@envisiongroup/porygon 1.0.0 → 1.0.2
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 +1 -0
- package/dist/index.js +64 -56
- package/dist/react-components/fields/TagPicker/EFWTagPicker.js +72 -68
- package/dist/react-components/i18n/PorygonI18nProvider.d.ts +3 -2
- package/dist/react-components/i18n/PorygonI18nProvider.js +169 -76
- package/dist/react-components/i18n/defaultLocaleText.d.ts +2 -1
- package/dist/react-components/i18n/defaultLocaleText.js +14 -5
- package/dist/react-components/i18n/index.d.ts +4 -4
- package/dist/react-components/i18n/index.js +14 -12
- package/dist/react-components/i18n/localePresets.js +53 -34
- package/dist/react-components/i18n/porygonI18n.types.d.ts +15 -0
- package/dist/react-components/tables/EFWTable/EFWTable.js +821 -461
- package/dist/react-components/timeline/EFWTimeline/EFWTimeline.d.ts +24 -0
- package/dist/react-components/timeline/EFWTimeline/EFWTimeline.js +392 -0
- package/dist/react-components/timeline/EFWTimeline/EFWTimeline.types.d.ts +208 -0
- package/dist/react-components/timeline/EFWTimeline/EFWTimeline.utils.d.ts +30 -0
- package/dist/react-components/timeline/EFWTimeline/EFWTimeline.utils.js +45 -0
- package/dist/react-components/timeline/EFWTimeline/index.d.ts +3 -0
- package/dist/react-components/timeline/EFWTimeline/index.js +8 -0
- package/package.json +6 -1
|
@@ -18,7 +18,9 @@ import { EFWTableCommandBar as Nr } from "./components/EFWTableCommandBar/EFWTab
|
|
|
18
18
|
import { EFWTableOverlay as _n } from "./components/EFWTableOverlay/EFWTableOverlay.js";
|
|
19
19
|
import { EFWTableHeader as kr } from "./components/EFWTableHeader/EFWTableHeader.js";
|
|
20
20
|
import { EFWTableBody as Lr } from "./components/EFWTableBody/EFWTableBody.js";
|
|
21
|
-
const de = {}, _r = /* @__PURE__ */ new Set(), Wn = [], Be = [], Wr = {}, De = (g) => g, Br = (g) => Object.entries(g).filter(([, p]) => !Fr(p)).map(([p, y]) => ({ id: p, value: y })), Oe = (g) => Object.fromEntries(
|
|
21
|
+
const de = {}, _r = /* @__PURE__ */ new Set(), Wn = [], Be = [], Wr = {}, De = (g) => g, Br = (g) => Object.entries(g).filter(([, p]) => !Fr(p)).map(([p, y]) => ({ id: p, value: y })), Oe = (g) => Object.fromEntries(
|
|
22
|
+
g.map((p) => [p.id, p.value])
|
|
23
|
+
), Bn = (g) => g.map(({ id: p, desc: y }) => ({ id: p, desc: y })), Me = (g) => g.map(({ id: p, desc: y }) => ({ id: p, desc: y })), O = 121, Ae = 40, he = 120, Pe = 2500, Dn = 500, Dr = 20, Or = (g) => {
|
|
22
24
|
switch (g) {
|
|
23
25
|
case "Date":
|
|
24
26
|
return (p, y, a) => {
|
|
@@ -221,29 +223,45 @@ const ls = ({
|
|
|
221
223
|
lt && z === void 0 && console.warn(
|
|
222
224
|
'[EFWTable] La prop "height" es requerida cuando "useVirtualization" está habilitado. La virtualización necesita una altura fija para calcular las filas visibles.'
|
|
223
225
|
);
|
|
224
|
-
const ge = z !== void 0 ? Y ? z - 40 : z : void 0, qe = k ?? (q ? 32 : 44), vt = jr(), Jn = wr(
|
|
226
|
+
const ge = z !== void 0 ? Y ? z - 40 : z : void 0, qe = k ?? (q ? 32 : 44), vt = jr(), Jn = wr(
|
|
227
|
+
y,
|
|
228
|
+
"efw-table",
|
|
229
|
+
vt["efw-table"]
|
|
230
|
+
), K = w(!1), Se = w(
|
|
231
|
+
null
|
|
232
|
+
), we = w(null), Ye = v !== void 0, H = It !== void 0, [Zn, xe] = te(
|
|
225
233
|
() => Xn || { state: "none" }
|
|
226
234
|
), Ne = H ? It : Zn, [Qn, er] = te(() => (M || Wn).map((t) => ({
|
|
227
235
|
...t,
|
|
228
236
|
_rowId: t._rowId || it()
|
|
229
|
-
}))), X = Ye ? v || Wn : Qn, Ct = w(/* @__PURE__ */ new WeakMap()), ke = f(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
237
|
+
}))), X = Ye ? v || Wn : Qn, Ct = w(/* @__PURE__ */ new WeakMap()), ke = f(
|
|
238
|
+
(e, t) => {
|
|
239
|
+
if (e._rowId)
|
|
240
|
+
return String(e._rowId);
|
|
241
|
+
const n = Ct.current.get(e);
|
|
242
|
+
if (n)
|
|
243
|
+
return n;
|
|
244
|
+
const r = it();
|
|
245
|
+
return Ct.current.set(e, r), r;
|
|
246
|
+
},
|
|
247
|
+
[]
|
|
248
|
+
), [L, Ie] = te(() => {
|
|
238
249
|
const e = {};
|
|
239
250
|
return a.forEach((t) => {
|
|
240
251
|
const n = P[t.internalName];
|
|
241
252
|
if (n?.width) {
|
|
242
253
|
const r = n.minWidth ?? he, o = n.maxWidth ?? Pe;
|
|
243
|
-
e[t.internalName] = Math.min(
|
|
254
|
+
e[t.internalName] = Math.min(
|
|
255
|
+
Math.max(n.width ?? 0, r),
|
|
256
|
+
o
|
|
257
|
+
);
|
|
244
258
|
}
|
|
245
259
|
}), e;
|
|
246
|
-
}), Tt = w(P), [J, Ge] = te(
|
|
260
|
+
}), Tt = w(P), [J, Ge] = te(
|
|
261
|
+
() => Bn(Gn ?? [])
|
|
262
|
+
), [Z, Ke] = te(
|
|
263
|
+
[]
|
|
264
|
+
), Et = w(Z);
|
|
247
265
|
Et.current = Z;
|
|
248
266
|
const [Q, zt] = te(0), [tr, nr] = te({}), Xe = w(ne);
|
|
249
267
|
Xe.current = ne;
|
|
@@ -263,7 +281,9 @@ const ls = ({
|
|
|
263
281
|
enableSelection: I,
|
|
264
282
|
items: X,
|
|
265
283
|
getRowId: ke
|
|
266
|
-
}), re = w(null), ue = w(
|
|
284
|
+
}), re = w(null), ue = w(
|
|
285
|
+
null
|
|
286
|
+
), [Je, rr] = te(null), sr = f((e) => {
|
|
267
287
|
re.current = e, rr(e);
|
|
268
288
|
}, []), ee = f(() => {
|
|
269
289
|
if (Qe.current && !be.current) {
|
|
@@ -279,22 +299,28 @@ const ls = ({
|
|
|
279
299
|
top: e.scrollTop,
|
|
280
300
|
left: e.scrollLeft
|
|
281
301
|
};
|
|
282
|
-
}, []), Ze = f(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
const
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
302
|
+
}, []), Ze = f(
|
|
303
|
+
(e, t) => {
|
|
304
|
+
e.scrollTop !== t.top && (e.scrollTop = t.top), e.scrollLeft !== t.left && (e.scrollLeft = t.left);
|
|
305
|
+
},
|
|
306
|
+
[]
|
|
307
|
+
), A = f(
|
|
308
|
+
(e, t, n) => {
|
|
309
|
+
!(n?.animateRows ?? (t === "add" ? Xe.current.addRows : Xe.current.updateRows)) || e.length === 0 || nr((o) => {
|
|
310
|
+
const c = { ...o };
|
|
311
|
+
return e.forEach(({ item: u }, s) => {
|
|
312
|
+
if (!u._rowId)
|
|
313
|
+
return;
|
|
314
|
+
const i = String(u._rowId);
|
|
315
|
+
c[i] = {
|
|
316
|
+
delay: s * Dr,
|
|
317
|
+
token: (c[i]?.token ?? 0) + 1
|
|
318
|
+
};
|
|
319
|
+
}), c;
|
|
320
|
+
});
|
|
321
|
+
},
|
|
322
|
+
[]
|
|
323
|
+
), R = w(X), Le = w(/* @__PURE__ */ new Map()), Qe = w(Ye);
|
|
298
324
|
Qe.current = Ye;
|
|
299
325
|
const be = w(at);
|
|
300
326
|
be.current = at;
|
|
@@ -304,7 +330,9 @@ const ls = ({
|
|
|
304
330
|
Re.current = St;
|
|
305
331
|
const ve = w(wt);
|
|
306
332
|
ve.current = wt;
|
|
307
|
-
const _ = w(
|
|
333
|
+
const _ = w(
|
|
334
|
+
null
|
|
335
|
+
), _t = w(pe);
|
|
308
336
|
_t.current = pe;
|
|
309
337
|
const Wt = w(ut);
|
|
310
338
|
Wt.current = ut;
|
|
@@ -354,7 +382,14 @@ const ls = ({
|
|
|
354
382
|
return I && e.push({
|
|
355
383
|
id: "select",
|
|
356
384
|
header: ({ table: t }) => /* @__PURE__ */ D(Pr, { table: t, dense: q }),
|
|
357
|
-
cell: ({ row: t }) => /* @__PURE__ */ D(
|
|
385
|
+
cell: ({ row: t }) => /* @__PURE__ */ D(
|
|
386
|
+
Hr,
|
|
387
|
+
{
|
|
388
|
+
row: t,
|
|
389
|
+
toggleMultiple: Nt,
|
|
390
|
+
dense: q
|
|
391
|
+
}
|
|
392
|
+
),
|
|
358
393
|
size: Ae,
|
|
359
394
|
minSize: Ae,
|
|
360
395
|
maxSize: Ae,
|
|
@@ -409,7 +444,10 @@ const ls = ({
|
|
|
409
444
|
}), a.forEach((c) => {
|
|
410
445
|
const u = c.internalName, s = P[u], i = e[u];
|
|
411
446
|
if (s?.width !== void 0) {
|
|
412
|
-
const S = s.minWidth ?? he, x = s.maxWidth ?? Pe, l = Math.min(
|
|
447
|
+
const S = s.minWidth ?? he, x = s.maxWidth ?? Pe, l = Math.min(
|
|
448
|
+
Math.max(s.width, S),
|
|
449
|
+
x
|
|
450
|
+
);
|
|
413
451
|
r[u] !== l && (r[u] = l, n = !0);
|
|
414
452
|
} else i?.width !== void 0 && r[u] !== void 0 && (delete r[u], n = !0);
|
|
415
453
|
}), n ? r : t;
|
|
@@ -437,11 +475,17 @@ const ls = ({
|
|
|
437
475
|
onRowSelectionChange: Ft,
|
|
438
476
|
onSortingChange: (e) => {
|
|
439
477
|
const t = typeof e == "function" ? e(J) : e;
|
|
440
|
-
Ge(t), Ee.current && Ee.current(
|
|
478
|
+
Ge(t), Ee.current && Ee.current(
|
|
479
|
+
Me(t),
|
|
480
|
+
_.current
|
|
481
|
+
);
|
|
441
482
|
},
|
|
442
483
|
onColumnFiltersChange: (e) => {
|
|
443
484
|
const t = typeof e == "function" ? e(Et.current) : e;
|
|
444
|
-
Ke(t), ze.current && ze.current(
|
|
485
|
+
Ke(t), ze.current && ze.current(
|
|
486
|
+
Oe(t),
|
|
487
|
+
_.current
|
|
488
|
+
);
|
|
445
489
|
},
|
|
446
490
|
onColumnSizingChange: (e) => {
|
|
447
491
|
Ie((t) => {
|
|
@@ -450,7 +494,10 @@ const ls = ({
|
|
|
450
494
|
const c = B.find((u) => u.id === o);
|
|
451
495
|
if (c) {
|
|
452
496
|
const u = c.minSize || he, s = c.maxSize || Pe;
|
|
453
|
-
K.current ? r[o] = Math.max(n[o], u) : r[o] = Math.min(
|
|
497
|
+
K.current ? r[o] = Math.max(n[o], u) : r[o] = Math.min(
|
|
498
|
+
Math.max(n[o], u),
|
|
499
|
+
s
|
|
500
|
+
);
|
|
454
501
|
}
|
|
455
502
|
}), { ...t, ...r };
|
|
456
503
|
});
|
|
@@ -471,20 +518,23 @@ const ls = ({
|
|
|
471
518
|
ae[t] && e.add(t);
|
|
472
519
|
}), nt.current = e;
|
|
473
520
|
}, [ae]);
|
|
474
|
-
const cr = f(
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
521
|
+
const cr = f(
|
|
522
|
+
(e) => {
|
|
523
|
+
if (Wt.current?.(e), !et.current || _t.current)
|
|
524
|
+
return;
|
|
525
|
+
const t = e.currentTarget, n = Number.isFinite(tt.current) ? Math.max(0, tt.current) : Dn, { scrollTop: r, scrollHeight: o, clientHeight: c } = t, s = o - r - c <= n, i = Bt.current;
|
|
526
|
+
if (Bt.current = o, o > i && !s) {
|
|
527
|
+
Ce.current = !1;
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
if (!s) {
|
|
531
|
+
Ce.current = !1;
|
|
532
|
+
return;
|
|
533
|
+
}
|
|
534
|
+
Ce.current || (Ce.current = !0, Dt.current = o, et.current());
|
|
535
|
+
},
|
|
536
|
+
[]
|
|
537
|
+
), Ht = (e) => {
|
|
488
538
|
const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), o = new Set(
|
|
489
539
|
Object.keys(ae).filter((s) => ae[s])
|
|
490
540
|
), c = e.map(
|
|
@@ -512,244 +562,423 @@ const ls = ({
|
|
|
512
562
|
const u = ke(o, c), s = t.selectedIds.has(u), i = t.selectedRefs.has(o), S = !n && t.selectedIndexes.has(c);
|
|
513
563
|
(s || i || S) && (r[u] = !0);
|
|
514
564
|
}), Ft(r);
|
|
515
|
-
}, b = f(
|
|
516
|
-
|
|
517
|
-
if (
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
565
|
+
}, b = f(
|
|
566
|
+
(e) => {
|
|
567
|
+
if (Qe.current) {
|
|
568
|
+
if (!be.current)
|
|
569
|
+
return ue.current = null, Ot.current || (console.warn(
|
|
570
|
+
"[EFWTable] Modo controlled detectado sin onItemsChange. Las operaciones CRUD locales no se aplicarán."
|
|
571
|
+
), Ot.current = !0), !1;
|
|
572
|
+
const t = R.current, n = typeof e == "function" ? e(t) : e;
|
|
573
|
+
R.current = n;
|
|
574
|
+
const r = Ht(t);
|
|
575
|
+
return nt.current = r.selectedIds, jt(n, r), be.current(n), !0;
|
|
576
|
+
}
|
|
577
|
+
return er((t) => {
|
|
578
|
+
const n = typeof e == "function" ? e(t) : e;
|
|
579
|
+
R.current = n;
|
|
580
|
+
const r = Ht(t);
|
|
581
|
+
return nt.current = r.selectedIds, jt(n, r), be.current?.(n), n;
|
|
582
|
+
}), !0;
|
|
583
|
+
},
|
|
584
|
+
[]
|
|
585
|
+
), Ut = f(() => a, [a]), Vt = f(() => Me(J), [J]), $t = f(() => Me(J)[0] ?? null, [J]), qt = f(() => J.length > 0, [J]), Yt = f((e) => {
|
|
531
586
|
const t = Bn(e);
|
|
532
|
-
Ge(t), Ee.current?.(
|
|
587
|
+
Ge(t), Ee.current?.(
|
|
588
|
+
Me(t),
|
|
589
|
+
_.current
|
|
590
|
+
);
|
|
533
591
|
}, []), Gt = f(() => {
|
|
534
592
|
const e = [];
|
|
535
|
-
Ge(e), Ee.current?.(
|
|
593
|
+
Ge(e), Ee.current?.(
|
|
594
|
+
Me(e),
|
|
595
|
+
_.current
|
|
596
|
+
);
|
|
536
597
|
}, []), Kt = f(() => a.filter(
|
|
537
598
|
(e) => e.typeAsString !== "Attachments" && P?.[e.internalName]?.filterable !== !1
|
|
538
599
|
), [a, P]), Xt = f(() => Oe(Z), [Z]), Jt = f(() => Z.length > 0, [Z]), Zt = f((e) => {
|
|
539
600
|
const t = Br(e);
|
|
540
|
-
Ke(t), ze.current?.(
|
|
601
|
+
Ke(t), ze.current?.(
|
|
602
|
+
Oe(t),
|
|
603
|
+
_.current
|
|
604
|
+
);
|
|
541
605
|
}, []), Qt = f(() => {
|
|
542
606
|
const e = [];
|
|
543
|
-
Ke(e), ze.current?.(
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
607
|
+
Ke(e), ze.current?.(
|
|
608
|
+
Oe(e),
|
|
609
|
+
_.current
|
|
610
|
+
);
|
|
611
|
+
}, []), en = f(
|
|
612
|
+
async (e, t = {}) => {
|
|
613
|
+
const { position: n = "end" } = t;
|
|
614
|
+
try {
|
|
615
|
+
if (ye.current) {
|
|
616
|
+
const r = We(e), o = await ye.current(
|
|
617
|
+
[r],
|
|
618
|
+
_.current
|
|
619
|
+
);
|
|
620
|
+
if (o) {
|
|
621
|
+
if (o.successful.length > 0) {
|
|
622
|
+
const i = R.current.length, S = o.successful.map(
|
|
623
|
+
(m) => Ln(m.item)
|
|
624
|
+
);
|
|
625
|
+
if (ee(), !b(
|
|
626
|
+
(m) => fe(m, S, n)
|
|
627
|
+
))
|
|
628
|
+
return {
|
|
629
|
+
successful: [],
|
|
630
|
+
failed: S.map((m, h) => ({
|
|
631
|
+
index: h,
|
|
632
|
+
item: m,
|
|
633
|
+
error: "Controlled mode without onItemsChange"
|
|
634
|
+
}))
|
|
635
|
+
};
|
|
636
|
+
const l = me(
|
|
637
|
+
S,
|
|
638
|
+
i,
|
|
639
|
+
n
|
|
640
|
+
);
|
|
641
|
+
return A(l, "add", t), {
|
|
642
|
+
...o,
|
|
643
|
+
successful: l
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
return { ...o, successful: [] };
|
|
561
647
|
}
|
|
562
|
-
|
|
648
|
+
const c = R.current.length;
|
|
649
|
+
if (ee(), !b(
|
|
650
|
+
(i) => fe(i, [r], n)
|
|
651
|
+
))
|
|
652
|
+
return {
|
|
653
|
+
successful: [],
|
|
654
|
+
failed: [
|
|
655
|
+
{
|
|
656
|
+
index: -1,
|
|
657
|
+
item: r,
|
|
658
|
+
error: "Controlled mode without onItemsChange"
|
|
659
|
+
}
|
|
660
|
+
]
|
|
661
|
+
};
|
|
662
|
+
const s = me(
|
|
663
|
+
[r],
|
|
664
|
+
c,
|
|
665
|
+
n
|
|
666
|
+
);
|
|
667
|
+
return A(s, "add", t), {
|
|
668
|
+
successful: s,
|
|
669
|
+
failed: []
|
|
670
|
+
};
|
|
671
|
+
} else {
|
|
672
|
+
const r = We(e), o = R.current.length;
|
|
673
|
+
if (ee(), !b(
|
|
674
|
+
(s) => fe(s, [r], n)
|
|
675
|
+
))
|
|
676
|
+
return {
|
|
677
|
+
successful: [],
|
|
678
|
+
failed: [
|
|
679
|
+
{
|
|
680
|
+
index: -1,
|
|
681
|
+
item: r,
|
|
682
|
+
error: "Controlled mode without onItemsChange"
|
|
683
|
+
}
|
|
684
|
+
]
|
|
685
|
+
};
|
|
686
|
+
const u = me(
|
|
687
|
+
[r],
|
|
688
|
+
o,
|
|
689
|
+
n
|
|
690
|
+
);
|
|
691
|
+
return A(u, "add", t), {
|
|
692
|
+
successful: u,
|
|
693
|
+
failed: []
|
|
694
|
+
};
|
|
563
695
|
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
696
|
+
} catch (r) {
|
|
697
|
+
return {
|
|
698
|
+
successful: [],
|
|
699
|
+
failed: [
|
|
700
|
+
{
|
|
701
|
+
index: -1,
|
|
702
|
+
item: e,
|
|
703
|
+
error: String(r)
|
|
704
|
+
}
|
|
705
|
+
]
|
|
571
706
|
};
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
707
|
+
}
|
|
708
|
+
},
|
|
709
|
+
[b, ee, A]
|
|
710
|
+
), tn = f(
|
|
711
|
+
async (e, t = {}) => {
|
|
712
|
+
const { position: n = "end" } = t;
|
|
713
|
+
if (e.length === 0)
|
|
714
|
+
return {
|
|
715
|
+
successful: [],
|
|
579
716
|
failed: []
|
|
580
717
|
};
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
718
|
+
try {
|
|
719
|
+
if (ye.current) {
|
|
720
|
+
const r = e.map(
|
|
721
|
+
(i) => We(i)
|
|
722
|
+
), o = await ye.current(
|
|
723
|
+
r,
|
|
724
|
+
_.current
|
|
725
|
+
);
|
|
726
|
+
if (o) {
|
|
727
|
+
if (o.successful.length > 0) {
|
|
728
|
+
const i = R.current.length, S = o.successful.map(
|
|
729
|
+
(m) => Ln(m.item)
|
|
730
|
+
);
|
|
731
|
+
if (ee(), !b(
|
|
732
|
+
(m) => fe(m, S, n)
|
|
733
|
+
))
|
|
734
|
+
return {
|
|
735
|
+
successful: [],
|
|
736
|
+
failed: S.map((m, h) => ({
|
|
737
|
+
index: h,
|
|
738
|
+
item: m,
|
|
739
|
+
error: "Controlled mode without onItemsChange"
|
|
740
|
+
}))
|
|
741
|
+
};
|
|
742
|
+
const l = me(
|
|
743
|
+
S,
|
|
744
|
+
i,
|
|
745
|
+
n
|
|
746
|
+
);
|
|
747
|
+
return A(l, "add", t), {
|
|
748
|
+
...o,
|
|
749
|
+
successful: l
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
return { ...o, successful: [] };
|
|
610
753
|
}
|
|
611
|
-
|
|
754
|
+
const c = R.current.length;
|
|
755
|
+
if (ee(), !b(
|
|
756
|
+
(i) => fe(i, r, n)
|
|
757
|
+
))
|
|
758
|
+
return {
|
|
759
|
+
successful: [],
|
|
760
|
+
failed: r.map((i, S) => ({
|
|
761
|
+
index: S,
|
|
762
|
+
item: i,
|
|
763
|
+
error: "Controlled mode without onItemsChange"
|
|
764
|
+
}))
|
|
765
|
+
};
|
|
766
|
+
const s = me(
|
|
767
|
+
r,
|
|
768
|
+
c,
|
|
769
|
+
n
|
|
770
|
+
);
|
|
771
|
+
return A(s, "add", t), {
|
|
772
|
+
successful: s,
|
|
773
|
+
failed: []
|
|
774
|
+
};
|
|
775
|
+
} else {
|
|
776
|
+
const r = e.map(
|
|
777
|
+
(s) => We(s)
|
|
778
|
+
), o = R.current.length;
|
|
779
|
+
if (ee(), !b(
|
|
780
|
+
(s) => fe(s, r, n)
|
|
781
|
+
))
|
|
782
|
+
return {
|
|
783
|
+
successful: [],
|
|
784
|
+
failed: r.map((s, i) => ({
|
|
785
|
+
index: i,
|
|
786
|
+
item: s,
|
|
787
|
+
error: "Controlled mode without onItemsChange"
|
|
788
|
+
}))
|
|
789
|
+
};
|
|
790
|
+
const u = me(
|
|
791
|
+
r,
|
|
792
|
+
o,
|
|
793
|
+
n
|
|
794
|
+
);
|
|
795
|
+
return A(u, "add", t), {
|
|
796
|
+
successful: u,
|
|
797
|
+
failed: []
|
|
798
|
+
};
|
|
612
799
|
}
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
} else {
|
|
622
|
-
const r = e.map((s) => We(s)), o = R.current.length;
|
|
623
|
-
if (ee(), !b((s) => fe(s, r, n)))
|
|
624
|
-
return { successful: [], failed: r.map((s, i) => ({ index: i, item: s, error: "Controlled mode without onItemsChange" })) };
|
|
625
|
-
const u = me(r, o, n);
|
|
626
|
-
return A(u, "add", t), {
|
|
627
|
-
successful: u,
|
|
628
|
-
failed: []
|
|
800
|
+
} catch (r) {
|
|
801
|
+
return {
|
|
802
|
+
successful: [],
|
|
803
|
+
failed: e.map((o, c) => ({
|
|
804
|
+
index: c,
|
|
805
|
+
item: o,
|
|
806
|
+
error: String(r)
|
|
807
|
+
}))
|
|
629
808
|
};
|
|
630
809
|
}
|
|
631
|
-
}
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
h,
|
|
658
|
-
|
|
659
|
-
h
|
|
810
|
+
},
|
|
811
|
+
[b, ee, A]
|
|
812
|
+
), nn = f(
|
|
813
|
+
async (e, t, n = {}) => {
|
|
814
|
+
const r = R.current;
|
|
815
|
+
if (e < 0 || e >= r.length)
|
|
816
|
+
return {
|
|
817
|
+
successful: [],
|
|
818
|
+
failed: [{ index: e, item: t, error: "Invalid index" }]
|
|
819
|
+
};
|
|
820
|
+
try {
|
|
821
|
+
if (Re.current) {
|
|
822
|
+
const s = await Re.current(
|
|
823
|
+
[{ index: e, item: t }],
|
|
824
|
+
_.current
|
|
825
|
+
);
|
|
826
|
+
if (s) {
|
|
827
|
+
const S = s.successful.filter(
|
|
828
|
+
({ index: h }) => h >= 0 && h < r.length
|
|
829
|
+
).map(({ index: h, item: E }) => {
|
|
830
|
+
const V = sn(
|
|
831
|
+
r,
|
|
832
|
+
h,
|
|
833
|
+
E,
|
|
834
|
+
h === e ? t : void 0
|
|
835
|
+
);
|
|
836
|
+
return V ? { index: h, item: V } : null;
|
|
837
|
+
}).filter(
|
|
838
|
+
(h) => h !== null
|
|
660
839
|
);
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
840
|
+
if (S.length) {
|
|
841
|
+
if (!b((E) => {
|
|
842
|
+
const V = [...E];
|
|
843
|
+
return S.forEach(({ index: d, item: N }) => {
|
|
844
|
+
V[d] = N;
|
|
845
|
+
}), V;
|
|
846
|
+
}))
|
|
847
|
+
return {
|
|
848
|
+
successful: [],
|
|
849
|
+
failed: S.map(({ index: E, item: V }) => ({
|
|
850
|
+
index: E,
|
|
851
|
+
item: V,
|
|
852
|
+
error: "Controlled mode without onItemsChange"
|
|
853
|
+
}))
|
|
854
|
+
};
|
|
855
|
+
A(S, "update", n);
|
|
856
|
+
}
|
|
857
|
+
const x = new Set(
|
|
858
|
+
s.failed.map((h) => h.index)
|
|
859
|
+
), l = [...s.failed];
|
|
860
|
+
return s.successful.filter(
|
|
861
|
+
({ index: h }) => h < 0 || h >= r.length
|
|
862
|
+
).map(({ index: h, item: E }) => ({
|
|
863
|
+
index: h,
|
|
864
|
+
item: E,
|
|
865
|
+
error: "Invalid index"
|
|
866
|
+
})).forEach((h) => {
|
|
867
|
+
x.has(h.index) || l.push(h);
|
|
868
|
+
}), { successful: S, failed: l };
|
|
672
869
|
}
|
|
673
|
-
const x = new Set(s.failed.map((h) => h.index)), l = [...s.failed];
|
|
674
|
-
return s.successful.filter(({ index: h }) => h < 0 || h >= r.length).map(({ index: h, item: E }) => ({
|
|
675
|
-
index: h,
|
|
676
|
-
item: E,
|
|
677
|
-
error: "Invalid index"
|
|
678
|
-
})).forEach((h) => {
|
|
679
|
-
x.has(h.index) || l.push(h);
|
|
680
|
-
}), { successful: S, failed: l };
|
|
681
870
|
}
|
|
871
|
+
let o;
|
|
872
|
+
if (!b((s) => {
|
|
873
|
+
o = { ...s[e], ...t };
|
|
874
|
+
const i = [...s];
|
|
875
|
+
return i[e] = o, i;
|
|
876
|
+
}))
|
|
877
|
+
return {
|
|
878
|
+
successful: [],
|
|
879
|
+
failed: [
|
|
880
|
+
{
|
|
881
|
+
index: e,
|
|
882
|
+
item: t,
|
|
883
|
+
error: "Controlled mode without onItemsChange"
|
|
884
|
+
}
|
|
885
|
+
]
|
|
886
|
+
};
|
|
887
|
+
const u = [{ index: e, item: o }];
|
|
888
|
+
return A(u, "update", n), { successful: u, failed: [] };
|
|
889
|
+
} catch (o) {
|
|
890
|
+
return {
|
|
891
|
+
successful: [],
|
|
892
|
+
failed: [{ index: e, item: t, error: String(o) }]
|
|
893
|
+
};
|
|
682
894
|
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
}))
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
u.get(d)
|
|
895
|
+
},
|
|
896
|
+
[b, A]
|
|
897
|
+
), rn = f(
|
|
898
|
+
async (e, t = {}) => {
|
|
899
|
+
if (!e.length) return { successful: [], failed: [] };
|
|
900
|
+
const n = R.current, r = (s) => s >= 0 && s < n.length, o = e.filter(({ index: s }) => !r(s)).map(({ index: s, item: i }) => ({ index: s, item: i, error: "Invalid index" })), c = e.filter(
|
|
901
|
+
({ index: s }) => r(s)
|
|
902
|
+
), u = /* @__PURE__ */ new Map();
|
|
903
|
+
c.forEach(({ index: s, item: i }) => {
|
|
904
|
+
u.set(s, i);
|
|
905
|
+
});
|
|
906
|
+
try {
|
|
907
|
+
if (Re.current) {
|
|
908
|
+
const x = await Re.current(
|
|
909
|
+
e,
|
|
910
|
+
_.current
|
|
911
|
+
);
|
|
912
|
+
if (x) {
|
|
913
|
+
const m = x.successful.filter(
|
|
914
|
+
({ index: d }) => r(d)
|
|
915
|
+
).map(({ index: d, item: N }) => {
|
|
916
|
+
const F = sn(
|
|
917
|
+
n,
|
|
918
|
+
d,
|
|
919
|
+
N,
|
|
920
|
+
u.get(d)
|
|
921
|
+
);
|
|
922
|
+
return F ? { index: d, item: F } : null;
|
|
923
|
+
}).filter(
|
|
924
|
+
(d) => d !== null
|
|
714
925
|
);
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
926
|
+
if (m.length) {
|
|
927
|
+
if (!b((N) => {
|
|
928
|
+
const F = [...N];
|
|
929
|
+
return m.forEach(({ index: Nn, item: ot }) => {
|
|
930
|
+
F[Nn] = ot;
|
|
931
|
+
}), F;
|
|
932
|
+
}))
|
|
933
|
+
return {
|
|
934
|
+
successful: [],
|
|
935
|
+
failed: m.map(({ index: N, item: F }) => ({
|
|
936
|
+
index: N,
|
|
937
|
+
item: F,
|
|
938
|
+
error: "Controlled mode without onItemsChange"
|
|
939
|
+
}))
|
|
940
|
+
};
|
|
941
|
+
A(m, "update", t);
|
|
942
|
+
}
|
|
943
|
+
const h = new Set(x.failed.map((d) => d.index)), E = [...x.failed];
|
|
944
|
+
return o.forEach((d) => {
|
|
945
|
+
h.has(d.index) || E.push(d);
|
|
946
|
+
}), x.successful.filter(({ index: d }) => !r(d)).map(({ index: d, item: N }) => ({
|
|
947
|
+
index: d,
|
|
948
|
+
item: N,
|
|
949
|
+
error: "Invalid index"
|
|
950
|
+
})).forEach((d) => {
|
|
951
|
+
h.has(d.index) || E.push(d);
|
|
952
|
+
}), { successful: m, failed: E };
|
|
726
953
|
}
|
|
727
|
-
const h = new Set(x.failed.map((d) => d.index)), E = [...x.failed];
|
|
728
|
-
return o.forEach((d) => {
|
|
729
|
-
h.has(d.index) || E.push(d);
|
|
730
|
-
}), x.successful.filter(({ index: d }) => !r(d)).map(({ index: d, item: N }) => ({ index: d, item: N, error: "Invalid index" })).forEach((d) => {
|
|
731
|
-
h.has(d.index) || E.push(d);
|
|
732
|
-
}), { successful: m, failed: E };
|
|
733
954
|
}
|
|
955
|
+
const s = [], i = [...o];
|
|
956
|
+
return b((x) => {
|
|
957
|
+
const l = [...x];
|
|
958
|
+
return c.forEach(({ index: m, item: h }) => {
|
|
959
|
+
l[m] = { ...l[m], ...h }, s.push({ index: m, item: l[m] });
|
|
960
|
+
}), l;
|
|
961
|
+
}) ? (A(s, "update", t), { successful: s, failed: i }) : {
|
|
962
|
+
successful: [],
|
|
963
|
+
failed: c.map(({ index: x, item: l }) => ({
|
|
964
|
+
index: x,
|
|
965
|
+
item: l,
|
|
966
|
+
error: "Controlled mode without onItemsChange"
|
|
967
|
+
}))
|
|
968
|
+
};
|
|
969
|
+
} catch (s) {
|
|
970
|
+
return {
|
|
971
|
+
successful: [],
|
|
972
|
+
failed: e.map(({ index: i, item: S }) => ({
|
|
973
|
+
index: i,
|
|
974
|
+
item: S,
|
|
975
|
+
error: String(s)
|
|
976
|
+
}))
|
|
977
|
+
};
|
|
734
978
|
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
return c.forEach(({ index: m, item: h }) => {
|
|
739
|
-
l[m] = { ...l[m], ...h }, s.push({ index: m, item: l[m] });
|
|
740
|
-
}), l;
|
|
741
|
-
}) ? (A(s, "update", t), { successful: s, failed: i }) : { successful: [], failed: c.map(({ index: x, item: l }) => ({ index: x, item: l, error: "Controlled mode without onItemsChange" })) };
|
|
742
|
-
} catch (s) {
|
|
743
|
-
return {
|
|
744
|
-
successful: [],
|
|
745
|
-
failed: e.map(({ index: i, item: S }) => ({
|
|
746
|
-
index: i,
|
|
747
|
-
item: S,
|
|
748
|
-
error: String(s)
|
|
749
|
-
}))
|
|
750
|
-
};
|
|
751
|
-
}
|
|
752
|
-
}, [b, A]), sn = (e, t, n, r) => {
|
|
979
|
+
},
|
|
980
|
+
[b, A]
|
|
981
|
+
), sn = (e, t, n, r) => {
|
|
753
982
|
const o = e[t];
|
|
754
983
|
if (!o)
|
|
755
984
|
return null;
|
|
@@ -766,208 +995,301 @@ const ls = ({
|
|
|
766
995
|
...n,
|
|
767
996
|
_rowId: n._rowId ?? r._rowId
|
|
768
997
|
} : r : null;
|
|
769
|
-
}, cn = f(
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
)
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
998
|
+
}, cn = f(
|
|
999
|
+
async (e) => {
|
|
1000
|
+
const t = R.current;
|
|
1001
|
+
if (e < 0 || e >= t.length)
|
|
1002
|
+
return {
|
|
1003
|
+
successful: [],
|
|
1004
|
+
failed: [{ index: e, error: "Invalid index" }]
|
|
1005
|
+
};
|
|
1006
|
+
try {
|
|
1007
|
+
if (ve.current) {
|
|
1008
|
+
const o = t[e], c = await ve.current(
|
|
1009
|
+
[{ index: e, item: o }],
|
|
1010
|
+
_.current
|
|
1011
|
+
);
|
|
1012
|
+
if (c) {
|
|
1013
|
+
const s = c.successful.filter(
|
|
1014
|
+
({ index: l }) => l >= 0 && l < t.length
|
|
1015
|
+
).map(({ index: l, item: m }) => {
|
|
1016
|
+
const h = on(
|
|
1017
|
+
t,
|
|
1018
|
+
l,
|
|
1019
|
+
m
|
|
1020
|
+
);
|
|
1021
|
+
return h ? { index: l, item: h } : null;
|
|
1022
|
+
}).filter(
|
|
1023
|
+
(l) => l !== null
|
|
1024
|
+
);
|
|
1025
|
+
if (s.length && !b(
|
|
1026
|
+
(m) => m.filter((h, E) => E !== e)
|
|
1027
|
+
))
|
|
1028
|
+
return {
|
|
1029
|
+
successful: [],
|
|
1030
|
+
failed: [
|
|
1031
|
+
{ index: e, error: "Controlled mode without onItemsChange" }
|
|
1032
|
+
]
|
|
1033
|
+
};
|
|
1034
|
+
const i = new Set(
|
|
1035
|
+
c.failed.map((l) => l.index)
|
|
1036
|
+
), S = [...c.failed];
|
|
1037
|
+
return c.successful.filter(
|
|
1038
|
+
({ index: l }) => l < 0 || l >= t.length
|
|
1039
|
+
).map(({ index: l, item: m }) => ({
|
|
1040
|
+
index: l,
|
|
1041
|
+
item: m,
|
|
1042
|
+
error: "Invalid index"
|
|
1043
|
+
})).forEach((l) => {
|
|
1044
|
+
i.has(l.index) || S.push(l);
|
|
1045
|
+
}), { successful: s, failed: S };
|
|
1046
|
+
}
|
|
796
1047
|
}
|
|
1048
|
+
let n;
|
|
1049
|
+
return b((o) => (n = o[e], o.filter((c, u) => u !== e))) ? { successful: [{ index: e, item: n }], failed: [] } : {
|
|
1050
|
+
successful: [],
|
|
1051
|
+
failed: [{ index: e, error: "Controlled mode without onItemsChange" }]
|
|
1052
|
+
};
|
|
1053
|
+
} catch (n) {
|
|
1054
|
+
return {
|
|
1055
|
+
successful: [],
|
|
1056
|
+
failed: [{ index: e, error: String(n) }]
|
|
1057
|
+
};
|
|
797
1058
|
}
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
1059
|
+
},
|
|
1060
|
+
[b]
|
|
1061
|
+
), ln = f(
|
|
1062
|
+
async (e) => {
|
|
1063
|
+
if (!e.length) return { successful: [], failed: [] };
|
|
1064
|
+
const t = R.current, n = Array.from(new Set(e)), { validIndexes: r, invalidFailures: o } = n.reduce(
|
|
1065
|
+
(s, i) => (i >= 0 && i < t.length ? s.validIndexes.push(i) : s.invalidFailures.push({ index: i, error: "Invalid index" }), s),
|
|
1066
|
+
{
|
|
1067
|
+
validIndexes: [],
|
|
1068
|
+
invalidFailures: []
|
|
1069
|
+
}
|
|
1070
|
+
), c = n.map((s) => ({
|
|
1071
|
+
index: s,
|
|
1072
|
+
item: t[s]
|
|
1073
|
+
})), u = new Set(r);
|
|
1074
|
+
try {
|
|
1075
|
+
if (ve.current) {
|
|
1076
|
+
const x = await ve.current(
|
|
1077
|
+
c,
|
|
1078
|
+
_.current
|
|
1079
|
+
);
|
|
1080
|
+
if (x) {
|
|
1081
|
+
const l = x.successful.filter(
|
|
1082
|
+
({ index: d }) => u.has(d)
|
|
1083
|
+
), m = l.map(({ index: d, item: N }) => {
|
|
1084
|
+
const F = on(
|
|
1085
|
+
t,
|
|
1086
|
+
d,
|
|
1087
|
+
N
|
|
1088
|
+
);
|
|
1089
|
+
return F ? { index: d, item: F } : null;
|
|
1090
|
+
}).filter(
|
|
1091
|
+
(d) => d !== null
|
|
1092
|
+
);
|
|
1093
|
+
if (l.length) {
|
|
1094
|
+
const d = new Set(m.map((F) => F.index));
|
|
1095
|
+
if (!b(
|
|
1096
|
+
(F) => F.filter((Nn, ot) => !d.has(ot))
|
|
1097
|
+
))
|
|
1098
|
+
return {
|
|
1099
|
+
successful: [],
|
|
1100
|
+
failed: m.map(({ index: F }) => ({
|
|
1101
|
+
index: F,
|
|
1102
|
+
error: "Controlled mode without onItemsChange"
|
|
1103
|
+
}))
|
|
1104
|
+
};
|
|
1105
|
+
}
|
|
1106
|
+
const h = new Set(x.failed.map((d) => d.index)), E = [...x.failed];
|
|
1107
|
+
return o.forEach((d) => {
|
|
1108
|
+
h.has(d.index) || E.push(d);
|
|
1109
|
+
}), x.successful.filter(({ index: d }) => !u.has(d)).map(({ index: d, item: N }) => ({
|
|
1110
|
+
index: d,
|
|
1111
|
+
item: N,
|
|
1112
|
+
error: "Invalid index"
|
|
1113
|
+
})).forEach((d) => {
|
|
1114
|
+
h.has(d.index) || E.push(d);
|
|
1115
|
+
}), { successful: m, failed: E };
|
|
824
1116
|
}
|
|
825
|
-
const h = new Set(x.failed.map((d) => d.index)), E = [...x.failed];
|
|
826
|
-
return o.forEach((d) => {
|
|
827
|
-
h.has(d.index) || E.push(d);
|
|
828
|
-
}), x.successful.filter(({ index: d }) => !u.has(d)).map(({ index: d, item: N }) => ({ index: d, item: N, error: "Invalid index" })).forEach((d) => {
|
|
829
|
-
h.has(d.index) || E.push(d);
|
|
830
|
-
}), { successful: m, failed: E };
|
|
831
1117
|
}
|
|
1118
|
+
const s = new Set(r), i = [];
|
|
1119
|
+
return b((x) => {
|
|
1120
|
+
const l = [];
|
|
1121
|
+
return x.forEach((m, h) => {
|
|
1122
|
+
s.has(h) ? i.push({ index: h, item: m }) : l.push(m);
|
|
1123
|
+
}), l;
|
|
1124
|
+
}) ? { successful: i, failed: o } : {
|
|
1125
|
+
successful: [],
|
|
1126
|
+
failed: r.map((x) => ({
|
|
1127
|
+
index: x,
|
|
1128
|
+
error: "Controlled mode without onItemsChange"
|
|
1129
|
+
}))
|
|
1130
|
+
};
|
|
1131
|
+
} catch (s) {
|
|
1132
|
+
return {
|
|
1133
|
+
successful: [],
|
|
1134
|
+
failed: n.map((i) => ({
|
|
1135
|
+
index: i,
|
|
1136
|
+
error: String(s)
|
|
1137
|
+
}))
|
|
1138
|
+
};
|
|
832
1139
|
}
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
return x.forEach((m, h) => {
|
|
837
|
-
s.has(h) ? i.push({ index: h, item: m }) : l.push(m);
|
|
838
|
-
}), l;
|
|
839
|
-
}) ? { successful: i, failed: o } : { successful: [], failed: r.map((x) => ({ index: x, error: "Controlled mode without onItemsChange" })) };
|
|
840
|
-
} catch (s) {
|
|
841
|
-
return {
|
|
842
|
-
successful: [],
|
|
843
|
-
failed: n.map((i) => ({ index: i, error: String(s) }))
|
|
844
|
-
};
|
|
845
|
-
}
|
|
846
|
-
}, [b]), an = f((e) => {
|
|
1140
|
+
},
|
|
1141
|
+
[b]
|
|
1142
|
+
), an = f((e) => {
|
|
847
1143
|
const t = Le.current.get(String(e));
|
|
848
1144
|
return t !== void 0 ? R.current[t] : void 0;
|
|
849
|
-
}, []), un = f((e) => R.current[e], []), dn = f(
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
1145
|
+
}, []), un = f((e) => R.current[e], []), dn = f(
|
|
1146
|
+
(e) => {
|
|
1147
|
+
b(
|
|
1148
|
+
e.map((t) => ({ ...t, _rowId: t._rowId ?? it() }))
|
|
1149
|
+
);
|
|
1150
|
+
},
|
|
1151
|
+
[b]
|
|
1152
|
+
), fn = f(() => {
|
|
854
1153
|
b([]);
|
|
855
|
-
}, [b]), mn = f((e) => Le.current.get(String(e)) ?? -1, []), hn = f((e) => Le.current.has(String(e)), []), pn = f(() => R.current.length, []), gn = f(() => [...R.current], []), Sn = f(() => kt(R.current), [kt]), wn = f(() => Lt(R.current), [Lt]), xn = f(
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
state: "
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1154
|
+
}, [b]), mn = f((e) => Le.current.get(String(e)) ?? -1, []), hn = f((e) => Le.current.has(String(e)), []), pn = f(() => R.current.length, []), gn = f(() => [...R.current], []), Sn = f(() => kt(R.current), [kt]), wn = f(() => Lt(R.current), [Lt]), xn = f(
|
|
1155
|
+
(e, t) => {
|
|
1156
|
+
const n = e ? {
|
|
1157
|
+
state: "loading",
|
|
1158
|
+
message: t?.title,
|
|
1159
|
+
description: t?.description
|
|
1160
|
+
} : { state: "none" };
|
|
1161
|
+
H || xe(n), j?.(n);
|
|
1162
|
+
},
|
|
1163
|
+
[H, j]
|
|
1164
|
+
), In = f(
|
|
1165
|
+
(e, t) => {
|
|
1166
|
+
const n = e ? {
|
|
1167
|
+
state: "error",
|
|
1168
|
+
message: t?.title,
|
|
1169
|
+
description: t?.description,
|
|
1170
|
+
onRetry: t?.onRetry,
|
|
1171
|
+
retryButtonText: t?.retryButtonText
|
|
1172
|
+
} : { state: "none" };
|
|
1173
|
+
H || xe(n), j?.(n);
|
|
1174
|
+
},
|
|
1175
|
+
[H, j]
|
|
1176
|
+
), bn = f(
|
|
1177
|
+
(e, t) => {
|
|
1178
|
+
const n = e ? {
|
|
1179
|
+
state: "partial-loading",
|
|
1180
|
+
message: t?.title,
|
|
1181
|
+
description: t?.description
|
|
1182
|
+
} : { state: "none" };
|
|
1183
|
+
H || xe(n), j?.(n);
|
|
1184
|
+
},
|
|
1185
|
+
[H, j]
|
|
1186
|
+
), yn = f(
|
|
1187
|
+
(e, t) => {
|
|
1188
|
+
const n = e ? {
|
|
1189
|
+
state: "empty",
|
|
1190
|
+
message: t?.title,
|
|
1191
|
+
description: t?.description,
|
|
1192
|
+
imageUrl: t?.imageUrl
|
|
1193
|
+
} : { state: "none" };
|
|
1194
|
+
H || xe(n), j?.(n);
|
|
1195
|
+
},
|
|
1196
|
+
[H, j]
|
|
1197
|
+
), Rn = f(() => {
|
|
887
1198
|
const e = { state: "none" };
|
|
888
1199
|
H || xe(e), j?.(e);
|
|
889
|
-
}, [H, j]), vn = f(() => Ne.state, [Ne.state]), Fe = se(
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
1200
|
+
}, [H, j]), vn = f(() => Ne.state, [Ne.state]), Fe = se(
|
|
1201
|
+
() => ({
|
|
1202
|
+
getFields: Ut,
|
|
1203
|
+
addItem: en,
|
|
1204
|
+
addItems: tn,
|
|
1205
|
+
updateItem: nn,
|
|
1206
|
+
updateItems: rn,
|
|
1207
|
+
deleteItem: cn,
|
|
1208
|
+
deleteItems: ln,
|
|
1209
|
+
getItem: an,
|
|
1210
|
+
getItemByIndex: un,
|
|
1211
|
+
getItems: gn,
|
|
1212
|
+
getItemsCount: pn,
|
|
1213
|
+
itemExists: hn,
|
|
1214
|
+
getItemIndex: mn,
|
|
1215
|
+
replaceAllItems: dn,
|
|
1216
|
+
clearItems: fn,
|
|
1217
|
+
deselectAllRows: Mt,
|
|
1218
|
+
getSelectedItems: Sn,
|
|
1219
|
+
getSelectedRows: wn,
|
|
1220
|
+
// Overlay methods
|
|
1221
|
+
setLoading: xn,
|
|
1222
|
+
setError: In,
|
|
1223
|
+
setPartialLoading: bn,
|
|
1224
|
+
setEmpty: yn,
|
|
1225
|
+
clearOverlay: Rn,
|
|
1226
|
+
getOverlayState: vn,
|
|
1227
|
+
// Sorting methods
|
|
1228
|
+
getSortingState: Vt,
|
|
1229
|
+
getPrimarySortedColumn: $t,
|
|
1230
|
+
hasActiveSorting: qt,
|
|
1231
|
+
setSortingState: Yt,
|
|
1232
|
+
clearSorting: Gt,
|
|
1233
|
+
// Filter methods
|
|
1234
|
+
getFilterableFields: Kt,
|
|
1235
|
+
getColumnFilters: Xt,
|
|
1236
|
+
hasActiveFilters: Jt,
|
|
1237
|
+
setColumnFilters: Zt,
|
|
1238
|
+
clearColumnFilters: Qt
|
|
1239
|
+
}),
|
|
1240
|
+
[
|
|
1241
|
+
en,
|
|
1242
|
+
tn,
|
|
1243
|
+
fn,
|
|
1244
|
+
Rn,
|
|
1245
|
+
cn,
|
|
1246
|
+
ln,
|
|
1247
|
+
Mt,
|
|
1248
|
+
a,
|
|
1249
|
+
Ut,
|
|
1250
|
+
an,
|
|
1251
|
+
un,
|
|
1252
|
+
mn,
|
|
1253
|
+
gn,
|
|
1254
|
+
pn,
|
|
1255
|
+
vn,
|
|
1256
|
+
Sn,
|
|
1257
|
+
wn,
|
|
1258
|
+
Vt,
|
|
1259
|
+
$t,
|
|
1260
|
+
qt,
|
|
1261
|
+
hn,
|
|
1262
|
+
dn,
|
|
1263
|
+
Gt,
|
|
1264
|
+
yn,
|
|
1265
|
+
In,
|
|
1266
|
+
xn,
|
|
1267
|
+
Yt,
|
|
1268
|
+
bn,
|
|
1269
|
+
nn,
|
|
1270
|
+
rn,
|
|
1271
|
+
// Filter methods
|
|
1272
|
+
Qt,
|
|
1273
|
+
Xt,
|
|
1274
|
+
Kt,
|
|
1275
|
+
Jt,
|
|
1276
|
+
Zt
|
|
1277
|
+
]
|
|
1278
|
+
);
|
|
1279
|
+
_.current = Fe, fr.useImperativeHandle(jn, () => Fe, [
|
|
1280
|
+
Fe
|
|
964
1281
|
]);
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
1282
|
+
const ir = f(
|
|
1283
|
+
(e, t) => {
|
|
1284
|
+
t?.target && t.target.closest('[data-checkbox="true"]') || (I && At(e.index), T && T(e.original, e.index));
|
|
1285
|
+
},
|
|
1286
|
+
[I, T, At]
|
|
1287
|
+
), lr = f(
|
|
1288
|
+
(e, t) => {
|
|
1289
|
+
t?.target && t.target.closest('[data-checkbox="true"]') || He && He(e.original, e.index);
|
|
1290
|
+
},
|
|
1291
|
+
[He]
|
|
1292
|
+
), Cn = se(() => B.map((e) => {
|
|
971
1293
|
const n = a.find((o) => o.internalName === e.id)?.typeAsString === "Note" ? O * 2 : O, r = L[e.id] || (typeof e.size == "number" ? e.size : n);
|
|
972
1294
|
return e.id === "select" ? `${Ae}px` : `${r}px`;
|
|
973
1295
|
}).join(" "), [B, L, a]), Tn = w(!1);
|
|
@@ -978,8 +1300,16 @@ const ls = ({
|
|
|
978
1300
|
const t = e.clientWidth;
|
|
979
1301
|
if (t <= 0) return;
|
|
980
1302
|
Tn.current = !0, zt(t);
|
|
981
|
-
const n = ie ? On(t, B, a, L) : Pn(
|
|
982
|
-
|
|
1303
|
+
const n = ie ? On(t, B, a, L) : Pn(
|
|
1304
|
+
t,
|
|
1305
|
+
B,
|
|
1306
|
+
a,
|
|
1307
|
+
L,
|
|
1308
|
+
Te
|
|
1309
|
+
);
|
|
1310
|
+
n && (K.current = !0, Ie(
|
|
1311
|
+
(r) => ie ? n : { ...r, ...n }
|
|
1312
|
+
), requestAnimationFrame(() => {
|
|
983
1313
|
K.current = !1;
|
|
984
1314
|
}));
|
|
985
1315
|
}), oe(() => {
|
|
@@ -992,7 +1322,12 @@ const ls = ({
|
|
|
992
1322
|
}, [Je]), oe(() => {
|
|
993
1323
|
if (!(!ie || Q <= 0) && !K.current)
|
|
994
1324
|
return Se.current && clearTimeout(Se.current), Se.current = setTimeout(() => {
|
|
995
|
-
const e = On(
|
|
1325
|
+
const e = On(
|
|
1326
|
+
Q,
|
|
1327
|
+
B,
|
|
1328
|
+
a,
|
|
1329
|
+
L
|
|
1330
|
+
);
|
|
996
1331
|
e && (K.current = !0, Ie(e), requestAnimationFrame(() => {
|
|
997
1332
|
K.current = !1;
|
|
998
1333
|
}));
|
|
@@ -1002,7 +1337,13 @@ const ls = ({
|
|
|
1002
1337
|
}, [ie, Q, B, a]), oe(() => {
|
|
1003
1338
|
if (!(ie || Q <= 0))
|
|
1004
1339
|
return we.current && clearTimeout(we.current), we.current = setTimeout(() => {
|
|
1005
|
-
const e = Pn(
|
|
1340
|
+
const e = Pn(
|
|
1341
|
+
Q,
|
|
1342
|
+
B,
|
|
1343
|
+
a,
|
|
1344
|
+
L,
|
|
1345
|
+
Te
|
|
1346
|
+
);
|
|
1006
1347
|
e && (K.current = !0, Ie((t) => ({ ...t, ...e })), requestAnimationFrame(() => {
|
|
1007
1348
|
K.current = !1;
|
|
1008
1349
|
}));
|
|
@@ -1010,7 +1351,16 @@ const ls = ({
|
|
|
1010
1351
|
we.current && clearTimeout(we.current);
|
|
1011
1352
|
};
|
|
1012
1353
|
}, [ie, Q, Te, B, a]);
|
|
1013
|
-
const En = Rr(Un, W), zn = vr(
|
|
1354
|
+
const En = Rr(Un, W), zn = vr(
|
|
1355
|
+
Vn,
|
|
1356
|
+
W
|
|
1357
|
+
), _e = Cr(
|
|
1358
|
+
$n,
|
|
1359
|
+
W
|
|
1360
|
+
), Fn = Tr(
|
|
1361
|
+
qn,
|
|
1362
|
+
W
|
|
1363
|
+
), Mn = Fn ? [...mt, Fn] : mt, ar = En ? [...Mn, En] : Mn, st = [];
|
|
1014
1364
|
zn && st.push(zn);
|
|
1015
1365
|
const ur = _e ? [...st, ...ht, _e] : [...st, ...ht], dr = _e ? [...pt, _e] : pt, An = /* @__PURE__ */ ct(
|
|
1016
1366
|
xr,
|
|
@@ -1033,8 +1383,12 @@ const ls = ({
|
|
|
1033
1383
|
tableMethods: Fe,
|
|
1034
1384
|
alwaysButtons: De(ar),
|
|
1035
1385
|
noSelectionButtons: De(Yn),
|
|
1036
|
-
singleSelectionButtons: De(
|
|
1037
|
-
|
|
1386
|
+
singleSelectionButtons: De(
|
|
1387
|
+
ur
|
|
1388
|
+
),
|
|
1389
|
+
multiSelectionButtons: De(
|
|
1390
|
+
dr
|
|
1391
|
+
),
|
|
1038
1392
|
selectedRows: Fe.getSelectedRows(),
|
|
1039
1393
|
localeText: W
|
|
1040
1394
|
}
|
|
@@ -1129,7 +1483,13 @@ const ls = ({
|
|
|
1129
1483
|
},
|
|
1130
1484
|
"aria-live": "polite",
|
|
1131
1485
|
"aria-label": W.loadingMoreAriaLabel,
|
|
1132
|
-
children: /* @__PURE__ */ D(
|
|
1486
|
+
children: /* @__PURE__ */ D(
|
|
1487
|
+
Ir,
|
|
1488
|
+
{
|
|
1489
|
+
size: "tiny",
|
|
1490
|
+
label: W.loadingMoreSpinnerLabel
|
|
1491
|
+
}
|
|
1492
|
+
)
|
|
1133
1493
|
}
|
|
1134
1494
|
)
|
|
1135
1495
|
]
|