@helpwave/hightide 0.1.11 → 0.1.13
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 +37 -7
- package/dist/components/date/DatePicker.js.map +1 -1
- package/dist/components/date/DatePicker.mjs +37 -7
- 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/TimePicker.js +27 -6
- package/dist/components/date/TimePicker.js.map +1 -1
- package/dist/components/date/TimePicker.mjs +27 -6
- package/dist/components/date/TimePicker.mjs.map +1 -1
- package/dist/components/date/YearMonthPicker.js +36 -6
- package/dist/components/date/YearMonthPicker.js.map +1 -1
- package/dist/components/date/YearMonthPicker.mjs +36 -6
- package/dist/components/date/YearMonthPicker.mjs.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.js +16 -2
- package/dist/components/dialogs/ConfirmDialog.js.map +1 -1
- package/dist/components/dialogs/ConfirmDialog.mjs +16 -2
- package/dist/components/dialogs/ConfirmDialog.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.js +42 -9
- package/dist/components/layout-and-navigation/Carousel.js.map +1 -1
- package/dist/components/layout-and-navigation/Carousel.mjs +42 -9
- package/dist/components/layout-and-navigation/Carousel.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.js +1 -1
- package/dist/components/layout-and-navigation/Expandable.js.map +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs +1 -1
- package/dist/components/layout-and-navigation/Expandable.mjs.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js +1 -1
- package/dist/components/layout-and-navigation/FAQSection.js.map +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs +1 -1
- package/dist/components/layout-and-navigation/FAQSection.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.js +16 -2
- package/dist/components/layout-and-navigation/Overlay.js.map +1 -1
- package/dist/components/layout-and-navigation/Overlay.mjs +16 -2
- package/dist/components/layout-and-navigation/Overlay.mjs.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.d.mts +6 -3
- package/dist/components/layout-and-navigation/Pagination.d.ts +6 -3
- package/dist/components/layout-and-navigation/Pagination.js +404 -19
- package/dist/components/layout-and-navigation/Pagination.js.map +1 -1
- package/dist/components/layout-and-navigation/Pagination.mjs +404 -19
- package/dist/components/layout-and-navigation/Pagination.mjs.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.js +187 -67
- package/dist/components/layout-and-navigation/SearchableList.js.map +1 -1
- package/dist/components/layout-and-navigation/SearchableList.mjs +183 -63
- package/dist/components/layout-and-navigation/SearchableList.mjs.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.js +37 -5
- package/dist/components/layout-and-navigation/StepperBar.js.map +1 -1
- package/dist/components/layout-and-navigation/StepperBar.mjs +37 -5
- package/dist/components/layout-and-navigation/StepperBar.mjs.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.js +2 -0
- package/dist/components/layout-and-navigation/TextImage.js.map +1 -1
- package/dist/components/layout-and-navigation/TextImage.mjs +2 -0
- package/dist/components/layout-and-navigation/TextImage.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.js +2 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.js.map +1 -1
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs +2 -0
- package/dist/components/loading-states/LoadingAndErrorComponent.mjs.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.js +2 -0
- package/dist/components/loading-states/LoadingAnimation.js.map +1 -1
- package/dist/components/loading-states/LoadingAnimation.mjs +2 -0
- package/dist/components/loading-states/LoadingAnimation.mjs.map +1 -1
- package/dist/components/loading-states/LoadingButton.js +9 -0
- package/dist/components/loading-states/LoadingButton.js.map +1 -1
- package/dist/components/loading-states/LoadingButton.mjs +9 -0
- package/dist/components/loading-states/LoadingButton.mjs.map +1 -1
- package/dist/components/modals/ConfirmModal.js +16 -2
- package/dist/components/modals/ConfirmModal.js.map +1 -1
- package/dist/components/modals/ConfirmModal.mjs +16 -2
- package/dist/components/modals/ConfirmModal.mjs.map +1 -1
- package/dist/components/modals/DiscardChangesModal.js +16 -2
- package/dist/components/modals/DiscardChangesModal.js.map +1 -1
- package/dist/components/modals/DiscardChangesModal.mjs +16 -2
- 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 +196 -76
- package/dist/components/modals/InputModal.js.map +1 -1
- package/dist/components/modals/InputModal.mjs +189 -69
- package/dist/components/modals/InputModal.mjs.map +1 -1
- package/dist/components/modals/LanguageModal.js +203 -83
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +192 -72
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +206 -86
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +193 -73
- package/dist/components/modals/ThemeModal.mjs.map +1 -1
- package/dist/components/properties/CheckboxProperty.js +17 -5
- package/dist/components/properties/CheckboxProperty.js.map +1 -1
- package/dist/components/properties/CheckboxProperty.mjs +17 -5
- package/dist/components/properties/CheckboxProperty.mjs.map +1 -1
- package/dist/components/properties/DateProperty.js +182 -65
- package/dist/components/properties/DateProperty.js.map +1 -1
- package/dist/components/properties/DateProperty.mjs +179 -62
- package/dist/components/properties/DateProperty.mjs.map +1 -1
- package/dist/components/properties/MultiSelectProperty.js +194 -74
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +187 -67
- package/dist/components/properties/MultiSelectProperty.mjs.map +1 -1
- package/dist/components/properties/NumberProperty.js +182 -65
- package/dist/components/properties/NumberProperty.js.map +1 -1
- package/dist/components/properties/NumberProperty.mjs +179 -62
- package/dist/components/properties/NumberProperty.mjs.map +1 -1
- package/dist/components/properties/PropertyBase.js +12 -1
- package/dist/components/properties/PropertyBase.js.map +1 -1
- package/dist/components/properties/PropertyBase.mjs +12 -1
- package/dist/components/properties/PropertyBase.mjs.map +1 -1
- package/dist/components/properties/SelectProperty.js +194 -74
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +187 -67
- package/dist/components/properties/SelectProperty.mjs.map +1 -1
- package/dist/components/properties/TextProperty.js +43 -34
- package/dist/components/properties/TextProperty.js.map +1 -1
- package/dist/components/properties/TextProperty.mjs +43 -34
- package/dist/components/properties/TextProperty.mjs.map +1 -1
- package/dist/components/table/FillerRowElement.d.mts +8 -0
- package/dist/components/table/FillerRowElement.d.ts +8 -0
- package/dist/components/table/FillerRowElement.js +36 -0
- package/dist/components/table/FillerRowElement.js.map +1 -0
- package/dist/components/table/FillerRowElement.mjs +12 -0
- package/dist/components/table/FillerRowElement.mjs.map +1 -0
- package/dist/components/table/Filter.d.mts +5 -0
- package/dist/components/table/Filter.d.ts +5 -0
- package/dist/components/table/Filter.js +41 -0
- package/dist/components/table/Filter.js.map +1 -0
- package/dist/components/table/Filter.mjs +17 -0
- package/dist/components/table/Filter.mjs.map +1 -0
- package/dist/components/table/Table.d.mts +41 -0
- package/dist/components/table/Table.d.ts +41 -0
- package/dist/components/table/Table.js +1549 -0
- package/dist/components/table/Table.js.map +1 -0
- package/dist/components/table/Table.mjs +1520 -0
- package/dist/components/table/Table.mjs.map +1 -0
- package/dist/components/table/TableCell.d.mts +9 -0
- package/dist/components/table/TableCell.d.ts +9 -0
- package/dist/components/table/TableCell.js +37 -0
- package/dist/components/table/TableCell.js.map +1 -0
- package/dist/components/table/TableCell.mjs +13 -0
- package/dist/components/table/TableCell.mjs.map +1 -0
- package/dist/components/table/TableFilterButton.d.mts +11 -0
- package/dist/components/table/TableFilterButton.d.ts +11 -0
- package/dist/components/table/TableFilterButton.js +888 -0
- package/dist/components/table/TableFilterButton.js.map +1 -0
- package/dist/components/table/TableFilterButton.mjs +852 -0
- package/dist/components/table/TableFilterButton.mjs.map +1 -0
- package/dist/components/table/TableSortButton.d.mts +15 -0
- package/dist/components/table/TableSortButton.d.ts +15 -0
- package/dist/components/table/TableSortButton.js +136 -0
- package/dist/components/table/TableSortButton.js.map +1 -0
- package/dist/components/table/TableSortButton.mjs +102 -0
- package/dist/components/table/TableSortButton.mjs.map +1 -0
- package/dist/components/user-action/Button.d.mts +20 -5
- package/dist/components/user-action/Button.d.ts +20 -5
- package/dist/components/user-action/Button.js +12 -3
- package/dist/components/user-action/Button.js.map +1 -1
- package/dist/components/user-action/Button.mjs +11 -3
- package/dist/components/user-action/Button.mjs.map +1 -1
- package/dist/components/user-action/Checkbox.js +5 -4
- package/dist/components/user-action/Checkbox.js.map +1 -1
- package/dist/components/user-action/Checkbox.mjs +5 -4
- package/dist/components/user-action/Checkbox.mjs.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.js +41 -9
- package/dist/components/user-action/DateAndTimePicker.js.map +1 -1
- package/dist/components/user-action/DateAndTimePicker.mjs +41 -9
- package/dist/components/user-action/DateAndTimePicker.mjs.map +1 -1
- package/dist/components/user-action/Input.d.mts +27 -7
- package/dist/components/user-action/Input.d.ts +27 -7
- package/dist/components/user-action/Input.js +173 -64
- package/dist/components/user-action/Input.js.map +1 -1
- package/dist/components/user-action/Input.mjs +172 -63
- package/dist/components/user-action/Input.mjs.map +1 -1
- package/dist/components/user-action/MultiSelect.js +195 -75
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +187 -67
- package/dist/components/user-action/MultiSelect.mjs.map +1 -1
- package/dist/components/user-action/ScrollPicker.js +26 -5
- package/dist/components/user-action/ScrollPicker.js.map +1 -1
- package/dist/components/user-action/ScrollPicker.mjs +26 -5
- package/dist/components/user-action/ScrollPicker.mjs.map +1 -1
- package/dist/components/user-action/Select.js +195 -75
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +187 -67
- package/dist/components/user-action/Select.mjs.map +1 -1
- package/dist/components/user-action/Textarea.d.mts +3 -1
- package/dist/components/user-action/Textarea.d.ts +3 -1
- package/dist/components/user-action/Textarea.js +31 -33
- package/dist/components/user-action/Textarea.js.map +1 -1
- package/dist/components/user-action/Textarea.mjs +31 -33
- package/dist/components/user-action/Textarea.mjs.map +1 -1
- package/dist/components/user-action/ToggleableInput.d.mts +3 -1
- package/dist/components/user-action/ToggleableInput.d.ts +3 -1
- package/dist/components/user-action/ToggleableInput.js +31 -33
- package/dist/components/user-action/ToggleableInput.js.map +1 -1
- package/dist/components/user-action/ToggleableInput.mjs +31 -33
- package/dist/components/user-action/ToggleableInput.mjs.map +1 -1
- package/dist/css/globals.css +431 -186
- package/dist/css/uncompiled/globals.css +36 -493
- package/dist/css/uncompiled/textstyles.css +69 -0
- package/dist/css/uncompiled/theme/colors-basic.css +72 -0
- package/dist/css/uncompiled/theme/colors-component.css +143 -0
- package/dist/css/uncompiled/theme/colors-semantic.css +99 -0
- package/dist/css/uncompiled/theme/index.css +5 -0
- package/dist/css/uncompiled/theme/theme.css +0 -0
- package/dist/css/uncompiled/theme/variants.css +3 -0
- package/dist/css/uncompiled/utitlity/animation.css +111 -0
- package/dist/css/uncompiled/utitlity/borderradius.css +23 -0
- package/dist/css/uncompiled/utitlity/general.css +11 -0
- package/dist/css/uncompiled/utitlity/index.css +4 -0
- package/dist/css/uncompiled/utitlity/shadow.css +29 -0
- package/dist/hooks/useDelay.d.mts +11 -0
- package/dist/hooks/useDelay.d.ts +11 -0
- package/dist/hooks/useDelay.js +64 -0
- package/dist/hooks/useDelay.js.map +1 -0
- package/dist/hooks/useDelay.mjs +40 -0
- package/dist/hooks/useDelay.mjs.map +1 -0
- package/dist/hooks/useFocusManagement.d.mts +9 -0
- package/dist/hooks/useFocusManagement.d.ts +9 -0
- package/dist/hooks/useFocusManagement.js +84 -0
- package/dist/hooks/useFocusManagement.js.map +1 -0
- package/dist/hooks/useFocusManagement.mjs +60 -0
- package/dist/hooks/useFocusManagement.mjs.map +1 -0
- package/dist/hooks/useFocusOnceVisible.d.mts +5 -0
- package/dist/hooks/useFocusOnceVisible.d.ts +5 -0
- package/dist/hooks/useFocusOnceVisible.js +60 -0
- package/dist/hooks/useFocusOnceVisible.js.map +1 -0
- package/dist/hooks/useFocusOnceVisible.mjs +26 -0
- package/dist/hooks/useFocusOnceVisible.mjs.map +1 -0
- package/dist/hooks/useRerender.d.mts +5 -0
- package/dist/hooks/useRerender.d.ts +5 -0
- package/dist/hooks/useRerender.js +33 -0
- package/dist/hooks/useRerender.js.map +1 -0
- package/dist/hooks/useRerender.mjs +9 -0
- package/dist/hooks/useRerender.mjs.map +1 -0
- package/dist/hooks/useResizeCallbackWrapper.d.mts +11 -0
- package/dist/hooks/useResizeCallbackWrapper.d.ts +11 -0
- package/dist/hooks/useResizeCallbackWrapper.js +38 -0
- package/dist/hooks/useResizeCallbackWrapper.js.map +1 -0
- package/dist/hooks/useResizeCallbackWrapper.mjs +14 -0
- package/dist/hooks/useResizeCallbackWrapper.mjs.map +1 -0
- package/dist/index.d.mts +16 -5
- package/dist/index.d.ts +16 -5
- package/dist/index.js +1428 -860
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1370 -799
- package/dist/index.mjs.map +1 -1
- package/dist/localization/defaults/form.d.mts +1 -0
- package/dist/localization/defaults/form.d.ts +1 -0
- package/dist/localization/defaults/form.js +2 -0
- package/dist/localization/defaults/form.js.map +1 -1
- package/dist/localization/defaults/form.mjs +2 -0
- package/dist/localization/defaults/form.mjs.map +1 -1
- package/dist/util/array.d.mts +11 -5
- package/dist/util/array.d.ts +11 -5
- package/dist/util/array.js +25 -4
- package/dist/util/array.js.map +1 -1
- package/dist/util/array.mjs +25 -4
- package/dist/util/array.mjs.map +1 -1
- package/dist/util/date.js.map +1 -1
- package/dist/util/date.mjs.map +1 -1
- package/dist/util/resolveSetState.d.mts +5 -0
- package/dist/util/resolveSetState.d.ts +5 -0
- package/dist/util/resolveSetState.js +32 -0
- package/dist/util/resolveSetState.js.map +1 -0
- package/dist/util/resolveSetState.mjs +8 -0
- package/dist/util/resolveSetState.mjs.map +1 -0
- package/package.json +4 -2
- package/dist/components/layout-and-navigation/Table.d.mts +0 -99
- package/dist/components/layout-and-navigation/Table.d.ts +0 -99
- package/dist/components/layout-and-navigation/Table.js +0 -688
- package/dist/components/layout-and-navigation/Table.js.map +0 -1
- package/dist/components/layout-and-navigation/Table.mjs +0 -645
- package/dist/components/layout-and-navigation/Table.mjs.map +0 -1
- package/dist/hooks/useSaveDelay.d.mts +0 -6
- package/dist/hooks/useSaveDelay.d.ts +0 -6
- package/dist/hooks/useSaveDelay.js +0 -67
- package/dist/hooks/useSaveDelay.js.map +0 -1
- package/dist/hooks/useSaveDelay.mjs +0 -43
- package/dist/hooks/useSaveDelay.mjs.map +0 -1
|
@@ -123,7 +123,7 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
// src/components/user-action/MultiSelect.tsx
|
|
126
|
-
var
|
|
126
|
+
var import_react9 = require("react");
|
|
127
127
|
var import_lucide_react3 = require("lucide-react");
|
|
128
128
|
var import_clsx7 = __toESM(require("clsx"));
|
|
129
129
|
|
|
@@ -150,55 +150,147 @@ var import_lucide_react = require("lucide-react");
|
|
|
150
150
|
var import_clsx4 = __toESM(require("clsx"));
|
|
151
151
|
|
|
152
152
|
// src/components/user-action/Input.tsx
|
|
153
|
-
var
|
|
153
|
+
var import_react6 = require("react");
|
|
154
154
|
var import_clsx2 = __toESM(require("clsx"));
|
|
155
155
|
|
|
156
|
-
// src/hooks/
|
|
156
|
+
// src/hooks/useDelay.ts
|
|
157
157
|
var import_react3 = require("react");
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
setNotificationTimer(setTimeout(() => {
|
|
168
|
-
setNotificationStatus(false);
|
|
169
|
-
clearTimeout(notificationTimer);
|
|
170
|
-
}, delay));
|
|
171
|
-
clearTimeout(updateTimer);
|
|
172
|
-
}, delay));
|
|
158
|
+
var defaultOptions = {
|
|
159
|
+
delay: 3e3,
|
|
160
|
+
disabled: false
|
|
161
|
+
};
|
|
162
|
+
function useDelay(options) {
|
|
163
|
+
const [timer, setTimer] = (0, import_react3.useState)(void 0);
|
|
164
|
+
const { delay, disabled } = {
|
|
165
|
+
...defaultOptions,
|
|
166
|
+
...options
|
|
173
167
|
};
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
setNotificationStatus(true);
|
|
178
|
-
clearTimeout(notificationTimer);
|
|
179
|
-
setNotificationTimer(setTimeout(() => {
|
|
180
|
-
setNotificationStatus(false);
|
|
181
|
-
clearTimeout(notificationTimer);
|
|
182
|
-
}, delay));
|
|
183
|
-
} else {
|
|
184
|
-
setNotificationStatus(false);
|
|
168
|
+
const restartTimer = (onDelayFinish) => {
|
|
169
|
+
if (disabled) {
|
|
170
|
+
return;
|
|
185
171
|
}
|
|
172
|
+
clearTimeout(timer);
|
|
173
|
+
setTimer(setTimeout(() => {
|
|
174
|
+
onDelayFinish();
|
|
175
|
+
}, delay));
|
|
176
|
+
};
|
|
177
|
+
const clearTimer = () => {
|
|
178
|
+
clearTimeout(timer);
|
|
186
179
|
};
|
|
187
180
|
(0, import_react3.useEffect)(() => {
|
|
188
181
|
return () => {
|
|
189
|
-
clearTimeout(
|
|
190
|
-
clearTimeout(notificationTimer);
|
|
182
|
+
clearTimeout(timer);
|
|
191
183
|
};
|
|
192
|
-
}, []);
|
|
193
|
-
|
|
184
|
+
}, [timer]);
|
|
185
|
+
(0, import_react3.useEffect)(() => {
|
|
186
|
+
if (disabled) {
|
|
187
|
+
clearTimeout(timer);
|
|
188
|
+
}
|
|
189
|
+
}, [disabled, timer]);
|
|
190
|
+
return { restartTimer, clearTimer };
|
|
194
191
|
}
|
|
195
192
|
|
|
196
193
|
// src/util/noop.ts
|
|
197
194
|
var noop = () => void 0;
|
|
198
195
|
|
|
196
|
+
// src/hooks/useFocusManagement.ts
|
|
197
|
+
var import_react4 = require("react");
|
|
198
|
+
function useFocusManagement() {
|
|
199
|
+
const getFocusableElements = (0, import_react4.useCallback)(() => {
|
|
200
|
+
return Array.from(
|
|
201
|
+
document.querySelectorAll(
|
|
202
|
+
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
203
|
+
)
|
|
204
|
+
).filter(
|
|
205
|
+
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
206
|
+
);
|
|
207
|
+
}, []);
|
|
208
|
+
const getNextFocusElement = (0, import_react4.useCallback)(() => {
|
|
209
|
+
const elements = getFocusableElements();
|
|
210
|
+
if (elements.length === 0) {
|
|
211
|
+
return void 0;
|
|
212
|
+
}
|
|
213
|
+
let nextElement = elements[0];
|
|
214
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
215
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
216
|
+
nextElement = elements[(currentIndex + 1) % elements.length];
|
|
217
|
+
}
|
|
218
|
+
return nextElement;
|
|
219
|
+
}, [getFocusableElements]);
|
|
220
|
+
const focusNext = (0, import_react4.useCallback)(() => {
|
|
221
|
+
const nextElement = getNextFocusElement();
|
|
222
|
+
nextElement?.focus();
|
|
223
|
+
}, [getNextFocusElement]);
|
|
224
|
+
const getPreviousFocusElement = (0, import_react4.useCallback)(() => {
|
|
225
|
+
const elements = getFocusableElements();
|
|
226
|
+
if (elements.length === 0) {
|
|
227
|
+
return void 0;
|
|
228
|
+
}
|
|
229
|
+
let previousElement = elements[0];
|
|
230
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
231
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
232
|
+
if (currentIndex === 0) {
|
|
233
|
+
previousElement = elements[elements.length - 1];
|
|
234
|
+
} else {
|
|
235
|
+
previousElement = elements[currentIndex - 1];
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return previousElement;
|
|
239
|
+
}, [getFocusableElements]);
|
|
240
|
+
const focusPrevious = (0, import_react4.useCallback)(() => {
|
|
241
|
+
const previousElement = getPreviousFocusElement();
|
|
242
|
+
if (previousElement) previousElement.focus();
|
|
243
|
+
}, [getPreviousFocusElement]);
|
|
244
|
+
return {
|
|
245
|
+
getFocusableElements,
|
|
246
|
+
getNextFocusElement,
|
|
247
|
+
getPreviousFocusElement,
|
|
248
|
+
focusNext,
|
|
249
|
+
focusPrevious
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// src/hooks/useFocusOnceVisible.ts
|
|
254
|
+
var import_react5 = __toESM(require("react"));
|
|
255
|
+
var useFocusOnceVisible = (ref, disable = false) => {
|
|
256
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react5.default.useState(false);
|
|
257
|
+
(0, import_react5.useEffect)(() => {
|
|
258
|
+
if (disable || hasUsedFocus) {
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
262
|
+
if (entry.isIntersecting && !hasUsedFocus) {
|
|
263
|
+
ref.current?.focus();
|
|
264
|
+
setHasUsedFocus(hasUsedFocus);
|
|
265
|
+
}
|
|
266
|
+
}, {
|
|
267
|
+
threshold: 0.1
|
|
268
|
+
});
|
|
269
|
+
if (ref.current) {
|
|
270
|
+
observer.observe(ref.current);
|
|
271
|
+
}
|
|
272
|
+
return () => observer.disconnect();
|
|
273
|
+
}, [disable, hasUsedFocus, ref]);
|
|
274
|
+
};
|
|
275
|
+
|
|
199
276
|
// src/components/user-action/Input.tsx
|
|
200
277
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
201
|
-
var
|
|
278
|
+
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
279
|
+
return (0, import_clsx2.default)(
|
|
280
|
+
"px-2 py-1.5 rounded-md border-2",
|
|
281
|
+
{
|
|
282
|
+
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
283
|
+
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
284
|
+
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
285
|
+
}
|
|
286
|
+
);
|
|
287
|
+
};
|
|
288
|
+
var defaultEditCompleteOptions = {
|
|
289
|
+
onBlur: true,
|
|
290
|
+
afterDelay: true,
|
|
291
|
+
delay: 2500
|
|
292
|
+
};
|
|
293
|
+
var Input = (0, import_react6.forwardRef)(function Input2({
|
|
202
294
|
id,
|
|
203
295
|
type = "text",
|
|
204
296
|
value,
|
|
@@ -207,58 +299,73 @@ var Input = ({
|
|
|
207
299
|
onChangeText = noop,
|
|
208
300
|
onEditCompleted,
|
|
209
301
|
className = "",
|
|
302
|
+
allowEnterComplete = true,
|
|
210
303
|
expanded = true,
|
|
211
|
-
autoFocus,
|
|
304
|
+
autoFocus = false,
|
|
212
305
|
onBlur,
|
|
306
|
+
editCompleteOptions,
|
|
213
307
|
containerClassName,
|
|
308
|
+
disabled,
|
|
214
309
|
...restProps
|
|
215
|
-
})
|
|
310
|
+
}, forwardedRef) {
|
|
311
|
+
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
216
312
|
const {
|
|
217
313
|
restartTimer,
|
|
218
|
-
|
|
219
|
-
} =
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
314
|
+
clearTimer
|
|
315
|
+
} = useDelay({ delay, disabled: !afterDelay });
|
|
316
|
+
const innerRef = (0, import_react6.useRef)(null);
|
|
317
|
+
const { focusNext } = useFocusManagement();
|
|
318
|
+
useFocusOnceVisible(innerRef, !autoFocus);
|
|
319
|
+
(0, import_react6.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
320
|
+
const handleKeyDown = (e) => {
|
|
321
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
322
|
+
e.preventDefault();
|
|
323
|
+
innerRef.current?.blur();
|
|
324
|
+
focusNext();
|
|
224
325
|
}
|
|
225
|
-
}
|
|
326
|
+
};
|
|
226
327
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)({ "w-full": expanded }, containerClassName), children: [
|
|
227
328
|
label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx2.default)("mb-1", label.className) }),
|
|
228
329
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
229
330
|
"input",
|
|
230
331
|
{
|
|
231
|
-
|
|
332
|
+
...restProps,
|
|
333
|
+
ref: innerRef,
|
|
232
334
|
value,
|
|
233
335
|
id,
|
|
234
336
|
type,
|
|
235
|
-
|
|
337
|
+
disabled,
|
|
338
|
+
className: (0, import_clsx2.default)(getInputClassName({ disabled }), className),
|
|
339
|
+
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
236
340
|
onBlur: (event) => {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
if (onEditCompleted) {
|
|
341
|
+
onBlur?.(event);
|
|
342
|
+
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
241
343
|
onEditCompleted(event.target.value);
|
|
242
|
-
|
|
344
|
+
clearTimer();
|
|
243
345
|
}
|
|
244
346
|
},
|
|
245
347
|
onChange: (e) => {
|
|
246
348
|
const value2 = e.target.value;
|
|
247
349
|
if (onEditCompleted) {
|
|
248
350
|
restartTimer(() => {
|
|
249
|
-
|
|
250
|
-
|
|
351
|
+
if (innerRef.current) {
|
|
352
|
+
innerRef.current.blur();
|
|
353
|
+
if (!allowEditCompleteOnBlur) {
|
|
354
|
+
onEditCompleted(value2);
|
|
355
|
+
}
|
|
356
|
+
} else {
|
|
357
|
+
onEditCompleted(value2);
|
|
358
|
+
}
|
|
251
359
|
});
|
|
252
360
|
}
|
|
253
361
|
onChange(e);
|
|
254
362
|
onChangeText(value2);
|
|
255
|
-
}
|
|
256
|
-
...restProps
|
|
363
|
+
}
|
|
257
364
|
}
|
|
258
365
|
)
|
|
259
366
|
] });
|
|
260
|
-
};
|
|
261
|
-
var FormInput = (0,
|
|
367
|
+
});
|
|
368
|
+
var FormInput = (0, import_react6.forwardRef)(function FormInput2({
|
|
262
369
|
id,
|
|
263
370
|
labelText,
|
|
264
371
|
errorText,
|
|
@@ -267,19 +374,18 @@ var FormInput = (0, import_react4.forwardRef)(function FormInput2({
|
|
|
267
374
|
errorClassName,
|
|
268
375
|
containerClassName,
|
|
269
376
|
required,
|
|
377
|
+
disabled,
|
|
270
378
|
...restProps
|
|
271
379
|
}, ref) {
|
|
272
380
|
const input = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
273
381
|
"input",
|
|
274
382
|
{
|
|
383
|
+
...restProps,
|
|
275
384
|
ref,
|
|
276
385
|
id,
|
|
277
|
-
|
|
386
|
+
disabled,
|
|
278
387
|
className: (0, import_clsx2.default)(
|
|
279
|
-
{
|
|
280
|
-
"focus:border-primary focus:ring-primary": !errorText,
|
|
281
|
-
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
282
|
-
},
|
|
388
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
283
389
|
className
|
|
284
390
|
)
|
|
285
391
|
}
|
|
@@ -297,12 +403,21 @@ var FormInput = (0, import_react4.forwardRef)(function FormInput2({
|
|
|
297
403
|
// src/components/user-action/Button.tsx
|
|
298
404
|
var import_clsx3 = __toESM(require("clsx"));
|
|
299
405
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
406
|
+
var ButtonColorUtil = {
|
|
407
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
408
|
+
text: ["primary", "negative", "neutral"],
|
|
409
|
+
outline: ["primary"]
|
|
410
|
+
};
|
|
411
|
+
var IconButtonUtil = {
|
|
412
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
413
|
+
};
|
|
300
414
|
var paddingMapping = {
|
|
301
415
|
small: "btn-sm",
|
|
302
416
|
medium: "btn-md",
|
|
303
417
|
large: "btn-lg"
|
|
304
418
|
};
|
|
305
419
|
var iconPaddingMapping = {
|
|
420
|
+
tiny: "icon-btn-xs",
|
|
306
421
|
small: "icon-btn-sm",
|
|
307
422
|
medium: "icon-btn-md",
|
|
308
423
|
large: "icon-btn-lg"
|
|
@@ -409,7 +524,7 @@ var TextButton = ({
|
|
|
409
524
|
className: (0, import_clsx3.default)(
|
|
410
525
|
{
|
|
411
526
|
"text-disabled-text cursor-not-allowed": disabled,
|
|
412
|
-
[(0, import_clsx3.default)(colorClasses, "hover:bg-button-text-hover-background
|
|
527
|
+
[(0, import_clsx3.default)(colorClasses, "hover:bg-button-text-hover-background")]: !disabled
|
|
413
528
|
},
|
|
414
529
|
ButtonUtil.paddingMapping[size],
|
|
415
530
|
className
|
|
@@ -457,7 +572,8 @@ var IconButton = ({
|
|
|
457
572
|
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
458
573
|
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
459
574
|
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
460
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
575
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
576
|
+
transparent: "bg-transparent"
|
|
461
577
|
}[color];
|
|
462
578
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
463
579
|
"button",
|
|
@@ -466,7 +582,9 @@ var IconButton = ({
|
|
|
466
582
|
disabled: disabled || onClick === void 0,
|
|
467
583
|
className: (0, import_clsx3.default)(
|
|
468
584
|
{
|
|
469
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
585
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
586
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
587
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
470
588
|
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
471
589
|
},
|
|
472
590
|
ButtonUtil.iconPaddingMapping[size],
|
|
@@ -479,7 +597,7 @@ var IconButton = ({
|
|
|
479
597
|
};
|
|
480
598
|
|
|
481
599
|
// src/hooks/useSearch.ts
|
|
482
|
-
var
|
|
600
|
+
var import_react7 = require("react");
|
|
483
601
|
|
|
484
602
|
// src/util/simpleSearch.ts
|
|
485
603
|
var MultiSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -498,12 +616,12 @@ var useSearch = ({
|
|
|
498
616
|
initialSearch,
|
|
499
617
|
searchMapping
|
|
500
618
|
}) => {
|
|
501
|
-
const [items, setItems] = (0,
|
|
502
|
-
const [search, setSearch] = (0,
|
|
503
|
-
(0,
|
|
619
|
+
const [items, setItems] = (0, import_react7.useState)(list);
|
|
620
|
+
const [search, setSearch] = (0, import_react7.useState)(initialSearch);
|
|
621
|
+
(0, import_react7.useEffect)(() => {
|
|
504
622
|
setItems(list);
|
|
505
623
|
}, [list]);
|
|
506
|
-
const result = (0,
|
|
624
|
+
const result = (0, import_react7.useMemo)(
|
|
507
625
|
() => MultiSearchWithMapping(search, items, searchMapping),
|
|
508
626
|
[search, items, searchMapping]
|
|
509
627
|
);
|
|
@@ -521,6 +639,7 @@ var useSearch = ({
|
|
|
521
639
|
var formTranslation = {
|
|
522
640
|
en: {
|
|
523
641
|
all: "All",
|
|
642
|
+
apply: "Apply",
|
|
524
643
|
back: "Back",
|
|
525
644
|
cancel: "Cancel",
|
|
526
645
|
change: "Change",
|
|
@@ -569,6 +688,7 @@ var formTranslation = {
|
|
|
569
688
|
},
|
|
570
689
|
de: {
|
|
571
690
|
all: "Alle",
|
|
691
|
+
apply: "Anwenden",
|
|
572
692
|
back: "Zur\xFCck",
|
|
573
693
|
cancel: "Abbrechen",
|
|
574
694
|
change: "\xC4ndern",
|
|
@@ -766,9 +886,9 @@ var ChipList = ({
|
|
|
766
886
|
};
|
|
767
887
|
|
|
768
888
|
// src/hooks/useOutsideClick.ts
|
|
769
|
-
var
|
|
889
|
+
var import_react8 = require("react");
|
|
770
890
|
var useOutsideClick = (refs, handler) => {
|
|
771
|
-
(0,
|
|
891
|
+
(0, import_react8.useEffect)(() => {
|
|
772
892
|
const listener = (event) => {
|
|
773
893
|
if (event.target === null) return;
|
|
774
894
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -808,9 +928,9 @@ var MultiSelect = ({
|
|
|
808
928
|
className = ""
|
|
809
929
|
}) => {
|
|
810
930
|
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
811
|
-
const triggerRef = (0,
|
|
812
|
-
const menuRef = (0,
|
|
813
|
-
const [isOpen, setIsOpen] = (0,
|
|
931
|
+
const triggerRef = (0, import_react9.useRef)(null);
|
|
932
|
+
const menuRef = (0, import_react9.useRef)(null);
|
|
933
|
+
const [isOpen, setIsOpen] = (0, import_react9.useState)(false);
|
|
814
934
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
815
935
|
const selectedItems = options.filter((value) => value.selected);
|
|
816
936
|
const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
|