ia-table 0.13.3 → 0.14.1
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/index.d.ts +245 -0
- package/dist/index.js +8164 -9329
- package/dist/pivot.d.ts +2153 -0
- package/dist/pivot.js +1867 -0
- package/dist/right-arrow-Af0m3Gur.js +1317 -0
- package/package.json +6 -1
|
@@ -0,0 +1,1317 @@
|
|
|
1
|
+
import { jsxs as I, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import * as L from "react";
|
|
3
|
+
import { useRef as G, useEffect as F, memo as te, useCallback as U, useState as X } from "react";
|
|
4
|
+
import { createPortal as se } from "react-dom";
|
|
5
|
+
const We = 200, je = 2, ve = 56, be = 48, De = {
|
|
6
|
+
default: {
|
|
7
|
+
height: 46,
|
|
8
|
+
padding: 24
|
|
9
|
+
},
|
|
10
|
+
compact: {
|
|
11
|
+
height: 30,
|
|
12
|
+
padding: 9
|
|
13
|
+
},
|
|
14
|
+
comfortable: {
|
|
15
|
+
height: 52,
|
|
16
|
+
padding: 32
|
|
17
|
+
}
|
|
18
|
+
}, Fe = {
|
|
19
|
+
46: "32px",
|
|
20
|
+
30: "24px",
|
|
21
|
+
52: "32px"
|
|
22
|
+
}, Ze = 16, Oe = [
|
|
23
|
+
"int",
|
|
24
|
+
"str",
|
|
25
|
+
"percentage",
|
|
26
|
+
"number",
|
|
27
|
+
"date",
|
|
28
|
+
"datetime",
|
|
29
|
+
"time",
|
|
30
|
+
"float",
|
|
31
|
+
"dollar",
|
|
32
|
+
"decimal",
|
|
33
|
+
"DateTimeField",
|
|
34
|
+
"daterangepicker",
|
|
35
|
+
"list",
|
|
36
|
+
"dropdown"
|
|
37
|
+
], Ue = 0, Ge = "furthestFromViewport", qe = 2, ze = !1, Be = "infiniteCache", Ye = {
|
|
38
|
+
maxPersistedBlocks: 5,
|
|
39
|
+
persistBlockData: !0,
|
|
40
|
+
compressionEnabled: !1
|
|
41
|
+
}, Ke = 1e6, le = 3, Xe = 7, Je = 6, Qe = ({
|
|
42
|
+
isFrozen: e,
|
|
43
|
+
column: t,
|
|
44
|
+
frozenColumns: n
|
|
45
|
+
}) => {
|
|
46
|
+
const s = e && t.pinned !== "right", a = e && t.pinned === "right", i = Z(t), o = s && n.positions ? n.positions[i] : null, c = s && n.indexes ? n.indexes.indexOf(i) : null, r = a && n.rightPinned && n.rightPinned.positions ? n.rightPinned.positions[i] : null;
|
|
47
|
+
return {
|
|
48
|
+
isPinnedLeft: s,
|
|
49
|
+
isPinnedRight: a,
|
|
50
|
+
frozenPosition: o,
|
|
51
|
+
frozenIndex: c,
|
|
52
|
+
rightPinnedPosition: r
|
|
53
|
+
};
|
|
54
|
+
}, we = (e, t, n) => e ? t || n ? be : ve : 0, et = (e, t) => {
|
|
55
|
+
let n = e;
|
|
56
|
+
return t.includes(".") && !n[t] ? (t.split(".").every((a) => n[a] ? (n = n[a], !0) : !1), n) : Object.prototype.hasOwnProperty.call(n, t);
|
|
57
|
+
}, Z = (e) => e && (e.colId || e.field || e.column_name || e.accessor || e.groupId || e.headerName) || "", Ce = (e, t = !1) => e.uniqueHierarchyId ? t && e.originalPath ? e.originalPath : e.path || [] : e.path || [], W = (e) => e.is_hidden || e.hidden || e.hide || !1, z = (e, t, n) => {
|
|
58
|
+
let s = t;
|
|
59
|
+
return e.length <= t && (s = e.findIndex((a) => a === n)), s >= 1 && e.length > 1 ? `${e.slice(0, s).join("/")}/${n ?? ""}` : n ?? "";
|
|
60
|
+
}, re = (e, t = 0) => !e || !e.length ? t : e.every(
|
|
61
|
+
(s) => s.headerName === ""
|
|
62
|
+
) ? t - 1 : Math.max(
|
|
63
|
+
...e.map((s) => s.children && s.children.length ? re(s.children, t + 1) : t),
|
|
64
|
+
t
|
|
65
|
+
), Ee = (e, t) => {
|
|
66
|
+
if (!Array.isArray(e) || t < 0) return [];
|
|
67
|
+
if (t === 0) {
|
|
68
|
+
const c = /* @__PURE__ */ new Set(), r = [];
|
|
69
|
+
for (const f of e) {
|
|
70
|
+
const l = f.path;
|
|
71
|
+
if (!(l != null && l.length) || !l[0]) continue;
|
|
72
|
+
Z(f) === l[0] ? r.push(`null-${l[0]}`) : c.has(l[0]) || (c.add(l[0]), r.push(l[0]));
|
|
73
|
+
}
|
|
74
|
+
return r;
|
|
75
|
+
}
|
|
76
|
+
const n = /* @__PURE__ */ Object.create(null), s = /* @__PURE__ */ new Map(), a = [], i = [];
|
|
77
|
+
let o;
|
|
78
|
+
for (const c of e) {
|
|
79
|
+
const r = c.path;
|
|
80
|
+
if (!(r != null && r.length) || !r[0]) continue;
|
|
81
|
+
const f = r[0];
|
|
82
|
+
n[f] || (n[f] = [], a.push(f)), n[f].push(r);
|
|
83
|
+
const l = Z(c);
|
|
84
|
+
l && s.set(r, l);
|
|
85
|
+
}
|
|
86
|
+
for (let c = 0; c < a.length; c++) {
|
|
87
|
+
const r = n[a[c]];
|
|
88
|
+
if (r.length > 1 && r.some((l) => l.length > 1))
|
|
89
|
+
for (const l of r) {
|
|
90
|
+
const p = s.get(l);
|
|
91
|
+
if (l.length > t) {
|
|
92
|
+
const d = l[t];
|
|
93
|
+
if (p === l[t]) {
|
|
94
|
+
const u = z(
|
|
95
|
+
l,
|
|
96
|
+
t,
|
|
97
|
+
p
|
|
98
|
+
);
|
|
99
|
+
i.push(`null-${u}`), o = `null-${p}`;
|
|
100
|
+
} else if (d !== o) {
|
|
101
|
+
const u = z(
|
|
102
|
+
l,
|
|
103
|
+
t,
|
|
104
|
+
d
|
|
105
|
+
);
|
|
106
|
+
i.push(u), o = d;
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
const d = z(
|
|
110
|
+
l,
|
|
111
|
+
t,
|
|
112
|
+
p
|
|
113
|
+
), u = d ? `null-${d}` : "null", h = p ? `null-${p}` : "null";
|
|
114
|
+
i.push(u), o = h;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
const l = r[0], p = s.get(l), d = z(
|
|
119
|
+
l,
|
|
120
|
+
t,
|
|
121
|
+
p
|
|
122
|
+
);
|
|
123
|
+
if (l.length > t) {
|
|
124
|
+
const u = l[t];
|
|
125
|
+
if (p === l[t])
|
|
126
|
+
i.push(`null-${d}`);
|
|
127
|
+
else if (u !== i[i.length - 1]) {
|
|
128
|
+
const h = z(
|
|
129
|
+
l,
|
|
130
|
+
t,
|
|
131
|
+
u
|
|
132
|
+
);
|
|
133
|
+
i.push(h);
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
const u = d ? `null-${d}` : "null";
|
|
137
|
+
i.push(u);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return i;
|
|
142
|
+
}, ye = (e) => {
|
|
143
|
+
const t = {}, n = (s) => {
|
|
144
|
+
Array.isArray(s) && s.forEach((a) => {
|
|
145
|
+
var f;
|
|
146
|
+
if (typeof a != "object" || a === null) return;
|
|
147
|
+
const i = Z(a), o = z(
|
|
148
|
+
a.path || [],
|
|
149
|
+
(((f = a.path) == null ? void 0 : f.length) || 1) - 1,
|
|
150
|
+
i
|
|
151
|
+
), c = a.value ? `[${a.value}]` : "", r = o ? `${o}${c}`.toLowerCase() : "";
|
|
152
|
+
r && (t[r] = a), o && !t[o.toLowerCase()] && (t[o.toLowerCase()] = a), Array.isArray(a.children) && n(a.children);
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
return n(e), t;
|
|
156
|
+
}, tt = (e) => {
|
|
157
|
+
const t = {}, n = (s) => {
|
|
158
|
+
Array.isArray(s) && s.forEach((a) => {
|
|
159
|
+
if (!(typeof a != "object" || a === null))
|
|
160
|
+
if (!Array.isArray(a.children) || a.children.length === 0) {
|
|
161
|
+
const i = Z(a);
|
|
162
|
+
i && (t[i.toLowerCase()] = a);
|
|
163
|
+
} else
|
|
164
|
+
n(a.children);
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
return n(e), t;
|
|
168
|
+
}, oe = (e, t, n = 0, s = null, a = 150, i = [], o = [], c = !1, r = null) => !e || !Array.isArray(e) ? {} : { processedColumns: e.map((l) => {
|
|
169
|
+
var j;
|
|
170
|
+
const p = l.autoHeight === !0 || c, d = Z(l), u = l.value ? `${d}[${l.value}]` : d, h = [...o, u], g = l.children && l.children.length > 0, w = l.children && l.children.some((B) => B.columnGroupShow !== "open") || !1, v = ((j = l.children) == null ? void 0 : j.length) && !w, C = t.isAllGroupExpanded || t[d] === !0 || i.includes(d) || v || !1, N = s ? t[s] === !0 || t.isAllGroupExpanded || i.includes(s) || v : !0, S = l.columnGroupShow === "open" && !N || !s && W(l);
|
|
171
|
+
C && N && t[d] !== !0 && !i.includes(d) && v && i.push(d);
|
|
172
|
+
const _ = g ? oe(
|
|
173
|
+
l.children || [],
|
|
174
|
+
t,
|
|
175
|
+
n + 1,
|
|
176
|
+
u,
|
|
177
|
+
// Use pathIdentifier (includes value) for unique parent field
|
|
178
|
+
a,
|
|
179
|
+
i,
|
|
180
|
+
h,
|
|
181
|
+
// Pass current path to children
|
|
182
|
+
p,
|
|
183
|
+
// Pass down autoHeight to children
|
|
184
|
+
r
|
|
185
|
+
// Pass down column counts
|
|
186
|
+
) : {}, H = g ? _.processedColumns.reduce(
|
|
187
|
+
(B, Y) => B + (Y.colSpan || 1),
|
|
188
|
+
0
|
|
189
|
+
) : 1, A = s !== null, R = A ? !1 : S, V = Object.prototype.hasOwnProperty.call(
|
|
190
|
+
l,
|
|
191
|
+
"headerName"
|
|
192
|
+
), $ = !g, x = {
|
|
193
|
+
...l,
|
|
194
|
+
level: n,
|
|
195
|
+
parentField: s,
|
|
196
|
+
// Store the unique path identifier for this column (includes value for pivot columns)
|
|
197
|
+
pathIdentifier: u,
|
|
198
|
+
path: h,
|
|
199
|
+
// Track column's position in the hierarchy
|
|
200
|
+
notApplyGrouping: v,
|
|
201
|
+
headerName: l.headerName || l.label || (V ? "" : Z(l)),
|
|
202
|
+
hasChildren: g,
|
|
203
|
+
isExpanded: C,
|
|
204
|
+
hidden: R,
|
|
205
|
+
is_hidden: S,
|
|
206
|
+
belongsToColumnGroup: A,
|
|
207
|
+
children: _.processedColumns || [],
|
|
208
|
+
colSpan: H,
|
|
209
|
+
field: l.field || Z(l),
|
|
210
|
+
is_frozen: l.is_frozen || l.pinned === "left" || l.pinned === "right",
|
|
211
|
+
pinned: l.pinned ? l.pinned : l.is_frozen ? "left" : null,
|
|
212
|
+
// rowSpan: 1, // Will be adjusted during header rendering
|
|
213
|
+
isLeaf: $,
|
|
214
|
+
autoHeight: p,
|
|
215
|
+
// Explicitly set autoHeight based on parent or own value
|
|
216
|
+
isSearchable: l.isSearchable || l.is_searchable
|
|
217
|
+
};
|
|
218
|
+
return r && $ && !S && (x.is_frozen && x.pinned !== "right" || x.pinned === "left" ? r.left++ : x.is_frozen && x.pinned === "right" ? r.right++ : r.normal++), x;
|
|
219
|
+
}), initialGroupedColumns: i };
|
|
220
|
+
let ae = 0;
|
|
221
|
+
const Ne = (e, {
|
|
222
|
+
pinnedType: t,
|
|
223
|
+
minWidth: n = 150
|
|
224
|
+
} = {}) => {
|
|
225
|
+
if (!e || !Array.isArray(e))
|
|
226
|
+
return { headerRows: [], leafColumns: [] };
|
|
227
|
+
ae = 0;
|
|
228
|
+
const s = (p) => W(p) ? !1 : t === "leftPinnedOnly" ? Q(p) : t === "rightPinnedOnly" ? ee(p) : t === "normal" ? !Q(p) && !ee(p) : !0, a = re(e), i = Array(a + 1).fill(null).map(() => []), o = [];
|
|
229
|
+
ce(
|
|
230
|
+
e,
|
|
231
|
+
i,
|
|
232
|
+
o,
|
|
233
|
+
/* @__PURE__ */ new Set(),
|
|
234
|
+
a,
|
|
235
|
+
s
|
|
236
|
+
), Math.max(...i.map((p) => p.length));
|
|
237
|
+
const r = [];
|
|
238
|
+
i.forEach((p, d) => {
|
|
239
|
+
if (d !== i.length - 1) {
|
|
240
|
+
const u = Ee(
|
|
241
|
+
i[i.length - 1],
|
|
242
|
+
d
|
|
243
|
+
);
|
|
244
|
+
r[d] = u;
|
|
245
|
+
} else
|
|
246
|
+
r[d] = p;
|
|
247
|
+
});
|
|
248
|
+
const f = ye(e), l = r.map(
|
|
249
|
+
(p, d) => d === i.length - 1 ? p : p.map(
|
|
250
|
+
(u, h) => {
|
|
251
|
+
var g;
|
|
252
|
+
if (u.startsWith("null")) {
|
|
253
|
+
const w = (g = u.split("-")[1]) == null ? void 0 : g.toLowerCase(), v = f[w], C = (v == null ? void 0 : v.width) || n, N = (v == null ? void 0 : v.is_hidden) || !1;
|
|
254
|
+
return {
|
|
255
|
+
headerName: "",
|
|
256
|
+
isPlaceholder: !0,
|
|
257
|
+
isLastInGroup: !1,
|
|
258
|
+
depth: d,
|
|
259
|
+
colSpan: 1,
|
|
260
|
+
rowSpan: 1,
|
|
261
|
+
isLeaf: !1,
|
|
262
|
+
isStandalone: !1,
|
|
263
|
+
field: `empty_${d}_${h}`,
|
|
264
|
+
id: `empty_${d}_${h}`,
|
|
265
|
+
accessor: `empty_${d}_${h}`,
|
|
266
|
+
width: C,
|
|
267
|
+
is_hidden: N,
|
|
268
|
+
emptyCell: !0,
|
|
269
|
+
is_frozen: t === "leftPinnedOnly" || t === "rightPinnedOnly",
|
|
270
|
+
pinned: t === "leftPinnedOnly" ? "left" : t === "rightPinnedOnly" ? "right" : null,
|
|
271
|
+
children: [],
|
|
272
|
+
childColumn: v
|
|
273
|
+
};
|
|
274
|
+
} else
|
|
275
|
+
return f[u.toLowerCase()];
|
|
276
|
+
}
|
|
277
|
+
)
|
|
278
|
+
);
|
|
279
|
+
return l.forEach((p) => {
|
|
280
|
+
let d = 0, u = 0;
|
|
281
|
+
p.forEach((h) => {
|
|
282
|
+
const g = $e(h, h.hasChildren, n);
|
|
283
|
+
h.width = g, d += h.isWithEmptyHeaderName ? 0 : g || 0, u += h.isParentWithChildEmptyHeaderName ? g : 0, h.isWithEmptyHeaderName ? (h.leftTotalWidth = d + g - u, u -= g) : h.leftTotalWidth = d;
|
|
284
|
+
});
|
|
285
|
+
}), {
|
|
286
|
+
headerRows: l,
|
|
287
|
+
leafColumns: o
|
|
288
|
+
};
|
|
289
|
+
}, ce = (e, t, n, s, a, i, o = 0, c = [], r = !1) => {
|
|
290
|
+
!e || !Array.isArray(e) || e.length === 0 || e.forEach((f) => {
|
|
291
|
+
var S, _;
|
|
292
|
+
const l = f.field || Z(f), p = Ce(f, !0), d = f.value ? `[${f.value}]` : "", u = (p == null ? void 0 : p.length) > 1 ? `${p.slice(0, p.length - 1).join("/")}/${l}${d}` : `${l}${d}`;
|
|
293
|
+
if (!i(f) || s.has(u))
|
|
294
|
+
return;
|
|
295
|
+
s.add(u);
|
|
296
|
+
const h = f.children && f.children.some((H) => i(H)), g = h && ((_ = (S = f.children) == null ? void 0 : S.every) == null ? void 0 : _.call(
|
|
297
|
+
S,
|
|
298
|
+
(H) => !H.headerName && !H.columnGroupShow
|
|
299
|
+
)), w = !h || g, v = w ? a : o;
|
|
300
|
+
w || ae++;
|
|
301
|
+
const C = w ? null : ae % 2 === 0 ? "even-column-group" : "odd-column-group";
|
|
302
|
+
f.colorClass = C || "";
|
|
303
|
+
const N = {
|
|
304
|
+
...f,
|
|
305
|
+
isLastInGroup: !1,
|
|
306
|
+
// Will be set later
|
|
307
|
+
depth: o,
|
|
308
|
+
isLeaf: w,
|
|
309
|
+
field: l,
|
|
310
|
+
isStandalone: w || r,
|
|
311
|
+
isParentWithChildEmptyHeaderName: g
|
|
312
|
+
};
|
|
313
|
+
t[v].push(N), g && f.children && (f.children.forEach((H) => {
|
|
314
|
+
H.isLeaf = !0, H.isStandalone = !0, H.isWithEmptyHeaderName = !0;
|
|
315
|
+
}), t[v].push(...f.children)), w && (n.push(N), g && n.push(...f.children || [])), h && !g && h && ce(
|
|
316
|
+
f.children || [],
|
|
317
|
+
t,
|
|
318
|
+
n,
|
|
319
|
+
s,
|
|
320
|
+
a,
|
|
321
|
+
i,
|
|
322
|
+
o + 1,
|
|
323
|
+
[...c, l],
|
|
324
|
+
!1
|
|
325
|
+
);
|
|
326
|
+
});
|
|
327
|
+
}, nt = (e, t, n = {}, s) => {
|
|
328
|
+
const a = { left: 0, normal: 0, right: 0 }, {
|
|
329
|
+
processedColumns: i
|
|
330
|
+
// initialGroupedColumns
|
|
331
|
+
} = oe(
|
|
332
|
+
e,
|
|
333
|
+
n,
|
|
334
|
+
0,
|
|
335
|
+
null,
|
|
336
|
+
s,
|
|
337
|
+
[],
|
|
338
|
+
[],
|
|
339
|
+
!1,
|
|
340
|
+
a
|
|
341
|
+
), { headerRows: o, leafColumns: c } = Ne(i, {
|
|
342
|
+
pinnedType: t,
|
|
343
|
+
minWidth: s
|
|
344
|
+
});
|
|
345
|
+
return {
|
|
346
|
+
secondRowColumns: c,
|
|
347
|
+
// parentColumns: allParentColumns,
|
|
348
|
+
// expandableParentColumns,
|
|
349
|
+
headerRows: o,
|
|
350
|
+
// New: Include the full header hierarchy
|
|
351
|
+
// leafColumns, // New: All leaf nodes (columns with data)
|
|
352
|
+
// initialGroupedColumns,
|
|
353
|
+
globalColumnCounts: a
|
|
354
|
+
};
|
|
355
|
+
}, it = (e, t) => {
|
|
356
|
+
const n = (s) => s.reduce((a, i) => {
|
|
357
|
+
if (W(i)) return a + 0;
|
|
358
|
+
if (i.children && i.children.length > 0)
|
|
359
|
+
return a + n(i.children);
|
|
360
|
+
const o = i.width || t;
|
|
361
|
+
return a + (o < t ? t : o);
|
|
362
|
+
}, 0);
|
|
363
|
+
return n(e);
|
|
364
|
+
}, Q = (e) => e.pinned === "right" ? !1 : e.is_frozen || e.pinned === "left", ee = (e) => e.pinned === "right";
|
|
365
|
+
function at(e, t = {}) {
|
|
366
|
+
if (t && typeof t == "object") {
|
|
367
|
+
const {
|
|
368
|
+
leftPinned: n = !1,
|
|
369
|
+
rightPinned: s = !1,
|
|
370
|
+
includeHidden: a = !1
|
|
371
|
+
} = t;
|
|
372
|
+
return s ? e.filter(
|
|
373
|
+
(i) => ee(i) && (a || !W(i))
|
|
374
|
+
) : n ? e.filter(
|
|
375
|
+
(i) => Q(i) && (a || !W(i))
|
|
376
|
+
) : e.filter(
|
|
377
|
+
(i) => !Q(i) && !ee(i) && (a || !W(i))
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
return e;
|
|
381
|
+
}
|
|
382
|
+
const $e = (e, t, n = 150) => {
|
|
383
|
+
const s = (a) => a.children && a.children.length > 0 ? W(a) ? 0 : a.children.reduce(
|
|
384
|
+
(i, o) => i + s(o),
|
|
385
|
+
0
|
|
386
|
+
) : W(a) ? 0 : a.width && a.width < n ? n : a.width || n;
|
|
387
|
+
return t && e.children && e.children.length > 0 ? W(e) ? 0 : e.children.reduce(
|
|
388
|
+
(a, i) => a + s(i),
|
|
389
|
+
0
|
|
390
|
+
) : W(e) ? 0 : e.width && e.width < n ? n : e.width || n;
|
|
391
|
+
}, lt = (e, t, n, s, a, i) => {
|
|
392
|
+
var r;
|
|
393
|
+
const o = [];
|
|
394
|
+
let c = 0;
|
|
395
|
+
for (let f = 0; f < e.length; f++) {
|
|
396
|
+
o[f] = c;
|
|
397
|
+
const l = e[f];
|
|
398
|
+
if (l.__parentId !== void 0) continue;
|
|
399
|
+
const p = l.id || l[t] || f;
|
|
400
|
+
if (a && ((r = s == null ? void 0 : s.expandedRows) != null && r.includes(p))) {
|
|
401
|
+
const u = s.detailRowHeight || 200;
|
|
402
|
+
c += u;
|
|
403
|
+
}
|
|
404
|
+
const d = l[t] || "";
|
|
405
|
+
i[f] !== void 0 ? c += i[f] - n : i[d] && (c += i[d] - n);
|
|
406
|
+
}
|
|
407
|
+
return o;
|
|
408
|
+
}, st = (e, t, n, s, a, i, o, c, r, f) => {
|
|
409
|
+
let l = 0;
|
|
410
|
+
const p = Object.keys(r) || [];
|
|
411
|
+
if (r && p.length > 0) {
|
|
412
|
+
let d = 0;
|
|
413
|
+
p.forEach((u) => {
|
|
414
|
+
const h = String(u);
|
|
415
|
+
if (h.includes("/") && s.includes(h))
|
|
416
|
+
l += r[h];
|
|
417
|
+
else if (h.includes("/")) {
|
|
418
|
+
const g = h.split("/"), w = g.slice(0, g.length - 1).join("/");
|
|
419
|
+
s.includes(w) ? l += r[h] : d += 1;
|
|
420
|
+
} else
|
|
421
|
+
l += r[h];
|
|
422
|
+
}), l += (e.length - p.length + d) * t;
|
|
423
|
+
} else
|
|
424
|
+
l += e.length * t;
|
|
425
|
+
return n && (a != null && a.expandedRows) && a.expandedRows.length > 0 && e.forEach((d) => {
|
|
426
|
+
var h;
|
|
427
|
+
const u = d.id || d[i];
|
|
428
|
+
(h = a == null ? void 0 : a.expandedRows) != null && h.includes(u) && (l += (a == null ? void 0 : a.detailRowHeight) || 200);
|
|
429
|
+
}), o && (l += le * t), c.length && f && (l += le * t), l;
|
|
430
|
+
}, rt = (e, t, n) => {
|
|
431
|
+
var c;
|
|
432
|
+
const s = ((c = t.path) == null ? void 0 : c.length) || 0, a = n.length - (e - s + 2), i = n.slice(
|
|
433
|
+
a
|
|
434
|
+
);
|
|
435
|
+
return i.reduce((r, f) => r + f, 0) + 19 * i.length;
|
|
436
|
+
}, ot = (e, t, n = 40) => {
|
|
437
|
+
const a = [
|
|
438
|
+
e[`left_pinned_${t}`],
|
|
439
|
+
e[`normal_${t}`],
|
|
440
|
+
e[`right_pinned_${t}`]
|
|
441
|
+
].filter((i) => i);
|
|
442
|
+
return a.length === 0 ? { maxHeight: n, maxLineCount: 1 } : a.reduce((i, o) => !i || o.maxHeight > i.maxHeight ? o : i, a[0]);
|
|
443
|
+
}, ct = (e, t, n, s, a) => e ? `${(t.leftTotalWidth || 0) - n + we(
|
|
444
|
+
e,
|
|
445
|
+
a,
|
|
446
|
+
s
|
|
447
|
+
)}px` : `${(t.leftTotalWidth || 0) - n}px`, xe = (e, t, n) => (e.is_frozen = t, e.pinned = n, e.children && Array.isArray(e.children) && e.children.length > 0 && e.children.forEach((s) => {
|
|
448
|
+
xe(s, t, n);
|
|
449
|
+
}), e), ie = ({
|
|
450
|
+
onClick: e,
|
|
451
|
+
children: t,
|
|
452
|
+
variant: n = "primary",
|
|
453
|
+
size: s = "large",
|
|
454
|
+
iconButton: a = !1,
|
|
455
|
+
className: i = "",
|
|
456
|
+
disabled: o = !1,
|
|
457
|
+
leftIcon: c = null,
|
|
458
|
+
rightIcon: r = null,
|
|
459
|
+
buttonRef: f = null,
|
|
460
|
+
simpleButton: l = !1,
|
|
461
|
+
...p
|
|
462
|
+
}) => /* @__PURE__ */ I(
|
|
463
|
+
"button",
|
|
464
|
+
{
|
|
465
|
+
ref: f,
|
|
466
|
+
onClick: (d) => {
|
|
467
|
+
o || e(d);
|
|
468
|
+
},
|
|
469
|
+
className: `ia-table-btn cursor-pointer d-flex align-items-center justify-content-center ia-table-btn-${n} ia-table-btn-${s} ${a ? "ia-table-btn-icon" : ""} ${i} ${o ? "ia-table-btn-disabled pointer-events-none" : ""} gap-4 ${l ? "ia-table-btn-simple" : ""}`,
|
|
470
|
+
...p,
|
|
471
|
+
children: [
|
|
472
|
+
c && c,
|
|
473
|
+
a ? t : /* @__PURE__ */ m("div", { className: "ia-table-btn-text", children: t }),
|
|
474
|
+
r && r
|
|
475
|
+
]
|
|
476
|
+
}
|
|
477
|
+
);
|
|
478
|
+
class Le {
|
|
479
|
+
constructor() {
|
|
480
|
+
this.tooltipElement = null, this.currentConfig = null, this.hideTimeout = null;
|
|
481
|
+
}
|
|
482
|
+
initialize() {
|
|
483
|
+
this.tooltipElement || (this.tooltipElement = document.createElement("div"), this.tooltipElement.className = "tooltip d-flex align-items-center justify-content-center", this.tooltipElement.style.position = "absolute", this.tooltipElement.style.top = "0", this.tooltipElement.style.left = "0", document.body.appendChild(this.tooltipElement));
|
|
484
|
+
}
|
|
485
|
+
show(t) {
|
|
486
|
+
this.initialize(), this.currentConfig = t, this.hideTimeout && (clearTimeout(this.hideTimeout), this.hideTimeout = null), this.updateContent(t), requestAnimationFrame(() => {
|
|
487
|
+
var n;
|
|
488
|
+
this.calculatePosition(t), (n = this.tooltipElement) == null || n.classList.add("tooltip-visible");
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
hide() {
|
|
492
|
+
this.tooltipElement && (this.tooltipElement.classList.remove("tooltip-visible"), this.currentConfig = null, setTimeout(() => {
|
|
493
|
+
this.tooltipElement && !this.currentConfig && (this.tooltipElement.innerHTML = "");
|
|
494
|
+
}, 200));
|
|
495
|
+
}
|
|
496
|
+
updateContent(t) {
|
|
497
|
+
const {
|
|
498
|
+
title: n,
|
|
499
|
+
varient: s,
|
|
500
|
+
illustration: a,
|
|
501
|
+
icon: i,
|
|
502
|
+
bodyText: o,
|
|
503
|
+
btns: c,
|
|
504
|
+
showPaginationAbove: r,
|
|
505
|
+
pagination: f
|
|
506
|
+
} = t;
|
|
507
|
+
if (!this.tooltipElement) return;
|
|
508
|
+
this.tooltipElement.className = `tooltip tooltip--${s || "primary"}`;
|
|
509
|
+
let l = "";
|
|
510
|
+
f && r && (l += this.getPaginationHTML(s)), a || (i && (l += `<div class="tooltip-icon">${i}</div>`), n && (l += `<div class="tooltip-title">${n}</div>`)), (o || c || a || f) && (l += `<button class="tooltip-close d-flex align-items-center justify-content-center" aria-label="Close tooltip">
|
|
511
|
+
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
512
|
+
<path d="M8 7.293l3.646-3.647a.5.5 0 01.708.708L8.707 8l3.647 3.646a.5.5 0 01-.708.708L8 8.707l-3.646 3.647a.5.5 0 01-.708-.708L7.293 8 3.646 4.354a.5.5 0 01.708-.708L8 7.293z"/>
|
|
513
|
+
</svg>
|
|
514
|
+
</button>`), a && (l += `<div class="tooltip-illustration"><img src="${a}" alt="Illustration" /></div>`), a && (l += '<div class="tooltip-header d-flex align-items-center">', i && (l += `<div class="tooltip-icon">${i}</div>`), n && (l += `<div class="tooltip-title">${n}</div>`), l += "</div>"), f && !r && (l += this.getPaginationHTML(s)), c && (l += '<div class="tooltip-btns d-flex">', c.forEach((d) => {
|
|
515
|
+
let u = d.type;
|
|
516
|
+
d.type !== "default" && (s === "primary" || s === "tertiary" ? u = "secondary" : s === "secondary" && (u = "primary")), l += `<button class="${u === "default" ? "btn-no-bg" : `tooltip-btn btn--${u}`}">${d.label}</button>`;
|
|
517
|
+
}), l += "</div>"), l += "</div></div>", l += '<div class="tooltip-arrow"></div>', this.tooltipElement.innerHTML = l;
|
|
518
|
+
const p = this.tooltipElement.querySelector(
|
|
519
|
+
".tooltip-close"
|
|
520
|
+
);
|
|
521
|
+
p && (p.onclick = () => this.hide());
|
|
522
|
+
}
|
|
523
|
+
getPaginationHTML(t) {
|
|
524
|
+
return `<div class="tooltip-pagination d-flex align-items-center">
|
|
525
|
+
<div class="tooltip-pagination-bar ${t === "secondary" ? "secondary-variant" : ""}"></div>
|
|
526
|
+
<div class="tooltip-pagination-bar ${t === "secondary" ? "secondary-variant" : ""}"></div>
|
|
527
|
+
<div class="tooltip-pagination-bar ${t === "secondary" ? "secondary-variant" : ""}"></div>
|
|
528
|
+
<div class="tooltip-pagination-bar ${t === "secondary" ? "secondary-variant" : ""}"></div>
|
|
529
|
+
</div>`;
|
|
530
|
+
}
|
|
531
|
+
calculatePosition(t) {
|
|
532
|
+
const { targetRef: n, orientation: s = "top", varient: a } = t;
|
|
533
|
+
if (!(n != null && n.current) || !this.tooltipElement) return;
|
|
534
|
+
const i = n.current.getBoundingClientRect(), o = this.tooltipElement.getBoundingClientRect(), c = 8, r = 16, f = {
|
|
535
|
+
top: i.top - r,
|
|
536
|
+
bottom: window.innerHeight - i.bottom - r,
|
|
537
|
+
left: i.left - r,
|
|
538
|
+
right: window.innerWidth - i.right - r
|
|
539
|
+
}, l = s === "top" ? f.top > o.height : s === "bottom" ? f.bottom > o.height : s === "left" ? f.left > o.width : f.right > o.width, p = Object.entries(f).sort(
|
|
540
|
+
(w, v) => v[1] - w[1]
|
|
541
|
+
)[0][0], d = l ? s : p;
|
|
542
|
+
let u = 0, h = 0;
|
|
543
|
+
switch (d) {
|
|
544
|
+
case "top":
|
|
545
|
+
u = i.top - o.height - c, h = i.left + i.width / 2 - o.width / 2;
|
|
546
|
+
break;
|
|
547
|
+
case "bottom":
|
|
548
|
+
u = i.bottom + c, h = i.left + i.width / 2 - o.width / 2;
|
|
549
|
+
break;
|
|
550
|
+
case "left":
|
|
551
|
+
u = i.top + i.height / 2 - o.height / 2, h = i.left - o.width - c;
|
|
552
|
+
break;
|
|
553
|
+
case "right":
|
|
554
|
+
u = i.top + i.height / 2 - o.height / 2, h = i.right + c;
|
|
555
|
+
break;
|
|
556
|
+
default:
|
|
557
|
+
u = i.top - o.height - c, h = i.left + i.width / 2 - o.width / 2;
|
|
558
|
+
}
|
|
559
|
+
h = Math.max(
|
|
560
|
+
r,
|
|
561
|
+
Math.min(h, window.innerWidth - o.width - r)
|
|
562
|
+
), u = Math.max(
|
|
563
|
+
r,
|
|
564
|
+
Math.min(u, window.innerHeight - o.height - r)
|
|
565
|
+
), this.tooltipElement.style.top = `${u + window.scrollY}px`, this.tooltipElement.style.left = `${h + window.scrollX}px`, this.tooltipElement.className = `tooltip tooltip--${a || "primary"} tooltip--${d}`;
|
|
566
|
+
const g = this.tooltipElement.querySelector(
|
|
567
|
+
".tooltip-arrow"
|
|
568
|
+
);
|
|
569
|
+
if (g)
|
|
570
|
+
if (d === "top" || d === "bottom") {
|
|
571
|
+
let v = (i.left + i.width / 2 - h) / o.width * 100;
|
|
572
|
+
v = Math.max(10, Math.min(90, v)), g.style.left = `${v}%`, g.style.top = "";
|
|
573
|
+
} else {
|
|
574
|
+
let v = (i.top + i.height / 2 - u) / o.height * 100;
|
|
575
|
+
v = Math.max(10, Math.min(90, v)), g.style.top = `${v}%`, g.style.left = "";
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
cleanup() {
|
|
579
|
+
this.tooltipElement && this.tooltipElement.parentNode && (this.tooltipElement.parentNode.removeChild(this.tooltipElement), this.tooltipElement = null);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
const J = new Le(), dt = ({
|
|
583
|
+
title: e,
|
|
584
|
+
varient: t,
|
|
585
|
+
orientation: n,
|
|
586
|
+
children: s,
|
|
587
|
+
targetRef: a,
|
|
588
|
+
illustration: i = "",
|
|
589
|
+
icon: o = null,
|
|
590
|
+
bodyText: c = "",
|
|
591
|
+
btns: r = null,
|
|
592
|
+
showPaginationAbove: f = null,
|
|
593
|
+
pagination: l = null,
|
|
594
|
+
justifyBodyContent: p = null,
|
|
595
|
+
forceShowTooltip: d = !1,
|
|
596
|
+
className: u = "ia-table-width-inherit"
|
|
597
|
+
}) => {
|
|
598
|
+
const h = G({
|
|
599
|
+
title: e,
|
|
600
|
+
varient: t,
|
|
601
|
+
orientation: n,
|
|
602
|
+
targetRef: a,
|
|
603
|
+
illustration: i,
|
|
604
|
+
icon: o,
|
|
605
|
+
bodyText: c,
|
|
606
|
+
btns: r,
|
|
607
|
+
showPaginationAbove: f,
|
|
608
|
+
pagination: l,
|
|
609
|
+
justifyBodyContent: p
|
|
610
|
+
});
|
|
611
|
+
h.current = {
|
|
612
|
+
title: e,
|
|
613
|
+
varient: t,
|
|
614
|
+
orientation: n,
|
|
615
|
+
targetRef: a,
|
|
616
|
+
illustration: i,
|
|
617
|
+
icon: o,
|
|
618
|
+
bodyText: c,
|
|
619
|
+
btns: r,
|
|
620
|
+
showPaginationAbove: f,
|
|
621
|
+
pagination: l,
|
|
622
|
+
justifyBodyContent: p
|
|
623
|
+
}, F(() => () => {
|
|
624
|
+
J.hide();
|
|
625
|
+
}, []);
|
|
626
|
+
const g = () => {
|
|
627
|
+
if (!(a != null && a.current) || !e)
|
|
628
|
+
return;
|
|
629
|
+
if (d && e) {
|
|
630
|
+
J.show(h.current);
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
const v = a.current, C = v.querySelector("input") || // element.querySelector("div[data-tooltip-title]") ||
|
|
634
|
+
v.querySelector(".text-overflow-ellipsis") || v.querySelector(".ia-table-header-string-title") || v.querySelector("span") || v, N = C.classList.contains("ia-table-line-clamp-2") || C.classList.contains("ia-table-line-clamp-3") || window.getComputedStyle(C).webkitLineClamp !== "none";
|
|
635
|
+
let S = !1;
|
|
636
|
+
if (N) {
|
|
637
|
+
const _ = C.scrollHeight, H = C.clientHeight;
|
|
638
|
+
S = _ > H;
|
|
639
|
+
} else {
|
|
640
|
+
const _ = C.scrollWidth, H = C.clientWidth;
|
|
641
|
+
S = _ > H;
|
|
642
|
+
}
|
|
643
|
+
S && J.show(h.current);
|
|
644
|
+
}, w = () => {
|
|
645
|
+
J.hide();
|
|
646
|
+
};
|
|
647
|
+
return /* @__PURE__ */ m(
|
|
648
|
+
"div",
|
|
649
|
+
{
|
|
650
|
+
ref: a,
|
|
651
|
+
className: `tooltip-container ${u}`,
|
|
652
|
+
onMouseEnter: g,
|
|
653
|
+
onMouseLeave: w,
|
|
654
|
+
onFocus: g,
|
|
655
|
+
onBlur: w,
|
|
656
|
+
children: s
|
|
657
|
+
}
|
|
658
|
+
);
|
|
659
|
+
}, de = (e) => /* @__PURE__ */ L.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ L.createElement("path", { d: "M9.66659 1.27325L8.72659 0.333252L4.99992 4.05992L1.27325 0.333252L0.333252 1.27325L4.05992 4.99992L0.333252 8.72659L1.27325 9.66659L4.99992 5.93992L8.72659 9.66659L9.66659 8.72659L5.93992 4.99992L9.66659 1.27325Z", fill: "currentColor" })), ht = (e) => /* @__PURE__ */ L.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ L.createElement("path", { d: "M9.09808 7.54717H8.52308L8.31929 7.36192C9.03258 6.57976 9.46201 5.56432 9.46201 4.45969C9.46201 1.99657 7.34397 0 4.731 0C2.11803 0 0 1.99657 0 4.45969C0 6.92281 2.11803 8.91938 4.731 8.91938C5.90284 8.91938 6.98005 8.51458 7.80979 7.8422L8.00631 8.0343V8.57633L11.6455 12L12.73 10.9777L9.09808 7.54717ZM4.731 7.54717C2.91866 7.54717 1.45569 6.1681 1.45569 4.45969C1.45569 2.75129 2.91866 1.37221 4.731 1.37221C6.54334 1.37221 8.00631 2.75129 8.00631 4.45969C8.00631 6.1681 6.54334 7.54717 4.731 7.54717Z", fill: "#60697D" })), ft = (e) => /* @__PURE__ */ L.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 8 11", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ L.createElement("path", { d: "M1.99902 8.66675C2.45611 8.66675 2.83283 9.04271 2.83301 9.49976C2.83301 9.95695 2.45621 10.3337 1.99902 10.3337C1.54198 10.3336 1.16602 9.95684 1.16602 9.49976C1.16619 9.04282 1.54209 8.66693 1.99902 8.66675ZM5.99902 8.66675C6.45611 8.66675 6.83283 9.04271 6.83301 9.49976C6.83301 9.95695 6.45621 10.3337 5.99902 10.3337C5.54198 10.3336 5.16602 9.95684 5.16602 9.49976C5.16619 9.04282 5.54209 8.66693 5.99902 8.66675ZM1.99902 4.66675C2.45611 4.66675 2.83283 5.04271 2.83301 5.49976C2.83301 5.95695 2.45621 6.33374 1.99902 6.33374C1.54198 6.33356 1.16602 5.95684 1.16602 5.49976C1.16619 5.04282 1.54209 4.66693 1.99902 4.66675ZM5.99902 4.66675C6.45611 4.66675 6.83283 5.04271 6.83301 5.49976C6.83301 5.95695 6.45621 6.33374 5.99902 6.33374C5.54198 6.33356 5.16602 5.95684 5.16602 5.49976C5.16619 5.04282 5.54209 4.66693 5.99902 4.66675ZM1.99902 0.666748C2.45611 0.666748 2.83283 1.04271 2.83301 1.49976C2.83301 1.95695 2.45621 2.33374 1.99902 2.33374C1.54198 2.33356 1.16602 1.95684 1.16602 1.49976C1.16619 1.04282 1.54209 0.666926 1.99902 0.666748ZM5.99902 0.666748C6.45611 0.666748 6.83283 1.04271 6.83301 1.49976C6.83301 1.95695 6.45621 2.33374 5.99902 2.33374C5.54198 2.33356 5.16602 1.95684 5.16602 1.49976C5.16619 1.04282 5.54209 0.666926 5.99902 0.666748Z", fill: "currentColor", stroke: "currentColor" })), Se = ({
|
|
660
|
+
label: e,
|
|
661
|
+
variant: t = "filled",
|
|
662
|
+
color: n = "default",
|
|
663
|
+
size: s = "default",
|
|
664
|
+
className: a = "",
|
|
665
|
+
onClick: i,
|
|
666
|
+
...o
|
|
667
|
+
}) => {
|
|
668
|
+
if (!e) return null;
|
|
669
|
+
const c = `ia-table-badge align-items-center justify-content-center ia-table-badge-${t} ia-table-badge-${n} ia-table-badge-size-${s} ${a} ${i ? "cursor-pointer" : ""}`;
|
|
670
|
+
return /* @__PURE__ */ m("div", { className: c, onClick: i, ...o, children: /* @__PURE__ */ m("span", { className: "ia-table-badge-label text-overflow-ellipsis", children: e }) });
|
|
671
|
+
}, ut = te(Se), He = ({
|
|
672
|
+
open: e = !1,
|
|
673
|
+
onClose: t,
|
|
674
|
+
title: n,
|
|
675
|
+
children: s,
|
|
676
|
+
size: a = "medium",
|
|
677
|
+
width: i,
|
|
678
|
+
height: o,
|
|
679
|
+
className: c = "",
|
|
680
|
+
onPrimaryButtonClick: r,
|
|
681
|
+
primaryButtonLabel: f = "Confirm",
|
|
682
|
+
onSecondaryButtonClick: l,
|
|
683
|
+
secondaryButtonLabel: p = "Cancel",
|
|
684
|
+
closeOnOutsideClick: d = !0,
|
|
685
|
+
primaryButtonVariant: u = "primary",
|
|
686
|
+
primaryButtonProps: h = {},
|
|
687
|
+
showCloseButton: g = !0,
|
|
688
|
+
showPrimaryButton: w = !0,
|
|
689
|
+
showSecondaryButton: v = !0
|
|
690
|
+
}) => {
|
|
691
|
+
const C = G(null);
|
|
692
|
+
F(() => {
|
|
693
|
+
const R = (V) => {
|
|
694
|
+
V.key === "Escape" && e && t();
|
|
695
|
+
};
|
|
696
|
+
return e && (document.addEventListener("keydown", R), document.body.style.overflow = "hidden"), () => {
|
|
697
|
+
document.removeEventListener("keydown", R), document.body.style.overflow = "";
|
|
698
|
+
};
|
|
699
|
+
}, [e, t]);
|
|
700
|
+
const N = U(
|
|
701
|
+
(R) => {
|
|
702
|
+
d && C.current && !C.current.contains(R.target) && t();
|
|
703
|
+
},
|
|
704
|
+
[d, t]
|
|
705
|
+
);
|
|
706
|
+
if (!e) return null;
|
|
707
|
+
const S = `ia-table-modal-${a}`, _ = {};
|
|
708
|
+
i && (_.width = typeof i == "number" ? `${i}px` : i), o && (_.height = typeof o == "number" ? `${o}px` : o);
|
|
709
|
+
const H = w && f || v && p, A = /* @__PURE__ */ m(
|
|
710
|
+
"div",
|
|
711
|
+
{
|
|
712
|
+
className: "ia-table-modal-overlay d-flex align-items-center justify-content-center",
|
|
713
|
+
onClick: N,
|
|
714
|
+
children: /* @__PURE__ */ I(
|
|
715
|
+
"div",
|
|
716
|
+
{
|
|
717
|
+
className: `ia-table-modal d-flex flex-column ${S} ${c}`,
|
|
718
|
+
style: _,
|
|
719
|
+
ref: C,
|
|
720
|
+
children: [
|
|
721
|
+
/* @__PURE__ */ I("div", { className: "ia-table-modal-header d-flex justify-content-between align-items-center", children: [
|
|
722
|
+
/* @__PURE__ */ m("div", { className: "ia-table-modal-header-content", children: n && /* @__PURE__ */ m("h2", { className: "ia-table-modal-title", children: n }) }),
|
|
723
|
+
g && /* @__PURE__ */ m(
|
|
724
|
+
ie,
|
|
725
|
+
{
|
|
726
|
+
onClick: t,
|
|
727
|
+
"aria-label": "Close",
|
|
728
|
+
variant: "url",
|
|
729
|
+
className: "ia-table-close-button",
|
|
730
|
+
size: "small",
|
|
731
|
+
iconButton: !0,
|
|
732
|
+
children: /* @__PURE__ */ m(de, { className: "ia-table-close-icon" })
|
|
733
|
+
}
|
|
734
|
+
)
|
|
735
|
+
] }),
|
|
736
|
+
/* @__PURE__ */ m("div", { className: "ia-table-modal-content", children: s }),
|
|
737
|
+
H && /* @__PURE__ */ I("div", { className: "ia-table-modal-footer d-flex justify-content-end align-items-center gap-12", children: [
|
|
738
|
+
v && p && /* @__PURE__ */ m(
|
|
739
|
+
ie,
|
|
740
|
+
{
|
|
741
|
+
onClick: l || t,
|
|
742
|
+
variant: "link",
|
|
743
|
+
children: p
|
|
744
|
+
}
|
|
745
|
+
),
|
|
746
|
+
w && f && r && /* @__PURE__ */ m(
|
|
747
|
+
ie,
|
|
748
|
+
{
|
|
749
|
+
onClick: r,
|
|
750
|
+
variant: u,
|
|
751
|
+
...h,
|
|
752
|
+
children: f
|
|
753
|
+
}
|
|
754
|
+
)
|
|
755
|
+
] })
|
|
756
|
+
]
|
|
757
|
+
}
|
|
758
|
+
)
|
|
759
|
+
}
|
|
760
|
+
);
|
|
761
|
+
return se(A, document.body);
|
|
762
|
+
}, pt = te(He), ke = ({
|
|
763
|
+
placeholder: e = "",
|
|
764
|
+
label: t = "",
|
|
765
|
+
value: n = "",
|
|
766
|
+
onChange: s,
|
|
767
|
+
type: a = "text",
|
|
768
|
+
disabled: i = !1,
|
|
769
|
+
error: o = "",
|
|
770
|
+
leftIcon: c = null,
|
|
771
|
+
rightIcon: r = null,
|
|
772
|
+
className: f = "",
|
|
773
|
+
width: l = "100%",
|
|
774
|
+
onClick: p = (C) => C.stopPropagation(),
|
|
775
|
+
isCellRenderer: d = !1,
|
|
776
|
+
inputType: u = "text",
|
|
777
|
+
iconButton: h = null,
|
|
778
|
+
iconButtonClassName: g = "",
|
|
779
|
+
height: w,
|
|
780
|
+
...v
|
|
781
|
+
}) => {
|
|
782
|
+
const C = G(null), N = G(null), S = U(() => {
|
|
783
|
+
var $;
|
|
784
|
+
($ = C.current) == null || $.focus();
|
|
785
|
+
}, []), _ = U(
|
|
786
|
+
($) => {
|
|
787
|
+
if (u === "int" && ($.key === "." || $.keyCode === 190 || $.keyCode === 110))
|
|
788
|
+
return $.preventDefault(), !1;
|
|
789
|
+
},
|
|
790
|
+
[u]
|
|
791
|
+
), H = U(
|
|
792
|
+
($) => {
|
|
793
|
+
const x = $.target.value;
|
|
794
|
+
switch (u) {
|
|
795
|
+
case "int":
|
|
796
|
+
(x === "" || /^-?\d*$/.test(x)) && s($);
|
|
797
|
+
break;
|
|
798
|
+
case "float":
|
|
799
|
+
case "decimal":
|
|
800
|
+
(x === "" || /^-?\d*\.?\d*$/.test(x)) && s($);
|
|
801
|
+
break;
|
|
802
|
+
case "percentage":
|
|
803
|
+
(x === "" || /^\d*\.?\d*%?$/.test(x)) && s($);
|
|
804
|
+
break;
|
|
805
|
+
case "dollar":
|
|
806
|
+
(x === "" || /^\$?\d*\.?\d*$/.test(x)) && s($);
|
|
807
|
+
break;
|
|
808
|
+
case "str":
|
|
809
|
+
default:
|
|
810
|
+
s($);
|
|
811
|
+
break;
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
[s, u]
|
|
815
|
+
), A = u === "str" || u === "text", R = u === "str" || u === "text" ? "left" : "right", V = `ia-table-input-container d-flex align-items-center ${i ? d ? "ia-table-cell-render-input-disabled" : "ia-table-input-disabled" : ""} ${o ? "ia-table-input-error" : ""} ${c ? "has-left-icon" : ""} ${r ? "has-right-icon" : ""} ${h && !A ? "has-left-icon-button" : ""} ${h && A ? "has-right-icon-button" : ""} ${d ? "ia-table-cellrender-input" : ""} ${f}
|
|
816
|
+
`;
|
|
817
|
+
return /* @__PURE__ */ I(
|
|
818
|
+
"div",
|
|
819
|
+
{
|
|
820
|
+
className: `ia-table-inputbox-container d-flex flex-column ${i && d ? "ia-table-cell-render-input-disabled" : ""} `,
|
|
821
|
+
style: { width: l, ...w ? { height: w } : {} },
|
|
822
|
+
children: [
|
|
823
|
+
t && /* @__PURE__ */ m("label", { className: "ia-table-input-label", children: t }),
|
|
824
|
+
/* @__PURE__ */ I(
|
|
825
|
+
"div",
|
|
826
|
+
{
|
|
827
|
+
className: V,
|
|
828
|
+
onClick: S,
|
|
829
|
+
onMouseEnter: () => {
|
|
830
|
+
N.current && N.current.classList.add("visible");
|
|
831
|
+
},
|
|
832
|
+
onMouseLeave: () => {
|
|
833
|
+
N.current && N.current.classList.remove("visible");
|
|
834
|
+
},
|
|
835
|
+
children: [
|
|
836
|
+
c && /* @__PURE__ */ m("div", { className: "left-input-icon d-flex align-items-center justify-content-center", children: c }),
|
|
837
|
+
h && !A && /* @__PURE__ */ m(
|
|
838
|
+
"div",
|
|
839
|
+
{
|
|
840
|
+
ref: N,
|
|
841
|
+
className: `left-input-icon-button d-flex align-items-center justify-content-center ${g}`,
|
|
842
|
+
children: h
|
|
843
|
+
}
|
|
844
|
+
),
|
|
845
|
+
/* @__PURE__ */ m("div", { className: "ia-table-input-wrapper", children: /* @__PURE__ */ m(
|
|
846
|
+
"input",
|
|
847
|
+
{
|
|
848
|
+
ref: C,
|
|
849
|
+
type: a,
|
|
850
|
+
value: n,
|
|
851
|
+
onChange: H,
|
|
852
|
+
onClick: p,
|
|
853
|
+
onKeyDown: _,
|
|
854
|
+
placeholder: e,
|
|
855
|
+
disabled: i,
|
|
856
|
+
className: "ia-table-input",
|
|
857
|
+
style: { textAlign: R },
|
|
858
|
+
...v
|
|
859
|
+
}
|
|
860
|
+
) }),
|
|
861
|
+
r && /* @__PURE__ */ m("div", { className: "right-input-icon d-flex align-items-center justify-content-center", children: r }),
|
|
862
|
+
h && A && /* @__PURE__ */ m(
|
|
863
|
+
"div",
|
|
864
|
+
{
|
|
865
|
+
className: `right-input-icon-button d-flex align-items-center justify-content-center ${g}`,
|
|
866
|
+
children: h
|
|
867
|
+
}
|
|
868
|
+
)
|
|
869
|
+
]
|
|
870
|
+
}
|
|
871
|
+
),
|
|
872
|
+
o && /* @__PURE__ */ m("div", { className: "ia-table-input-error-message", children: o })
|
|
873
|
+
]
|
|
874
|
+
}
|
|
875
|
+
);
|
|
876
|
+
}, gt = te(ke), Pe = (e) => /* @__PURE__ */ L.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ L.createElement("path", { d: "M7.15604 14.8024C7.0149 14.6706 6.94434 14.5146 6.94434 14.3344C6.94434 14.1545 7.0149 13.9987 7.15604 13.8669L11.2913 10.0066L7.14192 6.13307C7.0102 6.0101 6.94434 5.85639 6.94434 5.67194C6.94434 5.48748 7.0149 5.32938 7.15604 5.19763C7.29717 5.06588 7.46427 5 7.65735 5C7.85004 5 8.01696 5.06588 8.15809 5.19763L12.9002 9.63768C12.9567 9.69038 12.9967 9.74747 13.0204 9.80896C13.0438 9.87044 13.0554 9.93632 13.0554 10.0066C13.0554 10.0769 13.0438 10.1427 13.0204 10.2042C12.9967 10.2657 12.9567 10.3228 12.9002 10.3755L8.14398 14.8155C8.01225 14.9385 7.85004 15 7.65735 15C7.46427 15 7.29717 14.9341 7.15604 14.8024Z", fill: "#60697D" })), he = (e) => /* @__PURE__ */ L.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ L.createElement("path", { d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z", fill: "#ECEEFD" }), /* @__PURE__ */ L.createElement("path", { d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z", stroke: "#4259EE" }), /* @__PURE__ */ L.createElement("path", { d: "M11.4375 5.4375L6.75 10.125L4.5625 7.9375", stroke: "#4259EE", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" })), fe = (e) => /* @__PURE__ */ L.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ L.createElement("path", { d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z", fill: "white" }), /* @__PURE__ */ L.createElement("path", { d: "M4 0.5H12C13.933 0.5 15.5 2.067 15.5 4V12C15.5 13.933 13.933 15.5 12 15.5H4C2.067 15.5 0.5 13.933 0.5 12V4C0.5 2.067 2.067 0.5 4 0.5Z", stroke: "#C3C8D4" })), _e = (e) => /* @__PURE__ */ L.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ L.createElement("path", { d: "M5.35163 10.7033C3.85592 10.7033 2.59005 10.1852 1.55403 9.14923C0.51801 8.11321 0 6.84734 0 5.35163C0 3.85592 0.51801 2.59005 1.55403 1.55403C2.59005 0.51801 3.85592 0 5.35163 0C6.84734 0 8.11321 0.51801 9.14923 1.55403C10.1852 2.59005 10.7033 3.85592 10.7033 5.35163C10.7033 5.9554 10.6072 6.52487 10.4151 7.06003C10.223 7.5952 9.96226 8.06861 9.63293 8.48027L13.7736 12.6209C13.9245 12.7719 14 12.964 14 13.1973C14 13.4305 13.9245 13.6226 13.7736 13.7736C13.6226 13.9245 13.4305 14 13.1973 14C12.964 14 12.7719 13.9245 12.6209 13.7736L8.48027 9.63293C8.06861 9.96226 7.5952 10.223 7.06003 10.4151C6.52487 10.6072 5.9554 10.7033 5.35163 10.7033ZM5.35163 9.0566C6.38079 9.0566 7.25557 8.6964 7.97599 7.97599C8.6964 7.25557 9.0566 6.38079 9.0566 5.35163C9.0566 4.32247 8.6964 3.44768 7.97599 2.72727C7.25557 2.00686 6.38079 1.64666 5.35163 1.64666C4.32247 1.64666 3.44768 2.00686 2.72727 2.72727C2.00686 3.44768 1.64666 4.32247 1.64666 5.35163C1.64666 6.38079 2.00686 7.25557 2.72727 7.97599C3.44768 8.6964 4.32247 9.0566 5.35163 9.0566Z", fill: "#60697D" })), Te = ({ inputRef: e, onChange: t, type: n, placeholder: s, value: a }) => /* @__PURE__ */ I("div", { className: "ia-table-select-search d-flex align-items-center", children: [
|
|
877
|
+
/* @__PURE__ */ m(_e, { className: "icon-10" }),
|
|
878
|
+
/* @__PURE__ */ m(
|
|
879
|
+
"input",
|
|
880
|
+
{
|
|
881
|
+
ref: e,
|
|
882
|
+
type: n,
|
|
883
|
+
value: a,
|
|
884
|
+
placeholder: s,
|
|
885
|
+
className: "ia-table-select-search-input",
|
|
886
|
+
onChange: t,
|
|
887
|
+
onClick: (i) => i.stopPropagation()
|
|
888
|
+
}
|
|
889
|
+
)
|
|
890
|
+
] }), Me = (e, t, n) => {
|
|
891
|
+
F(() => {
|
|
892
|
+
var a;
|
|
893
|
+
const s = (a = n == null ? void 0 : n.getTableInstance) == null ? void 0 : a.call(n);
|
|
894
|
+
if (e && t && (s != null && s.current)) {
|
|
895
|
+
const i = s.current.querySelectorAll(
|
|
896
|
+
".ia-table-frozen-scroll-container, .ia-table-right-pinned-scroll-container, .ia-table-normal-scroll-container"
|
|
897
|
+
), o = Array.from(
|
|
898
|
+
i
|
|
899
|
+
).map((c) => ({
|
|
900
|
+
element: c,
|
|
901
|
+
overflow: c.style.overflow
|
|
902
|
+
}));
|
|
903
|
+
return i.forEach((c) => {
|
|
904
|
+
c.style.overflow = "hidden";
|
|
905
|
+
}), () => {
|
|
906
|
+
o.forEach((c) => {
|
|
907
|
+
c.element.style.overflow = c.overflow;
|
|
908
|
+
});
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
}, [e, t, n]);
|
|
912
|
+
}, Ie = ({
|
|
913
|
+
label: e = "",
|
|
914
|
+
width: t = "100%",
|
|
915
|
+
selectedOptions: n,
|
|
916
|
+
setSelectedOptions: s,
|
|
917
|
+
isDisabled: a = !1,
|
|
918
|
+
isOpen: i = void 0,
|
|
919
|
+
setIsOpen: o = void 0,
|
|
920
|
+
initialOptions: c = [],
|
|
921
|
+
withPortal: r = !1,
|
|
922
|
+
className: f = "",
|
|
923
|
+
isMulti: l = !1,
|
|
924
|
+
currentOptions: p,
|
|
925
|
+
setCurrentOptions: d,
|
|
926
|
+
onBlur: u,
|
|
927
|
+
isCellRenderer: h = !1,
|
|
928
|
+
tableApi: g = null,
|
|
929
|
+
lazyLoadCellRenderer: w = !1,
|
|
930
|
+
isEnableResetButton: v = !0
|
|
931
|
+
}) => {
|
|
932
|
+
const C = G(null), N = G(null), S = G(null), [_, H] = X(!1), [A, R] = X(""), [V, $] = X(null), [x, j] = X(-1), [B, Y] = X(c), q = p || B || c, T = i !== void 0 ? i : _, D = o || H;
|
|
933
|
+
Me(T, h, g);
|
|
934
|
+
const O = U(() => {
|
|
935
|
+
if (C.current) {
|
|
936
|
+
const E = C.current.getBoundingClientRect();
|
|
937
|
+
return {
|
|
938
|
+
top: E.bottom + window.scrollY,
|
|
939
|
+
left: E.left + window.scrollX,
|
|
940
|
+
width: E.width
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
return null;
|
|
944
|
+
}, []);
|
|
945
|
+
F(() => {
|
|
946
|
+
if (w) {
|
|
947
|
+
if (r) {
|
|
948
|
+
const E = O();
|
|
949
|
+
E && $(E);
|
|
950
|
+
}
|
|
951
|
+
D(w);
|
|
952
|
+
}
|
|
953
|
+
}, [w, r, O]), F(() => {
|
|
954
|
+
if (T && r) {
|
|
955
|
+
const E = O();
|
|
956
|
+
E && $(E);
|
|
957
|
+
}
|
|
958
|
+
}, [T, r, O]), F(() => {
|
|
959
|
+
const E = (b) => {
|
|
960
|
+
C.current && !C.current.contains(b.target) && N.current && !N.current.contains(b.target) && (D(!1), u && u(), h && (g != null && g.tableId) && (window.iaTablePortalOpen || (window.iaTablePortalOpen = {}), window.iaTablePortalOpen[g.tableId] = !1));
|
|
961
|
+
}, y = () => {
|
|
962
|
+
if (T && r) {
|
|
963
|
+
const b = O();
|
|
964
|
+
b && $(b);
|
|
965
|
+
}
|
|
966
|
+
};
|
|
967
|
+
return T && (document.addEventListener("mousedown", E), r && (window.addEventListener("scroll", y, !0), window.addEventListener("resize", y))), () => {
|
|
968
|
+
document.removeEventListener("mousedown", E), r && (window.removeEventListener("scroll", y, !0), window.removeEventListener("resize", y));
|
|
969
|
+
};
|
|
970
|
+
}, [
|
|
971
|
+
T,
|
|
972
|
+
D,
|
|
973
|
+
r,
|
|
974
|
+
h,
|
|
975
|
+
u,
|
|
976
|
+
g,
|
|
977
|
+
O
|
|
978
|
+
]), F(() => {
|
|
979
|
+
T && S.current && (S.current.focus(), j(-1));
|
|
980
|
+
}, [T]), F(() => {
|
|
981
|
+
p || c && c.length > 0 && Y(c);
|
|
982
|
+
}, [c, p, d]);
|
|
983
|
+
const ue = U(
|
|
984
|
+
(E) => {
|
|
985
|
+
if (E.stopPropagation(), !a) {
|
|
986
|
+
if (!T && r) {
|
|
987
|
+
const y = O();
|
|
988
|
+
y && $(y);
|
|
989
|
+
}
|
|
990
|
+
D(!T), T && u && u();
|
|
991
|
+
}
|
|
992
|
+
},
|
|
993
|
+
[a, T, D, r, O]
|
|
994
|
+
), ne = U(
|
|
995
|
+
(E) => {
|
|
996
|
+
if (l)
|
|
997
|
+
if (Array.isArray(n) && n.some((b) => b.value === E.value))
|
|
998
|
+
s(
|
|
999
|
+
n.filter(
|
|
1000
|
+
(b) => b.value !== E.value
|
|
1001
|
+
)
|
|
1002
|
+
);
|
|
1003
|
+
else {
|
|
1004
|
+
const b = Array.isArray(n) ? n : [];
|
|
1005
|
+
s([...b, E]);
|
|
1006
|
+
}
|
|
1007
|
+
else
|
|
1008
|
+
s(E), D(!1), h && (g != null && g.tableId) && (window.iaTablePortalOpen || (window.iaTablePortalOpen = {}), window.iaTablePortalOpen[g.tableId] = !1);
|
|
1009
|
+
},
|
|
1010
|
+
[l, n, s, D, h]
|
|
1011
|
+
), pe = U(
|
|
1012
|
+
(E) => {
|
|
1013
|
+
const y = E.target.value.toLowerCase();
|
|
1014
|
+
R(y), j(-1);
|
|
1015
|
+
const b = p || c;
|
|
1016
|
+
if (y) {
|
|
1017
|
+
const P = b.filter((k) => k.label && typeof k.label == "string" ? k.label.toLowerCase().includes(y) : k.value && typeof k.value == "string" ? k.value.toLowerCase().includes(y) : k.label && typeof k.label == "number" ? k.label == Number(y) : k.value && typeof k.value == "number" ? k.value == Number(y) : !1);
|
|
1018
|
+
d ? d(P) : Y(P);
|
|
1019
|
+
} else
|
|
1020
|
+
d ? d(c) : Y(c);
|
|
1021
|
+
},
|
|
1022
|
+
[c, p, d]
|
|
1023
|
+
);
|
|
1024
|
+
F(() => {
|
|
1025
|
+
if (!T) return;
|
|
1026
|
+
const E = (y) => {
|
|
1027
|
+
const b = q.filter((P) => !P.isDisabled);
|
|
1028
|
+
switch (y.key) {
|
|
1029
|
+
case "ArrowDown":
|
|
1030
|
+
y.preventDefault(), y.stopPropagation(), j((P) => {
|
|
1031
|
+
const k = P < b.length - 1 ? P + 1 : 0;
|
|
1032
|
+
return setTimeout(() => {
|
|
1033
|
+
var K;
|
|
1034
|
+
const M = (K = N.current) == null ? void 0 : K.querySelector(
|
|
1035
|
+
`[data-option-index="${k}"]`
|
|
1036
|
+
);
|
|
1037
|
+
M == null || M.scrollIntoView({ block: "nearest" });
|
|
1038
|
+
}, 0), k;
|
|
1039
|
+
});
|
|
1040
|
+
break;
|
|
1041
|
+
case "ArrowUp":
|
|
1042
|
+
y.preventDefault(), y.stopPropagation(), j((P) => {
|
|
1043
|
+
const k = P > 0 ? P - 1 : b.length - 1;
|
|
1044
|
+
return setTimeout(() => {
|
|
1045
|
+
var K;
|
|
1046
|
+
const M = (K = N.current) == null ? void 0 : K.querySelector(
|
|
1047
|
+
`[data-option-index="${k}"]`
|
|
1048
|
+
);
|
|
1049
|
+
M == null || M.scrollIntoView({ block: "nearest" });
|
|
1050
|
+
}, 0), k;
|
|
1051
|
+
});
|
|
1052
|
+
break;
|
|
1053
|
+
case "Enter":
|
|
1054
|
+
if (y.preventDefault(), y.stopPropagation(), x >= 0 && x < b.length) {
|
|
1055
|
+
const P = b[x];
|
|
1056
|
+
P && !P.isDisabled && ne(P);
|
|
1057
|
+
}
|
|
1058
|
+
break;
|
|
1059
|
+
case "Escape":
|
|
1060
|
+
y.preventDefault(), y.stopPropagation(), D(!1), h && (g != null && g.tableId) && (window.iaTablePortalOpen || (window.iaTablePortalOpen = {}), window.iaTablePortalOpen[g.tableId] = !1);
|
|
1061
|
+
break;
|
|
1062
|
+
}
|
|
1063
|
+
};
|
|
1064
|
+
return document.addEventListener("keydown", E), () => {
|
|
1065
|
+
document.removeEventListener("keydown", E);
|
|
1066
|
+
};
|
|
1067
|
+
}, [
|
|
1068
|
+
T,
|
|
1069
|
+
q,
|
|
1070
|
+
x,
|
|
1071
|
+
ne,
|
|
1072
|
+
D,
|
|
1073
|
+
h,
|
|
1074
|
+
g
|
|
1075
|
+
]);
|
|
1076
|
+
const ge = `ia-table-select-container d-flex justify-content-between align-items-center ${a ? "ia-table-select-disabled" : ""} ${T ? "ia-table-select-open" : ""} ${h ? "ia-table-selectrenderer" : ""} ${f}`, me = () => {
|
|
1077
|
+
const E = q.filter((b) => !b.isDisabled), y = /* @__PURE__ */ I(
|
|
1078
|
+
"div",
|
|
1079
|
+
{
|
|
1080
|
+
ref: N,
|
|
1081
|
+
className: "ia-table-select-dropdown d-flex flex-column",
|
|
1082
|
+
onClick: (b) => b.stopPropagation(),
|
|
1083
|
+
style: {
|
|
1084
|
+
...r && V ? {
|
|
1085
|
+
position: "absolute",
|
|
1086
|
+
top: `${V.top}px`,
|
|
1087
|
+
left: `${V.left}px`,
|
|
1088
|
+
width: `${V.width}px`
|
|
1089
|
+
} : { width: t }
|
|
1090
|
+
},
|
|
1091
|
+
children: [
|
|
1092
|
+
/* @__PURE__ */ m(
|
|
1093
|
+
Te,
|
|
1094
|
+
{
|
|
1095
|
+
inputRef: S,
|
|
1096
|
+
type: "text",
|
|
1097
|
+
value: A,
|
|
1098
|
+
onChange: pe,
|
|
1099
|
+
placeholder: "Search here..."
|
|
1100
|
+
}
|
|
1101
|
+
),
|
|
1102
|
+
/* @__PURE__ */ m("div", { className: "ia-table-select-options d-flex flex-column gap-2", children: q && q.length > 0 ? q.map((b) => {
|
|
1103
|
+
const P = E.findIndex(
|
|
1104
|
+
(M) => M.value === b.value
|
|
1105
|
+
), k = P === x;
|
|
1106
|
+
return /* @__PURE__ */ I(
|
|
1107
|
+
"div",
|
|
1108
|
+
{
|
|
1109
|
+
"data-option-index": P,
|
|
1110
|
+
className: `ia-table-select-option cursor-pointer d-flex align-items-center gap-6 ${l ? Array.isArray(n) && n.some(
|
|
1111
|
+
(M) => M.value === b.value
|
|
1112
|
+
) ? "ia-table-select-option-selected" : "" : n && !Array.isArray(n) && n.value === b.value ? "ia-table-select-option-selected" : ""} ${b.isDisabled ? "ia-table-option-disabled" : ""} ${k ? "ia-table-select-option-highlighted" : ""}`,
|
|
1113
|
+
onClick: (M) => {
|
|
1114
|
+
M.stopPropagation(), b.isDisabled || ne(b);
|
|
1115
|
+
},
|
|
1116
|
+
onMouseEnter: () => {
|
|
1117
|
+
b.isDisabled || j(P);
|
|
1118
|
+
},
|
|
1119
|
+
onMouseLeave: () => {
|
|
1120
|
+
b.isDisabled || j(-1);
|
|
1121
|
+
},
|
|
1122
|
+
children: [
|
|
1123
|
+
l && Array.isArray(n) && n.some(
|
|
1124
|
+
(M) => M.value === b.value
|
|
1125
|
+
) ? /* @__PURE__ */ m(he, { className: "icon-16" }) : l ? /* @__PURE__ */ m(fe, { className: "icon-16" }) : null,
|
|
1126
|
+
/* @__PURE__ */ m("span", { children: b.label })
|
|
1127
|
+
]
|
|
1128
|
+
},
|
|
1129
|
+
b.value
|
|
1130
|
+
);
|
|
1131
|
+
}) : /* @__PURE__ */ m("div", { className: "ia-table-select-no-options", children: "No options available" }) })
|
|
1132
|
+
]
|
|
1133
|
+
}
|
|
1134
|
+
);
|
|
1135
|
+
return r ? se(y, document.body) : y;
|
|
1136
|
+
};
|
|
1137
|
+
return /* @__PURE__ */ I(
|
|
1138
|
+
"div",
|
|
1139
|
+
{
|
|
1140
|
+
className: `ia-table-selectbox-container ${h && a ? "ia-table-cell-render-select-disabled" : ""}`,
|
|
1141
|
+
style: { width: t },
|
|
1142
|
+
children: [
|
|
1143
|
+
e && /* @__PURE__ */ m("label", { className: "ia-table-select-label", children: e }),
|
|
1144
|
+
/* @__PURE__ */ I(
|
|
1145
|
+
"div",
|
|
1146
|
+
{
|
|
1147
|
+
ref: C,
|
|
1148
|
+
className: ge,
|
|
1149
|
+
onClick: ue,
|
|
1150
|
+
children: [
|
|
1151
|
+
/* @__PURE__ */ m("div", { className: "ia-table-select-value", children: n ? l ? Array.isArray(n) && n.length > 0 ? n.length === 1 ? n[0].label : `${n.length} items selected` : "Select" : Array.isArray(n) ? "Select" : n.label : l ? "Select" : "Select an option" }),
|
|
1152
|
+
(l ? Array.isArray(n) && n.length > 0 : n) && v && /* @__PURE__ */ m(
|
|
1153
|
+
"button",
|
|
1154
|
+
{
|
|
1155
|
+
className: "ia-table-select-reset cursor-pointer flex-shrink-0 d-flex align-items-center justify-content-center",
|
|
1156
|
+
onClick: (E) => {
|
|
1157
|
+
E.stopPropagation(), s([]);
|
|
1158
|
+
},
|
|
1159
|
+
children: /* @__PURE__ */ m(de, { className: "icon-10" })
|
|
1160
|
+
}
|
|
1161
|
+
),
|
|
1162
|
+
/* @__PURE__ */ m(
|
|
1163
|
+
"div",
|
|
1164
|
+
{
|
|
1165
|
+
className: "ia-table-select-arrow d-flex align-items-center icon-16 justify-content-center",
|
|
1166
|
+
style: {
|
|
1167
|
+
marginLeft: n ? "0" : "8px"
|
|
1168
|
+
},
|
|
1169
|
+
children: /* @__PURE__ */ m(
|
|
1170
|
+
Pe,
|
|
1171
|
+
{
|
|
1172
|
+
className: `icon-16 ${T ? "ia-table-rotate-270" : "ia-table-rotate-90"}`
|
|
1173
|
+
}
|
|
1174
|
+
)
|
|
1175
|
+
}
|
|
1176
|
+
)
|
|
1177
|
+
]
|
|
1178
|
+
}
|
|
1179
|
+
),
|
|
1180
|
+
T && me()
|
|
1181
|
+
]
|
|
1182
|
+
}
|
|
1183
|
+
);
|
|
1184
|
+
}, mt = te(Ie), vt = ({
|
|
1185
|
+
checked: e = !1,
|
|
1186
|
+
onChange: t,
|
|
1187
|
+
label: n,
|
|
1188
|
+
disabled: s = !1,
|
|
1189
|
+
className: a = ""
|
|
1190
|
+
}) => {
|
|
1191
|
+
const i = (o) => {
|
|
1192
|
+
o.stopPropagation(), !s && t && t(o.target.checked);
|
|
1193
|
+
};
|
|
1194
|
+
return /* @__PURE__ */ I(
|
|
1195
|
+
"label",
|
|
1196
|
+
{
|
|
1197
|
+
className: `ia-checkbox-container d-flex align-items-center gap-6 cursor-pointer ${a} ${s ? "ia-checkbox-disabled" : ""} `,
|
|
1198
|
+
children: [
|
|
1199
|
+
/* @__PURE__ */ I("div", { className: "ia-checkbox-wrapper d-flex align-items-center justify-content-center position-relative", children: [
|
|
1200
|
+
/* @__PURE__ */ m(
|
|
1201
|
+
"input",
|
|
1202
|
+
{
|
|
1203
|
+
type: "checkbox",
|
|
1204
|
+
checked: e,
|
|
1205
|
+
onChange: i,
|
|
1206
|
+
disabled: s,
|
|
1207
|
+
className: "ia-checkbox-input cursor-pointer"
|
|
1208
|
+
}
|
|
1209
|
+
),
|
|
1210
|
+
/* @__PURE__ */ m("span", { className: "ia-checkbox-custom d-flex align-items-center justify-content-center", children: e ? /* @__PURE__ */ m(he, { className: "ia-checkbox-icon" }) : /* @__PURE__ */ m(fe, { className: "ia-checkbox-icon" }) })
|
|
1211
|
+
] }),
|
|
1212
|
+
n && /* @__PURE__ */ m("span", { className: "ia-checkbox-label", children: n })
|
|
1213
|
+
]
|
|
1214
|
+
}
|
|
1215
|
+
);
|
|
1216
|
+
}, bt = ({
|
|
1217
|
+
options: e,
|
|
1218
|
+
selectedOption: t,
|
|
1219
|
+
onChange: n,
|
|
1220
|
+
orientation: s = "vertical",
|
|
1221
|
+
disabled: a = !1,
|
|
1222
|
+
name: i = "radio-group",
|
|
1223
|
+
className: o = ""
|
|
1224
|
+
}) => {
|
|
1225
|
+
const c = (r) => {
|
|
1226
|
+
!a && n && n(r);
|
|
1227
|
+
};
|
|
1228
|
+
return /* @__PURE__ */ m(
|
|
1229
|
+
"div",
|
|
1230
|
+
{
|
|
1231
|
+
className: `ia-table-radio-group-container d-flex gap-16 ${s} ${o}`,
|
|
1232
|
+
children: e.map((r) => /* @__PURE__ */ I(
|
|
1233
|
+
"label",
|
|
1234
|
+
{
|
|
1235
|
+
className: "ia-table-radio-option d-flex align-items-center gap-8 cursor-pointer position-relative",
|
|
1236
|
+
children: [
|
|
1237
|
+
/* @__PURE__ */ m(
|
|
1238
|
+
"input",
|
|
1239
|
+
{
|
|
1240
|
+
type: "radio",
|
|
1241
|
+
name: i,
|
|
1242
|
+
value: r.value,
|
|
1243
|
+
checked: t === r.value,
|
|
1244
|
+
onChange: c,
|
|
1245
|
+
disabled: a || r.disabled,
|
|
1246
|
+
"aria-label": r.label,
|
|
1247
|
+
className: "ia-table-radio-input position-absolute cursor-pointer"
|
|
1248
|
+
}
|
|
1249
|
+
),
|
|
1250
|
+
/* @__PURE__ */ m("span", { className: "ia-table-radio-custom position-relative d-flex align-items-center justify-content-center" }),
|
|
1251
|
+
r.label && /* @__PURE__ */ m(
|
|
1252
|
+
"span",
|
|
1253
|
+
{
|
|
1254
|
+
className: `ia-table-radio-label ${t === r.value ? "ia-table-radio-label-selected" : ""}`,
|
|
1255
|
+
children: r.label
|
|
1256
|
+
}
|
|
1257
|
+
)
|
|
1258
|
+
]
|
|
1259
|
+
},
|
|
1260
|
+
r.value
|
|
1261
|
+
))
|
|
1262
|
+
}
|
|
1263
|
+
);
|
|
1264
|
+
}, wt = (e) => /* @__PURE__ */ L.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ L.createElement("path", { d: "M3.62057 16C3.15514 16 2.75754 15.8327 2.42777 15.498C2.09814 15.1632 1.93333 14.7595 1.93333 14.287V2.25959H1V0.838165H5.2V0H10.8V0.838165H15V2.25959H14.0667V14.287C14.0667 14.7657 13.9033 15.1708 13.5767 15.5025C13.25 15.8342 12.8509 16 12.3794 16H3.62057ZM12.6667 2.25959H3.33333V14.287C3.33333 14.3721 3.36024 14.442 3.41407 14.4966C3.46789 14.5513 3.53672 14.5786 3.62057 14.5786H12.3794C12.4513 14.5786 12.5171 14.5482 12.5768 14.4874C12.6367 14.4267 12.6667 14.3599 12.6667 14.287V2.25959ZM5.57707 12.6833H6.97683V4.15482H5.57707V12.6833ZM9.02317 12.6833H10.4229V4.15482H9.02317V12.6833Z", fill: "#B4BAC7" })), Ct = (e) => /* @__PURE__ */ L.createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 6 9", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ L.createElement("path", { d: "M0.725024 8.3419C0.612116 8.23649 0.555663 8.1117 0.555663 7.96751C0.555663 7.8236 0.612116 7.69894 0.725024 7.59354L4.03321 4.50527L0.713734 1.40646C0.608354 1.30808 0.555664 1.18511 0.555664 1.03755C0.555664 0.889987 0.612118 0.763505 0.725025 0.658103C0.837932 0.552701 0.971615 0.5 1.12607 0.5C1.28023 0.5 1.41376 0.552701 1.52667 0.658103L5.32035 4.21015C5.36552 4.25231 5.39758 4.29798 5.41655 4.34717C5.43522 4.39635 5.44455 4.44906 5.44455 4.50527C5.44455 4.56148 5.43522 4.61419 5.41655 4.66337C5.39758 4.71256 5.36552 4.75823 5.32035 4.80039L1.51537 8.35244C1.40999 8.45081 1.28023 8.5 1.12607 8.5C0.971613 8.5 0.837931 8.4473 0.725024 8.3419Z", fill: "#60697D" }));
|
|
1265
|
+
export {
|
|
1266
|
+
Xe as A,
|
|
1267
|
+
ie as B,
|
|
1268
|
+
vt as C,
|
|
1269
|
+
Ct as D,
|
|
1270
|
+
Je as E,
|
|
1271
|
+
z as F,
|
|
1272
|
+
_e as G,
|
|
1273
|
+
ot as H,
|
|
1274
|
+
gt as I,
|
|
1275
|
+
rt as J,
|
|
1276
|
+
nt as K,
|
|
1277
|
+
it as L,
|
|
1278
|
+
pt as M,
|
|
1279
|
+
qe as N,
|
|
1280
|
+
Ye as O,
|
|
1281
|
+
Be as P,
|
|
1282
|
+
ze as Q,
|
|
1283
|
+
De as R,
|
|
1284
|
+
de as S,
|
|
1285
|
+
dt as T,
|
|
1286
|
+
Ge as U,
|
|
1287
|
+
We as V,
|
|
1288
|
+
je as W,
|
|
1289
|
+
Ue as X,
|
|
1290
|
+
Ke as Y,
|
|
1291
|
+
xe as a,
|
|
1292
|
+
W as b,
|
|
1293
|
+
ye as c,
|
|
1294
|
+
tt as d,
|
|
1295
|
+
we as e,
|
|
1296
|
+
ft as f,
|
|
1297
|
+
Z as g,
|
|
1298
|
+
at as h,
|
|
1299
|
+
ht as i,
|
|
1300
|
+
bt as j,
|
|
1301
|
+
mt as k,
|
|
1302
|
+
ut as l,
|
|
1303
|
+
Te as m,
|
|
1304
|
+
wt as n,
|
|
1305
|
+
Pe as o,
|
|
1306
|
+
oe as p,
|
|
1307
|
+
ct as q,
|
|
1308
|
+
le as r,
|
|
1309
|
+
Ze as s,
|
|
1310
|
+
Qe as t,
|
|
1311
|
+
Me as u,
|
|
1312
|
+
et as v,
|
|
1313
|
+
Oe as w,
|
|
1314
|
+
lt as x,
|
|
1315
|
+
Fe as y,
|
|
1316
|
+
st as z
|
|
1317
|
+
};
|