@oliasoft-open-source/react-ui-library 5.15.3 → 5.16.0
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 +5 -3
- package/dist/index.js +66 -66
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ 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;
|
|
100
|
+
export declare const ColorInput: ({ columns, disabled, options, small, value, onChange, adjustColorsInDarkMode, }: IColorInputProps) => JSX_2.Element;
|
|
101
101
|
|
|
102
102
|
export declare const Column: ({ background, borderLeft, borderRight, children, flex, flexbox, padding, scroll, showScrollbar, spacing, width, widthMobile, widthTablet, testId, }: ILayoutColumnProps) => JSX_2.Element;
|
|
103
103
|
|
|
@@ -347,6 +347,7 @@ export declare interface IColorInputProps {
|
|
|
347
347
|
small?: boolean;
|
|
348
348
|
value?: string;
|
|
349
349
|
onChange?: (value: string) => void;
|
|
350
|
+
adjustColorsInDarkMode?: boolean;
|
|
350
351
|
}
|
|
351
352
|
|
|
352
353
|
/**
|
|
@@ -1798,6 +1799,7 @@ export declare interface ITreeProps {
|
|
|
1798
1799
|
isOpen: boolean;
|
|
1799
1800
|
onToggle: (id: TStringOrNumber) => void;
|
|
1800
1801
|
}) => ReactElement;
|
|
1802
|
+
placeholderIndent?: TStringOrNumber;
|
|
1801
1803
|
}
|
|
1802
1804
|
|
|
1803
1805
|
declare interface ITreeRowItem extends TRowType_2 {
|
|
@@ -1810,7 +1812,7 @@ declare interface ITreeRowItem extends TRowType_2 {
|
|
|
1810
1812
|
|
|
1811
1813
|
export declare interface ITreeTableProps extends ITreeProps {
|
|
1812
1814
|
table: {
|
|
1813
|
-
columnAlignment?: (Align.LEFT | Align.RIGHT)[];
|
|
1815
|
+
columnAlignment?: (Align.LEFT | Align.RIGHT | null)[];
|
|
1814
1816
|
columnWidths?: string[];
|
|
1815
1817
|
fixedWidth?: string;
|
|
1816
1818
|
headers?: TRowType_2[];
|
|
@@ -2210,7 +2212,7 @@ declare const TRANSLATION_FALLBACK: {
|
|
|
2210
2212
|
unknown: string;
|
|
2211
2213
|
};
|
|
2212
2214
|
|
|
2213
|
-
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;
|
|
2215
|
+
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;
|
|
2214
2216
|
|
|
2215
2217
|
export declare const TreeTable: ({ allowParentReassignment, autoOpenActiveItems, canDrop, draggable, icons, isInitialOpen, itemHasChild, onItemToggle, onListReorder, onChangeOpen, table, testId, treeRef, }: ITreeTableProps) => JSX_2.Element;
|
|
2216
2218
|
|
package/dist/index.js
CHANGED
|
@@ -1337,23 +1337,24 @@ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOn
|
|
|
1337
1337
|
})] });
|
|
1338
1338
|
};
|
|
1339
1339
|
var color_input_module_default = {
|
|
1340
|
-
colorInput: "
|
|
1341
|
-
trigger: "
|
|
1342
|
-
buttonColor: "
|
|
1343
|
-
options: "
|
|
1344
|
-
option: "
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1340
|
+
colorInput: "_colorInput_1j7vk_1",
|
|
1341
|
+
trigger: "_trigger_1j7vk_8",
|
|
1342
|
+
buttonColor: "_buttonColor_1j7vk_12",
|
|
1343
|
+
options: "_options_1j7vk_17",
|
|
1344
|
+
option: "_option_1j7vk_17",
|
|
1345
|
+
adjustColorsInDarkMode: "_adjustColorsInDarkMode_1j7vk_26"
|
|
1346
|
+
};
|
|
1347
|
+
const ColorInput = ({ columns: e = 9, disabled: t, options: n = [], small: r, value: i, onChange: a, adjustColorsInDarkMode: o = !1 }) => {
|
|
1348
|
+
var s;
|
|
1349
|
+
let [c, l] = useState(!1), u = (s = n.find((e) => e.value === i)) == null ? void 0 : s.label;
|
|
1349
1350
|
return /* @__PURE__ */ jsx("div", {
|
|
1350
|
-
className: color_input_module_default.colorInput,
|
|
1351
|
+
className: cx(color_input_module_default.colorInput, o ? color_input_module_default.adjustColorsInDarkMode : void 0),
|
|
1351
1352
|
children: /* @__PURE__ */ jsx(Popover, {
|
|
1352
1353
|
placement: "bottom-start",
|
|
1353
|
-
isOpen:
|
|
1354
|
-
onToggle:
|
|
1354
|
+
isOpen: c,
|
|
1355
|
+
onToggle: l,
|
|
1355
1356
|
content: /* @__PURE__ */ jsx("div", {
|
|
1356
|
-
className: color_input_module_default.options,
|
|
1357
|
+
className: cx(color_input_module_default.options, o ? color_input_module_default.adjustColorsInDarkMode : void 0),
|
|
1357
1358
|
style: { gridTemplateColumns: `repeat(${e}, auto)` },
|
|
1358
1359
|
children: n.map((e) => /* @__PURE__ */ jsx("div", {
|
|
1359
1360
|
className: color_input_module_default.option,
|
|
@@ -1367,7 +1368,7 @@ const ColorInput = ({ columns: e = 9, disabled: t, options: n = [], small: r, va
|
|
|
1367
1368
|
style: { backgroundColor: e.value }
|
|
1368
1369
|
}),
|
|
1369
1370
|
onClick: () => {
|
|
1370
|
-
a == null || a(e.value),
|
|
1371
|
+
a == null || a(e.value), l(!1);
|
|
1371
1372
|
}
|
|
1372
1373
|
}, e.value)
|
|
1373
1374
|
}))
|
|
@@ -1375,9 +1376,9 @@ const ColorInput = ({ columns: e = 9, disabled: t, options: n = [], small: r, va
|
|
|
1375
1376
|
children: /* @__PURE__ */ jsx(Button, {
|
|
1376
1377
|
disabled: t,
|
|
1377
1378
|
small: r,
|
|
1378
|
-
active:
|
|
1379
|
+
active: c,
|
|
1379
1380
|
width: r ? "var(--size-sm)" : "var(--size)",
|
|
1380
|
-
tooltip:
|
|
1381
|
+
tooltip: u,
|
|
1381
1382
|
label: /* @__PURE__ */ jsx("div", {
|
|
1382
1383
|
className: color_input_module_default.buttonColor,
|
|
1383
1384
|
style: { backgroundColor: i }
|
|
@@ -6679,32 +6680,32 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6679
6680
|
]
|
|
6680
6681
|
})
|
|
6681
6682
|
});
|
|
6682
|
-
}, TreePlaceholder = ({ depth: e }) => /* @__PURE__ */ jsx("div", {
|
|
6683
|
+
}, TreePlaceholder = ({ depth: e, indent: t = "var(--size-sm)" }) => /* @__PURE__ */ jsx("div", {
|
|
6683
6684
|
className: tree_module_default.placeholder,
|
|
6684
|
-
style: { left:
|
|
6685
|
-
}), 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: _ }) => {
|
|
6686
|
-
var
|
|
6687
|
-
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) => {
|
|
6688
6689
|
i && i(e);
|
|
6689
|
-
},
|
|
6690
|
+
}, S = (t) => {
|
|
6690
6691
|
let n = e.items.find((e) => e.id === t);
|
|
6691
|
-
return n && n.parent ? [n.parent, ...
|
|
6692
|
+
return n && n.parent ? [n.parent, ...S(n.parent)] : [];
|
|
6692
6693
|
};
|
|
6693
6694
|
useEffect(() => {
|
|
6694
6695
|
if (s) {
|
|
6695
6696
|
let n = e.items.find((e) => e.active);
|
|
6696
6697
|
if (n) {
|
|
6697
6698
|
var t;
|
|
6698
|
-
let e =
|
|
6699
|
-
(t =
|
|
6699
|
+
let e = S(n.id);
|
|
6700
|
+
(t = b.current) == null || t.open(e);
|
|
6700
6701
|
}
|
|
6701
6702
|
}
|
|
6702
6703
|
}, [s, e.items]);
|
|
6703
|
-
let
|
|
6704
|
+
let C = (e, t) => {
|
|
6704
6705
|
var n;
|
|
6705
6706
|
return (n = e == null ? void 0 : e.findIndex((e) => (e == null ? void 0 : e.id) === t)) == null ? -1 : n;
|
|
6706
|
-
},
|
|
6707
|
-
let n =
|
|
6707
|
+
}, w = (e, t) => {
|
|
6708
|
+
let n = C(t, e == null ? void 0 : e.parent);
|
|
6708
6709
|
if (n >= 0) {
|
|
6709
6710
|
let r = t == null ? void 0 : t.find((e) => {
|
|
6710
6711
|
var r;
|
|
@@ -6712,20 +6713,20 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6712
6713
|
});
|
|
6713
6714
|
e.parent = r ? r.id : 0;
|
|
6714
6715
|
}
|
|
6715
|
-
},
|
|
6716
|
+
}, T = (e, t) => {
|
|
6716
6717
|
var n;
|
|
6717
6718
|
return (n = t == null ? void 0 : t.filter((t) => (t == null ? void 0 : t.id) !== (e == null ? void 0 : e.id))) == null ? [] : n;
|
|
6718
|
-
},
|
|
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 }) => ({
|
|
6719
6720
|
id: e,
|
|
6720
6721
|
parent: t,
|
|
6721
6722
|
droppable: n,
|
|
6722
6723
|
...r
|
|
6723
|
-
})),
|
|
6724
|
+
})), O = (e, t) => {
|
|
6724
6725
|
let { dragSource: n, dropTarget: i } = t, a = [...e];
|
|
6725
6726
|
if (!r) return;
|
|
6726
|
-
let o =
|
|
6727
|
-
(n == null ? void 0 : n.parent) === (i == null ? void 0 : i.id) && o === 0 && m && (
|
|
6728
|
-
},
|
|
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 }) => ({
|
|
6729
6730
|
id: e,
|
|
6730
6731
|
text: r,
|
|
6731
6732
|
droppable: t,
|
|
@@ -6749,8 +6750,8 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6749
6750
|
options: getBackendOptions(),
|
|
6750
6751
|
context: window,
|
|
6751
6752
|
children: /* @__PURE__ */ jsx(Tree$1, {
|
|
6752
|
-
ref:
|
|
6753
|
-
tree:
|
|
6753
|
+
ref: b,
|
|
6754
|
+
tree: k,
|
|
6754
6755
|
sort: !1,
|
|
6755
6756
|
insertDroppableFirst: !1,
|
|
6756
6757
|
canDrag: () => n,
|
|
@@ -6780,10 +6781,13 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6780
6781
|
onDrop: (s = e.data) == null ? void 0 : s.onDrop
|
|
6781
6782
|
});
|
|
6782
6783
|
},
|
|
6783
|
-
onDrop:
|
|
6784
|
-
onChangeOpen:
|
|
6784
|
+
onDrop: O,
|
|
6785
|
+
onChangeOpen: x,
|
|
6785
6786
|
dropTargetOffset: 10,
|
|
6786
|
-
placeholderRender: (e, { depth: t }) => /* @__PURE__ */ jsx(TreePlaceholder, {
|
|
6787
|
+
placeholderRender: (e, { depth: t }) => /* @__PURE__ */ jsx(TreePlaceholder, {
|
|
6788
|
+
depth: t,
|
|
6789
|
+
indent: v
|
|
6790
|
+
}),
|
|
6787
6791
|
placeholderComponent: "div",
|
|
6788
6792
|
listComponent: "div",
|
|
6789
6793
|
listItemComponent: "div",
|
|
@@ -6800,17 +6804,19 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
|
|
|
6800
6804
|
});
|
|
6801
6805
|
};
|
|
6802
6806
|
var tree_table_module_default = {
|
|
6803
|
-
treeTable: "
|
|
6804
|
-
treeTableHeader: "
|
|
6805
|
-
folderCell: "
|
|
6806
|
-
dragCell: "
|
|
6807
|
-
drag: "
|
|
6808
|
-
folder: "
|
|
6809
|
-
|
|
6810
|
-
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"
|
|
6811
6814
|
};
|
|
6812
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 }) => {
|
|
6813
|
-
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
|
+
};
|
|
6814
6820
|
return /* @__PURE__ */ jsx("table", {
|
|
6815
6821
|
className: table_module_default.table,
|
|
6816
6822
|
"data-testid": b,
|
|
@@ -6819,7 +6825,8 @@ const TreeTableRow = ({ columnAlignment: e, columnWidths: t, depth: n, draggable
|
|
|
6819
6825
|
onDragOver: d,
|
|
6820
6826
|
onDragLeave: f,
|
|
6821
6827
|
children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsxs("tr", {
|
|
6822
|
-
|
|
6828
|
+
onClick: C,
|
|
6829
|
+
className: cx(tree_table_module_default.treeTableRow, S ? tree_table_module_default.active : void 0),
|
|
6823
6830
|
children: [
|
|
6824
6831
|
r && /* @__PURE__ */ jsx("td", {
|
|
6825
6832
|
className: tree_table_module_default.dragCell,
|
|
@@ -6830,14 +6837,10 @@ const TreeTableRow = ({ columnAlignment: e, columnWidths: t, depth: n, draggable
|
|
|
6830
6837
|
children: /* @__PURE__ */ jsx(Icon, { icon: IconType.DRAG })
|
|
6831
6838
|
})
|
|
6832
6839
|
}),
|
|
6833
|
-
/* @__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", {
|
|
6834
6842
|
className: tree_table_module_default.folderCell,
|
|
6835
|
-
|
|
6836
|
-
width: S,
|
|
6837
|
-
minWidth: S,
|
|
6838
|
-
maxWidth: S
|
|
6839
|
-
},
|
|
6840
|
-
children: (_ || a) && /* @__PURE__ */ jsx("div", {
|
|
6843
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
6841
6844
|
className: tree_table_module_default.folder,
|
|
6842
6845
|
onClick: () => m(v),
|
|
6843
6846
|
onMouseDown: (e) => e.stopPropagation(),
|
|
@@ -6851,15 +6854,12 @@ const TreeTableRow = ({ columnAlignment: e, columnWidths: t, depth: n, draggable
|
|
|
6851
6854
|
})
|
|
6852
6855
|
})
|
|
6853
6856
|
}),
|
|
6854
|
-
y.map((
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
columnAlignment: e ? e[r] : null
|
|
6861
|
-
}, r);
|
|
6862
|
-
}),
|
|
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)),
|
|
6863
6863
|
o && /* @__PURE__ */ jsx(Cell, {
|
|
6864
6864
|
isHeader: !1,
|
|
6865
6865
|
cell: {
|
|
@@ -6874,7 +6874,6 @@ const TreeTableRow = ({ columnAlignment: e, columnWidths: t, depth: n, draggable
|
|
|
6874
6874
|
className: cx(table_module_default.table, tree_table_module_default.treeTableHeader),
|
|
6875
6875
|
children: /* @__PURE__ */ jsx("thead", { children: i.map((i, a) => /* @__PURE__ */ jsxs("tr", { children: [
|
|
6876
6876
|
n && /* @__PURE__ */ jsx("th", { className: tree_table_module_default.dragCell }),
|
|
6877
|
-
/* @__PURE__ */ jsx("th", { className: tree_table_module_default.folderCell }),
|
|
6878
6877
|
i.cells.map((n, r) => /* @__PURE__ */ jsx(Cell, {
|
|
6879
6878
|
isHeader: !0,
|
|
6880
6879
|
cell: n,
|
|
@@ -6917,6 +6916,7 @@ const TreeTableRow = ({ columnAlignment: e, columnWidths: t, depth: n, draggable
|
|
|
6917
6916
|
onChangeOpen: l,
|
|
6918
6917
|
onItemToggle: s,
|
|
6919
6918
|
onListReorder: c,
|
|
6919
|
+
placeholderIndent: "var(--size)",
|
|
6920
6920
|
render: (e, { depth: t, draggable: n, handleRef: r, hasChild: a, isOpen: o, onToggle: s }) => /* @__PURE__ */ jsx(TreeTableRow, {
|
|
6921
6921
|
node: e,
|
|
6922
6922
|
columnAlignment: p,
|
package/package.json
CHANGED