@covalent/core 10.4.0-beta.3 → 10.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/directives/web-components/form-control.directive.d.ts +13 -4
- package/common/styles/font/_font.scss +4 -0
- package/fesm2022/covalent-core-breadcrumbs.mjs +1 -1
- package/fesm2022/covalent-core-common.mjs +53 -12
- package/fesm2022/covalent-core-common.mjs.map +1 -1
- package/fesm2022/covalent-core-dialogs.mjs +3 -3
- package/fesm2022/covalent-core-dialogs.mjs.map +1 -1
- package/fesm2022/covalent-core-dynamic-menu.mjs +1 -1
- package/fesm2022/covalent-core-file.mjs +2 -2
- package/fesm2022/covalent-core-json-formatter.mjs +2 -2
- package/fesm2022/covalent-core-layout.mjs +3 -3
- package/fesm2022/covalent-core-message.mjs +2 -2
- package/fesm2022/covalent-core-search.mjs +17 -7
- package/fesm2022/covalent-core-search.mjs.map +1 -1
- package/fesm2022/covalent-core-side-sheet.mjs +2 -2
- package/fesm2022/covalent-core-user-profile.mjs +1 -1
- package/package.json +6 -6
- package/side-sheet/side-sheet-container.d.ts +1 -1
- package/common/material-icons.css +0 -1
- package/common/material-icons.css.map +0 -1
- package/common/platform.css +0 -1
- package/common/platform.css.map +0 -1
- package/theming/prebuilt/all-theme-dark.css +0 -1
- package/theming/prebuilt/all-theme-dark.css.map +0 -1
- package/theming/prebuilt/all-theme-light.css +0 -1
- package/theming/prebuilt/all-theme-light.css.map +0 -1
- package/theming/prebuilt/blue-grey-deep-orange.css +0 -1
- package/theming/prebuilt/blue-grey-deep-orange.css.map +0 -1
- package/theming/prebuilt/blue-orange.css +0 -1
- package/theming/prebuilt/blue-orange.css.map +0 -1
- package/theming/prebuilt/indigo-pink.css +0 -1
- package/theming/prebuilt/indigo-pink.css.map +0 -1
- package/theming/prebuilt/orange-light-blue.css +0 -1
- package/theming/prebuilt/orange-light-blue.css.map +0 -1
- package/theming/prebuilt/teal-orange.css +0 -1
- package/theming/prebuilt/teal-orange.css.map +0 -1
|
@@ -1,20 +1,29 @@
|
|
|
1
|
-
import { ElementRef } from '@angular/core';
|
|
1
|
+
import { DestroyRef, ElementRef, OnInit } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor, NgControl } from '@angular/forms';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class CovalentTextfieldValueAccessorDirective implements ControlValueAccessor {
|
|
4
|
+
export declare class CovalentTextfieldValueAccessorDirective implements ControlValueAccessor, OnInit {
|
|
5
5
|
private _elementRef;
|
|
6
6
|
_ngControl: NgControl;
|
|
7
|
+
private _destroyRef;
|
|
7
8
|
private _onChange;
|
|
8
9
|
private _onTouched;
|
|
9
|
-
constructor(_elementRef: ElementRef<any>, _ngControl: NgControl);
|
|
10
|
+
constructor(_elementRef: ElementRef<any>, _ngControl: NgControl, _destroyRef: DestroyRef);
|
|
11
|
+
ngOnInit(): void;
|
|
10
12
|
writeValue(value: string): void;
|
|
11
13
|
registerOnChange(fn: any): void;
|
|
12
14
|
registerOnTouched(fn: any): void;
|
|
13
|
-
|
|
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;
|
|
20
|
+
handleInput(): void;
|
|
21
|
+
handleChange(): void;
|
|
14
22
|
handleBlur(): void;
|
|
15
23
|
setDisabledState(isDisabled: boolean): void;
|
|
16
24
|
private _isCheckBox;
|
|
17
25
|
private _isRadio;
|
|
26
|
+
private _isTextAreaOrField;
|
|
18
27
|
private _updateValidity;
|
|
19
28
|
static ɵfac: i0.ɵɵFactoryDeclaration<CovalentTextfieldValueAccessorDirective, never>;
|
|
20
29
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CovalentTextfieldValueAccessorDirective, "cv-textfield[formControl], cv-textarea[formControl], cv-select[formControl], cv-checkbox[formControl], cv-checkbox-icon[formControl], cv-radio[formControl], cv-radio-icon[formControl], cv-textfield[formControlName], cv-textarea[formControlName], cv-select[formControlName], cv-checkbox[formControlName], cv-checkbox-icon[formControlName], cv-radio[formControlName], cv-radio-icon[formControlName],", never, {}, {}, never, never, true, never>;
|
|
@@ -3,6 +3,10 @@ $mat-font-url: 'styles/font/' !default;
|
|
|
3
3
|
@mixin covalent-material-icons() {
|
|
4
4
|
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block');
|
|
5
5
|
|
|
6
|
+
.material-icons {
|
|
7
|
+
font-family: 'Material Symbols Outlined', sans-serif;
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
// Ensure our size prevails over material
|
|
7
11
|
mat-icon.material-icons {
|
|
8
12
|
&,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
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,9 +8,10 @@ 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,
|
|
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
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
14
15
|
|
|
15
16
|
class TdAutoTrimDirective {
|
|
16
17
|
_model;
|
|
@@ -2079,17 +2080,29 @@ function mixinDisableRipple(base) {
|
|
|
2079
2080
|
class CovalentTextfieldValueAccessorDirective {
|
|
2080
2081
|
_elementRef;
|
|
2081
2082
|
_ngControl;
|
|
2083
|
+
_destroyRef;
|
|
2082
2084
|
_onChange = () => {
|
|
2083
2085
|
/* noop */
|
|
2084
2086
|
};
|
|
2085
2087
|
_onTouched = () => {
|
|
2086
2088
|
/* noop */
|
|
2087
2089
|
};
|
|
2088
|
-
constructor(_elementRef, _ngControl) {
|
|
2090
|
+
constructor(_elementRef, _ngControl, _destroyRef) {
|
|
2089
2091
|
this._elementRef = _elementRef;
|
|
2090
2092
|
this._ngControl = _ngControl;
|
|
2093
|
+
this._destroyRef = _destroyRef;
|
|
2091
2094
|
_ngControl.valueAccessor = this;
|
|
2092
2095
|
}
|
|
2096
|
+
ngOnInit() {
|
|
2097
|
+
// Set up a subscription to monitor status changes
|
|
2098
|
+
if (this._ngControl.control) {
|
|
2099
|
+
this._ngControl.control.statusChanges
|
|
2100
|
+
.pipe(takeUntilDestroyed(this._destroyRef))
|
|
2101
|
+
.subscribe(() => {
|
|
2102
|
+
this._updateValidity();
|
|
2103
|
+
});
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2093
2106
|
writeValue(value) {
|
|
2094
2107
|
if (this._isCheckBox()) {
|
|
2095
2108
|
this._elementRef.nativeElement.value = value || '';
|
|
@@ -2110,15 +2123,36 @@ class CovalentTextfieldValueAccessorDirective {
|
|
|
2110
2123
|
registerOnTouched(fn) {
|
|
2111
2124
|
this._onTouched = fn;
|
|
2112
2125
|
}
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
this.
|
|
2119
|
-
|
|
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
|
+
}
|
|
2133
|
+
handleInput() {
|
|
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);
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
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
|
+
}
|
|
2120
2149
|
}
|
|
2121
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
|
+
}
|
|
2122
2156
|
this._onTouched();
|
|
2123
2157
|
}
|
|
2124
2158
|
// Optional: If you need to handle disabled states
|
|
@@ -2133,6 +2167,10 @@ class CovalentTextfieldValueAccessorDirective {
|
|
|
2133
2167
|
const tagName = this._elementRef.nativeElement.tagName.toLowerCase();
|
|
2134
2168
|
return tagName === 'cv-radio' || tagName === 'cv-radio-icon';
|
|
2135
2169
|
}
|
|
2170
|
+
_isTextAreaOrField() {
|
|
2171
|
+
const tagName = this._elementRef.nativeElement.tagName.toLowerCase();
|
|
2172
|
+
return tagName === 'cv-textarea' || tagName === 'cv-textfield';
|
|
2173
|
+
}
|
|
2136
2174
|
_updateValidity() {
|
|
2137
2175
|
const element = this._elementRef.nativeElement;
|
|
2138
2176
|
const control = this._ngControl.control;
|
|
@@ -2150,9 +2188,9 @@ class CovalentTextfieldValueAccessorDirective {
|
|
|
2150
2188
|
// Set the web component's custom validity message
|
|
2151
2189
|
element.reportValidity();
|
|
2152
2190
|
}
|
|
2153
|
-
static ɵfac = function CovalentTextfieldValueAccessorDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CovalentTextfieldValueAccessorDirective)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1.NgControl)); };
|
|
2191
|
+
static ɵfac = function CovalentTextfieldValueAccessorDirective_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CovalentTextfieldValueAccessorDirective)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1.NgControl), i0.ɵɵdirectiveInject(i0.DestroyRef)); };
|
|
2154
2192
|
static ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: CovalentTextfieldValueAccessorDirective, selectors: [["cv-textfield", "formControl", ""], ["cv-textarea", "formControl", ""], ["cv-select", "formControl", ""], ["cv-checkbox", "formControl", ""], ["cv-checkbox-icon", "formControl", ""], ["cv-radio", "formControl", ""], ["cv-radio-icon", "formControl", ""], ["cv-textfield", "formControlName", ""], ["cv-textarea", "formControlName", ""], ["cv-select", "formControlName", ""], ["cv-checkbox", "formControlName", ""], ["cv-checkbox-icon", "formControlName", ""], ["cv-radio", "formControlName", ""], ["cv-radio-icon", "formControlName", ""], [""]], hostBindings: function CovalentTextfieldValueAccessorDirective_HostBindings(rf, ctx) { if (rf & 1) {
|
|
2155
|
-
i0.ɵɵlistener("change", function CovalentTextfieldValueAccessorDirective_change_HostBindingHandler($event) { return ctx.handleChange($event); })("blur", function CovalentTextfieldValueAccessorDirective_blur_HostBindingHandler() { return ctx.handleBlur(); });
|
|
2193
|
+
i0.ɵɵlistener("input", function CovalentTextfieldValueAccessorDirective_input_HostBindingHandler() { return ctx.handleInput(); })("change", function CovalentTextfieldValueAccessorDirective_change_HostBindingHandler($event) { return ctx.handleChange($event); })("blur", function CovalentTextfieldValueAccessorDirective_blur_HostBindingHandler() { return ctx.handleBlur(); });
|
|
2156
2194
|
} } });
|
|
2157
2195
|
}
|
|
2158
2196
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CovalentTextfieldValueAccessorDirective, [{
|
|
@@ -2173,7 +2211,10 @@ class CovalentTextfieldValueAccessorDirective {
|
|
|
2173
2211
|
cv-radio[formControlName],
|
|
2174
2212
|
cv-radio-icon[formControlName],`,
|
|
2175
2213
|
}]
|
|
2176
|
-
}], () => [{ type: i0.ElementRef }, { type: i1.NgControl }], {
|
|
2214
|
+
}], () => [{ type: i0.ElementRef }, { type: i1.NgControl }, { type: i0.DestroyRef }], { handleInput: [{
|
|
2215
|
+
type: HostListener,
|
|
2216
|
+
args: ['input']
|
|
2217
|
+
}], handleChange: [{
|
|
2177
2218
|
type: HostListener,
|
|
2178
2219
|
args: ['change', ['$event']]
|
|
2179
2220
|
}], handleBlur: [{
|