mmhglobal-dynamicform 1.1.41 → 1.1.44

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/README.md CHANGED
@@ -3,6 +3,17 @@
3
3
  This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.13.
4
4
 
5
5
  ## Changelog
6
+ `1.1.44`<br/>
7
+ [zudf] - enhance zudf<br/>
8
+ [zcard] - enhance to handle disablecollapse<br/>
9
+ [zbutton] - enhance to have kendo color, fill<br/>
10
+
11
+ `1.1.43`<br/>
12
+ [ztree] - enhance to have expand & select 1 node and collapse 1 node<br/>
13
+
14
+ `1.1.42`<br/>
15
+ [zselectmultiple] - enhance to support ButtonList for zselectmultiple.<br/>
16
+
6
17
  `1.1.41`<br/>
7
18
  [mainservice] check event if not null, check for zudf form if applicable.<br/>
8
19
 
@@ -4069,6 +4069,8 @@
4069
4069
  if (button.Disabled != "" && button.Disabled) {
4070
4070
  buttonDisabled = button.Disabled === 'true' ? true : i3.ZComponentHelper.getGroupEvalValue.call(_this, button.Disabled);
4071
4071
  }
4072
+ var fill = button['Fill'] ? button['Fill'] : 'outline';
4073
+ var color = button.Color ? button.Color : 'dark';
4072
4074
  _this.items.push({
4073
4075
  name: button.Name,
4074
4076
  text: label,
@@ -4079,6 +4081,8 @@
4079
4081
  iconName: button.Icon,
4080
4082
  dismissType: button.DismissType,
4081
4083
  disableTriggerTimer: button.DisableTriggerTimer,
4084
+ fill: fill,
4085
+ color: color,
4082
4086
  SubType: _this.data.SubType,
4083
4087
  click: function (y) {
4084
4088
  _this.buttonClick(button);
@@ -4129,14 +4133,19 @@
4129
4133
  });
4130
4134
  };
