@skyux/forms 10.0.0-alpha.0 → 10.0.0-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.
Files changed (71) hide show
  1. package/documentation.json +4278 -3104
  2. package/esm2022/index.mjs +5 -1
  3. package/esm2022/lib/modules/character-counter/character-counter-indicator.component.mjs +7 -6
  4. package/esm2022/lib/modules/character-counter/character-counter-screen-reader.pipe.mjs +46 -0
  5. package/esm2022/lib/modules/character-counter/character-counter.directive.mjs +3 -3
  6. package/esm2022/lib/modules/character-counter/character-counter.module.mjs +8 -5
  7. package/esm2022/lib/modules/checkbox/checkbox-label.component.mjs +3 -3
  8. package/esm2022/lib/modules/checkbox/checkbox.component.mjs +30 -19
  9. package/esm2022/lib/modules/checkbox/checkbox.module.mjs +36 -7
  10. package/esm2022/lib/modules/file-attachment/file-attachment-label.component.mjs +3 -3
  11. package/esm2022/lib/modules/file-attachment/file-attachment.component.mjs +6 -7
  12. package/esm2022/lib/modules/file-attachment/file-attachment.service.mjs +5 -6
  13. package/esm2022/lib/modules/file-attachment/file-attachments.module.mjs +4 -4
  14. package/esm2022/lib/modules/file-attachment/file-drop.component.mjs +6 -7
  15. package/esm2022/lib/modules/file-attachment/file-item.component.mjs +4 -4
  16. package/esm2022/lib/modules/file-attachment/file-item.service.mjs +3 -3
  17. package/esm2022/lib/modules/file-attachment/file-size.pipe.mjs +3 -3
  18. package/esm2022/lib/modules/file-attachment/types/file-drop-change.mjs +1 -1
  19. package/esm2022/lib/modules/form-error/form-error.component.mjs +30 -14
  20. package/esm2022/lib/modules/form-error/form-error.module.mjs +16 -0
  21. package/esm2022/lib/modules/form-error/form-errors-enabled-token.mjs +6 -0
  22. package/esm2022/lib/modules/form-error/form-errors.component.mjs +5 -5
  23. package/esm2022/lib/modules/form-error/form-errors.module.mjs +7 -6
  24. package/esm2022/lib/modules/input-box/input-box-adapter.service.mjs +3 -3
  25. package/esm2022/lib/modules/input-box/input-box-control.directive.mjs +3 -3
  26. package/esm2022/lib/modules/input-box/input-box-help-inline.component.mjs +3 -3
  27. package/esm2022/lib/modules/input-box/input-box-host.service.mjs +3 -3
  28. package/esm2022/lib/modules/input-box/input-box.component.mjs +21 -6
  29. package/esm2022/lib/modules/input-box/input-box.module.mjs +26 -12
  30. package/esm2022/lib/modules/radio/radio-group-id.service.mjs +3 -3
  31. package/esm2022/lib/modules/radio/radio-group.component.mjs +74 -10
  32. package/esm2022/lib/modules/radio/radio-label.component.mjs +3 -3
  33. package/esm2022/lib/modules/radio/radio.component.mjs +3 -3
  34. package/esm2022/lib/modules/radio/radio.module.mjs +43 -9
  35. package/esm2022/lib/modules/selection-box/selection-box-adapter.service.mjs +3 -3
  36. package/esm2022/lib/modules/selection-box/selection-box-description.component.mjs +3 -3
  37. package/esm2022/lib/modules/selection-box/selection-box-grid.component.mjs +3 -3
  38. package/esm2022/lib/modules/selection-box/selection-box-header.component.mjs +3 -3
  39. package/esm2022/lib/modules/selection-box/selection-box.component.mjs +3 -3
  40. package/esm2022/lib/modules/selection-box/selection-box.module.mjs +4 -4
  41. package/esm2022/lib/modules/shared/sky-forms-resources.module.mjs +8 -6
  42. package/esm2022/lib/modules/toggle-switch/toggle-switch-label.component.mjs +3 -3
  43. package/esm2022/lib/modules/toggle-switch/toggle-switch.component.mjs +3 -3
  44. package/esm2022/lib/modules/toggle-switch/toggle-switch.module.mjs +4 -4
  45. package/esm2022/testing/checkbox/checkbox-harness.mjs +15 -1
  46. package/esm2022/testing/form-error/form-error-harness.mjs +5 -9
  47. package/esm2022/testing/form-error/form-errors-harness.mjs +15 -64
  48. package/esm2022/testing/input-box/input-box-harness.mjs +59 -2
  49. package/fesm2022/skyux-forms-testing.mjs +122 -106
  50. package/fesm2022/skyux-forms-testing.mjs.map +1 -1
  51. package/fesm2022/skyux-forms.mjs +480 -256
  52. package/fesm2022/skyux-forms.mjs.map +1 -1
  53. package/index.d.ts +4 -0
  54. package/lib/modules/character-counter/character-counter-screen-reader.pipe.d.ts +8 -0
  55. package/lib/modules/character-counter/character-counter.module.d.ts +3 -2
  56. package/lib/modules/checkbox/checkbox.component.d.ts +9 -2
  57. package/lib/modules/checkbox/checkbox.module.d.ts +6 -3
  58. package/lib/modules/file-attachment/types/file-drop-change.d.ts +2 -2
  59. package/lib/modules/form-error/form-error.component.d.ts +17 -3
  60. package/lib/modules/form-error/form-error.module.d.ts +7 -0
  61. package/lib/modules/form-error/form-errors-enabled-token.d.ts +5 -0
  62. package/lib/modules/form-error/form-errors.module.d.ts +2 -1
  63. package/lib/modules/input-box/input-box.component.d.ts +2 -1
  64. package/lib/modules/input-box/input-box.module.d.ts +7 -5
  65. package/lib/modules/radio/radio-group.component.d.ts +18 -3
  66. package/lib/modules/radio/radio.module.d.ts +6 -3
  67. package/package.json +12 -12
  68. package/testing/checkbox/checkbox-harness.d.ts +2 -0
  69. package/testing/form-error/form-error-harness.d.ts +4 -2
  70. package/testing/form-error/form-errors-harness.d.ts +10 -11
  71. package/testing/input-box/input-box-harness.d.ts +36 -1
