@wlcm/angular 19.2.6 → 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 +329 -500
- 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 +375 -401
- 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 +67 -85
- 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 +0 -3
- 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 -18
- 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 -37
- 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 -5
- 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 -19
- 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,32 +1,28 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { ChangeDetectionStrategy, Component, Injectable, InjectionToken, inject, Directive,
|
|
3
|
-
import {
|
|
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
4
|
import * as i3 from '@angular/forms';
|
|
5
|
-
import {
|
|
6
|
-
import * as i1 from '@angular/common';
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
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$2 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
|
|
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';
|
|
14
12
|
import * as i2 from '@angular/material/autocomplete';
|
|
15
|
-
import { MatAutocomplete, MatAutocompleteOrigin, MatAutocompleteModule,
|
|
16
|
-
import { RxLet } from '@rx-angular/template/let';
|
|
13
|
+
import { MatAutocomplete, MatAutocompleteTrigger, MatAutocompleteOrigin, MatAutocompleteModule, MAT_AUTOCOMPLETE_DEFAULT_OPTIONS } from '@angular/material/autocomplete';
|
|
17
14
|
import { cloneDeep, mergeWith } from 'lodash-es';
|
|
18
15
|
import * as i1$1 from '@angular/material/checkbox';
|
|
19
16
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
20
|
-
import { toObservable } from '@angular/core/rxjs-interop';
|
|
21
17
|
import { MatRadioModule, MAT_RADIO_DEFAULT_OPTIONS } from '@angular/material/radio';
|
|
22
18
|
|
|
23
19
|
class WlcmErrorComponent {
|
|
24
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
25
|
-
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 }); }
|
|
26
22
|
}
|
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmErrorComponent, decorators: [{
|
|
28
24
|
type: Component,
|
|
29
|
-
args: [{ selector: 'wlcm-error',
|
|
25
|
+
args: [{ selector: 'wlcm-error', imports: [], host: { class: 'wlcm-error' }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n" }]
|
|
30
26
|
}] });
|
|
31
27
|
|
|
32
28
|
class FormStateHandlerService {
|
|
@@ -37,10 +33,10 @@ class FormStateHandlerService {
|
|
|
37
33
|
updateFormState() {
|
|
38
34
|
this._stateChanges$.next();
|
|
39
35
|
}
|
|
40
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
41
|
-
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' }); }
|
|
42
38
|
}
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FormStateHandlerService, decorators: [{
|
|
44
40
|
type: Injectable,
|
|
45
41
|
args: [{ providedIn: 'root' }]
|
|
46
42
|
}] });
|
|
@@ -98,17 +94,17 @@ class WlcmDefaultPlacesApi {
|
|
|
98
94
|
get autocompleteService() {
|
|
99
95
|
return this._autocompleteService;
|
|
100
96
|
}
|
|
101
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
102
|
-
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 }); }
|
|
103
99
|
}
|
|
104
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmDefaultPlacesApi, decorators: [{
|
|
105
101
|
type: Injectable
|
|
106
102
|
}], ctorParameters: () => [] });
|
|
107
103
|
class WlcmPlacesApi {
|
|
108
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
109
|
-
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 }); }
|
|
110
106
|
}
|
|
111
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
107
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmPlacesApi, decorators: [{
|
|
112
108
|
type: Injectable,
|
|
113
109
|
args: [{
|
|
114
110
|
providedIn: 'root',
|
|
@@ -128,25 +124,24 @@ const WLCM_FORM_CONTROL_PROVIDER = {
|
|
|
128
124
|
};
|
|
129
125
|
|
|
130
126
|
class WlcmFormFieldCustomContainerDirective {
|
|
131
|
-
constructor(
|
|
132
|
-
this.elementRef =
|
|
127
|
+
constructor() {
|
|
128
|
+
this.elementRef = inject((ElementRef));
|
|
133
129
|
}
|
|
134
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
135
|
-
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 }); }
|
|
136
132
|
}
|
|
137
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldCustomContainerDirective, decorators: [{
|
|
138
134
|
type: Directive,
|
|
139
135
|
args: [{
|
|
140
136
|
selector: '[wlcmFormFieldCustomContainer]',
|
|
141
|
-
standalone: true,
|
|
142
137
|
}]
|
|
143
|
-
}]
|
|
138
|
+
}] });
|
|
144
139
|
|
|
145
140
|
class ErrorsMapperPipe {
|
|
146
|
-
constructor(
|
|
147
|
-
this.changeDetectorRef =
|
|
148
|
-
this.errors =
|
|
149
|
-
this.priorityErrors =
|
|
141
|
+
constructor() {
|
|
142
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
|
143
|
+
this.errors = inject(WLCM_ERRORS);
|
|
144
|
+
this.priorityErrors = inject(WLCM_PRIORITY_ERRORS);
|
|
150
145
|
this.destroy$ = new Subject();
|
|
151
146
|
this.currentError = null;
|
|
152
147
|
}
|
|
@@ -173,23 +168,16 @@ class ErrorsMapperPipe {
|
|
|
173
168
|
this.changeDetectorRef.markForCheck();
|
|
174
169
|
});
|
|
175
170
|
}
|
|
176
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
177
|
-
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 }); }
|
|
178
173
|
}
|
|
179
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ErrorsMapperPipe, decorators: [{
|
|
180
175
|
type: Pipe,
|
|
181
176
|
args: [{
|
|
182
177
|
name: 'errorsMapper',
|
|
183
|
-
standalone: true,
|
|
184
178
|
pure: false,
|
|
185
179
|
}]
|
|
186
|
-
}]
|
|
187
|
-
type: Inject,
|
|
188
|
-
args: [WLCM_ERRORS]
|
|
189
|
-
}] }, { type: Set, decorators: [{
|
|
190
|
-
type: Inject,
|
|
191
|
-
args: [WLCM_PRIORITY_ERRORS]
|
|
192
|
-
}] }] });
|
|
180
|
+
}] });
|
|
193
181
|
|
|
194
182
|
class WlcmFormFieldPrefixDirective {
|
|
195
183
|
constructor() {
|
|
@@ -197,14 +185,13 @@ class WlcmFormFieldPrefixDirective {
|
|
|
197
185
|
event.stopPropagation();
|
|
198
186
|
};
|
|
199
187
|
}
|
|
200
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
201
|
-
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 }); }
|
|
202
190
|
}
|
|
203
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldPrefixDirective, decorators: [{
|
|
204
192
|
type: Directive,
|
|
205
193
|
args: [{
|
|
206
194
|
selector: '[wlcmFormFieldPrefix]',
|
|
207
|
-
standalone: true,
|
|
208
195
|
}]
|
|
209
196
|
}], propDecorators: { handlerClick: [{
|
|
210
197
|
type: HostListener,
|
|
@@ -212,18 +199,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
212
199
|
}] } });
|
|
213
200
|
|
|
214
201
|
class WlcmFormFieldSuffixDirective {
|
|
215
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
216
|
-
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 }); }
|
|
217
204
|
}
|
|
218
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldSuffixDirective, decorators: [{
|
|
219
206
|
type: Directive,
|
|
220
207
|
args: [{
|
|
221
208
|
selector: '[wlcmFormFieldSuffix]',
|
|
222
|
-
standalone: true,
|
|
223
209
|
}]
|
|
224
210
|
}] });
|
|
225
211
|
|
|
226
|
-
|
|
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
|
+
}
|
|
227
232
|
get isFocused() {
|
|
228
233
|
return this.inputRef?.isFocused() ?? false;
|
|
229
234
|
}
|
|
@@ -239,13 +244,8 @@ let WlcmFormFieldComponent = class WlcmFormFieldComponent {
|
|
|
239
244
|
get isDisabled() {
|
|
240
245
|
return this.control?.disabled;
|
|
241
246
|
}
|
|
242
|
-
constructor(parentFormMember, changeDetectorRef) {
|
|
243
|
-
this.parentFormMember = parentFormMember;
|
|
244
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
245
|
-
this.displayErrorMessages = true;
|
|
246
|
-
}
|
|
247
247
|
ngAfterViewInit() {
|
|
248
|
-
if (!this.inputRef && !this.customContainer) {
|
|
248
|
+
if (!this.inputRef && !this.customContainer()) {
|
|
249
249
|
throw new Error('Input element should be bound to the wlcmInput directive.');
|
|
250
250
|
}
|
|
251
251
|
this.handleStateChanges();
|
|
@@ -256,10 +256,10 @@ let WlcmFormFieldComponent = class WlcmFormFieldComponent {
|
|
|
256
256
|
this.inputRef?.focus();
|
|
257
257
|
}
|
|
258
258
|
get control() {
|
|
259
|
-
return (this.controlContainer?.control || this.ngControl?.control) ?? null;
|
|
259
|
+
return (this.controlContainer()?.control || this.ngControl()?.control) ?? null;
|
|
260
260
|
}
|
|
261
261
|
get inputContainer() {
|
|
262
|
-
return this.customContainer?.elementRef || this.defaultContainer;
|
|
262
|
+
return this.customContainer()?.elementRef || this.defaultContainer();
|
|
263
263
|
}
|
|
264
264
|
handleStateChanges() {
|
|
265
265
|
const events = this.controlEvents;
|
|
@@ -267,11 +267,11 @@ let WlcmFormFieldComponent = class WlcmFormFieldComponent {
|
|
|
267
267
|
events.push(this.parentFormMember.stateChanges$);
|
|
268
268
|
}
|
|
269
269
|
merge(...events)
|
|
270
|
-
.pipe(
|
|
270
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
271
271
|
.subscribe(() => this.changeDetectorRef.markForCheck());
|
|
272
272
|
}
|
|
273
273
|
get inputRef() {
|
|
274
|
-
return this._inputRef?.get();
|
|
274
|
+
return this._inputRef()?.get();
|
|
275
275
|
}
|
|
276
276
|
get controlEvents() {
|
|
277
277
|
const events = [];
|
|
@@ -279,87 +279,50 @@ let WlcmFormFieldComponent = class WlcmFormFieldComponent {
|
|
|
279
279
|
events.push(this.inputRef.focus$, this.inputRef.blur$);
|
|
280
280
|
}
|
|
281
281
|
if (this.control) {
|
|
282
|
-
|
|
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);
|
|
283
286
|
}
|
|
284
287
|
return events;
|
|
285
288
|
}
|
|
286
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
287
|
-
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: [
|
|
288
291
|
WLCM_FORM_CONTROL_PROVIDER,
|
|
289
292
|
{ provide: WLCM_FORM_FIELD, useExisting: forwardRef(() => WlcmFormFieldComponent) },
|
|
290
|
-
], 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
|
|
291
|
-
}
|
|
292
|
-
WlcmFormFieldComponent
|
|
293
|
-
UntilDestroy(),
|
|
294
|
-
__metadata("design:paramtypes", [Object, ChangeDetectorRef])
|
|
295
|
-
], WlcmFormFieldComponent);
|
|
296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", 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: [{
|
|
297
296
|
type: Component,
|
|
298
|
-
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: [
|
|
299
305
|
WLCM_FORM_CONTROL_PROVIDER,
|
|
300
306
|
{ provide: WLCM_FORM_FIELD, useExisting: forwardRef(() => WlcmFormFieldComponent) },
|
|
301
|
-
], template: "<ng-content select=\"wlcm-label\"></ng-content>\n\n<ng-content select=\"[wlcmFormFieldCustomContainer]\"></ng-content>\n\n<div\n
|
|
302
|
-
}],
|
|
303
|
-
type: Optional
|
|
304
|
-
}, {
|
|
305
|
-
type: Inject,
|
|
306
|
-
args: [WLCM_FORM_CONTROL]
|
|
307
|
-
}] }, { type: i0.ChangeDetectorRef }], propDecorators: { displayErrorMessages: [{
|
|
308
|
-
type: Input
|
|
309
|
-
}], ngControl: [{
|
|
310
|
-
type: ContentChild,
|
|
311
|
-
args: [NgControl, { descendants: true }]
|
|
312
|
-
}], controlContainer: [{
|
|
313
|
-
type: ContentChild,
|
|
314
|
-
args: [ControlContainer, { descendants: true }]
|
|
315
|
-
}], _inputRef: [{
|
|
316
|
-
type: ContentChild,
|
|
317
|
-
args: [WLCM_INPUT]
|
|
318
|
-
}], prefix: [{
|
|
319
|
-
type: ContentChild,
|
|
320
|
-
args: [WlcmFormFieldPrefixDirective]
|
|
321
|
-
}], suffix: [{
|
|
322
|
-
type: ContentChild,
|
|
323
|
-
args: [WlcmFormFieldSuffixDirective]
|
|
324
|
-
}], customContainer: [{
|
|
325
|
-
type: ContentChild,
|
|
326
|
-
args: [WlcmFormFieldCustomContainerDirective]
|
|
327
|
-
}], defaultContainer: [{
|
|
328
|
-
type: ViewChild,
|
|
329
|
-
args: ['defaultContainer']
|
|
330
|
-
}], isFocused: [{
|
|
331
|
-
type: HostBinding,
|
|
332
|
-
args: ['class.wlcm-field-focused']
|
|
333
|
-
}], isRequired: [{
|
|
334
|
-
type: HostBinding,
|
|
335
|
-
args: ['class.wlcm-field-required']
|
|
336
|
-
}], isInvalid: [{
|
|
337
|
-
type: HostBinding,
|
|
338
|
-
args: ['class.wlcm-field-invalid']
|
|
339
|
-
}], isTouched: [{
|
|
340
|
-
type: HostBinding,
|
|
341
|
-
args: ['class.wlcm-field-touched']
|
|
342
|
-
}], isDisabled: [{
|
|
343
|
-
type: HostBinding,
|
|
344
|
-
args: ['class.wlcm-field-disabled']
|
|
345
|
-
}] } });
|
|
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 }] }] } });
|
|
346
309
|
|
|
347
310
|
const WLCM_FORM_FIELD_INPUT_CLASS = 'wlcm-form-field-input';
|
|
348
311
|
|
|
349
312
|
class WlcmInputDirective {
|
|
350
|
-
constructor(
|
|
351
|
-
this._elementRef =
|
|
313
|
+
constructor() {
|
|
314
|
+
this._elementRef = inject((ElementRef));
|
|
352
315
|
this.focus = () => this._elementRef.nativeElement.focus();
|
|
353
316
|
this.isFocused = () => this._elementRef.nativeElement === document.activeElement;
|
|
354
317
|
this.focus$ = fromEvent(this._elementRef.nativeElement, 'focus');
|
|
355
318
|
this.blur$ = fromEvent(this._elementRef.nativeElement, 'blur');
|
|
356
|
-
const element = _elementRef.nativeElement;
|
|
319
|
+
const element = this._elementRef.nativeElement;
|
|
357
320
|
if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
|
|
358
321
|
element.classList.add(WLCM_FORM_FIELD_INPUT_CLASS);
|
|
359
322
|
}
|
|
360
323
|
}
|
|
361
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
362
|
-
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: [
|
|
363
326
|
{
|
|
364
327
|
provide: WLCM_INPUT,
|
|
365
328
|
useFactory: () => {
|
|
@@ -370,7 +333,7 @@ class WlcmInputDirective {
|
|
|
370
333
|
},
|
|
371
334
|
], ngImport: i0 }); }
|
|
372
335
|
}
|
|
373
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmInputDirective, decorators: [{
|
|
374
337
|
type: Directive,
|
|
375
338
|
args: [{
|
|
376
339
|
selector: '[wlcmInput]',
|
|
@@ -384,56 +347,50 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
384
347
|
},
|
|
385
348
|
},
|
|
386
349
|
],
|
|
387
|
-
standalone: true,
|
|
388
350
|
}]
|
|
389
|
-
}], ctorParameters: () => [
|
|
351
|
+
}], ctorParameters: () => [] });
|
|
390
352
|
|
|
391
353
|
class WlcmLabelComponent {
|
|
392
354
|
constructor() {
|
|
393
|
-
this.required = false
|
|
355
|
+
this.required = input(false, /* @ts-ignore */
|
|
356
|
+
...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
394
357
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
}
|
|
398
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.9", ngImport: i0, type: WlcmLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
399
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.9", 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 }); }
|
|
400
360
|
}
|
|
401
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmLabelComponent, decorators: [{
|
|
402
362
|
type: Component,
|
|
403
|
-
args: [{ selector: 'wlcm-label',
|
|
404
|
-
}], propDecorators: { required: [{
|
|
405
|
-
type: Input
|
|
406
|
-
}], isRequired: [{
|
|
407
|
-
type: HostBinding,
|
|
408
|
-
args: ['class.required']
|
|
409
|
-
}] } });
|
|
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 }] }] } });
|
|
410
365
|
|
|
411
|
-
|
|
412
|
-
constructor(
|
|
413
|
-
this.
|
|
414
|
-
this.autocomplete = autocomplete;
|
|
415
|
-
this.panelScrolled = new EventEmitter();
|
|
366
|
+
class AutocompleteDirective {
|
|
367
|
+
constructor() {
|
|
368
|
+
this.panelScrolled = output();
|
|
416
369
|
this._scrollHeight = 0;
|
|
417
370
|
this._scrollHeightChanged = false;
|
|
371
|
+
this.autocomplete = inject(MatAutocomplete, { host: true, optional: true });
|
|
372
|
+
this.destroyRef = inject(DestroyRef);
|
|
418
373
|
this.handleOpenEvent();
|
|
419
374
|
}
|
|
420
375
|
handleOpenEvent() {
|
|
421
376
|
this.autocomplete.opened
|
|
422
|
-
.pipe(
|
|
423
|
-
.
|
|
424
|
-
.subscribe(() => this.zone.runOutsideAngular(() => this.handleScrolling()));
|
|
377
|
+
.pipe(observeOn(asyncScheduler), takeUntilDestroyed(this.destroyRef))
|
|
378
|
+
.subscribe(() => this.handleScrolling());
|
|
425
379
|
}
|
|
426
380
|
handleScrolling() {
|
|
427
381
|
const panel = this.autocomplete.panel.nativeElement;
|
|
428
382
|
this.setScrollHscrollHeight(panel.scrollHeight);
|
|
429
|
-
|
|
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 })
|
|
430
387
|
.pipe(takeUntil(this.autocomplete.closed))
|
|
431
388
|
.subscribe(() => {
|
|
432
389
|
if (this._scrollHeight !== panel.scrollHeight) {
|
|
433
390
|
this.setScrollHscrollHeight(panel.scrollHeight);
|
|
434
391
|
}
|
|
435
392
|
if (panel.scrollHeight * 0.8 <= panel.scrollTop + panel.clientHeight && this._scrollHeightChanged) {
|
|
436
|
-
this.
|
|
393
|
+
this.panelScrolled.emit();
|
|
437
394
|
this._scrollHeightChanged = false;
|
|
438
395
|
}
|
|
439
396
|
});
|
|
@@ -442,66 +399,78 @@ let AutocompleteDirective = class AutocompleteDirective {
|
|
|
442
399
|
this._scrollHeight = height;
|
|
443
400
|
this._scrollHeightChanged = true;
|
|
444
401
|
}
|
|
445
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
446
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
447
|
-
}
|
|
448
|
-
AutocompleteDirective
|
|
449
|
-
UntilDestroy(),
|
|
450
|
-
__metadata("design:paramtypes", [NgZone,
|
|
451
|
-
MatAutocomplete])
|
|
452
|
-
], AutocompleteDirective);
|
|
453
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", 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: [{
|
|
454
406
|
type: Directive,
|
|
455
407
|
args: [{
|
|
456
408
|
selector: '[wlcmAutocomplete]',
|
|
457
|
-
standalone: true,
|
|
458
409
|
}]
|
|
459
|
-
}], ctorParameters: () => [
|
|
460
|
-
type: Host
|
|
461
|
-
}, {
|
|
462
|
-
type: Optional
|
|
463
|
-
}] }], propDecorators: { panelScrolled: [{
|
|
464
|
-
type: Output
|
|
465
|
-
}] } });
|
|
410
|
+
}], ctorParameters: () => [], propDecorators: { panelScrolled: [{ type: i0.Output, args: ["panelScrolled"] }] } });
|
|
466
411
|
|
|
467
412
|
class WlcmAutocomplete {
|
|
468
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
469
|
-
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 }); }
|
|
470
415
|
}
|
|
471
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
416
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmAutocomplete, decorators: [{
|
|
472
417
|
type: Directive
|
|
473
418
|
}] });
|
|
474
419
|
|
|
475
420
|
const PANEL_CLASS$1 = 'wlcm-autocomplete-panel';
|
|
476
|
-
|
|
477
|
-
constructor(
|
|
421
|
+
class WlcmAutocompleteComponent extends WlcmAutocomplete {
|
|
422
|
+
constructor() {
|
|
478
423
|
super();
|
|
479
|
-
this.
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
this.
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
});
|
|
487
|
-
this.
|
|
488
|
-
|
|
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 */ []));
|
|
489
447
|
this.selected = output();
|
|
490
448
|
this.control = new FormControl('');
|
|
491
449
|
this._loadMore$ = new Subject();
|
|
492
|
-
this.
|
|
493
|
-
|
|
450
|
+
this.options = signal([], /* @ts-ignore */
|
|
451
|
+
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
494
452
|
this.closed$ = new Subject();
|
|
495
453
|
this._focusStream$ = new BehaviorSubject(EMPTY);
|
|
496
454
|
this._blurStream$ = new BehaviorSubject(EMPTY);
|
|
497
|
-
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);
|
|
498
460
|
this.focus$ = this._focusStream$.pipe(switchMap((stream) => stream));
|
|
499
461
|
this.blur$ = this._blurStream$.pipe(switchMap((stream) => stream));
|
|
500
|
-
this.loading$ = this._loading$.asObservable();
|
|
501
462
|
this.adjustedValue$ = new BehaviorSubject(null);
|
|
502
463
|
this._paginatedData = null;
|
|
503
464
|
this._reloadOptions$ = new Subject();
|
|
504
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);
|
|
505
474
|
this.handleLoadMoreEvent();
|
|
506
475
|
this.handleControlValueChanges();
|
|
507
476
|
this.handleAdjustedValue();
|
|
@@ -511,9 +480,16 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
511
480
|
}
|
|
512
481
|
ngAfterViewInit() {
|
|
513
482
|
this.viewReady$.next();
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
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
|
+
}
|
|
517
493
|
this.attachFocusBlurListeners();
|
|
518
494
|
}
|
|
519
495
|
displayWith(value) {
|
|
@@ -523,10 +499,10 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
523
499
|
return value;
|
|
524
500
|
}
|
|
525
501
|
focus() {
|
|
526
|
-
this.inputElement
|
|
502
|
+
this.inputElement()?.nativeElement.focus();
|
|
527
503
|
}
|
|
528
504
|
isFocused() {
|
|
529
|
-
return this.inputElement?.nativeElement === document.activeElement || this.autocomplete?.isOpen;
|
|
505
|
+
return this.inputElement()?.nativeElement === document.activeElement || (this.autocomplete()?.isOpen ?? false);
|
|
530
506
|
}
|
|
531
507
|
loadMore() {
|
|
532
508
|
this._loadMore$.next();
|
|
@@ -551,9 +527,12 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
551
527
|
this._reloadOptions$.next();
|
|
552
528
|
}
|
|
553
529
|
blured() {
|
|
554
|
-
|
|
530
|
+
const autocomplete = this.autocomplete();
|
|
531
|
+
if (!autocomplete)
|
|
532
|
+
return;
|
|
533
|
+
if (!autocomplete.isOpen)
|
|
555
534
|
this._touched?.();
|
|
556
|
-
|
|
535
|
+
autocomplete.closed.pipe(take(1)).subscribe(() => this._touched?.());
|
|
557
536
|
}
|
|
558
537
|
validate(control) {
|
|
559
538
|
if (this.control.value) {
|
|
@@ -573,24 +552,24 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
573
552
|
return value;
|
|
574
553
|
}
|
|
575
554
|
loadOptions(query = '') {
|
|
576
|
-
this.
|
|
577
|
-
this.
|
|
578
|
-
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) => {
|
|
579
558
|
this._paginatedData = paginatedData;
|
|
580
|
-
this.
|
|
581
|
-
this.
|
|
559
|
+
this.options.set(paginatedData.data);
|
|
560
|
+
this.loading.set(false);
|
|
582
561
|
}));
|
|
583
562
|
}
|
|
584
563
|
handleLoadMoreEvent() {
|
|
585
564
|
this._loadMore$
|
|
586
565
|
.pipe(concatMap(() => {
|
|
587
566
|
if (this._paginatedData && this._paginatedData.currPage + 1 <= this._paginatedData.totalPages) {
|
|
588
|
-
this.
|
|
589
|
-
this.
|
|
590
|
-
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) => {
|
|
591
570
|
this._paginatedData = paginatedData;
|
|
592
|
-
this.
|
|
593
|
-
this.
|
|
571
|
+
this.options.update((options) => [...options, ...paginatedData.data]);
|
|
572
|
+
this.loading.set(false);
|
|
594
573
|
}));
|
|
595
574
|
}
|
|
596
575
|
return EMPTY;
|
|
@@ -599,7 +578,7 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
599
578
|
}
|
|
600
579
|
handleControlValueChanges() {
|
|
601
580
|
merge(this.control.valueChanges, this._reloadOptions$.pipe(map(() => this.control.value)))
|
|
602
|
-
.pipe(
|
|
581
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
603
582
|
.pipe(filter((value) => {
|
|
604
583
|
let _value = value ?? '';
|
|
605
584
|
if (value instanceof Object && this.selectOptionFormat() === 'ValueOnly')
|
|
@@ -612,10 +591,14 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
612
591
|
.subscribe();
|
|
613
592
|
}
|
|
614
593
|
attachFocusBlurListeners() {
|
|
615
|
-
const
|
|
616
|
-
const
|
|
617
|
-
|
|
618
|
-
|
|
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];
|
|
619
602
|
this._focusStream$.next(merge(...focusObservables).pipe(map(() => undefined)));
|
|
620
603
|
this._blurStream$.next(merge(...blurObservables).pipe(map(() => this.control?.markAsTouched())));
|
|
621
604
|
}
|
|
@@ -624,8 +607,8 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
624
607
|
.pipe(switchMap(() => this.adjustedValue$.pipe(filter(Boolean))))
|
|
625
608
|
.subscribe((value) => this._changed?.(value));
|
|
626
609
|
}
|
|
627
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
628
|
-
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: [
|
|
629
612
|
{ provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, useValue: { overlayPanelClass: PANEL_CLASS$1 } },
|
|
630
613
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmAutocompleteComponent), multi: true },
|
|
631
614
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmAutocompleteComponent), multi: true },
|
|
@@ -636,15 +619,11 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
|
636
619
|
return { bind: () => autocomplete };
|
|
637
620
|
},
|
|
638
621
|
},
|
|
639
|
-
], 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
|
|
640
|
-
}
|
|
641
|
-
WlcmAutocompleteComponent
|
|
642
|
-
UntilDestroy(),
|
|
643
|
-
__metadata("design:paramtypes", [Injector, Object])
|
|
644
|
-
], WlcmAutocompleteComponent);
|
|
645
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", 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: [{
|
|
646
625
|
type: Component,
|
|
647
|
-
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: [
|
|
648
627
|
{ provide: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS, useValue: { overlayPanelClass: PANEL_CLASS$1 } },
|
|
649
628
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmAutocompleteComponent), multi: true },
|
|
650
629
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmAutocompleteComponent), multi: true },
|
|
@@ -655,40 +634,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
655
634
|
return { bind: () => autocomplete };
|
|
656
635
|
},
|
|
657
636
|
},
|
|
658
|
-
], 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
|
|
659
|
-
}], ctorParameters: () => [{ type: i0.
|
|
660
|
-
type: Inject,
|
|
661
|
-
args: [WLCM_FORM_FIELD]
|
|
662
|
-
}] }], propDecorators: { fetchPaginatedOptions: [{
|
|
663
|
-
type: Input
|
|
664
|
-
}], label: [{
|
|
665
|
-
type: Input
|
|
666
|
-
}], required: [{
|
|
667
|
-
type: Input
|
|
668
|
-
}], placeholder: [{
|
|
669
|
-
type: Input
|
|
670
|
-
}], optionTemplate: [{
|
|
671
|
-
type: Input
|
|
672
|
-
}], queryParams: [{
|
|
673
|
-
type: Input,
|
|
674
|
-
args: [{ transform: (params) => cloneDeep(params) }]
|
|
675
|
-
}], inputElement: [{
|
|
676
|
-
type: ViewChild,
|
|
677
|
-
args: [WLCM_INPUT, { read: ElementRef }]
|
|
678
|
-
}], autocompleteTrigger: [{
|
|
679
|
-
type: ViewChild,
|
|
680
|
-
args: [MatAutocompleteTrigger]
|
|
681
|
-
}], autocomplete: [{
|
|
682
|
-
type: ViewChild,
|
|
683
|
-
args: [MatAutocomplete]
|
|
684
|
-
}] } });
|
|
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 }] }] } });
|
|
685
639
|
|
|
686
|
-
|
|
687
|
-
constructor(
|
|
688
|
-
this.changeDetectorRef =
|
|
689
|
-
this.parentFormMember =
|
|
690
|
-
this.
|
|
691
|
-
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();
|
|
692
648
|
this.control = new FormControl(false);
|
|
693
649
|
this.validate = () => null;
|
|
694
650
|
if (this.parentFormMember) {
|
|
@@ -725,45 +681,38 @@ let WlcmCheckboxComponent = class WlcmCheckboxComponent {
|
|
|
725
681
|
this.control.setValue(value);
|
|
726
682
|
}
|
|
727
683
|
handleStateChange() {
|
|
728
|
-
this.parentFormMember.stateChanges$.pipe(
|
|
684
|
+
this.parentFormMember.stateChanges$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
729
685
|
this._validatorChanged?.();
|
|
730
686
|
this.changeDetectorRef.markForCheck();
|
|
731
687
|
});
|
|
732
688
|
}
|
|
733
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
734
|
-
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: [
|
|
735
691
|
WLCM_FORM_CONTROL_PROVIDER,
|
|
736
692
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmCheckboxComponent), multi: true },
|
|
737
693
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmCheckboxComponent), multi: true },
|
|
738
|
-
], ngImport: i0, template: "<mat-checkbox [formControl]=\"control\" (change)=\"handleChange($event)\">\n <ng-content></ng-content>\n</mat-checkbox>\n", styles: [""], dependencies: [{ kind: "ngmodule", type:
|
|
739
|
-
}
|
|
740
|
-
WlcmCheckboxComponent
|
|
741
|
-
UntilDestroy(),
|
|
742
|
-
__metadata("design:paramtypes", [ChangeDetectorRef, Object])
|
|
743
|
-
], WlcmCheckboxComponent);
|
|
744
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", 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: [{
|
|
745
697
|
type: Component,
|
|
746
|
-
args: [{ selector: 'wlcm-checkbox', host: { class: 'wlcm-checkbox' },
|
|
698
|
+
args: [{ selector: 'wlcm-checkbox', host: { class: 'wlcm-checkbox' }, imports: [MatCheckboxModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
747
699
|
WLCM_FORM_CONTROL_PROVIDER,
|
|
748
700
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmCheckboxComponent), multi: true },
|
|
749
701
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmCheckboxComponent), multi: true },
|
|
750
702
|
], template: "<mat-checkbox [formControl]=\"control\" (change)=\"handleChange($event)\">\n <ng-content></ng-content>\n</mat-checkbox>\n" }]
|
|
751
|
-
}], ctorParameters: () => [{ type: i0.
|
|
752
|
-
type: Optional
|
|
753
|
-
}, {
|
|
754
|
-
type: Inject,
|
|
755
|
-
args: [WLCM_FORM_CONTROL]
|
|
756
|
-
}] }], propDecorators: { changed: [{
|
|
757
|
-
type: Output
|
|
758
|
-
}] } });
|
|
703
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
759
704
|
|
|
760
|
-
|
|
705
|
+
class WlcmCheckboxGroupComponent {
|
|
761
706
|
constructor() {
|
|
762
|
-
this.
|
|
707
|
+
this.destroyRef = inject(DestroyRef);
|
|
708
|
+
this.checkboxes = contentChildren(WlcmCheckboxComponent, /* @ts-ignore */
|
|
709
|
+
...(ngDevMode ? [{ debugName: "checkboxes" }] : /* istanbul ignore next */ []));
|
|
763
710
|
this.checkboxesMap = computed(() => {
|
|
764
711
|
return new Map(this.checkboxes().map((checkbox) => [checkbox.value(), checkbox]));
|
|
765
|
-
}
|
|
766
|
-
|
|
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 */ []));
|
|
767
716
|
this.checkboxesListUpdated = new Subject();
|
|
768
717
|
this.validate = () => null;
|
|
769
718
|
effect(() => this.handleCheckboxesToggle(this.checkboxes()));
|
|
@@ -810,47 +759,44 @@ let WlcmCheckboxGroupComponent = class WlcmCheckboxGroupComponent {
|
|
|
810
759
|
});
|
|
811
760
|
};
|
|
812
761
|
const changeHandlers = Array.from(checkboxes.values()).map((checkbox) => {
|
|
813
|
-
return checkbox.changed
|
|
762
|
+
return outputToObservable(checkbox.changed).pipe(tap(() => handleCheck(checkbox)));
|
|
814
763
|
});
|
|
815
764
|
merge(...changeHandlers)
|
|
816
|
-
.pipe(
|
|
765
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
817
766
|
.pipe(takeUntil(this.checkboxesListUpdated))
|
|
818
767
|
.subscribe();
|
|
819
768
|
}
|
|
820
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
821
|
-
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: [
|
|
822
771
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmCheckboxGroupComponent), multi: true },
|
|
823
772
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmCheckboxGroupComponent), multi: true },
|
|
824
|
-
], queries: [{ propertyName: "checkboxes", predicate: WlcmCheckboxComponent, isSignal: true }], ngImport: i0, template: "<ng-content select=\"wlcm-checkbox\"></ng-content>\n", styles: [""],
|
|
825
|
-
}
|
|
826
|
-
WlcmCheckboxGroupComponent
|
|
827
|
-
UntilDestroy(),
|
|
828
|
-
__metadata("design:paramtypes", [])
|
|
829
|
-
], WlcmCheckboxGroupComponent);
|
|
830
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", 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: [{
|
|
831
776
|
type: Component,
|
|
832
|
-
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: [
|
|
833
778
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmCheckboxGroupComponent), multi: true },
|
|
834
779
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmCheckboxGroupComponent), multi: true },
|
|
835
780
|
], template: "<ng-content select=\"wlcm-checkbox\"></ng-content>\n" }]
|
|
836
|
-
}], ctorParameters: () => [] });
|
|
781
|
+
}], ctorParameters: () => [], propDecorators: { checkboxes: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => WlcmCheckboxComponent), { isSignal: true }] }] } });
|
|
837
782
|
|
|
838
783
|
class WlcmAutocompleteSuffixComponent {
|
|
839
784
|
constructor() {
|
|
840
|
-
this.autocomplete = input.required(
|
|
785
|
+
this.autocomplete = input.required(/* @ts-ignore */
|
|
786
|
+
...(ngDevMode ? [{ debugName: "autocomplete" }] : /* istanbul ignore next */ []));
|
|
841
787
|
this.WlcmIconName = WlcmIconName;
|
|
842
788
|
}
|
|
843
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
844
|
-
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 }); }
|
|
845
791
|
}
|
|
846
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
792
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmAutocompleteSuffixComponent, decorators: [{
|
|
847
793
|
type: Component,
|
|
848
|
-
args: [{ selector: 'wlcm-autocomplete-suffix', host: { class: 'wlcm-autocomplete-suffix' },
|
|
849
|
-
}] });
|
|
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 }] }] } });
|
|
850
796
|
|
|
851
797
|
class WlcmSelectInputBinderDirective {
|
|
852
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
853
|
-
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: [
|
|
854
800
|
{
|
|
855
801
|
provide: WLCM_INPUT_BINDER,
|
|
856
802
|
useFactory: () => {
|
|
@@ -860,10 +806,9 @@ class WlcmSelectInputBinderDirective {
|
|
|
860
806
|
},
|
|
861
807
|
], ngImport: i0 }); }
|
|
862
808
|
}
|
|
863
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmSelectInputBinderDirective, decorators: [{
|
|
864
810
|
type: Directive,
|
|
865
811
|
args: [{
|
|
866
|
-
standalone: true,
|
|
867
812
|
selector: '[wlcmSelectInputBinder]',
|
|
868
813
|
providers: [
|
|
869
814
|
{
|
|
@@ -886,45 +831,60 @@ const mergeConfig = (config) => {
|
|
|
886
831
|
};
|
|
887
832
|
return mergeWith({ ...DEFAULT_CONFIG }, config, customizer);
|
|
888
833
|
};
|
|
889
|
-
|
|
834
|
+
class WlcmSelectComponent {
|
|
890
835
|
openPanel() {
|
|
891
|
-
this.matSelect
|
|
892
|
-
}
|
|
893
|
-
constructor(
|
|
894
|
-
this.
|
|
895
|
-
|
|
896
|
-
this.
|
|
897
|
-
|
|
898
|
-
this.
|
|
899
|
-
|
|
900
|
-
this.
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
this.
|
|
907
|
-
|
|
908
|
-
this.
|
|
909
|
-
|
|
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 */ []));
|
|
910
869
|
this.selectionChange = output();
|
|
911
870
|
this.opened = output();
|
|
912
871
|
this.closed = output();
|
|
913
|
-
this.value = signal(null
|
|
914
|
-
|
|
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 */ []));
|
|
915
876
|
this.WlcmIconName = WlcmIconName;
|
|
916
877
|
this._paginatedData = null;
|
|
917
878
|
this._previousValue = null;
|
|
918
879
|
this._optionsCache = new Set();
|
|
919
|
-
this.computedOptions = computed(() =>
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
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 */ []));
|
|
928
888
|
this._focusStream$ = new BehaviorSubject(EMPTY);
|
|
929
889
|
this._blurStream$ = new BehaviorSubject(EMPTY);
|
|
930
890
|
this.focus$ = this._focusStream$.pipe(switchMap((stream) => stream));
|
|
@@ -932,6 +892,11 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
932
892
|
this.adjustedValue$ = new BehaviorSubject(null);
|
|
933
893
|
this.viewReady$ = new Subject();
|
|
934
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);
|
|
935
900
|
this.compareWith = (optionA, optionB) => {
|
|
936
901
|
if (this.areOptionsEqual(optionA, optionB)) {
|
|
937
902
|
if (this.selectOptionFormat() === 'CompleteOption' && typeof optionB !== 'object') {
|
|
@@ -941,14 +906,24 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
941
906
|
}
|
|
942
907
|
return false;
|
|
943
908
|
};
|
|
944
|
-
this.focus = () => this.matSelect
|
|
909
|
+
this.focus = () => this.matSelect()?.open();
|
|
945
910
|
this.isFocused = () => this.isOpen;
|
|
946
911
|
if (this.parentFormMember) {
|
|
947
912
|
this.handleStateChange();
|
|
948
913
|
}
|
|
949
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
|
+
});
|
|
950
925
|
toObservable(this.paginated)
|
|
951
|
-
.pipe(
|
|
926
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
952
927
|
.subscribe((paginated) => {
|
|
953
928
|
if (paginated)
|
|
954
929
|
this.loadPaginatedOptions();
|
|
@@ -956,15 +931,36 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
956
931
|
}
|
|
957
932
|
ngAfterViewInit() {
|
|
958
933
|
this.viewReady$.next();
|
|
959
|
-
|
|
960
|
-
|
|
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);
|
|
961
940
|
}
|
|
962
|
-
|
|
963
|
-
|
|
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;
|
|
964
958
|
}
|
|
965
959
|
select(event) {
|
|
966
960
|
this.selected$.next();
|
|
967
|
-
|
|
961
|
+
const matSelect = this.matSelect();
|
|
962
|
+
if (matSelect)
|
|
963
|
+
matSelect.value = event.value;
|
|
968
964
|
this.validateSelectedOption(event.value)
|
|
969
965
|
.pipe(takeUntil(this.selected$))
|
|
970
966
|
.subscribe((canSelect) => {
|
|
@@ -980,7 +976,9 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
980
976
|
return (optionA?.value || optionA) === (optionB?.value || optionB);
|
|
981
977
|
}
|
|
982
978
|
revertPreviousValue() {
|
|
983
|
-
|
|
979
|
+
const matSelect = this.matSelect();
|
|
980
|
+
if (matSelect)
|
|
981
|
+
matSelect.value = this._previousValue;
|
|
984
982
|
}
|
|
985
983
|
updateValue(value) {
|
|
986
984
|
this.value.set(value);
|
|
@@ -988,7 +986,7 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
988
986
|
}
|
|
989
987
|
validateSelectedOption(value) {
|
|
990
988
|
return new Observable((observer) => {
|
|
991
|
-
const response = this.canSelect(value);
|
|
989
|
+
const response = this.canSelect()(value);
|
|
992
990
|
const source = response instanceof Observable ? response.pipe(first()) : of(response);
|
|
993
991
|
source.subscribe((result) => {
|
|
994
992
|
observer.next(result);
|
|
@@ -1031,7 +1029,7 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
1031
1029
|
return null;
|
|
1032
1030
|
}
|
|
1033
1031
|
get isOpen() {
|
|
1034
|
-
return this.matSelect?.panelOpen ?? false;
|
|
1032
|
+
return this.matSelect()?.panelOpen ?? false;
|
|
1035
1033
|
}
|
|
1036
1034
|
prepareValueForPatch(value) {
|
|
1037
1035
|
const formatedValue = this.formatValue(value);
|
|
@@ -1061,9 +1059,9 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
1061
1059
|
return { changed: false, value };
|
|
1062
1060
|
}
|
|
1063
1061
|
loadPaginatedOptions() {
|
|
1064
|
-
this.
|
|
1065
|
-
this.fetchPaginatedOptions(this.
|
|
1066
|
-
.pipe(
|
|
1062
|
+
this._queryParams.update((params) => ({ ...params, page: 1 }));
|
|
1063
|
+
this.fetchPaginatedOptions()(this._queryParams())
|
|
1064
|
+
.pipe(takeUntilDestroyed(this.destroyRef), first())
|
|
1067
1065
|
.subscribe((paginatedData) => {
|
|
1068
1066
|
this._optionsCache.clear();
|
|
1069
1067
|
this.cacheOptions(paginatedData.data);
|
|
@@ -1074,9 +1072,9 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
1074
1072
|
loadMorePaginatedOptions() {
|
|
1075
1073
|
if (!this._paginatedData || this._paginatedData.currPage + 1 > this._paginatedData.totalPages)
|
|
1076
1074
|
return;
|
|
1077
|
-
this.
|
|
1078
|
-
this.fetchPaginatedOptions({ ...this.
|
|
1079
|
-
.pipe(
|
|
1075
|
+
this._queryParams.update((params) => ({ ...params, page: params.page + 1 }));
|
|
1076
|
+
this.fetchPaginatedOptions()({ ...this._queryParams() })
|
|
1077
|
+
.pipe(takeUntilDestroyed(this.destroyRef), first())
|
|
1080
1078
|
.subscribe((paginatedData) => {
|
|
1081
1079
|
this.cacheOptions(paginatedData.data);
|
|
1082
1080
|
this._paginatedData = paginatedData;
|
|
@@ -1105,15 +1103,19 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
1105
1103
|
this.prefilledOptions.set(prefilledOptions);
|
|
1106
1104
|
}
|
|
1107
1105
|
handleScrollDown() {
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
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());
|
|
1114
1116
|
}
|
|
1115
1117
|
handleStateChange() {
|
|
1116
|
-
this.parentFormMember.stateChanges$.pipe(
|
|
1118
|
+
this.parentFormMember.stateChanges$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
1117
1119
|
this._validatorChanged?.();
|
|
1118
1120
|
this.changeDetectorRef.markForCheck();
|
|
1119
1121
|
});
|
|
@@ -1123,8 +1125,8 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
1123
1125
|
.pipe(switchMap(() => this.adjustedValue$.pipe(filter(Boolean))))
|
|
1124
1126
|
.subscribe((value) => this._changed?.(value));
|
|
1125
1127
|
}
|
|
1126
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1127
|
-
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: [
|
|
1128
1130
|
WLCM_FORM_CONTROL_PROVIDER,
|
|
1129
1131
|
{
|
|
1130
1132
|
provide: MAT_SELECT_CONFIG,
|
|
@@ -1135,17 +1137,11 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
|
1135
1137
|
},
|
|
1136
1138
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmSelectComponent), multi: true },
|
|
1137
1139
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmSelectComponent), multi: true },
|
|
1138
|
-
], viewQueries: [{ propertyName: "
|
|
1139
|
-
}
|
|
1140
|
-
WlcmSelectComponent
|
|
1141
|
-
UntilDestroy(),
|
|
1142
|
-
__metadata("design:paramtypes", [NgZone,
|
|
1143
|
-
ChangeDetectorRef,
|
|
1144
|
-
ScrollDetectionApi, Object, Object])
|
|
1145
|
-
], WlcmSelectComponent);
|
|
1146
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", 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: [{
|
|
1147
1143
|
type: Component,
|
|
1148
|
-
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: [
|
|
1149
1145
|
WLCM_FORM_CONTROL_PROVIDER,
|
|
1150
1146
|
{
|
|
1151
1147
|
provide: MAT_SELECT_CONFIG,
|
|
@@ -1156,43 +1152,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
|
|
|
1156
1152
|
},
|
|
1157
1153
|
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => WlcmSelectComponent), multi: true },
|
|
1158
1154
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => WlcmSelectComponent), multi: true },
|
|
1159
|
-
], 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
|
|
1160
|
-
}], ctorParameters: () => [{ type: i0.
|
|
1161
|
-
type: Inject,
|
|
1162
|
-
args: [WLCM_FORM_FIELD]
|
|
1163
|
-
}] }, { type: undefined, decorators: [{
|
|
1164
|
-
type: Optional
|
|
1165
|
-
}, {
|
|
1166
|
-
type: Inject,
|
|
1167
|
-
args: [WLCM_FORM_CONTROL]
|
|
1168
|
-
}] }], propDecorators: { multiple: [{
|
|
1169
|
-
type: Input
|
|
1170
|
-
}], placeholder: [{
|
|
1171
|
-
type: Input
|
|
1172
|
-
}], fetchPaginatedOptions: [{
|
|
1173
|
-
type: Input
|
|
1174
|
-
}], canSelect: [{
|
|
1175
|
-
type: Input
|
|
1176
|
-
}], queryParams: [{
|
|
1177
|
-
type: Input
|
|
1178
|
-
}], matSelect: [{
|
|
1179
|
-
type: ViewChild,
|
|
1180
|
-
args: [MatSelect]
|
|
1181
|
-
}], openPanel: [{
|
|
1182
|
-
type: HostListener,
|
|
1183
|
-
args: ['click']
|
|
1184
|
-
}] } });
|
|
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 }] }] } });
|
|
1185
1157
|
|
|
1186
1158
|
class WlcmFormFieldHintDirective {
|
|
1187
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1188
|
-
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 }); }
|
|
1189
1161
|
}
|
|
1190
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormFieldHintDirective, decorators: [{
|
|
1191
1163
|
type: Directive,
|
|
1192
1164
|
args: [{
|
|
1193
1165
|
selector: '[wlcmFormFieldHint]',
|
|
1194
1166
|
host: { class: 'wlcm-hint' },
|
|
1195
|
-
standalone: true,
|
|
1196
1167
|
}]
|
|
1197
1168
|
}] });
|
|
1198
1169
|
|
|
@@ -1213,8 +1184,8 @@ const components = [
|
|
|
1213
1184
|
WlcmLabelComponent,
|
|
1214
1185
|
];
|
|
1215
1186
|
class WlcmFormsModule {
|
|
1216
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1217
|
-
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,
|
|
1218
1189
|
WlcmAutocompleteComponent,
|
|
1219
1190
|
WlcmAutocompleteSuffixComponent,
|
|
1220
1191
|
WlcmCheckboxGroupComponent,
|
|
@@ -1235,9 +1206,12 @@ class WlcmFormsModule {
|
|
|
1235
1206
|
WlcmFormFieldSuffixDirective,
|
|
1236
1207
|
WlcmFormFieldPrefixDirective,
|
|
1237
1208
|
WlcmFormFieldHintDirective, MatRadioModule] }); }
|
|
1238
|
-
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] }); }
|
|
1239
1213
|
}
|
|
1240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: WlcmFormsModule, decorators: [{
|
|
1241
1215
|
type: NgModule,
|
|
1242
1216
|
args: [{
|
|
1243
1217
|
imports: [...components, ...directives, MatRadioModule],
|