@helpwave/hightide 0.1.10 → 0.1.12

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