@reportportal/ui-kit 0.0.1-alpha.141 → 0.0.1-alpha.142
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/adaptiveTagList.js +189 -0
- package/dist/attachedFile.js +9 -0
- package/dist/autocompletes.js +779 -0
- package/dist/baseIconButton-251479f7.js +25 -0
- package/dist/baseIconButton.js +7 -0
- package/dist/bind-06a7ff84.js +41 -0
- package/dist/breadcrumbs-8e5ca8d7.js +183 -0
- package/dist/breadcrumbs.js +12 -0
- package/dist/bubblesLoader-f3ffa240.js +28 -0
- package/dist/bubblesLoader.js +7 -0
- package/dist/button-97d9e587.js +66 -0
- package/dist/button.js +8 -0
- package/dist/calendarArrow-44c7e60e.js +5 -0
- package/dist/checkbox-ed6cc375.js +73 -0
- package/dist/checkbox.js +9 -0
- package/dist/chevronDownDropdown-66f5b1af.js +7 -0
- package/dist/clear-53660571.js +5 -0
- package/dist/close-4d480ef7.js +5 -0
- package/dist/datePicker-f8e0df24.js +194 -0
- package/dist/datePicker.js +35 -0
- package/dist/dropdown-0260bb66.js +5 -0
- package/dist/dropdown-893c692c.js +634 -0
- package/dist/dropdown.js +27 -0
- package/dist/fieldLabel.js +18 -0
- package/dist/fieldNumber-d1b5a7a1.js +140 -0
- package/dist/fieldNumber.js +13 -0
- package/dist/fieldText-1749da7a.js +167 -0
- package/dist/fieldText.js +14 -0
- package/dist/fieldTextFlex-2f51c173.js +80 -0
- package/dist/fieldTextFlex.js +10 -0
- package/dist/fileDropArea.js +325 -0
- package/dist/filterOutline-819b4b0d.js +6 -0
- package/dist/filtersButton.js +25 -0
- package/dist/floatingUi-41f8c7b5.js +29 -0
- package/dist/icons.js +85 -0
- package/dist/index-1a874a8b.js +110 -0
- package/dist/index.js +165 -0
- package/dist/isEmpty-ccacb5ff.js +38 -0
- package/dist/keyCodes-f63c0e11.js +4 -0
- package/dist/maxValueDisplay-9be01a75.js +13 -0
- package/dist/maxValueDisplay.js +6 -0
- package/dist/minus-2857540f.js +5 -0
- package/dist/modal.js +194 -0
- package/dist/openEye-950159cb.js +6 -0
- package/dist/pagination-a3dee614.js +347 -0
- package/dist/pagination.js +22 -0
- package/dist/plus-199fb2a8.js +5 -0
- package/dist/popover.js +80 -0
- package/dist/prevPage-87faf576.js +6 -0
- package/dist/radio-62546efa.js +76 -0
- package/dist/radio.js +9 -0
- package/dist/selection-9124d029.js +38 -0
- package/dist/selection.js +10 -0
- package/dist/sidePanel.js +88 -0
- package/dist/sortable.js +160 -0
- package/dist/spinLoader-c4a53718.js +11 -0
- package/dist/spinLoader.js +7 -0
- package/dist/success-8fd8bd2c.js +7 -0
- package/dist/systemAlert.js +69 -0
- package/dist/systemMessage-924fdaa6.js +30 -0
- package/dist/systemMessage.js +7 -0
- package/dist/table-c172f35e.js +504 -0
- package/dist/table.js +15 -0
- package/dist/themeProvider-46c2be7b.js +23 -0
- package/dist/themeProvider.js +7 -0
- package/dist/toggle-304107fa.js +59 -0
- package/dist/toggle.js +9 -0
- package/dist/tooltip.js +103 -0
- package/dist/tree-c3dd3d45.js +6 -0
- package/dist/xls-995781cc.js +11 -0
- package/package.json +8 -6
- package/dist/adaptiveTagList.cjs +0 -1
- package/dist/attachedFile.cjs +0 -1
- package/dist/autocompletes.cjs +0 -1
- package/dist/baseIconButton-263e74dc.js +0 -1
- package/dist/baseIconButton.cjs +0 -1
- package/dist/bind-29baac98.js +0 -5
- package/dist/breadcrumbs-a11e7e56.js +0 -1
- package/dist/breadcrumbs.cjs +0 -1
- package/dist/bubblesLoader-98fdf0af.js +0 -1
- package/dist/bubblesLoader.cjs +0 -1
- package/dist/button-8456d133.js +0 -1
- package/dist/button.cjs +0 -1
- package/dist/calendarArrow-6c6d9356.js +0 -1
- package/dist/checkbox-d4cc648d.js +0 -1
- package/dist/checkbox.cjs +0 -1
- package/dist/chevronDownDropdown-6196562c.js +0 -1
- package/dist/clear-07e1c174.js +0 -1
- package/dist/close-82e2e274.js +0 -1
- package/dist/datePicker-245e845d.js +0 -1
- package/dist/datePicker.cjs +0 -1
- package/dist/dropdown-b56964c6.js +0 -1
- package/dist/dropdown-fa4cd19c.js +0 -1
- package/dist/dropdown.cjs +0 -1
- package/dist/fieldLabel.cjs +0 -1
- package/dist/fieldNumber-9fe044df.js +0 -1
- package/dist/fieldNumber.cjs +0 -1
- package/dist/fieldText-2af0d7db.js +0 -1
- package/dist/fieldText.cjs +0 -1
- package/dist/fieldTextFlex-c26b190d.js +0 -1
- package/dist/fieldTextFlex.cjs +0 -1
- package/dist/fileDropArea.cjs +0 -1
- package/dist/filterOutline-5f3f8591.js +0 -1
- package/dist/filtersButton.cjs +0 -1
- package/dist/floatingUi-97183bba.js +0 -1
- package/dist/icons.cjs +0 -1
- package/dist/index-4c0424bf.js +0 -1
- package/dist/index.cjs +0 -1
- package/dist/isEmpty-fe949e63.js +0 -1
- package/dist/keyCodes-b188a920.js +0 -1
- package/dist/maxValueDisplay-68f1f114.js +0 -1
- package/dist/maxValueDisplay.cjs +0 -1
- package/dist/minus-0debd2c6.js +0 -1
- package/dist/modal.cjs +0 -1
- package/dist/openEye-737c72d6.js +0 -1
- package/dist/pagination-fc5189f7.js +0 -1
- package/dist/pagination.cjs +0 -1
- package/dist/plus-b12abe9f.js +0 -1
- package/dist/popover.cjs +0 -1
- package/dist/prevPage-063b5d63.js +0 -1
- package/dist/radio-aba4677b.js +0 -1
- package/dist/radio.cjs +0 -1
- package/dist/selection-49b927d0.js +0 -1
- package/dist/selection.cjs +0 -1
- package/dist/sidePanel.cjs +0 -1
- package/dist/sortable.cjs +0 -1
- package/dist/spinLoader-9ebd776a.js +0 -1
- package/dist/spinLoader.cjs +0 -1
- package/dist/success-823e5446.js +0 -1
- package/dist/systemAlert.cjs +0 -1
- package/dist/systemMessage-1ae2764d.js +0 -1
- package/dist/systemMessage.cjs +0 -1
- package/dist/table-cd9f0ff3.js +0 -1
- package/dist/table.cjs +0 -1
- package/dist/themeProvider-4dfafca5.js +0 -1
- package/dist/themeProvider.cjs +0 -1
- package/dist/toggle-359b70d4.js +0 -1
- package/dist/toggle.cjs +0 -1
- package/dist/tooltip.cjs +0 -1
- package/dist/tree-4610ac42.js +0 -1
- package/dist/xls-3ed747b0.js +0 -1
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
import { jsx as o, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as ee, useState as A, useCallback as C, useEffect as le, useRef as ae } from "react";
|
|
3
|
+
import { c as me } from "./bind-06a7ff84.js";
|
|
4
|
+
import { b as V, a as Z, S as Ne } from "./chevronDownDropdown-66f5b1af.js";
|
|
5
|
+
import { C as R } from "./checkbox-ed6cc375.js";
|
|
6
|
+
import { Tooltip as qe } from "./tooltip.js";
|
|
7
|
+
const P = (l) => typeof l == "string", Ee = "_table_qg65a_1", Me = "_selectable_qg65a_56", $e = "_expanded_qg65a_52", Se = "_label_qg65a_283", Te = {
|
|
8
|
+
table: Ee,
|
|
9
|
+
"fixed-header": "_fixed-header_qg65a_8",
|
|
10
|
+
"horizontally-scrollable-container": "_horizontally-scrollable-container_qg65a_14",
|
|
11
|
+
"table-header": "_table-header_qg65a_19",
|
|
12
|
+
"sticky-header": "_sticky-header_qg65a_26",
|
|
13
|
+
"horizontally-scrollable": "_horizontally-scrollable_qg65a_14",
|
|
14
|
+
"table-row": "_table-row_qg65a_47",
|
|
15
|
+
"expanded-cell": "_expanded-cell_qg65a_52",
|
|
16
|
+
selectable: Me,
|
|
17
|
+
"row-content-wrapper": "_row-content-wrapper_qg65a_60",
|
|
18
|
+
"table-row-content": "_table-row-content_qg65a_68",
|
|
19
|
+
"expand-cell": "_expand-cell_qg65a_82",
|
|
20
|
+
"size-small": "_size-small_qg65a_85",
|
|
21
|
+
"size-large": "_size-large_qg65a_96",
|
|
22
|
+
"table-body": "_table-body_qg65a_108",
|
|
23
|
+
"scrollable-body": "_scrollable-body_qg65a_114",
|
|
24
|
+
"table-header-cell": "_table-header-cell_qg65a_163",
|
|
25
|
+
"table-cell": "_table-cell_qg65a_164",
|
|
26
|
+
"action-menu-cell": "_action-menu-cell_qg65a_170",
|
|
27
|
+
"checkbox-cell": "_checkbox-cell_qg65a_195",
|
|
28
|
+
"expand-all-tooltip-wrapper": "_expand-all-tooltip-wrapper_qg65a_237",
|
|
29
|
+
"expand-all-tooltip-content": "_expand-all-tooltip-content_qg65a_246",
|
|
30
|
+
"expand-icon": "_expand-icon_qg65a_255",
|
|
31
|
+
expanded: $e,
|
|
32
|
+
"primary-cell": "_primary-cell_qg65a_264",
|
|
33
|
+
label: Se,
|
|
34
|
+
"sortable-cell": "_sortable-cell_qg65a_294",
|
|
35
|
+
"align-right": "_align-right_qg65a_297",
|
|
36
|
+
"align-center": "_align-center_qg65a_303",
|
|
37
|
+
"pinned-column": "_pinned-column_qg65a_306"
|
|
38
|
+
}, te = "asc", m = 32, ne = 100, ze = 48, Ae = (l) => l.toLowerCase() === te, Le = (l) => l.map((t) => t.key), w = (l) => "primary" in l && l.primary === !0, We = (l) => {
|
|
39
|
+
var n;
|
|
40
|
+
return `size-${((n = l.rowConfigs) == null ? void 0 : n.size) ?? "default"}`;
|
|
41
|
+
}, Pe = (l, t, n, r, i) => {
|
|
42
|
+
let c = 0;
|
|
43
|
+
r && (c += m), i && (c += m);
|
|
44
|
+
for (let h = 0; h < l; h++) {
|
|
45
|
+
const y = t[h];
|
|
46
|
+
if (w(y)) {
|
|
47
|
+
const a = n.current.get(y.key) || ne;
|
|
48
|
+
c += a;
|
|
49
|
+
} else {
|
|
50
|
+
const a = y, s = P(a.width) ? parseInt(a.width, 10) || 0 : a.width;
|
|
51
|
+
c += s;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return c;
|
|
55
|
+
}, z = (l, t, n, r, i, c, h) => {
|
|
56
|
+
const y = {};
|
|
57
|
+
if (!w(l)) {
|
|
58
|
+
const a = l;
|
|
59
|
+
y.textAlign = a.align;
|
|
60
|
+
}
|
|
61
|
+
if (t && n !== void 0) {
|
|
62
|
+
const a = Pe(
|
|
63
|
+
n,
|
|
64
|
+
r,
|
|
65
|
+
i,
|
|
66
|
+
c,
|
|
67
|
+
h
|
|
68
|
+
);
|
|
69
|
+
y.left = `${a}px`;
|
|
70
|
+
}
|
|
71
|
+
return y;
|
|
72
|
+
}, F = (l, t, n, r, i, c = !1) => {
|
|
73
|
+
const h = [];
|
|
74
|
+
n && h.push(`${m}px`), c && r && h.push(`${m}px`);
|
|
75
|
+
const y = (a) => {
|
|
76
|
+
if (w(a)) {
|
|
77
|
+
const s = a, p = s.width ? P(s.width) ? s.width : `${s.width}px` : `${ne}px`;
|
|
78
|
+
h.push(`minmax(${p}, 1fr)`);
|
|
79
|
+
} else {
|
|
80
|
+
const s = a, p = P(s.width) ? s.width : `${s.width}px`;
|
|
81
|
+
h.push(p);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
return l.forEach(y), t.forEach(y), i && h.push(`${ze}px`), h.join(" ");
|
|
85
|
+
}, De = ({
|
|
86
|
+
primaryColumns: l,
|
|
87
|
+
fixedColumns: t,
|
|
88
|
+
pinnedColumnKeys: n
|
|
89
|
+
}) => ee(() => {
|
|
90
|
+
const r = [], i = [];
|
|
91
|
+
return l.forEach((c) => {
|
|
92
|
+
const h = { ...c, primary: !0 };
|
|
93
|
+
n.includes(c.key) ? r.push(h) : i.push(h);
|
|
94
|
+
}), t.forEach((c) => {
|
|
95
|
+
n.includes(c.key) ? r.push(c) : i.push(c);
|
|
96
|
+
}), {
|
|
97
|
+
pinnedColumns: r,
|
|
98
|
+
scrollableColumns: i
|
|
99
|
+
};
|
|
100
|
+
}, [l, t, n]), Ue = () => {
|
|
101
|
+
const [l, t] = A(null), [n, r] = A(null), i = C((a) => {
|
|
102
|
+
t(a);
|
|
103
|
+
}, []), c = C(() => {
|
|
104
|
+
t(null);
|
|
105
|
+
}, []), h = C((a) => {
|
|
106
|
+
r(a);
|
|
107
|
+
}, []), y = C(() => {
|
|
108
|
+
r(null);
|
|
109
|
+
}, []);
|
|
110
|
+
return {
|
|
111
|
+
hoveredColumn: l,
|
|
112
|
+
hoveredRow: n,
|
|
113
|
+
handleColumnMouseEnter: i,
|
|
114
|
+
handleColumnMouseLeave: c,
|
|
115
|
+
handleRowMouseEnter: h,
|
|
116
|
+
handleRowMouseLeave: y
|
|
117
|
+
};
|
|
118
|
+
}, Oe = ({
|
|
119
|
+
primaryColumns: l,
|
|
120
|
+
fixedColumns: t,
|
|
121
|
+
expandedRowIds: n,
|
|
122
|
+
onToggleRowExpansion: r
|
|
123
|
+
}) => {
|
|
124
|
+
const [i, c] = A(/* @__PURE__ */ new Set());
|
|
125
|
+
le(() => {
|
|
126
|
+
const a = [
|
|
127
|
+
...l.map((p) => p.key),
|
|
128
|
+
...t.map((p) => p.key)
|
|
129
|
+
], s = /* @__PURE__ */ new Set();
|
|
130
|
+
n.forEach((p) => {
|
|
131
|
+
a.forEach((f) => {
|
|
132
|
+
s.add(`${p}-${f}`);
|
|
133
|
+
});
|
|
134
|
+
}), c((p) => {
|
|
135
|
+
if (p.size === s.size) {
|
|
136
|
+
let f = !0;
|
|
137
|
+
if (p.forEach((u) => {
|
|
138
|
+
s.has(u) || (f = !1);
|
|
139
|
+
}), f)
|
|
140
|
+
return p;
|
|
141
|
+
}
|
|
142
|
+
return s;
|
|
143
|
+
});
|
|
144
|
+
}, [n, l, t]);
|
|
145
|
+
const h = C(
|
|
146
|
+
(a) => {
|
|
147
|
+
const s = new Set(i), p = n.includes(a), f = [
|
|
148
|
+
...l.map((u) => u.key),
|
|
149
|
+
...t.map((u) => u.key)
|
|
150
|
+
];
|
|
151
|
+
p ? f.forEach((u) => {
|
|
152
|
+
const k = `${a}-${u}`;
|
|
153
|
+
s.delete(k);
|
|
154
|
+
}) : f.forEach((u) => {
|
|
155
|
+
const k = `${a}-${u}`;
|
|
156
|
+
s.add(k);
|
|
157
|
+
}), c(s), r(a);
|
|
158
|
+
},
|
|
159
|
+
[i, n, l, t, r]
|
|
160
|
+
), y = C(
|
|
161
|
+
(a, s) => {
|
|
162
|
+
const p = `${a}-${s}`;
|
|
163
|
+
return i.has(p);
|
|
164
|
+
},
|
|
165
|
+
[i]
|
|
166
|
+
);
|
|
167
|
+
return {
|
|
168
|
+
expandedCells: i,
|
|
169
|
+
handleToggleRowExpansion: h,
|
|
170
|
+
isCellExpanded: y
|
|
171
|
+
};
|
|
172
|
+
}, je = () => {
|
|
173
|
+
const l = ae(/* @__PURE__ */ new Map()), t = C(
|
|
174
|
+
(n) => (r) => {
|
|
175
|
+
if (!r)
|
|
176
|
+
return;
|
|
177
|
+
const i = r.getBoundingClientRect().width;
|
|
178
|
+
i > 0 && l.current.set(n, i);
|
|
179
|
+
},
|
|
180
|
+
[]
|
|
181
|
+
);
|
|
182
|
+
return {
|
|
183
|
+
columnWidthsRef: l,
|
|
184
|
+
setCellRef: t
|
|
185
|
+
};
|
|
186
|
+
}, d = me.bind(Te), I = ({ column: l }) => {
|
|
187
|
+
const t = ae(null), [n, r] = A(!1);
|
|
188
|
+
return le(() => {
|
|
189
|
+
if (t.current) {
|
|
190
|
+
const i = t.current.offsetWidth, c = t.current.scrollWidth;
|
|
191
|
+
r(c > i);
|
|
192
|
+
}
|
|
193
|
+
}, [l.header]), /* @__PURE__ */ o("span", { ref: t, title: n ? l.header : void 0, children: l.header });
|
|
194
|
+
}, Je = ({
|
|
195
|
+
data: l,
|
|
196
|
+
primaryColumn: t,
|
|
197
|
+
fixedColumns: n,
|
|
198
|
+
renderRowActions: r,
|
|
199
|
+
className: i = "",
|
|
200
|
+
rowClassName: c = "",
|
|
201
|
+
headerClassName: h = "",
|
|
202
|
+
bodyClassName: y = "",
|
|
203
|
+
selectable: a = !1,
|
|
204
|
+
selectedRowIds: s = [],
|
|
205
|
+
sortingDirection: p = te,
|
|
206
|
+
sortingColumn: f,
|
|
207
|
+
sortableColumns: u,
|
|
208
|
+
isHeaderFixed: k = !1,
|
|
209
|
+
isHorizontallyScrollable: L = !1,
|
|
210
|
+
pinnedColumnKeys: se = [],
|
|
211
|
+
isRowsExpandable: g = !1,
|
|
212
|
+
expandedRowIds: N = [],
|
|
213
|
+
isAllExpandedByDefault: D,
|
|
214
|
+
expandAllTooltip: U,
|
|
215
|
+
onChangeSorting: oe = () => {
|
|
216
|
+
},
|
|
217
|
+
onToggleRowSelection: re = () => {
|
|
218
|
+
},
|
|
219
|
+
onToggleAllRowsSelection: ce = () => {
|
|
220
|
+
},
|
|
221
|
+
onToggleRowExpansion: ie = () => {
|
|
222
|
+
},
|
|
223
|
+
onToggleAllRowsExpansion: de = () => {
|
|
224
|
+
}
|
|
225
|
+
}) => {
|
|
226
|
+
const q = ee(
|
|
227
|
+
() => Array.isArray(t) ? t : [t],
|
|
228
|
+
[t]
|
|
229
|
+
), b = f ?? q[0], E = u ?? Le([...q, ...n]), { pinnedColumns: v, scrollableColumns: M } = De({
|
|
230
|
+
primaryColumns: q,
|
|
231
|
+
fixedColumns: n,
|
|
232
|
+
pinnedColumnKeys: se
|
|
233
|
+
}), {
|
|
234
|
+
hoveredColumn: O,
|
|
235
|
+
hoveredRow: he,
|
|
236
|
+
handleColumnMouseEnter: j,
|
|
237
|
+
handleColumnMouseLeave: B,
|
|
238
|
+
handleRowMouseEnter: pe,
|
|
239
|
+
handleRowMouseLeave: _e
|
|
240
|
+
} = Ue(), { columnWidthsRef: $, setCellRef: H } = je(), { handleToggleRowExpansion: ye, isCellExpanded: G } = Oe({
|
|
241
|
+
primaryColumns: q,
|
|
242
|
+
fixedColumns: n,
|
|
243
|
+
expandedRowIds: N,
|
|
244
|
+
onToggleRowExpansion: ie
|
|
245
|
+
}), X = (e) => {
|
|
246
|
+
E.includes(e) && oe({ key: e, direction: p });
|
|
247
|
+
}, ue = (e) => {
|
|
248
|
+
re(e);
|
|
249
|
+
}, ge = () => {
|
|
250
|
+
ce();
|
|
251
|
+
}, fe = () => {
|
|
252
|
+
de();
|
|
253
|
+
}, K = (e) => E.includes(e) ? (b == null ? void 0 : b.key) === e ? Ae(p) ? /* @__PURE__ */ o(Z, {}) : /* @__PURE__ */ o(Ne, {}) : /* @__PURE__ */ o(Z, {}) : null, be = l.every((e) => s.includes(e.id)), ke = l.some((e) => s.includes(e.id)), Y = (s == null ? void 0 : s.length) > 0, ve = l.every((e) => N.includes(e.id)), Ce = D !== void 0 ? D : ve, we = F(
|
|
254
|
+
v,
|
|
255
|
+
M,
|
|
256
|
+
g,
|
|
257
|
+
a,
|
|
258
|
+
!!r,
|
|
259
|
+
!1
|
|
260
|
+
), xe = F(
|
|
261
|
+
v,
|
|
262
|
+
M,
|
|
263
|
+
g,
|
|
264
|
+
a,
|
|
265
|
+
!!r,
|
|
266
|
+
!0
|
|
267
|
+
), J = /* @__PURE__ */ o("button", { onClick: fe, "aria-label": "Toggle all rows expansion", children: /* @__PURE__ */ o("span", { className: d("expand-icon", { expanded: Ce }), children: /* @__PURE__ */ o(V, {}) }) });
|
|
268
|
+
return /* @__PURE__ */ x(
|
|
269
|
+
"div",
|
|
270
|
+
{
|
|
271
|
+
className: d(
|
|
272
|
+
"table",
|
|
273
|
+
{
|
|
274
|
+
"fixed-header": k,
|
|
275
|
+
"horizontally-scrollable-container": k && L
|
|
276
|
+
},
|
|
277
|
+
i
|
|
278
|
+
),
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ x(
|
|
281
|
+
"div",
|
|
282
|
+
{
|
|
283
|
+
className: d(
|
|
284
|
+
"table-header",
|
|
285
|
+
{
|
|
286
|
+
"sticky-header": k,
|
|
287
|
+
"horizontally-scrollable": L
|
|
288
|
+
},
|
|
289
|
+
h
|
|
290
|
+
),
|
|
291
|
+
style: { gridTemplateColumns: xe },
|
|
292
|
+
children: [
|
|
293
|
+
a && /* @__PURE__ */ o(
|
|
294
|
+
"div",
|
|
295
|
+
{
|
|
296
|
+
className: d("table-header-cell", "checkbox-cell"),
|
|
297
|
+
style: { left: g ? `${m}px` : "0" },
|
|
298
|
+
children: Y && /* @__PURE__ */ o(
|
|
299
|
+
R,
|
|
300
|
+
{
|
|
301
|
+
value: be,
|
|
302
|
+
partiallyChecked: ke,
|
|
303
|
+
onChange: ge,
|
|
304
|
+
className: d("checkbox-cell")
|
|
305
|
+
}
|
|
306
|
+
)
|
|
307
|
+
}
|
|
308
|
+
),
|
|
309
|
+
g && /* @__PURE__ */ o("div", { className: d("table-header-cell", "expand-cell"), style: { left: "0" }, children: U ? /* @__PURE__ */ o(
|
|
310
|
+
qe,
|
|
311
|
+
{
|
|
312
|
+
content: U,
|
|
313
|
+
placement: "top",
|
|
314
|
+
wrapperClassName: d("expand-all-tooltip-wrapper"),
|
|
315
|
+
contentClassName: d("expand-all-tooltip-content"),
|
|
316
|
+
children: J
|
|
317
|
+
}
|
|
318
|
+
) : J }),
|
|
319
|
+
v.map((e, S) => /* @__PURE__ */ o(
|
|
320
|
+
"button",
|
|
321
|
+
{
|
|
322
|
+
className: d("table-header-cell", "pinned-column", {
|
|
323
|
+
[`align-${e.align}`]: "align" in e,
|
|
324
|
+
"primary-cell": w(e),
|
|
325
|
+
"sortable-cell": E.includes(e.key)
|
|
326
|
+
}),
|
|
327
|
+
style: z(
|
|
328
|
+
e,
|
|
329
|
+
!0,
|
|
330
|
+
S,
|
|
331
|
+
v,
|
|
332
|
+
$,
|
|
333
|
+
g,
|
|
334
|
+
a
|
|
335
|
+
),
|
|
336
|
+
children: /* @__PURE__ */ x(
|
|
337
|
+
"div",
|
|
338
|
+
{
|
|
339
|
+
className: d("label"),
|
|
340
|
+
onClick: () => X(e.key),
|
|
341
|
+
onMouseEnter: () => j(e.key),
|
|
342
|
+
onMouseLeave: B,
|
|
343
|
+
children: [
|
|
344
|
+
/* @__PURE__ */ o(I, { column: e }),
|
|
345
|
+
(O === e.key || (b == null ? void 0 : b.key) === e.key) && K(e.key)
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
)
|
|
349
|
+
},
|
|
350
|
+
e.key
|
|
351
|
+
)),
|
|
352
|
+
M.map((e) => /* @__PURE__ */ o(
|
|
353
|
+
"button",
|
|
354
|
+
{
|
|
355
|
+
className: d("table-header-cell", {
|
|
356
|
+
[`align-${e.align}`]: "align" in e,
|
|
357
|
+
"primary-cell": w(e),
|
|
358
|
+
"sortable-cell": E.includes(e.key)
|
|
359
|
+
}),
|
|
360
|
+
style: z(
|
|
361
|
+
e,
|
|
362
|
+
!1,
|
|
363
|
+
void 0,
|
|
364
|
+
v,
|
|
365
|
+
$,
|
|
366
|
+
g,
|
|
367
|
+
a
|
|
368
|
+
),
|
|
369
|
+
children: /* @__PURE__ */ x(
|
|
370
|
+
"div",
|
|
371
|
+
{
|
|
372
|
+
className: d("label"),
|
|
373
|
+
onClick: () => X(e.key),
|
|
374
|
+
onMouseEnter: () => j(e.key),
|
|
375
|
+
onMouseLeave: B,
|
|
376
|
+
children: [
|
|
377
|
+
/* @__PURE__ */ o(I, { column: e }),
|
|
378
|
+
(O === e.key || (b == null ? void 0 : b.key) === e.key) && K(e.key)
|
|
379
|
+
]
|
|
380
|
+
}
|
|
381
|
+
)
|
|
382
|
+
},
|
|
383
|
+
e.key
|
|
384
|
+
)),
|
|
385
|
+
r && /* @__PURE__ */ o("div", { className: d("table-header-cell", "action-menu-cell") })
|
|
386
|
+
]
|
|
387
|
+
}
|
|
388
|
+
),
|
|
389
|
+
/* @__PURE__ */ o(
|
|
390
|
+
"div",
|
|
391
|
+
{
|
|
392
|
+
className: d(
|
|
393
|
+
"table-body",
|
|
394
|
+
{
|
|
395
|
+
"scrollable-body": k,
|
|
396
|
+
"horizontally-scrollable": L
|
|
397
|
+
},
|
|
398
|
+
y
|
|
399
|
+
),
|
|
400
|
+
children: l.map((e, S) => /* @__PURE__ */ x(
|
|
401
|
+
"div",
|
|
402
|
+
{
|
|
403
|
+
className: d("table-row", We(e), c, {
|
|
404
|
+
selectable: a
|
|
405
|
+
}),
|
|
406
|
+
onMouseEnter: () => pe(S),
|
|
407
|
+
onMouseLeave: _e,
|
|
408
|
+
children: [
|
|
409
|
+
a && /* @__PURE__ */ o(
|
|
410
|
+
"div",
|
|
411
|
+
{
|
|
412
|
+
className: d("table-cell", "checkbox-cell"),
|
|
413
|
+
style: { left: g ? `${m}px` : "0" },
|
|
414
|
+
children: (Y || he === S) && /* @__PURE__ */ o(
|
|
415
|
+
R,
|
|
416
|
+
{
|
|
417
|
+
value: s.includes(e.id),
|
|
418
|
+
onChange: () => ue(e.id),
|
|
419
|
+
className: d("checkbox-cell")
|
|
420
|
+
}
|
|
421
|
+
)
|
|
422
|
+
}
|
|
423
|
+
),
|
|
424
|
+
/* @__PURE__ */ o("div", { className: d("row-content-wrapper"), children: /* @__PURE__ */ x("div", { className: d("table-row-content"), style: { gridTemplateColumns: we }, children: [
|
|
425
|
+
g && /* @__PURE__ */ o("div", { className: d("table-cell", "expand-cell"), style: { left: "0" }, children: /* @__PURE__ */ o(
|
|
426
|
+
"button",
|
|
427
|
+
{
|
|
428
|
+
onClick: () => ye(e.id),
|
|
429
|
+
"aria-label": N.includes(e.id) ? "Collapse row" : "Expand row",
|
|
430
|
+
"aria-expanded": N.includes(e.id),
|
|
431
|
+
children: /* @__PURE__ */ o(
|
|
432
|
+
"span",
|
|
433
|
+
{
|
|
434
|
+
className: d("expand-icon", {
|
|
435
|
+
expanded: N.includes(e.id)
|
|
436
|
+
}),
|
|
437
|
+
children: /* @__PURE__ */ o(V, {})
|
|
438
|
+
}
|
|
439
|
+
)
|
|
440
|
+
}
|
|
441
|
+
) }),
|
|
442
|
+
v.map((_, W) => {
|
|
443
|
+
const T = G(e.id, _.key), Q = w(_);
|
|
444
|
+
return /* @__PURE__ */ o(
|
|
445
|
+
"div",
|
|
446
|
+
{
|
|
447
|
+
ref: Q ? H(_.key) : void 0,
|
|
448
|
+
className: d("table-cell", "pinned-column", {
|
|
449
|
+
"primary-cell": Q,
|
|
450
|
+
"expanded-cell": T
|
|
451
|
+
}),
|
|
452
|
+
style: z(
|
|
453
|
+
_,
|
|
454
|
+
!0,
|
|
455
|
+
W,
|
|
456
|
+
v,
|
|
457
|
+
$,
|
|
458
|
+
g,
|
|
459
|
+
a
|
|
460
|
+
),
|
|
461
|
+
children: e[_.key].component || e[_.key].content || e[_.key]
|
|
462
|
+
},
|
|
463
|
+
_.key
|
|
464
|
+
);
|
|
465
|
+
}),
|
|
466
|
+
M.map((_) => {
|
|
467
|
+
const W = G(e.id, _.key), T = w(_);
|
|
468
|
+
return /* @__PURE__ */ o(
|
|
469
|
+
"div",
|
|
470
|
+
{
|
|
471
|
+
ref: T ? H(_.key) : void 0,
|
|
472
|
+
className: d("table-cell", {
|
|
473
|
+
"primary-cell": T,
|
|
474
|
+
"expanded-cell": W
|
|
475
|
+
}),
|
|
476
|
+
style: z(
|
|
477
|
+
_,
|
|
478
|
+
!1,
|
|
479
|
+
void 0,
|
|
480
|
+
v,
|
|
481
|
+
$,
|
|
482
|
+
g,
|
|
483
|
+
a
|
|
484
|
+
),
|
|
485
|
+
children: e[_.key].component || e[_.key].content || e[_.key]
|
|
486
|
+
},
|
|
487
|
+
_.key
|
|
488
|
+
);
|
|
489
|
+
}),
|
|
490
|
+
r && /* @__PURE__ */ o("div", { className: d("table-cell", "action-menu-cell"), children: r(e.metaData) })
|
|
491
|
+
] }) })
|
|
492
|
+
]
|
|
493
|
+
},
|
|
494
|
+
e.id
|
|
495
|
+
))
|
|
496
|
+
}
|
|
497
|
+
)
|
|
498
|
+
]
|
|
499
|
+
}
|
|
500
|
+
);
|
|
501
|
+
};
|
|
502
|
+
export {
|
|
503
|
+
Je as T
|
|
504
|
+
};
|
package/dist/table.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { T as r } from "./table-c172f35e.js";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import "./bind-06a7ff84.js";
|
|
5
|
+
import "./chevronDownDropdown-66f5b1af.js";
|
|
6
|
+
import "./checkbox-ed6cc375.js";
|
|
7
|
+
import "./keyCodes-f63c0e11.js";
|
|
8
|
+
import "./tooltip.js";
|
|
9
|
+
import "react-dom";
|
|
10
|
+
import "@floating-ui/react";
|
|
11
|
+
import "./floatingUi-41f8c7b5.js";
|
|
12
|
+
export {
|
|
13
|
+
r as Table,
|
|
14
|
+
r as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as h } from "./bind-06a7ff84.js";
|
|
3
|
+
const n = {
|
|
4
|
+
"theme-provider": "_theme-provider_xipmx_1"
|
|
5
|
+
}, c = h.bind(n), e = {
|
|
6
|
+
light: "rp-ui-kit-theme-light",
|
|
7
|
+
dark: "rp-ui-kit-theme-dark"
|
|
8
|
+
};
|
|
9
|
+
function p({
|
|
10
|
+
children: t,
|
|
11
|
+
theme: i = "light",
|
|
12
|
+
customThemes: r = {},
|
|
13
|
+
className: s
|
|
14
|
+
}) {
|
|
15
|
+
const m = {
|
|
16
|
+
...e,
|
|
17
|
+
...r
|
|
18
|
+
}[i] || e.light;
|
|
19
|
+
return /* @__PURE__ */ o("div", { className: c("theme-provider", s, m), children: t });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
p as T
|
|
23
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsxs as b, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { c as h } from "./bind-06a7ff84.js";
|
|
3
|
+
import { useRef as k, useId as x } from "react";
|
|
4
|
+
import { K as _ } from "./keyCodes-f63c0e11.js";
|
|
5
|
+
const y = "_toggle_1c7gt_1", E = "_slider_1c7gt_27", D = "_round_1c7gt_47", K = "_input_1c7gt_51", N = "_disabled_1c7gt_92", C = {
|
|
6
|
+
toggle: y,
|
|
7
|
+
"children-container": "_children-container_1c7gt_14",
|
|
8
|
+
slider: E,
|
|
9
|
+
round: D,
|
|
10
|
+
input: K,
|
|
11
|
+
disabled: N
|
|
12
|
+
}, e = h.bind(C), w = ({
|
|
13
|
+
children: s,
|
|
14
|
+
value: r,
|
|
15
|
+
onChange: g,
|
|
16
|
+
className: u,
|
|
17
|
+
disabled: t = !1,
|
|
18
|
+
title: p,
|
|
19
|
+
...m
|
|
20
|
+
}) => {
|
|
21
|
+
const c = k(null), l = x(), f = (n) => {
|
|
22
|
+
var a, d;
|
|
23
|
+
const { keyCode: i } = n;
|
|
24
|
+
if (i === _.SPACE_KEY_CODE) {
|
|
25
|
+
n.preventDefault(), (a = c.current) == null || a.click();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
i === _.ENTER_KEY_CODE && (n.preventDefault(), (d = c.current) == null || d.click());
|
|
29
|
+
};
|
|
30
|
+
return /* @__PURE__ */ b("label", { id: l, title: p, className: e("toggle", u, { disabled: t }), children: [
|
|
31
|
+
/* @__PURE__ */ o(
|
|
32
|
+
"input",
|
|
33
|
+
{
|
|
34
|
+
ref: c,
|
|
35
|
+
tabIndex: t ? -1 : 0,
|
|
36
|
+
onChange: g,
|
|
37
|
+
checked: r,
|
|
38
|
+
disabled: t,
|
|
39
|
+
onKeyDown: f,
|
|
40
|
+
className: e("input"),
|
|
41
|
+
type: "checkbox",
|
|
42
|
+
...m
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
/* @__PURE__ */ o(
|
|
46
|
+
"div",
|
|
47
|
+
{
|
|
48
|
+
"aria-labelledby": l,
|
|
49
|
+
role: "checkbox",
|
|
50
|
+
"aria-checked": r,
|
|
51
|
+
className: e("slider", "round")
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
s && /* @__PURE__ */ o("span", { className: e("children-container"), children: s })
|
|
55
|
+
] });
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
w as T
|
|
59
|
+
};
|