4131
4135
  ZbuttonsComponent.prototype.getButtonLabel = function (button) {
4132
- var labelExpr = button.Label.match(/^{{.*}}$/gi);
4133
- if (labelExpr) {
4134
- labelExpr = labelExpr[0].slice(2, -2);
4135
- var label = i3.ZComponentHelper.getGroupValue(labelExpr, this.group);
4136
- return label;
4136
+ if (button.Label) {
4137
+ var labelExpr = button.Label.match(/^{{.*}}$/gi);
4138
+ if (labelExpr) {
4139
+ labelExpr = labelExpr[0].slice(2, -2);
4140
+ var label = i3.ZComponentHelper.getGroupValue(labelExpr, this.group);
4141
+ return label;
4142
+ }
4143
+ else {
4144
+ return button.Label;
4145
+ }
4137
4146
  }
4138
4147
  else {
4139
- return button.Label;
4148
+ return null;
4140
4149
  }
4141
4150
  };
4142
4151
  ZbuttonsComponent.prototype.getButtonRole = function (button, label) {
@@ -4167,7 +4176,7 @@
4167
4176
  ZbuttonsComponent.decorators = [
4168
4177
  { type: i0.Component, args: [{
4169
4178
  selector: "app-zbuttons",
4170
- template: "<!-- <p>\r\n zbuttons {{data.Value}}\r\n</p> -->\r\n<div *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible) && items.length > 0\">\r\n\r\n <div class=\"ion-margin-vertical\" *ngIf=\"isMobileScreen() && items.length > 1 && FirstZbtn === false\">\r\n <kendo-dropdownbutton [data]=\"items\" size=\"large\" [look]=\"'outline'\" class=\"ion-activatable ripple-parent\">\r\n Actions\r\n <ng-template kendoDropDownButtonItemTemplate let-dataItem>\r\n <!-- <span class=\"k-icon k-i-{{ dataItem.icon }}\"></span> -->\r\n <span>{{ dataItem.text }}</span>\r\n </ng-template>\r\n <ion-ripple-effect></ion-ripple-effect>\r\n </kendo-dropdownbutton>\r\n </div>\r\n\r\n <div *ngIf=\"!isMobileScreen() || items.length === 1 \" style=\"padding: 10px 0px;\" [class]=\"data.DivClass\">\r\n <!-- <button *ngFor=\"let item of items; let i = index\" (click)=\"BtnClick(item.clickEvent)\"\r\n kendoButton [togglable]=\"true\" [icon]=\"item.icon\" [hidden]=\"!isBtnVisible(item.visible)\"\r\n style=\"margin-right: 5px;\">{{item.text}}</button> -->\r\n <ion-button fill=\"outline\"\r\n color=\"dark\"\r\n size=\"small\"\r\n strong=\"false\"\r\n [expand]=\"expand\"\r\n *ngFor=\"let item of items; let i = index\"\r\n class=\"button-container\"\r\n (click)=\"BtnClick(item)\"\r\n [hidden]=\"!isBtnVisible(item.visible)\"\r\n [disabled]=\"group.isTriggered || item.disabled\">\r\n <fa-icon [icon]=\"getFontAwesome(item.icon)\" style=\"padding-right: 5px;\"></fa-icon>\r\n <span class=\"ion-text-capitalize\">{{item.text}}</span>\r\n </ion-button>\r\n </div>\r\n</div>\r\n",
4179
+ template: "<!-- <p>\r\n zbuttons {{data.Value}}\r\n</p> -->\r\n<div *ngIf=\"data.AlignButton\" style=\"padding-top: 13px\"></div>\r\n<div *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible) && items.length > 0\">\r\n\r\n <div class=\"ion-margin-vertical\" *ngIf=\"isMobileScreen() && items.length > 1 && FirstZbtn === false\">\r\n <kendo-dropdownbutton [data]=\"items\" size=\"large\" [look]=\"'outline'\" class=\"ion-activatable ripple-parent\">\r\n Actions\r\n <ng-template kendoDropDownButtonItemTemplate let-dataItem>\r\n <!-- <span class=\"k-icon k-i-{{ dataItem.icon }}\"></span> -->\r\n <span>{{ dataItem.text }}</span>\r\n </ng-template>\r\n <ion-ripple-effect></ion-ripple-effect>\r\n </kendo-dropdownbutton>\r\n </div>\r\n\r\n <div *ngIf=\"!isMobileScreen() || items.length === 1 \" style=\"padding: 10px 0px;\" [class]=\"data.DivClass\">\r\n <!-- <button *ngFor=\"let item of items; let i = index\" (click)=\"BtnClick(item.clickEvent)\"\r\n kendoButton [togglable]=\"true\" [icon]=\"item.icon\" [hidden]=\"!isBtnVisible(item.visible)\"\r\n style=\"margin-right: 5px;\">{{item.text}}</button> -->\r\n <ion-button *ngFor=\"let item of items; let i = index\"\r\n [fill]=\"item.fill\"\r\n [color]=\"item.color\"\r\n size=\"small\"\r\n strong=\"false\"\r\n class=\"button-container\"\r\n (click)=\"BtnClick(item)\"\r\n [expand]=\"expand\"\r\n [hidden]=\"!isBtnVisible(item.visible)\"\r\n [disabled]=\"group.isTriggered || item.disabled\">\r\n <fa-icon [icon]=\"getFontAwesome(item.icon)\"></fa-icon>\r\n <div *ngIf=\"item.text\" style=\"padding-right: 5px;\"></div>\r\n <span class=\"ion-text-capitalize\">{{item.text}}</span>\r\n </ion-button>\r\n </div>\r\n</div>\r\n",
4171
4180
  styles: [".ripple-parent{position:relative;overflow:hidden}:host ::ng-deep span.ion-text-capitalize{font-weight:600}.button-container,.button:hover{font-size:12px;height:30px}.button:hover{border-radius:5px}"]
4172
4181
  },] }
4173
4182
  ];
@@ -4232,8 +4241,8 @@
4232
4241
  ZcardComponent.decorators = [
4233
4242
  { type: i0.Component, args: [{
4234
4243
  selector: "app-zcard",
4235
- template: "<div *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\" style=\"margin: 10px 0 6px 0;\">\r\n <kendo-panelbar keepItemContent=\"true\">\r\n <kendo-panelbar-item [expanded]=\"!data.DefaultCollapse\" [disabled]=\"(!!componentProperties.isReadOnlyField ? group[componentProperties.isReadOnlyField] : componentProperties.isReadOnly)\">\r\n <ng-template kendoPanelBarItemTitle>\r\n <span *ngIf=\"data.Icon\">\r\n <fa-icon [icon]=\"data.Icon\" class=\"zcard-header-icon\"></fa-icon>\r\n </span>\r\n <span *ngIf=\"!data.Icon\">\r\n <i class=\"fas fa-folder\" style=\"color: #000000\"></i>\r\n </span>\r\n <ion-label class=\"zcard-header-title\">{{options.Title}}</ion-label>\r\n </ng-template>\r\n <ng-template kendoPanelBarContent>\r\n <div class=\"ion-row\" style=\"padding: 6px 12px;\">\r\n <app-zformcontrol [ngClass]=\"group[field.isVisibleField] ? field.DivClass : ((field.Visible === true) ? field.DivClass : 'flex-hide')\"\r\n *ngFor=\"let field of data.Value\"\r\n [field]=\"field\"\r\n [group]=\"group\"\r\n [form]=\"form\"\r\n id=\"{{field.Type}}-{{field.Name}}\">\r\n </app-zformcontrol>\r\n </div>\r\n </ng-template>\r\n </kendo-panelbar-item>\r\n </kendo-panelbar>\r\n</div>\r\n",
4236
- styles: [".zcard-header-icon{color:#fff!important;padding-right:3px;font-size:11pt}.zcard-header-title{color:#fff!important;font-weight:500;font-size:11pt}"]
4244
+ template: "<div *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\" style=\"margin: 10px 0 6px 0;\">\r\n <kendo-panelbar keepItemContent=\"true\" *ngIf=\"!data.DisableCollapse\">\r\n <kendo-panelbar-item [expanded]=\"!data.DefaultCollapse\" [disabled]=\"(!!componentProperties.isReadOnlyField ? group[componentProperties.isReadOnlyField] : componentProperties.isReadOnly)\">\r\n <ng-template kendoPanelBarItemTitle>\r\n <span *ngIf=\"data.Icon\">\r\n <fa-icon [icon]=\"data.Icon\" class=\"zcard-header-icon\"></fa-icon>\r\n </span>\r\n <span *ngIf=\"!data.Icon\">\r\n <i class=\"fas fa-folder\" style=\"color: #000000\"></i>\r\n </span>\r\n <ion-label class=\"zcard-header-title\">{{options.Title}}</ion-label>\r\n </ng-template>\r\n <ng-template kendoPanelBarContent>\r\n <div class=\"ion-row\" style=\"padding: 6px 12px;\">\r\n <app-zformcontrol [ngClass]=\"group[field.isVisibleField] ? field.DivClass : ((field.Visible === true) ? field.DivClass : 'flex-hide')\"\r\n *ngFor=\"let field of data.Value\"\r\n [field]=\"field\"\r\n [group]=\"group\"\r\n [form]=\"form\"\r\n id=\"{{field.Type}}-{{field.Name}}\">\r\n </app-zformcontrol>\r\n </div>\r\n </ng-template>\r\n </kendo-panelbar-item>\r\n </kendo-panelbar>\r\n\r\n <kendo-card *ngIf=\"data.DisableCollapse\" width=\"100%\">\r\n <kendo-card-header>\r\n <div>\r\n <span *ngIf=\"data.Icon\">\r\n <fa-icon [icon]=\"data.Icon\" class=\"zcard-header-icon\"></fa-icon>\r\n </span>\r\n <span *ngIf=\"!data.Icon\">\r\n <i class=\"fas fa-folder\" style=\"color: #000000\"></i>\r\n </span>\r\n <ion-label class=\"card-header-title\">{{options.Title}}</ion-label>\r\n </div>\r\n </kendo-card-header>\r\n <kendo-card-body>\r\n <div class=\"ion-row\">\r\n <app-zformcontrol [ngClass]=\"group[field.isVisibleField] ? field.DivClass : ((field.Visible === true) ? field.DivClass : 'flex-hide')\"\r\n *ngFor=\"let field of data.Value\"\r\n [field]=\"field\"\r\n [group]=\"group\"\r\n [form]=\"form\"\r\n id=\"{{field.Type}}-{{field.Name}}\">\r\n </app-zformcontrol>\r\n </div>\r\n </kendo-card-body>\r\n </kendo-card>\r\n</div>\r\n",
4245
+ styles: [".zcard-header-icon{color:#fff!important;padding-right:3px;font-size:11pt}:host ::ng-deep kendo-card-header{background-color:#5596e6;color:#fff}.card-header-title{font-weight:500;font-size:10.5pt}"]
4237
4246
  },] }
4238
4247
  ];
4239
4248
  ZcardComponent.ctorParameters = function () { return [
@@ -8726,6 +8735,16 @@
8726
8735
  });
8727
8736
  }
8728
8737
  }
8738
+ // Handle Button beside dropdown
8739
+ this.buttonList = this.data.ButtonList;
8740
+ if (this.buttonList) {
8741
+ this.buttonList.forEach(function (button) {
8742
+ if (button.tooltip) {
8743
+ button.tooltip = i3.ZComponentHelper.getGroupEvalValue.call(_this, button.tooltip);
8744
+ }
8745
+ });
8746
+ }
8747
+ // dropdown configuration
8729
8748
  this.allowCustomValue = this.data.AllowCustomValue || false; // Allow enter text in dropdownbox
8730
8749
  var fieldValue = this.data.Value;
8731
8750
  var data = this.data;
@@ -9152,12 +9171,15 @@
9152
9171
  }
9153
9172
  return 'ion-row divselectmultiple';
9154
9173
  };
9174
+ ZselectmultipleComponent.prototype.getFontAwesome = function (iconName) {
9175
+ return i3.ZComponentHelper.getFontAwesome(iconName);
9176
+ };
9155
9177
  return ZselectmultipleComponent;
9156
9178
  }());
