@povio/ui 2.3.0-rc.6 → 2.3.0-rc.7

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 (191) hide show
  1. package/dist/assets/icons/AlignCenter.js +26 -11
  2. package/dist/assets/icons/AlignLeft.js +26 -11
  3. package/dist/assets/icons/AlignLeftRight.js +26 -11
  4. package/dist/assets/icons/AlignRight.js +26 -11
  5. package/dist/assets/icons/ArrowDropDown.js +26 -11
  6. package/dist/assets/icons/ArrowDropUp.js +26 -11
  7. package/dist/assets/icons/ArrowLeft.js +26 -11
  8. package/dist/assets/icons/ArrowRight.js +26 -11
  9. package/dist/assets/icons/Bold.js +26 -11
  10. package/dist/assets/icons/BulletedList.js +26 -11
  11. package/dist/assets/icons/Calendar.js +28 -13
  12. package/dist/assets/icons/Check.js +28 -13
  13. package/dist/assets/icons/CheckCircle.js +26 -11
  14. package/dist/assets/icons/CheckboxCheckmark.js +29 -14
  15. package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
  16. package/dist/assets/icons/ChevronDown.js +28 -13
  17. package/dist/assets/icons/ChevronLeft.js +28 -13
  18. package/dist/assets/icons/ChevronRight.js +28 -13
  19. package/dist/assets/icons/ChevronUp.js +28 -13
  20. package/dist/assets/icons/ChevronsLeft.js +28 -13
  21. package/dist/assets/icons/ChevronsRight.js +28 -13
  22. package/dist/assets/icons/Clock.js +26 -11
  23. package/dist/assets/icons/Close.js +26 -11
  24. package/dist/assets/icons/DateTime.js +35 -14
  25. package/dist/assets/icons/DragIndicator.js +26 -11
  26. package/dist/assets/icons/File.js +28 -13
  27. package/dist/assets/icons/Highlight.js +26 -11
  28. package/dist/assets/icons/HighlightOn.js +49 -15
  29. package/dist/assets/icons/Home.js +26 -11
  30. package/dist/assets/icons/Info.js +37 -16
  31. package/dist/assets/icons/Italic.js +26 -11
  32. package/dist/assets/icons/Link.js +26 -11
  33. package/dist/assets/icons/Menu.js +26 -11
  34. package/dist/assets/icons/NumberedList.js +26 -11
  35. package/dist/assets/icons/PointerHorizontal.js +26 -11
  36. package/dist/assets/icons/PointerVertical.js +26 -11
  37. package/dist/assets/icons/Search.js +26 -11
  38. package/dist/assets/icons/Send.js +28 -13
  39. package/dist/assets/icons/Strikethrough.js +26 -11
  40. package/dist/assets/icons/TextColor.js +48 -14
  41. package/dist/assets/icons/Today.js +26 -11
  42. package/dist/assets/icons/Underlined.js +28 -13
  43. package/dist/assets/icons/Upload.js +35 -14
  44. package/dist/assets/icons/Visibility.js +26 -11
  45. package/dist/assets/icons/VisibilityOff.js +26 -11
  46. package/dist/assets/icons/WarningFilled.js +28 -13
  47. package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
  48. package/dist/components/Menu/Menu.js +18 -2
  49. package/dist/components/Menu/MenuDesktop.js +41 -7
  50. package/dist/components/Menu/MenuItem.js +32 -9
  51. package/dist/components/Menu/MenuMobile.js +97 -38
  52. package/dist/components/Menu/MenuPopover.js +105 -29
  53. package/dist/components/buttons/IconButton/IconButton.js +40 -8
  54. package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
  55. package/dist/components/buttons/PillButton/PillButton.js +55 -17
  56. package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
  57. package/dist/components/buttons/TextButton/TextButton.js +30 -8
  58. package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
  59. package/dist/components/buttons/shared/ButtonContent.js +80 -22
  60. package/dist/components/inputs/Checkbox/Checkbox.js +164 -34
  61. package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
  62. package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +8 -8
  63. package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +103 -103
  64. package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +9 -9
  65. package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +384 -116
  66. package/dist/components/inputs/DateTime/shared/Calendar.js +331 -137
  67. package/dist/components/inputs/DateTime/shared/CalendarCell.js +283 -102
  68. package/dist/components/inputs/DateTime/shared/CalendarGrid.js +142 -33
  69. package/dist/components/inputs/DateTime/shared/CalendarHeader.js +245 -90
  70. package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
  71. package/dist/components/inputs/DateTime/shared/DateField.js +296 -112
  72. package/dist/components/inputs/DateTime/shared/DatePickerInput.js +345 -142
  73. package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +94 -21
  74. package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +81 -27
  75. package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
  76. package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
  77. package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
  78. package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
  79. package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
  80. package/dist/components/inputs/DateTime/shared/TimePickerInput.js +205 -70
  81. package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
  82. package/dist/components/inputs/File/FileUpload.js +86 -44
  83. package/dist/components/inputs/File/FileUploadContainer.js +15 -7
  84. package/dist/components/inputs/File/InputUpload.js +317 -79
  85. package/dist/components/inputs/File/shared/FileCard.js +104 -41
  86. package/dist/components/inputs/File/shared/FileCardList.js +47 -12
  87. package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
  88. package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
  89. package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
  90. package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
  91. package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
  92. package/dist/components/inputs/File/shared/InputUploadContent.js +148 -35
  93. package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
  94. package/dist/components/inputs/File/shared/ProgressBar.js +48 -9
  95. package/dist/components/inputs/FormField/FormField.js +119 -37
  96. package/dist/components/inputs/FormField/FormFieldError.js +25 -5
  97. package/dist/components/inputs/FormField/FormFieldHeader.js +79 -22
  98. package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
  99. package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
  100. package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
  101. package/dist/components/inputs/Input/NumberInput/NumberInput.js +253 -82
  102. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +541 -116
  103. package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +314 -75
  104. package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
  105. package/dist/components/inputs/Input/TextArea/TextArea.js +298 -89
  106. package/dist/components/inputs/Input/TextInput/TextInput.js +241 -81
  107. package/dist/components/inputs/Input/shared/InputContent.js +190 -58
  108. package/dist/components/inputs/Inputs/Form.js +40 -11
  109. package/dist/components/inputs/Inputs/InputItem.js +65 -14
  110. package/dist/components/inputs/Inputs/Inputs.js +37 -11
  111. package/dist/components/inputs/RadioGroup/RadioGroup.js +317 -106
  112. package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
  113. package/dist/components/inputs/Selection/Select/QuerySelect.js +107 -27
  114. package/dist/components/inputs/Selection/shared/SelectBase.js +69 -20
  115. package/dist/components/inputs/Selection/shared/SelectDesktop.js +390 -143
  116. package/dist/components/inputs/Selection/shared/SelectInput.js +334 -136
  117. package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
  118. package/dist/components/inputs/Selection/shared/SelectListBox.js +163 -51
  119. package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
  120. package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
  121. package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
  122. package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
  123. package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +36 -11
  124. package/dist/components/inputs/Selection/shared/select.context.js +34 -34
  125. package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
  126. package/dist/components/inputs/Skeleton/InputFrame.js +472 -145
  127. package/dist/components/inputs/Slider/Slider.js +247 -74
  128. package/dist/components/inputs/TextEditor/TextEditor.js +447 -103
  129. package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
  130. package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
  131. package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
  132. package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
  133. package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
  134. package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
  135. package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
  136. package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
  137. package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
  138. package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
  139. package/dist/components/inputs/Toggle/Toggle.js +187 -41
  140. package/dist/components/inputs/shared/CheckContent.js +21 -10
  141. package/dist/components/inputs/shared/InputClear.js +78 -21
  142. package/dist/components/inputs/shared/TooltipWrapper.js +47 -12
  143. package/dist/components/inputs/shared/input.cva.js +13 -3
  144. package/dist/components/inputs/shared/useStaticInputHandoff.js +93 -50
  145. package/dist/components/navigation/Accordion/Accordion.js +69 -22
  146. package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
  147. package/dist/components/navigation/Stepper/Stepper.js +67 -22
  148. package/dist/components/navigation/Stepper/StepperItem.js +104 -31
  149. package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
  150. package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
  151. package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
  152. package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
  153. package/dist/components/overlays/Drawer/Drawer.js +62 -20
  154. package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +83 -27
  155. package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
  156. package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
  157. package/dist/components/segment/Segment.js +218 -57
  158. package/dist/components/segment/SegmentItem.js +67 -10
  159. package/dist/components/shared/pagination/Pagination.js +108 -22
  160. package/dist/components/shared/pagination/PaginationList.js +167 -64
  161. package/dist/components/status/Alert/Alert.js +97 -30
  162. package/dist/components/status/Loader/Loader.js +77 -22
  163. package/dist/components/status/Toast/Toast.js +21 -13
  164. package/dist/components/status/Toast/useToast.js +62 -57
  165. package/dist/components/table/ColumnConfig.js +158 -54
  166. package/dist/components/table/InfiniteTable.js +67 -16
  167. package/dist/components/table/PaginatedTable.js +84 -18
  168. package/dist/components/table/Table.js +23 -23
  169. package/dist/components/text/Link/Link.js +19 -7
  170. package/dist/components/text/Typography/Typography.js +23 -8
  171. package/dist/config/confirmation.context.js +1 -1
  172. package/dist/config/link.context.js +23 -9
  173. package/dist/config/router.context.js +42 -16
  174. package/dist/config/theme.context.js +98 -45
  175. package/dist/config/uiConfig.context.js +39 -8
  176. package/dist/config/uiStyle.context.js +15 -5
  177. package/dist/hooks/useBreakpoint.js +16 -3
  178. package/dist/hooks/useDebounceCallback.js +51 -17
  179. package/dist/hooks/useFilters.js +125 -64
  180. package/dist/hooks/useForm.js +42 -8
  181. package/dist/hooks/useFormAutosave.js +101 -30
  182. package/dist/hooks/useIntersectionObserver.js +86 -32
  183. package/dist/hooks/useLocalStorage.js +43 -10
  184. package/dist/hooks/useLongPressRepeat.js +55 -20
  185. package/dist/hooks/usePagination.js +49 -19
  186. package/dist/hooks/useScrollableListBox.js +37 -16
  187. package/dist/hooks/useSorting.js +69 -28
  188. package/dist/hooks/useStateAndRef.js +21 -7
  189. package/dist/hooks/useTableColumnConfig.js +124 -31
  190. package/dist/hooks/useTranslationMemo.js +25 -5
  191. package/package.json +1 -1
