@helpwave/hightide 0.1.7 → 0.1.9
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/branding/HelpwaveBadge.js +30 -8
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +30 -8
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
- package/dist/components/date/DatePicker.d.mts +3 -4
- package/dist/components/date/DatePicker.d.ts +3 -4
- package/dist/components/date/DatePicker.js +135 -33
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +135 -33
- package/dist/components/date/DatePicker.mjs.map +1 -1
- package/dist/components/date/DayPicker.d.mts +1 -1
- package/dist/components/date/DayPicker.d.ts +1 -1
- package/dist/components/date/DayPicker.js +23 -11
- package/dist/components/date/DayPicker.js.map +1 -1
- package/dist/components/date/DayPicker.mjs +23 -11
- package/dist/components/date/DayPicker.mjs.map +1 -1
- package/dist/components/date/TimeDisplay.d.mts +5 -19
- package/dist/components/date/TimeDisplay.d.ts +5 -19
- package/dist/components/date/TimeDisplay.js +121 -37
- package/dist/components/date/TimeDisplay.js.map +1 -1
- package/dist/components/date/TimeDisplay.mjs +121 -37
- package/dist/components/date/TimeDisplay.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js +106 -22
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +106 -22
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.d.mts +2 -5
- package/dist/components/dialogs/ConfirmDialog.d.ts +2 -5
- package/dist/components/dialogs/ConfirmDialog.js +157 -25
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +157 -25
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.js +2 -2
- package/dist/components/icons-and-geometry/Avatar.js.map +1 -1
- package/dist/components/icons-and-geometry/Avatar.mjs +2 -2
- package/dist/components/icons-and-geometry/Avatar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.d.mts +1 -1
- package/dist/components/layout-and-navigation/Carousel.d.ts +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +86 -28
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.mjs +86 -28
- package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.d.mts +3 -0
- package/dist/components/layout-and-navigation/Expandable.d.ts +3 -0
- package/dist/components/layout-and-navigation/Expandable.js +4 -3
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +4 -3
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +4 -3
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +4 -3
- package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.d.mts +2 -3
- package/dist/components/layout-and-navigation/Overlay.d.ts +2 -3
- package/dist/components/layout-and-navigation/Overlay.js +152 -12
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +152 -12
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.d.mts +2 -3
- package/dist/components/layout-and-navigation/Pagination.d.ts +2 -3
- package/dist/components/layout-and-navigation/Pagination.js +145 -13
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +145 -13
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.d.mts +10 -8
- package/dist/components/layout-and-navigation/SearchableList.d.ts +10 -8
- package/dist/components/layout-and-navigation/SearchableList.js +261 -30
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +261 -30
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.d.mts +2 -5
- package/dist/components/layout-and-navigation/StepperBar.d.ts +2 -5
- package/dist/components/layout-and-navigation/StepperBar.js +149 -19
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +149 -19
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Table.js +146 -14
- package/dist/components/layout-and-navigation/Table.js.map +1 -1
- package/dist/components/layout-and-navigation/Table.mjs +146 -14
- package/dist/components/layout-and-navigation/Table.mjs.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.d.mts +3 -4
- package/dist/components/layout-and-navigation/TextImage.d.ts +3 -4
- package/dist/components/layout-and-navigation/TextImage.js +153 -19
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +153 -19
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Tile.d.mts +10 -15
- package/dist/components/layout-and-navigation/Tile.d.ts +10 -15
- package/dist/components/layout-and-navigation/Tile.js +30 -8
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +30 -8
- package/dist/components/layout-and-navigation/Tile.mjs.map +1 -1
- package/dist/components/loading-states/ErrorComponent.js +48 -8
- package/dist/components/loading-states/ErrorComponent.js.map +1 -1
- package/dist/components/loading-states/ErrorComponent.mjs +48 -8
- package/dist/components/loading-states/ErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.d.mts +1 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.d.ts +1 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.js +147 -15
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +147 -15
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.d.mts +2 -3
- package/dist/components/loading-states/LoadingAnimation.d.ts +2 -3
- package/dist/components/loading-states/LoadingAnimation.js +145 -13
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +145 -13
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/loading-states/ProgressIndicator.js +2 -2
- package/dist/components/loading-states/ProgressIndicator.js.map +1 -1
- package/dist/components/loading-states/ProgressIndicator.mjs +2 -2
- package/dist/components/loading-states/ProgressIndicator.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.d.mts +2 -5
- package/dist/components/modals/ConfirmModal.d.ts +2 -5
- package/dist/components/modals/ConfirmModal.js +158 -28
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +158 -28
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.d.mts +2 -7
- package/dist/components/modals/DiscardChangesModal.d.ts +2 -7
- package/dist/components/modals/DiscardChangesModal.js +162 -48
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +162 -48
- package/dist/components/modals/DiscardChangesModal.mjs.map +1 -1
- package/dist/components/modals/InputModal.d.mts +1 -0
- package/dist/components/modals/InputModal.d.ts +1 -0
- package/dist/components/modals/InputModal.js +158 -28
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +158 -28
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.d.mts +3 -2
- package/dist/components/modals/LanguageModal.d.ts +3 -2
- package/dist/components/modals/LanguageModal.js +538 -166
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +537 -165
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.d.mts +5 -5
- package/dist/components/modals/ThemeModal.d.ts +5 -5
- package/dist/components/modals/ThemeModal.js +547 -176
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +544 -173
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.d.mts +3 -5
- package/dist/components/properties/CheckboxProperty.d.ts +3 -5
- package/dist/components/properties/CheckboxProperty.js +148 -26
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +148 -26
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.d.mts +1 -0
- package/dist/components/properties/DateProperty.d.ts +1 -0
- package/dist/components/properties/DateProperty.js +146 -14
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +146 -14
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.d.mts +5 -5
- package/dist/components/properties/MultiSelectProperty.d.ts +5 -5
- package/dist/components/properties/MultiSelectProperty.js +626 -456
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +622 -452
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.d.mts +1 -0
- package/dist/components/properties/NumberProperty.d.ts +1 -0
- package/dist/components/properties/NumberProperty.js +148 -16
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +148 -16
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.d.mts +2 -3
- package/dist/components/properties/PropertyBase.d.ts +2 -3
- package/dist/components/properties/PropertyBase.js +146 -14
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +146 -14
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.d.mts +5 -6
- package/dist/components/properties/SelectProperty.d.ts +5 -6
- package/dist/components/properties/SelectProperty.js +542 -279
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +542 -279
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.d.mts +2 -1
- package/dist/components/properties/TextProperty.d.ts +2 -1
- package/dist/components/properties/TextProperty.js +150 -18
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +150 -18
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.d.mts +4 -20
- package/dist/components/user-action/DateAndTimePicker.d.ts +4 -20
- package/dist/components/user-action/DateAndTimePicker.js +233 -71
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +233 -71
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Menu.d.mts +14 -8
- package/dist/components/user-action/Menu.d.ts +14 -8
- package/dist/components/user-action/Menu.js +32 -11
- package/dist/components/user-action/Menu.js.map +1 -1
- package/dist/components/user-action/Menu.mjs +32 -11
- package/dist/components/user-action/Menu.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.d.mts +13 -23
- package/dist/components/user-action/MultiSelect.d.ts +13 -23
- package/dist/components/user-action/MultiSelect.js +632 -325
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +629 -323
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/Select.d.mts +5 -18
- package/dist/components/user-action/Select.d.ts +5 -18
- package/dist/components/user-action/Select.js +447 -113
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +442 -107
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Tooltip.js +2 -2
- package/dist/components/user-action/Tooltip.js.map +1 -1
- package/dist/components/user-action/Tooltip.mjs +2 -2
- package/dist/components/user-action/Tooltip.mjs.map +1 -1
- package/dist/css/globals.css +224 -207
- package/dist/css/uncompiled/globals.css +138 -74
- package/dist/hooks/useSearch.d.mts +17 -0
- package/dist/hooks/useSearch.d.ts +17 -0
- package/dist/hooks/useSearch.js +66 -0
- package/dist/hooks/useSearch.js.map +1 -0
- package/dist/hooks/useSearch.mjs +42 -0
- package/dist/hooks/useSearch.mjs.map +1 -0
- package/dist/index.d.mts +10 -6
- package/dist/index.d.ts +10 -6
- package/dist/index.js +882 -758
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +836 -717
- package/dist/index.mjs.map +1 -1
- package/dist/localization/defaults/form.d.mts +54 -0
- package/dist/localization/defaults/form.d.ts +54 -0
- package/dist/localization/defaults/form.js +127 -0
- package/dist/localization/defaults/form.js.map +1 -0
- package/dist/localization/defaults/form.mjs +103 -0
- package/dist/localization/defaults/form.mjs.map +1 -0
- package/dist/localization/defaults/time.d.mts +39 -0
- package/dist/localization/defaults/time.d.ts +39 -0
- package/dist/localization/defaults/time.js +101 -0
- package/dist/localization/defaults/time.js.map +1 -0
- package/dist/localization/defaults/time.mjs +76 -0
- package/dist/localization/defaults/time.mjs.map +1 -0
- package/dist/localization/useTranslation.d.mts +30 -6
- package/dist/localization/useTranslation.d.ts +30 -6
- package/dist/localization/useTranslation.js +46 -6
- package/dist/localization/useTranslation.js.map +1 -1
- package/dist/localization/useTranslation.mjs +46 -6
- package/dist/localization/useTranslation.mjs.map +1 -1
- package/dist/theming/useTheme.d.mts +4 -2
- package/dist/theming/useTheme.d.ts +4 -2
- package/dist/theming/useTheme.js +10 -2
- package/dist/theming/useTheme.js.map +1 -1
- package/dist/theming/useTheme.mjs +10 -2
- package/dist/theming/useTheme.mjs.map +1 -1
- package/dist/util/PropsWithFunctionChildren.d.mts +14 -0
- package/dist/util/PropsWithFunctionChildren.d.ts +14 -0
- package/dist/util/PropsWithFunctionChildren.js +38 -0
- package/dist/util/PropsWithFunctionChildren.js.map +1 -0
- package/dist/util/PropsWithFunctionChildren.mjs +14 -0
- package/dist/util/PropsWithFunctionChildren.mjs.map +1 -0
- package/dist/util/simpleSearch.d.mts +2 -2
- package/dist/util/simpleSearch.d.ts +2 -2
- package/dist/util/simpleSearch.js +4 -1
- package/dist/util/simpleSearch.js.map +1 -1
- package/dist/util/simpleSearch.mjs +4 -1
- package/dist/util/simpleSearch.mjs.map +1 -1
- package/package.json +1 -2
|
@@ -29,11 +29,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/components/user-action/MultiSelect.tsx
|
|
30
30
|
var MultiSelect_exports = {};
|
|
31
31
|
__export(MultiSelect_exports, {
|
|
32
|
-
MultiSelect: () => MultiSelect
|
|
32
|
+
MultiSelect: () => MultiSelect,
|
|
33
|
+
MultiSelectUncontrolled: () => MultiSelectUncontrolled
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(MultiSelect_exports);
|
|
35
|
-
var
|
|
36
|
-
var
|
|
36
|
+
var import_react7 = require("react");
|
|
37
|
+
var import_lucide_react3 = require("lucide-react");
|
|
37
38
|
|
|
38
39
|
// src/localization/LanguageProvider.tsx
|
|
39
40
|
var import_react2 = require("react");
|
|
@@ -63,160 +64,91 @@ var LanguageContext = (0, import_react2.createContext)({
|
|
|
63
64
|
var useLanguage = () => (0, import_react2.useContext)(LanguageContext);
|
|
64
65
|
|
|
65
66
|
// src/localization/useTranslation.ts
|
|
66
|
-
var useTranslation = (
|
|
67
|
-
const { language: languageProp, translation: overwrite } =
|
|
67
|
+
var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
68
|
+
const { language: languageProp, translation: overwrite } = overwriteTranslation;
|
|
68
69
|
const { language: inferredLanguage } = useLanguage();
|
|
69
70
|
const usedLanguage = languageProp ?? inferredLanguage;
|
|
70
|
-
|
|
71
|
-
if (overwrite
|
|
72
|
-
|
|
71
|
+
const usedTranslations = [...translations];
|
|
72
|
+
if (overwrite) {
|
|
73
|
+
usedTranslations.push(overwrite);
|
|
73
74
|
}
|
|
74
|
-
return
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
75
|
+
return (key, options) => {
|
|
76
|
+
const { count, replacements } = { ...{ count: 0, replacements: {} }, ...options };
|
|
77
|
+
try {
|
|
78
|
+
for (let i = translations.length - 1; i >= 0; i--) {
|
|
79
|
+
const translation = translations[i];
|
|
80
|
+
const localizedTranslation = translation[usedLanguage];
|
|
81
|
+
if (!localizedTranslation) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const value = localizedTranslation[key];
|
|
85
|
+
if (!value) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
let forProcessing;
|
|
89
|
+
if (typeof value !== "string") {
|
|
90
|
+
if (count <= 0 && value?.zero) {
|
|
91
|
+
forProcessing = value.zero;
|
|
92
|
+
} else if (count === 1 && value?.one) {
|
|
93
|
+
forProcessing = value.one;
|
|
94
|
+
} else if (count === 2 && value?.two) {
|
|
95
|
+
forProcessing = value.two;
|
|
96
|
+
} else if (count <= 10 && value?.few) {
|
|
97
|
+
forProcessing = value.few;
|
|
98
|
+
} else if (count > 10 && value?.many) {
|
|
99
|
+
forProcessing = value.many;
|
|
100
|
+
} else {
|
|
101
|
+
forProcessing = value.other;
|
|
102
|
+
}
|
|
103
|
+
} else {
|
|
104
|
+
forProcessing = value;
|
|
105
|
+
}
|
|
106
|
+
forProcessing = forProcessing.replace(/\{\{(\w+)}}/g, (_, placeholder) => {
|
|
107
|
+
return replacements[placeholder] ?? `{{${placeholder}}}`;
|
|
108
|
+
});
|
|
109
|
+
return forProcessing;
|
|
100
110
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
document.addEventListener("mousedown", listener);
|
|
104
|
-
document.addEventListener("touchstart", listener);
|
|
105
|
-
return () => {
|
|
106
|
-
document.removeEventListener("mousedown", listener);
|
|
107
|
-
document.removeEventListener("touchstart", listener);
|
|
108
|
-
};
|
|
109
|
-
}, [refs, handler]);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
// src/hooks/useHoverState.ts
|
|
113
|
-
var import_react4 = require("react");
|
|
114
|
-
var defaultUseHoverStateProps = {
|
|
115
|
-
closingDelay: 200,
|
|
116
|
-
isDisabled: false
|
|
117
|
-
};
|
|
118
|
-
var useHoverState = (props = void 0) => {
|
|
119
|
-
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
120
|
-
const [isHovered, setIsHovered] = (0, import_react4.useState)(false);
|
|
121
|
-
const [timer, setTimer] = (0, import_react4.useState)();
|
|
122
|
-
const onMouseEnter = () => {
|
|
123
|
-
if (isDisabled) {
|
|
124
|
-
return;
|
|
111
|
+
} catch (e) {
|
|
112
|
+
console.error(e);
|
|
125
113
|
}
|
|
126
|
-
|
|
127
|
-
setIsHovered(true);
|
|
128
|
-
};
|
|
129
|
-
const onMouseLeave = () => {
|
|
130
|
-
if (isDisabled) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
setTimer(setTimeout(() => {
|
|
134
|
-
setIsHovered(false);
|
|
135
|
-
}, closingDelay));
|
|
136
|
-
};
|
|
137
|
-
(0, import_react4.useEffect)(() => {
|
|
138
|
-
if (timer) {
|
|
139
|
-
return () => {
|
|
140
|
-
clearTimeout(timer);
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
(0, import_react4.useEffect)(() => {
|
|
145
|
-
if (timer) {
|
|
146
|
-
clearTimeout(timer);
|
|
147
|
-
}
|
|
148
|
-
}, [isDisabled]);
|
|
149
|
-
return {
|
|
150
|
-
isHovered,
|
|
151
|
-
setIsHovered,
|
|
152
|
-
handlers: { onMouseEnter, onMouseLeave }
|
|
114
|
+
return `{{${usedLanguage}:${key}}}`;
|
|
153
115
|
};
|
|
154
116
|
};
|
|
155
117
|
|
|
156
|
-
// src/components/user-action/
|
|
118
|
+
// src/components/user-action/MultiSelect.tsx
|
|
119
|
+
var import_clsx7 = __toESM(require("clsx"));
|
|
120
|
+
|
|
121
|
+
// src/components/user-action/Label.tsx
|
|
122
|
+
var import_clsx = __toESM(require("clsx"));
|
|
157
123
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
158
|
-
var
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
"div",
|
|
165
|
-
{
|
|
166
|
-
className: (0, import_clsx.default)("block px-3 py-1 bg-menu-background text-menu-text hover:brightness-90", {
|
|
167
|
-
"text-right": alignment === "right",
|
|
168
|
-
"text-left": alignment === "left"
|
|
169
|
-
}, className),
|
|
170
|
-
onClick,
|
|
171
|
-
children
|
|
172
|
-
}
|
|
173
|
-
);
|
|
174
|
-
var Menu = ({
|
|
175
|
-
trigger,
|
|
124
|
+
var styleMapping = {
|
|
125
|
+
labelSmall: "textstyle-label-sm",
|
|
126
|
+
labelMedium: "textstyle-label-md",
|
|
127
|
+
labelBig: "textstyle-label-lg"
|
|
128
|
+
};
|
|
129
|
+
var Label = ({
|
|
176
130
|
children,
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
131
|
+
name,
|
|
132
|
+
labelType = "labelSmall",
|
|
133
|
+
className,
|
|
134
|
+
...props
|
|
180
135
|
}) => {
|
|
181
|
-
|
|
182
|
-
const triggerRef = (0, import_react5.useRef)(null);
|
|
183
|
-
const menuRef = (0, import_react5.useRef)(null);
|
|
184
|
-
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
185
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
186
|
-
"div",
|
|
187
|
-
{
|
|
188
|
-
className: "relative",
|
|
189
|
-
...handlers,
|
|
190
|
-
children: [
|
|
191
|
-
trigger(() => setIsOpen(!isOpen), triggerRef),
|
|
192
|
-
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
193
|
-
"div",
|
|
194
|
-
{
|
|
195
|
-
ref: menuRef,
|
|
196
|
-
onClick: (e) => e.stopPropagation(),
|
|
197
|
-
className: (0, import_clsx.default)("absolute top-full mt-1 py-2 w-60 rounded-lg bg-menu-background text-menu-text ring-1 ring-slate-900/5 text-sm leading-6 font-semibold shadow-md z-[1]", {
|
|
198
|
-
" top-[8px]": alignment[0] === "t",
|
|
199
|
-
" bottom-[8px]": alignment[0] === "b",
|
|
200
|
-
" left-[-8px]": alignment[1] === "l",
|
|
201
|
-
" right-[-8px]": alignment[1] === "r"
|
|
202
|
-
}, menuClassName),
|
|
203
|
-
children
|
|
204
|
-
}
|
|
205
|
-
) : null
|
|
206
|
-
]
|
|
207
|
-
}
|
|
208
|
-
);
|
|
136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
209
137
|
};
|
|
210
138
|
|
|
139
|
+
// src/components/layout-and-navigation/SearchableList.tsx
|
|
140
|
+
var import_lucide_react = require("lucide-react");
|
|
141
|
+
var import_clsx4 = __toESM(require("clsx"));
|
|
142
|
+
|
|
211
143
|
// src/components/user-action/Input.tsx
|
|
212
|
-
var
|
|
213
|
-
var
|
|
144
|
+
var import_react4 = require("react");
|
|
145
|
+
var import_clsx2 = __toESM(require("clsx"));
|
|
214
146
|
|
|
215
147
|
// src/hooks/useSaveDelay.ts
|
|
216
|
-
var
|
|
148
|
+
var import_react3 = require("react");
|
|
217
149
|
function useSaveDelay(setNotificationStatus, delay) {
|
|
218
|
-
const [updateTimer, setUpdateTimer] = (0,
|
|
219
|
-
const [notificationTimer, setNotificationTimer] = (0,
|
|
150
|
+
const [updateTimer, setUpdateTimer] = (0, import_react3.useState)(void 0);
|
|
151
|
+
const [notificationTimer, setNotificationTimer] = (0, import_react3.useState)(void 0);
|
|
220
152
|
const restartTimer = (onSave) => {
|
|
221
153
|
clearTimeout(updateTimer);
|
|
222
154
|
setUpdateTimer(setTimeout(() => {
|
|
@@ -243,7 +175,7 @@ function useSaveDelay(setNotificationStatus, delay) {
|
|
|
243
175
|
setNotificationStatus(false);
|
|
244
176
|
}
|
|
245
177
|
};
|
|
246
|
-
(0,
|
|
178
|
+
(0, import_react3.useEffect)(() => {
|
|
247
179
|
return () => {
|
|
248
180
|
clearTimeout(updateTimer);
|
|
249
181
|
clearTimeout(notificationTimer);
|
|
@@ -255,26 +187,8 @@ function useSaveDelay(setNotificationStatus, delay) {
|
|
|
255
187
|
// src/util/noop.ts
|
|
256
188
|
var noop = () => void 0;
|
|
257
189
|
|
|
258
|
-
// src/components/user-action/Label.tsx
|
|
259
|
-
var import_clsx2 = __toESM(require("clsx"));
|
|
260
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
261
|
-
var styleMapping = {
|
|
262
|
-
labelSmall: "textstyle-label-sm",
|
|
263
|
-
labelMedium: "textstyle-label-md",
|
|
264
|
-
labelBig: "textstyle-label-lg"
|
|
265
|
-
};
|
|
266
|
-
var Label = ({
|
|
267
|
-
children,
|
|
268
|
-
name,
|
|
269
|
-
labelType = "labelSmall",
|
|
270
|
-
className,
|
|
271
|
-
...props
|
|
272
|
-
}) => {
|
|
273
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { ...props, className: (0, import_clsx2.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
274
|
-
};
|
|
275
|
-
|
|
276
190
|
// src/components/user-action/Input.tsx
|
|
277
|
-
var
|
|
191
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
278
192
|
var Input = ({
|
|
279
193
|
id,
|
|
280
194
|
type = "text",
|
|
@@ -294,15 +208,15 @@ var Input = ({
|
|
|
294
208
|
restartTimer,
|
|
295
209
|
clearUpdateTimer
|
|
296
210
|
} = useSaveDelay(() => void 0, 3e3);
|
|
297
|
-
const ref = (0,
|
|
298
|
-
(0,
|
|
211
|
+
const ref = (0, import_react4.useRef)(null);
|
|
212
|
+
(0, import_react4.useEffect)(() => {
|
|
299
213
|
if (autoFocus) {
|
|
300
214
|
ref.current?.focus();
|
|
301
215
|
}
|
|
302
216
|
}, [autoFocus]);
|
|
303
|
-
return /* @__PURE__ */ (0,
|
|
304
|
-
label && /* @__PURE__ */ (0,
|
|
305
|
-
/* @__PURE__ */ (0,
|
|
217
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)({ "w-full": expanded }, containerClassName), children: [
|
|
218
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx2.default)("mb-1", label.className) }),
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
306
220
|
"input",
|
|
307
221
|
{
|
|
308
222
|
ref,
|
|
@@ -335,7 +249,7 @@ var Input = ({
|
|
|
335
249
|
)
|
|
336
250
|
] });
|
|
337
251
|
};
|
|
338
|
-
var FormInput = (0,
|
|
252
|
+
var FormInput = (0, import_react4.forwardRef)(function FormInput2({
|
|
339
253
|
id,
|
|
340
254
|
labelText,
|
|
341
255
|
errorText,
|
|
@@ -346,13 +260,13 @@ var FormInput = (0, import_react7.forwardRef)(function FormInput2({
|
|
|
346
260
|
required,
|
|
347
261
|
...restProps
|
|
348
262
|
}, ref) {
|
|
349
|
-
const input = /* @__PURE__ */ (0,
|
|
263
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
350
264
|
"input",
|
|
351
265
|
{
|
|
352
266
|
ref,
|
|
353
267
|
id,
|
|
354
268
|
...restProps,
|
|
355
|
-
className: (0,
|
|
269
|
+
className: (0, import_clsx2.default)(
|
|
356
270
|
{
|
|
357
271
|
"focus:border-primary focus:ring-primary": !errorText,
|
|
358
272
|
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
@@ -361,209 +275,602 @@ var FormInput = (0, import_react7.forwardRef)(function FormInput2({
|
|
|
361
275
|
)
|
|
362
276
|
}
|
|
363
277
|
);
|
|
364
|
-
return /* @__PURE__ */ (0,
|
|
365
|
-
labelText && /* @__PURE__ */ (0,
|
|
278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
279
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { htmlFor: id, className: (0, import_clsx2.default)("textstyle-label-md", labelClassName), children: [
|
|
366
280
|
labelText,
|
|
367
|
-
required && /* @__PURE__ */ (0,
|
|
281
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
368
282
|
] }),
|
|
369
283
|
input,
|
|
370
|
-
errorText && /* @__PURE__ */ (0,
|
|
284
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: id, className: (0, import_clsx2.default)("text-negative", errorClassName), children: errorText })
|
|
371
285
|
] });
|
|
372
286
|
});
|
|
373
287
|
|
|
374
|
-
// src/components/user-action/
|
|
375
|
-
var
|
|
376
|
-
var
|
|
377
|
-
var
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
small: "size-4",
|
|
382
|
-
medium: "size-6",
|
|
383
|
-
large: "size-8"
|
|
288
|
+
// src/components/user-action/Button.tsx
|
|
289
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
290
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
291
|
+
var paddingMapping = {
|
|
292
|
+
small: "btn-sm",
|
|
293
|
+
medium: "btn-md",
|
|
294
|
+
large: "btn-lg"
|
|
384
295
|
};
|
|
385
|
-
var
|
|
386
|
-
small: "
|
|
387
|
-
medium: "
|
|
388
|
-
large: "
|
|
296
|
+
var iconPaddingMapping = {
|
|
297
|
+
small: "icon-btn-sm",
|
|
298
|
+
medium: "icon-btn-md",
|
|
299
|
+
large: "icon-btn-lg"
|
|
389
300
|
};
|
|
390
|
-
var
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
301
|
+
var ButtonUtil = {
|
|
302
|
+
paddingMapping,
|
|
303
|
+
iconPaddingMapping
|
|
304
|
+
};
|
|
305
|
+
var SolidButton = ({
|
|
306
|
+
children,
|
|
307
|
+
disabled = false,
|
|
308
|
+
color = "primary",
|
|
397
309
|
size = "medium",
|
|
398
|
-
|
|
399
|
-
|
|
310
|
+
startIcon,
|
|
311
|
+
endIcon,
|
|
312
|
+
onClick,
|
|
313
|
+
className,
|
|
314
|
+
...restProps
|
|
315
|
+
}) => {
|
|
316
|
+
const colorClasses = {
|
|
317
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
318
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
319
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
320
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
321
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
322
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
323
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
324
|
+
}[color];
|
|
325
|
+
const iconColorClasses = {
|
|
326
|
+
primary: "text-button-solid-primary-icon",
|
|
327
|
+
secondary: "text-button-solid-secondary-icon",
|
|
328
|
+
tertiary: "text-button-solid-tertiary-icon",
|
|
329
|
+
positive: "text-button-solid-positive-icon",
|
|
330
|
+
warning: "text-button-solid-warning-icon",
|
|
331
|
+
negative: "text-button-solid-negative-icon",
|
|
332
|
+
neutral: "text-button-solid-neutral-icon"
|
|
333
|
+
}[color];
|
|
334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
335
|
+
"button",
|
|
336
|
+
{
|
|
337
|
+
onClick: disabled ? void 0 : onClick,
|
|
338
|
+
disabled: disabled || onClick === void 0,
|
|
339
|
+
className: (0, import_clsx3.default)(
|
|
340
|
+
{
|
|
341
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
342
|
+
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
343
|
+
},
|
|
344
|
+
ButtonUtil.paddingMapping[size],
|
|
345
|
+
className
|
|
346
|
+
),
|
|
347
|
+
...restProps,
|
|
348
|
+
children: [
|
|
349
|
+
startIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
350
|
+
"span",
|
|
351
|
+
{
|
|
352
|
+
className: (0, import_clsx3.default)({
|
|
353
|
+
[iconColorClasses]: !disabled,
|
|
354
|
+
[`text-disabled-icon`]: disabled
|
|
355
|
+
}),
|
|
356
|
+
children: startIcon
|
|
357
|
+
}
|
|
358
|
+
),
|
|
359
|
+
children,
|
|
360
|
+
endIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
361
|
+
"span",
|
|
362
|
+
{
|
|
363
|
+
className: (0, import_clsx3.default)({
|
|
364
|
+
[iconColorClasses]: !disabled,
|
|
365
|
+
[`text-disabled-icon`]: disabled
|
|
366
|
+
}),
|
|
367
|
+
children: endIcon
|
|
368
|
+
}
|
|
369
|
+
)
|
|
370
|
+
]
|
|
371
|
+
}
|
|
372
|
+
);
|
|
373
|
+
};
|
|
374
|
+
var IconButton = ({
|
|
375
|
+
children,
|
|
376
|
+
disabled = false,
|
|
377
|
+
color = "primary",
|
|
378
|
+
size = "medium",
|
|
379
|
+
onClick,
|
|
380
|
+
className,
|
|
381
|
+
...restProps
|
|
400
382
|
}) => {
|
|
401
|
-
const
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
383
|
+
const colorClasses = {
|
|
384
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
385
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
386
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
387
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
388
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
389
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
390
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
391
|
+
}[color];
|
|
392
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
393
|
+
"button",
|
|
394
|
+
{
|
|
395
|
+
onClick: disabled ? void 0 : onClick,
|
|
396
|
+
disabled: disabled || onClick === void 0,
|
|
397
|
+
className: (0, import_clsx3.default)(
|
|
398
|
+
{
|
|
399
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
400
|
+
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
401
|
+
},
|
|
402
|
+
ButtonUtil.iconPaddingMapping[size],
|
|
403
|
+
className
|
|
404
|
+
),
|
|
405
|
+
...restProps,
|
|
406
|
+
children
|
|
406
407
|
}
|
|
407
|
-
|
|
408
|
-
|
|
408
|
+
);
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
// src/hooks/useSearch.ts
|
|
412
|
+
var import_react5 = require("react");
|
|
413
|
+
|
|
414
|
+
// src/util/simpleSearch.ts
|
|
415
|
+
var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
416
|
+
return objects.filter((object) => {
|
|
417
|
+
const mappedSearchKeywords = mapping(object)?.map((value) => value.toLowerCase().trim());
|
|
418
|
+
if (!mappedSearchKeywords) {
|
|
419
|
+
return true;
|
|
409
420
|
}
|
|
421
|
+
return !!mappedSearchKeywords.find((value) => value.includes(search.toLowerCase().trim()));
|
|
422
|
+
});
|
|
423
|
+
};
|
|
424
|
+
|
|
425
|
+
// src/hooks/useSearch.ts
|
|
426
|
+
var useSearch = ({
|
|
427
|
+
list,
|
|
428
|
+
initialSearch,
|
|
429
|
+
searchMapping
|
|
430
|
+
}) => {
|
|
431
|
+
const [items, setItems] = (0, import_react5.useState)(list);
|
|
432
|
+
const [search, setSearch] = (0, import_react5.useState)(initialSearch);
|
|
433
|
+
(0, import_react5.useEffect)(() => {
|
|
434
|
+
setItems(list);
|
|
435
|
+
}, [list]);
|
|
436
|
+
const result = (0, import_react5.useMemo)(
|
|
437
|
+
() => MultiSearchWithMapping(search, items, searchMapping),
|
|
438
|
+
[search, items, searchMapping]
|
|
439
|
+
);
|
|
440
|
+
return {
|
|
441
|
+
result,
|
|
442
|
+
hasResult: result.length > 0,
|
|
443
|
+
allItems: items,
|
|
444
|
+
setItems,
|
|
445
|
+
search,
|
|
446
|
+
setSearch
|
|
410
447
|
};
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
// src/localization/defaults/form.ts
|
|
451
|
+
var formTranslation = {
|
|
452
|
+
en: {
|
|
453
|
+
all: "All",
|
|
454
|
+
back: "Back",
|
|
455
|
+
cancel: "Cancel",
|
|
456
|
+
change: "Change",
|
|
457
|
+
clear: "Clear",
|
|
458
|
+
close: "Close",
|
|
459
|
+
confirm: "Confirm",
|
|
460
|
+
decline: "Decline",
|
|
461
|
+
delete: "Delete",
|
|
462
|
+
discard: "Discard",
|
|
463
|
+
discardChanges: "Discard Changes",
|
|
464
|
+
done: "Done",
|
|
465
|
+
edit: "Edit",
|
|
466
|
+
enterText: "Enter text here",
|
|
467
|
+
error: "Error",
|
|
468
|
+
exit: "Exit",
|
|
469
|
+
fieldRequiredError: "This field is required.",
|
|
470
|
+
invalidEmailError: "Please enter a valid email address.",
|
|
471
|
+
less: "Less",
|
|
472
|
+
loading: "Loading",
|
|
473
|
+
maxLengthError: "Maximum length exceeded.",
|
|
474
|
+
minLengthError: "Minimum length not met.",
|
|
475
|
+
more: "More",
|
|
476
|
+
next: "Next",
|
|
477
|
+
no: "No",
|
|
478
|
+
none: "None",
|
|
479
|
+
of: "of",
|
|
480
|
+
optional: "Optional",
|
|
481
|
+
pleaseWait: "Please wait...",
|
|
482
|
+
previous: "Previous",
|
|
483
|
+
remove: "Remove",
|
|
484
|
+
required: "Required",
|
|
485
|
+
reset: "Reset",
|
|
486
|
+
save: "Save",
|
|
487
|
+
search: "Search",
|
|
488
|
+
select: "Select",
|
|
489
|
+
selectOption: "Select an option",
|
|
490
|
+
show: "Show",
|
|
491
|
+
showMore: "Show more",
|
|
492
|
+
showLess: "Show less",
|
|
493
|
+
submit: "Submit",
|
|
494
|
+
success: "Success",
|
|
495
|
+
update: "Update",
|
|
496
|
+
unsavedChanges: "Unsaved Changes",
|
|
497
|
+
unsavedChangesSaveQuestion: "Do you want to save your changes?",
|
|
498
|
+
yes: "Yes"
|
|
499
|
+
},
|
|
500
|
+
de: {
|
|
501
|
+
all: "Alle",
|
|
502
|
+
back: "Zur\xFCck",
|
|
503
|
+
cancel: "Abbrechen",
|
|
504
|
+
change: "\xC4ndern",
|
|
505
|
+
clear: "L\xF6schen",
|
|
506
|
+
close: "Schlie\xDFen",
|
|
507
|
+
confirm: "Best\xE4tigen",
|
|
508
|
+
decline: "Ablehnen",
|
|
509
|
+
delete: "L\xF6schen",
|
|
510
|
+
discard: "Verwerfen",
|
|
511
|
+
discardChanges: "\xC4nderungen Verwerfen",
|
|
512
|
+
done: "Fertig",
|
|
513
|
+
edit: "Bearbeiten",
|
|
514
|
+
enterText: "Text hier eingeben",
|
|
515
|
+
error: "Fehler",
|
|
516
|
+
exit: "Beenden",
|
|
517
|
+
fieldRequiredError: "Dieses Feld ist erforderlich.",
|
|
518
|
+
invalidEmailError: "Bitte geben Sie eine g\xFCltige E-Mail-Adresse ein.",
|
|
519
|
+
less: "Weniger",
|
|
520
|
+
loading: "L\xE4dt",
|
|
521
|
+
maxLengthError: "Maximale L\xE4nge \xFCberschritten.",
|
|
522
|
+
minLengthError: "Mindestl\xE4nge nicht erreicht.",
|
|
523
|
+
more: "Mehr",
|
|
524
|
+
next: "Weiter",
|
|
525
|
+
no: "Nein",
|
|
526
|
+
none: "Nichts",
|
|
527
|
+
of: "von",
|
|
528
|
+
optional: "Optional",
|
|
529
|
+
pleaseWait: "Bitte warten...",
|
|
530
|
+
previous: "Vorherige",
|
|
531
|
+
remove: "Entfernen",
|
|
532
|
+
required: "Erforderlich",
|
|
533
|
+
reset: "Zur\xFCcksetzen",
|
|
534
|
+
save: "Speichern",
|
|
535
|
+
search: "Suche",
|
|
536
|
+
select: "Select",
|
|
537
|
+
selectOption: "Option ausw\xE4hlen",
|
|
538
|
+
show: "Anzeigen",
|
|
539
|
+
showMore: "Mehr anzeigen",
|
|
540
|
+
showLess: "Weniger anzeigen",
|
|
541
|
+
submit: "Abschicken",
|
|
542
|
+
success: "Erfolg",
|
|
543
|
+
update: "Update",
|
|
544
|
+
unsavedChanges: "Ungespeicherte \xC4nderungen",
|
|
545
|
+
unsavedChangesSaveQuestion: "M\xF6chtest du die \xC4nderungen speichern?",
|
|
546
|
+
yes: "Ja"
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
// src/components/layout-and-navigation/SearchableList.tsx
|
|
551
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
552
|
+
var defaultSearchableListTranslation = {
|
|
553
|
+
en: {
|
|
554
|
+
nothingFound: "Nothing found"
|
|
555
|
+
},
|
|
556
|
+
de: {
|
|
557
|
+
nothingFound: "Nichts gefunden"
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
var SearchableList = ({
|
|
561
|
+
overwriteTranslation,
|
|
562
|
+
list,
|
|
563
|
+
initialSearch = "",
|
|
564
|
+
searchMapping,
|
|
565
|
+
autoFocus,
|
|
566
|
+
minimumItemsForSearch = 6,
|
|
567
|
+
itemMapper,
|
|
568
|
+
className,
|
|
569
|
+
resultListClassName
|
|
570
|
+
}) => {
|
|
571
|
+
const translation = useTranslation([defaultSearchableListTranslation, formTranslation], overwriteTranslation);
|
|
572
|
+
const { result, hasResult, search, setSearch } = useSearch({ list, initialSearch, searchMapping });
|
|
573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("col gap-y-2", className), children: [
|
|
574
|
+
list.length > minimumItemsForSearch && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "row justify-between gap-x-4 items-center", children: [
|
|
575
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
576
|
+
Input,
|
|
577
|
+
{
|
|
578
|
+
value: search,
|
|
579
|
+
onChangeText: setSearch,
|
|
580
|
+
placeholder: translation("search"),
|
|
581
|
+
autoFocus,
|
|
582
|
+
className: "w-full"
|
|
583
|
+
}
|
|
584
|
+
),
|
|
585
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconButton, { color: "neutral", disabled: search.length === 0, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.Search, { className: "w-full h-full" }) })
|
|
586
|
+
] }),
|
|
587
|
+
hasResult ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_clsx4.default)("col gap-y-1", resultListClassName), children: result.map(itemMapper) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "row text-description py-2 px-2", children: translation("nothingFound") })
|
|
444
588
|
] });
|
|
445
589
|
};
|
|
446
590
|
|
|
447
|
-
// src/components/
|
|
591
|
+
// src/components/layout-and-navigation/Tile.tsx
|
|
592
|
+
var import_clsx5 = __toESM(require("clsx"));
|
|
593
|
+
var import_lucide_react2 = require("lucide-react");
|
|
448
594
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
595
|
+
var Tile = ({
|
|
596
|
+
title,
|
|
597
|
+
description,
|
|
598
|
+
onClick,
|
|
599
|
+
isSelected = false,
|
|
600
|
+
isDisabled = false,
|
|
601
|
+
prefix,
|
|
602
|
+
suffix,
|
|
603
|
+
normalClassName = "hover:bg-primary/40 cursor-pointer",
|
|
604
|
+
selectedClassName = " bg-primary/20",
|
|
605
|
+
disabledClassName = "text-disabled-text bg-disabled-background cursor-not-allowed",
|
|
606
|
+
className
|
|
607
|
+
}) => {
|
|
608
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
609
|
+
"div",
|
|
610
|
+
{
|
|
611
|
+
className: (0, import_clsx5.default)(
|
|
612
|
+
"row gap-x-2 w-full items-center",
|
|
613
|
+
{
|
|
614
|
+
[normalClassName]: !!onClick && !isDisabled,
|
|
615
|
+
[selectedClassName]: isSelected && !isDisabled,
|
|
616
|
+
[disabledClassName]: isDisabled
|
|
617
|
+
},
|
|
618
|
+
className
|
|
619
|
+
),
|
|
620
|
+
onClick: isDisabled ? void 0 : onClick,
|
|
621
|
+
children: [
|
|
622
|
+
prefix ?? (isSelected ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Check, { size: 24 }) : void 0),
|
|
623
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "col gap-y-0 w-full", children: [
|
|
624
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h4", { className: (0, import_clsx5.default)(title.className ?? "textstyle-title-normal"), children: title.value }),
|
|
625
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: (0, import_clsx5.default)(description.className ?? "textstyle-description"), children: description.value })
|
|
626
|
+
] }),
|
|
627
|
+
suffix
|
|
628
|
+
]
|
|
629
|
+
}
|
|
630
|
+
);
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
// src/components/layout-and-navigation/Chip.tsx
|
|
634
|
+
var import_clsx6 = __toESM(require("clsx"));
|
|
635
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
636
|
+
var Chip = ({
|
|
637
|
+
children,
|
|
638
|
+
trailingIcon,
|
|
639
|
+
color = "default",
|
|
640
|
+
variant = "normal",
|
|
641
|
+
className = "",
|
|
642
|
+
...restProps
|
|
643
|
+
}) => {
|
|
644
|
+
const colorMapping = {
|
|
645
|
+
default: "text-tag-default-text bg-tag-default-background",
|
|
646
|
+
dark: "text-tag-dark-text bg-tag-dark-background",
|
|
647
|
+
red: "text-tag-red-text bg-tag-red-background",
|
|
648
|
+
yellow: "text-tag-yellow-text bg-tag-yellow-background",
|
|
649
|
+
green: "text-tag-green-text bg-tag-green-background",
|
|
650
|
+
blue: "text-tag-blue-text bg-tag-blue-background",
|
|
651
|
+
pink: "text-tag-pink-text bg-tag-pink-background"
|
|
652
|
+
}[color];
|
|
653
|
+
const colorMappingIcon = {
|
|
654
|
+
default: "text-tag-default-icon",
|
|
655
|
+
dark: "text-tag-dark-icon",
|
|
656
|
+
red: "text-tag-red-icon",
|
|
657
|
+
yellow: "text-tag-yellow-icon",
|
|
658
|
+
green: "text-tag-green-icon",
|
|
659
|
+
blue: "text-tag-blue-icon",
|
|
660
|
+
pink: "text-tag-pink-icon"
|
|
661
|
+
}[color];
|
|
662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
663
|
+
"div",
|
|
664
|
+
{
|
|
665
|
+
...restProps,
|
|
666
|
+
className: (0, import_clsx6.default)(
|
|
667
|
+
`row w-fit px-2 py-1`,
|
|
668
|
+
colorMapping,
|
|
669
|
+
{
|
|
670
|
+
"rounded-md": variant === "normal",
|
|
671
|
+
"rounded-full": variant === "fullyRounded"
|
|
672
|
+
},
|
|
673
|
+
className
|
|
674
|
+
),
|
|
675
|
+
children: [
|
|
676
|
+
children,
|
|
677
|
+
trailingIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: colorMappingIcon, children: trailingIcon })
|
|
678
|
+
]
|
|
679
|
+
}
|
|
680
|
+
);
|
|
681
|
+
};
|
|
682
|
+
var ChipList = ({
|
|
683
|
+
list,
|
|
684
|
+
className = ""
|
|
685
|
+
}) => {
|
|
686
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_clsx6.default)("flex flex-wrap gap-x-4 gap-y-2", className), children: list.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
687
|
+
Chip,
|
|
688
|
+
{
|
|
689
|
+
...value,
|
|
690
|
+
color: value.color ?? "dark",
|
|
691
|
+
variant: value.variant ?? "normal",
|
|
692
|
+
children: value.children
|
|
693
|
+
},
|
|
694
|
+
index
|
|
695
|
+
)) });
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
// src/hooks/useOutsideClick.ts
|
|
699
|
+
var import_react6 = require("react");
|
|
700
|
+
var useOutsideClick = (refs, handler) => {
|
|
701
|
+
(0, import_react6.useEffect)(() => {
|
|
702
|
+
const listener = (event) => {
|
|
703
|
+
if (event.target === null) return;
|
|
704
|
+
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
handler();
|
|
708
|
+
};
|
|
709
|
+
document.addEventListener("mousedown", listener);
|
|
710
|
+
document.addEventListener("touchstart", listener);
|
|
711
|
+
return () => {
|
|
712
|
+
document.removeEventListener("mousedown", listener);
|
|
713
|
+
document.removeEventListener("touchstart", listener);
|
|
714
|
+
};
|
|
715
|
+
}, [refs, handler]);
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
// src/components/user-action/MultiSelect.tsx
|
|
719
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
449
720
|
var defaultMultiSelectTranslation = {
|
|
450
721
|
en: {
|
|
451
|
-
|
|
452
|
-
search: "Search",
|
|
453
|
-
selected: "selected"
|
|
722
|
+
selected: `{{amount}} selected`
|
|
454
723
|
},
|
|
455
724
|
de: {
|
|
456
|
-
|
|
457
|
-
search: "Suche",
|
|
458
|
-
selected: "ausgew\xE4hlt"
|
|
725
|
+
selected: `{{amount}} ausgew\xE4hlt`
|
|
459
726
|
}
|
|
460
727
|
};
|
|
461
728
|
var MultiSelect = ({
|
|
462
729
|
overwriteTranslation,
|
|
463
730
|
options,
|
|
464
|
-
onChange,
|
|
465
|
-
search,
|
|
466
|
-
disabled = false,
|
|
467
|
-
selectedDisplay,
|
|
468
731
|
label,
|
|
732
|
+
onChange,
|
|
469
733
|
hintText,
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
734
|
+
isDisabled = false,
|
|
735
|
+
isSearchEnabled = false,
|
|
736
|
+
selectedDisplayOverwrite,
|
|
737
|
+
useChipDisplay = false,
|
|
738
|
+
className = ""
|
|
473
739
|
}) => {
|
|
474
|
-
const translation = useTranslation(defaultMultiSelectTranslation, overwriteTranslation);
|
|
475
|
-
const
|
|
476
|
-
|
|
477
|
-
const
|
|
478
|
-
|
|
479
|
-
filteredOptions = MultiSearchWithMapping(
|
|
480
|
-
searchText,
|
|
481
|
-
filteredOptions,
|
|
482
|
-
(value) => search.searchMapping(value)
|
|
483
|
-
);
|
|
484
|
-
}
|
|
485
|
-
if (!showDisabledOptions) {
|
|
486
|
-
filteredOptions = filteredOptions.filter((value) => !value.disabled);
|
|
487
|
-
}
|
|
740
|
+
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
741
|
+
const triggerRef = (0, import_react7.useRef)(null);
|
|
742
|
+
const menuRef = (0, import_react7.useRef)(null);
|
|
743
|
+
const [isOpen, setIsOpen] = (0, import_react7.useState)(false);
|
|
744
|
+
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
488
745
|
const selectedItems = options.filter((value) => value.selected);
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
746
|
+
const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
|
|
747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: (0, import_clsx7.default)(className), children: [
|
|
748
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
493
749
|
Label,
|
|
494
750
|
{
|
|
495
751
|
...label,
|
|
496
752
|
htmlFor: label.name,
|
|
497
|
-
className: (0,
|
|
753
|
+
className: (0, import_clsx7.default)(" mb-1", label.className),
|
|
498
754
|
labelType: label.labelType ?? "labelBig"
|
|
499
755
|
}
|
|
500
756
|
),
|
|
501
|
-
/* @__PURE__ */ (0,
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
ref,
|
|
509
|
-
onClick: disabled ? void 0 : onClick,
|
|
510
|
-
className: (0, import_clsx5.default)(
|
|
511
|
-
borderColor,
|
|
512
|
-
"bg-menu-background text-menu-text inline-w-full justify-between items-center rounded-lg border-2 px-4 py-2 font-medium",
|
|
513
|
-
{
|
|
514
|
-
"hover:border-primary cursor-pointer": !disabled,
|
|
515
|
-
"bg-disabled-background text-disabled cursor-not-allowed": disabled
|
|
516
|
-
},
|
|
517
|
-
triggerClassName
|
|
518
|
-
),
|
|
519
|
-
children: selectedDisplay ? selectedDisplay({ items: options, disabled }) : menuButtonText
|
|
520
|
-
}
|
|
521
|
-
),
|
|
522
|
-
menuClassName: (0, import_clsx5.default)(
|
|
523
|
-
"!rounded-lg !shadow-lg !max-h-[500px] !min-w-[400px] !max-w-[70vh] !overflow-y-auto !border !border-2",
|
|
524
|
-
borderColor,
|
|
525
|
-
{ "!py-0": !enableSearch, "!pb-0": enableSearch }
|
|
526
|
-
),
|
|
527
|
-
children: [
|
|
528
|
-
enableSearch && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "row gap-x-2 items-center px-2 py-2", children: [
|
|
529
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Input, { autoFocus: true, className: "w-full", value: searchText, onChangeText: setSearchText }),
|
|
530
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Search, {})
|
|
531
|
-
] }, "selectSearch"),
|
|
532
|
-
filteredOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
533
|
-
MenuItem,
|
|
757
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative", children: [
|
|
758
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
759
|
+
"button",
|
|
760
|
+
{
|
|
761
|
+
ref: triggerRef,
|
|
762
|
+
className: (0, import_clsx7.default)(
|
|
763
|
+
"btn-md justify-between w-full border-2 h-auto",
|
|
534
764
|
{
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
765
|
+
"rounded-b-lg": !open,
|
|
766
|
+
"bg-menu-background border-menu-border hover:border-primary": !isDisabled,
|
|
767
|
+
"bg-disabled-background text-disabled-text border-disabled-background cursor-not-allowed": isDisabled
|
|
768
|
+
}
|
|
769
|
+
),
|
|
770
|
+
onClick: () => setIsOpen(!isOpen),
|
|
771
|
+
disabled: isDisabled,
|
|
772
|
+
children: [
|
|
773
|
+
!isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? (useChipDisplay && selectedItems ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) : translation("selected", { replacements: { amount: selectedItems.length.toString() } })) }),
|
|
774
|
+
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "textstyle-description", children: hintText ?? translation("select") }),
|
|
775
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ChevronUp, { size: 24, className: "min-w-6" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react3.ChevronDown, { className: "min-w-6" })
|
|
776
|
+
]
|
|
777
|
+
}
|
|
778
|
+
),
|
|
779
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
780
|
+
"div",
|
|
781
|
+
{
|
|
782
|
+
ref: menuRef,
|
|
783
|
+
className: "absolute w-full z-10 rounded-lg mt-0.5 bg-menu-background text-menu-text shadow-around-md max-h-[500px] overflow-y-auto p-2",
|
|
784
|
+
children: [
|
|
785
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
786
|
+
SearchableList,
|
|
787
|
+
{
|
|
788
|
+
list: options,
|
|
789
|
+
minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
|
|
790
|
+
searchMapping: (item) => item.searchTags,
|
|
791
|
+
itemMapper: (option, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
792
|
+
Tile,
|
|
793
|
+
{
|
|
794
|
+
isSelected: option.selected,
|
|
795
|
+
className: "px-2 py-1 rounded-md",
|
|
796
|
+
disabledClassName: "text-disabled-text cursor-not-allowed",
|
|
797
|
+
title: { value: option.label, className: "font-semibold" },
|
|
798
|
+
onClick: () => {
|
|
545
799
|
onChange(options.map((value) => value.value === option.value ? {
|
|
546
800
|
...option,
|
|
547
801
|
selected: !value.selected
|
|
548
802
|
} : value));
|
|
549
|
-
}
|
|
803
|
+
},
|
|
804
|
+
isDisabled: option.disabled
|
|
550
805
|
},
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
)
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
806
|
+
index
|
|
807
|
+
)
|
|
808
|
+
}
|
|
809
|
+
),
|
|
810
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "row justify-between mt-2", children: [
|
|
811
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "row gap-x-2", children: [
|
|
812
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
813
|
+
SolidButton,
|
|
814
|
+
{
|
|
815
|
+
color: "neutral",
|
|
816
|
+
size: "small",
|
|
817
|
+
onClick: () => {
|
|
818
|
+
onChange(options.map((option) => ({
|
|
819
|
+
...option,
|
|
820
|
+
selected: !option.disabled
|
|
821
|
+
})));
|
|
822
|
+
},
|
|
823
|
+
disabled: options.every((value) => value.selected || value.disabled),
|
|
824
|
+
children: translation("all")
|
|
825
|
+
}
|
|
826
|
+
),
|
|
827
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
828
|
+
SolidButton,
|
|
829
|
+
{
|
|
830
|
+
color: "neutral",
|
|
831
|
+
size: "small",
|
|
832
|
+
onClick: () => {
|
|
833
|
+
onChange(options.map((option) => ({
|
|
834
|
+
...option,
|
|
835
|
+
selected: false
|
|
836
|
+
})));
|
|
837
|
+
},
|
|
838
|
+
children: translation("none")
|
|
839
|
+
}
|
|
840
|
+
)
|
|
841
|
+
] }),
|
|
842
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(SolidButton, { size: "small", onClick: () => setIsOpen(false), children: "Done" })
|
|
843
|
+
] })
|
|
844
|
+
]
|
|
845
|
+
}
|
|
846
|
+
)
|
|
847
|
+
] })
|
|
563
848
|
] });
|
|
564
849
|
};
|
|
850
|
+
var MultiSelectUncontrolled = ({
|
|
851
|
+
options,
|
|
852
|
+
onChange,
|
|
853
|
+
...props
|
|
854
|
+
}) => {
|
|
855
|
+
const [usedOptions, setUsedOptions] = (0, import_react7.useState)(options);
|
|
856
|
+
(0, import_react7.useEffect)(() => {
|
|
857
|
+
setUsedOptions(options);
|
|
858
|
+
}, [options]);
|
|
859
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
860
|
+
MultiSelect,
|
|
861
|
+
{
|
|
862
|
+
...props,
|
|
863
|
+
options: usedOptions,
|
|
864
|
+
onChange: (options2) => {
|
|
865
|
+
setUsedOptions(options2);
|
|
866
|
+
onChange(options2);
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
);
|
|
870
|
+
};
|
|
565
871
|
// Annotate the CommonJS export names for ESM import in node:
|
|
566
872
|
0 && (module.exports = {
|
|
567
|
-
MultiSelect
|
|
873
|
+
MultiSelect,
|
|
874
|
+
MultiSelectUncontrolled
|
|
568
875
|
});
|
|
569
876
|
//# sourceMappingURL=MultiSelect.js.map
|