@abgov/angular-components 4.7.0 → 4.7.1-alpha.2

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.
@@ -2828,8 +2828,24 @@ class GoabInput extends GoabControlValueAccessor {
2828
2828
  const detail = e.detail;
2829
2829
  this.onBlur.emit(detail);
2830
2830
  }
2831
+ getLeadingContentAsString() {
2832
+ return this.leadingContent instanceof TemplateRef ? "" : this.leadingContent;
2833
+ }
2834
+ getLeadingContentAsTemplate() {
2835
+ if (!this.leadingContent)
2836
+ return null;
2837
+ return this.leadingContent instanceof TemplateRef ? this.leadingContent : null;
2838
+ }
2839
+ getTrailingContentAsString() {
2840
+ return this.trailingContent instanceof TemplateRef ? "" : this.trailingContent;
2841
+ }
2842
+ getTrailingContentAsTemplate() {
2843
+ if (!this.trailingContent)
2844
+ return null;
2845
+ return this.trailingContent instanceof TemplateRef ? this.trailingContent : null;
2846
+ }
2831
2847
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabInput, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
2832
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", type: GoabInput, isStandalone: true, selector: "goab-input", inputs: { type: "type", name: "name", debounce: ["debounce", "debounce", numberAttribute], autoCapitalize: "autoCapitalize", autoComplete: "autoComplete", placeholder: "placeholder", leadingIcon: "leadingIcon", trailingIcon: "trailingIcon", variant: "variant", focused: ["focused", "focused", booleanAttribute], readonly: ["readonly", "readonly", booleanAttribute], width: "width", prefix: "prefix", suffix: "suffix", ariaLabel: "ariaLabel", maxLength: ["maxLength", "maxLength", numberAttribute], min: "min", max: "max", step: ["step", "step", numberAttribute], ariaLabelledBy: "ariaLabelledBy", trailingIconAriaLabel: "trailingIconAriaLabel", textAlign: "textAlign" }, outputs: { onTrailingIconClick: "onTrailingIconClick", onFocus: "onFocus", onBlur: "onBlur", onKeyPress: "onKeyPress", onChange: "onChange" }, providers: [
2848
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", type: GoabInput, isStandalone: true, selector: "goab-input", inputs: { type: "type", name: "name", debounce: ["debounce", "debounce", numberAttribute], autoCapitalize: "autoCapitalize", autoComplete: "autoComplete", placeholder: "placeholder", leadingIcon: "leadingIcon", trailingIcon: "trailingIcon", variant: "variant", focused: ["focused", "focused", booleanAttribute], readonly: ["readonly", "readonly", booleanAttribute], width: "width", prefix: "prefix", suffix: "suffix", ariaLabel: "ariaLabel", maxLength: ["maxLength", "maxLength", numberAttribute], min: "min", max: "max", step: ["step", "step", numberAttribute], ariaLabelledBy: "ariaLabelledBy", trailingIconAriaLabel: "trailingIconAriaLabel", textAlign: "textAlign", leadingContent: "leadingContent", trailingContent: "trailingContent" }, outputs: { onTrailingIconClick: "onTrailingIconClick", onFocus: "onFocus", onBlur: "onBlur", onKeyPress: "onKeyPress", onChange: "onChange" }, providers: [
2833
2849
  {
2834
2850
  provide: NG_VALUE_ACCESSOR,
2835
2851
  multi: true,
@@ -2875,15 +2891,38 @@ class GoabInput extends GoabControlValueAccessor {
2875
2891
  (_keyPress)="_onKeyPress($event)"
2876
2892
  [attr.trailingiconarialabel]="trailingIconAriaLabel"
2877
2893
  >
2894
+ <div slot="leadingContent">
2895
+ <ng-container *ngIf="leadingContent">
2896
+ <ng-container *ngIf="getLeadingContentAsTemplate(); else stringLeading">
2897
+ <ng-container
2898
+ [ngTemplateOutlet]="getLeadingContentAsTemplate()"
2899
+ ></ng-container>
2900
+ </ng-container>
2901
+ <ng-template #stringLeading>{{ getLeadingContentAsString() }}</ng-template>
2902
+ </ng-container>
2903
+ </div>
2904
+
2878
2905
  <ng-content />
2906
+
2907
+ <div slot="trailingContent">
2908
+ <ng-container *ngIf="trailingContent">
2909
+ <ng-container *ngIf="getTrailingContentAsTemplate(); else stringTrailing">
2910
+ <ng-container
2911
+ [ngTemplateOutlet]="getTrailingContentAsTemplate()"
2912
+ ></ng-container>
2913
+ </ng-container>
2914
+ <ng-template #stringTrailing>{{ getTrailingContentAsString() }}</ng-template>
2915
+ </ng-container>
2916
+ </div>
2879
2917
  </goa-input>
2880
- `, isInline: true }); }
2918
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
2881
2919
  }
2882
2920
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabInput, decorators: [{
2883
2921
  type: Component,
2884
2922
  args: [{
2885
2923
  standalone: true,
2886
2924
  selector: "goab-input",
2925
+ imports: [NgIf, NgTemplateOutlet],
2887
2926
  template: `
2888
2927
  <goa-input
2889
2928
  [attr.type]="type"
@@ -2924,7 +2963,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
2924
2963
  (_keyPress)="_onKeyPress($event)"
2925
2964
  [attr.trailingiconarialabel]="trailingIconAriaLabel"
2926
2965
  >
2966
+ <div slot="leadingContent">
2967
+ <ng-container *ngIf="leadingContent">
2968
+ <ng-container *ngIf="getLeadingContentAsTemplate(); else stringLeading">
2969
+ <ng-container
2970
+ [ngTemplateOutlet]="getLeadingContentAsTemplate()"
2971
+ ></ng-container>
2972
+ </ng-container>
2973
+ <ng-template #stringLeading>{{ getLeadingContentAsString() }}</ng-template>
2974
+ </ng-container>
2975
+ </div>
2976
+
2927
2977
  <ng-content />
2978
+
2979
+ <div slot="trailingContent">
2980
+ <ng-container *ngIf="trailingContent">
2981
+ <ng-container *ngIf="getTrailingContentAsTemplate(); else stringTrailing">
2982
+ <ng-container
2983
+ [ngTemplateOutlet]="getTrailingContentAsTemplate()"
2984
+ ></ng-container>
2985
+ </ng-container>
2986
+ <ng-template #stringTrailing>{{ getTrailingContentAsString() }}</ng-template>
2987
+ </ng-container>
2988
+ </div>
2928
2989
  </goa-input>
2929
2990
  `,
2930
2991
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
@@ -2985,6 +3046,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
2985
3046
  type: Input
2986
3047
  }], textAlign: [{
2987
3048
  type: Input
3049
+ }], leadingContent: [{
3050
+ type: Input
3051
+ }], trailingContent: [{
3052
+ type: Input
2988
3053
  }], onTrailingIconClick: [{
2989
3054
  type: Output
2990
3055
  }], onFocus: [{
@@ -3066,8 +3131,24 @@ class GoabInputNumber {
3066
3131
  setDisabledState(isDisabled) {
3067
3132
  this.disabled = isDisabled;
3068
3133
  }
3134
+ getLeadingContentAsString() {
3135
+ return this.leadingContent instanceof TemplateRef ? "" : this.leadingContent;
3136
+ }
3137
+ getLeadingContentAsTemplate() {
3138
+ if (!this.leadingContent)
3139
+ return null;
3140
+ return this.leadingContent instanceof TemplateRef ? this.leadingContent : null;
3141
+ }
3142
+ getTrailingContentAsString() {
3143
+ return this.trailingContent instanceof TemplateRef ? "" : this.trailingContent;
3144
+ }
3145
+ getTrailingContentAsTemplate() {
3146
+ if (!this.trailingContent)
3147
+ return null;
3148
+ return this.trailingContent instanceof TemplateRef ? this.trailingContent : null;
3149
+ }
3069
3150
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabInputNumber, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3070
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", type: GoabInputNumber, isStandalone: true, selector: "goab-input-number", inputs: { type: "type", name: "name", id: "id", debounce: ["debounce", "debounce", numberAttribute], disabled: ["disabled", "disabled", booleanAttribute], autoCapitalize: "autoCapitalize", placeholder: "placeholder", leadingIcon: "leadingIcon", trailingIcon: "trailingIcon", variant: "variant", focused: ["focused", "focused", booleanAttribute], readonly: ["readonly", "readonly", booleanAttribute], error: ["error", "error", booleanAttribute], width: "width", prefix: "prefix", suffix: "suffix", testId: "testId", ariaLabel: "ariaLabel", maxLength: ["maxLength", "maxLength", numberAttribute], min: "min", max: "max", step: ["step", "step", numberAttribute], ariaLabelledBy: "ariaLabelledBy", mt: "mt", mr: "mr", mb: "mb", ml: "ml", trailingIconAriaLabel: "trailingIconAriaLabel", textAlign: "textAlign", value: "value" }, outputs: { onTrailingIconClick: "onTrailingIconClick", onFocus: "onFocus", onBlur: "onBlur", onKeyPress: "onKeyPress", onChange: "onChange" }, providers: [
3151
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", type: GoabInputNumber, isStandalone: true, selector: "goab-input-number", inputs: { type: "type", name: "name", id: "id", debounce: ["debounce", "debounce", numberAttribute], disabled: ["disabled", "disabled", booleanAttribute], autoCapitalize: "autoCapitalize", placeholder: "placeholder", leadingIcon: "leadingIcon", trailingIcon: "trailingIcon", variant: "variant", focused: ["focused", "focused", booleanAttribute], readonly: ["readonly", "readonly", booleanAttribute], error: ["error", "error", booleanAttribute], width: "width", prefix: "prefix", suffix: "suffix", testId: "testId", ariaLabel: "ariaLabel", maxLength: ["maxLength", "maxLength", numberAttribute], min: "min", max: "max", step: ["step", "step", numberAttribute], ariaLabelledBy: "ariaLabelledBy", mt: "mt", mr: "mr", mb: "mb", ml: "ml", trailingIconAriaLabel: "trailingIconAriaLabel", textAlign: "textAlign", value: "value", leadingContent: "leadingContent", trailingContent: "trailingContent" }, outputs: { onTrailingIconClick: "onTrailingIconClick", onFocus: "onFocus", onBlur: "onBlur", onKeyPress: "onKeyPress", onChange: "onChange" }, providers: [
3071
3152
  {
3072
3153
  provide: NG_VALUE_ACCESSOR,
3073
3154
  multi: true,
@@ -3113,15 +3194,38 @@ class GoabInputNumber {
3113
3194
  (_keypress)="_onKeyPress($event)"
3114
3195
  [attr.trailingiconarialabel]="trailingIconAriaLabel"
3115
3196
  >
3197
+ <div slot="leadingContent">
3198
+ <ng-container *ngIf="leadingContent">
3199
+ <ng-container *ngIf="getLeadingContentAsTemplate(); else stringLeading">
3200
+ <ng-container
3201
+ [ngTemplateOutlet]="getLeadingContentAsTemplate()"
3202
+ ></ng-container>
3203
+ </ng-container>
3204
+ <ng-template #stringLeading>{{ getLeadingContentAsString() }}</ng-template>
3205
+ </ng-container>
3206
+ </div>
3207
+
3116
3208
  <ng-content />
3209
+
3210
+ <div slot="trailingContent">
3211
+ <ng-container *ngIf="trailingContent">
3212
+ <ng-container *ngIf="getTrailingContentAsTemplate(); else stringTrailing">
3213
+ <ng-container
3214
+ [ngTemplateOutlet]="getTrailingContentAsTemplate()"
3215
+ ></ng-container>
3216
+ </ng-container>
3217
+ <ng-template #stringTrailing>{{ getTrailingContentAsString() }}</ng-template>
3218
+ </ng-container>
3219
+ </div>
3117
3220
  </goa-input>
3118
- `, isInline: true }); }
3221
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
3119
3222
  }
