@acorex/components 3.0.32 → 3.0.36
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 +177 -25
- 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/query-builder/query-builder-group.component.js +14 -5
- package/esm2015/lib/query-builder/query-builder-rule.component.js +7 -2
- 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 +38 -15
- package/esm5/lib/query-builder/query-builder-group.component.js +15 -5
- package/esm5/lib/query-builder/query-builder-rule.component.js +7 -2
- 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 +38 -15
- package/fesm2015/acorex-components.js +148 -26
- package/fesm2015/acorex-components.js.map +1 -1
- package/fesm5/acorex-components.js +178 -26
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate, __metadata, __extends, __spread, __param, __assign, __awaiter, __generator } from 'tslib';
|
|
1
|
+
import { __decorate, __metadata, __extends, __spread, __param, __assign, __awaiter, __generator, __asyncValues } from 'tslib';
|
|
2
2
|
import { Input, Component, EventEmitter, ContentChildren, QueryList, Output, ViewChild, ContentChild, ElementRef, ɵɵdefineInjectable, ɵɵinject, Injectable, ComponentFactoryResolver, Injector, NgZone, Inject, RendererFactory2, INJECTOR, TemplateRef, ApplicationRef, ChangeDetectorRef, HostListener, ViewEncapsulation, NgModule, ChangeDetectionStrategy, Attribute, Directive, ViewContainerRef, Renderer2, ViewChildren } from '@angular/core';
|
|
3
3
|
import { AXTranslator, AXHtmlUtil, AXRenderService, AXConfig, AXDateTime, AXDateTimeRange, AXCoreModule, AXMenuItem, AXTranslatorModule, AXObjectUtil, AXScrollModule, getPropByPath, AXColorUtil } from '@acorex/core';
|
|
4
4
|
import { OverlayContainer, ScrollStrategyOptions, OverlayPositionBuilder, OverlayKeyboardDispatcher, Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
@@ -9423,6 +9423,7 @@ var AXQueryBuilderRuleComponent = /** @class */ (function () {
|
|
|
9423
9423
|
function AXQueryBuilderRuleComponent() {
|
|
9424
9424
|
var _this = this;
|
|
9425
9425
|
this.isEditing = true;
|
|
9426
|
+
this.mode = 'new';
|
|
9426
9427
|
this.fields = [];
|
|
9427
9428
|
this.onRuleDelete = new EventEmitter();
|
|
9428
9429
|
this.ruleChanged = new EventEmitter();
|
|
@@ -9753,6 +9754,10 @@ var AXQueryBuilderRuleComponent = /** @class */ (function () {
|
|
|
9753
9754
|
Input(),
|
|
9754
9755
|
__metadata("design:type", AXQueryBuilderGroup)
|
|
9755
9756
|
], AXQueryBuilderRuleComponent.prototype, "parent", void 0);
|
|
9757
|
+
__decorate([
|
|
9758
|
+
Input(),
|
|
9759
|
+
__metadata("design:type", String)
|
|
9760
|
+
], AXQueryBuilderRuleComponent.prototype, "mode", void 0);
|
|
9756
9761
|
__decorate([
|
|
9757
9762
|
Input(),
|
|
9758
9763
|
__metadata("design:type", Array)
|
|
@@ -9768,7 +9773,7 @@ var AXQueryBuilderRuleComponent = /** @class */ (function () {
|
|
|
9768
9773
|
AXQueryBuilderRuleComponent = __decorate([
|
|
9769
9774
|
Component({
|
|
9770
9775
|
selector: 'ax-query-rule',
|
|
9771
|
-
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
|
|
9776
|
+
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>",
|
|
9772
9777
|
host: { class: 'ax ax-query-rule' },
|
|
9773
9778
|
encapsulation: ViewEncapsulation.None
|
|
9774
9779
|
}),
|
|
@@ -9963,7 +9968,7 @@ var AXQueryBuilderService = /** @class */ (function () {
|
|
|
9963
9968
|
}
|
|
9964
9969
|
}
|
|
9965
9970
|
if (_this.canRun) {
|
|
9966
|
-
_this.popup.open(AXQueryBuilderPopupComponent, { data: { group: group, provideData: provideData }, title:
|
|
9971
|
+
_this.popup.open(AXQueryBuilderPopupComponent, { data: { group: group, provideData: provideData }, title: 'دریافت مقادیر' }).then(function (c) {
|
|
9967
9972
|
resolve(c);
|
|
9968
9973
|
});
|
|
9969
9974
|
}
|
|
@@ -10003,10 +10008,119 @@ var AXQueryBuilderService = /** @class */ (function () {
|
|
|
10003
10008
|
}
|
|
10004
10009
|
// }
|
|
10005
10010
|
};
|
|
10011
|
+
AXQueryBuilderService.prototype.getQueryStringSimple = function (group) {
|
|
10012
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
10013
|
+
var _this = this;
|
|
10014
|
+
return __generator(this, function (_a) {
|
|
10015
|
+
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
|
|
10016
|
+
var query, id, _a, _b, iterator, item, codeOperator, e_1_1;
|
|
10017
|
+
var e_1, _c;
|
|
10018
|
+
return __generator(this, function (_d) {
|
|
10019
|
+
switch (_d.label) {
|
|
10020
|
+
case 0:
|
|
10021
|
+
debugger;
|
|
10022
|
+
if (group.items.length > 0) {
|
|
10023
|
+
query = ' ( ';
|
|
10024
|
+
}
|
|
10025
|
+
id = 0;
|
|
10026
|
+
_d.label = 1;
|
|
10027
|
+
case 1:
|
|
10028
|
+
_d.trys.push([1, 9, 10, 15]);
|
|
10029
|
+
_a = __asyncValues(group.items);
|
|
10030
|
+
_d.label = 2;
|
|
10031
|
+
case 2: return [4 /*yield*/, _a.next()];
|
|
10032
|
+
case 3:
|
|
10033
|
+
if (!(_b = _d.sent(), !_b.done)) return [3 /*break*/, 8];
|
|
10034
|
+
iterator = _b.value;
|
|
10035
|
+
item = group.items[id];
|
|
10036
|
+
if (!item.condition) return [3 /*break*/, 5];
|
|
10037
|
+
return [4 /*yield*/, this.getQueryStringSimple(item).then(function (c) {
|
|
10038
|
+
query = query + c;
|
|
10039
|
+
})];
|
|
10040
|
+
case 4:
|
|
10041
|
+
_d.sent();
|
|
10042
|
+
return [3 /*break*/, 6];
|
|
10043
|
+
case 5:
|
|
10044
|
+
codeOperator = null;
|
|
10045
|
+
switch (item.operator) {
|
|
10046
|
+
case 'equal':
|
|
10047
|
+
codeOperator = '==';
|
|
10048
|
+
break;
|
|
10049
|
+
case 'not-equal':
|
|
10050
|
+
codeOperator = '!=';
|
|
10051
|
+
break;
|
|
10052
|
+
case 'not-null':
|
|
10053
|
+
codeOperator = '!= null';
|
|
10054
|
+
break;
|
|
10055
|
+
case 'null':
|
|
10056
|
+
codeOperator = '== null';
|
|
10057
|
+
break;
|
|
10058
|
+
case 'gt':
|
|
10059
|
+
codeOperator = '>';
|
|
10060
|
+
break;
|
|
10061
|
+
case 'gte':
|
|
10062
|
+
codeOperator = '>=';
|
|
10063
|
+
break;
|
|
10064
|
+
case 'lt':
|
|
10065
|
+
codeOperator = '<';
|
|
10066
|
+
break;
|
|
10067
|
+
case 'lte':
|
|
10068
|
+
codeOperator = '<=';
|
|
10069
|
+
break;
|
|
10070
|
+
case 'contains':
|
|
10071
|
+
codeOperator = item.operator;
|
|
10072
|
+
break;
|
|
10073
|
+
case 'start-with':
|
|
10074
|
+
codeOperator = item.operator;
|
|
10075
|
+
break;
|
|
10076
|
+
case 'end-with':
|
|
10077
|
+
codeOperator = item.operator;
|
|
10078
|
+
break;
|
|
10079
|
+
}
|
|
10080
|
+
debugger;
|
|
10081
|
+
query = query + ' ' + item.caption + ' ' + codeOperator + ' ' + item.text;
|
|
10082
|
+
_d.label = 6;
|
|
10083
|
+
case 6:
|
|
10084
|
+
if (id !== group.items.length - 1 && query != ' ( ') {
|
|
10085
|
+
query = query + ' ' + group.condition;
|
|
10086
|
+
}
|
|
10087
|
+
id += 1;
|
|
10088
|
+
_d.label = 7;
|
|
10089
|
+
case 7: return [3 /*break*/, 2];
|
|
10090
|
+
case 8: return [3 /*break*/, 15];
|
|
10091
|
+
case 9:
|
|
10092
|
+
e_1_1 = _d.sent();
|
|
10093
|
+
e_1 = { error: e_1_1 };
|
|
10094
|
+
return [3 /*break*/, 15];
|
|
10095
|
+
case 10:
|
|
10096
|
+
_d.trys.push([10, , 13, 14]);
|
|
10097
|
+
if (!(_b && !_b.done && (_c = _a.return))) return [3 /*break*/, 12];
|
|
10098
|
+
return [4 /*yield*/, _c.call(_a)];
|
|
10099
|
+
case 11:
|
|
10100
|
+
_d.sent();
|
|
10101
|
+
_d.label = 12;
|
|
10102
|
+
case 12: return [3 /*break*/, 14];
|
|
10103
|
+
case 13:
|
|
10104
|
+
if (e_1) throw e_1.error;
|
|
10105
|
+
return [7 /*endfinally*/];
|
|
10106
|
+
case 14: return [7 /*endfinally*/];
|
|
10107
|
+
case 15:
|
|
10108
|
+
if (group.items.length > 0) {
|
|
10109
|
+
query = query + ' ) ';
|
|
10110
|
+
}
|
|
10111
|
+
resolve(query);
|
|
10112
|
+
return [2 /*return*/];
|
|
10113
|
+
}
|
|
10114
|
+
});
|
|
10115
|
+
}); })];
|
|
10116
|
+
});
|
|
10117
|
+
});
|
|
10118
|
+
};
|
|
10006
10119
|
AXQueryBuilderService.prototype.getQueryString = function (group, type) {
|
|
10007
10120
|
var query = '';
|
|
10008
10121
|
switch (type) {
|
|
10009
10122
|
case 'simple':
|
|
10123
|
+
debugger;
|
|
10010
10124
|
if (group.items.length > 0) {
|
|
10011
10125
|
query = ' ( ';
|
|
10012
10126
|
}
|
|
@@ -10068,6 +10182,7 @@ var AXQueryBuilderGroupComponent = /** @class */ (function () {
|
|
|
10068
10182
|
this.qs = qs;
|
|
10069
10183
|
this.collapsed = false;
|
|
10070
10184
|
this.fields = [];
|
|
10185
|
+
this.mode = 'new';
|
|
10071
10186
|
//ruleIsEditing: boolean = true;
|
|
10072
10187
|
this.groupRuleChanged = new EventEmitter();
|
|
10073
10188
|
this.showGroupCondition = false;
|
|
@@ -10146,9 +10261,14 @@ var AXQueryBuilderGroupComponent = /** @class */ (function () {
|
|
|
10146
10261
|
this.ruleChanged(null);
|
|
10147
10262
|
};
|
|
10148
10263
|
AXQueryBuilderGroupComponent.prototype.ruleChanged = function (e) {
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
this.
|
|
10264
|
+
var _this = this;
|
|
10265
|
+
debugger;
|
|
10266
|
+
// this.group.queryString = this.qs.getQueryString(this.group, 'simple');
|
|
10267
|
+
this.qs.getQueryStringSimple(this.group).then(function (c) {
|
|
10268
|
+
_this.group.queryString = c;
|
|
10269
|
+
_this.group.queryStringElastic = _this.qs.getQueryString(_this.group, 'elastic');
|
|
10270
|
+
_this.groupRuleChanged.emit({ groups: _this.group, component: _this });
|
|
10271
|
+
});
|
|
10152
10272
|
};
|
|
10153
10273
|
AXQueryBuilderGroupComponent.ctorParameters = function () { return [
|
|
10154
10274
|
{ type: AXQueryBuilderService }
|
|
@@ -10173,6 +10293,10 @@ var AXQueryBuilderGroupComponent = /** @class */ (function () {
|
|
|
10173
10293
|
Input(),
|
|
10174
10294
|
__metadata("design:type", Array)
|
|
10175
10295
|
], AXQueryBuilderGroupComponent.prototype, "fields", void 0);
|
|
10296
|
+
__decorate([
|
|
10297
|
+
Input(),
|
|
10298
|
+
__metadata("design:type", String)
|
|
10299
|
+
], AXQueryBuilderGroupComponent.prototype, "mode", void 0);
|
|
10176
10300
|
__decorate([
|
|
10177
10301
|
Output(),
|
|
10178
10302
|
__metadata("design:type", EventEmitter)
|
|
@@ -10180,7 +10304,7 @@ var AXQueryBuilderGroupComponent = /** @class */ (function () {
|
|
|
10180
10304
|
AXQueryBuilderGroupComponent = __decorate([
|
|
10181
10305
|
Component({
|
|
10182
10306
|
selector: 'ax-query-group',
|
|
10183
|
-
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\"
|
|
10307
|
+
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>",
|
|
10184
10308
|
host: { class: 'ax ax-query-group' },
|
|
10185
10309
|
encapsulation: ViewEncapsulation.None
|
|
10186
10310
|
}),
|
|
@@ -10195,6 +10319,7 @@ var AXQueryBuilderComponent = /** @class */ (function (_super) {
|
|
|
10195
10319
|
var _this = _super.call(this) || this;
|
|
10196
10320
|
_this.ref = ref;
|
|
10197
10321
|
_this.toast = toast;
|
|
10322
|
+
_this.mode = 'new';
|
|
10198
10323
|
_this.rootGroup = new AXQueryBuilderGroup();
|
|
10199
10324
|
_this.fields = [];
|
|
10200
10325
|
// @Input()
|
|
@@ -10204,11 +10329,11 @@ var AXQueryBuilderComponent = /** @class */ (function (_super) {
|
|
|
10204
10329
|
return _this;
|
|
10205
10330
|
}
|
|
10206
10331
|
AXQueryBuilderComponent.prototype.ngOnInit = function () {
|
|
10207
|
-
this.rootGroup.condition = this.query.condition ? this.query.condition :
|
|
10332
|
+
this.rootGroup.condition = this.query.condition ? this.query.condition : 'AND';
|
|
10208
10333
|
this.rootGroup.items = this.query.items ? this.query.items : [];
|
|
10209
10334
|
};
|
|
10210
10335
|
AXQueryBuilderComponent.prototype.getQueryBuilder = function () {
|
|
10211
|
-
return
|
|
10336
|
+
return { groups: this.rootGroup };
|
|
10212
10337
|
};
|
|
10213
10338
|
AXQueryBuilderComponent.prototype.ruleChanged = function (e) {
|
|
10214
10339
|
this.onRuleChanged.emit({ component: this, groups: this.rootGroup });
|
|
@@ -10258,6 +10383,10 @@ var AXQueryBuilderComponent = /** @class */ (function (_super) {
|
|
|
10258
10383
|
Input(),
|
|
10259
10384
|
__metadata("design:type", AXQueryBuilderGroup)
|
|
10260
10385
|
], AXQueryBuilderComponent.prototype, "query", void 0);
|
|
10386
|
+
__decorate([
|
|
10387
|
+
Input(),
|
|
10388
|
+
__metadata("design:type", String)
|
|
10389
|
+
], AXQueryBuilderComponent.prototype, "mode", void 0);
|
|
10261
10390
|
__decorate([
|
|
10262
10391
|
Input(),
|
|
10263
10392
|
__metadata("design:type", Array)
|
|
@@ -10269,9 +10398,9 @@ var AXQueryBuilderComponent = /** @class */ (function (_super) {
|
|
|
10269
10398
|
AXQueryBuilderComponent = __decorate([
|
|
10270
10399
|
Component({
|
|
10271
10400
|
selector: 'ax-query-builder',
|
|
10272
|
-
template: "<ax-query-group #queryGroup [group]=\"rootGroup\" [fields]=\"fields\"
|
|
10401
|
+
template: "<ax-query-group #queryGroup [mode]=\"mode\" [group]=\"rootGroup\" [fields]=\"fields\"\r\n (groupRuleChanged)=\"ruleChanged($event)\">\r\n</ax-query-group>",
|
|
10273
10402
|
encapsulation: ViewEncapsulation.None,
|
|
10274
|
-
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-
|
|
10403
|
+
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)}"]
|
|
10275
10404
|
}),
|
|
10276
10405
|
__metadata("design:paramtypes", [ElementRef, AXToastService])
|
|
10277
10406
|
], AXQueryBuilderComponent);
|
|
@@ -11474,7 +11603,7 @@ var AXTabPageModule = /** @class */ (function () {
|
|
|
11474
11603
|
imports: [CommonModule, AXLoadingModule],
|
|
11475
11604
|
exports: [AXTabPageRendererComponent],
|
|
11476
11605
|
entryComponents: [AXTabPageRendererComponent, AXTabPageHostComponent],
|
|
11477
|
-
providers: [
|
|
11606
|
+
providers: [],
|
|
11478
11607
|
})
|
|
11479
11608
|
], AXTabPageModule);
|
|
11480
11609
|
return AXTabPageModule;
|
|
@@ -13577,7 +13706,10 @@ var AXTreeViewComponent = /** @class */ (function (_super) {
|
|
|
13577
13706
|
//seletedKeyFields set id of nodes and parents
|
|
13578
13707
|
//selectedFieldName set name of fields that set selectes
|
|
13579
13708
|
_this.selectedFieldName = null;
|
|
13580
|
-
|
|
13709
|
+
// @Input()
|
|
13710
|
+
// selectNodesRecursive: 'all' | 'parents' | 'childs' | 'none' = 'all'; //leaf
|
|
13711
|
+
_this.checkParents = true;
|
|
13712
|
+
_this.checkChilds = true;
|
|
13581
13713
|
_this.seletedKeyFields = [];
|
|
13582
13714
|
_this.keyField = 'id';
|
|
13583
13715
|
_this.hasChildField = 'child';
|
|
@@ -13711,7 +13843,8 @@ var AXTreeViewComponent = /** @class */ (function (_super) {
|
|
|
13711
13843
|
};
|
|
13712
13844
|
AXTreeViewComponent.prototype.changeChildSelect = function (item, s) {
|
|
13713
13845
|
var _this = this;
|
|
13714
|
-
if (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'childs') {
|
|
13846
|
+
// if (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'childs') {
|
|
13847
|
+
if (this.checkChilds == true) {
|
|
13715
13848
|
item.select = s;
|
|
13716
13849
|
if (item[this.hasChildField] === true && item[this.childField] && item[this.childField].length > 0) {
|
|
13717
13850
|
item[this.childField].forEach(function (elm) {
|
|
@@ -13745,7 +13878,8 @@ var AXTreeViewComponent = /** @class */ (function (_super) {
|
|
|
13745
13878
|
};
|
|
13746
13879
|
AXTreeViewComponent.prototype.changeParentSelect = function (item) {
|
|
13747
13880
|
var _this = this;
|
|
13748
|
-
if (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'parents') {
|
|
13881
|
+
//if (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'parents') {
|
|
13882
|
+
if (this.checkParents) {
|
|
13749
13883
|
var allselect = true;
|
|
13750
13884
|
var alldeselect = true;
|
|
13751
13885
|
var oneselect = false;
|
|
@@ -13865,9 +13999,11 @@ var AXTreeViewComponent = /** @class */ (function (_super) {
|
|
|
13865
13999
|
_this.seletedKeyFields.forEach(function (n) {
|
|
13866
14000
|
if (n.includes(el[_this.keyField])) {
|
|
13867
14001
|
if (el[_this.hasChildField] == true) {
|
|
13868
|
-
|
|
14002
|
+
if (_this.checkParents == false && _this.checkChilds == false) {
|
|
14003
|
+
//select parent when check child and check parent is false TODO check this Action
|
|
14004
|
+
_this.selectItem(el);
|
|
14005
|
+
}
|
|
13869
14006
|
_this.open(el);
|
|
13870
|
-
// }
|
|
13871
14007
|
}
|
|
13872
14008
|
else {
|
|
13873
14009
|
_this.selectItem(el);
|
|
@@ -13878,9 +14014,11 @@ var AXTreeViewComponent = /** @class */ (function (_super) {
|
|
|
13878
14014
|
}
|
|
13879
14015
|
else if (_this.selectedFieldName != null) {
|
|
13880
14016
|
if (el[_this.hasChildField] == true && el[_this.selectedFieldName] == true) {
|
|
13881
|
-
|
|
14017
|
+
if (_this.checkParents == false && _this.checkChilds == false) {
|
|
14018
|
+
//select parent when check child and check parent is false TODO check this Action
|
|
14019
|
+
_this.selectItem(el);
|
|
14020
|
+
}
|
|
13882
14021
|
_this.open(el);
|
|
13883
|
-
// }
|
|
13884
14022
|
}
|
|
13885
14023
|
else if (el[_this.selectedFieldName] == true) {
|
|
13886
14024
|
_this.selectItem(el);
|
|
@@ -13913,7 +14051,8 @@ var AXTreeViewComponent = /** @class */ (function (_super) {
|
|
|
13913
14051
|
if (_this.selectionLevel == 'parents' && result_1[i][_this.hasChildField] == false) {
|
|
13914
14052
|
result_1[i].disabledCheckBox = true;
|
|
13915
14053
|
}
|
|
13916
|
-
if (
|
|
14054
|
+
// if (this.selectionMode !== 'single' && (this.selectNodesRecursive == 'all' || this.selectNodesRecursive == 'childs')) {
|
|
14055
|
+
if (_this.selectionMode !== 'single' && _this.checkChilds == true) {
|
|
13917
14056
|
result_1[i].select = _this.itemRow.select === (undefined || null) ? false : _this.itemRow.select;
|
|
13918
14057
|
if (_this.itemRow.select === true && _this.selectionMode == 'multiple' && result_1[i][_this.hasChildField] === false) {
|
|
13919
14058
|
_this.selectedItems = _this.selectedItems.filter(function (c) { return c[_this.keyField] !== result_1[i][_this.keyField]; });
|
|
@@ -13928,9 +14067,11 @@ var AXTreeViewComponent = /** @class */ (function (_super) {
|
|
|
13928
14067
|
_this.seletedKeyFields.forEach(function (n) {
|
|
13929
14068
|
if (n.includes(result_1[i][_this.keyField])) {
|
|
13930
14069
|
if (result_1[i][_this.hasChildField] == true) {
|
|
13931
|
-
|
|
14070
|
+
if (_this.checkParents == false && _this.checkChilds == false) {
|
|
14071
|
+
//select parent when check child and check parent is false TODO check this Action
|
|
14072
|
+
_this.selectItem(result_1[i]);
|
|
14073
|
+
}
|
|
13932
14074
|
_this.open(result_1[i]);
|
|
13933
|
-
// }
|
|
13934
14075
|
}
|
|
13935
14076
|
else {
|
|
13936
14077
|
_this.selectItem(result_1[i]);
|
|
@@ -13941,9 +14082,11 @@ var AXTreeViewComponent = /** @class */ (function (_super) {
|
|
|
13941
14082
|
}
|
|
13942
14083
|
else if (_this.selectedFieldName != null) {
|
|
13943
14084
|
if (result_1[i][_this.hasChildField] == true && result_1[i][_this.selectedFieldName] == true) {
|
|
13944
|
-
|
|
14085
|
+
if (_this.checkParents == false && _this.checkChilds == false) {
|
|
14086
|
+
//select parent when check child and check parent is false TODO check this Action
|
|
14087
|
+
_this.selectItem(result_1[i]);
|
|
14088
|
+
}
|
|
13945
14089
|
_this.open(result_1[i]);
|
|
13946
|
-
// }
|
|
13947
14090
|
}
|
|
13948
14091
|
else if (result_1[i][_this.selectedFieldName] == true) {
|
|
13949
14092
|
_this.selectItem(result_1[i]);
|
|
@@ -14115,6 +14258,11 @@ var AXTreeViewComponent = /** @class */ (function (_super) {
|
|
|
14115
14258
|
this.internalSelectItem(item, false);
|
|
14116
14259
|
}
|
|
14117
14260
|
};
|
|
14261
|
+
AXTreeViewComponent.prototype.unSelectItem = function (item) {
|
|
14262
|
+
if (item['select'] == true) {
|
|
14263
|
+
this.internalSelectItem(item, false);
|
|
14264
|
+
}
|
|
14265
|
+
};
|
|
14118
14266
|
AXTreeViewComponent.prototype.open = function (item) {
|
|
14119
14267
|
if (item['toggle'] !== true) {
|
|
14120
14268
|
this.toggleNode(item, true);
|
|
@@ -14198,8 +14346,12 @@ var AXTreeViewComponent = /** @class */ (function (_super) {
|
|
|
14198
14346
|
], AXTreeViewComponent.prototype, "selectedFieldName", void 0);
|
|
14199
14347
|
__decorate([
|
|
14200
14348
|
Input(),
|
|
14201
|
-
__metadata("design:type",
|
|
14202
|
-
], AXTreeViewComponent.prototype, "
|
|
14349
|
+
__metadata("design:type", Boolean)
|
|
14350
|
+
], AXTreeViewComponent.prototype, "checkParents", void 0);
|
|
14351
|
+
__decorate([
|
|
14352
|
+
Input(),
|
|
14353
|
+
__metadata("design:type", Boolean)
|
|
14354
|
+
], AXTreeViewComponent.prototype, "checkChilds", void 0);
|
|
14203
14355
|
__decorate([
|
|
14204
14356
|
Input(),
|
|
14205
14357
|
__metadata("design:type", Array)
|