@abgov/angular-components 4.2.2-alpha.4 → 4.2.2-alpha.6

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) {
@@ -2449,7 +2452,7 @@ class GoabInput {
2449
2452
  provide: NG_VALUE_ACCESSOR,
2450
2453
  multi: true,
2451
2454
  useExisting: forwardRef(() => GoabInput),
2452
- }
2455
+ },
2453
2456
  ], ngImport: i0, template: `
2454
2457
  <goa-input
2455
2458
  [attr.type]="type"
@@ -2485,10 +2488,10 @@ class GoabInput {
2485
2488
  (_change)="_onChange($event)"
2486
2489
  (_focus)="_onFocus($event)"
2487
2490
  (_blur)="_onBlur($event)"
2488
- (_keypress)="_onKeyPress($event)"
2491
+ (_keyPress)="_onKeyPress($event)"
2489
2492
  [attr.trailingiconarialabel]="trailingIconAriaLabel"
2490
2493
  >
2491
- <ng-content/>
2494
+ <ng-content />
2492
2495
  </goa-input>
2493
2496
  `, isInline: true }); }
2494
2497
  }
@@ -2532,10 +2535,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
2532
2535
  (_change)="_onChange($event)"
2533
2536
  (_focus)="_onFocus($event)"
2534
2537
  (_blur)="_onBlur($event)"
2535
- (_keypress)="_onKeyPress($event)"
2538
+ (_keyPress)="_onKeyPress($event)"
2536
2539
  [attr.trailingiconarialabel]="trailingIconAriaLabel"
2537
2540
  >
2538
- <ng-content/>
2541
+ <ng-content />
2539
2542
  </goa-input>
2540
2543
  `,
2541
2544
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
@@ -2544,8 +2547,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
2544
2547
  provide: NG_VALUE_ACCESSOR,
2545
2548
  multi: true,
2546
2549
  useExisting: forwardRef(() => GoabInput),
2547
- }
2548
- ]
2550
+ },
2551
+ ],
2549
2552
  }]
2550
2553
  }], propDecorators: { type: [{
2551
2554
  type: Input
@@ -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: `
@@ -3893,5 +4140,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImpor
3893
4140
  * Generated bundle index. Do not edit.
3894
4141
  */
3895
4142
 
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 };
4143
+ 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, GoabTextArea, GoabTooltip, ValueDirective, ValueListDirective };
3897
4144
  //# sourceMappingURL=abgov-angular-components.mjs.map