Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dataZoom): type fix for startValue and endValue. close #14412 #14775

Merged
merged 2 commits into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/component/dataZoom/AxisProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ class AxisProxy {
calculateDataWindow(opt?: {
start?: number
end?: number
startValue?: number
endValue?: number
startValue?: number | string | Date
endValue?: number | string | Date
}) {
const dataExtent = this._dataExtent;
const axisModel = this.getAxisModel();
Expand Down
8 changes: 4 additions & 4 deletions src/component/dataZoom/DataZoomModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ export interface DataZoomOption extends ComponentOption {
/**
* Start value. If startValue specified, start is ignored
*/
startValue?: number
startValue?: number | string | Date
/**
* End value. If endValue specified, end is ignored.
*/
endValue?: number
endValue?: number | string | Date
/**
* Min span percent, 0 - 100
* The range of dataZoom can not be smaller than that.
Expand Down Expand Up @@ -507,7 +507,7 @@ class DataZoomModel<Opts extends DataZoomOption = DataZoomOption> extends Compon
setCalculatedRange(opt: RangeOption): void {
const option = this.option;
each(['start', 'startValue', 'end', 'endValue'] as const, function (name) {
option[name] = opt[name];
(option as any)[name] = opt[name];
});
}

Expand Down Expand Up @@ -590,7 +590,7 @@ function retrieveRawOption<T extends DataZoomOption>(option: T) {
each(
['start', 'end', 'startValue', 'endValue', 'throttle'] as const,
function (name) {
option.hasOwnProperty(name) && (ret[name] = option[name]);
option.hasOwnProperty(name) && ((ret as any)[name] = option[name]);
}
);
return ret;
Expand Down