@acorex/components 3.0.46 → 3.0.51
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 +171 -80
- 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/calendar/calendar-box/calendar-box.component.js +6 -6
- package/esm2015/lib/date-picker/date-picker.component.js +3 -2
- package/esm2015/lib/dropdown/dropdown.component.js +3 -2
- package/esm2015/lib/menu/menu2.component.js +1 -1
- package/esm2015/lib/property-editor/editors/color-editor/color.editor.js +2 -2
- package/esm2015/lib/property-editor/editors/column-editor/column.editor.js +2 -2
- package/esm2015/lib/property-editor/editors/conditional-color-editor/conditional-color.editor.js +2 -2
- package/esm2015/lib/property-editor/editors/date-editor/date.editor.js +2 -2
- package/esm2015/lib/property-editor/editors/number-editor/number.editor.js +2 -2
- package/esm2015/lib/property-editor/editors/range-editor/range.editor.js +2 -2
- package/esm2015/lib/property-editor/editors/selectbox-editor/selectbox.editor.js +22 -12
- package/esm2015/lib/property-editor/editors/switch-editor/number.editor.js +2 -2
- package/esm2015/lib/property-editor/editors/text-editor/text.editor.js +2 -2
- package/esm2015/lib/property-editor/editors/time-editor/time.editor.js +2 -2
- package/esm2015/lib/property-editor/property-editor-renderer.directive.js +83 -37
- package/esm2015/lib/property-editor/property-editor.class.js +18 -4
- package/esm2015/lib/query-builder/query-builder-rule.component.js +5 -1
- package/esm2015/lib/query-builder/query-builder.service.js +4 -4
- package/esm2015/lib/selection-list/selection-list.component.js +6 -7
- package/esm2015/lib/tab-strip/tab-strip.component.js +11 -9
- package/esm5/lib/calendar/calendar-box/calendar-box.component.js +6 -6
- package/esm5/lib/date-picker/date-picker.component.js +3 -2
- package/esm5/lib/dropdown/dropdown.component.js +3 -2
- package/esm5/lib/menu/menu2.component.js +1 -1
- package/esm5/lib/property-editor/editors/color-editor/color.editor.js +2 -2
- package/esm5/lib/property-editor/editors/column-editor/column.editor.js +2 -2
- package/esm5/lib/property-editor/editors/conditional-color-editor/conditional-color.editor.js +2 -2
- package/esm5/lib/property-editor/editors/date-editor/date.editor.js +2 -2
- package/esm5/lib/property-editor/editors/number-editor/number.editor.js +2 -2
- package/esm5/lib/property-editor/editors/range-editor/range.editor.js +2 -2
- package/esm5/lib/property-editor/editors/selectbox-editor/selectbox.editor.js +26 -12
- package/esm5/lib/property-editor/editors/switch-editor/number.editor.js +2 -2
- package/esm5/lib/property-editor/editors/text-editor/text.editor.js +2 -2
- package/esm5/lib/property-editor/editors/time-editor/time.editor.js +2 -2
- package/esm5/lib/property-editor/property-editor-renderer.directive.js +89 -39
- package/esm5/lib/property-editor/property-editor.class.js +24 -4
- package/esm5/lib/query-builder/query-builder-rule.component.js +5 -1
- package/esm5/lib/query-builder/query-builder.service.js +4 -4
- package/esm5/lib/selection-list/selection-list.component.js +3 -4
- package/esm5/lib/tab-strip/tab-strip.component.js +11 -9
- package/fesm2015/acorex-components.js +159 -82
- package/fesm2015/acorex-components.js.map +1 -1
- package/fesm5/acorex-components.js +172 -81
- package/fesm5/acorex-components.js.map +1 -1
- package/lib/property-editor/editors/selectbox-editor/selectbox.editor.d.ts +7 -4
- package/lib/property-editor/property-editor-renderer.directive.d.ts +5 -3
- package/lib/property-editor/property-editor.class.d.ts +4 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
-
import { AXTranslator, AXHtmlUtil, AXRenderService, AXConfig, AXDateTime, AXDateTimeRange, AXCoreModule, AXMenuItem, AXTranslatorModule, AXObjectUtil, AXScrollModule,
|
|
3
|
+
import { AXTranslator, AXHtmlUtil, AXRenderService, AXConfig, AXDateTime, AXDateTimeRange, AXCoreModule, AXMenuItem, AXTranslatorModule, AXObjectUtil, AXScrollModule, setPropByPath, AXEventService, AXColorUtil } from '@acorex/core';
|
|
4
4
|
import { OverlayContainer, ScrollStrategyOptions, OverlayPositionBuilder, OverlayKeyboardDispatcher, Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
5
5
|
import { TemplatePortal, ComponentPortal, CdkPortalOutlet, PortalModule } from '@angular/cdk/portal';
|
|
6
6
|
import { merge, Subject, Observable } from 'rxjs';
|
|
@@ -1171,7 +1171,7 @@ var AXCalendarBoxComponent = /** @class */ (function () {
|
|
|
1171
1171
|
configurable: true
|
|
1172
1172
|
});
|
|
1173
1173
|
AXCalendarBoxComponent.prototype.findDay = function (date) {
|
|
1174
|
-
if (this.dayStyle.find(function (c) { return c.date == date.toISOString().split('T')[0]; })) {
|
|
1174
|
+
if (this.dayStyle.find(function (c) { return c.date.split('T')[0] == date.toISOString().split('T')[0]; })) {
|
|
1175
1175
|
return true;
|
|
1176
1176
|
}
|
|
1177
1177
|
else {
|
|
@@ -1179,16 +1179,16 @@ var AXCalendarBoxComponent = /** @class */ (function () {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
};
|
|
1181
1181
|
AXCalendarBoxComponent.prototype.getStyle = function (date) {
|
|
1182
|
-
if (this.dayStyle.find(function (c) { return c.date == date.toISOString().split('T')[0]; })) {
|
|
1183
|
-
return this.dayStyle.find(function (c) { return c.date == date.toISOString().split('T')[0]; }).style;
|
|
1182
|
+
if (this.dayStyle.find(function (c) { return c.date.split('T')[0] == date.toISOString().split('T')[0]; })) {
|
|
1183
|
+
return this.dayStyle.find(function (c) { return c.date.split('T')[0] == date.toISOString().split('T')[0]; }).style;
|
|
1184
1184
|
}
|
|
1185
1185
|
else {
|
|
1186
1186
|
return '';
|
|
1187
1187
|
}
|
|
1188
1188
|
};
|
|
1189
1189
|
AXCalendarBoxComponent.prototype.getTitle = function (date) {
|
|
1190
|
-
if (this.dayStyle.find(function (c) { return c.date == date.toISOString().split('T')[0]; })) {
|
|
1191
|
-
return this.dayStyle.find(function (c) { return c.date == date.toISOString().split('T')[0]; }).text;
|
|
1190
|
+
if (this.dayStyle.find(function (c) { return c.date.split('T')[0] == date.toISOString().split('T')[0]; })) {
|
|
1191
|
+
return this.dayStyle.find(function (c) { return c.date.split('T')[0] == date.toISOString().split('T')[0]; }).text;
|
|
1192
1192
|
}
|
|
1193
1193
|
else {
|
|
1194
1194
|
return '';
|
|
@@ -3242,7 +3242,7 @@ var AXMenu2Component = /** @class */ (function () {
|
|
|
3242
3242
|
selector: 'ax-menu2',
|
|
3243
3243
|
template: "\n <div class=\"ax ax-menu ax-menu-vertical\" [attr.data-level]=\"level\">\n <ax-menu-item\n *ngFor=\"let item of items\"\n [level]=\"level\"\n [item]=\"item\"\n (showSubMenu)=\"showSubmenu($event)\">\n </ax-menu-item>\n </div>\n ",
|
|
3244
3244
|
encapsulation: ViewEncapsulation.None,
|
|
3245
|
-
styles: [".ax.ax-menu{display:flex}.ax.ax-menu.ax-menu-vertical[data-level=\"0\"]{display:flex;flex-direction:row}.ax.ax-menu.ax-menu-vertical:not([data-level=\"0\"]){display:flex;transition:opacity .3s;min-width:12em;box-shadow:0 1px 7px 0 var(--ax-border-color);background:#fff;flex-direction:column}.ax.ax-menu.ax-menu-vertical .ax-menu-item{display:flex;white-space:nowrap;cursor:pointer;padding:0 10px;font-weight:400;font-size:1rem;line-height:40px;text-decoration:none;align-items:center}.ax.ax-menu.ax-menu-vertical .ax-menu-item .icon:first-child{-webkit-margin-end:var(--ax-size-md);margin-inline-end:var(--ax-size-md)}.ax.ax-menu.ax-menu-vertical .ax-menu-item .icon:last-child{-webkit-margin-start:var(--ax-size-md);margin-inline-start:var(--ax-size-md)}.ax.ax-menu.ax-menu-vertical .ax-menu-item span{flex:1}.ax.ax-menu.ax-menu-vertical .ax-menu-item.disabled{
|
|
3245
|
+
styles: [".ax.ax-menu{display:flex}.ax.ax-menu.ax-menu-vertical[data-level=\"0\"]{display:flex;flex-direction:row}.ax.ax-menu.ax-menu-vertical:not([data-level=\"0\"]){display:flex;transition:opacity .3s;min-width:12em;box-shadow:0 1px 7px 0 var(--ax-border-color);background:#fff;flex-direction:column}.ax.ax-menu.ax-menu-vertical .ax-menu-item{display:flex;white-space:nowrap;cursor:pointer;padding:0 10px;font-weight:400;font-size:1rem;line-height:40px;text-decoration:none;align-items:center}.ax.ax-menu.ax-menu-vertical .ax-menu-item .icon:first-child{-webkit-margin-end:var(--ax-size-md);margin-inline-end:var(--ax-size-md)}.ax.ax-menu.ax-menu-vertical .ax-menu-item .icon:last-child{-webkit-margin-start:var(--ax-size-md);margin-inline-start:var(--ax-size-md)}.ax.ax-menu.ax-menu-vertical .ax-menu-item span{flex:1}.ax.ax-menu.ax-menu-vertical .ax-menu-item.disabled{opacity:.6;cursor:not-allowed!important}.ax.ax-menu.ax-menu-vertical .ax-menu-item.disabled .icon{color:var(--ax-gray-dark-color)!important}.ax.ax-menu.ax-menu-vertical .ax-menu-item.disabled:hover{cursor:not-allowed!important}"]
|
|
3246
3246
|
}),
|
|
3247
3247
|
__metadata("design:paramtypes", [Overlay,
|
|
3248
3248
|
ViewContainerRef,
|
|
@@ -4019,8 +4019,7 @@ var AXSelectionListComponent = /** @class */ (function (_super) {
|
|
|
4019
4019
|
}
|
|
4020
4020
|
}
|
|
4021
4021
|
};
|
|
4022
|
-
AXSelectionListComponent.prototype.focus = function () {
|
|
4023
|
-
};
|
|
4022
|
+
AXSelectionListComponent.prototype.focus = function () { };
|
|
4024
4023
|
AXSelectionListComponent.prototype.onvalueChanged = function (e) {
|
|
4025
4024
|
if (!this.disabled) {
|
|
4026
4025
|
this.selectedItemsChange.emit([e]);
|
|
@@ -4086,7 +4085,7 @@ var AXSelectionListComponent = /** @class */ (function (_super) {
|
|
|
4086
4085
|
AXSelectionListComponent = __decorate([
|
|
4087
4086
|
Component({
|
|
4088
4087
|
selector: 'ax-selection-list',
|
|
4089
|
-
template: "<ng-container *ngIf=\" mode == 'multiple'; then checkboxList; else radioButtonList\"></ng-container>\r\n<ng-template #checkboxList>\r\n <div class=\"ax selection-list {{size}}\" [ngClass]=\"direction\">\r\n <ax-check-box label=\"{{item[textField]}}\" *ngFor=\"let item of items\" [disabled]=\"disabled\"
|
|
4088
|
+
template: "<ng-container *ngIf=\" mode == 'multiple'; then checkboxList; else radioButtonList\"></ng-container>\r\n<ng-template #checkboxList>\r\n <div class=\"ax selection-list {{size}}\" [ngClass]=\"direction\">\r\n <ax-check-box label=\"{{item[textField]}}\" *ngFor=\"let item of items\" [disabled]=\"item.disable || disabled\"\r\n [readonly]=\"item.readonly || readonly\" [value]=\"selectedValues.indexOf(item[valueField])>-1\"\r\n (onValueChanged)=\"onCheckValueChange(item[valueField],$event.value)\">\r\n </ax-check-box>\r\n </div>\r\n</ng-template>\r\n<ng-template #radioButtonList>\r\n <div class=\"ax selection-list {{size}}\" [ngClass]=\"direction\">\r\n <label class=\"ax radio\" for=\"{{uid}}\" [class.disabled]=\"disabled\" [class.readonly]=\"disabled\"\r\n *ngFor=\"let item of items\" (click)=\"onvalueChanged(item)\">\r\n {{ item[textField] }}\r\n <input type=\"radio\" (change)=\"onCheckValueChange(item[valueField],true)\" [value]=\"item[valueField]\"\r\n [checked]=\"selectedValues==item[valueField]\" [name]=\"uid\" [disabled]=\"item.disable || disabled\"\r\n [readonly]=\"item.readonly || readonly\" />\r\n <span class=\"checkmark\"></span>\r\n </label>\r\n </div>\r\n</ng-template>",
|
|
4090
4089
|
encapsulation: ViewEncapsulation.None,
|
|
4091
4090
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
4092
4091
|
}),
|
|
@@ -5316,7 +5315,8 @@ var AXDropdownComponent = /** @class */ (function (_super) {
|
|
|
5316
5315
|
var _this = this;
|
|
5317
5316
|
if (!this.overlayRef) {
|
|
5318
5317
|
var targetEl = document.querySelector('#' + this.uid);
|
|
5319
|
-
var positionStrategy = this.overlay
|
|
5318
|
+
var positionStrategy = this.overlay
|
|
5319
|
+
.position()
|
|
5320
5320
|
.flexibleConnectedTo(targetEl)
|
|
5321
5321
|
.withPositions([
|
|
5322
5322
|
{
|
|
@@ -5506,7 +5506,8 @@ var AXDatePickerComponent = /** @class */ (function (_super) {
|
|
|
5506
5506
|
this.value = new Date();
|
|
5507
5507
|
};
|
|
5508
5508
|
AXDatePickerComponent.prototype.focus = function () {
|
|
5509
|
-
this.dropdown.focus();
|
|
5509
|
+
// this.dropdown.focus();
|
|
5510
|
+
this.input.focus();
|
|
5510
5511
|
};
|
|
5511
5512
|
AXDatePickerComponent.prototype.convertMaskToDate = function (text) {
|
|
5512
5513
|
if (this.type == 'jalali') {
|
|
@@ -9475,6 +9476,10 @@ var AXQueryBuilderRuleComponent = /** @class */ (function () {
|
|
|
9475
9476
|
value: 'not-contains',
|
|
9476
9477
|
text: AXTranslator.get('queryBuilder.not-contains')
|
|
9477
9478
|
},
|
|
9479
|
+
{
|
|
9480
|
+
value: 'contains-all',
|
|
9481
|
+
text: AXTranslator.get('queryBuilder.contains-all')
|
|
9482
|
+
},
|
|
9478
9483
|
{
|
|
9479
9484
|
value: 'null',
|
|
9480
9485
|
text: AXTranslator.get('queryBuilder.null')
|
|
@@ -10034,7 +10039,6 @@ var AXQueryBuilderService = /** @class */ (function () {
|
|
|
10034
10039
|
return __generator(this, function (_d) {
|
|
10035
10040
|
switch (_d.label) {
|
|
10036
10041
|
case 0:
|
|
10037
|
-
;
|
|
10038
10042
|
if (group.items.length > 0) {
|
|
10039
10043
|
query = ' ( ';
|
|
10040
10044
|
}
|
|
@@ -10092,8 +10096,10 @@ var AXQueryBuilderService = /** @class */ (function () {
|
|
|
10092
10096
|
case 'end-with':
|
|
10093
10097
|
codeOperator = item.operator;
|
|
10094
10098
|
break;
|
|
10099
|
+
default:
|
|
10100
|
+
codeOperator = item.operator;
|
|
10101
|
+
break;
|
|
10095
10102
|
}
|
|
10096
|
-
;
|
|
10097
10103
|
query = query + ' ' + item.caption + ' ' + codeOperator + ' ' + item.text;
|
|
10098
10104
|
_d.label = 6;
|
|
10099
10105
|
case 6:
|
|
@@ -10136,7 +10142,6 @@ var AXQueryBuilderService = /** @class */ (function () {
|
|
|
10136
10142
|
var query = '';
|
|
10137
10143
|
switch (type) {
|
|
10138
10144
|
case 'simple':
|
|
10139
|
-
;
|
|
10140
10145
|
if (group.items.length > 0) {
|
|
10141
10146
|
query = ' ( ';
|
|
10142
10147
|
}
|
|
@@ -11640,13 +11645,15 @@ var AXTabStripComponent = /** @class */ (function () {
|
|
|
11640
11645
|
}
|
|
11641
11646
|
AXTabStripComponent.prototype.ngOnInit = function () { };
|
|
11642
11647
|
AXTabStripComponent.prototype.handleClick = function (i) {
|
|
11643
|
-
|
|
11644
|
-
|
|
11645
|
-
|
|
11646
|
-
|
|
11647
|
-
|
|
11648
|
-
|
|
11649
|
-
|
|
11648
|
+
if (!i.disable) {
|
|
11649
|
+
this.items.forEach(function (c) { return (c.active = false); });
|
|
11650
|
+
i.active = true;
|
|
11651
|
+
this.onTabChanged.emit({
|
|
11652
|
+
component: this,
|
|
11653
|
+
seledtedTab: i,
|
|
11654
|
+
htmlElement: this.ref.nativeElement
|
|
11655
|
+
});
|
|
11656
|
+
}
|
|
11650
11657
|
};
|
|
11651
11658
|
AXTabStripComponent.ctorParameters = function () { return [
|
|
11652
11659
|
{ type: ElementRef }
|
|
@@ -11662,7 +11669,7 @@ var AXTabStripComponent = /** @class */ (function () {
|
|
|
11662
11669
|
AXTabStripComponent = __decorate([
|
|
11663
11670
|
Component({
|
|
11664
11671
|
selector: 'ax-tab-strip',
|
|
11665
|
-
template: "<ul class=\"tab-strip-container\">\r\n <ng-container *ngFor=\"let item of items\">\r\n <li [class.active]=\"item.active\" (click)=\"handleClick(item)\">{{item.text}}</li>\r\n </ng-container>\r\n</ul>"
|
|
11672
|
+
template: "<ul class=\"tab-strip-container\">\r\n <ng-container *ngFor=\"let item of items\">\r\n <li *ngIf=\"!!item.visible || item.visible == undefined\" [class.active]=\"item.active\"\r\n [class.disabled]=\"item.disable\" (click)=\"handleClick(item)\">{{item.text}}</li>\r\n </ng-container>\r\n</ul>"
|
|
11666
11673
|
}),
|
|
11667
11674
|
__metadata("design:paramtypes", [ElementRef])
|
|
11668
11675
|
], AXTabStripComponent);
|
|
@@ -14767,12 +14774,25 @@ var AXAccordionModule = /** @class */ (function () {
|
|
|
14767
14774
|
|
|
14768
14775
|
var AXProperyEditorComponent = /** @class */ (function () {
|
|
14769
14776
|
function AXProperyEditorComponent(cdr) {
|
|
14777
|
+
var _this = this;
|
|
14770
14778
|
this.cdr = cdr;
|
|
14771
14779
|
this.readonly = false;
|
|
14772
|
-
this.
|
|
14780
|
+
this._initiated = false;
|
|
14781
|
+
this._valueBound = false;
|
|
14773
14782
|
this.validatableComponentRegistered = new Subject();
|
|
14774
14783
|
this.valueChange = new EventEmitter();
|
|
14784
|
+
this.onRenderCompleted = new EventEmitter();
|
|
14785
|
+
this.onRenderCompleted.subscribe(function () {
|
|
14786
|
+
_this._initiated = true;
|
|
14787
|
+
});
|
|
14775
14788
|
}
|
|
14789
|
+
Object.defineProperty(AXProperyEditorComponent.prototype, "initiated", {
|
|
14790
|
+
get: function () {
|
|
14791
|
+
return this._initiated && this._valueBound;
|
|
14792
|
+
},
|
|
14793
|
+
enumerable: true,
|
|
14794
|
+
configurable: true
|
|
14795
|
+
});
|
|
14776
14796
|
AXProperyEditorComponent.prototype.registerForValidationForm = function (component) {
|
|
14777
14797
|
this.validatableComponentRegistered.next(component);
|
|
14778
14798
|
};
|
|
@@ -14781,10 +14801,15 @@ var AXProperyEditorComponent = /** @class */ (function () {
|
|
|
14781
14801
|
return this._value;
|
|
14782
14802
|
},
|
|
14783
14803
|
set: function (v) {
|
|
14804
|
+
var _this = this;
|
|
14784
14805
|
if (v !== this._value) {
|
|
14785
14806
|
this._value = v;
|
|
14786
14807
|
this.valueChange.emit(v);
|
|
14787
14808
|
this.cdr.detectChanges();
|
|
14809
|
+
//TODO: find better solution
|
|
14810
|
+
setTimeout(function () {
|
|
14811
|
+
_this._valueBound = true;
|
|
14812
|
+
}, 100);
|
|
14788
14813
|
}
|
|
14789
14814
|
},
|
|
14790
14815
|
enumerable: true,
|
|
@@ -14793,12 +14818,14 @@ var AXProperyEditorComponent = /** @class */ (function () {
|
|
|
14793
14818
|
AXProperyEditorComponent.prototype.handleValueChange = function (v) {
|
|
14794
14819
|
this.value = v;
|
|
14795
14820
|
};
|
|
14796
|
-
AXProperyEditorComponent.prototype.initiat = function () {
|
|
14797
|
-
};
|
|
14798
14821
|
__decorate([
|
|
14799
14822
|
Output(),
|
|
14800
14823
|
__metadata("design:type", EventEmitter)
|
|
14801
14824
|
], AXProperyEditorComponent.prototype, "valueChange", void 0);
|
|
14825
|
+
__decorate([
|
|
14826
|
+
Output(),
|
|
14827
|
+
__metadata("design:type", EventEmitter)
|
|
14828
|
+
], AXProperyEditorComponent.prototype, "onRenderCompleted", void 0);
|
|
14802
14829
|
__decorate([
|
|
14803
14830
|
Input(),
|
|
14804
14831
|
__metadata("design:type", Object),
|
|
@@ -14861,11 +14888,12 @@ function propertyEditor(options) {
|
|
|
14861
14888
|
}
|
|
14862
14889
|
|
|
14863
14890
|
var AXPropertyEditorRendererDirective = /** @class */ (function () {
|
|
14864
|
-
function AXPropertyEditorRendererDirective(target, componentFactoryResolver, renderService) {
|
|
14891
|
+
function AXPropertyEditorRendererDirective(target, componentFactoryResolver, renderService, eventService) {
|
|
14865
14892
|
this.target = target;
|
|
14866
14893
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
14867
14894
|
this.renderService = renderService;
|
|
14868
|
-
this.
|
|
14895
|
+
this.eventService = eventService;
|
|
14896
|
+
this._context = {};
|
|
14869
14897
|
this.onValueChange = new EventEmitter();
|
|
14870
14898
|
}
|
|
14871
14899
|
Object.defineProperty(AXPropertyEditorRendererDirective.prototype, "context", {
|
|
@@ -14874,9 +14902,6 @@ var AXPropertyEditorRendererDirective = /** @class */ (function () {
|
|
|
14874
14902
|
},
|
|
14875
14903
|
set: function (v) {
|
|
14876
14904
|
this._context = v;
|
|
14877
|
-
if (v && this.instance) {
|
|
14878
|
-
this.assignProps();
|
|
14879
|
-
}
|
|
14880
14905
|
},
|
|
14881
14906
|
enumerable: true,
|
|
14882
14907
|
configurable: true
|
|
@@ -14895,60 +14920,110 @@ var AXPropertyEditorRendererDirective = /** @class */ (function () {
|
|
|
14895
14920
|
var cmpRef = _this.target.createComponent(factory);
|
|
14896
14921
|
_this.instance = cmpRef.instance;
|
|
14897
14922
|
_this.subscription = _this.instance.valueChange.subscribe(function (value) {
|
|
14898
|
-
|
|
14899
|
-
|
|
14900
|
-
|
|
14923
|
+
var _a, _b;
|
|
14924
|
+
_this.property.value = value;
|
|
14925
|
+
_this.onValueChange.emit(_this.property);
|
|
14926
|
+
if ((_b = (_a = _this.property) === null || _a === void 0 ? void 0 : _a.property) === null || _b === void 0 ? void 0 : _b.name) {
|
|
14927
|
+
setTimeout(function () {
|
|
14928
|
+
_this.eventService.broadcast("props-" + _this.groupId + "-" + _this.property.property.name, _this.property);
|
|
14929
|
+
}, 0);
|
|
14901
14930
|
}
|
|
14902
14931
|
});
|
|
14903
|
-
|
|
14932
|
+
_this.watchChanges();
|
|
14933
|
+
_this.assignProps();
|
|
14934
|
+
_this.instance.value = _this.property.value;
|
|
14935
|
+
// this.instance.onRenderCompleted.subscribe(() => {
|
|
14936
|
+
// });
|
|
14904
14937
|
if (_this.validationForm) {
|
|
14905
14938
|
_this.instance.validatableComponentRegistered.subscribe(function (v) {
|
|
14906
14939
|
_this.validationForm.addWidget(v);
|
|
14907
14940
|
});
|
|
14908
14941
|
}
|
|
14909
|
-
//
|
|
14910
|
-
//setTimeout(() => {
|
|
14911
|
-
_this.instance.readonly = _this.readonly;
|
|
14912
|
-
_this.assignProps();
|
|
14913
|
-
_this.instance.value = _this.property.value;
|
|
14914
|
-
_this.instance.initiat();
|
|
14915
|
-
cmpRef.changeDetectorRef.markForCheck();
|
|
14916
|
-
//});
|
|
14917
14942
|
}
|
|
14918
14943
|
});
|
|
14919
14944
|
};
|
|
14920
|
-
AXPropertyEditorRendererDirective.prototype.
|
|
14945
|
+
AXPropertyEditorRendererDirective.prototype.watchChanges = function () {
|
|
14921
14946
|
var _this = this;
|
|
14947
|
+
var _a, _b;
|
|
14948
|
+
var varsRegx = /((\$\{[a-zA-Z_0-9]+\})+)/gm;
|
|
14949
|
+
var varNameRegx = /[a-zA-Z_0-9]+/gm;
|
|
14922
14950
|
var options = this.property.property.editorOptions;
|
|
14923
14951
|
if (!options) {
|
|
14924
14952
|
return;
|
|
14925
14953
|
}
|
|
14926
14954
|
var _loop_1 = function (p) {
|
|
14955
|
+
if (options.hasOwnProperty(p)) {
|
|
14956
|
+
var opt_1 = options[p];
|
|
14957
|
+
var vars_1 = typeof opt_1 === 'string' ? (_a = opt_1) === null || _a === void 0 ? void 0 : _a.match(varsRegx) : [];
|
|
14958
|
+
// bind the props
|
|
14959
|
+
if ((_b = vars_1) === null || _b === void 0 ? void 0 : _b.length) {
|
|
14960
|
+
vars_1.forEach(function (v) {
|
|
14961
|
+
var _a;
|
|
14962
|
+
var path = ((_a = v.match(varNameRegx)) === null || _a === void 0 ? void 0 : _a.length) ? v.match(varNameRegx)[0] : null;
|
|
14963
|
+
if (path) {
|
|
14964
|
+
_this.eventService.on("props-" + _this.groupId + "-" + path, function (e) {
|
|
14965
|
+
var execCode = opt_1.slice();
|
|
14966
|
+
var params = {};
|
|
14967
|
+
vars_1.forEach(function (vv) {
|
|
14968
|
+
var _a;
|
|
14969
|
+
var p2 = ((_a = vv.match(varNameRegx)) === null || _a === void 0 ? void 0 : _a.length) ? vv.match(varNameRegx)[0] : null;
|
|
14970
|
+
params[p2] = AXObjectUtil.deepCopy(_this.context[p2]) || null;
|
|
14971
|
+
execCode = execCode.replace(vv, "__params__." + p2);
|
|
14972
|
+
});
|
|
14973
|
+
var func = new Function('__params__', "try { return " + execCode + "} catch(e){ console.log(e); return null; }");
|
|
14974
|
+
var val = func(params);
|
|
14975
|
+
var keys = p.split('.');
|
|
14976
|
+
var prop = Object.assign({}, _this.instance[keys[0]]);
|
|
14977
|
+
if (keys.length > 1) {
|
|
14978
|
+
_this.instance[keys[0]] = setPropByPath(prop, p, val);
|
|
14979
|
+
}
|
|
14980
|
+
else {
|
|
14981
|
+
setPropByPath(_this.instance, p, val);
|
|
14982
|
+
}
|
|
14983
|
+
});
|
|
14984
|
+
}
|
|
14985
|
+
});
|
|
14986
|
+
}
|
|
14987
|
+
// else {
|
|
14988
|
+
// this.assignProps();
|
|
14989
|
+
// }
|
|
14990
|
+
}
|
|
14991
|
+
};
|
|
14992
|
+
for (var p in options) {
|
|
14993
|
+
_loop_1(p);
|
|
14994
|
+
}
|
|
14995
|
+
};
|
|
14996
|
+
AXPropertyEditorRendererDirective.prototype.assignProps = function () {
|
|
14997
|
+
var _this = this;
|
|
14998
|
+
var _a, _b;
|
|
14999
|
+
var options = this.property.property.editorOptions;
|
|
15000
|
+
if (!options) {
|
|
15001
|
+
return;
|
|
15002
|
+
}
|
|
15003
|
+
var varsRegx = /((\$\{[a-zA-Z_0-9]+\})+)/gm;
|
|
15004
|
+
var _loop_2 = function (p) {
|
|
14927
15005
|
if (options.hasOwnProperty(p)) {
|
|
14928
15006
|
var opt = options[p];
|
|
14929
|
-
|
|
14930
|
-
|
|
14931
|
-
|
|
14932
|
-
if (val) {
|
|
14933
|
-
this_1.instance[p] = typeof val === 'function' ? val({ data: this_1.context, host: this_1.host }, this_1.property) : val;
|
|
14934
|
-
}
|
|
15007
|
+
var vars = typeof opt === 'string' ? (_a = opt) === null || _a === void 0 ? void 0 : _a.match(varsRegx) : [];
|
|
15008
|
+
if ((_b = vars) === null || _b === void 0 ? void 0 : _b.length) {
|
|
15009
|
+
return "continue";
|
|
14935
15010
|
}
|
|
14936
15011
|
else {
|
|
14937
|
-
var
|
|
14938
|
-
if (
|
|
14939
|
-
|
|
14940
|
-
_this.instance
|
|
15012
|
+
var val_1 = typeof opt === 'function' ? opt({ data: this_1.context, host: this_1.host }, this_1.property) : opt;
|
|
15013
|
+
if (val_1 instanceof Promise) {
|
|
15014
|
+
val_1.then(function (v) {
|
|
15015
|
+
setPropByPath(_this.instance, p, val_1);
|
|
14941
15016
|
});
|
|
14942
15017
|
}
|
|
14943
15018
|
else {
|
|
14944
|
-
this_1.instance
|
|
15019
|
+
setPropByPath(this_1.instance, p, val_1);
|
|
14945
15020
|
}
|
|
14946
15021
|
}
|
|
14947
15022
|
}
|
|
14948
15023
|
};
|
|
14949
15024
|
var this_1 = this;
|
|
14950
15025
|
for (var p in options) {
|
|
14951
|
-
|
|
15026
|
+
_loop_2(p);
|
|
14952
15027
|
}
|
|
14953
15028
|
};
|
|
14954
15029
|
AXPropertyEditorRendererDirective.prototype.ngOnDestroy = function () {
|
|
@@ -14959,16 +15034,13 @@ var AXPropertyEditorRendererDirective = /** @class */ (function () {
|
|
|
14959
15034
|
AXPropertyEditorRendererDirective.ctorParameters = function () { return [
|
|
14960
15035
|
{ type: ViewContainerRef },
|
|
14961
15036
|
{ type: ComponentFactoryResolver },
|
|
14962
|
-
{ type: AXRenderService }
|
|
15037
|
+
{ type: AXRenderService },
|
|
15038
|
+
{ type: AXEventService }
|
|
14963
15039
|
]; };
|
|
14964
15040
|
__decorate([
|
|
14965
15041
|
Input(),
|
|
14966
15042
|
__metadata("design:type", Object)
|
|
14967
15043
|
], AXPropertyEditorRendererDirective.prototype, "property", void 0);
|
|
14968
|
-
__decorate([
|
|
14969
|
-
Input(),
|
|
14970
|
-
__metadata("design:type", Boolean)
|
|
14971
|
-
], AXPropertyEditorRendererDirective.prototype, "readonly", void 0);
|
|
14972
15044
|
__decorate([
|
|
14973
15045
|
Input(),
|
|
14974
15046
|
__metadata("design:type", AXValidationFormComponent)
|
|
@@ -14982,6 +15054,10 @@ var AXPropertyEditorRendererDirective = /** @class */ (function () {
|
|
|
14982
15054
|
Input(),
|
|
14983
15055
|
__metadata("design:type", Object)
|
|
14984
15056
|
], AXPropertyEditorRendererDirective.prototype, "host", void 0);
|
|
15057
|
+
__decorate([
|
|
15058
|
+
Input(),
|
|
15059
|
+
__metadata("design:type", Object)
|
|
15060
|
+
], AXPropertyEditorRendererDirective.prototype, "groupId", void 0);
|
|
14985
15061
|
__decorate([
|
|
14986
15062
|
Output(),
|
|
14987
15063
|
__metadata("design:type", EventEmitter)
|
|
@@ -14992,7 +15068,8 @@ var AXPropertyEditorRendererDirective = /** @class */ (function () {
|
|
|
14992
15068
|
}),
|
|
14993
15069
|
__metadata("design:paramtypes", [ViewContainerRef,
|
|
14994
15070
|
ComponentFactoryResolver,
|
|
14995
|
-
AXRenderService
|
|
15071
|
+
AXRenderService,
|
|
15072
|
+
AXEventService])
|
|
14996
15073
|
], AXPropertyEditorRendererDirective);
|
|
14997
15074
|
return AXPropertyEditorRendererDirective;
|
|
14998
15075
|
}());
|
|
@@ -15010,7 +15087,7 @@ var AXTextPropertyEditorComponent = /** @class */ (function (_super) {
|
|
|
15010
15087
|
};
|
|
15011
15088
|
AXTextPropertyEditorComponent.prototype.ngAfterViewInit = function () {
|
|
15012
15089
|
this.registerForValidationForm(this.textBox);
|
|
15013
|
-
this.
|
|
15090
|
+
this.onRenderCompleted.emit();
|
|
15014
15091
|
};
|
|
15015
15092
|
AXTextPropertyEditorComponent.ctorParameters = function () { return [
|
|
15016
15093
|
{ type: ChangeDetectorRef }
|
|
@@ -15060,8 +15137,8 @@ var AXNumberBoxPropertyEditorComponent = /** @class */ (function (_super) {
|
|
|
15060
15137
|
_super.prototype.handleValueChange.call(this, e.value);
|
|
15061
15138
|
};
|
|
15062
15139
|
AXNumberBoxPropertyEditorComponent.prototype.ngAfterViewInit = function () {
|
|
15063
|
-
this.initiated = true;
|
|
15064
15140
|
this.registerForValidationForm(this.textBox);
|
|
15141
|
+
this.onRenderCompleted.emit();
|
|
15065
15142
|
};
|
|
15066
15143
|
AXNumberBoxPropertyEditorComponent.ctorParameters = function () { return [
|
|
15067
15144
|
{ type: ChangeDetectorRef }
|
|
@@ -15106,16 +15183,18 @@ var AXSelectBoxPropertyEditorComponent = /** @class */ (function (_super) {
|
|
|
15106
15183
|
_this.selectionDataMode = 'value';
|
|
15107
15184
|
_this.allowSearch = true;
|
|
15108
15185
|
_this.allowNull = false;
|
|
15186
|
+
_this.disabled = false;
|
|
15109
15187
|
_this.items = [];
|
|
15110
15188
|
_this.remoteOperation = false;
|
|
15111
15189
|
_this.provideData = function (e) {
|
|
15112
15190
|
return new Promise(function (resolve) {
|
|
15113
15191
|
var func = function () {
|
|
15114
15192
|
if (Array.isArray(_this.items)) {
|
|
15115
|
-
resolve(_this.items);
|
|
15193
|
+
resolve(_this.items.slice());
|
|
15116
15194
|
}
|
|
15117
15195
|
else if (typeof _this.items === 'function') {
|
|
15118
|
-
|
|
15196
|
+
var a = Object.assign(e, { sender: _this });
|
|
15197
|
+
resolve(_this.items(a));
|
|
15119
15198
|
}
|
|
15120
15199
|
else {
|
|
15121
15200
|
resolve([]);
|
|
@@ -15131,26 +15210,38 @@ var AXSelectBoxPropertyEditorComponent = /** @class */ (function (_super) {
|
|
|
15131
15210
|
};
|
|
15132
15211
|
return _this;
|
|
15133
15212
|
}
|
|
15213
|
+
Object.defineProperty(AXSelectBoxPropertyEditorComponent.prototype, "filter", {
|
|
15214
|
+
get: function () {
|
|
15215
|
+
return this._filter;
|
|
15216
|
+
},
|
|
15217
|
+
set: function (v) {
|
|
15218
|
+
var _a;
|
|
15219
|
+
this._filter = v;
|
|
15220
|
+
if (this.value && this.initiated) {
|
|
15221
|
+
this.value = null;
|
|
15222
|
+
(_a = this.selectBox) === null || _a === void 0 ? void 0 : _a.refresh();
|
|
15223
|
+
}
|
|
15224
|
+
},
|
|
15225
|
+
enumerable: true,
|
|
15226
|
+
configurable: true
|
|
15227
|
+
});
|
|
15134
15228
|
AXSelectBoxPropertyEditorComponent.prototype.handleValueChange = function (e) {
|
|
15135
|
-
_super.prototype.handleValueChange.call(this, e.
|
|
15229
|
+
_super.prototype.handleValueChange.call(this, e.selectedValues);
|
|
15136
15230
|
};
|
|
15137
15231
|
AXSelectBoxPropertyEditorComponent.prototype.ngAfterViewInit = function () {
|
|
15138
|
-
this.selectBox.refresh();
|
|
15139
15232
|
this.registerForValidationForm(this.selectBox);
|
|
15140
|
-
|
|
15141
|
-
AXSelectBoxPropertyEditorComponent.prototype.initiat = function () {
|
|
15142
|
-
this.initiated = true;
|
|
15233
|
+
this.onRenderCompleted.emit();
|
|
15143
15234
|
};
|
|
15144
15235
|
AXSelectBoxPropertyEditorComponent.ctorParameters = function () { return [
|
|
15145
15236
|
{ type: ChangeDetectorRef }
|
|
15146
15237
|
]; };
|
|
15147
15238
|
__decorate([
|
|
15148
|
-
ViewChild(
|
|
15149
|
-
__metadata("design:type",
|
|
15239
|
+
ViewChild(AXSelectBoxComponent, { static: true }),
|
|
15240
|
+
__metadata("design:type", AXSelectBoxComponent)
|
|
15150
15241
|
], AXSelectBoxPropertyEditorComponent.prototype, "selectBox", void 0);
|
|
15151
15242
|
AXSelectBoxPropertyEditorComponent = __decorate([
|
|
15152
15243
|
Component({
|
|
15153
|
-
template: "<ax-select-
|
|
15244
|
+
template: "<ax-select-box [mode]=\"selectionMode\"\r\n [textField]=\"textField\" \r\n [valueField]=\"valueField\" \r\n [selectedValues]=\"value\" \r\n [remoteOperation]=\"remoteOperation\"\r\n [allowSearch]=\"allowSearch\" \r\n [allowNull]=\"allowNull\"\r\n [readonly]=\"readonly\"\r\n [disabled]=\"disabled\"\r\n (selectionChanged)=\"handleValueChange($event)\">\r\n <ax-data-source [provideData]=\"provideData\">\r\n </ax-data-source>\r\n <ax-validation [rules]=\"validation?.rules\">\r\n </ax-validation>\r\n</ax-select-box>"
|
|
15154
15245
|
}),
|
|
15155
15246
|
__metadata("design:paramtypes", [ChangeDetectorRef])
|
|
15156
15247
|
], AXSelectBoxPropertyEditorComponent);
|
|
@@ -15189,7 +15280,7 @@ var AXRangePropertyEditorComponent = /** @class */ (function (_super) {
|
|
|
15189
15280
|
this.cdr.detectChanges();
|
|
15190
15281
|
};
|
|
15191
15282
|
AXRangePropertyEditorComponent.prototype.ngAfterViewInit = function () {
|
|
15192
|
-
this.
|
|
15283
|
+
this.onRenderCompleted.emit();
|
|
15193
15284
|
};
|
|
15194
15285
|
// getRanges() {
|
|
15195
15286
|
// return this.ranges.sort((a, b) => a.minValue - b.minValue);
|
|
@@ -15895,7 +15986,7 @@ var AXColorPropertyEditorComponent = /** @class */ (function (_super) {
|
|
|
15895
15986
|
}
|
|
15896
15987
|
AXColorPropertyEditorComponent.prototype.ngAfterViewInit = function () {
|
|
15897
15988
|
this.registerForValidationForm(this.textBox);
|
|
15898
|
-
this.
|
|
15989
|
+
this.onRenderCompleted.emit();
|
|
15899
15990
|
};
|
|
15900
15991
|
AXColorPropertyEditorComponent.ctorParameters = function () { return [
|
|
15901
15992
|
{ type: ChangeDetectorRef }
|
|
@@ -15953,7 +16044,7 @@ var ColumnPropertyEditorComponent = /** @class */ (function (_super) {
|
|
|
15953
16044
|
this.columns = this.value ? JSON.parse(JSON.stringify(this.value)) : [];
|
|
15954
16045
|
};
|
|
15955
16046
|
ColumnPropertyEditorComponent.prototype.ngAfterViewInit = function () {
|
|
15956
|
-
this.
|
|
16047
|
+
this.onRenderCompleted.emit();
|
|
15957
16048
|
};
|
|
15958
16049
|
ColumnPropertyEditorComponent.prototype.drop = function (event) {
|
|
15959
16050
|
moveItemInArray(this.columns, event.previousIndex, event.currentIndex);
|
|
@@ -16113,8 +16204,8 @@ var AXConditionalColorPropertyEditorComponent = /** @class */ (function (_super)
|
|
|
16113
16204
|
].filter(function (c) { return c.dataTypes == null || c.dataTypes.includes(_this.dataType); });
|
|
16114
16205
|
};
|
|
16115
16206
|
AXConditionalColorPropertyEditorComponent.prototype.ngAfterViewInit = function () {
|
|
16116
|
-
this.initiated = true;
|
|
16117
16207
|
this.cdr.detectChanges();
|
|
16208
|
+
this.onRenderCompleted.emit();
|
|
16118
16209
|
};
|
|
16119
16210
|
AXConditionalColorPropertyEditorComponent.prototype.handleEditClick = function (item) {
|
|
16120
16211
|
var _this = this;
|
|
@@ -16313,7 +16404,7 @@ var AXSwitchPropertyEditorComponent = /** @class */ (function (_super) {
|
|
|
16313
16404
|
_super.prototype.handleValueChange.call(this, e.value);
|
|
16314
16405
|
};
|
|
16315
16406
|
AXSwitchPropertyEditorComponent.prototype.ngAfterViewInit = function () {
|
|
16316
|
-
this.
|
|
16407
|
+
this.onRenderCompleted.emit();
|
|
16317
16408
|
};
|
|
16318
16409
|
AXSwitchPropertyEditorComponent.ctorParameters = function () { return [
|
|
16319
16410
|
{ type: ChangeDetectorRef }
|
|
@@ -16362,8 +16453,8 @@ var AXDatePropertyEditorComponent = /** @class */ (function (_super) {
|
|
|
16362
16453
|
_super.prototype.handleValueChange.call(this, e.value);
|
|
16363
16454
|
};
|
|
16364
16455
|
AXDatePropertyEditorComponent.prototype.ngAfterViewInit = function () {
|
|
16365
|
-
this.initiated = true;
|
|
16366
16456
|
this.registerForValidationForm(this.date);
|
|
16457
|
+
this.onRenderCompleted.emit();
|
|
16367
16458
|
};
|
|
16368
16459
|
AXDatePropertyEditorComponent.ctorParameters = function () { return [
|
|
16369
16460
|
{ type: ChangeDetectorRef }
|
|
@@ -16411,8 +16502,8 @@ var AXTimePropertyEditorComponent = /** @class */ (function (_super) {
|
|
|
16411
16502
|
_super.prototype.handleValueChange.call(this, (_a = e.value) === null || _a === void 0 ? void 0 : _a.time);
|
|
16412
16503
|
};
|
|
16413
16504
|
AXTimePropertyEditorComponent.prototype.ngAfterViewInit = function () {
|
|
16414
|
-
this.initiated = true;
|
|
16415
16505
|
this.registerForValidationForm(this.time);
|
|
16506
|
+
this.onRenderCompleted.emit();
|
|
16416
16507
|
};
|
|
16417
16508
|
AXTimePropertyEditorComponent.ctorParameters = function () { return [
|
|
16418
16509
|
{ type: ChangeDetectorRef }
|