Skip to content

Commit

Permalink
Merge pull request #14775 from dileepyelleti/fix-14412
Browse files Browse the repository at this point in the history
fix(dataZoom): type fix for startValue and endValue. close #14412
  • Loading branch information
pissang authored May 12, 2021
2 parents 0ac6f31 + 23a2f7f commit f97b7fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
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

0 comments on commit f97b7fa

Please sign in to comment.