@oliasoft-open-source/react-ui-library 5.8.0-beta-3 → 5.8.0-beta-4
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 +126 -108
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3502,87 +3502,77 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
|
|
|
3502
3502
|
testId: a
|
|
3503
3503
|
})
|
|
3504
3504
|
});
|
|
3505
|
-
}, Row$1 = ({ row: e, rowIndex: t, isHeader: n = !1, columnCount: r, colSpan: i, columnHeaderAlignments: a = [], columnAlignment: o = [], hasRowActions: s, draggableTable:
|
|
3506
|
-
let
|
|
3507
|
-
useEffect(() => {
|
|
3508
|
-
if (w && p) {
|
|
3509
|
-
let e = document.querySelector("tr[data-active=\"true\"]");
|
|
3510
|
-
e && e.scrollIntoView({
|
|
3511
|
-
behavior: "smooth",
|
|
3512
|
-
block: "center"
|
|
3513
|
-
});
|
|
3514
|
-
}
|
|
3515
|
-
}, [w, p]);
|
|
3516
|
-
let T = e.cells.map((e, r) => {
|
|
3505
|
+
}, Row$1 = ({ row: e, rowIndex: t, isHeader: n = !1, columnCount: r, colSpan: i, columnHeaderAlignments: a = [], columnAlignment: o = [], hasRowActions: s, draggableTable: c = !1, columnWidths: l, dropDisabled: u = !1, height: d, testId: f }) => {
|
|
3506
|
+
let p = getHeaderAlignment(a, n, t), { onRowClick: m, onRowFocus: h, onRowMouseEnter: _, onRowMouseLeave: v, expandedContent: y, error: b, warning: x, active: S } = e, C = e.cells.map((e, r) => {
|
|
3517
3507
|
let i = `${n ? 0 : 1}_${t}_${r}`;
|
|
3518
3508
|
return /* @__PURE__ */ jsx(Cell, {
|
|
3519
3509
|
cell: e,
|
|
3520
3510
|
isHeader: n,
|
|
3521
3511
|
columnAlignment: o[r],
|
|
3522
|
-
columnHeaderAlignment:
|
|
3523
|
-
width:
|
|
3512
|
+
columnHeaderAlignment: p[r],
|
|
3513
|
+
width: l ? l[r] : void 0,
|
|
3524
3514
|
testId: e.testId
|
|
3525
3515
|
}, i);
|
|
3526
|
-
}),
|
|
3516
|
+
}), w = s && /* @__PURE__ */ jsx(Cell, {
|
|
3527
3517
|
cell: {
|
|
3528
3518
|
type: CellType.ACTIONS,
|
|
3529
3519
|
actions: e.actions
|
|
3530
3520
|
},
|
|
3531
3521
|
isHeader: n
|
|
3532
|
-
}, r), { attributes:
|
|
3522
|
+
}, r), { attributes: T, listeners: E, setNodeRef: D, transform: O, transition: k, isDragging: A } = useSortable({
|
|
3533
3523
|
id: t.toString(),
|
|
3534
3524
|
animateLayoutChanges: () => !1
|
|
3535
|
-
}),
|
|
3536
|
-
transform:
|
|
3537
|
-
height:
|
|
3538
|
-
transition:
|
|
3539
|
-
opacity:
|
|
3540
|
-
},
|
|
3525
|
+
}), j = {
|
|
3526
|
+
transform: u ? void 0 : CSS.Translate.toString(O),
|
|
3527
|
+
height: d,
|
|
3528
|
+
transition: k,
|
|
3529
|
+
opacity: A ? 0 : void 0
|
|
3530
|
+
}, M = () => e.noDrag ? /* @__PURE__ */ jsx("td", { "aria-labelledby": "unique-label-id" }) : /* @__PURE__ */ jsx("td", {
|
|
3541
3531
|
className: row_module_default$1.dragIconCell,
|
|
3542
3532
|
children: /* @__PURE__ */ jsx("div", {
|
|
3543
|
-
className: cx(row_module_default$1.dragIcon,
|
|
3544
|
-
...
|
|
3545
|
-
...
|
|
3533
|
+
className: cx(row_module_default$1.dragIcon, u ? row_module_default$1.dragIconDisabled : ""),
|
|
3534
|
+
...T,
|
|
3535
|
+
...E,
|
|
3546
3536
|
children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG })
|
|
3547
3537
|
})
|
|
3548
3538
|
});
|
|
3549
3539
|
return n ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("tr", {
|
|
3550
|
-
onClick:
|
|
3551
|
-
onMouseEnter:
|
|
3552
|
-
onMouseLeave:
|
|
3553
|
-
onFocus:
|
|
3554
|
-
className: cx(
|
|
3540
|
+
onClick: m,
|
|
3541
|
+
onMouseEnter: _,
|
|
3542
|
+
onMouseLeave: v,
|
|
3543
|
+
onFocus: h,
|
|
3544
|
+
className: cx(m ? row_module_default$1.clickableRow : null, _ ? row_module_default$1.hoverableRow : null),
|
|
3555
3545
|
children: [
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3546
|
+
c ? /* @__PURE__ */ jsx("th", {}) : null,
|
|
3547
|
+
C,
|
|
3548
|
+
w
|
|
3559
3549
|
]
|
|
3560
|
-
}, t),
|
|
3550
|
+
}, t), y && y.content ? /* @__PURE__ */ jsx(ExpandedContentRow, {
|
|
3561
3551
|
colSpan: i,
|
|
3562
|
-
flush:
|
|
3563
|
-
children:
|
|
3552
|
+
flush: y.flush === !0,
|
|
3553
|
+
children: y.content
|
|
3564
3554
|
}, `${t}_expanded_content`) : null] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("tr", {
|
|
3565
|
-
ref: e.noDrag ? null :
|
|
3566
|
-
onClick:
|
|
3567
|
-
onMouseEnter:
|
|
3568
|
-
onMouseLeave:
|
|
3569
|
-
onFocus:
|
|
3570
|
-
className: cx(
|
|
3571
|
-
"data-active":
|
|
3572
|
-
"data-error":
|
|
3573
|
-
"data-warning":
|
|
3555
|
+
ref: e.noDrag ? null : D,
|
|
3556
|
+
onClick: m,
|
|
3557
|
+
onMouseEnter: _,
|
|
3558
|
+
onMouseLeave: v,
|
|
3559
|
+
onFocus: h,
|
|
3560
|
+
className: cx(m && !m.noStyle ? row_module_default$1.clickableRow : null, _ && !_.noStyle ? row_module_default$1.hoverableRow : null, S ? row_module_default$1.rowActive : null),
|
|
3561
|
+
"data-active": S || null,
|
|
3562
|
+
"data-error": b || null,
|
|
3563
|
+
"data-warning": x || null,
|
|
3574
3564
|
"data-index": t,
|
|
3575
3565
|
"data-even": t % 2 == 0,
|
|
3576
|
-
style:
|
|
3566
|
+
style: j,
|
|
3577
3567
|
children: [
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3568
|
+
c ? M() : null,
|
|
3569
|
+
C,
|
|
3570
|
+
w
|
|
3581
3571
|
]
|
|
3582
|
-
}, t),
|
|
3572
|
+
}, t), y && y.content ? /* @__PURE__ */ jsx(ExpandedContentRow, {
|
|
3583
3573
|
colSpan: i,
|
|
3584
|
-
flush:
|
|
3585
|
-
children:
|
|
3574
|
+
flush: y.flush === !0,
|
|
3575
|
+
children: y.content
|
|
3586
3576
|
}, `${t}_expanded_content`) : null] });
|
|
3587
3577
|
}, TableDragWrapper = (e) => {
|
|
3588
3578
|
let { children: t, colSpan: n, columnAlignment: r, columnCount: i, draggable: a, onListReorder: o = () => {}, canListReorder: s = () => !0, rowActions: c, rows: l = [], tbodyRef: u } = e, [f, p] = useState(null), [h, _] = useState(!1), v = useMemo(() => l.map((e, t) => t.toString()), [l]);
|
|
@@ -3662,23 +3652,53 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
|
|
|
3662
3652
|
})()
|
|
3663
3653
|
})
|
|
3664
3654
|
});
|
|
3665
|
-
}
|
|
3666
|
-
|
|
3655
|
+
};
|
|
3656
|
+
var ScrollToActiveRow = ({ activeIndex: e, triggerScrollToActiveRow: t, isVirtualized: n, virtualizer: r }) => (useEffect(() => {
|
|
3657
|
+
if (t && !(e == null || e < 0)) {
|
|
3658
|
+
if (n && r) r.scrollToIndex(e, {
|
|
3659
|
+
align: "center",
|
|
3660
|
+
behavior: "auto"
|
|
3661
|
+
});
|
|
3662
|
+
else if (!n) {
|
|
3663
|
+
let t = document.querySelector(`tr[data-index="${e}"]`);
|
|
3664
|
+
t && t.scrollIntoView({
|
|
3665
|
+
behavior: "auto",
|
|
3666
|
+
block: "center"
|
|
3667
|
+
});
|
|
3668
|
+
}
|
|
3669
|
+
}
|
|
3670
|
+
}, [
|
|
3671
|
+
e,
|
|
3672
|
+
t,
|
|
3673
|
+
n,
|
|
3674
|
+
r
|
|
3675
|
+
]), null);
|
|
3676
|
+
const TableScrollWrapper = ({ table: e, theadRef: t, children: n }) => {
|
|
3677
|
+
let { infiniteScroll: r = !1, triggerScrollToActiveRow: i = !1, rows: a } = e, o = useMemo(() => typeof e.activeRowIndex == "number" ? e.activeRowIndex : Array.isArray(a) && a.length ? a.findIndex((e) => e && e.active) : -1, [a, e.activeRowIndex]);
|
|
3667
3678
|
return r ? /* @__PURE__ */ jsx(TableVirtualScrollWrapper, {
|
|
3668
3679
|
table: e,
|
|
3669
3680
|
theadRef: t,
|
|
3670
|
-
children: ({ virtualizer: e, tableStyle: t }) =>
|
|
3681
|
+
children: ({ virtualizer: e, tableStyle: t }) => /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ScrollToActiveRow, {
|
|
3682
|
+
isVirtualized: !0,
|
|
3683
|
+
virtualizer: e,
|
|
3684
|
+
activeIndex: o,
|
|
3685
|
+
triggerScrollToActiveRow: i
|
|
3686
|
+
}), n({
|
|
3671
3687
|
virtualizer: e,
|
|
3672
3688
|
tableStyle: t
|
|
3673
|
-
})
|
|
3674
|
-
}) : /* @__PURE__ */
|
|
3689
|
+
})] })
|
|
3690
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
3675
3691
|
id: "scrollWrapper",
|
|
3676
3692
|
className: table_module_default.scroll,
|
|
3677
|
-
children:
|
|
3693
|
+
children: [/* @__PURE__ */ jsx(ScrollToActiveRow, {
|
|
3694
|
+
isVirtualized: !1,
|
|
3695
|
+
activeIndex: o,
|
|
3696
|
+
triggerScrollToActiveRow: i
|
|
3697
|
+
}), n({})]
|
|
3678
3698
|
});
|
|
3679
3699
|
}, Table = (e) => {
|
|
3680
|
-
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
|
|
3681
|
-
cells:
|
|
3700
|
+
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 = useRef(null), T = get(e, "table.headers", []), E = getColumnCount(c, T), D = hasRowActions(c, T), O = E + (D ? 1 : 0), k = o ? o?.pagination?.rowsPerPage?.value === 0 || Number(o?.pagination?.selectedPage) >= Number(o?.pagination?.rowCount) / Number(o?.pagination?.rowsPerPage?.value) : !0, A = v?.cells?.length && y && k, j = {
|
|
3701
|
+
cells: A ? v.cells.map((e, t) => e?.type === "Input" ? {
|
|
3682
3702
|
...e,
|
|
3683
3703
|
onChange: (e) => {
|
|
3684
3704
|
let n = e?.target?.value, r = {
|
|
@@ -3695,12 +3715,12 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
|
|
|
3695
3715
|
disabled: !0
|
|
3696
3716
|
}) : null,
|
|
3697
3717
|
testId: h ? `${h}-last-empty-row` : void 0
|
|
3698
|
-
},
|
|
3718
|
+
}, M = A ? c.concat(j) : c, N = {
|
|
3699
3719
|
...i,
|
|
3700
|
-
rows:
|
|
3701
|
-
},
|
|
3720
|
+
rows: M
|
|
3721
|
+
}, P = cx(table_module_default.wrapper, b ? table_module_default.bordered : "");
|
|
3702
3722
|
return /* @__PURE__ */ jsxs("div", {
|
|
3703
|
-
className:
|
|
3723
|
+
className: P,
|
|
3704
3724
|
style: {
|
|
3705
3725
|
maxHeight: x,
|
|
3706
3726
|
width: S,
|
|
@@ -3714,57 +3734,56 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
|
|
|
3714
3734
|
testId: h && `${h}-title`
|
|
3715
3735
|
}),
|
|
3716
3736
|
/* @__PURE__ */ jsx(TableDragWrapper, {
|
|
3717
|
-
colSpan:
|
|
3737
|
+
colSpan: O,
|
|
3718
3738
|
columnAlignment: f,
|
|
3719
|
-
columnCount:
|
|
3739
|
+
columnCount: E,
|
|
3720
3740
|
draggable: _,
|
|
3721
3741
|
onListReorder: t,
|
|
3722
|
-
rowActions:
|
|
3723
|
-
rows:
|
|
3724
|
-
tbodyRef:
|
|
3742
|
+
rowActions: D,
|
|
3743
|
+
rows: M,
|
|
3744
|
+
tbodyRef: w,
|
|
3725
3745
|
canListReorder: n,
|
|
3726
3746
|
children: ({ dropDisabled: e }) => /* @__PURE__ */ jsx(TableScrollWrapper, {
|
|
3727
|
-
table:
|
|
3728
|
-
theadRef:
|
|
3747
|
+
table: N,
|
|
3748
|
+
theadRef: C,
|
|
3729
3749
|
children: ({ virtualizer: t, tableStyle: n }) => /* @__PURE__ */ jsxs("table", {
|
|
3730
3750
|
className: cx(table_module_default.table, m ? table_module_default.striped : ""),
|
|
3731
3751
|
"data-testid": h,
|
|
3732
3752
|
style: n,
|
|
3733
3753
|
children: [/* @__PURE__ */ jsx("thead", {
|
|
3734
|
-
ref:
|
|
3735
|
-
children:
|
|
3754
|
+
ref: C,
|
|
3755
|
+
children: T.map((e, t) => /* @__PURE__ */ jsx(Row$1, {
|
|
3736
3756
|
rowIndex: t,
|
|
3737
3757
|
isHeader: !0,
|
|
3738
3758
|
row: e,
|
|
3739
|
-
columnCount:
|
|
3759
|
+
columnCount: E,
|
|
3740
3760
|
columnWidths: a,
|
|
3741
|
-
colSpan:
|
|
3742
|
-
hasRowActions:
|
|
3761
|
+
colSpan: O,
|
|
3762
|
+
hasRowActions: D,
|
|
3743
3763
|
columnAlignment: f,
|
|
3744
3764
|
columnHeaderAlignments: d,
|
|
3745
3765
|
draggableTable: _
|
|
3746
3766
|
}, `0_${t}`))
|
|
3747
3767
|
}), /* @__PURE__ */ jsx("tbody", {
|
|
3748
|
-
ref:
|
|
3768
|
+
ref: w,
|
|
3749
3769
|
children: t ? t.getVirtualItems().map((t) => {
|
|
3750
|
-
let n = t.index, i =
|
|
3770
|
+
let n = t.index, i = M[n], o = r ? r({
|
|
3751
3771
|
row: i,
|
|
3752
3772
|
rowIndex: n
|
|
3753
3773
|
}) : i;
|
|
3754
3774
|
return /* @__PURE__ */ jsx(Row$1, {
|
|
3755
3775
|
rowIndex: n,
|
|
3756
3776
|
row: o,
|
|
3757
|
-
columnCount:
|
|
3777
|
+
columnCount: E,
|
|
3758
3778
|
columnWidths: a,
|
|
3759
|
-
colSpan:
|
|
3760
|
-
hasRowActions:
|
|
3779
|
+
colSpan: O,
|
|
3780
|
+
hasRowActions: D,
|
|
3761
3781
|
columnAlignment: f,
|
|
3762
3782
|
draggableTable: _,
|
|
3763
3783
|
height: t.size,
|
|
3764
|
-
dropDisabled: e
|
|
3765
|
-
triggerScrollToActiveRow: C
|
|
3784
|
+
dropDisabled: e
|
|
3766
3785
|
}, `1_${n}`);
|
|
3767
|
-
}) :
|
|
3786
|
+
}) : M.map((t, n) => {
|
|
3768
3787
|
let i = r ? r({
|
|
3769
3788
|
row: t,
|
|
3770
3789
|
rowIndex: n
|
|
@@ -3772,14 +3791,13 @@ const Cell = ({ cell: e, isHeader: t, columnHeaderAlignment: n, columnAlignment:
|
|
|
3772
3791
|
return /* @__PURE__ */ jsx(Row$1, {
|
|
3773
3792
|
rowIndex: n,
|
|
3774
3793
|
row: i,
|
|
3775
|
-
columnCount:
|
|
3794
|
+
columnCount: E,
|
|
3776
3795
|
columnWidths: a,
|
|
3777
|
-
colSpan:
|
|
3778
|
-
hasRowActions:
|
|
3796
|
+
colSpan: O,
|
|
3797
|
+
hasRowActions: D,
|
|
3779
3798
|
columnAlignment: f,
|
|
3780
3799
|
draggableTable: _,
|
|
3781
|
-
dropDisabled: e
|
|
3782
|
-
triggerScrollToActiveRow: C
|
|
3800
|
+
dropDisabled: e
|
|
3783
3801
|
}, `1_${n}`);
|
|
3784
3802
|
})
|
|
3785
3803
|
})]
|
|
@@ -6582,7 +6600,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6582
6600
|
} : {
|
|
6583
6601
|
value: G,
|
|
6584
6602
|
unit: U
|
|
6585
|
-
}),
|
|
6603
|
+
}), kd = k || K?.value === void 0, [J, Ad] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), jd = !!(O || n), Y = C && C.find((e) => {
|
|
6586
6604
|
if (!e?.value) return;
|
|
6587
6605
|
if (E) return E === e.valueKey;
|
|
6588
6606
|
let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
|
|
@@ -6591,7 +6609,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6591
6609
|
toUnit: t
|
|
6592
6610
|
});
|
|
6593
6611
|
return withUnit(n, t) === e.value;
|
|
6594
|
-
}),
|
|
6612
|
+
}), Md = () => {
|
|
6595
6613
|
let e = l ?? "", t = K.unit;
|
|
6596
6614
|
if (checkConversion({
|
|
6597
6615
|
value: e,
|
|
@@ -6605,7 +6623,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6605
6623
|
return null;
|
|
6606
6624
|
}
|
|
6607
6625
|
} else return getAltUnitsListByQuantity(u)?.map((e) => ["", e?.unit]);
|
|
6608
|
-
},
|
|
6626
|
+
}, Nd = (t) => {
|
|
6609
6627
|
let n = getStringName(e), r = t.target, { value: i, selectionStart: a } = r, o = withUnit(i, K?.unit || ""), s = A ? withUnit(convertAndGetValue(o, B), B) : o;
|
|
6610
6628
|
h({ target: {
|
|
6611
6629
|
value: s,
|
|
@@ -6618,7 +6636,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6618
6636
|
}), R(() => {
|
|
6619
6637
|
r.selectionStart = a, r.selectionEnd = a;
|
|
6620
6638
|
});
|
|
6621
|
-
},
|
|
6639
|
+
}, Pd = (e, t) => {
|
|
6622
6640
|
t === K.unit || isNaN(Number(e)) || (q({
|
|
6623
6641
|
value: e,
|
|
6624
6642
|
unit: t
|
|
@@ -6649,7 +6667,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6649
6667
|
e !== void 0 && q({
|
|
6650
6668
|
value: e,
|
|
6651
6669
|
unit: t
|
|
6652
|
-
}), C &&
|
|
6670
|
+
}), C && Ad(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
|
|
6653
6671
|
}
|
|
6654
6672
|
}, [
|
|
6655
6673
|
U,
|
|
@@ -6657,7 +6675,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6657
6675
|
i,
|
|
6658
6676
|
T
|
|
6659
6677
|
]);
|
|
6660
|
-
let X =
|
|
6678
|
+
let X = Md(), Z = label(K.unit) || K.unit || "", Fd = p || !X || X && X.length === 1, Q = getStringName(e), $, Id = (t) => {
|
|
6661
6679
|
let r = t?.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
|
|
6662
6680
|
if (checkConversion({
|
|
6663
6681
|
value: r,
|
|
@@ -6677,7 +6695,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6677
6695
|
type: MenuType.OPTION,
|
|
6678
6696
|
inline: !0,
|
|
6679
6697
|
onClick: () => {
|
|
6680
|
-
validateNumber(i).valid && !n && (
|
|
6698
|
+
validateNumber(i).valid && !n && (Ad(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
|
|
6681
6699
|
value: r,
|
|
6682
6700
|
name: typeof e == "string" ? e : e?.fieldName || "",
|
|
6683
6701
|
predefinedSelected: !0,
|
|
@@ -6704,10 +6722,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6704
6722
|
label: "Custom",
|
|
6705
6723
|
selected: J === PredefinedOptionsMenuState.CUSTOM
|
|
6706
6724
|
}], C?.length) {
|
|
6707
|
-
let e = C.map(
|
|
6725
|
+
let e = C.map(Id);
|
|
6708
6726
|
$ = [...$, ...e];
|
|
6709
6727
|
}
|
|
6710
|
-
let
|
|
6728
|
+
let Ld = (e) => {
|
|
6711
6729
|
if (isValueWithUnit(e)) {
|
|
6712
6730
|
let t = getUnit(e), { value: n } = safeConvertValue({
|
|
6713
6731
|
value: e,
|
|
@@ -6719,7 +6737,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6719
6737
|
return n;
|
|
6720
6738
|
}
|
|
6721
6739
|
return e;
|
|
6722
|
-
},
|
|
6740
|
+
}, Rd = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, zd = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
|
|
6723
6741
|
return /* @__PURE__ */ jsx("div", {
|
|
6724
6742
|
className: J === PredefinedOptionsMenuState.PREDEFINED ? cx(unit_input_module_default.predefinedMenuActive) : "",
|
|
6725
6743
|
children: /* @__PURE__ */ jsxs(InputGroup, {
|
|
@@ -6751,31 +6769,31 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6751
6769
|
name: Q,
|
|
6752
6770
|
testId: x,
|
|
6753
6771
|
disabled: n,
|
|
6754
|
-
placeholder:
|
|
6772
|
+
placeholder: Ld(t),
|
|
6755
6773
|
value: K.value,
|
|
6756
|
-
onChange:
|
|
6774
|
+
onChange: Nd,
|
|
6757
6775
|
onFocus: v,
|
|
6758
6776
|
error: i === null ? void 0 : i,
|
|
6759
6777
|
warning: S === null ? void 0 : S,
|
|
6760
6778
|
left: a,
|
|
6761
|
-
allowEmpty:
|
|
6779
|
+
allowEmpty: kd,
|
|
6762
6780
|
validationCallback: (e, t) => D(Q, t),
|
|
6763
6781
|
enableCosmeticRounding: j,
|
|
6764
6782
|
enableDisplayRounding: M,
|
|
6765
6783
|
roundDisplayValue: N,
|
|
6766
|
-
groupOrder:
|
|
6767
|
-
disableInternalErrorValidationMessages:
|
|
6784
|
+
groupOrder: Rd,
|
|
6785
|
+
disableInternalErrorValidationMessages: jd,
|
|
6768
6786
|
small: o,
|
|
6769
6787
|
selectOnFocus: P,
|
|
6770
6788
|
tooltip: I
|
|
6771
6789
|
}, Q)
|
|
6772
6790
|
}),
|
|
6773
|
-
Z && (
|
|
6774
|
-
groupOrder:
|
|
6791
|
+
Z && (Fd || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
6792
|
+
groupOrder: zd,
|
|
6775
6793
|
small: o,
|
|
6776
6794
|
children: Z
|
|
6777
6795
|
}) : /* @__PURE__ */ jsx(Menu, {
|
|
6778
|
-
groupOrder:
|
|
6796
|
+
groupOrder: zd,
|
|
6779
6797
|
maxHeight: 380,
|
|
6780
6798
|
disabled: r,
|
|
6781
6799
|
testId: x && `${x}-menu`,
|
|
@@ -6791,7 +6809,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6791
6809
|
label: j ? safeRoundNumbers(i) : i,
|
|
6792
6810
|
inline: !0,
|
|
6793
6811
|
onClick: (n) => {
|
|
6794
|
-
n.stopPropagation(),
|
|
6812
|
+
n.stopPropagation(), Pd(e, t);
|
|
6795
6813
|
},
|
|
6796
6814
|
description: r,
|
|
6797
6815
|
selected: r === Z,
|
package/package.json
CHANGED