1mpacto-react-ui 2.0.20 → 2.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/_mixins.scss +72 -72
- package/dist/assets/icons/arrow-narrow-down.svg +3 -3
- package/dist/assets/style.css +1 -1
- package/dist/components/Alert/index.cjs +1 -1
- package/dist/components/Alert/index.mjs +40 -40
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +3 -3
- package/dist/components/Breadcrumbs/Breadcrumbs.mjs +43 -43
- package/dist/components/Button/Button.cjs +12 -12
- package/dist/components/Button/Button.config.cjs +1 -1
- package/dist/components/Button/Button.config.mjs +3 -1
- package/dist/components/Button/Button.mjs +24 -24
- package/dist/components/Button/style.module.scss.cjs +1 -1
- package/dist/components/Button/style.module.scss.mjs +57 -55
- package/dist/components/ButtonIcon/ButtonIcon.cjs +12 -12
- package/dist/components/ButtonIcon/ButtonIcon.mjs +20 -20
- package/dist/components/ButtonPopover/ButtonPopover.cjs +1 -1
- package/dist/components/ButtonPopover/ButtonPopover.mjs +28 -31
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.mjs +98 -100
- package/dist/components/Calendar/CalendarMonth.cjs +1 -1
- package/dist/components/Calendar/CalendarMonth.mjs +41 -42
- package/dist/components/Calendar/CalendarRange.cjs +1 -1
- package/dist/components/Calendar/CalendarRange.mjs +59 -61
- package/dist/components/Calendar/CalendarYear.cjs +3 -3
- package/dist/components/Calendar/CalendarYear.mjs +39 -40
- package/dist/components/Chart/DoughnutChart.cjs +1 -1
- package/dist/components/Chart/DoughnutChart.mjs +93 -96
- package/dist/components/Chart/GradientBarChart.cjs +1 -1
- package/dist/components/Chart/GradientBarChart.mjs +80 -81
- package/dist/components/Chart/GradientLineChart.cjs +1 -1
- package/dist/components/Chart/GradientLineChart.mjs +50 -51
- package/dist/components/Chart/LineChart.cjs +1 -1
- package/dist/components/Chart/LineChart.mjs +23 -23
- package/dist/components/Chart/PieChart.cjs +1 -1
- package/dist/components/Chart/PieChart.mjs +45 -48
- package/dist/components/Collapse/Collapse.cjs +1 -1
- package/dist/components/Collapse/Collapse.mjs +23 -24
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.mjs +86 -89
- package/dist/components/DatePicker/DateRangePicker.cjs +1 -1
- package/dist/components/DatePicker/DateRangePicker.mjs +91 -92
- package/dist/components/DatePicker/FilterDate.cjs +1 -1
- package/dist/components/DatePicker/FilterDate.mjs +107 -110
- package/dist/components/DatePicker/MonthYearPicker.cjs +1 -1
- package/dist/components/DatePicker/MonthYearPicker.mjs +51 -53
- package/dist/components/FilterContainer/FilterContainer.cjs +1 -1
- package/dist/components/FilterContainer/FilterContainer.mjs +27 -27
- package/dist/components/Input/InputFloatingInner.cjs +5 -5
- package/dist/components/Input/InputFloatingInner.mjs +24 -25
- package/dist/components/NumberFormat/NumberFormat.cjs +1 -1
- package/dist/components/NumberFormat/NumberFormat.mjs +12 -13
- package/dist/components/Pagination/Pagination.cjs +2 -2
- package/dist/components/Pagination/Pagination.mjs +76 -80
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.cjs +1 -1
- package/dist/components/SelectDropdownContainer/SelectDropdownContainer.mjs +98 -102
- package/dist/components/Sidebar/ItemSidebar.cjs +8 -8
- package/dist/components/Sidebar/ItemSidebar.mjs +71 -72
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.mjs +65 -68
- package/dist/components/Slider/Slider.cjs +1 -0
- package/dist/components/Slider/Slider.mjs +61 -0
- package/dist/components/Slider/style.module.scss.cjs +1 -0
- package/dist/components/Slider/style.module.scss.mjs +14 -0
- package/dist/components/Step/Step.cjs +5 -5
- package/dist/components/Step/Step.mjs +52 -52
- package/dist/components/Table/Table.cjs +3 -3
- package/dist/components/Table/Table.mjs +275 -298
- package/dist/components/Table/TableSubMobile.cjs +1 -1
- package/dist/components/Table/TableSubMobile.mjs +32 -35
- package/dist/components/Tabs/Tabs.cjs +8 -8
- package/dist/components/Tabs/Tabs.mjs +66 -70
- package/dist/components/Textarea/Textarea.cjs +7 -7
- package/dist/components/Textarea/Textarea.mjs +47 -50
- package/dist/components/Textarea/TextareaFloatingInner.cjs +6 -6
- package/dist/components/Textarea/TextareaFloatingInner.mjs +56 -61
- package/dist/components/Textarea/TextareaInnerLabel.cjs +6 -6
- package/dist/components/Textarea/TextareaInnerLabel.mjs +47 -50
- package/dist/components/TimeRange/TimeRange.cjs +1 -1
- package/dist/components/TimeRange/TimeRange.mjs +88 -91
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.mjs +44 -46
- package/dist/components/Upload/UploadFile.cjs +1 -1
- package/dist/components/Upload/UploadFile.mjs +50 -54
- package/dist/components/Upload/UploadImage.cjs +12 -12
- package/dist/components/Upload/UploadImage.mjs +73 -79
- package/dist/components/Upload/UploadMultipleFile.cjs +1 -1
- package/dist/components/Upload/UploadMultipleFile.mjs +61 -62
- package/dist/components/Virtualization/ListVirtualization.cjs +1 -1
- package/dist/components/Virtualization/ListVirtualization.mjs +52 -55
- package/dist/components/Virtualization/TableVirtualization.cjs +1 -1
- package/dist/components/Virtualization/TableVirtualization.mjs +56 -59
- package/dist/config/components/tinymce.cjs +2 -2
- package/dist/config/components/tinymce.mjs +3 -3
- package/dist/hooks/useCountdown.cjs +1 -1
- package/dist/hooks/useCountdown.mjs +15 -15
- package/dist/hooks/useDebounce.cjs +1 -1
- package/dist/hooks/useDebounce.mjs +19 -19
- package/dist/hooks/useOtpInput.cjs +1 -1
- package/dist/hooks/useOtpInput.mjs +47 -51
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +48 -46
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.d.ts +129 -128
- package/dist/package.json.mjs +1 -1
- package/dist/src/components/Button/Button.config.d.ts +2 -0
- package/dist/src/components/Slider/Slider.d.ts +3 -0
- package/dist/src/components/Slider/Slider.stories.d.ts +6 -0
- package/dist/src/components/index.d.ts +4 -2
- package/dist/src/interfaces/components/Button/index.d.ts +1 -1
- package/dist/src/interfaces/components/Slider/index.d.ts +51 -0
- package/dist/types-external/table.d.ts +15 -15
- package/dist/utils/common.cjs +1 -1
- package/dist/utils/common.mjs +172 -173
- package/package.json +128 -128
|
@@ -1,402 +1,379 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { flexRender as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useDeepCompareEffect as
|
|
7
|
-
import { ConfigTable as
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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:
|
|
18
|
+
width: e.getSize(),
|
|
20
19
|
zIndex: 1,
|
|
21
20
|
background: c ? "white" : ""
|
|
22
21
|
} : {};
|
|
23
|
-
},
|
|
24
|
-
const c =
|
|
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:
|
|
28
|
-
top:
|
|
29
|
-
bottom:
|
|
30
|
-
isPinning: c.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
|
-
},
|
|
33
|
-
tableInstance:
|
|
31
|
+
}, Q = ({
|
|
32
|
+
tableInstance: e,
|
|
34
33
|
classNameWrapperTable: c,
|
|
35
|
-
classNameTable:
|
|
36
|
-
handlerRowClick:
|
|
37
|
-
privillageRowClick:
|
|
38
|
-
headerId:
|
|
39
|
-
tbodyTrId:
|
|
40
|
-
theadTrId:
|
|
41
|
-
maxHeight:
|
|
42
|
-
idCalculateHeight:
|
|
43
|
-
componentSortASC:
|
|
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:
|
|
46
|
-
emptyPlaceholder:
|
|
47
|
-
renderSubComponent:
|
|
48
|
-
visibilityColumns:
|
|
49
|
-
classNameSubMobile:
|
|
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:
|
|
53
|
+
style: $ ? { height: $, overflow: "auto" } : {},
|
|
55
54
|
className: c ?? "",
|
|
56
|
-
children: /* @__PURE__ */
|
|
55
|
+
children: /* @__PURE__ */ y(
|
|
57
56
|
"table",
|
|
58
57
|
{
|
|
59
|
-
className:
|
|
60
|
-
style: { width:
|
|
58
|
+
className: i,
|
|
59
|
+
style: { width: B(e.getState()).isPinning ? e.getCenterTotalSize() : "" },
|
|
61
60
|
children: [
|
|
62
|
-
/* @__PURE__ */ o("thead", { id:
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
...
|
|
70
|
-
...
|
|
71
|
-
...
|
|
67
|
+
...K($, n),
|
|
68
|
+
...R(n.column),
|
|
69
|
+
...h.columns.includes(n.column.id) ? { display: "none" } : {}
|
|
72
70
|
},
|
|
73
|
-
id: `${
|
|
74
|
-
colSpan: typeof
|
|
75
|
-
rowSpan:
|
|
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
|
-
|
|
75
|
+
n.isPlaceholder && t === void 0 ? null : /* @__PURE__ */ y(
|
|
78
76
|
"div",
|
|
79
77
|
{
|
|
80
|
-
className:
|
|
81
|
-
onClick:
|
|
82
|
-
id:
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
] }) : /* @__PURE__ */ o(
|
|
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
|
-
|
|
90
|
+
n.column.getIsPinned() && /* @__PURE__ */ o(
|
|
93
91
|
"div",
|
|
94
92
|
{
|
|
95
|
-
onDoubleClick: () =>
|
|
96
|
-
onMouseDown:
|
|
97
|
-
onTouchStart:
|
|
98
|
-
className:
|
|
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
|
-
|
|
101
|
+
n.id
|
|
104
102
|
);
|
|
105
|
-
}) },
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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
|
-
),
|
|
149
|
-
const { context:
|
|
150
|
-
return /* @__PURE__ */ o("thead", { id:
|
|
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
|
-
|
|
153
|
-
const
|
|
144
|
+
I.displayName = "VirtualizationHead";
|
|
145
|
+
const U = ({ style: e, context: c, ...i }) => /* @__PURE__ */ o(
|
|
154
146
|
"table",
|
|
155
147
|
{
|
|
156
|
-
...
|
|
148
|
+
...i,
|
|
157
149
|
id: "1ru-table",
|
|
158
|
-
className:
|
|
159
|
-
style: { ...
|
|
150
|
+
className: c?.classNameTable ?? "",
|
|
151
|
+
style: { ...e, width: c?.width }
|
|
160
152
|
}
|
|
161
|
-
),
|
|
162
|
-
tableInstance:
|
|
153
|
+
), X = ({
|
|
154
|
+
tableInstance: e,
|
|
163
155
|
classNameWrapperTable: c,
|
|
164
|
-
handlerRowClick:
|
|
165
|
-
privillageRowClick:
|
|
166
|
-
virtualizationProps:
|
|
167
|
-
headerId:
|
|
168
|
-
tbodyTrId:
|
|
169
|
-
theadTrId:
|
|
170
|
-
classNameTable:
|
|
171
|
-
componentSortASC:
|
|
172
|
-
componentSortDESC:
|
|
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:
|
|
175
|
-
renderSubComponent:
|
|
176
|
-
visibilityColumns:
|
|
177
|
-
classNameSubMobile:
|
|
166
|
+
emptyPlaceholder: N,
|
|
167
|
+
renderSubComponent: m,
|
|
168
|
+
visibilityColumns: d,
|
|
169
|
+
classNameSubMobile: h
|
|
178
170
|
}) => {
|
|
179
|
-
|
|
180
|
-
const [j, u] = D.useState(0);
|
|
171
|
+
const [E, s] = p.useState(0);
|
|
181
172
|
return /* @__PURE__ */ o(
|
|
182
|
-
|
|
173
|
+
J,
|
|
183
174
|
{
|
|
184
175
|
context: {
|
|
185
|
-
headerId:
|
|
186
|
-
classNameTable:
|
|
187
|
-
width:
|
|
176
|
+
headerId: z,
|
|
177
|
+
classNameTable: $,
|
|
178
|
+
width: B(e.getState()).isPinning ? e.getCenterTotalSize() : ""
|
|
188
179
|
},
|
|
189
180
|
typeHight: "min-max",
|
|
190
|
-
totalCount:
|
|
191
|
-
minLengthItem:
|
|
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:
|
|
187
|
+
TableHead: I,
|
|
197
188
|
// eslint-disable-next-line
|
|
198
189
|
// @ts-ignore
|
|
199
|
-
Table:
|
|
200
|
-
EmptyPlaceholder: () => /* @__PURE__ */ o("tbody", { ref: (
|
|
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: () =>
|
|
207
|
-
|
|
208
|
-
|
|
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: `${
|
|
213
|
-
colSpan:
|
|
214
|
-
rowSpan:
|
|
199
|
+
id: `${w(t)}-${t.id}`,
|
|
200
|
+
colSpan: t.colSpan,
|
|
201
|
+
rowSpan: l,
|
|
215
202
|
style: {
|
|
216
|
-
...typeof
|
|
217
|
-
...
|
|
218
|
-
...
|
|
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
|
-
|
|
208
|
+
t.isPlaceholder && l === void 0 ? null : /* @__PURE__ */ y(
|
|
222
209
|
"div",
|
|
223
210
|
{
|
|
224
|
-
className:
|
|
225
|
-
onClick:
|
|
226
|
-
id:
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
] }) : /* @__PURE__ */ o(
|
|
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
|
-
|
|
223
|
+
t.column.getIsPinned() && /* @__PURE__ */ o(
|
|
237
224
|
"div",
|
|
238
225
|
{
|
|
239
|
-
onDoubleClick: () =>
|
|
240
|
-
onMouseDown:
|
|
241
|
-
onTouchStart:
|
|
242
|
-
className:
|
|
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
|
-
|
|
234
|
+
t.id
|
|
248
235
|
);
|
|
249
|
-
}) },
|
|
250
|
-
itemContent: (
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
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
|
-
...
|
|
289
|
-
minHeightItem: (
|
|
290
|
-
itemSizeNames: typeof
|
|
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
|
-
},
|
|
294
|
-
tableInstance:
|
|
273
|
+
}, ot = ({
|
|
274
|
+
tableInstance: e,
|
|
295
275
|
classNameWrapperTable: c = "",
|
|
296
|
-
classNameTable:
|
|
297
|
-
collapseAll:
|
|
298
|
-
handlerRowClick:
|
|
299
|
-
privillageRowClick:
|
|
300
|
-
virtualization:
|
|
301
|
-
virtualizationProps:
|
|
302
|
-
headerId:
|
|
303
|
-
tbodyTrId:
|
|
304
|
-
theadTrId:
|
|
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:
|
|
307
|
-
kind:
|
|
308
|
-
componentSortASC:
|
|
309
|
-
componentSortDESC:
|
|
310
|
-
scrollTop:
|
|
311
|
-
emptyPlaceholder:
|
|
312
|
-
variant:
|
|
313
|
-
renderSubComponent:
|
|
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
|
-
|
|
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
|
-
}),
|
|
321
|
-
if (![void 0, "undefined"].includes(
|
|
322
|
-
const
|
|
323
|
-
let
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
-
},
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
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
|
|
342
|
-
!
|
|
343
|
-
}, [
|
|
344
|
-
x > 0 &&
|
|
345
|
-
}, [
|
|
346
|
-
if (Array.isArray(l) &&
|
|
347
|
-
return
|
|
348
|
-
window.removeEventListener("resize",
|
|
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__ */
|
|
351
|
-
!
|
|
352
|
-
|
|
327
|
+
}, [l]), /* @__PURE__ */ y(f, { children: [
|
|
328
|
+
!D && /* @__PURE__ */ o(
|
|
329
|
+
Q,
|
|
353
330
|
{
|
|
354
|
-
theadTrId:
|
|
355
|
-
tbodyTrId:
|
|
356
|
-
headerId:
|
|
357
|
-
tableInstance:
|
|
358
|
-
classNameTable:
|
|
359
|
-
classNameWrapperTable: `${
|
|
360
|
-
${
|
|
361
|
-
handlerRowClick:
|
|
362
|
-
privillageRowClick:
|
|
363
|
-
maxHeight:
|
|
364
|
-
idCalculateHeight:
|
|
365
|
-
componentSortASC:
|
|
366
|
-
componentSortDESC:
|
|
367
|
-
classNamePointer:
|
|
368
|
-
emptyPlaceholder:
|
|
369
|
-
renderSubComponent:
|
|
370
|
-
visibilityColumns:
|
|
371
|
-
classNameSubMobile:
|
|
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
|
-
|
|
375
|
-
|
|
351
|
+
D && /* @__PURE__ */ o(
|
|
352
|
+
X,
|
|
376
353
|
{
|
|
377
|
-
theadTrId:
|
|
378
|
-
tbodyTrId:
|
|
379
|
-
headerId:
|
|
380
|
-
tableInstance:
|
|
381
|
-
classNameTable:
|
|
382
|
-
classNameWrapperTable: `${
|
|
383
|
-
${
|
|
384
|
-
handlerRowClick:
|
|
385
|
-
privillageRowClick:
|
|
386
|
-
virtualizationProps:
|
|
387
|
-
componentSortASC:
|
|
388
|
-
componentSortDESC:
|
|
389
|
-
classNamePointer:
|
|
390
|
-
emptyPlaceholder:
|
|
391
|
-
renderSubComponent:
|
|
392
|
-
visibilityColumns:
|
|
393
|
-
classNameSubMobile:
|
|
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
|
-
|
|
400
|
-
|
|
401
|
-
|
|
376
|
+
I as VirtualizationHead,
|
|
377
|
+
U as VirtualizationTable,
|
|
378
|
+
ot as default
|
|
402
379
|
};
|