@acorex/cdk 20.2.0-next.9 → 20.2.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/accordion/index.d.ts +21 -16
- package/carousel/index.d.ts +1 -0
- package/common/README.md +1 -1
- package/common/index.d.ts +113 -2
- package/drag-drop/index.d.ts +1 -0
- package/drawer/index.d.ts +15 -0
- package/fesm2022/acorex-cdk-accordion.mjs +103 -54
- package/fesm2022/acorex-cdk-accordion.mjs.map +1 -1
- package/fesm2022/acorex-cdk-carousel.mjs +11 -5
- package/fesm2022/acorex-cdk-carousel.mjs.map +1 -1
- package/fesm2022/acorex-cdk-clipboard.mjs +6 -6
- package/fesm2022/acorex-cdk-clipboard.mjs.map +1 -1
- package/fesm2022/acorex-cdk-common.mjs +452 -157
- package/fesm2022/acorex-cdk-common.mjs.map +1 -1
- package/fesm2022/acorex-cdk-dom.mjs +3 -3
- package/fesm2022/acorex-cdk-dom.mjs.map +1 -1
- package/fesm2022/acorex-cdk-drag-drop.mjs +23 -20
- package/fesm2022/acorex-cdk-drag-drop.mjs.map +1 -1
- package/fesm2022/acorex-cdk-drawer.mjs +27 -14
- package/fesm2022/acorex-cdk-drawer.mjs.map +1 -1
- package/fesm2022/acorex-cdk-focus-trap.mjs +3 -3
- package/fesm2022/acorex-cdk-focus-trap.mjs.map +1 -1
- package/fesm2022/acorex-cdk-input-mask.mjs +65 -7
- package/fesm2022/acorex-cdk-input-mask.mjs.map +1 -1
- package/fesm2022/acorex-cdk-list-navigation.mjs +75 -100
- package/fesm2022/acorex-cdk-list-navigation.mjs.map +1 -1
- package/fesm2022/acorex-cdk-outline.mjs +24 -29
- package/fesm2022/acorex-cdk-outline.mjs.map +1 -1
- package/fesm2022/acorex-cdk-overlay.mjs +3 -3
- package/fesm2022/acorex-cdk-overlay.mjs.map +1 -1
- package/fesm2022/acorex-cdk-pan-view.mjs +5 -5
- package/fesm2022/acorex-cdk-pan-view.mjs.map +1 -1
- package/fesm2022/acorex-cdk-qrcode.mjs.map +1 -1
- package/fesm2022/acorex-cdk-resizable.mjs +3 -3
- package/fesm2022/acorex-cdk-resizable.mjs.map +1 -1
- package/fesm2022/acorex-cdk-selection.mjs +76 -16
- package/fesm2022/acorex-cdk-selection.mjs.map +1 -1
- package/fesm2022/acorex-cdk-sliding-item.mjs +5 -22
- package/fesm2022/acorex-cdk-sliding-item.mjs.map +1 -1
- package/fesm2022/acorex-cdk-sticky.mjs +3 -3
- package/fesm2022/acorex-cdk-sticky.mjs.map +1 -1
- package/fesm2022/acorex-cdk-virtual-scroll.mjs +10 -10
- package/fesm2022/acorex-cdk-virtual-scroll.mjs.map +1 -1
- package/fesm2022/acorex-cdk-wysiwyg.mjs +5 -0
- package/fesm2022/acorex-cdk-wysiwyg.mjs.map +1 -1
- package/focus-trap/index.d.ts +1 -1
- package/input-mask/index.d.ts +38 -0
- package/list-navigation/index.d.ts +20 -20
- package/outline/index.d.ts +3 -8
- package/overlay/index.d.ts +1 -1
- package/package.json +2 -5
- package/selection/index.d.ts +5 -3
- package/sliding-item/index.d.ts +8 -15
- package/virtual-scroll/index.d.ts +1 -1
- package/wysiwyg/index.d.ts +3 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { model, output, Component, inject, ElementRef, signal, afterNextRender, Injectable, ChangeDetectorRef, ViewContainerRef, EventEmitter, DOCUMENT, PLATFORM_ID, Renderer2, Input, Directive, NgModule, InjectionToken, Output, input, effect } from '@angular/core';
|
|
3
3
|
import { AXHtmlUtil } from '@acorex/core/utils';
|
|
4
|
-
import { flatten, clone, cloneDeep, isEqual, omit, set } from 'lodash-es';
|
|
4
|
+
import { flatten, clone, cloneDeep, isEqual, omit, set, get } from 'lodash-es';
|
|
5
5
|
import { isBrowser } from '@acorex/core/platform';
|
|
6
6
|
import { AXValidationService } from '@acorex/core/validation';
|
|
7
7
|
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
@@ -21,10 +21,10 @@ class NXButtonComponent {
|
|
|
21
21
|
this.toggleableChange = output();
|
|
22
22
|
this.selectedChange = output();
|
|
23
23
|
}
|
|
24
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
25
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.
|
|
24
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
25
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.3", type: NXButtonComponent, isStandalone: true, selector: "ng-component", inputs: { text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { text: "textChange", toggleableChange: "toggleableChange", selectedChange: "selectedChange" }, ngImport: i0, template: '', isInline: true }); }
|
|
26
26
|
}
|
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXButtonComponent, decorators: [{
|
|
28
28
|
type: Component,
|
|
29
29
|
args: [{
|
|
30
30
|
template: '',
|
|
@@ -35,10 +35,10 @@ class NXColorComponent {
|
|
|
35
35
|
constructor() {
|
|
36
36
|
this.color = model('default', ...(ngDevMode ? [{ debugName: "color" }] : []));
|
|
37
37
|
}
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
39
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXColorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
39
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.3", type: NXColorComponent, isStandalone: true, selector: "ng-component", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { color: "colorChange" }, ngImport: i0, template: '', isInline: true }); }
|
|
40
40
|
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXColorComponent, decorators: [{
|
|
42
42
|
type: Component,
|
|
43
43
|
args: [{
|
|
44
44
|
template: '',
|
|
@@ -63,10 +63,10 @@ class NXComponent {
|
|
|
63
63
|
get nativeElement() {
|
|
64
64
|
return this.#elementRef.nativeElement;
|
|
65
65
|
}
|
|
66
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
67
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
66
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
67
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXComponent }); }
|
|
68
68
|
}
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXComponent, decorators: [{
|
|
70
70
|
type: Injectable
|
|
71
71
|
}] });
|
|
72
72
|
|
|
@@ -106,10 +106,10 @@ class NXInteractiveComponent extends NXComponent {
|
|
|
106
106
|
hasFocus() {
|
|
107
107
|
return AXHtmlUtil.hasFocus(this.nativeElement);
|
|
108
108
|
}
|
|
109
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
110
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.
|
|
109
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXInteractiveComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
110
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.3", type: NXInteractiveComponent, isStandalone: true, selector: "ng-component", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", tabIndex: "tabIndexChange", onFocus: "onFocus", onBlur: "onBlur" }, usesInheritance: true, ngImport: i0, template: '', isInline: true }); }
|
|
111
111
|
}
|
|
112
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXInteractiveComponent, decorators: [{
|
|
113
113
|
type: Component,
|
|
114
114
|
args: [{
|
|
115
115
|
template: '',
|
|
@@ -120,10 +120,10 @@ class NXLookComponent {
|
|
|
120
120
|
constructor() {
|
|
121
121
|
this.look = model('solid', ...(ngDevMode ? [{ debugName: "look" }] : []));
|
|
122
122
|
}
|
|
123
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
124
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.
|
|
123
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXLookComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
124
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.3", type: NXLookComponent, isStandalone: true, selector: "ng-component", inputs: { look: { classPropertyName: "look", publicName: "look", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { look: "lookChange" }, ngImport: i0, template: '', isInline: true }); }
|
|
125
125
|
}
|
|
126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXLookComponent, decorators: [{
|
|
127
127
|
type: Component,
|
|
128
128
|
args: [{
|
|
129
129
|
template: '',
|
|
@@ -137,10 +137,10 @@ class NXValueComponent {
|
|
|
137
137
|
this.value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : []));
|
|
138
138
|
this.onValueChanged = output();
|
|
139
139
|
}
|
|
140
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
141
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.
|
|
140
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
141
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.3", type: NXValueComponent, isStandalone: true, selector: "ng-component", inputs: { readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { readonly: "readonlyChange", name: "nameChange", value: "valueChange", onValueChanged: "onValueChanged" }, ngImport: i0, template: '', isInline: true }); }
|
|
142
142
|
}
|
|
143
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
143
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: NXValueComponent, decorators: [{
|
|
144
144
|
type: Component,
|
|
145
145
|
args: [{
|
|
146
146
|
template: '',
|
|
@@ -316,10 +316,10 @@ class AXDomService {
|
|
|
316
316
|
const randomness = Math.random().toString(36).substr(2);
|
|
317
317
|
return dateString + randomness;
|
|
318
318
|
}
|
|
319
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
320
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
319
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXDomService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
320
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXDomService, providedIn: 'root' }); }
|
|
321
321
|
}
|
|
322
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
322
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXDomService, decorators: [{
|
|
323
323
|
type: Injectable,
|
|
324
324
|
args: [{ providedIn: 'root' }]
|
|
325
325
|
}] });
|
|
@@ -347,6 +347,11 @@ class MXBaseComponent {
|
|
|
347
347
|
get cdr() {
|
|
348
348
|
return this._cdr;
|
|
349
349
|
}
|
|
350
|
+
/**
|
|
351
|
+
* Gets the host HTML element of the component.
|
|
352
|
+
*
|
|
353
|
+
* @returns T - The native DOM element associated with this component.
|
|
354
|
+
*/
|
|
350
355
|
getHostElement() {
|
|
351
356
|
return this._elementRef?.nativeElement;
|
|
352
357
|
}
|
|
@@ -363,6 +368,11 @@ class MXBaseComponent {
|
|
|
363
368
|
ngOnInit() {
|
|
364
369
|
this.getHostElement().__axContext__ = this;
|
|
365
370
|
}
|
|
371
|
+
/**
|
|
372
|
+
* Sets a component option with optional lifecycle callbacks.
|
|
373
|
+
*
|
|
374
|
+
* @param option - The option configuration containing the name, value and optional before/after callbacks.
|
|
375
|
+
*/
|
|
366
376
|
setOption(option) {
|
|
367
377
|
const oldValue = this[option.name];
|
|
368
378
|
let newValue = this.internalOptionChanging({
|
|
@@ -388,10 +398,10 @@ class MXBaseComponent {
|
|
|
388
398
|
if (option.afterCallback)
|
|
389
399
|
option.afterCallback(oldValue, newValue);
|
|
390
400
|
}
|
|
391
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
392
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
401
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
402
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXBaseComponent }); }
|
|
393
403
|
}
|
|
394
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
404
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXBaseComponent, decorators: [{
|
|
395
405
|
type: Injectable
|
|
396
406
|
}] });
|
|
397
407
|
|
|
@@ -428,6 +438,11 @@ class MXInteractiveComponent extends MXBaseComponent {
|
|
|
428
438
|
// this._focused.set(false);
|
|
429
439
|
// }
|
|
430
440
|
}
|
|
441
|
+
/**
|
|
442
|
+
* Registers a touched callback function (ControlValueAccessor method).
|
|
443
|
+
*
|
|
444
|
+
* @param fn - The callback function to register.
|
|
445
|
+
*/
|
|
431
446
|
registerOnTouched(fn) {
|
|
432
447
|
this.onTouchedCallback = fn;
|
|
433
448
|
}
|
|
@@ -463,6 +478,11 @@ class MXInteractiveComponent extends MXBaseComponent {
|
|
|
463
478
|
},
|
|
464
479
|
});
|
|
465
480
|
}
|
|
481
|
+
/**
|
|
482
|
+
* Sets the disabled state of the component.
|
|
483
|
+
*
|
|
484
|
+
* @param isDisabled - Whether the component should be disabled.
|
|
485
|
+
*/
|
|
466
486
|
setDisabledState(isDisabled) {
|
|
467
487
|
this.disabled = isDisabled;
|
|
468
488
|
}
|
|
@@ -505,14 +525,22 @@ class MXInteractiveComponent extends MXBaseComponent {
|
|
|
505
525
|
// nativeEvent: e,
|
|
506
526
|
// });
|
|
507
527
|
// }
|
|
528
|
+
/**
|
|
529
|
+
* Focuses the component.
|
|
530
|
+
*/
|
|
508
531
|
focus() {
|
|
509
532
|
AXHtmlUtil.focusElement(this.getHostElement());
|
|
510
533
|
}
|
|
534
|
+
/**
|
|
535
|
+
* Removes focus from the component.
|
|
536
|
+
*/
|
|
511
537
|
blur() {
|
|
512
538
|
AXHtmlUtil.blurElement(this.getHostElement());
|
|
513
539
|
}
|
|
514
540
|
/**
|
|
515
|
-
*
|
|
541
|
+
* Checks if the component is focused or has any focused element.
|
|
542
|
+
*
|
|
543
|
+
* @returns boolean - True if the component has focus.
|
|
516
544
|
*/
|
|
517
545
|
hasFocus() {
|
|
518
546
|
return AXHtmlUtil.hasFocus(this.getHostElement());
|
|
@@ -639,10 +667,20 @@ class MXValueComponent extends MXInteractiveComponent {
|
|
|
639
667
|
get isRequired() {
|
|
640
668
|
return this.validationRules?.some((c) => c.rule == 'required');
|
|
641
669
|
}
|
|
670
|
+
/**
|
|
671
|
+
* Adds a validation rule.
|
|
672
|
+
*
|
|
673
|
+
* @param rule - The validation rule to add.
|
|
674
|
+
*/
|
|
642
675
|
addValidationRule(rule) {
|
|
643
676
|
this.validationRules.push(rule);
|
|
644
677
|
this.validationRulesChange.emit(this.validationRules);
|
|
645
678
|
}
|
|
679
|
+
/**
|
|
680
|
+
* Removes a validation rule.
|
|
681
|
+
*
|
|
682
|
+
* @param ruleToRemove - The validation rule to remove.
|
|
683
|
+
*/
|
|
646
684
|
removeValidationRule(ruleToRemove) {
|
|
647
685
|
this.validationRules = this.validationRules.filter((r) => {
|
|
648
686
|
if (r.rule !== ruleToRemove.rule) {
|
|
@@ -656,6 +694,11 @@ class MXValueComponent extends MXInteractiveComponent {
|
|
|
656
694
|
this.validationRulesChange.emit(this.validationRules);
|
|
657
695
|
this.setState('clear');
|
|
658
696
|
}
|
|
697
|
+
/**
|
|
698
|
+
* Validates the component.
|
|
699
|
+
*
|
|
700
|
+
* @returns Promise<AXValidationSummary> - Validation result.
|
|
701
|
+
*/
|
|
659
702
|
async validate() {
|
|
660
703
|
const container_classes = ['ax-editor-container', 'ax-checkbox', 'ax-radio'];
|
|
661
704
|
const container = container_classes.some((c) => this.getHostElement().classList.contains(c))
|
|
@@ -724,12 +767,28 @@ class MXValueComponent extends MXInteractiveComponent {
|
|
|
724
767
|
this.cdr.markForCheck();
|
|
725
768
|
}
|
|
726
769
|
}
|
|
770
|
+
/**
|
|
771
|
+
* Registers a change callback function (ControlValueAccessor method).
|
|
772
|
+
*
|
|
773
|
+
* @param fn - The callback function to register.
|
|
774
|
+
*/
|
|
727
775
|
registerOnChange(fn) {
|
|
728
776
|
this.onChangeCallback = fn;
|
|
729
777
|
}
|
|
778
|
+
/**
|
|
779
|
+
* Writes a value to the component (ControlValueAccessor method).
|
|
780
|
+
*
|
|
781
|
+
* @param value - The value to write.
|
|
782
|
+
*/
|
|
730
783
|
writeValue(value) {
|
|
731
784
|
this.value = value;
|
|
732
785
|
}
|
|
786
|
+
/**
|
|
787
|
+
* Commits a value with optional user interaction flag.
|
|
788
|
+
*
|
|
789
|
+
* @param value - The value to commit.
|
|
790
|
+
* @param u - Optional flag indicating if this is a user interaction.
|
|
791
|
+
*/
|
|
733
792
|
commitValue(value, u = false) {
|
|
734
793
|
if (u) {
|
|
735
794
|
this.markAsTouched();
|
|
@@ -738,16 +797,24 @@ class MXValueComponent extends MXInteractiveComponent {
|
|
|
738
797
|
}
|
|
739
798
|
this.writeValue(value);
|
|
740
799
|
}
|
|
800
|
+
/**
|
|
801
|
+
* Resets the component value.
|
|
802
|
+
*
|
|
803
|
+
* @param e - Optional flag indicating if this is a user interaction.
|
|
804
|
+
*/
|
|
741
805
|
reset(e = false) {
|
|
742
806
|
this.commitValue(null, e);
|
|
743
807
|
}
|
|
808
|
+
/**
|
|
809
|
+
* Resets validation errors.
|
|
810
|
+
*/
|
|
744
811
|
resetErrors() {
|
|
745
812
|
this.setState('clear');
|
|
746
813
|
}
|
|
747
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
748
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
814
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXValueComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
815
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXValueComponent }); }
|
|
749
816
|
}
|
|
750
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
817
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXValueComponent, decorators: [{
|
|
751
818
|
type: Injectable
|
|
752
819
|
}] });
|
|
753
820
|
|
|
@@ -804,6 +871,12 @@ class AXButtonClickEvent extends AXClickEvent {
|
|
|
804
871
|
*/
|
|
805
872
|
class AXItemClickEvent extends AXClickEvent {
|
|
806
873
|
}
|
|
874
|
+
/**
|
|
875
|
+
* Fires each time the user select the element.
|
|
876
|
+
* @category Events
|
|
877
|
+
*/
|
|
878
|
+
class AXItemSelectedEvent extends AXEvent {
|
|
879
|
+
}
|
|
807
880
|
/**
|
|
808
881
|
* Fires each time the component gets focused.
|
|
809
882
|
* @category Events
|
|
@@ -854,52 +927,52 @@ class AXComponentClosedPromise extends Promise {
|
|
|
854
927
|
}
|
|
855
928
|
}
|
|
856
929
|
class AXComponent {
|
|
857
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
858
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
930
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
931
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXComponent }); }
|
|
859
932
|
}
|
|
860
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
933
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXComponent, decorators: [{
|
|
861
934
|
type: Injectable
|
|
862
935
|
}] });
|
|
863
936
|
class AXClosableComponent extends AXComponent {
|
|
864
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
865
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
937
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXClosableComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
938
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXClosableComponent }); }
|
|
866
939
|
}
|
|
867
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
940
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXClosableComponent, decorators: [{
|
|
868
941
|
type: Injectable
|
|
869
942
|
}] });
|
|
870
943
|
class AXClearableComponent extends AXComponent {
|
|
871
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
872
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
944
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXClearableComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
945
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXClearableComponent }); }
|
|
873
946
|
}
|
|
874
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
947
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXClearableComponent, decorators: [{
|
|
875
948
|
type: Injectable
|
|
876
949
|
}] });
|
|
877
950
|
class AXSearchableComponent extends AXComponent {
|
|
878
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
879
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
951
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXSearchableComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
952
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXSearchableComponent }); }
|
|
880
953
|
}
|
|
881
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
954
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXSearchableComponent, decorators: [{
|
|
882
955
|
type: Injectable
|
|
883
956
|
}] });
|
|
884
957
|
class AXValuableComponent extends AXComponent {
|
|
885
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
886
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
958
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXValuableComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
959
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXValuableComponent }); }
|
|
887
960
|
}
|
|
888
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
961
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXValuableComponent, decorators: [{
|
|
889
962
|
type: Injectable
|
|
890
963
|
}] });
|
|
891
964
|
class AXFocusableComponent extends AXComponent {
|
|
892
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
893
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
965
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXFocusableComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
966
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXFocusableComponent }); }
|
|
894
967
|
}
|
|
895
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
968
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXFocusableComponent, decorators: [{
|
|
896
969
|
type: Injectable
|
|
897
970
|
}] });
|
|
898
971
|
class AXPagedComponent extends AXComponent {
|
|
899
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
900
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
972
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXPagedComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
973
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXPagedComponent }); }
|
|
901
974
|
}
|
|
902
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
975
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXPagedComponent, decorators: [{
|
|
903
976
|
type: Injectable
|
|
904
977
|
}] });
|
|
905
978
|
class AXAutocompleteParentComponent extends MXValueComponent {
|
|
@@ -921,10 +994,10 @@ class AXAutocompleteParentComponent extends MXValueComponent {
|
|
|
921
994
|
});
|
|
922
995
|
this.oldInputEmitValue = value;
|
|
923
996
|
}
|
|
924
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
925
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
997
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAutocompleteParentComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
998
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAutocompleteParentComponent }); }
|
|
926
999
|
}
|
|
927
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1000
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAutocompleteParentComponent, decorators: [{
|
|
928
1001
|
type: Injectable
|
|
929
1002
|
}] });
|
|
930
1003
|
|
|
@@ -1100,34 +1173,50 @@ class AXDataSource {
|
|
|
1100
1173
|
}
|
|
1101
1174
|
}
|
|
1102
1175
|
function convertArrayToDataSource(items, options = { key: 'id', pageSize: 100 }) {
|
|
1176
|
+
// Normalize primitives to objects so consumers (e.g., select/list) can rely on
|
|
1177
|
+
// value and text fields without triggering extra byKey lookups.
|
|
1178
|
+
const normalizedItems = items.map((candidate) => {
|
|
1179
|
+
const isObjectItem = candidate != null && typeof candidate === 'object';
|
|
1180
|
+
if (isObjectItem) {
|
|
1181
|
+
return candidate;
|
|
1182
|
+
}
|
|
1183
|
+
// For primitive values, create an object with both key and text
|
|
1184
|
+
return { [options.key]: candidate, text: String(candidate ?? '') };
|
|
1185
|
+
});
|
|
1103
1186
|
const config = {
|
|
1104
1187
|
key: options.key,
|
|
1105
1188
|
pageSize: options.pageSize,
|
|
1106
1189
|
load: async (e) => {
|
|
1107
|
-
const
|
|
1190
|
+
const itemsForFilter = normalizedItems;
|
|
1191
|
+
const resultNormalized = e.filter
|
|
1192
|
+
? applyDataSourceQuery(itemsForFilter, e.filter)
|
|
1193
|
+
: itemsForFilter;
|
|
1194
|
+
const result = resultNormalized;
|
|
1108
1195
|
return {
|
|
1109
1196
|
items: result.slice(e.skip, e.skip + e.take),
|
|
1110
|
-
total:
|
|
1197
|
+
total: resultNormalized.length,
|
|
1111
1198
|
};
|
|
1112
1199
|
},
|
|
1113
|
-
byKey: (v) =>
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
if (!filter?.field || filter.value === undefined || filter.value === null) {
|
|
1119
|
-
return items; // No filter applied
|
|
1120
|
-
}
|
|
1121
|
-
return items.filter((item) => {
|
|
1122
|
-
const itemField = item[filter.field];
|
|
1123
|
-
if (typeof itemField === 'string' && typeof filter.value === 'string') {
|
|
1124
|
-
return itemField.toLowerCase().includes(filter.value.toLowerCase());
|
|
1125
|
-
}
|
|
1126
|
-
return false; // Return false if itemField isn't comparable
|
|
1127
|
-
});
|
|
1200
|
+
byKey: async (v) =>
|
|
1201
|
+
// Search in the normalized list (supports primitive and object arrays)
|
|
1202
|
+
normalizedItems.find((record) => {
|
|
1203
|
+
return record[options.key] == v;
|
|
1204
|
+
}),
|
|
1128
1205
|
};
|
|
1129
1206
|
return new AXDataSource(config);
|
|
1130
1207
|
}
|
|
1208
|
+
function applyDataSourceQuery(items, filter) {
|
|
1209
|
+
if (!filter?.field || filter.value === undefined || filter.value === null) {
|
|
1210
|
+
return items; // No filter applied
|
|
1211
|
+
}
|
|
1212
|
+
return items.filter((item) => {
|
|
1213
|
+
const itemField = item[filter.field];
|
|
1214
|
+
if (typeof itemField === 'string' && typeof filter.value === 'string') {
|
|
1215
|
+
return itemField.toLowerCase().includes(filter.value.toLowerCase());
|
|
1216
|
+
}
|
|
1217
|
+
return false; // Return false if itemField isn't comparable
|
|
1218
|
+
});
|
|
1219
|
+
}
|
|
1131
1220
|
|
|
1132
1221
|
const AX_STYLE_COLOR_TYPES = [
|
|
1133
1222
|
'primary',
|
|
@@ -1185,10 +1274,10 @@ class AXAutoFocusDirective {
|
|
|
1185
1274
|
}, this.time);
|
|
1186
1275
|
}
|
|
1187
1276
|
}
|
|
1188
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1189
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.
|
|
1277
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAutoFocusDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1278
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: AXAutoFocusDirective, isStandalone: true, selector: "[axAutoFocus]", inputs: { autoFocus: ["axAutoFocus", "autoFocus"], time: ["axAutoFocusTime", "time"] }, ngImport: i0 }); }
|
|
1190
1279
|
}
|
|
1191
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1280
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXAutoFocusDirective, decorators: [{
|
|
1192
1281
|
type: Directive,
|
|
1193
1282
|
args: [{ selector: '[axAutoFocus]' }]
|
|
1194
1283
|
}], propDecorators: { autoFocus: [{
|
|
@@ -1235,10 +1324,10 @@ class AXHotkeysService {
|
|
|
1235
1324
|
}
|
|
1236
1325
|
});
|
|
1237
1326
|
}
|
|
1238
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1239
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
1327
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXHotkeysService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1328
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXHotkeysService }); }
|
|
1240
1329
|
}
|
|
1241
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1330
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXHotkeysService, decorators: [{
|
|
1242
1331
|
type: Injectable
|
|
1243
1332
|
}] });
|
|
1244
1333
|
|
|
@@ -1298,10 +1387,10 @@ class AXHotkeyDirective {
|
|
|
1298
1387
|
s.unsubscribe();
|
|
1299
1388
|
});
|
|
1300
1389
|
}
|
|
1301
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1302
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.
|
|
1390
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXHotkeyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1391
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: AXHotkeyDirective, isStandalone: true, selector: "[axHotkey]", inputs: { axHotkey: "axHotkey" }, ngImport: i0 }); }
|
|
1303
1392
|
}
|
|
1304
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXHotkeyDirective, decorators: [{
|
|
1305
1394
|
type: Directive,
|
|
1306
1395
|
args: [{ selector: '[axHotkey]' }]
|
|
1307
1396
|
}], propDecorators: { axHotkey: [{
|
|
@@ -1348,10 +1437,10 @@ class AXInfiniteScrollerDirective {
|
|
|
1348
1437
|
return this.scrollCallback();
|
|
1349
1438
|
}));
|
|
1350
1439
|
}
|
|
1351
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1352
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.
|
|
1440
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXInfiniteScrollerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1441
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: AXInfiniteScrollerDirective, isStandalone: true, selector: "[axInfiniteScroller]", inputs: { scrollCallback: "scrollCallback", immediateCallback: "immediateCallback", scrollPercent: "scrollPercent" }, ngImport: i0 }); }
|
|
1353
1442
|
}
|
|
1354
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXInfiniteScrollerDirective, decorators: [{
|
|
1355
1444
|
type: Directive,
|
|
1356
1445
|
args: [{ selector: '[axInfiniteScroller]' }]
|
|
1357
1446
|
}], propDecorators: { scrollCallback: [{
|
|
@@ -1390,20 +1479,20 @@ class AXResponsiveDirective {
|
|
|
1390
1479
|
this._observer?.disconnect();
|
|
1391
1480
|
this._observer?.unobserve(this._elementRef.nativeElement);
|
|
1392
1481
|
}
|
|
1393
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1394
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.
|
|
1482
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXResponsiveDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1483
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: AXResponsiveDirective, isStandalone: true, selector: "[axResponsive]", ngImport: i0 }); }
|
|
1395
1484
|
}
|
|
1396
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1485
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXResponsiveDirective, decorators: [{
|
|
1397
1486
|
type: Directive,
|
|
1398
1487
|
args: [{ selector: '[axResponsive]' }]
|
|
1399
1488
|
}], ctorParameters: () => [] });
|
|
1400
1489
|
|
|
1401
1490
|
class AXCommonModule {
|
|
1402
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1403
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
1404
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
1491
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1492
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.3", ngImport: i0, type: AXCommonModule, imports: [AXResponsiveDirective, AXInfiniteScrollerDirective, AXAutoFocusDirective, AXHotkeyDirective], exports: [AXResponsiveDirective, AXInfiniteScrollerDirective, AXAutoFocusDirective, AXHotkeyDirective] }); }
|
|
1493
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommonModule, providers: [AXHotkeysService] }); }
|
|
1405
1494
|
}
|
|
1406
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1495
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXCommonModule, decorators: [{
|
|
1407
1496
|
type: NgModule,
|
|
1408
1497
|
args: [{
|
|
1409
1498
|
imports: [AXResponsiveDirective, AXInfiniteScrollerDirective, AXAutoFocusDirective, AXHotkeyDirective],
|
|
@@ -1436,10 +1525,10 @@ class MXColorComponent extends MXBaseComponent {
|
|
|
1436
1525
|
}
|
|
1437
1526
|
|
|
1438
1527
|
class MXLookableComponent {
|
|
1439
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1440
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
1528
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXLookableComponent, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1529
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXLookableComponent }); }
|
|
1441
1530
|
}
|
|
1442
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1531
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXLookableComponent, decorators: [{
|
|
1443
1532
|
type: Injectable
|
|
1444
1533
|
}] });
|
|
1445
1534
|
class MXLookComponent extends MXBaseComponent {
|
|
@@ -1614,10 +1703,10 @@ class MXInputBaseValueComponent extends MXValueComponent {
|
|
|
1614
1703
|
else
|
|
1615
1704
|
super.focus();
|
|
1616
1705
|
}
|
|
1617
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1618
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
1706
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXInputBaseValueComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1707
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXInputBaseValueComponent }); }
|
|
1619
1708
|
}
|
|
1620
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1709
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXInputBaseValueComponent, decorators: [{
|
|
1621
1710
|
type: Injectable
|
|
1622
1711
|
}] });
|
|
1623
1712
|
|
|
@@ -1631,10 +1720,10 @@ class MXSelectionBridgeService {
|
|
|
1631
1720
|
/** Cache for normalized items keyed by their unique identifier */
|
|
1632
1721
|
this.cacheList = {};
|
|
1633
1722
|
}
|
|
1634
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1635
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
1723
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXSelectionBridgeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1724
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXSelectionBridgeService }); }
|
|
1636
1725
|
}
|
|
1637
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1726
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXSelectionBridgeService, decorators: [{
|
|
1638
1727
|
type: Injectable
|
|
1639
1728
|
}] });
|
|
1640
1729
|
/**
|
|
@@ -1655,8 +1744,18 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1655
1744
|
this._valueField = 'id';
|
|
1656
1745
|
this._textField = 'text';
|
|
1657
1746
|
this._textTemplate = '';
|
|
1747
|
+
this._defaultText = '-';
|
|
1658
1748
|
this._disabledField = 'disabled';
|
|
1659
1749
|
this._multiple = false;
|
|
1750
|
+
// #endregion
|
|
1751
|
+
// #region Events
|
|
1752
|
+
this.onItemSelected = new EventEmitter();
|
|
1753
|
+
/**
|
|
1754
|
+
* Emitted when an item in the list is clicked.
|
|
1755
|
+
*
|
|
1756
|
+
* @event
|
|
1757
|
+
*/
|
|
1758
|
+
this.onItemClick = new EventEmitter();
|
|
1660
1759
|
}
|
|
1661
1760
|
/** Field name used to extract the unique value from items */
|
|
1662
1761
|
get valueField() {
|
|
@@ -1679,6 +1778,13 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1679
1778
|
set textTemplate(value) {
|
|
1680
1779
|
this.setOption({ name: 'textTemplate', value });
|
|
1681
1780
|
}
|
|
1781
|
+
/** Text to display when neither textField nor valueField exist on the item */
|
|
1782
|
+
get defaultText() {
|
|
1783
|
+
return this._defaultText;
|
|
1784
|
+
}
|
|
1785
|
+
set defaultText(value) {
|
|
1786
|
+
this.setOption({ name: 'defaultText', value });
|
|
1787
|
+
}
|
|
1682
1788
|
/** Field name used to determine if an item is disabled */
|
|
1683
1789
|
get disabledField() {
|
|
1684
1790
|
return this._disabledField;
|
|
@@ -1716,16 +1822,22 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1716
1822
|
if (value == null || (isArray && value.length === 0)) {
|
|
1717
1823
|
return this.multiple ? [] : null;
|
|
1718
1824
|
}
|
|
1719
|
-
//
|
|
1825
|
+
// Check if items already have text properties to avoid unnecessary findByKey calls
|
|
1720
1826
|
const itemsToNormalize = isArray ? value : [value];
|
|
1721
|
-
const
|
|
1827
|
+
const needsFindByKey = itemsToNormalize.some((item) => {
|
|
1828
|
+
if (typeof item === 'object' && item !== null) {
|
|
1829
|
+
return get(item, this.textField) == null;
|
|
1830
|
+
}
|
|
1831
|
+
return true; // Primitive values need findByKey
|
|
1832
|
+
});
|
|
1833
|
+
const normalizedItems = this.normalizeItemsList(itemsToNormalize, needsFindByKey);
|
|
1722
1834
|
if (normalizedItems.length === 0) {
|
|
1723
1835
|
return this.multiple ? [] : null;
|
|
1724
1836
|
}
|
|
1725
1837
|
// Extract values based on selection mode
|
|
1726
1838
|
return this.multiple
|
|
1727
|
-
? normalizedItems.map(item => item
|
|
1728
|
-
: normalizedItems[0]
|
|
1839
|
+
? normalizedItems.map((item) => get(item, this.valueField))
|
|
1840
|
+
: (get(normalizedItems[0], this.valueField) ?? null);
|
|
1729
1841
|
}
|
|
1730
1842
|
/**
|
|
1731
1843
|
* Override to normalize selected items when value changes
|
|
@@ -1745,9 +1857,7 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1745
1857
|
normalizeItemsList(items, findByKey = false) {
|
|
1746
1858
|
if (!items?.length)
|
|
1747
1859
|
return [];
|
|
1748
|
-
return items
|
|
1749
|
-
.filter(item => item != null)
|
|
1750
|
-
.map(item => this.normalizeItem(item, findByKey));
|
|
1860
|
+
return items.filter((item) => item != null).map((item) => this.normalizeItem(item, findByKey));
|
|
1751
1861
|
}
|
|
1752
1862
|
/**
|
|
1753
1863
|
* Normalizes a single item, handling caching and async loading
|
|
@@ -1758,22 +1868,24 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1758
1868
|
normalizeItem(item, findByKey = false) {
|
|
1759
1869
|
const isComplexObject = typeof item === 'object' && item !== null;
|
|
1760
1870
|
const itemRecord = item;
|
|
1761
|
-
const
|
|
1871
|
+
const valueKey = isComplexObject ? get(itemRecord, this.valueField) : item;
|
|
1872
|
+
const key = valueKey != null ? String(valueKey) : String(item);
|
|
1762
1873
|
const cacheKey = this.createCacheKey(key);
|
|
1763
1874
|
// Return cached item if available and has text
|
|
1764
1875
|
const cachedItem = this.dataService.cacheList[cacheKey];
|
|
1765
|
-
if (cachedItem && cachedItem
|
|
1876
|
+
if (cachedItem && get(cachedItem, this.textField) != null) {
|
|
1766
1877
|
return cachedItem;
|
|
1767
1878
|
}
|
|
1768
|
-
const hasTextProperty = !isComplexObject || itemRecord
|
|
1879
|
+
const hasTextProperty = !isComplexObject || get(itemRecord, this.textField) != null;
|
|
1769
1880
|
const normalizedObj = {};
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1881
|
+
// If findByKey is true, we need to resolve the item to get its text
|
|
1882
|
+
// This is needed for string values like 'ir', 'us' that don't have text
|
|
1883
|
+
if (findByKey) {
|
|
1884
|
+
this.handleItemNormalization(normalizedObj, item, key, true, cacheKey);
|
|
1773
1885
|
}
|
|
1774
1886
|
else {
|
|
1775
|
-
//
|
|
1776
|
-
|
|
1887
|
+
// Item already has all required properties, just copy them
|
|
1888
|
+
Object.assign(normalizedObj, item);
|
|
1777
1889
|
}
|
|
1778
1890
|
this.dataService.cacheList[cacheKey] = normalizedObj;
|
|
1779
1891
|
return normalizedObj;
|
|
@@ -1800,9 +1912,9 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1800
1912
|
// Set loading state
|
|
1801
1913
|
obj[this.valueField] = key;
|
|
1802
1914
|
obj['isLoading'] = true;
|
|
1803
|
-
obj[this.textField] = '
|
|
1915
|
+
obj[this.textField] = '@acorex:common.status.loading';
|
|
1804
1916
|
promise
|
|
1805
|
-
.then(result => {
|
|
1917
|
+
.then((result) => {
|
|
1806
1918
|
if (typeof result === 'object' && result) {
|
|
1807
1919
|
Object.assign(obj, cloneDeep(result));
|
|
1808
1920
|
}
|
|
@@ -1810,11 +1922,23 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1810
1922
|
obj[this.valueField] = result || key;
|
|
1811
1923
|
obj[this.textField] = result;
|
|
1812
1924
|
}
|
|
1925
|
+
})
|
|
1926
|
+
.catch((error) => {
|
|
1927
|
+
console.warn('Failed to load item by key:', key, error);
|
|
1928
|
+
// On error, keep the original value but mark as failed
|
|
1929
|
+
obj[this.textField] = this.defaultText;
|
|
1813
1930
|
})
|
|
1814
1931
|
.finally(() => {
|
|
1815
1932
|
delete obj['isLoading'];
|
|
1933
|
+
delete obj['_displayTextLoading'];
|
|
1934
|
+
delete obj['_loadingTriggered'];
|
|
1816
1935
|
this.dataService.cacheList[cacheKey] = obj;
|
|
1817
|
-
|
|
1936
|
+
// Use setTimeout to defer change detection and prevent immediate re-rendering
|
|
1937
|
+
setTimeout(() => {
|
|
1938
|
+
if (this.cdr) {
|
|
1939
|
+
this.cdr.markForCheck();
|
|
1940
|
+
}
|
|
1941
|
+
}, 0);
|
|
1818
1942
|
});
|
|
1819
1943
|
}
|
|
1820
1944
|
/**
|
|
@@ -1824,12 +1948,16 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1824
1948
|
const isSourceObject = typeof sourceItem === 'object' && sourceItem !== null;
|
|
1825
1949
|
const sourceRecord = sourceItem;
|
|
1826
1950
|
if (isComplexSource && isSourceObject) {
|
|
1827
|
-
|
|
1828
|
-
|
|
1951
|
+
const valueFromSource = get(sourceRecord, this.valueField);
|
|
1952
|
+
const textFromSource = get(sourceRecord, this.textField);
|
|
1953
|
+
obj[this.valueField] = (valueFromSource ?? textFromSource);
|
|
1954
|
+
obj[this.textField] = (textFromSource ?? valueFromSource ?? this.defaultText);
|
|
1829
1955
|
}
|
|
1830
1956
|
else {
|
|
1831
|
-
|
|
1832
|
-
|
|
1957
|
+
const valueFromSource = isSourceObject ? get(sourceRecord, this.valueField) : sourceItem;
|
|
1958
|
+
const textFromSource = isSourceObject ? get(sourceRecord, this.textField) : sourceItem;
|
|
1959
|
+
obj[this.valueField] = (valueFromSource ?? textFromSource);
|
|
1960
|
+
obj[this.textField] = (textFromSource ?? valueFromSource ?? this.defaultText);
|
|
1833
1961
|
}
|
|
1834
1962
|
}
|
|
1835
1963
|
/**
|
|
@@ -1842,10 +1970,13 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1842
1970
|
* Normalizes currently selected items and updates the data service
|
|
1843
1971
|
*/
|
|
1844
1972
|
_normalizeSelectedItems() {
|
|
1845
|
-
const values = Array.isArray(this.value)
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
this.dataService.selectedItems = values.map(value =>
|
|
1973
|
+
const values = Array.isArray(this.value) ? this.value : this.value != null ? [this.value] : [];
|
|
1974
|
+
// Only call normalizeItem with findByKey=true if the item doesn't have text
|
|
1975
|
+
// This prevents unnecessary API calls for items that already have text
|
|
1976
|
+
this.dataService.selectedItems = values.map((value) => {
|
|
1977
|
+
const hasText = typeof value === 'object' && value !== null && get(value, this.textField) != null;
|
|
1978
|
+
return this.normalizeItem(value, !hasText);
|
|
1979
|
+
});
|
|
1849
1980
|
}
|
|
1850
1981
|
// #endregion
|
|
1851
1982
|
// #region Public Selection Methods
|
|
@@ -1859,7 +1990,8 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1859
1990
|
return;
|
|
1860
1991
|
}
|
|
1861
1992
|
const normalizedItems = this.normalizeItemsList(items);
|
|
1862
|
-
const newSelectedItems = this.selectedItems.filter(selectedItem => !normalizedItems.some(normalizedItem => normalizedItem
|
|
1993
|
+
const newSelectedItems = this.selectedItems.filter((selectedItem) => !normalizedItems.some((normalizedItem) => get(normalizedItem, this.valueField) ===
|
|
1994
|
+
get(selectedItem, this.valueField)));
|
|
1863
1995
|
this.commitValue(newSelectedItems, true);
|
|
1864
1996
|
}
|
|
1865
1997
|
/**
|
|
@@ -1867,13 +1999,18 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1867
1999
|
* @param items Items to select
|
|
1868
2000
|
*/
|
|
1869
2001
|
selectItems(...items) {
|
|
1870
|
-
if (!items?.length)
|
|
2002
|
+
if (!items?.length) {
|
|
1871
2003
|
return;
|
|
2004
|
+
}
|
|
1872
2005
|
const currentValue = Array.isArray(this.value) ? this.value : [this.value];
|
|
1873
2006
|
const normalizedItems = this.normalizeItemsList(items);
|
|
1874
|
-
const newSelectedItems = this.multiple
|
|
1875
|
-
|
|
1876
|
-
:
|
|
2007
|
+
const newSelectedItems = this.multiple ? [...currentValue, ...normalizedItems] : normalizedItems;
|
|
2008
|
+
this.onItemSelected.emit({
|
|
2009
|
+
component: this,
|
|
2010
|
+
isUserInteraction: true,
|
|
2011
|
+
item: newSelectedItems[0],
|
|
2012
|
+
htmlElement: this.getHostElement(),
|
|
2013
|
+
});
|
|
1877
2014
|
this.commitValue(newSelectedItems, true);
|
|
1878
2015
|
}
|
|
1879
2016
|
/**
|
|
@@ -1881,11 +2018,9 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1881
2018
|
* @param items Items to toggle
|
|
1882
2019
|
*/
|
|
1883
2020
|
toggleSelect(...items) {
|
|
1884
|
-
items?.forEach(item => {
|
|
2021
|
+
items?.forEach((item) => {
|
|
1885
2022
|
if (this.multiple) {
|
|
1886
|
-
this.isItemSelected(item)
|
|
1887
|
-
? this.unselectItems(item)
|
|
1888
|
-
: this.selectItems(item);
|
|
2023
|
+
this.isItemSelected(item) ? this.unselectItems(item) : this.selectItems(item);
|
|
1889
2024
|
}
|
|
1890
2025
|
else {
|
|
1891
2026
|
this.selectItems(item);
|
|
@@ -1901,7 +2036,8 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1901
2036
|
*/
|
|
1902
2037
|
isItemSelected(item) {
|
|
1903
2038
|
const normalizedItem = this.normalizeItem(item);
|
|
1904
|
-
|
|
2039
|
+
const normalizedValue = get(normalizedItem, this.valueField);
|
|
2040
|
+
return this.selectedItems.some((selectedItem) => get(selectedItem, this.valueField) === normalizedValue);
|
|
1905
2041
|
}
|
|
1906
2042
|
/**
|
|
1907
2043
|
* Checks if an item is disabled
|
|
@@ -1911,9 +2047,18 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1911
2047
|
isItemDisabled(item) {
|
|
1912
2048
|
const itemRecord = item;
|
|
1913
2049
|
return (this.disabled ||
|
|
1914
|
-
coerceBooleanProperty(itemRecord
|
|
2050
|
+
coerceBooleanProperty(get(itemRecord, this.disabledField)) === true ||
|
|
1915
2051
|
(this.disabledCallback?.({ item, index: -1 }) ?? false));
|
|
1916
2052
|
}
|
|
2053
|
+
/**
|
|
2054
|
+
* Checks if an item is currently loading
|
|
2055
|
+
* @param item Item to check
|
|
2056
|
+
* @returns True if the item is loading
|
|
2057
|
+
*/
|
|
2058
|
+
isItemLoading(item) {
|
|
2059
|
+
const normalizedItem = this.normalizeItem(item);
|
|
2060
|
+
return normalizedItem['isLoading'] === true;
|
|
2061
|
+
}
|
|
1917
2062
|
// #endregion
|
|
1918
2063
|
// #region Protected Utility Methods
|
|
1919
2064
|
/**
|
|
@@ -1922,22 +2067,109 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1922
2067
|
* @returns Formatted display text
|
|
1923
2068
|
*/
|
|
1924
2069
|
getDisplayText(item) {
|
|
1925
|
-
|
|
2070
|
+
// Prevent recursive calls that could cause infinite loops
|
|
2071
|
+
if (item && typeof item === 'object' && item['_displayTextLoading']) {
|
|
2072
|
+
return '@acorex:common.status.loading';
|
|
2073
|
+
}
|
|
2074
|
+
// Add timestamp-based debouncing to prevent excessive calls for ALL item types
|
|
2075
|
+
const now = Date.now();
|
|
2076
|
+
const itemKey = typeof item === 'string' ? item : get(item, this.valueField);
|
|
2077
|
+
const cacheKey = this.createCacheKey(String(itemKey));
|
|
2078
|
+
// Check if we have a recent result in the cache to prevent duplicate processing
|
|
2079
|
+
const cachedResult = this.dataService.cacheList[cacheKey];
|
|
2080
|
+
if (cachedResult && cachedResult['_lastDisplayTextCall']) {
|
|
2081
|
+
const timeSinceLastCall = now - cachedResult['_lastDisplayTextCall'];
|
|
2082
|
+
if (timeSinceLastCall < 50) {
|
|
2083
|
+
// 50ms debounce
|
|
2084
|
+
return cachedResult['_lastDisplayTextResult'] || String(itemKey || '');
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
// For string values, we need to normalize with findByKey=true to trigger async loading
|
|
2088
|
+
const isStringValue = typeof item === 'string';
|
|
2089
|
+
const normalizedItem = this.normalizeItem(item, isStringValue);
|
|
2090
|
+
// Check if this item is already in the cache with proper text
|
|
2091
|
+
const itemValue = get(normalizedItem, this.valueField);
|
|
2092
|
+
if (itemValue != null && itemValue !== '') {
|
|
2093
|
+
const cacheKey = this.createCacheKey(String(itemValue));
|
|
2094
|
+
const cachedItem = this.dataService.cacheList[cacheKey];
|
|
2095
|
+
if (cachedItem && get(cachedItem, this.textField) != null) {
|
|
2096
|
+
// Use cached text if available
|
|
2097
|
+
const cachedText = get(cachedItem, this.textField);
|
|
2098
|
+
if (cachedText && cachedText !== '@acorex:common.status.loading') {
|
|
2099
|
+
const result = String(cachedText);
|
|
2100
|
+
// Cache the timestamp and result for debouncing in the cache (works for all item types)
|
|
2101
|
+
if (cachedItem) {
|
|
2102
|
+
cachedItem['_lastDisplayTextCall'] = now;
|
|
2103
|
+
cachedItem['_lastDisplayTextResult'] = result;
|
|
2104
|
+
}
|
|
2105
|
+
return result;
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
1926
2109
|
// Try template formatting first
|
|
1927
2110
|
if (this.textTemplate) {
|
|
1928
2111
|
const formattedTemplate = this.formatService.format(this.textTemplate, 'string', normalizedItem);
|
|
1929
2112
|
if (formattedTemplate !== this.textTemplate) {
|
|
1930
|
-
|
|
2113
|
+
const result = formattedTemplate;
|
|
2114
|
+
// Cache the timestamp and result for debouncing in the cache
|
|
2115
|
+
if (normalizedItem) {
|
|
2116
|
+
normalizedItem['_lastDisplayTextCall'] = now;
|
|
2117
|
+
normalizedItem['_lastDisplayTextResult'] = result;
|
|
2118
|
+
}
|
|
2119
|
+
return result;
|
|
1931
2120
|
}
|
|
1932
2121
|
}
|
|
1933
2122
|
// Use text field or fallback to value field
|
|
1934
|
-
|
|
1935
|
-
|
|
2123
|
+
const textValue = get(normalizedItem, this.textField);
|
|
2124
|
+
if (textValue != null && textValue !== '') {
|
|
2125
|
+
const result = String(textValue);
|
|
2126
|
+
// Cache the timestamp and result for debouncing in the cache
|
|
2127
|
+
if (normalizedItem) {
|
|
2128
|
+
normalizedItem['_lastDisplayTextCall'] = now;
|
|
2129
|
+
normalizedItem['_lastDisplayTextResult'] = result;
|
|
2130
|
+
}
|
|
2131
|
+
return result;
|
|
2132
|
+
}
|
|
2133
|
+
// If text is missing and item is loading, show loading state
|
|
2134
|
+
if (normalizedItem['isLoading']) {
|
|
2135
|
+
const result = '@acorex:common.status.loading';
|
|
2136
|
+
// Cache the timestamp and result for debouncing in the cache
|
|
2137
|
+
if (normalizedItem) {
|
|
2138
|
+
normalizedItem['_lastDisplayTextCall'] = now;
|
|
2139
|
+
normalizedItem['_lastDisplayTextResult'] = result;
|
|
2140
|
+
}
|
|
2141
|
+
return result;
|
|
1936
2142
|
}
|
|
1937
2143
|
// Attempt to load item by key if text is missing
|
|
1938
|
-
const value = normalizedItem
|
|
1939
|
-
|
|
1940
|
-
|
|
2144
|
+
const value = get(normalizedItem, this.valueField);
|
|
2145
|
+
if (value == null || value === '') {
|
|
2146
|
+
const result = this.defaultText;
|
|
2147
|
+
// Cache the timestamp and result for debouncing in the cache
|
|
2148
|
+
if (normalizedItem) {
|
|
2149
|
+
normalizedItem['_lastDisplayTextCall'] = now;
|
|
2150
|
+
normalizedItem['_lastDisplayTextResult'] = result;
|
|
2151
|
+
}
|
|
2152
|
+
return result;
|
|
2153
|
+
}
|
|
2154
|
+
// If we have a value but no text, trigger async loading only once
|
|
2155
|
+
// Use a flag to prevent multiple calls
|
|
2156
|
+
if (!normalizedItem['_loadingTriggered'] && !normalizedItem[this.textField]) {
|
|
2157
|
+
normalizedItem['_loadingTriggered'] = true;
|
|
2158
|
+
normalizedItem['_displayTextLoading'] = true;
|
|
2159
|
+
// Use setTimeout to defer the async loading and prevent immediate change detection
|
|
2160
|
+
setTimeout(() => {
|
|
2161
|
+
this.loadAndCacheItemByKey(value);
|
|
2162
|
+
}, 0);
|
|
2163
|
+
}
|
|
2164
|
+
// Return the value itself as a fallback
|
|
2165
|
+
// This will be updated once the async loading completes
|
|
2166
|
+
const result = String(value);
|
|
2167
|
+
// Cache the timestamp and result for debouncing in the cache
|
|
2168
|
+
if (normalizedItem) {
|
|
2169
|
+
normalizedItem['_lastDisplayTextCall'] = now;
|
|
2170
|
+
normalizedItem['_lastDisplayTextResult'] = result;
|
|
2171
|
+
}
|
|
2172
|
+
return result;
|
|
1941
2173
|
}
|
|
1942
2174
|
/**
|
|
1943
2175
|
* Gets the value of an item
|
|
@@ -1946,7 +2178,7 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1946
2178
|
*/
|
|
1947
2179
|
getValue(item) {
|
|
1948
2180
|
const normalizedItem = this.normalizeItem(item);
|
|
1949
|
-
return normalizedItem
|
|
2181
|
+
return get(normalizedItem, this.valueField);
|
|
1950
2182
|
}
|
|
1951
2183
|
/**
|
|
1952
2184
|
* Clears the selection cache and selected items
|
|
@@ -1963,6 +2195,52 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1963
2195
|
this.dataService.cacheList = {};
|
|
1964
2196
|
this.cdr.markForCheck();
|
|
1965
2197
|
}
|
|
2198
|
+
/**
|
|
2199
|
+
* Clears the debouncing cache for specific items to ensure fresh data is displayed
|
|
2200
|
+
*/
|
|
2201
|
+
clearItemDebouncingCache(item) {
|
|
2202
|
+
// Get the cache key for this item
|
|
2203
|
+
const itemKey = typeof item === 'string' ? item : get(item, this.valueField);
|
|
2204
|
+
if (itemKey != null) {
|
|
2205
|
+
const cacheKey = this.createCacheKey(String(itemKey));
|
|
2206
|
+
const cachedItem = this.dataService.cacheList[cacheKey];
|
|
2207
|
+
if (cachedItem) {
|
|
2208
|
+
delete cachedItem['_lastDisplayTextCall'];
|
|
2209
|
+
delete cachedItem['_lastDisplayTextResult'];
|
|
2210
|
+
delete cachedItem['_displayTextLoading'];
|
|
2211
|
+
delete cachedItem['_loadingTriggered'];
|
|
2212
|
+
}
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
/**
|
|
2216
|
+
* Forces a refresh of the display when items are loaded asynchronously
|
|
2217
|
+
* This should be called when the data source is updated
|
|
2218
|
+
*/
|
|
2219
|
+
refreshDisplay() {
|
|
2220
|
+
this.cdr.markForCheck();
|
|
2221
|
+
}
|
|
2222
|
+
/**
|
|
2223
|
+
* Refreshes the display for all selected items to ensure consistency
|
|
2224
|
+
* This is useful when the data source has been updated
|
|
2225
|
+
*/
|
|
2226
|
+
refreshSelectedItemsDisplay() {
|
|
2227
|
+
// Force a refresh of the display without re-normalizing to avoid infinite loops
|
|
2228
|
+
if (this.selectedItems.length > 0) {
|
|
2229
|
+
this.cdr.markForCheck();
|
|
2230
|
+
}
|
|
2231
|
+
}
|
|
2232
|
+
/**
|
|
2233
|
+
* Forces a refresh of all selected items by clearing their debouncing cache
|
|
2234
|
+
* This ensures fresh data is displayed when the data source is updated
|
|
2235
|
+
*/
|
|
2236
|
+
forceRefreshSelectedItems() {
|
|
2237
|
+
if (this.selectedItems.length > 0) {
|
|
2238
|
+
this.selectedItems.forEach((item) => {
|
|
2239
|
+
this.clearItemDebouncingCache(item);
|
|
2240
|
+
});
|
|
2241
|
+
this.cdr.markForCheck();
|
|
2242
|
+
}
|
|
2243
|
+
}
|
|
1966
2244
|
// #endregion
|
|
1967
2245
|
// #region Private Helper Methods
|
|
1968
2246
|
/**
|
|
@@ -1975,18 +2253,35 @@ class MXSelectionValueComponent extends MXValueComponent {
|
|
|
1975
2253
|
if (item) {
|
|
1976
2254
|
const normalizedItem = this.normalizeItem(item);
|
|
1977
2255
|
const cacheKey = this.createCacheKey(String(normalizedItem[this.valueField]));
|
|
2256
|
+
// Update the cache with the loaded item
|
|
1978
2257
|
this.dataService.cacheList[cacheKey] = normalizedItem;
|
|
1979
|
-
|
|
2258
|
+
// Clear loading flags
|
|
2259
|
+
if (this.dataService.cacheList[cacheKey]) {
|
|
2260
|
+
delete this.dataService.cacheList[cacheKey]['_displayTextLoading'];
|
|
2261
|
+
delete this.dataService.cacheList[cacheKey]['_loadingTriggered'];
|
|
2262
|
+
}
|
|
2263
|
+
// Use setTimeout to defer change detection and prevent immediate re-rendering
|
|
2264
|
+
setTimeout(() => {
|
|
2265
|
+
if (this.cdr) {
|
|
2266
|
+
this.cdr.markForCheck();
|
|
2267
|
+
}
|
|
2268
|
+
}, 0);
|
|
1980
2269
|
}
|
|
1981
2270
|
}
|
|
1982
2271
|
catch (error) {
|
|
1983
2272
|
console.warn('Failed to load item by key:', key, error);
|
|
2273
|
+
// Clear loading flags on error too
|
|
2274
|
+
const cacheKey = this.createCacheKey(String(key));
|
|
2275
|
+
if (this.dataService.cacheList[cacheKey]) {
|
|
2276
|
+
delete this.dataService.cacheList[cacheKey]['_displayTextLoading'];
|
|
2277
|
+
delete this.dataService.cacheList[cacheKey]['_loadingTriggered'];
|
|
2278
|
+
}
|
|
1984
2279
|
}
|
|
1985
2280
|
}
|
|
1986
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1987
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
2281
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXSelectionValueComponent, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2282
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXSelectionValueComponent }); }
|
|
1988
2283
|
}
|
|
1989
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
2284
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: MXSelectionValueComponent, decorators: [{
|
|
1990
2285
|
type: Injectable
|
|
1991
2286
|
}] });
|
|
1992
2287
|
|
|
@@ -2019,10 +2314,10 @@ class AXNgModelDelayedValueChangedDirective {
|
|
|
2019
2314
|
distinctUntilChanged(), debounceTime(this.delayTime))
|
|
2020
2315
|
.subscribe((value) => this.axDelayedValueChanged.emit(value));
|
|
2021
2316
|
}
|
|
2022
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
2023
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.
|
|
2317
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXNgModelDelayedValueChangedDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2318
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: AXNgModelDelayedValueChangedDirective, isStandalone: true, selector: "[axDelayedValueChanged]", inputs: { delayTime: "delayTime" }, outputs: { axDelayedValueChanged: "axDelayedValueChanged", axDelayTimeChange: "axDelayTimeChange" }, ngImport: i0 }); }
|
|
2024
2319
|
}
|
|
2025
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
2320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXNgModelDelayedValueChangedDirective, decorators: [{
|
|
2026
2321
|
type: Directive,
|
|
2027
2322
|
args: [{
|
|
2028
2323
|
selector: '[axDelayedValueChanged]',
|
|
@@ -2073,10 +2368,10 @@ class AXInvertedColorDirective {
|
|
|
2073
2368
|
});
|
|
2074
2369
|
}
|
|
2075
2370
|
}
|
|
2076
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
2077
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.
|
|
2371
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXInvertedColorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2372
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.3", type: AXInvertedColorDirective, isStandalone: true, selector: "[axInvertedColor]", inputs: { color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
2078
2373
|
}
|
|
2079
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
2374
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXInvertedColorDirective, decorators: [{
|
|
2080
2375
|
type: Directive,
|
|
2081
2376
|
args: [{
|
|
2082
2377
|
selector: '[axInvertedColor]',
|
|
@@ -2129,10 +2424,10 @@ class AXRippleDirective {
|
|
|
2129
2424
|
});
|
|
2130
2425
|
}
|
|
2131
2426
|
}
|
|
2132
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
2133
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.
|
|
2427
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXRippleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2428
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.3", type: AXRippleDirective, isStandalone: true, selector: "[axRipple]", inputs: { enabled: ["axRipple", "enabled"], axRippleColor: "axRippleColor" }, ngImport: i0 }); }
|
|
2134
2429
|
}
|
|
2135
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
2430
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.3", ngImport: i0, type: AXRippleDirective, decorators: [{
|
|
2136
2431
|
type: Directive,
|
|
2137
2432
|
args: [{
|
|
2138
2433
|
selector: '[axRipple]',
|
|
@@ -2148,5 +2443,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
|
|
|
2148
2443
|
* Generated bundle index. Do not edit.
|
|
2149
2444
|
*/
|
|
2150
2445
|
|
|
2151
|
-
export { AXAutoFocusDirective, AXAutocompleteParentComponent, AXButtonClickEvent, AXClearableComponent, AXClickEvent, AXClosableComponent, AXCommonModule, AXComponent, AXComponentCloseEvent, AXComponentClosedPromise, AXComponentClosing, AXComponentResult, AXDataSource, AXDomService, AXEvent, AXFocusEvent, AXFocusableComponent, AXHotkeyDirective, AXHotkeysService, AXHtmlEvent, AXInfiniteScrollerDirective, AXInvertedColorDirective, AXItemClickEvent, AXListDataSource, AXNgModelDelayedValueChangedDirective, AXOptionChangedEvent, AXPagedComponent, AXRangeChangedEvent, AXResponsiveDirective, AXRippleDirective, AXSearchableComponent, AXSelectionValueChangedEvent, AXValuableComponent, AXValueChangedEvent, AX_LOCATIONS, AX_PLACEMENT_BOTTOM, AX_PLACEMENT_BOTTOM_END, AX_PLACEMENT_BOTTOM_START, AX_PLACEMENT_END, AX_PLACEMENT_END_BOTTOM, AX_PLACEMENT_END_TOP, AX_PLACEMENT_MAP, AX_PLACEMENT_START, AX_PLACEMENT_START_BOTTOM, AX_PLACEMENT_START_TOP, AX_PLACEMENT_TOP, AX_PLACEMENT_TOP_END, AX_PLACEMENT_TOP_START, AX_SELECTION_DATA_TOKEN, AX_STYLE_COLOR_TYPES, AX_STYLE_LOOK_TYPES, MXBaseComponent, MXButtonBaseComponent, MXColorComponent, MXColorLookComponent, MXInputBaseValueComponent, MXInteractiveComponent, MXLookComponent, MXLookableComponent, MXSelectionBridgeService, MXSelectionValueComponent, MXValueComponent, NXButtonComponent, NXClickEvent, NXColorComponent, NXComponent, NXEvent, NXInteractiveComponent, NXLookComponent, NXNativeEvent, NXValueComponent, TAB_META_KEY, convertArrayToDataSource, convertToPlacement };
|
|
2446
|
+
export { AXAutoFocusDirective, AXAutocompleteParentComponent, AXButtonClickEvent, AXClearableComponent, AXClickEvent, AXClosableComponent, AXCommonModule, AXComponent, AXComponentCloseEvent, AXComponentClosedPromise, AXComponentClosing, AXComponentResult, AXDataSource, AXDomService, AXEvent, AXFocusEvent, AXFocusableComponent, AXHotkeyDirective, AXHotkeysService, AXHtmlEvent, AXInfiniteScrollerDirective, AXInvertedColorDirective, AXItemClickEvent, AXItemSelectedEvent, AXListDataSource, AXNgModelDelayedValueChangedDirective, AXOptionChangedEvent, AXPagedComponent, AXRangeChangedEvent, AXResponsiveDirective, AXRippleDirective, AXSearchableComponent, AXSelectionValueChangedEvent, AXValuableComponent, AXValueChangedEvent, AX_LOCATIONS, AX_PLACEMENT_BOTTOM, AX_PLACEMENT_BOTTOM_END, AX_PLACEMENT_BOTTOM_START, AX_PLACEMENT_END, AX_PLACEMENT_END_BOTTOM, AX_PLACEMENT_END_TOP, AX_PLACEMENT_MAP, AX_PLACEMENT_START, AX_PLACEMENT_START_BOTTOM, AX_PLACEMENT_START_TOP, AX_PLACEMENT_TOP, AX_PLACEMENT_TOP_END, AX_PLACEMENT_TOP_START, AX_SELECTION_DATA_TOKEN, AX_STYLE_COLOR_TYPES, AX_STYLE_LOOK_TYPES, MXBaseComponent, MXButtonBaseComponent, MXColorComponent, MXColorLookComponent, MXInputBaseValueComponent, MXInteractiveComponent, MXLookComponent, MXLookableComponent, MXSelectionBridgeService, MXSelectionValueComponent, MXValueComponent, NXButtonComponent, NXClickEvent, NXColorComponent, NXComponent, NXEvent, NXInteractiveComponent, NXLookComponent, NXNativeEvent, NXValueComponent, TAB_META_KEY, applyDataSourceQuery, convertArrayToDataSource, convertToPlacement };
|
|
2152
2447
|
//# sourceMappingURL=acorex-cdk-common.mjs.map
|