@elliemae/ds-slider 1.60.0 → 2.0.0-alpha.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DSSlider.js +17 -29
- package/cjs/components/SliderImp.js +125 -156
- package/cjs/components/Thumb.js +40 -53
- package/cjs/components/TickMarks.js +25 -36
- package/cjs/components/TickMarksValues.js +25 -36
- package/cjs/components/Track.js +51 -43
- package/cjs/components/context.js +1 -2
- package/cjs/components/styled.js +25 -40
- package/cjs/components/utils.js +18 -19
- package/cjs/index.js +1 -25
- package/cjs/prop-types.js +3 -4
- package/esm/DSSlider.js +14 -26
- package/esm/components/SliderImp.js +122 -152
- package/esm/components/Thumb.js +36 -46
- package/esm/components/TickMarks.js +23 -34
- package/esm/components/TickMarksValues.js +23 -34
- package/esm/components/Track.js +47 -39
- package/esm/components/context.js +1 -2
- package/esm/components/styled.js +25 -40
- package/esm/components/utils.js +18 -19
- package/esm/index.js +0 -24
- package/esm/prop-types.js +3 -4
- package/package.json +73 -16
- package/types/DSSlider.d.ts +107 -0
- package/types/components/SliderImp.d.ts +3 -0
- package/types/components/Thumb.d.ts +14 -0
- package/types/components/TickMarks.d.ts +3 -0
- package/types/components/TickMarksValues.d.ts +3 -0
- package/types/components/Track.d.ts +6 -0
- package/types/components/context.d.ts +2 -0
- package/types/components/styled.d.ts +8 -0
- package/types/components/utils.d.ts +2 -0
- package/types/index.d.ts +2 -0
- package/types/prop-types.d.ts +122 -0
- package/DSSlider/package.json +0 -10
- package/cjs/DSSlider.js.map +0 -1
- package/cjs/components/SliderImp.js.map +0 -1
- package/cjs/components/Thumb.js.map +0 -1
- package/cjs/components/TickMarks.js.map +0 -1
- package/cjs/components/TickMarksValues.js.map +0 -1
- package/cjs/components/Track.js.map +0 -1
- package/cjs/components/context.js.map +0 -1
- package/cjs/components/styled.js.map +0 -1
- package/cjs/components/utils.js.map +0 -1
- package/cjs/index.js.map +0 -1
- package/cjs/prop-types.js.map +0 -1
- package/components/SliderImp/package.json +0 -10
- package/components/Thumb/package.json +0 -10
- package/components/TickMarks/package.json +0 -10
- package/components/TickMarksValues/package.json +0 -10
- package/components/Track/package.json +0 -10
- package/components/context/package.json +0 -10
- package/components/styled/package.json +0 -10
- package/components/utils/package.json +0 -10
- package/esm/DSSlider.js.map +0 -1
- package/esm/components/SliderImp.js.map +0 -1
- package/esm/components/Thumb.js.map +0 -1
- package/esm/components/TickMarks.js.map +0 -1
- package/esm/components/TickMarksValues.js.map +0 -1
- package/esm/components/Track.js.map +0 -1
- package/esm/components/context.js.map +0 -1
- package/esm/components/styled.js.map +0 -1
- package/esm/components/utils.js.map +0 -1
- package/esm/index.js.map +0 -1
- package/esm/prop-types.js.map +0 -1
- package/prop-types/package.json +0 -10
|
@@ -1,54 +1,43 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
|
+
require('core-js/modules/esnext.async-iterator.map.js');
|
|
5
|
+
require('core-js/modules/esnext.iterator.map.js');
|
|
3
6
|
var React = require('react');
|
|
4
7
|
var styled = require('styled-components');
|
|
5
8
|
var dsSystem = require('@elliemae/ds-system');
|
|
6
|
-
var
|
|
9
|
+
var context = require('./context.js');
|
|
7
10
|
|
|
8
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
12
|
|
|
10
|
-
var
|
|
13
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
11
14
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
15
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
}, [parsedValuesArray, sliderUUID, fullSelectedValues]);
|
|
32
|
-
var PureTickMArksValues = React.useMemo(function () {
|
|
33
|
-
return /*#__PURE__*/React__default['default'].createElement(TickMarksContainer, {
|
|
34
|
-
"data-testid": "slider-tick-marks-values"
|
|
35
|
-
}, TickMarksLabels);
|
|
36
|
-
}, [TickMarksLabels]);
|
|
16
|
+
const TickMarks = () => {
|
|
17
|
+
var _TickMarksContainer;
|
|
18
|
+
|
|
19
|
+
const {
|
|
20
|
+
parsedValuesArray,
|
|
21
|
+
fullSelectedValues,
|
|
22
|
+
sliderUUID
|
|
23
|
+
} = React.useContext(context.SliderContext);
|
|
24
|
+
const TickMarksLabels = React.useMemo(() => parsedValuesArray.map(value => {
|
|
25
|
+
const isSelected = fullSelectedValues.findIndex(selectedVal => selectedVal === value) >= 0;
|
|
26
|
+
return /*#__PURE__*/_jsx__default["default"](TickMarkValue, {
|
|
27
|
+
isSelected: isSelected
|
|
28
|
+
}, "".concat(sliderUUID, "-").concat(value), value);
|
|
29
|
+
}), [parsedValuesArray, sliderUUID, fullSelectedValues]);
|
|
30
|
+
const PureTickMArksValues = React.useMemo(() => _TickMarksContainer || (_TickMarksContainer = /*#__PURE__*/_jsx__default["default"](TickMarksContainer, {
|
|
31
|
+
"data-testid": "slider-tick-marks-values"
|
|
32
|
+
}, void 0, TickMarksLabels)), [TickMarksLabels]);
|
|
37
33
|
return PureTickMArksValues;
|
|
38
34
|
};
|
|
39
35
|
|
|
40
|
-
|
|
36
|
+
const TickMarkValue = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
41
37
|
componentId: "sc-lq3yel-0"
|
|
42
|
-
})(["margin:", " 0;overflow:visible;transform:translateX(-100%);width:", ";color:", ";"],
|
|
43
|
-
|
|
44
|
-
}, function (props) {
|
|
45
|
-
return dsSystem.__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs);
|
|
46
|
-
}, function (props) {
|
|
47
|
-
return props.isSelected ? props.theme.colors.neutral[800] : props.theme.colors.neutral[500];
|
|
48
|
-
});
|
|
49
|
-
var TickMarksContainer = /*#__PURE__*/styled__default['default'].div.withConfig({
|
|
38
|
+
})(["margin:", " 0;overflow:visible;transform:translateX(-100%);width:", ";color:", ";"], props => dsSystem.__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.s), props => dsSystem.__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs), props => props.isSelected ? props.theme.colors.neutral[800] : props.theme.colors.neutral[500]);
|
|
39
|
+
const TickMarksContainer = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
50
40
|
componentId: "sc-lq3yel-1"
|
|
51
41
|
})(["display:flex;justify-content:space-between;"]);
|
|
52
42
|
|
|
53
43
|
module.exports = TickMarks;
|
|
54
|
-
//# sourceMappingURL=TickMarksValues.js.map
|
package/cjs/components/Track.js
CHANGED
|
@@ -1,59 +1,67 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
4
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
5
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
9
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
10
|
var React = require('react');
|
|
5
11
|
var reactRange = require('react-range');
|
|
6
12
|
var styled = require('styled-components');
|
|
7
13
|
var dsSystem = require('@elliemae/ds-system');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
14
|
+
var TickMarks = require('./TickMarks.js');
|
|
15
|
+
var TickMarksValues = require('./TickMarksValues.js');
|
|
16
|
+
var context = require('./context.js');
|
|
17
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
11
18
|
|
|
12
19
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
20
|
|
|
14
|
-
var
|
|
15
|
-
var
|
|
21
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
22
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
16
23
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
17
24
|
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
25
|
+
var _TickMarks, _TickMarksValues;
|
|
26
|
+
|
|
27
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
28
|
+
|
|
29
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
30
|
+
|
|
31
|
+
const Track = _ref => {
|
|
32
|
+
let {
|
|
33
|
+
children,
|
|
34
|
+
props
|
|
35
|
+
} = _ref;
|
|
36
|
+
const {
|
|
37
|
+
disabled,
|
|
38
|
+
minValue,
|
|
39
|
+
maxValue,
|
|
40
|
+
rangeValues,
|
|
41
|
+
withTickMarks,
|
|
42
|
+
withTickMarksValues,
|
|
43
|
+
withTwoHandles
|
|
44
|
+
} = React.useContext(context.SliderContext);
|
|
45
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
46
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(TrackStyled, _objectSpread(_objectSpread({}, props), {}, {
|
|
47
|
+
// This is needed because it's received from the library
|
|
48
|
+
disabled: disabled,
|
|
49
|
+
minValue: minValue,
|
|
50
|
+
maxValue: maxValue,
|
|
51
|
+
rangeValues: rangeValues,
|
|
52
|
+
withTwoHandles: withTwoHandles,
|
|
53
|
+
children: [children, withTickMarks && !disabled && (_TickMarks || (_TickMarks = /*#__PURE__*/_jsx__default["default"](TickMarks, {})))]
|
|
54
|
+
})), withTickMarksValues && (_TickMarksValues || (_TickMarksValues = /*#__PURE__*/_jsx__default["default"](TickMarksValues, {})))]
|
|
55
|
+
});
|
|
39
56
|
};
|
|
40
57
|
|
|
41
|
-
|
|
58
|
+
const TrackStyled = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
42
59
|
componentId: "sc-13fbuj5-0"
|
|
43
|
-
})(["position:relative;height:", ";width:100%;min-width:", ";border-radius:", ";background:", ";"],
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}, function (props) {
|
|
50
|
-
return props.disabled ? props.theme.colors.neutral[100] : reactRange.getTrackBackground({
|
|
51
|
-
values: props.rangeValues,
|
|
52
|
-
colors: props.withTwoHandles ? [props.theme.colors.neutral[100], props.theme.colors.brand[600], props.theme.colors.neutral[100]] : [props.theme.colors.brand[600], props.theme.colors.neutral[100]],
|
|
53
|
-
min: props.minValue,
|
|
54
|
-
max: props.maxValue
|
|
55
|
-
});
|
|
56
|
-
});
|
|
60
|
+
})(["position:relative;height:", ";width:100%;min-width:", ";border-radius:", ";background:", ";"], props => dsSystem.__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs), props => dsSystem.__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxl), props => dsSystem.__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs), props => props.disabled ? props.theme.colors.neutral[100] : reactRange.getTrackBackground({
|
|
61
|
+
values: props.rangeValues,
|
|
62
|
+
colors: props.withTwoHandles ? [props.theme.colors.neutral[100], props.theme.colors.brand[600], props.theme.colors.neutral[100]] : [props.theme.colors.brand[600], props.theme.colors.neutral[100]],
|
|
63
|
+
min: props.minValue,
|
|
64
|
+
max: props.maxValue
|
|
65
|
+
}));
|
|
57
66
|
|
|
58
67
|
module.exports = Track;
|
|
59
|
-
//# sourceMappingURL=Track.js.map
|
|
@@ -8,7 +8,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
8
8
|
|
|
9
9
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
const SliderContext = /*#__PURE__*/React__default["default"].createContext();
|
|
12
12
|
|
|
13
13
|
exports.SliderContext = SliderContext;
|
|
14
|
-
//# sourceMappingURL=context.js.map
|
package/cjs/components/styled.js
CHANGED
|
@@ -11,58 +11,44 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
11
11
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
12
|
|
|
13
13
|
/* eslint-disable indent */
|
|
14
|
-
|
|
14
|
+
const ThumbStyled = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
15
15
|
componentId: "sc-24in0j-0"
|
|
16
|
-
})(["height:20px;width:20px;background-color:", ";border-radius:10px;border:1px solid ", ";:focus{border:1px solid ", ";outline:unset;}:hover{background-color:", ";}"],
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
return props.theme.colors.brand[600];
|
|
22
|
-
}, function (_ref) {
|
|
23
|
-
var disabled = _ref.disabled,
|
|
24
|
-
theme = _ref.theme;
|
|
16
|
+
})(["height:20px;width:20px;background-color:", ";border-radius:10px;border:1px solid ", ";:focus{border:1px solid ", ";outline:unset;}:hover{background-color:", ";}"], props => props.disabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral['000'], props => props.disabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral[400], props => props.theme.colors.brand[600], _ref => {
|
|
17
|
+
let {
|
|
18
|
+
disabled,
|
|
19
|
+
theme
|
|
20
|
+
} = _ref;
|
|
25
21
|
return disabled ? theme.colors.neutral[100] : theme.colors.brand[200];
|
|
26
22
|
});
|
|
27
|
-
|
|
23
|
+
const TooltipContainerStyled = /*#__PURE__*/styled__default["default"](dsTooltip.TooltipContainer).withConfig({
|
|
28
24
|
componentId: "sc-24in0j-1"
|
|
29
|
-
})(["position:relative;display:flex;align-items:center;flex-direction:column;top:-35px;width:max-content;left:50%;transform:translateX(-50%);visibility:", ";"],
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
})(["position:relative;display:flex;align-items:center;flex-direction:column;top:-35px;width:max-content;left:50%;transform:translateX(-50%);visibility:", ";"], _ref2 => {
|
|
26
|
+
let {
|
|
27
|
+
isDragged,
|
|
28
|
+
isHovered
|
|
29
|
+
} = _ref2;
|
|
32
30
|
return isDragged || isHovered ? 'visible' : 'hidden';
|
|
33
31
|
}); // TODO: didn't work with DSTooltip, see how to improve
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
const TooltipArrow = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
36
34
|
componentId: "sc-24in0j-2"
|
|
37
|
-
})(["position:absolute;width:0;height:0;top:20px;border-left:calc(", " * 2.5) solid transparent;border-right:calc(", " * 2.5) solid transparent;border-top:calc(", " * 2.5) solid ", ";"],
|
|
38
|
-
|
|
39
|
-
}, function (props) {
|
|
40
|
-
return dsSystem.__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs);
|
|
41
|
-
}, function (props) {
|
|
42
|
-
return dsSystem.__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs);
|
|
43
|
-
}, function (props) {
|
|
44
|
-
return props.theme.colors.neutral[0];
|
|
45
|
-
});
|
|
46
|
-
var LabelWrapper = /*#__PURE__*/styled__default['default'].div.withConfig({
|
|
35
|
+
})(["position:absolute;width:0;height:0;top:20px;border-left:calc(", " * 2.5) solid transparent;border-right:calc(", " * 2.5) solid transparent;border-top:calc(", " * 2.5) solid ", ";"], props => dsSystem.__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs), props => dsSystem.__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs), props => dsSystem.__UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs), props => props.theme.colors.neutral[0]);
|
|
36
|
+
const LabelWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
47
37
|
componentId: "sc-24in0j-3"
|
|
48
|
-
})(["margin-bottom:", ";max-width:100%;width:", ";"],
|
|
49
|
-
|
|
50
|
-
}, function (props) {
|
|
51
|
-
return "".concat(props.width || 0, "px");
|
|
52
|
-
});
|
|
53
|
-
var LabelText = /*#__PURE__*/styled__default['default'].span.withConfig({
|
|
38
|
+
})(["margin-bottom:", ";max-width:100%;width:", ";"], props => props.theme.space.xxs, props => "".concat(props.width || 0, "px"));
|
|
39
|
+
const LabelText = /*#__PURE__*/styled__default["default"].span.withConfig({
|
|
54
40
|
componentId: "sc-24in0j-4"
|
|
55
|
-
})(["color:", ";"],
|
|
56
|
-
|
|
57
|
-
});
|
|
58
|
-
var ValueText = /*#__PURE__*/styled__default['default'].span.withConfig({
|
|
41
|
+
})(["color:", ";"], props => props.theme.colors.neutral[600]);
|
|
42
|
+
const ValueText = /*#__PURE__*/styled__default["default"].span.withConfig({
|
|
59
43
|
componentId: "sc-24in0j-5"
|
|
60
|
-
})(["color:", ";"],
|
|
61
|
-
|
|
62
|
-
|
|
44
|
+
})(["color:", ";"], _ref3 => {
|
|
45
|
+
let {
|
|
46
|
+
disabled,
|
|
47
|
+
theme
|
|
48
|
+
} = _ref3;
|
|
63
49
|
return theme.colors.neutral[disabled ? 500 : 800];
|
|
64
50
|
});
|
|
65
|
-
|
|
51
|
+
const StyledRangeWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
66
52
|
componentId: "sc-24in0j-6"
|
|
67
53
|
})(["min-height:28px;margin:0 10px;"]);
|
|
68
54
|
|
|
@@ -73,4 +59,3 @@ exports.ThumbStyled = ThumbStyled;
|
|
|
73
59
|
exports.TooltipArrow = TooltipArrow;
|
|
74
60
|
exports.TooltipContainerStyled = TooltipContainerStyled;
|
|
75
61
|
exports.ValueText = ValueText;
|
|
76
|
-
//# sourceMappingURL=styled.js.map
|
package/cjs/components/utils.js
CHANGED
|
@@ -5,19 +5,19 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var dsUtilities = require('@elliemae/ds-utilities');
|
|
6
6
|
|
|
7
7
|
/* eslint-disable max-params */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
const conformedLabel = function (rangeValues) {
|
|
9
|
+
let label = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
10
|
+
let labelWithValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
11
|
+
let withTwoHandles = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
12
|
+
let customTickMarksValues = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
13
|
+
let step = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
|
|
14
|
+
let minValue = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;
|
|
15
|
+
const msg = label.trim();
|
|
16
|
+
let value = '';
|
|
17
17
|
|
|
18
18
|
if (!dsUtilities.isEmpty(customTickMarksValues) && labelWithValue && label) {
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
const firstValue = customTickMarksValues[(rangeValues[0] - minValue) / step];
|
|
20
|
+
const secondValue = customTickMarksValues[(rangeValues[1] - minValue) / step];
|
|
21
21
|
value = "".concat(firstValue || rangeValues[0].toFixed(1), " ").concat(withTwoHandles ? ", ".concat(secondValue || rangeValues[1].toFixed(1)) : '', " ");
|
|
22
22
|
} else if (labelWithValue && label) {
|
|
23
23
|
var _rangeValues$;
|
|
@@ -28,15 +28,15 @@ var conformedLabel = function conformedLabel(rangeValues) {
|
|
|
28
28
|
value = value.trim();
|
|
29
29
|
return [msg, value];
|
|
30
30
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
const conformedThumbLabel = function (rangeValues) {
|
|
32
|
+
let customTickMarksValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
33
|
+
let index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
34
|
+
let step = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
|
|
35
|
+
let minValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
36
|
+
let msg = "Value: ";
|
|
37
37
|
|
|
38
38
|
if (!dsUtilities.isEmpty(customTickMarksValues)) {
|
|
39
|
-
|
|
39
|
+
const foundValue = customTickMarksValues[(rangeValues[index] - minValue) / step];
|
|
40
40
|
msg += "".concat(foundValue || rangeValues[index].toFixed(1));
|
|
41
41
|
} else {
|
|
42
42
|
msg += "".concat(rangeValues[index].toFixed(1));
|
|
@@ -47,4 +47,3 @@ var conformedThumbLabel = function conformedThumbLabel(rangeValues) {
|
|
|
47
47
|
|
|
48
48
|
exports.conformedLabel = conformedLabel;
|
|
49
49
|
exports.conformedThumbLabel = conformedThumbLabel;
|
|
50
|
-
//# sourceMappingURL=utils.js.map
|
package/cjs/index.js
CHANGED
|
@@ -3,33 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var DSSlider = require('./DSSlider.js');
|
|
6
|
-
require('react');
|
|
7
|
-
require('react-desc');
|
|
8
|
-
require('./components/SliderImp.js');
|
|
9
|
-
require('@babel/runtime/helpers/slicedToArray');
|
|
10
|
-
require('uuid');
|
|
11
|
-
require('react-range');
|
|
12
|
-
require('@elliemae/ds-utilities');
|
|
13
|
-
require('@elliemae/ds-truncated-tooltip-text');
|
|
14
|
-
require('@elliemae/ds-grid');
|
|
15
|
-
require('./components/Track.js');
|
|
16
|
-
require('@babel/runtime/helpers/extends');
|
|
17
|
-
require('styled-components');
|
|
18
|
-
require('@elliemae/ds-system');
|
|
19
|
-
require('./components/TickMarks.js');
|
|
20
|
-
require('./components/context.js');
|
|
21
|
-
require('./components/TickMarksValues.js');
|
|
22
|
-
require('./components/Thumb.js');
|
|
23
|
-
require('@babel/runtime/helpers/defineProperty');
|
|
24
|
-
require('prop-types');
|
|
25
|
-
require('@elliemae/ds-tooltip');
|
|
26
|
-
require('./components/utils.js');
|
|
27
|
-
require('./components/styled.js');
|
|
28
|
-
require('./prop-types.js');
|
|
29
6
|
|
|
30
7
|
|
|
31
8
|
|
|
32
9
|
exports.DSSlider = DSSlider.DSSlider;
|
|
33
10
|
exports.DSSliderWithSchema = DSSlider.DSSliderWithSchema;
|
|
34
|
-
exports
|
|
35
|
-
//# sourceMappingURL=index.js.map
|
|
11
|
+
exports["default"] = DSSlider.DSSlider;
|
package/cjs/prop-types.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var reactDesc = require('react-desc');
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
const defaultProps = {
|
|
8
8
|
containerProps: {},
|
|
9
9
|
disabled: false,
|
|
10
10
|
label: '',
|
|
@@ -12,14 +12,14 @@ var defaultProps = {
|
|
|
12
12
|
minValue: 0,
|
|
13
13
|
maxValue: 100,
|
|
14
14
|
step: 5,
|
|
15
|
-
onChange:
|
|
15
|
+
onChange: () => {},
|
|
16
16
|
withTickMarks: false,
|
|
17
17
|
withTickMarksValues: false,
|
|
18
18
|
withTwoHandles: false,
|
|
19
19
|
customTickMarksValues: [],
|
|
20
20
|
zIndex: 0
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
const sliderPropTypes = {
|
|
23
23
|
/** props to inject to slider wrapper */
|
|
24
24
|
containerProps: reactDesc.PropTypes.shape({}).description('props to inject to slider wrapper'),
|
|
25
25
|
|
|
@@ -62,4 +62,3 @@ var sliderPropTypes = {
|
|
|
62
62
|
|
|
63
63
|
exports.defaultProps = defaultProps;
|
|
64
64
|
exports.sliderPropTypes = sliderPropTypes;
|
|
65
|
-
//# sourceMappingURL=prop-types.js.map
|
package/esm/DSSlider.js
CHANGED
|
@@ -1,35 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import 'react';
|
|
2
8
|
import { describe } from 'react-desc';
|
|
3
9
|
import SliderImp from './components/SliderImp.js';
|
|
4
10
|
import { sliderPropTypes, defaultProps } from './prop-types.js';
|
|
5
|
-
import '
|
|
6
|
-
import 'uuid';
|
|
7
|
-
import 'react-range';
|
|
8
|
-
import '@elliemae/ds-utilities';
|
|
9
|
-
import '@elliemae/ds-truncated-tooltip-text';
|
|
10
|
-
import '@elliemae/ds-grid';
|
|
11
|
-
import './components/Track.js';
|
|
12
|
-
import '@babel/runtime/helpers/esm/extends';
|
|
13
|
-
import 'styled-components';
|
|
14
|
-
import '@elliemae/ds-system';
|
|
15
|
-
import './components/TickMarks.js';
|
|
16
|
-
import './components/context.js';
|
|
17
|
-
import './components/TickMarksValues.js';
|
|
18
|
-
import './components/Thumb.js';
|
|
19
|
-
import '@babel/runtime/helpers/esm/defineProperty';
|
|
20
|
-
import 'prop-types';
|
|
21
|
-
import '@elliemae/ds-tooltip';
|
|
22
|
-
import './components/utils.js';
|
|
23
|
-
import './components/styled.js';
|
|
11
|
+
import { jsx } from 'react/jsx-runtime';
|
|
24
12
|
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
};
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
16
|
+
|
|
17
|
+
const DSSlider = props => /*#__PURE__*/jsx(SliderImp, _objectSpread({}, props));
|
|
28
18
|
|
|
29
19
|
DSSlider.defaultProps = defaultProps;
|
|
30
|
-
|
|
31
|
-
var DSSliderWithSchema = describe(DSSlider);
|
|
20
|
+
const DSSliderWithSchema = describe(DSSlider);
|
|
32
21
|
DSSliderWithSchema.propTypes = sliderPropTypes;
|
|
33
22
|
|
|
34
23
|
export { DSSlider, DSSliderWithSchema, DSSlider as default };
|
|
35
|
-
//# sourceMappingURL=DSSlider.js.map
|