@riverty/web-components 5.7.0 → 6.0.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 +128 -0
- package/custom-elements.json +152 -372
- 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 +45 -14
- package/dist/cjs/r-badge.cjs.entry.js +1 -1
- package/dist/cjs/r-button.cjs.entry.js +2 -2
- package/dist/cjs/r-checkbox-group.cjs.entry.js +28 -24
- package/dist/cjs/r-checkbox.cjs.entry.js +97 -81
- 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 +133 -25
- package/dist/cjs/r-input-date.cjs.entry.js +87 -23
- package/dist/cjs/r-input-password.cjs.entry.js +34 -13
- package/dist/cjs/r-input-phone-number.cjs.entry.js +30 -22
- package/dist/cjs/r-input.cjs.entry.js +108 -49
- package/dist/cjs/r-list-item.cjs.entry.js +5 -5
- package/dist/cjs/r-pagination.cjs.entry.js +1 -1
- package/dist/cjs/r-panel.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-action.cjs.entry.js +2 -2
- 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 +32 -32
- package/dist/cjs/r-select-option.cjs.entry.js +1 -1
- package/dist/cjs/r-select.cjs.entry.js +116 -40
- package/dist/cjs/r-skip-link.cjs.entry.js +1 -1
- package/dist/cjs/r-stepper-item.cjs.entry.js +2 -2
- package/dist/cjs/r-stepper.cjs.entry.js +1 -1
- package/dist/cjs/r-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/r-tab.cjs.entry.js +1 -1
- package/dist/cjs/r-tabs-list.cjs.entry.js +1 -1
- package/dist/cjs/r-tabs.cjs.entry.js +1 -1
- package/dist/cjs/r-textarea.cjs.entry.js +24 -23
- package/dist/cjs/r-toast-group.cjs.entry.js +1 -1
- package/dist/cjs/r-toast.cjs.entry.js +51 -20
- 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 +58 -12
- package/dist/collection/components/alert/alert.js +92 -17
- package/dist/collection/components/alert/exports.js +1 -1
- package/dist/collection/components/badge/badge.js +1 -1
- package/dist/collection/components/button/button.css +6 -7
- package/dist/collection/components/button/button.js +1 -1
- package/dist/collection/components/checkbox/checkbox.js +121 -104
- package/dist/collection/components/checkbox-group/checkbox-group.js +48 -63
- 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.css +0 -7
- package/dist/collection/components/icon-button/icon-button.js +3 -3
- package/dist/collection/components/input/input.css +3 -0
- package/dist/collection/components/input/input.js +221 -378
- package/dist/collection/components/input-code/exports.js +2 -0
- package/dist/collection/components/input-code/input-code.js +335 -34
- package/dist/collection/components/input-date/input-date.js +237 -87
- 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 +233 -75
- package/dist/collection/components/input-phone-number/input-phone-number.js +50 -85
- package/dist/collection/components/label/label.js +3 -113
- package/dist/collection/components/list-item/list-item/list-item.css +7 -7
- package/dist/collection/components/list-item/list-item/list-item.js +4 -26
- package/dist/collection/components/pagination/pagination.css +23 -23
- package/dist/collection/components/panel/panel.js +2 -2
- package/dist/collection/components/popover/exports.js +0 -1
- package/dist/collection/components/popover/popover.css +13 -13
- package/dist/collection/components/popover/popover.js +2 -55
- package/dist/collection/components/popover-action/popover-action.css +3 -5
- 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 +53 -135
- package/dist/collection/components/select/select.js +197 -349
- 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.js +1 -1
- package/dist/collection/components/stepper-item/stepper-item.js +2 -2
- package/dist/collection/components/tab/tab.js +1 -1
- 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 +1 -1
- package/dist/collection/components/textarea/textarea.js +44 -163
- package/dist/collection/components/toast/toast.css +22 -14
- package/dist/collection/components/toast/toast.js +95 -43
- package/dist/collection/components/toast-group/toast-group.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +1 -1
- 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 +45 -14
- package/dist/esm/r-badge.entry.js +1 -1
- package/dist/esm/r-button.entry.js +2 -2
- package/dist/esm/r-checkbox-group.entry.js +28 -24
- package/dist/esm/r-checkbox.entry.js +97 -81
- 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 +133 -25
- package/dist/esm/r-input-date.entry.js +87 -23
- package/dist/esm/r-input-password.entry.js +34 -13
- package/dist/esm/r-input-phone-number.entry.js +30 -22
- package/dist/esm/r-input.entry.js +108 -49
- package/dist/esm/r-list-item.entry.js +5 -5
- package/dist/esm/r-pagination.entry.js +1 -1
- package/dist/esm/r-panel.entry.js +2 -2
- package/dist/esm/r-popover-action.entry.js +2 -2
- 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 +32 -32
- package/dist/esm/r-select-option.entry.js +1 -1
- package/dist/esm/r-select.entry.js +116 -40
- package/dist/esm/r-skip-link.entry.js +1 -1
- package/dist/esm/r-stepper-item.entry.js +2 -2
- package/dist/esm/r-stepper.entry.js +1 -1
- package/dist/esm/r-tab-panel.entry.js +1 -1
- package/dist/esm/r-tab.entry.js +1 -1
- package/dist/esm/r-tabs-list.entry.js +1 -1
- package/dist/esm/r-tabs.entry.js +1 -1
- package/dist/esm/r-textarea.entry.js +24 -23
- package/dist/esm/r-toast-group.entry.js +1 -1
- package/dist/esm/r-toast.entry.js +51 -20
- 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 +9 -1
- package/dist/types/components/alert/exports.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +29 -34
- package/dist/types/components/checkbox-group/checkbox-group.d.ts +6 -11
- package/dist/types/components/dialog/dialog.d.ts +0 -2
- package/dist/types/components/input/input.d.ts +35 -72
- package/dist/types/components/input-code/exports.d.ts +4 -0
- package/dist/types/components/input-code/input-code.d.ts +54 -7
- package/dist/types/components/input-date/input-date.d.ts +30 -16
- package/dist/types/components/input-password/exports.d.ts +1 -0
- package/dist/types/components/input-password/input-password.d.ts +53 -16
- package/dist/types/components/input-phone-number/input-phone-number.d.ts +5 -16
- package/dist/types/components/label/label.d.ts +0 -18
- package/dist/types/components/list-item/list-item/list-item.d.ts +0 -6
- 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 +6 -28
- package/dist/types/components/select/select.d.ts +34 -52
- package/dist/types/components/textarea/textarea.d.ts +5 -32
- package/dist/types/components/toast/toast.d.ts +10 -7
- package/dist/types/components.d.ts +347 -647
- 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-05738503.entry.js +1 -0
- package/dist/web-components/p-0e4c8bf1.entry.js +1 -0
- package/dist/web-components/p-1da75540.entry.js +1 -0
- 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-3a5a67e7.entry.js +1 -0
- package/dist/web-components/p-3f60c6c0.entry.js +1 -0
- package/dist/web-components/p-4254a383.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-5441b746.entry.js +1 -0
- 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-60341de2.entry.js +1 -0
- package/dist/web-components/{p-4bd3e077.entry.js → p-60ca994e.entry.js} +1 -1
- package/dist/web-components/{p-44ae9f33.entry.js → p-62b788bf.entry.js} +1 -1
- package/dist/web-components/{p-2b2f581a.entry.js → p-6303b9fe.entry.js} +1 -1
- package/dist/web-components/p-63fd817d.entry.js +1 -0
- package/dist/web-components/{p-e0e2f2b2.entry.js → p-673dbfd0.entry.js} +1 -1
- package/dist/web-components/p-67fa3f84.entry.js +1 -0
- package/dist/web-components/p-6a4f3836.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-429213ea.entry.js → p-7fed6f4d.entry.js} +1 -1
- package/dist/web-components/p-8a66d20c.entry.js +1 -0
- package/dist/web-components/{p-0bb04d79.entry.js → p-8b4d2448.entry.js} +1 -1
- 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-1c2497de.entry.js → p-9ef1bbee.entry.js} +1 -1
- package/dist/web-components/p-a0dbde7c.entry.js +1 -0
- package/dist/web-components/{p-755cc697.entry.js → p-a71485d8.entry.js} +1 -1
- package/dist/web-components/p-a7d22c76.entry.js +1 -0
- package/dist/web-components/{p-85a9af42.entry.js → p-ae251d2f.entry.js} +1 -1
- package/dist/web-components/{p-77155630.entry.js → p-b98ab649.entry.js} +1 -1
- package/dist/web-components/p-b9e3b3d6.entry.js +1 -0
- package/dist/web-components/p-c1e748f2.entry.js +1 -0
- package/dist/web-components/p-c478712b.entry.js +1 -0
- package/dist/web-components/{p-72c0c0d8.entry.js → p-d054eb4d.entry.js} +1 -1
- package/dist/web-components/p-d433a828.entry.js +1 -0
- 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-e2188953.entry.js +1 -0
- package/dist/web-components/{p-3b4e3faf.entry.js → p-e5945c01.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-289eb4b0.entry.js +0 -1
- package/dist/web-components/p-2b8e12ae.entry.js +0 -1
- package/dist/web-components/p-2e2c8a5b.entry.js +0 -1
- package/dist/web-components/p-3a39932b.entry.js +0 -1
- package/dist/web-components/p-3bc93d65.entry.js +0 -1
- package/dist/web-components/p-44be9992.entry.js +0 -1
- package/dist/web-components/p-4652635a.entry.js +0 -1
- package/dist/web-components/p-51a5804b.entry.js +0 -1
- package/dist/web-components/p-63474b32.entry.js +0 -1
- package/dist/web-components/p-74d2a563.entry.js +0 -1
- package/dist/web-components/p-7ad8e78b.entry.js +0 -1
- package/dist/web-components/p-8028c2a9.entry.js +0 -1
- package/dist/web-components/p-96ddeb7f.entry.js +0 -1
- package/dist/web-components/p-9d898089.entry.js +0 -1
- package/dist/web-components/p-9e50120b.entry.js +0 -1
- package/dist/web-components/p-9eb1f262.entry.js +0 -1
- package/dist/web-components/p-a022f356.entry.js +0 -1
- package/dist/web-components/p-a7e7f8fa.entry.js +0 -1
- package/dist/web-components/p-b2f03016.entry.js +0 -1
- package/dist/web-components/p-c300c22f.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-d93c240d.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-f6a92287.entry.js +0 -1
- package/dist/web-components/p-f770e22b.entry.js +0 -1
- package/dist/web-components/p-f952161b.entry.js +0 -1
|
@@ -9,7 +9,7 @@ const RadioButtonTrailing = class {
|
|
|
9
9
|
index.registerInstance(this, hostRef);
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
return (index.h(index.Host, { key: '
|
|
12
|
+
return (index.h(index.Host, { key: '844ad8251f30a4b0b6e700d0864798957e53750b', slot: "trailing" }, index.h("div", { key: '26a3458b5a448a9d8a687081325a5aa93c83e512', class: "r-radio-button-trailing", style: { display: 'contents' } }, index.h("slot", { key: 'fc1634011f555127d3281351a8ba9d7fdc1a7a38' }))));
|
|
13
13
|
}
|
|
14
14
|
get host() { return index.getElement(this); }
|
|
15
15
|
};
|
|
@@ -14,6 +14,8 @@ const RadioButton = class {
|
|
|
14
14
|
this.radioButtonDeselect = index.createEvent(this, "radioButtonDeselect");
|
|
15
15
|
/** Value of element data within a form */
|
|
16
16
|
this.value = this.slotTextValue;
|
|
17
|
+
/** 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. */
|
|
18
|
+
this.autofocus = false;
|
|
17
19
|
/** Unique id */
|
|
18
20
|
this.uniqueId = `r-radio-button-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
19
21
|
this.onClick = (event) => {
|
|
@@ -34,18 +36,25 @@ const RadioButton = class {
|
|
|
34
36
|
this.onBlur = () => {
|
|
35
37
|
this.host.classList.remove('focused');
|
|
36
38
|
};
|
|
39
|
+
this.applyAutofocus = () => {
|
|
40
|
+
queueMicrotask(() => {
|
|
41
|
+
this.setFocus();
|
|
42
|
+
});
|
|
43
|
+
};
|
|
37
44
|
}
|
|
38
45
|
/** Sets focus on the radio button element */
|
|
39
46
|
async setFocus() {
|
|
40
|
-
|
|
47
|
+
var _a;
|
|
48
|
+
(_a = this.nativeEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
41
49
|
}
|
|
42
50
|
/** Blurs the radio button element */
|
|
43
51
|
async setBlur() {
|
|
44
|
-
|
|
52
|
+
var _a;
|
|
53
|
+
(_a = this.nativeEl) === null || _a === void 0 ? void 0 : _a.blur();
|
|
45
54
|
}
|
|
46
55
|
/** Selects the radio button element */
|
|
47
56
|
async select() {
|
|
48
|
-
var _a;
|
|
57
|
+
var _a, _b, _c;
|
|
49
58
|
if (this.checked)
|
|
50
59
|
return;
|
|
51
60
|
if (this.disabled)
|
|
@@ -55,8 +64,8 @@ const RadioButton = class {
|
|
|
55
64
|
radio.shadowRoot.querySelector('.r-radio-button--input').setAttribute('tabindex', '-1');
|
|
56
65
|
});
|
|
57
66
|
this.checked = true;
|
|
58
|
-
this.nativeEl.setAttribute('tabindex', '0');
|
|
59
|
-
this.nativeEl.focus();
|
|
67
|
+
(_b = this.nativeEl) === null || _b === void 0 ? void 0 : _b.setAttribute('tabindex', '0');
|
|
68
|
+
(_c = this.nativeEl) === null || _c === void 0 ? void 0 : _c.focus();
|
|
60
69
|
const { host, value, checked } = this;
|
|
61
70
|
this.rChange.emit({ element: host, value, checked });
|
|
62
71
|
}
|
|
@@ -90,6 +99,9 @@ const RadioButton = class {
|
|
|
90
99
|
get isTrailing() {
|
|
91
100
|
return this.host.querySelector('[slot="trailing"]') !== null || this.host.querySelector('r-radio-button-trailing') !== null;
|
|
92
101
|
}
|
|
102
|
+
get shouldAutofocus() {
|
|
103
|
+
return this.autofocus && (!this.groupEl || !this.groupEl.autofocus);
|
|
104
|
+
}
|
|
93
105
|
componentWillLoad() {
|
|
94
106
|
if (!this.initialState)
|
|
95
107
|
this.initialState = this.checked;
|
|
@@ -97,8 +109,12 @@ const RadioButton = class {
|
|
|
97
109
|
this.name = this.groupEl.name;
|
|
98
110
|
}
|
|
99
111
|
}
|
|
112
|
+
componentDidLoad() {
|
|
113
|
+
if (this.shouldAutofocus)
|
|
114
|
+
this.applyAutofocus();
|
|
115
|
+
}
|
|
100
116
|
render() {
|
|
101
|
-
const { name, value, checked, disabled, hint, uniqueId, required, invalid, error } = this;
|
|
117
|
+
const { name, value, checked, disabled, hint, uniqueId, required, invalid, error, autofocus } = this;
|
|
102
118
|
const inputAttrs = {
|
|
103
119
|
type: 'radio',
|
|
104
120
|
tabindex: '-1',
|
|
@@ -106,13 +122,14 @@ const RadioButton = class {
|
|
|
106
122
|
value,
|
|
107
123
|
disabled,
|
|
108
124
|
checked,
|
|
109
|
-
required
|
|
125
|
+
required,
|
|
126
|
+
autofocus
|
|
110
127
|
};
|
|
111
|
-
return (index.h(index.Host, { key: '
|
|
112
|
-
index.h("div", { key: '
|
|
113
|
-
index.h("div", { key: '
|
|
114
|
-
index.h("r-hint", { key: '
|
|
115
|
-
index.h("r-hint", { key: '
|
|
128
|
+
return (index.h(index.Host, { key: '718b29840798212b4a31a2250fe79620554a9fb5' }, index.h("label", { key: 'ab86d4ca9bb300628a5b7f4bf10ba2ce88656d6d', class: "r-radio-button", onClick: this.onClick, onKeyDown: this.onKeydown }, index.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 })), index.h("span", { key: 'a90a3704b4fc2d431482cca0c4064241001e09d2', class: "r-radio-button--box" }), this.isLeading &&
|
|
129
|
+
index.h("div", { key: '8a067dc10dc0f764c507be6610a8bf6f80565f8b', class: "r-radio-button--leading" }, index.h("slot", { key: 'db99a204cdf0932b203a65698f6167ede11309c4', name: "leading" }, this.icon && index.h("r-icon", { key: '8f6b1c585e0dcfcee9bb471e59f4d911ff72e7bc', name: this.icon, size: "m" }))), index.h("div", { key: 'b2ec0c20df6bffa599c5331016f3c52ce5661a17', class: "r-radio-button--text" }, index.h("slot", { key: '82ed5be7758c72ece18d4df27c0dbeb7e00ab1fc', name: "title" }, index.h("div", { key: '9c839853016eb5e7a3940bea0f9c5c755933ae55', style: { display: 'contents' } }, index.h("slot", { key: '78875045c000e5dcd0375fe2143e3032bf3a5226' }))), index.h("slot", { key: 'd75f2511dc33c734eb34c0d8953ed5be2f4cb7ea', name: "description" }, this.description)), this.isTrailing &&
|
|
130
|
+
index.h("div", { key: 'fd204a1c99ac54d60fc4479de3ca650d8ecf6508', class: "r-radio-button--trailing" }, index.h("slot", { key: '9a82590bc860567d1a60f9125622b1e63471ad94', name: "trailing" }))), invalid && error &&
|
|
131
|
+
index.h("r-hint", { key: '1fc760af1aff4ca5aaa595270c294b492fdb14e3', role: "alert", variant: "error", id: `${uniqueId}-hint` }, this.error), hint &&
|
|
132
|
+
index.h("r-hint", { key: '079a060908d285505f7093820933c173194f2348', role: "note", variant: "information", id: `${uniqueId}-hint` }, hint)));
|
|
116
133
|
}
|
|
117
134
|
get host() { return index.getElement(this); }
|
|
118
135
|
};
|
|
@@ -11,15 +11,13 @@ const RadioGroup = class {
|
|
|
11
11
|
this.rValidate = index.createEvent(this, "rValidate");
|
|
12
12
|
this.rChange = index.createEvent(this, "rChange");
|
|
13
13
|
this.rReset = index.createEvent(this, "rReset");
|
|
14
|
-
/**
|
|
15
|
-
* _DEPRECATED_ (This property will be removed in November 2025 release.)
|
|
16
|
-
* Indicates whether to show the validation state.
|
|
17
|
-
* When set to `true`, the component will display validation feedback.
|
|
18
|
-
* Defaults to `false`.
|
|
19
|
-
*/
|
|
20
|
-
this.showValid = false;
|
|
21
14
|
/** Controls the style variation of the radio buttons. */
|
|
22
15
|
this.variant = 'standard';
|
|
16
|
+
/**
|
|
17
|
+
* When set to `true`, automatically focuses the first enabled radio button in the group on mount.
|
|
18
|
+
* This will focus the selected radio button if one exists, or the first enabled radio button otherwise.
|
|
19
|
+
*/
|
|
20
|
+
this.autofocus = false;
|
|
23
21
|
this.validityState = '';
|
|
24
22
|
this.validityMessage = '';
|
|
25
23
|
/**
|
|
@@ -29,18 +27,21 @@ const RadioGroup = class {
|
|
|
29
27
|
/** Unique id */
|
|
30
28
|
this.uniqueId = `r-radio-group-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
31
29
|
this.getValidityStateData = element => {
|
|
30
|
+
let validityState = '';
|
|
31
|
+
let validityMessage = '';
|
|
32
32
|
if (element === null)
|
|
33
|
-
return;
|
|
33
|
+
return { validityState, validityMessage };
|
|
34
34
|
for (const state in element.validity) {
|
|
35
35
|
if (element.validity[state]) {
|
|
36
|
-
|
|
36
|
+
validityState = state;
|
|
37
37
|
if (this[state + 'Message']) {
|
|
38
|
-
|
|
39
|
-
return;
|
|
38
|
+
validityMessage = this[state + 'Message'];
|
|
39
|
+
return { validityState, validityMessage };
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
validityMessage = element.validationMessage;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
return { validityState, validityMessage };
|
|
44
45
|
};
|
|
45
46
|
this.validateFormElement = (element = null) => {
|
|
46
47
|
if (element === null)
|
|
@@ -49,7 +50,9 @@ const RadioGroup = class {
|
|
|
49
50
|
return;
|
|
50
51
|
if (this.error)
|
|
51
52
|
return;
|
|
52
|
-
this.getValidityStateData(element);
|
|
53
|
+
const { validityState, validityMessage } = this.getValidityStateData(element);
|
|
54
|
+
this.validityState = validityState;
|
|
55
|
+
this.validityMessage = validityMessage;
|
|
53
56
|
const isValid = this.validityState === 'valid';
|
|
54
57
|
this.valid = isValid;
|
|
55
58
|
this.invalid = !isValid;
|
|
@@ -206,14 +209,13 @@ const RadioGroup = class {
|
|
|
206
209
|
this.value = null;
|
|
207
210
|
}
|
|
208
211
|
/**
|
|
209
|
-
* Validates the radio group and returns a boolean indicating its validity.
|
|
210
|
-
*
|
|
212
|
+
* Validates the radio group without triggering UI and returns a boolean indicating its validity.
|
|
211
213
|
* @returns A boolean indicating whether the radio group is valid.
|
|
212
214
|
*/
|
|
213
215
|
async checkValidity() {
|
|
214
216
|
const element = this.nativeSelectedEl || this.nativeFirstEl || null;
|
|
215
|
-
this.getValidityStateData(element);
|
|
216
|
-
return
|
|
217
|
+
const { validityState } = this.getValidityStateData(element);
|
|
218
|
+
return validityState === 'valid';
|
|
217
219
|
}
|
|
218
220
|
/**
|
|
219
221
|
* Validates the radio group and displays the validity state.
|
|
@@ -264,10 +266,10 @@ const RadioGroup = class {
|
|
|
264
266
|
return this.host.querySelectorAll('r-radio-button:not([disabled]:not([disabled="false"]))');
|
|
265
267
|
}
|
|
266
268
|
get selectedRadioButtonElement() {
|
|
267
|
-
return Array.from(this.radioButtonElements).find(el => el.hasAttribute('checked')) || null;
|
|
269
|
+
return Array.from(this.radioButtonElements).find(el => el.checked || el.hasAttribute('checked')) || null;
|
|
268
270
|
}
|
|
269
271
|
get hasSelected() {
|
|
270
|
-
return Array.from(this.radioButtonElements).some(el => el.hasAttribute('checked'));
|
|
272
|
+
return Array.from(this.radioButtonElements).some(el => el.checked || el.hasAttribute('checked'));
|
|
271
273
|
}
|
|
272
274
|
get nativeSelectedEl() {
|
|
273
275
|
var _a, _b;
|
|
@@ -329,21 +331,19 @@ const RadioGroup = class {
|
|
|
329
331
|
const { name, required } = this;
|
|
330
332
|
this.passPropsToGroupItems({ name, required });
|
|
331
333
|
this.setTabindex();
|
|
334
|
+
if (this.autofocus) {
|
|
335
|
+
queueMicrotask(() => {
|
|
336
|
+
this.setFocus();
|
|
337
|
+
});
|
|
338
|
+
}
|
|
332
339
|
}
|
|
333
340
|
render() {
|
|
334
|
-
const { label, hint, fieldIndicator,
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
'
|
|
339
|
-
'
|
|
340
|
-
};
|
|
341
|
-
return (index.h(index.Host, { key: '0a209644dc2a122c793a38e1f624eccf3ca0b884' }, index.h("div", { key: 'b4d8dbe5fb3d1e11d87a7902addcc801852e3554', class: "r-radio-group", onClick: this.onLabelClick }, label &&
|
|
342
|
-
index.h("div", { key: 'c77bc88a07ddad6f45671c869b99b3fa5c4d0e2a', class: "r-radio-group--label-container" }, index.h("r-label", Object.assign({ key: '1dbfc739da13dbae04481912203a53837941b8e0', id: `${uniqueId}-label`, class: "r-radio-group--label", "field-indicator": fieldIndicator }, labelAttr), label), index.h("slot", { key: '2f1b6a50b2f7d7b1becef2cc95a4d7f6a26d970d', name: "popover" })), hint &&
|
|
343
|
-
index.h("r-hint", { key: 'c3c4310d3550d17d34ee26fa308cb3957a19dfd3', id: `${uniqueId}-hint`, class: "r-radio-group--hint", role: "note" }, hint), index.h("div", { key: '891beaea14680a2d629fa59f4597a968b8c2b695', class: "r-radio-group--content" }, index.h("slot", { key: '1d107723f7c363564e488309fdcb586ff43046ff' }))), invalid && error &&
|
|
344
|
-
index.h("r-hint", { key: 'de64c7c8a42136b7ac3ca93536a7654dc1d274fa', "aria-live": "polite", id: `${uniqueId}-message`, role: "alert", variant: "error" }, error), this.validityState !== 'valid' && this.validityMessage &&
|
|
345
|
-
index.h("r-hint", { key: 'c40eba0d5b6c47276ca91ca1631948d11f950c86', "aria-live": "polite", id: `${uniqueId}-message`, role: "alert", variant: "error" }, this.customErrorMessage || this.validityMessage), this.valid && this.validMessage && this.showValid &&
|
|
346
|
-
index.h("r-hint", { key: '0b13cc722509fe66231f18bd2783b29b798882ef', role: "alert", variant: "success" }, this.validMessage)));
|
|
341
|
+
const { label, hint, fieldIndicator, error, uniqueId, invalid } = this;
|
|
342
|
+
return (index.h(index.Host, { key: '598a714f75ce283c76278d52fb7684c5818700f9' }, index.h("div", { key: '0c691e6738d11dcc8b621fe90b356980944ce5ec', class: "r-radio-group", onClick: this.onLabelClick }, label &&
|
|
343
|
+
index.h("div", { key: '3071e2dedc5e9935bd6f80cc3e01883d8bffacc6', class: "r-radio-group--label-container" }, index.h("r-label", { key: '6175d4620468c3d2b06790baf11673c47e797bd7', id: `${uniqueId}-label`, class: "r-radio-group--label", "field-indicator": fieldIndicator }, label), index.h("slot", { key: '9c3595a94234b99bec2001c9667c53cd41d8fdde', name: "popover" })), hint &&
|
|
344
|
+
index.h("r-hint", { key: '8d9ef5dbaacac8a9cae05a633c942c8009b3d686', id: `${uniqueId}-hint`, class: "r-radio-group--hint", role: "note" }, hint), index.h("div", { key: '9206c8f841cc20ee632f58da3775e1d967730c58', class: "r-radio-group--content" }, index.h("slot", { key: '1f7edd0e36e16956acf7dbe5dd17c16a43b39666' }))), invalid && error &&
|
|
345
|
+
index.h("r-hint", { key: 'e4780947cede5a39e553d639eb37aeb842f1cda3', "aria-live": "polite", id: `${uniqueId}-message`, role: "alert", variant: "error" }, error), this.validityState !== 'valid' && this.validityMessage &&
|
|
346
|
+
index.h("r-hint", { key: '4c9867129f7da323cc9e99b350332ac1d5740a0e', "aria-live": "polite", id: `${uniqueId}-message`, role: "alert", variant: "error" }, this.customErrorMessage || this.validityMessage)));
|
|
347
347
|
}
|
|
348
348
|
get host() { return index.getElement(this); }
|
|
349
349
|
};
|
|
@@ -121,7 +121,7 @@ const SelectOption = class {
|
|
|
121
121
|
size: iconSize,
|
|
122
122
|
color: iconColor
|
|
123
123
|
};
|
|
124
|
-
return (index.h(index.Host, { key: '
|
|
124
|
+
return (index.h(index.Host, { key: 'd059d75cec11ef39ddea8c4ddc9ce8bc9d1a57e7', 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}` }, index.h("div", { key: '70fa5c2fc9194d197b4124b6afad296d2849032c', class: "r-select-option" }, icon && index.h("span", { key: '07bdfeb2d8330c989e6b59c34ee85cac029135cb', class: "r-select-option--icon" }, index.h("r-icon", Object.assign({ key: '358748199ca580e8a9d397ed4f5642a722703441' }, iconAttributes))), !icon && hasIconSlot && index.h("span", { key: '60a4e6059188b27d0fbe6e9b0134882cea803d90', class: "r-select-option--icon" }, index.h("slot", { key: '08b11beec2c086b21ab92ad6cab080bae1cd0eac', name: "icon" })), index.h("span", { key: '4397696c7b8ec172098d9bd82e0c89c55781bb91', class: "r-select-option--label" }, index.h("slot", { key: 'b9dddec8b9c455f130ed38577c9321cb6aced0dd' })))));
|
|
125
125
|
}
|
|
126
126
|
get host() { return index.getElement(this); }
|
|
127
127
|
};
|
|
@@ -12,19 +12,8 @@ const Select = class {
|
|
|
12
12
|
this.rValidate = index.createEvent(this, "rValidate");
|
|
13
13
|
this.rChange = index.createEvent(this, "rChange");
|
|
14
14
|
this.rReset = index.createEvent(this, "rReset");
|
|
15
|
-
/** Controls the visibility of validation indicators for the field. */
|
|
16
|
-
this.showValid = false;
|
|
17
15
|
/** Define if select should render as a text item or a block */
|
|
18
16
|
this.fullWidth = false;
|
|
19
|
-
/** _DEPRECATED_ (This property will be removed in November 2025 release. Use `leading slot` instead)
|
|
20
|
-
* Define size of an icon that serves as leading icon in select */
|
|
21
|
-
this.leadingIconSize = 's';
|
|
22
|
-
/** _DEPRECATED_ (This property will be removed in November 2025 release.)
|
|
23
|
-
* Defines the trailing icon defined by name for select, Default: 'andle-down' */
|
|
24
|
-
this.trailingIcon = 'angle-down';
|
|
25
|
-
/** _DEPRECATED_ (This property will be removed in November 2025 release.)
|
|
26
|
-
* Define size of an icon that serves as trailing icon in select */
|
|
27
|
-
this.tralingIconSize = 's';
|
|
28
17
|
/** Define wether listbox appears on top or at the bottom of the select */
|
|
29
18
|
this.listboxPosition = 'bottom';
|
|
30
19
|
/**
|
|
@@ -51,10 +40,13 @@ const Select = class {
|
|
|
51
40
|
this.valueToDisplay = '';
|
|
52
41
|
this.isInitializing = false;
|
|
53
42
|
this.isResetting = false;
|
|
54
|
-
this.isNewValue = false;
|
|
55
43
|
this.focusedOption = null;
|
|
56
44
|
this.isValueFocused = false;
|
|
57
45
|
this.isNoResultsFound = false;
|
|
46
|
+
/** Indicates if the user has interacted with the select (focused/clicked) */
|
|
47
|
+
this.touched = false;
|
|
48
|
+
/** Indicates if the value has been changed by user interaction */
|
|
49
|
+
this.dirty = false;
|
|
58
50
|
this.handleSlotChange = () => {
|
|
59
51
|
setTimeout(() => {
|
|
60
52
|
this.initialize();
|
|
@@ -68,16 +60,19 @@ const Select = class {
|
|
|
68
60
|
/** Unique id */
|
|
69
61
|
this.uniqueId = `r-select-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
70
62
|
this.getValidityStateData = (element) => {
|
|
63
|
+
let validityState = '';
|
|
64
|
+
let validityMessage = '';
|
|
71
65
|
for (const state in element.validity) {
|
|
72
66
|
if (element.validity[state]) {
|
|
73
|
-
|
|
67
|
+
validityState = state;
|
|
74
68
|
if (this[state + 'Message']) {
|
|
75
|
-
|
|
76
|
-
return;
|
|
69
|
+
validityMessage = this[state + 'Message'];
|
|
70
|
+
return { validityState, validityMessage };
|
|
77
71
|
}
|
|
78
|
-
|
|
72
|
+
validityMessage = element.validationMessage;
|
|
79
73
|
}
|
|
80
74
|
}
|
|
75
|
+
return { validityState, validityMessage };
|
|
81
76
|
};
|
|
82
77
|
this.validateFormElement = (element = null) => {
|
|
83
78
|
if (element === null)
|
|
@@ -86,7 +81,9 @@ const Select = class {
|
|
|
86
81
|
return;
|
|
87
82
|
if (this.error)
|
|
88
83
|
return;
|
|
89
|
-
this.getValidityStateData(element);
|
|
84
|
+
const { validityState, validityMessage } = this.getValidityStateData(element);
|
|
85
|
+
this.validityState = validityState;
|
|
86
|
+
this.validityMessage = validityMessage;
|
|
90
87
|
const isValid = this.validityState === 'valid';
|
|
91
88
|
this.valid = isValid;
|
|
92
89
|
this.invalid = !isValid;
|
|
@@ -108,6 +105,8 @@ const Select = class {
|
|
|
108
105
|
return;
|
|
109
106
|
e.preventDefault();
|
|
110
107
|
e.stopPropagation();
|
|
108
|
+
// Mark as touched when user clicks on the select
|
|
109
|
+
this.touched = true;
|
|
111
110
|
this.toggle();
|
|
112
111
|
if (!this.isExpanded)
|
|
113
112
|
return;
|
|
@@ -122,7 +121,11 @@ const Select = class {
|
|
|
122
121
|
return () => {
|
|
123
122
|
var _a;
|
|
124
123
|
if (this.isExpanded) {
|
|
125
|
-
|
|
124
|
+
const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
125
|
+
if (newValue !== this.currentValue) {
|
|
126
|
+
this.dirty = true;
|
|
127
|
+
}
|
|
128
|
+
this.setValueFromUserInteraction(newValue);
|
|
126
129
|
return;
|
|
127
130
|
}
|
|
128
131
|
this.expand();
|
|
@@ -143,7 +146,11 @@ const Select = class {
|
|
|
143
146
|
return;
|
|
144
147
|
}
|
|
145
148
|
if (this.focusedOption && altKey) {
|
|
146
|
-
|
|
149
|
+
const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
150
|
+
if (newValue !== this.currentValue) {
|
|
151
|
+
this.dirty = true;
|
|
152
|
+
}
|
|
153
|
+
this.setValueFromUserInteraction(newValue);
|
|
147
154
|
return;
|
|
148
155
|
}
|
|
149
156
|
if (!this.combobox && this.focusedOption === this.optionElements[0])
|
|
@@ -217,7 +224,14 @@ const Select = class {
|
|
|
217
224
|
};
|
|
218
225
|
}
|
|
219
226
|
case 'Tab':
|
|
220
|
-
return () => {
|
|
227
|
+
return () => {
|
|
228
|
+
var _a;
|
|
229
|
+
const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
230
|
+
if (newValue !== this.currentValue) {
|
|
231
|
+
this.dirty = true;
|
|
232
|
+
}
|
|
233
|
+
this.setValueFromUserInteraction(newValue);
|
|
234
|
+
};
|
|
221
235
|
default:
|
|
222
236
|
// No matching key handler: intentional no-op
|
|
223
237
|
return () => { };
|
|
@@ -289,7 +303,11 @@ const Select = class {
|
|
|
289
303
|
return;
|
|
290
304
|
}
|
|
291
305
|
this.valueElement.value = '';
|
|
292
|
-
|
|
306
|
+
const newValue = '';
|
|
307
|
+
if (newValue !== this.currentValue) {
|
|
308
|
+
this.dirty = true;
|
|
309
|
+
}
|
|
310
|
+
this.setValueFromUserInteraction(newValue);
|
|
293
311
|
this.reportValidity();
|
|
294
312
|
break;
|
|
295
313
|
default:
|
|
@@ -306,6 +324,8 @@ const Select = class {
|
|
|
306
324
|
};
|
|
307
325
|
this.onValueFocus = () => {
|
|
308
326
|
this.isValueFocused = true;
|
|
327
|
+
// Mark as touched when user focuses on the select
|
|
328
|
+
this.touched = true;
|
|
309
329
|
};
|
|
310
330
|
this.filterOptionsListByComboboxValue = (value = '') => {
|
|
311
331
|
const options = Array.from(this.host.querySelectorAll('r-select-option:not([data-no-results="true"])'));
|
|
@@ -351,6 +371,8 @@ const Select = class {
|
|
|
351
371
|
this.onResetForm = () => {
|
|
352
372
|
// Clear validation results
|
|
353
373
|
this.resetValidation();
|
|
374
|
+
// Reset touched and dirty states
|
|
375
|
+
this.markAsPristine();
|
|
354
376
|
// Restore initial value
|
|
355
377
|
this.setValue(this.initial['value']);
|
|
356
378
|
// Emit rReset
|
|
@@ -390,15 +412,24 @@ const Select = class {
|
|
|
390
412
|
handleValueChange(value, oldValue) {
|
|
391
413
|
if (this.isInitializing)
|
|
392
414
|
return;
|
|
393
|
-
this
|
|
394
|
-
|
|
415
|
+
// Only process if this is not the initial load (oldValue is defined)
|
|
416
|
+
if (oldValue !== undefined && oldValue !== value) {
|
|
417
|
+
// This is a programmatic change from parent attribute
|
|
418
|
+
// Do NOT mark as dirty, do NOT emit rChange
|
|
419
|
+
this._renderSelected(value, false);
|
|
420
|
+
this.clearComboboxOptions();
|
|
421
|
+
}
|
|
395
422
|
}
|
|
396
423
|
/** Listen for custom event triggered by "onClick" event on `<r-select-option>` */
|
|
397
424
|
optionSelectAction(e) {
|
|
398
425
|
e.stopPropagation();
|
|
399
426
|
if (this.disabled)
|
|
400
427
|
return;
|
|
401
|
-
|
|
428
|
+
// Mark as dirty only if value actually changes
|
|
429
|
+
if (e.target.value !== this.currentValue) {
|
|
430
|
+
this.dirty = true;
|
|
431
|
+
}
|
|
432
|
+
this.setValueFromUserInteraction(e.target.value);
|
|
402
433
|
}
|
|
403
434
|
tooltipFocusAction() {
|
|
404
435
|
this.collapse();
|
|
@@ -438,11 +469,28 @@ const Select = class {
|
|
|
438
469
|
if (this.isExpanded)
|
|
439
470
|
this.defineListboxPositionState();
|
|
440
471
|
}
|
|
441
|
-
/**
|
|
472
|
+
/**
|
|
473
|
+
* Set value of the select programmatically.
|
|
474
|
+
* Does NOT mark as dirty or emit change events.
|
|
475
|
+
* Use this for programmatic value updates.
|
|
476
|
+
*/
|
|
442
477
|
async setValue(value = '') {
|
|
443
478
|
// Clear validation results
|
|
444
479
|
this.resetValidation();
|
|
445
|
-
|
|
480
|
+
// Don't emit change event for programmatic updates
|
|
481
|
+
this._renderSelected(value, false);
|
|
482
|
+
this.clearComboboxOptions();
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Internal method to set value from user interaction.
|
|
486
|
+
* Assumes dirty flag is already set by the caller.
|
|
487
|
+
* Will emit rChange if dirty flag is true.
|
|
488
|
+
*/
|
|
489
|
+
setValueFromUserInteraction(value = '') {
|
|
490
|
+
// Clear validation results
|
|
491
|
+
this.resetValidation();
|
|
492
|
+
// Emit change event for user interactions (if dirty is set)
|
|
493
|
+
this._renderSelected(value, true);
|
|
446
494
|
this.clearComboboxOptions();
|
|
447
495
|
}
|
|
448
496
|
/** Set value of the select */
|
|
@@ -453,6 +501,8 @@ const Select = class {
|
|
|
453
501
|
async reset() {
|
|
454
502
|
// Clear validation results
|
|
455
503
|
this.resetValidation();
|
|
504
|
+
// Reset touched and dirty states
|
|
505
|
+
this.markAsPristine();
|
|
456
506
|
// Collapse options listbox
|
|
457
507
|
this.collapse();
|
|
458
508
|
// Restore unfiltered list
|
|
@@ -485,6 +535,35 @@ const Select = class {
|
|
|
485
535
|
this.invalid = this.initial['invalid'];
|
|
486
536
|
this.valid = !this.invalid;
|
|
487
537
|
}
|
|
538
|
+
/**
|
|
539
|
+
* Returns whether the select has been touched (focused/clicked by user).
|
|
540
|
+
* @returns A boolean indicating whether the select has been touched.
|
|
541
|
+
*/
|
|
542
|
+
async isTouched() {
|
|
543
|
+
return this.touched;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Returns whether the select value has been changed by user interaction.
|
|
547
|
+
* @returns A boolean indicating whether the select is dirty.
|
|
548
|
+
*/
|
|
549
|
+
async isDirty() {
|
|
550
|
+
return this.dirty;
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Marks the select as untouched and pristine (not dirty).
|
|
554
|
+
*/
|
|
555
|
+
async markAsPristine() {
|
|
556
|
+
this.touched = false;
|
|
557
|
+
this.dirty = false;
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Validates the textarea without triggering UI and returns a boolean indicating its validity.
|
|
561
|
+
* @returns A boolean indicating whether the textarea is valid.
|
|
562
|
+
*/
|
|
563
|
+
async checkValidity() {
|
|
564
|
+
const { validityState } = this.getValidityStateData(this.nativeElement);
|
|
565
|
+
return validityState === 'valid';
|
|
566
|
+
}
|
|
488
567
|
/** Check validity and reveal validation state and message */
|
|
489
568
|
async reportValidity() {
|
|
490
569
|
this.validateFormElement(this.nativeElement);
|
|
@@ -617,7 +696,11 @@ const Select = class {
|
|
|
617
696
|
if (!this.isBusy) {
|
|
618
697
|
this.reportValidity();
|
|
619
698
|
}
|
|
620
|
-
|
|
699
|
+
// Only emit rChange if:
|
|
700
|
+
// 1. emitValue is true
|
|
701
|
+
// 2. Not during initialization or reset
|
|
702
|
+
// 3. The component is dirty (user has interacted)
|
|
703
|
+
if (emitValue && !this.isBusy && this.dirty) {
|
|
621
704
|
this.rChange.emit({
|
|
622
705
|
element: this.host,
|
|
623
706
|
value: value
|
|
@@ -934,11 +1017,8 @@ const Select = class {
|
|
|
934
1017
|
var _a;
|
|
935
1018
|
return this.validityState !== 'valid' && ((_a = this.validityMessage) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
936
1019
|
}
|
|
937
|
-
get hasValidationSuccess() {
|
|
938
|
-
return this.valid && this.validMessage && this.showValid;
|
|
939
|
-
}
|
|
940
1020
|
get hasMessage() {
|
|
941
|
-
return this.hasError || this.hasValidationError
|
|
1021
|
+
return this.hasError || this.hasValidationError;
|
|
942
1022
|
}
|
|
943
1023
|
get isInteractive() {
|
|
944
1024
|
return !this.disabled && !this.isReadonly;
|
|
@@ -973,14 +1053,10 @@ const Select = class {
|
|
|
973
1053
|
}
|
|
974
1054
|
render() {
|
|
975
1055
|
var _a;
|
|
976
|
-
const { uniqueId, disabled, isExpanded, fieldIndicator, invalid, placeholder, required, hint, label, internal
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
tooltip,
|
|
980
|
-
'tooltip-icon': tooltipIcon,
|
|
981
|
-
'tooltip-icon-color': tooltipIconColor,
|
|
1056
|
+
const { uniqueId, disabled, isExpanded, fieldIndicator, invalid, placeholder, required, hint, label, internal } = this;
|
|
1057
|
+
const labelAttr = label ? {
|
|
1058
|
+
fieldIndicator
|
|
982
1059
|
} : {};
|
|
983
|
-
const labelAttr = label ? Object.assign({ fieldIndicator }, tooltipAttrs) : {};
|
|
984
1060
|
const isRequired = this.isInteractive ? !!required : false;
|
|
985
1061
|
const comboboxAttrs = {
|
|
986
1062
|
id: `${uniqueId}-value`,
|
|
@@ -1007,8 +1083,8 @@ const Select = class {
|
|
|
1007
1083
|
disabled,
|
|
1008
1084
|
required: isRequired
|
|
1009
1085
|
};
|
|
1010
|
-
return (index.h(index.Host, { key: '
|
|
1011
|
-
index.h("r-hint", { key: '
|
|
1086
|
+
return (index.h(index.Host, { key: '7f1fb8ee95b7da1cd7aad0d212d1efa9da744dc2', "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}` }, index.h("div", { key: 'cb2a21da12f1f1c0dc298f42338d32b709f62375', class: `r-select--label ${!internal ? 'r-select--label__margin-bottom' : ''}` }, index.h("div", { key: 'd293ba41b9846d24ba4a2c44fb8fcb9895637c03', class: internal ? 'visually-hidden' : 'r-select--label-container' }, index.h("label", { key: 'b562d22174f435deed545a94d0fd7ce0233ba3de', id: `${uniqueId}-label`, onClick: this.isInteractive ? this.onValueClick : null }, index.h("r-label", Object.assign({ key: '2412f39f04b62a1fac018b588fb463efc9760ae0' }, labelAttr), label)), index.h("slot", { key: '99c5c78534118199fc1e99daac2737b78d55bc28', name: "popover" })), hint &&
|
|
1087
|
+
index.h("r-hint", { key: '74f3cf98c25ba600e8faf8a1793d56ab14c01466', id: `${uniqueId}-hint`, class: "r-select--hint" }, hint)), index.h("div", { key: '1960780639c8896bc52d1b62269d9453645132ef', class: "r-select" }, index.h("select", Object.assign({ key: '2b9d75c37066bfeb8e06b4097ecc73bd96358702', class: "r-select--native", ref: el => this.nativeElement = el }, nativeAttrs)), index.h("div", { key: '3eff5f8f263a013e0ba7ba64eace1da6167b6d1f', class: "r-select--container" }, this.combobox ? this.renderCombobox(comboboxAttrs) : this.renderSelect(comboboxAttrs), index.h("div", Object.assign({ key: 'bbfb28e905d17feee0bd2693faac327d8ef97894', 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)) && index.h("r-select-option", { key: '319993c58f2133c271c2db357d22132497751958', "data-no-results": "true", value: "no_results" }, this.noResultsFound), index.h("slot", { key: 'bbb21659679bb22e3aeb9471a34e3e007ab835d8', onSlotchange: this.handleSlotChange })))), index.h("div", { key: '5971e5c4f3bbb453dcae9f3ecbdf2c2f14cf0293', 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 && index.h("r-hint", { key: '1c1aba3c4f3baa93cd6ecab59dd40d99ad5bd0b2', variant: this.invalid ? 'error' : 'success' }, this.hasError && this.error, this.hasValidationError && this.validityMessage))));
|
|
1012
1088
|
}
|
|
1013
1089
|
get host() { return index.getElement(this); }
|
|
1014
1090
|
static get watchers() { return {
|
|
@@ -11,7 +11,7 @@ const SkipLink = class {
|
|
|
11
11
|
this.position = 'center';
|
|
12
12
|
}
|
|
13
13
|
render() {
|
|
14
|
-
return (index.h(index.Host, { key: '
|
|
14
|
+
return (index.h(index.Host, { key: '5097cfa89ded56bcfb98dc24ca0b1e42c389e4ae' }, index.h("slot", { key: 'bba803efc4b82b0612e270665d5f80b740a786f1' })));
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
SkipLink.style = skipLinkCss;
|
|
@@ -17,8 +17,8 @@ const StepperItem = class {
|
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
19
|
const number = this.number || this.stepNumber;
|
|
20
|
-
return (index.h(index.Host, { key: '
|
|
21
|
-
index.h("div", { key: '
|
|
20
|
+
return (index.h(index.Host, { key: '3613c92e8ac7583bf5e3db7e90edca9a921fa475' }, index.h("div", { key: 'ca2c38443d9a855baea829e99ec9c642c279a3be', class: "r-stepper-item" }, index.h("div", { key: '513f01a9a3ac3a87c3622b14f051765121308241', class: "r-stepper-item--indicator" }, this.complete ? (index.h("r-icon", { name: "check", size: "s" })) : this.icon ? (index.h("r-icon", { name: this.icon, size: "s" })) : number !== undefined ? (index.h("span", { class: "r-stepper-item--indicator--step-number" }, number)) : null), this.hasText &&
|
|
21
|
+
index.h("div", { key: 'cec8659e5ff31608b05c6f62798a8a1048cd7539', class: "r-stepper-item--text" }, index.h("slot", { key: '6a9d581948decc8a15e66401275cb85bf52bb459' })))));
|
|
22
22
|
}
|
|
23
23
|
get host() { return index.getElement(this); }
|
|
24
24
|
};
|
|
@@ -17,7 +17,7 @@ const Stepper = class {
|
|
|
17
17
|
}
|
|
18
18
|
render() {
|
|
19
19
|
const completed = this.completed || this.completeSteps;
|
|
20
|
-
return (index.h(index.Host, { key: '
|
|
20
|
+
return (index.h(index.Host, { key: '196ddb8922499f7222418d19cd6ddc994c211119' }, index.h("div", { key: '2220fcb8ec2125a15db198ec7948780d8d331e50', class: "r-stepper" }, !this.hasSteps && Array.from({ length: this.total }, (_, index$1) => (index.h("r-stepper-item", { number: index$1 + 1, complete: completed > index$1, active: completed === index$1, key: index$1 }))), index.h("slot", { key: '69c7eb87d53b67b19efc6da0ab489debc7e6b06c' }))));
|
|
21
21
|
}
|
|
22
22
|
get host() { return index.getElement(this); }
|
|
23
23
|
};
|
|
@@ -18,7 +18,7 @@ const RTabPanel = class {
|
|
|
18
18
|
active,
|
|
19
19
|
'aria-labelledby': tabId
|
|
20
20
|
};
|
|
21
|
-
return (index.h(index.Host, Object.assign({ key: '
|
|
21
|
+
return (index.h(index.Host, Object.assign({ key: 'de50044bd0be5598615c2f84e66f5a552edb4ab9', class: "r-typography" }, hostAttrs), index.h("div", { key: 'e4db4fd5b115c96474f31d9d16881f496b8f4fd2', class: "r-tab-panel" }, index.h("slot", { key: 'd2ad80745f97933fb173f6ecd3635829d3c890ac' }))));
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
RTabPanel.style = tabPanelCss;
|
|
@@ -49,7 +49,7 @@ const RTab = class {
|
|
|
49
49
|
'aria-selected': `${active}`,
|
|
50
50
|
'aria-disabled': `${disabled}`
|
|
51
51
|
};
|
|
52
|
-
return (index.h(index.Host, Object.assign({ key: '
|
|
52
|
+
return (index.h(index.Host, Object.assign({ key: '04af619a56c41414b02e942d9d5bba11ef5eb1a0', onClick: this.handleClick, onKeyUp: this.handleKeyup, onKeyDown: this.handleKeydown }, hostAttrs), index.h("span", { key: 'e3fcc9b084de339aafcf98d8c5ca06f0e9615916', class: "r-tab" }, index.h("span", { key: 'bb52bf58758c2404a61b595706ecb3e3f71942ee', class: "r-tab--slot" }, index.h("slot", { key: '939a0e9618875e4909dbb763290f5f439122e312' })))));
|
|
53
53
|
}
|
|
54
54
|
get host() { return index.getElement(this); }
|
|
55
55
|
};
|
|
@@ -9,7 +9,7 @@ const RTabsList = class {
|
|
|
9
9
|
index.registerInstance(this, hostRef);
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
return (index.h(index.Host, { key: '
|
|
12
|
+
return (index.h(index.Host, { key: '98a63f5b2df8649a90efc639cf745537eb903446', role: "tablist" }, index.h("div", { key: 'f1f0ce63461fed127e2e0789e941404545265b51', class: "r-tabs-list" }, index.h("slot", { key: 'e8302171cd66fba6332ed3301be7370dff43e69d' }))));
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
RTabsList.style = tabsListCss;
|