@quartzds/core 1.0.0-beta.9 → 1.0.0-beta.91

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 (387) hide show
  1. package/README.md +5 -5
  2. package/components/index.d.ts +48 -0
  3. package/components/index.js +60 -28
  4. package/components/index.js.map +1 -1
  5. package/components/p-2806fee1.js +1887 -0
  6. package/components/p-2806fee1.js.map +1 -0
  7. package/components/p-2bf0797c.js +272 -0
  8. package/components/p-2bf0797c.js.map +1 -0
  9. package/components/p-3baf75f4.js +111 -0
  10. package/components/p-3baf75f4.js.map +1 -0
  11. package/components/p-3c48ff53.js +103 -0
  12. package/components/p-3c48ff53.js.map +1 -0
  13. package/components/p-8abba29b.js +204 -0
  14. package/components/p-8abba29b.js.map +1 -0
  15. package/components/p-a020ece3.js +142 -0
  16. package/components/p-a020ece3.js.map +1 -0
  17. package/components/p-a6310886.js +144 -0
  18. package/components/p-a6310886.js.map +1 -0
  19. package/components/p-b4c302d4.js +91 -0
  20. package/components/p-b4c302d4.js.map +1 -0
  21. package/components/p-ba880369.js +256 -0
  22. package/components/p-ba880369.js.map +1 -0
  23. package/components/p-c80f112a.js +408 -0
  24. package/components/p-c80f112a.js.map +1 -0
  25. package/components/p-d107c90c.js +27 -0
  26. package/components/p-d107c90c.js.map +1 -0
  27. package/components/p-d6e52d0b.js +404 -0
  28. package/components/p-d6e52d0b.js.map +1 -0
  29. package/components/{floating-ui.dom.esm.js → p-fdd0abae.js} +468 -416
  30. package/components/p-fdd0abae.js.map +1 -0
  31. package/components/p-fed0d11f.js +94 -0
  32. package/components/p-fed0d11f.js.map +1 -0
  33. package/components/qds-badge-counter.d.ts +11 -0
  34. package/components/qds-badge-counter.js +13 -0
  35. package/components/qds-badge-counter.js.map +1 -0
  36. package/components/qds-badge-indicator.d.ts +11 -0
  37. package/components/qds-badge-indicator.js +13 -0
  38. package/components/qds-badge-indicator.js.map +1 -0
  39. package/components/qds-breadcrumb-item.d.ts +11 -0
  40. package/components/qds-breadcrumb-item.js +126 -0
  41. package/components/qds-breadcrumb-item.js.map +1 -0
  42. package/components/qds-button.d.ts +2 -2
  43. package/components/qds-button.js +3 -138
  44. package/components/qds-button.js.map +1 -1
  45. package/components/qds-checkbox.d.ts +2 -2
  46. package/components/qds-checkbox.js +3 -146
  47. package/components/qds-checkbox.js.map +1 -1
  48. package/components/qds-chip.d.ts +11 -0
  49. package/components/qds-chip.js +296 -0
  50. package/components/qds-chip.js.map +1 -0
  51. package/components/qds-dialog.d.ts +11 -0
  52. package/components/qds-dialog.js +126 -0
  53. package/components/qds-dialog.js.map +1 -0
  54. package/components/qds-divider.d.ts +2 -2
  55. package/components/qds-divider.js +3 -39
  56. package/components/qds-divider.js.map +1 -1
  57. package/components/qds-dropdown.d.ts +2 -2
  58. package/components/qds-dropdown.js +273 -239
  59. package/components/qds-dropdown.js.map +1 -1
  60. package/components/qds-form-message.d.ts +11 -0
  61. package/components/qds-form-message.js +112 -0
  62. package/components/qds-form-message.js.map +1 -0
  63. package/components/qds-icon.d.ts +2 -2
  64. package/components/qds-icon.js +3 -3
  65. package/components/qds-inline-link.d.ts +2 -2
  66. package/components/qds-inline-link.js +136 -73
  67. package/components/qds-inline-link.js.map +1 -1
  68. package/components/qds-input.d.ts +2 -2
  69. package/components/qds-input.js +489 -230
  70. package/components/qds-input.js.map +1 -1
  71. package/components/qds-label.d.ts +2 -2
  72. package/components/qds-label.js +3 -3
  73. package/components/qds-list-item.d.ts +11 -0
  74. package/components/qds-list-item.js +212 -0
  75. package/components/qds-list-item.js.map +1 -0
  76. package/components/qds-loader.d.ts +11 -0
  77. package/components/qds-loader.js +113 -0
  78. package/components/qds-loader.js.map +1 -0
  79. package/components/qds-nav-list-item.d.ts +11 -0
  80. package/components/qds-nav-list-item.js +162 -0
  81. package/components/qds-nav-list-item.js.map +1 -0
  82. package/components/qds-progress-bar.d.ts +11 -0
  83. package/components/qds-progress-bar.js +153 -0
  84. package/components/qds-progress-bar.js.map +1 -0
  85. package/components/qds-radio.d.ts +2 -2
  86. package/components/qds-radio.js +147 -93
  87. package/components/qds-radio.js.map +1 -1
  88. package/components/qds-select.d.ts +11 -0
  89. package/components/qds-select.js +361 -0
  90. package/components/qds-select.js.map +1 -0
  91. package/components/qds-standalone-link.d.ts +11 -0
  92. package/components/qds-standalone-link.js +174 -0
  93. package/components/qds-standalone-link.js.map +1 -0
  94. package/components/qds-switch.d.ts +2 -2
  95. package/components/qds-switch.js +221 -105
  96. package/components/qds-switch.js.map +1 -1
  97. package/components/qds-tab.d.ts +11 -0
  98. package/components/qds-tab.js +379 -0
  99. package/components/qds-tab.js.map +1 -0
  100. package/components/qds-tabbar.d.ts +11 -0
  101. package/components/qds-tabbar.js +407 -0
  102. package/components/qds-tabbar.js.map +1 -0
  103. package/components/qds-table-body.d.ts +11 -0
  104. package/components/qds-table-body.js +68 -0
  105. package/components/qds-table-body.js.map +1 -0
  106. package/components/qds-table-cell.d.ts +11 -0
  107. package/components/qds-table-cell.js +71 -0
  108. package/components/qds-table-cell.js.map +1 -0
  109. package/components/qds-table-head-cell.d.ts +11 -0
  110. package/components/qds-table-head-cell.js +73 -0
  111. package/components/qds-table-head-cell.js.map +1 -0
  112. package/components/qds-table-head.d.ts +11 -0
  113. package/components/qds-table-head.js +68 -0
  114. package/components/qds-table-head.js.map +1 -0
  115. package/components/qds-table-row.d.ts +11 -0
  116. package/components/qds-table-row.js +68 -0
  117. package/components/qds-table-row.js.map +1 -0
  118. package/components/qds-table.d.ts +11 -0
  119. package/components/qds-table.js +68 -0
  120. package/components/qds-table.js.map +1 -0
  121. package/components/qds-tag.d.ts +11 -0
  122. package/components/qds-tag.js +13 -0
  123. package/components/qds-tag.js.map +1 -0
  124. package/components/qds-textarea.d.ts +2 -2
  125. package/components/qds-textarea.js +331 -193
  126. package/components/qds-textarea.js.map +1 -1
  127. package/components/qds-title.d.ts +2 -2
  128. package/components/qds-title.js +3 -84
  129. package/components/qds-title.js.map +1 -1
  130. package/components/qds-tooltip.d.ts +2 -2
  131. package/components/qds-tooltip.js +3 -315
  132. package/components/qds-tooltip.js.map +1 -1
  133. package/dist/cjs/app-globals-c4cf08df.js +12 -0
  134. package/dist/cjs/app-globals-c4cf08df.js.map +1 -0
  135. package/dist/cjs/controls-ee3d2ec8.js +31 -0
  136. package/dist/cjs/controls-ee3d2ec8.js.map +1 -0
  137. package/dist/cjs/{floating-ui.dom.esm-71fa96af.js → floating-ui.dom.esm-19b2b933.js} +468 -416
  138. package/dist/cjs/floating-ui.dom.esm-19b2b933.js.map +1 -0
  139. package/dist/cjs/helpers-10154521.js +217 -0
  140. package/dist/cjs/helpers-10154521.js.map +1 -0
  141. package/dist/cjs/index-523dd2e0.js +2149 -0
  142. package/dist/cjs/index-523dd2e0.js.map +1 -0
  143. package/dist/cjs/index.cjs.js +39 -27
  144. package/dist/cjs/index.cjs.js.map +1 -1
  145. package/dist/cjs/library-41b19b9e.js +117 -0
  146. package/dist/cjs/library-41b19b9e.js.map +1 -0
  147. package/dist/cjs/loader.cjs.js +8 -6
  148. package/dist/cjs/loader.cjs.js.map +1 -1
  149. package/dist/cjs/qds-badge-counter_2.cjs.entry.js +151 -0
  150. package/dist/cjs/qds-badge-counter_2.cjs.entry.js.map +1 -0
  151. package/dist/cjs/qds-breadcrumb-item.cjs.entry.js +96 -0
  152. package/dist/cjs/qds-breadcrumb-item.cjs.entry.js.map +1 -0
  153. package/dist/cjs/qds-button.cjs.entry.js +321 -90
  154. package/dist/cjs/qds-button.cjs.entry.js.map +1 -1
  155. package/dist/cjs/qds-checkbox.cjs.entry.js +212 -100
  156. package/dist/cjs/qds-checkbox.cjs.entry.js.map +1 -1
  157. package/dist/cjs/qds-chip.cjs.entry.js +256 -0
  158. package/dist/cjs/qds-chip.cjs.entry.js.map +1 -0
  159. package/dist/cjs/qds-dialog.cjs.entry.js +108 -0
  160. package/dist/cjs/qds-dialog.cjs.entry.js.map +1 -0
  161. package/dist/cjs/qds-divider.cjs.entry.js +60 -18
  162. package/dist/cjs/qds-divider.cjs.entry.js.map +1 -1
  163. package/dist/cjs/qds-dropdown.cjs.entry.js +232 -206
  164. package/dist/cjs/qds-dropdown.cjs.entry.js.map +1 -1
  165. package/dist/cjs/qds-form-message.cjs.entry.js +86 -0
  166. package/dist/cjs/qds-form-message.cjs.entry.js.map +1 -0
  167. package/dist/cjs/qds-icon.cjs.entry.js +113 -90
  168. package/dist/cjs/qds-icon.cjs.entry.js.map +1 -1
  169. package/dist/cjs/qds-inline-link.cjs.entry.js +99 -46
  170. package/dist/cjs/qds-inline-link.cjs.entry.js.map +1 -1
  171. package/dist/cjs/qds-input.cjs.entry.js +404 -185
  172. package/dist/cjs/qds-input.cjs.entry.js.map +1 -1
  173. package/dist/cjs/qds-label.cjs.entry.js +102 -24
  174. package/dist/cjs/qds-label.cjs.entry.js.map +1 -1
  175. package/dist/cjs/qds-list-item.cjs.entry.js +157 -0
  176. package/dist/cjs/qds-list-item.cjs.entry.js.map +1 -0
  177. package/dist/cjs/qds-loader.cjs.entry.js +94 -0
  178. package/dist/cjs/qds-loader.cjs.entry.js.map +1 -0
  179. package/dist/cjs/qds-nav-list-item.cjs.entry.js +124 -0
  180. package/dist/cjs/qds-nav-list-item.cjs.entry.js.map +1 -0
  181. package/dist/cjs/qds-progress-bar.cjs.entry.js +135 -0
  182. package/dist/cjs/qds-progress-bar.cjs.entry.js.map +1 -0
  183. package/dist/cjs/qds-radio.cjs.entry.js +102 -57
  184. package/dist/cjs/qds-radio.cjs.entry.js.map +1 -1
  185. package/dist/cjs/qds-select.cjs.entry.js +323 -0
  186. package/dist/cjs/qds-select.cjs.entry.js.map +1 -0
  187. package/dist/cjs/qds-standalone-link.cjs.entry.js +134 -0
  188. package/dist/cjs/qds-standalone-link.cjs.entry.js.map +1 -0
  189. package/dist/cjs/qds-switch.cjs.entry.js +193 -64
  190. package/dist/cjs/qds-switch.cjs.entry.js.map +1 -1
  191. package/dist/cjs/qds-tab.cjs.entry.js +299 -0
  192. package/dist/cjs/qds-tab.cjs.entry.js.map +1 -0
  193. package/dist/cjs/qds-tabbar.cjs.entry.js +349 -0
  194. package/dist/cjs/qds-tabbar.cjs.entry.js.map +1 -0
  195. package/dist/cjs/qds-table-body.cjs.entry.js +54 -0
  196. package/dist/cjs/qds-table-body.cjs.entry.js.map +1 -0
  197. package/dist/cjs/qds-table-cell.cjs.entry.js +54 -0
  198. package/dist/cjs/qds-table-cell.cjs.entry.js.map +1 -0
  199. package/dist/cjs/qds-table-head-cell.cjs.entry.js +54 -0
  200. package/dist/cjs/qds-table-head-cell.cjs.entry.js.map +1 -0
  201. package/dist/cjs/qds-table-head.cjs.entry.js +54 -0
  202. package/dist/cjs/qds-table-head.cjs.entry.js.map +1 -0
  203. package/dist/cjs/qds-table-row.cjs.entry.js +54 -0
  204. package/dist/cjs/qds-table-row.cjs.entry.js.map +1 -0
  205. package/dist/cjs/qds-table.cjs.entry.js +54 -0
  206. package/dist/cjs/qds-table.cjs.entry.js.map +1 -0
  207. package/dist/cjs/qds-tag_2.cjs.entry.js +181 -0
  208. package/dist/cjs/qds-tag_2.cjs.entry.js.map +1 -0
  209. package/dist/cjs/qds-textarea.cjs.entry.js +288 -153
  210. package/dist/cjs/qds-textarea.cjs.entry.js.map +1 -1
  211. package/dist/cjs/qds-tooltip.cjs.entry.js +332 -260
  212. package/dist/cjs/qds-tooltip.cjs.entry.js.map +1 -1
  213. package/dist/cjs/qds.cjs.js +15 -13
  214. package/dist/cjs/qds.cjs.js.map +1 -1
  215. package/dist/custom-elements.json +8727 -2151
  216. package/dist/docs.d.ts +344 -240
  217. package/dist/docs.json +9364 -2903
  218. package/dist/esm/app-globals-8ced3a41.js +10 -0
  219. package/dist/esm/app-globals-8ced3a41.js.map +1 -0
  220. package/dist/esm/controls-a4768aaf.js +27 -0
  221. package/dist/esm/controls-a4768aaf.js.map +1 -0
  222. package/dist/esm/{floating-ui.dom.esm-f96ac766.js → floating-ui.dom.esm-61986f35.js} +468 -416
  223. package/dist/esm/floating-ui.dom.esm-61986f35.js.map +1 -0
  224. package/dist/esm/helpers-2e4ca34d.js +204 -0
  225. package/dist/esm/helpers-2e4ca34d.js.map +1 -0
  226. package/dist/esm/index-b1d6acd2.js +2118 -0
  227. package/dist/esm/index-b1d6acd2.js.map +1 -0
  228. package/dist/esm/index.js +39 -28
  229. package/dist/esm/index.js.map +1 -1
  230. package/dist/esm/library-2e5458af.js +113 -0
  231. package/dist/esm/library-2e5458af.js.map +1 -0
  232. package/dist/esm/loader.js +9 -7
  233. package/dist/esm/loader.js.map +1 -1
  234. package/dist/esm/qds-badge-counter_2.entry.js +146 -0
  235. package/dist/esm/qds-badge-counter_2.entry.js.map +1 -0
  236. package/dist/esm/qds-breadcrumb-item.entry.js +92 -0
  237. package/dist/esm/qds-breadcrumb-item.entry.js.map +1 -0
  238. package/dist/esm/qds-button.entry.js +321 -90
  239. package/dist/esm/qds-button.entry.js.map +1 -1
  240. package/dist/esm/qds-checkbox.entry.js +212 -100
  241. package/dist/esm/qds-checkbox.entry.js.map +1 -1
  242. package/dist/esm/qds-chip.entry.js +252 -0
  243. package/dist/esm/qds-chip.entry.js.map +1 -0
  244. package/dist/esm/qds-dialog.entry.js +104 -0
  245. package/dist/esm/qds-dialog.entry.js.map +1 -0
  246. package/dist/esm/qds-divider.entry.js +60 -18
  247. package/dist/esm/qds-divider.entry.js.map +1 -1
  248. package/dist/esm/qds-dropdown.entry.js +232 -206
  249. package/dist/esm/qds-dropdown.entry.js.map +1 -1
  250. package/dist/esm/qds-form-message.entry.js +82 -0
  251. package/dist/esm/qds-form-message.entry.js.map +1 -0
  252. package/dist/esm/qds-icon.entry.js +113 -90
  253. package/dist/esm/qds-icon.entry.js.map +1 -1
  254. package/dist/esm/qds-inline-link.entry.js +99 -46
  255. package/dist/esm/qds-inline-link.entry.js.map +1 -1
  256. package/dist/esm/qds-input.entry.js +404 -185
  257. package/dist/esm/qds-input.entry.js.map +1 -1
  258. package/dist/esm/qds-label.entry.js +102 -24
  259. package/dist/esm/qds-label.entry.js.map +1 -1
  260. package/dist/esm/qds-list-item.entry.js +153 -0
  261. package/dist/esm/qds-list-item.entry.js.map +1 -0
  262. package/dist/esm/qds-loader.entry.js +90 -0
  263. package/dist/esm/qds-loader.entry.js.map +1 -0
  264. package/dist/esm/qds-nav-list-item.entry.js +120 -0
  265. package/dist/esm/qds-nav-list-item.entry.js.map +1 -0
  266. package/dist/esm/qds-progress-bar.entry.js +131 -0
  267. package/dist/esm/qds-progress-bar.entry.js.map +1 -0
  268. package/dist/esm/qds-radio.entry.js +102 -57
  269. package/dist/esm/qds-radio.entry.js.map +1 -1
  270. package/dist/esm/qds-select.entry.js +319 -0
  271. package/dist/esm/qds-select.entry.js.map +1 -0
  272. package/dist/esm/qds-standalone-link.entry.js +130 -0
  273. package/dist/esm/qds-standalone-link.entry.js.map +1 -0
  274. package/dist/esm/qds-switch.entry.js +193 -64
  275. package/dist/esm/qds-switch.entry.js.map +1 -1
  276. package/dist/esm/qds-tab.entry.js +295 -0
  277. package/dist/esm/qds-tab.entry.js.map +1 -0
  278. package/dist/esm/qds-tabbar.entry.js +345 -0
  279. package/dist/esm/qds-tabbar.entry.js.map +1 -0
  280. package/dist/esm/qds-table-body.entry.js +50 -0
  281. package/dist/esm/qds-table-body.entry.js.map +1 -0
  282. package/dist/esm/qds-table-cell.entry.js +50 -0
  283. package/dist/esm/qds-table-cell.entry.js.map +1 -0
  284. package/dist/esm/qds-table-head-cell.entry.js +50 -0
  285. package/dist/esm/qds-table-head-cell.entry.js.map +1 -0
  286. package/dist/esm/qds-table-head.entry.js +50 -0
  287. package/dist/esm/qds-table-head.entry.js.map +1 -0
  288. package/dist/esm/qds-table-row.entry.js +50 -0
  289. package/dist/esm/qds-table-row.entry.js.map +1 -0
  290. package/dist/esm/qds-table.entry.js +50 -0
  291. package/dist/esm/qds-table.entry.js.map +1 -0
  292. package/dist/esm/qds-tag_2.entry.js +176 -0
  293. package/dist/esm/qds-tag_2.entry.js.map +1 -0
  294. package/dist/esm/qds-textarea.entry.js +288 -153
  295. package/dist/esm/qds-textarea.entry.js.map +1 -1
  296. package/dist/esm/qds-tooltip.entry.js +332 -260
  297. package/dist/esm/qds-tooltip.entry.js.map +1 -1
  298. package/dist/esm/qds.js +16 -14
  299. package/dist/esm/qds.js.map +1 -1
  300. package/dist/types/components/badge-counter/badge-counter.d.ts +40 -0
  301. package/dist/types/components/badge-indicator/badge-indicator.d.ts +36 -0
  302. package/dist/types/components/breadcrumb-item/breadcrumb-item.d.ts +160 -0
  303. package/dist/types/components/button/button.d.ts +272 -194
  304. package/dist/types/components/checkbox/checkbox.d.ts +137 -124
  305. package/dist/types/components/chip/chip.d.ts +109 -0
  306. package/dist/types/components/controls.d.ts +4 -1
  307. package/dist/types/components/dialog/dialog.d.ts +35 -0
  308. package/dist/types/components/divider/divider.d.ts +13 -9
  309. package/dist/types/components/dropdown/dropdown.d.ts +107 -125
  310. package/dist/types/components/form-message/form-message.d.ts +42 -0
  311. package/dist/types/components/icon/icon.d.ts +24 -24
  312. package/dist/types/components/icon/library.d.ts +3 -3
  313. package/dist/types/components/icon/request.d.ts +5 -9
  314. package/dist/types/components/inline-link/inline-link.d.ts +208 -191
  315. package/dist/types/components/input/input.d.ts +415 -368
  316. package/dist/types/components/label/label.d.ts +26 -24
  317. package/dist/types/components/list-item/list-item.d.ts +100 -0
  318. package/dist/types/components/loader/loader.d.ts +27 -0
  319. package/dist/types/components/nav-list-item/nav-list-item.d.ts +67 -0
  320. package/dist/types/components/progress-bar/progress-bar.d.ts +60 -0
  321. package/dist/types/components/radio/radio.d.ts +90 -95
  322. package/dist/types/components/select/select.d.ts +203 -0
  323. package/dist/types/components/shared.d.ts +6 -0
  324. package/dist/types/components/standalone-link/standalone-link.d.ts +233 -0
  325. package/dist/types/components/switch/switch.d.ts +114 -107
  326. package/dist/types/components/tab/tab.d.ts +160 -0
  327. package/dist/types/components/tabbar/tabbar.d.ts +47 -0
  328. package/dist/types/components/table/table.d.ts +15 -0
  329. package/dist/types/components/table-body/table-body.d.ts +15 -0
  330. package/dist/types/components/table-cell/table-cell.d.ts +32 -0
  331. package/dist/types/components/table-head/table-head.d.ts +15 -0
  332. package/dist/types/components/table-head-cell/table-head-cell.d.ts +56 -0
  333. package/dist/types/components/table-row/table-row.d.ts +15 -0
  334. package/dist/types/components/tag/tag.d.ts +55 -0
  335. package/dist/types/components/textarea/textarea.d.ts +285 -300
  336. package/dist/types/components/title/title.d.ts +39 -32
  337. package/dist/types/components/tooltip/tooltip.d.ts +123 -137
  338. package/dist/types/components.d.ts +3957 -833
  339. package/dist/types/helpers.d.ts +15 -16
  340. package/dist/types/index.d.ts +2 -1
  341. package/dist/types/interface-overrides.d.ts +211 -0
  342. package/dist/types/qds-test.d.ts +22 -11
  343. package/dist/types/stencil-public-runtime.d.ts +55 -15
  344. package/dist/types/utils.d.ts +11 -4
  345. package/dist/vscode.html-custom-data.json +1528 -210
  346. package/hydrate/index.d.ts +59 -18
  347. package/hydrate/index.js +25724 -9014
  348. package/hydrate/index.mjs +26627 -0
  349. package/hydrate/package.json +7 -1
  350. package/loader/cdn.js +3 -4
  351. package/loader/index.cjs.js +3 -4
  352. package/loader/index.d.ts +4 -1
  353. package/loader/index.es2017.js +3 -4
  354. package/loader/index.js +3 -4
  355. package/package.json +53 -89
  356. package/styles/core.css +137 -14
  357. package/components/floating-ui.dom.esm.js.map +0 -1
  358. package/components/helpers.js +0 -175
  359. package/components/helpers.js.map +0 -1
  360. package/components/icon.js +0 -175
  361. package/components/icon.js.map +0 -1
  362. package/components/label.js +0 -55
  363. package/components/label.js.map +0 -1
  364. package/dist/cjs/floating-ui.dom.esm-71fa96af.js.map +0 -1
  365. package/dist/cjs/helpers-452256e8.js +0 -185
  366. package/dist/cjs/helpers-452256e8.js.map +0 -1
  367. package/dist/cjs/index-d181f952.js +0 -2039
  368. package/dist/cjs/index-d181f952.js.map +0 -1
  369. package/dist/cjs/library-0a619eeb.js +0 -62
  370. package/dist/cjs/library-0a619eeb.js.map +0 -1
  371. package/dist/cjs/qds-title.cjs.entry.js +0 -66
  372. package/dist/cjs/qds-title.cjs.entry.js.map +0 -1
  373. package/dist/esm/floating-ui.dom.esm-f96ac766.js.map +0 -1
  374. package/dist/esm/helpers-76b84f45.js +0 -175
  375. package/dist/esm/helpers-76b84f45.js.map +0 -1
  376. package/dist/esm/index-d7183092.js +0 -2009
  377. package/dist/esm/index-d7183092.js.map +0 -1
  378. package/dist/esm/library-021aca11.js +0 -58
  379. package/dist/esm/library-021aca11.js.map +0 -1
  380. package/dist/esm/polyfills/core-js.js +0 -11
  381. package/dist/esm/polyfills/dom.js +0 -79
  382. package/dist/esm/polyfills/es5-html-element.js +0 -1
  383. package/dist/esm/polyfills/index.js +0 -34
  384. package/dist/esm/polyfills/system.js +0 -6
  385. package/dist/esm/qds-title.entry.js +0 -62
  386. package/dist/esm/qds-title.entry.js.map +0 -1
  387. package/dist/types/components/create-story.d.ts +0 -5
