@danske/sapphire-angular 3.8.2 → 3.9.0

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.
@@ -1,5 +1,6 @@
1
1
  export { SapphireFieldModule } from './src/field.module';
2
2
  export { FieldComponent } from './src/field.component';
3
+ export { FieldsetComponent } from './src/field.component';
3
4
  export { FieldNoteDirective } from './src/field-note.directive';
4
5
  export { FieldErrorDirective } from './src/field-error.directive';
5
6
  export { FieldLabelDirective } from './src/field-label.directive';
@@ -9,7 +9,15 @@ export declare class FieldErrorDirective {
9
9
  * If none is supplied, it will be auto-generated.
10
10
  */
11
11
  id: string;
12
- target?: FieldControl;
12
+ /**
13
+ * Target for the error. Can be either a specific control or a nested field.
14
+ * When set, only the targeted control/field will show the error state.
15
+ */
16
+ target?: FieldControl | {
17
+ controls?: {
18
+ toArray(): FieldControl[];
19
+ };
20
+ };
13
21
  static ɵfac: i0.ɵɵFactoryDeclaration<FieldErrorDirective, never>;
14
22
  static ɵdir: i0.ɵɵDirectiveDeclaration<FieldErrorDirective, "sp-field-error", never, { "id": "id"; "target": "target"; }, {}, never, never, true, never>;
15
23
  }
@@ -35,6 +35,7 @@ import * as i1 from "../../common/sapphire-view-encapsulation";
35
35
  */
36
36
  export declare class FieldComponent implements AfterContentInit, AfterViewChecked, IconSizeProvider {
37
37
  private changeDetectorRef;
38
+ private fieldset?;
38
39
  /**
39
40
  * Whether the necessity indicator should be visible.
40
41
  */
@@ -77,14 +78,17 @@ export declare class FieldComponent implements AfterContentInit, AfterViewChecke
77
78
  */
78
79
  _noteSuffixPortal: DomPortal<HTMLElement> | null;
79
80
  private changed;
80
- constructor(changeDetectorRef: ChangeDetectorRef, iconRegistry: IconRegistry);
81
+ constructor(changeDetectorRef: ChangeDetectorRef, iconRegistry: IconRegistry, fieldset?: FieldsetComponent | undefined);
81
82
  ngAfterContentInit(): void;
82
83
  ngAfterViewInit(): void;
83
84
  ngAfterViewChecked(): void;
84
85
  /**
85
86
  * Whether the field contains an error message (sp-field-error).
87
+ * Also checks if a parent fieldset has an error.
86
88
  */
87
89
  hasError(targetField?: FieldControl): boolean;
90
+ private _hasOwnError;
91
+ private _isFieldControl;
88
92
  /**
89
93
  * If there are multiple controls, the field is only disabled when all of them are disabled
90
94
  */
@@ -104,6 +108,10 @@ export declare class FieldComponent implements AfterContentInit, AfterViewChecke
104
108
  hasRadioGroupChild(): boolean;
105
109
  get labelNecessityIndicator(): LabelComponent['necessityIndicator'];
106
110
  _setSuffixPortal(portal: DomPortal<HTMLElement> | null): void;
107
- static ɵfac: i0.ɵɵFactoryDeclaration<FieldComponent, never>;
111
+ static ɵfac: i0.ɵɵFactoryDeclaration<FieldComponent, [null, null, { optional: true; skipSelf: true; }]>;
108
112
  static ɵcmp: i0.ɵɵComponentDeclaration<FieldComponent, "sp-field", never, { "necessityIndicator": "necessityIndicator"; "labelPlacement": "labelPlacement"; "noDefaultWidth": "noDefaultWidth"; "allowNoteAndError": "allowNoteAndError"; "size": "size"; }, {}, ["note", "error", "_fieldLabel", "radioGroup", "ngControl", "requiredValidator", "controls"], ["sp-field-label", "sp-help-button", "*", "sp-field-error", "sp-field-note"], false, [{ directive: typeof i1.UseComponentStylesOnHost; inputs: {}; outputs: {}; }]>;
109
113
  }
114
+ export declare class FieldsetComponent extends FieldComponent {
115
+ static ɵfac: i0.ɵɵFactoryDeclaration<FieldsetComponent, never>;
116
+ static ɵcmp: i0.ɵɵComponentDeclaration<FieldsetComponent, "sp-fieldset", never, {}, {}, never, ["sp-field-label", "sp-help-button", "*", "sp-field-error", "sp-field-note"], false, [{ directive: typeof i1.UseComponentStylesOnHost; inputs: {}; outputs: {}; }]>;
117
+ }
@@ -10,6 +10,6 @@ import * as i8 from "../../label/src/label.component";
10
10
  import * as i9 from "../../icon/src/icon.module";
11
11
  export declare class SapphireFieldModule {
12
12
  static ɵfac: i0.ɵɵFactoryDeclaration<SapphireFieldModule, never>;
13
- static ɵmod: i0.ɵɵNgModuleDeclaration<SapphireFieldModule, [typeof i1.FieldComponent], [typeof i2.NgIf, typeof i3.FieldLabelDirective, typeof i4.FieldNoteDirective, typeof i5.FieldNoteSuffixDirective, typeof i6.FieldErrorDirective, typeof i7.PortalModule, typeof i8.LabelComponent, typeof i2.CommonModule, typeof i9.SapphireIconModule], [typeof i3.FieldLabelDirective, typeof i4.FieldNoteDirective, typeof i5.FieldNoteSuffixDirective, typeof i6.FieldErrorDirective, typeof i1.FieldComponent]>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SapphireFieldModule, [typeof i1.FieldComponent, typeof i1.FieldsetComponent], [typeof i2.NgIf, typeof i3.FieldLabelDirective, typeof i4.FieldNoteDirective, typeof i5.FieldNoteSuffixDirective, typeof i6.FieldErrorDirective, typeof i7.PortalModule, typeof i8.LabelComponent, typeof i2.CommonModule, typeof i9.SapphireIconModule], [typeof i3.FieldLabelDirective, typeof i4.FieldNoteDirective, typeof i5.FieldNoteSuffixDirective, typeof i6.FieldErrorDirective, typeof i1.FieldComponent, typeof i1.FieldsetComponent]>;
14
14
  static ɵinj: i0.ɵɵInjectorDeclaration<SapphireFieldModule>;
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danske/sapphire-angular",
3
- "version": "3.8.2",
3
+ "version": "3.9.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "description": "The Angular implementation of the Sapphire Design System from Danske Bank A/S",
6
6
  "module": "fesm2015/danske-sapphire-angular.mjs",
@@ -21,7 +21,7 @@
21
21
  "dompurify": "^3.2.6",
22
22
  "tslib": "^2.3.0"
23
23
  },
24
- "gitHead": "6e7cb3028dc134adc624e161700df8cb3bc3bfb7",
24
+ "gitHead": "16211b81aadc435461763b838c77f4951e9dad50",
25
25
  "es2020": "fesm2020/danske-sapphire-angular.mjs",
26
26
  "esm2020": "esm2020/danske-sapphire-angular.mjs",
27
27
  "fesm2020": "fesm2020/danske-sapphire-angular.mjs",