1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | exports.RangeSlider = void 0;
|
19 | var tslib_1 = require("tslib");
|
20 | var React = tslib_1.__importStar(require("react"));
|
21 | var common_1 = require("../../common");
|
22 | var Errors = tslib_1.__importStar(require("../../common/errors"));
|
23 | var props_1 = require("../../common/props");
|
24 | var multiSlider_1 = require("./multiSlider");
|
25 | var RangeIndex;
|
26 | (function (RangeIndex) {
|
27 | RangeIndex[RangeIndex["START"] = 0] = "START";
|
28 | RangeIndex[RangeIndex["END"] = 1] = "END";
|
29 | })(RangeIndex || (RangeIndex = {}));
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | var RangeSlider = (function (_super) {
|
36 | tslib_1.__extends(RangeSlider, _super);
|
37 | function RangeSlider() {
|
38 | return _super !== null && _super.apply(this, arguments) || this;
|
39 | }
|
40 | RangeSlider.prototype.render = function () {
|
41 | var _a = this.props, value = _a.value, handleHtmlProps = _a.handleHtmlProps, props = tslib_1.__rest(_a, ["value", "handleHtmlProps"]);
|
42 | return (React.createElement(multiSlider_1.MultiSlider, tslib_1.__assign({}, props),
|
43 | React.createElement(multiSlider_1.MultiSlider.Handle, { value: value[RangeIndex.START], type: "start", intentAfter: props.intent, htmlProps: handleHtmlProps === null || handleHtmlProps === void 0 ? void 0 : handleHtmlProps.start }),
|
44 | React.createElement(multiSlider_1.MultiSlider.Handle, { value: value[RangeIndex.END], type: "end", htmlProps: handleHtmlProps === null || handleHtmlProps === void 0 ? void 0 : handleHtmlProps.end })));
|
45 | };
|
46 | RangeSlider.prototype.validateProps = function (props) {
|
47 | var value = props.value;
|
48 | if (value == null || value[RangeIndex.START] == null || value[RangeIndex.END] == null) {
|
49 | throw new Error(Errors.RANGESLIDER_NULL_VALUE);
|
50 | }
|
51 | };
|
52 | RangeSlider.defaultProps = tslib_1.__assign(tslib_1.__assign({}, multiSlider_1.MultiSlider.defaultSliderProps), { intent: common_1.Intent.PRIMARY, value: [0, 10] });
|
53 | RangeSlider.displayName = "".concat(props_1.DISPLAYNAME_PREFIX, ".RangeSlider");
|
54 | return RangeSlider;
|
55 | }(common_1.AbstractPureComponent2));
|
56 | exports.RangeSlider = RangeSlider;
|
57 |
|
\ | No newline at end of file |