@siemens/ix 2.6.0 → 2.6.1

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 (311) hide show
  1. package/components/button.js +7 -2
  2. package/components/button.js.map +1 -1
  3. package/components/dropdown-item.js +1 -1
  4. package/components/dropdown-item.js.map +1 -1
  5. package/components/field-label.js +1 -1
  6. package/components/field-label.js.map +1 -1
  7. package/components/field-wrapper.js +2 -2
  8. package/components/field-wrapper.js.map +1 -1
  9. package/components/index3.js +2 -1
  10. package/components/index3.js.map +1 -1
  11. package/components/input.util.js +4 -8
  12. package/components/input.util.js.map +1 -1
  13. package/components/ix-date-input.js +6 -6
  14. package/components/ix-date-input.js.map +1 -1
  15. package/components/ix-input.js +3 -3
  16. package/components/ix-input.js.map +1 -1
  17. package/components/ix-number-input.js +5 -5
  18. package/components/ix-number-input.js.map +1 -1
  19. package/components/ix-textarea.js +2 -2
  20. package/components/ix-textarea.js.map +1 -1
  21. package/components/ix-toggle-button.js +2 -2
  22. package/components/ix-toggle.js +25 -5
  23. package/components/ix-toggle.js.map +1 -1
  24. package/components/ix-tree.js +330 -496
  25. package/components/ix-tree.js.map +1 -1
  26. package/components/ix-upload.js +3 -3
  27. package/components/ix-validation-tooltip.js +2 -2
  28. package/components/ix-workflow-step.js +3 -3
  29. package/components/ix-workflow-steps.js +1 -1
  30. package/components/modal.js +6 -0
  31. package/components/modal.js.map +1 -1
  32. package/components/select.js +68 -52
  33. package/components/select.js.map +1 -1
  34. package/components/tooltip.js +2 -2
  35. package/components/tree-item.js +6 -5
  36. package/components/tree-item.js.map +1 -1
  37. package/dist/cjs/{app-globals-3c9c6a50.js → app-globals-4d8f1524.js} +2 -2
  38. package/dist/cjs/{app-globals-3c9c6a50.js.map → app-globals-4d8f1524.js.map} +1 -1
  39. package/dist/cjs/core-js-b22adfab.js +26 -0
  40. package/dist/cjs/core-js-b22adfab.js.map +1 -0
  41. package/dist/cjs/{helper-text-util-3192e78f.js → helper-text-util-635a1877.js} +2 -2
  42. package/dist/cjs/{helper-text-util-3192e78f.js.map → helper-text-util-635a1877.js.map} +1 -1
  43. package/dist/cjs/{index-74904d8b.js → index-492e6488.js} +2 -2
  44. package/dist/cjs/{index-74904d8b.js.map → index-492e6488.js.map} +1 -1
  45. package/dist/cjs/{index-d2117dc0.js → index-b44a6617.js} +3 -1
  46. package/dist/cjs/index-b44a6617.js.map +1 -0
  47. package/dist/cjs/index.cjs.js +2 -2
  48. package/dist/cjs/{index.es2017-0c2b80b6.js → index.es2017-805b5876.js} +3 -3
  49. package/dist/cjs/{index.es2017-0c2b80b6.js.map → index.es2017-805b5876.js.map} +1 -1
  50. package/dist/cjs/{input.util-1c2fa43d.js → input.util-54d161e6.js} +5 -9
  51. package/dist/cjs/input.util-54d161e6.js.map +1 -0
  52. package/dist/cjs/ix-application-header.cjs.entry.js +2 -2
  53. package/dist/cjs/ix-application-switch-modal.cjs.entry.js +1 -1
  54. package/dist/cjs/ix-button.cjs.entry.js +7 -2
  55. package/dist/cjs/ix-button.cjs.entry.js.map +1 -1
  56. package/dist/cjs/ix-col_4.cjs.entry.js +1 -1
  57. package/dist/cjs/ix-date-input.cjs.entry.js +6 -6
  58. package/dist/cjs/ix-date-input.cjs.entry.js.map +1 -1
  59. package/dist/cjs/ix-dropdown-item.cjs.entry.js +1 -1
  60. package/dist/cjs/ix-dropdown-item.cjs.entry.js.map +1 -1
  61. package/dist/cjs/ix-field-label_3.cjs.entry.js +7 -7
  62. package/dist/cjs/ix-field-label_3.cjs.entry.js.map +1 -1
  63. package/dist/cjs/ix-helper-text.cjs.entry.js +2 -2
  64. package/dist/cjs/{ix-icon.entry-e95ddded.js → ix-icon.entry-e33446e2.js} +2 -2
  65. package/dist/cjs/{ix-icon.entry-e95ddded.js.map → ix-icon.entry-e33446e2.js.map} +1 -1
  66. package/dist/cjs/ix-input.cjs.entry.js +5 -5
  67. package/dist/cjs/ix-input.cjs.entry.js.map +1 -1
  68. package/dist/cjs/ix-menu.cjs.entry.js +2 -2
  69. package/dist/cjs/ix-number-input.cjs.entry.js +7 -7
  70. package/dist/cjs/ix-number-input.cjs.entry.js.map +1 -1
  71. package/dist/cjs/ix-select.cjs.entry.js +68 -52
  72. package/dist/cjs/ix-select.cjs.entry.js.map +1 -1
  73. package/dist/cjs/ix-textarea.cjs.entry.js +3 -3
  74. package/dist/cjs/ix-textarea.cjs.entry.js.map +1 -1
  75. package/dist/cjs/ix-time-picker.cjs.entry.js +1 -1
  76. package/dist/cjs/ix-toggle-button.cjs.entry.js +2 -2
  77. package/dist/cjs/ix-toggle.cjs.entry.js +17 -3
  78. package/dist/cjs/ix-toggle.cjs.entry.js.map +1 -1
  79. package/dist/cjs/ix-tree-item.cjs.entry.js +6 -5
  80. package/dist/cjs/ix-tree-item.cjs.entry.js.map +1 -1
  81. package/dist/cjs/ix-tree.cjs.entry.js +330 -489
  82. package/dist/cjs/ix-tree.cjs.entry.js.map +1 -1
  83. package/dist/cjs/ix-upload.cjs.entry.js +3 -3
  84. package/dist/cjs/ix-validation-tooltip.cjs.entry.js +2 -2
  85. package/dist/cjs/ix-workflow-step.cjs.entry.js +3 -3
  86. package/dist/cjs/ix-workflow-steps.cjs.entry.js +1 -1
  87. package/dist/cjs/loader.cjs.js +3 -3
  88. package/dist/cjs/{modal-a49409aa.js → modal-923c83a6.js} +7 -1
  89. package/dist/cjs/modal-923c83a6.js.map +1 -0
  90. package/dist/cjs/{setup-86b7d543.js → setup-cc07fbfc.js} +2 -2
  91. package/dist/cjs/{setup-86b7d543.js.map → setup-cc07fbfc.js.map} +1 -1
  92. package/dist/cjs/siemens-ix.cjs.js +3 -3
  93. package/dist/collection/components/button/button.js +7 -2
  94. package/dist/collection/components/button/button.js.map +1 -1
  95. package/dist/collection/components/date-input/date-input.js +8 -6
  96. package/dist/collection/components/date-input/date-input.js.map +1 -1
  97. package/dist/collection/components/dropdown-item/dropdown-item.css +0 -3
  98. package/dist/collection/components/field-label/field-label.js +13 -5
  99. package/dist/collection/components/field-label/field-label.js.map +1 -1
  100. package/dist/collection/components/field-wrapper/field-wrapper.js +12 -4
  101. package/dist/collection/components/field-wrapper/field-wrapper.js.map +1 -1
  102. package/dist/collection/components/input/input.fc.js +4 -8
  103. package/dist/collection/components/input/input.fc.js.map +1 -1
  104. package/dist/collection/components/input/input.js +5 -3
  105. package/dist/collection/components/input/input.js.map +1 -1
  106. package/dist/collection/components/input/number-input.js +7 -5
  107. package/dist/collection/components/input/number-input.js.map +1 -1
  108. package/dist/collection/components/input/textarea.js +2 -2
  109. package/dist/collection/components/input/textarea.js.map +1 -1
  110. package/dist/collection/components/modal/test/modal.ct.js +57 -65
  111. package/dist/collection/components/modal/test/modal.ct.js.map +1 -1
  112. package/dist/collection/components/select/select.js +68 -52
  113. package/dist/collection/components/select/select.js.map +1 -1
  114. package/dist/collection/components/select/test/select.ct.js +72 -100
  115. package/dist/collection/components/select/test/select.ct.js.map +1 -1
  116. package/dist/collection/components/toggle/toggle.css +376 -161
  117. package/dist/collection/components/toggle/toggle.js +17 -3
  118. package/dist/collection/components/toggle/toggle.js.map +1 -1
  119. package/dist/collection/components/toggle-button/toggle-button.js +2 -2
  120. package/dist/collection/components/tooltip/tooltip.js +2 -2
  121. package/dist/collection/components/tree/tree.js +6 -3
  122. package/dist/collection/components/tree/tree.js.map +1 -1
  123. package/dist/collection/components/tree-item/tree-item.js +6 -5
  124. package/dist/collection/components/tree-item/tree-item.js.map +1 -1
  125. package/dist/collection/components/upload/upload.js +3 -3
  126. package/dist/collection/components/utils/lazy-list/index.js +2 -0
  127. package/dist/collection/components/utils/lazy-list/index.js.map +1 -0
  128. package/dist/collection/components/utils/lazy-list/lazy.js +343 -0
  129. package/dist/collection/components/utils/lazy-list/lazy.js.map +1 -0
  130. package/dist/collection/components/utils/modal/modal.js +6 -0
  131. package/dist/collection/components/utils/modal/modal.js.map +1 -1
  132. package/dist/collection/components/validation-tooltip/validation-tooltip.js +2 -2
  133. package/dist/collection/components/workflow-step/workflow-step.js +3 -3
  134. package/dist/collection/components/workflow-steps/workflow-steps.js +1 -1
  135. package/dist/collection/tests/html-tags/html-tags.e2e.js +17 -0
  136. package/dist/collection/tests/html-tags/html-tags.e2e.js.map +1 -0
  137. package/dist/esm/app-globals-40082a83.js +7 -0
  138. package/dist/esm/{app-globals-ae0ca705.js.map → app-globals-40082a83.js.map} +1 -1
  139. package/dist/esm/{core-js-78b486a8.js → core-js-4a847feb.js} +2 -2
  140. package/dist/esm/{core-js-78b486a8.js.map → core-js-4a847feb.js.map} +1 -1
  141. package/dist/esm/{helper-text-util-10896253.js → helper-text-util-e47b864d.js} +2 -2
  142. package/dist/esm/{helper-text-util-10896253.js.map → helper-text-util-e47b864d.js.map} +1 -1
  143. package/dist/esm/{index-ad2af369.js → index-2b76ea55.js} +3 -2
  144. package/dist/esm/index-2b76ea55.js.map +1 -0
  145. package/dist/esm/{index-60d17930.js → index-7421df0c.js} +2 -2
  146. package/dist/esm/{index-60d17930.js.map → index-7421df0c.js.map} +1 -1
  147. package/dist/esm/{index.es2017-93ac816c.js → index.es2017-4e6fdf77.js} +3 -3
  148. package/dist/esm/{index.es2017-93ac816c.js.map → index.es2017-4e6fdf77.js.map} +1 -1
  149. package/dist/esm/index.js +3 -3
  150. package/dist/esm/{input.util-715860e3.js → input.util-c855b2ed.js} +5 -9
  151. package/dist/esm/input.util-c855b2ed.js.map +1 -0
  152. package/dist/esm/ix-application-header.entry.js +2 -2
  153. package/dist/esm/ix-application-switch-modal.entry.js +1 -1
  154. package/dist/esm/ix-button.entry.js +7 -2
  155. package/dist/esm/ix-button.entry.js.map +1 -1
  156. package/dist/esm/ix-col_4.entry.js +1 -1
  157. package/dist/esm/ix-date-input.entry.js +6 -6
  158. package/dist/esm/ix-date-input.entry.js.map +1 -1
  159. package/dist/esm/ix-dropdown-item.entry.js +1 -1
  160. package/dist/esm/ix-dropdown-item.entry.js.map +1 -1
  161. package/dist/esm/ix-field-label_3.entry.js +7 -7
  162. package/dist/esm/ix-field-label_3.entry.js.map +1 -1
  163. package/dist/esm/ix-helper-text.entry.js +2 -2
  164. package/dist/esm/{ix-icon.entry-621b700a.js → ix-icon.entry-f5f7c268.js} +2 -2
  165. package/dist/esm/{ix-icon.entry-621b700a.js.map → ix-icon.entry-f5f7c268.js.map} +1 -1
  166. package/dist/esm/ix-input.entry.js +5 -5
  167. package/dist/esm/ix-input.entry.js.map +1 -1
  168. package/dist/esm/ix-menu.entry.js +2 -2
  169. package/dist/esm/ix-number-input.entry.js +7 -7
  170. package/dist/esm/ix-number-input.entry.js.map +1 -1
  171. package/dist/esm/ix-select.entry.js +68 -52
  172. package/dist/esm/ix-select.entry.js.map +1 -1
  173. package/dist/esm/ix-textarea.entry.js +3 -3
  174. package/dist/esm/ix-textarea.entry.js.map +1 -1
  175. package/dist/esm/ix-time-picker.entry.js +1 -1
  176. package/dist/esm/ix-toggle-button.entry.js +2 -2
  177. package/dist/esm/ix-toggle.entry.js +18 -4
  178. package/dist/esm/ix-toggle.entry.js.map +1 -1
  179. package/dist/esm/ix-tree-item.entry.js +6 -5
  180. package/dist/esm/ix-tree-item.entry.js.map +1 -1
  181. package/dist/esm/ix-tree.entry.js +330 -489
  182. package/dist/esm/ix-tree.entry.js.map +1 -1
  183. package/dist/esm/ix-upload.entry.js +3 -3
  184. package/dist/esm/ix-validation-tooltip.entry.js +2 -2
  185. package/dist/esm/ix-workflow-step.entry.js +3 -3
  186. package/dist/esm/ix-workflow-steps.entry.js +1 -1
  187. package/dist/esm/loader.js +3 -3
  188. package/dist/esm/{modal-101eef04.js → modal-4b3f8800.js} +7 -1
  189. package/dist/{cjs/modal-a49409aa.js.map → esm/modal-4b3f8800.js.map} +1 -1
  190. package/dist/esm/{setup-d88021f8.js → setup-9c5fe321.js} +2 -2
  191. package/dist/esm/{setup-d88021f8.js.map → setup-9c5fe321.js.map} +1 -1
  192. package/dist/esm/siemens-ix.js +3 -3
  193. package/dist/siemens-ix/index.esm.js +1 -1
  194. package/dist/siemens-ix/{p-0dbc970e.entry.js → p-0b2f0536.entry.js} +2 -2
  195. package/dist/siemens-ix/{p-2b226409.entry.js → p-0b5c9f33.entry.js} +2 -2
  196. package/dist/siemens-ix/p-0b5c9f33.entry.js.map +1 -0
  197. package/dist/siemens-ix/{p-044c2a7b.entry.js → p-18542846.entry.js} +2 -2
  198. package/dist/siemens-ix/p-20938f73.entry.js +2 -0
  199. package/dist/siemens-ix/p-20938f73.entry.js.map +1 -0
  200. package/dist/siemens-ix/p-22cba43a.entry.js +2 -0
  201. package/dist/siemens-ix/p-22cba43a.entry.js.map +1 -0
  202. package/dist/siemens-ix/{p-9fe2759f.entry.js → p-243e8b32.entry.js} +2 -2
  203. package/dist/siemens-ix/p-243e8b32.entry.js.map +1 -0
  204. package/dist/siemens-ix/p-38d9d569.js +2 -0
  205. package/dist/siemens-ix/p-38d9d569.js.map +1 -0
  206. package/dist/siemens-ix/{p-d7aa00d6.js → p-3aaecbd9.js} +2 -2
  207. package/dist/siemens-ix/{p-175599e4.entry.js → p-42320fb3.entry.js} +2 -2
  208. package/dist/siemens-ix/p-44fa005c.js +4 -0
  209. package/dist/siemens-ix/{p-a2200306.js.map → p-44fa005c.js.map} +1 -1
  210. package/dist/siemens-ix/p-451551d1.js +2 -0
  211. package/dist/siemens-ix/p-451551d1.js.map +1 -0
  212. package/dist/siemens-ix/p-53fd545a.entry.js +2 -0
  213. package/dist/siemens-ix/p-53fd545a.entry.js.map +1 -0
  214. package/dist/siemens-ix/p-5fbdff13.entry.js +2 -0
  215. package/dist/siemens-ix/p-5fbdff13.entry.js.map +1 -0
  216. package/dist/siemens-ix/{p-1f6df0c6.js → p-738c2d1f.js} +2 -2
  217. package/dist/siemens-ix/{p-424e8092.entry.js → p-897c8e5b.entry.js} +2 -2
  218. package/dist/siemens-ix/p-897c8e5b.entry.js.map +1 -0
  219. package/dist/siemens-ix/{p-f35386ec.js → p-93d4d3c9.js} +2 -2
  220. package/dist/siemens-ix/{p-9948574f.entry.js → p-97d4b3bd.entry.js} +2 -2
  221. package/dist/siemens-ix/{p-6a4a2064.entry.js → p-9f960c0b.entry.js} +2 -2
  222. package/dist/siemens-ix/{p-0c89cbcc.entry.js → p-a4dc6824.entry.js} +2 -2
  223. package/dist/siemens-ix/{p-fe87443e.js → p-a6af13b0.js} +2 -2
  224. package/dist/siemens-ix/p-af7c4b16.entry.js +2 -0
  225. package/dist/siemens-ix/p-af7c4b16.entry.js.map +1 -0
  226. package/dist/siemens-ix/{p-a3364116.entry.js → p-afb4565c.entry.js} +2 -2
  227. package/dist/siemens-ix/{p-4c9b7548.entry.js → p-bc272f75.entry.js} +2 -2
  228. package/dist/siemens-ix/{p-3205726a.entry.js → p-bfe469e4.entry.js} +2 -2
  229. package/dist/siemens-ix/{p-792e1c52.entry.js → p-c07557b0.entry.js} +2 -2
  230. package/dist/siemens-ix/p-c07557b0.entry.js.map +1 -0
  231. package/dist/siemens-ix/p-c3ca17fc.js +2 -0
  232. package/dist/siemens-ix/p-c530de51.entry.js +2 -0
  233. package/dist/siemens-ix/p-c530de51.entry.js.map +1 -0
  234. package/dist/siemens-ix/p-d2f21544.js +2 -0
  235. package/dist/siemens-ix/{p-68bb2a09.entry.js → p-d9b654af.entry.js} +2 -2
  236. package/dist/siemens-ix/p-d9b654af.entry.js.map +1 -0
  237. package/dist/siemens-ix/{p-e9a37b3f.entry.js → p-ee0645f8.entry.js} +2 -2
  238. package/dist/siemens-ix/p-fe158b99.js +2 -0
  239. package/dist/siemens-ix/p-fe158b99.js.map +1 -0
  240. package/dist/siemens-ix/{p-f39048a2.entry.js → p-fe396297.entry.js} +2 -2
  241. package/dist/siemens-ix/siemens-ix.esm.js +1 -1
  242. package/dist/types/components/button/button.d.ts +1 -0
  243. package/dist/types/components/date-input/date-input.d.ts +2 -0
  244. package/dist/types/components/field-label/field-label.d.ts +1 -1
  245. package/dist/types/components/field-wrapper/field-wrapper.d.ts +1 -1
  246. package/dist/types/components/input/input.d.ts +2 -0
  247. package/dist/types/components/input/number-input.d.ts +2 -0
  248. package/dist/types/components/modal/test/modal.ct.d.ts +2 -1
  249. package/dist/types/components/select/select.d.ts +9 -8
  250. package/dist/types/components/utils/lazy-list/index.d.ts +2 -0
  251. package/dist/types/components/utils/lazy-list/lazy.d.ts +51 -0
  252. package/dist/types/components.d.ts +9 -3
  253. package/hydrate/index.js +499 -621
  254. package/package.json +1 -2
  255. package/dist/cjs/_commonjsHelpers-0192c5b3.js +0 -17
  256. package/dist/cjs/_commonjsHelpers-0192c5b3.js.map +0 -1
  257. package/dist/cjs/core-js-2fc351ee.js +0 -26
  258. package/dist/cjs/core-js-2fc351ee.js.map +0 -1
  259. package/dist/cjs/index-d2117dc0.js.map +0 -1
  260. package/dist/cjs/input.util-1c2fa43d.js.map +0 -1
  261. package/dist/esm/_commonjsHelpers-e557d4a5.js +0 -13
  262. package/dist/esm/_commonjsHelpers-e557d4a5.js.map +0 -1
  263. package/dist/esm/app-globals-ae0ca705.js +0 -7
  264. package/dist/esm/index-ad2af369.js.map +0 -1
  265. package/dist/esm/input.util-715860e3.js.map +0 -1
  266. package/dist/esm/modal-101eef04.js.map +0 -1
  267. package/dist/siemens-ix/p-0f0e7e14.entry.js +0 -2
  268. package/dist/siemens-ix/p-0f0e7e14.entry.js.map +0 -1
  269. package/dist/siemens-ix/p-23a4b81f.js +0 -2
  270. package/dist/siemens-ix/p-23a4b81f.js.map +0 -1
  271. package/dist/siemens-ix/p-2b226409.entry.js.map +0 -1
  272. package/dist/siemens-ix/p-424e8092.entry.js.map +0 -1
  273. package/dist/siemens-ix/p-45840cb9.js +0 -2
  274. package/dist/siemens-ix/p-45840cb9.js.map +0 -1
  275. package/dist/siemens-ix/p-4624a772.entry.js +0 -2
  276. package/dist/siemens-ix/p-4624a772.entry.js.map +0 -1
  277. package/dist/siemens-ix/p-50096707.js +0 -2
  278. package/dist/siemens-ix/p-5682e985.js +0 -2
  279. package/dist/siemens-ix/p-5db5a0b5.entry.js +0 -2
  280. package/dist/siemens-ix/p-5db5a0b5.entry.js.map +0 -1
  281. package/dist/siemens-ix/p-68bb2a09.entry.js.map +0 -1
  282. package/dist/siemens-ix/p-792e1c52.entry.js.map +0 -1
  283. package/dist/siemens-ix/p-79bb0d39.js +0 -2
  284. package/dist/siemens-ix/p-79bb0d39.js.map +0 -1
  285. package/dist/siemens-ix/p-857f99c8.entry.js +0 -2
  286. package/dist/siemens-ix/p-857f99c8.entry.js.map +0 -1
  287. package/dist/siemens-ix/p-9fe2759f.entry.js.map +0 -1
  288. package/dist/siemens-ix/p-a2200306.js +0 -4
  289. package/dist/siemens-ix/p-a427e6a2.js +0 -2
  290. package/dist/siemens-ix/p-a427e6a2.js.map +0 -1
  291. package/dist/siemens-ix/p-bded112a.entry.js +0 -2
  292. package/dist/siemens-ix/p-bded112a.entry.js.map +0 -1
  293. package/dist/siemens-ix/p-f7618d1d.entry.js +0 -2
  294. package/dist/siemens-ix/p-f7618d1d.entry.js.map +0 -1
  295. /package/dist/siemens-ix/{p-0dbc970e.entry.js.map → p-0b2f0536.entry.js.map} +0 -0
  296. /package/dist/siemens-ix/{p-044c2a7b.entry.js.map → p-18542846.entry.js.map} +0 -0
  297. /package/dist/siemens-ix/{p-d7aa00d6.js.map → p-3aaecbd9.js.map} +0 -0
  298. /package/dist/siemens-ix/{p-175599e4.entry.js.map → p-42320fb3.entry.js.map} +0 -0
  299. /package/dist/siemens-ix/{p-1f6df0c6.js.map → p-738c2d1f.js.map} +0 -0
  300. /package/dist/siemens-ix/{p-f35386ec.js.map → p-93d4d3c9.js.map} +0 -0
  301. /package/dist/siemens-ix/{p-9948574f.entry.js.map → p-97d4b3bd.entry.js.map} +0 -0
  302. /package/dist/siemens-ix/{p-6a4a2064.entry.js.map → p-9f960c0b.entry.js.map} +0 -0
  303. /package/dist/siemens-ix/{p-0c89cbcc.entry.js.map → p-a4dc6824.entry.js.map} +0 -0
  304. /package/dist/siemens-ix/{p-fe87443e.js.map → p-a6af13b0.js.map} +0 -0
  305. /package/dist/siemens-ix/{p-a3364116.entry.js.map → p-afb4565c.entry.js.map} +0 -0
  306. /package/dist/siemens-ix/{p-4c9b7548.entry.js.map → p-bc272f75.entry.js.map} +0 -0
  307. /package/dist/siemens-ix/{p-3205726a.entry.js.map → p-bfe469e4.entry.js.map} +0 -0
  308. /package/dist/siemens-ix/{p-5682e985.js.map → p-c3ca17fc.js.map} +0 -0
  309. /package/dist/siemens-ix/{p-50096707.js.map → p-d2f21544.js.map} +0 -0
  310. /package/dist/siemens-ix/{p-e9a37b3f.entry.js.map → p-ee0645f8.entry.js.map} +0 -0
  311. /package/dist/siemens-ix/{p-f39048a2.entry.js.map → p-fe396297.entry.js.map} +0 -0
