@oliasoft-open-source/react-ui-library 5.7.0-beta-5 → 5.7.0-beta-7
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 +27 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -29,6 +29,7 @@ import { EditorComponent, Remirror, useActive, useCommands, useRemirror } from "
|
|
|
29
29
|
import "remirror/styles/all.css";
|
|
30
30
|
import { DndProvider } from "react-dnd";
|
|
31
31
|
import { MultiBackend, Tree as Tree$1, getBackendOptions } from "@minoru/react-dnd-treeview";
|
|
32
|
+
import ReactDiffViewer, { DiffMethod } from "react-diff-viewer-continued";
|
|
32
33
|
let TriggerType = /* @__PURE__ */ function(e) {
|
|
33
34
|
return e.TEXT = "Text", e.BUTTON = "Button", e.DROP_DOWN_BUTTON = "DropDownButton", e.COMPONENT = "Component", e;
|
|
34
35
|
}({}), GroupOrder = /* @__PURE__ */ function(e) {
|
|
@@ -6568,7 +6569,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6568
6569
|
} : {
|
|
6569
6570
|
value: G,
|
|
6570
6571
|
unit: U
|
|
6571
|
-
}),
|
|
6572
|
+
}), Td = k || K?.value === void 0, [J, Ed] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), Dd = !!(O || n), Y = C && C.find((e) => {
|
|
6572
6573
|
if (!e?.value) return;
|
|
6573
6574
|
if (E) return E === e.valueKey;
|
|
6574
6575
|
let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
|
|
@@ -6577,7 +6578,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6577
6578
|
toUnit: t
|
|
6578
6579
|
});
|
|
6579
6580
|
return withUnit(n, t) === e.value;
|
|
6580
|
-
}),
|
|
6581
|
+
}), Od = () => {
|
|
6581
6582
|
let e = l ?? "", t = K.unit;
|
|
6582
6583
|
if (checkConversion({
|
|
6583
6584
|
value: e,
|
|
@@ -6591,7 +6592,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6591
6592
|
return null;
|
|
6592
6593
|
}
|
|
6593
6594
|
} else return getAltUnitsListByQuantity(u)?.map((e) => ["", e?.unit]);
|
|
6594
|
-
},
|
|
6595
|
+
}, kd = (t) => {
|
|
6595
6596
|
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;
|
|
6596
6597
|
h({ target: {
|
|
6597
6598
|
value: s,
|
|
@@ -6604,7 +6605,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6604
6605
|
}), R(() => {
|
|
6605
6606
|
r.selectionStart = a, r.selectionEnd = a;
|
|
6606
6607
|
});
|
|
6607
|
-
},
|
|
6608
|
+
}, Ad = (e, t) => {
|
|
6608
6609
|
t === K.unit || isNaN(Number(e)) || (q({
|
|
6609
6610
|
value: e,
|
|
6610
6611
|
unit: t
|
|
@@ -6635,7 +6636,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6635
6636
|
e !== void 0 && q({
|
|
6636
6637
|
value: e,
|
|
6637
6638
|
unit: t
|
|
6638
|
-
}), C &&
|
|
6639
|
+
}), C && Ed(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
|
|
6639
6640
|
}
|
|
6640
6641
|
}, [
|
|
6641
6642
|
U,
|
|
@@ -6643,7 +6644,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6643
6644
|
i,
|
|
6644
6645
|
T
|
|
6645
6646
|
]);
|
|
6646
|
-
let X =
|
|
6647
|
+
let X = Od(), Z = label(K.unit) || K.unit || "", jd = p || !X || X && X.length === 1, Q = getStringName(e), $, Md = (t) => {
|
|
6647
6648
|
let r = t?.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
|
|
6648
6649
|
if (checkConversion({
|
|
6649
6650
|
value: r,
|
|
@@ -6663,7 +6664,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6663
6664
|
type: MenuType.OPTION,
|
|
6664
6665
|
inline: !0,
|
|
6665
6666
|
onClick: () => {
|
|
6666
|
-
validateNumber(i).valid && !n && (
|
|
6667
|
+
validateNumber(i).valid && !n && (Ed(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
|
|
6667
6668
|
value: r,
|
|
6668
6669
|
name: typeof e == "string" ? e : e?.fieldName || "",
|
|
6669
6670
|
predefinedSelected: !0,
|
|
@@ -6690,10 +6691,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6690
6691
|
label: "Custom",
|
|
6691
6692
|
selected: J === PredefinedOptionsMenuState.CUSTOM
|
|
6692
6693
|
}], C?.length) {
|
|
6693
|
-
let e = C.map(
|
|
6694
|
+
let e = C.map(Md);
|
|
6694
6695
|
$ = [...$, ...e];
|
|
6695
6696
|
}
|
|
6696
|
-
let
|
|
6697
|
+
let Nd = (e) => {
|
|
6697
6698
|
if (isValueWithUnit(e)) {
|
|
6698
6699
|
let t = getUnit(e), { value: n } = safeConvertValue({
|
|
6699
6700
|
value: e,
|
|
@@ -6705,7 +6706,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6705
6706
|
return n;
|
|
6706
6707
|
}
|
|
6707
6708
|
return e;
|
|
6708
|
-
},
|
|
6709
|
+
}, Pd = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, Fd = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
|
|
6709
6710
|
return /* @__PURE__ */ jsx("div", {
|
|
6710
6711
|
className: J === PredefinedOptionsMenuState.PREDEFINED ? cx(unit_input_module_default.predefinedMenuActive) : "",
|
|
6711
6712
|
children: /* @__PURE__ */ jsxs(InputGroup, {
|
|
@@ -6737,31 +6738,31 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6737
6738
|
name: Q,
|
|
6738
6739
|
testId: x,
|
|
6739
6740
|
disabled: n,
|
|
6740
|
-
placeholder:
|
|
6741
|
+
placeholder: Nd(t),
|
|
6741
6742
|
value: K.value,
|
|
6742
|
-
onChange:
|
|
6743
|
+
onChange: kd,
|
|
6743
6744
|
onFocus: v,
|
|
6744
6745
|
error: i === null ? void 0 : i,
|
|
6745
6746
|
warning: S === null ? void 0 : S,
|
|
6746
6747
|
left: a,
|
|
6747
|
-
allowEmpty:
|
|
6748
|
+
allowEmpty: Td,
|
|
6748
6749
|
validationCallback: (e, t) => D(Q, t),
|
|
6749
6750
|
enableCosmeticRounding: j,
|
|
6750
6751
|
enableDisplayRounding: M,
|
|
6751
6752
|
roundDisplayValue: N,
|
|
6752
|
-
groupOrder:
|
|
6753
|
-
disableInternalErrorValidationMessages:
|
|
6753
|
+
groupOrder: Pd,
|
|
6754
|
+
disableInternalErrorValidationMessages: Dd,
|
|
6754
6755
|
small: o,
|
|
6755
6756
|
selectOnFocus: P,
|
|
6756
6757
|
tooltip: I
|
|
6757
6758
|
}, Q)
|
|
6758
6759
|
}),
|
|
6759
|
-
Z && (
|
|
6760
|
-
groupOrder:
|
|
6760
|
+
Z && (jd || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
6761
|
+
groupOrder: Fd,
|
|
6761
6762
|
small: o,
|
|
6762
6763
|
children: Z
|
|
6763
6764
|
}) : /* @__PURE__ */ jsx(Menu, {
|
|
6764
|
-
groupOrder:
|
|
6765
|
+
groupOrder: Fd,
|
|
6765
6766
|
maxHeight: 380,
|
|
6766
6767
|
disabled: r,
|
|
6767
6768
|
testId: x && `${x}-menu`,
|
|
@@ -6777,7 +6778,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
6777
6778
|
label: j ? safeRoundNumbers(i) : i,
|
|
6778
6779
|
inline: !0,
|
|
6779
6780
|
onClick: (n) => {
|
|
6780
|
-
n.stopPropagation(),
|
|
6781
|
+
n.stopPropagation(), Ad(e, t);
|
|
6781
6782
|
},
|
|
6782
6783
|
description: r,
|
|
6783
6784
|
selected: r === Z,
|
|
@@ -7020,7 +7021,7 @@ const DiffViewer = ({ oldJson: e, newJson: t, viewType: n = SPLIT_VIEW }) => {
|
|
|
7020
7021
|
let s = ({ target: { value: e } }) => {
|
|
7021
7022
|
a(e);
|
|
7022
7023
|
}, { added: l, removed: u } = renderLinesCount(e, t), d = l + u, f = d > 3500;
|
|
7023
|
-
return console.log("logs", n, l, u, d, f), /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Card, {
|
|
7024
|
+
return console.log("typeof ReactDiffViewer:", typeof ReactDiffViewer), console.log(typeof e, typeof t), console.log("logs", n, l, u, d, f, DiffMethod.WORDS), /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(Card, {
|
|
7024
7025
|
bordered: !0,
|
|
7025
7026
|
heading: /* @__PURE__ */ jsxs(Flex, {
|
|
7026
7027
|
gap: !0,
|
|
@@ -7049,7 +7050,12 @@ const DiffViewer = ({ oldJson: e, newJson: t, viewType: n = SPLIT_VIEW }) => {
|
|
|
7049
7050
|
muted: !0,
|
|
7050
7051
|
children: r?.changesTooLarge
|
|
7051
7052
|
})
|
|
7052
|
-
}) : /* @__PURE__ */ jsx(
|
|
7053
|
+
}) : /* @__PURE__ */ jsx(ReactDiffViewer, {
|
|
7054
|
+
oldValue: e,
|
|
7055
|
+
newValue: t,
|
|
7056
|
+
splitView: i === SPLIT_VIEW,
|
|
7057
|
+
compareMethod: DiffMethod.WORDS
|
|
7058
|
+
})
|
|
7053
7059
|
}) });
|
|
7054
7060
|
};
|
|
7055
7061
|
function formatDate({ date: e, showTime: t, showSeconds: n, timeZone: r, showTimeZone: i, locale: a }) {
|
package/package.json
CHANGED