@@ -1,65 +1,70 @@
1
1
  import { Toast } from "./Toast.js";
2
+ import { c } from "react/compiler-runtime";
2
3
  import { jsx } from "react/jsx-runtime";
3
- import { useCallback, useMemo } from "react";
4
4
  import { toast } from "react-toastify";
5
5
  //#region src/components/status/Toast/useToast.tsx
6
6
  var useToast = () => {
7
- const successToast = useCallback((params, options) => {
8
- return toast.success(/* @__PURE__ */ jsx(Toast, {
9
- color: "success",
10
- ...params
11
- }), {
12
- ...options,
13
- position: params.position,
14
- data: { variant: params.variant }
15
- });
16
- }, []);
17
- const errorToast = useCallback((params, options) => {
18
- return toast.error(/* @__PURE__ */ jsx(Toast, {
19
- color: "error",
20
- ...params
21
- }), {
22
- ...options,
23
- position: params.position,
24
- data: { variant: params.variant }
25
- });
26
- }, []);
27
- const warningToast = useCallback((params, options) => {
28
- return toast.warning(/* @__PURE__ */ jsx(Toast, {
29
- color: "warning",
30
- ...params
31
- }), {
32
- ...options,
33
- position: params.position,
34
- data: { variant: params.variant }
35
- });
36
- }, []);
37
- const neutralToast = useCallback((params, options) => {
38
- return toast.info(/* @__PURE__ */ jsx(Toast, {
39
- color: "neutral",
40
- ...params
41
- }), {
42
- ...options,
43
- position: params.position,
44
- data: { variant: params.variant }
45
- });
46
- }, []);
47
- const closeToast = useCallback((id) => {
48
- toast.dismiss(id);
49
- }, []);
50
- return useMemo(() => ({
51
- successToast,
52
- errorToast,
53
- warningToast,
54
- neutralToast,
55
- closeToast
56
- }), [
57
- successToast,
58
- errorToast,
59
- warningToast,
60
- neutralToast,
61
- closeToast
62
- ]);
7
+ const $ = c(1);
8
+ const successToast = _temp;
9
+ const errorToast = _temp2;
10
+ const warningToast = _temp3;
11
+ const neutralToast = _temp4;
12
+ const closeToast = _temp5;
13
+ let t0;
14
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
15
+ t0 = {
16
+ successToast,
17
+ errorToast,
18
+ warningToast,
19
+ neutralToast,
20
+ closeToast
21
+ };
22
+ $[0] = t0;
23
+ } else t0 = $[0];
24
+ return t0;
63
25
  };
