@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 } 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';
|
|
@@ -484,7 +484,17 @@ function _DatalistComponenetMixin(Base) {
|
|
|
484
484
|
return __classPrivateFieldGet(this, _isLoading, "f");
|
|
485
485
|
}
|
|
486
486
|
_formatData(v) {
|
|
487
|
-
return _.unionBy(v.map((o, i) => {
|
|
487
|
+
// return _.unionBy(v.map((o, i) => {
|
|
488
|
+
// if (typeof o == 'object')
|
|
489
|
+
// return o
|
|
490
|
+
// else {
|
|
491
|
+
// const no: any = {};
|
|
492
|
+
// no[this.valueField] = o;
|
|
493
|
+
// no[Array.isArray(this.textField) ? this.textField[0] : this.textField] = o;
|
|
494
|
+
// return no;
|
|
495
|
+
// }
|
|
496
|
+
// }), this.valueField);
|
|
497
|
+
return v.map((o, i) => {
|
|
488
498
|
if (typeof o == 'object')
|
|
489
499
|
return o;
|
|
490
500
|
else {
|
|
@@ -493,16 +503,17 @@ function _DatalistComponenetMixin(Base) {
|
|
|
493
503
|
no[Array.isArray(this.textField) ? this.textField[0] : this.textField] = o;
|
|
494
504
|
return no;
|
|
495
505
|
}
|
|
496
|
-
})
|
|
506
|
+
});
|
|
497
507
|
}
|
|
498
508
|
_fetchData(opts) {
|
|
499
|
-
|
|
509
|
+
const skip = __classPrivateFieldGet(this, _currentPage, "f") * this.pageSize, take = this.pageSize;
|
|
510
|
+
if ((this.loadedCount >= this.totalCount && this.totalCount != 0) || __classPrivateFieldGet(this, _isLoading, "f") || !__classPrivateFieldGet(this, _isLazy, "f") || (skip > this.totalCount)) {
|
|
500
511
|
return;
|
|
501
512
|
}
|
|
502
513
|
if (__classPrivateFieldGet(this, _items, "f")) {
|
|
503
514
|
__classPrivateFieldSet(this, _isLoading, true, "f");
|
|
504
515
|
const fetchFn = __classPrivateFieldGet(this, _items, "f");
|
|
505
|
-
fetchFn({ skip
|
|
516
|
+
fetchFn({ skip, take, searchQuery: opts?.searchQuery }).then(c => {
|
|
506
517
|
var _a;
|
|
507
518
|
if (Array.isArray(c)) {
|
|
508
519
|
__classPrivateFieldSet(this, _loadedItems, this._formatData(c), "f");
|
|
@@ -510,7 +521,7 @@ function _DatalistComponenetMixin(Base) {
|
|
|
510
521
|
}
|
|
511
522
|
else {
|
|
512
523
|
__classPrivateFieldSet(this, _totalItems, c.total || c.items?.length || 0, "f");
|
|
513
|
-
__classPrivateFieldSet(this, _loadedItems, __classPrivateFieldGet(this, _loadedItems, "f").concat(this._formatData(c.items)), "f");
|
|
524
|
+
__classPrivateFieldSet(this, _loadedItems, [...new Set(__classPrivateFieldGet(this, _loadedItems, "f").concat(this._formatData(c.items)))], "f");
|
|
514
525
|
__classPrivateFieldSet(this, _currentPage, (_a = __classPrivateFieldGet(this, _currentPage, "f"), _a++, _a), "f");
|
|
515
526
|
}
|
|
516
527
|
this._cdr.markForCheck();
|
|
@@ -3383,7 +3394,6 @@ class AXCalendarComponent extends AXCalendarComponentMixin {
|
|
|
3383
3394
|
return date.dayOfWeek == 7 || date.dayOfWeek == 1;
|
|
3384
3395
|
}
|
|
3385
3396
|
_generatePickerItems(view) {
|
|
3386
|
-
debugger;
|
|
3387
3397
|
switch (view) {
|
|
3388
3398
|
case 'year':
|
|
3389
3399
|
this._pickerYears = _.range(2000, 2050, 1);
|
|
@@ -3405,7 +3415,6 @@ class AXCalendarComponent extends AXCalendarComponentMixin {
|
|
|
3405
3415
|
}
|
|
3406
3416
|
}
|
|
3407
3417
|
_handlePickerChange(item, view) {
|
|
3408
|
-
debugger;
|
|
3409
3418
|
if (!item)
|
|
3410
3419
|
return;
|
|
3411
3420
|
const date = this._viewRange.startTime;
|
|
@@ -5342,7 +5351,6 @@ class AXColorPickerComponent extends AXBaseColorPickerMixin {
|
|
|
5342
5351
|
this._platform.resize.subscribe(() => {
|
|
5343
5352
|
this._isMobile = this._platform.is('Mobile');
|
|
5344
5353
|
this.popover.dispose();
|
|
5345
|
-
this._popoverWidth = this._isMobile ? null : this._target.offsetWidth;
|
|
5346
5354
|
});
|
|
5347
5355
|
}
|
|
5348
5356
|
_handleArrowClickEvent(e) {
|
|
@@ -5356,11 +5364,9 @@ class AXColorPickerComponent extends AXBaseColorPickerMixin {
|
|
|
5356
5364
|
onInit() {
|
|
5357
5365
|
super.onInit();
|
|
5358
5366
|
this._target = this._elementRef.nativeElement;
|
|
5359
|
-
this._popoverTitle = this.placeholder || AXTranslator.get('selectbox.popover.title');
|
|
5360
5367
|
}
|
|
5361
5368
|
onViewInit() {
|
|
5362
5369
|
super.onViewInit();
|
|
5363
|
-
this._popoverWidth = this._isMobile ? null : this._target.offsetWidth;
|
|
5364
5370
|
}
|
|
5365
5371
|
_onValueChanged(oldValue, newValue) {
|
|
5366
5372
|
super._onValueChanged(oldValue, newValue);
|
|
@@ -5375,12 +5381,12 @@ class AXColorPickerComponent extends AXBaseColorPickerMixin {
|
|
|
5375
5381
|
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 });
|
|
5376
5382
|
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: [
|
|
5377
5383
|
{ provide: AXClosbaleComponent, useExisting: AXColorPickerComponent }
|
|
5378
|
-
], 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\"
|
|
5384
|
+
], 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 });
|
|
5379
5385
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXColorPickerComponent, decorators: [{
|
|
5380
5386
|
type: Component,
|
|
5381
5387
|
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: [
|
|
5382
5388
|
{ provide: AXClosbaleComponent, useExisting: AXColorPickerComponent }
|
|
5383
|
-
], 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\"
|
|
5389
|
+
], 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>" }]
|
|
5384
5390
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$4.AXPlatform }]; }, propDecorators: { popover: [{
|
|
5385
5391
|
type: ViewChild,
|
|
5386
5392
|
args: [AXPopoverComponent, { static: true }]
|
|
@@ -6518,14 +6524,17 @@ class AXFormComponent extends AXBaseComponentMixin {
|
|
|
6518
6524
|
_getComponenets() {
|
|
6519
6525
|
return Array.from(this._getHostElement().querySelectorAll('[ax-form-input="true"]'));
|
|
6520
6526
|
}
|
|
6521
|
-
validate() {
|
|
6527
|
+
validate(...args) {
|
|
6522
6528
|
const widgets = this._getComponenets();
|
|
6523
6529
|
//
|
|
6524
6530
|
return new Promise((resolve, reject) => {
|
|
6525
6531
|
if (widgets.length === 0) {
|
|
6526
6532
|
return Promise.resolve({ result: true });
|
|
6527
6533
|
}
|
|
6528
|
-
Promise.all(widgets.map((c) => c.__axContext__
|
|
6534
|
+
Promise.all(widgets.map((c) => c.__axContext__)
|
|
6535
|
+
.filter(c => (args == null || args.length == 0) || args.includes(c.name))
|
|
6536
|
+
.map((c) => c.validate()))
|
|
6537
|
+
.then((rules) => {
|
|
6529
6538
|
const failed = rules.filter((c) => !c.result);
|
|
6530
6539
|
if (failed.length) {
|
|
6531
6540
|
reject({
|
|
@@ -6547,12 +6556,12 @@ class AXFormComponent extends AXBaseComponentMixin {
|
|
|
6547
6556
|
}
|
|
6548
6557
|
}
|
|
6549
6558
|
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 });
|
|
6550
|
-
AXFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.9", type: AXFormComponent, selector: "ax-form", usesInheritance: true, ngImport: i0, template: '<
|
|
6559
|
+
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 });
|
|
6551
6560
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXFormComponent, decorators: [{
|
|
6552
6561
|
type: Component,
|
|
6553
6562
|
args: [{
|
|
6554
6563
|
selector: 'ax-form',
|
|
6555
|
-
template: '<
|
|
6564
|
+
template: '<ng-content></ng-content>',
|
|
6556
6565
|
encapsulation: ViewEncapsulation.None,
|
|
6557
6566
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
6558
6567
|
}]
|
|
@@ -6646,7 +6655,7 @@ class AXSearchBoxComponent extends AXBaseComponentMixin {
|
|
|
6646
6655
|
super(_elementRef, _cdr);
|
|
6647
6656
|
this._parent = _parent;
|
|
6648
6657
|
this.placeholder = 'common.search';
|
|
6649
|
-
this.debounceTime =
|
|
6658
|
+
this.debounceTime = 500;
|
|
6650
6659
|
this.searchExp = null;
|
|
6651
6660
|
}
|
|
6652
6661
|
_onSearchExprChanged(e) {
|
|
@@ -6657,12 +6666,15 @@ class AXSearchBoxComponent extends AXBaseComponentMixin {
|
|
|
6657
6666
|
focus() {
|
|
6658
6667
|
this._textbox?.focus();
|
|
6659
6668
|
}
|
|
6669
|
+
clear() {
|
|
6670
|
+
this._textbox._setValue(null);
|
|
6671
|
+
}
|
|
6660
6672
|
}
|
|
6661
6673
|
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 });
|
|
6662
|
-
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 });
|
|
6674
|
+
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 });
|
|
6663
6675
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSearchBoxComponent, decorators: [{
|
|
6664
6676
|
type: Component,
|
|
6665
|
-
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>" }]
|
|
6677
|
+
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>" }]
|
|
6666
6678
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: AXSearchableComponent, decorators: [{
|
|
6667
6679
|
type: Optional
|
|
6668
6680
|
}, {
|
|
@@ -6680,11 +6692,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImpor
|
|
|
6680
6692
|
}] } });
|
|
6681
6693
|
|
|
6682
6694
|
const COMPONENT$9 = [AXSearchBoxComponent];
|
|
6683
|
-
const MODULES$9 = [CommonModule, AXTranslationModule, AXDecoratorModule, AXTextBoxModule];
|
|
6695
|
+
const MODULES$9 = [CommonModule, AXTranslationModule, AXDecoratorModule, AXTextBoxModule, AXButtonModule];
|
|
6684
6696
|
class AXSearchBoxModule {
|
|
6685
6697
|
}
|
|
6686
6698
|
AXSearchBoxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSearchBoxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
6687
|
-
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] });
|
|
6699
|
+
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] });
|
|
6688
6700
|
AXSearchBoxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSearchBoxModule, providers: [], imports: [[...MODULES$9]] });
|
|
6689
6701
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSearchBoxModule, decorators: [{
|
|
6690
6702
|
type: NgModule,
|
|
@@ -6846,10 +6858,10 @@ class AXMenuComponent extends AXBaseMenuMixin {
|
|
|
6846
6858
|
}
|
|
6847
6859
|
}
|
|
6848
6860
|
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 });
|
|
6849
|
-
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: "<
|
|
6861
|
+
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 });
|
|
6850
6862
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXMenuComponent, decorators: [{
|
|
6851
6863
|
type: Component,
|
|
6852
|
-
args: [{ selector: 'ax-menu', inputs: [...INTERACTIVE_INPUTS, ...BASEMENU_INPUTS], outputs: [...INTERACTIVE_OUTPUT], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { class: 'ax-menu' }, template: "<
|
|
6864
|
+
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>" }]
|
|
6853
6865
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { popover: [{
|
|
6854
6866
|
type: ViewChild,
|
|
6855
6867
|
args: [AXPopoverComponent, { static: true }]
|
|
@@ -7437,7 +7449,7 @@ class AXSelectBoxComponent extends AXBaseSelectionDropdownMixin {
|
|
|
7437
7449
|
onInit() {
|
|
7438
7450
|
super.onInit();
|
|
7439
7451
|
this._target = this._elementRef.nativeElement;
|
|
7440
|
-
this.
|
|
7452
|
+
this._updatePopupTitle();
|
|
7441
7453
|
}
|
|
7442
7454
|
onViewInit() {
|
|
7443
7455
|
super.onViewInit();
|
|
@@ -7447,6 +7459,11 @@ class AXSelectBoxComponent extends AXBaseSelectionDropdownMixin {
|
|
|
7447
7459
|
this.value = null;
|
|
7448
7460
|
super.refresh();
|
|
7449
7461
|
}
|
|
7462
|
+
_updatePopupTitle() {
|
|
7463
|
+
// const count =this.selectedItems?.length;
|
|
7464
|
+
// this._popoverTitle = count > 1 ? `(${count}) items selected`: this.placeholder || AXTranslator.get('selectbox.popover.title')
|
|
7465
|
+
this._popoverTitle = this.placeholder || AXTranslator.get('selectbox.popover.title');
|
|
7466
|
+
}
|
|
7450
7467
|
_handleOnItemClick(e, item) {
|
|
7451
7468
|
if (this.isItemDisabled(item)) {
|
|
7452
7469
|
return;
|
|
@@ -7478,6 +7495,7 @@ class AXSelectBoxComponent extends AXBaseSelectionDropdownMixin {
|
|
|
7478
7495
|
this._focusSelectedItem();
|
|
7479
7496
|
this._forceFocus = false;
|
|
7480
7497
|
}
|
|
7498
|
+
this._focusSearchBox();
|
|
7481
7499
|
}, 100);
|
|
7482
7500
|
}
|
|
7483
7501
|
}
|
|
@@ -7542,7 +7560,6 @@ class AXSelectBoxComponent extends AXBaseSelectionDropdownMixin {
|
|
|
7542
7560
|
e.preventDefault();
|
|
7543
7561
|
}
|
|
7544
7562
|
else if ((e.code === 'Space' || e.code === 'Enter')) {
|
|
7545
|
-
debugger;
|
|
7546
7563
|
e.preventDefault();
|
|
7547
7564
|
const focusedItemId = this.listContainer.nativeElement.querySelector('.ax-state-focus')?.dataset?.id;
|
|
7548
7565
|
const focusedItem = _.findLast(this.flatItems, [this.valueField, focusedItemId]);
|
|
@@ -7581,14 +7598,16 @@ class AXSelectBoxComponent extends AXBaseSelectionDropdownMixin {
|
|
|
7581
7598
|
else {
|
|
7582
7599
|
this._focusSelectedItem();
|
|
7583
7600
|
}
|
|
7584
|
-
|
|
7585
|
-
if (this._searchBox && !this._isMobile) {
|
|
7586
|
-
this._searchBox.focus();
|
|
7587
|
-
}
|
|
7601
|
+
this._focusSearchBox();
|
|
7588
7602
|
}
|
|
7589
7603
|
_handlePopupOnClosed(e) {
|
|
7590
7604
|
this.focus();
|
|
7591
7605
|
}
|
|
7606
|
+
_focusSearchBox() {
|
|
7607
|
+
if (this._searchBox && (!this._isMobile || this._searchBox.searchExp)) {
|
|
7608
|
+
this._searchBox.focus();
|
|
7609
|
+
}
|
|
7610
|
+
}
|
|
7592
7611
|
_focusItemByNav(sign) {
|
|
7593
7612
|
const list = this.listContainer.nativeElement;
|
|
7594
7613
|
const fn = (s) => list.querySelector(s);
|
|
@@ -7655,12 +7674,6 @@ class AXSelectBoxComponent extends AXBaseSelectionDropdownMixin {
|
|
|
7655
7674
|
this._fetchData();
|
|
7656
7675
|
}
|
|
7657
7676
|
}
|
|
7658
|
-
_onSearchExprChanged(e) {
|
|
7659
|
-
debugger;
|
|
7660
|
-
this.empty();
|
|
7661
|
-
this._forceFocus = true;
|
|
7662
|
-
this._fetchData();
|
|
7663
|
-
}
|
|
7664
7677
|
search(exp) {
|
|
7665
7678
|
debugger;
|
|
7666
7679
|
this.empty();
|
|
@@ -7675,13 +7688,13 @@ AXSelectBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", ver
|
|
|
7675
7688
|
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: [
|
|
7676
7689
|
{ provide: AXClosbaleComponent, useExisting: AXSelectBoxComponent },
|
|
7677
7690
|
{ provide: AXSearchableComponent, useExisting: AXSelectBoxComponent }
|
|
7678
|
-
], 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 });
|
|
7691
|
+
], 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 });
|
|
7679
7692
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.9", ngImport: i0, type: AXSelectBoxComponent, decorators: [{
|
|
7680
7693
|
type: Component,
|
|
7681
7694
|
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: [
|
|
7682
7695
|
{ provide: AXClosbaleComponent, useExisting: AXSelectBoxComponent },
|
|
7683
7696
|
{ provide: AXSearchableComponent, useExisting: AXSelectBoxComponent }
|
|
7684
|
-
], 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'\"
|
|
7697
|
+
], 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>" }]
|
|
7685
7698
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1$4.AXPlatform }]; }, propDecorators: { popover: [{
|
|
7686
7699
|
type: ViewChild,
|
|
7687
7700
|
args: [AXPopoverComponent, { static: true }]
|
|
@@ -8908,16 +8921,17 @@ class AXValidationRuleComponent extends AXBaseComponentMixin {
|
|
|
8908
8921
|
if (this.enabled === false) {
|
|
8909
8922
|
return Promise.resolve({ result: true });
|
|
8910
8923
|
}
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
return this._internalValidate(this.rule, value, this.message, this.value);
|
|
8924
|
+
if (this.rule == 'custom') {
|
|
8925
|
+
const regRule = AXConfig.get(`form.validation.rules.${this.value}`);
|
|
8926
|
+
if (regRule) {
|
|
8927
|
+
return this._internalValidate(regRule.rule, value, this.message || regRule.message, regRule.value);
|
|
8928
|
+
}
|
|
8917
8929
|
}
|
|
8930
|
+
return this._internalValidate(this.rule, value, this.message, this.value);
|
|
8918
8931
|
}
|
|
8919
8932
|
_internalValidate(type, value, message, ruleValue) {
|
|
8920
8933
|
return new Promise(resolve => {
|
|
8934
|
+
debugger;
|
|
8921
8935
|
switch (type) {
|
|
8922
8936
|
case 'required':
|
|
8923
8937
|
resolve({
|
|
@@ -8932,7 +8946,6 @@ class AXValidationRuleComponent extends AXBaseComponentMixin {
|
|
|
8932
8946
|
result: ex.test(value)
|
|
8933
8947
|
});
|
|
8934
8948
|
break;
|
|
8935
|
-
case 'custom':
|
|
8936
8949
|
case 'callback':
|
|
8937
8950
|
if (typeof ruleValue === 'function') {
|
|
8938
8951
|
const res = {};
|
|
@@ -8953,11 +8966,17 @@ class AXValidationRuleComponent extends AXBaseComponentMixin {
|
|
|
8953
8966
|
}
|
|
8954
8967
|
}
|
|
8955
8968
|
else {
|
|
8956
|
-
resolve({
|
|
8969
|
+
resolve({
|
|
8970
|
+
message: AXTranslator.get('validation.messages.invalid-rull-fn'),
|
|
8971
|
+
result: false
|
|
8972
|
+
});
|
|
8957
8973
|
}
|
|
8958
8974
|
break;
|
|
8959
8975
|
default:
|
|
8960
|
-
resolve({
|
|
8976
|
+
resolve({
|
|
8977
|
+
message: AXTranslator.get('validation.messages.invalid-rull-name'),
|
|
8978
|
+
result: false
|
|
8979
|
+
});
|
|
8961
8980
|
}
|
|
8962
8981
|
});
|
|
8963
8982
|
}
|