@@ -1 +1 @@
1
- {"file":"qds-input.entry.cjs.js","mappings":";;;;;;;;;;;;AAAA,MAAM,QAAQ,GAAG,4sEAA4sE;;AC0G7tE,IAAI,kBAAkB,GAAG,CAAC,CAAA;MAgBb,KAAK;;;;;;;IA8UR,wBAAmB,GAAe,EAAE,CAAA;IAmM3B,QAAG,GAAG,CAAC,KAAwB;MAC9C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;KACnB,CAAA;IAEgB,WAAM,GAAG,CAAC,KAAiB;MAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAACA,gCAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;KACvD,CAAA;IAEgB,aAAQ,GAAG;MAC1BC,iBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;MAErB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAA;MAC7B,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAA;KAC1B,CAAA;IAEgB,YAAO,GAAG,CAAC,KAAiB;MAC3C,I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AAM,EACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS,KAE1B,IAAI,CAAC,mBAAmB,GAC5B,EACH;GACF;;;;;;;;;;;;","names":["pickFocusEventAttributes","invariant","pickInputEventAttributes","inheritAriaAttributes","inheritAttributes","h"],"sources":["src/components/input/input.css?tag=qds-input&encapsulation=scoped","src/components/input/input.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2023 Schneider Electric\n *\n * SPDX-License-Identifier: LGPL-2.1-only\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.input {\n appearance: textfield;\n padding: 0;\n background-color: var(--qds-theme-control-input-background);\n border: var(--qds-control-border-width) solid var(--qds-theme-control-border);\n border-radius: var(--qds-control-border-radius);\n color: var(--qds-theme-control-text-standard);\n gap: var(--qds-control-input-gap-internal);\n padding-inline: var(--qds-control-input-padding-horizontal);\n width: 100%;\n\n &:not(:focus)[aria-invalid='true'] {\n border-color: var(--qds-theme-feedback-result-failure);\n }\n\n &[type='color'] {\n appearance: none;\n min-width: 50px;\n padding-block: var(--qds-control-input-padding-horizontal);\n\n &::-webkit-color-swatch-wrapper {\n padding: 0;\n }\n\n &::-webkit-color-swatch {\n border: var(--qds-control-border-width) solid\n var(--qds-theme-control-border);\n border-radius: var(--qds-control-border-radius);\n }\n\n &::-moz-color-swatch {\n border: var(--qds-control-border-width) solid\n var(--qds-theme-control-border);\n border-radius: var(--qds-control-border-radius);\n }\n\n cursor: pointer;\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n }\n\n &:disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n }\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n\n &:placeholder-shown {\n color: var(--qds-theme-control-text-placeholder);\n }\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n height: var(--qds-control-small-height);\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n height: var(--qds-control-standard-height);\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n height: var(--qds-control-large-height);\n}\n","// SPDX-FileCopyrightText: © 2023 Schneider Electric\n//\n// SPDX-License-Identifier: LGPL-2.1-only\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n Component,\n Element,\n Event,\n h,\n Method,\n Prop,\n Watch,\n} from '@stencil/core'\n\nimport type {\n Attributes,\n QdsFocusEventDetail,\n QdsInputEventDetail,\n} from '../../helpers'\nimport {\n inheritAriaAttributes,\n inheritAttributes,\n invariant,\n pickFocusEventAttributes,\n pickInputEventAttributes,\n} from '../../helpers'\nimport type {\n AutoCapitalize,\n EnterKeyHint,\n InputMode,\n SelectDirection,\n Value,\n} from '../controls'\n\nexport type InputAutoComplete =\n | 'additional-name'\n | 'address-level1'\n | 'address-level2'\n | 'address-level3'\n | 'address-level4'\n | 'address-line1'\n | 'address-line2'\n | 'address-line3'\n | 'bday-day'\n | 'bday-month'\n | 'bday-year'\n | 'bday'\n | 'cc-additional-name'\n | 'cc-csc'\n | 'cc-exp-month'\n | 'cc-exp-year'\n | 'cc-exp'\n | 'cc-family-name'\n | 'cc-given-name'\n | 'cc-name'\n | 'cc-number'\n | 'cc-type'\n | 'country-name'\n | 'country'\n | 'current-password'\n | 'email'\n | 'family-name'\n | 'given-name'\n | 'honorific-prefix'\n | 'honorific-suffix'\n | 'impp'\n | 'language'\n | 'name'\n | 'new-password'\n | 'nickname'\n | 'off'\n | 'on'\n | 'one-time-code'\n | 'organization-title'\n | 'organization'\n | 'photo'\n | 'postal-code'\n | 'sex'\n | 'street-address'\n | 'tel-area-code'\n | 'tel-country-code'\n | 'tel-extension'\n | 'tel-local'\n | 'tel-national'\n | 'tel'\n | 'transaction-amount'\n | 'transaction-currency'\n | 'url'\n | 'username'\nexport type InputType =\n | 'color'\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'month'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'text'\n | 'time'\n | 'url'\n | 'week'\nexport type InputSize = 'large' | 'small' | 'standard'\n\nlet autoIncrementingId = 1\n\n/**\n * The `<qds-input>` element is used to create interactive controls for\n * web-based forms in order to accept data from the user; a wide variety of\n * types of input data and control widgets are available, depending on the\n * device and\n * [user agent](https://developer.mozilla.org/docs/Glossary/User_agent).\n *\n * @see https://quartz.se.com/build/components/input\n */\n@Component({\n tag: 'qds-input',\n scoped: true,\n styleUrl: 'input.css',\n})\nexport class Input implements ComponentInterface {\n /**\n * Defines if the input is in an invalid state. Validity is determined by\n * attributes such as `type`, `pattern`, `min`, `max`, `required`, `step`,\n * `minlength`, and `maxlength` using\n * [constraint validation](https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation).\n */\n @Prop({ mutable: true, reflect: true }) public invalid?: boolean\n\n /**\n * The input's size.\n *\n * > **_NOTE:_** The native\n * [`size` HTML attribute](https://developer.mozilla.org/docs/Web/HTML/Attributes/size)\n * is not supported. CSS `width` should be used instead if this functionality\n * is needed.\n */\n @Prop({ reflect: true }) public readonly size: InputSize = 'standard'\n\n /**\n * Controls whether and how input is automatically capitalized as it is\n * entered/edited by the user. Only valid for `search`, `tel`, and `text`\n * inputs. Possible values:\n *\n * - `\"off\"` or `\"none\"`: No auto-capitalization is applied (all letters\n * default to lowercase).\n * - `\"on\"` or `\"sentences\"`: The first letter of each sentence defaults to a\n * capital letter; all other letters default to lowercase.\n * - `\"words\"`: The first letter of each word defaults to a capital letter;\n * all other letters default to lowercase.\n * - `\"characters\"`: All letters default to uppercase.\n *\n * @webnative\n */\n @Prop({ attribute: 'autocapitalize' })\n public readonly autoCapitalize?: AutoCapitalize\n\n /**\n * Indicates whether the value of the input can be automatically completed by\n * the browser.\n *\n * @webnative\n */\n @Prop({ attribute: 'autocomplete' })\n public readonly autoComplete?: InputAutoComplete\n\n /**\n * Specify whether the input should have focus when the page loads.\n *\n * @webnative\n */\n @Prop({ attribute: 'autofocus' }) public readonly autoFocus?: boolean\n\n /**\n * Prevents the input from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop({ mutable: true, reflect: true }) public disabled?: boolean\n\n /**\n * What action label (or icon) to present for the enter key on virtual\n * keyboards. Possible values:\n *\n * - `\"done\"`: Typically meaning there is nothing more to input and the input\n * method editor (IME) will be closed.\n * - `\"enter\"`:\tTypically inserting a new line.\n * - `\"go\"`: \tTypically meaning to take the user to the target of the text\n * they typed.\n * - `\"next\"`: \tTypically taking the user to the next field that will accept\n * text.\n * - `\"previous\"`: Typically taking the user to the previous field that will\n * accept text.\n * - `\"search\"`: Typically taking the user to the results of searching for\n * the text they have typed.\n * - `\"send\"`: Typically delivering the text to its target.\n *\n * @webnative\n */\n // FIXME: Can't use `attribute` option here to name this `enterKeyHint` instead.\n @Prop() public readonly enterkeyhint?: EnterKeyHint\n\n /**\n * The [`<form>`](https://developer.mozilla.org/docs/Web/HTML/Element/form)\n * element to associate the input with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<qds-input>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<qds-input>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n * an ancestor `<form>` element.\n *\n * @webnative\n */\n @Prop() public readonly form?: string\n\n /**\n * Provide a hint to browsers as to the type of virtual keyboard\n * configuration to use when editing this element or its contents.\n *\n * @webnative\n */\n // FIXME: Can't use `attribute` option here to name this `inputMode` instead.\n @Prop() public readonly inputmode?: InputMode\n\n /**\n * Defines the greatest value in the range of permitted values. If the\n * `value` entered into the input exceeds this, the input fails\n * [constraint validation](https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation).\n * Only valid for `date`, `datetime-local`, `month`, `time`, and `week`\n * inputs.\n *\n * If this value isn't a valid number, then the input has no maximum value.\n *\n * @webnative\n */\n @Prop() public readonly max?: number | string\n\n /**\n * The maximum number of characters (as UTF-16 code units) the user can enter\n * into the input. This must be an non-negative integer value. If no\n * `maxlength` is specified, or an invalid value is specified, the input has\n * no maximum length. Only valid for `email`, `password`, `search`, `tel`,\n * `text`, and `url` inputs.\n *\n * The input will fail\n * [constraint validation](https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation)\n * if the length of the text entered into the field is greater than\n * `maxlength` UTF-16 code units long. By default, browsers prevent users\n * from entering more characters than allowed by the `maxlength` attribute. See\n * [Client-side validation](https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation)\n * for more information.\n *\n * @webnative\n */\n @Prop({ attribute: 'maxlength' }) public readonly maxLength?: number\n\n /**\n * Defines the most negative value in the range of permitted values. If the\n * `value` entered into the input is less than this, the input fails\n * [constraint validation](https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation).\n * Only valid for `date`, `datetime-local`, `month`, `time`, and `week`\n * inputs.\n *\n * This value must be less than or equal to the value of the `max` attribute.\n * If this value isn't a valid number, then the input has no minimum value.\n *\n * @webnative\n */\n @Prop() public readonly min?: number | string\n\n /**\n * The minimum number of characters (as UTF-16 code units) the user can enter\n * into the input. This must be an non-negative integer value smaller than or\n * equal to the value specified by `maxlength`. If no `minlength` is\n * specified, or an invalid value is specified, the input has no minimum\n * length. Only valid for `email`, `password`, `search`, `tel`, `text`, and\n * `url` inputs.\n *\n * The input will fail\n * [constraint validation](https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation)\n * if the length of the text entered into the field is fewer than `minlength`\n * UTF-16 code units long, preventing form submission. See\n * [Client-side validation](https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation)\n * for more information.\n *\n * @webnative\n */\n @Prop({ attribute: 'minlength' }) public readonly minLength?: number\n\n /**\n * Specifies if multiple comma-separated email addresses can be entered. Only\n * valid for `email` inputs.\n *\n * @webnative\n */\n @Prop() public readonly multiple?: boolean\n\n /**\n * The name of the control, which is submitted with the form data. An\n * incrementing input ID is used by default.\n *\n * @webnative\n */\n @Prop() public readonly name = `qds-input-${autoIncrementingId}`\n\n /**\n * Defines a regular expression that the input's `value` must match in order\n * for the value to pass\n * [constraint validation](https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation).\n * It must be a valid JavaScript regular expression, as used by the\n * [`RegExp`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp)\n * type, and as documented in MDN's\n * [guide on regular expressions](https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions);\n * the `'u'` flag is specified when compiling the regular expression, so that\n * the pattern is treated as a sequence of Unicode code points, instead of as\n * ASCII. No forward slashes should be specified around the pattern text.\n * Only valid for `email`, `password`, `search`, `tel`, `text`, and `url`\n * inputs.\n *\n * If the `pattern` is invalid, no regular expression is applied and this\n * property is ignored. If the pattern is valid and a non-empty value does\n * not match the pattern, constraint validation will prevent form submission.\n *\n * @webnative\n */\n @Prop() public readonly pattern?: string\n\n /**\n * Text that appears in the input when it has no value set. Only valid for\n * `email`, `number`, `password`, `search`, `tel`, `text`, and `url` inputs.\n *\n * @webnative\n */\n @Prop() public readonly placeholder?: string\n\n /**\n * The value of the input cannot be edited. Not valid for `color` inputs.\n *\n * @webnative\n */\n @Prop({ attribute: 'readonly' }) public readonly readOnly?: boolean\n\n /**\n * A value must be specified for the input before the owning form can be\n * submitted. Not valid for `color` inputs.\n *\n * See\n * [Client-side validation](https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation)\n * and the\n * [HTML attribute: `required`](https://developer.mozilla.org/docs/Web/HTML/Attributes/required)\n * for more information.\n *\n * @webnative\n */\n @Prop() public readonly required?: boolean\n\n /**\n * Defines whether the input may be checked for spelling errors.\n *\n * @webnative\n */\n @Prop({ attribute: 'spellcheck' }) public readonly spellCheck?: boolean\n\n /**\n * Specifies the granularity that the `value` must adhere to. Only valid for\n * `date`, `datetime-local`, `month`, `number`, `time`, and `week` inputs.\n *\n * The value must be a positive number—integer or float—or the special value\n * `any`, which means no stepping is implied, and any value is allowed\n * (barring other constraints, such as `min` and `max`).\n *\n * If `any` is not explicitly set, valid values for the `number` are the\n * basis for stepping — the `min` value and increments of the step value, up\n * to the `max` value, if specified.\n *\n * @webnative\n */\n @Prop() public readonly step?: number | 'any'\n\n /**\n * The type of input to render:\n *\n * - `\"date\"`: An input for entering a date (year, month, and day, with no\n * time). Opens a date picker or numeric wheels for year, month, day when\n * active in supporting browsers.\n * - `\"datetime-local\"`: An input for entering a date and time, with no time\n * zone. Opens a date picker or numeric wheels for date and time components\n * when active in supporting browsers.\n * - `\"email\"`: An input for editing an email address. Looks like a `\"text\"`\n * input, but has validation parameters and relevant keyboard in supporting\n * browsers and devices with dynamic keyboards.\n * - `\"month\"`: An input for entering a month and year, with no time zone.\n * - `\"number\"`: An input for entering a number. Displays a spinner and adds\n * default validation when supported. Displays a numeric keypad in some\n * devices with dynamic keypads.\n * - `\"password\"`: A single-line text input whose value is obscured. Will\n * alert user if site is not secure.\n * - `\"search\"`: A single-line text input for entering search strings.\n * Line-breaks are automatically removed from the input value. May include a\n * delete icon in supporting browsers that can be used to clear the input.\n * Displays a search icon instead of enter key on some devices with dynamic\n * keypads.\n * - `\"tel\"`: An input for entering a telephone number. Displays a telephone\n * keypad in some devices with dynamic keypads.\n * - `\"text\"`: A single-line text input. Line-breaks are automatically\n * removed from the input value.\n * - `\"time\"`: An input for entering a time value with no time zone.\n * - `\"url\"`: An input for entering a URL. Looks like a `\"text\"` input, but\n * has validation parameters and relevant keyboard in supporting browsers and\n * devices with dynamic keyboards.\n * - `\"week\"`: An input for entering a date consisting of a week-year number\n * and a week number with no time zone.\n *\n * @webnative\n */\n @Prop() public readonly type?: InputType\n\n /**\n * The value of the input.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public value?: Value\n\n /**\n * Emitted when the input loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when an alteration to the input's value is committed by the user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the input gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the input's value changes.\n */\n @Event({ eventName: 'qdsInput', cancelable: false })\n private readonly inputEmitter!: EventEmitter<QdsInputEventDetail>\n\n @Element() private readonly element!: HTMLQdsInputElement\n\n private inheritedAttributes: Attributes = {}\n\n private input?: HTMLInputElement\n\n private get computedDisabled(): boolean {\n return this.disabled ?? false\n }\n\n /**\n * Returns true if the element's value passes validity checks; otherwise,\n * returns false, fires an invalid event at the element, and (if the event\n * isn't canceled) reports the problem to the user.\n */\n @Method()\n public async reportValidity(): Promise<boolean> {\n invariant(this.input)\n\n return this.input.reportValidity()\n }\n\n /**\n * Selects the entire content of the `<qds-input>` element if the element's\n * content is selectable.\n */\n @Method()\n public async select(): Promise<void> {\n invariant(this.input)\n\n this.input.select()\n }\n\n /**\n * Sets a custom validity message for the input. If this message is not the\n * empty string, then the element is considered invalid.\n */\n @Method()\n public async setCustomValidity(message: string): Promise<void> {\n invariant(this.input)\n\n this.input.setCustomValidity(message)\n this.invalid = !this.input.checkValidity()\n }\n\n /**\n * Sets the contents of the specified range of characters in the input element to a given string.\n *\n * @param replacement The string to insert.\n * @param start The 0-based index of the first character to replace. Defaults to the current selectionStart value (the start of the user's current selection).\n * @param end The 0-based index of the character _after_ the last character to replace. Defaults to the current selectionEnd value (the end of the user's current selection).\n * @param selectionMode A string defining how the selection should be set after the text has been replaced. Possible values:\n *\n * - `\"select\"` selects the newly inserted text.\n * - `\"start\"` moves the selection to just before the inserted text.\n * - `\"end\"` moves the selection to just after the inserted text.\n * - `\"preserve\"` attempts to preserve the selection.\n */\n @Method()\n public async setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectionMode: SelectionMode = 'preserve',\n ): Promise<void> {\n invariant(this.input)\n\n this.input.setRangeText(replacement, start, end, selectionMode)\n\n if (this.value !== this.input.value) {\n this.value = this.input.value\n this.inputEmitter.emit()\n this.changeEmitter.emit()\n }\n }\n\n /**\n * Selects the specified range of characters within the input.\n *\n * @param start The offset into the input for the start of the selection.\n * @param end The offset into the input for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n @Method()\n public async setSelectionRange(\n start: number | null,\n end: number | null,\n direction?: SelectDirection,\n ): Promise<void> {\n invariant(this.input)\n\n this.input.setSelectionRange(start, end, direction)\n }\n\n /**\n * Decrements the `value` by (`step` * n), where n defaults to 1 if not\n * specified.\n *\n * @param n Amount to decrement the value by.\n */\n @Method()\n public async stepDown(n?: number): Promise<void> {\n invariant(this.input)\n\n this.input.stepDown(n)\n }\n\n /**\n * Increments the `value` by (`step` * n), where n defaults to 1 if not\n * specified.\n *\n * @param n Amount to increment the value by.\n */\n @Method()\n public async stepUp(n?: number): Promise<void> {\n invariant(this.input)\n\n this.input.stepUp(n)\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n invariant(this.input)\n\n // Disabled inputs are always valid, so we need to recheck validity when\n // the state changes.\n this.input.disabled = this.computedDisabled\n this.invalid = !this.input.checkValidity()\n }\n\n @Watch('step')\n protected stepChanged(): void {\n invariant(this.input)\n\n // If step changes, the value may become invalid so we need to recheck\n // after the update. We set the new step imperatively so we don't have to\n // wait for the next render to report the updated validity.\n this.input.step = String(this.step)\n this.invalid = !this.input.checkValidity()\n }\n\n @Watch('value')\n protected valueChanged(): void {\n invariant(this.input)\n\n this.invalid = !this.input.checkValidity()\n }\n\n public componentWillLoad(): void {\n autoIncrementingId += 1\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.element),\n ...inheritAttributes(this.element, ['tabindex']),\n }\n }\n\n public render() {\n return (\n <input\n aria-invalid={this.invalid ?? false ? 'true' : 'false'}\n autoCapitalize={this.autoCapitalize}\n autoComplete={this.autoComplete}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.autoFocus}\n class=\"input\"\n data-size={this.size}\n disabled={this.disabled}\n enterKeyHint={this.enterkeyhint}\n form={this.form}\n inputMode={this.inputmode}\n max={this.max}\n maxLength={this.maxLength}\n min={this.min}\n minLength={this.minLength}\n multiple={this.multiple}\n name={this.name}\n onBlur={this.onBlur}\n onChange={this.onChange}\n onClick={this.onClick}\n onFocus={this.onFocus}\n onInput={this.onInput}\n onInvalid={this.onInvalid}\n pattern={this.pattern}\n placeholder={this.placeholder}\n readOnly={this.readOnly}\n ref={this.ref}\n required={this.required}\n spellcheck={this.spellCheck}\n step={this.step}\n type={this.type}\n value={this.value ?? undefined}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n />\n )\n }\n\n private readonly ref = (input?: HTMLInputElement): void => {\n this.input = input\n }\n\n private readonly onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onChange = (): void => {\n invariant(this.input)\n\n this.value = this.input.value\n this.changeEmitter.emit()\n }\n\n private readonly onClick = (event: MouseEvent): void => {\n if (this.computedDisabled) {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n private readonly onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onInput = (event: InputEvent): void => {\n invariant(this.input)\n\n this.value = this.input.value\n this.inputEmitter.emit(pickInputEventAttributes(event))\n }\n\n private readonly onInvalid = (): void => {\n this.invalid = true\n }\n}\n"],"version":3}
1
+ {"file":"qds-input.entry.cjs.js","mappings":";;;;;;;;;;;;;AAAA,MAAM,QAAQ,GAAG,+9TAA+9T,CAAC;AACj/T,uBAAe,QAAQ;;ACDvB;AACA;AACA;;;;;;;;;;;;;;;;;;MA+Da,KAAK;IANlB;;;;;;;;;;;;;;;;;;;;;QAa0B,WAAM,GAAa,KAAK,CAAA;;;;;;;;;QAUxB,SAAI,GAAU,UAAU,CAAA;;;;;;;;QA0FxB,UAAK,GAA8B,IAAI,CAAA;;;;;;;;;;;;;;;;;;QAmBvC,SAAI,GAAsC,IAAI,CAAA;;;;;;;;;;QAoB9C,WAAM,GAC5B,EAAgC,CAAA;;;;;;;;QA8I3B,uBAAkB,GAA2C,IAAI,CAAA;;;;;;;;QAWjE,iBAAY,GAAqC,IAAI,CAAA;;;;;;;;QAWrD,mBAAc,GAAuC,IAAI,CAAA;;;;;;;;QAgEhD,sBAAiB,GAA0C,EAAE,CAAA;;;;;;;;;QAUrD,aAAQ,GAAiCA,oBAAW,CAAA;;;;;;;;QAgBpD,iBAAY,GAAqC,KAAK,CAAA;QAwC9E,qCAAmC,EAAE,EAAA;QAErC,+BAAyB;QAuSlB,kBAAa,GAAsC,MACxD,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE,CAAA;QAEzB,mBAAc,GAAuC,MAC1D,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAA;QAE1B,sBAAiB,GAA0C,CAAC,KAAK;YACtEC,iBAAS,CAAC,uBAAA,IAAI,oBAAO,CAAC,CAAA;YAEtB,uBAAA,IAAI,oBAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA;YACpC,IAAI,KAAK;gBACP,IAAI,CAAC,SAAS,CAAC,WAAW,CAACC,2BAAkB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AAE,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAC5C;AACH,CAAC;IAGC,QACE,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ;QAC7B,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EACxE;AACH,CAAC,qDA4Wa,CAAc,EAAE,GAAkB;IAC9C,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAA;AAChE,CAAC;;;;;","names":["VALID_STATE","invariant","CUSTOM_ERROR_FLAGS","NO_ERROR_FLAGS","pickFocusEventAttributes","pickInputEventAttributes","inheritAriaAttributes","h"],"sources":["src/components/input/input.css?tag=qds-input&encapsulation=shadow","src/components/input/input.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n@-moz-document url-prefix() {\n [type='date'],\n [type='datetime-local'],\n [type='month'],\n [type='time'],\n [type='week'] {\n ~ .qds-icon-container {\n display: none;\n }\n }\n}\n\n.qds-container,\n.qds-input {\n max-width: inherit;\n width: inherit;\n}\n\n.qds-container {\n align-content: flex-start;\n align-items: center;\n box-sizing: border-box;\n display: grid;\n grid-template-areas: 'input';\n}\n\n.qds-icon {\n --qds-theme-interactive-background-hover: none;\n --qds-theme-interactive-background-pressed: none;\n --qds-control-small-height: var(--qds-control-small-icon-size);\n\n flex-shrink: 0;\n}\n\n.qds-input,\n.qds-icon-container {\n grid-area: input;\n}\n\n.qds-icon-container {\n display: flex;\n align-items: center;\n justify-content: center;\n justify-self: end;\n padding-inline-end: var(--qds-control-input-padding-horizontal);\n\n &.no-padding {\n padding-inline-end: 0;\n }\n}\n\n.qds-focus-ring {\n border-radius: max(\n 1px,\n var(\n --qds-control-border-radius-top-left,\n var(--qds-control-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-top-right,\n var(--qds-control-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-border-radius)\n )\n )\n max(\n 1px,\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-border-radius)\n )\n );\n grid-area: input;\n isolation: isolate;\n outline: var(--qds-control-input-focus-border-width) solid\n var(--qds-theme-control-input-focus-border);\n pointer-events: none;\n visibility: hidden;\n width: calc(\n 100% + var(--qds-control-border-width) -\n var(\n --qds-control-border-width-inline-end,\n var(--qds-control-border-width)\n )\n );\n height: calc(\n 100% + var(--qds-control-border-width) -\n var(--qds-control-border-width-block-end, var(--qds-control-border-width))\n );\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n height: var(--qds-control-small-height);\n\n &.qds-icon {\n --qds-experimental-icon-click-target-size: var(--qds-control-small-height);\n\n width: var(--qds-control-small-icon-size);\n height: var(--qds-control-small-icon-size);\n }\n\n & ~ .qds-icon-container {\n gap: var(--qds-control-small-gap-internal);\n margin-inline-start: var(--qds-control-small-gap-internal);\n }\n\n &[type='date'],\n &[type='datetime-local'],\n &[type='email'],\n &[type='month'],\n &[type='time'],\n &[type='url'],\n &[type='tel'],\n &[type='week'] {\n padding-inline: var(--qds-control-input-padding-horizontal)\n calc(\n var(--qds-control-input-padding-horizontal) +\n var(--qds-control-small-height)\n );\n }\n\n &[type='file']::file-selector-button {\n font: var(--qds-control-small-text);\n height: var(--qds-control-small-height);\n margin-inline-end: var(--qds-control-small-gap-siblings-related);\n padding-inline: var(--qds-control-button-small-padding-horizontal);\n }\n\n &[type='number']::-webkit-inner-spin-button,\n &[type='number']::-webkit-outer-spin-button {\n margin-inline-start: var(--qds-control-small-gap-internal);\n }\n\n &[type='search'] {\n padding-inline: var(--qds-control-input-padding-horizontal)\n calc(\n var(--qds-control-small-height) + var(--qds-control-small-icon-size) +\n var(--qds-control-input-padding-horizontal) +\n var(--qds-control-small-gap-internal)\n );\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n height: var(--qds-control-standard-height);\n\n &.qds-icon {\n --qds-experimental-icon-click-target-size: var(\n --qds-control-standard-height\n );\n\n width: var(--qds-control-standard-icon-size);\n height: var(--qds-control-standard-icon-size);\n }\n\n & ~ .qds-icon-container {\n gap: var(--qds-control-standard-gap-internal);\n margin-inline-start: var(--qds-control-standard-gap-internal);\n }\n\n &[type='date'],\n &[type='datetime-local'],\n &[type='email'],\n &[type='month'],\n &[type='time'],\n &[type='url'],\n &[type='tel'],\n &[type='week'] {\n padding-inline: var(--qds-control-input-padding-horizontal)\n calc(\n var(--qds-control-input-padding-horizontal) +\n var(--qds-control-standard-height)\n );\n }\n\n &[type='file']::file-selector-button {\n font: var(--qds-control-standard-text);\n height: var(--qds-control-standard-height);\n margin-inline-end: var(--qds-control-standard-gap-siblings-related);\n padding-inline: var(--qds-control-button-standard-padding-horizontal);\n }\n\n &[type='number']::-webkit-inner-spin-button,\n &[type='number']::-webkit-outer-spin-button {\n margin-inline-start: var(--qds-control-standard-gap-internal);\n }\n\n &[type='search'] {\n padding-inline: var(--qds-control-input-padding-horizontal)\n calc(\n var(--qds-control-small-height) + var(--qds-control-standard-icon-size) +\n var(--qds-control-input-padding-horizontal) +\n var(--qds-control-standard-gap-internal)\n );\n }\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n height: var(--qds-control-large-height);\n\n &.qds-icon {\n --qds-experimental-icon-click-target-size: var(--qds-control-large-height);\n\n width: var(--qds-control-large-icon-size);\n height: var(--qds-control-large-icon-size);\n }\n\n & ~ .qds-icon-container {\n gap: var(--qds-control-large-gap-internal);\n margin-inline-start: var(--qds-control-large-gap-internal);\n }\n\n &[type='date'],\n &[type='datetime-local'],\n &[type='email'],\n &[type='month'],\n &[type='time'],\n &[type='url'],\n &[type='tel'],\n &[type='week'] {\n padding-inline: var(--qds-control-input-padding-horizontal)\n calc(\n var(--qds-control-input-padding-horizontal) +\n var(--qds-control-large-height)\n );\n }\n\n &[type='file']::file-selector-button {\n font: var(--qds-control-large-text);\n height: var(--qds-control-large-height);\n margin-inline-end: var(--qds-control-large-gap-siblings-related);\n padding-inline: var(--qds-control-button-large-padding-horizontal);\n }\n\n &[type='number'] {\n &::-webkit-inner-spin-button,\n &::-webkit-outer-spin-button {\n margin-inline-start: var(--qds-control-large-gap-internal);\n }\n }\n\n &[type='search'] {\n padding-inline: var(--qds-control-input-padding-horizontal)\n calc(\n var(--qds-control-small-height) + var(--qds-control-large-icon-size) +\n var(--qds-control-input-padding-horizontal) +\n var(--qds-control-large-gap-internal)\n );\n }\n}\n\n.qds-input {\n appearance: textfield;\n background-color: var(--qds-theme-control-input-background);\n border-color: var(--qds-theme-control-border);\n border-radius: var(\n --qds-control-border-radius-top-left,\n var(--qds-control-border-radius)\n )\n var(--qds-control-border-radius-top-right, var(--qds-control-border-radius))\n var(\n --qds-control-border-radius-bottom-right,\n var(--qds-control-border-radius)\n )\n var(\n --qds-control-border-radius-bottom-left,\n var(--qds-control-border-radius)\n );\n border-style: solid;\n border-width: var(--qds-control-border-width)\n var(--qds-control-border-width-inline-end, var(--qds-control-border-width))\n var(--qds-control-border-width-block-end, var(--qds-control-border-width))\n var(--qds-control-border-width);\n box-sizing: border-box;\n color: var(--qds-theme-control-text-standard);\n grid-area: input;\n padding-block: 0;\n padding-inline: var(--qds-control-input-padding-horizontal);\n\n &.qds-hide ~ .qds-icon-container {\n display: none;\n }\n\n &:disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n }\n\n &:focus-visible {\n outline: none;\n\n ~ .qds-focus-ring {\n visibility: visible;\n }\n }\n\n &:placeholder-shown {\n color: var(--qds-theme-control-text-placeholder);\n }\n\n &:not(:focus):user-invalid {\n border-color: var(--qds-theme-feedback-result-failure);\n }\n\n &:is(\n [type='date'],\n [type='datetime-local'],\n [type='month'],\n [type='time'],\n [type='week']\n )::-webkit-calendar-picker-indicator,\n &::-webkit-search-cancel-button {\n cursor: pointer;\n display: none;\n }\n\n &[type='file'] {\n padding-block: var(--qds-control-input-padding-horizontal);\n\n &::file-selector-button {\n background-color: transparent;\n border: var(--qds-control-border-width) solid\n var(--qds-theme-control-border);\n border-radius: var(--qds-control-border-radius);\n color: var(--qds-theme-control-text-standard);\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n }\n }\n\n &[type='text'],\n &[type='password'],\n &[type='color'],\n &[type='number'] {\n padding-inline: var(--qds-control-input-padding-horizontal);\n }\n\n &[type='color'] {\n appearance: none;\n min-width: 50px;\n padding-block: var(--qds-control-input-padding-horizontal);\n\n &::-webkit-color-swatch-wrapper {\n padding: 0;\n }\n\n &::-webkit-color-swatch {\n border: var(--qds-control-border-width) solid\n var(--qds-theme-control-border);\n border-radius: var(--qds-control-border-radius);\n }\n\n &::-moz-color-swatch {\n border: var(--qds-control-border-width) solid\n var(--qds-theme-control-border);\n border-radius: var(--qds-control-border-radius);\n }\n\n cursor: pointer;\n\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n }\n\n &[data-size='small'],\n &[data-size='standard'],\n &[data-size='large'] {\n &.qds-search-padding {\n padding-inline: var(--qds-control-input-padding-horizontal)\n calc(\n var(--qds-control-small-height) +\n var(--qds-control-input-padding-horizontal)\n );\n }\n\n &[type='file'] {\n height: initial;\n }\n\n &.qds-padding {\n padding-inline: var(--qds-control-input-padding-horizontal);\n }\n\n @-moz-document url-prefix() {\n &[type='date'],\n &[type='datetime-local'],\n &[type='month'],\n &[type='week'],\n &[type='time'] {\n padding-inline-end: var(--qds-control-input-padding-horizontal);\n }\n }\n }\n\n @-moz-document url-prefix() {\n &[type='number'] {\n appearance: none;\n }\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n AttachInternals,\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type {\n Attributes,\n QdsFocusEventDetail,\n QdsInputEventDetail,\n} from '../../helpers'\nimport {\n inheritAriaAttributes,\n invariant,\n pickFocusEventAttributes,\n pickInputEventAttributes,\n} from '../../helpers'\nimport type { AutoComplete, EnterKeyHint, InputMode, Value } from '../controls'\nimport { CUSTOM_ERROR_FLAGS, NO_ERROR_FLAGS, VALID_STATE } from '../controls'\nimport type { Size } from '../shared'\n\nexport type Capture = '' | 'environment' | 'user'\n\nexport type InputType =\n | 'color'\n | 'date'\n | 'datetime-local'\n | 'email'\n | 'file'\n | 'month'\n | 'number'\n | 'password'\n | 'search'\n | 'tel'\n | 'text'\n | 'time'\n | 'url'\n | 'week'\n\n/**\n * The `<qds-input>` element is used to create interactive controls for\n * web-based forms in order to accept data from the user; a wide variety of\n * types of input data and control widgets are available, depending on the\n * device and\n * [user agent](https://developer.mozilla.org/docs/Glossary/User_agent).\n *\n * @see https://quartz.se.com/build/components/input\n */\n@Component({\n tag: 'qds-input',\n formAssociated: true,\n shadow: { delegatesFocus: true },\n styleUrl: 'input.css',\n})\nexport class Input implements ComponentInterface {\n /**\n * Hide the input type's icon.\n *\n * > **_NOTE:_** Due to browser limitations, the icon may not be hidden in\n * all browsers.\n */\n @Prop() public readonly noIcon?: boolean = false\n\n /**\n * The input's size.\n *\n * > **_NOTE:_** The native [`size` HTML attribute][size] is not supported.\n * CSS `width` should be used instead if this functionality is needed.\n *\n * [size]: https://developer.mozilla.org/docs/Web/HTML/Attributes/size\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Defines the file types the `file` type input should accept. This is a\n * comma-separated list of [unique file type specifiers][]. Because a given\n * file type may be identified in more than one manner, it's useful to\n * provide a thorough set of type specifiers when you files of a given format\n * are needed.\n *\n * For instance, there are a number of ways Microsoft Word files can be\n * identified, so a site that accepts Word files might use a `<qds-input>`\n * like this:\n *\n * @example\n * <qds-input\n * type=\"file\"\n * accept=\".doc,.docx,.xml,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n * ></qds-input>\n *\n * [unique file type specifiers]: https://developer.mozilla.org/docs/Web/HTML/Element/input/file#unique_file_type_specifiers\n *\n * @webnative\n */\n @Prop() public readonly accept?: string\n\n /**\n * Provides a hint for a [user agent's][] autocomplete feature. See\n * [the HTML `autocomplete` attribute][autocomplete] for a complete list of\n * values and details on how to use `autoComplete`.\n *\n * [user agent's]: https://developer.mozilla.org/docs/Glossary/User_agent\n * [autocomplete]: https://developer.mozilla.org/docs/Web/HTML/Attributes/autocomplete\n *\n * @webnative\n */\n @Prop({ attribute: 'autocomplete' })\n public readonly autoComplete?: AutoComplete\n\n /**\n * Specifies that a new file should be captured and which device should be\n * used to capture that new media of the type defined by `accept`.\n *\n * Values include `user`, `environment`, and `''`:\n *\n * - `user`: The user-facing camera and/or microphone should be used.\n * - `environment`: The outward-facing camera and/or microphone should be\n * used.\n * - `''`: The implementation-specific capture state.\n *\n * @webnative\n */\n @Prop() public readonly capture?: Capture\n\n /**\n * Prevents the input from being interacted with: it cannot be pressed or\n * focused.\n *\n * @webnative\n */\n @Prop() public readonly disabled?: boolean\n\n /**\n * What action label (or icon) to present for the enter key on virtual\n * keyboards. Possible values:\n *\n * - `\"done\"`: Typically meaning there is nothing more to input and the input\n * method editor (IME) will be closed.\n * - `\"enter\"`:\tTypically inserting a new line.\n * - `\"go\"`: \tTypically meaning to take the user to the target of the text\n * they typed.\n * - `\"next\"`: \tTypically taking the user to the next field that will accept\n * text.\n * - `\"previous\"`: Typically taking the user to the previous field that will\n * accept text.\n * - `\"search\"`: Typically taking the user to the results of searching for\n * the text they have typed.\n * - `\"send\"`: Typically delivering the text to its target.\n *\n * @webnative\n */\n // FIXME: Can't use `attribute` option here to name this `enterKeyHint` instead.\n @Prop() public readonly enterkeyhint?: EnterKeyHint\n\n /**\n * Returns a file list for a `file` type input.\n *\n * @readonly\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly files: HTMLInputElement['files'] = null\n\n /**\n * The [`<form>`][] element to associate the input with (its form owner).\n *\n * The value of this attribute must be the id of a `<form>` in the same\n * document. If this attribute is not set, the `<qds-input>` is associated\n * with its ancestor `<form>` element, if any.\n *\n * This attribute lets you associate `<qds-input>` elements to `<form>`s\n * anywhere in the document, not just inside a `<form>`. It can also override\n * an ancestor `<form>` element.\n *\n * [`<form>`]: https://developer.mozilla.org/docs/Web/HTML/Element/form\n *\n * @readonly\n * @webnative\n */\n // eslint-disable-next-line unicorn/no-null\n @Prop() public readonly form: ElementInternals['form'] | string = null\n\n /**\n * Provide a hint to browsers as to the type of virtual keyboard\n * configuration to use when editing this element or its contents.\n *\n * @webnative\n */\n // FIXME: Can't use `attribute` option here to name this `inputMode` instead.\n @Prop() public readonly inputmode?: InputMode\n\n /**\n * Returns a list of the [`<label>`][] elements associated with the\n * `qds-input` element.\n *\n * [`<label>`]: https://developer.mozilla.org/docs/Web/HTML/Element/label\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly labels: ElementInternals['labels'] =\n {} as ElementInternals['labels']\n\n /**\n * Defines the greatest value in the range of permitted values. If the\n * `value` entered into the input exceeds this, the input fails\n * [constraint validation][]. Only valid for `date`, `datetime-local`,\n * `month`, `time`, and `week` inputs.\n *\n * If this value isn't a valid number, then the input has no maximum value.\n *\n * [constraint validation]: https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation\n *\n * @webnative\n */\n @Prop() public readonly max?: number | string\n\n /**\n * The maximum number of characters (as UTF-16 code units) the user can enter\n * into the input. This must be an non-negative integer value. If no\n * `maxlength` is specified, or an invalid value is specified, the input has\n * no maximum length. Only valid for `email`, `password`, `search`, `tel`,\n * `text`, and `url` inputs.\n *\n * The input will fail [constraint validation][] if the length of the text\n * entered into the field is greater than `maxlength` UTF-16 code units long.\n * By default, browsers prevent users from entering more characters than\n * allowed by the `maxlength` attribute. See [Client-side validation][] for\n * more information.\n *\n * [constraint validation]: https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation\n * [Client-side validation]: https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation\n *\n * @webnative\n */\n @Prop({ attribute: 'maxlength' }) public readonly maxLength?: number\n\n /**\n * Defines the most negative value in the range of permitted values. If the\n * `value` entered into the input is less than this, the input fails\n * [constraint validation][]. Only valid for `date`, `datetime-local`,\n * `month`, `time`, and `week` inputs.\n *\n * This value must be less than or equal to the value of the `max` attribute.\n * If this value isn't a valid number, then the input has no minimum value.\n *\n * [constraint validation]: https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation\n *\n * @webnative\n */\n @Prop() public readonly min?: number | string\n\n /**\n * The minimum number of characters (as UTF-16 code units) the user can enter\n * into the input. This must be an non-negative integer value smaller than or\n * equal to the value specified by `maxlength`. If no `minlength` is\n * specified, or an invalid value is specified, the input has no minimum\n * length. Only valid for `email`, `password`, `search`, `tel`, `text`, and\n * `url` inputs.\n *\n * The input will fail [constraint validation][] if the length of the text\n * entered into the field is fewer than `minlength` UTF-16 code units long,\n * preventing form submission. See [Client-side validation][] for more\n * information.\n *\n * [constraint validation]: https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation\n * [Client-side validation]: https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation\n *\n * @webnative\n */\n @Prop({ attribute: 'minlength' }) public readonly minLength?: number\n\n /**\n * For `email` inputs, specifies if multiple comma-separated email addresses\n * can be entered. For `file` inputs, specifies if the user is allowed to\n * select more than one file.\n *\n * Only valid for `email` or `file` inputs.\n *\n * @webnative\n */\n @Prop() public readonly multiple?: boolean\n\n /**\n * The name of the input, which is submitted with the form data.\n *\n * @webnative\n */\n @Prop() public readonly name?: string\n\n /**\n * Defines a regular expression that the input's `value` must match in order\n * for the value to pass [constraint validation][]. It must be a valid\n * JavaScript regular expression, as used by the [`RegExp`][] type, and as\n * documented in MDN's [guide on regular expressions][]; the `'u'` flag is\n * specified when compiling the regular expression, so that the pattern is\n * treated as a sequence of Unicode code points, instead of as ASCII. No\n * forward slashes should be specified around the pattern text. Only valid\n * for `email`, `password`, `search`, `tel`, `text`, and `url` inputs.\n *\n * If the `pattern` is invalid, no regular expression is applied and this\n * property is ignored. If the pattern is valid and a non-empty value does\n * not match the pattern, constraint validation will prevent form submission.\n *\n * [constraint validation]: https://developer.mozilla.org/docs/Web/Guide/HTML/Constraint_validation\n * [`RegExp`]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp\n * [guide on regular expressions]: https://developer.mozilla.org/docs/Web/JavaScript/Guide/Regular_Expressions\n *\n * @webnative\n */\n @Prop() public readonly pattern?: string\n\n /**\n * Text that appears in the input when it has no value set. Only valid for\n * `email`, `number`, `password`, `search`, `tel`, `text`, and `url` inputs.\n *\n * @webnative\n */\n @Prop() public readonly placeholder?: string\n\n /**\n * A value must be specified for the input before the owning form can be\n * submitted. Not valid for `color` inputs.\n *\n * See [Client-side validation][] and the\n * [HTML attribute: `required`][required] for more information.\n *\n * [Client-side validation]: https://developer.mozilla.org/docs/Web/HTML/Element/input#client-side_validation\n * [required]: https://developer.mozilla.org/docs/Web/HTML/Attributes/required\n *\n * @webnative\n */\n @Prop() public readonly required?: boolean\n\n /**\n * Get or set the selection direction of a text selection.\n *\n * > **_NOTE:_** This property has no effect when used as an attribute.\n *\n * @webnative\n */\n @Prop({ mutable: true })\n // eslint-disable-next-line unicorn/no-null\n public selectionDirection: HTMLInputElement['selectionDirection'] = null\n\n /**\n * Get or set the ending position or offset of a text selection.\n *\n * > **_NOTE:_** This property has no effect when used as an attribute.\n *\n * @webnative\n */\n @Prop({ mutable: true })\n // eslint-disable-next-line unicorn/no-null\n public selectionEnd: HTMLInputElement['selectionEnd'] = null\n\n /**\n * Get or set the starting position or offset of a text selection.\n *\n * > **_NOTE:_** This property has no effect when used as an attribute.\n *\n * @webnative\n */\n @Prop({ mutable: true })\n // eslint-disable-next-line unicorn/no-null\n public selectionStart: HTMLInputElement['selectionStart'] = null\n\n /**\n * Specifies the granularity that the `value` must adhere to. Only valid for\n * `date`, `datetime-local`, `month`, `number`, `time`, and `week` inputs.\n *\n * The value must be a positive number—integer or float—or the special value\n * `any`, which means no stepping is implied, and any value is allowed\n * (barring other constraints, such as `min` and `max`).\n *\n * If `any` is not explicitly set, valid values for the `number` are the\n * basis for stepping — the `min` value and increments of the step value, up\n * to the `max` value, if specified.\n *\n * @webnative\n */\n @Prop() public readonly step?: number | 'any'\n\n /**\n * The type of input to render:\n *\n * - `\"date\"`: An input for entering a date (year, month, and day, with no\n * time). Opens a date picker or numeric wheels for year, month, day when\n * active in supporting browsers.\n * - `\"datetime-local\"`: An input for entering a date and time, with no time\n * zone. Opens a date picker or numeric wheels for date and time components\n * when active in supporting browsers.\n * - `\"email\"`: An input for editing an email address. Looks like a `\"text\"`\n * input, but has validation parameters and relevant keyboard in supporting\n * browsers and devices with dynamic keyboards.\n * - `\"month\"`: An input for entering a month and year, with no time zone.\n * - `\"number\"`: An input for entering a number. Displays a spinner and adds\n * default validation when supported. Displays a numeric keypad in some\n * devices with dynamic keypads.\n * - `\"password\"`: A single-line text input whose value is obscured. Will\n * alert user if site is not secure.\n * - `\"search\"`: A single-line text input for entering search strings.\n * Line-breaks are automatically removed from the input value. May include a\n * delete icon in supporting browsers that can be used to clear the input.\n * Displays a search icon instead of enter key on some devices with dynamic\n * keypads.\n * - `\"tel\"`: An input for entering a telephone number. Displays a telephone\n * keypad in some devices with dynamic keypads.\n * - `\"text\"`: A single-line text input. Line-breaks are automatically\n * removed from the input value.\n * - `\"time\"`: An input for entering a time value with no time zone.\n * - `\"url\"`: An input for entering a URL. Looks like a `\"text\"` input, but\n * has validation parameters and relevant keyboard in supporting browsers and\n * devices with dynamic keyboards.\n * - `\"week\"`: An input for entering a date consisting of a week-year number\n * and a week number with no time zone.\n *\n * @webnative\n */\n @Prop() public readonly type?: InputType\n\n /**\n * The error message that would be shown to the user if the `<qds-input>`\n * was to be checked for validity.\n *\n * @readonly\n * @webnative\n */\n @Prop()\n public readonly validationMessage: ElementInternals['validationMessage'] = ''\n\n /**\n * The [`ValidityState`][] object for this `<qds-input>`.\n *\n * [`ValidityState`]: https://developer.mozilla.org/docs/Web/API/ValidityState\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly validity: ElementInternals['validity'] = VALID_STATE\n\n /**\n * The value of the input.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public value?: Value\n\n /**\n * True if `<qds-input>` will be validated when the form is submitted; false\n * otherwise.\n *\n * @readonly\n * @webnative\n */\n @Prop() public readonly willValidate: ElementInternals['willValidate'] = false\n\n @AttachInternals() private readonly internals!: ElementInternals\n\n /**\n * Emitted when the input loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the user cancels the file picker via the <kbd>Esc</kbd> key\n * or the cancel button and when the user re-selects the same files that were\n * previously selected.\n */\n @Event({ eventName: 'qdsCancel', cancelable: false })\n private readonly cancelEmitter!: EventEmitter<void>\n\n /**\n * Emitted when an alteration to the input's value is committed by the user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the input gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the input's value changes.\n */\n @Event({ eventName: 'qdsInput', cancelable: false })\n private readonly inputEmitter!: EventEmitter<QdsInputEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private tabIndex?: number\n\n #inheritedAttributes: Attributes = {}\n\n #input?: HTMLInputElement\n\n get #computedDisabled(): boolean {\n return this.host.matches(':disabled') || (this.disabled ?? false)\n }\n\n get #computedIconName(): `input-${InputType}` | undefined {\n switch (this.type) {\n case 'date':\n case 'datetime-local':\n case 'email':\n case 'month':\n case 'search':\n case 'tel':\n case 'time':\n case 'url':\n case 'week': {\n return `input-${this.type}`\n }\n default: {\n return undefined\n }\n }\n }\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n get #computedValue(): Parameters<ElementInternals['setFormValue']>[0] {\n if (typeof this.value === 'number') return this.value.toString()\n // eslint-disable-next-line unicorn/no-null\n return this.value === undefined ? null : this.value\n }\n\n get #hasIcon(): boolean {\n return (\n typeof this.type === 'string' &&\n ['email', 'tel', 'url'].includes(this.type)\n )\n }\n\n get #hasInteractiveIcon(): boolean {\n return (\n typeof this.type === 'string' &&\n ['month', 'time', 'date', 'datetime-local', 'week'].includes(this.type)\n )\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.#computedDisabled) event.stopImmediatePropagation()\n }\n\n @Listen('keydown')\n protected onKeydown(event: KeyboardEvent): void {\n if (this.#computedDisabled) {\n event.stopImmediatePropagation()\n return\n }\n\n if (event.key === 'Enter' && this.internals.form) {\n this.internals.form.requestSubmit()\n event.preventDefault()\n }\n }\n\n @Watch('disabled')\n protected disabledChanged(): void {\n if (this.#computedDisabled)\n // eslint-disable-next-line unicorn/no-null\n this.internals.setFormValue(null)\n else this.internals.setFormValue(this.#computedValue)\n }\n\n @Watch('selectionDirection')\n protected selectionDirectionChanged(): void {\n invariant(this.#input)\n\n this.#input.selectionDirection = this.selectionDirection\n }\n\n @Watch('selectionEnd')\n protected selectionEndChanged(): void {\n invariant(this.#input)\n\n this.#input.selectionEnd = this.selectionEnd\n }\n\n @Watch('selectionStart')\n protected selectionStartChanged(): void {\n invariant(this.#input)\n\n this.#input.selectionStart = this.selectionStart\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n @Watch('max')\n @Watch('maxLength')\n @Watch('min')\n @Watch('minLength')\n @Watch('pattern')\n @Watch('required')\n @Watch('step')\n @Watch('type')\n @Watch('value')\n protected validationChanged(): void {\n if (!this.#input) return\n\n if (this.#input.max !== this.max && this.max !== undefined)\n this.#input.max = this.max.toString()\n if (this.maxLength !== undefined) this.#input.maxLength = this.maxLength\n if (this.#input.min !== this.min && this.min !== undefined)\n this.#input.min = this.min.toString()\n if (this.minLength !== undefined) this.#input.minLength = this.minLength\n if (this.pattern !== undefined) this.#input.pattern = this.pattern\n this.#input.required = this.required ?? false\n if (this.#input.step !== this.step && this.step !== undefined)\n this.#input.step = this.step.toString()\n if (this.type !== undefined) this.#input.type = this.type\n // eslint-disable-next-line unicorn/no-null\n if (this.type !== 'file' && this.value != null)\n this.#input.value = this.value.toString()\n\n const { valid } = this.#input.validity\n if (valid)\n this.internals.setValidity(NO_ERROR_FLAGS, undefined, this.#input)\n else\n this.internals.setValidity(\n this.#input.validity,\n this.#input.validationMessage,\n this.#input,\n )\n }\n\n @Watch('value')\n protected valueChanged(): void {\n if (!this.#computedDisabled)\n this.internals.setFormValue(this.#computedValue)\n }\n\n public componentWillLoad(): void {\n this.#defineGetter('form', () => this.internals.form)\n this.#defineGetter('willValidate', () => this.internals.willValidate)\n this.#defineGetter('validity', () => this.internals.validity)\n this.#defineGetter(\n 'validationMessage',\n () => this.internals.validationMessage,\n )\n this.#defineGetter('files', this.#getFiles)\n this.#defineGetter('labels', () => this.internals.labels)\n\n this.#inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public componentDidLoad(): void {\n invariant(this.#input)\n\n this.validationChanged()\n this.valueChanged()\n // FIXME: This event is supported by the native `<input>` element but not\n // recognized by Stencil's type definitions, so it needs to be manually\n // bound here.\n this.#input.addEventListener('cancel', this.#onCancel)\n }\n\n public disconnectedCallback(): void {\n if (this.#input) this.#input.removeEventListener('cancel', this.#onCancel)\n }\n\n public render() {\n const hasValue =\n this.value !== null && this.value !== undefined && this.value !== ''\n const isSearchType = this.type === 'search'\n const shouldShowClearButton = isSearchType && hasValue\n const shouldShowSearchIcon = isSearchType && this.noIcon === false\n const shouldHideIcon = !isSearchType && this.noIcon === true\n const shouldRemoveSearchPadding = isSearchType && this.noIcon === true\n\n return (\n <div class=\"qds-container\">\n <input\n accept={this.accept}\n autoCapitalize={this.host.autocapitalize}\n autoComplete={this.autoComplete}\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus={this.host.autofocus}\n capture={this.capture}\n class={{\n 'qds-search-padding': shouldRemoveSearchPadding,\n 'qds-input': true,\n 'qds-hide': shouldHideIcon,\n 'qds-padding': shouldHideIcon,\n }}\n data-size={this.#computedSize}\n disabled={this.disabled}\n enterKeyHint={this.enterkeyhint}\n inputMode={this.inputmode}\n max={this.max}\n maxLength={this.maxLength}\n min={this.min}\n minLength={this.minLength}\n multiple={this.multiple}\n onBlur={this.#onBlur}\n onChange={this.#onChange}\n onFocus={this.#onFocus}\n onInput={this.#onInput}\n placeholder={this.placeholder}\n ref={this.#ref}\n spellcheck={this.host.spellcheck}\n step={this.step}\n tabIndex={this.#computedDisabled ? undefined : this.tabIndex}\n type={this.type}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.#inheritedAttributes}\n />\n <div class=\"qds-focus-ring\" />\n {this.#computedIconName && (\n <div\n class={{\n 'qds-icon-container': true,\n 'no-padding': shouldRemoveSearchPadding,\n }}\n >\n {shouldShowClearButton && (\n <qds-button\n class={{\n 'qds-icon': true,\n 'qds-hide': !hasValue,\n }}\n disabled={this.disabled}\n iconLibrary=\"core\"\n iconName=\"clear\"\n iconOnly\n importance=\"subdued\"\n onClick={this.#onClear}\n size=\"small\"\n text=\"clear input\"\n />\n )}\n {this.#hasIcon && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library=\"core\"\n name={this.#computedIconName}\n />\n )}\n {this.#hasInteractiveIcon && (\n <qds-button\n class=\"qds-icon\"\n disabled={this.disabled}\n iconLibrary=\"core\"\n iconName={this.#computedIconName}\n iconOnly\n importance=\"subdued\"\n onClick={this.showPicker}\n size=\"small\"\n text={this.type ?? ''}\n />\n )}\n {shouldShowSearchIcon ? (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon\"\n data-size={this.#computedSize}\n library=\"core\"\n name={this.#computedIconName}\n />\n ) : (\n <div />\n )}\n </div>\n )}\n </div>\n )\n }\n\n public checkValidity: ElementInternals['checkValidity'] = () =>\n this.internals.checkValidity()\n\n public reportValidity: ElementInternals['reportValidity'] = () =>\n this.internals.reportValidity()\n\n public setCustomValidity: HTMLInputElement['setCustomValidity'] = (error) => {\n invariant(this.#input)\n\n this.#input.setCustomValidity(error)\n if (error)\n this.internals.setValidity(CUSTOM_ERROR_FLAGS, error, this.#input)\n else this.internals.setValidity(NO_ERROR_FLAGS)\n }\n\n public select: HTMLInputElement['select'] = () => {\n invariant(this.#input)\n\n this.#input.select()\n }\n\n public getSelectionDirection: () => HTMLInputElement['selectionDirection'] =\n () => {\n invariant(this.#input)\n\n return this.#input.selectionDirection\n }\n\n public getSelectionStart: () => HTMLInputElement['selectionStart'] = () => {\n invariant(this.#input)\n\n return this.#input.selectionStart\n }\n\n public getSelectionEnd: () => HTMLInputElement['selectionEnd'] = () => {\n invariant(this.#input)\n\n return this.#input.selectionEnd\n }\n\n public setRangeText = (\n replacement: string,\n start: number,\n end: number,\n selectionMode?: SelectionMode,\n ): void => {\n invariant(this.#input)\n\n this.#input.setRangeText(replacement, start, end, selectionMode)\n\n if (this.value !== this.#input.value) {\n this.value = this.#input.value\n this.inputEmitter.emit()\n this.changeEmitter.emit()\n }\n }\n\n public setSelectionRange: HTMLInputElement['setSelectionRange'] = (\n start,\n end,\n direction,\n ) => {\n invariant(this.#input)\n\n this.#input.setSelectionRange(start, end, direction)\n }\n\n public stepDown: HTMLInputElement['stepDown'] = (n) => {\n invariant(this.#input)\n\n this.#input.stepDown(n)\n }\n\n public stepUp: HTMLInputElement['stepUp'] = (n) => {\n invariant(this.#input)\n\n this.#input.stepUp(n)\n }\n\n public showPicker: HTMLInputElement['showPicker'] = () => {\n invariant(this.#input)\n\n this.#input.showPicker()\n }\n\n readonly #ref = (input?: HTMLInputElement): void => {\n this.#input = input\n }\n\n readonly #getFiles: () => HTMLInputElement['files'] = () => {\n invariant(this.#input)\n\n return this.#input.files\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onCancel = (): void => {\n this.cancelEmitter.emit()\n }\n\n readonly #onChange = (): void => {\n this.changeEmitter.emit()\n }\n\n readonly #onClear = (): void => {\n invariant(this.#input)\n\n this.#input.value = ''\n this.#onInput(new InputEvent('input', { inputType: 'deleteContent' }))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onInput = (event: InputEvent): void => {\n invariant(this.#input)\n\n this.value = this.#input.value\n this.inputEmitter.emit(pickInputEventAttributes(event))\n }\n\n #defineGetter(p: PropertyKey, get: () => unknown): void {\n Object.defineProperty(this.host, p, { enumerable: true, get })\n }\n}\n"],"version":3}
@@ -1,38 +1,116 @@
1
1
  /*!
2
- * SPDX-FileCopyrightText: © 2023 Schneider Electric
2
+ * SPDX-FileCopyrightText: © 2025 Schneider Electric
3
3
  *
4
- * SPDX-License-Identifier: LGPL-2.1-only
4
+ * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  'use strict';
7
7
 
8
8
  Object.defineProperty(exports, '__esModule', { value: true });
9
9
 
10
- const index = require('./index-d181f952.js');
11
- const helpers = require('./helpers-452256e8.js');
10
+ const index = require('./index-523dd2e0.js');
11
+ const helpers = require('./helpers-10154521.js');
12
12
 
13
- const labelCss = ":host{box-sizing:border-box}:host([hidden]){display:none !important}:host([hidden]){}:host *,:host *::before,:host *::after{box-sizing:inherit}:host{display:inline-block}.label{color:var(--qds-theme-control-text-standard);display:inline-block}.required{color:var(--qds-theme-feedback-field-required);-webkit-user-select:none;user-select:none}[data-size='small']{font:var(--qds-control-small-text)}.inline[data-size='small']{margin-block:var(--qds-control-small-padding-auto-height)}[data-size='standard']{font:var(--qds-control-standard-text)}.inline[data-size='standard']{margin-block:var(--qds-control-standard-padding-auto-height)}[data-size='large']{font:var(--qds-control-large-text)}.inline[data-size='large']{margin-block:var(--qds-control-large-padding-auto-height)}";
13
+ const labelCss = ":host([hidden]){display:none!important}:host{display:inline-block}.qds-label{box-sizing:border-box;color:var(--qds-theme-control-text-standard);display:inline-flex;gap:var(--qds-text-icon-gap)}.qds-label:focus-visible{border-radius:var(--qds-focus-border-radius);outline:var(--qds-focus-border-width) solid var(--qds-theme-focus-border);outline-offset:var(--qds-focus-border-offset)}.qds-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.qds-required{color:var(--qds-theme-feedback-field-required);-webkit-user-select:none;user-select:none}[data-size=small]{font:var(--qds-control-small-text)}.qds-inline[data-size=small]{margin-block:var(--qds-control-small-padding-auto-height)}[data-size=standard]{font:var(--qds-control-standard-text)}.qds-inline[data-size=standard]{margin-block:var(--qds-control-standard-padding-auto-height)}[data-size=large]{font:var(--qds-control-large-text)}.qds-inline[data-size=large]{margin-block:var(--qds-control-large-padding-auto-height)}";
14
+ const QdsLabelStyle0 = labelCss;
14
15
 
16
+ // SPDX-FileCopyrightText: © 2024 Schneider Electric
17
+ //
18
+ // SPDX-License-Identifier: Apache-2.0
19
+ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
20
+ if (kind === "a" && !f)
21
+ throw new TypeError("Private accessor was defined without a getter");
22
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
23
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
24
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
25
+ };
26
+ var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
27
+ if (kind === "m")
28
+ throw new TypeError("Private method is not writable");
29
+ if (kind === "a" && !f)
30
+ throw new TypeError("Private accessor was defined without a setter");
31
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
32
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
33
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
34
+ };
35
+ var _Label_instances, _Label_label, _Label_ro, _Label_span, _Label_computedSize_get, _Label_labelRef, _Label_spanRef, _Label_tooltipRef;
15
36
  const Label = class {
16
- constructor(hostRef) {
17
- index.registerInstance(this, hostRef);
18
- this.inheritedAttributes = {};
19
- this.inline = false;
20
- this.required = false;
21
- this.size = 'standard';
22
- this.text = undefined;
23
- }
24
- componentWillLoad() {
25
- this.inheritedAttributes = helpers.inheritAriaAttributes(this.element);
26
- }
27
- render() {
28
- return (index.h("span", { class: {
29
- inline: this.inline,
30
- label: true,
31
- }, "data-size": this.size, ...this.inheritedAttributes }, this.required && index.h("span", { class: "required" }, "*"), this.text));
32
- }
33
- get element() { return index.getElement(this); }
37
+ constructor(hostRef) {
38
+ index.registerInstance(this, hostRef);
39
+ _Label_instances.add(this);
40
+ /**
41
+ * Adds vertical margin to the label for alignment.
42
+ *
43
+ * This is useful when creating inline layouts so that the first lines have
44
+ * the correct vertical centering.
45
+ */
46
+ this.inline = false;
47
+ /**
48
+ * Specify the labelled item as required by appending a red asterisk (*).
49
+ */
50
+ this.required = false;
51
+ /**
52
+ * The label's size.
53
+ */
54
+ this.size = 'standard';
55
+ this.tooltip = false;
56
+ _Label_label.set(this, void 0);
57
+ _Label_ro.set(this, void 0);
58
+ _Label_span.set(this, void 0);
59
+ _Label_labelRef.set(this, (label) => {
60
+ __classPrivateFieldSet(this, _Label_label, label, "f");
61
+ });
62
+ _Label_spanRef.set(this, (span) => {
63
+ __classPrivateFieldSet(this, _Label_span, span, "f");
64
+ });
65
+ _Label_tooltipRef.set(this, (tooltip) => {
66
+ if (tooltip)
67
+ // eslint-disable-next-line no-param-reassign
68
+ tooltip.target = __classPrivateFieldGet(this, _Label_label, "f");
69
+ });
70
+ }
71
+ textChanged() {
72
+ if (__classPrivateFieldGet(this, _Label_ro, "f"))
73
+ __classPrivateFieldGet(this, _Label_ro, "f").disconnect();
74
+ if (!__classPrivateFieldGet(this, _Label_span, "f"))
75
+ return;
76
+ this.tooltip = helpers.isOverflowing(__classPrivateFieldGet(this, _Label_span, "f"));
77
+ __classPrivateFieldSet(this, _Label_ro, new ResizeObserver(([spanEntry]) => {
78
+ this.tooltip = helpers.isOverflowing(spanEntry.target);
79
+ }), "f");
80
+ __classPrivateFieldGet(this, _Label_ro, "f").observe(__classPrivateFieldGet(this, _Label_span, "f"));
81
+ }
82
+ componentDidLoad() {
83
+ this.textChanged();
84
+ }
85
+ disconnectedCallback() {
86
+ if (__classPrivateFieldGet(this, _Label_ro, "f"))
87
+ __classPrivateFieldGet(this, _Label_ro, "f").disconnect();
88
+ }
89
+ render() {
90
+ return (index.h("span", { key: '87f5b083f2433de63705377cd25132dd4b9a4ec8', class: {
91
+ 'qds-inline': this.inline,
92
+ 'qds-label': true,
93
+ }, "data-size": __classPrivateFieldGet(this, _Label_instances, "a", _Label_computedSize_get), ref: __classPrivateFieldGet(this, _Label_labelRef, "f"),
94
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
95
+ tabIndex: this.tooltip ? 0 : undefined }, this.required && index.h("span", { key: '46a398ab4adb384d7117fd327a1c2dd9a3567a9e', class: "qds-required" }, "*"), index.h("span", { key: 'c62c558ab3a364c9310a6eaa0571d33a78675a13', class: "qds-text", ref: __classPrivateFieldGet(this, _Label_spanRef, "f") }, this.text), this.tooltip && (index.h("qds-tooltip", { key: 'ddfb792feda73cad459fbfbc823cd2b84a11ed42', "aria-hidden": "true", ref: __classPrivateFieldGet(this, _Label_tooltipRef, "f") }, this.text))));
96
+ }
97
+ static get watchers() { return {
98
+ "text": ["textChanged"]
99
+ }; }
100
+ };
101
+ _Label_label = new WeakMap(), _Label_ro = new WeakMap(), _Label_span = new WeakMap(), _Label_labelRef = new WeakMap(), _Label_spanRef = new WeakMap(), _Label_tooltipRef = new WeakMap(), _Label_instances = new WeakSet(), _Label_computedSize_get = function _Label_computedSize_get() {
102
+ switch (this.size) {
103
+ case 'standard':
104
+ case 'small':
105
+ case 'large': {
106
+ return this.size;
107
+ }
108
+ default: {
109
+ return 'standard';
110
+ }
111
+ }
34
112
  };