26
+ function _temp(params, options) {
27
+ return toast.success(/* @__PURE__ */ jsx(Toast, {
28
+ color: "success",
29
+ ...params
30
+ }), {
31
+ ...options,
32
+ position: params.position,
33
+ data: { variant: params.variant }
34
+ });
35
+ }
36
+ function _temp2(params_0, options_0) {
37
+ return toast.error(/* @__PURE__ */ jsx(Toast, {
38
+ color: "error",
39
+ ...params_0
40
+ }), {
41
+ ...options_0,
42
+ position: params_0.position,
43
+ data: { variant: params_0.variant }
44
+ });
45
+ }
46
+ function _temp3(params_1, options_1) {
47
+ return toast.warning(/* @__PURE__ */ jsx(Toast, {
48
+ color: "warning",
49
+ ...params_1
50
+ }), {
51
+ ...options_1,
52
+ position: params_1.position,
53
+ data: { variant: params_1.variant }
54
+ });
55
+ }
56
+ function _temp4(params_2, options_2) {
57
+ return toast.info(/* @__PURE__ */ jsx(Toast, {
58
+ color: "neutral",
59
+ ...params_2
60
+ }), {
61
+ ...options_2,
62
+ position: params_2.position,
63
+ data: { variant: params_2.variant }
64
+ });
65
+ }
66
+ function _temp5(id) {
67
+ toast.dismiss(id);
68
+ }
64
69
  //#endregion
