@oliasoft-open-source/react-ui-library 5.8.5-beta-2 → 5.8.5-beta-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/README.md +1 -0
- package/dist/global.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +23 -19
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1761,6 +1761,7 @@ export declare interface ITreeProps {
|
|
|
1761
1761
|
};
|
|
1762
1762
|
allowParentReassignment?: boolean;
|
|
1763
1763
|
stickyHeader?: boolean;
|
|
1764
|
+
height?: number | string;
|
|
1764
1765
|
}
|
|
1765
1766
|
|
|
1766
1767
|
declare interface IUnitConfigItem {
|
|
@@ -2141,7 +2142,7 @@ declare const TRANSLATION_FALLBACK: {
|
|
|
2141
2142
|
unknown: string;
|
|
2142
2143
|
};
|
|
2143
2144
|
|
|
2144
|
-
export declare const Tree: ({ list, draggable, onListReorder, onChangeOpen, testId, isInitialOpen, treeRef, itemHasChild, onItemToggle, icons, allowParentReassignment, stickyHeader, }: ITreeProps) => JSX_2.Element;
|
|
2145
|
+
export declare const Tree: ({ list, draggable, onListReorder, onChangeOpen, testId, isInitialOpen, treeRef, itemHasChild, onItemToggle, icons, allowParentReassignment, stickyHeader, height, }: ITreeProps) => JSX_2.Element;
|
|
2145
2146
|
|
|
2146
2147
|
export declare enum TriggerType {
|
|
2147
2148
|
TEXT = "Text",
|
package/dist/index.js
CHANGED
|
@@ -1457,7 +1457,10 @@ const DrawerTabs = ({ tabs: e, activeTab: t, open: n, background: r, handleTabCl
|
|
|
1457
1457
|
if (isNil(e) || isEmpty(e)) return null;
|
|
1458
1458
|
let i = t === r;
|
|
1459
1459
|
return /* @__PURE__ */ jsx("div", {
|
|
1460
|
-
style: {
|
|
1460
|
+
style: {
|
|
1461
|
+
width: typeof a == "number" ? `${a}px` : a,
|
|
1462
|
+
display: i ? "block" : "none"
|
|
1463
|
+
},
|
|
1461
1464
|
className: drawer_module_default.tabsContent,
|
|
1462
1465
|
"data-testid": o && `${o}-content-${r}`,
|
|
1463
1466
|
children: i && n && e.content
|
|
@@ -6333,12 +6336,12 @@ const Content = ({ title: e, okText: t, onClickOk: n, disableConfirmButton: r, c
|
|
|
6333
6336
|
children: e
|
|
6334
6337
|
});
|
|
6335
6338
|
var tree_module_default = {
|
|
6336
|
-
tree: "
|
|
6337
|
-
toggle: "
|
|
6338
|
-
dropTarget: "
|
|
6339
|
-
placeholder: "
|
|
6340
|
-
draggingSource: "
|
|
6341
|
-
placeholderContainer: "
|
|
6339
|
+
tree: "_tree_1mtkj_1",
|
|
6340
|
+
toggle: "_toggle_1mtkj_7",
|
|
6341
|
+
dropTarget: "_dropTarget_1mtkj_14",
|
|
6342
|
+
placeholder: "_placeholder_1mtkj_29",
|
|
6343
|
+
draggingSource: "_draggingSource_1mtkj_35",
|
|
6344
|
+
placeholderContainer: "_placeholderContainer_1mtkj_38"
|
|
6342
6345
|
};
|
|
6343
6346
|
const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, draggable: o, icons: s, onDrop: c }) => {
|
|
6344
6347
|
let { id: l, data: u } = t, { active: d, testId: f, onClick: p, actions: m = [] } = u, [h, _] = React.useState(!1), [v, y] = React.useState(0), b = (e) => {
|
|
@@ -6395,26 +6398,26 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6395
6398
|
}, TreePlaceholder = ({ depth: e }) => /* @__PURE__ */ jsx("div", {
|
|
6396
6399
|
className: tree_module_default.placeholder,
|
|
6397
6400
|
style: { left: e * 24 }
|
|
6398
|
-
}), Tree = ({ list: e, draggable: t = !1, onListReorder: n, onChangeOpen: r, testId: i, isInitialOpen: a = !1, treeRef: o, itemHasChild: s, onItemToggle: c, icons: l, allowParentReassignment: u, stickyHeader: d }) => {
|
|
6399
|
-
let
|
|
6401
|
+
}), Tree = ({ list: e, draggable: t = !1, onListReorder: n, onChangeOpen: r, testId: i, isInitialOpen: a = !1, treeRef: o, itemHasChild: s, onItemToggle: c, icons: l, allowParentReassignment: u, stickyHeader: d, height: f }) => {
|
|
6402
|
+
let p = (e) => {
|
|
6400
6403
|
r && r(e);
|
|
6401
|
-
},
|
|
6402
|
-
let n =
|
|
6404
|
+
}, m = (e, t) => e?.findIndex((e) => e?.id === t) ?? -1, h = (e, t) => {
|
|
6405
|
+
let n = m(t, e?.parent);
|
|
6403
6406
|
if (n >= 0) {
|
|
6404
6407
|
let r = t?.find((e) => e?.id === t[n]?.parent);
|
|
6405
6408
|
e.parent = r ? r.id : 0;
|
|
6406
6409
|
}
|
|
6407
|
-
},
|
|
6410
|
+
}, g = (e, t) => t?.filter((t) => t?.id !== e?.id) ?? [], _ = (e, t, n) => (n?.splice(t, 0, e), n), v = (e) => e.map(({ id: e, parent: t, droppable: n, data: r }) => ({
|
|
6408
6411
|
id: e,
|
|
6409
6412
|
parent: t,
|
|
6410
6413
|
droppable: n,
|
|
6411
6414
|
...r
|
|
6412
|
-
})),
|
|
6415
|
+
})), y = (e, t) => {
|
|
6413
6416
|
let { dragSource: r, dropTarget: i } = t, a = [...e];
|
|
6414
6417
|
if (!n) return;
|
|
6415
|
-
let o =
|
|
6416
|
-
r?.parent === i?.id && o === 0 && u && (
|
|
6417
|
-
},
|
|
6418
|
+
let o = m(a, r?.id), s = m(a, r?.parent), c = [];
|
|
6419
|
+
r?.parent === i?.id && o === 0 && u && (h(r, a), a = g(r, a), a = _(r, s, a)), c = v(a), n(c);
|
|
6420
|
+
}, b = e?.items?.map(({ id: e, droppable: t, parent: n, name: r, onDrop: i,...a }) => ({
|
|
6418
6421
|
id: e,
|
|
6419
6422
|
text: r,
|
|
6420
6423
|
droppable: t,
|
|
@@ -6428,6 +6431,7 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6428
6431
|
return /* @__PURE__ */ jsxs("div", {
|
|
6429
6432
|
"data-testid": i,
|
|
6430
6433
|
className: list_module_default.list,
|
|
6434
|
+
style: { height: f },
|
|
6431
6435
|
children: [e.name && !e.noHeader && /* @__PURE__ */ jsx(ListHeading, {
|
|
6432
6436
|
name: e.name,
|
|
6433
6437
|
actions: e.actions,
|
|
@@ -6438,7 +6442,7 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6438
6442
|
context: window,
|
|
6439
6443
|
children: /* @__PURE__ */ jsx(Tree$1, {
|
|
6440
6444
|
ref: o,
|
|
6441
|
-
tree:
|
|
6445
|
+
tree: b,
|
|
6442
6446
|
sort: !1,
|
|
6443
6447
|
insertDroppableFirst: !1,
|
|
6444
6448
|
canDrag: () => t,
|
|
@@ -6458,8 +6462,8 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6458
6462
|
icons: l,
|
|
6459
6463
|
onDrop: e.data?.onDrop
|
|
6460
6464
|
}),
|
|
6461
|
-
onDrop:
|
|
6462
|
-
onChangeOpen:
|
|
6465
|
+
onDrop: y,
|
|
6466
|
+
onChangeOpen: p,
|
|
6463
6467
|
dropTargetOffset: 10,
|
|
6464
6468
|
placeholderRender: (e, { depth: t }) => /* @__PURE__ */ jsx(TreePlaceholder, { depth: t }),
|
|
6465
6469
|
placeholderComponent: "div",
|
package/package.json
CHANGED