@abgov/angular-components 4.2.2-alpha.5 → 4.2.2-alpha.7

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.
@@ -2398,6 +2398,9 @@ class GoabInput {
2398
2398
  }
2399
2399
  ngOnInit() {
2400
2400
  this.handleTrailingIconClick = this.onTrailingIconClick.observed;
2401
+ if (typeof this.value === "number") {
2402
+ console.warn("For numeric values use goab-input-number.");
2403
+ }
2401
2404
  }
2402
2405
  _onTrailingIconClick(_) {
2403
2406
  if (this.handleTrailingIconClick) {
@@ -2617,6 +2620,250 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
2617
2620
  type: Output
2618
2621
  }] } });
2619
2622
 
2623
+ class GoabInputNumber {
2624
+ constructor() {
2625
+ this.type = "number";
2626
+ this.value = null;
2627
+ this.onTrailingIconClick = new EventEmitter(); // Keep void type
2628
+ this.onFocus = new EventEmitter();
2629
+ this.onBlur = new EventEmitter();
2630
+ this.onKeyPress = new EventEmitter();
2631
+ this.onChange = new EventEmitter();
2632
+ this.handleTrailingIconClick = false;
2633
+ this.touched = false;
2634
+ }
2635
+ ngOnInit() {
2636
+ this.handleTrailingIconClick = this.onTrailingIconClick.observed;
2637
+ }
2638
+ _onTrailingIconClick(_) {
2639
+ if (this.handleTrailingIconClick) {
2640
+ this.onTrailingIconClick.emit();
2641
+ }
2642
+ }
2643
+ _onChange(e) {
2644
+ this.markAsTouched();
2645
+ const detail = e.detail;
2646
+ const stringValue = detail.value;
2647
+ let numericValue = null;
2648
+ if (stringValue !== null && stringValue.trim() !== "") {
2649
+ const parsed = parseFloat(stringValue);
2650
+ if (!isNaN(parsed)) {
2651
+ numericValue = parsed;
2652
+ }
2653
+ }
2654
+ this.value = numericValue;
2655
+ this.fcChange?.(numericValue);
2656
+ this.onChange.emit(detail);
2657
+ }
2658
+ _onKeyPress(e) {
2659
+ this.markAsTouched();
2660
+ const detail = e.detail;
2661
+ this.onKeyPress.emit(detail);
2662
+ }
2663
+ _onFocus(e) {
2664
+ this.markAsTouched();
2665
+ const detail = e.detail;
2666
+ this.onFocus.emit(detail);
2667
+ }
2668
+ _onBlur(e) {
2669
+ this.markAsTouched();
2670
+ const detail = e.detail;
2671
+ this.onBlur.emit(detail);
2672
+ }
2673
+ markAsTouched() {
2674
+ if (!this.touched) {
2675
+ this.fcTouched?.();
2676
+ this.touched = true;
2677
+ }
2678
+ }
2679
+ writeValue(value) {
2680
+ this.value = value === undefined ? null : value;
2681
+ }
2682
+ registerOnChange(fn) {
2683
+ this.fcChange = fn;
2684
+ }
2685
+ registerOnTouched(fn) {
2686
+ this.fcTouched = fn;
2687
+ }
2688
+ setDisabledState(isDisabled) {
2689
+ this.disabled = isDisabled;
2690
+ }
2691
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabInputNumber, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2692
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabInputNumber, isStandalone: true, selector: "goab-input-number", inputs: { type: "type", name: "name", id: "id", debounce: "debounce", disabled: "disabled", autoCapitalize: "autoCapitalize", placeholder: "placeholder", leadingIcon: "leadingIcon", trailingIcon: "trailingIcon", variant: "variant", focused: "focused", readonly: "readonly", error: "error", width: "width", prefix: "prefix", suffix: "suffix", testId: "testId", ariaLabel: "ariaLabel", maxLength: "maxLength", min: "min", max: "max", step: "step", ariaLabelledBy: "ariaLabelledBy", mt: "mt", mr: "mr", mb: "mb", ml: "ml", trailingIconAriaLabel: "trailingIconAriaLabel", value: "value" }, outputs: { onTrailingIconClick: "onTrailingIconClick", onFocus: "onFocus", onBlur: "onBlur", onKeyPress: "onKeyPress", onChange: "onChange" }, providers: [
2693
+ {
2694
+ provide: NG_VALUE_ACCESSOR,
2695
+ multi: true,
2696
+ // Use forwardRef with the new class name
2697
+ useExisting: forwardRef(() => GoabInputNumber),
2698
+ },
2699
+ ], ngImport: i0, template: `
2700
+ <goa-input
2701
+ [attr.type]="type"
2702
+ [attr.name]="name"
2703
+ [attr.focused]="focused"
2704
+ [attr.value]="value !== null ? value : ''"
2705
+ [attr.autocapitalize]="autoCapitalize"
2706
+ [attr.placeholder]="placeholder"
2707
+ [attr.leadingicon]="leadingIcon"
2708
+ [attr.trailingicon]="trailingIcon"
2709
+ [attr.variant]="variant"
2710
+ [disabled]="disabled"
2711
+ [attr.readonly]="readonly"
2712
+ [attr.error]="error"
2713
+ [attr.data-testid]="testId"
2714
+ [attr.width]="width"
2715
+ [attr.arialabel]="ariaLabel"
2716
+ [attr.arialabelledby]="ariaLabelledBy"
2717
+ [attr.min]="min"
2718
+ [attr.max]="max"
2719
+ [attr.step]="step"
2720
+ [attr.prefix]="prefix"
2721
+ [attr.suffix]="suffix"
2722
+ [attr.debounce]="debounce"
2723
+ [attr.maxlength]="maxLength"
2724
+ [attr.id]="id"
2725
+ [attr.mt]="mt"
2726
+ [attr.mr]="mr"
2727
+ [attr.mb]="mb"
2728
+ [attr.ml]="ml"
2729
+ [attr.handletrailingiconclick]="handleTrailingIconClick"
2730
+ (_trailingIconClick)="_onTrailingIconClick($event)"
2731
+ (_change)="_onChange($event)"
2732
+ (_focus)="_onFocus($event)"
2733
+ (_blur)="_onBlur($event)"
2734
+ (_keypress)="_onKeyPress($event)"
2735
+ [attr.trailingiconarialabel]="trailingIconAriaLabel"
2736
+ >
2737
+ <ng-content />
2738
+ </goa-input>
2739
+ `, isInline: true }); }
2740
+ }
2741
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabInputNumber, decorators: [{
2742
+ type: Component,
2743
+ args: [{
2744
+ standalone: true,
2745
+ selector: "goab-input-number",
2746
+ template: `
2747
+ <goa-input
2748
+ [attr.type]="type"
2749
+ [attr.name]="name"
2750
+ [attr.focused]="focused"
2751
+ [attr.value]="value !== null ? value : ''"
2752
+ [attr.autocapitalize]="autoCapitalize"
2753
+ [attr.placeholder]="placeholder"
2754
+ [attr.leadingicon]="leadingIcon"
2755
+ [attr.trailingicon]="trailingIcon"
2756
+ [attr.variant]="variant"
2757
+ [disabled]="disabled"
2758
+ [attr.readonly]="readonly"
2759
+ [attr.error]="error"
2760
+ [attr.data-testid]="testId"
2761
+ [attr.width]="width"
2762
+ [attr.arialabel]="ariaLabel"
2763
+ [attr.arialabelledby]="ariaLabelledBy"
2764
+ [attr.min]="min"
2765
+ [attr.max]="max"
2766
+ [attr.step]="step"
2767
+ [attr.prefix]="prefix"
2768
+ [attr.suffix]="suffix"
2769
+ [attr.debounce]="debounce"
2770
+ [attr.maxlength]="maxLength"
2771
+ [attr.id]="id"
2772
+ [attr.mt]="mt"
2773
+ [attr.mr]="mr"
2774
+ [attr.mb]="mb"
2775
+ [attr.ml]="ml"
2776
+ [attr.handletrailingiconclick]="handleTrailingIconClick"
2777
+ (_trailingIconClick)="_onTrailingIconClick($event)"
2778
+ (_change)="_onChange($event)"
2779
+ (_focus)="_onFocus($event)"
2780
+ (_blur)="_onBlur($event)"
2781
+ (_keypress)="_onKeyPress($event)"
2782
+ [attr.trailingiconarialabel]="trailingIconAriaLabel"
2783
+ >
2784
+ <ng-content />
2785
+ </goa-input>
2786
+ `,
2787
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
2788
+ providers: [
2789
+ {
2790
+ provide: NG_VALUE_ACCESSOR,
2791
+ multi: true,
2792
+ // Use forwardRef with the new class name
2793
+ useExisting: forwardRef(() => GoabInputNumber),
2794
+ },
2795
+ ],
2796
+ }]
2797
+ }], propDecorators: { type: [{
2798
+ type: Input
2799
+ }], name: [{
2800
+ type: Input
2801
+ }], id: [{
2802
+ type: Input
2803
+ }], debounce: [{
2804
+ type: Input
2805
+ }], disabled: [{
2806
+ type: Input
2807
+ }], autoCapitalize: [{
2808
+ type: Input
2809
+ }], placeholder: [{
2810
+ type: Input
2811
+ }], leadingIcon: [{
2812
+ type: Input
2813
+ }], trailingIcon: [{
2814
+ type: Input
2815
+ }], variant: [{
2816
+ type: Input
2817
+ }], focused: [{
2818
+ type: Input
2819
+ }], readonly: [{
2820
+ type: Input
2821
+ }], error: [{
2822
+ type: Input
2823
+ }], width: [{
2824
+ type: Input
2825
+ }], prefix: [{
2826
+ type: Input
2827
+ }], suffix: [{
2828
+ type: Input
2829
+ }], testId: [{
2830
+ type: Input
2831
+ }], ariaLabel: [{
2832
+ type: Input
2833
+ }], maxLength: [{
2834
+ type: Input
2835
+ }], min: [{
2836
+ type: Input
2837
+ }], max: [{
2838
+ type: Input
2839
+ }], step: [{
2840
+ type: Input
2841
+ }], ariaLabelledBy: [{
2842
+ type: Input
2843
+ }], mt: [{
2844
+ type: Input
2845
+ }], mr: [{
2846
+ type: Input
2847
+ }], mb: [{
2848
+ type: Input
2849
+ }], ml: [{
2850
+ type: Input
2851
+ }], trailingIconAriaLabel: [{
2852
+ type: Input
2853
+ }], value: [{
2854
+ type: Input
2855
+ }], onTrailingIconClick: [{
2856
+ type: Output
2857
+ }], onFocus: [{
2858
+ type: Output
2859
+ }], onBlur: [{
2860
+ type: Output
2861
+ }], onKeyPress: [{
2862
+ type: Output
2863
+ }], onChange: [{
2864
+ type: Output
2865
+ }] } });
2866
+
2620
2867
  class GoabLink {
2621
2868
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabLink, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2622
2869
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabLink, isStandalone: true, selector: "goab-link", inputs: { leadingIcon: "leadingIcon", trailingIcon: "trailingIcon", testId: "testId", mt: "mt", mb: "mb", ml: "ml", mr: "mr" }, ngImport: i0, template: `
@@ -3683,6 +3930,60 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
3683
3930
  type: Output
3684
3931
  }] } });
3685
3932
 
3933
+ class GoabText {
3934
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabText, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3935
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabText, isStandalone: true, selector: "goab-text", inputs: { tag: "tag", size: "size", maxWidth: "maxWidth", color: "color", mt: "mt", mb: "mb", ml: "ml", mr: "mr" }, ngImport: i0, template: `
3936
+ <goa-text
3937
+ [attr.as]="tag"
3938
+ [attr.size]="size"
3939
+ [attr.maxwidth]="maxWidth"
3940
+ [attr.color]="color"
3941
+ [attr.mt]="mt"
3942
+ [attr.mb]="mb"
3943
+ [attr.ml]="ml"
3944
+ [attr.mr]="mr">
3945
+ <ng-content />
3946
+ </goa-text>
3947
+ `, isInline: true }); }
3948
+ }
3949
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabText, decorators: [{
3950
+ type: Component,
3951
+ args: [{
3952
+ standalone: true,
3953
+ selector: 'goab-text',
3954
+ template: `
3955
+ <goa-text
3956
+ [attr.as]="tag"
3957
+ [attr.size]="size"
3958
+ [attr.maxwidth]="maxWidth"
3959
+ [attr.color]="color"
3960
+ [attr.mt]="mt"
3961
+ [attr.mb]="mb"
3962
+ [attr.ml]="ml"
3963
+ [attr.mr]="mr">
3964
+ <ng-content />
3965
+ </goa-text>
3966
+ `,
3967
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
3968
+ }]
3969
+ }], propDecorators: { tag: [{
3970
+ type: Input
3971
+ }], size: [{
3972
+ type: Input
3973
+ }], maxWidth: [{
3974
+ type: Input
3975
+ }], color: [{
3976
+ type: Input
3977
+ }], mt: [{
3978
+ type: Input
3979
+ }], mb: [{
3980
+ type: Input
3981
+ }], ml: [{
3982
+ type: Input
3983
+ }], mr: [{
3984
+ type: Input
3985
+ }] } });
3986
+
3686
3987
  class GoabTextArea {
3687
3988
  constructor() {
3688
3989
  this.value = "";
@@ -3893,5 +4194,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
3893
4194
  * Generated bundle index. Do not edit.
3894
4195
  */
3895
4196
 
3896
- export { AngularComponentsModule, CheckedDirective, GoabAccordion, GoabAppFooter, GoabAppFooterMetaSection, GoabAppFooterNavSection, GoabAppHeader, GoabAppHeaderMenu, GoabBadge, GoabBlock, GoabButton, GoabButtonGroup, GoabCallout, GoabCard, GoabCardActions, GoabCardContent, GoabCardImage, GoabCheckbox, GoabChip, GoabCircularProgress, GoabColumnLayout, GoabContainer, GoabDatePicker, GoabDetails, GoabDivider, GoabDropdown, GoabDropdownItem, GoabFileUploadCard, GoabFileUploadInput, GoabFilterChip, GoabFormItem, GoabFormItemSlot, GoabFormStep, GoabFormStepper, GoabGrid, GoabHeroBanner, GoabIcon, GoabIconButton, GoabInput, GoabLink, GoabMicrositeHeader, GoabModal, GoabNotification, GoabPages, GoabPagination, GoabPopover, GoabRadioGroup, GoabRadioItem, GoabSideMenu, GoabSideMenuGroup, GoabSideMenuHeading, GoabSkeleton, GoabSpacer, GoabTab, GoabTable, GoabTableSortHeader, GoabTabs, GoabTextArea, GoabTooltip, ValueDirective, ValueListDirective };
4197
+ export { AngularComponentsModule, CheckedDirective, GoabAccordion, GoabAppFooter, GoabAppFooterMetaSection, GoabAppFooterNavSection, GoabAppHeader, GoabAppHeaderMenu, GoabBadge, GoabBlock, GoabButton, GoabButtonGroup, GoabCallout, GoabCard, GoabCardActions, GoabCardContent, GoabCardImage, GoabCheckbox, GoabChip, GoabCircularProgress, GoabColumnLayout, GoabContainer, GoabDatePicker, GoabDetails, GoabDivider, GoabDropdown, GoabDropdownItem, GoabFileUploadCard, GoabFileUploadInput, GoabFilterChip, GoabFormItem, GoabFormItemSlot, GoabFormStep, GoabFormStepper, GoabGrid, GoabHeroBanner, GoabIcon, GoabIconButton, GoabInput, GoabInputNumber, GoabLink, GoabMicrositeHeader, GoabModal, GoabNotification, GoabPages, GoabPagination, GoabPopover, GoabRadioGroup, GoabRadioItem, GoabSideMenu, GoabSideMenuGroup, GoabSideMenuHeading, GoabSkeleton, GoabSpacer, GoabTab, GoabTable, GoabTableSortHeader, GoabTabs, GoabText, GoabTextArea, GoabTooltip, ValueDirective, ValueListDirective };
3897
4198
  //# sourceMappingURL=abgov-angular-components.mjs.map