mmhglobal-dynamicform 2.15.0 → 2.15.2

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.
@@ -11009,6 +11009,18 @@ class ZtreeComponent extends DataListingFieldBase {
11009
11009
  this.collapseAll = () => {
11010
11010
  this.state.expandedkeys = [];
11011
11011
  };
11012
+ // Custom logic handling Indeterminate state when custom data item property is persisted
11013
+ this.isChecked = (dataItem, index) => {
11014
+ if (this.data.TreeViewCheckboxConfiguration) {
11015
+ if (this.containsItem(dataItem)) {
11016
+ return "checked";
11017
+ }
11018
+ if (this.isIndeterminate(dataItem.Value)) {
11019
+ return "indeterminate";
11020
+ }
11021
+ return "none";
11022
+ }
11023
+ };
11012
11024
  }
11013
11025
  ngOnInit() {
11014
11026
  super.initComponent().subscribe(() => {
@@ -11363,14 +11375,14 @@ class ZtreeComponent extends DataListingFieldBase {
11363
11375
  }
11364
11376
  return checkboxConfiguration;
11365
11377
  }
11366
- setValues(data, targetArray, defaultValue = []) {
11367
- targetArray = data ? (Array.isArray(data) ? data : [data]) : defaultValue;
11378
+ setValues(data, targetVariable, defaultValue = []) {
11379
+ this[targetVariable] = data ? (Array.isArray(data) ? data : [data]) : defaultValue;
11368
11380
  }
11369
11381
  setCheckedValues(data) {
11370
- this.setValues(data, this.checkedKeys);
11382
+ this.setValues(data, 'checkedKeys');
11371
11383
  }
11372
11384
  setDisabledCheckBox(data) {
11373
- this.setValues(data, this.disabledCheckBoxKeys);
11385
+ this.setValues(data, 'disabledCheckBoxKeys');
11374
11386
  }
11375
11387
  get checkableSettings() {
11376
11388
  if (!!this.data.TreeViewCheckboxConfiguration) {
@@ -11409,17 +11421,6 @@ class ZtreeComponent extends DataListingFieldBase {
11409
11421
  }
11410
11422
  return [];
11411
11423
  }
11412
- isChecked(dataItem, index) {
11413
- if (this.data.TreeViewCheckboxConfiguration) {
11414
- if (this.containsItem(dataItem)) {
11415
- return "checked";
11416
- }
11417
- if (this.isIndeterminate(dataItem.Value)) {
11418
- return "indeterminate";
11419
- }
11420
- return "none";
11421
- }
11422
- }
11423
11424
  containsItem(item) {
11424
11425
  return this.checkedKeys.indexOf(item[this.data.SelectOptions]) > -1;
11425
11426
  }