@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
|
@@ -10,19 +10,8 @@ const Select = class {
|
|
|
10
10
|
this.rValidate = createEvent(this, "rValidate");
|
|
11
11
|
this.rChange = createEvent(this, "rChange");
|
|
12
12
|
this.rReset = createEvent(this, "rReset");
|
|
13
|
-
/** Controls the visibility of validation indicators for the field. */
|
|
14
|
-
this.showValid = false;
|
|
15
13
|
/** Define if select should render as a text item or a block */
|
|
16
14
|
this.fullWidth = false;
|
|
17
|
-
/** _DEPRECATED_ (This property will be removed in November 2025 release. Use `leading slot` instead)
|
|
18
|
-
* Define size of an icon that serves as leading icon in select */
|
|
19
|
-
this.leadingIconSize = 's';
|
|
20
|
-
/** _DEPRECATED_ (This property will be removed in November 2025 release.)
|
|
21
|
-
* Defines the trailing icon defined by name for select, Default: 'andle-down' */
|
|
22
|
-
this.trailingIcon = 'angle-down';
|
|
23
|
-
/** _DEPRECATED_ (This property will be removed in November 2025 release.)
|
|
24
|
-
* Define size of an icon that serves as trailing icon in select */
|
|
25
|
-
this.tralingIconSize = 's';
|
|
26
15
|
/** Define wether listbox appears on top or at the bottom of the select */
|
|
27
16
|
this.listboxPosition = 'bottom';
|
|
28
17
|
/**
|
|
@@ -49,10 +38,13 @@ const Select = class {
|
|
|
49
38
|
this.valueToDisplay = '';
|
|
50
39
|
this.isInitializing = false;
|
|
51
40
|
this.isResetting = false;
|
|
52
|
-
this.isNewValue = false;
|
|
53
41
|
this.focusedOption = null;
|
|
54
42
|
this.isValueFocused = false;
|
|
55
43
|
this.isNoResultsFound = false;
|
|
44
|
+
/** Indicates if the user has interacted with the select (focused/clicked) */
|
|
45
|
+
this.touched = false;
|
|
46
|
+
/** Indicates if the value has been changed by user interaction */
|
|
47
|
+
this.dirty = false;
|
|
56
48
|
this.handleSlotChange = () => {
|
|
57
49
|
setTimeout(() => {
|
|
58
50
|
this.initialize();
|
|
@@ -66,16 +58,19 @@ const Select = class {
|
|
|
66
58
|
/** Unique id */
|
|
67
59
|
this.uniqueId = `r-select-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
68
60
|
this.getValidityStateData = (element) => {
|
|
61
|
+
let validityState = '';
|
|
62
|
+
let validityMessage = '';
|
|
69
63
|
for (const state in element.validity) {
|
|
70
64
|
if (element.validity[state]) {
|
|
71
|
-
|
|
65
|
+
validityState = state;
|
|
72
66
|
if (this[state + 'Message']) {
|
|
73
|
-
|
|
74
|
-
return;
|
|
67
|
+
validityMessage = this[state + 'Message'];
|
|
68
|
+
return { validityState, validityMessage };
|
|
75
69
|
}
|
|
76
|
-
|
|
70
|
+
validityMessage = element.validationMessage;
|
|
77
71
|
}
|
|
78
72
|
}
|
|
73
|
+
return { validityState, validityMessage };
|
|
79
74
|
};
|
|
80
75
|
this.validateFormElement = (element = null) => {
|
|
81
76
|
if (element === null)
|
|
@@ -84,7 +79,9 @@ const Select = class {
|
|
|
84
79
|
return;
|
|
85
80
|
if (this.error)
|
|
86
81
|
return;
|
|
87
|
-
this.getValidityStateData(element);
|
|
82
|
+
const { validityState, validityMessage } = this.getValidityStateData(element);
|
|
83
|
+
this.validityState = validityState;
|
|
84
|
+
this.validityMessage = validityMessage;
|
|
88
85
|
const isValid = this.validityState === 'valid';
|
|
89
86
|
this.valid = isValid;
|
|
90
87
|
this.invalid = !isValid;
|
|
@@ -106,6 +103,8 @@ const Select = class {
|
|
|
106
103
|
return;
|
|
107
104
|
e.preventDefault();
|
|
108
105
|
e.stopPropagation();
|
|
106
|
+
// Mark as touched when user clicks on the select
|
|
107
|
+
this.touched = true;
|
|
109
108
|
this.toggle();
|
|
110
109
|
if (!this.isExpanded)
|
|
111
110
|
return;
|
|
@@ -120,7 +119,11 @@ const Select = class {
|
|
|
120
119
|
return () => {
|
|
121
120
|
var _a;
|
|
122
121
|
if (this.isExpanded) {
|
|
123
|
-
|
|
122
|
+
const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
123
|
+
if (newValue !== this.currentValue) {
|
|
124
|
+
this.dirty = true;
|
|
125
|
+
}
|
|
126
|
+
this.setValueFromUserInteraction(newValue);
|
|
124
127
|
return;
|
|
125
128
|
}
|
|
126
129
|
this.expand();
|
|
@@ -141,7 +144,11 @@ const Select = class {
|
|
|
141
144
|
return;
|
|
142
145
|
}
|
|
143
146
|
if (this.focusedOption && altKey) {
|
|
144
|
-
|
|
147
|
+
const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
148
|
+
if (newValue !== this.currentValue) {
|
|
149
|
+
this.dirty = true;
|
|
150
|
+
}
|
|
151
|
+
this.setValueFromUserInteraction(newValue);
|
|
145
152
|
return;
|
|
146
153
|
}
|
|
147
154
|
if (!this.combobox && this.focusedOption === this.optionElements[0])
|
|
@@ -215,7 +222,14 @@ const Select = class {
|
|
|
215
222
|
};
|
|
216
223
|
}
|
|
217
224
|
case 'Tab':
|
|
218
|
-
return () => {
|
|
225
|
+
return () => {
|
|
226
|
+
var _a;
|
|
227
|
+
const newValue = ((_a = this.focusedOption) === null || _a === void 0 ? void 0 : _a.value) || '';
|
|
228
|
+
if (newValue !== this.currentValue) {
|
|
229
|
+
this.dirty = true;
|
|
230
|
+
}
|
|
231
|
+
this.setValueFromUserInteraction(newValue);
|
|
232
|
+
};
|
|
219
233
|
default:
|
|
220
234
|
// No matching key handler: intentional no-op
|
|
221
235
|
return () => { };
|
|
@@ -287,7 +301,11 @@ const Select = class {
|
|
|
287
301
|
return;
|
|
288
302
|
}
|
|
289
303
|
this.valueElement.value = '';
|
|
290
|
-
|
|
304
|
+
const newValue = '';
|
|
305
|
+
if (newValue !== this.currentValue) {
|
|
306
|
+
this.dirty = true;
|
|
307
|
+
}
|
|
308
|
+
this.setValueFromUserInteraction(newValue);
|
|
291
309
|
this.reportValidity();
|
|
292
310
|
break;
|
|
293
311
|
default:
|
|
@@ -304,6 +322,8 @@ const Select = class {
|
|
|
304
322
|
};
|
|
305
323
|
this.onValueFocus = () => {
|
|
306
324
|
this.isValueFocused = true;
|
|
325
|
+
// Mark as touched when user focuses on the select
|
|
326
|
+
this.touched = true;
|
|
307
327
|
};
|
|
308
328
|
this.filterOptionsListByComboboxValue = (value = '') => {
|
|
309
329
|
const options = Array.from(this.host.querySelectorAll('r-select-option:not([data-no-results="true"])'));
|
|
@@ -349,6 +369,8 @@ const Select = class {
|
|
|
349
369
|
this.onResetForm = () => {
|
|
350
370
|
// Clear validation results
|
|
351
371
|
this.resetValidation();
|
|
372
|
+
// Reset touched and dirty states
|
|
373
|
+
this.markAsPristine();
|
|
352
374
|
// Restore initial value
|
|
353
375
|
this.setValue(this.initial['value']);
|
|
354
376
|
// Emit rReset
|
|
@@ -388,15 +410,24 @@ const Select = class {
|
|
|
388
410
|
handleValueChange(value, oldValue) {
|
|
389
411
|
if (this.isInitializing)
|
|
390
412
|
return;
|
|
391
|
-
this
|
|
392
|
-
|
|
413
|
+
// Only process if this is not the initial load (oldValue is defined)
|
|
414
|
+
if (oldValue !== undefined && oldValue !== value) {
|
|
415
|
+
// This is a programmatic change from parent attribute
|
|
416
|
+
// Do NOT mark as dirty, do NOT emit rChange
|
|
417
|
+
this._renderSelected(value, false);
|
|
418
|
+
this.clearComboboxOptions();
|
|
419
|
+
}
|
|
393
420
|
}
|
|
394
421
|
/** Listen for custom event triggered by "onClick" event on `<r-select-option>` */
|
|
395
422
|
optionSelectAction(e) {
|
|
396
423
|
e.stopPropagation();
|
|
397
424
|
if (this.disabled)
|
|
398
425
|
return;
|
|
399
|
-
|
|
426
|
+
// Mark as dirty only if value actually changes
|
|
427
|
+
if (e.target.value !== this.currentValue) {
|
|
428
|
+
this.dirty = true;
|
|
429
|
+
}
|
|
430
|
+
this.setValueFromUserInteraction(e.target.value);
|
|
400
431
|
}
|
|
401
432
|
tooltipFocusAction() {
|
|
402
433
|
this.collapse();
|
|
@@ -436,11 +467,28 @@ const Select = class {
|
|
|
436
467
|
if (this.isExpanded)
|
|
437
468
|
this.defineListboxPositionState();
|
|
438
469
|
}
|
|
439
|
-
/**
|
|
470
|
+
/**
|
|
471
|
+
* Set value of the select programmatically.
|
|
472
|
+
* Does NOT mark as dirty or emit change events.
|
|
473
|
+
* Use this for programmatic value updates.
|
|
474
|
+
*/
|
|
440
475
|
async setValue(value = '') {
|
|
441
476
|
// Clear validation results
|
|
442
477
|
this.resetValidation();
|
|
443
|
-
|
|
478
|
+
// Don't emit change event for programmatic updates
|
|
479
|
+
this._renderSelected(value, false);
|
|
480
|
+
this.clearComboboxOptions();
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Internal method to set value from user interaction.
|
|
484
|
+
* Assumes dirty flag is already set by the caller.
|
|
485
|
+
* Will emit rChange if dirty flag is true.
|
|
486
|
+
*/
|
|
487
|
+
setValueFromUserInteraction(value = '') {
|
|
488
|
+
// Clear validation results
|
|
489
|
+
this.resetValidation();
|
|
490
|
+
// Emit change event for user interactions (if dirty is set)
|
|
491
|
+
this._renderSelected(value, true);
|
|
444
492
|
this.clearComboboxOptions();
|
|
445
493
|
}
|
|
446
494
|
/** Set value of the select */
|
|
@@ -451,6 +499,8 @@ const Select = class {
|
|
|
451
499
|
async reset() {
|
|
452
500
|
// Clear validation results
|
|
453
501
|
this.resetValidation();
|
|
502
|
+
// Reset touched and dirty states
|
|
503
|
+
this.markAsPristine();
|
|
454
504
|
// Collapse options listbox
|
|
455
505
|
this.collapse();
|
|
456
506
|
// Restore unfiltered list
|
|
@@ -483,6 +533,35 @@ const Select = class {
|
|
|
483
533
|
this.invalid = this.initial['invalid'];
|
|
484
534
|
this.valid = !this.invalid;
|
|
485
535
|
}
|
|
536
|
+
/**
|
|
537
|
+
* Returns whether the select has been touched (focused/clicked by user).
|
|
538
|
+
* @returns A boolean indicating whether the select has been touched.
|
|
539
|
+
*/
|
|
540
|
+
async isTouched() {
|
|
541
|
+
return this.touched;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Returns whether the select value has been changed by user interaction.
|
|
545
|
+
* @returns A boolean indicating whether the select is dirty.
|
|
546
|
+
*/
|
|
547
|
+
async isDirty() {
|
|
548
|
+
return this.dirty;
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Marks the select as untouched and pristine (not dirty).
|
|
552
|
+
*/
|
|
553
|
+
async markAsPristine() {
|
|
554
|
+
this.touched = false;
|
|
555
|
+
this.dirty = false;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Validates the textarea without triggering UI and returns a boolean indicating its validity.
|
|
559
|
+
* @returns A boolean indicating whether the textarea is valid.
|
|
560
|
+
*/
|
|
561
|
+
async checkValidity() {
|
|
562
|
+
const { validityState } = this.getValidityStateData(this.nativeElement);
|
|
563
|
+
return validityState === 'valid';
|
|
564
|
+
}
|
|
486
565
|
/** Check validity and reveal validation state and message */
|
|
487
566
|
async reportValidity() {
|
|
488
567
|
this.validateFormElement(this.nativeElement);
|
|
@@ -615,7 +694,11 @@ const Select = class {
|
|
|
615
694
|
if (!this.isBusy) {
|
|
616
695
|
this.reportValidity();
|
|
617
696
|
}
|
|
618
|
-
|
|
697
|
+
// Only emit rChange if:
|
|
698
|
+
// 1. emitValue is true
|
|
699
|
+
// 2. Not during initialization or reset
|
|
700
|
+
// 3. The component is dirty (user has interacted)
|
|
701
|
+
if (emitValue && !this.isBusy && this.dirty) {
|
|
619
702
|
this.rChange.emit({
|
|
620
703
|
element: this.host,
|
|
621
704
|
value: value
|
|
@@ -932,11 +1015,8 @@ const Select = class {
|
|
|
932
1015
|
var _a;
|
|
933
1016
|
return this.validityState !== 'valid' && ((_a = this.validityMessage) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
934
1017
|
}
|
|
935
|
-
get hasValidationSuccess() {
|
|
936
|
-
return this.valid && this.validMessage && this.showValid;
|
|
937
|
-
}
|
|
938
1018
|
get hasMessage() {
|
|
939
|
-
return this.hasError || this.hasValidationError
|
|
1019
|
+
return this.hasError || this.hasValidationError;
|
|
940
1020
|
}
|
|
941
1021
|
get isInteractive() {
|
|
942
1022
|
return !this.disabled && !this.isReadonly;
|
|
@@ -971,14 +1051,10 @@ const Select = class {
|
|
|
971
1051
|
}
|
|
972
1052
|
render() {
|
|
973
1053
|
var _a;
|
|
974
|
-
const { uniqueId, disabled, isExpanded, fieldIndicator, invalid, placeholder, required, hint, label, internal
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
tooltip,
|
|
978
|
-
'tooltip-icon': tooltipIcon,
|
|
979
|
-
'tooltip-icon-color': tooltipIconColor,
|
|
1054
|
+
const { uniqueId, disabled, isExpanded, fieldIndicator, invalid, placeholder, required, hint, label, internal } = this;
|
|
1055
|
+
const labelAttr = label ? {
|
|
1056
|
+
fieldIndicator
|
|
980
1057
|
} : {};
|
|
981
|
-
const labelAttr = label ? Object.assign({ fieldIndicator }, tooltipAttrs) : {};
|
|
982
1058
|
const isRequired = this.isInteractive ? !!required : false;
|
|
983
1059
|
const comboboxAttrs = {
|
|
984
1060
|
id: `${uniqueId}-value`,
|
|
@@ -1005,8 +1081,8 @@ const Select = class {
|
|
|
1005
1081
|
disabled,
|
|
1006
1082
|
required: isRequired
|
|
1007
1083
|
};
|
|
1008
|
-
return (h(Host, { key: '
|
|
1009
|
-
h("r-hint", { key: '
|
|
1084
|
+
return (h(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}` }, h("div", { key: 'cb2a21da12f1f1c0dc298f42338d32b709f62375', class: `r-select--label ${!internal ? 'r-select--label__margin-bottom' : ''}` }, h("div", { key: 'd293ba41b9846d24ba4a2c44fb8fcb9895637c03', class: internal ? 'visually-hidden' : 'r-select--label-container' }, h("label", { key: 'b562d22174f435deed545a94d0fd7ce0233ba3de', id: `${uniqueId}-label`, onClick: this.isInteractive ? this.onValueClick : null }, h("r-label", Object.assign({ key: '2412f39f04b62a1fac018b588fb463efc9760ae0' }, labelAttr), label)), h("slot", { key: '99c5c78534118199fc1e99daac2737b78d55bc28', name: "popover" })), hint &&
|
|
1085
|
+
h("r-hint", { key: '74f3cf98c25ba600e8faf8a1793d56ab14c01466', id: `${uniqueId}-hint`, class: "r-select--hint" }, hint)), h("div", { key: '1960780639c8896bc52d1b62269d9453645132ef', class: "r-select" }, h("select", Object.assign({ key: '2b9d75c37066bfeb8e06b4097ecc73bd96358702', class: "r-select--native", ref: el => this.nativeElement = el }, nativeAttrs)), h("div", { key: '3eff5f8f263a013e0ba7ba64eace1da6167b6d1f', class: "r-select--container" }, this.combobox ? this.renderCombobox(comboboxAttrs) : this.renderSelect(comboboxAttrs), 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)) && h("r-select-option", { key: '319993c58f2133c271c2db357d22132497751958', "data-no-results": "true", value: "no_results" }, this.noResultsFound), h("slot", { key: 'bbb21659679bb22e3aeb9471a34e3e007ab835d8', onSlotchange: this.handleSlotChange })))), 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 && h("r-hint", { key: '1c1aba3c4f3baa93cd6ecab59dd40d99ad5bd0b2', variant: this.invalid ? 'error' : 'success' }, this.hasError && this.error, this.hasValidationError && this.validityMessage))));
|
|
1010
1086
|
}
|
|
1011
1087
|
get host() { return getElement(this); }
|
|
1012
1088
|
static get watchers() { return {
|
|
@@ -9,7 +9,7 @@ const SkipLink = class {
|
|
|
9
9
|
this.position = 'center';
|
|
10
10
|
}
|
|
11
11
|
render() {
|
|
12
|
-
return (h(Host, { key: '
|
|
12
|
+
return (h(Host, { key: '5097cfa89ded56bcfb98dc24ca0b1e42c389e4ae' }, h("slot", { key: 'bba803efc4b82b0612e270665d5f80b740a786f1' })));
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
SkipLink.style = skipLinkCss;
|
|
@@ -15,8 +15,8 @@ const StepperItem = class {
|
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
17
|
const number = this.number || this.stepNumber;
|
|
18
|
-
return (h(Host, { key: '
|
|
19
|
-
h("div", { key: '
|
|
18
|
+
return (h(Host, { key: '3613c92e8ac7583bf5e3db7e90edca9a921fa475' }, h("div", { key: 'ca2c38443d9a855baea829e99ec9c642c279a3be', class: "r-stepper-item" }, h("div", { key: '513f01a9a3ac3a87c3622b14f051765121308241', class: "r-stepper-item--indicator" }, this.complete ? (h("r-icon", { name: "check", size: "s" })) : this.icon ? (h("r-icon", { name: this.icon, size: "s" })) : number !== undefined ? (h("span", { class: "r-stepper-item--indicator--step-number" }, number)) : null), this.hasText &&
|
|
19
|
+
h("div", { key: 'cec8659e5ff31608b05c6f62798a8a1048cd7539', class: "r-stepper-item--text" }, h("slot", { key: '6a9d581948decc8a15e66401275cb85bf52bb459' })))));
|
|
20
20
|
}
|
|
21
21
|
get host() { return getElement(this); }
|
|
22
22
|
};
|
|
@@ -15,7 +15,7 @@ const Stepper = class {
|
|
|
15
15
|
}
|
|
16
16
|
render() {
|
|
17
17
|
const completed = this.completed || this.completeSteps;
|
|
18
|
-
return (h(Host, { key: '
|
|
18
|
+
return (h(Host, { key: '196ddb8922499f7222418d19cd6ddc994c211119' }, h("div", { key: '2220fcb8ec2125a15db198ec7948780d8d331e50', class: "r-stepper" }, !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: '69c7eb87d53b67b19efc6da0ab489debc7e6b06c' }))));
|
|
19
19
|
}
|
|
20
20
|
get host() { return getElement(this); }
|
|
21
21
|
};
|
|
@@ -16,7 +16,7 @@ const RTabPanel = class {
|
|
|
16
16
|
active,
|
|
17
17
|
'aria-labelledby': tabId
|
|
18
18
|
};
|
|
19
|
-
return (h(Host, Object.assign({ key: '
|
|
19
|
+
return (h(Host, Object.assign({ key: 'de50044bd0be5598615c2f84e66f5a552edb4ab9', class: "r-typography" }, hostAttrs), h("div", { key: 'e4db4fd5b115c96474f31d9d16881f496b8f4fd2', class: "r-tab-panel" }, h("slot", { key: 'd2ad80745f97933fb173f6ecd3635829d3c890ac' }))));
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
22
|
RTabPanel.style = tabPanelCss;
|
package/dist/esm/r-tab.entry.js
CHANGED
|
@@ -47,7 +47,7 @@ const RTab = class {
|
|
|
47
47
|
'aria-selected': `${active}`,
|
|
48
48
|
'aria-disabled': `${disabled}`
|
|
49
49
|
};
|
|
50
|
-
return (h(Host, Object.assign({ key: '
|
|
50
|
+
return (h(Host, Object.assign({ key: '04af619a56c41414b02e942d9d5bba11ef5eb1a0', onClick: this.handleClick, onKeyUp: this.handleKeyup, onKeyDown: this.handleKeydown }, hostAttrs), h("span", { key: 'e3fcc9b084de339aafcf98d8c5ca06f0e9615916', class: "r-tab" }, h("span", { key: 'bb52bf58758c2404a61b595706ecb3e3f71942ee', class: "r-tab--slot" }, h("slot", { key: '939a0e9618875e4909dbb763290f5f439122e312' })))));
|
|
51
51
|
}
|
|
52
52
|
get host() { return getElement(this); }
|
|
53
53
|
};
|
|
@@ -7,7 +7,7 @@ const RTabsList = class {
|
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: '98a63f5b2df8649a90efc639cf745537eb903446', role: "tablist" }, h("div", { key: 'f1f0ce63461fed127e2e0789e941404545265b51', class: "r-tabs-list" }, h("slot", { key: 'e8302171cd66fba6332ed3301be7370dff43e69d' }))));
|
|
11
11
|
}
|
|
12
12
|
};
|
|
13
13
|
RTabsList.style = tabsListCss;
|
package/dist/esm/r-tabs.entry.js
CHANGED
|
@@ -238,7 +238,7 @@ const RTabs = class {
|
|
|
238
238
|
this._changeFocusTab(e.target, e.detail.keycode);
|
|
239
239
|
}
|
|
240
240
|
render() {
|
|
241
|
-
return (h(Host, { key: '
|
|
241
|
+
return (h(Host, { key: '4c86b16a8af456854579e7141ff2b3d2b60627e5', class: "r-tabs" }, h("slot", { key: '589b8ae9f3f51df095ed28b896714e1407fd9d87' })));
|
|
242
242
|
}
|
|
243
243
|
get host() { return getElement(this); }
|
|
244
244
|
};
|
|
@@ -21,11 +21,6 @@ const RTextarea = class {
|
|
|
21
21
|
this.resize = 'none';
|
|
22
22
|
/** Custom message when the character limit is reached to alert screen reader users. */
|
|
23
23
|
this.characterLimitReachedMessage = "You've reached the character limit.";
|
|
24
|
-
/**
|
|
25
|
-
* _DEPRECATED_ (This property will be removed in November 2025 release.)
|
|
26
|
-
* Controls the visibility of validation indicators for the field.
|
|
27
|
-
* */
|
|
28
|
-
this.showValid = false;
|
|
29
24
|
/** Custom validity state */
|
|
30
25
|
this.validityState = null;
|
|
31
26
|
/** Custom validity message */
|
|
@@ -80,16 +75,19 @@ const RTextarea = class {
|
|
|
80
75
|
this.rReset.emit({ element: host, value });
|
|
81
76
|
};
|
|
82
77
|
this.getValidityStateData = (element) => {
|
|
78
|
+
let validityState = '';
|
|
79
|
+
let validityMessage = '';
|
|
83
80
|
for (const state in element.validity) {
|
|
84
81
|
if (element.validity[state]) {
|
|
85
|
-
|
|
82
|
+
validityState = state;
|
|
86
83
|
if (this[state + 'Message']) {
|
|
87
|
-
|
|
88
|
-
return;
|
|
84
|
+
validityMessage = this[state + 'Message'];
|
|
85
|
+
return { validityState, validityMessage };
|
|
89
86
|
}
|
|
90
|
-
|
|
87
|
+
validityMessage = element.validationMessage;
|
|
91
88
|
}
|
|
92
89
|
}
|
|
90
|
+
return { validityState, validityMessage };
|
|
93
91
|
};
|
|
94
92
|
this.validateFormElement = (element = null) => {
|
|
95
93
|
if (element === null)
|
|
@@ -98,7 +96,9 @@ const RTextarea = class {
|
|
|
98
96
|
return;
|
|
99
97
|
if (this.error)
|
|
100
98
|
return;
|
|
101
|
-
this.getValidityStateData(element);
|
|
99
|
+
const { validityState, validityMessage } = this.getValidityStateData(element);
|
|
100
|
+
this.validityState = validityState;
|
|
101
|
+
this.validityMessage = validityMessage;
|
|
102
102
|
const isValid = this.validityState === 'valid';
|
|
103
103
|
this.valid = isValid;
|
|
104
104
|
this.invalid = !isValid;
|
|
@@ -152,6 +152,14 @@ const RTextarea = class {
|
|
|
152
152
|
this.customErrorMessage = message;
|
|
153
153
|
this.validateFormElement(this.nativeElement);
|
|
154
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Validates the textarea without triggering UI and returns a boolean indicating its validity.
|
|
157
|
+
* @returns A boolean indicating whether the textarea is valid.
|
|
158
|
+
*/
|
|
159
|
+
async checkValidity() {
|
|
160
|
+
const { validityState } = this.getValidityStateData(this.nativeElement);
|
|
161
|
+
return validityState === 'valid';
|
|
162
|
+
}
|
|
155
163
|
/** Validates an element and displays validity state. */
|
|
156
164
|
async reportValidity() {
|
|
157
165
|
this.validateFormElement(this.nativeElement);
|
|
@@ -175,11 +183,8 @@ const RTextarea = class {
|
|
|
175
183
|
const hasMessage = !!(this.customErrorMessage || this.validityMessage);
|
|
176
184
|
return isInvalid && hasMessage;
|
|
177
185
|
}
|
|
178
|
-
get hasValidationSuccess() {
|
|
179
|
-
return this.valid && this.validMessage && this.showValid;
|
|
180
|
-
}
|
|
181
186
|
get hasMessage() {
|
|
182
|
-
return this.hasError || this.hasValidationError
|
|
187
|
+
return this.hasError || this.hasValidationError;
|
|
183
188
|
}
|
|
184
189
|
/**
|
|
185
190
|
* Determine whether this element should be ignored
|
|
@@ -220,7 +225,7 @@ const RTextarea = class {
|
|
|
220
225
|
this.disconnectFormEventListeners();
|
|
221
226
|
}
|
|
222
227
|
render() {
|
|
223
|
-
const { name, rows, cols, placeholder, required, showCounter, maxlength, minlength, form, value, disabled, resize, hint, invalid, label, uniqueId, fieldIndicator,
|
|
228
|
+
const { name, rows, cols, placeholder, required, showCounter, maxlength, minlength, form, value, disabled, resize, hint, invalid, label, uniqueId, fieldIndicator, readonly } = this;
|
|
224
229
|
const textareaAttrs = {
|
|
225
230
|
name,
|
|
226
231
|
rows,
|
|
@@ -239,14 +244,10 @@ const RTextarea = class {
|
|
|
239
244
|
'aria-invalid': `${!!invalid}`,
|
|
240
245
|
'aria-required': `${!!required}`
|
|
241
246
|
};
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
tooltipIcon,
|
|
246
|
-
tooltipIconColor
|
|
247
|
+
const labelAttr = label ? {
|
|
248
|
+
label,
|
|
249
|
+
fieldIndicator
|
|
247
250
|
} : {};
|
|
248
|
-
const labelAttr = label ? Object.assign({ label,
|
|
249
|
-
fieldIndicator }, tooltipAttrs) : {};
|
|
250
251
|
// Filter out event listener properties based on naming convention.
|
|
251
252
|
// Pass them to native element.
|
|
252
253
|
const eventListeners = Object.entries(this).reduce((acc, [key, value]) => {
|
|
@@ -257,7 +258,7 @@ const RTextarea = class {
|
|
|
257
258
|
}, {});
|
|
258
259
|
return (h(Host, null, h("div", { class: "r-textarea--label-container" }, h("label", { htmlFor: uniqueId }, label &&
|
|
259
260
|
h("r-label", Object.assign({ id: `${uniqueId}-label` }, labelAttr), label)), h("slot", { name: "popover" })), hint &&
|
|
260
|
-
h("r-hint", { id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { class: "r-textarea--container", "data-disabled": `${!!disabled}`, "data-readonly": `${!!readonly}` }, h("textarea", Object.assign({ class: "r-textarea--input" }, textareaAttrs, eventListeners, { ref: el => this.nativeElement = el, onChange: this.onChange, onInput: this.onInput })), h("div", { class: "r-textarea--trailing" }, this.readonly && h("r-icon", { class: "r-textarea--readonly-icon", name: "pen-disabled", size: "s" }), this.hasTrailingSlot && h("slot", { name: "trailing" }))), h("div", { class: "r-textarea--messages" }, h("r-hint", { "aria-live": "polite", "aria-atomic": "true", id: `${uniqueId}-message`, class: !this.hasMessage && 'visually-hidden', variant: invalid ? 'error' : 'success' }, this.hasError && this.error, this.hasValidationError && (this.customErrorMessage || this.validityMessage)
|
|
261
|
+
h("r-hint", { id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { class: "r-textarea--container", "data-disabled": `${!!disabled}`, "data-readonly": `${!!readonly}` }, h("textarea", Object.assign({ class: "r-textarea--input" }, textareaAttrs, eventListeners, { ref: el => this.nativeElement = el, onChange: this.onChange, onInput: this.onInput })), h("div", { class: "r-textarea--trailing" }, this.readonly && h("r-icon", { class: "r-textarea--readonly-icon", name: "pen-disabled", size: "s" }), this.hasTrailingSlot && h("slot", { name: "trailing" }))), h("div", { class: "r-textarea--messages" }, h("r-hint", { "aria-live": "polite", "aria-atomic": "true", id: `${uniqueId}-message`, class: !this.hasMessage && 'visually-hidden', variant: invalid ? 'error' : 'success' }, this.hasError && this.error, this.hasValidationError && (this.customErrorMessage || this.validityMessage)), showCounter && h("r-hint", { "aria-hidden": true, class: "r-textarea--messages--counter" }, `${value.length}${maxlength ? '/' : ''}${maxlength}`), maxlength &&
|
|
261
262
|
h("div", { class: "visually-hidden", ref: el => this.characterLimitReachedAlert = el, "aria-live": "assertive" }))));
|
|
262
263
|
}
|
|
263
264
|
get host() { return getElement(this); }
|
|
@@ -26,7 +26,7 @@ const ToastGroup = class {
|
|
|
26
26
|
this.observeSlotContentChange();
|
|
27
27
|
}
|
|
28
28
|
render() {
|
|
29
|
-
return (h(Host, { key: '
|
|
29
|
+
return (h(Host, { key: 'bbb13408cb02b62fe5f6ab1c09548509bfb3a195' }, h("div", { key: 'd82f7deff5b66aa8f9e19d29a5b34fc4b984c94d', class: "r-toast-group" }, h("slot", { key: '02a49bceae7197f72d5b80ba7d71374345d0f0c7' }))));
|
|
30
30
|
}
|
|
31
31
|
get host() { return getElement(this); }
|
|
32
32
|
};
|