@elliemae/ds-slider-v2 3.26.0-next.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/DSSliderV2.js +50 -0
- package/dist/cjs/DSSliderV2.js.map +7 -0
- package/dist/cjs/DSSliderV2CTX.js +40 -0
- package/dist/cjs/DSSliderV2CTX.js.map +7 -0
- package/dist/cjs/config/useSliderV2.js +70 -0
- package/dist/cjs/config/useSliderV2.js.map +7 -0
- package/dist/cjs/config/useTickMarksValues.js +51 -0
- package/dist/cjs/config/useTickMarksValues.js.map +7 -0
- package/dist/cjs/config/useValidateProps.js +45 -0
- package/dist/cjs/config/useValidateProps.js.map +7 -0
- package/dist/cjs/constants/index.js +50 -0
- package/dist/cjs/constants/index.js.map +7 -0
- package/dist/cjs/index.js +42 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/parts/MainContent.js +95 -0
- package/dist/cjs/parts/MainContent.js.map +7 -0
- package/dist/cjs/parts/Thumb.js +82 -0
- package/dist/cjs/parts/Thumb.js.map +7 -0
- package/dist/cjs/parts/TickMarks.js +67 -0
- package/dist/cjs/parts/TickMarks.js.map +7 -0
- package/dist/cjs/parts/TickMarksValues.js +67 -0
- package/dist/cjs/parts/TickMarksValues.js.map +7 -0
- package/dist/cjs/parts/Track.js +71 -0
- package/dist/cjs/parts/Track.js.map +7 -0
- package/dist/cjs/react-desc-prop-types.js +64 -0
- package/dist/cjs/react-desc-prop-types.js.map +7 -0
- package/dist/cjs/styles.js +122 -0
- package/dist/cjs/styles.js.map +7 -0
- package/dist/cjs/typescript-testing/typescript-slider-v2-valid.js +95 -0
- package/dist/cjs/typescript-testing/typescript-slider-v2-valid.js.map +7 -0
- package/dist/cjs/utils/inRange.js +42 -0
- package/dist/cjs/utils/inRange.js.map +7 -0
- package/dist/cjs/utils/thumbLabels.js +51 -0
- package/dist/cjs/utils/thumbLabels.js.map +7 -0
- package/dist/esm/DSSliderV2.js +20 -0
- package/dist/esm/DSSliderV2.js.map +7 -0
- package/dist/esm/DSSliderV2CTX.js +10 -0
- package/dist/esm/DSSliderV2CTX.js.map +7 -0
- package/dist/esm/config/useSliderV2.js +40 -0
- package/dist/esm/config/useSliderV2.js.map +7 -0
- package/dist/esm/config/useTickMarksValues.js +21 -0
- package/dist/esm/config/useTickMarksValues.js.map +7 -0
- package/dist/esm/config/useValidateProps.js +15 -0
- package/dist/esm/config/useValidateProps.js.map +7 -0
- package/dist/esm/constants/index.js +20 -0
- package/dist/esm/constants/index.js.map +7 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +7 -0
- package/dist/esm/parts/MainContent.js +65 -0
- package/dist/esm/parts/MainContent.js.map +7 -0
- package/dist/esm/parts/Thumb.js +52 -0
- package/dist/esm/parts/Thumb.js.map +7 -0
- package/dist/esm/parts/TickMarks.js +37 -0
- package/dist/esm/parts/TickMarks.js.map +7 -0
- package/dist/esm/parts/TickMarksValues.js +37 -0
- package/dist/esm/parts/TickMarksValues.js.map +7 -0
- package/dist/esm/parts/Track.js +41 -0
- package/dist/esm/parts/Track.js.map +7 -0
- package/dist/esm/react-desc-prop-types.js +39 -0
- package/dist/esm/react-desc-prop-types.js.map +7 -0
- package/dist/esm/styles.js +92 -0
- package/dist/esm/styles.js.map +7 -0
- package/dist/esm/typescript-testing/typescript-slider-v2-valid.js +72 -0
- package/dist/esm/typescript-testing/typescript-slider-v2-valid.js.map +7 -0
- package/dist/esm/utils/inRange.js +12 -0
- package/dist/esm/utils/inRange.js.map +7 -0
- package/dist/esm/utils/thumbLabels.js +21 -0
- package/dist/esm/utils/thumbLabels.js.map +7 -0
- package/dist/types/DSSliderV2.d.ts +7 -0
- package/dist/types/DSSliderV2CTX.d.ts +5 -0
- package/dist/types/config/useSliderV2.d.ts +20 -0
- package/dist/types/config/useTickMarksValues.d.ts +2 -0
- package/dist/types/config/useValidateProps.d.ts +5 -0
- package/dist/types/constants/index.d.ts +12 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/parts/MainContent.d.ts +1 -0
- package/dist/types/parts/Thumb.d.ts +2 -0
- package/dist/types/parts/TickMarks.d.ts +1 -0
- package/dist/types/parts/TickMarksValues.d.ts +1 -0
- package/dist/types/parts/Track.d.ts +2 -0
- package/dist/types/react-desc-prop-types.d.ts +30 -0
- package/dist/types/styles.d.ts +21 -0
- package/dist/types/tests/axe-core.test.d.ts +1 -0
- package/dist/types/tests/events.test.d.ts +1 -0
- package/dist/types/tests/render.test.d.ts +1 -0
- package/dist/types/typescript-testing/typescript-slider-v2-valid.d.ts +1 -0
- package/dist/types/utils/inRange.d.ts +1 -0
- package/dist/types/utils/thumbLabels.d.ts +7 -0
- package/package.json +78 -0
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
var DSSliderV2_exports = {};
|
30
|
+
__export(DSSliderV2_exports, {
|
31
|
+
DSSliderV2: () => DSSliderV2,
|
32
|
+
DSSliderV2WithSchema: () => DSSliderV2WithSchema
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(DSSliderV2_exports);
|
35
|
+
var React = __toESM(require("react"));
|
36
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
37
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
38
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
39
|
+
var import_useSliderV2 = require("./config/useSliderV2.js");
|
40
|
+
var import_constants = require("./constants/index.js");
|
41
|
+
var import_DSSliderV2CTX = __toESM(require("./DSSliderV2CTX.js"));
|
42
|
+
var import_MainContent = require("./parts/MainContent.js");
|
43
|
+
const DSSliderV2 = (props) => {
|
44
|
+
const ctx = (0, import_useSliderV2.useSliderV2)(props);
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DSSliderV2CTX.default.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_MainContent.MainContent, {}) });
|
46
|
+
};
|
47
|
+
DSSliderV2.displayName = import_constants.DSSliderV2Name;
|
48
|
+
const DSSliderV2WithSchema = (0, import_ds_props_helpers.describe)(DSSliderV2);
|
49
|
+
DSSliderV2WithSchema.propTypes = import_react_desc_prop_types.DSSliderV2PropTypesSchema;
|
50
|
+
//# sourceMappingURL=DSSliderV2.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/DSSliderV2.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport { describe } from '@elliemae/ds-props-helpers';\nimport { type DSSliderV2T, DSSliderV2PropTypesSchema } from './react-desc-prop-types.js';\nimport { useSliderV2 } from './config/useSliderV2.js';\nimport { DSSliderV2Name } from './constants/index.js';\n\nimport DSSliderV2Context from './DSSliderV2CTX.js';\nimport { MainContent } from './parts/MainContent.js';\n\nconst DSSliderV2 = <TMultiple extends boolean = false>(props: DSSliderV2T.Props<TMultiple>) => {\n const ctx = useSliderV2(props);\n\n return (\n <DSSliderV2Context.Provider value={ctx}>\n <MainContent />\n </DSSliderV2Context.Provider>\n );\n};\n\nDSSliderV2.displayName = DSSliderV2Name;\nconst DSSliderV2WithSchema = describe(DSSliderV2);\nDSSliderV2WithSchema.propTypes = DSSliderV2PropTypesSchema;\n\nexport { DSSliderV2, DSSliderV2WithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADcjB;AAbN,8BAAyB;AACzB,mCAA4D;AAC5D,yBAA4B;AAC5B,uBAA+B;AAE/B,2BAA8B;AAC9B,yBAA4B;AAE5B,MAAM,aAAa,CAAoC,UAAwC;AAC7F,QAAM,UAAM,gCAAY,KAAK;AAE7B,SACE,4CAAC,qBAAAA,QAAkB,UAAlB,EAA2B,OAAO,KACjC,sDAAC,kCAAY,GACf;AAEJ;AAEA,WAAW,cAAc;AACzB,MAAM,2BAAuB,kCAAS,UAAU;AAChD,qBAAqB,YAAY;",
|
6
|
+
"names": ["DSSliderV2Context"]
|
7
|
+
}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
var DSSliderV2CTX_exports = {};
|
30
|
+
__export(DSSliderV2CTX_exports, {
|
31
|
+
DSSliderV2Context: () => DSSliderV2Context,
|
32
|
+
default: () => DSSliderV2CTX_default
|
33
|
+
});
|
34
|
+
module.exports = __toCommonJS(DSSliderV2CTX_exports);
|
35
|
+
var React = __toESM(require("react"));
|
36
|
+
var import_react = require("react");
|
37
|
+
const defaultContext = {};
|
38
|
+
const DSSliderV2Context = (0, import_react.createContext)(defaultContext);
|
39
|
+
var DSSliderV2CTX_default = DSSliderV2Context;
|
40
|
+
//# sourceMappingURL=DSSliderV2CTX.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/DSSliderV2CTX.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
+
"sourcesContent": ["import { createContext } from 'react';\nimport type { DSSliderV2CTX } from './config/useSliderV2.js';\n\nconst defaultContext = {} as DSSliderV2CTX<boolean>;\n\n/** Context for cross component communication */\nexport const DSSliderV2Context = createContext<DSSliderV2CTX<boolean>>(defaultContext);\n\nexport default DSSliderV2Context;\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAA8B;AAG9B,MAAM,iBAAiB,CAAC;AAGjB,MAAM,wBAAoB,4BAAsC,cAAc;AAErF,IAAO,wBAAQ;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
var useSliderV2_exports = {};
|
30
|
+
__export(useSliderV2_exports, {
|
31
|
+
useSliderV2: () => useSliderV2
|
32
|
+
});
|
33
|
+
module.exports = __toCommonJS(useSliderV2_exports);
|
34
|
+
var React = __toESM(require("react"));
|
35
|
+
var import_react = __toESM(require("react"));
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
37
|
+
var import_uid = require("uid");
|
38
|
+
var import_react_desc_prop_types = require("../react-desc-prop-types.js");
|
39
|
+
var import_useValidateProps = require("./useValidateProps.js");
|
40
|
+
var import_useTickMarksValues = require("./useTickMarksValues.js");
|
41
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
42
|
+
const useSliderV2 = (propsFromUser) => {
|
43
|
+
const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(
|
44
|
+
propsFromUser,
|
45
|
+
import_react_desc_prop_types.defaultProps
|
46
|
+
);
|
47
|
+
const { multiple, value } = propsWithDefault;
|
48
|
+
const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
|
49
|
+
const instanceUid = import_react.default.useMemo(() => `slider-v2-${(0, import_uid.uid)(5)}`, []);
|
50
|
+
const rangeValues = import_react.default.useMemo(() => {
|
51
|
+
if (multiple === true)
|
52
|
+
return value;
|
53
|
+
return [value];
|
54
|
+
}, [multiple, value]);
|
55
|
+
const tickMarkPositions = (0, import_useTickMarksValues.useTickMarksValues)(propsWithDefault);
|
56
|
+
(0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSSliderV2PropTypes, { tickMarkPositions });
|
57
|
+
const ownerPropConfig = (0, import_ds_utilities.useOwnerProps)(propsWithDefault);
|
58
|
+
return import_react.default.useMemo(
|
59
|
+
() => ({
|
60
|
+
propsWithDefault,
|
61
|
+
xstyledProps,
|
62
|
+
instanceUid,
|
63
|
+
rangeValues,
|
64
|
+
tickMarkPositions,
|
65
|
+
...ownerPropConfig
|
66
|
+
}),
|
67
|
+
[propsWithDefault, xstyledProps, instanceUid, rangeValues, tickMarkPositions, ownerPropConfig]
|
68
|
+
);
|
69
|
+
};
|
70
|
+
//# sourceMappingURL=useSliderV2.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/config/useSliderV2.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport type { XstyledProps } from '@elliemae/ds-props-helpers';\nimport { useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { type DSSliderV2T, DSSliderV2PropTypes, defaultProps } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport { useTickMarksValues } from './useTickMarksValues.js';\nimport { useOwnerProps } from '@elliemae/ds-utilities';\n\nexport interface DSSliderV2CTX<TMultiple extends boolean> {\n propsWithDefault: DSSliderV2T.InternalProps<TMultiple>;\n xstyledProps: XstyledProps;\n instanceUid: string;\n rangeValues: [number, number] | [number];\n tickMarkPositions: number[];\n getOwnerProps: () => DSSliderV2T.InternalProps<TMultiple>;\n getOwnerPropsArguments: () => Record<string, unknown>;\n}\n\nexport const useSliderV2 = <TMultiple extends boolean>(propsFromUser: DSSliderV2T.Props<TMultiple>) => {\n // =============================================================================\n // MERGE WITH DEFAULT\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSSliderV2T.InternalProps<TMultiple>>(\n propsFromUser,\n defaultProps as DSSliderV2T.DefaultProps<TMultiple>,\n );\n\n const { multiple, value } = propsWithDefault;\n\n // =============================================================================\n // XSTYLED PROPS\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const instanceUid = React.useMemo(() => `slider-v2-${uid(5)}`, []);\n\n const rangeValues = React.useMemo(() => {\n if (multiple === true) return value as [number, number];\n return [value] as [number];\n }, [multiple, value]);\n\n // =============================================================================\n // HELPERS HOOKS CONFIGS\n // =============================================================================\n const tickMarkPositions = useTickMarksValues(propsWithDefault);\n\n // ===========================================================================\n // VALIDATE PROPS\n // ===========================================================================\n useValidateProps(propsWithDefault, DSSliderV2PropTypes, { tickMarkPositions });\n\n const ownerPropConfig = useOwnerProps(propsWithDefault);\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n instanceUid,\n rangeValues,\n tickMarkPositions,\n ...ownerPropConfig,\n }),\n [propsWithDefault, xstyledProps, instanceUid, rangeValues, tickMarkPositions, ownerPropConfig],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAElB,8BAAiE;AACjE,iBAAoB;AACpB,mCAAoE;AACpE,8BAAiC;AACjC,gCAAmC;AACnC,0BAA8B;AAYvB,MAAM,cAAc,CAA4B,kBAAgD;AAIrG,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AAEA,QAAM,EAAE,UAAU,MAAM,IAAI;AAK5B,QAAM,mBAAe,4CAAmB,gBAAgB;AAIxD,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,iBAAa,gBAAI,CAAC,KAAK,CAAC,CAAC;AAEjE,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM;AACtC,QAAI,aAAa;AAAM,aAAO;AAC9B,WAAO,CAAC,KAAK;AAAA,EACf,GAAG,CAAC,UAAU,KAAK,CAAC;AAKpB,QAAM,wBAAoB,8CAAmB,gBAAgB;AAK7D,gDAAiB,kBAAkB,kDAAqB,EAAE,kBAAkB,CAAC;AAE7E,QAAM,sBAAkB,mCAAc,gBAAgB;AAEtD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL;AAAA,IACA,CAAC,kBAAkB,cAAc,aAAa,aAAa,mBAAmB,eAAe;AAAA,EAC/F;AACF;",
|
6
|
+
"names": ["React"]
|
7
|
+
}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
var useTickMarksValues_exports = {};
|
30
|
+
__export(useTickMarksValues_exports, {
|
31
|
+
useTickMarksValues: () => useTickMarksValues
|
32
|
+
});
|
33
|
+
module.exports = __toCommonJS(useTickMarksValues_exports);
|
34
|
+
var React = __toESM(require("react"));
|
35
|
+
var import_react = __toESM(require("react"));
|
36
|
+
const getDefaultTickMarksValues = ({
|
37
|
+
minValue,
|
38
|
+
maxValue,
|
39
|
+
step
|
40
|
+
}) => {
|
41
|
+
const parsedValuesArray = [];
|
42
|
+
for (let value = minValue; value <= maxValue; value += step) {
|
43
|
+
parsedValuesArray.push(value);
|
44
|
+
}
|
45
|
+
return parsedValuesArray;
|
46
|
+
};
|
47
|
+
const useTickMarksValues = (props) => {
|
48
|
+
const { minValue, maxValue, step } = props;
|
49
|
+
return import_react.default.useMemo(() => getDefaultTickMarksValues({ minValue, maxValue, step }), [maxValue, minValue, step]);
|
50
|
+
};
|
51
|
+
//# sourceMappingURL=useTickMarksValues.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/config/useTickMarksValues.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
+
"sourcesContent": ["import React from 'react';\nimport type { DSSliderV2T } from '../react-desc-prop-types.js';\n\n// Tick mark values will be generated from the minValue, maxValue and step props\nconst getDefaultTickMarksValues = ({\n minValue,\n maxValue,\n step,\n}: {\n minValue: number;\n maxValue: number;\n step: number;\n}) => {\n const parsedValuesArray: number[] = [];\n for (let value = minValue; value <= maxValue; value += step) {\n parsedValuesArray.push(value);\n }\n return parsedValuesArray;\n};\n\nexport const useTickMarksValues = <TMultiple extends boolean>(props: DSSliderV2T.InternalProps<TMultiple>) => {\n const { minValue, maxValue, step } = props;\n return React.useMemo(() => getDefaultTickMarksValues({ minValue, maxValue, step }), [maxValue, minValue, step]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAIlB,MAAM,4BAA4B,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AACF,MAIM;AACJ,QAAM,oBAA8B,CAAC;AACrC,WAAS,QAAQ,UAAU,SAAS,UAAU,SAAS,MAAM;AAC3D,sBAAkB,KAAK,KAAK;AAAA,EAC9B;AACA,SAAO;AACT;AAEO,MAAM,qBAAqB,CAA4B,UAAgD;AAC5G,QAAM,EAAE,UAAU,UAAU,KAAK,IAAI;AACrC,SAAO,aAAAA,QAAM,QAAQ,MAAM,0BAA0B,EAAE,UAAU,UAAU,KAAK,CAAC,GAAG,CAAC,UAAU,UAAU,IAAI,CAAC;AAChH;",
|
6
|
+
"names": ["React"]
|
7
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
var useValidateProps_exports = {};
|
30
|
+
__export(useValidateProps_exports, {
|
31
|
+
useValidateProps: () => useValidateProps
|
32
|
+
});
|
33
|
+
module.exports = __toCommonJS(useValidateProps_exports);
|
34
|
+
var React = __toESM(require("react"));
|
35
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
36
|
+
var import_constants = require("../constants/index.js");
|
37
|
+
const useValidateProps = (props, propTypes, { tickMarkPositions }) => {
|
38
|
+
(0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSSliderV2Name);
|
39
|
+
if (props.customTickMarksValues.length && props.customTickMarksValues.length !== tickMarkPositions.length) {
|
40
|
+
throw new Error(
|
41
|
+
`The length of the customTickMarksValues prop must be equal to the length of the tickMarkPositions array (${tickMarkPositions.length}).`
|
42
|
+
);
|
43
|
+
}
|
44
|
+
};
|
45
|
+
//# sourceMappingURL=useValidateProps.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
+
"sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { WeakValidationMap } from 'react';\nimport { type DSSliderV2T } from '../react-desc-prop-types.js';\nimport { DSSliderV2Name } from '../constants/index.js';\n\nexport const useValidateProps = <TMultiple extends boolean>(\n props: DSSliderV2T.InternalProps<TMultiple>,\n propTypes: WeakValidationMap<unknown>,\n { tickMarkPositions }: { tickMarkPositions: number[] },\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSSliderV2Name);\n\n if (props.customTickMarksValues.length && props.customTickMarksValues.length !== tickMarkPositions.length) {\n throw new Error(\n `The length of the customTickMarksValues prop must be equal to the length of the tickMarkPositions array (${tickMarkPositions.length}).`,\n );\n }\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,uBAA+B;AAExB,MAAM,mBAAmB,CAC9B,OACA,WACA,EAAE,kBAAkB,MACX;AAET,8DAA+B,OAAO,WAAW,+BAAc;AAE/D,MAAI,MAAM,sBAAsB,UAAU,MAAM,sBAAsB,WAAW,kBAAkB,QAAQ;AACzG,UAAM,IAAI;AAAA,MACR,4GAA4G,kBAAkB;AAAA,IAChI;AAAA,EACF;AACF;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
var constants_exports = {};
|
30
|
+
__export(constants_exports, {
|
31
|
+
DSSliderV2Name: () => DSSliderV2Name,
|
32
|
+
SLIDER_V2_DATA_TESTID: () => SLIDER_V2_DATA_TESTID,
|
33
|
+
SLIDER_V2_SLOTS: () => SLIDER_V2_SLOTS
|
34
|
+
});
|
35
|
+
module.exports = __toCommonJS(constants_exports);
|
36
|
+
var React = __toESM(require("react"));
|
37
|
+
var import_ds_system = require("@elliemae/ds-system");
|
38
|
+
const DSSliderV2Name = "DSSliderV2";
|
39
|
+
const SLIDER_V2_SLOTS = {
|
40
|
+
ROOT: "root",
|
41
|
+
RANGE_WRAPPER: "range-wrapper",
|
42
|
+
TRACK: "track",
|
43
|
+
DOT: "dot",
|
44
|
+
DOT_CONTAINER: "dot-container",
|
45
|
+
TICK_MARK_VALUE: "tick-mark-value",
|
46
|
+
TICK_MARK_CONTAINER: "tick-mark-container",
|
47
|
+
THUMB: "thumb"
|
48
|
+
};
|
49
|
+
const SLIDER_V2_DATA_TESTID = (0, import_ds_system.slotObjectToDataTestIds)(DSSliderV2Name, SLIDER_V2_SLOTS);
|
50
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
+
"sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSSliderV2Name = 'DSSliderV2';\n\n// we are giving \"component_name_slots\" to avoid errors on duplicate exports variables in aggregators\nexport const SLIDER_V2_SLOTS = {\n ROOT: 'root',\n RANGE_WRAPPER: 'range-wrapper',\n TRACK: 'track',\n DOT: 'dot',\n DOT_CONTAINER: 'dot-container',\n TICK_MARK_VALUE: 'tick-mark-value',\n TICK_MARK_CONTAINER: 'tick-mark-container',\n THUMB: 'thumb',\n} as const;\n\n// we are giving \"component_name_data_testid\" to avoid errors on duplicate exports variables in aggregators\nexport const SLIDER_V2_DATA_TESTID = slotObjectToDataTestIds(DSSliderV2Name, SLIDER_V2_SLOTS);\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,iBAAiB;AAGvB,MAAM,kBAAkB;AAAA,EAC7B,MAAM;AAAA,EACN,eAAe;AAAA,EACf,OAAO;AAAA,EACP,KAAK;AAAA,EACL,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,qBAAqB;AAAA,EACrB,OAAO;AACT;AAGO,MAAM,4BAAwB,0CAAwB,gBAAgB,eAAe;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
var src_exports = {};
|
30
|
+
__export(src_exports, {
|
31
|
+
DSSliderV2: () => import_DSSliderV2.DSSliderV2,
|
32
|
+
DSSliderV2Name: () => import_constants.DSSliderV2Name,
|
33
|
+
DSSliderV2WithSchema: () => import_DSSliderV2.DSSliderV2WithSchema,
|
34
|
+
SLIDER_V2_DATA_TESTID: () => import_constants.SLIDER_V2_DATA_TESTID,
|
35
|
+
SLIDER_V2_SLOTS: () => import_constants.SLIDER_V2_SLOTS
|
36
|
+
});
|
37
|
+
module.exports = __toCommonJS(src_exports);
|
38
|
+
var React = __toESM(require("react"));
|
39
|
+
var import_DSSliderV2 = require("./DSSliderV2.js");
|
40
|
+
var import_react_desc_prop_types = require("./react-desc-prop-types.js");
|
41
|
+
var import_constants = require("./constants/index.js");
|
42
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
+
"sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSSliderV2, DSSliderV2WithSchema } from './DSSliderV2.js';\nexport { type DSSliderV2T } from './react-desc-prop-types.js';\nexport { DSSliderV2Name, SLIDER_V2_SLOTS, SLIDER_V2_DATA_TESTID } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,wBAAiD;AACjD,mCAAiC;AACjC,uBAAuE;",
|
6
|
+
"names": []
|
7
|
+
}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
var MainContent_exports = {};
|
30
|
+
__export(MainContent_exports, {
|
31
|
+
MainContent: () => MainContent
|
32
|
+
});
|
33
|
+
module.exports = __toCommonJS(MainContent_exports);
|
34
|
+
var React = __toESM(require("react"));
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
36
|
+
var import_react = require("react");
|
37
|
+
var import_react_range = require("react-range");
|
38
|
+
var import_DSSliderV2CTX = __toESM(require("../DSSliderV2CTX.js"));
|
39
|
+
var import_styles = require("../styles.js");
|
40
|
+
var import_Track = require("./Track.js");
|
41
|
+
var import_Thumb = require("./Thumb.js");
|
42
|
+
const MainContent = () => {
|
43
|
+
const {
|
44
|
+
propsWithDefault: { step, minValue, maxValue, disabled, onValueChange, className },
|
45
|
+
xstyledProps,
|
46
|
+
rangeValues,
|
47
|
+
getOwnerProps,
|
48
|
+
getOwnerPropsArguments
|
49
|
+
} = (0, import_react.useContext)(import_DSSliderV2CTX.default);
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
51
|
+
import_styles.StyledWrapper,
|
52
|
+
{
|
53
|
+
width: "100%",
|
54
|
+
style: { maxWidth: "100%" },
|
55
|
+
alignItems: "center",
|
56
|
+
rows: ["auto", "auto"],
|
57
|
+
getOwnerProps,
|
58
|
+
getOwnerPropsArguments,
|
59
|
+
className,
|
60
|
+
...xstyledProps,
|
61
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
62
|
+
import_styles.StyledRangeWrapper,
|
63
|
+
{
|
64
|
+
rows: ["28px", "auto"],
|
65
|
+
alignItems: "center",
|
66
|
+
margin: "0 16px",
|
67
|
+
minHeight: "28px",
|
68
|
+
getOwnerProps,
|
69
|
+
getOwnerPropsArguments,
|
70
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
71
|
+
import_react_range.Range,
|
72
|
+
{
|
73
|
+
step,
|
74
|
+
min: minValue,
|
75
|
+
max: maxValue,
|
76
|
+
values: rangeValues,
|
77
|
+
disabled,
|
78
|
+
onChange: (values) => {
|
79
|
+
if (values.length === 1) {
|
80
|
+
onValueChange(values[0]);
|
81
|
+
} else {
|
82
|
+
onValueChange(values);
|
83
|
+
}
|
84
|
+
},
|
85
|
+
renderTrack: (args) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Track.Track, { ...args }),
|
86
|
+
renderThumb: (args) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Thumb.Thumb, { ...args }),
|
87
|
+
allowOverlap: false
|
88
|
+
}
|
89
|
+
)
|
90
|
+
}
|
91
|
+
)
|
92
|
+
}
|
93
|
+
);
|
94
|
+
};
|
95
|
+
//# sourceMappingURL=MainContent.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/parts/MainContent.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
+
"sourcesContent": ["import { useContext } from 'react';\nimport { Range } from 'react-range';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\nimport { StyledRangeWrapper, StyledWrapper } from '../styles.js';\nimport { Track } from './Track.js';\nimport { Thumb } from './Thumb.js';\nimport type { DSSliderV2T } from '../react-desc-prop-types.js';\n\nexport const MainContent = () => {\n const {\n propsWithDefault: { step, minValue, maxValue, disabled, onValueChange, className },\n xstyledProps,\n rangeValues,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n return (\n <StyledWrapper\n width=\"100%\"\n style={{ maxWidth: '100%' }}\n alignItems=\"center\"\n rows={['auto', 'auto']}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n className={className}\n {...xstyledProps}\n >\n <StyledRangeWrapper\n rows={['28px', 'auto']}\n alignItems=\"center\"\n margin=\"0 16px\"\n minHeight=\"28px\"\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <Range\n step={step}\n min={minValue}\n max={maxValue}\n values={rangeValues}\n disabled={disabled}\n onChange={(values) => {\n if (values.length === 1) {\n onValueChange(values[0]);\n } else {\n onValueChange(values as DSSliderV2T.ValueType<true>);\n }\n }}\n renderTrack={(args) => <Track {...args} />}\n renderThumb={(args) => <Thumb {...args} />}\n allowOverlap={false}\n />\n </StyledRangeWrapper>\n </StyledWrapper>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiDU;AAjDjC,mBAA2B;AAC3B,yBAAsB;AACtB,2BAA8B;AAC9B,oBAAkD;AAClD,mBAAsB;AACtB,mBAAsB;AAGf,MAAM,cAAc,MAAM;AAC/B,QAAM;AAAA,IACJ,kBAAkB,EAAE,MAAM,UAAU,UAAU,UAAU,eAAe,UAAU;AAAA,IACjF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,qBAAAA,OAAiB;AAEhC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,OAAO,EAAE,UAAU,OAAO;AAAA,MAC1B,YAAW;AAAA,MACX,MAAM,CAAC,QAAQ,MAAM;AAAA,MACrB;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,QAAC;AAAA;AAAA,UACC,MAAM,CAAC,QAAQ,MAAM;AAAA,UACrB,YAAW;AAAA,UACX,QAAO;AAAA,UACP,WAAU;AAAA,UACV;AAAA,UACA;AAAA,UAEA;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA,KAAK;AAAA,cACL,KAAK;AAAA,cACL,QAAQ;AAAA,cACR;AAAA,cACA,UAAU,CAAC,WAAW;AACpB,oBAAI,OAAO,WAAW,GAAG;AACvB,gCAAc,OAAO,CAAC,CAAC;AAAA,gBACzB,OAAO;AACL,gCAAc,MAAqC;AAAA,gBACrD;AAAA,cACF;AAAA,cACA,aAAa,CAAC,SAAS,4CAAC,sBAAO,GAAG,MAAM;AAAA,cACxC,aAAa,CAAC,SAAS,4CAAC,sBAAO,GAAG,MAAM;AAAA,cACxC,cAAc;AAAA;AAAA,UAChB;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;",
|
6
|
+
"names": ["DSSliderV2Context"]
|
7
|
+
}
|
@@ -0,0 +1,82 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __create = Object.create;
|
3
|
+
var __defProp = Object.defineProperty;
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
8
|
+
var __export = (target, all) => {
|
9
|
+
for (var name in all)
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
11
|
+
};
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
14
|
+
for (let key of __getOwnPropNames(from))
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
17
|
+
}
|
18
|
+
return to;
|
19
|
+
};
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
26
|
+
mod
|
27
|
+
));
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
+
var Thumb_exports = {};
|
30
|
+
__export(Thumb_exports, {
|
31
|
+
Thumb: () => Thumb
|
32
|
+
});
|
33
|
+
module.exports = __toCommonJS(Thumb_exports);
|
34
|
+
var React = __toESM(require("react"));
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
36
|
+
var import_react = require("react");
|
37
|
+
var import_ds_tooltip = require("@elliemae/ds-tooltip");
|
38
|
+
var import_thumbLabels = require("../utils/thumbLabels.js");
|
39
|
+
var import_styles = require("../styles.js");
|
40
|
+
var import_DSSliderV2CTX = __toESM(require("../DSSliderV2CTX.js"));
|
41
|
+
const Thumb = ({ index, props, isDragged }) => {
|
42
|
+
const {
|
43
|
+
propsWithDefault: { disabled, customTickMarksValues, step, minValue },
|
44
|
+
rangeValues,
|
45
|
+
getOwnerProps,
|
46
|
+
getOwnerPropsArguments
|
47
|
+
} = (0, import_react.useContext)(import_DSSliderV2CTX.default);
|
48
|
+
const [isHovered, setIsHovered] = (0, import_react.useState)(false);
|
49
|
+
const [isFocused, setIsFocused] = (0, import_react.useState)(false);
|
50
|
+
const { ref, ...rest } = props;
|
51
|
+
const label = (0, import_thumbLabels.conformedThumbLabel)({ rangeValues, customTickMarksValues, index, step, minValue });
|
52
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
53
|
+
import_styles.StyledThumb,
|
54
|
+
{
|
55
|
+
...rest,
|
56
|
+
style: { ...rest.style, zIndex: void 0 },
|
57
|
+
innerRef: ref,
|
58
|
+
disabled,
|
59
|
+
onMouseEnter: () => {
|
60
|
+
setIsHovered(true);
|
61
|
+
setIsFocused(false);
|
62
|
+
},
|
63
|
+
onMouseLeave: () => setIsHovered(false),
|
64
|
+
onKeyDownCapture: () => setIsFocused(true),
|
65
|
+
onBlur: () => setIsFocused(false),
|
66
|
+
getOwnerProps,
|
67
|
+
getOwnerPropsArguments,
|
68
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
69
|
+
import_ds_tooltip.DSTooltipV3,
|
70
|
+
{
|
71
|
+
text: label,
|
72
|
+
showPopover: isDragged || isHovered || isFocused,
|
73
|
+
customOffset: [0, 20],
|
74
|
+
withoutAnimation: true,
|
75
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {})
|
76
|
+
},
|
77
|
+
label
|
78
|
+
)
|
79
|
+
}
|
80
|
+
);
|
81
|
+
};
|
82
|
+
//# sourceMappingURL=Thumb.js.map
|
@@ -0,0 +1,7 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/parts/Thumb.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
4
|
+
"sourcesContent": ["import React, { useContext, useState } from 'react';\nimport { DSTooltipV3 } from '@elliemae/ds-tooltip';\nimport { conformedThumbLabel } from '../utils/thumbLabels.js';\nimport { StyledThumb } from '../styles.js';\nimport type { IRenderThumbParams } from 'react-range/lib/types.js';\nimport DSSliderV2Context from '../DSSliderV2CTX.js';\n\nexport const Thumb = ({ index, props, isDragged }: IRenderThumbParams) => {\n const {\n propsWithDefault: { disabled, customTickMarksValues, step, minValue },\n rangeValues,\n getOwnerProps,\n getOwnerPropsArguments,\n } = useContext(DSSliderV2Context);\n\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n\n const { ref, ...rest } = props;\n\n const label = conformedThumbLabel({ rangeValues, customTickMarksValues, index, step, minValue });\n\n return (\n <StyledThumb\n {...rest}\n style={{ ...rest.style, zIndex: undefined }}\n innerRef={ref}\n disabled={disabled}\n onMouseEnter={() => {\n setIsHovered(true);\n setIsFocused(false);\n }}\n onMouseLeave={() => setIsHovered(false)}\n onKeyDownCapture={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n <DSTooltipV3\n key={label}\n text={label}\n showPopover={isDragged || isHovered || isFocused}\n customOffset={[0, 20]}\n withoutAnimation\n >\n <></>\n </DSTooltipV3>\n </StyledThumb>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD6Cf;AA7CR,mBAA4C;AAC5C,wBAA4B;AAC5B,yBAAoC;AACpC,oBAA4B;AAE5B,2BAA8B;AAEvB,MAAM,QAAQ,CAAC,EAAE,OAAO,OAAO,UAAU,MAA0B;AACxE,QAAM;AAAA,IACJ,kBAAkB,EAAE,UAAU,uBAAuB,MAAM,SAAS;AAAA,IACpE;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,qBAAAA,OAAiB;AAEhC,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAS,KAAK;AAChD,QAAM,CAAC,WAAW,YAAY,QAAI,uBAAS,KAAK;AAEhD,QAAM,EAAE,KAAK,GAAG,KAAK,IAAI;AAEzB,QAAM,YAAQ,wCAAoB,EAAE,aAAa,uBAAuB,OAAO,MAAM,SAAS,CAAC;AAE/F,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,OAAO,EAAE,GAAG,KAAK,OAAO,QAAQ,OAAU;AAAA,MAC1C,UAAU;AAAA,MACV;AAAA,MACA,cAAc,MAAM;AAClB,qBAAa,IAAI;AACjB,qBAAa,KAAK;AAAA,MACpB;AAAA,MACA,cAAc,MAAM,aAAa,KAAK;AAAA,MACtC,kBAAkB,MAAM,aAAa,IAAI;AAAA,MACzC,QAAQ,MAAM,aAAa,KAAK;AAAA,MAChC;AAAA,MACA;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UAEC,MAAM;AAAA,UACN,aAAa,aAAa,aAAa;AAAA,UACvC,cAAc,CAAC,GAAG,EAAE;AAAA,UACpB,kBAAgB;AAAA,UAEhB,qFAAE;AAAA;AAAA,QANG;AAAA,MAOP;AAAA;AAAA,EACF;AAEJ;",
|
6
|
+
"names": ["DSSliderV2Context"]
|
7
|
+
}
|