@zeedhi/common 1.57.0 → 1.57.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/zd-common.esm.js +74 -23
- package/dist/zd-common.umd.js +74 -23
- package/package.json +2 -2
- package/types/components/zd-grid/grid.d.ts +1 -1
- package/types/components/zd-iterable/interfaces.d.ts +1 -0
- package/types/components/zd-iterable/iterable-controller.d.ts +1 -1
- package/types/components/zd-iterable/iterable.d.ts +5 -0
- package/types/components/zd-tree-grid/interfaces.d.ts +1 -0
- package/types/components/zd-tree-grid/tree-grid.d.ts +15 -0
package/dist/zd-common.esm.js
CHANGED
|
@@ -4427,7 +4427,7 @@ class Number$1 extends TextInput {
|
|
|
4427
4427
|
return this.localValue;
|
|
4428
4428
|
}
|
|
4429
4429
|
set value(value) {
|
|
4430
|
-
if (typeof value === 'string' && window.Number.isNaN(parseFloat(value)))
|
|
4430
|
+
if (this.isFocused || (typeof value === 'string' && window.Number.isNaN(parseFloat(value))))
|
|
4431
4431
|
return;
|
|
4432
4432
|
this.localValue = value;
|
|
4433
4433
|
if (this.maskValid && this.localValue !== undefined && this.localValue !== null) {
|
|
@@ -6107,11 +6107,11 @@ class Frame extends ComponentRender {
|
|
|
6107
6107
|
});
|
|
6108
6108
|
}
|
|
6109
6109
|
overrideNamedPropsFunc(metadata) {
|
|
6110
|
-
let
|
|
6110
|
+
let strMetadata = JSON.stringify(metadata);
|
|
6111
6111
|
Object.keys(this.overrideNamedProps).forEach((key) => {
|
|
6112
|
-
|
|
6112
|
+
strMetadata = strMetadata.replace(RegExp(`<<${key}>>`, 'g'), this.overrideNamedProps[key]);
|
|
6113
6113
|
});
|
|
6114
|
-
return JSON.parse(
|
|
6114
|
+
return JSON.parse(strMetadata);
|
|
6115
6115
|
}
|
|
6116
6116
|
reload() {
|
|
6117
6117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -6440,11 +6440,11 @@ class ColumnNotFoundError extends Error {
|
|
|
6440
6440
|
class IterableController {
|
|
6441
6441
|
constructor(iterable) {
|
|
6442
6442
|
this.searchInValue = undefined;
|
|
6443
|
-
this.
|
|
6443
|
+
this.iterable = iterable;
|
|
6444
6444
|
}
|
|
6445
6445
|
get searchIn() {
|
|
6446
|
-
return this.searchInValue || this.columns.reduce((result, column) => {
|
|
6447
|
-
if (column.type !== 'action' && column.isVisible)
|
|
6446
|
+
return this.searchInValue || this.iterable.columns.reduce((result, column) => {
|
|
6447
|
+
if (column.type !== 'action' && (!this.iterable.searchVisibleOnly || column.isVisible))
|
|
6448
6448
|
result.push(column.name);
|
|
6449
6449
|
return result;
|
|
6450
6450
|
}, []);
|
|
@@ -6464,7 +6464,7 @@ class Iterable extends ComponentRender {
|
|
|
6464
6464
|
* @param props Iterable properties
|
|
6465
6465
|
*/
|
|
6466
6466
|
constructor(props) {
|
|
6467
|
-
var _a;
|
|
6467
|
+
var _a, _b;
|
|
6468
6468
|
super(props);
|
|
6469
6469
|
/**
|
|
6470
6470
|
* Iterable columns
|
|
@@ -6488,10 +6488,12 @@ class Iterable extends ComponentRender {
|
|
|
6488
6488
|
* Dictionary of prop pointing to the condition (applied) return value
|
|
6489
6489
|
*/
|
|
6490
6490
|
this.actionsApplied = {};
|
|
6491
|
+
this.defaultSearchVisibleOnly = (_a = Config.iterableSearchVisibleOnly) !== null && _a !== void 0 ? _a : true;
|
|
6491
6492
|
this.columns = this.getColumns(props.columns || this.columns);
|
|
6492
6493
|
this.createController();
|
|
6493
|
-
this.datasource = DatasourceFactory.factory(Object.assign(Object.assign({}, props.datasource), { searchIn: ((
|
|
6494
|
+
this.datasource = DatasourceFactory.factory(Object.assign(Object.assign({}, props.datasource), { searchIn: ((_b = props.datasource) === null || _b === void 0 ? void 0 : _b.searchIn) || `{{IterableController_${this.name}.searchIn}}` }));
|
|
6494
6495
|
this.pageSizes = this.getInitValue('pageSizes', props.pageSizes, this.pageSizes);
|
|
6496
|
+
this.searchVisibleOnly = this.getInitValue('searchVisibleOnly', props.searchVisibleOnly, this.defaultSearchVisibleOnly);
|
|
6495
6497
|
this.virtualScroll = this.getInitValue('virtualScroll', props.virtualScroll, this.virtualScroll);
|
|
6496
6498
|
}
|
|
6497
6499
|
createController() {
|
|
@@ -6813,8 +6815,24 @@ class Grid extends Iterable {
|
|
|
6813
6815
|
*/
|
|
6814
6816
|
this.footerSlot = [
|
|
6815
6817
|
{ name: '<<NAME>>_iterablePagination', component: 'ZdIterablePagination' },
|
|
6816
|
-
{
|
|
6817
|
-
|
|
6818
|
+
{
|
|
6819
|
+
name: '<<NAME>>_iterableInfoDiv',
|
|
6820
|
+
component: 'ZdTag',
|
|
6821
|
+
cssClass: 'zd-grid-div-footer',
|
|
6822
|
+
tag: 'div',
|
|
6823
|
+
children: [
|
|
6824
|
+
{
|
|
6825
|
+
name: '<<NAME>>_iterablePageSize',
|
|
6826
|
+
component: 'ZdIterablePageSize',
|
|
6827
|
+
iterableComponentName: '<<NAME>>',
|
|
6828
|
+
},
|
|
6829
|
+
{
|
|
6830
|
+
name: '<<NAME>>_iterablePageInfo',
|
|
6831
|
+
component: 'ZdIterablePageInfo',
|
|
6832
|
+
iterableComponentName: '<<NAME>>',
|
|
6833
|
+
},
|
|
6834
|
+
],
|
|
6835
|
+
},
|
|
6818
6836
|
];
|
|
6819
6837
|
/**
|
|
6820
6838
|
* Toggle checkbox column
|
|
@@ -7104,10 +7122,9 @@ class Grid extends Iterable {
|
|
|
7104
7122
|
return newComponent;
|
|
7105
7123
|
}
|
|
7106
7124
|
changeDefaultSlotNames(slot) {
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
return slot;
|
|
7125
|
+
const strMetadata = JSON.stringify(slot);
|
|
7126
|
+
const newObj = strMetadata.replace(RegExp('<<NAME>>', 'g'), this.name);
|
|
7127
|
+
return JSON.parse(newObj);
|
|
7111
7128
|
}
|
|
7112
7129
|
callDisableSelection(row) {
|
|
7113
7130
|
return !!this.disableSelection && typeof this.disableSelection === 'function'
|
|
@@ -8314,7 +8331,7 @@ class Select extends TextInput {
|
|
|
8314
8331
|
return this.fieldValue;
|
|
8315
8332
|
}
|
|
8316
8333
|
set value(value) {
|
|
8317
|
-
if (this.initialized && this.
|
|
8334
|
+
if (this.initialized && this.fieldValue !== value) {
|
|
8318
8335
|
this.setValue(value);
|
|
8319
8336
|
}
|
|
8320
8337
|
}
|
|
@@ -12381,6 +12398,10 @@ class TreeGrid extends Grid {
|
|
|
12381
12398
|
* Components that will be rendered on footer slot
|
|
12382
12399
|
*/
|
|
12383
12400
|
this.footerSlot = [];
|
|
12401
|
+
/**
|
|
12402
|
+
* Even though all children are selected, the parent node is not
|
|
12403
|
+
*/
|
|
12404
|
+
this.flat = false;
|
|
12384
12405
|
this.navigationTreeKeyMapping = {
|
|
12385
12406
|
right: {
|
|
12386
12407
|
event: this.navigateToggle.bind(this, false),
|
|
@@ -12397,6 +12418,7 @@ class TreeGrid extends Grid {
|
|
|
12397
12418
|
this.lazyLoad = ((_a = props.datasource) === null || _a === void 0 ? void 0 : _a.lazyLoad) !== false;
|
|
12398
12419
|
this.parentField = this.getInitValue('parentField', props.parentField, this.parentField);
|
|
12399
12420
|
this.fetchOnDemand = this.getInitValue('fetchOnDemand', props.fetchOnDemand, this.fetchOnDemand);
|
|
12421
|
+
this.flat = this.getInitValue('flat', props.flat, this.flat);
|
|
12400
12422
|
this.treeDataStructure = new TreeDataStructure(this);
|
|
12401
12423
|
this.createAccessors();
|
|
12402
12424
|
}
|
|
@@ -12507,17 +12529,22 @@ class TreeGrid extends Grid {
|
|
|
12507
12529
|
}
|
|
12508
12530
|
}
|
|
12509
12531
|
}
|
|
12532
|
+
removeDuplicates(arr, key) {
|
|
12533
|
+
return [...new Map(arr.map((item) => [item[key], item])).values()];
|
|
12534
|
+
}
|
|
12510
12535
|
/**
|
|
12511
12536
|
* Select/deselect rows
|
|
12512
12537
|
* @param row selected row
|
|
12513
12538
|
* @param isSelected row is selected
|
|
12514
12539
|
*/
|
|
12515
12540
|
selectRow(row, isSelected) {
|
|
12516
|
-
const
|
|
12541
|
+
const childrenRows = !this.flat ? this.treeDataStructure.getChildren(row) : [];
|
|
12542
|
+
const rows = [row, ...childrenRows];
|
|
12517
12543
|
if (isSelected) {
|
|
12518
|
-
this.selectedRows =
|
|
12544
|
+
this.selectedRows = this.removeDuplicates(this.selectedRows.concat(rows), this.datasource.uniqueKey);
|
|
12519
12545
|
// check if all the children of the parent are selected.
|
|
12520
|
-
this.
|
|
12546
|
+
if (!this.flat)
|
|
12547
|
+
this.selectParents(row);
|
|
12521
12548
|
}
|
|
12522
12549
|
else {
|
|
12523
12550
|
rows.forEach((item) => {
|
|
@@ -12525,10 +12552,33 @@ class TreeGrid extends Grid {
|
|
|
12525
12552
|
if (index > -1)
|
|
12526
12553
|
this.selectedRows.splice(index, 1);
|
|
12527
12554
|
});
|
|
12528
|
-
this.
|
|
12555
|
+
if (!this.flat)
|
|
12556
|
+
this.unselectParents(row);
|
|
12529
12557
|
}
|
|
12530
12558
|
}
|
|
12531
|
-
|
|
12559
|
+
/**
|
|
12560
|
+
* Select children rows
|
|
12561
|
+
* @param row Row to unselect children
|
|
12562
|
+
*/
|
|
12563
|
+
selectChildren(row) {
|
|
12564
|
+
const childrenRows = this.treeDataStructure.getChildren(row);
|
|
12565
|
+
const rows = this.flat ? childrenRows : [row, ...childrenRows];
|
|
12566
|
+
this.selectedRows = this.removeDuplicates(this.selectedRows.concat(rows), this.datasource.uniqueKey);
|
|
12567
|
+
}
|
|
12568
|
+
/**
|
|
12569
|
+
* Unselect children rows
|
|
12570
|
+
* @param row Row to select children
|
|
12571
|
+
*/
|
|
12572
|
+
unselectChildren(row) {
|
|
12573
|
+
const childrenRows = this.treeDataStructure.getChildren(row);
|
|
12574
|
+
const rows = this.flat ? childrenRows : [row, ...childrenRows];
|
|
12575
|
+
rows.forEach((item) => {
|
|
12576
|
+
const index = this.treeDataStructure.findDataIndex(this.selectedRows, item[this.datasource.uniqueKey]);
|
|
12577
|
+
if (index > -1)
|
|
12578
|
+
this.selectedRows.splice(index, 1);
|
|
12579
|
+
});
|
|
12580
|
+
}
|
|
12581
|
+
selectParents(row) {
|
|
12532
12582
|
if (row[this.parentField]) {
|
|
12533
12583
|
const parentRow = this.treeDataStructure.getRowData(row).tree__parent;
|
|
12534
12584
|
const every = this.treeDataStructure.getChildren(parentRow).every((item) => {
|
|
@@ -12537,10 +12587,11 @@ class TreeGrid extends Grid {
|
|
|
12537
12587
|
return true;
|
|
12538
12588
|
return false;
|
|
12539
12589
|
});
|
|
12590
|
+
const rows = [];
|
|
12540
12591
|
if (every)
|
|
12541
12592
|
rows.push(parentRow);
|
|
12542
|
-
this.selectedRows =
|
|
12543
|
-
this.selectParents(
|
|
12593
|
+
this.selectedRows = this.removeDuplicates(this.selectedRows.concat(rows), this.datasource.uniqueKey);
|
|
12594
|
+
this.selectParents(parentRow);
|
|
12544
12595
|
}
|
|
12545
12596
|
}
|
|
12546
12597
|
unselectParents(row) {
|
package/dist/zd-common.umd.js
CHANGED
|
@@ -4434,7 +4434,7 @@
|
|
|
4434
4434
|
return this.localValue;
|
|
4435
4435
|
}
|
|
4436
4436
|
set value(value) {
|
|
4437
|
-
if (typeof value === 'string' && window.Number.isNaN(parseFloat(value)))
|
|
4437
|
+
if (this.isFocused || (typeof value === 'string' && window.Number.isNaN(parseFloat(value))))
|
|
4438
4438
|
return;
|
|
4439
4439
|
this.localValue = value;
|
|
4440
4440
|
if (this.maskValid && this.localValue !== undefined && this.localValue !== null) {
|
|
@@ -6114,11 +6114,11 @@
|
|
|
6114
6114
|
});
|
|
6115
6115
|
}
|
|
6116
6116
|
overrideNamedPropsFunc(metadata) {
|
|
6117
|
-
let
|
|
6117
|
+
let strMetadata = JSON.stringify(metadata);
|
|
6118
6118
|
Object.keys(this.overrideNamedProps).forEach((key) => {
|
|
6119
|
-
|
|
6119
|
+
strMetadata = strMetadata.replace(RegExp(`<<${key}>>`, 'g'), this.overrideNamedProps[key]);
|
|
6120
6120
|
});
|
|
6121
|
-
return JSON.parse(
|
|
6121
|
+
return JSON.parse(strMetadata);
|
|
6122
6122
|
}
|
|
6123
6123
|
reload() {
|
|
6124
6124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -6447,11 +6447,11 @@
|
|
|
6447
6447
|
class IterableController {
|
|
6448
6448
|
constructor(iterable) {
|
|
6449
6449
|
this.searchInValue = undefined;
|
|
6450
|
-
this.
|
|
6450
|
+
this.iterable = iterable;
|
|
6451
6451
|
}
|
|
6452
6452
|
get searchIn() {
|
|
6453
|
-
return this.searchInValue || this.columns.reduce((result, column) => {
|
|
6454
|
-
if (column.type !== 'action' && column.isVisible)
|
|
6453
|
+
return this.searchInValue || this.iterable.columns.reduce((result, column) => {
|
|
6454
|
+
if (column.type !== 'action' && (!this.iterable.searchVisibleOnly || column.isVisible))
|
|
6455
6455
|
result.push(column.name);
|
|
6456
6456
|
return result;
|
|
6457
6457
|
}, []);
|
|
@@ -6471,7 +6471,7 @@
|
|
|
6471
6471
|
* @param props Iterable properties
|
|
6472
6472
|
*/
|
|
6473
6473
|
constructor(props) {
|
|
6474
|
-
var _a;
|
|
6474
|
+
var _a, _b;
|
|
6475
6475
|
super(props);
|
|
6476
6476
|
/**
|
|
6477
6477
|
* Iterable columns
|
|
@@ -6495,10 +6495,12 @@
|
|
|
6495
6495
|
* Dictionary of prop pointing to the condition (applied) return value
|
|
6496
6496
|
*/
|
|
6497
6497
|
this.actionsApplied = {};
|
|
6498
|
+
this.defaultSearchVisibleOnly = (_a = core.Config.iterableSearchVisibleOnly) !== null && _a !== void 0 ? _a : true;
|
|
6498
6499
|
this.columns = this.getColumns(props.columns || this.columns);
|
|
6499
6500
|
this.createController();
|
|
6500
|
-
this.datasource = core.DatasourceFactory.factory(Object.assign(Object.assign({}, props.datasource), { searchIn: ((
|
|
6501
|
+
this.datasource = core.DatasourceFactory.factory(Object.assign(Object.assign({}, props.datasource), { searchIn: ((_b = props.datasource) === null || _b === void 0 ? void 0 : _b.searchIn) || `{{IterableController_${this.name}.searchIn}}` }));
|
|
6501
6502
|
this.pageSizes = this.getInitValue('pageSizes', props.pageSizes, this.pageSizes);
|
|
6503
|
+
this.searchVisibleOnly = this.getInitValue('searchVisibleOnly', props.searchVisibleOnly, this.defaultSearchVisibleOnly);
|
|
6502
6504
|
this.virtualScroll = this.getInitValue('virtualScroll', props.virtualScroll, this.virtualScroll);
|
|
6503
6505
|
}
|
|
6504
6506
|
createController() {
|
|
@@ -6820,8 +6822,24 @@
|
|
|
6820
6822
|
*/
|
|
6821
6823
|
this.footerSlot = [
|
|
6822
6824
|
{ name: '<<NAME>>_iterablePagination', component: 'ZdIterablePagination' },
|
|
6823
|
-
{
|
|
6824
|
-
|
|
6825
|
+
{
|
|
6826
|
+
name: '<<NAME>>_iterableInfoDiv',
|
|
6827
|
+
component: 'ZdTag',
|
|
6828
|
+
cssClass: 'zd-grid-div-footer',
|
|
6829
|
+
tag: 'div',
|
|
6830
|
+
children: [
|
|
6831
|
+
{
|
|
6832
|
+
name: '<<NAME>>_iterablePageSize',
|
|
6833
|
+
component: 'ZdIterablePageSize',
|
|
6834
|
+
iterableComponentName: '<<NAME>>',
|
|
6835
|
+
},
|
|
6836
|
+
{
|
|
6837
|
+
name: '<<NAME>>_iterablePageInfo',
|
|
6838
|
+
component: 'ZdIterablePageInfo',
|
|
6839
|
+
iterableComponentName: '<<NAME>>',
|
|
6840
|
+
},
|
|
6841
|
+
],
|
|
6842
|
+
},
|
|
6825
6843
|
];
|
|
6826
6844
|
/**
|
|
6827
6845
|
* Toggle checkbox column
|
|
@@ -7111,10 +7129,9 @@
|
|
|
7111
7129
|
return newComponent;
|
|
7112
7130
|
}
|
|
7113
7131
|
changeDefaultSlotNames(slot) {
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
return slot;
|
|
7132
|
+
const strMetadata = JSON.stringify(slot);
|
|
7133
|
+
const newObj = strMetadata.replace(RegExp('<<NAME>>', 'g'), this.name);
|
|
7134
|
+
return JSON.parse(newObj);
|
|
7118
7135
|
}
|
|
7119
7136
|
callDisableSelection(row) {
|
|
7120
7137
|
return !!this.disableSelection && typeof this.disableSelection === 'function'
|
|
@@ -8321,7 +8338,7 @@
|
|
|
8321
8338
|
return this.fieldValue;
|
|
8322
8339
|
}
|
|
8323
8340
|
set value(value) {
|
|
8324
|
-
if (this.initialized && this.
|
|
8341
|
+
if (this.initialized && this.fieldValue !== value) {
|
|
8325
8342
|
this.setValue(value);
|
|
8326
8343
|
}
|
|
8327
8344
|
}
|
|
@@ -12388,6 +12405,10 @@
|
|
|
12388
12405
|
* Components that will be rendered on footer slot
|
|
12389
12406
|
*/
|
|
12390
12407
|
this.footerSlot = [];
|
|
12408
|
+
/**
|
|
12409
|
+
* Even though all children are selected, the parent node is not
|
|
12410
|
+
*/
|
|
12411
|
+
this.flat = false;
|
|
12391
12412
|
this.navigationTreeKeyMapping = {
|
|
12392
12413
|
right: {
|
|
12393
12414
|
event: this.navigateToggle.bind(this, false),
|
|
@@ -12404,6 +12425,7 @@
|
|
|
12404
12425
|
this.lazyLoad = ((_a = props.datasource) === null || _a === void 0 ? void 0 : _a.lazyLoad) !== false;
|
|
12405
12426
|
this.parentField = this.getInitValue('parentField', props.parentField, this.parentField);
|
|
12406
12427
|
this.fetchOnDemand = this.getInitValue('fetchOnDemand', props.fetchOnDemand, this.fetchOnDemand);
|
|
12428
|
+
this.flat = this.getInitValue('flat', props.flat, this.flat);
|
|
12407
12429
|
this.treeDataStructure = new TreeDataStructure(this);
|
|
12408
12430
|
this.createAccessors();
|
|
12409
12431
|
}
|
|
@@ -12514,17 +12536,22 @@
|
|
|
12514
12536
|
}
|
|
12515
12537
|
}
|
|
12516
12538
|
}
|
|
12539
|
+
removeDuplicates(arr, key) {
|
|
12540
|
+
return [...new Map(arr.map((item) => [item[key], item])).values()];
|
|
12541
|
+
}
|
|
12517
12542
|
/**
|
|
12518
12543
|
* Select/deselect rows
|
|
12519
12544
|
* @param row selected row
|
|
12520
12545
|
* @param isSelected row is selected
|
|
12521
12546
|
*/
|
|
12522
12547
|
selectRow(row, isSelected) {
|
|
12523
|
-
const
|
|
12548
|
+
const childrenRows = !this.flat ? this.treeDataStructure.getChildren(row) : [];
|
|
12549
|
+
const rows = [row, ...childrenRows];
|
|
12524
12550
|
if (isSelected) {
|
|
12525
|
-
this.selectedRows =
|
|
12551
|
+
this.selectedRows = this.removeDuplicates(this.selectedRows.concat(rows), this.datasource.uniqueKey);
|
|
12526
12552
|
// check if all the children of the parent are selected.
|
|
12527
|
-
this.
|
|
12553
|
+
if (!this.flat)
|
|
12554
|
+
this.selectParents(row);
|
|
12528
12555
|
}
|
|
12529
12556
|
else {
|
|
12530
12557
|
rows.forEach((item) => {
|
|
@@ -12532,10 +12559,33 @@
|
|
|
12532
12559
|
if (index > -1)
|
|
12533
12560
|
this.selectedRows.splice(index, 1);
|
|
12534
12561
|
});
|
|
12535
|
-
this.
|
|
12562
|
+
if (!this.flat)
|
|
12563
|
+
this.unselectParents(row);
|
|
12536
12564
|
}
|
|
12537
12565
|
}
|
|
12538
|
-
|
|
12566
|
+
/**
|
|
12567
|
+
* Select children rows
|
|
12568
|
+
* @param row Row to unselect children
|
|
12569
|
+
*/
|
|
12570
|
+
selectChildren(row) {
|
|
12571
|
+
const childrenRows = this.treeDataStructure.getChildren(row);
|
|
12572
|
+
const rows = this.flat ? childrenRows : [row, ...childrenRows];
|
|
12573
|
+
this.selectedRows = this.removeDuplicates(this.selectedRows.concat(rows), this.datasource.uniqueKey);
|
|
12574
|
+
}
|
|
12575
|
+
/**
|
|
12576
|
+
* Unselect children rows
|
|
12577
|
+
* @param row Row to select children
|
|
12578
|
+
*/
|
|
12579
|
+
unselectChildren(row) {
|
|
12580
|
+
const childrenRows = this.treeDataStructure.getChildren(row);
|
|
12581
|
+
const rows = this.flat ? childrenRows : [row, ...childrenRows];
|
|
12582
|
+
rows.forEach((item) => {
|
|
12583
|
+
const index = this.treeDataStructure.findDataIndex(this.selectedRows, item[this.datasource.uniqueKey]);
|
|
12584
|
+
if (index > -1)
|
|
12585
|
+
this.selectedRows.splice(index, 1);
|
|
12586
|
+
});
|
|
12587
|
+
}
|
|
12588
|
+
selectParents(row) {
|
|
12539
12589
|
if (row[this.parentField]) {
|
|
12540
12590
|
const parentRow = this.treeDataStructure.getRowData(row).tree__parent;
|
|
12541
12591
|
const every = this.treeDataStructure.getChildren(parentRow).every((item) => {
|
|
@@ -12544,10 +12594,11 @@
|
|
|
12544
12594
|
return true;
|
|
12545
12595
|
return false;
|
|
12546
12596
|
});
|
|
12597
|
+
const rows = [];
|
|
12547
12598
|
if (every)
|
|
12548
12599
|
rows.push(parentRow);
|
|
12549
|
-
this.selectedRows =
|
|
12550
|
-
this.selectParents(
|
|
12600
|
+
this.selectedRows = this.removeDuplicates(this.selectedRows.concat(rows), this.datasource.uniqueKey);
|
|
12601
|
+
this.selectParents(parentRow);
|
|
12551
12602
|
}
|
|
12552
12603
|
}
|
|
12553
12604
|
unselectParents(row) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/common",
|
|
3
|
-
"version": "1.57.
|
|
3
|
+
"version": "1.57.1",
|
|
4
4
|
"description": "Zeedhi Common",
|
|
5
5
|
"author": "Zeedhi <zeedhi@teknisa.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"lodash.times": "^4.3.2",
|
|
38
38
|
"mockdate": "^3.0.2"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "c77cf358d4514a7230f8c85515eba42ef015cf55"
|
|
41
41
|
}
|
|
@@ -175,6 +175,6 @@ export declare class Grid extends Iterable implements IGrid {
|
|
|
175
175
|
protected navigatePageDown(): void;
|
|
176
176
|
deleteRows(): Promise<any[]>;
|
|
177
177
|
getActionComponent(actionComponent: IComponent, column: GridColumn, row: IDictionary, parentPath?: string): IComponent;
|
|
178
|
-
protected changeDefaultSlotNames(slot: IComponentRender[]):
|
|
178
|
+
protected changeDefaultSlotNames(slot: IComponentRender[]): any;
|
|
179
179
|
callDisableSelection(row: IDictionary<any>): boolean;
|
|
180
180
|
}
|
|
@@ -30,6 +30,7 @@ export interface IIterable extends IComponentRender {
|
|
|
30
30
|
datasource?: IDatasource;
|
|
31
31
|
pageSizes?: string[];
|
|
32
32
|
virtualScroll?: boolean;
|
|
33
|
+
searchVisibleOnly?: boolean;
|
|
33
34
|
}
|
|
34
35
|
export interface IIterablePageComponent extends IComponentRender {
|
|
35
36
|
iterableComponentName?: string;
|
|
@@ -36,6 +36,11 @@ export declare class Iterable extends ComponentRender implements IIterable {
|
|
|
36
36
|
* Dictionary of prop pointing to the condition (applied) return value
|
|
37
37
|
*/
|
|
38
38
|
actionsApplied: IDictionary<IDictionary<IDictionary<any>>>;
|
|
39
|
+
/**
|
|
40
|
+
* Defines if searchIn should consider only visible columns or not
|
|
41
|
+
*/
|
|
42
|
+
searchVisibleOnly: boolean;
|
|
43
|
+
defaultSearchVisibleOnly: boolean;
|
|
39
44
|
/**
|
|
40
45
|
* Creates a new Iterable.
|
|
41
46
|
* @param props Iterable properties
|
|
@@ -31,6 +31,10 @@ export declare class TreeGrid extends Grid implements ITreeGrid {
|
|
|
31
31
|
* Tree data structure
|
|
32
32
|
*/
|
|
33
33
|
treeDataStructure: TreeDataStructure;
|
|
34
|
+
/**
|
|
35
|
+
* Even though all children are selected, the parent node is not
|
|
36
|
+
*/
|
|
37
|
+
flat: boolean;
|
|
34
38
|
viewUpdateScrollData?: () => void;
|
|
35
39
|
/**
|
|
36
40
|
* Creates a new Tree Grid.
|
|
@@ -80,12 +84,23 @@ export declare class TreeGrid extends Grid implements ITreeGrid {
|
|
|
80
84
|
* Navigate downwards
|
|
81
85
|
*/
|
|
82
86
|
protected navigateDown(): void;
|
|
87
|
+
private removeDuplicates;
|
|
83
88
|
/**
|
|
84
89
|
* Select/deselect rows
|
|
85
90
|
* @param row selected row
|
|
86
91
|
* @param isSelected row is selected
|
|
87
92
|
*/
|
|
88
93
|
selectRow(row: IDictionary<any>, isSelected: boolean): void;
|
|
94
|
+
/**
|
|
95
|
+
* Select children rows
|
|
96
|
+
* @param row Row to unselect children
|
|
97
|
+
*/
|
|
98
|
+
selectChildren(row: IDictionary<any>): void;
|
|
99
|
+
/**
|
|
100
|
+
* Unselect children rows
|
|
101
|
+
* @param row Row to select children
|
|
102
|
+
*/
|
|
103
|
+
unselectChildren(row: IDictionary<any>): void;
|
|
89
104
|
private selectParents;
|
|
90
105
|
private unselectParents;
|
|
91
106
|
}
|