@riverty/web-components 6.1.0 → 6.2.1
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 +29 -0
- package/custom-elements.json +160 -1
- package/dist/cjs/{index-DJ4H_bFj.js → index-BnETQtSf.js} +9 -382
- package/dist/cjs/loader.cjs.js +2 -2
- 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 +1 -1
- package/dist/cjs/r-accordion.cjs.entry.js +1 -1
- package/dist/cjs/r-alert.cjs.entry.js +9 -6
- package/dist/cjs/r-badge.cjs.entry.js +1 -1
- package/dist/cjs/r-button.cjs.entry.js +6 -2
- package/dist/cjs/r-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/r-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/r-design-system-devtools.cjs.entry.js +1 -1
- package/dist/cjs/r-dialog.cjs.entry.js +1 -1
- package/dist/cjs/r-hint_2.cjs.entry.js +3 -3
- package/dist/cjs/r-icon-button_2.cjs.entry.js +24 -4
- package/dist/cjs/r-icon.cjs.entry.js +2 -2
- package/dist/cjs/r-illustration.cjs.entry.js +396 -0
- package/dist/cjs/r-input-code.cjs.entry.js +34 -12
- package/dist/cjs/r-input-date.cjs.entry.js +7 -7
- package/dist/cjs/r-input-password.cjs.entry.js +3 -3
- package/dist/cjs/r-input-phone-number.cjs.entry.js +4 -4
- package/dist/cjs/r-input.cjs.entry.js +5 -4
- package/dist/cjs/r-list-item.cjs.entry.js +1 -1
- package/dist/cjs/r-pagination.cjs.entry.js +56 -50
- package/dist/cjs/r-panel.cjs.entry.js +3 -3
- package/dist/cjs/r-popover-action.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-content.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-headline.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-trigger.cjs.entry.js +2 -2
- package/dist/cjs/r-popover.cjs.entry.js +46 -5
- package/dist/cjs/r-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-description.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-leading.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-title.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-trailing.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button.cjs.entry.js +8 -7
- package/dist/cjs/r-radio-group.cjs.entry.js +83 -10
- package/dist/cjs/r-select-option.cjs.entry.js +2 -2
- package/dist/cjs/r-select.cjs.entry.js +6 -4
- package/dist/cjs/r-skip-link.cjs.entry.js +2 -2
- package/dist/cjs/r-stepper-item.cjs.entry.js +19 -4
- package/dist/cjs/r-stepper.cjs.entry.js +76 -3
- package/dist/cjs/r-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/r-tab.cjs.entry.js +3 -3
- package/dist/cjs/r-tabs-list.cjs.entry.js +4 -4
- package/dist/cjs/r-tabs.cjs.entry.js +2 -2
- package/dist/cjs/r-textarea.cjs.entry.js +1 -1
- package/dist/cjs/r-toast-group.cjs.entry.js +13 -4
- package/dist/cjs/r-toast.cjs.entry.js +87 -18
- package/dist/cjs/web-components.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/alert/alert.css +4 -3
- package/dist/collection/components/alert/alert.js +7 -4
- package/dist/collection/components/button/button.js +30 -1
- package/dist/collection/components/button/exports.js +1 -0
- package/dist/collection/components/checkbox/checkbox.js +3 -3
- package/dist/collection/components/icon/exports.js +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon/riverty-kit.js +1 -1
- package/dist/collection/components/illustration/data.js +112 -0
- package/dist/collection/components/illustration/exports.js +3 -0
- package/dist/collection/components/illustration/illustration.css +52 -0
- package/dist/collection/components/illustration/illustration.js +540 -0
- package/dist/collection/components/illustration/illustrations-ui-kit.js +2 -0
- package/dist/collection/components/input/exports.js +1 -0
- package/dist/collection/components/input/input.css +3 -0
- package/dist/collection/components/input/input.js +47 -2
- package/dist/collection/components/input-code/input-code.css +6 -0
- package/dist/collection/components/input-code/input-code.js +48 -10
- package/dist/collection/components/input-date/input-date.js +6 -6
- package/dist/collection/components/input-password/input-password.js +2 -2
- package/dist/collection/components/input-phone-number/input-phone-number.js +3 -3
- package/dist/collection/components/label/label.js +2 -2
- package/dist/collection/components/pagination/pagination.css +33 -72
- package/dist/collection/components/pagination/pagination.js +194 -48
- package/dist/collection/components/panel/panel.js +2 -2
- package/dist/collection/components/popover/popover.css +0 -1
- package/dist/collection/components/popover/popover.js +44 -3
- 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 +7 -6
- 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.css +4 -1
- package/dist/collection/components/radio-group/radio-group.js +100 -8
- package/dist/collection/components/select/select.js +5 -3
- 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 +4 -1
- package/dist/collection/components/stepper/stepper.js +125 -1
- package/dist/collection/components/stepper-item/stepper-item.css +22 -9
- package/dist/collection/components/stepper-item/stepper-item.js +36 -2
- package/dist/collection/components/tab/tab.js +2 -2
- package/dist/collection/components/tab-panel/tab-panel.js +1 -1
- package/dist/collection/components/tabs/tabs.js +1 -1
- package/dist/collection/components/tabs-list/tabs-list.js +3 -3
- package/dist/collection/components/toast/toast.css +9 -9
- package/dist/collection/components/toast/toast.js +109 -21
- package/dist/collection/components/toast-group/toast-group.css +5 -11
- package/dist/collection/components/toast-group/toast-group.js +12 -3
- package/dist/collection/components/tooltip/tooltip.js +23 -3
- package/dist/esm/{index-Da7qOBFr.js → index-CTxpqopm.js} +9 -382
- package/dist/esm/loader.js +3 -3
- 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 +1 -1
- package/dist/esm/r-accordion.entry.js +1 -1
- package/dist/esm/r-alert.entry.js +9 -6
- package/dist/esm/r-badge.entry.js +1 -1
- package/dist/esm/r-button.entry.js +6 -2
- package/dist/esm/r-checkbox-group.entry.js +1 -1
- package/dist/esm/r-checkbox.entry.js +4 -4
- package/dist/esm/r-design-system-devtools.entry.js +1 -1
- package/dist/esm/r-dialog.entry.js +1 -1
- package/dist/esm/r-hint_2.entry.js +3 -3
- package/dist/esm/r-icon-button_2.entry.js +24 -4
- package/dist/esm/r-icon.entry.js +2 -2
- package/dist/esm/r-illustration.entry.js +394 -0
- package/dist/esm/r-input-code.entry.js +34 -12
- package/dist/esm/r-input-date.entry.js +7 -7
- package/dist/esm/r-input-password.entry.js +3 -3
- package/dist/esm/r-input-phone-number.entry.js +4 -4
- package/dist/esm/r-input.entry.js +5 -4
- package/dist/esm/r-list-item.entry.js +1 -1
- package/dist/esm/r-pagination.entry.js +56 -50
- package/dist/esm/r-panel.entry.js +3 -3
- package/dist/esm/r-popover-action.entry.js +2 -2
- package/dist/esm/r-popover-content.entry.js +2 -2
- package/dist/esm/r-popover-headline.entry.js +2 -2
- package/dist/esm/r-popover-trigger.entry.js +2 -2
- package/dist/esm/r-popover.entry.js +46 -5
- package/dist/esm/r-progress-bar.entry.js +2 -2
- package/dist/esm/r-radio-button-description.entry.js +2 -2
- package/dist/esm/r-radio-button-leading.entry.js +2 -2
- package/dist/esm/r-radio-button-title.entry.js +2 -2
- package/dist/esm/r-radio-button-trailing.entry.js +2 -2
- package/dist/esm/r-radio-button.entry.js +8 -7
- package/dist/esm/r-radio-group.entry.js +83 -10
- package/dist/esm/r-select-option.entry.js +2 -2
- package/dist/esm/r-select.entry.js +6 -4
- package/dist/esm/r-skip-link.entry.js +2 -2
- package/dist/esm/r-stepper-item.entry.js +19 -4
- package/dist/esm/r-stepper.entry.js +76 -3
- package/dist/esm/r-tab-panel.entry.js +2 -2
- package/dist/esm/r-tab.entry.js +3 -3
- package/dist/esm/r-tabs-list.entry.js +4 -4
- package/dist/esm/r-tabs.entry.js +2 -2
- package/dist/esm/r-textarea.entry.js +1 -1
- package/dist/esm/r-toast-group.entry.js +13 -4
- package/dist/esm/r-toast.entry.js +87 -18
- package/dist/esm/web-components.js +3 -3
- package/dist/types/components/alert/alert.d.ts +1 -0
- package/dist/types/components/button/button.d.ts +8 -1
- package/dist/types/components/button/exports.d.ts +2 -0
- package/dist/types/components/icon/exports.d.ts +1 -1
- package/dist/types/components/icon/riverty-kit.d.ts +1 -1
- package/dist/types/components/illustration/data.d.ts +52 -0
- package/dist/types/components/illustration/exports.d.ts +23 -0
- package/dist/types/components/illustration/illustration.d.ts +51 -0
- package/dist/types/components/illustration/illustrations-ui-kit.d.ts +21 -0
- package/dist/types/components/input/exports.d.ts +2 -0
- package/dist/types/components/input/input.d.ts +15 -1
- package/dist/types/components/input-code/input-code.d.ts +15 -1
- package/dist/types/components/pagination/pagination.d.ts +19 -0
- package/dist/types/components/popover/popover.d.ts +9 -0
- package/dist/types/components/radio-group/radio-group.d.ts +16 -0
- package/dist/types/components/stepper/stepper.d.ts +11 -0
- package/dist/types/components/stepper-item/stepper-item.d.ts +7 -0
- package/dist/types/components/toast/toast.d.ts +10 -4
- package/dist/types/components/tooltip/tooltip.d.ts +5 -0
- package/dist/types/components.d.ts +273 -7
- package/dist/web-components/p-02b22f8e.entry.js +1 -0
- package/dist/web-components/{p-d054eb4d.entry.js → p-075a8dc8.entry.js} +1 -1
- package/dist/web-components/{p-8a66d20c.entry.js → p-0a34d33b.entry.js} +1 -1
- package/dist/web-components/{p-8c31cbd5.entry.js → p-10cc9983.entry.js} +1 -1
- package/dist/web-components/{p-d7726e46.entry.js → p-253068b9.entry.js} +1 -1
- package/dist/web-components/{p-3884c6e7.entry.js → p-3b8c8951.entry.js} +1 -1
- package/dist/web-components/{p-550e2237.entry.js → p-3beacdab.entry.js} +1 -1
- package/dist/web-components/p-4214867d.entry.js +1 -0
- package/dist/web-components/{p-3f60c6c0.entry.js → p-42c857e9.entry.js} +1 -1
- package/dist/web-components/{p-7fed6f4d.entry.js → p-44f87e16.entry.js} +1 -1
- package/dist/web-components/p-477614c5.entry.js +1 -0
- package/dist/web-components/{p-1da75540.entry.js → p-495ba3d2.entry.js} +1 -1
- package/dist/web-components/{p-19407a14.entry.js → p-4de76291.entry.js} +1 -1
- package/dist/web-components/{p-cd5daad2.entry.js → p-55600d47.entry.js} +1 -1
- package/dist/web-components/{p-c95b6470.entry.js → p-562051aa.entry.js} +1 -1
- package/dist/web-components/p-5b850e0f.entry.js +1 -0
- package/dist/web-components/p-6013dfc8.entry.js +1 -0
- package/dist/web-components/{p-6cc2ea2c.entry.js → p-62e7ae04.entry.js} +1 -1
- package/dist/web-components/p-71519d37.entry.js +1 -0
- package/dist/web-components/p-88f7b47f.entry.js +1 -0
- package/dist/web-components/p-8975a6a3.entry.js +1 -0
- package/dist/web-components/{p-6bb44ec6.entry.js → p-8e125826.entry.js} +1 -1
- package/dist/web-components/p-91cc0bde.entry.js +1 -0
- package/dist/web-components/{p-0347feff.entry.js → p-93435fcd.entry.js} +1 -1
- package/dist/web-components/p-947969d7.entry.js +1 -0
- package/dist/web-components/{p-cdd88c5a.entry.js → p-95396b5c.entry.js} +1 -1
- package/dist/web-components/p-9de3a1a5.entry.js +1 -0
- package/dist/web-components/p-9f583ed1.entry.js +1 -0
- package/dist/web-components/p-CTxpqopm.js +2 -0
- package/dist/web-components/{p-5eeb7002.entry.js → p-a1086abe.entry.js} +1 -1
- package/dist/web-components/{p-f9d5004c.entry.js → p-bbba6d79.entry.js} +1 -1
- package/dist/web-components/{p-c478712b.entry.js → p-bde44ec4.entry.js} +1 -1
- package/dist/web-components/p-bfc7e6c0.entry.js +1 -0
- package/dist/web-components/p-c1030394.entry.js +1 -0
- package/dist/web-components/{p-26ef77d6.entry.js → p-c80a5541.entry.js} +1 -1
- package/dist/web-components/{p-9ef1bbee.entry.js → p-c96ee61a.entry.js} +1 -1
- package/dist/web-components/{p-8dac326b.entry.js → p-caf8f067.entry.js} +1 -1
- package/dist/web-components/p-cc363c3d.entry.js +1 -0
- package/dist/web-components/p-cf4ff357.entry.js +1 -0
- package/dist/web-components/p-d0310ed4.entry.js +1 -0
- package/dist/web-components/p-d1412932.entry.js +1 -0
- package/dist/web-components/{p-62b788bf.entry.js → p-d2447e30.entry.js} +1 -1
- package/dist/web-components/p-dc9cca06.entry.js +1 -0
- package/dist/web-components/p-e5b943a2.entry.js +1 -0
- package/dist/web-components/{p-4cc58c6a.entry.js → p-e67b13df.entry.js} +1 -1
- package/dist/web-components/p-efec231a.entry.js +1 -0
- package/dist/web-components/{p-4595fa8e.entry.js → p-f867e4c3.entry.js} +1 -1
- package/dist/web-components/p-ff6b1b8f.entry.js +1 -0
- package/dist/web-components/web-components.esm.js +1 -1
- package/package.json +5 -2
- package/dist/collection/components/icon/bundled-icons/all-kit.json +0 -1
- package/dist/collection/components/icon/bundled-icons/riverty-kit.json +0 -1
- package/dist/web-components/bundled-icons/all-kit.json +0 -1
- package/dist/web-components/bundled-icons/riverty-kit.json +0 -1
- package/dist/web-components/p-159822fe.entry.js +0 -1
- package/dist/web-components/p-4f261b63.entry.js +0 -1
- package/dist/web-components/p-50893211.entry.js +0 -1
- package/dist/web-components/p-589baaf9.entry.js +0 -1
- package/dist/web-components/p-60341de2.entry.js +0 -1
- package/dist/web-components/p-63fd817d.entry.js +0 -1
- package/dist/web-components/p-67fa3f84.entry.js +0 -1
- package/dist/web-components/p-70784685.entry.js +0 -1
- package/dist/web-components/p-7ce57332.entry.js +0 -1
- package/dist/web-components/p-92c7cf33.entry.js +0 -1
- package/dist/web-components/p-Da7qOBFr.js +0 -2
- package/dist/web-components/p-a7d22c76.entry.js +0 -1
- package/dist/web-components/p-b96d59ca.entry.js +0 -1
- package/dist/web-components/p-b98ab649.entry.js +0 -1
- package/dist/web-components/p-ba801820.entry.js +0 -1
- package/dist/web-components/p-bfc8c077.entry.js +0 -1
- package/dist/web-components/p-c05b05da.entry.js +0 -1
- package/dist/web-components/p-c1e748f2.entry.js +0 -1
- package/dist/web-components/p-d433a828.entry.js +0 -1
- package/dist/web-components/p-d819c8e5.entry.js +0 -1
- package/dist/web-components/p-e4dc60f0.entry.js +0 -1
- package/dist/web-components/p-f7adb875.entry.js +0 -1
- package/dist/collection/components/icon/{icon-data.js → data.js} +0 -0
- package/dist/types/components/icon/{icon-data.d.ts → data.d.ts} +1 -1
|
@@ -71,8 +71,36 @@ export class RadioGroup {
|
|
|
71
71
|
this.contributeToFormData = (event) => {
|
|
72
72
|
appendControlToFormData(this.host, event.formData);
|
|
73
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* Handles parent radio group value changes for nested groups.
|
|
76
|
+
* If this is a nested group with a parentValue specified, it will reset when
|
|
77
|
+
* the parent group's value changes to something other than the parentValue.
|
|
78
|
+
*/
|
|
79
|
+
this.onParentGroupChange = (event) => {
|
|
80
|
+
// Only proceed if this group has a parentValue specified (indicating it's nested)
|
|
81
|
+
if (!this.parentValue)
|
|
82
|
+
return;
|
|
83
|
+
const parentNewValue = event.detail.value;
|
|
84
|
+
// If parent changed to a different value than our parentValue, reset this nested group
|
|
85
|
+
if (parentNewValue !== this.parentValue) {
|
|
86
|
+
this.clearValue();
|
|
87
|
+
// Emit rReset event to notify that the nested group was automatically reset
|
|
88
|
+
this.rReset.emit({
|
|
89
|
+
element: this.host,
|
|
90
|
+
value: null
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
74
94
|
}
|
|
75
95
|
rChangeAction(event) {
|
|
96
|
+
// Only handle events from direct children, not from nested radio-groups
|
|
97
|
+
const targetElement = event.target;
|
|
98
|
+
const isDirectChild = targetElement.parentElement === this.host;
|
|
99
|
+
if (!isDirectChild) {
|
|
100
|
+
return; // Ignore events from nested radio-groups
|
|
101
|
+
}
|
|
102
|
+
// Stop event from bubbling to parent radio-groups
|
|
103
|
+
event.stopPropagation();
|
|
76
104
|
this.resetValidity();
|
|
77
105
|
this.setValue(event.detail.value);
|
|
78
106
|
}
|
|
@@ -82,6 +110,14 @@ export class RadioGroup {
|
|
|
82
110
|
* to their initial values.
|
|
83
111
|
*/
|
|
84
112
|
radioButtonClickAction(event) {
|
|
113
|
+
// Only handle events from direct children, not from nested radio-groups
|
|
114
|
+
const targetElement = event.target;
|
|
115
|
+
const isDirectChild = targetElement.parentElement === this.host;
|
|
116
|
+
if (!isDirectChild) {
|
|
117
|
+
return; // Ignore events from nested radio-groups
|
|
118
|
+
}
|
|
119
|
+
// Stop event from bubbling to parent radio-groups
|
|
120
|
+
event.stopPropagation();
|
|
85
121
|
!event.target.disabled && event.target.select();
|
|
86
122
|
}
|
|
87
123
|
get selectedIndex() {
|
|
@@ -93,6 +129,7 @@ export class RadioGroup {
|
|
|
93
129
|
return isnativeFirstElement || isNoSelected ? this.radioButtonElements.length - 1 : this.selectedIndex - 1;
|
|
94
130
|
}
|
|
95
131
|
get focusedRadioButtonEl() {
|
|
132
|
+
// Query all descendants to find focused element, but it will only be used for direct children
|
|
96
133
|
return this.host.querySelector('r-radio-button.focused');
|
|
97
134
|
}
|
|
98
135
|
get focusedRadioButtonElIndex() {
|
|
@@ -108,6 +145,14 @@ export class RadioGroup {
|
|
|
108
145
|
}
|
|
109
146
|
radioButtonKeydownAction(event) {
|
|
110
147
|
var _a;
|
|
148
|
+
// Only handle events from direct children, not from nested radio-groups
|
|
149
|
+
const targetElement = event.target;
|
|
150
|
+
const isDirectChild = targetElement.parentElement === this.host;
|
|
151
|
+
if (!isDirectChild) {
|
|
152
|
+
return; // Ignore events from nested radio-groups
|
|
153
|
+
}
|
|
154
|
+
// Stop event from bubbling to parent radio-groups
|
|
155
|
+
event.stopPropagation();
|
|
111
156
|
switch (event.detail.code) {
|
|
112
157
|
case 'ArrowUp':
|
|
113
158
|
case 'ArrowLeft':
|
|
@@ -254,7 +299,8 @@ export class RadioGroup {
|
|
|
254
299
|
return this.host.closest('form') || document.querySelector(`#${this.form}`) || null;
|
|
255
300
|
}
|
|
256
301
|
get radioButtonElements() {
|
|
257
|
-
|
|
302
|
+
// Use :scope > to only select direct children, excluding nested radio-group buttons
|
|
303
|
+
return this.host.querySelectorAll(':scope > r-radio-button:not([disabled]:not([disabled="false"]))');
|
|
258
304
|
}
|
|
259
305
|
get selectedRadioButtonElement() {
|
|
260
306
|
return Array.from(this.radioButtonElements).find(el => el.checked || el.hasAttribute('checked')) || null;
|
|
@@ -292,6 +338,11 @@ export class RadioGroup {
|
|
|
292
338
|
const el = this.nativeSelectedEl || this.nativeFirstEl;
|
|
293
339
|
el === null || el === void 0 ? void 0 : el.setAttribute('tabindex', '0');
|
|
294
340
|
}
|
|
341
|
+
get parentRadioGroup() {
|
|
342
|
+
var _a;
|
|
343
|
+
// Find the parent radio group element
|
|
344
|
+
return ((_a = this.host.parentElement) === null || _a === void 0 ? void 0 : _a.closest('r-radio-group')) || null;
|
|
345
|
+
}
|
|
295
346
|
connectFormEventListeners() {
|
|
296
347
|
var _a, _b, _c;
|
|
297
348
|
(_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.addEventListener('formdata', this.contributeToFormData);
|
|
@@ -304,11 +355,28 @@ export class RadioGroup {
|
|
|
304
355
|
(_b = this.parentFormEl) === null || _b === void 0 ? void 0 : _b.removeEventListener('reset', this.onResetForm);
|
|
305
356
|
(_c = this.parentFormEl) === null || _c === void 0 ? void 0 : _c.removeEventListener('submit', this.onSubmitForm);
|
|
306
357
|
}
|
|
358
|
+
connectParentGroupListener() {
|
|
359
|
+
// Only connect if this is a nested group (has parentValue specified)
|
|
360
|
+
if (this.parentValue && this.parentRadioGroup) {
|
|
361
|
+
this.parentRadioGroup.addEventListener('rChange', this.onParentGroupChange);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
disconnectParentGroupListener() {
|
|
365
|
+
if (this.parentValue && this.parentRadioGroup) {
|
|
366
|
+
this.parentRadioGroup.removeEventListener('rChange', this.onParentGroupChange);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
get ariaDescribedBy() {
|
|
370
|
+
const messageId = `${this.uniqueId}-message`;
|
|
371
|
+
return this.hint ? `${this.uniqueId}-hint ${messageId}` : messageId;
|
|
372
|
+
}
|
|
307
373
|
connectedCallback() {
|
|
308
374
|
this.connectFormEventListeners();
|
|
375
|
+
this.connectParentGroupListener();
|
|
309
376
|
}
|
|
310
377
|
disconnectedCallback() {
|
|
311
378
|
this.disconnectFormEventListeners();
|
|
379
|
+
this.disconnectParentGroupListener();
|
|
312
380
|
}
|
|
313
381
|
componentWillLoad() {
|
|
314
382
|
const { required, name } = this;
|
|
@@ -323,18 +391,23 @@ export class RadioGroup {
|
|
|
323
391
|
this.passPropsToGroupItems({ name, required });
|
|
324
392
|
this.setTabindex();
|
|
325
393
|
if (this.autofocus) {
|
|
326
|
-
|
|
394
|
+
// Use setTimeout to ensure setValue has completed and checked state is synced
|
|
395
|
+
setTimeout(() => {
|
|
327
396
|
this.setFocus();
|
|
328
|
-
});
|
|
397
|
+
}, 0);
|
|
329
398
|
}
|
|
330
399
|
}
|
|
331
400
|
render() {
|
|
332
401
|
const { label, hint, fieldIndicator, error, uniqueId, invalid } = this;
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
402
|
+
const fieldsetAttrs = {
|
|
403
|
+
'aria-invalid': `${invalid || false}`,
|
|
404
|
+
'aria-describedby': this.ariaDescribedBy
|
|
405
|
+
};
|
|
406
|
+
return (h(Host, { key: 'bd1b1d42f3efab78cf0a2cce7b1a1e2568f21765' }, h("fieldset", Object.assign({ key: 'c449667b014cf8aeea4176b0d94c82573b661182', class: "r-radio-group" }, fieldsetAttrs, { onClick: this.onLabelClick }), label &&
|
|
407
|
+
h("legend", { key: '212e27fd8d20b31cf6d84078870ec59796bb59c6', class: "r-radio-group--label-container" }, h("r-label", { key: '69907b0e2bdb49bcdea00d1849bc0c5c4d3404ae', id: `${uniqueId}-label`, class: "r-radio-group--label", "field-indicator": fieldIndicator }, label), h("slot", { key: 'd208c147248154ba26ecc5b412233d2cf479bb68', name: "popover" })), hint &&
|
|
408
|
+
h("r-hint", { key: 'b409e053226d88ac3619524b2d63864b49972985', id: `${uniqueId}-hint`, class: "r-radio-group--hint", role: "note" }, hint), h("div", { key: 'c8e98214e9b14f6fdcf97677b392abd14d653a56', class: "r-radio-group--content" }, h("slot", { key: '5e4aa07801e8f1bd7ec3262511d28f553d8740a7' })), h("div", { key: 'a576e8c91d33877eb677d5551ac18d10924586fd', id: `${uniqueId}-message`, "aria-live": "polite", role: "alert", class: "r-radio-group--message" }, invalid && error &&
|
|
409
|
+
h("r-hint", { key: '98f7fa6855c0803ae5d31a3a248c146679204af9', variant: "error" }, error), this.validityState !== 'valid' && this.validityMessage &&
|
|
410
|
+
h("r-hint", { key: 'de1997af842a7e5fdb887a830fd0fe701e4fa5ce', variant: "error" }, this.customErrorMessage || this.validityMessage)))));
|
|
338
411
|
}
|
|
339
412
|
static get is() { return "r-radio-group"; }
|
|
340
413
|
static get encapsulation() { return "shadow"; }
|
|
@@ -642,6 +715,25 @@ export class RadioGroup {
|
|
|
642
715
|
"setter": false,
|
|
643
716
|
"reflect": false,
|
|
644
717
|
"defaultValue": "false"
|
|
718
|
+
},
|
|
719
|
+
"parentValue": {
|
|
720
|
+
"type": "string",
|
|
721
|
+
"attribute": "parent-value",
|
|
722
|
+
"mutable": false,
|
|
723
|
+
"complexType": {
|
|
724
|
+
"original": "string",
|
|
725
|
+
"resolved": "string",
|
|
726
|
+
"references": {}
|
|
727
|
+
},
|
|
728
|
+
"required": false,
|
|
729
|
+
"optional": true,
|
|
730
|
+
"docs": {
|
|
731
|
+
"tags": [],
|
|
732
|
+
"text": "For nested radio groups: specifies the parent radio button value that this nested group belongs to.\nWhen the parent group's value changes to a different value, this nested group will be automatically reset.\nThis ensures nested selections are only maintained when their parent context is active."
|
|
733
|
+
},
|
|
734
|
+
"getter": false,
|
|
735
|
+
"setter": false,
|
|
736
|
+
"reflect": false
|
|
645
737
|
}
|
|
646
738
|
};
|
|
647
739
|
}
|
|
@@ -445,7 +445,9 @@ export class Select {
|
|
|
445
445
|
if (!this.isExpanded)
|
|
446
446
|
return;
|
|
447
447
|
e.stopPropagation();
|
|
448
|
-
|
|
448
|
+
const path = e.composedPath ? e.composedPath() : [];
|
|
449
|
+
const isInsideSelect = path.includes(this.host);
|
|
450
|
+
if (!isInsideSelect) {
|
|
449
451
|
this.collapse();
|
|
450
452
|
this.reportValidity();
|
|
451
453
|
}
|
|
@@ -1080,8 +1082,8 @@ export class Select {
|
|
|
1080
1082
|
disabled,
|
|
1081
1083
|
required: isRequired
|
|
1082
1084
|
};
|
|
1083
|
-
return (h(Host, { key: '
|
|
1084
|
-
h("r-hint", { key: '
|
|
1085
|
+
return (h(Host, { key: 'f52fa96bdacace6070cd2baa15f8fab939d05916', "data-value": this.currentValue, expanded: !this.disabled && this.isExpanded, "data-listbox-position": this.listboxPositionState, "data-initial-value": this.initial['value'], "data-is-placeholder": `${!!this.isPlaceholder}`, "data-value-focused": `${!!this.isValueFocused}`, "data-option-focused": `${!!this.focusedOption}`, "data-validity-state": `${this.validityState || ''}`, "data-validity-message": `${this.validityMessage || ''}`, "data-readonly": `${!!this.isReadonly}`, "data-touched": `${this.touched}`, "data-dirty": `${this.dirty}` }, h("div", { key: '80326d43674f8caac11678ca4d5a6ca8178f9454', class: `r-select--label ${!internal ? 'r-select--label__margin-bottom' : ''}` }, h("div", { key: '25fa25960350a338c7c9156d38c974c0ad8a0861', class: internal ? 'visually-hidden' : 'r-select--label-container' }, h("label", { key: 'b52ac4d91e32df39459492bbeaf166d2a71d165c', id: `${uniqueId}-label`, onClick: this.isInteractive ? this.onValueClick : null }, h("r-label", Object.assign({ key: 'ac75955086f424e781baf66e6853cbc89ec20d56' }, labelAttr), label)), h("slot", { key: '4cd953da5c64a473070ce4b8a3e5721a36561685', name: "popover" })), hint &&
|
|
1086
|
+
h("r-hint", { key: '2d6a2e9eae51d56f31886725274c637e76ab4d75', id: `${uniqueId}-hint`, class: "r-select--hint" }, hint)), h("div", { key: '8107a1d2475d11d6e827d7394ade84f9c4c85ea5', class: "r-select" }, h("select", Object.assign({ key: 'd7a60a4ff2f8f568da1ea90d859d5de78a1e73ef', class: "r-select--native", ref: el => this.nativeElement = el }, nativeAttrs)), h("div", { key: '9d49470c7e4cc179dfd93cb1233e2bbf86ac7641', class: "r-select--container" }, this.combobox ? this.renderCombobox(comboboxAttrs) : this.renderSelect(comboboxAttrs), h("div", Object.assign({ key: '9594f3439c7591a4e4ef359a205a55d1c56dbb80', role: "listbox", tabindex: "-1", id: `${uniqueId}-list`, class: "r-select--options", ref: el => this.listboxElement = el }, listboxAttrs), (this.isNoResultsFound || !((_a = this.optionElements) === null || _a === void 0 ? void 0 : _a.length)) && h("r-select-option", { key: 'ae0ef701ff3e7db4c17aba7d57265122c3bf6587', "data-no-results": "true", value: "no_results" }, this.noResultsFound), h("slot", { key: '012fcee55283c7bc5a3230ff23b692eca33d853b', onSlotchange: this.handleSlotChange })))), h("div", { key: '94fc769d8eeb0bd92f1d12d553b033a3de9ad8dc', id: `${uniqueId}-message`, "aria-live": "polite", "aria-atomic": "true", ref: (el) => this.messageContainer = el, class: this.hasMessage && !internal ? 'r-select--message' : 'visually-hidden' }, this.hasMessage && h("r-hint", { key: '881e60130bd3cbc9004aacbb027911357286a516', variant: this.invalid ? 'error' : 'success' }, this.hasError && this.error, this.hasValidationError && this.validityMessage))));
|
|
1085
1087
|
}
|
|
1086
1088
|
static get is() { return "r-select"; }
|
|
1087
1089
|
static get encapsulation() { return "shadow"; }
|
|
@@ -128,7 +128,7 @@ export class SelectOption {
|
|
|
128
128
|
size: iconSize,
|
|
129
129
|
color: iconColor
|
|
130
130
|
};
|
|
131
|
-
return (h(Host, { key: '
|
|
131
|
+
return (h(Host, { key: 'd75c7a753d325360d4bee79ef7b96fbedd2d9b96', id: uniqueId, role: "option", onClick: this.handleClick, onKeydown: this.handleKeydown, "aria-disabled": `${disabled}`, "aria-selected": `${this.isSelected}`, "data-value": this.definedValue, "data-focused": `${this.isFocused}` }, h("div", { key: '8d8d449a5352f90d7731df10ea011856537b02f4', class: "r-select-option" }, icon && h("span", { key: 'f74192805472c8023b921f0a2869772f4c007d78', class: "r-select-option--icon" }, h("r-icon", Object.assign({ key: '6ac112921c222e83df33b2cf0113f3b158a98407' }, iconAttributes))), !icon && hasIconSlot && h("span", { key: '8c5779ab3446a8d4b8880bf1f9958f02d32ca5e4', class: "r-select-option--icon" }, h("slot", { key: '05647b1a0f7fb6f3c996461a825d8d60bb966b50', name: "icon" })), h("span", { key: 'a4de330d788288995da81cd7cbe7a9f8e9ba44c0', class: "r-select-option--label" }, h("slot", { key: '2cb6ac3d005a3bf9b75b0c23d27cbf1930bc15cc' })))));
|
|
132
132
|
}
|
|
133
133
|
static get is() { return "r-select-option"; }
|
|
134
134
|
static get encapsulation() { return "shadow"; }
|
|
@@ -5,7 +5,7 @@ export class SkipLink {
|
|
|
5
5
|
this.position = 'center';
|
|
6
6
|
}
|
|
7
7
|
render() {
|
|
8
|
-
return (h(Host, { key: '
|
|
8
|
+
return (h(Host, { key: '08280b6003ccf78bf96eba9778fd3ddcaebc8947' }, h("slot", { key: '7808e8156601912e0192fe0b74bdedda2c359e1c' })));
|
|
9
9
|
}
|
|
10
10
|
static get is() { return "r-skip-link"; }
|
|
11
11
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
.r-stepper {
|
|
2
2
|
display: var(--r-stepper--display, flex);
|
|
3
3
|
align-items: var(--r-stepper--align-items, top);
|
|
4
|
+
list-style-type: var(--r-stepper--list-style-type, none);
|
|
5
|
+
padding: var(--r-stepper--padding, 0);
|
|
6
|
+
margin: var(--r-stepper--margin, 0);
|
|
4
7
|
}
|
|
5
8
|
.r-stepper > r-stepper-item,
|
|
6
9
|
.r-stepper ::slotted(r-stepper-item) {
|
|
@@ -17,6 +20,6 @@
|
|
|
17
20
|
position: var(--r-stepper-divider--position, relative);
|
|
18
21
|
width: var(--r-stepper-divider--width, 100%);
|
|
19
22
|
height: var(--r-stepper-divider--height, 1px);
|
|
20
|
-
top: var(--r-stepper-divider--top,
|
|
23
|
+
top: var(--r-stepper-divider--top, 0.625rem);
|
|
21
24
|
background-color: var(--r-stepper-divider--background-color, var(--r-text-regular, #282828));
|
|
22
25
|
}
|
|
@@ -1,17 +1,87 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
|
+
const OFFSET = 20;
|
|
2
3
|
export class Stepper {
|
|
3
4
|
constructor() {
|
|
4
5
|
/** Complete steps. Default value 0 */
|
|
5
6
|
this.completed = 0;
|
|
6
7
|
/** _DEPRECATED_ (use `completed` instead) Completed steps. Default value 0 */
|
|
7
8
|
this.completeSteps = 0;
|
|
9
|
+
/** Label for completed steps for screen reader users. */
|
|
10
|
+
this.completedStepsLabel = 'Completed';
|
|
11
|
+
this.handleSlotChange = () => {
|
|
12
|
+
this.setStepStatus();
|
|
13
|
+
this.updateVisibilityOfStepText();
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
handleCompletedStepsLabelChange() {
|
|
17
|
+
this.setStepStatus();
|
|
18
|
+
}
|
|
19
|
+
onResize() {
|
|
20
|
+
this.updateVisibilityOfStepText();
|
|
8
21
|
}
|
|
9
22
|
get hasSteps() {
|
|
10
23
|
return this.host.querySelectorAll('r-stepper-item').length > 0;
|
|
11
24
|
}
|
|
25
|
+
componentDidLoad() {
|
|
26
|
+
this.setStepStatus();
|
|
27
|
+
this.updateVisibilityOfStepText();
|
|
28
|
+
}
|
|
29
|
+
setStepStatus() {
|
|
30
|
+
var _a;
|
|
31
|
+
const innerSteps = ((_a = this.host.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('r-stepper-item')) || [];
|
|
32
|
+
const slotSteps = this.host.querySelectorAll('r-stepper-item') || [];
|
|
33
|
+
const allSteps = [...Array.from(innerSteps), ...Array.from(slotSteps)];
|
|
34
|
+
allSteps === null || allSteps === void 0 ? void 0 : allSteps.forEach((step) => {
|
|
35
|
+
const existingSpan = step.querySelector('.visually-hidden');
|
|
36
|
+
if (existingSpan) {
|
|
37
|
+
existingSpan.remove();
|
|
38
|
+
}
|
|
39
|
+
const span = document.createElement('span');
|
|
40
|
+
span.className = 'visually-hidden';
|
|
41
|
+
span.textContent = `${step.complete ? `${this.completedStepsLabel}.` : ''}`;
|
|
42
|
+
step.prepend(span);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
getTextElementWidth(stepElement) {
|
|
46
|
+
var _a;
|
|
47
|
+
const textElement = (_a = stepElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.r-stepper-item--text');
|
|
48
|
+
if (!textElement)
|
|
49
|
+
return 0;
|
|
50
|
+
// Temporarily remove visually-hidden to get the natural width
|
|
51
|
+
const wasHidden = textElement.classList.contains('visually-hidden');
|
|
52
|
+
if (wasHidden) {
|
|
53
|
+
textElement.classList.remove('visually-hidden');
|
|
54
|
+
}
|
|
55
|
+
const width = textElement.offsetWidth;
|
|
56
|
+
// Restore the previous state
|
|
57
|
+
if (wasHidden) {
|
|
58
|
+
textElement.classList.add('visually-hidden');
|
|
59
|
+
}
|
|
60
|
+
return width;
|
|
61
|
+
}
|
|
62
|
+
updateVisibilityOfStepText() {
|
|
63
|
+
const slotSteps = this.host.querySelectorAll('r-stepper-item') || [];
|
|
64
|
+
let totalWidth = 0;
|
|
65
|
+
slotSteps.forEach((step) => {
|
|
66
|
+
totalWidth += this.getTextElementWidth(step) + OFFSET;
|
|
67
|
+
});
|
|
68
|
+
const isOverflowing = totalWidth >= this.host.offsetWidth;
|
|
69
|
+
if (isOverflowing) {
|
|
70
|
+
slotSteps.forEach((step) => {
|
|
71
|
+
var _a;
|
|
72
|
+
(_a = step.shadowRoot.querySelector('.r-stepper-item--text')) === null || _a === void 0 ? void 0 : _a.classList.add('visually-hidden');
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
slotSteps.forEach((step) => {
|
|
77
|
+
var _a;
|
|
78
|
+
(_a = step.shadowRoot.querySelector('.r-stepper-item--text')) === null || _a === void 0 ? void 0 : _a.classList.remove('visually-hidden');
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
12
82
|
render() {
|
|
13
83
|
const completed = this.completed || this.completeSteps;
|
|
14
|
-
return (h(Host, { key: '
|
|
84
|
+
return (h(Host, { key: '9a8684fe78d610b90c824a8bd06371efc222b94a' }, h("ol", { key: '89c37db27cab79946f29e5302784f3a17c853cef', class: "r-stepper", "aria-label": this.label || null }, !this.hasSteps && Array.from({ length: this.total }, (_, index) => (h("r-stepper-item", { number: index + 1, complete: completed > index, active: completed === index, key: index }))), h("slot", { key: '92d043648fb9c12ca5222a569ec40a917798af5a', onSlotchange: this.handleSlotChange }))));
|
|
15
85
|
}
|
|
16
86
|
static get is() { return "r-stepper"; }
|
|
17
87
|
static get encapsulation() { return "shadow"; }
|
|
@@ -85,8 +155,62 @@ export class Stepper {
|
|
|
85
155
|
"getter": false,
|
|
86
156
|
"setter": false,
|
|
87
157
|
"reflect": false
|
|
158
|
+
},
|
|
159
|
+
"label": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"attribute": "label",
|
|
162
|
+
"mutable": false,
|
|
163
|
+
"complexType": {
|
|
164
|
+
"original": "string",
|
|
165
|
+
"resolved": "string",
|
|
166
|
+
"references": {}
|
|
167
|
+
},
|
|
168
|
+
"required": false,
|
|
169
|
+
"optional": true,
|
|
170
|
+
"docs": {
|
|
171
|
+
"tags": [],
|
|
172
|
+
"text": "Label for the stepper for screen reader users."
|
|
173
|
+
},
|
|
174
|
+
"getter": false,
|
|
175
|
+
"setter": false,
|
|
176
|
+
"reflect": true
|
|
177
|
+
},
|
|
178
|
+
"completedStepsLabel": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"attribute": "completed-steps-label",
|
|
181
|
+
"mutable": false,
|
|
182
|
+
"complexType": {
|
|
183
|
+
"original": "string",
|
|
184
|
+
"resolved": "string",
|
|
185
|
+
"references": {}
|
|
186
|
+
},
|
|
187
|
+
"required": false,
|
|
188
|
+
"optional": true,
|
|
189
|
+
"docs": {
|
|
190
|
+
"tags": [],
|
|
191
|
+
"text": "Label for completed steps for screen reader users."
|
|
192
|
+
},
|
|
193
|
+
"getter": false,
|
|
194
|
+
"setter": false,
|
|
195
|
+
"reflect": true,
|
|
196
|
+
"defaultValue": "'Completed'"
|
|
88
197
|
}
|
|
89
198
|
};
|
|
90
199
|
}
|
|
91
200
|
static get elementRef() { return "host"; }
|
|
201
|
+
static get watchers() {
|
|
202
|
+
return [{
|
|
203
|
+
"propName": "completedStepsLabel",
|
|
204
|
+
"methodName": "handleCompletedStepsLabelChange"
|
|
205
|
+
}];
|
|
206
|
+
}
|
|
207
|
+
static get listeners() {
|
|
208
|
+
return [{
|
|
209
|
+
"name": "resize",
|
|
210
|
+
"method": "onResize",
|
|
211
|
+
"target": "window",
|
|
212
|
+
"capture": false,
|
|
213
|
+
"passive": true
|
|
214
|
+
}];
|
|
215
|
+
}
|
|
92
216
|
}
|
|
@@ -12,22 +12,35 @@
|
|
|
12
12
|
--r-stepper-item--indicator--border-color: transparent;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
::slotted(.visually-hidden),
|
|
16
|
+
[data-visually-hidden-only=true],
|
|
17
|
+
.visually-hidden {
|
|
18
|
+
position: absolute;
|
|
19
|
+
width: 1px;
|
|
20
|
+
height: 1px;
|
|
21
|
+
padding: 0;
|
|
22
|
+
margin: -1px;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
clip: rect(0, 0, 0, 0);
|
|
25
|
+
border: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
15
28
|
.r-stepper-item {
|
|
16
29
|
display: var(--r-stepper-item--display, flex);
|
|
17
30
|
flex-direction: var(--r-stepper-item--flex-direction, column);
|
|
18
31
|
align-items: var(--r-stepper-item--align-items, center);
|
|
19
32
|
justify-content: var(--r-stepper-item--justify-content, center);
|
|
20
|
-
font-size: var(--r-stepper-item--font-size, var(--r-font-size-200,
|
|
33
|
+
font-size: var(--r-stepper-item--font-size, var(--r-font-size-200, 0.8125rem));
|
|
21
34
|
color: var(--r-stepper-item--color, var(--r-text-regular, #282828));
|
|
22
35
|
font-family: var(--r-stepper-item--font-family, var(--r-font-family-text, system-ui));
|
|
23
|
-
width: var(--r-stepper-item--width,
|
|
36
|
+
width: var(--r-stepper-item--width, var(--r-spacing-225, 2.25rem));
|
|
24
37
|
white-space: var(--r-stepper-item--white-space, nowrap);
|
|
25
|
-
gap: var(--r-stepper-item--gap,
|
|
38
|
+
gap: var(--r-stepper-item--gap, var(--r-spacing-100, 0.5rem));
|
|
26
39
|
}
|
|
27
40
|
.r-stepper-item--indicator {
|
|
28
|
-
width: var(--r-stepper-item--indicator--width,
|
|
29
|
-
height: var(--r-stepper-item--indicator--height,
|
|
30
|
-
line-height: var(--r-stepper-item--indicator--line-height,
|
|
41
|
+
width: var(--r-stepper-item--indicator--width, var(--r-spacing-125, 1.25rem));
|
|
42
|
+
height: var(--r-stepper-item--indicator--height, var(--r-spacing-125, 1.25rem));
|
|
43
|
+
line-height: var(--r-stepper-item--indicator--line-height, var(--r-spacing-125, 1.25rem));
|
|
31
44
|
border-radius: var(--r-stepper-item--indicator--border-radius, 50%);
|
|
32
45
|
background-color: var(--r-stepper-item--indicator--background-color, transparent);
|
|
33
46
|
display: var(--r-stepper-item--indicator--display, flex);
|
|
@@ -36,14 +49,14 @@
|
|
|
36
49
|
border-width: var(--r-stepper-item--indicator--border-width, 1px);
|
|
37
50
|
border-style: var(--r-stepper-item--indicator--border-style, solid);
|
|
38
51
|
border-color: var(--r-stepper-item--indicator--border-color, var(--r-text-regular, #282828));
|
|
39
|
-
margin-left: var(--r-stepper-item--indicator--margin-left,
|
|
40
|
-
margin-right: var(--r-stepper-item--indicator--margin-right,
|
|
52
|
+
margin-left: var(--r-stepper-item--indicator--margin-left, var(--r-spacing-100, 0.5rem));
|
|
53
|
+
margin-right: var(--r-stepper-item--indicator--margin-right, var(--r-spacing-100, 0.5rem));
|
|
41
54
|
}
|
|
42
55
|
.r-stepper-item--indicator--step-number {
|
|
43
56
|
vertical-align: var(--r-stepper-item--step-number--vertical-align, middle);
|
|
44
57
|
}
|
|
45
58
|
.r-stepper-item--text {
|
|
46
|
-
font-size: var(--r-stepper-item--text--font-size, var(--r-font-size-200,
|
|
59
|
+
font-size: var(--r-stepper-item--text--font-size, var(--r-font-size-200, 0.8125rem));
|
|
47
60
|
color: var(--r-stepper-item--text--color, var(--r-text-regular, #282828));
|
|
48
61
|
text-align: var(--r-stepper-item--text--text-align, center);
|
|
49
62
|
}
|
|
@@ -6,13 +6,28 @@ export class StepperItem {
|
|
|
6
6
|
/** Defines a property active that determines whether the step is active */
|
|
7
7
|
this.active = false;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the slot contains only visually-hidden elements (no visible text).
|
|
11
|
+
* Returns true if only visually-hidden elements are present.
|
|
12
|
+
*/
|
|
13
|
+
get hasOnlyVisuallyHiddenContent() {
|
|
14
|
+
var _a;
|
|
15
|
+
const textContent = ((_a = this.host.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || '';
|
|
16
|
+
const visuallyHiddenElement = this.host.querySelector('.visually-hidden');
|
|
17
|
+
if (!visuallyHiddenElement) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const visuallyHiddenText = visuallyHiddenElement.textContent || '';
|
|
21
|
+
const remainingText = textContent.replace(visuallyHiddenText.trim(), '').trim();
|
|
22
|
+
return !remainingText.length;
|
|
23
|
+
}
|
|
9
24
|
get hasText() {
|
|
10
25
|
return this.host.textContent.trim().length > 0;
|
|
11
26
|
}
|
|
12
27
|
render() {
|
|
13
28
|
const number = this.number || this.stepNumber;
|
|
14
|
-
return (h(Host, { key: '
|
|
15
|
-
h("div", { key: '
|
|
29
|
+
return (h(Host, { key: '4f55b5491ec5eee7cad6313fa85e7d6cc89b2178', role: "listitem", "aria-current": this.active ? 'step' : null }, h("div", { key: '2864f0e19f2f11af0f8674b9a701cd948024c085', class: "r-stepper-item" }, h("div", { key: 'de896ec98a13a4b20965a3ca58c5517a30de1f74', class: "r-stepper-item--indicator" }, this.complete ? (h("r-icon", { name: "check", size: "s" })) : this.icon ? (h("r-icon", { name: this.icon, iconAriaLabel: this.label, size: "s" })) : number !== undefined ? (h("span", { "aria-hidden": `${!this.hasOnlyVisuallyHiddenContent}`, class: "r-stepper-item--indicator--step-number" }, number)) : null), this.hasText &&
|
|
30
|
+
h("div", { key: 'cf3b6b5e3f4454830ecce06a6b6c16225aadd93e', "data-visually-hidden-only": `${this.hasOnlyVisuallyHiddenContent}`, class: "r-stepper-item--text" }, h("slot", { key: '65bd1f231c445f9681750c71ef156297edbf05fb' })))));
|
|
16
31
|
}
|
|
17
32
|
static get is() { return "r-stepper-item"; }
|
|
18
33
|
static get encapsulation() { return "shadow"; }
|
|
@@ -130,6 +145,25 @@ export class StepperItem {
|
|
|
130
145
|
"getter": false,
|
|
131
146
|
"setter": false,
|
|
132
147
|
"reflect": true
|
|
148
|
+
},
|
|
149
|
+
"label": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"attribute": "label",
|
|
152
|
+
"mutable": false,
|
|
153
|
+
"complexType": {
|
|
154
|
+
"original": "string",
|
|
155
|
+
"resolved": "string",
|
|
156
|
+
"references": {}
|
|
157
|
+
},
|
|
158
|
+
"required": false,
|
|
159
|
+
"optional": true,
|
|
160
|
+
"docs": {
|
|
161
|
+
"tags": [],
|
|
162
|
+
"text": "Label for the step icon for screen reader users."
|
|
163
|
+
},
|
|
164
|
+
"getter": false,
|
|
165
|
+
"setter": false,
|
|
166
|
+
"reflect": true
|
|
133
167
|
}
|
|
134
168
|
};
|
|
135
169
|
}
|
|
@@ -43,9 +43,9 @@ export class RTab {
|
|
|
43
43
|
'aria-selected': `${active}`,
|
|
44
44
|
'aria-disabled': `${disabled}`
|
|
45
45
|
};
|
|
46
|
-
return (h(Host, Object.assign({ key: '
|
|
46
|
+
return (h(Host, Object.assign({ key: '270a02c942f223ef5ac0f9f83d33c51bfd88c1c7', onClick: this.handleClick, onKeyUp: this.handleKeyup, onKeyDown: this.handleKeydown }, hostAttrs), h("span", { key: '60bbf17ad69478028579b61d03ca316a55ce52ea', class: "r-tab" }, disabled ?
|
|
47
47
|
h("r-icon", { class: "r-tab--disabled-icon", size: "s", name: "circle-slash" })
|
|
48
|
-
: h("slot", { name: "icon" }), h("slot", { key: '
|
|
48
|
+
: h("slot", { name: "icon" }), h("slot", { key: '5b0582bebdf14a0de908d23d2a08d80cf1850b50' }))));
|
|
49
49
|
}
|
|
50
50
|
static get is() { return "r-tab"; }
|
|
51
51
|
static get encapsulation() { return "shadow"; }
|
|
@@ -12,7 +12,7 @@ export class RTabPanel {
|
|
|
12
12
|
active,
|
|
13
13
|
'aria-labelledby': tabId
|
|
14
14
|
};
|
|
15
|
-
return (h(Host, Object.assign({ key: '
|
|
15
|
+
return (h(Host, Object.assign({ key: 'f58718704b5625e82bfa531bcbf2b6c94c2e1ae3', class: "r-typography" }, hostAttrs), h("div", { key: '75dc2720b47da749a4d1e168e20338b94724a369', class: "r-tab-panel" }, h("slot", { key: '9710a7fc07751091c4ec0c97ae1d205ae540fdfd' }))));
|
|
16
16
|
}
|
|
17
17
|
static get is() { return "r-tab-panel"; }
|
|
18
18
|
static get encapsulation() { return "shadow"; }
|
|
@@ -261,7 +261,7 @@ export class RTabs {
|
|
|
261
261
|
this._changeFocusTab(e.target, e.detail.keycode);
|
|
262
262
|
}
|
|
263
263
|
render() {
|
|
264
|
-
return (h(Host, { key: '
|
|
264
|
+
return (h(Host, { key: '0737bf78e596f8fb9d4a2ec10f1503d1072f2683', class: "r-tabs" }, h("slot", { key: '5bc87b17930c9ea159ef29335c6b11f0f4c7d43e' })));
|
|
265
265
|
}
|
|
266
266
|
static get is() { return "r-tabs"; }
|
|
267
267
|
static get encapsulation() { return "shadow"; }
|
|
@@ -158,9 +158,9 @@ export class RTabsList {
|
|
|
158
158
|
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
159
159
|
}
|
|
160
160
|
render() {
|
|
161
|
-
return (h(Host, { key: '
|
|
162
|
-
h("div", { key: '
|
|
163
|
-
h("div", { key: '
|
|
161
|
+
return (h(Host, { key: '19666af123fe058aa3e654c153ad84ec16861a59', scrollable: `${this.scrollable}`, role: "tablist" }, h("div", { key: '5de7241f57b419133f81ae565bf517873a8e9268', class: "r-tabs-list" }, this.scrollable &&
|
|
162
|
+
h("div", { key: 'ff5edcbb61dd4ba9be3e0baf22822edbcbf8ec6d', "aria-hidden": "true", class: "r-tabs-list--scroll-button-container" }, this.renderScrollButton('left', this.firstItemVisible, this.scrollLeft, this.scrollLeftTooltip), !this.firstItemVisible && h("div", { key: '76fbeab529e2a7869ac7e946b1c0863969114888', class: "r-tabs-list--scroll-indicator" })), h("div", { key: 'd520b386242700c000daf85eba8d50fb014fc616', class: "r-tabs-list--tabs-container", ref: (el) => this.containerRef = el, onScroll: this.updateScrollState }, h("slot", { key: 'f8534275445ed4d32154519f0a8f592ee7ea3353' })), this.scrollable &&
|
|
163
|
+
h("div", { key: '8ca03d4864eba5af975de4dd6dc6fd3c3e8be108', "aria-hidden": "true", class: "r-tabs-list--scroll-button-container" }, !this.lastItemVisible && h("div", { key: '1a0534b79bbe3273a73f48530a3a17ccac0d7826', class: "r-tabs-list--scroll-indicator" }), this.renderScrollButton('right', this.lastItemVisible, this.scrollRight, this.scrollRightTooltip)))));
|
|
164
164
|
}
|
|
165
165
|
static get is() { return "r-tabs-list"; }
|
|
166
166
|
static get encapsulation() { return "shadow"; }
|