@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.
Files changed (227) hide show
  1. package/CHANGELOG.md +47 -1
  2. package/custom-elements.json +40 -4
  3. package/dist/cjs/{index-BnETQtSf.js → index-DJ4H_bFj.js} +382 -5
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/r-accordion-item.cjs.entry.js +1 -1
  6. package/dist/cjs/r-accordion-panel.cjs.entry.js +1 -1
  7. package/dist/cjs/r-accordion-section.cjs.entry.js +1 -1
  8. package/dist/cjs/r-accordion-trigger.cjs.entry.js +1 -1
  9. package/dist/cjs/r-accordion.cjs.entry.js +1 -1
  10. package/dist/cjs/r-alert.cjs.entry.js +1 -1
  11. package/dist/cjs/r-badge.cjs.entry.js +2 -2
  12. package/dist/cjs/r-button.cjs.entry.js +1 -1
  13. package/dist/cjs/r-checkbox-group.cjs.entry.js +1 -1
  14. package/dist/cjs/r-checkbox.cjs.entry.js +1 -1
  15. package/dist/cjs/r-design-system-devtools.cjs.entry.js +1 -1
  16. package/dist/cjs/r-dialog.cjs.entry.js +12 -15
  17. package/dist/cjs/r-hint_3.cjs.entry.js +5 -5
  18. package/dist/cjs/r-icon-button.cjs.entry.js +4 -4
  19. package/dist/cjs/r-icon.cjs.entry.js +1 -1
  20. package/dist/cjs/r-input-code.cjs.entry.js +24 -8
  21. package/dist/cjs/r-input-date.cjs.entry.js +29 -8
  22. package/dist/cjs/r-input-password.cjs.entry.js +16 -5
  23. package/dist/cjs/r-input-phone-number.cjs.entry.js +58 -20
  24. package/dist/cjs/r-input.cjs.entry.js +31 -8
  25. package/dist/cjs/r-list-item.cjs.entry.js +17 -14
  26. package/dist/cjs/r-pagination.cjs.entry.js +1 -1
  27. package/dist/cjs/r-panel.cjs.entry.js +3 -3
  28. package/dist/cjs/r-popover-action.cjs.entry.js +2 -2
  29. package/dist/cjs/r-popover-content.cjs.entry.js +2 -2
  30. package/dist/cjs/r-popover-headline.cjs.entry.js +2 -2
  31. package/dist/cjs/r-popover-trigger.cjs.entry.js +2 -2
  32. package/dist/cjs/r-popover.cjs.entry.js +3 -3
  33. package/dist/cjs/r-progress-bar.cjs.entry.js +2 -2
  34. package/dist/cjs/r-radio-button-description.cjs.entry.js +2 -2
  35. package/dist/cjs/r-radio-button-leading.cjs.entry.js +2 -2
  36. package/dist/cjs/r-radio-button-title.cjs.entry.js +2 -2
  37. package/dist/cjs/r-radio-button-trailing.cjs.entry.js +2 -2
  38. package/dist/cjs/r-radio-button.cjs.entry.js +6 -6
  39. package/dist/cjs/r-radio-group.cjs.entry.js +7 -7
  40. package/dist/cjs/r-select-option.cjs.entry.js +2 -2
  41. package/dist/cjs/r-select.cjs.entry.js +6 -5
  42. package/dist/cjs/r-skip-link.cjs.entry.js +2 -2
  43. package/dist/cjs/r-stepper-item.cjs.entry.js +3 -3
  44. package/dist/cjs/r-stepper.cjs.entry.js +2 -2
  45. package/dist/cjs/r-tab-panel.cjs.entry.js +2 -2
  46. package/dist/cjs/r-tab.cjs.entry.js +2 -2
  47. package/dist/cjs/r-tabs-list.cjs.entry.js +2 -2
  48. package/dist/cjs/r-tabs.cjs.entry.js +4 -4
  49. package/dist/cjs/r-textarea.cjs.entry.js +18 -4
  50. package/dist/cjs/r-toast-group.cjs.entry.js +15 -5
  51. package/dist/cjs/r-toast.cjs.entry.js +16 -10
  52. package/dist/cjs/web-components.cjs.js +2 -2
  53. package/dist/collection/components/badge/badge.css +7 -7
  54. package/dist/collection/components/dialog/dialog.css +14 -14
  55. package/dist/collection/components/dialog/dialog.js +27 -13
  56. package/dist/collection/components/icon-button/icon-button.js +3 -3
  57. package/dist/collection/components/input/input.css +17 -2
  58. package/dist/collection/components/input/input.js +48 -6
  59. package/dist/collection/components/input-code/input-code.css +17 -2
  60. package/dist/collection/components/input-code/input-code.js +41 -6
  61. package/dist/collection/components/input-date/input-date.css +13 -2
  62. package/dist/collection/components/input-date/input-date.js +46 -6
  63. package/dist/collection/components/input-password/input-password.js +34 -4
  64. package/dist/collection/components/input-phone-number/input-phone-number.js +79 -18
  65. package/dist/collection/components/label/label.js +3 -3
  66. package/dist/collection/components/list-item/list-item/list-item.css +39 -32
  67. package/dist/collection/components/list-item/list-item/list-item.js +77 -14
  68. package/dist/collection/components/panel/panel.js +2 -2
  69. package/dist/collection/components/popover/popover.js +2 -2
  70. package/dist/collection/components/popover-action/popover-action.js +1 -1
  71. package/dist/collection/components/popover-content/popover-content.js +1 -1
  72. package/dist/collection/components/popover-headline/popover-headline.js +1 -1
  73. package/dist/collection/components/popover-trigger/popover-trigger.js +1 -1
  74. package/dist/collection/components/progress-bar/progress-bar.js +1 -1
  75. package/dist/collection/components/radio-button/radio-button.js +5 -5
  76. package/dist/collection/components/radio-button-description/radio-button-description.js +1 -1
  77. package/dist/collection/components/radio-button-leading/radio-button-leading.js +1 -1
  78. package/dist/collection/components/radio-button-title/radio-button-title.js +1 -1
  79. package/dist/collection/components/radio-button-trailing/radio-button-trailing.js +1 -1
  80. package/dist/collection/components/radio-group/radio-group.js +6 -6
  81. package/dist/collection/components/select/select.js +5 -4
  82. package/dist/collection/components/select-option/select-option.js +1 -1
  83. package/dist/collection/components/skip-link/skip-link.js +1 -1
  84. package/dist/collection/components/stepper/stepper.js +1 -1
  85. package/dist/collection/components/stepper-item/stepper-item.js +2 -2
  86. package/dist/collection/components/tab/tab.js +1 -1
  87. package/dist/collection/components/tab-panel/tab-panel.js +1 -1
  88. package/dist/collection/components/tabs/tabs.js +3 -3
  89. package/dist/collection/components/tabs-list/tabs-list.js +1 -1
  90. package/dist/collection/components/textarea/textarea.css +52 -21
  91. package/dist/collection/components/textarea/textarea.js +36 -3
  92. package/dist/collection/components/toast/toast.css +10 -3
  93. package/dist/collection/components/toast/toast.js +19 -10
  94. package/dist/collection/components/toast-group/toast-group.css +14 -13
  95. package/dist/collection/components/toast-group/toast-group.js +14 -4
  96. package/dist/collection/components/tooltip/tooltip.js +1 -1
  97. package/dist/esm/{index-CTxpqopm.js → index-Da7qOBFr.js} +382 -5
  98. package/dist/esm/loader.js +3 -3
  99. package/dist/esm/r-accordion-item.entry.js +1 -1
  100. package/dist/esm/r-accordion-panel.entry.js +1 -1
  101. package/dist/esm/r-accordion-section.entry.js +1 -1
  102. package/dist/esm/r-accordion-trigger.entry.js +1 -1
  103. package/dist/esm/r-accordion.entry.js +1 -1
  104. package/dist/esm/r-alert.entry.js +1 -1
  105. package/dist/esm/r-badge.entry.js +2 -2
  106. package/dist/esm/r-button.entry.js +1 -1
  107. package/dist/esm/r-checkbox-group.entry.js +1 -1
  108. package/dist/esm/r-checkbox.entry.js +1 -1
  109. package/dist/esm/r-design-system-devtools.entry.js +1 -1
  110. package/dist/esm/r-dialog.entry.js +12 -15
  111. package/dist/esm/r-hint_3.entry.js +5 -5
  112. package/dist/esm/r-icon-button.entry.js +4 -4
  113. package/dist/esm/r-icon.entry.js +1 -1
  114. package/dist/esm/r-input-code.entry.js +24 -8
  115. package/dist/esm/r-input-date.entry.js +29 -8
  116. package/dist/esm/r-input-password.entry.js +16 -5
  117. package/dist/esm/r-input-phone-number.entry.js +58 -20
  118. package/dist/esm/r-input.entry.js +31 -8
  119. package/dist/esm/r-list-item.entry.js +17 -14
  120. package/dist/esm/r-pagination.entry.js +1 -1
  121. package/dist/esm/r-panel.entry.js +3 -3
  122. package/dist/esm/r-popover-action.entry.js +2 -2
  123. package/dist/esm/r-popover-content.entry.js +2 -2
  124. package/dist/esm/r-popover-headline.entry.js +2 -2
  125. package/dist/esm/r-popover-trigger.entry.js +2 -2
  126. package/dist/esm/r-popover.entry.js +3 -3
  127. package/dist/esm/r-progress-bar.entry.js +2 -2
  128. package/dist/esm/r-radio-button-description.entry.js +2 -2
  129. package/dist/esm/r-radio-button-leading.entry.js +2 -2
  130. package/dist/esm/r-radio-button-title.entry.js +2 -2
  131. package/dist/esm/r-radio-button-trailing.entry.js +2 -2
  132. package/dist/esm/r-radio-button.entry.js +6 -6
  133. package/dist/esm/r-radio-group.entry.js +7 -7
  134. package/dist/esm/r-select-option.entry.js +2 -2
  135. package/dist/esm/r-select.entry.js +6 -5
  136. package/dist/esm/r-skip-link.entry.js +2 -2
  137. package/dist/esm/r-stepper-item.entry.js +3 -3
  138. package/dist/esm/r-stepper.entry.js +2 -2
  139. package/dist/esm/r-tab-panel.entry.js +2 -2
  140. package/dist/esm/r-tab.entry.js +2 -2
  141. package/dist/esm/r-tabs-list.entry.js +2 -2
  142. package/dist/esm/r-tabs.entry.js +4 -4
  143. package/dist/esm/r-textarea.entry.js +18 -4
  144. package/dist/esm/r-toast-group.entry.js +15 -5
  145. package/dist/esm/r-toast.entry.js +16 -10
  146. package/dist/esm/web-components.js +3 -3
  147. package/dist/types/components/dialog/dialog.d.ts +7 -1
  148. package/dist/types/components/input/input.d.ts +7 -0
  149. package/dist/types/components/input-code/input-code.d.ts +6 -0
  150. package/dist/types/components/input-date/input-date.d.ts +6 -0
  151. package/dist/types/components/input-password/input-password.d.ts +5 -0
  152. package/dist/types/components/input-phone-number/input-phone-number.d.ts +7 -0
  153. package/dist/types/components/list-item/list-item/list-item.d.ts +16 -3
  154. package/dist/types/components/textarea/textarea.d.ts +8 -1
  155. package/dist/types/components/toast/toast.d.ts +6 -0
  156. package/dist/types/components/toast-group/toast-group.d.ts +2 -0
  157. package/dist/types/components.d.ts +101 -8
  158. package/dist/web-components/p-00ca474f.entry.js +1 -0
  159. package/dist/web-components/p-00eb6986.entry.js +1 -0
  160. package/dist/web-components/{p-a45fd808.entry.js → p-0735fd75.entry.js} +1 -1
  161. package/dist/web-components/{p-7545038f.entry.js → p-0bb04d79.entry.js} +1 -1
  162. package/dist/web-components/{p-ef0f43e0.entry.js → p-0f4eea22.entry.js} +1 -1
  163. package/dist/web-components/{p-4cf01f30.entry.js → p-1c2497de.entry.js} +1 -1
  164. package/dist/web-components/p-2265dae1.entry.js +1 -0
  165. package/dist/web-components/{p-03ff9abf.entry.js → p-230e44ae.entry.js} +1 -1
  166. package/dist/web-components/{p-4dae8c19.entry.js → p-24bbf3b6.entry.js} +1 -1
  167. package/dist/web-components/p-28718c50.entry.js +1 -0
  168. package/dist/web-components/{p-59aa588e.entry.js → p-2b2f581a.entry.js} +1 -1
  169. package/dist/web-components/p-3b4e3faf.entry.js +1 -0
  170. package/dist/web-components/p-3bc93d65.entry.js +1 -0
  171. package/dist/web-components/{p-8968ddf6.entry.js → p-429213ea.entry.js} +1 -1
  172. package/dist/web-components/{p-c60294d4.entry.js → p-43eff76a.entry.js} +1 -1
  173. package/dist/web-components/{p-87bb4b91.entry.js → p-44ae9f33.entry.js} +1 -1
  174. package/dist/web-components/{p-806b173d.entry.js → p-4652635a.entry.js} +1 -1
  175. package/dist/web-components/{p-832dca22.entry.js → p-4bd3e077.entry.js} +1 -1
  176. package/dist/web-components/{p-512d3a60.entry.js → p-4e3df002.entry.js} +1 -1
  177. package/dist/web-components/p-51a5804b.entry.js +1 -0
  178. package/dist/web-components/{p-a81a67da.entry.js → p-72fa1fd1.entry.js} +1 -1
  179. package/dist/web-components/{p-5bc9fe5e.entry.js → p-755cc697.entry.js} +1 -1
  180. package/dist/web-components/{p-e74c363a.entry.js → p-77155630.entry.js} +1 -1
  181. package/dist/web-components/{p-77335ae7.entry.js → p-7fccc301.entry.js} +1 -1
  182. package/dist/web-components/{p-651522b6.entry.js → p-85a9af42.entry.js} +1 -1
  183. package/dist/web-components/{p-24130cdb.entry.js → p-87f39749.entry.js} +1 -1
  184. package/dist/web-components/{p-c9b2389b.entry.js → p-89136369.entry.js} +1 -1
  185. package/dist/web-components/p-8c577cda.entry.js +1 -0
  186. package/dist/web-components/{p-6b7d5236.entry.js → p-99ba15d9.entry.js} +1 -1
  187. package/dist/web-components/{p-d35303a6.entry.js → p-9eb1f262.entry.js} +1 -1
  188. package/dist/web-components/p-Da7qOBFr.js +2 -0
  189. package/dist/web-components/p-a022f356.entry.js +1 -0
  190. package/dist/web-components/p-a58124c4.entry.js +1 -0
  191. package/dist/web-components/{p-8d2f4097.entry.js → p-a683612d.entry.js} +1 -1
  192. package/dist/web-components/{p-9891afb8.entry.js → p-a7e7f8fa.entry.js} +1 -1
  193. package/dist/web-components/p-ad4292d8.entry.js +1 -0
  194. package/dist/web-components/p-c09a863b.entry.js +1 -0
  195. package/dist/web-components/{p-26e4816a.entry.js → p-c7f8e59b.entry.js} +1 -1
  196. package/dist/web-components/{p-f625b739.entry.js → p-c937bd92.entry.js} +1 -1
  197. package/dist/web-components/p-cbcd7699.entry.js +1 -0
  198. package/dist/web-components/p-e0e2f2b2.entry.js +1 -0
  199. package/dist/web-components/{p-0930ee1d.entry.js → p-e49b1ec3.entry.js} +1 -1
  200. package/dist/web-components/p-e4b66277.entry.js +1 -0
  201. package/dist/web-components/p-e6a31881.entry.js +1 -0
  202. package/dist/web-components/p-f1e22caa.entry.js +1 -0
  203. package/dist/web-components/{p-5dd43433.entry.js → p-f22696e0.entry.js} +1 -1
  204. package/dist/web-components/p-f6a92287.entry.js +1 -0
  205. package/dist/web-components/p-f7adb875.entry.js +1 -0
  206. package/dist/web-components/web-components.esm.js +1 -1
  207. package/package.json +1 -1
  208. package/dist/web-components/p-0bd10e93.entry.js +0 -1
  209. package/dist/web-components/p-15d10c68.entry.js +0 -1
  210. package/dist/web-components/p-1cfa9a0e.entry.js +0 -1
  211. package/dist/web-components/p-23ff25a1.entry.js +0 -1
  212. package/dist/web-components/p-50f01d6b.entry.js +0 -1
  213. package/dist/web-components/p-547fc56c.entry.js +0 -1
  214. package/dist/web-components/p-5cd1ad6a.entry.js +0 -1
  215. package/dist/web-components/p-73adec9b.entry.js +0 -1
  216. package/dist/web-components/p-8388221b.entry.js +0 -1
  217. package/dist/web-components/p-8cc4be0c.entry.js +0 -1
  218. package/dist/web-components/p-90d390f4.entry.js +0 -1
  219. package/dist/web-components/p-98628a15.entry.js +0 -1
  220. package/dist/web-components/p-9f583ed1.entry.js +0 -1
  221. package/dist/web-components/p-CTxpqopm.js +0 -2
  222. package/dist/web-components/p-aff51d37.entry.js +0 -1
  223. package/dist/web-components/p-b07be088.entry.js +0 -1
  224. package/dist/web-components/p-b5c8e978.entry.js +0 -1
  225. package/dist/web-components/p-d6ef5fff.entry.js +0 -1
  226. package/dist/web-components/p-dfd8bed6.entry.js +0 -1
  227. 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: '21c24c54dab7a321b76b0fe43c56c2002e71c6ba', value: this.value, onClick: this.onHostClick }, h("div", { key: '20e0f7bd4caaf67b3b24f8ddddfa2c4758baca87', class: "r-input-code--label-container" }, h("label", { key: '57555ebc91e7c0cd87395eeb85878c9a8c5298d1', htmlFor: uniqueId }, label ?
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: '858364e0940037842c2daba33fce0405e9bede4f', name: "popover" })), hint &&
266
- h("r-hint", { key: '2f8197c1bedf2a173c21ad5b749fc70fc739f58d', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: '89ab6e25c2274d74bf335e306759da7882d7fce8', class: "r-input-code--container", role: "group", "aria-labelledby": `${uniqueId}-label`, "aria-describedby": this.groupDescribedby }, h("slot", { key: 'cfb9ed388a51a3c8ba71160264c30093815e09eb', 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, onInput: this.createInputHandler(i), onKeyDown: this.createKeyDownHandler(i), onPaste: this.handlePaste }))), h("input", Object.assign({ key: '7cb823ab4fdae6e426f1b463cc6a24fb92b7dfd6', type: "hidden" }, inputAttrs, { value: this.values.join(''), ref: el => this.nativeElement = el })), h("slot", { key: '2cc6c8837176ec3a50697511c7787f1de80057ca', name: "trailing" }, valid &&
267
- h("r-icon", { key: '6aa4c20fba9e24a2176fef57e761a28ba5b5cd5b', name: "circled-check", size: "s", color: "var(--r-status-success-regular)" }))), h("slot", { key: '6597bd3d299be110dfc0b7c2b2cf5faa597a388e', name: "message" }, this.hasMessage &&
268
- h("r-hint", { key: '8a901746d9c029856157d1da45d106c91e8105ec', "aria-live": "polite", id: `${uniqueId}-message`, variant: "error" }, this.message))));
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(:hover:not([disabled]:not([disabled=false]))) {
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: '45402df1a93a99839195db652735095a5b373f35', onClick: this.onHostClick }, h("fieldset", Object.assign({ key: 'fa4328121e8a6391d7eca78445ce419a437543b1', class: "r-input-date" }, groupAttrs), h("div", { key: '50f428f5c1674d8355a803b0f093b6fcfcdaadb0', class: "r-input-date--legend-container" }, h("legend", { key: '55872125d4df627288369fa61bf3231500ba349b', class: "r-input-date--legend" }, h("label", { key: 'b051da10e21ac8d68d1fe56fe32ae2cb79b6289f', htmlFor: uniqueId }, label ?
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: '2f6e6d44c6a81d0e649ddc325f02575fde26c505', name: "popover" })), hint &&
374
- h("r-hint", { key: '7f1aed34c0391ed1cb25db22fda839bc3bc994e6', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: 'cd02f4b4ae91e9c2dd25a3c1d72ac345d79c769f', class: "r-input-date--container" }, h("r-icon", { key: '3472d2b8753d84c387de5e39a01538bfaef635ed', name: "calendar", size: "s", class: "r-input-date--calendar-icon" }), h("div", { key: 'a8f3e0c4b986ec86e4b6f48efac093c32a359256', 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 &&
375
- h("span", { "aria-hidden": "true", class: "r-input-date--delimiter" }, this.delimiter)))), h("input", Object.assign({ key: '2e3e7b6fb13bc961549ad147e7bbc65b330bccd2', type: "hidden" }, dateInputAttrs, { value: this.value, ref: (el) => this.nativeElement = el }))), h("div", { key: '77af892c79891b6a4893d36730135f9124cb71f7', class: "r-input-date--trailing" }, h("slot", { key: '20e5f42a09a7fdda67467a25aced264d8d1c9b1e', name: "trailing" }, valid &&
376
- h("r-icon", { key: '65d84ab8a34134b267be8e54fad621b112ae4a11', name: "circled-check", size: "s", color: "var(--r-status-success-regular)" })))), h("div", { key: '2943beb614010b8b2251bb96ded76021384fb1d7', id: `${uniqueId}-message`, "aria-live": "polite", class: "r-input-date--message" }, this.hasMessage && h("r-hint", { key: 'efb51013501de46364d3dd043813c2fd3fb5c257', variant: "error" }, this.message)))));
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: '8e6cba802dd16c4d3728ee18c4a99882413eb94d' }, h("r-input", Object.assign({ key: '8fe50776017dc37afe9cd06cb944fff2f17bcc22' }, inputAttrs, { ref: (el) => this.nativeElement = el, type: showed ? 'text' : 'password', onRInput: this.onInput, onRChange: this.onChange, onKeyUp: this.handleKeyup, onRBlur: this.handleBlur }), h("slot", { key: 'f8a7ad986b5945549968db08f7b98f3f3512292d', name: "popover", slot: "popover" }), h("r-icon", { key: '3adae1ce4ac77ca8db37fbdb4cf9060a84f56a23', name: "padlock-closed", size: "s", slot: "leading" }), h("r-icon-button", { key: '928a08c5250fcf01884da4f295b6b85299d7a588', slot: "trailing", name: showed ? 'eye-crossed-out' : 'eye', size: "s", disabled: disabled, label: showed ? hidePasswordAriaLabel : showPasswordAriaLabel, onClick: this.onShowClick }), this.hasMessage &&
214
- h("r-hint", { key: 'fe5651e7dafc74e42f23b528510c3d18b37ac779', slot: "message", variant: "error" }, this.hasError && this.error, this.hasValidationError && (this.customErrorMessage || this.validityMessage))), h("div", { key: 'b5badae92e3eee6447a599128f71ce4d907f1425', class: "visually-hidden", ref: el => this.passwordVisibilityChangeAlertContainer = el, "aria-live": "polite" })));
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
- var _a;
125
- (_a = this.countryCodeElement) === null || _a === void 0 ? void 0 : _a.setAttribute('disabled', `${this.disabled || false}`);
135
+ this.setCountryCodeElementAttributes({
136
+ 'disabled': `${!!this.disabled}`
137
+ });
126
138
  }