65
70
  export { useToast };
@@ -4,16 +4,37 @@ import { Checkbox } from "../inputs/Checkbox/Checkbox.js";
4
4
  import { Modal } from "../overlays/Modal/Modal.js";
5
5
  import { Table } from "./Table.js";
6
6
  import { useTranslationMemo } from "../../hooks/useTranslationMemo.js";
7
+ import { c } from "react/compiler-runtime";
7
8
  import { jsx, jsxs } from "react/jsx-runtime";
8
- import { useCallback, useEffect, useState } from "react";
9
+ import { useEffect, useState } from "react";
9
10
  import { useTranslation } from "react-i18next";
10
11
  //#region src/components/table/ColumnConfig.tsx
11
- var VisibilityCell = ({ original, onToggle }) => /* @__PURE__ */ jsx(Checkbox, {
12
- isSelected: original.visible,
13
- onChange: () => onToggle(original.id),
14
- hideLabel: true,
15
- children: original.label
16
- });
12
+ var VisibilityCell = (t0) => {
13
+ const $ = c(7);
14
+ const { original, onToggle } = t0;
15
+ let t1;
16
+ if ($[0] !== onToggle || $[1] !== original.id) {
17
+ t1 = () => onToggle(original.id);
18
+ $[0] = onToggle;
19
+ $[1] = original.id;
20
+ $[2] = t1;
21
+ } else t1 = $[2];
22
+ const t2 = original.label;
23
+ let t3;
24
+ if ($[3] !== original.visible || $[4] !== t1 || $[5] !== t2) {
25
+ t3 = /* @__PURE__ */ jsx(Checkbox, {
26
+ isSelected: original.visible,
27
+ onChange: t1,
28
+ hideLabel: true,
29
+ children: t2
30
+ });
31
+ $[3] = original.visible;
32
+ $[4] = t1;
33
+ $[5] = t2;
34
+ $[6] = t3;
35
+ } else t3 = $[6];
36
+ return t3;
37
+ };
17
38
  var getColumns = (t, handleToggleVisibility) => [{
18
39
  id: "name",
19
40
  header: t(($) => $.ui.table.column, { ns: "ui" }),
@@ -28,56 +49,139 @@ var getColumns = (t, handleToggleVisibility) => [{
28
49
  onToggle: handleToggleVisibility
29
50
  })
30
51
  }];
