@acorex/components 3.0.31 → 3.0.35
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/acorex-components.metadata.json +1 -1
- package/bundles/acorex-components.umd.js +180 -27
- package/bundles/acorex-components.umd.js.map +1 -1
- package/bundles/acorex-components.umd.min.js +1 -1
- package/bundles/acorex-components.umd.min.js.map +1 -1
- package/esm2015/lib/number-box/number-box.component.js +1 -2
- package/esm2015/lib/query-builder/query-builder-group.component.js +14 -5
- package/esm2015/lib/query-builder/query-builder-rule.component.js +7 -3
- package/esm2015/lib/query-builder/query-builder.component.js +10 -5
- package/esm2015/lib/query-builder/query-builder.service.js +84 -4
- package/esm2015/lib/tab-page/tab-page.module.js +2 -3
- package/esm2015/lib/tree-view/tree-view.component.js +40 -15
- package/esm5/lib/number-box/number-box.component.js +1 -2
- package/esm5/lib/query-builder/query-builder-group.component.js +15 -5
- package/esm5/lib/query-builder/query-builder-rule.component.js +7 -3
- package/esm5/lib/query-builder/query-builder.component.js +10 -5
- package/esm5/lib/query-builder/query-builder.service.js +113 -4
- package/esm5/lib/tab-page/tab-page.module.js +2 -3
- package/esm5/lib/tree-view/tree-view.component.js +41 -15
- package/fesm2015/acorex-components.js +150 -28
- package/fesm2015/acorex-components.js.map +1 -1
- package/fesm5/acorex-components.js +181 -28
- package/fesm5/acorex-components.js.map +1 -1
- package/lib/query-builder/query-builder-group.component.d.ts +1 -0
- package/lib/query-builder/query-builder-rule.component.d.ts +1 -0
- package/lib/query-builder/query-builder.component.d.ts +1 -0
- package/lib/query-builder/query-builder.service.d.ts +2 -1
- package/lib/tree-view/tree-view.component.d.ts +3 -1
- package/package.json +1 -1
|
@@ -7774,7 +7774,6 @@
|
|
|
7774
7774
|
configurable: true
|
|
7775
7775
|
});
|
|
7776
7776
|
AXNumberBoxComponent.prototype.calcSeparator = function (num) {
|
|
7777
|
-
debugger;
|
|
7778
7777
|
if (this.showSeparator) {
|
|
7779
7778
|
return num + (+(num / 3));
|
|
7780
7779
|
}
|
|
@@ -9630,6 +9629,7 @@
|
|
|
9630
9629
|
function AXQueryBuilderRuleComponent() {
|
|
9631
9630
|
var _this = this;
|
|
9632
9631
|
this.isEditing = true;
|
|
9632
|
+
this.mode = 'new';
|
|
9633
9633
|
this.fields = [];
|
|
9634
9634
|
this.onRuleDelete = new core.EventEmitter();
|
|
9635
9635
|
this.ruleChanged = new core.EventEmitter();
|
|
@@ -9813,7 +9813,6 @@
|
|
|
9813
9813
|
};
|
|
9814
9814
|
AXQueryBuilderRuleComponent.prototype.captionChange = function (e) {
|
|
9815
9815
|
var _this = this;
|
|
9816
|
-
debugger;
|
|
9817
9816
|
if (e.selectedItems[0]) {
|
|
9818
9817
|
this.rule.caption = e.selectedItems[0].caption;
|
|
9819
9818
|
this.rule.dataField = e.selectedItems[0].dataField;
|
|
@@ -9961,6 +9960,10 @@
|
|
|
9961
9960
|
core.Input(),
|
|
9962
9961
|
__metadata("design:type", AXQueryBuilderGroup)
|
|
9963
9962
|
], AXQueryBuilderRuleComponent.prototype, "parent", void 0);
|
|
9963
|
+
__decorate([
|
|
9964
|
+
core.Input(),
|
|
9965
|
+
__metadata("design:type", String)
|
|
9966
|
+
], AXQueryBuilderRuleComponent.prototype, "mode", void 0);
|
|
9964
9967
|
__decorate([
|
|
9965
9968
|
core.Input(),
|
|
9966
9969
|
__metadata("design:type", Array)
|
|
@@ -9976,7 +9979,7 @@
|
|
|
9976
9979
|
AXQueryBuilderRuleComponent = __decorate([
|
|
9977
9980
|
core.Component({
|
|
9978
9981
|
selector: 'ax-query-rule',
|
|
9979
|
-
template: "<div class=\"condition\" *ngIf=\"parent\">\r\n <div class=\"text {{parent.condition}}\">\r\n <span>{{parent.condition}}</span>\r\n </div>\r\n</div>\r\n<div class=\"handler\">\r\n <i class=\"far fa-grip-lines-vertical\"></i>\r\n</div>\r\n\r\n<div class=\"caption\" [ngClass]=\"{'editable': isEditing}\">\r\n <ng-container *ngIf=\"isEditing;else fieldsTemplate\">\r\n <ax-form-group>\r\n <ax-select-box (selectionChanged)=\"captionChange($event)\" allowNull=\"false\"\r\n [(selectedItems)]=\"rule.dataFieldItem\" textField=\"caption\" valueField=\"dataField\" [items]=\"fields\"\r\n
|
|
9982
|
+
template: "<div class=\"condition\" *ngIf=\"parent\">\r\n <div class=\"text {{parent.condition}}\">\r\n <span>{{parent.condition}}</span>\r\n </div>\r\n</div>\r\n<div class=\"handler\">\r\n <i class=\"far fa-grip-lines-vertical\"></i>\r\n</div>\r\n\r\n<div class=\"caption\" [ngClass]=\"{'editable': isEditing}\">\r\n <ng-container *ngIf=\"isEditing;else fieldsTemplate\">\r\n <ax-form-group>\r\n <ax-select-box [readonly]=\"mode == 'edit'\" (selectionChanged)=\"captionChange($event)\" allowNull=\"false\"\r\n [(selectedItems)]=\"rule.dataFieldItem\" textField=\"caption\" valueField=\"dataField\" [items]=\"fields\"\r\n mode=\"single\">\r\n </ax-select-box>\r\n </ax-form-group>\r\n </ng-container>\r\n <ng-template #fieldsTemplate>\r\n <div (click)=\"handleEditClick()\">\r\n {{rule.caption}}\r\n </div>\r\n </ng-template>\r\n</div>\r\n\r\n<div class=\"operator\" [ngClass]=\"{'editable': isEditing,'radius':!showValue}\">\r\n <ng-container *ngIf=\"isEditing;else operatorTemplate\">\r\n <ax-form-group>\r\n <ax-select-box [readonly]=\"mode == 'edit'\" *ngIf=\"showOperatorSelectBox\" [(selectedValues)]=\"rule.operator\"\r\n #selectBox (selectedItemsChange)=\"operatorChange($event)\" allowNull=\"false\" mode=\"single\">\r\n <ax-data-source [provideData]=\"provideDataOperator\">\r\n </ax-data-source>\r\n </ax-select-box>\r\n </ax-form-group>\r\n </ng-container>\r\n <ng-template #operatorTemplate>\r\n <div class=\"text\" (click)=\"handleEditClick()\">\r\n {{('queryBuilder.'+rule.operator) | trans}}\r\n </div>\r\n </ng-template>\r\n</div>\r\n<div *ngIf=\"showValue\" class=\"value\" [ngClass]=\"{'editable': isEditing}\">\r\n <ng-container *ngIf=\"isEditing;else valueTemplate\">\r\n\r\n <div *ngIf=\" rule.control && !isOnDemandLabel\" [ngSwitch]=\"rule.control.type\">\r\n <div *ngSwitchCase=\"'textBox'\">\r\n <ax-form-group>\r\n <ax-text-box (onValueChanged)=\"valueChange($event)\" placeholder=\"\u0645\u0642\u062F\u0627\u0631 \u0645\u0648\u0631\u062F \u0646\u0638\u0631 \u062E\u0648\u062F \u0631\u0627 \u0648\u0627\u0631\u062F \u06A9\u0646\u06CC\u062F\"\r\n [(value)]=\"rule.value\">\r\n </ax-text-box>\r\n </ax-form-group>\r\n </div>\r\n <div *ngSwitchCase=\"'selectBox'\">\r\n <ax-form-group>\r\n <ax-select-box *ngIf=\"showSelectBox\" [mode]=\"getOption('mode')\"\r\n [remoteOperation]=\"getOption('remoteOperation')\" [valueField]=\"getOption('valueField')\"\r\n placeholder=\"\u0645\u0642\u062F\u0627\u0631 \u0645\u0648\u0631\u062F \u0646\u0638\u0631 \u062E\u0648\u062F \u0631\u0627 \u0648\u0627\u0631\u062F \u06A9\u0646\u06CC\u062F\" [textField]=\"getOption('textField')\"\r\n [(selectedItems)]=\"rule.valueItem\" (selectedItemsChange)=\"selectedItemsChange($event)\"\r\n #selectBoxValue>\r\n <ax-data-source [provideData]=\"getProvideData\"></ax-data-source>\r\n </ax-select-box>\r\n </ax-form-group>\r\n </div>\r\n\r\n <div *ngSwitchCase=\"'numberBox'\">\r\n <ax-form-group>\r\n <ax-number-box (onValueChanged)=\"valueChange($event)\" placeholder=\"\u0645\u0642\u062F\u0627\u0631 \u0645\u0648\u0631\u062F \u0646\u0638\u0631 \u062E\u0648\u062F \u0631\u0627 \u0648\u0627\u0631\u062F \u06A9\u0646\u06CC\u062F\"\r\n [(value)]=\"rule.value\">\r\n </ax-number-box>\r\n </ax-form-group>\r\n </div>\r\n <div *ngSwitchCase=\"'datePicker'\">\r\n\r\n\r\n </div>\r\n <div *ngSwitchCase=\"'boolean'\">\r\n\r\n <ax-form-group>\r\n <ax-select-box #selectBoxBoolean (selectedItemsChange)=\"valueBooleanChange($event)\"\r\n allowNull=\"false\" [selectedValues]=\"rule.value\" mode=\"single\">\r\n <ax-data-source [provideData]=\"provideDataBoolean\">\r\n </ax-data-source>\r\n </ax-select-box>\r\n </ax-form-group>\r\n\r\n </div>\r\n <div *ngSwitchDefault>\r\n <ax-form-group>\r\n <ax-text-box (onValueChanged)=\"valueChange($event)\" placeholder=\"\u0645\u0642\u062F\u0627\u0631 \u0645\u0648\u0631\u062F \u0646\u0638\u0631 \u062E\u0648\u062F \u0631\u0627 \u0648\u0627\u0631\u062F \u06A9\u0646\u06CC\u062F\"\r\n [(value)]=\"rule.value\">\r\n </ax-text-box>\r\n\r\n </ax-form-group>\r\n\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"isOnDemandLabel\">\r\n\r\n <ax-text-box #textBoxNameValue [value]=\"getOnDemandName(rule.onDemandLabel)\"\r\n (onValueChanged)=\"onDemandLabelChange($event)\" placeholder=\"\u0646\u0627\u0645 \u0645\u062A\u063A\u06CC\u0631 \u062E\u0648\u062F \u0631\u0627 \u0648\u0627\u0631\u062F \u06A9\u0646\u06CC\u062F\">\r\n <!-- <ax-validation>\r\n <ax-validation-rule type=\"required\"></ax-validation-rule>\r\n </ax-validation> -->\r\n </ax-text-box>\r\n\r\n\r\n </div>\r\n\r\n </ng-container>\r\n <ng-template #valueTemplate>\r\n <div (click)=\"handleEditClick()\">\r\n\r\n {{rule.text}}\r\n\r\n </div>\r\n </ng-template>\r\n</div>\r\n\r\n<div class=\"buttons-list\">\r\n <div *ngIf=\"showValue && isEditing && mode == 'new'\" class=\"button variable\"\r\n [ngClass]=\"{'active-button': isOnDemandLabel}\">\r\n <i class=\"far fa-dollar-sign\"></i>\r\n <ax-check-box [value]=\"isOnDemandLabel\" (onClick)=\"onDemandLabel($event)\">\r\n </ax-check-box>\r\n </div>\r\n\r\n <div class=\"button commit\" (click)=\"handleCommitClick()\" *ngIf=\"isEditing\">\r\n <i class=\"far fa-check\"></i>\r\n </div>\r\n <div class=\"button remove\" (click)=\"handleRemoveClick()\" *ngIf=\"mode == 'new'\">\r\n <i class=\"far fa-times\"></i>\r\n </div>\r\n</div>",
|
|
9980
9983
|
host: { class: 'ax ax-query-rule' },
|
|
9981
9984
|
encapsulation: core.ViewEncapsulation.None
|
|
9982
9985
|
}),
|
|
@@ -10171,7 +10174,7 @@
|
|
|
10171
10174
|
}
|
|
10172
10175
|
}
|
|
10173
10176
|
if (_this.canRun) {
|
|
10174
|
-
_this.popup.open(AXQueryBuilderPopupComponent, { data: { group: group, provideData: provideData }, title:
|
|
10177
|
+
_this.popup.open(AXQueryBuilderPopupComponent, { data: { group: group, provideData: provideData }, title: 'دریافت مقادیر' }).then(function (c) {
|
|
10175
10178
|
resolve(c);
|
|
10176
10179
|
});
|
|
10177
10180
|
}
|
|
@@ -10211,10 +10214,119 @@
|
|
|
10211
10214
|
}
|
|
10212
10215
|
// }
|
|
10213
10216
|
};
|
|
10217
|
+
AXQueryBuilderService.prototype.getQueryStringSimple = function (group) {
|
|
10218
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
10219
|
+
var _this = this;
|
|
10220
|
+
return __generator(this, function (_a) {
|
|
10221
|
+
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
10222
|
+
var query, id, _a, _b, iterator, item, codeOperator, e_1_1;
|
|
10223
|
+
var e_1, _c;
|
|
10224
|
+
return __generator(this, function (_d) {
|
|
10225
|
+
switch (_d.label) {
|
|
10226
|
+
case 0:
|
|
10227
|
+
debugger;
|
|
10228
|
+
if (group.items.length > 0) {
|
|
10229
|
+
query = ' ( ';
|
|
10230
|
+
}
|
|
10231
|
+
id = 0;
|
|
10232
|
+
_d.label = 1;
|
|
10233
|
+
case 1:
|
|
10234
|
+
_d.trys.push([1, 9, 10, 15]);
|
|
10235
|
+
_a = __asyncValues(group.items);
|
|
10236
|
+
_d.label = 2;
|
|
10237
|
+
case 2: return [4 /*yield*/, _a.next()];
|
|
10238
|
+
case 3:
|
|
10239
|
+
if (!(_b = _d.sent(), !_b.done)) return [3 /*break*/, 8];
|
|
10240
|
+
iterator = _b.value;
|
|
10241
|
+
item = group.items[id];
|
|
10242
|
+
if (!item.condition) return [3 /*break*/, 5];
|
|
10243
|
+
return [4 /*yield*/, this.getQueryStringSimple(item).then(function (c) {
|
|
10244
|
+
query = query + c;
|
|
10245
|
+
})];
|
|
10246
|
+
case 4:
|
|
10247
|
+
_d.sent();
|
|
10248
|
+
return [3 /*break*/, 6];
|
|
10249
|
+
case 5:
|
|
10250
|
+
codeOperator = null;
|
|
10251
|
+
switch (item.operator) {
|
|
10252
|
+
case 'equal':
|
|
10253
|
+
codeOperator = '==';
|
|
10254
|
+
break;
|
|
10255
|
+
case 'not-equal':
|
|
10256
|
+
codeOperator = '!=';
|
|
10257
|
+
break;
|
|
10258
|
+
case 'not-null':
|
|
10259
|
+
codeOperator = '!= null';
|
|
10260
|
+
break;
|
|
10261
|
+
case 'null':
|
|
10262
|
+
codeOperator = '== null';
|
|
10263
|
+
break;
|
|
10264
|
+
case 'gt':
|
|
10265
|
+
codeOperator = '>';
|
|
10266
|
+
break;
|
|
10267
|
+
case 'gte':
|
|
10268
|
+
codeOperator = '>=';
|
|
10269
|
+
break;
|
|
10270
|
+
case 'lt':
|
|
10271
|
+
codeOperator = '<';
|
|
10272
|
+
break;
|
|
10273
|
+
case 'lte':
|
|
10274
|
+
codeOperator = '<=';
|
|
10275
|
+
break;
|
|
10276
|
+
case 'contains':
|
|
10277
|
+
codeOperator = item.operator;
|
|
10278
|
+
break;
|
|
10279
|
+
case 'start-with':
|
|
10280
|
+
codeOperator = item.operator;
|
|
10281
|
+
break;
|
|
10282
|
+
case 'end-with':
|
|
10283
|
+
codeOperator = item.operator;
|
|
10284
|
+
break;
|
|
10285
|
+
}
|
|
10286
|
+
debugger;
|
|
10287
|
+
query = query + ' ' + item.caption + ' ' + codeOperator + ' ' + item.text;
|
|
10288
|
+
_d.label = 6;
|
|
10289
|
+
case 6:
|
|
10290
|
+
if (id !== group.items.length - 1 && query != ' ( ') {
|
|
10291
|
+
query = query + ' ' + group.condition;
|
|
10292
|
+
}
|
|
10293
|
+
id += 1;
|
|
10294
|
+
_d.label = 7;
|
|
10295
|
+
case 7: return [3 /*break*/, 2];
|
|
10296
|
+
case 8: return [3 /*break*/, 15];
|
|
10297
|
+
case 9:
|
|
10298
|
+
e_1_1 = _d.sent();
|
|
10299
|
+
e_1 = { error: e_1_1 };
|
|
10300
|
+
return [3 /*break*/, 15];
|
|
10301
|
+
case 10:
|
|
10302
|
+
_d.trys.push([10, , 13, 14]);
|
|
10303
|
+
if (!(_b && !_b.done && (_c = _a.return))) return [3 /*break*/, 12];
|
|
10304
|
+
return [4 /*yield*/, _c.call(_a)];
|
|
10305
|
+
case 11:
|
|
10306
|
+
_d.sent();
|
|
10307
|
+
_d.label = 12;
|
|
10308
|
+
case 12: return [3 /*break*/, 14];
|
|
10309
|
+
case 13:
|
|
10310
|
+
if (e_1) throw e_1.error;
|
|
10311
|
+
return [7 /*endfinally*/];
|
|
10312
|
+
case 14: return [7 /*endfinally*/];
|
|
10313
|
+
case 15:
|
|
10314
|
+
if (group.items.length > 0) {
|
|
10315
|
+
query = query + ' ) ';
|
|
10316
|
+
}
|
|
10317
|
+
resolve(query);
|
|
10318
|
+
return [2 /*return*/];
|
|
10319
|
+
}
|
|
10320
|
+
});
|
|
10321
|
+
}); })];
|
|
10322
|
+
});
|
|
10323
|
+
});
|
|
10324
|
+
};
|
|
10214
10325
|
AXQueryBuilderService.prototype.getQueryString = function (group, type) {
|
|
10215
10326
|
var query = '';
|
|
10216
10327
|
switch (type) {
|
|
10217
10328
|
case 'simple':
|
|
10329
|
+
debugger;
|
|
10218
10330
|
if (group.items.length > 0) {
|
|
10219
10331
|
query = ' ( ';
|
|
10220
10332
|
}
|
|
@@ -10276,6 +10388,7 @@
|
|
|
10276
10388
|
this.qs = qs;
|
|
10277
10389
|
this.collapsed = false;
|
|
10278
10390
|
this.fields = [];
|
|
10391
|
+
this.mode = 'new';
|
|
10279
10392
|
//ruleIsEditing: boolean = true;
|
|
10280
10393
|
this.groupRuleChanged = new core.EventEmitter();
|
|
10281
10394
|
this.showGroupCondition = false;
|
|
@@ -10354,9 +10467,14 @@
|
|
|
10354
10467
|
this.ruleChanged(null);
|
|
10355
10468
|
};
|
|
10356
10469
|
AXQueryBuilderGroupComponent.prototype.ruleChanged = function (e) {
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
this.
|
|
10470
|
+
var _this = this;
|
|
10471
|
+
debugger;
|
|
10472
|
+
// this.group.queryString = this.qs.getQueryString(this.group, 'simple');
|
|
10473
|
+
this.qs.getQueryStringSimple(this.group).then(function (c) {
|
|
10474
|
+
_this.group.queryString = c;
|
|
10475
|
+
_this.group.queryStringElastic = _this.qs.getQueryString(_this.group, 'elastic');
|
|
10476
|
+
_this.groupRuleChanged.emit({ groups: _this.group, component: _this });
|
|
10477
|
+
});
|
|
10360
10478
|
};
|
|
10361
10479
|
AXQueryBuilderGroupComponent.ctorParameters = function () { return [
|
|
10362
10480
|
{ type: AXQueryBuilderService }
|
|
@@ -10381,6 +10499,10 @@
|
|
|
10381
10499
|
core.Input(),
|
|
10382
10500
|
__metadata("design:type", Array)
|
|
10383
10501
|
], AXQueryBuilderGroupComponent.prototype, "fields", void 0);
|
|
10502
|
+
__decorate([
|
|
10503
|
+
core.Input(),
|
|
10504
|
+
__metadata("design:type", String)
|
|
10505
|
+
], AXQueryBuilderGroupComponent.prototype, "mode", void 0);
|
|
10384
10506
|
__decorate([
|
|
10385
10507
|
core.Output(),
|
|
10386
10508
|
__metadata("design:type", core.EventEmitter)
|
|
@@ -10388,7 +10510,7 @@
|
|
|
10388
10510
|
AXQueryBuilderGroupComponent = __decorate([
|
|
10389
10511
|
core.Component({
|
|
10390
10512
|
selector: 'ax-query-group',
|
|
10391
|
-
template: "<div class=\"header\">\r\n <div class=\"condition\" *ngIf=\"parent\">\r\n <div class=\"text {{parent.condition}}\">\r\n <span>{{parent.condition }}</span>\r\n </div>\r\n </div>\r\n <div class=\"handler\">\r\n <i class=\"far fa-grip-lines-vertical\"></i>\r\n </div>\r\n\r\n <div class=\"detail {{group.condition}}\" (click)=\"changeDetailMode()\">\r\n <div class=\"collapsed\" *ngIf=\"collapsed;else expandedTemplate\">\r\n {{group.queryString}}\r\n </div>\r\n <ng-template #expandedTemplate>\r\n <div class=\"expanded\">\r\n <strong>{{group.condition == 'OR' ? '\u06CC\u06A9\u06CC \u0627\u0632' : '\u0647\u0645\u0647' }} <span>\u0634\u0631\u0627\u06CC\u0637 \u0632\u06CC\u0631 \u0628\u0631\u0642\u0631\u0627\u0631 \u0628\u0627\u0634\u062F</span> </strong>\r\n </div>\r\n </ng-template>\r\n </div>\r\n <div class=\"buttons-list\">\r\n <div class=\"button remove\" *ngIf=\"parent\" (click)=\"handleRemoveClick()\">\r\n <i class=\"far fa-times ax-danger-color\"></i>\r\n </div>\r\n <div class=\"button edit\" (click)=\"handleChangeClick()\">\r\n <i class=\"far fa-retweet ax-danger-color\"></i>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"rules\" *ngIf=\"!collapsed\">\r\n <!-- <ax-validation-form #form> -->\r\n\r\n <div *ngFor=\"let item of group.items\" class=\"group-item\">\r\n <ng-container *ngIf=\"item.condition;else ruleTemplate\">\r\n <ax-query-group (groupRuleChanged)=\"ruleChanged($event)\" [group]=\"item\" [fields]=\"fields\"
|
|
10513
|
+
template: "<div class=\"header\">\r\n <div class=\"condition\" *ngIf=\"parent\">\r\n <div class=\"text {{parent.condition}}\">\r\n <span>{{parent.condition }}</span>\r\n </div>\r\n </div>\r\n <div class=\"handler\">\r\n <i class=\"far fa-grip-lines-vertical\"></i>\r\n </div>\r\n\r\n <div class=\"detail {{group.condition}}\" (click)=\"changeDetailMode()\">\r\n <div class=\"collapsed\" *ngIf=\"collapsed;else expandedTemplate\">\r\n {{group.queryString}}\r\n </div>\r\n <ng-template #expandedTemplate>\r\n <div class=\"expanded\">\r\n <strong>{{group.condition == 'OR' ? '\u06CC\u06A9\u06CC \u0627\u0632' : '\u0647\u0645\u0647' }} <span>\u0634\u0631\u0627\u06CC\u0637 \u0632\u06CC\u0631 \u0628\u0631\u0642\u0631\u0627\u0631 \u0628\u0627\u0634\u062F</span> </strong>\r\n </div>\r\n </ng-template>\r\n </div>\r\n <div class=\"buttons-list\">\r\n <div class=\"button remove\" *ngIf=\"parent && mode=='new'\" (click)=\"handleRemoveClick()\">\r\n <i class=\"far fa-times ax-danger-color\"></i>\r\n </div>\r\n <div class=\"button edit\" *ngIf=\"mode=='new'\" (click)=\"handleChangeClick()\">\r\n <i class=\"far fa-retweet ax-danger-color\"></i>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"rules\" *ngIf=\"!collapsed\">\r\n <!-- <ax-validation-form #form> -->\r\n\r\n <div *ngFor=\"let item of group.items\" class=\"group-item\">\r\n <ng-container *ngIf=\"item.condition;else ruleTemplate\">\r\n <ax-query-group (groupRuleChanged)=\"ruleChanged($event)\" [mode]=\"mode\" [group]=\"item\" [fields]=\"fields\"\r\n [parent]=\"group\">\r\n </ax-query-group>\r\n </ng-container>\r\n <ng-template #ruleTemplate>\r\n <ax-query-rule #queryRule (ruleChanged)=\"ruleChanged($event)\" [mode]=\"mode\"\r\n (onRuleDelete)=\"ruleDelete($event)\" [rule]=\"item\" [fields]=\"fields\" [parent]=\"group\">\r\n </ax-query-rule>\r\n </ng-template>\r\n </div>\r\n <!-- </ax-validation-form> -->\r\n <div class=\"group-item\" *ngIf=\"mode=='new'\">\r\n <div class=\"ax-query-rule\">\r\n <div class=\"condition\">\r\n </div>\r\n <div class=\"handler\">\r\n <i class=\"far fa-grip-lines-vertical\"></i>\r\n </div>\r\n <div class=\"add-rule\" (click)=\"addRule()\" *ngIf=\"mode=='new'\">\r\n <i class=\"far fa-plus\"></i> <span>\u0634\u0631\u0637</span>\r\n </div>\r\n <div class=\"add-group\" (click)=\"addGroup()\" *ngIf=\"!showGroupCondition && mode=='new'\">\r\n <i class=\"far fa-plus\"></i> <span>\u06AF\u0631\u0648\u0647</span>\r\n </div>\r\n <div *ngIf=\"showGroupCondition && mode=='new'\" class=\"add-condition OR\" (click)=\"addGroupOR()\">\r\n <i class=\"far fa-plus\"></i> <span>OR</span>\r\n </div>\r\n <div *ngIf=\"showGroupCondition && mode=='new'\" class=\"add-condition AND\" (click)=\"addGroupAND()\">\r\n <i class=\"far fa-plus\"></i> <span>AND</span>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n</div>",
|
|
10392
10514
|
host: { class: 'ax ax-query-group' },
|
|
10393
10515
|
encapsulation: core.ViewEncapsulation.None
|
|
10394
10516
|
}),
|
|
@@ -10403,6 +10525,7 @@
|
|
|
10403
10525
|
var _this = _super.call(this) || this;
|
|
10404
10526
|
_this.ref = ref;
|
|
10405
10527
|
_this.toast = toast;
|
|
10528
|
+
_this.mode = 'new';
|
|
10406
10529
|
_this.rootGroup = new AXQueryBuilderGroup();
|
|
10407
10530
|
_this.fields = [];
|
|
10408
10531
|
// @Input()
|
|
@@ -10412,11 +10535,11 @@
|
|
|
10412
10535
|
return _this;
|
|
10413
10536
|
}
|
|
10414
10537
|
AXQueryBuilderComponent.prototype.ngOnInit = function () {
|
|
10415
|
-
this.rootGroup.condition = this.query.condition ? this.query.condition :
|
|
10538
|
+
this.rootGroup.condition = this.query.condition ? this.query.condition : 'AND';
|
|
10416
10539
|
this.rootGroup.items = this.query.items ? this.query.items : [];
|
|
10417
10540
|
};
|
|
10418
10541
|
AXQueryBuilderComponent.prototype.getQueryBuilder = function () {
|
|
10419
|
-
return
|
|
10542
|
+
return { groups: this.rootGroup };
|
|
10420
10543
|
};
|
|
10421
10544
|
AXQueryBuilderComponent.prototype.ruleChanged = function (e) {
|
|
10422
10545
|
this.onRuleChanged.emit({ component: this, groups: this.rootGroup });
|
|
@@ -10466,6 +10589,10 @@
|
|
|
10466
10589
|
core.Input(),
|
|
10467
10590
|
__metadata("design:type", AXQueryBuilderGroup)
|
|
10468
10591
|
], AXQueryBuilderComponent.prototype, "query", void 0);
|
|
10592
|
+
__decorate([
|
|
10593
|
+
core.Input(),
|
|
10594
|
+
__metadata("design:type", String)
|
|
10595
|
+
], AXQueryBuilderComponent.prototype, "mode", void 0);
|
|
10469
10596
|
__decorate([
|
|
10470
10597
|
core.Input(),
|
|
10471
10598
|
__metadata("design:type", Array)
|
|
@@ -10477,9 +10604,9 @@
|
|
|
10477
10604
|
AXQueryBuilderComponent = __decorate([
|
|
10478
10605
|
core.Component({
|
|
10479
10606
|
selector: 'ax-query-builder',
|
|
10480
|
-
template: "<ax-query-group #queryGroup [group]=\"rootGroup\" [fields]=\"fields\"
|
|
10607
|
+
template: "<ax-query-group #queryGroup [mode]=\"mode\" [group]=\"rootGroup\" [fields]=\"fields\"\r\n (groupRuleChanged)=\"ruleChanged($event)\">\r\n</ax-query-group>",
|
|
10481
10608
|
encapsulation: core.ViewEncapsulation.None,
|
|
10482
|
-
styles: [".ax-query-group{display:flex;flex-direction:column;margin:5px;-webkit-padding-start:0;padding-inline-start:0}.ax-query-group .add-buttons{display:flex;margin:5px;flex-direction:row}.ax-query-group .add-buttons .handler{display:flex;align-items:center;background-color:var(--ax-primary-trans-light-color);color:var(--ax-primary-color);padding:5px;cursor:move;border:1px solid var(--ax-primary-trans-light-color);border-
|
|
10609
|
+
styles: [".ax-query-group{display:flex;flex-direction:column;margin:5px;-webkit-padding-start:0;padding-inline-start:0}.ax-query-group .add-buttons{display:flex;margin:5px;flex-direction:row}.ax-query-group .add-buttons .handler{display:flex;align-items:center;background-color:var(--ax-primary-trans-light-color);color:var(--ax-primary-color);padding:5px;cursor:move;border:1px solid var(--ax-primary-trans-light-color);border-start-start-radius:4px;border-end-start-radius:4px}.ax-query-group .buttons-list{-webkit-margin-start:10px;margin-inline-start:10px;display:flex;align-items:center}.ax-query-group .buttons-list .button{cursor:pointer;-webkit-margin-end:.5em;margin-inline-end:.5em;width:2.3em;height:2.3em;display:flex;align-items:center;justify-content:center;border-radius:50px;position:relative}.ax-query-group .buttons-list .button ax-check-box{opacity:0;width:100%;height:100%;position:absolute;z-index:1;left:0;top:0}.ax-query-group .buttons-list .variable{color:var(--ax-warning-color);background:var(--ax-warning-trans-light-color)}.ax-query-group .buttons-list .variable.active-button{background:var(--ax-warning-light-color);color:var(--ax-white-color);opacity:.7}.ax-query-group .buttons-list .commit{color:var(--ax-success-color);background:var(--ax-success-trans-light-color)}.ax-query-group .buttons-list .remove{color:var(--ax-danger-color);background:var(--ax-danger-trans-light-color)}.ax-query-group .buttons-list .edit{color:var(--ax-primary-color);background:var(--ax-primary-trans-light-color)}.ax-query-group .group-item{transition:.5s}.ax-query-group .group-item .condition{width:40px;display:flex;align-items:center;background:linear-gradient(180deg,rgba(2,0,36,0) 49%,var(--ax-gray-light-color) 49%,var(--ax-gray-light-color) 55%,rgba(0,212,255,0) 50%)}.ax-query-group .group-item .condition .text{-webkit-margin-start:-50%;margin-inline-start:-50%;border-radius:50%;width:35px;height:35px;display:flex;align-items:center;justify-content:center}.ax-query-group .group-item .condition .text.OR{background:var(--ax-warning-color);color:var(--ax-warning-fore-color)}.ax-query-group .group-item .condition .text.AND{background:var(--ax-success-color);color:var(--ax-success-fore-color)}.ax-query-group .header{display:flex;flex-direction:row}.ax-query-group .header .handler{display:flex;align-items:center;background-color:var(--ax-light-light-color);color:var(--ax-light-fore-color);padding:5px;cursor:move;border:1px solid var(--ax-light-light-color);border-start-start-radius:4px;border-end-start-radius:4px}.ax-query-group .header .caption{padding:.5rem;background-color:var(--ax-gray-trans-light-color);color:var(--ax-gray-dark-color);font-weight:700;cursor:pointer}.ax-query-group .header .detail{padding:.5rem;background-color:var(--ax-gray-trans-light-color);border-right:none;border-start-end-radius:4px;border-end-end-radius:4px;cursor:pointer}.ax-query-group .header .detail.OR{background-color:var(--ax-warning-trans-light-color)}.ax-query-group .header .detail.AND{background-color:var(--ax-success-trans-light-color)}.ax-query-group .rules{-webkit-margin-start:10px;margin-inline-start:10px;-webkit-border-start:2px solid var(--ax-gray-light-color);border-inline-start:2px solid var(--ax-gray-light-color)}.ax-query-group .rules .rules{-webkit-margin-start:48px;margin-inline-start:48px}.ax-query-group .ax-query-rule{display:flex;margin:5px;flex-direction:row;transition:.5s}.ax-query-group .ax-query-rule .handler{display:flex;align-items:center;background-color:var(--ax-light-light-color);color:var(--ax-light-fore-color);padding:.5em;cursor:move;border:1px solid var(--ax-light-light-color);border-start-start-radius:4px;border-end-start-radius:4px}.ax-query-group .ax-query-rule .caption{padding:.5rem;background-color:var(--ax-gray-trans-light-color);border:1px solid var(--ax-gray-light-color);color:#333;font-weight:700;cursor:pointer}.ax-query-group .ax-query-rule .caption.editable{width:200px}.ax-query-group .ax-query-rule .operator{border-top:1px solid var(--ax-gray-light-color);border-bottom:1px solid var(--ax-gray-light-color);background-color:var(--ax-gray-trans-light-color);padding:.5rem}.ax-query-group .ax-query-rule .operator.editable{width:200px}.ax-query-group .ax-query-rule .operator .text{color:var(--ax-primary-color);font-weight:700;-webkit-text-decoration:underline dashed;text-decoration:underline dashed;cursor:pointer}.ax-query-group .ax-query-rule .operator.radius{border-top-left-radius:4px;border-bottom-left-radius:4px;border:1px solid var(--ax-gray-light-color);border-right:none}.ax-query-group .ax-query-rule .value{padding:.5rem;background-color:var(--ax-light-light-color);color:#000;border:1px solid var(--ax-gray-light-color);border-right:none;border-start-end-radius:4px;border-end-end-radius:4px;cursor:pointer}.ax-query-group .ax-query-rule .value.editable{width:200px}.ax-query-group .ax-query-rule .add-rule{border-top:1px dashed var(--ax-gray-light-color);border-bottom:1px dashed var(--ax-gray-light-color);color:var(--ax-gray-dark-color);padding:.5rem;font-weight:700;cursor:pointer}.ax-query-group .ax-query-rule .add-group:hover,.ax-query-group .ax-query-rule .add-rule:hover{background-color:var(--ax-gray-light-color)}.ax-query-group .ax-query-rule .add-condition,.ax-query-group .ax-query-rule .add-group{border-top:1px dashed var(--ax-gray-light-color);border-bottom:1px dashed var(--ax-gray-light-color);color:var(--ax-gray-dark-color);padding:.5rem;border:1px dashed var(--ax-gray-light-color);border-top-left-radius:4px;border-bottom-left-radius:4px;cursor:pointer}.ax-query-group .ax-query-rule .add-condition.OR{background-color:var(--ax-warning-trans-light-color);color:var(--ax-warning-dark-color)}.ax-query-group .ax-query-rule .add-condition.AND{background-color:var(--ax-success-trans-light-color);color:var(--ax-success-dark-color)}.ax-query-group .ax-query-rule .add-condition:hover.OR{background-color:var(--ax-warning-trans-light-color);color:var(--ax-warning-dark-color)}.ax-query-group .ax-query-rule .add-condition:hover.AND{background-color:var(--ax-success-trans-light-color);color:var(--ax-success-dark-color)}"]
|
|
10483
10610
|
}),
|
|
10484
10611
|
__metadata("design:paramtypes", [core.ElementRef, AXToastService])
|
|
10485
10612
|
], AXQueryBuilderComponent);
|
|
@@ -11682,7 +11809,7 @@
|
|
|
11682
11809
|
imports: [common.CommonModule, AXLoadingModule],
|
|
11683
11810
|
exports: [AXTabPageRendererComponent],
|
|
11684
11811
|
entryComponents: [AXTabPageRendererComponent, AXTabPageHostComponent],
|
|
11685
|
-
providers: [
|
|
11812
|
+
providers: [],
|
|
11686
11813
|
})
|
|
11687
11814
|
], AXTabPageModule);
|
|
11688
11815
|
return AXTabPageModule;
|
|
@@ -13785,7 +13912,10 @@
|
|
|
13785
13912
|
//seletedKeyFields set id of nodes and parents
|
|
13786
13913
|
//selectedFieldName set name of fields that set selectes
|
|
13787
13914
|
_this.selectedFieldName = null;
|
|
13788
|
-
|
|
13915
|
+
// @Input()
|
|
13916
|
+
// selectNodesRecursive: 'all' | 'parents' | 'childs' | 'none' = 'all'; //leaf
|
|
13917
|
+
_this.checkParents = true;
|
|
13918
|
+
_this.checkChilds = true;
|
|
13789
13919
|
_this.seletedKeyFields = [];
|
|
13790
13920
|
_this.keyField = 'id';
|
|
13791
13921
|
_this.hasChildField = 'child';
|
|
@@ -13857,6 +13987,7 @@
|
|
|
13857
13987
|
}
|
|
13858
13988
|
if (item.select == true) {
|
|
13859
13989
|
if (this.selectionMode === 'multiple') {
|
|
13990
|
+
this.selectedParents = this.selectedParents.filter(function (c) { return c[_this.keyField] !== item[_this.keyField]; });
|
|
13860
13991
|
this.selectedParents.push(item);
|
|
13861
13992
|
}
|
|
13862
13993
|
else {
|
|
@@ -13911,13 +14042,15 @@
|
|
|
13911
14042
|
}
|
|
13912
14043
|
node.itemData.item = c; //TO DO
|
|
13913
14044
|
node.itemData.selected = item.select === true ? item.select : false;
|
|
14045
|
+
node.itemData.indeterminate = item.select === null ? true : false;
|
|
13914
14046
|
node.itemData.hasChild = item[this.hasChildField];
|
|
13915
14047
|
node.parent = item.parentNode === undefined ? null : this.makeNode(item.parentNode, false);
|
|
13916
14048
|
return node;
|
|
13917
14049
|
};
|
|
13918
14050
|
AXTreeViewComponent.prototype.changeChildSelect = function (item, s) {
|
|
13919
14051
|
var _this = this;
|
|
13920
|
-
if (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'childs') {
|
|
14052
|
+
// if (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'childs') {
|
|
14053
|
+
if (this.checkChilds == true) {
|
|
13921
14054
|
item.select = s;
|
|
13922
14055
|
if (item[this.hasChildField] === true && item[this.childField] && item[this.childField].length > 0) {
|
|
13923
14056
|
item[this.childField].forEach(function (elm) {
|
|
@@ -13950,7 +14083,9 @@
|
|
|
13950
14083
|
}
|
|
13951
14084
|
};
|
|
13952
14085
|
AXTreeViewComponent.prototype.changeParentSelect = function (item) {
|
|
13953
|
-
|
|
14086
|
+
var _this = this;
|
|
14087
|
+
//if (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'parents') {
|
|
14088
|
+
if (this.checkParents) {
|
|
13954
14089
|
var allselect = true;
|
|
13955
14090
|
var alldeselect = true;
|
|
13956
14091
|
var oneselect = false;
|
|
@@ -13974,9 +14109,13 @@
|
|
|
13974
14109
|
}
|
|
13975
14110
|
if (oneselect || (isindeterminate && !allselect)) {
|
|
13976
14111
|
item.select = null;
|
|
14112
|
+
this.selectedParents = this.selectedParents.filter(function (c) { return c[_this.keyField] !== item[_this.keyField]; });
|
|
14113
|
+
this.selectedParents.push(item);
|
|
13977
14114
|
}
|
|
13978
14115
|
if (allselect === true) {
|
|
13979
14116
|
item.select = true;
|
|
14117
|
+
this.selectedParents = this.selectedParents.filter(function (c) { return c[_this.keyField] !== item[_this.keyField]; });
|
|
14118
|
+
this.selectedParents.push(item);
|
|
13980
14119
|
}
|
|
13981
14120
|
if (alldeselect === true) {
|
|
13982
14121
|
item.select = false;
|
|
@@ -14066,9 +14205,11 @@
|
|
|
14066
14205
|
_this.seletedKeyFields.forEach(function (n) {
|
|
14067
14206
|
if (n.includes(el[_this.keyField])) {
|
|
14068
14207
|
if (el[_this.hasChildField] == true) {
|
|
14069
|
-
|
|
14208
|
+
if (_this.checkParents == false && _this.checkChilds == false) {
|
|
14209
|
+
//select parent when check child and check parent is false TODO check this Action
|
|
14210
|
+
_this.selectItem(el);
|
|
14211
|
+
}
|
|
14070
14212
|
_this.open(el);
|
|
14071
|
-
// }
|
|
14072
14213
|
}
|
|
14073
14214
|
else {
|
|
14074
14215
|
_this.selectItem(el);
|
|
@@ -14079,9 +14220,11 @@
|
|
|
14079
14220
|
}
|
|
14080
14221
|
else if (_this.selectedFieldName != null) {
|
|
14081
14222
|
if (el[_this.hasChildField] == true && el[_this.selectedFieldName] == true) {
|
|
14082
|
-
|
|
14223
|
+
if (_this.checkParents == false && _this.checkChilds == false) {
|
|
14224
|
+
//select parent when check child and check parent is false TODO check this Action
|
|
14225
|
+
_this.selectItem(el);
|
|
14226
|
+
}
|
|
14083
14227
|
_this.open(el);
|
|
14084
|
-
// }
|
|
14085
14228
|
}
|
|
14086
14229
|
else if (el[_this.selectedFieldName] == true) {
|
|
14087
14230
|
_this.selectItem(el);
|
|
@@ -14093,6 +14236,7 @@
|
|
|
14093
14236
|
else {
|
|
14094
14237
|
_this.itemRow = _this.listLoad.filter(function (c) { return c.requestId === _data.data.requestId; })[0];
|
|
14095
14238
|
_this.listLoad = _this.listLoad.filter(function (c) { return c.requestId !== _data.data.requestId; });
|
|
14239
|
+
_this.itemRow.loaded = true;
|
|
14096
14240
|
if (_this.itemRow !== undefined) {
|
|
14097
14241
|
_this.hideLoading(_this.itemRow);
|
|
14098
14242
|
var result_1 = _data.data.result;
|
|
@@ -14113,7 +14257,8 @@
|
|
|
14113
14257
|
if (_this.selectionLevel == 'parents' && result_1[i][_this.hasChildField] == false) {
|
|
14114
14258
|
result_1[i].disabledCheckBox = true;
|
|
14115
14259
|
}
|
|
14116
|
-
if (
|
|
14260
|
+
// if (this.selectionMode !== 'single' && (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'childs')) {
|
|
14261
|
+
if (_this.selectionMode !== 'single' && _this.checkChilds == true) {
|
|
14117
14262
|
result_1[i].select = _this.itemRow.select === (undefined || null) ? false : _this.itemRow.select;
|
|
14118
14263
|
if (_this.itemRow.select === true && _this.selectionMode == 'multiple' && result_1[i][_this.hasChildField] === false) {
|
|
14119
14264
|
_this.selectedItems = _this.selectedItems.filter(function (c) { return c[_this.keyField] !== result_1[i][_this.keyField]; });
|
|
@@ -14128,9 +14273,11 @@
|
|
|
14128
14273
|
_this.seletedKeyFields.forEach(function (n) {
|
|
14129
14274
|
if (n.includes(result_1[i][_this.keyField])) {
|
|
14130
14275
|
if (result_1[i][_this.hasChildField] == true) {
|
|
14131
|
-
|
|
14276
|
+
if (_this.checkParents == false && _this.checkChilds == false) {
|
|
14277
|
+
//select parent when check child and check parent is false TODO check this Action
|
|
14278
|
+
_this.selectItem(result_1[i]);
|
|
14279
|
+
}
|
|
14132
14280
|
_this.open(result_1[i]);
|
|
14133
|
-
// }
|
|
14134
14281
|
}
|
|
14135
14282
|
else {
|
|
14136
14283
|
_this.selectItem(result_1[i]);
|
|
@@ -14141,9 +14288,11 @@
|
|
|
14141
14288
|
}
|
|
14142
14289
|
else if (_this.selectedFieldName != null) {
|
|
14143
14290
|
if (result_1[i][_this.hasChildField] == true && result_1[i][_this.selectedFieldName] == true) {
|
|
14144
|
-
|
|
14291
|
+
if (_this.checkParents == false && _this.checkChilds == false) {
|
|
14292
|
+
//select parent when check child and check parent is false TODO check this Action
|
|
14293
|
+
_this.selectItem(result_1[i]);
|
|
14294
|
+
}
|
|
14145
14295
|
_this.open(result_1[i]);
|
|
14146
|
-
// }
|
|
14147
14296
|
}
|
|
14148
14297
|
else if (result_1[i][_this.selectedFieldName] == true) {
|
|
14149
14298
|
_this.selectItem(result_1[i]);
|
|
@@ -14398,8 +14547,12 @@
|
|
|
14398
14547
|
], AXTreeViewComponent.prototype, "selectedFieldName", void 0);
|
|
14399
14548
|
__decorate([
|
|
14400
14549
|
core.Input(),
|
|
14401
|
-
__metadata("design:type",
|
|
14402
|
-
], AXTreeViewComponent.prototype, "
|
|
14550
|
+
__metadata("design:type", Boolean)
|
|
14551
|
+
], AXTreeViewComponent.prototype, "checkParents", void 0);
|
|
14552
|
+
__decorate([
|
|
14553
|
+
core.Input(),
|
|
14554
|
+
__metadata("design:type", Boolean)
|
|
14555
|
+
], AXTreeViewComponent.prototype, "checkChilds", void 0);
|
|
14403
14556
|
__decorate([
|
|
14404
14557
|
core.Input(),
|
|
14405
14558
|
__metadata("design:type", Array)
|