@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/index.js
CHANGED
|
@@ -7194,7 +7194,7 @@ var LanguageProvider = ({ children, language }) => {
|
|
|
7194
7194
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(LanguageContext.Provider, { value: {
|
|
7195
7195
|
language: resolvedLanguage,
|
|
7196
7196
|
setLanguage: (newLanguage) => {
|
|
7197
|
-
if (language) {
|
|
7197
|
+
if (language !== "system") {
|
|
7198
7198
|
console.warn("LanguageProvider: Attempting to change the language while setting a fixed language won't have any effect. Change the language provided to the LanguageProvider instead.");
|
|
7199
7199
|
}
|
|
7200
7200
|
setStoredLanguage(newLanguage);
|
|
@@ -8118,7 +8118,6 @@ var import_clsx10 = __toESM(require("clsx"));
|
|
|
8118
8118
|
// src/components/dialog/Dialog.tsx
|
|
8119
8119
|
var import_react13 = require("react");
|
|
8120
8120
|
var import_react14 = require("react");
|
|
8121
|
-
var import_react15 = require("react");
|
|
8122
8121
|
var import_clsx9 = __toESM(require("clsx"));
|
|
8123
8122
|
var import_lucide_react3 = require("lucide-react");
|
|
8124
8123
|
|
|
@@ -8481,15 +8480,18 @@ var Dialog = ({
|
|
|
8481
8480
|
description,
|
|
8482
8481
|
isModal = true,
|
|
8483
8482
|
onClose,
|
|
8484
|
-
className,
|
|
8485
8483
|
backgroundClassName,
|
|
8486
8484
|
position = "center",
|
|
8487
|
-
isAnimated = true
|
|
8485
|
+
isAnimated = true,
|
|
8486
|
+
containerClassName,
|
|
8487
|
+
...props
|
|
8488
8488
|
}) => {
|
|
8489
8489
|
const translation = useTranslation([formTranslation]);
|
|
8490
8490
|
const [visible, setVisible] = (0, import_react14.useState)(isOpen);
|
|
8491
|
-
const
|
|
8492
|
-
|
|
8491
|
+
const generatedId = (0, import_react13.useId)();
|
|
8492
|
+
const id = props.id ?? generatedId;
|
|
8493
|
+
const ref = (0, import_react14.useRef)(null);
|
|
8494
|
+
(0, import_react14.useEffect)(() => {
|
|
8493
8495
|
if (isOpen) {
|
|
8494
8496
|
setVisible(true);
|
|
8495
8497
|
} else {
|
|
@@ -8514,14 +8516,16 @@ var Dialog = ({
|
|
|
8514
8516
|
none: ""
|
|
8515
8517
|
};
|
|
8516
8518
|
const positionStyle = positionMap[position];
|
|
8519
|
+
if (!visible) return;
|
|
8517
8520
|
return (0, import_react_dom.createPortal)(
|
|
8518
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
8521
|
+
/* @__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: [
|
|
8519
8522
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
8520
8523
|
"div",
|
|
8521
8524
|
{
|
|
8525
|
+
id: `dialog-background-${id}`,
|
|
8522
8526
|
hidden: !visible,
|
|
8523
8527
|
className: (0, import_clsx9.default)(
|
|
8524
|
-
"fixed inset-0 h-screen w-screen bg-overlay-shadow
|
|
8528
|
+
"fixed inset-0 h-screen w-screen bg-overlay-shadow",
|
|
8525
8529
|
{
|
|
8526
8530
|
"motion-safe:animate-fade-in": isOpen,
|
|
8527
8531
|
"motion-safe:animate-fade-out": !isOpen
|
|
@@ -8540,6 +8544,8 @@ var Dialog = ({
|
|
|
8540
8544
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
8541
8545
|
"div",
|
|
8542
8546
|
{
|
|
8547
|
+
...props,
|
|
8548
|
+
id: `dialog-${id}`,
|
|
8543
8549
|
ref,
|
|
8544
8550
|
hidden: !visible,
|
|
8545
8551
|
onKeyDown: (event) => {
|
|
@@ -8553,13 +8559,13 @@ var Dialog = ({
|
|
|
8553
8559
|
}
|
|
8554
8560
|
},
|
|
8555
8561
|
className: (0, import_clsx9.default)(
|
|
8556
|
-
"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)]
|
|
8562
|
+
"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)]",
|
|
8557
8563
|
{
|
|
8558
8564
|
"motion-safe:animate-pop-in": isOpen,
|
|
8559
8565
|
"motion-safe:animate-pop-out": !isOpen
|
|
8560
8566
|
},
|
|
8561
8567
|
positionStyle,
|
|
8562
|
-
className
|
|
8568
|
+
props.className
|
|
8563
8569
|
),
|
|
8564
8570
|
children: [
|
|
8565
8571
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "typography-title-lg mr-8", children: titleElement }),
|
|
@@ -8676,17 +8682,17 @@ var DiscardChangesDialog = ({
|
|
|
8676
8682
|
};
|
|
8677
8683
|
|
|
8678
8684
|
// src/components/user-action/input/Input.tsx
|
|
8679
|
-
var
|
|
8685
|
+
var import_react17 = require("react");
|
|
8680
8686
|
var import_clsx11 = __toESM(require("clsx"));
|
|
8681
8687
|
|
|
8682
8688
|
// src/hooks/useDelay.ts
|
|
8683
|
-
var
|
|
8689
|
+
var import_react15 = require("react");
|
|
8684
8690
|
var defaultOptions2 = {
|
|
8685
8691
|
delay: 3e3,
|
|
8686
8692
|
disabled: false
|
|
8687
8693
|
};
|
|
8688
8694
|
function useDelay(options) {
|
|
8689
|
-
const [timer, setTimer] = (0,
|
|
8695
|
+
const [timer, setTimer] = (0, import_react15.useState)(void 0);
|
|
8690
8696
|
const { delay, disabled } = {
|
|
8691
8697
|
...defaultOptions2,
|
|
8692
8698
|
...options
|
|
@@ -8705,12 +8711,12 @@ function useDelay(options) {
|
|
|
8705
8711
|
setTimer(void 0);
|
|
8706
8712
|
}, delay));
|
|
8707
8713
|
};
|
|
8708
|
-
(0,
|
|
8714
|
+
(0, import_react15.useEffect)(() => {
|
|
8709
8715
|
return () => {
|
|
8710
8716
|
clearTimeout(timer);
|
|
8711
8717
|
};
|
|
8712
8718
|
}, [timer]);
|
|
8713
|
-
(0,
|
|
8719
|
+
(0, import_react15.useEffect)(() => {
|
|
8714
8720
|
if (disabled) {
|
|
8715
8721
|
clearTimeout(timer);
|
|
8716
8722
|
setTimer(void 0);
|
|
@@ -8720,9 +8726,9 @@ function useDelay(options) {
|
|
|
8720
8726
|
}
|
|
8721
8727
|
|
|
8722
8728
|
// src/hooks/focus/useFocusManagement.ts
|
|
8723
|
-
var
|
|
8729
|
+
var import_react16 = require("react");
|
|
8724
8730
|
function useFocusManagement() {
|
|
8725
|
-
const getFocusableElements = (0,
|
|
8731
|
+
const getFocusableElements = (0, import_react16.useCallback)(() => {
|
|
8726
8732
|
return Array.from(
|
|
8727
8733
|
document.querySelectorAll(
|
|
8728
8734
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -8731,7 +8737,7 @@ function useFocusManagement() {
|
|
|
8731
8737
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
8732
8738
|
);
|
|
8733
8739
|
}, []);
|
|
8734
|
-
const getNextFocusElement = (0,
|
|
8740
|
+
const getNextFocusElement = (0, import_react16.useCallback)(() => {
|
|
8735
8741
|
const elements = getFocusableElements();
|
|
8736
8742
|
if (elements.length === 0) {
|
|
8737
8743
|
return void 0;
|
|
@@ -8743,11 +8749,11 @@ function useFocusManagement() {
|
|
|
8743
8749
|
}
|
|
8744
8750
|
return nextElement;
|
|
8745
8751
|
}, [getFocusableElements]);
|
|
8746
|
-
const focusNext = (0,
|
|
8752
|
+
const focusNext = (0, import_react16.useCallback)(() => {
|
|
8747
8753
|
const nextElement = getNextFocusElement();
|
|
8748
8754
|
nextElement?.focus();
|
|
8749
8755
|
}, [getNextFocusElement]);
|
|
8750
|
-
const getPreviousFocusElement = (0,
|
|
8756
|
+
const getPreviousFocusElement = (0, import_react16.useCallback)(() => {
|
|
8751
8757
|
const elements = getFocusableElements();
|
|
8752
8758
|
if (elements.length === 0) {
|
|
8753
8759
|
return void 0;
|
|
@@ -8763,7 +8769,7 @@ function useFocusManagement() {
|
|
|
8763
8769
|
}
|
|
8764
8770
|
return previousElement;
|
|
8765
8771
|
}, [getFocusableElements]);
|
|
8766
|
-
const focusPrevious = (0,
|
|
8772
|
+
const focusPrevious = (0, import_react16.useCallback)(() => {
|
|
8767
8773
|
const previousElement = getPreviousFocusElement();
|
|
8768
8774
|
if (previousElement) previousElement.focus();
|
|
8769
8775
|
}, [getPreviousFocusElement]);
|
|
@@ -8784,7 +8790,7 @@ var defaultEditCompleteOptions = {
|
|
|
8784
8790
|
afterDelay: true,
|
|
8785
8791
|
delay: 2500
|
|
8786
8792
|
};
|
|
8787
|
-
var Input = (0,
|
|
8793
|
+
var Input = (0, import_react17.forwardRef)(function Input2({
|
|
8788
8794
|
value,
|
|
8789
8795
|
onChange,
|
|
8790
8796
|
onChangeText,
|
|
@@ -8806,8 +8812,8 @@ var Input = (0, import_react18.forwardRef)(function Input2({
|
|
|
8806
8812
|
restartTimer,
|
|
8807
8813
|
clearTimer
|
|
8808
8814
|
} = useDelay({ delay, disabled: !afterDelay });
|
|
8809
|
-
const innerRef = (0,
|
|
8810
|
-
(0,
|
|
8815
|
+
const innerRef = (0, import_react17.useRef)(null);
|
|
8816
|
+
(0, import_react17.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
8811
8817
|
const { focusNext } = useFocusManagement();
|
|
8812
8818
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8813
8819
|
"input",
|
|
@@ -8892,7 +8898,7 @@ var InputDialog = ({
|
|
|
8892
8898
|
};
|
|
8893
8899
|
|
|
8894
8900
|
// src/components/user-action/select/Select.tsx
|
|
8895
|
-
var
|
|
8901
|
+
var import_react19 = require("react");
|
|
8896
8902
|
var import_clsx13 = __toESM(require("clsx"));
|
|
8897
8903
|
|
|
8898
8904
|
// src/utils/match.ts
|
|
@@ -8986,7 +8992,7 @@ var ChipList = ({
|
|
|
8986
8992
|
};
|
|
8987
8993
|
|
|
8988
8994
|
// src/hooks/useFloatingElement.ts
|
|
8989
|
-
var
|
|
8995
|
+
var import_react18 = require("react");
|
|
8990
8996
|
|
|
8991
8997
|
// src/utils/math.ts
|
|
8992
8998
|
var clamp = (value, range2 = [0, 1]) => {
|
|
@@ -9049,9 +9055,9 @@ function useFloatingElement({
|
|
|
9049
9055
|
screenPadding = 16,
|
|
9050
9056
|
gap = 4
|
|
9051
9057
|
}) {
|
|
9052
|
-
const [style, setStyle] = (0,
|
|
9058
|
+
const [style, setStyle] = (0, import_react18.useState)();
|
|
9053
9059
|
const isMounted = useIsMounted();
|
|
9054
|
-
const calculate = (0,
|
|
9060
|
+
const calculate = (0, import_react18.useCallback)(() => {
|
|
9055
9061
|
const containerRect = containerRef.current.getBoundingClientRect();
|
|
9056
9062
|
const windowRect = windowRef?.current.getBoundingClientRect() ?? {
|
|
9057
9063
|
top: 0,
|
|
@@ -9081,14 +9087,14 @@ function useFloatingElement({
|
|
|
9081
9087
|
}, [anchorRef, containerRef, gap, horizontalAlignment, screenPadding, verticalAlignment, windowRef]);
|
|
9082
9088
|
const height = containerRef.current?.getBoundingClientRect().height;
|
|
9083
9089
|
const width = containerRef.current?.getBoundingClientRect().width;
|
|
9084
|
-
(0,
|
|
9090
|
+
(0, import_react18.useEffect)(() => {
|
|
9085
9091
|
if (active && isMounted) {
|
|
9086
9092
|
calculate();
|
|
9087
9093
|
} else {
|
|
9088
9094
|
setStyle(void 0);
|
|
9089
9095
|
}
|
|
9090
9096
|
}, [calculate, active, isMounted, height, width]);
|
|
9091
|
-
(0,
|
|
9097
|
+
(0, import_react18.useEffect)(() => {
|
|
9092
9098
|
window.addEventListener("resize", calculate);
|
|
9093
9099
|
let timeout;
|
|
9094
9100
|
if (isPolling) {
|
|
@@ -9108,11 +9114,11 @@ function useFloatingElement({
|
|
|
9108
9114
|
var import_react_dom2 = require("react-dom");
|
|
9109
9115
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
9110
9116
|
var defaultToggleOpenOptions = {
|
|
9111
|
-
|
|
9117
|
+
highlightStartPositionBehavior: "first"
|
|
9112
9118
|
};
|
|
9113
|
-
var SelectContext = (0,
|
|
9119
|
+
var SelectContext = (0, import_react19.createContext)(null);
|
|
9114
9120
|
function useSelectContext() {
|
|
9115
|
-
const ctx = (0,
|
|
9121
|
+
const ctx = (0, import_react19.useContext)(SelectContext);
|
|
9116
9122
|
if (!ctx) {
|
|
9117
9123
|
throw new Error("SelectContext must be used within a ListBoxPrimitive");
|
|
9118
9124
|
}
|
|
@@ -9131,47 +9137,62 @@ var SelectRoot = ({
|
|
|
9131
9137
|
isMultiSelect = false,
|
|
9132
9138
|
iconAppearance = "left"
|
|
9133
9139
|
}) => {
|
|
9134
|
-
const
|
|
9135
|
-
const
|
|
9136
|
-
const generatedId = (0, import_react20.useId)();
|
|
9140
|
+
const triggerRef = (0, import_react19.useRef)(null);
|
|
9141
|
+
const generatedId = (0, import_react19.useId)();
|
|
9137
9142
|
const usedId = id ?? generatedId;
|
|
9138
|
-
const [internalState, setInternalState] = (0,
|
|
9139
|
-
isOpen
|
|
9143
|
+
const [internalState, setInternalState] = (0, import_react19.useState)({
|
|
9144
|
+
isOpen,
|
|
9145
|
+
options: []
|
|
9140
9146
|
});
|
|
9141
|
-
const selectedValues =
|
|
9147
|
+
const selectedValues = (0, import_react19.useMemo)(
|
|
9148
|
+
() => isMultiSelect ? values ?? [] : [value].filter(Boolean),
|
|
9149
|
+
[isMultiSelect, value, values]
|
|
9150
|
+
);
|
|
9151
|
+
const selectedOptions = (0, import_react19.useMemo)(
|
|
9152
|
+
() => selectedValues.map((value2) => internalState.options.find((option) => value2 === option.value)).filter(Boolean),
|
|
9153
|
+
[selectedValues, internalState.options]
|
|
9154
|
+
);
|
|
9142
9155
|
const state = {
|
|
9143
9156
|
...internalState,
|
|
9144
9157
|
id: usedId,
|
|
9145
9158
|
disabled,
|
|
9146
9159
|
invalid,
|
|
9147
9160
|
value: selectedValues,
|
|
9148
|
-
|
|
9149
|
-
selectedOptions: selectedValues.map((value2) => options.find((option) => value2 === option.value)).filter(Boolean)
|
|
9161
|
+
selectedOptions
|
|
9150
9162
|
};
|
|
9151
9163
|
const config = {
|
|
9152
9164
|
isMultiSelect,
|
|
9153
9165
|
iconAppearance
|
|
9154
9166
|
};
|
|
9155
|
-
const registerItem = (0,
|
|
9156
|
-
|
|
9157
|
-
const
|
|
9158
|
-
|
|
9167
|
+
const registerItem = (0, import_react19.useCallback)((item) => {
|
|
9168
|
+
setInternalState((prev) => {
|
|
9169
|
+
const updatedOptions = [...prev.options, item];
|
|
9170
|
+
updatedOptions.sort((a, b) => {
|
|
9159
9171
|
const aEl = a.ref.current;
|
|
9160
9172
|
const bEl = b.ref.current;
|
|
9161
9173
|
if (!aEl || !bEl) return 0;
|
|
9162
9174
|
return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
9163
9175
|
});
|
|
9164
|
-
return
|
|
9176
|
+
return {
|
|
9177
|
+
...prev,
|
|
9178
|
+
options: updatedOptions
|
|
9179
|
+
};
|
|
9165
9180
|
});
|
|
9166
9181
|
}, []);
|
|
9167
|
-
const unregisterItem = (0,
|
|
9168
|
-
|
|
9182
|
+
const unregisterItem = (0, import_react19.useCallback)((value2) => {
|
|
9183
|
+
setInternalState((prev) => {
|
|
9184
|
+
const updatedOptions = prev.options.filter((i) => i.value !== value2);
|
|
9185
|
+
return {
|
|
9186
|
+
...prev,
|
|
9187
|
+
options: updatedOptions
|
|
9188
|
+
};
|
|
9189
|
+
});
|
|
9169
9190
|
}, []);
|
|
9170
9191
|
const toggleSelection = (value2, isSelected) => {
|
|
9171
9192
|
if (disabled) {
|
|
9172
9193
|
return;
|
|
9173
9194
|
}
|
|
9174
|
-
const option = options.find((i) => i.value === value2);
|
|
9195
|
+
const option = state.options.find((i) => i.value === value2);
|
|
9175
9196
|
if (!option) {
|
|
9176
9197
|
console.error(`SelectOption with value: ${value2} not found`);
|
|
9177
9198
|
return;
|
|
@@ -9207,42 +9228,47 @@ var SelectRoot = ({
|
|
|
9207
9228
|
highlightedValue: value2
|
|
9208
9229
|
}));
|
|
9209
9230
|
};
|
|
9210
|
-
const registerTrigger = (0,
|
|
9231
|
+
const registerTrigger = (0, import_react19.useCallback)((ref) => {
|
|
9211
9232
|
triggerRef.current = ref.current;
|
|
9212
9233
|
}, []);
|
|
9213
|
-
const unregisterTrigger = (0,
|
|
9234
|
+
const unregisterTrigger = (0, import_react19.useCallback)(() => {
|
|
9214
9235
|
triggerRef.current = null;
|
|
9215
9236
|
}, []);
|
|
9216
9237
|
const toggleOpen = (isOpen2, toggleOpenOptions) => {
|
|
9217
|
-
const {
|
|
9218
|
-
let
|
|
9219
|
-
|
|
9220
|
-
|
|
9221
|
-
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
|
|
9238
|
+
const { highlightStartPositionBehavior } = { ...defaultToggleOpenOptions, ...toggleOpenOptions };
|
|
9239
|
+
let firstSelectedValue;
|
|
9240
|
+
let firstEnabledValue;
|
|
9241
|
+
for (let i = 0; i < state.options.length; i++) {
|
|
9242
|
+
const currentOption = state.options[highlightStartPositionBehavior === "first" ? i : state.options.length - i - 1];
|
|
9243
|
+
if (!currentOption.disabled) {
|
|
9244
|
+
if (!firstEnabledValue) {
|
|
9245
|
+
firstEnabledValue = currentOption.value;
|
|
9246
|
+
}
|
|
9247
|
+
if (selectedValues.includes(currentOption.value)) {
|
|
9248
|
+
firstSelectedValue = currentOption.value;
|
|
9249
|
+
break;
|
|
9250
|
+
}
|
|
9251
|
+
}
|
|
9226
9252
|
}
|
|
9227
9253
|
setInternalState((prevState) => ({
|
|
9228
9254
|
...prevState,
|
|
9229
9255
|
isOpen: isOpen2 ?? !prevState.isOpen,
|
|
9230
|
-
highlightedValue:
|
|
9256
|
+
highlightedValue: firstSelectedValue ?? firstEnabledValue
|
|
9231
9257
|
}));
|
|
9232
9258
|
};
|
|
9233
9259
|
const moveHighlightedIndex = (delta) => {
|
|
9234
|
-
let highlightedIndex = options.findIndex((value2) => value2.value === internalState.highlightedValue);
|
|
9260
|
+
let highlightedIndex = state.options.findIndex((value2) => value2.value === internalState.highlightedValue);
|
|
9235
9261
|
if (highlightedIndex === -1) {
|
|
9236
9262
|
highlightedIndex = 0;
|
|
9237
9263
|
}
|
|
9238
|
-
const optionLength = options.length;
|
|
9264
|
+
const optionLength = state.options.length;
|
|
9239
9265
|
const startIndex = (highlightedIndex + delta % optionLength + optionLength) % optionLength;
|
|
9240
9266
|
const isForward = delta >= 0;
|
|
9241
|
-
let highlightedValue = options[startIndex].value;
|
|
9242
|
-
for (let i = 0; i < options.length; i++) {
|
|
9267
|
+
let highlightedValue = state.options[startIndex].value;
|
|
9268
|
+
for (let i = 0; i < state.options.length; i++) {
|
|
9243
9269
|
const index = (startIndex + (isForward ? i : -i) + optionLength) % optionLength;
|
|
9244
|
-
if (!options[index].disabled) {
|
|
9245
|
-
highlightedValue = options[index].value;
|
|
9270
|
+
if (!state.options[index].disabled) {
|
|
9271
|
+
highlightedValue = state.options[index].value;
|
|
9246
9272
|
break;
|
|
9247
9273
|
}
|
|
9248
9274
|
}
|
|
@@ -9251,11 +9277,11 @@ var SelectRoot = ({
|
|
|
9251
9277
|
highlightedValue
|
|
9252
9278
|
}));
|
|
9253
9279
|
};
|
|
9254
|
-
(0,
|
|
9280
|
+
(0, import_react19.useEffect)(() => {
|
|
9255
9281
|
if (!internalState.highlightedValue) return;
|
|
9256
|
-
const highlighted = options.find((value2) => value2.value === internalState.highlightedValue);
|
|
9282
|
+
const highlighted = internalState.options.find((value2) => value2.value === internalState.highlightedValue);
|
|
9257
9283
|
if (highlighted) {
|
|
9258
|
-
highlighted.ref.current
|
|
9284
|
+
highlighted.ref.current?.scrollIntoView({ behavior: "instant", block: "nearest" });
|
|
9259
9285
|
} else {
|
|
9260
9286
|
console.error(`SelectRoot: Could not find highlighted value (${internalState.highlightedValue})`);
|
|
9261
9287
|
}
|
|
@@ -9279,14 +9305,14 @@ var SelectRoot = ({
|
|
|
9279
9305
|
};
|
|
9280
9306
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContext.Provider, { value: contextValue, children });
|
|
9281
9307
|
};
|
|
9282
|
-
var SelectOption = (0,
|
|
9308
|
+
var SelectOption = (0, import_react19.forwardRef)(
|
|
9283
9309
|
function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
|
|
9284
9310
|
const { state, config, item, trigger } = useSelectContext();
|
|
9285
9311
|
const { register, unregister, toggleSelection, highlightItem } = item;
|
|
9286
|
-
const itemRef = (0,
|
|
9312
|
+
const itemRef = (0, import_react19.useRef)(null);
|
|
9287
9313
|
iconAppearance ??= config.iconAppearance;
|
|
9288
9314
|
const label = children ?? value;
|
|
9289
|
-
(0,
|
|
9315
|
+
(0, import_react19.useEffect)(() => {
|
|
9290
9316
|
register({
|
|
9291
9317
|
value,
|
|
9292
9318
|
label,
|
|
@@ -9364,13 +9390,13 @@ var defaultSelectButtonTranslation = {
|
|
|
9364
9390
|
clickToSelect: "Zum ausw\xE4hlen dr\xFCcken"
|
|
9365
9391
|
}
|
|
9366
9392
|
};
|
|
9367
|
-
var SelectButton = (0,
|
|
9393
|
+
var SelectButton = (0, import_react19.forwardRef)(function SelectButton2({ placeholder, selectedDisplay, ...props }, ref) {
|
|
9368
9394
|
const translation = useTranslation([defaultSelectButtonTranslation]);
|
|
9369
9395
|
const { state, trigger } = useSelectContext();
|
|
9370
9396
|
const { register, unregister, toggleOpen } = trigger;
|
|
9371
|
-
const innerRef = (0,
|
|
9372
|
-
(0,
|
|
9373
|
-
(0,
|
|
9397
|
+
const innerRef = (0, import_react19.useRef)(null);
|
|
9398
|
+
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current);
|
|
9399
|
+
(0, import_react19.useEffect)(() => {
|
|
9374
9400
|
register(innerRef);
|
|
9375
9401
|
return () => unregister();
|
|
9376
9402
|
}, [register, unregister]);
|
|
@@ -9392,12 +9418,12 @@ var SelectButton = (0, import_react20.forwardRef)(function SelectButton2({ place
|
|
|
9392
9418
|
props.onKeyDown?.(event);
|
|
9393
9419
|
switch (event.key) {
|
|
9394
9420
|
case "ArrowDown":
|
|
9395
|
-
toggleOpen(true, {
|
|
9421
|
+
toggleOpen(true, { highlightStartPositionBehavior: "first" });
|
|
9396
9422
|
event.preventDefault();
|
|
9397
9423
|
event.stopPropagation();
|
|
9398
9424
|
break;
|
|
9399
9425
|
case "ArrowUp":
|
|
9400
|
-
toggleOpen(true, {
|
|
9426
|
+
toggleOpen(true, { highlightStartPositionBehavior: "last" });
|
|
9401
9427
|
event.preventDefault();
|
|
9402
9428
|
event.stopPropagation();
|
|
9403
9429
|
break;
|
|
@@ -9443,12 +9469,12 @@ var SelectButton = (0, import_react20.forwardRef)(function SelectButton2({ place
|
|
|
9443
9469
|
}
|
|
9444
9470
|
);
|
|
9445
9471
|
});
|
|
9446
|
-
var SelectChipDisplay = (0,
|
|
9472
|
+
var SelectChipDisplay = (0, import_react19.forwardRef)(function SelectChipDisplay2({ ...props }, ref) {
|
|
9447
9473
|
const { state, trigger, item } = useSelectContext();
|
|
9448
9474
|
const { register, unregister, toggleOpen } = trigger;
|
|
9449
|
-
const innerRef = (0,
|
|
9450
|
-
(0,
|
|
9451
|
-
(0,
|
|
9475
|
+
const innerRef = (0, import_react19.useRef)(null);
|
|
9476
|
+
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current);
|
|
9477
|
+
(0, import_react19.useEffect)(() => {
|
|
9452
9478
|
register(innerRef);
|
|
9453
9479
|
return () => unregister();
|
|
9454
9480
|
}, [register, unregister]);
|
|
@@ -9491,10 +9517,10 @@ var SelectChipDisplay = (0, import_react20.forwardRef)(function SelectChipDispla
|
|
|
9491
9517
|
onKeyDown: (event) => {
|
|
9492
9518
|
switch (event.key) {
|
|
9493
9519
|
case "ArrowDown":
|
|
9494
|
-
toggleOpen(true, {
|
|
9520
|
+
toggleOpen(true, { highlightStartPositionBehavior: "first" });
|
|
9495
9521
|
break;
|
|
9496
9522
|
case "ArrowUp":
|
|
9497
|
-
toggleOpen(true, {
|
|
9523
|
+
toggleOpen(true, { highlightStartPositionBehavior: "last" });
|
|
9498
9524
|
}
|
|
9499
9525
|
},
|
|
9500
9526
|
size: "small",
|
|
@@ -9511,14 +9537,15 @@ var SelectChipDisplay = (0, import_react20.forwardRef)(function SelectChipDispla
|
|
|
9511
9537
|
}
|
|
9512
9538
|
);
|
|
9513
9539
|
});
|
|
9514
|
-
var SelectContent = (0,
|
|
9540
|
+
var SelectContent = (0, import_react19.forwardRef)(
|
|
9515
9541
|
function SelectContent2({
|
|
9516
9542
|
alignment,
|
|
9517
9543
|
orientation = "vertical",
|
|
9544
|
+
containerClassName,
|
|
9518
9545
|
...props
|
|
9519
9546
|
}, ref) {
|
|
9520
|
-
const innerRef = (0,
|
|
9521
|
-
(0,
|
|
9547
|
+
const innerRef = (0, import_react19.useRef)(null);
|
|
9548
|
+
(0, import_react19.useImperativeHandle)(ref, () => innerRef.current);
|
|
9522
9549
|
const { trigger, state, config, item } = useSelectContext();
|
|
9523
9550
|
const position = useFloatingElement({
|
|
9524
9551
|
active: state.isOpen,
|
|
@@ -9531,81 +9558,88 @@ var SelectContent = (0, import_react20.forwardRef)(
|
|
|
9531
9558
|
active: state.isOpen && !!position
|
|
9532
9559
|
});
|
|
9533
9560
|
return (0, import_react_dom2.createPortal)(
|
|
9534
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
{
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
vertical: "ArrowDown",
|
|
9559
|
-
horizontal: "ArrowUp"
|
|
9560
|
-
}):
|
|
9561
|
-
item.moveHighlightedIndex(1);
|
|
9562
|
-
event.preventDefault();
|
|
9563
|
-
break;
|
|
9564
|
-
case match(orientation, {
|
|
9565
|
-
vertical: "ArrowUp",
|
|
9566
|
-
horizontal: "ArrowDown"
|
|
9567
|
-
}):
|
|
9568
|
-
item.moveHighlightedIndex(-1);
|
|
9569
|
-
event.preventDefault();
|
|
9570
|
-
break;
|
|
9571
|
-
case "Home":
|
|
9572
|
-
event.preventDefault();
|
|
9573
|
-
break;
|
|
9574
|
-
case "End":
|
|
9575
|
-
event.preventDefault();
|
|
9576
|
-
break;
|
|
9577
|
-
case "Enter":
|
|
9578
|
-
// Fall through
|
|
9579
|
-
case " ":
|
|
9580
|
-
if (state.highlightedValue) {
|
|
9581
|
-
item.toggleSelection(state.highlightedValue);
|
|
9582
|
-
if (!config.isMultiSelect) {
|
|
9561
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
9562
|
+
"div",
|
|
9563
|
+
{
|
|
9564
|
+
id: `select-container-${state.id}`,
|
|
9565
|
+
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen", containerClassName),
|
|
9566
|
+
hidden: !state.isOpen,
|
|
9567
|
+
children: [
|
|
9568
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9569
|
+
"div",
|
|
9570
|
+
{
|
|
9571
|
+
id: `select-background-${state.id}`,
|
|
9572
|
+
onClick: () => trigger.toggleOpen(false),
|
|
9573
|
+
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen")
|
|
9574
|
+
}
|
|
9575
|
+
),
|
|
9576
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
9577
|
+
"ul",
|
|
9578
|
+
{
|
|
9579
|
+
...props,
|
|
9580
|
+
id: `${state.id}-listbox`,
|
|
9581
|
+
ref: innerRef,
|
|
9582
|
+
onKeyDown: (event) => {
|
|
9583
|
+
switch (event.key) {
|
|
9584
|
+
case "Escape":
|
|
9583
9585
|
trigger.toggleOpen(false);
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
+
event.preventDefault();
|
|
9587
|
+
event.stopPropagation();
|
|
9588
|
+
break;
|
|
9589
|
+
case match(orientation, {
|
|
9590
|
+
vertical: "ArrowDown",
|
|
9591
|
+
horizontal: "ArrowUp"
|
|
9592
|
+
}):
|
|
9593
|
+
item.moveHighlightedIndex(1);
|
|
9594
|
+
event.preventDefault();
|
|
9595
|
+
break;
|
|
9596
|
+
case match(orientation, {
|
|
9597
|
+
vertical: "ArrowUp",
|
|
9598
|
+
horizontal: "ArrowDown"
|
|
9599
|
+
}):
|
|
9600
|
+
item.moveHighlightedIndex(-1);
|
|
9601
|
+
event.preventDefault();
|
|
9602
|
+
break;
|
|
9603
|
+
case "Home":
|
|
9604
|
+
event.preventDefault();
|
|
9605
|
+
break;
|
|
9606
|
+
case "End":
|
|
9607
|
+
event.preventDefault();
|
|
9608
|
+
break;
|
|
9609
|
+
case "Enter":
|
|
9610
|
+
// Fall through
|
|
9611
|
+
case " ":
|
|
9612
|
+
if (state.highlightedValue) {
|
|
9613
|
+
item.toggleSelection(state.highlightedValue);
|
|
9614
|
+
if (!config.isMultiSelect) {
|
|
9615
|
+
trigger.toggleOpen(false);
|
|
9616
|
+
}
|
|
9617
|
+
event.preventDefault();
|
|
9618
|
+
}
|
|
9619
|
+
break;
|
|
9586
9620
|
}
|
|
9587
|
-
|
|
9621
|
+
},
|
|
9622
|
+
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),
|
|
9623
|
+
style: {
|
|
9624
|
+
opacity: position ? void 0 : 0,
|
|
9625
|
+
position: "fixed",
|
|
9626
|
+
...position
|
|
9627
|
+
},
|
|
9628
|
+
role: "listbox",
|
|
9629
|
+
"aria-multiselectable": config.isMultiSelect,
|
|
9630
|
+
"aria-orientation": orientation,
|
|
9631
|
+
tabIndex: position ? 0 : void 0,
|
|
9632
|
+
children: props.children
|
|
9588
9633
|
}
|
|
9589
|
-
|
|
9590
|
-
|
|
9591
|
-
|
|
9592
|
-
|
|
9593
|
-
position: "fixed",
|
|
9594
|
-
...position
|
|
9595
|
-
},
|
|
9596
|
-
role: "listbox",
|
|
9597
|
-
"aria-multiselectable": config.isMultiSelect,
|
|
9598
|
-
"aria-orientation": orientation,
|
|
9599
|
-
tabIndex: position ? 0 : void 0,
|
|
9600
|
-
children: props.children
|
|
9601
|
-
}
|
|
9602
|
-
)
|
|
9603
|
-
] }),
|
|
9634
|
+
)
|
|
9635
|
+
]
|
|
9636
|
+
}
|
|
9637
|
+
),
|
|
9604
9638
|
document.body
|
|
9605
9639
|
);
|
|
9606
9640
|
}
|
|
9607
9641
|
);
|
|
9608
|
-
var Select = (0,
|
|
9642
|
+
var Select = (0, import_react19.forwardRef)(function Select2({
|
|
9609
9643
|
children,
|
|
9610
9644
|
contentPanelProps,
|
|
9611
9645
|
buttonProps,
|
|
@@ -9627,7 +9661,7 @@ var Select = (0, import_react20.forwardRef)(function Select2({
|
|
|
9627
9661
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
9628
9662
|
] });
|
|
9629
9663
|
});
|
|
9630
|
-
var SelectUncontrolled = (0,
|
|
9664
|
+
var SelectUncontrolled = (0, import_react19.forwardRef)(function SelectUncontrolled2({
|
|
9631
9665
|
value: initialValue,
|
|
9632
9666
|
onValueChanged,
|
|
9633
9667
|
...props
|
|
@@ -9643,7 +9677,7 @@ var SelectUncontrolled = (0, import_react20.forwardRef)(function SelectUncontrol
|
|
|
9643
9677
|
}
|
|
9644
9678
|
);
|
|
9645
9679
|
});
|
|
9646
|
-
var MultiSelect = (0,
|
|
9680
|
+
var MultiSelect = (0, import_react19.forwardRef)(function MultiSelect2({
|
|
9647
9681
|
children,
|
|
9648
9682
|
contentPanelProps,
|
|
9649
9683
|
buttonProps,
|
|
@@ -9654,7 +9688,7 @@ var MultiSelect = (0, import_react20.forwardRef)(function MultiSelect2({
|
|
|
9654
9688
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
9655
9689
|
] });
|
|
9656
9690
|
});
|
|
9657
|
-
var MultiSelectUncontrolled = (0,
|
|
9691
|
+
var MultiSelectUncontrolled = (0, import_react19.forwardRef)(function MultiSelectUncontrolled2({
|
|
9658
9692
|
values: initialValues,
|
|
9659
9693
|
onValuesChanged,
|
|
9660
9694
|
...props
|
|
@@ -9670,7 +9704,7 @@ var MultiSelectUncontrolled = (0, import_react20.forwardRef)(function MultiSelec
|
|
|
9670
9704
|
}
|
|
9671
9705
|
);
|
|
9672
9706
|
});
|
|
9673
|
-
var MultiSelectChipDisplay = (0,
|
|
9707
|
+
var MultiSelectChipDisplay = (0, import_react19.forwardRef)(function MultiSelectChipDisplay2({
|
|
9674
9708
|
children,
|
|
9675
9709
|
contentPanelProps,
|
|
9676
9710
|
chipDisplayProps,
|
|
@@ -9681,7 +9715,7 @@ var MultiSelectChipDisplay = (0, import_react20.forwardRef)(function MultiSelect
|
|
|
9681
9715
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
9682
9716
|
] });
|
|
9683
9717
|
});
|
|
9684
|
-
var MultiSelectChipDisplayUncontrolled = (0,
|
|
9718
|
+
var MultiSelectChipDisplayUncontrolled = (0, import_react19.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
|
|
9685
9719
|
values: initialValues,
|
|
9686
9720
|
onValuesChanged,
|
|
9687
9721
|
...props
|
|
@@ -9754,7 +9788,7 @@ var import_lucide_react5 = require("lucide-react");
|
|
|
9754
9788
|
var import_clsx14 = __toESM(require("clsx"));
|
|
9755
9789
|
|
|
9756
9790
|
// src/theming/useTheme.tsx
|
|
9757
|
-
var
|
|
9791
|
+
var import_react20 = require("react");
|
|
9758
9792
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
9759
9793
|
var themes = ["light", "dark", "system"];
|
|
9760
9794
|
var defaultThemeTypeTranslation = {
|
|
@@ -9781,15 +9815,15 @@ var ThemeUtil = {
|
|
|
9781
9815
|
themes,
|
|
9782
9816
|
translation: defaultThemeTypeTranslation
|
|
9783
9817
|
};
|
|
9784
|
-
var ThemeContext = (0,
|
|
9818
|
+
var ThemeContext = (0, import_react20.createContext)(null);
|
|
9785
9819
|
var ThemeProvider = ({ children, theme }) => {
|
|
9786
9820
|
const {
|
|
9787
9821
|
value: storedTheme,
|
|
9788
9822
|
setValue: setStoredTheme,
|
|
9789
9823
|
deleteValue: deleteStoredTheme
|
|
9790
9824
|
} = useLocalStorage("theme", "system");
|
|
9791
|
-
const [themePreference, setThemePreference] = (0,
|
|
9792
|
-
const resolvedTheme = (0,
|
|
9825
|
+
const [themePreference, setThemePreference] = (0, import_react20.useState)("system");
|
|
9826
|
+
const resolvedTheme = (0, import_react20.useMemo)(() => {
|
|
9793
9827
|
if (theme && theme !== "system") {
|
|
9794
9828
|
return theme;
|
|
9795
9829
|
}
|
|
@@ -9801,7 +9835,7 @@ var ThemeProvider = ({ children, theme }) => {
|
|
|
9801
9835
|
}
|
|
9802
9836
|
return "light";
|
|
9803
9837
|
}, [storedTheme, theme, themePreference]);
|
|
9804
|
-
(0,
|
|
9838
|
+
(0, import_react20.useEffect)(() => {
|
|
9805
9839
|
if (!theme) return;
|
|
9806
9840
|
if (theme === "system") {
|
|
9807
9841
|
deleteStoredTheme();
|
|
@@ -9809,18 +9843,18 @@ var ThemeProvider = ({ children, theme }) => {
|
|
|
9809
9843
|
setStoredTheme(theme);
|
|
9810
9844
|
}
|
|
9811
9845
|
}, [theme]);
|
|
9812
|
-
(0,
|
|
9846
|
+
(0, import_react20.useEffect)(() => {
|
|
9813
9847
|
document.documentElement.setAttribute("data-theme", resolvedTheme);
|
|
9814
9848
|
}, [resolvedTheme]);
|
|
9815
|
-
const getPreference = (0,
|
|
9849
|
+
const getPreference = (0, import_react20.useCallback)(() => {
|
|
9816
9850
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
9817
9851
|
const prefersLight = window.matchMedia("(prefers-color-scheme: light)").matches;
|
|
9818
9852
|
setThemePreference(prefersDark ? "dark" : prefersLight ? "light" : "system");
|
|
9819
9853
|
}, []);
|
|
9820
|
-
(0,
|
|
9854
|
+
(0, import_react20.useEffect)(() => {
|
|
9821
9855
|
getPreference();
|
|
9822
9856
|
}, [getPreference]);
|
|
9823
|
-
(0,
|
|
9857
|
+
(0, import_react20.useEffect)(() => {
|
|
9824
9858
|
const darkQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
9825
9859
|
const lightQuery = window.matchMedia("(prefers-color-scheme: light)");
|
|
9826
9860
|
const noPrefQuery = window.matchMedia("(prefers-color-scheme: no-preference)");
|
|
@@ -9840,7 +9874,7 @@ var ThemeProvider = ({ children, theme }) => {
|
|
|
9840
9874
|
theme: storedTheme,
|
|
9841
9875
|
resolvedTheme,
|
|
9842
9876
|
setTheme: (newTheme) => {
|
|
9843
|
-
if (theme) {
|
|
9877
|
+
if (theme && theme !== "system") {
|
|
9844
9878
|
console.warn("ThemeProvider: Attempting to change the theme while setting a fixed theme won't have any effect. Change the theme provided to the ThemeProvider instead.");
|
|
9845
9879
|
}
|
|
9846
9880
|
setStoredTheme(newTheme);
|
|
@@ -9851,7 +9885,7 @@ var ThemeProvider = ({ children, theme }) => {
|
|
|
9851
9885
|
);
|
|
9852
9886
|
};
|
|
9853
9887
|
var useTheme = () => {
|
|
9854
|
-
const context = (0,
|
|
9888
|
+
const context = (0, import_react20.useContext)(ThemeContext);
|
|
9855
9889
|
if (!context) {
|
|
9856
9890
|
throw new Error("useTheme must be used within ThemeContext. Try adding a ThemeProvider around your app.");
|
|
9857
9891
|
}
|
|
@@ -9923,7 +9957,7 @@ var ThemeDialog = ({
|
|
|
9923
9957
|
};
|
|
9924
9958
|
|
|
9925
9959
|
// src/components/form/FormElementWrapper.tsx
|
|
9926
|
-
var
|
|
9960
|
+
var import_react21 = require("react");
|
|
9927
9961
|
var import_clsx16 = require("clsx");
|
|
9928
9962
|
|
|
9929
9963
|
// src/components/user-action/Label.tsx
|
|
@@ -9961,7 +9995,7 @@ var FormElementWrapper = ({
|
|
|
9961
9995
|
containerClassName
|
|
9962
9996
|
}) => {
|
|
9963
9997
|
const [touched, setTouched] = useOverwritableState(initialIsShowingError, onIsShowingError);
|
|
9964
|
-
const generatedId = (0,
|
|
9998
|
+
const generatedId = (0, import_react21.useId)();
|
|
9965
9999
|
const usedId = id ?? generatedId;
|
|
9966
10000
|
const errorId = `${usedId}-description`;
|
|
9967
10001
|
const labelId = `${usedId}-label`;
|
|
@@ -10032,7 +10066,7 @@ var FormElementWrapper = ({
|
|
|
10032
10066
|
|
|
10033
10067
|
// src/components/icons-and-geometry/Avatar.tsx
|
|
10034
10068
|
var import_clsx17 = __toESM(require("clsx"));
|
|
10035
|
-
var
|
|
10069
|
+
var import_react22 = require("react");
|
|
10036
10070
|
var import_lucide_react6 = require("lucide-react");
|
|
10037
10071
|
|
|
10038
10072
|
// node_modules/@radix-ui/react-avatar/dist/index.mjs
|
|
@@ -10431,7 +10465,7 @@ var Avatar2 = ({ image, name, size = "md", fullyRounded, className = "" }) => {
|
|
|
10431
10465
|
maxHeight: pixels
|
|
10432
10466
|
};
|
|
10433
10467
|
const textClassName = textClassNameMapping[size];
|
|
10434
|
-
const displayName = (0,
|
|
10468
|
+
const displayName = (0, import_react22.useMemo)(() => {
|
|
10435
10469
|
const maxLetters = size === "sm" ? 1 : 2;
|
|
10436
10470
|
return (name ?? "").split(" ").filter((_, index) => index < maxLetters).map((value) => value[0]).join("").toUpperCase();
|
|
10437
10471
|
}, [name, size]);
|
|
@@ -10531,7 +10565,7 @@ var Circle = ({
|
|
|
10531
10565
|
};
|
|
10532
10566
|
|
|
10533
10567
|
// src/components/icons-and-geometry/Ring.tsx
|
|
10534
|
-
var
|
|
10568
|
+
var import_react23 = require("react");
|
|
10535
10569
|
var import_clsx19 = __toESM(require("clsx"));
|
|
10536
10570
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
10537
10571
|
var Ring = ({
|
|
@@ -10560,9 +10594,9 @@ var AnimatedRing = ({
|
|
|
10560
10594
|
onAnimationFinished,
|
|
10561
10595
|
style
|
|
10562
10596
|
}) => {
|
|
10563
|
-
const [currentWidth, setCurrentWidth] = (0,
|
|
10597
|
+
const [currentWidth, setCurrentWidth] = (0, import_react23.useState)(0);
|
|
10564
10598
|
const milliseconds = 1e3 * fillAnimationDuration;
|
|
10565
|
-
const animate = (0,
|
|
10599
|
+
const animate = (0, import_react23.useCallback)((timestamp, startTime) => {
|
|
10566
10600
|
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
10567
10601
|
const newWidth = Math.min(width * progress, width);
|
|
10568
10602
|
setCurrentWidth(newWidth);
|
|
@@ -10576,7 +10610,7 @@ var AnimatedRing = ({
|
|
|
10576
10610
|
}
|
|
10577
10611
|
}
|
|
10578
10612
|
}, [milliseconds, onAnimationFinished, repeating, width]);
|
|
10579
|
-
(0,
|
|
10613
|
+
(0, import_react23.useEffect)(() => {
|
|
10580
10614
|
if (currentWidth < width) {
|
|
10581
10615
|
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
10582
10616
|
}
|
|
@@ -10611,10 +10645,10 @@ var RingWave = ({
|
|
|
10611
10645
|
onAnimationFinished,
|
|
10612
10646
|
style
|
|
10613
10647
|
}) => {
|
|
10614
|
-
const [currentInnerSize, setCurrentInnerSize] = (0,
|
|
10648
|
+
const [currentInnerSize, setCurrentInnerSize] = (0, import_react23.useState)(startInnerSize);
|
|
10615
10649
|
const distance = endInnerSize - startInnerSize;
|
|
10616
10650
|
const milliseconds = 1e3 * fillAnimationDuration;
|
|
10617
|
-
const animate = (0,
|
|
10651
|
+
const animate = (0, import_react23.useCallback)((timestamp, startTime) => {
|
|
10618
10652
|
const progress = Math.min((timestamp - startTime) / milliseconds, 1);
|
|
10619
10653
|
const newInnerSize = Math.min(
|
|
10620
10654
|
startInnerSize + distance * progress,
|
|
@@ -10631,7 +10665,7 @@ var RingWave = ({
|
|
|
10631
10665
|
}
|
|
10632
10666
|
}
|
|
10633
10667
|
}, [distance, endInnerSize, milliseconds, onAnimationFinished, repeating, startInnerSize]);
|
|
10634
|
-
(0,
|
|
10668
|
+
(0, import_react23.useEffect)(() => {
|
|
10635
10669
|
if (currentInnerSize < endInnerSize) {
|
|
10636
10670
|
requestAnimationFrame((timestamp) => animate(timestamp, timestamp));
|
|
10637
10671
|
}
|
|
@@ -10666,7 +10700,7 @@ var RadialRings = ({
|
|
|
10666
10700
|
sizeCircle2 = 200,
|
|
10667
10701
|
sizeCircle3 = 300
|
|
10668
10702
|
}) => {
|
|
10669
|
-
const [currentRing, setCurrentRing] = (0,
|
|
10703
|
+
const [currentRing, setCurrentRing] = (0, import_react23.useState)(0);
|
|
10670
10704
|
const size = sizeCircle3;
|
|
10671
10705
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
10672
10706
|
"div",
|
|
@@ -10815,13 +10849,13 @@ var TagIcon = ({
|
|
|
10815
10849
|
};
|
|
10816
10850
|
|
|
10817
10851
|
// src/components/layout/Carousel.tsx
|
|
10818
|
-
var
|
|
10852
|
+
var import_react24 = require("react");
|
|
10819
10853
|
var import_clsx20 = __toESM(require("clsx"));
|
|
10820
10854
|
var import_lucide_react7 = require("lucide-react");
|
|
10821
10855
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
10822
|
-
var CarouselContext = (0,
|
|
10856
|
+
var CarouselContext = (0, import_react24.createContext)(null);
|
|
10823
10857
|
var useCarouselContext = () => {
|
|
10824
|
-
const context = (0,
|
|
10858
|
+
const context = (0, import_react24.useContext)(CarouselContext);
|
|
10825
10859
|
if (!context) {
|
|
10826
10860
|
console.error("useCarouselContext must be used within CarouselContext");
|
|
10827
10861
|
}
|
|
@@ -10844,7 +10878,7 @@ function CarouselTabs({
|
|
|
10844
10878
|
defaultCarouselTabTranslationType
|
|
10845
10879
|
]);
|
|
10846
10880
|
const { id, slideCount, currentIndex, isLooping } = useCarouselContext();
|
|
10847
|
-
const tabRefs = (0,
|
|
10881
|
+
const tabRefs = (0, import_react24.useRef)([]);
|
|
10848
10882
|
const handleKeyDown = (event, index) => {
|
|
10849
10883
|
let newIndex = index;
|
|
10850
10884
|
if (event.key === "ArrowRight") {
|
|
@@ -10904,7 +10938,7 @@ var defaultCarouselSlideTranslationType = {
|
|
|
10904
10938
|
slideOf: `Slide {{index}} von {{length}} slides`
|
|
10905
10939
|
}
|
|
10906
10940
|
};
|
|
10907
|
-
var CarouselSlide = (0,
|
|
10941
|
+
var CarouselSlide = (0, import_react24.forwardRef)(
|
|
10908
10942
|
function CarouselSlide2({
|
|
10909
10943
|
index,
|
|
10910
10944
|
...props
|
|
@@ -10961,20 +10995,21 @@ var Carousel = ({
|
|
|
10961
10995
|
heightClassName = "h-96",
|
|
10962
10996
|
widthClassName = "w-[70%] desktop:w-1/2",
|
|
10963
10997
|
slideContainerProps,
|
|
10998
|
+
onSlideChanged,
|
|
10964
10999
|
...props
|
|
10965
11000
|
}) => {
|
|
10966
11001
|
const translation = useTranslation([defaultCarouselTranslationType]);
|
|
10967
|
-
const slideRefs = (0,
|
|
10968
|
-
const [currentIndex, setCurrentIndex] = (0,
|
|
10969
|
-
const [hasFocus, setHasFocus] = (0,
|
|
10970
|
-
const [dragState, setDragState] = (0,
|
|
11002
|
+
const slideRefs = (0, import_react24.useRef)([]);
|
|
11003
|
+
const [currentIndex, setCurrentIndex] = (0, import_react24.useState)(0);
|
|
11004
|
+
const [hasFocus, setHasFocus] = (0, import_react24.useState)(false);
|
|
11005
|
+
const [dragState, setDragState] = (0, import_react24.useState)();
|
|
10971
11006
|
const isPaused = hasFocus;
|
|
10972
|
-
const carouselContainerRef = (0,
|
|
10973
|
-
const [disableClick, setDisableClick] = (0,
|
|
10974
|
-
const timeOut = (0,
|
|
10975
|
-
const length = (0,
|
|
11007
|
+
const carouselContainerRef = (0, import_react24.useRef)(null);
|
|
11008
|
+
const [disableClick, setDisableClick] = (0, import_react24.useState)(false);
|
|
11009
|
+
const timeOut = (0, import_react24.useRef)(void 0);
|
|
11010
|
+
const length = (0, import_react24.useMemo)(() => children.length, [children]);
|
|
10976
11011
|
const paddingItemCount = 3;
|
|
10977
|
-
const generatedId = "carousel" + (0,
|
|
11012
|
+
const generatedId = "carousel" + (0, import_react24.useId)();
|
|
10978
11013
|
const id = props.id ?? generatedId;
|
|
10979
11014
|
if (isAutoPlaying && !isLooping) {
|
|
10980
11015
|
console.error("When isAutoLooping is true, isLooping should also be true");
|
|
@@ -10983,7 +11018,7 @@ var Carousel = ({
|
|
|
10983
11018
|
autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut);
|
|
10984
11019
|
animationTime = Math.max(100, animationTime);
|
|
10985
11020
|
autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime);
|
|
10986
|
-
(0,
|
|
11021
|
+
(0, import_react24.useEffect)(() => {
|
|
10987
11022
|
const carousel = carouselContainerRef.current;
|
|
10988
11023
|
if (carousel) {
|
|
10989
11024
|
let onFocus = function() {
|
|
@@ -11006,7 +11041,7 @@ var Carousel = ({
|
|
|
11006
11041
|
const canGoLeft = () => {
|
|
11007
11042
|
return isLooping || currentIndex !== 0;
|
|
11008
11043
|
};
|
|
11009
|
-
const canGoRight = (0,
|
|
11044
|
+
const canGoRight = (0, import_react24.useCallback)(() => {
|
|
11010
11045
|
return isLooping || currentIndex !== length - 1;
|
|
11011
11046
|
}, [currentIndex, isLooping, length]);
|
|
11012
11047
|
const left = () => {
|
|
@@ -11014,12 +11049,12 @@ var Carousel = ({
|
|
|
11014
11049
|
setCurrentIndex(currentIndex - 1);
|
|
11015
11050
|
}
|
|
11016
11051
|
};
|
|
11017
|
-
const right = (0,
|
|
11052
|
+
const right = (0, import_react24.useCallback)(() => {
|
|
11018
11053
|
if (canGoRight()) {
|
|
11019
11054
|
setCurrentIndex((currentIndex + length + 1) % length);
|
|
11020
11055
|
}
|
|
11021
11056
|
}, [canGoRight, currentIndex, length]);
|
|
11022
|
-
(0,
|
|
11057
|
+
(0, import_react24.useEffect)(() => {
|
|
11023
11058
|
if (!timeOut.current && !isPaused) {
|
|
11024
11059
|
if (autoLoopingTimeOut > 0) {
|
|
11025
11060
|
timeOut.current = setTimeout(() => {
|
|
@@ -11071,9 +11106,12 @@ var Carousel = ({
|
|
|
11071
11106
|
}
|
|
11072
11107
|
setDragState(void 0);
|
|
11073
11108
|
};
|
|
11074
|
-
(0,
|
|
11109
|
+
(0, import_react24.useEffect)(() => {
|
|
11075
11110
|
setDisableClick(!dragState);
|
|
11076
11111
|
}, [dragState]);
|
|
11112
|
+
(0, import_react24.useEffect)(() => {
|
|
11113
|
+
onSlideChanged?.(currentIndex);
|
|
11114
|
+
}, [currentIndex]);
|
|
11077
11115
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CarouselContext.Provider, { value: { id, currentIndex, slideCount: length, isLooping }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
11078
11116
|
"div",
|
|
11079
11117
|
{
|
|
@@ -11462,11 +11500,11 @@ var FAQSection = ({
|
|
|
11462
11500
|
};
|
|
11463
11501
|
|
|
11464
11502
|
// src/components/layout/FloatingContainer.tsx
|
|
11465
|
-
var
|
|
11503
|
+
var import_react25 = require("react");
|
|
11466
11504
|
var import_react_dom3 = require("react-dom");
|
|
11467
11505
|
var import_clsx23 = require("clsx");
|
|
11468
11506
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
11469
|
-
var FloatingContainer = (0,
|
|
11507
|
+
var FloatingContainer = (0, import_react25.forwardRef)(function FloatingContainer2({
|
|
11470
11508
|
children,
|
|
11471
11509
|
backgroundOverlay,
|
|
11472
11510
|
anchor,
|
|
@@ -11478,8 +11516,8 @@ var FloatingContainer = (0, import_react26.forwardRef)(function FloatingContaine
|
|
|
11478
11516
|
gap = 4,
|
|
11479
11517
|
...props
|
|
11480
11518
|
}, forwardRef17) {
|
|
11481
|
-
const innerRef = (0,
|
|
11482
|
-
(0,
|
|
11519
|
+
const innerRef = (0, import_react25.useRef)(null);
|
|
11520
|
+
(0, import_react25.useImperativeHandle)(forwardRef17, () => innerRef.current);
|
|
11483
11521
|
const position = useFloatingElement({
|
|
11484
11522
|
active: !props.hidden,
|
|
11485
11523
|
containerRef: innerRef,
|
|
@@ -11519,18 +11557,18 @@ var FloatingContainer = (0, import_react26.forwardRef)(function FloatingContaine
|
|
|
11519
11557
|
});
|
|
11520
11558
|
|
|
11521
11559
|
// src/components/layout/ListBox.tsx
|
|
11522
|
-
var
|
|
11560
|
+
var import_react26 = __toESM(require("react"));
|
|
11523
11561
|
var import_clsx24 = require("clsx");
|
|
11524
11562
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
11525
|
-
var ListBoxContext = (0,
|
|
11563
|
+
var ListBoxContext = (0, import_react26.createContext)(null);
|
|
11526
11564
|
function useListBoxContext() {
|
|
11527
|
-
const ctx = (0,
|
|
11565
|
+
const ctx = (0, import_react26.useContext)(ListBoxContext);
|
|
11528
11566
|
if (!ctx) {
|
|
11529
11567
|
throw new Error("ListBoxItem must be used within a ListBoxPrimitive");
|
|
11530
11568
|
}
|
|
11531
11569
|
return ctx;
|
|
11532
11570
|
}
|
|
11533
|
-
var ListBoxItem = (0,
|
|
11571
|
+
var ListBoxItem = (0, import_react26.forwardRef)(
|
|
11534
11572
|
function ListBoxItem2({ value, disabled = false, children, className, ...rest }, ref) {
|
|
11535
11573
|
const {
|
|
11536
11574
|
registerItem,
|
|
@@ -11540,9 +11578,9 @@ var ListBoxItem = (0, import_react27.forwardRef)(
|
|
|
11540
11578
|
onItemClick,
|
|
11541
11579
|
isSelected
|
|
11542
11580
|
} = useListBoxContext();
|
|
11543
|
-
const itemRef = (0,
|
|
11544
|
-
const id =
|
|
11545
|
-
(0,
|
|
11581
|
+
const itemRef = (0, import_react26.useRef)(null);
|
|
11582
|
+
const id = import_react26.default.useId();
|
|
11583
|
+
(0, import_react26.useEffect)(() => {
|
|
11546
11584
|
registerItem({ id, value, disabled, ref: itemRef });
|
|
11547
11585
|
return () => unregisterItem(id);
|
|
11548
11586
|
}, [id, value, disabled, registerItem, unregisterItem]);
|
|
@@ -11584,7 +11622,7 @@ var ListBoxItem = (0, import_react27.forwardRef)(
|
|
|
11584
11622
|
);
|
|
11585
11623
|
}
|
|
11586
11624
|
);
|
|
11587
|
-
var ListBoxPrimitive = (0,
|
|
11625
|
+
var ListBoxPrimitive = (0, import_react26.forwardRef)(
|
|
11588
11626
|
function ListBoxPrimitive2({
|
|
11589
11627
|
value,
|
|
11590
11628
|
onSelectionChanged,
|
|
@@ -11594,9 +11632,9 @@ var ListBoxPrimitive = (0, import_react27.forwardRef)(
|
|
|
11594
11632
|
orientation = "vertical",
|
|
11595
11633
|
...props
|
|
11596
11634
|
}, ref) {
|
|
11597
|
-
const itemsRef = (0,
|
|
11598
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
11599
|
-
const registerItem = (0,
|
|
11635
|
+
const itemsRef = (0, import_react26.useRef)([]);
|
|
11636
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react26.useState)(void 0);
|
|
11637
|
+
const registerItem = (0, import_react26.useCallback)((item) => {
|
|
11600
11638
|
itemsRef.current.push(item);
|
|
11601
11639
|
itemsRef.current.sort((a, b) => {
|
|
11602
11640
|
const aEl = a.ref.current;
|
|
@@ -11605,14 +11643,14 @@ var ListBoxPrimitive = (0, import_react27.forwardRef)(
|
|
|
11605
11643
|
return aEl.compareDocumentPosition(bEl) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
11606
11644
|
});
|
|
11607
11645
|
}, []);
|
|
11608
|
-
const unregisterItem = (0,
|
|
11646
|
+
const unregisterItem = (0, import_react26.useCallback)((id) => {
|
|
11609
11647
|
itemsRef.current = itemsRef.current.filter((i) => i.id !== id);
|
|
11610
11648
|
}, []);
|
|
11611
|
-
const isSelected = (0,
|
|
11649
|
+
const isSelected = (0, import_react26.useCallback)(
|
|
11612
11650
|
(val) => (value ?? []).includes(val),
|
|
11613
11651
|
[value]
|
|
11614
11652
|
);
|
|
11615
|
-
const onItemClickedHandler = (0,
|
|
11653
|
+
const onItemClickedHandler = (0, import_react26.useCallback)(
|
|
11616
11654
|
(id) => {
|
|
11617
11655
|
const index = itemsRef.current.findIndex((i) => i.id === id);
|
|
11618
11656
|
if (index === -1) {
|
|
@@ -11636,13 +11674,13 @@ var ListBoxPrimitive = (0, import_react27.forwardRef)(
|
|
|
11636
11674
|
},
|
|
11637
11675
|
[onItemClicked, isSelection, isMultiple, onSelectionChanged, isSelected, value]
|
|
11638
11676
|
);
|
|
11639
|
-
const setHighlightedId = (0,
|
|
11677
|
+
const setHighlightedId = (0, import_react26.useCallback)((id) => {
|
|
11640
11678
|
const index = itemsRef.current.findIndex((i) => i.id === id);
|
|
11641
11679
|
if (index !== -1) {
|
|
11642
11680
|
setHighlightedIndex(index);
|
|
11643
11681
|
}
|
|
11644
11682
|
}, []);
|
|
11645
|
-
(0,
|
|
11683
|
+
(0, import_react26.useEffect)(() => {
|
|
11646
11684
|
if (highlightedIndex !== void 0) {
|
|
11647
11685
|
itemsRef.current[highlightedIndex]?.ref.current?.scrollIntoView({ block: "nearest", behavior: "auto" });
|
|
11648
11686
|
}
|
|
@@ -11747,7 +11785,7 @@ var ListBoxMultipleUncontrolled = ({
|
|
|
11747
11785
|
}
|
|
11748
11786
|
);
|
|
11749
11787
|
};
|
|
11750
|
-
var ListBox = (0,
|
|
11788
|
+
var ListBox = (0, import_react26.forwardRef)(function ListBox2({
|
|
11751
11789
|
value,
|
|
11752
11790
|
onSelectionChanged,
|
|
11753
11791
|
...props
|
|
@@ -12881,7 +12919,7 @@ var ErrorComponent = ({
|
|
|
12881
12919
|
};
|
|
12882
12920
|
|
|
12883
12921
|
// src/components/loading-states/LoadingAndErrorComponent.tsx
|
|
12884
|
-
var
|
|
12922
|
+
var import_react27 = require("react");
|
|
12885
12923
|
|
|
12886
12924
|
// src/components/loading-states/LoadingContainer.tsx
|
|
12887
12925
|
var import_clsx28 = require("clsx");
|
|
@@ -12902,8 +12940,8 @@ var LoadingAndErrorComponent = ({
|
|
|
12902
12940
|
minimumLoadingDuration = 200,
|
|
12903
12941
|
className
|
|
12904
12942
|
}) => {
|
|
12905
|
-
const [isInMinimumLoading, setIsInMinimumLoading] = (0,
|
|
12906
|
-
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0,
|
|
12943
|
+
const [isInMinimumLoading, setIsInMinimumLoading] = (0, import_react27.useState)(false);
|
|
12944
|
+
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0, import_react27.useState)(false);
|
|
12907
12945
|
if (minimumLoadingDuration && !isInMinimumLoading && !hasUsedMinimumLoading) {
|
|
12908
12946
|
setIsInMinimumLoading(true);
|
|
12909
12947
|
setTimeout(() => {
|
|
@@ -13005,13 +13043,13 @@ var ProgressIndicator = ({
|
|
|
13005
13043
|
// src/components/navigation/BreadCrumb.tsx
|
|
13006
13044
|
var import_link = __toESM(require_link2());
|
|
13007
13045
|
var import_clsx32 = __toESM(require("clsx"));
|
|
13008
|
-
var
|
|
13046
|
+
var import_react28 = require("react");
|
|
13009
13047
|
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
13010
13048
|
var BreadCrumb = ({ crumbs, linkClassName, containerClassName }) => {
|
|
13011
13049
|
const color = "text-description";
|
|
13012
13050
|
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) => {
|
|
13013
13051
|
const isLast = index === crumbs.length - 1;
|
|
13014
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
13052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react28.Fragment, { children: [
|
|
13015
13053
|
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
13016
13054
|
import_link.default,
|
|
13017
13055
|
{
|
|
@@ -13027,8 +13065,8 @@ var BreadCrumb = ({ crumbs, linkClassName, containerClassName }) => {
|
|
|
13027
13065
|
|
|
13028
13066
|
// src/components/navigation/Navigation.tsx
|
|
13029
13067
|
var import_lucide_react9 = require("lucide-react");
|
|
13068
|
+
var import_react29 = require("react");
|
|
13030
13069
|
var import_react30 = require("react");
|
|
13031
|
-
var import_react31 = require("react");
|
|
13032
13070
|
var import_link2 = __toESM(require_link2());
|
|
13033
13071
|
var import_clsx33 = __toESM(require("clsx"));
|
|
13034
13072
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
@@ -13041,10 +13079,10 @@ var NavigationItemWithSubItem = ({
|
|
|
13041
13079
|
horizontalAlignment = "center",
|
|
13042
13080
|
...options
|
|
13043
13081
|
}) => {
|
|
13044
|
-
const [isOpen, setOpen] = (0,
|
|
13045
|
-
const containerRef = (0,
|
|
13046
|
-
const triggerRef = (0,
|
|
13047
|
-
const id = (0,
|
|
13082
|
+
const [isOpen, setOpen] = (0, import_react30.useState)(false);
|
|
13083
|
+
const containerRef = (0, import_react30.useRef)();
|
|
13084
|
+
const triggerRef = (0, import_react30.useRef)(null);
|
|
13085
|
+
const id = (0, import_react30.useId)();
|
|
13048
13086
|
const style = useFloatingElement({
|
|
13049
13087
|
active: isOpen,
|
|
13050
13088
|
containerRef,
|
|
@@ -13052,7 +13090,7 @@ var NavigationItemWithSubItem = ({
|
|
|
13052
13090
|
horizontalAlignment,
|
|
13053
13091
|
...options
|
|
13054
13092
|
});
|
|
13055
|
-
const onBlur = (0,
|
|
13093
|
+
const onBlur = (0, import_react30.useCallback)((event) => {
|
|
13056
13094
|
const nextFocus = event.relatedTarget;
|
|
13057
13095
|
if (!containerRef.current?.contains(nextFocus) && !triggerRef.current?.contains(nextFocus)) {
|
|
13058
13096
|
setOpen(false);
|
|
@@ -13106,10 +13144,10 @@ var NavigationItemList = ({ items, ...restProps }) => {
|
|
|
13106
13144
|
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)) });
|
|
13107
13145
|
};
|
|
13108
13146
|
var Navigation = ({ ...props }) => {
|
|
13109
|
-
const [isMobileOpen, setIsMobileOpen] = (0,
|
|
13110
|
-
const id = (0,
|
|
13111
|
-
const menuRef = (0,
|
|
13112
|
-
(0,
|
|
13147
|
+
const [isMobileOpen, setIsMobileOpen] = (0, import_react30.useState)(false);
|
|
13148
|
+
const id = (0, import_react30.useId)();
|
|
13149
|
+
const menuRef = (0, import_react30.useRef)(null);
|
|
13150
|
+
(0, import_react29.useEffect)(() => {
|
|
13113
13151
|
menuRef.current?.focus();
|
|
13114
13152
|
}, [isMobileOpen]);
|
|
13115
13153
|
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
@@ -13164,7 +13202,7 @@ var Navigation = ({ ...props }) => {
|
|
|
13164
13202
|
// src/components/navigation/Pagination.tsx
|
|
13165
13203
|
var import_lucide_react10 = require("lucide-react");
|
|
13166
13204
|
var import_clsx34 = __toESM(require("clsx"));
|
|
13167
|
-
var
|
|
13205
|
+
var import_react31 = require("react");
|
|
13168
13206
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
13169
13207
|
var Pagination = ({
|
|
13170
13208
|
overwriteTranslation,
|
|
@@ -13175,11 +13213,11 @@ var Pagination = ({
|
|
|
13175
13213
|
style
|
|
13176
13214
|
}) => {
|
|
13177
13215
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
13178
|
-
const [value, setValue] = (0,
|
|
13216
|
+
const [value, setValue] = (0, import_react31.useState)((pageIndex + 1).toString());
|
|
13179
13217
|
const noPages = pageCount === 0;
|
|
13180
13218
|
const onFirstPage = pageIndex === 0 && !noPages;
|
|
13181
13219
|
const onLastPage = pageIndex === pageCount - 1;
|
|
13182
|
-
(0,
|
|
13220
|
+
(0, import_react31.useEffect)(() => {
|
|
13183
13221
|
if (noPages) {
|
|
13184
13222
|
setValue("0");
|
|
13185
13223
|
} else {
|
|
@@ -13858,7 +13896,7 @@ var PropertyBase = ({
|
|
|
13858
13896
|
};
|
|
13859
13897
|
|
|
13860
13898
|
// src/components/properties/CheckboxProperty.tsx
|
|
13861
|
-
var
|
|
13899
|
+
var import_react32 = require("react");
|
|
13862
13900
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
13863
13901
|
var CheckboxProperty = ({
|
|
13864
13902
|
overwriteTranslation,
|
|
@@ -13868,7 +13906,7 @@ var CheckboxProperty = ({
|
|
|
13868
13906
|
...baseProps
|
|
13869
13907
|
}) => {
|
|
13870
13908
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
13871
|
-
const id = (0,
|
|
13909
|
+
const id = (0, import_react32.useId)();
|
|
13872
13910
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13873
13911
|
PropertyBase,
|
|
13874
13912
|
{
|
|
@@ -14091,10 +14129,10 @@ var import_lucide_react19 = require("lucide-react");
|
|
|
14091
14129
|
var import_clsx43 = __toESM(require("clsx"));
|
|
14092
14130
|
|
|
14093
14131
|
// src/components/user-action/Textarea.tsx
|
|
14094
|
-
var
|
|
14132
|
+
var import_react33 = require("react");
|
|
14095
14133
|
var import_clsx42 = __toESM(require("clsx"));
|
|
14096
14134
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
14097
|
-
var Textarea = (0,
|
|
14135
|
+
var Textarea = (0, import_react33.forwardRef)(function Textarea2({
|
|
14098
14136
|
id,
|
|
14099
14137
|
onChange,
|
|
14100
14138
|
onChangeText,
|
|
@@ -14168,7 +14206,7 @@ var TextareaWithHeadline = ({
|
|
|
14168
14206
|
containerClassName,
|
|
14169
14207
|
...props
|
|
14170
14208
|
}) => {
|
|
14171
|
-
const genId = (0,
|
|
14209
|
+
const genId = (0, import_react33.useId)();
|
|
14172
14210
|
const usedId = id ?? genId;
|
|
14173
14211
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
14174
14212
|
"div",
|
|
@@ -14283,7 +14321,7 @@ var TableFilters = {
|
|
|
14283
14321
|
};
|
|
14284
14322
|
|
|
14285
14323
|
// src/components/table/Table.tsx
|
|
14286
|
-
var
|
|
14324
|
+
var import_react39 = require("react");
|
|
14287
14325
|
var import_clsx48 = __toESM(require("clsx"));
|
|
14288
14326
|
var import_react_table = require("@tanstack/react-table");
|
|
14289
14327
|
var import_react_custom_scrollbars_23 = require("react-custom-scrollbars-2");
|
|
@@ -14299,9 +14337,9 @@ var TableCell = ({
|
|
|
14299
14337
|
};
|
|
14300
14338
|
|
|
14301
14339
|
// src/hooks/useResizeCallbackWrapper.ts
|
|
14302
|
-
var
|
|
14340
|
+
var import_react34 = require("react");
|
|
14303
14341
|
var useResizeCallbackWrapper = (callback) => {
|
|
14304
|
-
(0,
|
|
14342
|
+
(0, import_react34.useEffect)(() => {
|
|
14305
14343
|
window.addEventListener("resize", callback);
|
|
14306
14344
|
return () => {
|
|
14307
14345
|
window.removeEventListener("resize", callback);
|
|
@@ -14344,7 +14382,7 @@ var TableSortButton = ({
|
|
|
14344
14382
|
var import_lucide_react21 = require("lucide-react");
|
|
14345
14383
|
|
|
14346
14384
|
// src/components/user-action/Menu.tsx
|
|
14347
|
-
var
|
|
14385
|
+
var import_react37 = require("react");
|
|
14348
14386
|
var import_clsx47 = __toESM(require("clsx"));
|
|
14349
14387
|
|
|
14350
14388
|
// src/utils/bagFunctions.ts
|
|
@@ -14416,15 +14454,15 @@ var usePopoverPosition = (trigger, options) => {
|
|
|
14416
14454
|
};
|
|
14417
14455
|
|
|
14418
14456
|
// src/hooks/useHoverState.ts
|
|
14419
|
-
var
|
|
14457
|
+
var import_react35 = require("react");
|
|
14420
14458
|
var defaultUseHoverStateProps = {
|
|
14421
14459
|
closingDelay: 200,
|
|
14422
14460
|
isDisabled: false
|
|
14423
14461
|
};
|
|
14424
14462
|
var useHoverState = (props = void 0) => {
|
|
14425
14463
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
14426
|
-
const [isHovered, setIsHovered] = (0,
|
|
14427
|
-
const [timer, setTimer] = (0,
|
|
14464
|
+
const [isHovered, setIsHovered] = (0, import_react35.useState)(false);
|
|
14465
|
+
const [timer, setTimer] = (0, import_react35.useState)();
|
|
14428
14466
|
const onMouseEnter = () => {
|
|
14429
14467
|
if (isDisabled) {
|
|
14430
14468
|
return;
|
|
@@ -14440,14 +14478,14 @@ var useHoverState = (props = void 0) => {
|
|
|
14440
14478
|
setIsHovered(false);
|
|
14441
14479
|
}, closingDelay));
|
|
14442
14480
|
};
|
|
14443
|
-
(0,
|
|
14481
|
+
(0, import_react35.useEffect)(() => {
|
|
14444
14482
|
if (timer) {
|
|
14445
14483
|
return () => {
|
|
14446
14484
|
clearTimeout(timer);
|
|
14447
14485
|
};
|
|
14448
14486
|
}
|
|
14449
14487
|
});
|
|
14450
|
-
(0,
|
|
14488
|
+
(0, import_react35.useEffect)(() => {
|
|
14451
14489
|
if (timer) {
|
|
14452
14490
|
clearTimeout(timer);
|
|
14453
14491
|
}
|
|
@@ -14460,9 +14498,9 @@ var useHoverState = (props = void 0) => {
|
|
|
14460
14498
|
};
|
|
14461
14499
|
|
|
14462
14500
|
// src/hooks/useOutsideClick.ts
|
|
14463
|
-
var
|
|
14501
|
+
var import_react36 = require("react");
|
|
14464
14502
|
var useOutsideClick = (refs, handler) => {
|
|
14465
|
-
(0,
|
|
14503
|
+
(0, import_react36.useEffect)(() => {
|
|
14466
14504
|
const listener = (event) => {
|
|
14467
14505
|
if (event.target === null) return;
|
|
14468
14506
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -14520,10 +14558,10 @@ var Menu = ({
|
|
|
14520
14558
|
menuClassName = ""
|
|
14521
14559
|
}) => {
|
|
14522
14560
|
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
14523
|
-
const triggerRef = (0,
|
|
14524
|
-
const menuRef = (0,
|
|
14561
|
+
const triggerRef = (0, import_react37.useRef)(null);
|
|
14562
|
+
const menuRef = (0, import_react37.useRef)(null);
|
|
14525
14563
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
14526
|
-
const [isHidden, setIsHidden] = (0,
|
|
14564
|
+
const [isHidden, setIsHidden] = (0, import_react37.useState)(true);
|
|
14527
14565
|
const bag = {
|
|
14528
14566
|
isOpen,
|
|
14529
14567
|
close: () => setIsOpen(false),
|
|
@@ -14534,7 +14572,7 @@ var Menu = ({
|
|
|
14534
14572
|
triggerRef.current?.getBoundingClientRect(),
|
|
14535
14573
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
14536
14574
|
);
|
|
14537
|
-
(0,
|
|
14575
|
+
(0, import_react37.useEffect)(() => {
|
|
14538
14576
|
if (!isOpen) return;
|
|
14539
14577
|
const triggerEl = triggerRef.current;
|
|
14540
14578
|
if (!triggerEl) return;
|
|
@@ -14551,7 +14589,7 @@ var Menu = ({
|
|
|
14551
14589
|
window.removeEventListener("resize", close);
|
|
14552
14590
|
};
|
|
14553
14591
|
}, [isOpen, setIsOpen]);
|
|
14554
|
-
(0,
|
|
14592
|
+
(0, import_react37.useEffect)(() => {
|
|
14555
14593
|
if (isOpen) {
|
|
14556
14594
|
setIsHidden(false);
|
|
14557
14595
|
}
|
|
@@ -14587,7 +14625,7 @@ var Menu = ({
|
|
|
14587
14625
|
};
|
|
14588
14626
|
|
|
14589
14627
|
// src/components/table/TableFilterButton.tsx
|
|
14590
|
-
var
|
|
14628
|
+
var import_react38 = require("react");
|
|
14591
14629
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14592
14630
|
var defaultTableFilterTranslation = {
|
|
14593
14631
|
en: {
|
|
@@ -14613,9 +14651,9 @@ var TableFilterButton = ({
|
|
|
14613
14651
|
}) => {
|
|
14614
14652
|
const translation = useTranslation([formTranslation, defaultTableFilterTranslation]);
|
|
14615
14653
|
const columnFilterValue = column.getFilterValue();
|
|
14616
|
-
const [filterValue, setFilterValue] = (0,
|
|
14654
|
+
const [filterValue, setFilterValue] = (0, import_react38.useState)(columnFilterValue);
|
|
14617
14655
|
const hasFilter = !!filterValue;
|
|
14618
|
-
(0,
|
|
14656
|
+
(0, import_react38.useEffect)(() => {
|
|
14619
14657
|
setFilterValue(columnFilterValue);
|
|
14620
14658
|
}, [columnFilterValue]);
|
|
14621
14659
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
@@ -14729,22 +14767,22 @@ var Table = ({
|
|
|
14729
14767
|
columns,
|
|
14730
14768
|
...tableOptions
|
|
14731
14769
|
}) => {
|
|
14732
|
-
const ref = (0,
|
|
14733
|
-
const tableRef = (0,
|
|
14734
|
-
const [columnSizing, setColumnSizing] = (0,
|
|
14770
|
+
const ref = (0, import_react39.useRef)(null);
|
|
14771
|
+
const tableRef = (0, import_react39.useRef)(null);
|
|
14772
|
+
const [columnSizing, setColumnSizing] = (0, import_react39.useState)(columns.reduce((previousValue, currentValue) => {
|
|
14735
14773
|
return {
|
|
14736
14774
|
...previousValue,
|
|
14737
14775
|
[currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
|
|
14738
14776
|
};
|
|
14739
14777
|
}, {}));
|
|
14740
|
-
const [columnSizingInfo, setColumnSizingInfo] = (0,
|
|
14741
|
-
const [pagination, setPagination] = (0,
|
|
14778
|
+
const [columnSizingInfo, setColumnSizingInfo] = (0, import_react39.useState)();
|
|
14779
|
+
const [pagination, setPagination] = (0, import_react39.useState)({
|
|
14742
14780
|
pageSize: 10,
|
|
14743
14781
|
pageIndex: 0,
|
|
14744
14782
|
...initialState?.pagination
|
|
14745
14783
|
});
|
|
14746
|
-
const [columnFilters, setColumnFilters] = (0,
|
|
14747
|
-
const computedColumnMinWidths = (0,
|
|
14784
|
+
const [columnFilters, setColumnFilters] = (0, import_react39.useState)(initialState?.columnFilters);
|
|
14785
|
+
const computedColumnMinWidths = (0, import_react39.useMemo)(() => {
|
|
14748
14786
|
return columns.reduce((previousValue, column) => {
|
|
14749
14787
|
return {
|
|
14750
14788
|
...previousValue,
|
|
@@ -14753,7 +14791,7 @@ var Table = ({
|
|
|
14753
14791
|
};
|
|
14754
14792
|
}, {});
|
|
14755
14793
|
}, [columns, defaultColumn]);
|
|
14756
|
-
const computedColumnMaxWidths = (0,
|
|
14794
|
+
const computedColumnMaxWidths = (0, import_react39.useMemo)(() => {
|
|
14757
14795
|
return columns.reduce((previousValue, column) => {
|
|
14758
14796
|
return {
|
|
14759
14797
|
...previousValue,
|
|
@@ -14761,12 +14799,12 @@ var Table = ({
|
|
|
14761
14799
|
};
|
|
14762
14800
|
}, {});
|
|
14763
14801
|
}, [columns, defaultColumn]);
|
|
14764
|
-
const tableMinWidth = (0,
|
|
14802
|
+
const tableMinWidth = (0, import_react39.useMemo)(() => {
|
|
14765
14803
|
return columns.reduce((sum, column) => {
|
|
14766
14804
|
return sum + computedColumnMinWidths[column.id];
|
|
14767
14805
|
}, 0);
|
|
14768
14806
|
}, [columns, computedColumnMinWidths]);
|
|
14769
|
-
const updateColumnSizes = (0,
|
|
14807
|
+
const updateColumnSizes = (0, import_react39.useMemo)(() => {
|
|
14770
14808
|
return (previous) => {
|
|
14771
14809
|
const updateSizing = {
|
|
14772
14810
|
...columnSizing,
|
|
@@ -14883,18 +14921,18 @@ var Table = ({
|
|
|
14883
14921
|
columnResizeMode: "onChange",
|
|
14884
14922
|
...tableOptions
|
|
14885
14923
|
});
|
|
14886
|
-
const [hasInitializedSizing, setHasInitializedSizing] = (0,
|
|
14887
|
-
(0,
|
|
14924
|
+
const [hasInitializedSizing, setHasInitializedSizing] = (0, import_react39.useState)(false);
|
|
14925
|
+
(0, import_react39.useEffect)(() => {
|
|
14888
14926
|
if (!hasInitializedSizing && ref.current) {
|
|
14889
14927
|
setHasInitializedSizing(true);
|
|
14890
14928
|
table.setColumnSizing(updateColumnSizes(columnSizing));
|
|
14891
14929
|
}
|
|
14892
14930
|
}, [columnSizing, hasInitializedSizing]);
|
|
14893
|
-
useResizeCallbackWrapper((0,
|
|
14931
|
+
useResizeCallbackWrapper((0, import_react39.useCallback)(() => {
|
|
14894
14932
|
table.setColumnSizing(updateColumnSizes);
|
|
14895
14933
|
}, [updateColumnSizes]));
|
|
14896
14934
|
const pageCount = table.getPageCount();
|
|
14897
|
-
(0,
|
|
14935
|
+
(0, import_react39.useEffect)(() => {
|
|
14898
14936
|
const totalPages = pageCount;
|
|
14899
14937
|
if (totalPages === 0) {
|
|
14900
14938
|
if (pagination.pageIndex !== 0) {
|
|
@@ -14910,7 +14948,7 @@ var Table = ({
|
|
|
14910
14948
|
}));
|
|
14911
14949
|
}
|
|
14912
14950
|
}, [data, pageCount, pagination.pageSize, pagination.pageIndex]);
|
|
14913
|
-
const columnSizeVars = (0,
|
|
14951
|
+
const columnSizeVars = (0, import_react39.useMemo)(() => {
|
|
14914
14952
|
const headers = table.getFlatHeaders();
|
|
14915
14953
|
const colSizes = {};
|
|
14916
14954
|
for (let i = 0; i < headers.length; i++) {
|
|
@@ -15045,7 +15083,7 @@ var TableWithSelection = ({
|
|
|
15045
15083
|
meta,
|
|
15046
15084
|
...props
|
|
15047
15085
|
}) => {
|
|
15048
|
-
const columnsWithSelection = (0,
|
|
15086
|
+
const columnsWithSelection = (0, import_react39.useMemo)(() => {
|
|
15049
15087
|
return [
|
|
15050
15088
|
{
|
|
15051
15089
|
id: selectionRowId,
|
|
@@ -15114,7 +15152,7 @@ var TableWithSelection = ({
|
|
|
15114
15152
|
};
|
|
15115
15153
|
|
|
15116
15154
|
// src/components/user-action/CopyToClipboardWrapper.tsx
|
|
15117
|
-
var
|
|
15155
|
+
var import_react40 = require("react");
|
|
15118
15156
|
var import_clsx49 = require("clsx");
|
|
15119
15157
|
|
|
15120
15158
|
// src/utils/writeToClipboard.ts
|
|
@@ -15134,8 +15172,8 @@ var CopyToClipboardWrapper = ({
|
|
|
15134
15172
|
zIndex = 10
|
|
15135
15173
|
}) => {
|
|
15136
15174
|
const translation = useTranslation([formTranslation]);
|
|
15137
|
-
const [isShowingIndication, setIsShowingIndication] = (0,
|
|
15138
|
-
const [isShowingConfirmation, setIsShowingConfirmation] = (0,
|
|
15175
|
+
const [isShowingIndication, setIsShowingIndication] = (0, import_react40.useState)(false);
|
|
15176
|
+
const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react40.useState)(false);
|
|
15139
15177
|
const positionClasses = {
|
|
15140
15178
|
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
15141
15179
|
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
@@ -15277,7 +15315,7 @@ var DateTimePicker = ({
|
|
|
15277
15315
|
};
|
|
15278
15316
|
|
|
15279
15317
|
// src/components/user-action/ScrollPicker.tsx
|
|
15280
|
-
var
|
|
15318
|
+
var import_react41 = require("react");
|
|
15281
15319
|
var import_clsx51 = __toESM(require("clsx"));
|
|
15282
15320
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
15283
15321
|
var up = 1;
|
|
@@ -15298,7 +15336,7 @@ var ScrollPicker = ({
|
|
|
15298
15336
|
transition,
|
|
15299
15337
|
items,
|
|
15300
15338
|
lastTimeStamp
|
|
15301
|
-
}, setAnimation] = (0,
|
|
15339
|
+
}, setAnimation] = (0, import_react41.useState)({
|
|
15302
15340
|
targetIndex: selectedIndex,
|
|
15303
15341
|
currentIndex: disabled ? selectedIndex : 0,
|
|
15304
15342
|
velocity: 0,
|
|
@@ -15314,7 +15352,7 @@ var ScrollPicker = ({
|
|
|
15314
15352
|
const itemHeight = 40;
|
|
15315
15353
|
const distance = 8;
|
|
15316
15354
|
const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
|
|
15317
|
-
const getDirection = (0,
|
|
15355
|
+
const getDirection = (0, import_react41.useCallback)((targetIndex, currentIndex2, transition2, length) => {
|
|
15318
15356
|
if (targetIndex === currentIndex2) {
|
|
15319
15357
|
return transition2 > 0 ? up : down;
|
|
15320
15358
|
}
|
|
@@ -15324,7 +15362,7 @@ var ScrollPicker = ({
|
|
|
15324
15362
|
}
|
|
15325
15363
|
return distanceForward >= length / 2 ? down : up;
|
|
15326
15364
|
}, []);
|
|
15327
|
-
const animate = (0,
|
|
15365
|
+
const animate = (0, import_react41.useCallback)((timestamp, startTime) => {
|
|
15328
15366
|
setAnimation((prevState) => {
|
|
15329
15367
|
const {
|
|
15330
15368
|
targetIndex,
|
|
@@ -15397,7 +15435,7 @@ var ScrollPicker = ({
|
|
|
15397
15435
|
};
|
|
15398
15436
|
});
|
|
15399
15437
|
}, [disabled, getDirection, onChange]);
|
|
15400
|
-
(0,
|
|
15438
|
+
(0, import_react41.useEffect)(() => {
|
|
15401
15439
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
15402
15440
|
});
|
|
15403
15441
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -15565,18 +15603,18 @@ var Tooltip = ({
|
|
|
15565
15603
|
};
|
|
15566
15604
|
|
|
15567
15605
|
// src/components/user-action/input/InsideLabelInput.tsx
|
|
15606
|
+
var import_react42 = require("react");
|
|
15568
15607
|
var import_react43 = require("react");
|
|
15569
|
-
var import_react44 = require("react");
|
|
15570
15608
|
var import_clsx54 = __toESM(require("clsx"));
|
|
15571
15609
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
15572
|
-
var InsideLabelInput = (0,
|
|
15610
|
+
var InsideLabelInput = (0, import_react43.forwardRef)(function InsideLabelInput2({
|
|
15573
15611
|
id: customId,
|
|
15574
15612
|
label,
|
|
15575
15613
|
...props
|
|
15576
15614
|
}, forwardedRef) {
|
|
15577
15615
|
const { value } = props;
|
|
15578
|
-
const [isFocused, setIsFocused] = (0,
|
|
15579
|
-
const generatedId = (0,
|
|
15616
|
+
const [isFocused, setIsFocused] = (0, import_react43.useState)(false);
|
|
15617
|
+
const generatedId = (0, import_react42.useId)();
|
|
15580
15618
|
const id = customId ?? generatedId;
|
|
15581
15619
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: (0, import_clsx54.default)("relative"), children: [
|
|
15582
15620
|
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
@@ -15629,20 +15667,20 @@ var InsideLabelInputUncontrolled = ({
|
|
|
15629
15667
|
};
|
|
15630
15668
|
|
|
15631
15669
|
// src/components/user-action/input/ToggleableInput.tsx
|
|
15632
|
-
var
|
|
15670
|
+
var import_react44 = require("react");
|
|
15633
15671
|
var import_lucide_react24 = require("lucide-react");
|
|
15634
15672
|
var import_clsx55 = __toESM(require("clsx"));
|
|
15635
15673
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
15636
|
-
var ToggleableInput = (0,
|
|
15674
|
+
var ToggleableInput = (0, import_react44.forwardRef)(function ToggleableInput2({
|
|
15637
15675
|
value,
|
|
15638
15676
|
initialState = "display",
|
|
15639
15677
|
editCompleteOptions,
|
|
15640
15678
|
...props
|
|
15641
15679
|
}, forwardedRef) {
|
|
15642
|
-
const [isEditing, setIsEditing] = (0,
|
|
15643
|
-
const innerRef = (0,
|
|
15644
|
-
(0,
|
|
15645
|
-
(0,
|
|
15680
|
+
const [isEditing, setIsEditing] = (0, import_react44.useState)(initialState !== "display");
|
|
15681
|
+
const innerRef = (0, import_react44.useRef)(null);
|
|
15682
|
+
(0, import_react44.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
15683
|
+
(0, import_react44.useEffect)(() => {
|
|
15646
15684
|
if (isEditing) {
|
|
15647
15685
|
innerRef.current?.focus();
|
|
15648
15686
|
}
|
|
@@ -15697,33 +15735,33 @@ var ToggleableInputUncontrolled = ({
|
|
|
15697
15735
|
};
|
|
15698
15736
|
|
|
15699
15737
|
// src/components/utils/FocusTrap.tsx
|
|
15738
|
+
var import_react45 = require("react");
|
|
15700
15739
|
var import_react46 = require("react");
|
|
15701
15740
|
var import_react47 = require("react");
|
|
15702
|
-
var import_react48 = require("react");
|
|
15703
15741
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
15704
|
-
var FocusTrap = (0,
|
|
15742
|
+
var FocusTrap = (0, import_react47.forwardRef)(function FocusTrap2({
|
|
15705
15743
|
active = true,
|
|
15706
15744
|
initialFocus,
|
|
15707
15745
|
focusFirst = false,
|
|
15708
15746
|
...props
|
|
15709
15747
|
}, forwardedRef) {
|
|
15710
|
-
const innerRef = (0,
|
|
15711
|
-
(0,
|
|
15748
|
+
const innerRef = (0, import_react45.useRef)(null);
|
|
15749
|
+
(0, import_react46.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
15712
15750
|
useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
|
|
15713
15751
|
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { ref: innerRef, ...props });
|
|
15714
15752
|
});
|
|
15715
15753
|
|
|
15716
15754
|
// src/components/utils/Transition.tsx
|
|
15717
|
-
var
|
|
15755
|
+
var import_react48 = require("react");
|
|
15718
15756
|
function Transition({
|
|
15719
15757
|
children,
|
|
15720
15758
|
show,
|
|
15721
15759
|
includeAnimation = true
|
|
15722
15760
|
}) {
|
|
15723
|
-
const [isOpen, setIsOpen] = (0,
|
|
15724
|
-
const [isTransitioning, setIsTransitioning] = (0,
|
|
15761
|
+
const [isOpen, setIsOpen] = (0, import_react48.useState)(show);
|
|
15762
|
+
const [isTransitioning, setIsTransitioning] = (0, import_react48.useState)(!isOpen);
|
|
15725
15763
|
const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
|
|
15726
|
-
(0,
|
|
15764
|
+
(0, import_react48.useEffect)(() => {
|
|
15727
15765
|
setIsOpen(show);
|
|
15728
15766
|
setIsTransitioning(true);
|
|
15729
15767
|
}, [show]);
|
|
@@ -15748,7 +15786,7 @@ function Transition({
|
|
|
15748
15786
|
}
|
|
15749
15787
|
|
|
15750
15788
|
// src/hooks/focus/useFocusGuards.ts
|
|
15751
|
-
var
|
|
15789
|
+
var import_react49 = require("react");
|
|
15752
15790
|
var selectorName = "data-hw-focus-guard";
|
|
15753
15791
|
function FocusGuard() {
|
|
15754
15792
|
const element = document.createElement("div");
|
|
@@ -15786,7 +15824,7 @@ var FocusGuardsService = class _FocusGuardsService {
|
|
|
15786
15824
|
}
|
|
15787
15825
|
};
|
|
15788
15826
|
var useFocusGuards = () => {
|
|
15789
|
-
(0,
|
|
15827
|
+
(0, import_react49.useEffect)(() => {
|
|
15790
15828
|
FocusGuardsService.getInstance().add();
|
|
15791
15829
|
return () => {
|
|
15792
15830
|
FocusGuardsService.getInstance().remove();
|
|
@@ -15795,10 +15833,10 @@ var useFocusGuards = () => {
|
|
|
15795
15833
|
};
|
|
15796
15834
|
|
|
15797
15835
|
// src/hooks/focus/useFocusOnceVisible.ts
|
|
15798
|
-
var
|
|
15836
|
+
var import_react50 = __toESM(require("react"));
|
|
15799
15837
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
15800
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
15801
|
-
(0,
|
|
15838
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react50.default.useState(false);
|
|
15839
|
+
(0, import_react50.useEffect)(() => {
|
|
15802
15840
|
if (disable || hasUsedFocus) {
|
|
15803
15841
|
return;
|
|
15804
15842
|
}
|
|
@@ -15818,13 +15856,13 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
15818
15856
|
};
|
|
15819
15857
|
|
|
15820
15858
|
// src/hooks/useRerender.ts
|
|
15821
|
-
var
|
|
15859
|
+
var import_react51 = require("react");
|
|
15822
15860
|
var useRerender = () => {
|
|
15823
|
-
return (0,
|
|
15861
|
+
return (0, import_react51.useReducer)(() => ({}), {})[1];
|
|
15824
15862
|
};
|
|
15825
15863
|
|
|
15826
15864
|
// src/hooks/useSearch.ts
|
|
15827
|
-
var
|
|
15865
|
+
var import_react52 = require("react");
|
|
15828
15866
|
|
|
15829
15867
|
// src/utils/simpleSearch.ts
|
|
15830
15868
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -15863,34 +15901,34 @@ var useSearch = ({
|
|
|
15863
15901
|
filter,
|
|
15864
15902
|
disabled = false
|
|
15865
15903
|
}) => {
|
|
15866
|
-
const [search, setSearch] = (0,
|
|
15867
|
-
const [result, setResult] = (0,
|
|
15868
|
-
const searchTags = (0,
|
|
15869
|
-
const updateSearch = (0,
|
|
15904
|
+
const [search, setSearch] = (0, import_react52.useState)(initialSearch ?? "");
|
|
15905
|
+
const [result, setResult] = (0, import_react52.useState)(list);
|
|
15906
|
+
const searchTags = (0, import_react52.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
15907
|
+
const updateSearch = (0, import_react52.useCallback)((newSearch) => {
|
|
15870
15908
|
const usedSearch = newSearch ?? search;
|
|
15871
15909
|
if (newSearch) {
|
|
15872
15910
|
setSearch(search);
|
|
15873
15911
|
}
|
|
15874
15912
|
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
15875
15913
|
}, [searchTags, list, search, searchMapping]);
|
|
15876
|
-
(0,
|
|
15914
|
+
(0, import_react52.useEffect)(() => {
|
|
15877
15915
|
if (isSearchInstant) {
|
|
15878
15916
|
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
15879
15917
|
}
|
|
15880
15918
|
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
15881
|
-
const filteredResult = (0,
|
|
15919
|
+
const filteredResult = (0, import_react52.useMemo)(() => {
|
|
15882
15920
|
if (!filter) {
|
|
15883
15921
|
return result;
|
|
15884
15922
|
}
|
|
15885
15923
|
return result.filter(filter);
|
|
15886
15924
|
}, [result, filter]);
|
|
15887
|
-
const sortedAndFilteredResult = (0,
|
|
15925
|
+
const sortedAndFilteredResult = (0, import_react52.useMemo)(() => {
|
|
15888
15926
|
if (!sortingFunction) {
|
|
15889
15927
|
return filteredResult;
|
|
15890
15928
|
}
|
|
15891
15929
|
return filteredResult.sort(sortingFunction);
|
|
15892
15930
|
}, [filteredResult, sortingFunction]);
|
|
15893
|
-
const usedResult = (0,
|
|
15931
|
+
const usedResult = (0, import_react52.useMemo)(() => {
|
|
15894
15932
|
if (!disabled) {
|
|
15895
15933
|
return sortedAndFilteredResult;
|
|
15896
15934
|
}
|