@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/global.css +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +138 -137
- package/package.json +1 -1
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: "
|
|
1341
|
-
trigger: "
|
|
1342
|
-
buttonColor: "
|
|
1343
|
-
options: "
|
|
1344
|
-
option: "
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
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:
|
|
1354
|
-
onToggle:
|
|
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),
|
|
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:
|
|
1379
|
+
active: c,
|
|
1379
1380
|
width: r ? "var(--size-sm)" : "var(--size)",
|
|
1380
|
-
tooltip:
|
|
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,
|
|
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:
|
|
5205
|
-
setState:
|
|
5205
|
+
state: C,
|
|
5206
|
+
setState: w,
|
|
5206
5207
|
smartUploadConfig: t,
|
|
5207
|
-
startTransition:
|
|
5208
|
-
}), { readAndParseInput:
|
|
5209
|
-
useKeyboardEvent("Escape", () =>
|
|
5210
|
-
let
|
|
5211
|
-
|
|
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:
|
|
5214
|
+
label: N("uploadFile"),
|
|
5214
5215
|
upload: !0,
|
|
5215
5216
|
uploadType: ".csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
5216
|
-
onChange:
|
|
5217
|
+
onChange: H,
|
|
5217
5218
|
testId: `${n}-option-upload-file`
|
|
5218
|
-
}
|
|
5219
|
+
},
|
|
5219
5220
|
..._ ? [{
|
|
5220
5221
|
type: "Option",
|
|
5221
|
-
label:
|
|
5222
|
-
onClick:
|
|
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:
|
|
5228
|
-
onClick: () =>
|
|
5228
|
+
label: N("pasteWithReview"),
|
|
5229
|
+
onClick: () => V("reviewPasteModal", !E),
|
|
5229
5230
|
testId: `${n}-paste-with-review`
|
|
5230
5231
|
}] : [],
|
|
5231
|
-
...
|
|
5232
|
+
...k && O && t ? [{
|
|
5232
5233
|
type: "Option",
|
|
5233
|
-
label:
|
|
5234
|
-
onClick: () =>
|
|
5234
|
+
label: N("smartUpload_smartUpload"),
|
|
5235
|
+
onClick: () => V("smartUploadModal", !T),
|
|
5235
5236
|
testId: `${n}-smart-upload`
|
|
5236
5237
|
}] : [],
|
|
5237
|
-
...applyModalHandlers((r =
|
|
5238
|
-
] : [],
|
|
5238
|
+
...applyModalHandlers((r = x == null ? void 0 : x.importOptions) == null ? [] : r, C, V)
|
|
5239
|
+
] : [], J = [
|
|
5239
5240
|
{
|
|
5240
5241
|
type: "Option",
|
|
5241
|
-
label:
|
|
5242
|
+
label: N("downloadFile"),
|
|
5242
5243
|
onClick: async () => {
|
|
5243
|
-
let e = await
|
|
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:
|
|
5250
|
-
onClick: () =>
|
|
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:
|
|
5257
|
+
label: N("copyToClipboard"),
|
|
5257
5258
|
sections: [{
|
|
5258
5259
|
type: "Option",
|
|
5259
|
-
label:
|
|
5260
|
-
onClick: () =>
|
|
5260
|
+
label: N("copyDecimalDot"),
|
|
5261
|
+
onClick: () => W("dot"),
|
|
5261
5262
|
testId: `${n}-option-copy-decimal-dot`
|
|
5262
5263
|
}, {
|
|
5263
5264
|
type: "Option",
|
|
5264
|
-
label:
|
|
5265
|
-
onClick: () =>
|
|
5265
|
+
label: N("copyDecimalComma"),
|
|
5266
|
+
onClick: () => W("comma")
|
|
5266
5267
|
}]
|
|
5267
5268
|
}
|
|
5268
5269
|
}],
|
|
5269
|
-
...applyModalHandlers((i =
|
|
5270
|
-
],
|
|
5270
|
+
...applyModalHandlers((i = x == null ? void 0 : x.exportOptions) == null ? [] : i, C, V)
|
|
5271
|
+
], Y = v ? [{
|
|
5271
5272
|
type: "Option",
|
|
5272
|
-
label:
|
|
5273
|
-
onClick: () =>
|
|
5273
|
+
label: N("deleteAllRows"),
|
|
5274
|
+
onClick: () => K(),
|
|
5274
5275
|
testId: `${n}-delete-all-rows`
|
|
5275
|
-
}, ...applyModalHandlers((a =
|
|
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:
|
|
5280
|
-
onClick: () =>
|
|
5280
|
+
label: N("help"),
|
|
5281
|
+
onClick: () => V("helpModal", !D)
|
|
5281
5282
|
},
|
|
5282
|
-
...applyModalHandlers((o =
|
|
5283
|
-
] : [],
|
|
5284
|
-
...
|
|
5285
|
-
section: [...
|
|
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:
|
|
5289
|
+
tooltip: N("import")
|
|
5289
5290
|
}] : [],
|
|
5290
|
-
...
|
|
5291
|
-
section:
|
|
5291
|
+
...J.length ? [{
|
|
5292
|
+
section: J,
|
|
5292
5293
|
name: "export-options",
|
|
5293
5294
|
iconName: "export",
|
|
5294
|
-
tooltip:
|
|
5295
|
+
tooltip: N("export")
|
|
5295
5296
|
}] : [],
|
|
5296
|
-
...
|
|
5297
|
-
section:
|
|
5297
|
+
...Y.length ? [{
|
|
5298
|
+
section: Y,
|
|
5298
5299
|
name: "delete-options",
|
|
5299
5300
|
iconName: "delete",
|
|
5300
|
-
tooltip:
|
|
5301
|
+
tooltip: N("deleteAllRows")
|
|
5301
5302
|
}] : []
|
|
5302
5303
|
];
|
|
5303
5304
|
return /* @__PURE__ */ jsxs("span", { children: [
|
|
5304
|
-
|
|
5305
|
+
F && /* @__PURE__ */ jsx(Spinner, {
|
|
5305
5306
|
small: !0,
|
|
5306
5307
|
dark: !0
|
|
5307
5308
|
}),
|
|
5308
|
-
|
|
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
|
-
|
|
5315
|
+
E && /* @__PURE__ */ jsx(PasteWithReviewModal, {
|
|
5315
5316
|
config: e,
|
|
5316
|
-
state:
|
|
5317
|
-
updateState:
|
|
5318
|
-
setModalVisibility:
|
|
5319
|
-
readAndParseInput:
|
|
5320
|
-
onCloseModal:
|
|
5317
|
+
state: C,
|
|
5318
|
+
updateState: z,
|
|
5319
|
+
setModalVisibility: V,
|
|
5320
|
+
readAndParseInput: R,
|
|
5321
|
+
onCloseModal: B,
|
|
5321
5322
|
validationRules: u,
|
|
5322
|
-
onCompleteImport:
|
|
5323
|
+
onCompleteImport: S,
|
|
5323
5324
|
prevalidationConfig: l,
|
|
5324
|
-
t:
|
|
5325
|
-
loading:
|
|
5326
|
-
startTransition:
|
|
5325
|
+
t: N,
|
|
5326
|
+
loading: F,
|
|
5327
|
+
startTransition: I,
|
|
5327
5328
|
testId: n
|
|
5328
5329
|
}),
|
|
5329
|
-
|
|
5330
|
-
visible:
|
|
5331
|
-
setModalVisibility:
|
|
5330
|
+
D && /* @__PURE__ */ jsx(HelpModal, {
|
|
5331
|
+
visible: D,
|
|
5332
|
+
setModalVisibility: V,
|
|
5332
5333
|
validationRules: u,
|
|
5333
|
-
t:
|
|
5334
|
+
t: N
|
|
5334
5335
|
}),
|
|
5335
|
-
|
|
5336
|
-
visible:
|
|
5337
|
-
prompt:
|
|
5338
|
-
onUpload:
|
|
5339
|
-
onCloseModal: () =>
|
|
5340
|
-
onComplete:
|
|
5341
|
-
onError:
|
|
5342
|
-
heading:
|
|
5343
|
-
dialogText:
|
|
5344
|
-
fileInputText:
|
|
5345
|
-
fileInputPlaceholder:
|
|
5346
|
-
uploadText:
|
|
5347
|
-
cancelText:
|
|
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:
|
|
5352
|
-
modalVisibility:
|
|
5353
|
-
onCloseModal:
|
|
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,
|
|
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()
|
|
6635
|
+
e.preventDefault(), e.stopPropagation(), _ || (v(!0), b((/* @__PURE__ */ new Date()).getTime()));
|
|
6637
6636
|
}, C = (e) => {
|
|
6638
|
-
e.preventDefault(), e.stopPropagation(),
|
|
6637
|
+
e.preventDefault(), e.stopPropagation(), (/* @__PURE__ */ new Date()).getTime() - y > 20 && v(!1);
|
|
6639
6638
|
}, w = (e) => {
|
|
6640
|
-
e.preventDefault(), e.stopPropagation(),
|
|
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 : "",
|
|
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":
|
|
6646
|
+
"data-testid": p,
|
|
6646
6647
|
onClick: (e) => {
|
|
6647
|
-
|
|
6648
|
+
f || (m ? m(e) : a && x(e));
|
|
6648
6649
|
},
|
|
6649
|
-
onDrop: (e) => c ?
|
|
6650
|
-
onDragEnter: (e) => c ?
|
|
6651
|
-
onDragOver: (e) => c ?
|
|
6652
|
-
onDragLeave: (e) => c ?
|
|
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,
|
|
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:
|
|
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__ */
|
|
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:
|
|
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,
|
|
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
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
}),
|
|
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
|
|
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 && (
|
|
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:
|
|
7174
|
+
selected: X === t && Y === PredefinedOptionsMenuState.PREDEFINED
|
|
7174
7175
|
};
|
|
7175
7176
|
};
|
|
7176
|
-
if (
|
|
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
|
-
|
|
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:
|
|
7226
|
+
sections: $
|
|
7226
7227
|
},
|
|
7227
|
-
tooltip: Y === PredefinedOptionsMenuState.PREDEFINED ?
|
|
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:
|
|
7233
|
+
name: oe,
|
|
7233
7234
|
testId: x,
|
|
7234
7235
|
disabled: n,
|
|
7235
7236
|
placeholder: ce(t),
|
|
7236
7237
|
value: K.value,
|
|
7237
|
-
onChange:
|
|
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(
|
|
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:
|
|
7249
|
+
disableInternalErrorValidationMessages: te,
|
|
7249
7250
|
small: o,
|
|
7250
7251
|
selectOnFocus: P,
|
|
7251
7252
|
tooltip: I
|
|
7252
|
-
},
|
|
7253
|
+
}, oe)
|
|
7253
7254
|
}),
|
|
7254
|
-
|
|
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:
|
|
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(),
|
|
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