3120
3223
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabInputNumber, decorators: [{
3121
3224
  type: Component,
3122
3225
  args: [{
3123
3226
  standalone: true,
3124
3227
  selector: "goab-input-number",
3228
+ imports: [NgIf, NgTemplateOutlet],
3125
3229
  template: `
3126
3230
  <goa-input
3127
3231
  [attr.type]="type"
@@ -3161,7 +3265,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
3161
3265
  (_keypress)="_onKeyPress($event)"
3162
3266
  [attr.trailingiconarialabel]="trailingIconAriaLabel"
3163
3267
  >
3268
+ <div slot="leadingContent">
3269
+ <ng-container *ngIf="leadingContent">
3270
+ <ng-container *ngIf="getLeadingContentAsTemplate(); else stringLeading">
3271
+ <ng-container
3272
+ [ngTemplateOutlet]="getLeadingContentAsTemplate()"
3273
+ ></ng-container>
3274
+ </ng-container>
3275
+ <ng-template #stringLeading>{{ getLeadingContentAsString() }}</ng-template>
3276
+ </ng-container>
3277
+ </div>
3278
+
3164
3279
  <ng-content />
3280
+
3281
+ <div slot="trailingContent">
3282
+ <ng-container *ngIf="trailingContent">
3283
+ <ng-container *ngIf="getTrailingContentAsTemplate(); else stringTrailing">
3284
+ <ng-container
3285
+ [ngTemplateOutlet]="getTrailingContentAsTemplate()"
3286
+ ></ng-container>
3287
+ </ng-container>
3288
+ <ng-template #stringTrailing>{{ getTrailingContentAsString() }}</ng-template>
3289
+ </ng-container>
3290
+ </div>
3165
3291
  </goa-input>
3166
3292
  `,
3167
3293
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
@@ -3241,6 +3367,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
3241
3367
  type: Input
3242
3368
  }], value: [{
3243
3369
  type: Input
3370
+ }], leadingContent: [{
3371
+ type: Input
3372
+ }], trailingContent: [{
3373
+ type: Input
3244
3374
  }], onTrailingIconClick: [{
3245
3375
  type: Output
3246
3376
  }], onFocus: [{
@@ -4514,11 +4644,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
4514
4644
  }] } });