@@ -40,9 +40,9 @@ export class FieldWrapper {
40
40
  infoText: this.infoText,
41
41
  helperText: this.helperText,
42
42
  };
43
- return (h(Host, { key: '3a1885ca13c1de17fdbb33eb6cde695cbdb3469e' }, this.label && (h("div", { key: '9e8c0a96fe7014feb6ac76473137183ba92e2ad1', class: "field-top" }, h("ix-field-label", { key: '923dec87ac02cf550400aba0bf929b95d8a271ed', required: this.required, htmlFor: this.htmlForLabel, controlRef: this.controlRef, isInvalid: this.isInvalid }, this.label))), h("div", { key: 'a6694ebd1d18d2411565960ff5f1e6ee900491e8', class: {
43
+ return (h(Host, { key: 'cca8bb819e4c2e02176ef9edc0d2456b3b3cbb5c' }, this.label && (h("div", { key: '3e9aa899b1e7257cabfd9e9c36823598d798c2b2', class: "field-top" }, h("ix-field-label", { key: '425ee0329aa0f27abebe81995f4843cd734c1a6a', required: this.required, htmlFor: this.htmlForLabel, controlRef: this.controlRef, isInvalid: this.isInvalid }, this.label))), h("div", { key: '3fe4cedebd10b2c3fb9abf47223049e12a666010', class: {
44
44
  'slot-wrapper': true,
45
- }, ref: this.slotRef }, h("slot", { key: '302fcd87bd9cba38a3057b9a6542dbaed9d16bbc' })), h("div", { key: '8f5c9836963e0df796388b8dac20db7289ea067e', class: 'field-bottom' }, !this.showTextAsTooltip && renderHelperText(textOptions), h("div", { key: '620bf3f6730971ee840744fce7b8a7de2d2f12a9', class: "bottom-right" }, h("slot", { key: '7cff3c8d8f550a88e4bccacf6b71547edb89b0a7', name: "bottom-right" }))), this.showTextAsTooltip === true && hasAnyText(textOptions) && (h("ix-tooltip", { key: '9041af539fd29c6fd2e8e3e4a00daa8e2c15ed22', for: this.slotRef.waitForCurrent(), showDelay: 500, placement: "bottom" }, renderHelperText(textOptions)))));
45
+ }, ref: this.slotRef }, h("slot", { key: '206122b8896175febbb37f4c3c54a8e3555a46d5' })), h("div", { key: 'f238391284d847e62e76eb78e1f85863f60092a5', class: 'field-bottom' }, !this.showTextAsTooltip && renderHelperText(textOptions), h("div", { key: '55d56938344a710759252156997d528486b67e14', class: "bottom-right" }, h("slot", { key: 'bbc9255ddc0e95a6896a8d5ff0cd5f7146c434bf', name: "bottom-right" }))), this.showTextAsTooltip === true && hasAnyText(textOptions) && (h("ix-tooltip", { key: 'e50287d266f19646efe1b56a56ef9a5b11bd7fed', for: this.slotRef.waitForCurrent(), showDelay: 500, placement: "bottom" }, renderHelperText(textOptions)))));
46
46
  }
47
47
  static get is() { return "ix-field-wrapper"; }
48
48
  static get encapsulation() { return "shadow"; }
