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

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
@@ -793,8 +793,8 @@ declare interface IListItem {
793
793
  disabled?: boolean;
794
794
  onClick?: (evt: any) => void;
795
795
  title?: string;
796
- details?: string;
797
- metadata?: string;
796
+ details?: string | ReactElement;
797
+ metadata?: string | ReactElement;
798
798
  testId?: string;
799
799
  level?: number;
800
800
  label?: ILabel;
@@ -1393,6 +1393,12 @@ declare interface ISimpleCell extends TCommonCell {
1393
1393
  type?: TCellType;
1394
1394
  }
1395
1395
 
1396
+ export declare interface ISkeletonProps {
1397
+ count?: number;
1398
+ width?: string | number;
1399
+ height?: string | number;
1400
+ }
1401
+
1396
1402
  declare interface ISliderCell extends TCommonCell {
1397
1403
  type: TCellType;
1398
1404
  label?: string | null;
@@ -1550,6 +1556,7 @@ export declare interface ITableImportExportConfig {
1550
1556
  copyFromClipBoard?: boolean;
1551
1557
  showDeleteOptions?: boolean;
1552
1558
  showHelpOption?: boolean;
1559
+ showUploadFileOption?: boolean;
1553
1560
  onDeleteRows?: (type: 'all') => void;
1554
1561
  onImportComplete?: (data: IImportData) => void;
1555
1562
  }
@@ -2008,6 +2015,8 @@ export declare const SettingField: ({ helpText, disabled, showCustom, children,
2008
2015
 
2009
2016
  export declare const SideBar: default_2.MemoExoticComponent<({ options, startOpen, onShiftClickToggleOpen, top, }: ISideBarProps) => JSX_2.Element>;
2010
2017
 
2018
+ export declare const Skeleton: ({ count, width, height }: ISkeletonProps) => JSX_2.Element;
2019
+
2011
2020
  export declare const Slider: ({ name, label, width, labelWidth, value, min, max, step, marks, showArrows, showTooltip, tooltipFormatter, disabled, range, small, vertical, onChange, }: ISliderProps) => JSX_2.Element;
2012
2021
 
2013
2022
  export declare const SmartUploadModal: ({ visible, prompt, onCloseModal, onUpload, onComplete, onFailed, onError, width, heading, dialogText, fileInputText, fileInputPlaceholder, uploadText, cancelText, testId, }: ISmartUploadModalProps) => JSX_2.Element;
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import { cloneDeep, cloneDeepWith, debounce, every, get, isArray, isBoolean, isE
10
10
  import styled, { css } from "styled-components";
11
11
  import { Resizable } from "react-resizable";
12
12
  import { createPortal } from "react-dom";
13
- import { ALT_UNITS, KNOWN_UNITS, altUnitsList, cleanNumStr, convertAndGetValue, convertSamePrecision, getAltUnitsListByQuantity, getUnit, getUnitsForQuantity, getValue, isNumeric, isScientificStringNum, isValidNum, isValueWithUnit, label, roundByMagnitude, roundByMagnitudeToFixed, roundToFixed, roundToPrecision, split, stripLeadingZeros, toNum, toString, unitFromQuantity, validateNumber, withPrettyUnitLabel, withUnit } from "@oliasoft-open-source/units";
13
+ import { ALT_UNITS, KNOWN_UNITS, altUnitsList, cleanNumStr, convertAndGetValue, convertSamePrecision, getAltUnitsListByQuantity, getUnit, getUnitsForQuantity, getValue, isScientificStringNum, isValidNum, isValueWithUnit, label, roundByMagnitude, roundByMagnitudeToFixed, roundToFixed, roundToPrecision, split, stripLeadingZeros, toNum, toString, unitFromQuantity, validateNumber, withPrettyUnitLabel, withUnit } from "@oliasoft-open-source/units";
14
14
  import { FixedSizeList } from "react-window";
15
15
  import { SortableContext, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
16
16
  import { CSS } from "@dnd-kit/utilities";
@@ -27,6 +27,8 @@ import { EditorContent, useEditor } from "@tiptap/react";
27
27
  import StarterKit from "@tiptap/starter-kit";
28
28
  import Placeholder from "@tiptap/extension-placeholder";
29
29
  import { Markdown } from "@tiptap/markdown";
30
+ import ReactLoadingSkeleton from "react-loading-skeleton";
31
+ import "react-loading-skeleton/dist/skeleton.css";
30
32
  import { DndProvider } from "react-dnd";
31
33
  import { MultiBackend, Tree as Tree$1, getBackendOptions } from "@minoru/react-dnd-treeview";
32
34
  import ReactDiffViewer, { DiffMethod } from "react-diff-viewer-continued";
@@ -5200,158 +5202,158 @@ var initialState = {
5200
5202
  };
5201
5203
  const TableImportExport = ({ config: e, smartUploadConfig: t, testId: n }) => {
5202
5204
  var r, i, a, o;
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({
5205
+ 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({
5204
5206
  config: e,
5205
- state: C,
5206
- setState: w,
5207
+ state: w,
5208
+ setState: T,
5207
5209
  smartUploadConfig: t,
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
- {
5210
+ startTransition: L
5211
+ }), { readAndParseInput: z, updateState: B, closeModals: V, setModalVisibility: H, onFileChange: U, onClickQuickPasteFromClipBoard: W, onClickCopyClipboard: G, onSmartUploadResult: K, deleteAllRows: q } = R == null ? {} : R;
5212
+ useKeyboardEvent("Escape", () => V());
5213
+ let J = g ? [
5214
+ ...b ? [{
5213
5215
  type: "Option",
5214
- label: N("uploadFile"),
5216
+ label: P("uploadFile"),
5215
5217
  upload: !0,
5216
5218
  uploadType: ".csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
5217
- onChange: H,
5219
+ onChange: U,
5218
5220
  testId: `${n}-option-upload-file`
5219
- },
5221
+ }] : [],
5220
5222
  ..._ ? [{
5221
5223
  type: "Option",
5222
- label: N("quickPasteFromClipboard"),
5223
- onClick: U,
5224
+ label: P("quickPasteFromClipboard"),
5225
+ onClick: W,
5224
5226
  testId: `${n}-option-quick-paste-from-clipboard`
5225
5227
  }] : [],
5226
5228
  ..._ ? [{
5227
5229
  type: "Option",
5228
- label: N("pasteWithReview"),
5229
- onClick: () => V("reviewPasteModal", !E),
5230
+ label: P("pasteWithReview"),
5231
+ onClick: () => H("reviewPasteModal", !D),
5230
5232
  testId: `${n}-paste-with-review`
5231
5233
  }] : [],
5232
- ...k && O && t ? [{
5234
+ ...A && k && t ? [{
5233
5235
  type: "Option",
5234
- label: N("smartUpload_smartUpload"),
5235
- onClick: () => V("smartUploadModal", !T),
5236
+ label: P("smartUpload_smartUpload"),
5237
+ onClick: () => H("smartUploadModal", !E),
5236
5238
  testId: `${n}-smart-upload`
5237
5239
  }] : [],
5238
- ...applyModalHandlers((r = x == null ? void 0 : x.importOptions) == null ? [] : r, C, V)
5239
- ] : [], J = [
5240
+ ...applyModalHandlers((r = S == null ? void 0 : S.importOptions) == null ? [] : r, w, H)
5241
+ ] : [], Y = [
5240
5242
  {
5241
5243
  type: "Option",
5242
- label: N("downloadFile"),
5244
+ label: P("downloadFile"),
5243
5245
  onClick: async () => {
5244
- let e = await P();
5246
+ let e = await F();
5245
5247
  e && e && onClickDownLoad(e, d);
5246
5248
  }
5247
5249
  },
5248
5250
  ...p ? [{
5249
5251
  type: "Option",
5250
- label: N("copyToClipboard"),
5251
- onClick: () => W("dot")
5252
+ label: P("copyToClipboard"),
5253
+ onClick: () => G("dot")
5252
5254
  }] : [{
5253
5255
  type: "Menu",
5254
5256
  testId: `${n}-menu-copy-to-clipboard`,
5255
5257
  menu: {
5256
5258
  trigger: "Text",
5257
- label: N("copyToClipboard"),
5259
+ label: P("copyToClipboard"),
5258
5260
  sections: [{
5259
5261
  type: "Option",
5260
- label: N("copyDecimalDot"),
5261
- onClick: () => W("dot"),
5262
+ label: P("copyDecimalDot"),
5263
+ onClick: () => G("dot"),
5262
5264
  testId: `${n}-option-copy-decimal-dot`
5263
5265
  }, {
5264
5266
  type: "Option",
5265
- label: N("copyDecimalComma"),
5266
- onClick: () => W("comma")
5267
+ label: P("copyDecimalComma"),
5268
+ onClick: () => G("comma")
5267
5269
  }]
5268
5270
  }
5269
5271
  }],
5270
- ...applyModalHandlers((i = x == null ? void 0 : x.exportOptions) == null ? [] : i, C, V)
5271
- ], Y = v ? [{
5272
+ ...applyModalHandlers((i = S == null ? void 0 : S.exportOptions) == null ? [] : i, w, H)
5273
+ ], X = v ? [{
5272
5274
  type: "Option",
5273
- label: N("deleteAllRows"),
5274
- onClick: () => K(),
5275
+ label: P("deleteAllRows"),
5276
+ onClick: () => q(),
5275
5277
  testId: `${n}-delete-all-rows`
5276
- }, ...applyModalHandlers((a = x == null ? void 0 : x.deleteOptions) == null ? [] : a, C, V)] : [], ee = y ? [
5278
+ }, ...applyModalHandlers((a = S == null ? void 0 : S.deleteOptions) == null ? [] : a, w, H)] : [], ee = y ? [
5277
5279
  { type: "Divider" },
5278
5280
  {
5279
5281
  type: "Option",
5280
- label: N("help"),
5281
- onClick: () => V("helpModal", !D)
5282
+ label: P("help"),
5283
+ onClick: () => H("helpModal", !O)
5282
5284
  },
5283
- ...applyModalHandlers((o = x == null ? void 0 : x.helpOptions) == null ? [] : o, C, V)
5284
- ] : [], te = [
5285
- ...q.length ? [{
5286
- section: [...q, ...ee],
5285
+ ...applyModalHandlers((o = S == null ? void 0 : S.helpOptions) == null ? [] : o, w, H)
5286
+ ] : [], Z = [
5287
+ ...J.length ? [{
5288
+ section: [...J, ...ee],
5287
5289
  name: "import-options",
5288
5290
  iconName: "import",
5289
- tooltip: N("import")
5291
+ tooltip: P("import")
5290
5292
  }] : [],
5291
- ...J.length ? [{
5292
- section: J,
5293
+ ...Y.length ? [{
5294
+ section: Y,
5293
5295
  name: "export-options",
5294
5296
  iconName: "export",
5295
- tooltip: N("export")
5297
+ tooltip: P("export")
5296
5298
  }] : [],
5297
- ...Y.length ? [{
5298
- section: Y,
5299
+ ...X.length ? [{
5300
+ section: X,
5299
5301
  name: "delete-options",
5300
5302
  iconName: "delete",
5301
- tooltip: N("deleteAllRows")
5303
+ tooltip: P("deleteAllRows")
5302
5304
  }] : []
5303
5305
  ];
5304
5306
  return /* @__PURE__ */ jsxs("span", { children: [
5305
- F && /* @__PURE__ */ jsx(Spinner, {
5307
+ I && /* @__PURE__ */ jsx(Spinner, {
5306
5308
  small: !0,
5307
5309
  dark: !0
5308
5310
  }),
5309
- te.map((e, t) => /* @__PURE__ */ jsx(MenuComponent, {
5311
+ Z.map((e, t) => /* @__PURE__ */ jsx(MenuComponent, {
5310
5312
  sections: e.section,
5311
5313
  iconName: e.iconName,
5312
5314
  tooltip: e.tooltip,
5313
5315
  testId: `data-${e == null ? void 0 : e.name}-menu`
5314
5316
  }, t)),
5315
- E && /* @__PURE__ */ jsx(PasteWithReviewModal, {
5317
+ D && /* @__PURE__ */ jsx(PasteWithReviewModal, {
5316
5318
  config: e,
5317
- state: C,
5318
- updateState: z,
5319
- setModalVisibility: V,
5320
- readAndParseInput: R,
5321
- onCloseModal: B,
5319
+ state: w,
5320
+ updateState: B,
5321
+ setModalVisibility: H,
5322
+ readAndParseInput: z,
5323
+ onCloseModal: V,
5322
5324
  validationRules: u,
5323
- onCompleteImport: S,
5325
+ onCompleteImport: C,
5324
5326
  prevalidationConfig: l,
5325
- t: N,
5326
- loading: F,
5327
- startTransition: I,
5327
+ t: P,
5328
+ loading: I,
5329
+ startTransition: L,
5328
5330
  testId: n
5329
5331
  }),
5330
- D && /* @__PURE__ */ jsx(HelpModal, {
5331
- visible: D,
5332
- setModalVisibility: V,
5332
+ O && /* @__PURE__ */ jsx(HelpModal, {
5333
+ visible: O,
5334
+ setModalVisibility: H,
5333
5335
  validationRules: u,
5334
- t: N
5336
+ t: P
5335
5337
  }),
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"),
5338
+ k && t && /* @__PURE__ */ jsx(SmartUploadModal, {
5339
+ visible: E,
5340
+ prompt: A,
5341
+ onUpload: N,
5342
+ onCloseModal: () => V({ callback: j }),
5343
+ onComplete: K,
5344
+ onError: M,
5345
+ heading: P("smartUpload_smartUpload"),
5346
+ dialogText: P("smartUpload_description"),
5347
+ fileInputText: P("chooseFile"),
5348
+ fileInputPlaceholder: P("noFileSelected"),
5349
+ uploadText: P("uploadCapitalized"),
5350
+ cancelText: P("cancel"),
5349
5351
  testId: n
5350
5352
  }),
5351
5353
  /* @__PURE__ */ jsx(ModalsRenderer, {
5352
- modals: b,
5353
- modalVisibility: C == null ? void 0 : C.modalVisibility,
5354
- onCloseModal: B,
5354
+ modals: x,
5355
+ modalVisibility: w == null ? void 0 : w.modalVisibility,
5356
+ onCloseModal: V,
5355
5357
  testId: n
5356
5358
  })
5357
5359
  ] });
@@ -6283,6 +6285,19 @@ const Link$1 = ({ isOpen: e, items: t, sectionIndex: n, onClick: r, testId: i })
6283
6285
  })
6284
6286
  });
6285
6287
  }, (e, t) => isEqual$1(e, t));
6288
+ var skeleton_module_default = {
6289
+ skeletonContainer: "_skeletonContainer_k2td0_9",
6290
+ skeleton: "_skeleton_k2td0_9"
6291
+ };
6292
+ const Skeleton = ({ count: e, width: t, height: n }) => /* @__PURE__ */ jsx(ReactLoadingSkeleton, {
6293
+ baseColor: "var(--color-skeleton-base)",
6294
+ highlightColor: "var(--color-skeleton-highlight)",
6295
+ containerClassName: skeleton_module_default.skeletonContainer,
6296
+ className: skeleton_module_default.skeleton,
6297
+ count: e,
6298
+ width: t,
6299
+ height: n
6300
+ });
6286
6301
  var tabs_module_default = {
6287
6302
  tabs: "_tabs_1y79t_1",
6288
6303
  padding: "_padding_1y79t_7",
@@ -7061,7 +7076,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7061
7076
  } : {
7062
7077
  value: G,
7063
7078
  unit: U
7064
- }), 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) => {
7079
+ }), 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
7080
  if (!(e != null && e.value)) return;
7066
7081
  if (E) return E === e.valueKey;
7067
7082
  let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
@@ -7070,7 +7085,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7070
7085
  toUnit: t
7071
7086
  });
7072
7087
  return withUnit(n, t) === e.value;
7073
- }), ne = () => {
7088
+ }), te = () => {
7074
7089
  var e;
7075
7090
  let t = (e = l) == null ? "" : e, n = K.unit;
7076
7091
  if (!checkConversion({
@@ -7086,7 +7101,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7086
7101
  } catch {
7087
7102
  return null;
7088
7103
  }
7089
- }, re = (t) => {
7104
+ }, ne = (t) => {
7090
7105
  let n = getStringName(e), r = t.target, { value: i, selectionStart: a } = r, o = withUnit(i, (K == null ? void 0 : K.unit) || "");
7091
7106
  h({ target: {
7092
7107
  value: A ? withUnit(convertAndGetValue(o, B), B) : o,
@@ -7099,7 +7114,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7099
7114
  }), R(() => {
7100
7115
  r.selectionStart = a, r.selectionEnd = a;
7101
7116
  });
7102
- }, ie = (e, t) => {
7117
+ }, re = (e, t) => {
7103
7118
  t === K.unit || isNaN(Number(e)) || (q({
7104
7119
  value: e,
7105
7120
  unit: t
@@ -7130,7 +7145,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7130
7145
  e !== void 0 && q({
7131
7146
  value: e,
7132
7147
  unit: t
7133
- }), ee(C && X && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
7148
+ }), X(C && Z && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
7134
7149
  }
7135
7150
  }, [
7136
7151
  U,
@@ -7138,7 +7153,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7138
7153
  i,
7139
7154
  T
7140
7155
  ]);
7141
- let Z = ne(), Q = label(K.unit) || K.unit || "", ae = p || !Z || Z && Z.length === 1, oe = getStringName(e), $, se = (t) => {
7156
+ let Q = te(), $ = label(K.unit) || K.unit || "", ie = p || !Q || Q && Q.length === 1, ae = getStringName(e), oe, se = (t) => {
7142
7157
  let r = t != null && t.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
7143
7158
  if (checkConversion({
7144
7159
  value: r,
@@ -7158,7 +7173,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7158
7173
  type: MenuType.OPTION,
7159
7174
  inline: !0,
7160
7175
  onClick: () => {
7161
- validateNumber(i).valid && !n && (ee(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
7176
+ validateNumber(i).valid && !n && (X(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
7162
7177
  value: r,
7163
7178
  name: typeof e == "string" ? e : (e == null ? void 0 : e.fieldName) || "",
7164
7179
  predefinedSelected: !0,
@@ -7170,10 +7185,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7170
7185
  height: "0"
7171
7186
  })] }),
7172
7187
  description: o,
7173
- selected: X === t && Y === PredefinedOptionsMenuState.PREDEFINED
7188
+ selected: Z === t && Y === PredefinedOptionsMenuState.PREDEFINED
7174
7189
  };
7175
7190
  };
7176
- if ($ = [{
7191
+ if (oe = [{
7177
7192
  type: MenuType.OPTION,
7178
7193
  inline: !0,
7179
7194
  onClick: () => {
@@ -7186,7 +7201,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7186
7201
  selected: Y === PredefinedOptionsMenuState.CUSTOM
7187
7202
  }], C != null && C.length) {
7188
7203
  let e = C.map(se);
7189
- $ = [...$, ...e];
7204
+ oe = [...oe, ...e];
7190
7205
  }
7191
7206
  let ce = (e) => {
7192
7207
  if (isValueWithUnit(e)) {
@@ -7222,39 +7237,39 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7222
7237
  small: o
7223
7238
  }),
7224
7239
  small: o,
7225
- sections: $
7240
+ sections: oe
7226
7241
  },
7227
- tooltip: Y === PredefinedOptionsMenuState.PREDEFINED ? X == null ? void 0 : X.label : ""
7242
+ tooltip: Y === PredefinedOptionsMenuState.PREDEFINED ? Z == null ? void 0 : Z.label : ""
7228
7243
  }),
7229
7244
  /* @__PURE__ */ jsx("div", {
7230
7245
  className: unit_input_module_default.inputWrapper,
7231
7246
  children: /* @__PURE__ */ jsx(NumberInput, {
7232
- name: oe,
7247
+ name: ae,
7233
7248
  testId: x,
7234
7249
  disabled: n,
7235
7250
  placeholder: ce(t),
7236
7251
  value: K.value,
7237
- onChange: re,
7252
+ onChange: ne,
7238
7253
  onFocus: v,
7239
7254
  error: i === null ? void 0 : i,
7240
7255
  warning: S === null ? void 0 : S,
7241
7256
  left: a,
7242
7257
  allowEmpty: J,
7243
- validationCallback: (e, t) => D(oe, t),
7258
+ validationCallback: (e, t) => D(ae, t),
7244
7259
  enableCosmeticRounding: j,
7245
7260
  enableDisplayRounding: M,
7246
7261
  roundDisplayValue: N,
7247
7262
  groupOrder: le,
7248
- disableInternalErrorValidationMessages: te,
7263
+ disableInternalErrorValidationMessages: ee,
7249
7264
  small: o,
7250
7265
  selectOnFocus: P,
7251
7266
  tooltip: I
7252
- }, oe)
7267
+ }, ae)
7253
7268
  }),
7254
- Q && (ae || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
7269
+ $ && (ie || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
7255
7270
  groupOrder: ue,
7256
7271
  small: o,
7257
- children: Q
7272
+ children: $
7258
7273
  }) : /* @__PURE__ */ jsx(Menu, {
7259
7274
  groupOrder: ue,
7260
7275
  maxHeight: 380,
@@ -7262,20 +7277,20 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
7262
7277
  testId: x && `${x}-menu`,
7263
7278
  tabIndex: -1,
7264
7279
  menu: {
7265
- label: Q,
7280
+ label: $,
7266
7281
  trigger: "DropDownButton",
7267
7282
  small: o,
7268
- sections: Z.map(([e = "", t = "", n]) => {
7283
+ sections: Q.map(([e = "", t = "", n]) => {
7269
7284
  let r = n || t || "", i = isValidNum(e) ? e : "";
7270
7285
  return {
7271
7286
  type: "Option",
7272
7287
  label: j ? safeRoundNumbers(i) : i,
7273
7288
  inline: !0,
7274
7289
  onClick: (n) => {
7275
- n.stopPropagation(), ie(e, t);
7290
+ n.stopPropagation(), re(e, t);
7276
7291
  },
7277
7292
  description: r,
7278
- selected: r === Q,
7293
+ selected: r === $,
7279
7294
  testId: `${x}-unit-${r}`
7280
7295
  };
7281
7296
  })
@@ -8911,7 +8926,7 @@ const countDeltas = (e) => (Array.isArray(e) ? e : e ? [e] : []).reduce((e, t) =
8911
8926
  case 1: {
8912
8927
  let [t] = e;
8913
8928
  return {
8914
- type: "created",
8929
+ type: "Created",
8915
8930
  before: "",
8916
8931
  after: toText(t)
8917
8932
  };
@@ -8919,7 +8934,7 @@ const countDeltas = (e) => (Array.isArray(e) ? e : e ? [e] : []).reduce((e, t) =
8919
8934
  case 2: {
8920
8935
  let [t, n] = e;
8921
8936
  return {
8922
- type: "modified",
8937
+ type: "Modified",
8923
8938
  before: toText(t),
8924
8939
  after: toText(n)
8925
8940
  };
@@ -8927,13 +8942,13 @@ const countDeltas = (e) => (Array.isArray(e) ? e : e ? [e] : []).reduce((e, t) =
8927
8942
  case 3: {
8928
8943
  let [t] = e;
8929
8944
  return {
8930
- type: "deleted",
8945
+ type: "Deleted",
8931
8946
  before: toText(t),
8932
8947
  after: ""
8933
8948
  };
8934
8949
  }
8935
8950
  default: return {
8936
- type: "modified",
8951
+ type: "Modified",
8937
8952
  before: "",
8938
8953
  after: ""
8939
8954
  };
@@ -8963,43 +8978,23 @@ const createDiffJson = (e, t, n) => {
8963
8978
  oldJson: a,
8964
8979
  newJson: o
8965
8980
  };
8966
- };
8967
- var humanize = (e) => e.replace(/\[\d+\]/g, "").replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\s+/g, " ").trim().replace(/^./, (e) => e.toUpperCase()), formatValue = (e) => {
8968
- if (e == null || e === "") return "empty";
8969
- if (typeof e == "boolean") return e ? "true" : "false";
8970
- if (typeof e == "string") return e;
8971
- if (typeof e == "number") return String(e);
8972
- if (Array.isArray(e)) return e.length ? e.join(", ") : "empty";
8973
- try {
8974
- return JSON.stringify(e);
8975
- } catch {
8976
- return String(e);
8977
- }
8978
- }, findReasonableProperty = (e, t = 0) => {
8979
- if (t >= e.length) return "Value";
8980
- let n = e[t];
8981
- return !n || isNumeric(n) ? findReasonableProperty(e, t + 1) : humanize(n);
8982
- }, buildChangeSentence = ({ userName: e, type: t, property: n, before: r, after: i, sectionName: a }) => {
8983
- let o = formatValue(r), s = formatValue(i);
8984
- switch (t) {
8985
- case "modified": return `${e} updated ${n} from ${o} to ${s} in ${a}.`;
8986
- case "created": return `${e} created ${s} in ${a}.`;
8987
- case "deleted": return `${e} deleted ${o} in ${a}.`;
8988
- default: return `${e} changed ${n} in ${a}.`;
8989
- }
8990
- };
8991
- const ChangesOverview = ({ sectionNames: e, userName: t, diffs: n }) => /* @__PURE__ */ jsx(Table, { table: {
8992
- headers: [{ cells: [{ value: "Changes" }] }],
8981
+ }, ChangesOverview = ({ sectionNames: e, userName: t, diffs: n }) => /* @__PURE__ */ jsx(Table, { table: {
8982
+ headers: [{ cells: [
8983
+ { value: "Modified By" },
8984
+ { value: "Type" },
8985
+ { value: "Before" },
8986
+ { value: "After" },
8987
+ { value: "" }
8988
+ ] }],
8993
8989
  rows: n.map((n) => {
8994
8990
  let { deltaFormat: r, path: i } = n, a = getSectionName(e, i), { type: o, before: s, after: c } = defaultMessage(r);
8995
- return { cells: [{ value: buildChangeSentence({
8996
- userName: t,
8997
- type: o,
8998
- property: findReasonableProperty(i),
8999
- before: s,
9000
- after: c,
9001
- sectionName: a
9002
- }) }] };
8991
+ return { cells: [
8992
+ { value: t },
8993
+ { value: o },
8994
+ { value: s },
8995
+ { value: c },
8996
+ { value: a }
8997
+ ] };
9003
8998
  })
9004
8999
  } }), viewTypes = Object.freeze({
9005
9000
  summary: {
@@ -9198,4 +9193,4 @@ const ComparisonViewModal = ({ auditLog: e, auditLogs: t, data: n, isOpen: r, se
9198
9193
  e === ConfigKeyType.Translations ? setConfig(e, getTranslations(t)) : setConfig(e, isPrimitiveValue(t) ? t : { ...t });
9199
9194
  });
9200
9195
  };
9201
- export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Collapse, Color, ColorInput, Column, Dialog, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, RichTextInput, Row, Select, SettingField, SideBar, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, TextTransform, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TreeTable, TriggerType, UnitInput, UnitTable, UsageTracker, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };
9196
+ export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Collapse, Color, ColorInput, Column, Dialog, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, RichTextInput, Row, Select, SettingField, SideBar, Skeleton, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, TextTransform, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TreeTable, TriggerType, UnitInput, UnitTable, UsageTracker, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "5.17.0-beta-11",
3
+ "version": "5.17.0",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {
@@ -60,6 +60,7 @@
60
60
  "react-fast-compare": "^3.2.2",
61
61
  "react-icons": "^5.5.0",
62
62
  "react-laag": "^2.0.5",
63
+ "react-loading-skeleton": "^3.5.0",
63
64
  "react-resizable": "^3.0.5",
64
65
  "react-router-dom": "^7.2.0",
65
66
  "react-svg": "^16.3.0",