@azrico/reactgrid 1.3.48 → 1.3.50
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/src/func/func_child.js +7 -7
- package/dist/src/themes/grid.css +15 -3
- package/package.json +1 -1
- package/src/func/func_child.ts +6 -6
- package/src/themes/grid.css +15 -3
|
@@ -5,24 +5,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.fix_parent_child_relations = fix_parent_child_relations;
|
|
7
7
|
exports.func_selection = void 0;
|
|
8
|
-
function
|
|
8
|
+
function getParentId(obj) {
|
|
9
9
|
var _ref, _obj$__parent__table_;
|
|
10
|
-
return (_ref = (_obj$__parent__table_ = obj.__parent__table_id) !== null && _obj$__parent__table_ !== void 0 ? _obj$__parent__table_ : obj.
|
|
10
|
+
return (_ref = (_obj$__parent__table_ = obj.__parent__table_id) !== null && _obj$__parent__table_ !== void 0 ? _obj$__parent__table_ : obj.parentid) !== null && _ref !== void 0 ? _ref : obj.parent;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function getSelfId(obj) {
|
|
13
13
|
var _obj$__table_id;
|
|
14
14
|
return (_obj$__table_id = obj.__table_id) !== null && _obj$__table_id !== void 0 ? _obj$__table_id : obj._id;
|
|
15
15
|
}
|
|
16
16
|
//given an array of rows, fixes parent,child relations
|
|
17
17
|
function fix_parent_child_relations(rows) {
|
|
18
18
|
if (!Array.isArray(rows)) rows = [];
|
|
19
|
-
const anyparentid = rows.find(r =>
|
|
20
|
-
const anyselfid = rows.find(r =>
|
|
19
|
+
const anyparentid = rows.find(r => getParentId(r));
|
|
20
|
+
const anyselfid = rows.find(r => getSelfId(r));
|
|
21
21
|
if (!anyparentid || !anyselfid) return rows;
|
|
22
22
|
const converted_rows = rows.filter(r => r != null).map(r => {
|
|
23
23
|
return {
|
|
24
|
-
parent:
|
|
25
|
-
self:
|
|
24
|
+
parent: getParentId(r),
|
|
25
|
+
self: getSelfId(r),
|
|
26
26
|
data: r
|
|
27
27
|
};
|
|
28
28
|
});
|
package/dist/src/themes/grid.css
CHANGED
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
--grid-bg-hover: oklch(var(--b2, #313943));
|
|
9
9
|
--grid-fg-hover: #ececec;
|
|
10
10
|
}
|
|
11
|
-
.InovuaReactDataGrid
|
|
11
|
+
.InovuaReactDataGrid {
|
|
12
12
|
--grid-bg: oklch(var(--b1, #fff));
|
|
13
13
|
--grid-fg: oklch(var(--bc, #1e1e1e));
|
|
14
14
|
--grid-bg-hover: oklch(var(--b2, #ebedf7));
|
|
15
|
+
--grid-bg-hover2: oklch(var(--b3, #ebedf7));
|
|
15
16
|
--grid-fg-hover: oklch(var(--bc, #1e1e1e));
|
|
16
17
|
}
|
|
17
18
|
.InovuaReactDataGrid__row {
|
|
@@ -42,8 +43,19 @@
|
|
|
42
43
|
.InovuaReactDataGrid__row--empty
|
|
43
44
|
)
|
|
44
45
|
.InovuaReactDataGrid__row-hover-target:hover {
|
|
45
|
-
background: var(--grid-bg-hover)!important;
|
|
46
|
-
color: var(--grid-fg-hover)!important;
|
|
46
|
+
background: var(--grid-bg-hover) !important;
|
|
47
|
+
color: var(--grid-fg-hover) !important;
|
|
48
|
+
}
|
|
49
|
+
.InovuaReactDataGrid--theme-default-light.InovuaReactDataGrid--show-hover-rows
|
|
50
|
+
.InovuaReactDataGrid__row--no-zebra:not(.InovuaReactDataGrid__row--scrolling):not(
|
|
51
|
+
.InovuaReactDataGrid__row--empty
|
|
52
|
+
)
|
|
53
|
+
.InovuaReactDataGrid__row-hover-target:hover
|
|
54
|
+
.InovuaReactDataGrid__row-index-column,
|
|
55
|
+
.InovuaReactDataGrid--theme-default-light.InovuaReactDataGrid--show-hover-rows
|
|
56
|
+
.InovuaReactDataGrid__row-hover-target:hover
|
|
57
|
+
.InovuaReactDataGrid__row-index-column {
|
|
58
|
+
background: var(--grid-bg-hover2) !important;
|
|
47
59
|
}
|
|
48
60
|
/* -------------------------------------------------------------------------- */
|
|
49
61
|
.inovua-react-toolkit-text-input {
|
package/package.json
CHANGED
package/src/func/func_child.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
type mrow = { __parent__table_id: any; __table_id: any; __children?: any[] };
|
|
2
2
|
type converted_row = { parent: any; self: any; data: mrow };
|
|
3
3
|
|
|
4
|
-
function
|
|
5
|
-
return obj.__parent__table_id ?? obj.
|
|
4
|
+
function getParentId(obj) {
|
|
5
|
+
return obj.__parent__table_id ?? obj.parentid ?? obj.parent;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function getSelfId(obj) {
|
|
8
8
|
return obj.__table_id ?? obj._id;
|
|
9
9
|
}
|
|
10
10
|
//given an array of rows, fixes parent,child relations
|
|
11
11
|
export function fix_parent_child_relations<T extends mrow>(rows: T[]): T[] {
|
|
12
12
|
if (!Array.isArray(rows)) rows = [];
|
|
13
|
-
const anyparentid = rows.find((r) =>
|
|
14
|
-
const anyselfid = rows.find((r) =>
|
|
13
|
+
const anyparentid = rows.find((r) => getParentId(r));
|
|
14
|
+
const anyselfid = rows.find((r) => getSelfId(r));
|
|
15
15
|
if (!anyparentid || !anyselfid) return rows;
|
|
16
16
|
|
|
17
17
|
const converted_rows: converted_row[] = rows
|
|
18
18
|
.filter((r) => r != null)
|
|
19
19
|
.map((r) => {
|
|
20
|
-
return { parent:
|
|
20
|
+
return { parent: getParentId(r), self: getSelfId(r), data: r };
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
const top_level_rows: converted_row[] = converted_rows.filter((r) => !r.parent);
|
package/src/themes/grid.css
CHANGED
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
--grid-bg-hover: oklch(var(--b2, #313943));
|
|
9
9
|
--grid-fg-hover: #ececec;
|
|
10
10
|
}
|
|
11
|
-
.InovuaReactDataGrid
|
|
11
|
+
.InovuaReactDataGrid {
|
|
12
12
|
--grid-bg: oklch(var(--b1, #fff));
|
|
13
13
|
--grid-fg: oklch(var(--bc, #1e1e1e));
|
|
14
14
|
--grid-bg-hover: oklch(var(--b2, #ebedf7));
|
|
15
|
+
--grid-bg-hover2: oklch(var(--b3, #ebedf7));
|
|
15
16
|
--grid-fg-hover: oklch(var(--bc, #1e1e1e));
|
|
16
17
|
}
|
|
17
18
|
.InovuaReactDataGrid__row {
|
|
@@ -42,8 +43,19 @@
|
|
|
42
43
|
.InovuaReactDataGrid__row--empty
|
|
43
44
|
)
|
|
44
45
|
.InovuaReactDataGrid__row-hover-target:hover {
|
|
45
|
-
background: var(--grid-bg-hover)!important;
|
|
46
|
-
color: var(--grid-fg-hover)!important;
|
|
46
|
+
background: var(--grid-bg-hover) !important;
|
|
47
|
+
color: var(--grid-fg-hover) !important;
|
|
48
|
+
}
|
|
49
|
+
.InovuaReactDataGrid--theme-default-light.InovuaReactDataGrid--show-hover-rows
|
|
50
|
+
.InovuaReactDataGrid__row--no-zebra:not(.InovuaReactDataGrid__row--scrolling):not(
|
|
51
|
+
.InovuaReactDataGrid__row--empty
|
|
52
|
+
)
|
|
53
|
+
.InovuaReactDataGrid__row-hover-target:hover
|
|
54
|
+
.InovuaReactDataGrid__row-index-column,
|
|
55
|
+
.InovuaReactDataGrid--theme-default-light.InovuaReactDataGrid--show-hover-rows
|
|
56
|
+
.InovuaReactDataGrid__row-hover-target:hover
|
|
57
|
+
.InovuaReactDataGrid__row-index-column {
|
|
58
|
+
background: var(--grid-bg-hover2) !important;
|
|
47
59
|
}
|
|
48
60
|
/* -------------------------------------------------------------------------- */
|
|
49
61
|
.inovua-react-toolkit-text-input {
|