@oliasoft-open-source/react-ui-library 5.14.1-beta-1 → 5.15.0-beta-1
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 +14 -1
- package/dist/index.js +217 -167
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -97,6 +97,8 @@ 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;
|
|
101
|
+
|
|
100
102
|
export declare const Column: ({ background, borderLeft, borderRight, children, flex, flexbox, padding, scroll, showScrollbar, spacing, width, widthMobile, widthTablet, testId, }: ILayoutColumnProps) => JSX_2.Element;
|
|
101
103
|
|
|
102
104
|
export declare const Dialog: ({ dialog }: IDialogProps) => JSX_2.Element;
|
|
@@ -335,6 +337,18 @@ export declare interface ICollapseProps {
|
|
|
335
337
|
expanded: boolean;
|
|
336
338
|
}
|
|
337
339
|
|
|
340
|
+
export declare interface IColorInputProps {
|
|
341
|
+
columns?: number;
|
|
342
|
+
disabled?: boolean;
|
|
343
|
+
options?: {
|
|
344
|
+
value: string;
|
|
345
|
+
label: string;
|
|
346
|
+
}[];
|
|
347
|
+
small?: boolean;
|
|
348
|
+
value?: string;
|
|
349
|
+
onChange?: (value: string) => void;
|
|
350
|
+
}
|
|
351
|
+
|
|
338
352
|
/**
|
|
339
353
|
* Icon wrapper component to support different icon formats:
|
|
340
354
|
* - string names (default recommendation)
|
|
@@ -1534,7 +1548,6 @@ export declare interface ITableImportExportConfig {
|
|
|
1534
1548
|
copyFromClipBoard?: boolean;
|
|
1535
1549
|
showDeleteOptions?: boolean;
|
|
1536
1550
|
showHelpOption?: boolean;
|
|
1537
|
-
showUploadFileOption?: boolean;
|
|
1538
1551
|
onDeleteRows?: (type: 'all') => void;
|
|
1539
1552
|
onImportComplete?: (data: IImportData) => void;
|
|
1540
1553
|
}
|
package/dist/index.js
CHANGED
|
@@ -1273,6 +1273,119 @@ const Card = ({ bordered: e = !0, heading: t = null, children: n, margin: r = "0
|
|
|
1273
1273
|
children: n
|
|
1274
1274
|
})]
|
|
1275
1275
|
});
|
|
1276
|
+
var popover_module_default = {
|
|
1277
|
+
toggleBox: "_toggleBox_rwod1_1",
|
|
1278
|
+
enter: "_enter_rwod1_8",
|
|
1279
|
+
enterActive: "_enterActive_rwod1_12",
|
|
1280
|
+
fullWidthStyleFix: "_fullWidthStyleFix_rwod1_17",
|
|
1281
|
+
dismiss: "_dismiss_rwod1_22"
|
|
1282
|
+
};
|
|
1283
|
+
const Popover = ({ children: t, content: n, placement: r = "top-center", closeOnOutsideClick: i = !0, fullWidth: a = !1, showCloseButton: o = !1, testId: l, disabled: u = !1, overflowContainer: d = !1, isOpen: f, onToggle: h }) => {
|
|
1284
|
+
let _ = useContext(DisabledContext), v = useRef(null), [y, b] = f === void 0 ? useState(!1) : [f, h], x = () => {
|
|
1285
|
+
!u && !_ && b && b(!1);
|
|
1286
|
+
}, S = () => {
|
|
1287
|
+
u || _ || b && b(!y);
|
|
1288
|
+
};
|
|
1289
|
+
useEffect(() => {
|
|
1290
|
+
(u || _) && x();
|
|
1291
|
+
}, [u, _]);
|
|
1292
|
+
let { renderLayer: C, arrowProps: w, layerProps: T, triggerProps: E } = useLayer({
|
|
1293
|
+
isOpen: y,
|
|
1294
|
+
placement: r,
|
|
1295
|
+
auto: !0,
|
|
1296
|
+
triggerOffset: 6,
|
|
1297
|
+
onOutsideClick: i ? x : void 0,
|
|
1298
|
+
ResizeObserver: ResizeObserver$1,
|
|
1299
|
+
overflowContainer: d
|
|
1300
|
+
});
|
|
1301
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
1302
|
+
ref: E.ref,
|
|
1303
|
+
onClick: S,
|
|
1304
|
+
"data-testid": l,
|
|
1305
|
+
children: t
|
|
1306
|
+
}), /* @__PURE__ */ jsx(CSSTransition, {
|
|
1307
|
+
nodeRef: v,
|
|
1308
|
+
in: y,
|
|
1309
|
+
timeout: 100,
|
|
1310
|
+
classNames: {
|
|
1311
|
+
enter: popover_module_default.enter,
|
|
1312
|
+
enterActive: popover_module_default.enterActive
|
|
1313
|
+
},
|
|
1314
|
+
unmountOnExit: !0,
|
|
1315
|
+
children: /* @__PURE__ */ jsx(Fragment$1, { children: y && C(/* @__PURE__ */ jsxs("div", {
|
|
1316
|
+
className: a ? cx(popover_module_default.toggleBox, popover_module_default.fullWidthStyleFix) : cx(popover_module_default.toggleBox),
|
|
1317
|
+
...T,
|
|
1318
|
+
ref: (e) => {
|
|
1319
|
+
v.current = e, T.ref(e);
|
|
1320
|
+
},
|
|
1321
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [React.isValidElement(n) ? React.cloneElement(n, { close: x }) : n, o && /* @__PURE__ */ jsx("div", {
|
|
1322
|
+
className: popover_module_default.dismiss,
|
|
1323
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
1324
|
+
small: !0,
|
|
1325
|
+
round: !0,
|
|
1326
|
+
onClick: x,
|
|
1327
|
+
icon: IconType.CLOSE
|
|
1328
|
+
})
|
|
1329
|
+
})] }), /* @__PURE__ */ jsx(Arrow, {
|
|
1330
|
+
...w,
|
|
1331
|
+
backgroundColor: "var(--color-background-layer)",
|
|
1332
|
+
borderColor: "var(--color-border)",
|
|
1333
|
+
borderWidth: 1,
|
|
1334
|
+
size: 6
|
|
1335
|
+
})]
|
|
1336
|
+
})) })
|
|
1337
|
+
})] });
|
|
1338
|
+
};
|
|
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;
|
|
1349
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1350
|
+
className: color_input_module_default.colorInput,
|
|
1351
|
+
children: /* @__PURE__ */ jsx(Popover, {
|
|
1352
|
+
placement: "bottom-start",
|
|
1353
|
+
isOpen: s,
|
|
1354
|
+
onToggle: c,
|
|
1355
|
+
content: /* @__PURE__ */ jsx("div", {
|
|
1356
|
+
className: color_input_module_default.options,
|
|
1357
|
+
style: { gridTemplateColumns: `repeat(${e}, auto)` },
|
|
1358
|
+
children: n.map((e) => /* @__PURE__ */ jsx("div", {
|
|
1359
|
+
className: color_input_module_default.option,
|
|
1360
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
1361
|
+
basic: !0,
|
|
1362
|
+
disabled: t,
|
|
1363
|
+
width: "var(--size)",
|
|
1364
|
+
tooltip: e.label,
|
|
1365
|
+
label: /* @__PURE__ */ jsx("div", {
|
|
1366
|
+
className: color_input_module_default.buttonColor,
|
|
1367
|
+
style: { backgroundColor: e.value }
|
|
1368
|
+
}),
|
|
1369
|
+
onClick: () => {
|
|
1370
|
+
a == null || a(e.value), c(!1);
|
|
1371
|
+
}
|
|
1372
|
+
}, e.value)
|
|
1373
|
+
}))
|
|
1374
|
+
}),
|
|
1375
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
1376
|
+
disabled: t,
|
|
1377
|
+
small: r,
|
|
1378
|
+
active: s,
|
|
1379
|
+
width: r ? "var(--size-sm)" : "var(--size)",
|
|
1380
|
+
tooltip: l,
|
|
1381
|
+
label: /* @__PURE__ */ jsx("div", {
|
|
1382
|
+
className: color_input_module_default.buttonColor,
|
|
1383
|
+
style: { backgroundColor: i }
|
|
1384
|
+
})
|
|
1385
|
+
})
|
|
1386
|
+
})
|
|
1387
|
+
});
|
|
1388
|
+
};
|
|
1276
1389
|
var noScrollbars = css`
|
|
1277
1390
|
scrollbar-width: none;
|
|
1278
1391
|
-ms-overflow-style: none;
|
|
@@ -3450,70 +3563,7 @@ const Slider = ({ name: e, label: t, width: n = "100%", labelWidth: r = "auto",
|
|
|
3450
3563
|
children: /* @__PURE__ */ jsx(Icon, { icon: n })
|
|
3451
3564
|
})
|
|
3452
3565
|
});
|
|
3453
|
-
}, ActionsCell = ({ cell: e }) => /* @__PURE__ */ jsx(Actions, { actions: e.actions })
|
|
3454
|
-
var popover_module_default = {
|
|
3455
|
-
toggleBox: "_toggleBox_rwod1_1",
|
|
3456
|
-
enter: "_enter_rwod1_8",
|
|
3457
|
-
enterActive: "_enterActive_rwod1_12",
|
|
3458
|
-
fullWidthStyleFix: "_fullWidthStyleFix_rwod1_17",
|
|
3459
|
-
dismiss: "_dismiss_rwod1_22"
|
|
3460
|
-
};
|
|
3461
|
-
const Popover = ({ children: t, content: n, placement: r = "top-center", closeOnOutsideClick: i = !0, fullWidth: a = !1, showCloseButton: o = !1, testId: l, disabled: u = !1, overflowContainer: d = !1, isOpen: f, onToggle: h }) => {
|
|
3462
|
-
let _ = useContext(DisabledContext), v = useRef(null), [y, b] = f === void 0 ? useState(!1) : [f, h], x = () => {
|
|
3463
|
-
!u && !_ && b && b(!1);
|
|
3464
|
-
}, S = () => {
|
|
3465
|
-
u || _ || b && b(!y);
|
|
3466
|
-
};
|
|
3467
|
-
useEffect(() => {
|
|
3468
|
-
(u || _) && x();
|
|
3469
|
-
}, [u, _]);
|
|
3470
|
-
let { renderLayer: C, arrowProps: w, layerProps: T, triggerProps: E } = useLayer({
|
|
3471
|
-
isOpen: y,
|
|
3472
|
-
placement: r,
|
|
3473
|
-
auto: !0,
|
|
3474
|
-
triggerOffset: 6,
|
|
3475
|
-
onOutsideClick: i ? x : void 0,
|
|
3476
|
-
ResizeObserver: ResizeObserver$1,
|
|
3477
|
-
overflowContainer: d
|
|
3478
|
-
});
|
|
3479
|
-
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
3480
|
-
ref: E.ref,
|
|
3481
|
-
onClick: S,
|
|
3482
|
-
"data-testid": l,
|
|
3483
|
-
children: t
|
|
3484
|
-
}), /* @__PURE__ */ jsx(CSSTransition, {
|
|
3485
|
-
nodeRef: v,
|
|
3486
|
-
in: y,
|
|
3487
|
-
timeout: 100,
|
|
3488
|
-
classNames: {
|
|
3489
|
-
enter: popover_module_default.enter,
|
|
3490
|
-
enterActive: popover_module_default.enterActive
|
|
3491
|
-
},
|
|
3492
|
-
unmountOnExit: !0,
|
|
3493
|
-
children: /* @__PURE__ */ jsx(Fragment$1, { children: y && C(/* @__PURE__ */ jsxs("div", {
|
|
3494
|
-
className: a ? cx(popover_module_default.toggleBox, popover_module_default.fullWidthStyleFix) : cx(popover_module_default.toggleBox),
|
|
3495
|
-
...T,
|
|
3496
|
-
ref: (e) => {
|
|
3497
|
-
v.current = e, T.ref(e);
|
|
3498
|
-
},
|
|
3499
|
-
children: [/* @__PURE__ */ jsxs("div", { children: [React.isValidElement(n) ? React.cloneElement(n, { close: x }) : n, o && /* @__PURE__ */ jsx("div", {
|
|
3500
|
-
className: popover_module_default.dismiss,
|
|
3501
|
-
children: /* @__PURE__ */ jsx(Button, {
|
|
3502
|
-
small: !0,
|
|
3503
|
-
round: !0,
|
|
3504
|
-
onClick: x,
|
|
3505
|
-
icon: IconType.CLOSE
|
|
3506
|
-
})
|
|
3507
|
-
})] }), /* @__PURE__ */ jsx(Arrow, {
|
|
3508
|
-
...w,
|
|
3509
|
-
backgroundColor: "var(--color-background-layer)",
|
|
3510
|
-
borderColor: "var(--color-border)",
|
|
3511
|
-
borderWidth: 1,
|
|
3512
|
-
size: 6
|
|
3513
|
-
})]
|
|
3514
|
-
})) })
|
|
3515
|
-
})] });
|
|
3516
|
-
}, CellHelpIcon = ({ cell: e }) => {
|
|
3566
|
+
}, ActionsCell = ({ cell: e }) => /* @__PURE__ */ jsx(Actions, { actions: e.actions }), CellHelpIcon = ({ cell: e }) => {
|
|
3517
3567
|
let { helpIcon: t } = e;
|
|
3518
3568
|
return t ? /* @__PURE__ */ jsx("div", {
|
|
3519
3569
|
className: cell_module_default.icon,
|
|
@@ -5149,158 +5199,158 @@ var initialState = {
|
|
|
5149
5199
|
};
|
|
5150
5200
|
const TableImportExport = ({ config: e, smartUploadConfig: t, testId: n }) => {
|
|
5151
5201
|
var r, i, a, o;
|
|
5152
|
-
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,
|
|
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, 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({
|
|
5153
5203
|
config: e,
|
|
5154
|
-
state:
|
|
5155
|
-
setState:
|
|
5204
|
+
state: C,
|
|
5205
|
+
setState: w,
|
|
5156
5206
|
smartUploadConfig: t,
|
|
5157
|
-
startTransition:
|
|
5158
|
-
}), { readAndParseInput:
|
|
5159
|
-
useKeyboardEvent("Escape", () =>
|
|
5160
|
-
let
|
|
5161
|
-
|
|
5207
|
+
startTransition: I
|
|
5208
|
+
}), { readAndParseInput: R, updateState: z, closeModals: B, setModalVisibility: V, onFileChange: H, onClickQuickPasteFromClipBoard: U, onClickCopyClipboard: W, onSmartUploadResult: G, deleteAllRows: K } = L == null ? {} : L;
|
|
5209
|
+
useKeyboardEvent("Escape", () => B());
|
|
5210
|
+
let q = g ? [
|
|
5211
|
+
{
|
|
5162
5212
|
type: "Option",
|
|
5163
|
-
label:
|
|
5213
|
+
label: N("uploadFile"),
|
|
5164
5214
|
upload: !0,
|
|
5165
5215
|
uploadType: ".csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
5166
|
-
onChange:
|
|
5216
|
+
onChange: H,
|
|
5167
5217
|
testId: `${n}-option-upload-file`
|
|
5168
|
-
}
|
|
5218
|
+
},
|
|
5169
5219
|
..._ ? [{
|
|
5170
5220
|
type: "Option",
|
|
5171
|
-
label:
|
|
5172
|
-
onClick:
|
|
5221
|
+
label: N("quickPasteFromClipboard"),
|
|
5222
|
+
onClick: U,
|
|
5173
5223
|
testId: `${n}-option-quick-paste-from-clipboard`
|
|
5174
5224
|
}] : [],
|
|
5175
5225
|
..._ ? [{
|
|
5176
5226
|
type: "Option",
|
|
5177
|
-
label:
|
|
5178
|
-
onClick: () =>
|
|
5227
|
+
label: N("pasteWithReview"),
|
|
5228
|
+
onClick: () => V("reviewPasteModal", !E),
|
|
5179
5229
|
testId: `${n}-paste-with-review`
|
|
5180
5230
|
}] : [],
|
|
5181
|
-
...
|
|
5231
|
+
...k && O && t ? [{
|
|
5182
5232
|
type: "Option",
|
|
5183
|
-
label:
|
|
5184
|
-
onClick: () =>
|
|
5233
|
+
label: N("smartUpload_smartUpload"),
|
|
5234
|
+
onClick: () => V("smartUploadModal", !T),
|
|
5185
5235
|
testId: `${n}-smart-upload`
|
|
5186
5236
|
}] : [],
|
|
5187
|
-
...applyModalHandlers((r =
|
|
5188
|
-
] : [],
|
|
5237
|
+
...applyModalHandlers((r = x == null ? void 0 : x.importOptions) == null ? [] : r, C, V)
|
|
5238
|
+
] : [], J = [
|
|
5189
5239
|
{
|
|
5190
5240
|
type: "Option",
|
|
5191
|
-
label:
|
|
5241
|
+
label: N("downloadFile"),
|
|
5192
5242
|
onClick: async () => {
|
|
5193
|
-
let e = await
|
|
5243
|
+
let e = await P();
|
|
5194
5244
|
e && e && onClickDownLoad(e, d);
|
|
5195
5245
|
}
|
|
5196
5246
|
},
|
|
5197
5247
|
...p ? [{
|
|
5198
5248
|
type: "Option",
|
|
5199
|
-
label:
|
|
5200
|
-
onClick: () =>
|
|
5249
|
+
label: N("copyToClipboard"),
|
|
5250
|
+
onClick: () => W("dot")
|
|
5201
5251
|
}] : [{
|
|
5202
5252
|
type: "Menu",
|
|
5203
5253
|
testId: `${n}-menu-copy-to-clipboard`,
|
|
5204
5254
|
menu: {
|
|
5205
5255
|
trigger: "Text",
|
|
5206
|
-
label:
|
|
5256
|
+
label: N("copyToClipboard"),
|
|
5207
5257
|
sections: [{
|
|
5208
5258
|
type: "Option",
|
|
5209
|
-
label:
|
|
5210
|
-
onClick: () =>
|
|
5259
|
+
label: N("copyDecimalDot"),
|
|
5260
|
+
onClick: () => W("dot"),
|
|
5211
5261
|
testId: `${n}-option-copy-decimal-dot`
|
|
5212
5262
|
}, {
|
|
5213
5263
|
type: "Option",
|
|
5214
|
-
label:
|
|
5215
|
-
onClick: () =>
|
|
5264
|
+
label: N("copyDecimalComma"),
|
|
5265
|
+
onClick: () => W("comma")
|
|
5216
5266
|
}]
|
|
5217
5267
|
}
|
|
5218
5268
|
}],
|
|
5219
|
-
...applyModalHandlers((i =
|
|
5220
|
-
],
|
|
5269
|
+
...applyModalHandlers((i = x == null ? void 0 : x.exportOptions) == null ? [] : i, C, V)
|
|
5270
|
+
], Y = v ? [{
|
|
5221
5271
|
type: "Option",
|
|
5222
|
-
label:
|
|
5223
|
-
onClick: () =>
|
|
5272
|
+
label: N("deleteAllRows"),
|
|
5273
|
+
onClick: () => K(),
|
|
5224
5274
|
testId: `${n}-delete-all-rows`
|
|
5225
|
-
}, ...applyModalHandlers((a =
|
|
5275
|
+
}, ...applyModalHandlers((a = x == null ? void 0 : x.deleteOptions) == null ? [] : a, C, V)] : [], ee = y ? [
|
|
5226
5276
|
{ type: "Divider" },
|
|
5227
5277
|
{
|
|
5228
5278
|
type: "Option",
|
|
5229
|
-
label:
|
|
5230
|
-
onClick: () =>
|
|
5279
|
+
label: N("help"),
|
|
5280
|
+
onClick: () => V("helpModal", !D)
|
|
5231
5281
|
},
|
|
5232
|
-
...applyModalHandlers((o =
|
|
5233
|
-
] : [],
|
|
5234
|
-
...
|
|
5235
|
-
section: [...
|
|
5282
|
+
...applyModalHandlers((o = x == null ? void 0 : x.helpOptions) == null ? [] : o, C, V)
|
|
5283
|
+
] : [], te = [
|
|
5284
|
+
...q.length ? [{
|
|
5285
|
+
section: [...q, ...ee],
|
|
5236
5286
|
name: "import-options",
|
|
5237
5287
|
iconName: "import",
|
|
5238
|
-
tooltip:
|
|
5288
|
+
tooltip: N("import")
|
|
5239
5289
|
}] : [],
|
|
5240
|
-
...
|
|
5241
|
-
section:
|
|
5290
|
+
...J.length ? [{
|
|
5291
|
+
section: J,
|
|
5242
5292
|
name: "export-options",
|
|
5243
5293
|
iconName: "export",
|
|
5244
|
-
tooltip:
|
|
5294
|
+
tooltip: N("export")
|
|
5245
5295
|
}] : [],
|
|
5246
|
-
...
|
|
5247
|
-
section:
|
|
5296
|
+
...Y.length ? [{
|
|
5297
|
+
section: Y,
|
|
5248
5298
|
name: "delete-options",
|
|
5249
5299
|
iconName: "delete",
|
|
5250
|
-
tooltip:
|
|
5300
|
+
tooltip: N("deleteAllRows")
|
|
5251
5301
|
}] : []
|
|
5252
5302
|
];
|
|
5253
5303
|
return /* @__PURE__ */ jsxs("span", { children: [
|
|
5254
|
-
|
|
5304
|
+
F && /* @__PURE__ */ jsx(Spinner, {
|
|
5255
5305
|
small: !0,
|
|
5256
5306
|
dark: !0
|
|
5257
5307
|
}),
|
|
5258
|
-
|
|
5308
|
+
te.map((e, t) => /* @__PURE__ */ jsx(MenuComponent, {
|
|
5259
5309
|
sections: e.section,
|
|
5260
5310
|
iconName: e.iconName,
|
|
5261
5311
|
tooltip: e.tooltip,
|
|
5262
5312
|
testId: `data-${e == null ? void 0 : e.name}-menu`
|
|
5263
5313
|
}, t)),
|
|
5264
|
-
|
|
5314
|
+
E && /* @__PURE__ */ jsx(PasteWithReviewModal, {
|
|
5265
5315
|
config: e,
|
|
5266
|
-
state:
|
|
5267
|
-
updateState:
|
|
5268
|
-
setModalVisibility:
|
|
5269
|
-
readAndParseInput:
|
|
5270
|
-
onCloseModal:
|
|
5316
|
+
state: C,
|
|
5317
|
+
updateState: z,
|
|
5318
|
+
setModalVisibility: V,
|
|
5319
|
+
readAndParseInput: R,
|
|
5320
|
+
onCloseModal: B,
|
|
5271
5321
|
validationRules: u,
|
|
5272
|
-
onCompleteImport:
|
|
5322
|
+
onCompleteImport: S,
|
|
5273
5323
|
prevalidationConfig: l,
|
|
5274
|
-
t:
|
|
5275
|
-
loading:
|
|
5276
|
-
startTransition:
|
|
5324
|
+
t: N,
|
|
5325
|
+
loading: F,
|
|
5326
|
+
startTransition: I,
|
|
5277
5327
|
testId: n
|
|
5278
5328
|
}),
|
|
5279
|
-
|
|
5280
|
-
visible:
|
|
5281
|
-
setModalVisibility:
|
|
5329
|
+
D && /* @__PURE__ */ jsx(HelpModal, {
|
|
5330
|
+
visible: D,
|
|
5331
|
+
setModalVisibility: V,
|
|
5282
5332
|
validationRules: u,
|
|
5283
|
-
t:
|
|
5333
|
+
t: N
|
|
5284
5334
|
}),
|
|
5285
|
-
|
|
5286
|
-
visible:
|
|
5287
|
-
prompt:
|
|
5288
|
-
onUpload:
|
|
5289
|
-
onCloseModal: () =>
|
|
5290
|
-
onComplete:
|
|
5291
|
-
onError:
|
|
5292
|
-
heading:
|
|
5293
|
-
dialogText:
|
|
5294
|
-
fileInputText:
|
|
5295
|
-
fileInputPlaceholder:
|
|
5296
|
-
uploadText:
|
|
5297
|
-
cancelText:
|
|
5335
|
+
O && t && /* @__PURE__ */ jsx(SmartUploadModal, {
|
|
5336
|
+
visible: T,
|
|
5337
|
+
prompt: k,
|
|
5338
|
+
onUpload: M,
|
|
5339
|
+
onCloseModal: () => B({ callback: A }),
|
|
5340
|
+
onComplete: G,
|
|
5341
|
+
onError: j,
|
|
5342
|
+
heading: N("smartUpload_smartUpload"),
|
|
5343
|
+
dialogText: N("smartUpload_description"),
|
|
5344
|
+
fileInputText: N("chooseFile"),
|
|
5345
|
+
fileInputPlaceholder: N("noFileSelected"),
|
|
5346
|
+
uploadText: N("uploadCapitalized"),
|
|
5347
|
+
cancelText: N("cancel"),
|
|
5298
5348
|
testId: n
|
|
5299
5349
|
}),
|
|
5300
5350
|
/* @__PURE__ */ jsx(ModalsRenderer, {
|
|
5301
|
-
modals:
|
|
5302
|
-
modalVisibility:
|
|
5303
|
-
onCloseModal:
|
|
5351
|
+
modals: b,
|
|
5352
|
+
modalVisibility: C == null ? void 0 : C.modalVisibility,
|
|
5353
|
+
onCloseModal: B,
|
|
5304
5354
|
testId: n
|
|
5305
5355
|
})
|
|
5306
5356
|
] });
|
|
@@ -7010,7 +7060,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7010
7060
|
} : {
|
|
7011
7061
|
value: G,
|
|
7012
7062
|
unit: U
|
|
7013
|
-
}), J = k || (K == null ? void 0 : K.value) === void 0, [Y,
|
|
7063
|
+
}), 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) => {
|
|
7014
7064
|
if (!(e != null && e.value)) return;
|
|
7015
7065
|
if (E) return E === e.valueKey;
|
|
7016
7066
|
let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
|
|
@@ -7019,7 +7069,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7019
7069
|
toUnit: t
|
|
7020
7070
|
});
|
|
7021
7071
|
return withUnit(n, t) === e.value;
|
|
7022
|
-
}),
|
|
7072
|
+
}), ne = () => {
|
|
7023
7073
|
var e;
|
|
7024
7074
|
let t = (e = l) == null ? "" : e, n = K.unit;
|
|
7025
7075
|
if (!checkConversion({
|
|
@@ -7035,7 +7085,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7035
7085
|
} catch {
|
|
7036
7086
|
return null;
|
|
7037
7087
|
}
|
|
7038
|
-
},
|
|
7088
|
+
}, re = (t) => {
|
|
7039
7089
|
let n = getStringName(e), r = t.target, { value: i, selectionStart: a } = r, o = withUnit(i, (K == null ? void 0 : K.unit) || "");
|
|
7040
7090
|
h({ target: {
|
|
7041
7091
|
value: A ? withUnit(convertAndGetValue(o, B), B) : o,
|
|
@@ -7048,7 +7098,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7048
7098
|
}), R(() => {
|
|
7049
7099
|
r.selectionStart = a, r.selectionEnd = a;
|
|
7050
7100
|
});
|
|
7051
|
-
},
|
|
7101
|
+
}, ie = (e, t) => {
|
|
7052
7102
|
t === K.unit || isNaN(Number(e)) || (q({
|
|
7053
7103
|
value: e,
|
|
7054
7104
|
unit: t
|
|
@@ -7079,7 +7129,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7079
7129
|
e !== void 0 && q({
|
|
7080
7130
|
value: e,
|
|
7081
7131
|
unit: t
|
|
7082
|
-
}),
|
|
7132
|
+
}), ee(C && X && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
|
|
7083
7133
|
}
|
|
7084
7134
|
}, [
|
|
7085
7135
|
U,
|
|
@@ -7087,7 +7137,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7087
7137
|
i,
|
|
7088
7138
|
T
|
|
7089
7139
|
]);
|
|
7090
|
-
let
|
|
7140
|
+
let Z = ne(), Q = label(K.unit) || K.unit || "", ae = p || !Z || Z && Z.length === 1, oe = getStringName(e), $, se = (t) => {
|
|
7091
7141
|
let r = t != null && t.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
|
|
7092
7142
|
if (checkConversion({
|
|
7093
7143
|
value: r,
|
|
@@ -7107,7 +7157,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7107
7157
|
type: MenuType.OPTION,
|
|
7108
7158
|
inline: !0,
|
|
7109
7159
|
onClick: () => {
|
|
7110
|
-
validateNumber(i).valid && !n && (
|
|
7160
|
+
validateNumber(i).valid && !n && (ee(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
|
|
7111
7161
|
value: r,
|
|
7112
7162
|
name: typeof e == "string" ? e : (e == null ? void 0 : e.fieldName) || "",
|
|
7113
7163
|
predefinedSelected: !0,
|
|
@@ -7119,10 +7169,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7119
7169
|
height: "0"
|
|
7120
7170
|
})] }),
|
|
7121
7171
|
description: o,
|
|
7122
|
-
selected:
|
|
7172
|
+
selected: X === t && Y === PredefinedOptionsMenuState.PREDEFINED
|
|
7123
7173
|
};
|
|
7124
7174
|
};
|
|
7125
|
-
if (
|
|
7175
|
+
if ($ = [{
|
|
7126
7176
|
type: MenuType.OPTION,
|
|
7127
7177
|
inline: !0,
|
|
7128
7178
|
onClick: () => {
|
|
@@ -7135,7 +7185,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7135
7185
|
selected: Y === PredefinedOptionsMenuState.CUSTOM
|
|
7136
7186
|
}], C != null && C.length) {
|
|
7137
7187
|
let e = C.map(se);
|
|
7138
|
-
|
|
7188
|
+
$ = [...$, ...e];
|
|
7139
7189
|
}
|
|
7140
7190
|
let ce = (e) => {
|
|
7141
7191
|
if (isValueWithUnit(e)) {
|
|
@@ -7171,39 +7221,39 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7171
7221
|
small: o
|
|
7172
7222
|
}),
|
|
7173
7223
|
small: o,
|
|
7174
|
-
sections:
|
|
7224
|
+
sections: $
|
|
7175
7225
|
},
|
|
7176
|
-
tooltip: Y === PredefinedOptionsMenuState.PREDEFINED ?
|
|
7226
|
+
tooltip: Y === PredefinedOptionsMenuState.PREDEFINED ? X == null ? void 0 : X.label : ""
|
|
7177
7227
|
}),
|
|
7178
7228
|
/* @__PURE__ */ jsx("div", {
|
|
7179
7229
|
className: unit_input_module_default.inputWrapper,
|
|
7180
7230
|
children: /* @__PURE__ */ jsx(NumberInput, {
|
|
7181
|
-
name:
|
|
7231
|
+
name: oe,
|
|
7182
7232
|
testId: x,
|
|
7183
7233
|
disabled: n,
|
|
7184
7234
|
placeholder: ce(t),
|
|
7185
7235
|
value: K.value,
|
|
7186
|
-
onChange:
|
|
7236
|
+
onChange: re,
|
|
7187
7237
|
onFocus: v,
|
|
7188
7238
|
error: i === null ? void 0 : i,
|
|
7189
7239
|
warning: S === null ? void 0 : S,
|
|
7190
7240
|
left: a,
|
|
7191
7241
|
allowEmpty: J,
|
|
7192
|
-
validationCallback: (e, t) => D(
|
|
7242
|
+
validationCallback: (e, t) => D(oe, t),
|
|
7193
7243
|
enableCosmeticRounding: j,
|
|
7194
7244
|
enableDisplayRounding: M,
|
|
7195
7245
|
roundDisplayValue: N,
|
|
7196
7246
|
groupOrder: le,
|
|
7197
|
-
disableInternalErrorValidationMessages:
|
|
7247
|
+
disableInternalErrorValidationMessages: te,
|
|
7198
7248
|
small: o,
|
|
7199
7249
|
selectOnFocus: P,
|
|
7200
7250
|
tooltip: I
|
|
7201
|
-
},
|
|
7251
|
+
}, oe)
|
|
7202
7252
|
}),
|
|
7203
|
-
|
|
7253
|
+
Q && (ae || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
7204
7254
|
groupOrder: ue,
|
|
7205
7255
|
small: o,
|
|
7206
|
-
children:
|
|
7256
|
+
children: Q
|
|
7207
7257
|
}) : /* @__PURE__ */ jsx(Menu, {
|
|
7208
7258
|
groupOrder: ue,
|
|
7209
7259
|
maxHeight: 380,
|
|
@@ -7211,20 +7261,20 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7211
7261
|
testId: x && `${x}-menu`,
|
|
7212
7262
|
tabIndex: -1,
|
|
7213
7263
|
menu: {
|
|
7214
|
-
label:
|
|
7264
|
+
label: Q,
|
|
7215
7265
|
trigger: "DropDownButton",
|
|
7216
7266
|
small: o,
|
|
7217
|
-
sections:
|
|
7267
|
+
sections: Z.map(([e = "", t = "", n]) => {
|
|
7218
7268
|
let r = n || t || "", i = isValidNum(e) ? e : "";
|
|
7219
7269
|
return {
|
|
7220
7270
|
type: "Option",
|
|
7221
7271
|
label: j ? safeRoundNumbers(i) : i,
|
|
7222
7272
|
inline: !0,
|
|
7223
7273
|
onClick: (n) => {
|
|
7224
|
-
n.stopPropagation(),
|
|
7274
|
+
n.stopPropagation(), ie(e, t);
|
|
7225
7275
|
},
|
|
7226
7276
|
description: r,
|
|
7227
|
-
selected: r ===
|
|
7277
|
+
selected: r === Q,
|
|
7228
7278
|
testId: `${x}-unit-${r}`
|
|
7229
7279
|
};
|
|
7230
7280
|
})
|
|
@@ -9127,4 +9177,4 @@ const ComparisonViewModal = ({ auditLog: e, auditLogs: t, data: n, isOpen: r, se
|
|
|
9127
9177
|
e === ConfigKeyType.Translations ? setConfig(e, getTranslations(t)) : setConfig(e, isPrimitiveValue(t) ? t : { ...t });
|
|
9128
9178
|
});
|
|
9129
9179
|
};
|
|
9130
|
-
export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Collapse, Color, 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 };
|
|
9180
|
+
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 };
|
package/package.json
CHANGED