@oliasoft-open-source/react-ui-library 5.15.4 → 5.16.1-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 +4 -2
- package/dist/index.js +151 -152
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1550,6 +1550,7 @@ export declare interface ITableImportExportConfig {
|
|
|
1550
1550
|
copyFromClipBoard?: boolean;
|
|
1551
1551
|
showDeleteOptions?: boolean;
|
|
1552
1552
|
showHelpOption?: boolean;
|
|
1553
|
+
showUploadFileOption?: boolean;
|
|
1553
1554
|
onDeleteRows?: (type: 'all') => void;
|
|
1554
1555
|
onImportComplete?: (data: IImportData) => void;
|
|
1555
1556
|
}
|
|
@@ -1799,6 +1800,7 @@ export declare interface ITreeProps {
|
|
|
1799
1800
|
isOpen: boolean;
|
|
1800
1801
|
onToggle: (id: TStringOrNumber) => void;
|
|
1801
1802
|
}) => ReactElement;
|
|
1803
|
+
placeholderIndent?: TStringOrNumber;
|
|
1802
1804
|
}
|
|
1803
1805
|
|
|
1804
1806
|
declare interface ITreeRowItem extends TRowType_2 {
|
|
@@ -1811,7 +1813,7 @@ declare interface ITreeRowItem extends TRowType_2 {
|
|
|
1811
1813
|
|
|
1812
1814
|
export declare interface ITreeTableProps extends ITreeProps {
|
|
1813
1815
|
table: {
|
|
1814
|
-
columnAlignment?: (Align.LEFT | Align.RIGHT)[];
|
|
1816
|
+
columnAlignment?: (Align.LEFT | Align.RIGHT | null)[];
|
|
1815
1817
|
columnWidths?: string[];
|
|
1816
1818
|
fixedWidth?: string;
|
|
1817
1819
|
headers?: TRowType_2[];
|
|
@@ -2211,7 +2213,7 @@ declare const TRANSLATION_FALLBACK: {
|
|
|
2211
2213
|
unknown: string;
|
|
2212
2214
|
};
|
|
2213
2215
|
|
|
2214
|
-
export declare const Tree: ({ list, canDrop, draggable, onListReorder, onChangeOpen, testId, isInitialOpen, autoOpenActiveItems, treeRef: treeRefProp, itemHasChild, onItemToggle, icons, allowParentReassignment, stickyHeader, height, render, }: ITreeProps) => JSX_2.Element;
|
|
2216
|
+
export declare const Tree: ({ list, canDrop, draggable, onListReorder, onChangeOpen, testId, isInitialOpen, autoOpenActiveItems, treeRef: treeRefProp, itemHasChild, onItemToggle, icons, allowParentReassignment, stickyHeader, height, render, placeholderIndent, }: ITreeProps) => JSX_2.Element;
|
|
2215
2217
|
|
|
2216
2218
|
export declare const TreeTable: ({ allowParentReassignment, autoOpenActiveItems, canDrop, draggable, icons, isInitialOpen, itemHasChild, onItemToggle, onListReorder, onChangeOpen, table, testId, treeRef, }: ITreeTableProps) => JSX_2.Element;
|
|
2217
2219
|
|
package/dist/index.js
CHANGED
|
@@ -5200,158 +5200,158 @@ var initialState = {
|
|
|
5200
5200
|
};
|
|
5201
5201
|
const TableImportExport = ({ config: e, smartUploadConfig: t, testId: n }) => {
|
|
5202
5202
|
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,
|
|
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, 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
5204
|
config: e,
|
|
5205
|
-
state:
|
|
5206
|
-
setState:
|
|
5205
|
+
state: w,
|
|
5206
|
+
setState: T,
|
|
5207
5207
|
smartUploadConfig: t,
|
|
5208
|
-
startTransition:
|
|
5209
|
-
}), { readAndParseInput:
|
|
5210
|
-
useKeyboardEvent("Escape", () =>
|
|
5211
|
-
let
|
|
5212
|
-
{
|
|
5208
|
+
startTransition: L
|
|
5209
|
+
}), { readAndParseInput: z, updateState: B, closeModals: V, setModalVisibility: H, onFileChange: U, onClickQuickPasteFromClipBoard: W, onClickCopyClipboard: G, onSmartUploadResult: K, deleteAllRows: q } = R == null ? {} : R;
|
|
5210
|
+
useKeyboardEvent("Escape", () => V());
|
|
5211
|
+
let J = g ? [
|
|
5212
|
+
...b ? [{
|
|
5213
5213
|
type: "Option",
|
|
5214
|
-
label:
|
|
5214
|
+
label: P("uploadFile"),
|
|
5215
5215
|
upload: !0,
|
|
5216
5216
|
uploadType: ".csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
5217
|
-
onChange:
|
|
5217
|
+
onChange: U,
|
|
5218
5218
|
testId: `${n}-option-upload-file`
|
|
5219
|
-
},
|
|
5219
|
+
}] : [],
|
|
5220
5220
|
..._ ? [{
|
|
5221
5221
|
type: "Option",
|
|
5222
|
-
label:
|
|
5223
|
-
onClick:
|
|
5222
|
+
label: P("quickPasteFromClipboard"),
|
|
5223
|
+
onClick: W,
|
|
5224
5224
|
testId: `${n}-option-quick-paste-from-clipboard`
|
|
5225
5225
|
}] : [],
|
|
5226
5226
|
..._ ? [{
|
|
5227
5227
|
type: "Option",
|
|
5228
|
-
label:
|
|
5229
|
-
onClick: () =>
|
|
5228
|
+
label: P("pasteWithReview"),
|
|
5229
|
+
onClick: () => H("reviewPasteModal", !D),
|
|
5230
5230
|
testId: `${n}-paste-with-review`
|
|
5231
5231
|
}] : [],
|
|
5232
|
-
...
|
|
5232
|
+
...A && k && t ? [{
|
|
5233
5233
|
type: "Option",
|
|
5234
|
-
label:
|
|
5235
|
-
onClick: () =>
|
|
5234
|
+
label: P("smartUpload_smartUpload"),
|
|
5235
|
+
onClick: () => H("smartUploadModal", !E),
|
|
5236
5236
|
testId: `${n}-smart-upload`
|
|
5237
5237
|
}] : [],
|
|
5238
|
-
...applyModalHandlers((r =
|
|
5239
|
-
] : [],
|
|
5238
|
+
...applyModalHandlers((r = S == null ? void 0 : S.importOptions) == null ? [] : r, w, H)
|
|
5239
|
+
] : [], Y = [
|
|
5240
5240
|
{
|
|
5241
5241
|
type: "Option",
|
|
5242
|
-
label:
|
|
5242
|
+
label: P("downloadFile"),
|
|
5243
5243
|
onClick: async () => {
|
|
5244
|
-
let e = await
|
|
5244
|
+
let e = await F();
|
|
5245
5245
|
e && e && onClickDownLoad(e, d);
|
|
5246
5246
|
}
|
|
5247
5247
|
},
|
|
5248
5248
|
...p ? [{
|
|
5249
5249
|
type: "Option",
|
|
5250
|
-
label:
|
|
5251
|
-
onClick: () =>
|
|
5250
|
+
label: P("copyToClipboard"),
|
|
5251
|
+
onClick: () => G("dot")
|
|
5252
5252
|
}] : [{
|
|
5253
5253
|
type: "Menu",
|
|
5254
5254
|
testId: `${n}-menu-copy-to-clipboard`,
|
|
5255
5255
|
menu: {
|
|
5256
5256
|
trigger: "Text",
|
|
5257
|
-
label:
|
|
5257
|
+
label: P("copyToClipboard"),
|
|
5258
5258
|
sections: [{
|
|
5259
5259
|
type: "Option",
|
|
5260
|
-
label:
|
|
5261
|
-
onClick: () =>
|
|
5260
|
+
label: P("copyDecimalDot"),
|
|
5261
|
+
onClick: () => G("dot"),
|
|
5262
5262
|
testId: `${n}-option-copy-decimal-dot`
|
|
5263
5263
|
}, {
|
|
5264
5264
|
type: "Option",
|
|
5265
|
-
label:
|
|
5266
|
-
onClick: () =>
|
|
5265
|
+
label: P("copyDecimalComma"),
|
|
5266
|
+
onClick: () => G("comma")
|
|
5267
5267
|
}]
|
|
5268
5268
|
}
|
|
5269
5269
|
}],
|
|
5270
|
-
...applyModalHandlers((i =
|
|
5271
|
-
],
|
|
5270
|
+
...applyModalHandlers((i = S == null ? void 0 : S.exportOptions) == null ? [] : i, w, H)
|
|
5271
|
+
], X = v ? [{
|
|
5272
5272
|
type: "Option",
|
|
5273
|
-
label:
|
|
5274
|
-
onClick: () =>
|
|
5273
|
+
label: P("deleteAllRows"),
|
|
5274
|
+
onClick: () => q(),
|
|
5275
5275
|
testId: `${n}-delete-all-rows`
|
|
5276
|
-
}, ...applyModalHandlers((a =
|
|
5276
|
+
}, ...applyModalHandlers((a = S == null ? void 0 : S.deleteOptions) == null ? [] : a, w, H)] : [], ee = y ? [
|
|
5277
5277
|
{ type: "Divider" },
|
|
5278
5278
|
{
|
|
5279
5279
|
type: "Option",
|
|
5280
|
-
label:
|
|
5281
|
-
onClick: () =>
|
|
5280
|
+
label: P("help"),
|
|
5281
|
+
onClick: () => H("helpModal", !O)
|
|
5282
5282
|
},
|
|
5283
|
-
...applyModalHandlers((o =
|
|
5284
|
-
] : [],
|
|
5285
|
-
...
|
|
5286
|
-
section: [...
|
|
5283
|
+
...applyModalHandlers((o = S == null ? void 0 : S.helpOptions) == null ? [] : o, w, H)
|
|
5284
|
+
] : [], Z = [
|
|
5285
|
+
...J.length ? [{
|
|
5286
|
+
section: [...J, ...ee],
|
|
5287
5287
|
name: "import-options",
|
|
5288
5288
|
iconName: "import",
|
|
5289
|
-
tooltip:
|
|
5289
|
+
tooltip: P("import")
|
|
5290
5290
|
}] : [],
|
|
5291
|
-
...
|
|
5292
|
-
section:
|
|
5291
|
+
...Y.length ? [{
|
|
5292
|
+
section: Y,
|
|
5293
5293
|
name: "export-options",
|
|
5294
5294
|
iconName: "export",
|
|
5295
|
-
tooltip:
|
|
5295
|
+
tooltip: P("export")
|
|
5296
5296
|
}] : [],
|
|
5297
|
-
...
|
|
5298
|
-
section:
|
|
5297
|
+
...X.length ? [{
|
|
5298
|
+
section: X,
|
|
5299
5299
|
name: "delete-options",
|
|
5300
5300
|
iconName: "delete",
|
|
5301
|
-
tooltip:
|
|
5301
|
+
tooltip: P("deleteAllRows")
|
|
5302
5302
|
}] : []
|
|
5303
5303
|
];
|
|
5304
5304
|
return /* @__PURE__ */ jsxs("span", { children: [
|
|
5305
|
-
|
|
5305
|
+
I && /* @__PURE__ */ jsx(Spinner, {
|
|
5306
5306
|
small: !0,
|
|
5307
5307
|
dark: !0
|
|
5308
5308
|
}),
|
|
5309
|
-
|
|
5309
|
+
Z.map((e, t) => /* @__PURE__ */ jsx(MenuComponent, {
|
|
5310
5310
|
sections: e.section,
|
|
5311
5311
|
iconName: e.iconName,
|
|
5312
5312
|
tooltip: e.tooltip,
|
|
5313
5313
|
testId: `data-${e == null ? void 0 : e.name}-menu`
|
|
5314
5314
|
}, t)),
|
|
5315
|
-
|
|
5315
|
+
D && /* @__PURE__ */ jsx(PasteWithReviewModal, {
|
|
5316
5316
|
config: e,
|
|
5317
|
-
state:
|
|
5318
|
-
updateState:
|
|
5319
|
-
setModalVisibility:
|
|
5320
|
-
readAndParseInput:
|
|
5321
|
-
onCloseModal:
|
|
5317
|
+
state: w,
|
|
5318
|
+
updateState: B,
|
|
5319
|
+
setModalVisibility: H,
|
|
5320
|
+
readAndParseInput: z,
|
|
5321
|
+
onCloseModal: V,
|
|
5322
5322
|
validationRules: u,
|
|
5323
|
-
onCompleteImport:
|
|
5323
|
+
onCompleteImport: C,
|
|
5324
5324
|
prevalidationConfig: l,
|
|
5325
|
-
t:
|
|
5326
|
-
loading:
|
|
5327
|
-
startTransition:
|
|
5325
|
+
t: P,
|
|
5326
|
+
loading: I,
|
|
5327
|
+
startTransition: L,
|
|
5328
5328
|
testId: n
|
|
5329
5329
|
}),
|
|
5330
|
-
|
|
5331
|
-
visible:
|
|
5332
|
-
setModalVisibility:
|
|
5330
|
+
O && /* @__PURE__ */ jsx(HelpModal, {
|
|
5331
|
+
visible: O,
|
|
5332
|
+
setModalVisibility: H,
|
|
5333
5333
|
validationRules: u,
|
|
5334
|
-
t:
|
|
5334
|
+
t: P
|
|
5335
5335
|
}),
|
|
5336
|
-
|
|
5337
|
-
visible:
|
|
5338
|
-
prompt:
|
|
5339
|
-
onUpload:
|
|
5340
|
-
onCloseModal: () =>
|
|
5341
|
-
onComplete:
|
|
5342
|
-
onError:
|
|
5343
|
-
heading:
|
|
5344
|
-
dialogText:
|
|
5345
|
-
fileInputText:
|
|
5346
|
-
fileInputPlaceholder:
|
|
5347
|
-
uploadText:
|
|
5348
|
-
cancelText:
|
|
5336
|
+
k && t && /* @__PURE__ */ jsx(SmartUploadModal, {
|
|
5337
|
+
visible: E,
|
|
5338
|
+
prompt: A,
|
|
5339
|
+
onUpload: N,
|
|
5340
|
+
onCloseModal: () => V({ callback: j }),
|
|
5341
|
+
onComplete: K,
|
|
5342
|
+
onError: M,
|
|
5343
|
+
heading: P("smartUpload_smartUpload"),
|
|
5344
|
+
dialogText: P("smartUpload_description"),
|
|
5345
|
+
fileInputText: P("chooseFile"),
|
|
5346
|
+
fileInputPlaceholder: P("noFileSelected"),
|
|
5347
|
+
uploadText: P("uploadCapitalized"),
|
|
5348
|
+
cancelText: P("cancel"),
|
|
5349
5349
|
testId: n
|
|
5350
5350
|
}),
|
|
5351
5351
|
/* @__PURE__ */ jsx(ModalsRenderer, {
|
|
5352
|
-
modals:
|
|
5353
|
-
modalVisibility:
|
|
5354
|
-
onCloseModal:
|
|
5352
|
+
modals: x,
|
|
5353
|
+
modalVisibility: w == null ? void 0 : w.modalVisibility,
|
|
5354
|
+
onCloseModal: V,
|
|
5355
5355
|
testId: n
|
|
5356
5356
|
})
|
|
5357
5357
|
] });
|
|
@@ -6680,32 +6680,32 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6680
6680
|
]
|
|
6681
6681
|
})
|
|
6682
6682
|
});
|
|
6683
|
-
}, TreePlaceholder = ({ depth: e }) => /* @__PURE__ */ jsx("div", {
|
|
6683
|
+
}, TreePlaceholder = ({ depth: e, indent: t = "var(--size-sm)" }) => /* @__PURE__ */ jsx("div", {
|
|
6684
6684
|
className: tree_module_default.placeholder,
|
|
6685
|
-
style: { left:
|
|
6686
|
-
}), Tree = ({ list: e, canDrop: t, draggable: n = !1, onListReorder: r, onChangeOpen: i, testId: a, isInitialOpen: o = !1, autoOpenActiveItems: s = !1, treeRef: l, itemHasChild: u, onItemToggle: d, icons: f, allowParentReassignment: m, stickyHeader: h, height: g, render: _ }) => {
|
|
6687
|
-
var
|
|
6688
|
-
let
|
|
6685
|
+
style: { left: `calc(${t} * ${e})` }
|
|
6686
|
+
}), Tree = ({ list: e, canDrop: t, draggable: n = !1, onListReorder: r, onChangeOpen: i, testId: a, isInitialOpen: o = !1, autoOpenActiveItems: s = !1, treeRef: l, itemHasChild: u, onItemToggle: d, icons: f, allowParentReassignment: m, stickyHeader: h, height: g, render: _, placeholderIndent: v }) => {
|
|
6687
|
+
var y;
|
|
6688
|
+
let b = l == null ? useRef(null) : l, x = (e) => {
|
|
6689
6689
|
i && i(e);
|
|
6690
|
-
},
|
|
6690
|
+
}, S = (t) => {
|
|
6691
6691
|
let n = e.items.find((e) => e.id === t);
|
|
6692
|
-
return n && n.parent ? [n.parent, ...
|
|
6692
|
+
return n && n.parent ? [n.parent, ...S(n.parent)] : [];
|
|
6693
6693
|
};
|
|
6694
6694
|
useEffect(() => {
|
|
6695
6695
|
if (s) {
|
|
6696
6696
|
let n = e.items.find((e) => e.active);
|
|
6697
6697
|
if (n) {
|
|
6698
6698
|
var t;
|
|
6699
|
-
let e =
|
|
6700
|
-
(t =
|
|
6699
|
+
let e = S(n.id);
|
|
6700
|
+
(t = b.current) == null || t.open(e);
|
|
6701
6701
|
}
|
|
6702
6702
|
}
|
|
6703
6703
|
}, [s, e.items]);
|
|
6704
|
-
let
|
|
6704
|
+
let C = (e, t) => {
|
|
6705
6705
|
var n;
|
|
6706
6706
|
return (n = e == null ? void 0 : e.findIndex((e) => (e == null ? void 0 : e.id) === t)) == null ? -1 : n;
|
|
6707
|
-
},
|
|
6708
|
-
let n =
|
|
6707
|
+
}, w = (e, t) => {
|
|
6708
|
+
let n = C(t, e == null ? void 0 : e.parent);
|
|
6709
6709
|
if (n >= 0) {
|
|
6710
6710
|
let r = t == null ? void 0 : t.find((e) => {
|
|
6711
6711
|
var r;
|
|
@@ -6713,20 +6713,20 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6713
6713
|
});
|
|
6714
6714
|
e.parent = r ? r.id : 0;
|
|
6715
6715
|
}
|
|
6716
|
-
},
|
|
6716
|
+
}, T = (e, t) => {
|
|
6717
6717
|
var n;
|
|
6718
6718
|
return (n = t == null ? void 0 : t.filter((t) => (t == null ? void 0 : t.id) !== (e == null ? void 0 : e.id))) == null ? [] : n;
|
|
6719
|
-
},
|
|
6719
|
+
}, E = (e, t, n) => (n == null || n.splice(t, 0, e), n), D = (e) => e.map(({ id: e, parent: t, droppable: n, data: r }) => ({
|
|
6720
6720
|
id: e,
|
|
6721
6721
|
parent: t,
|
|
6722
6722
|
droppable: n,
|
|
6723
6723
|
...r
|
|
6724
|
-
})),
|
|
6724
|
+
})), O = (e, t) => {
|
|
6725
6725
|
let { dragSource: n, dropTarget: i } = t, a = [...e];
|
|
6726
6726
|
if (!r) return;
|
|
6727
|
-
let o =
|
|
6728
|
-
(n == null ? void 0 : n.parent) === (i == null ? void 0 : i.id) && o === 0 && m && (
|
|
6729
|
-
},
|
|
6727
|
+
let o = C(a, n == null ? void 0 : n.id), s = C(a, n == null ? void 0 : n.parent), c = [];
|
|
6728
|
+
(n == null ? void 0 : n.parent) === (i == null ? void 0 : i.id) && o === 0 && m && (w(n, a), a = T(n, a), a = E(n, s, a)), c = D(a), r(c);
|
|
6729
|
+
}, k = e == null || (y = e.items) == null ? void 0 : y.map(({ id: e, droppable: t, parent: n, name: r, onDrop: i, ...a }) => ({
|
|
6730
6730
|
id: e,
|
|
6731
6731
|
text: r,
|
|
6732
6732
|
droppable: t,
|
|
@@ -6750,8 +6750,8 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6750
6750
|
options: getBackendOptions(),
|
|
6751
6751
|
context: window,
|
|
6752
6752
|
children: /* @__PURE__ */ jsx(Tree$1, {
|
|
6753
|
-
ref:
|
|
6754
|
-
tree:
|
|
6753
|
+
ref: b,
|
|
6754
|
+
tree: k,
|
|
6755
6755
|
sort: !1,
|
|
6756
6756
|
insertDroppableFirst: !1,
|
|
6757
6757
|
canDrag: () => n,
|
|
@@ -6781,10 +6781,13 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6781
6781
|
onDrop: (s = e.data) == null ? void 0 : s.onDrop
|
|
6782
6782
|
});
|
|
6783
6783
|
},
|
|
6784
|
-
onDrop:
|
|
6785
|
-
onChangeOpen:
|
|
6784
|
+
onDrop: O,
|
|
6785
|
+
onChangeOpen: x,
|
|
6786
6786
|
dropTargetOffset: 10,
|
|
6787
|
-
placeholderRender: (e, { depth: t }) => /* @__PURE__ */ jsx(TreePlaceholder, {
|
|
6787
|
+
placeholderRender: (e, { depth: t }) => /* @__PURE__ */ jsx(TreePlaceholder, {
|
|
6788
|
+
depth: t,
|
|
6789
|
+
indent: v
|
|
6790
|
+
}),
|
|
6788
6791
|
placeholderComponent: "div",
|
|
6789
6792
|
listComponent: "div",
|
|
6790
6793
|
listItemComponent: "div",
|
|
@@ -6801,17 +6804,19 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6801
6804
|
});
|
|
6802
6805
|
};
|
|
6803
6806
|
var tree_table_module_default = {
|
|
6804
|
-
treeTable: "
|
|
6805
|
-
treeTableHeader: "
|
|
6806
|
-
folderCell: "
|
|
6807
|
-
dragCell: "
|
|
6808
|
-
drag: "
|
|
6809
|
-
folder: "
|
|
6810
|
-
|
|
6811
|
-
nested: "_nested_3rlrs_63"
|
|
6807
|
+
treeTable: "_treeTable_1ywvy_1",
|
|
6808
|
+
treeTableHeader: "_treeTableHeader_1ywvy_22",
|
|
6809
|
+
folderCell: "_folderCell_1ywvy_30",
|
|
6810
|
+
dragCell: "_dragCell_1ywvy_31",
|
|
6811
|
+
drag: "_drag_1ywvy_31",
|
|
6812
|
+
folder: "_folder_1ywvy_30",
|
|
6813
|
+
active: "_active_1ywvy_61"
|
|
6812
6814
|
};
|
|
6813
6815
|
const TreeTableRow = ({ columnAlignment: e, columnWidths: t, depth: n, draggable: r, handleRef: i, hasChild: a, hasRowActions: o, icons: s, isOpen: c, node: l, onDragEnter: u, onDragOver: d, onDragLeave: f, onDrop: p, onToggle: m }) => {
|
|
6814
|
-
let { data: h, droppable: _ } = l, { id: v, cells: y, testId: b, actions: x = [] } = h,
|
|
6816
|
+
let { data: h, droppable: _ } = l, { id: v, cells: y, testId: b, actions: x = [], active: S, onRowClick: C } = h, w = _ || a, T = (e) => {
|
|
6817
|
+
let r = t ? t[e] : void 0;
|
|
6818
|
+
return e === 0 ? `calc(${r} - ${`calc(var(--size) * ${w ? n + 1 : n})`})` : r;
|
|
6819
|
+
};
|
|
6815
6820
|
return /* @__PURE__ */ jsx("table", {
|
|
6816
6821
|
className: table_module_default.table,
|
|
6817
6822
|
"data-testid": b,
|
|
@@ -6820,7 +6825,8 @@ const TreeTableRow = ({ columnAlignment: e, columnWidths: t, depth: n, draggable
|
|
|
6820
6825
|
onDragOver: d,
|
|
6821
6826
|
onDragLeave: f,
|
|
6822
6827
|
children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsxs("tr", {
|
|
6823
|
-
|
|
6828
|
+
onClick: C,
|
|
6829
|
+
className: cx(tree_table_module_default.treeTableRow, S ? tree_table_module_default.active : void 0),
|
|
6824
6830
|
children: [
|
|
6825
6831
|
r && /* @__PURE__ */ jsx("td", {
|
|
6826
6832
|
className: tree_table_module_default.dragCell,
|
|
@@ -6831,14 +6837,10 @@ const TreeTableRow = ({ columnAlignment: e, columnWidths: t, depth: n, draggable
|
|
|
6831
6837
|
children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG })
|
|
6832
6838
|
})
|
|
6833
6839
|
}),
|
|
6834
|
-
/* @__PURE__ */ jsx("td", {
|
|
6840
|
+
Array.from({ length: n }).map((e, t) => /* @__PURE__ */ jsx("td", { className: tree_table_module_default.folderCell }, t)),
|
|
6841
|
+
w && /* @__PURE__ */ jsx("td", {
|
|
6835
6842
|
className: tree_table_module_default.folderCell,
|
|
6836
|
-
|
|
6837
|
-
width: S,
|
|
6838
|
-
minWidth: S,
|
|
6839
|
-
maxWidth: S
|
|
6840
|
-
},
|
|
6841
|
-
children: (_ || a) && /* @__PURE__ */ jsx("div", {
|
|
6843
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
6842
6844
|
className: tree_table_module_default.folder,
|
|
6843
6845
|
onClick: () => m(v),
|
|
6844
6846
|
onMouseDown: (e) => e.stopPropagation(),
|
|
@@ -6852,15 +6854,12 @@ const TreeTableRow = ({ columnAlignment: e, columnWidths: t, depth: n, draggable
|
|
|
6852
6854
|
})
|
|
6853
6855
|
})
|
|
6854
6856
|
}),
|
|
6855
|
-
y.map((
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
columnAlignment: e ? e[r] : null
|
|
6862
|
-
}, r);
|
|
6863
|
-
}),
|
|
6857
|
+
y.map((t, n) => /* @__PURE__ */ jsx(Cell, {
|
|
6858
|
+
isHeader: !1,
|
|
6859
|
+
cell: t,
|
|
6860
|
+
width: T(n),
|
|
6861
|
+
columnAlignment: e ? e[n] : null
|
|
6862
|
+
}, n)),
|
|
6864
6863
|
o && /* @__PURE__ */ jsx(Cell, {
|
|
6865
6864
|
isHeader: !1,
|
|
6866
6865
|
cell: {
|
|
@@ -6875,7 +6874,6 @@ const TreeTableRow = ({ columnAlignment: e, columnWidths: t, depth: n, draggable
|
|
|
6875
6874
|
className: cx(table_module_default.table, tree_table_module_default.treeTableHeader),
|
|
6876
6875
|
children: /* @__PURE__ */ jsx("thead", { children: i.map((i, a) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
6877
6876
|
n && /* @__PURE__ */ jsx("th", { className: tree_table_module_default.dragCell }),
|
|
6878
|
-
/* @__PURE__ */ jsx("th", { className: tree_table_module_default.folderCell }),
|
|
6879
6877
|
i.cells.map((n, r) => /* @__PURE__ */ jsx(Cell, {
|
|
6880
6878
|
isHeader: !0,
|
|
6881
6879
|
cell: n,
|
|
@@ -6918,6 +6916,7 @@ const TreeTableRow = ({ columnAlignment: e, columnWidths: t, depth: n, draggable
|
|
|
6918
6916
|
onChangeOpen: l,
|
|
6919
6917
|
onItemToggle: s,
|
|
6920
6918
|
onListReorder: c,
|
|
6919
|
+
placeholderIndent: "var(--size)",
|
|
6921
6920
|
render: (e, { depth: t, draggable: n, handleRef: r, hasChild: a, isOpen: o, onToggle: s }) => /* @__PURE__ */ jsx(TreeTableRow, {
|
|
6922
6921
|
node: e,
|
|
6923
6922
|
columnAlignment: p,
|
|
@@ -7062,7 +7061,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7062
7061
|
} : {
|
|
7063
7062
|
value: G,
|
|
7064
7063
|
unit: U
|
|
7065
|
-
}), J = k || (K == null ? void 0 : K.value) === void 0, [Y,
|
|
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) => {
|
|
7066
7065
|
if (!(e != null && e.value)) return;
|
|
7067
7066
|
if (E) return E === e.valueKey;
|
|
7068
7067
|
let t = isValueWithUnit(e.value) ? getUnit(e.value) : "", { value: n = l } = convertUnit({
|
|
@@ -7071,7 +7070,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7071
7070
|
toUnit: t
|
|
7072
7071
|
});
|
|
7073
7072
|
return withUnit(n, t) === e.value;
|
|
7074
|
-
}),
|
|
7073
|
+
}), te = () => {
|
|
7075
7074
|
var e;
|
|
7076
7075
|
let t = (e = l) == null ? "" : e, n = K.unit;
|
|
7077
7076
|
if (!checkConversion({
|
|
@@ -7087,7 +7086,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7087
7086
|
} catch {
|
|
7088
7087
|
return null;
|
|
7089
7088
|
}
|
|
7090
|
-
},
|
|
7089
|
+
}, ne = (t) => {
|
|
7091
7090
|
let n = getStringName(e), r = t.target, { value: i, selectionStart: a } = r, o = withUnit(i, (K == null ? void 0 : K.unit) || "");
|
|
7092
7091
|
h({ target: {
|
|
7093
7092
|
value: A ? withUnit(convertAndGetValue(o, B), B) : o,
|
|
@@ -7100,7 +7099,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7100
7099
|
}), R(() => {
|
|
7101
7100
|
r.selectionStart = a, r.selectionEnd = a;
|
|
7102
7101
|
});
|
|
7103
|
-
},
|
|
7102
|
+
}, re = (e, t) => {
|
|
7104
7103
|
t === K.unit || isNaN(Number(e)) || (q({
|
|
7105
7104
|
value: e,
|
|
7106
7105
|
unit: t
|
|
@@ -7131,7 +7130,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7131
7130
|
e !== void 0 && q({
|
|
7132
7131
|
value: e,
|
|
7133
7132
|
unit: t
|
|
7134
|
-
}),
|
|
7133
|
+
}), X(C && Z && T ? PredefinedOptionsMenuState.PREDEFINED : PredefinedOptionsMenuState.CUSTOM);
|
|
7135
7134
|
}
|
|
7136
7135
|
}, [
|
|
7137
7136
|
U,
|
|
@@ -7139,7 +7138,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7139
7138
|
i,
|
|
7140
7139
|
T
|
|
7141
7140
|
]);
|
|
7142
|
-
let
|
|
7141
|
+
let Q = te(), $ = label(K.unit) || K.unit || "", ie = p || !Q || Q && Q.length === 1, ae = getStringName(e), oe, se = (t) => {
|
|
7143
7142
|
let r = t != null && t.value ? t.value : "", [i = "", a = ""] = isValueWithUnit(r) ? split(r) : [r], o = withPrettyUnitLabel(r);
|
|
7144
7143
|
if (checkConversion({
|
|
7145
7144
|
value: r,
|
|
@@ -7159,7 +7158,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7159
7158
|
type: MenuType.OPTION,
|
|
7160
7159
|
inline: !0,
|
|
7161
7160
|
onClick: () => {
|
|
7162
|
-
validateNumber(i).valid && !n && (
|
|
7161
|
+
validateNumber(i).valid && !n && (X(PredefinedOptionsMenuState.PREDEFINED), h({ target: {
|
|
7163
7162
|
value: r,
|
|
7164
7163
|
name: typeof e == "string" ? e : (e == null ? void 0 : e.fieldName) || "",
|
|
7165
7164
|
predefinedSelected: !0,
|
|
@@ -7171,10 +7170,10 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7171
7170
|
height: "0"
|
|
7172
7171
|
})] }),
|
|
7173
7172
|
description: o,
|
|
7174
|
-
selected:
|
|
7173
|
+
selected: Z === t && Y === PredefinedOptionsMenuState.PREDEFINED
|
|
7175
7174
|
};
|
|
7176
7175
|
};
|
|
7177
|
-
if (
|
|
7176
|
+
if (oe = [{
|
|
7178
7177
|
type: MenuType.OPTION,
|
|
7179
7178
|
inline: !0,
|
|
7180
7179
|
onClick: () => {
|
|
@@ -7187,7 +7186,7 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7187
7186
|
selected: Y === PredefinedOptionsMenuState.CUSTOM
|
|
7188
7187
|
}], C != null && C.length) {
|
|
7189
7188
|
let e = C.map(se);
|
|
7190
|
-
|
|
7189
|
+
oe = [...oe, ...e];
|
|
7191
7190
|
}
|
|
7192
7191
|
let ce = (e) => {
|
|
7193
7192
|
if (isValueWithUnit(e)) {
|
|
@@ -7223,39 +7222,39 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7223
7222
|
small: o
|
|
7224
7223
|
}),
|
|
7225
7224
|
small: o,
|
|
7226
|
-
sections:
|
|
7225
|
+
sections: oe
|
|
7227
7226
|
},
|
|
7228
|
-
tooltip: Y === PredefinedOptionsMenuState.PREDEFINED ?
|
|
7227
|
+
tooltip: Y === PredefinedOptionsMenuState.PREDEFINED ? Z == null ? void 0 : Z.label : ""
|
|
7229
7228
|
}),
|
|
7230
7229
|
/* @__PURE__ */ jsx("div", {
|
|
7231
7230
|
className: unit_input_module_default.inputWrapper,
|
|
7232
7231
|
children: /* @__PURE__ */ jsx(NumberInput, {
|
|
7233
|
-
name:
|
|
7232
|
+
name: ae,
|
|
7234
7233
|
testId: x,
|
|
7235
7234
|
disabled: n,
|
|
7236
7235
|
placeholder: ce(t),
|
|
7237
7236
|
value: K.value,
|
|
7238
|
-
onChange:
|
|
7237
|
+
onChange: ne,
|
|
7239
7238
|
onFocus: v,
|
|
7240
7239
|
error: i === null ? void 0 : i,
|
|
7241
7240
|
warning: S === null ? void 0 : S,
|
|
7242
7241
|
left: a,
|
|
7243
7242
|
allowEmpty: J,
|
|
7244
|
-
validationCallback: (e, t) => D(
|
|
7243
|
+
validationCallback: (e, t) => D(ae, t),
|
|
7245
7244
|
enableCosmeticRounding: j,
|
|
7246
7245
|
enableDisplayRounding: M,
|
|
7247
7246
|
roundDisplayValue: N,
|
|
7248
7247
|
groupOrder: le,
|
|
7249
|
-
disableInternalErrorValidationMessages:
|
|
7248
|
+
disableInternalErrorValidationMessages: ee,
|
|
7250
7249
|
small: o,
|
|
7251
7250
|
selectOnFocus: P,
|
|
7252
7251
|
tooltip: I
|
|
7253
|
-
},
|
|
7252
|
+
}, ae)
|
|
7254
7253
|
}),
|
|
7255
|
-
|
|
7254
|
+
$ && (ie || !H ? /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
7256
7255
|
groupOrder: ue,
|
|
7257
7256
|
small: o,
|
|
7258
|
-
children:
|
|
7257
|
+
children: $
|
|
7259
7258
|
}) : /* @__PURE__ */ jsx(Menu, {
|
|
7260
7259
|
groupOrder: ue,
|
|
7261
7260
|
maxHeight: 380,
|
|
@@ -7263,20 +7262,20 @@ const UnitInput = ({ name: e, placeholder: t = "", disabled: n = !1, disabledUni
|
|
|
7263
7262
|
testId: x && `${x}-menu`,
|
|
7264
7263
|
tabIndex: -1,
|
|
7265
7264
|
menu: {
|
|
7266
|
-
label:
|
|
7265
|
+
label: $,
|
|
7267
7266
|
trigger: "DropDownButton",
|
|
7268
7267
|
small: o,
|
|
7269
|
-
sections:
|
|
7268
|
+
sections: Q.map(([e = "", t = "", n]) => {
|
|
7270
7269
|
let r = n || t || "", i = isValidNum(e) ? e : "";
|
|
7271
7270
|
return {
|
|
7272
7271
|
type: "Option",
|
|
7273
7272
|
label: j ? safeRoundNumbers(i) : i,
|
|
7274
7273
|
inline: !0,
|
|
7275
7274
|
onClick: (n) => {
|
|
7276
|
-
n.stopPropagation(),
|
|
7275
|
+
n.stopPropagation(), re(e, t);
|
|
7277
7276
|
},
|
|
7278
7277
|
description: r,
|
|
7279
|
-
selected: r ===
|
|
7278
|
+
selected: r === $,
|
|
7280
7279
|
testId: `${x}-unit-${r}`
|
|
7281
7280
|
};
|
|
7282
7281
|
})
|
package/package.json
CHANGED