@splunk/react-ui 5.4.0 → 5.6.0
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/AnchorMenu.d.ts +2 -0
- package/AnchorMenu.js +286 -0
- package/Badge.d.ts +2 -0
- package/Badge.js +154 -0
- package/CHANGELOG.md +42 -0
- package/Code.js +1097 -500
- package/Color.js +142 -141
- package/ComboBox.js +6 -5
- package/Link.js +74 -44
- package/MIGRATION.md +32 -1
- package/Menu.js +41 -43
- package/Multiselect.js +615 -2156
- package/Number.js +3 -3
- package/PhoneNumber.d.ts +2 -0
- package/PhoneNumber.js +769 -0
- package/Popover.js +73 -75
- package/RadioList.js +166 -151
- package/ResultsMenu.js +27 -29
- package/Select.js +179 -1768
- package/SelectBase.d.ts +2 -0
- package/SelectBase.js +1714 -0
- package/Slider.js +358 -302
- package/SlidingPanels.js +55 -62
- package/Switch.js +42 -27
- package/TabBar.js +295 -294
- package/TabLayout.js +14 -14
- package/Table.js +1087 -1040
- package/TransitionOpen.js +65 -58
- package/cypress/support/commands.ts +40 -0
- package/cypress/support/component.ts +1 -1
- package/cypress/support/index.d.ts +22 -0
- package/docker-compose.yml +99 -52
- package/package.json +9 -5
- package/stubs-splunkui.d.ts +0 -86
- package/test-runner-jest.config.js +1 -0
- package/types/src/AnchorMenu/AnchorMenu.d.ts +36 -0
- package/types/src/AnchorMenu/AnchorMenuContext.d.ts +6 -0
- package/types/src/AnchorMenu/Item.d.ts +35 -0
- package/types/src/AnchorMenu/docs/examples/Basic.d.ts +6 -0
- package/types/src/AnchorMenu/index.d.ts +3 -0
- package/types/src/Badge/Badge.d.ts +29 -0
- package/types/src/Badge/docs/examples/Basic.d.ts +5 -0
- package/types/src/Badge/docs/examples/Count.d.ts +6 -0
- package/types/src/Badge/docs/examples/CustomColors.d.ts +8 -0
- package/types/src/Badge/docs/examples/Icon.d.ts +6 -0
- package/types/src/Badge/index.d.ts +2 -0
- package/types/src/Code/Code.d.ts +4 -3
- package/types/src/Code/index.d.ts +1 -0
- package/types/src/Link/Link.d.ts +4 -0
- package/types/src/Link/LinkContext.d.ts +14 -0
- package/types/src/Link/docs/examples/Visited.d.ts +7 -0
- package/types/src/Link/index.d.ts +1 -0
- package/types/src/Menu/Item.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +8 -1
- package/types/src/Multiselect/Multiselect.d.ts +8 -1
- package/types/src/PhoneNumber/PhoneNumber.d.ts +139 -0
- package/types/src/PhoneNumber/docs/examples/Controlled.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/DefaultCountry.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/Disabled.d.ts +6 -0
- package/types/src/PhoneNumber/docs/examples/Error.d.ts +6 -0
- package/types/src/PhoneNumber/docs/examples/Inline.d.ts +7 -0
- package/types/src/PhoneNumber/docs/examples/Uncontrolled.d.ts +7 -0
- package/types/src/PhoneNumber/index.d.ts +2 -0
- package/types/src/PhoneNumber/utils.d.ts +47 -0
- package/types/src/RadioList/Option.d.ts +6 -1
- package/types/src/RadioList/docs/examples/Description.d.ts +6 -0
- package/types/src/Select/Option.d.ts +8 -3
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/{Select → SelectBase}/OptionBase.d.ts +8 -2
- package/types/src/{Select → SelectBase}/SelectBase.d.ts +11 -2
- package/types/src/SelectBase/index.d.ts +2 -0
- package/types/src/Slider/Slider.d.ts +7 -1
- package/types/src/Switch/Switch.d.ts +4 -1
- package/types/src/Table/Body.d.ts +6 -1
- package/types/src/Table/Cell.d.ts +5 -1
- package/types/src/Table/Head.d.ts +6 -2
- package/types/src/Table/HeadCell.d.ts +5 -1
- package/types/src/Table/Row.d.ts +5 -1
- package/types/src/Table/Table.d.ts +20 -1
- package/types/src/Table/TableContext.d.ts +1 -0
- package/types/src/Table/docs/examples/HorizontalOverflowScroll.d.ts +8 -0
- package/types/src/Table/docs/examples/PinActionColumn.d.ts +7 -0
- package/types/src/TransitionOpen/TransitionOpen.d.ts +3 -1
- package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -0
- package/types/src/useRovingFocus/useRovingFocus.d.ts +8 -1
- package/usePrevious.d.ts +2 -0
- package/useResizeObserver.js +59 -92
- package/useRovingFocus.js +96 -41
- /package/types/src/{Select → SelectBase}/SelectAllOption.d.ts +0 -0
package/Slider.js
CHANGED
|
@@ -8,27 +8,27 @@
|
|
|
8
8
|
/******/ /* webpack/runtime/compat get default export */
|
|
9
9
|
/******/ (() => {
|
|
10
10
|
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
11
|
-
/******/ e.n =
|
|
12
|
-
/******/ var
|
|
13
|
-
/******/ () =>
|
|
14
|
-
/******/ : () =>
|
|
11
|
+
/******/ e.n = t => {
|
|
12
|
+
/******/ var r = t && t.__esModule ?
|
|
13
|
+
/******/ () => t["default"]
|
|
14
|
+
/******/ : () => t
|
|
15
15
|
/******/;
|
|
16
|
-
e.d(
|
|
17
|
-
a:
|
|
16
|
+
e.d(r, {
|
|
17
|
+
a: r
|
|
18
18
|
});
|
|
19
|
-
/******/ return
|
|
19
|
+
/******/ return r;
|
|
20
20
|
/******/ };
|
|
21
21
|
/******/ })();
|
|
22
22
|
/******/
|
|
23
23
|
/******/ /* webpack/runtime/define property getters */
|
|
24
24
|
/******/ (() => {
|
|
25
25
|
/******/ // define getter functions for harmony exports
|
|
26
|
-
/******/ e.d = (
|
|
27
|
-
/******/ for (var n in
|
|
28
|
-
/******/ if (e.o(
|
|
29
|
-
/******/ Object.defineProperty(
|
|
26
|
+
/******/ e.d = (t, r) => {
|
|
27
|
+
/******/ for (var n in r) {
|
|
28
|
+
/******/ if (e.o(r, n) && !e.o(t, n)) {
|
|
29
|
+
/******/ Object.defineProperty(t, n, {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get:
|
|
31
|
+
get: r[n]
|
|
32
32
|
});
|
|
33
33
|
/******/ }
|
|
34
34
|
/******/ }
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
/******/
|
|
38
38
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
39
39
|
/******/ (() => {
|
|
40
|
-
/******/ e.o = (e,
|
|
40
|
+
/******/ e.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t)
|
|
41
41
|
/******/;
|
|
42
42
|
})();
|
|
43
43
|
/******/
|
|
@@ -56,16 +56,16 @@
|
|
|
56
56
|
/******/ };
|
|
57
57
|
/******/ })();
|
|
58
58
|
/******/
|
|
59
|
-
/************************************************************************/ var
|
|
59
|
+
/************************************************************************/ var t = {};
|
|
60
60
|
// ESM COMPAT FLAG
|
|
61
|
-
e.r(
|
|
61
|
+
e.r(t);
|
|
62
62
|
// EXPORTS
|
|
63
|
-
e.d(
|
|
64
|
-
default: () => /* reexport */
|
|
63
|
+
e.d(t, {
|
|
64
|
+
default: () => /* reexport */ re
|
|
65
65
|
});
|
|
66
66
|
// CONCATENATED MODULE: external "react"
|
|
67
|
-
const
|
|
68
|
-
var n = e.n(
|
|
67
|
+
const r = require("react");
|
|
68
|
+
var n = e.n(r);
|
|
69
69
|
// CONCATENATED MODULE: external "decimal.js-light"
|
|
70
70
|
const a = require("decimal.js-light");
|
|
71
71
|
var i = e.n(a);
|
|
@@ -82,10 +82,10 @@
|
|
|
82
82
|
const f = require("@splunk/react-ui/useControlled");
|
|
83
83
|
var v = e.n(f);
|
|
84
84
|
// CONCATENATED MODULE: external "styled-components"
|
|
85
|
-
const
|
|
86
|
-
var
|
|
85
|
+
const p = require("styled-components");
|
|
86
|
+
var m = e.n(p);
|
|
87
87
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
88
|
-
const
|
|
88
|
+
const b = require("@splunk/themes");
|
|
89
89
|
// CONCATENATED MODULE: ./src/Slider/getStepMarksBackground.ts
|
|
90
90
|
/* this file is being ignored by stylelint via .stylelintignore */
|
|
91
91
|
/* the radial-gradient returned in the map below needs `css` before backticks
|
|
@@ -93,119 +93,160 @@
|
|
|
93
93
|
* a stylelint `Unknown word CssSyntaxError` */
|
|
94
94
|
/* getStepMarksBackground generates the multiple radial gradient backgrounds for step marks */
|
|
95
95
|
function h(e) {
|
|
96
|
-
var
|
|
97
|
-
/* need to subtract 1 to avoid extra step at the end */ var o = Math.floor(100 /
|
|
96
|
+
var t = e.stepWidth, r = e.thumbPosition, n = r === void 0 ? 0 : r, a = e.beforeThumbStepColor, i = e.afterThumbStepColor;
|
|
97
|
+
/* need to subtract 1 to avoid extra step at the end */ var o = Math.floor(100 / t) - 1;
|
|
98
98
|
var l = new Array(o).fill(false);
|
|
99
|
-
return (0,
|
|
100
|
-
var o = (
|
|
99
|
+
return (0, p.css)([ "background:", ";" ], l.map((function(e, r) {
|
|
100
|
+
var o = (r + 1) * t;
|
|
101
101
|
var u = o <= n ? a : i;
|
|
102
|
-
/* css doesn't allow trailing comma */ var s =
|
|
103
|
-
return (0,
|
|
102
|
+
/* css doesn't allow trailing comma */ var s = r < l.length - 1 ? "," : "";
|
|
103
|
+
return (0, p.css)([ "radial-gradient(circle,", " 0%,", " 3px,transparent 3px) calc(", "% - 1.5px) center no-repeat ", "" ], u, u, o, s);
|
|
104
104
|
})));
|
|
105
105
|
}
|
|
106
106
|
/* harmony default export */ const y = h;
|
|
107
107
|
// CONCATENATED MODULE: ./src/Slider/SliderStyles.ts
|
|
108
108
|
var g = 8;
|
|
109
109
|
var w = 1;
|
|
110
|
-
var
|
|
111
|
-
var
|
|
110
|
+
var C = 24;
|
|
111
|
+
var S = m().div.withConfig({
|
|
112
112
|
displayName: "SliderStyles__StyledSliderWrapper",
|
|
113
113
|
componentId: "sc-16ooit4-0"
|
|
114
|
-
})([ "", ";gap:", ";width:100%;", "" ],
|
|
115
|
-
var
|
|
116
|
-
return
|
|
114
|
+
})([ "", ";gap:", ";width:100%;", "" ], b.mixins.reset("flex"), b.variables.spacingLarge, (function(e) {
|
|
115
|
+
var t = e.$inline;
|
|
116
|
+
return t && (0, p.css)([ "width:300px;" ]);
|
|
117
117
|
}));
|
|
118
|
-
|
|
118
|
+
// Use .attrs() to set CSS variable via style attribute to avoid styled-components class regeneration.
|
|
119
|
+
// The ::before pseudo-element reads this variable, which is the only way to style pseudo-elements dynamically
|
|
120
|
+
// without regenerating CSS classes on every position change.
|
|
121
|
+
var x = m().div.attrs((function(e) {
|
|
122
|
+
var t = e.$thumbPosition;
|
|
123
|
+
return {
|
|
124
|
+
style: t !== undefined ? {
|
|
125
|
+
"--slider-fill-width": "".concat(t, "%")
|
|
126
|
+
} : undefined
|
|
127
|
+
};
|
|
128
|
+
})).withConfig({
|
|
119
129
|
displayName: "SliderStyles__StyledSliderBar",
|
|
120
130
|
componentId: "sc-16ooit4-1"
|
|
121
131
|
})([ "position:relative;left:0;height:", "px;width:100%;border-radius:10px;background-color:", ";border:", "px solid;border-color:", ";", " ", "" ], g, (0,
|
|
122
|
-
|
|
123
|
-
default:
|
|
124
|
-
error:
|
|
125
|
-
disabled:
|
|
126
|
-
}), w, (0,
|
|
127
|
-
default:
|
|
128
|
-
error:
|
|
132
|
+
b.pickVariant)("$state", {
|
|
133
|
+
default: b.variables.neutral300,
|
|
134
|
+
error: b.variables.neutral300,
|
|
135
|
+
disabled: b.variables.neutral200
|
|
136
|
+
}), w, (0, b.pickVariant)("$state", {
|
|
137
|
+
default: b.variables.interactiveColorBorder,
|
|
138
|
+
error: b.variables.interactiveColorBorder,
|
|
129
139
|
disabled: "transparent"
|
|
130
140
|
}), (function(e) {
|
|
131
|
-
var
|
|
132
|
-
return (
|
|
133
|
-
|
|
134
|
-
default:
|
|
135
|
-
error:
|
|
136
|
-
disabled:
|
|
141
|
+
var t = e.$thumbPosition;
|
|
142
|
+
return (t || t === 0) && (0, p.css)([ "&::before{position:absolute;border-radius:", ";content:'';height:calc( ", "px + ", "px );top:-", "px;left:-", "px;width:var(--slider-fill-width,0%);background-color:", ";}" ], b.variables.borderRadius, g, w * 2, w, w, (0,
|
|
143
|
+
b.pickVariant)("$state", {
|
|
144
|
+
default: b.variables.interactiveColorAccent,
|
|
145
|
+
error: b.variables.interactiveColorAccentError,
|
|
146
|
+
disabled: b.variables.neutral300
|
|
137
147
|
}));
|
|
138
148
|
}), (function(e) {
|
|
139
|
-
var
|
|
140
|
-
return
|
|
141
|
-
beforeThumbStepColor: (0,
|
|
142
|
-
default:
|
|
143
|
-
error:
|
|
144
|
-
disabled:
|
|
149
|
+
var t = e.$stepWidth, r = e.$thumbPosition;
|
|
150
|
+
return t && (0, p.css)([ "&::after{position:absolute;top:0;left:0;width:100%;height:100%;", ";background-size:8px 8px;}" ], y({
|
|
151
|
+
beforeThumbStepColor: (0, b.pickVariant)("$state", {
|
|
152
|
+
default: b.variables.contentColorAccentWeak,
|
|
153
|
+
error: b.variables.contentColorNegativeWeak,
|
|
154
|
+
disabled: b.variables.contentColorDisabled
|
|
145
155
|
}),
|
|
146
|
-
afterThumbStepColor: (0,
|
|
147
|
-
default:
|
|
148
|
-
error:
|
|
149
|
-
disabled:
|
|
156
|
+
afterThumbStepColor: (0, b.pickVariant)("$state", {
|
|
157
|
+
default: b.variables.contentColorDefault,
|
|
158
|
+
error: b.variables.contentColorDefault,
|
|
159
|
+
disabled: b.variables.contentColorDisabled
|
|
150
160
|
}),
|
|
151
|
-
stepWidth:
|
|
152
|
-
thumbPosition:
|
|
161
|
+
stepWidth: t,
|
|
162
|
+
thumbPosition: r
|
|
153
163
|
}));
|
|
154
164
|
}));
|
|
155
|
-
|
|
165
|
+
// Use .attrs() to compute positioning styles and set them via style attribute.
|
|
166
|
+
// This avoids styled-components class regeneration during drag operations, significantly
|
|
167
|
+
// improving performance when the thumb moves continuously.
|
|
168
|
+
var k = m().button.attrs((function(e) {
|
|
169
|
+
var t = e.$thumbPosition, r = e.$stepWidth;
|
|
170
|
+
if (t === undefined) {
|
|
171
|
+
return {
|
|
172
|
+
style: undefined
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
if (r) {
|
|
176
|
+
// With step marks
|
|
177
|
+
var n = -C / 2;
|
|
178
|
+
/* used to align thumb center with position */ if (t === 0) {
|
|
179
|
+
/* used to align thumb at start of bar (without going out of bar bounds) */
|
|
180
|
+
n = 0;
|
|
181
|
+
} else if (t === 100) {
|
|
182
|
+
/* used to align thumb at end of bar (without going out of bar bounds) */
|
|
183
|
+
n = -C;
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
style: {
|
|
187
|
+
left: "".concat(t, "%"),
|
|
188
|
+
marginLeft: "".concat(n, "px")
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/* Smoothly position thumb center at the min/max step position while keeping it
|
|
193
|
+
within bounds. This calculation doesn't match exactly with step marks so it is
|
|
194
|
+
only used when stepMarks are too small to be rendered. */ return {
|
|
195
|
+
style: {
|
|
196
|
+
left: "calc(".concat(t, "% - ").concat(t / 100 * C, "px)")
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
})).withConfig({
|
|
156
200
|
displayName: "SliderStyles__StyledSliderThumb",
|
|
157
201
|
componentId: "sc-16ooit4-2"
|
|
158
|
-
})([ "display:block;position:absolute;cursor:pointer;width:", "px;height:", "px;border-radius:50%;background-color:", ";border:2px solid ", ";
|
|
159
|
-
|
|
160
|
-
default:
|
|
161
|
-
error:
|
|
162
|
-
disabled:
|
|
163
|
-
}), (0,
|
|
164
|
-
default:
|
|
165
|
-
error:
|
|
166
|
-
disabled:
|
|
202
|
+
})([ "display:block;position:absolute;cursor:pointer;width:", "px;height:", "px;border-radius:50%;background-color:", ";border:2px solid ", ";", " ", "" ], C, C, (0,
|
|
203
|
+
b.pickVariant)("$state", {
|
|
204
|
+
default: b.variables.white,
|
|
205
|
+
error: b.variables.interactiveColorAccentError,
|
|
206
|
+
disabled: b.variables.neutral300
|
|
207
|
+
}), (0, b.pickVariant)("$state", {
|
|
208
|
+
default: b.variables.borderColorStrong,
|
|
209
|
+
error: b.variables.interactiveColorAccentErrorStrong,
|
|
210
|
+
disabled: b.variables.neutral300
|
|
167
211
|
}), (function(e) {
|
|
168
|
-
var
|
|
169
|
-
return
|
|
170
|
-
}), S / 2, (function(e) {
|
|
171
|
-
var r = e.$state;
|
|
172
|
-
return r !== "disabled" && (0, m.css)([ "&:hover,&:focus,&:active{box-shadow:", ";}" ], p.variables.focusShadow);
|
|
212
|
+
var t = e.$state;
|
|
213
|
+
return t !== "disabled" && (0, p.css)([ "&:hover,&:focus,&:active{box-shadow:", ";}" ], b.variables.focusShadow);
|
|
173
214
|
}), (function(e) {
|
|
174
|
-
var
|
|
175
|
-
return
|
|
215
|
+
var t = e.$state;
|
|
216
|
+
return t === "disabled" && (0, p.css)([ "cursor:not-allowed;" ]);
|
|
176
217
|
}));
|
|
177
|
-
var E =
|
|
218
|
+
var E = m().div.withConfig({
|
|
178
219
|
displayName: "SliderStyles__StyledPopoverContent",
|
|
179
220
|
componentId: "sc-16ooit4-3"
|
|
180
|
-
})([ "padding:", ";" ],
|
|
181
|
-
var $ =
|
|
221
|
+
})([ "padding:", ";" ], b.variables.spacingMedium);
|
|
222
|
+
var $ = m().span.withConfig({
|
|
182
223
|
displayName: "SliderStyles__StyledLabel",
|
|
183
224
|
componentId: "sc-16ooit4-4"
|
|
184
225
|
})([ "align-self:center;color:", ";" ], (function(e) {
|
|
185
|
-
var
|
|
186
|
-
return
|
|
226
|
+
var t = e.$disabled;
|
|
227
|
+
return t ? b.variables.contentColorDisabled : b.variables.contentColorActive;
|
|
187
228
|
}));
|
|
188
229
|
/* using content: '' to control if step marks should be shown
|
|
189
230
|
* to avoid further issues with variable interpolation given the
|
|
190
231
|
* complexity of the multiple radial gradient backgrounds. This also
|
|
191
|
-
* allows us not to pass in StyledSliderTypes to StyledInput */ var A = (0,
|
|
192
|
-
var O =
|
|
232
|
+
* allows us not to pass in StyledSliderTypes to StyledInput */ var A = (0, p.css)([ "", "{&::after{content:'';}}" ], /* sc-sel */ x);
|
|
233
|
+
var O = m().div.withConfig({
|
|
193
234
|
displayName: "SliderStyles__StyledInput",
|
|
194
235
|
componentId: "sc-16ooit4-5"
|
|
195
|
-
})([ "width:100%;min-width:200px;display:flex;align-items:center;flex:1 0 0;position:relative;cursor:default;height:", ";max-width:100%;", " &:hover{", "{border-color:", ";}}", "" ],
|
|
196
|
-
var
|
|
197
|
-
return
|
|
198
|
-
}), /* sc-sel */ x, (0,
|
|
199
|
-
default:
|
|
200
|
-
error:
|
|
236
|
+
})([ "width:100%;min-width:200px;display:flex;align-items:center;flex:1 0 0;position:relative;cursor:default;height:", ";max-width:100%;", " &:hover{", "{border-color:", ";}}", "" ], b.variables.inputHeight, (function(e) {
|
|
237
|
+
var t = e.$state;
|
|
238
|
+
return t === "disabled" && (0, p.css)([ "cursor:not-allowed;" ]);
|
|
239
|
+
}), /* sc-sel */ x, (0, b.pickVariant)("$state", {
|
|
240
|
+
default: b.variables.interactiveColorBorderHover,
|
|
241
|
+
error: b.variables.interactiveColorBorderHover,
|
|
201
242
|
disabled: "transparent"
|
|
202
|
-
}), (0,
|
|
203
|
-
focus: (0,
|
|
204
|
-
always: (0,
|
|
243
|
+
}), (0, b.pickVariant)("$stepAppearance", {
|
|
244
|
+
focus: (0, p.css)([ "&:focus-within{", "}" ], A),
|
|
245
|
+
always: (0, p.css)([ "", "" ], A)
|
|
205
246
|
}));
|
|
206
247
|
// CONCATENATED MODULE: ./src/utils/ssrDocument.ts
|
|
207
248
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
208
|
-
var
|
|
249
|
+
var P = {
|
|
209
250
|
body: {
|
|
210
251
|
appendChild: function e() {
|
|
211
252
|
return [];
|
|
@@ -259,16 +300,16 @@
|
|
|
259
300
|
search: ""
|
|
260
301
|
}
|
|
261
302
|
};
|
|
262
|
-
function
|
|
263
|
-
var e = typeof document !== "undefined" ? document :
|
|
303
|
+
function T() {
|
|
304
|
+
var e = typeof document !== "undefined" ? document : P;
|
|
264
305
|
return e;
|
|
265
306
|
}
|
|
266
|
-
var
|
|
267
|
-
/* harmony default export */ const B = /* unused pure expression or super */ null &&
|
|
307
|
+
var V = T();
|
|
308
|
+
/* harmony default export */ const B = /* unused pure expression or super */ null && V;
|
|
268
309
|
// CONCATENATED MODULE: ./src/utils/ssrWindow.ts
|
|
269
310
|
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
270
|
-
var
|
|
271
|
-
document:
|
|
311
|
+
var I = {
|
|
312
|
+
document: P,
|
|
272
313
|
navigator: {
|
|
273
314
|
userAgent: ""
|
|
274
315
|
},
|
|
@@ -308,26 +349,26 @@
|
|
|
308
349
|
matchMedia: function e() {
|
|
309
350
|
return {};
|
|
310
351
|
},
|
|
311
|
-
requestAnimationFrame: function e(
|
|
352
|
+
requestAnimationFrame: function e(t) {
|
|
312
353
|
if (typeof setTimeout === "undefined") {
|
|
313
|
-
|
|
354
|
+
t();
|
|
314
355
|
return null;
|
|
315
356
|
}
|
|
316
|
-
return setTimeout(
|
|
357
|
+
return setTimeout(t, 0);
|
|
317
358
|
},
|
|
318
|
-
cancelAnimationFrame: function e(
|
|
359
|
+
cancelAnimationFrame: function e(t) {
|
|
319
360
|
if (typeof setTimeout === "undefined") {
|
|
320
361
|
return;
|
|
321
362
|
}
|
|
322
|
-
clearTimeout(
|
|
363
|
+
clearTimeout(t);
|
|
323
364
|
}
|
|
324
365
|
};
|
|
325
|
-
function
|
|
326
|
-
var e = typeof window !== "undefined" ? window :
|
|
366
|
+
function L() {
|
|
367
|
+
var e = typeof window !== "undefined" ? window : I;
|
|
327
368
|
return e;
|
|
328
369
|
}
|
|
329
|
-
var
|
|
330
|
-
/* harmony default export */ const
|
|
370
|
+
var _ = L();
|
|
371
|
+
/* harmony default export */ const j = _;
|
|
331
372
|
// CONCATENATED MODULE: ./src/utils/updateReactRef.ts
|
|
332
373
|
/**
|
|
333
374
|
* Updates a React ref. Callback refs and object refs (from `createRef` and `useRef`) are supported.
|
|
@@ -335,65 +376,65 @@
|
|
|
335
376
|
* @param ref - The React callback or object ref. Can be `null` or `undefined`.
|
|
336
377
|
* @param current - The new value of the ref.
|
|
337
378
|
*/
|
|
338
|
-
function
|
|
379
|
+
function q(e, t) {
|
|
339
380
|
if (e) {
|
|
340
381
|
if (typeof e === "function") {
|
|
341
|
-
e(
|
|
382
|
+
e(t);
|
|
342
383
|
} else {
|
|
343
384
|
// the public signature of this util uses React.Ref<T> to mirror the way React types refs.
|
|
344
385
|
// the intention here is to signal "we will take care of setting 'current', not you".
|
|
345
|
-
e.current =
|
|
386
|
+
e.current = t;
|
|
346
387
|
// eslint-disable-line no-param-reassign
|
|
347
388
|
}
|
|
348
389
|
}
|
|
349
390
|
}
|
|
350
391
|
// CONCATENATED MODULE: ./src/Slider/Slider.tsx
|
|
351
|
-
function
|
|
352
|
-
return
|
|
353
|
-
for (var
|
|
354
|
-
var
|
|
355
|
-
for (var n in
|
|
356
|
-
({}).hasOwnProperty.call(
|
|
392
|
+
function M() {
|
|
393
|
+
return M = Object.assign ? Object.assign.bind() : function(e) {
|
|
394
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
395
|
+
var r = arguments[t];
|
|
396
|
+
for (var n in r) {
|
|
397
|
+
({}).hasOwnProperty.call(r, n) && (e[n] = r[n]);
|
|
357
398
|
}
|
|
358
399
|
}
|
|
359
400
|
return e;
|
|
360
|
-
},
|
|
401
|
+
}, M.apply(null, arguments);
|
|
361
402
|
}
|
|
362
|
-
function
|
|
363
|
-
return H(e) || F(e,
|
|
403
|
+
function N(e, t) {
|
|
404
|
+
return H(e) || F(e, t) || R(e, t) || D();
|
|
364
405
|
}
|
|
365
406
|
function D() {
|
|
366
407
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
367
408
|
}
|
|
368
|
-
function R(e,
|
|
409
|
+
function R(e, t) {
|
|
369
410
|
if (e) {
|
|
370
|
-
if ("string" == typeof e) return W(e,
|
|
371
|
-
var
|
|
372
|
-
return "Object" ===
|
|
411
|
+
if ("string" == typeof e) return W(e, t);
|
|
412
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
413
|
+
return "Object" === r && e.constructor && (r = e.constructor.name), "Map" === r || "Set" === r ? Array.from(e) : "Arguments" === r || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? W(e, t) : void 0;
|
|
373
414
|
}
|
|
374
415
|
}
|
|
375
|
-
function W(e,
|
|
376
|
-
(null ==
|
|
377
|
-
for (var
|
|
378
|
-
n[
|
|
416
|
+
function W(e, t) {
|
|
417
|
+
(null == t || t > e.length) && (t = e.length);
|
|
418
|
+
for (var r = 0, n = Array(t); r < t; r++) {
|
|
419
|
+
n[r] = e[r];
|
|
379
420
|
}
|
|
380
421
|
return n;
|
|
381
422
|
}
|
|
382
|
-
function F(e,
|
|
383
|
-
var
|
|
384
|
-
if (null !=
|
|
423
|
+
function F(e, t) {
|
|
424
|
+
var r = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
425
|
+
if (null != r) {
|
|
385
426
|
var n, a, i, o, l = [], u = !0, s = !1;
|
|
386
427
|
try {
|
|
387
|
-
if (i = (
|
|
388
|
-
if (Object(
|
|
428
|
+
if (i = (r = r.call(e)).next, 0 === t) {
|
|
429
|
+
if (Object(r) !== r) return;
|
|
389
430
|
u = !1;
|
|
390
|
-
} else for (;!(u = (n = i.call(
|
|
431
|
+
} else for (;!(u = (n = i.call(r)).done) && (l.push(n.value), l.length !== t); u = !0) {
|
|
391
432
|
}
|
|
392
433
|
} catch (e) {
|
|
393
434
|
s = !0, a = e;
|
|
394
435
|
} finally {
|
|
395
436
|
try {
|
|
396
|
-
if (!u && null !=
|
|
437
|
+
if (!u && null != r["return"] && (o = r["return"](), Object(o) !== o)) return;
|
|
397
438
|
} finally {
|
|
398
439
|
if (s) throw a;
|
|
399
440
|
}
|
|
@@ -404,27 +445,27 @@
|
|
|
404
445
|
function H(e) {
|
|
405
446
|
if (Array.isArray(e)) return e;
|
|
406
447
|
}
|
|
407
|
-
function U(e,
|
|
448
|
+
function U(e, t) {
|
|
408
449
|
if (null == e) return {};
|
|
409
|
-
var
|
|
450
|
+
var r, n, a = z(e, t);
|
|
410
451
|
if (Object.getOwnPropertySymbols) {
|
|
411
452
|
var i = Object.getOwnPropertySymbols(e);
|
|
412
453
|
for (n = 0; n < i.length; n++) {
|
|
413
|
-
|
|
454
|
+
r = i[n], -1 === t.indexOf(r) && {}.propertyIsEnumerable.call(e, r) && (a[r] = e[r]);
|
|
414
455
|
}
|
|
415
456
|
}
|
|
416
457
|
return a;
|
|
417
458
|
}
|
|
418
|
-
function z(e,
|
|
459
|
+
function z(e, t) {
|
|
419
460
|
if (null == e) return {};
|
|
420
|
-
var
|
|
461
|
+
var r = {};
|
|
421
462
|
for (var n in e) {
|
|
422
463
|
if ({}.hasOwnProperty.call(e, n)) {
|
|
423
|
-
if (-1 !==
|
|
424
|
-
|
|
464
|
+
if (-1 !== t.indexOf(n)) continue;
|
|
465
|
+
r[n] = e[n];
|
|
425
466
|
}
|
|
426
467
|
}
|
|
427
|
-
return
|
|
468
|
+
return r;
|
|
428
469
|
}
|
|
429
470
|
/** @public */ var K = {
|
|
430
471
|
defaultValue: l().number,
|
|
@@ -434,6 +475,7 @@
|
|
|
434
475
|
elementRef: l().oneOfType([ l().func, l().object ]),
|
|
435
476
|
error: l().bool,
|
|
436
477
|
inline: l().bool,
|
|
478
|
+
inputId: l().string,
|
|
437
479
|
labelledBy: l().string,
|
|
438
480
|
max: l().number,
|
|
439
481
|
maxLabel: l().node,
|
|
@@ -448,10 +490,10 @@
|
|
|
448
490
|
thumbRef: l().oneOfType([ l().func, l().object ]),
|
|
449
491
|
value: l().number
|
|
450
492
|
};
|
|
451
|
-
var X = function e(
|
|
452
|
-
var
|
|
453
|
-
if (a >
|
|
454
|
-
return
|
|
493
|
+
var X = function e(t) {
|
|
494
|
+
var r = t.max, n = t.min, a = t.value;
|
|
495
|
+
if (a > r) {
|
|
496
|
+
return r;
|
|
455
497
|
}
|
|
456
498
|
if (a < n) {
|
|
457
499
|
return n;
|
|
@@ -460,38 +502,38 @@
|
|
|
460
502
|
};
|
|
461
503
|
// If the current value is in between a step, i.e. defaultValue is not at a
|
|
462
504
|
// step mark, this function handles navigating to the next correct step
|
|
463
|
-
var G = function e(
|
|
464
|
-
var
|
|
505
|
+
var G = function e(t) {
|
|
506
|
+
var r = t.direction, n = t.min, a = t.step, o = t.value;
|
|
465
507
|
var l = new (i())(o).minus(n).modulo(a).toNumber();
|
|
466
508
|
if (l > 0) {
|
|
467
|
-
return
|
|
509
|
+
return r === "forward" ? a - l : l;
|
|
468
510
|
}
|
|
469
511
|
return a;
|
|
470
512
|
};
|
|
471
|
-
var J = function e(
|
|
472
|
-
if (
|
|
513
|
+
var J = function e(t, r) {
|
|
514
|
+
if (r === null) {
|
|
473
515
|
return undefined;
|
|
474
516
|
}
|
|
475
|
-
var n =
|
|
476
|
-
var a =
|
|
517
|
+
var n = r.getBoundingClientRect();
|
|
518
|
+
var a = t.clientX - n.left;
|
|
477
519
|
return X({
|
|
478
520
|
max: 100,
|
|
479
521
|
min: 0,
|
|
480
522
|
value: a / n.width * 100
|
|
481
523
|
});
|
|
482
524
|
};
|
|
483
|
-
var Q = function e(
|
|
484
|
-
var
|
|
525
|
+
var Q = function e(t) {
|
|
526
|
+
var r = t.max, n = t.min, a = t.step, o = t.value;
|
|
485
527
|
// Handles if the max is in between steps but val is larger than the halfway point between last step mark and max
|
|
486
|
-
if (o >
|
|
487
|
-
return
|
|
528
|
+
if (o > r - (r - n) % a / 2) {
|
|
529
|
+
return r;
|
|
488
530
|
}
|
|
489
531
|
return new (i())(o).minus(n).div(a).todp(0).mul(a).add(n).toNumber();
|
|
490
532
|
};
|
|
491
|
-
var Y = function e(
|
|
492
|
-
var
|
|
533
|
+
var Y = function e(t) {
|
|
534
|
+
var r = t.position, n = t.max, a = t.min, i = t.step;
|
|
493
535
|
var o = n - a;
|
|
494
|
-
var l =
|
|
536
|
+
var l = r / 100 * o + a;
|
|
495
537
|
return Q({
|
|
496
538
|
max: n,
|
|
497
539
|
min: a,
|
|
@@ -499,248 +541,262 @@
|
|
|
499
541
|
value: l
|
|
500
542
|
});
|
|
501
543
|
};
|
|
502
|
-
var Z = function e(
|
|
503
|
-
var
|
|
544
|
+
var Z = function e(t) {
|
|
545
|
+
var r = t.max, n = t.min, a = t.sliderBar, i = t.step;
|
|
504
546
|
// don't render stepMarks if they are too small i.e. stepWidth is less than SliderThumb divided by 2
|
|
505
547
|
// in that case, undefined is returned
|
|
506
548
|
if (a === null) {
|
|
507
549
|
return undefined;
|
|
508
550
|
}
|
|
509
|
-
var o =
|
|
551
|
+
var o = r - n;
|
|
510
552
|
var l = Math.round(o / i);
|
|
511
553
|
var u = a.getBoundingClientRect();
|
|
512
554
|
var s = i * 100 / o;
|
|
513
|
-
return u.width / l >
|
|
555
|
+
return u.width / l > C / 2 ? s : undefined;
|
|
514
556
|
};
|
|
515
|
-
var ee = function e(
|
|
516
|
-
var
|
|
557
|
+
var ee = function e(t) {
|
|
558
|
+
var r = t.max, n = t.min, a = t.value;
|
|
517
559
|
if (a === undefined) {
|
|
518
560
|
return undefined;
|
|
519
561
|
}
|
|
520
|
-
var i =
|
|
562
|
+
var i = r - n;
|
|
521
563
|
return (a - n) / i * 100;
|
|
522
564
|
};
|
|
523
|
-
function
|
|
524
|
-
var
|
|
565
|
+
function te(e) {
|
|
566
|
+
var t = e.defaultValue, a = e.describedBy, i = e.disabled, o = e.displayValue, l = e.elementRef, u = e.error, c = e.inline, f = e.inputId, p = e.labelledBy, m = e.max, b = m === void 0 ? 5 : m, h = e.maxLabel, y = e.min, g = y === void 0 ? 1 : y, w = e.minLabel, C = e.name, A = e.onChange, P = e.required, T = e.step, V = T === void 0 ? 1 : T, B = e.stepMarks, I = B === void 0 ? "focus" : B, L = e.thumbRef, _ = e.value, D = U(e, [ "defaultValue", "describedBy", "disabled", "displayValue", "elementRef", "error", "inline", "inputId", "labelledBy", "max", "maxLabel", "min", "minLabel", "name", "onChange", "required", "step", "stepMarks", "thumbRef", "value" ]);
|
|
525
567
|
// @docs-props-type SliderPropsBase
|
|
526
|
-
var
|
|
568
|
+
var R = v()({
|
|
527
569
|
componentName: "Slider",
|
|
528
570
|
/* eslint-disable-next-line prefer-rest-params */
|
|
529
571
|
componentProps: arguments[0]
|
|
530
572
|
});
|
|
531
|
-
var
|
|
532
|
-
var
|
|
533
|
-
var
|
|
534
|
-
var
|
|
535
|
-
var
|
|
536
|
-
return
|
|
537
|
-
value: (b -
|
|
538
|
-
min:
|
|
573
|
+
var W = (0, r.useState)(false), F = N(W, 2), H = F[0], z = F[1];
|
|
574
|
+
var K = (0, r.useState)(false), te = N(K, 2), re = te[0], ne = te[1];
|
|
575
|
+
var ae = (0, r.useState)(null), ie = N(ae, 2), oe = ie[0], le = ie[1];
|
|
576
|
+
var ue = (0, r.useState)(null), se = N(ue, 2), ce = se[0], de = se[1];
|
|
577
|
+
var fe = (0, r.useMemo)((function() {
|
|
578
|
+
return R ? Q({
|
|
579
|
+
value: (b - g) / 2,
|
|
580
|
+
min: g,
|
|
539
581
|
max: b,
|
|
540
582
|
step: V
|
|
541
|
-
}) :
|
|
542
|
-
}), [
|
|
543
|
-
var
|
|
544
|
-
var
|
|
545
|
-
var
|
|
546
|
-
if (me !==
|
|
547
|
-
|
|
548
|
-
value:
|
|
549
|
-
name:
|
|
583
|
+
}) : t;
|
|
584
|
+
}), [ R, t, b, g, V ]);
|
|
585
|
+
var ve = (0, r.useState)(R ? _ : fe), pe = N(ve, 2), me = pe[0], be = pe[1];
|
|
586
|
+
var he = (0, r.useCallback)((function(e, t) {
|
|
587
|
+
var r = t.newValue;
|
|
588
|
+
if (me !== r) {
|
|
589
|
+
A === null || A === void 0 ? void 0 : A(e, {
|
|
590
|
+
value: r,
|
|
591
|
+
name: C
|
|
550
592
|
});
|
|
551
|
-
if (!
|
|
552
|
-
be(
|
|
593
|
+
if (!R) {
|
|
594
|
+
be(r);
|
|
553
595
|
}
|
|
554
596
|
}
|
|
555
|
-
}), [
|
|
597
|
+
}), [ R, C, A, me ]);
|
|
556
598
|
// handlers
|
|
557
|
-
var
|
|
558
|
-
|
|
599
|
+
var ye = (0, r.useCallback)((function() {
|
|
600
|
+
ne(false);
|
|
559
601
|
}), []);
|
|
560
|
-
var
|
|
561
|
-
|
|
602
|
+
var ge = (0, r.useCallback)((function() {
|
|
603
|
+
ne(true);
|
|
562
604
|
}), []);
|
|
563
|
-
var
|
|
564
|
-
|
|
605
|
+
var we = (0, r.useCallback)((function(e) {
|
|
606
|
+
le(e);
|
|
565
607
|
}), []);
|
|
566
|
-
var
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
}), [
|
|
570
|
-
var Se = (0,
|
|
571
|
-
var
|
|
572
|
-
if (
|
|
573
|
-
var
|
|
574
|
-
position:
|
|
608
|
+
var Ce = (0, r.useCallback)((function(e) {
|
|
609
|
+
de(e);
|
|
610
|
+
q(L, e);
|
|
611
|
+
}), [ L ]);
|
|
612
|
+
var Se = (0, r.useCallback)((function(e) {
|
|
613
|
+
var t = J(e, oe);
|
|
614
|
+
if (t !== undefined) {
|
|
615
|
+
var r = Y({
|
|
616
|
+
position: t,
|
|
575
617
|
max: b,
|
|
576
|
-
min:
|
|
618
|
+
min: g,
|
|
577
619
|
step: V
|
|
578
620
|
});
|
|
579
|
-
|
|
580
|
-
newValue:
|
|
621
|
+
he(e, {
|
|
622
|
+
newValue: r
|
|
581
623
|
});
|
|
582
624
|
}
|
|
583
|
-
}), [ b,
|
|
584
|
-
var
|
|
585
|
-
var
|
|
586
|
-
if (
|
|
587
|
-
var
|
|
625
|
+
}), [ b, g, he, oe, V ]);
|
|
626
|
+
var xe = (0, r.useCallback)((function(e) {
|
|
627
|
+
var t = me;
|
|
628
|
+
if (t !== undefined) {
|
|
629
|
+
var r = e.key;
|
|
588
630
|
var n;
|
|
589
631
|
var a = G({
|
|
590
632
|
direction: "forward",
|
|
591
|
-
min:
|
|
633
|
+
min: g,
|
|
592
634
|
step: V,
|
|
593
|
-
value:
|
|
635
|
+
value: t
|
|
594
636
|
});
|
|
595
637
|
var i = G({
|
|
596
638
|
direction: "backward",
|
|
597
|
-
min:
|
|
639
|
+
min: g,
|
|
598
640
|
step: V,
|
|
599
|
-
value:
|
|
641
|
+
value: t
|
|
600
642
|
});
|
|
601
|
-
if (
|
|
602
|
-
n =
|
|
603
|
-
} else if (
|
|
604
|
-
n =
|
|
605
|
-
} else if (
|
|
643
|
+
if (r === "ArrowRight") {
|
|
644
|
+
n = t + a;
|
|
645
|
+
} else if (r === "ArrowLeft") {
|
|
646
|
+
n = t - i;
|
|
647
|
+
} else if (r === "ArrowUp") {
|
|
606
648
|
e.preventDefault();
|
|
607
|
-
n =
|
|
608
|
-
} else if (
|
|
649
|
+
n = t + a;
|
|
650
|
+
} else if (r === "ArrowDown") {
|
|
609
651
|
e.preventDefault();
|
|
610
|
-
n =
|
|
652
|
+
n = t - i;
|
|
611
653
|
} else {
|
|
612
654
|
return;
|
|
613
655
|
}
|
|
614
|
-
|
|
656
|
+
t = X({
|
|
615
657
|
max: b,
|
|
616
|
-
min:
|
|
658
|
+
min: g,
|
|
617
659
|
value: n
|
|
618
660
|
});
|
|
619
|
-
|
|
661
|
+
t = Q({
|
|
620
662
|
max: b,
|
|
621
|
-
min:
|
|
663
|
+
min: g,
|
|
622
664
|
step: V,
|
|
623
|
-
value:
|
|
665
|
+
value: t
|
|
624
666
|
});
|
|
625
|
-
|
|
626
|
-
newValue:
|
|
667
|
+
he(e, {
|
|
668
|
+
newValue: t
|
|
627
669
|
});
|
|
628
670
|
}
|
|
629
|
-
}), [ b,
|
|
630
|
-
var
|
|
671
|
+
}), [ b, g, he, V, me ]);
|
|
672
|
+
var ke = (0, r.useCallback)((function(e) {
|
|
631
673
|
e.preventDefault();
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
}), [
|
|
636
|
-
var
|
|
637
|
-
|
|
674
|
+
ce === null || ce === void 0 ? void 0 : ce.focus();
|
|
675
|
+
z(true);
|
|
676
|
+
ne(true);
|
|
677
|
+
}), [ ce ]);
|
|
678
|
+
var Ee = (0, r.useCallback)((function() {
|
|
679
|
+
ne(true);
|
|
638
680
|
}), []);
|
|
639
|
-
var
|
|
640
|
-
if (!
|
|
641
|
-
|
|
681
|
+
var $e = (0, r.useCallback)((function() {
|
|
682
|
+
if (!H) {
|
|
683
|
+
ne(false);
|
|
642
684
|
}
|
|
643
|
-
}), [
|
|
644
|
-
var
|
|
645
|
-
if (
|
|
646
|
-
var
|
|
647
|
-
if (
|
|
648
|
-
var
|
|
649
|
-
position:
|
|
650
|
-
min:
|
|
685
|
+
}), [ H ]);
|
|
686
|
+
var Ae = (0, r.useCallback)((function(e) {
|
|
687
|
+
if (H) {
|
|
688
|
+
var t = J(e, oe);
|
|
689
|
+
if (t !== undefined) {
|
|
690
|
+
var r = Y({
|
|
691
|
+
position: t,
|
|
692
|
+
min: g,
|
|
651
693
|
max: b,
|
|
652
694
|
step: V
|
|
653
695
|
});
|
|
654
|
-
|
|
655
|
-
newValue:
|
|
696
|
+
he(e, {
|
|
697
|
+
newValue: r
|
|
656
698
|
});
|
|
657
699
|
}
|
|
658
700
|
}
|
|
659
|
-
}), [
|
|
660
|
-
var
|
|
661
|
-
|
|
662
|
-
|
|
701
|
+
}), [ H, b, g, he, oe, V ]);
|
|
702
|
+
var Oe = (0, r.useCallback)((function() {
|
|
703
|
+
z(false);
|
|
704
|
+
ne(false);
|
|
663
705
|
}), []);
|
|
664
|
-
(0,
|
|
706
|
+
var Pe = (0, r.useCallback)((function(e) {
|
|
707
|
+
// When a label is clicked, it triggers a synthetic click event on the associated control.
|
|
708
|
+
// For Slider, we only want to focus the thumb, not trigger any other behavior.
|
|
709
|
+
// We can detect label-initiated clicks because they have a detail of 0 (synthetic)
|
|
710
|
+
// and the button wasn't the actual click target.
|
|
711
|
+
if (e.detail === 0) {
|
|
712
|
+
e.preventDefault();
|
|
713
|
+
e.stopPropagation();
|
|
714
|
+
ce === null || ce === void 0 ? void 0 : ce.focus();
|
|
715
|
+
}
|
|
716
|
+
}), [ ce ]);
|
|
717
|
+
(0, r.useEffect)((function() {
|
|
665
718
|
if (false) {}
|
|
666
|
-
}), [ b,
|
|
667
|
-
(0,
|
|
719
|
+
}), [ b, g ]);
|
|
720
|
+
(0, r.useEffect)((function() {
|
|
668
721
|
// keep valueState in sync with value prop when controlled
|
|
669
|
-
if (
|
|
670
|
-
be(
|
|
722
|
+
if (R) {
|
|
723
|
+
be(_);
|
|
671
724
|
}
|
|
672
|
-
}), [
|
|
673
|
-
var
|
|
674
|
-
var
|
|
725
|
+
}), [ R, _ ]);
|
|
726
|
+
var Te = i && "disabled" || u && "error" || "default";
|
|
727
|
+
var Ve = ee({
|
|
675
728
|
value: me,
|
|
676
|
-
min:
|
|
729
|
+
min: g,
|
|
677
730
|
max: b
|
|
678
731
|
});
|
|
679
|
-
var
|
|
732
|
+
var Be = V ? Z({
|
|
680
733
|
max: b,
|
|
681
|
-
min:
|
|
682
|
-
sliderBar:
|
|
734
|
+
min: g,
|
|
735
|
+
sliderBar: oe,
|
|
683
736
|
step: V
|
|
684
737
|
}) : undefined;
|
|
685
738
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
|
686
|
-
return n().createElement(
|
|
739
|
+
return n().createElement(S, M({
|
|
687
740
|
"data-test": "slider",
|
|
688
741
|
"data-test-disabled": i ? "disabled" : undefined,
|
|
689
742
|
"data-test-value": me,
|
|
690
743
|
ref: l,
|
|
691
744
|
$inline: c
|
|
692
|
-
},
|
|
693
|
-
target:
|
|
745
|
+
}, D), H && n().createElement(n().Fragment, null, n().createElement(s(), {
|
|
746
|
+
target: j,
|
|
694
747
|
eventType: "mouseup",
|
|
695
|
-
listener:
|
|
748
|
+
listener: Oe
|
|
696
749
|
}), n().createElement(s(), {
|
|
697
|
-
target:
|
|
750
|
+
target: j,
|
|
698
751
|
eventType: "mousemove",
|
|
699
|
-
listener:
|
|
700
|
-
})),
|
|
752
|
+
listener: Ae
|
|
753
|
+
})), w !== null && n().createElement($, {
|
|
701
754
|
"data-test": "min-label",
|
|
702
755
|
$disabled: i
|
|
703
|
-
},
|
|
756
|
+
}, w || g), n().createElement(O, {
|
|
704
757
|
onClick: i ? undefined : Se,
|
|
705
|
-
$state:
|
|
706
|
-
$stepAppearance:
|
|
758
|
+
$state: Te,
|
|
759
|
+
$stepAppearance: I
|
|
707
760
|
}, n().createElement(x, {
|
|
708
|
-
"aria-required":
|
|
761
|
+
"aria-required": P,
|
|
709
762
|
"data-test": "bar",
|
|
710
|
-
ref:
|
|
711
|
-
$thumbPosition:
|
|
712
|
-
$stepWidth:
|
|
713
|
-
$state:
|
|
763
|
+
ref: we,
|
|
764
|
+
$thumbPosition: Ve,
|
|
765
|
+
$stepWidth: Be,
|
|
766
|
+
$state: Te
|
|
714
767
|
}), n().createElement(k, {
|
|
768
|
+
id: f,
|
|
715
769
|
"aria-describedby": a,
|
|
716
|
-
"aria-labelledby":
|
|
770
|
+
"aria-labelledby": p,
|
|
717
771
|
"aria-invalid": u,
|
|
718
772
|
"aria-valuemax": b,
|
|
719
|
-
"aria-valuemin":
|
|
773
|
+
"aria-valuemin": g,
|
|
720
774
|
"aria-valuenow": me,
|
|
721
775
|
"data-test": "thumb",
|
|
722
|
-
onBlur:
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
776
|
+
onBlur: ye,
|
|
777
|
+
onClick: i ? undefined : Pe,
|
|
778
|
+
onMouseEnter: Ee,
|
|
779
|
+
onMouseLeave: $e,
|
|
780
|
+
onKeyDown: i ? undefined : xe,
|
|
781
|
+
onMouseDown: i ? undefined : ke,
|
|
782
|
+
onFocus: ge,
|
|
783
|
+
ref: Ce,
|
|
729
784
|
role: "slider",
|
|
730
785
|
disabled: i,
|
|
731
|
-
$thumbPosition:
|
|
732
|
-
$
|
|
786
|
+
$thumbPosition: Ve,
|
|
787
|
+
$stepWidth: Be,
|
|
788
|
+
$state: Te
|
|
733
789
|
}), n().createElement(d(), {
|
|
734
790
|
open: re,
|
|
735
|
-
anchor:
|
|
791
|
+
anchor: ce,
|
|
736
792
|
align: "center"
|
|
737
|
-
}, n().createElement(E, null, o || me))),
|
|
793
|
+
}, n().createElement(E, null, o || me))), h !== null && n().createElement($, {
|
|
738
794
|
"data-test": "max-label",
|
|
739
795
|
$disabled: i
|
|
740
|
-
},
|
|
796
|
+
}, h || b));
|
|
741
797
|
}
|
|
742
|
-
|
|
743
|
-
/* harmony default export */ const
|
|
798
|
+
te.propTypes = K;
|
|
799
|
+
/* harmony default export */ const re = te;
|
|
744
800
|
// CONCATENATED MODULE: ./src/Slider/index.ts
|
|
745
|
-
module.exports =
|
|
801
|
+
module.exports = t;
|
|
746
802
|
/******/})();
|