* If not specified, set to undefined.
(opt: RangeOption)
| 473 | * If not specified, set to undefined. |
| 474 | */ |
| 475 | setRawRange(opt: RangeOption): void { |
| 476 | const thisOption = this.option; |
| 477 | const settledOption = this.settledOption; |
| 478 | each([['start', 'startValue'], ['end', 'endValue']] as const, function (names) { |
| 479 | // Consider the pair <start, startValue>: |
| 480 | // If one has value and the other one is `null/undefined`, we both set them |
| 481 | // to `settledOption`. This strategy enables the feature to clear the original |
| 482 | // value in `settledOption` to `null/undefined`. |
| 483 | // But if both of them are `null/undefined`, we do not set them to `settledOption` |
| 484 | // and keep `settledOption` with the original value. This strategy enables users to |
| 485 | // only set <end or endValue> but not set <start or startValue> when calling |
| 486 | // `dispatchAction`. |
| 487 | // The pair <end, endValue> is treated in the same way. |
| 488 | if (opt[names[0]] != null || opt[names[1]] != null) { |
| 489 | thisOption[names[0]] = settledOption[names[0]] = opt[names[0]]; |
| 490 | thisOption[names[1]] = settledOption[names[1]] = opt[names[1]]; |
| 491 | } |
| 492 | }, this); |
| 493 | |
| 494 | this._updateRangeUse(opt); |
| 495 | } |
| 496 | |
| 497 | setCalculatedRange(opt: RangeOption): void { |
| 498 | const option = this.option; |
no test coverage detected