@acorex/components 3.0.33 → 3.0.37

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.
@@ -3379,7 +3379,7 @@ __decorate([
3379
3379
  AXCheckBoxComponent = __decorate([
3380
3380
  Component({
3381
3381
  selector: 'ax-check-box',
3382
- template: "<!-- <label class=\"ax checkbox {{size}}\" for=\"{{uid}}\" [ngClass]=\"{ 'disabled': disabled, 'readonly': readonly }\"\r\n (click)=\"handleClick($event)\">\r\n {{ label }}\r\n <input #input type=\"checkbox\" id=\"{{uid}}\" [readonly]=\"readonly\" [checked]=\"value\"\r\n [disabled]=\"disabled || readonly\" />\r\n <span class=\"checkmark\" [ngClass]=\"{'indeterminate': indeterminate && value == null}\"></span>\r\n\r\n</label> -->\r\n\r\n<label for=\"{{uid}}\" class=\"ax-checkbox-container\" (click)=\"handleClick($event)\">\r\n <input #input type=\"checkbox\" class=\"ax-checkbox\" [ngClass]=\"{'indeterminate': indeterminate && value == null}\"\r\n id=\"{{uid}}\" [readonly]=\"readonly\" [checked]=\"value\" [(ngModel)]=\"value\" [disabled]=\"disabled || readonly\" />\r\n <span>{{ label ? label : '&nbsp;' }}</span>\r\n</label>",
3382
+ template: "<!-- <label class=\"ax checkbox {{size}}\" for=\"{{uid}}\" [ngClass]=\"{ 'disabled': disabled, 'readonly': readonly }\"\r\n (click)=\"handleClick($event)\">\r\n {{ label }}\r\n <input #input type=\"checkbox\" id=\"{{uid}}\" [readonly]=\"readonly\" [checked]=\"value\"\r\n [disabled]=\"disabled || readonly\" />\r\n <span class=\"checkmark\" [ngClass]=\"{'indeterminate': indeterminate && value == null}\"></span>\r\n\r\n</label> -->\r\n\r\n<label for=\"{{uid}}\" class=\"ax-checkbox-container\" [ngClass]=\"{ 'disabled': disabled, 'readonly': readonly }\"\r\n (click)=\"handleClick($event)\">\r\n <input #input type=\"checkbox\" class=\"ax-checkbox\" [ngClass]=\"{'indeterminate': indeterminate && value == null}\"\r\n id=\"{{uid}}\" [readonly]=\"readonly\" [checked]=\"value\" [(ngModel)]=\"value\" [disabled]=\"disabled || readonly\" />\r\n <span>{{ label ? label : '&nbsp;' }}</span>\r\n</label>",
3383
3383
  encapsulation: ViewEncapsulation.None,
3384
3384
  changeDetection: ChangeDetectionStrategy.OnPush
3385
3385
  }),
@@ -10921,7 +10921,7 @@ AXTabPageModule = __decorate([
10921
10921
  imports: [CommonModule, AXLoadingModule],
10922
10922
  exports: [AXTabPageRendererComponent],
10923
10923
  entryComponents: [AXTabPageRendererComponent, AXTabPageHostComponent],
10924
- providers: [AXTabPageService],
10924
+ providers: [],
10925
10925
  })
10926
10926
  ], AXTabPageModule);
10927
10927
 
@@ -12908,7 +12908,10 @@ let AXTreeViewComponent = class AXTreeViewComponent extends AXBaseComponent {
12908
12908
  //seletedKeyFields set id of nodes and parents
12909
12909
  //selectedFieldName set name of fields that set selectes
12910
12910
  this.selectedFieldName = null;
12911
- this.selectNodesRecursive = 'all';
12911
+ // @Input()
12912
+ // selectNodesRecursive: 'all' | 'parents' | 'childs' | 'none' = 'all'; //leaf
12913
+ this.checkParents = true;
12914
+ this.checkChilds = true;
12912
12915
  this.seletedKeyFields = [];
12913
12916
  this.keyField = 'id';
12914
12917
  this.hasChildField = 'child';
@@ -12923,6 +12926,7 @@ let AXTreeViewComponent = class AXTreeViewComponent extends AXBaseComponent {
12923
12926
  this.onItemClosing = new EventEmitter();
12924
12927
  this.onItemDrag = new EventEmitter();
12925
12928
  this.onItemMoved = new EventEmitter();
12929
+ this.selectableField = '';
12926
12930
  this.onContextMenuItemClick = new EventEmitter();
12927
12931
  this.showSelectBox = false;
12928
12932
  this.loading = false;
@@ -13036,7 +13040,8 @@ let AXTreeViewComponent = class AXTreeViewComponent extends AXBaseComponent {
13036
13040
  return node;
13037
13041
  }
13038
13042
  changeChildSelect(item, s) {
13039
- if (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'childs') {
13043
+ // if (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'childs') {
13044
+ if (this.checkChilds == true) {
13040
13045
  item.select = s;
13041
13046
  if (item[this.hasChildField] === true && item[this.childField] && item[this.childField].length > 0) {
13042
13047
  item[this.childField].forEach((elm) => {
@@ -13069,7 +13074,8 @@ let AXTreeViewComponent = class AXTreeViewComponent extends AXBaseComponent {
13069
13074
  }
13070
13075
  }
13071
13076
  changeParentSelect(item) {
13072
- if (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'parents') {
13077
+ //if (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'parents') {
13078
+ if (this.checkParents) {
13073
13079
  let allselect = true;
13074
13080
  let alldeselect = true;
13075
13081
  let oneselect = false;
@@ -13173,7 +13179,7 @@ let AXTreeViewComponent = class AXTreeViewComponent extends AXBaseComponent {
13173
13179
  this.hideLoading(null);
13174
13180
  this.list = _data.data.result;
13175
13181
  this.list.forEach((el) => {
13176
- el.disabledCheckBox = false;
13182
+ el.disabledCheckBox = this.selectableField != '' ? el[this.selectableField] : false;
13177
13183
  el.select = false;
13178
13184
  if (this.selectionLevel == 'nodes' && el[this.hasChildField] == true) {
13179
13185
  el.disabledCheckBox = true;
@@ -13185,9 +13191,11 @@ let AXTreeViewComponent = class AXTreeViewComponent extends AXBaseComponent {
13185
13191
  this.seletedKeyFields.forEach((n) => {
13186
13192
  if (n.includes(el[this.keyField])) {
13187
13193
  if (el[this.hasChildField] == true) {
13188
- // if (this.selectNodesRecursive) {
13194
+ if (this.checkParents == false && this.checkChilds == false) {
13195
+ //select parent when check child and check parent is false TODO check this Action
13196
+ this.selectItem(el);
13197
+ }
13189
13198
  this.open(el);
13190
- // }
13191
13199
  }
13192
13200
  else {
13193
13201
  this.selectItem(el);
@@ -13198,9 +13206,11 @@ let AXTreeViewComponent = class AXTreeViewComponent extends AXBaseComponent {
13198
13206
  }
13199
13207
  else if (this.selectedFieldName != null) {
13200
13208
  if (el[this.hasChildField] == true && el[this.selectedFieldName] == true) {
13201
- // if (this.selectNodesRecursive) {
13209
+ if (this.checkParents == false && this.checkChilds == false) {
13210
+ //select parent when check child and check parent is false TODO check this Action
13211
+ this.selectItem(el);
13212
+ }
13202
13213
  this.open(el);
13203
- // }
13204
13214
  }
13205
13215
  else if (el[this.selectedFieldName] == true) {
13206
13216
  this.selectItem(el);
@@ -13219,7 +13229,7 @@ let AXTreeViewComponent = class AXTreeViewComponent extends AXBaseComponent {
13219
13229
  if (this.list.length !== 0) {
13220
13230
  if (this.itemRow[this.childField] && this.itemRow[this.childField].length > 0) {
13221
13231
  result.forEach((el) => {
13222
- el.disabledCheckBox = false;
13232
+ el.disabledCheckBox = this.selectableField != '' ? el[this.selectableField] : false;
13223
13233
  this.itemRow[this.childField][this.itemRow[this.childField].length] = el;
13224
13234
  });
13225
13235
  }
@@ -13233,7 +13243,8 @@ let AXTreeViewComponent = class AXTreeViewComponent extends AXBaseComponent {
13233
13243
  if (this.selectionLevel == 'parents' && result[i][this.hasChildField] == false) {
13234
13244
  result[i].disabledCheckBox = true;
13235
13245
  }
13236
- if (this.selectionMode !== 'single' && (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'childs')) {
13246
+ // if (this.selectionMode !== 'single' && (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'childs')) {
13247
+ if (this.selectionMode !== 'single' && this.checkChilds == true) {
13237
13248
  result[i].select = this.itemRow.select === (undefined || null) ? false : this.itemRow.select;
13238
13249
  if (this.itemRow.select === true && this.selectionMode == 'multiple' && result[i][this.hasChildField] === false) {
13239
13250
  this.selectedItems = this.selectedItems.filter((c) => c[this.keyField] !== result[i][this.keyField]);
@@ -13248,9 +13259,11 @@ let AXTreeViewComponent = class AXTreeViewComponent extends AXBaseComponent {
13248
13259
  this.seletedKeyFields.forEach((n) => {
13249
13260
  if (n.includes(result[i][this.keyField])) {
13250
13261
  if (result[i][this.hasChildField] == true) {
13251
- // if (this.selectNodesRecursive) {
13262
+ if (this.checkParents == false && this.checkChilds == false) {
13263
+ //select parent when check child and check parent is false TODO check this Action
13264
+ this.selectItem(result[i]);
13265
+ }
13252
13266
  this.open(result[i]);
13253
- // }
13254
13267
  }
13255
13268
  else {
13256
13269
  this.selectItem(result[i]);
@@ -13261,9 +13274,11 @@ let AXTreeViewComponent = class AXTreeViewComponent extends AXBaseComponent {
13261
13274
  }
13262
13275
  else if (this.selectedFieldName != null) {
13263
13276
  if (result[i][this.hasChildField] == true && result[i][this.selectedFieldName] == true) {
13264
- // if (this.selectNodesRecursive) {
13277
+ if (this.checkParents == false && this.checkChilds == false) {
13278
+ //select parent when check child and check parent is false TODO check this Action
13279
+ this.selectItem(result[i]);
13280
+ }
13265
13281
  this.open(result[i]);
13266
- // }
13267
13282
  }
13268
13283
  else if (result[i][this.selectedFieldName] == true) {
13269
13284
  this.selectItem(result[i]);
@@ -13428,6 +13443,11 @@ let AXTreeViewComponent = class AXTreeViewComponent extends AXBaseComponent {
13428
13443
  this.internalSelectItem(item, false);
13429
13444
  }
13430
13445
  }
13446
+ unSelectItem(item) {
13447
+ if (item['select'] == true) {
13448
+ this.internalSelectItem(item, false);
13449
+ }
13450
+ }
13431
13451
  open(item) {
13432
13452
  if (item['toggle'] !== true) {
13433
13453
  this.toggleNode(item, true);
@@ -13509,8 +13529,12 @@ __decorate([
13509
13529
  ], AXTreeViewComponent.prototype, "selectedFieldName", void 0);
13510
13530
  __decorate([
13511
13531
  Input(),
13512
- __metadata("design:type", String)
13513
- ], AXTreeViewComponent.prototype, "selectNodesRecursive", void 0);
13532
+ __metadata("design:type", Boolean)
13533
+ ], AXTreeViewComponent.prototype, "checkParents", void 0);
13534
+ __decorate([
13535
+ Input(),
13536
+ __metadata("design:type", Boolean)
13537
+ ], AXTreeViewComponent.prototype, "checkChilds", void 0);
13514
13538
  __decorate([
13515
13539
  Input(),
13516
13540
  __metadata("design:type", Array)
@@ -13567,6 +13591,10 @@ __decorate([
13567
13591
  Output(),
13568
13592
  __metadata("design:type", EventEmitter)
13569
13593
  ], AXTreeViewComponent.prototype, "onItemMoved", void 0);
13594
+ __decorate([
13595
+ Input(),
13596
+ __metadata("design:type", String)
13597
+ ], AXTreeViewComponent.prototype, "selectableField", void 0);
13570
13598
  __decorate([
13571
13599
  Output(),
13572
13600
  __metadata("design:type", EventEmitter)