9157
9179
  ZselectmultipleComponent.decorators = [
9158
9180
  { type: i0.Component, args: [{
9159
9181
  selector: "app-zselectmultiple",
9160
- template: "<ion-item [ngClass]=\"getClass(form, data)\" *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible) && isMobileScreen()\">\r\n\r\n <ion-label *ngIf=\"data.ShowLabel === undefined || data.ShowLabel\" position=\"stacked\">\r\n {{data.Label}}\r\n <ion-text *ngIf=\"componentProperties.isRequired\" color=\"danger\">*</ion-text>\r\n </ion-label>\r\n\r\n <kendo-label *ngIf=\"data.TooltipsInfo && !showTooltipsInfoIcon && !showTooltipsInfoBySide\"\r\n [text]=\"tooltipsDisplayText\"\r\n [class]=\"setTooltipsInfoClass()\"\r\n [style.color]=\"setTooltipsInfoColor()\"></kendo-label>\r\n <div [class]=\"setTooltipsInfoSideBySide()\" *ngIf=\"!isLoading\">\r\n <div style=\"flex-grow: 1;\">\r\n <ionic-selectable #selectComponent item-content\r\n searchFailText=\"Nothing found :(\"\r\n headerColor=\"primary\"\r\n clearButtonText=\"Clear\"\r\n [(ngModel)]=\"group.zModel[data.Value]\"\r\n [id]=\"data.Value\"\r\n [items]=\"getItemsData()\"\r\n [itemValueField]=\"itemValueField\"\r\n [itemTextField]=\"itemTextField\"\r\n [canAddItem]=\"!!data.OnAddItem\"\r\n [canClear]=\"true\"\r\n [placeholder]=\"data.PlaceHolder\"\r\n [canSearch]=\"!data['disable-search']\"\r\n [shouldFocusSearchbar]=\"!data['disable-search']\"\r\n [hasInfiniteScroll]=\"!!data.HasInfiniteScroll\"\r\n [isMultiple]=\"data.Multiple\"\r\n [isEnabled]=\"!(!!componentProperties.isReadOnlyField ? group[componentProperties.isReadOnlyField] : componentProperties.isReadOnly)\"\r\n [shouldStoreItemValue]=\"true\"\r\n (onSearch)=\"onSearch($event)\"\r\n (onInfiniteScroll)=\"getInfiniteData($event)\"\r\n (onAddItem)=\"onAddItem($event)\"\r\n (onChange)=\"onChange($event)\">\r\n\r\n <ng-template ionicSelectableItemIconTemplate\r\n let-item=\"item\"\r\n let-isItemSelected=\"isItemSelected\">\r\n <fa-icon slot=\"start\"\r\n class=\"isItemSelected\"\r\n size=\"sm\"\r\n [icon]=\"['far', isItemSelected ? 'check-circle': 'circle']\"\r\n [styles]=\"{'color': isItemSelected ? 'dodgerBlue' : 'lightGray'}\"></fa-icon>\r\n </ng-template>\r\n\r\n <ng-template ionicSelectableCloseButtonTemplate>\r\n <!-- <ion-icon name=\"close-circle\"></ion-icon> -->\r\n <fa-icon [icon]=\"'times-circle'\" size=\"md\"></fa-icon>\r\n </ng-template>\r\n\r\n <ng-template ionicSelectableTitleTemplate>\r\n {{data.Label}}\r\n <ion-text *ngIf=\"getIsRequiredValue()\" color=\"danger\">*</ion-text>\r\n </ng-template>\r\n\r\n <ng-template ionicSelectableItemTemplate let-item=\"item\">\r\n {{ getItemTemplate(item, data, group, itemValueField, itemTextField) }}\r\n <!-- <ng-template zselectitemelement [item]=\"item\"></ng-template> -->\r\n </ng-template>\r\n\r\n <!--<ng-template ionicSelectableFooterTemplate>\r\n <ion-toolbar>\r\n <ion-row>\r\n <ion-col>\r\n <ion-button expand=\"full\" ng-reflect-disabled=\"false\" ng-reflect-expand=\"full\" class=\"button button-full button-solid ion-activatable ion-focusable hydrated\" (click)=\"clearItems()\">\r\n Clear\r\n </ion-button>\r\n </ion-col>\r\n <ion-col>\r\n <ion-button expand=\"full\" ng-reflect-disabled=\"false\" ng-reflect-expand=\"full\" class=\"button button-full button-solid ion-activatable ion-focusable hydrated\" (click)=\"confirmItems()\">\r\n OK\r\n </ion-button>\r\n </ion-col>\r\n </ion-row>\r\n </ion-toolbar>\r\n </ng-template>-->\r\n </ionic-selectable>\r\n </div>\r\n <app-uivalidationmessage [group]=\"group\" [data]=\"data\" [form]=\"form\"></app-uivalidationmessage>\r\n <!-- side by side and desktop tooltipsinfo -->\r\n <kendo-label *ngIf=\"tooltipsInfo && !showTooltipsInfoIcon && showTooltipsInfoBySide\"\r\n [text]=\"tooltipsDisplayText\"\r\n [class]=\"setTooltipsInfoClass()\"\r\n [style.color]=\"setTooltipsInfoColor()\"></kendo-label>\r\n </div>\r\n</ion-item>\r\n\r\n\r\n\r\n<ion-item [ngClass]=\"getClass(form, data)\" [formGroup]=\"form\" *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible) && !isMobileScreen()\" [ngClass]=\"getIon_InvalidClass(form, data)\">\r\n <ion-label [attr.for]=\"data.Value\" *ngIf=\"data.ShowLabel === undefined || data.ShowLabel\" position=\"stacked\">\r\n {{data.Label}}\r\n <ion-text *ngIf=\"(!!componentProperties.isRequiredField ? group[componentProperties.isRequiredField] : componentProperties.isRequired)\" color=\"danger\">*</ion-text>\r\n <span kendoTooltip\r\n *ngIf=\"data.TooltipsInfo && showTooltipsInfoIcon\"\r\n [title]=\"tooltipsDisplayText\">\r\n <fa-icon [icon]=\"tooltipsDisplayIcon\"\r\n class=\"tooltipsinfo-icon\">\r\n </fa-icon>\r\n </span>\r\n </ion-label>\r\n <!-- mobile tooltipsinfo below label-->\r\n <div [class]=\"setTooltipsInfoSideBySide()\">\r\n <div style=\"flex: 1;\">\r\n <kendo-combobox *ngIf=\"!data.Multiple\"\r\n #comboboxComponent\r\n [data]=\"getItemsData()\"\r\n [valueField]=\"itemValueField\"\r\n [textField]=\"itemTextField\"\r\n [formControlName]=\"data.Value\"\r\n [valuePrimitive]=\"true\"\r\n [placeholder]=\"data.PlaceHolder\"\r\n [allowCustom]=\"allowCustomValue\"\r\n [suggest]=\"true\"\r\n [filterable]=\"!!data.HasInfiniteScroll\"\r\n [openOnFocus]=\"disableOpenOnFocus(comboboxComponent)\"\r\n [readonly]=\"(!!componentProperties.isReadOnlyField ? group[componentProperties.isReadOnlyField] : componentProperties.isReadOnly)\"\r\n [ngClass]=\"{'disabled' : (!!componentProperties.isReadOnlyField ? group[componentProperties.isReadOnlyField] : componentProperties.isReadOnly)}\"\r\n [loading]=\"isLoading\"\r\n (valueChange)=\"onValueChange($event)\"\r\n (filterChange)=\"handleFilter($event)\"\r\n [virtual]=\"virtual\"\r\n (open)=\"handleOpen()\"\r\n (close)=\"handleClose()\"\r\n (blur)=\"handleBlur()\"\r\n style=\"margin-top: 7px; width: 100%;\">\r\n <ng-template kendoComboBoxItemTemplate let-dataItem>\r\n {{ getItemTemplate(dataItem, data, group, itemValueField, itemTextField) }}\r\n <!-- <span class=\"template\">{{ dataItem.value }}</span> {{ dataItem.text }} -->\r\n </ng-template>\r\n <ng-template kendoTextBoxSuffixTemplate>\r\n\r\n <!-- For Validation feature -->\r\n <app-uivalidationmessage [group]=\"group\"\r\n [data]=\"data\"\r\n [form]=\"form\"\r\n class=\"validation-icon\"></app-uivalidationmessage>\r\n </ng-template>\r\n </kendo-combobox>\r\n <kendo-multiselect *ngIf=\"data.Multiple\"\r\n [data]=\"getItemsData()\"\r\n [valueField]=\"itemValueField\"\r\n [textField]=\"itemTextField\"\r\n [formControlName]=\"data.Value\"\r\n [valuePrimitive]=\"true\"\r\n [placeholder]=\"data.PlaceHolder\"\r\n [allowCustom]=\"allowCustomValue\"\r\n [filterable]=\"!!data.HasInfiniteScroll\"\r\n [checkboxes]=\"data.EnableCheckbox\"\r\n [loading]=\"isLoading\"\r\n [autoClose]=\"autoClose\"\r\n [readonly]=\"(!!componentProperties.isReadOnlyField ? group[componentProperties.isReadOnlyField] : componentProperties.isReadOnly)\"\r\n [ngClass]=\"{'disabled' : (!!componentProperties.isReadOnlyField ? group[componentProperties.isReadOnlyField] : componentProperties.isReadOnly)}\"\r\n (valueChange)=\"onValueChange($event)\"\r\n (filterChange)=\"handleFilter($event)\"\r\n (open)=\"handleOpen()\"\r\n (close)=\"handleClose()\"\r\n (blur)=\"handleBlur()\"\r\n style=\"margin-top: 7px; width: 100%;\">\r\n <ng-template kendoMultiSelectItemTemplate let-dataItem>\r\n {{ getItemTemplate(dataItem, data, group, itemValueField, itemTextField) }}\r\n <!-- <span class=\"template\">{{ dataItem.value }}</span> {{ dataItem.text }} -->\r\n </ng-template>\r\n </kendo-multiselect>\r\n </div>\r\n\r\n <div *ngFor=\"let item of iconList\">\r\n <div kendoTooltip style=\"text-align: center; padding-top: 10px;\"\r\n showOn=\"hover\"\r\n [tooltipWidth]=\"item.Width\"\r\n [position]=\"item.Position\">\r\n <span *ngIf=\"!!item && item.Color\"\r\n (click)=\"onIconClick(item.Click)\"\r\n [title]=\"item.Tooltip\"\r\n style=\"margin-top: 10px;\">\r\n <fa-icon [icon]=\"item.Icon\"\r\n [ngStyle]=\"{'padding': '4px 6px', 'color': (item.Color ? item.Color : 'black')}\"></fa-icon>\r\n </span>\r\n </div>\r\n </div>\r\n\r\n <app-uivalidationmessage [group]=\"group\"\r\n [data]=\"data\"\r\n [form]=\"form\"></app-uivalidationmessage>\r\n\r\n <!-- side by side and desktop tooltipsinfo -->\r\n <kendo-label *ngIf=\"tooltipsInfo && !showTooltipsInfoIcon && ((showTooltipsInfoBySide && isMobileScreen()) || !isMobileScreen())\"\r\n [text]=\"tooltipsDisplayText\"\r\n [class]=\"setTooltipsInfoClass()\"\r\n [style.color]=\"setTooltipsInfoColor()\"></kendo-label>\r\n\r\n </div>\r\n</ion-item>\r\n",
9182
+ template: "<ion-item [ngClass]=\"getClass(form, data)\" *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible) && isMobileScreen()\">\r\n\r\n <ion-label *ngIf=\"data.ShowLabel === undefined || data.ShowLabel\" position=\"stacked\">\r\n {{data.Label}}\r\n <ion-text *ngIf=\"componentProperties.isRequired\" color=\"danger\">*</ion-text>\r\n </ion-label>\r\n\r\n <kendo-label *ngIf=\"data.TooltipsInfo && !showTooltipsInfoIcon && !showTooltipsInfoBySide\"\r\n [text]=\"tooltipsDisplayText\"\r\n [class]=\"setTooltipsInfoClass()\"\r\n [style.color]=\"setTooltipsInfoColor()\"></kendo-label>\r\n <div [class]=\"setTooltipsInfoSideBySide()\" *ngIf=\"!isLoading\">\r\n <div style=\"flex-grow: 1;\">\r\n <ionic-selectable #selectComponent item-content\r\n searchFailText=\"Nothing found :(\"\r\n headerColor=\"primary\"\r\n clearButtonText=\"Clear\"\r\n [(ngModel)]=\"group.zModel[data.Value]\"\r\n [id]=\"data.Value\"\r\n [items]=\"getItemsData()\"\r\n [itemValueField]=\"itemValueField\"\r\n [itemTextField]=\"itemTextField\"\r\n [canAddItem]=\"!!data.OnAddItem\"\r\n [canClear]=\"true\"\r\n [placeholder]=\"data.PlaceHolder\"\r\n [canSearch]=\"!data['disable-search']\"\r\n [shouldFocusSearchbar]=\"!data['disable-search']\"\r\n [hasInfiniteScroll]=\"!!data.HasInfiniteScroll\"\r\n [isMultiple]=\"data.Multiple\"\r\n [isEnabled]=\"!(!!componentProperties.isReadOnlyField ? group[componentProperties.isReadOnlyField] : componentProperties.isReadOnly)\"\r\n [shouldStoreItemValue]=\"true\"\r\n (onSearch)=\"onSearch($event)\"\r\n (onInfiniteScroll)=\"getInfiniteData($event)\"\r\n (onAddItem)=\"onAddItem($event)\"\r\n (onChange)=\"onChange($event)\">\r\n\r\n <ng-template ionicSelectableItemIconTemplate\r\n let-item=\"item\"\r\n let-isItemSelected=\"isItemSelected\">\r\n <fa-icon slot=\"start\"\r\n class=\"isItemSelected\"\r\n size=\"sm\"\r\n [icon]=\"['far', isItemSelected ? 'check-circle': 'circle']\"\r\n [styles]=\"{'color': isItemSelected ? 'dodgerBlue' : 'lightGray'}\"></fa-icon>\r\n </ng-template>\r\n\r\n <ng-template ionicSelectableCloseButtonTemplate>\r\n <!-- <ion-icon name=\"close-circle\"></ion-icon> -->\r\n <fa-icon [icon]=\"'times-circle'\" size=\"md\"></fa-icon>\r\n </ng-template>\r\n\r\n <ng-template ionicSelectableTitleTemplate>\r\n {{data.Label}}\r\n <ion-text *ngIf=\"getIsRequiredValue()\" color=\"danger\">*</ion-text>\r\n </ng-template>\r\n\r\n <ng-template ionicSelectableItemTemplate let-item=\"item\">\r\n {{ getItemTemplate(item, data, group, itemValueField, itemTextField) }}\r\n <!-- <ng-template zselectitemelement [item]=\"item\"></ng-template> -->\r\n </ng-template>\r\n\r\n <!--<ng-template ionicSelectableFooterTemplate>\r\n <ion-toolbar>\r\n <ion-row>\r\n <ion-col>\r\n <ion-button expand=\"full\" ng-reflect-disabled=\"false\" ng-reflect-expand=\"full\" class=\"button button-full button-solid ion-activatable ion-focusable hydrated\" (click)=\"clearItems()\">\r\n Clear\r\n </ion-button>\r\n </ion-col>\r\n <ion-col>\r\n <ion-button expand=\"full\" ng-reflect-disabled=\"false\" ng-reflect-expand=\"full\" class=\"button button-full button-solid ion-activatable ion-focusable hydrated\" (click)=\"confirmItems()\">\r\n OK\r\n </ion-button>\r\n </ion-col>\r\n </ion-row>\r\n </ion-toolbar>\r\n </ng-template>-->\r\n </ionic-selectable>\r\n </div>\r\n <app-uivalidationmessage [group]=\"group\" [data]=\"data\" [form]=\"form\"></app-uivalidationmessage>\r\n <!-- side by side and desktop tooltipsinfo -->\r\n <kendo-label *ngIf=\"tooltipsInfo && !showTooltipsInfoIcon && showTooltipsInfoBySide\"\r\n [text]=\"tooltipsDisplayText\"\r\n [class]=\"setTooltipsInfoClass()\"\r\n [style.color]=\"setTooltipsInfoColor()\"></kendo-label>\r\n </div>\r\n</ion-item>\r\n\r\n\r\n\r\n<ion-item [ngClass]=\"getClass(form, data)\" [formGroup]=\"form\" *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible) && !isMobileScreen()\">\r\n <ion-label [attr.for]=\"data.Value\" *ngIf=\"data.ShowLabel === undefined || data.ShowLabel\" position=\"stacked\">\r\n {{data.Label}}\r\n <ion-text *ngIf=\"(!!componentProperties.isRequiredField ? group[componentProperties.isRequiredField] : componentProperties.isRequired)\" color=\"danger\">*</ion-text>\r\n <span kendoTooltip\r\n *ngIf=\"data.TooltipsInfo && showTooltipsInfoIcon\"\r\n [title]=\"tooltipsDisplayText\">\r\n <fa-icon [icon]=\"tooltipsDisplayIcon\"\r\n class=\"tooltipsinfo-icon\">\r\n </fa-icon>\r\n </span>\r\n </ion-label>\r\n <!-- mobile tooltipsinfo below label-->\r\n <div [class]=\"setTooltipsInfoSideBySide()\">\r\n <div style=\"flex: 1;\">\r\n <kendo-combobox *ngIf=\"!data.Multiple\"\r\n #comboboxComponent\r\n [data]=\"getItemsData()\"\r\n [valueField]=\"itemValueField\"\r\n [textField]=\"itemTextField\"\r\n [formControlName]=\"data.Value\"\r\n [valuePrimitive]=\"true\"\r\n [placeholder]=\"data.PlaceHolder\"\r\n [allowCustom]=\"allowCustomValue\"\r\n [suggest]=\"true\"\r\n [filterable]=\"!!data.HasInfiniteScroll\"\r\n [openOnFocus]=\"disableOpenOnFocus(comboboxComponent)\"\r\n [readonly]=\"(!!componentProperties.isReadOnlyField ? group[componentProperties.isReadOnlyField] : componentProperties.isReadOnly)\"\r\n [ngClass]=\"{'disabled' : (!!componentProperties.isReadOnlyField ? group[componentProperties.isReadOnlyField] : componentProperties.isReadOnly)}\"\r\n [loading]=\"isLoading\"\r\n (valueChange)=\"onValueChange($event)\"\r\n (filterChange)=\"handleFilter($event)\"\r\n [virtual]=\"virtual\"\r\n (open)=\"handleOpen()\"\r\n (close)=\"handleClose()\"\r\n (blur)=\"handleBlur()\"\r\n style=\"margin-top: 7px; width: 100%;\">\r\n <ng-template kendoComboBoxItemTemplate let-dataItem>\r\n {{ getItemTemplate(dataItem, data, group, itemValueField, itemTextField) }}\r\n <!-- <span class=\"template\">{{ dataItem.value }}</span> {{ dataItem.text }} -->\r\n </ng-template>\r\n <ng-template kendoTextBoxSuffixTemplate>\r\n\r\n <!-- For Validation feature -->\r\n <app-uivalidationmessage [group]=\"group\"\r\n [data]=\"data\"\r\n [form]=\"form\"\r\n class=\"validation-icon\"></app-uivalidationmessage>\r\n </ng-template>\r\n </kendo-combobox>\r\n <kendo-multiselect *ngIf=\"data.Multiple\"\r\n [data]=\"getItemsData()\"\r\n [valueField]=\"itemValueField\"\r\n [textField]=\"itemTextField\"\r\n [formControlName]=\"data.Value\"\r\n [valuePrimitive]=\"true\"\r\n [placeholder]=\"data.PlaceHolder\"\r\n [allowCustom]=\"allowCustomValue\"\r\n [filterable]=\"!!data.HasInfiniteScroll\"\r\n [checkboxes]=\"data.EnableCheckbox\"\r\n [loading]=\"isLoading\"\r\n [autoClose]=\"autoClose\"\r\n [readonly]=\"(!!componentProperties.isReadOnlyField ? group[componentProperties.isReadOnlyField] : componentProperties.isReadOnly)\"\r\n [ngClass]=\"{'disabled' : (!!componentProperties.isReadOnlyField ? group[componentProperties.isReadOnlyField] : componentProperties.isReadOnly)}\"\r\n (valueChange)=\"onValueChange($event)\"\r\n (filterChange)=\"handleFilter($event)\"\r\n (open)=\"handleOpen()\"\r\n (close)=\"handleClose()\"\r\n (blur)=\"handleBlur()\"\r\n style=\"margin-top: 7px; width: 100%;\">\r\n <ng-template kendoMultiSelectItemTemplate let-dataItem>\r\n {{ getItemTemplate(dataItem, data, group, itemValueField, itemTextField) }}\r\n <!-- <span class=\"template\">{{ dataItem.value }}</span> {{ dataItem.text }} -->\r\n </ng-template>\r\n </kendo-multiselect>\r\n </div>\r\n\r\n <div *ngFor=\"let item of iconList\">\r\n <div kendoTooltip style=\"text-align: center; padding-top: 10px;\"\r\n showOn=\"hover\"\r\n [tooltipWidth]=\"item.Width\"\r\n [position]=\"item.Position\">\r\n <span *ngIf=\"!!item && item.Color\"\r\n (click)=\"onIconClick(item.Click)\"\r\n [title]=\"item.Tooltip\"\r\n style=\"margin-top: 10px;\">\r\n <fa-icon [icon]=\"item.Icon\"\r\n [ngStyle]=\"{'padding': '4px 6px', 'color': (item.Color ? item.Color : 'black')}\"></fa-icon>\r\n </span>\r\n </div>\r\n </div>\r\n\r\n <ion-button *ngFor=\"let button of buttonList; let i = button\"\r\n fill=\"outline\"\r\n color=\"dark\"\r\n size=\"small\"\r\n strong=\"false\"\r\n class=\"button-container\"\r\n style=\"margin-top: 7px;\"\r\n (click)=\"onIconClick(button.click)\"\r\n [hidden]=\"!button.visible\"\r\n [disabled]=\"group.isTriggered || button.disabled\">\r\n <fa-icon *ngIf=\"button.icon\" [icon]=\"getFontAwesome(button.icon)\" style=\"padding-right: 5px;\"></fa-icon>\r\n <span class=\"ion-text-capitalize\">{{ button.text }}</span>\r\n </ion-button>\r\n\r\n <app-uivalidationmessage [group]=\"group\"\r\n [data]=\"data\"\r\n [form]=\"form\"></app-uivalidationmessage>\r\n\r\n <!-- side by side and desktop tooltipsinfo -->\r\n <kendo-label *ngIf=\"tooltipsInfo && !showTooltipsInfoIcon && ((showTooltipsInfoBySide && isMobileScreen()) || !isMobileScreen())\"\r\n [text]=\"tooltipsDisplayText\"\r\n [class]=\"setTooltipsInfoClass()\"\r\n [style.color]=\"setTooltipsInfoColor()\"></kendo-label>\r\n\r\n </div>\r\n</ion-item>\r\n",
9161
9183
  styles: ["fa-icon.isItemSelected{display:inline-block;width:1em;height:1em;contain:strict;fill:currentcolor;box-sizing:initial!important;font-size:20px;margin-top:10px;margin-bottom:14px;margin-right:unset;margin-inline-end:20px}.gridInlineEdit{--background:transparent}.item.sc-ion-label-md-h,.item .sc-ion-label-md-h{font-weight:var(--z-label-weight);color:var(--z-label-color);text-shadow:var(--z-label-shadow)}.divselectmultiple{justify-content:space-between;width:100%;color:#000}.tooltipsinfo-text{margin-left:5px}.tooltipsinfo-text,.tooltipsinfo-text-wide{text-align:justify;text-justify:inter-word;word-wrap:break-word;font-size:10px;margin-top:6px}.tooltipsinfo-text-wide{width:100%;padding-bottom:5px}.tooltipsinfo-right{display:grid;grid-template-columns:1.2fr .05fr 1fr;grid-gap:0}.tooltipsinfo-icon{padding-left:10px;color:#3880ff}"]
9162
9184
  },] }
9163
9185
  ];
