kdpa-components 1.35.2 → 1.35.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/Accordion/index.d.ts +3 -0
- package/dist/Accordion/index.d.ts.map +1 -0
- package/dist/Accordion/index.js +481 -0
- package/dist/AdvancedList/index.d.ts +2 -0
- package/dist/AdvancedList/index.d.ts.map +1 -0
- package/dist/AdvancedList/index.js +16751 -0
- package/dist/Alert/index.d.ts +5 -0
- package/dist/Alert/index.d.ts.map +1 -0
- package/dist/Alert/index.js +407 -0
- package/dist/ArrowDropDown-76613637.js +35 -0
- package/dist/Autocomplete-45ae6737.js +1670 -0
- package/dist/Avatar/index.d.ts +3 -0
- package/dist/Avatar/index.d.ts.map +1 -0
- package/dist/Avatar/index.js +210 -0
- package/dist/Badge/index.d.ts +6 -0
- package/dist/Badge/index.d.ts.map +1 -0
- package/dist/Badge/index.js +69 -0
- package/dist/Badge-26e8a2aa.js +392 -0
- package/dist/Box-a827334a.js +58 -0
- package/dist/Button-b93e890d.js +355 -0
- package/dist/ButtonBase-0f9f324d.js +655 -0
- package/dist/Buttons/index.d.ts +9 -0
- package/dist/Buttons/index.d.ts.map +1 -0
- package/dist/Buttons/index.js +83 -0
- package/dist/CSSTransition-d0281d1f.js +215 -0
- package/dist/Cards/index.d.ts +3 -0
- package/dist/Cards/index.d.ts.map +1 -0
- package/dist/Cards/index.js +144 -0
- package/dist/CheckBox/index.d.ts +3 -0
- package/dist/CheckBox/index.d.ts.map +1 -0
- package/dist/CheckBox/index.js +32 -0
- package/dist/Checkbox-2cb33932.js +199 -0
- package/dist/Chip/index.d.ts +3 -0
- package/dist/Chip/index.d.ts.map +1 -0
- package/dist/Chip/index.js +61 -0
- package/dist/Chip-7b1a25ce.js +444 -0
- package/dist/CircularProgress-2c55d9ef.js +217 -0
- package/dist/Close-ef7a3b6b.js +9 -0
- package/dist/CodeEditor/index.d.ts +2 -0
- package/dist/CodeEditor/index.d.ts.map +1 -0
- package/dist/CodeEditor/index.js +559 -0
- package/dist/Collapse/index.d.ts +3 -0
- package/dist/Collapse/index.d.ts.map +1 -0
- package/dist/Collapse/index.js +23 -0
- package/dist/Collapse-4b8b3146.js +299 -0
- package/dist/CopyToClipboard/index.d.ts +3 -0
- package/dist/CopyToClipboard/index.d.ts.map +1 -0
- package/dist/CopyToClipboard/index.js +591 -0
- package/dist/Dialog-25ebaee6.js +356 -0
- package/dist/Divider/index.d.ts +4 -0
- package/dist/Divider/index.d.ts.map +1 -0
- package/dist/Divider/index.js +31 -0
- package/dist/Divider-cadf67a7.js +231 -0
- package/dist/DropZone/index.d.ts +2 -0
- package/dist/DropZone/index.d.ts.map +1 -0
- package/dist/DropZone/index.js +1348 -0
- package/dist/Fade-aabbd0cb.js +163 -0
- package/dist/FormControl/index.d.ts +5 -0
- package/dist/FormControl/index.d.ts.map +1 -0
- package/dist/FormControl/index.js +24 -0
- package/dist/FormControl-e7294bde.js +232 -0
- package/dist/FormControlLabel-276f1b1e.js +214 -0
- package/dist/FullScreenDialog/index.d.ts +3 -0
- package/dist/FullScreenDialog/index.d.ts.map +1 -0
- package/dist/FullScreenDialog/index.js +42 -0
- package/dist/Grid/index.d.ts +3 -0
- package/dist/Grid/index.d.ts.map +1 -0
- package/dist/Grid/index.js +17 -0
- package/dist/Grid-c1f5fe6b.js +486 -0
- package/dist/Grow-151a20f6.js +193 -0
- package/dist/HTMLElementType-ff213f3c.js +9 -0
- package/dist/IconButton-fdbca6d2.js +184 -0
- package/dist/Input/index.d.ts +7 -0
- package/dist/Input/index.d.ts.map +1 -0
- package/dist/Input/index.js +88 -0
- package/dist/InputAdornment-3334ace2.js +155 -0
- package/dist/KdpaAutoComplete-40e0949e.js +8 -0
- package/dist/KdpaCollapse-d9e37824.js +11 -0
- package/dist/KdpaFormControl-2d7c1db8.js +6 -0
- package/dist/KdpaIconButton-514e0d96.js +23 -0
- package/dist/KdpaMenuItem-085f686f.js +36 -0
- package/dist/KdpaSecondaryButton-14992523.js +25 -0
- package/dist/KeyboardArrowRight-14dbe7d6.js +12 -0
- package/dist/LazyDrop/index.d.ts +3 -0
- package/dist/LazyDrop/index.d.ts.map +1 -0
- package/dist/LazyDrop/index.js +839 -0
- package/dist/ListContext-de5072f9.js +7 -0
- package/dist/ListItem-2b5c2e20.js +426 -0
- package/dist/ListItemText-fcd66149.js +150 -0
- package/dist/Loading/KdpaProgress/index.d.ts +3 -0
- package/dist/Loading/KdpaProgress/index.d.ts.map +1 -0
- package/dist/Loading/KdpaProgress/index.js +56 -0
- package/dist/Loading/index.d.ts +6 -0
- package/dist/Loading/index.d.ts.map +1 -0
- package/dist/Loading/index.js +348 -0
- package/dist/MenuItem-cc037c5b.js +240 -0
- package/dist/Modal/index.d.ts +2 -0
- package/dist/Modal/index.d.ts.map +1 -0
- package/dist/Modal/index.js +751 -0
- package/dist/Modal-5f23fcfd.js +984 -0
- package/dist/PaginationGrid/index.d.ts +3 -0
- package/dist/PaginationGrid/index.d.ts.map +1 -0
- package/dist/PaginationGrid/index.js +60 -0
- package/dist/Paper-aaec61a3.js +163 -0
- package/dist/Pickers/index.d.ts +7 -0
- package/dist/Pickers/index.d.ts.map +1 -0
- package/dist/Pickers/index.js +14408 -0
- package/dist/Popper-490e6477.js +490 -0
- package/dist/Portal-b4f8657f.js +77 -0
- package/dist/Radio/index.d.ts +5 -0
- package/dist/Radio/index.d.ts.map +1 -0
- package/dist/Radio/index.js +431 -0
- package/dist/Segment/index.d.ts +3 -0
- package/dist/Segment/index.d.ts.map +1 -0
- package/dist/Segment/index.js +84 -0
- package/dist/Selects/index.d.ts +7 -0
- package/dist/Selects/index.d.ts.map +1 -0
- package/dist/Selects/index.js +66 -0
- package/dist/SimpleList/index.d.ts +2 -0
- package/dist/SimpleList/index.d.ts.map +1 -0
- package/dist/SimpleList/index.js +1913 -0
- package/dist/Skeleton-263b2beb.js +213 -0
- package/dist/Slide-3bc7a346.js +227 -0
- package/dist/Slider/index.d.ts +3 -0
- package/dist/Slider/index.d.ts.map +1 -0
- package/dist/Slider/index.js +1322 -0
- package/dist/SweetAlerts/index.d.ts +6 -0
- package/dist/SweetAlerts/index.d.ts.map +1 -0
- package/dist/SweetAlerts/index.js +1540 -0
- package/dist/Switch/index.d.ts +3 -0
- package/dist/Switch/index.d.ts.map +1 -0
- package/dist/Switch/index.js +39 -0
- package/dist/Switch-ef584fc0.js +302 -0
- package/dist/SwitchBase-c367ca3c.js +231 -0
- package/dist/Tabs/index.d.ts +5 -0
- package/dist/Tabs/index.d.ts.map +1 -0
- package/dist/Tabs/index.js +63 -0
- package/dist/Tabs-9775b0bb.js +1084 -0
- package/dist/TextField-b8c731e8.js +4439 -0
- package/dist/ThemeProvider/index.d.ts +4 -0
- package/dist/ThemeProvider/index.d.ts.map +1 -0
- package/dist/ThemeProvider/index.js +294 -0
- package/dist/Tooltip-4b1baf1b.js +584 -0
- package/dist/Tooltips/index.d.ts +3 -0
- package/dist/Tooltips/index.d.ts.map +1 -0
- package/dist/Tooltips/index.js +46 -0
- package/dist/TransitionGroup-196acb6a.js +185 -0
- package/dist/TransitionGroupContext-7435e195.js +10 -0
- package/dist/Transitions/index.d.ts +11 -0
- package/dist/Transitions/index.d.ts.map +1 -0
- package/dist/Transitions/index.js +34 -0
- package/dist/Tree/index.d.ts +3 -0
- package/dist/Tree/index.d.ts.map +1 -0
- package/dist/Tree/index.js +1447 -0
- package/dist/TreeSelect/index.d.ts +3 -0
- package/dist/TreeSelect/index.d.ts.map +1 -0
- package/dist/TreeSelect/index.js +6888 -0
- package/dist/Typography/index.d.ts +3 -0
- package/dist/Typography/index.d.ts.map +1 -0
- package/dist/Typography/index.js +14 -0
- package/dist/Typography-dfa51fea.js +176 -0
- package/dist/Uploader/index.d.ts +3 -0
- package/dist/Uploader/index.d.ts.map +1 -0
- package/dist/Uploader/index.js +81 -0
- package/dist/Zoom-b84bdc2b.js +163 -0
- package/dist/_commonjsHelpers-92157f1b.js +36 -0
- package/dist/assertThisInitialized-05701a63.js +8 -0
- package/dist/chainPropTypes-004bf492.js +8 -0
- package/dist/createChainedFunction-68e2a88d.js +9 -0
- package/dist/createSvgIcon-b80a8a41.js +182 -0
- package/dist/dividerClasses-99758da7.js +10 -0
- package/dist/elementAcceptingRef-803dfd80.js +26 -0
- package/dist/elementTypeAcceptingRef-6c34f16b.js +23 -0
- package/dist/emotion-is-prop-valid.esm-b7f48706.js +191 -0
- package/dist/emotion-memoize.esm-021d0d4e.js +9 -0
- package/dist/emotion-react.browser.esm-d563ed65.js +255 -0
- package/dist/exactProp-3aaa3ecc.js +13 -0
- package/dist/extendSxProp-f7714a31.js +30 -0
- package/dist/extends-393586f3.js +22 -0
- package/dist/formControlState-9148c46f.js +10 -0
- package/dist/hoist-non-react-statics.cjs-ce2f2873.js +236 -0
- package/dist/iconBase-800b43ff.js +63 -0
- package/dist/identifier-9dfe30d8.js +3320 -0
- package/dist/index-116f732f.js +749 -0
- package/dist/index-7e2d793d.js +12011 -0
- package/dist/index-fa965a10.js +43 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm-b78383d3.js +35 -0
- package/dist/isMuiElement-b88a921a.js +7 -0
- package/dist/jsx-runtime-944c88e2.js +631 -0
- package/dist/kdpaSelect-4ed993c7.js +1 -0
- package/dist/listItemTextClasses-d6839c02.js +10 -0
- package/dist/ownerDocument-5430cd5b.js +6 -0
- package/dist/ownerWindow-e6cc3097.js +20 -0
- package/dist/popper-78c6b162.js +1006 -0
- package/dist/refType-af1a9f54.js +5 -0
- package/dist/setPrototypeOf-98a00546.js +8 -0
- package/dist/style.css +1 -0
- package/dist/toPropertyKey-e295cd73.js +27 -0
- package/dist/types/designerKit/components/GridPanel/PanelWrapper.d.ts +1 -1
- package/dist/types/designerKit/components/GridPanel/PanelWrapper.d.ts.map +1 -1
- package/dist/types/designerKit/components/Uploader/KdAdvanceFileUploader/DroppedFiles.d.ts.map +1 -1
- package/dist/types/designerKit/components/Uploader/KdFileUploader/UploadedItems.d.ts.map +1 -1
- package/dist/types/designerKit/utils/typographyHelper.d.ts +1 -2
- package/dist/types/designerKit/utils/typographyHelper.d.ts.map +1 -1
- package/dist/unsupportedProp-3dbf01f6.js +9 -0
- package/dist/useControlled-cc2d41cb.js +31 -0
- package/dist/useEventCallback-fe4fd69c.js +16 -0
- package/dist/useForkRef-0781dda0.js +15 -0
- package/dist/useFormControl-af690c26.js +11 -0
- package/dist/useId-e7dff7be.js +19 -0
- package/dist/useIsFocusVisible-4693b580.js +68 -0
- package/dist/usePreviousProps-c1ae4548.js +10 -0
- package/dist/useSlotProps-f238319f.js +74 -0
- package/dist/useTheme-014a54ad.js +10 -0
- package/dist/useThemeProps-7d04a175.js +513 -0
- package/dist/utils-129661c6.js +370 -0
- package/package.json +1 -1
- package/dist/types/designerKit/components/Alert/Temp.d.ts +0 -3
- package/dist/types/designerKit/components/Alert/Temp.d.ts.map +0 -1
- package/dist/types/designerKit/components/Form/KdFormField/KdpaFormField.d.ts +0 -12
- package/dist/types/designerKit/components/Form/KdFormField/KdpaFormField.d.ts.map +0 -1
- package/dist/types/designerKit/components/Tree/useKdTreeHelper.d.ts +0 -5
- package/dist/types/designerKit/components/Tree/useKdTreeHelper.d.ts.map +0 -1
- package/dist/types/designerKit/components/Uploader/KdAdvanceFileUploader/DroppingFiles.d.ts +0 -9
- package/dist/types/designerKit/components/Uploader/KdAdvanceFileUploader/DroppingFiles.d.ts.map +0 -1
- package/dist/types/designerKit/components/Uploader/KdUseFileUpload/KdUseFileUpload.d.ts +0 -53
- package/dist/types/designerKit/components/Uploader/KdUseFileUpload/KdUseFileUpload.d.ts.map +0 -1
- package/dist/types/designerKit/utils/fileUtils.d.ts +0 -19
- package/dist/types/designerKit/utils/fileUtils.d.ts.map +0 -1
- package/dist/types/designerKit/utils/useTreeHelper.d.ts +0 -17
- package/dist/types/designerKit/utils/useTreeHelper.d.ts.map +0 -1
|
@@ -0,0 +1,1322 @@
|
|
|
1
|
+
import { j as C } from "../jsx-runtime-944c88e2.js";
|
|
2
|
+
import { _ as c, a as Nt } from "../extends-393586f3.js";
|
|
3
|
+
import * as T from "react";
|
|
4
|
+
import { g as Rt, P as t, h as U, l as Et, m as _t, a as rt } from "../identifier-9dfe30d8.js";
|
|
5
|
+
import { g as Vt, c as ce, s as ee, h as ct, u as wt, a as At } from "../useThemeProps-7d04a175.js";
|
|
6
|
+
import { u as It } from "../useTheme-014a54ad.js";
|
|
7
|
+
import { i as Ee, u as B } from "../useSlotProps-f238319f.js";
|
|
8
|
+
import { u as jt } from "../useControlled-cc2d41cb.js";
|
|
9
|
+
import { u as Mt } from "../useIsFocusVisible-4693b580.js";
|
|
10
|
+
import { u as at } from "../useForkRef-0781dda0.js";
|
|
11
|
+
import { a as zt, u as We } from "../useEventCallback-fe4fd69c.js";
|
|
12
|
+
import { o as _e } from "../ownerDocument-5430cd5b.js";
|
|
13
|
+
import { c as nt } from "../chainPropTypes-004bf492.js";
|
|
14
|
+
import "../emotion-memoize.esm-021d0d4e.js";
|
|
15
|
+
import "../_commonjsHelpers-92157f1b.js";
|
|
16
|
+
import "../emotion-is-prop-valid.esm-b7f48706.js";
|
|
17
|
+
const Ft = {
|
|
18
|
+
border: 0,
|
|
19
|
+
clip: "rect(0 0 0 0)",
|
|
20
|
+
height: "1px",
|
|
21
|
+
margin: -1,
|
|
22
|
+
overflow: "hidden",
|
|
23
|
+
padding: 0,
|
|
24
|
+
position: "absolute",
|
|
25
|
+
whiteSpace: "nowrap",
|
|
26
|
+
width: "1px"
|
|
27
|
+
}, Dt = Ft;
|
|
28
|
+
function Ht(e, o, a = (s, d) => s === d) {
|
|
29
|
+
return e.length === o.length && e.every((s, d) => a(s, o[d]));
|
|
30
|
+
}
|
|
31
|
+
const Yt = 2;
|
|
32
|
+
function ut(e, o) {
|
|
33
|
+
return e - o;
|
|
34
|
+
}
|
|
35
|
+
function he(e, o, a) {
|
|
36
|
+
return e == null ? o : Math.min(Math.max(o, e), a);
|
|
37
|
+
}
|
|
38
|
+
function lt(e, o) {
|
|
39
|
+
var a;
|
|
40
|
+
const {
|
|
41
|
+
index: s
|
|
42
|
+
} = (a = e.reduce((d, L, N) => {
|
|
43
|
+
const f = Math.abs(o - L);
|
|
44
|
+
return d === null || f < d.distance || f === d.distance ? {
|
|
45
|
+
distance: f,
|
|
46
|
+
index: N
|
|
47
|
+
} : d;
|
|
48
|
+
}, null)) != null ? a : {};
|
|
49
|
+
return s;
|
|
50
|
+
}
|
|
51
|
+
function Ce(e, o) {
|
|
52
|
+
if (o.current !== void 0 && e.changedTouches) {
|
|
53
|
+
const a = e;
|
|
54
|
+
for (let s = 0; s < a.changedTouches.length; s += 1) {
|
|
55
|
+
const d = a.changedTouches[s];
|
|
56
|
+
if (d.identifier === o.current)
|
|
57
|
+
return {
|
|
58
|
+
x: d.clientX,
|
|
59
|
+
y: d.clientY
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return !1;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
x: e.clientX,
|
|
66
|
+
y: e.clientY
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function Ve(e, o, a) {
|
|
70
|
+
return (e - o) * 100 / (a - o);
|
|
71
|
+
}
|
|
72
|
+
function Bt(e, o, a) {
|
|
73
|
+
return (a - o) * e + o;
|
|
74
|
+
}
|
|
75
|
+
function Ut(e) {
|
|
76
|
+
if (Math.abs(e) < 1) {
|
|
77
|
+
const a = e.toExponential().split("e-"), s = a[0].split(".")[1];
|
|
78
|
+
return (s ? s.length : 0) + parseInt(a[1], 10);
|
|
79
|
+
}
|
|
80
|
+
const o = e.toString().split(".")[1];
|
|
81
|
+
return o ? o.length : 0;
|
|
82
|
+
}
|
|
83
|
+
function qt(e, o, a) {
|
|
84
|
+
const s = Math.round((e - a) / o) * o + a;
|
|
85
|
+
return Number(s.toFixed(Ut(o)));
|
|
86
|
+
}
|
|
87
|
+
function st({
|
|
88
|
+
values: e,
|
|
89
|
+
newValue: o,
|
|
90
|
+
index: a
|
|
91
|
+
}) {
|
|
92
|
+
const s = e.slice();
|
|
93
|
+
return s[a] = o, s.sort(ut);
|
|
94
|
+
}
|
|
95
|
+
function $e({
|
|
96
|
+
sliderRef: e,
|
|
97
|
+
activeIndex: o,
|
|
98
|
+
setActive: a
|
|
99
|
+
}) {
|
|
100
|
+
var s, d;
|
|
101
|
+
const L = _e(e.current);
|
|
102
|
+
if (!((s = e.current) != null && s.contains(L.activeElement)) || Number(L == null || (d = L.activeElement) == null ? void 0 : d.getAttribute("data-index")) !== o) {
|
|
103
|
+
var N;
|
|
104
|
+
(N = e.current) == null || N.querySelector(`[type="range"][data-index="${o}"]`).focus();
|
|
105
|
+
}
|
|
106
|
+
a && a(o);
|
|
107
|
+
}
|
|
108
|
+
function Ne(e, o) {
|
|
109
|
+
return typeof e == "number" && typeof o == "number" ? e === o : typeof e == "object" && typeof o == "object" ? Ht(e, o) : !1;
|
|
110
|
+
}
|
|
111
|
+
const Xt = {
|
|
112
|
+
horizontal: {
|
|
113
|
+
offset: (e) => ({
|
|
114
|
+
left: `${e}%`
|
|
115
|
+
}),
|
|
116
|
+
leap: (e) => ({
|
|
117
|
+
width: `${e}%`
|
|
118
|
+
})
|
|
119
|
+
},
|
|
120
|
+
"horizontal-reverse": {
|
|
121
|
+
offset: (e) => ({
|
|
122
|
+
right: `${e}%`
|
|
123
|
+
}),
|
|
124
|
+
leap: (e) => ({
|
|
125
|
+
width: `${e}%`
|
|
126
|
+
})
|
|
127
|
+
},
|
|
128
|
+
vertical: {
|
|
129
|
+
offset: (e) => ({
|
|
130
|
+
bottom: `${e}%`
|
|
131
|
+
}),
|
|
132
|
+
leap: (e) => ({
|
|
133
|
+
height: `${e}%`
|
|
134
|
+
})
|
|
135
|
+
}
|
|
136
|
+
}, Wt = (e) => e;
|
|
137
|
+
let Re;
|
|
138
|
+
function Ge() {
|
|
139
|
+
return Re === void 0 && (typeof CSS < "u" && typeof CSS.supports == "function" ? Re = CSS.supports("touch-action", "none") : Re = !0), Re;
|
|
140
|
+
}
|
|
141
|
+
function Gt(e) {
|
|
142
|
+
const {
|
|
143
|
+
"aria-labelledby": o,
|
|
144
|
+
defaultValue: a,
|
|
145
|
+
disabled: s = !1,
|
|
146
|
+
disableSwap: d = !1,
|
|
147
|
+
isRtl: L = !1,
|
|
148
|
+
marks: N = !1,
|
|
149
|
+
max: f = 100,
|
|
150
|
+
min: b = 0,
|
|
151
|
+
name: q,
|
|
152
|
+
onChange: ue,
|
|
153
|
+
onChangeCommitted: X,
|
|
154
|
+
orientation: te = "horizontal",
|
|
155
|
+
rootRef: ge,
|
|
156
|
+
scale: de = Wt,
|
|
157
|
+
step: _ = 1,
|
|
158
|
+
tabIndex: ye,
|
|
159
|
+
value: ke
|
|
160
|
+
} = e, M = T.useRef(), [pe, D] = T.useState(-1), [xe, H] = T.useState(-1), [me, fe] = T.useState(!1), W = T.useRef(0), [V, Y] = jt({
|
|
161
|
+
controlled: ke,
|
|
162
|
+
default: a ?? b,
|
|
163
|
+
name: "Slider"
|
|
164
|
+
}), z = ue && ((r, n, l) => {
|
|
165
|
+
const i = r.nativeEvent || r, y = new i.constructor(i.type, i);
|
|
166
|
+
Object.defineProperty(y, "target", {
|
|
167
|
+
writable: !0,
|
|
168
|
+
value: {
|
|
169
|
+
value: n,
|
|
170
|
+
name: q
|
|
171
|
+
}
|
|
172
|
+
}), ue(y, n, l);
|
|
173
|
+
}), G = Array.isArray(V);
|
|
174
|
+
let g = G ? V.slice().sort(ut) : [V];
|
|
175
|
+
g = g.map((r) => he(r, b, f));
|
|
176
|
+
const oe = N === !0 && _ !== null ? [...Array(Math.floor((f - b) / _) + 1)].map((r, n) => ({
|
|
177
|
+
value: b + _ * n
|
|
178
|
+
})) : N || [], w = oe.map((r) => r.value), {
|
|
179
|
+
isFocusVisibleRef: Te,
|
|
180
|
+
onBlur: A,
|
|
181
|
+
onFocus: I,
|
|
182
|
+
ref: we
|
|
183
|
+
} = Mt(), [Le, re] = T.useState(-1), S = T.useRef(), Se = at(we, S), be = at(ge, Se), Pe = (r) => (n) => {
|
|
184
|
+
var l;
|
|
185
|
+
const i = Number(n.currentTarget.getAttribute("data-index"));
|
|
186
|
+
I(n), Te.current === !0 && re(i), H(i), r == null || (l = r.onFocus) == null || l.call(r, n);
|
|
187
|
+
}, Ae = (r) => (n) => {
|
|
188
|
+
var l;
|
|
189
|
+
A(n), Te.current === !1 && re(-1), H(-1), r == null || (l = r.onBlur) == null || l.call(r, n);
|
|
190
|
+
};
|
|
191
|
+
zt(() => {
|
|
192
|
+
if (s && S.current.contains(document.activeElement)) {
|
|
193
|
+
var r;
|
|
194
|
+
(r = document.activeElement) == null || r.blur();
|
|
195
|
+
}
|
|
196
|
+
}, [s]), s && pe !== -1 && D(-1), s && Le !== -1 && re(-1);
|
|
197
|
+
const ae = (r) => (n) => {
|
|
198
|
+
var l;
|
|
199
|
+
(l = r.onChange) == null || l.call(r, n);
|
|
200
|
+
const i = Number(n.currentTarget.getAttribute("data-index")), y = g[i], P = w.indexOf(y);
|
|
201
|
+
let p = n.target.valueAsNumber;
|
|
202
|
+
if (oe && _ == null && (p = p < y ? w[P - 1] : w[P + 1]), p = he(p, b, f), oe && _ == null) {
|
|
203
|
+
const O = w.indexOf(g[i]);
|
|
204
|
+
p = p < g[i] ? w[O - 1] : w[O + 1];
|
|
205
|
+
}
|
|
206
|
+
if (G) {
|
|
207
|
+
d && (p = he(p, g[i - 1] || -1 / 0, g[i + 1] || 1 / 0));
|
|
208
|
+
const O = p;
|
|
209
|
+
p = st({
|
|
210
|
+
values: g,
|
|
211
|
+
newValue: p,
|
|
212
|
+
index: i
|
|
213
|
+
});
|
|
214
|
+
let u = i;
|
|
215
|
+
d || (u = p.indexOf(O)), $e({
|
|
216
|
+
sliderRef: S,
|
|
217
|
+
activeIndex: u
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
Y(p), re(i), z && !Ne(p, V) && z(n, p, i), X && X(n, p);
|
|
221
|
+
}, K = T.useRef();
|
|
222
|
+
let ne = te;
|
|
223
|
+
L && te === "horizontal" && (ne += "-reverse");
|
|
224
|
+
const le = ({
|
|
225
|
+
finger: r,
|
|
226
|
+
move: n = !1
|
|
227
|
+
}) => {
|
|
228
|
+
const {
|
|
229
|
+
current: l
|
|
230
|
+
} = S, {
|
|
231
|
+
width: i,
|
|
232
|
+
height: y,
|
|
233
|
+
bottom: P,
|
|
234
|
+
left: p
|
|
235
|
+
} = l.getBoundingClientRect();
|
|
236
|
+
let O;
|
|
237
|
+
ne.indexOf("vertical") === 0 ? O = (P - r.y) / y : O = (r.x - p) / i, ne.indexOf("-reverse") !== -1 && (O = 1 - O);
|
|
238
|
+
let u;
|
|
239
|
+
if (u = Bt(O, b, f), _)
|
|
240
|
+
u = qt(u, _, b);
|
|
241
|
+
else {
|
|
242
|
+
const ve = lt(w, u);
|
|
243
|
+
u = w[ve];
|
|
244
|
+
}
|
|
245
|
+
u = he(u, b, f);
|
|
246
|
+
let j = 0;
|
|
247
|
+
if (G) {
|
|
248
|
+
n ? j = K.current : j = lt(g, u), d && (u = he(u, g[j - 1] || -1 / 0, g[j + 1] || 1 / 0));
|
|
249
|
+
const ve = u;
|
|
250
|
+
u = st({
|
|
251
|
+
values: g,
|
|
252
|
+
newValue: u,
|
|
253
|
+
index: j
|
|
254
|
+
}), d && n || (j = u.indexOf(ve), K.current = j);
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
newValue: u,
|
|
258
|
+
activeIndex: j
|
|
259
|
+
};
|
|
260
|
+
}, J = We((r) => {
|
|
261
|
+
const n = Ce(r, M);
|
|
262
|
+
if (!n)
|
|
263
|
+
return;
|
|
264
|
+
if (W.current += 1, r.type === "mousemove" && r.buttons === 0) {
|
|
265
|
+
R(r);
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const {
|
|
269
|
+
newValue: l,
|
|
270
|
+
activeIndex: i
|
|
271
|
+
} = le({
|
|
272
|
+
finger: n,
|
|
273
|
+
move: !0
|
|
274
|
+
});
|
|
275
|
+
$e({
|
|
276
|
+
sliderRef: S,
|
|
277
|
+
activeIndex: i,
|
|
278
|
+
setActive: D
|
|
279
|
+
}), Y(l), !me && W.current > Yt && fe(!0), z && !Ne(l, V) && z(r, l, i);
|
|
280
|
+
}), R = We((r) => {
|
|
281
|
+
const n = Ce(r, M);
|
|
282
|
+
if (fe(!1), !n)
|
|
283
|
+
return;
|
|
284
|
+
const {
|
|
285
|
+
newValue: l
|
|
286
|
+
} = le({
|
|
287
|
+
finger: n,
|
|
288
|
+
move: !0
|
|
289
|
+
});
|
|
290
|
+
D(-1), r.type === "touchend" && H(-1), X && X(r, l), M.current = void 0, m();
|
|
291
|
+
}), v = We((r) => {
|
|
292
|
+
if (s)
|
|
293
|
+
return;
|
|
294
|
+
Ge() || r.preventDefault();
|
|
295
|
+
const n = r.changedTouches[0];
|
|
296
|
+
n != null && (M.current = n.identifier);
|
|
297
|
+
const l = Ce(r, M);
|
|
298
|
+
if (l !== !1) {
|
|
299
|
+
const {
|
|
300
|
+
newValue: y,
|
|
301
|
+
activeIndex: P
|
|
302
|
+
} = le({
|
|
303
|
+
finger: l
|
|
304
|
+
});
|
|
305
|
+
$e({
|
|
306
|
+
sliderRef: S,
|
|
307
|
+
activeIndex: P,
|
|
308
|
+
setActive: D
|
|
309
|
+
}), Y(y), z && !Ne(y, V) && z(r, y, P);
|
|
310
|
+
}
|
|
311
|
+
W.current = 0;
|
|
312
|
+
const i = _e(S.current);
|
|
313
|
+
i.addEventListener("touchmove", J), i.addEventListener("touchend", R);
|
|
314
|
+
}), m = T.useCallback(() => {
|
|
315
|
+
const r = _e(S.current);
|
|
316
|
+
r.removeEventListener("mousemove", J), r.removeEventListener("mouseup", R), r.removeEventListener("touchmove", J), r.removeEventListener("touchend", R);
|
|
317
|
+
}, [R, J]);
|
|
318
|
+
T.useEffect(() => {
|
|
319
|
+
const {
|
|
320
|
+
current: r
|
|
321
|
+
} = S;
|
|
322
|
+
return r.addEventListener("touchstart", v, {
|
|
323
|
+
passive: Ge()
|
|
324
|
+
}), () => {
|
|
325
|
+
r.removeEventListener("touchstart", v, {
|
|
326
|
+
passive: Ge()
|
|
327
|
+
}), m();
|
|
328
|
+
};
|
|
329
|
+
}, [m, v]), T.useEffect(() => {
|
|
330
|
+
s && m();
|
|
331
|
+
}, [s, m]);
|
|
332
|
+
const se = (r) => (n) => {
|
|
333
|
+
var l;
|
|
334
|
+
if ((l = r.onMouseDown) == null || l.call(r, n), s || n.defaultPrevented || n.button !== 0)
|
|
335
|
+
return;
|
|
336
|
+
n.preventDefault();
|
|
337
|
+
const i = Ce(n, M);
|
|
338
|
+
if (i !== !1) {
|
|
339
|
+
const {
|
|
340
|
+
newValue: P,
|
|
341
|
+
activeIndex: p
|
|
342
|
+
} = le({
|
|
343
|
+
finger: i
|
|
344
|
+
});
|
|
345
|
+
$e({
|
|
346
|
+
sliderRef: S,
|
|
347
|
+
activeIndex: p,
|
|
348
|
+
setActive: D
|
|
349
|
+
}), Y(P), z && !Ne(P, V) && z(n, P, p);
|
|
350
|
+
}
|
|
351
|
+
W.current = 0;
|
|
352
|
+
const y = _e(S.current);
|
|
353
|
+
y.addEventListener("mousemove", J), y.addEventListener("mouseup", R);
|
|
354
|
+
}, Q = Ve(G ? g[0] : b, b, f), Z = Ve(g[g.length - 1], b, f) - Q, Ie = (r = {}) => {
|
|
355
|
+
const n = {
|
|
356
|
+
onMouseDown: se(r || {})
|
|
357
|
+
}, l = c({}, r, n);
|
|
358
|
+
return c({
|
|
359
|
+
ref: be
|
|
360
|
+
}, l);
|
|
361
|
+
}, x = (r) => (n) => {
|
|
362
|
+
var l;
|
|
363
|
+
(l = r.onMouseOver) == null || l.call(r, n);
|
|
364
|
+
const i = Number(n.currentTarget.getAttribute("data-index"));
|
|
365
|
+
H(i);
|
|
366
|
+
}, ie = (r) => (n) => {
|
|
367
|
+
var l;
|
|
368
|
+
(l = r.onMouseLeave) == null || l.call(r, n), H(-1);
|
|
369
|
+
};
|
|
370
|
+
return {
|
|
371
|
+
active: pe,
|
|
372
|
+
axis: ne,
|
|
373
|
+
axisProps: Xt,
|
|
374
|
+
dragging: me,
|
|
375
|
+
focusedThumbIndex: Le,
|
|
376
|
+
getHiddenInputProps: (r = {}) => {
|
|
377
|
+
var n;
|
|
378
|
+
const l = {
|
|
379
|
+
onChange: ae(r || {}),
|
|
380
|
+
onFocus: Pe(r || {}),
|
|
381
|
+
onBlur: Ae(r || {})
|
|
382
|
+
}, i = c({}, r, l);
|
|
383
|
+
return c({
|
|
384
|
+
tabIndex: ye,
|
|
385
|
+
"aria-labelledby": o,
|
|
386
|
+
"aria-orientation": te,
|
|
387
|
+
"aria-valuemax": de(f),
|
|
388
|
+
"aria-valuemin": de(b),
|
|
389
|
+
name: q,
|
|
390
|
+
type: "range",
|
|
391
|
+
min: e.min,
|
|
392
|
+
max: e.max,
|
|
393
|
+
step: (n = e.step) != null ? n : void 0,
|
|
394
|
+
disabled: s
|
|
395
|
+
}, i, {
|
|
396
|
+
style: c({}, Dt, {
|
|
397
|
+
direction: L ? "rtl" : "ltr",
|
|
398
|
+
// So that VoiceOver's focus indicator matches the thumb's dimensions
|
|
399
|
+
width: "100%",
|
|
400
|
+
height: "100%"
|
|
401
|
+
})
|
|
402
|
+
});
|
|
403
|
+
},
|
|
404
|
+
getRootProps: Ie,
|
|
405
|
+
getThumbProps: (r = {}) => {
|
|
406
|
+
const n = {
|
|
407
|
+
onMouseOver: x(r || {}),
|
|
408
|
+
onMouseLeave: ie(r || {})
|
|
409
|
+
};
|
|
410
|
+
return c({}, r, n);
|
|
411
|
+
},
|
|
412
|
+
marks: oe,
|
|
413
|
+
open: xe,
|
|
414
|
+
range: G,
|
|
415
|
+
rootRef: be,
|
|
416
|
+
trackLeap: Z,
|
|
417
|
+
trackOffset: Q,
|
|
418
|
+
values: g
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
const Kt = (e) => !e || !Ee(e), Jt = Kt;
|
|
422
|
+
function Qt(e) {
|
|
423
|
+
return Rt("MuiSlider", e);
|
|
424
|
+
}
|
|
425
|
+
const Zt = Vt("MuiSlider", ["root", "active", "colorPrimary", "colorSecondary", "disabled", "dragging", "focusVisible", "mark", "markActive", "marked", "markLabel", "markLabelActive", "rail", "sizeSmall", "thumb", "thumbColorPrimary", "thumbColorSecondary", "track", "trackInverted", "trackFalse", "thumbSizeSmall", "valueLabel", "valueLabelOpen", "valueLabelCircle", "valueLabelLabel", "vertical"]), E = Zt, eo = (e) => {
|
|
426
|
+
const {
|
|
427
|
+
open: o
|
|
428
|
+
} = e;
|
|
429
|
+
return {
|
|
430
|
+
offset: ce(o && E.valueLabelOpen),
|
|
431
|
+
circle: E.valueLabelCircle,
|
|
432
|
+
label: E.valueLabelLabel
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
function dt(e) {
|
|
436
|
+
const {
|
|
437
|
+
children: o,
|
|
438
|
+
className: a,
|
|
439
|
+
value: s
|
|
440
|
+
} = e, d = eo(e);
|
|
441
|
+
return o ? /* @__PURE__ */ T.cloneElement(o, {
|
|
442
|
+
className: ce(o.props.className)
|
|
443
|
+
}, /* @__PURE__ */ C.jsxs(T.Fragment, {
|
|
444
|
+
children: [o.props.children, /* @__PURE__ */ C.jsx("span", {
|
|
445
|
+
className: ce(d.offset, a),
|
|
446
|
+
"aria-hidden": !0,
|
|
447
|
+
children: /* @__PURE__ */ C.jsx("span", {
|
|
448
|
+
className: d.circle,
|
|
449
|
+
children: /* @__PURE__ */ C.jsx("span", {
|
|
450
|
+
className: d.label,
|
|
451
|
+
children: s
|
|
452
|
+
})
|
|
453
|
+
})
|
|
454
|
+
})]
|
|
455
|
+
})) : null;
|
|
456
|
+
}
|
|
457
|
+
process.env.NODE_ENV !== "production" && (dt.propTypes = {
|
|
458
|
+
children: t.element.isRequired,
|
|
459
|
+
className: t.string,
|
|
460
|
+
value: t.node
|
|
461
|
+
});
|
|
462
|
+
const to = ["aria-label", "aria-valuetext", "aria-labelledby", "component", "components", "componentsProps", "color", "classes", "className", "disableSwap", "disabled", "getAriaLabel", "getAriaValueText", "marks", "max", "min", "name", "onChange", "onChangeCommitted", "orientation", "size", "step", "scale", "slotProps", "slots", "tabIndex", "track", "value", "valueLabelDisplay", "valueLabelFormat"];
|
|
463
|
+
function it(e) {
|
|
464
|
+
return e;
|
|
465
|
+
}
|
|
466
|
+
const pt = ee("span", {
|
|
467
|
+
name: "MuiSlider",
|
|
468
|
+
slot: "Root",
|
|
469
|
+
overridesResolver: (e, o) => {
|
|
470
|
+
const {
|
|
471
|
+
ownerState: a
|
|
472
|
+
} = e;
|
|
473
|
+
return [o.root, o[`color${U(a.color)}`], a.size !== "medium" && o[`size${U(a.size)}`], a.marked && o.marked, a.orientation === "vertical" && o.vertical, a.track === "inverted" && o.trackInverted, a.track === !1 && o.trackFalse];
|
|
474
|
+
}
|
|
475
|
+
})(({
|
|
476
|
+
theme: e,
|
|
477
|
+
ownerState: o
|
|
478
|
+
}) => c({
|
|
479
|
+
borderRadius: 12,
|
|
480
|
+
boxSizing: "content-box",
|
|
481
|
+
display: "inline-block",
|
|
482
|
+
position: "relative",
|
|
483
|
+
cursor: "pointer",
|
|
484
|
+
touchAction: "none",
|
|
485
|
+
color: (e.vars || e).palette[o.color].main,
|
|
486
|
+
WebkitTapHighlightColor: "transparent"
|
|
487
|
+
}, o.orientation === "horizontal" && c({
|
|
488
|
+
height: 4,
|
|
489
|
+
width: "100%",
|
|
490
|
+
padding: "13px 0",
|
|
491
|
+
// The primary input mechanism of the device includes a pointing device of limited accuracy.
|
|
492
|
+
"@media (pointer: coarse)": {
|
|
493
|
+
// Reach 42px touch target, about ~8mm on screen.
|
|
494
|
+
padding: "20px 0"
|
|
495
|
+
}
|
|
496
|
+
}, o.size === "small" && {
|
|
497
|
+
height: 2
|
|
498
|
+
}, o.marked && {
|
|
499
|
+
marginBottom: 20
|
|
500
|
+
}), o.orientation === "vertical" && c({
|
|
501
|
+
height: "100%",
|
|
502
|
+
width: 4,
|
|
503
|
+
padding: "0 13px",
|
|
504
|
+
// The primary input mechanism of the device includes a pointing device of limited accuracy.
|
|
505
|
+
"@media (pointer: coarse)": {
|
|
506
|
+
// Reach 42px touch target, about ~8mm on screen.
|
|
507
|
+
padding: "0 20px"
|
|
508
|
+
}
|
|
509
|
+
}, o.size === "small" && {
|
|
510
|
+
width: 2
|
|
511
|
+
}, o.marked && {
|
|
512
|
+
marginRight: 44
|
|
513
|
+
}), {
|
|
514
|
+
"@media print": {
|
|
515
|
+
colorAdjust: "exact"
|
|
516
|
+
},
|
|
517
|
+
[`&.${E.disabled}`]: {
|
|
518
|
+
pointerEvents: "none",
|
|
519
|
+
cursor: "default",
|
|
520
|
+
color: (e.vars || e).palette.grey[400]
|
|
521
|
+
},
|
|
522
|
+
[`&.${E.dragging}`]: {
|
|
523
|
+
[`& .${E.thumb}, & .${E.track}`]: {
|
|
524
|
+
transition: "none"
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}));
|
|
528
|
+
process.env.NODE_ENV !== "production" && (pt.propTypes = {
|
|
529
|
+
// ----------------------------- Warning --------------------------------
|
|
530
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
531
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
532
|
+
// ----------------------------------------------------------------------
|
|
533
|
+
/**
|
|
534
|
+
* @ignore
|
|
535
|
+
*/
|
|
536
|
+
children: t.node
|
|
537
|
+
});
|
|
538
|
+
const mt = ee("span", {
|
|
539
|
+
name: "MuiSlider",
|
|
540
|
+
slot: "Rail",
|
|
541
|
+
overridesResolver: (e, o) => o.rail
|
|
542
|
+
})(({
|
|
543
|
+
ownerState: e
|
|
544
|
+
}) => c({
|
|
545
|
+
display: "block",
|
|
546
|
+
position: "absolute",
|
|
547
|
+
borderRadius: "inherit",
|
|
548
|
+
backgroundColor: "currentColor",
|
|
549
|
+
opacity: 0.38
|
|
550
|
+
}, e.orientation === "horizontal" && {
|
|
551
|
+
width: "100%",
|
|
552
|
+
height: "inherit",
|
|
553
|
+
top: "50%",
|
|
554
|
+
transform: "translateY(-50%)"
|
|
555
|
+
}, e.orientation === "vertical" && {
|
|
556
|
+
height: "100%",
|
|
557
|
+
width: "inherit",
|
|
558
|
+
left: "50%",
|
|
559
|
+
transform: "translateX(-50%)"
|
|
560
|
+
}, e.track === "inverted" && {
|
|
561
|
+
opacity: 1
|
|
562
|
+
}));
|
|
563
|
+
process.env.NODE_ENV !== "production" && (mt.propTypes = {
|
|
564
|
+
// ----------------------------- Warning --------------------------------
|
|
565
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
566
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
567
|
+
// ----------------------------------------------------------------------
|
|
568
|
+
/**
|
|
569
|
+
* @ignore
|
|
570
|
+
*/
|
|
571
|
+
children: t.node
|
|
572
|
+
});
|
|
573
|
+
const ft = ee("span", {
|
|
574
|
+
name: "MuiSlider",
|
|
575
|
+
slot: "Track",
|
|
576
|
+
overridesResolver: (e, o) => o.track
|
|
577
|
+
})(({
|
|
578
|
+
theme: e,
|
|
579
|
+
ownerState: o
|
|
580
|
+
}) => {
|
|
581
|
+
const a = (
|
|
582
|
+
// Same logic as the LinearProgress track color
|
|
583
|
+
e.palette.mode === "light" ? Et(e.palette[o.color].main, 0.62) : _t(e.palette[o.color].main, 0.5)
|
|
584
|
+
);
|
|
585
|
+
return c({
|
|
586
|
+
display: "block",
|
|
587
|
+
position: "absolute",
|
|
588
|
+
borderRadius: "inherit",
|
|
589
|
+
border: "1px solid currentColor",
|
|
590
|
+
backgroundColor: "currentColor",
|
|
591
|
+
transition: e.transitions.create(["left", "width", "bottom", "height"], {
|
|
592
|
+
duration: e.transitions.duration.shortest
|
|
593
|
+
})
|
|
594
|
+
}, o.size === "small" && {
|
|
595
|
+
border: "none"
|
|
596
|
+
}, o.orientation === "horizontal" && {
|
|
597
|
+
height: "inherit",
|
|
598
|
+
top: "50%",
|
|
599
|
+
transform: "translateY(-50%)"
|
|
600
|
+
}, o.orientation === "vertical" && {
|
|
601
|
+
width: "inherit",
|
|
602
|
+
left: "50%",
|
|
603
|
+
transform: "translateX(-50%)"
|
|
604
|
+
}, o.track === !1 && {
|
|
605
|
+
display: "none"
|
|
606
|
+
}, o.track === "inverted" && {
|
|
607
|
+
backgroundColor: e.vars ? e.vars.palette.Slider[`${o.color}Track`] : a,
|
|
608
|
+
borderColor: e.vars ? e.vars.palette.Slider[`${o.color}Track`] : a
|
|
609
|
+
});
|
|
610
|
+
});
|
|
611
|
+
process.env.NODE_ENV !== "production" && (ft.propTypes = {
|
|
612
|
+
// ----------------------------- Warning --------------------------------
|
|
613
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
614
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
615
|
+
// ----------------------------------------------------------------------
|
|
616
|
+
/**
|
|
617
|
+
* @ignore
|
|
618
|
+
*/
|
|
619
|
+
children: t.node
|
|
620
|
+
});
|
|
621
|
+
const bt = ee("span", {
|
|
622
|
+
name: "MuiSlider",
|
|
623
|
+
slot: "Thumb",
|
|
624
|
+
overridesResolver: (e, o) => {
|
|
625
|
+
const {
|
|
626
|
+
ownerState: a
|
|
627
|
+
} = e;
|
|
628
|
+
return [o.thumb, o[`thumbColor${U(a.color)}`], a.size !== "medium" && o[`thumbSize${U(a.size)}`]];
|
|
629
|
+
}
|
|
630
|
+
})(({
|
|
631
|
+
theme: e,
|
|
632
|
+
ownerState: o
|
|
633
|
+
}) => c({
|
|
634
|
+
position: "absolute",
|
|
635
|
+
width: 20,
|
|
636
|
+
height: 20,
|
|
637
|
+
boxSizing: "border-box",
|
|
638
|
+
borderRadius: "50%",
|
|
639
|
+
outline: 0,
|
|
640
|
+
backgroundColor: "currentColor",
|
|
641
|
+
display: "flex",
|
|
642
|
+
alignItems: "center",
|
|
643
|
+
justifyContent: "center",
|
|
644
|
+
transition: e.transitions.create(["box-shadow", "left", "bottom"], {
|
|
645
|
+
duration: e.transitions.duration.shortest
|
|
646
|
+
})
|
|
647
|
+
}, o.size === "small" && {
|
|
648
|
+
width: 12,
|
|
649
|
+
height: 12
|
|
650
|
+
}, o.orientation === "horizontal" && {
|
|
651
|
+
top: "50%",
|
|
652
|
+
transform: "translate(-50%, -50%)"
|
|
653
|
+
}, o.orientation === "vertical" && {
|
|
654
|
+
left: "50%",
|
|
655
|
+
transform: "translate(-50%, 50%)"
|
|
656
|
+
}, {
|
|
657
|
+
"&:before": c({
|
|
658
|
+
position: "absolute",
|
|
659
|
+
content: '""',
|
|
660
|
+
borderRadius: "inherit",
|
|
661
|
+
width: "100%",
|
|
662
|
+
height: "100%",
|
|
663
|
+
boxShadow: (e.vars || e).shadows[2]
|
|
664
|
+
}, o.size === "small" && {
|
|
665
|
+
boxShadow: "none"
|
|
666
|
+
}),
|
|
667
|
+
"&::after": {
|
|
668
|
+
position: "absolute",
|
|
669
|
+
content: '""',
|
|
670
|
+
borderRadius: "50%",
|
|
671
|
+
// 42px is the hit target
|
|
672
|
+
width: 42,
|
|
673
|
+
height: 42,
|
|
674
|
+
top: "50%",
|
|
675
|
+
left: "50%",
|
|
676
|
+
transform: "translate(-50%, -50%)"
|
|
677
|
+
},
|
|
678
|
+
[`&:hover, &.${E.focusVisible}`]: {
|
|
679
|
+
boxShadow: `0px 0px 0px 8px ${e.vars ? `rgba(${e.vars.palette[o.color].mainChannel} / 0.16)` : rt(e.palette[o.color].main, 0.16)}`,
|
|
680
|
+
"@media (hover: none)": {
|
|
681
|
+
boxShadow: "none"
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
[`&.${E.active}`]: {
|
|
685
|
+
boxShadow: `0px 0px 0px 14px ${e.vars ? `rgba(${e.vars.palette[o.color].mainChannel} / 0.16)` : rt(e.palette[o.color].main, 0.16)}`
|
|
686
|
+
},
|
|
687
|
+
[`&.${E.disabled}`]: {
|
|
688
|
+
"&:hover": {
|
|
689
|
+
boxShadow: "none"
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
}));
|
|
693
|
+
process.env.NODE_ENV !== "production" && (bt.propTypes = {
|
|
694
|
+
// ----------------------------- Warning --------------------------------
|
|
695
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
696
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
697
|
+
// ----------------------------------------------------------------------
|
|
698
|
+
/**
|
|
699
|
+
* @ignore
|
|
700
|
+
*/
|
|
701
|
+
children: t.node
|
|
702
|
+
});
|
|
703
|
+
const vt = ee(dt, {
|
|
704
|
+
name: "MuiSlider",
|
|
705
|
+
slot: "ValueLabel",
|
|
706
|
+
overridesResolver: (e, o) => o.valueLabel
|
|
707
|
+
})(({
|
|
708
|
+
theme: e,
|
|
709
|
+
ownerState: o
|
|
710
|
+
}) => c({
|
|
711
|
+
[`&.${E.valueLabelOpen}`]: {
|
|
712
|
+
transform: `${o.orientation === "vertical" ? "translateY(-50%)" : "translateY(-100%)"} scale(1)`
|
|
713
|
+
},
|
|
714
|
+
zIndex: 1,
|
|
715
|
+
whiteSpace: "nowrap"
|
|
716
|
+
}, e.typography.body2, {
|
|
717
|
+
fontWeight: 500,
|
|
718
|
+
transition: e.transitions.create(["transform"], {
|
|
719
|
+
duration: e.transitions.duration.shortest
|
|
720
|
+
}),
|
|
721
|
+
transform: `${o.orientation === "vertical" ? "translateY(-50%)" : "translateY(-100%)"} scale(0)`,
|
|
722
|
+
position: "absolute",
|
|
723
|
+
backgroundColor: (e.vars || e).palette.grey[600],
|
|
724
|
+
borderRadius: 2,
|
|
725
|
+
color: (e.vars || e).palette.common.white,
|
|
726
|
+
display: "flex",
|
|
727
|
+
alignItems: "center",
|
|
728
|
+
justifyContent: "center",
|
|
729
|
+
padding: "0.25rem 0.75rem"
|
|
730
|
+
}, o.orientation === "horizontal" && {
|
|
731
|
+
top: "-10px",
|
|
732
|
+
transformOrigin: "bottom center",
|
|
733
|
+
"&:before": {
|
|
734
|
+
position: "absolute",
|
|
735
|
+
content: '""',
|
|
736
|
+
width: 8,
|
|
737
|
+
height: 8,
|
|
738
|
+
transform: "translate(-50%, 50%) rotate(45deg)",
|
|
739
|
+
backgroundColor: "inherit",
|
|
740
|
+
bottom: 0,
|
|
741
|
+
left: "50%"
|
|
742
|
+
}
|
|
743
|
+
}, o.orientation === "vertical" && {
|
|
744
|
+
right: o.size === "small" ? "20px" : "30px",
|
|
745
|
+
top: "50%",
|
|
746
|
+
transformOrigin: "right center",
|
|
747
|
+
"&:before": {
|
|
748
|
+
position: "absolute",
|
|
749
|
+
content: '""',
|
|
750
|
+
width: 8,
|
|
751
|
+
height: 8,
|
|
752
|
+
transform: "translate(-50%, -50%) rotate(45deg)",
|
|
753
|
+
backgroundColor: "inherit",
|
|
754
|
+
right: "-20%",
|
|
755
|
+
top: "50%"
|
|
756
|
+
}
|
|
757
|
+
}, o.size === "small" && {
|
|
758
|
+
fontSize: e.typography.pxToRem(12),
|
|
759
|
+
padding: "0.25rem 0.5rem"
|
|
760
|
+
}));
|
|
761
|
+
process.env.NODE_ENV !== "production" && (vt.propTypes = {
|
|
762
|
+
// ----------------------------- Warning --------------------------------
|
|
763
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
764
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
765
|
+
// ----------------------------------------------------------------------
|
|
766
|
+
/**
|
|
767
|
+
* @ignore
|
|
768
|
+
*/
|
|
769
|
+
children: t.node
|
|
770
|
+
});
|
|
771
|
+
const ht = ee("span", {
|
|
772
|
+
name: "MuiSlider",
|
|
773
|
+
slot: "Mark",
|
|
774
|
+
shouldForwardProp: (e) => ct(e) && e !== "markActive",
|
|
775
|
+
overridesResolver: (e, o) => {
|
|
776
|
+
const {
|
|
777
|
+
markActive: a
|
|
778
|
+
} = e;
|
|
779
|
+
return [o.mark, a && o.markActive];
|
|
780
|
+
}
|
|
781
|
+
})(({
|
|
782
|
+
theme: e,
|
|
783
|
+
ownerState: o,
|
|
784
|
+
markActive: a
|
|
785
|
+
}) => c({
|
|
786
|
+
position: "absolute",
|
|
787
|
+
width: 2,
|
|
788
|
+
height: 2,
|
|
789
|
+
borderRadius: 1,
|
|
790
|
+
backgroundColor: "currentColor"
|
|
791
|
+
}, o.orientation === "horizontal" && {
|
|
792
|
+
top: "50%",
|
|
793
|
+
transform: "translate(-1px, -50%)"
|
|
794
|
+
}, o.orientation === "vertical" && {
|
|
795
|
+
left: "50%",
|
|
796
|
+
transform: "translate(-50%, 1px)"
|
|
797
|
+
}, a && {
|
|
798
|
+
backgroundColor: (e.vars || e).palette.background.paper,
|
|
799
|
+
opacity: 0.8
|
|
800
|
+
}));
|
|
801
|
+
process.env.NODE_ENV !== "production" && (ht.propTypes = {
|
|
802
|
+
// ----------------------------- Warning --------------------------------
|
|
803
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
804
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
805
|
+
// ----------------------------------------------------------------------
|
|
806
|
+
/**
|
|
807
|
+
* @ignore
|
|
808
|
+
*/
|
|
809
|
+
children: t.node
|
|
810
|
+
});
|
|
811
|
+
const gt = ee("span", {
|
|
812
|
+
name: "MuiSlider",
|
|
813
|
+
slot: "MarkLabel",
|
|
814
|
+
shouldForwardProp: (e) => ct(e) && e !== "markLabelActive",
|
|
815
|
+
overridesResolver: (e, o) => o.markLabel
|
|
816
|
+
})(({
|
|
817
|
+
theme: e,
|
|
818
|
+
ownerState: o,
|
|
819
|
+
markLabelActive: a
|
|
820
|
+
}) => c({}, e.typography.body2, {
|
|
821
|
+
color: (e.vars || e).palette.text.secondary,
|
|
822
|
+
position: "absolute",
|
|
823
|
+
whiteSpace: "nowrap"
|
|
824
|
+
}, o.orientation === "horizontal" && {
|
|
825
|
+
top: 30,
|
|
826
|
+
transform: "translateX(-50%)",
|
|
827
|
+
"@media (pointer: coarse)": {
|
|
828
|
+
top: 40
|
|
829
|
+
}
|
|
830
|
+
}, o.orientation === "vertical" && {
|
|
831
|
+
left: 36,
|
|
832
|
+
transform: "translateY(50%)",
|
|
833
|
+
"@media (pointer: coarse)": {
|
|
834
|
+
left: 44
|
|
835
|
+
}
|
|
836
|
+
}, a && {
|
|
837
|
+
color: (e.vars || e).palette.text.primary
|
|
838
|
+
}));
|
|
839
|
+
process.env.NODE_ENV !== "production" && (gt.propTypes = {
|
|
840
|
+
// ----------------------------- Warning --------------------------------
|
|
841
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
842
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
843
|
+
// ----------------------------------------------------------------------
|
|
844
|
+
/**
|
|
845
|
+
* @ignore
|
|
846
|
+
*/
|
|
847
|
+
children: t.node
|
|
848
|
+
});
|
|
849
|
+
const oo = (e) => {
|
|
850
|
+
const {
|
|
851
|
+
disabled: o,
|
|
852
|
+
dragging: a,
|
|
853
|
+
marked: s,
|
|
854
|
+
orientation: d,
|
|
855
|
+
track: L,
|
|
856
|
+
classes: N,
|
|
857
|
+
color: f,
|
|
858
|
+
size: b
|
|
859
|
+
} = e, q = {
|
|
860
|
+
root: ["root", o && "disabled", a && "dragging", s && "marked", d === "vertical" && "vertical", L === "inverted" && "trackInverted", L === !1 && "trackFalse", f && `color${U(f)}`, b && `size${U(b)}`],
|
|
861
|
+
rail: ["rail"],
|
|
862
|
+
track: ["track"],
|
|
863
|
+
mark: ["mark"],
|
|
864
|
+
markActive: ["markActive"],
|
|
865
|
+
markLabel: ["markLabel"],
|
|
866
|
+
markLabelActive: ["markLabelActive"],
|
|
867
|
+
valueLabel: ["valueLabel"],
|
|
868
|
+
thumb: ["thumb", o && "disabled", b && `thumbSize${U(b)}`, f && `thumbColor${U(f)}`],
|
|
869
|
+
active: ["active"],
|
|
870
|
+
disabled: ["disabled"],
|
|
871
|
+
focusVisible: ["focusVisible"]
|
|
872
|
+
};
|
|
873
|
+
return At(q, Qt, N);
|
|
874
|
+
}, ro = ({
|
|
875
|
+
children: e
|
|
876
|
+
}) => e, yt = /* @__PURE__ */ T.forwardRef(function(o, a) {
|
|
877
|
+
var s, d, L, N, f, b, q, ue, X, te, ge, de, _, ye, ke, M, pe, D, xe, H, me, fe, W, V;
|
|
878
|
+
const Y = wt({
|
|
879
|
+
props: o,
|
|
880
|
+
name: "MuiSlider"
|
|
881
|
+
}), G = It().direction === "rtl", {
|
|
882
|
+
"aria-label": g,
|
|
883
|
+
"aria-valuetext": oe,
|
|
884
|
+
"aria-labelledby": w,
|
|
885
|
+
// eslint-disable-next-line react/prop-types
|
|
886
|
+
component: Te = "span",
|
|
887
|
+
components: A = {},
|
|
888
|
+
componentsProps: I = {},
|
|
889
|
+
color: we = "primary",
|
|
890
|
+
classes: Le,
|
|
891
|
+
className: re,
|
|
892
|
+
disableSwap: S = !1,
|
|
893
|
+
disabled: Se = !1,
|
|
894
|
+
getAriaLabel: be,
|
|
895
|
+
getAriaValueText: Pe,
|
|
896
|
+
marks: Ae = !1,
|
|
897
|
+
max: ae = 100,
|
|
898
|
+
min: K = 0,
|
|
899
|
+
orientation: ne = "horizontal",
|
|
900
|
+
size: le = "medium",
|
|
901
|
+
step: J = 1,
|
|
902
|
+
scale: R = it,
|
|
903
|
+
slotProps: v,
|
|
904
|
+
slots: m,
|
|
905
|
+
track: se = "normal",
|
|
906
|
+
valueLabelDisplay: Q = "off",
|
|
907
|
+
valueLabelFormat: Z = it
|
|
908
|
+
} = Y, Ie = Nt(Y, to), x = c({}, Y, {
|
|
909
|
+
isRtl: G,
|
|
910
|
+
max: ae,
|
|
911
|
+
min: K,
|
|
912
|
+
classes: Le,
|
|
913
|
+
disabled: Se,
|
|
914
|
+
disableSwap: S,
|
|
915
|
+
orientation: ne,
|
|
916
|
+
marks: Ae,
|
|
917
|
+
color: we,
|
|
918
|
+
size: le,
|
|
919
|
+
step: J,
|
|
920
|
+
scale: R,
|
|
921
|
+
track: se,
|
|
922
|
+
valueLabelDisplay: Q,
|
|
923
|
+
valueLabelFormat: Z
|
|
924
|
+
}), {
|
|
925
|
+
axisProps: ie,
|
|
926
|
+
getRootProps: Ke,
|
|
927
|
+
getHiddenInputProps: Je,
|
|
928
|
+
getThumbProps: r,
|
|
929
|
+
open: n,
|
|
930
|
+
active: l,
|
|
931
|
+
axis: i,
|
|
932
|
+
focusedThumbIndex: y,
|
|
933
|
+
range: P,
|
|
934
|
+
dragging: p,
|
|
935
|
+
marks: O,
|
|
936
|
+
values: u,
|
|
937
|
+
trackOffset: j,
|
|
938
|
+
trackLeap: ve
|
|
939
|
+
} = Gt(c({}, x, {
|
|
940
|
+
rootRef: a
|
|
941
|
+
}));
|
|
942
|
+
x.marked = O.length > 0 && O.some((h) => h.label), x.dragging = p, x.focusedThumbIndex = y;
|
|
943
|
+
const $ = oo(x), je = (s = (d = m == null ? void 0 : m.root) != null ? d : A.Root) != null ? s : pt, Qe = (L = (N = m == null ? void 0 : m.rail) != null ? N : A.Rail) != null ? L : mt, Ze = (f = (b = m == null ? void 0 : m.track) != null ? b : A.Track) != null ? f : ft, et = (q = (ue = m == null ? void 0 : m.thumb) != null ? ue : A.Thumb) != null ? q : bt, tt = (X = (te = m == null ? void 0 : m.valueLabel) != null ? te : A.ValueLabel) != null ? X : vt, Me = (ge = (de = m == null ? void 0 : m.mark) != null ? de : A.Mark) != null ? ge : ht, ze = (_ = (ye = m == null ? void 0 : m.markLabel) != null ? ye : A.MarkLabel) != null ? _ : gt, ot = (ke = (M = m == null ? void 0 : m.input) != null ? M : A.Input) != null ? ke : "input", Fe = (pe = v == null ? void 0 : v.root) != null ? pe : I.root, kt = (D = v == null ? void 0 : v.rail) != null ? D : I.rail, De = (xe = v == null ? void 0 : v.track) != null ? xe : I.track, He = (H = v == null ? void 0 : v.thumb) != null ? H : I.thumb, Ye = (me = v == null ? void 0 : v.valueLabel) != null ? me : I.valueLabel, xt = (fe = v == null ? void 0 : v.mark) != null ? fe : I.mark, Tt = (W = v == null ? void 0 : v.markLabel) != null ? W : I.markLabel, Lt = (V = v == null ? void 0 : v.input) != null ? V : I.input, St = B({
|
|
944
|
+
elementType: je,
|
|
945
|
+
getSlotProps: Ke,
|
|
946
|
+
externalSlotProps: Fe,
|
|
947
|
+
externalForwardedProps: Ie,
|
|
948
|
+
additionalProps: c({}, Jt(je) && {
|
|
949
|
+
as: Te
|
|
950
|
+
}),
|
|
951
|
+
ownerState: c({}, x, Fe == null ? void 0 : Fe.ownerState),
|
|
952
|
+
className: [$.root, re]
|
|
953
|
+
}), Pt = B({
|
|
954
|
+
elementType: Qe,
|
|
955
|
+
externalSlotProps: kt,
|
|
956
|
+
ownerState: x,
|
|
957
|
+
className: $.rail
|
|
958
|
+
}), Ot = B({
|
|
959
|
+
elementType: Ze,
|
|
960
|
+
externalSlotProps: De,
|
|
961
|
+
additionalProps: {
|
|
962
|
+
style: c({}, ie[i].offset(j), ie[i].leap(ve))
|
|
963
|
+
},
|
|
964
|
+
ownerState: c({}, x, De == null ? void 0 : De.ownerState),
|
|
965
|
+
className: $.track
|
|
966
|
+
}), Be = B({
|
|
967
|
+
elementType: et,
|
|
968
|
+
getSlotProps: r,
|
|
969
|
+
externalSlotProps: He,
|
|
970
|
+
ownerState: c({}, x, He == null ? void 0 : He.ownerState),
|
|
971
|
+
className: $.thumb
|
|
972
|
+
}), Ct = B({
|
|
973
|
+
elementType: tt,
|
|
974
|
+
externalSlotProps: Ye,
|
|
975
|
+
ownerState: c({}, x, Ye == null ? void 0 : Ye.ownerState),
|
|
976
|
+
className: $.valueLabel
|
|
977
|
+
}), Ue = B({
|
|
978
|
+
elementType: Me,
|
|
979
|
+
externalSlotProps: xt,
|
|
980
|
+
ownerState: x,
|
|
981
|
+
className: $.mark
|
|
982
|
+
}), qe = B({
|
|
983
|
+
elementType: ze,
|
|
984
|
+
externalSlotProps: Tt,
|
|
985
|
+
ownerState: x,
|
|
986
|
+
className: $.markLabel
|
|
987
|
+
}), $t = B({
|
|
988
|
+
elementType: ot,
|
|
989
|
+
getSlotProps: Je,
|
|
990
|
+
externalSlotProps: Lt,
|
|
991
|
+
ownerState: x
|
|
992
|
+
});
|
|
993
|
+
return /* @__PURE__ */ C.jsxs(je, c({}, St, {
|
|
994
|
+
children: [/* @__PURE__ */ C.jsx(Qe, c({}, Pt)), /* @__PURE__ */ C.jsx(Ze, c({}, Ot)), O.filter((h) => h.value >= K && h.value <= ae).map((h, k) => {
|
|
995
|
+
const Xe = Ve(h.value, K, ae), Oe = ie[i].offset(Xe);
|
|
996
|
+
let F;
|
|
997
|
+
return se === !1 ? F = u.indexOf(h.value) !== -1 : F = se === "normal" && (P ? h.value >= u[0] && h.value <= u[u.length - 1] : h.value <= u[0]) || se === "inverted" && (P ? h.value <= u[0] || h.value >= u[u.length - 1] : h.value >= u[0]), /* @__PURE__ */ C.jsxs(T.Fragment, {
|
|
998
|
+
children: [/* @__PURE__ */ C.jsx(Me, c({
|
|
999
|
+
"data-index": k
|
|
1000
|
+
}, Ue, !Ee(Me) && {
|
|
1001
|
+
markActive: F
|
|
1002
|
+
}, {
|
|
1003
|
+
style: c({}, Oe, Ue.style),
|
|
1004
|
+
className: ce(Ue.className, F && $.markActive)
|
|
1005
|
+
})), h.label != null ? /* @__PURE__ */ C.jsx(ze, c({
|
|
1006
|
+
"aria-hidden": !0,
|
|
1007
|
+
"data-index": k
|
|
1008
|
+
}, qe, !Ee(ze) && {
|
|
1009
|
+
markLabelActive: F
|
|
1010
|
+
}, {
|
|
1011
|
+
style: c({}, Oe, qe.style),
|
|
1012
|
+
className: ce($.markLabel, qe.className, F && $.markLabelActive),
|
|
1013
|
+
children: h.label
|
|
1014
|
+
})) : null]
|
|
1015
|
+
}, k);
|
|
1016
|
+
}), u.map((h, k) => {
|
|
1017
|
+
const Xe = Ve(h, K, ae), Oe = ie[i].offset(Xe), F = Q === "off" ? ro : tt;
|
|
1018
|
+
return (
|
|
1019
|
+
/* TODO v6: Change component structure. It will help in avoiding the complicated React.cloneElement API added in SliderValueLabel component. Should be: Thumb -> Input, ValueLabel. Follow Joy UI's Slider structure. */
|
|
1020
|
+
/* @__PURE__ */ C.jsx(F, c({}, !Ee(F) && {
|
|
1021
|
+
valueLabelFormat: Z,
|
|
1022
|
+
valueLabelDisplay: Q,
|
|
1023
|
+
value: typeof Z == "function" ? Z(R(h), k) : Z,
|
|
1024
|
+
index: k,
|
|
1025
|
+
open: n === k || l === k || Q === "on",
|
|
1026
|
+
disabled: Se
|
|
1027
|
+
}, Ct, {
|
|
1028
|
+
children: /* @__PURE__ */ C.jsx(et, c({
|
|
1029
|
+
"data-index": k
|
|
1030
|
+
}, Be, {
|
|
1031
|
+
className: ce($.thumb, Be.className, l === k && $.active, y === k && $.focusVisible),
|
|
1032
|
+
style: c({}, Oe, {
|
|
1033
|
+
pointerEvents: S && l !== k ? "none" : void 0
|
|
1034
|
+
}, Be.style),
|
|
1035
|
+
children: /* @__PURE__ */ C.jsx(ot, c({
|
|
1036
|
+
"data-index": k,
|
|
1037
|
+
"aria-label": be ? be(k) : g,
|
|
1038
|
+
"aria-valuenow": R(h),
|
|
1039
|
+
"aria-labelledby": w,
|
|
1040
|
+
"aria-valuetext": Pe ? Pe(R(h), k) : oe,
|
|
1041
|
+
value: u[k]
|
|
1042
|
+
}, $t))
|
|
1043
|
+
}))
|
|
1044
|
+
}), k)
|
|
1045
|
+
);
|
|
1046
|
+
})]
|
|
1047
|
+
}));
|
|
1048
|
+
});
|
|
1049
|
+
process.env.NODE_ENV !== "production" && (yt.propTypes = {
|
|
1050
|
+
// ----------------------------- Warning --------------------------------
|
|
1051
|
+
// | These PropTypes are generated from the TypeScript type definitions |
|
|
1052
|
+
// | To update them edit the d.ts file and run "yarn proptypes" |
|
|
1053
|
+
// ----------------------------------------------------------------------
|
|
1054
|
+
/**
|
|
1055
|
+
* The label of the slider.
|
|
1056
|
+
*/
|
|
1057
|
+
"aria-label": nt(t.string, (e) => Array.isArray(e.value || e.defaultValue) && e["aria-label"] != null ? new Error("MUI: You need to use the `getAriaLabel` prop instead of `aria-label` when using a range slider.") : null),
|
|
1058
|
+
/**
|
|
1059
|
+
* The id of the element containing a label for the slider.
|
|
1060
|
+
*/
|
|
1061
|
+
"aria-labelledby": t.string,
|
|
1062
|
+
/**
|
|
1063
|
+
* A string value that provides a user-friendly name for the current value of the slider.
|
|
1064
|
+
*/
|
|
1065
|
+
"aria-valuetext": nt(t.string, (e) => Array.isArray(e.value || e.defaultValue) && e["aria-valuetext"] != null ? new Error("MUI: You need to use the `getAriaValueText` prop instead of `aria-valuetext` when using a range slider.") : null),
|
|
1066
|
+
/**
|
|
1067
|
+
* @ignore
|
|
1068
|
+
*/
|
|
1069
|
+
children: t.node,
|
|
1070
|
+
/**
|
|
1071
|
+
* Override or extend the styles applied to the component.
|
|
1072
|
+
*/
|
|
1073
|
+
classes: t.object,
|
|
1074
|
+
/**
|
|
1075
|
+
* @ignore
|
|
1076
|
+
*/
|
|
1077
|
+
className: t.string,
|
|
1078
|
+
/**
|
|
1079
|
+
* The color of the component.
|
|
1080
|
+
* It supports both default and custom theme colors, which can be added as shown in the
|
|
1081
|
+
* [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).
|
|
1082
|
+
* @default 'primary'
|
|
1083
|
+
*/
|
|
1084
|
+
color: t.oneOfType([t.oneOf(["primary", "secondary"]), t.string]),
|
|
1085
|
+
/**
|
|
1086
|
+
* The components used for each slot inside.
|
|
1087
|
+
*
|
|
1088
|
+
* This prop is an alias for the `slots` prop.
|
|
1089
|
+
* It's recommended to use the `slots` prop instead.
|
|
1090
|
+
*
|
|
1091
|
+
* @default {}
|
|
1092
|
+
*/
|
|
1093
|
+
components: t.shape({
|
|
1094
|
+
Input: t.elementType,
|
|
1095
|
+
Mark: t.elementType,
|
|
1096
|
+
MarkLabel: t.elementType,
|
|
1097
|
+
Rail: t.elementType,
|
|
1098
|
+
Root: t.elementType,
|
|
1099
|
+
Thumb: t.elementType,
|
|
1100
|
+
Track: t.elementType,
|
|
1101
|
+
ValueLabel: t.elementType
|
|
1102
|
+
}),
|
|
1103
|
+
/**
|
|
1104
|
+
* The extra props for the slot components.
|
|
1105
|
+
* You can override the existing props or add new ones.
|
|
1106
|
+
*
|
|
1107
|
+
* This prop is an alias for the `slotProps` prop.
|
|
1108
|
+
* It's recommended to use the `slotProps` prop instead, as `componentsProps` will be deprecated in the future.
|
|
1109
|
+
*
|
|
1110
|
+
* @default {}
|
|
1111
|
+
*/
|
|
1112
|
+
componentsProps: t.shape({
|
|
1113
|
+
input: t.oneOfType([t.func, t.object]),
|
|
1114
|
+
mark: t.oneOfType([t.func, t.object]),
|
|
1115
|
+
markLabel: t.oneOfType([t.func, t.object]),
|
|
1116
|
+
rail: t.oneOfType([t.func, t.object]),
|
|
1117
|
+
root: t.oneOfType([t.func, t.object]),
|
|
1118
|
+
thumb: t.oneOfType([t.func, t.object]),
|
|
1119
|
+
track: t.oneOfType([t.func, t.object]),
|
|
1120
|
+
valueLabel: t.oneOfType([t.func, t.shape({
|
|
1121
|
+
children: t.element,
|
|
1122
|
+
className: t.string,
|
|
1123
|
+
open: t.bool,
|
|
1124
|
+
style: t.object,
|
|
1125
|
+
value: t.number,
|
|
1126
|
+
valueLabelDisplay: t.oneOf(["auto", "off", "on"])
|
|
1127
|
+
})])
|
|
1128
|
+
}),
|
|
1129
|
+
/**
|
|
1130
|
+
* The default value. Use when the component is not controlled.
|
|
1131
|
+
*/
|
|
1132
|
+
defaultValue: t.oneOfType([t.arrayOf(t.number), t.number]),
|
|
1133
|
+
/**
|
|
1134
|
+
* If `true`, the component is disabled.
|
|
1135
|
+
* @default false
|
|
1136
|
+
*/
|
|
1137
|
+
disabled: t.bool,
|
|
1138
|
+
/**
|
|
1139
|
+
* If `true`, the active thumb doesn't swap when moving pointer over a thumb while dragging another thumb.
|
|
1140
|
+
* @default false
|
|
1141
|
+
*/
|
|
1142
|
+
disableSwap: t.bool,
|
|
1143
|
+
/**
|
|
1144
|
+
* Accepts a function which returns a string value that provides a user-friendly name for the thumb labels of the slider.
|
|
1145
|
+
* This is important for screen reader users.
|
|
1146
|
+
* @param {number} index The thumb label's index to format.
|
|
1147
|
+
* @returns {string}
|
|
1148
|
+
*/
|
|
1149
|
+
getAriaLabel: t.func,
|
|
1150
|
+
/**
|
|
1151
|
+
* Accepts a function which returns a string value that provides a user-friendly name for the current value of the slider.
|
|
1152
|
+
* This is important for screen reader users.
|
|
1153
|
+
* @param {number} value The thumb label's value to format.
|
|
1154
|
+
* @param {number} index The thumb label's index to format.
|
|
1155
|
+
* @returns {string}
|
|
1156
|
+
*/
|
|
1157
|
+
getAriaValueText: t.func,
|
|
1158
|
+
/**
|
|
1159
|
+
* Marks indicate predetermined values to which the user can move the slider.
|
|
1160
|
+
* If `true` the marks are spaced according the value of the `step` prop.
|
|
1161
|
+
* If an array, it should contain objects with `value` and an optional `label` keys.
|
|
1162
|
+
* @default false
|
|
1163
|
+
*/
|
|
1164
|
+
marks: t.oneOfType([t.arrayOf(t.shape({
|
|
1165
|
+
label: t.node,
|
|
1166
|
+
value: t.number.isRequired
|
|
1167
|
+
})), t.bool]),
|
|
1168
|
+
/**
|
|
1169
|
+
* The maximum allowed value of the slider.
|
|
1170
|
+
* Should not be equal to min.
|
|
1171
|
+
* @default 100
|
|
1172
|
+
*/
|
|
1173
|
+
max: t.number,
|
|
1174
|
+
/**
|
|
1175
|
+
* The minimum allowed value of the slider.
|
|
1176
|
+
* Should not be equal to max.
|
|
1177
|
+
* @default 0
|
|
1178
|
+
*/
|
|
1179
|
+
min: t.number,
|
|
1180
|
+
/**
|
|
1181
|
+
* Name attribute of the hidden `input` element.
|
|
1182
|
+
*/
|
|
1183
|
+
name: t.string,
|
|
1184
|
+
/**
|
|
1185
|
+
* Callback function that is fired when the slider's value changed.
|
|
1186
|
+
*
|
|
1187
|
+
* @param {Event} event The event source of the callback.
|
|
1188
|
+
* You can pull out the new value by accessing `event.target.value` (any).
|
|
1189
|
+
* **Warning**: This is a generic event not a change event.
|
|
1190
|
+
* @param {number | number[]} value The new value.
|
|
1191
|
+
* @param {number} activeThumb Index of the currently moved thumb.
|
|
1192
|
+
*/
|
|
1193
|
+
onChange: t.func,
|
|
1194
|
+
/**
|
|
1195
|
+
* Callback function that is fired when the `mouseup` is triggered.
|
|
1196
|
+
*
|
|
1197
|
+
* @param {React.SyntheticEvent | Event} event The event source of the callback. **Warning**: This is a generic event not a change event.
|
|
1198
|
+
* @param {number | number[]} value The new value.
|
|
1199
|
+
*/
|
|
1200
|
+
onChangeCommitted: t.func,
|
|
1201
|
+
/**
|
|
1202
|
+
* The component orientation.
|
|
1203
|
+
* @default 'horizontal'
|
|
1204
|
+
*/
|
|
1205
|
+
orientation: t.oneOf(["horizontal", "vertical"]),
|
|
1206
|
+
/**
|
|
1207
|
+
* A transformation function, to change the scale of the slider.
|
|
1208
|
+
* @param {any} x
|
|
1209
|
+
* @returns {any}
|
|
1210
|
+
* @default function Identity(x) {
|
|
1211
|
+
* return x;
|
|
1212
|
+
* }
|
|
1213
|
+
*/
|
|
1214
|
+
scale: t.func,
|
|
1215
|
+
/**
|
|
1216
|
+
* The size of the slider.
|
|
1217
|
+
* @default 'medium'
|
|
1218
|
+
*/
|
|
1219
|
+
size: t.oneOfType([t.oneOf(["small", "medium"]), t.string]),
|
|
1220
|
+
/**
|
|
1221
|
+
* The props used for each slot inside the Slider.
|
|
1222
|
+
* @default {}
|
|
1223
|
+
*/
|
|
1224
|
+
slotProps: t.shape({
|
|
1225
|
+
input: t.oneOfType([t.func, t.object]),
|
|
1226
|
+
mark: t.oneOfType([t.func, t.object]),
|
|
1227
|
+
markLabel: t.oneOfType([t.func, t.object]),
|
|
1228
|
+
rail: t.oneOfType([t.func, t.object]),
|
|
1229
|
+
root: t.oneOfType([t.func, t.object]),
|
|
1230
|
+
thumb: t.oneOfType([t.func, t.object]),
|
|
1231
|
+
track: t.oneOfType([t.func, t.object]),
|
|
1232
|
+
valueLabel: t.oneOfType([t.func, t.shape({
|
|
1233
|
+
children: t.element,
|
|
1234
|
+
className: t.string,
|
|
1235
|
+
open: t.bool,
|
|
1236
|
+
style: t.object,
|
|
1237
|
+
value: t.number,
|
|
1238
|
+
valueLabelDisplay: t.oneOf(["auto", "off", "on"])
|
|
1239
|
+
})])
|
|
1240
|
+
}),
|
|
1241
|
+
/**
|
|
1242
|
+
* The components used for each slot inside the Slider.
|
|
1243
|
+
* Either a string to use a HTML element or a component.
|
|
1244
|
+
* @default {}
|
|
1245
|
+
*/
|
|
1246
|
+
slots: t.shape({
|
|
1247
|
+
input: t.elementType,
|
|
1248
|
+
mark: t.elementType,
|
|
1249
|
+
markLabel: t.elementType,
|
|
1250
|
+
rail: t.elementType,
|
|
1251
|
+
root: t.elementType,
|
|
1252
|
+
thumb: t.elementType,
|
|
1253
|
+
track: t.elementType,
|
|
1254
|
+
valueLabel: t.elementType
|
|
1255
|
+
}),
|
|
1256
|
+
/**
|
|
1257
|
+
* The granularity with which the slider can step through values. (A "discrete" slider.)
|
|
1258
|
+
* The `min` prop serves as the origin for the valid values.
|
|
1259
|
+
* We recommend (max - min) to be evenly divisible by the step.
|
|
1260
|
+
*
|
|
1261
|
+
* When step is `null`, the thumb can only be slid onto marks provided with the `marks` prop.
|
|
1262
|
+
* @default 1
|
|
1263
|
+
*/
|
|
1264
|
+
step: t.number,
|
|
1265
|
+
/**
|
|
1266
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1267
|
+
*/
|
|
1268
|
+
sx: t.oneOfType([t.arrayOf(t.oneOfType([t.func, t.object, t.bool])), t.func, t.object]),
|
|
1269
|
+
/**
|
|
1270
|
+
* Tab index attribute of the hidden `input` element.
|
|
1271
|
+
*/
|
|
1272
|
+
tabIndex: t.number,
|
|
1273
|
+
/**
|
|
1274
|
+
* The track presentation:
|
|
1275
|
+
*
|
|
1276
|
+
* - `normal` the track will render a bar representing the slider value.
|
|
1277
|
+
* - `inverted` the track will render a bar representing the remaining slider value.
|
|
1278
|
+
* - `false` the track will render without a bar.
|
|
1279
|
+
* @default 'normal'
|
|
1280
|
+
*/
|
|
1281
|
+
track: t.oneOf(["inverted", "normal", !1]),
|
|
1282
|
+
/**
|
|
1283
|
+
* The value of the slider.
|
|
1284
|
+
* For ranged sliders, provide an array with two values.
|
|
1285
|
+
*/
|
|
1286
|
+
value: t.oneOfType([t.arrayOf(t.number), t.number]),
|
|
1287
|
+
/**
|
|
1288
|
+
* Controls when the value label is displayed:
|
|
1289
|
+
*
|
|
1290
|
+
* - `auto` the value label will display when the thumb is hovered or focused.
|
|
1291
|
+
* - `on` will display persistently.
|
|
1292
|
+
* - `off` will never display.
|
|
1293
|
+
* @default 'off'
|
|
1294
|
+
*/
|
|
1295
|
+
valueLabelDisplay: t.oneOf(["auto", "off", "on"]),
|
|
1296
|
+
/**
|
|
1297
|
+
* The format function the value label's value.
|
|
1298
|
+
*
|
|
1299
|
+
* When a function is provided, it should have the following signature:
|
|
1300
|
+
*
|
|
1301
|
+
* - {number} value The value label's value to format
|
|
1302
|
+
* - {number} index The value label's index to format
|
|
1303
|
+
* @param {any} x
|
|
1304
|
+
* @returns {any}
|
|
1305
|
+
* @default function Identity(x) {
|
|
1306
|
+
* return x;
|
|
1307
|
+
* }
|
|
1308
|
+
*/
|
|
1309
|
+
valueLabelFormat: t.oneOfType([t.func, t.string])
|
|
1310
|
+
});
|
|
1311
|
+
const ao = yt;
|
|
1312
|
+
const xo = ({ ...e }) => /* @__PURE__ */ C.jsx(
|
|
1313
|
+
ao,
|
|
1314
|
+
{
|
|
1315
|
+
className: "kdpa-slider",
|
|
1316
|
+
"aria-labelledby": "discrete-slider",
|
|
1317
|
+
...e
|
|
1318
|
+
}
|
|
1319
|
+
);
|
|
1320
|
+
export {
|
|
1321
|
+
xo as KdpaSlider
|
|
1322
|
+
};
|