35
- Label.style = labelCss;
113
+ Label.style = QdsLabelStyle0;
36
114
 
37
115
  exports.qds_label = Label;
38
116
 
@@ -1 +1 @@
1
- {"file":"qds-label.entry.cjs.js","mappings":";;;;;;;;;;;;AAAA,MAAM,QAAQ,GAAG,wwBAAwwB;;MCsB5wB,KAAK;;;IA0BR,wBAAmB,GAAe,EAAE,CAAA;kBAnBF,KAAK;oBAKH,KAAK;gBAKU,UAAU;;;EAW9D,iBAAiB;IACtB,IAAI,CAAC,mBAAmB,GAAGA,6BAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;GAC/D;EAEM,MAAM;IACX,QACEC,kBACE,KAAK,EAAE;QACL,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,KAAK,EAAE,IAAI;OACZ,eACU,IAAI,CAAC,IAAI,KAEhB,IAAI,CAAC,mBAAmB,IAE3B,IAAI,CAAC,QAAQ,IAAIA,kBAAM,KAAK,EAAC,UAAU,QAAS,EAChD,IAAI,CAAC,IAAI,CACL,EACR;GACF;;;;;;;","names":["inheritAriaAttributes","h"],"sources":["src/components/label/label.css?tag=qds-label&encapsulation=shadow","src/components/label/label.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2023 Schneider Electric\n *\n * SPDX-License-Identifier: LGPL-2.1-only\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.label {\n color: var(--qds-theme-control-text-standard);\n display: inline-block;\n}\n\n.required {\n color: var(--qds-theme-feedback-field-required);\n user-select: none;\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n\n &.inline {\n margin-block: var(--qds-control-small-padding-auto-height);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n\n &.inline {\n margin-block: var(--qds-control-standard-padding-auto-height);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n\n &.inline {\n margin-block: var(--qds-control-large-padding-auto-height);\n }\n}\n","// SPDX-FileCopyrightText: © 2023 Schneider Electric\n//\n// SPDX-License-Identifier: LGPL-2.1-only\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { Component, Element, h, Prop } from '@stencil/core'\n\nimport type { Attributes } from '../../helpers'\nimport { inheritAriaAttributes } from '../../helpers'\n\nexport type LabelSize = 'large' | 'small' | 'standard'\n\n/**\n * `<qds-label>` elements represent a caption for an item in a user interface.\n *\n * @see https://quartz.se.com/build/components/label\n */\n@Component({\n tag: 'qds-label',\n shadow: true,\n styleUrl: 'label.css',\n})\nexport class Label implements ComponentInterface {\n /**\n * Adds vertical margin to the label for alignment.\n *\n * This is useful when creating inline layouts so that the first lines have\n * the correct vertical centering.\n */\n @Prop() public readonly inline: boolean = false\n\n /**\n * Specify the labelled item as required by appending a red asterisk (*).\n */\n @Prop() public readonly required: boolean = false\n\n /**\n * The label's size.\n */\n @Prop({ reflect: true }) public readonly size: LabelSize = 'standard'\n\n /**\n * The label's text.\n */\n @Prop({ reflect: true }) public readonly text?: string\n\n @Element() private readonly element!: HTMLQdsLabelElement\n\n private inheritedAttributes: Attributes = {}\n\n public componentWillLoad(): void {\n this.inheritedAttributes = inheritAriaAttributes(this.element)\n }\n\n public render() {\n return (\n <span\n class={{\n inline: this.inline,\n label: true,\n }}\n data-size={this.size}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n >\n {this.required && <span class=\"required\">*</span>}\n {this.text}\n </span>\n )\n }\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AI,iBAAI;YAAE,uBAAA,IAAI,iBAAI,CAAC,UAAU,EAAE,CAAA;KACpC;IAEM,MAAM;QACX,QACEC,mEACE,KAAK,EAAE;gBACL,YAAY,EAAE,IAAI,CAAC,MAAM;gBACzB,WAAW,EAAE,IAAI;aAClB,eACU,uBAAA,IAAI,iDAAc,EAC7B,GAAG,EAAE,uBAAA,IAAI,uBAAU;;YAEnB,QAAQ,EAAE,IAAI,CAAC,OAAO,GAAG,CAAC,GAAG,SAAS,IAErC,IAAI,CAAC,QAAQ,IAAIA,mEAAM,KAAK,EAAC,cAAc,QAAS,EACrDA,mEAAM,KAAK,EAAC,UAAU,EAAC,GAAG,EAAE,uBAAA,IAAI,sBAAS,IACtC,IAAI,CAAC,IAAI,CACL,EACN,IAAI,CAAC,OAAO,KACXA,yFAAyB,MAAM,EAAC,GAAG,EAAE,uBAAA,IAAI,yBAAY,IAClD,IAAI,CAAC,IAAI,CACE,CACf,CACI,EACR;KACF;;;;;;IAxDC,QAAQ,IAAI,CAAC,IAAI;QACf,KAAK,UAAU,CAAC;QAChB,KAAK,OAAO,CAAC;QACb,KAAK,OAAO,EAAE;YACZ,OAAO,IAAI,CAAC,IAAI,CAAA;SACjB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;;;;;","names":["isOverflowing","h"],"sources":["src/components/label/label.css?tag=qds-label&encapsulation=shadow","src/components/label/label.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-label {\n box-sizing: border-box;\n color: var(--qds-theme-control-text-standard);\n display: inline-flex;\n gap: var(--qds-text-icon-gap);\n\n &:focus-visible {\n outline: var(--qds-focus-border-width) solid var(--qds-theme-focus-border);\n outline-offset: var(--qds-focus-border-offset);\n border-radius: var(--qds-focus-border-radius);\n }\n}\n\n.qds-text {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n}\n\n.qds-required {\n color: var(--qds-theme-feedback-field-required);\n user-select: none;\n}\n\n[data-size='small'] {\n font: var(--qds-control-small-text);\n\n &.qds-inline {\n margin-block: var(--qds-control-small-padding-auto-height);\n }\n}\n\n[data-size='standard'] {\n font: var(--qds-control-standard-text);\n\n &.qds-inline {\n margin-block: var(--qds-control-standard-padding-auto-height);\n }\n}\n\n[data-size='large'] {\n font: var(--qds-control-large-text);\n\n &.qds-inline {\n margin-block: var(--qds-control-large-padding-auto-height);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface } from '@stencil/core'\nimport { Component, h, Prop, State, Watch } from '@stencil/core'\n\nimport { isOverflowing } from '../../helpers'\nimport type { Size } from '../shared'\n\n/**\n * `<qds-label>` elements represent a caption for an item in a user interface.\n *\n * @see https://quartz.se.com/build/components/label\n */\n@Component({\n tag: 'qds-label',\n shadow: true,\n styleUrl: 'label.css',\n})\nexport class Label implements ComponentInterface {\n /**\n * Adds vertical margin to the label for alignment.\n *\n * This is useful when creating inline layouts so that the first lines have\n * the correct vertical centering.\n */\n @Prop() public readonly inline: boolean = false\n\n /**\n * Specify the labelled item as required by appending a red asterisk (*).\n */\n @Prop() public readonly required: boolean = false\n\n /**\n * The label's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * The label's text.\n */\n @Prop() public readonly text?: string\n\n @State() private tooltip = false\n\n #label?: HTMLSpanElement\n\n #ro?: ResizeObserver\n\n #span?: HTMLSpanElement\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n @Watch('text')\n protected textChanged(): void {\n if (this.#ro) this.#ro.disconnect()\n\n if (!this.#span) return\n\n this.tooltip = isOverflowing(this.#span)\n this.#ro = new ResizeObserver(([spanEntry]) => {\n this.tooltip = isOverflowing(spanEntry.target)\n })\n this.#ro.observe(this.#span)\n }\n\n public componentDidLoad(): void {\n this.textChanged()\n }\n\n public disconnectedCallback(): void {\n if (this.#ro) this.#ro.disconnect()\n }\n\n public render() {\n return (\n <span\n class={{\n 'qds-inline': this.inline,\n 'qds-label': true,\n }}\n data-size={this.#computedSize}\n ref={this.#labelRef}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex\n tabIndex={this.tooltip ? 0 : undefined}\n >\n {this.required && <span class=\"qds-required\">*</span>}\n <span class=\"qds-text\" ref={this.#spanRef}>\n {this.text}\n </span>\n {this.tooltip && (\n <qds-tooltip aria-hidden=\"true\" ref={this.#tooltipRef}>\n {this.text}\n </qds-tooltip>\n )}\n </span>\n )\n }\n\n readonly #labelRef = (label?: HTMLSpanElement): void => {\n this.#label = label\n }\n\n readonly #spanRef = (span?: HTMLSpanElement): void => {\n this.#span = span\n }\n\n readonly #tooltipRef = (tooltip?: HTMLQdsTooltipElement): void => {\n if (tooltip)\n // eslint-disable-next-line no-param-reassign\n tooltip.target = this.#label\n }\n}\n"],"version":3}
@@ -0,0 +1,157 @@
1
+ /*!
2
+ * SPDX-FileCopyrightText: © 2025 Schneider Electric
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ 'use strict';
7
+
8
+ Object.defineProperty(exports, '__esModule', { value: true });
9
+
10
+ const index = require('./index-523dd2e0.js');
11
+ const helpers = require('./helpers-10154521.js');
12
+
13
+ const listItemCss = ":host([hidden]){display:none!important}:host{display:block}.qds-disabled{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-indented-content,.qds-list-item{align-items:center;box-sizing:border-box;display:flex}.qds-list-action{pointer-events:none}.qds-indented-content{align-self:stretch;flex:1 0}.qds-destination{transform:scaleX(var(--qds-direction-factor,1))}.qds-divider{border-block-end:var(--qds-list-border-width) solid var(--qds-theme-divider-standard)}.qds-icon{color:var(--qds-theme-text-standard)}.qds-texts{display:flex;flex:1 0;flex-direction:column;justify-items:center;padding:0;position:relative}.qds-input{-webkit-appearance:none;appearance:none;background:none;border:none;border-radius:var(--qds-control-border-radius);inset:0;margin:0;outline:none;position:absolute}.qds-title{color:var(--qds-theme-title)}.qds-subtitle{color:var(--qds-theme-subtitle)}.qds-kicker{color:var(--qds-theme-kicker)}.qds-list-item[data-size=small]{gap:var(--qds-list-item-small-gap-internal);padding-inline-start:var(--qds-list-item-small-padding-horizontal)}[data-size=small] .qds-indented-content{gap:var(--qds-list-item-small-gap-internal);min-height:var(--qds-list-item-small-height);padding-block:var(--qds-list-item-small-padding-vertical);padding-inline-end:var(--qds-list-item-small-padding-horizontal)}[data-size=small] .qds-icon{font-size:var(--qds-control-small-icon-size)}[data-size=small] .qds-main-icon{font-size:var(--qds-list-item-small-icon-size)}[data-size=small] .qds-texts{gap:var(--qds-list-item-small-titles-gap)}[data-size=small] .qds-kicker{font:var(--qds-list-item-small-kicker)}[data-size=small] .qds-title{font:var(--qds-list-item-small-title)}[data-size=small] .qds-subtitle{font:var(--qds-list-item-small-subtitle)}.qds-list-item[data-size=standard]{gap:var(--qds-list-item-standard-gap-internal);padding-inline-start:var(--qds-list-item-standard-padding-horizontal)}[data-size=standard] .qds-indented-content{gap:var(--qds-list-item-standard-gap-internal);min-height:var(--qds-list-item-standard-height);padding-block:var(--qds-list-item-standard-padding-vertical);padding-inline-end:var(--qds-list-item-standard-padding-horizontal)}[data-size=standard] .qds-icon{font-size:var(--qds-control-standard-icon-size)}[data-size=standard] .qds-main-icon{font-size:var(--qds-list-item-standard-icon-size)}[data-size=standard] .qds-texts{gap:var(--qds-list-item-standard-titles-gap)}[data-size=standard] .qds-kicker{font:var(--qds-list-item-standard-kicker)}[data-size=standard] .qds-title{font:var(--qds-list-item-standard-title)}[data-size=standard] .qds-subtitle{font:var(--qds-list-item-standard-subtitle)}.qds-list-item[data-size=large]{gap:var(--qds-list-item-large-gap-internal);padding-inline-start:var(--qds-list-item-large-padding-horizontal)}[data-size=large] .qds-indented-content{gap:var(--qds-list-item-large-gap-internal);min-height:var(--qds-list-item-large-height);padding-block:var(--qds-list-item-large-padding-vertical);padding-inline-end:var(--qds-list-item-large-padding-horizontal)}[data-size=large] .qds-icon{font-size:var(--qds-control-large-icon-size)}[data-size=large] .qds-main-icon{font-size:var(--qds-list-item-large-icon-size)}[data-size=large] .qds-texts{gap:var(--qds-list-item-large-titles-gap)}[data-size=large] .qds-kicker{font:var(--qds-list-item-large-kicker)}[data-size=large] .qds-title{font:var(--qds-list-item-large-title)}[data-size=large] .qds-subtitle{font:var(--qds-list-item-large-subtitle)}.qds-list-item:hover{background-color:var(--qds-theme-interactive-background-hover)}.qds-list-item:active{background-color:var(--qds-theme-interactive-background-pressed)}.qds-list-item:has(input:focus-visible){outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width);outline-offset:var(--qds-focus-border-offset)}.qds-selected.qds-list-item{background-color:var(--qds-theme-interactive-background-selected)}.qds-selected[data-size=small] .qds-title{font:var(--qds-list-item-small-title-emphasized)}.qds-selected[data-size=standard] .qds-title{font:var(--qds-list-item-standard-title-emphasized)}.qds-selected[data-size=large] .qds-title{font:var(--qds-list-item-large-title-emphasized)}:host(:last-of-type) .qds-divider{border-block-end:none}";
14
+ const QdsListItemStyle0 = listItemCss;
15
+
16
+ // SPDX-FileCopyrightText: © 2024 Schneider Electric
17
+ //
18
+ // SPDX-License-Identifier: Apache-2.0
19
+ var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
20
+ if (kind === "a" && !f)
21
+ throw new TypeError("Private accessor was defined without a getter");
22
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
23
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
24
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
25
+ };
26
+ var _ListItem_instances, _ListItem_computedDestination_get, _ListItem_computedDivider_get, _ListItem_computedIndeterminate_get, _ListItem_computedListAction_get, _ListItem_computedSelected_get, _ListItem_computedChecked_get, _ListItem_computedSize_get, _ListItem_onBlur, _ListItem_onFocus;
27
+ const ListItem = class {
28
+ constructor(hostRef) {
29
+ index.registerInstance(this, hostRef);
30
+ this.blurEmitter = index.createEvent(this, "qdsBlur", 2);
31
+ this.changeEmitter = index.createEvent(this, "qdsChange", 6);
32
+ this.focusEmitter = index.createEvent(this, "qdsFocus", 2);
33
+ _ListItem_instances.add(this);
34
+ /**
35
+ * Prevents the list item from being interacted with: it cannot be selected
36
+ * or focused.
37
+ */
38
+ this.disabled = false;
39
+ /**
40
+ * The name of a registered icon library.
41
+ */
42
+ this.iconLibrary = 'default';
43
+ /**
44
+ * The list items's size.
45
+ */
46
+ this.size = 'standard';
47
+ this.inheritedAttributes = {};
48
+ _ListItem_onBlur.set(this, (event) => {
49
+ this.blurEmitter.emit(helpers.pickFocusEventAttributes(event));
50
+ });
51
+ _ListItem_onFocus.set(this, (event) => {
52
+ this.focusEmitter.emit(helpers.pickFocusEventAttributes(event));
53
+ });
54
+ }
55
+ onClick(event) {
56
+ if (this.disabled) {
57
+ event.stopImmediatePropagation();
58
+ return;
59
+ }
60
+ // Always prevent default behavior to avoid the internal `<input>`
61
+ // to toggle `checked` state inappropriately.
62
+ //
63
+ // Note that this will need adjustments once we add the `item-action` slot.
64
+ event.preventDefault();
65
+ if (this.listAction === 'multiselect') {
66
+ this.checked = __classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedIndeterminate_get) ? true : !__classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedChecked_get);
67
+ this.changeEmitter.emit();
68
+ this.indeterminate = false;
69
+ }
70
+ }
71
+ tabindexChanged(newValue) {
72
+ const parsedValue = Number.parseInt(newValue, 10);
73
+ this.tabIndex =
74
+ parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue;
75
+ }
76
+ componentWillLoad() {
77
+ this.inheritedAttributes = helpers.inheritAriaAttributes(this.host);
78
+ this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0');
79
+ }
80
+ render() {
81
+ return (
82
+ /* eslint-disable jsx-a11y/label-has-associated-control */
83
+ // eslint-disable-next-line jsx-a11y/no-redundant-roles
84
+ index.h("li", { key: 'c85d55cd3ac8feac479d083eda49f4f0b30d0479', class: {
85
+ 'qds-list-item': true,
86
+ 'qds-disabled': this.disabled,
87
+ 'qds-divider': __classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedDivider_get) === undefined,
88
+ 'qds-multiselect': __classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedListAction_get) === 'multiselect',
89
+ 'qds-selected': __classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedSelected_get),
90
+ 'qds-checked': __classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedChecked_get),
91
+ }, "data-size": __classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedSize_get), role: "listitem" // Required because it can't be a direct child of a list element (<ul>, <ol>, or <menu>).
92
+ ,
93
+ ...this.inheritedAttributes }, __classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedListAction_get) === 'multiselect' && (index.h("qds-checkbox", { key: 'e009fe7c14014db5e9b15a193b72c6f772a89211', checked: this.checked, class: "qds-list-action", indeterminate: this.indeterminate, size: this.size, tabIndex: -1, text: this.text, checkboxOnly: true })), __classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedListAction_get) === 'reorder' && (index.h("qds-icon", { key: '9067a11441139fe1f72f9c3e0eff6303e3075b94', "aria-hidden": "true", class: "qds-icon qds-list-action", library: "core", name: __classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedListAction_get) })), index.h("div", { key: '509559713f04a4e512457c6e67f07726a9d8d71d', class: {
94
+ 'qds-indented-content': true,
95
+ 'qds-divider': __classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedDivider_get) === 'indent',
96
+ } }, this.iconName !== undefined && this.iconName !== '' && (index.h("qds-icon", { key: 'df33c08dae14a2f1c96739f42f5a31a7102ff2d5', "aria-hidden": "true", class: "qds-icon qds-main-icon", library: this.iconLibrary, name: this.iconName })), index.h("label", { key: '89b9b7abd196959444aa9a90dbab084e8fd619cb', class: "qds-texts" }, index.h("input", { key: '8653a0496fc8cedd98ae0b136573ddf9735dfa36', checked: this.selected, class: "qds-input", disabled: this.disabled, indeterminate: this.indeterminate, onBlur: __classPrivateFieldGet(this, _ListItem_onBlur, "f"), onFocus: __classPrivateFieldGet(this, _ListItem_onFocus, "f"), tabIndex: this.disabled ? undefined : this.tabIndex, type: "checkbox" }), this.kicker !== undefined && this.kicker !== '' && (index.h("div", { key: '6551cfbecc9b5a7089a555f593ee00ea8bc5dd44', class: "qds-kicker" }, this.kicker)), index.h("div", { key: 'b3cf789a107852128c6e6d1b097c49f00b1c862c', class: "qds-title" }, this.text), this.subtitle !== undefined && this.subtitle !== '' && (index.h("div", { key: '7765860d7e5d3615dc27d9e454956734ec53ac06', class: "qds-subtitle" }, this.subtitle))), __classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedDestination_get) !== undefined && (index.h("qds-icon", { key: '3d9a3f7b24f9629d09e2bd8cf0839c0f44f1aa38', "aria-hidden": "true", class: "qds-icon qds-destination", library: "core", name: __classPrivateFieldGet(this, _ListItem_instances, "a", _ListItem_computedDestination_get) }))))
97
+ /* eslint-enable jsx-a11y/label-has-associated-control */
98
+ );
99
+ }
100
+ static get delegatesFocus() { return true; }
101
+ get host() { return index.getElement(this); }
102
+ static get watchers() { return {
103
+ "tabindex": ["tabindexChanged"]
104
+ }; }
105
+ };
106
+ _ListItem_onBlur = new WeakMap(), _ListItem_onFocus = new WeakMap(), _ListItem_instances = new WeakSet(), _ListItem_computedDestination_get = function _ListItem_computedDestination_get() {
107
+ switch (this.destination) {
108
+ case 'navigation': {
109
+ return this.destination;
110
+ }
111
+ default: {
112
+ return undefined;
113
+ }
114
+ }
115
+ }, _ListItem_computedDivider_get = function _ListItem_computedDivider_get() {
116
+ switch (this.divider) {
117
+ case 'hide':
118
+ case 'indent': {
119
+ return this.divider;
120
+ }
121
+ default: {
122
+ return undefined;
123
+ }
124
+ }
125
+ }, _ListItem_computedIndeterminate_get = function _ListItem_computedIndeterminate_get() {
126
+ return this.indeterminate ?? false;
127
+ }, _ListItem_computedListAction_get = function _ListItem_computedListAction_get() {
128
+ switch (this.listAction) {
129
+ case 'reorder':
130
+ case 'multiselect': {
131
+ return this.listAction;
132
+ }
133
+ default: {
134
+ return undefined;
135
+ }
136
+ }
137
+ }, _ListItem_computedSelected_get = function _ListItem_computedSelected_get() {
138
+ return this.selected ?? false;
139
+ }, _ListItem_computedChecked_get = function _ListItem_computedChecked_get() {
140
+ return this.checked ?? false;
141
+ }, _ListItem_computedSize_get = function _ListItem_computedSize_get() {
142
+ switch (this.size) {
143
+ case 'standard':
144
+ case 'small':
145
+ case 'large': {
146
+ return this.size;
147
+ }
148
+ default: {
149
+ return 'standard';
150
+ }
151
+ }
152
+ };
153
+ ListItem.style = QdsListItemStyle0;
154
+
155
+ exports.qds_list_item = ListItem;
156
+
157
+ //# sourceMappingURL=qds-list-item.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"qds-list-item.entry.cjs.js","mappings":";;;;;;;;;;;;AAAA,MAAM,WAAW,GAAG,ooIAAooI,CAAC;AACzpI,0BAAe,WAAW;;ACD1B;AACA;AACA;;;;;;;;;MAgCa,QAAQ;IALrB;;;;;;;;;;QAe0B,aAAQ,GAAY,KAAK,CAAA;;;;QAyBzB,gBAAW,GAAW,SAAS,CAAA;;;;QAe/B,SAAI,GAAU,UAAU,CAAA;QAqDxC,wBAAmB,GAAe,EAAE,CAAA;QAoLnC,2BAAU,CAAC,KAAiB;YACnC,IAAI,CAAC,WAAW,CAAC,IAAI,CAACA,gCAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACvD,EAAA;QAEQ,4BAAW,CAAC,KAAiB;YACpC,IAAI,CAAC,YAAY,CAAC,IAAI,CAACA,gCAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACx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AAO,IAAI,CAAC,IAAI,CAAA;SACjB;QACD,SAAS;YACP,OAAO,UAAU,CAAA;SAClB;KACF;AACH,CAAC;;;;;","names":["pickFocusEventAttributes","inheritAriaAttributes","h"],"sources":["src/components/list-item/list-item.css?tag=qds-list-item&encapsulation=shadow","src/components/list-item/list-item.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: block;\n}\n\n.qds-disabled {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n.qds-list-item,\n.qds-indented-content {\n align-items: center;\n box-sizing: border-box;\n display: flex;\n}\n\n.qds-list-action {\n pointer-events: none;\n}\n\n.qds-indented-content {\n flex: 1 0;\n align-self: stretch;\n}\n\n.qds-destination {\n transform: scaleX(var(--qds-direction-factor, 1));\n}\n\n.qds-divider {\n border-block-end: var(--qds-list-border-width) solid\n var(--qds-theme-divider-standard);\n}\n\n.qds-icon {\n color: var(--qds-theme-text-standard);\n}\n\n.qds-texts {\n justify-items: center;\n display: flex;\n flex: 1 0;\n flex-direction: column;\n padding: 0;\n position: relative;\n}\n\n.qds-input {\n appearance: none;\n background: none;\n border: none;\n border-radius: var(--qds-control-border-radius);\n inset: 0;\n margin: 0;\n outline: none;\n position: absolute;\n}\n\n.qds-title {\n color: var(--qds-theme-title);\n}\n\n.qds-subtitle {\n color: var(--qds-theme-subtitle);\n}\n\n.qds-kicker {\n color: var(--qds-theme-kicker);\n}\n\n[data-size='small'] {\n &.qds-list-item {\n gap: var(--qds-list-item-small-gap-internal);\n padding-inline-start: var(--qds-list-item-small-padding-horizontal);\n }\n\n .qds-indented-content {\n gap: var(--qds-list-item-small-gap-internal);\n min-height: var(--qds-list-item-small-height);\n padding-block: var(--qds-list-item-small-padding-vertical);\n padding-inline-end: var(--qds-list-item-small-padding-horizontal);\n }\n\n .qds-icon {\n font-size: var(--qds-control-small-icon-size);\n }\n\n .qds-main-icon {\n font-size: var(--qds-list-item-small-icon-size);\n }\n\n .qds-texts {\n gap: var(--qds-list-item-small-titles-gap);\n }\n\n .qds-kicker {\n font: var(--qds-list-item-small-kicker);\n }\n\n .qds-title {\n font: var(--qds-list-item-small-title);\n }\n\n .qds-subtitle {\n font: var(--qds-list-item-small-subtitle);\n }\n}\n\n[data-size='standard'] {\n &.qds-list-item {\n gap: var(--qds-list-item-standard-gap-internal);\n padding-inline-start: var(--qds-list-item-standard-padding-horizontal);\n }\n\n .qds-indented-content {\n gap: var(--qds-list-item-standard-gap-internal);\n min-height: var(--qds-list-item-standard-height);\n padding-block: var(--qds-list-item-standard-padding-vertical);\n padding-inline-end: var(--qds-list-item-standard-padding-horizontal);\n }\n\n .qds-icon {\n font-size: var(--qds-control-standard-icon-size);\n }\n\n .qds-main-icon {\n font-size: var(--qds-list-item-standard-icon-size);\n }\n\n .qds-texts {\n gap: var(--qds-list-item-standard-titles-gap);\n }\n\n .qds-kicker {\n font: var(--qds-list-item-standard-kicker);\n }\n\n .qds-title {\n font: var(--qds-list-item-standard-title);\n }\n\n .qds-subtitle {\n font: var(--qds-list-item-standard-subtitle);\n }\n}\n\n[data-size='large'] {\n &.qds-list-item {\n gap: var(--qds-list-item-large-gap-internal);\n padding-inline-start: var(--qds-list-item-large-padding-horizontal);\n }\n\n .qds-indented-content {\n gap: var(--qds-list-item-large-gap-internal);\n min-height: var(--qds-list-item-large-height);\n padding-block: var(--qds-list-item-large-padding-vertical);\n padding-inline-end: var(--qds-list-item-large-padding-horizontal);\n }\n\n .qds-icon {\n font-size: var(--qds-control-large-icon-size);\n }\n\n .qds-main-icon {\n font-size: var(--qds-list-item-large-icon-size);\n }\n\n .qds-texts {\n gap: var(--qds-list-item-large-titles-gap);\n }\n\n .qds-kicker {\n font: var(--qds-list-item-large-kicker);\n }\n\n .qds-title {\n font: var(--qds-list-item-large-title);\n }\n\n .qds-subtitle {\n font: var(--qds-list-item-large-subtitle);\n }\n}\n\n.qds-list-item {\n &:hover {\n background-color: var(--qds-theme-interactive-background-hover);\n }\n\n &:active {\n background-color: var(--qds-theme-interactive-background-pressed);\n }\n\n &:has(input:focus-visible) {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n outline-offset: var(--qds-focus-border-offset);\n }\n}\n\n.qds-selected {\n &.qds-list-item {\n background-color: var(--qds-theme-interactive-background-selected);\n }\n\n &[data-size='small'] .qds-title {\n font: var(--qds-list-item-small-title-emphasized);\n }\n\n &[data-size='standard'] .qds-title {\n font: var(--qds-list-item-standard-title-emphasized);\n }\n\n &[data-size='large'] .qds-title {\n font: var(--qds-list-item-large-title-emphasized);\n }\n}\n\n:host(:last-of-type) {\n .qds-divider {\n border-block-end: none;\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport {\n Component,\n Element,\n Event,\n h,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport { inheritAriaAttributes, pickFocusEventAttributes } from '../../helpers'\nimport type { Size } from '../shared'\n\nexport type Destination = 'navigation'\nexport type ListAction = 'multiselect' | 'reorder'\nexport type Divider = 'hide' | 'indent'\n\n/**\n *\n *\n * @see https://quartz.se.com/build/components/list-item\n */\n@Component({\n tag: 'qds-list-item',\n shadow: { delegatesFocus: true },\n styleUrl: 'list-item.css',\n})\nexport class ListItem implements ComponentInterface {\n /**\n * The destination action that the list item denotes through its rightmost icon.\n */\n @Prop() public readonly destination?: Destination\n\n /**\n * Prevents the list item from being interacted with: it cannot be selected\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * Control how to display the bottom divider line.\n *\n * By default, the divider is visible and uses the full width of the list item.\n *\n * Use the `hide` value to hide the divider completely (useful with multiselect).\n *\n * Use the `indent` value to align the left end of the divider to the icon/text (useful on mobile).\n *\n * **Note**: the divider is automatically hidden on the last list item in the parent container.\n */\n @Prop() public readonly divider?: Divider\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * Text to display for the kicker.\n */\n @Prop() public readonly kicker?: string\n\n /**\n * The type of list-level action that the list item supports\n */\n @Prop() public readonly listAction?: ListAction\n\n /**\n * The list items's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Whether or not the list item is checked when `list-action=\"multiselect\"`\n */\n @Prop({ mutable: true }) public checked?: boolean\n\n /**\n * Whether or not the list item is selected.\n */\n @Prop({ mutable: true }) public selected?: boolean\n\n /**\n * Sets the list item to an indeterminate state, only when `list-action=\"indeterminate\"`.\n * This is usually applied to items that represent a \"select all/none\" behavior when associated\n * items have a mix of selected and unselected states.\n *\n * @webnative\n */\n @Prop({ mutable: true }) public indeterminate?: boolean\n\n /**\n * The primary text of the list item.\n */\n @Prop() public readonly text!: string\n\n /**\n * Text to display below the primary text.\n */\n @Prop() public readonly subtitle?: string\n\n /**\n * Emitted when the list item loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when a change to the checkbox's state is committed by the user.\n */\n @Event({ eventName: 'qdsChange', cancelable: false })\n private readonly changeEmitter!: EventEmitter<void>\n\n /**\n * Emitted when the list item gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly host!: HTMLElement\n\n @State() private tabIndex?: number\n\n private inheritedAttributes: Attributes = {}\n\n get #computedDestination(): Destination | undefined {\n switch (this.destination) {\n case 'navigation': {\n return this.destination\n }\n default: {\n return undefined\n }\n }\n }\n\n get #computedDivider(): Divider | undefined {\n switch (this.divider) {\n case 'hide':\n case 'indent': {\n return this.divider\n }\n default: {\n return undefined\n }\n }\n }\n\n get #computedIndeterminate(): boolean {\n return this.indeterminate ?? false\n }\n\n get #computedListAction(): ListAction | undefined {\n switch (this.listAction) {\n case 'reorder':\n case 'multiselect': {\n return this.listAction\n }\n default: {\n return undefined\n }\n }\n }\n\n get #computedSelected(): boolean {\n return this.selected ?? false\n }\n\n get #computedChecked(): boolean {\n return this.checked ?? false\n }\n\n get #computedSize(): Size {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.disabled) {\n event.stopImmediatePropagation()\n return\n }\n\n // Always prevent default behavior to avoid the internal `<input>`\n // to toggle `checked` state inappropriately.\n //\n // Note that this will need adjustments once we add the `item-action` slot.\n event.preventDefault()\n\n if (this.listAction === 'multiselect') {\n this.checked = this.#computedIndeterminate ? true : !this.#computedChecked\n this.changeEmitter.emit()\n this.indeterminate = false\n }\n }\n\n @Watch('tabindex')\n protected tabindexChanged(newValue: string): void {\n const parsedValue = Number.parseInt(newValue, 10)\n this.tabIndex =\n parsedValue === 0 || Number.isNaN(parsedValue) ? undefined : parsedValue\n }\n\n public componentWillLoad(): void {\n this.inheritedAttributes = inheritAriaAttributes(this.host)\n this.tabindexChanged(this.host.getAttribute('tabindex') ?? '0')\n }\n\n public render() {\n return (\n /* eslint-disable jsx-a11y/label-has-associated-control */\n // eslint-disable-next-line jsx-a11y/no-redundant-roles\n <li\n class={{\n 'qds-list-item': true,\n 'qds-disabled': this.disabled,\n 'qds-divider': this.#computedDivider === undefined,\n 'qds-multiselect': this.#computedListAction === 'multiselect',\n 'qds-selected': this.#computedSelected,\n 'qds-checked': this.#computedChecked,\n }}\n data-size={this.#computedSize}\n role=\"listitem\" // Required because it can't be a direct child of a list element (<ul>, <ol>, or <menu>).\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n >\n {this.#computedListAction === 'multiselect' && (\n <qds-checkbox\n checked={this.checked}\n class=\"qds-list-action\"\n indeterminate={this.indeterminate}\n size={this.size}\n tabIndex={-1}\n text={this.text}\n checkboxOnly\n />\n )}\n {this.#computedListAction === 'reorder' && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon qds-list-action\"\n library=\"core\"\n name={this.#computedListAction}\n />\n )}\n\n <div\n class={{\n 'qds-indented-content': true,\n 'qds-divider': this.#computedDivider === 'indent',\n }}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon qds-main-icon\"\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n\n <label class=\"qds-texts\">\n <input\n checked={this.selected}\n class=\"qds-input\"\n disabled={this.disabled}\n indeterminate={this.indeterminate}\n onBlur={this.#onBlur}\n onFocus={this.#onFocus}\n tabIndex={this.disabled ? undefined : this.tabIndex}\n type=\"checkbox\"\n />\n {this.kicker !== undefined && this.kicker !== '' && (\n <div class=\"qds-kicker\">{this.kicker}</div>\n )}\n <div class=\"qds-title\">{this.text}</div>\n {this.subtitle !== undefined && this.subtitle !== '' && (\n <div class=\"qds-subtitle\">{this.subtitle}</div>\n )}\n </label>\n {this.#computedDestination !== undefined && (\n <qds-icon\n aria-hidden=\"true\"\n class=\"qds-icon qds-destination\"\n library=\"core\"\n name={this.#computedDestination}\n />\n )}\n </div>\n </li>\n /* eslint-enable jsx-a11y/label-has-associated-control */\n )\n }\n\n readonly #onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n readonly #onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}