mmhglobal-dynamicform 2.11.1 → 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.
- package/README.md +9 -1
- package/esm2020/lib/sfquerybuilder/sfquerybuilder.component.mjs +25 -42
- package/fesm2015/mmhglobal-dynamicform.mjs +24 -41
- package/fesm2015/mmhglobal-dynamicform.mjs.map +1 -1
- package/fesm2020/mmhglobal-dynamicform.mjs +24 -41
- package/fesm2020/mmhglobal-dynamicform.mjs.map +1 -1
- package/lib/sfquerybuilder/sfquerybuilder.component.d.ts +2 -2
- package/package.json +1 -1
|
@@ -87,8 +87,8 @@ import { trigger, transition, style, animate } from '@angular/animations';
|
|
|
87
87
|
import * as i3$8 from '@progress/kendo-angular-toolbar';
|
|
88
88
|
import { MultiSelect, DropDownList } from '@syncfusion/ej2-dropdowns';
|
|
89
89
|
import { createElement, getComponent } from '@syncfusion/ej2-base';
|
|
90
|
-
import { CheckBox } from '@syncfusion/ej2-buttons';
|
|
91
90
|
import { Query } from '@syncfusion/ej2-data';
|
|
91
|
+
import { CheckBox } from '@syncfusion/ej2-buttons';
|
|
92
92
|
|
|
93
93
|
/********** Angular **********/
|
|
94
94
|
class ZComponentService {
|
|
@@ -13020,10 +13020,6 @@ class SfquerybuilderComponent {
|
|
|
13020
13020
|
this.qbItems = {};
|
|
13021
13021
|
this.componentProperties = new ZComponentProperties();
|
|
13022
13022
|
this.issfLoaded = false;
|
|
13023
|
-
//public currentConfig: QueryBuilderConfig = {
|
|
13024
|
-
// fields: {},
|
|
13025
|
-
// allowEmptyRulesets: true
|
|
13026
|
-
//};
|
|
13027
13023
|
this.allowRuleset = true;
|
|
13028
13024
|
this.allowCollapse = false;
|
|
13029
13025
|
this.persistValueOnFieldChange = false;
|
|
@@ -13031,6 +13027,7 @@ class SfquerybuilderComponent {
|
|
|
13031
13027
|
this.displayRule = '';
|
|
13032
13028
|
this.loadedDropdownOptions = [];
|
|
13033
13029
|
this.sdFilter = [];
|
|
13030
|
+
//#region Operator
|
|
13034
13031
|
this.equalOperator = { value: 'equal', key: 'Equals' };
|
|
13035
13032
|
this.notequalOperator = { value: 'notequal', key: 'Not Equals' };
|
|
13036
13033
|
this.startswithOperator = { value: 'startswith', key: 'Start With' };
|
|
@@ -13092,6 +13089,7 @@ class SfquerybuilderComponent {
|
|
|
13092
13089
|
this.isnullOperator,
|
|
13093
13090
|
this.isnotnullOperator
|
|
13094
13091
|
];
|
|
13092
|
+
//#endregion
|
|
13095
13093
|
this.selectionComponentList = [];
|
|
13096
13094
|
}
|
|
13097
13095
|
ngOnInit() {
|
|
@@ -13111,6 +13109,18 @@ class SfquerybuilderComponent {
|
|
|
13111
13109
|
//this.issfLoaded = true;
|
|
13112
13110
|
});
|
|
13113
13111
|
}
|
|
13112
|
+
beforeLoadField(fieldElementData) {
|
|
13113
|
+
let beforeLoadField = fieldElementData['BeforeLoadField'];
|
|
13114
|
+
if (beforeLoadField) {
|
|
13115
|
+
beforeLoadField = beforeLoadField.replace('modalGroup.', 'group.');
|
|
13116
|
+
const callFunc = eval('this.' + beforeLoadField);
|
|
13117
|
+
if (typeof callFunc === "function") {
|
|
13118
|
+
const newFunc = callFunc.bind(this);
|
|
13119
|
+
return newFunc(event, this, fieldElementData);
|
|
13120
|
+
}
|
|
13121
|
+
}
|
|
13122
|
+
return of(fieldElementData);
|
|
13123
|
+
}
|
|
13114
13124
|
loadQueryBuilder() {
|
|
13115
13125
|
if (this.data['AllowCollapse'] === true) {
|
|
13116
13126
|
this.allowCollapse = this.data['AllowCollapse'];
|
|
@@ -13123,14 +13133,9 @@ class SfquerybuilderComponent {
|
|
|
13123
13133
|
}
|
|
13124
13134
|
this.fields = this.fieldService.getFormFieldCode(this.data.Value, "FormField", null, null);
|
|
13125
13135
|
try {
|
|
13126
|
-
let isGrouped = true;
|
|
13127
13136
|
return this.fields.pipe(tap$1((data) => {
|
|
13128
|
-
// if [isGrouped = true] include grouping name as prefix
|
|
13129
|
-
if (data.length > 1) {
|
|
13130
|
-
isGrouped = false;
|
|
13131
|
-
}
|
|
13132
13137
|
data.forEach((field) => __awaiter(this, void 0, void 0, function* () {
|
|
13133
|
-
this.renderComponentType(field
|
|
13138
|
+
this.renderComponentType(field);
|
|
13134
13139
|
})); //end foreach
|
|
13135
13140
|
this.issfLoaded = true;
|
|
13136
13141
|
}));
|
|
@@ -13141,11 +13146,11 @@ class SfquerybuilderComponent {
|
|
|
13141
13146
|
return of(false);
|
|
13142
13147
|
}
|
|
13143
13148
|
}
|
|
13144
|
-
renderComponentType(field,
|
|
13149
|
+
renderComponentType(field, fieldTitle) {
|
|
13145
13150
|
var _a;
|
|
13146
13151
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13147
13152
|
let componentLabel = field.SubType ? field.Label : (_a = field.Label) !== null && _a !== void 0 ? _a : field.Name;
|
|
13148
|
-
componentLabel = !
|
|
13153
|
+
componentLabel = !ZComponentHelper.isNullUndefinedEmpty(fieldTitle) ? "[" + fieldTitle + "] " + field.Label : !ZComponentHelper.isNullUndefinedEmpty(field.Label) ? field.Label : field.Name;
|
|
13149
13154
|
let componentField = !ZComponentHelper.isNullUndefinedEmpty(fieldTitle) ? fieldTitle + "_" + field.Value : field.Value;
|
|
13150
13155
|
if (field.Type === 'category' || field.Type === 'multiselect' || field.Type === 'zuiselectmultiple') {
|
|
13151
13156
|
this.sdFilter.push({
|
|
@@ -13184,11 +13189,11 @@ class SfquerybuilderComponent {
|
|
|
13184
13189
|
else if (field.Type === 'kcard') {
|
|
13185
13190
|
if (field.Value.length > 0) {
|
|
13186
13191
|
field.Value.forEach((item) => __awaiter(this, void 0, void 0, function* () {
|
|
13187
|
-
this.renderComponentType(item,
|
|
13192
|
+
this.renderComponentType(item, field.Title);
|
|
13188
13193
|
}));
|
|
13189
13194
|
}
|
|
13190
13195
|
}
|
|
13191
|
-
else {
|
|
13196
|
+
else if (field.Type != 'zlabel') {
|
|
13192
13197
|
this.sdFilter.push({
|
|
13193
13198
|
field: componentField,
|
|
13194
13199
|
label: componentLabel,
|
|
@@ -13199,7 +13204,7 @@ class SfquerybuilderComponent {
|
|
|
13199
13204
|
this.sdFilter.sort((a, b) => a.label.toLowerCase() < b.label.toLowerCase() ? -1 : 1);
|
|
13200
13205
|
});
|
|
13201
13206
|
}
|
|
13202
|
-
//#region
|
|
13207
|
+
//#region Generate component
|
|
13203
13208
|
generateColumnCheckbox(label, value) {
|
|
13204
13209
|
return {
|
|
13205
13210
|
create: () => {
|
|
@@ -13220,8 +13225,6 @@ class SfquerybuilderComponent {
|
|
|
13220
13225
|
}
|
|
13221
13226
|
};
|
|
13222
13227
|
}
|
|
13223
|
-
//#endregion
|
|
13224
|
-
//#region dropdown/multiselect
|
|
13225
13228
|
generateColumnSelection(fieldElementData) {
|
|
13226
13229
|
return {
|
|
13227
13230
|
// Creates the custom component
|
|
@@ -13230,8 +13233,7 @@ class SfquerybuilderComponent {
|
|
|
13230
13233
|
if (this.data['Filters']) {
|
|
13231
13234
|
this.filters = ZComponentHelper.getGroupEvalValue.call(this, this.data['Filters'], this.group);
|
|
13232
13235
|
}
|
|
13233
|
-
|
|
13234
|
-
return createElement('input', { attrs: { 'type': 'text' } });
|
|
13236
|
+
return createElement('input', { attrs: { 'type': 'text' } }); // 'display: none'
|
|
13235
13237
|
},
|
|
13236
13238
|
// Destroy the custom component
|
|
13237
13239
|
destroy: (args) => {
|
|
@@ -13312,9 +13314,6 @@ class SfquerybuilderComponent {
|
|
|
13312
13314
|
});
|
|
13313
13315
|
const selectionComponent = this.generateSelectionComponent(args, optionList);
|
|
13314
13316
|
selectionComponent.appendTo('#' + args.elements.id);
|
|
13315
|
-
//const xxx = document.getElementById(args.elements.id);
|
|
13316
|
-
////xxx.appendChild(inputElement);
|
|
13317
|
-
//xxx.style.display = 'block';
|
|
13318
13317
|
//#region used for updateSelectionOption
|
|
13319
13318
|
const existingIndex = this.selectionComponentList.findIndex((item) => item.componentId === args.elements.id);
|
|
13320
13319
|
if (existingIndex !== -1) {
|
|
@@ -13468,10 +13467,6 @@ class SfquerybuilderComponent {
|
|
|
13468
13467
|
}
|
|
13469
13468
|
;
|
|
13470
13469
|
setQueryValue(savedData) {
|
|
13471
|
-
//if (!this.qryBldrObj) {
|
|
13472
|
-
// console.warn('query builder object is null.');
|
|
13473
|
-
// return;
|
|
13474
|
-
//}
|
|
13475
13470
|
if (savedData) {
|
|
13476
13471
|
this.qryBldrObj.setRules(savedData);
|
|
13477
13472
|
this.updateRule({ rule: savedData });
|
|
@@ -13486,24 +13481,12 @@ class SfquerybuilderComponent {
|
|
|
13486
13481
|
onChange() {
|
|
13487
13482
|
this.updateRule({ rule: this.qryBldrObj.getValidRules(this.qryBldrObj.rule) });
|
|
13488
13483
|
}
|
|
13489
|
-
beforeLoadField(fieldElementData) {
|
|
13490
|
-
let beforeLoadField = fieldElementData['BeforeLoadField'];
|
|
13491
|
-
if (beforeLoadField) {
|
|
13492
|
-
beforeLoadField = beforeLoadField.replace('modalGroup.', 'group.');
|
|
13493
|
-
const callFunc = eval('this.' + beforeLoadField);
|
|
13494
|
-
if (typeof callFunc === "function") {
|
|
13495
|
-
const newFunc = callFunc.bind(this);
|
|
13496
|
-
return newFunc(event, this, fieldElementData);
|
|
13497
|
-
}
|
|
13498
|
-
}
|
|
13499
|
-
return of(fieldElementData);
|
|
13500
|
-
}
|
|
13501
13484
|
}
|
|
13502
13485
|
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 });
|
|
13503
|
-
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{width:
|
|
13486
|
+
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"] }] });
|
|
13504
13487
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: SfquerybuilderComponent, decorators: [{
|
|
13505
13488
|
type: Component,
|
|
13506
|
-
args: [{ selector: 'app-sfquerybuilder', 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{width:
|
|
13489
|
+
args: [{ selector: 'app-sfquerybuilder', 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"] }]
|
|
13507
13490
|
}], ctorParameters: function () { return [{ type: i2.FieldService }, { type: i2.ResourceApiService }, { type: i2.WebApiService }]; }, propDecorators: { qryBldrObj: [{
|
|
13508
13491
|
type: ViewChild,
|
|
13509
13492
|
args: ['querybuilder']
|