@wlcm/angular 19.1.7 → 19.1.10
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/datepicker/fesm2022/wlcm-angular-datepicker.mjs +1 -1
- package/datepicker/fesm2022/wlcm-angular-datepicker.mjs.map +1 -1
- package/datepicker/lib/constants/datepicker.constants.d.ts +1 -1
- package/datepicker/lib/directives/datepicker-trigger.base.d.ts +1 -1
- package/forms/fesm2022/wlcm-angular-forms.mjs +15 -7
- package/forms/fesm2022/wlcm-angular-forms.mjs.map +1 -1
- package/forms/lib/forms/components/autocomplete/autocomplete.component.d.ts +1 -1
- package/forms/lib/forms/components/select/select.component.d.ts +1 -0
- package/package.json +1 -1
@@ -4,4 +4,4 @@ import { WlcmDatepickerConfig } from '../models/date-picker.models';
|
|
4
4
|
export declare const WLCM_DEFAULT_DATE_FORMATS: MatDateFormats;
|
5
5
|
export declare const WLCM_DEFAULT_DATEPICKER_PROVIDERS: Provider[];
|
6
6
|
export declare const WLCM_DATEPICKER_CONFIG: InjectionToken<WlcmDatepickerConfig>;
|
7
|
-
export declare const WLCM_DATEPICKER_INPUT_CLASS
|
7
|
+
export declare const WLCM_DATEPICKER_INPUT_CLASS = "wlcm-datepicker-input";
|
@@ -16,7 +16,7 @@ export declare abstract class WlcmDatepickerTrigger<T, D = Date> {
|
|
16
16
|
protected abstract connectedTo: ElementRef<HTMLElement>;
|
17
17
|
protected abstract componentType: Type<T>;
|
18
18
|
protected componentRef?: ComponentRef<T>;
|
19
|
-
constructor(overlay: Overlay, viewContainerRef: ViewContainerRef, selectionModel: MatDateSelectionModel<D>);
|
19
|
+
protected constructor(overlay: Overlay, viewContainerRef: ViewContainerRef, selectionModel: MatDateSelectionModel<D>);
|
20
20
|
open(): void;
|
21
21
|
close(): void;
|
22
22
|
get isOpen(): boolean;
|
@@ -512,9 +512,9 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
512
512
|
}
|
513
513
|
ngAfterViewInit() {
|
514
514
|
this.viewReady$.next();
|
515
|
-
|
516
|
-
|
517
|
-
|
515
|
+
this.autocompleteTrigger.connectedTo = runInInjectionContext(this.injector, () => {
|
516
|
+
return new MatAutocompleteOrigin(this.formField.inputContainer);
|
517
|
+
});
|
518
518
|
this.attachFocusBlurListeners();
|
519
519
|
}
|
520
520
|
displayWith(value) {
|
@@ -557,7 +557,7 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
557
557
|
this.autocomplete.closed.pipe(take(1)).subscribe(() => this._touched?.());
|
558
558
|
}
|
559
559
|
validate(control) {
|
560
|
-
if (
|
560
|
+
if (this.control.value) {
|
561
561
|
if (this.control.value instanceof Object)
|
562
562
|
return null;
|
563
563
|
return { ...control.errors, unselected: true, required: false };
|
@@ -613,12 +613,11 @@ let WlcmAutocompleteComponent = class WlcmAutocompleteComponent extends WlcmAuto
|
|
613
613
|
.subscribe();
|
614
614
|
}
|
615
615
|
attachFocusBlurListeners() {
|
616
|
-
const voidFn = () => { };
|
617
616
|
const inputFocus = fromEvent(this.inputElement.nativeElement, 'focus');
|
618
617
|
const inputBlur = fromEvent(this.inputElement.nativeElement, 'blur');
|
619
618
|
const focusObservables = [inputFocus, this.autocomplete.opened];
|
620
619
|
const blurObservables = [inputBlur, this.autocomplete.closed];
|
621
|
-
this._focusStream$.next(merge(...focusObservables).pipe(map(
|
620
|
+
this._focusStream$.next(merge(...focusObservables).pipe(map(() => undefined)));
|
622
621
|
this._blurStream$.next(merge(...blurObservables).pipe(map(() => this.control?.markAsTouched())));
|
623
622
|
}
|
624
623
|
handleAdjustedValue() {
|
@@ -935,7 +934,13 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
935
934
|
this.viewReady$ = new Subject();
|
936
935
|
this.selected$ = new Subject();
|
937
936
|
this.compareWith = (optionA, optionB) => {
|
938
|
-
|
937
|
+
if (this.areOptionsEqual(optionA, optionB)) {
|
938
|
+
if (this.selectOptionFormat() === 'CompleteOption' && typeof optionB !== 'object') {
|
939
|
+
this._changed?.(optionA);
|
940
|
+
}
|
941
|
+
return true;
|
942
|
+
}
|
943
|
+
return false;
|
939
944
|
};
|
940
945
|
this.focus = () => this.matSelect.open();
|
941
946
|
this.isFocused = () => this.isOpen;
|
@@ -972,6 +977,9 @@ let WlcmSelectComponent = class WlcmSelectComponent {
|
|
972
977
|
this.selectionChange.emit(event);
|
973
978
|
});
|
974
979
|
}
|
980
|
+
areOptionsEqual(optionA, optionB) {
|
981
|
+
return (optionA?.value || optionA) === (optionB?.value || optionB);
|
982
|
+
}
|
975
983
|
revertPreviousValue() {
|
976
984
|
this.matSelect.value = this._previousValue;
|
977
985
|
}
|