@wlcm/angular 19.2.5 → 22.0.1
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/README.md +37 -0
- package/button/fesm2022/wlcm-angular-button.mjs +25 -31
- package/button/fesm2022/wlcm-angular-button.mjs.map +1 -1
- package/button/package.json +25 -0
- package/button/types/wlcm-angular-button.d.ts +28 -0
- package/core/fesm2022/wlcm-angular-core.mjs +76 -92
- package/core/fesm2022/wlcm-angular-core.mjs.map +1 -1
- package/core/package.json +26 -0
- package/core/types/wlcm-angular-core.d.ts +102 -0
- package/datepicker/fesm2022/wlcm-angular-datepicker.mjs +341 -497
- package/datepicker/fesm2022/wlcm-angular-datepicker.mjs.map +1 -1
- package/datepicker/package.json +33 -0
- package/datepicker/types/wlcm-angular-datepicker.d.ts +285 -0
- package/filters/fesm2022/wlcm-angular-filters.mjs +32 -38
- package/filters/fesm2022/wlcm-angular-filters.mjs.map +1 -1
- package/filters/package.json +25 -0
- package/filters/types/wlcm-angular-filters.d.ts +81 -0
- package/forms/fesm2022/wlcm-angular-forms.mjs +378 -405
- package/forms/fesm2022/wlcm-angular-forms.mjs.map +1 -1
- package/forms/package.json +31 -0
- package/forms/types/wlcm-angular-forms.d.ts +365 -0
- package/package.json +27 -46
- package/phone-input/fesm2022/wlcm-angular-phone-input.mjs +66 -84
- package/phone-input/fesm2022/wlcm-angular-phone-input.mjs.map +1 -1
- package/phone-input/package.json +32 -0
- package/phone-input/types/wlcm-angular-phone-input.d.ts +81 -0
- package/search-field/fesm2022/wlcm-angular-search-field.mjs +25 -30
- package/search-field/fesm2022/wlcm-angular-search-field.mjs.map +1 -1
- package/search-field/package.json +28 -0
- package/search-field/types/wlcm-angular-search-field.d.ts +24 -0
- package/stepper/fesm2022/wlcm-angular-stepper.mjs +171 -294
- package/stepper/fesm2022/wlcm-angular-stepper.mjs.map +1 -1
- package/stepper/package.json +24 -0
- package/stepper/types/wlcm-angular-stepper.d.ts +114 -0
- package/styles/components/button/index.scss +25 -82
- package/styles/components/calendar/_calendar-header.scss +3 -6
- package/styles/components/calendar/_calendar.scss +10 -13
- package/styles/components/common/index.scss +4 -7
- package/styles/components/datepicker/_datepicker-input-container.scss +0 -3
- package/styles/components/datepicker/_datepicker-panel.scss +2 -5
- package/styles/components/datepicker/_datepicker-trigger.scss +0 -3
- package/styles/components/datepicker/date-range-picker/_date-range-picker-body.scss +10 -5
- package/styles/components/datepicker/date-range-picker/_date-range-picker-input.scss +4 -7
- package/styles/components/datepicker/date-range-picker/_date-range-picker-panel.scss +2 -5
- package/styles/components/forms/_autocomplete.scss +0 -3
- package/styles/components/forms/_checkbox-group.scss +0 -3
- package/styles/components/forms/_checkbox.scss +6 -8
- package/styles/components/forms/_error.scss +2 -13
- package/styles/components/forms/_form-field.scss +9 -10
- package/styles/components/forms/_label.scss +2 -11
- package/styles/components/forms/_radio.scss +13 -12
- package/styles/components/forms/_select.scss +5 -8
- package/styles/components/forms/partials/_dropdown-panel.scss +4 -6
- package/styles/components/loader/_loader.scss +5 -9
- package/styles/components/phone-input/_country-code-select.scss +0 -5
- package/styles/components/phone-input/_phone-input-container.scss +1 -6
- package/styles/components/search-field/index.scss +0 -4
- package/styles/components/stepper/_step-header.scss +8 -11
- package/styles/components/stepper/_step.scss +0 -5
- package/styles/components/stepper/_stepper-header.scss +0 -5
- package/styles/components/stepper/_stepper.scss +0 -4
- package/styles/components/table/_table-head-data.scss +6 -9
- package/styles/components/table/_table-head.scss +0 -5
- package/styles/components/table/_table-row-data.scss +2 -7
- package/styles/components/table/_table-row.scss +0 -5
- package/styles/components/table/_table.scss +0 -5
- package/styles/core/_all-theme.scss +8 -3
- package/styles/core/_tokens.scss +41 -0
- package/styles/core/_utils.scss +11 -44
- package/styles/wlcm.scss +1 -3
- package/table/fesm2022/wlcm-angular-table.mjs +130 -160
- package/table/fesm2022/wlcm-angular-table.mjs.map +1 -1
- package/table/package.json +27 -0
- package/table/types/wlcm-angular-table.d.ts +115 -0
- package/button/index.d.ts +0 -2
- package/button/lib/button.module.d.ts +0 -7
- package/button/lib/components/button/button.component.d.ts +0 -19
- package/button/lib/models/button.models.d.ts +0 -4
- package/core/index.d.ts +0 -11
- package/core/lib/components/default-loader/default-loader.component.d.ts +0 -5
- package/core/lib/components/icons/calendar-icon/calendar-icon.component.d.ts +0 -5
- package/core/lib/components/icons/chevron-down-icon/chevron-down-icon.component.d.ts +0 -5
- package/core/lib/components/icons/close-icon/close-icon.component.d.ts +0 -5
- package/core/lib/components/icons/search-icon/search-icon.component.d.ts +0 -5
- package/core/lib/components/loader/loader.component.d.ts +0 -11
- package/core/lib/constants/_index.d.ts +0 -2
- package/core/lib/constants/http.constants.d.ts +0 -2
- package/core/lib/constants/icon.contants.d.ts +0 -4
- package/core/lib/constants/loader.constants.d.ts +0 -2
- package/core/lib/directives/_index.d.ts +0 -1
- package/core/lib/directives/icon.directive.d.ts +0 -15
- package/core/lib/models/_index.d.ts +0 -2
- package/core/lib/models/icon.models.d.ts +0 -9
- package/core/lib/models/option.models.d.ts +0 -14
- package/core/lib/services/scroll-detection.api.d.ts +0 -10
- package/core/lib/utils/paginated-data-emulator.utils.d.ts +0 -9
- package/core/lib/utils/stream.utils.d.ts +0 -6
- package/datepicker/index.d.ts +0 -17
- package/datepicker/lib/components/calendar-header/calendar-header.component.d.ts +0 -24
- package/datepicker/lib/components/range/date-range-calendar-header/date-range-calendar-header.component.d.ts +0 -24
- package/datepicker/lib/components/range/date-range-picker-bottom-panel/date-range-picker-bottom-panel.component.d.ts +0 -8
- package/datepicker/lib/components/range/date-range-picker-input/date-range-picker-input.component.d.ts +0 -36
- package/datepicker/lib/components/range/double-calendar-range-picker/double-calendar-range-picker.component.d.ts +0 -35
- package/datepicker/lib/components/range/single-calendar-range-picker/single-calendar-range-picker.component.d.ts +0 -27
- package/datepicker/lib/components/single/datepicker-input-container/datepicker-input-container.component.d.ts +0 -30
- package/datepicker/lib/components/single/datepicker-panel/datepicker-panel.component.d.ts +0 -17
- package/datepicker/lib/constants/datepicker.constants.d.ts +0 -7
- package/datepicker/lib/constants/range/date-range-picker.constants.d.ts +0 -4
- package/datepicker/lib/constants/range/date-range-selection-model.constants.d.ts +0 -4
- package/datepicker/lib/constants/range/date-range-trigger-selection-model.constants.d.ts +0 -4
- package/datepicker/lib/datepicker.module.d.ts +0 -12
- package/datepicker/lib/directives/calendar.directive.d.ts +0 -5
- package/datepicker/lib/directives/datepicker-input.base.d.ts +0 -33
- package/datepicker/lib/directives/datepicker-trigger.base.d.ts +0 -33
- package/datepicker/lib/directives/ragne/date-range-picker-input-end.directive.d.ts +0 -20
- package/datepicker/lib/directives/ragne/date-range-picker-input-start.directive.d.ts +0 -20
- package/datepicker/lib/directives/ragne/date-range-picker-input.base.d.ts +0 -23
- package/datepicker/lib/directives/ragne/left-calendar.directive.d.ts +0 -17
- package/datepicker/lib/directives/ragne/right-calendar.directive.d.ts +0 -20
- package/datepicker/lib/directives/single/datepicker-input.directive.d.ts +0 -21
- package/datepicker/lib/models/date-picker.models.d.ts +0 -18
- package/datepicker/lib/models/range/data-range-calendar.models.d.ts +0 -25
- package/datepicker/lib/models/range/date-range-picker.models.d.ts +0 -18
- package/datepicker/lib/models/range/date-range-validation.models.d.ts +0 -3
- package/datepicker/lib/utils/range/date-range-input.validators.d.ts +0 -2
- package/datepicker/lib/utils/range/date-range-picker-errors.d.ts +0 -4
- package/filters/index.d.ts +0 -5
- package/filters/lib/components/filters-group/filters-group.component.d.ts +0 -6
- package/filters/lib/constants/filter.constants.d.ts +0 -3
- package/filters/lib/constants/index.d.ts +0 -1
- package/filters/lib/directives/filter.directive.d.ts +0 -5
- package/filters/lib/directives/index.d.ts +0 -1
- package/filters/lib/filters.module.d.ts +0 -9
- package/filters/lib/models/array-filter.models.d.ts +0 -19
- package/filters/lib/models/filter.models.d.ts +0 -19
- package/filters/lib/models/filters-group.models.d.ts +0 -22
- package/filters/lib/models/index.d.ts +0 -3
- package/forms/index.d.ts +0 -12
- package/forms/lib/forms/components/autocomplete/autocomplete.component.d.ts +0 -76
- package/forms/lib/forms/components/checkbox/checkbox.component.d.ts +0 -28
- package/forms/lib/forms/components/checkbox-group/checkbox-group.component.d.ts +0 -25
- package/forms/lib/forms/components/error/error.component.d.ts +0 -5
- package/forms/lib/forms/components/form-field/form-field.component.d.ts +0 -34
- package/forms/lib/forms/components/index.d.ts +0 -8
- package/forms/lib/forms/components/label/label.component.d.ts +0 -7
- package/forms/lib/forms/components/partials/autocomplete-suffix/autocomplete-suffix.component.d.ts +0 -10
- package/forms/lib/forms/components/partials/index.d.ts +0 -1
- package/forms/lib/forms/components/select/select.component.d.ts +0 -90
- package/forms/lib/forms/constants/form-elements.constants.d.ts +0 -6
- package/forms/lib/forms/constants/form-errors.constants.d.ts +0 -4
- package/forms/lib/forms/constants/form-field.constants.d.ts +0 -1
- package/forms/lib/forms/constants/form-state-handlers.constants.d.ts +0 -6
- package/forms/lib/forms/constants/index.d.ts +0 -5
- package/forms/lib/forms/constants/select.constants.d.ts +0 -3
- package/forms/lib/forms/directives/autocomplete.directive.d.ts +0 -16
- package/forms/lib/forms/directives/form-field-custom-container.directive.d.ts +0 -8
- package/forms/lib/forms/directives/form-field-hint.directive.d.ts +0 -5
- package/forms/lib/forms/directives/form-field-prefix.directive.d.ts +0 -6
- package/forms/lib/forms/directives/form-field-suffix.directive.d.ts +0 -5
- package/forms/lib/forms/directives/input.directive.d.ts +0 -14
- package/forms/lib/forms/directives/select-input-binder.directive.d.ts +0 -5
- package/forms/lib/forms/forms.module.d.ts +0 -19
- package/forms/lib/forms/models/_index.d.ts +0 -5
- package/forms/lib/forms/models/autocomplete.models.d.ts +0 -9
- package/forms/lib/forms/models/form-errors.models.d.ts +0 -5
- package/forms/lib/forms/models/form.models.d.ts +0 -11
- package/forms/lib/forms/models/input.models.d.ts +0 -13
- package/forms/lib/forms/models/select.models.d.ts +0 -9
- package/forms/lib/forms/pipes/errors-mapper.pipe.d.ts +0 -17
- package/forms/lib/forms/services/form-state-handler.service.d.ts +0 -10
- package/forms/lib/forms/services/index.d.ts +0 -2
- package/forms/lib/forms/services/places.api.d.ts +0 -11
- package/phone-input/index.d.ts +0 -4
- package/phone-input/lib/components/country-code-select/country-code-select.component.d.ts +0 -15
- package/phone-input/lib/components/phone-input-container/phone-input-container.component.d.ts +0 -30
- package/phone-input/lib/constants/country-code-options.constants.d.ts +0 -3
- package/phone-input/lib/constants/phone-adapter.constants.d.ts +0 -3
- package/phone-input/lib/directives/phone-input.directive.d.ts +0 -36
- package/phone-input/lib/models/country-code.models.d.ts +0 -7
- package/phone-input/lib/models/phone-adapter.models.d.ts +0 -10
- package/phone-input/lib/models/phone.models.d.ts +0 -3
- package/phone-input/lib/phone-input.module.d.ts +0 -9
- package/phone-input/lib/pipes/phone-code.pipe.d.ts +0 -8
- package/search-field/index.d.ts +0 -2
- package/search-field/lib/components/search-field/search-field.component.d.ts +0 -16
- package/search-field/lib/search-field.module.d.ts +0 -8
- package/stepper/index.d.ts +0 -10
- package/stepper/lib/components/step/step.component.d.ts +0 -16
- package/stepper/lib/components/step-header/step-header.component.d.ts +0 -20
- package/stepper/lib/components/stepper/stepper.component.d.ts +0 -6
- package/stepper/lib/components/stepper-header/stepper-header.component.d.ts +0 -8
- package/stepper/lib/constants/step.constants.d.ts +0 -4
- package/stepper/lib/constants/stepper.stepper.d.ts +0 -3
- package/stepper/lib/directives/load-on-active-step.directive.d.ts +0 -13
- package/stepper/lib/models/step.models.d.ts +0 -43
- package/stepper/lib/models/stepper.models.d.ts +0 -44
- package/stepper/lib/stepper.module.d.ts +0 -12
- package/styles/core/_core.scss +0 -10
- package/table/index.d.ts +0 -9
- package/table/lib/components/table/table.component.d.ts +0 -24
- package/table/lib/components/table-head/table-head.component.d.ts +0 -8
- package/table/lib/components/table-head-actions/table-head-actions.component.d.ts +0 -12
- package/table/lib/components/table-head-data/table-head-data.component.d.ts +0 -5
- package/table/lib/components/table-row/table-row.component.d.ts +0 -23
- package/table/lib/components/table-row-actions/table-row-actions.component.d.ts +0 -5
- package/table/lib/components/table-row-data/table-row-data.component.d.ts +0 -5
- package/table/lib/components/table-row-spacer/table-row-spacer.component.d.ts +0 -5
- package/table/lib/constants/table-row.constants.d.ts +0 -3
- package/table/lib/constants/table.constants.d.ts +0 -3
- package/table/lib/directives/scrollable-table-container.directive.d.ts +0 -13
- package/table/lib/models/table-config-manager.models.d.ts +0 -12
- package/table/lib/models/table-row.models.d.ts +0 -10
- package/table/lib/models/table-selection-model.d.ts +0 -25
- package/table/lib/models/table.models.d.ts +0 -4
- package/table/lib/pipes/table-row-injector.pipe.d.ts +0 -9
- package/table/lib/table.module.d.ts +0 -13
- package/table/lib/utils/table-errors.utils.d.ts +0 -3
|
@@ -1,33 +1,28 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import * as
|
|
5
|
-
import {
|
|
6
|
-
import * as i1 from '@angular/common';
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Injectable, InjectionToken, inject, ElementRef, Directive, ChangeDetectorRef, Pipe, HostListener, input, contentChild, viewChild, DestroyRef, forwardRef, output, linkedSignal, signal, Injector, runInInjectionContext, contentChildren, computed, effect, viewChildren, NgModule } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed, toObservable, outputToObservable } from '@angular/core/rxjs-interop';
|
|
4
|
+
import * as i3 from '@angular/forms';
|
|
5
|
+
import { NgControl, ControlContainer, Validators, FormControl, ReactiveFormsModule, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
8
6
|
import { Subject, Observable, takeUntil, merge, fromEvent, observeOn, asyncScheduler, BehaviorSubject, EMPTY, switchMap, first, take, tap, concatMap, map, filter, timer, of } from 'rxjs';
|
|
9
|
-
import * as i1$3 from '@wlcm/angular/core';
|
|
10
7
|
import { WlcmAutocompleteOption, DEFAULT_QUERY_PARAMS, WlcmIconName, WlcmIconDirective, WlcmLoaderComponent, ScrollDetectionApi } from '@wlcm/angular/core';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
8
|
+
import * as i1 from '@angular/common';
|
|
9
|
+
import { CommonModule } from '@angular/common';
|
|
10
|
+
import * as i3$1 from '@angular/material/select';
|
|
11
|
+
import { MatSelect, MatOption, MatSelectModule, MAT_SELECT_CONFIG } from '@angular/material/select';
|
|
12
|
+
import * as i2 from '@angular/material/autocomplete';
|
|
13
|
+
import { MatAutocomplete, MatAutocompleteTrigger, MatAutocompleteOrigin, MatAutocompleteModule, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS } from '@angular/material/autocomplete';
|
|
17
14
|
import { cloneDeep, mergeWith } from 'lodash-es';
|
|
18
|
-
import * as
|
|
19
|
-
import * as i1$2 from '@angular/material/checkbox';
|
|
15
|
+
import * as i1$1 from '@angular/material/checkbox';
|
|
20
16
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
21
|
-
import { toObservable } from '@angular/core/rxjs-interop';
|
|
22
17
|
import { MatRadioModule, MAT_RADIO_DEFAULT_OPTIONS } from '@angular/material/radio';
|
|
23
18
|
|
|
24
19
|
class WlcmErrorComponent {
|
|
25
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
26
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
20
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
21
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.5", type: WlcmErrorComponent, isStandalone: true, selector: "wlcm-error", host: { classAttribute: "wlcm-error" }, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
27
22
|
}
|
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmErrorComponent, decorators: [{
|
|
29
24
|
type: Component,
|
|
30
|
-
args: [{ selector: 'wlcm-error',
|
|
25
|
+
args: [{ selector: 'wlcm-error', imports: [], host: { class: 'wlcm-error' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n" }]
|
|
31
26
|
}] });
|
|
32
27
|
|
|
33
28
|
class FormStateHandlerService {
|
|
@@ -38,10 +33,10 @@ class FormStateHandlerService {
|
|
|
38
33
|
updateFormState() {
|
|
39
34
|
this._stateChanges$.next();
|
|
40
35
|
}
|
|
41
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
42
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
36
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormStateHandlerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
37
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormStateHandlerService, providedIn: 'root' }); }
|
|
43
38
|
}
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormStateHandlerService, decorators: [{
|
|
45
40
|
type: Injectable,
|
|
46
41
|
args: [{ providedIn: 'root' }]
|
|
47
42
|
}] });
|
|
@@ -99,17 +94,17 @@ class WlcmDefaultPlacesApi {
|
|
|
99
94
|
get autocompleteService() {
|
|
100
95
|
return this._autocompleteService;
|
|
101
96
|
}
|
|
102
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
103
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
97
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmDefaultPlacesApi, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
98
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmDefaultPlacesApi }); }
|
|
104
99
|
}
|
|
105
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmDefaultPlacesApi, decorators: [{
|
|
106
101
|
type: Injectable
|
|
107
102
|
}], ctorParameters: () => [] });
|
|
108
103
|
class WlcmPlacesApi {
|
|
109
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
110
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
104
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmPlacesApi, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
105
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmPlacesApi, providedIn: 'root', useClass: WlcmDefaultPlacesApi }); }
|
|
111
106
|
}
|
|
112
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmPlacesApi, decorators: [{
|
|
113
108
|
type: Injectable,
|
|
114
109
|
args: [{
|
|
115
110
|
providedIn: 'root',
|
|
@@ -129,25 +124,24 @@ const WLCM_FORM_CONTROL_PROVIDER = {
|
|
|
129
124
|
};
|
|
130
125
|
|
|
131
126
|
class WlcmFormFieldCustomContainerDirective {
|
|
132
|
-
constructor(
|
|
133
|
-
this.elementRef =
|
|
127
|
+
constructor() {
|
|
128
|
+
this.elementRef = inject((ElementRef));
|
|
134
129
|
}
|
|
135
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
136
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
130
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldCustomContainerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
131
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: WlcmFormFieldCustomContainerDirective, isStandalone: true, selector: "[wlcmFormFieldCustomContainer]", ngImport: i0 }); }
|
|
137
132
|
}
|
|
138
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldCustomContainerDirective, decorators: [{
|
|
139
134
|
type: Directive,
|
|
140
135
|
args: [{
|
|
141
136
|
selector: '[wlcmFormFieldCustomContainer]',
|
|
142
|
-
standalone: true,
|
|
143
137
|
}]
|
|
144
|
-
}]
|
|
138
|
+
}] });
|
|
145
139
|
|
|
146
140
|
class ErrorsMapperPipe {
|
|
147
|
-
constructor(
|
|
148
|
-
this.changeDetectorRef =
|
|
149
|
-
this.errors =
|
|
150
|
-
this.priorityErrors =
|
|
141
|
+
constructor() {
|
|
142
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
143
|
+
this.errors = inject(WLCM_ERRORS);
|
|
144
|
+
this.priorityErrors = inject(WLCM_PRIORITY_ERRORS);
|
|
151
145
|
this.destroy$ = new Subject();
|
|
152
146
|
this.currentError = null;
|
|
153
147
|
}
|
|
@@ -174,23 +168,16 @@ class ErrorsMapperPipe {
|
|
|
174
168
|
this.changeDetectorRef.markForCheck();
|
|
175
169
|
});
|
|
176
170
|
}
|
|
177
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
178
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
171
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ErrorsMapperPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
172
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.5", ngImport: i0, type: ErrorsMapperPipe, isStandalone: true, name: "errorsMapper", pure: false }); }
|
|
179
173
|
}
|
|
180
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ErrorsMapperPipe, decorators: [{
|
|
181
175
|
type: Pipe,
|
|
182
176
|
args: [{
|
|
183
177
|
name: 'errorsMapper',
|
|
184
|
-
standalone: true,
|
|
185
178
|
pure: false,
|
|
186
179
|
}]
|
|
187
|
-
}]
|
|
188
|
-
type: Inject,
|
|
189
|
-
args: [WLCM_ERRORS]
|
|
190
|
-
}] }, { type: Set, decorators: [{
|
|
191
|
-
type: Inject,
|
|
192
|
-
args: [WLCM_PRIORITY_ERRORS]
|
|
193
|
-
}] }] });
|
|
180
|
+
}] });
|
|
194
181
|
|
|
195
182
|
class WlcmFormFieldPrefixDirective {
|
|
196
183
|
constructor() {
|
|
@@ -198,14 +185,13 @@ class WlcmFormFieldPrefixDirective {
|
|
|
198
185
|
event.stopPropagation();
|
|
199
186
|
};
|
|
200
187
|
}
|
|
201
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
202
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
188
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldPrefixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
189
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: WlcmFormFieldPrefixDirective, isStandalone: true, selector: "[wlcmFormFieldPrefix]", host: { listeners: { "click": "handlerClick($event)" } }, ngImport: i0 }); }
|
|
203
190
|
}
|
|
204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldPrefixDirective, decorators: [{
|
|
205
192
|
type: Directive,
|
|
206
193
|
args: [{
|
|
207
194
|
selector: '[wlcmFormFieldPrefix]',
|
|
208
|
-
standalone: true,
|
|
209
195
|
}]
|
|
210
196
|
}], propDecorators: { handlerClick: [{
|
|
211
197
|
type: HostListener,
|
|
@@ -213,18 +199,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
213
199
|
}] } });
|
|
214
200
|
|
|
215
201
|
class WlcmFormFieldSuffixDirective {
|
|
216
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
217
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
202
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldSuffixDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
203
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: WlcmFormFieldSuffixDirective, isStandalone: true, selector: "[wlcmFormFieldSuffix]", ngImport: i0 }); }
|
|
218
204
|
}
|
|
219
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldSuffixDirective, decorators: [{
|
|
220
206
|
type: Directive,
|
|
221
207
|
args: [{
|
|
222
208
|
selector: '[wlcmFormFieldSuffix]',
|
|
223
|
-
standalone: true,
|
|
224
209
|
}]
|
|
225
210
|
}] });
|
|
226
211
|
|
|
227
|
-
|
|
212
|
+
class WlcmFormFieldComponent {
|
|
213
|
+
constructor() {
|
|
214
|
+
this.displayErrorMessages = input(true, /* @ts-ignore */
|
|
215
|
+
...(ngDevMode ? [{ debugName: "displayErrorMessages" }] : /* istanbul ignore next */ []));
|
|
216
|
+
this.ngControl = contentChild(NgControl, { ...(ngDevMode ? { debugName: "ngControl" } : /* istanbul ignore next */ {}), descendants: true });
|
|
217
|
+
this.controlContainer = contentChild(ControlContainer, { ...(ngDevMode ? { debugName: "controlContainer" } : /* istanbul ignore next */ {}), descendants: true });
|
|
218
|
+
this._inputRef = contentChild(WLCM_INPUT, /* @ts-ignore */
|
|
219
|
+
...(ngDevMode ? [{ debugName: "_inputRef" }] : /* istanbul ignore next */ []));
|
|
220
|
+
this.prefix = contentChild(WlcmFormFieldPrefixDirective, /* @ts-ignore */
|
|
221
|
+
...(ngDevMode ? [{ debugName: "prefix" }] : /* istanbul ignore next */ []));
|
|
222
|
+
this.suffix = contentChild(WlcmFormFieldSuffixDirective, /* @ts-ignore */
|
|
223
|
+
...(ngDevMode ? [{ debugName: "suffix" }] : /* istanbul ignore next */ []));
|
|
224
|
+
this.customContainer = contentChild(WlcmFormFieldCustomContainerDirective, /* @ts-ignore */
|
|
225
|
+
...(ngDevMode ? [{ debugName: "customContainer" }] : /* istanbul ignore next */ []));
|
|
226
|
+
this.defaultContainer = viewChild('defaultContainer', /* @ts-ignore */
|
|
227
|
+
...(ngDevMode ? [{ debugName: "defaultContainer" }] : /* istanbul ignore next */ []));
|
|
228
|
+
this.parentFormMember = inject(WLCM_FORM_CONTROL, { optional: true });
|
|
229
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
230
|
+
this.destroyRef = inject(DestroyRef);
|
|
231
|
+
}
|
|
228
232
|
get isFocused() {
|
|
229
233
|
return this.inputRef?.isFocused() ?? false;
|
|
230
234
|
}
|
|
@@ -240,13 +244,8 @@ let WlcmFormFieldComponent = class WlcmFormFieldComponent {
|
|
|
240
244
|
get isDisabled() {
|
|
241
245
|
return this.control?.disabled;
|
|
242
246
|
}
|
|
243
|
-
constructor(parentFormMember, changeDetectorRef) {
|
|
244
|
-
this.parentFormMember = parentFormMember;
|
|
245
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
246
|
-
this.displayErrorMessages = true;
|
|
247
|
-
}
|
|
248
247
|
ngAfterViewInit() {
|
|
249
|
-
if (!this.inputRef && !this.customContainer) {
|
|
248
|
+
if (!this.inputRef && !this.customContainer()) {
|
|
250
249
|
throw new Error('Input element should be bound to the wlcmInput directive.');
|
|
251
250
|
}
|
|
252
251
|
this.handleStateChanges();
|
|
@@ -257,10 +256,10 @@ let WlcmFormFieldComponent = class WlcmFormFieldComponent {
|
|
|
257
256
|
this.inputRef?.focus();
|
|
258
257
|
}
|
|
259
258
|
get control() {
|
|
260
|
-
return (this.controlContainer?.control || this.ngControl?.control) ?? null;
|
|
259
|
+
return (this.controlContainer()?.control || this.ngControl()?.control) ?? null;
|
|
261
260
|
}
|
|
262
261
|
get inputContainer() {
|
|
263
|
-
return this.customContainer?.elementRef || this.defaultContainer;
|
|
262
|
+
return this.customContainer()?.elementRef || this.defaultContainer();
|
|
264
263
|
}
|
|
265
264
|
handleStateChanges() {
|
|
266
265
|
const events = this.controlEvents;
|
|
@@ -268,11 +267,11 @@ let WlcmFormFieldComponent = class WlcmFormFieldComponent {
|
|
|
268
267
|
events.push(this.parentFormMember.stateChanges$);
|
|
269
268
|
}
|
|
270
269
|
merge(...events)
|
|
271
|
-
.pipe(
|
|
270
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
272
271
|
.subscribe(() => this.changeDetectorRef.markForCheck());
|
|
273
272
|
}
|
|
274
273
|
get inputRef() {
|
|
275
|
-
return this._inputRef?.get();
|
|
274
|
+
return this._inputRef()?.get();
|
|
276
275
|
}
|
|
277
276
|
get controlEvents() {
|
|
278
277
|
const events = [];
|
|
@@ -280,87 +279,50 @@ let WlcmFormFieldComponent = class WlcmFormFieldComponent {
|
|
|
280
279
|
events.push(this.inputRef.focus$, this.inputRef.blur$);
|
|
281
280
|
}
|
|
282
281
|
if (this.control) {
|
|
283
|
-
|
|
282
|
+
// control.events fires on status, value, touched and pristine changes —
|
|
283
|
+
// statusChanges alone never emits on touched changes, so the
|
|
284
|
+
// wlcm-field-touched host class would go stale under OnPush.
|
|
285
|
+
events.push(this.control.events);
|
|
284
286
|
}
|
|
285
287
|
return events;
|
|
286
288
|
}
|
|
287
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
288
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
289
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
290
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: WlcmFormFieldComponent, isStandalone: true, selector: "wlcm-form-field", inputs: { displayErrorMessages: { classPropertyName: "displayErrorMessages", publicName: "displayErrorMessages", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.wlcm-field-focused": "isFocused", "class.wlcm-field-required": "isRequired", "class.wlcm-field-invalid": "isInvalid", "class.wlcm-field-touched": "isTouched", "class.wlcm-field-disabled": "isDisabled" }, classAttribute: "wlcm-form-field" }, providers: [
|
|
289
291
|
WLCM_FORM_CONTROL_PROVIDER,
|
|
290
292
|
{ provide: WLCM_FORM_FIELD, useExisting: forwardRef(() => WlcmFormFieldComponent) },
|
|
291
|
-
], queries: [{ propertyName: "ngControl", first: true, predicate: NgControl, descendants: true }, { propertyName: "controlContainer", first: true, predicate: ControlContainer, descendants: true }, { propertyName: "_inputRef", first: true, predicate: WLCM_INPUT, descendants: true }, { propertyName: "prefix", first: true, predicate: WlcmFormFieldPrefixDirective, descendants: true }, { propertyName: "suffix", first: true, predicate: WlcmFormFieldSuffixDirective, descendants: true }, { propertyName: "customContainer", first: true, predicate: WlcmFormFieldCustomContainerDirective, descendants: true }], viewQueries: [{ propertyName: "defaultContainer", first: true, predicate: ["defaultContainer"], descendants: true }], ngImport: i0, template: "<ng-content select=\"wlcm-label\"></ng-content>\n\n<ng-content select=\"[wlcmFormFieldCustomContainer]\"></ng-content>\n\n<div\n
|
|
292
|
-
}
|
|
293
|
-
WlcmFormFieldComponent
|
|
294
|
-
UntilDestroy(),
|
|
295
|
-
__metadata("design:paramtypes", [Object, ChangeDetectorRef])
|
|
296
|
-
], WlcmFormFieldComponent);
|
|
297
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmFormFieldComponent, decorators: [{
|
|
293
|
+
], queries: [{ propertyName: "ngControl", first: true, predicate: NgControl, descendants: true, isSignal: true }, { propertyName: "controlContainer", first: true, predicate: ControlContainer, descendants: true, isSignal: true }, { propertyName: "_inputRef", first: true, predicate: WLCM_INPUT, descendants: true, isSignal: true }, { propertyName: "prefix", first: true, predicate: WlcmFormFieldPrefixDirective, descendants: true, isSignal: true }, { propertyName: "suffix", first: true, predicate: WlcmFormFieldSuffixDirective, descendants: true, isSignal: true }, { propertyName: "customContainer", first: true, predicate: WlcmFormFieldCustomContainerDirective, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "defaultContainer", first: true, predicate: ["defaultContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<ng-content select=\"wlcm-label\"></ng-content>\n\n<ng-content select=\"[wlcmFormFieldCustomContainer]\"></ng-content>\n\n@if (!customContainer()) {\n <div\n class=\"wlcm-field-container\"\n (click)=\"focus()\"\n #defaultContainer\n >\n <div class=\"wlcm-field-prefix\" [class.contains-children]=\"prefix()\">\n <ng-content select=\"[wlcmFormFieldPrefix]\"></ng-content>\n </div>\n <ng-content select=\"[wlcmInput]\"></ng-content>\n <div class=\"wlcm-field-suffix\" [class.contains-children]=\"suffix()\">\n <ng-content select=\"[wlcmFormFieldSuffix]\"></ng-content>\n </div>\n </div>\n}\n\n<ng-content select=\"[wlcmFormFieldHint]\"></ng-content>\n\n@if (control && displayErrorMessages()) {\n <div class=\"wlcm-field-error-container\">\n <wlcm-error>{{ $any(control) | errorsMapper }}</wlcm-error>\n </div>\n}\n", styles: [""], dependencies: [{ kind: "component", type: WlcmErrorComponent, selector: "wlcm-error" }, { kind: "pipe", type: ErrorsMapperPipe, name: "errorsMapper" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
294
|
+
}
|
|
295
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldComponent, decorators: [{
|
|
298
296
|
type: Component,
|
|
299
|
-
args: [{ selector: 'wlcm-form-field',
|
|
297
|
+
args: [{ selector: 'wlcm-form-field', imports: [WlcmErrorComponent, ErrorsMapperPipe], host: {
|
|
298
|
+
class: 'wlcm-form-field',
|
|
299
|
+
'[class.wlcm-field-focused]': 'isFocused',
|
|
300
|
+
'[class.wlcm-field-required]': 'isRequired',
|
|
301
|
+
'[class.wlcm-field-invalid]': 'isInvalid',
|
|
302
|
+
'[class.wlcm-field-touched]': 'isTouched',
|
|
303
|
+
'[class.wlcm-field-disabled]': 'isDisabled',
|
|
304
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
300
305
|
WLCM_FORM_CONTROL_PROVIDER,
|
|
301
306
|
{ provide: WLCM_FORM_FIELD, useExisting: forwardRef(() => WlcmFormFieldComponent) },
|
|
302
|
-
], template: "<ng-content select=\"wlcm-label\"></ng-content>\n\n<ng-content select=\"[wlcmFormFieldCustomContainer]\"></ng-content>\n\n<div\n
|
|
303
|
-
}],
|
|
304
|
-
type: Optional
|
|
305
|
-
}, {
|
|
306
|
-
type: Inject,
|
|
307
|
-
args: [WLCM_FORM_CONTROL]
|
|
308
|
-
}] }, { type: i0.ChangeDetectorRef }], propDecorators: { displayErrorMessages: [{
|
|
309
|
-
type: Input
|
|
310
|
-
}], ngControl: [{
|
|
311
|
-
type: ContentChild,
|
|
312
|
-
args: [NgControl, { descendants: true }]
|
|
313
|
-
}], controlContainer: [{
|
|
314
|
-
type: ContentChild,
|
|
315
|
-
args: [ControlContainer, { descendants: true }]
|
|
316
|
-
}], _inputRef: [{
|
|
317
|
-
type: ContentChild,
|
|
318
|
-
args: [WLCM_INPUT]
|
|
319
|
-
}], prefix: [{
|
|
320
|
-
type: ContentChild,
|
|
321
|
-
args: [WlcmFormFieldPrefixDirective]
|
|
322
|
-
}], suffix: [{
|
|
323
|
-
type: ContentChild,
|
|
324
|
-
args: [WlcmFormFieldSuffixDirective]
|
|
325
|
-
}], customContainer: [{
|
|
326
|
-
type: ContentChild,
|
|
327
|
-
args: [WlcmFormFieldCustomContainerDirective]
|
|
328
|
-
}], defaultContainer: [{
|
|
329
|
-
type: ViewChild,
|
|
330
|
-
args: ['defaultContainer']
|
|
331
|
-
}], isFocused: [{
|
|
332
|
-
type: HostBinding,
|
|
333
|
-
args: ['class.wlcm-field-focused']
|
|
334
|
-
}], isRequired: [{
|
|
335
|
-
type: HostBinding,
|
|
336
|
-
args: ['class.wlcm-field-required']
|
|
337
|
-
}], isInvalid: [{
|
|
338
|
-
type: HostBinding,
|
|
339
|
-
args: ['class.wlcm-field-invalid']
|
|
340
|
-
}], isTouched: [{
|
|
341
|
-
type: HostBinding,
|
|
342
|
-
args: ['class.wlcm-field-touched']
|
|
343
|
-
}], isDisabled: [{
|
|
344
|
-
type: HostBinding,
|
|
345
|
-
args: ['class.wlcm-field-disabled']
|
|
346
|
-
}] } });
|
|
307
|
+
], template: "<ng-content select=\"wlcm-label\"></ng-content>\n\n<ng-content select=\"[wlcmFormFieldCustomContainer]\"></ng-content>\n\n@if (!customContainer()) {\n <div\n class=\"wlcm-field-container\"\n (click)=\"focus()\"\n #defaultContainer\n >\n <div class=\"wlcm-field-prefix\" [class.contains-children]=\"prefix()\">\n <ng-content select=\"[wlcmFormFieldPrefix]\"></ng-content>\n </div>\n <ng-content select=\"[wlcmInput]\"></ng-content>\n <div class=\"wlcm-field-suffix\" [class.contains-children]=\"suffix()\">\n <ng-content select=\"[wlcmFormFieldSuffix]\"></ng-content>\n </div>\n </div>\n}\n\n<ng-content select=\"[wlcmFormFieldHint]\"></ng-content>\n\n@if (control && displayErrorMessages()) {\n <div class=\"wlcm-field-error-container\">\n <wlcm-error>{{ $any(control) | errorsMapper }}</wlcm-error>\n </div>\n}\n" }]
|
|
308
|
+
}], propDecorators: { displayErrorMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayErrorMessages", required: false }] }], ngControl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => NgControl), { ...{ descendants: true }, isSignal: true }] }], controlContainer: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ControlContainer), { ...{ descendants: true }, isSignal: true }] }], _inputRef: [{ type: i0.ContentChild, args: [i0.forwardRef(() => WLCM_INPUT), { isSignal: true }] }], prefix: [{ type: i0.ContentChild, args: [i0.forwardRef(() => WlcmFormFieldPrefixDirective), { isSignal: true }] }], suffix: [{ type: i0.ContentChild, args: [i0.forwardRef(() => WlcmFormFieldSuffixDirective), { isSignal: true }] }], customContainer: [{ type: i0.ContentChild, args: [i0.forwardRef(() => WlcmFormFieldCustomContainerDirective), { isSignal: true }] }], defaultContainer: [{ type: i0.ViewChild, args: ['defaultContainer', { isSignal: true }] }] } });
|
|
347
309
|
|
|
348
310
|
const WLCM_FORM_FIELD_INPUT_CLASS = 'wlcm-form-field-input';
|
|
349
311
|
|
|
350
312
|
class WlcmInputDirective {
|
|
351
|
-
constructor(
|
|
352
|
-
this._elementRef =
|
|
313
|
+
constructor() {
|
|
314
|
+
this._elementRef = inject((ElementRef));
|
|
353
315
|
this.focus = () => this._elementRef.nativeElement.focus();
|
|
354
316
|
this.isFocused = () => this._elementRef.nativeElement === document.activeElement;
|
|
355
317
|
this.focus$ = fromEvent(this._elementRef.nativeElement, 'focus');
|
|
356
318
|
this.blur$ = fromEvent(this._elementRef.nativeElement, 'blur');
|
|
357
|
-
const element = _elementRef.nativeElement;
|
|
319
|
+
const element = this._elementRef.nativeElement;
|
|
358
320
|
if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
|
|
359
321
|
element.classList.add(WLCM_FORM_FIELD_INPUT_CLASS);
|
|
360
322
|
}
|
|
361
323
|
}
|
|
362
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
363
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
324
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
325
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: WlcmInputDirective, isStandalone: true, selector: "[wlcmInput]", providers: [
|
|
364
326
|
{
|
|
365
327
|
provide: WLCM_INPUT,
|
|
366
328
|
useFactory: () => {
|
|
@@ -371,7 +333,7 @@ class WlcmInputDirective {
|
|
|
371
333
|
},
|
|
372
334
|
], ngImport: i0 }); }
|
|
373
335
|
}
|
|
374
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmInputDirective, decorators: [{
|
|
375
337
|
type: Directive,
|
|
376
338
|
args: [{
|
|
377
339
|
selector: '[wlcmInput]',
|
|
@@ -385,56 +347,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
385
347
|
},
|
|
386
348
|
},
|
|
387
349
|
],
|
|
388
|
-
standalone: true,
|
|
389
350
|
}]
|
|
390
|
-
}], ctorParameters: () => [
|
|
351
|
+
}], ctorParameters: () => [] });
|
|
391
352
|
|
|
392
353
|
class WlcmLabelComponent {
|
|
393
354
|
constructor() {
|
|
394
|
-
this.required = false
|
|
355
|
+
this.required = input(false, /* @ts-ignore */
|
|
356
|
+
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
395
357
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}
|
|
399
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
400
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: WlcmLabelComponent, isStandalone: true, selector: "wlcm-label", inputs: { required: "required" }, host: { properties: { "class.required": "this.isRequired" }, classAttribute: "wlcm-label" }, ngImport: i0, template: "<span class=\"wlcm-label-asterisk\">*</span>\n\n<ng-content></ng-content>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
358
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
359
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: WlcmLabelComponent, isStandalone: true, selector: "wlcm-label", inputs: { required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.required": "required()" }, classAttribute: "wlcm-label" }, ngImport: i0, template: "<span class=\"wlcm-label-asterisk\">*</span>\n\n<ng-content></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
401
360
|
}
|
|
402
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmLabelComponent, decorators: [{
|
|
403
362
|
type: Component,
|
|
404
|
-
args: [{ selector: 'wlcm-label',
|
|
405
|
-
}], propDecorators: { required: [{
|
|
406
|
-
type: Input
|
|
407
|
-
}], isRequired: [{
|
|
408
|
-
type: HostBinding,
|
|
409
|
-
args: ['class.required']
|
|
410
|
-
}] } });
|
|
363
|
+
args: [{ selector: 'wlcm-label', imports: [], host: { class: 'wlcm-label', '[class.required]': 'required()' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"wlcm-label-asterisk\">*</span>\n\n<ng-content></ng-content>\n" }]
|
|
364
|
+
}], propDecorators: { required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }] } });
|
|
411
365
|
|
|
412
|
-
|
|
413
|
-
constructor(
|
|
414
|
-
this.
|
|
415
|
-
this.autocomplete = autocomplete;
|
|
416
|
-
this.panelScrolled = new EventEmitter();
|
|
366
|
+
class AutocompleteDirective {
|
|
367
|
+
constructor() {
|
|
368
|
+
this.panelScrolled = output();
|
|
417
369
|
this._scrollHeight = 0;
|
|
418
370
|
this._scrollHeightChanged = false;
|
|
371
|
+
this.autocomplete = inject(MatAutocomplete, { host: true, optional: true });
|
|
372
|
+
this.destroyRef = inject(DestroyRef);
|
|
419
373
|
this.handleOpenEvent();
|
|
420
374
|
}
|
|
421
375
|
handleOpenEvent() {
|
|
422
376
|
this.autocomplete.opened
|
|
423
|
-
.pipe(
|
|
424
|
-
.
|
|
425
|
-
.subscribe(() => this.zone.runOutsideAngular(() => this.handleScrolling()));
|
|
377
|
+
.pipe(observeOn(asyncScheduler), takeUntilDestroyed(this.destroyRef))
|
|
378
|
+
.subscribe(() => this.handleScrolling());
|
|
426
379
|
}
|
|
427
380
|
handleScrolling() {
|
|
428
381
|
const panel = this.autocomplete.panel.nativeElement;
|
|
429
382
|
this.setScrollHscrollHeight(panel.scrollHeight);
|
|
430
|
-
|
|
383
|
+
// Zone-free: the scroll listener no longer runs outside/inside NgZone.
|
|
384
|
+
// Under zoneless CD the panelScrolled output drives change detection on
|
|
385
|
+
// its own, so no zone.run wrapper is needed.
|
|
386
|
+
fromEvent(panel, 'scroll', { passive: true })
|
|
431
387
|
.pipe(takeUntil(this.autocomplete.closed))
|
|
432
388
|
.subscribe(() => {
|
|
433
389
|
if (this._scrollHeight !== panel.scrollHeight) {
|
|
434
390
|
this.setScrollHscrollHeight(panel.scrollHeight);
|
|
435
391
|
}
|
|
436
392
|
if (panel.scrollHeight * 0.8 <= panel.scrollTop + panel.clientHeight && this._scrollHeightChanged) {
|
|
437
|
-
this.
|
|
393
|
+
this.panelScrolled.emit();
|
|
438
394
|
this._scrollHeightChanged = false;
|
|
439
395
|
}
|
|
440
396
|
});
|
|
@@ -443,66 +399,78 @@ let AutocompleteDirective = class AutocompleteDirective {
|
|
|
443
399
|
this._scrollHeight = height;
|
|
444
400
|
this._scrollHeightChanged = true;
|
|
445
401
|
}
|
|
446
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
447
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
448
|
-
}
|
|
449
|
-
AutocompleteDirective
|
|
450
|
-
UntilDestroy(),
|
|
451
|
-
__metadata("design:paramtypes", [NgZone,
|
|
452
|
-
MatAutocomplete])
|
|
453
|
-
], AutocompleteDirective);
|
|
454
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AutocompleteDirective, decorators: [{
|
|
402
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: AutocompleteDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
403
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: AutocompleteDirective, isStandalone: true, selector: "[wlcmAutocomplete]", outputs: { panelScrolled: "panelScrolled" }, ngImport: i0 }); }
|
|
404
|
+
}
|
|
405
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: AutocompleteDirective, decorators: [{
|
|
455
406
|
type: Directive,
|
|
456
407
|
args: [{
|
|
457
408
|
selector: '[wlcmAutocomplete]',
|
|
458
|
-
standalone: true,
|
|
459
409
|
}]
|
|
460
|
-
}], ctorParameters: () => [
|
|
461
|
-
type: Host
|
|
462
|
-
}, {
|
|
463
|
-
type: Optional
|
|
464
|
-
}] }], propDecorators: { panelScrolled: [{
|
|
465
|
-
type: Output
|
|
466
|
-
}] } });
|
|
410
|
+
}], ctorParameters: () => [], propDecorators: { panelScrolled: [{ type: i0.Output, args: ["panelScrolled"] }] } });
|
|
467
411
|
|
|
468
412
|
class WlcmAutocomplete {
|
|
469
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
470
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
413
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmAutocomplete, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
414
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: WlcmAutocomplete, isStandalone: true, ngImport: i0 }); }
|
|
471
415
|
}
|
|
472
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
416
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmAutocomplete, decorators: [{
|
|
473
417
|
type: Directive
|
|
474
418
|
}] });
|
|
475
419
|
|
|
476
420
|
const PANEL_CLASS$1 = 'wlcm-autocomplete-panel';
|
|
477
|
-
|
|
478
|
-
constructor(
|
|
421
|
+
class WlcmAutocompleteComponent extends WlcmAutocomplete {
|
|
422
|
+
constructor() {
|
|
479
423
|
super();
|
|
480
|
-
this.
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
this.
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
});
|
|
488
|
-
this.
|
|
489
|
-
|
|
424
|
+
this.fetchPaginatedOptions = input.required(/* @ts-ignore */
|
|
425
|
+
...(ngDevMode ? [{ debugName: "fetchPaginatedOptions" }] : /* istanbul ignore next */ []));
|
|
426
|
+
// Unused internally and not always bound by consumers (e.g. sandbox); keep optional
|
|
427
|
+
// to preserve the previous non-required @Input() label!: string contract.
|
|
428
|
+
this.label = input('', /* @ts-ignore */
|
|
429
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
430
|
+
this.required = input(false, /* @ts-ignore */
|
|
431
|
+
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
432
|
+
this.placeholder = input('', /* @ts-ignore */
|
|
433
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
434
|
+
this.optionTemplate = input(undefined, /* @ts-ignore */
|
|
435
|
+
...(ngDevMode ? [{ debugName: "optionTemplate" }] : /* istanbul ignore next */ []));
|
|
436
|
+
// queryParams is a public input that is also mutated internally (query text and
|
|
437
|
+
// page cursor on every load). A read-only signal input can't be written, so the
|
|
438
|
+
// input seeds a mutable linkedSignal working copy (cloneDeep preserves the
|
|
439
|
+
// original transform semantics: never mutate the caller's object).
|
|
440
|
+
this.queryParams = input(cloneDeep({ ...DEFAULT_QUERY_PARAMS, limit: 15 }), { ...(ngDevMode ? { debugName: "queryParams" } : /* istanbul ignore next */ {}), transform: (params) => cloneDeep(params) });
|
|
441
|
+
this._queryParams = linkedSignal(() => cloneDeep(this.queryParams()), /* @ts-ignore */
|
|
442
|
+
...(ngDevMode ? [{ debugName: "_queryParams" }] : /* istanbul ignore next */ []));
|
|
443
|
+
this.selectOptionFormat = input('ValueOnly', /* @ts-ignore */
|
|
444
|
+
...(ngDevMode ? [{ debugName: "selectOptionFormat" }] : /* istanbul ignore next */ []));
|
|
445
|
+
this.noResultsTemplate = input(/* @ts-ignore */
|
|
446
|
+
...(ngDevMode ? [undefined, { debugName: "noResultsTemplate" }] : /* istanbul ignore next */ []));
|
|
490
447
|
this.selected = output();
|
|
491
448
|
this.control = new FormControl('');
|
|
492
449
|
this._loadMore$ = new Subject();
|
|
493
|
-
this.
|
|
494
|
-
|
|
450
|
+
this.options = signal([], /* @ts-ignore */
|
|
451
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
495
452
|
this.closed$ = new Subject();
|
|
496
453
|
this._focusStream$ = new BehaviorSubject(EMPTY);
|
|
497
454
|
this._blurStream$ = new BehaviorSubject(EMPTY);
|
|
498
|
-
this.
|
|
455
|
+
this.loading = signal(false, /* @ts-ignore */
|
|
456
|
+
...(ngDevMode ? [{ debugName: "loading" }] : /* istanbul ignore next */ []));
|
|
457
|
+
// WlcmAutocomplete contract + the autocomplete-suffix partial consume loading$
|
|
458
|
+
// as an observable, so bridge the internal loading signal back to an observable.
|
|
459
|
+
this.loading$ = toObservable(this.loading);
|
|
499
460
|
this.focus$ = this._focusStream$.pipe(switchMap((stream) => stream));
|
|
500
461
|
this.blur$ = this._blurStream$.pipe(switchMap((stream) => stream));
|
|
501
|
-
this.loading$ = this._loading$.asObservable();
|
|
502
462
|
this.adjustedValue$ = new BehaviorSubject(null);
|
|
503
463
|
this._paginatedData = null;
|
|
504
464
|
this._reloadOptions$ = new Subject();
|
|
505
465
|
this.viewReady$ = new Subject();
|
|
466
|
+
this.inputElement = viewChild(WLCM_INPUT, { ...(ngDevMode ? { debugName: "inputElement" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
467
|
+
this.autocompleteTrigger = viewChild(MatAutocompleteTrigger, /* @ts-ignore */
|
|
468
|
+
...(ngDevMode ? [{ debugName: "autocompleteTrigger" }] : /* istanbul ignore next */ []));
|
|
469
|
+
this.autocomplete = viewChild(MatAutocomplete, /* @ts-ignore */
|
|
470
|
+
...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
471
|
+
this.injector = inject(Injector);
|
|
472
|
+
this.formField = inject(WLCM_FORM_FIELD);
|
|
473
|
+
this.destroyRef = inject(DestroyRef);
|
|
506
474
|
this.handleLoadMoreEvent();
|
|
507
475
|
this.handleControlValueChanges();
|
|
508
476
|
this.handleAdjustedValue();
|
|
@@ -512,9 +480,16 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
512
480
|
}
|
|
513
481
|
ngAfterViewInit() {
|
|
514
482
|
this.viewReady$.next();
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
483
|
+
const trigger = this.autocompleteTrigger();
|
|
484
|
+
if (trigger) {
|
|
485
|
+
trigger.connectedTo = runInInjectionContext(this.injector, () => {
|
|
486
|
+
// Material 22 made MatAutocompleteOrigin a directive with a no-arg constructor that injects
|
|
487
|
+
// its own ElementRef; point it at the form-field input container after construction.
|
|
488
|
+
const origin = new MatAutocompleteOrigin();
|
|
489
|
+
origin.elementRef = this.formField.inputContainer;
|
|
490
|
+
return origin;
|
|
491
|
+
});
|
|
492
|
+
}
|
|
518
493
|
this.attachFocusBlurListeners();
|
|
519
494
|
}
|
|
520
495
|
displayWith(value) {
|
|
@@ -524,10 +499,10 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
524
499
|
return value;
|
|
525
500
|
}
|
|
526
501
|
focus() {
|
|
527
|
-
this.inputElement
|
|
502
|
+
this.inputElement()?.nativeElement.focus();
|
|
528
503
|
}
|
|
529
504
|
isFocused() {
|
|
530
|
-
return this.inputElement?.nativeElement === document.activeElement || this.autocomplete?.isOpen;
|
|
505
|
+
return this.inputElement()?.nativeElement === document.activeElement || (this.autocomplete()?.isOpen ?? false);
|
|
531
506
|
}
|
|
532
507
|
loadMore() {
|
|
533
508
|
this._loadMore$.next();
|
|
@@ -552,9 +527,12 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
552
527
|
this._reloadOptions$.next();
|
|
553
528
|
}
|
|
554
529
|
blured() {
|
|
555
|
-
|
|
530
|
+
const autocomplete = this.autocomplete();
|
|
531
|
+
if (!autocomplete)
|
|
532
|
+
return;
|
|
533
|
+
if (!autocomplete.isOpen)
|
|
556
534
|
this._touched?.();
|
|
557
|
-
|
|
535
|
+
autocomplete.closed.pipe(take(1)).subscribe(() => this._touched?.());
|
|
558
536
|
}
|
|
559
537
|
validate(control) {
|
|
560
538
|
if (this.control.value) {
|
|
@@ -574,24 +552,24 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
574
552
|
return value;
|
|
575
553
|
}
|
|
576
554
|
loadOptions(query = '') {
|
|
577
|
-
this.
|
|
578
|
-
this.
|
|
579
|
-
return this.fetchPaginatedOptions(this.
|
|
555
|
+
this.loading.set(true);
|
|
556
|
+
this._queryParams.update((params) => ({ ...params, query, page: 1 }));
|
|
557
|
+
return this.fetchPaginatedOptions()(this._queryParams()).pipe(tap((paginatedData) => {
|
|
580
558
|
this._paginatedData = paginatedData;
|
|
581
|
-
this.
|
|
582
|
-
this.
|
|
559
|
+
this.options.set(paginatedData.data);
|
|
560
|
+
this.loading.set(false);
|
|
583
561
|
}));
|
|
584
562
|
}
|
|
585
563
|
handleLoadMoreEvent() {
|
|
586
564
|
this._loadMore$
|
|
587
565
|
.pipe(concatMap(() => {
|
|
588
566
|
if (this._paginatedData && this._paginatedData.currPage + 1 <= this._paginatedData.totalPages) {
|
|
589
|
-
this.
|
|
590
|
-
this.
|
|
591
|
-
return this.fetchPaginatedOptions(this.
|
|
567
|
+
this._queryParams.update((params) => ({ ...params, page: params.page + 1 }));
|
|
568
|
+
this.loading.set(true);
|
|
569
|
+
return this.fetchPaginatedOptions()(this._queryParams()).pipe(tap((paginatedData) => {
|
|
592
570
|
this._paginatedData = paginatedData;
|
|
593
|
-
this.
|
|
594
|
-
this.
|
|
571
|
+
this.options.update((options) => [...options, ...paginatedData.data]);
|
|
572
|
+
this.loading.set(false);
|
|
595
573
|
}));
|
|
596
574
|
}
|
|
597
575
|
return EMPTY;
|
|
@@ -600,7 +578,7 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
600
578
|
}
|
|
601
579
|
handleControlValueChanges() {
|
|
602
580
|
merge(this.control.valueChanges, this._reloadOptions$.pipe(map(() => this.control.value)))
|
|
603
|
-
.pipe(
|
|
581
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
604
582
|
.pipe(filter((value) => {
|
|
605
583
|
let _value = value ?? '';
|
|
606
584
|
if (value instanceof Object && this.selectOptionFormat() === 'ValueOnly')
|
|
@@ -613,10 +591,14 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
613
591
|
.subscribe();
|
|
614
592
|
}
|
|
615
593
|
attachFocusBlurListeners() {
|
|
616
|
-
const
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
|
|
594
|
+
const inputElement = this.inputElement();
|
|
595
|
+
const autocomplete = this.autocomplete();
|
|
596
|
+
if (!inputElement || !autocomplete)
|
|
597
|
+
return;
|
|
598
|
+
const inputFocus = fromEvent(inputElement.nativeElement, 'focus');
|
|
599
|
+
const inputBlur = fromEvent(inputElement.nativeElement, 'blur');
|
|
600
|
+
const focusObservables = [inputFocus, autocomplete.opened];
|
|
601
|
+
const blurObservables = [inputBlur, autocomplete.closed];
|
|
620
602
|
this._focusStream$.next(merge(...focusObservables).pipe(map(() => undefined)));
|
|
621
603
|
this._blurStream$.next(merge(...blurObservables).pipe(map(() => this.control?.markAsTouched())));
|
|
622
604
|
}
|
|
@@ -625,8 +607,8 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
625
607
|
.pipe(switchMap(() => this.adjustedValue$.pipe(filter(Boolean))))
|
|
626
608
|
.subscribe((value) => this._changed?.(value));
|
|
627
609
|
}
|
|
628
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
629
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
610
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
611
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: WlcmAutocompleteComponent, isStandalone: true, selector: "wlcm-autocomplete", inputs: { fetchPaginatedOptions: { classPropertyName: "fetchPaginatedOptions", publicName: "fetchPaginatedOptions", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, selectOptionFormat: { classPropertyName: "selectOptionFormat", publicName: "selectOptionFormat", isSignal: true, isRequired: false, transformFunction: null }, noResultsTemplate: { classPropertyName: "noResultsTemplate", publicName: "noResultsTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, host: { classAttribute: "wlcm-autocomplete" }, providers: [
|
|
630
612
|
{ provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, useValue: { overlayPanelClass: PANEL_CLASS$1 } },
|
|
631
613
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmAutocompleteComponent), multi: true },
|
|
632
614
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmAutocompleteComponent), multi: true },
|
|
@@ -637,15 +619,11 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
637
619
|
return { bind: () => autocomplete };
|
|
638
620
|
},
|
|
639
621
|
},
|
|
640
|
-
], viewQueries: [{ propertyName: "inputElement", first: true, predicate: WLCM_INPUT, descendants: true, read: ElementRef }, { propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true }, { propertyName: "autocomplete", first: true, predicate: MatAutocomplete, descendants: true }], exportAs: ["wlcmAutocomplete"], usesInheritance: true, ngImport: i0, template: "<input\n wlcmInput\n type=\"text\"\n [matAutocomplete]=\"autocomplete\"\n [placeholder]=\"placeholder\"\n [formControl]=\"control\"\n (blur)=\"blured()\"\n/>\n\n<mat-autocomplete\n #autocomplete=\"matAutocomplete\"\n wlcmAutocomplete\n [disableRipple]=\"true\"\n [displayWith]=\"displayWith\"\n [hideSingleSelectionIndicator]=\"true\"\n (panelScrolled)=\"loadMore()\"\n>\n <ng-container
|
|
641
|
-
}
|
|
642
|
-
WlcmAutocompleteComponent
|
|
643
|
-
UntilDestroy(),
|
|
644
|
-
__metadata("design:paramtypes", [Injector, Object])
|
|
645
|
-
], WlcmAutocompleteComponent);
|
|
646
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmAutocompleteComponent, decorators: [{
|
|
622
|
+
], viewQueries: [{ propertyName: "inputElement", first: true, predicate: WLCM_INPUT, descendants: true, read: ElementRef, isSignal: true }, { propertyName: "autocompleteTrigger", first: true, predicate: MatAutocompleteTrigger, descendants: true, isSignal: true }, { propertyName: "autocomplete", first: true, predicate: MatAutocomplete, descendants: true, isSignal: true }], exportAs: ["wlcmAutocomplete"], usesInheritance: true, ngImport: i0, template: "<input\n wlcmInput\n type=\"text\"\n [matAutocomplete]=\"autocomplete\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"control\"\n (blur)=\"blured()\"\n />\n\n<mat-autocomplete\n #autocomplete=\"matAutocomplete\"\n wlcmAutocomplete\n [disableRipple]=\"true\"\n [displayWith]=\"displayWith\"\n [hideSingleSelectionIndicator]=\"true\"\n (panelScrolled)=\"loadMore()\"\n >\n <ng-container>\n @for (option of options(); track option) {\n <mat-option\n [ngClass]=\"{ 'wlcm-custom-option-content': optionTemplate() }\"\n [value]=\"option\"\n >\n @if (optionTemplate(); as optionTemplate) {\n <ng-container\n *ngTemplateOutlet=\"optionTemplate; context: { $implicit: option }\"\n ></ng-container>\n } @else {\n {{ option.viewValue }}\n }\n </mat-option>\n }\n\n @if (options().length === 0) {\n <mat-option [disabled]=\"true\">\n @if (noResultsTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n noResultsTemplate()!;\n context: { $implicit: control.value, loading: loading() }\n \"\n ></ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n defaultNoResultsTemplate;\n context: { $implicit: control.value, loading: loading() }\n \"\n ></ng-container>\n }\n </mat-option>\n }\n </ng-container>\n</mat-autocomplete>\n\n<ng-template #defaultNoResultsTemplate let-loading=\"loading\">\n @if (loading) {\n Please wait...\n } @else {\n No results found\n }\n</ng-template>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i2.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "directive", type: i2.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "directive", type: AutocompleteDirective, selector: "[wlcmAutocomplete]", outputs: ["panelScrolled"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: WlcmInputDirective, selector: "[wlcmInput]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
623
|
+
}
|
|
624
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmAutocompleteComponent, decorators: [{
|
|
647
625
|
type: Component,
|
|
648
|
-
args: [{ selector: 'wlcm-autocomplete', exportAs: 'wlcmAutocomplete', host: { class: 'wlcm-autocomplete' },
|
|
626
|
+
args: [{ selector: 'wlcm-autocomplete', exportAs: 'wlcmAutocomplete', host: { class: 'wlcm-autocomplete' }, imports: [CommonModule, MatAutocompleteModule, AutocompleteDirective, ReactiveFormsModule, WlcmInputDirective], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
649
627
|
{ provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, useValue: { overlayPanelClass: PANEL_CLASS$1 } },
|
|
650
628
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmAutocompleteComponent), multi: true },
|
|
651
629
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmAutocompleteComponent), multi: true },
|
|
@@ -656,40 +634,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
656
634
|
return { bind: () => autocomplete };
|
|
657
635
|
},
|
|
658
636
|
},
|
|
659
|
-
], template: "<input\n wlcmInput\n type=\"text\"\n [matAutocomplete]=\"autocomplete\"\n [placeholder]=\"placeholder\"\n [formControl]=\"control\"\n (blur)=\"blured()\"\n/>\n\n<mat-autocomplete\n #autocomplete=\"matAutocomplete\"\n wlcmAutocomplete\n [disableRipple]=\"true\"\n [displayWith]=\"displayWith\"\n [hideSingleSelectionIndicator]=\"true\"\n (panelScrolled)=\"loadMore()\"\n>\n <ng-container
|
|
660
|
-
}], ctorParameters: () => [{ type: i0.
|
|
661
|
-
type: Inject,
|
|
662
|
-
args: [WLCM_FORM_FIELD]
|
|
663
|
-
}] }], propDecorators: { fetchPaginatedOptions: [{
|
|
664
|
-
type: Input
|
|
665
|
-
}], label: [{
|
|
666
|
-
type: Input
|
|
667
|
-
}], required: [{
|
|
668
|
-
type: Input
|
|
669
|
-
}], placeholder: [{
|
|
670
|
-
type: Input
|
|
671
|
-
}], optionTemplate: [{
|
|
672
|
-
type: Input
|
|
673
|
-
}], queryParams: [{
|
|
674
|
-
type: Input,
|
|
675
|
-
args: [{ transform: (params) => cloneDeep(params) }]
|
|
676
|
-
}], inputElement: [{
|
|
677
|
-
type: ViewChild,
|
|
678
|
-
args: [WLCM_INPUT, { read: ElementRef }]
|
|
679
|
-
}], autocompleteTrigger: [{
|
|
680
|
-
type: ViewChild,
|
|
681
|
-
args: [MatAutocompleteTrigger]
|
|
682
|
-
}], autocomplete: [{
|
|
683
|
-
type: ViewChild,
|
|
684
|
-
args: [MatAutocomplete]
|
|
685
|
-
}] } });
|
|
637
|
+
], template: "<input\n wlcmInput\n type=\"text\"\n [matAutocomplete]=\"autocomplete\"\n [placeholder]=\"placeholder()\"\n [formControl]=\"control\"\n (blur)=\"blured()\"\n />\n\n<mat-autocomplete\n #autocomplete=\"matAutocomplete\"\n wlcmAutocomplete\n [disableRipple]=\"true\"\n [displayWith]=\"displayWith\"\n [hideSingleSelectionIndicator]=\"true\"\n (panelScrolled)=\"loadMore()\"\n >\n <ng-container>\n @for (option of options(); track option) {\n <mat-option\n [ngClass]=\"{ 'wlcm-custom-option-content': optionTemplate() }\"\n [value]=\"option\"\n >\n @if (optionTemplate(); as optionTemplate) {\n <ng-container\n *ngTemplateOutlet=\"optionTemplate; context: { $implicit: option }\"\n ></ng-container>\n } @else {\n {{ option.viewValue }}\n }\n </mat-option>\n }\n\n @if (options().length === 0) {\n <mat-option [disabled]=\"true\">\n @if (noResultsTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"\n noResultsTemplate()!;\n context: { $implicit: control.value, loading: loading() }\n \"\n ></ng-container>\n } @else {\n <ng-container\n *ngTemplateOutlet=\"\n defaultNoResultsTemplate;\n context: { $implicit: control.value, loading: loading() }\n \"\n ></ng-container>\n }\n </mat-option>\n }\n </ng-container>\n</mat-autocomplete>\n\n<ng-template #defaultNoResultsTemplate let-loading=\"loading\">\n @if (loading) {\n Please wait...\n } @else {\n No results found\n }\n</ng-template>\n" }]
|
|
638
|
+
}], ctorParameters: () => [], propDecorators: { fetchPaginatedOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "fetchPaginatedOptions", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], optionTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionTemplate", required: false }] }], queryParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParams", required: false }] }], selectOptionFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectOptionFormat", required: false }] }], noResultsTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "noResultsTemplate", required: false }] }], selected: [{ type: i0.Output, args: ["selected"] }], inputElement: [{ type: i0.ViewChild, args: [i0.forwardRef(() => WLCM_INPUT), { ...{ read: ElementRef }, isSignal: true }] }], autocompleteTrigger: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatAutocompleteTrigger), { isSignal: true }] }], autocomplete: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatAutocomplete), { isSignal: true }] }] } });
|
|
686
639
|
|
|
687
|
-
|
|
688
|
-
constructor(
|
|
689
|
-
this.changeDetectorRef =
|
|
690
|
-
this.parentFormMember =
|
|
691
|
-
this.
|
|
692
|
-
this.
|
|
640
|
+
class WlcmCheckboxComponent {
|
|
641
|
+
constructor() {
|
|
642
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
643
|
+
this.parentFormMember = inject(WLCM_FORM_CONTROL, { optional: true });
|
|
644
|
+
this.destroyRef = inject(DestroyRef);
|
|
645
|
+
this.value = input(/* @ts-ignore */
|
|
646
|
+
...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
|
|
647
|
+
this.changed = output();
|
|
693
648
|
this.control = new FormControl(false);
|
|
694
649
|
this.validate = () => null;
|
|
695
650
|
if (this.parentFormMember) {
|
|
@@ -726,45 +681,38 @@ let WlcmCheckboxComponent = class WlcmCheckboxComponent {
|
|
|
726
681
|
this.control.setValue(value);
|
|
727
682
|
}
|
|
728
683
|
handleStateChange() {
|
|
729
|
-
this.parentFormMember.stateChanges$.pipe(
|
|
684
|
+
this.parentFormMember.stateChanges$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
730
685
|
this._validatorChanged?.();
|
|
731
686
|
this.changeDetectorRef.markForCheck();
|
|
732
687
|
});
|
|
733
688
|
}
|
|
734
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
735
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
689
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
690
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.5", type: WlcmCheckboxComponent, isStandalone: true, selector: "wlcm-checkbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, host: { classAttribute: "wlcm-checkbox" }, providers: [
|
|
736
691
|
WLCM_FORM_CONTROL_PROVIDER,
|
|
737
692
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmCheckboxComponent), multi: true },
|
|
738
693
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmCheckboxComponent), multi: true },
|
|
739
|
-
], ngImport: i0, template: "<mat-checkbox [formControl]=\"control\" (change)=\"handleChange($event)\">\n <ng-content></ng-content>\n</mat-checkbox>\n", styles: [""], dependencies: [{ kind: "ngmodule", type:
|
|
740
|
-
}
|
|
741
|
-
WlcmCheckboxComponent
|
|
742
|
-
UntilDestroy(),
|
|
743
|
-
__metadata("design:paramtypes", [ChangeDetectorRef, Object])
|
|
744
|
-
], WlcmCheckboxComponent);
|
|
745
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmCheckboxComponent, decorators: [{
|
|
694
|
+
], ngImport: i0, template: "<mat-checkbox [formControl]=\"control\" (change)=\"handleChange($event)\">\n <ng-content></ng-content>\n</mat-checkbox>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i1$1.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
695
|
+
}
|
|
696
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmCheckboxComponent, decorators: [{
|
|
746
697
|
type: Component,
|
|
747
|
-
args: [{ selector: 'wlcm-checkbox', host: { class: 'wlcm-checkbox' },
|
|
698
|
+
args: [{ selector: 'wlcm-checkbox', host: { class: 'wlcm-checkbox' }, imports: [MatCheckboxModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
748
699
|
WLCM_FORM_CONTROL_PROVIDER,
|
|
749
700
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmCheckboxComponent), multi: true },
|
|
750
701
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmCheckboxComponent), multi: true },
|
|
751
702
|
], template: "<mat-checkbox [formControl]=\"control\" (change)=\"handleChange($event)\">\n <ng-content></ng-content>\n</mat-checkbox>\n" }]
|
|
752
|
-
}], ctorParameters: () => [{ type: i0.
|
|
753
|
-
type: Optional
|
|
754
|
-
}, {
|
|
755
|
-
type: Inject,
|
|
756
|
-
args: [WLCM_FORM_CONTROL]
|
|
757
|
-
}] }], propDecorators: { changed: [{
|
|
758
|
-
type: Output
|
|
759
|
-
}] } });
|
|
703
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
760
704
|
|
|
761
|
-
|
|
705
|
+
class WlcmCheckboxGroupComponent {
|
|
762
706
|
constructor() {
|
|
763
|
-
this.
|
|
707
|
+
this.destroyRef = inject(DestroyRef);
|
|
708
|
+
this.checkboxes = contentChildren(WlcmCheckboxComponent, /* @ts-ignore */
|
|
709
|
+
...(ngDevMode ? [{ debugName: "checkboxes" }] : /* istanbul ignore next */ []));
|
|
764
710
|
this.checkboxesMap = computed(() => {
|
|
765
711
|
return new Map(this.checkboxes().map((checkbox) => [checkbox.value(), checkbox]));
|
|
766
|
-
}
|
|
767
|
-
|
|
712
|
+
}, /* @ts-ignore */
|
|
713
|
+
...(ngDevMode ? [{ debugName: "checkboxesMap" }] : /* istanbul ignore next */ []));
|
|
714
|
+
this.values = signal(new Set(), /* @ts-ignore */
|
|
715
|
+
...(ngDevMode ? [{ debugName: "values" }] : /* istanbul ignore next */ []));
|
|
768
716
|
this.checkboxesListUpdated = new Subject();
|
|
769
717
|
this.validate = () => null;
|
|
770
718
|
effect(() => this.handleCheckboxesToggle(this.checkboxes()));
|
|
@@ -811,47 +759,44 @@ let WlcmCheckboxGroupComponent = class WlcmCheckboxGroupComponent {
|
|
|
811
759
|
});
|
|
812
760
|
};
|
|
813
761
|
const changeHandlers = Array.from(checkboxes.values()).map((checkbox) => {
|
|
814
|
-
return checkbox.changed
|
|
762
|
+
return outputToObservable(checkbox.changed).pipe(tap(() => handleCheck(checkbox)));
|
|
815
763
|
});
|
|
816
764
|
merge(...changeHandlers)
|
|
817
|
-
.pipe(
|
|
765
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
818
766
|
.pipe(takeUntil(this.checkboxesListUpdated))
|
|
819
767
|
.subscribe();
|
|
820
768
|
}
|
|
821
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
822
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
769
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmCheckboxGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
770
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.5", type: WlcmCheckboxGroupComponent, isStandalone: true, selector: "wlcm-checkbox-group", host: { classAttribute: "wlcm-checkbox-group" }, providers: [
|
|
823
771
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmCheckboxGroupComponent), multi: true },
|
|
824
772
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmCheckboxGroupComponent), multi: true },
|
|
825
|
-
], queries: [{ propertyName: "checkboxes", predicate: WlcmCheckboxComponent, isSignal: true }], ngImport: i0, template: "<ng-content select=\"wlcm-checkbox\"></ng-content>\n", styles: [""],
|
|
826
|
-
}
|
|
827
|
-
WlcmCheckboxGroupComponent
|
|
828
|
-
UntilDestroy(),
|
|
829
|
-
__metadata("design:paramtypes", [])
|
|
830
|
-
], WlcmCheckboxGroupComponent);
|
|
831
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmCheckboxGroupComponent, decorators: [{
|
|
773
|
+
], queries: [{ propertyName: "checkboxes", predicate: WlcmCheckboxComponent, isSignal: true }], ngImport: i0, template: "<ng-content select=\"wlcm-checkbox\"></ng-content>\n", styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
774
|
+
}
|
|
775
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmCheckboxGroupComponent, decorators: [{
|
|
832
776
|
type: Component,
|
|
833
|
-
args: [{ selector: 'wlcm-checkbox-group', host: { class: 'wlcm-checkbox-group' },
|
|
777
|
+
args: [{ selector: 'wlcm-checkbox-group', host: { class: 'wlcm-checkbox-group' }, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
834
778
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmCheckboxGroupComponent), multi: true },
|
|
835
779
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmCheckboxGroupComponent), multi: true },
|
|
836
780
|
], template: "<ng-content select=\"wlcm-checkbox\"></ng-content>\n" }]
|
|
837
|
-
}], ctorParameters: () => [] });
|
|
781
|
+
}], ctorParameters: () => [], propDecorators: { checkboxes: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => WlcmCheckboxComponent), { isSignal: true }] }] } });
|
|
838
782
|
|
|
839
783
|
class WlcmAutocompleteSuffixComponent {
|
|
840
784
|
constructor() {
|
|
841
|
-
this.autocomplete = input.required(
|
|
785
|
+
this.autocomplete = input.required(/* @ts-ignore */
|
|
786
|
+
...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
842
787
|
this.WlcmIconName = WlcmIconName;
|
|
843
788
|
}
|
|
844
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
845
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
789
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmAutocompleteSuffixComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
790
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: WlcmAutocompleteSuffixComponent, isStandalone: true, selector: "wlcm-autocomplete-suffix", inputs: { autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "wlcm-autocomplete-suffix" }, ngImport: i0, template: "@let loading = autocomplete().loading$ | async;\n<ng-container>\n @if (!loading) {\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n }\n\n <wlcm-loader [hidden]=\"!loading\"></wlcm-loader>\n</ng-container>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: WlcmIconDirective, selector: "[wlcmIcon]", inputs: ["wlcmIcon", "wlcmIconStopPropagation"], outputs: ["wlcmIconClicked"] }, { kind: "component", type: WlcmLoaderComponent, selector: "wlcm-loader", inputs: ["hidden", "diameter"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
846
791
|
}
|
|
847
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
792
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmAutocompleteSuffixComponent, decorators: [{
|
|
848
793
|
type: Component,
|
|
849
|
-
args: [{ selector: 'wlcm-autocomplete-suffix', host: { class: 'wlcm-autocomplete-suffix' },
|
|
850
|
-
}] });
|
|
794
|
+
args: [{ selector: 'wlcm-autocomplete-suffix', host: { class: 'wlcm-autocomplete-suffix' }, imports: [CommonModule, WlcmIconDirective, WlcmLoaderComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let loading = autocomplete().loading$ | async;\n<ng-container>\n @if (!loading) {\n <ng-container [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"></ng-container>\n }\n\n <wlcm-loader [hidden]=\"!loading\"></wlcm-loader>\n</ng-container>\n" }]
|
|
795
|
+
}], propDecorators: { autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: true }] }] } });
|
|
851
796
|
|
|
852
797
|
class WlcmSelectInputBinderDirective {
|
|
853
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
854
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
798
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmSelectInputBinderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
799
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: WlcmSelectInputBinderDirective, isStandalone: true, selector: "[wlcmSelectInputBinder]", providers: [
|
|
855
800
|
{
|
|
856
801
|
provide: WLCM_INPUT_BINDER,
|
|
857
802
|
useFactory: () => {
|
|
@@ -861,10 +806,9 @@ class WlcmSelectInputBinderDirective {
|
|
|
861
806
|
},
|
|
862
807
|
], ngImport: i0 }); }
|
|
863
808
|
}
|
|
864
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmSelectInputBinderDirective, decorators: [{
|
|
865
810
|
type: Directive,
|
|
866
811
|
args: [{
|
|
867
|
-
standalone: true,
|
|
868
812
|
selector: '[wlcmSelectInputBinder]',
|
|
869
813
|
providers: [
|
|
870
814
|
{
|
|
@@ -887,45 +831,60 @@ const mergeConfig = (config) => {
|
|
|
887
831
|
};
|
|
888
832
|
return mergeWith({ ...DEFAULT_CONFIG }, config, customizer);
|
|
889
833
|
};
|
|
890
|
-
|
|
834
|
+
class WlcmSelectComponent {
|
|
891
835
|
openPanel() {
|
|
892
|
-
this.matSelect
|
|
893
|
-
}
|
|
894
|
-
constructor(
|
|
895
|
-
this.
|
|
896
|
-
|
|
897
|
-
this.
|
|
898
|
-
|
|
899
|
-
this.
|
|
900
|
-
|
|
901
|
-
this.
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
this.
|
|
908
|
-
|
|
909
|
-
this.
|
|
910
|
-
|
|
836
|
+
this.matSelect()?.open();
|
|
837
|
+
}
|
|
838
|
+
constructor() {
|
|
839
|
+
this.multiple = input(false, /* @ts-ignore */
|
|
840
|
+
...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
841
|
+
this.placeholder = input('Not selected', /* @ts-ignore */
|
|
842
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
843
|
+
this.fetchPaginatedOptions = input(/* @ts-ignore */
|
|
844
|
+
...(ngDevMode ? [undefined, { debugName: "fetchPaginatedOptions" }] : /* istanbul ignore next */ []));
|
|
845
|
+
this.canSelect = input((_) => true, /* @ts-ignore */
|
|
846
|
+
...(ngDevMode ? [{ debugName: "canSelect" }] : /* istanbul ignore next */ []));
|
|
847
|
+
// queryParams is both a public input AND mutated internally (page pagination),
|
|
848
|
+
// so it can't be a plain read-only signal input. linkedSignal seeds a mutable
|
|
849
|
+
// working copy from the input (structuredClone so we never mutate the caller's
|
|
850
|
+
// object) and re-seeds if the input changes.
|
|
851
|
+
this.queryParams = input({ ...DEFAULT_QUERY_PARAMS }, /* @ts-ignore */
|
|
852
|
+
...(ngDevMode ? [{ debugName: "queryParams" }] : /* istanbul ignore next */ []));
|
|
853
|
+
this._queryParams = linkedSignal(() => structuredClone(this.queryParams()), /* @ts-ignore */
|
|
854
|
+
...(ngDevMode ? [{ debugName: "_queryParams" }] : /* istanbul ignore next */ []));
|
|
855
|
+
this.paginated = input(false, /* @ts-ignore */
|
|
856
|
+
...(ngDevMode ? [{ debugName: "paginated" }] : /* istanbul ignore next */ []));
|
|
857
|
+
this.options = input([], /* @ts-ignore */
|
|
858
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
859
|
+
this.paginatedOptions = signal([], /* @ts-ignore */
|
|
860
|
+
...(ngDevMode ? [{ debugName: "paginatedOptions" }] : /* istanbul ignore next */ []));
|
|
861
|
+
this.selectOptionFormat = input('ValueOnly', /* @ts-ignore */
|
|
862
|
+
...(ngDevMode ? [{ debugName: "selectOptionFormat" }] : /* istanbul ignore next */ []));
|
|
863
|
+
this.optionTemplate = input(null, /* @ts-ignore */
|
|
864
|
+
...(ngDevMode ? [{ debugName: "optionTemplate" }] : /* istanbul ignore next */ []));
|
|
865
|
+
this.triggerTemplate = input(/* @ts-ignore */
|
|
866
|
+
...(ngDevMode ? [undefined, { debugName: "triggerTemplate" }] : /* istanbul ignore next */ []));
|
|
867
|
+
this.isOptionDisabled = input(() => false, /* @ts-ignore */
|
|
868
|
+
...(ngDevMode ? [{ debugName: "isOptionDisabled" }] : /* istanbul ignore next */ []));
|
|
911
869
|
this.selectionChange = output();
|
|
912
870
|
this.opened = output();
|
|
913
871
|
this.closed = output();
|
|
914
|
-
this.value = signal(null
|
|
915
|
-
|
|
872
|
+
this.value = signal(null, /* @ts-ignore */
|
|
873
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
874
|
+
this.disabled = signal(false, /* @ts-ignore */
|
|
875
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
916
876
|
this.WlcmIconName = WlcmIconName;
|
|
917
877
|
this._paginatedData = null;
|
|
918
878
|
this._previousValue = null;
|
|
919
879
|
this._optionsCache = new Set();
|
|
920
|
-
this.computedOptions = computed(() =>
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
this.matOptions = viewChildren(MatOption);
|
|
880
|
+
this.computedOptions = computed(() => this.paginated() ? this.paginatedOptions() : this.options(), /* @ts-ignore */
|
|
881
|
+
...(ngDevMode ? [{ debugName: "computedOptions" }] : /* istanbul ignore next */ []));
|
|
882
|
+
this.prefilledOptions = signal([], /* @ts-ignore */
|
|
883
|
+
...(ngDevMode ? [{ debugName: "prefilledOptions" }] : /* istanbul ignore next */ []));
|
|
884
|
+
this.matSelect = viewChild(MatSelect, /* @ts-ignore */
|
|
885
|
+
...(ngDevMode ? [{ debugName: "matSelect" }] : /* istanbul ignore next */ []));
|
|
886
|
+
this.matOptions = viewChildren(MatOption, /* @ts-ignore */
|
|
887
|
+
...(ngDevMode ? [{ debugName: "matOptions" }] : /* istanbul ignore next */ []));
|
|
929
888
|
this._focusStream$ = new BehaviorSubject(EMPTY);
|
|
930
889
|
this._blurStream$ = new BehaviorSubject(EMPTY);
|
|
931
890
|
this.focus$ = this._focusStream$.pipe(switchMap((stream) => stream));
|
|
@@ -933,6 +892,11 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
933
892
|
this.adjustedValue$ = new BehaviorSubject(null);
|
|
934
893
|
this.viewReady$ = new Subject();
|
|
935
894
|
this.selected$ = new Subject();
|
|
895
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
896
|
+
this.scrollDetectionApi = inject(ScrollDetectionApi);
|
|
897
|
+
this.formField = inject(WLCM_FORM_FIELD);
|
|
898
|
+
this.parentFormMember = inject(WLCM_FORM_CONTROL, { optional: true });
|
|
899
|
+
this.destroyRef = inject(DestroyRef);
|
|
936
900
|
this.compareWith = (optionA, optionB) => {
|
|
937
901
|
if (this.areOptionsEqual(optionA, optionB)) {
|
|
938
902
|
if (this.selectOptionFormat() === 'CompleteOption' && typeof optionB !== 'object') {
|
|
@@ -942,14 +906,24 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
942
906
|
}
|
|
943
907
|
return false;
|
|
944
908
|
};
|
|
945
|
-
this.focus = () => this.matSelect
|
|
909
|
+
this.focus = () => this.matSelect()?.open();
|
|
946
910
|
this.isFocused = () => this.isOpen;
|
|
947
911
|
if (this.parentFormMember) {
|
|
948
912
|
this.handleStateChange();
|
|
949
913
|
}
|
|
950
914
|
this.handleAdjustedValue();
|
|
915
|
+
// Keep each rendered MatOption's disabled state in sync with the
|
|
916
|
+
// isOptionDisabled predicate. Runs as an effect (not inside computedOptions)
|
|
917
|
+
// because MatOption.disabled is a signal-backed setter as of Material 20 and
|
|
918
|
+
// writing to it from within a computed throws NG0600.
|
|
919
|
+
effect(() => {
|
|
920
|
+
const options = this.computedOptions();
|
|
921
|
+
if (this.isOptionDisabled() && options.length > 0) {
|
|
922
|
+
this.updateOptionsStatus();
|
|
923
|
+
}
|
|
924
|
+
});
|
|
951
925
|
toObservable(this.paginated)
|
|
952
|
-
.pipe(
|
|
926
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
953
927
|
.subscribe((paginated) => {
|
|
954
928
|
if (paginated)
|
|
955
929
|
this.loadPaginatedOptions();
|
|
@@ -957,15 +931,36 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
957
931
|
}
|
|
958
932
|
ngAfterViewInit() {
|
|
959
933
|
this.viewReady$.next();
|
|
960
|
-
|
|
961
|
-
|
|
934
|
+
// At runtime the MatSelect view query always resolves; under
|
|
935
|
+
// jest-preset-angular the lookup can return undefined in the harness, so
|
|
936
|
+
// every access is guarded.
|
|
937
|
+
const matSelect = this.matSelect();
|
|
938
|
+
if (this.formField && matSelect) {
|
|
939
|
+
this.setPreferredOverlayOrigin(matSelect);
|
|
962
940
|
}
|
|
963
|
-
|
|
964
|
-
|
|
941
|
+
if (matSelect) {
|
|
942
|
+
// Material exposes no public focus/blur streams for MatSelect. Derive both
|
|
943
|
+
// from the public openedChange emitter (true = opened/focus, false =
|
|
944
|
+
// closed/blur) instead of the private _openedStream/_closedStream.
|
|
945
|
+
this._focusStream$.next(matSelect.openedChange.pipe(filter(Boolean), map(() => undefined)));
|
|
946
|
+
this._blurStream$.next(matSelect.openedChange.pipe(filter((opened) => !opened), map(() => undefined)));
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
// MatSelect has no public API to override the overlay origin; _preferredOverlayOrigin
|
|
950
|
+
// is the only lever. Isolated here with a dev-mode assertion so a Material upgrade
|
|
951
|
+
// that renames/removes the field fails loudly instead of silently misplacing the panel.
|
|
952
|
+
setPreferredOverlayOrigin(matSelect) {
|
|
953
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode && !('_preferredOverlayOrigin' in matSelect)) {
|
|
954
|
+
throw new Error('WlcmSelect: MatSelect._preferredOverlayOrigin is no longer available — the overlay origin ' +
|
|
955
|
+
'override needs to be reworked for this @angular/material version.');
|
|
956
|
+
}
|
|
957
|
+
matSelect._preferredOverlayOrigin = this.formField.inputContainer;
|
|
965
958
|
}
|
|
966
959
|
select(event) {
|
|
967
960
|
this.selected$.next();
|
|
968
|
-
|
|
961
|
+
const matSelect = this.matSelect();
|
|
962
|
+
if (matSelect)
|
|
963
|
+
matSelect.value = event.value;
|
|
969
964
|
this.validateSelectedOption(event.value)
|
|
970
965
|
.pipe(takeUntil(this.selected$))
|
|
971
966
|
.subscribe((canSelect) => {
|
|
@@ -981,7 +976,9 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
981
976
|
return (optionA?.value || optionA) === (optionB?.value || optionB);
|
|
982
977
|
}
|
|
983
978
|
revertPreviousValue() {
|
|
984
|
-
|
|
979
|
+
const matSelect = this.matSelect();
|
|
980
|
+
if (matSelect)
|
|
981
|
+
matSelect.value = this._previousValue;
|
|
985
982
|
}
|
|
986
983
|
updateValue(value) {
|
|
987
984
|
this.value.set(value);
|
|
@@ -989,7 +986,7 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
989
986
|
}
|
|
990
987
|
validateSelectedOption(value) {
|
|
991
988
|
return new Observable((observer) => {
|
|
992
|
-
const response = this.canSelect(value);
|
|
989
|
+
const response = this.canSelect()(value);
|
|
993
990
|
const source = response instanceof Observable ? response.pipe(first()) : of(response);
|
|
994
991
|
source.subscribe((result) => {
|
|
995
992
|
observer.next(result);
|
|
@@ -1032,7 +1029,7 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
1032
1029
|
return null;
|
|
1033
1030
|
}
|
|
1034
1031
|
get isOpen() {
|
|
1035
|
-
return this.matSelect?.panelOpen ?? false;
|
|
1032
|
+
return this.matSelect()?.panelOpen ?? false;
|
|
1036
1033
|
}
|
|
1037
1034
|
prepareValueForPatch(value) {
|
|
1038
1035
|
const formatedValue = this.formatValue(value);
|
|
@@ -1062,9 +1059,9 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
1062
1059
|
return { changed: false, value };
|
|
1063
1060
|
}
|
|
1064
1061
|
loadPaginatedOptions() {
|
|
1065
|
-
this.
|
|
1066
|
-
this.fetchPaginatedOptions(this.
|
|
1067
|
-
.pipe(
|
|
1062
|
+
this._queryParams.update((params) => ({ ...params, page: 1 }));
|
|
1063
|
+
this.fetchPaginatedOptions()(this._queryParams())
|
|
1064
|
+
.pipe(takeUntilDestroyed(this.destroyRef), first())
|
|
1068
1065
|
.subscribe((paginatedData) => {
|
|
1069
1066
|
this._optionsCache.clear();
|
|
1070
1067
|
this.cacheOptions(paginatedData.data);
|
|
@@ -1075,9 +1072,9 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
1075
1072
|
loadMorePaginatedOptions() {
|
|
1076
1073
|
if (!this._paginatedData || this._paginatedData.currPage + 1 > this._paginatedData.totalPages)
|
|
1077
1074
|
return;
|
|
1078
|
-
this.
|
|
1079
|
-
this.fetchPaginatedOptions({ ...this.
|
|
1080
|
-
.pipe(
|
|
1075
|
+
this._queryParams.update((params) => ({ ...params, page: params.page + 1 }));
|
|
1076
|
+
this.fetchPaginatedOptions()({ ...this._queryParams() })
|
|
1077
|
+
.pipe(takeUntilDestroyed(this.destroyRef), first())
|
|
1081
1078
|
.subscribe((paginatedData) => {
|
|
1082
1079
|
this.cacheOptions(paginatedData.data);
|
|
1083
1080
|
this._paginatedData = paginatedData;
|
|
@@ -1106,15 +1103,19 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
1106
1103
|
this.prefilledOptions.set(prefilledOptions);
|
|
1107
1104
|
}
|
|
1108
1105
|
handleScrollDown() {
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1106
|
+
const panel = this.matSelect()?.panel;
|
|
1107
|
+
if (!panel)
|
|
1108
|
+
return;
|
|
1109
|
+
// ScrollDetectionApi is zone-free (fromEvent with passive listener); no NgZone
|
|
1110
|
+
// dance needed under zoneless CD. panel.nativeElement replaces the old
|
|
1111
|
+
// document.querySelector('.mat-mdc-select-panel') internal-DOM lookup.
|
|
1112
|
+
this.scrollDetectionApi
|
|
1113
|
+
.onScrolledDown(panel.nativeElement)
|
|
1114
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1115
|
+
.subscribe(() => this.loadMorePaginatedOptions());
|
|
1115
1116
|
}
|
|
1116
1117
|
handleStateChange() {
|
|
1117
|
-
this.parentFormMember.stateChanges$.pipe(
|
|
1118
|
+
this.parentFormMember.stateChanges$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
1118
1119
|
this._validatorChanged?.();
|
|
1119
1120
|
this.changeDetectorRef.markForCheck();
|
|
1120
1121
|
});
|
|
@@ -1124,8 +1125,8 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
1124
1125
|
.pipe(switchMap(() => this.adjustedValue$.pipe(filter(Boolean))))
|
|
1125
1126
|
.subscribe((value) => this._changed?.(value));
|
|
1126
1127
|
}
|
|
1127
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1128
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
1128
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1129
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: WlcmSelectComponent, isStandalone: true, selector: "wlcm-select", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, fetchPaginatedOptions: { classPropertyName: "fetchPaginatedOptions", publicName: "fetchPaginatedOptions", isSignal: true, isRequired: false, transformFunction: null }, canSelect: { classPropertyName: "canSelect", publicName: "canSelect", isSignal: true, isRequired: false, transformFunction: null }, queryParams: { classPropertyName: "queryParams", publicName: "queryParams", isSignal: true, isRequired: false, transformFunction: null }, paginated: { classPropertyName: "paginated", publicName: "paginated", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, selectOptionFormat: { classPropertyName: "selectOptionFormat", publicName: "selectOptionFormat", isSignal: true, isRequired: false, transformFunction: null }, optionTemplate: { classPropertyName: "optionTemplate", publicName: "optionTemplate", isSignal: true, isRequired: false, transformFunction: null }, triggerTemplate: { classPropertyName: "triggerTemplate", publicName: "triggerTemplate", isSignal: true, isRequired: false, transformFunction: null }, isOptionDisabled: { classPropertyName: "isOptionDisabled", publicName: "isOptionDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange", opened: "opened", closed: "closed" }, host: { listeners: { "click": "openPanel()" }, classAttribute: "wlcm-select" }, providers: [
|
|
1129
1130
|
WLCM_FORM_CONTROL_PROVIDER,
|
|
1130
1131
|
{
|
|
1131
1132
|
provide: MAT_SELECT_CONFIG,
|
|
@@ -1136,17 +1137,11 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
1136
1137
|
},
|
|
1137
1138
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmSelectComponent), multi: true },
|
|
1138
1139
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmSelectComponent), multi: true },
|
|
1139
|
-
], viewQueries: [{ propertyName: "
|
|
1140
|
-
}
|
|
1141
|
-
WlcmSelectComponent
|
|
1142
|
-
UntilDestroy(),
|
|
1143
|
-
__metadata("design:paramtypes", [NgZone,
|
|
1144
|
-
ChangeDetectorRef,
|
|
1145
|
-
ScrollDetectionApi, Object, Object])
|
|
1146
|
-
], WlcmSelectComponent);
|
|
1147
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: WlcmSelectComponent, decorators: [{
|
|
1140
|
+
], viewQueries: [{ propertyName: "matSelect", first: true, predicate: MatSelect, descendants: true, isSignal: true }, { propertyName: "matOptions", predicate: MatOption, descendants: true, isSignal: true }], hostDirectives: [{ directive: WlcmSelectInputBinderDirective }], ngImport: i0, template: "<mat-select\n #selectComponent\n [value]=\"value()\"\n [disabled]=\"disabled()\"\n [multiple]=\"multiple()\"\n [disableRipple]=\"true\"\n [placeholder]=\"placeholder()\"\n [hideSingleSelectionIndicator]=\"true\"\n [ngClass]=\"{ focused: selectComponent.focused }\"\n (selectionChange)=\"select($event)\"\n [compareWith]=\"compareWith\"\n (opened)=\"panelOpened()\"\n (closed)=\"panelClosed()\"\n >\n @if (triggerTemplate()) {\n <mat-select-trigger>\n <ng-container\n *ngTemplateOutlet=\"\n triggerTemplate()!;\n context: $any({ $implicit: selectComponent.selected })\n \"\n ></ng-container>\n </mat-select-trigger>\n }\n\n @for (option of prefilledOptions(); track option) {\n <mat-option\n [value]=\"selectOptionFormat() === 'CompleteOption' ? option : option.value\"\n >\n <ng-container\n [ngTemplateOutlet]=\"wlcmSelectOptionContent\"\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\n ></ng-container>\n </mat-option>\n }\n\n @for (option of computedOptions(); track option) {\n <mat-option\n [value]=\"selectOptionFormat() === 'CompleteOption' ? option : option.value\"\n >\n <ng-container\n [ngTemplateOutlet]=\"wlcmSelectOptionContent\"\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\n ></ng-container>\n </mat-option>\n }\n</mat-select>\n\n<div class=\"wlcm-select-arrow\">\n <ng-container\n [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"\n [wlcmIconStopPropagation]=\"false\"\n ></ng-container>\n</div>\n\n<ng-template #wlcmSelectOptionContent let-option>\n @if (optionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"optionTemplate(); context: $any({ $implicit: option })\"\n ></ng-container>\n } @else {\n {{ option.viewValue }}\n }\n</ng-template>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i3$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "directive", type: i3$1.MatSelectTrigger, selector: "mat-select-trigger" }, { kind: "component", type: i2.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: WlcmIconDirective, selector: "[wlcmIcon]", inputs: ["wlcmIcon", "wlcmIconStopPropagation"], outputs: ["wlcmIconClicked"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1141
|
+
}
|
|
1142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmSelectComponent, decorators: [{
|
|
1148
1143
|
type: Component,
|
|
1149
|
-
args: [{ selector: 'wlcm-select',
|
|
1144
|
+
args: [{ selector: 'wlcm-select', host: { class: 'wlcm-select', '(click)': 'openPanel()' }, imports: [CommonModule, MatSelectModule, ReactiveFormsModule, WlcmIconDirective], changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [WlcmSelectInputBinderDirective], providers: [
|
|
1150
1145
|
WLCM_FORM_CONTROL_PROVIDER,
|
|
1151
1146
|
{
|
|
1152
1147
|
provide: MAT_SELECT_CONFIG,
|
|
@@ -1157,43 +1152,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
1157
1152
|
},
|
|
1158
1153
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmSelectComponent), multi: true },
|
|
1159
1154
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmSelectComponent), multi: true },
|
|
1160
|
-
], template: "<mat-select\n #selectComponent\n [value]=\"value()\"\n [disabled]=\"disabled()\"\n [multiple]=\"multiple\"\n [disableRipple]=\"true\"\n [placeholder]=\"placeholder\"\n [hideSingleSelectionIndicator]=\"true\"\n [ngClass]=\"{ focused: selectComponent.focused }\"\n (selectionChange)=\"select($event)\"\n [compareWith]=\"compareWith\"\n (opened)=\"panelOpened()\"\n (closed)=\"panelClosed()\"\n>\n @if (triggerTemplate()) {\n <mat-select-trigger>\n <ng-container\n *ngTemplateOutlet=\"\n triggerTemplate()!;\n context: $any({ $implicit: selectComponent.selected })\n \"\n ></ng-container>\n </mat-select-trigger>\n }\n\n
|
|
1161
|
-
}], ctorParameters: () => [{ type: i0.
|
|
1162
|
-
type: Inject,
|
|
1163
|
-
args: [WLCM_FORM_FIELD]
|
|
1164
|
-
}] }, { type: undefined, decorators: [{
|
|
1165
|
-
type: Optional
|
|
1166
|
-
}, {
|
|
1167
|
-
type: Inject,
|
|
1168
|
-
args: [WLCM_FORM_CONTROL]
|
|
1169
|
-
}] }], propDecorators: { multiple: [{
|
|
1170
|
-
type: Input
|
|
1171
|
-
}], placeholder: [{
|
|
1172
|
-
type: Input
|
|
1173
|
-
}], fetchPaginatedOptions: [{
|
|
1174
|
-
type: Input
|
|
1175
|
-
}], canSelect: [{
|
|
1176
|
-
type: Input
|
|
1177
|
-
}], queryParams: [{
|
|
1178
|
-
type: Input
|
|
1179
|
-
}], matSelect: [{
|
|
1180
|
-
type: ViewChild,
|
|
1181
|
-
args: [MatSelect]
|
|
1182
|
-
}], openPanel: [{
|
|
1183
|
-
type: HostListener,
|
|
1184
|
-
args: ['click']
|
|
1185
|
-
}] } });
|
|
1155
|
+
], template: "<mat-select\n #selectComponent\n [value]=\"value()\"\n [disabled]=\"disabled()\"\n [multiple]=\"multiple()\"\n [disableRipple]=\"true\"\n [placeholder]=\"placeholder()\"\n [hideSingleSelectionIndicator]=\"true\"\n [ngClass]=\"{ focused: selectComponent.focused }\"\n (selectionChange)=\"select($event)\"\n [compareWith]=\"compareWith\"\n (opened)=\"panelOpened()\"\n (closed)=\"panelClosed()\"\n >\n @if (triggerTemplate()) {\n <mat-select-trigger>\n <ng-container\n *ngTemplateOutlet=\"\n triggerTemplate()!;\n context: $any({ $implicit: selectComponent.selected })\n \"\n ></ng-container>\n </mat-select-trigger>\n }\n\n @for (option of prefilledOptions(); track option) {\n <mat-option\n [value]=\"selectOptionFormat() === 'CompleteOption' ? option : option.value\"\n >\n <ng-container\n [ngTemplateOutlet]=\"wlcmSelectOptionContent\"\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\n ></ng-container>\n </mat-option>\n }\n\n @for (option of computedOptions(); track option) {\n <mat-option\n [value]=\"selectOptionFormat() === 'CompleteOption' ? option : option.value\"\n >\n <ng-container\n [ngTemplateOutlet]=\"wlcmSelectOptionContent\"\n [ngTemplateOutletContext]=\"{ $implicit: option }\"\n ></ng-container>\n </mat-option>\n }\n</mat-select>\n\n<div class=\"wlcm-select-arrow\">\n <ng-container\n [wlcmIcon]=\"WlcmIconName.CHEVRON_DOWN\"\n [wlcmIconStopPropagation]=\"false\"\n ></ng-container>\n</div>\n\n<ng-template #wlcmSelectOptionContent let-option>\n @if (optionTemplate()) {\n <ng-container\n *ngTemplateOutlet=\"optionTemplate(); context: $any({ $implicit: option })\"\n ></ng-container>\n } @else {\n {{ option.viewValue }}\n }\n</ng-template>\n" }]
|
|
1156
|
+
}], ctorParameters: () => [], propDecorators: { multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], fetchPaginatedOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "fetchPaginatedOptions", required: false }] }], canSelect: [{ type: i0.Input, args: [{ isSignal: true, alias: "canSelect", required: false }] }], queryParams: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryParams", required: false }] }], paginated: [{ type: i0.Input, args: [{ isSignal: true, alias: "paginated", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], selectOptionFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectOptionFormat", required: false }] }], optionTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionTemplate", required: false }] }], triggerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "triggerTemplate", required: false }] }], isOptionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "isOptionDisabled", required: false }] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }], matSelect: [{ type: i0.ViewChild, args: [i0.forwardRef(() => MatSelect), { isSignal: true }] }], matOptions: [{ type: i0.ViewChildren, args: [i0.forwardRef(() => MatOption), { isSignal: true }] }] } });
|
|
1186
1157
|
|
|
1187
1158
|
class WlcmFormFieldHintDirective {
|
|
1188
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1189
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
1159
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldHintDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1160
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: WlcmFormFieldHintDirective, isStandalone: true, selector: "[wlcmFormFieldHint]", host: { classAttribute: "wlcm-hint" }, ngImport: i0 }); }
|
|
1190
1161
|
}
|
|
1191
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldHintDirective, decorators: [{
|
|
1192
1163
|
type: Directive,
|
|
1193
1164
|
args: [{
|
|
1194
1165
|
selector: '[wlcmFormFieldHint]',
|
|
1195
1166
|
host: { class: 'wlcm-hint' },
|
|
1196
|
-
standalone: true,
|
|
1197
1167
|
}]
|
|
1198
1168
|
}] });
|
|
1199
1169
|
|
|
@@ -1214,8 +1184,8 @@ const components = [
|
|
|
1214
1184
|
WlcmLabelComponent,
|
|
1215
1185
|
];
|
|
1216
1186
|
class WlcmFormsModule {
|
|
1217
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1218
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
1187
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1188
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormsModule, imports: [WlcmFormFieldComponent,
|
|
1219
1189
|
WlcmAutocompleteComponent,
|
|
1220
1190
|
WlcmAutocompleteSuffixComponent,
|
|
1221
1191
|
WlcmCheckboxGroupComponent,
|
|
@@ -1236,9 +1206,12 @@ class WlcmFormsModule {
|
|
|
1236
1206
|
WlcmFormFieldSuffixDirective,
|
|
1237
1207
|
WlcmFormFieldPrefixDirective,
|
|
1238
1208
|
WlcmFormFieldHintDirective, MatRadioModule] }); }
|
|
1239
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
1209
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormsModule, providers: [{ provide: MAT_RADIO_DEFAULT_OPTIONS, useValue: { color: 'primary' } }], imports: [WlcmAutocompleteComponent,
|
|
1210
|
+
WlcmAutocompleteSuffixComponent,
|
|
1211
|
+
WlcmCheckboxComponent,
|
|
1212
|
+
WlcmSelectComponent, MatRadioModule, MatRadioModule] }); }
|
|
1240
1213
|
}
|
|
1241
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormsModule, decorators: [{
|
|
1242
1215
|
type: NgModule,
|
|
1243
1216
|
args: [{
|
|
1244
1217
|
imports: [...components, ...directives, MatRadioModule],
|