package/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export { SkyCharacterCounterModule } from './lib/modules/character-counter/chara
2
2
  export { SkyCheckboxChange } from './lib/modules/checkbox/checkbox-change';
3
3
  export { SkyCheckboxModule } from './lib/modules/checkbox/checkbox.module';
4
4
  export { SkyFormErrorsModule } from './lib/modules/form-error/form-errors.module';
5
+ export { SkyFormErrorModule } from './lib/modules/form-error/form-error.module';
5
6
  export { SkyFileAttachmentsModule } from './lib/modules/file-attachment/file-attachments.module';
6
7
  export { SkyFileItem } from './lib/modules/file-attachment/file-item';
7
8
  export { SkyFileItemErrorType } from './lib/modules/file-attachment/file-item-error-type';
@@ -21,8 +22,10 @@ export { SkySelectionBoxGridAlignItems } from './lib/modules/selection-box/types
21
22
  export { SkySelectionBoxGridAlignItemsType } from './lib/modules/selection-box/types/selection-box-grid-align-items-type';
22
23
  export { SkyToggleSwitchModule } from './lib/modules/toggle-switch/toggle-switch.module';
23
24
  export { SkyToggleSwitchChange } from './lib/modules/toggle-switch/types/toggle-switch-change';
25
+ export { SKY_FORM_ERRORS_ENABLED } from './lib/modules/form-error/form-errors-enabled-token';
24
26
  export { SkyCharacterCounterIndicatorComponent as λ1 } from './lib/modules/character-counter/character-counter-indicator.component';
25
27
  export { SkyCharacterCounterInputDirective as λ2 } from './lib/modules/character-counter/character-counter.directive';
28
+ export { SkyCharacterCounterScreenReaderPipe as λ23 } from './lib/modules/character-counter/character-counter-screen-reader.pipe';
26
29
  export { SkyCheckboxLabelComponent as λ4 } from './lib/modules/checkbox/checkbox-label.component';
27
30
  export { SkyCheckboxComponent as λ3 } from './lib/modules/checkbox/checkbox.component';
28
31
  export { SkyFileAttachmentLabelComponent as λ6 } from './lib/modules/file-attachment/file-attachment-label.component';
@@ -30,6 +33,7 @@ export { SkyFileAttachmentComponent as λ7 } from './lib/modules/file-attachment
30
33
  export { SkyFileDropComponent as λ8 } from './lib/modules/file-attachment/file-drop.component';
31
34
  export { SkyFileItemComponent as λ9 } from './lib/modules/file-attachment/file-item.component';
32
35
  export { SkyFormErrorsComponent as λ21 } from './lib/modules/form-error/form-errors.component';
36
+ export { SkyFormErrorComponent as λ22 } from './lib/modules/form-error/form-error.component';
33
37
  export { SkyInputBoxControlDirective as λ20 } from './lib/modules/input-box/input-box-control.directive';
34
38
  export { SkyInputBoxComponent as λ10 } from './lib/modules/input-box/input-box.component';
35
39
  export { SkyRadioGroupComponent as λ11 } from './lib/modules/radio/radio-group.component';