@@ -9171,6 +9193,7 @@
9171
9193
  group: [{ type: i0.Input }],
9172
9194
  form: [{ type: i0.Input }],
9173
9195
  iconList: [{ type: i0.Input }],
9196
+ buttonList: [{ type: i0.Input }],
9174
9197
  selectComponent: [{ type: i0.ViewChild, args: ["selectComponent",] }]
9175
9198
  };
9176
9199
 
@@ -9812,16 +9835,61 @@
9812
9835
  this.nodeCounter = 1;
9813
9836
  this.clickActName = null;
9814
9837
  this.state = { expandedkeys: [] };
9838
+ this.itemIndex = [];
9839
+ this.selectedKeys = [];
9815
9840
  this.componentProperties = new i3.ZComponentProperties();
9816
9841
  this.isExpanded = function (dataItem, index) {
9817
9842
  // console.log(index);
9818
9843
  return _this.state.expandedkeys.indexOf(index) > -1;
9819
9844
  // return true;
9820
9845
  };
9846
+ this.expandNode = function (field, value, setAsSelected) {
9847
+ _this.itemIndex = [];
9848
+ var node = _this.getItems();
9849
+ _this.searchNodeIndex(node, value, '', field);
9850
+ var index = _this.itemIndex;
9851
+ if (setAsSelected) {
9852
+ _this.selectedKeys = index;
9853
+ }
9854
+ var indexArr = [];
9855
+ index.forEach(function (i) {
9856
+ var arr = i.split('_');
9857
+ var indexs = "";
9858
+ arr.forEach(function (x) {
9859
+ indexs = indexs.concat("_").concat(x);
9860
+ indexArr.push(indexs.substring(1));
9861
+ });
9862
+ });
9863
+ _this.state.expandedkeys = _this.state.expandedkeys.concat(indexArr);
9864
+ };
9865
+ this.collapseNode = function (field, value, collapseParent) {
9866
+ _this.itemIndex = [];
9867
+ var node = _this.getItems();
9868
+ _this.searchNodeIndex(node, value, '', field);
9869
+ var index = _this.itemIndex;
9870
+ var indexArr = [];
9871
+ if (collapseParent) {
9872
+ index.forEach(function (i) {
9873
+ var arr = i.split('_');
9874
+ var indexs = "";
9875
+ arr.forEach(function (x) {
9876
+ indexs = indexs.concat("_").concat(x);
9877
+ indexArr.push(indexs.substring(1));
9878
+ });
9879
+ });
9880
+ }
9881
+ else {
9882
+ indexArr = index;
9883
+ }
9884
+ _this.state.expandedkeys = _this.state.expandedkeys.filter(function (v) {
9885
+ return !indexArr.includes(v);
9886
+ });
9887
+ };
9821
9888
  this.expandAll = function () {
9822
9889
  var node = _this.getItems();
9823
- _this.expandAllNode(node, '');
9824
- console.log(_this.state.expandedkeys);
9890
+ if (node) {
9891
+ _this.expandAllNode(node, '');
9892
+ }
9825
9893
  };
