@oliasoft-open-source/react-ui-library 5.7.0-beta-4 → 5.7.0-beta-5

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