@oliasoft-open-source/react-ui-library 5.7.0-beta-11 → 5.7.0-beta-13

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 +135 -26
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6569,7 +6569,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6569
6569
  } : {
6570
6570
  value: G,
6571
6571
  unit: U
6572
- }), Od = k || K?.value === void 0, [J, kd] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), Ad = !!(O || n), Y = C && C.find((e) => {
6572
+ }), Ad = k || K?.value === void 0, [J, jd] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), Md = !!(O || n), Y = C && C.find((e) => {
6573
6573
  if (!e?.value) return;
6574
6574
  if (E) return E === e.valueKey;
6575
6575
  let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
@@ -6578,7 +6578,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6578
6578
  toUnit: t
6579
6579
  });
6580
6580
  return withUnit(n, t) === e.value;
6581
- }), jd = () => {
6581
+ }), Nd = () => {
6582
6582
  let e = l ?? "", t = K.unit;
6583
6583
  if (checkConversion({
6584
6584
  value: e,
@@ -6592,7 +6592,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6592
6592
  return null;
6593
6593
  }
6594
6594
  } else return getAltUnitsListByQuantity(u)?.map((e) => ["", e?.unit]);
6595
- }, Md = (t) => {
6595
+ }, Pd = (t) => {
6596
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;
6597
6597
  h({ target: {
6598
6598
  value: s,
@@ -6605,7 +6605,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6605
6605
  }), R(() => {
6606
6606
  r.selectionStart = a, r.selectionEnd = a;
6607
6607
  });
6608
- }, Nd = (e, t) => {
6608
+ }, Fd = (e, t) => {
6609
6609
  t === K.unit || isNaN(Number(e)) || (q({
6610
6610
  value: e,
6611
6611
  unit: t
@@ -6636,7 +6636,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6636
6636
  e !== void 0 && q({
6637
6637
  value: e,
6638
6638
  unit: t
6639
- }), C && kd(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
6639
+ }), C && jd(Y && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
6640
6640
  }
6641
6641
  }, [
6642
6642
  U,
@@ -6644,7 +6644,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6644
6644
  i,
6645
6645
  T
6646
6646
  ]);
6647
- let X = jd(), Z = label(K.unit) || K.unit || "", Pd = p || !X || X && X.length === 1, Q = getStringName(e), $, Fd = (t) => {
6647
+ let X = Nd(), Z = label(K.unit) || K.unit || "", Id = p || !X || X && X.length === 1, Q = getStringName(e), $, Ld = (t) => {
6648
6648
  let r = t?.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
6649
6649
  if (checkConversion({
6650
6650
  value: r,
@@ -6664,7 +6664,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6664
6664
  type: MenuType.OPTION,
6665
6665
  inline: !0,
6666
6666
  onClick: () => {
6667
- validateNumber(i).valid && !n && (kd(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
6667
+ validateNumber(i).valid && !n && (jd(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
6668
6668
  value: r,
6669
6669
  name: typeof e == "string" ? e : e?.fieldName || "",
6670
6670
  predefinedSelected: !0,
@@ -6691,10 +6691,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6691
6691
  label: "Custom",
6692
6692
  selected: J === PredefinedOptionsMenuState.CUSTOM
6693
6693
  }], C?.length) {
6694
- let e = C.map(Fd);
6694
+ let e = C.map(Ld);
6695
6695
  $ = [...$, ...e];
6696
6696
  }
6697
- let Id = (e) => {
6697
+ let Rd = (e) => {
6698
6698
  if (isValueWithUnit(e)) {
6699
6699
  let t = getUnit(e), { value: n } = safeConvertValue({
6700
6700
  value: e,
@@ -6706,7 +6706,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6706
6706
  return n;
6707
6707
  }
6708
6708
  return e;
6709
- }, Ld = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, Rd = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
6709
+ }, zd = !C && (!F || F === GroupOrder.FIRST) ? GroupOrder.FIRST : GroupOrder.MIDDLE, Bd = !F || F === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
6710
6710
  return /* @__PURE__ */ jsx("div", {
6711
6711
  className: J === PredefinedOptionsMenuState.PREDEFINED ? cx(unit_input_module_default.predefinedMenuActive) : "",
6712
6712
  children: /* @__PURE__ */ jsxs(InputGroup, {
@@ -6738,31 +6738,31 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6738
6738
  name: Q,
6739
6739
  testId: x,
6740
6740
  disabled: n,
6741
- placeholder: Id(t),
6741
+ placeholder: Rd(t),
6742
6742
  value: K.value,
6743
- onChange: Md,
6743
+ onChange: Pd,
6744
6744
  onFocus: v,
6745
6745
  error: i === null ? void 0 : i,
6746
6746
  warning: S === null ? void 0 : S,
6747
6747
  left: a,
6748
- allowEmpty: Od,
6748
+ allowEmpty: Ad,
6749
6749
  validationCallback: (e, t) => D(Q, t),
6750
6750
  enableCosmeticRounding: j,
6751
6751
  enableDisplayRounding: M,
6752
6752
  roundDisplayValue: N,
6753
- groupOrder: Ld,
6754
- disableInternalErrorValidationMessages: Ad,
6753
+ groupOrder: zd,
6754
+ disableInternalErrorValidationMessages: Md,
6755
6755
  small: o,
6756
6756
  selectOnFocus: P,
6757
6757
  tooltip: I
6758
6758
  }, Q)
6759
6759
  }),
6760
- Z && (Pd || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
6761
- groupOrder: Rd,
6760
+ Z && (Id || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
6761
+ groupOrder: Bd,
6762
6762
  small: o,
6763
6763
  children: Z
6764
6764
  }) : /* @__PURE__ */ jsx(Menu, {
6765
- groupOrder: Rd,
6765
+ groupOrder: Bd,
6766
6766
  maxHeight: 380,
6767
6767
  disabled: r,
6768
6768
  testId: x && `${x}-menu`,
@@ -6778,7 +6778,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
6778
6778
  label: j ? safeRoundNumbers(i) : i,
6779
6779
  inline: !0,
6780
6780
  onClick: (n) => {
6781
- n.stopPropagation(), Nd(e, t);
6781
+ n.stopPropagation(), Fd(e, t);
6782
6782
  },
6783
6783
  description: r,
6784
6784
  selected: r === Z,
@@ -8316,7 +8316,112 @@ const createDiffPatcher = (e = {}) => create({
8316
8316
  minLength: 120
8317
8317
  },
8318
8318
  cloneDiffValues: !0
8319
- }), defaultMessage = (e) => {
8319
+ }), sectionNames = [
8320
+ {
8321
+ sectionKey: "hierarchy",
8322
+ sectionLabel: "Hierarchy"
8323
+ },
8324
+ {
8325
+ sectionKey: "hierarchyPermissions",
8326
+ sectionLabel: "Hierarchy Permissions"
8327
+ },
8328
+ {
8329
+ sectionKey: "hierarchyOptionalParameters",
8330
+ sectionLabel: "Hierarchy Optional Parameters"
8331
+ },
8332
+ {
8333
+ sectionKey: "general",
8334
+ sectionLabel: "General"
8335
+ },
8336
+ {
8337
+ sectionKey: "generalAppearance",
8338
+ sectionLabel: "General — Appearance"
8339
+ },
8340
+ {
8341
+ sectionKey: "generalUnitSettings",
8342
+ sectionLabel: "General — Unit Settings"
8343
+ },
8344
+ {
8345
+ sectionKey: "generalUnitPrecision",
8346
+ sectionLabel: "General — Unit Precision"
8347
+ },
8348
+ {
8349
+ sectionKey: "trajectory",
8350
+ sectionLabel: "Trajectory"
8351
+ },
8352
+ {
8353
+ sectionKey: "antiCollision",
8354
+ sectionLabel: "Anti-Collision"
8355
+ },
8356
+ {
8357
+ sectionKey: "casingDesign",
8358
+ sectionLabel: "Casing Design"
8359
+ },
8360
+ {
8361
+ sectionKey: "casingDesignFactors",
8362
+ sectionLabel: "Casing Design — Factors"
8363
+ },
8364
+ {
8365
+ sectionKey: "casingDesignKickTolerance",
8366
+ sectionLabel: "Casing Design — Kick Tolerance"
8367
+ },
8368
+ {
8369
+ sectionKey: "casingDesignStressAnalysisOptions",
8370
+ sectionLabel: "Casing Design — Stress Analysis Options"
8371
+ },
8372
+ {
8373
+ sectionKey: "casingDesignLoadsDefaultConfig",
8374
+ sectionLabel: "Casing Design — Loads Default Config"
8375
+ },
8376
+ {
8377
+ sectionKey: "casingDesignMultipleFlowSimulations",
8378
+ sectionLabel: "Casing Design — Multiple Flow Simulations"
8379
+ },
8380
+ {
8381
+ sectionKey: "annularFluidExpansion",
8382
+ sectionLabel: "Annular Fluid Expansion"
8383
+ },
8384
+ {
8385
+ sectionKey: "drillingMechanics",
8386
+ sectionLabel: "Drilling Mechanics"
8387
+ },
8388
+ {
8389
+ sectionKey: "drillingMechanicsGeneral",
8390
+ sectionLabel: "Drilling Mechanics — General"
8391
+ },
8392
+ {
8393
+ sectionKey: "drillingMechanicsHydraulics",
8394
+ sectionLabel: "Drilling Mechanics — Hydraulics"
8395
+ },
8396
+ {
8397
+ sectionKey: "drillingMechanicsSurgeAndSwab",
8398
+ sectionLabel: "Drilling Mechanics — Surge & Swab"
8399
+ },
8400
+ {
8401
+ sectionKey: "drillingMechanicsTorqueAndDrag",
8402
+ sectionLabel: "Drilling Mechanics — Torque & Drag"
8403
+ },
8404
+ {
8405
+ sectionKey: "drillingMechanicsWear",
8406
+ sectionLabel: "Drilling Mechanics — Wear"
8407
+ },
8408
+ {
8409
+ sectionKey: "tempsim",
8410
+ sectionLabel: "Temperature Simulation"
8411
+ },
8412
+ {
8413
+ sectionKey: "libraries",
8414
+ sectionLabel: "Libraries"
8415
+ },
8416
+ {
8417
+ sectionKey: "automaticDesign",
8418
+ sectionLabel: "Automatic Design"
8419
+ },
8420
+ {
8421
+ sectionKey: "webhooks",
8422
+ sectionLabel: "Webhooks"
8423
+ }
8424
+ ], getSectionName = (e) => sectionNames.find((t) => e.find((e) => e.includes(t.sectionKey)))?.sectionLabel || "", defaultMessage = (e) => {
8320
8425
  switch (e.length) {
8321
8426
  case 1: {
8322
8427
  let [t] = e;
@@ -8351,16 +8456,20 @@ const createDiffPatcher = (e = {}) => create({
8351
8456
  }, ChangesOverview = ({ diffs: e }) => {
8352
8457
  let t = {
8353
8458
  headers: [{ cells: [
8354
- { value: "Tpye" },
8459
+ { value: "Type" },
8355
8460
  { value: "Before" },
8356
- { value: "After" }
8461
+ { value: "After" },
8462
+ { value: "" }
8357
8463
  ] }],
8358
8464
  rows: e.map((e) => {
8359
- let { deltaFormat: t } = e, { type: n, before: r, after: i } = defaultMessage(t);
8465
+ let { deltaFormat: t, path: n } = e, r = getSectionName(n);
8466
+ console.log(n, r);
8467
+ let { type: i, before: a, after: o } = defaultMessage(t), s = n.length > 0 ? n[n.length - 1] : "";
8360
8468
  return { cells: [
8361
- { value: n },
8362
- { value: r },
8363
- { value: i }
8469
+ { value: `${i} ${s}` },
8470
+ { value: a },
8471
+ { value: o },
8472
+ { value: r }
8364
8473
  ] };
8365
8474
  })
8366
8475
  };
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-11",
3
+ "version": "5.7.0-beta-13",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {