@oliasoft-open-source/react-ui-library 5.15.2 → 5.15.3-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/index.js +19 -19
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6628,30 +6628,30 @@ var tree_module_default = {
|
|
|
6628
6628
|
placeholderContainer: "_placeholderContainer_1cqsz_38"
|
|
6629
6629
|
};
|
|
6630
6630
|
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,
|
|
6631
|
+
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
6632
|
e.stopPropagation(), i(l);
|
|
6633
|
-
}, x = (e) => {
|
|
6634
|
-
e.preventDefault(), e.stopPropagation(), h || (_(!0), y((/* @__PURE__ */ new Date()).getTime()));
|
|
6635
6633
|
}, S = (e) => {
|
|
6636
|
-
e.preventDefault(), e.stopPropagation(), (/* @__PURE__ */ new Date()).getTime()
|
|
6634
|
+
e.preventDefault(), e.stopPropagation(), _ || (v(!0), b((/* @__PURE__ */ new Date()).getTime()));
|
|
6637
6635
|
}, C = (e) => {
|
|
6638
|
-
e.preventDefault(), e.stopPropagation(),
|
|
6636
|
+
e.preventDefault(), e.stopPropagation(), (/* @__PURE__ */ new Date()).getTime() - y > 20 && v(!1);
|
|
6639
6637
|
}, w = (e) => {
|
|
6640
|
-
e.preventDefault(), e.stopPropagation(),
|
|
6638
|
+
e.preventDefault(), e.stopPropagation(), a && !r && (/* @__PURE__ */ new Date()).getTime() - y > 200 && x(e);
|
|
6639
|
+
}, T = (e) => {
|
|
6640
|
+
e.preventDefault(), e.stopPropagation(), v(!1), b((/* @__PURE__ */ new Date()).getTime()), c == null || c(e);
|
|
6641
6641
|
};
|
|
6642
6642
|
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 : "",
|
|
6643
|
+
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
6644
|
style: { marginInlineStart: n * 24 },
|
|
6645
|
-
"data-testid":
|
|
6645
|
+
"data-testid": p,
|
|
6646
6646
|
onClick: (e) => {
|
|
6647
|
-
|
|
6647
|
+
f || (m ? m(e) : a && x(e));
|
|
6648
6648
|
},
|
|
6649
|
-
onDrop: (e) => c ?
|
|
6650
|
-
onDragEnter: (e) => c ?
|
|
6651
|
-
onDragOver: (e) => c ?
|
|
6652
|
-
onDragLeave: (e) => c ?
|
|
6649
|
+
onDrop: (e) => c ? T(e) : {},
|
|
6650
|
+
onDragEnter: (e) => c ? S(e) : {},
|
|
6651
|
+
onDragOver: (e) => c ? w(e) : {},
|
|
6652
|
+
onDragLeave: (e) => c ? C(e) : {},
|
|
6653
6653
|
children: /* @__PURE__ */ jsxs("div", {
|
|
6654
|
-
className: cx(list_module_default.itemHeader,
|
|
6654
|
+
className: cx(list_module_default.itemHeader, _ ? list_module_default.noPointerEvents : ""),
|
|
6655
6655
|
children: [
|
|
6656
6656
|
a && /* @__PURE__ */ jsx("div", {
|
|
6657
6657
|
className: tree_module_default.toggle,
|
|
@@ -6661,7 +6661,7 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6661
6661
|
small: !0,
|
|
6662
6662
|
round: !0,
|
|
6663
6663
|
icon: r ? (s == null ? void 0 : s.collapse) || IconType.COLLAPSE : (s == null ? void 0 : s.expand) || IconType.EXPAND,
|
|
6664
|
-
onClick:
|
|
6664
|
+
onClick: x
|
|
6665
6665
|
})
|
|
6666
6666
|
}),
|
|
6667
6667
|
o && /* @__PURE__ */ jsx("div", {
|
|
@@ -6669,12 +6669,12 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6669
6669
|
children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG })
|
|
6670
6670
|
}),
|
|
6671
6671
|
/* @__PURE__ */ jsx(MetaContent, { item: u }),
|
|
6672
|
-
/* @__PURE__ */
|
|
6672
|
+
/* @__PURE__ */ jsxs("div", {
|
|
6673
6673
|
className: list_module_default.right,
|
|
6674
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
6674
|
+
children: [/* @__PURE__ */ jsx(MetaCount, { item: u }), !f && h.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
6675
6675
|
className: list_module_default.actions,
|
|
6676
|
-
children: /* @__PURE__ */ jsx(Actions, { actions:
|
|
6677
|
-
})
|
|
6676
|
+
children: /* @__PURE__ */ jsx(Actions, { actions: h })
|
|
6677
|
+
})]
|
|
6678
6678
|
})
|
|
6679
6679
|
]
|
|
6680
6680
|
})
|
package/package.json
CHANGED