1mpacto-react-ui 2.0.19 → 2.0.21

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 (98) hide show
  1. package/dist/assets/style.css +1 -1
  2. package/dist/components/Alert/index.cjs +1 -1
  3. package/dist/components/Alert/index.mjs +40 -40
  4. package/dist/components/Breadcrumbs/Breadcrumbs.cjs +3 -3
  5. package/dist/components/Breadcrumbs/Breadcrumbs.mjs +43 -43
  6. package/dist/components/ButtonPopover/ButtonPopover.cjs +1 -1
  7. package/dist/components/ButtonPopover/ButtonPopover.mjs +28 -31
  8. package/dist/components/Calendar/Calendar.cjs +1 -1
  9. package/dist/components/Calendar/Calendar.mjs +98 -100
  10. package/dist/components/Calendar/CalendarMonth.cjs +1 -1
  11. package/dist/components/Calendar/CalendarMonth.mjs +41 -42
  12. package/dist/components/Calendar/CalendarRange.cjs +1 -1
  13. package/dist/components/Calendar/CalendarRange.mjs +59 -61
  14. package/dist/components/Calendar/CalendarYear.cjs +2 -2
  15. package/dist/components/Calendar/CalendarYear.mjs +37 -38
  16. package/dist/components/Chart/DoughnutChart.cjs +1 -1
  17. package/dist/components/Chart/DoughnutChart.mjs +93 -96
  18. package/dist/components/Chart/GradientBarChart.cjs +1 -1
  19. package/dist/components/Chart/GradientBarChart.mjs +80 -81
  20. package/dist/components/Chart/GradientLineChart.cjs +1 -1
  21. package/dist/components/Chart/GradientLineChart.mjs +50 -51
  22. package/dist/components/Chart/LineChart.cjs +1 -1
  23. package/dist/components/Chart/LineChart.mjs +23 -23
  24. package/dist/components/Chart/PieChart.cjs +1 -1
  25. package/dist/components/Chart/PieChart.mjs +45 -48
  26. package/dist/components/Collapse/Collapse.cjs +1 -1
  27. package/dist/components/Collapse/Collapse.mjs +23 -24
  28. package/dist/components/DatePicker/DatePicker.cjs +1 -1
  29. package/dist/components/DatePicker/DatePicker.mjs +86 -89
  30. package/dist/components/DatePicker/DateRangePicker.cjs +1 -1
  31. package/dist/components/DatePicker/DateRangePicker.mjs +91 -92
  32. package/dist/components/DatePicker/FilterDate.cjs +1 -1
  33. package/dist/components/DatePicker/FilterDate.mjs +107 -110
  34. package/dist/components/DatePicker/MonthYearPicker.cjs +1 -1
  35. package/dist/components/DatePicker/MonthYearPicker.mjs +51 -53
  36. package/dist/components/FilterContainer/FilterContainer.cjs +1 -1
  37. package/dist/components/FilterContainer/FilterContainer.mjs +27 -27
  38. package/dist/components/Input/InputFloatingInner.cjs +5 -5
  39. package/dist/components/Input/InputFloatingInner.mjs +24 -25
  40. package/dist/components/NumberFormat/NumberFormat.cjs +1 -1
  41. package/dist/components/NumberFormat/NumberFormat.mjs +12 -13
  42. package/dist/components/Pagination/Pagination.cjs +2 -2
  43. package/dist/components/Pagination/Pagination.mjs +76 -80
  44. package/dist/components/SelectDropdownContainer/SelectDropdownContainer.cjs +1 -1
  45. package/dist/components/SelectDropdownContainer/SelectDropdownContainer.mjs +98 -102
  46. package/dist/components/Sidebar/ItemSidebar.cjs +8 -8
  47. package/dist/components/Sidebar/ItemSidebar.mjs +71 -72
  48. package/dist/components/Sidebar/Sidebar.cjs +1 -1
  49. package/dist/components/Sidebar/Sidebar.mjs +65 -68
  50. package/dist/components/Step/Step.cjs +5 -5
  51. package/dist/components/Step/Step.mjs +52 -52
  52. package/dist/components/Table/Table.cjs +3 -3
  53. package/dist/components/Table/Table.mjs +275 -298
  54. package/dist/components/Table/TableSubMobile.cjs +1 -1
  55. package/dist/components/Table/TableSubMobile.mjs +32 -35
  56. package/dist/components/Tabs/Tabs.cjs +8 -8
  57. package/dist/components/Tabs/Tabs.mjs +66 -70
  58. package/dist/components/Textarea/Textarea.cjs +7 -7
  59. package/dist/components/Textarea/Textarea.mjs +47 -50
  60. package/dist/components/Textarea/TextareaFloatingInner.cjs +6 -6
  61. package/dist/components/Textarea/TextareaFloatingInner.mjs +56 -61
  62. package/dist/components/Textarea/TextareaInnerLabel.cjs +6 -6
  63. package/dist/components/Textarea/TextareaInnerLabel.mjs +47 -50
  64. package/dist/components/TimeRange/TimeRange.cjs +1 -1
  65. package/dist/components/TimeRange/TimeRange.mjs +88 -91
  66. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  67. package/dist/components/Tooltip/Tooltip.mjs +44 -46
  68. package/dist/components/Upload/UploadFile.cjs +1 -1
  69. package/dist/components/Upload/UploadFile.mjs +50 -54
  70. package/dist/components/Upload/UploadImage.cjs +3 -3
  71. package/dist/components/Upload/UploadImage.mjs +62 -68
  72. package/dist/components/Upload/UploadMultipleFile.cjs +1 -1
  73. package/dist/components/Upload/UploadMultipleFile.mjs +61 -62
  74. package/dist/components/Virtualization/ListVirtualization.cjs +1 -1
  75. package/dist/components/Virtualization/ListVirtualization.mjs +52 -55
  76. package/dist/components/Virtualization/TableVirtualization.cjs +1 -1
  77. package/dist/components/Virtualization/TableVirtualization.mjs +56 -59
  78. package/dist/config/components/tinymce.cjs +2 -2
  79. package/dist/config/components/tinymce.mjs +3 -3
  80. package/dist/hooks/useCountdown.cjs +1 -1
  81. package/dist/hooks/useCountdown.mjs +15 -15
  82. package/dist/hooks/useDebounce.cjs +1 -0
  83. package/dist/hooks/useDebounce.mjs +27 -0
  84. package/dist/hooks/useOtpInput.cjs +1 -1
  85. package/dist/hooks/useOtpInput.mjs +47 -51
  86. package/dist/hooks/usePacked.cjs +1 -0
  87. package/dist/hooks/usePacked.mjs +56 -0
  88. package/dist/index.cjs +1 -1
  89. package/dist/index.mjs +52 -48
  90. package/dist/package.json.cjs +1 -1
  91. package/dist/package.json.d.ts +5 -4
  92. package/dist/package.json.mjs +1 -1
  93. package/dist/src/hooks/index.d.ts +4 -2
  94. package/dist/src/hooks/useDebounce.d.ts +61 -0
  95. package/dist/src/hooks/usePacked.d.ts +84 -0
  96. package/dist/utils/common.cjs +1 -1
  97. package/dist/utils/common.mjs +172 -173
  98. package/package.json +4 -4
