@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
|
@@ -53,47 +53,44 @@ var formatDateTime = (date) => {
|
|
|
53
53
|
var noop = () => void 0;
|
|
54
54
|
|
|
55
55
|
// src/components/user-action/Input.tsx
|
|
56
|
-
var
|
|
56
|
+
var import_react4 = require("react");
|
|
57
57
|
var import_clsx2 = __toESM(require("clsx"));
|
|
58
58
|
|
|
59
|
-
// src/hooks/
|
|
59
|
+
// src/hooks/useDelay.ts
|
|
60
60
|
var import_react = require("react");
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
setNotificationTimer(setTimeout(() => {
|
|
71
|
-
setNotificationStatus(false);
|
|
72
|
-
clearTimeout(notificationTimer);
|
|
73
|
-
}, delay));
|
|
74
|
-
clearTimeout(updateTimer);
|
|
75
|
-
}, delay));
|
|
61
|
+
var defaultOptions = {
|
|
62
|
+
delay: 3e3,
|
|
63
|
+
disabled: false
|
|
64
|
+
};
|
|
65
|
+
function useDelay(options) {
|
|
66
|
+
const [timer, setTimer] = (0, import_react.useState)(void 0);
|
|
67
|
+
const { delay, disabled } = {
|
|
68
|
+
...defaultOptions,
|
|
69
|
+
...options
|
|
76
70
|
};
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
setNotificationStatus(true);
|
|
81
|
-
clearTimeout(notificationTimer);
|
|
82
|
-
setNotificationTimer(setTimeout(() => {
|
|
83
|
-
setNotificationStatus(false);
|
|
84
|
-
clearTimeout(notificationTimer);
|
|
85
|
-
}, delay));
|
|
86
|
-
} else {
|
|
87
|
-
setNotificationStatus(false);
|
|
71
|
+
const restartTimer = (onDelayFinish) => {
|
|
72
|
+
if (disabled) {
|
|
73
|
+
return;
|
|
88
74
|
}
|
|
75
|
+
clearTimeout(timer);
|
|
76
|
+
setTimer(setTimeout(() => {
|
|
77
|
+
onDelayFinish();
|
|
78
|
+
}, delay));
|
|
79
|
+
};
|
|
80
|
+
const clearTimer = () => {
|
|
81
|
+
clearTimeout(timer);
|
|
89
82
|
};
|
|
90
83
|
(0, import_react.useEffect)(() => {
|
|
91
84
|
return () => {
|
|
92
|
-
clearTimeout(
|
|
93
|
-
clearTimeout(notificationTimer);
|
|
85
|
+
clearTimeout(timer);
|
|
94
86
|
};
|
|
95
|
-
}, []);
|
|
96
|
-
|
|
87
|
+
}, [timer]);
|
|
88
|
+
(0, import_react.useEffect)(() => {
|
|
89
|
+
if (disabled) {
|
|
90
|
+
clearTimeout(timer);
|
|
91
|
+
}
|
|
92
|
+
}, [disabled, timer]);
|
|
93
|
+
return { restartTimer, clearTimer };
|
|
97
94
|
}
|
|
98
95
|
|
|
99
96
|
// src/components/user-action/Label.tsx
|
|
@@ -114,9 +111,104 @@ var Label = ({
|
|
|
114
111
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
115
112
|
};
|
|
116
113
|
|
|
114
|
+
// src/hooks/useFocusManagement.ts
|
|
115
|
+
var import_react2 = require("react");
|
|
116
|
+
function useFocusManagement() {
|
|
117
|
+
const getFocusableElements = (0, import_react2.useCallback)(() => {
|
|
118
|
+
return Array.from(
|
|
119
|
+
document.querySelectorAll(
|
|
120
|
+
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
121
|
+
)
|
|
122
|
+
).filter(
|
|
123
|
+
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
124
|
+
);
|
|
125
|
+
}, []);
|
|
126
|
+
const getNextFocusElement = (0, import_react2.useCallback)(() => {
|
|
127
|
+
const elements = getFocusableElements();
|
|
128
|
+
if (elements.length === 0) {
|
|
129
|
+
return void 0;
|
|
130
|
+
}
|
|
131
|
+
let nextElement = elements[0];
|
|
132
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
133
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
134
|
+
nextElement = elements[(currentIndex + 1) % elements.length];
|
|
135
|
+
}
|
|
136
|
+
return nextElement;
|
|
137
|
+
}, [getFocusableElements]);
|
|
138
|
+
const focusNext = (0, import_react2.useCallback)(() => {
|
|
139
|
+
const nextElement = getNextFocusElement();
|
|
140
|
+
nextElement?.focus();
|
|
141
|
+
}, [getNextFocusElement]);
|
|
142
|
+
const getPreviousFocusElement = (0, import_react2.useCallback)(() => {
|
|
143
|
+
const elements = getFocusableElements();
|
|
144
|
+
if (elements.length === 0) {
|
|
145
|
+
return void 0;
|
|
146
|
+
}
|
|
147
|
+
let previousElement = elements[0];
|
|
148
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
149
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
150
|
+
if (currentIndex === 0) {
|
|
151
|
+
previousElement = elements[elements.length - 1];
|
|
152
|
+
} else {
|
|
153
|
+
previousElement = elements[currentIndex - 1];
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return previousElement;
|
|
157
|
+
}, [getFocusableElements]);
|
|
158
|
+
const focusPrevious = (0, import_react2.useCallback)(() => {
|
|
159
|
+
const previousElement = getPreviousFocusElement();
|
|
160
|
+
if (previousElement) previousElement.focus();
|
|
161
|
+
}, [getPreviousFocusElement]);
|
|
162
|
+
return {
|
|
163
|
+
getFocusableElements,
|
|
164
|
+
getNextFocusElement,
|
|
165
|
+
getPreviousFocusElement,
|
|
166
|
+
focusNext,
|
|
167
|
+
focusPrevious
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
// src/hooks/useFocusOnceVisible.ts
|
|
172
|
+
var import_react3 = __toESM(require("react"));
|
|
173
|
+
var useFocusOnceVisible = (ref, disable = false) => {
|
|
174
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react3.default.useState(false);
|
|
175
|
+
(0, import_react3.useEffect)(() => {
|
|
176
|
+
if (disable || hasUsedFocus) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
180
|
+
if (entry.isIntersecting && !hasUsedFocus) {
|
|
181
|
+
ref.current?.focus();
|
|
182
|
+
setHasUsedFocus(hasUsedFocus);
|
|
183
|
+
}
|
|
184
|
+
}, {
|
|
185
|
+
threshold: 0.1
|
|
186
|
+
});
|
|
187
|
+
if (ref.current) {
|
|
188
|
+
observer.observe(ref.current);
|
|
189
|
+
}
|
|
190
|
+
return () => observer.disconnect();
|
|
191
|
+
}, [disable, hasUsedFocus, ref]);
|
|
192
|
+
};
|
|
193
|
+
|
|
117
194
|
// src/components/user-action/Input.tsx
|
|
118
195
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
119
|
-
var
|
|
196
|
+
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
197
|
+
return (0, import_clsx2.default)(
|
|
198
|
+
"px-2 py-1.5 rounded-md border-2",
|
|
199
|
+
{
|
|
200
|
+
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
201
|
+
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
202
|
+
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
203
|
+
}
|
|
204
|
+
);
|
|
205
|
+
};
|
|
206
|
+
var defaultEditCompleteOptions = {
|
|
207
|
+
onBlur: true,
|
|
208
|
+
afterDelay: true,
|
|
209
|
+
delay: 2500
|
|
210
|
+
};
|
|
211
|
+
var Input = (0, import_react4.forwardRef)(function Input2({
|
|
120
212
|
id,
|
|
121
213
|
type = "text",
|
|
122
214
|
value,
|
|
@@ -125,58 +217,73 @@ var Input = ({
|
|
|
125
217
|
onChangeText = noop,
|
|
126
218
|
onEditCompleted,
|
|
127
219
|
className = "",
|
|
220
|
+
allowEnterComplete = true,
|
|
128
221
|
expanded = true,
|
|
129
|
-
autoFocus,
|
|
222
|
+
autoFocus = false,
|
|
130
223
|
onBlur,
|
|
224
|
+
editCompleteOptions,
|
|
131
225
|
containerClassName,
|
|
226
|
+
disabled,
|
|
132
227
|
...restProps
|
|
133
|
-
})
|
|
228
|
+
}, forwardedRef) {
|
|
229
|
+
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
134
230
|
const {
|
|
135
231
|
restartTimer,
|
|
136
|
-
|
|
137
|
-
} =
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
232
|
+
clearTimer
|
|
233
|
+
} = useDelay({ delay, disabled: !afterDelay });
|
|
234
|
+
const innerRef = (0, import_react4.useRef)(null);
|
|
235
|
+
const { focusNext } = useFocusManagement();
|
|
236
|
+
useFocusOnceVisible(innerRef, !autoFocus);
|
|
237
|
+
(0, import_react4.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
238
|
+
const handleKeyDown = (e) => {
|
|
239
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
240
|
+
e.preventDefault();
|
|
241
|
+
innerRef.current?.blur();
|
|
242
|
+
focusNext();
|
|
142
243
|
}
|
|
143
|
-
}
|
|
244
|
+
};
|
|
144
245
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: (0, import_clsx2.default)({ "w-full": expanded }, containerClassName), children: [
|
|
145
246
|
label && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx2.default)("mb-1", label.className) }),
|
|
146
247
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
147
248
|
"input",
|
|
148
249
|
{
|
|
149
|
-
|
|
250
|
+
...restProps,
|
|
251
|
+
ref: innerRef,
|
|
150
252
|
value,
|
|
151
253
|
id,
|
|
152
254
|
type,
|
|
153
|
-
|
|
255
|
+
disabled,
|
|
256
|
+
className: (0, import_clsx2.default)(getInputClassName({ disabled }), className),
|
|
257
|
+
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
154
258
|
onBlur: (event) => {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
if (onEditCompleted) {
|
|
259
|
+
onBlur?.(event);
|
|
260
|
+
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
159
261
|
onEditCompleted(event.target.value);
|
|
160
|
-
|
|
262
|
+
clearTimer();
|
|
161
263
|
}
|
|
162
264
|
},
|
|
163
265
|
onChange: (e) => {
|
|
164
266
|
const value2 = e.target.value;
|
|
165
267
|
if (onEditCompleted) {
|
|
166
268
|
restartTimer(() => {
|
|
167
|
-
|
|
168
|
-
|
|
269
|
+
if (innerRef.current) {
|
|
270
|
+
innerRef.current.blur();
|
|
271
|
+
if (!allowEditCompleteOnBlur) {
|
|
272
|
+
onEditCompleted(value2);
|
|
273
|
+
}
|
|
274
|
+
} else {
|
|
275
|
+
onEditCompleted(value2);
|
|
276
|
+
}
|
|
169
277
|
});
|
|
170
278
|
}
|
|
171
279
|
onChange(e);
|
|
172
280
|
onChangeText(value2);
|
|
173
|
-
}
|
|
174
|
-
...restProps
|
|
281
|
+
}
|
|
175
282
|
}
|
|
176
283
|
)
|
|
177
284
|
] });
|
|
178
|
-
};
|
|
179
|
-
var FormInput = (0,
|
|
285
|
+
});
|
|
286
|
+
var FormInput = (0, import_react4.forwardRef)(function FormInput2({
|
|
180
287
|
id,
|
|
181
288
|
labelText,
|
|
182
289
|
errorText,
|
|
@@ -185,19 +292,18 @@ var FormInput = (0, import_react2.forwardRef)(function FormInput2({
|
|
|
185
292
|
errorClassName,
|
|
186
293
|
containerClassName,
|
|
187
294
|
required,
|
|
295
|
+
disabled,
|
|
188
296
|
...restProps
|
|
189
297
|
}, ref) {
|
|
190
298
|
const input = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
191
299
|
"input",
|
|
192
300
|
{
|
|
301
|
+
...restProps,
|
|
193
302
|
ref,
|
|
194
303
|
id,
|
|
195
|
-
|
|
304
|
+
disabled,
|
|
196
305
|
className: (0, import_clsx2.default)(
|
|
197
|
-
{
|
|
198
|
-
"focus:border-primary focus:ring-primary": !errorText,
|
|
199
|
-
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
200
|
-
},
|
|
306
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
201
307
|
className
|
|
202
308
|
)
|
|
203
309
|
}
|
|
@@ -219,12 +325,21 @@ var import_clsx4 = __toESM(require("clsx"));
|
|
|
219
325
|
// src/components/user-action/Button.tsx
|
|
220
326
|
var import_clsx3 = __toESM(require("clsx"));
|
|
221
327
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
328
|
+
var ButtonColorUtil = {
|
|
329
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
330
|
+
text: ["primary", "negative", "neutral"],
|
|
331
|
+
outline: ["primary"]
|
|
332
|
+
};
|
|
333
|
+
var IconButtonUtil = {
|
|
334
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
335
|
+
};
|
|
222
336
|
var paddingMapping = {
|
|
223
337
|
small: "btn-sm",
|
|
224
338
|
medium: "btn-md",
|
|
225
339
|
large: "btn-lg"
|
|
226
340
|
};
|
|
227
341
|
var iconPaddingMapping = {
|
|
342
|
+
tiny: "icon-btn-xs",
|
|
228
343
|
small: "icon-btn-sm",
|
|
229
344
|
medium: "icon-btn-md",
|
|
230
345
|
large: "icon-btn-lg"
|
|
@@ -262,7 +377,7 @@ var TextButton = ({
|
|
|
262
377
|
className: (0, import_clsx3.default)(
|
|
263
378
|
{
|
|
264
379
|
"text-disabled-text cursor-not-allowed": disabled,
|
|
265
|
-
[(0, import_clsx3.default)(colorClasses, "hover:bg-button-text-hover-background
|
|
380
|
+
[(0, import_clsx3.default)(colorClasses, "hover:bg-button-text-hover-background")]: !disabled
|
|
266
381
|
},
|
|
267
382
|
ButtonUtil.paddingMapping[size],
|
|
268
383
|
className
|
|
@@ -296,10 +411,10 @@ var TextButton = ({
|
|
|
296
411
|
};
|
|
297
412
|
|
|
298
413
|
// src/localization/LanguageProvider.tsx
|
|
299
|
-
var
|
|
414
|
+
var import_react6 = require("react");
|
|
300
415
|
|
|
301
416
|
// src/hooks/useLocalStorage.ts
|
|
302
|
-
var
|
|
417
|
+
var import_react5 = require("react");
|
|
303
418
|
|
|
304
419
|
// src/localization/util.ts
|
|
305
420
|
var languages = ["en", "de"];
|
|
@@ -316,11 +431,11 @@ var LanguageUtil = {
|
|
|
316
431
|
|
|
317
432
|
// src/localization/LanguageProvider.tsx
|
|
318
433
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
319
|
-
var LanguageContext = (0,
|
|
434
|
+
var LanguageContext = (0, import_react6.createContext)({
|
|
320
435
|
language: LanguageUtil.DEFAULT_LANGUAGE,
|
|
321
436
|
setLanguage: (v) => v
|
|
322
437
|
});
|
|
323
|
-
var useLanguage = () => (0,
|
|
438
|
+
var useLanguage = () => (0, import_react6.useContext)(LanguageContext);
|
|
324
439
|
|
|
325
440
|
// src/localization/useTranslation.ts
|
|
326
441
|
var TranslationPluralCount = {
|
|
@@ -386,6 +501,7 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
386
501
|
var formTranslation = {
|
|
387
502
|
en: {
|
|
388
503
|
all: "All",
|
|
504
|
+
apply: "Apply",
|
|
389
505
|
back: "Back",
|
|
390
506
|
cancel: "Cancel",
|
|
391
507
|
change: "Change",
|
|
@@ -434,6 +550,7 @@ var formTranslation = {
|
|
|
434
550
|
},
|
|
435
551
|
de: {
|
|
436
552
|
all: "Alle",
|
|
553
|
+
apply: "Anwenden",
|
|
437
554
|
back: "Zur\xFCck",
|
|
438
555
|
cancel: "Abbrechen",
|
|
439
556
|
change: "\xC4ndern",
|