@oliasoft-open-source/react-ui-library 5.8.8-beta-1 → 5.8.8
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.js +52 -58
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3632,25 +3632,24 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
|
|
|
3632
3632
|
})
|
|
3633
3633
|
}), document.body)]
|
|
3634
3634
|
}) : t({});
|
|
3635
|
-
}, TableVirtualScrollWrapper = ({ table: e,
|
|
3636
|
-
let
|
|
3635
|
+
}, TableVirtualScrollWrapper = ({ table: e, children: t }) => {
|
|
3636
|
+
let n = useRef(null), r = useVirtualizer({
|
|
3637
3637
|
count: e?.rowCount ?? e.rows?.length ?? 0,
|
|
3638
|
-
getScrollElement: () =>
|
|
3638
|
+
getScrollElement: () => n.current,
|
|
3639
3639
|
estimateSize: () => 31,
|
|
3640
3640
|
overscan: 10
|
|
3641
3641
|
});
|
|
3642
3642
|
return /* @__PURE__ */ jsx("div", {
|
|
3643
3643
|
id: "scrollWrapper",
|
|
3644
3644
|
className: cx(table_module_default.scroll, table_module_default.virtualScroll),
|
|
3645
|
-
ref:
|
|
3646
|
-
children:
|
|
3647
|
-
virtualizer:
|
|
3645
|
+
ref: n,
|
|
3646
|
+
children: t({
|
|
3647
|
+
virtualizer: r,
|
|
3648
3648
|
tableStyle: (() => {
|
|
3649
|
-
let e =
|
|
3649
|
+
let e = r.getVirtualItems(), t = e.length > 0 ? e[0].start : 0, n = e.length > 0 ? r.getTotalSize() - e[e.length - 1].end : 0;
|
|
3650
3650
|
return {
|
|
3651
|
-
"--virtualPaddingTop":
|
|
3652
|
-
"--virtualPaddingBottom":
|
|
3653
|
-
height: n
|
|
3651
|
+
"--virtualPaddingTop": t + "px",
|
|
3652
|
+
"--virtualPaddingBottom": n + "px"
|
|
3654
3653
|
};
|
|
3655
3654
|
})()
|
|
3656
3655
|
})
|
|
@@ -3676,32 +3675,31 @@ var ScrollToActiveRow = ({ activeIndex: e, triggerScrollToActiveRow: t, isVirtua
|
|
|
3676
3675
|
n,
|
|
3677
3676
|
r
|
|
3678
3677
|
]), null);
|
|
3679
|
-
const TableScrollWrapper = ({ table: e,
|
|
3680
|
-
let { infiniteScroll:
|
|
3681
|
-
return
|
|
3678
|
+
const TableScrollWrapper = ({ table: e, children: t }) => {
|
|
3679
|
+
let { infiniteScroll: n = !1, triggerScrollToActiveRow: r = !1, rows: i } = e, a = useMemo(() => typeof e.activeRowIndex == "number" ? e.activeRowIndex : Array.isArray(i) && i.length ? i.findIndex((e) => e && e.active) : -1, [i, e.activeRowIndex]);
|
|
3680
|
+
return n ? /* @__PURE__ */ jsx(TableVirtualScrollWrapper, {
|
|
3682
3681
|
table: e,
|
|
3683
|
-
|
|
3684
|
-
children: ({ virtualizer: e, tableStyle: t }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ScrollToActiveRow, {
|
|
3682
|
+
children: ({ virtualizer: e, tableStyle: n }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ScrollToActiveRow, {
|
|
3685
3683
|
isVirtualized: !0,
|
|
3686
3684
|
virtualizer: e,
|
|
3687
|
-
activeIndex:
|
|
3688
|
-
triggerScrollToActiveRow:
|
|
3689
|
-
}),
|
|
3685
|
+
activeIndex: a,
|
|
3686
|
+
triggerScrollToActiveRow: r
|
|
3687
|
+
}), t({
|
|
3690
3688
|
virtualizer: e,
|
|
3691
|
-
tableStyle:
|
|
3689
|
+
tableStyle: n
|
|
3692
3690
|
})] })
|
|
3693
3691
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
3694
3692
|
id: "scrollWrapper",
|
|
3695
3693
|
className: table_module_default.scroll,
|
|
3696
3694
|
children: [/* @__PURE__ */ jsx(ScrollToActiveRow, {
|
|
3697
3695
|
isVirtualized: !1,
|
|
3698
|
-
activeIndex:
|
|
3699
|
-
triggerScrollToActiveRow:
|
|
3700
|
-
}),
|
|
3696
|
+
activeIndex: a,
|
|
3697
|
+
triggerScrollToActiveRow: r
|
|
3698
|
+
}), t({})]
|
|
3701
3699
|
});
|
|
3702
3700
|
}, Table = (e) => {
|
|
3703
|
-
let { onListReorder: t = () => {}, canListReorder: n = () => !0, beforeRenderRow: r, table: i } = e, { columnWidths: a, footer: o, name: s, rows: c = [], actions: l, actionsRight: u, columnHeaderAlignments: d, columnAlignment: f, striped: m = !0, testId: h, draggable: _, defaultEmptyRow: v = null, onAddRow: y = null, bordered: b = !0, maxHeight: x, fixedWidth: S } = i, C = useRef(null), w =
|
|
3704
|
-
cells:
|
|
3701
|
+
let { onListReorder: t = () => {}, canListReorder: n = () => !0, beforeRenderRow: r, table: i } = e, { columnWidths: a, footer: o, name: s, rows: c = [], actions: l, actionsRight: u, columnHeaderAlignments: d, columnAlignment: f, striped: m = !0, testId: h, draggable: _, defaultEmptyRow: v = null, onAddRow: y = null, bordered: b = !0, maxHeight: x, fixedWidth: S } = i, C = useRef(null), w = get(e, "table.headers", []), T = getColumnCount(c, w), E = hasRowActions(c, w), D = T + (E ? 1 : 0), O = o ? o?.pagination?.rowsPerPage?.value === 0 || Number(o?.pagination?.selectedPage) >= Number(o?.pagination?.rowCount) / Number(o?.pagination?.rowsPerPage?.value) : !0, k = v?.cells?.length && y && O, A = {
|
|
3702
|
+
cells: k ? v.cells.map((e, t) => e?.type === "Input" ? {
|
|
3705
3703
|
...e,
|
|
3706
3704
|
onChange: (e) => {
|
|
3707
3705
|
let n = e?.target?.value, r = {
|
|
@@ -3718,12 +3716,12 @@ const TableScrollWrapper = ({ table: e, theadRef: t, children: n }) => {
|
|
|
3718
3716
|
disabled: !0
|
|
3719
3717
|
}) : null,
|
|
3720
3718
|
testId: h ? `${h}-last-empty-row` : void 0
|
|
3721
|
-
},
|
|
3719
|
+
}, j = k ? c.concat(A) : c, M = {
|
|
3722
3720
|
...i,
|
|
3723
|
-
rows:
|
|
3724
|
-
},
|
|
3721
|
+
rows: j
|
|
3722
|
+
}, N = cx(table_module_default.wrapper, b ? table_module_default.bordered : "");
|
|
3725
3723
|
return /* @__PURE__ */ jsxs("div", {
|
|
3726
|
-
className:
|
|
3724
|
+
className: N,
|
|
3727
3725
|
style: {
|
|
3728
3726
|
maxHeight: x,
|
|
3729
3727
|
width: S,
|
|
@@ -3737,56 +3735,52 @@ const TableScrollWrapper = ({ table: e, theadRef: t, children: n }) => {
|
|
|
3737
3735
|
testId: h && `${h}-title`
|
|
3738
3736
|
}),
|
|
3739
3737
|
/* @__PURE__ */ jsx(TableDragWrapper, {
|
|
3740
|
-
colSpan:
|
|
3738
|
+
colSpan: D,
|
|
3741
3739
|
columnAlignment: f,
|
|
3742
|
-
columnCount:
|
|
3740
|
+
columnCount: T,
|
|
3743
3741
|
draggable: _,
|
|
3744
3742
|
onListReorder: t,
|
|
3745
|
-
rowActions:
|
|
3746
|
-
rows:
|
|
3747
|
-
tbodyRef:
|
|
3743
|
+
rowActions: E,
|
|
3744
|
+
rows: j,
|
|
3745
|
+
tbodyRef: C,
|
|
3748
3746
|
canListReorder: n,
|
|
3749
3747
|
children: ({ dropDisabled: e }) => /* @__PURE__ */ jsx(TableScrollWrapper, {
|
|
3750
|
-
table:
|
|
3751
|
-
theadRef: C,
|
|
3748
|
+
table: M,
|
|
3752
3749
|
children: ({ virtualizer: t, tableStyle: n }) => /* @__PURE__ */ jsxs("table", {
|
|
3753
3750
|
className: cx(table_module_default.table, m ? table_module_default.striped : ""),
|
|
3754
3751
|
"data-testid": h,
|
|
3755
3752
|
style: n,
|
|
3756
|
-
children: [/* @__PURE__ */ jsx("thead", {
|
|
3753
|
+
children: [/* @__PURE__ */ jsx("thead", { children: w.map((e, t) => /* @__PURE__ */ jsx(Row$1, {
|
|
3754
|
+
rowIndex: t,
|
|
3755
|
+
isHeader: !0,
|
|
3756
|
+
row: e,
|
|
3757
|
+
columnCount: T,
|
|
3758
|
+
columnWidths: a,
|
|
3759
|
+
colSpan: D,
|
|
3760
|
+
hasRowActions: E,
|
|
3761
|
+
columnAlignment: f,
|
|
3762
|
+
columnHeaderAlignments: d,
|
|
3763
|
+
draggableTable: _
|
|
3764
|
+
}, `0_${t}`)) }), /* @__PURE__ */ jsx("tbody", {
|
|
3757
3765
|
ref: C,
|
|
3758
|
-
children: T.map((e, t) => /* @__PURE__ */ jsx(Row$1, {
|
|
3759
|
-
rowIndex: t,
|
|
3760
|
-
isHeader: !0,
|
|
3761
|
-
row: e,
|
|
3762
|
-
columnCount: E,
|
|
3763
|
-
columnWidths: a,
|
|
3764
|
-
colSpan: O,
|
|
3765
|
-
hasRowActions: D,
|
|
3766
|
-
columnAlignment: f,
|
|
3767
|
-
columnHeaderAlignments: d,
|
|
3768
|
-
draggableTable: _
|
|
3769
|
-
}, `0_${t}`))
|
|
3770
|
-
}), /* @__PURE__ */ jsx("tbody", {
|
|
3771
|
-
ref: w,
|
|
3772
3766
|
children: t ? t.getVirtualItems().map((t) => {
|
|
3773
|
-
let n = t.index, i =
|
|
3767
|
+
let n = t.index, i = j[n], o = r ? r({
|
|
3774
3768
|
row: i,
|
|
3775
3769
|
rowIndex: n
|
|
3776
3770
|
}) : i;
|
|
3777
3771
|
return /* @__PURE__ */ jsx(Row$1, {
|
|
3778
3772
|
rowIndex: n,
|
|
3779
3773
|
row: o,
|
|
3780
|
-
columnCount:
|
|
3774
|
+
columnCount: T,
|
|
3781
3775
|
columnWidths: a,
|
|
3782
|
-
colSpan:
|
|
3783
|
-
hasRowActions:
|
|
3776
|
+
colSpan: D,
|
|
3777
|
+
hasRowActions: E,
|
|
3784
3778
|
columnAlignment: f,
|
|
3785
3779
|
draggableTable: _,
|
|
3786
3780
|
height: t.size,
|
|
3787
3781
|
dropDisabled: e
|
|
3788
3782
|
}, `1_${n}`);
|
|
3789
|
-
}) :
|
|
3783
|
+
}) : j.map((t, n) => {
|
|
3790
3784
|
let i = r ? r({
|
|
3791
3785
|
row: t,
|
|
3792
3786
|
rowIndex: n
|
|
@@ -3794,10 +3788,10 @@ const TableScrollWrapper = ({ table: e, theadRef: t, children: n }) => {
|
|
|
3794
3788
|
return /* @__PURE__ */ jsx(Row$1, {
|
|
3795
3789
|
rowIndex: n,
|
|
3796
3790
|
row: i,
|
|
3797
|
-
columnCount:
|
|
3791
|
+
columnCount: T,
|
|
3798
3792
|
columnWidths: a,
|
|
3799
|
-
colSpan:
|
|
3800
|
-
hasRowActions:
|
|
3793
|
+
colSpan: D,
|
|
3794
|
+
hasRowActions: E,
|
|
3801
3795
|
columnAlignment: f,
|
|
3802
3796
|
draggableTable: _,
|
|
3803
3797
|
dropDisabled: e
|
package/package.json
CHANGED