31
- function ColumnConfigModal({ isOpen, onClose, configColumns, visibleColumns, onVisibilityChange, onOrderChange }) {
52
+ function ColumnConfigModal(t0) {
53
+ const $ = c(27);
54
+ const { isOpen, onClose, configColumns, visibleColumns, onVisibilityChange, onOrderChange } = t0;
32
55
  const { t } = useTranslation("ui");
33
- const [data, setData] = useState([]);
34
- useEffect(() => {
35
- setData(configColumns.map((column) => {
36
- const columnId = column.id ?? column.accessorKey;
37
- return {
38
- id: columnId,
39
- label: column.header,
40
- visible: visibleColumns?.[columnId] ?? true
41
- };
42
- }));
43
- }, [configColumns, visibleColumns]);
44
- const handleToggleVisibility = useCallback((columnId) => {
45
- onVisibilityChange({
46
- ...visibleColumns,
47
- [columnId]: !visibleColumns[columnId]
48
- });
49
- }, [visibleColumns, onVisibilityChange]);
50
- const columns = useTranslationMemo(useCallback((translateFn) => getColumns(translateFn, handleToggleVisibility), [handleToggleVisibility]));
51
- const handleReorder = useCallback((reorderedItems) => {
52
- setData(reorderedItems);
53
- onOrderChange(reorderedItems.map((item) => item.id));
54
- }, [onOrderChange]);
56
+ let t1;
57
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
58
+ t1 = [];
59
+ $[0] = t1;
60
+ } else t1 = $[0];
61
+ const [data, setData] = useState(t1);
62
+ let t2;
63
+ let t3;
64
+ if ($[1] !== configColumns || $[2] !== visibleColumns) {
65
+ t2 = () => {
66
+ setData(configColumns.map((column) => {
67
+ const columnId = column.id ?? column.accessorKey;
68
+ return {
69
+ id: columnId,
70
+ label: column.header,
71
+ visible: visibleColumns?.[columnId] ?? true
72
+ };
73
+ }));
74
+ };
75
+ t3 = [configColumns, visibleColumns];
76
+ $[1] = configColumns;
77
+ $[2] = visibleColumns;
78
+ $[3] = t2;
79
+ $[4] = t3;
80
+ } else {
81
+ t2 = $[3];
82
+ t3 = $[4];
83
+ }
84
+ useEffect(t2, t3);
85
+ let t4;
86
+ if ($[5] !== onVisibilityChange || $[6] !== visibleColumns) {
87
+ t4 = (columnId_0) => {
88
+ onVisibilityChange({
89
+ ...visibleColumns,
90
+ [columnId_0]: !visibleColumns[columnId_0]
91
+ });
92
+ };
93
+ $[5] = onVisibilityChange;
94
+ $[6] = visibleColumns;
95
+ $[7] = t4;
96
+ } else t4 = $[7];
97
+ const handleToggleVisibility = t4;
98
+ let t5;
99
+ if ($[8] !== handleToggleVisibility) {
100
+ t5 = (translateFn) => getColumns(translateFn, handleToggleVisibility);
101
+ $[8] = handleToggleVisibility;
102
+ $[9] = t5;
103
+ } else t5 = $[9];
104
+ const columns = useTranslationMemo(t5);
105
+ let t6;
106
+ if ($[10] !== onOrderChange) {
107
+ t6 = (reorderedItems) => {
108
+ setData(reorderedItems);
109
+ onOrderChange(reorderedItems.map(_temp));
110
+ };
111
+ $[10] = onOrderChange;
112
+ $[11] = t6;
113
+ } else t6 = $[11];
114
+ const handleReorder = t6;
55
115
  if (!isOpen) return null;
56
- return /* @__PURE__ */ jsx(Modal, {
57
- isOpen,
58
- onClose,
59
- showCloseIcon: true,
60
- children: /* @__PURE__ */ jsxs("div", {
116
+ let t7;
117
+ if ($[12] !== t) {
118
+ t7 = t(_temp2);
119
+ $[12] = t;
120
+ $[13] = t7;
121
+ } else t7 = $[13];
122
+ let t8;
123
+ if ($[14] !== t7) {
124
+ t8 = /* @__PURE__ */ jsx(Typography, {
125
+ as: "h2",
126
+ variant: "prominent-1",
127
+ size: "title-5",
128
+ children: t7
129
+ });
130
+ $[14] = t7;
131
+ $[15] = t8;
132
+ } else t8 = $[15];
133
+ let t9;
134
+ if ($[16] !== columns || $[17] !== data || $[18] !== handleReorder) {
135
+ t9 = /* @__PURE__ */ jsx("div", {
136
+ className: "max-h-96 overflow-y-auto",
137
+ children: /* @__PURE__ */ jsx(Table, {
138
+ items: data,
139
+ columns,
140
+ showCellBorder: true,
141
+ className: "w-full",
142
+ enableDragDrop: true,
143
+ getRowId: _temp3,
144
+ onReorder: handleReorder
145
+ })
146
+ });
147
+ $[16] = columns;
148
+ $[17] = data;
149
+ $[18] = handleReorder;
150
+ $[19] = t9;
151
+ } else t9 = $[19];
152
+ let t10;
153
+ if ($[20] !== t8 || $[21] !== t9) {
154
+ t10 = /* @__PURE__ */ jsxs("div", {
61
155
  className: "flex flex-col gap-2 p-4",
62
- children: [/* @__PURE__ */ jsx(Typography, {
63
- as: "h2",
64
- variant: "prominent-1",
65
- size: "title-5",
66
- children: t(($) => $.ui.table.configureColumns)
67
- }), /* @__PURE__ */ jsx("div", {
68
- className: "max-h-96 overflow-y-auto",
69
- children: /* @__PURE__ */ jsx(Table, {
70
- items: data,
71
- columns,
72
- showCellBorder: true,
73
- className: "w-full",
74
- enableDragDrop: true,
75
- getRowId: (row) => row.id,
76
- onReorder: handleReorder
77
- })
78
- })]
79
- })
80
- });
156
+ children: [t8, t9]
157
+ });
158
+ $[20] = t8;
159
+ $[21] = t9;
160
+ $[22] = t10;
161
+ } else t10 = $[22];
162
+ let t11;
163
+ if ($[23] !== isOpen || $[24] !== onClose || $[25] !== t10) {
164
+ t11 = /* @__PURE__ */ jsx(Modal, {
165
+ isOpen,
166
+ onClose,
167
+ showCloseIcon: true,
168
+ children: t10
169
+ });
170
+ $[23] = isOpen;
171
+ $[24] = onClose;
172
+ $[25] = t10;
173
+ $[26] = t11;
174
+ } else t11 = $[26];
175
+ return t11;
176
+ }
177
+ function _temp3(row) {
178
+ return row.id;
179
+ }
180
+ function _temp2($) {
181
+ return $.ui.table.configureColumns;
182
+ }
183
+ function _temp(item) {
184
+ return item.id;
81
185
  }
82
186
  //#endregion
83
187
  export { ColumnConfigModal };
@@ -1,28 +1,79 @@
1
1
  import { Loader } from "../status/Loader/Loader.js";
