@acorex/components 5.4.0 → 5.5.0
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/esm2020/lib/base/mixin/datalist-component.class.mjs +17 -6
- package/esm2020/lib/calendar/calendar.component.mjs +1 -3
- package/esm2020/lib/color-picker/color-picker.component.mjs +4 -7
- package/esm2020/lib/form/form.component.mjs +8 -5
- package/esm2020/lib/menu/menu.component.mjs +5 -5
- package/esm2020/lib/searchbox/searchbox.component.mjs +13 -7
- package/esm2020/lib/searchbox/searchbox.module.mjs +4 -3
- package/esm2020/lib/selectbox/selectbox.component.mjs +16 -15
- package/esm2020/lib/validation/validation-rule.widget.mjs +17 -11
- package/fesm2015/acorex-components.mjs +66 -47
- package/fesm2015/acorex-components.mjs.map +1 -1
- package/fesm2020/acorex-components.mjs +66 -47
- package/fesm2020/acorex-components.mjs.map +1 -1
- package/lib/form/form.component.d.ts +1 -1
- package/lib/menu/menu.component.d.ts +1 -1
- package/lib/searchbox/searchbox.component.d.ts +1 -0
- package/lib/searchbox/searchbox.module.d.ts +2 -1
- package/lib/selectbox/selectbox.component.d.ts +3 -2
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import { __classPrivateFieldSet, __classPrivateFieldGet, __awaiter } from 'tslib
|
|
|
5
5
|
import _ from 'lodash';
|
|
6
6
|
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
7
7
|
import * as i1$4 from '@acorex/core';
|
|
8
|
-
import { AXObjectUtil, AXConfig, AXDateTime, AXDateTimeRange, AXDateTimeModule, AXColorUtil, AXDrawingUtil,
|
|
8
|
+
import { AXObjectUtil, AXConfig, AXDateTime, AXDateTimeRange, AXDateTimeModule, AXColorUtil, AXDrawingUtil, AXTranslationModule, AXTranslator, AXStringUtil } from '@acorex/core';
|
|
9
9
|
import { Subscription, Subject, fromEvent, merge, asyncScheduler, BehaviorSubject } from 'rxjs';
|
|
10
10
|
import { debounceTime, distinctUntilChanged, map, pairwise, filter, startWith, exhaustMap, throttleTime, observeOn, finalize } from 'rxjs/operators';
|
|
11
11
|
import * as i1$5 from '@angular/cdk/portal';
|
|
@@ -488,7 +488,17 @@ function _DatalistComponenetMixin(Base) {
|
|
|
488
488
|
return __classPrivateFieldGet(this, _isLoading, "f");
|
|
489
489
|
}
|
|
490
490
|
_formatData(v) {
|
|
491
|
-
return _.unionBy(v.map((o, i) => {
|
|
491
|
+
// return _.unionBy(v.map((o, i) => {
|
|
492
|
+
// if (typeof o == 'object')
|
|
493
|
+
// return o
|
|
494
|
+
// else {
|
|
495
|
+
// const no: any = {};
|
|
496
|
+
// no[this.valueField] = o;
|
|
497
|
+
// no[Array.isArray(this.textField) ? this.textField[0] : this.textField] = o;
|
|
498
|
+
// return no;
|
|
499
|
+
// }
|
|
500
|
+
// }), this.valueField);
|
|
501
|
+
return v.map((o, i) => {
|
|
492
502
|
if (typeof o == 'object')
|
|
493
503
|
return o;
|
|
494
504
|
else {
|
|
@@ -497,16 +507,17 @@ function _DatalistComponenetMixin(Base) {
|
|
|
497
507
|
no[Array.isArray(this.textField) ? this.textField[0] : this.textField] = o;
|
|
498
508
|
return no;
|
|
499
509
|
}
|
|
500
|
-
})
|
|
510
|
+
});
|
|
501
511
|
}
|
|
502
512
|
_fetchData(opts) {
|
|
503
|
-
|
|
513
|
+
const skip = __classPrivateFieldGet(this, _currentPage, "f") * this.pageSize, take = this.pageSize;
|
|
514
|
+
if ((this.loadedCount >= this.totalCount && this.totalCount != 0) || __classPrivateFieldGet(this, _isLoading, "f") || !__classPrivateFieldGet(this, _isLazy, "f") || (skip > this.totalCount)) {
|
|
504
515
|
return;
|
|
505
516
|
}
|
|
506
517
|
if (__classPrivateFieldGet(this, _items, "f")) {
|
|
507
518
|
__classPrivateFieldSet(this, _isLoading, true, "f");
|
|
508
519
|
const fetchFn = __classPrivateFieldGet(this, _items, "f");
|
|
509
|
-
fetchFn({ skip
|
|
520
|
+
fetchFn({ skip, take, searchQuery: opts === null || opts === void 0 ? void 0 : opts.searchQuery }).then(c => {
|
|
510
521
|
var _b;
|
|
511
522
|
var _a;
|
|
512
523
|
if (Array.isArray(c)) {
|
|
@@ -515,7 +526,7 @@ function _DatalistComponenetMixin(Base) {
|
|
|
515
526
|
}
|
|
516
527
|
else {
|
|
517
528
|
__classPrivateFieldSet(this, _totalItems, c.total || ((_b = c.items) === null || _b === void 0 ? void 0 : _b.length) || 0, "f");
|
|
518
|
-
__classPrivateFieldSet(this, _loadedItems, __classPrivateFieldGet(this, _loadedItems, "f").concat(this._formatData(c.items)), "f");
|
|
529
|
+
__classPrivateFieldSet(this, _loadedItems, [...new Set(__classPrivateFieldGet(this, _loadedItems, "f").concat(this._formatData(c.items)))], "f");
|
|
519
530
|
__classPrivateFieldSet(this, _currentPage, (_a = __classPrivateFieldGet(this, _currentPage, "f"), _a++, _a), "f");
|
|
520
531
|
}
|
|
521
532
|
this._cdr.markForCheck();
|
|
@@ -3395,7 +3406,6 @@ class AXCalendarComponent extends AXCalendarComponentMixin {
|
|
|
3395
3406
|
return date.dayOfWeek == 7 || date.dayOfWeek == 1;
|
|
3396
3407
|
}
|
|
3397
3408
|
_generatePickerItems(view) {
|
|
3398
|
-
debugger;
|
|
3399
3409
|
switch (view) {
|
|
3400
3410
|
case 'year':
|
|
3401
3411
|
this._pickerYears = _.range(2000, 2050, 1);
|
|
@@ -3417,7 +3427,6 @@ class AXCalendarComponent extends AXCalendarComponentMixin {
|
|
|
3417
3427
|
}
|
|
3418
3428
|
}
|
|
3419
3429
|
_handlePickerChange(item, view) {
|
|
3420
|
-
debugger;
|
|
3421
3430
|
if (!item)
|
|
3422
3431
|
return;
|
|
3423
3432
|
const date = this._viewRange.startTime;
|
|
@@ -5368,7 +5377,6 @@ class AXColorPickerComponent extends AXBaseColorPickerMixin {
|
|
|
5368
5377
|
this._platform.resize.subscribe(() => {
|
|
5369
5378
|
this._isMobile = this._platform.is('Mobile');
|
|
5370
5379
|
this.popover.dispose();
|
|
5371
|
-
this._popoverWidth = this._isMobile ? null : this._target.offsetWidth;
|
|
5372
5380
|
});
|
|
5373
5381
|
}
|
|
5374
5382
|
_handleArrowClickEvent(e) {
|
|
@@ -5382,11 +5390,9 @@ class AXColorPickerComponent extends AXBaseColorPickerMixin {
|
|
|
5382
5390
|
onInit() {
|
|
5383
5391
|
super.onInit();
|
|
5384
5392
|
this._target = this._elementRef.nativeElement;
|
|
5385
|
-
this._popoverTitle = this.placeholder || AXTranslator.get('selectbox.popover.title');
|
|
5386
5393
|
}
|
|
5387
5394
|
onViewInit() {
|
|
5388
5395
|
super.onViewInit();
|
|
5389
|
-
this._popoverWidth = this._isMobile ? null : this._target.offsetWidth;
|
|
5390
5396
|
}
|
|
5391
5397
|
_onValueChanged(oldValue, newValue) {
|
|
5392
5398
|
super._onValueChanged(oldValue, newValue);
|
|
@@ -5403,12 +5409,12 @@ class AXColorPickerComponent extends AXBaseColorPickerMixin {
|
|
|
5403
5409
|
AXColorPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXColorPickerComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i1$4.AXPlatform }], target: i0.ɵɵFactoryTarget.Component });
|
|
5404
5410
|
AXColorPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: AXColorPickerComponent, selector: "ax-color-picker", inputs: { isOpen: "isOpen", fitParent: "fitParent", dropdownWidth: "dropdownWidth", position: "position", disabled: "disabled", tabIndex: "tabIndex", readonly: "readonly", allowNull: "allowNull", value: "value", debounceTime: "debounceTime", name: "name", checked: "checked", placeholder: "placeholder", maxLength: "maxLength", type: "type", autoComplete: "autoComplete" }, outputs: { onOpened: "onOpened", onClosed: "onClosed", onBlur: "onBlur", onFocus: "onFocus", valueChange: "valueChange", onValueChanged: "onValueChanged" }, host: { classAttribute: "ax-editor-container ax-drop-down" }, providers: [
|
|
5405
5411
|
{ provide: AXClosbaleComponent, useExisting: AXColorPickerComponent }
|
|
5406
|
-
], viewQueries: [{ propertyName: "popover", first: true, predicate: AXPopoverComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<div class=\"ax-dropdown-content\" [class.ax-state-disabled]=\"disabled\" (click)=\"_handleInputClickEvent($event)\">\r\n <div *ngIf=\"value\" class=\"color-badge\" [ngStyle]=\"{'background-color': value}\"></div>\r\n <div class=\"ax-uppercase\">{{_colorCode}}</div>\r\n</div>\r\n<ax-button color=\"light\" look=\"blank\" (onClick)=\"clear()\" [tabIndex]=\"-1\" *ngIf=\"value && !(disabled || readonly)\">\r\n <ax-icon icon=\"ax-ic ax-ic-close\"></ax-icon>\r\n</ax-button>\r\n<ax-button [disabled]=\"disabled\" [tabIndex]=\"-1\" color=\"light\" look=\"blank\" (onClick)=\"_handleArrowClickEvent($event)\">\r\n <ax-icon #icon icon=\"ax-ic ax-ic-chevron ax-transform ax--rotate-90\"></ax-icon>\r\n</ax-button>\r\n<ng-content select=\"ax-validation-rule\">\r\n</ng-content>\r\n<ng-content select=\"ax-suffix\">\r\n</ng-content>\r\n<ax-popover [target]=\"_target\" [position]=\"position\" [openTrigger]=\"'manual'\" [closeTrigger]=\"'clickout'\"\r\n [adaptivityEnabled]=\"true\"
|
|
5412
|
+
], viewQueries: [{ propertyName: "popover", first: true, predicate: AXPopoverComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<div class=\"ax-dropdown-content\" [class.ax-state-disabled]=\"disabled\" (click)=\"_handleInputClickEvent($event)\">\r\n <div *ngIf=\"value\" class=\"color-badge\" [ngStyle]=\"{'background-color': value}\"></div>\r\n <div class=\"ax-uppercase\">{{_colorCode}}</div>\r\n</div>\r\n<ax-button color=\"light\" look=\"blank\" (onClick)=\"clear()\" [tabIndex]=\"-1\" *ngIf=\"value && !(disabled || readonly)\">\r\n <ax-icon icon=\"ax-ic ax-ic-close\"></ax-icon>\r\n</ax-button>\r\n<ax-button [disabled]=\"disabled\" [tabIndex]=\"-1\" color=\"light\" look=\"blank\" (onClick)=\"_handleArrowClickEvent($event)\">\r\n <ax-icon #icon icon=\"ax-ic ax-ic-chevron ax-transform ax--rotate-90\"></ax-icon>\r\n</ax-button>\r\n<ng-content select=\"ax-validation-rule\">\r\n</ng-content>\r\n<ng-content select=\"ax-suffix\">\r\n</ng-content>\r\n<ax-popover [target]=\"_target\" [position]=\"position\" [openTrigger]=\"'manual'\" [closeTrigger]=\"'clickout'\"\r\n [adaptivityEnabled]=\"true\" (onOpened)=\"_handlePopupOnOpened($event)\" (onClosed)=\"_handlePopupOnClosed($event)\">\r\n <div class=\"ax-overlay-pane\" [class.ax-w-full]=\"_isMobile\" tabindex=\"0\" aria-modal=\"true\" cdkTrapFocus\r\n [class.ax-overlay-actionsheet]=\"_isMobile\">\r\n <ax-color-palette [(value)]=\"value\" [(mode)]=\"_mode\">\r\n </ax-color-palette>\r\n </div>\r\n</ax-popover>", components: [{ type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "size", "color", "look", "text", "submitBehavior", "cancelBehavior", "toggleable", "selected"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange"] }, { type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { type: AXPopoverComponent, selector: "ax-popover", inputs: ["target", "position", "openTrigger", "closeTrigger", "hasBackdrop", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { type: AXColorPalleteComponent, selector: "ax-color-palette", inputs: ["disabled", "tabIndex", "readonly", "allowNull", "value", "debounceTime", "name", "checked", "mode"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged", "modeChange"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i7.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
5407
5413
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXColorPickerComponent, decorators: [{
|
|
5408
5414
|
type: Component,
|
|
5409
5415
|
args: [{ selector: 'ax-color-picker', inputs: [...DROPDOWN_INPUTS, ...INTERACTIVE_INPUTS, ...VALUE_INPUTS, ...TEXTBOX_INPUTS], outputs: [...DROPDOWN_OUTPUT, ...INTERACTIVE_OUTPUT, ...VALUE_OUTPUT, ...TEXTBOX_OUTPUT], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
5410
5416
|
{ provide: AXClosbaleComponent, useExisting: AXColorPickerComponent }
|
|
5411
|
-
], host: { class: 'ax-editor-container ax-drop-down' }, template: "<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<div class=\"ax-dropdown-content\" [class.ax-state-disabled]=\"disabled\" (click)=\"_handleInputClickEvent($event)\">\r\n <div *ngIf=\"value\" class=\"color-badge\" [ngStyle]=\"{'background-color': value}\"></div>\r\n <div class=\"ax-uppercase\">{{_colorCode}}</div>\r\n</div>\r\n<ax-button color=\"light\" look=\"blank\" (onClick)=\"clear()\" [tabIndex]=\"-1\" *ngIf=\"value && !(disabled || readonly)\">\r\n <ax-icon icon=\"ax-ic ax-ic-close\"></ax-icon>\r\n</ax-button>\r\n<ax-button [disabled]=\"disabled\" [tabIndex]=\"-1\" color=\"light\" look=\"blank\" (onClick)=\"_handleArrowClickEvent($event)\">\r\n <ax-icon #icon icon=\"ax-ic ax-ic-chevron ax-transform ax--rotate-90\"></ax-icon>\r\n</ax-button>\r\n<ng-content select=\"ax-validation-rule\">\r\n</ng-content>\r\n<ng-content select=\"ax-suffix\">\r\n</ng-content>\r\n<ax-popover [target]=\"_target\" [position]=\"position\" [openTrigger]=\"'manual'\" [closeTrigger]=\"'clickout'\"\r\n [adaptivityEnabled]=\"true\"
|
|
5417
|
+
], host: { class: 'ax-editor-container ax-drop-down' }, template: "<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<div class=\"ax-dropdown-content\" [class.ax-state-disabled]=\"disabled\" (click)=\"_handleInputClickEvent($event)\">\r\n <div *ngIf=\"value\" class=\"color-badge\" [ngStyle]=\"{'background-color': value}\"></div>\r\n <div class=\"ax-uppercase\">{{_colorCode}}</div>\r\n</div>\r\n<ax-button color=\"light\" look=\"blank\" (onClick)=\"clear()\" [tabIndex]=\"-1\" *ngIf=\"value && !(disabled || readonly)\">\r\n <ax-icon icon=\"ax-ic ax-ic-close\"></ax-icon>\r\n</ax-button>\r\n<ax-button [disabled]=\"disabled\" [tabIndex]=\"-1\" color=\"light\" look=\"blank\" (onClick)=\"_handleArrowClickEvent($event)\">\r\n <ax-icon #icon icon=\"ax-ic ax-ic-chevron ax-transform ax--rotate-90\"></ax-icon>\r\n</ax-button>\r\n<ng-content select=\"ax-validation-rule\">\r\n</ng-content>\r\n<ng-content select=\"ax-suffix\">\r\n</ng-content>\r\n<ax-popover [target]=\"_target\" [position]=\"position\" [openTrigger]=\"'manual'\" [closeTrigger]=\"'clickout'\"\r\n [adaptivityEnabled]=\"true\" (onOpened)=\"_handlePopupOnOpened($event)\" (onClosed)=\"_handlePopupOnClosed($event)\">\r\n <div class=\"ax-overlay-pane\" [class.ax-w-full]=\"_isMobile\" tabindex=\"0\" aria-modal=\"true\" cdkTrapFocus\r\n [class.ax-overlay-actionsheet]=\"_isMobile\">\r\n <ax-color-palette [(value)]=\"value\" [(mode)]=\"_mode\">\r\n </ax-color-palette>\r\n </div>\r\n</ax-popover>" }]
|
|
5412
5418
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$4.AXPlatform }]; }, propDecorators: { popover: [{
|
|
5413
5419
|
type: ViewChild,
|
|
5414
5420
|
args: [AXPopoverComponent, { static: true }]
|
|
@@ -6553,14 +6559,17 @@ class AXFormComponent extends AXBaseComponentMixin {
|
|
|
6553
6559
|
_getComponenets() {
|
|
6554
6560
|
return Array.from(this._getHostElement().querySelectorAll('[ax-form-input="true"]'));
|
|
6555
6561
|
}
|
|
6556
|
-
validate() {
|
|
6562
|
+
validate(...args) {
|
|
6557
6563
|
const widgets = this._getComponenets();
|
|
6558
6564
|
//
|
|
6559
6565
|
return new Promise((resolve, reject) => {
|
|
6560
6566
|
if (widgets.length === 0) {
|
|
6561
6567
|
return Promise.resolve({ result: true });
|
|
6562
6568
|
}
|
|
6563
|
-
Promise.all(widgets.map((c) => c.__axContext__
|
|
6569
|
+
Promise.all(widgets.map((c) => c.__axContext__)
|
|
6570
|
+
.filter(c => (args == null || args.length == 0) || args.includes(c.name))
|
|
6571
|
+
.map((c) => c.validate()))
|
|
6572
|
+
.then((rules) => {
|
|
6564
6573
|
const failed = rules.filter((c) => !c.result);
|
|
6565
6574
|
if (failed.length) {
|
|
6566
6575
|
reject({
|
|
@@ -6582,12 +6591,12 @@ class AXFormComponent extends AXBaseComponentMixin {
|
|
|
6582
6591
|
}
|
|
6583
6592
|
}
|
|
6584
6593
|
AXFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXFormComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
6585
|
-
AXFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: AXFormComponent, selector: "ax-form", usesInheritance: true, ngImport: i0, template: '<
|
|
6594
|
+
AXFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: AXFormComponent, selector: "ax-form", usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6586
6595
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXFormComponent, decorators: [{
|
|
6587
6596
|
type: Component,
|
|
6588
6597
|
args: [{
|
|
6589
6598
|
selector: 'ax-form',
|
|
6590
|
-
template: '<
|
|
6599
|
+
template: '<ng-content></ng-content>',
|
|
6591
6600
|
encapsulation: ViewEncapsulation.None,
|
|
6592
6601
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
6593
6602
|
}]
|
|
@@ -6681,7 +6690,7 @@ class AXSearchBoxComponent extends AXBaseComponentMixin {
|
|
|
6681
6690
|
super(_elementRef, _cdr);
|
|
6682
6691
|
this._parent = _parent;
|
|
6683
6692
|
this.placeholder = 'common.search';
|
|
6684
|
-
this.debounceTime =
|
|
6693
|
+
this.debounceTime = 500;
|
|
6685
6694
|
this.searchExp = null;
|
|
6686
6695
|
}
|
|
6687
6696
|
_onSearchExprChanged(e) {
|
|
@@ -6693,12 +6702,15 @@ class AXSearchBoxComponent extends AXBaseComponentMixin {
|
|
|
6693
6702
|
var _a;
|
|
6694
6703
|
(_a = this._textbox) === null || _a === void 0 ? void 0 : _a.focus();
|
|
6695
6704
|
}
|
|
6705
|
+
clear() {
|
|
6706
|
+
this._textbox._setValue(null);
|
|
6707
|
+
}
|
|
6696
6708
|
}
|
|
6697
6709
|
AXSearchBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSearchBoxComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: AXSearchableComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
6698
|
-
AXSearchBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: AXSearchBoxComponent, selector: "ax-search-box", inputs: { placeholder: "placeholder", debounceTime: "debounceTime", searchExp: "searchExp" }, viewQueries: [{ propertyName: "_textbox", first: true, predicate: AXTextBoxComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<ax-text-box placeholder=\"{{ placeholder | trans }}\" [debounceTime]=\"debounceTime\" \r\n [(value)]=\"searchExp\" (onValueChanged)=\"_onSearchExprChanged($event)\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-ic ax-ic-magnify\">\r\n </ax-icon>\r\n </ax-prefix>\r\n</ax-text-box>", components: [{ type: AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "allowNull", "value", "debounceTime", "name", "checked", "placeholder", "maxLength", "type", "autoComplete"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged"] }, { type: AXDecoratorPrefixComponent, selector: "ax-prefix" }, { type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }], pipes: { "trans": i1$4.AXTranslatorPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6710
|
+
AXSearchBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: AXSearchBoxComponent, selector: "ax-search-box", inputs: { placeholder: "placeholder", debounceTime: "debounceTime", searchExp: "searchExp" }, viewQueries: [{ propertyName: "_textbox", first: true, predicate: AXTextBoxComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<ax-text-box placeholder=\"{{ placeholder | trans }}\" [debounceTime]=\"debounceTime\" \r\n [(value)]=\"searchExp\" (onValueChanged)=\"_onSearchExprChanged($event)\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-ic ax-ic-magnify\" >\r\n </ax-icon>\r\n </ax-prefix>\r\n <ax-suffix>\r\n <ax-button look=\"blank\" color=\"danger\" *ngIf=\"searchExp\" (onClick)=\"clear()\">\r\n <ax-icon class=\"ax-ic ax-ic-close\">\r\n </ax-icon>\r\n </ax-button>\r\n </ax-suffix>\r\n</ax-text-box>", components: [{ type: AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "allowNull", "value", "debounceTime", "name", "checked", "placeholder", "maxLength", "type", "autoComplete"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged"] }, { type: AXDecoratorPrefixComponent, selector: "ax-prefix" }, { type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { type: AXDecoratorSuffixComponent, selector: "ax-suffix" }, { type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "size", "color", "look", "text", "submitBehavior", "cancelBehavior", "toggleable", "selected"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "trans": i1$4.AXTranslatorPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6699
6711
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSearchBoxComponent, decorators: [{
|
|
6700
6712
|
type: Component,
|
|
6701
|
-
args: [{ selector: 'ax-search-box', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ax-text-box placeholder=\"{{ placeholder | trans }}\" [debounceTime]=\"debounceTime\" \r\n [(value)]=\"searchExp\" (onValueChanged)=\"_onSearchExprChanged($event)\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-ic ax-ic-magnify\">\r\n </ax-icon>\r\n </ax-prefix>\r\n</ax-text-box>" }]
|
|
6713
|
+
args: [{ selector: 'ax-search-box', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ax-text-box placeholder=\"{{ placeholder | trans }}\" [debounceTime]=\"debounceTime\" \r\n [(value)]=\"searchExp\" (onValueChanged)=\"_onSearchExprChanged($event)\">\r\n <ax-prefix>\r\n <ax-icon class=\"ax-ic ax-ic-magnify\" >\r\n </ax-icon>\r\n </ax-prefix>\r\n <ax-suffix>\r\n <ax-button look=\"blank\" color=\"danger\" *ngIf=\"searchExp\" (onClick)=\"clear()\">\r\n <ax-icon class=\"ax-ic ax-ic-close\">\r\n </ax-icon>\r\n </ax-button>\r\n </ax-suffix>\r\n</ax-text-box>" }]
|
|
6702
6714
|
}], ctorParameters: function () {
|
|
6703
6715
|
return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: AXSearchableComponent, decorators: [{
|
|
6704
6716
|
type: Optional
|
|
@@ -6718,11 +6730,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImpor
|
|
|
6718
6730
|
}] } });
|
|
6719
6731
|
|
|
6720
6732
|
const COMPONENT$9 = [AXSearchBoxComponent];
|
|
6721
|
-
const MODULES$9 = [CommonModule, AXTranslationModule, AXDecoratorModule, AXTextBoxModule];
|
|
6733
|
+
const MODULES$9 = [CommonModule, AXTranslationModule, AXDecoratorModule, AXTextBoxModule, AXButtonModule];
|
|
6722
6734
|
class AXSearchBoxModule {
|
|
6723
6735
|
}
|
|
6724
6736
|
AXSearchBoxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSearchBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6725
|
-
AXSearchBoxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSearchBoxModule, declarations: [AXSearchBoxComponent], imports: [CommonModule, AXTranslationModule, AXDecoratorModule, AXTextBoxModule], exports: [AXSearchBoxComponent] });
|
|
6737
|
+
AXSearchBoxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSearchBoxModule, declarations: [AXSearchBoxComponent], imports: [CommonModule, AXTranslationModule, AXDecoratorModule, AXTextBoxModule, AXButtonModule], exports: [AXSearchBoxComponent] });
|
|
6726
6738
|
AXSearchBoxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSearchBoxModule, providers: [], imports: [[...MODULES$9]] });
|
|
6727
6739
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSearchBoxModule, decorators: [{
|
|
6728
6740
|
type: NgModule,
|
|
@@ -6890,10 +6902,10 @@ class AXMenuComponent extends AXBaseMenuMixin {
|
|
|
6890
6902
|
}
|
|
6891
6903
|
}
|
|
6892
6904
|
AXMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXMenuComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
6893
|
-
AXMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: AXMenuComponent, selector: "ax-menu", inputs: { disabled: "disabled", tabIndex: "tabIndex", textField: "textField", valueField: "valueField", items: "items", id: "id", parentId: "parentId", iconField: "iconField", tooltip: "tooltip", isOpen: "isOpen", isActive: "isActive", visibleField: "visibleField", disableField: "disableField", hasChildField: "hasChildField", openMode: "openMode", direction: "direction" }, outputs: { onBlur: "onBlur", onFocus: "onFocus" }, host: { classAttribute: "ax-menu" }, queries: [{ propertyName: "_contentEmptyTemplate", first: true, predicate: ["emptyTemplate"], descendants: true }, { propertyName: "_searchBox", first: true, predicate: AXSearchBoxComponent, descendants: true, static: true }], viewQueries: [{ propertyName: "popover", first: true, predicate: AXPopoverComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<
|
|
6905
|
+
AXMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: AXMenuComponent, selector: "ax-menu", inputs: { disabled: "disabled", tabIndex: "tabIndex", textField: "textField", valueField: "valueField", items: "items", id: "id", parentId: "parentId", iconField: "iconField", tooltip: "tooltip", isOpen: "isOpen", isActive: "isActive", visibleField: "visibleField", disableField: "disableField", hasChildField: "hasChildField", openMode: "openMode", direction: "direction" }, outputs: { onBlur: "onBlur", onFocus: "onFocus", onMenuItemClick: "onMenuItemClick" }, host: { classAttribute: "ax-menu" }, queries: [{ propertyName: "_contentEmptyTemplate", first: true, predicate: ["emptyTemplate"], descendants: true }, { propertyName: "_searchBox", first: true, predicate: AXSearchBoxComponent, descendants: true, static: true }], viewQueries: [{ propertyName: "popover", first: true, predicate: AXPopoverComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ul [ngClass]=\"_getDirection()\">\r\n <ng-container *ngTemplateOutlet=\"recursiveListTmpl; context:{ list: displayItems }\"></ng-container>\r\n</ul>\r\n\r\n<ng-template #recursiveListTmpl let-list=\"list\">\r\n <ng-container *ngFor=\"let item of list; trackBy: _trackLoaded\">\r\n <li *ngIf=\"item[visibleField] !=false\" [class.ax-state-disabled]=\"item[disableField]\"\r\n (click)=\"_onMenuClick($event,item)\" (mouseenter)=\"_onMouseEnter($event,item)\" (mouseleave)=\"_onMouseLeave(item)\">\r\n <a [ngClass]=\"{'active': item.isActive}\">\r\n <div class=\"ax-menu-start-side\">\r\n <ax-icon *ngIf=\"item[iconField]\" [class]=\"item[iconField]\"></ax-icon>\r\n <span>{{_getItemDisplayTextTemplte(item)}}</span>\r\n </div>\r\n <div class=\"ax-menu-end-side\">\r\n <ax-icon *ngIf=\"!item.isLoading\"\r\n [ngClass]=\"{'ax-ic-chevron':item?.children?.length > 0 || item[hasChildField],'active-icon': item.isOpen}\">\r\n </ax-icon>\r\n <ax-loading *ngIf=\"item.isLoading\">\r\n </ax-loading>\r\n </div>\r\n </a>\r\n <ul [class.ax-state-disabled]=\"item[disableField]\" *ngIf=\"item?.children?.length > 0 && item.isOpen\">\r\n <ng-container *ngTemplateOutlet=\"recursiveListTmpl; context:{ list: item.children }\"></ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n</ng-template>\r\n<ng-container *ngIf=\"isLoading\">\r\n <ng-template>\r\n <div class=\"ax-flex ax-items-center ax-justify-center ax-p-4\">\r\n <ax-loading text=\"{{ 'layout.loading.text' | trans }}\"></ax-loading>\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n<ng-template #tmpEmpty>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <!--------------- check for custom template --------------->\r\n <ng-container *ngIf=\"emptyTemplate; else elseEmptyTemplate\">\r\n <ng-container *ngTemplateOutlet=\"emptyTemplate\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseEmptyTemplate>\r\n <div class=\"ax-list-item\">\r\n {{ 'common.no-result-found' | trans }}\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n</ng-template>", components: [{ type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { type: AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "text"], outputs: ["visibleChange"] }], directives: [{ type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "trans": i1$4.AXTranslatorPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
6894
6906
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXMenuComponent, decorators: [{
|
|
6895
6907
|
type: Component,
|
|
6896
|
-
args: [{ selector: 'ax-menu', inputs: [...INTERACTIVE_INPUTS, ...BASEMENU_INPUTS], outputs: [...INTERACTIVE_OUTPUT], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { class: 'ax-menu' }, template: "<
|
|
6908
|
+
args: [{ selector: 'ax-menu', inputs: [...INTERACTIVE_INPUTS, ...BASEMENU_INPUTS], outputs: [...INTERACTIVE_OUTPUT, ...BASEMENU_OUTPUT], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { class: 'ax-menu' }, template: "<ul [ngClass]=\"_getDirection()\">\r\n <ng-container *ngTemplateOutlet=\"recursiveListTmpl; context:{ list: displayItems }\"></ng-container>\r\n</ul>\r\n\r\n<ng-template #recursiveListTmpl let-list=\"list\">\r\n <ng-container *ngFor=\"let item of list; trackBy: _trackLoaded\">\r\n <li *ngIf=\"item[visibleField] !=false\" [class.ax-state-disabled]=\"item[disableField]\"\r\n (click)=\"_onMenuClick($event,item)\" (mouseenter)=\"_onMouseEnter($event,item)\" (mouseleave)=\"_onMouseLeave(item)\">\r\n <a [ngClass]=\"{'active': item.isActive}\">\r\n <div class=\"ax-menu-start-side\">\r\n <ax-icon *ngIf=\"item[iconField]\" [class]=\"item[iconField]\"></ax-icon>\r\n <span>{{_getItemDisplayTextTemplte(item)}}</span>\r\n </div>\r\n <div class=\"ax-menu-end-side\">\r\n <ax-icon *ngIf=\"!item.isLoading\"\r\n [ngClass]=\"{'ax-ic-chevron':item?.children?.length > 0 || item[hasChildField],'active-icon': item.isOpen}\">\r\n </ax-icon>\r\n <ax-loading *ngIf=\"item.isLoading\">\r\n </ax-loading>\r\n </div>\r\n </a>\r\n <ul [class.ax-state-disabled]=\"item[disableField]\" *ngIf=\"item?.children?.length > 0 && item.isOpen\">\r\n <ng-container *ngTemplateOutlet=\"recursiveListTmpl; context:{ list: item.children }\"></ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n</ng-template>\r\n<ng-container *ngIf=\"isLoading\">\r\n <ng-template>\r\n <div class=\"ax-flex ax-items-center ax-justify-center ax-p-4\">\r\n <ax-loading text=\"{{ 'layout.loading.text' | trans }}\"></ax-loading>\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n<ng-template #tmpEmpty>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <!--------------- check for custom template --------------->\r\n <ng-container *ngIf=\"emptyTemplate; else elseEmptyTemplate\">\r\n <ng-container *ngTemplateOutlet=\"emptyTemplate\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseEmptyTemplate>\r\n <div class=\"ax-list-item\">\r\n {{ 'common.no-result-found' | trans }}\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n</ng-template>" }]
|
|
6897
6909
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { popover: [{
|
|
6898
6910
|
type: ViewChild,
|
|
6899
6911
|
args: [AXPopoverComponent, { static: true }]
|
|
@@ -7482,7 +7494,7 @@ class AXSelectBoxComponent extends AXBaseSelectionDropdownMixin {
|
|
|
7482
7494
|
onInit() {
|
|
7483
7495
|
super.onInit();
|
|
7484
7496
|
this._target = this._elementRef.nativeElement;
|
|
7485
|
-
this.
|
|
7497
|
+
this._updatePopupTitle();
|
|
7486
7498
|
}
|
|
7487
7499
|
onViewInit() {
|
|
7488
7500
|
super.onViewInit();
|
|
@@ -7492,6 +7504,11 @@ class AXSelectBoxComponent extends AXBaseSelectionDropdownMixin {
|
|
|
7492
7504
|
this.value = null;
|
|
7493
7505
|
super.refresh();
|
|
7494
7506
|
}
|
|
7507
|
+
_updatePopupTitle() {
|
|
7508
|
+
// const count =this.selectedItems?.length;
|
|
7509
|
+
// this._popoverTitle = count > 1 ? `(${count}) items selected`: this.placeholder || AXTranslator.get('selectbox.popover.title')
|
|
7510
|
+
this._popoverTitle = this.placeholder || AXTranslator.get('selectbox.popover.title');
|
|
7511
|
+
}
|
|
7495
7512
|
_handleOnItemClick(e, item) {
|
|
7496
7513
|
if (this.isItemDisabled(item)) {
|
|
7497
7514
|
return;
|
|
@@ -7523,6 +7540,7 @@ class AXSelectBoxComponent extends AXBaseSelectionDropdownMixin {
|
|
|
7523
7540
|
this._focusSelectedItem();
|
|
7524
7541
|
this._forceFocus = false;
|
|
7525
7542
|
}
|
|
7543
|
+
this._focusSearchBox();
|
|
7526
7544
|
}, 100);
|
|
7527
7545
|
}
|
|
7528
7546
|
}
|
|
@@ -7588,7 +7606,6 @@ class AXSelectBoxComponent extends AXBaseSelectionDropdownMixin {
|
|
|
7588
7606
|
e.preventDefault();
|
|
7589
7607
|
}
|
|
7590
7608
|
else if ((e.code === 'Space' || e.code === 'Enter')) {
|
|
7591
|
-
debugger;
|
|
7592
7609
|
e.preventDefault();
|
|
7593
7610
|
const focusedItemId = (_b = (_a = this.listContainer.nativeElement.querySelector('.ax-state-focus')) === null || _a === void 0 ? void 0 : _a.dataset) === null || _b === void 0 ? void 0 : _b.id;
|
|
7594
7611
|
const focusedItem = _.findLast(this.flatItems, [this.valueField, focusedItemId]);
|
|
@@ -7628,15 +7645,17 @@ class AXSelectBoxComponent extends AXBaseSelectionDropdownMixin {
|
|
|
7628
7645
|
else {
|
|
7629
7646
|
this._focusSelectedItem();
|
|
7630
7647
|
}
|
|
7631
|
-
|
|
7632
|
-
if (this._searchBox && !this._isMobile) {
|
|
7633
|
-
this._searchBox.focus();
|
|
7634
|
-
}
|
|
7648
|
+
this._focusSearchBox();
|
|
7635
7649
|
});
|
|
7636
7650
|
}
|
|
7637
7651
|
_handlePopupOnClosed(e) {
|
|
7638
7652
|
this.focus();
|
|
7639
7653
|
}
|
|
7654
|
+
_focusSearchBox() {
|
|
7655
|
+
if (this._searchBox && (!this._isMobile || this._searchBox.searchExp)) {
|
|
7656
|
+
this._searchBox.focus();
|
|
7657
|
+
}
|
|
7658
|
+
}
|
|
7640
7659
|
_focusItemByNav(sign) {
|
|
7641
7660
|
var _a;
|
|
7642
7661
|
const list = this.listContainer.nativeElement;
|
|
@@ -7704,12 +7723,6 @@ class AXSelectBoxComponent extends AXBaseSelectionDropdownMixin {
|
|
|
7704
7723
|
this._fetchData();
|
|
7705
7724
|
}
|
|
7706
7725
|
}
|
|
7707
|
-
_onSearchExprChanged(e) {
|
|
7708
|
-
debugger;
|
|
7709
|
-
this.empty();
|
|
7710
|
-
this._forceFocus = true;
|
|
7711
|
-
this._fetchData();
|
|
7712
|
-
}
|
|
7713
7726
|
search(exp) {
|
|
7714
7727
|
debugger;
|
|
7715
7728
|
this.empty();
|
|
@@ -7725,13 +7738,13 @@ AXSelectBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", ver
|
|
|
7725
7738
|
AXSelectBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: AXSelectBoxComponent, selector: "ax-select-box", inputs: { isOpen: "isOpen", fitParent: "fitParent", dropdownWidth: "dropdownWidth", position: "position", disabled: "disabled", tabIndex: "tabIndex", readonly: "readonly", allowNull: "allowNull", value: "value", debounceTime: "debounceTime", name: "name", checked: "checked", placeholder: "placeholder", maxLength: "maxLength", type: "type", autoComplete: "autoComplete", pageSize: "pageSize", valueField: "valueField", textField: "textField", items: "items", disabledField: "disabledField", disabledCallback: "disabledCallback", multiple: "multiple", selectionMode: "selectionMode", clearButton: "clearButton", checkbox: "checkbox" }, outputs: { onOpened: "onOpened", onClosed: "onClosed", onBlur: "onBlur", onFocus: "onFocus", valueChange: "valueChange", onValueChanged: "onValueChanged", valueChanged: "valueChanged" }, host: { listeners: { "keydown": "_handleKeydown($event)" }, classAttribute: "ax-editor-container ax-drop-down" }, providers: [
|
|
7726
7739
|
{ provide: AXClosbaleComponent, useExisting: AXSelectBoxComponent },
|
|
7727
7740
|
{ provide: AXSearchableComponent, useExisting: AXSelectBoxComponent }
|
|
7728
|
-
], queries: [{ propertyName: "_searchBox", first: true, predicate: AXSearchBoxComponent, descendants: true, static: true }, { propertyName: "_contentEmptyTemplate", first: true, predicate: ["emptyTemplate"], descendants: true }], viewQueries: [{ propertyName: "popover", first: true, predicate: AXPopoverComponent, descendants: true, static: true }, { propertyName: "listContainer", first: true, predicate: ["listContainer"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<div class=\"ax-dropdown-content\" [class.ax-state-disabled]=\"disabled\" (click)=\"_handleInputClickEvent($event)\">\r\n <div class=\"ax-select-box-selection\" [tabindex]=\"tabIndex\" (focus)=\"_emitOnFocusEvent($event)\"\r\n (blur)=\"_emitOnBlurEvent($event)\">\r\n <ng-container *ngIf=\"selectedItems && selectedItems.length; else showPlaceholder\">\r\n <ng-container *ngIf=\"!multiple; then singleSelectedTemplate; else multipleSelectedTemplate\"></ng-container>\r\n <ng-template #singleSelectedTemplate>\r\n <ng-container *ngFor=\"let item of selectedItems\">\r\n <span class=\"ax-mx-2\"> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n </ng-container>\r\n </ng-template>\r\n <ng-template #multipleSelectedTemplate>\r\n <div class=\"ax-flex ax-mx-2\">\r\n <ng-container *ngFor=\"let item of selectedItems\">\r\n <ax-badge [text]=\"_getItemDisplayTextTemplte(item)\" color=\"light\" class=\"ax-me-2\">\r\n <ax-suffix>\r\n <ax-icon icon=\"ax-ic ax-ic-close ax-cursor-pointer\"\r\n (click)=\"_handleBadgeRemove($event,item)\"></ax-icon>\r\n </ax-suffix>\r\n </ax-badge>\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #showPlaceholder>\r\n <div class=\"ax-placeholder\" role=\"textbox\" area-readonly=\"true\"> {{placeholder}}</div>\r\n </ng-template>\r\n </div>\r\n</div>\r\n<ax-button color=\"light\" look=\"blank\" (onClick)=\"clear()\" [tabIndex]=\"-1\"\r\n *ngIf=\"value && clearButton && !(disabled || readonly)\">\r\n <ax-icon icon=\"ax-ic ax-ic-close\"></ax-icon>\r\n</ax-button>\r\n<ax-button [disabled]=\"disabled\" [tabIndex]=\"-1\" color=\"light\" look=\"blank\" (onClick)=\"_handleArrowClickEvent($event)\">\r\n <ax-prefix *ngIf=\"(isLoading && !this.popover.isOpen);else icon\">\r\n <ax-loading type=\"spinner\"></ax-loading>\r\n </ax-prefix>\r\n <ng-template #icon>\r\n <ax-icon #icon icon=\"ax-ic ax-ic-chevron ax-transform ax--rotate-90\"></ax-icon>\r\n </ng-template>\r\n</ax-button>\r\n<ng-content select=\"ax-validation-rule\">\r\n</ng-content>\r\n<ng-content select=\"ax-suffix\">\r\n</ng-content>\r\n<ax-popover [target]=\"_target\" [position]=\"position\" [openTrigger]=\"'manual'\" [closeTrigger]=\"'clickout'\" [adaptivityEnabled]=\"true\"\r\n (onOpened)=\"_handlePopupOnOpened($event)\" (onClosed)=\"_handlePopupOnClosed($event)\">\r\n <div class=\"ax-overlay-pane \" (keydown)=\"_handlePopoverKeydown($event)\" tabindex=\"0\" aria-modal=\"true\" cdkTrapFocus\r\n [class.ax-overlay-actionsheet]=\"_isMobile\" [class.ax-full]=\"_searchBox || isLazy\"\r\n [style.min-width.px]=\"_popoverWidth\">\r\n <div class=\"ax-list\" >\r\n <ax-header *ngIf=\"_isMobile\" >\r\n <ax-title [text]=\"_popoverTitle\"></ax-title>\r\n <ax-close-button [icon]=\"multiple?'ax-ic-check !ax-text-primary-500':'ax-ic-close'\"></ax-close-button>\r\n </ax-header>\r\n <div class=\"ax-p-2\" [class.ax-hidden]=\"!_searchBox\" [cdkTrapFocus]=\"_searchBox!=null\">\r\n <ng-content select=\"ax-search-box\" ></ng-content>\r\n </div>\r\n <div class=\"ax-content ax-list-items-container ax-default\" (scroll)=\"_handleListScroll($event)\"\r\n #listContainer>\r\n <ng-container *ngIf=\"displayItems.length; else tmpEmpty\">\r\n <ul>\r\n <ng-container *ngTemplateOutlet=\"tmpTree; context:{ list: displayItems }\">\r\n </ng-container>\r\n <ng-template #tmpTree let-list=\"list\">\r\n <ng-container *ngFor=\"let item of list;let i = index;trackBy : _trackByFunction\">\r\n <ng-container *ngIf=\"itemTemplate; else defualtTemplate\">\r\n <li class=\"ax-list-item\" (click)=\"_handleOnItemClick($event,item)\"\r\n [attr.data-id]=\"item[this.valueField]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item,direction:direction}\">\r\n </ng-container>\r\n </li>\r\n </ng-container>\r\n <ng-template #defualtTemplate>\r\n <ng-container *ngIf=\"item.children?.length > 0;else tmpItem\">\r\n <li class=\"ax-list-item-group\" [attr.data-id]=\"item[this.valueField]\">\r\n <span> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n <ul *ngIf=\"item.children?.length > 0\">\r\n <ng-container\r\n *ngTemplateOutlet=\"tmpTree; context:{ list: item.children }\">\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n <ng-template #tmpItem>\r\n <ng-container *ngIf=\"!multiple; else multipleTemplate\">\r\n <li class=\"ax-list-item\" [class.ax-state-selected]=\"isItemSelected(item)\"\r\n [class.ax-state-disabled]=\"isItemDisabled(item)\" [attr.tabindex]=\"i\"\r\n (click)=\"_handleOnItemClick($event,item)\"\r\n [attr.data-id]=\"item[this.valueField]\">\r\n <span> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n </li>\r\n </ng-container>\r\n <ng-template #multipleTemplate>\r\n <li class=\"ax-list-item\" [class.ax-state-selected]=\"isItemSelected(item)\"\r\n [class.ax-state-disabled]=\"isItemDisabled(item)\"\r\n [class.ax-check-box]=\"checkbox\" [attr.tabindex]=\"i\"\r\n (click)=\"_handleOnItemClick($event,item)\"\r\n [attr.data-id]=\"item[this.valueField]\">\r\n <input type=\"checkbox\" [class.ax-state-disabled]=\"isItemDisabled(item)\"\r\n *ngIf=\"checkbox\" [checked]=\"isItemSelected(item)\"\r\n [disabled]=\"isItemDisabled(item)\">\r\n <span class=\"ax-ms-2\"> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n </li>\r\n </ng-template>\r\n </ng-template>\r\n </ng-template>\r\n </ng-container>\r\n </ng-template>\r\n </ul>\r\n </ng-container>\r\n <ng-container *ngIf=\"isLoading\">\r\n <ng-container *ngIf=\"loadingTemplate; else elseLoadingTemplate\">\r\n <ng-container *ngTemplateOutlet=\"loadingTemplate\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseLoadingTemplate>\r\n <div class=\"ax-flex ax-items-center ax-justify-center ax-p-4\">\r\n <ax-loading text=\"{{ 'layout.loading.text' | trans }}\"></ax-loading>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #tmpEmpty>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <ng-container *ngIf=\"emptyTemplate; else elseEmptyTemplate\">\r\n <ng-container *ngTemplateOutlet=\"emptyTemplate\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseEmptyTemplate>\r\n <div class=\"ax-list-item\">\r\n {{ 'common.no-result-found' | trans }}\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </ng-template>\r\n\r\n </div>\r\n <!-- <div class=\"ax-list-items-container ax-vertical ax-default\" [class.ax-full]=\"_isMobile\"\r\n >\r\n \r\n </div> -->\r\n <!-- <div class=\"ax-footer\">footer</div> -->\r\n </div>\r\n </div>\r\n</ax-popover>", components: [{ type: AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { type: AXDecoratorSuffixComponent, selector: "ax-suffix" }, { type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "size", "color", "look", "text", "submitBehavior", "cancelBehavior", "toggleable", "selected"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange"] }, { type: AXDecoratorPrefixComponent, selector: "ax-prefix" }, { type: AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "text"], outputs: ["visibleChange"] }, { type: AXPopoverComponent, selector: "ax-popover", inputs: ["target", "position", "openTrigger", "closeTrigger", "hasBackdrop", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { type: AXDecoratorHeaderComponent, selector: "ax-header" }, { type: AXDecoratorTitleComponent, selector: "ax-title", inputs: ["text"] }, { type: AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["icon"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "trans": i1$4.AXTranslatorPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
7741
|
+
], queries: [{ propertyName: "_searchBox", first: true, predicate: AXSearchBoxComponent, descendants: true, static: true }, { propertyName: "_contentEmptyTemplate", first: true, predicate: ["emptyTemplate"], descendants: true }], viewQueries: [{ propertyName: "popover", first: true, predicate: AXPopoverComponent, descendants: true, static: true }, { propertyName: "listContainer", first: true, predicate: ["listContainer"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<div class=\"ax-dropdown-content\" [class.ax-state-disabled]=\"disabled\" (click)=\"_handleInputClickEvent($event)\">\r\n <div class=\"ax-select-box-selection\" [tabindex]=\"tabIndex\" (focus)=\"_emitOnFocusEvent($event)\"\r\n (blur)=\"_emitOnBlurEvent($event)\">\r\n <ng-container *ngIf=\"selectedItems && selectedItems.length; else showPlaceholder\">\r\n <ng-container *ngIf=\"!multiple; then singleSelectedTemplate; else multipleSelectedTemplate\"></ng-container>\r\n <ng-template #singleSelectedTemplate>\r\n <ng-container *ngFor=\"let item of selectedItems\">\r\n <span class=\"ax-mx-2\"> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n </ng-container>\r\n </ng-template>\r\n <ng-template #multipleSelectedTemplate>\r\n <div class=\"ax-flex ax-mx-2\">\r\n <ng-container *ngFor=\"let item of selectedItems\">\r\n <ax-badge [text]=\"_getItemDisplayTextTemplte(item)\" color=\"light\" class=\"ax-me-2\">\r\n <ax-suffix>\r\n <ax-icon icon=\"ax-ic ax-ic-close ax-cursor-pointer\"\r\n (click)=\"_handleBadgeRemove($event,item)\"></ax-icon>\r\n </ax-suffix>\r\n </ax-badge>\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #showPlaceholder>\r\n <div class=\"ax-placeholder\" role=\"textbox\" area-readonly=\"true\"> {{placeholder}}</div>\r\n </ng-template>\r\n </div>\r\n</div>\r\n<ax-button color=\"light\" look=\"blank\" (onClick)=\"clear()\" [tabIndex]=\"-1\"\r\n *ngIf=\"value && clearButton && !(disabled || readonly)\">\r\n <ax-icon icon=\"ax-ic ax-ic-close\"></ax-icon>\r\n</ax-button>\r\n<ax-button [disabled]=\"disabled\" [tabIndex]=\"-1\" color=\"light\" look=\"blank\" (onClick)=\"_handleArrowClickEvent($event)\">\r\n <ax-prefix *ngIf=\"(isLoading && !this.popover.isOpen);else icon\">\r\n <ax-loading type=\"spinner\"></ax-loading>\r\n </ax-prefix>\r\n <ng-template #icon>\r\n <ax-icon #icon icon=\"ax-ic ax-ic-chevron ax-transform ax--rotate-90\"></ax-icon>\r\n </ng-template>\r\n</ax-button>\r\n<ng-content select=\"ax-validation-rule\">\r\n</ng-content>\r\n<ng-content select=\"ax-suffix\">\r\n</ng-content>\r\n<ax-popover [target]=\"_target\" [position]=\"position\" [openTrigger]=\"'manual'\" [closeTrigger]=\"'clickout'\"\r\n [adaptivityEnabled]=\"true\" (onOpened)=\"_handlePopupOnOpened($event)\" (onClosed)=\"_handlePopupOnClosed($event)\">\r\n <div class=\"ax-overlay-pane \" (keydown)=\"_handlePopoverKeydown($event)\" tabindex=\"0\" aria-modal=\"true\" cdkTrapFocus\r\n [class.ax-overlay-actionsheet]=\"_isMobile\" [class.ax-full]=\"_searchBox || isLazy\"\r\n [style.min-width.px]=\"_popoverWidth\">\r\n <div class=\"ax-list\">\r\n <ax-header *ngIf=\"_isMobile\">\r\n <ax-title [text]=\"_popoverTitle\"></ax-title>\r\n <ax-close-button [icon]=\"multiple?'ax-ic-check !ax-text-primary-500':'ax-ic-close'\"></ax-close-button>\r\n </ax-header>\r\n <div class=\"ax-p-2\" [class.ax-hidden]=\"!_searchBox\" [cdkTrapFocus]=\"_searchBox!=null\">\r\n <ng-content select=\"ax-search-box\"></ng-content>\r\n </div>\r\n <div class=\"ax-content ax-list-items-container ax-default\" (scroll)=\"_handleListScroll($event)\"\r\n #listContainer>\r\n <ng-container *ngIf=\"displayItems.length; else tmpEmpty\">\r\n <ul>\r\n <ng-container *ngTemplateOutlet=\"tmpTree; context:{ list: displayItems }\">\r\n </ng-container>\r\n <ng-template #tmpTree let-list=\"list\">\r\n <ng-container *ngFor=\"let item of list;let i = index;trackBy : _trackByFunction\">\r\n <ng-container *ngIf=\"itemTemplate; else defualtTemplate\">\r\n <li class=\"ax-list-item\" (click)=\"_handleOnItemClick($event,item)\"\r\n [attr.data-id]=\"item[this.valueField]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item,direction:direction}\">\r\n </ng-container>\r\n </li>\r\n </ng-container>\r\n <ng-template #defualtTemplate>\r\n <ng-container *ngIf=\"item.children?.length > 0;else tmpItem\">\r\n <li class=\"ax-list-item-group\" [attr.data-id]=\"item[this.valueField]\">\r\n <span> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n <ul *ngIf=\"item.children?.length > 0\">\r\n <ng-container\r\n *ngTemplateOutlet=\"tmpTree; context:{ list: item.children }\">\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n <ng-template #tmpItem>\r\n <ng-container *ngIf=\"!multiple; else multipleTemplate\">\r\n <li class=\"ax-list-item\" [class.ax-state-selected]=\"isItemSelected(item)\"\r\n [class.ax-state-disabled]=\"isItemDisabled(item)\" [attr.tabindex]=\"i\"\r\n (click)=\"_handleOnItemClick($event,item)\"\r\n [attr.data-id]=\"item[this.valueField]\">\r\n <span> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n </li>\r\n </ng-container>\r\n <ng-template #multipleTemplate>\r\n <li class=\"ax-list-item\" [class.ax-state-selected]=\"isItemSelected(item)\"\r\n [class.ax-state-disabled]=\"isItemDisabled(item)\"\r\n [class.ax-check-box]=\"checkbox\" [attr.tabindex]=\"i\"\r\n (click)=\"_handleOnItemClick($event,item)\"\r\n [attr.data-id]=\"item[this.valueField]\">\r\n <input type=\"checkbox\" [class.ax-state-disabled]=\"isItemDisabled(item)\"\r\n *ngIf=\"checkbox\" [checked]=\"isItemSelected(item)\"\r\n [disabled]=\"isItemDisabled(item)\">\r\n <span class=\"ax-ms-2\"> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n </li>\r\n </ng-template>\r\n </ng-template>\r\n </ng-template>\r\n </ng-container>\r\n </ng-template>\r\n </ul>\r\n </ng-container>\r\n <ng-container *ngIf=\"isLoading\">\r\n <ng-container *ngIf=\"loadingTemplate; else elseLoadingTemplate\">\r\n <ng-container *ngTemplateOutlet=\"loadingTemplate\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseLoadingTemplate>\r\n <div class=\"ax-flex ax-items-center ax-justify-center ax-p-4\">\r\n <ax-loading text=\"{{ 'layout.loading.text' | trans }}\"></ax-loading>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #tmpEmpty>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <ng-container *ngIf=\"emptyTemplate; else elseEmptyTemplate\">\r\n <ng-container *ngTemplateOutlet=\"emptyTemplate\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseEmptyTemplate>\r\n <div class=\"ax-flex ax-items-center ax-justify-center ax-p-4\"\r\n [innerHTML]=\"'common.no-result-for' | trans:{exp:this._searchBox? this._searchBox.searchExp :''}\">\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </ng-template>\r\n\r\n </div>\r\n <!-- <div class=\"ax-list-items-container ax-vertical ax-default\" [class.ax-full]=\"_isMobile\"\r\n >\r\n \r\n </div> -->\r\n <!-- <div class=\"ax-footer\">footer</div> -->\r\n </div>\r\n </div>\r\n</ax-popover>", components: [{ type: AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }, { type: AXDecoratorSuffixComponent, selector: "ax-suffix" }, { type: AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { type: AXButtonComponent, selector: "ax-button", inputs: ["disabled", "tabIndex", "size", "color", "look", "text", "submitBehavior", "cancelBehavior", "toggleable", "selected"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange"] }, { type: AXDecoratorPrefixComponent, selector: "ax-prefix" }, { type: AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "text"], outputs: ["visibleChange"] }, { type: AXPopoverComponent, selector: "ax-popover", inputs: ["target", "position", "openTrigger", "closeTrigger", "hasBackdrop", "backdropClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { type: AXDecoratorHeaderComponent, selector: "ax-header" }, { type: AXDecoratorTitleComponent, selector: "ax-title", inputs: ["text"] }, { type: AXDecoratorCloseButtonComponent, selector: "ax-close-button", inputs: ["icon"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i7.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "trans": i1$4.AXTranslatorPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
7729
7742
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSelectBoxComponent, decorators: [{
|
|
7730
7743
|
type: Component,
|
|
7731
7744
|
args: [{ selector: 'ax-select-box', inputs: [...DROPDOWN_INPUTS, ...INTERACTIVE_INPUTS, ...VALUE_INPUTS, ...TEXTBOX_INPUTS, ...DATALIST_INPUTS, ...SELECTION_INPUTS], outputs: [...DROPDOWN_OUTPUT, ...INTERACTIVE_OUTPUT, ...VALUE_OUTPUT, ...TEXTBOX_OUTPUT, ...SELECTION_OUTPUT], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
7732
7745
|
{ provide: AXClosbaleComponent, useExisting: AXSelectBoxComponent },
|
|
7733
7746
|
{ provide: AXSearchableComponent, useExisting: AXSelectBoxComponent }
|
|
7734
|
-
], host: { class: 'ax-editor-container ax-drop-down' }, template: "<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<div class=\"ax-dropdown-content\" [class.ax-state-disabled]=\"disabled\" (click)=\"_handleInputClickEvent($event)\">\r\n <div class=\"ax-select-box-selection\" [tabindex]=\"tabIndex\" (focus)=\"_emitOnFocusEvent($event)\"\r\n (blur)=\"_emitOnBlurEvent($event)\">\r\n <ng-container *ngIf=\"selectedItems && selectedItems.length; else showPlaceholder\">\r\n <ng-container *ngIf=\"!multiple; then singleSelectedTemplate; else multipleSelectedTemplate\"></ng-container>\r\n <ng-template #singleSelectedTemplate>\r\n <ng-container *ngFor=\"let item of selectedItems\">\r\n <span class=\"ax-mx-2\"> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n </ng-container>\r\n </ng-template>\r\n <ng-template #multipleSelectedTemplate>\r\n <div class=\"ax-flex ax-mx-2\">\r\n <ng-container *ngFor=\"let item of selectedItems\">\r\n <ax-badge [text]=\"_getItemDisplayTextTemplte(item)\" color=\"light\" class=\"ax-me-2\">\r\n <ax-suffix>\r\n <ax-icon icon=\"ax-ic ax-ic-close ax-cursor-pointer\"\r\n (click)=\"_handleBadgeRemove($event,item)\"></ax-icon>\r\n </ax-suffix>\r\n </ax-badge>\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #showPlaceholder>\r\n <div class=\"ax-placeholder\" role=\"textbox\" area-readonly=\"true\"> {{placeholder}}</div>\r\n </ng-template>\r\n </div>\r\n</div>\r\n<ax-button color=\"light\" look=\"blank\" (onClick)=\"clear()\" [tabIndex]=\"-1\"\r\n *ngIf=\"value && clearButton && !(disabled || readonly)\">\r\n <ax-icon icon=\"ax-ic ax-ic-close\"></ax-icon>\r\n</ax-button>\r\n<ax-button [disabled]=\"disabled\" [tabIndex]=\"-1\" color=\"light\" look=\"blank\" (onClick)=\"_handleArrowClickEvent($event)\">\r\n <ax-prefix *ngIf=\"(isLoading && !this.popover.isOpen);else icon\">\r\n <ax-loading type=\"spinner\"></ax-loading>\r\n </ax-prefix>\r\n <ng-template #icon>\r\n <ax-icon #icon icon=\"ax-ic ax-ic-chevron ax-transform ax--rotate-90\"></ax-icon>\r\n </ng-template>\r\n</ax-button>\r\n<ng-content select=\"ax-validation-rule\">\r\n</ng-content>\r\n<ng-content select=\"ax-suffix\">\r\n</ng-content>\r\n<ax-popover [target]=\"_target\" [position]=\"position\" [openTrigger]=\"'manual'\" [closeTrigger]=\"'clickout'\"
|
|
7747
|
+
], host: { class: 'ax-editor-container ax-drop-down' }, template: "<ng-content select=\"ax-prefix\">\r\n</ng-content>\r\n<div class=\"ax-dropdown-content\" [class.ax-state-disabled]=\"disabled\" (click)=\"_handleInputClickEvent($event)\">\r\n <div class=\"ax-select-box-selection\" [tabindex]=\"tabIndex\" (focus)=\"_emitOnFocusEvent($event)\"\r\n (blur)=\"_emitOnBlurEvent($event)\">\r\n <ng-container *ngIf=\"selectedItems && selectedItems.length; else showPlaceholder\">\r\n <ng-container *ngIf=\"!multiple; then singleSelectedTemplate; else multipleSelectedTemplate\"></ng-container>\r\n <ng-template #singleSelectedTemplate>\r\n <ng-container *ngFor=\"let item of selectedItems\">\r\n <span class=\"ax-mx-2\"> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n </ng-container>\r\n </ng-template>\r\n <ng-template #multipleSelectedTemplate>\r\n <div class=\"ax-flex ax-mx-2\">\r\n <ng-container *ngFor=\"let item of selectedItems\">\r\n <ax-badge [text]=\"_getItemDisplayTextTemplte(item)\" color=\"light\" class=\"ax-me-2\">\r\n <ax-suffix>\r\n <ax-icon icon=\"ax-ic ax-ic-close ax-cursor-pointer\"\r\n (click)=\"_handleBadgeRemove($event,item)\"></ax-icon>\r\n </ax-suffix>\r\n </ax-badge>\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #showPlaceholder>\r\n <div class=\"ax-placeholder\" role=\"textbox\" area-readonly=\"true\"> {{placeholder}}</div>\r\n </ng-template>\r\n </div>\r\n</div>\r\n<ax-button color=\"light\" look=\"blank\" (onClick)=\"clear()\" [tabIndex]=\"-1\"\r\n *ngIf=\"value && clearButton && !(disabled || readonly)\">\r\n <ax-icon icon=\"ax-ic ax-ic-close\"></ax-icon>\r\n</ax-button>\r\n<ax-button [disabled]=\"disabled\" [tabIndex]=\"-1\" color=\"light\" look=\"blank\" (onClick)=\"_handleArrowClickEvent($event)\">\r\n <ax-prefix *ngIf=\"(isLoading && !this.popover.isOpen);else icon\">\r\n <ax-loading type=\"spinner\"></ax-loading>\r\n </ax-prefix>\r\n <ng-template #icon>\r\n <ax-icon #icon icon=\"ax-ic ax-ic-chevron ax-transform ax--rotate-90\"></ax-icon>\r\n </ng-template>\r\n</ax-button>\r\n<ng-content select=\"ax-validation-rule\">\r\n</ng-content>\r\n<ng-content select=\"ax-suffix\">\r\n</ng-content>\r\n<ax-popover [target]=\"_target\" [position]=\"position\" [openTrigger]=\"'manual'\" [closeTrigger]=\"'clickout'\"\r\n [adaptivityEnabled]=\"true\" (onOpened)=\"_handlePopupOnOpened($event)\" (onClosed)=\"_handlePopupOnClosed($event)\">\r\n <div class=\"ax-overlay-pane \" (keydown)=\"_handlePopoverKeydown($event)\" tabindex=\"0\" aria-modal=\"true\" cdkTrapFocus\r\n [class.ax-overlay-actionsheet]=\"_isMobile\" [class.ax-full]=\"_searchBox || isLazy\"\r\n [style.min-width.px]=\"_popoverWidth\">\r\n <div class=\"ax-list\">\r\n <ax-header *ngIf=\"_isMobile\">\r\n <ax-title [text]=\"_popoverTitle\"></ax-title>\r\n <ax-close-button [icon]=\"multiple?'ax-ic-check !ax-text-primary-500':'ax-ic-close'\"></ax-close-button>\r\n </ax-header>\r\n <div class=\"ax-p-2\" [class.ax-hidden]=\"!_searchBox\" [cdkTrapFocus]=\"_searchBox!=null\">\r\n <ng-content select=\"ax-search-box\"></ng-content>\r\n </div>\r\n <div class=\"ax-content ax-list-items-container ax-default\" (scroll)=\"_handleListScroll($event)\"\r\n #listContainer>\r\n <ng-container *ngIf=\"displayItems.length; else tmpEmpty\">\r\n <ul>\r\n <ng-container *ngTemplateOutlet=\"tmpTree; context:{ list: displayItems }\">\r\n </ng-container>\r\n <ng-template #tmpTree let-list=\"list\">\r\n <ng-container *ngFor=\"let item of list;let i = index;trackBy : _trackByFunction\">\r\n <ng-container *ngIf=\"itemTemplate; else defualtTemplate\">\r\n <li class=\"ax-list-item\" (click)=\"_handleOnItemClick($event,item)\"\r\n [attr.data-id]=\"item[this.valueField]\">\r\n <ng-container\r\n *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item,direction:direction}\">\r\n </ng-container>\r\n </li>\r\n </ng-container>\r\n <ng-template #defualtTemplate>\r\n <ng-container *ngIf=\"item.children?.length > 0;else tmpItem\">\r\n <li class=\"ax-list-item-group\" [attr.data-id]=\"item[this.valueField]\">\r\n <span> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n <ul *ngIf=\"item.children?.length > 0\">\r\n <ng-container\r\n *ngTemplateOutlet=\"tmpTree; context:{ list: item.children }\">\r\n </ng-container>\r\n </ul>\r\n </li>\r\n </ng-container>\r\n <ng-template #tmpItem>\r\n <ng-container *ngIf=\"!multiple; else multipleTemplate\">\r\n <li class=\"ax-list-item\" [class.ax-state-selected]=\"isItemSelected(item)\"\r\n [class.ax-state-disabled]=\"isItemDisabled(item)\" [attr.tabindex]=\"i\"\r\n (click)=\"_handleOnItemClick($event,item)\"\r\n [attr.data-id]=\"item[this.valueField]\">\r\n <span> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n </li>\r\n </ng-container>\r\n <ng-template #multipleTemplate>\r\n <li class=\"ax-list-item\" [class.ax-state-selected]=\"isItemSelected(item)\"\r\n [class.ax-state-disabled]=\"isItemDisabled(item)\"\r\n [class.ax-check-box]=\"checkbox\" [attr.tabindex]=\"i\"\r\n (click)=\"_handleOnItemClick($event,item)\"\r\n [attr.data-id]=\"item[this.valueField]\">\r\n <input type=\"checkbox\" [class.ax-state-disabled]=\"isItemDisabled(item)\"\r\n *ngIf=\"checkbox\" [checked]=\"isItemSelected(item)\"\r\n [disabled]=\"isItemDisabled(item)\">\r\n <span class=\"ax-ms-2\"> {{ _getItemDisplayTextTemplte(item) }}</span>\r\n </li>\r\n </ng-template>\r\n </ng-template>\r\n </ng-template>\r\n </ng-container>\r\n </ng-template>\r\n </ul>\r\n </ng-container>\r\n <ng-container *ngIf=\"isLoading\">\r\n <ng-container *ngIf=\"loadingTemplate; else elseLoadingTemplate\">\r\n <ng-container *ngTemplateOutlet=\"loadingTemplate\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseLoadingTemplate>\r\n <div class=\"ax-flex ax-items-center ax-justify-center ax-p-4\">\r\n <ax-loading text=\"{{ 'layout.loading.text' | trans }}\"></ax-loading>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n <ng-template #tmpEmpty>\r\n <ng-container *ngIf=\"!isLoading\">\r\n <ng-container *ngIf=\"emptyTemplate; else elseEmptyTemplate\">\r\n <ng-container *ngTemplateOutlet=\"emptyTemplate\">\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #elseEmptyTemplate>\r\n <div class=\"ax-flex ax-items-center ax-justify-center ax-p-4\"\r\n [innerHTML]=\"'common.no-result-for' | trans:{exp:this._searchBox? this._searchBox.searchExp :''}\">\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n </ng-template>\r\n\r\n </div>\r\n <!-- <div class=\"ax-list-items-container ax-vertical ax-default\" [class.ax-full]=\"_isMobile\"\r\n >\r\n \r\n </div> -->\r\n <!-- <div class=\"ax-footer\">footer</div> -->\r\n </div>\r\n </div>\r\n</ax-popover>" }]
|
|
7735
7748
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$4.AXPlatform }]; }, propDecorators: { popover: [{
|
|
7736
7749
|
type: ViewChild,
|
|
7737
7750
|
args: [AXPopoverComponent, { static: true }]
|
|
@@ -8963,16 +8976,17 @@ class AXValidationRuleComponent extends AXBaseComponentMixin {
|
|
|
8963
8976
|
if (this.enabled === false) {
|
|
8964
8977
|
return Promise.resolve({ result: true });
|
|
8965
8978
|
}
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
|
|
8970
|
-
|
|
8971
|
-
return this._internalValidate(this.rule, value, this.message, this.value);
|
|
8979
|
+
if (this.rule == 'custom') {
|
|
8980
|
+
const regRule = AXConfig.get(`form.validation.rules.${this.value}`);
|
|
8981
|
+
if (regRule) {
|
|
8982
|
+
return this._internalValidate(regRule.rule, value, this.message || regRule.message, regRule.value);
|
|
8983
|
+
}
|
|
8972
8984
|
}
|
|
8985
|
+
return this._internalValidate(this.rule, value, this.message, this.value);
|
|
8973
8986
|
}
|
|
8974
8987
|
_internalValidate(type, value, message, ruleValue) {
|
|
8975
8988
|
return new Promise(resolve => {
|
|
8989
|
+
debugger;
|
|
8976
8990
|
switch (type) {
|
|
8977
8991
|
case 'required':
|
|
8978
8992
|
resolve({
|
|
@@ -8987,7 +9001,6 @@ class AXValidationRuleComponent extends AXBaseComponentMixin {
|
|
|
8987
9001
|
result: ex.test(value)
|
|
8988
9002
|
});
|
|
8989
9003
|
break;
|
|
8990
|
-
case 'custom':
|
|
8991
9004
|
case 'callback':
|
|
8992
9005
|
if (typeof ruleValue === 'function') {
|
|
8993
9006
|
const res = {};
|
|
@@ -9008,11 +9021,17 @@ class AXValidationRuleComponent extends AXBaseComponentMixin {
|
|
|
9008
9021
|
}
|
|
9009
9022
|
}
|
|
9010
9023
|
else {
|
|
9011
|
-
resolve({
|
|
9024
|
+
resolve({
|
|
9025
|
+
message: AXTranslator.get('validation.messages.invalid-rull-fn'),
|
|
9026
|
+
result: false
|
|
9027
|
+
});
|
|
9012
9028
|
}
|
|
9013
9029
|
break;
|
|
9014
9030
|
default:
|
|
9015
|
-
resolve({
|
|
9031
|
+
resolve({
|
|
9032
|
+
message: AXTranslator.get('validation.messages.invalid-rull-name'),
|
|
9033
|
+
result: false
|
|
9034
|
+
});
|
|
9016
9035
|
}
|
|
9017
9036
|
});
|
|
9018
9037
|
}
|