@@ -0,0 +1,8 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class SkyCharacterCounterScreenReaderPipe implements PipeTransform {
4
+ #private;
5
+ transform(characterCount: number | undefined, characterCountLimit: number | undefined): string;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkyCharacterCounterScreenReaderPipe, never>;
7
+ static ɵpipe: i0.ɵɵPipeDeclaration<SkyCharacterCounterScreenReaderPipe, "skyCharacterCounterScreenReader", true>;
8
+ }
@@ -3,9 +3,10 @@ import * as i1 from "./character-counter.directive";
3
3
  import * as i2 from "./character-counter-indicator.component";
4
4
  import * as i3 from "@angular/common";
5
5
  import * as i4 from "@angular/forms";
6
- import * as i5 from "../shared/sky-forms-resources.module";
6
+ import * as i5 from "./character-counter-screen-reader.pipe";
7
+ import * as i6 from "../shared/sky-forms-resources.module";
7
8
  export declare class SkyCharacterCounterModule {
8
9
  static ɵfac: i0.ɵɵFactoryDeclaration<SkyCharacterCounterModule, never>;
9
- static ɵmod: i0.ɵɵNgModuleDeclaration<SkyCharacterCounterModule, [typeof i1.SkyCharacterCounterInputDirective, typeof i2.SkyCharacterCounterIndicatorComponent], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.SkyFormsResourcesModule], [typeof i1.SkyCharacterCounterInputDirective, typeof i2.SkyCharacterCounterIndicatorComponent]>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SkyCharacterCounterModule, [typeof i1.SkyCharacterCounterInputDirective, typeof i2.SkyCharacterCounterIndicatorComponent], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i4.ReactiveFormsModule, typeof i5.SkyCharacterCounterScreenReaderPipe, typeof i6.SkyFormsResourcesModule], [typeof i1.SkyCharacterCounterInputDirective, typeof i2.SkyCharacterCounterIndicatorComponent]>;
10
11
  static ɵinj: i0.ɵɵInjectorDeclaration<SkyCharacterCounterModule>;
11
12
  }
@@ -1,5 +1,5 @@
1
1
  import { ElementRef, EventEmitter, OnInit } from '@angular/core';
2
- import { ControlValueAccessor } from '@angular/forms';
2
+ import { ControlValueAccessor, NgControl } from '@angular/forms';
3
3
  import { Observable } from 'rxjs';
4
4
  import { SkyCheckboxChange } from './checkbox-change';
5
5
  import * as i0 from "@angular/core";
@@ -94,6 +94,11 @@ export declare class SkyCheckboxComponent implements ControlValueAccessor, OnIni
94
94
  */
95
95
  set required(value: boolean | undefined);
96
96
  get required(): boolean;
97
+ /**
98
+ * The text to display as the checkbox's label. Use this instead of the `sky-checkbox-label` when the label is text-only.
99
+ * Specifying `labelText` also enables automatic error message handling for checkbox.
100
+ */
101
+ labelText: string | undefined;
97
102
  /**
98
103
  * Fires when users select or deselect the checkbox.
99
104
  */
@@ -110,6 +115,8 @@ export declare class SkyCheckboxComponent implements ControlValueAccessor, OnIni
110
115
  set inputEl(el: ElementRef | undefined);
111
116
  get inputEl(): ElementRef | undefined;
112
117
  protected inputId: string;
118
+ protected readonly ngControl: NgControl | null;
119
+ protected readonly errorId: string;
113
120
  constructor();
114
121
  ngOnInit(): void;
115
122
  /**
@@ -137,5 +144,5 @@ export declare class SkyCheckboxComponent implements ControlValueAccessor, OnIni
137
144
  /** Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor. */
138
145
  onTouched: () => any;
139
146
  static ɵfac: i0.ɵɵFactoryDeclaration<SkyCheckboxComponent, never>;