2
2
  import { useIntersectionObserver } from "../../hooks/useIntersectionObserver.js";
3
3
  import { Table } from "./Table.js";
4
+ import { c } from "react/compiler-runtime";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
- import { useCallback } from "react";
6
6
  //#region src/components/table/InfiniteTable.tsx
7
- var InfiniteTable = ({ hasNextPage, isFetchingNextPage = false, fetchNextPage, ...rest }) => {
8
- const { ref } = useIntersectionObserver({
9
- onIntersection: useCallback(() => {
7
+ var InfiniteTable = (t0) => {
8
+ const $ = c(20);
9
+ let fetchNextPage;
10
+ let hasNextPage;
11
+ let rest;
12
+ let t1;
13
+ if ($[0] !== t0) {
14
+ ({hasNextPage, isFetchingNextPage: t1, fetchNextPage, ...rest} = t0);
15
+ $[0] = t0;
16
+ $[1] = fetchNextPage;
17
+ $[2] = hasNextPage;
18
+ $[3] = rest;
19
+ $[4] = t1;
20
+ } else {
21
+ fetchNextPage = $[1];
22
+ hasNextPage = $[2];
23
+ rest = $[3];
24
+ t1 = $[4];
25
+ }
26
+ const isFetchingNextPage = t1 === void 0 ? false : t1;
27
+ let t2;
28
+ if ($[5] !== fetchNextPage || $[6] !== hasNextPage || $[7] !== isFetchingNextPage) {
29
+ t2 = () => {
10
30
  if (!isFetchingNextPage && hasNextPage) fetchNextPage();
11
- }, [
12
- isFetchingNextPage,
13
- hasNextPage,
14
- fetchNextPage
15
- ]),
16
- rootMargin: "100px"
17
- });
18
- return /* @__PURE__ */ jsxs("div", {
19
- className: "flex flex-col",
20
- children: [/* @__PURE__ */ jsx(Table, { ...rest }), (hasNextPage || isFetchingNextPage) && /* @__PURE__ */ jsx("div", {
31
+ };
32
+ $[5] = fetchNextPage;
33
+ $[6] = hasNextPage;
34
+ $[7] = isFetchingNextPage;
35
+ $[8] = t2;
36
+ } else t2 = $[8];
37
+ const handleLoadMore = t2;
38
+ let t3;
39
+ if ($[9] !== handleLoadMore) {
40
+ t3 = {
41
+ onIntersection: handleLoadMore,
42
+ rootMargin: "100px"
43
+ };
44
+ $[9] = handleLoadMore;
45
+ $[10] = t3;
46
+ } else t3 = $[10];
47
+ const { ref } = useIntersectionObserver(t3);
48
+ let t4;
49
+ if ($[11] !== rest) {
50
+ t4 = /* @__PURE__ */ jsx(Table, { ...rest });
51
+ $[11] = rest;
52
+ $[12] = t4;
53
+ } else t4 = $[12];
54
+ let t5;
55
+ if ($[13] !== hasNextPage || $[14] !== isFetchingNextPage || $[15] !== ref) {
56
+ t5 = (hasNextPage || isFetchingNextPage) && /* @__PURE__ */ jsx("div", {
21
57
  ref,
22
58
  className: "flex justify-center py-4",
23
59
  children: /* @__PURE__ */ jsx(Loader, {})
24
- })]
25
- });
60
+ });
61
+ $[13] = hasNextPage;
62
+ $[14] = isFetchingNextPage;
63
+ $[15] = ref;
64
+ $[16] = t5;
65
+ } else t5 = $[16];
66
+ let t6;
67
+ if ($[17] !== t4 || $[18] !== t5) {
68
+ t6 = /* @__PURE__ */ jsxs("div", {
69
+ className: "flex flex-col",
70
+ children: [t4, t5]
71
+ });
72
+ $[17] = t4;
73
+ $[18] = t5;
74
+ $[19] = t6;
75
+ } else t6 = $[19];
76
+ return t6;
26
77
  };
27
78
  //#endregion
28
79
  export { InfiniteTable };
@@ -1,28 +1,94 @@
1
1
  import { Pagination } from "../shared/pagination/Pagination.js";
2
2
  import { Table } from "./Table.js";
3
+ import { c } from "react/compiler-runtime";
3
4
  import { jsx, jsxs } from "react/jsx-runtime";
4
5
  //#region src/components/table/PaginatedTable.tsx
5
- var PaginatedTable = ({ pagination, setPagination, items, totalItems, ...rest }) => {
6
- return /* @__PURE__ */ jsxs("div", {
7
- className: "flex flex-col gap-4",
8
- children: [/* @__PURE__ */ jsx(Table, {
6
+ var PaginatedTable = (t0) => {
7
+ const $ = c(24);
8
+ let items;
9
+ let pagination;
10
+ let rest;
11
+ let setPagination;
12
+ let totalItems;
13
+ if ($[0] !== t0) {
14
+ ({pagination, setPagination, items, totalItems, ...rest} = t0);
15
+ $[0] = t0;
16
+ $[1] = items;
17
+ $[2] = pagination;
18
+ $[3] = rest;
19
+ $[4] = setPagination;
20
+ $[5] = totalItems;
21
+ } else {
22
+ items = $[1];
23
+ pagination = $[2];
24
+ rest = $[3];
25
+ setPagination = $[4];
26
+ totalItems = $[5];
27
+ }
28
+ let t1;
29
+ if ($[6] !== items) {
30
+ t1 = items ?? [];
31
+ $[6] = items;
32
+ $[7] = t1;
33
+ } else t1 = $[7];
34
+ let t2;
35
+ if ($[8] !== rest || $[9] !== t1) {
36
+ t2 = /* @__PURE__ */ jsx(Table, {
9
37
  ...rest,
10
- items: items ?? []
11
- }), /* @__PURE__ */ jsx(Pagination, {
38
+ items: t1
39
+ });
40
+ $[8] = rest;
41
+ $[9] = t1;
42
+ $[10] = t2;
43
+ } else t2 = $[10];
44
+ const t3 = totalItems ?? 0;
45
+ let t4;
46
+ let t5;
47
+ if ($[11] !== pagination || $[12] !== setPagination) {
48
+ t4 = (page) => setPagination({
49
+ ...pagination,
50
+ pageIndex: page
51
+ });
52
+ t5 = (pageSize) => setPagination({
53
+ ...pagination,
54
+ pageSize,
55
+ pageIndex: 1
56
+ });
57
+ $[11] = pagination;
58
+ $[12] = setPagination;
59
+ $[13] = t4;
60
+ $[14] = t5;
61
+ } else {
62
+ t4 = $[13];
63
+ t5 = $[14];
64
+ }
65
+ let t6;
66
+ if ($[15] !== pagination.pageIndex || $[16] !== pagination.pageSize || $[17] !== t3 || $[18] !== t4 || $[19] !== t5) {
67
+ t6 = /* @__PURE__ */ jsx(Pagination, {
12
68
  page: pagination.pageIndex,
13
69
  pageSize: pagination.pageSize,
14
- totalItems: totalItems ?? 0,
15
- onPageChange: (page) => setPagination({
16
- ...pagination,
17
- pageIndex: page
18
- }),
19
- onPageSizeChange: (pageSize) => setPagination({
20
- ...pagination,
21
- pageSize,
22
- pageIndex: 1
23
- })
24
- })]
25
- });
70
+ totalItems: t3,
71
+ onPageChange: t4,
72
+ onPageSizeChange: t5
73
+ });
74
+ $[15] = pagination.pageIndex;
75
+ $[16] = pagination.pageSize;
76
+ $[17] = t3;
77
+ $[18] = t4;
78
+ $[19] = t5;
79
+ $[20] = t6;
80
+ } else t6 = $[20];
81
+ let t7;
82
+ if ($[21] !== t2 || $[22] !== t6) {
83
+ t7 = /* @__PURE__ */ jsxs("div", {
84
+ className: "flex flex-col gap-4",
85
+ children: [t2, t6]
86
+ });
87
+ $[21] = t2;
88
+ $[22] = t6;
89
+ $[23] = t7;
90
+ } else t7 = $[23];
91
+ return t7;
26
92
  };
27
93
  //#endregion
28
94
  export { PaginatedTable };
@@ -155,8 +155,8 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
155
155
  if (!active || !over || active.id === over.id) return;
156
156
  if (getRowId && (onReorder || onDragEnd)) {
157
157
  if (onReorder) {
158
- const oldIndex = items.findIndex((item) => getRowId(item) === active.id);
159
- const newIndex = items.findIndex((item) => getRowId(item) === over.id);
158
+ const oldIndex = items.findIndex((item_0) => getRowId(item_0) === active.id);
159
+ const newIndex = items.findIndex((item_1) => getRowId(item_1) === over.id);
160
160
  if (oldIndex !== -1 && newIndex !== -1) onReorder(arrayMove(items, oldIndex, newIndex));
161
161
  }
162
162
  onDragEnd?.(event);
@@ -186,18 +186,18 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
186
186
  children: headerGroup.headers.filter((header) => {
187
187
  if (isAnyRowSelected && header.index > 0) return false;
188
188
  return header.column.getIsVisible();
189
- }).map((header, index) => {
190
- const columnMeta = header.column.columnDef.meta ?? {};
189
+ }).map((header_0, index) => {
190
+ const columnMeta = header_0.column.columnDef.meta ?? {};
191
191
  return /* @__PURE__ */ jsx("th", {
192
- colSpan: isAnyRowSelected ? columnCount : header.colSpan,
192
+ colSpan: isAnyRowSelected ? columnCount : header_0.colSpan,
193
193
  tabIndex: -1,
194
194
  className: clsx(tableHeadDataCva({ hasRightBorder: index > 0 && showCellBorder }), columnMeta.headerClass, columnMeta.width),
195
195
  children: isAnyRowSelected ? /* @__PURE__ */ jsx(ActionHeader, { table }) : /* @__PURE__ */ jsxs("button", {
196
196
  type: "button",
197
197
  "aria-label": "Sort column",
198
- className: clsx("flex select-none items-center gap-1 text-text-default-1", header.column.getCanSort() ? "h-6 cursor-pointer rounded-xs px-1 hover:bg-elevation-fill-default-2" : "cursor-default", columnMeta.sortClass),
199
- onClick: header.column.getToggleSortingHandler(),
200
- children: [typeof header.column.columnDef.header === "function" ? flexRender(header.column.columnDef.header, header.getContext()) : /* @__PURE__ */ jsx(HeaderText, { children: header.column.columnDef.header }), {
198
+ className: clsx("flex select-none items-center gap-1 text-text-default-1", header_0.column.getCanSort() ? "h-6 cursor-pointer rounded-xs px-1 hover:bg-elevation-fill-default-2" : "cursor-default", columnMeta.sortClass),
199
+ onClick: header_0.column.getToggleSortingHandler(),
200
+ children: [typeof header_0.column.columnDef.header === "function" ? flexRender(header_0.column.columnDef.header, header_0.getContext()) : /* @__PURE__ */ jsx(HeaderText, { children: header_0.column.columnDef.header }), {
201
201
  asc: /* @__PURE__ */ jsx(ChevronUpIcon, {
202
202
  width: 18,
203
203
  height: 18
@@ -206,9 +206,9 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
206
206
  width: 18,
207
207
  height: 18
208
208
  })
209
- }[header.column.getIsSorted()] ?? null]
209
+ }[header_0.column.getIsSorted()] ?? null]
210
210
  })
211
- }, header.id);
211
+ }, header_0.id);
212
212
  })
213
213
  }, headerGroup.id))]
