@ufal-lccv/gpsub-ds 0.2.46 → 0.2.47

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.
@@ -1,937 +0,0 @@
1
- import { $ as t, c as P, p as re, an as K, C as ae, D as de, m as oe, X as ce, Z as V, ao as he, ap as ue, aq as fe, ar as xe, U as ge, E as ie, as as pe, at as me, au as be, av as je, aw as Y, ax as z, ay as we, az as We, aA as Ie, aB as ye } from "./GenericAGGridTable-DNnLeEvP.js";
2
- import { useState as J, useEffect as G, useMemo as Z, useRef as Q, useLayoutEffect as Ae } from "react";
3
- import { Icon as te } from "sbwb-ds";
4
- import { Controller as B, useController as ke } from "react-hook-form";
5
- import { v as q, s as Re } from "./index-YF_5f0O1.js";
6
- import { p as se } from "./parseDate-ihxA2lUF.js";
7
- const le = 350, Fe = ({
8
- title: r,
9
- children: a,
10
- endAdornment: f = null,
11
- marginBottom: p = "16px",
12
- customStyles: o = {},
13
- wrapperCustomStyles: l = {},
14
- animationContainerCustomStyles: c = {},
15
- hideAdornmentOnCollapse: x = !1,
16
- maxHeight: k = "none",
17
- // Default to 'none' to allow full expansion
18
- height: H = "fit-content"
19
- }) => {
20
- const [R, S] = J(!1), [m, I] = J(!0);
21
- G(() => {
22
- if (x)
23
- if (R) {
24
- const w = setTimeout(
25
- () => I(!1),
26
- le
27
- );
28
- return () => clearTimeout(w);
29
- } else
30
- I(!0);
31
- }, [R, x]);
32
- const N = x && !m ? null : f;
33
- return /* @__PURE__ */ t.jsxs(
34
- P,
35
- {
36
- width: "100%",
37
- flex: "1",
38
- gap: "8px",
39
- customStyles: l,
40
- children: [
41
- /* @__PURE__ */ t.jsx(
42
- re,
43
- {
44
- title: r,
45
- divider: !0,
46
- marginBottom: p,
47
- collapse: {
48
- collapsed: R,
49
- setCollapsed: S
50
- },
51
- endAdornment: N,
52
- customStyles: o
53
- }
54
- ),
55
- /* @__PURE__ */ t.jsx(
56
- P,
57
- {
58
- gap: "8px",
59
- width: "100%",
60
- height: H,
61
- customStyles: {
62
- ...c,
63
- maxHeight: R ? "0" : k,
64
- transition: `max-height ${le}ms ease-in-out`
65
- },
66
- children: a
67
- }
68
- )
69
- ]
70
- }
71
- );
72
- };
73
- function Oe({
74
- form: r,
75
- name: a,
76
- id: f = a,
77
- label: p,
78
- readonly: o = !1,
79
- disabled: l = !1,
80
- afterCheck: c,
81
- width: x = "100%",
82
- formatter: k,
83
- parser: H,
84
- flex: R,
85
- size: S = "Medium",
86
- checkColor: m,
87
- triggerFormField: I = null,
88
- ...N
89
- }) {
90
- const { onChangeTrigger: w } = K({
91
- form: r,
92
- fieldName: a,
93
- triggerType: I,
94
- debounceTime: 0
95
- }), h = (b, C) => {
96
- C(b), c == null || c(b), w == null || w();
97
- };
98
- return /* @__PURE__ */ t.jsx(P, { width: x, flex: R, children: /* @__PURE__ */ t.jsx(
99
- B,
100
- {
101
- name: a,
102
- control: r.control,
103
- render: ({
104
- field: { onChange: b, value: C, onBlur: $ },
105
- fieldState: { error: T = null }
106
- }) => {
107
- const M = T == null ? void 0 : T.message;
108
- return M && console.log("Error on checkbox!", M), /* @__PURE__ */ t.jsx(
109
- ae,
110
- {
111
- id: `form-checkbox-${f}`,
112
- checked: k ? k(C) : !!C,
113
- name: a,
114
- label: p,
115
- disabled: l || o,
116
- onChange: (g) => {
117
- h(
118
- (H == null ? void 0 : H(g.target.checked, C)) ?? g.target.checked,
119
- b
120
- ), $ == null || $();
121
- },
122
- size: S,
123
- checkColor: m,
124
- ...N
125
- }
126
- );
127
- }
128
- }
129
- ) });
130
- }
131
- const Ee = ({
132
- form: r,
133
- name: a,
134
- label: f,
135
- placeholder: p,
136
- readonly: o = !1,
137
- disabled: l = !1,
138
- width: c = "100%",
139
- flex: x,
140
- tooltipIsVisible: k,
141
- tooltipMaxWidth: H,
142
- tooltipPosition: R = "top",
143
- afterFormChange: S,
144
- openToDate: m,
145
- range: I = !1,
146
- openCalendarOnInputClick: N = !1,
147
- ...w
148
- }) => {
149
- let h = p;
150
- return !q(p) && !l && (h = o ? "Nenhuma data escolhida" : "Escolha uma data"), /* @__PURE__ */ t.jsx(P, { width: c, flex: x, children: /* @__PURE__ */ t.jsx(
151
- B,
152
- {
153
- name: a,
154
- control: r.control,
155
- render: ({ field: { value: b, onChange: C, ref: $ } }) => {
156
- let T;
157
- q(b) && (I ? T = Array.isArray(b) ? b.join(" - ") : b : T = new Date(Re(b.slice(0, 10))));
158
- const { error: M } = r.getFieldState(a, r.formState);
159
- return /* @__PURE__ */ t.jsx(
160
- de,
161
- {
162
- ref: $,
163
- idCalendar: `${a}-calendar`,
164
- label: f,
165
- value: T,
166
- size: "Small",
167
- readonly: o,
168
- errorMessage: M == null ? void 0 : M.message,
169
- disabled: l,
170
- placeholder: h,
171
- onChangeHandleDate: (g) => {
172
- var n;
173
- C(
174
- I ? g ? g.split(" - ").map((D) => {
175
- var O;
176
- return ((O = se(D)) == null ? void 0 : O.slice(0, 10)) || null;
177
- }) : [null, null] : g && ((n = se(g)) == null ? void 0 : n.slice(0, 10)) || null
178
- ), S == null || S(g);
179
- },
180
- openToDate: m,
181
- selectsRange: I,
182
- openCalendarOnInputClick: N,
183
- width: c,
184
- flex: x,
185
- ...w
186
- }
187
- );
188
- }
189
- }
190
- ) });
191
- };
192
- function Ue({
193
- form: r,
194
- name: a,
195
- label: f,
196
- slots: { field: p },
197
- slotsProps: o,
198
- triggerFormField: l = null,
199
- // Value
200
- value: c,
201
- // Flags
202
- bypassControllerOnChange: x = !1,
203
- overrideOnBlur: k = !1,
204
- isRequired: H = !1,
205
- readonly: R = !1,
206
- disabled: S = !1,
207
- // Tranformations
208
- parser: m,
209
- // Debounce
210
- debounce: I,
211
- // Change handlers
212
- beforeChange: N,
213
- onChange: w,
214
- afterChange: h,
215
- // Blur handlers
216
- beforeBlur: b,
217
- onBlur: C,
218
- afterBlur: $,
219
- // Enter handlers
220
- onEnter: T
221
- }) {
222
- const {
223
- field: { value: M, onChange: g },
224
- fieldState: { error: n = null }
225
- } = ke({ name: a, control: r.control }), D = q(I), { onChangeTrigger: O, onBlurTrigger: d } = K({
226
- form: r,
227
- fieldName: a,
228
- triggerType: l,
229
- debounceTime: D ? 0 : 500
230
- }), i = (e, j) => {
231
- var A, _;
232
- const F = ((A = e == null ? void 0 : e.target) == null ? void 0 : A.value) || ((_ = e == null ? void 0 : e.target) == null ? void 0 : _.checked) || e || void 0, y = q(m) ? m(F) : F;
233
- N == null || N(y), x || j == null || j(y), w == null || w(e, j), h == null || h(e, j), O == null || O();
234
- }, W = Z(() => {
235
- if (!D) return i;
236
- let e;
237
- return (F, y) => {
238
- clearTimeout(e), e = setTimeout(() => i(F, y), I);
239
- };
240
- }, [D, I, i]), u = (e, j) => {
241
- var y, A;
242
- const F = ((y = e == null ? void 0 : e.target) == null ? void 0 : y.value) || ((A = e == null ? void 0 : e.target) == null ? void 0 : A.checked) || e || void 0;
243
- !k && x && (g == null || g(F)), b == null || b(e, j), C == null || C(e, j), $ == null || $(e, j), d == null || d();
244
- }, L = (e, j) => {
245
- T == null || T(e, j);
246
- };
247
- n != null && n.message && console.log(`Error on ${p.displayName}!`, n.message);
248
- const s = q(c) ? c == null ? void 0 : c(M) : { value: M };
249
- return /* @__PURE__ */ t.jsx(P, { ...o == null ? void 0 : o.container, children: /* @__PURE__ */ t.jsx(
250
- p,
251
- {
252
- ...o == null ? void 0 : o.field,
253
- ...s,
254
- label: f,
255
- onChange: (e) => W == null ? void 0 : W(e, g),
256
- onBlur: (e) => u == null ? void 0 : u(e, g),
257
- onEnter: (e) => L == null ? void 0 : L(e, g),
258
- errorMessage: n == null ? void 0 : n.message
259
- }
260
- ) });
261
- }
262
- const Ve = ({
263
- form: r,
264
- name: a,
265
- label: f,
266
- options: p,
267
- readonly: o = !1,
268
- disabled: l = !1,
269
- width: c = "100%",
270
- flex: x,
271
- placeholder: k,
272
- iconName: H,
273
- onSelect: R,
274
- hasSelectAll: S = !1,
275
- tags: m = !0,
276
- sortOptions: I = !1,
277
- enableSearch: N = !1,
278
- valueAllOption: w,
279
- isRequired: h = !1,
280
- tooltipProps: b = {},
281
- infoProps: C = {},
282
- triggerFormField: $ = null,
283
- ...T
284
- }) => {
285
- const { onChangeTrigger: M } = K({
286
- form: r,
287
- fieldName: a,
288
- triggerType: $,
289
- debounceTime: 0
290
- });
291
- return /* @__PURE__ */ t.jsx(P, { width: c, flex: x, children: /* @__PURE__ */ t.jsx(
292
- B,
293
- {
294
- name: a,
295
- control: r.control,
296
- render: ({ field: { value: g, onChange: n } }) => {
297
- const { error: D } = r.getFieldState(a), O = q(g) ? g : [];
298
- return /* @__PURE__ */ t.jsx(
299
- oe,
300
- {
301
- label: f,
302
- size: "Small",
303
- disabled: l || o,
304
- onChange: (d) => {
305
- n(d), R == null || R(d), M == null || M();
306
- },
307
- values: O,
308
- errorMessage: D == null ? void 0 : D.message,
309
- options: p,
310
- iconName: H,
311
- hasSelectAll: S,
312
- tags: m,
313
- sortOptions: I,
314
- placeholder: k,
315
- enableSearch: N,
316
- valueAllOption: w,
317
- isRequired: h,
318
- tooltipProps: {
319
- position: "top",
320
- ...b
321
- },
322
- infoProps: {
323
- tooltipProps: {
324
- position: "top",
325
- maxWidth: "300px",
326
- ...C.tooltipProps
327
- },
328
- ...C
329
- },
330
- ...T
331
- }
332
- );
333
- }
334
- }
335
- ) });
336
- }, _e = ({
337
- variant: r = "default",
338
- form: a,
339
- name: f,
340
- label: p,
341
- options: o,
342
- readonly: l = !1,
343
- disabled: c = !1,
344
- optionsMap: x,
345
- width: k = "100%",
346
- flex: H,
347
- placeholder: R,
348
- onSelect: S,
349
- parser: m,
350
- onPaste: I,
351
- filter: N,
352
- tooltipProps: w = {},
353
- infoProps: h = {},
354
- maxHeightMenu: b,
355
- isRequired: C = !1,
356
- onRemoveSelected: $,
357
- triggerFormField: T = null,
358
- displayText: M,
359
- usePortal: g = !1,
360
- ...n
361
- }) => {
362
- const { onChangeTrigger: D } = K({
363
- form: a,
364
- fieldName: f,
365
- triggerType: T,
366
- debounceTime: 0
367
- }), O = {
368
- position: "top",
369
- ...w
370
- }, d = {
371
- ...h,
372
- tooltipProps: {
373
- position: "top",
374
- maxWidth: "300px",
375
- ...h == null ? void 0 : h.tooltipProps
376
- }
377
- }, i = (u, L) => {
378
- let s = u;
379
- m && (s = m == null ? void 0 : m(u)), L(s), S == null || S(s), D == null || D();
380
- }, W = Z(() => q(x) ? x : Object.fromEntries(o.map((u) => [u.value, u])), [o, x]);
381
- return /* @__PURE__ */ t.jsx(P, { width: k, flex: H, children: /* @__PURE__ */ t.jsx(
382
- B,
383
- {
384
- name: f,
385
- control: a.control,
386
- render: ({
387
- field: { onChange: u, value: L },
388
- fieldState: { error: s = null }
389
- }) => {
390
- let e = W[L];
391
- return /* @__PURE__ */ t.jsx(
392
- ce,
393
- {
394
- label: p,
395
- width: "100%",
396
- size: "Small",
397
- variant: r,
398
- disabled: c,
399
- readonly: l,
400
- filter: N,
401
- errorMessage: s == null ? void 0 : s.message,
402
- placeholder: R,
403
- value: e,
404
- handleOption: (j) => {
405
- i(j.value, u);
406
- },
407
- tooltipProps: O,
408
- options: o,
409
- usePortal: g,
410
- infoProps: d,
411
- maxHeightMenu: b,
412
- isRequired: C,
413
- onRemoveSelected: $,
414
- displayText: M,
415
- onPaste: I,
416
- ...n
417
- }
418
- );
419
- }
420
- }
421
- ) });
422
- }, Se = (r) => {
423
- const [a, f] = J(!1), [p, o] = J(r), l = Q(null);
424
- return G(() => {
425
- o(r);
426
- }, [r]), {
427
- setIsOpen: f,
428
- isOpen: a,
429
- setOptionsSelect: o,
430
- optionsSelect: p,
431
- selectContainerRef: l
432
- };
433
- }, Ne = 200, qe = ({
434
- name: r,
435
- variant: a = "primary",
436
- width: f = "100%",
437
- size: p = "Medium",
438
- disabled: o = !1,
439
- isLoading: l = !1,
440
- onClick: c,
441
- options: x,
442
- label: k,
443
- menuSelectProps: H = {},
444
- iconName: R,
445
- optionsIconPosition: S
446
- }) => {
447
- const { isOpen: m, setIsOpen: I, selectContainerRef: N, optionsSelect: w } = Se(x);
448
- let h = V.colors.backgroundColors.colorBackgroundSnow;
449
- o ? h = V.colors.neutralColors.colorNeutralCloudy : a !== "primary" && (h = V.colors.neutralColors.colorNeutralDark);
450
- const b = {
451
- ...H
452
- };
453
- return /* @__PURE__ */ t.jsxs(
454
- he,
455
- {
456
- ref: N,
457
- width: f,
458
- size: p,
459
- disabled: o,
460
- onBlur: () => setTimeout(() => I(!1), Ne),
461
- children: [
462
- k && /* @__PURE__ */ t.jsx(ue, { children: k }),
463
- /* @__PURE__ */ t.jsxs(
464
- fe,
465
- {
466
- type: "button",
467
- size: p,
468
- disabled: o,
469
- variant: a,
470
- isLoading: l,
471
- onClick: () => !l && I(!m),
472
- id: `button-component-${r}`,
473
- "data-cy": `button-component-${r}`,
474
- children: [
475
- l && /* @__PURE__ */ t.jsx(xe, { size: p, disabled: o, variant: a, children: /* @__PURE__ */ t.jsx(
476
- te,
477
- {
478
- iconName: `ProgressActivity${p === "Small" ? "Ant" : "Sm"}`,
479
- color: h,
480
- "data-testid": "icon-loading"
481
- }
482
- ) }),
483
- !l && /* @__PURE__ */ t.jsx("p", { title: r, children: r }),
484
- !l && (m ? /* @__PURE__ */ t.jsx(
485
- te,
486
- {
487
- iconName: `ExpandLess${p === "Small" ? "Ant" : "Sm"}`,
488
- color: h,
489
- "data-testid": "icon-button-less"
490
- }
491
- ) : /* @__PURE__ */ t.jsx(
492
- te,
493
- {
494
- iconName: `ExpandMore${p === "Small" ? "Ant" : "Sm"}`,
495
- color: h,
496
- "data-testid": "icon-button-more"
497
- }
498
- ))
499
- ]
500
- }
501
- ),
502
- m && /* @__PURE__ */ t.jsx(
503
- ge,
504
- {
505
- selectContainerRef: N,
506
- value: null,
507
- optionsSelect: w,
508
- selectOption: c,
509
- size: p,
510
- inputValue: null,
511
- iconPosition: S,
512
- iconName: R,
513
- ...b
514
- }
515
- )
516
- ]
517
- }
518
- );
519
- }, Pe = ({
520
- width: r = "100%",
521
- height: a = "fit-content",
522
- flex: f,
523
- backgroundColor: p = V.colors.backgroundColors.colorBackgroundCarpet,
524
- upperComponent: o = void 0,
525
- options: l = [],
526
- lowerComponent: c = void 0,
527
- heightItems: x = "60px",
528
- widthItems: k = "155px",
529
- emptyProps: H = {
530
- title: "Nenhum dado a ser mostrado",
531
- body: null
532
- },
533
- customWrapperStyles: R = {
534
- border: `1px solid ${V.colors.neutralColors.colorNeutralSoft}`,
535
- borderRadius: "8px"
536
- },
537
- customItemStyles: S = {},
538
- selectedKey: m,
539
- onSelect: I,
540
- selectedItemKey: N,
541
- setSelectedItemKey: w
542
- }) => {
543
- var O;
544
- const h = m !== void 0, b = !h && N !== void 0, [C, $] = J(((O = l[0]) == null ? void 0 : O.key) ?? null), T = Q(null), M = Q(null), g = h ? m : b ? N : C, n = Z(() => l.length ? g == null ? h ? null : l[0] : l.find((i) => i.key === g) ?? (h || b ? null : l[0]) : null, [l, g, h, b]);
545
- G(() => {
546
- const d = T.current, i = M.current, W = () => {
547
- d && i && (i.scrollTop = d.scrollTop);
548
- };
549
- return d == null || d.addEventListener("scroll", W), () => {
550
- d == null || d.removeEventListener("scroll", W);
551
- };
552
- }, []), G(() => {
553
- if (!(h || b)) {
554
- if (!l.length) {
555
- $(null);
556
- return;
557
- }
558
- $((d) => d != null && l.some((i) => i.key === d) ? d : l[0].key);
559
- }
560
- }, [l, h, b]);
561
- const D = (d) => {
562
- I == null || I(d), w == null || w(d.key), !h && !b && $(d.key);
563
- };
564
- return (l == null ? void 0 : l.length) === 0 ? /* @__PURE__ */ t.jsx(
565
- ie,
566
- {
567
- title: H.title,
568
- body: H.body,
569
- flex: "1",
570
- mode: "table"
571
- }
572
- ) : /* @__PURE__ */ t.jsxs(
573
- P,
574
- {
575
- width: r,
576
- height: a,
577
- flex: f,
578
- backgroundColor: p,
579
- direction: "horizontal",
580
- customStyles: {
581
- border: `1px solid ${V.colors.neutralColors.colorNeutralSoft}`,
582
- borderRadius: V.borders.borderRadius.borderRadiusSm,
583
- ...R,
584
- overflow: "hidden"
585
- },
586
- children: [
587
- /* @__PURE__ */ t.jsxs(pe, { ref: T, widthItems: k, children: [
588
- o && o,
589
- l == null ? void 0 : l.map((d) => /* @__PURE__ */ t.jsx(
590
- me,
591
- {
592
- selected: g === d.key,
593
- onClick: () => D(d),
594
- withBorderRight: !0,
595
- heightItems: x,
596
- customStyles: S,
597
- children: d.item
598
- },
599
- d.key
600
- )),
601
- c && c,
602
- /* @__PURE__ */ t.jsx(be, {})
603
- ] }),
604
- /* @__PURE__ */ t.jsx(je, { children: n && (n == null ? void 0 : n.contentItem) })
605
- ]
606
- }
607
- );
608
- };
609
- function Te(r) {
610
- return (a) => typeof r == "string" ? a[r] : typeof r == "function" ? r(a) : (console.warn("Please, setup a rowKey for table."), JSON.stringify(a));
611
- }
612
- function Je({
613
- id: r,
614
- rowKey: a = "id",
615
- size: f = "Small",
616
- onRowClick: p,
617
- fit: o = !1,
618
- maxHeight: l = "40rem",
619
- columns: c,
620
- dataSource: x,
621
- columnsTextSize: k = f,
622
- emptyProps: H = {
623
- width: "100%",
624
- height: "100%",
625
- title: "Nenhum dado a ser mostrado.",
626
- mode: "table",
627
- borders: !0,
628
- backgroundColor: V.colors.backgroundColors.colorBackgroundSnow
629
- },
630
- selectedRow: R = !1,
631
- hideHeader: S = !1,
632
- withBorder: m = !0,
633
- withBorderRadius: I = !0,
634
- striped: N = !1,
635
- borderRadius: w = V.borders.borderRadius.borderRadiusSm,
636
- disableMaxHeight: h = !1,
637
- isVisible: b = !1
638
- }) {
639
- const C = Z(() => Te(a), [a]), [$, T] = J(null), M = Q(null), g = Q(null), [n, D] = J(c);
640
- Ae(() => {
641
- if (!g.current || c.length === 0) {
642
- D(c);
643
- return;
644
- }
645
- const i = () => {
646
- var _;
647
- const u = ((_ = g.current) == null ? void 0 : _.clientWidth) || 0;
648
- if (u === 0) return;
649
- let L = 0, s = 0;
650
- const e = [], j = [];
651
- c.forEach((U) => {
652
- const E = Number(U.flex);
653
- U.width ? L += parseInt(U.width, 10) || 0 : U.flex && E > 0 ? (s += E, e.push(U)) : j.push(U);
654
- });
655
- const F = u - L, y = "80";
656
- let A = [...c];
657
- if (F > 0) {
658
- if (e.length > 0) {
659
- const U = F / s;
660
- A = c.map((E) => {
661
- const X = Number(E.flex);
662
- if (X && X > 0) {
663
- const v = parseInt(E.minWidth || y, 10), ee = X * U, ne = Math.max(ee, v);
664
- return { ...E, width: `${Math.floor(ne)}px` };
665
- }
666
- return !E.width && !X ? {
667
- ...E,
668
- width: E.minWidth || `${y}px`
669
- } : E;
670
- });
671
- } else if (j.length > 0) {
672
- const U = F / j.length;
673
- A = c.map((E) => {
674
- const X = Number(E.flex);
675
- if (!E.width && !X) {
676
- const v = parseInt(E.minWidth || y, 10), ee = Math.max(U, v);
677
- return { ...E, width: `${Math.floor(ee)}px` };
678
- }
679
- return E;
680
- });
681
- }
682
- } else
683
- A = c.map((U) => U.width ? U : { ...U, width: U.minWidth || `${y}px` });
684
- D(A);
685
- };
686
- i();
687
- const W = new ResizeObserver(i);
688
- return W.observe(g.current), () => W.disconnect();
689
- }, [c]), G(() => {
690
- const i = (W) => {
691
- M.current && !M.current.contains(W.target) && T(null);
692
- };
693
- return document.addEventListener("mousedown", i), () => {
694
- document.removeEventListener("mousedown", i);
695
- };
696
- }, []);
697
- const O = Z(() => n ? n.some(
698
- (i) => i.mergeHeaderId && i.mergeHeaderLabel
699
- ) : !1, [n]), d = Z(() => {
700
- var L, s;
701
- if (S || !n || n.length === 0)
702
- return null;
703
- if (!O)
704
- return /* @__PURE__ */ t.jsx(
705
- Y,
706
- {
707
- isHeader: !0,
708
- size: f,
709
- numRows: 1,
710
- borderRadius: w,
711
- children: n.map((e, j) => {
712
- var F;
713
- return /* @__PURE__ */ t.jsx(
714
- z,
715
- {
716
- width: e.width,
717
- minWidth: e.minWidth,
718
- maxWidth: e.maxWidth,
719
- horizontalAlign: e.horizontalAlign,
720
- size: f,
721
- columnsTextSize: k,
722
- withBorder: m,
723
- headerAlign: e.headerAlign,
724
- isLastColumn: j === n.length - 1,
725
- children: ((F = e.columnRender) == null ? void 0 : F.call(e, x)) || /* @__PURE__ */ t.jsx("span", { title: e.label, children: e.label })
726
- },
727
- e.dataIndex
728
- );
729
- })
730
- }
731
- );
732
- const i = [], W = [];
733
- let u = 0;
734
- for (; u < n.length; ) {
735
- const e = n[u];
736
- if (e.mergeHeaderId && e.mergeHeaderLabel) {
737
- let j = 0;
738
- const F = e.mergeHeaderId;
739
- for (let y = u; y < n.length && n[y].mergeHeaderId === F; y++)
740
- j++;
741
- i.push(
742
- /* @__PURE__ */ t.jsx(
743
- z,
744
- {
745
- colSpan: j,
746
- horizontalAlign: "center",
747
- size: f,
748
- columnsTextSize: k,
749
- withBorder: m,
750
- width: e.width,
751
- minWidth: e.minWidth,
752
- maxWidth: e.maxWidth,
753
- headerAlign: e.headerAlign,
754
- isTopRow: !0,
755
- isLastColumn: u + j - 1 === n.length - 1,
756
- children: /* @__PURE__ */ t.jsx("span", { title: e.mergeHeaderLabel, children: e.mergeHeaderLabel })
757
- },
758
- `${e.mergeHeaderId}-merged`
759
- )
760
- );
761
- for (let y = 0; y < j; y++) {
762
- const A = n[u + y];
763
- W.push(
764
- /* @__PURE__ */ t.jsx(
765
- z,
766
- {
767
- width: A.width,
768
- minWidth: A.minWidth,
769
- maxWidth: A.maxWidth,
770
- horizontalAlign: A.horizontalAlign,
771
- size: f,
772
- columnsTextSize: k,
773
- withBorder: m,
774
- headerAlign: e.headerAlign,
775
- isLastColumn: u + y === n.length - 1,
776
- children: ((L = A.columnRender) == null ? void 0 : L.call(A, x)) || /* @__PURE__ */ t.jsx("span", { title: A.label, children: A.label })
777
- },
778
- A.dataIndex + "-individual"
779
- )
780
- );
781
- }
782
- u += j;
783
- } else
784
- i.push(
785
- /* @__PURE__ */ t.jsx(
786
- z,
787
- {
788
- rowSpan: 2,
789
- width: e.width,
790
- minWidth: e.minWidth,
791
- maxWidth: e.maxWidth,
792
- horizontalAlign: e.horizontalAlign,
793
- size: f,
794
- columnsTextSize: k,
795
- withBorder: m,
796
- headerAlign: e.headerAlign,
797
- isTopRow: !0,
798
- isLastColumn: u === n.length - 1,
799
- children: ((s = e.columnRender) == null ? void 0 : s.call(e, x)) || /* @__PURE__ */ t.jsx("span", { title: e.label, children: e.label })
800
- },
801
- e.dataIndex
802
- )
803
- ), u++;
804
- }
805
- return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
806
- /* @__PURE__ */ t.jsx(
807
- Y,
808
- {
809
- isHeader: !0,
810
- size: f,
811
- numRows: 2,
812
- borderRadius: w,
813
- children: i
814
- }
815
- ),
816
- W.length > 0 && /* @__PURE__ */ t.jsx(
817
- Y,
818
- {
819
- isHeader: !0,
820
- size: f,
821
- numRows: 2,
822
- borderRadius: w,
823
- children: W
824
- }
825
- )
826
- ] });
827
- }, [n, S, f, k, O]);
828
- return !x || x.length === 0 ? /* @__PURE__ */ t.jsx(
829
- ie,
830
- {
831
- backgroundColor: V.colors.backgroundColors.colorBackgroundSnow,
832
- borders: !0,
833
- mode: "table",
834
- ...H
835
- }
836
- ) : /* @__PURE__ */ t.jsx(
837
- we,
838
- {
839
- maxHeight: l,
840
- disableMaxHeight: h,
841
- withBorderRadius: I,
842
- ref: g,
843
- borderRadius: w,
844
- isVisible: b,
845
- children: /* @__PURE__ */ t.jsxs(We, { id: r, ref: M, children: [
846
- /* @__PURE__ */ t.jsx("thead", { children: d }),
847
- /* @__PURE__ */ t.jsx("tbody", { style: { width: "100%" }, children: x == null ? void 0 : x.map((i, W, u) => {
848
- const L = C(i);
849
- return /* @__PURE__ */ t.jsx(
850
- Y,
851
- {
852
- isLast: W === u.length - 1,
853
- fit: o,
854
- size: f,
855
- withBorder: m,
856
- isSelected: L === $ && R,
857
- striped: N && W % 2 !== 0,
858
- borderRadius: w,
859
- children: n.map((s, e) => {
860
- var j, F, y, A, _;
861
- return /* @__PURE__ */ t.jsx(
862
- Ie,
863
- {
864
- width: s.width,
865
- minWidth: s.minWidth,
866
- maxWidth: s.maxWidth,
867
- size: f,
868
- isClickable: q(p),
869
- isLastColumn: e === n.length - 1,
870
- onClick: () => {
871
- p && p(i, s, W), R && T(
872
- $ === L ? null : L
873
- );
874
- },
875
- horizontalAlign: s.horizontalAlign,
876
- verticalAlign: s.verticalAlign,
877
- rowPadding: s.rowPadding,
878
- withBorder: m,
879
- isLast: W === u.length - 1,
880
- disabled: (j = s.disable) == null ? void 0 : j.call(
881
- s,
882
- i[s.dataIndex],
883
- i,
884
- W,
885
- u
886
- ),
887
- hasError: (F = s.warn) == null ? void 0 : F.call(
888
- s,
889
- i[s.dataIndex],
890
- i,
891
- W,
892
- u
893
- ),
894
- backgroundColor: (y = s.paint) == null ? void 0 : y.call(
895
- s,
896
- i[s.dataIndex],
897
- i,
898
- W,
899
- u
900
- ),
901
- children: ((A = s.render) == null ? void 0 : A.call(
902
- s,
903
- i[s.dataIndex],
904
- i,
905
- W,
906
- u
907
- )) || /* @__PURE__ */ t.jsx(
908
- ye,
909
- {
910
- title: i[s.dataIndex],
911
- style: (_ = s.rowCss) == null ? void 0 : _.call(s, i),
912
- children: i[s.dataIndex]
913
- }
914
- ) || ""
915
- },
916
- `${L}::${s.dataIndex}`
917
- );
918
- })
919
- },
920
- L
921
- );
922
- }) })
923
- ] })
924
- }
925
- );
926
- }
927
- export {
928
- Fe as C,
929
- Ee as D,
930
- Ue as F,
931
- Ve as M,
932
- _e as S,
933
- Pe as T,
934
- Oe as a,
935
- qe as b,
936
- Je as c
937
- };