140
- static ɵcmp: i0.ɵɵComponentDeclaration<SkyCheckboxComponent, "sky-checkbox", never, { "label": { "alias": "label"; "required": false; }; "labelledBy": { "alias": "labelledBy"; "required": false; }; "id": { "alias": "id"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; "name": { "alias": "name"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "checkboxType": { "alias": "checkboxType"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; "required": { "alias": "required"; "required": false; }; }, { "change": "change"; "checkedChange": "checkedChange"; "disabledChange": "disabledChange"; "indeterminateChange": "indeterminateChange"; }, never, ["sky-checkbox-label"], false, never>;
147
+ static ɵcmp: i0.ɵɵComponentDeclaration<SkyCheckboxComponent, "sky-checkbox", never, { "label": { "alias": "label"; "required": false; }; "labelledBy": { "alias": "labelledBy"; "required": false; }; "id": { "alias": "id"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "tabindex": { "alias": "tabindex"; "required": false; }; "name": { "alias": "name"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "checkboxType": { "alias": "checkboxType"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "indeterminate": { "alias": "indeterminate"; "required": false; }; "required": { "alias": "required"; "required": false; }; "labelText": { "alias": "labelText"; "required": false; }; }, { "change": "change"; "checkedChange": "checkedChange"; "disabledChange": "disabledChange"; "indeterminateChange": "indeterminateChange"; }, never, ["sky-checkbox-label", "sky-form-error"], false, never>;
141
148
  }
@@ -3,10 +3,13 @@ import * as i1 from "./checkbox.component";
3
3
  import * as i2 from "./checkbox-label.component";
4
4
  import * as i3 from "@angular/common";
5
5
  import * as i4 from "@angular/forms";
6
- import * as i5 from "@skyux/indicators";
7
- import * as i6 from "@skyux/core";
6
+ import * as i5 from "../form-error/form-error.module";
7
+ import * as i6 from "../form-error/form-errors.module";
8
+ import * as i7 from "../shared/sky-forms-resources.module";
9
+ import * as i8 from "@skyux/indicators";
10
+ import * as i9 from "@skyux/core";
8
11
  export declare class SkyCheckboxModule {
9
12
  static ɵfac: i0.ɵɵFactoryDeclaration<SkyCheckboxModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<SkyCheckboxModule, [typeof i1.SkyCheckboxComponent, typeof i2.SkyCheckboxLabelComponent], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i5.SkyIconModule, typeof i6.SkyTrimModule], [typeof i1.SkyCheckboxComponent, typeof i2.SkyCheckboxLabelComponent]>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SkyCheckboxModule, [typeof i1.SkyCheckboxComponent, typeof i2.SkyCheckboxLabelComponent], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i5.SkyFormErrorModule, typeof i6.SkyFormErrorsModule, typeof i7.SkyFormsResourcesModule, typeof i8.SkyIconModule, typeof i9.SkyTrimModule], [typeof i1.SkyCheckboxComponent, typeof i2.SkyCheckboxLabelComponent, typeof i5.SkyFormErrorModule]>;
11
14
  static ɵinj: i0.ɵɵInjectorDeclaration<SkyCheckboxModule>;
12
15
  }
@@ -3,9 +3,9 @@ export interface SkyFileDropChange {
3
3
  /**
4
4
  * The array of files that were added or removed.
5
5
  */
6
- files: Array<SkyFileItem>;
6
+ files: SkyFileItem[];
7
7
  /**
8
8
  * The array of files that were rejected.
9
9
  */
10
- rejectedFiles: Array<SkyFileItem>;
10
+ rejectedFiles: SkyFileItem[];
11
11
  }
@@ -1,9 +1,23 @@
1
1
  import * as i0 from "@angular/core";
2
2
  /**
3
- * @internal
3
+ * Displays default and custom form field error messages for form field components.
4
+ * Set `labelText` on the form field component to automatically display required,
5
+ * maximum length, minimum length, date, email, phone number, time, and URL errors.
6
+ * To display custom errors, include sky-form-error elements in the form field component.
4
7
  */
5
8
  export declare class SkyFormErrorComponent {
6
- protected readonly cssClass = "sky-form-error-indicator";
9
+ /**
10
+ * The name of the error.
11
+ * @required
12
+ */
13
+ errorName: string;
14
+ /**
15
+ * The error message to display.
16
+ * @required
17
+ */
18
+ errorText: string;
19
+ protected readonly formErrors: boolean | null;
20
+ constructor();
7
21
  static ɵfac: i0.ɵɵFactoryDeclaration<SkyFormErrorComponent, never>;
8
- static ɵcmp: i0.ɵɵComponentDeclaration<SkyFormErrorComponent, "sky-form-error", never, {}, {}, never, ["*"], true, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<SkyFormErrorComponent, "sky-form-error", never, { "errorName": { "alias": "errorName"; "required": true; }; "errorText": { "alias": "errorText"; "required": true; }; }, {}, never, never, true, never>;
9
23
  }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./form-error.component";
3
+ export declare class SkyFormErrorModule {
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<SkyFormErrorModule, never>;
5
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SkyFormErrorModule, never, [typeof i1.SkyFormErrorComponent], [typeof i1.SkyFormErrorComponent]>;
6
+ static ɵinj: i0.ɵɵInjectorDeclaration<SkyFormErrorModule>;
7
+ }
@@ -0,0 +1,5 @@
1
+ import { InjectionToken } from '@angular/core';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare const SKY_FORM_ERRORS_ENABLED: InjectionToken<boolean>;
@@ -1,10 +1,11 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "./form-errors.component";
3
+ import * as i2 from "./form-error.component";
3
4
  /**
4
5
  * @internal
5
6
  */
6
7
  export declare class SkyFormErrorsModule {
7
8
  static ɵfac: i0.ɵɵFactoryDeclaration<SkyFormErrorsModule, never>;
8
- static ɵmod: i0.ɵɵNgModuleDeclaration<SkyFormErrorsModule, never, [typeof i1.SkyFormErrorsComponent], [typeof i1.SkyFormErrorsComponent]>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SkyFormErrorsModule, never, [typeof i1.SkyFormErrorsComponent, typeof i2.SkyFormErrorComponent], [typeof i1.SkyFormErrorsComponent]>;
9
10
  static ɵinj: i0.ɵɵInjectorDeclaration<SkyFormErrorsModule>;
10
11
  }
@@ -77,6 +77,7 @@ export declare class SkyInputBoxComponent implements OnInit, AfterContentChecked
77
77
  protected helpPopoverOpen: boolean | undefined;
78
78
  protected get hasErrorsComputed(): boolean;
79
79
  protected get required(): boolean;
80
+ protected characterCountScreenReader: number;
80
81
  ngOnInit(): void;
81
82
  ngAfterContentChecked(): void;
82
83
  ngOnDestroy(): void;
@@ -85,5 +86,5 @@ export declare class SkyInputBoxComponent implements OnInit, AfterContentChecked
85
86
  onInsetIconClick(): void;
86
87
  populate(args: SkyInputBoxPopulateArgs): void;
87
88
  static ɵfac: i0.ɵɵFactoryDeclaration<SkyInputBoxComponent, never>;
88
- static ɵcmp: i0.ɵɵComponentDeclaration<SkyInputBoxComponent, "sky-input-box", never, { "hasErrors": { "alias": "hasErrors"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "labelText": { "alias": "labelText"; "required": false; }; "characterLimit": { "alias": "characterLimit"; "required": false; }; "stacked": { "alias": "stacked"; "required": false; }; "helpPopoverTitle": { "alias": "helpPopoverTitle"; "required": false; }; "helpPopoverContent": { "alias": "helpPopoverContent"; "required": false; }; "hintText": { "alias": "hintText"; "required": false; }; }, {}, ["formControl", "formControlByName", "ngModel", "inputRef"], [".sky-control-label", ".sky-control-help", "sky-character-counter-indicator", "input,select,.sky-form-control:not(textarea),sky-text-editor", "textarea", ".sky-input-group-btn.sky-input-box-btn-left", ".sky-input-group-btn:not(.sky-input-box-btn-left):not(.sky-input-box-btn-inset)", ".sky-input-group-btn.sky-input-box-btn-inset", ".sky-input-group-icon.sky-input-box-icon-inset", ".sky-input-group-icon.sky-input-box-icon-inset-left", ".sky-error-label,.sky-error-indicator"], false, never>;
89
+ static ɵcmp: i0.ɵɵComponentDeclaration<SkyInputBoxComponent, "sky-input-box", never, { "hasErrors": { "alias": "hasErrors"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "labelText": { "alias": "labelText"; "required": false; }; "characterLimit": { "alias": "characterLimit"; "required": false; }; "stacked": { "alias": "stacked"; "required": false; }; "helpPopoverTitle": { "alias": "helpPopoverTitle"; "required": false; }; "helpPopoverContent": { "alias": "helpPopoverContent"; "required": false; }; "hintText": { "alias": "hintText"; "required": false; }; }, {}, ["formControl", "formControlByName", "ngModel", "inputRef"], [".sky-control-label", ".sky-control-help", "sky-character-counter-indicator", "input,select,.sky-form-control:not(textarea),sky-text-editor", "textarea", ".sky-input-group-btn.sky-input-box-btn-left", ".sky-input-group-btn:not(.sky-input-box-btn-left):not(.sky-input-box-btn-inset)", ".sky-input-group-btn.sky-input-box-btn-inset", ".sky-input-group-icon.sky-input-box-icon-inset", ".sky-input-group-icon.sky-input-box-icon-inset-left", "sky-form-error", ".sky-error-label,.sky-error-indicator"], false, never>;
89
90
  }
@@ -2,12 +2,14 @@ import * as i0 from "@angular/core";
2
2
  import * as i1 from "./input-box.component";
3
3
  import * as i2 from "@angular/common";
4
4
  import * as i3 from "../character-counter/character-counter.module";
5
- import * as i4 from "../form-error/form-errors.component";
6
- import * as i5 from "./input-box-control.directive";
7
- import * as i6 from "./input-box-help-inline.component";
8
- import * as i7 from "@skyux/theme";
5
+ import * as i4 from "../form-error/form-errors.module";
6
+ import * as i5 from "../form-error/form-error.module";
7
+ import * as i6 from "../shared/sky-forms-resources.module";
8
+ import * as i7 from "./input-box-control.directive";
9
+ import * as i8 from "./input-box-help-inline.component";
10
+ import * as i9 from "@skyux/theme";
9
11
  export declare class SkyInputBoxModule {
10
12
  static ɵfac: i0.ɵɵFactoryDeclaration<SkyInputBoxModule, never>;
11
- static ɵmod: i0.ɵɵNgModuleDeclaration<SkyInputBoxModule, [typeof i1.SkyInputBoxComponent], [typeof i2.CommonModule, typeof i3.SkyCharacterCounterModule, typeof i4.SkyFormErrorsComponent, typeof i5.SkyInputBoxControlDirective, typeof i6.SkyInputBoxHelpInlineComponent, typeof i7.SkyThemeModule], [typeof i1.SkyInputBoxComponent, typeof i5.SkyInputBoxControlDirective]>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SkyInputBoxModule, [typeof i1.SkyInputBoxComponent], [typeof i2.CommonModule, typeof i3.SkyCharacterCounterModule, typeof i4.SkyFormErrorsModule, typeof i5.SkyFormErrorModule, typeof i6.SkyFormsResourcesModule, typeof i7.SkyInputBoxControlDirective, typeof i8.SkyInputBoxHelpInlineComponent, typeof i9.SkyThemeModule], [typeof i1.SkyInputBoxComponent, typeof i7.SkyInputBoxControlDirective, typeof i5.SkyFormErrorModule]>;
12
14
  static ɵinj: i0.ɵɵInjectorDeclaration<SkyInputBoxModule>;
13
15
  }
@@ -17,16 +17,20 @@ export declare class SkyRadioGroupComponent implements AfterContentInit, AfterVi
17
17
  * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).
18
18
  * If the radio button group does not include a visible label, use `ariaLabel` instead.
19
19
  * For more information about the `aria-labelledby` attribute, see the [WAI-ARIA definition](https://www.w3.org/TR/wai-aria/#aria-labelledby).
20
+ * @deprecated Use `labelText` instead.
20
21
  */
21
- ariaLabelledBy: string | undefined;
22
+ set ariaLabelledBy(value: string | undefined);
23
+ get ariaLabelledBy(): string | undefined;
22
24
  /**
23
25
  * The ARIA label for the radio button group. This sets the
24
26
  * radio button group's `aria-label` attribute to provide a text equivalent for screen readers
25
27
  * [to support accessibility](https://developer.blackbaud.com/skyux/learn/accessibility).
26
28
  * If the radio button group includes a visible label, use `ariaLabelledBy` instead.
27
29
  * For more information about the `aria-label` attribute, see the [WAI-ARIA definition](https://www.w3.org/TR/wai-aria/#aria-label).
30
+ * @deprecated Use `labelText` instead.
28
31
  */
29
- ariaLabel: string | undefined;
32
+ set ariaLabel(value: string | undefined);
33
+ get ariaLabel(): string | undefined;
30
34
  /**
31
35
  * Whether to disable the input on template-driven forms. Don't use this input on reactive forms because they may overwrite the input or leave the control out of sync.
32
36
  * To set the disabled state on reactive forms, use the `FormControl` instead.
@@ -66,6 +70,14 @@ export declare class SkyRadioGroupComponent implements AfterContentInit, AfterVi
66
70
  */
67
71
  set tabIndex(value: number | undefined);
68
72
  get tabIndex(): number | undefined;
73
+ /**
74
+ * The text to display as the radio group's label.
75
+ */
76
+ labelText: string | undefined;
77
+ /**
78
+ * Indicates whether to hide the `labelText`.
79
+ */
80
+ labelHidden: boolean;
69
81
  /**
70
82
  * Our radio components are usually implemented using an unordered list. This is an
71
83
  * accessibility violation because the unordered list has an implicit role which
@@ -75,6 +87,9 @@ export declare class SkyRadioGroupComponent implements AfterContentInit, AfterVi
75
87
  */
76
88
  ariaOwns: string | undefined;
77
89
  radios: QueryList<SkyRadioComponent> | undefined;
90
+ protected labelId: string;
91
+ protected errorId: string;
92
+ protected ngControl: NgControl | undefined;
78
93
  constructor(changeDetector: ChangeDetectorRef, radioGroupIdSvc: SkyRadioGroupIdService, ngControl: NgControl);
79
94
  ngAfterContentInit(): void;
80
95
  ngAfterViewInit(): void;
@@ -89,5 +104,5 @@ export declare class SkyRadioGroupComponent implements AfterContentInit, AfterVi
89
104
  registerOnChange(fn: (value: any) => void): void;
90
105
  registerOnTouched(fn: any): void;
91
106
  static ɵfac: i0.ɵɵFactoryDeclaration<SkyRadioGroupComponent, [null, null, { optional: true; self: true; }]>;
92
- static ɵcmp: i0.ɵɵComponentDeclaration<SkyRadioGroupComponent, "sky-radio-group", never, { "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "name": { "alias": "name"; "required": false; }; "required": { "alias": "required"; "required": false; }; "value": { "alias": "value"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; }, {}, ["radios"], ["*"], false, never>;
107
+ static ɵcmp: i0.ɵɵComponentDeclaration<SkyRadioGroupComponent, "sky-radio-group", never, { "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "name": { "alias": "name"; "required": false; }; "required": { "alias": "required"; "required": false; }; "value": { "alias": "value"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "labelText": { "alias": "labelText"; "required": false; }; "labelHidden": { "alias": "labelHidden"; "required": false; }; }, {}, ["radios"], ["*", "sky-form-error"], false, never>;
93
108
  }
@@ -4,10 +4,13 @@ import * as i2 from "./radio-group.component";
4
4
  import * as i3 from "./radio-label.component";
5
5
  import * as i4 from "@angular/common";
6
6
  import * as i5 from "@angular/forms";
7
- import * as i6 from "@skyux/indicators";
8
- import * as i7 from "@skyux/core";
7
+ import * as i6 from "../form-error/form-error.module";
8
+ import * as i7 from "../form-error/form-errors.module";
9
+ import * as i8 from "@skyux/indicators";
10
+ import * as i9 from "@skyux/core";
11
+ import * as i10 from "../shared/sky-forms-resources.module";
9
12
  export declare class SkyRadioModule {
10
13
  static ɵfac: i0.ɵɵFactoryDeclaration<SkyRadioModule, never>;
11
- static ɵmod: i0.ɵɵNgModuleDeclaration<SkyRadioModule, [typeof i1.SkyRadioComponent, typeof i2.SkyRadioGroupComponent, typeof i3.SkyRadioLabelComponent], [typeof i4.CommonModule, typeof i5.FormsModule, typeof i6.SkyIconModule, typeof i7.SkyTrimModule], [typeof i1.SkyRadioComponent, typeof i2.SkyRadioGroupComponent, typeof i3.SkyRadioLabelComponent]>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SkyRadioModule, [typeof i1.SkyRadioComponent, typeof i2.SkyRadioGroupComponent, typeof i3.SkyRadioLabelComponent], [typeof i4.CommonModule, typeof i5.FormsModule, typeof i6.SkyFormErrorModule, typeof i7.SkyFormErrorsModule, typeof i8.SkyIconModule, typeof i9.SkyIdModule, typeof i10.SkyFormsResourcesModule, typeof i9.SkyTrimModule], [typeof i6.SkyFormErrorModule, typeof i1.SkyRadioComponent, typeof i2.SkyRadioGroupComponent, typeof i3.SkyRadioLabelComponent]>;
12
15
  static ɵinj: i0.ɵɵInjectorDeclaration<SkyRadioModule>;
13
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyux/forms",
3
- "version": "10.0.0-alpha.0",
3
+ "version": "10.0.0-alpha.2",
4
4
  "author": "Blackbaud, Inc.",
5
5
  "keywords": [
6
6
  "blackbaud",
@@ -36,17 +36,17 @@
36
36
  }
37
37
  },
38
38
  "peerDependencies": {
39
- "@angular/cdk": "^17.1.0",
40
- "@angular/common": "^17.1.0",
41
- "@angular/core": "^17.1.0",
42
- "@angular/forms": "^17.1.0",
43
- "@angular/platform-browser": "^17.1.0",
44
- "@skyux-sdk/testing": "10.0.0-alpha.0",
45
- "@skyux/core": "10.0.0-alpha.0",
46
- "@skyux/i18n": "10.0.0-alpha.0",
47
- "@skyux/indicators": "10.0.0-alpha.0",
48
- "@skyux/popovers": "10.0.0-alpha.0",
49
- "@skyux/theme": "10.0.0-alpha.0"
39
+ "@angular/cdk": "^17.1.1",
40
+ "@angular/common": "^17.1.1",
41
+ "@angular/core": "^17.1.1",
42
+ "@angular/forms": "^17.1.1",
43
+ "@angular/platform-browser": "^17.1.1",
44
+ "@skyux-sdk/testing": "10.0.0-alpha.2",
45
+ "@skyux/core": "10.0.0-alpha.2",
46
+ "@skyux/i18n": "10.0.0-alpha.2",
47
+ "@skyux/indicators": "10.0.0-alpha.2",
48
+ "@skyux/popovers": "10.0.0-alpha.2",
49
+ "@skyux/theme": "10.0.0-alpha.2"
50
50
  },
51
51
  "dependencies": {
52
52
  "tslib": "^2.6.2"
@@ -68,4 +68,6 @@ export declare class SkyCheckboxHarness extends SkyComponentHarness {
68
68
  * Puts the checkbox in an unchecked state by toggling it if it is currently checked, or doing nothing if it is already unchecked.
69
69
  */
70
70
  uncheck(): Promise<void>;
71
+ hasRequiredError(): Promise<boolean>;
72
+ hasCustomError(errorName: string): Promise<boolean>;
71
73
  }
@@ -2,7 +2,6 @@ import { HarnessPredicate } from '@angular/cdk/testing';
2
2
  import { SkyComponentHarness } from '@skyux/core/testing';
3
3
  import { SkyFormErrorHarnessFilters } from './form-error-harness.filters';
4
4
  export declare class SkyFormErrorHarness extends SkyComponentHarness {
5
- #private;
6
5
  /**
7
6
  * @internal
8
7
  */
@@ -12,5 +11,8 @@ export declare class SkyFormErrorHarness extends SkyComponentHarness {
12
11
  * `SkyFormErrorHarness` that meets certain criteria
13
12
  */
14
13
  static with(filters: SkyFormErrorHarnessFilters): HarnessPredicate<SkyFormErrorHarness>;
15
- getFirstClassError(): Promise<string>;
14
+ /**
15
+ * Gets the error name.
16
+ */
17
+ getErrorName(): Promise<string | null>;
16
18
  }
@@ -2,7 +2,6 @@ import { HarnessPredicate } from '@angular/cdk/testing';
2
2
  import { SkyComponentHarness } from '@skyux/core/testing';
3
3
  import { SkyFormErrorsHarnessFilters } from './form-errors-harness.filters';
4
4
  export declare class SkyFormErrorsHarness extends SkyComponentHarness {
5
- #private;
6
5
  /**
7
6
  * @internal
8
7
  */
@@ -12,14 +11,14 @@ export declare class SkyFormErrorsHarness extends SkyComponentHarness {
12
11
  * `SkyFormErrorsHarness` that meets certain criteria
13
12
  */
14
13
  static with(filters: SkyFormErrorsHarnessFilters): HarnessPredicate<SkyFormErrorsHarness>;
15
- getNumberOfErrors(): Promise<number>;
16
- hasRequiredError(): Promise<boolean>;
17
- hasMaxLengthError(): Promise<boolean>;
18
- hasMinLengthError(): Promise<boolean>;
19
- hasCharacterCountError(): Promise<boolean>;
20
- hasDateError(): Promise<boolean>;
21
- hasEmailError(): Promise<boolean>;
22
- hasPhoneFieldError(): Promise<boolean>;
23
- hasTimeError(): Promise<boolean>;
24
- hasUrlError(): Promise<boolean>;
14
+ /**
15
+ * Gets a list of all errors fired.
16
+ */
17
+ getFormErrors(): Promise<{
18
+ errorName: string | null;
19
+ }[]>;
20
+ /**
21
+ * Whether an error with the given name has fired.
22
+ */
23
+ hasError(errorName: string): Promise<boolean>;
25
24
  }
@@ -32,6 +32,42 @@ export declare class SkyInputBoxHarness extends SkyComponentHarness {
32
32
  * handled by input box.
33
33
  */
34
34
  getCustomErrors(): Promise<SkyStatusIndicatorHarness[]>;
35
+ /**
36
+ * Whether the custom error is triggered.
37
+ */
38
+ hasCustomFormError(errorName: string): Promise<boolean>;
39
+ /**
40
+ * Whether the required field is empty.
41
+ */
42
+ hasRequiredError(): Promise<boolean>;
43
+ /**
44
+ * Whether the field has more characters than allowed.
45
+ */
46
+ hasMaxLengthError(): Promise<boolean>;
47
+ /**
48
+ * Whether the field has fewer characters than allowed.
49
+ */
50
+ hasMinLengthError(): Promise<boolean>;
51
+ /**
52
+ * Whether the field is set to an invalid email address.
53
+ */
54
+ hasEmailError(): Promise<boolean>;
55
+ /**
56
+ * Whether the field is set to an invalid URL.
57
+ */
58
+ hasUrlError(): Promise<boolean>;
59
+ /**
60
+ * Whether the field is set to an invalid date.
61
+ */
62
+ hasDateError(): Promise<boolean>;
63
+ /**
64
+ * Whether the field is set to an invalid phone number.
65
+ */
66
+ hasPhoneFieldError(): Promise<boolean>;
67
+ /**
68
+ * Whether the field is set to an invalid time.
69
+ */
70
+ hasTimeError(): Promise<boolean>;
35
71
  /**
36
72
  * Indicates whether the input box has disabled styles applied.
37
73
  */
@@ -51,7 +87,6 @@ export declare class SkyInputBoxHarness extends SkyComponentHarness {
51
87
  getHintText(): Promise<string>;
52
88
  /**
53
89
  * Indicates whether the input box has stacked styles applied.
54
- * @returns
55
90
  */
56
91
  getStacked(): Promise<boolean>;
57
92
  }