@riverty/web-components 5.7.0 → 5.8.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 +42 -0
- package/custom-elements.json +28 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/r-alert.cjs.entry.js +24 -8
- package/dist/cjs/r-button.cjs.entry.js +1 -1
- package/dist/cjs/r-checkbox-group.cjs.entry.js +27 -13
- package/dist/cjs/r-checkbox.cjs.entry.js +25 -10
- package/dist/cjs/r-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/r-icon.cjs.entry.js +1 -1
- package/dist/cjs/r-input-code.cjs.entry.js +29 -16
- package/dist/cjs/r-input-date.cjs.entry.js +85 -15
- package/dist/cjs/r-input-password.cjs.entry.js +20 -7
- package/dist/cjs/r-input-phone-number.cjs.entry.js +27 -14
- package/dist/cjs/r-input.cjs.entry.js +24 -11
- package/dist/cjs/r-pagination.cjs.entry.js +1 -1
- package/dist/cjs/r-popover-action.cjs.entry.js +1 -1
- package/dist/cjs/r-popover.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-group.cjs.entry.js +20 -16
- package/dist/cjs/r-select.cjs.entry.js +112 -18
- package/dist/cjs/r-textarea.cjs.entry.js +18 -5
- package/dist/cjs/r-toast.cjs.entry.js +50 -19
- package/dist/cjs/web-components.cjs.js +1 -1
- package/dist/collection/components/alert/alert.css +52 -12
- package/dist/collection/components/alert/alert.js +48 -11
- package/dist/collection/components/alert/exports.js +1 -1
- package/dist/collection/components/button/button.css +6 -7
- package/dist/collection/components/checkbox/checkbox.js +45 -10
- package/dist/collection/components/checkbox-group/checkbox-group.js +47 -13
- 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/input/input.js +44 -11
- package/dist/collection/components/input-code/input-code.js +49 -16
- package/dist/collection/components/input-date/input-date.js +235 -16
- package/dist/collection/components/input-password/input-password.js +40 -7
- package/dist/collection/components/input-phone-number/input-phone-number.js +47 -14
- package/dist/collection/components/pagination/pagination.css +23 -23
- package/dist/collection/components/popover/popover.css +11 -3
- package/dist/collection/components/popover-action/popover-action.css +3 -5
- package/dist/collection/components/radio-group/radio-group.js +21 -17
- package/dist/collection/components/select/select.js +193 -21
- package/dist/collection/components/textarea/textarea.js +38 -5
- package/dist/collection/components/toast/toast.css +22 -14
- package/dist/collection/components/toast/toast.js +94 -20
- package/dist/esm/loader.js +1 -1
- package/dist/esm/r-alert.entry.js +24 -8
- package/dist/esm/r-button.entry.js +1 -1
- package/dist/esm/r-checkbox-group.entry.js +27 -13
- package/dist/esm/r-checkbox.entry.js +25 -10
- package/dist/esm/r-icon-button.entry.js +1 -1
- package/dist/esm/r-icon.entry.js +1 -1
- package/dist/esm/r-input-code.entry.js +29 -16
- package/dist/esm/r-input-date.entry.js +85 -15
- package/dist/esm/r-input-password.entry.js +20 -7
- package/dist/esm/r-input-phone-number.entry.js +27 -14
- package/dist/esm/r-input.entry.js +24 -11
- package/dist/esm/r-pagination.entry.js +1 -1
- package/dist/esm/r-popover-action.entry.js +1 -1
- package/dist/esm/r-popover.entry.js +1 -1
- package/dist/esm/r-radio-group.entry.js +20 -16
- package/dist/esm/r-select.entry.js +112 -18
- package/dist/esm/r-textarea.entry.js +18 -5
- package/dist/esm/r-toast.entry.js +50 -19
- package/dist/esm/web-components.js +1 -1
- package/dist/types/components/alert/alert.d.ts +3 -0
- package/dist/types/components/alert/exports.d.ts +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +5 -0
- package/dist/types/components/checkbox-group/checkbox-group.d.ts +6 -0
- package/dist/types/components/input/input.d.ts +5 -0
- package/dist/types/components/input-code/input-code.d.ts +5 -0
- package/dist/types/components/input-date/input-date.d.ts +30 -0
- package/dist/types/components/input-password/input-password.d.ts +5 -0
- package/dist/types/components/input-phone-number/input-phone-number.d.ts +5 -0
- package/dist/types/components/radio-group/radio-group.d.ts +1 -2
- package/dist/types/components/select/select.d.ts +34 -2
- package/dist/types/components/textarea/textarea.d.ts +5 -0
- package/dist/types/components/toast/toast.d.ts +10 -2
- package/dist/types/components.d.ts +143 -8
- package/dist/web-components/bundled-icons/riverty-kit.json +1 -1
- package/dist/web-components/p-15ac0fdd.entry.js +1 -0
- package/dist/web-components/p-1c956370.entry.js +1 -0
- package/dist/web-components/p-2a512983.entry.js +1 -0
- package/dist/web-components/p-2e18e762.entry.js +1 -0
- package/dist/web-components/{p-72c0c0d8.entry.js → p-3078b2b8.entry.js} +1 -1
- package/dist/web-components/p-56da04d8.entry.js +1 -0
- package/dist/web-components/p-5744d75c.entry.js +1 -0
- package/dist/web-components/p-5bbd6e3c.entry.js +1 -0
- package/dist/web-components/p-5e6aabd8.entry.js +1 -0
- package/dist/web-components/p-656229de.entry.js +1 -0
- package/dist/web-components/p-6a4f3836.entry.js +1 -0
- package/dist/web-components/p-7775228c.entry.js +1 -0
- package/dist/web-components/p-8563a1ab.entry.js +1 -0
- package/dist/web-components/p-ad9b2a48.entry.js +1 -0
- package/dist/web-components/p-b87ad83b.entry.js +1 -0
- package/dist/web-components/{p-77155630.entry.js → p-b98ab649.entry.js} +1 -1
- package/dist/web-components/p-dbe579e8.entry.js +1 -0
- package/dist/web-components/p-f2577a3c.entry.js +1 -0
- package/dist/web-components/web-components.esm.js +1 -1
- package/package.json +1 -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-44be9992.entry.js +0 -1
- package/dist/web-components/p-4652635a.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-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-9eb1f262.entry.js +0 -1
- package/dist/web-components/p-c300c22f.entry.js +0 -1
- package/dist/web-components/p-d93c240d.entry.js +0 -1
- package/dist/web-components/p-f770e22b.entry.js +0 -1
- package/dist/web-components/p-f952161b.entry.js +0 -1
|
@@ -50,7 +50,9 @@ export class InputPhoneNumber {
|
|
|
50
50
|
return;
|
|
51
51
|
if (this.error)
|
|
52
52
|
return;
|
|
53
|
-
this.getValidityStateData();
|
|
53
|
+
const { validityState, validityMessage } = this.getValidityStateData();
|
|
54
|
+
this.validityState = validityState;
|
|
55
|
+
this.validityMessage = validityMessage;
|
|
54
56
|
const isValid = this.validityState === 'valid';
|
|
55
57
|
this.valid = isValid;
|
|
56
58
|
this.invalid = !isValid;
|
|
@@ -61,22 +63,25 @@ export class InputPhoneNumber {
|
|
|
61
63
|
};
|
|
62
64
|
this.getValidityStateData = () => {
|
|
63
65
|
var _a, _b;
|
|
66
|
+
let validityState = '';
|
|
67
|
+
let validityMessage = '';
|
|
64
68
|
if (!this.required && !((_a = this.phoneNumber) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
65
|
-
|
|
66
|
-
return;
|
|
69
|
+
validityState = 'valid';
|
|
70
|
+
return { validityState, validityMessage };
|
|
67
71
|
}
|
|
68
72
|
if (!((_b = this.phoneNumber) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return;
|
|
73
|
+
validityState = 'valueMissing';
|
|
74
|
+
validityMessage = this.valueMissingMessage;
|
|
75
|
+
return { validityState, validityMessage };
|
|
72
76
|
}
|
|
73
77
|
const isPhoneNumberValid = this.countryCode ? this.getPhoneValidationResult(this.phoneNumber, this.countryCode).isValid : false;
|
|
74
78
|
if (!isPhoneNumberValid) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return;
|
|
79
|
+
validityState = 'invalid';
|
|
80
|
+
validityMessage = this.customErrorMessage;
|
|
81
|
+
return { validityState, validityMessage };
|
|
78
82
|
}
|
|
79
|
-
|
|
83
|
+
validityState = 'valid';
|
|
84
|
+
return { validityState, validityMessage };
|
|
80
85
|
};
|
|
81
86
|
this.onSubmitForm = (event) => {
|
|
82
87
|
if (this.isNoValidate)
|
|
@@ -118,6 +123,14 @@ export class InputPhoneNumber {
|
|
|
118
123
|
this.customErrorMessage = message;
|
|
119
124
|
this.validateFormElement(this.nativeElement);
|
|
120
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Validates the input phone number without triggering UI and returns a boolean indicating its validity.
|
|
128
|
+
* @returns A boolean indicating whether the input phone number is valid.
|
|
129
|
+
*/
|
|
130
|
+
async checkValidity() {
|
|
131
|
+
const { validityState } = this.getValidityStateData();
|
|
132
|
+
return validityState === 'valid';
|
|
133
|
+
}
|
|
121
134
|
/** Check validity and reveal validation state. */
|
|
122
135
|
async reportValidity() {
|
|
123
136
|
this.validateFormElement(this.nativeElement);
|
|
@@ -275,10 +288,10 @@ export class InputPhoneNumber {
|
|
|
275
288
|
disabled,
|
|
276
289
|
'aria-describedby': this.ariaDescribedBy
|
|
277
290
|
};
|
|
278
|
-
return (h(Host, { key: '
|
|
279
|
-
h("r-label", Object.assign({ key: '
|
|
280
|
-
h("r-hint", { key: '
|
|
281
|
-
h("r-icon", { key: '
|
|
291
|
+
return (h(Host, { key: '4551070926e1974ddf3fcb8cc435570ddde50276' }, h("div", { key: 'a076fb01b4e0563ec2d30a5680a6ccd48b2f6895', class: "r-input-phone-number--label-container" }, h("label", { key: 'a8ad943efeca2ac3b5a63857ea0a52b19c32f09c', id: `${uniqueId}-label` }, label &&
|
|
292
|
+
h("r-label", Object.assign({ key: 'ac0d2a1c12cb85ec03e6596b9bb2e28328026eac' }, labelAttr), label)), h("slot", { key: 'cadd98a33c32bfb60be0a3448772eac483630bdf', name: "popover" })), hint &&
|
|
293
|
+
h("r-hint", { key: '23874cabee60dc0a5e620066eed92de809cac1eb', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: '800b3a389ce815c5e137077dd5766177c317a05d', class: "r-input-phone-number", role: "group", "aria-labelledby": `${uniqueId}-label`, "aria-describedby": this.ariaDescribedBy }, h("slot", { key: '6106007980212ef05cd11304da2a4d0cc28ddf4f' }), h("r-input", { key: 'd65b4d9ca8761c7e6dd08359ff02f3c88c57aa66', label: inputLabel, value: phoneNumber, internal: true, valid: valid, invalid: invalid, required: required, readonly: this.readonly, novalidate: true, fullWidth: fullWidth, type: "tel", error: this.errorMessage || '', onRInput: this.handleOnInput, onRChange: this.handleInputOnChange, disabled: disabled }, valid && phoneNumber &&
|
|
294
|
+
h("r-icon", { key: '09c721cb014d6d7ece724bcf7de9ec5928624dac', slot: "trailing", name: "circled-check", size: "s", color: "var(--r-status-success-regular)" }))), h("input", Object.assign({ key: 'e2eef2512f9125f0dd3d1b09120cbb77955350bd', type: "hidden" }, inputAttrs, { readonly: this.readonly, value: fullPhoneNumber, ref: el => this.nativeElement = el })), h("r-hint", { key: 'a12e9640bcf2df7b754de4e54b111e4ead2d023e', "aria-live": "polite", "aria-atomic": "true", id: `${uniqueId}-message`, class: !this.hasMessage && 'visually-hidden', variant: "error" }, this.hasMessage ? (this.hasError ? this.error : this.validityMessage) : '')));
|
|
282
295
|
}
|
|
283
296
|
static get is() { return "r-input-phone-number"; }
|
|
284
297
|
static get encapsulation() { return "shadow"; }
|
|
@@ -851,6 +864,26 @@ export class InputPhoneNumber {
|
|
|
851
864
|
"tags": []
|
|
852
865
|
}
|
|
853
866
|
},
|
|
867
|
+
"checkValidity": {
|
|
868
|
+
"complexType": {
|
|
869
|
+
"signature": "() => Promise<boolean>",
|
|
870
|
+
"parameters": [],
|
|
871
|
+
"references": {
|
|
872
|
+
"Promise": {
|
|
873
|
+
"location": "global",
|
|
874
|
+
"id": "global::Promise"
|
|
875
|
+
}
|
|
876
|
+
},
|
|
877
|
+
"return": "Promise<boolean>"
|
|
878
|
+
},
|
|
879
|
+
"docs": {
|
|
880
|
+
"text": "Validates the input phone number without triggering UI and returns a boolean indicating its validity.",
|
|
881
|
+
"tags": [{
|
|
882
|
+
"name": "returns",
|
|
883
|
+
"text": "A boolean indicating whether the input phone number is valid."
|
|
884
|
+
}]
|
|
885
|
+
}
|
|
886
|
+
},
|
|
854
887
|
"reportValidity": {
|
|
855
888
|
"complexType": {
|
|
856
889
|
"signature": "() => Promise<boolean>",
|
|
@@ -90,29 +90,6 @@
|
|
|
90
90
|
.r-pagination--header label {
|
|
91
91
|
font-size: var(--r-pagination--font-size);
|
|
92
92
|
}
|
|
93
|
-
.r-pagination--item {
|
|
94
|
-
--r-button--display: flex;
|
|
95
|
-
--r-button--width: var(--r-pagination--button--width);
|
|
96
|
-
--r-button--height: var(--r-pagination--button--height);
|
|
97
|
-
--r-button--color: var(--r-pagination--button--color);
|
|
98
|
-
--r-button--background-color: var(--r-pagination--button--background-color);
|
|
99
|
-
--r-button--border-width: var(--r-pagination--button--border-width);
|
|
100
|
-
--r-button--padding: var(--r-pagination--button--padding);
|
|
101
|
-
--r-button--icon--width: auto;
|
|
102
|
-
--r-button--icon--height: auto;
|
|
103
|
-
align-items: var(--r-pagination--item--align-items);
|
|
104
|
-
background-color: var(--r-pagination--item--background-color);
|
|
105
|
-
color: var(--r-pagination--item--color);
|
|
106
|
-
display: var(--r-pagination--item--display);
|
|
107
|
-
font-family: var(--r-pagination--item--font-family);
|
|
108
|
-
height: var(--r-pagination--item--height);
|
|
109
|
-
justify-content: var(--r-pagination--item--justify-content);
|
|
110
|
-
margin-left: var(--r-pagination--item--margin-left);
|
|
111
|
-
margin-right: var(--r-pagination--item--margin-right);
|
|
112
|
-
opacity: var(--r-pagination--item--opacity);
|
|
113
|
-
width: var(--r-pagination--item--width);
|
|
114
|
-
z-index: var(--r-pagination--item--z-index);
|
|
115
|
-
}
|
|
116
93
|
.r-pagination--item:hover {
|
|
117
94
|
--r-pagination--item--background-color: var(--r-background-interactive-hovered);
|
|
118
95
|
}
|
|
@@ -155,3 +132,26 @@
|
|
|
155
132
|
.r-pagination--item.number {
|
|
156
133
|
--r-button--font-size: 0.813rem;
|
|
157
134
|
}
|
|
135
|
+
.r-pagination--item {
|
|
136
|
+
--r-button--display: flex;
|
|
137
|
+
--r-button--width: var(--r-pagination--button--width);
|
|
138
|
+
--r-button--height: var(--r-pagination--button--height);
|
|
139
|
+
--r-button--color: var(--r-pagination--button--color);
|
|
140
|
+
--r-button--background-color: var(--r-pagination--button--background-color);
|
|
141
|
+
--r-button--border-width: var(--r-pagination--button--border-width);
|
|
142
|
+
--r-button--padding: var(--r-pagination--button--padding);
|
|
143
|
+
--r-button--icon--width: auto;
|
|
144
|
+
--r-button--icon--height: auto;
|
|
145
|
+
align-items: var(--r-pagination--item--align-items);
|
|
146
|
+
background-color: var(--r-pagination--item--background-color);
|
|
147
|
+
color: var(--r-pagination--item--color);
|
|
148
|
+
display: var(--r-pagination--item--display);
|
|
149
|
+
font-family: var(--r-pagination--item--font-family);
|
|
150
|
+
height: var(--r-pagination--item--height);
|
|
151
|
+
justify-content: var(--r-pagination--item--justify-content);
|
|
152
|
+
margin-left: var(--r-pagination--item--margin-left);
|
|
153
|
+
margin-right: var(--r-pagination--item--margin-right);
|
|
154
|
+
opacity: var(--r-pagination--item--opacity);
|
|
155
|
+
width: var(--r-pagination--item--width);
|
|
156
|
+
z-index: var(--r-pagination--item--z-index);
|
|
157
|
+
}
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
font-weight: var(--r-font-weight-regular, 400);
|
|
7
7
|
font-size: var(--r-font-size-400, 1rem);
|
|
8
8
|
text-align: left;
|
|
9
|
+
}
|
|
10
|
+
:host slot {
|
|
11
|
+
display: contents;
|
|
12
|
+
}
|
|
13
|
+
:host {
|
|
9
14
|
--board--shift: 1rem;
|
|
10
15
|
--board--min-width: 304px;
|
|
11
16
|
--board--max-width: 504px;
|
|
@@ -14,9 +19,6 @@
|
|
|
14
19
|
--pointer--height: 0.5rem;
|
|
15
20
|
--pointer--spacer: 0.25rem;
|
|
16
21
|
}
|
|
17
|
-
:host slot {
|
|
18
|
-
display: contents;
|
|
19
|
-
}
|
|
20
22
|
|
|
21
23
|
:host([size=s]) {
|
|
22
24
|
--r-popover--board--max-width: 375px;
|
|
@@ -187,6 +189,12 @@
|
|
|
187
189
|
right: var(--r-popover--dismiss--right, 20px);
|
|
188
190
|
color: var(--r-text-inverse);
|
|
189
191
|
}
|
|
192
|
+
.r-popover--dismiss:hover {
|
|
193
|
+
--r-icon-button--background-color: var(--r-background-interactive-hovered-inverse, rgba(243, 241, 240, 0.04));
|
|
194
|
+
}
|
|
195
|
+
.r-popover--dismiss:active {
|
|
196
|
+
--r-icon-button--background-color: var(--r-background-interactive-pressed-inverse, rgba(243, 241, 240, 0.12));
|
|
197
|
+
}
|
|
190
198
|
.r-popover--trigger {
|
|
191
199
|
border: var(--r-popover--trigger--border, none);
|
|
192
200
|
background: var(--r-popover--trigger--background, none);
|
|
@@ -4,20 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
::slotted(r-button) {
|
|
6
6
|
--r-button--color: var(--r-text-regular);
|
|
7
|
-
--r-button--border-
|
|
7
|
+
--r-button--border-width: 0;
|
|
8
8
|
--r-button--background-color: rgba(0,0,0,0);
|
|
9
9
|
--r-button--slot--position: relative;
|
|
10
10
|
--r-button--slot--text-decoration: underline;
|
|
11
|
-
--r-button--padding:
|
|
12
|
-
--r-button--slot--text-underline-offset:
|
|
11
|
+
--r-button--padding: 10px 2px 18px 2px;
|
|
12
|
+
--r-button--slot--text-underline-offset: 9px;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
::slotted(r-button:hover:not([disabled]):not([disabled=false])) {
|
|
16
|
-
--r-button--border-color: var(--r-border-soft);
|
|
17
16
|
--r-button--background-color: var(--r-background-interactive-hovered);
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
::slotted(r-button:active:not([disabled]):not([disabled=false])) {
|
|
21
20
|
--r-button--background-color: var(--r-background-interactive-pressed);
|
|
22
|
-
--r-button--border-color: var(--r-border-soft);
|
|
23
21
|
}
|
|
@@ -20,18 +20,21 @@ export class RadioGroup {
|
|
|
20
20
|
/** Unique id */
|
|
21
21
|
this.uniqueId = `r-radio-group-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
22
22
|
this.getValidityStateData = element => {
|
|
23
|
+
let validityState = '';
|
|
24
|
+
let validityMessage = '';
|
|
23
25
|
if (element === null)
|
|
24
|
-
return;
|
|
26
|
+
return { validityState, validityMessage };
|
|
25
27
|
for (const state in element.validity) {
|
|
26
28
|
if (element.validity[state]) {
|
|
27
|
-
|
|
29
|
+
validityState = state;
|
|
28
30
|
if (this[state + 'Message']) {
|
|
29
|
-
|
|
30
|
-
return;
|
|
31
|
+
validityMessage = this[state + 'Message'];
|
|
32
|
+
return { validityState, validityMessage };
|
|
31
33
|
}
|
|
32
|
-
|
|
34
|
+
validityMessage = element.validationMessage;
|
|
33
35
|
}
|
|
34
36
|
}
|
|
37
|
+
return { validityState, validityMessage };
|
|
35
38
|
};
|
|
36
39
|
this.validateFormElement = (element = null) => {
|
|
37
40
|
if (element === null)
|
|
@@ -40,7 +43,9 @@ export class RadioGroup {
|
|
|
40
43
|
return;
|
|
41
44
|
if (this.error)
|
|
42
45
|
return;
|
|
43
|
-
this.getValidityStateData(element);
|
|
46
|
+
const { validityState, validityMessage } = this.getValidityStateData(element);
|
|
47
|
+
this.validityState = validityState;
|
|
48
|
+
this.validityMessage = validityMessage;
|
|
44
49
|
const isValid = this.validityState === 'valid';
|
|
45
50
|
this.valid = isValid;
|
|
46
51
|
this.invalid = !isValid;
|
|
@@ -197,14 +202,13 @@ export class RadioGroup {
|
|
|
197
202
|
this.value = null;
|
|
198
203
|
}
|
|
199
204
|
/**
|
|
200
|
-
* Validates the radio group and returns a boolean indicating its validity.
|
|
201
|
-
*
|
|
205
|
+
* Validates the radio group without triggering UI and returns a boolean indicating its validity.
|
|
202
206
|
* @returns A boolean indicating whether the radio group is valid.
|
|
203
207
|
*/
|
|
204
208
|
async checkValidity() {
|
|
205
209
|
const element = this.nativeSelectedEl || this.nativeFirstEl || null;
|
|
206
|
-
this.getValidityStateData(element);
|
|
207
|
-
return
|
|
210
|
+
const { validityState } = this.getValidityStateData(element);
|
|
211
|
+
return validityState === 'valid';
|
|
208
212
|
}
|
|
209
213
|
/**
|
|
210
214
|
* Validates the radio group and displays the validity state.
|
|
@@ -329,12 +333,12 @@ export class RadioGroup {
|
|
|
329
333
|
'tooltip-icon': tooltipIcon,
|
|
330
334
|
'tooltip-icon-color': tooltipIconColor
|
|
331
335
|
};
|
|
332
|
-
return (h(Host, { key: '
|
|
333
|
-
h("div", { key: '
|
|
334
|
-
h("r-hint", { key: '
|
|
335
|
-
h("r-hint", { key: '
|
|
336
|
-
h("r-hint", { key: '
|
|
337
|
-
h("r-hint", { key: '
|
|
336
|
+
return (h(Host, { key: '5bf5f0493d2329b07d82e332153e467239ddff0f' }, h("div", { key: '06f96cb1868f7cbb635137ca68eda6a326b969c3', class: "r-radio-group", onClick: this.onLabelClick }, label &&
|
|
337
|
+
h("div", { key: '4dca24e0cb903a2e74e55ee743ed595608af0bf4', class: "r-radio-group--label-container" }, h("r-label", Object.assign({ key: 'cba1398032eae164db0a00808a06116affa671ec', id: `${uniqueId}-label`, class: "r-radio-group--label", "field-indicator": fieldIndicator }, labelAttr), label), h("slot", { key: 'c0180f3c6c99fed7d524719aff8eb8e64236cc3c', name: "popover" })), hint &&
|
|
338
|
+
h("r-hint", { key: '3ae1c84630975059aa1532b4b72957967e398949', id: `${uniqueId}-hint`, class: "r-radio-group--hint", role: "note" }, hint), h("div", { key: '2c18a09474189e6f2719db7c6ee5fb51c460e52f', class: "r-radio-group--content" }, h("slot", { key: '1c79f92cc0cd2095cfe51ee5fc108b6a004c4e4e' }))), invalid && error &&
|
|
339
|
+
h("r-hint", { key: '86aa0f4d1400e401cc7f71259511f118a3f68ef7', "aria-live": "polite", id: `${uniqueId}-message`, role: "alert", variant: "error" }, error), this.validityState !== 'valid' && this.validityMessage &&
|
|
340
|
+
h("r-hint", { key: 'aa06f829a6566becdf4a1f86e26e5161526756fb', "aria-live": "polite", id: `${uniqueId}-message`, role: "alert", variant: "error" }, this.customErrorMessage || this.validityMessage), this.valid && this.validMessage && this.showValid &&
|
|
341
|
+
h("r-hint", { key: '11500e705487028e4312679a6757dc48d861ebba', role: "alert", variant: "success" }, this.validMessage)));
|
|
338
342
|
}
|
|
339
343
|
static get is() { return "r-radio-group"; }
|
|
340
344
|
static get encapsulation() { return "shadow"; }
|
|
@@ -901,7 +905,7 @@ export class RadioGroup {
|
|
|
901
905
|
"return": "Promise<boolean>"
|
|
902
906
|
},
|
|
903
907
|
"docs": {
|
|
904
|
-
"text": "Validates the radio group and returns a boolean indicating its validity.",
|
|
908
|
+
"text": "Validates the radio group without triggering UI and returns a boolean indicating its validity.",
|
|
905
909
|
"tags": [{
|
|
906
910
|
"name": "returns",
|
|
907
911
|
"text": "A boolean indicating whether the radio group is valid."
|