@@ -289,8 +289,8 @@ export class FieldWrapper {
289
289
  "type": "unknown",
290
290
  "mutable": false,
291
291
  "complexType": {
292
- "original": "MakeRef<HTMLElement>",
293
- "resolved": "{ (ref: HTMLElement): void; current: HTMLElement; waitForCurrent(): Promise<HTMLElement>; }",
292
+ "original": "| MakeRef<HTMLElement>\n | MakeRef<HTMLInputElement>\n | MakeRef<HTMLTextAreaElement>",
293
+ "resolved": "{ (ref: HTMLElement): void; current: HTMLElement; waitForCurrent(): Promise<HTMLElement>; } | { (ref: HTMLInputElement): void; current: HTMLInputElement; waitForCurrent(): Promise<HTMLInputElement>; } | { (ref: HTMLTextAreaElement): void; current: HTMLTextAreaElement; waitForCurrent(): Promise<HTMLTextAreaElement>; }",
294
294
  "references": {
295
295
  "MakeRef": {
296
296
  "location": "import",
@@ -300,6 +300,14 @@ export class FieldWrapper {
300
300
  "HTMLElement": {
301
301
  "location": "global",
302
302
  "id": "global::HTMLElement"
303
+ },
304
+ "HTMLInputElement": {
305
+ "location": "global",
306
+ "id": "global::HTMLInputElement"
307
+ },
308
+ "HTMLTextAreaElement": {
309
+ "location": "global",
310
+ "id": "global::HTMLTextAreaElement"
303
311
  }
304
312
  }
305
313
  },
@@ -1 +1 @@
1
- {"version":3,"file":"field-wrapper.js","sourceRoot":"","sources":["../../../src/components/field-wrapper/field-wrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,EAAW,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAElE,gBAAgB;AAMhB,MAAM,OAAO,YAAY;;QAyEN,YAAO,GAAG,OAAO,EAAkB,CAAC;;;;;;;yBArCxB,KAAK;uBAKP,KAAK;sBAKN,KAAK;yBAKF,KAAK;iCAKG,KAAK;wBAKd,KAAK;;;;IAcjC,MAAM;QACJ,MAAM,WAAW,GAAG;YAClB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;QACF,OAAO,CACL,EAAC,IAAI;YACF,IAAI,CAAC,KAAK,IAAI,CACb,4DAAK,KAAK,EAAC,WAAW;gBACpB,uEACE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,YAAY,EAC1B,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,SAAS,EAAE,IAAI,CAAC,SAAS,IAExB,IAAI,CAAC,KAAK,CACI,CACb,CACP;YACD,4DACE,KAAK,EAAE;oBACL,cAAc,EAAE,IAAI;iBACrB,EACD,GAAG,EAAE,IAAI,CAAC,OAAO;gBAEjB,8DAAa,CACT;YACN,4DAAK,KAAK,EAAE,cAAc;gBACvB,CAAC,IAAI,CAAC,iBAAiB,IAAI,gBAAgB,CAAC,WAAW,CAAC;gBACzD,4DAAK,KAAK,EAAC,cAAc;oBACvB,6DAAM,IAAI,EAAC,cAAc,GAAQ,CAC7B,CACF;YAEL,IAAI,CAAC,iBAAiB,KAAK,IAAI,IAAI,UAAU,CAAC,WAAW,CAAC,IAAI,CAC7D,mEACE,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAClC,SAAS,EAAE,GAAG,EACd,SAAS,EAAC,QAAQ,IAEjB,gBAAgB,CAAC,WAAW,CAAC,CACnB,CACd,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Component, Element, Host, Prop, h } from '@stencil/core';\nimport { FieldWrapperInterface } from '../utils/input';\nimport { MakeRef, makeRef } from '../utils/make-ref';\nimport { hasAnyText, renderHelperText } from './helper-text-util';\n\n/** @internal */\n@Component({\n tag: 'ix-field-wrapper',\n styleUrl: 'field-wrapper.scss',\n shadow: true,\n})\nexport class FieldWrapper implements FieldWrapperInterface {\n @Element() hostElement!: HTMLIxFieldWrapperElement;\n\n /**\n * Show text below the field component\n */\n @Prop() helperText?: string;\n\n /**\n * Label for the field component\n */\n @Prop() label?: string;\n\n /**\n * Error text for the field component\n */\n @Prop() invalidText?: string;\n\n /**\n * Valid text for the field component\n */\n @Prop() validText?: string;\n\n /**\n * Info text for the field component\n */\n @Prop() infoText?: string;\n\n /**\n * Warning text for the field component\n */\n @Prop() warningText?: string;\n\n /**\n * Is the field component invalid\n */\n @Prop() isInvalid: boolean = false;\n\n /**\n * Is the field component valid\n */\n @Prop() isValid: boolean = false;\n\n /**\n * Is the field component info\n */\n @Prop() isInfo: boolean = false;\n\n /**\n * Is the field component warning\n */\n @Prop() isWarning: boolean = false;\n\n /**\n * Show helper, error, info, warning text as tooltip\n */\n @Prop() showTextAsTooltip: boolean = false;\n\n /**\n * Show label as required\n */\n @Prop() required: boolean = false;\n\n /**\n * The id of the form element that the label is associated with\n */\n @Prop() htmlForLabel?: string;\n\n /**\n * The control element that the label is associated with\n */\n @Prop() controlRef?: MakeRef<HTMLElement>;\n\n private readonly slotRef = makeRef<HTMLDivElement>();\n\n render() {\n const textOptions = {\n invalidText: this.invalidText,\n isInvalid: this.isInvalid,\n isValid: this.isValid,\n validText: this.validText,\n isWarning: this.isWarning,\n warningText: this.warningText,\n isInfo: this.isInfo,\n infoText: this.infoText,\n helperText: this.helperText,\n };\n return (\n <Host>\n {this.label && (\n <div class=\"field-top\">\n <ix-field-label\n required={this.required}\n htmlFor={this.htmlForLabel}\n controlRef={this.controlRef}\n isInvalid={this.isInvalid}\n >\n {this.label}\n </ix-field-label>\n </div>\n )}\n <div\n class={{\n 'slot-wrapper': true,\n }}\n ref={this.slotRef}\n >\n <slot></slot>\n </div>\n <div class={'field-bottom'}>\n {!this.showTextAsTooltip && renderHelperText(textOptions)}\n <div class=\"bottom-right\">\n <slot name=\"bottom-right\"></slot>\n </div>\n </div>\n\n {this.showTextAsTooltip === true && hasAnyText(textOptions) && (\n <ix-tooltip\n for={this.slotRef.waitForCurrent()}\n showDelay={500}\n placement=\"bottom\"\n >\n {renderHelperText(textOptions)}\n </ix-tooltip>\n )}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"field-wrapper.js","sourceRoot":"","sources":["../../../src/components/field-wrapper/field-wrapper.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,EAAW,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAElE,gBAAgB;AAMhB,MAAM,OAAO,YAAY;;QA4EN,YAAO,GAAG,OAAO,EAAkB,CAAC;;;;;;;yBAxCxB,KAAK;uBAKP,KAAK;sBAKN,KAAK;yBAKF,KAAK;iCAKG,KAAK;wBAKd,KAAK;;;;IAiBjC,MAAM;QACJ,MAAM,WAAW,GAAG;YAClB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,UAAU,EAAE,IAAI,CAAC,UAAU;SAC5B,CAAC;QACF,OAAO,CACL,EAAC,IAAI;YACF,IAAI,CAAC,KAAK,IAAI,CACb,4DAAK,KAAK,EAAC,WAAW;gBACpB,uEACE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,YAAY,EAC1B,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,SAAS,EAAE,IAAI,CAAC,SAAS,IAExB,IAAI,CAAC,KAAK,CACI,CACb,CACP;YACD,4DACE,KAAK,EAAE;oBACL,cAAc,EAAE,IAAI;iBACrB,EACD,GAAG,EAAE,IAAI,CAAC,OAAO;gBAEjB,8DAAa,CACT;YACN,4DAAK,KAAK,EAAE,cAAc;gBACvB,CAAC,IAAI,CAAC,iBAAiB,IAAI,gBAAgB,CAAC,WAAW,CAAC;gBACzD,4DAAK,KAAK,EAAC,cAAc;oBACvB,6DAAM,IAAI,EAAC,cAAc,GAAQ,CAC7B,CACF;YAEL,IAAI,CAAC,iBAAiB,KAAK,IAAI,IAAI,UAAU,CAAC,WAAW,CAAC,IAAI,CAC7D,mEACE,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAClC,SAAS,EAAE,GAAG,EACd,SAAS,EAAC,QAAQ,IAEjB,gBAAgB,CAAC,WAAW,CAAC,CACnB,CACd,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Component, Element, Host, Prop, h } from '@stencil/core';\nimport { FieldWrapperInterface } from '../utils/input';\nimport { MakeRef, makeRef } from '../utils/make-ref';\nimport { hasAnyText, renderHelperText } from './helper-text-util';\n\n/** @internal */\n@Component({\n tag: 'ix-field-wrapper',\n styleUrl: 'field-wrapper.scss',\n shadow: true,\n})\nexport class FieldWrapper implements FieldWrapperInterface {\n @Element() hostElement!: HTMLIxFieldWrapperElement;\n\n /**\n * Show text below the field component\n */\n @Prop() helperText?: string;\n\n /**\n * Label for the field component\n */\n @Prop() label?: string;\n\n /**\n * Error text for the field component\n */\n @Prop() invalidText?: string;\n\n /**\n * Valid text for the field component\n */\n @Prop() validText?: string;\n\n /**\n * Info text for the field component\n */\n @Prop() infoText?: string;\n\n /**\n * Warning text for the field component\n */\n @Prop() warningText?: string;\n\n /**\n * Is the field component invalid\n */\n @Prop() isInvalid: boolean = false;\n\n /**\n * Is the field component valid\n */\n @Prop() isValid: boolean = false;\n\n /**\n * Is the field component info\n */\n @Prop() isInfo: boolean = false;\n\n /**\n * Is the field component warning\n */\n @Prop() isWarning: boolean = false;\n\n /**\n * Show helper, error, info, warning text as tooltip\n */\n @Prop() showTextAsTooltip: boolean = false;\n\n /**\n * Show label as required\n */\n @Prop() required: boolean = false;\n\n /**\n * The id of the form element that the label is associated with\n */\n @Prop() htmlForLabel?: string;\n\n /**\n * The control element that the label is associated with\n */\n @Prop() controlRef?:\n | MakeRef<HTMLElement>\n | MakeRef<HTMLInputElement>\n | MakeRef<HTMLTextAreaElement>;\n\n private readonly slotRef = makeRef<HTMLDivElement>();\n\n render() {\n const textOptions = {\n invalidText: this.invalidText,\n isInvalid: this.isInvalid,\n isValid: this.isValid,\n validText: this.validText,\n isWarning: this.isWarning,\n warningText: this.warningText,\n isInfo: this.isInfo,\n infoText: this.infoText,\n helperText: this.helperText,\n };\n return (\n <Host>\n {this.label && (\n <div class=\"field-top\">\n <ix-field-label\n required={this.required}\n htmlFor={this.htmlForLabel}\n controlRef={this.controlRef}\n isInvalid={this.isInvalid}\n >\n {this.label}\n </ix-field-label>\n </div>\n )}\n <div\n class={{\n 'slot-wrapper': true,\n }}\n ref={this.slotRef}\n >\n <slot></slot>\n </div>\n <div class={'field-bottom'}>\n {!this.showTextAsTooltip && renderHelperText(textOptions)}\n <div class=\"bottom-right\">\n <slot name=\"bottom-right\"></slot>\n </div>\n </div>\n\n {this.showTextAsTooltip === true && hasAnyText(textOptions) && (\n <ix-tooltip\n for={this.slotRef.waitForCurrent()}\n showDelay={500}\n placement=\"bottom\"\n >\n {renderHelperText(textOptions)}\n </ix-tooltip>\n )}\n </Host>\n );\n }\n}\n"]}
@@ -10,12 +10,10 @@ import { h } from "@stencil/core";
10
10
  export function TextareaElement(props) {
11
11
  return (h("textarea", Object.assign({ readOnly: props.readonly, disabled: props.disabled, maxLength: props.maxLength, minLength: props.minLength, cols: props.textareaCols, rows: props.textareaRows, ref: props.textAreaRef, class: {
12
12
  'is-invalid': props.isInvalid,
13
- }, required: props.required, value: props.value, placeholder: props.placeholder, onChange: (changeEvent) => {
14
- const target = changeEvent.target;
15
- props.valueChange(target.value);
16
- }, onInput: (inputEvent) => {
13
+ }, required: props.required, value: props.value, placeholder: props.placeholder, onInput: (inputEvent) => {
17
14
  const target = inputEvent.target;
18
15
  props.updateFormInternalValue(target.value);
16
+ props.valueChange(target.value);
19
17
  }, onBlur: () => props.onBlur(), style: {
20
18
  resize: props.resizeBehavior,
21
19
  height: props.textareaHeight,
@@ -25,12 +23,10 @@ export function TextareaElement(props) {
25
23
  export function InputElement(props) {
26
24
  return (h("input", Object.assign({ id: props.id, autoComplete: "off", readOnly: props.readonly, disabled: props.disabled, min: props.min, max: props.max, maxLength: props.maxLength ? Number(props.maxLength) : undefined, minLength: props.maxLength ? Number(props.minLength) : undefined, ref: props.inputRef, pattern: props.pattern, type: props.type, class: {
27
25
  'is-invalid': props.isInvalid,
28
- }, required: props.required, value: props.value, placeholder: props.placeholder, onKeyPress: (event) => props.onKeyPress(event), onChange: (changeEvent) => {
29
- const target = changeEvent.target;
30
- props.valueChange(target.value);
31
- }, onInput: (inputEvent) => {
26
+ }, required: props.required, value: props.value, placeholder: props.placeholder, onKeyPress: (event) => props.onKeyPress(event), onInput: (inputEvent) => {
32
27
  const target = inputEvent.target;
33
28
  props.updateFormInternalValue(target.value);
29
+ props.valueChange(target.value);
34
30
  }, onBlur: () => props.onBlur() }, props.ariaAttributes)));
35
31
  }
36
32
  export const SlotEnd = (props, children) => {
@@ -1 +1 @@
1
- {"version":3,"file":"input.fc.js","sourceRoot":"","sources":["../../../src/components/input/input.fc.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAuB,MAAM,eAAe,CAAC;AAIvD,MAAM,UAAU,eAAe,CAAC,KAmB/B;IACC,OAAO,CACL,8BACE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,IAAI,EAAE,KAAK,CAAC,YAAY,EACxB,IAAI,EAAE,KAAK,CAAC,YAAY,EACxB,GAAG,EAAE,KAAK,CAAC,WAAW,EACtB,KAAK,EAAE;YACL,YAAY,EAAE,KAAK,CAAC,SAAS;SAC9B,EACD,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,QAAQ,EAAE,CAAC,WAAW,EAAE,EAAE;YACxB,MAAM,MAAM,GAAG,WAAW,CAAC,MAA0B,CAAC;YACtD,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC,EACD,OAAO,EAAE,CAAC,UAAU,EAAE,EAAE;YACtB,MAAM,MAAM,GAAG,UAAU,CAAC,MAA0B,CAAC;YACrD,KAAK,CAAC,uBAAuB,CAAC,MAAM,CAAC,KAAK,CAAC,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AW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC,EACD,OAAO,EAAE,CAAC,UAAU,EAAE,EAAE;YACtB,MAAM,MAAM,GAAG,UAAU,CAAC,MAA0B,CAAC;YACrD,KAAK,CAAC,uBAAuB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9C,CAAC,EACD,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,IACxB,KAAK,CAAC,cAAc,EACjB,CACV,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAGf,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;IACvB,OAAO,CACL,WAAK,KAAK,EAAC,eAAe,EAAC,GAAG,EAAE,KAAK,CAAC,UAAU;QAC9C,YAAM,IAAI,EAAC,KAAK,EAAC,YAAY,EAAE,KAAK,CAAC,YAAY,GAAS;QACzD,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAGjB,CAAC,KAAK,EAAE,EAAE;IACb,OAAO,CACL,WAAK,KAAK,EAAC,iBAAiB,EAAC,GAAG,EAAE,KAAK,CAAC,YAAY;QAClD,YAAM,IAAI,EAAC,OAAO,EAAC,YAAY,EAAE,KAAK,CAAC,YAAY,GAAS,CACxD,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { h, FunctionalComponent } from '@stencil/core';\nimport { MakeRef } from '../utils/make-ref';\nimport { A11yAttributes } from '../utils/a11y';\n\nexport function TextareaElement(props: {\n resizeBehavior: 'both' | 'horizontal' | 'vertical' | 'none';\n textareaHeight?: string;\n textareaWidth?: string;\n textareaRows?: number;\n textareaCols?: number;\n disabled: boolean;\n readonly: boolean;\n maxLength?: number;\n minLength?: number;\n isInvalid: boolean;\n required: boolean;\n value: string;\n placeholder?: string;\n textAreaRef: (el: HTMLTextAreaElement | undefined) => void;\n valueChange: (value: string) => void;\n updateFormInternalValue: (value: string) => void;\n onBlur: () => void;\n ariaAttributes?: A11yAttributes;\n}) {\n return (\n <textarea\n readOnly={props.readonly}\n disabled={props.disabled}\n maxLength={props.maxLength}\n minLength={props.minLength}\n cols={props.textareaCols}\n rows={props.textareaRows}\n ref={props.textAreaRef}\n class={{\n 'is-invalid': props.isInvalid,\n }}\n required={props.required}\n value={props.value}\n placeholder={props.placeholder}\n onChange={(changeEvent) => {\n const target = changeEvent.target as HTMLInputElement;\n props.valueChange(target.value);\n }}\n onInput={(inputEvent) => {\n const target = inputEvent.target as HTMLInputElement;\n props.updateFormInternalValue(target.value);\n }}\n onBlur={() => props.onBlur()}\n style={{\n resize: props.resizeBehavior,\n height: props.textareaHeight,\n width: props.textareaWidth,\n }}\n {...props.ariaAttributes}\n ></textarea>\n );\n}\n\nexport function InputElement(props: {\n id: string;\n disabled: boolean;\n readonly: boolean;\n maxLength?: string | number;\n minLength?: string | number;\n max?: string | number;\n min?: string | number;\n pattern?: string;\n type: string;\n isInvalid: boolean;\n required: boolean;\n value: string | number;\n placeholder?: string;\n inputRef: (el: HTMLInputElement | undefined) => void;\n onKeyPress: (event: KeyboardEvent) => void;\n valueChange: (value: string) => void;\n updateFormInternalValue: (value: string) => void;\n onBlur: () => void;\n ariaAttributes?: A11yAttributes;\n}) {\n return (\n <input\n id={props.id}\n autoComplete=\"off\"\n readOnly={props.readonly}\n disabled={props.disabled}\n min={props.min}\n max={props.max}\n maxLength={props.maxLength ? Number(props.maxLength) : undefined}\n minLength={props.maxLength ? Number(props.minLength) : undefined}\n ref={props.inputRef}\n pattern={props.pattern}\n type={props.type}\n class={{\n 'is-invalid': props.isInvalid,\n }}\n required={props.required}\n value={props.value}\n placeholder={props.placeholder}\n onKeyPress={(event) => props.onKeyPress(event)}\n onChange={(changeEvent) => {\n const target = changeEvent.target as HTMLInputElement;\n props.valueChange(target.value);\n }}\n onInput={(inputEvent) => {\n const target = inputEvent.target as HTMLInputElement;\n props.updateFormInternalValue(target.value);\n }}\n onBlur={() => props.onBlur()}\n {...props.ariaAttributes}\n ></input>\n );\n}\n\nexport const SlotEnd: FunctionalComponent<{\n slotEndRef: MakeRef<HTMLDivElement>;\n onSlotChange?: (e: Event) => void;\n}> = (props, children) => {\n return (\n <div class=\"end-container\" ref={props.slotEndRef}>\n <slot name=\"end\" onSlotchange={props.onSlotChange}></slot>\n {children}\n </div>\n );\n};\n\nexport const SlotStart: FunctionalComponent<{\n slotStartRef: MakeRef<HTMLDivElement>;\n onSlotChange?: (e: Event) => void;\n}> = (props) => {\n return (\n <div class=\"start-container\" ref={props.slotStartRef}>\n <slot name=\"start\" onSlotchange={props.onSlotChange}></slot>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"input.fc.js","sourceRoot":"","sources":["../../../src/components/input/input.fc.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAuB,MAAM,eAAe,CAAC;AAIvD,MAAM,UAAU,eAAe,CAAC,KAmB/B;IACC,OAAO,CACL,8BACE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,IAAI,EAAE,KAAK,CAAC,YAAY,EACxB,IAAI,EAAE,KAAK,CAAC,YAAY,EACxB,GAAG,EAAE,KAAK,CAAC,WAAW,EACtB,KAAK,EAAE;YACL,YAAY,EAAE,KAAK,CAAC,SAAS;SAC9B,EACD,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,OAAO,EAAE,CAAC,UAAU,EAAE,EAAE;YACtB,MAAM,MAAM,GAAG,UAAU,CAAC,M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C,KAAK,CAAC,EAC9C,OAAO,EAAE,CAAC,UAAU,EAAE,EAAE;YACtB,MAAM,MAAM,GAAG,UAAU,CAAC,MAA0B,CAAC;YACrD,KAAK,CAAC,uBAAuB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5C,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAClC,CAAC,EACD,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,IACxB,KAAK,CAAC,cAAc,EACjB,CACV,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAGf,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;IACvB,OAAO,CACL,WAAK,KAAK,EAAC,eAAe,EAAC,GAAG,EAAE,KAAK,CAAC,UAAU;QAC9C,YAAM,IAAI,EAAC,KAAK,EAAC,YAAY,EAAE,KAAK,CAAC,YAAY,GAAS;QACzD,QAAQ,CACL,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAGjB,CAAC,KAAK,EAAE,EAAE;IACb,OAAO,CACL,WAAK,KAAK,EAAC,iBAAiB,EAAC,GAAG,EAAE,KAAK,CAAC,YAAY;QAClD,YAAM,IAAI,EAAC,OAAO,EAAC,YAAY,EAAE,KAAK,CAAC,YAAY,GAAS,CACxD,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { h, FunctionalComponent } from '@stencil/core';\nimport { MakeRef } from '../utils/make-ref';\nimport { A11yAttributes } from '../utils/a11y';\n\nexport function TextareaElement(props: {\n resizeBehavior: 'both' | 'horizontal' | 'vertical' | 'none';\n textareaHeight?: string;\n textareaWidth?: string;\n textareaRows?: number;\n textareaCols?: number;\n disabled: boolean;\n readonly: boolean;\n maxLength?: number;\n minLength?: number;\n isInvalid: boolean;\n required: boolean;\n value: string;\n placeholder?: string;\n textAreaRef: (el: HTMLTextAreaElement | undefined) => void;\n valueChange: (value: string) => void;\n updateFormInternalValue: (value: string) => void;\n onBlur: () => void;\n ariaAttributes?: A11yAttributes;\n}) {\n return (\n <textarea\n readOnly={props.readonly}\n disabled={props.disabled}\n maxLength={props.maxLength}\n minLength={props.minLength}\n cols={props.textareaCols}\n rows={props.textareaRows}\n ref={props.textAreaRef}\n class={{\n 'is-invalid': props.isInvalid,\n }}\n required={props.required}\n value={props.value}\n placeholder={props.placeholder}\n onInput={(inputEvent) => {\n const target = inputEvent.target as HTMLInputElement;\n props.updateFormInternalValue(target.value);\n props.valueChange(target.value);\n }}\n onBlur={() => props.onBlur()}\n style={{\n resize: props.resizeBehavior,\n height: props.textareaHeight,\n width: props.textareaWidth,\n }}\n {...props.ariaAttributes}\n ></textarea>\n );\n}\n\nexport function InputElement(props: {\n id: string;\n disabled: boolean;\n readonly: boolean;\n maxLength?: string | number;\n minLength?: string | number;\n max?: string | number;\n min?: string | number;\n pattern?: string;\n type: string;\n isInvalid: boolean;\n required: boolean;\n value: string | number;\n placeholder?: string;\n inputRef: (el: HTMLInputElement | undefined) => void;\n onKeyPress: (event: KeyboardEvent) => void;\n valueChange: (value: string) => void;\n updateFormInternalValue: (value: string) => void;\n onBlur: () => void;\n ariaAttributes?: A11yAttributes;\n}) {\n return (\n <input\n id={props.id}\n autoComplete=\"off\"\n readOnly={props.readonly}\n disabled={props.disabled}\n min={props.min}\n max={props.max}\n maxLength={props.maxLength ? Number(props.maxLength) : undefined}\n minLength={props.maxLength ? Number(props.minLength) : undefined}\n ref={props.inputRef}\n pattern={props.pattern}\n type={props.type}\n class={{\n 'is-invalid': props.isInvalid,\n }}\n required={props.required}\n value={props.value}\n placeholder={props.placeholder}\n onKeyPress={(event) => props.onKeyPress(event)}\n onInput={(inputEvent) => {\n const target = inputEvent.target as HTMLInputElement;\n props.updateFormInternalValue(target.value);\n props.valueChange(target.value);\n }}\n onBlur={() => props.onBlur()}\n {...props.ariaAttributes}\n ></input>\n );\n}\n\nexport const SlotEnd: FunctionalComponent<{\n slotEndRef: MakeRef<HTMLDivElement>;\n onSlotChange?: (e: Event) => void;\n}> = (props, children) => {\n return (\n <div class=\"end-container\" ref={props.slotEndRef}>\n <slot name=\"end\" onSlotchange={props.onSlotChange}></slot>\n {children}\n </div>\n );\n};\n\nexport const SlotStart: FunctionalComponent<{\n slotStartRef: MakeRef<HTMLDivElement>;\n onSlotChange?: (e: Event) => void;\n}> = (props) => {\n return (\n <div class=\"start-container\" ref={props.slotStartRef}>\n <slot name=\"start\" onSlotchange={props.onSlotChange}></slot>\n </div>\n );\n};\n"]}
@@ -26,6 +26,8 @@ let inputIds = 0;
26
26
  /**
27
27
  * @since 2.6.0
28
28
  * @form-ready 2.6.0
29
+ * @slot start - Element will be displayed at the start of the input
30
+ * @slot end - Element will be displayed at the end of the input
29
31
  */
30
32
  export class Input {
31
33
  constructor() {
@@ -101,10 +103,10 @@ export class Input {
101
103
  render() {
102
104
  var _a;
103
105
  const inputAria = getAriaAttributesForInput(this);
104
- return (h(Host, { key: '842ff9fc4e182372da40d4bcb4f89653fc1c90fd', class: {
106
+ return (h(Host, { key: 'f625dc7d2ed058f53940ccda73db408a3d7017a5', class: {
105
107
  disabled: this.disabled,
106
108
  readonly: this.readonly,
107
- } }, h("ix-field-wrapper", { key: '3614d6006a3c55191f6fce25c70c1383b46fec0b', htmlForLabel: this.inputId, required: this.required, label: this.label, helperText: this.helperText, invalidText: this.invalidText, infoText: this.infoText, warningText: this.warningText, validText: this.validText, showTextAsTooltip: this.showTextAsTooltip, isInvalid: this.isInvalid, isValid: this.isValid, isInfo: this.isInfo, isWarning: this.isWarning, controlRef: this.inputRef }, h("div", { key: '71ba199ce76ca1ac0135a403827e47aec4c88977', class: "input-wrapper" }, h(SlotStart, { key: 'f6a8ea82539d59e475e6e62d498ea7150de90506', slotStartRef: this.slotStartRef, onSlotChange: () => this.updatePaddings() }), h(InputElement, { key: '4c4ff361edcf9d5b780825142ba64bee79531153', id: this.inputId, readonly: this.readonly, disabled: this.disabled, maxLength: this.maxLength, minLength: this.minLength, pattern: this.pattern, type: this.inputType, isInvalid: this.isInvalid, required: this.required, value: this.value, placeholder: this.placeholder, inputRef: this.inputRef, onKeyPress: (event) => checkAllowedKeys(this, event), valueChange: (value) => this.valueChange.emit(value), updateFormInternalValue: (value) => this.updateFormInternalValue(value), onBlur: () => onInputBlur(this, this.inputRef.current), ariaAttributes: inputAria }), h(SlotEnd, { key: '9b0dab754362fbe7abf36c505209da7063490a52', slotEndRef: this.slotEndRef, onSlotChange: () => this.updatePaddings() }, h("ix-icon-button", { key: '6003d03e3d8efd967c932fc05e2270f83a102ae4', color: "color-weak-text", class: {
109
+ } }, h("ix-field-wrapper", { key: 'c018215d637253e021247473c35701ff94d3f028', htmlForLabel: this.inputId, required: this.required, label: this.label, helperText: this.helperText, invalidText: this.invalidText, infoText: this.infoText, warningText: this.warningText, validText: this.validText, showTextAsTooltip: this.showTextAsTooltip, isInvalid: this.isInvalid, isValid: this.isValid, isInfo: this.isInfo, isWarning: this.isWarning, controlRef: this.inputRef }, h("div", { key: 'cc9ee3d23a14d0e10351f294fae72aeec82fbf64', class: "input-wrapper" }, h(SlotStart, { key: 'f32e50c55492dc1423b91f05209c1e9914b50f28', slotStartRef: this.slotStartRef, onSlotChange: () => this.updatePaddings() }), h(InputElement, { key: 'ca17d2fee580dbe2e8d176018d0e55565bef5f33', id: this.inputId, readonly: this.readonly, disabled: this.disabled, maxLength: this.maxLength, minLength: this.minLength, pattern: this.pattern, type: this.inputType, isInvalid: this.isInvalid, required: this.required, value: this.value, placeholder: this.placeholder, inputRef: this.inputRef, onKeyPress: (event) => checkAllowedKeys(this, event), valueChange: (value) => this.valueChange.emit(value), updateFormInternalValue: (value) => this.updateFormInternalValue(value), onBlur: () => onInputBlur(this, this.inputRef.current), ariaAttributes: inputAria }), h(SlotEnd, { key: '5664747770d85defa36d460b4aa3e497a802bca2', slotEndRef: this.slotEndRef, onSlotChange: () => this.updatePaddings() }, h("ix-icon-button", { key: 'f680b65ba0355746be49646d25a2074cc4a9caac', color: "color-weak-text", class: {
108
110
  'password-eye': true,
109
111
  'eye-hidden': this.type !== 'password',
110
112
  }, ghost: true, icon: this.inputType === 'password' ? iconEye : iconEyeCancelled, onClick: () => {
@@ -113,7 +115,7 @@ export class Input {
113
115
  return;
114
116
  }
115
117
  this.inputType = 'password';
116
- } }))), !!this.maxLength && this.maxLength > 0 && (h("ix-typography", { key: 'ecb767e15d688a8f93237a2572fcdf2343c087c6', class: "bottom-text", slot: "bottom-right", color: "soft" }, (_a = this.value) === null || _a === void 0 ? void 0 :
118
+ } }))), !!this.maxLength && this.maxLength > 0 && (h("ix-typography", { key: 'baa09803b87cd3efce3cce29cb735b5d0a290832', class: "bottom-text", slot: "bottom-right", color: "soft" }, (_a = this.value) === null || _a === void 0 ? void 0 :
117
119
  _a.length, "/", this.maxLength)))));
118
120
  }
119
121
  static get is() { return "ix-input"; }
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;;;;;;AAEH,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EACL,eAAe,EACf,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,CAAC,GACF,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,GAGxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAW,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,EAChB,yBAAyB,EACzB,mBAAmB,EACnB,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,IAAI,CAAC,SAAS,KAAK,UAAU,EAAE,CAAC;oCAClC,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC;oCACxB,OAAO;gCACT,CAAC;gCAED,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;4BAC9B,CAAC,GACe,CACV,CACN;gBACL,CAAC,CAAC,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CACzC,sEAAe,KAAK,EAAC,aAAa,EAAC,IAAI,EAAC,cAAc,EAAC,KAAK,EAAC,MAAM,IAChE,MAAA,IAAI,CAAC,KAAK;uBAAE,MAAM;;oBAAG,IAAI,CAAC,SAAS,CACtB,CACjB,CACgB,CACd,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAhJC;IADC,uBAAuB,EAAE;gDAGzB","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { iconEye, iconEyeCancelled } from '@siemens/ix-icons/icons';\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n} from '@stencil/core';\nimport { A11yAttributes } from '../utils/a11y';\nimport {\n HookValidationLifecycle,\n IxInputFieldComponent,\n ValidationResults,\n} from '../utils/input';\nimport { MakeRef, makeRef } from '../utils/make-ref';\nimport { InputElement, SlotEnd, SlotStart } from './input.fc';\nimport {\n adjustPaddingForStartAndEnd,\n checkAllowedKeys,\n getAriaAttributesForInput,\n mapValidationResult,\n onInputBlur,\n} from './input.util';\n\nlet inputIds = 0;\n\n/**\n * @since 2.6.0\n * @form-ready 2.6.0\n */\n@Component({\n tag: 'ix-input',\n styleUrl: 'input.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Input implements IxInputFieldComponent<string> {\n @Element() hostElement!: HTMLIxInputElement;\n @AttachInternals() formInternals!: ElementInternals;\n\n /**\n * The type of the text field. Possible values are 'text', 'email', or 'password'.\n */\n @Prop() type: 'text' | 'email' | 'password' | 'tel' | 'url' = 'text';\n\n /**\n * The name of the text field.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The placeholder text for the text field.\n */\n @Prop({ reflect: true }) placeholder?: string;\n\n /**\n * The value of the text field.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * Specifies whether the text field is required.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Specifies whether the text field is disabled.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * Specifies whether the text field is readonly.\n */\n @Prop({ reflect: true }) readonly: boolean = false;\n\n /**\n * The helper text for the text field.\n */\n @Prop() helperText?: string;\n\n /**\n * The info text for the text field.\n */\n @Prop() infoText?: string;\n\n /**\n * Specifies whether to show the text as a tooltip.\n */\n @Prop() showTextAsTooltip?: boolean;\n\n /**\n * The valid text for the text field.\n */\n @Prop() validText?: string;\n\n /**\n * The warning text for the text field.\n */\n @Prop() warningText?: string;\n\n /**\n * The label for the text field.\n */\n @Prop({ reflect: true }) label?: string;\n\n /**\n * The error text for the text field.\n */\n @Prop() invalidText?: string;\n\n /**\n * The pattern for the text field.\n */\n @Prop() pattern?: string;\n\n /**\n * The maximum length of the text field.\n */\n @Prop() maxLength?: number;\n\n /**\n * The minimum length of the text field.\n */\n @Prop() minLength?: number;\n\n /**\n * The allowed characters pattern for the text field.\n */\n @Prop() allowedCharactersPattern?: string;\n\n /**\n * Event emitted when the value of the text field changes.\n */\n @Event() valueChange!: EventEmitter<string>;\n\n /**\n * Event emitted when the validity state of the text field changes.\n */\n @Event() validityStateChange!: EventEmitter<ValidityState>;\n\n /**\n * Event emitted when the text field loses focus.\n */\n @Event() ixBlur!: EventEmitter<void>;\n\n @State() isInvalid = false;\n @State() isValid = false;\n @State() isInfo = false;\n @State() isWarning = false;\n @State() isInvalidByRequired = false;\n\n @State() inputType = 'text';\n\n private readonly inputRef = makeRef<HTMLInputElement>();\n private readonly slotEndRef = makeRef<HTMLDivElement>();\n private readonly slotStartRef = makeRef<HTMLDivElement>();\n\n private readonly inputId = `input-${inputIds++}`;\n\n @HookValidationLifecycle()\n updateClassMappings(result: ValidationResults) {\n mapValidationResult(this, result);\n }\n\n @Watch('type')\n updateInputType() {\n this.inputType = this.type;\n }\n\n componentWillLoad() {\n this.updateFormInternalValue(this.value);\n this.inputType = this.type;\n }\n\n componentDidRender() {\n this.updatePaddings();\n }\n\n private updatePaddings() {\n adjustPaddingForStartAndEnd(\n this.slotStartRef.current,\n this.slotEndRef.current,\n this.inputRef.current\n );\n }\n\n updateFormInternalValue(value: string) {\n this.formInternals.setFormValue(value);\n this.value = value;\n }\n\n /** @internal */\n @Method()\n async getAssociatedFormElement(): Promise<HTMLFormElement | null> {\n return this.formInternals.form;\n }\n\n /** @internal */\n @Method()\n hasValidValue(): Promise<boolean> {\n return Promise.resolve(!!this.value);\n }\n\n /**\n * Returns the native input element used in the text field.\n */\n @Method()\n getNativeInputElement() {\n return this.inputRef.waitForCurrent();\n }\n\n /**\n * Focuses the input field\n */\n @Method()\n async focusInput(): Promise<void> {\n return (await this.getNativeInputElement()).focus();\n }\n\n render() {\n const inputAria: A11yAttributes = getAriaAttributesForInput(this);\n return (\n <Host\n class={{\n disabled: this.disabled,\n readonly: this.readonly,\n }}\n >\n <ix-field-wrapper\n htmlForLabel={this.inputId}\n required={this.required}\n label={this.label}\n helperText={this.helperText}\n invalidText={this.invalidText}\n infoText={this.infoText}\n warningText={this.warningText}\n validText={this.validText}\n showTextAsTooltip={this.showTextAsTooltip}\n isInvalid={this.isInvalid}\n isValid={this.isValid}\n isInfo={this.isInfo}\n isWarning={this.isWarning}\n controlRef={this.inputRef as unknown as MakeRef<HTMLElement>}\n >\n <div class=\"input-wrapper\">\n <SlotStart\n slotStartRef={this.slotStartRef}\n onSlotChange={() => this.updatePaddings()}\n ></SlotStart>\n <InputElement\n id={this.inputId}\n readonly={this.readonly}\n disabled={this.disabled}\n maxLength={this.maxLength}\n minLength={this.minLength}\n pattern={this.pattern}\n type={this.inputType}\n isInvalid={this.isInvalid}\n required={this.required}\n value={this.value}\n placeholder={this.placeholder}\n inputRef={this.inputRef}\n onKeyPress={(event) => checkAllowedKeys(this, event)}\n valueChange={(value) => this.valueChange.emit(value)}\n updateFormInternalValue={(value) =>\n this.updateFormInternalValue(value)\n }\n onBlur={() => onInputBlur(this, this.inputRef.current)}\n ariaAttributes={inputAria}\n ></InputElement>\n <SlotEnd\n slotEndRef={this.slotEndRef}\n onSlotChange={() => this.updatePaddings()}\n >\n <ix-icon-button\n color=\"color-weak-text\"\n class={{\n 'password-eye': true,\n 'eye-hidden': this.type !== 'password',\n }}\n ghost\n icon={\n this.inputType === 'password' ? iconEye : iconEyeCancelled\n }\n onClick={() => {\n if (this.inputType === 'password') {\n this.inputType = 'text';\n return;\n }\n\n this.inputType = 'password';\n }}\n ></ix-icon-button>\n </SlotEnd>\n </div>\n {!!this.maxLength && this.maxLength > 0 && (\n <ix-typography class=\"bottom-text\" slot=\"bottom-right\" color=\"soft\">\n {this.value?.length}/{this.maxLength}\n </ix-typography>\n )}\n </ix-field-wrapper>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;;;;;;AAEH,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EACL,eAAe,EACf,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,KAAK,EACL,CAAC,GACF,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,GAGxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EACL,2BAA2B,EAC3B,gBAAgB,EAChB,yBAAyB,EACzB,mBAAmB,EACnB,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,IAAI,QAAQ,GAAG,CAAC,CAAC;AAEjB;;;;;GAKG;AAOH,MAAM,OAAO,KAAK;;QAqHC,aAAQ,GAAG,OAAO,EAAoB,CAAC;QACvC,eAAU,GAAG,OAAO,EAAkB,CAAC;QACvC,iBAAY,GAAG,OAAO,EAAkB,CAAC;QAEzC,YAAO,GAAG,SAAS,QAAQ,EAAE,EAAE,CAAC;oBAlHa,MAAM;;;qBAeZ,EAAE;wBAKb,KAAK;wBAKL,KAAK;wBAKL,KAAK;;;;;;;;;;;;yBAwE7B,KAAK;uBACP,KAAK;sBACN,KAAK;yBACF,KAAK;mCACK,KAAK;yBAEf,MAAM;;IAS3B,mBAAmB,CAAC,MAAyB;QAC3C,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;IAGD,eAAe;QACb,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAhJC;IADC,uBAAuB,EAAE;gDAGzB","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { iconEye, iconEyeCancelled } from '@siemens/ix-icons/icons';\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n Watch,\n h,\n} from '@stencil/core';\nimport { A11yAttributes } from '../utils/a11y';\nimport {\n HookValidationLifecycle,\n IxInputFieldComponent,\n ValidationResults,\n} from '../utils/input';\nimport { makeRef } from '../utils/make-ref';\nimport { InputElement, SlotEnd, SlotStart } from './input.fc';\nimport {\n adjustPaddingForStartAndEnd,\n checkAllowedKeys,\n getAriaAttributesForInput,\n mapValidationResult,\n onInputBlur,\n} from './input.util';\n\nlet inputIds = 0;\n\n/**\n * @since 2.6.0\n * @form-ready 2.6.0\n * @slot start - Element will be displayed at the start of the input\n * @slot end - Element will be displayed at the end of the input\n */\n@Component({\n tag: 'ix-input',\n styleUrl: 'input.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Input implements IxInputFieldComponent<string> {\n @Element() hostElement!: HTMLIxInputElement;\n @AttachInternals() formInternals!: ElementInternals;\n\n /**\n * The type of the text field. Possible values are 'text', 'email', or 'password'.\n */\n @Prop() type: 'text' | 'email' | 'password' | 'tel' | 'url' = 'text';\n\n /**\n * The name of the text field.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The placeholder text for the text field.\n */\n @Prop({ reflect: true }) placeholder?: string;\n\n /**\n * The value of the text field.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * Specifies whether the text field is required.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Specifies whether the text field is disabled.\n */\n @Prop({ reflect: true }) disabled: boolean = false;\n\n /**\n * Specifies whether the text field is readonly.\n */\n @Prop({ reflect: true }) readonly: boolean = false;\n\n /**\n * The helper text for the text field.\n */\n @Prop() helperText?: string;\n\n /**\n * The info text for the text field.\n */\n @Prop() infoText?: string;\n\n /**\n * Specifies whether to show the text as a tooltip.\n */\n @Prop() showTextAsTooltip?: boolean;\n\n /**\n * The valid text for the text field.\n */\n @Prop() validText?: string;\n\n /**\n * The warning text for the text field.\n */\n @Prop() warningText?: string;\n\n /**\n * The label for the text field.\n */\n @Prop({ reflect: true }) label?: string;\n\n /**\n * The error text for the text field.\n */\n @Prop() invalidText?: string;\n\n /**\n * The pattern for the text field.\n */\n @Prop() pattern?: string;\n\n /**\n * The maximum length of the text field.\n */\n @Prop() maxLength?: number;\n\n /**\n * The minimum length of the text field.\n */\n @Prop() minLength?: number;\n\n /**\n * The allowed characters pattern for the text field.\n */\n @Prop() allowedCharactersPattern?: string;\n\n /**\n * Event emitted when the value of the text field changes.\n */\n @Event() valueChange!: EventEmitter<string>;\n\n /**\n * Event emitted when the validity state of the text field changes.\n */\n @Event() validityStateChange!: EventEmitter<ValidityState>;\n\n /**\n * Event emitted when the text field loses focus.\n */\n @Event() ixBlur!: EventEmitter<void>;\n\n @State() isInvalid = false;\n @State() isValid = false;\n @State() isInfo = false;\n @State() isWarning = false;\n @State() isInvalidByRequired = false;\n\n @State() inputType = 'text';\n\n private readonly inputRef = makeRef<HTMLInputElement>();\n private readonly slotEndRef = makeRef<HTMLDivElement>();\n private readonly slotStartRef = makeRef<HTMLDivElement>();\n\n private readonly inputId = `input-${inputIds++}`;\n\n @HookValidationLifecycle()\n updateClassMappings(result: ValidationResults) {\n mapValidationResult(this, result);\n }\n\n @Watch('type')\n updateInputType() {\n this.inputType = this.type;\n }\n\n componentWillLoad() {\n this.updateFormInternalValue(this.value);\n this.inputType = this.type;\n }\n\n componentDidRender() {\n this.updatePaddings();\n }\n\n private updatePaddings() {\n adjustPaddingForStartAndEnd(\n this.slotStartRef.current,\n this.slotEndRef.current,\n this.inputRef.current\n );\n }\n\n updateFormInternalValue(value: string) {\n this.formInternals.setFormValue(value);\n this.value = value;\n }\n\n /** @internal */\n @Method()\n async getAssociatedFormElement(): Promise<HTMLFormElement | null> {\n return this.formInternals.form;\n }\n\n /** @internal */\n @Method()\n hasValidValue(): Promise<boolean> {\n return Promise.resolve(!!this.value);\n }\n\n /**\n * Returns the native input element used in the text field.\n */\n @Method()\n getNativeInputElement() {\n return this.inputRef.waitForCurrent();\n }\n\n /**\n * Focuses the input field\n */\n @Method()\n async focusInput(): Promise<void> {\n return (await this.getNativeInputElement()).focus();\n }\n\n render() {\n const inputAria: A11yAttributes = getAriaAttributesForInput(this);\n return (\n <Host\n class={{\n disabled: this.disabled,\n readonly: this.readonly,\n }}\n >\n <ix-field-wrapper\n htmlForLabel={this.inputId}\n required={this.required}\n label={this.label}\n helperText={this.helperText}\n invalidText={this.invalidText}\n infoText={this.infoText}\n warningText={this.warningText}\n validText={this.validText}\n showTextAsTooltip={this.showTextAsTooltip}\n isInvalid={this.isInvalid}\n isValid={this.isValid}\n isInfo={this.isInfo}\n isWarning={this.isWarning}\n controlRef={this.inputRef}\n >\n <div class=\"input-wrapper\">\n <SlotStart\n slotStartRef={this.slotStartRef}\n onSlotChange={() => this.updatePaddings()}\n ></SlotStart>\n <InputElement\n id={this.inputId}\n readonly={this.readonly}\n disabled={this.disabled}\n maxLength={this.maxLength}\n minLength={this.minLength}\n pattern={this.pattern}\n type={this.inputType}\n isInvalid={this.isInvalid}\n required={this.required}\n value={this.value}\n placeholder={this.placeholder}\n inputRef={this.inputRef}\n onKeyPress={(event) => checkAllowedKeys(this, event)}\n valueChange={(value) => this.valueChange.emit(value)}\n updateFormInternalValue={(value) =>\n this.updateFormInternalValue(value)\n }\n onBlur={() => onInputBlur(this, this.inputRef.current)}\n ariaAttributes={inputAria}\n ></InputElement>\n <SlotEnd\n slotEndRef={this.slotEndRef}\n onSlotChange={() => this.updatePaddings()}\n >\n <ix-icon-button\n color=\"color-weak-text\"\n class={{\n 'password-eye': true,\n 'eye-hidden': this.type !== 'password',\n }}\n ghost\n icon={\n this.inputType === 'password' ? iconEye : iconEyeCancelled\n }\n onClick={() => {\n if (this.inputType === 'password') {\n this.inputType = 'text';\n return;\n }\n\n this.inputType = 'password';\n }}\n ></ix-icon-button>\n </SlotEnd>\n </div>\n {!!this.maxLength && this.maxLength > 0 && (\n <ix-typography class=\"bottom-text\" slot=\"bottom-right\" color=\"soft\">\n {this.value?.length}/{this.maxLength}\n </ix-typography>\n )}\n </ix-field-wrapper>\n </Host>\n );\n }\n}\n"]}
@@ -26,6 +26,8 @@ let numberInputIds = 0;
26
26
  /**
27
27
  * @since 2.6.0
28
28
  * @form-ready 2.6.0
29
+ * @slot start - Element will be displayed at the start of the input
30
+ * @slot end - Element will be displayed at the end of the input
29
31
  */
30
32
  export class NumberInput {
31
33
  constructor() {
@@ -95,16 +97,16 @@ export class NumberInput {
95
97
  }
96
98
  render() {
97
99
  const showStepperButtons = this.showStepperButtons && (this.disabled || this.readonly) === false;
98
- return (h(Host, { key: '257156c1c5ec77ef4426b3a8818941f0b28062c6', class: {
100
+ return (h(Host, { key: 'd44d46cba0a85db489b707e79978d7835cd7f6db', class: {
99
101
  disabled: this.disabled,
100
102
  readonly: this.readonly,
101
- } }, h("ix-field-wrapper", { key: 'ab953fa1af86d3f0415b709fff3871e17f00453a', id: this.numberInputId, required: this.required, label: this.label, helperText: this.helperText, invalidText: this.invalidText, infoText: this.infoText, warningText: this.warningText, validText: this.validText, showTextAsTooltip: this.showTextAsTooltip, isInvalid: this.isInvalid, isValid: this.isValid, isInfo: this.isInfo, isWarning: this.isWarning, controlRef: this.inputRef }, h("div", { key: '82ab33e39746a47d1c387f953b3862bd47547a4b', class: {
103
+ } }, h("ix-field-wrapper", { key: '258921ecc2d462c97026ba1b0bfc783c277cef41', id: this.numberInputId, required: this.required, label: this.label, helperText: this.helperText, invalidText: this.invalidText, infoText: this.infoText, warningText: this.warningText, validText: this.validText, showTextAsTooltip: this.showTextAsTooltip, isInvalid: this.isInvalid, isValid: this.isValid, isInfo: this.isInfo, isWarning: this.isWarning, controlRef: this.inputRef }, h("div", { key: '88f56233a0fff77353f8e5710e7503e61877a391', class: {
102
104
  'input-wrapper': true,
103
105
  'show-stepper-buttons': !!this.showStepperButtons,
104
- } }, h(SlotStart, { key: '252e87d3380c33806b2a1af84b98d672e2f0980f', slotStartRef: this.slotStartRef, onSlotChange: () => this.updatePaddings() }), h(InputElement, { key: 'd2cbab2e83934c970e9b8fce0390d5ad01234646', id: this.numberInputId, readonly: this.readonly, disabled: this.disabled, min: this.min, max: this.max, pattern: this.pattern, type: 'number', isInvalid: this.isInvalid, required: this.required, value: this.value, placeholder: this.placeholder, inputRef: this.inputRef, onKeyPress: (event) => checkAllowedKeys(this, event), valueChange: (value) => this.valueChange.emit(Number(value)), updateFormInternalValue: (value) => this.updateFormInternalValue(Number(value)), onBlur: () => onInputBlur(this, this.inputRef.current) }), h(SlotEnd, { key: '9a9a6de11186692b3707d85315a124256124ad2f', slotEndRef: this.slotEndRef, onSlotChange: () => this.updatePaddings() }, h("div", { key: '97a24bdb25e6a6818038f662eb14a94e4e79d7a0', class: {
106
+ } }, h(SlotStart, { key: 'c74d37bb1153f84bd326b4c84308d0ef87c2af53', slotStartRef: this.slotStartRef, onSlotChange: () => this.updatePaddings() }), h(InputElement, { key: 'e538819db34d4e7b3a345f992f79cd7d528b3fae', id: this.numberInputId, readonly: this.readonly, disabled: this.disabled, min: this.min, max: this.max, pattern: this.pattern, type: 'number', isInvalid: this.isInvalid, required: this.required, value: this.value, placeholder: this.placeholder, inputRef: this.inputRef, onKeyPress: (event) => checkAllowedKeys(this, event), valueChange: (value) => this.valueChange.emit(Number(value)), updateFormInternalValue: (value) => this.updateFormInternalValue(Number(value)), onBlur: () => onInputBlur(this, this.inputRef.current) }), h(SlotEnd, { key: '91bff359e6340bace9a9669da1ee056da40bb977', slotEndRef: this.slotEndRef, onSlotChange: () => this.updatePaddings() }, h("div", { key: '9f002e7ccfb5f77e76d4e1179af333ca20f99cd2', class: {
105
107
  'number-stepper-container': true,
106
108
  'container-hidden': !showStepperButtons,
107
- } }, h("ix-icon-button", { key: '89d6c0aea01ea12ad5342cf825f9f43748e5f47a', ghost: true, icon: iconMinus, size: "16", class: "number-stepper-button step-minus", onClick: () => {
109
+ } }, h("ix-icon-button", { key: '6fa92f4a99603300ba0815bbab96f5c3c01f35b6', ghost: true, icon: iconMinus, size: "16", class: "number-stepper-button step-minus", onClick: () => {
108
110
  if (!this.inputRef.current) {
109
111
  return;
110
112
  }
@@ -112,7 +114,7 @@ export class NumberInput {
112
114
  checkInternalValidity(this, this.inputRef.current);
113
115
  this.updateFormInternalValue(Number(this.inputRef.current.value));
114
116
  this.valueChange.emit(this.value);
115
- } }), h("ix-icon-button", { key: '7a913f64e5abf65be33268df93eae3635452b51b', ghost: true, icon: iconPlus, size: "16", class: "number-stepper-button step-plus", onClick: () => {
117
+ } }), h("ix-icon-button", { key: '514c2c7164156b86b09a6aa2c999e00128e4527e', ghost: true, icon: iconPlus, size: "16", class: "number-stepper-button step-plus", onClick: () => {
116
118
  if (!this.inputRef.current) {
117
119
  return;
118
120
  }
@@ -1 +1 @@
1
- {"version":3,"file":"number-input.js","sourceRoot":"","sources":["../../../src/components/input/number-input.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;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AC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CACpC,CAAC;oCACF,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gCACpC,CAAC,GACe,CACd,CACE,CACN,CACW,CACd,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAjKC;IADC,uBAAuB,EAAE;sDAGzB","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { iconMinus, iconPlus } from '@siemens/ix-icons/icons';\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n h,\n} from '@stencil/core';\nimport {\n HookValidationLifecycle,\n IxInputFieldComponent,\n ValidationResults,\n} from '../utils/input';\nimport { MakeRef, makeRef } from '../utils/make-ref';\nimport { InputElement, SlotEnd, SlotStart } from './input.fc';\nimport {\n adjustPaddingForStartAndEnd,\n checkAllowedKeys,\n checkInternalValidity,\n mapValidationResult,\n onInputBlur,\n} from './input.util';\n\nlet numberInputIds = 0;\n\n/**\n * @since 2.6.0\n * @form-ready 2.6.0\n */\n@Component({\n tag: 'ix-number-input',\n styleUrl: 'number-input.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NumberInput implements IxInputFieldComponent<number> {\n @Element() hostElement!: HTMLIxNumberInputElement;\n @AttachInternals() formInternals!: ElementInternals;\n\n /**\n * name of the input element\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * placeholder of the input element\n */\n @Prop({ reflect: true }) placeholder?: string;\n\n /**\n * The value of the input field\n */\n @Prop({ reflect: true, mutable: true }) value: number = 0;\n\n /**\n * Indicates if the field is required\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Disables the input field\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Indicates if the field is read-only\n */\n @Prop() readonly: boolean = false;\n\n /**\n * The helper text for the input field\n */\n @Prop() helperText?: string;\n\n /**\n * The info text for the input field\n */\n @Prop() infoText?: string;\n\n /**\n * Indicates if the text should be shown as a tooltip\n */\n @Prop() showTextAsTooltip?: boolean;\n\n /**\n * The valid text for the input field\n */\n @Prop() validText?: string;\n\n /**\n * The warning text for the input field\n */\n @Prop() warningText?: string;\n\n /**\n * The label for the input field\n */\n @Prop({ reflect: true }) label?: string;\n\n /**\n * The error text for the input field\n */\n @Prop() invalidText?: string;\n\n /**\n * The pattern for the input field\n */\n @Prop() pattern?: string;\n\n /**\n * The minimum value for the input field\n */\n @Prop() min?: string | number;\n\n /**\n * The maximum value for the input field\n */\n @Prop() max?: string | number;\n\n /**\n * The allowed characters pattern for the input field\n */\n @Prop() allowedCharactersPattern?: string;\n\n /**\n * Indicates if the stepper buttons should be shown\n */\n @Prop() showStepperButtons?: boolean;\n\n /**\n * Event emitted when the value of the input field changes\n */\n @Event() valueChange!: EventEmitter<number>;\n\n /**\n * Event emitted when the validity state of the input field changes\n */\n @Event() validityStateChange!: EventEmitter<ValidityState>;\n\n /**\n * Event emitted when the input field loses focus\n */\n @Event() ixBlur!: EventEmitter<void>;\n\n @State() isInvalid = false;\n @State() isValid = false;\n @State() isInfo = false;\n @State() isWarning = false;\n @State() isInvalidByRequired = false;\n\n private readonly inputRef = makeRef<HTMLInputElement>();\n private readonly slotEndRef = makeRef<HTMLDivElement>();\n private readonly slotStartRef = makeRef<HTMLDivElement>();\n private readonly numberInputId = `number-input-${numberInputIds++}`;\n\n @HookValidationLifecycle()\n updateClassMappings(result: ValidationResults) {\n mapValidationResult(this, result);\n }\n\n componentWillLoad() {\n this.updateFormInternalValue(this.value);\n }\n\n componentDidRender() {\n this.updatePaddings();\n }\n\n private updatePaddings() {\n adjustPaddingForStartAndEnd(\n this.slotStartRef.current,\n this.slotEndRef.current,\n this.inputRef.current\n );\n }\n\n updateFormInternalValue(value: number) {\n this.formInternals.setFormValue(value.toString());\n this.value = value;\n }\n\n /** @internal */\n @Method()\n async getAssociatedFormElement(): Promise<HTMLFormElement | null> {\n return this.formInternals.form;\n }\n\n /** @internal */\n @Method()\n hasValidValue(): Promise<boolean> {\n return Promise.resolve(!!this.value);\n }\n\n /**\n * Returns the native input element used under the hood\n */\n @Method()\n getNativeInputElement(): Promise<HTMLInputElement> {\n return this.inputRef.waitForCurrent();\n }\n\n /**\n * Focuses the input field\n */\n @Method()\n async focusInput(): Promise<void> {\n return (await this.getNativeInputElement()).focus();\n }\n\n render() {\n const showStepperButtons =\n this.showStepperButtons && (this.disabled || this.readonly) === false;\n\n return (\n <Host\n class={{\n disabled: this.disabled,\n readonly: this.readonly,\n }}\n >\n <ix-field-wrapper\n id={this.numberInputId}\n required={this.required}\n label={this.label}\n helperText={this.helperText}\n invalidText={this.invalidText}\n infoText={this.infoText}\n warningText={this.warningText}\n validText={this.validText}\n showTextAsTooltip={this.showTextAsTooltip}\n isInvalid={this.isInvalid}\n isValid={this.isValid}\n isInfo={this.isInfo}\n isWarning={this.isWarning}\n controlRef={this.inputRef as unknown as MakeRef<HTMLElement>}\n >\n <div\n class={{\n 'input-wrapper': true,\n 'show-stepper-buttons': !!this.showStepperButtons,\n }}\n >\n <SlotStart\n slotStartRef={this.slotStartRef}\n onSlotChange={() => this.updatePaddings()}\n ></SlotStart>\n <InputElement\n id={this.numberInputId}\n readonly={this.readonly}\n disabled={this.disabled}\n min={this.min}\n max={this.max}\n pattern={this.pattern}\n type={'number'}\n isInvalid={this.isInvalid}\n required={this.required}\n value={this.value}\n placeholder={this.placeholder}\n inputRef={this.inputRef}\n onKeyPress={(event) => checkAllowedKeys(this, event)}\n valueChange={(value) => this.valueChange.emit(Number(value))}\n updateFormInternalValue={(value) =>\n this.updateFormInternalValue(Number(value))\n }\n onBlur={() => onInputBlur(this, this.inputRef.current)}\n ></InputElement>\n <SlotEnd\n slotEndRef={this.slotEndRef}\n onSlotChange={() => this.updatePaddings()}\n >\n <div\n class={{\n 'number-stepper-container': true,\n 'container-hidden': !showStepperButtons,\n }}\n >\n <ix-icon-button\n ghost\n icon={iconMinus}\n size=\"16\"\n class=\"number-stepper-button step-minus\"\n onClick={() => {\n if (!this.inputRef.current) {\n return;\n }\n this.inputRef.current.stepDown();\n checkInternalValidity(this, this.inputRef.current);\n this.updateFormInternalValue(\n Number(this.inputRef.current.value)\n );\n this.valueChange.emit(this.value);\n }}\n ></ix-icon-button>\n <ix-icon-button\n ghost\n icon={iconPlus}\n size=\"16\"\n class=\"number-stepper-button step-plus\"\n onClick={() => {\n if (!this.inputRef.current) {\n return;\n }\n this.inputRef.current.stepUp();\n checkInternalValidity(this, this.inputRef.current);\n this.updateFormInternalValue(\n Number(this.inputRef.current.value)\n );\n this.valueChange.emit(this.value);\n }}\n ></ix-icon-button>\n </div>\n </SlotEnd>\n </div>\n </ix-field-wrapper>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"number-input.js","sourceRoot":"","sources":["../../../src/components/input/number-input.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;;;;;;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAA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pC,CAAC;oCACF,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gCACpC,CAAC,GACe,CACd,CACE,CACN,CACW,CACd,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAjKC;IADC,uBAAuB,EAAE;sDAGzB","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { iconMinus, iconPlus } from '@siemens/ix-icons/icons';\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n h,\n} from '@stencil/core';\nimport {\n HookValidationLifecycle,\n IxInputFieldComponent,\n ValidationResults,\n} from '../utils/input';\nimport { makeRef } from '../utils/make-ref';\nimport { InputElement, SlotEnd, SlotStart } from './input.fc';\nimport {\n adjustPaddingForStartAndEnd,\n checkAllowedKeys,\n checkInternalValidity,\n mapValidationResult,\n onInputBlur,\n} from './input.util';\n\nlet numberInputIds = 0;\n\n/**\n * @since 2.6.0\n * @form-ready 2.6.0\n * @slot start - Element will be displayed at the start of the input\n * @slot end - Element will be displayed at the end of the input\n */\n@Component({\n tag: 'ix-number-input',\n styleUrl: 'number-input.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class NumberInput implements IxInputFieldComponent<number> {\n @Element() hostElement!: HTMLIxNumberInputElement;\n @AttachInternals() formInternals!: ElementInternals;\n\n /**\n * name of the input element\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * placeholder of the input element\n */\n @Prop({ reflect: true }) placeholder?: string;\n\n /**\n * The value of the input field\n */\n @Prop({ reflect: true, mutable: true }) value: number = 0;\n\n /**\n * Indicates if the field is required\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Disables the input field\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Indicates if the field is read-only\n */\n @Prop() readonly: boolean = false;\n\n /**\n * The helper text for the input field\n */\n @Prop() helperText?: string;\n\n /**\n * The info text for the input field\n */\n @Prop() infoText?: string;\n\n /**\n * Indicates if the text should be shown as a tooltip\n */\n @Prop() showTextAsTooltip?: boolean;\n\n /**\n * The valid text for the input field\n */\n @Prop() validText?: string;\n\n /**\n * The warning text for the input field\n */\n @Prop() warningText?: string;\n\n /**\n * The label for the input field\n */\n @Prop({ reflect: true }) label?: string;\n\n /**\n * The error text for the input field\n */\n @Prop() invalidText?: string;\n\n /**\n * The pattern for the input field\n */\n @Prop() pattern?: string;\n\n /**\n * The minimum value for the input field\n */\n @Prop() min?: string | number;\n\n /**\n * The maximum value for the input field\n */\n @Prop() max?: string | number;\n\n /**\n * The allowed characters pattern for the input field\n */\n @Prop() allowedCharactersPattern?: string;\n\n /**\n * Indicates if the stepper buttons should be shown\n */\n @Prop() showStepperButtons?: boolean;\n\n /**\n * Event emitted when the value of the input field changes\n */\n @Event() valueChange!: EventEmitter<number>;\n\n /**\n * Event emitted when the validity state of the input field changes\n */\n @Event() validityStateChange!: EventEmitter<ValidityState>;\n\n /**\n * Event emitted when the input field loses focus\n */\n @Event() ixBlur!: EventEmitter<void>;\n\n @State() isInvalid = false;\n @State() isValid = false;\n @State() isInfo = false;\n @State() isWarning = false;\n @State() isInvalidByRequired = false;\n\n private readonly inputRef = makeRef<HTMLInputElement>();\n private readonly slotEndRef = makeRef<HTMLDivElement>();\n private readonly slotStartRef = makeRef<HTMLDivElement>();\n private readonly numberInputId = `number-input-${numberInputIds++}`;\n\n @HookValidationLifecycle()\n updateClassMappings(result: ValidationResults) {\n mapValidationResult(this, result);\n }\n\n componentWillLoad() {\n this.updateFormInternalValue(this.value);\n }\n\n componentDidRender() {\n this.updatePaddings();\n }\n\n private updatePaddings() {\n adjustPaddingForStartAndEnd(\n this.slotStartRef.current,\n this.slotEndRef.current,\n this.inputRef.current\n );\n }\n\n updateFormInternalValue(value: number) {\n this.formInternals.setFormValue(value.toString());\n this.value = value;\n }\n\n /** @internal */\n @Method()\n async getAssociatedFormElement(): Promise<HTMLFormElement | null> {\n return this.formInternals.form;\n }\n\n /** @internal */\n @Method()\n hasValidValue(): Promise<boolean> {\n return Promise.resolve(!!this.value);\n }\n\n /**\n * Returns the native input element used under the hood\n */\n @Method()\n getNativeInputElement(): Promise<HTMLInputElement> {\n return this.inputRef.waitForCurrent();\n }\n\n /**\n * Focuses the input field\n */\n @Method()\n async focusInput(): Promise<void> {\n return (await this.getNativeInputElement()).focus();\n }\n\n render() {\n const showStepperButtons =\n this.showStepperButtons && (this.disabled || this.readonly) === false;\n\n return (\n <Host\n class={{\n disabled: this.disabled,\n readonly: this.readonly,\n }}\n >\n <ix-field-wrapper\n id={this.numberInputId}\n required={this.required}\n label={this.label}\n helperText={this.helperText}\n invalidText={this.invalidText}\n infoText={this.infoText}\n warningText={this.warningText}\n validText={this.validText}\n showTextAsTooltip={this.showTextAsTooltip}\n isInvalid={this.isInvalid}\n isValid={this.isValid}\n isInfo={this.isInfo}\n isWarning={this.isWarning}\n controlRef={this.inputRef}\n >\n <div\n class={{\n 'input-wrapper': true,\n 'show-stepper-buttons': !!this.showStepperButtons,\n }}\n >\n <SlotStart\n slotStartRef={this.slotStartRef}\n onSlotChange={() => this.updatePaddings()}\n ></SlotStart>\n <InputElement\n id={this.numberInputId}\n readonly={this.readonly}\n disabled={this.disabled}\n min={this.min}\n max={this.max}\n pattern={this.pattern}\n type={'number'}\n isInvalid={this.isInvalid}\n required={this.required}\n value={this.value}\n placeholder={this.placeholder}\n inputRef={this.inputRef}\n onKeyPress={(event) => checkAllowedKeys(this, event)}\n valueChange={(value) => this.valueChange.emit(Number(value))}\n updateFormInternalValue={(value) =>\n this.updateFormInternalValue(Number(value))\n }\n onBlur={() => onInputBlur(this, this.inputRef.current)}\n ></InputElement>\n <SlotEnd\n slotEndRef={this.slotEndRef}\n onSlotChange={() => this.updatePaddings()}\n >\n <div\n class={{\n 'number-stepper-container': true,\n 'container-hidden': !showStepperButtons,\n }}\n >\n <ix-icon-button\n ghost\n icon={iconMinus}\n size=\"16\"\n class=\"number-stepper-button step-minus\"\n onClick={() => {\n if (!this.inputRef.current) {\n return;\n }\n this.inputRef.current.stepDown();\n checkInternalValidity(this, this.inputRef.current);\n this.updateFormInternalValue(\n Number(this.inputRef.current.value)\n );\n this.valueChange.emit(this.value);\n }}\n ></ix-icon-button>\n <ix-icon-button\n ghost\n icon={iconPlus}\n size=\"16\"\n class=\"number-stepper-button step-plus\"\n onClick={() => {\n if (!this.inputRef.current) {\n return;\n }\n this.inputRef.current.stepUp();\n checkInternalValidity(this, this.inputRef.current);\n this.updateFormInternalValue(\n Number(this.inputRef.current.value)\n );\n this.valueChange.emit(this.value);\n }}\n ></ix-icon-button>\n </div>\n </SlotEnd>\n </div>\n </ix-field-wrapper>\n </Host>\n );\n }\n}\n"]}
@@ -85,10 +85,10 @@ export class Textarea {
85
85
  return (await this.getNativeInputElement()).focus();
86
86
  }
87
87
  render() {
88
- return (h(Host, { key: '55f9acbe1f37fd80ce6d6104c06c057b2014dc47', class: {
88
+ return (h(Host, { key: '952c321d9c45ebf78962aca11974f95dcfd7b18a', class: {
89
89
  disabled: this.disabled,
90
90
  readonly: this.readonly,
91
- } }, h("ix-field-wrapper", { key: 'd38e875d3de15093496a1ae8e3d0e06272e3f4fc', required: this.required, label: this.label, helperText: this.helperText, invalidText: this.invalidText, infoText: this.infoText, warningText: this.warningText, validText: this.validText, showTextAsTooltip: this.showTextAsTooltip, isInvalid: this.isInvalid, isValid: this.isValid, isInfo: this.isInfo, isWarning: this.isWarning, controlRef: this.textAreaRef }, !!this.maxLength && this.maxLength > 0 && (h("ix-typography", { key: 'c85143e3e8866490d3673d0183741e1f914692ce', class: "bottom-text", slot: "bottom-right", color: "soft" }, this.value.length, "/", this.maxLength)), h("div", { key: '790d620ea6157129ee00798edd4076b73769c705', class: "input-wrapper" }, h(TextareaElement, { key: '3242925ed8673d49974da380b7c2e8833170511e', minLength: this.minLength, maxLength: this.maxLength, textareaCols: this.textareaCols, textareaRows: this.textareaRows, textareaHeight: this.textareaHeight, textareaWidth: this.textareaWidth, resizeBehavior: this.resizeBehavior, readonly: this.readonly, disabled: this.disabled, isInvalid: this.isInvalid, required: this.required, value: this.value, placeholder: this.placeholder, textAreaRef: this.textAreaRef, valueChange: (value) => this.valueChange.emit(value), updateFormInternalValue: (value) => this.updateFormInternalValue(value), onBlur: () => onInputBlur(this, this.textAreaRef.current) })))));
91
+ } }, h("ix-field-wrapper", { key: '78c62b4ed783ffe4545de3bfa17ff9fbe5dcde2f', required: this.required, label: this.label, helperText: this.helperText, invalidText: this.invalidText, infoText: this.infoText, warningText: this.warningText, validText: this.validText, showTextAsTooltip: this.showTextAsTooltip, isInvalid: this.isInvalid, isValid: this.isValid, isInfo: this.isInfo, isWarning: this.isWarning, controlRef: this.textAreaRef }, !!this.maxLength && this.maxLength > 0 && (h("ix-typography", { key: 'b05c5008923f91643f710f9953ae374f44d88c11', class: "bottom-text", slot: "bottom-right", color: "soft" }, this.value.length, "/", this.maxLength)), h("div", { key: 'bb7a292373d01721499c2128b057cad95c0fe59d', class: "input-wrapper" }, h(TextareaElement, { key: '1769ad294d552d2cd99113dfdcddc77ec517826a', minLength: this.minLength, maxLength: this.maxLength, textareaCols: this.textareaCols, textareaRows: this.textareaRows, textareaHeight: this.textareaHeight, textareaWidth: this.textareaWidth, resizeBehavior: this.resizeBehavior, readonly: this.readonly, disabled: this.disabled, isInvalid: this.isInvalid, required: this.required, value: this.value, placeholder: this.placeholder, textAreaRef: this.textAreaRef, valueChange: (value) => this.valueChange.emit(value), updateFormInternalValue: (value) => this.updateFormInternalValue(value), onBlur: () => onInputBlur(this, this.textAreaRef.current) })))));
92
92
  }
93
93
  static get is() { return "ix-textarea"; }
94
94
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/components/input/textarea.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;;;;;;AAEH,OAAO,EACL,eAAe,EACf,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,CAAC,GACF,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,GAGxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAW,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAQhE;;;GAGG;AAOH,MAAM,OAAO,QAAQ;;QA8HF,gBAAW,GAAG,OAAO,EAAuB,CAAC;;;qBA7GN,EAAE;wBAKb,KAAK;wBAKtB,KAAK;wBAKL,KAAK;;;;;;;;;;;;8BA6DgB,MAAM;;;yBA2BlC,KAAK;uBACP,KAAK;sBACN,KAAK;yBACF,KAAK;mCACK,KAAK;;IAKpC,mBAAmB,CAAC,MAAyB;QAC3C,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,iBA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAhGC;IADC,uBAAuB,EAAE;mDAGzB","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n h,\n} from '@stencil/core';\nimport {\n HookValidationLifecycle,\n IxInputFieldComponent,\n ValidationResults,\n} from '../utils/input';\nimport { MakeRef, makeRef } from '../utils/make-ref';\nimport { TextareaElement } from './input.fc';\nimport { mapValidationResult, onInputBlur } from './input.util';\n\nexport type TextareaResizeBehavior =\n | 'both'\n | 'horizontal'\n | 'vertical'\n | 'none';\n\n/**\n * @since 2.6.0\n * @form-ready 2.6.0\n */\n@Component({\n tag: 'ix-textarea',\n styleUrl: 'textarea.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Textarea implements IxInputFieldComponent<string> {\n @Element() hostElement!: HTMLIxTextareaElement;\n @AttachInternals() formInternals!: ElementInternals;\n\n /**\n * The name of the textarea field.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The placeholder text for the textarea field.\n */\n @Prop({ reflect: true }) placeholder?: string;\n\n /**\n * The value of the textarea field.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * Determines if the textarea field is required.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Determines if the textarea field is disabled.\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Determines if the textarea field is readonly.\n */\n @Prop() readonly: boolean = false;\n\n /**\n * The helper text for the textarea field.\n */\n @Prop() helperText?: string;\n\n /**\n * The info text for the textarea field.\n */\n @Prop() infoText?: string;\n\n /**\n * Determines if the text should be displayed as a tooltip.\n */\n @Prop() showTextAsTooltip?: boolean;\n\n /**\n * The valid text for the textarea field.\n */\n @Prop() validText?: string;\n\n /**\n * The warning text for the textarea field.\n */\n @Prop() warningText?: string;\n\n /**\n * The label for the textarea field.\n */\n @Prop({ reflect: true }) label?: string;\n\n /**\n * The error text for the textarea field.\n */\n @Prop() invalidText?: string;\n\n /**\n * The height of the textarea field (e.g. \"52px\").\n */\n @Prop() textareaHeight?: string;\n\n /**\n * The width of the textarea field (e.g. \"200px\").\n */\n @Prop() textareaWidth?: string;\n\n /**\n * The height of the textarea specified by number of rows.\n */\n @Prop() textareaRows?: number;\n\n /**\n * The width of the textarea specified by number of characters.\n */\n @Prop() textareaCols?: number;\n\n /**\n * Determines the resize behavior of the textarea field.\n * Resizing can be enabled in one direction, both directions or completely disabled.\n */\n @Prop() resizeBehavior: TextareaResizeBehavior = 'both';\n\n /**\n * The maximum length of the textarea field.\n */\n @Prop() maxLength?: number;\n\n /**\n * The minimum length of the textarea field.\n */\n @Prop() minLength?: number;\n\n /**\n * Event emitted when the value of the textarea field changes.\n */\n @Event() valueChange!: EventEmitter<string>;\n\n /**\n * Event emitted when the validity state of the textarea field changes.\n */\n @Event() validityStateChange!: EventEmitter<ValidityState>;\n\n /**\n * Event emitted when the textarea field loses focus.\n */\n @Event() ixBlur!: EventEmitter<void>;\n\n @State() isInvalid = false;\n @State() isValid = false;\n @State() isInfo = false;\n @State() isWarning = false;\n @State() isInvalidByRequired = false;\n\n private readonly textAreaRef = makeRef<HTMLTextAreaElement>();\n\n @HookValidationLifecycle()\n updateClassMappings(result: ValidationResults) {\n mapValidationResult(this, result);\n }\n\n componentWillLoad() {\n this.updateFormInternalValue(this.value);\n }\n\n updateFormInternalValue(value: string) {\n this.formInternals.setFormValue(value);\n this.value = value;\n }\n\n /** @internal */\n @Method()\n async getAssociatedFormElement(): Promise<HTMLFormElement | null> {\n return this.formInternals.form;\n }\n\n /** @internal */\n @Method()\n hasValidValue(): Promise<boolean> {\n return Promise.resolve(!!this.value);\n }\n\n /**\n * Get the native textarea element.\n */\n @Method()\n getNativeInputElement(): Promise<HTMLTextAreaElement> {\n return this.textAreaRef.waitForCurrent();\n }\n\n /**\n * Focuses the input field\n */\n @Method()\n async focusInput(): Promise<void> {\n return (await this.getNativeInputElement()).focus();\n }\n\n render() {\n return (\n <Host\n class={{\n disabled: this.disabled,\n readonly: this.readonly,\n }}\n >\n <ix-field-wrapper\n required={this.required}\n label={this.label}\n helperText={this.helperText}\n invalidText={this.invalidText}\n infoText={this.infoText}\n warningText={this.warningText}\n validText={this.validText}\n showTextAsTooltip={this.showTextAsTooltip}\n isInvalid={this.isInvalid}\n isValid={this.isValid}\n isInfo={this.isInfo}\n isWarning={this.isWarning}\n controlRef={this.textAreaRef as unknown as MakeRef<HTMLElement>}\n >\n {!!this.maxLength && this.maxLength > 0 && (\n <ix-typography class=\"bottom-text\" slot=\"bottom-right\" color=\"soft\">\n {this.value.length}/{this.maxLength}\n </ix-typography>\n )}\n <div class=\"input-wrapper\">\n <TextareaElement\n minLength={this.minLength}\n maxLength={this.maxLength}\n textareaCols={this.textareaCols}\n textareaRows={this.textareaRows}\n textareaHeight={this.textareaHeight}\n textareaWidth={this.textareaWidth}\n resizeBehavior={this.resizeBehavior}\n readonly={this.readonly}\n disabled={this.disabled}\n isInvalid={this.isInvalid}\n required={this.required}\n value={this.value}\n placeholder={this.placeholder}\n textAreaRef={this.textAreaRef}\n valueChange={(value) => this.valueChange.emit(value)}\n updateFormInternalValue={(value) =>\n this.updateFormInternalValue(value)\n }\n onBlur={() => onInputBlur(this, this.textAreaRef.current)}\n ></TextareaElement>\n </div>\n </ix-field-wrapper>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../src/components/input/textarea.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;;;;;;AAEH,OAAO,EACL,eAAe,EACf,SAAS,EACT,OAAO,EACP,KAAK,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,KAAK,EACL,CAAC,GACF,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,GAGxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAQhE;;;GAGG;AAOH,MAAM,OAAO,QAAQ;;QA8HF,gBAAW,GAAG,OAAO,EAAuB,CAAC;;;qBA7GN,EAAE;wBAKb,KAAK;wBAKtB,KAAK;wBAKL,KAAK;;;;;;;;;;;;8BA6DgB,MAAM;;;yBA2BlC,KAAK;uBACP,KAAK;sBACN,KAAK;yBACF,KAAK;mCACK,KAAK;;IAKpC,mBAAmB,CAAC,MAAyB;QAC3C,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACpC,CAAC;IAED,iBAAiB;QACf,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,uBAAuB,CAAC,KAAa;QACnC,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF;AAhGC;IADC,uBAAuB,EAAE;mDAGzB","sourcesContent":["/*\n * SPDX-FileCopyrightText: 2024 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n EventEmitter,\n Host,\n Method,\n Prop,\n State,\n h,\n} from '@stencil/core';\nimport {\n HookValidationLifecycle,\n IxInputFieldComponent,\n ValidationResults,\n} from '../utils/input';\nimport { makeRef } from '../utils/make-ref';\nimport { TextareaElement } from './input.fc';\nimport { mapValidationResult, onInputBlur } from './input.util';\n\nexport type TextareaResizeBehavior =\n | 'both'\n | 'horizontal'\n | 'vertical'\n | 'none';\n\n/**\n * @since 2.6.0\n * @form-ready 2.6.0\n */\n@Component({\n tag: 'ix-textarea',\n styleUrl: 'textarea.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Textarea implements IxInputFieldComponent<string> {\n @Element() hostElement!: HTMLIxTextareaElement;\n @AttachInternals() formInternals!: ElementInternals;\n\n /**\n * The name of the textarea field.\n */\n @Prop({ reflect: true }) name?: string;\n\n /**\n * The placeholder text for the textarea field.\n */\n @Prop({ reflect: true }) placeholder?: string;\n\n /**\n * The value of the textarea field.\n */\n @Prop({ reflect: true, mutable: true }) value: string = '';\n\n /**\n * Determines if the textarea field is required.\n */\n @Prop({ reflect: true }) required: boolean = false;\n\n /**\n * Determines if the textarea field is disabled.\n */\n @Prop() disabled: boolean = false;\n\n /**\n * Determines if the textarea field is readonly.\n */\n @Prop() readonly: boolean = false;\n\n /**\n * The helper text for the textarea field.\n */\n @Prop() helperText?: string;\n\n /**\n * The info text for the textarea field.\n */\n @Prop() infoText?: string;\n\n /**\n * Determines if the text should be displayed as a tooltip.\n */\n @Prop() showTextAsTooltip?: boolean;\n\n /**\n * The valid text for the textarea field.\n */\n @Prop() validText?: string;\n\n /**\n * The warning text for the textarea field.\n */\n @Prop() warningText?: string;\n\n /**\n * The label for the textarea field.\n */\n @Prop({ reflect: true }) label?: string;\n\n /**\n * The error text for the textarea field.\n */\n @Prop() invalidText?: string;\n\n /**\n * The height of the textarea field (e.g. \"52px\").\n */\n @Prop() textareaHeight?: string;\n\n /**\n * The width of the textarea field (e.g. \"200px\").\n */\n @Prop() textareaWidth?: string;\n\n /**\n * The height of the textarea specified by number of rows.\n */\n @Prop() textareaRows?: number;\n\n /**\n * The width of the textarea specified by number of characters.\n */\n @Prop() textareaCols?: number;\n\n /**\n * Determines the resize behavior of the textarea field.\n * Resizing can be enabled in one direction, both directions or completely disabled.\n */\n @Prop() resizeBehavior: TextareaResizeBehavior = 'both';\n\n /**\n * The maximum length of the textarea field.\n */\n @Prop() maxLength?: number;\n\n /**\n * The minimum length of the textarea field.\n */\n @Prop() minLength?: number;\n\n /**\n * Event emitted when the value of the textarea field changes.\n */\n @Event() valueChange!: EventEmitter<string>;\n\n /**\n * Event emitted when the validity state of the textarea field changes.\n */\n @Event() validityStateChange!: EventEmitter<ValidityState>;\n\n /**\n * Event emitted when the textarea field loses focus.\n */\n @Event() ixBlur!: EventEmitter<void>;\n\n @State() isInvalid = false;\n @State() isValid = false;\n @State() isInfo = false;\n @State() isWarning = false;\n @State() isInvalidByRequired = false;\n\n private readonly textAreaRef = makeRef<HTMLTextAreaElement>();\n\n @HookValidationLifecycle()\n updateClassMappings(result: ValidationResults) {\n mapValidationResult(this, result);\n }\n\n componentWillLoad() {\n this.updateFormInternalValue(this.value);\n }\n\n updateFormInternalValue(value: string) {\n this.formInternals.setFormValue(value);\n this.value = value;\n }\n\n /** @internal */\n @Method()\n async getAssociatedFormElement(): Promise<HTMLFormElement | null> {\n return this.formInternals.form;\n }\n\n /** @internal */\n @Method()\n hasValidValue(): Promise<boolean> {\n return Promise.resolve(!!this.value);\n }\n\n /**\n * Get the native textarea element.\n */\n @Method()\n getNativeInputElement(): Promise<HTMLTextAreaElement> {\n return this.textAreaRef.waitForCurrent();\n }\n\n /**\n * Focuses the input field\n */\n @Method()\n async focusInput(): Promise<void> {\n return (await this.getNativeInputElement()).focus();\n }\n\n render() {\n return (\n <Host\n class={{\n disabled: this.disabled,\n readonly: this.readonly,\n }}\n >\n <ix-field-wrapper\n required={this.required}\n label={this.label}\n helperText={this.helperText}\n invalidText={this.invalidText}\n infoText={this.infoText}\n warningText={this.warningText}\n validText={this.validText}\n showTextAsTooltip={this.showTextAsTooltip}\n isInvalid={this.isInvalid}\n isValid={this.isValid}\n isInfo={this.isInfo}\n isWarning={this.isWarning}\n controlRef={this.textAreaRef}\n >\n {!!this.maxLength && this.maxLength > 0 && (\n <ix-typography class=\"bottom-text\" slot=\"bottom-right\" color=\"soft\">\n {this.value.length}/{this.maxLength}\n </ix-typography>\n )}\n <div class=\"input-wrapper\">\n <TextareaElement\n minLength={this.minLength}\n maxLength={this.maxLength}\n textareaCols={this.textareaCols}\n textareaRows={this.textareaRows}\n textareaHeight={this.textareaHeight}\n textareaWidth={this.textareaWidth}\n resizeBehavior={this.resizeBehavior}\n readonly={this.readonly}\n disabled={this.disabled}\n isInvalid={this.isInvalid}\n required={this.required}\n value={this.value}\n placeholder={this.placeholder}\n textAreaRef={this.textAreaRef}\n valueChange={(value) => this.valueChange.emit(value)}\n updateFormInternalValue={(value) =>\n this.updateFormInternalValue(value)\n }\n onBlur={() => onInputBlur(this, this.textAreaRef.current)}\n ></TextareaElement>\n </div>\n </ix-field-wrapper>\n </Host>\n );\n }\n}\n"]}
@@ -8,26 +8,47 @@
8
8
  */
9
9
  import { expect } from "@playwright/test";
10
10
  import { test } from "../../../tests/utils/test/index";
11
- test('closes on Escape key down', async ({ mount, page }) => {
12
- await mount(``);
11
+ async function setupModalEnvironment(page) {
13
12
  await page.evaluate(() => {
14
13
  return new Promise((resolve) => {
14
+ var _a;
15
15
  const script = document.createElement('script');
16
16
  script.type = 'module';
17
17
  script.innerHTML = `
18
18
  import * as ix from 'http://127.0.0.1:8080/www/build/index.esm.js';
19
19
  window.showModal = ix.showModal;
20
+ window.dismissModal = ix.dismissModal;
20
21
  `;
21
- document.body.appendChild(script);
22
+ (_a = document.getElementById('mount')) === null || _a === void 0 ? void 0 : _a.appendChild(script);
22
23
  resolve();
23
24
  });
24
25
  });
26
+ }
27
+ async function createToggleExample(page) {
28
+ await page.evaluate(() => {
29
+ function createModalExample() {
30
+ const el = document.createElement('DIV');
31
+ el.style.display = 'contents';
32
+ el.innerHTML = `<ix-toggle id="toggle"></ix-toggle>`;
33
+ return el;
34
+ }
35
+ setTimeout(() => {
36
+ window.showModal({
37
+ content: createModalExample(),
38
+ closeOnBackdropClick: true,
39
+ });
40
+ }, 2000);
41
+ });
42
+ }
43
+ test('closes on Escape key down', async ({ mount, page }) => {
44
+ await mount(``);
45
+ await setupModalEnvironment(page);
25
46
  await page.waitForTimeout(1000);
26
47
  await page.evaluate(() => {
27
48
  const elm = document.createElement('ix-modal');
28
49
  elm.innerHTML = `
29
50
  <ix-modal-header>Title</ix-modal-header>
30
- <ix-modal-content>Content</ix-modal-header>
51
+ <ix-modal-content>Content</ix-modal-content>
31
52
  `;
32
53
  window.showModal({
33
54
  content: elm,
@@ -44,30 +65,8 @@ test.describe('closeOnBackdropClick = true', () => {
44
65
  await mount(`
45
66
  <ix-button>Some background noise</ix-button>
46
67
  `);
47
- await page.evaluate(() => {
48
- return new Promise((resolve) => {
49
- const script = document.createElement('script');
50
- script.type = 'module';
51
- script.innerHTML = `
52
- import * as ix from 'http://127.0.0.1:8080/www/build/index.esm.js';
53
- window.showModal = ix.showModal;
54
- `;
55
- document.getElementById('mount').appendChild(script);
56
- function createModalExample() {
57
- const el = document.createElement('DIV');
58
- el.style.display = 'contents';
59
- el.innerHTML = `<ix-toggle id="toggle"></ix-toggle>`;
60
- return el;
61
- }
62
- setTimeout(() => {
63
- window.showModal({
64
- content: createModalExample(),
65
- closeOnBackdropClick: true,
66
- });
67
- resolve();
68
- }, 2000);
69
- });
70
- });
68
+ await setupModalEnvironment(page);
69
+ await createToggleExample(page);
71
70
  // needed to skip fade out / in animation
72
71
  await page.waitForTimeout(500);
73
72
  const toggle = page.locator('#toggle');
@@ -81,30 +80,8 @@ test.describe('closeOnBackdropClick = true', () => {
81
80
  await mount(`
82
81
  <ix-button>Some background noise</ix-button>
83
82
  `);
84
- await page.evaluate(() => {
85
- return new Promise((resolve) => {
86
- const script = document.createElement('script');
87
- script.type = 'module';
88
- script.innerHTML = `
89
- import * as ix from 'http://127.0.0.1:8080/www/build/index.esm.js';
90
- window.showModal = ix.showModal;
91
- `;
92
- document.getElementById('mount').appendChild(script);
93
- function createModalExample() {
94
- const el = document.createElement('DIV');
95
- el.style.display = 'contents';
96
- el.innerHTML = `<ix-toggle id="toggle"></ix-toggle>`;
97
- return el;
98
- }
99
- setTimeout(() => {
100
- window.showModal({
101
- content: createModalExample(),
102
- closeOnBackdropClick: true,
103
- });
104
- resolve();
105
- }, 2000);
106
- });
107
- });
83
+ await setupModalEnvironment(page);
84
+ await createToggleExample(page);
108
85
  // needed to skip fade out / in animation
109
86
  await page.waitForTimeout(500);
110
87
  const toggle = page.locator('#toggle');
@@ -117,24 +94,13 @@ test.describe('closeOnBackdropClick = true', () => {
117
94
  });
118
95
  test('emits one event on close', async ({ mount, page }) => {
119
96
  await mount(``);
120
- await page.evaluate(() => {
121
- return new Promise((resolve) => {
122
- const script = document.createElement('script');
123
- script.type = 'module';
124
- script.innerHTML = `
125
- import * as ix from 'http://127.0.0.1:8080/www/build/index.esm.js';
126
- window.showModal = ix.showModal;
127
- `;
128
- document.body.appendChild(script);
129
- resolve();
130
- });
131
- });
97
+ await setupModalEnvironment(page);
132
98
  await page.waitForTimeout(1000);
133
99
  await page.evaluate(() => {
134
100
  const elm = document.createElement('ix-modal');
135
101
  elm.innerHTML = `
136
102
  <ix-modal-header>Title</ix-modal-header>
137
- <ix-modal-content>Content</ix-modal-header>
103
+ <ix-modal-content>Content</ix-modal-content>
138
104
  `;
139
105
  window
140
106
  .showModal({
@@ -161,4 +127,30 @@ test('emits one event on close', async ({ mount, page }) => {
161
127
  await expect(dialog).not.toBeVisible();
162
128
  expect(await page.evaluate(() => window.__counter)).toBe(1);
163
129
  });
130
+ test('button receives focus on load', async ({ mount, page }) => {
131
+ await mount('');
132
+ await setupModalEnvironment(page);
133
+ await page.waitForTimeout(100);
134
+ await page.evaluate(() => {
135
+ const elm = document.createElement('ix-modal');
136
+ elm.innerHTML = `
137
+ <ix-modal-header>Title</ix-modal-header>
138
+ <ix-modal-footer>
139
+ <ix-button autofocus>OK</ix-button>
140
+ </ix-modal-footer>
141
+ `;
142
+ window.showModal({
143
+ content: elm,
144
+ });
145
+ const okButton = elm.querySelector('ix-button');
146
+ okButton === null || okButton === void 0 ? void 0 : okButton.addEventListener('click', () => {
147
+ window.dismissModal(elm);
148
+ });
149
+ });
150
+ await page.waitForTimeout(250);
151
+ const dialog = page.locator('ix-modal dialog');
152
+ await expect(dialog).toBeVisible();
153
+ await page.keyboard.press('Enter');
154
+ await expect(dialog).not.toBeVisible();
155
+ });
164
156
  //# sourceMappingURL=modal.ct.js.map