mmhglobal-dynamicform 2.11.2 → 2.11.3

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.
@@ -86,8 +86,8 @@ import { trigger, transition, style, animate } from '@angular/animations';
86
86
  import * as i3$8 from '@progress/kendo-angular-toolbar';
87
87
  import { MultiSelect, DropDownList } from '@syncfusion/ej2-dropdowns';
88
88
  import { createElement, getComponent } from '@syncfusion/ej2-base';
89
- import { CheckBox } from '@syncfusion/ej2-buttons';
90
89
  import { Query } from '@syncfusion/ej2-data';
90
+ import { CheckBox } from '@syncfusion/ej2-buttons';
91
91
 
92
92
  /********** Angular **********/
93
93
  class ZComponentService {
@@ -12994,10 +12994,6 @@ class SfquerybuilderComponent {
12994
12994
  this.qbItems = {};
12995
12995
  this.componentProperties = new ZComponentProperties();
12996
12996
  this.issfLoaded = false;
12997
- //public currentConfig: QueryBuilderConfig = {
12998
- // fields: {},
12999
- // allowEmptyRulesets: true
13000
- //};
13001
12997
  this.allowRuleset = true;
13002
12998
  this.allowCollapse = false;
13003
12999
  this.persistValueOnFieldChange = false;
@@ -13005,6 +13001,7 @@ class SfquerybuilderComponent {
13005
13001
  this.displayRule = '';
13006
13002
  this.loadedDropdownOptions = [];
13007
13003
  this.sdFilter = [];
13004
+ //#region Operator
13008
13005
  this.equalOperator = { value: 'equal', key: 'Equals' };
13009
13006
  this.notequalOperator = { value: 'notequal', key: 'Not Equals' };
13010
13007
  this.startswithOperator = { value: 'startswith', key: 'Start With' };
@@ -13066,6 +13063,7 @@ class SfquerybuilderComponent {
13066
13063
  this.isnullOperator,
13067
13064
  this.isnotnullOperator
13068
13065
  ];
13066
+ //#endregion
13069
13067
  this.selectionComponentList = [];
13070
13068
  }
13071
13069
  ngOnInit() {
@@ -13085,6 +13083,18 @@ class SfquerybuilderComponent {
13085
13083
  //this.issfLoaded = true;
13086
13084
  });
13087
13085
  }
13086
+ beforeLoadField(fieldElementData) {
13087
+ let beforeLoadField = fieldElementData['BeforeLoadField'];
13088
+ if (beforeLoadField) {
13089
+ beforeLoadField = beforeLoadField.replace('modalGroup.', 'group.');
13090
+ const callFunc = eval('this.' + beforeLoadField);
13091
+ if (typeof callFunc === "function") {
13092
+ const newFunc = callFunc.bind(this);
13093
+ return newFunc(event, this, fieldElementData);
13094
+ }
13095
+ }
13096
+ return of(fieldElementData);
13097
+ }
13088
13098
  loadQueryBuilder() {
13089
13099
  if (this.data['AllowCollapse'] === true) {
13090
13100
  this.allowCollapse = this.data['AllowCollapse'];
@@ -13097,14 +13107,9 @@ class SfquerybuilderComponent {
13097
13107
  }
13098
13108
  this.fields = this.fieldService.getFormFieldCode(this.data.Value, "FormField", null, null);
13099
13109
  try {
13100
- let isGrouped = true;
13101
13110
  return this.fields.pipe(tap$1((data) => {
13102
- // if [isGrouped = true] include grouping name as prefix
13103
- if (data.length > 1) {
13104
- isGrouped = false;
13105
- }
13106
13111
  data.forEach(async (field) => {
13107
- this.renderComponentType(field, isGrouped);
13112
+ this.renderComponentType(field);
13108
13113
  }); //end foreach
13109
13114
  this.issfLoaded = true;
13110
13115
  }));
@@ -13115,9 +13120,9 @@ class SfquerybuilderComponent {
13115
13120
  return of(false);
13116
13121
  }
13117
13122
  }
13118
- async renderComponentType(field, isGrouped, fieldTitle) {
13123
+ async renderComponentType(field, fieldTitle) {
13119
13124
  let componentLabel = field.SubType ? field.Label : field.Label ?? field.Name;
13120
- componentLabel = !isGrouped && !ZComponentHelper.isNullUndefinedEmpty(fieldTitle) ? "[" + fieldTitle + "] " + field.Label : !ZComponentHelper.isNullUndefinedEmpty(field.Label) ? field.Label : field.Name;
13125
+ componentLabel = !ZComponentHelper.isNullUndefinedEmpty(fieldTitle) ? "[" + fieldTitle + "] " + field.Label : !ZComponentHelper.isNullUndefinedEmpty(field.Label) ? field.Label : field.Name;
13121
13126
  let componentField = !ZComponentHelper.isNullUndefinedEmpty(fieldTitle) ? fieldTitle + "_" + field.Value : field.Value;
13122
13127
  if (field.Type === 'category' || field.Type === 'multiselect' || field.Type === 'zuiselectmultiple') {
13123
13128
  this.sdFilter.push({
@@ -13156,7 +13161,7 @@ class SfquerybuilderComponent {
13156
13161
  else if (field.Type === 'kcard') {
13157
13162
  if (field.Value.length > 0) {
13158
13163
  field.Value.forEach(async (item) => {
13159
- this.renderComponentType(item, isGrouped, field.Title);
13164
+ this.renderComponentType(item, field.Title);
13160
13165
  });
13161
13166
  }
13162
13167
  }
@@ -13170,7 +13175,7 @@ class SfquerybuilderComponent {
13170
13175
  }
13171
13176
  this.sdFilter.sort((a, b) => a.label.toLowerCase() < b.label.toLowerCase() ? -1 : 1);
13172
13177
  }
13173
- //#region checkbox
13178
+ //#region Generate component
13174
13179
  generateColumnCheckbox(label, value) {
13175
13180
  return {
13176
13181
  create: () => {
@@ -13191,8 +13196,6 @@ class SfquerybuilderComponent {
13191
13196
  }
13192
13197
  };
13193
13198
  }
13194
- //#endregion
13195
- //#region dropdown/multiselect
13196
13199
  generateColumnSelection(fieldElementData) {
13197
13200
  return {
13198
13201
  // Creates the custom component
@@ -13201,8 +13204,7 @@ class SfquerybuilderComponent {
13201
13204
  if (this.data['Filters']) {
13202
13205
  this.filters = ZComponentHelper.getGroupEvalValue.call(this, this.data['Filters'], this.group);
13203
13206
  }
13204
- //return createElement('input', { attrs: { 'type': 'text', 'style': 'display: none' } });
13205
- return createElement('input', { attrs: { 'type': 'text' } });
13207
+ return createElement('input', { attrs: { 'type': 'text' } }); // 'display: none'
13206
13208
  },
13207
13209
  // Destroy the custom component
13208
13210
  destroy: (args) => {
@@ -13282,9 +13284,6 @@ class SfquerybuilderComponent {
13282
13284
  });
13283
13285
  const selectionComponent = this.generateSelectionComponent(args, optionList);
13284
13286
  selectionComponent.appendTo('#' + args.elements.id);
13285
- //const xxx = document.getElementById(args.elements.id);
13286
- ////xxx.appendChild(inputElement);
13287
- //xxx.style.display = 'block';
13288
13287
  //#region used for updateSelectionOption
13289
13288
  const existingIndex = this.selectionComponentList.findIndex((item) => item.componentId === args.elements.id);
13290
13289
  if (existingIndex !== -1) {
@@ -13438,10 +13437,6 @@ class SfquerybuilderComponent {
13438
13437
  }
13439
13438
  ;
13440
13439
  setQueryValue(savedData) {
13441
- //if (!this.qryBldrObj) {
13442
- // console.warn('query builder object is null.');
13443
- // return;
13444
- //}
13445
13440
  if (savedData) {
13446
13441
  this.qryBldrObj.setRules(savedData);
13447
13442
  this.updateRule({ rule: savedData });
@@ -13456,18 +13451,6 @@ class SfquerybuilderComponent {
13456
13451
  onChange() {
13457
13452
  this.updateRule({ rule: this.qryBldrObj.getValidRules(this.qryBldrObj.rule) });
13458
13453
  }
13459
- beforeLoadField(fieldElementData) {
13460
- let beforeLoadField = fieldElementData['BeforeLoadField'];
13461
- if (beforeLoadField) {
13462
- beforeLoadField = beforeLoadField.replace('modalGroup.', 'group.');
13463
- const callFunc = eval('this.' + beforeLoadField);
13464
- if (typeof callFunc === "function") {
13465
- const newFunc = callFunc.bind(this);
13466
- return newFunc(event, this, fieldElementData);
13467
- }
13468
- }
13469
- return of(fieldElementData);
13470
- }
13471
13454
  }
13472
13455
  SfquerybuilderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SfquerybuilderComponent, deps: [{ token: i2.FieldService }, { token: i2.ResourceApiService }, { token: i2.WebApiService }], target: i0.ɵɵFactoryTarget.Component });
13473
13456
  SfquerybuilderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: SfquerybuilderComponent, selector: "app-sfquerybuilder", inputs: { data: "data", group: "group", form: "form" }, viewQueries: [{ propertyName: "qryBldrObj", first: true, predicate: ["querybuilder"], descendants: true }], ngImport: i0, template: "<ion-item *ngIf=\"(!!componentProperties.isVisibleField ? group[componentProperties.isVisibleField] : componentProperties.isVisible)\">\r\n <div class=\"qbcontainer\">\r\n <ejs-querybuilder *ngIf=\"issfLoaded\"\r\n #querybuilder\r\n width=\"100%\"\r\n [dataSource]=\"sfData\"\r\n [columns]=\"sdFilter\"\r\n [rule]=\"importRules\"\r\n (ruleChange)=\"updateRule($event)\"\r\n (created)=\"onChange()\">\r\n </ejs-querybuilder>\r\n\r\n <div *ngIf=\"!data.HideShowResultPanel\">\r\n <br>\r\n <ion-label>Result</ion-label>\r\n <textarea class=\"output\"\r\n resizable=\"none\"\r\n [rows]=\"10\"\r\n style=\"border: 1px solid #d3d3d3; width: 100%;\">{{displayRule}}</textarea>\r\n </div>\r\n </div>\r\n</ion-item>\r\n", styles: [".qbcontainer{border-radius:5px;border:1px solid rgba(0,0,0,.08);padding:10px;margin:10px 0;width:100%}#querybuilder .e-slider-container.e-control-wrapper{height:0}ejs-querybuilder{display:block}.e-query-builder{margin:0 auto;display:block;background-color:#fff;border-color:#e0e0e0}.highcontrast textarea#ruleContent{background-color:#000}.e-query-builder .e-group-body .e-rule-container{box-shadow:0 2px 6px #d3d3d3;height:auto;margin-top:0;padding-right:12px;border:none;border-color:none}.e-bigger.e-small .e-ddl.e-popup .e-list-item,.e-bigger.e-small .e-ddl.e-popup .e-list-group-item,.e-bigger.e-small .e-ddl.e-popup .e-fixed-head{font-size:14px;line-height:34px;padding-left:0;text-indent:16px}.e-query-builder .e-group-body .e-rule-container .e-rule-filter,.e-query-builder .e-group-body .e-rule-container .e-value{width:40%!important}.e-query-builder .e-group-body .e-rule-container .e-operator{width:15%!important}\n"], components: [{ type: i2$1.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { type: i3$b.QueryBuilderComponent, selector: "ejs-querybuilder", inputs: ["allowValidation", "columns", "cssClass", "dataSource", "displayMode", "enableNotCondition", "enablePersistence", "enableRtl", "fieldMode", "fieldModel", "headerTemplate", "height", "immediateModeDelay", "locale", "matchCase", "maxGroupCount", "operatorModel", "readonly", "rule", "separator", "showButtons", "sortDirection", "summaryView", "valueModel", "width"], outputs: ["actionBegin", "beforeChange", "change", "created", "dataBound", "ruleChange"] }, { type: i2$1.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }], directives: [{ type: i5$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });