@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.
Files changed (45) hide show
  1. package/cjs/DSSlider.js +48 -33
  2. package/cjs/DSSlider.js.map +7 -0
  3. package/cjs/components/SliderImp.js +154 -158
  4. package/cjs/components/SliderImp.js.map +7 -0
  5. package/cjs/components/Thumb.js +64 -63
  6. package/cjs/components/Thumb.js.map +7 -0
  7. package/cjs/components/TickMarks.js +72 -31
  8. package/cjs/components/TickMarks.js.map +7 -0
  9. package/cjs/components/TickMarksValues.js +59 -38
  10. package/cjs/components/TickMarksValues.js.map +7 -0
  11. package/cjs/components/Track.js +66 -55
  12. package/cjs/components/Track.js.map +7 -0
  13. package/cjs/components/context.js +36 -13
  14. package/cjs/components/context.js.map +7 -0
  15. package/cjs/components/styled.js +93 -58
  16. package/cjs/components/styled.js.map +7 -0
  17. package/cjs/components/utils.js +46 -36
  18. package/cjs/components/utils.js.map +7 -0
  19. package/cjs/index.js +36 -11
  20. package/cjs/index.js.map +7 -0
  21. package/cjs/prop-types.js +52 -49
  22. package/cjs/prop-types.js.map +7 -0
  23. package/esm/DSSlider.js +16 -20
  24. package/esm/DSSlider.js.map +7 -0
  25. package/esm/components/SliderImp.js +120 -139
  26. package/esm/components/SliderImp.js.map +7 -0
  27. package/esm/components/Thumb.js +33 -54
  28. package/esm/components/Thumb.js.map +7 -0
  29. package/esm/components/TickMarks.js +42 -23
  30. package/esm/components/TickMarks.js.map +7 -0
  31. package/esm/components/TickMarksValues.js +30 -31
  32. package/esm/components/TickMarksValues.js.map +7 -0
  33. package/esm/components/Track.js +36 -46
  34. package/esm/components/Track.js.map +7 -0
  35. package/esm/components/context.js +7 -5
  36. package/esm/components/context.js.map +7 -0
  37. package/esm/components/styled.js +64 -44
  38. package/esm/components/styled.js.map +7 -0
  39. package/esm/components/utils.js +15 -29
  40. package/esm/components/utils.js.map +7 -0
  41. package/esm/index.js +7 -1
  42. package/esm/index.js.map +7 -0
  43. package/esm/prop-types.js +23 -44
  44. package/esm/prop-types.js.map +7 -0
  45. package/package.json +6 -6
@@ -1,61 +1,96 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var styled = require('styled-components');
6
- var dsSystem = require('@elliemae/ds-system');
7
- var dsTooltip = require('@elliemae/ds-tooltip');
8
-
9
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
-
11
- var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
12
-
13
- /* eslint-disable indent */
14
- const ThumbStyled = /*#__PURE__*/styled__default["default"].div.withConfig({
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:", ";}"], 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;
21
- return disabled ? theme.colors.neutral[100] : theme.colors.brand[200];
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
- const TooltipContainerStyled = /*#__PURE__*/styled__default["default"](dsTooltip.TooltipContainer).withConfig({
24
- componentId: "sc-24in0j-1"
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;
30
- return isDragged || isHovered ? 'visible' : 'hidden';
31
- }); // TODO: didn't work with DSTooltip, see how to improve
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
- const TooltipArrow = /*#__PURE__*/styled__default["default"].div.withConfig({
34
- componentId: "sc-24in0j-2"
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({
37
- componentId: "sc-24in0j-3"
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({
40
- componentId: "sc-24in0j-4"
41
- })(["color:", ";"], props => props.theme.colors.neutral[600]);
42
- const ValueText = /*#__PURE__*/styled__default["default"].span.withConfig({
43
- componentId: "sc-24in0j-5"
44
- })(["color:", ";"], _ref3 => {
45
- let {
46
- disabled,
47
- theme
48
- } = _ref3;
49
- return theme.colors.neutral[disabled ? 500 : 800];
50
- });
51
- const StyledRangeWrapper = /*#__PURE__*/styled__default["default"].div.withConfig({
52
- componentId: "sc-24in0j-6"
53
- })(["min-height:28px;margin:0 10px;"]);
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
- exports.LabelText = LabelText;
56
- exports.LabelWrapper = LabelWrapper;
57
- exports.StyledRangeWrapper = StyledRangeWrapper;
58
- exports.ThumbStyled = ThumbStyled;
59
- exports.TooltipArrow = TooltipArrow;
60
- exports.TooltipContainerStyled = TooltipContainerStyled;
61
- exports.ValueText = ValueText;
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
+ }
@@ -1,49 +1,59 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var dsUtilities = require('@elliemae/ds-utilities');
6
-
7
- /* eslint-disable max-params */
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;
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 = "".concat(firstValue || rangeValues[0].toFixed(1), " ").concat(withTwoHandles ? ", ".concat(secondValue || rangeValues[1].toFixed(1)) : '', " ");
41
+ value = `${firstValue || rangeValues[0].toFixed(1)} ${withTwoHandles ? `, ${secondValue || rangeValues[1].toFixed(1)}` : ""} `;
22
42
  } else if (labelWithValue && label) {
23
- var _rangeValues$;
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 = 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
-
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 += "".concat(foundValue || rangeValues[index].toFixed(1));
52
+ msg += `${foundValue || rangeValues[index].toFixed(1)}`;
41
53
  } else {
42
- msg += "".concat(rangeValues[index].toFixed(1));
54
+ msg += `${rangeValues[index].toFixed(1)}`;
43
55
  }
44
-
45
56
  return msg;
46
57
  };
47
-
48
- exports.conformedLabel = conformedLabel;
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
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var DSSlider = require('./DSSlider.js');
6
-
7
-
8
-
9
- exports.DSSlider = DSSlider.DSSlider;
10
- exports.DSSliderWithSchema = DSSlider.DSSliderWithSchema;
11
- exports["default"] = DSSlider.DSSlider;
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
@@ -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
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var reactDesc = require('react-desc');
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
- /** props to inject to slider wrapper */
24
- containerProps: reactDesc.PropTypes.shape({}).description('props to inject to slider wrapper'),
25
-
26
- /** disable slider */
27
- disabled: reactDesc.PropTypes.bool.description('disable slider'),
28
-
29
- /** label for slider */
30
- label: reactDesc.PropTypes.string.description('label for slider'),
31
-
32
- /** if the label comes with value attached for slider or not */
33
- labelWithValue: reactDesc.PropTypes.bool.description('if the label comes with value attached for slider or not'),
34
-
35
- /** min value for slider */
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
- exports.defaultProps = defaultProps;
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 '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';
8
- import { describe } from 'react-desc';
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 { DSSlider, DSSliderWithSchema, DSSlider as default };
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
+ }