UNPKG

2.17 kBJavaScriptView Raw
1/*
2 * Copyright 2016 Palantir Technologies, Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16import { __assign, __decorate, __extends, __rest } from "tslib";
17import * as React from "react";
18import { polyfill } from "react-lifecycles-compat";
19import { AbstractPureComponent2, Intent } from "../../common";
20import { DISPLAYNAME_PREFIX } from "../../common/props";
21import { MultiSlider } from "./multiSlider";
22var Slider = /** @class */ (function (_super) {
23 __extends(Slider, _super);
24 function Slider() {
25 return _super !== null && _super.apply(this, arguments) || this;
26 }
27 Slider.prototype.render = function () {
28 var _a = this.props, initialValue = _a.initialValue, intent = _a.intent, value = _a.value, onChange = _a.onChange, onRelease = _a.onRelease, props = __rest(_a, ["initialValue", "intent", "value", "onChange", "onRelease"]);
29 return (React.createElement(MultiSlider, __assign({}, props),
30 React.createElement(MultiSlider.Handle, { value: value, intentAfter: value < initialValue ? intent : undefined, intentBefore: value >= initialValue ? intent : undefined, onChange: onChange, onRelease: onRelease }),
31 React.createElement(MultiSlider.Handle, { value: initialValue, interactionKind: "none" })));
32 };
33 Slider.defaultProps = __assign(__assign({}, MultiSlider.defaultSliderProps), { initialValue: 0, intent: Intent.PRIMARY, value: 0 });
34 Slider.displayName = DISPLAYNAME_PREFIX + ".Slider";
35 Slider = __decorate([
36 polyfill
37 ], Slider);
38 return Slider;
39}(AbstractPureComponent2));
40export { Slider };
41//# sourceMappingURL=slider.js.map
\No newline at end of file