@elliemae/ds-slider 2.3.1 → 3.0.0-alpha.3
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/dist/cjs/DSSlider.js +60 -0
- package/dist/cjs/DSSlider.js.map +7 -0
- package/dist/cjs/components/SliderImp.js +195 -0
- package/dist/cjs/components/SliderImp.js.map +7 -0
- package/dist/cjs/components/Thumb.js +88 -0
- package/dist/cjs/components/Thumb.js.map +7 -0
- package/dist/cjs/components/TickMarks.js +87 -0
- package/dist/cjs/components/TickMarks.js.map +7 -0
- package/dist/cjs/components/TickMarksValues.js +64 -0
- package/dist/cjs/components/TickMarksValues.js.map +7 -0
- package/dist/cjs/components/Track.js +94 -0
- package/dist/cjs/components/Track.js.map +7 -0
- package/dist/cjs/components/context.js +36 -0
- package/dist/cjs/components/context.js.map +7 -0
- package/dist/cjs/components/styled.js +96 -0
- package/dist/cjs/components/styled.js.map +7 -0
- package/dist/cjs/components/utils.js +59 -0
- package/dist/cjs/components/utils.js.map +7 -0
- package/dist/cjs/index.js +36 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/prop-types.js +67 -0
- package/dist/cjs/prop-types.js.map +7 -0
- package/dist/esm/DSSlider.js +33 -0
- package/dist/esm/DSSlider.js.map +7 -0
- package/dist/esm/components/SliderImp.js +173 -0
- package/dist/esm/components/SliderImp.js.map +7 -0
- package/dist/esm/components/Thumb.js +61 -0
- package/dist/esm/components/Thumb.js.map +7 -0
- package/dist/esm/components/TickMarks.js +58 -0
- package/dist/esm/components/TickMarks.js.map +7 -0
- package/dist/esm/components/TickMarksValues.js +35 -0
- package/dist/esm/components/TickMarksValues.js.map +7 -0
- package/dist/esm/components/Track.js +67 -0
- package/dist/esm/components/Track.js.map +7 -0
- package/dist/esm/components/context.js +7 -0
- package/dist/esm/components/context.js.map +7 -0
- package/dist/esm/components/styled.js +67 -0
- package/dist/esm/components/styled.js.map +7 -0
- package/dist/esm/components/utils.js +30 -0
- package/dist/esm/components/utils.js.map +7 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/prop-types.js +38 -0
- package/dist/esm/prop-types.js.map +7 -0
- package/package.json +49 -40
- package/cjs/DSSlider.js +0 -33
- package/cjs/components/SliderImp.js +0 -199
- package/cjs/components/Thumb.js +0 -71
- package/cjs/components/TickMarks.js +0 -46
- package/cjs/components/TickMarksValues.js +0 -43
- package/cjs/components/Track.js +0 -67
- package/cjs/components/context.js +0 -13
- package/cjs/components/styled.js +0 -61
- package/cjs/components/utils.js +0 -49
- package/cjs/index.js +0 -11
- package/cjs/prop-types.js +0 -64
- package/esm/DSSlider.js +0 -23
- package/esm/components/SliderImp.js +0 -192
- package/esm/components/Thumb.js +0 -64
- package/esm/components/TickMarks.js +0 -39
- package/esm/components/TickMarksValues.js +0 -36
- package/esm/components/Track.js +0 -59
- package/esm/components/context.js +0 -5
- package/esm/components/styled.js +0 -47
- package/esm/components/utils.js +0 -44
- package/esm/index.js +0 -1
- package/esm/prop-types.js +0 -59
- package/types/DSSlider.d.ts +0 -107
- package/types/components/SliderImp.d.ts +0 -3
- package/types/components/Thumb.d.ts +0 -14
- package/types/components/TickMarks.d.ts +0 -3
- package/types/components/TickMarksValues.d.ts +0 -3
- package/types/components/Track.d.ts +0 -6
- package/types/components/context.d.ts +0 -2
- package/types/components/styled.d.ts +0 -8
- package/types/components/utils.d.ts +0 -2
- package/types/index.d.ts +0 -2
- package/types/prop-types.d.ts +0 -109
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useState, useEffect, useRef, useMemo } from "react";
|
|
3
|
+
import { v4 as uuidv4 } from "uuid";
|
|
4
|
+
import { Range } from "react-range";
|
|
5
|
+
import { usePrevious } from "@elliemae/ds-utilities";
|
|
6
|
+
import DSTruncatedTooltipText, {
|
|
7
|
+
TooltipTextProvider
|
|
8
|
+
} from "@elliemae/ds-truncated-tooltip-text";
|
|
9
|
+
import { Grid } from "@elliemae/ds-grid";
|
|
10
|
+
import Track from "./Track";
|
|
11
|
+
import Thumb from "./Thumb";
|
|
12
|
+
import {
|
|
13
|
+
LabelWrapper,
|
|
14
|
+
StyledRangeWrapper,
|
|
15
|
+
LabelText,
|
|
16
|
+
ValueText
|
|
17
|
+
} from "./styled";
|
|
18
|
+
import { conformedLabel } from "./utils";
|
|
19
|
+
import { SliderContext } from "./context";
|
|
20
|
+
const getSubArrayFromRange = (arr, [minVal, maxVal], isCustomTickMarksValues = false) => {
|
|
21
|
+
const trueMinVal = isCustomTickMarksValues ? arr[minVal] : minVal;
|
|
22
|
+
const minIndex = arr.findIndex((el) => el === trueMinVal);
|
|
23
|
+
if (maxVal !== void 0) {
|
|
24
|
+
const trueMaxVal = isCustomTickMarksValues ? arr[maxVal] : maxVal;
|
|
25
|
+
const maxIndex = arr.findIndex((el) => el === trueMaxVal);
|
|
26
|
+
if (minIndex >= 0 && maxIndex > minIndex)
|
|
27
|
+
return arr.slice(minIndex, maxIndex + 1);
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
return [trueMinVal];
|
|
31
|
+
};
|
|
32
|
+
const SliderImp = (props) => {
|
|
33
|
+
const {
|
|
34
|
+
containerProps,
|
|
35
|
+
disabled,
|
|
36
|
+
label,
|
|
37
|
+
labelWithValue,
|
|
38
|
+
minValue,
|
|
39
|
+
maxValue,
|
|
40
|
+
step,
|
|
41
|
+
onChange,
|
|
42
|
+
withTickMarks,
|
|
43
|
+
withTickMarksValues,
|
|
44
|
+
withTwoHandles,
|
|
45
|
+
customTickMarksValues,
|
|
46
|
+
zIndex
|
|
47
|
+
} = props;
|
|
48
|
+
const ref = useRef();
|
|
49
|
+
const [width, setWidth] = useState(0);
|
|
50
|
+
const sliderUUID = useMemo(() => uuidv4(), []);
|
|
51
|
+
const parsedMinValue = useMemo(() => {
|
|
52
|
+
if (customTickMarksValues?.length)
|
|
53
|
+
return 0;
|
|
54
|
+
return minValue;
|
|
55
|
+
}, [customTickMarksValues?.length, minValue]);
|
|
56
|
+
const parsedMaxValue = useMemo(() => {
|
|
57
|
+
if (customTickMarksValues?.length)
|
|
58
|
+
return customTickMarksValues?.length - 1;
|
|
59
|
+
return maxValue;
|
|
60
|
+
}, [customTickMarksValues?.length, maxValue]);
|
|
61
|
+
const parsedStep = useMemo(() => {
|
|
62
|
+
if (customTickMarksValues?.length)
|
|
63
|
+
return 1;
|
|
64
|
+
return step;
|
|
65
|
+
}, [customTickMarksValues?.length, step]);
|
|
66
|
+
const parsedValuesArray = useMemo(() => {
|
|
67
|
+
if (customTickMarksValues?.length)
|
|
68
|
+
return customTickMarksValues;
|
|
69
|
+
const newLength = Math.ceil(maxValue / step);
|
|
70
|
+
const valuesArray = [];
|
|
71
|
+
for (let i = 0; i <= newLength; i += 1) {
|
|
72
|
+
valuesArray.push(step * i);
|
|
73
|
+
}
|
|
74
|
+
return valuesArray;
|
|
75
|
+
}, [customTickMarksValues?.length, minValue, maxValue, step]);
|
|
76
|
+
const [rangeValues, setRangeValues] = useState(withTwoHandles ? [parsedMinValue, parsedMaxValue] : [parsedMinValue]);
|
|
77
|
+
const [fullSelectedValues, setFullSelectedValues] = useState([]);
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
const selectedRangeValues = getSubArrayFromRange(parsedValuesArray, rangeValues, !!customTickMarksValues?.length);
|
|
80
|
+
setFullSelectedValues(selectedRangeValues);
|
|
81
|
+
}, [parsedValuesArray, rangeValues, customTickMarksValues?.length]);
|
|
82
|
+
const prevWithTwoHandles = usePrevious(withTwoHandles);
|
|
83
|
+
const resizeHandler = () => {
|
|
84
|
+
setWidth(0);
|
|
85
|
+
setWidth(ref.current?.clientWidth);
|
|
86
|
+
};
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
window.addEventListener("resize", resizeHandler);
|
|
89
|
+
return () => window.removeEventListener("resize", resizeHandler);
|
|
90
|
+
});
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
if (!prevWithTwoHandles && withTwoHandles) {
|
|
93
|
+
setRangeValues([parsedMinValue, parsedMaxValue]);
|
|
94
|
+
} else if (prevWithTwoHandles && !withTwoHandles) {
|
|
95
|
+
setRangeValues([parsedMinValue]);
|
|
96
|
+
}
|
|
97
|
+
}, [withTwoHandles]);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
setWidth(ref.current?.clientWidth);
|
|
100
|
+
}, [ref.current?.clientWidth]);
|
|
101
|
+
const [finalLabelText, finalValueText] = useMemo(() => conformedLabel(rangeValues, label, labelWithValue, withTwoHandles, customTickMarksValues, parsedStep), [
|
|
102
|
+
rangeValues,
|
|
103
|
+
label,
|
|
104
|
+
labelWithValue,
|
|
105
|
+
withTwoHandles,
|
|
106
|
+
customTickMarksValues,
|
|
107
|
+
parsedStep
|
|
108
|
+
]);
|
|
109
|
+
const SliderLabel = /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(LabelText, null, finalLabelText), finalLabelText && " ", /* @__PURE__ */ React2.createElement(ValueText, {
|
|
110
|
+
disabled
|
|
111
|
+
}, finalValueText));
|
|
112
|
+
return /* @__PURE__ */ React2.createElement(TooltipTextProvider, null, /* @__PURE__ */ React2.createElement("div", {
|
|
113
|
+
ref
|
|
114
|
+
}, /* @__PURE__ */ React2.createElement(Grid, {
|
|
115
|
+
width: "100%",
|
|
116
|
+
style: { maxWidth: "100%" },
|
|
117
|
+
containerProps,
|
|
118
|
+
"data-testid": "slider",
|
|
119
|
+
rows: ["auto", "auto"]
|
|
120
|
+
}, /* @__PURE__ */ React2.createElement(SliderContext.Provider, {
|
|
121
|
+
value: {
|
|
122
|
+
disabled,
|
|
123
|
+
sliderUUID,
|
|
124
|
+
label,
|
|
125
|
+
labelWithValue,
|
|
126
|
+
minValue: parsedMinValue,
|
|
127
|
+
maxValue: parsedMaxValue,
|
|
128
|
+
step: parsedStep,
|
|
129
|
+
parsedValuesArray,
|
|
130
|
+
withTickMarks,
|
|
131
|
+
withTickMarksValues,
|
|
132
|
+
withTwoHandles,
|
|
133
|
+
customTickMarksValues,
|
|
134
|
+
rangeValues,
|
|
135
|
+
fullSelectedValues,
|
|
136
|
+
zIndex
|
|
137
|
+
}
|
|
138
|
+
}, finalLabelText && /* @__PURE__ */ React2.createElement(LabelWrapper, {
|
|
139
|
+
width
|
|
140
|
+
}, /* @__PURE__ */ React2.createElement(DSTruncatedTooltipText, {
|
|
141
|
+
value: SliderLabel
|
|
142
|
+
})), /* @__PURE__ */ React2.createElement(StyledRangeWrapper, null, /* @__PURE__ */ React2.createElement(Range, {
|
|
143
|
+
step: parsedStep,
|
|
144
|
+
min: parsedMinValue,
|
|
145
|
+
max: parsedMaxValue,
|
|
146
|
+
values: rangeValues,
|
|
147
|
+
disabled,
|
|
148
|
+
onChange: (values) => {
|
|
149
|
+
if (withTwoHandles && values[0] === values[1])
|
|
150
|
+
return;
|
|
151
|
+
setRangeValues(values);
|
|
152
|
+
onChange(values);
|
|
153
|
+
},
|
|
154
|
+
renderTrack: ({ props: trackProps, children }) => /* @__PURE__ */ React2.createElement(Track, {
|
|
155
|
+
props: trackProps
|
|
156
|
+
}, children),
|
|
157
|
+
renderThumb: (renderArgs) => {
|
|
158
|
+
const { index, props: thumbProps, isDragged } = renderArgs;
|
|
159
|
+
return /* @__PURE__ */ React2.createElement(Thumb, {
|
|
160
|
+
key: `${sliderUUID}-${thumbProps.key}`,
|
|
161
|
+
props: thumbProps,
|
|
162
|
+
isDragged,
|
|
163
|
+
index
|
|
164
|
+
});
|
|
165
|
+
},
|
|
166
|
+
allowOverlap: false
|
|
167
|
+
}))))));
|
|
168
|
+
};
|
|
169
|
+
var SliderImp_default = SliderImp;
|
|
170
|
+
export {
|
|
171
|
+
SliderImp_default as default
|
|
172
|
+
};
|
|
173
|
+
//# sourceMappingURL=SliderImp.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/SliderImp.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React, { useState, useEffect, useRef, useMemo } from 'react';\nimport { v4 as uuidv4 } from 'uuid';\nimport { Range } from 'react-range';\nimport { usePrevious } from '@elliemae/ds-utilities';\nimport DSTruncatedTooltipText, {\n TooltipTextProvider,\n} from '@elliemae/ds-truncated-tooltip-text';\nimport { Grid } from '@elliemae/ds-grid';\nimport Track from './Track';\nimport Thumb from './Thumb';\nimport {\n LabelWrapper,\n StyledRangeWrapper,\n LabelText,\n ValueText,\n} from './styled';\nimport { conformedLabel } from './utils';\nimport { SliderContext } from './context';\n\nconst getSubArrayFromRange = (\n arr,\n [minVal, maxVal], // maxValue is undefined when only one handler\n isCustomTickMarksValues = false,\n) => {\n const trueMinVal = isCustomTickMarksValues ? arr[minVal] : minVal;\n const minIndex = arr.findIndex((el) => el === trueMinVal);\n\n if (maxVal !== undefined) {\n // if two handlers, return the found slice\n const trueMaxVal = isCustomTickMarksValues ? arr[maxVal] : maxVal;\n const maxIndex = arr.findIndex((el) => el === trueMaxVal);\n\n if (minIndex >= 0 && maxIndex > minIndex)\n return arr.slice(minIndex, maxIndex + 1);\n return [];\n }\n // if only one handler, return the value in an array\n return [trueMinVal];\n};\n\nconst SliderImp = (props) => {\n const {\n containerProps,\n disabled,\n label,\n labelWithValue,\n minValue,\n maxValue,\n step,\n onChange,\n withTickMarks,\n withTickMarksValues,\n withTwoHandles,\n customTickMarksValues,\n zIndex,\n } = props;\n const ref = useRef();\n const [width, setWidth] = useState(0);\n const sliderUUID = useMemo(() => uuidv4(), []);\n\n const parsedMinValue = useMemo(() => {\n // ensure this works correctly with customTickMarksValues array\n if (customTickMarksValues?.length) return 0;\n return minValue;\n }, [customTickMarksValues?.length, minValue]);\n const parsedMaxValue = useMemo(() => {\n // ensure this works correctly with customTickMarksValues array\n if (customTickMarksValues?.length) return customTickMarksValues?.length - 1;\n return maxValue;\n }, [customTickMarksValues?.length, maxValue]);\n const parsedStep = useMemo(() => {\n // ensure this works correctly with customTickMarksValues array\n if (customTickMarksValues?.length) return 1;\n return step;\n }, [customTickMarksValues?.length, step]);\n\n const parsedValuesArray = useMemo(() => {\n // ensure this works correctly with customTickMarksValues array\n if (customTickMarksValues?.length) return customTickMarksValues;\n const newLength = Math.ceil(maxValue / step);\n const valuesArray = [];\n for (let i = 0; i <= newLength; i += 1) {\n valuesArray.push(step * i);\n }\n\n return valuesArray;\n }, [customTickMarksValues?.length, minValue, maxValue, step]);\n\n const [rangeValues, setRangeValues] = useState(\n withTwoHandles ? [parsedMinValue, parsedMaxValue] : [parsedMinValue],\n );\n // track the full slice of values selected instead of only the limits\n // this is important to handle the selected range labels colors\n const [fullSelectedValues, setFullSelectedValues] = useState([]);\n useEffect(() => {\n const selectedRangeValues = getSubArrayFromRange(\n parsedValuesArray,\n rangeValues,\n !!customTickMarksValues?.length,\n );\n setFullSelectedValues(selectedRangeValues);\n }, [parsedValuesArray, rangeValues, customTickMarksValues?.length]);\n\n const prevWithTwoHandles = usePrevious(withTwoHandles);\n const resizeHandler = () => {\n setWidth(0);\n setWidth(ref.current?.clientWidth);\n };\n useEffect(() => {\n window.addEventListener('resize', resizeHandler);\n return () => window.removeEventListener('resize', resizeHandler);\n });\n useEffect(() => {\n if (!prevWithTwoHandles && withTwoHandles) {\n setRangeValues([parsedMinValue, parsedMaxValue]);\n } else if (prevWithTwoHandles && !withTwoHandles) {\n setRangeValues([parsedMinValue]);\n }\n }, [withTwoHandles]);\n\n useEffect(() => {\n setWidth(ref.current?.clientWidth);\n }, [ref.current?.clientWidth]);\n\n const [finalLabelText, finalValueText] = useMemo(\n () =>\n conformedLabel(\n rangeValues,\n label,\n labelWithValue,\n withTwoHandles,\n customTickMarksValues,\n parsedStep,\n ),\n [\n rangeValues,\n label,\n labelWithValue,\n withTwoHandles,\n customTickMarksValues,\n parsedStep,\n ],\n );\n\n const SliderLabel = (\n <>\n <LabelText>{finalLabelText}</LabelText>\n {finalLabelText && ' '}\n <ValueText disabled={disabled}>{finalValueText}</ValueText>\n </>\n );\n\n return (\n <TooltipTextProvider>\n <div ref={ref}>\n <Grid\n width=\"100%\"\n style={{ maxWidth: '100%' }}\n containerProps={containerProps}\n data-testid=\"slider\"\n rows={['auto', 'auto']}\n >\n <SliderContext.Provider\n value={{\n disabled,\n sliderUUID,\n label,\n labelWithValue,\n minValue: parsedMinValue,\n maxValue: parsedMaxValue,\n step: parsedStep,\n parsedValuesArray,\n withTickMarks,\n withTickMarksValues,\n withTwoHandles,\n customTickMarksValues,\n rangeValues,\n fullSelectedValues,\n zIndex,\n }}\n >\n {finalLabelText && (\n <LabelWrapper width={width}>\n <DSTruncatedTooltipText value={SliderLabel} />\n </LabelWrapper>\n )}\n <StyledRangeWrapper>\n <Range\n step={parsedStep}\n min={parsedMinValue}\n max={parsedMaxValue}\n values={rangeValues}\n disabled={disabled}\n onChange={(values) => {\n if (withTwoHandles && values[0] === values[1]) return;\n setRangeValues(values);\n onChange(values);\n }}\n renderTrack={({ props: trackProps, children }) => (\n <Track props={trackProps}>{children}</Track>\n )}\n renderThumb={(renderArgs) => {\n const { index, props: thumbProps, isDragged } = renderArgs;\n return (\n <Thumb\n key={`${sliderUUID}-${thumbProps.key}`}\n props={thumbProps}\n isDragged={isDragged}\n index={index}\n />\n );\n }}\n allowOverlap={false}\n />\n </StyledRangeWrapper>\n </SliderContext.Provider>\n </Grid>\n </div>\n </TooltipTextProvider>\n );\n};\n\n// SliderImp.propTypes = sliderPropTypes;\n\nexport default SliderImp;\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import React2, { useContext, useState } from "react";
|
|
22
|
+
import PropTypes from "prop-types";
|
|
23
|
+
import { TooltipText } from "@elliemae/ds-tooltip";
|
|
24
|
+
import { SliderContext } from "./context";
|
|
25
|
+
import { conformedThumbLabel } from "./utils";
|
|
26
|
+
import { ThumbStyled, TooltipContainerStyled, TooltipArrow } from "./styled";
|
|
27
|
+
const Thumb = ({ index, props, isDragged }) => {
|
|
28
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
29
|
+
const {
|
|
30
|
+
disabled,
|
|
31
|
+
rangeValues,
|
|
32
|
+
zIndex,
|
|
33
|
+
customTickMarksValues,
|
|
34
|
+
step,
|
|
35
|
+
minValue
|
|
36
|
+
} = useContext(SliderContext);
|
|
37
|
+
const cleanedProps = __spreadValues({}, props);
|
|
38
|
+
return /* @__PURE__ */ React2.createElement(ThumbStyled, __spreadProps(__spreadValues({}, cleanedProps), {
|
|
39
|
+
"data-testid": "slider-thumb",
|
|
40
|
+
disabled,
|
|
41
|
+
style: __spreadProps(__spreadValues({}, cleanedProps.style), { zIndex }),
|
|
42
|
+
index,
|
|
43
|
+
onMouseEnter: () => setIsHovered(true),
|
|
44
|
+
onMouseLeave: () => setIsHovered(false)
|
|
45
|
+
}), /* @__PURE__ */ React2.createElement(TooltipContainerStyled, {
|
|
46
|
+
isDragged,
|
|
47
|
+
isHovered
|
|
48
|
+
}, /* @__PURE__ */ React2.createElement(TooltipText, null, conformedThumbLabel(rangeValues, customTickMarksValues, index, step, minValue)), /* @__PURE__ */ React2.createElement(TooltipArrow, null)));
|
|
49
|
+
};
|
|
50
|
+
Thumb.propTypes = {
|
|
51
|
+
index: PropTypes.number,
|
|
52
|
+
props: PropTypes.shape({
|
|
53
|
+
style: PropTypes.shape({}).isRequired
|
|
54
|
+
}).isRequired,
|
|
55
|
+
isDragged: PropTypes.bool
|
|
56
|
+
};
|
|
57
|
+
var Thumb_default = Thumb;
|
|
58
|
+
export {
|
|
59
|
+
Thumb_default as default
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=Thumb.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Thumb.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { TooltipText } from '@elliemae/ds-tooltip';\nimport { SliderContext } from './context';\nimport { conformedThumbLabel } from './utils';\nimport { ThumbStyled, TooltipContainerStyled, TooltipArrow } from './styled';\n\nconst Thumb = ({ index, props, isDragged }) => {\n const [isHovered, setIsHovered] = useState(false);\n const {\n disabled,\n rangeValues,\n zIndex,\n customTickMarksValues,\n step,\n minValue,\n } = useContext(SliderContext);\n\n const cleanedProps = { ...props };\n // delete cleanedProps.key;\n // delete cleanedProps.draggable;\n return (\n // ...props is needed because it's received from the library\n // ...props.style has it own style from the library but has a bug with the zIndex for two thumbs, so that's why it has to be overwrite\n <ThumbStyled\n {...cleanedProps}\n data-testid=\"slider-thumb\"\n disabled={disabled}\n // eslint-disable-next-line react/prop-types\n style={{ ...cleanedProps.style, zIndex }}\n index={index}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n >\n <TooltipContainerStyled isDragged={isDragged} isHovered={isHovered}>\n <TooltipText>\n {conformedThumbLabel(\n rangeValues,\n customTickMarksValues,\n index,\n step,\n minValue,\n )}\n </TooltipText>\n <TooltipArrow />\n </TooltipContainerStyled>\n </ThumbStyled>\n );\n};\n\nThumb.propTypes = {\n index: PropTypes.number,\n props: PropTypes.shape({\n style: PropTypes.shape({}).isRequired,\n }).isRequired,\n isDragged: PropTypes.bool,\n};\n\nexport default Thumb;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,QAAQ,CAAC,EAAE,OAAO,OAAO,gBAAgB;AAC7C,QAAM,CAAC,WAAW,gBAAgB,SAAS;AAC3C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,WAAW;AAEf,QAAM,eAAe,mBAAK;AAG1B,SAGE,qCAAC,aAAD,iCACM,eADN;AAAA,IAEE,eAAY;AAAA,IACZ;AAAA,IAEA,OAAO,iCAAK,aAAa,QAAlB,EAAyB;AAAA,IAChC;AAAA,IACA,cAAc,MAAM,aAAa;AAAA,IACjC,cAAc,MAAM,aAAa;AAAA,MAEjC,qCAAC,wBAAD;AAAA,IAAwB;AAAA,IAAsB;AAAA,KAC5C,qCAAC,aAAD,MACG,oBACC,aACA,uBACA,OACA,MACA,YAGJ,qCAAC,cAAD;AAAA;AAMR,MAAM,YAAY;AAAA,EAChB,OAAO,UAAU;AAAA,EACjB,OAAO,UAAU,MAAM;AAAA,IACrB,OAAO,UAAU,MAAM,IAAI;AAAA,KAC1B;AAAA,EACH,WAAW,UAAU;AAAA;AAGvB,IAAO,gBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useContext } from "react";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import { __UNSAFE_SPACE_TO_DIMSUM } from "@elliemae/ds-system";
|
|
5
|
+
import { SliderContext } from "./context";
|
|
6
|
+
const TickMarks = () => {
|
|
7
|
+
const {
|
|
8
|
+
minValue,
|
|
9
|
+
maxValue,
|
|
10
|
+
rangeValues,
|
|
11
|
+
step,
|
|
12
|
+
withTwoHandles,
|
|
13
|
+
zIndex
|
|
14
|
+
} = useContext(SliderContext);
|
|
15
|
+
const dots = [];
|
|
16
|
+
for (let index = minValue || 0; index <= maxValue; index += step) {
|
|
17
|
+
const isActive = withTwoHandles ? rangeValues[0] <= index && index < rangeValues[1] : rangeValues[0] > index;
|
|
18
|
+
dots.push(/* @__PURE__ */ React2.createElement(Dot, {
|
|
19
|
+
"data-testid": "slider-dot",
|
|
20
|
+
isActive,
|
|
21
|
+
key: index
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
return /* @__PURE__ */ React2.createElement(DotsContainer, {
|
|
25
|
+
"data-testid": "slider-tick-marks",
|
|
26
|
+
zIndex
|
|
27
|
+
}, dots);
|
|
28
|
+
};
|
|
29
|
+
const Dot = styled.div`
|
|
30
|
+
&:after {
|
|
31
|
+
content: '';
|
|
32
|
+
background: ${(props) => props.isActive ? props.theme.colors.brand[300] : props.theme.colors.neutral[400]};
|
|
33
|
+
border-radius: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)};
|
|
34
|
+
display: block;
|
|
35
|
+
position: relative;
|
|
36
|
+
width: 2px;
|
|
37
|
+
height: 2px;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
const DotsContainer = styled.div`
|
|
41
|
+
padding: 0
|
|
42
|
+
calc(${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)} * 0.5);
|
|
43
|
+
align-items: center;
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: space-between;
|
|
46
|
+
pointer-events: none;
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 0;
|
|
49
|
+
left: 0;
|
|
50
|
+
right: 0;
|
|
51
|
+
bottom: 0;
|
|
52
|
+
z-index: ${(props) => props.zIndex - 1};
|
|
53
|
+
`;
|
|
54
|
+
var TickMarks_default = TickMarks;
|
|
55
|
+
export {
|
|
56
|
+
TickMarks_default as default
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=TickMarks.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/TickMarks.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport React, { useContext } from 'react';\nimport styled from 'styled-components';\nimport { __UNSAFE_SPACE_TO_DIMSUM } from '@elliemae/ds-system';\nimport { SliderContext } from './context';\n\nconst TickMarks = () => {\n const {\n minValue,\n maxValue,\n rangeValues,\n step,\n withTwoHandles,\n zIndex,\n } = useContext(SliderContext);\n const dots = [];\n\n for (let index = minValue || 0; index <= maxValue; index += step) {\n const isActive = withTwoHandles\n ? rangeValues[0] <= index && index < rangeValues[1]\n : rangeValues[0] > index;\n dots.push(<Dot data-testid=\"slider-dot\" isActive={isActive} key={index} />);\n }\n\n return (\n <DotsContainer data-testid=\"slider-tick-marks\" zIndex={zIndex}>\n {dots}\n </DotsContainer>\n );\n};\n\nconst Dot = styled.div`\n &:after {\n content: '';\n background: ${(props) =>\n props.isActive\n ? props.theme.colors.brand[300]\n : props.theme.colors.neutral[400]};\n border-radius: ${(props) =>\n __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)};\n display: block;\n position: relative;\n width: 2px;\n height: 2px;\n }\n`;\n\nconst DotsContainer = styled.div`\n padding: 0\n calc(${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)} * 0.5);\n align-items: center;\n display: flex;\n justify-content: space-between;\n pointer-events: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: ${(props) => props.zIndex - 1};\n`;\n\nexport default TickMarks;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AAEA,MAAM,YAAY,MAAM;AACtB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,WAAW;AACf,QAAM,OAAO;AAEb,WAAS,QAAQ,YAAY,GAAG,SAAS,UAAU,SAAS,MAAM;AAChE,UAAM,WAAW,iBACb,YAAY,MAAM,SAAS,QAAQ,YAAY,KAC/C,YAAY,KAAK;AACrB,SAAK,KAAK,qCAAC,KAAD;AAAA,MAAK,eAAY;AAAA,MAAa;AAAA,MAAoB,KAAK;AAAA;AAAA;AAGnE,SACE,qCAAC,eAAD;AAAA,IAAe,eAAY;AAAA,IAAoB;AAAA,KAC5C;AAAA;AAKP,MAAM,MAAM,OAAO;AAAA;AAAA;AAAA,kBAGD,CAAC,UACb,MAAM,WACF,MAAM,MAAM,OAAO,MAAM,OACzB,MAAM,MAAM,OAAO,QAAQ;AAAA,qBAChB,CAAC,UAChB,yBAAyB,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQjD,MAAM,gBAAgB,OAAO;AAAA;AAAA,WAElB,CAAC,UAAU,yBAAyB,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAUpD,CAAC,UAAU,MAAM,SAAS;AAAA;AAGvC,IAAO,oBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useContext, useMemo } from "react";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
import { __UNSAFE_SPACE_TO_DIMSUM } from "@elliemae/ds-system";
|
|
5
|
+
import { SliderContext } from "./context";
|
|
6
|
+
const TickMarks = () => {
|
|
7
|
+
const { parsedValuesArray, fullSelectedValues, sliderUUID } = useContext(SliderContext);
|
|
8
|
+
const TickMarksLabels = useMemo(() => parsedValuesArray.map((value) => {
|
|
9
|
+
const isSelected = fullSelectedValues.findIndex((selectedVal) => selectedVal === value) >= 0;
|
|
10
|
+
return /* @__PURE__ */ React2.createElement(TickMarkValue, {
|
|
11
|
+
key: `${sliderUUID}-${value}`,
|
|
12
|
+
isSelected
|
|
13
|
+
}, value);
|
|
14
|
+
}), [parsedValuesArray, sliderUUID, fullSelectedValues]);
|
|
15
|
+
const PureTickMArksValues = useMemo(() => /* @__PURE__ */ React2.createElement(TickMarksContainer, {
|
|
16
|
+
"data-testid": "slider-tick-marks-values"
|
|
17
|
+
}, TickMarksLabels), [TickMarksLabels]);
|
|
18
|
+
return PureTickMArksValues;
|
|
19
|
+
};
|
|
20
|
+
const TickMarkValue = styled.div`
|
|
21
|
+
margin: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.s)} 0;
|
|
22
|
+
overflow: visible;
|
|
23
|
+
transform: translateX(-100%);
|
|
24
|
+
width: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)};
|
|
25
|
+
color: ${(props) => props.isSelected ? props.theme.colors.neutral[800] : props.theme.colors.neutral[500]};
|
|
26
|
+
`;
|
|
27
|
+
const TickMarksContainer = styled.div`
|
|
28
|
+
display: flex;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
`;
|
|
31
|
+
var TickMarksValues_default = TickMarks;
|
|
32
|
+
export {
|
|
33
|
+
TickMarksValues_default as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=TickMarksValues.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/TickMarksValues.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-plusplus */\nimport React, { useContext, useMemo } from 'react';\nimport styled from 'styled-components';\nimport { __UNSAFE_SPACE_TO_DIMSUM } from '@elliemae/ds-system';\nimport { SliderContext } from './context';\n\nconst TickMarks = () => {\n const { parsedValuesArray, fullSelectedValues, sliderUUID } = useContext(\n SliderContext,\n );\n\n const TickMarksLabels = useMemo(\n () =>\n parsedValuesArray.map((value) => {\n const isSelected =\n fullSelectedValues.findIndex(\n (selectedVal) => selectedVal === value,\n ) >= 0;\n return (\n <TickMarkValue key={`${sliderUUID}-${value}`} isSelected={isSelected}>\n {value}\n </TickMarkValue>\n );\n }),\n\n [parsedValuesArray, sliderUUID, fullSelectedValues],\n );\n\n const PureTickMArksValues = useMemo(\n () => (\n <TickMarksContainer data-testid=\"slider-tick-marks-values\">\n {TickMarksLabels}\n </TickMarksContainer>\n ),\n [TickMarksLabels],\n );\n\n return PureTickMArksValues;\n};\n\nconst TickMarkValue = styled.div`\n margin: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.s)} 0;\n overflow: visible;\n transform: translateX(-100%);\n width: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)};\n color: ${(props) =>\n props.isSelected\n ? props.theme.colors.neutral[800]\n : props.theme.colors.neutral[500]};\n`;\n\nconst TickMarksContainer = styled.div`\n display: flex;\n justify-content: space-between;\n`;\n\nexport default TickMarks;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AAEA,MAAM,YAAY,MAAM;AACtB,QAAM,EAAE,mBAAmB,oBAAoB,eAAe,WAC5D;AAGF,QAAM,kBAAkB,QACtB,MACE,kBAAkB,IAAI,CAAC,UAAU;AAC/B,UAAM,aACJ,mBAAmB,UACjB,CAAC,gBAAgB,gBAAgB,UAC9B;AACP,WACE,qCAAC,eAAD;AAAA,MAAe,KAAK,GAAG,cAAc;AAAA,MAAS;AAAA,OAC3C;AAAA,MAKT,CAAC,mBAAmB,YAAY;AAGlC,QAAM,sBAAsB,QAC1B,MACE,qCAAC,oBAAD;AAAA,IAAoB,eAAY;AAAA,KAC7B,kBAGL,CAAC;AAGH,SAAO;AAAA;AAGT,MAAM,gBAAgB,OAAO;AAAA,YACjB,CAAC,UAAU,yBAAyB,MAAM,MAAM,MAAM;AAAA;AAAA;AAAA,WAGvD,CAAC,UAAU,yBAAyB,MAAM,MAAM,MAAM;AAAA,WACtD,CAAC,UACR,MAAM,aACF,MAAM,MAAM,OAAO,QAAQ,OAC3B,MAAM,MAAM,OAAO,QAAQ;AAAA;AAGnC,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;AAKlC,IAAO,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import * as React from "react";
|
|
21
|
+
import React2, { useContext } from "react";
|
|
22
|
+
import { getTrackBackground } from "react-range";
|
|
23
|
+
import styled from "styled-components";
|
|
24
|
+
import { __UNSAFE_SPACE_TO_DIMSUM } from "@elliemae/ds-system";
|
|
25
|
+
import TickMarks from "./TickMarks";
|
|
26
|
+
import TickMarksValues from "./TickMarksValues";
|
|
27
|
+
import { SliderContext } from "./context";
|
|
28
|
+
const Track = ({ children, props }) => {
|
|
29
|
+
const {
|
|
30
|
+
disabled,
|
|
31
|
+
minValue,
|
|
32
|
+
maxValue,
|
|
33
|
+
rangeValues,
|
|
34
|
+
withTickMarks,
|
|
35
|
+
withTickMarksValues,
|
|
36
|
+
withTwoHandles
|
|
37
|
+
} = useContext(SliderContext);
|
|
38
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(TrackStyled, __spreadProps(__spreadValues({}, props), {
|
|
39
|
+
disabled,
|
|
40
|
+
minValue,
|
|
41
|
+
maxValue,
|
|
42
|
+
rangeValues,
|
|
43
|
+
withTwoHandles
|
|
44
|
+
}), children, withTickMarks && !disabled && /* @__PURE__ */ React2.createElement(TickMarks, null)), withTickMarksValues && /* @__PURE__ */ React2.createElement(TickMarksValues, null));
|
|
45
|
+
};
|
|
46
|
+
const TrackStyled = styled.div`
|
|
47
|
+
position: relative;
|
|
48
|
+
height: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)};
|
|
49
|
+
width: 100%;
|
|
50
|
+
min-width: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxl)};
|
|
51
|
+
border-radius: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)};
|
|
52
|
+
background: ${(props) => props.disabled ? props.theme.colors.neutral[100] : getTrackBackground({
|
|
53
|
+
values: props.rangeValues,
|
|
54
|
+
colors: props.withTwoHandles ? [
|
|
55
|
+
props.theme.colors.neutral[100],
|
|
56
|
+
props.theme.colors.brand[600],
|
|
57
|
+
props.theme.colors.neutral[100]
|
|
58
|
+
] : [props.theme.colors.brand[600], props.theme.colors.neutral[100]],
|
|
59
|
+
min: props.minValue,
|
|
60
|
+
max: props.maxValue
|
|
61
|
+
})};
|
|
62
|
+
`;
|
|
63
|
+
var Track_default = Track;
|
|
64
|
+
export {
|
|
65
|
+
Track_default as default
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=Track.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/Track.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\n/* eslint-disable react/prop-types */\nimport React, { useContext } from 'react';\nimport { getTrackBackground } from 'react-range';\nimport styled from 'styled-components';\nimport { __UNSAFE_SPACE_TO_DIMSUM } from '@elliemae/ds-system';\n\nimport TickMarks from './TickMarks';\nimport TickMarksValues from './TickMarksValues';\nimport { SliderContext } from './context';\n\nconst Track = ({ children, props }) => {\n const {\n disabled,\n minValue,\n maxValue,\n rangeValues,\n withTickMarks,\n withTickMarksValues,\n withTwoHandles,\n } = useContext(SliderContext);\n\n return (\n <>\n <TrackStyled\n {...props} // This is needed because it's received from the library\n disabled={disabled}\n minValue={minValue}\n maxValue={maxValue}\n rangeValues={rangeValues}\n withTwoHandles={withTwoHandles}\n >\n {children}\n {withTickMarks && !disabled && <TickMarks />}\n </TrackStyled>\n {withTickMarksValues && <TickMarksValues />}\n </>\n );\n};\n\nconst TrackStyled = styled.div`\n position: relative;\n height: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)};\n width: 100%;\n min-width: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxl)};\n border-radius: ${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)};\n background: ${(props) =>\n props.disabled\n ? props.theme.colors.neutral[100]\n : getTrackBackground({\n values: props.rangeValues,\n colors: props.withTwoHandles\n ? [\n props.theme.colors.neutral[100],\n props.theme.colors.brand[600],\n props.theme.colors.neutral[100],\n ]\n : [props.theme.colors.brand[600], props.theme.colors.neutral[100]],\n min: props.minValue,\n max: props.maxValue,\n })};\n`;\n\nexport default Track;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA,MAAM,QAAQ,CAAC,EAAE,UAAU,YAAY;AACrC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE,WAAW;AAEf,SACE,4DACE,qCAAC,aAAD,iCACM,QADN;AAAA,IAEE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MAEC,UACA,iBAAiB,CAAC,YAAY,qCAAC,WAAD,QAEhC,uBAAuB,qCAAC,iBAAD;AAAA;AAK9B,MAAM,cAAc,OAAO;AAAA;AAAA,YAEf,CAAC,UAAU,yBAAyB,MAAM,MAAM,MAAM;AAAA;AAAA,eAEnD,CAAC,UAAU,yBAAyB,MAAM,MAAM,MAAM;AAAA,mBAClD,CAAC,UAAU,yBAAyB,MAAM,MAAM,MAAM;AAAA,gBACzD,CAAC,UACb,MAAM,WACF,MAAM,MAAM,OAAO,QAAQ,OAC3B,mBAAmB;AAAA,EACjB,QAAQ,MAAM;AAAA,EACd,QAAQ,MAAM,iBACV;AAAA,IACE,MAAM,MAAM,OAAO,QAAQ;AAAA,IAC3B,MAAM,MAAM,OAAO,MAAM;AAAA,IACzB,MAAM,MAAM,OAAO,QAAQ;AAAA,MAE7B,CAAC,MAAM,MAAM,OAAO,MAAM,MAAM,MAAM,MAAM,OAAO,QAAQ;AAAA,EAC/D,KAAK,MAAM;AAAA,EACX,KAAK,MAAM;AAAA;AAAA;AAIrB,IAAO,gBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/context.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\n\nexport const SliderContext = React.createContext();\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,gBAAgB,OAAM;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import styled from "styled-components";
|
|
3
|
+
import { __UNSAFE_SPACE_TO_DIMSUM } from "@elliemae/ds-system";
|
|
4
|
+
import { TooltipContainer } from "@elliemae/ds-tooltip";
|
|
5
|
+
const ThumbStyled = styled.div`
|
|
6
|
+
height: 20px;
|
|
7
|
+
width: 20px;
|
|
8
|
+
background-color: ${(props) => props.disabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral["000"]};
|
|
9
|
+
border-radius: 10px;
|
|
10
|
+
border: 1px solid ${(props) => props.disabled ? props.theme.colors.neutral[100] : props.theme.colors.neutral[400]};
|
|
11
|
+
|
|
12
|
+
:focus {
|
|
13
|
+
border: 1px solid ${(props) => props.theme.colors.brand[600]};
|
|
14
|
+
outline: unset;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:hover {
|
|
18
|
+
background-color: ${({ disabled, theme }) => disabled ? theme.colors.neutral[100] : theme.colors.brand[200]};
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
const TooltipContainerStyled = styled(TooltipContainer)`
|
|
22
|
+
position: relative;
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
top: -35px;
|
|
27
|
+
width: max-content;
|
|
28
|
+
left: 50%;
|
|
29
|
+
transform: translateX(-50%);
|
|
30
|
+
visibility: ${({ isDragged, isHovered }) => isDragged || isHovered ? "visible" : "hidden"};
|
|
31
|
+
`;
|
|
32
|
+
const TooltipArrow = styled.div`
|
|
33
|
+
position: absolute;
|
|
34
|
+
width: 0;
|
|
35
|
+
height: 0;
|
|
36
|
+
top: 20px;
|
|
37
|
+
border-left: calc(${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)} * 2.5) solid transparent;
|
|
38
|
+
border-right: calc(${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)} * 2.5) solid transparent;
|
|
39
|
+
|
|
40
|
+
border-top: calc(${(props) => __UNSAFE_SPACE_TO_DIMSUM(props.theme.space.xxs)} * 2.5) solid
|
|
41
|
+
${(props) => props.theme.colors.neutral[0]};
|
|
42
|
+
`;
|
|
43
|
+
const LabelWrapper = styled.div`
|
|
44
|
+
margin-bottom: ${(props) => props.theme.space.xxs};
|
|
45
|
+
max-width: 100%;
|
|
46
|
+
width: ${(props) => `${props.width || 0}px`};
|
|
47
|
+
`;
|
|
48
|
+
const LabelText = styled.span`
|
|
49
|
+
color: ${(props) => props.theme.colors.neutral[600]};
|
|
50
|
+
`;
|
|
51
|
+
const ValueText = styled.span`
|
|
52
|
+
color: ${({ disabled, theme }) => theme.colors.neutral[disabled ? 500 : 800]};
|
|
53
|
+
`;
|
|
54
|
+
const StyledRangeWrapper = styled.div`
|
|
55
|
+
min-height: 28px;
|
|
56
|
+
margin: 0 10px;
|
|
57
|
+
`;
|
|
58
|
+
export {
|
|
59
|
+
LabelText,
|
|
60
|
+
LabelWrapper,
|
|
61
|
+
StyledRangeWrapper,
|
|
62
|
+
ThumbStyled,
|
|
63
|
+
TooltipArrow,
|
|
64
|
+
TooltipContainerStyled,
|
|
65
|
+
ValueText
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/styled.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AAEO,MAAM,cAAc,OAAO;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,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAS7B,CAAC,EAAE,WAAW,gBAAiB,aAAa,YAAY,YAAY;AAAA;AAG7E,MAAM,eAAe,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,sBAKb,CAAC,UAAU,yBAAyB,MAAM,MAAM,MAAM;AAAA,uBACrD,CAAC,UAAU,yBAAyB,MAAM,MAAM,MAAM;AAAA;AAAA,qBAExD,CAAC,UAAU,yBAAyB,MAAM,MAAM,MAAM;AAAA,MACrE,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAGrC,MAAM,eAAe,OAAO;AAAA,mBAChB,CAAC,UAAU,MAAM,MAAM,MAAM;AAAA;AAAA,WAErC,CAAC,UAAU,GAAG,MAAM,SAAS;AAAA;AAGjC,MAAM,YAAY,OAAO;AAAA,WACrB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAG1C,MAAM,YAAY,OAAO;AAAA,WACrB,CAAC,EAAE,UAAU,YAAY,MAAM,OAAO,QAAQ,WAAW,MAAM;AAAA;AAGnE,MAAM,qBAAqB,OAAO;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { isEmpty } from "@elliemae/ds-utilities";
|
|
3
|
+
const conformedLabel = (rangeValues, label = "", labelWithValue = false, withTwoHandles = false, customTickMarksValues = [], step = 1, minValue = 0) => {
|
|
4
|
+
const msg = label.trim();
|
|
5
|
+
let value = "";
|
|
6
|
+
if (!isEmpty(customTickMarksValues) && labelWithValue && label) {
|
|
7
|
+
const firstValue = customTickMarksValues[(rangeValues[0] - minValue) / step];
|
|
8
|
+
const secondValue = customTickMarksValues[(rangeValues[1] - minValue) / step];
|
|
9
|
+
value = `${firstValue || rangeValues[0].toFixed(1)} ${withTwoHandles ? `, ${secondValue || rangeValues[1].toFixed(1)}` : ""} `;
|
|
10
|
+
} else if (labelWithValue && label) {
|
|
11
|
+
value = `${rangeValues[0].toFixed(1)} ${withTwoHandles ? `, ${rangeValues[1]?.toFixed(1)}` : ""} `;
|
|
12
|
+
}
|
|
13
|
+
value = value.trim();
|
|
14
|
+
return [msg, value];
|
|
15
|
+
};
|
|
16
|
+
const conformedThumbLabel = (rangeValues, customTickMarksValues = [], index = 0, step = 1, minValue = 0) => {
|
|
17
|
+
let msg = `Value: `;
|
|
18
|
+
if (!isEmpty(customTickMarksValues)) {
|
|
19
|
+
const foundValue = customTickMarksValues[(rangeValues[index] - minValue) / step];
|
|
20
|
+
msg += `${foundValue || rangeValues[index].toFixed(1)}`;
|
|
21
|
+
} else {
|
|
22
|
+
msg += `${rangeValues[index].toFixed(1)}`;
|
|
23
|
+
}
|
|
24
|
+
return msg;
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
conformedLabel,
|
|
28
|
+
conformedThumbLabel
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/utils.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AAEO,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,QAAQ,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,QAAQ,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
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { default } from './DSSlider';\nexport * from './DSSlider';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|