@helpwave/hightide 0.1.37 → 0.1.39
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/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/TimeDisplay.js.map +1 -1
- package/dist/components/date/TimeDisplay.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/date/index.js.map +1 -1
- package/dist/components/date/index.mjs.map +1 -1
- package/dist/components/dialog/ConfirmDialog.js +15 -9
- package/dist/components/dialog/ConfirmDialog.js.map +1 -1
- package/dist/components/dialog/ConfirmDialog.mjs +16 -10
- package/dist/components/dialog/ConfirmDialog.mjs.map +1 -1
- package/dist/components/dialog/Dialog.d.mts +4 -5
- package/dist/components/dialog/Dialog.d.ts +4 -5
- package/dist/components/dialog/Dialog.js +15 -9
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/dialog/Dialog.mjs +16 -10
- package/dist/components/dialog/Dialog.mjs.map +1 -1
- package/dist/components/dialog/DiscardChangesDialog.js +15 -9
- package/dist/components/dialog/DiscardChangesDialog.js.map +1 -1
- package/dist/components/dialog/DiscardChangesDialog.mjs +16 -10
- package/dist/components/dialog/DiscardChangesDialog.mjs.map +1 -1
- package/dist/components/dialog/InputDialog.js +15 -9
- package/dist/components/dialog/InputDialog.js.map +1 -1
- package/dist/components/dialog/InputDialog.mjs +16 -10
- package/dist/components/dialog/InputDialog.mjs.map +1 -1
- package/dist/components/dialog/LanguageDialog.js +188 -154
- package/dist/components/dialog/LanguageDialog.js.map +1 -1
- package/dist/components/dialog/LanguageDialog.mjs +151 -116
- package/dist/components/dialog/LanguageDialog.mjs.map +1 -1
- package/dist/components/dialog/ThemeDialog.js +191 -157
- package/dist/components/dialog/ThemeDialog.js.map +1 -1
- package/dist/components/dialog/ThemeDialog.mjs +151 -116
- package/dist/components/dialog/ThemeDialog.mjs.map +1 -1
- package/dist/components/dialog/index.js +205 -171
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/index.mjs +152 -117
- package/dist/components/dialog/index.mjs.map +1 -1
- package/dist/components/index.js +337 -299
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +198 -159
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/layout/Carousel.d.mts +2 -1
- package/dist/components/layout/Carousel.d.ts +2 -1
- package/dist/components/layout/Carousel.js +4 -0
- package/dist/components/layout/Carousel.js.map +1 -1
- package/dist/components/layout/Carousel.mjs +4 -0
- package/dist/components/layout/Carousel.mjs.map +1 -1
- package/dist/components/layout/TextImage.js.map +1 -1
- package/dist/components/layout/TextImage.mjs.map +1 -1
- package/dist/components/layout/index.js +4 -0
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/index.mjs +4 -0
- package/dist/components/layout/index.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/loading-states/index.js.map +1 -1
- package/dist/components/loading-states/index.mjs.map +1 -1
- package/dist/components/navigation/Pagination.js.map +1 -1
- package/dist/components/navigation/Pagination.mjs.map +1 -1
- package/dist/components/navigation/StepperBar.js.map +1 -1
- package/dist/components/navigation/StepperBar.mjs.map +1 -1
- package/dist/components/navigation/index.js.map +1 -1
- package/dist/components/navigation/index.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.js +129 -101
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +131 -102
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.js +129 -101
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +131 -102
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/properties/index.js +129 -101
- package/dist/components/properties/index.js.map +1 -1
- package/dist/components/properties/index.mjs +131 -102
- package/dist/components/properties/index.mjs.map +1 -1
- package/dist/components/table/Table.js.map +1 -1
- package/dist/components/table/Table.mjs.map +1 -1
- package/dist/components/table/TableFilterButton.js.map +1 -1
- package/dist/components/table/TableFilterButton.mjs.map +1 -1
- package/dist/components/table/index.js.map +1 -1
- package/dist/components/table/index.mjs.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.js.map +1 -1
- package/dist/components/user-action/CopyToClipboardWrapper.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/SearchBar.js.map +1 -1
- package/dist/components/user-action/SearchBar.mjs.map +1 -1
- package/dist/components/user-action/index.js +129 -101
- package/dist/components/user-action/index.js.map +1 -1
- package/dist/components/user-action/index.mjs +131 -102
- package/dist/components/user-action/index.mjs.map +1 -1
- package/dist/components/user-action/select/Select.d.mts +2 -0
- package/dist/components/user-action/select/Select.d.ts +2 -0
- package/dist/components/user-action/select/Select.js +129 -101
- package/dist/components/user-action/select/Select.js.map +1 -1
- package/dist/components/user-action/select/Select.mjs +131 -102
- package/dist/components/user-action/select/Select.mjs.map +1 -1
- package/dist/components/user-action/select/index.js +129 -101
- package/dist/components/user-action/select/index.js.map +1 -1
- package/dist/components/user-action/select/index.mjs +131 -102
- package/dist/components/user-action/select/index.mjs.map +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/useValidators.js.map +1 -1
- package/dist/hooks/useValidators.mjs.map +1 -1
- package/dist/index.js +362 -324
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +206 -167
- package/dist/index.mjs.map +1 -1
- package/dist/localization/LanguageProvider.js +1 -1
- package/dist/localization/LanguageProvider.js.map +1 -1
- package/dist/localization/LanguageProvider.mjs +1 -1
- package/dist/localization/LanguageProvider.mjs.map +1 -1
- package/dist/localization/index.js +1 -1
- package/dist/localization/index.js.map +1 -1
- package/dist/localization/index.mjs +1 -1
- package/dist/localization/index.mjs.map +1 -1
- package/dist/localization/useTranslation.js.map +1 -1
- package/dist/localization/useTranslation.mjs.map +1 -1
- package/dist/style/globals.css +0 -3
- package/dist/theming/index.js +1 -1
- package/dist/theming/index.js.map +1 -1
- package/dist/theming/index.mjs +1 -1
- package/dist/theming/index.mjs.map +1 -1
- package/dist/theming/useTheme.js +1 -1
- package/dist/theming/useTheme.js.map +1 -1
- package/dist/theming/useTheme.mjs +1 -1
- package/dist/theming/useTheme.mjs.map +1 -1
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -7827,7 +7827,6 @@ var import_clsx10 = __toESM(require("clsx"));
|
|
|
7827
7827
|
// src/components/dialog/Dialog.tsx
|
|
7828
7828
|
var import_react13 = require("react");
|
|
7829
7829
|
var import_react14 = require("react");
|
|
7830
|
-
var import_react15 = require("react");
|
|
7831
7830
|
var import_clsx9 = __toESM(require("clsx"));
|
|
7832
7831
|
var import_lucide_react3 = require("lucide-react");
|
|
7833
7832
|
|
|
@@ -8190,15 +8189,18 @@ var Dialog = ({
|
|
|
8190
8189
|
description,
|
|
8191
8190
|
isModal = true,
|
|
8192
8191
|
onClose,
|
|
8193
|
-
className,
|
|
8194
8192
|
backgroundClassName,
|
|
8195
8193
|
position = "center",
|
|
8196
|
-
isAnimated = true
|
|
8194
|
+
isAnimated = true,
|
|
8195
|
+
containerClassName,
|
|
8196
|
+
...props
|
|
8197
8197
|
}) => {
|
|
8198
8198
|
const translation = useTranslation([formTranslation]);
|
|
8199
8199
|
const [visible, setVisible] = (0, import_react14.useState)(isOpen);
|
|
8200
|
-
const
|
|
8201
|
-
|
|
8200
|
+
const generatedId = (0, import_react13.useId)();
|
|
8201
|
+
const id = props.id ?? generatedId;
|
|
8202
|
+
const ref = (0, import_react14.useRef)(null);
|
|
8203
|
+
(0, import_react14.useEffect)(() => {
|
|
8202
8204
|
if (isOpen) {
|
|
8203
8205
|
setVisible(true);
|
|
8204
8206
|
} else {
|
|
@@ -8223,14 +8225,16 @@ var Dialog = ({
|
|
|
8223
8225
|
none: ""
|
|
8224
8226
|
};
|
|
8225
8227
|
const positionStyle = positionMap[position];
|
|
8228
|
+
if (!visible) return;
|
|
8226
8229
|
return (0, import_react_dom.createPortal)(
|
|
8227
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
8230
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { id: `dialog-container-${id}`, className: (0, import_clsx9.default)("fixed inset-0 h-screen w-screen", containerClassName), children: [
|
|
8228
8231
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
8229
8232
|
"div",
|
|
8230
8233
|
{
|
|
8234
|
+
id: `dialog-background-${id}`,
|
|
8231
8235
|
hidden: !visible,
|
|
8232
8236
|
className: (0, import_clsx9.default)(
|
|
8233
|
-
"fixed inset-0 h-screen w-screen bg-overlay-shadow
|
|
8237
|
+
"fixed inset-0 h-screen w-screen bg-overlay-shadow",
|
|
8234
8238
|
{
|
|
8235
8239
|
"motion-safe:animate-fade-in": isOpen,
|
|
8236
8240
|
"motion-safe:animate-fade-out": !isOpen
|
|
@@ -8249,6 +8253,8 @@ var Dialog = ({
|
|
|
8249
8253
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
8250
8254
|
"div",
|
|
8251
8255
|
{
|
|
8256
|
+
...props,
|
|
8257
|
+
id: `dialog-${id}`,
|
|
8252
8258
|
ref,
|
|
8253
8259
|
hidden: !visible,
|
|
8254
8260
|
onKeyDown: (event) => {
|
|
@@ -8262,13 +8268,13 @@ var Dialog = ({
|
|
|
8262
8268
|
}
|
|
8263
8269
|
},
|
|
8264
8270
|
className: (0, import_clsx9.default)(
|
|
8265
|
-
"flex-col-2 p-4 bg-overlay-background text-overlay-text rounded-xl shadow-hw-bottom max-w-[calc(100vw_-_2rem)] max-h-[calc(100vh_-_2rem)]
|
|
8271
|
+
"flex-col-2 p-4 bg-overlay-background text-overlay-text rounded-xl shadow-hw-bottom max-w-[calc(100vw_-_2rem)] max-h-[calc(100vh_-_2rem)]",
|
|
8266
8272
|
{
|
|
8267
8273
|
"motion-safe:animate-pop-in": isOpen,
|
|
8268
8274
|
"motion-safe:animate-pop-out": !isOpen
|
|
8269
8275
|
},
|
|
8270
8276
|
positionStyle,
|
|
8271
|
-
className
|
|
8277
|
+
props.className
|
|
8272
8278
|
),
|
|
8273
8279
|
children: [
|
|
8274
8280
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "typography-title-lg mr-8", children: titleElement }),
|
|
@@ -8385,17 +8391,17 @@ var DiscardChangesDialog = ({
|
|
|
8385
8391
|
};
|
|
8386
8392
|
|
|
8387
8393
|
// src/components/user-action/input/Input.tsx
|
|
8388
|
-
var
|
|
8394
|
+
var import_react17 = require("react");
|
|
8389
8395
|
var import_clsx11 = __toESM(require("clsx"));
|
|
8390
8396
|
|
|
8391
8397
|
// src/hooks/useDelay.ts
|
|
8392
|
-
var
|
|
8398
|
+
var import_react15 = require("react");
|
|
8393
8399
|
var defaultOptions2 = {
|
|
8394
8400
|
delay: 3e3,
|
|
8395
8401
|
disabled: false
|
|
8396
8402
|
};
|
|
8397
8403
|
function useDelay(options) {
|
|
8398
|
-
const [timer, setTimer] = (0,
|
|
8404
|
+
const [timer, setTimer] = (0, import_react15.useState)(void 0);
|
|
8399
8405
|
const { delay, disabled } = {
|
|
8400
8406
|
...defaultOptions2,
|
|
8401
8407
|
...options
|
|
@@ -8414,12 +8420,12 @@ function useDelay(options) {
|
|
|
8414
8420
|
setTimer(void 0);
|
|
8415
8421
|
}, delay));
|
|
8416
8422
|
};
|
|
8417
|
-
(0,
|
|
8423
|
+
(0, import_react15.useEffect)(() => {
|
|
8418
8424
|
return () => {
|
|
8419
8425
|
clearTimeout(timer);
|
|
8420
8426
|
};
|
|
8421
8427
|
}, [timer]);
|
|
8422
|
-
(0,
|
|
8428
|
+
(0, import_react15.useEffect)(() => {
|
|
8423
8429
|
if (disabled) {
|
|
8424
8430
|
clearTimeout(timer);
|
|
8425
8431
|
setTimer(void 0);
|
|
@@ -8429,9 +8435,9 @@ function useDelay(options) {
|
|
|
8429
8435
|
}
|
|
8430
8436
|
|
|
8431
8437
|
// src/hooks/focus/useFocusManagement.ts
|
|
8432
|
-
var
|
|
8438
|
+
var import_react16 = require("react");
|
|
8433
8439
|
function useFocusManagement() {
|
|
8434
|
-
const getFocusableElements = (0,
|
|
8440
|
+
const getFocusableElements = (0, import_react16.useCallback)(() => {
|
|
8435
8441
|
return Array.from(
|
|
8436
8442
|
document.querySelectorAll(
|
|
8437
8443
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -8440,7 +8446,7 @@ function useFocusManagement() {
|
|
|
8440
8446
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
8441
8447
|
);
|
|
8442
8448
|
}, []);
|
|
8443
|
-
const getNextFocusElement = (0,
|
|
8449
|
+
const getNextFocusElement = (0, import_react16.useCallback)(() => {
|
|
8444
8450
|
const elements = getFocusableElements();
|
|
8445
8451
|
if (elements.length === 0) {
|
|
8446
8452
|
return void 0;
|
|
@@ -8452,11 +8458,11 @@ function useFocusManagement() {
|
|
|
8452
8458
|
}
|
|
8453
8459
|
return nextElement;
|
|
8454
8460
|
}, [getFocusableElements]);
|
|
8455
|
-
const focusNext = (0,
|
|
8461
|
+
const focusNext = (0, import_react16.useCallback)(() => {
|
|
8456
8462
|
const nextElement = getNextFocusElement();
|
|
8457
8463
|
nextElement?.focus();
|
|
8458
8464
|
}, [getNextFocusElement]);
|
|
8459
|
-
const getPreviousFocusElement = (0,
|
|
8465
|
+
const getPreviousFocusElement = (0, import_react16.useCallback)(() => {
|
|
8460
8466
|
const elements = getFocusableElements();
|
|
8461
8467
|
if (elements.length === 0) {
|
|
8462
8468
|
return void 0;
|
|
@@ -8472,7 +8478,7 @@ function useFocusManagement() {
|
|
|
8472
8478
|
}
|
|
8473
8479
|
return previousElement;
|
|
8474
8480
|
}, [getFocusableElements]);
|
|
8475
|
-
const focusPrevious = (0,
|
|
8481
|
+
const focusPrevious = (0, import_react16.useCallback)(() => {
|
|
8476
8482
|
const previousElement = getPreviousFocusElement();
|
|
8477
8483
|
if (previousElement) previousElement.focus();
|
|
8478
8484
|
}, [getPreviousFocusElement]);
|
|
@@ -8493,7 +8499,7 @@ var defaultEditCompleteOptions = {
|
|
|
8493
8499
|
afterDelay: true,
|
|
8494
8500
|
delay: 2500
|
|
8495
8501
|
};
|
|
8496
|
-
var Input = (0,
|
|
8502
|
+
var Input = (0, import_react17.forwardRef)(function Input2({
|
|
8497
8503
|
value,
|
|
8498
8504
|
onChange,
|
|
8499
8505
|
onChangeText,
|
|
@@ -8515,8 +8521,8 @@ var Input = (0, import_react18.forwardRef)(function Input2({
|
|
|
8515
8521
|
restartTimer,
|
|
8516
8522
|
clearTimer
|
|
8517
8523
|
} = useDelay({ delay, disabled: !afterDelay });
|
|
8518
|
-
const innerRef = (0,
|
|
8519
|
-
(0,
|
|
8524
|
+
const innerRef = (0, import_react17.useRef)(null);
|
|
8525
|
+
(0, import_react17.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
8520
8526
|
const { focusNext } = useFocusManagement();
|
|
8521
8527
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8522
8528
|
"input",
|
|
@@ -8601,7 +8607,7 @@ var InputDialog = ({
|
|
|
8601
8607
|
};
|
|
8602
8608
|
|
|
8603
8609
|
// src/components/user-action/select/Select.tsx
|
|
8604
|
-
var
|
|
8610
|
+
var import_react19 = require("react");
|
|
8605
8611
|
var import_clsx13 = __toESM(require("clsx"));
|
|
8606
8612
|
|
|
8607
8613
|
// src/utils/match.ts
|
|
@@ -8695,7 +8701,7 @@ var ChipList = ({
|
|
|
8695
8701
|
};
|
|
8696
8702
|
|
|
8697
8703
|
// src/hooks/useFloatingElement.ts
|
|
8698
|
-
var
|
|
8704
|
+
var import_react18 = require("react");
|
|
8699
8705
|
|
|
8700
8706
|
// src/utils/math.ts
|
|
8701
8707
|
var clamp = (value, range2 = [0, 1]) => {
|
|
@@ -8758,9 +8764,9 @@ function useFloatingElement({
|
|
|
8758
8764
|
screenPadding = 16,
|
|
8759
8765
|
gap = 4
|
|
8760
8766
|
}) {
|
|
8761
|
-
const [style, setStyle] = (0,
|
|
8767
|
+
const [style, setStyle] = (0, import_react18.useState)();
|
|
8762
8768
|
const isMounted = useIsMounted();
|
|
8763
|
-
const calculate = (0,
|
|
8769
|
+
const calculate = (0, import_react18.useCallback)(() => {
|
|
8764
8770
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
8765
8771
|
const windowRect = windowRef?.current.getBoundingClientRect() ?? {
|
|
8766
8772
|
top: 0,
|
|
@@ -8790,14 +8796,14 @@ function useFloatingElement({
|
|
|
8790
8796
|
}, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef]);
|
|
8791
8797
|
const height = containerRef.current?.getBoundingClientRect().height;
|
|
8792
8798
|
const width = containerRef.current?.getBoundingClientRect().width;
|
|
8793
|
-
(0,
|
|
8799
|
+
(0, import_react18.useEffect)(() => {
|
|
8794
8800
|
if (active && isMounted) {
|
|
8795
8801
|
calculate();
|
|
8796
8802
|
} else {
|
|
8797
8803
|
setStyle(void 0);
|
|
8798
8804
|
}
|
|
8799
8805
|
}, [calculate, active, isMounted, height, width]);
|
|
8800
|
-
(0,
|
|
8806
|
+
(0, import_react18.useEffect)(() => {
|
|
8801
8807
|
window.addEventListener("resize", calculate);
|
|
8802
8808
|
let timeout;
|
|
8803
8809
|
if (isPolling) {
|
|
@@ -8817,11 +8823,11 @@ function useFloatingElement({
|
|
|
8817
8823
|
var import_react_dom2 = require("react-dom");
|
|
8818
8824
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
8819
8825
|
var defaultToggleOpenOptions = {
|
|
8820
|
-
|
|
8826
|
+
highlightStartPositionBehavior: "first"
|
|
8821
8827
|
};
|
|
8822
|
-
var SelectContext = (0,
|
|
8828
|
+
var SelectContext = (0, import_react19.createContext)(null);
|
|
8823
8829
|
function useSelectContext() {
|
|
8824
|
-
const ctx = (0,
|
|
8830
|
+
const ctx = (0, import_react19.useContext)(SelectContext);
|
|
8825
8831
|
if (!ctx) {
|
|
8826
8832
|
throw new Error("SelectContext must be used within a ListBoxPrimitive");
|
|
8827
8833
|
}
|
|
@@ -8840,47 +8846,62 @@ var SelectRoot = ({
|
|
|
8840
8846
|
isMultiSelect = false,
|
|
8841
8847
|
iconAppearance = "left"
|
|
8842
8848
|
}) => {
|
|
8843
|
-
const
|
|
8844
|
-
const
|
|
8845
|
-
const generatedId = (0, import_react20.useId)();
|
|
8849
|
+
const triggerRef = (0, import_react19.useRef)(null);
|
|
8850
|
+
const generatedId = (0, import_react19.useId)();
|
|
8846
8851
|
const usedId = id ?? generatedId;
|
|
8847
|
-
const [internalState, setInternalState] = (0,
|
|
8848
|
-
isOpen
|
|
8852
|
+
const [internalState, setInternalState] = (0, import_react19.useState)({
|
|
8853
|
+
isOpen,
|
|
8854
|
+
options: []
|
|
8849
8855
|
});
|
|
8850
|
-
const selectedValues =
|
|
8856
|
+
const selectedValues = (0, import_react19.useMemo)(
|
|
8857
|
+
() => isMultiSelect ? values ?? [] : [value].filter(Boolean),
|
|
8858
|
+
[isMultiSelect, value, values]
|
|
8859
|
+
);
|
|
8860
|
+
const selectedOptions = (0, import_react19.useMemo)(
|
|
8861
|
+
() => selectedValues.map((value2) => internalState.options.find((option) => value2 === option.value)).filter(Boolean),
|
|
8862
|
+
[selectedValues, internalState.options]
|
|
8863
|
+
);
|
|
8851
8864
|
const state = {
|
|
8852
8865
|
...internalState,
|
|
8853
8866
|
id: usedId,
|
|
8854
8867
|
disabled,
|
|
8855
8868
|
invalid,
|
|
8856
8869
|
value: selectedValues,
|
|
8857
|
-
|
|
8858
|
-
selectedOptions: selectedValues.map((value2) => options.find((option) => value2 === option.value)).filter(Boolean)
|
|
8870
|
+
selectedOptions
|
|
8859
8871
|
};
|
|
8860
8872
|
const config = {
|
|
8861
8873
|
isMultiSelect,
|
|
8862
8874
|
iconAppearance
|
|
8863
8875
|
};
|
|
8864
|
-
const registerItem = (0,
|
|
8865
|
-
|
|
8866
|
-
const
|
|
8867
|
-
|
|
8876
|
+
const registerItem = (0, import_react19.useCallback)((item) => {
|
|
8877
|
+
setInternalState((prev) => {
|
|
8878
|
+
const updatedOptions = [...prev.options, item];
|
|
8879
|
+
updatedOptions.sort((a, b) => {
|
|
8868
8880
|
const aEl = a.ref.current;
|
|
8869
8881
|
const bEl = b.ref.current;
|
|
8870
8882
|
if (!aEl || !bEl) return 0;
|
|
8871
8883
|
return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
8872
8884
|
});
|
|
8873
|
-
return
|
|
8885
|
+
return {
|
|
8886
|
+
...prev,
|
|
8887
|
+
options: updatedOptions
|
|
8888
|
+
};
|
|
8874
8889
|
});
|
|
8875
8890
|
}, []);
|
|
8876
|
-
const unregisterItem = (0,
|
|
8877
|
-
|
|
8891
|
+
const unregisterItem = (0, import_react19.useCallback)((value2) => {
|
|
8892
|
+
setInternalState((prev) => {
|
|
8893
|
+
const updatedOptions = prev.options.filter((i) => i.value !== value2);
|
|
8894
|
+
return {
|
|
8895
|
+
...prev,
|
|
8896
|
+
options: updatedOptions
|
|
8897
|
+
};
|
|
8898
|
+
});
|
|
8878
8899
|
}, []);
|
|
8879
8900
|
const toggleSelection = (value2, isSelected) => {
|
|
8880
8901
|
if (disabled) {
|
|
8881
8902
|
return;
|
|
8882
8903
|
}
|
|
8883
|
-
const option = options.find((i) => i.value === value2);
|
|
8904
|
+
const option = state.options.find((i) => i.value === value2);
|
|
8884
8905
|
if (!option) {
|
|
8885
8906
|
console.error(`SelectOption with value: ${value2} not found`);
|
|
8886
8907
|
return;
|
|
@@ -8916,42 +8937,47 @@ var SelectRoot = ({
|
|
|
8916
8937
|
highlightedValue: value2
|
|
8917
8938
|
}));
|
|
8918
8939
|
};
|
|
8919
|
-
const registerTrigger = (0,
|
|
8940
|
+
const registerTrigger = (0, import_react19.useCallback)((ref) => {
|
|
8920
8941
|
triggerRef.current = ref.current;
|
|
8921
8942
|
}, []);
|
|
8922
|
-
const unregisterTrigger = (0,
|
|
8943
|
+
const unregisterTrigger = (0, import_react19.useCallback)(() => {
|
|
8923
8944
|
triggerRef.current = null;
|
|
8924
8945
|
}, []);
|
|
8925
8946
|
const toggleOpen = (isOpen2, toggleOpenOptions) => {
|
|
8926
|
-
const {
|
|
8927
|
-
let
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8947
|
+
const { highlightStartPositionBehavior } = { ...defaultToggleOpenOptions, ...toggleOpenOptions };
|
|
8948
|
+
let firstSelectedValue;
|
|
8949
|
+
let firstEnabledValue;
|
|
8950
|
+
for (let i = 0; i < state.options.length; i++) {
|
|
8951
|
+
const currentOption = state.options[highlightStartPositionBehavior === "first" ? i : state.options.length - i - 1];
|
|
8952
|
+
if (!currentOption.disabled) {
|
|
8953
|
+
if (!firstEnabledValue) {
|
|
8954
|
+
firstEnabledValue = currentOption.value;
|
|
8955
|
+
}
|
|
8956
|
+
if (selectedValues.includes(currentOption.value)) {
|
|
8957
|
+
firstSelectedValue = currentOption.value;
|
|
8958
|
+
break;
|
|
8959
|
+
}
|
|
8960
|
+
}
|
|
8935
8961
|
}
|
|
8936
8962
|
setInternalState((prevState) => ({
|
|
8937
8963
|
...prevState,
|
|
8938
8964
|
isOpen: isOpen2 ?? !prevState.isOpen,
|
|
8939
|
-
highlightedValue:
|
|
8965
|
+
highlightedValue: firstSelectedValue ?? firstEnabledValue
|
|
8940
8966
|
}));
|
|
8941
8967
|
};
|
|
8942
8968
|
const moveHighlightedIndex = (delta) => {
|
|
8943
|
-
let highlightedIndex = options.findIndex((value2) => value2.value === internalState.highlightedValue);
|
|
8969
|
+
let highlightedIndex = state.options.findIndex((value2) => value2.value === internalState.highlightedValue);
|
|
8944
8970
|
if (highlightedIndex === -1) {
|
|
8945
8971
|
highlightedIndex = 0;
|
|
8946
8972
|
}
|
|
8947
|
-
const optionLength = options.length;
|
|
8973
|
+
const optionLength = state.options.length;
|
|
8948
8974
|
const startIndex = (highlightedIndex + delta % optionLength + optionLength) % optionLength;
|
|
8949
8975
|
const isForward = delta >= 0;
|
|
8950
|
-
let highlightedValue = options[startIndex].value;
|
|
8951
|
-
for (let i = 0; i < options.length; i++) {
|
|
8976
|
+
let highlightedValue = state.options[startIndex].value;
|
|
8977
|
+
for (let i = 0; i < state.options.length; i++) {
|
|
8952
8978
|
const index = (startIndex + (isForward ? i : -i) + optionLength) % optionLength;
|
|
8953
|
-
if (!options[index].disabled) {
|
|
8954
|
-
highlightedValue = options[index].value;
|
|
8979
|
+
if (!state.options[index].disabled) {
|
|
8980
|
+
highlightedValue = state.options[index].value;
|
|
8955
8981
|
break;
|
|
8956
8982
|
}
|
|
8957
8983
|
}
|
|
@@ -8960,11 +8986,11 @@ var SelectRoot = ({
|
|
|
8960
8986
|
highlightedValue
|
|
8961
8987
|
}));
|
|
8962
8988
|
};
|
|
8963
|
-
(0,
|
|
8989
|
+
(0, import_react19.useEffect)(() => {
|
|
8964
8990
|
if (!internalState.highlightedValue) return;
|
|
8965
|
-
const highlighted = options.find((value2) => value2.value === internalState.highlightedValue);
|
|
8991
|
+
const highlighted = internalState.options.find((value2) => value2.value === internalState.highlightedValue);
|
|
8966
8992
|
if (highlighted) {
|
|
8967
|
-
highlighted.ref.current
|
|
8993
|
+
highlighted.ref.current?.scrollIntoView({ behavior: "instant", block: "nearest" });
|
|
8968
8994
|
} else {
|
|
8969
8995
|
console.error(`SelectRoot: Could not find highlighted value (${internalState.highlightedValue})`);
|
|
8970
8996
|
}
|
|
@@ -8988,14 +9014,14 @@ var SelectRoot = ({
|
|
|
8988
9014
|
};
|
|
8989
9015
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContext.Provider, { value: contextValue, children });
|
|
8990
9016
|
};
|
|
8991
|
-
var SelectOption = (0,
|
|
9017
|
+
var SelectOption = (0, import_react19.forwardRef)(
|
|
8992
9018
|
function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
|
|
8993
9019
|
const { state, config, item, trigger } = useSelectContext();
|
|
8994
9020
|
const { register, unregister, toggleSelection, highlightItem } = item;
|
|
8995
|
-
const itemRef = (0,
|
|
9021
|
+
const itemRef = (0, import_react19.useRef)(null);
|
|
8996
9022
|
iconAppearance ??= config.iconAppearance;
|
|
8997
9023
|
const label = children ?? value;
|
|
8998
|
-
(0,
|
|
9024
|
+
(0, import_react19.useEffect)(() => {
|
|
8999
9025
|
register({
|
|
9000
9026
|
value,
|
|
9001
9027
|
label,
|
|
@@ -9073,13 +9099,13 @@ var defaultSelectButtonTranslation = {
|
|
|
9073
9099
|
clickToSelect: "Zum ausw\xE4hlen dr\xFCcken"
|
|
9074
9100
|
}
|
|
9075
9101
|
};
|
|
9076
|
-
var SelectButton = (0,
|
|
9102
|
+
var SelectButton = (0, import_react19.forwardRef)(function SelectButton2({ placeholder, selectedDisplay, ...props }, ref) {
|
|
9077
9103
|
const translation = useTranslation([defaultSelectButtonTranslation]);
|
|
9078
9104
|
const { state, trigger } = useSelectContext();
|
|
9079
9105
|
const { register, unregister, toggleOpen } = trigger;
|
|
9080
|
-
const innerRef = (0,
|
|
9081
|
-
(0,
|
|
9082
|
-
(0,
|
|
9106
|
+
const innerRef = (0, import_react19.useRef)(null);
|
|
9107
|
+
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current);
|
|
9108
|
+
(0, import_react19.useEffect)(() => {
|
|
9083
9109
|
register(innerRef);
|
|
9084
9110
|
return () => unregister();
|
|
9085
9111
|
}, [register, unregister]);
|
|
@@ -9101,12 +9127,12 @@ var SelectButton = (0, import_react20.forwardRef)(function SelectButton2({ place
|
|
|
9101
9127
|
props.onKeyDown?.(event);
|
|
9102
9128
|
switch (event.key) {
|
|
9103
9129
|
case "ArrowDown":
|
|
9104
|
-
toggleOpen(true, {
|
|
9130
|
+
toggleOpen(true, { highlightStartPositionBehavior: "first" });
|
|
9105
9131
|
event.preventDefault();
|
|
9106
9132
|
event.stopPropagation();
|
|
9107
9133
|
break;
|
|
9108
9134
|
case "ArrowUp":
|
|
9109
|
-
toggleOpen(true, {
|
|
9135
|
+
toggleOpen(true, { highlightStartPositionBehavior: "last" });
|
|
9110
9136
|
event.preventDefault();
|
|
9111
9137
|
event.stopPropagation();
|
|
9112
9138
|
break;
|
|
@@ -9152,12 +9178,12 @@ var SelectButton = (0, import_react20.forwardRef)(function SelectButton2({ place
|
|
|
9152
9178
|
}
|
|
9153
9179
|
);
|
|
9154
9180
|
});
|
|
9155
|
-
var SelectChipDisplay = (0,
|
|
9181
|
+
var SelectChipDisplay = (0, import_react19.forwardRef)(function SelectChipDisplay2({ ...props }, ref) {
|
|
9156
9182
|
const { state, trigger, item } = useSelectContext();
|
|
9157
9183
|
const { register, unregister, toggleOpen } = trigger;
|
|
9158
|
-
const innerRef = (0,
|
|
9159
|
-
(0,
|
|
9160
|
-
(0,
|
|
9184
|
+
const innerRef = (0, import_react19.useRef)(null);
|
|
9185
|
+
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current);
|
|
9186
|
+
(0, import_react19.useEffect)(() => {
|
|
9161
9187
|
register(innerRef);
|
|
9162
9188
|
return () => unregister();
|
|
9163
9189
|
}, [register, unregister]);
|
|
@@ -9200,10 +9226,10 @@ var SelectChipDisplay = (0, import_react20.forwardRef)(function SelectChipDispla
|
|
|
9200
9226
|
onKeyDown: (event) => {
|
|
9201
9227
|
switch (event.key) {
|
|
9202
9228
|
case "ArrowDown":
|
|
9203
|
-
toggleOpen(true, {
|
|
9229
|
+
toggleOpen(true, { highlightStartPositionBehavior: "first" });
|
|
9204
9230
|
break;
|
|
9205
9231
|
case "ArrowUp":
|
|
9206
|
-
toggleOpen(true, {
|
|
9232
|
+
toggleOpen(true, { highlightStartPositionBehavior: "last" });
|
|
9207
9233
|
}
|
|
9208
9234
|
},
|
|
9209
9235
|
size: "small",
|
|
@@ -9220,14 +9246,15 @@ var SelectChipDisplay = (0, import_react20.forwardRef)(function SelectChipDispla
|
|
|
9220
9246
|
}
|
|
9221
9247
|
);
|
|
9222
9248
|
});
|
|
9223
|
-
var SelectContent = (0,
|
|
9249
|
+
var SelectContent = (0, import_react19.forwardRef)(
|
|
9224
9250
|
function SelectContent2({
|
|
9225
9251
|
alignment,
|
|
9226
9252
|
orientation = "vertical",
|
|
9253
|
+
containerClassName,
|
|
9227
9254
|
...props
|
|
9228
9255
|
}, ref) {
|
|
9229
|
-
const innerRef = (0,
|
|
9230
|
-
(0,
|
|
9256
|
+
const innerRef = (0, import_react19.useRef)(null);
|
|
9257
|
+
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current);
|
|
9231
9258
|
const { trigger, state, config, item } = useSelectContext();
|
|
9232
9259
|
const position = useFloatingElement({
|
|
9233
9260
|
active: state.isOpen,
|
|
@@ -9240,81 +9267,88 @@ var SelectContent = (0, import_react20.forwardRef)(
|
|
|
9240
9267
|
active: state.isOpen && !!position
|
|
9241
9268
|
});
|
|
9242
9269
|
return (0, import_react_dom2.createPortal)(
|
|
9243
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
{
|
|
9247
|
-
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
vertical: "ArrowDown",
|
|
9268
|
-
horizontal: "ArrowUp"
|
|
9269
|
-
}):
|
|
9270
|
-
item.moveHighlightedIndex(1);
|
|
9271
|
-
event.preventDefault();
|
|
9272
|
-
break;
|
|
9273
|
-
case match(orientation, {
|
|
9274
|
-
vertical: "ArrowUp",
|
|
9275
|
-
horizontal: "ArrowDown"
|
|
9276
|
-
}):
|
|
9277
|
-
item.moveHighlightedIndex(-1);
|
|
9278
|
-
event.preventDefault();
|
|
9279
|
-
break;
|
|
9280
|
-
case "Home":
|
|
9281
|
-
event.preventDefault();
|
|
9282
|
-
break;
|
|
9283
|
-
case "End":
|
|
9284
|
-
event.preventDefault();
|
|
9285
|
-
break;
|
|
9286
|
-
case "Enter":
|
|
9287
|
-
// Fall through
|
|
9288
|
-
case " ":
|
|
9289
|
-
if (state.highlightedValue) {
|
|
9290
|
-
item.toggleSelection(state.highlightedValue);
|
|
9291
|
-
if (!config.isMultiSelect) {
|
|
9270
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
9271
|
+
"div",
|
|
9272
|
+
{
|
|
9273
|
+
id: `select-container-${state.id}`,
|
|
9274
|
+
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen", containerClassName),
|
|
9275
|
+
hidden: !state.isOpen,
|
|
9276
|
+
children: [
|
|
9277
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9278
|
+
"div",
|
|
9279
|
+
{
|
|
9280
|
+
id: `select-background-${state.id}`,
|
|
9281
|
+
onClick: () => trigger.toggleOpen(false),
|
|
9282
|
+
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen")
|
|
9283
|
+
}
|
|
9284
|
+
),
|
|
9285
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9286
|
+
"ul",
|
|
9287
|
+
{
|
|
9288
|
+
...props,
|
|
9289
|
+
id: `${state.id}-listbox`,
|
|
9290
|
+
ref: innerRef,
|
|
9291
|
+
onKeyDown: (event) => {
|
|
9292
|
+
switch (event.key) {
|
|
9293
|
+
case "Escape":
|
|
9292
9294
|
trigger.toggleOpen(false);
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
+
event.preventDefault();
|
|
9296
|
+
event.stopPropagation();
|
|
9297
|
+
break;
|
|
9298
|
+
case match(orientation, {
|
|
9299
|
+
vertical: "ArrowDown",
|
|
9300
|
+
horizontal: "ArrowUp"
|
|
9301
|
+
}):
|
|
9302
|
+
item.moveHighlightedIndex(1);
|
|
9303
|
+
event.preventDefault();
|
|
9304
|
+
break;
|
|
9305
|
+
case match(orientation, {
|
|
9306
|
+
vertical: "ArrowUp",
|
|
9307
|
+
horizontal: "ArrowDown"
|
|
9308
|
+
}):
|
|
9309
|
+
item.moveHighlightedIndex(-1);
|
|
9310
|
+
event.preventDefault();
|
|
9311
|
+
break;
|
|
9312
|
+
case "Home":
|
|
9313
|
+
event.preventDefault();
|
|
9314
|
+
break;
|
|
9315
|
+
case "End":
|
|
9316
|
+
event.preventDefault();
|
|
9317
|
+
break;
|
|
9318
|
+
case "Enter":
|
|
9319
|
+
// Fall through
|
|
9320
|
+
case " ":
|
|
9321
|
+
if (state.highlightedValue) {
|
|
9322
|
+
item.toggleSelection(state.highlightedValue);
|
|
9323
|
+
if (!config.isMultiSelect) {
|
|
9324
|
+
trigger.toggleOpen(false);
|
|
9325
|
+
}
|
|
9326
|
+
event.preventDefault();
|
|
9327
|
+
}
|
|
9328
|
+
break;
|
|
9295
9329
|
}
|
|
9296
|
-
|
|
9330
|
+
},
|
|
9331
|
+
className: (0, import_clsx13.default)("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-style-within overflow-auto", props.className),
|
|
9332
|
+
style: {
|
|
9333
|
+
opacity: position ? void 0 : 0,
|
|
9334
|
+
position: "fixed",
|
|
9335
|
+
...position
|
|
9336
|
+
},
|
|
9337
|
+
role: "listbox",
|
|
9338
|
+
"aria-multiselectable": config.isMultiSelect,
|
|
9339
|
+
"aria-orientation": orientation,
|
|
9340
|
+
tabIndex: position ? 0 : void 0,
|
|
9341
|
+
children: props.children
|
|
9297
9342
|
}
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
position: "fixed",
|
|
9303
|
-
...position
|
|
9304
|
-
},
|
|
9305
|
-
role: "listbox",
|
|
9306
|
-
"aria-multiselectable": config.isMultiSelect,
|
|
9307
|
-
"aria-orientation": orientation,
|
|
9308
|
-
tabIndex: position ? 0 : void 0,
|
|
9309
|
-
children: props.children
|
|
9310
|
-
}
|
|
9311
|
-
)
|
|
9312
|
-
] }),
|
|
9343
|
+
)
|
|
9344
|
+
]
|
|
9345
|
+
}
|
|
9346
|
+
),
|
|
9313
9347
|
document.body
|
|
9314
9348
|
);
|
|
9315
9349
|
}
|
|
9316
9350
|
);
|
|
9317
|
-
var Select = (0,
|
|
9351
|
+
var Select = (0, import_react19.forwardRef)(function Select2({
|
|
9318
9352
|
children,
|
|
9319
9353
|
contentPanelProps,
|
|
9320
9354
|
buttonProps,
|
|
@@ -9336,7 +9370,7 @@ var Select = (0, import_react20.forwardRef)(function Select2({
|
|
|
9336
9370
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
9337
9371
|
] });
|
|
9338
9372
|
});
|
|
9339
|
-
var SelectUncontrolled = (0,
|
|
9373
|
+
var SelectUncontrolled = (0, import_react19.forwardRef)(function SelectUncontrolled2({
|
|
9340
9374
|
value: initialValue,
|
|
9341
9375
|
onValueChanged,
|
|
9342
9376
|
...props
|
|
@@ -9352,7 +9386,7 @@ var SelectUncontrolled = (0, import_react20.forwardRef)(function SelectUncontrol
|
|
|
9352
9386
|
}
|
|
9353
9387
|
);
|
|
9354
9388
|
});
|
|
9355
|
-
var MultiSelect = (0,
|
|
9389
|
+
var MultiSelect = (0, import_react19.forwardRef)(function MultiSelect2({
|
|
9356
9390
|
children,
|
|
9357
9391
|
contentPanelProps,
|
|
9358
9392
|
buttonProps,
|
|
@@ -9363,7 +9397,7 @@ var MultiSelect = (0, import_react20.forwardRef)(function MultiSelect2({
|
|
|
9363
9397
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
9364
9398
|
] });
|
|
9365
9399
|
});
|
|
9366
|
-
var MultiSelectUncontrolled = (0,
|
|
9400
|
+
var MultiSelectUncontrolled = (0, import_react19.forwardRef)(function MultiSelectUncontrolled2({
|
|
9367
9401
|
values: initialValues,
|
|
9368
9402
|
onValuesChanged,
|
|
9369
9403
|
...props
|
|
@@ -9379,7 +9413,7 @@ var MultiSelectUncontrolled = (0, import_react20.forwardRef)(function MultiSelec
|
|
|
9379
9413
|
}
|
|
9380
9414
|
);
|
|
9381
9415
|
});
|
|
9382
|
-
var MultiSelectChipDisplay = (0,
|
|
9416
|
+
var MultiSelectChipDisplay = (0, import_react19.forwardRef)(function MultiSelectChipDisplay2({
|
|
9383
9417
|
children,
|
|
9384
9418
|
contentPanelProps,
|
|
9385
9419
|
chipDisplayProps,
|
|
@@ -9390,7 +9424,7 @@ var MultiSelectChipDisplay = (0, import_react20.forwardRef)(function MultiSelect
|
|
|
9390
9424
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
9391
9425
|
] });
|
|
9392
9426
|
});
|
|
9393
|
-
var MultiSelectChipDisplayUncontrolled = (0,
|
|
9427
|
+
var MultiSelectChipDisplayUncontrolled = (0, import_react19.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
|
|
9394
9428
|
values: initialValues,
|
|
9395
9429
|
onValuesChanged,
|
|
9396
9430
|
...props
|
|
@@ -9463,7 +9497,7 @@ var import_lucide_react5 = require("lucide-react");
|
|
|
9463
9497
|
var import_clsx14 = __toESM(require("clsx"));
|
|
9464
9498
|
|
|
9465
9499
|
// src/theming/useTheme.tsx
|
|
9466
|
-
var
|
|
9500
|
+
var import_react20 = require("react");
|
|
9467
9501
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
9468
9502
|
var themes = ["light", "dark", "system"];
|
|
9469
9503
|
var defaultThemeTypeTranslation = {
|
|
@@ -9490,9 +9524,9 @@ var ThemeUtil = {
|
|
|
9490
9524
|
themes,
|
|
9491
9525
|
translation: defaultThemeTypeTranslation
|
|
9492
9526
|
};
|
|
9493
|
-
var ThemeContext = (0,
|
|
9527
|
+
var ThemeContext = (0, import_react20.createContext)(null);
|
|
9494
9528
|
var useTheme = () => {
|
|
9495
|
-
const context = (0,
|
|
9529
|
+
const context = (0, import_react20.useContext)(ThemeContext);
|
|
9496
9530
|
if (!context) {
|
|
9497
9531
|
throw new Error("useTheme must be used within ThemeContext. Try adding a ThemeProvider around your app.");
|
|
9498
9532
|
}
|
|
@@ -9564,7 +9598,7 @@ var ThemeDialog = ({
|
|
|
9564
9598
|
};
|
|
9565
9599
|
|
|
9566
9600
|
// src/components/form/FormElementWrapper.tsx
|
|
9567
|
-
var
|
|
9601
|
+
var import_react21 = require("react");
|
|
9568
9602
|
var import_clsx16 = require("clsx");
|
|
9569
9603
|
|
|
9570
9604
|
// src/components/user-action/Label.tsx
|
|
@@ -9602,7 +9636,7 @@ var FormElementWrapper = ({
|
|
|
9602
9636
|
containerClassName
|
|
9603
9637
|
}) => {
|
|
9604
9638
|
const [touched, setTouched] = useOverwritableState(initialIsShowingError, onIsShowingError);
|
|
9605
|
-
const generatedId = (0,
|
|
9639
|
+
const generatedId = (0, import_react21.useId)();
|
|
9606
9640
|
const usedId = id ?? generatedId;
|
|
9607
9641
|
const errorId = `${usedId}-description`;
|
|
9608
9642
|
const labelId = `${usedId}-label`;
|
|
@@ -9673,7 +9707,7 @@ var FormElementWrapper = ({
|
|
|
9673
9707
|
|
|
9674
9708
|
// src/components/icons-and-geometry/Avatar.tsx
|
|
9675
9709
|
var import_clsx17 = __toESM(require("clsx"));
|
|
9676
|
-
var
|
|
9710
|
+
var import_react22 = require("react");
|
|
9677
9711
|
var import_lucide_react6 = require("lucide-react");
|
|
9678
9712
|
|
|
9679
9713
|
// node_modules/@radix-ui/react-avatar/dist/index.mjs
|
|
@@ -10072,7 +10106,7 @@ var Avatar2 = ({ image, name, size = "md", fullyRounded, className = "" }) => {
|
|
|
10072
10106
|
maxHeight: pixels
|
|
10073
10107
|
};
|
|
10074
10108
|
const textClassName = textClassNameMapping[size];
|
|
10075
|
-
const displayName = (0,
|
|
10109
|
+
const displayName = (0, import_react22.useMemo)(() => {
|
|
10076
10110
|
const maxLetters = size === "sm" ? 1 : 2;
|
|
10077
10111
|
return (name ?? "").split(" ").filter((_, index) => index < maxLetters).map((value) => value[0]).join("").toUpperCase();
|
|
10078
10112
|
}, [name, size]);
|
|
@@ -10172,7 +10206,7 @@ var Circle = ({
|
|
|
10172
10206
|
};
|
|
10173
10207
|
|
|
10174
10208
|
// src/components/icons-and-geometry/Ring.tsx
|
|
10175
|
-
var
|
|
10209
|
+
var import_react23 = require("react");
|
|
10176
10210
|
var import_clsx19 = __toESM(require("clsx"));
|
|
10177
10211
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
10178
10212
|
var Ring = ({
|
|
@@ -10201,9 +10235,9 @@ var AnimatedRing = ({
|
|
|
10201
10235
|
onAnimationFinished,
|
|
10202
10236
|
style
|
|
10203
10237
|
}) => {
|
|
10204
|
-
const [currentWidth, setCurrentWidth] = (0,
|
|
10238
|
+
const [currentWidth, setCurrentWidth] = (0, import_react23.useState)(0);
|
|
10205
10239
|
const milliseconds = 1e3 * fillAnimationDuration;
|
|
10206
|
-
const animate = (0,
|
|
10240
|
+
const animate = (0, import_react23.useCallback)((timestamp, startTime) => {
|
|
10207
10241
|
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
10208
10242
|
const newWidth = Math.min(width * progress, width);
|
|
10209
10243
|
setCurrentWidth(newWidth);
|
|
@@ -10217,7 +10251,7 @@ var AnimatedRing = ({
|
|
|
10217
10251
|
}
|
|
10218
10252
|
}
|
|
10219
10253
|
}, [milliseconds, onAnimationFinished, repeating, width]);
|
|
10220
|
-
(0,
|
|
10254
|
+
(0, import_react23.useEffect)(() => {
|
|
10221
10255
|
if (currentWidth < width) {
|
|
10222
10256
|
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
10223
10257
|
}
|
|
@@ -10252,10 +10286,10 @@ var RingWave = ({
|
|
|
10252
10286
|
onAnimationFinished,
|
|
10253
10287
|
style
|
|
10254
10288
|
}) => {
|
|
10255
|
-
const [currentInnerSize, setCurrentInnerSize] = (0,
|
|
10289
|
+
const [currentInnerSize, setCurrentInnerSize] = (0, import_react23.useState)(startInnerSize);
|
|
10256
10290
|
const distance = endInnerSize - startInnerSize;
|
|
10257
10291
|
const milliseconds = 1e3 * fillAnimationDuration;
|
|
10258
|
-
const animate = (0,
|
|
10292
|
+
const animate = (0, import_react23.useCallback)((timestamp, startTime) => {
|
|
10259
10293
|
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
10260
10294
|
const newInnerSize = Math.min(
|
|
10261
10295
|
startInnerSize + distance * progress,
|
|
@@ -10272,7 +10306,7 @@ var RingWave = ({
|
|
|
10272
10306
|
}
|
|
10273
10307
|
}
|
|
10274
10308
|
}, [distance, endInnerSize, milliseconds, onAnimationFinished, repeating, startInnerSize]);
|
|
10275
|
-
(0,
|
|
10309
|
+
(0, import_react23.useEffect)(() => {
|
|
10276
10310
|
if (currentInnerSize < endInnerSize) {
|
|
10277
10311
|
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
10278
10312
|
}
|
|
@@ -10307,7 +10341,7 @@ var RadialRings = ({
|
|
|
10307
10341
|
sizeCircle2 = 200,
|
|
10308
10342
|
sizeCircle3 = 300
|
|
10309
10343
|
}) => {
|
|
10310
|
-
const [currentRing, setCurrentRing] = (0,
|
|
10344
|
+
const [currentRing, setCurrentRing] = (0, import_react23.useState)(0);
|
|
10311
10345
|
const size = sizeCircle3;
|
|
10312
10346
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
10313
10347
|
"div",
|
|
@@ -10456,13 +10490,13 @@ var TagIcon = ({
|
|
|
10456
10490
|
};
|
|
10457
10491
|
|
|
10458
10492
|
// src/components/layout/Carousel.tsx
|
|
10459
|
-
var
|
|
10493
|
+
var import_react24 = require("react");
|
|
10460
10494
|
var import_clsx20 = __toESM(require("clsx"));
|
|
10461
10495
|
var import_lucide_react7 = require("lucide-react");
|
|
10462
10496
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
10463
|
-
var CarouselContext = (0,
|
|
10497
|
+
var CarouselContext = (0, import_react24.createContext)(null);
|
|
10464
10498
|
var useCarouselContext = () => {
|
|
10465
|
-
const context = (0,
|
|
10499
|
+
const context = (0, import_react24.useContext)(CarouselContext);
|
|
10466
10500
|
if (!context) {
|
|
10467
10501
|
console.error("useCarouselContext must be used within CarouselContext");
|
|
10468
10502
|
}
|
|
@@ -10485,7 +10519,7 @@ function CarouselTabs({
|
|
|
10485
10519
|
defaultCarouselTabTranslationType
|
|
10486
10520
|
]);
|
|
10487
10521
|
const { id, slideCount, currentIndex, isLooping } = useCarouselContext();
|
|
10488
|
-
const tabRefs = (0,
|
|
10522
|
+
const tabRefs = (0, import_react24.useRef)([]);
|
|
10489
10523
|
const handleKeyDown = (event, index) => {
|
|
10490
10524
|
let newIndex = index;
|
|
10491
10525
|
if (event.key === "ArrowRight") {
|
|
@@ -10545,7 +10579,7 @@ var defaultCarouselSlideTranslationType = {
|
|
|
10545
10579
|
slideOf: `Slide {{index}} von {{length}} slides`
|
|
10546
10580
|
}
|
|
10547
10581
|
};
|
|
10548
|
-
var CarouselSlide = (0,
|
|
10582
|
+
var CarouselSlide = (0, import_react24.forwardRef)(
|
|
10549
10583
|
function CarouselSlide2({
|
|
10550
10584
|
index,
|
|
10551
10585
|
...props
|
|
@@ -10602,20 +10636,21 @@ var Carousel = ({
|
|
|
10602
10636
|
heightClassName = "h-96",
|
|
10603
10637
|
widthClassName = "w-[70%] desktop:w-1/2",
|
|
10604
10638
|
slideContainerProps,
|
|
10639
|
+
onSlideChanged,
|
|
10605
10640
|
...props
|
|
10606
10641
|
}) => {
|
|
10607
10642
|
const translation = useTranslation([defaultCarouselTranslationType]);
|
|
10608
|
-
const slideRefs = (0,
|
|
10609
|
-
const [currentIndex, setCurrentIndex] = (0,
|
|
10610
|
-
const [hasFocus, setHasFocus] = (0,
|
|
10611
|
-
const [dragState, setDragState] = (0,
|
|
10643
|
+
const slideRefs = (0, import_react24.useRef)([]);
|
|
10644
|
+
const [currentIndex, setCurrentIndex] = (0, import_react24.useState)(0);
|
|
10645
|
+
const [hasFocus, setHasFocus] = (0, import_react24.useState)(false);
|
|
10646
|
+
const [dragState, setDragState] = (0, import_react24.useState)();
|
|
10612
10647
|
const isPaused = hasFocus;
|
|
10613
|
-
const carouselContainerRef = (0,
|
|
10614
|
-
const [disableClick, setDisableClick] = (0,
|
|
10615
|
-
const timeOut = (0,
|
|
10616
|
-
const length = (0,
|
|
10648
|
+
const carouselContainerRef = (0, import_react24.useRef)(null);
|
|
10649
|
+
const [disableClick, setDisableClick] = (0, import_react24.useState)(false);
|
|
10650
|
+
const timeOut = (0, import_react24.useRef)(void 0);
|
|
10651
|
+
const length = (0, import_react24.useMemo)(() => children.length, [children]);
|
|
10617
10652
|
const paddingItemCount = 3;
|
|
10618
|
-
const generatedId = "carousel" + (0,
|
|
10653
|
+
const generatedId = "carousel" + (0, import_react24.useId)();
|
|
10619
10654
|
const id = props.id ?? generatedId;
|
|
10620
10655
|
if (isAutoPlaying && !isLooping) {
|
|
10621
10656
|
console.error("When isAutoLooping is true, isLooping should also be true");
|
|
@@ -10624,7 +10659,7 @@ var Carousel = ({
|
|
|
10624
10659
|
autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut);
|
|
10625
10660
|
animationTime = Math.max(100, animationTime);
|
|
10626
10661
|
autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime);
|
|
10627
|
-
(0,
|
|
10662
|
+
(0, import_react24.useEffect)(() => {
|
|
10628
10663
|
const carousel = carouselContainerRef.current;
|
|
10629
10664
|
if (carousel) {
|
|
10630
10665
|
let onFocus = function() {
|
|
@@ -10647,7 +10682,7 @@ var Carousel = ({
|
|
|
10647
10682
|
const canGoLeft = () => {
|
|
10648
10683
|
return isLooping || currentIndex !== 0;
|
|
10649
10684
|
};
|
|
10650
|
-
const canGoRight = (0,
|
|
10685
|
+
const canGoRight = (0, import_react24.useCallback)(() => {
|
|
10651
10686
|
return isLooping || currentIndex !== length - 1;
|
|
10652
10687
|
}, [currentIndex, isLooping, length]);
|
|
10653
10688
|
const left = () => {
|
|
@@ -10655,12 +10690,12 @@ var Carousel = ({
|
|
|
10655
10690
|
setCurrentIndex(currentIndex - 1);
|
|
10656
10691
|
}
|
|
10657
10692
|
};
|
|
10658
|
-
const right = (0,
|
|
10693
|
+
const right = (0, import_react24.useCallback)(() => {
|
|
10659
10694
|
if (canGoRight()) {
|
|
10660
10695
|
setCurrentIndex((currentIndex + length + 1) % length);
|
|
10661
10696
|
}
|
|
10662
10697
|
}, [canGoRight, currentIndex, length]);
|
|
10663
|
-
(0,
|
|
10698
|
+
(0, import_react24.useEffect)(() => {
|
|
10664
10699
|
if (!timeOut.current && !isPaused) {
|
|
10665
10700
|
if (autoLoopingTimeOut > 0) {
|
|
10666
10701
|
timeOut.current = setTimeout(() => {
|
|
@@ -10712,9 +10747,12 @@ var Carousel = ({
|
|
|
10712
10747
|
}
|
|
10713
10748
|
setDragState(void 0);
|
|
10714
10749
|
};
|
|
10715
|
-
(0,
|
|
10750
|
+
(0, import_react24.useEffect)(() => {
|
|
10716
10751
|
setDisableClick(!dragState);
|
|
10717
10752
|
}, [dragState]);
|
|
10753
|
+
(0, import_react24.useEffect)(() => {
|
|
10754
|
+
onSlideChanged?.(currentIndex);
|
|
10755
|
+
}, [currentIndex]);
|
|
10718
10756
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CarouselContext.Provider, { value: { id, currentIndex, slideCount: length, isLooping }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
10719
10757
|
"div",
|
|
10720
10758
|
{
|
|
@@ -11103,11 +11141,11 @@ var FAQSection = ({
|
|
|
11103
11141
|
};
|
|
11104
11142
|
|
|
11105
11143
|
// src/components/layout/FloatingContainer.tsx
|
|
11106
|
-
var
|
|
11144
|
+
var import_react25 = require("react");
|
|
11107
11145
|
var import_react_dom3 = require("react-dom");
|
|
11108
11146
|
var import_clsx23 = require("clsx");
|
|
11109
11147
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
11110
|
-
var FloatingContainer = (0,
|
|
11148
|
+
var FloatingContainer = (0, import_react25.forwardRef)(function FloatingContainer2({
|
|
11111
11149
|
children,
|
|
11112
11150
|
backgroundOverlay,
|
|
11113
11151
|
anchor,
|
|
@@ -11119,8 +11157,8 @@ var FloatingContainer = (0, import_react26.forwardRef)(function FloatingContaine
|
|
|
11119
11157
|
gap = 4,
|
|
11120
11158
|
...props
|
|
11121
11159
|
}, forwardRef17) {
|
|
11122
|
-
const innerRef = (0,
|
|
11123
|
-
(0,
|
|
11160
|
+
const innerRef = (0, import_react25.useRef)(null);
|
|
11161
|
+
(0, import_react25.useImperativeHandle)(forwardRef17, () => innerRef.current);
|
|
11124
11162
|
const position = useFloatingElement({
|
|
11125
11163
|
active: !props.hidden,
|
|
11126
11164
|
containerRef: innerRef,
|
|
@@ -11160,18 +11198,18 @@ var FloatingContainer = (0, import_react26.forwardRef)(function FloatingContaine
|
|
|
11160
11198
|
});
|
|
11161
11199
|
|
|
11162
11200
|
// src/components/layout/ListBox.tsx
|
|
11163
|
-
var
|
|
11201
|
+
var import_react26 = __toESM(require("react"));
|
|
11164
11202
|
var import_clsx24 = require("clsx");
|
|
11165
11203
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
11166
|
-
var ListBoxContext = (0,
|
|
11204
|
+
var ListBoxContext = (0, import_react26.createContext)(null);
|
|
11167
11205
|
function useListBoxContext() {
|
|
11168
|
-
const ctx = (0,
|
|
11206
|
+
const ctx = (0, import_react26.useContext)(ListBoxContext);
|
|
11169
11207
|
if (!ctx) {
|
|
11170
11208
|
throw new Error("ListBoxItem must be used within a ListBoxPrimitive");
|
|
11171
11209
|
}
|
|
11172
11210
|
return ctx;
|
|
11173
11211
|
}
|
|
11174
|
-
var ListBoxItem = (0,
|
|
11212
|
+
var ListBoxItem = (0, import_react26.forwardRef)(
|
|
11175
11213
|
function ListBoxItem2({ value, disabled = false, children, className, ...rest }, ref) {
|
|
11176
11214
|
const {
|
|
11177
11215
|
registerItem,
|
|
@@ -11181,9 +11219,9 @@ var ListBoxItem = (0, import_react27.forwardRef)(
|
|
|
11181
11219
|
onItemClick,
|
|
11182
11220
|
isSelected
|
|
11183
11221
|
} = useListBoxContext();
|
|
11184
|
-
const itemRef = (0,
|
|
11185
|
-
const id =
|
|
11186
|
-
(0,
|
|
11222
|
+
const itemRef = (0, import_react26.useRef)(null);
|
|
11223
|
+
const id = import_react26.default.useId();
|
|
11224
|
+
(0, import_react26.useEffect)(() => {
|
|
11187
11225
|
registerItem({ id, value, disabled, ref: itemRef });
|
|
11188
11226
|
return () => unregisterItem(id);
|
|
11189
11227
|
}, [id, value, disabled, registerItem, unregisterItem]);
|
|
@@ -11225,7 +11263,7 @@ var ListBoxItem = (0, import_react27.forwardRef)(
|
|
|
11225
11263
|
);
|
|
11226
11264
|
}
|
|
11227
11265
|
);
|
|
11228
|
-
var ListBoxPrimitive = (0,
|
|
11266
|
+
var ListBoxPrimitive = (0, import_react26.forwardRef)(
|
|
11229
11267
|
function ListBoxPrimitive2({
|
|
11230
11268
|
value,
|
|
11231
11269
|
onSelectionChanged,
|
|
@@ -11235,9 +11273,9 @@ var ListBoxPrimitive = (0, import_react27.forwardRef)(
|
|
|
11235
11273
|
orientation = "vertical",
|
|
11236
11274
|
...props
|
|
11237
11275
|
}, ref) {
|
|
11238
|
-
const itemsRef = (0,
|
|
11239
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
11240
|
-
const registerItem = (0,
|
|
11276
|
+
const itemsRef = (0, import_react26.useRef)([]);
|
|
11277
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react26.useState)(void 0);
|
|
11278
|
+
const registerItem = (0, import_react26.useCallback)((item) => {
|
|
11241
11279
|
itemsRef.current.push(item);
|
|
11242
11280
|
itemsRef.current.sort((a, b) => {
|
|
11243
11281
|
const aEl = a.ref.current;
|
|
@@ -11246,14 +11284,14 @@ var ListBoxPrimitive = (0, import_react27.forwardRef)(
|
|
|
11246
11284
|
return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
11247
11285
|
});
|
|
11248
11286
|
}, []);
|
|
11249
|
-
const unregisterItem = (0,
|
|
11287
|
+
const unregisterItem = (0, import_react26.useCallback)((id) => {
|
|
11250
11288
|
itemsRef.current = itemsRef.current.filter((i) => i.id !== id);
|
|
11251
11289
|
}, []);
|
|
11252
|
-
const isSelected = (0,
|
|
11290
|
+
const isSelected = (0, import_react26.useCallback)(
|
|
11253
11291
|
(val) => (value ?? []).includes(val),
|
|
11254
11292
|
[value]
|
|
11255
11293
|
);
|
|
11256
|
-
const onItemClickedHandler = (0,
|
|
11294
|
+
const onItemClickedHandler = (0, import_react26.useCallback)(
|
|
11257
11295
|
(id) => {
|
|
11258
11296
|
const index = itemsRef.current.findIndex((i) => i.id === id);
|
|
11259
11297
|
if (index === -1) {
|
|
@@ -11277,13 +11315,13 @@ var ListBoxPrimitive = (0, import_react27.forwardRef)(
|
|
|
11277
11315
|
},
|
|
11278
11316
|
[onItemClicked, isSelection, isMultiple, onSelectionChanged, isSelected, value]
|
|
11279
11317
|
);
|
|
11280
|
-
const setHighlightedId = (0,
|
|
11318
|
+
const setHighlightedId = (0, import_react26.useCallback)((id) => {
|
|
11281
11319
|
const index = itemsRef.current.findIndex((i) => i.id === id);
|
|
11282
11320
|
if (index !== -1) {
|
|
11283
11321
|
setHighlightedIndex(index);
|
|
11284
11322
|
}
|
|
11285
11323
|
}, []);
|
|
11286
|
-
(0,
|
|
11324
|
+
(0, import_react26.useEffect)(() => {
|
|
11287
11325
|
if (highlightedIndex !== void 0) {
|
|
11288
11326
|
itemsRef.current[highlightedIndex]?.ref.current?.scrollIntoView({ block: "nearest", behavior: "auto" });
|
|
11289
11327
|
}
|
|
@@ -11388,7 +11426,7 @@ var ListBoxMultipleUncontrolled = ({
|
|
|
11388
11426
|
}
|
|
11389
11427
|
);
|
|
11390
11428
|
};
|
|
11391
|
-
var ListBox = (0,
|
|
11429
|
+
var ListBox = (0, import_react26.forwardRef)(function ListBox2({
|
|
11392
11430
|
value,
|
|
11393
11431
|
onSelectionChanged,
|
|
11394
11432
|
...props
|
|
@@ -12522,7 +12560,7 @@ var ErrorComponent = ({
|
|
|
12522
12560
|
};
|
|
12523
12561
|
|
|
12524
12562
|
// src/components/loading-states/LoadingAndErrorComponent.tsx
|
|
12525
|
-
var
|
|
12563
|
+
var import_react27 = require("react");
|
|
12526
12564
|
|
|
12527
12565
|
// src/components/loading-states/LoadingContainer.tsx
|
|
12528
12566
|
var import_clsx28 = require("clsx");
|
|
@@ -12543,8 +12581,8 @@ var LoadingAndErrorComponent = ({
|
|
|
12543
12581
|
minimumLoadingDuration = 200,
|
|
12544
12582
|
className
|
|
12545
12583
|
}) => {
|
|
12546
|
-
const [isInMinimumLoading, setIsInMinimumLoading] = (0,
|
|
12547
|
-
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0,
|
|
12584
|
+
const [isInMinimumLoading, setIsInMinimumLoading] = (0, import_react27.useState)(false);
|
|
12585
|
+
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0, import_react27.useState)(false);
|
|
12548
12586
|
if (minimumLoadingDuration && !isInMinimumLoading && !hasUsedMinimumLoading) {
|
|
12549
12587
|
setIsInMinimumLoading(true);
|
|
12550
12588
|
setTimeout(() => {
|
|
@@ -12646,13 +12684,13 @@ var ProgressIndicator = ({
|
|
|
12646
12684
|
// src/components/navigation/BreadCrumb.tsx
|
|
12647
12685
|
var import_link = __toESM(require_link2());
|
|
12648
12686
|
var import_clsx32 = __toESM(require("clsx"));
|
|
12649
|
-
var
|
|
12687
|
+
var import_react28 = require("react");
|
|
12650
12688
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
12651
12689
|
var BreadCrumb = ({ crumbs, linkClassName, containerClassName }) => {
|
|
12652
12690
|
const color = "text-description";
|
|
12653
12691
|
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: (0, import_clsx32.default)("flex-row-0.5 items-center", containerClassName), children: crumbs.map((crumb, index) => {
|
|
12654
12692
|
const isLast = index === crumbs.length - 1;
|
|
12655
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
12693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react28.Fragment, { children: [
|
|
12656
12694
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12657
12695
|
import_link.default,
|
|
12658
12696
|
{
|
|
@@ -12668,8 +12706,8 @@ var BreadCrumb = ({ crumbs, linkClassName, containerClassName }) => {
|
|
|
12668
12706
|
|
|
12669
12707
|
// src/components/navigation/Navigation.tsx
|
|
12670
12708
|
var import_lucide_react9 = require("lucide-react");
|
|
12709
|
+
var import_react29 = require("react");
|
|
12671
12710
|
var import_react30 = require("react");
|
|
12672
|
-
var import_react31 = require("react");
|
|
12673
12711
|
var import_link2 = __toESM(require_link2());
|
|
12674
12712
|
var import_clsx33 = __toESM(require("clsx"));
|
|
12675
12713
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
@@ -12682,10 +12720,10 @@ var NavigationItemWithSubItem = ({
|
|
|
12682
12720
|
horizontalAlignment = "center",
|
|
12683
12721
|
...options
|
|
12684
12722
|
}) => {
|
|
12685
|
-
const [isOpen, setOpen] = (0,
|
|
12686
|
-
const containerRef = (0,
|
|
12687
|
-
const triggerRef = (0,
|
|
12688
|
-
const id = (0,
|
|
12723
|
+
const [isOpen, setOpen] = (0, import_react30.useState)(false);
|
|
12724
|
+
const containerRef = (0, import_react30.useRef)();
|
|
12725
|
+
const triggerRef = (0, import_react30.useRef)(null);
|
|
12726
|
+
const id = (0, import_react30.useId)();
|
|
12689
12727
|
const style = useFloatingElement({
|
|
12690
12728
|
active: isOpen,
|
|
12691
12729
|
containerRef,
|
|
@@ -12693,7 +12731,7 @@ var NavigationItemWithSubItem = ({
|
|
|
12693
12731
|
horizontalAlignment,
|
|
12694
12732
|
...options
|
|
12695
12733
|
});
|
|
12696
|
-
const onBlur = (0,
|
|
12734
|
+
const onBlur = (0, import_react30.useCallback)((event) => {
|
|
12697
12735
|
const nextFocus = event.relatedTarget;
|
|
12698
12736
|
if (!containerRef.current?.contains(nextFocus) && !triggerRef.current?.contains(nextFocus)) {
|
|
12699
12737
|
setOpen(false);
|
|
@@ -12747,10 +12785,10 @@ var NavigationItemList = ({ items, ...restProps }) => {
|
|
|
12747
12785
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("nav", { ...restProps, className: (0, import_clsx33.default)("flex-row-6 items-center", restProps.className), children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("li", { children: isSubItem(item) ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(NavigationItemWithSubItem, { ...item }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_link2.default, { href: item.link, target: item.external ? "_blank" : void 0, className: "link", children: item.label }) }, index)) });
|
|
12748
12786
|
};
|
|
12749
12787
|
var Navigation = ({ ...props }) => {
|
|
12750
|
-
const [isMobileOpen, setIsMobileOpen] = (0,
|
|
12751
|
-
const id = (0,
|
|
12752
|
-
const menuRef = (0,
|
|
12753
|
-
(0,
|
|
12788
|
+
const [isMobileOpen, setIsMobileOpen] = (0, import_react30.useState)(false);
|
|
12789
|
+
const id = (0, import_react30.useId)();
|
|
12790
|
+
const menuRef = (0, import_react30.useRef)(null);
|
|
12791
|
+
(0, import_react29.useEffect)(() => {
|
|
12754
12792
|
menuRef.current?.focus();
|
|
12755
12793
|
}, [isMobileOpen]);
|
|
12756
12794
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
@@ -12805,7 +12843,7 @@ var Navigation = ({ ...props }) => {
|
|
|
12805
12843
|
// src/components/navigation/Pagination.tsx
|
|
12806
12844
|
var import_lucide_react10 = require("lucide-react");
|
|
12807
12845
|
var import_clsx34 = __toESM(require("clsx"));
|
|
12808
|
-
var
|
|
12846
|
+
var import_react31 = require("react");
|
|
12809
12847
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
12810
12848
|
var Pagination = ({
|
|
12811
12849
|
overwriteTranslation,
|
|
@@ -12816,11 +12854,11 @@ var Pagination = ({
|
|
|
12816
12854
|
style
|
|
12817
12855
|
}) => {
|
|
12818
12856
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
12819
|
-
const [value, setValue] = (0,
|
|
12857
|
+
const [value, setValue] = (0, import_react31.useState)((pageIndex + 1).toString());
|
|
12820
12858
|
const noPages = pageCount === 0;
|
|
12821
12859
|
const onFirstPage = pageIndex === 0 && !noPages;
|
|
12822
12860
|
const onLastPage = pageIndex === pageCount - 1;
|
|
12823
|
-
(0,
|
|
12861
|
+
(0, import_react31.useEffect)(() => {
|
|
12824
12862
|
if (noPages) {
|
|
12825
12863
|
setValue("0");
|
|
12826
12864
|
} else {
|
|
@@ -13499,7 +13537,7 @@ var PropertyBase = ({
|
|
|
13499
13537
|
};
|
|
13500
13538
|
|
|
13501
13539
|
// src/components/properties/CheckboxProperty.tsx
|
|
13502
|
-
var
|
|
13540
|
+
var import_react32 = require("react");
|
|
13503
13541
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
13504
13542
|
var CheckboxProperty = ({
|
|
13505
13543
|
overwriteTranslation,
|
|
@@ -13509,7 +13547,7 @@ var CheckboxProperty = ({
|
|
|
13509
13547
|
...baseProps
|
|
13510
13548
|
}) => {
|
|
13511
13549
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
13512
|
-
const id = (0,
|
|
13550
|
+
const id = (0, import_react32.useId)();
|
|
13513
13551
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13514
13552
|
PropertyBase,
|
|
13515
13553
|
{
|
|
@@ -13732,10 +13770,10 @@ var import_lucide_react19 = require("lucide-react");
|
|
|
13732
13770
|
var import_clsx43 = __toESM(require("clsx"));
|
|
13733
13771
|
|
|
13734
13772
|
// src/components/user-action/Textarea.tsx
|
|
13735
|
-
var
|
|
13773
|
+
var import_react33 = require("react");
|
|
13736
13774
|
var import_clsx42 = __toESM(require("clsx"));
|
|
13737
13775
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
13738
|
-
var Textarea = (0,
|
|
13776
|
+
var Textarea = (0, import_react33.forwardRef)(function Textarea2({
|
|
13739
13777
|
id,
|
|
13740
13778
|
onChange,
|
|
13741
13779
|
onChangeText,
|
|
@@ -13809,7 +13847,7 @@ var TextareaWithHeadline = ({
|
|
|
13809
13847
|
containerClassName,
|
|
13810
13848
|
...props
|
|
13811
13849
|
}) => {
|
|
13812
|
-
const genId = (0,
|
|
13850
|
+
const genId = (0, import_react33.useId)();
|
|
13813
13851
|
const usedId = id ?? genId;
|
|
13814
13852
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
13815
13853
|
"div",
|
|
@@ -13924,7 +13962,7 @@ var TableFilters = {
|
|
|
13924
13962
|
};
|
|
13925
13963
|
|
|
13926
13964
|
// src/components/table/Table.tsx
|
|
13927
|
-
var
|
|
13965
|
+
var import_react39 = require("react");
|
|
13928
13966
|
var import_clsx48 = __toESM(require("clsx"));
|
|
13929
13967
|
var import_react_table = require("@tanstack/react-table");
|
|
13930
13968
|
var import_react_custom_scrollbars_23 = require("react-custom-scrollbars-2");
|
|
@@ -13940,9 +13978,9 @@ var TableCell = ({
|
|
|
13940
13978
|
};
|
|
13941
13979
|
|
|
13942
13980
|
// src/hooks/useResizeCallbackWrapper.ts
|
|
13943
|
-
var
|
|
13981
|
+
var import_react34 = require("react");
|
|
13944
13982
|
var useResizeCallbackWrapper = (callback) => {
|
|
13945
|
-
(0,
|
|
13983
|
+
(0, import_react34.useEffect)(() => {
|
|
13946
13984
|
window.addEventListener("resize", callback);
|
|
13947
13985
|
return () => {
|
|
13948
13986
|
window.removeEventListener("resize", callback);
|
|
@@ -13985,7 +14023,7 @@ var TableSortButton = ({
|
|
|
13985
14023
|
var import_lucide_react21 = require("lucide-react");
|
|
13986
14024
|
|
|
13987
14025
|
// src/components/user-action/Menu.tsx
|
|
13988
|
-
var
|
|
14026
|
+
var import_react37 = require("react");
|
|
13989
14027
|
var import_clsx47 = __toESM(require("clsx"));
|
|
13990
14028
|
|
|
13991
14029
|
// src/utils/bagFunctions.ts
|
|
@@ -14057,15 +14095,15 @@ var usePopoverPosition = (trigger, options) => {
|
|
|
14057
14095
|
};
|
|
14058
14096
|
|
|
14059
14097
|
// src/hooks/useHoverState.ts
|
|
14060
|
-
var
|
|
14098
|
+
var import_react35 = require("react");
|
|
14061
14099
|
var defaultUseHoverStateProps = {
|
|
14062
14100
|
closingDelay: 200,
|
|
14063
14101
|
isDisabled: false
|
|
14064
14102
|
};
|
|
14065
14103
|
var useHoverState = (props = void 0) => {
|
|
14066
14104
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
14067
|
-
const [isHovered, setIsHovered] = (0,
|
|
14068
|
-
const [timer, setTimer] = (0,
|
|
14105
|
+
const [isHovered, setIsHovered] = (0, import_react35.useState)(false);
|
|
14106
|
+
const [timer, setTimer] = (0, import_react35.useState)();
|
|
14069
14107
|
const onMouseEnter = () => {
|
|
14070
14108
|
if (isDisabled) {
|
|
14071
14109
|
return;
|
|
@@ -14081,14 +14119,14 @@ var useHoverState = (props = void 0) => {
|
|
|
14081
14119
|
setIsHovered(false);
|
|
14082
14120
|
}, closingDelay));
|
|
14083
14121
|
};
|
|
14084
|
-
(0,
|
|
14122
|
+
(0, import_react35.useEffect)(() => {
|
|
14085
14123
|
if (timer) {
|
|
14086
14124
|
return () => {
|
|
14087
14125
|
clearTimeout(timer);
|
|
14088
14126
|
};
|
|
14089
14127
|
}
|
|
14090
14128
|
});
|
|
14091
|
-
(0,
|
|
14129
|
+
(0, import_react35.useEffect)(() => {
|
|
14092
14130
|
if (timer) {
|
|
14093
14131
|
clearTimeout(timer);
|
|
14094
14132
|
}
|
|
@@ -14101,9 +14139,9 @@ var useHoverState = (props = void 0) => {
|
|
|
14101
14139
|
};
|
|
14102
14140
|
|
|
14103
14141
|
// src/hooks/useOutsideClick.ts
|
|
14104
|
-
var
|
|
14142
|
+
var import_react36 = require("react");
|
|
14105
14143
|
var useOutsideClick = (refs, handler) => {
|
|
14106
|
-
(0,
|
|
14144
|
+
(0, import_react36.useEffect)(() => {
|
|
14107
14145
|
const listener = (event) => {
|
|
14108
14146
|
if (event.target === null) return;
|
|
14109
14147
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -14161,10 +14199,10 @@ var Menu = ({
|
|
|
14161
14199
|
menuClassName = ""
|
|
14162
14200
|
}) => {
|
|
14163
14201
|
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
14164
|
-
const triggerRef = (0,
|
|
14165
|
-
const menuRef = (0,
|
|
14202
|
+
const triggerRef = (0, import_react37.useRef)(null);
|
|
14203
|
+
const menuRef = (0, import_react37.useRef)(null);
|
|
14166
14204
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
14167
|
-
const [isHidden, setIsHidden] = (0,
|
|
14205
|
+
const [isHidden, setIsHidden] = (0, import_react37.useState)(true);
|
|
14168
14206
|
const bag = {
|
|
14169
14207
|
isOpen,
|
|
14170
14208
|
close: () => setIsOpen(false),
|
|
@@ -14175,7 +14213,7 @@ var Menu = ({
|
|
|
14175
14213
|
triggerRef.current?.getBoundingClientRect(),
|
|
14176
14214
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
14177
14215
|
);
|
|
14178
|
-
(0,
|
|
14216
|
+
(0, import_react37.useEffect)(() => {
|
|
14179
14217
|
if (!isOpen) return;
|
|
14180
14218
|
const triggerEl = triggerRef.current;
|
|
14181
14219
|
if (!triggerEl) return;
|
|
@@ -14192,7 +14230,7 @@ var Menu = ({
|
|
|
14192
14230
|
window.removeEventListener("resize", close);
|
|
14193
14231
|
};
|
|
14194
14232
|
}, [isOpen, setIsOpen]);
|
|
14195
|
-
(0,
|
|
14233
|
+
(0, import_react37.useEffect)(() => {
|
|
14196
14234
|
if (isOpen) {
|
|
14197
14235
|
setIsHidden(false);
|
|
14198
14236
|
}
|
|
@@ -14228,7 +14266,7 @@ var Menu = ({
|
|
|
14228
14266
|
};
|
|
14229
14267
|
|
|
14230
14268
|
// src/components/table/TableFilterButton.tsx
|
|
14231
|
-
var
|
|
14269
|
+
var import_react38 = require("react");
|
|
14232
14270
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14233
14271
|
var defaultTableFilterTranslation = {
|
|
14234
14272
|
en: {
|
|
@@ -14254,9 +14292,9 @@ var TableFilterButton = ({
|
|
|
14254
14292
|
}) => {
|
|
14255
14293
|
const translation = useTranslation([formTranslation, defaultTableFilterTranslation]);
|
|
14256
14294
|
const columnFilterValue = column.getFilterValue();
|
|
14257
|
-
const [filterValue, setFilterValue] = (0,
|
|
14295
|
+
const [filterValue, setFilterValue] = (0, import_react38.useState)(columnFilterValue);
|
|
14258
14296
|
const hasFilter = !!filterValue;
|
|
14259
|
-
(0,
|
|
14297
|
+
(0, import_react38.useEffect)(() => {
|
|
14260
14298
|
setFilterValue(columnFilterValue);
|
|
14261
14299
|
}, [columnFilterValue]);
|
|
14262
14300
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
@@ -14370,22 +14408,22 @@ var Table = ({
|
|
|
14370
14408
|
columns,
|
|
14371
14409
|
...tableOptions
|
|
14372
14410
|
}) => {
|
|
14373
|
-
const ref = (0,
|
|
14374
|
-
const tableRef = (0,
|
|
14375
|
-
const [columnSizing, setColumnSizing] = (0,
|
|
14411
|
+
const ref = (0, import_react39.useRef)(null);
|
|
14412
|
+
const tableRef = (0, import_react39.useRef)(null);
|
|
14413
|
+
const [columnSizing, setColumnSizing] = (0, import_react39.useState)(columns.reduce((previousValue, currentValue) => {
|
|
14376
14414
|
return {
|
|
14377
14415
|
...previousValue,
|
|
14378
14416
|
[currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
|
|
14379
14417
|
};
|
|
14380
14418
|
}, {}));
|
|
14381
|
-
const [columnSizingInfo, setColumnSizingInfo] = (0,
|
|
14382
|
-
const [pagination, setPagination] = (0,
|
|
14419
|
+
const [columnSizingInfo, setColumnSizingInfo] = (0, import_react39.useState)();
|
|
14420
|
+
const [pagination, setPagination] = (0, import_react39.useState)({
|
|
14383
14421
|
pageSize: 10,
|
|
14384
14422
|
pageIndex: 0,
|
|
14385
14423
|
...initialState?.pagination
|
|
14386
14424
|
});
|
|
14387
|
-
const [columnFilters, setColumnFilters] = (0,
|
|
14388
|
-
const computedColumnMinWidths = (0,
|
|
14425
|
+
const [columnFilters, setColumnFilters] = (0, import_react39.useState)(initialState?.columnFilters);
|
|
14426
|
+
const computedColumnMinWidths = (0, import_react39.useMemo)(() => {
|
|
14389
14427
|
return columns.reduce((previousValue, column) => {
|
|
14390
14428
|
return {
|
|
14391
14429
|
...previousValue,
|
|
@@ -14394,7 +14432,7 @@ var Table = ({
|
|
|
14394
14432
|
};
|
|
14395
14433
|
}, {});
|
|
14396
14434
|
}, [columns, defaultColumn]);
|
|
14397
|
-
const computedColumnMaxWidths = (0,
|
|
14435
|
+
const computedColumnMaxWidths = (0, import_react39.useMemo)(() => {
|
|
14398
14436
|
return columns.reduce((previousValue, column) => {
|
|
14399
14437
|
return {
|
|
14400
14438
|
...previousValue,
|
|
@@ -14402,12 +14440,12 @@ var Table = ({
|
|
|
14402
14440
|
};
|
|
14403
14441
|
}, {});
|
|
14404
14442
|
}, [columns, defaultColumn]);
|
|
14405
|
-
const tableMinWidth = (0,
|
|
14443
|
+
const tableMinWidth = (0, import_react39.useMemo)(() => {
|
|
14406
14444
|
return columns.reduce((sum, column) => {
|
|
14407
14445
|
return sum + computedColumnMinWidths[column.id];
|
|
14408
14446
|
}, 0);
|
|
14409
14447
|
}, [columns, computedColumnMinWidths]);
|
|
14410
|
-
const updateColumnSizes = (0,
|
|
14448
|
+
const updateColumnSizes = (0, import_react39.useMemo)(() => {
|
|
14411
14449
|
return (previous) => {
|
|
14412
14450
|
const updateSizing = {
|
|
14413
14451
|
...columnSizing,
|
|
@@ -14524,18 +14562,18 @@ var Table = ({
|
|
|
14524
14562
|
columnResizeMode: "onChange",
|
|
14525
14563
|
...tableOptions
|
|
14526
14564
|
});
|
|
14527
|
-
const [hasInitializedSizing, setHasInitializedSizing] = (0,
|
|
14528
|
-
(0,
|
|
14565
|
+
const [hasInitializedSizing, setHasInitializedSizing] = (0, import_react39.useState)(false);
|
|
14566
|
+
(0, import_react39.useEffect)(() => {
|
|
14529
14567
|
if (!hasInitializedSizing && ref.current) {
|
|
14530
14568
|
setHasInitializedSizing(true);
|
|
14531
14569
|
table.setColumnSizing(updateColumnSizes(columnSizing));
|
|
14532
14570
|
}
|
|
14533
14571
|
}, [columnSizing, hasInitializedSizing]);
|
|
14534
|
-
useResizeCallbackWrapper((0,
|
|
14572
|
+
useResizeCallbackWrapper((0, import_react39.useCallback)(() => {
|
|
14535
14573
|
table.setColumnSizing(updateColumnSizes);
|
|
14536
14574
|
}, [updateColumnSizes]));
|
|
14537
14575
|
const pageCount = table.getPageCount();
|
|
14538
|
-
(0,
|
|
14576
|
+
(0, import_react39.useEffect)(() => {
|
|
14539
14577
|
const totalPages = pageCount;
|
|
14540
14578
|
if (totalPages === 0) {
|
|
14541
14579
|
if (pagination.pageIndex !== 0) {
|
|
@@ -14551,7 +14589,7 @@ var Table = ({
|
|
|
14551
14589
|
}));
|
|
14552
14590
|
}
|
|
14553
14591
|
}, [data, pageCount, pagination.pageSize, pagination.pageIndex]);
|
|
14554
|
-
const columnSizeVars = (0,
|
|
14592
|
+
const columnSizeVars = (0, import_react39.useMemo)(() => {
|
|
14555
14593
|
const headers = table.getFlatHeaders();
|
|
14556
14594
|
const colSizes = {};
|
|
14557
14595
|
for (let i = 0; i < headers.length; i++) {
|
|
@@ -14686,7 +14724,7 @@ var TableWithSelection = ({
|
|
|
14686
14724
|
meta,
|
|
14687
14725
|
...props
|
|
14688
14726
|
}) => {
|
|
14689
|
-
const columnsWithSelection = (0,
|
|
14727
|
+
const columnsWithSelection = (0, import_react39.useMemo)(() => {
|
|
14690
14728
|
return [
|
|
14691
14729
|
{
|
|
14692
14730
|
id: selectionRowId,
|
|
@@ -14755,7 +14793,7 @@ var TableWithSelection = ({
|
|
|
14755
14793
|
};
|
|
14756
14794
|
|
|
14757
14795
|
// src/components/user-action/CopyToClipboardWrapper.tsx
|
|
14758
|
-
var
|
|
14796
|
+
var import_react40 = require("react");
|
|
14759
14797
|
var import_clsx49 = require("clsx");
|
|
14760
14798
|
|
|
14761
14799
|
// src/utils/writeToClipboard.ts
|
|
@@ -14775,8 +14813,8 @@ var CopyToClipboardWrapper = ({
|
|
|
14775
14813
|
zIndex = 10
|
|
14776
14814
|
}) => {
|
|
14777
14815
|
const translation = useTranslation([formTranslation]);
|
|
14778
|
-
const [isShowingIndication, setIsShowingIndication] = (0,
|
|
14779
|
-
const [isShowingConfirmation, setIsShowingConfirmation] = (0,
|
|
14816
|
+
const [isShowingIndication, setIsShowingIndication] = (0, import_react40.useState)(false);
|
|
14817
|
+
const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react40.useState)(false);
|
|
14780
14818
|
const positionClasses = {
|
|
14781
14819
|
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
14782
14820
|
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
@@ -14918,7 +14956,7 @@ var DateTimePicker = ({
|
|
|
14918
14956
|
};
|
|
14919
14957
|
|
|
14920
14958
|
// src/components/user-action/ScrollPicker.tsx
|
|
14921
|
-
var
|
|
14959
|
+
var import_react41 = require("react");
|
|
14922
14960
|
var import_clsx51 = __toESM(require("clsx"));
|
|
14923
14961
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
14924
14962
|
var up = 1;
|
|
@@ -14939,7 +14977,7 @@ var ScrollPicker = ({
|
|
|
14939
14977
|
transition,
|
|
14940
14978
|
items,
|
|
14941
14979
|
lastTimeStamp
|
|
14942
|
-
}, setAnimation] = (0,
|
|
14980
|
+
}, setAnimation] = (0, import_react41.useState)({
|
|
14943
14981
|
targetIndex: selectedIndex,
|
|
14944
14982
|
currentIndex: disabled ? selectedIndex : 0,
|
|
14945
14983
|
velocity: 0,
|
|
@@ -14955,7 +14993,7 @@ var ScrollPicker = ({
|
|
|
14955
14993
|
const itemHeight = 40;
|
|
14956
14994
|
const distance = 8;
|
|
14957
14995
|
const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
|
|
14958
|
-
const getDirection = (0,
|
|
14996
|
+
const getDirection = (0, import_react41.useCallback)((targetIndex, currentIndex2, transition2, length) => {
|
|
14959
14997
|
if (targetIndex === currentIndex2) {
|
|
14960
14998
|
return transition2 > 0 ? up : down;
|
|
14961
14999
|
}
|
|
@@ -14965,7 +15003,7 @@ var ScrollPicker = ({
|
|
|
14965
15003
|
}
|
|
14966
15004
|
return distanceForward >= length / 2 ? down : up;
|
|
14967
15005
|
}, []);
|
|
14968
|
-
const animate = (0,
|
|
15006
|
+
const animate = (0, import_react41.useCallback)((timestamp, startTime) => {
|
|
14969
15007
|
setAnimation((prevState) => {
|
|
14970
15008
|
const {
|
|
14971
15009
|
targetIndex,
|
|
@@ -15038,7 +15076,7 @@ var ScrollPicker = ({
|
|
|
15038
15076
|
};
|
|
15039
15077
|
});
|
|
15040
15078
|
}, [disabled, getDirection, onChange]);
|
|
15041
|
-
(0,
|
|
15079
|
+
(0, import_react41.useEffect)(() => {
|
|
15042
15080
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
15043
15081
|
});
|
|
15044
15082
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -15206,18 +15244,18 @@ var Tooltip = ({
|
|
|
15206
15244
|
};
|
|
15207
15245
|
|
|
15208
15246
|
// src/components/user-action/input/InsideLabelInput.tsx
|
|
15247
|
+
var import_react42 = require("react");
|
|
15209
15248
|
var import_react43 = require("react");
|
|
15210
|
-
var import_react44 = require("react");
|
|
15211
15249
|
var import_clsx54 = __toESM(require("clsx"));
|
|
15212
15250
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
15213
|
-
var InsideLabelInput = (0,
|
|
15251
|
+
var InsideLabelInput = (0, import_react43.forwardRef)(function InsideLabelInput2({
|
|
15214
15252
|
id: customId,
|
|
15215
15253
|
label,
|
|
15216
15254
|
...props
|
|
15217
15255
|
}, forwardedRef) {
|
|
15218
15256
|
const { value } = props;
|
|
15219
|
-
const [isFocused, setIsFocused] = (0,
|
|
15220
|
-
const generatedId = (0,
|
|
15257
|
+
const [isFocused, setIsFocused] = (0, import_react43.useState)(false);
|
|
15258
|
+
const generatedId = (0, import_react42.useId)();
|
|
15221
15259
|
const id = customId ?? generatedId;
|
|
15222
15260
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: (0, import_clsx54.default)("relative"), children: [
|
|
15223
15261
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
@@ -15270,20 +15308,20 @@ var InsideLabelInputUncontrolled = ({
|
|
|
15270
15308
|
};
|
|
15271
15309
|
|
|
15272
15310
|
// src/components/user-action/input/ToggleableInput.tsx
|
|
15273
|
-
var
|
|
15311
|
+
var import_react44 = require("react");
|
|
15274
15312
|
var import_lucide_react24 = require("lucide-react");
|
|
15275
15313
|
var import_clsx55 = __toESM(require("clsx"));
|
|
15276
15314
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
15277
|
-
var ToggleableInput = (0,
|
|
15315
|
+
var ToggleableInput = (0, import_react44.forwardRef)(function ToggleableInput2({
|
|
15278
15316
|
value,
|
|
15279
15317
|
initialState = "display",
|
|
15280
15318
|
editCompleteOptions,
|
|
15281
15319
|
...props
|
|
15282
15320
|
}, forwardedRef) {
|
|
15283
|
-
const [isEditing, setIsEditing] = (0,
|
|
15284
|
-
const innerRef = (0,
|
|
15285
|
-
(0,
|
|
15286
|
-
(0,
|
|
15321
|
+
const [isEditing, setIsEditing] = (0, import_react44.useState)(initialState !== "display");
|
|
15322
|
+
const innerRef = (0, import_react44.useRef)(null);
|
|
15323
|
+
(0, import_react44.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
15324
|
+
(0, import_react44.useEffect)(() => {
|
|
15287
15325
|
if (isEditing) {
|
|
15288
15326
|
innerRef.current?.focus();
|
|
15289
15327
|
}
|
|
@@ -15338,33 +15376,33 @@ var ToggleableInputUncontrolled = ({
|
|
|
15338
15376
|
};
|
|
15339
15377
|
|
|
15340
15378
|
// src/components/utils/FocusTrap.tsx
|
|
15379
|
+
var import_react45 = require("react");
|
|
15341
15380
|
var import_react46 = require("react");
|
|
15342
15381
|
var import_react47 = require("react");
|
|
15343
|
-
var import_react48 = require("react");
|
|
15344
15382
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
15345
|
-
var FocusTrap = (0,
|
|
15383
|
+
var FocusTrap = (0, import_react47.forwardRef)(function FocusTrap2({
|
|
15346
15384
|
active = true,
|
|
15347
15385
|
initialFocus,
|
|
15348
15386
|
focusFirst = false,
|
|
15349
15387
|
...props
|
|
15350
15388
|
}, forwardedRef) {
|
|
15351
|
-
const innerRef = (0,
|
|
15352
|
-
(0,
|
|
15389
|
+
const innerRef = (0, import_react45.useRef)(null);
|
|
15390
|
+
(0, import_react46.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
15353
15391
|
useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
|
|
15354
15392
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { ref: innerRef, ...props });
|
|
15355
15393
|
});
|
|
15356
15394
|
|
|
15357
15395
|
// src/components/utils/Transition.tsx
|
|
15358
|
-
var
|
|
15396
|
+
var import_react48 = require("react");
|
|
15359
15397
|
function Transition({
|
|
15360
15398
|
children,
|
|
15361
15399
|
show,
|
|
15362
15400
|
includeAnimation = true
|
|
15363
15401
|
}) {
|
|
15364
|
-
const [isOpen, setIsOpen] = (0,
|
|
15365
|
-
const [isTransitioning, setIsTransitioning] = (0,
|
|
15402
|
+
const [isOpen, setIsOpen] = (0, import_react48.useState)(show);
|
|
15403
|
+
const [isTransitioning, setIsTransitioning] = (0, import_react48.useState)(!isOpen);
|
|
15366
15404
|
const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
|
|
15367
|
-
(0,
|
|
15405
|
+
(0, import_react48.useEffect)(() => {
|
|
15368
15406
|
setIsOpen(show);
|
|
15369
15407
|
setIsTransitioning(true);
|
|
15370
15408
|
}, [show]);
|