@oliasoft-open-source/react-ui-library 5.15.3-beta-2 → 5.15.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.d.ts CHANGED
@@ -97,7 +97,7 @@ export declare enum Color {
97
97
  MUTED = "muted"
98
98
  }
99
99
 
100
- export declare const ColorInput: ({ columns, disabled, options, small, value, onChange, }: IColorInputProps) => JSX_2.Element;
100
+ export declare const ColorInput: ({ columns, disabled, options, small, value, onChange, adjustColorsInDarkMode, }: IColorInputProps) => JSX_2.Element;
101
101
 
102
102
  export declare const Column: ({ background, borderLeft, borderRight, children, flex, flexbox, padding, scroll, showScrollbar, spacing, width, widthMobile, widthTablet, testId, }: ILayoutColumnProps) => JSX_2.Element;
103
103
 
@@ -347,6 +347,7 @@ export declare interface IColorInputProps {
347
347
  small?: boolean;
348
348
  value?: string;
349
349
  onChange?: (value: string) => void;
350
+ adjustColorsInDarkMode?: boolean;
350
351
  }
351
352
 
352
353
  /**
@@ -1549,7 +1550,6 @@ export declare interface ITableImportExportConfig {
1549
1550
  copyFromClipBoard?: boolean;
1550
1551
  showDeleteOptions?: boolean;
1551
1552
  showHelpOption?: boolean;
1552
- showUploadFileOption?: boolean;
1553
1553
  onDeleteRows?: (type: 'all') => void;
1554
1554
  onImportComplete?: (data: IImportData) => void;
1555
1555
  }
package/dist/index.js CHANGED
@@ -1337,23 +1337,24 @@ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOn
1337
1337
  })] });
1338
1338
  };
1339
1339
  var color_input_module_default = {
1340
- colorInput: "_colorInput_hb750_1",
1341
- trigger: "_trigger_hb750_8",
1342
- buttonColor: "_buttonColor_hb750_12",
1343
- options: "_options_hb750_17",
1344
- option: "_option_hb750_17"
1345
- };
1346
- const ColorInput = ({ columns: e = 9, disabled: t, options: n = [], small: r, value: i, onChange: a }) => {
1347
- var o;
1348
- let [s, c] = useState(!1), l = (o = n.find((e) => e.value === i)) == null ? void 0 : o.label;
1340
+ colorInput: "_colorInput_1j7vk_1",
1341
+ trigger: "_trigger_1j7vk_8",
1342
+ buttonColor: "_buttonColor_1j7vk_12",
1343
+ options: "_options_1j7vk_17",
1344
+ option: "_option_1j7vk_17",
1345
+ adjustColorsInDarkMode: "_adjustColorsInDarkMode_1j7vk_26"
1346
+ };
1347
+ const ColorInput = ({ columns: e = 9, disabled: t, options: n = [], small: r, value: i, onChange: a, adjustColorsInDarkMode: o = !1 }) => {
1348
+ var s;
1349
+ let [c, l] = useState(!1), u = (s = n.find((e) => e.value === i)) == null ? void 0 : s.label;
1349
1350
  return /* @__PURE__ */ jsx("div", {
1350
- className: color_input_module_default.colorInput,
1351
+ className: cx(color_input_module_default.colorInput, o ? color_input_module_default.adjustColorsInDarkMode : void 0),
1351
1352
  children: /* @__PURE__ */ jsx(Popover, {
1352
1353
  placement: "bottom-start",
1353
- isOpen: s,
1354
- onToggle: c,
1354
+ isOpen: c,
1355
+ onToggle: l,
1355
1356
  content: /* @__PURE__ */ jsx("div", {
1356
- className: color_input_module_default.options,
1357
+ className: cx(color_input_module_default.options, o ? color_input_module_default.adjustColorsInDarkMode : void 0),
1357
1358
  style: { gridTemplateColumns: `repeat(${e}, auto)` },
1358
1359
  children: n.map((e) => /* @__PURE__ */ jsx("div", {
1359
1360
  className: color_input_module_default.option,
@@ -1367,7 +1368,7 @@ const ColorInput = ({ columns: e = 9, disabled: t, options: n = [], small: r, va
1367
1368
  style: { backgroundColor: e.value }
1368
1369
  }),
1369
1370
  onClick: () => {
1370
- a == null || a(e.value), c(!1);
1371
+ a == null || a(e.value), l(!1);
1371
1372
  }
1372
1373
  }, e.value)
1373
1374
  }))
@@ -1375,9 +1376,9 @@ const ColorInput = ({ columns: e = 9, disabled: t, options: n = [], small: r, va
1375
1376
  children: /* @__PURE__ */ jsx(Button, {
1376
1377
  disabled: t,
1377
1378
  small: r,
1378
- active: s,
1379
+ active: c,
1379
1380
  width: r ? "var(--size-sm)" : "var(--size)",
1380
- tooltip: l,
1381
+ tooltip: u,
1381
1382
  label: /* @__PURE__ */ jsx("div", {
1382
1383
  className: color_input_module_default.buttonColor,
1383
1384
  style: { backgroundColor: i }
@@ -5199,158 +5200,158 @@ var initialState = {
5199
5200
  };
5200
5201
  const TableImportExport = ({ config: e, smartUploadConfig: t, testId: n }) => {
5201
5202
  var r, i, a, o;
5202
- let { exportData: s, beforeExportData: c, prevalidationConfig: l, validationRules: u, title: d, translations: f, textOnly: p = !1, showImportOptions: g = !0, copyFromClipBoard: _ = !0, showDeleteOptions: v = !0, showHelpOption: y = !0, showUploadFileOption: b = !0, modals: x = [], dynamicOptions: S, onImportComplete: C } = e == null ? {} : e, [w, T] = useState(initialState), { modalVisibility: { smartUploadModal: E = !1, reviewPasteModal: D = !1, helpModal: O = !1 } } = w, { enabled: k, prompt: A = "", onClose: j, onError: M, service: N = () => Promise.resolve() } = t == null ? {} : t, P = useTranslationMap(f), F = useExportData(P, s, c), [I, L] = useTransition(), R = useDataImportActions({
5203
+ let { exportData: s, beforeExportData: c, prevalidationConfig: l, validationRules: u, title: d, translations: f, textOnly: p = !1, showImportOptions: g = !0, copyFromClipBoard: _ = !0, showDeleteOptions: v = !0, showHelpOption: y = !0, modals: b = [], dynamicOptions: x, onImportComplete: S } = e == null ? {} : e, [C, w] = useState(initialState), { modalVisibility: { smartUploadModal: T = !1, reviewPasteModal: E = !1, helpModal: D = !1 } } = C, { enabled: O, prompt: k = "", onClose: A, onError: j, service: M = () => Promise.resolve() } = t == null ? {} : t, N = useTranslationMap(f), P = useExportData(N, s, c), [F, I] = useTransition(), L = useDataImportActions({
5203
5204
  config: e,
5204
- state: w,
5205
- setState: T,
5205
+ state: C,
5206
+ setState: w,
5206
5207
  smartUploadConfig: t,
5207
- startTransition: L
5208
- }), { readAndParseInput: z, updateState: B, closeModals: V, setModalVisibility: H, onFileChange: U, onClickQuickPasteFromClipBoard: W, onClickCopyClipboard: G, onSmartUploadResult: K, deleteAllRows: q } = R == null ? {} : R;
5209
- useKeyboardEvent("Escape", () => V());
5210
- let J = g ? [
5211
- ...b ? [{
5208
+ startTransition: I
5209
+ }), { readAndParseInput: R, updateState: z, closeModals: B, setModalVisibility: V, onFileChange: H, onClickQuickPasteFromClipBoard: U, onClickCopyClipboard: W, onSmartUploadResult: G, deleteAllRows: K } = L == null ? {} : L;
5210
+ useKeyboardEvent("Escape", () => B());
5211
+ let q = g ? [
5212
+ {
5212
5213
  type: "Option",
5213
- label: P("uploadFile"),
5214
+ label: N("uploadFile"),
5214
5215
  upload: !0,
5215
5216
  uploadType: ".csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
5216
- onChange: U,
5217
+ onChange: H,
5217
5218
  testId: `${n}-option-upload-file`
5218
- }] : [],
5219
+ },
5219
5220
  ..._ ? [{
5220
5221
  type: "Option",
5221
- label: P("quickPasteFromClipboard"),
5222
- onClick: W,
5222
+ label: N("quickPasteFromClipboard"),
5223
+ onClick: U,
5223
5224
  testId: `${n}-option-quick-paste-from-clipboard`
5224
5225
  }] : [],
5225
5226
  ..._ ? [{
5226
5227
  type: "Option",
5227
- label: P("pasteWithReview"),
5228
- onClick: () => H("reviewPasteModal", !D),
5228
+ label: N("pasteWithReview"),
5229
+ onClick: () => V("reviewPasteModal", !E),
5229
5230
  testId: `${n}-paste-with-review`
5230
5231
  }] : [],
5231
- ...A && k && t ? [{
5232
+ ...k && O && t ? [{
5232
5233
  type: "Option",
5233
- label: P("smartUpload_smartUpload"),
5234
- onClick: () => H("smartUploadModal", !E),
5234
+ label: N("smartUpload_smartUpload"),
5235
+ onClick: () => V("smartUploadModal", !T),
5235
5236
  testId: `${n}-smart-upload`
5236
5237
  }] : [],
5237
- ...applyModalHandlers((r = S == null ? void 0 : S.importOptions) == null ? [] : r, w, H)
5238
- ] : [], Y = [
5238
+ ...applyModalHandlers((r = x == null ? void 0 : x.importOptions) == null ? [] : r, C, V)
5239
+ ] : [], J = [
5239
5240
  {
5240
5241
  type: "Option",
5241
- label: P("downloadFile"),
5242
+ label: N("downloadFile"),
5242
5243
  onClick: async () => {
5243
- let e = await F();
5244
+ let e = await P();
5244
5245
  e && e && onClickDownLoad(e, d);
5245
5246
  }
5246
5247
  },
5247
5248
  ...p ? [{
5248
5249
  type: "Option",
5249
- label: P("copyToClipboard"),
5250
- onClick: () => G("dot")
5250
+ label: N("copyToClipboard"),
5251
+ onClick: () => W("dot")
5251
5252
  }] : [{
5252
5253
  type: "Menu",
5253
5254
  testId: `${n}-menu-copy-to-clipboard`,
5254
5255
  menu: {
5255
5256
  trigger: "Text",
5256
- label: P("copyToClipboard"),
5257
+ label: N("copyToClipboard"),
5257
5258
  sections: [{
5258
5259
  type: "Option",
5259
- label: P("copyDecimalDot"),
5260
- onClick: () => G("dot"),
5260
+ label: N("copyDecimalDot"),
5261
+ onClick: () => W("dot"),
5261
5262
  testId: `${n}-option-copy-decimal-dot`
5262
5263
  }, {
5263
5264
  type: "Option",
5264
- label: P("copyDecimalComma"),
5265
- onClick: () => G("comma")
5265
+ label: N("copyDecimalComma"),
5266
+ onClick: () => W("comma")
5266
5267
  }]
5267
5268
  }
5268
5269
  }],
5269
- ...applyModalHandlers((i = S == null ? void 0 : S.exportOptions) == null ? [] : i, w, H)
5270
- ], X = v ? [{
5270
+ ...applyModalHandlers((i = x == null ? void 0 : x.exportOptions) == null ? [] : i, C, V)
5271
+ ], Y = v ? [{
5271
5272
  type: "Option",
5272
- label: P("deleteAllRows"),
5273
- onClick: () => q(),
5273
+ label: N("deleteAllRows"),
5274
+ onClick: () => K(),
5274
5275
  testId: `${n}-delete-all-rows`
5275
- }, ...applyModalHandlers((a = S == null ? void 0 : S.deleteOptions) == null ? [] : a, w, H)] : [], ee = y ? [
5276
+ }, ...applyModalHandlers((a = x == null ? void 0 : x.deleteOptions) == null ? [] : a, C, V)] : [], ee = y ? [
5276
5277
  { type: "Divider" },
5277
5278
  {
5278
5279
  type: "Option",
5279
- label: P("help"),
5280
- onClick: () => H("helpModal", !O)
5280
+ label: N("help"),
5281
+ onClick: () => V("helpModal", !D)
5281
5282
  },
5282
- ...applyModalHandlers((o = S == null ? void 0 : S.helpOptions) == null ? [] : o, w, H)
5283
- ] : [], Z = [
5284
- ...J.length ? [{
5285
- section: [...J, ...ee],
5283
+ ...applyModalHandlers((o = x == null ? void 0 : x.helpOptions) == null ? [] : o, C, V)
5284
+ ] : [], te = [
5285
+ ...q.length ? [{
5286
+ section: [...q, ...ee],
5286
5287
  name: "import-options",
5287
5288
  iconName: "import",
5288
- tooltip: P("import")
5289
+ tooltip: N("import")
5289
5290
  }] : [],
5290
- ...Y.length ? [{
5291
- section: Y,
5291
+ ...J.length ? [{
5292
+ section: J,
5292
5293
  name: "export-options",
5293
5294
  iconName: "export",
5294
- tooltip: P("export")
5295
+ tooltip: N("export")
5295
5296
  }] : [],
5296
- ...X.length ? [{
5297
- section: X,
5297
+ ...Y.length ? [{
5298
+ section: Y,
5298
5299
  name: "delete-options",
5299
5300
  iconName: "delete",
5300
- tooltip: P("deleteAllRows")
5301
+ tooltip: N("deleteAllRows")
5301
5302
  }] : []
5302
5303
  ];
5303
5304
  return /* @__PURE__ */ jsxs("span", { children: [
5304
- I && /* @__PURE__ */ jsx(Spinner, {
5305
+ F && /* @__PURE__ */ jsx(Spinner, {
5305
5306
  small: !0,
5306
5307
  dark: !0
5307
5308
  }),
5308
- Z.map((e, t) => /* @__PURE__ */ jsx(MenuComponent, {
5309
+ te.map((e, t) => /* @__PURE__ */ jsx(MenuComponent, {
5309
5310
  sections: e.section,
5310
5311
  iconName: e.iconName,
5311
5312
  tooltip: e.tooltip,
5312
5313
  testId: `data-${e == null ? void 0 : e.name}-menu`
5313
5314
  }, t)),
5314
- D && /* @__PURE__ */ jsx(PasteWithReviewModal, {
5315
+ E && /* @__PURE__ */ jsx(PasteWithReviewModal, {
5315
5316
  config: e,
5316
- state: w,
5317
- updateState: B,
5318
- setModalVisibility: H,
5319
- readAndParseInput: z,
5320
- onCloseModal: V,
5317
+ state: C,
5318
+ updateState: z,
5319
+ setModalVisibility: V,
5320
+ readAndParseInput: R,
5321
+ onCloseModal: B,
5321
5322
  validationRules: u,
5322
- onCompleteImport: C,
5323
+ onCompleteImport: S,
5323
5324
  prevalidationConfig: l,
5324
- t: P,
5325
- loading: I,
5326
- startTransition: L,
5325
+ t: N,
5326
+ loading: F,
5327
+ startTransition: I,
5327
5328
  testId: n
5328
5329
  }),
5329
- O && /* @__PURE__ */ jsx(HelpModal, {
5330
- visible: O,
5331
- setModalVisibility: H,
5330
+ D && /* @__PURE__ */ jsx(HelpModal, {
5331
+ visible: D,
5332
+ setModalVisibility: V,
5332
5333
  validationRules: u,
5333
- t: P
5334
+ t: N
5334
5335
  }),
5335
- k && t && /* @__PURE__ */ jsx(SmartUploadModal, {
5336
- visible: E,
5337
- prompt: A,
5338
- onUpload: N,
5339
- onCloseModal: () => V({ callback: j }),
5340
- onComplete: K,
5341
- onError: M,
5342
- heading: P("smartUpload_smartUpload"),
5343
- dialogText: P("smartUpload_description"),
5344
- fileInputText: P("chooseFile"),
5345
- fileInputPlaceholder: P("noFileSelected"),
5346
- uploadText: P("uploadCapitalized"),
5347
- cancelText: P("cancel"),
5336
+ O && t && /* @__PURE__ */ jsx(SmartUploadModal, {
5337
+ visible: T,
5338
+ prompt: k,
5339
+ onUpload: M,
5340
+ onCloseModal: () => B({ callback: A }),
5341
+ onComplete: G,
5342
+ onError: j,
5343
+ heading: N("smartUpload_smartUpload"),
5344
+ dialogText: N("smartUpload_description"),
5345
+ fileInputText: N("chooseFile"),
5346
+ fileInputPlaceholder: N("noFileSelected"),
5347
+ uploadText: N("uploadCapitalized"),
5348
+ cancelText: N("cancel"),
5348
5349
  testId: n
5349
5350
  }),
5350
5351
  /* @__PURE__ */ jsx(ModalsRenderer, {
5351
- modals: x,
5352
- modalVisibility: w == null ? void 0 : w.modalVisibility,
5353
- onCloseModal: V,
5352
+ modals: b,
5353
+ modalVisibility: C == null ? void 0 : C.modalVisibility,
5354
+ onCloseModal: B,
5354
5355
  testId: n
5355
5356
  })
5356
5357
  ] });
@@ -6628,30 +6629,30 @@ var tree_module_default = {
6628
6629
  placeholderContainer: "_placeholderContainer_1cqsz_38"
6629
6630
  };
6630
6631
  const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, draggable: o, icons: s, onDrop: c }) => {
6631
- let { id: l, data: u } = t, { active: d, testId: f, onClick: p, actions: m = [] } = u, [h, _] = React.useState(!1), [v, y] = React.useState(0), b = (e) => {
6632
+ let { id: l, data: u } = t, { active: d, disabled: f, testId: p, onClick: m, actions: h = [] } = u, [_, v] = React.useState(!1), [y, b] = React.useState(0), x = (e) => {
6632
6633
  e.stopPropagation(), i(l);
6633
- }, x = (e) => {
6634
- e.preventDefault(), e.stopPropagation(), h || (_(!0), y((/* @__PURE__ */ new Date()).getTime()));
6635
6634
  }, S = (e) => {
6636
- e.preventDefault(), e.stopPropagation(), (/* @__PURE__ */ new Date()).getTime() - v > 20 && _(!1);
6635
+ e.preventDefault(), e.stopPropagation(), _ || (v(!0), b((/* @__PURE__ */ new Date()).getTime()));
6637
6636
  }, C = (e) => {
6638
- e.preventDefault(), e.stopPropagation(), a && !r && (/* @__PURE__ */ new Date()).getTime() - v > 200 && b(e);
6637
+ e.preventDefault(), e.stopPropagation(), (/* @__PURE__ */ new Date()).getTime() - y > 20 && v(!1);
6639
6638
  }, w = (e) => {
6640
- e.preventDefault(), e.stopPropagation(), _(!1), y((/* @__PURE__ */ new Date()).getTime()), c == null || c(e);
6639
+ e.preventDefault(), e.stopPropagation(), a && !r && (/* @__PURE__ */ new Date()).getTime() - y > 200 && x(e);
6640
+ }, T = (e) => {
6641
+ e.preventDefault(), e.stopPropagation(), v(!1), b((/* @__PURE__ */ new Date()).getTime()), c == null || c(e);
6641
6642
  };
6642
6643
  return /* @__PURE__ */ jsx("div", {
6643
- className: cx(list_module_default.item, list_module_default.action, d ? list_module_default.active : "", n > 0 ? list_module_default.indented : "", h ? list_module_default.bordered : ""),
6644
+ className: cx(list_module_default.item, f ? "" : list_module_default.action, d ? list_module_default.active : "", f ? list_module_default.disabled : "", n > 0 ? list_module_default.indented : "", _ ? list_module_default.bordered : ""),
6644
6645
  style: { marginInlineStart: n * 24 },
6645
- "data-testid": f,
6646
+ "data-testid": p,
6646
6647
  onClick: (e) => {
6647
- p ? p(e) : a && b(e);
6648
+ f || (m ? m(e) : a && x(e));
6648
6649
  },
6649
- onDrop: (e) => c ? w(e) : {},
6650
- onDragEnter: (e) => c ? x(e) : {},
6651
- onDragOver: (e) => c ? C(e) : {},
6652
- onDragLeave: (e) => c ? S(e) : {},
6650
+ onDrop: (e) => c ? T(e) : {},
6651
+ onDragEnter: (e) => c ? S(e) : {},
6652
+ onDragOver: (e) => c ? w(e) : {},
6653
+ onDragLeave: (e) => c ? C(e) : {},
6653
6654
  children: /* @__PURE__ */ jsxs("div", {
6654
- className: cx(list_module_default.itemHeader, h ? list_module_default.noPointerEvents : ""),
6655
+ className: cx(list_module_default.itemHeader, _ ? list_module_default.noPointerEvents : ""),
6655
6656
  children: [
6656
6657
  a && /* @__PURE__ */ jsx("div", {
6657
6658
  className: tree_module_default.toggle,
@@ -6661,7 +6662,7 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
6661
6662
  small: !0,
6662
6663
  round: !0,
6663
6664
  icon: r ? (s == null ? void 0 : s.collapse) || IconType.COLLAPSE : (s == null ? void 0 : s.expand) || IconType.EXPAND,
6664
- onClick: b
6665
+ onClick: x
6665
6666
  })
6666
6667
  }),
6667
6668
  o && /* @__PURE__ */ jsx("div", {
@@ -6669,12 +6670,12 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
6669
6670
  children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG })
6670
6671
  }),
6671
6672
  /* @__PURE__ */ jsx(MetaContent, { item: u }),
6672
- /* @__PURE__ */ jsx("div", {
6673
+ /* @__PURE__ */ jsxs("div", {
6673
6674
  className: list_module_default.right,
6674
- children: /* @__PURE__ */ jsx("div", {
6675
+ children: [/* @__PURE__ */ jsx(MetaCount, { item: u }), !f && h.length > 0 && /* @__PURE__ */ jsx("div", {
6675
6676
  className: list_module_default.actions,
6676
- children: /* @__PURE__ */ jsx(Actions, { actions: m })
6677
- })
6677
+ children: /* @__PURE__ */ jsx(Actions, { actions: h })
6678
+ })]
6678
6679
  })
6679
6680
  ]
6680
6681
  })
@@ -7061,7 +7062,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7061
7062
  } : {
7062
7063
  value: G,
7063
7064
  unit: U
7064
- }), J = k || (K == null ? void 0 : K.value) === void 0, [Y, X] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), ee = !!(O || n), Z = C && C.find((e) => {
7065
+ }), J = k || (K == null ? void 0 : K.value) === void 0, [Y, ee] = useState(w ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM), te = !!(O || n), X = C && C.find((e) => {
7065
7066
  if (!(e != null && e.value)) return;
7066
7067
  if (E) return E === e.valueKey;
7067
7068
  let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
@@ -7070,7 +7071,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7070
7071
  toUnit: t
7071
7072
  });
7072
7073
  return withUnit(n, t) === e.value;
7073
- }), te = () => {
7074
+ }), ne = () => {
7074
7075
  var e;
7075
7076
  let t = (e = l) == null ? "" : e, n = K.unit;
7076
7077
  if (!checkConversion({
@@ -7086,7 +7087,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7086
7087
  } catch {
7087
7088
  return null;
7088
7089
  }
7089
- }, ne = (t) => {
7090
+ }, re = (t) => {
7090
7091
  let n = getStringName(e), r = t.target, { value: i, selectionStart: a } = r, o = withUnit(i, (K == null ? void 0 : K.unit) || "");
7091
7092
  h({ target: {
7092
7093
  value: A ? withUnit(convertAndGetValue(o, B), B) : o,
@@ -7099,7 +7100,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7099
7100
  }), R(() => {
7100
7101
  r.selectionStart = a, r.selectionEnd = a;
7101
7102
  });
7102
- }, re = (e, t) => {
7103
+ }, ie = (e, t) => {
7103
7104
  t === K.unit || isNaN(Number(e)) || (q({
7104
7105
  value: e,
7105
7106
  unit: t
@@ -7130,7 +7131,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7130
7131
  e !== void 0 && q({
7131
7132
  value: e,
7132
7133
  unit: t
7133
- }), X(C && Z && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
7134
+ }), ee(C && X && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
7134
7135
  }
7135
7136
  }, [
7136
7137
  U,
@@ -7138,7 +7139,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7138
7139
  i,
7139
7140
  T
7140
7141
  ]);
7141
- let Q = te(), $ = label(K.unit) || K.unit || "", ie = p || !Q || Q && Q.length === 1, ae = getStringName(e), oe, se = (t) => {
7142
+ let Z = ne(), Q = label(K.unit) || K.unit || "", ae = p || !Z || Z && Z.length === 1, oe = getStringName(e), $, se = (t) => {
7142
7143
  let r = t != null && t.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
7143
7144
  if (checkConversion({
7144
7145
  value: r,
@@ -7158,7 +7159,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7158
7159
  type: MenuType.OPTION,
7159
7160
  inline: !0,
7160
7161
  onClick: () => {
7161
- validateNumber(i).valid && !n && (X(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
7162
+ validateNumber(i).valid && !n && (ee(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
7162
7163
  value: r,
7163
7164
  name: typeof e == "string" ? e : (e == null ? void 0 : e.fieldName) || "",
7164
7165
  predefinedSelected: !0,
@@ -7170,10 +7171,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7170
7171
  height: "0"
7171
7172
  })] }),
7172
7173
  description: o,
7173
- selected: Z === t && Y === PredefinedOptionsMenuState.PREDEFINED
7174
+ selected: X === t && Y === PredefinedOptionsMenuState.PREDEFINED
7174
7175
  };
7175
7176
  };
7176
- if (oe = [{
7177
+ if ($ = [{
7177
7178
  type: MenuType.OPTION,
7178
7179
  inline: !0,
7179
7180
  onClick: () => {
@@ -7186,7 +7187,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7186
7187
  selected: Y === PredefinedOptionsMenuState.CUSTOM
7187
7188
  }], C != null && C.length) {
7188
7189
  let e = C.map(se);
7189
- oe = [...oe, ...e];
7190
+ $ = [...$, ...e];
7190
7191
  }
7191
7192
  let ce = (e) => {
7192
7193
  if (isValueWithUnit(e)) {
@@ -7222,39 +7223,39 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7222
7223
  small: o
7223
7224
  }),
7224
7225
  small: o,
7225
- sections: oe
7226
+ sections: $
7226
7227
  },
7227
- tooltip: Y === PredefinedOptionsMenuState.PREDEFINED ? Z == null ? void 0 : Z.label : ""
7228
+ tooltip: Y === PredefinedOptionsMenuState.PREDEFINED ? X == null ? void 0 : X.label : ""
7228
7229
  }),
7229
7230
  /* @__PURE__ */ jsx("div", {
7230
7231
  className: unit_input_module_default.inputWrapper,
7231
7232
  children: /* @__PURE__ */ jsx(NumberInput, {
7232
- name: ae,
7233
+ name: oe,
7233
7234
  testId: x,
7234
7235
  disabled: n,
7235
7236
  placeholder: ce(t),
7236
7237
  value: K.value,
7237
- onChange: ne,
7238
+ onChange: re,
7238
7239
  onFocus: v,
7239
7240
  error: i === null ? void 0 : i,
7240
7241
  warning: S === null ? void 0 : S,
7241
7242
  left: a,
7242
7243
  allowEmpty: J,
7243
- validationCallback: (e, t) => D(ae, t),
7244
+ validationCallback: (e, t) => D(oe, t),
7244
7245
  enableCosmeticRounding: j,
7245
7246
  enableDisplayRounding: M,
7246
7247
  roundDisplayValue: N,
7247
7248
  groupOrder: le,
7248
- disableInternalErrorValidationMessages: ee,
7249
+ disableInternalErrorValidationMessages: te,
7249
7250
  small: o,
7250
7251
  selectOnFocus: P,
7251
7252
  tooltip: I
7252
- }, ae)
7253
+ }, oe)
7253
7254
  }),
7254
- $ && (ie || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
7255
+ Q && (ae || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
7255
7256
  groupOrder: ue,
7256
7257
  small: o,
7257
- children: $
7258
+ children: Q
7258
7259
  }) : /* @__PURE__ */ jsx(Menu, {
7259
7260
  groupOrder: ue,
7260
7261
  maxHeight: 380,
@@ -7262,20 +7263,20 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7262
7263
  testId: x && `${x}-menu`,
7263
7264
  tabIndex: -1,
7264
7265
  menu: {
7265
- label: $,
7266
+ label: Q,
7266
7267
  trigger: "DropDownButton",
7267
7268
  small: o,
7268
- sections: Q.map(([e = "", t = "", n]) => {
7269
+ sections: Z.map(([e = "", t = "", n]) => {
7269
7270
  let r = n || t || "", i = isValidNum(e) ? e : "";
7270
7271
  return {
7271
7272
  type: "Option",
7272
7273
  label: j ? safeRoundNumbers(i) : i,
7273
7274
  inline: !0,
7274
7275
  onClick: (n) => {
7275
- n.stopPropagation(), re(e, t);
7276
+ n.stopPropagation(), ie(e, t);
7276
7277
  },
7277
7278
  description: r,
7278
- selected: r === $,
7279
+ selected: r === Q,
7279
7280
  testId: `${x}-unit-${r}`
7280
7281
  };
7281
7282
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "5.15.3-beta-2",
3
+ "version": "5.15.4",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {