ng-tailwind 7.0.1 → 7.0.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.
package/fesm2022/ng-tailwind.mjs
CHANGED
|
@@ -9408,10 +9408,9 @@ class NgtReactiveInputComponent extends NgtControlValueAccessor {
|
|
|
9408
9408
|
if (value && typeof value === 'string' && this.mask() == InputMaskEnum.DECIMAL) {
|
|
9409
9409
|
this.value = parseFloat(value);
|
|
9410
9410
|
}
|
|
9411
|
-
if (
|
|
9411
|
+
if (this.hasChangesBetweenValues()) {
|
|
9412
9412
|
this.setNativeValue(value ?? '');
|
|
9413
9413
|
}
|
|
9414
|
-
this.onValueChangeEvent.emit(this.value);
|
|
9415
9414
|
}
|
|
9416
9415
|
setFocus() {
|
|
9417
9416
|
this.inputElement.nativeElement.focus();
|
|
@@ -9493,7 +9492,7 @@ class NgtReactiveInputComponent extends NgtControlValueAccessor {
|
|
|
9493
9492
|
if (this.formControl) {
|
|
9494
9493
|
this.subscriptions.push(this.formControl.events.subscribe((event) => {
|
|
9495
9494
|
if (event instanceof TouchedChangeEvent) {
|
|
9496
|
-
this.touched.set(
|
|
9495
|
+
this.touched.set(event.touched);
|
|
9497
9496
|
}
|
|
9498
9497
|
this.formControlHasErrors.set(!!this.formControl?.errors);
|
|
9499
9498
|
this.formControlIsDirty.set(this.formControl?.dirty);
|
|
@@ -9688,7 +9687,7 @@ class NgtReactiveInputComponent extends NgtControlValueAccessor {
|
|
|
9688
9687
|
this.inputPaddingClass(),
|
|
9689
9688
|
this.ngtStyle.compile(['h', 'text', 'color.border', 'color.bg', 'color.text', 'rounded', 'cursor'])
|
|
9690
9689
|
];
|
|
9691
|
-
if (this.formControlHasErrors() && this.formControlIsDirty()
|
|
9690
|
+
if (this.formControlHasErrors() && (this.formControlIsDirty() || this.touched())) {
|
|
9692
9691
|
classes.push('input-has-error border-red-700');
|
|
9693
9692
|
}
|
|
9694
9693
|
return classes.join(' ');
|
|
@@ -9865,7 +9864,7 @@ class NgtReactiveTextareaComponent extends NgtControlValueAccessor {
|
|
|
9865
9864
|
if (this.formControl) {
|
|
9866
9865
|
this.subscriptions.push(this.formControl.events.subscribe((event) => {
|
|
9867
9866
|
if (event instanceof TouchedChangeEvent) {
|
|
9868
|
-
this.touched.set(
|
|
9867
|
+
this.touched.set(event.touched);
|
|
9869
9868
|
}
|
|
9870
9869
|
this.formControlHasErrors.set(!!this.formControl?.errors);
|
|
9871
9870
|
this.formControlIsDirty.set(this.formControl?.dirty);
|
|
@@ -9949,7 +9948,7 @@ class NgtReactiveTextareaComponent extends NgtControlValueAccessor {
|
|
|
9949
9948
|
'flex border appearance-none focus:outline-none leading-tight w-full px-4 py-3',
|
|
9950
9949
|
this.ngtStyle.compile(['text', 'color.border', 'color.bg', 'color.text', 'rounded'])
|
|
9951
9950
|
];
|
|
9952
|
-
if (this.formControlHasErrors() && this.formControlIsDirty()
|
|
9951
|
+
if (this.formControlHasErrors() && (this.formControlIsDirty() || this.touched())) {
|
|
9953
9952
|
classes.push('input-has-error border-red-700');
|
|
9954
9953
|
}
|
|
9955
9954
|
return classes.join(' ');
|
|
@@ -10518,7 +10517,7 @@ class NgtReactiveSelectComponent extends NgtControlValueAccessor {
|
|
|
10518
10517
|
if (this.formControl) {
|
|
10519
10518
|
this.subscriptions.push(this.formControl.events.subscribe((event) => {
|
|
10520
10519
|
if (event instanceof TouchedChangeEvent) {
|
|
10521
|
-
this.touched.set(
|
|
10520
|
+
this.touched.set(event.touched);
|
|
10522
10521
|
}
|
|
10523
10522
|
this.stateService.updateFormControlState(this.formControl);
|
|
10524
10523
|
}));
|
|
@@ -10729,7 +10728,7 @@ class NgtReactiveSelectComponent extends NgtControlValueAccessor {
|
|
|
10729
10728
|
if (this.isDisabledState()) {
|
|
10730
10729
|
selectClass += ' select-border-disabled';
|
|
10731
10730
|
}
|
|
10732
|
-
else if (this.stateService.formControlHasErrors() && this.stateService.formControlIsDirty()
|
|
10731
|
+
else if (this.stateService.formControlHasErrors() && (this.stateService.formControlIsDirty() || this.touched())) {
|
|
10733
10732
|
selectClass += ' select-border-error';
|
|
10734
10733
|
}
|
|
10735
10734
|
else {
|
|
@@ -11088,7 +11087,7 @@ class NgtReactiveDateComponent extends NgtControlValueAccessor {
|
|
|
11088
11087
|
if (this.formControl) {
|
|
11089
11088
|
this.subscriptions.push(this.formControl.events.subscribe((event) => {
|
|
11090
11089
|
if (event instanceof TouchedChangeEvent) {
|
|
11091
|
-
this.touched.set(
|
|
11090
|
+
this.touched.set(event.touched);
|
|
11092
11091
|
}
|
|
11093
11092
|
this.formControlHasErrors.set(!!this.formControl?.errors);
|
|
11094
11093
|
this.formControlIsDirty.set(this.formControl?.dirty);
|
|
@@ -11167,7 +11166,7 @@ class NgtReactiveDateComponent extends NgtControlValueAccessor {
|
|
|
11167
11166
|
'overflow-hidden border',
|
|
11168
11167
|
this.ngtStyle.compile(['h', 'color.text', 'px', 'py', 'text', 'rounded', 'color.bg', 'color.border'])
|
|
11169
11168
|
];
|
|
11170
|
-
if (this.formControlHasErrors() && this.formControlIsDirty()
|
|
11169
|
+
if (this.formControlHasErrors() && (this.formControlIsDirty() || this.touched())) {
|
|
11171
11170
|
classes.push('border-error');
|
|
11172
11171
|
}
|
|
11173
11172
|
return classes.join(' ');
|