@skyux/forms 10.22.0 → 10.23.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.
- package/documentation.json +3005 -2629
- package/esm2022/lib/modules/checkbox/checkbox-group.component.mjs +43 -20
- package/esm2022/lib/modules/radio/radio-group.component.mjs +47 -24
- package/fesm2022/skyux-forms.mjs +88 -42
- package/fesm2022/skyux-forms.mjs.map +1 -1
- package/lib/modules/checkbox/checkbox-group.component.d.ts +10 -7
- package/lib/modules/radio/radio-group.component.d.ts +11 -8
- package/package.json +8 -8
package/fesm2022/skyux-forms.mjs
CHANGED
|
@@ -507,38 +507,58 @@ class SkyCheckboxGroupComponent {
|
|
|
507
507
|
*/
|
|
508
508
|
this.headingHidden = false;
|
|
509
509
|
/**
|
|
510
|
-
* The
|
|
510
|
+
* The heading [font style](https://developer.blackbaud.com/skyux/design/styles/typography#headings).
|
|
511
511
|
* @preview
|
|
512
|
-
* @default
|
|
512
|
+
* @default 4
|
|
513
513
|
*/
|
|
514
|
-
this.
|
|
514
|
+
this.headingStyle = 4;
|
|
515
515
|
/**
|
|
516
516
|
* Whether the checkbox group is required.
|
|
517
517
|
* @preview
|
|
518
518
|
*/
|
|
519
519
|
this.required = false;
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
* vertical spacing is automatically added to the checkbox group.
|
|
523
|
-
* @preview
|
|
524
|
-
*/
|
|
525
|
-
this.stacked = false;
|
|
520
|
+
this.stackedLg = false;
|
|
521
|
+
this.stackedXL = false;
|
|
526
522
|
this.#idSvc = inject(SkyIdService);
|
|
527
523
|
this.errorId = this.#idSvc.generateId();
|
|
528
524
|
this.formErrorsDataId = 'checkbox-group-form-errors';
|
|
529
|
-
this
|
|
525
|
+
this.#_stacked = false;
|
|
530
526
|
}
|
|
531
527
|
/**
|
|
532
|
-
* The heading
|
|
528
|
+
* The semantic heading level in the document structure. By default, the heading text is not wrapped in a heading element.
|
|
533
529
|
* @preview
|
|
534
|
-
* @default 3
|
|
535
530
|
*/
|
|
536
|
-
set
|
|
537
|
-
this
|
|
531
|
+
set headingLevel(value) {
|
|
532
|
+
this.#_headingLevel = value && !isNaN(value) ? value : undefined;
|
|
533
|
+
this.#updateStackedClasses();
|
|
534
|
+
}
|
|
535
|
+
get headingLevel() {
|
|
536
|
+
return this.#_headingLevel;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Whether the checkbox group is stacked on another form component. When specified, the appropriate
|
|
540
|
+
* vertical spacing is automatically added to the checkbox group.
|
|
541
|
+
* @preview
|
|
542
|
+
*/
|
|
543
|
+
set stacked(value) {
|
|
544
|
+
this.#_stacked = value;
|
|
545
|
+
this.#updateStackedClasses();
|
|
546
|
+
}
|
|
547
|
+
get stacked() {
|
|
548
|
+
return this.#_stacked;
|
|
549
|
+
}
|
|
550
|
+
get headingClass() {
|
|
551
|
+
return `sky-font-heading-${this.headingStyle}`;
|
|
538
552
|
}
|
|
539
553
|
#idSvc;
|
|
554
|
+
#_headingLevel;
|
|
555
|
+
#_stacked;
|
|
556
|
+
#updateStackedClasses() {
|
|
557
|
+
this.stackedLg = !this.headingLevel && this.stacked;
|
|
558
|
+
this.stackedXL = !!this.headingLevel && this.stacked;
|
|
559
|
+
}
|
|
540
560
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: SkyCheckboxGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
541
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.3.4", type: SkyCheckboxGroupComponent, isStandalone: true, selector: "sky-checkbox-group", inputs: { helpPopoverContent: "helpPopoverContent", helpPopoverTitle: "helpPopoverTitle", headingText: "headingText", headingHidden: ["headingHidden", "headingHidden", booleanAttribute], headingLevel: ["headingLevel", "headingLevel", numberAttribute], headingStyle: ["headingStyle", "headingStyle", numberAttribute], hintText: "hintText", required: ["required", "required", booleanAttribute], stacked: ["stacked", "stacked", booleanAttribute], formGroup: "formGroup", helpKey: "helpKey" }, host: { properties: { "class.sky-margin-stacked-lg": "this.stacked" } }, providers: [{ provide: SKY_FORM_ERRORS_ENABLED, useValue: true }], ngImport: i0, template: "<fieldset\n class=\"sky-checkbox-group\"\n [attr.aria-invalid]=\"!!formGroup.errors\"\n [attr.aria-describedby]=\"hintText ? hintTextEl.id : undefined\"\n [attr.aria-errormessage]=\"\n headingText && formGroup.errors ? errorId : undefined\n \"\n>\n <legend\n class=\"sky-control-label\"\n [ngClass]=\"{\n 'sky-screen-reader-only': headingHidden,\n 'sky-margin-stacked-xs': !!hintText,\n 'sky-margin-stacked-sm': !hintText\n }\"\n >\n <span\n class=\"sky-margin-inline-xs\"\n [ngClass]=\"{\n 'sky-control-label-required': required\n }\"\n >\n <h3 *ngIf=\"headingLevel === 3\" [class]=\"headingClass\">\n {{ headingText }}\n </h3>\n <h4 *ngIf=\"headingLevel === 4\" [class]=\"headingClass\">\n {{ headingText }}\n </h4>\n <h5 *ngIf=\"headingLevel === 5\" [class]=\"headingClass\">\n {{ headingText }}\n </h5> </span\n ><span class=\"sky-screen-reader-only\" *ngIf=\"required\">{{\n 'skyux_checkbox_group_required' | skyLibResources\n }}</span\n ><sky-help-inline\n *ngIf=\"helpPopoverContent || helpKey\"\n [helpKey]=\"helpKey\"\n [labelText]=\"headingText\"\n [popoverTitle]=\"helpPopoverTitle\"\n [popoverContent]=\"helpPopoverContent\"\n />\n </legend>\n <div\n skyId\n [ngClass]=\"{\n 'sky-font-deemphasized sky-margin-stacked-lg sky-checkbox-group-hint-text':\n !!hintText\n }\"\n #hintTextEl=\"skyId\"\n >\n {{ hintText }}\n </div>\n <span class=\"sky-checkbox-group-inline sky-switch-icon-group\">\n <ng-content select=\"sky-checkbox[icon]\" />\n </span>\n <span class=\"sky-checkbox-group-stacked\">\n <ng-content select=\"sky-checkbox\" />\n </span>\n</fieldset>\n<sky-form-errors\n *ngIf=\"headingText && formGroup.errors\"\n [id]=\"errorId\"\n [attr.data-sky-id]=\"formErrorsDataId\"\n [errors]=\"formGroup.errors\"\n [labelText]=\"headingText\"\n [showErrors]=\"formGroup.touched || formGroup.dirty\"\n>\n <ng-content select=\"sky-form-error\" />\n</sky-form-errors>\n", styles: [":host{display:block}h3,h4,h5{margin:0;display:inline-block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: SkyFormErrorsModule }, { kind: "component", type: SkyFormErrorsComponent, selector: "sky-form-errors", inputs: ["errors", "labelText", "showErrors"] }, { kind: "ngmodule", type: SkyFormsResourcesModule }, { kind: "pipe", type: i2.SkyLibResourcesPipe, name: "skyLibResources" }, { kind: "ngmodule", type: SkyHelpInlineModule }, { kind: "component", type: i4.λ1, selector: "sky-help-inline", inputs: ["ariaControls", "ariaExpanded", "ariaLabel", "labelText", "popoverContent", "popoverTitle", "helpKey"], outputs: ["actionClick"] }, { kind: "ngmodule", type: SkyIdModule }, { kind: "directive", type: i1$1.λ2, selector: "[skyId]", exportAs: ["skyId"] }] }); }
|
|
561
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.3.4", type: SkyCheckboxGroupComponent, isStandalone: true, selector: "sky-checkbox-group", inputs: { helpPopoverContent: "helpPopoverContent", helpPopoverTitle: "helpPopoverTitle", headingText: "headingText", headingHidden: ["headingHidden", "headingHidden", booleanAttribute], headingLevel: ["headingLevel", "headingLevel", numberAttribute], headingStyle: ["headingStyle", "headingStyle", numberAttribute], hintText: "hintText", required: ["required", "required", booleanAttribute], stacked: ["stacked", "stacked", booleanAttribute], formGroup: "formGroup", helpKey: "helpKey" }, host: { properties: { "class.sky-margin-stacked-lg": "this.stackedLg", "class.sky-margin-stacked-xl": "this.stackedXL" } }, providers: [{ provide: SKY_FORM_ERRORS_ENABLED, useValue: true }], ngImport: i0, template: "<fieldset\n class=\"sky-checkbox-group\"\n [attr.aria-invalid]=\"!!formGroup.errors\"\n [attr.aria-describedby]=\"hintText ? hintTextEl.id : undefined\"\n [attr.aria-errormessage]=\"\n headingText && formGroup.errors ? errorId : undefined\n \"\n>\n <legend\n class=\"sky-control-label\"\n [ngClass]=\"{\n 'sky-screen-reader-only': headingHidden,\n 'sky-margin-stacked-xs': !!hintText,\n 'sky-margin-stacked-sm': !hintText\n }\"\n >\n <span\n class=\"sky-margin-inline-xs\"\n [ngClass]=\"{\n 'sky-control-label-required': required\n }\"\n >\n <span *ngIf=\"!headingLevel\" [class]=\"'sky-heading-text ' + headingClass\">\n {{ headingText }}\n </span>\n <h3 *ngIf=\"headingLevel === 3\" [class]=\"headingClass\">\n {{ headingText }}\n </h3>\n <h4 *ngIf=\"headingLevel === 4\" [class]=\"headingClass\">\n {{ headingText }}\n </h4>\n <h5 *ngIf=\"headingLevel === 5\" [class]=\"headingClass\">\n {{ headingText }}\n </h5> </span\n ><span class=\"sky-screen-reader-only\" *ngIf=\"required\">{{\n 'skyux_checkbox_group_required' | skyLibResources\n }}</span\n ><sky-help-inline\n *ngIf=\"helpPopoverContent || helpKey\"\n [helpKey]=\"helpKey\"\n [labelText]=\"headingText\"\n [popoverTitle]=\"helpPopoverTitle\"\n [popoverContent]=\"helpPopoverContent\"\n />\n </legend>\n <div\n skyId\n [ngClass]=\"{\n 'sky-font-deemphasized sky-margin-stacked-lg sky-checkbox-group-hint-text':\n !!hintText\n }\"\n #hintTextEl=\"skyId\"\n >\n {{ hintText }}\n </div>\n <span class=\"sky-checkbox-group-inline sky-switch-icon-group\">\n <ng-content select=\"sky-checkbox[icon]\" />\n </span>\n <span class=\"sky-checkbox-group-stacked\">\n <ng-content select=\"sky-checkbox\" />\n </span>\n</fieldset>\n<sky-form-errors\n *ngIf=\"headingText && formGroup.errors\"\n [id]=\"errorId\"\n [attr.data-sky-id]=\"formErrorsDataId\"\n [errors]=\"formGroup.errors\"\n [labelText]=\"headingText\"\n [showErrors]=\"formGroup.touched || formGroup.dirty\"\n>\n <ng-content select=\"sky-form-error\" />\n</sky-form-errors>\n", styles: [":host{display:block}h3,h4,h5{margin:0;display:inline-block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: SkyFormErrorsModule }, { kind: "component", type: SkyFormErrorsComponent, selector: "sky-form-errors", inputs: ["errors", "labelText", "showErrors"] }, { kind: "ngmodule", type: SkyFormsResourcesModule }, { kind: "pipe", type: i2.SkyLibResourcesPipe, name: "skyLibResources" }, { kind: "ngmodule", type: SkyHelpInlineModule }, { kind: "component", type: i4.λ1, selector: "sky-help-inline", inputs: ["ariaControls", "ariaExpanded", "ariaLabel", "labelText", "popoverContent", "popoverTitle", "helpKey"], outputs: ["actionClick"] }, { kind: "ngmodule", type: SkyIdModule }, { kind: "directive", type: i1$1.λ2, selector: "[skyId]", exportAs: ["skyId"] }] }); }
|
|
542
562
|
}
|
|
543
563
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: SkyCheckboxGroupComponent, decorators: [{
|
|
544
564
|
type: Component,
|
|
@@ -548,7 +568,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
548
568
|
SkyFormsResourcesModule,
|
|
549
569
|
SkyHelpInlineModule,
|
|
550
570
|
SkyIdModule,
|
|
551
|
-
], providers: [{ provide: SKY_FORM_ERRORS_ENABLED, useValue: true }], template: "<fieldset\n class=\"sky-checkbox-group\"\n [attr.aria-invalid]=\"!!formGroup.errors\"\n [attr.aria-describedby]=\"hintText ? hintTextEl.id : undefined\"\n [attr.aria-errormessage]=\"\n headingText && formGroup.errors ? errorId : undefined\n \"\n>\n <legend\n class=\"sky-control-label\"\n [ngClass]=\"{\n 'sky-screen-reader-only': headingHidden,\n 'sky-margin-stacked-xs': !!hintText,\n 'sky-margin-stacked-sm': !hintText\n }\"\n >\n <span\n class=\"sky-margin-inline-xs\"\n [ngClass]=\"{\n 'sky-control-label-required': required\n }\"\n >\n <h3 *ngIf=\"headingLevel === 3\" [class]=\"headingClass\">\n {{ headingText }}\n </h3>\n <h4 *ngIf=\"headingLevel === 4\" [class]=\"headingClass\">\n {{ headingText }}\n </h4>\n <h5 *ngIf=\"headingLevel === 5\" [class]=\"headingClass\">\n {{ headingText }}\n </h5> </span\n ><span class=\"sky-screen-reader-only\" *ngIf=\"required\">{{\n 'skyux_checkbox_group_required' | skyLibResources\n }}</span\n ><sky-help-inline\n *ngIf=\"helpPopoverContent || helpKey\"\n [helpKey]=\"helpKey\"\n [labelText]=\"headingText\"\n [popoverTitle]=\"helpPopoverTitle\"\n [popoverContent]=\"helpPopoverContent\"\n />\n </legend>\n <div\n skyId\n [ngClass]=\"{\n 'sky-font-deemphasized sky-margin-stacked-lg sky-checkbox-group-hint-text':\n !!hintText\n }\"\n #hintTextEl=\"skyId\"\n >\n {{ hintText }}\n </div>\n <span class=\"sky-checkbox-group-inline sky-switch-icon-group\">\n <ng-content select=\"sky-checkbox[icon]\" />\n </span>\n <span class=\"sky-checkbox-group-stacked\">\n <ng-content select=\"sky-checkbox\" />\n </span>\n</fieldset>\n<sky-form-errors\n *ngIf=\"headingText && formGroup.errors\"\n [id]=\"errorId\"\n [attr.data-sky-id]=\"formErrorsDataId\"\n [errors]=\"formGroup.errors\"\n [labelText]=\"headingText\"\n [showErrors]=\"formGroup.touched || formGroup.dirty\"\n>\n <ng-content select=\"sky-form-error\" />\n</sky-form-errors>\n", styles: [":host{display:block}h3,h4,h5{margin:0;display:inline-block}\n"] }]
|
|
571
|
+
], providers: [{ provide: SKY_FORM_ERRORS_ENABLED, useValue: true }], template: "<fieldset\n class=\"sky-checkbox-group\"\n [attr.aria-invalid]=\"!!formGroup.errors\"\n [attr.aria-describedby]=\"hintText ? hintTextEl.id : undefined\"\n [attr.aria-errormessage]=\"\n headingText && formGroup.errors ? errorId : undefined\n \"\n>\n <legend\n class=\"sky-control-label\"\n [ngClass]=\"{\n 'sky-screen-reader-only': headingHidden,\n 'sky-margin-stacked-xs': !!hintText,\n 'sky-margin-stacked-sm': !hintText\n }\"\n >\n <span\n class=\"sky-margin-inline-xs\"\n [ngClass]=\"{\n 'sky-control-label-required': required\n }\"\n >\n <span *ngIf=\"!headingLevel\" [class]=\"'sky-heading-text ' + headingClass\">\n {{ headingText }}\n </span>\n <h3 *ngIf=\"headingLevel === 3\" [class]=\"headingClass\">\n {{ headingText }}\n </h3>\n <h4 *ngIf=\"headingLevel === 4\" [class]=\"headingClass\">\n {{ headingText }}\n </h4>\n <h5 *ngIf=\"headingLevel === 5\" [class]=\"headingClass\">\n {{ headingText }}\n </h5> </span\n ><span class=\"sky-screen-reader-only\" *ngIf=\"required\">{{\n 'skyux_checkbox_group_required' | skyLibResources\n }}</span\n ><sky-help-inline\n *ngIf=\"helpPopoverContent || helpKey\"\n [helpKey]=\"helpKey\"\n [labelText]=\"headingText\"\n [popoverTitle]=\"helpPopoverTitle\"\n [popoverContent]=\"helpPopoverContent\"\n />\n </legend>\n <div\n skyId\n [ngClass]=\"{\n 'sky-font-deemphasized sky-margin-stacked-lg sky-checkbox-group-hint-text':\n !!hintText\n }\"\n #hintTextEl=\"skyId\"\n >\n {{ hintText }}\n </div>\n <span class=\"sky-checkbox-group-inline sky-switch-icon-group\">\n <ng-content select=\"sky-checkbox[icon]\" />\n </span>\n <span class=\"sky-checkbox-group-stacked\">\n <ng-content select=\"sky-checkbox\" />\n </span>\n</fieldset>\n<sky-form-errors\n *ngIf=\"headingText && formGroup.errors\"\n [id]=\"errorId\"\n [attr.data-sky-id]=\"formErrorsDataId\"\n [errors]=\"formGroup.errors\"\n [labelText]=\"headingText\"\n [showErrors]=\"formGroup.touched || formGroup.dirty\"\n>\n <ng-content select=\"sky-form-error\" />\n</sky-form-errors>\n", styles: [":host{display:block}h3,h4,h5{margin:0;display:inline-block}\n"] }]
|
|
552
572
|
}], propDecorators: { helpPopoverContent: [{
|
|
553
573
|
type: Input
|
|
554
574
|
}], helpPopoverTitle: [{
|
|
@@ -573,14 +593,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
573
593
|
}], stacked: [{
|
|
574
594
|
type: Input,
|
|
575
595
|
args: [{ transform: booleanAttribute }]
|
|
576
|
-
}, {
|
|
577
|
-
type: HostBinding,
|
|
578
|
-
args: ['class.sky-margin-stacked-lg']
|
|
579
596
|
}], formGroup: [{
|
|
580
597
|
type: Input,
|
|
581
598
|
args: [{ required: true }]
|
|
582
599
|
}], helpKey: [{
|
|
583
600
|
type: Input
|
|
601
|
+
}], stackedLg: [{
|
|
602
|
+
type: HostBinding,
|
|
603
|
+
args: ['class.sky-margin-stacked-lg']
|
|
604
|
+
}], stackedXL: [{
|
|
605
|
+
type: HostBinding,
|
|
606
|
+
args: ['class.sky-margin-stacked-xl']
|
|
584
607
|
}] } });
|
|
585
608
|
|
|
586
609
|
/**
|
|
@@ -3331,12 +3354,15 @@ class SkyRadioGroupComponent {
|
|
|
3331
3354
|
return this.#_disabled;
|
|
3332
3355
|
}
|
|
3333
3356
|
/**
|
|
3334
|
-
* The heading
|
|
3357
|
+
* The semantic heading level in the document structure. By default, the heading text is not wrapped in a heading element.
|
|
3335
3358
|
* @preview
|
|
3336
|
-
* @default 3
|
|
3337
3359
|
*/
|
|
3338
|
-
set
|
|
3339
|
-
this
|
|
3360
|
+
set headingLevel(value) {
|
|
3361
|
+
this.#_headingLevel = value && !isNaN(value) ? value : undefined;
|
|
3362
|
+
this.#updateStackedClasses();
|
|
3363
|
+
}
|
|
3364
|
+
get headingLevel() {
|
|
3365
|
+
return this.#_headingLevel;
|
|
3340
3366
|
}
|
|
3341
3367
|
/**
|
|
3342
3368
|
* The name for the collection of radio buttons that the component groups together.
|
|
@@ -3356,6 +3382,18 @@ class SkyRadioGroupComponent {
|
|
|
3356
3382
|
get name() {
|
|
3357
3383
|
return this.#_name;
|
|
3358
3384
|
}
|
|
3385
|
+
/**
|
|
3386
|
+
* Whether the radio button group is stacked on another form component. When specified,
|
|
3387
|
+
* the appropriate vertical spacing is automatically added to the radio button group.
|
|
3388
|
+
* @preview
|
|
3389
|
+
*/
|
|
3390
|
+
set stacked(value) {
|
|
3391
|
+
this.#_stacked = value;
|
|
3392
|
+
this.#updateStackedClasses();
|
|
3393
|
+
}
|
|
3394
|
+
get stacked() {
|
|
3395
|
+
return this.#_stacked;
|
|
3396
|
+
}
|
|
3359
3397
|
/**
|
|
3360
3398
|
* The value of the radio button to select by default when the group loads.
|
|
3361
3399
|
* The value corresponds to the `value` property of an individual `sky-radio` element within the
|
|
@@ -3387,6 +3425,9 @@ class SkyRadioGroupComponent {
|
|
|
3387
3425
|
get tabIndex() {
|
|
3388
3426
|
return this.#_tabIndex;
|
|
3389
3427
|
}
|
|
3428
|
+
get headingClass() {
|
|
3429
|
+
return `sky-font-heading-${this.headingStyle}`;
|
|
3430
|
+
}
|
|
3390
3431
|
#controlValue;
|
|
3391
3432
|
#defaultName;
|
|
3392
3433
|
#ngUnsubscribe;
|
|
@@ -3395,6 +3436,8 @@ class SkyRadioGroupComponent {
|
|
|
3395
3436
|
#_tabIndex;
|
|
3396
3437
|
#_ariaLabel;
|
|
3397
3438
|
#_ariaLabelledBy;
|
|
3439
|
+
#_headingLevel;
|
|
3440
|
+
#_stacked;
|
|
3398
3441
|
#changeDetector;
|
|
3399
3442
|
#radioGroupIdSvc;
|
|
3400
3443
|
#logger;
|
|
@@ -3402,11 +3445,11 @@ class SkyRadioGroupComponent {
|
|
|
3402
3445
|
#headingTextRequired;
|
|
3403
3446
|
constructor(changeDetector, radioGroupIdSvc, ngControl) {
|
|
3404
3447
|
/**
|
|
3405
|
-
* The
|
|
3448
|
+
* The heading [font style](https://developer.blackbaud.com/skyux/design/styles/typography#headings).
|
|
3406
3449
|
* @preview
|
|
3407
|
-
* @default
|
|
3450
|
+
* @default 4
|
|
3408
3451
|
*/
|
|
3409
|
-
this.
|
|
3452
|
+
this.headingStyle = 4;
|
|
3410
3453
|
/**
|
|
3411
3454
|
* Whether the input is required for form validation.
|
|
3412
3455
|
* When you set this property to `true`, the component adds `aria-required` and `required`
|
|
@@ -3416,28 +3459,24 @@ class SkyRadioGroupComponent {
|
|
|
3416
3459
|
* @default false
|
|
3417
3460
|
*/
|
|
3418
3461
|
this.required = false;
|
|
3419
|
-
/**
|
|
3420
|
-
* Whether the radio button group is stacked on another form component. When specified,
|
|
3421
|
-
* the appropriate vertical spacing is automatically added to the radio button group.
|
|
3422
|
-
* @preview
|
|
3423
|
-
*/
|
|
3424
|
-
this.stacked = false;
|
|
3425
3462
|
/**
|
|
3426
3463
|
* Indicates whether to hide the `headingText`.
|
|
3427
3464
|
* @preview
|
|
3428
3465
|
*/
|
|
3429
3466
|
this.headingHidden = false;
|
|
3467
|
+
this.stackedLg = false;
|
|
3468
|
+
this.stackedXL = false;
|
|
3430
3469
|
this.#defaultName = `sky-radio-group-${nextUniqueId++}`;
|
|
3431
3470
|
this.#ngUnsubscribe = new Subject();
|
|
3432
3471
|
this.#_disabled = false;
|
|
3433
3472
|
this.#_name = '';
|
|
3473
|
+
this.#_stacked = false;
|
|
3434
3474
|
this.#logger = inject(SkyLogService);
|
|
3435
3475
|
this.#idService = inject(SkyIdService);
|
|
3436
3476
|
this.#headingTextRequired = inject(SkyFormFieldLabelTextRequiredService, {
|
|
3437
3477
|
optional: true,
|
|
3438
3478
|
});
|
|
3439
3479
|
this.errorId = this.#idService.generateId();
|
|
3440
|
-
this.headingClass = 'sky-font-heading-3';
|
|
3441
3480
|
/* istanbul ignore next */
|
|
3442
3481
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3443
3482
|
this.#onChange = () => { };
|
|
@@ -3572,18 +3611,22 @@ class SkyRadioGroupComponent {
|
|
|
3572
3611
|
this.#updateRadioButtonTabIndexes();
|
|
3573
3612
|
this.#updateRadioButtonDisabled();
|
|
3574
3613
|
}
|
|
3614
|
+
#updateStackedClasses() {
|
|
3615
|
+
this.stackedLg = !this.headingLevel && this.stacked;
|
|
3616
|
+
this.stackedXL = !!this.headingLevel && this.stacked;
|
|
3617
|
+
}
|
|
3575
3618
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: SkyRadioGroupComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: SkyRadioGroupIdService }, { token: i2$1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3576
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.3.4", type: SkyRadioGroupComponent, selector: "sky-radio-group", inputs: { ariaLabelledBy: "ariaLabelledBy", ariaLabel: "ariaLabel", disabled: "disabled", headingLevel: ["headingLevel", "headingLevel", numberAttribute], headingStyle: ["headingStyle", "headingStyle", numberAttribute], name: "name", required: "required", stacked: ["stacked", "stacked", booleanAttribute], value: "value", tabIndex: "tabIndex", headingText: "headingText", headingHidden: ["headingHidden", "headingHidden", booleanAttribute], hintText: "hintText", helpPopoverContent: "helpPopoverContent", helpPopoverTitle: "helpPopoverTitle", helpKey: "helpKey" }, host: { properties: { "class.sky-margin-stacked-lg": "this.
|
|
3619
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "17.3.4", type: SkyRadioGroupComponent, selector: "sky-radio-group", inputs: { ariaLabelledBy: "ariaLabelledBy", ariaLabel: "ariaLabel", disabled: "disabled", headingLevel: ["headingLevel", "headingLevel", numberAttribute], headingStyle: ["headingStyle", "headingStyle", numberAttribute], name: "name", required: "required", stacked: ["stacked", "stacked", booleanAttribute], value: "value", tabIndex: "tabIndex", headingText: "headingText", headingHidden: ["headingHidden", "headingHidden", booleanAttribute], hintText: "hintText", helpPopoverContent: "helpPopoverContent", helpPopoverTitle: "helpPopoverTitle", helpKey: "helpKey" }, host: { properties: { "style.display": "this.display", "class.sky-margin-stacked-lg": "this.stackedLg", "class.sky-margin-stacked-xl": "this.stackedXL" } }, providers: [
|
|
3577
3620
|
SkyRadioGroupIdService,
|
|
3578
3621
|
{ provide: SKY_FORM_ERRORS_ENABLED, useValue: true },
|
|
3579
|
-
], queries: [{ propertyName: "radios", predicate: SkyRadioComponent, descendants: true }], ngImport: i0, template: "<fieldset\n class=\"sky-radio-group\"\n role=\"radiogroup\"\n [attr.aria-label]=\"headingText ? undefined : ariaLabel\"\n [attr.aria-labelledby]=\"headingText ? undefined : ariaLabelledBy\"\n [attr.aria-describedby]=\"hintText ? hintTextEl.id : undefined\"\n [attr.aria-owns]=\"ariaOwns\"\n [attr.aria-required]=\"required ? true : null\"\n [attr.required]=\"required ? '' : null\"\n [attr.aria-invalid]=\"!!ngControl?.errors\"\n [attr.aria-errormessage]=\"\n headingText && ngControl?.errors ? errorId : undefined\n \"\n>\n <span class=\"sky-radio-group-label-wrapper\">\n <legend\n *ngIf=\"headingText\"\n class=\"sky-control-label\"\n [ngClass]=\"{\n 'sky-screen-reader-only': headingHidden,\n 'sky-margin-stacked-sm': !hintText,\n 'sky-control-label-required': required,\n 'sky-margin-inline-xs': helpPopoverContent\n }\"\n >\n <h3 *ngIf=\"headingLevel === 3\" [class]=\"headingClass\">\n {{ headingText }}\n </h3>\n <h4 *ngIf=\"headingLevel === 4\" [class]=\"headingClass\">\n {{ headingText }}\n </h4>\n <h5 *ngIf=\"headingLevel === 5\" [class]=\"headingClass\">\n {{ headingText }}\n </h5>\n </legend>\n <sky-help-inline\n *ngIf=\"(helpPopoverContent || helpKey) && headingText\"\n [helpKey]=\"helpKey\"\n [labelText]=\"headingText\"\n [popoverTitle]=\"helpPopoverTitle\"\n [popoverContent]=\"helpPopoverContent\"\n />\n </span>\n\n <div skyId #hintTextEl=\"skyId\">\n <div\n *ngIf=\"hintText\"\n class=\"sky-font-deemphasized sky-radio-group-hint-text\"\n >\n {{ hintText }}\n </div>\n </div>\n <ng-content />\n</fieldset>\n<sky-form-errors\n *ngIf=\"headingText && ngControl?.errors\"\n [id]=\"errorId\"\n [errors]=\"ngControl?.errors\"\n [labelText]=\"'skyux_radio_group_required_label_text' | skyLibResources\"\n [showErrors]=\"ngControl?.touched || ngControl?.dirty\"\n>\n <ng-content select=\"sky-form-error\" />\n</sky-form-errors>\n", styles: [":host.sky-margin-stacked-lg{display:block}.sky-radio-group-hint-text{margin-bottom:var(--sky-margin-stacked-lg)}.sky-radio-group-label-wrapper{display:flex}h3,h4,h5{margin:0;display:inline-block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SkyFormErrorsComponent, selector: "sky-form-errors", inputs: ["errors", "labelText", "showErrors"] }, { kind: "component", type: i4.λ1, selector: "sky-help-inline", inputs: ["ariaControls", "ariaExpanded", "ariaLabel", "labelText", "popoverContent", "popoverTitle", "helpKey"], outputs: ["actionClick"] }, { kind: "directive", type: i1$1.λ2, selector: "[skyId]", exportAs: ["skyId"] }, { kind: "pipe", type: i2.SkyLibResourcesPipe, name: "skyLibResources" }] }); }
|
|
3622
|
+
], queries: [{ propertyName: "radios", predicate: SkyRadioComponent, descendants: true }], ngImport: i0, template: "<fieldset\n class=\"sky-radio-group\"\n role=\"radiogroup\"\n [attr.aria-label]=\"headingText ? undefined : ariaLabel\"\n [attr.aria-labelledby]=\"headingText ? undefined : ariaLabelledBy\"\n [attr.aria-describedby]=\"hintText ? hintTextEl.id : undefined\"\n [attr.aria-owns]=\"ariaOwns\"\n [attr.aria-required]=\"required ? true : null\"\n [attr.required]=\"required ? '' : null\"\n [attr.aria-invalid]=\"!!ngControl?.errors\"\n [attr.aria-errormessage]=\"\n headingText && ngControl?.errors ? errorId : undefined\n \"\n>\n <span class=\"sky-radio-group-label-wrapper\">\n <legend\n *ngIf=\"headingText\"\n class=\"sky-control-label\"\n [ngClass]=\"{\n 'sky-screen-reader-only': headingHidden,\n 'sky-margin-stacked-sm': !hintText,\n 'sky-control-label-required': required,\n 'sky-margin-inline-xs': helpPopoverContent\n }\"\n >\n <span *ngIf=\"!headingLevel\" [class]=\"headingClass\">\n {{ headingText }}\n </span>\n <h3 *ngIf=\"headingLevel === 3\" [class]=\"headingClass\">\n {{ headingText }}\n </h3>\n <h4 *ngIf=\"headingLevel === 4\" [class]=\"headingClass\">\n {{ headingText }}\n </h4>\n <h5 *ngIf=\"headingLevel === 5\" [class]=\"headingClass\">\n {{ headingText }}\n </h5>\n </legend>\n <sky-help-inline\n *ngIf=\"(helpPopoverContent || helpKey) && headingText\"\n [helpKey]=\"helpKey\"\n [labelText]=\"headingText\"\n [popoverTitle]=\"helpPopoverTitle\"\n [popoverContent]=\"helpPopoverContent\"\n />\n </span>\n\n <div skyId #hintTextEl=\"skyId\">\n <div\n *ngIf=\"hintText\"\n class=\"sky-font-deemphasized sky-radio-group-hint-text\"\n >\n {{ hintText }}\n </div>\n </div>\n <ng-content />\n</fieldset>\n<sky-form-errors\n *ngIf=\"headingText && ngControl?.errors\"\n [id]=\"errorId\"\n [errors]=\"ngControl?.errors\"\n [labelText]=\"'skyux_radio_group_required_label_text' | skyLibResources\"\n [showErrors]=\"ngControl?.touched || ngControl?.dirty\"\n>\n <ng-content select=\"sky-form-error\" />\n</sky-form-errors>\n", styles: [":host.sky-margin-stacked-lg,:host.sky-margin-stacked-xl{display:block}.sky-radio-group-hint-text{margin-bottom:var(--sky-margin-stacked-lg)}.sky-radio-group-label-wrapper{display:flex}h3,h4,h5{margin:0;display:inline-block}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SkyFormErrorsComponent, selector: "sky-form-errors", inputs: ["errors", "labelText", "showErrors"] }, { kind: "component", type: i4.λ1, selector: "sky-help-inline", inputs: ["ariaControls", "ariaExpanded", "ariaLabel", "labelText", "popoverContent", "popoverTitle", "helpKey"], outputs: ["actionClick"] }, { kind: "directive", type: i1$1.λ2, selector: "[skyId]", exportAs: ["skyId"] }, { kind: "pipe", type: i2.SkyLibResourcesPipe, name: "skyLibResources" }] }); }
|
|
3580
3623
|
}
|
|
3581
3624
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: SkyRadioGroupComponent, decorators: [{
|
|
3582
3625
|
type: Component,
|
|
3583
3626
|
args: [{ selector: 'sky-radio-group', providers: [
|
|
3584
3627
|
SkyRadioGroupIdService,
|
|
3585
3628
|
{ provide: SKY_FORM_ERRORS_ENABLED, useValue: true },
|
|
3586
|
-
], template: "<fieldset\n class=\"sky-radio-group\"\n role=\"radiogroup\"\n [attr.aria-label]=\"headingText ? undefined : ariaLabel\"\n [attr.aria-labelledby]=\"headingText ? undefined : ariaLabelledBy\"\n [attr.aria-describedby]=\"hintText ? hintTextEl.id : undefined\"\n [attr.aria-owns]=\"ariaOwns\"\n [attr.aria-required]=\"required ? true : null\"\n [attr.required]=\"required ? '' : null\"\n [attr.aria-invalid]=\"!!ngControl?.errors\"\n [attr.aria-errormessage]=\"\n headingText && ngControl?.errors ? errorId : undefined\n \"\n>\n <span class=\"sky-radio-group-label-wrapper\">\n <legend\n *ngIf=\"headingText\"\n class=\"sky-control-label\"\n [ngClass]=\"{\n 'sky-screen-reader-only': headingHidden,\n 'sky-margin-stacked-sm': !hintText,\n 'sky-control-label-required': required,\n 'sky-margin-inline-xs': helpPopoverContent\n }\"\n >\n <h3 *ngIf=\"headingLevel === 3\" [class]=\"headingClass\">\n {{ headingText }}\n </h3>\n <h4 *ngIf=\"headingLevel === 4\" [class]=\"headingClass\">\n {{ headingText }}\n </h4>\n <h5 *ngIf=\"headingLevel === 5\" [class]=\"headingClass\">\n {{ headingText }}\n </h5>\n </legend>\n <sky-help-inline\n *ngIf=\"(helpPopoverContent || helpKey) && headingText\"\n [helpKey]=\"helpKey\"\n [labelText]=\"headingText\"\n [popoverTitle]=\"helpPopoverTitle\"\n [popoverContent]=\"helpPopoverContent\"\n />\n </span>\n\n <div skyId #hintTextEl=\"skyId\">\n <div\n *ngIf=\"hintText\"\n class=\"sky-font-deemphasized sky-radio-group-hint-text\"\n >\n {{ hintText }}\n </div>\n </div>\n <ng-content />\n</fieldset>\n<sky-form-errors\n *ngIf=\"headingText && ngControl?.errors\"\n [id]=\"errorId\"\n [errors]=\"ngControl?.errors\"\n [labelText]=\"'skyux_radio_group_required_label_text' | skyLibResources\"\n [showErrors]=\"ngControl?.touched || ngControl?.dirty\"\n>\n <ng-content select=\"sky-form-error\" />\n</sky-form-errors>\n", styles: [":host.sky-margin-stacked-lg{display:block}.sky-radio-group-hint-text{margin-bottom:var(--sky-margin-stacked-lg)}.sky-radio-group-label-wrapper{display:flex}h3,h4,h5{margin:0;display:inline-block}\n"] }]
|
|
3629
|
+
], template: "<fieldset\n class=\"sky-radio-group\"\n role=\"radiogroup\"\n [attr.aria-label]=\"headingText ? undefined : ariaLabel\"\n [attr.aria-labelledby]=\"headingText ? undefined : ariaLabelledBy\"\n [attr.aria-describedby]=\"hintText ? hintTextEl.id : undefined\"\n [attr.aria-owns]=\"ariaOwns\"\n [attr.aria-required]=\"required ? true : null\"\n [attr.required]=\"required ? '' : null\"\n [attr.aria-invalid]=\"!!ngControl?.errors\"\n [attr.aria-errormessage]=\"\n headingText && ngControl?.errors ? errorId : undefined\n \"\n>\n <span class=\"sky-radio-group-label-wrapper\">\n <legend\n *ngIf=\"headingText\"\n class=\"sky-control-label\"\n [ngClass]=\"{\n 'sky-screen-reader-only': headingHidden,\n 'sky-margin-stacked-sm': !hintText,\n 'sky-control-label-required': required,\n 'sky-margin-inline-xs': helpPopoverContent\n }\"\n >\n <span *ngIf=\"!headingLevel\" [class]=\"headingClass\">\n {{ headingText }}\n </span>\n <h3 *ngIf=\"headingLevel === 3\" [class]=\"headingClass\">\n {{ headingText }}\n </h3>\n <h4 *ngIf=\"headingLevel === 4\" [class]=\"headingClass\">\n {{ headingText }}\n </h4>\n <h5 *ngIf=\"headingLevel === 5\" [class]=\"headingClass\">\n {{ headingText }}\n </h5>\n </legend>\n <sky-help-inline\n *ngIf=\"(helpPopoverContent || helpKey) && headingText\"\n [helpKey]=\"helpKey\"\n [labelText]=\"headingText\"\n [popoverTitle]=\"helpPopoverTitle\"\n [popoverContent]=\"helpPopoverContent\"\n />\n </span>\n\n <div skyId #hintTextEl=\"skyId\">\n <div\n *ngIf=\"hintText\"\n class=\"sky-font-deemphasized sky-radio-group-hint-text\"\n >\n {{ hintText }}\n </div>\n </div>\n <ng-content />\n</fieldset>\n<sky-form-errors\n *ngIf=\"headingText && ngControl?.errors\"\n [id]=\"errorId\"\n [errors]=\"ngControl?.errors\"\n [labelText]=\"'skyux_radio_group_required_label_text' | skyLibResources\"\n [showErrors]=\"ngControl?.touched || ngControl?.dirty\"\n>\n <ng-content select=\"sky-form-error\" />\n</sky-form-errors>\n", styles: [":host.sky-margin-stacked-lg,:host.sky-margin-stacked-xl{display:block}.sky-radio-group-hint-text{margin-bottom:var(--sky-margin-stacked-lg)}.sky-radio-group-label-wrapper{display:flex}h3,h4,h5{margin:0;display:inline-block}\n"] }]
|
|
3587
3630
|
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: SkyRadioGroupIdService }, { type: i2$1.NgControl, decorators: [{
|
|
3588
3631
|
type: Self
|
|
3589
3632
|
}, {
|
|
@@ -3607,9 +3650,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
3607
3650
|
}], stacked: [{
|
|
3608
3651
|
type: Input,
|
|
3609
3652
|
args: [{ transform: booleanAttribute }]
|
|
3610
|
-
}, {
|
|
3611
|
-
type: HostBinding,
|
|
3612
|
-
args: ['class.sky-margin-stacked-lg']
|
|
3613
3653
|
}], value: [{
|
|
3614
3654
|
type: Input
|
|
3615
3655
|
}], tabIndex: [{
|
|
@@ -3619,9 +3659,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
3619
3659
|
}], headingHidden: [{
|
|
3620
3660
|
type: Input,
|
|
3621
3661
|
args: [{ transform: booleanAttribute }]
|
|
3622
|
-
}], display: [{
|
|
3623
|
-
type: HostBinding,
|
|
3624
|
-
args: ['style.display']
|
|
3625
3662
|
}], hintText: [{
|
|
3626
3663
|
type: Input
|
|
3627
3664
|
}], helpPopoverContent: [{
|
|
@@ -3633,6 +3670,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
3633
3670
|
}], radios: [{
|
|
3634
3671
|
type: ContentChildren,
|
|
3635
3672
|
args: [SkyRadioComponent, { descendants: true }]
|
|
3673
|
+
}], display: [{
|
|
3674
|
+
type: HostBinding,
|
|
3675
|
+
args: ['style.display']
|
|
3676
|
+
}], stackedLg: [{
|
|
3677
|
+
type: HostBinding,
|
|
3678
|
+
args: ['class.sky-margin-stacked-lg']
|
|
3679
|
+
}], stackedXL: [{
|
|
3680
|
+
type: HostBinding,
|
|
3681
|
+
args: ['class.sky-margin-stacked-xl']
|
|
3636
3682
|
}] } });
|
|
3637
3683
|
|
|
3638
3684
|
/**
|