@@ -1,402 +1,379 @@
1
- import { jsxs as $, Fragment as N, jsx as o } from "react/jsx-runtime";
2
- import { flexRender as O } from "@tanstack/react-table";
3
- import D from "react";
4
- import Z from "../Virtualization/TableVirtualization.mjs";
5
- import q from "./Table.module.scss.mjs";
6
- import { useDeepCompareEffect as J } from "../../hooks/useDeepCompareEffect.mjs";
7
- import { ConfigTable as p } from "./Table.config.mjs";
8
- const _ = (t, c) => {
9
- var g, m;
10
- let s = {};
11
- return t && (s = { position: "sticky", top: 0, zIndex: 2 }), (g = c.column.columnDef.meta) != null && g.styleTh && (s = { ...s, ...(m = c.column.columnDef.meta) == null ? void 0 : m.styleTh(c.column.columnDef) }), s;
12
- }, G = (t, c = !1) => {
13
- const s = t.getIsPinned(), g = s === "left" && t.getIsLastColumn("left"), m = s === "right" && t.getIsFirstColumn("right");
14
- return s ? {
15
- boxShadow: g ? "-4px 0 4px -4px gray inset" : m ? "4px 0 4px -4px gray inset" : void 0,
16
- left: s === "left" ? `${t.getStart("left")}px` : void 0,
17
- right: s === "right" ? `${t.getAfter("right")}px` : void 0,
1
+ import { jsxs as y, Fragment as f, jsx as o } from "react/jsx-runtime";
2
+ import { flexRender as M } from "@tanstack/react-table";
3
+ import p from "react";
4
+ import J from "../Virtualization/TableVirtualization.mjs";
5
+ import H from "./Table.module.scss.mjs";
6
+ import { useDeepCompareEffect as v } from "../../hooks/useDeepCompareEffect.mjs";
7
+ import { ConfigTable as a } from "./Table.config.mjs";
8
+ const K = (e, c) => {
9
+ let i = {};
10
+ return e && (i = { position: "sticky", top: 0, zIndex: 2 }), c.column.columnDef.meta?.styleTh && (i = { ...i, ...c.column.columnDef.meta?.styleTh(c.column.columnDef) }), i;
11
+ }, R = (e, c = !1) => {
12
+ const i = e.getIsPinned(), u = i === "left" && e.getIsLastColumn("left"), r = i === "right" && e.getIsFirstColumn("right");
13
+ return i ? {
14
+ boxShadow: u ? "-4px 0 4px -4px gray inset" : r ? "4px 0 4px -4px gray inset" : void 0,
15
+ left: i === "left" ? `${e.getStart("left")}px` : void 0,
16
+ right: i === "right" ? `${e.getAfter("right")}px` : void 0,
18
17
  position: "sticky",
19
- width: t.getSize(),
18
+ width: e.getSize(),
20
19
  zIndex: 1,
21
20
  background: c ? "white" : ""
22
21
  } : {};
23
- }, X = (t) => {
24
- const c = t.columnPinning.left || [], s = t.columnPinning.right || [], g = t.rowPinning.top || [], m = t.rowPinning.bottom || [];
22
+ }, B = (e) => {
23
+ const c = e.columnPinning.left || [], i = e.columnPinning.right || [], u = e.rowPinning.top || [], r = e.rowPinning.bottom || [];
25
24
  return {
26
25
  left: c,
27
- right: s,
28
- top: g,
29
- bottom: m,
30
- isPinning: c.length > 0 || s.length > 0 || g.length > 0 || m.length > 0
26
+ right: i,
27
+ top: u,
28
+ bottom: r,
29
+ isPinning: c.length > 0 || i.length > 0 || u.length > 0 || r.length > 0
31
30
  };
32
- }, I = ({
33
- tableInstance: t,
31
+ }, Q = ({
32
+ tableInstance: e,
34
33
  classNameWrapperTable: c,
35
- classNameTable: s,
36
- handlerRowClick: g,
37
- privillageRowClick: m,
38
- headerId: A,
39
- tbodyTrId: E,
40
- theadTrId: W,
41
- maxHeight: M,
42
- idCalculateHeight: z,
43
- componentSortASC: L,
34
+ classNameTable: i,
35
+ handlerRowClick: u,
36
+ privillageRowClick: r,
37
+ headerId: z,
38
+ tbodyTrId: D,
39
+ theadTrId: w,
40
+ maxHeight: $,
41
+ idCalculateHeight: C,
42
+ componentSortASC: T,
44
43
  componentSortDESC: x,
45
- classNamePointer: V,
46
- emptyPlaceholder: d,
47
- renderSubComponent: a,
48
- visibilityColumns: S,
49
- classNameSubMobile: j
44
+ classNamePointer: N,
45
+ emptyPlaceholder: m,
46
+ renderSubComponent: d,
47
+ visibilityColumns: h,
48
+ classNameSubMobile: E
50
49
  }) => /* @__PURE__ */ o(
51
50
  "div",
52
51
  {
53
52
  id: "1ru-table",
54
- style: M ? { height: M, overflow: "auto" } : {},
53
+ style: $ ? { height: $, overflow: "auto" } : {},
55
54
  className: c ?? "",
56
- children: /* @__PURE__ */ $(
55
+ children: /* @__PURE__ */ y(
57
56
  "table",
58
57
  {
59
- className: s,
60
- style: { width: X(t.getState()).isPinning ? t.getCenterTotalSize() : "" },
58
+ className: i,
59
+ style: { width: B(e.getState()).isPinning ? e.getCenterTotalSize() : "" },
61
60
  children: [
62
- /* @__PURE__ */ o("thead", { id: A, "data-calculate-height-header": z, children: t.getHeaderGroups().map((u) => /* @__PURE__ */ o("tr", { children: u.headers.map((e) => {
63
- var l, f, n, i;
64
- const y = (f = (l = e.column.columnDef.meta) == null ? void 0 : l.rowSpan) == null ? void 0 : f.call(l, e);
65
- return !e.isPlaceholder && y !== void 0 && e.id === e.column.id ? /* @__PURE__ */ o(N, {}) : /* @__PURE__ */ $(
61
+ /* @__PURE__ */ o("thead", { id: z, "data-calculate-height-header": C, children: e.getHeaderGroups().map((s) => /* @__PURE__ */ o("tr", { children: s.headers.map((n) => {
62
+ const t = n.column.columnDef.meta?.rowSpan?.(n);
63
+ return !n.isPlaceholder && t !== void 0 && n.id === n.column.id ? /* @__PURE__ */ o(f, {}) : /* @__PURE__ */ y(
66
64
  "th",
67
65
  {
68
66
  style: {
69
- ..._(M, e),
70
- ...G(e.column),
71
- ...S.columns.includes(e.column.id) ? { display: "none" } : {}
67
+ ...K($, n),
68
+ ...R(n.column),
69
+ ...h.columns.includes(n.column.id) ? { display: "none" } : {}
72
70
  },
73
- id: `${W(e)}-${e.id}`,
74
- colSpan: typeof ((n = e.column.columnDef.meta) == null ? void 0 : n.colSpan) == "function" ? (i = e.column.columnDef.meta) == null ? void 0 : i.colSpan(e.column.columnDef) : e.colSpan,
75
- rowSpan: y,
71
+ id: `${w(n)}-${n.id}`,
72
+ colSpan: typeof n.column.columnDef.meta?.colSpan == "function" ? n.column.columnDef.meta?.colSpan(n.column.columnDef) : n.colSpan,
73
+ rowSpan: t,
76
74
  children: [
77
- e.isPlaceholder && y === void 0 ? null : /* @__PURE__ */ $(
75
+ n.isPlaceholder && t === void 0 ? null : /* @__PURE__ */ y(
78
76
  "div",
79
77
  {
80
- className: e.column.getCanSort() ? q.sorting : "",
81
- onClick: e.column.getToggleSortingHandler(),
82
- id: e.column.getCanSort() ? `${W(e)}-${e.id}-sort` : "",
78
+ className: n.column.getCanSort() ? H.sorting : "",
79
+ onClick: n.column.getToggleSortingHandler(),
80
+ id: n.column.getCanSort() ? `${w(n)}-${n.id}-sort` : "",
83
81
  children: [
84
- O(e.column.columnDef.header, e.getContext()),
85
- e.column.getCanSort() && /* @__PURE__ */ o("span", { className: "iru-flex-shrink-0", children: e.column.getIsSorted() === "asc" || e.column.getIsSorted() === "desc" ? /* @__PURE__ */ $(N, { children: [
86
- e.column.getIsSorted() === "asc" && /* @__PURE__ */ o(N, { children: L }),
87
- e.column.getIsSorted() === "desc" && /* @__PURE__ */ o(N, { children: x })
88
- ] }) : /* @__PURE__ */ o(N, {}) })
82
+ M(n.column.columnDef.header, n.getContext()),
83
+ n.column.getCanSort() && /* @__PURE__ */ o("span", { className: "iru-flex-shrink-0", children: n.column.getIsSorted() === "asc" || n.column.getIsSorted() === "desc" ? /* @__PURE__ */ y(f, { children: [
84
+ n.column.getIsSorted() === "asc" && /* @__PURE__ */ o(f, { children: T }),
85
+ n.column.getIsSorted() === "desc" && /* @__PURE__ */ o(f, { children: x })
86
+ ] }) : /* @__PURE__ */ o(f, {}) })
89
87
  ]
90
88
  }
91
89
  ),
92
- e.column.getIsPinned() && /* @__PURE__ */ o(
90
+ n.column.getIsPinned() && /* @__PURE__ */ o(
93
91
  "div",
94
92
  {
95
- onDoubleClick: () => e.column.resetSize(),
96
- onMouseDown: e.getResizeHandler(),
97
- onTouchStart: e.getResizeHandler(),
98
- className: q["resize-menu"]
93
+ onDoubleClick: () => n.column.resetSize(),
94
+ onMouseDown: n.getResizeHandler(),
95
+ onTouchStart: n.getResizeHandler(),
96
+ className: H["resize-menu"]
99
97
  }
100
98
  )
101
99
  ]
102
100
  },
103
- e.id
101
+ n.id
104
102
  );
105
- }) }, u.id)) }),
106
- /* @__PURE__ */ $("tbody", { children: [
107
- t.getRowModel().rows.length > 0 && t.getRowModel().rows.map((u, e) => {
108
- var y;
109
- return /* @__PURE__ */ $(D.Fragment, { children: [
110
- /* @__PURE__ */ o(
111
- "tr",
112
- {
113
- onClick: (l) => {
114
- l.stopPropagation(), m && typeof g == "function" && g(u.original, u);
115
- },
116
- className: m ? V : "",
117
- "data-calculate-height": `${z}-${e}`,
118
- id: E(u),
119
- children: u.getVisibleCells().map((l) => {
120
- var f, n, i;
121
- return /* @__PURE__ */ o(
122
- "td",
123
- {
124
- style: {
125
- ...typeof ((f = l.column.columnDef.meta) == null ? void 0 : f.styleTd) == "function" ? l.column.columnDef.meta.styleTd(u.original, u) : {},
126
- ...G(l.column, !0),
127
- ...S.columns.includes(l.column.id) ? { display: "none" } : {}
128
- },
129
- className: typeof ((n = l.column.columnDef.meta) == null ? void 0 : n.classNameTd) == "function" ? (i = l.column.columnDef.meta) == null ? void 0 : i.classNameTd(u.original, u) : "",
130
- id: `${E(u)}-${l.column.id}`,
131
- children: O(l.column.columnDef.cell, l.getContext())
132
- },
133
- l.id
134
- );
135
- })
103
+ }) }, s.id)) }),
104
+ /* @__PURE__ */ y("tbody", { children: [
105
+ e.getRowModel().rows.length > 0 && e.getRowModel().rows.map((s, n) => /* @__PURE__ */ y(p.Fragment, { children: [
106
+ /* @__PURE__ */ o(
107
+ "tr",
108
+ {
109
+ onClick: (t) => {
110
+ t.stopPropagation(), r && typeof u == "function" && u(s.original, s);
136
111
  },
137
- u.id
138
- ),
139
- u.getIsExpanded() && typeof a == "function" && /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: u.getVisibleCells().length - (((y = S == null ? void 0 : S.realColumns) == null ? void 0 : y.length) || 0), children: a(u.original, u, { visibilityColumns: S, classNameSubMobile: j }) }) })
140
- ] }, u.id);
141
- }),
142
- t.getRowModel().rows.length === 0 && D.isValidElement(d) && /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: t.getVisibleFlatColumns().length, children: d }) })
112
+ className: r ? N : "",
113
+ "data-calculate-height": `${C}-${n}`,
114
+ id: D(s),
115
+ children: s.getVisibleCells().map((t) => /* @__PURE__ */ o(
116
+ "td",
117
+ {
118
+ style: {
119
+ ...typeof t.column.columnDef.meta?.styleTd == "function" ? t.column.columnDef.meta.styleTd(s.original, s) : {},
120
+ ...R(t.column, !0),
121
+ ...h.columns.includes(t.column.id) ? { display: "none" } : {}
122
+ },
123
+ className: typeof t.column.columnDef.meta?.classNameTd == "function" ? t.column.columnDef.meta?.classNameTd(s.original, s) : "",
124
+ id: `${D(s)}-${t.column.id}`,
125
+ children: M(t.column.columnDef.cell, t.getContext())
126
+ },
127
+ t.id
128
+ ))
129
+ },
130
+ s.id
131
+ ),
132
+ s.getIsExpanded() && typeof d == "function" && /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: s.getVisibleCells().length - (h?.realColumns?.length || 0), children: d(s.original, s, { visibilityColumns: h, classNameSubMobile: E }) }) })
133
+ ] }, s.id)),
134
+ e.getRowModel().rows.length === 0 && p.isValidElement(m) && /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: e.getVisibleFlatColumns().length, children: m }) })
143
135
  ] })
