@oliasoft-open-source/react-ui-library 5.14.0 → 5.14.1-beta-2
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 +17 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6577,30 +6577,30 @@ var tree_module_default = {
|
|
|
6577
6577
|
placeholderContainer: "_placeholderContainer_1cqsz_38"
|
|
6578
6578
|
};
|
|
6579
6579
|
const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, draggable: o, icons: s, onDrop: c }) => {
|
|
6580
|
-
let { id: l, data: u } = t, { active: d,
|
|
6580
|
+
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) => {
|
|
6581
6581
|
e.stopPropagation(), i(l);
|
|
6582
|
-
}, x = (e) => {
|
|
6583
|
-
e.preventDefault(), e.stopPropagation(), h || (_(!0), y((/* @__PURE__ */ new Date()).getTime()));
|
|
6584
6582
|
}, S = (e) => {
|
|
6585
|
-
e.preventDefault(), e.stopPropagation(), (/* @__PURE__ */ new Date()).getTime()
|
|
6583
|
+
e.preventDefault(), e.stopPropagation(), _ || (v(!0), b((/* @__PURE__ */ new Date()).getTime()));
|
|
6586
6584
|
}, C = (e) => {
|
|
6587
|
-
e.preventDefault(), e.stopPropagation(),
|
|
6585
|
+
e.preventDefault(), e.stopPropagation(), (/* @__PURE__ */ new Date()).getTime() - y > 20 && v(!1);
|
|
6588
6586
|
}, w = (e) => {
|
|
6589
|
-
e.preventDefault(), e.stopPropagation(),
|
|
6587
|
+
e.preventDefault(), e.stopPropagation(), a && !r && (/* @__PURE__ */ new Date()).getTime() - y > 200 && x(e);
|
|
6588
|
+
}, T = (e) => {
|
|
6589
|
+
e.preventDefault(), e.stopPropagation(), v(!1), b((/* @__PURE__ */ new Date()).getTime()), c == null || c(e);
|
|
6590
6590
|
};
|
|
6591
6591
|
return /* @__PURE__ */ jsx("div", {
|
|
6592
|
-
className: cx(list_module_default.item, list_module_default.action, d ? list_module_default.active : "", n > 0 ? list_module_default.indented : "",
|
|
6592
|
+
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 : ""),
|
|
6593
6593
|
style: { marginInlineStart: n * 24 },
|
|
6594
|
-
"data-testid":
|
|
6594
|
+
"data-testid": p,
|
|
6595
6595
|
onClick: (e) => {
|
|
6596
|
-
|
|
6596
|
+
f || (m ? m(e) : a && x(e));
|
|
6597
6597
|
},
|
|
6598
|
-
onDrop: (e) => c ?
|
|
6599
|
-
onDragEnter: (e) => c ?
|
|
6600
|
-
onDragOver: (e) => c ?
|
|
6601
|
-
onDragLeave: (e) => c ?
|
|
6598
|
+
onDrop: (e) => c ? T(e) : {},
|
|
6599
|
+
onDragEnter: (e) => c ? S(e) : {},
|
|
6600
|
+
onDragOver: (e) => c ? w(e) : {},
|
|
6601
|
+
onDragLeave: (e) => c ? C(e) : {},
|
|
6602
6602
|
children: /* @__PURE__ */ jsxs("div", {
|
|
6603
|
-
className: cx(list_module_default.itemHeader,
|
|
6603
|
+
className: cx(list_module_default.itemHeader, _ ? list_module_default.noPointerEvents : ""),
|
|
6604
6604
|
children: [
|
|
6605
6605
|
a && /* @__PURE__ */ jsx("div", {
|
|
6606
6606
|
className: tree_module_default.toggle,
|
|
@@ -6610,7 +6610,7 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6610
6610
|
small: !0,
|
|
6611
6611
|
round: !0,
|
|
6612
6612
|
icon: r ? (s == null ? void 0 : s.collapse) || IconType.COLLAPSE : (s == null ? void 0 : s.expand) || IconType.EXPAND,
|
|
6613
|
-
onClick:
|
|
6613
|
+
onClick: x
|
|
6614
6614
|
})
|
|
6615
6615
|
}),
|
|
6616
6616
|
o && /* @__PURE__ */ jsx("div", {
|
|
@@ -6620,9 +6620,9 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6620
6620
|
/* @__PURE__ */ jsx(MetaContent, { item: u }),
|
|
6621
6621
|
/* @__PURE__ */ jsx("div", {
|
|
6622
6622
|
className: list_module_default.right,
|
|
6623
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
6623
|
+
children: !f && h.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
6624
6624
|
className: list_module_default.actions,
|
|
6625
|
-
children: /* @__PURE__ */ jsx(Actions, { actions:
|
|
6625
|
+
children: /* @__PURE__ */ jsx(Actions, { actions: h })
|
|
6626
6626
|
})
|
|
6627
6627
|
})
|
|
6628
6628
|
]
|
package/package.json
CHANGED