@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
package/dist/index.js
CHANGED
|
@@ -2872,10 +2872,12 @@ __export(index_exports, {
|
|
|
2872
2872
|
Expandable: () => Expandable,
|
|
2873
2873
|
ExpandableUncontrolled: () => ExpandableUncontrolled,
|
|
2874
2874
|
FAQSection: () => FAQSection,
|
|
2875
|
+
FillerRowElement: () => FillerRowElement,
|
|
2875
2876
|
FormInput: () => FormInput,
|
|
2876
2877
|
Helpwave: () => Helpwave,
|
|
2877
2878
|
HelpwaveBadge: () => HelpwaveBadge,
|
|
2878
2879
|
IconButton: () => IconButton,
|
|
2880
|
+
IconButtonUtil: () => IconButtonUtil,
|
|
2879
2881
|
Input: () => Input,
|
|
2880
2882
|
InputModal: () => InputModal,
|
|
2881
2883
|
InputUncontrolled: () => InputUncontrolled,
|
|
@@ -2917,10 +2919,15 @@ __export(index_exports, {
|
|
|
2917
2919
|
SimpleSearchWithMapping: () => SimpleSearchWithMapping,
|
|
2918
2920
|
SingleSelectProperty: () => SingleSelectProperty,
|
|
2919
2921
|
SolidButton: () => SolidButton,
|
|
2920
|
-
SortButton: () => SortButton,
|
|
2921
2922
|
StepperBar: () => StepperBar,
|
|
2922
2923
|
StepperBarUncontrolled: () => StepperBarUncontrolled,
|
|
2923
2924
|
Table: () => Table,
|
|
2925
|
+
TableCell: () => TableCell,
|
|
2926
|
+
TableFilterButton: () => TableFilterButton,
|
|
2927
|
+
TableFilters: () => TableFilters,
|
|
2928
|
+
TableSortButton: () => TableSortButton,
|
|
2929
|
+
TableUncontrolled: () => TableUncontrolled,
|
|
2930
|
+
TableWithSelection: () => TableWithSelection,
|
|
2924
2931
|
TagIcon: () => TagIcon,
|
|
2925
2932
|
TextButton: () => TextButton,
|
|
2926
2933
|
TextImage: () => TextImage,
|
|
@@ -2943,18 +2950,14 @@ __export(index_exports, {
|
|
|
2943
2950
|
YearMonthPicker: () => YearMonthPicker,
|
|
2944
2951
|
YearMonthPickerUncontrolled: () => YearMonthPickerUncontrolled,
|
|
2945
2952
|
addDuration: () => addDuration,
|
|
2946
|
-
addElementToTable: () => addElementToTable,
|
|
2947
2953
|
avatarSizeMapping: () => avatarSizeMapping,
|
|
2948
2954
|
avtarSizeList: () => avtarSizeList,
|
|
2949
2955
|
builder: () => builder,
|
|
2950
2956
|
changeDuration: () => changeDuration,
|
|
2951
|
-
changeTableSelectionSingle: () => changeTableSelectionSingle,
|
|
2952
2957
|
clamp: () => clamp,
|
|
2953
2958
|
closestMatch: () => closestMatch,
|
|
2954
2959
|
createLoopingList: () => createLoopingList,
|
|
2955
2960
|
createLoopingListWithIndex: () => createLoopingListWithIndex,
|
|
2956
|
-
defaultTableStatePagination: () => defaultTableStatePagination,
|
|
2957
|
-
defaultTableStateSelection: () => defaultTableStateSelection,
|
|
2958
2961
|
equalDate: () => equalDate,
|
|
2959
2962
|
equalSizeGroups: () => equalSizeGroups,
|
|
2960
2963
|
filterNews: () => filterNews,
|
|
@@ -2966,7 +2969,6 @@ __export(index_exports, {
|
|
|
2966
2969
|
getDaysInMonth: () => getDaysInMonth,
|
|
2967
2970
|
getNeighbours: () => getNeighbours,
|
|
2968
2971
|
getWeeksForCalenderMonth: () => getWeeksForCalenderMonth,
|
|
2969
|
-
isDataObjectSelected: () => isDataObjectSelected,
|
|
2970
2972
|
isInTimeSpan: () => isInTimeSpan,
|
|
2971
2973
|
localizedNewsSchema: () => localizedNewsSchema,
|
|
2972
2974
|
monthTranslation: () => monthTranslation,
|
|
@@ -2974,19 +2976,21 @@ __export(index_exports, {
|
|
|
2974
2976
|
newsListSchema: () => newsListSchema,
|
|
2975
2977
|
newsSchema: () => newsSchema,
|
|
2976
2978
|
noop: () => noop,
|
|
2977
|
-
pageForItem: () => pageForItem,
|
|
2978
2979
|
range: () => range,
|
|
2979
|
-
|
|
2980
|
+
resolveSetState: () => resolveSetState,
|
|
2980
2981
|
shadingColorValues: () => shadingColorValues,
|
|
2981
2982
|
subtractDuration: () => subtractDuration,
|
|
2982
2983
|
timeTranslation: () => timeTranslation,
|
|
2983
|
-
|
|
2984
|
+
useDelay: () => useDelay,
|
|
2985
|
+
useFocusManagement: () => useFocusManagement,
|
|
2986
|
+
useFocusOnceVisible: () => useFocusOnceVisible,
|
|
2984
2987
|
useHoverState: () => useHoverState,
|
|
2985
2988
|
useLanguage: () => useLanguage,
|
|
2986
2989
|
useLocalStorage: () => useLocalStorage,
|
|
2987
2990
|
useLocale: () => useLocale,
|
|
2988
2991
|
useOutsideClick: () => useOutsideClick,
|
|
2989
|
-
|
|
2992
|
+
useRerender: () => useRerender,
|
|
2993
|
+
useResizeCallbackWrapper: () => useResizeCallbackWrapper,
|
|
2990
2994
|
useSearch: () => useSearch,
|
|
2991
2995
|
useTheme: () => useTheme,
|
|
2992
2996
|
useTranslation: () => useTranslation,
|
|
@@ -3379,14 +3383,35 @@ var equalSizeGroups = (array, groupSize) => {
|
|
|
3379
3383
|
}
|
|
3380
3384
|
return groups;
|
|
3381
3385
|
};
|
|
3382
|
-
var
|
|
3383
|
-
|
|
3386
|
+
var defaultRangeOptions = {
|
|
3387
|
+
allowEmptyRange: false,
|
|
3388
|
+
stepSize: 1,
|
|
3389
|
+
exclusiveStart: false,
|
|
3390
|
+
exclusiveEnd: true
|
|
3391
|
+
};
|
|
3392
|
+
var range = (endOrRange, options) => {
|
|
3393
|
+
const { allowEmptyRange, stepSize, exclusiveStart, exclusiveEnd } = { ...defaultRangeOptions, ...options };
|
|
3394
|
+
let start = 0;
|
|
3395
|
+
let end;
|
|
3396
|
+
if (typeof endOrRange === "number") {
|
|
3397
|
+
end = endOrRange;
|
|
3398
|
+
} else {
|
|
3399
|
+
start = endOrRange[0];
|
|
3400
|
+
end = endOrRange[1];
|
|
3401
|
+
}
|
|
3402
|
+
if (!exclusiveEnd) {
|
|
3403
|
+
end -= 1;
|
|
3404
|
+
}
|
|
3405
|
+
if (exclusiveStart) {
|
|
3406
|
+
start += 1;
|
|
3407
|
+
}
|
|
3408
|
+
if (end - 1 < start) {
|
|
3384
3409
|
if (!allowEmptyRange) {
|
|
3385
|
-
console.warn(`range: end (${end}) < start (${start}) should be allowed explicitly, set allowEmptyRange to true`);
|
|
3410
|
+
console.warn(`range: end (${end}) < start (${start}) should be allowed explicitly, set options.allowEmptyRange to true`);
|
|
3386
3411
|
}
|
|
3387
3412
|
return [];
|
|
3388
3413
|
}
|
|
3389
|
-
return Array.from({ length: end - start
|
|
3414
|
+
return Array.from({ length: end - start }, (_, index) => index * stepSize + start);
|
|
3390
3415
|
};
|
|
3391
3416
|
var closestMatch = (list, firstCloser) => {
|
|
3392
3417
|
return list.reduce((item1, item2) => {
|
|
@@ -3597,12 +3622,16 @@ var ButtonColorUtil = {
|
|
|
3597
3622
|
text: ["primary", "negative", "neutral"],
|
|
3598
3623
|
outline: ["primary"]
|
|
3599
3624
|
};
|
|
3625
|
+
var IconButtonUtil = {
|
|
3626
|
+
icon: [...ButtonColorUtil.solid, "transparent"]
|
|
3627
|
+
};
|
|
3600
3628
|
var paddingMapping = {
|
|
3601
3629
|
small: "btn-sm",
|
|
3602
3630
|
medium: "btn-md",
|
|
3603
3631
|
large: "btn-lg"
|
|
3604
3632
|
};
|
|
3605
3633
|
var iconPaddingMapping = {
|
|
3634
|
+
tiny: "icon-btn-xs",
|
|
3606
3635
|
small: "icon-btn-sm",
|
|
3607
3636
|
medium: "icon-btn-md",
|
|
3608
3637
|
large: "icon-btn-lg"
|
|
@@ -3766,7 +3795,7 @@ var TextButton = ({
|
|
|
3766
3795
|
className: (0, import_clsx4.default)(
|
|
3767
3796
|
{
|
|
3768
3797
|
"text-disabled-text cursor-not-allowed": disabled,
|
|
3769
|
-
[(0, import_clsx4.default)(colorClasses, "hover:bg-button-text-hover-background
|
|
3798
|
+
[(0, import_clsx4.default)(colorClasses, "hover:bg-button-text-hover-background")]: !disabled
|
|
3770
3799
|
},
|
|
3771
3800
|
ButtonUtil.paddingMapping[size],
|
|
3772
3801
|
className
|
|
@@ -3814,7 +3843,8 @@ var IconButton = ({
|
|
|
3814
3843
|
positive: "bg-button-solid-positive-background text-button-solid-positive-text",
|
|
3815
3844
|
warning: "bg-button-solid-warning-background text-button-solid-warning-text",
|
|
3816
3845
|
negative: "bg-button-solid-negative-background text-button-solid-negative-text",
|
|
3817
|
-
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text"
|
|
3846
|
+
neutral: "bg-button-solid-neutral-background text-button-solid-neutral-text",
|
|
3847
|
+
transparent: "bg-transparent"
|
|
3818
3848
|
}[color];
|
|
3819
3849
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
3820
3850
|
"button",
|
|
@@ -3823,7 +3853,9 @@ var IconButton = ({
|
|
|
3823
3853
|
disabled: disabled || onClick === void 0,
|
|
3824
3854
|
className: (0, import_clsx4.default)(
|
|
3825
3855
|
{
|
|
3826
|
-
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled,
|
|
3856
|
+
"text-disabled-text bg-disabled-background cursor-not-allowed": disabled && color !== "transparent",
|
|
3857
|
+
"text-disabled-text cursor-not-allowed opacity-70": disabled && color === "transparent",
|
|
3858
|
+
"hover:bg-button-text-hover-background": !disabled && color === "transparent",
|
|
3827
3859
|
[(0, import_clsx4.default)(colorClasses, "hover:brightness-90")]: !disabled
|
|
3828
3860
|
},
|
|
3829
3861
|
ButtonUtil.iconPaddingMapping[size],
|
|
@@ -3845,7 +3877,7 @@ var import_react3 = require("react");
|
|
|
3845
3877
|
var import_lucide_react2 = require("lucide-react");
|
|
3846
3878
|
var import_clsx5 = __toESM(require("clsx"));
|
|
3847
3879
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
3848
|
-
var DefaultIcon = (expanded) => expanded ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.ChevronUp, {
|
|
3880
|
+
var DefaultIcon = (expanded) => expanded ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.ChevronUp, { className: "min-w-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.ChevronDown, { className: "min-w-4 w-4" });
|
|
3849
3881
|
var Expandable = (0, import_react3.forwardRef)(function Expandable2({
|
|
3850
3882
|
children,
|
|
3851
3883
|
label,
|
|
@@ -3941,7 +3973,7 @@ var YearMonthPicker = ({
|
|
|
3941
3973
|
console.error(`startYear: (${start}) less than endYear: (${end})`);
|
|
3942
3974
|
return null;
|
|
3943
3975
|
}
|
|
3944
|
-
const years = range(start.getFullYear(), end.getFullYear());
|
|
3976
|
+
const years = range([start.getFullYear(), end.getFullYear()], { exclusiveEnd: false });
|
|
3945
3977
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: (0, import_clsx6.default)("col select-none", className), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_custom_scrollbars_2.Scrollbars, { autoHeight: true, autoHeightMax: maxHeight, style: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "col gap-y-1 mr-3", children: years.map((year) => {
|
|
3946
3978
|
const selectedYear = displayedYearMonth.getFullYear() === year;
|
|
3947
3979
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
@@ -4340,8 +4372,8 @@ var TimePicker = ({
|
|
|
4340
4372
|
const minuteRef = (0, import_react7.useRef)(null);
|
|
4341
4373
|
const hourRef = (0, import_react7.useRef)(null);
|
|
4342
4374
|
const isPM = time.getHours() >= 11;
|
|
4343
|
-
const hours = is24HourFormat ? range(
|
|
4344
|
-
let minutes = range(
|
|
4375
|
+
const hours = is24HourFormat ? range(24) : range([1, 12], { exclusiveEnd: false });
|
|
4376
|
+
let minutes = range(60);
|
|
4345
4377
|
(0, import_react7.useEffect)(() => {
|
|
4346
4378
|
const scrollToItem = () => {
|
|
4347
4379
|
if (minuteRef.current) {
|
|
@@ -4588,6 +4620,7 @@ var import_lucide_react4 = require("lucide-react");
|
|
|
4588
4620
|
var formTranslation = {
|
|
4589
4621
|
en: {
|
|
4590
4622
|
all: "All",
|
|
4623
|
+
apply: "Apply",
|
|
4591
4624
|
back: "Back",
|
|
4592
4625
|
cancel: "Cancel",
|
|
4593
4626
|
change: "Change",
|
|
@@ -4636,6 +4669,7 @@ var formTranslation = {
|
|
|
4636
4669
|
},
|
|
4637
4670
|
de: {
|
|
4638
4671
|
all: "Alle",
|
|
4672
|
+
apply: "Anwenden",
|
|
4639
4673
|
back: "Zur\xFCck",
|
|
4640
4674
|
cancel: "Abbrechen",
|
|
4641
4675
|
change: "\xC4ndern",
|
|
@@ -5457,7 +5491,7 @@ var Carousel = ({
|
|
|
5457
5491
|
overScrollThreshold = 0.1,
|
|
5458
5492
|
blurColor = "from-background",
|
|
5459
5493
|
className = "",
|
|
5460
|
-
heightClassName = "h-
|
|
5494
|
+
heightClassName = "h-96",
|
|
5461
5495
|
widthClassName = "w-[70%] desktop:w-1/2"
|
|
5462
5496
|
}) => {
|
|
5463
5497
|
if (isAutoLooping && !isLooping) {
|
|
@@ -5740,10 +5774,10 @@ var Carousel = ({
|
|
|
5740
5774
|
"div",
|
|
5741
5775
|
{
|
|
5742
5776
|
className: "row items-center justify-center w-full my-2",
|
|
5743
|
-
children: range(
|
|
5777
|
+
children: range(length).map((index) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
5744
5778
|
"button",
|
|
5745
5779
|
{
|
|
5746
|
-
className: (0, import_clsx17.default)("w-
|
|
5780
|
+
className: (0, import_clsx17.default)("w-8 min-w-8 h-3 min-h-3 first:rounded-l-md last:rounded-r-md", {
|
|
5747
5781
|
"bg-carousel-dot-disabled hover:bg-carousel-dot-active": currentIndex !== index,
|
|
5748
5782
|
"bg-carousel-dot-active hover:brightness-90": currentIndex === index
|
|
5749
5783
|
}),
|
|
@@ -6101,85 +6135,52 @@ var FAQSection = ({
|
|
|
6101
6135
|
|
|
6102
6136
|
// src/components/layout-and-navigation/Pagination.tsx
|
|
6103
6137
|
var import_lucide_react7 = require("lucide-react");
|
|
6104
|
-
var
|
|
6105
|
-
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
6106
|
-
var Pagination = ({
|
|
6107
|
-
overwriteTranslation,
|
|
6108
|
-
page,
|
|
6109
|
-
numberOfPages,
|
|
6110
|
-
onPageChanged
|
|
6111
|
-
}) => {
|
|
6112
|
-
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
6113
|
-
const changePage = (page2) => {
|
|
6114
|
-
onPageChanged(page2);
|
|
6115
|
-
};
|
|
6116
|
-
const noPages = numberOfPages === 0;
|
|
6117
|
-
const onFirstPage = page === 0 && !noPages;
|
|
6118
|
-
const onLastPage = page === numberOfPages - 1;
|
|
6119
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: (0, import_clsx21.default)("row", { "opacity-30": noPages }), children: [
|
|
6120
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { onClick: () => changePage(0), disabled: onFirstPage, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react7.ChevronFirst, { className: (0, import_clsx21.default)({ "opacity-30": onFirstPage }) }) }),
|
|
6121
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { onClick: () => changePage(page - 1), disabled: onFirstPage, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react7.ChevronLeft, { className: (0, import_clsx21.default)({ "opacity-30": onFirstPage }) }) }),
|
|
6122
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "min-w-[80px] justify-center mx-2", children: [
|
|
6123
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "select-none text-right flex-1", children: noPages ? 0 : page + 1 }),
|
|
6124
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "select-none mx-2", children: translation("of") }),
|
|
6125
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "select-none text-left flex-1", children: numberOfPages })
|
|
6126
|
-
] }),
|
|
6127
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { onClick: () => changePage(page + 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react7.ChevronRight, { className: (0, import_clsx21.default)({ "opacity-30": onLastPage }) }) }),
|
|
6128
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("button", { onClick: () => changePage(numberOfPages - 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react7.ChevronLast, { className: (0, import_clsx21.default)({ "opacity-30": onLastPage }) }) })
|
|
6129
|
-
] });
|
|
6130
|
-
};
|
|
6131
|
-
|
|
6132
|
-
// src/components/layout-and-navigation/SearchableList.tsx
|
|
6133
|
-
var import_lucide_react8 = require("lucide-react");
|
|
6134
|
-
var import_clsx24 = __toESM(require("clsx"));
|
|
6138
|
+
var import_clsx23 = __toESM(require("clsx"));
|
|
6135
6139
|
|
|
6136
6140
|
// src/components/user-action/Input.tsx
|
|
6137
|
-
var
|
|
6138
|
-
var
|
|
6141
|
+
var import_react15 = require("react");
|
|
6142
|
+
var import_clsx22 = __toESM(require("clsx"));
|
|
6139
6143
|
|
|
6140
|
-
// src/hooks/
|
|
6144
|
+
// src/hooks/useDelay.ts
|
|
6141
6145
|
var import_react12 = require("react");
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
setNotificationTimer(setTimeout(() => {
|
|
6152
|
-
setNotificationStatus(false);
|
|
6153
|
-
clearTimeout(notificationTimer);
|
|
6154
|
-
}, delay));
|
|
6155
|
-
clearTimeout(updateTimer);
|
|
6156
|
-
}, delay));
|
|
6146
|
+
var defaultOptions = {
|
|
6147
|
+
delay: 3e3,
|
|
6148
|
+
disabled: false
|
|
6149
|
+
};
|
|
6150
|
+
function useDelay(options) {
|
|
6151
|
+
const [timer, setTimer] = (0, import_react12.useState)(void 0);
|
|
6152
|
+
const { delay, disabled } = {
|
|
6153
|
+
...defaultOptions,
|
|
6154
|
+
...options
|
|
6157
6155
|
};
|
|
6158
|
-
const
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
setNotificationStatus(true);
|
|
6162
|
-
clearTimeout(notificationTimer);
|
|
6163
|
-
setNotificationTimer(setTimeout(() => {
|
|
6164
|
-
setNotificationStatus(false);
|
|
6165
|
-
clearTimeout(notificationTimer);
|
|
6166
|
-
}, delay));
|
|
6167
|
-
} else {
|
|
6168
|
-
setNotificationStatus(false);
|
|
6156
|
+
const restartTimer = (onDelayFinish) => {
|
|
6157
|
+
if (disabled) {
|
|
6158
|
+
return;
|
|
6169
6159
|
}
|
|
6160
|
+
clearTimeout(timer);
|
|
6161
|
+
setTimer(setTimeout(() => {
|
|
6162
|
+
onDelayFinish();
|
|
6163
|
+
}, delay));
|
|
6164
|
+
};
|
|
6165
|
+
const clearTimer = () => {
|
|
6166
|
+
clearTimeout(timer);
|
|
6170
6167
|
};
|
|
6171
6168
|
(0, import_react12.useEffect)(() => {
|
|
6172
6169
|
return () => {
|
|
6173
|
-
clearTimeout(
|
|
6174
|
-
clearTimeout(notificationTimer);
|
|
6170
|
+
clearTimeout(timer);
|
|
6175
6171
|
};
|
|
6176
|
-
}, []);
|
|
6177
|
-
|
|
6172
|
+
}, [timer]);
|
|
6173
|
+
(0, import_react12.useEffect)(() => {
|
|
6174
|
+
if (disabled) {
|
|
6175
|
+
clearTimeout(timer);
|
|
6176
|
+
}
|
|
6177
|
+
}, [disabled, timer]);
|
|
6178
|
+
return { restartTimer, clearTimer };
|
|
6178
6179
|
}
|
|
6179
6180
|
|
|
6180
6181
|
// src/components/user-action/Label.tsx
|
|
6181
|
-
var
|
|
6182
|
-
var
|
|
6182
|
+
var import_clsx21 = __toESM(require("clsx"));
|
|
6183
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
6183
6184
|
var styleMapping = {
|
|
6184
6185
|
labelSmall: "textstyle-label-sm",
|
|
6185
6186
|
labelMedium: "textstyle-label-md",
|
|
@@ -6192,12 +6193,107 @@ var Label = ({
|
|
|
6192
6193
|
className,
|
|
6193
6194
|
...props
|
|
6194
6195
|
}) => {
|
|
6195
|
-
return /* @__PURE__ */ (0,
|
|
6196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { ...props, className: (0, import_clsx21.default)(styleMapping[labelType], className), children: children ? children : name });
|
|
6197
|
+
};
|
|
6198
|
+
|
|
6199
|
+
// src/hooks/useFocusManagement.ts
|
|
6200
|
+
var import_react13 = require("react");
|
|
6201
|
+
function useFocusManagement() {
|
|
6202
|
+
const getFocusableElements = (0, import_react13.useCallback)(() => {
|
|
6203
|
+
return Array.from(
|
|
6204
|
+
document.querySelectorAll(
|
|
6205
|
+
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
6206
|
+
)
|
|
6207
|
+
).filter(
|
|
6208
|
+
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
6209
|
+
);
|
|
6210
|
+
}, []);
|
|
6211
|
+
const getNextFocusElement = (0, import_react13.useCallback)(() => {
|
|
6212
|
+
const elements = getFocusableElements();
|
|
6213
|
+
if (elements.length === 0) {
|
|
6214
|
+
return void 0;
|
|
6215
|
+
}
|
|
6216
|
+
let nextElement = elements[0];
|
|
6217
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
6218
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
6219
|
+
nextElement = elements[(currentIndex + 1) % elements.length];
|
|
6220
|
+
}
|
|
6221
|
+
return nextElement;
|
|
6222
|
+
}, [getFocusableElements]);
|
|
6223
|
+
const focusNext = (0, import_react13.useCallback)(() => {
|
|
6224
|
+
const nextElement = getNextFocusElement();
|
|
6225
|
+
nextElement?.focus();
|
|
6226
|
+
}, [getNextFocusElement]);
|
|
6227
|
+
const getPreviousFocusElement = (0, import_react13.useCallback)(() => {
|
|
6228
|
+
const elements = getFocusableElements();
|
|
6229
|
+
if (elements.length === 0) {
|
|
6230
|
+
return void 0;
|
|
6231
|
+
}
|
|
6232
|
+
let previousElement = elements[0];
|
|
6233
|
+
if (document.activeElement instanceof HTMLElement) {
|
|
6234
|
+
const currentIndex = elements.indexOf(document.activeElement);
|
|
6235
|
+
if (currentIndex === 0) {
|
|
6236
|
+
previousElement = elements[elements.length - 1];
|
|
6237
|
+
} else {
|
|
6238
|
+
previousElement = elements[currentIndex - 1];
|
|
6239
|
+
}
|
|
6240
|
+
}
|
|
6241
|
+
return previousElement;
|
|
6242
|
+
}, [getFocusableElements]);
|
|
6243
|
+
const focusPrevious = (0, import_react13.useCallback)(() => {
|
|
6244
|
+
const previousElement = getPreviousFocusElement();
|
|
6245
|
+
if (previousElement) previousElement.focus();
|
|
6246
|
+
}, [getPreviousFocusElement]);
|
|
6247
|
+
return {
|
|
6248
|
+
getFocusableElements,
|
|
6249
|
+
getNextFocusElement,
|
|
6250
|
+
getPreviousFocusElement,
|
|
6251
|
+
focusNext,
|
|
6252
|
+
focusPrevious
|
|
6253
|
+
};
|
|
6254
|
+
}
|
|
6255
|
+
|
|
6256
|
+
// src/hooks/useFocusOnceVisible.ts
|
|
6257
|
+
var import_react14 = __toESM(require("react"));
|
|
6258
|
+
var useFocusOnceVisible = (ref, disable = false) => {
|
|
6259
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react14.default.useState(false);
|
|
6260
|
+
(0, import_react14.useEffect)(() => {
|
|
6261
|
+
if (disable || hasUsedFocus) {
|
|
6262
|
+
return;
|
|
6263
|
+
}
|
|
6264
|
+
const observer = new IntersectionObserver(([entry]) => {
|
|
6265
|
+
if (entry.isIntersecting && !hasUsedFocus) {
|
|
6266
|
+
ref.current?.focus();
|
|
6267
|
+
setHasUsedFocus(hasUsedFocus);
|
|
6268
|
+
}
|
|
6269
|
+
}, {
|
|
6270
|
+
threshold: 0.1
|
|
6271
|
+
});
|
|
6272
|
+
if (ref.current) {
|
|
6273
|
+
observer.observe(ref.current);
|
|
6274
|
+
}
|
|
6275
|
+
return () => observer.disconnect();
|
|
6276
|
+
}, [disable, hasUsedFocus, ref]);
|
|
6196
6277
|
};
|
|
6197
6278
|
|
|
6198
6279
|
// src/components/user-action/Input.tsx
|
|
6199
|
-
var
|
|
6200
|
-
var
|
|
6280
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
6281
|
+
var getInputClassName = ({ disabled = false, hasError = false }) => {
|
|
6282
|
+
return (0, import_clsx22.default)(
|
|
6283
|
+
"px-2 py-1.5 rounded-md border-2",
|
|
6284
|
+
{
|
|
6285
|
+
"bg-surface text-on-surface hover:border-primary focus:border-primary": !disabled && !hasError,
|
|
6286
|
+
"bg-on-negative text-negative border-negative-border hover:border-negative-border-hover": !disabled && hasError,
|
|
6287
|
+
"bg-disabled-background text-disabled-text border-disabled-border": disabled
|
|
6288
|
+
}
|
|
6289
|
+
);
|
|
6290
|
+
};
|
|
6291
|
+
var defaultEditCompleteOptions = {
|
|
6292
|
+
onBlur: true,
|
|
6293
|
+
afterDelay: true,
|
|
6294
|
+
delay: 2500
|
|
6295
|
+
};
|
|
6296
|
+
var Input = (0, import_react15.forwardRef)(function Input2({
|
|
6201
6297
|
id,
|
|
6202
6298
|
type = "text",
|
|
6203
6299
|
value,
|
|
@@ -6206,76 +6302,94 @@ var Input = ({
|
|
|
6206
6302
|
onChangeText = noop,
|
|
6207
6303
|
onEditCompleted,
|
|
6208
6304
|
className = "",
|
|
6305
|
+
allowEnterComplete = true,
|
|
6209
6306
|
expanded = true,
|
|
6210
|
-
autoFocus,
|
|
6307
|
+
autoFocus = false,
|
|
6211
6308
|
onBlur,
|
|
6309
|
+
editCompleteOptions,
|
|
6212
6310
|
containerClassName,
|
|
6311
|
+
disabled,
|
|
6213
6312
|
...restProps
|
|
6214
|
-
})
|
|
6313
|
+
}, forwardedRef) {
|
|
6314
|
+
const { onBlur: allowEditCompleteOnBlur, afterDelay, delay } = { ...defaultEditCompleteOptions, ...editCompleteOptions };
|
|
6215
6315
|
const {
|
|
6216
6316
|
restartTimer,
|
|
6217
|
-
|
|
6218
|
-
} =
|
|
6219
|
-
const
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6317
|
+
clearTimer
|
|
6318
|
+
} = useDelay({ delay, disabled: !afterDelay });
|
|
6319
|
+
const innerRef = (0, import_react15.useRef)(null);
|
|
6320
|
+
const { focusNext } = useFocusManagement();
|
|
6321
|
+
useFocusOnceVisible(innerRef, !autoFocus);
|
|
6322
|
+
(0, import_react15.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
6323
|
+
const handleKeyDown = (e) => {
|
|
6324
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
6325
|
+
e.preventDefault();
|
|
6326
|
+
innerRef.current?.blur();
|
|
6327
|
+
focusNext();
|
|
6223
6328
|
}
|
|
6224
|
-
}
|
|
6225
|
-
return /* @__PURE__ */ (0,
|
|
6226
|
-
label && /* @__PURE__ */ (0,
|
|
6227
|
-
/* @__PURE__ */ (0,
|
|
6329
|
+
};
|
|
6330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: (0, import_clsx22.default)({ "w-full": expanded }, containerClassName), children: [
|
|
6331
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Label, { ...label, htmlFor: id, className: (0, import_clsx22.default)("mb-1", label.className) }),
|
|
6332
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
6228
6333
|
"input",
|
|
6229
6334
|
{
|
|
6230
|
-
|
|
6335
|
+
...restProps,
|
|
6336
|
+
ref: innerRef,
|
|
6231
6337
|
value,
|
|
6232
6338
|
id,
|
|
6233
6339
|
type,
|
|
6234
|
-
|
|
6340
|
+
disabled,
|
|
6341
|
+
className: (0, import_clsx22.default)(getInputClassName({ disabled }), className),
|
|
6342
|
+
onKeyDown: allowEnterComplete ? handleKeyDown : void 0,
|
|
6235
6343
|
onBlur: (event) => {
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
}
|
|
6239
|
-
if (onEditCompleted) {
|
|
6344
|
+
onBlur?.(event);
|
|
6345
|
+
if (onEditCompleted && allowEditCompleteOnBlur) {
|
|
6240
6346
|
onEditCompleted(event.target.value);
|
|
6241
|
-
|
|
6347
|
+
clearTimer();
|
|
6242
6348
|
}
|
|
6243
6349
|
},
|
|
6244
6350
|
onChange: (e) => {
|
|
6245
6351
|
const value2 = e.target.value;
|
|
6246
6352
|
if (onEditCompleted) {
|
|
6247
6353
|
restartTimer(() => {
|
|
6248
|
-
|
|
6249
|
-
|
|
6354
|
+
if (innerRef.current) {
|
|
6355
|
+
innerRef.current.blur();
|
|
6356
|
+
if (!allowEditCompleteOnBlur) {
|
|
6357
|
+
onEditCompleted(value2);
|
|
6358
|
+
}
|
|
6359
|
+
} else {
|
|
6360
|
+
onEditCompleted(value2);
|
|
6361
|
+
}
|
|
6250
6362
|
});
|
|
6251
6363
|
}
|
|
6252
6364
|
onChange(e);
|
|
6253
6365
|
onChangeText(value2);
|
|
6254
|
-
}
|
|
6255
|
-
...restProps
|
|
6366
|
+
}
|
|
6256
6367
|
}
|
|
6257
6368
|
)
|
|
6258
6369
|
] });
|
|
6259
|
-
};
|
|
6370
|
+
});
|
|
6260
6371
|
var InputUncontrolled = ({
|
|
6261
|
-
|
|
6372
|
+
value = "",
|
|
6262
6373
|
onChangeText = noop,
|
|
6263
6374
|
...props
|
|
6264
6375
|
}) => {
|
|
6265
|
-
const [
|
|
6266
|
-
|
|
6376
|
+
const [usedValue, setUsedValue] = (0, import_react15.useState)(value);
|
|
6377
|
+
(0, import_react15.useEffect)(() => {
|
|
6378
|
+
setUsedValue(value);
|
|
6379
|
+
}, [value]);
|
|
6380
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
6267
6381
|
Input,
|
|
6268
6382
|
{
|
|
6269
6383
|
...props,
|
|
6270
|
-
value,
|
|
6384
|
+
value: usedValue,
|
|
6271
6385
|
onChangeText: (text) => {
|
|
6272
|
-
|
|
6386
|
+
setUsedValue(text);
|
|
6273
6387
|
onChangeText(text);
|
|
6274
6388
|
}
|
|
6275
6389
|
}
|
|
6276
6390
|
);
|
|
6277
6391
|
};
|
|
6278
|
-
var FormInput = (0,
|
|
6392
|
+
var FormInput = (0, import_react15.forwardRef)(function FormInput2({
|
|
6279
6393
|
id,
|
|
6280
6394
|
labelText,
|
|
6281
6395
|
errorText,
|
|
@@ -6284,35 +6398,107 @@ var FormInput = (0, import_react13.forwardRef)(function FormInput2({
|
|
|
6284
6398
|
errorClassName,
|
|
6285
6399
|
containerClassName,
|
|
6286
6400
|
required,
|
|
6401
|
+
disabled,
|
|
6287
6402
|
...restProps
|
|
6288
6403
|
}, ref) {
|
|
6289
|
-
const input = /* @__PURE__ */ (0,
|
|
6404
|
+
const input = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
6290
6405
|
"input",
|
|
6291
6406
|
{
|
|
6407
|
+
...restProps,
|
|
6292
6408
|
ref,
|
|
6293
6409
|
id,
|
|
6294
|
-
|
|
6295
|
-
className: (0,
|
|
6296
|
-
{
|
|
6297
|
-
"focus:border-primary focus:ring-primary": !errorText,
|
|
6298
|
-
"focus:border-negative focus:ring-negative text-negative": !!errorText
|
|
6299
|
-
},
|
|
6410
|
+
disabled,
|
|
6411
|
+
className: (0, import_clsx22.default)(
|
|
6412
|
+
getInputClassName({ disabled, hasError: !!errorText }),
|
|
6300
6413
|
className
|
|
6301
6414
|
)
|
|
6302
6415
|
}
|
|
6303
6416
|
);
|
|
6304
|
-
return /* @__PURE__ */ (0,
|
|
6305
|
-
labelText && /* @__PURE__ */ (0,
|
|
6417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: (0, import_clsx22.default)("flex flex-col gap-y-1", containerClassName), children: [
|
|
6418
|
+
labelText && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { htmlFor: id, className: (0, import_clsx22.default)("textstyle-label-md", labelClassName), children: [
|
|
6306
6419
|
labelText,
|
|
6307
|
-
required && /* @__PURE__ */ (0,
|
|
6420
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-primary font-bold", children: "*" })
|
|
6308
6421
|
] }),
|
|
6309
6422
|
input,
|
|
6310
|
-
errorText && /* @__PURE__ */ (0,
|
|
6423
|
+
errorText && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { htmlFor: id, className: (0, import_clsx22.default)("text-negative", errorClassName), children: errorText })
|
|
6311
6424
|
] });
|
|
6312
6425
|
});
|
|
6313
6426
|
|
|
6427
|
+
// src/components/layout-and-navigation/Pagination.tsx
|
|
6428
|
+
var import_react16 = require("react");
|
|
6429
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
6430
|
+
var Pagination = ({
|
|
6431
|
+
overwriteTranslation,
|
|
6432
|
+
pageIndex,
|
|
6433
|
+
pageCount,
|
|
6434
|
+
onPageChanged,
|
|
6435
|
+
className,
|
|
6436
|
+
style
|
|
6437
|
+
}) => {
|
|
6438
|
+
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
6439
|
+
const [value, setValue] = (0, import_react16.useState)((pageIndex + 1).toString());
|
|
6440
|
+
const noPages = pageCount === 0;
|
|
6441
|
+
const onFirstPage = pageIndex === 0 && !noPages;
|
|
6442
|
+
const onLastPage = pageIndex === pageCount - 1;
|
|
6443
|
+
(0, import_react16.useEffect)(() => {
|
|
6444
|
+
if (noPages) {
|
|
6445
|
+
setValue("0");
|
|
6446
|
+
} else {
|
|
6447
|
+
setValue((pageIndex + 1).toString());
|
|
6448
|
+
}
|
|
6449
|
+
}, [pageIndex, noPages]);
|
|
6450
|
+
const changePage = (page) => {
|
|
6451
|
+
onPageChanged(page);
|
|
6452
|
+
};
|
|
6453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: (0, import_clsx23.default)("row gap-x-1", className), style, children: [
|
|
6454
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { color: "transparent", onClick: () => changePage(0), disabled: onFirstPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react7.ChevronFirst, {}) }),
|
|
6455
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { color: "transparent", onClick: () => changePage(pageIndex - 1), disabled: onFirstPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react7.ChevronLeft, {}) }),
|
|
6456
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "row min-w-56 gap-x-2 items-center justify-center mx-2 text-center", children: [
|
|
6457
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
6458
|
+
Input,
|
|
6459
|
+
{
|
|
6460
|
+
value,
|
|
6461
|
+
containerClassName: "flex flex-1 h-10",
|
|
6462
|
+
className: (0, import_clsx23.default)(
|
|
6463
|
+
"w-full text-center font-bold input-indicator-hidden"
|
|
6464
|
+
),
|
|
6465
|
+
type: "number",
|
|
6466
|
+
min: 1,
|
|
6467
|
+
max: pageCount,
|
|
6468
|
+
disabled: noPages,
|
|
6469
|
+
onChangeText: (value2) => {
|
|
6470
|
+
if (value2) {
|
|
6471
|
+
setValue(clamp(Number(value2), 1, pageCount).toString());
|
|
6472
|
+
} else {
|
|
6473
|
+
setValue(value2);
|
|
6474
|
+
}
|
|
6475
|
+
},
|
|
6476
|
+
onEditCompleted: (value2) => {
|
|
6477
|
+
changePage(clamp(Number(value2) - 1, 0, pageCount - 1));
|
|
6478
|
+
},
|
|
6479
|
+
editCompleteOptions: { delay: 800 }
|
|
6480
|
+
}
|
|
6481
|
+
),
|
|
6482
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "select-none w-10", children: translation("of") }),
|
|
6483
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
6484
|
+
"span",
|
|
6485
|
+
{
|
|
6486
|
+
className: "row flex-1 items-center justify-center select-none h-10 bg-surface text-on-surface rounded-md font-bold",
|
|
6487
|
+
children: pageCount
|
|
6488
|
+
}
|
|
6489
|
+
)
|
|
6490
|
+
] }),
|
|
6491
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { color: "transparent", onClick: () => changePage(pageIndex + 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react7.ChevronRight, {}) }),
|
|
6492
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconButton, { color: "transparent", onClick: () => changePage(pageCount - 1), disabled: onLastPage || noPages, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react7.ChevronLast, {}) })
|
|
6493
|
+
] });
|
|
6494
|
+
};
|
|
6495
|
+
|
|
6496
|
+
// src/components/layout-and-navigation/SearchableList.tsx
|
|
6497
|
+
var import_lucide_react8 = require("lucide-react");
|
|
6498
|
+
var import_clsx24 = __toESM(require("clsx"));
|
|
6499
|
+
|
|
6314
6500
|
// src/hooks/useSearch.ts
|
|
6315
|
-
var
|
|
6501
|
+
var import_react17 = require("react");
|
|
6316
6502
|
|
|
6317
6503
|
// src/util/simpleSearch.ts
|
|
6318
6504
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -6343,12 +6529,12 @@ var useSearch = ({
|
|
|
6343
6529
|
initialSearch,
|
|
6344
6530
|
searchMapping
|
|
6345
6531
|
}) => {
|
|
6346
|
-
const [items, setItems] = (0,
|
|
6347
|
-
const [search, setSearch] = (0,
|
|
6348
|
-
(0,
|
|
6532
|
+
const [items, setItems] = (0, import_react17.useState)(list);
|
|
6533
|
+
const [search, setSearch] = (0, import_react17.useState)(initialSearch);
|
|
6534
|
+
(0, import_react17.useEffect)(() => {
|
|
6349
6535
|
setItems(list);
|
|
6350
6536
|
}, [list]);
|
|
6351
|
-
const result = (0,
|
|
6537
|
+
const result = (0, import_react17.useMemo)(
|
|
6352
6538
|
() => MultiSearchWithMapping(search, items, searchMapping),
|
|
6353
6539
|
[search, items, searchMapping]
|
|
6354
6540
|
);
|
|
@@ -6406,7 +6592,7 @@ var SearchableList = ({
|
|
|
6406
6592
|
// src/components/layout-and-navigation/StepperBar.tsx
|
|
6407
6593
|
var import_lucide_react9 = require("lucide-react");
|
|
6408
6594
|
var import_clsx25 = __toESM(require("clsx"));
|
|
6409
|
-
var
|
|
6595
|
+
var import_react18 = require("react");
|
|
6410
6596
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
6411
6597
|
var defaultState = {
|
|
6412
6598
|
currentStep: 0,
|
|
@@ -6424,7 +6610,7 @@ var StepperBar = ({
|
|
|
6424
6610
|
className = ""
|
|
6425
6611
|
}) => {
|
|
6426
6612
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
6427
|
-
const dots = range(
|
|
6613
|
+
const dots = range(numberOfSteps + 1);
|
|
6428
6614
|
const { currentStep, seenSteps } = state ?? defaultState;
|
|
6429
6615
|
const update = (newStep) => {
|
|
6430
6616
|
seenSteps.add(newStep);
|
|
@@ -6500,8 +6686,8 @@ var StepperBar = ({
|
|
|
6500
6686
|
);
|
|
6501
6687
|
};
|
|
6502
6688
|
var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
6503
|
-
const [usedState, setUsedState] = (0,
|
|
6504
|
-
(0,
|
|
6689
|
+
const [usedState, setUsedState] = (0, import_react18.useState)(state ?? defaultState);
|
|
6690
|
+
(0, import_react18.useEffect)(() => {
|
|
6505
6691
|
setUsedState(state ?? defaultState);
|
|
6506
6692
|
}, [state]);
|
|
6507
6693
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
@@ -6517,394 +6703,59 @@ var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
|
6517
6703
|
);
|
|
6518
6704
|
};
|
|
6519
6705
|
|
|
6520
|
-
// src/components/layout-and-navigation/
|
|
6521
|
-
var import_react17 = require("react");
|
|
6522
|
-
var import_react_custom_scrollbars_23 = require("react-custom-scrollbars-2");
|
|
6523
|
-
|
|
6524
|
-
// src/components/user-action/Checkbox.tsx
|
|
6525
|
-
var import_react16 = require("react");
|
|
6526
|
-
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
6527
|
-
var import_lucide_react10 = require("lucide-react");
|
|
6706
|
+
// src/components/layout-and-navigation/TextImage.tsx
|
|
6528
6707
|
var import_clsx26 = __toESM(require("clsx"));
|
|
6529
6708
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
6530
|
-
var
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
var Checkbox = ({
|
|
6541
|
-
id,
|
|
6542
|
-
label,
|
|
6543
|
-
checked,
|
|
6544
|
-
disabled,
|
|
6545
|
-
onChange,
|
|
6546
|
-
onChangeTristate,
|
|
6547
|
-
size = "medium",
|
|
6548
|
-
className = "",
|
|
6549
|
-
containerClassName
|
|
6709
|
+
var TextImage = ({
|
|
6710
|
+
overwriteTranslation,
|
|
6711
|
+
title,
|
|
6712
|
+
description,
|
|
6713
|
+
imageUrl,
|
|
6714
|
+
onShowMoreClicked,
|
|
6715
|
+
color = "primary",
|
|
6716
|
+
badge,
|
|
6717
|
+
contentClassName = "",
|
|
6718
|
+
className = ""
|
|
6550
6719
|
}) => {
|
|
6551
|
-
const
|
|
6552
|
-
const
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
}
|
|
6557
|
-
if (onChange) {
|
|
6558
|
-
onChange(checked2 === "indeterminate" ? false : checked2);
|
|
6559
|
-
}
|
|
6560
|
-
};
|
|
6561
|
-
const changeValue = () => {
|
|
6562
|
-
const newValue = checked === "indeterminate" ? false : !checked;
|
|
6563
|
-
propagateChange(newValue);
|
|
6720
|
+
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
6721
|
+
const chipColorMapping = {
|
|
6722
|
+
primary: "text-text-image-primary-background bg-text-image-primary-text",
|
|
6723
|
+
secondary: "text-text-image-secondary-background bg-text-image-secondary-text",
|
|
6724
|
+
dark: "text-text-image-dark-background bg-text-image-dark-text"
|
|
6564
6725
|
};
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
onCheckedChange: propagateChange,
|
|
6570
|
-
checked,
|
|
6571
|
-
disabled,
|
|
6572
|
-
id,
|
|
6573
|
-
className: (0, import_clsx26.default)(usedSizeClass, `items-center border-2 rounded outline-none focus:border-primary`, {
|
|
6574
|
-
"text-disabled-text border-disabled-text bg-disabled-background": disabled,
|
|
6575
|
-
"bg-surface": !disabled && !checked,
|
|
6576
|
-
"bg-primary/30 border-primary text-primary": checked === true || checked === "indeterminate",
|
|
6577
|
-
"hover:border-primary focus:hover:border-primary": !checked
|
|
6578
|
-
}, className),
|
|
6579
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(CheckboxPrimitive.Indicator, { children: [
|
|
6580
|
-
checked === true && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react10.Check, { className: innerIconSize }),
|
|
6581
|
-
checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react10.Minus, { className: innerIconSize })
|
|
6582
|
-
] })
|
|
6583
|
-
}
|
|
6584
|
-
),
|
|
6585
|
-
label && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6586
|
-
Label,
|
|
6587
|
-
{
|
|
6588
|
-
...label,
|
|
6589
|
-
className: (0, import_clsx26.default)("cursor-pointer", label.className),
|
|
6590
|
-
htmlFor: id,
|
|
6591
|
-
onClick: changeValue
|
|
6592
|
-
}
|
|
6593
|
-
)
|
|
6594
|
-
] });
|
|
6595
|
-
};
|
|
6596
|
-
var CheckboxUncontrolled = ({
|
|
6597
|
-
onChange,
|
|
6598
|
-
onChangeTristate,
|
|
6599
|
-
defaultValue = false,
|
|
6600
|
-
...props
|
|
6601
|
-
}) => {
|
|
6602
|
-
const [checked, setChecked] = (0, import_react16.useState)(defaultValue);
|
|
6603
|
-
const handleChange = (checked2) => {
|
|
6604
|
-
if (onChangeTristate) {
|
|
6605
|
-
onChangeTristate(checked2);
|
|
6606
|
-
}
|
|
6607
|
-
if (onChange) {
|
|
6608
|
-
onChange(checked2 === "indeterminate" ? false : checked2);
|
|
6609
|
-
}
|
|
6610
|
-
setChecked(checked2);
|
|
6726
|
+
const colorMapping = {
|
|
6727
|
+
primary: "text-text-image-primary-text bg-linear-to-r from-30% from-text-image-primary-background to-text-image-primary-background/55",
|
|
6728
|
+
secondary: "text-text-image-secondary-text bg-linear-to-r from-30% from-text-image-secondary-background to-text-image-secondary-background/55",
|
|
6729
|
+
dark: "text-text-image-dark-text bg-linear-to-r from-30% from-text-image-dark-background to-text-image-dark-background/55"
|
|
6611
6730
|
};
|
|
6612
6731
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
6613
|
-
|
|
6732
|
+
"div",
|
|
6614
6733
|
{
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6734
|
+
className: (0, import_clsx26.default)("rounded-2xl w-full", className),
|
|
6735
|
+
style: {
|
|
6736
|
+
backgroundImage: `url(${imageUrl})`,
|
|
6737
|
+
backgroundSize: "cover"
|
|
6738
|
+
},
|
|
6739
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
6740
|
+
"div",
|
|
6741
|
+
{
|
|
6742
|
+
className: (0, import_clsx26.default)(`col px-6 py-12 rounded-2xl h-full`, colorMapping[color], contentClassName),
|
|
6743
|
+
children: [
|
|
6744
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: (0, import_clsx26.default)(`chip-full mb-2 py-2 px-4 w-fit`, chipColorMapping[color]), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-lg font-bold", children: badge }) }),
|
|
6745
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "col gap-y-1 overflow-hidden", children: [
|
|
6746
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "textstyle-title-xl", children: title }),
|
|
6747
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-ellipsis overflow-hidden", children: description })
|
|
6748
|
+
] }),
|
|
6749
|
+
onShowMoreClicked && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "row mt-2 underline", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("button", { onClick: onShowMoreClicked, children: translation("showMore") }) })
|
|
6750
|
+
]
|
|
6751
|
+
}
|
|
6752
|
+
)
|
|
6618
6753
|
}
|
|
6619
6754
|
);
|
|
6620
6755
|
};
|
|
6621
6756
|
|
|
6622
|
-
// src/components/layout-and-navigation/
|
|
6623
|
-
var import_clsx27 = __toESM(require("clsx"));
|
|
6624
|
-
var import_lucide_react11 = require("lucide-react");
|
|
6757
|
+
// src/components/layout-and-navigation/VerticalDivider.tsx
|
|
6625
6758
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
6626
|
-
var defaultTableStatePagination = {
|
|
6627
|
-
currentPage: 0,
|
|
6628
|
-
entriesPerPage: 5
|
|
6629
|
-
};
|
|
6630
|
-
var defaultTableStateSelection = {
|
|
6631
|
-
currentSelection: [],
|
|
6632
|
-
hasSelectedAll: false,
|
|
6633
|
-
hasSelectedSome: false,
|
|
6634
|
-
hasSelectedNone: true
|
|
6635
|
-
};
|
|
6636
|
-
var isDataObjectSelected = (tableState, dataObject, identifierMapping) => {
|
|
6637
|
-
if (!tableState.selection) {
|
|
6638
|
-
return false;
|
|
6639
|
-
}
|
|
6640
|
-
return !!tableState.selection.currentSelection.find((value) => value.localeCompare(identifierMapping(dataObject)) === 0);
|
|
6641
|
-
};
|
|
6642
|
-
var pageForItem = (data, item, entriesPerPage, identifierMapping) => {
|
|
6643
|
-
const index = data.findIndex((value) => identifierMapping(value) === identifierMapping(item));
|
|
6644
|
-
if (index !== -1) {
|
|
6645
|
-
return Math.floor(index / entriesPerPage);
|
|
6646
|
-
}
|
|
6647
|
-
console.warn("item doesn't exist on data", item, data);
|
|
6648
|
-
return 0;
|
|
6649
|
-
};
|
|
6650
|
-
var updatePagination = (pagination, dataLength) => ({
|
|
6651
|
-
...pagination,
|
|
6652
|
-
currentPage: Math.min(Math.max(Math.ceil(dataLength / pagination.entriesPerPage) - 1, 0), pagination.currentPage)
|
|
6653
|
-
});
|
|
6654
|
-
var addElementToTable = (tableState, data, dataObject, identifierMapping) => {
|
|
6655
|
-
return {
|
|
6656
|
-
...tableState,
|
|
6657
|
-
pagination: tableState.pagination ? {
|
|
6658
|
-
...tableState.pagination,
|
|
6659
|
-
currentPage: pageForItem(data, dataObject, tableState.pagination.entriesPerPage, identifierMapping)
|
|
6660
|
-
} : void 0,
|
|
6661
|
-
selection: tableState.selection ? {
|
|
6662
|
-
...tableState.selection,
|
|
6663
|
-
hasSelectedAll: false,
|
|
6664
|
-
hasSelectedSome: tableState.selection.hasSelectedAll || tableState.selection.hasSelectedSome
|
|
6665
|
-
} : void 0
|
|
6666
|
-
};
|
|
6667
|
-
};
|
|
6668
|
-
var removeFromTableSelection = (tableState, deletedObjects, dataLength, identifierMapping) => {
|
|
6669
|
-
if (!tableState.selection) {
|
|
6670
|
-
return tableState;
|
|
6671
|
-
}
|
|
6672
|
-
const deletedObjectIds = deletedObjects.map(identifierMapping);
|
|
6673
|
-
const elementsBefore = tableState.selection.currentSelection.length;
|
|
6674
|
-
const currentSelection = tableState.selection.currentSelection.filter((value) => !deletedObjectIds.includes(value));
|
|
6675
|
-
dataLength -= elementsBefore - currentSelection.length;
|
|
6676
|
-
return {
|
|
6677
|
-
...tableState,
|
|
6678
|
-
selection: {
|
|
6679
|
-
currentSelection,
|
|
6680
|
-
hasSelectedAll: currentSelection.length === dataLength && dataLength !== 0,
|
|
6681
|
-
hasSelectedSome: currentSelection.length > 0 && currentSelection.length !== dataLength,
|
|
6682
|
-
hasSelectedNone: currentSelection.length === 0
|
|
6683
|
-
},
|
|
6684
|
-
pagination: tableState.pagination ? updatePagination(tableState.pagination, dataLength) : void 0
|
|
6685
|
-
};
|
|
6686
|
-
};
|
|
6687
|
-
var changeTableSelectionSingle = (tableState, dataObject, dataLength, identifierMapping) => {
|
|
6688
|
-
if (!tableState.selection) {
|
|
6689
|
-
return tableState;
|
|
6690
|
-
}
|
|
6691
|
-
const hasSelectedObject = isDataObjectSelected(tableState, dataObject, identifierMapping);
|
|
6692
|
-
let currentSelection = [...tableState.selection.currentSelection, identifierMapping(dataObject)];
|
|
6693
|
-
if (hasSelectedObject) {
|
|
6694
|
-
currentSelection = tableState.selection.currentSelection.filter((value) => value.localeCompare(identifierMapping(dataObject)) !== 0);
|
|
6695
|
-
}
|
|
6696
|
-
return {
|
|
6697
|
-
...tableState,
|
|
6698
|
-
selection: {
|
|
6699
|
-
currentSelection,
|
|
6700
|
-
hasSelectedAll: currentSelection.length === dataLength,
|
|
6701
|
-
hasSelectedSome: currentSelection.length > 0 && currentSelection.length !== dataLength,
|
|
6702
|
-
hasSelectedNone: currentSelection.length === 0
|
|
6703
|
-
}
|
|
6704
|
-
};
|
|
6705
|
-
};
|
|
6706
|
-
var changeTableSelectionAll = (tableState, data, identifierMapping) => {
|
|
6707
|
-
if (!tableState.selection) {
|
|
6708
|
-
return tableState;
|
|
6709
|
-
}
|
|
6710
|
-
if (data.length === 0) {
|
|
6711
|
-
return {
|
|
6712
|
-
...tableState,
|
|
6713
|
-
selection: {
|
|
6714
|
-
currentSelection: [],
|
|
6715
|
-
hasSelectedAll: false,
|
|
6716
|
-
hasSelectedSome: false,
|
|
6717
|
-
hasSelectedNone: true
|
|
6718
|
-
}
|
|
6719
|
-
};
|
|
6720
|
-
}
|
|
6721
|
-
const hasSelectedAll = !(tableState.selection.hasSelectedSome || tableState.selection.hasSelectedAll);
|
|
6722
|
-
return {
|
|
6723
|
-
...tableState,
|
|
6724
|
-
selection: {
|
|
6725
|
-
currentSelection: hasSelectedAll ? data.map(identifierMapping) : [],
|
|
6726
|
-
hasSelectedAll,
|
|
6727
|
-
hasSelectedSome: false,
|
|
6728
|
-
hasSelectedNone: !hasSelectedAll
|
|
6729
|
-
}
|
|
6730
|
-
};
|
|
6731
|
-
};
|
|
6732
|
-
var Table = ({
|
|
6733
|
-
data,
|
|
6734
|
-
stateManagement = [{}, noop],
|
|
6735
|
-
identifierMapping,
|
|
6736
|
-
header,
|
|
6737
|
-
rowMappingToCells,
|
|
6738
|
-
sorting,
|
|
6739
|
-
focusElement,
|
|
6740
|
-
className
|
|
6741
|
-
}) => {
|
|
6742
|
-
const sortedData = [...data];
|
|
6743
|
-
if (sorting) {
|
|
6744
|
-
const [sortingFunction, sortingType] = sorting;
|
|
6745
|
-
sortedData.sort((a, b) => sortingFunction(a, b) * (sortingType === "ascending" ? 1 : -1));
|
|
6746
|
-
}
|
|
6747
|
-
let currentPage = 0;
|
|
6748
|
-
let pageCount = 1;
|
|
6749
|
-
let entriesPerPage = 5;
|
|
6750
|
-
const [tableState, updateTableState] = stateManagement;
|
|
6751
|
-
let shownElements = sortedData;
|
|
6752
|
-
if (tableState?.pagination) {
|
|
6753
|
-
if (tableState.pagination.entriesPerPage < 1) {
|
|
6754
|
-
console.error("tableState.pagination.entriesPerPage must be >= 1", tableState.pagination.entriesPerPage);
|
|
6755
|
-
}
|
|
6756
|
-
entriesPerPage = Math.max(1, tableState.pagination.entriesPerPage);
|
|
6757
|
-
pageCount = Math.ceil(sortedData.length / entriesPerPage);
|
|
6758
|
-
if (tableState.pagination.currentPage < 0 || tableState.pagination.currentPage >= pageCount && pageCount !== 0) {
|
|
6759
|
-
console.error(
|
|
6760
|
-
"tableState.pagination.currentPage < 0 || (tableState.pagination.currentPage >= pageCount && pageCount !== 0) must be fullfilled",
|
|
6761
|
-
[`pageCount: ${pageCount}`, `tableState.pagination.currentPage: ${tableState.pagination.currentPage}`]
|
|
6762
|
-
);
|
|
6763
|
-
} else {
|
|
6764
|
-
currentPage = tableState.pagination.currentPage;
|
|
6765
|
-
}
|
|
6766
|
-
if (focusElement) {
|
|
6767
|
-
currentPage = pageForItem(sortedData, focusElement, entriesPerPage, identifierMapping);
|
|
6768
|
-
}
|
|
6769
|
-
shownElements = sortedData.slice(currentPage * entriesPerPage, Math.min(sortedData.length, (currentPage + 1) * entriesPerPage));
|
|
6770
|
-
} else {
|
|
6771
|
-
currentPage = 0;
|
|
6772
|
-
}
|
|
6773
|
-
const headerRow = "border-b-2";
|
|
6774
|
-
const headerPaddingHead = "pb-2";
|
|
6775
|
-
const headerPaddingBody = "pt-2";
|
|
6776
|
-
const cellPadding = "py-1 px-2";
|
|
6777
|
-
const [scrollbarsAutoHeightMin, setScrollbarsAutoHeightMin] = (0, import_react17.useState)(0);
|
|
6778
|
-
const tableRef = (0, import_react17.useRef)(null);
|
|
6779
|
-
const calculateHeight = () => {
|
|
6780
|
-
if (tableRef.current) {
|
|
6781
|
-
const tableHeight = tableRef.current.offsetHeight;
|
|
6782
|
-
const offset = 25;
|
|
6783
|
-
setScrollbarsAutoHeightMin(tableHeight + offset);
|
|
6784
|
-
}
|
|
6785
|
-
};
|
|
6786
|
-
(0, import_react17.useEffect)(() => {
|
|
6787
|
-
calculateHeight();
|
|
6788
|
-
const handleResize = () => {
|
|
6789
|
-
calculateHeight();
|
|
6790
|
-
};
|
|
6791
|
-
window.addEventListener("resize", handleResize);
|
|
6792
|
-
return () => {
|
|
6793
|
-
window.removeEventListener("resize", handleResize);
|
|
6794
|
-
};
|
|
6795
|
-
}, [data, currentPage]);
|
|
6796
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0, import_clsx27.default)("col gap-y-4 overflow-hidden", className), children: [
|
|
6797
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_custom_scrollbars_23.Scrollbars, { autoHeight: true, autoHeightMin: scrollbarsAutoHeightMin, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("table", { ref: tableRef, className: "w-full mb-[12px]", children: [
|
|
6798
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("tr", { className: headerRow, children: [
|
|
6799
|
-
header && tableState.selection && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("th", { className: headerPaddingHead, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6800
|
-
Checkbox,
|
|
6801
|
-
{
|
|
6802
|
-
checked: tableState.selection.hasSelectedSome ? "indeterminate" : tableState.selection.hasSelectedAll,
|
|
6803
|
-
onChange: () => updateTableState(changeTableSelectionAll(tableState, data, identifierMapping))
|
|
6804
|
-
}
|
|
6805
|
-
) }),
|
|
6806
|
-
header && header.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("th", { className: headerPaddingHead, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "row justify-start px-2", children: value }) }, `tableHeader${index}`))
|
|
6807
|
-
] }) }),
|
|
6808
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("tbody", { children: shownElements.map((value, rowIndex) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("tr", { children: [
|
|
6809
|
-
tableState.selection && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("td", { className: (0, import_clsx27.default)(cellPadding, { [headerPaddingBody]: rowIndex === 0 }), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6810
|
-
Checkbox,
|
|
6811
|
-
{
|
|
6812
|
-
checked: isDataObjectSelected(tableState, value, identifierMapping),
|
|
6813
|
-
onChange: () => {
|
|
6814
|
-
updateTableState(changeTableSelectionSingle(tableState, value, data.length, identifierMapping));
|
|
6815
|
-
}
|
|
6816
|
-
}
|
|
6817
|
-
) }),
|
|
6818
|
-
rowMappingToCells(value).map((value1, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6819
|
-
"td",
|
|
6820
|
-
{
|
|
6821
|
-
className: (0, import_clsx27.default)(cellPadding, { [headerPaddingBody]: rowIndex === 0 }),
|
|
6822
|
-
children: value1
|
|
6823
|
-
},
|
|
6824
|
-
index
|
|
6825
|
-
))
|
|
6826
|
-
] }, identifierMapping(value))) })
|
|
6827
|
-
] }) }) }),
|
|
6828
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "row justify-center", children: tableState.pagination && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Pagination, { page: currentPage, numberOfPages: pageCount, onPageChanged: (page) => updateTableState({
|
|
6829
|
-
...tableState,
|
|
6830
|
-
pagination: { entriesPerPage, currentPage: page }
|
|
6831
|
-
}) }) })
|
|
6832
|
-
] });
|
|
6833
|
-
};
|
|
6834
|
-
var SortButton = ({
|
|
6835
|
-
children,
|
|
6836
|
-
ascending,
|
|
6837
|
-
color,
|
|
6838
|
-
onClick,
|
|
6839
|
-
...buttonProps
|
|
6840
|
-
}) => {
|
|
6841
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6842
|
-
TextButton,
|
|
6843
|
-
{
|
|
6844
|
-
color,
|
|
6845
|
-
onClick: () => onClick(ascending === "descending" ? "ascending" : "descending"),
|
|
6846
|
-
...buttonProps,
|
|
6847
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "row gap-x-2", children: [
|
|
6848
|
-
children,
|
|
6849
|
-
ascending === "ascending" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react11.ChevronUp, {}) : !ascending ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react11.ChevronsUpDown, {}) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react11.ChevronDown, {})
|
|
6850
|
-
] })
|
|
6851
|
-
}
|
|
6852
|
-
);
|
|
6853
|
-
};
|
|
6854
|
-
|
|
6855
|
-
// src/components/layout-and-navigation/TextImage.tsx
|
|
6856
|
-
var import_clsx28 = __toESM(require("clsx"));
|
|
6857
|
-
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
6858
|
-
var TextImage = ({
|
|
6859
|
-
overwriteTranslation,
|
|
6860
|
-
title,
|
|
6861
|
-
description,
|
|
6862
|
-
imageUrl,
|
|
6863
|
-
onShowMoreClicked,
|
|
6864
|
-
color = "primary",
|
|
6865
|
-
badge,
|
|
6866
|
-
contentClassName = "",
|
|
6867
|
-
className = ""
|
|
6868
|
-
}) => {
|
|
6869
|
-
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
6870
|
-
const chipColorMapping = {
|
|
6871
|
-
primary: "text-text-image-primary-background bg-text-image-primary-text",
|
|
6872
|
-
secondary: "text-text-image-secondary-background bg-text-image-secondary-text",
|
|
6873
|
-
dark: "text-text-image-dark-background bg-text-image-dark-text"
|
|
6874
|
-
};
|
|
6875
|
-
const colorMapping = {
|
|
6876
|
-
primary: "text-text-image-primary-text bg-linear-to-r from-30% from-text-image-primary-background to-text-image-primary-background/55",
|
|
6877
|
-
secondary: "text-text-image-secondary-text bg-linear-to-r from-30% from-text-image-secondary-background to-text-image-secondary-background/55",
|
|
6878
|
-
dark: "text-text-image-dark-text bg-linear-to-r from-30% from-text-image-dark-background to-text-image-dark-background/55"
|
|
6879
|
-
};
|
|
6880
|
-
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
6881
|
-
"div",
|
|
6882
|
-
{
|
|
6883
|
-
className: (0, import_clsx28.default)("rounded-2xl w-full", className),
|
|
6884
|
-
style: {
|
|
6885
|
-
backgroundImage: `url(${imageUrl})`,
|
|
6886
|
-
backgroundSize: "cover"
|
|
6887
|
-
},
|
|
6888
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
6889
|
-
"div",
|
|
6890
|
-
{
|
|
6891
|
-
className: (0, import_clsx28.default)(`col px-6 py-12 rounded-2xl h-full`, colorMapping[color], contentClassName),
|
|
6892
|
-
children: [
|
|
6893
|
-
badge && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: (0, import_clsx28.default)(`chip-full mb-2 py-2 px-4 w-fit`, chipColorMapping[color]), children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-lg font-bold", children: badge }) }),
|
|
6894
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "col gap-y-1 overflow-hidden", children: [
|
|
6895
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "textstyle-title-xl", children: title }),
|
|
6896
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-ellipsis overflow-hidden", children: description })
|
|
6897
|
-
] }),
|
|
6898
|
-
onShowMoreClicked && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "row mt-2 underline", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("button", { onClick: onShowMoreClicked, children: translation("showMore") }) })
|
|
6899
|
-
]
|
|
6900
|
-
}
|
|
6901
|
-
)
|
|
6902
|
-
}
|
|
6903
|
-
);
|
|
6904
|
-
};
|
|
6905
|
-
|
|
6906
|
-
// src/components/layout-and-navigation/VerticalDivider.tsx
|
|
6907
|
-
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
6908
6759
|
var VerticalDivider = ({
|
|
6909
6760
|
width = 1,
|
|
6910
6761
|
height = 100,
|
|
@@ -6912,7 +6763,7 @@ var VerticalDivider = ({
|
|
|
6912
6763
|
dashGap = 4,
|
|
6913
6764
|
dashLength = 4
|
|
6914
6765
|
}) => {
|
|
6915
|
-
return /* @__PURE__ */ (0,
|
|
6766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { style: { width: width + "px", height: height + "px" }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
6916
6767
|
"svg",
|
|
6917
6768
|
{
|
|
6918
6769
|
width,
|
|
@@ -6921,7 +6772,7 @@ var VerticalDivider = ({
|
|
|
6921
6772
|
fill: "none",
|
|
6922
6773
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6923
6774
|
children: [
|
|
6924
|
-
/* @__PURE__ */ (0,
|
|
6775
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
6925
6776
|
"line",
|
|
6926
6777
|
{
|
|
6927
6778
|
opacity: "0.5",
|
|
@@ -6935,7 +6786,7 @@ var VerticalDivider = ({
|
|
|
6935
6786
|
strokeLinecap: "round"
|
|
6936
6787
|
}
|
|
6937
6788
|
),
|
|
6938
|
-
/* @__PURE__ */ (0,
|
|
6789
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("defs", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
6939
6790
|
"linearGradient",
|
|
6940
6791
|
{
|
|
6941
6792
|
id: "paint_linear",
|
|
@@ -6945,9 +6796,9 @@ var VerticalDivider = ({
|
|
|
6945
6796
|
y2: height,
|
|
6946
6797
|
gradientUnits: "userSpaceOnUse",
|
|
6947
6798
|
children: [
|
|
6948
|
-
/* @__PURE__ */ (0,
|
|
6949
|
-
/* @__PURE__ */ (0,
|
|
6950
|
-
/* @__PURE__ */ (0,
|
|
6799
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("stop", { stopOpacity: "0", stopColor: "currentColor" }),
|
|
6800
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("stop", { offset: "0.5", stopColor: "currentColor" }),
|
|
6801
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("stop", { offset: "1", stopColor: "currentColor", stopOpacity: "0" })
|
|
6951
6802
|
]
|
|
6952
6803
|
}
|
|
6953
6804
|
) })
|
|
@@ -6957,9 +6808,9 @@ var VerticalDivider = ({
|
|
|
6957
6808
|
};
|
|
6958
6809
|
|
|
6959
6810
|
// src/components/loading-states/ErrorComponent.tsx
|
|
6960
|
-
var
|
|
6961
|
-
var
|
|
6962
|
-
var
|
|
6811
|
+
var import_lucide_react10 = require("lucide-react");
|
|
6812
|
+
var import_clsx27 = __toESM(require("clsx"));
|
|
6813
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
6963
6814
|
var defaultErrorComponentTranslation = {
|
|
6964
6815
|
en: {
|
|
6965
6816
|
errorOccurred: "An error occurred"
|
|
@@ -6974,32 +6825,32 @@ var ErrorComponent = ({
|
|
|
6974
6825
|
classname
|
|
6975
6826
|
}) => {
|
|
6976
6827
|
const translation = useTranslation([defaultErrorComponentTranslation], overwriteTranslation);
|
|
6977
|
-
return /* @__PURE__ */ (0,
|
|
6978
|
-
/* @__PURE__ */ (0,
|
|
6828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: (0, import_clsx27.default)("col items-center justify-center gap-y-4 w-full h-24", classname), children: [
|
|
6829
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_lucide_react10.AlertOctagon, { size: 64, className: "text-warning" }),
|
|
6979
6830
|
errorText ?? `${translation("errorOccurred")} :(`
|
|
6980
6831
|
] });
|
|
6981
6832
|
};
|
|
6982
6833
|
|
|
6983
6834
|
// src/components/loading-states/LoadingAndErrorComponent.tsx
|
|
6984
|
-
var
|
|
6835
|
+
var import_react19 = require("react");
|
|
6985
6836
|
|
|
6986
6837
|
// src/components/loading-states/LoadingAnimation.tsx
|
|
6987
|
-
var
|
|
6988
|
-
var
|
|
6838
|
+
var import_clsx28 = __toESM(require("clsx"));
|
|
6839
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
6989
6840
|
var LoadingAnimation = ({
|
|
6990
6841
|
overwriteTranslation,
|
|
6991
6842
|
loadingText,
|
|
6992
6843
|
classname
|
|
6993
6844
|
}) => {
|
|
6994
6845
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
6995
|
-
return /* @__PURE__ */ (0,
|
|
6996
|
-
/* @__PURE__ */ (0,
|
|
6846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: (0, import_clsx28.default)("col items-center justify-center w-full h-24", classname), children: [
|
|
6847
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Helpwave, { animate: "loading" }),
|
|
6997
6848
|
loadingText ?? `${translation("loading")}...`
|
|
6998
6849
|
] });
|
|
6999
6850
|
};
|
|
7000
6851
|
|
|
7001
6852
|
// src/components/loading-states/LoadingAndErrorComponent.tsx
|
|
7002
|
-
var
|
|
6853
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
7003
6854
|
var LoadingAndErrorComponent = ({
|
|
7004
6855
|
children,
|
|
7005
6856
|
isLoading = false,
|
|
@@ -7008,8 +6859,8 @@ var LoadingAndErrorComponent = ({
|
|
|
7008
6859
|
loadingProps,
|
|
7009
6860
|
minimumLoadingDuration
|
|
7010
6861
|
}) => {
|
|
7011
|
-
const [isInMinimumLoading, setIsInMinimumLoading] = (0,
|
|
7012
|
-
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0,
|
|
6862
|
+
const [isInMinimumLoading, setIsInMinimumLoading] = (0, import_react19.useState)(false);
|
|
6863
|
+
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0, import_react19.useState)(false);
|
|
7013
6864
|
if (minimumLoadingDuration && !isInMinimumLoading && !hasUsedMinimumLoading) {
|
|
7014
6865
|
setIsInMinimumLoading(true);
|
|
7015
6866
|
setTimeout(() => {
|
|
@@ -7018,27 +6869,27 @@ var LoadingAndErrorComponent = ({
|
|
|
7018
6869
|
}, minimumLoadingDuration);
|
|
7019
6870
|
}
|
|
7020
6871
|
if (isLoading || minimumLoadingDuration && isInMinimumLoading) {
|
|
7021
|
-
return /* @__PURE__ */ (0,
|
|
6872
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LoadingAnimation, { ...loadingProps });
|
|
7022
6873
|
}
|
|
7023
6874
|
if (hasError) {
|
|
7024
|
-
return /* @__PURE__ */ (0,
|
|
6875
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ErrorComponent, { ...errorProps });
|
|
7025
6876
|
}
|
|
7026
6877
|
return children;
|
|
7027
6878
|
};
|
|
7028
6879
|
|
|
7029
6880
|
// src/components/loading-states/LoadingButton.tsx
|
|
7030
|
-
var
|
|
7031
|
-
var
|
|
6881
|
+
var import_clsx29 = __toESM(require("clsx"));
|
|
6882
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
7032
6883
|
var LoadingButton = ({ isLoading = false, size = "medium", onClick, ...rest }) => {
|
|
7033
6884
|
const paddingClass = ButtonUtil.paddingMapping[size];
|
|
7034
|
-
return /* @__PURE__ */ (0,
|
|
7035
|
-
isLoading && /* @__PURE__ */ (0,
|
|
7036
|
-
/* @__PURE__ */ (0,
|
|
6885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "inline-block relative", children: [
|
|
6886
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: (0, import_clsx29.default)("absolute inset-0 row items-center justify-center bg-white/40", paddingClass), children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Helpwave, { animate: "loading", className: "text-white" }) }),
|
|
6887
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SolidButton, { ...rest, disabled: rest.disabled, onClick: isLoading ? noop : onClick })
|
|
7037
6888
|
] });
|
|
7038
6889
|
};
|
|
7039
6890
|
|
|
7040
6891
|
// src/components/loading-states/ProgressIndicator.tsx
|
|
7041
|
-
var
|
|
6892
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
7042
6893
|
var sizeMapping = { small: 16, medium: 24, big: 48 };
|
|
7043
6894
|
var ProgressIndicator = ({
|
|
7044
6895
|
progress,
|
|
@@ -7055,7 +6906,7 @@ var ProgressIndicator = ({
|
|
|
7055
6906
|
if (direction === "clockwise") {
|
|
7056
6907
|
rotation += 360 * progress;
|
|
7057
6908
|
}
|
|
7058
|
-
return /* @__PURE__ */ (0,
|
|
6909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
7059
6910
|
"svg",
|
|
7060
6911
|
{
|
|
7061
6912
|
style: {
|
|
@@ -7064,7 +6915,7 @@ var ProgressIndicator = ({
|
|
|
7064
6915
|
transform: `rotate(${rotation}deg)`
|
|
7065
6916
|
},
|
|
7066
6917
|
children: [
|
|
7067
|
-
/* @__PURE__ */ (0,
|
|
6918
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7068
6919
|
"circle",
|
|
7069
6920
|
{
|
|
7070
6921
|
cx: center,
|
|
@@ -7075,7 +6926,7 @@ var ProgressIndicator = ({
|
|
|
7075
6926
|
className: "stroke-progress-indicator-fill"
|
|
7076
6927
|
}
|
|
7077
6928
|
),
|
|
7078
|
-
/* @__PURE__ */ (0,
|
|
6929
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
7079
6930
|
"circle",
|
|
7080
6931
|
{
|
|
7081
6932
|
cx: center,
|
|
@@ -7094,8 +6945,8 @@ var ProgressIndicator = ({
|
|
|
7094
6945
|
};
|
|
7095
6946
|
|
|
7096
6947
|
// src/components/modals/ConfirmModal.tsx
|
|
7097
|
-
var
|
|
7098
|
-
var
|
|
6948
|
+
var import_clsx30 = __toESM(require("clsx"));
|
|
6949
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
7099
6950
|
var ConfirmModal = ({
|
|
7100
6951
|
overwriteTranslation,
|
|
7101
6952
|
children,
|
|
@@ -7114,10 +6965,10 @@ var ConfirmModal = ({
|
|
|
7114
6965
|
positive: "positive",
|
|
7115
6966
|
primary: "primary"
|
|
7116
6967
|
};
|
|
7117
|
-
return /* @__PURE__ */ (0,
|
|
7118
|
-
/* @__PURE__ */ (0,
|
|
7119
|
-
/* @__PURE__ */ (0,
|
|
7120
|
-
onCancel && /* @__PURE__ */ (0,
|
|
6968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Modal, { ...restProps, onClose: onCancel, className: (0, import_clsx30.default)("justify-between", className), children: [
|
|
6969
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "col grow", children }),
|
|
6970
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "row mt-3 gap-x-4 justify-end", children: [
|
|
6971
|
+
onCancel && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7121
6972
|
SolidButton,
|
|
7122
6973
|
{
|
|
7123
6974
|
color: buttonOverwrites?.[0].color ?? "neutral",
|
|
@@ -7126,7 +6977,7 @@ var ConfirmModal = ({
|
|
|
7126
6977
|
children: buttonOverwrites?.[0].text ?? translation("cancel")
|
|
7127
6978
|
}
|
|
7128
6979
|
),
|
|
7129
|
-
onDecline && /* @__PURE__ */ (0,
|
|
6980
|
+
onDecline && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7130
6981
|
SolidButton,
|
|
7131
6982
|
{
|
|
7132
6983
|
color: buttonOverwrites?.[1].color ?? "negative",
|
|
@@ -7135,7 +6986,7 @@ var ConfirmModal = ({
|
|
|
7135
6986
|
children: buttonOverwrites?.[1].text ?? translation("decline")
|
|
7136
6987
|
}
|
|
7137
6988
|
),
|
|
7138
|
-
/* @__PURE__ */ (0,
|
|
6989
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
7139
6990
|
SolidButton,
|
|
7140
6991
|
{
|
|
7141
6992
|
autoFocus: true,
|
|
@@ -7150,7 +7001,7 @@ var ConfirmModal = ({
|
|
|
7150
7001
|
};
|
|
7151
7002
|
|
|
7152
7003
|
// src/components/modals/DiscardChangesModal.tsx
|
|
7153
|
-
var
|
|
7004
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
7154
7005
|
var DiscardChangesModal = ({
|
|
7155
7006
|
overwriteTranslation,
|
|
7156
7007
|
children,
|
|
@@ -7161,7 +7012,7 @@ var DiscardChangesModal = ({
|
|
|
7161
7012
|
...modalProps
|
|
7162
7013
|
}) => {
|
|
7163
7014
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
7164
|
-
return /* @__PURE__ */ (0,
|
|
7015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
7165
7016
|
ConfirmModal,
|
|
7166
7017
|
{
|
|
7167
7018
|
headerProps: {
|
|
@@ -7180,31 +7031,31 @@ var DiscardChangesModal = ({
|
|
|
7180
7031
|
};
|
|
7181
7032
|
|
|
7182
7033
|
// src/components/modals/InputModal.tsx
|
|
7183
|
-
var
|
|
7034
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
7184
7035
|
var InputModal = ({
|
|
7185
7036
|
inputs,
|
|
7186
7037
|
buttonOverwrites,
|
|
7187
7038
|
...restProps
|
|
7188
7039
|
}) => {
|
|
7189
|
-
return /* @__PURE__ */ (0,
|
|
7040
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
7190
7041
|
ConfirmModal,
|
|
7191
7042
|
{
|
|
7192
7043
|
buttonOverwrites,
|
|
7193
7044
|
...restProps,
|
|
7194
|
-
children: inputs.map((inputProps, index) => /* @__PURE__ */ (0,
|
|
7045
|
+
children: inputs.map((inputProps, index) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Input, { ...inputProps }, `input ${index}`))
|
|
7195
7046
|
}
|
|
7196
7047
|
);
|
|
7197
7048
|
};
|
|
7198
7049
|
|
|
7199
7050
|
// src/components/user-action/Select.tsx
|
|
7200
|
-
var
|
|
7201
|
-
var
|
|
7202
|
-
var
|
|
7051
|
+
var import_lucide_react11 = require("lucide-react");
|
|
7052
|
+
var import_react21 = require("react");
|
|
7053
|
+
var import_clsx31 = __toESM(require("clsx"));
|
|
7203
7054
|
|
|
7204
7055
|
// src/hooks/useOutsideClick.ts
|
|
7205
|
-
var
|
|
7056
|
+
var import_react20 = require("react");
|
|
7206
7057
|
var useOutsideClick = (refs, handler) => {
|
|
7207
|
-
(0,
|
|
7058
|
+
(0, import_react20.useEffect)(() => {
|
|
7208
7059
|
const listener = (event) => {
|
|
7209
7060
|
if (event.target === null) return;
|
|
7210
7061
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -7222,7 +7073,7 @@ var useOutsideClick = (refs, handler) => {
|
|
|
7222
7073
|
};
|
|
7223
7074
|
|
|
7224
7075
|
// src/components/user-action/Select.tsx
|
|
7225
|
-
var
|
|
7076
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
7226
7077
|
var Select = ({
|
|
7227
7078
|
value,
|
|
7228
7079
|
label,
|
|
@@ -7234,23 +7085,23 @@ var Select = ({
|
|
|
7234
7085
|
className,
|
|
7235
7086
|
selectedDisplayOverwrite
|
|
7236
7087
|
}) => {
|
|
7237
|
-
const triggerRef = (0,
|
|
7238
|
-
const menuRef = (0,
|
|
7239
|
-
const [isOpen, setIsOpen] = (0,
|
|
7088
|
+
const triggerRef = (0, import_react21.useRef)(null);
|
|
7089
|
+
const menuRef = (0, import_react21.useRef)(null);
|
|
7090
|
+
const [isOpen, setIsOpen] = (0, import_react21.useState)(false);
|
|
7240
7091
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
7241
7092
|
const selectedOption = options.find((option) => option.value === value);
|
|
7242
7093
|
if (value !== void 0 && selectedOption === void 0 && selectedDisplayOverwrite === void 0) {
|
|
7243
7094
|
console.warn("The selected value is not found in the options list. This might be an error on your part or default behavior if it is complex data type on which === does not work. In case of the latter use selectedDisplayOverwrite to set your selected text or component");
|
|
7244
7095
|
}
|
|
7245
7096
|
const isShowingHint = !selectedDisplayOverwrite && !selectedOption?.label;
|
|
7246
|
-
return /* @__PURE__ */ (0,
|
|
7247
|
-
label && /* @__PURE__ */ (0,
|
|
7248
|
-
/* @__PURE__ */ (0,
|
|
7249
|
-
/* @__PURE__ */ (0,
|
|
7097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: (0, import_clsx31.default)(className), children: [
|
|
7098
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Label, { ...label, labelType: label.labelType ?? "labelBig", className: (0, import_clsx31.default)("mb-1", label.className) }),
|
|
7099
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "relative", children: [
|
|
7100
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
7250
7101
|
"button",
|
|
7251
7102
|
{
|
|
7252
7103
|
ref: triggerRef,
|
|
7253
|
-
className: (0,
|
|
7104
|
+
className: (0, import_clsx31.default)(
|
|
7254
7105
|
"btn-md justify-between w-full border-2",
|
|
7255
7106
|
{
|
|
7256
7107
|
"rounded-b-lg": !open,
|
|
@@ -7261,24 +7112,24 @@ var Select = ({
|
|
|
7261
7112
|
onClick: () => setIsOpen(!isOpen),
|
|
7262
7113
|
disabled: isDisabled,
|
|
7263
7114
|
children: [
|
|
7264
|
-
!isShowingHint && /* @__PURE__ */ (0,
|
|
7265
|
-
isShowingHint && /* @__PURE__ */ (0,
|
|
7266
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
7115
|
+
!isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? selectedOption?.label }),
|
|
7116
|
+
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "textstyle-description", children: hintText }),
|
|
7117
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react11.ChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react11.ChevronDown, {})
|
|
7267
7118
|
]
|
|
7268
7119
|
}
|
|
7269
7120
|
),
|
|
7270
|
-
isOpen && /* @__PURE__ */ (0,
|
|
7121
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7271
7122
|
"div",
|
|
7272
7123
|
{
|
|
7273
7124
|
ref: menuRef,
|
|
7274
7125
|
className: "absolute w-full z-10 rounded-lg mt-0.5 bg-menu-background text-menu-text shadow-around-lg max-h-[500px] overflow-y-auto p-2",
|
|
7275
|
-
children: /* @__PURE__ */ (0,
|
|
7126
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7276
7127
|
SearchableList,
|
|
7277
7128
|
{
|
|
7278
7129
|
list: options,
|
|
7279
7130
|
minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
|
|
7280
7131
|
searchMapping: (item) => item.searchTags,
|
|
7281
|
-
itemMapper: (option, index) => /* @__PURE__ */ (0,
|
|
7132
|
+
itemMapper: (option, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7282
7133
|
Tile,
|
|
7283
7134
|
{
|
|
7284
7135
|
isSelected: selectedOption?.value === option.value,
|
|
@@ -7307,13 +7158,13 @@ var SelectUncontrolled = ({
|
|
|
7307
7158
|
hintText,
|
|
7308
7159
|
...props
|
|
7309
7160
|
}) => {
|
|
7310
|
-
const [selected, setSelected] = (0,
|
|
7311
|
-
(0,
|
|
7161
|
+
const [selected, setSelected] = (0, import_react21.useState)(value);
|
|
7162
|
+
(0, import_react21.useEffect)(() => {
|
|
7312
7163
|
if (options.find((options2) => options2.value === value)) {
|
|
7313
7164
|
setSelected(value);
|
|
7314
7165
|
}
|
|
7315
7166
|
}, [options, value]);
|
|
7316
|
-
return /* @__PURE__ */ (0,
|
|
7167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
7317
7168
|
Select,
|
|
7318
7169
|
{
|
|
7319
7170
|
value: selected,
|
|
@@ -7329,7 +7180,7 @@ var SelectUncontrolled = ({
|
|
|
7329
7180
|
};
|
|
7330
7181
|
|
|
7331
7182
|
// src/components/modals/LanguageModal.tsx
|
|
7332
|
-
var
|
|
7183
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
7333
7184
|
var defaultLanguageModalTranslation = {
|
|
7334
7185
|
en: {
|
|
7335
7186
|
language: "Language",
|
|
@@ -7352,7 +7203,7 @@ var LanguageModal = ({
|
|
|
7352
7203
|
}) => {
|
|
7353
7204
|
const { language, setLanguage } = useLanguage();
|
|
7354
7205
|
const translation = useTranslation([defaultLanguageModalTranslation], overwriteTranslation);
|
|
7355
|
-
return /* @__PURE__ */ (0,
|
|
7206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7356
7207
|
Modal,
|
|
7357
7208
|
{
|
|
7358
7209
|
headerProps: {
|
|
@@ -7362,8 +7213,8 @@ var LanguageModal = ({
|
|
|
7362
7213
|
},
|
|
7363
7214
|
onClose,
|
|
7364
7215
|
...modalProps,
|
|
7365
|
-
children: /* @__PURE__ */ (0,
|
|
7366
|
-
/* @__PURE__ */ (0,
|
|
7216
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "w-64", children: [
|
|
7217
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
7367
7218
|
Select,
|
|
7368
7219
|
{
|
|
7369
7220
|
className: "mt-2",
|
|
@@ -7372,15 +7223,15 @@ var LanguageModal = ({
|
|
|
7372
7223
|
onChange: (language2) => setLanguage(language2)
|
|
7373
7224
|
}
|
|
7374
7225
|
),
|
|
7375
|
-
/* @__PURE__ */ (0,
|
|
7226
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
|
|
7376
7227
|
] })
|
|
7377
7228
|
}
|
|
7378
7229
|
);
|
|
7379
7230
|
};
|
|
7380
7231
|
|
|
7381
7232
|
// src/theming/useTheme.tsx
|
|
7382
|
-
var
|
|
7383
|
-
var
|
|
7233
|
+
var import_react22 = require("react");
|
|
7234
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
7384
7235
|
var themes = ["light", "dark"];
|
|
7385
7236
|
var defaultThemeTypeTranslation = {
|
|
7386
7237
|
en: {
|
|
@@ -7404,27 +7255,27 @@ var ThemeUtil = {
|
|
|
7404
7255
|
themes,
|
|
7405
7256
|
translation: defaultThemeTypeTranslation
|
|
7406
7257
|
};
|
|
7407
|
-
var ThemeContext = (0,
|
|
7258
|
+
var ThemeContext = (0, import_react22.createContext)({
|
|
7408
7259
|
theme: "light",
|
|
7409
7260
|
setTheme: noop
|
|
7410
7261
|
});
|
|
7411
7262
|
var ThemeProvider = ({ children, initialTheme = "light" }) => {
|
|
7412
|
-
const [theme, setTheme] = (0,
|
|
7413
|
-
(0,
|
|
7263
|
+
const [theme, setTheme] = (0, import_react22.useState)(initialTheme);
|
|
7264
|
+
(0, import_react22.useEffect)(() => {
|
|
7414
7265
|
if (theme !== initialTheme) {
|
|
7415
7266
|
console.warn("ThemeProvider initial state changed: Prefer using useTheme's setTheme instead");
|
|
7416
7267
|
setTheme(initialTheme);
|
|
7417
7268
|
}
|
|
7418
7269
|
}, [initialTheme]);
|
|
7419
|
-
(0,
|
|
7270
|
+
(0, import_react22.useEffect)(() => {
|
|
7420
7271
|
document.documentElement.setAttribute("data-theme", theme);
|
|
7421
7272
|
}, [theme]);
|
|
7422
|
-
return /* @__PURE__ */ (0,
|
|
7273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ThemeContext.Provider, { value: { theme, setTheme }, children });
|
|
7423
7274
|
};
|
|
7424
|
-
var useTheme = () => (0,
|
|
7275
|
+
var useTheme = () => (0, import_react22.useContext)(ThemeContext);
|
|
7425
7276
|
|
|
7426
7277
|
// src/components/modals/ThemeModal.tsx
|
|
7427
|
-
var
|
|
7278
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
7428
7279
|
var defaultConfirmDialogTranslation = {
|
|
7429
7280
|
en: {
|
|
7430
7281
|
chooseTheme: "Choose your preferred theme"
|
|
@@ -7441,7 +7292,7 @@ var ThemeModal = ({
|
|
|
7441
7292
|
}) => {
|
|
7442
7293
|
const { theme, setTheme } = useTheme();
|
|
7443
7294
|
const translation = useTranslation([defaultConfirmDialogTranslation, formTranslation, ThemeUtil.translation], overwriteTranslation);
|
|
7444
|
-
return /* @__PURE__ */ (0,
|
|
7295
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7445
7296
|
Modal,
|
|
7446
7297
|
{
|
|
7447
7298
|
headerProps: {
|
|
@@ -7451,8 +7302,8 @@ var ThemeModal = ({
|
|
|
7451
7302
|
},
|
|
7452
7303
|
onClose,
|
|
7453
7304
|
...modalProps,
|
|
7454
|
-
children: /* @__PURE__ */ (0,
|
|
7455
|
-
/* @__PURE__ */ (0,
|
|
7305
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "w-64", children: [
|
|
7306
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7456
7307
|
Select,
|
|
7457
7308
|
{
|
|
7458
7309
|
className: "mt-2",
|
|
@@ -7461,64 +7312,163 @@ var ThemeModal = ({
|
|
|
7461
7312
|
onChange: (theme2) => setTheme(theme2)
|
|
7462
7313
|
}
|
|
7463
7314
|
),
|
|
7464
|
-
/* @__PURE__ */ (0,
|
|
7315
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "row mt-3 gap-x-4 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SolidButton, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
|
|
7465
7316
|
] })
|
|
7466
7317
|
}
|
|
7467
7318
|
);
|
|
7468
7319
|
};
|
|
7469
7320
|
|
|
7470
7321
|
// src/components/properties/CheckboxProperty.tsx
|
|
7471
|
-
var import_lucide_react15 = require("lucide-react");
|
|
7472
|
-
|
|
7473
|
-
// src/components/properties/PropertyBase.tsx
|
|
7474
7322
|
var import_lucide_react14 = require("lucide-react");
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
var
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7323
|
+
|
|
7324
|
+
// src/components/user-action/Checkbox.tsx
|
|
7325
|
+
var import_react23 = require("react");
|
|
7326
|
+
var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"));
|
|
7327
|
+
var import_lucide_react12 = require("lucide-react");
|
|
7328
|
+
var import_clsx32 = __toESM(require("clsx"));
|
|
7329
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
7330
|
+
var checkboxSizeMapping = {
|
|
7331
|
+
small: "size-4",
|
|
7332
|
+
medium: "size-6",
|
|
7333
|
+
large: "size-8"
|
|
7334
|
+
};
|
|
7335
|
+
var checkboxIconSizeMapping = {
|
|
7336
|
+
small: "size-3",
|
|
7337
|
+
medium: "size-5",
|
|
7338
|
+
large: "size-7"
|
|
7339
|
+
};
|
|
7340
|
+
var Checkbox = ({
|
|
7341
|
+
id,
|
|
7342
|
+
label,
|
|
7343
|
+
checked,
|
|
7344
|
+
disabled,
|
|
7345
|
+
onChange,
|
|
7346
|
+
onChangeTristate,
|
|
7347
|
+
size = "medium",
|
|
7348
|
+
className = "",
|
|
7349
|
+
containerClassName
|
|
7487
7350
|
}) => {
|
|
7488
|
-
const
|
|
7489
|
-
const
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7351
|
+
const usedSizeClass = checkboxSizeMapping[size];
|
|
7352
|
+
const innerIconSize = checkboxIconSizeMapping[size];
|
|
7353
|
+
const propagateChange = (checked2) => {
|
|
7354
|
+
if (onChangeTristate) {
|
|
7355
|
+
onChangeTristate(checked2);
|
|
7356
|
+
}
|
|
7357
|
+
if (onChange) {
|
|
7358
|
+
onChange(checked2 === "indeterminate" ? false : checked2);
|
|
7359
|
+
}
|
|
7360
|
+
};
|
|
7361
|
+
const changeValue = () => {
|
|
7362
|
+
const newValue = checked === "indeterminate" ? false : !checked;
|
|
7363
|
+
propagateChange(newValue);
|
|
7364
|
+
};
|
|
7365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: (0, import_clsx32.default)("row justify-center items-center", containerClassName), children: [
|
|
7366
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7367
|
+
CheckboxPrimitive.Root,
|
|
7493
7368
|
{
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7369
|
+
onCheckedChange: propagateChange,
|
|
7370
|
+
checked,
|
|
7371
|
+
disabled,
|
|
7372
|
+
id,
|
|
7373
|
+
className: (0, import_clsx32.default)(usedSizeClass, `items-center border-2 rounded outline-none `, {
|
|
7374
|
+
"text-disabled-text border-disabled-outline bg-disabled-background cursor-not-allowed": disabled,
|
|
7375
|
+
"focus:border-primary": !disabled,
|
|
7376
|
+
"bg-surface": !disabled && !checked,
|
|
7377
|
+
"bg-primary/30 border-primary text-primary": !disabled && checked === true || checked === "indeterminate",
|
|
7378
|
+
"hover:border-primary focus:hover:border-primary": !disabled && !checked
|
|
7497
7379
|
}, className),
|
|
7498
|
-
children: [
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
]
|
|
7380
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(CheckboxPrimitive.Indicator, { children: [
|
|
7381
|
+
checked === true && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react12.Check, { className: innerIconSize }),
|
|
7382
|
+
checked === "indeterminate" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_lucide_react12.Minus, { className: innerIconSize })
|
|
7383
|
+
] })
|
|
7502
7384
|
}
|
|
7503
7385
|
),
|
|
7504
|
-
/* @__PURE__ */ (0,
|
|
7505
|
-
|
|
7386
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7387
|
+
Label,
|
|
7506
7388
|
{
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7389
|
+
...label,
|
|
7390
|
+
className: (0, import_clsx32.default)("cursor-pointer", label.className),
|
|
7391
|
+
htmlFor: id,
|
|
7392
|
+
onClick: changeValue
|
|
7393
|
+
}
|
|
7394
|
+
)
|
|
7395
|
+
] });
|
|
7396
|
+
};
|
|
7397
|
+
var CheckboxUncontrolled = ({
|
|
7398
|
+
onChange,
|
|
7399
|
+
onChangeTristate,
|
|
7400
|
+
defaultValue = false,
|
|
7401
|
+
...props
|
|
7402
|
+
}) => {
|
|
7403
|
+
const [checked, setChecked] = (0, import_react23.useState)(defaultValue);
|
|
7404
|
+
const handleChange = (checked2) => {
|
|
7405
|
+
if (onChangeTristate) {
|
|
7406
|
+
onChangeTristate(checked2);
|
|
7407
|
+
}
|
|
7408
|
+
if (onChange) {
|
|
7409
|
+
onChange(checked2 === "indeterminate" ? false : checked2);
|
|
7410
|
+
}
|
|
7411
|
+
setChecked(checked2);
|
|
7412
|
+
};
|
|
7413
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
7414
|
+
Checkbox,
|
|
7415
|
+
{
|
|
7416
|
+
...props,
|
|
7417
|
+
checked,
|
|
7418
|
+
onChangeTristate: handleChange
|
|
7419
|
+
}
|
|
7420
|
+
);
|
|
7421
|
+
};
|
|
7422
|
+
|
|
7423
|
+
// src/components/properties/PropertyBase.tsx
|
|
7424
|
+
var import_lucide_react13 = require("lucide-react");
|
|
7425
|
+
var import_clsx33 = __toESM(require("clsx"));
|
|
7426
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
7427
|
+
var PropertyBase = ({
|
|
7428
|
+
overwriteTranslation,
|
|
7429
|
+
name,
|
|
7430
|
+
input,
|
|
7431
|
+
softRequired = false,
|
|
7432
|
+
hasValue,
|
|
7433
|
+
icon,
|
|
7434
|
+
readOnly,
|
|
7435
|
+
onRemove,
|
|
7436
|
+
className = ""
|
|
7437
|
+
}) => {
|
|
7438
|
+
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
7439
|
+
const requiredAndNoValue = softRequired && !hasValue;
|
|
7440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: (0, import_clsx33.default)("row gap-x-0 group", className), children: [
|
|
7441
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
7442
|
+
"div",
|
|
7443
|
+
{
|
|
7444
|
+
className: (0, import_clsx33.default)("row gap-x-2 !w-[200px] px-4 py-2 items-center rounded-l-xl border-2 border-r-0", {
|
|
7445
|
+
"bg-property-title-background property-title-text group-hover:border-primary": !requiredAndNoValue,
|
|
7446
|
+
"bg-warning text-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
7447
|
+
}, className),
|
|
7448
|
+
children: [
|
|
7449
|
+
icon,
|
|
7450
|
+
name
|
|
7451
|
+
]
|
|
7452
|
+
}
|
|
7453
|
+
),
|
|
7454
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
7455
|
+
"div",
|
|
7456
|
+
{
|
|
7457
|
+
className: (0, import_clsx33.default)("row gap-x-0 grow justify-between items-center rounded-r-xl border-2 border-l-0", {
|
|
7458
|
+
"bg-surface group-hover:border-primary": !requiredAndNoValue,
|
|
7459
|
+
"bg-surface-warning group-hover:border-warning border-warning/90": requiredAndNoValue
|
|
7460
|
+
}, className),
|
|
7461
|
+
children: [
|
|
7462
|
+
input({ softRequired, hasValue }),
|
|
7463
|
+
requiredAndNoValue && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "text-warning pr-4", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react13.AlertTriangle, { size: 24 }) }),
|
|
7464
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
7465
|
+
TextButton,
|
|
7466
|
+
{
|
|
7467
|
+
onClick: onRemove,
|
|
7468
|
+
color: "negative",
|
|
7469
|
+
className: (0, import_clsx33.default)("pr-4 items-center", { "!text-transparent": !hasValue || readOnly }),
|
|
7470
|
+
disabled: !hasValue || readOnly,
|
|
7471
|
+
children: translation("remove")
|
|
7522
7472
|
}
|
|
7523
7473
|
)
|
|
7524
7474
|
]
|
|
@@ -7528,7 +7478,7 @@ var PropertyBase = ({
|
|
|
7528
7478
|
};
|
|
7529
7479
|
|
|
7530
7480
|
// src/components/properties/CheckboxProperty.tsx
|
|
7531
|
-
var
|
|
7481
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
7532
7482
|
var CheckboxProperty = ({
|
|
7533
7483
|
overwriteTranslation,
|
|
7534
7484
|
value,
|
|
@@ -7537,14 +7487,14 @@ var CheckboxProperty = ({
|
|
|
7537
7487
|
...baseProps
|
|
7538
7488
|
}) => {
|
|
7539
7489
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
7540
|
-
return /* @__PURE__ */ (0,
|
|
7490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
7541
7491
|
PropertyBase,
|
|
7542
7492
|
{
|
|
7543
7493
|
...baseProps,
|
|
7544
7494
|
hasValue: true,
|
|
7545
7495
|
readOnly,
|
|
7546
|
-
icon: /* @__PURE__ */ (0,
|
|
7547
|
-
input: () => /* @__PURE__ */ (0,
|
|
7496
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react14.Check, { size: 16 }),
|
|
7497
|
+
input: () => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "row py-2 px-4 items-center", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
7548
7498
|
Checkbox,
|
|
7549
7499
|
{
|
|
7550
7500
|
checked: value ?? true,
|
|
@@ -7558,9 +7508,9 @@ var CheckboxProperty = ({
|
|
|
7558
7508
|
};
|
|
7559
7509
|
|
|
7560
7510
|
// src/components/properties/DateProperty.tsx
|
|
7561
|
-
var
|
|
7562
|
-
var
|
|
7563
|
-
var
|
|
7511
|
+
var import_lucide_react15 = require("lucide-react");
|
|
7512
|
+
var import_clsx34 = __toESM(require("clsx"));
|
|
7513
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
7564
7514
|
var DateProperty = ({
|
|
7565
7515
|
value,
|
|
7566
7516
|
onChange = noop,
|
|
@@ -7571,20 +7521,20 @@ var DateProperty = ({
|
|
|
7571
7521
|
}) => {
|
|
7572
7522
|
const hasValue = !!value;
|
|
7573
7523
|
const dateText = value ? type === "dateTime" ? formatDateTime(value) : formatDate(value) : "";
|
|
7574
|
-
return /* @__PURE__ */ (0,
|
|
7524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7575
7525
|
PropertyBase,
|
|
7576
7526
|
{
|
|
7577
7527
|
...baseProps,
|
|
7578
7528
|
hasValue,
|
|
7579
|
-
icon: /* @__PURE__ */ (0,
|
|
7580
|
-
input: ({ softRequired }) => /* @__PURE__ */ (0,
|
|
7529
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react15.CalendarDays, { size: 16 }),
|
|
7530
|
+
input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7581
7531
|
"div",
|
|
7582
7532
|
{
|
|
7583
|
-
className: (0,
|
|
7584
|
-
children: /* @__PURE__ */ (0,
|
|
7533
|
+
className: (0, import_clsx34.default)("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
|
|
7534
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
7585
7535
|
Input,
|
|
7586
7536
|
{
|
|
7587
|
-
className: (0,
|
|
7537
|
+
className: (0, import_clsx34.default)("!ring-0 !border-0 !outline-0 !p-0 !m-0 !shadow-none !w-fit !rounded-none", { "bg-surface-warning": softRequired && !hasValue }),
|
|
7588
7538
|
value: dateText,
|
|
7589
7539
|
type: type === "dateTime" ? "datetime-local" : "date",
|
|
7590
7540
|
readOnly,
|
|
@@ -7607,14 +7557,14 @@ var DateProperty = ({
|
|
|
7607
7557
|
};
|
|
7608
7558
|
|
|
7609
7559
|
// src/components/properties/MultiSelectProperty.tsx
|
|
7610
|
-
var import_lucide_react18 = require("lucide-react");
|
|
7611
|
-
var import_clsx37 = __toESM(require("clsx"));
|
|
7612
|
-
|
|
7613
|
-
// src/components/user-action/MultiSelect.tsx
|
|
7614
|
-
var import_react22 = require("react");
|
|
7615
7560
|
var import_lucide_react17 = require("lucide-react");
|
|
7616
7561
|
var import_clsx36 = __toESM(require("clsx"));
|
|
7617
|
-
|
|
7562
|
+
|
|
7563
|
+
// src/components/user-action/MultiSelect.tsx
|
|
7564
|
+
var import_react24 = require("react");
|
|
7565
|
+
var import_lucide_react16 = require("lucide-react");
|
|
7566
|
+
var import_clsx35 = __toESM(require("clsx"));
|
|
7567
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
7618
7568
|
var defaultMultiSelectTranslation = {
|
|
7619
7569
|
en: {
|
|
7620
7570
|
selected: `{{amount}} selected`
|
|
@@ -7636,28 +7586,28 @@ var MultiSelect = ({
|
|
|
7636
7586
|
className = ""
|
|
7637
7587
|
}) => {
|
|
7638
7588
|
const translation = useTranslation([formTranslation, defaultMultiSelectTranslation], overwriteTranslation);
|
|
7639
|
-
const triggerRef = (0,
|
|
7640
|
-
const menuRef = (0,
|
|
7641
|
-
const [isOpen, setIsOpen] = (0,
|
|
7589
|
+
const triggerRef = (0, import_react24.useRef)(null);
|
|
7590
|
+
const menuRef = (0, import_react24.useRef)(null);
|
|
7591
|
+
const [isOpen, setIsOpen] = (0, import_react24.useState)(false);
|
|
7642
7592
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
7643
7593
|
const selectedItems = options.filter((value) => value.selected);
|
|
7644
7594
|
const isShowingHint = !selectedDisplayOverwrite && selectedItems.length === 0;
|
|
7645
|
-
return /* @__PURE__ */ (0,
|
|
7646
|
-
label && /* @__PURE__ */ (0,
|
|
7595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: (0, import_clsx35.default)(className), children: [
|
|
7596
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7647
7597
|
Label,
|
|
7648
7598
|
{
|
|
7649
7599
|
...label,
|
|
7650
7600
|
htmlFor: label.name,
|
|
7651
|
-
className: (0,
|
|
7601
|
+
className: (0, import_clsx35.default)(" mb-1", label.className),
|
|
7652
7602
|
labelType: label.labelType ?? "labelBig"
|
|
7653
7603
|
}
|
|
7654
7604
|
),
|
|
7655
|
-
/* @__PURE__ */ (0,
|
|
7656
|
-
/* @__PURE__ */ (0,
|
|
7605
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "relative", children: [
|
|
7606
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
7657
7607
|
"button",
|
|
7658
7608
|
{
|
|
7659
7609
|
ref: triggerRef,
|
|
7660
|
-
className: (0,
|
|
7610
|
+
className: (0, import_clsx35.default)(
|
|
7661
7611
|
"btn-md justify-between w-full border-2 h-auto",
|
|
7662
7612
|
{
|
|
7663
7613
|
"rounded-b-lg": !open,
|
|
@@ -7668,25 +7618,25 @@ var MultiSelect = ({
|
|
|
7668
7618
|
onClick: () => setIsOpen(!isOpen),
|
|
7669
7619
|
disabled: isDisabled,
|
|
7670
7620
|
children: [
|
|
7671
|
-
!isShowingHint && /* @__PURE__ */ (0,
|
|
7672
|
-
isShowingHint && /* @__PURE__ */ (0,
|
|
7673
|
-
isOpen ? /* @__PURE__ */ (0,
|
|
7621
|
+
!isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "font-semibold text-menu-text", children: selectedDisplayOverwrite ?? (useChipDisplay && selectedItems ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ChipList, { list: selectedItems.map((value) => ({ children: value.label })) }) : translation("selected", { replacements: { amount: selectedItems.length.toString() } })) }),
|
|
7622
|
+
isShowingHint && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "textstyle-description", children: hintText ?? translation("select") }),
|
|
7623
|
+
isOpen ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react16.ChevronUp, { size: 24, className: "min-w-6" }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react16.ChevronDown, { className: "min-w-6" })
|
|
7674
7624
|
]
|
|
7675
7625
|
}
|
|
7676
7626
|
),
|
|
7677
|
-
isOpen && /* @__PURE__ */ (0,
|
|
7627
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
7678
7628
|
"div",
|
|
7679
7629
|
{
|
|
7680
7630
|
ref: menuRef,
|
|
7681
7631
|
className: "absolute w-full z-10 rounded-lg mt-0.5 bg-menu-background text-menu-text shadow-around-lg max-h-[500px] overflow-y-auto p-2",
|
|
7682
7632
|
children: [
|
|
7683
|
-
/* @__PURE__ */ (0,
|
|
7633
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7684
7634
|
SearchableList,
|
|
7685
7635
|
{
|
|
7686
7636
|
list: options,
|
|
7687
7637
|
minimumItemsForSearch: isSearchEnabled ? void 0 : options.length,
|
|
7688
7638
|
searchMapping: (item) => item.searchTags,
|
|
7689
|
-
itemMapper: (option, index) => /* @__PURE__ */ (0,
|
|
7639
|
+
itemMapper: (option, index) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7690
7640
|
Tile,
|
|
7691
7641
|
{
|
|
7692
7642
|
isSelected: option.selected,
|
|
@@ -7705,9 +7655,9 @@ var MultiSelect = ({
|
|
|
7705
7655
|
)
|
|
7706
7656
|
}
|
|
7707
7657
|
),
|
|
7708
|
-
/* @__PURE__ */ (0,
|
|
7709
|
-
/* @__PURE__ */ (0,
|
|
7710
|
-
/* @__PURE__ */ (0,
|
|
7658
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "row justify-between mt-2", children: [
|
|
7659
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "row gap-x-2", children: [
|
|
7660
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7711
7661
|
SolidButton,
|
|
7712
7662
|
{
|
|
7713
7663
|
color: "neutral",
|
|
@@ -7722,7 +7672,7 @@ var MultiSelect = ({
|
|
|
7722
7672
|
children: translation("all")
|
|
7723
7673
|
}
|
|
7724
7674
|
),
|
|
7725
|
-
/* @__PURE__ */ (0,
|
|
7675
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7726
7676
|
SolidButton,
|
|
7727
7677
|
{
|
|
7728
7678
|
color: "neutral",
|
|
@@ -7737,7 +7687,7 @@ var MultiSelect = ({
|
|
|
7737
7687
|
}
|
|
7738
7688
|
)
|
|
7739
7689
|
] }),
|
|
7740
|
-
/* @__PURE__ */ (0,
|
|
7690
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SolidButton, { size: "small", onClick: () => setIsOpen(false), children: "Done" })
|
|
7741
7691
|
] })
|
|
7742
7692
|
]
|
|
7743
7693
|
}
|
|
@@ -7750,11 +7700,11 @@ var MultiSelectUncontrolled = ({
|
|
|
7750
7700
|
onChange,
|
|
7751
7701
|
...props
|
|
7752
7702
|
}) => {
|
|
7753
|
-
const [usedOptions, setUsedOptions] = (0,
|
|
7754
|
-
(0,
|
|
7703
|
+
const [usedOptions, setUsedOptions] = (0, import_react24.useState)(options);
|
|
7704
|
+
(0, import_react24.useEffect)(() => {
|
|
7755
7705
|
setUsedOptions(options);
|
|
7756
7706
|
}, [options]);
|
|
7757
|
-
return /* @__PURE__ */ (0,
|
|
7707
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
7758
7708
|
MultiSelect,
|
|
7759
7709
|
{
|
|
7760
7710
|
...props,
|
|
@@ -7768,7 +7718,7 @@ var MultiSelectUncontrolled = ({
|
|
|
7768
7718
|
};
|
|
7769
7719
|
|
|
7770
7720
|
// src/components/properties/MultiSelectProperty.tsx
|
|
7771
|
-
var
|
|
7721
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
7772
7722
|
var MultiSelectProperty = ({
|
|
7773
7723
|
overwriteTranslation,
|
|
7774
7724
|
options,
|
|
@@ -7780,7 +7730,7 @@ var MultiSelectProperty = ({
|
|
|
7780
7730
|
}) => {
|
|
7781
7731
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
7782
7732
|
const hasValue = options.some((value) => value.selected);
|
|
7783
|
-
return /* @__PURE__ */ (0,
|
|
7733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7784
7734
|
PropertyBase,
|
|
7785
7735
|
{
|
|
7786
7736
|
name,
|
|
@@ -7788,16 +7738,16 @@ var MultiSelectProperty = ({
|
|
|
7788
7738
|
readOnly,
|
|
7789
7739
|
softRequired,
|
|
7790
7740
|
hasValue,
|
|
7791
|
-
icon: /* @__PURE__ */ (0,
|
|
7792
|
-
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0,
|
|
7741
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react17.List, { size: 16 }),
|
|
7742
|
+
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7793
7743
|
"div",
|
|
7794
7744
|
{
|
|
7795
|
-
className: (0,
|
|
7796
|
-
children: /* @__PURE__ */ (0,
|
|
7745
|
+
className: (0, import_clsx36.default)("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired2 && !hasValue }),
|
|
7746
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
7797
7747
|
MultiSelect,
|
|
7798
7748
|
{
|
|
7799
7749
|
...multiSelectProps,
|
|
7800
|
-
className: (0,
|
|
7750
|
+
className: (0, import_clsx36.default)("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
|
|
7801
7751
|
options,
|
|
7802
7752
|
isDisabled: readOnly,
|
|
7803
7753
|
useChipDisplay: true,
|
|
@@ -7811,9 +7761,9 @@ var MultiSelectProperty = ({
|
|
|
7811
7761
|
};
|
|
7812
7762
|
|
|
7813
7763
|
// src/components/properties/NumberProperty.tsx
|
|
7814
|
-
var
|
|
7815
|
-
var
|
|
7816
|
-
var
|
|
7764
|
+
var import_lucide_react18 = require("lucide-react");
|
|
7765
|
+
var import_clsx37 = __toESM(require("clsx"));
|
|
7766
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
7817
7767
|
var defaultNumberPropertyTranslation = {
|
|
7818
7768
|
en: {
|
|
7819
7769
|
value: "Value"
|
|
@@ -7834,23 +7784,23 @@ var NumberProperty = ({
|
|
|
7834
7784
|
}) => {
|
|
7835
7785
|
const translation = useTranslation([defaultNumberPropertyTranslation], overwriteTranslation);
|
|
7836
7786
|
const hasValue = value !== void 0;
|
|
7837
|
-
return /* @__PURE__ */ (0,
|
|
7787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7838
7788
|
PropertyBase,
|
|
7839
7789
|
{
|
|
7840
7790
|
...baseProps,
|
|
7841
7791
|
onRemove,
|
|
7842
7792
|
hasValue,
|
|
7843
|
-
icon: /* @__PURE__ */ (0,
|
|
7844
|
-
input: ({ softRequired }) => /* @__PURE__ */ (0,
|
|
7793
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react18.Binary, { size: 16 }),
|
|
7794
|
+
input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
7845
7795
|
"div",
|
|
7846
7796
|
{
|
|
7847
|
-
className: (0,
|
|
7797
|
+
className: (0, import_clsx37.default)("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
|
|
7848
7798
|
children: [
|
|
7849
|
-
/* @__PURE__ */ (0,
|
|
7799
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
7850
7800
|
Input,
|
|
7851
7801
|
{
|
|
7852
7802
|
expanded: false,
|
|
7853
|
-
className: (0,
|
|
7803
|
+
className: (0, import_clsx37.default)("!ring-0 !border-0 !outline-0 !p-0 !m-0 !w-fit !shadow-none !rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
|
|
7854
7804
|
value: value?.toString() ?? "",
|
|
7855
7805
|
type: "number",
|
|
7856
7806
|
readOnly,
|
|
@@ -7873,7 +7823,7 @@ var NumberProperty = ({
|
|
|
7873
7823
|
}
|
|
7874
7824
|
}
|
|
7875
7825
|
),
|
|
7876
|
-
suffix && /* @__PURE__ */ (0,
|
|
7826
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: (0, import_clsx37.default)("ml-1", { "bg-surface-warning": softRequired && !hasValue }), children: suffix })
|
|
7877
7827
|
]
|
|
7878
7828
|
}
|
|
7879
7829
|
)
|
|
@@ -7882,9 +7832,9 @@ var NumberProperty = ({
|
|
|
7882
7832
|
};
|
|
7883
7833
|
|
|
7884
7834
|
// src/components/properties/SelectProperty.tsx
|
|
7885
|
-
var
|
|
7886
|
-
var
|
|
7887
|
-
var
|
|
7835
|
+
var import_lucide_react19 = require("lucide-react");
|
|
7836
|
+
var import_clsx38 = __toESM(require("clsx"));
|
|
7837
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
7888
7838
|
var SingleSelectProperty = ({
|
|
7889
7839
|
overwriteTranslation,
|
|
7890
7840
|
value,
|
|
@@ -7897,7 +7847,7 @@ var SingleSelectProperty = ({
|
|
|
7897
7847
|
}) => {
|
|
7898
7848
|
const translation = useTranslation([formTranslation], overwriteTranslation);
|
|
7899
7849
|
const hasValue = value !== void 0;
|
|
7900
|
-
return /* @__PURE__ */ (0,
|
|
7850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7901
7851
|
PropertyBase,
|
|
7902
7852
|
{
|
|
7903
7853
|
name,
|
|
@@ -7905,19 +7855,19 @@ var SingleSelectProperty = ({
|
|
|
7905
7855
|
readOnly,
|
|
7906
7856
|
softRequired,
|
|
7907
7857
|
hasValue,
|
|
7908
|
-
icon: /* @__PURE__ */ (0,
|
|
7909
|
-
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0,
|
|
7858
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react19.List, { size: 16 }),
|
|
7859
|
+
input: ({ softRequired: softRequired2 }) => /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7910
7860
|
"div",
|
|
7911
7861
|
{
|
|
7912
|
-
className: (0,
|
|
7913
|
-
children: /* @__PURE__ */ (0,
|
|
7862
|
+
className: (0, import_clsx38.default)("row grow py-2 px-4 cursor-pointer", { "text-warning": softRequired2 && !hasValue }),
|
|
7863
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
7914
7864
|
Select,
|
|
7915
7865
|
{
|
|
7916
7866
|
...selectProps,
|
|
7917
7867
|
value,
|
|
7918
7868
|
options,
|
|
7919
7869
|
isDisabled: readOnly,
|
|
7920
|
-
className: (0,
|
|
7870
|
+
className: (0, import_clsx38.default)("w-full", { "bg-surface-warning": softRequired2 && !hasValue }),
|
|
7921
7871
|
hintText: `${translation("select")}...`
|
|
7922
7872
|
}
|
|
7923
7873
|
)
|
|
@@ -7928,13 +7878,13 @@ var SingleSelectProperty = ({
|
|
|
7928
7878
|
};
|
|
7929
7879
|
|
|
7930
7880
|
// src/components/properties/TextProperty.tsx
|
|
7931
|
-
var
|
|
7932
|
-
var
|
|
7881
|
+
var import_lucide_react20 = require("lucide-react");
|
|
7882
|
+
var import_clsx40 = __toESM(require("clsx"));
|
|
7933
7883
|
|
|
7934
7884
|
// src/components/user-action/Textarea.tsx
|
|
7935
|
-
var
|
|
7936
|
-
var
|
|
7937
|
-
var
|
|
7885
|
+
var import_react25 = require("react");
|
|
7886
|
+
var import_clsx39 = __toESM(require("clsx"));
|
|
7887
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
7938
7888
|
var Textarea = ({
|
|
7939
7889
|
label,
|
|
7940
7890
|
headline,
|
|
@@ -7945,37 +7895,38 @@ var Textarea = ({
|
|
|
7945
7895
|
disclaimer,
|
|
7946
7896
|
onBlur = noop,
|
|
7947
7897
|
onEditCompleted = noop,
|
|
7898
|
+
saveDelayOptions,
|
|
7948
7899
|
defaultStyle = true,
|
|
7949
7900
|
className,
|
|
7950
7901
|
...props
|
|
7951
7902
|
}) => {
|
|
7952
|
-
const [hasFocus, setHasFocus] = (0,
|
|
7953
|
-
const { restartTimer,
|
|
7903
|
+
const [hasFocus, setHasFocus] = (0, import_react25.useState)(false);
|
|
7904
|
+
const { restartTimer, clearTimer } = useDelay(saveDelayOptions);
|
|
7954
7905
|
const onEditCompletedWrapper = (text) => {
|
|
7955
7906
|
onEditCompleted(text);
|
|
7956
|
-
|
|
7907
|
+
clearTimer();
|
|
7957
7908
|
};
|
|
7958
|
-
return /* @__PURE__ */ (0,
|
|
7959
|
-
label && /* @__PURE__ */ (0,
|
|
7909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "w-full", children: [
|
|
7910
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7960
7911
|
Label,
|
|
7961
7912
|
{
|
|
7962
7913
|
...label,
|
|
7963
7914
|
htmlFor: id,
|
|
7964
|
-
className: (0,
|
|
7915
|
+
className: (0, import_clsx39.default)("mb-1", label.className),
|
|
7965
7916
|
labelType: label.labelType ?? "labelSmall"
|
|
7966
7917
|
}
|
|
7967
7918
|
),
|
|
7968
|
-
/* @__PURE__ */ (0,
|
|
7919
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
7969
7920
|
"div",
|
|
7970
7921
|
{
|
|
7971
|
-
className: `${(0,
|
|
7922
|
+
className: `${(0, import_clsx39.default)(" bg-surface text-on-surface focus-within:border-primary relative", { "shadow border-2 hover:border-primary rounded-lg": defaultStyle })}`,
|
|
7972
7923
|
children: [
|
|
7973
|
-
headline && /* @__PURE__ */ (0,
|
|
7974
|
-
/* @__PURE__ */ (0,
|
|
7924
|
+
headline && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "mx-3 mt-3 block textstyle-label-md", children: headline }),
|
|
7925
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
7975
7926
|
"textarea",
|
|
7976
7927
|
{
|
|
7977
7928
|
id,
|
|
7978
|
-
className: (0,
|
|
7929
|
+
className: (0, import_clsx39.default)("pt-0 px-3 border-transparent focus:border-transparent focus:ring-0 appearance-none border w-full leading-tight focus:outline-none", {
|
|
7979
7930
|
"resize-none": !resizable,
|
|
7980
7931
|
"h-32": defaultStyle,
|
|
7981
7932
|
"mt-3": !headline
|
|
@@ -8002,7 +7953,7 @@ var Textarea = ({
|
|
|
8002
7953
|
]
|
|
8003
7954
|
}
|
|
8004
7955
|
),
|
|
8005
|
-
hasFocus && disclaimer && /* @__PURE__ */ (0,
|
|
7956
|
+
hasFocus && disclaimer && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("label", { className: "text-negative", children: disclaimer })
|
|
8006
7957
|
] });
|
|
8007
7958
|
};
|
|
8008
7959
|
var TextareaUncontrolled = ({
|
|
@@ -8010,11 +7961,11 @@ var TextareaUncontrolled = ({
|
|
|
8010
7961
|
onChangeText = noop,
|
|
8011
7962
|
...props
|
|
8012
7963
|
}) => {
|
|
8013
|
-
const [text, setText] = (0,
|
|
8014
|
-
(0,
|
|
7964
|
+
const [text, setText] = (0, import_react25.useState)(value);
|
|
7965
|
+
(0, import_react25.useEffect)(() => {
|
|
8015
7966
|
setText(value);
|
|
8016
7967
|
}, [value]);
|
|
8017
|
-
return /* @__PURE__ */ (0,
|
|
7968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
8018
7969
|
Textarea,
|
|
8019
7970
|
{
|
|
8020
7971
|
...props,
|
|
@@ -8028,7 +7979,7 @@ var TextareaUncontrolled = ({
|
|
|
8028
7979
|
};
|
|
8029
7980
|
|
|
8030
7981
|
// src/components/properties/TextProperty.tsx
|
|
8031
|
-
var
|
|
7982
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
8032
7983
|
var defaultTextPropertyTranslation = {
|
|
8033
7984
|
en: {
|
|
8034
7985
|
text: "Text"
|
|
@@ -8048,21 +7999,21 @@ var TextProperty = ({
|
|
|
8048
7999
|
}) => {
|
|
8049
8000
|
const translation = useTranslation([defaultTextPropertyTranslation], overwriteTranslation);
|
|
8050
8001
|
const hasValue = value !== void 0;
|
|
8051
|
-
return /* @__PURE__ */ (0,
|
|
8002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8052
8003
|
PropertyBase,
|
|
8053
8004
|
{
|
|
8054
8005
|
...baseProps,
|
|
8055
8006
|
onRemove,
|
|
8056
8007
|
hasValue,
|
|
8057
|
-
icon: /* @__PURE__ */ (0,
|
|
8058
|
-
input: ({ softRequired }) => /* @__PURE__ */ (0,
|
|
8008
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react20.Text, { size: 16 }),
|
|
8009
|
+
input: ({ softRequired }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8059
8010
|
"div",
|
|
8060
8011
|
{
|
|
8061
|
-
className: (0,
|
|
8062
|
-
children: /* @__PURE__ */ (0,
|
|
8012
|
+
className: (0, import_clsx40.default)("row grow pt-2 pb-1 px-4 cursor-pointer", { "text-warning": softRequired && !hasValue }),
|
|
8013
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
8063
8014
|
Textarea,
|
|
8064
8015
|
{
|
|
8065
|
-
className: (0,
|
|
8016
|
+
className: (0, import_clsx40.default)("ring-0 border-0 outline-0 p-0 m-0 shadow-none rounded-none", { "bg-surface-warning placeholder-warning": softRequired && !hasValue }),
|
|
8066
8017
|
rows: 5,
|
|
8067
8018
|
defaultStyle: false,
|
|
8068
8019
|
value: value ?? "",
|
|
@@ -8090,74 +8041,41 @@ var TextProperty = ({
|
|
|
8090
8041
|
);
|
|
8091
8042
|
};
|
|
8092
8043
|
|
|
8093
|
-
// src/components/
|
|
8094
|
-
var
|
|
8095
|
-
var
|
|
8096
|
-
var
|
|
8097
|
-
|
|
8098
|
-
value = /* @__PURE__ */ new Date(),
|
|
8099
|
-
start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
8100
|
-
end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
8101
|
-
mode = "dateTime",
|
|
8102
|
-
onFinish = noop,
|
|
8103
|
-
onChange = noop,
|
|
8104
|
-
onRemove = noop,
|
|
8105
|
-
timePickerProps,
|
|
8106
|
-
datePickerProps
|
|
8044
|
+
// src/components/table/FillerRowElement.tsx
|
|
8045
|
+
var import_clsx41 = require("clsx");
|
|
8046
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
8047
|
+
var FillerRowElement = ({
|
|
8048
|
+
className
|
|
8107
8049
|
}) => {
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
|
|
8116
|
-
|
|
8117
|
-
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
value,
|
|
8121
|
-
start,
|
|
8122
|
-
end,
|
|
8123
|
-
onChange
|
|
8124
|
-
}
|
|
8125
|
-
);
|
|
8126
|
-
}
|
|
8127
|
-
if (useTime) {
|
|
8128
|
-
timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8129
|
-
TimePicker,
|
|
8130
|
-
{
|
|
8131
|
-
...timePickerProps,
|
|
8132
|
-
className: (0, import_clsx42.default)("h-full", { "justify-between w-full": mode === "time" }),
|
|
8133
|
-
maxHeight: 250,
|
|
8134
|
-
time: value,
|
|
8135
|
-
onChange
|
|
8136
|
-
}
|
|
8137
|
-
);
|
|
8138
|
-
}
|
|
8139
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "col w-fit", children: [
|
|
8140
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "row gap-x-4", children: [
|
|
8141
|
-
dateDisplay,
|
|
8142
|
-
timeDisplay
|
|
8143
|
-
] }),
|
|
8144
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "row justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "row gap-x-2 mt-1", children: [
|
|
8145
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
|
|
8146
|
-
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8147
|
-
SolidButton,
|
|
8148
|
-
{
|
|
8149
|
-
size: "medium",
|
|
8150
|
-
onClick: () => onFinish(value),
|
|
8151
|
-
children: translation("change")
|
|
8152
|
-
}
|
|
8153
|
-
)
|
|
8154
|
-
] }) })
|
|
8155
|
-
] });
|
|
8050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: (0, import_clsx41.clsx)("flex flex-row items-center w-1/2 h-4 text-disabled-text font-bold", className), children: "-" });
|
|
8051
|
+
};
|
|
8052
|
+
|
|
8053
|
+
// src/components/table/Filter.ts
|
|
8054
|
+
var dateRange = (row, columnId, filterValue) => {
|
|
8055
|
+
const [min, max] = filterValue;
|
|
8056
|
+
const value = row.getValue(columnId);
|
|
8057
|
+
const date = value instanceof Date ? value : new Date(value);
|
|
8058
|
+
if (isNaN(date.getTime())) return false;
|
|
8059
|
+
if (min && date < min) return false;
|
|
8060
|
+
if (max && date > max) return false;
|
|
8061
|
+
return true;
|
|
8156
8062
|
};
|
|
8063
|
+
var TableFilters = {
|
|
8064
|
+
dateRange
|
|
8065
|
+
};
|
|
8066
|
+
|
|
8067
|
+
// src/components/table/Table.tsx
|
|
8068
|
+
var import_react29 = require("react");
|
|
8069
|
+
var import_clsx45 = __toESM(require("clsx"));
|
|
8070
|
+
var import_react_table = require("@tanstack/react-table");
|
|
8071
|
+
var import_react_custom_scrollbars_23 = require("react-custom-scrollbars-2");
|
|
8072
|
+
|
|
8073
|
+
// src/components/table/TableFilterButton.tsx
|
|
8074
|
+
var import_lucide_react21 = require("lucide-react");
|
|
8157
8075
|
|
|
8158
8076
|
// src/components/user-action/Menu.tsx
|
|
8159
|
-
var
|
|
8160
|
-
var
|
|
8077
|
+
var import_react26 = require("react");
|
|
8078
|
+
var import_clsx42 = __toESM(require("clsx"));
|
|
8161
8079
|
|
|
8162
8080
|
// src/util/PropsWithFunctionChildren.ts
|
|
8163
8081
|
var resolve = (children, bag) => {
|
|
@@ -8171,17 +8089,17 @@ var BagFunctionUtil = {
|
|
|
8171
8089
|
};
|
|
8172
8090
|
|
|
8173
8091
|
// src/components/user-action/Menu.tsx
|
|
8174
|
-
var
|
|
8092
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
8175
8093
|
var MenuItem = ({
|
|
8176
8094
|
children,
|
|
8177
8095
|
onClick,
|
|
8178
8096
|
alignment = "left",
|
|
8179
8097
|
isDisabled = false,
|
|
8180
8098
|
className
|
|
8181
|
-
}) => /* @__PURE__ */ (0,
|
|
8099
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8182
8100
|
"div",
|
|
8183
8101
|
{
|
|
8184
|
-
className: (0,
|
|
8102
|
+
className: (0, import_clsx42.default)("block px-3 py-1.5 bg-menu-background first:rounded-t-lg last:rounded-b-lg text-sm font-semibold", {
|
|
8185
8103
|
"text-right": alignment === "right",
|
|
8186
8104
|
"text-left": alignment === "left",
|
|
8187
8105
|
"text-disabled-text cursor-not-allowed": isDisabled,
|
|
@@ -8200,23 +8118,23 @@ var Menu = ({
|
|
|
8200
8118
|
menuClassName = ""
|
|
8201
8119
|
}) => {
|
|
8202
8120
|
const { isHovered: isOpen, setIsHovered: setIsOpen, handlers } = useHoverState({ isDisabled: !showOnHover });
|
|
8203
|
-
const triggerRef = (0,
|
|
8204
|
-
const menuRef = (0,
|
|
8121
|
+
const triggerRef = (0, import_react26.useRef)(null);
|
|
8122
|
+
const menuRef = (0, import_react26.useRef)(null);
|
|
8205
8123
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
8206
8124
|
const bag = { isOpen, close: () => setIsOpen(false) };
|
|
8207
|
-
return /* @__PURE__ */ (0,
|
|
8125
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
8208
8126
|
"div",
|
|
8209
8127
|
{
|
|
8210
8128
|
className: "relative",
|
|
8211
8129
|
...handlers,
|
|
8212
8130
|
children: [
|
|
8213
8131
|
trigger(() => setIsOpen(!isOpen), triggerRef),
|
|
8214
|
-
/* @__PURE__ */ (0,
|
|
8132
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
8215
8133
|
"div",
|
|
8216
8134
|
{
|
|
8217
8135
|
ref: menuRef,
|
|
8218
8136
|
onClick: (e) => e.stopPropagation(),
|
|
8219
|
-
className: (0,
|
|
8137
|
+
className: (0, import_clsx42.default)(
|
|
8220
8138
|
"absolute top-full mt-1 min-w-40 rounded-lg bg-menu-background text-menu-text shadow-around-lg z-10",
|
|
8221
8139
|
{
|
|
8222
8140
|
"top-0": alignment[0] === "t",
|
|
@@ -8235,10 +8153,644 @@ var Menu = ({
|
|
|
8235
8153
|
);
|
|
8236
8154
|
};
|
|
8237
8155
|
|
|
8238
|
-
// src/components/
|
|
8239
|
-
var
|
|
8240
|
-
var
|
|
8156
|
+
// src/components/table/TableFilterButton.tsx
|
|
8157
|
+
var import_react27 = require("react");
|
|
8158
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
8159
|
+
var defaultTableFilterTranslation = {
|
|
8160
|
+
en: {
|
|
8161
|
+
filter: "Filter",
|
|
8162
|
+
min: "Min",
|
|
8163
|
+
max: "Max",
|
|
8164
|
+
startDate: "Start",
|
|
8165
|
+
endDate: "End",
|
|
8166
|
+
text: "Text..."
|
|
8167
|
+
},
|
|
8168
|
+
de: {
|
|
8169
|
+
filter: "Filter",
|
|
8170
|
+
min: "Min",
|
|
8171
|
+
max: "Max",
|
|
8172
|
+
startDate: "Start",
|
|
8173
|
+
endDate: "Ende",
|
|
8174
|
+
text: "Text..."
|
|
8175
|
+
}
|
|
8176
|
+
};
|
|
8177
|
+
var TableFilterButton = ({
|
|
8178
|
+
filterType,
|
|
8179
|
+
column
|
|
8180
|
+
}) => {
|
|
8181
|
+
const translation = useTranslation([formTranslation, defaultTableFilterTranslation]);
|
|
8182
|
+
const columnFilterValue = column.getFilterValue();
|
|
8183
|
+
const [filterValue, setFilterValue] = (0, import_react27.useState)(columnFilterValue);
|
|
8184
|
+
const hasFilter = !!filterValue;
|
|
8185
|
+
(0, import_react27.useEffect)(() => {
|
|
8186
|
+
setFilterValue(columnFilterValue);
|
|
8187
|
+
}, [columnFilterValue]);
|
|
8188
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8189
|
+
Menu,
|
|
8190
|
+
{
|
|
8191
|
+
trigger: (onClick, ref) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { ref, className: "relative", children: [
|
|
8192
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(IconButton, { color: "neutral", size: "tiny", onClick, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react21.FilterIcon, {}) }),
|
|
8193
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8194
|
+
"div",
|
|
8195
|
+
{
|
|
8196
|
+
className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary pointer-events-none",
|
|
8197
|
+
"aria-hidden": true
|
|
8198
|
+
}
|
|
8199
|
+
)
|
|
8200
|
+
] }),
|
|
8201
|
+
children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "col gap-y-1 p-2 items-start font-normal text-menu-text", children: [
|
|
8202
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("h4", { className: "textstyle-title-sm", children: translation("filter") }),
|
|
8203
|
+
filterType === "text" && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8204
|
+
Input,
|
|
8205
|
+
{
|
|
8206
|
+
value: filterValue ?? "",
|
|
8207
|
+
autoFocus: true,
|
|
8208
|
+
placeholder: translation("text"),
|
|
8209
|
+
onChangeText: setFilterValue,
|
|
8210
|
+
className: "h-10"
|
|
8211
|
+
}
|
|
8212
|
+
),
|
|
8213
|
+
filterType === "range" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "row gap-x-2 items-center", children: [
|
|
8214
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8215
|
+
Input,
|
|
8216
|
+
{
|
|
8217
|
+
value: filterValue?.[0] ?? "",
|
|
8218
|
+
type: "number",
|
|
8219
|
+
placeholder: translation("min"),
|
|
8220
|
+
onChangeText: (text) => {
|
|
8221
|
+
const num = Number(text);
|
|
8222
|
+
setFilterValue((old) => [num, old?.[1]]);
|
|
8223
|
+
},
|
|
8224
|
+
className: "h-10 input-indicator-hidden w-40"
|
|
8225
|
+
}
|
|
8226
|
+
),
|
|
8227
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "font-bold", children: "-" }),
|
|
8228
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8229
|
+
Input,
|
|
8230
|
+
{
|
|
8231
|
+
value: filterValue?.[1] ?? "",
|
|
8232
|
+
type: "number",
|
|
8233
|
+
placeholder: translation("max"),
|
|
8234
|
+
onChangeText: (text) => {
|
|
8235
|
+
const num = Number(text);
|
|
8236
|
+
setFilterValue((old) => [old?.[0], num]);
|
|
8237
|
+
},
|
|
8238
|
+
className: "h-10 input-indicator-hidden w-40"
|
|
8239
|
+
}
|
|
8240
|
+
)
|
|
8241
|
+
] }),
|
|
8242
|
+
filterType === "dateRange" && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
8243
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8244
|
+
Input,
|
|
8245
|
+
{
|
|
8246
|
+
value: filterValue?.[0] ? filterValue?.[0].toISOString().slice(0, 16) : "",
|
|
8247
|
+
type: "datetime-local",
|
|
8248
|
+
placeholder: translation("startDate"),
|
|
8249
|
+
onChangeText: (text) => {
|
|
8250
|
+
const value = new Date(text);
|
|
8251
|
+
setFilterValue((old) => [value, old?.[1]]);
|
|
8252
|
+
},
|
|
8253
|
+
className: "h-10 w-50"
|
|
8254
|
+
}
|
|
8255
|
+
),
|
|
8256
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
8257
|
+
Input,
|
|
8258
|
+
{
|
|
8259
|
+
value: filterValue?.[1] ? filterValue?.[1].toISOString().slice(0, 16) : "",
|
|
8260
|
+
type: "datetime-local",
|
|
8261
|
+
placeholder: translation("endDate"),
|
|
8262
|
+
onChangeText: (text) => {
|
|
8263
|
+
const value = new Date(text);
|
|
8264
|
+
setFilterValue((old) => [old?.[0], value]);
|
|
8265
|
+
},
|
|
8266
|
+
className: "h-10 w-50"
|
|
8267
|
+
}
|
|
8268
|
+
)
|
|
8269
|
+
] }),
|
|
8270
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "row justify-end w-full", children: [
|
|
8271
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SolidButton, { color: "negative", size: "small", onClick: () => {
|
|
8272
|
+
column.setFilterValue(void 0);
|
|
8273
|
+
close();
|
|
8274
|
+
}, children: translation("remove") }),
|
|
8275
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SolidButton, { size: "small", onClick: () => {
|
|
8276
|
+
column.setFilterValue(filterValue);
|
|
8277
|
+
close();
|
|
8278
|
+
}, children: translation("apply") })
|
|
8279
|
+
] })
|
|
8280
|
+
] })
|
|
8281
|
+
}
|
|
8282
|
+
);
|
|
8283
|
+
};
|
|
8284
|
+
|
|
8285
|
+
// src/components/table/TableSortButton.tsx
|
|
8286
|
+
var import_lucide_react22 = require("lucide-react");
|
|
8287
|
+
var import_clsx43 = __toESM(require("clsx"));
|
|
8241
8288
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
8289
|
+
var TableSortButton = ({
|
|
8290
|
+
sortDirection,
|
|
8291
|
+
invert = false,
|
|
8292
|
+
color = "neutral",
|
|
8293
|
+
className,
|
|
8294
|
+
...buttonProps
|
|
8295
|
+
}) => {
|
|
8296
|
+
let icon = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react22.ChevronsUpDown, { className: "w-full h-full" });
|
|
8297
|
+
if (sortDirection) {
|
|
8298
|
+
let usedSortDirection = sortDirection;
|
|
8299
|
+
if (invert) {
|
|
8300
|
+
usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
|
|
8301
|
+
}
|
|
8302
|
+
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react22.ChevronUp, { className: "w-full h-full" }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react22.ChevronDown, { className: "w-full h-full" });
|
|
8303
|
+
}
|
|
8304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
8305
|
+
IconButton,
|
|
8306
|
+
{
|
|
8307
|
+
size: "tiny",
|
|
8308
|
+
color,
|
|
8309
|
+
className: (0, import_clsx43.default)(className),
|
|
8310
|
+
...buttonProps,
|
|
8311
|
+
children: icon
|
|
8312
|
+
}
|
|
8313
|
+
);
|
|
8314
|
+
};
|
|
8315
|
+
|
|
8316
|
+
// src/hooks/useResizeCallbackWrapper.ts
|
|
8317
|
+
var import_react28 = require("react");
|
|
8318
|
+
var useResizeCallbackWrapper = (callback) => {
|
|
8319
|
+
(0, import_react28.useEffect)(() => {
|
|
8320
|
+
window.addEventListener("resize", callback);
|
|
8321
|
+
return () => {
|
|
8322
|
+
window.removeEventListener("resize", callback);
|
|
8323
|
+
};
|
|
8324
|
+
}, [callback]);
|
|
8325
|
+
};
|
|
8326
|
+
|
|
8327
|
+
// src/components/table/TableCell.tsx
|
|
8328
|
+
var import_clsx44 = require("clsx");
|
|
8329
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
8330
|
+
var TableCell = ({
|
|
8331
|
+
children,
|
|
8332
|
+
className
|
|
8333
|
+
}) => {
|
|
8334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: (0, import_clsx44.clsx)("block max-w-full overflow-ellipsis truncate", className), children });
|
|
8335
|
+
};
|
|
8336
|
+
|
|
8337
|
+
// src/components/table/Table.tsx
|
|
8338
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
8339
|
+
var Table = ({
|
|
8340
|
+
data,
|
|
8341
|
+
fillerRow,
|
|
8342
|
+
initialState,
|
|
8343
|
+
onRowClick = noop,
|
|
8344
|
+
className,
|
|
8345
|
+
tableClassName,
|
|
8346
|
+
defaultColumn,
|
|
8347
|
+
state,
|
|
8348
|
+
columns,
|
|
8349
|
+
...tableOptions
|
|
8350
|
+
}) => {
|
|
8351
|
+
const ref = (0, import_react29.useRef)(null);
|
|
8352
|
+
const tableRef = (0, import_react29.useRef)(null);
|
|
8353
|
+
const [columnSizing, setColumnSizing] = (0, import_react29.useState)(columns.reduce((previousValue, currentValue) => {
|
|
8354
|
+
return {
|
|
8355
|
+
...previousValue,
|
|
8356
|
+
[currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
|
|
8357
|
+
};
|
|
8358
|
+
}, {}));
|
|
8359
|
+
const [columnSizingInfo, setColumnSizingInfo] = (0, import_react29.useState)();
|
|
8360
|
+
const [pagination, setPagination] = (0, import_react29.useState)({
|
|
8361
|
+
pageSize: 10,
|
|
8362
|
+
pageIndex: 0,
|
|
8363
|
+
...initialState?.pagination
|
|
8364
|
+
});
|
|
8365
|
+
const [columnFilters, setColumnFilters] = (0, import_react29.useState)(initialState?.columnFilters);
|
|
8366
|
+
const computedColumnMinWidths = (0, import_react29.useMemo)(() => {
|
|
8367
|
+
return columns.reduce((previousValue, column) => {
|
|
8368
|
+
return {
|
|
8369
|
+
...previousValue,
|
|
8370
|
+
// every column is at least 12px wide
|
|
8371
|
+
[column.id]: column.minSize ?? defaultColumn?.minSize ?? 12
|
|
8372
|
+
};
|
|
8373
|
+
}, {});
|
|
8374
|
+
}, [columns, defaultColumn]);
|
|
8375
|
+
const computedColumnMaxWidths = (0, import_react29.useMemo)(() => {
|
|
8376
|
+
return columns.reduce((previousValue, column) => {
|
|
8377
|
+
return {
|
|
8378
|
+
...previousValue,
|
|
8379
|
+
[column.id]: column.maxSize ?? defaultColumn?.maxSize
|
|
8380
|
+
};
|
|
8381
|
+
}, {});
|
|
8382
|
+
}, [columns, defaultColumn]);
|
|
8383
|
+
const tableMinWidth = (0, import_react29.useMemo)(() => {
|
|
8384
|
+
return columns.reduce((sum, column) => {
|
|
8385
|
+
return sum + computedColumnMinWidths[column.id];
|
|
8386
|
+
}, 0);
|
|
8387
|
+
}, [columns, computedColumnMinWidths]);
|
|
8388
|
+
const updateColumnSizes = (0, import_react29.useMemo)(() => {
|
|
8389
|
+
return (previous) => {
|
|
8390
|
+
const updateSizing = {
|
|
8391
|
+
...columnSizing,
|
|
8392
|
+
...previous
|
|
8393
|
+
};
|
|
8394
|
+
const containerWidth = ref.current.offsetWidth;
|
|
8395
|
+
columns.forEach((column) => {
|
|
8396
|
+
updateSizing[column.id] = clamp(updateSizing[column.id], computedColumnMinWidths[column.id], computedColumnMaxWidths[column.id] ?? containerWidth);
|
|
8397
|
+
});
|
|
8398
|
+
const width = columns.reduce((previousValue, currentValue) => previousValue + updateSizing[currentValue.id], 0);
|
|
8399
|
+
if (width > containerWidth) {
|
|
8400
|
+
if (tableMinWidth >= containerWidth) {
|
|
8401
|
+
return columns.reduce((previousValue, currentValue) => ({
|
|
8402
|
+
...previousValue,
|
|
8403
|
+
[currentValue.id]: computedColumnMinWidths[currentValue.id]
|
|
8404
|
+
}), {});
|
|
8405
|
+
}
|
|
8406
|
+
let reduceableColumns = columns.map((value) => value.id).filter((id) => updateSizing[id] - computedColumnMinWidths[id] > 0);
|
|
8407
|
+
let spaceToReduce = width - containerWidth;
|
|
8408
|
+
while (spaceToReduce > 0 && reduceableColumns.length > 0) {
|
|
8409
|
+
let maxReduceAmount = reduceableColumns.reduce((previousValue, id) => Math.max(previousValue, updateSizing[id] - computedColumnMinWidths[id]), 0);
|
|
8410
|
+
if (maxReduceAmount * reduceableColumns.length > spaceToReduce) {
|
|
8411
|
+
maxReduceAmount = spaceToReduce / reduceableColumns.length;
|
|
8412
|
+
}
|
|
8413
|
+
reduceableColumns.forEach((id) => {
|
|
8414
|
+
updateSizing[id] -= maxReduceAmount;
|
|
8415
|
+
});
|
|
8416
|
+
spaceToReduce -= maxReduceAmount * reduceableColumns.length;
|
|
8417
|
+
reduceableColumns = reduceableColumns.filter((id) => updateSizing[id] - computedColumnMinWidths[id] > 0);
|
|
8418
|
+
}
|
|
8419
|
+
} else if (width <= containerWidth) {
|
|
8420
|
+
let distributableWidth = containerWidth - width;
|
|
8421
|
+
const violatingColumns = columns.filter((value) => computedColumnMaxWidths[value.id] && updateSizing[value.id] > computedColumnMaxWidths[value.id]);
|
|
8422
|
+
const violationColumnsAmount = violatingColumns.reduce(
|
|
8423
|
+
(previousValue, column) => previousValue + updateSizing[column.id] - computedColumnMaxWidths[column.id],
|
|
8424
|
+
0
|
|
8425
|
+
);
|
|
8426
|
+
distributableWidth += violationColumnsAmount;
|
|
8427
|
+
let enlargeableColumns = columns.filter((col) => !computedColumnMaxWidths[col.id] || updateSizing[col.id] < computedColumnMaxWidths[col.id]).map((value) => value.id);
|
|
8428
|
+
while (distributableWidth > 0 && enlargeableColumns.length > 0) {
|
|
8429
|
+
let minEnlargeableAmount = enlargeableColumns.reduce((previousValue, id) => Math.min(previousValue, computedColumnMaxWidths[id] ? computedColumnMaxWidths[id] - updateSizing[id] : distributableWidth), distributableWidth);
|
|
8430
|
+
if (minEnlargeableAmount * enlargeableColumns.length > distributableWidth) {
|
|
8431
|
+
minEnlargeableAmount = distributableWidth / enlargeableColumns.length;
|
|
8432
|
+
}
|
|
8433
|
+
enlargeableColumns.forEach((id) => {
|
|
8434
|
+
updateSizing[id] += minEnlargeableAmount;
|
|
8435
|
+
});
|
|
8436
|
+
distributableWidth -= minEnlargeableAmount * enlargeableColumns.length;
|
|
8437
|
+
enlargeableColumns = enlargeableColumns.filter((id) => !computedColumnMaxWidths[id] || updateSizing[id] < computedColumnMaxWidths[id]);
|
|
8438
|
+
}
|
|
8439
|
+
if (distributableWidth > 0) {
|
|
8440
|
+
updateSizing[columns[columns.length - 1].id] += distributableWidth;
|
|
8441
|
+
}
|
|
8442
|
+
}
|
|
8443
|
+
return updateSizing;
|
|
8444
|
+
};
|
|
8445
|
+
}, [columns, computedColumnMaxWidths, computedColumnMinWidths, tableMinWidth]);
|
|
8446
|
+
const table = (0, import_react_table.useReactTable)({
|
|
8447
|
+
data,
|
|
8448
|
+
getCoreRowModel: (0, import_react_table.getCoreRowModel)(),
|
|
8449
|
+
getFilteredRowModel: (0, import_react_table.getFilteredRowModel)(),
|
|
8450
|
+
getSortedRowModel: (0, import_react_table.getSortedRowModel)(),
|
|
8451
|
+
getPaginationRowModel: (0, import_react_table.getPaginationRowModel)(),
|
|
8452
|
+
initialState,
|
|
8453
|
+
defaultColumn: {
|
|
8454
|
+
minSize: 60,
|
|
8455
|
+
maxSize: 700,
|
|
8456
|
+
cell: ({ cell }) => {
|
|
8457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(TableCell, { children: cell.getValue() });
|
|
8458
|
+
},
|
|
8459
|
+
...defaultColumn
|
|
8460
|
+
},
|
|
8461
|
+
columns,
|
|
8462
|
+
state: {
|
|
8463
|
+
columnSizing,
|
|
8464
|
+
columnSizingInfo,
|
|
8465
|
+
pagination,
|
|
8466
|
+
columnFilters,
|
|
8467
|
+
...state
|
|
8468
|
+
},
|
|
8469
|
+
filterFns: {
|
|
8470
|
+
...tableOptions?.filterFns,
|
|
8471
|
+
dateRange: TableFilters.dateRange
|
|
8472
|
+
},
|
|
8473
|
+
onColumnSizingInfoChange: (updaterOrValue) => {
|
|
8474
|
+
setColumnSizingInfo(updaterOrValue);
|
|
8475
|
+
if (tableOptions.onColumnSizingInfoChange) {
|
|
8476
|
+
tableOptions?.onColumnSizingInfoChange(updaterOrValue);
|
|
8477
|
+
}
|
|
8478
|
+
},
|
|
8479
|
+
onColumnSizingChange: (updaterOrValue) => {
|
|
8480
|
+
setColumnSizing((previous) => {
|
|
8481
|
+
const newSizing = typeof updaterOrValue === "function" ? updaterOrValue(previous) : updaterOrValue;
|
|
8482
|
+
return updateColumnSizes(newSizing);
|
|
8483
|
+
});
|
|
8484
|
+
if (tableOptions.onColumnSizingChange) {
|
|
8485
|
+
tableOptions.onColumnSizingChange(updaterOrValue);
|
|
8486
|
+
}
|
|
8487
|
+
},
|
|
8488
|
+
onPaginationChange: (updaterOrValue) => {
|
|
8489
|
+
setPagination(updaterOrValue);
|
|
8490
|
+
if (tableOptions.onPaginationChange) {
|
|
8491
|
+
tableOptions.onPaginationChange(updaterOrValue);
|
|
8492
|
+
}
|
|
8493
|
+
},
|
|
8494
|
+
onColumnFiltersChange: (updaterOrValue) => {
|
|
8495
|
+
setColumnFilters(updaterOrValue);
|
|
8496
|
+
table.toggleAllRowsSelected(false);
|
|
8497
|
+
if (tableOptions.onColumnFiltersChange) {
|
|
8498
|
+
tableOptions.onColumnFiltersChange(updaterOrValue);
|
|
8499
|
+
}
|
|
8500
|
+
},
|
|
8501
|
+
autoResetPageIndex: false,
|
|
8502
|
+
columnResizeMode: "onChange",
|
|
8503
|
+
...tableOptions
|
|
8504
|
+
});
|
|
8505
|
+
const [hasInitializedSizing, setHasInitializedSizing] = (0, import_react29.useState)(false);
|
|
8506
|
+
(0, import_react29.useEffect)(() => {
|
|
8507
|
+
if (!hasInitializedSizing && ref.current) {
|
|
8508
|
+
setHasInitializedSizing(true);
|
|
8509
|
+
table.setColumnSizing(updateColumnSizes(columnSizing));
|
|
8510
|
+
}
|
|
8511
|
+
}, [columnSizing, hasInitializedSizing]);
|
|
8512
|
+
useResizeCallbackWrapper((0, import_react29.useCallback)(() => {
|
|
8513
|
+
table.setColumnSizing(updateColumnSizes);
|
|
8514
|
+
}, [updateColumnSizes]));
|
|
8515
|
+
const pageCount = table.getPageCount();
|
|
8516
|
+
(0, import_react29.useEffect)(() => {
|
|
8517
|
+
const totalPages = pageCount;
|
|
8518
|
+
if (totalPages === 0) {
|
|
8519
|
+
if (pagination.pageIndex !== 0) {
|
|
8520
|
+
table.setPagination((prevState) => ({
|
|
8521
|
+
...prevState,
|
|
8522
|
+
pageIndex: 0
|
|
8523
|
+
}));
|
|
8524
|
+
}
|
|
8525
|
+
} else if (pagination.pageIndex >= totalPages) {
|
|
8526
|
+
table.setPagination((prev) => ({
|
|
8527
|
+
...prev,
|
|
8528
|
+
pageIndex: totalPages - 1
|
|
8529
|
+
}));
|
|
8530
|
+
}
|
|
8531
|
+
}, [data, pageCount, pagination.pageSize, pagination.pageIndex]);
|
|
8532
|
+
const columnSizeVars = (0, import_react29.useMemo)(() => {
|
|
8533
|
+
const headers = table.getFlatHeaders();
|
|
8534
|
+
const colSizes = {};
|
|
8535
|
+
for (let i = 0; i < headers.length; i++) {
|
|
8536
|
+
const header = headers[i];
|
|
8537
|
+
colSizes[`--header-${header.id}-size`] = header.getSize();
|
|
8538
|
+
colSizes[`--col-${header.column.id}-size`] = header.column.getSize();
|
|
8539
|
+
}
|
|
8540
|
+
return colSizes;
|
|
8541
|
+
}, [table.getState().columnSizingInfo, table.getState().columnSizing]);
|
|
8542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { ref, className: (0, import_clsx45.default)("col gap-y-4", className), children: [
|
|
8543
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_react_custom_scrollbars_23.Scrollbars, { autoHeight: true, autoHeightMax: tableRef.current?.offsetHeight, autoHide: true, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
8544
|
+
"table",
|
|
8545
|
+
{
|
|
8546
|
+
ref: tableRef,
|
|
8547
|
+
className: (0, import_clsx45.default)(tableClassName),
|
|
8548
|
+
style: {
|
|
8549
|
+
...columnSizeVars,
|
|
8550
|
+
width: Math.max(table.getTotalSize(), ref.current?.offsetWidth ?? table.getTotalSize())
|
|
8551
|
+
},
|
|
8552
|
+
children: [
|
|
8553
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8554
|
+
"col",
|
|
8555
|
+
{
|
|
8556
|
+
style: {
|
|
8557
|
+
width: `calc(var(--header-${header?.id}-size) * 1px)`,
|
|
8558
|
+
minWidth: header.column.columnDef.minSize,
|
|
8559
|
+
maxWidth: header.column.columnDef.maxSize
|
|
8560
|
+
}
|
|
8561
|
+
},
|
|
8562
|
+
header.id
|
|
8563
|
+
)) }, headerGroup.id)),
|
|
8564
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("tr", { className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
|
|
8565
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
|
|
8566
|
+
"th",
|
|
8567
|
+
{
|
|
8568
|
+
colSpan: header.colSpan,
|
|
8569
|
+
className: (0, import_clsx45.default)("relative group", header.column.columnDef.meta?.className),
|
|
8570
|
+
children: [
|
|
8571
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "row w-full", children: header.isPlaceholder ? null : /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "row gap-x-1 items-center", children: [
|
|
8572
|
+
header.column.getCanSort() && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8573
|
+
TableSortButton,
|
|
8574
|
+
{
|
|
8575
|
+
sortDirection: header.column.getIsSorted(),
|
|
8576
|
+
onClick: () => header.column.toggleSorting()
|
|
8577
|
+
}
|
|
8578
|
+
),
|
|
8579
|
+
header.column.getCanFilter() && header.column.columnDef.meta?.filterType ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8580
|
+
TableFilterButton,
|
|
8581
|
+
{
|
|
8582
|
+
column: header.column,
|
|
8583
|
+
filterType: header.column.columnDef.meta.filterType
|
|
8584
|
+
}
|
|
8585
|
+
) : null,
|
|
8586
|
+
(0, import_react_table.flexRender)(
|
|
8587
|
+
header.column.columnDef.header,
|
|
8588
|
+
header.getContext()
|
|
8589
|
+
)
|
|
8590
|
+
] }) }),
|
|
8591
|
+
header.column.getCanResize() && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8592
|
+
"div",
|
|
8593
|
+
{
|
|
8594
|
+
onMouseDown: header.getResizeHandler(),
|
|
8595
|
+
onTouchStart: header.getResizeHandler(),
|
|
8596
|
+
onDoubleClick: () => {
|
|
8597
|
+
header.column.resetSize();
|
|
8598
|
+
},
|
|
8599
|
+
className: "table-resize-indicator w-2 rounded bg-primary cursor-col-resize select-none touch-none opacity-0 group-hover:opacity-100 transition-opacity",
|
|
8600
|
+
style: {
|
|
8601
|
+
opacity: !columnSizingInfo?.columnSizingStart ? void 0 : columnSizingInfo?.columnSizingStart?.findIndex(([id, _]) => id === header.column.id) !== -1 ? 1 : columnSizingInfo?.columnSizingStart?.length !== 0 ? 0 : void 0
|
|
8602
|
+
}
|
|
8603
|
+
}
|
|
8604
|
+
)
|
|
8605
|
+
]
|
|
8606
|
+
},
|
|
8607
|
+
header.id
|
|
8608
|
+
);
|
|
8609
|
+
}) }, headerGroup.id)) }),
|
|
8610
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("tbody", { children: [
|
|
8611
|
+
table.getRowModel().rows.map((row) => {
|
|
8612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("tr", { onClick: () => onRowClick(row, table), className: table.options.meta?.bodyRowClassName, children: row.getVisibleCells().map((cell) => {
|
|
8613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("td", { children: (0, import_react_table.flexRender)(
|
|
8614
|
+
cell.column.columnDef.cell,
|
|
8615
|
+
cell.getContext()
|
|
8616
|
+
) }, cell.id);
|
|
8617
|
+
}) }, row.id);
|
|
8618
|
+
}),
|
|
8619
|
+
range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
|
|
8620
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("tr", { children: columns.map((column) => {
|
|
8621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(FillerRowElement, {}) }, column.id);
|
|
8622
|
+
}) }, "filler-row-" + index);
|
|
8623
|
+
})
|
|
8624
|
+
] })
|
|
8625
|
+
]
|
|
8626
|
+
}
|
|
8627
|
+
) }),
|
|
8628
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { className: "row justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8629
|
+
Pagination,
|
|
8630
|
+
{
|
|
8631
|
+
pageIndex: table.getState().pagination.pageIndex,
|
|
8632
|
+
pageCount: table.getPageCount(),
|
|
8633
|
+
onPageChanged: (page) => table.setPageIndex(page)
|
|
8634
|
+
}
|
|
8635
|
+
) })
|
|
8636
|
+
] });
|
|
8637
|
+
};
|
|
8638
|
+
var TableUncontrolled = ({ data, ...props }) => {
|
|
8639
|
+
const [usedDate, setUsedData] = (0, import_react29.useState)(data);
|
|
8640
|
+
(0, import_react29.useEffect)(() => {
|
|
8641
|
+
setUsedData(data);
|
|
8642
|
+
}, [data]);
|
|
8643
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8644
|
+
Table,
|
|
8645
|
+
{
|
|
8646
|
+
...props,
|
|
8647
|
+
data: usedDate
|
|
8648
|
+
}
|
|
8649
|
+
);
|
|
8650
|
+
};
|
|
8651
|
+
var TableWithSelection = ({
|
|
8652
|
+
columns,
|
|
8653
|
+
state,
|
|
8654
|
+
fillerRow,
|
|
8655
|
+
rowSelection,
|
|
8656
|
+
selectionRowId = "selection",
|
|
8657
|
+
onRowClick = noop,
|
|
8658
|
+
meta,
|
|
8659
|
+
...props
|
|
8660
|
+
}) => {
|
|
8661
|
+
const columnsWithSelection = (0, import_react29.useMemo)(() => {
|
|
8662
|
+
return [
|
|
8663
|
+
{
|
|
8664
|
+
id: selectionRowId,
|
|
8665
|
+
header: ({ table }) => {
|
|
8666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8667
|
+
Checkbox,
|
|
8668
|
+
{
|
|
8669
|
+
checked: table.getIsSomeRowsSelected() ? "indeterminate" : table.getIsAllRowsSelected(),
|
|
8670
|
+
onChangeTristate: (value) => {
|
|
8671
|
+
const newValue = !!value;
|
|
8672
|
+
table.toggleAllRowsSelected(newValue);
|
|
8673
|
+
},
|
|
8674
|
+
containerClassName: "max-w-6"
|
|
8675
|
+
}
|
|
8676
|
+
);
|
|
8677
|
+
},
|
|
8678
|
+
cell: ({ row }) => {
|
|
8679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8680
|
+
Checkbox,
|
|
8681
|
+
{
|
|
8682
|
+
disabled: !row.getCanSelect(),
|
|
8683
|
+
checked: row.getIsSelected(),
|
|
8684
|
+
onChange: row.getToggleSelectedHandler(),
|
|
8685
|
+
containerClassName: "max-w-6"
|
|
8686
|
+
}
|
|
8687
|
+
);
|
|
8688
|
+
},
|
|
8689
|
+
size: 60,
|
|
8690
|
+
minSize: 60,
|
|
8691
|
+
maxSize: 60,
|
|
8692
|
+
enableResizing: false,
|
|
8693
|
+
enableSorting: false
|
|
8694
|
+
},
|
|
8695
|
+
...columns
|
|
8696
|
+
];
|
|
8697
|
+
}, [columns, selectionRowId]);
|
|
8698
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
8699
|
+
Table,
|
|
8700
|
+
{
|
|
8701
|
+
columns: columnsWithSelection,
|
|
8702
|
+
fillerRow: (columnId, table) => {
|
|
8703
|
+
if (columnId === selectionRowId) {
|
|
8704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(Checkbox, { checked: false, disabled: true, containerClassName: "max-w-6" });
|
|
8705
|
+
}
|
|
8706
|
+
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(FillerRowElement, {});
|
|
8707
|
+
},
|
|
8708
|
+
state: {
|
|
8709
|
+
rowSelection,
|
|
8710
|
+
...state
|
|
8711
|
+
},
|
|
8712
|
+
onRowClick: (row, table) => {
|
|
8713
|
+
row.toggleSelected();
|
|
8714
|
+
onRowClick(row, table);
|
|
8715
|
+
},
|
|
8716
|
+
meta: {
|
|
8717
|
+
bodyRowClassName: "cursor-pointer",
|
|
8718
|
+
...meta
|
|
8719
|
+
},
|
|
8720
|
+
...props
|
|
8721
|
+
}
|
|
8722
|
+
);
|
|
8723
|
+
};
|
|
8724
|
+
|
|
8725
|
+
// src/components/user-action/DateAndTimePicker.tsx
|
|
8726
|
+
var import_clsx46 = __toESM(require("clsx"));
|
|
8727
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
8728
|
+
var DateTimePicker = ({
|
|
8729
|
+
overwriteTranslation,
|
|
8730
|
+
value = /* @__PURE__ */ new Date(),
|
|
8731
|
+
start = subtractDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
8732
|
+
end = addDuration(/* @__PURE__ */ new Date(), { years: 50 }),
|
|
8733
|
+
mode = "dateTime",
|
|
8734
|
+
onFinish = noop,
|
|
8735
|
+
onChange = noop,
|
|
8736
|
+
onRemove = noop,
|
|
8737
|
+
timePickerProps,
|
|
8738
|
+
datePickerProps
|
|
8739
|
+
}) => {
|
|
8740
|
+
const translation = useTranslation([formTranslation, timeTranslation], overwriteTranslation);
|
|
8741
|
+
const useDate = mode === "dateTime" || mode === "date";
|
|
8742
|
+
const useTime = mode === "dateTime" || mode === "time";
|
|
8743
|
+
let dateDisplay;
|
|
8744
|
+
let timeDisplay;
|
|
8745
|
+
if (useDate) {
|
|
8746
|
+
dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
8747
|
+
DatePicker,
|
|
8748
|
+
{
|
|
8749
|
+
...datePickerProps,
|
|
8750
|
+
className: "min-w-[320px] min-h-[250px]",
|
|
8751
|
+
yearMonthPickerProps: { maxHeight: 218 },
|
|
8752
|
+
value,
|
|
8753
|
+
start,
|
|
8754
|
+
end,
|
|
8755
|
+
onChange
|
|
8756
|
+
}
|
|
8757
|
+
);
|
|
8758
|
+
}
|
|
8759
|
+
if (useTime) {
|
|
8760
|
+
timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
8761
|
+
TimePicker,
|
|
8762
|
+
{
|
|
8763
|
+
...timePickerProps,
|
|
8764
|
+
className: (0, import_clsx46.default)("h-full", { "justify-between w-full": mode === "time" }),
|
|
8765
|
+
maxHeight: 250,
|
|
8766
|
+
time: value,
|
|
8767
|
+
onChange
|
|
8768
|
+
}
|
|
8769
|
+
);
|
|
8770
|
+
}
|
|
8771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "col w-fit", children: [
|
|
8772
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "row gap-x-4", children: [
|
|
8773
|
+
dateDisplay,
|
|
8774
|
+
timeDisplay
|
|
8775
|
+
] }),
|
|
8776
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "row justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)("div", { className: "row gap-x-2 mt-1", children: [
|
|
8777
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(SolidButton, { size: "medium", color: "negative", onClick: onRemove, children: translation("clear") }),
|
|
8778
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
8779
|
+
SolidButton,
|
|
8780
|
+
{
|
|
8781
|
+
size: "medium",
|
|
8782
|
+
onClick: () => onFinish(value),
|
|
8783
|
+
children: translation("change")
|
|
8784
|
+
}
|
|
8785
|
+
)
|
|
8786
|
+
] }) })
|
|
8787
|
+
] });
|
|
8788
|
+
};
|
|
8789
|
+
|
|
8790
|
+
// src/components/user-action/ScrollPicker.tsx
|
|
8791
|
+
var import_react30 = require("react");
|
|
8792
|
+
var import_clsx47 = __toESM(require("clsx"));
|
|
8793
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
8242
8794
|
var up = 1;
|
|
8243
8795
|
var down = -1;
|
|
8244
8796
|
var ScrollPicker = ({
|
|
@@ -8257,7 +8809,7 @@ var ScrollPicker = ({
|
|
|
8257
8809
|
transition,
|
|
8258
8810
|
items,
|
|
8259
8811
|
lastTimeStamp
|
|
8260
|
-
}, setAnimation] = (0,
|
|
8812
|
+
}, setAnimation] = (0, import_react30.useState)({
|
|
8261
8813
|
targetIndex: selectedIndex,
|
|
8262
8814
|
currentIndex: disabled ? selectedIndex : 0,
|
|
8263
8815
|
velocity: 0,
|
|
@@ -8266,14 +8818,14 @@ var ScrollPicker = ({
|
|
|
8266
8818
|
items: options
|
|
8267
8819
|
});
|
|
8268
8820
|
const itemsShownCount = 5;
|
|
8269
|
-
const shownItems = getNeighbours(range(
|
|
8821
|
+
const shownItems = getNeighbours(range(items.length), currentIndex).map((index) => ({
|
|
8270
8822
|
name: mapping(items[index]),
|
|
8271
8823
|
index
|
|
8272
8824
|
}));
|
|
8273
8825
|
const itemHeight = 40;
|
|
8274
8826
|
const distance = 8;
|
|
8275
8827
|
const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
|
|
8276
|
-
const getDirection = (0,
|
|
8828
|
+
const getDirection = (0, import_react30.useCallback)((targetIndex, currentIndex2, transition2, length) => {
|
|
8277
8829
|
if (targetIndex === currentIndex2) {
|
|
8278
8830
|
return transition2 > 0 ? up : down;
|
|
8279
8831
|
}
|
|
@@ -8283,7 +8835,7 @@ var ScrollPicker = ({
|
|
|
8283
8835
|
}
|
|
8284
8836
|
return distanceForward >= length / 2 ? down : up;
|
|
8285
8837
|
}, []);
|
|
8286
|
-
const animate = (0,
|
|
8838
|
+
const animate = (0, import_react30.useCallback)((timestamp, startTime) => {
|
|
8287
8839
|
setAnimation((prevState) => {
|
|
8288
8840
|
const {
|
|
8289
8841
|
targetIndex,
|
|
@@ -8356,7 +8908,7 @@ var ScrollPicker = ({
|
|
|
8356
8908
|
};
|
|
8357
8909
|
});
|
|
8358
8910
|
}, [disabled, getDirection, onChange]);
|
|
8359
|
-
(0,
|
|
8911
|
+
(0, import_react30.useEffect)(() => {
|
|
8360
8912
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
8361
8913
|
});
|
|
8362
8914
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -8377,7 +8929,7 @@ var ScrollPicker = ({
|
|
|
8377
8929
|
}
|
|
8378
8930
|
return clamp(1 - opacityValue / max);
|
|
8379
8931
|
};
|
|
8380
|
-
return /* @__PURE__ */ (0,
|
|
8932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8381
8933
|
"div",
|
|
8382
8934
|
{
|
|
8383
8935
|
className: "relative overflow-hidden",
|
|
@@ -8387,15 +8939,15 @@ var ScrollPicker = ({
|
|
|
8387
8939
|
setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + event.deltaY }));
|
|
8388
8940
|
}
|
|
8389
8941
|
},
|
|
8390
|
-
children: /* @__PURE__ */ (0,
|
|
8391
|
-
/* @__PURE__ */ (0,
|
|
8942
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
|
|
8943
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8392
8944
|
"div",
|
|
8393
8945
|
{
|
|
8394
8946
|
className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-divider/30 border-y-2 border-x-0 ",
|
|
8395
8947
|
style: { height: `${itemHeight}px` }
|
|
8396
8948
|
}
|
|
8397
8949
|
),
|
|
8398
|
-
/* @__PURE__ */ (0,
|
|
8950
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8399
8951
|
"div",
|
|
8400
8952
|
{
|
|
8401
8953
|
className: "col select-none",
|
|
@@ -8403,10 +8955,10 @@ var ScrollPicker = ({
|
|
|
8403
8955
|
transform: `translateY(${-transition * (distance + itemHeight)}px)`,
|
|
8404
8956
|
columnGap: `${distance}px`
|
|
8405
8957
|
},
|
|
8406
|
-
children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ (0,
|
|
8958
|
+
children: shownItems.map(({ name, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
8407
8959
|
"div",
|
|
8408
8960
|
{
|
|
8409
|
-
className: (0,
|
|
8961
|
+
className: (0, import_clsx47.default)(
|
|
8410
8962
|
`col items-center justify-center rounded-md`,
|
|
8411
8963
|
{
|
|
8412
8964
|
"text-primary font-bold": currentIndex === index,
|
|
@@ -8433,10 +8985,10 @@ var ScrollPicker = ({
|
|
|
8433
8985
|
};
|
|
8434
8986
|
|
|
8435
8987
|
// src/components/user-action/ToggleableInput.tsx
|
|
8436
|
-
var
|
|
8437
|
-
var
|
|
8438
|
-
var
|
|
8439
|
-
var
|
|
8988
|
+
var import_react31 = require("react");
|
|
8989
|
+
var import_lucide_react23 = require("lucide-react");
|
|
8990
|
+
var import_clsx48 = __toESM(require("clsx"));
|
|
8991
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
8440
8992
|
var ToggleableInput = ({
|
|
8441
8993
|
type = "text",
|
|
8442
8994
|
value,
|
|
@@ -8448,28 +9000,29 @@ var ToggleableInput = ({
|
|
|
8448
9000
|
size = 16,
|
|
8449
9001
|
disclaimer,
|
|
8450
9002
|
onBlur,
|
|
9003
|
+
saveDelayOptions,
|
|
8451
9004
|
...restProps
|
|
8452
9005
|
}) => {
|
|
8453
|
-
const [isEditing, setIsEditing] = (0,
|
|
8454
|
-
const { restartTimer,
|
|
8455
|
-
const ref = (0,
|
|
9006
|
+
const [isEditing, setIsEditing] = (0, import_react31.useState)(initialState !== "display");
|
|
9007
|
+
const { restartTimer, clearTimer } = useDelay(saveDelayOptions);
|
|
9008
|
+
const ref = (0, import_react31.useRef)(null);
|
|
8456
9009
|
const onEditCompletedWrapper = (text) => {
|
|
8457
9010
|
onEditCompleted(text);
|
|
8458
|
-
|
|
9011
|
+
clearTimer();
|
|
8459
9012
|
};
|
|
8460
|
-
(0,
|
|
9013
|
+
(0, import_react31.useEffect)(() => {
|
|
8461
9014
|
if (isEditing) {
|
|
8462
9015
|
ref.current?.focus();
|
|
8463
9016
|
}
|
|
8464
9017
|
}, [isEditing]);
|
|
8465
|
-
return /* @__PURE__ */ (0,
|
|
8466
|
-
/* @__PURE__ */ (0,
|
|
9018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { children: [
|
|
9019
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
8467
9020
|
"div",
|
|
8468
9021
|
{
|
|
8469
|
-
className: (0,
|
|
9022
|
+
className: (0, import_clsx48.default)("row items-center w-full gap-x-2 overflow-hidden", { "cursor-pointer": !isEditing }),
|
|
8470
9023
|
onClick: () => !isEditing ? setIsEditing(!isEditing) : void 0,
|
|
8471
9024
|
children: [
|
|
8472
|
-
/* @__PURE__ */ (0,
|
|
9025
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: (0, import_clsx48.default)("row overflow-hidden", { "flex-1": isEditing }), children: isEditing ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8473
9026
|
"input",
|
|
8474
9027
|
{
|
|
8475
9028
|
ref,
|
|
@@ -8497,16 +9050,16 @@ var ToggleableInput = ({
|
|
|
8497
9050
|
onEditCompletedWrapper(value);
|
|
8498
9051
|
}
|
|
8499
9052
|
},
|
|
8500
|
-
className: (0,
|
|
9053
|
+
className: (0, import_clsx48.default)(`w-full border-none rounded-none ring-0 outline-0 text-inherit bg-inherit shadow-transparent decoration-primary p-0 underline-offset-4`, {
|
|
8501
9054
|
underline: isEditing
|
|
8502
9055
|
}, labelClassName),
|
|
8503
9056
|
onFocus: (event) => event.target.select()
|
|
8504
9057
|
}
|
|
8505
|
-
) : /* @__PURE__ */ (0,
|
|
8506
|
-
/* @__PURE__ */ (0,
|
|
8507
|
-
|
|
9058
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: (0, import_clsx48.default)("max-w-xs break-words overflow-hidden", labelClassName), children: value }) }),
|
|
9059
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
9060
|
+
import_lucide_react23.Pencil,
|
|
8508
9061
|
{
|
|
8509
|
-
className: (0,
|
|
9062
|
+
className: (0, import_clsx48.default)(`cursor-pointer`, { "text-transparent": isEditing }),
|
|
8510
9063
|
size,
|
|
8511
9064
|
style: { minWidth: `${size}px` }
|
|
8512
9065
|
}
|
|
@@ -8514,7 +9067,7 @@ var ToggleableInput = ({
|
|
|
8514
9067
|
]
|
|
8515
9068
|
}
|
|
8516
9069
|
),
|
|
8517
|
-
isEditing && disclaimer && /* @__PURE__ */ (0,
|
|
9070
|
+
isEditing && disclaimer && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("label", { className: "text-negative", children: disclaimer })
|
|
8518
9071
|
] });
|
|
8519
9072
|
};
|
|
8520
9073
|
var ToggleableInputUncontrolled = ({
|
|
@@ -8522,11 +9075,11 @@ var ToggleableInputUncontrolled = ({
|
|
|
8522
9075
|
onChangeText = noop,
|
|
8523
9076
|
...restProps
|
|
8524
9077
|
}) => {
|
|
8525
|
-
const [value, setValue] = (0,
|
|
8526
|
-
(0,
|
|
9078
|
+
const [value, setValue] = (0, import_react31.useState)(initialValue);
|
|
9079
|
+
(0, import_react31.useEffect)(() => {
|
|
8527
9080
|
setValue(initialValue);
|
|
8528
9081
|
}, [initialValue]);
|
|
8529
|
-
return /* @__PURE__ */ (0,
|
|
9082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
8530
9083
|
ToggleableInput,
|
|
8531
9084
|
{
|
|
8532
9085
|
value,
|
|
@@ -8539,6 +9092,12 @@ var ToggleableInputUncontrolled = ({
|
|
|
8539
9092
|
);
|
|
8540
9093
|
};
|
|
8541
9094
|
|
|
9095
|
+
// src/hooks/useRerender.ts
|
|
9096
|
+
var import_react32 = require("react");
|
|
9097
|
+
var useRerender = () => {
|
|
9098
|
+
return (0, import_react32.useReducer)(() => ({}), {})[1];
|
|
9099
|
+
};
|
|
9100
|
+
|
|
8542
9101
|
// src/util/builder.ts
|
|
8543
9102
|
var builder = (value, update) => {
|
|
8544
9103
|
update(value);
|
|
@@ -8577,6 +9136,11 @@ var localizedNewsSchema = import_zod.z.record(import_zod.z.enum(LanguageUtil.lan
|
|
|
8577
9136
|
var filterNews = (localizedNews, requiredKeys) => {
|
|
8578
9137
|
return localizedNews.filter((news) => requiredKeys.every((value) => news.keys.includes(value)));
|
|
8579
9138
|
};
|
|
9139
|
+
|
|
9140
|
+
// src/util/resolveSetState.ts
|
|
9141
|
+
function resolveSetState(action, prev) {
|
|
9142
|
+
return typeof action === "function" ? action(prev) : action;
|
|
9143
|
+
}
|
|
8580
9144
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8581
9145
|
0 && (module.exports = {
|
|
8582
9146
|
ASTNodeInterpreter,
|
|
@@ -8611,10 +9175,12 @@ var filterNews = (localizedNews, requiredKeys) => {
|
|
|
8611
9175
|
Expandable,
|
|
8612
9176
|
ExpandableUncontrolled,
|
|
8613
9177
|
FAQSection,
|
|
9178
|
+
FillerRowElement,
|
|
8614
9179
|
FormInput,
|
|
8615
9180
|
Helpwave,
|
|
8616
9181
|
HelpwaveBadge,
|
|
8617
9182
|
IconButton,
|
|
9183
|
+
IconButtonUtil,
|
|
8618
9184
|
Input,
|
|
8619
9185
|
InputModal,
|
|
8620
9186
|
InputUncontrolled,
|
|
@@ -8656,10 +9222,15 @@ var filterNews = (localizedNews, requiredKeys) => {
|
|
|
8656
9222
|
SimpleSearchWithMapping,
|
|
8657
9223
|
SingleSelectProperty,
|
|
8658
9224
|
SolidButton,
|
|
8659
|
-
SortButton,
|
|
8660
9225
|
StepperBar,
|
|
8661
9226
|
StepperBarUncontrolled,
|
|
8662
9227
|
Table,
|
|
9228
|
+
TableCell,
|
|
9229
|
+
TableFilterButton,
|
|
9230
|
+
TableFilters,
|
|
9231
|
+
TableSortButton,
|
|
9232
|
+
TableUncontrolled,
|
|
9233
|
+
TableWithSelection,
|
|
8663
9234
|
TagIcon,
|
|
8664
9235
|
TextButton,
|
|
8665
9236
|
TextImage,
|
|
@@ -8682,18 +9253,14 @@ var filterNews = (localizedNews, requiredKeys) => {
|
|
|
8682
9253
|
YearMonthPicker,
|
|
8683
9254
|
YearMonthPickerUncontrolled,
|
|
8684
9255
|
addDuration,
|
|
8685
|
-
addElementToTable,
|
|
8686
9256
|
avatarSizeMapping,
|
|
8687
9257
|
avtarSizeList,
|
|
8688
9258
|
builder,
|
|
8689
9259
|
changeDuration,
|
|
8690
|
-
changeTableSelectionSingle,
|
|
8691
9260
|
clamp,
|
|
8692
9261
|
closestMatch,
|
|
8693
9262
|
createLoopingList,
|
|
8694
9263
|
createLoopingListWithIndex,
|
|
8695
|
-
defaultTableStatePagination,
|
|
8696
|
-
defaultTableStateSelection,
|
|
8697
9264
|
equalDate,
|
|
8698
9265
|
equalSizeGroups,
|
|
8699
9266
|
filterNews,
|
|
@@ -8705,7 +9272,6 @@ var filterNews = (localizedNews, requiredKeys) => {
|
|
|
8705
9272
|
getDaysInMonth,
|
|
8706
9273
|
getNeighbours,
|
|
8707
9274
|
getWeeksForCalenderMonth,
|
|
8708
|
-
isDataObjectSelected,
|
|
8709
9275
|
isInTimeSpan,
|
|
8710
9276
|
localizedNewsSchema,
|
|
8711
9277
|
monthTranslation,
|
|
@@ -8713,19 +9279,21 @@ var filterNews = (localizedNews, requiredKeys) => {
|
|
|
8713
9279
|
newsListSchema,
|
|
8714
9280
|
newsSchema,
|
|
8715
9281
|
noop,
|
|
8716
|
-
pageForItem,
|
|
8717
9282
|
range,
|
|
8718
|
-
|
|
9283
|
+
resolveSetState,
|
|
8719
9284
|
shadingColorValues,
|
|
8720
9285
|
subtractDuration,
|
|
8721
9286
|
timeTranslation,
|
|
8722
|
-
|
|
9287
|
+
useDelay,
|
|
9288
|
+
useFocusManagement,
|
|
9289
|
+
useFocusOnceVisible,
|
|
8723
9290
|
useHoverState,
|
|
8724
9291
|
useLanguage,
|
|
8725
9292
|
useLocalStorage,
|
|
8726
9293
|
useLocale,
|
|
8727
9294
|
useOutsideClick,
|
|
8728
|
-
|
|
9295
|
+
useRerender,
|
|
9296
|
+
useResizeCallbackWrapper,
|
|
8729
9297
|
useSearch,
|
|
8730
9298
|
useTheme,
|
|
8731
9299
|
useTranslation,
|