144
136
  ]
145
137
  }
146
138
  )
147
139
  }
148
- ), Y = D.forwardRef((t, c) => {
149
- const { context: s, ...g } = t;
150
- return /* @__PURE__ */ o("thead", { id: (s == null ? void 0 : s.headerId) ?? "", ...g, ref: c });
140
+ ), I = p.forwardRef((e, c) => {
141
+ const { context: i, ...u } = e;
142
+ return /* @__PURE__ */ o("thead", { id: i?.headerId ?? "", ...u, ref: c });
151
143
  });
152
- Y.displayName = "VirtualizationHead";
153
- const b = ({ style: t, context: c, ...s }) => /* @__PURE__ */ o(
144
+ I.displayName = "VirtualizationHead";
145
+ const U = ({ style: e, context: c, ...i }) => /* @__PURE__ */ o(
154
146
  "table",
155
147
  {
156
- ...s,
148
+ ...i,
157
149
  id: "1ru-table",
158
- className: (c == null ? void 0 : c.classNameTable) ?? "",
159
- style: { ...t, width: c == null ? void 0 : c.width }
150
+ className: c?.classNameTable ?? "",
151
+ style: { ...e, width: c?.width }
160
152
  }
161
- ), B = ({
162
- tableInstance: t,
153
+ ), X = ({
154
+ tableInstance: e,
163
155
  classNameWrapperTable: c,
164
- handlerRowClick: s,
165
- privillageRowClick: g,
166
- virtualizationProps: m,
167
- headerId: A,
168
- tbodyTrId: E,
169
- theadTrId: W,
170
- classNameTable: M,
171
- componentSortASC: z,
172
- componentSortDESC: L,
156
+ handlerRowClick: i,
157
+ privillageRowClick: u,
158
+ virtualizationProps: r,
159
+ headerId: z,
160
+ tbodyTrId: D,
161
+ theadTrId: w,
162
+ classNameTable: $,
163
+ componentSortASC: C,
164
+ componentSortDESC: T,
173
165
  classNamePointer: x,
174
- emptyPlaceholder: V,
175
- renderSubComponent: d,
176
- visibilityColumns: a,
177
- classNameSubMobile: S
166
+ emptyPlaceholder: N,
167
+ renderSubComponent: m,
168
+ visibilityColumns: d,
169
+ classNameSubMobile: h
178
170
  }) => {
179
- var e, y, l;
180
- const [j, u] = D.useState(0);
171
+ const [E, s] = p.useState(0);
181
172
  return /* @__PURE__ */ o(
182
- Z,
173
+ J,
183
174
  {
184
175
  context: {
185
- headerId: A,
186
- classNameTable: M,
187
- width: X(t.getState()).isPinning ? t.getCenterTotalSize() : ""
176
+ headerId: z,
177
+ classNameTable: $,
178
+ width: B(e.getState()).isPinning ? e.getCenterTotalSize() : ""
188
179
  },
189
180
  typeHight: "min-max",
190
- totalCount: ((e = t.getRowModel().rows) == null ? void 0 : e.length) || 0,
191
- minLengthItem: ((y = t.getRowModel().rows) == null ? void 0 : y.length) || 0,
181
+ totalCount: e.getRowModel().rows?.length || 0,
182
+ minLengthItem: e.getRowModel().rows?.length || 0,
192
183
  typeCalculateItemSize: "auto",
193
184
  component: {
194
185
  // eslint-disable-next-line
195
186
  // @ts-ignore
196
- TableHead: Y,
187
+ TableHead: I,
197
188
  // eslint-disable-next-line
198
189
  // @ts-ignore
199
- Table: b,
200
- EmptyPlaceholder: () => /* @__PURE__ */ o("tbody", { ref: (f) => {
201
- var n;
202
- return u(((n = f == null ? void 0 : f.getBoundingClientRect()) == null ? void 0 : n.height) ?? 0);
203
- }, children: /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: t.getVisibleFlatColumns().length, children: D.isValidElement(V) && V }) }) })
190
+ Table: U,
191
+ EmptyPlaceholder: () => /* @__PURE__ */ o("tbody", { ref: (n) => s(n?.getBoundingClientRect()?.height ?? 0), children: /* @__PURE__ */ o("tr", { children: /* @__PURE__ */ o("td", { colSpan: e.getVisibleFlatColumns().length, children: p.isValidElement(N) && N }) }) })
204
192
  },
205
193
  classNameContainer: c,
206
- fixedHeaderContent: () => t.getHeaderGroups().map((f) => /* @__PURE__ */ o("tr", { children: f.headers.map((n) => {
207
- var w, P, C, H;
208
- const i = (P = (w = n.column.columnDef.meta) == null ? void 0 : w.rowSpan) == null ? void 0 : P.call(w, n);
209
- return !n.isPlaceholder && i !== void 0 && n.id === n.column.id ? /* @__PURE__ */ o(N, {}) : /* @__PURE__ */ $(
194
+ fixedHeaderContent: () => e.getHeaderGroups().map((n) => /* @__PURE__ */ o("tr", { children: n.headers.map((t) => {
195
+ const l = t.column.columnDef.meta?.rowSpan?.(t);
196
+ return !t.isPlaceholder && l !== void 0 && t.id === t.column.id ? /* @__PURE__ */ o(f, {}) : /* @__PURE__ */ y(
210
197
  "th",
211
198
  {
212
- id: `${W(n)}-${n.id}`,
213
- colSpan: n.colSpan,
214
- rowSpan: i,
199
+ id: `${w(t)}-${t.id}`,
200
+ colSpan: t.colSpan,
201
+ rowSpan: l,
215
202
  style: {
216
- ...typeof ((C = n.column.columnDef.meta) == null ? void 0 : C.styleTh) == "function" ? (H = n.column.columnDef.meta) == null ? void 0 : H.styleTh(n.column.columnDef) : {},
217
- ...G(n.column),
218
- ...a.columns.includes(n.column.id) ? { display: "none" } : {}
203
+ ...typeof t.column.columnDef.meta?.styleTh == "function" ? t.column.columnDef.meta?.styleTh(t.column.columnDef) : {},
204
+ ...R(t.column),
205
+ ...d.columns.includes(t.column.id) ? { display: "none" } : {}
219
206
  },
220
207
  children: [
221
- n.isPlaceholder && i === void 0 ? null : /* @__PURE__ */ $(
208
+ t.isPlaceholder && l === void 0 ? null : /* @__PURE__ */ y(
222
209
  "div",
223
210
  {
224
- className: n.column.getCanSort() ? q.sorting : "",
225
- onClick: n.column.getToggleSortingHandler(),
226
- id: n.column.getCanSort() ? `${W(n)}-${n.id}-sort` : "",
211
+ className: t.column.getCanSort() ? H.sorting : "",
212
+ onClick: t.column.getToggleSortingHandler(),
213
+ id: t.column.getCanSort() ? `${w(t)}-${t.id}-sort` : "",
227
214
  children: [
228
- O(n.column.columnDef.header, n.getContext()),
229
- n.column.getCanSort() && /* @__PURE__ */ o("span", { className: "iru-flex-shrink-0", children: n.column.getIsSorted() === "asc" || n.column.getIsSorted() === "desc" ? /* @__PURE__ */ $(N, { children: [
230
- n.column.getIsSorted() === "asc" && /* @__PURE__ */ o(N, { children: z }),
231
- n.column.getIsSorted() === "desc" && /* @__PURE__ */ o(N, { children: L })
232
- ] }) : /* @__PURE__ */ o(N, {}) })
215
+ M(t.column.columnDef.header, t.getContext()),
216
+ t.column.getCanSort() && /* @__PURE__ */ o("span", { className: "iru-flex-shrink-0", children: t.column.getIsSorted() === "asc" || t.column.getIsSorted() === "desc" ? /* @__PURE__ */ y(f, { children: [
217
+ t.column.getIsSorted() === "asc" && /* @__PURE__ */ o(f, { children: C }),
218
+ t.column.getIsSorted() === "desc" && /* @__PURE__ */ o(f, { children: T })
219
+ ] }) : /* @__PURE__ */ o(f, {}) })
233
220
  ]
234
221
  }
235
222
  ),
236
- n.column.getIsPinned() && /* @__PURE__ */ o(
223
+ t.column.getIsPinned() && /* @__PURE__ */ o(
237
224
  "div",
238
225
  {
239
- onDoubleClick: () => n.column.resetSize(),
240
- onMouseDown: n.getResizeHandler(),
241
- onTouchStart: n.getResizeHandler(),
242
- className: q["resize-menu"]
226
+ onDoubleClick: () => t.column.resetSize(),
227
+ onMouseDown: t.getResizeHandler(),
228
+ onTouchStart: t.getResizeHandler(),
229
+ className: H["resize-menu"]
243
230
  }
244
231
  )
245
232
  ]
246
233
  },
247
- n.id
234
+ t.id
248
235
  );
249
- }) }, f.id)),
250
- itemContent: (f, n) => {
251
- var w, P;
252
- const i = (P = (w = t.getRowModel()) == null ? void 0 : w.rows) == null ? void 0 : P[n];
253
- return /* @__PURE__ */ o(f, { children: ({ ...C }) => {
254
- var H;
255
- return /* @__PURE__ */ $(D.Fragment, { children: [
256
- /* @__PURE__ */ o(
257
- "tr",
258
- {
259
- ...C,
260
- onClick: (r) => {
261
- r.stopPropagation(), g && typeof s == "function" && s(i.original, i);
236
+ }) }, n.id)),
237
+ itemContent: (n, t) => {
238
+ const l = e.getRowModel()?.rows?.[t];
239
+ return /* @__PURE__ */ o(n, { children: ({ ...W }) => /* @__PURE__ */ y(p.Fragment, { children: [
240
+ /* @__PURE__ */ o(
241
+ "tr",
242
+ {
243
+ ...W,
244
+ onClick: (g) => {
245
+ g.stopPropagation(), u && typeof i == "function" && i(l.original, l);
246
+ },
247
+ className: u ? x : "",
248
+ id: D(l),
249
+ children: l.getVisibleCells().map((g) => /* @__PURE__ */ o(f, { children: /* @__PURE__ */ o(
250
+ "td",
251
+ {
252
+ style: {
253
+ ...typeof g.column.columnDef.meta?.styleTd == "function" ? g.column.columnDef.meta.styleTd(l.original, l) : {},
254
+ ...R(g.column, !0),
255
+ ...d.columns.includes(g.column.id) ? { display: "none" } : {}
256
+ },
257
+ className: typeof g.column.columnDef.meta?.classNameTd == "function" ? g.column.columnDef.meta?.classNameTd(l.original, l) : "",
258
+ id: `${D(l)}-${g.column.id}`,
259
+ children: M(g.column.columnDef.cell, g.getContext())
262
260
  },
263
- className: g ? x : "",
264
- id: E(i),
265
- children: i.getVisibleCells().map((r) => {
266
- var T, h, F;
267
- return /* @__PURE__ */ o(N, { children: /* @__PURE__ */ o(
268
- "td",
269
- {
270
- style: {
271
- ...typeof ((T = r.column.columnDef.meta) == null ? void 0 : T.styleTd) == "function" ? r.column.columnDef.meta.styleTd(i.original, i) : {},
272
- ...G(r.column, !0),
273
- ...a.columns.includes(r.column.id) ? { display: "none" } : {}
274
- },
275
- className: typeof ((h = r.column.columnDef.meta) == null ? void 0 : h.classNameTd) == "function" ? (F = r.column.columnDef.meta) == null ? void 0 : F.classNameTd(i.original, i) : "",
276
- id: `${E(i)}-${r.column.id}`,
277
- children: O(r.column.columnDef.cell, r.getContext())
278
- },
279
- r.id
280
- ) });
281
- })
282
- }
283
- ),
284
- i.getIsExpanded() && typeof d == "function" && /* @__PURE__ */ o("tr", { "data-sub-component": n, children: /* @__PURE__ */ o("td", { colSpan: i.getVisibleCells().length - (((H = a == null ? void 0 : a.realColumns) == null ? void 0 : H.length) || 0), children: d(i.original, i, { visibilityColumns: a, classNameSubMobile: S }) }) })
285
- ] }, i.id);
286
- } }, i.id);
261
+ g.id
262
+ ) }))
263
+ }
264
+ ),
265
+ l.getIsExpanded() && typeof m == "function" && /* @__PURE__ */ o("tr", { "data-sub-component": t, children: /* @__PURE__ */ o("td", { colSpan: l.getVisibleCells().length - (d?.realColumns?.length || 0), children: m(l.original, l, { visibilityColumns: d, classNameSubMobile: h }) }) })
266
+ ] }, l.id) }, l.id);
287
267
  },
288
- ...m,
289
- minHeightItem: ((m == null ? void 0 : m.minHeightItem) ?? 60) + ((((l = t.getRowModel().rows) == null ? void 0 : l.length) || 0) > 0 ? 0 : j),
290
- itemSizeNames: typeof d == "function" ? [...(m == null ? void 0 : m.itemSizeNames) ?? [], "data-sub-component"] : m == null ? void 0 : m.itemSizeNames
268
+ ...r,
269
+ minHeightItem: (r?.minHeightItem ?? 60) + ((e.getRowModel().rows?.length || 0) > 0 ? 0 : E),
270
+ itemSizeNames: typeof m == "function" ? [...r?.itemSizeNames ?? [], "data-sub-component"] : r?.itemSizeNames
291
271
  }
292
272
  );
293
- }, it = ({
294
- tableInstance: t,
273
+ }, ot = ({
274
+ tableInstance: e,
295
275
  classNameWrapperTable: c = "",
296
- classNameTable: s = "",
297
- collapseAll: g = !0,
298
- handlerRowClick: m,
299
- privillageRowClick: A = !1,
300
- virtualization: E = !1,
301
- virtualizationProps: W,
302
- headerId: M = "",
303
- tbodyTrId: z = () => "",
304
- theadTrId: L = () => "",
276
+ classNameTable: i = "",
277
+ collapseAll: u = !0,
278
+ handlerRowClick: r,
279
+ privillageRowClick: z = !1,
280
+ virtualization: D = !1,
281
+ virtualizationProps: w,
282
+ headerId: $ = "",
283
+ tbodyTrId: C = () => "",
284
+ theadTrId: T = () => "",
305
285
  maxHeight: x = 0,
306
- idCalculateHeight: V = void 0,
307
- kind: d = "laba-reguler",
308
- componentSortASC: a,
309
- componentSortDESC: S,
310
- scrollTop: j = !1,
311
- emptyPlaceholder: u,
312
- variant: e,
313
- renderSubComponent: y,
286
+ idCalculateHeight: N = void 0,
287
+ kind: m = "laba-reguler",
288
+ componentSortASC: d,
289
+ componentSortDESC: h,
290
+ scrollTop: E = !1,
291
+ emptyPlaceholder: s,
292
+ variant: n,
293
+ renderSubComponent: t,
314
294
  columnBreakpoints: l
315
295
  }) => {
316
- var H;
317
- const [f, n] = D.useState(0), [i, w] = D.useState({
296
+ const [W, g] = p.useState(0), [A, L] = p.useState({
318
297
  columns: [],
319
298
  realColumns: []
320
- }), P = () => {
321
- if (![void 0, "undefined"].includes(V)) {
322
- const r = document.querySelector(`[data-calculate-height-header="${V}"]`);
323
- let T = 0;
324
- const h = document.querySelectorAll(`[data-calculate-height^="${V}-"]`);
325
- return h == null || h.forEach((F) => {
326
- T += F.offsetHeight;
327
- }), T > x ? x + r.offsetHeight : 0;
299
+ }), G = () => {
300
+ if (![void 0, "undefined"].includes(N)) {
301
+ const V = document.querySelector(`[data-calculate-height-header="${N}"]`);
302
+ let F = 0;
303
+ return document.querySelectorAll(`[data-calculate-height^="${N}-"]`)?.forEach((S) => {
304
+ F += S.offsetHeight;
305
+ }), F > x ? x + V.offsetHeight : 0;
328
306
  }
329
307
  return x;
330
- }, C = () => {
331
- var F;
332
- const r = ((F = document.querySelector("body")) == null ? void 0 : F.offsetWidth) || 0, T = l == null ? void 0 : l.sort((R, K) => {
333
- const Q = (R.maxWidth ?? R.minWidth) || 0, U = (K.maxWidth ?? K.minWidth) || 0;
334
- return Q !== U ? Q - U : R.maxWidth ? -1 : 1;
335
- }), h = (T == null ? void 0 : T.find((R) => !!(Object.hasOwnProperty.call(R, "maxWidth") && r <= (R.maxWidth || 0) || Object.hasOwnProperty.call(R, "minWidth") && r >= (R.minWidth || 0)))) || {};
336
- Object.keys(h).length > 0 ? (w({
337
- columns: h.columns,
338
- realColumns: h.realColumns || h.columns
339
- }), h != null && h.resetExpanded && t.resetExpanded()) : w({ columns: [], realColumns: [] });
308
+ }, b = () => {
309
+ const V = document.querySelector("body")?.offsetWidth || 0, P = l?.sort((S, j) => {
310
+ const O = (S.maxWidth ?? S.minWidth) || 0, q = (j.maxWidth ?? j.minWidth) || 0;
311
+ return O !== q ? O - q : S.maxWidth ? -1 : 1;
312
+ })?.find((S) => !!(Object.hasOwnProperty.call(S, "maxWidth") && V <= (S.maxWidth || 0) || Object.hasOwnProperty.call(S, "minWidth") && V >= (S.minWidth || 0))) || {};
313
+ Object.keys(P).length > 0 ? (L({
314
+ columns: P.columns,
315
+ realColumns: P.realColumns || P.columns
316
+ }), P?.resetExpanded && e.resetExpanded()) : L({ columns: [], realColumns: [] });
340
317
  };
341
- return J(() => {
342
- !g && typeof t.toggleAllRowsExpanded == "function" && t.toggleAllRowsExpanded();
343
- }, [g, t == null ? void 0 : t.toggleAllRowsExpanded]), J(() => {
344
- x > 0 && n(P());
345
- }, [(H = t == null ? void 0 : t.options) == null ? void 0 : H.data, x]), J(() => {
346
- if (Array.isArray(l) && (l == null ? void 0 : l.length) > 0)
347
- return C(), window.addEventListener("resize", C), () => {
348
- window.removeEventListener("resize", C);
318
+ return v(() => {
319
+ !u && typeof e.toggleAllRowsExpanded == "function" && e.toggleAllRowsExpanded();
320
+ }, [u, e?.toggleAllRowsExpanded]), v(() => {
321
+ x > 0 && g(G());
322
+ }, [e?.options?.data, x]), v(() => {
323
+ if (Array.isArray(l) && l?.length > 0)
324
+ return b(), window.addEventListener("resize", b), () => {
325
+ window.removeEventListener("resize", b);
349
326
  };
350
- }, [l]), /* @__PURE__ */ $(N, { children: [
351
- !E && /* @__PURE__ */ o(
352
- I,
327
+ }, [l]), /* @__PURE__ */ y(f, { children: [
328
+ !D && /* @__PURE__ */ o(
329
+ Q,
353
330
  {
354
- theadTrId: L,
355
- tbodyTrId: z,
356
- headerId: M,
357
- tableInstance: t,
358
- classNameTable: s,
359
- classNameWrapperTable: `${p().kind[d]} ${e ? p().variant[e] : ""}
360
- ${j ? p().utility["table-scroll-top"] : ""} ${c}`,
361
- handlerRowClick: m,
362
- privillageRowClick: A,
363
- maxHeight: f,
364
- idCalculateHeight: V,
365
- componentSortASC: D.isValidElement(a) ? a : p().sortingIcon[d].asc,
366
- componentSortDESC: D.isValidElement(S) ? S : p().sortingIcon[d].desc,
367
- classNamePointer: p().pointer[d],
368
- emptyPlaceholder: u,
369
- renderSubComponent: y,
370
- visibilityColumns: i,
371
- classNameSubMobile: p().subMobile[d]
331
+ theadTrId: T,
332
+ tbodyTrId: C,
333
+ headerId: $,
334
+ tableInstance: e,
335
+ classNameTable: i,
336
+ classNameWrapperTable: `${a().kind[m]} ${n ? a().variant[n] : ""}
337
+ ${E ? a().utility["table-scroll-top"] : ""} ${c}`,
338
+ handlerRowClick: r,
339
+ privillageRowClick: z,
340
+ maxHeight: W,
341
+ idCalculateHeight: N,
342
+ componentSortASC: p.isValidElement(d) ? d : a().sortingIcon[m].asc,
343
+ componentSortDESC: p.isValidElement(h) ? h : a().sortingIcon[m].desc,
344
+ classNamePointer: a().pointer[m],
345
+ emptyPlaceholder: s,
346
+ renderSubComponent: t,
347
+ visibilityColumns: A,
348
+ classNameSubMobile: a().subMobile[m]
372
349
  }
373
350
  ),
374
- E && /* @__PURE__ */ o(
375
- B,
351
+ D && /* @__PURE__ */ o(
352
+ X,
376
353
  {
377
- theadTrId: L,
378
- tbodyTrId: z,
379
- headerId: M,
380
- tableInstance: t,
381
- classNameTable: s,
382
- classNameWrapperTable: `${p().kind[d]} ${e ? p().variant[e] : ""}
383
- ${j ? p().utility["table-scroll-top"] : ""} ${c}`,
384
- handlerRowClick: m,
385
- privillageRowClick: A,
386
- virtualizationProps: W,
387
- componentSortASC: D.isValidElement(a) ? a : p().sortingIcon[d].asc,
388
- componentSortDESC: D.isValidElement(S) ? S : p().sortingIcon[d].desc,
389
- classNamePointer: p().pointer[d],
390
- emptyPlaceholder: u,
391
- renderSubComponent: y,
392
- visibilityColumns: i,
393
- classNameSubMobile: p().subMobile[d]
354
+ theadTrId: T,
355
+ tbodyTrId: C,
356
+ headerId: $,
357
+ tableInstance: e,
358
+ classNameTable: i,
359
+ classNameWrapperTable: `${a().kind[m]} ${n ? a().variant[n] : ""}
360
+ ${E ? a().utility["table-scroll-top"] : ""} ${c}`,
361
+ handlerRowClick: r,
362
+ privillageRowClick: z,
363
+ virtualizationProps: w,
364
+ componentSortASC: p.isValidElement(d) ? d : a().sortingIcon[m].asc,
365
+ componentSortDESC: p.isValidElement(h) ? h : a().sortingIcon[m].desc,
366
+ classNamePointer: a().pointer[m],
367
+ emptyPlaceholder: s,
368
+ renderSubComponent: t,
369
+ visibilityColumns: A,
370
+ classNameSubMobile: a().subMobile[m]
394
371
  }
395
372
  )
396
373
  ] });
397
374
  };
398
375
  export {
399
- Y as VirtualizationHead,
400
- b as VirtualizationTable,
401
- it as default
376
+ I as VirtualizationHead,
377
+ U as VirtualizationTable,
378
+ ot as default
402
379
  };