@riverty/web-components 5.3.0 → 5.5.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 +47 -1
- package/custom-elements.json +40 -4
- package/dist/cjs/{index-BnETQtSf.js → index-DJ4H_bFj.js} +382 -5
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/r-accordion-item.cjs.entry.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 +1 -1
- package/dist/cjs/r-accordion.cjs.entry.js +1 -1
- package/dist/cjs/r-alert.cjs.entry.js +1 -1
- package/dist/cjs/r-badge.cjs.entry.js +2 -2
- package/dist/cjs/r-button.cjs.entry.js +1 -1
- package/dist/cjs/r-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/r-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/r-design-system-devtools.cjs.entry.js +1 -1
- package/dist/cjs/r-dialog.cjs.entry.js +12 -15
- package/dist/cjs/r-hint_3.cjs.entry.js +5 -5
- package/dist/cjs/r-icon-button.cjs.entry.js +4 -4
- package/dist/cjs/r-icon.cjs.entry.js +1 -1
- package/dist/cjs/r-input-code.cjs.entry.js +24 -8
- package/dist/cjs/r-input-date.cjs.entry.js +29 -8
- package/dist/cjs/r-input-password.cjs.entry.js +16 -5
- package/dist/cjs/r-input-phone-number.cjs.entry.js +58 -20
- package/dist/cjs/r-input.cjs.entry.js +31 -8
- package/dist/cjs/r-list-item.cjs.entry.js +17 -14
- package/dist/cjs/r-pagination.cjs.entry.js +1 -1
- package/dist/cjs/r-panel.cjs.entry.js +3 -3
- package/dist/cjs/r-popover-action.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-content.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-headline.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-trigger.cjs.entry.js +2 -2
- package/dist/cjs/r-popover.cjs.entry.js +3 -3
- package/dist/cjs/r-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-description.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-leading.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-title.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-trailing.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button.cjs.entry.js +6 -6
- package/dist/cjs/r-radio-group.cjs.entry.js +7 -7
- package/dist/cjs/r-select-option.cjs.entry.js +2 -2
- package/dist/cjs/r-select.cjs.entry.js +6 -5
- package/dist/cjs/r-skip-link.cjs.entry.js +2 -2
- package/dist/cjs/r-stepper-item.cjs.entry.js +3 -3
- package/dist/cjs/r-stepper.cjs.entry.js +2 -2
- package/dist/cjs/r-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/r-tab.cjs.entry.js +2 -2
- package/dist/cjs/r-tabs-list.cjs.entry.js +2 -2
- package/dist/cjs/r-tabs.cjs.entry.js +4 -4
- package/dist/cjs/r-textarea.cjs.entry.js +18 -4
- package/dist/cjs/r-toast-group.cjs.entry.js +15 -5
- package/dist/cjs/r-toast.cjs.entry.js +16 -10
- package/dist/cjs/web-components.cjs.js +2 -2
- package/dist/collection/components/badge/badge.css +7 -7
- package/dist/collection/components/dialog/dialog.css +14 -14
- package/dist/collection/components/dialog/dialog.js +27 -13
- package/dist/collection/components/icon-button/icon-button.js +3 -3
- package/dist/collection/components/input/input.css +17 -2
- package/dist/collection/components/input/input.js +48 -6
- package/dist/collection/components/input-code/input-code.css +17 -2
- package/dist/collection/components/input-code/input-code.js +41 -6
- package/dist/collection/components/input-date/input-date.css +13 -2
- package/dist/collection/components/input-date/input-date.js +46 -6
- package/dist/collection/components/input-password/input-password.js +34 -4
- package/dist/collection/components/input-phone-number/input-phone-number.js +79 -18
- package/dist/collection/components/label/label.js +3 -3
- package/dist/collection/components/list-item/list-item/list-item.css +39 -32
- package/dist/collection/components/list-item/list-item/list-item.js +77 -14
- package/dist/collection/components/panel/panel.js +2 -2
- package/dist/collection/components/popover/popover.js +2 -2
- 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 +5 -5
- 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 +6 -6
- package/dist/collection/components/select/select.js +5 -4
- 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 +3 -3
- package/dist/collection/components/tabs-list/tabs-list.js +1 -1
- package/dist/collection/components/textarea/textarea.css +52 -21
- package/dist/collection/components/textarea/textarea.js +36 -3
- package/dist/collection/components/toast/toast.css +10 -3
- package/dist/collection/components/toast/toast.js +19 -10
- package/dist/collection/components/toast-group/toast-group.css +14 -13
- package/dist/collection/components/toast-group/toast-group.js +14 -4
- package/dist/collection/components/tooltip/tooltip.js +1 -1
- package/dist/esm/{index-CTxpqopm.js → index-Da7qOBFr.js} +382 -5
- package/dist/esm/loader.js +3 -3
- package/dist/esm/r-accordion-item.entry.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 +1 -1
- package/dist/esm/r-accordion.entry.js +1 -1
- package/dist/esm/r-alert.entry.js +1 -1
- package/dist/esm/r-badge.entry.js +2 -2
- package/dist/esm/r-button.entry.js +1 -1
- package/dist/esm/r-checkbox-group.entry.js +1 -1
- package/dist/esm/r-checkbox.entry.js +1 -1
- package/dist/esm/r-design-system-devtools.entry.js +1 -1
- package/dist/esm/r-dialog.entry.js +12 -15
- package/dist/esm/r-hint_3.entry.js +5 -5
- package/dist/esm/r-icon-button.entry.js +4 -4
- package/dist/esm/r-icon.entry.js +1 -1
- package/dist/esm/r-input-code.entry.js +24 -8
- package/dist/esm/r-input-date.entry.js +29 -8
- package/dist/esm/r-input-password.entry.js +16 -5
- package/dist/esm/r-input-phone-number.entry.js +58 -20
- package/dist/esm/r-input.entry.js +31 -8
- package/dist/esm/r-list-item.entry.js +17 -14
- package/dist/esm/r-pagination.entry.js +1 -1
- package/dist/esm/r-panel.entry.js +3 -3
- package/dist/esm/r-popover-action.entry.js +2 -2
- package/dist/esm/r-popover-content.entry.js +2 -2
- package/dist/esm/r-popover-headline.entry.js +2 -2
- package/dist/esm/r-popover-trigger.entry.js +2 -2
- package/dist/esm/r-popover.entry.js +3 -3
- package/dist/esm/r-progress-bar.entry.js +2 -2
- package/dist/esm/r-radio-button-description.entry.js +2 -2
- package/dist/esm/r-radio-button-leading.entry.js +2 -2
- package/dist/esm/r-radio-button-title.entry.js +2 -2
- package/dist/esm/r-radio-button-trailing.entry.js +2 -2
- package/dist/esm/r-radio-button.entry.js +6 -6
- package/dist/esm/r-radio-group.entry.js +7 -7
- package/dist/esm/r-select-option.entry.js +2 -2
- package/dist/esm/r-select.entry.js +6 -5
- package/dist/esm/r-skip-link.entry.js +2 -2
- package/dist/esm/r-stepper-item.entry.js +3 -3
- package/dist/esm/r-stepper.entry.js +2 -2
- package/dist/esm/r-tab-panel.entry.js +2 -2
- package/dist/esm/r-tab.entry.js +2 -2
- package/dist/esm/r-tabs-list.entry.js +2 -2
- package/dist/esm/r-tabs.entry.js +4 -4
- package/dist/esm/r-textarea.entry.js +18 -4
- package/dist/esm/r-toast-group.entry.js +15 -5
- package/dist/esm/r-toast.entry.js +16 -10
- package/dist/esm/web-components.js +3 -3
- package/dist/types/components/dialog/dialog.d.ts +7 -1
- package/dist/types/components/input/input.d.ts +7 -0
- package/dist/types/components/input-code/input-code.d.ts +6 -0
- package/dist/types/components/input-date/input-date.d.ts +6 -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 +7 -0
- package/dist/types/components/list-item/list-item/list-item.d.ts +16 -3
- package/dist/types/components/textarea/textarea.d.ts +8 -1
- package/dist/types/components/toast/toast.d.ts +6 -0
- package/dist/types/components/toast-group/toast-group.d.ts +2 -0
- package/dist/types/components.d.ts +101 -8
- package/dist/web-components/p-00ca474f.entry.js +1 -0
- package/dist/web-components/p-00eb6986.entry.js +1 -0
- package/dist/web-components/{p-a45fd808.entry.js → p-0735fd75.entry.js} +1 -1
- package/dist/web-components/{p-7545038f.entry.js → p-0bb04d79.entry.js} +1 -1
- package/dist/web-components/{p-ef0f43e0.entry.js → p-0f4eea22.entry.js} +1 -1
- package/dist/web-components/{p-4cf01f30.entry.js → p-1c2497de.entry.js} +1 -1
- package/dist/web-components/p-2265dae1.entry.js +1 -0
- package/dist/web-components/{p-03ff9abf.entry.js → p-230e44ae.entry.js} +1 -1
- package/dist/web-components/{p-4dae8c19.entry.js → p-24bbf3b6.entry.js} +1 -1
- package/dist/web-components/p-28718c50.entry.js +1 -0
- package/dist/web-components/{p-59aa588e.entry.js → p-2b2f581a.entry.js} +1 -1
- package/dist/web-components/p-3b4e3faf.entry.js +1 -0
- package/dist/web-components/p-3bc93d65.entry.js +1 -0
- package/dist/web-components/{p-8968ddf6.entry.js → p-429213ea.entry.js} +1 -1
- package/dist/web-components/{p-c60294d4.entry.js → p-43eff76a.entry.js} +1 -1
- package/dist/web-components/{p-87bb4b91.entry.js → p-44ae9f33.entry.js} +1 -1
- package/dist/web-components/{p-806b173d.entry.js → p-4652635a.entry.js} +1 -1
- package/dist/web-components/{p-832dca22.entry.js → p-4bd3e077.entry.js} +1 -1
- package/dist/web-components/{p-512d3a60.entry.js → p-4e3df002.entry.js} +1 -1
- package/dist/web-components/p-51a5804b.entry.js +1 -0
- package/dist/web-components/{p-a81a67da.entry.js → p-72fa1fd1.entry.js} +1 -1
- package/dist/web-components/{p-5bc9fe5e.entry.js → p-755cc697.entry.js} +1 -1
- package/dist/web-components/{p-e74c363a.entry.js → p-77155630.entry.js} +1 -1
- package/dist/web-components/{p-77335ae7.entry.js → p-7fccc301.entry.js} +1 -1
- package/dist/web-components/{p-651522b6.entry.js → p-85a9af42.entry.js} +1 -1
- package/dist/web-components/{p-24130cdb.entry.js → p-87f39749.entry.js} +1 -1
- package/dist/web-components/{p-c9b2389b.entry.js → p-89136369.entry.js} +1 -1
- package/dist/web-components/p-8c577cda.entry.js +1 -0
- package/dist/web-components/{p-6b7d5236.entry.js → p-99ba15d9.entry.js} +1 -1
- package/dist/web-components/{p-d35303a6.entry.js → p-9eb1f262.entry.js} +1 -1
- package/dist/web-components/p-Da7qOBFr.js +2 -0
- package/dist/web-components/p-a022f356.entry.js +1 -0
- package/dist/web-components/p-a58124c4.entry.js +1 -0
- package/dist/web-components/{p-8d2f4097.entry.js → p-a683612d.entry.js} +1 -1
- package/dist/web-components/{p-9891afb8.entry.js → p-a7e7f8fa.entry.js} +1 -1
- package/dist/web-components/p-ad4292d8.entry.js +1 -0
- package/dist/web-components/p-c09a863b.entry.js +1 -0
- package/dist/web-components/{p-26e4816a.entry.js → p-c7f8e59b.entry.js} +1 -1
- package/dist/web-components/{p-f625b739.entry.js → p-c937bd92.entry.js} +1 -1
- package/dist/web-components/p-cbcd7699.entry.js +1 -0
- package/dist/web-components/p-e0e2f2b2.entry.js +1 -0
- package/dist/web-components/{p-0930ee1d.entry.js → p-e49b1ec3.entry.js} +1 -1
- package/dist/web-components/p-e4b66277.entry.js +1 -0
- package/dist/web-components/p-e6a31881.entry.js +1 -0
- package/dist/web-components/p-f1e22caa.entry.js +1 -0
- package/dist/web-components/{p-5dd43433.entry.js → p-f22696e0.entry.js} +1 -1
- package/dist/web-components/p-f6a92287.entry.js +1 -0
- package/dist/web-components/p-f7adb875.entry.js +1 -0
- package/dist/web-components/web-components.esm.js +1 -1
- package/package.json +1 -1
- package/dist/web-components/p-0bd10e93.entry.js +0 -1
- package/dist/web-components/p-15d10c68.entry.js +0 -1
- package/dist/web-components/p-1cfa9a0e.entry.js +0 -1
- package/dist/web-components/p-23ff25a1.entry.js +0 -1
- package/dist/web-components/p-50f01d6b.entry.js +0 -1
- package/dist/web-components/p-547fc56c.entry.js +0 -1
- package/dist/web-components/p-5cd1ad6a.entry.js +0 -1
- package/dist/web-components/p-73adec9b.entry.js +0 -1
- package/dist/web-components/p-8388221b.entry.js +0 -1
- package/dist/web-components/p-8cc4be0c.entry.js +0 -1
- package/dist/web-components/p-90d390f4.entry.js +0 -1
- package/dist/web-components/p-98628a15.entry.js +0 -1
- package/dist/web-components/p-9f583ed1.entry.js +0 -1
- package/dist/web-components/p-CTxpqopm.js +0 -2
- package/dist/web-components/p-aff51d37.entry.js +0 -1
- package/dist/web-components/p-b07be088.entry.js +0 -1
- package/dist/web-components/p-b5c8e978.entry.js +0 -1
- package/dist/web-components/p-d6ef5fff.entry.js +0 -1
- package/dist/web-components/p-dfd8bed6.entry.js +0 -1
- package/dist/web-components/p-e138c70a.entry.js +0 -1
|
@@ -21,6 +21,8 @@ export class InputCode {
|
|
|
21
21
|
this.inputs = [];
|
|
22
22
|
this.handleInput = (index, event) => {
|
|
23
23
|
var _a;
|
|
24
|
+
if (this.readonly)
|
|
25
|
+
return;
|
|
24
26
|
const input = event.target;
|
|
25
27
|
const value = input.value.slice(-1);
|
|
26
28
|
this.values[index] = value;
|
|
@@ -32,6 +34,8 @@ export class InputCode {
|
|
|
32
34
|
};
|
|
33
35
|
this.handleKeyDown = (index, event) => {
|
|
34
36
|
var _a, _b, _c;
|
|
37
|
+
if (this.readonly)
|
|
38
|
+
return;
|
|
35
39
|
const key = event.key;
|
|
36
40
|
if (key === 'Backspace') {
|
|
37
41
|
if (!this.values[index] && index > 0) {
|
|
@@ -71,6 +75,8 @@ export class InputCode {
|
|
|
71
75
|
};
|
|
72
76
|
this.handlePaste = async (event) => {
|
|
73
77
|
var _a;
|
|
78
|
+
if (this.readonly)
|
|
79
|
+
return;
|
|
74
80
|
event.preventDefault();
|
|
75
81
|
const pasted = event.clipboardData.getData('text').slice(0, this.length);
|
|
76
82
|
this.values = pasted.split('').concat(new Array(this.length).fill('')).slice(0, this.length);
|
|
@@ -119,6 +125,8 @@ export class InputCode {
|
|
|
119
125
|
});
|
|
120
126
|
};
|
|
121
127
|
this.onResetForm = async () => {
|
|
128
|
+
if (this.readonly)
|
|
129
|
+
return;
|
|
122
130
|
this.reset();
|
|
123
131
|
this.validityState = null;
|
|
124
132
|
this.validityMessage = null;
|
|
@@ -155,6 +163,8 @@ export class InputCode {
|
|
|
155
163
|
*/
|
|
156
164
|
async reset() {
|
|
157
165
|
var _a;
|
|
166
|
+
if (this.readonly)
|
|
167
|
+
return;
|
|
158
168
|
this.values = new Array(this.length).fill('');
|
|
159
169
|
(_a = this.inputs[0]) === null || _a === void 0 ? void 0 : _a.focus();
|
|
160
170
|
}
|
|
@@ -239,13 +249,17 @@ export class InputCode {
|
|
|
239
249
|
return `${uniqueId}-hint`;
|
|
240
250
|
return null;
|
|
241
251
|
}
|
|
252
|
+
get hasTrailingSlot() {
|
|
253
|
+
return !!this.host.querySelector('[slot="trailing"]');
|
|
254
|
+
}
|
|
242
255
|
componentWillLoad() {
|
|
243
256
|
this.setValue(this.value);
|
|
244
257
|
}
|
|
245
258
|
render() {
|
|
246
|
-
const { form, name, novalidate, required, disabled, label, fieldIndicator, hint, uniqueId, valid } = this;
|
|
259
|
+
const { form, name, novalidate, required, disabled, label, fieldIndicator, hint, uniqueId, valid, readonly } = this;
|
|
247
260
|
const inputAttrs = {
|
|
248
261
|
id: uniqueId,
|
|
262
|
+
readonly,
|
|
249
263
|
form,
|
|
250
264
|
name,
|
|
251
265
|
novalidate,
|
|
@@ -259,13 +273,15 @@ export class InputCode {
|
|
|
259
273
|
id: `${uniqueId}-label`,
|
|
260
274
|
fieldIndicator
|
|
261
275
|
} : {};
|
|
262
|
-
return (h(Host, { key: '
|
|
276
|
+
return (h(Host, { key: '7c77442f0a5b39e6baca0e0a19b07e5c28388267', value: this.value, onClick: this.onHostClick }, h("div", { key: 'e9d80a3cbb3f8afcbfce17da69bbe881112307c5', class: "r-input-code--label-container" }, h("label", { key: 'dfdc795d969466e71d82492dd142773fbad93f6b', htmlFor: uniqueId }, label ?
|
|
263
277
|
h("r-label", Object.assign({}, labelAttr), label)
|
|
264
278
|
:
|
|
265
|
-
h("slot", { name: "label" })), h("slot", { key: '
|
|
266
|
-
h("r-hint", { key: '
|
|
267
|
-
h("r-icon", { key: '
|
|
268
|
-
h("
|
|
279
|
+
h("slot", { name: "label" })), h("slot", { key: 'f68f02578abd8be8fceea4bdaf1af657f07f5327', name: "popover" })), hint &&
|
|
280
|
+
h("r-hint", { key: '784b4a072ee504c99873d8e7744c1c055cbdd52a', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: 'b9b458b9b18859132145848135118aacf6c43ab2', class: "r-input-code--container", role: "group", "aria-labelledby": `${uniqueId}-label`, "aria-describedby": this.groupDescribedby }, h("slot", { key: '34d0391987a526d9672ff457fbfd34c153099dbc', name: "leading" }), Array.from({ length: this.length }).map((_, i) => (h("input", { class: "r-input-code--input", key: i, id: `${uniqueId}-input-section-${i}`, "aria-label": `${this.ariaCharacterLabel || 'Character'}: ${i + 1}`, "aria-invalid": `${this.invalid || false}`, value: this.values[i], ref: el => this.inputs[i] = el, maxlength: 1, disabled: this.disabled, required: this.required, readonly: readonly, onInput: this.createInputHandler(i), onKeyDown: this.createKeyDownHandler(i), onPaste: this.handlePaste }))), h("input", Object.assign({ key: '029bcca9a6907090058ea65de36cc3aea106ad25', type: "hidden" }, inputAttrs, { value: this.values.join(''), ref: el => this.nativeElement = el })), h("div", { key: 'a91256c17340a75fe1e5a7942c9ede1089bd477c', class: "r-input-code--trailing" }, this.readonly &&
|
|
281
|
+
h("r-icon", { key: '28df1a0823e8b6c94a26fe8dac6838d663da26b7', class: "r-input-code--readonly-icon", name: "pen-disabled", size: "s" }), this.hasTrailingSlot &&
|
|
282
|
+
h("slot", { key: '13dee654a15b7104fbe66408ba6c0a8d4b839a2c', name: "trailing" }, valid &&
|
|
283
|
+
h("r-icon", { key: '85f0413d86b7366229fe07af87a7bdd5368f8a22', name: "circled-check", size: "s", color: "var(--r-status-success-regular)" })))), h("slot", { key: 'cf9e23001dec5216a2c35144b9282dee25d5fe50', name: "message" }, this.hasMessage &&
|
|
284
|
+
h("r-hint", { key: '0c642fbeef09ec9c5ce1e2a6272bb27160be05c0', "aria-live": "polite", id: `${uniqueId}-message`, variant: "error" }, this.message))));
|
|
269
285
|
}
|
|
270
286
|
static get is() { return "r-input-code"; }
|
|
271
287
|
static get encapsulation() { return "shadow"; }
|
|
@@ -397,6 +413,25 @@ export class InputCode {
|
|
|
397
413
|
"setter": false,
|
|
398
414
|
"reflect": false
|
|
399
415
|
},
|
|
416
|
+
"readonly": {
|
|
417
|
+
"type": "boolean",
|
|
418
|
+
"attribute": "readonly",
|
|
419
|
+
"mutable": false,
|
|
420
|
+
"complexType": {
|
|
421
|
+
"original": "boolean",
|
|
422
|
+
"resolved": "boolean",
|
|
423
|
+
"references": {}
|
|
424
|
+
},
|
|
425
|
+
"required": false,
|
|
426
|
+
"optional": true,
|
|
427
|
+
"docs": {
|
|
428
|
+
"tags": [],
|
|
429
|
+
"text": "Read-only mode (mirrors native `readonly`): value cannot be changed by the user,\nbut the field can still receive focus, be selected, and be submitted with a form."
|
|
430
|
+
},
|
|
431
|
+
"getter": false,
|
|
432
|
+
"setter": false,
|
|
433
|
+
"reflect": true
|
|
434
|
+
},
|
|
400
435
|
"label": {
|
|
401
436
|
"type": "string",
|
|
402
437
|
"attribute": "label",
|
|
@@ -8,11 +8,17 @@
|
|
|
8
8
|
display: contents;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
:host(
|
|
11
|
+
:host([readonly]:not([readonly=false])) {
|
|
12
|
+
--r-input-date--container--background-color: var(--r-background-soft, #f3f1f0);
|
|
13
|
+
--r-input-date--container--border-color: transparent transparent var(--r-border-soft, #686868) transparent;
|
|
14
|
+
--r-input-date--container--cursor: text;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
:host(:hover:not([disabled]:not([disabled=false])):not([readonly]:not([readonly=false]))) {
|
|
12
18
|
--r-input-date--container--background-color: var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04));
|
|
13
19
|
}
|
|
14
20
|
|
|
15
|
-
:host(:active:not([disabled]:not([disabled=false]))) {
|
|
21
|
+
:host(:active:not([disabled]:not([disabled=false])):not([readonly]:not([readonly=false]))) {
|
|
16
22
|
--r-input-date--container--background-color: var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12));
|
|
17
23
|
}
|
|
18
24
|
|
|
@@ -123,6 +129,11 @@
|
|
|
123
129
|
.r-input-date--trailing {
|
|
124
130
|
display: var(--r-input-date--trailing--display, flex);
|
|
125
131
|
margin-left: var(--r-input-date--trailing--margin-left, auto);
|
|
132
|
+
align-items: var(--r-input-date--trailing--align-items, center);
|
|
133
|
+
gap: var(--r-input-date--trailing--gap, 0.625rem);
|
|
134
|
+
}
|
|
135
|
+
.r-input-date--readonly-icon {
|
|
136
|
+
color: var(--r-input-date--readonly-icon--color, var(--r-icon-soft, #686868));
|
|
126
137
|
}
|
|
127
138
|
|
|
128
139
|
.visually-hidden {
|
|
@@ -82,6 +82,7 @@ export class InputDate {
|
|
|
82
82
|
inputmode: 'numeric',
|
|
83
83
|
disabled: this.disabled,
|
|
84
84
|
required: this.required,
|
|
85
|
+
readonly: this.readonly,
|
|
85
86
|
'aria-label': label(type),
|
|
86
87
|
'data-date-type': type
|
|
87
88
|
};
|
|
@@ -91,6 +92,8 @@ export class InputDate {
|
|
|
91
92
|
return ((_a = value.replace(/[^.\-/]/g, '')) === null || _a === void 0 ? void 0 : _a.charAt(0)) || '/';
|
|
92
93
|
};
|
|
93
94
|
this.updateValue = () => {
|
|
95
|
+
if (this.readonly)
|
|
96
|
+
return;
|
|
94
97
|
this.delimiter = this.getDelimiter(this.format);
|
|
95
98
|
this.value = this.value ? this.inputOrder.map((input) => this.getDateComponent(input)).join(this.delimiter) : '';
|
|
96
99
|
};
|
|
@@ -106,6 +109,8 @@ export class InputDate {
|
|
|
106
109
|
};
|
|
107
110
|
this.handleKeyDown = (index, event) => {
|
|
108
111
|
var _a, _b, _c, _d, _e, _f;
|
|
112
|
+
if (this.readonly)
|
|
113
|
+
return;
|
|
109
114
|
if (event.code === 'Enter') {
|
|
110
115
|
this.validateFormElement(this.nativeElement);
|
|
111
116
|
if (this.invalid && !this.isNoValidate)
|
|
@@ -154,6 +159,8 @@ export class InputDate {
|
|
|
154
159
|
}
|
|
155
160
|
};
|
|
156
161
|
this.handlePaste = (event) => {
|
|
162
|
+
if (this.readonly)
|
|
163
|
+
return;
|
|
157
164
|
this.value = event.clipboardData.getData('text');
|
|
158
165
|
event.preventDefault();
|
|
159
166
|
};
|
|
@@ -162,6 +169,8 @@ export class InputDate {
|
|
|
162
169
|
};
|
|
163
170
|
this.handleInput = (input, index, event) => {
|
|
164
171
|
var _a, _b, _c;
|
|
172
|
+
if (this.readonly)
|
|
173
|
+
return;
|
|
165
174
|
const value = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.replace(/[^0-9]/g, '');
|
|
166
175
|
event.target.value = value;
|
|
167
176
|
this.setDateComponent(input, value);
|
|
@@ -177,11 +186,14 @@ export class InputDate {
|
|
|
177
186
|
};
|
|
178
187
|
this.handleChange = (input, event) => {
|
|
179
188
|
var _a;
|
|
189
|
+
if (this.readonly)
|
|
190
|
+
return;
|
|
180
191
|
const value = (_a = event.target.value) === null || _a === void 0 ? void 0 : _a.replace(/[^0-9]/g, '');
|
|
181
192
|
event.target.value = value;
|
|
182
193
|
this.setDateComponent(input, value);
|
|
183
194
|
this.value = this.inputOrder.map((el) => this.getDateComponent(el)).join(this.delimiter);
|
|
184
195
|
this.rChange.emit({ element: this.host, value: this.value });
|
|
196
|
+
this.validateFormElement(this.nativeElement);
|
|
185
197
|
};
|
|
186
198
|
this.getValidityStateData = (element) => {
|
|
187
199
|
if (this.required && element.value.length === 0) {
|
|
@@ -212,6 +224,8 @@ export class InputDate {
|
|
|
212
224
|
});
|
|
213
225
|
};
|
|
214
226
|
this.onResetForm = async () => {
|
|
227
|
+
if (this.readonly)
|
|
228
|
+
return;
|
|
215
229
|
this.reset();
|
|
216
230
|
this.validityState = null;
|
|
217
231
|
this.validityMessage = null;
|
|
@@ -271,6 +285,8 @@ export class InputDate {
|
|
|
271
285
|
* @returns Promise that resolves when reset is complete
|
|
272
286
|
*/
|
|
273
287
|
async reset() {
|
|
288
|
+
if (this.readonly)
|
|
289
|
+
return;
|
|
274
290
|
this.validityState = null;
|
|
275
291
|
this.validityMessage = null;
|
|
276
292
|
this.value = this.initial['value'];
|
|
@@ -317,6 +333,9 @@ export class InputDate {
|
|
|
317
333
|
get firstEmptyInput() {
|
|
318
334
|
return this.inputs.find(input => !input.value) || null;
|
|
319
335
|
}
|
|
336
|
+
get hasTrailingSlot() {
|
|
337
|
+
return !!this.host.querySelector('[slot="trailing"]');
|
|
338
|
+
}
|
|
320
339
|
componentWillLoad() {
|
|
321
340
|
dayjs.extend(customParseFormat);
|
|
322
341
|
this.delimiter = this.getDelimiter(this.format);
|
|
@@ -344,7 +363,7 @@ export class InputDate {
|
|
|
344
363
|
this.disconnectFormEventListeners();
|
|
345
364
|
}
|
|
346
365
|
render() {
|
|
347
|
-
const { form, name, required, disabled, label, fieldIndicator, hint, tooltip, tooltipIcon, tooltipIconColor, uniqueId, invalid, valid } = this;
|
|
366
|
+
const { form, name, required, disabled, label, fieldIndicator, hint, tooltip, tooltipIcon, tooltipIconColor, uniqueId, invalid, valid, readonly } = this;
|
|
348
367
|
const groupAttrs = {
|
|
349
368
|
'aria-invalid': `${invalid || false}`,
|
|
350
369
|
'aria-describedby': this.ariaDescribedBy
|
|
@@ -355,6 +374,7 @@ export class InputDate {
|
|
|
355
374
|
name,
|
|
356
375
|
required,
|
|
357
376
|
disabled,
|
|
377
|
+
readonly,
|
|
358
378
|
'aria-describedby': this.ariaDescribedBy
|
|
359
379
|
};
|
|
360
380
|
// DEPRECATED: will be removed in November 2025 release.
|
|
@@ -367,13 +387,14 @@ export class InputDate {
|
|
|
367
387
|
id: `${uniqueId}-label`,
|
|
368
388
|
fieldIndicator
|
|
369
389
|
} : {};
|
|
370
|
-
return (h(Host, { key: '
|
|
390
|
+
return (h(Host, { key: '291b135444b1fa349daddde0f182d67688e739bb', onClick: this.onHostClick }, h("fieldset", Object.assign({ key: 'ba9bdebb80e24fff65d2b18902e97a3497c3f602', class: "r-input-date" }, groupAttrs), h("div", { key: '74ac02efb2741cc4de337133d68ad5eaf978b911', class: "r-input-date--legend-container" }, h("legend", { key: 'c3fc3b194b878e9acb717b6c70e05db55a9ad63a', class: "r-input-date--legend" }, h("label", { key: '5c7eee1fadb2c62d55b8a890eeec2c163d87d0b9', htmlFor: uniqueId }, label ?
|
|
371
391
|
h("r-label", Object.assign({}, labelAttr, tooltipAttrs), label)
|
|
372
392
|
:
|
|
373
|
-
h("slot", { name: "label" }))), h("slot", { key: '
|
|
374
|
-
h("r-hint", { key: '
|
|
375
|
-
h("span", { "aria-hidden": "true", class: "r-input-date--delimiter" }, this.delimiter)))), h("input", Object.assign({ key: '
|
|
376
|
-
h("r-icon", { key: '
|
|
393
|
+
h("slot", { name: "label" }))), h("slot", { key: '0f5d78659b43177ebabfe9d5201083ca09ec34c0', name: "popover" })), hint &&
|
|
394
|
+
h("r-hint", { key: 'cc46269c0a59a29ed5f4d454316d3736febd11d8', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: '407b00450575bea92bbd0ea1c8f2f7050cc5731b', class: "r-input-date--container" }, h("r-icon", { key: '192a807af7a17da42dbfc104b250008fb92f9201', name: "calendar", size: "s", class: "r-input-date--calendar-icon" }), h("div", { key: 'e97c5d40242fef7a0e7de74498415342e98a3914', class: "r-input-date--inputs" }, this.inputOrder.map((input, i) => (h(Fragment, null, h("input", Object.assign({ class: "r-input-date--input" }, this.getInputAttrs(input), { key: input, value: this.getDateComponent(input), onInput: this.createInputHandler(input, i), onChange: this.createChangeHandler(input), onClick: this.onInputClick, onKeyDown: this.createKeyDownHandler(i), onPaste: this.handlePaste })), i < this.inputOrder.length - 1 &&
|
|
395
|
+
h("span", { "aria-hidden": "true", class: "r-input-date--delimiter" }, this.delimiter)))), h("input", Object.assign({ key: 'e93adbded043a7e5cb621b3f12c25145f1110c7e', type: "hidden" }, dateInputAttrs, { value: this.value, ref: (el) => this.nativeElement = el }))), h("div", { key: '6046c334c88411bbeb36f96201e75c3af55302af', class: "r-input-date--trailing" }, this.readonly &&
|
|
396
|
+
h("r-icon", { key: '69d132c86d369d900d9d5e7f1b8b01bb5fa35203', class: "r-input-date--readonly-icon", name: "pen-disabled", size: "s" }), valid &&
|
|
397
|
+
h("r-icon", { key: '9a2ddfc73a8d9cc615abc035c5854158a3314ff3', name: "circled-check", size: "s", color: "var(--r-status-success-regular)" }), this.hasTrailingSlot && h("slot", { key: '6e7b97da07d9dd20da07cfd743c3e6e0d5e82308', name: "trailing" }))), h("div", { key: 'd0a3edff590af1893bafa7d51a41ba261f6c6215', id: `${uniqueId}-message`, "aria-live": "polite", class: "r-input-date--message" }, this.hasMessage && h("r-hint", { key: '077b7b9a115ca1c871498a8840fe4019e39deea3', variant: "error" }, this.message)))));
|
|
377
398
|
}
|
|
378
399
|
static get is() { return "r-input-date"; }
|
|
379
400
|
static get encapsulation() { return "shadow"; }
|
|
@@ -761,6 +782,25 @@ export class InputDate {
|
|
|
761
782
|
"setter": false,
|
|
762
783
|
"reflect": true
|
|
763
784
|
},
|
|
785
|
+
"readonly": {
|
|
786
|
+
"type": "boolean",
|
|
787
|
+
"attribute": "readonly",
|
|
788
|
+
"mutable": false,
|
|
789
|
+
"complexType": {
|
|
790
|
+
"original": "boolean",
|
|
791
|
+
"resolved": "boolean",
|
|
792
|
+
"references": {}
|
|
793
|
+
},
|
|
794
|
+
"required": false,
|
|
795
|
+
"optional": true,
|
|
796
|
+
"docs": {
|
|
797
|
+
"tags": [],
|
|
798
|
+
"text": "Makes the date inputs read-only: users can focus and copy the value,\nbut cannot modify it (value still submitted with the form unlike disabled)."
|
|
799
|
+
},
|
|
800
|
+
"getter": false,
|
|
801
|
+
"setter": false,
|
|
802
|
+
"reflect": true
|
|
803
|
+
},
|
|
764
804
|
"required": {
|
|
765
805
|
"type": "boolean",
|
|
766
806
|
"attribute": "required",
|
|
@@ -37,11 +37,15 @@ export class InputPassword {
|
|
|
37
37
|
}, 2000);
|
|
38
38
|
};
|
|
39
39
|
this.onInput = (event) => {
|
|
40
|
+
if (this.readonly)
|
|
41
|
+
return;
|
|
40
42
|
this.value = event.detail.value;
|
|
41
43
|
const { host, value } = this;
|
|
42
44
|
this.rInput.emit({ element: host, value });
|
|
43
45
|
};
|
|
44
46
|
this.onChange = (event) => {
|
|
47
|
+
if (this.readonly)
|
|
48
|
+
return;
|
|
45
49
|
this.value = event.detail.value;
|
|
46
50
|
const { host, value } = this;
|
|
47
51
|
this.rChange.emit({ element: host, value });
|
|
@@ -78,6 +82,8 @@ export class InputPassword {
|
|
|
78
82
|
appendControlToFormData(this.nativeElement || this.host, event.formData);
|
|
79
83
|
};
|
|
80
84
|
this.onResetForm = () => {
|
|
85
|
+
if (this.readonly)
|
|
86
|
+
return;
|
|
81
87
|
this.validityState = null;
|
|
82
88
|
this.validityMessage = null;
|
|
83
89
|
this.value = this.initial['value'];
|
|
@@ -97,6 +103,8 @@ export class InputPassword {
|
|
|
97
103
|
};
|
|
98
104
|
this.handleKeyup = async (event) => {
|
|
99
105
|
var _a, _b;
|
|
106
|
+
if (this.readonly)
|
|
107
|
+
return;
|
|
100
108
|
if (event.code !== 'Enter')
|
|
101
109
|
return;
|
|
102
110
|
this.validateFormElement(this.nativeElement);
|
|
@@ -112,6 +120,8 @@ export class InputPassword {
|
|
|
112
120
|
}
|
|
113
121
|
};
|
|
114
122
|
this.handleBlur = () => {
|
|
123
|
+
if (this.readonly)
|
|
124
|
+
return;
|
|
115
125
|
this.validateFormElement(this.nativeElement);
|
|
116
126
|
};
|
|
117
127
|
}
|
|
@@ -191,7 +201,7 @@ export class InputPassword {
|
|
|
191
201
|
this.disconnectFormEventListeners();
|
|
192
202
|
}
|
|
193
203
|
render() {
|
|
194
|
-
const { name, placeholder, required, fieldIndicator, value, disabled, form, invalid, valid, hint, label, tooltip, tooltipIcon, tooltipIconColor, fullWidth, showPasswordAriaLabel, hidePasswordAriaLabel, showed } = this;
|
|
204
|
+
const { name, placeholder, required, fieldIndicator, value, disabled, form, invalid, valid, hint, label, tooltip, tooltipIcon, tooltipIconColor, fullWidth, showPasswordAriaLabel, hidePasswordAriaLabel, showed, readonly } = this;
|
|
195
205
|
const inputAttrs = {
|
|
196
206
|
name,
|
|
197
207
|
placeholder,
|
|
@@ -208,10 +218,11 @@ export class InputPassword {
|
|
|
208
218
|
tooltipIcon,
|
|
209
219
|
tooltipIconColor,
|
|
210
220
|
fullWidth,
|
|
211
|
-
novalidate: true
|
|
221
|
+
novalidate: true,
|
|
222
|
+
readonly
|
|
212
223
|
};
|
|
213
|
-
return (h(Host, { key: '
|
|
214
|
-
h("r-hint", { key: '
|
|
224
|
+
return (h(Host, { key: 'a572ffb573f9d4ff7732c372077d1488a86fd4be' }, h("r-input", Object.assign({ key: '9296fe93c32f82c850c571dfc588d599d4fedfeb' }, inputAttrs, { ref: (el) => this.nativeElement = el, type: showed ? 'text' : 'password', onRInput: this.onInput, onRChange: this.onChange, onKeyUp: this.handleKeyup, onRBlur: this.handleBlur }), h("r-icon", { key: '4ed51719c83a3b4e90fd86d95969b982f3372d16', name: "padlock-closed", size: "s", slot: "leading" }), h("slot", { key: 'c00d7cd2254773750a7a4627c7600550590f0e03', name: "popover", slot: "popover" }), h("r-icon-button", { key: '7bf8aabd7b00a2a36038d1f6162f11114dfa72fa', slot: "trailing", name: showed ? 'eye-crossed-out' : 'eye', size: "s", disabled: disabled, label: showed ? hidePasswordAriaLabel : showPasswordAriaLabel, onClick: this.onShowClick }), this.hasMessage &&
|
|
225
|
+
h("r-hint", { key: '654c4558871e740f13ae50351ff82e3befccc83d', slot: "message", variant: "error" }, this.hasError && this.error, this.hasValidationError && (this.customErrorMessage || this.validityMessage))), h("div", { key: 'e8b5e4a4a69ddf7074e88eb18c5e9ff725e3baa5', class: "visually-hidden", ref: el => this.passwordVisibilityChangeAlertContainer = el, "aria-live": "polite" })));
|
|
215
226
|
}
|
|
216
227
|
static get is() { return "r-input-password"; }
|
|
217
228
|
static get encapsulation() { return "shadow"; }
|
|
@@ -538,6 +549,25 @@ export class InputPassword {
|
|
|
538
549
|
"setter": false,
|
|
539
550
|
"reflect": true
|
|
540
551
|
},
|
|
552
|
+
"readonly": {
|
|
553
|
+
"type": "boolean",
|
|
554
|
+
"attribute": "readonly",
|
|
555
|
+
"mutable": false,
|
|
556
|
+
"complexType": {
|
|
557
|
+
"original": "boolean",
|
|
558
|
+
"resolved": "boolean",
|
|
559
|
+
"references": {}
|
|
560
|
+
},
|
|
561
|
+
"required": false,
|
|
562
|
+
"optional": true,
|
|
563
|
+
"docs": {
|
|
564
|
+
"tags": [],
|
|
565
|
+
"text": "Makes the input read-only: users can focus and copy the value,\nbut cannot modify it (value still submitted with the form unlike disabled)."
|
|
566
|
+
},
|
|
567
|
+
"getter": false,
|
|
568
|
+
"setter": false,
|
|
569
|
+
"reflect": true
|
|
570
|
+
},
|
|
541
571
|
"required": {
|
|
542
572
|
"type": "boolean",
|
|
543
573
|
"attribute": "required",
|
|
@@ -19,22 +19,31 @@ export class InputPhoneNumber {
|
|
|
19
19
|
* */
|
|
20
20
|
this.initial = {};
|
|
21
21
|
this.handleOnInput = (event) => {
|
|
22
|
+
if (this.readonly)
|
|
23
|
+
return;
|
|
22
24
|
this.phoneNumber = event.target.value;
|
|
23
25
|
this.fullPhoneNumber = this.phoneNumber ? this.countryCode + this.phoneNumber : '';
|
|
24
26
|
const { host, phoneNumber, countryCode, value } = this;
|
|
25
27
|
this.rInput.emit({ element: host, value, countryCode, phoneNumber });
|
|
28
|
+
this.validateFormElement(this.nativeElement);
|
|
26
29
|
};
|
|
27
30
|
this.handleInputOnChange = (event) => {
|
|
31
|
+
if (this.readonly)
|
|
32
|
+
return;
|
|
28
33
|
this.phoneNumber = event.target.value;
|
|
29
34
|
this.handleValueChange();
|
|
30
35
|
};
|
|
31
36
|
this.handleValueChange = () => {
|
|
37
|
+
if (this.readonly)
|
|
38
|
+
return;
|
|
32
39
|
this.fullPhoneNumber = this.phoneNumber ? this.countryCode + this.phoneNumber : '';
|
|
33
40
|
const { host, phoneNumber, countryCode, value } = this;
|
|
34
41
|
this.rChange.emit({ element: host, value, countryCode, phoneNumber });
|
|
35
42
|
this.validateFormElement(this.nativeElement);
|
|
36
43
|
};
|
|
37
44
|
this.validateFormElement = (element) => {
|
|
45
|
+
if (this.readonly)
|
|
46
|
+
return;
|
|
38
47
|
if (element === null)
|
|
39
48
|
return;
|
|
40
49
|
if (this.isNoValidate)
|
|
@@ -83,6 +92,8 @@ export class InputPhoneNumber {
|
|
|
83
92
|
};
|
|
84
93
|
this.onResetForm = () => {
|
|
85
94
|
var _a;
|
|
95
|
+
if (this.readonly)
|
|
96
|
+
return;
|
|
86
97
|
this.validityState = null;
|
|
87
98
|
this.validityMessage = null;
|
|
88
99
|
this.phoneNumber = '';
|
|
@@ -121,12 +132,24 @@ export class InputPhoneNumber {
|
|
|
121
132
|
this.validateFormElement(this.nativeElement);
|
|
122
133
|
}
|
|
123
134
|
handleDisabledChange() {
|
|
124
|
-
|
|
125
|
-
|
|
135
|
+
this.setCountryCodeElementAttributes({
|
|
136
|
+
'disabled': `${!!this.disabled}`
|
|
137
|
+
});
|
|
126
138
|
}
|
|
127
139
|
handleRequiredChange() {
|
|
128
|
-
|
|
129
|
-
|
|
140
|
+
this.setCountryCodeElementAttributes({
|
|
141
|
+
'required': `${!!this.required}`
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
handleReadonlyChange() {
|
|
145
|
+
this.setCountryCodeElementAttributes({
|
|
146
|
+
'readonly': `${!!this.readonly}`
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
handleLabelChange() {
|
|
150
|
+
this.setCountryCodeElementAttributes({
|
|
151
|
+
'label': this.countryCodeLabel
|
|
152
|
+
});
|
|
130
153
|
}
|
|
131
154
|
/** Identify wrapping form element */
|
|
132
155
|
get parentFormEl() {
|
|
@@ -182,15 +205,16 @@ export class InputPhoneNumber {
|
|
|
182
205
|
this.phoneNumber = value.replace(countryCode, '');
|
|
183
206
|
(_b = this.countryCodeElement) === null || _b === void 0 ? void 0 : _b.setValue(countryCode);
|
|
184
207
|
}
|
|
185
|
-
setCountryCodeElementAttributes() {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
208
|
+
setCountryCodeElementAttributes(attributes) {
|
|
209
|
+
Object.entries(attributes || {}).forEach(([key, val]) => {
|
|
210
|
+
var _a, _b;
|
|
211
|
+
if (val === false || val === null || val === undefined) {
|
|
212
|
+
(_a = this.countryCodeElement) === null || _a === void 0 ? void 0 : _a.removeAttribute(key);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
(_b = this.countryCodeElement) === null || _b === void 0 ? void 0 : _b.setAttribute(key, String(val));
|
|
216
|
+
}
|
|
217
|
+
});
|
|
194
218
|
}
|
|
195
219
|
getPhoneValidationResult(phoneNumber, countryCode = '') {
|
|
196
220
|
return phone(countryCode + phoneNumber, { validateMobilePrefix: false });
|
|
@@ -213,7 +237,19 @@ export class InputPhoneNumber {
|
|
|
213
237
|
this.initial['value'] = this.value;
|
|
214
238
|
this.initial['invalid'] = this.invalid;
|
|
215
239
|
this.updateValues(this.value);
|
|
216
|
-
|
|
240
|
+
const staticAttributes = {
|
|
241
|
+
'show-leading-icon': 'true',
|
|
242
|
+
'leading-icon': 'globe',
|
|
243
|
+
'placeholder': '+00',
|
|
244
|
+
'internal': 'true'
|
|
245
|
+
};
|
|
246
|
+
const dynamicAttributes = {
|
|
247
|
+
'disabled': `${!!this.disabled}`,
|
|
248
|
+
'required': `${!!this.required}`,
|
|
249
|
+
'readonly': `${!!this.readonly}`,
|
|
250
|
+
'label': this.countryCodeLabel
|
|
251
|
+
};
|
|
252
|
+
this.setCountryCodeElementAttributes(Object.assign(Object.assign({}, staticAttributes), dynamicAttributes));
|
|
217
253
|
}
|
|
218
254
|
componentDidLoad() {
|
|
219
255
|
this.connectEventListeners();
|
|
@@ -239,10 +275,10 @@ export class InputPhoneNumber {
|
|
|
239
275
|
disabled,
|
|
240
276
|
'aria-describedby': this.ariaDescribedBy
|
|
241
277
|
};
|
|
242
|
-
return (h(Host, { key: '
|
|
243
|
-
h("r-label", Object.assign({ key: '
|
|
244
|
-
h("r-hint", { key: '
|
|
245
|
-
h("r-icon", { key: '
|
|
278
|
+
return (h(Host, { key: '93e31af4d248db4fe90a84b897d96207dbf9b6e9' }, h("div", { key: 'fc909eb39efe18413838c9f051d7ad7d5aa461b3', class: "r-input-phone-number--label-container" }, h("label", { key: 'b849fc5188a03e52151006fd48338fe0a07dfd83', id: `${uniqueId}-label` }, label &&
|
|
279
|
+
h("r-label", Object.assign({ key: '6bab502ebce17055ef3e2862f9063bfd2d0d1291' }, labelAttr), label)), h("slot", { key: '014cbcd421f75299935cf430a8777ded1880134c', name: "popover" })), hint &&
|
|
280
|
+
h("r-hint", { key: '4f8e473e4c70ac62618f6d651dca1880aa755c3e', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: '7fa42ec6de7083cc8703f5bcbbfaabe283462d45', class: "r-input-phone-number", role: "group", "aria-labelledby": `${uniqueId}-label`, "aria-describedby": this.ariaDescribedBy }, h("slot", { key: '64b8a315acb0057e82d1c77dd3b35bc141378cc0' }), h("r-input", { key: '5fdaa9c0c5bb4913637b895f0979f377bac876bc', 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 &&
|
|
281
|
+
h("r-icon", { key: '6c25f0a2e473315279679c3e607691f8a3eca396', slot: "trailing", name: "circled-check", size: "s", color: "var(--r-status-success-regular)" }))), h("input", Object.assign({ key: '39cca18332d8e6473bef33db6e395a8aac36a954', type: "hidden" }, inputAttrs, { readonly: this.readonly, value: fullPhoneNumber, ref: el => this.nativeElement = el })), h("r-hint", { key: '8feb70b56f27287b06a3ba894a554d736d9e9b4b', "aria-live": "polite", "aria-atomic": "true", id: `${uniqueId}-message`, class: !this.hasMessage && 'visually-hidden', variant: "error" }, this.hasMessage ? (this.hasError ? this.error : this.validityMessage) : '')));
|
|
246
282
|
}
|
|
247
283
|
static get is() { return "r-input-phone-number"; }
|
|
248
284
|
static get encapsulation() { return "shadow"; }
|
|
@@ -514,6 +550,25 @@ export class InputPhoneNumber {
|
|
|
514
550
|
"setter": false,
|
|
515
551
|
"reflect": true
|
|
516
552
|
},
|
|
553
|
+
"readonly": {
|
|
554
|
+
"type": "boolean",
|
|
555
|
+
"attribute": "readonly",
|
|
556
|
+
"mutable": false,
|
|
557
|
+
"complexType": {
|
|
558
|
+
"original": "boolean",
|
|
559
|
+
"resolved": "boolean",
|
|
560
|
+
"references": {}
|
|
561
|
+
},
|
|
562
|
+
"required": false,
|
|
563
|
+
"optional": true,
|
|
564
|
+
"docs": {
|
|
565
|
+
"tags": [],
|
|
566
|
+
"text": "Makes the date inputs read-only: users can focus and copy the value,\nbut cannot modify it (value still submitted with the form unlike disabled)."
|
|
567
|
+
},
|
|
568
|
+
"getter": false,
|
|
569
|
+
"setter": false,
|
|
570
|
+
"reflect": true
|
|
571
|
+
},
|
|
517
572
|
"required": {
|
|
518
573
|
"type": "boolean",
|
|
519
574
|
"attribute": "required",
|
|
@@ -843,6 +898,12 @@ export class InputPhoneNumber {
|
|
|
843
898
|
}, {
|
|
844
899
|
"propName": "required",
|
|
845
900
|
"methodName": "handleRequiredChange"
|
|
901
|
+
}, {
|
|
902
|
+
"propName": "readonly",
|
|
903
|
+
"methodName": "handleReadonlyChange"
|
|
904
|
+
}, {
|
|
905
|
+
"propName": "label",
|
|
906
|
+
"methodName": "handleLabelChange"
|
|
846
907
|
}];
|
|
847
908
|
}
|
|
848
909
|
}
|
|
@@ -25,9 +25,9 @@ export class RLabel {
|
|
|
25
25
|
size: 's',
|
|
26
26
|
color: tooltipIconColor
|
|
27
27
|
};
|
|
28
|
-
return (h(Host, { key: '
|
|
29
|
-
h("span", { key: '
|
|
30
|
-
h("span", { key: '
|
|
28
|
+
return (h(Host, { key: '06097c8d9963d79b783b245a934832e3f8e7596b' }, h("div", { key: '2a3a8ddd22fddedb8e7a7472f81c05201ea26a77', class: "r-label" }, h("span", { key: '9d1814759bb2b3f8784a73aa75b215a19985f482', class: "r-label--slot" }, h("slot", { key: 'd472e83f02841c979bbfcc36c54068141de0d380' }), fieldIndicator &&
|
|
29
|
+
h("span", { key: 'f275ed855ebd8a684a35ce9b074b0e04471dcfe2', class: "r-label--marker" }, fieldIndicator)), tooltip &&
|
|
30
|
+
h("span", { key: 'aa336cbb979d0866e8f586c1596b9d9f38925023', class: "r-label--tooltip-icon" }, h("r-tooltip", Object.assign({ key: '245cd576fadb1b31ca2041a9b3d9b5a9a63e381d' }, tooltipAttrs), h("r-icon", Object.assign({ key: 'f83ce1d9d0ab51b3c5394866b01b1998559ddc68' }, tooltipIconAttrs)))))));
|
|
31
31
|
}
|
|
32
32
|
static get is() { return "r-label"; }
|
|
33
33
|
static get encapsulation() { return "shadow"; }
|