@covalent/core 10.3.1 → 10.3.3

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.
Files changed (35) hide show
  1. package/common/directives/web-components/form-control.directive.d.ts +6 -1
  2. package/fesm2022/covalent-core-breadcrumbs.mjs +1 -1
  3. package/fesm2022/covalent-core-common.mjs +26 -15
  4. package/fesm2022/covalent-core-common.mjs.map +1 -1
  5. package/fesm2022/covalent-core-dialogs.mjs +3 -3
  6. package/fesm2022/covalent-core-dialogs.mjs.map +1 -1
  7. package/fesm2022/covalent-core-dynamic-menu.mjs +1 -1
  8. package/fesm2022/covalent-core-file.mjs +2 -2
  9. package/fesm2022/covalent-core-json-formatter.mjs +2 -2
  10. package/fesm2022/covalent-core-layout.mjs +3 -3
  11. package/fesm2022/covalent-core-message.mjs +2 -2
  12. package/fesm2022/covalent-core-search.mjs +17 -7
  13. package/fesm2022/covalent-core-search.mjs.map +1 -1
  14. package/fesm2022/covalent-core-side-sheet.mjs +2 -2
  15. package/fesm2022/covalent-core-user-profile.mjs +1 -1
  16. package/package.json +2 -2
  17. package/side-sheet/side-sheet-container.d.ts +1 -1
  18. package/common/material-icons.css +0 -1
  19. package/common/material-icons.css.map +0 -1
  20. package/common/platform.css +0 -1
  21. package/common/platform.css.map +0 -1
  22. package/theming/prebuilt/all-theme-dark.css +0 -1
  23. package/theming/prebuilt/all-theme-dark.css.map +0 -1
  24. package/theming/prebuilt/all-theme-light.css +0 -1
  25. package/theming/prebuilt/all-theme-light.css.map +0 -1
  26. package/theming/prebuilt/blue-grey-deep-orange.css +0 -1
  27. package/theming/prebuilt/blue-grey-deep-orange.css.map +0 -1
  28. package/theming/prebuilt/blue-orange.css +0 -1
  29. package/theming/prebuilt/blue-orange.css.map +0 -1
  30. package/theming/prebuilt/indigo-pink.css +0 -1
  31. package/theming/prebuilt/indigo-pink.css.map +0 -1
  32. package/theming/prebuilt/orange-light-blue.css +0 -1
  33. package/theming/prebuilt/orange-light-blue.css.map +0 -1
  34. package/theming/prebuilt/teal-orange.css +0 -1
  35. package/theming/prebuilt/teal-orange.css.map +0 -1
@@ -12,8 +12,13 @@ export declare class CovalentTextfieldValueAccessorDirective implements ControlV
12
12
  writeValue(value: string): void;
13
13
  registerOnChange(fn: any): void;
14
14
  registerOnTouched(fn: any): void;
15
+ /**
16
+ * Gets the updateOn strategy of the control.
17
+ * @returns The updateOn strategy of the control, defaulting to 'change' if not set.
18
+ */
19
+ private getUpdateOn;
15
20
  handleInput(): void;
16
- handleChange(event: Event): void;
21
+ handleChange(): void;
17
22
  handleBlur(): void;
18
23
  setDisabledState(isDisabled: boolean): void;
19
24
  private _isCheckBox;
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, HostBinding, ContentChildren, Input, NgModule } from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component, HostBinding, Input, ContentChildren, NgModule } from '@angular/core';
3
3
  import { Subject, fromEvent } from 'rxjs';
4
4
  import { debounceTime, takeUntil, startWith } from 'rxjs/operators';
5
5
  import * as i1 from '@angular/common';
@@ -8,7 +8,7 @@ import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
8
8
  import * as i1$1 from '@angular/router';
9
9
  import { RoutesRecognized } from '@angular/router';
10
10
  import { filter, pairwise } from 'rxjs/operators';
11
- import { trigger, state, style, transition, group, query, animateChild, animate, AUTO_STYLE, keyframes } from '@angular/animations';
11
+ import { trigger, state, transition, style, group, query, animate, animateChild, AUTO_STYLE, keyframes } from '@angular/animations';
12
12
  import { Subject } from 'rxjs';
13
13
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
14
14
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@@ -2099,7 +2099,6 @@ class CovalentTextfieldValueAccessorDirective {
2099
2099
  this._ngControl.control.statusChanges
2100
2100
  .pipe(takeUntilDestroyed(this._destroyRef))
2101
2101
  .subscribe(() => {
2102
- this._onTouched();
2103
2102
  this._updateValidity();
2104
2103
  });
2105
2104
  }
@@ -2124,24 +2123,36 @@ class CovalentTextfieldValueAccessorDirective {
2124
2123
  registerOnTouched(fn) {
2125
2124
  this._onTouched = fn;
2126
2125
  }
2126
+ /**
2127
+ * Gets the updateOn strategy of the control.
2128
+ * @returns The updateOn strategy of the control, defaulting to 'change' if not set.
2129
+ */
2130
+ getUpdateOn() {
2131
+ return this._ngControl.control?.updateOn || 'change';
2132
+ }
2127
2133
  handleInput() {
2128
- if (!this._isTextAreaOrField()) {
2129
- return;
2134
+ // Update on 'input' event for textfields/textareas if updateOn strategy is 'change'
2135
+ if (this._isTextAreaOrField() && this.getUpdateOn() === 'change') {
2136
+ const value = this._elementRef.nativeElement.value;
2137
+ this._onChange(value);
2130
2138
  }
2131
- const value = this._elementRef.nativeElement.value;
2132
- this._onChange(value);
2133
- this._onTouched();
2134
- this._updateValidity();
2135
2139
  }
2136
- handleChange(event) {
2137
- const value = this._isCheckBox()
2138
- ? this._elementRef.nativeElement.checked
2139
- : this._elementRef.nativeElement.value;
2140
- this._onChange(value);
2141
- this._onTouched();
2142
- this._updateValidity();
2140
+ handleChange() {
2141
+ // For textfields/textareas, handleInput covers 'change' event
2142
+ if (!this._isTextAreaOrField()) {
2143
+ const value = this._isCheckBox()
2144
+ ? this._elementRef.nativeElement.checked
2145
+ : this._elementRef.nativeElement.value;
2146
+ this._onChange(value);
2147
+ this._onTouched();
2148
+ }
2143
2149
  }
2144
2150
  handleBlur() {
2151
+ // For textfields/textareas, update on 'blur' if updateOn strategy is 'blur'
2152
+ if (this._isTextAreaOrField() && this.getUpdateOn() === 'blur') {
2153
+ const value = this._elementRef.nativeElement.value;
2154
+ this._onChange(value);
2155
+ }
2145
2156
  this._onTouched();
2146
2157
  }
2147
2158
  // Optional: If you need to handle disabled states