@helpwave/hightide 0.1.10 → 0.1.12
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 +2 -2
- package/dist/components/branding/HelpwaveBadge.js.map +1 -1
- package/dist/components/branding/HelpwaveBadge.mjs +2 -2
- package/dist/components/branding/HelpwaveBadge.mjs.map +1 -1
- 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/layout-and-navigation/Tile.js +2 -2
- package/dist/components/layout-and-navigation/Tile.js.map +1 -1
- package/dist/components/layout-and-navigation/Tile.mjs +2 -2
- package/dist/components/layout-and-navigation/Tile.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 +206 -86
- package/dist/components/modals/LanguageModal.js.map +1 -1
- package/dist/components/modals/LanguageModal.mjs +195 -75
- package/dist/components/modals/LanguageModal.mjs.map +1 -1
- package/dist/components/modals/ThemeModal.js +209 -89
- package/dist/components/modals/ThemeModal.js.map +1 -1
- package/dist/components/modals/ThemeModal.mjs +196 -76
- 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 +196 -76
- package/dist/components/properties/MultiSelectProperty.js.map +1 -1
- package/dist/components/properties/MultiSelectProperty.mjs +189 -69
- 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 +196 -76
- package/dist/components/properties/SelectProperty.js.map +1 -1
- package/dist/components/properties/SelectProperty.mjs +189 -69
- 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 +1536 -0
- package/dist/components/table/Table.js.map +1 -0
- package/dist/components/table/Table.mjs +1507 -0
- package/dist/components/table/Table.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 +197 -77
- package/dist/components/user-action/MultiSelect.js.map +1 -1
- package/dist/components/user-action/MultiSelect.mjs +189 -69
- 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 +197 -77
- package/dist/components/user-action/Select.js.map +1 -1
- package/dist/components/user-action/Select.mjs +189 -69
- 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 +436 -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 +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.js +1417 -864
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1360 -803
- 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
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { PropsForTranslation } from '../../localization/useTranslation.mjs';
|
|
3
3
|
import { FormTranslationType } from '../../localization/defaults/form.mjs';
|
|
4
|
+
import { CSSProperties } from 'react';
|
|
4
5
|
import '../../localization/util.mjs';
|
|
5
6
|
|
|
6
7
|
type PaginationTranslation = FormTranslationType;
|
|
7
8
|
type PaginationProps = {
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
pageIndex: number;
|
|
10
|
+
pageCount: number;
|
|
10
11
|
onPageChanged: (page: number) => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: CSSProperties;
|
|
11
14
|
};
|
|
12
15
|
/**
|
|
13
16
|
* A Component showing the pagination allowing first, before, next and last page navigation
|
|
14
17
|
*/
|
|
15
|
-
declare const Pagination: ({ overwriteTranslation,
|
|
18
|
+
declare const Pagination: ({ overwriteTranslation, pageIndex, pageCount, onPageChanged, className, style, }: PropsForTranslation<PaginationTranslation, PaginationProps>) => react_jsx_runtime.JSX.Element;
|
|
16
19
|
|
|
17
20
|
export { Pagination, type PaginationProps };
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { PropsForTranslation } from '../../localization/useTranslation.js';
|
|
3
3
|
import { FormTranslationType } from '../../localization/defaults/form.js';
|
|
4
|
+
import { CSSProperties } from 'react';
|
|
4
5
|
import '../../localization/util.js';
|
|
5
6
|
|
|
6
7
|
type PaginationTranslation = FormTranslationType;
|
|
7
8
|
type PaginationProps = {
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
pageIndex: number;
|
|
10
|
+
pageCount: number;
|
|
10
11
|
onPageChanged: (page: number) => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: CSSProperties;
|
|
11
14
|
};
|
|
12
15
|
/**
|
|
13
16
|
* A Component showing the pagination allowing first, before, next and last page navigation
|
|
14
17
|
*/
|
|
15
|
-
declare const Pagination: ({ overwriteTranslation,
|
|
18
|
+
declare const Pagination: ({ overwriteTranslation, pageIndex, pageCount, onPageChanged, className, style, }: PropsForTranslation<PaginationTranslation, PaginationProps>) => react_jsx_runtime.JSX.Element;
|
|
16
19
|
|
|
17
20
|
export { Pagination, type PaginationProps };
|
|
@@ -33,7 +33,7 @@ __export(Pagination_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(Pagination_exports);
|
|
35
35
|
var import_lucide_react = require("lucide-react");
|
|
36
|
-
var
|
|
36
|
+
var import_clsx4 = __toESM(require("clsx"));
|
|
37
37
|
|
|
38
38
|
// src/localization/LanguageProvider.tsx
|
|
39
39
|
var import_react2 = require("react");
|
|
@@ -126,6 +126,7 @@ var useTranslation = (translations, overwriteTranslation = {}) => {
|
|
|
126
126
|
var formTranslation = {
|
|
127
127
|
en: {
|
|
128
128
|
all: "All",
|
|
129
|
+
apply: "Apply",
|
|
129
130
|
back: "Back",
|
|
130
131
|
cancel: "Cancel",
|
|
131
132
|
change: "Change",
|
|
@@ -174,6 +175,7 @@ var formTranslation = {
|
|
|
174
175
|
},
|
|
175
176
|
de: {
|
|
176
177
|
all: "Alle",
|
|
178
|
+
apply: "Anwenden",
|
|
177
179
|
back: "Zur\xFCck",
|
|
178
180
|
cancel: "Abbrechen",
|
|
179
181
|
change: "\xC4ndern",
|
|
@@ -222,31 +224,414 @@ var formTranslation = {
|
|
|
222
224
|
}
|
|
223
225
|
};
|
|
224
226
|
|
|
225
|
-
// src/components/
|
|
227
|
+
// src/components/user-action/Input.tsx
|
|
228
|
+
var import_react6 = require("react");
|
|
229
|
+
var import_clsx2 = __toESM(require("clsx"));
|
|
230
|
+
|
|
231
|
+
// src/hooks/useDelay.ts
|
|
232
|
+
var import_react3 = require("react");
|
|
233
|
+
var defaultOptions = {
|
|
234
|
+
delay: 3e3,
|
|
235
|
+
disabled: false
|
|
236
|
+
};
|
|
237
|
+
function useDelay(options) {
|
|
238
|
+
const [timer, setTimer] = (0, import_react3.useState)(void 0);
|
|
239
|
+
const { delay, disabled } = {
|
|
240
|
+
...defaultOptions,
|
|
241
|
+
...options
|
|
242
|
+
};
|
|
243
|
+
const restartTimer = (onDelayFinish) => {
|
|
244
|
+
if (disabled) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
clearTimeout(timer);
|
|
248
|
+
setTimer(setTimeout(() => {
|
|
249
|
+
onDelayFinish();
|
|
250
|
+
}, delay));
|
|
251
|
+
};
|
|
252
|
+
const clearTimer = () => {
|
|
253
|
+
clearTimeout(timer);
|
|
254
|
+
};
|
|
255
|
+
(0, import_react3.useEffect)(() => {
|
|
256
|
+
return () => {
|
|
257
|
+
clearTimeout(timer);
|
|
258
|
+
};
|
|
259
|
+
}, [timer]);
|
|
260
|
+
(0, import_react3.useEffect)(() => {
|
|
261
|
+
if (disabled) {
|
|
262
|
+
clearTimeout(timer);
|
|
263
|
+
}
|
|
264
|
+
}, [disabled, timer]);
|
|
265
|
+
return { restartTimer, clearTimer };
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// src/util/noop.ts
|
|
269
|
+
var noop = () => void 0;
|
|
270
|
+
|
|
271
|
+
// src/components/user-action/Label.tsx
|
|
272
|
+
var import_clsx = __toESM(require("clsx"));
|
|
226
273
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
274
|
+
var styleMapping = {
|
|
275
|
+
labelSmall: "textstyle-label-sm",
|
|
276
|
+
labelMedium: "textstyle-label-md",
|
|
277
|
+
labelBig: "textstyle-label-lg"
|
|
278
|
+
};
|
|
279
|
+
var Label = ({
|
|
280
|
+
children,
|
|
281
|
+
name,
|
|
282
|
+
labelType = "labelSmall",
|
|
283
|
+
className,
|
|
284
|
+
...props
|
|
285
|
+
}) => {
|
|
286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { ...props, className: (0, import_clsx.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
// src/hooks/useFocusManagement.ts
|
|
290
|
+
var import_react4 = require("react");
|
|
291
|
+
function useFocusManagement() {
|
|
292
|
+
const getFocusableElements = (0, import_react4.useCallback)(() => {
|
|
293
|
+
return Array.from(
|
|
294
|
+
document.querySelectorAll(
|
|
295
|
+
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
296
|
+
)
|
|
297
|
+
).filter(
|
|
298
|
+
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
299
|
+
);
|
|
300
|
+
}, []);
|
|
301
|
+
const getNextFocusElement = (0, import_react4.useCallback)(() => {
|
|
302
|
+
const elements = getFocusableElements();
|
|
303
|
+
if (elements.length === 0) {
|
|
304
|
+
return void 0;
|
|
305
|
+
}
|
|
306
|
+
let nextElement = elements[0];
|
|
307
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
308
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
309
|
+
nextElement = elements[(currentIndex + 1) % elements.length];
|
|
310
|
+
}
|
|
311
|
+
return nextElement;
|
|
312
|
+
}, [getFocusableElements]);
|
|
313
|
+
const focusNext = (0, import_react4.useCallback)(() => {
|
|
314
|
+
const nextElement = getNextFocusElement();
|
|
315
|
+
nextElement?.focus();
|
|
316
|
+
}, [getNextFocusElement]);
|
|
317
|
+
const getPreviousFocusElement = (0, import_react4.useCallback)(() => {
|
|
318
|
+
const elements = getFocusableElements();
|
|
319
|
+
if (elements.length === 0) {
|
|
320
|
+
return void 0;
|
|
321
|
+
}
|
|
322
|
+
let previousElement = elements[0];
|
|
323
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
324
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
325
|
+
if (currentIndex === 0) {
|
|
326
|
+
previousElement = elements[elements.length - 1];
|
|
327
|
+
} else {
|
|
328
|
+
previousElement = elements[currentIndex - 1];
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return previousElement;
|
|
332
|
+
}, [getFocusableElements]);
|
|
333
|
+
const focusPrevious = (0, import_react4.useCallback)(() => {
|
|
334
|
+
const previousElement = getPreviousFocusElement();
|
|
335
|
+
if (previousElement) previousElement.focus();
|
|
336
|
+
}, [getPreviousFocusElement]);
|
|
337
|
+
return {
|
|
338
|
+
getFocusableElements,
|
|
339
|
+
getNextFocusElement,
|
|
340
|
+
getPreviousFocusElement,
|
|
341
|
+
focusNext,
|
|
342
|
+
focusPrevious
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// src/hooks/useFocusOnceVisible.ts
|
|
347
|
+
var import_react5 = __toESM(require("react"));
|
|
348
|
+
var useFocusOnceVisible = (ref, disable = false) => {
|
|
349
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react5.default.useState(false);
|
|
350
|
+
(0, import_react5.useEffect)(() => {
|
|
351
|
+
if (disable || hasUsedFocus) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
355
|
+
if (entry.isIntersecting && !hasUsedFocus) {
|
|
356
|
+
ref.current?.focus();
|
|
357
|
+
setHasUsedFocus(hasUsedFocus);
|
|
358
|
+
}
|
|
359
|
+
}, {
|
|
360
|
+
threshold: 0.1
|
|
361
|
+
});
|
|
362
|
+
if (ref.current) {
|
|
363
|
+
observer.observe(ref.current);
|
|
364
|
+
}
|
|
365
|
+
return () => observer.disconnect();
|
|
366
|
+
}, [disable, hasUsedFocus, ref]);
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
// src/components/user-action/Input.tsx
|
|
370
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
371
|
+
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
372
|
+
return (0, import_clsx2.default)(
|
|
373
|
+
"px-2 py-1.5 rounded-md border-2",
|
|
374
|
+
{
|
|
375
|
+
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
376
|
+
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
377
|
+
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
378
|
+
}
|
|
379
|
+
);
|
|
380
|
+
};
|
|
381
|
+
var defaultEditCompleteOptions = {
|
|
382
|
+
onBlur: true,
|
|
383
|
+
afterDelay: true,
|
|
384
|
+
delay: 2500
|
|
385
|
+
};
|
|
386
|
+
var Input = (0, import_react6.forwardRef)(function Input2({
|
|
387
|
+
id,
|
|
388
|
+
type = "text",
|
|
389
|
+
value,
|
|
390
|
+
label,
|
|
391
|
+
onChange = noop,
|
|
392
|
+
onChangeText = noop,
|
|
393
|
+
onEditCompleted,
|
|
394
|
+
className = "",
|
|
395
|
+
allowEnterComplete = true,
|
|
396
|
+
expanded = true,
|
|
397
|
+
autoFocus = false,
|
|
398
|
+
onBlur,
|
|
399
|
+
editCompleteOptions,
|
|
400
|
+
containerClassName,
|
|
401
|
+
disabled,
|
|
402
|
+
...restProps
|
|
403
|
+
}, forwardedRef) {
|
|
404
|
+
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
405
|
+
const {
|
|
406
|
+
restartTimer,
|
|
407
|
+
clearTimer
|
|
408
|
+
} = useDelay({ delay, disabled: !afterDelay });
|
|
409
|
+
const innerRef = (0, import_react6.useRef)(null);
|
|
410
|
+
const { focusNext } = useFocusManagement();
|
|
411
|
+
useFocusOnceVisible(innerRef, !autoFocus);
|
|
412
|
+
(0, import_react6.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
413
|
+
const handleKeyDown = (e) => {
|
|
414
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
415
|
+
e.preventDefault();
|
|
416
|
+
innerRef.current?.blur();
|
|
417
|
+
focusNext();
|
|
418
|
+
}
|
|
419
|
+
};
|
|
420
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)({ "w-full": expanded }, containerClassName), children: [
|
|
421
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx2.default)("mb-1", label.className) }),
|
|
422
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
423
|
+
"input",
|
|
424
|
+
{
|
|
425
|
+
...restProps,
|
|
426
|
+
ref: innerRef,
|
|
427
|
+
value,
|
|
428
|
+
id,
|
|
429
|
+
type,
|
|
430
|
+
disabled,
|
|
431
|
+
className: (0, import_clsx2.default)(getInputClassName({ disabled }), className),
|
|
432
|
+
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
433
|
+
onBlur: (event) => {
|
|
434
|
+
onBlur?.(event);
|
|
435
|
+
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
436
|
+
onEditCompleted(event.target.value);
|
|
437
|
+
clearTimer();
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
onChange: (e) => {
|
|
441
|
+
const value2 = e.target.value;
|
|
442
|
+
if (onEditCompleted) {
|
|
443
|
+
restartTimer(() => {
|
|
444
|
+
if (innerRef.current) {
|
|
445
|
+
innerRef.current.blur();
|
|
446
|
+
if (!allowEditCompleteOnBlur) {
|
|
447
|
+
onEditCompleted(value2);
|
|
448
|
+
}
|
|
449
|
+
} else {
|
|
450
|
+
onEditCompleted(value2);
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
onChange(e);
|
|
455
|
+
onChangeText(value2);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
)
|
|
459
|
+
] });
|
|
460
|
+
});
|
|
461
|
+
var FormInput = (0, import_react6.forwardRef)(function FormInput2({
|
|
462
|
+
id,
|
|
463
|
+
labelText,
|
|
464
|
+
errorText,
|
|
465
|
+
className,
|
|
466
|
+
labelClassName,
|
|
467
|
+
errorClassName,
|
|
468
|
+
containerClassName,
|
|
469
|
+
required,
|
|
470
|
+
disabled,
|
|
471
|
+
...restProps
|
|
472
|
+
}, ref) {
|
|
473
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
474
|
+
"input",
|
|
475
|
+
{
|
|
476
|
+
...restProps,
|
|
477
|
+
ref,
|
|
478
|
+
id,
|
|
479
|
+
disabled,
|
|
480
|
+
className: (0, import_clsx2.default)(
|
|
481
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
482
|
+
className
|
|
483
|
+
)
|
|
484
|
+
}
|
|
485
|
+
);
|
|
486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: (0, import_clsx2.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
487
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("label", { htmlFor: id, className: (0, import_clsx2.default)("textstyle-label-md", labelClassName), children: [
|
|
488
|
+
labelText,
|
|
489
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
490
|
+
] }),
|
|
491
|
+
input,
|
|
492
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: id, className: (0, import_clsx2.default)("text-negative", errorClassName), children: errorText })
|
|
493
|
+
] });
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
// src/util/math.ts
|
|
497
|
+
var clamp = (value, min = 0, max = 1) => {
|
|
498
|
+
return Math.min(Math.max(value, min), max);
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
// src/components/layout-and-navigation/Pagination.tsx
|
|
502
|
+
var import_react7 = require("react");
|
|
503
|
+
|
|
504
|
+
// src/components/user-action/Button.tsx
|
|
505
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
506
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
507
|
+
var ButtonColorUtil = {
|
|
508
|
+
solid: ["primary", "secondary", "tertiary", "positive", "warning", "negative", "neutral"],
|
|
509
|
+
text: ["primary", "negative", "neutral"],
|
|
510
|
+
outline: ["primary"]
|
|
511
|
+
};
|
|
512
|
+
var IconButtonUtil = {
|
|
513
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
514
|
+
};
|
|
515
|
+
var paddingMapping = {
|
|
516
|
+
small: "btn-sm",
|
|
517
|
+
medium: "btn-md",
|
|
518
|
+
large: "btn-lg"
|
|
519
|
+
};
|
|
520
|
+
var iconPaddingMapping = {
|
|
521
|
+
tiny: "icon-btn-xs",
|
|
522
|
+
small: "icon-btn-sm",
|
|
523
|
+
medium: "icon-btn-md",
|
|
524
|
+
large: "icon-btn-lg"
|
|
525
|
+
};
|
|
526
|
+
var ButtonUtil = {
|
|
527
|
+
paddingMapping,
|
|
528
|
+
iconPaddingMapping
|
|
529
|
+
};
|
|
530
|
+
var IconButton = ({
|
|
531
|
+
children,
|
|
532
|
+
disabled = false,
|
|
533
|
+
color = "primary",
|
|
534
|
+
size = "medium",
|
|
535
|
+
onClick,
|
|
536
|
+
className,
|
|
537
|
+
...restProps
|
|
538
|
+
}) => {
|
|
539
|
+
const colorClasses = {
|
|
540
|
+
primary: "bg-button-solid-primary-background text-button-solid-primary-text",
|
|
541
|
+
secondary: "bg-button-solid-secondary-background text-button-solid-secondary-text",
|
|
542
|
+
tertiary: "bg-button-solid-tertiary-background text-button-solid-tertiary-text",
|
|
543
|
+
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
544
|
+
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
545
|
+
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
546
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
547
|
+
transparent: "bg-transparent"
|
|
548
|
+
}[color];
|
|
549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
550
|
+
"button",
|
|
551
|
+
{
|
|
552
|
+
onClick: disabled ? void 0 : onClick,
|
|
553
|
+
disabled: disabled || onClick === void 0,
|
|
554
|
+
className: (0, import_clsx3.default)(
|
|
555
|
+
{
|
|
556
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
557
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
558
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
559
|
+
[(0, import_clsx3.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
560
|
+
},
|
|
561
|
+
ButtonUtil.iconPaddingMapping[size],
|
|
562
|
+
className
|
|
563
|
+
),
|
|
564
|
+
...restProps,
|
|
565
|
+
children
|
|
566
|
+
}
|
|
567
|
+
);
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
// src/components/layout-and-navigation/Pagination.tsx
|
|
571
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
227
572
|
var Pagination = ({
|
|
228
573
|
overwriteTranslation,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
onPageChanged
|
|
574
|
+
pageIndex,
|
|
575
|
+
pageCount,
|
|
576
|
+
onPageChanged,
|
|
577
|
+
className,
|
|
578
|
+
style
|
|
232
579
|
}) => {
|
|
233
580
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
234
|
-
const
|
|
235
|
-
|
|
581
|
+
const [value, setValue] = (0, import_react7.useState)((pageIndex + 1).toString());
|
|
582
|
+
const noPages = pageCount === 0;
|
|
583
|
+
const onFirstPage = pageIndex === 0 && !noPages;
|
|
584
|
+
const onLastPage = pageIndex === pageCount - 1;
|
|
585
|
+
(0, import_react7.useEffect)(() => {
|
|
586
|
+
if (noPages) {
|
|
587
|
+
setValue("0");
|
|
588
|
+
} else {
|
|
589
|
+
setValue((pageIndex + 1).toString());
|
|
590
|
+
}
|
|
591
|
+
}, [pageIndex, noPages]);
|
|
592
|
+
const changePage = (page) => {
|
|
593
|
+
onPageChanged(page);
|
|
236
594
|
};
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_clsx4.default)("row gap-x-1", className), style, children: [
|
|
596
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconButton, { color: "transparent", onClick: () => changePage(0), disabled: onFirstPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.ChevronFirst, {}) }),
|
|
597
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconButton, { color: "transparent", onClick: () => changePage(pageIndex - 1), disabled: onFirstPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.ChevronLeft, {}) }),
|
|
598
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "row min-w-56 gap-x-2 items-center justify-center mx-2 text-center", children: [
|
|
599
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
600
|
+
Input,
|
|
601
|
+
{
|
|
602
|
+
value,
|
|
603
|
+
containerClassName: "flex flex-1 h-10",
|
|
604
|
+
className: (0, import_clsx4.default)(
|
|
605
|
+
"w-full text-center font-bold input-indicator-hidden"
|
|
606
|
+
),
|
|
607
|
+
type: "number",
|
|
608
|
+
min: 1,
|
|
609
|
+
max: pageCount,
|
|
610
|
+
disabled: noPages,
|
|
611
|
+
onChangeText: (value2) => {
|
|
612
|
+
if (value2) {
|
|
613
|
+
setValue(clamp(Number(value2), 1, pageCount).toString());
|
|
614
|
+
} else {
|
|
615
|
+
setValue(value2);
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
onEditCompleted: (value2) => {
|
|
619
|
+
changePage(clamp(Number(value2) - 1, 0, pageCount - 1));
|
|
620
|
+
},
|
|
621
|
+
editCompleteOptions: { delay: 800 }
|
|
622
|
+
}
|
|
623
|
+
),
|
|
624
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "select-none w-10", children: translation("of") }),
|
|
625
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
626
|
+
"span",
|
|
627
|
+
{
|
|
628
|
+
className: "row flex-1 items-center justify-center select-none h-10 bg-surface text-on-surface rounded-md font-bold",
|
|
629
|
+
children: pageCount
|
|
630
|
+
}
|
|
631
|
+
)
|
|
247
632
|
] }),
|
|
248
|
-
/* @__PURE__ */ (0,
|
|
249
|
-
/* @__PURE__ */ (0,
|
|
633
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconButton, { color: "transparent", onClick: () => changePage(pageIndex + 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.ChevronRight, {}) }),
|
|
634
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconButton, { color: "transparent", onClick: () => changePage(pageCount - 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react.ChevronLast, {}) })
|
|
250
635
|
] });
|
|
251
636
|
};
|
|
252
637
|
// Annotate the CommonJS export names for ESM import in node:
|