@elliemae/ds-slider 2.0.0-alpha.10 → 2.0.0-alpha.11
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/components/SliderImp.js +2 -1
- package/cjs/components/Thumb.js +1 -0
- package/cjs/components/TickMarksValues.js +1 -1
- package/cjs/components/styled.js +1 -1
- package/cjs/components/utils.js +5 -5
- package/esm/components/SliderImp.js +2 -1
- package/esm/components/Thumb.js +1 -0
- package/esm/components/TickMarksValues.js +1 -1
- package/esm/components/styled.js +1 -1
- package/esm/components/utils.js +5 -5
- package/package.json +6 -6
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var uuid = require('uuid');
|
|
6
7
|
var reactRange = require('react-range');
|
|
@@ -185,7 +186,7 @@ const SliderImp = props => {
|
|
|
185
186
|
props: thumbProps,
|
|
186
187
|
isDragged: isDragged,
|
|
187
188
|
index: index
|
|
188
|
-
},
|
|
189
|
+
}, "".concat(sliderUUID, "-").concat(thumbProps.key));
|
|
189
190
|
},
|
|
190
191
|
allowOverlap: false
|
|
191
192
|
}))))
|
package/cjs/components/Thumb.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
4
4
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
5
6
|
var React = require('react');
|
|
6
7
|
var dsTooltip = require('@elliemae/ds-tooltip');
|
|
7
8
|
var context = require('./context.js');
|
|
@@ -23,7 +23,7 @@ const TickMarks = () => {
|
|
|
23
23
|
const isSelected = fullSelectedValues.findIndex(selectedVal => selectedVal === value) >= 0;
|
|
24
24
|
return /*#__PURE__*/_jsx__default["default"](TickMarkValue, {
|
|
25
25
|
isSelected: isSelected
|
|
26
|
-
},
|
|
26
|
+
}, "".concat(sliderUUID, "-").concat(value), value);
|
|
27
27
|
}), [parsedValuesArray, sliderUUID, fullSelectedValues]);
|
|
28
28
|
const PureTickMArksValues = React.useMemo(() => _TickMarksContainer || (_TickMarksContainer = /*#__PURE__*/_jsx__default["default"](TickMarksContainer, {
|
|
29
29
|
"data-testid": "slider-tick-marks-values"
|
package/cjs/components/styled.js
CHANGED
|
@@ -29,7 +29,7 @@ const TooltipArrow = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
|
29
29
|
})(["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]);
|
|
30
30
|
const LabelWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
31
31
|
componentId: "sc-24in0j-3"
|
|
32
|
-
})(["margin-bottom:", ";max-width:100%;width:", ";"], props => props.theme.space.xxs, props =>
|
|
32
|
+
})(["margin-bottom:", ";max-width:100%;width:", ";"], props => props.theme.space.xxs, props => "".concat(props.width || 0, "px"));
|
|
33
33
|
const LabelText = /*#__PURE__*/styled__default["default"].span.withConfig({
|
|
34
34
|
componentId: "sc-24in0j-4"
|
|
35
35
|
})(["color:", ";"], props => props.theme.colors.neutral[600]);
|
package/cjs/components/utils.js
CHANGED
|
@@ -12,24 +12,24 @@ const conformedLabel = (rangeValues, label = '', labelWithValue = false, withTwo
|
|
|
12
12
|
if (!utils.isEmpty(customTickMarksValues) && labelWithValue && label) {
|
|
13
13
|
const firstValue = customTickMarksValues[(rangeValues[0] - minValue) / step];
|
|
14
14
|
const secondValue = customTickMarksValues[(rangeValues[1] - minValue) / step];
|
|
15
|
-
value =
|
|
15
|
+
value = "".concat(firstValue || rangeValues[0].toFixed(1), " ").concat(withTwoHandles ? ", ".concat(secondValue || rangeValues[1].toFixed(1)) : '', " ");
|
|
16
16
|
} else if (labelWithValue && label) {
|
|
17
17
|
var _rangeValues$;
|
|
18
18
|
|
|
19
|
-
value =
|
|
19
|
+
value = "".concat(rangeValues[0].toFixed(1), " ").concat(withTwoHandles ? ", ".concat((_rangeValues$ = rangeValues[1]) === null || _rangeValues$ === void 0 ? void 0 : _rangeValues$.toFixed(1)) : '', " ");
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
value = value.trim();
|
|
23
23
|
return [msg, value];
|
|
24
24
|
};
|
|
25
25
|
const conformedThumbLabel = (rangeValues, customTickMarksValues = [], index = 0, step = 1, minValue = 0) => {
|
|
26
|
-
let msg =
|
|
26
|
+
let msg = "Value: ";
|
|
27
27
|
|
|
28
28
|
if (!utils.isEmpty(customTickMarksValues)) {
|
|
29
29
|
const foundValue = customTickMarksValues[(rangeValues[index] - minValue) / step];
|
|
30
|
-
msg +=
|
|
30
|
+
msg += "".concat(foundValue || rangeValues[index].toFixed(1));
|
|
31
31
|
} else {
|
|
32
|
-
msg +=
|
|
32
|
+
msg += "".concat(rangeValues[index].toFixed(1));
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
return msg;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
3
|
import { useRef, useState, useMemo, useEffect } from 'react';
|
|
3
4
|
import { v4 } from 'uuid';
|
|
4
5
|
import { Range } from 'react-range';
|
|
@@ -177,7 +178,7 @@ const SliderImp = props => {
|
|
|
177
178
|
props: thumbProps,
|
|
178
179
|
isDragged: isDragged,
|
|
179
180
|
index: index
|
|
180
|
-
},
|
|
181
|
+
}, "".concat(sliderUUID, "-").concat(thumbProps.key));
|
|
181
182
|
},
|
|
182
183
|
allowOverlap: false
|
|
183
184
|
}))))
|
package/esm/components/Thumb.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
4
|
import { useState, useContext } from 'react';
|
|
4
5
|
import { TooltipText } from '@elliemae/ds-tooltip';
|
|
5
6
|
import { SliderContext } from './context.js';
|
|
@@ -16,7 +16,7 @@ const TickMarks = () => {
|
|
|
16
16
|
const isSelected = fullSelectedValues.findIndex(selectedVal => selectedVal === value) >= 0;
|
|
17
17
|
return /*#__PURE__*/_jsx(TickMarkValue, {
|
|
18
18
|
isSelected: isSelected
|
|
19
|
-
},
|
|
19
|
+
}, "".concat(sliderUUID, "-").concat(value), value);
|
|
20
20
|
}), [parsedValuesArray, sliderUUID, fullSelectedValues]);
|
|
21
21
|
const PureTickMArksValues = useMemo(() => _TickMarksContainer || (_TickMarksContainer = /*#__PURE__*/_jsx(TickMarksContainer, {
|
|
22
22
|
"data-testid": "slider-tick-marks-values"
|
package/esm/components/styled.js
CHANGED
|
@@ -21,7 +21,7 @@ const TooltipArrow = /*#__PURE__*/styled.div.withConfig({
|
|
|
21
21
|
})(["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 => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs), props => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs), props => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs), props => props.theme.colors.neutral[0]);
|
|
22
22
|
const LabelWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
23
23
|
componentId: "sc-24in0j-3"
|
|
24
|
-
})(["margin-bottom:", ";max-width:100%;width:", ";"], props => props.theme.space.xxs, props =>
|
|
24
|
+
})(["margin-bottom:", ";max-width:100%;width:", ";"], props => props.theme.space.xxs, props => "".concat(props.width || 0, "px"));
|
|
25
25
|
const LabelText = /*#__PURE__*/styled.span.withConfig({
|
|
26
26
|
componentId: "sc-24in0j-4"
|
|
27
27
|
})(["color:", ";"], props => props.theme.colors.neutral[600]);
|
package/esm/components/utils.js
CHANGED
|
@@ -8,24 +8,24 @@ const conformedLabel = (rangeValues, label = '', labelWithValue = false, withTwo
|
|
|
8
8
|
if (!isEmpty(customTickMarksValues) && labelWithValue && label) {
|
|
9
9
|
const firstValue = customTickMarksValues[(rangeValues[0] - minValue) / step];
|
|
10
10
|
const secondValue = customTickMarksValues[(rangeValues[1] - minValue) / step];
|
|
11
|
-
value =
|
|
11
|
+
value = "".concat(firstValue || rangeValues[0].toFixed(1), " ").concat(withTwoHandles ? ", ".concat(secondValue || rangeValues[1].toFixed(1)) : '', " ");
|
|
12
12
|
} else if (labelWithValue && label) {
|
|
13
13
|
var _rangeValues$;
|
|
14
14
|
|
|
15
|
-
value =
|
|
15
|
+
value = "".concat(rangeValues[0].toFixed(1), " ").concat(withTwoHandles ? ", ".concat((_rangeValues$ = rangeValues[1]) === null || _rangeValues$ === void 0 ? void 0 : _rangeValues$.toFixed(1)) : '', " ");
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
value = value.trim();
|
|
19
19
|
return [msg, value];
|
|
20
20
|
};
|
|
21
21
|
const conformedThumbLabel = (rangeValues, customTickMarksValues = [], index = 0, step = 1, minValue = 0) => {
|
|
22
|
-
let msg =
|
|
22
|
+
let msg = "Value: ";
|
|
23
23
|
|
|
24
24
|
if (!isEmpty(customTickMarksValues)) {
|
|
25
25
|
const foundValue = customTickMarksValues[(rangeValues[index] - minValue) / step];
|
|
26
|
-
msg +=
|
|
26
|
+
msg += "".concat(foundValue || rangeValues[index].toFixed(1));
|
|
27
27
|
} else {
|
|
28
|
-
msg +=
|
|
28
|
+
msg += "".concat(rangeValues[index].toFixed(1));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
return msg;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-slider",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.11",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Slider",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -72,11 +72,11 @@
|
|
|
72
72
|
"build": "node ../../scripts/build/build.js"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
-
"@elliemae/ds-grid": "2.0.0-alpha.
|
|
76
|
-
"@elliemae/ds-system": "2.0.0-alpha.
|
|
77
|
-
"@elliemae/ds-tooltip": "2.0.0-alpha.
|
|
78
|
-
"@elliemae/ds-truncated-tooltip-text": "2.0.0-alpha.
|
|
79
|
-
"@elliemae/ds-utilities": "2.0.0-alpha.
|
|
75
|
+
"@elliemae/ds-grid": "2.0.0-alpha.11",
|
|
76
|
+
"@elliemae/ds-system": "2.0.0-alpha.11",
|
|
77
|
+
"@elliemae/ds-tooltip": "2.0.0-alpha.11",
|
|
78
|
+
"@elliemae/ds-truncated-tooltip-text": "2.0.0-alpha.11",
|
|
79
|
+
"@elliemae/ds-utilities": "2.0.0-alpha.11",
|
|
80
80
|
"prop-types": "~15.7.2",
|
|
81
81
|
"react-desc": "~4.1.3",
|
|
82
82
|
"react-range": "~1.8.11",
|
package/cjs/package.json
DELETED