214
214
  }), /* @__PURE__ */ jsx("tbody", {
@@ -217,8 +217,8 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
217
217
  children: enableDragDrop ? /* @__PURE__ */ jsx(SortableContext, {
218
218
  items: dataIds,
219
219
  strategy: verticalListSortingStrategy,
220
- children: table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(DraggableRow, {
221
- row,
220
+ children: table.getRowModel().rows.map((row_0) => /* @__PURE__ */ jsx(DraggableRow, {
221
+ row: row_0,
222
222
  showCellBorder,
223
223
  onRowClick,
224
224
  onDoubleClick,
@@ -227,29 +227,29 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
227
227
  tableDataCva,
228
228
  hasOnClick,
229
229
  ...props
230
- }, row.id))
231
- }) : table.getRowModel().rows.map((row) => {
230
+ }, row_0.id))
231
+ }) : table.getRowModel().rows.map((row_1) => {
232
232
  return /* @__PURE__ */ jsx("tr", {
233
233
  className: clsx(tableRowCva({ ...props })),
234
234
  onClick: () => {
235
235
  if (onRowClick) {
236
- onRowClick(row.original);
236
+ onRowClick(row_1.original);
237
237
  return;
238
238
  }
239
- if (row.getCanSelect()) row.toggleSelected();
239
+ if (row_1.getCanSelect()) row_1.toggleSelected();
240
240
  },
241
- onDoubleClick: () => onDoubleClick?.(row.original),
242
- "data-clickable": hasOnClick || row.getCanSelect() || void 0,
243
- "data-selected": row.getIsSelected() || void 0,
244
- children: row.getVisibleCells().map((cell, cellIndex) => {
245
- const columnMeta = cell.column.columnDef.meta ?? {};
241
+ onDoubleClick: () => onDoubleClick?.(row_1.original),
242
+ "data-clickable": hasOnClick || row_1.getCanSelect() || void 0,
243
+ "data-selected": row_1.getIsSelected() || void 0,
244
+ children: row_1.getVisibleCells().map((cell, cellIndex) => {
245
+ const columnMeta_0 = cell.column.columnDef.meta ?? {};
246
246
  return /* @__PURE__ */ jsx("td", {
247
247
  tabIndex: -1,
248
- className: clsx(tableDataCva({ hasRightBorder: cellIndex > 0 && showCellBorder }), columnMeta.cellClass, columnMeta.width),
248
+ className: clsx(tableDataCva({ hasRightBorder: cellIndex > 0 && showCellBorder }), columnMeta_0.cellClass, columnMeta_0.width),
249
249
  children: renderCell(cell.column.columnDef.cell, CustomCellContext(cell.getContext()))
250
250
  }, cell.id);
251
251
  })
252
- }, row.id);
252
+ }, row_1.id);
253
253
  })
254
254
  })]
255
255
  });