@riverty/web-components 5.8.0 → 6.1.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/CHANGELOG.md +107 -0
- package/custom-elements.json +215 -362
- package/dist/cjs/index-DJ4H_bFj.js +6 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/r-accordion-panel.cjs.entry.js +1 -1
- package/dist/cjs/r-accordion-section.cjs.entry.js +1 -1
- package/dist/cjs/r-accordion-trigger.cjs.entry.js +5 -35
- package/dist/cjs/r-accordion.cjs.entry.js +3 -7
- package/dist/cjs/r-alert.cjs.entry.js +26 -11
- package/dist/cjs/r-badge.cjs.entry.js +1 -1
- package/dist/cjs/r-button.cjs.entry.js +1 -1
- package/dist/cjs/r-checkbox-group.cjs.entry.js +1 -11
- package/dist/cjs/r-checkbox.cjs.entry.js +76 -75
- package/dist/cjs/r-dialog.cjs.entry.js +3 -11
- package/dist/cjs/r-hint_2.cjs.entry.js +50 -0
- package/dist/cjs/{r-hint_3.cjs.entry.js → r-icon-button_2.cjs.entry.js} +64 -51
- package/dist/cjs/r-icon.cjs.entry.js +1 -1
- package/dist/cjs/r-input-code.cjs.entry.js +112 -17
- package/dist/cjs/r-input-date.cjs.entry.js +8 -14
- package/dist/cjs/r-input-password.cjs.entry.js +16 -8
- package/dist/cjs/r-input-phone-number.cjs.entry.js +7 -12
- package/dist/cjs/r-input.cjs.entry.js +90 -42
- package/dist/cjs/r-list-item.cjs.entry.js +20 -19
- package/dist/cjs/r-panel.cjs.entry.js +5 -5
- package/dist/cjs/r-popover-action.cjs.entry.js +1 -1
- package/dist/cjs/r-popover-content.cjs.entry.js +1 -1
- package/dist/cjs/r-popover-headline.cjs.entry.js +1 -1
- package/dist/cjs/r-popover-trigger.cjs.entry.js +1 -1
- package/dist/cjs/r-popover.cjs.entry.js +3 -3
- package/dist/cjs/r-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-button-description.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-button-leading.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-button-title.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-button-trailing.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-button.cjs.entry.js +29 -12
- package/dist/cjs/r-radio-group.cjs.entry.js +18 -22
- package/dist/cjs/r-select-option.cjs.entry.js +1 -1
- package/dist/cjs/r-select.cjs.entry.js +6 -24
- package/dist/cjs/r-skip-link.cjs.entry.js +1 -1
- package/dist/cjs/r-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/r-stepper.cjs.entry.js +2 -2
- package/dist/cjs/r-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/r-tab.cjs.entry.js +6 -2
- package/dist/cjs/r-tabs-list.cjs.entry.js +160 -2
- package/dist/cjs/r-tabs.cjs.entry.js +34 -6
- package/dist/cjs/r-textarea.cjs.entry.js +7 -19
- package/dist/cjs/r-toast-group.cjs.entry.js +2 -2
- package/dist/cjs/r-toast.cjs.entry.js +31 -11
- package/dist/cjs/web-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/accordion/accordion.css +0 -2
- package/dist/collection/components/accordion/accordion.js +4 -8
- package/dist/collection/components/accordion/exports.js +1 -1
- package/dist/collection/components/accordion-panel/accordion-panel.js +1 -1
- package/dist/collection/components/accordion-section/accordion-section.js +1 -1
- package/dist/collection/components/accordion-trigger/accordion-trigger.css +0 -4
- package/dist/collection/components/accordion-trigger/accordion-trigger.js +4 -215
- package/dist/collection/components/alert/alert.css +8 -3
- package/dist/collection/components/alert/alert.js +48 -10
- package/dist/collection/components/badge/badge.js +1 -1
- package/dist/collection/components/button/button.js +1 -1
- package/dist/collection/components/checkbox/checkbox.js +80 -98
- package/dist/collection/components/checkbox-group/checkbox-group.js +1 -50
- package/dist/collection/components/dialog/dialog.css +1 -3
- package/dist/collection/components/dialog/dialog.js +2 -10
- package/dist/collection/components/hint/hint.js +2 -2
- package/dist/collection/components/icon/bundled-icons/riverty-kit.json +1 -1
- package/dist/collection/components/icon/riverty-kit.js +1 -1
- package/dist/collection/components/icon-button/icon-button.js +22 -3
- package/dist/collection/components/input/exports.js +2 -0
- package/dist/collection/components/input/input.css +3 -0
- package/dist/collection/components/input/input.js +233 -371
- package/dist/collection/components/input-code/exports.js +2 -0
- package/dist/collection/components/input-code/input-code.js +294 -26
- package/dist/collection/components/input-date/input-date.js +8 -77
- package/dist/collection/components/input-password/exports.js +1 -0
- package/dist/collection/components/input-password/input-password.css +1 -0
- package/dist/collection/components/input-password/input-password.js +195 -70
- package/dist/collection/components/input-phone-number/input-phone-number.js +7 -75
- package/dist/collection/components/label/label.js +3 -113
- package/dist/collection/components/list-item/list-item/list-item.css +53 -19
- package/dist/collection/components/list-item/list-item/list-item.js +38 -40
- package/dist/collection/components/panel/panel.css +40 -17
- package/dist/collection/components/panel/panel.js +6 -6
- package/dist/collection/components/popover/exports.js +0 -1
- package/dist/collection/components/popover/popover.css +2 -10
- package/dist/collection/components/popover/popover.js +2 -55
- package/dist/collection/components/popover-action/popover-action.js +1 -1
- package/dist/collection/components/popover-content/popover-content.js +1 -1
- package/dist/collection/components/popover-headline/popover-headline.js +1 -1
- package/dist/collection/components/popover-trigger/popover-trigger.js +1 -1
- package/dist/collection/components/progress-bar/progress-bar.js +1 -1
- package/dist/collection/components/radio-button/radio-button.js +49 -12
- package/dist/collection/components/radio-button-description/radio-button-description.js +1 -1
- package/dist/collection/components/radio-button-leading/radio-button-leading.js +1 -1
- package/dist/collection/components/radio-button-title/radio-button-title.js +1 -1
- package/dist/collection/components/radio-button-trailing/radio-button-trailing.js +1 -1
- package/dist/collection/components/radio-group/radio-group.js +38 -124
- package/dist/collection/components/select/select.js +6 -330
- package/dist/collection/components/select-option/select-option.js +1 -1
- package/dist/collection/components/skip-link/skip-link.js +1 -1
- package/dist/collection/components/stepper/stepper.css +1 -1
- package/dist/collection/components/stepper/stepper.js +1 -1
- package/dist/collection/components/stepper-item/stepper-item.css +3 -3
- package/dist/collection/components/stepper-item/stepper-item.js +2 -2
- package/dist/collection/components/tab/tab.css +29 -29
- package/dist/collection/components/tab/tab.js +5 -1
- package/dist/collection/components/tab-panel/tab-panel.js +1 -1
- package/dist/collection/components/tabs/tabs.js +34 -6
- package/dist/collection/components/tabs-list/exports.js +2 -0
- package/dist/collection/components/tabs-list/tabs-list.css +43 -2
- package/dist/collection/components/tabs-list/tabs-list.js +277 -1
- package/dist/collection/components/textarea/textarea.css +1 -1
- package/dist/collection/components/textarea/textarea.js +6 -158
- package/dist/collection/components/toast/toast.css +35 -9
- package/dist/collection/components/toast/toast.js +44 -32
- package/dist/collection/components/toast-group/toast-group.css +1 -1
- package/dist/collection/components/toast-group/toast-group.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +2 -2
- package/dist/esm/index-Da7qOBFr.js +6 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/r-accordion-panel.entry.js +1 -1
- package/dist/esm/r-accordion-section.entry.js +1 -1
- package/dist/esm/r-accordion-trigger.entry.js +5 -35
- package/dist/esm/r-accordion.entry.js +3 -7
- package/dist/esm/r-alert.entry.js +26 -11
- package/dist/esm/r-badge.entry.js +1 -1
- package/dist/esm/r-button.entry.js +1 -1
- package/dist/esm/r-checkbox-group.entry.js +1 -11
- package/dist/esm/r-checkbox.entry.js +76 -75
- package/dist/esm/r-dialog.entry.js +3 -11
- package/dist/esm/r-hint_2.entry.js +47 -0
- package/dist/esm/{r-hint_3.entry.js → r-icon-button_2.entry.js} +65 -51
- package/dist/esm/r-icon.entry.js +1 -1
- package/dist/esm/r-input-code.entry.js +112 -17
- package/dist/esm/r-input-date.entry.js +8 -14
- package/dist/esm/r-input-password.entry.js +16 -8
- package/dist/esm/r-input-phone-number.entry.js +7 -12
- package/dist/esm/r-input.entry.js +90 -42
- package/dist/esm/r-list-item.entry.js +20 -19
- package/dist/esm/r-panel.entry.js +5 -5
- package/dist/esm/r-popover-action.entry.js +1 -1
- package/dist/esm/r-popover-content.entry.js +1 -1
- package/dist/esm/r-popover-headline.entry.js +1 -1
- package/dist/esm/r-popover-trigger.entry.js +1 -1
- package/dist/esm/r-popover.entry.js +3 -3
- package/dist/esm/r-progress-bar.entry.js +1 -1
- package/dist/esm/r-radio-button-description.entry.js +1 -1
- package/dist/esm/r-radio-button-leading.entry.js +1 -1
- package/dist/esm/r-radio-button-title.entry.js +1 -1
- package/dist/esm/r-radio-button-trailing.entry.js +1 -1
- package/dist/esm/r-radio-button.entry.js +29 -12
- package/dist/esm/r-radio-group.entry.js +18 -22
- package/dist/esm/r-select-option.entry.js +1 -1
- package/dist/esm/r-select.entry.js +6 -24
- package/dist/esm/r-skip-link.entry.js +1 -1
- package/dist/esm/r-stepper-item.entry.js +3 -3
- package/dist/esm/r-stepper.entry.js +2 -2
- package/dist/esm/r-tab-panel.entry.js +1 -1
- package/dist/esm/r-tab.entry.js +6 -2
- package/dist/esm/r-tabs-list.entry.js +161 -3
- package/dist/esm/r-tabs.entry.js +34 -6
- package/dist/esm/r-textarea.entry.js +7 -19
- package/dist/esm/r-toast-group.entry.js +2 -2
- package/dist/esm/r-toast.entry.js +31 -11
- package/dist/esm/web-components.js +1 -1
- package/dist/types/components/accordion/accordion.d.ts +1 -5
- package/dist/types/components/accordion/exports.d.ts +1 -1
- package/dist/types/components/accordion-trigger/accordion-trigger.d.ts +0 -36
- package/dist/types/components/alert/alert.d.ts +6 -1
- package/dist/types/components/checkbox/checkbox.d.ts +24 -34
- package/dist/types/components/checkbox-group/checkbox-group.d.ts +0 -11
- package/dist/types/components/dialog/dialog.d.ts +0 -2
- package/dist/types/components/icon/exports.d.ts +1 -0
- package/dist/types/components/icon/icon-data.d.ts +1 -0
- package/dist/types/components/icon/riverty-kit.d.ts +1 -0
- package/dist/types/components/icon-button/icon-button.d.ts +4 -0
- package/dist/types/components/input/exports.d.ts +4 -0
- package/dist/types/components/input/input.d.ts +47 -73
- package/dist/types/components/input-code/exports.d.ts +4 -0
- package/dist/types/components/input-code/input-code.d.ts +49 -7
- package/dist/types/components/input-date/input-date.d.ts +0 -16
- package/dist/types/components/input-password/exports.d.ts +1 -0
- package/dist/types/components/input-password/input-password.d.ts +48 -16
- package/dist/types/components/input-phone-number/input-phone-number.d.ts +0 -16
- package/dist/types/components/label/label.d.ts +0 -18
- package/dist/types/components/list-item/list-item/list-item.d.ts +5 -9
- package/dist/types/components/popover/exports.d.ts +0 -2
- package/dist/types/components/popover/popover.d.ts +1 -14
- package/dist/types/components/radio-button/radio-button.d.ts +5 -0
- package/dist/types/components/radio-group/radio-group.d.ts +5 -26
- package/dist/types/components/select/select.d.ts +0 -50
- package/dist/types/components/tabs/tabs.d.ts +1 -0
- package/dist/types/components/tabs-list/exports.d.ts +4 -0
- package/dist/types/components/tabs-list/tabs-list.d.ts +38 -0
- package/dist/types/components/textarea/textarea.d.ts +0 -32
- package/dist/types/components/toast/toast.d.ts +11 -5
- package/dist/types/components.d.ts +280 -638
- package/dist/web-components/bundled-icons/riverty-kit.json +1 -1
- package/dist/web-components/p-0347feff.entry.js +1 -0
- package/dist/web-components/p-159822fe.entry.js +1 -0
- package/dist/web-components/p-19407a14.entry.js +1 -0
- package/dist/web-components/{p-5744d75c.entry.js → p-1da75540.entry.js} +1 -1
- package/dist/web-components/p-26ef77d6.entry.js +1 -0
- package/dist/web-components/p-3884c6e7.entry.js +1 -0
- package/dist/web-components/p-3f60c6c0.entry.js +1 -0
- package/dist/web-components/{p-87f39749.entry.js → p-4595fa8e.entry.js} +1 -1
- package/dist/web-components/{p-4e3df002.entry.js → p-4cc58c6a.entry.js} +1 -1
- package/dist/web-components/p-4f261b63.entry.js +1 -0
- package/dist/web-components/{p-e0e2f2b2.entry.js → p-50893211.entry.js} +1 -1
- package/dist/web-components/{p-72fa1fd1.entry.js → p-550e2237.entry.js} +1 -1
- package/dist/web-components/p-589baaf9.entry.js +1 -0
- package/dist/web-components/{p-3b4e3faf.entry.js → p-5eeb7002.entry.js} +1 -1
- package/dist/web-components/p-60341de2.entry.js +1 -0
- package/dist/web-components/{p-44ae9f33.entry.js → p-62b788bf.entry.js} +1 -1
- package/dist/web-components/p-63fd817d.entry.js +1 -0
- package/dist/web-components/p-67fa3f84.entry.js +1 -0
- package/dist/web-components/p-6bb44ec6.entry.js +1 -0
- package/dist/web-components/p-6cc2ea2c.entry.js +1 -0
- package/dist/web-components/p-70784685.entry.js +1 -0
- package/dist/web-components/p-7ce57332.entry.js +1 -0
- package/dist/web-components/{p-429213ea.entry.js → p-7fed6f4d.entry.js} +1 -1
- package/dist/web-components/p-8a66d20c.entry.js +1 -0
- package/dist/web-components/{p-c7f8e59b.entry.js → p-8c31cbd5.entry.js} +1 -1
- package/dist/web-components/p-8dac326b.entry.js +1 -0
- package/dist/web-components/p-92c7cf33.entry.js +1 -0
- package/dist/web-components/{p-1c2497de.entry.js → p-9ef1bbee.entry.js} +1 -1
- package/dist/web-components/p-a7d22c76.entry.js +1 -0
- package/dist/web-components/p-b96d59ca.entry.js +1 -0
- package/dist/web-components/p-ba801820.entry.js +1 -0
- package/dist/web-components/{p-a022f356.entry.js → p-bfc8c077.entry.js} +1 -1
- package/dist/web-components/p-c05b05da.entry.js +1 -0
- package/dist/web-components/p-c1e748f2.entry.js +1 -0
- package/dist/web-components/{p-5bbd6e3c.entry.js → p-c478712b.entry.js} +1 -1
- package/dist/web-components/p-c95b6470.entry.js +1 -0
- package/dist/web-components/p-cd5daad2.entry.js +1 -0
- package/dist/web-components/p-cdd88c5a.entry.js +1 -0
- package/dist/web-components/{p-3078b2b8.entry.js → p-d054eb4d.entry.js} +1 -1
- package/dist/web-components/{p-8563a1ab.entry.js → p-d433a828.entry.js} +1 -1
- package/dist/web-components/p-d7726e46.entry.js +1 -0
- package/dist/web-components/p-d819c8e5.entry.js +1 -0
- package/dist/web-components/{p-755cc697.entry.js → p-e4dc60f0.entry.js} +1 -1
- package/dist/web-components/{p-d1379ac6.entry.js → p-f9d5004c.entry.js} +1 -1
- package/dist/web-components/web-components.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/r-accordion-item.cjs.entry.js +0 -78
- package/dist/cjs/r-icon-button.cjs.entry.js +0 -81
- package/dist/collection/components/accordion-item/accordion-item.css +0 -121
- package/dist/collection/components/accordion-item/accordion-item.js +0 -138
- package/dist/esm/r-accordion-item.entry.js +0 -76
- package/dist/esm/r-icon-button.entry.js +0 -79
- package/dist/types/components/accordion-item/accordion-item.d.ts +0 -26
- package/dist/web-components/p-00ca474f.entry.js +0 -1
- package/dist/web-components/p-0bb04d79.entry.js +0 -1
- package/dist/web-components/p-15ac0fdd.entry.js +0 -1
- package/dist/web-components/p-1c956370.entry.js +0 -1
- package/dist/web-components/p-2a512983.entry.js +0 -1
- package/dist/web-components/p-2b2f581a.entry.js +0 -1
- package/dist/web-components/p-2e18e762.entry.js +0 -1
- package/dist/web-components/p-3bc93d65.entry.js +0 -1
- package/dist/web-components/p-4bd3e077.entry.js +0 -1
- package/dist/web-components/p-51a5804b.entry.js +0 -1
- package/dist/web-components/p-56da04d8.entry.js +0 -1
- package/dist/web-components/p-5e6aabd8.entry.js +0 -1
- package/dist/web-components/p-656229de.entry.js +0 -1
- package/dist/web-components/p-6a4f3836.entry.js +0 -1
- package/dist/web-components/p-7775228c.entry.js +0 -1
- package/dist/web-components/p-7ad8e78b.entry.js +0 -1
- package/dist/web-components/p-85a9af42.entry.js +0 -1
- package/dist/web-components/p-9e50120b.entry.js +0 -1
- package/dist/web-components/p-a7e7f8fa.entry.js +0 -1
- package/dist/web-components/p-ad9b2a48.entry.js +0 -1
- package/dist/web-components/p-b2f03016.entry.js +0 -1
- package/dist/web-components/p-b87ad83b.entry.js +0 -1
- package/dist/web-components/p-c937bd92.entry.js +0 -1
- package/dist/web-components/p-cbcd7699.entry.js +0 -1
- package/dist/web-components/p-dbe579e8.entry.js +0 -1
- package/dist/web-components/p-e4b66277.entry.js +0 -1
- package/dist/web-components/p-e6a31881.entry.js +0 -1
- package/dist/web-components/p-f2577a3c.entry.js +0 -1
- package/dist/web-components/p-f6a92287.entry.js +0 -1
|
@@ -6,6 +6,8 @@ export class RadioButton {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
/** Value of element data within a form */
|
|
8
8
|
this.value = this.slotTextValue;
|
|
9
|
+
/** Automatically focus the radio button when the component is mounted. Note: Only one element per page should have autofocus set to true, following browser standard behavior. */
|
|
10
|
+
this.autofocus = false;
|
|
9
11
|
/** Unique id */
|
|
10
12
|
this.uniqueId = `r-radio-button-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
11
13
|
this.onClick = (event) => {
|
|
@@ -26,18 +28,25 @@ export class RadioButton {
|
|
|
26
28
|
this.onBlur = () => {
|
|
27
29
|
this.host.classList.remove('focused');
|
|
28
30
|
};
|
|
31
|
+
this.applyAutofocus = () => {
|
|
32
|
+
queueMicrotask(() => {
|
|
33
|
+
this.setFocus();
|
|
34
|
+
});
|
|
35
|
+
};
|
|
29
36
|
}
|
|
30
37
|
/** Sets focus on the radio button element */
|
|
31
38
|
async setFocus() {
|
|
32
|
-
|
|
39
|
+
var _a;
|
|
40
|
+
(_a = this.nativeEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
33
41
|
}
|
|
34
42
|
/** Blurs the radio button element */
|
|
35
43
|
async setBlur() {
|
|
36
|
-
|
|
44
|
+
var _a;
|
|
45
|
+
(_a = this.nativeEl) === null || _a === void 0 ? void 0 : _a.blur();
|
|
37
46
|
}
|
|
38
47
|
/** Selects the radio button element */
|
|
39
48
|
async select() {
|
|
40
|
-
var _a;
|
|
49
|
+
var _a, _b, _c;
|
|
41
50
|
if (this.checked)
|
|
42
51
|
return;
|
|
43
52
|
if (this.disabled)
|
|
@@ -47,8 +56,8 @@ export class RadioButton {
|
|
|
47
56
|
radio.shadowRoot.querySelector('.r-radio-button--input').setAttribute('tabindex', '-1');
|
|
48
57
|
});
|
|
49
58
|
this.checked = true;
|
|
50
|
-
this.nativeEl.setAttribute('tabindex', '0');
|
|
51
|
-
this.nativeEl.focus();
|
|
59
|
+
(_b = this.nativeEl) === null || _b === void 0 ? void 0 : _b.setAttribute('tabindex', '0');
|
|
60
|
+
(_c = this.nativeEl) === null || _c === void 0 ? void 0 : _c.focus();
|
|
52
61
|
const { host, value, checked } = this;
|
|
53
62
|
this.rChange.emit({ element: host, value, checked });
|
|
54
63
|
}
|
|
@@ -82,6 +91,9 @@ export class RadioButton {
|
|
|
82
91
|
get isTrailing() {
|
|
83
92
|
return this.host.querySelector('[slot="trailing"]') !== null || this.host.querySelector('r-radio-button-trailing') !== null;
|
|
84
93
|
}
|
|
94
|
+
get shouldAutofocus() {
|
|
95
|
+
return this.autofocus && (!this.groupEl || !this.groupEl.autofocus);
|
|
96
|
+
}
|
|
85
97
|
componentWillLoad() {
|
|
86
98
|
if (!this.initialState)
|
|
87
99
|
this.initialState = this.checked;
|
|
@@ -89,8 +101,12 @@ export class RadioButton {
|
|
|
89
101
|
this.name = this.groupEl.name;
|
|
90
102
|
}
|
|
91
103
|
}
|
|
104
|
+
componentDidLoad() {
|
|
105
|
+
if (this.shouldAutofocus)
|
|
106
|
+
this.applyAutofocus();
|
|
107
|
+
}
|
|
92
108
|
render() {
|
|
93
|
-
const { name, value, checked, disabled, hint, uniqueId, required, invalid, error } = this;
|
|
109
|
+
const { name, value, checked, disabled, hint, uniqueId, required, invalid, error, autofocus } = this;
|
|
94
110
|
const inputAttrs = {
|
|
95
111
|
type: 'radio',
|
|
96
112
|
tabindex: '-1',
|
|
@@ -98,13 +114,14 @@ export class RadioButton {
|
|
|
98
114
|
value,
|
|
99
115
|
disabled,
|
|
100
116
|
checked,
|
|
101
|
-
required
|
|
117
|
+
required,
|
|
118
|
+
autofocus
|
|
102
119
|
};
|
|
103
|
-
return (h(Host, { key: '
|
|
104
|
-
h("div", { key: '
|
|
105
|
-
h("div", { key: '
|
|
106
|
-
h("r-hint", { key: '
|
|
107
|
-
h("r-hint", { key: '
|
|
120
|
+
return (h(Host, { key: '718b29840798212b4a31a2250fe79620554a9fb5' }, h("label", { key: 'ab86d4ca9bb300628a5b7f4bf10ba2ce88656d6d', class: "r-radio-button", onClick: this.onClick, onKeyDown: this.onKeydown }, h("input", Object.assign({ key: '529324a5ae32238b56ab9443a9ba3dd67b9b76bd' }, inputAttrs, { id: `${uniqueId}-input`, class: "r-radio-button--input", ref: el => this.nativeEl = el, onFocus: this.onFocus, onBlur: this.onBlur })), h("span", { key: 'a90a3704b4fc2d431482cca0c4064241001e09d2', class: "r-radio-button--box" }), this.isLeading &&
|
|
121
|
+
h("div", { key: '8a067dc10dc0f764c507be6610a8bf6f80565f8b', class: "r-radio-button--leading" }, h("slot", { key: 'db99a204cdf0932b203a65698f6167ede11309c4', name: "leading" }, this.icon && h("r-icon", { key: '8f6b1c585e0dcfcee9bb471e59f4d911ff72e7bc', name: this.icon, size: "m" }))), h("div", { key: 'b2ec0c20df6bffa599c5331016f3c52ce5661a17', class: "r-radio-button--text" }, h("slot", { key: '82ed5be7758c72ece18d4df27c0dbeb7e00ab1fc', name: "title" }, h("div", { key: '9c839853016eb5e7a3940bea0f9c5c755933ae55', style: { display: 'contents' } }, h("slot", { key: '78875045c000e5dcd0375fe2143e3032bf3a5226' }))), h("slot", { key: 'd75f2511dc33c734eb34c0d8953ed5be2f4cb7ea', name: "description" }, this.description)), this.isTrailing &&
|
|
122
|
+
h("div", { key: 'fd204a1c99ac54d60fc4479de3ca650d8ecf6508', class: "r-radio-button--trailing" }, h("slot", { key: '9a82590bc860567d1a60f9125622b1e63471ad94', name: "trailing" }))), invalid && error &&
|
|
123
|
+
h("r-hint", { key: '1fc760af1aff4ca5aaa595270c294b492fdb14e3', role: "alert", variant: "error", id: `${uniqueId}-hint` }, this.error), hint &&
|
|
124
|
+
h("r-hint", { key: '079a060908d285505f7093820933c173194f2348', role: "note", variant: "information", id: `${uniqueId}-hint` }, hint)));
|
|
108
125
|
}
|
|
109
126
|
static get is() { return "r-radio-button"; }
|
|
110
127
|
static get encapsulation() { return "shadow"; }
|
|
@@ -254,6 +271,26 @@ export class RadioButton {
|
|
|
254
271
|
"setter": false,
|
|
255
272
|
"reflect": true
|
|
256
273
|
},
|
|
274
|
+
"autofocus": {
|
|
275
|
+
"type": "boolean",
|
|
276
|
+
"attribute": "autofocus",
|
|
277
|
+
"mutable": false,
|
|
278
|
+
"complexType": {
|
|
279
|
+
"original": "boolean",
|
|
280
|
+
"resolved": "boolean",
|
|
281
|
+
"references": {}
|
|
282
|
+
},
|
|
283
|
+
"required": false,
|
|
284
|
+
"optional": true,
|
|
285
|
+
"docs": {
|
|
286
|
+
"tags": [],
|
|
287
|
+
"text": "Automatically focus the radio button when the component is mounted. Note: Only one element per page should have autofocus set to true, following browser standard behavior."
|
|
288
|
+
},
|
|
289
|
+
"getter": false,
|
|
290
|
+
"setter": false,
|
|
291
|
+
"reflect": false,
|
|
292
|
+
"defaultValue": "false"
|
|
293
|
+
},
|
|
257
294
|
"checked": {
|
|
258
295
|
"type": "boolean",
|
|
259
296
|
"attribute": "checked",
|
|
@@ -4,7 +4,7 @@ import { Host, h } from "@stencil/core";
|
|
|
4
4
|
*/
|
|
5
5
|
export class RadioButtonDescription {
|
|
6
6
|
render() {
|
|
7
|
-
return (h(Host, { key: '
|
|
7
|
+
return (h(Host, { key: 'cd678f2b6c1e00e95ecfc56b1e460b3b3ab37597', slot: "description" }, h("div", { key: 'a19901417798ef6dacd6ad82c9eab7e2a8227cd5', class: "r-radio-button-description", style: { display: 'contents' } }, h("slot", { key: 'ba9308abf507f84affb24bb7eb8a43c8da4fd613' }))));
|
|
8
8
|
}
|
|
9
9
|
static get is() { return "r-radio-button-description"; }
|
|
10
10
|
static get encapsulation() { return "shadow"; }
|
|
@@ -4,7 +4,7 @@ import { Host, h } from "@stencil/core";
|
|
|
4
4
|
*/
|
|
5
5
|
export class RadioButtonLeading {
|
|
6
6
|
render() {
|
|
7
|
-
return (h(Host, { key: '
|
|
7
|
+
return (h(Host, { key: '272870387e6e1abe3db2a67a38cfcd502a0e5aac', slot: "leading" }, h("div", { key: '7fd29eb8b31cda51e7a3bebebf8d80c7b0a79622', class: "r-radio-button-leading", style: { display: 'contents' } }, h("slot", { key: '542afc33263c2f06007b1c50225457af3e1b9051' }))));
|
|
8
8
|
}
|
|
9
9
|
static get is() { return "r-radio-button-leading"; }
|
|
10
10
|
static get encapsulation() { return "shadow"; }
|
|
@@ -4,7 +4,7 @@ import { Host, h } from "@stencil/core";
|
|
|
4
4
|
*/
|
|
5
5
|
export class RadioButtonTitle {
|
|
6
6
|
render() {
|
|
7
|
-
return (h(Host, { key: '
|
|
7
|
+
return (h(Host, { key: '705ecfa00df2a6e5f1976e1e45dca02c2d63d0fb', slot: "title" }, h("div", { key: '9845596a7638b53995157c26ee89be55677ff2e9', class: "r-radio-button-title", style: { display: 'contents' } }, h("slot", { key: '5ec9a59d7d71f976513dddb471676d640e13e239' }))));
|
|
8
8
|
}
|
|
9
9
|
static get is() { return "r-radio-button-title"; }
|
|
10
10
|
static get encapsulation() { return "shadow"; }
|
|
@@ -4,7 +4,7 @@ import { Host, h } from "@stencil/core";
|
|
|
4
4
|
*/
|
|
5
5
|
export class RadioButtonTrailing {
|
|
6
6
|
render() {
|
|
7
|
-
return (h(Host, { key: '
|
|
7
|
+
return (h(Host, { key: '844ad8251f30a4b0b6e700d0864798957e53750b', slot: "trailing" }, h("div", { key: '26a3458b5a448a9d8a687081325a5aa93c83e512', class: "r-radio-button-trailing", style: { display: 'contents' } }, h("slot", { key: 'fc1634011f555127d3281351a8ba9d7fdc1a7a38' }))));
|
|
8
8
|
}
|
|
9
9
|
static get is() { return "r-radio-button-trailing"; }
|
|
10
10
|
static get encapsulation() { return "shadow"; }
|
|
@@ -2,15 +2,13 @@ import { Host, h } from "@stencil/core";
|
|
|
2
2
|
import { appendControlToFormData } from "../../utils/formData";
|
|
3
3
|
export class RadioGroup {
|
|
4
4
|
constructor() {
|
|
5
|
-
/**
|
|
6
|
-
* _DEPRECATED_ (This property will be removed in November 2025 release.)
|
|
7
|
-
* Indicates whether to show the validation state.
|
|
8
|
-
* When set to `true`, the component will display validation feedback.
|
|
9
|
-
* Defaults to `false`.
|
|
10
|
-
*/
|
|
11
|
-
this.showValid = false;
|
|
12
5
|
/** Controls the style variation of the radio buttons. */
|
|
13
6
|
this.variant = 'standard';
|
|
7
|
+
/**
|
|
8
|
+
* When set to `true`, automatically focuses the first enabled radio button in the group on mount.
|
|
9
|
+
* This will focus the selected radio button if one exists, or the first enabled radio button otherwise.
|
|
10
|
+
*/
|
|
11
|
+
this.autofocus = false;
|
|
14
12
|
this.validityState = '';
|
|
15
13
|
this.validityMessage = '';
|
|
16
14
|
/**
|
|
@@ -259,10 +257,10 @@ export class RadioGroup {
|
|
|
259
257
|
return this.host.querySelectorAll('r-radio-button:not([disabled]:not([disabled="false"]))');
|
|
260
258
|
}
|
|
261
259
|
get selectedRadioButtonElement() {
|
|
262
|
-
return Array.from(this.radioButtonElements).find(el => el.hasAttribute('checked')) || null;
|
|
260
|
+
return Array.from(this.radioButtonElements).find(el => el.checked || el.hasAttribute('checked')) || null;
|
|
263
261
|
}
|
|
264
262
|
get hasSelected() {
|
|
265
|
-
return Array.from(this.radioButtonElements).some(el => el.hasAttribute('checked'));
|
|
263
|
+
return Array.from(this.radioButtonElements).some(el => el.checked || el.hasAttribute('checked'));
|
|
266
264
|
}
|
|
267
265
|
get nativeSelectedEl() {
|
|
268
266
|
var _a, _b;
|
|
@@ -324,21 +322,19 @@ export class RadioGroup {
|
|
|
324
322
|
const { name, required } = this;
|
|
325
323
|
this.passPropsToGroupItems({ name, required });
|
|
326
324
|
this.setTabindex();
|
|
325
|
+
if (this.autofocus) {
|
|
326
|
+
queueMicrotask(() => {
|
|
327
|
+
this.setFocus();
|
|
328
|
+
});
|
|
329
|
+
}
|
|
327
330
|
}
|
|
328
331
|
render() {
|
|
329
|
-
const { label, hint, fieldIndicator,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
'
|
|
334
|
-
'
|
|
335
|
-
};
|
|
336
|
-
return (h(Host, { key: '5bf5f0493d2329b07d82e332153e467239ddff0f' }, h("div", { key: '06f96cb1868f7cbb635137ca68eda6a326b969c3', class: "r-radio-group", onClick: this.onLabelClick }, label &&
|
|
337
|
-
h("div", { key: '4dca24e0cb903a2e74e55ee743ed595608af0bf4', class: "r-radio-group--label-container" }, h("r-label", Object.assign({ key: 'cba1398032eae164db0a00808a06116affa671ec', id: `${uniqueId}-label`, class: "r-radio-group--label", "field-indicator": fieldIndicator }, labelAttr), label), h("slot", { key: 'c0180f3c6c99fed7d524719aff8eb8e64236cc3c', name: "popover" })), hint &&
|
|
338
|
-
h("r-hint", { key: '3ae1c84630975059aa1532b4b72957967e398949', id: `${uniqueId}-hint`, class: "r-radio-group--hint", role: "note" }, hint), h("div", { key: '2c18a09474189e6f2719db7c6ee5fb51c460e52f', class: "r-radio-group--content" }, h("slot", { key: '1c79f92cc0cd2095cfe51ee5fc108b6a004c4e4e' }))), invalid && error &&
|
|
339
|
-
h("r-hint", { key: '86aa0f4d1400e401cc7f71259511f118a3f68ef7', "aria-live": "polite", id: `${uniqueId}-message`, role: "alert", variant: "error" }, error), this.validityState !== 'valid' && this.validityMessage &&
|
|
340
|
-
h("r-hint", { key: 'aa06f829a6566becdf4a1f86e26e5161526756fb', "aria-live": "polite", id: `${uniqueId}-message`, role: "alert", variant: "error" }, this.customErrorMessage || this.validityMessage), this.valid && this.validMessage && this.showValid &&
|
|
341
|
-
h("r-hint", { key: '11500e705487028e4312679a6757dc48d861ebba', role: "alert", variant: "success" }, this.validMessage)));
|
|
332
|
+
const { label, hint, fieldIndicator, error, uniqueId, invalid } = this;
|
|
333
|
+
return (h(Host, { key: '598a714f75ce283c76278d52fb7684c5818700f9' }, h("div", { key: '0c691e6738d11dcc8b621fe90b356980944ce5ec', class: "r-radio-group", onClick: this.onLabelClick }, label &&
|
|
334
|
+
h("div", { key: '3071e2dedc5e9935bd6f80cc3e01883d8bffacc6', class: "r-radio-group--label-container" }, h("r-label", { key: '6175d4620468c3d2b06790baf11673c47e797bd7', id: `${uniqueId}-label`, class: "r-radio-group--label", "field-indicator": fieldIndicator }, label), h("slot", { key: '9c3595a94234b99bec2001c9667c53cd41d8fdde', name: "popover" })), hint &&
|
|
335
|
+
h("r-hint", { key: '8d9ef5dbaacac8a9cae05a633c942c8009b3d686', id: `${uniqueId}-hint`, class: "r-radio-group--hint", role: "note" }, hint), h("div", { key: '9206c8f841cc20ee632f58da3775e1d967730c58', class: "r-radio-group--content" }, h("slot", { key: '1f7edd0e36e16956acf7dbe5dd17c16a43b39666' }))), invalid && error &&
|
|
336
|
+
h("r-hint", { key: 'e4780947cede5a39e553d639eb37aeb842f1cda3', "aria-live": "polite", id: `${uniqueId}-message`, role: "alert", variant: "error" }, error), this.validityState !== 'valid' && this.validityMessage &&
|
|
337
|
+
h("r-hint", { key: '4c9867129f7da323cc9e99b350332ac1d5740a0e', "aria-live": "polite", id: `${uniqueId}-message`, role: "alert", variant: "error" }, this.customErrorMessage || this.validityMessage)));
|
|
342
338
|
}
|
|
343
339
|
static get is() { return "r-radio-group"; }
|
|
344
340
|
static get encapsulation() { return "shadow"; }
|
|
@@ -487,69 +483,6 @@ export class RadioGroup {
|
|
|
487
483
|
"setter": false,
|
|
488
484
|
"reflect": false
|
|
489
485
|
},
|
|
490
|
-
"tooltip": {
|
|
491
|
-
"type": "string",
|
|
492
|
-
"attribute": "tooltip",
|
|
493
|
-
"mutable": false,
|
|
494
|
-
"complexType": {
|
|
495
|
-
"original": "string",
|
|
496
|
-
"resolved": "string",
|
|
497
|
-
"references": {}
|
|
498
|
-
},
|
|
499
|
-
"required": false,
|
|
500
|
-
"optional": true,
|
|
501
|
-
"docs": {
|
|
502
|
-
"tags": [],
|
|
503
|
-
"text": "_DEPRECATED_ (Use popover slot instead. This property will be removed in November 2025 release.)\nLabel based text revealed within tooltip"
|
|
504
|
-
},
|
|
505
|
-
"getter": false,
|
|
506
|
-
"setter": false,
|
|
507
|
-
"reflect": false
|
|
508
|
-
},
|
|
509
|
-
"tooltipIcon": {
|
|
510
|
-
"type": "string",
|
|
511
|
-
"attribute": "tooltip-icon",
|
|
512
|
-
"mutable": false,
|
|
513
|
-
"complexType": {
|
|
514
|
-
"original": "IconName",
|
|
515
|
-
"resolved": "string",
|
|
516
|
-
"references": {
|
|
517
|
-
"IconName": {
|
|
518
|
-
"location": "import",
|
|
519
|
-
"path": "../icon/exports",
|
|
520
|
-
"id": "src/components/icon/exports.ts::IconName"
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
},
|
|
524
|
-
"required": false,
|
|
525
|
-
"optional": true,
|
|
526
|
-
"docs": {
|
|
527
|
-
"tags": [],
|
|
528
|
-
"text": "_DEPRECATED_ (Use popover slot instead. This property will be removed in November 2025 release.)\nLabel tooltip trigger icon"
|
|
529
|
-
},
|
|
530
|
-
"getter": false,
|
|
531
|
-
"setter": false,
|
|
532
|
-
"reflect": false
|
|
533
|
-
},
|
|
534
|
-
"tooltipIconColor": {
|
|
535
|
-
"type": "string",
|
|
536
|
-
"attribute": "tooltip-icon-color",
|
|
537
|
-
"mutable": false,
|
|
538
|
-
"complexType": {
|
|
539
|
-
"original": "string",
|
|
540
|
-
"resolved": "string",
|
|
541
|
-
"references": {}
|
|
542
|
-
},
|
|
543
|
-
"required": false,
|
|
544
|
-
"optional": true,
|
|
545
|
-
"docs": {
|
|
546
|
-
"tags": [],
|
|
547
|
-
"text": "_DEPRECATED_ (Use popover slot instead. This property will be removed in November 2025 release.)\nChange color of an icon that triggers tooltip to one of the Riverty color tokens"
|
|
548
|
-
},
|
|
549
|
-
"getter": false,
|
|
550
|
-
"setter": false,
|
|
551
|
-
"reflect": false
|
|
552
|
-
},
|
|
553
486
|
"valueMissingMessage": {
|
|
554
487
|
"type": "string",
|
|
555
488
|
"attribute": "value-missing-message",
|
|
@@ -569,26 +502,6 @@ export class RadioGroup {
|
|
|
569
502
|
"setter": false,
|
|
570
503
|
"reflect": false
|
|
571
504
|
},
|
|
572
|
-
"showValid": {
|
|
573
|
-
"type": "boolean",
|
|
574
|
-
"attribute": "show-valid",
|
|
575
|
-
"mutable": false,
|
|
576
|
-
"complexType": {
|
|
577
|
-
"original": "boolean",
|
|
578
|
-
"resolved": "boolean",
|
|
579
|
-
"references": {}
|
|
580
|
-
},
|
|
581
|
-
"required": false,
|
|
582
|
-
"optional": false,
|
|
583
|
-
"docs": {
|
|
584
|
-
"tags": [],
|
|
585
|
-
"text": "_DEPRECATED_ (This property will be removed in November 2025 release.)\nIndicates whether to show the validation state.\nWhen set to `true`, the component will display validation feedback.\nDefaults to `false`."
|
|
586
|
-
},
|
|
587
|
-
"getter": false,
|
|
588
|
-
"setter": false,
|
|
589
|
-
"reflect": false,
|
|
590
|
-
"defaultValue": "false"
|
|
591
|
-
},
|
|
592
505
|
"valid": {
|
|
593
506
|
"type": "boolean",
|
|
594
507
|
"attribute": "valid",
|
|
@@ -608,25 +521,6 @@ export class RadioGroup {
|
|
|
608
521
|
"setter": false,
|
|
609
522
|
"reflect": true
|
|
610
523
|
},
|
|
611
|
-
"validMessage": {
|
|
612
|
-
"type": "string",
|
|
613
|
-
"attribute": "valid-message",
|
|
614
|
-
"mutable": false,
|
|
615
|
-
"complexType": {
|
|
616
|
-
"original": "string",
|
|
617
|
-
"resolved": "string",
|
|
618
|
-
"references": {}
|
|
619
|
-
},
|
|
620
|
-
"required": false,
|
|
621
|
-
"optional": true,
|
|
622
|
-
"docs": {
|
|
623
|
-
"tags": [],
|
|
624
|
-
"text": "_DEPRECATED_ (This property will be removed in November 2025 release.)\nSet custom message if the element meets all its validation constraints."
|
|
625
|
-
},
|
|
626
|
-
"getter": false,
|
|
627
|
-
"setter": false,
|
|
628
|
-
"reflect": false
|
|
629
|
-
},
|
|
630
524
|
"invalid": {
|
|
631
525
|
"type": "boolean",
|
|
632
526
|
"attribute": "invalid",
|
|
@@ -728,6 +622,26 @@ export class RadioGroup {
|
|
|
728
622
|
"setter": false,
|
|
729
623
|
"reflect": true,
|
|
730
624
|
"defaultValue": "'standard'"
|
|
625
|
+
},
|
|
626
|
+
"autofocus": {
|
|
627
|
+
"type": "boolean",
|
|
628
|
+
"attribute": "autofocus",
|
|
629
|
+
"mutable": false,
|
|
630
|
+
"complexType": {
|
|
631
|
+
"original": "boolean",
|
|
632
|
+
"resolved": "boolean",
|
|
633
|
+
"references": {}
|
|
634
|
+
},
|
|
635
|
+
"required": false,
|
|
636
|
+
"optional": false,
|
|
637
|
+
"docs": {
|
|
638
|
+
"tags": [],
|
|
639
|
+
"text": "When set to `true`, automatically focuses the first enabled radio button in the group on mount.\nThis will focus the selected radio button if one exists, or the first enabled radio button otherwise."
|
|
640
|
+
},
|
|
641
|
+
"getter": false,
|
|
642
|
+
"setter": false,
|
|
643
|
+
"reflect": false,
|
|
644
|
+
"defaultValue": "false"
|
|
731
645
|
}
|
|
732
646
|
};
|
|
733
647
|
}
|