@azrico/reactgrid 1.3.41 → 1.3.42
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.
|
@@ -6,10 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.fix_parent_child_relations = fix_parent_child_relations;
|
|
7
7
|
exports.func_selection = void 0;
|
|
8
8
|
function get_parentId(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.parent) !== null && _ref !== void 0 ? _ref : obj.parentid;
|
|
10
11
|
}
|
|
11
12
|
function get_selfId(obj) {
|
|
12
|
-
|
|
13
|
+
var _obj$__table_id;
|
|
14
|
+
return (_obj$__table_id = obj.__table_id) !== null && _obj$__table_id !== void 0 ? _obj$__table_id : obj._id;
|
|
13
15
|
}
|
|
14
16
|
//given an array of rows, fixes parent,child relations
|
|
15
17
|
function fix_parent_child_relations(rows) {
|
package/package.json
CHANGED
package/src/func/func_child.ts
CHANGED
|
@@ -2,10 +2,10 @@ 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
4
|
function get_parentId(obj) {
|
|
5
|
-
return obj.__parent__table_id
|
|
5
|
+
return obj.__parent__table_id ?? obj.parent ?? obj.parentid;
|
|
6
6
|
}
|
|
7
7
|
function get_selfId(obj) {
|
|
8
|
-
return obj.__table_id;
|
|
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[] {
|