@elliemae/ds-slider 2.2.1 → 2.3.0-alpha.4
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 +48 -33
- package/cjs/DSSlider.js.map +7 -0
- package/cjs/components/SliderImp.js +154 -158
- package/cjs/components/SliderImp.js.map +7 -0
- package/cjs/components/Thumb.js +64 -63
- package/cjs/components/Thumb.js.map +7 -0
- package/cjs/components/TickMarks.js +72 -31
- package/cjs/components/TickMarks.js.map +7 -0
- package/cjs/components/TickMarksValues.js +59 -38
- package/cjs/components/TickMarksValues.js.map +7 -0
- package/cjs/components/Track.js +66 -55
- package/cjs/components/Track.js.map +7 -0
- package/cjs/components/context.js +36 -13
- package/cjs/components/context.js.map +7 -0
- package/cjs/components/styled.js +93 -58
- package/cjs/components/styled.js.map +7 -0
- package/cjs/components/utils.js +46 -36
- package/cjs/components/utils.js.map +7 -0
- package/cjs/index.js +36 -11
- package/cjs/index.js.map +7 -0
- package/cjs/prop-types.js +52 -49
- package/cjs/prop-types.js.map +7 -0
- package/esm/DSSlider.js +16 -20
- package/esm/DSSlider.js.map +7 -0
- package/esm/components/SliderImp.js +120 -139
- package/esm/components/SliderImp.js.map +7 -0
- package/esm/components/Thumb.js +33 -54
- package/esm/components/Thumb.js.map +7 -0
- package/esm/components/TickMarks.js +42 -23
- package/esm/components/TickMarks.js.map +7 -0
- package/esm/components/TickMarksValues.js +30 -31
- package/esm/components/TickMarksValues.js.map +7 -0
- package/esm/components/Track.js +36 -46
- package/esm/components/Track.js.map +7 -0
- package/esm/components/context.js +7 -5
- package/esm/components/context.js.map +7 -0
- package/esm/components/styled.js +64 -44
- package/esm/components/styled.js.map +7 -0
- package/esm/components/utils.js +15 -29
- package/esm/components/utils.js.map +7 -0
- package/esm/index.js +7 -1
- package/esm/index.js.map +7 -0
- package/esm/prop-types.js +23 -44
- package/esm/prop-types.js.map +7 -0
- package/package.json +6 -6
package/cjs/components/styled.js
CHANGED
|
@@ -1,61 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var styled_exports = {};
|
|
29
|
+
__export(styled_exports, {
|
|
30
|
+
LabelText: () => LabelText,
|
|
31
|
+
LabelWrapper: () => LabelWrapper,
|
|
32
|
+
StyledRangeWrapper: () => StyledRangeWrapper,
|
|
33
|
+
ThumbStyled: () => ThumbStyled,
|
|
34
|
+
TooltipArrow: () => TooltipArrow,
|
|
35
|
+
TooltipContainerStyled: () => TooltipContainerStyled,
|
|
36
|
+
ValueText: () => ValueText
|
|
22
37
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
38
|
+
var React = __toESM(require("react"));
|
|
39
|
+
var import_styled_components = __toESM(require("styled-components"));
|
|
40
|
+
var import_ds_system = require("@elliemae/ds-system");
|
|
41
|
+
var import_ds_tooltip = require("@elliemae/ds-tooltip");
|
|
42
|
+
const ThumbStyled = import_styled_components.default.div`
|
|
43
|
+
height: 20px;
|
|
44
|
+
width: 20px;
|
|
45
|
+
background-color: ${(props) => props.disabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral["000"]};
|
|
46
|
+
border-radius: 10px;
|
|
47
|
+
border: 1px solid ${(props) => props.disabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral[400]};
|
|
32
48
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
:focus {
|
|
50
|
+
border: 1px solid ${(props) => props.theme.colors.brand[600]};
|
|
51
|
+
outline: unset;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:hover {
|
|
55
|
+
background-color: ${({ disabled, theme }) => disabled ? theme.colors.neutral[100] : theme.colors.brand[200]};
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
const TooltipContainerStyled = (0, import_styled_components.default)(import_ds_tooltip.TooltipContainer)`
|
|
59
|
+
position: relative;
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
top: -35px;
|
|
64
|
+
width: max-content;
|
|
65
|
+
left: 50%;
|
|
66
|
+
transform: translateX(-50%);
|
|
67
|
+
visibility: ${({ isDragged, isHovered }) => isDragged || isHovered ? "visible" : "hidden"};
|
|
68
|
+
`;
|
|
69
|
+
const TooltipArrow = import_styled_components.default.div`
|
|
70
|
+
position: absolute;
|
|
71
|
+
width: 0;
|
|
72
|
+
height: 0;
|
|
73
|
+
top: 20px;
|
|
74
|
+
border-left: calc(${(props) => (0, import_ds_system.__UNSAFE_SPACE_TO_DIMSUM)(props.theme.space.xxs)} * 2.5) solid transparent;
|
|
75
|
+
border-right: calc(${(props) => (0, import_ds_system.__UNSAFE_SPACE_TO_DIMSUM)(props.theme.space.xxs)} * 2.5) solid transparent;
|
|
54
76
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
77
|
+
border-top: calc(${(props) => (0, import_ds_system.__UNSAFE_SPACE_TO_DIMSUM)(props.theme.space.xxs)} * 2.5) solid
|
|
78
|
+
${(props) => props.theme.colors.neutral[0]};
|
|
79
|
+
`;
|
|
80
|
+
const LabelWrapper = import_styled_components.default.div`
|
|
81
|
+
margin-bottom: ${(props) => props.theme.space.xxs};
|
|
82
|
+
max-width: 100%;
|
|
83
|
+
width: ${(props) => `${props.width || 0}px`};
|
|
84
|
+
`;
|
|
85
|
+
const LabelText = import_styled_components.default.span`
|
|
86
|
+
color: ${(props) => props.theme.colors.neutral[600]};
|
|
87
|
+
`;
|
|
88
|
+
const ValueText = import_styled_components.default.span`
|
|
89
|
+
color: ${({ disabled, theme }) => theme.colors.neutral[disabled ? 500 : 800]};
|
|
90
|
+
`;
|
|
91
|
+
const StyledRangeWrapper = import_styled_components.default.div`
|
|
92
|
+
min-height: 28px;
|
|
93
|
+
margin: 0 10px;
|
|
94
|
+
`;
|
|
95
|
+
module.exports = __toCommonJS(styled_exports);
|
|
96
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/styled.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable indent */\nimport styled from 'styled-components';\nimport { __UNSAFE_SPACE_TO_DIMSUM } from '@elliemae/ds-system';\nimport { TooltipContainer } from '@elliemae/ds-tooltip';\n\nexport const ThumbStyled = styled.div`\n height: 20px;\n width: 20px;\n background-color: ${(props) =>\n props.disabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral['000']};\n border-radius: 10px;\n border: 1px solid ${(props) => (props.disabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral[400])};\n\n :focus {\n border: 1px solid ${(props) => props.theme.colors.brand[600]};\n outline: unset;\n }\n\n :hover {\n background-color: ${({ disabled, theme }) => (disabled ? theme.colors.neutral[100] : theme.colors.brand[200])};\n }\n`;\n\nexport const TooltipContainerStyled = styled(TooltipContainer)`\n position: relative;\n display: flex;\n align-items: center;\n flex-direction: column;\n top: -35px;\n width: max-content;\n left: 50%;\n transform: translateX(-50%);\n visibility: ${({ isDragged, isHovered }) => (isDragged || isHovered ? 'visible' : 'hidden')};\n`;\n// TODO: didn't work with DSTooltip, see how to improve\nexport const TooltipArrow = styled.div`\n position: absolute;\n width: 0;\n height: 0;\n top: 20px;\n border-left: calc(${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)} * 2.5) solid transparent;\n border-right: calc(${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)} * 2.5) solid transparent;\n\n border-top: calc(${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)} * 2.5) solid\n ${(props) => props.theme.colors.neutral[0]};\n`;\n\nexport const LabelWrapper = styled.div`\n margin-bottom: ${(props) => props.theme.space.xxs};\n max-width: 100%;\n width: ${(props) => `${props.width || 0}px`};\n`;\n\nexport const LabelText = styled.span`\n color: ${(props) => props.theme.colors.neutral[600]};\n`;\n\nexport const ValueText = styled.span`\n color: ${({ disabled, theme }) => theme.colors.neutral[disabled ? 500 : 800]};\n`;\n\nexport const StyledRangeWrapper = styled.div`\n min-height: 28px;\n margin: 0 10px;\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,+BAAmB;AACnB,uBAAyC;AACzC,wBAAiC;AAE1B,MAAM,cAAc,iCAAO;AAAA;AAAA;AAAA,sBAGZ,CAAC,UACnB,MAAM,WAAW,MAAM,MAAM,OAAO,QAAQ,OAAO,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA,sBAE5D,CAAC,UAAW,MAAM,WAAW,MAAM,MAAM,OAAO,QAAQ,OAAO,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA,wBAGxF,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,wBAKpC,CAAC,EAAE,UAAU,YAAa,WAAW,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,MAAM;AAAA;AAAA;AAIrG,MAAM,yBAAyB,sCAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAS7B,CAAC,EAAE,WAAW,gBAAiB,aAAa,YAAY,YAAY;AAAA;AAG7E,MAAM,eAAe,iCAAO;AAAA;AAAA;AAAA;AAAA;AAAA,sBAKb,CAAC,UAAU,+CAAyB,MAAM,MAAM,MAAM;AAAA,uBACrD,CAAC,UAAU,+CAAyB,MAAM,MAAM,MAAM;AAAA;AAAA,qBAExD,CAAC,UAAU,+CAAyB,MAAM,MAAM,MAAM;AAAA,MACrE,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAGrC,MAAM,eAAe,iCAAO;AAAA,mBAChB,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA,WAErC,CAAC,UAAU,GAAG,MAAM,SAAS;AAAA;AAGjC,MAAM,YAAY,iCAAO;AAAA,WACrB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAG1C,MAAM,YAAY,iCAAO;AAAA,WACrB,CAAC,EAAE,UAAU,YAAY,MAAM,OAAO,QAAQ,WAAW,MAAM;AAAA;AAGnE,MAAM,qBAAqB,iCAAO;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/components/utils.js
CHANGED
|
@@ -1,49 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var utils_exports = {};
|
|
29
|
+
__export(utils_exports, {
|
|
30
|
+
conformedLabel: () => conformedLabel,
|
|
31
|
+
conformedThumbLabel: () => conformedThumbLabel
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
35
|
+
const conformedLabel = (rangeValues, label = "", labelWithValue = false, withTwoHandles = false, customTickMarksValues = [], step = 1, minValue = 0) => {
|
|
15
36
|
const msg = label.trim();
|
|
16
|
-
let value =
|
|
17
|
-
|
|
18
|
-
if (!dsUtilities.isEmpty(customTickMarksValues) && labelWithValue && label) {
|
|
37
|
+
let value = "";
|
|
38
|
+
if (!(0, import_ds_utilities.isEmpty)(customTickMarksValues) && labelWithValue && label) {
|
|
19
39
|
const firstValue = customTickMarksValues[(rangeValues[0] - minValue) / step];
|
|
20
40
|
const secondValue = customTickMarksValues[(rangeValues[1] - minValue) / step];
|
|
21
|
-
value =
|
|
41
|
+
value = `${firstValue || rangeValues[0].toFixed(1)} ${withTwoHandles ? `, ${secondValue || rangeValues[1].toFixed(1)}` : ""} `;
|
|
22
42
|
} else if (labelWithValue && label) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
value = "".concat(rangeValues[0].toFixed(1), " ").concat(withTwoHandles ? ", ".concat((_rangeValues$ = rangeValues[1]) === null || _rangeValues$ === void 0 ? void 0 : _rangeValues$.toFixed(1)) : '', " ");
|
|
43
|
+
value = `${rangeValues[0].toFixed(1)} ${withTwoHandles ? `, ${rangeValues[1]?.toFixed(1)}` : ""} `;
|
|
26
44
|
}
|
|
27
|
-
|
|
28
45
|
value = value.trim();
|
|
29
46
|
return [msg, value];
|
|
30
47
|
};
|
|
31
|
-
const conformedThumbLabel =
|
|
32
|
-
let
|
|
33
|
-
|
|
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
|
-
|
|
38
|
-
if (!dsUtilities.isEmpty(customTickMarksValues)) {
|
|
48
|
+
const conformedThumbLabel = (rangeValues, customTickMarksValues = [], index = 0, step = 1, minValue = 0) => {
|
|
49
|
+
let msg = `Value: `;
|
|
50
|
+
if (!(0, import_ds_utilities.isEmpty)(customTickMarksValues)) {
|
|
39
51
|
const foundValue = customTickMarksValues[(rangeValues[index] - minValue) / step];
|
|
40
|
-
msg +=
|
|
52
|
+
msg += `${foundValue || rangeValues[index].toFixed(1)}`;
|
|
41
53
|
} else {
|
|
42
|
-
msg +=
|
|
54
|
+
msg += `${rangeValues[index].toFixed(1)}`;
|
|
43
55
|
}
|
|
44
|
-
|
|
45
56
|
return msg;
|
|
46
57
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
exports.conformedThumbLabel = conformedThumbLabel;
|
|
58
|
+
module.exports = __toCommonJS(utils_exports);
|
|
59
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/utils.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-params */\nimport { isEmpty } from '@elliemae/ds-utilities';\n\nexport const conformedLabel = (\n rangeValues,\n label = '',\n labelWithValue = false,\n withTwoHandles = false,\n customTickMarksValues = [],\n step = 1,\n minValue = 0,\n) => {\n const msg = label.trim();\n let value = '';\n if (!isEmpty(customTickMarksValues) && labelWithValue && label) {\n const firstValue =\n customTickMarksValues[(rangeValues[0] - minValue) / step];\n const secondValue =\n customTickMarksValues[(rangeValues[1] - minValue) / step];\n value = `${firstValue || rangeValues[0].toFixed(1)} ${\n withTwoHandles ? `, ${secondValue || rangeValues[1].toFixed(1)}` : ''\n } `;\n } else if (labelWithValue && label) {\n value = `${rangeValues[0].toFixed(1)} ${\n withTwoHandles ? `, ${rangeValues[1]?.toFixed(1)}` : ''\n } `;\n }\n value = value.trim();\n\n return [msg, value];\n};\n\nexport const conformedThumbLabel = (\n rangeValues,\n customTickMarksValues = [],\n index = 0,\n step = 1,\n minValue = 0,\n) => {\n let msg = `Value: `;\n if (!isEmpty(customTickMarksValues)) {\n const foundValue =\n customTickMarksValues[(rangeValues[index] - minValue) / step];\n msg += `${foundValue || rangeValues[index].toFixed(1)}`;\n } else {\n msg += `${rangeValues[index].toFixed(1)}`;\n }\n\n return msg;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,0BAAwB;AAEjB,MAAM,iBAAiB,CAC5B,aACA,QAAQ,IACR,iBAAiB,OACjB,iBAAiB,OACjB,wBAAwB,IACxB,OAAO,GACP,WAAW,MACR;AACH,QAAM,MAAM,MAAM;AAClB,MAAI,QAAQ;AACZ,MAAI,CAAC,iCAAQ,0BAA0B,kBAAkB,OAAO;AAC9D,UAAM,aACJ,sBAAuB,aAAY,KAAK,YAAY;AACtD,UAAM,cACJ,sBAAuB,aAAY,KAAK,YAAY;AACtD,YAAQ,GAAG,cAAc,YAAY,GAAG,QAAQ,MAC9C,iBAAiB,KAAK,eAAe,YAAY,GAAG,QAAQ,OAAO;AAAA,aAE5D,kBAAkB,OAAO;AAClC,YAAQ,GAAG,YAAY,GAAG,QAAQ,MAChC,iBAAiB,KAAK,YAAY,IAAI,QAAQ,OAAO;AAAA;AAGzD,UAAQ,MAAM;AAEd,SAAO,CAAC,KAAK;AAAA;AAGR,MAAM,sBAAsB,CACjC,aACA,wBAAwB,IACxB,QAAQ,GACR,OAAO,GACP,WAAW,MACR;AACH,MAAI,MAAM;AACV,MAAI,CAAC,iCAAQ,wBAAwB;AACnC,UAAM,aACJ,sBAAuB,aAAY,SAAS,YAAY;AAC1D,WAAO,GAAG,cAAc,YAAY,OAAO,QAAQ;AAAA,SAC9C;AACL,WAAO,GAAG,YAAY,OAAO,QAAQ;AAAA;AAGvC,SAAO;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/index.js
CHANGED
|
@@ -1,11 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var src_exports = {};
|
|
29
|
+
__export(src_exports, {
|
|
30
|
+
default: () => import_DSSlider.default
|
|
31
|
+
});
|
|
32
|
+
var React = __toESM(require("react"));
|
|
33
|
+
var import_DSSlider = __toESM(require("./DSSlider"));
|
|
34
|
+
__reExport(src_exports, require("./DSSlider"));
|
|
35
|
+
module.exports = __toCommonJS(src_exports);
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { default } from './DSSlider';\nexport * from './DSSlider';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,sBAAwB;AACxB,wBAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/cjs/prop-types.js
CHANGED
|
@@ -1,18 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(module2))
|
|
15
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return target;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (module2, isNodeMode) => {
|
|
21
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
+
};
|
|
23
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
+
return (module2, temp) => {
|
|
25
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
+
};
|
|
27
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
+
var prop_types_exports = {};
|
|
29
|
+
__export(prop_types_exports, {
|
|
30
|
+
defaultProps: () => defaultProps,
|
|
31
|
+
sliderPropTypes: () => sliderPropTypes
|
|
32
|
+
});
|
|
33
|
+
var React = __toESM(require("react"));
|
|
34
|
+
var import_react_desc = require("react-desc");
|
|
7
35
|
const defaultProps = {
|
|
8
36
|
containerProps: {},
|
|
9
37
|
disabled: false,
|
|
10
|
-
label:
|
|
38
|
+
label: "",
|
|
11
39
|
labelWithValue: false,
|
|
12
40
|
minValue: 0,
|
|
13
41
|
maxValue: 100,
|
|
14
42
|
step: 5,
|
|
15
|
-
onChange: () => {
|
|
43
|
+
onChange: () => {
|
|
44
|
+
},
|
|
16
45
|
withTickMarks: false,
|
|
17
46
|
withTickMarksValues: false,
|
|
18
47
|
withTwoHandles: false,
|
|
@@ -20,45 +49,19 @@ const defaultProps = {
|
|
|
20
49
|
zIndex: 0
|
|
21
50
|
};
|
|
22
51
|
const sliderPropTypes = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
minValue: reactDesc.PropTypes.number.description('min value for slider'),
|
|
37
|
-
|
|
38
|
-
/** max value for slider */
|
|
39
|
-
maxValue: reactDesc.PropTypes.number.description('max value for slider'),
|
|
40
|
-
|
|
41
|
-
/** steps of values from min to max */
|
|
42
|
-
step: reactDesc.PropTypes.number.description('steps of values from min to max'),
|
|
43
|
-
|
|
44
|
-
/** change handler */
|
|
45
|
-
onChange: reactDesc.PropTypes.func.description('change handler'),
|
|
46
|
-
|
|
47
|
-
/** add tick marks between steps */
|
|
48
|
-
withTickMarks: reactDesc.PropTypes.bool.description('add tick marks between steps'),
|
|
49
|
-
|
|
50
|
-
/** add step value to tickmark */
|
|
51
|
-
withTickMarksValues: reactDesc.PropTypes.bool.description('add step value to tickmark'),
|
|
52
|
-
|
|
53
|
-
/** add two handles */
|
|
54
|
-
withTwoHandles: reactDesc.PropTypes.bool.description('add two handles'),
|
|
55
|
-
|
|
56
|
-
/** change manually tickmark values */
|
|
57
|
-
customTickMarksValues: reactDesc.PropTypes.arrayOf(reactDesc.PropTypes.oneOfType([reactDesc.PropTypes.string, reactDesc.PropTypes.number])).description('change manually tickmark values'),
|
|
58
|
-
|
|
59
|
-
/** z index for thumb */
|
|
60
|
-
zIndex: reactDesc.PropTypes.number.description('z index for thumb')
|
|
52
|
+
containerProps: import_react_desc.PropTypes.shape({}).description("props to inject to slider wrapper"),
|
|
53
|
+
disabled: import_react_desc.PropTypes.bool.description("disable slider"),
|
|
54
|
+
label: import_react_desc.PropTypes.string.description("label for slider"),
|
|
55
|
+
labelWithValue: import_react_desc.PropTypes.bool.description("if the label comes with value attached for slider or not"),
|
|
56
|
+
minValue: import_react_desc.PropTypes.number.description("min value for slider"),
|
|
57
|
+
maxValue: import_react_desc.PropTypes.number.description("max value for slider"),
|
|
58
|
+
step: import_react_desc.PropTypes.number.description("steps of values from min to max"),
|
|
59
|
+
onChange: import_react_desc.PropTypes.func.description("change handler"),
|
|
60
|
+
withTickMarks: import_react_desc.PropTypes.bool.description("add tick marks between steps"),
|
|
61
|
+
withTickMarksValues: import_react_desc.PropTypes.bool.description("add step value to tickmark"),
|
|
62
|
+
withTwoHandles: import_react_desc.PropTypes.bool.description("add two handles"),
|
|
63
|
+
customTickMarksValues: import_react_desc.PropTypes.arrayOf(import_react_desc.PropTypes.oneOfType([import_react_desc.PropTypes.string, import_react_desc.PropTypes.number])).description("change manually tickmark values"),
|
|
64
|
+
zIndex: import_react_desc.PropTypes.number.description("z index for thumb")
|
|
61
65
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
exports.sliderPropTypes = sliderPropTypes;
|
|
66
|
+
module.exports = __toCommonJS(prop_types_exports);
|
|
67
|
+
//# sourceMappingURL=prop-types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/prop-types.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { PropTypes } from 'react-desc';\n\nexport const defaultProps = {\n containerProps: {},\n disabled: false,\n label: '',\n labelWithValue: false,\n minValue: 0,\n maxValue: 100,\n step: 5,\n onChange: () => {},\n withTickMarks: false,\n withTickMarksValues: false,\n withTwoHandles: false,\n customTickMarksValues: [],\n zIndex: 0,\n};\n\nexport const sliderPropTypes = {\n /** props to inject to slider wrapper */\n containerProps: PropTypes.shape({}).description(\n 'props to inject to slider wrapper',\n ),\n /** disable slider */\n disabled: PropTypes.bool.description('disable slider'),\n /** label for slider */\n label: PropTypes.string.description('label for slider'),\n /** if the label comes with value attached for slider or not */\n labelWithValue: PropTypes.bool.description(\n 'if the label comes with value attached for slider or not',\n ),\n /** min value for slider */\n minValue: PropTypes.number.description('min value for slider'),\n /** max value for slider */\n maxValue: PropTypes.number.description('max value for slider'),\n /** steps of values from min to max */\n step: PropTypes.number.description('steps of values from min to max'),\n /** change handler */\n onChange: PropTypes.func.description('change handler'),\n /** add tick marks between steps */\n withTickMarks: PropTypes.bool.description('add tick marks between steps'),\n /** add step value to tickmark */\n withTickMarksValues: PropTypes.bool.description('add step value to tickmark'),\n /** add two handles */\n withTwoHandles: PropTypes.bool.description('add two handles'),\n /** change manually tickmark values */\n customTickMarksValues: PropTypes.arrayOf(\n PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n ).description('change manually tickmark values'),\n /** z index for thumb */\n zIndex: PropTypes.number.description('z index for thumb'),\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAA0B;AAEnB,MAAM,eAAe;AAAA,EAC1B,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,OAAO;AAAA,EACP,gBAAgB;AAAA,EAChB,UAAU;AAAA,EACV,UAAU;AAAA,EACV,MAAM;AAAA,EACN,UAAU,MAAM;AAAA;AAAA,EAChB,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,gBAAgB;AAAA,EAChB,uBAAuB;AAAA,EACvB,QAAQ;AAAA;AAGH,MAAM,kBAAkB;AAAA,EAE7B,gBAAgB,4BAAU,MAAM,IAAI,YAClC;AAAA,EAGF,UAAU,4BAAU,KAAK,YAAY;AAAA,EAErC,OAAO,4BAAU,OAAO,YAAY;AAAA,EAEpC,gBAAgB,4BAAU,KAAK,YAC7B;AAAA,EAGF,UAAU,4BAAU,OAAO,YAAY;AAAA,EAEvC,UAAU,4BAAU,OAAO,YAAY;AAAA,EAEvC,MAAM,4BAAU,OAAO,YAAY;AAAA,EAEnC,UAAU,4BAAU,KAAK,YAAY;AAAA,EAErC,eAAe,4BAAU,KAAK,YAAY;AAAA,EAE1C,qBAAqB,4BAAU,KAAK,YAAY;AAAA,EAEhD,gBAAgB,4BAAU,KAAK,YAAY;AAAA,EAE3C,uBAAuB,4BAAU,QAC/B,4BAAU,UAAU,CAAC,4BAAU,QAAQ,4BAAU,UACjD,YAAY;AAAA,EAEd,QAAQ,4BAAU,OAAO,YAAY;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/DSSlider.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import SliderImp from './components/SliderImp.js';
|
|
10
|
-
import { sliderPropTypes, defaultProps } from './prop-types.js';
|
|
11
|
-
import { jsx } from 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); 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 = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : 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));
|
|
18
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { describe } from "react-desc";
|
|
4
|
+
import SliderImp from "./components/SliderImp";
|
|
5
|
+
import { defaultProps, sliderPropTypes } from "./prop-types";
|
|
6
|
+
const DSSlider = (props) => /* @__PURE__ */ React2.createElement(SliderImp, {
|
|
7
|
+
...props
|
|
8
|
+
});
|
|
19
9
|
DSSlider.defaultProps = defaultProps;
|
|
10
|
+
DSSlider.propTypes = sliderPropTypes;
|
|
20
11
|
const DSSliderWithSchema = describe(DSSlider);
|
|
21
12
|
DSSliderWithSchema.propTypes = sliderPropTypes;
|
|
22
|
-
|
|
23
|
-
export {
|
|
13
|
+
var DSSlider_default = DSSlider;
|
|
14
|
+
export {
|
|
15
|
+
DSSlider,
|
|
16
|
+
DSSliderWithSchema,
|
|
17
|
+
DSSlider_default as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=DSSlider.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DSSlider.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe } from 'react-desc';\nimport SliderImp from './components/SliderImp';\nimport { defaultProps, sliderPropTypes } from './prop-types';\n\nconst DSSlider = (props) => <SliderImp {...props} />;\n\nDSSlider.defaultProps = defaultProps;\nDSSlider.propTypes = sliderPropTypes;\n\nconst DSSliderWithSchema = describe(DSSlider);\nDSSliderWithSchema.propTypes = sliderPropTypes;\n\nexport { DSSlider, DSSliderWithSchema };\nexport default DSSlider;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,WAAW,CAAC,UAAU,qCAAC,WAAD;AAAA,KAAe;AAAA;AAE3C,SAAS,eAAe;AACxB,SAAS,YAAY;AAErB,MAAM,qBAAqB,SAAS;AACpC,mBAAmB,YAAY;AAG/B,IAAO,mBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|