4515
4645
 
4516
4646
  class GoabTooltip extends GoabBaseComponent {
4647
+ getContentAsString() {
4648
+ return this.content instanceof TemplateRef ? "" : this.content || "";
4649
+ }
4650
+ getContentAsTemplate() {
4651
+ if (!this.content)
4652
+ return null;
4653
+ return this.content instanceof TemplateRef ? this.content : null;
4654
+ }
4517
4655
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabTooltip, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4518
4656
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabTooltip, isStandalone: true, selector: "goab-tooltip", inputs: { position: "position", content: "content", hAlign: "hAlign" }, usesInheritance: true, ngImport: i0, template: `
4519
4657
  <goa-tooltip
4520
4658
  [attr.position]="position"
4521
- [attr.content]="content"
4659
+ [attr.content]="getContentAsString()"
4522
4660
  [attr.halign]="hAlign"
4523
4661
  [attr.testid]="testId"
4524
4662
  [attr.mt]="mt"
@@ -4526,9 +4664,16 @@ class GoabTooltip extends GoabBaseComponent {
4526
4664
  [attr.ml]="ml"
4527
4665
  [attr.mr]="mr"
4528
4666
  >
4667
+ <div slot="content">
4668
+ <ng-container
4669
+ *ngIf="getContentAsTemplate()"
4670
+ [ngTemplateOutlet]="getContentAsTemplate()"
4671
+ ></ng-container>
4672
+ {{ getContentAsString() }}
4673
+ </div>
4529
4674
  <ng-content />
4530
4675
  </goa-tooltip>
4531
- `, isInline: true }); }
4676
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
4532
4677
  }
4533
4678
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabTooltip, decorators: [{
4534
4679
  type: Component,
@@ -4538,7 +4683,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
4538
4683
  template: `
4539
4684
  <goa-tooltip
4540
4685
  [attr.position]="position"
4541
- [attr.content]="content"
4686
+ [attr.content]="getContentAsString()"
4542
4687
  [attr.halign]="hAlign"
4543
4688
  [attr.testid]="testId"
4544
4689
  [attr.mt]="mt"
@@ -4546,10 +4691,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
4546
4691
  [attr.ml]="ml"
4547
4692
  [attr.mr]="mr"
4548
4693
  >
4694
+ <div slot="content">
4695
+ <ng-container
4696
+ *ngIf="getContentAsTemplate()"
4697
+ [ngTemplateOutlet]="getContentAsTemplate()"
4698
+ ></ng-container>
4699
+ {{ getContentAsString() }}
4700
+ </div>
4549
4701
  <ng-content />
4550
4702
  </goa-tooltip>
4551
4703
  `,
4552
4704
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
4705
+ imports: [NgTemplateOutlet, NgIf],
4553
4706
  }]
4554
4707
  }], propDecorators: { position: [{
4555
4708
  type: Input