127
139
  handleRequiredChange() {
128
- var _a;
129
- (_a = this.countryCodeElement) === null || _a === void 0 ? void 0 : _a.setAttribute('required', `${this.required || false}`);
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
- var _a, _b, _c, _d, _e, _f, _g;
187
- (_a = this.countryCodeElement) === null || _a === void 0 ? void 0 : _a.setAttribute('show-leading-icon', 'true');
188
- (_b = this.countryCodeElement) === null || _b === void 0 ? void 0 : _b.setAttribute('leading-icon', 'globe');
189
- (_c = this.countryCodeElement) === null || _c === void 0 ? void 0 : _c.setAttribute('placeholder', '+00');
190
- (_d = this.countryCodeElement) === null || _d === void 0 ? void 0 : _d.setAttribute('disabled', `${this.disabled || false}`);
191
- (_e = this.countryCodeElement) === null || _e === void 0 ? void 0 : _e.setAttribute('internal', 'true');
192
- (_f = this.countryCodeElement) === null || _f === void 0 ? void 0 : _f.setAttribute('required', `${this.required || false}`);
193
- (_g = this.countryCodeElement) === null || _g === void 0 ? void 0 : _g.setAttribute('label', this.countryCodeLabel);
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
- this.setCountryCodeElementAttributes();
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: 'd1ddc6d8dec0b98c83c65d2a0e0ad7177d4bf5e4' }, h("div", { key: '5e87d5acdf57428188dafa9e1d13b68268db7854', class: "r-input-phone-number--label-container" }, h("label", { key: 'ba8ec0808fbfd2c59115d5765d4e3e74d5fbd907', id: `${uniqueId}-label` }, label &&
243
- h("r-label", Object.assign({ key: 'b4102846d72fa6b9ac928d5a846163ad8f81cc2c' }, labelAttr), label)), h("slot", { key: 'debcf23c5add7c28c56b60d3f82c29ba32d85049', name: "popover" })), hint &&
244
- h("r-hint", { key: '429ed5d551ac9cb028b18919e3f7d8d4155330fe', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: 'c269f63f96d619595ae676d77448410d71a4b356', class: "r-input-phone-number", role: "group", "aria-labelledby": `${uniqueId}-label`, "aria-describedby": this.ariaDescribedBy }, h("slot", { key: 'eb5402152f90f5e97b68a04c511daa228e0d3c05' }), h("r-input", { key: '9aa1354f8a17087dff54ae394c8859b9a69e4b5a', label: inputLabel, value: phoneNumber, internal: true, valid: valid, invalid: invalid, required: required, novalidate: true, fullWidth: fullWidth, type: "tel", error: this.errorMessage || '', onRInput: this.handleOnInput, onRChange: this.handleInputOnChange, disabled: disabled }, valid && phoneNumber &&
245
- h("r-icon", { key: '8a4a597a9177f115ccfab3a1a388d6ef7445d0fb', slot: "trailing", name: "circled-check", size: "s", color: "var(--r-status-success-regular)" }))), h("input", Object.assign({ key: '44646c7de24094438bcbb5288ce08378bc7ed473', type: "hidden" }, inputAttrs, { value: fullPhoneNumber, ref: el => this.nativeElement = el })), h("r-hint", { key: 'a30016c4a30ab4e13a34374973b0ff2ee7369dac', "aria-live": "polite", "aria-atomic": "true", id: `${uniqueId}-message`, class: !this.hasMessage && 'visually-hidden', variant: "error" }, this.hasError && this.error, this.hasValidationError && this.validityMessage)));
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: '1bcaecd6616128ccab32f8a1ff4f46f1072190ac' }, h("div", { key: 'ab619a29898eb4e7a49ac5dd07f2b1b98aac17a2', class: "r-label" }, h("span", { key: 'ac0e0ea909ef6da765676b6b30ecc65d39664bcf', class: "r-label--slot" }, h("slot", { key: 'cf6014703ae7afeed874e017cef48d99aa32eddb' }), fieldIndicator &&
29
- h("span", { key: '11e2435c41fbe76ca0b64d9eacc59c10ff87233d', class: "r-label--marker" }, fieldIndicator)), tooltip &&
30
- h("span", { key: 'c9ed9b4fe5f084e23d24a8687dcc186bd3380b05', class: "r-label--tooltip-icon" }, h("r-tooltip", Object.assign({ key: '78f51c815bc28429edae7ad52f3150aafe3a5211' }, tooltipAttrs), h("r-icon", Object.assign({ key: 'e890282aaf5b66d805ee6212cf8c69abae3cde7e' }, tooltipIconAttrs)))))));
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"; }