@oliasoft-open-source/react-ui-library 5.8.8 → 5.8.9-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +26 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6596,7 +6596,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6596
6596
|
} : {
|
|
6597
6597
|
value: G,
|
|
6598
6598
|
unit: U
|
|
6599
|
-
}),
|
|
6599
|
+
}), Ad = k || K?.value === void 0, [J, jd] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), Md = !!(O || n), Y = C && C.find((e) => {
|
|
6600
6600
|
if (!e?.value) return;
|
|
6601
6601
|
if (E) return E === e.valueKey;
|
|
6602
6602
|
let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
|
|
@@ -6605,7 +6605,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6605
6605
|
toUnit: t
|
|
6606
6606
|
});
|
|
6607
6607
|
return withUnit(n, t) === e.value;
|
|
6608
|
-
}),
|
|
6608
|
+
}), Nd = () => {
|
|
6609
6609
|
let e = l ?? "", t = K.unit;
|
|
6610
6610
|
if (checkConversion({
|
|
6611
6611
|
value: e,
|
|
@@ -6619,7 +6619,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6619
6619
|
return null;
|
|
6620
6620
|
}
|
|
6621
6621
|
} else return getAltUnitsListByQuantity(u)?.map((e) => ["", e?.unit]);
|
|
6622
|
-
},
|
|
6622
|
+
}, Pd = (t) => {
|
|
6623
6623
|
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;
|
|
6624
6624
|
h({ target: {
|
|
6625
6625
|
value: s,
|
|
@@ -6632,7 +6632,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6632
6632
|
}), R(() => {
|
|
6633
6633
|
r.selectionStart = a, r.selectionEnd = a;
|
|
6634
6634
|
});
|
|
6635
|
-
},
|
|
6635
|
+
}, Fd = (e, t) => {
|
|
6636
6636
|
t === K.unit || isNaN(Number(e)) || (q({
|
|
6637
6637
|
value: e,
|
|
6638
6638
|
unit: t
|
|
@@ -6663,7 +6663,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6663
6663
|
e !== void 0 && q({
|
|
6664
6664
|
value: e,
|
|
6665
6665
|
unit: t
|
|
6666
|
-
}), C &&
|
|
6666
|
+
}), C && jd(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
|
|
6667
6667
|
}
|
|
6668
6668
|
}, [
|
|
6669
6669
|
U,
|
|
@@ -6671,7 +6671,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6671
6671
|
i,
|
|
6672
6672
|
T
|
|
6673
6673
|
]);
|
|
6674
|
-
let X =
|
|
6674
|
+
let X = Nd(), Z = label(K.unit) || K.unit || "", Id = p || !X || X && X.length === 1, Q = getStringName(e), $, Ld = (t) => {
|
|
6675
6675
|
let r = t?.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
|
|
6676
6676
|
if (checkConversion({
|
|
6677
6677
|
value: r,
|
|
@@ -6691,7 +6691,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6691
6691
|
type: MenuType.OPTION,
|
|
6692
6692
|
inline: !0,
|
|
6693
6693
|
onClick: () => {
|
|
6694
|
-
validateNumber(i).valid && !n && (
|
|
6694
|
+
validateNumber(i).valid && !n && (jd(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
|
|
6695
6695
|
value: r,
|
|
6696
6696
|
name: typeof e == "string" ? e : e?.fieldName || "",
|
|
6697
6697
|
predefinedSelected: !0,
|
|
@@ -6718,10 +6718,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6718
6718
|
label: "Custom",
|
|
6719
6719
|
selected: J === PredefinedOptionsMenuState.CUSTOM
|
|
6720
6720
|
}], C?.length) {
|
|
6721
|
-
let e = C.map(
|
|
6721
|
+
let e = C.map(Ld);
|
|
6722
6722
|
$ = [...$, ...e];
|
|
6723
6723
|
}
|
|
6724
|
-
let
|
|
6724
|
+
let Rd = (e) => {
|
|
6725
6725
|
if (isValueWithUnit(e)) {
|
|
6726
6726
|
let t = getUnit(e), { value: n } = safeConvertValue({
|
|
6727
6727
|
value: e,
|
|
@@ -6733,7 +6733,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6733
6733
|
return n;
|
|
6734
6734
|
}
|
|
6735
6735
|
return e;
|
|
6736
|
-
},
|
|
6736
|
+
}, zd = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, Bd = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
|
|
6737
6737
|
return /* @__PURE__ */ jsx("div", {
|
|
6738
6738
|
className: J === PredefinedOptionsMenuState.PREDEFINED ? cx(unit_input_module_default.predefinedMenuActive) : "",
|
|
6739
6739
|
children: /* @__PURE__ */ jsxs(InputGroup, {
|
|
@@ -6765,31 +6765,31 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6765
6765
|
name: Q,
|
|
6766
6766
|
testId: x,
|
|
6767
6767
|
disabled: n,
|
|
6768
|
-
placeholder:
|
|
6768
|
+
placeholder: Rd(t),
|
|
6769
6769
|
value: K.value,
|
|
6770
|
-
onChange:
|
|
6770
|
+
onChange: Pd,
|
|
6771
6771
|
onFocus: v,
|
|
6772
6772
|
error: i === null ? void 0 : i,
|
|
6773
6773
|
warning: S === null ? void 0 : S,
|
|
6774
6774
|
left: a,
|
|
6775
|
-
allowEmpty:
|
|
6775
|
+
allowEmpty: Ad,
|
|
6776
6776
|
validationCallback: (e, t) => D(Q, t),
|
|
6777
6777
|
enableCosmeticRounding: j,
|
|
6778
6778
|
enableDisplayRounding: M,
|
|
6779
6779
|
roundDisplayValue: N,
|
|
6780
|
-
groupOrder:
|
|
6781
|
-
disableInternalErrorValidationMessages:
|
|
6780
|
+
groupOrder: zd,
|
|
6781
|
+
disableInternalErrorValidationMessages: Md,
|
|
6782
6782
|
small: o,
|
|
6783
6783
|
selectOnFocus: P,
|
|
6784
6784
|
tooltip: I
|
|
6785
6785
|
}, Q)
|
|
6786
6786
|
}),
|
|
6787
|
-
Z && (
|
|
6788
|
-
groupOrder:
|
|
6787
|
+
Z && (Id || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
6788
|
+
groupOrder: Bd,
|
|
6789
6789
|
small: o,
|
|
6790
6790
|
children: Z
|
|
6791
6791
|
}) : /* @__PURE__ */ jsx(Menu, {
|
|
6792
|
-
groupOrder:
|
|
6792
|
+
groupOrder: Bd,
|
|
6793
6793
|
maxHeight: 380,
|
|
6794
6794
|
disabled: r,
|
|
6795
6795
|
testId: x && `${x}-menu`,
|
|
@@ -6805,7 +6805,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6805
6805
|
label: j ? safeRoundNumbers(i) : i,
|
|
6806
6806
|
inline: !0,
|
|
6807
6807
|
onClick: (n) => {
|
|
6808
|
-
n.stopPropagation(),
|
|
6808
|
+
n.stopPropagation(), Fd(e, t);
|
|
6809
6809
|
},
|
|
6810
6810
|
description: r,
|
|
6811
6811
|
selected: r === Z,
|
|
@@ -8430,29 +8430,31 @@ const countDeltas = (e) => (Array.isArray(e) ? e : e ? [e] : []).reduce((e, t) =
|
|
|
8430
8430
|
if (i) return i;
|
|
8431
8431
|
}
|
|
8432
8432
|
return "";
|
|
8433
|
-
}
|
|
8433
|
+
};
|
|
8434
|
+
var toText = (e) => isObject(e) ? "Multiple property changes" : String(e);
|
|
8435
|
+
const defaultMessage = (e) => {
|
|
8434
8436
|
switch (e.length) {
|
|
8435
8437
|
case 1: {
|
|
8436
8438
|
let [t] = e;
|
|
8437
8439
|
return {
|
|
8438
8440
|
type: "Created",
|
|
8439
8441
|
before: "",
|
|
8440
|
-
after:
|
|
8442
|
+
after: toText(t)
|
|
8441
8443
|
};
|
|
8442
8444
|
}
|
|
8443
8445
|
case 2: {
|
|
8444
8446
|
let [t, n] = e;
|
|
8445
8447
|
return {
|
|
8446
8448
|
type: "Modified",
|
|
8447
|
-
before:
|
|
8448
|
-
after:
|
|
8449
|
+
before: toText(t),
|
|
8450
|
+
after: toText(n)
|
|
8449
8451
|
};
|
|
8450
8452
|
}
|
|
8451
8453
|
case 3: {
|
|
8452
8454
|
let [t] = e;
|
|
8453
8455
|
return {
|
|
8454
8456
|
type: "Deleted",
|
|
8455
|
-
before:
|
|
8457
|
+
before: toText(t),
|
|
8456
8458
|
after: ""
|
|
8457
8459
|
};
|
|
8458
8460
|
}
|
package/package.json
CHANGED