9826
9894
  this.collapseAll = function () {
9827
9895
  _this.state.expandedkeys = [];
@@ -9841,14 +9909,14 @@
9841
9909
  ZtreeComponent.prototype.ngOnInit = function () {
9842
9910
  i3.ZComponentHelper.setComponentProperties(this);
9843
9911
  i3.ZComponentHelper.registerComponent(this);
9912
+ if (this.data.TreeviewExpandAll) {
9913
+ this.expandAll();
9914
+ }
9844
9915
  };
9845
9916
  ZtreeComponent.prototype.ngAfterViewInit = function () {
9846
9917
  // const componentId = ZComponentHelper.getComponentId(this.data);
9847
9918
  // this.group.zComponents[componentId] = this;
9848
9919
  i3.ZComponentHelper.registerComponent(this);
9849
- if (this.data.TreeviewExpandAll) {
9850
- this.expandAll();
9851
- }
9852
9920
  };
9853
9921
  ZtreeComponent.prototype.getItems = function () {
9854
9922
  // if (this.modelName) {
@@ -9874,6 +9942,21 @@
9874
9942
  // console.warn('ztree field Value is not set correctly. ', fieldValue);
9875
9943
  // }
9876
9944
  };
9945
+ ZtreeComponent.prototype.searchNodeIndex = function (node, value, key, field) {
9946
+ var _this = this;
9947
+ if (key) {
9948
+ key = key + '_';
9949
+ }
9950
+ node.forEach(function (d, i) {
9951
+ if (d[field] === Number(value) || d[field] === value) {
9952
+ _this.itemIndex = _this.itemIndex.concat(key + '' + i);
9953
+ }
9954
+ if (Array.isArray(d.Value)) {
9955
+ var k = key + '' + i;
9956
+ _this.searchNodeIndex(d.Value, value, k, field);
9957
+ }
9958
+ });
9959
+ };
9877
9960
  ZtreeComponent.prototype.expandAllNode = function (node, key) {
9878
9961
  var _this = this;
9879
9962
  if (key) {
@@ -10098,7 +10181,7 @@
10098
10181
  ZtreeComponent.decorators = [
10099
10182
  { type: i0.Component, args: [{
10100
10183
  selector: "app-ztree",
10101
- template: "<div style=\"width:100%\"\r\n *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\">\r\n <kendo-treeview [nodes]=\"getItems()\"\r\n kendoTreeViewExpandable\r\n kendoTreeViewSelectable\r\n kendoTreeViewDragAndDrop\r\n kendoTreeViewDragAndDropEditing\r\n [isExpanded]=\"isExpanded\"\r\n (collapse)=\"handleCollapse($event)\"\r\n (expand)=\"handleExpand($event)\"\r\n (nodeDrop)=\"handleNodeDrop($event)\"\r\n (nodeDragEnd)=\"handleNodeDragEnd($event)\"\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n kendoTreeViewHierarchyBinding\r\n childrenField=\"Value\"\r\n [filterable]=\"data.Filterable\"\r\n textField=\"Name\"\r\n (filterChange)=\"handleFilter($event)\">\r\n\r\n <ng-template kendoTreeViewNodeTemplate let-dataItem #nodetemplate>\r\n\r\n <ion-button *ngIf=\"!!data.OnAddNode\"\r\n (click)=\"onAddNode($event, dataItem, data, group)\"\r\n style=\"zoom: 0.6;margin: 0 0 0 2px;\" mat-raised-button color=\"primary\" size=\"medium\"\r\n [hidden]=\"(!!dataItem.OnAddNodeVisible)\">\r\n <!-- <ion-icon name=\"add\" slot=\"icon-only\"></ion-icon> -->\r\n <fa-icon [icon]=\"'plus'\"></fa-icon>\r\n </ion-button>\r\n <ion-button *ngIf=\"!!data.OnRemoveNode\" (click)=\"onRemoveNode($event, dataItem, data, group)\"\r\n style=\"zoom: 0.6;margin: 0 15px 0 10px;\" color=\"danger\" mat-raised-button size=\"medium\"\r\n [hidden]=\"(!!dataItem.OnRemoveNodeVisible)\">\r\n <!-- <ion-icon name=\"close\" slot=\"icon-only\"></ion-icon> -->\r\n <fa-icon [icon]=\"'minus'\"></fa-icon>\r\n </ion-button>\r\n\r\n {{ getTemplate(dataItem, data, group) }}\r\n\r\n </ng-template>\r\n </kendo-treeview>\r\n</div>\r\n",
10184
+ template: "<div style=\"width:100%\"\r\n *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\">\r\n <kendo-treeview [nodes]=\"getItems()\"\r\n kendoTreeViewExpandable\r\n kendoTreeViewSelectable\r\n kendoTreeViewDragAndDrop\r\n kendoTreeViewDragAndDropEditing\r\n [isExpanded]=\"isExpanded\"\r\n (collapse)=\"handleCollapse($event)\"\r\n (expand)=\"handleExpand($event)\"\r\n (nodeDrop)=\"handleNodeDrop($event)\"\r\n (nodeDragEnd)=\"handleNodeDragEnd($event)\"\r\n (selectionChange)=\"onSelectionChange($event)\"\r\n [selectedKeys]=\"selectedKeys\"\r\n kendoTreeViewHierarchyBinding\r\n childrenField=\"Value\"\r\n [filterable]=\"data.Filterable\"\r\n textField=\"Name\"\r\n (filterChange)=\"handleFilter($event)\">\r\n\r\n <ng-template kendoTreeViewNodeTemplate let-dataItem #nodetemplate>\r\n\r\n <ion-button *ngIf=\"!!data.OnAddNode\"\r\n (click)=\"onAddNode($event, dataItem, data, group)\"\r\n style=\"zoom: 0.6;margin: 0 0 0 2px;\" mat-raised-button color=\"primary\" size=\"medium\"\r\n [hidden]=\"(!!dataItem.OnAddNodeVisible)\">\r\n <!-- <ion-icon name=\"add\" slot=\"icon-only\"></ion-icon> -->\r\n <fa-icon [icon]=\"'plus'\"></fa-icon>\r\n </ion-button>\r\n <ion-button *ngIf=\"!!data.OnRemoveNode\" (click)=\"onRemoveNode($event, dataItem, data, group)\"\r\n style=\"zoom: 0.6;margin: 0 15px 0 10px;\" color=\"danger\" mat-raised-button size=\"medium\"\r\n [hidden]=\"(!!dataItem.OnRemoveNodeVisible)\">\r\n <!-- <ion-icon name=\"close\" slot=\"icon-only\"></ion-icon> -->\r\n <fa-icon [icon]=\"'minus'\"></fa-icon>\r\n </ion-button>\r\n\r\n {{ getTemplate(dataItem, data, group) }}\r\n\r\n </ng-template>\r\n </kendo-treeview>\r\n</div>\r\n",
10102
10185
  styles: [":host{--ion-color-primary:#479400;--ion-color-primary-rgb:56,128,255;--ion-color-primary-contrast:#fff;--ion-color-primary-contrast-rgb:255,255,255;--ion-color-primary-shade:#3171e0;--ion-color-primary-tint:#4c8dff}:host ::ng-deep .k-treeview .k-in{border-radius:2px;border:1px solid #c8dbf5;background-color:#e3ecf8}:host ::ng-deep .k-treeview .k-in,:host ::ng-deep .k-treeview .k-in.k-state-selected{width:100%;margin:5px;padding:9px 20px 9px 8px;color:#0a45ab;font-size:13px;cursor:pointer}:host ::ng-deep .k-treeview .k-in.k-state-selected{border-radius:2px;background-color:#a9c3e8}:host ::ng-deep .k-treeview .k-in.k-state-hover,:host ::ng-deep .k-treeview .k-in:hover{width:100%;margin:5px;padding:9px 20px 9px 8px;border-radius:2px;background-color:#c9daf2;color:#0a45ab;font-size:13px;cursor:pointer}"]
10103
10186
  },] }
10104
10187
  ];
@@ -10758,45 +10841,86 @@
10758
10841
  };
10759
10842
  }
10760
10843
  ZudfComponent.prototype.ngOnInit = function () {
10761
- var _this = this;
10762
10844
  i3.ZComponentHelper.setComponentProperties(this);
10763
10845
  i3.ZComponentHelper.registerComponent(this);
10846
+ // keep data Value
10847
+ this.initialDataValue = this.data.Value;
10848
+ if (i3.ZComponentHelper.isNullUndefinedEmpty(this.data.Value)) {
10849
+ this.loadEmptyForm();
10850
+ }
10851
+ else {
10852
+ this.loadZudfForm();
10853
+ }
10854
+ };
10855
+ ZudfComponent.prototype.loadEmptyForm = function () {
10856
+ var _this = this;
10857
+ rxjs.of(true).pipe(operators.tap(function () {
10858
+ _this.data.SubType = 'zudf';
10859
+ // change the value to the result field form
10860
+ _this.data.Value = [];
10861
+ // change zudf to zdiv
10862
+ //this.data.Type = 'zdiv';
10863
+ }), operators.tap(function () {
10864
+ if (!_this.group['_zudf_' + _this.data.Name]) {
10865
+ _this.group['_zudf_' + _this.data.Name] = new i3.ZGroup;
10866
+ }
10867
+ var grp = _this.group['_zudf_' + _this.data.Name];
10868
+ grp.zModel = {};
10869
+ // create as new Form Group
10870
+ _this.form = _this.toFormGroup(_this.data.Value);
10871
+ // set to zGroup scope
10872
+ grp.form = _this.form;
10873
+ }), operators.tap(function () {
10874
+ // set to formField for display
10875
+ _this.formField = _this.data.Value;
10876
+ })).subscribe(function () {
10877
+ // set Field div class
10878
+ i3.ZComponentHelper.setFieldsDivClass(_this.group._projectName, _this.group.fieldName, _this.data, _this.authService);
10879
+ });
10880
+ };
10881
+ ZudfComponent.prototype.loadZudfForm = function () {
10882
+ var _this = this;
10764
10883
  rxjs.of(true).pipe(operators.concatMap(function (fieldElements) {
10765
10884
  var asyncSubject = new rxjs.AsyncSubject();
10766
10885
  _this.fieldService.getFormFieldCode(_this.data.Value, 'FormField', _this, 'fields').pipe(operators.map(function (formFieldResult) {
10767
10886
  // rename add prefix to all udf field to prevent duplicate from main form
10768
- _this.appendPrefix(formFieldResult, 'zudf');
10887
+ _this.appendPrefix(formFieldResult, 'zudf_' + _this.data.Name);
10769
10888
  // change the value to the result field form
10770
10889
  _this.data.Value = formFieldResult;
10771
10890
  // change zudf to zdiv
10772
- _this.data.Type = 'zdiv';
10891
+ //this.data.Type = 'zdiv';
10773
10892
  // end subject
10774
10893
  asyncSubject.next(true);
10775
10894
  asyncSubject.complete();
10776
10895
  })).subscribe();
10777
10896
  return asyncSubject.asObservable();
10778
10897
  }), operators.tap(function () {
10779
- if (!_this.group._zudf) {
10780
- _this.group._zudf = new i3.ZGroup;
10898
+ if (!_this.group['_zudf_' + _this.data.Name]) {
10899
+ _this.group['_zudf_' + _this.data.Name] = new i3.ZGroup;
10781
10900
  }
10782
- _this.group._zudf.zModel = {};
10901
+ var grp = _this.group['_zudf_' + _this.data.Name];
10902
+ grp.zModel = {};
10783
10903
  // create as new Form Group
10784
10904
  _this.form = _this.toFormGroup(_this.data.Value);
10785
10905
  // set to zGroup scope
10786
- _this.group._zudf.form = _this.form;
10906
+ grp.form = _this.form;
10787
10907
  }), operators.tap(function () {
10788
10908
  // set to formField for display
10789
10909
  _this.formField = _this.data.Value;
10790
10910
  })).subscribe(function () {
10791
10911
  // set Field div class
10792
10912
  i3.ZComponentHelper.setFieldsDivClass(_this.group._projectName, _this.group.fieldName, _this.data, _this.authService);
10793
- // get saved record
10794
- _this.getFormFieldzModel();
10913
+ // TODO: get saved record
10914
+ //this.getFormFieldzModel();
10915
+ // change back the data.Value
10916
+ if (_this.data['DisableReplaceValue']) {
10917
+ _this.data.Value = _this.initialDataValue;
10918
+ }
10795
10919
  });
10796
10920
  };
10797
10921
  ZudfComponent.prototype.getFormFieldzModel = function () {
10798
- var form = this.group._zudf.form;
10799
- var zModel = this.group._zudf.zModel;
10922
+ var form = this.group['_zudf_' + this.data.Name].form;
10923
+ var zModel = this.group['_zudf_' + this.data.Name].zModel;
10800
10924
  var url = this.resourceApiService.getURL('field');
10801
10925
  var respData = { 'parentFormId': 5722, 'zudf_Name': 'test' };
10802
10926
  Object.assign(zModel, respData);
@@ -10835,10 +10959,10 @@
10835
10959
  var isRequired = i3.ZComponentHelper.isRequiredFormControl(_this, field);
10836
10960
  if (isFormControl === true) {
10837
10961
  var validators = i3.ZComponentHelper.getValidators(field, isVisible, isRequired);
10838
- formControls[field.Value] = new forms.FormControl(_this.group._zudf.zModel[field.Value], validators);
10962
+ formControls[field.Value] = new forms.FormControl(_this.group['_zudf_' + _this.data.Name].zModel[field.Value], validators);
10839
10963
  if (i3.ZComponentHelper.hasCCField(field.Type)) {
10840
10964
  var ccValidators = i3.ZComponentHelper.getCCValidators(field, isVisible, isRequired);
10841
- formControls[field.CCValue] = new forms.FormControl(_this.group._zudf.zModel[field.CCValue], ccValidators);
10965
+ formControls[field.CCValue] = new forms.FormControl(_this.group['_zudf_' + _this.data.Name].zModel[field.CCValue], ccValidators);
10842
10966
  }
10843
10967
  }
10844
10968
  }
@@ -10863,13 +10987,25 @@
10863
10987
  ZudfComponent.prototype.ComponentIsVisible = function (field) {
10864
10988
  return i3.ZComponentHelper.ComponentIsVisible(field, this.group);
10865
10989
  };
10990
+ ZudfComponent.prototype.appendFormControl = function (zudfControlName, zudfControl, fieldData) {
10991
+ this.form.addControl(zudfControlName, zudfControl);
10992
+ this.formField.push(fieldData);
10993
+ };
10994
+ ZudfComponent.prototype.clearFormControl = function () {
10995
+ var _this = this;
10996
+ this.formField.forEach(function (data) {
10997
+ _this.form.removeControl(data.Value);
10998
+ });
10999
+ this.data.Value = this.initialDataValue;
11000
+ this.formField = [];
11001
+ };
10866
11002
  return ZudfComponent;
10867
11003
  }());
