@prokodo/ui 0.1.14 → 0.1.15
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/components/RTE/RTE.client.js +0 -1
- package/dist/components/RTE/RTE.js +4 -1
- package/dist/components/accordion/Accordion.js +8 -2
- package/dist/components/accordion/Accordion.view.js +1 -1
- package/dist/components/animated/Animated.client.js +13 -5
- package/dist/components/animated/Animated.js +8 -2
- package/dist/components/animatedText/AnimatedText.client.js +10 -2
- package/dist/components/animatedText/AnimatedText.js +8 -2
- package/dist/components/autocomplete/Autocomplete.client.js +5 -1
- package/dist/components/autocomplete/Autocomplete.js +4 -1
- package/dist/components/autocomplete/Autocomplete.view.js +13 -4
- package/dist/components/avatar/Avatar.js +4 -1
- package/dist/components/avatar/Avatar.view.js +19 -12
- package/dist/components/base-link/BaseLink.js +4 -1
- package/dist/components/base-link/BaseLink.view.js +3 -0
- package/dist/components/button/Button.js +4 -1
- package/dist/components/button/Button.view.js +3 -1
- package/dist/components/calendly/Calendly.js +8 -2
- package/dist/components/card/Card.js +11 -5
- package/dist/components/card/Card.view.js +22 -5
- package/dist/components/carousel/Carousel.client.js +140 -129
- package/dist/components/carousel/Carousel.js +8 -2
- package/dist/components/carousel/Carousel.view.js +10 -0
- package/dist/components/checkbox/Checkbox.js +4 -1
- package/dist/components/checkbox/Checkbox.view.js +4 -1
- package/dist/components/checkbox-group/CheckboxGroup.js +4 -1
- package/dist/components/checkbox-group/CheckboxGroup.view.js +4 -1
- package/dist/components/chip/Chip.js +4 -1
- package/dist/components/chip/Chip.view.js +4 -0
- package/dist/components/datePicker/DatePicker.js +4 -1
- package/dist/components/dialog/Dialog.js +8 -2
- package/dist/components/dialog/Dialog.view.js +23 -5
- package/dist/components/drawer/Drawer.client.js +0 -1
- package/dist/components/drawer/Drawer.js +4 -1
- package/dist/components/drawer/Drawer.view.js +14 -3
- package/dist/components/dynamic-list/DynamicList.client.js +1 -0
- package/dist/components/dynamic-list/DynamicList.js +4 -1
- package/dist/components/dynamic-list/DynamicList.view.js +18 -5
- package/dist/components/form/Form.client.js +4 -1
- package/dist/components/form/Form.js +4 -1
- package/dist/components/form/Form.view.js +3 -1
- package/dist/components/form/FormField.client.js +8 -2
- package/dist/components/form/FormField.js +4 -1
- package/dist/components/form/FormResponse.js +4 -1
- package/dist/components/headline/Headline.js +8 -2
- package/dist/components/icon/Icon.js +8 -2
- package/dist/components/image/Image.client.js +9 -5
- package/dist/components/image/Image.js +8 -2
- package/dist/components/image/Image.server.js +2 -1
- package/dist/components/image-text/ImageText.js +18 -8
- package/dist/components/input/Input.client.js +15 -2
- package/dist/components/input/Input.js +4 -1
- package/dist/components/input/Input.view.js +15 -6
- package/dist/components/input/InputValidation.js +6 -2
- package/dist/components/inputOTP/InputOTP.js +2 -1
- package/dist/components/link/Link.js +5 -3
- package/dist/components/link/Link.view.js +2 -1
- package/dist/components/list/List.js +52 -23
- package/dist/components/loading/Loading.js +4 -1
- package/dist/components/loading/Loading.view.js +25 -5
- package/dist/components/lottie/Lottie.js +9 -5
- package/dist/components/map/Map.js +62 -44
- package/dist/components/pagination/Pagination.js +4 -1
- package/dist/components/pagination/Pagination.view.js +3 -1
- package/dist/components/post-item/PostItem.js +4 -1
- package/dist/components/post-item/PostItemAuthor.js +4 -1
- package/dist/components/post-teaser/PostTeaser.js +4 -1
- package/dist/components/post-teaser/PostTeaser.view.js +4 -2
- package/dist/components/post-widget/PostWidget.js +5 -3
- package/dist/components/post-widget/PostWidget.view.js +9 -3
- package/dist/components/post-widget-carousel/PostWidgetCarousel.js +8 -2
- package/dist/components/post-widget-carousel/PostWidgetCarousel.view.js +2 -1
- package/dist/components/progressBar/ProgressBar.js +8 -2
- package/dist/components/progressBar/ProgressBar.view.js +4 -1
- package/dist/components/rating/Rating.client.js +6 -1
- package/dist/components/rating/Rating.js +4 -1
- package/dist/components/rich-text/RichText.client.js +52 -17
- package/dist/components/rich-text/RichText.js +8 -2
- package/dist/components/rich-text/RichText.server.js +3 -0
- package/dist/components/select/Select.client.js +149 -101
- package/dist/components/select/Select.js +8 -2
- package/dist/components/select/Select.view.js +35 -11
- package/dist/components/sidenav/SideNav.js +8 -2
- package/dist/components/slider/Slider.client.js +11 -2
- package/dist/components/slider/Slider.js +4 -1
- package/dist/components/slider/Slider.view.js +43 -5
- package/dist/components/snackbar/Snackbar.client.js +5 -1
- package/dist/components/snackbar/Snackbar.js +4 -1
- package/dist/components/snackbar/SnackbarProvider.js +8 -2
- package/dist/components/stepper/Stepper.client.js +6 -3
- package/dist/components/stepper/Stepper.js +4 -1
- package/dist/components/switch/Switch.js +4 -1
- package/dist/components/switch/Switch.view.js +1 -0
- package/dist/components/table/Table.js +1 -0
- package/dist/components/tabs/Tabs.client.js +1 -0
- package/dist/components/tabs/Tabs.js +8 -2
- package/dist/components/tabs/Tabs.view.js +8 -2
- package/dist/components/tooltip/Tooltip.client.js +126 -91
- package/dist/components/tooltip/Tooltip.js +10 -4
- package/dist/components/tooltip/Tooltip.view.js +1 -0
- package/dist/constants/project.js +1 -1
- package/dist/helpers/createIsland.js +1 -0
- package/dist/helpers/createLazyWrapper.js +1 -0
- package/dist/hooks/useGoogleMaps.js +0 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/RTE/RTE.d.ts +1 -1
- package/dist/types/components/RTE/RTE.lazy.d.ts +1 -1
- package/dist/types/components/avatar/Avatar.view.d.ts +1 -1
- package/dist/types/components/carousel/Carousel.view.d.ts +1 -1
- package/dist/types/components/dynamic-list/DynamicList.model.d.ts +1 -1
- package/dist/types/components/headline/Headline.model.d.ts +1 -1
- package/dist/types/components/input/Input.view.d.ts +1 -1
- package/package.json +19 -5
|
@@ -11,11 +11,17 @@ function isMulti(v) {
|
|
|
11
11
|
__name(isMulti, "isMulti");
|
|
12
12
|
const toDatasetKey = /* @__PURE__ */ __name((k) => k.replace(/-([a-z])/g, (_, c) => c.toUpperCase()), "toDatasetKey");
|
|
13
13
|
function mergeValue(oldVal, newVal, multiple = false) {
|
|
14
|
-
return multiple ? (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
return multiple ? (
|
|
15
|
+
/* istanbul ignore next */
|
|
16
|
+
(() => {
|
|
17
|
+
const s = new Set(
|
|
18
|
+
/* istanbul ignore next */
|
|
19
|
+
isMulti(oldVal) ? oldVal : []
|
|
20
|
+
);
|
|
21
|
+
s.has(newVal) ? s.delete(newVal) : s.add(newVal);
|
|
22
|
+
return [...s];
|
|
23
|
+
})()
|
|
24
|
+
) : newVal;
|
|
19
25
|
}
|
|
20
26
|
__name(mergeValue, "mergeValue");
|
|
21
27
|
function SelectClient({
|
|
@@ -64,7 +70,10 @@ function SelectClient({
|
|
|
64
70
|
);
|
|
65
71
|
const valueToIndex = useCallback(() => {
|
|
66
72
|
if (!Boolean(multiple)) {
|
|
67
|
-
const current = String(
|
|
73
|
+
const current = String(
|
|
74
|
+
/* istanbul ignore next */
|
|
75
|
+
val ?? ""
|
|
76
|
+
);
|
|
68
77
|
if (hasPlaceholder && current === "") return 0;
|
|
69
78
|
const idx = items.findIndex((x) => String(x.value) === current);
|
|
70
79
|
if (idx >= 0) return idx + (hasPlaceholder ? 1 : 0);
|
|
@@ -81,19 +90,23 @@ function SelectClient({
|
|
|
81
90
|
setPopupReady(false);
|
|
82
91
|
(_a = btnRef == null ? void 0 : btnRef.current) == null ? void 0 : _a.focus();
|
|
83
92
|
}, []);
|
|
84
|
-
const updatePopupPosition = useCallback(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
const updatePopupPosition = useCallback(
|
|
94
|
+
/* istanbul ignore next */
|
|
95
|
+
() => {
|
|
96
|
+
const btn = btnRef.current;
|
|
97
|
+
if (!btn) return false;
|
|
98
|
+
const r = btn.getBoundingClientRect();
|
|
99
|
+
setPopupStyle({
|
|
100
|
+
position: "fixed",
|
|
101
|
+
left: r.left,
|
|
102
|
+
top: r.bottom,
|
|
103
|
+
width: r.width,
|
|
104
|
+
zIndex: 2147483647
|
|
105
|
+
});
|
|
106
|
+
return true;
|
|
107
|
+
},
|
|
108
|
+
[]
|
|
109
|
+
);
|
|
97
110
|
useEffect(() => {
|
|
98
111
|
if (!open || !popupReady) return;
|
|
99
112
|
setActiveIndex(valueToIndex());
|
|
@@ -142,54 +155,70 @@ function SelectClient({
|
|
|
142
155
|
window.addEventListener("click", handleOutside);
|
|
143
156
|
return () => window.removeEventListener("click", handleOutside);
|
|
144
157
|
}, [open, close]);
|
|
145
|
-
const handleKey =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if (e.key === "ArrowDown") {
|
|
154
|
-
e.preventDefault();
|
|
155
|
-
if (!open) {
|
|
156
|
-
openWithPosition();
|
|
158
|
+
const handleKey = (
|
|
159
|
+
/* istanbul ignore next */
|
|
160
|
+
/* @__PURE__ */ __name((e) => {
|
|
161
|
+
var _a, _b;
|
|
162
|
+
if (Boolean(disabled)) return;
|
|
163
|
+
if (e.key === "Escape") {
|
|
164
|
+
e.preventDefault();
|
|
165
|
+
close();
|
|
157
166
|
return;
|
|
158
167
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
if (e.key === "ArrowDown") {
|
|
169
|
+
e.preventDefault();
|
|
170
|
+
if (!open) {
|
|
171
|
+
openWithPosition();
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
setActiveIndex((i) => clampIndex((i < 0 ? valueToIndex() : i) + 1));
|
|
175
|
+
(_a = listRef.current) == null ? void 0 : _a.focus();
|
|
167
176
|
return;
|
|
168
177
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
178
|
+
if (e.key === "ArrowUp") {
|
|
179
|
+
e.preventDefault();
|
|
180
|
+
if (!open) {
|
|
181
|
+
openWithPosition();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
setActiveIndex((i) => clampIndex((i < 0 ? valueToIndex() : i) - 1));
|
|
185
|
+
(_b = listRef.current) == null ? void 0 : _b.focus();
|
|
186
|
+
}
|
|
187
|
+
}, "handleKey")
|
|
188
|
+
);
|
|
189
|
+
const dataset = useMemo(
|
|
190
|
+
/* istanbul ignore next */
|
|
191
|
+
() => {
|
|
192
|
+
const d = {};
|
|
193
|
+
for (const [k, v] of Object.entries(rest)) {
|
|
194
|
+
if (k.startsWith("data-")) d[toDatasetKey(k.slice(5))] = v;
|
|
195
|
+
}
|
|
196
|
+
return d;
|
|
197
|
+
},
|
|
198
|
+
[rest]
|
|
199
|
+
);
|
|
200
|
+
const clickOption = (
|
|
201
|
+
/* istanbul ignore next */
|
|
202
|
+
/* @__PURE__ */ __name((opt) => {
|
|
203
|
+
const newVal = opt === null ? (
|
|
204
|
+
/* istanbul ignore next */
|
|
205
|
+
Boolean(multiple) ? [] : ""
|
|
206
|
+
) : mergeValue(val, opt, multiple);
|
|
207
|
+
const syntheticEvt = { target: { dataset } };
|
|
208
|
+
setVal(newVal);
|
|
209
|
+
onChange == null ? void 0 : onChange(syntheticEvt, newVal);
|
|
210
|
+
if (!Boolean(multiple)) close();
|
|
211
|
+
}, "clickOption")
|
|
212
|
+
);
|
|
213
|
+
const onOptionKeyDown = (
|
|
214
|
+
/* istanbul ignore next */
|
|
215
|
+
/* @__PURE__ */ __name((e, v) => {
|
|
216
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
217
|
+
e.preventDefault();
|
|
218
|
+
clickOption(v);
|
|
219
|
+
}
|
|
220
|
+
}, "onOptionKeyDown")
|
|
221
|
+
);
|
|
193
222
|
return /* @__PURE__ */ jsx(
|
|
194
223
|
SelectView,
|
|
195
224
|
{
|
|
@@ -211,38 +240,41 @@ function SelectClient({
|
|
|
211
240
|
if (!args.open) return null;
|
|
212
241
|
if (!popupReady) return null;
|
|
213
242
|
if (typeof document === "undefined") return null;
|
|
214
|
-
const onListKeyDown =
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
const onListKeyDown = (
|
|
244
|
+
/* istanbul ignore next */
|
|
245
|
+
/* @__PURE__ */ __name((e) => {
|
|
246
|
+
if (e.key === "Escape") {
|
|
247
|
+
e.preventDefault();
|
|
248
|
+
close();
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
if (e.key === "ArrowDown") {
|
|
252
|
+
e.preventDefault();
|
|
253
|
+
setActiveIndex((i) => clampIndex((i < 0 ? valueToIndex() : i) + 1));
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
if (e.key === "ArrowUp") {
|
|
257
|
+
e.preventDefault();
|
|
258
|
+
setActiveIndex((i) => clampIndex((i < 0 ? valueToIndex() : i) - 1));
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
if (e.key === "Home") {
|
|
262
|
+
e.preventDefault();
|
|
263
|
+
setActiveIndex(optionCount > 0 ? 0 : -1);
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (e.key === "End") {
|
|
267
|
+
e.preventDefault();
|
|
268
|
+
setActiveIndex(optionCount > 0 ? optionCount - 1 : -1);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
272
|
+
e.preventDefault();
|
|
273
|
+
const v = indexToValue(activeIndex);
|
|
274
|
+
clickOption(v);
|
|
275
|
+
}
|
|
276
|
+
}, "onListKeyDown")
|
|
277
|
+
);
|
|
246
278
|
const listbox = /* @__PURE__ */ jsxs(
|
|
247
279
|
"ul",
|
|
248
280
|
{
|
|
@@ -262,14 +294,29 @@ function SelectClient({
|
|
|
262
294
|
id: `${args.id}-opt-0`,
|
|
263
295
|
role: "option",
|
|
264
296
|
tabIndex: -1,
|
|
265
|
-
"aria-selected":
|
|
297
|
+
"aria-selected": (
|
|
298
|
+
/* istanbul ignore next */
|
|
299
|
+
Array.isArray(args.value) ? args.value.length === 0 : String(args.value ?? "") === ""
|
|
300
|
+
),
|
|
266
301
|
className: args.bemItem({
|
|
267
|
-
selected:
|
|
302
|
+
selected: (
|
|
303
|
+
/* istanbul ignore next */
|
|
304
|
+
Array.isArray(args.value) ? args.value.length === 0 : String(args.value ?? "") === ""
|
|
305
|
+
),
|
|
268
306
|
active: activeIndex === 0
|
|
269
307
|
}),
|
|
270
|
-
onClick:
|
|
271
|
-
|
|
272
|
-
|
|
308
|
+
onClick: (
|
|
309
|
+
/* istanbul ignore next */
|
|
310
|
+
/* @__PURE__ */ __name(() => args.onOptionClick(null), "onClick")
|
|
311
|
+
),
|
|
312
|
+
onKeyDown: (
|
|
313
|
+
/* istanbul ignore next */
|
|
314
|
+
/* @__PURE__ */ __name((e) => onOptionKeyDown(e, null), "onKeyDown")
|
|
315
|
+
),
|
|
316
|
+
onMouseMove: (
|
|
317
|
+
/* istanbul ignore next */
|
|
318
|
+
/* @__PURE__ */ __name(() => setActiveIndex(0), "onMouseMove")
|
|
319
|
+
),
|
|
273
320
|
children: args.placeholder
|
|
274
321
|
},
|
|
275
322
|
"placeholder"
|
|
@@ -305,7 +352,8 @@ function SelectClient({
|
|
|
305
352
|
type: "checkbox"
|
|
306
353
|
}
|
|
307
354
|
),
|
|
308
|
-
Boolean(args.iconVisible) &&
|
|
355
|
+
Boolean(args.iconVisible) && /* istanbul ignore next */
|
|
356
|
+
((_a = opt.icon) == null ? void 0 : _a.call(opt)),
|
|
309
357
|
opt.label
|
|
310
358
|
]
|
|
311
359
|
},
|
|
@@ -5,8 +5,14 @@ import SelectServer from "./Select.server.js";
|
|
|
5
5
|
const Select = createIsland({
|
|
6
6
|
name: "Select",
|
|
7
7
|
Server: SelectServer,
|
|
8
|
-
loadLazy:
|
|
9
|
-
|
|
8
|
+
loadLazy: (
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
/* @__PURE__ */ __name(() => import("./Select.lazy.js"), "loadLazy")
|
|
11
|
+
),
|
|
12
|
+
isInteractive: (
|
|
13
|
+
/* istanbul ignore next */
|
|
14
|
+
/* @__PURE__ */ __name(() => true, "isInteractive")
|
|
15
|
+
)
|
|
10
16
|
});
|
|
11
17
|
export {
|
|
12
18
|
Select
|
|
@@ -33,9 +33,16 @@ function SelectView({
|
|
|
33
33
|
const listId = `${id}-listbox`;
|
|
34
34
|
const errorId = isError ? `${id}-error` : void 0;
|
|
35
35
|
const helperId = hasHelper ? `${id}-helper` : void 0;
|
|
36
|
-
const open = Boolean(_clientState == null ? void 0 : _clientState.open) ??
|
|
36
|
+
const open = Boolean(_clientState == null ? void 0 : _clientState.open) ?? /* istanbul ignore next */
|
|
37
|
+
false;
|
|
37
38
|
const btnRef = _clientState == null ? void 0 : _clientState.buttonRef;
|
|
38
|
-
const selectedItems = Array.isArray(value) ?
|
|
39
|
+
const selectedItems = Array.isArray(value) ? (
|
|
40
|
+
/* istanbul ignore next */
|
|
41
|
+
items.filter(
|
|
42
|
+
/* istanbul ignore next */
|
|
43
|
+
(i) => value.includes(i.value)
|
|
44
|
+
)
|
|
45
|
+
) : items.filter((i) => i.value === value);
|
|
39
46
|
const display = selectedItems.length === 0 ? /* @__PURE__ */ jsx(
|
|
40
47
|
"span",
|
|
41
48
|
{
|
|
@@ -49,9 +56,11 @@ function SelectView({
|
|
|
49
56
|
) : /* @__PURE__ */ jsx("span", { className: bem("button__inner", { expanded: open }), children: selectedItems.map((i, idx) => {
|
|
50
57
|
var _a2;
|
|
51
58
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
|
-
Boolean(iconVisible) &&
|
|
59
|
+
Boolean(iconVisible) && /* istanbul ignore next */
|
|
60
|
+
((_a2 = i.icon) == null ? void 0 : _a2.call(i)),
|
|
53
61
|
i.label,
|
|
54
|
-
idx < selectedItems.length - 1 &&
|
|
62
|
+
idx < selectedItems.length - 1 && /* istanbul ignore next */
|
|
63
|
+
", "
|
|
55
64
|
] }, i == null ? void 0 : i.label);
|
|
56
65
|
}) });
|
|
57
66
|
return /* @__PURE__ */ jsxs(
|
|
@@ -101,7 +110,13 @@ function SelectView({
|
|
|
101
110
|
{
|
|
102
111
|
name,
|
|
103
112
|
type: "hidden",
|
|
104
|
-
value:
|
|
113
|
+
value: (
|
|
114
|
+
/* istanbul ignore next */
|
|
115
|
+
Array.isArray(value) ? (
|
|
116
|
+
/* istanbul ignore next */
|
|
117
|
+
value.join(",")
|
|
118
|
+
) : value ?? ""
|
|
119
|
+
)
|
|
105
120
|
}
|
|
106
121
|
),
|
|
107
122
|
(_a = _clientState == null ? void 0 : _clientState.renderListbox) == null ? void 0 : _a.call(_clientState, {
|
|
@@ -113,13 +128,22 @@ function SelectView({
|
|
|
113
128
|
placeholder,
|
|
114
129
|
items,
|
|
115
130
|
value: value ?? (Boolean(multiple) ? [] : ""),
|
|
116
|
-
onOptionClick:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
131
|
+
onOptionClick: (
|
|
132
|
+
/* istanbul ignore next */
|
|
133
|
+
/* @__PURE__ */ __name((opt) => {
|
|
134
|
+
var _a2;
|
|
135
|
+
return (_a2 = _clientState == null ? void 0 : _clientState.onOptionClick) == null ? void 0 : _a2.call(_clientState, opt);
|
|
136
|
+
}, "onOptionClick")
|
|
137
|
+
),
|
|
120
138
|
iconVisible,
|
|
121
|
-
bemItem:
|
|
122
|
-
|
|
139
|
+
bemItem: (
|
|
140
|
+
/* istanbul ignore next */
|
|
141
|
+
/* @__PURE__ */ __name((mods) => bem("item", mods), "bemItem")
|
|
142
|
+
),
|
|
143
|
+
bemCheckbox: (
|
|
144
|
+
/* istanbul ignore next */
|
|
145
|
+
/* @__PURE__ */ __name((mods) => bem("checkbox", mods), "bemCheckbox")
|
|
146
|
+
)
|
|
123
147
|
})
|
|
124
148
|
] }),
|
|
125
149
|
(isError || Boolean(helperText)) && /* @__PURE__ */ jsx(
|
|
@@ -5,9 +5,15 @@ import SideNavServer from "./SideNav.server.js";
|
|
|
5
5
|
const SideNav = createIsland({
|
|
6
6
|
name: "SideNav",
|
|
7
7
|
Server: SideNavServer,
|
|
8
|
-
loadLazy:
|
|
8
|
+
loadLazy: (
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
/* @__PURE__ */ __name(() => import("./SideNav.lazy.js"), "loadLazy")
|
|
11
|
+
),
|
|
9
12
|
// Sidebar is *always* interactive (toggle button)
|
|
10
|
-
isInteractive:
|
|
13
|
+
isInteractive: (
|
|
14
|
+
/* istanbul ignore next */
|
|
15
|
+
/* @__PURE__ */ __name(() => true, "isInteractive")
|
|
16
|
+
)
|
|
11
17
|
});
|
|
12
18
|
export {
|
|
13
19
|
SideNav
|
|
@@ -35,6 +35,7 @@ function SliderClient(props) {
|
|
|
35
35
|
return [];
|
|
36
36
|
}, [marks, min, max, step]);
|
|
37
37
|
const snapToStep = useCallback(
|
|
38
|
+
/* istanbul ignore next */
|
|
38
39
|
(v) => clamp(step > 0 ? Math.round((v - min) / step) * step + min : v),
|
|
39
40
|
[clamp, step, min]
|
|
40
41
|
);
|
|
@@ -75,9 +76,17 @@ function SliderClient(props) {
|
|
|
75
76
|
const [internalValue, setInternalValue] = useState(initial);
|
|
76
77
|
useEffect(() => {
|
|
77
78
|
if (controlledValue !== void 0) {
|
|
78
|
-
const n = typeof controlledValue === "number" ? controlledValue : typeof controlledValue === "string" ? Number(controlledValue) :
|
|
79
|
+
const n = typeof controlledValue === "number" ? controlledValue : typeof controlledValue === "string" ? Number(controlledValue) : (
|
|
80
|
+
/* istanbul ignore next */
|
|
81
|
+
min
|
|
82
|
+
);
|
|
79
83
|
const q = quantize(n);
|
|
80
|
-
setInternalValue(
|
|
84
|
+
setInternalValue(
|
|
85
|
+
(prev) => prev === q ? prev : (
|
|
86
|
+
/* istanbul ignore next */
|
|
87
|
+
q
|
|
88
|
+
)
|
|
89
|
+
);
|
|
81
90
|
}
|
|
82
91
|
}, [controlledValue, min, quantize]);
|
|
83
92
|
const [isFocused, setIsFocused] = useState(false);
|
|
@@ -5,7 +5,10 @@ import SliderServer from "./Slider.server.js";
|
|
|
5
5
|
const Slider = createIsland({
|
|
6
6
|
name: "Slider",
|
|
7
7
|
Server: SliderServer,
|
|
8
|
-
loadLazy:
|
|
8
|
+
loadLazy: (
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
/* @__PURE__ */ __name(() => import("./Slider.lazy.js"), "loadLazy")
|
|
11
|
+
)
|
|
9
12
|
});
|
|
10
13
|
export {
|
|
11
14
|
Slider
|
|
@@ -14,8 +14,16 @@ const SliderView = /* @__PURE__ */ __name(({
|
|
|
14
14
|
required,
|
|
15
15
|
disabled,
|
|
16
16
|
// Defaultwerte für min, max, step:
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
/* istanbul ignore next */
|
|
18
|
+
min = (
|
|
19
|
+
/* istanbul ignore next */
|
|
20
|
+
0
|
|
21
|
+
),
|
|
22
|
+
/* istanbul ignore next */
|
|
23
|
+
max = (
|
|
24
|
+
/* istanbul ignore next */
|
|
25
|
+
100
|
|
26
|
+
),
|
|
19
27
|
step = 1,
|
|
20
28
|
marks = false,
|
|
21
29
|
valueLabelProps = {},
|
|
@@ -27,8 +35,23 @@ const SliderView = /* @__PURE__ */ __name(({
|
|
|
27
35
|
onChangeInternal
|
|
28
36
|
}) => {
|
|
29
37
|
var _a;
|
|
30
|
-
const clamped =
|
|
31
|
-
|
|
38
|
+
const clamped = (
|
|
39
|
+
/* istanbul ignore next */
|
|
40
|
+
internalValue < min ? (
|
|
41
|
+
/* istanbul ignore next */
|
|
42
|
+
min
|
|
43
|
+
) : (
|
|
44
|
+
/* istanbul ignore next */
|
|
45
|
+
internalValue > max ? (
|
|
46
|
+
/* istanbul ignore next */
|
|
47
|
+
max
|
|
48
|
+
) : internalValue
|
|
49
|
+
)
|
|
50
|
+
);
|
|
51
|
+
const pct = max > min ? (clamped - min) / (max - min) * 100 : (
|
|
52
|
+
/* istanbul ignore next */
|
|
53
|
+
0
|
|
54
|
+
);
|
|
32
55
|
let markPoints = [];
|
|
33
56
|
if (Array.isArray(marks)) {
|
|
34
57
|
markPoints = marks;
|
|
@@ -61,7 +84,22 @@ const SliderView = /* @__PURE__ */ __name(({
|
|
|
61
84
|
/* @__PURE__ */ jsx("div", { className: bem("rail") }),
|
|
62
85
|
/* @__PURE__ */ jsx("div", { className: bem("track"), style: { width: `${pct}%` } }),
|
|
63
86
|
markPoints.map((m) => {
|
|
64
|
-
const leftPct = max > min ? (
|
|
87
|
+
const leftPct = max > min ? (
|
|
88
|
+
/* istanbul ignore next */
|
|
89
|
+
((m.value < min ? (
|
|
90
|
+
/* istanbul ignore next */
|
|
91
|
+
min
|
|
92
|
+
) : (
|
|
93
|
+
/* istanbul ignore next */
|
|
94
|
+
m.value > max ? (
|
|
95
|
+
/* istanbul ignore next */
|
|
96
|
+
max
|
|
97
|
+
) : m.value
|
|
98
|
+
)) - min) / (max - min) * 100
|
|
99
|
+
) : (
|
|
100
|
+
/* istanbul ignore next */
|
|
101
|
+
0
|
|
102
|
+
);
|
|
65
103
|
return /* @__PURE__ */ jsx(
|
|
66
104
|
"div",
|
|
67
105
|
{
|
|
@@ -5,7 +5,11 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { memo, useState, useRef, useCallback, useEffect } from "react";
|
|
6
6
|
import { SnackbarView } from "./Snackbar.view.js";
|
|
7
7
|
function SnackbarClient({
|
|
8
|
-
|
|
8
|
+
/* istanbul ignore next */
|
|
9
|
+
open: openProp = (
|
|
10
|
+
/* istanbul ignore next */
|
|
11
|
+
false
|
|
12
|
+
),
|
|
9
13
|
autoHideDuration = 6e3,
|
|
10
14
|
onClose,
|
|
11
15
|
...rest
|
|
@@ -5,7 +5,10 @@ import SnackbarServer from "./Snackbar.server.js";
|
|
|
5
5
|
const Snackbar = createIsland({
|
|
6
6
|
name: "Snackbar",
|
|
7
7
|
Server: SnackbarServer,
|
|
8
|
-
loadLazy:
|
|
8
|
+
loadLazy: (
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
/* @__PURE__ */ __name(() => import("./Snackbar.lazy.js"), "loadLazy")
|
|
11
|
+
)
|
|
9
12
|
});
|
|
10
13
|
export {
|
|
11
14
|
Snackbar
|
|
@@ -6,8 +6,14 @@ const SnackbarProvider = createIsland({
|
|
|
6
6
|
name: "SnackbarProvider",
|
|
7
7
|
Server: /* @__PURE__ */ __name(({ children }) => /* @__PURE__ */ jsx(Fragment, { children }), "Server"),
|
|
8
8
|
// renders nothing on SSR
|
|
9
|
-
loadLazy:
|
|
10
|
-
|
|
9
|
+
loadLazy: (
|
|
10
|
+
/* istanbul ignore next */
|
|
11
|
+
/* @__PURE__ */ __name(() => import("./SnackbarProvider.lazy.js"), "loadLazy")
|
|
12
|
+
),
|
|
13
|
+
isInteractive: (
|
|
14
|
+
/* istanbul ignore next */
|
|
15
|
+
/* @__PURE__ */ __name(() => true, "isInteractive")
|
|
16
|
+
)
|
|
11
17
|
});
|
|
12
18
|
export {
|
|
13
19
|
SnackbarProvider
|
|
@@ -98,9 +98,12 @@ const StepperClient = forwardRef((props, ref) => {
|
|
|
98
98
|
(_c = (_b = (_a = steps == null ? void 0 : steps[i]) == null ? void 0 : _a.innerContainerProps) == null ? void 0 : _b.onBlur) == null ? void 0 : _c.call(_b, e);
|
|
99
99
|
}, "onBlur"),
|
|
100
100
|
// Capture the <div role="button"> element in stepRefs.current[i]
|
|
101
|
-
ref:
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
ref: (
|
|
102
|
+
/* istanbul ignore next */
|
|
103
|
+
/* @__PURE__ */ __name((el) => {
|
|
104
|
+
stepRefs.current[i] = el;
|
|
105
|
+
}, "ref")
|
|
106
|
+
)
|
|
104
107
|
}
|
|
105
108
|
};
|
|
106
109
|
}),
|
|
@@ -5,7 +5,10 @@ import StepperServer from "./Stepper.server.js";
|
|
|
5
5
|
const Stepper = createIsland({
|
|
6
6
|
name: "Stepper",
|
|
7
7
|
Server: StepperServer,
|
|
8
|
-
loadLazy:
|
|
8
|
+
loadLazy: (
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
/* @__PURE__ */ __name(() => import("./Stepper.lazy.js"), "loadLazy")
|
|
11
|
+
)
|
|
9
12
|
});
|
|
10
13
|
export {
|
|
11
14
|
Stepper
|
|
@@ -5,7 +5,10 @@ import SwitchServer from "./Switch.server.js";
|
|
|
5
5
|
const Switch = createIsland({
|
|
6
6
|
name: "Switch",
|
|
7
7
|
Server: SwitchServer,
|
|
8
|
-
loadLazy:
|
|
8
|
+
loadLazy: (
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
/* @__PURE__ */ __name(() => import("./Switch.lazy.js"), "loadLazy")
|
|
11
|
+
)
|
|
9
12
|
});
|
|
10
13
|
export {
|
|
11
14
|
Switch
|
|
@@ -52,6 +52,7 @@ const Table = /* @__PURE__ */ __name(({
|
|
|
52
52
|
"tr",
|
|
53
53
|
{
|
|
54
54
|
className: bem("body__row", {
|
|
55
|
+
/* istanbul ignore next */
|
|
55
56
|
"has-link": isString((_a = row == null ? void 0 : row.redirect) == null ? void 0 : _a.href)
|
|
56
57
|
}),
|
|
57
58
|
children: row == null ? void 0 : row.cells.filter((el) => el !== null).map((cell, b) => /* @__PURE__ */ createElement(
|
|
@@ -74,6 +74,7 @@ function TabsClient({
|
|
|
74
74
|
[disabled, isControlled, items, onChange]
|
|
75
75
|
);
|
|
76
76
|
const moveFocus = useCallback(
|
|
77
|
+
/* istanbul ignore next */
|
|
77
78
|
(currentIndex, direction) => {
|
|
78
79
|
if (!enabledIndices.length) return currentIndex;
|
|
79
80
|
const currentEnabledPos = enabledIndices.findIndex(
|