structra-ui 0.2.56 → 0.2.57

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.
@@ -2681,6 +2681,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
2681
2681
  type: Directive
2682
2682
  }] });
2683
2683
 
2684
+ /**
2685
+ * Após o botão limpar do `base-field`, repõe foco no controlo nativo (input/textarea/etc.).
2686
+ * **Não** usar em comboboxes dropdown (`select-field`, `multiselect`, `dropdown-search`).
2687
+ */
2688
+ function scheduleRefocusNativeAfterClear(nativeRef) {
2689
+ queueMicrotask(() => {
2690
+ const el = nativeRef?.nativeElement;
2691
+ if (el && typeof el.focus === 'function') {
2692
+ el.focus({ preventScroll: true });
2693
+ }
2694
+ });
2695
+ }
2696
+
2684
2697
  class TextFieldComponent extends NgControlFieldDirective {
2685
2698
  constructor() {
2686
2699
  super(...arguments);
@@ -2745,6 +2758,7 @@ class TextFieldComponent extends NgControlFieldDirective {
2745
2758
  else {
2746
2759
  this.cdr.markForCheck();
2747
2760
  }
2761
+ scheduleRefocusNativeAfterClear(this.nativeInputRef);
2748
2762
  }
2749
2763
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TextFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2750
2764
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "21.2.9", type: TextFieldComponent, isStandalone: true, selector: "app-text-field", inputs: { maxLength: ["maxLength", "maxLength", numberAttribute] }, providers: [
@@ -2864,6 +2878,7 @@ class PasswordFieldComponent extends NgControlFieldDirective {
2864
2878
  else {
2865
2879
  this.cdr.markForCheck();
2866
2880
  }
2881
+ scheduleRefocusNativeAfterClear(this.nativeInputRef);
2867
2882
  }
2868
2883
  togglePasswordVisible(ev) {
2869
2884
  ev.preventDefault();
@@ -3004,6 +3019,7 @@ class TextareaFieldComponent extends NgControlFieldDirective {
3004
3019
  else {
3005
3020
  this.cdr.markForCheck();
3006
3021
  }
3022
+ scheduleRefocusNativeAfterClear(this.nativeInputRef);
3007
3023
  }
3008
3024
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: TextareaFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3009
3025
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "21.2.9", type: TextareaFieldComponent, isStandalone: true, selector: "app-textarea-field", inputs: { maxLength: ["maxLength", "maxLength", numberAttribute], rows: ["rows", "rows", numberAttribute], maxResizeRows: ["maxResizeRows", "maxResizeRows", numberAttribute] }, host: { properties: { "class.textarea-field--invalid": "this.hostInvalidClass" } }, providers: [
@@ -3222,6 +3238,7 @@ class IntegerFieldComponent extends NgControlFieldDirective {
3222
3238
  else {
3223
3239
  this.cdr.markForCheck();
3224
3240
  }
3241
+ scheduleRefocusNativeAfterClear(this.nativeInputRef);
3225
3242
  }
3226
3243
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IntegerFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3227
3244
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "21.2.9", type: IntegerFieldComponent, isStandalone: true, selector: "app-integer-field", inputs: { max: ["max", "max", numberAttribute] }, providers: [
@@ -3540,6 +3557,7 @@ class DecimalFieldComponent extends NgControlFieldDirective {
3540
3557
  else {
3541
3558
  this.cdr.markForCheck();
3542
3559
  }
3560
+ scheduleRefocusNativeAfterClear(this.nativeInputRef);
3543
3561
  }
3544
3562
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DecimalFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3545
3563
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "21.2.9", type: DecimalFieldComponent, isStandalone: true, selector: "app-decimal-field", inputs: { max: ["max", "max", numberAttribute] }, providers: [
@@ -3748,6 +3766,7 @@ class DateFieldComponent extends NgControlFieldDirective {
3748
3766
  else {
3749
3767
  this.cdr.markForCheck();
3750
3768
  }
3769
+ scheduleRefocusNativeAfterClear(this.nativeInputRef);
3751
3770
  }
3752
3771
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: DateFieldComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3753
3772
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "21.2.9", type: DateFieldComponent, isStandalone: true, selector: "app-date-field", inputs: { showTimeHours: ["showTimeHours", "showTimeHours", booleanAttribute], minDate: "minDate", maxDate: "maxDate" }, providers: [
@@ -3954,6 +3973,7 @@ class MaskedTextFieldBase extends NgControlFieldDirective {
3954
3973
  else {
3955
3974
  this.cdr.markForCheck();
3956
3975
  }
3976
+ scheduleRefocusNativeAfterClear(this.nativeInputRef);
3957
3977
  }
3958
3978
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MaskedTextFieldBase, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
3959
3979
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: MaskedTextFieldBase, isStandalone: true, inputs: { maskPattern: "maskPattern" }, viewQueries: [{ propertyName: "nativeInputRef", first: true, predicate: ["nativeInput"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0 }); }