10868
11004
  ZudfComponent.decorators = [
10869
11005
  { type: i0.Component, args: [{
10870
11006
  selector: 'app-zudf',
10871
- template: "<div *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\" class=\"ion-row\">\r\n\r\n <app-zformcontrol [ngClass]=\"group[field.isVisibleField] ? field.DivClass : ((field.Visible === true) ? field.DivClass : 'flex-hide')\"\r\n *ngFor=\"let field of formField | divzlayout: data.zlayout\"\r\n [field]=\"field\"\r\n [group]=\"group\"\r\n [form]=\"form\"\r\n id=\"zudf-{{field.Type}}-{{field.Name}}\">\r\n </app-zformcontrol> \r\n</div>\r\n",
10872
- styles: ["#div1,#div2{float:left;width:100px;height:35px;margin:10px;padding:10px;border:1px solid #000}"]
11007
+ template: "<div style=\"padding: 15px\" *ngIf=\"data.Title && (!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\" class=\"ion-row\">\r\n <kendo-card *ngIf=\"data.Title\" width=\"100%\" >\r\n <kendo-card-header >\r\n <div>\r\n <ion-label class=\"card-header-title\">{{data.Title}}</ion-label>\r\n </div>\r\n </kendo-card-header>\r\n <kendo-card-body>\r\n <div class=\"ion-row\">\r\n <app-zformcontrol [ngClass]=\"group[field.isVisibleField] ? field.DivClass : ((field.Visible === true) ? field.DivClass : 'flex-hide')\"\r\n *ngFor=\"let field of formField | divzlayout: data.zlayout\"\r\n [field]=\"field\"\r\n [group]=\"group\"\r\n [form]=\"form\"\r\n id=\"zudf{{data.Name}}-{{field.Type}}-{{field.Name}}\">\r\n </app-zformcontrol>\r\n </div>\r\n </kendo-card-body> \r\n </kendo-card>\r\n</div>\r\n\r\n<div *ngIf=\"!data.Title && (!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\" class=\"ion-row\">\r\n <app-zformcontrol [ngClass]=\"group[field.isVisibleField] ? field.DivClass : ((field.Visible === true) ? field.DivClass : 'flex-hide')\"\r\n *ngFor=\"let field of formField | divzlayout: data.zlayout\"\r\n [field]=\"field\"\r\n [group]=\"group\"\r\n [form]=\"form\"\r\n id=\"zudf{{data.Name}}-{{field.Type}}-{{field.Name}}\">\r\n </app-zformcontrol>\r\n</div>\r\n",
11008
+ styles: [".card-header-title{color:#fff!important;font-weight:500;font-size:11pt}"]
10873
11009
  },] }
10874
11010
  ];
10875
11011
  ZudfComponent.ctorParameters = function () { return [