@carbon/web-components 1.26.0-rc.2 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (623) hide show
  1. package/dist/accordion.min.js +2 -2
  2. package/dist/accordion.rtl.min.js +2 -2
  3. package/dist/breadcrumb.min.js +1 -1
  4. package/dist/breadcrumb.rtl.min.js +1 -1
  5. package/dist/{button-0eeac278.js → button-c71594fa.js} +2 -2
  6. package/dist/{button-4b4837f0.js → button-e31ba29e.js} +2 -2
  7. package/dist/button.min.js +1 -1
  8. package/dist/button.rtl.min.js +1 -1
  9. package/dist/{decorators-0a905d41.js → carbon-element-18175602.js} +9 -1
  10. package/dist/checkbox-3fc0ced9.js +65 -0
  11. package/dist/checkbox-a740039c.js +65 -0
  12. package/dist/checkbox.min.js +1 -1
  13. package/dist/checkbox.rtl.min.js +1 -1
  14. package/dist/code-snippet.min.js +2 -2
  15. package/dist/code-snippet.rtl.min.js +2 -2
  16. package/dist/combo-box.min.js +1 -1
  17. package/dist/combo-box.rtl.min.js +1 -1
  18. package/dist/{content-switcher-item-d37071b9.js → content-switcher-item-77b690a9.js} +2 -2
  19. package/dist/{content-switcher-item-db96b7e3.js → content-switcher-item-96395561.js} +2 -2
  20. package/dist/content-switcher.min.js +1 -1
  21. package/dist/content-switcher.rtl.min.js +1 -1
  22. package/dist/copy-button-50221d0f.js +65 -0
  23. package/dist/copy-button-9cb9a0c6.js +65 -0
  24. package/dist/copy-button.min.js +1 -1
  25. package/dist/copy-button.rtl.min.js +1 -1
  26. package/dist/data-table.min.js +2 -2
  27. package/dist/data-table.rtl.min.js +2 -2
  28. package/dist/date-picker.min.js +3 -3
  29. package/dist/date-picker.rtl.min.js +3 -3
  30. package/dist/decorators-56213c84.js +78 -0
  31. package/dist/{dropdown-item-1630cdb0.js → dropdown-item-62abeaa7.js} +2 -2
  32. package/dist/{dropdown-item-8c9136d9.js → dropdown-item-97eb5366.js} +2 -2
  33. package/dist/dropdown.min.js +1 -1
  34. package/dist/dropdown.rtl.min.js +1 -1
  35. package/dist/file-uploader.min.js +2 -2
  36. package/dist/file-uploader.rtl.min.js +2 -2
  37. package/dist/form.min.js +1 -1
  38. package/dist/form.rtl.min.js +1 -1
  39. package/dist/inline-loading.min.js +2 -2
  40. package/dist/inline-loading.rtl.min.js +2 -2
  41. package/dist/{input-1583283e.js → input-254c34ac.js} +2 -2
  42. package/dist/{input-b817aa3d.js → input-bb75e577.js} +2 -2
  43. package/dist/input.min.js +1 -1
  44. package/dist/input.rtl.min.js +1 -1
  45. package/dist/link-3c734b06.js +65 -0
  46. package/dist/link-aecb4d2a.js +65 -0
  47. package/dist/link.min.js +1 -1
  48. package/dist/link.rtl.min.js +1 -1
  49. package/dist/list.min.js +1 -1
  50. package/dist/list.rtl.min.js +1 -1
  51. package/dist/loading-9ce928f0.js +65 -0
  52. package/dist/loading-c77e0b8d.js +65 -0
  53. package/dist/loading.min.js +1 -1
  54. package/dist/loading.rtl.min.js +1 -1
  55. package/dist/modal.min.js +2 -2
  56. package/dist/modal.rtl.min.js +2 -2
  57. package/dist/multi-select.min.js +1 -1
  58. package/dist/multi-select.rtl.min.js +1 -1
  59. package/dist/notification.min.js +2 -2
  60. package/dist/notification.rtl.min.js +2 -2
  61. package/dist/number-input.min.js +2 -2
  62. package/dist/number-input.rtl.min.js +2 -2
  63. package/dist/overflow-menu.min.js +2 -2
  64. package/dist/overflow-menu.rtl.min.js +2 -2
  65. package/dist/pagination.min.js +1 -1
  66. package/dist/pagination.rtl.min.js +1 -1
  67. package/dist/progress-indicator.min.js +2 -2
  68. package/dist/progress-indicator.rtl.min.js +2 -2
  69. package/dist/radio-button.min.js +2 -2
  70. package/dist/radio-button.rtl.min.js +2 -2
  71. package/dist/search-99e65bb6.js +65 -0
  72. package/dist/search-dfddc65c.js +65 -0
  73. package/dist/search.min.js +1 -1
  74. package/dist/search.rtl.min.js +1 -1
  75. package/dist/select.min.js +1 -1
  76. package/dist/select.rtl.min.js +1 -1
  77. package/dist/skeleton-placeholder.min.js +1 -1
  78. package/dist/skeleton-placeholder.rtl.min.js +1 -1
  79. package/dist/skeleton-text.min.js +2 -2
  80. package/dist/skeleton-text.rtl.min.js +2 -2
  81. package/dist/skip-to-content.min.js +1 -1
  82. package/dist/skip-to-content.rtl.min.js +1 -1
  83. package/dist/slider.min.js +1 -1
  84. package/dist/slider.rtl.min.js +1 -1
  85. package/dist/structured-list.min.js +1 -1
  86. package/dist/structured-list.rtl.min.js +1 -1
  87. package/dist/tabs.min.js +2 -2
  88. package/dist/tabs.rtl.min.js +2 -2
  89. package/dist/tag.min.js +2 -2
  90. package/dist/tag.rtl.min.js +2 -2
  91. package/dist/textarea.min.js +1 -1
  92. package/dist/textarea.rtl.min.js +1 -1
  93. package/dist/tile.min.js +1 -1
  94. package/dist/tile.rtl.min.js +1 -1
  95. package/dist/toggle.min.js +2 -2
  96. package/dist/toggle.rtl.min.js +2 -2
  97. package/dist/tooltip.min.js +2 -2
  98. package/dist/tooltip.rtl.min.js +2 -2
  99. package/dist/ui-shell.min.js +2 -2
  100. package/dist/ui-shell.rtl.min.js +2 -2
  101. package/es/components/accordion/accordion-item.d.ts +1 -1
  102. package/es/components/accordion/accordion-item.d.ts.map +1 -1
  103. package/es/components/accordion/accordion-item.js +4 -3
  104. package/es/components/accordion/accordion-item.js.map +1 -1
  105. package/es/components/accordion/accordion.d.ts +1 -1
  106. package/es/components/accordion/accordion.d.ts.map +1 -1
  107. package/es/components/accordion/accordion.js +3 -2
  108. package/es/components/accordion/accordion.js.map +1 -1
  109. package/es/components/breadcrumb/breadcrumb-item.d.ts +1 -1
  110. package/es/components/breadcrumb/breadcrumb-item.d.ts.map +1 -1
  111. package/es/components/breadcrumb/breadcrumb-item.js +3 -2
  112. package/es/components/breadcrumb/breadcrumb-item.js.map +1 -1
  113. package/es/components/breadcrumb/breadcrumb-link.d.ts +1 -1
  114. package/es/components/breadcrumb/breadcrumb-link.d.ts.map +1 -1
  115. package/es/components/breadcrumb/breadcrumb-link.js +2 -2
  116. package/es/components/breadcrumb/breadcrumb-link.js.map +1 -1
  117. package/es/components/breadcrumb/breadcrumb-overflow-menu.d.ts +1 -1
  118. package/es/components/breadcrumb/breadcrumb-overflow-menu.d.ts.map +1 -1
  119. package/es/components/breadcrumb/breadcrumb-overflow-menu.js +3 -2
  120. package/es/components/breadcrumb/breadcrumb-overflow-menu.js.map +1 -1
  121. package/es/components/breadcrumb/breadcrumb.d.ts +1 -1
  122. package/es/components/breadcrumb/breadcrumb.d.ts.map +1 -1
  123. package/es/components/breadcrumb/breadcrumb.js +3 -2
  124. package/es/components/breadcrumb/breadcrumb.js.map +1 -1
  125. package/es/components/button/button-skeleton.d.ts +1 -1
  126. package/es/components/button/button-skeleton.d.ts.map +1 -1
  127. package/es/components/button/button-skeleton.js +3 -2
  128. package/es/components/button/button-skeleton.js.map +1 -1
  129. package/es/components/button/button.d.ts +1 -1
  130. package/es/components/button/button.d.ts.map +1 -1
  131. package/es/components/button/button.js +3 -2
  132. package/es/components/button/button.js.map +1 -1
  133. package/es/components/checkbox/checkbox.d.ts +1 -1
  134. package/es/components/checkbox/checkbox.d.ts.map +1 -1
  135. package/es/components/checkbox/checkbox.js +3 -2
  136. package/es/components/checkbox/checkbox.js.map +1 -1
  137. package/es/components/code-snippet/code-snippet-skeleton.d.ts +1 -1
  138. package/es/components/code-snippet/code-snippet-skeleton.d.ts.map +1 -1
  139. package/es/components/code-snippet/code-snippet-skeleton.js +3 -2
  140. package/es/components/code-snippet/code-snippet-skeleton.js.map +1 -1
  141. package/es/components/code-snippet/code-snippet.d.ts +1 -1
  142. package/es/components/code-snippet/code-snippet.d.ts.map +1 -1
  143. package/es/components/code-snippet/code-snippet.js +3 -2
  144. package/es/components/code-snippet/code-snippet.js.map +1 -1
  145. package/es/components/combo-box/combo-box-item.d.ts +1 -1
  146. package/es/components/combo-box/combo-box-item.d.ts.map +1 -1
  147. package/es/components/combo-box/combo-box-item.js +2 -2
  148. package/es/components/combo-box/combo-box-item.js.map +1 -1
  149. package/es/components/combo-box/combo-box.d.ts +1 -1
  150. package/es/components/combo-box/combo-box.d.ts.map +1 -1
  151. package/es/components/combo-box/combo-box.js +3 -2
  152. package/es/components/combo-box/combo-box.js.map +1 -1
  153. package/es/components/content-switcher/content-switcher-item.d.ts +1 -1
  154. package/es/components/content-switcher/content-switcher-item.d.ts.map +1 -1
  155. package/es/components/content-switcher/content-switcher-item.js +3 -2
  156. package/es/components/content-switcher/content-switcher-item.js.map +1 -1
  157. package/es/components/content-switcher/content-switcher.d.ts +1 -1
  158. package/es/components/content-switcher/content-switcher.d.ts.map +1 -1
  159. package/es/components/content-switcher/content-switcher.js +3 -2
  160. package/es/components/content-switcher/content-switcher.js.map +1 -1
  161. package/es/components/copy-button/copy-button.d.ts +1 -1
  162. package/es/components/copy-button/copy-button.d.ts.map +1 -1
  163. package/es/components/copy-button/copy-button.js +3 -2
  164. package/es/components/copy-button/copy-button.js.map +1 -1
  165. package/es/components/data-table/table-batch-actions.d.ts +1 -1
  166. package/es/components/data-table/table-batch-actions.d.ts.map +1 -1
  167. package/es/components/data-table/table-batch-actions.js +3 -2
  168. package/es/components/data-table/table-batch-actions.js.map +1 -1
  169. package/es/components/data-table/table-body.d.ts +1 -1
  170. package/es/components/data-table/table-body.d.ts.map +1 -1
  171. package/es/components/data-table/table-body.js +3 -2
  172. package/es/components/data-table/table-body.js.map +1 -1
  173. package/es/components/data-table/table-cell-skeleton.d.ts +1 -1
  174. package/es/components/data-table/table-cell-skeleton.d.ts.map +1 -1
  175. package/es/components/data-table/table-cell-skeleton.js +3 -2
  176. package/es/components/data-table/table-cell-skeleton.js.map +1 -1
  177. package/es/components/data-table/table-cell.d.ts +1 -1
  178. package/es/components/data-table/table-cell.d.ts.map +1 -1
  179. package/es/components/data-table/table-cell.js +3 -2
  180. package/es/components/data-table/table-cell.js.map +1 -1
  181. package/es/components/data-table/table-expand-row.d.ts +1 -1
  182. package/es/components/data-table/table-expand-row.d.ts.map +1 -1
  183. package/es/components/data-table/table-expand-row.js +3 -2
  184. package/es/components/data-table/table-expand-row.js.map +1 -1
  185. package/es/components/data-table/table-expanded-row.d.ts +1 -1
  186. package/es/components/data-table/table-expanded-row.d.ts.map +1 -1
  187. package/es/components/data-table/table-expanded-row.js +3 -2
  188. package/es/components/data-table/table-expanded-row.js.map +1 -1
  189. package/es/components/data-table/table-head.d.ts +1 -1
  190. package/es/components/data-table/table-head.d.ts.map +1 -1
  191. package/es/components/data-table/table-head.js +3 -2
  192. package/es/components/data-table/table-head.js.map +1 -1
  193. package/es/components/data-table/table-header-cell-skeleton.d.ts +1 -1
  194. package/es/components/data-table/table-header-cell-skeleton.d.ts.map +1 -1
  195. package/es/components/data-table/table-header-cell-skeleton.js +2 -2
  196. package/es/components/data-table/table-header-cell-skeleton.js.map +1 -1
  197. package/es/components/data-table/table-header-cell.d.ts +1 -1
  198. package/es/components/data-table/table-header-cell.d.ts.map +1 -1
  199. package/es/components/data-table/table-header-cell.js +3 -2
  200. package/es/components/data-table/table-header-cell.js.map +1 -1
  201. package/es/components/data-table/table-header-expand-row.d.ts +1 -1
  202. package/es/components/data-table/table-header-expand-row.d.ts.map +1 -1
  203. package/es/components/data-table/table-header-expand-row.js +2 -2
  204. package/es/components/data-table/table-header-expand-row.js.map +1 -1
  205. package/es/components/data-table/table-header-row.d.ts +1 -1
  206. package/es/components/data-table/table-header-row.d.ts.map +1 -1
  207. package/es/components/data-table/table-header-row.js +2 -2
  208. package/es/components/data-table/table-header-row.js.map +1 -1
  209. package/es/components/data-table/table-row.d.ts +1 -1
  210. package/es/components/data-table/table-row.d.ts.map +1 -1
  211. package/es/components/data-table/table-row.js +3 -2
  212. package/es/components/data-table/table-row.js.map +1 -1
  213. package/es/components/data-table/table-toolbar-content.d.ts +1 -1
  214. package/es/components/data-table/table-toolbar-content.d.ts.map +1 -1
  215. package/es/components/data-table/table-toolbar-content.js +3 -2
  216. package/es/components/data-table/table-toolbar-content.js.map +1 -1
  217. package/es/components/data-table/table-toolbar-search.d.ts +1 -1
  218. package/es/components/data-table/table-toolbar-search.d.ts.map +1 -1
  219. package/es/components/data-table/table-toolbar-search.js +3 -2
  220. package/es/components/data-table/table-toolbar-search.js.map +1 -1
  221. package/es/components/data-table/table-toolbar.d.ts +1 -1
  222. package/es/components/data-table/table-toolbar.d.ts.map +1 -1
  223. package/es/components/data-table/table-toolbar.js +3 -2
  224. package/es/components/data-table/table-toolbar.js.map +1 -1
  225. package/es/components/data-table/table.d.ts +1 -1
  226. package/es/components/data-table/table.d.ts.map +1 -1
  227. package/es/components/data-table/table.js +3 -2
  228. package/es/components/data-table/table.js.map +1 -1
  229. package/es/components/date-picker/date-picker-input-skeleton.d.ts +1 -1
  230. package/es/components/date-picker/date-picker-input-skeleton.d.ts.map +1 -1
  231. package/es/components/date-picker/date-picker-input-skeleton.js +3 -2
  232. package/es/components/date-picker/date-picker-input-skeleton.js.map +1 -1
  233. package/es/components/date-picker/date-picker-input.d.ts +3 -7
  234. package/es/components/date-picker/date-picker-input.d.ts.map +1 -1
  235. package/es/components/date-picker/date-picker-input.js +3 -2
  236. package/es/components/date-picker/date-picker-input.js.map +1 -1
  237. package/es/components/date-picker/date-picker.d.ts +2 -4
  238. package/es/components/date-picker/date-picker.d.ts.map +1 -1
  239. package/es/components/date-picker/date-picker.js +3 -2
  240. package/es/components/date-picker/date-picker.js.map +1 -1
  241. package/es/components/dropdown/dropdown-item.d.ts +1 -1
  242. package/es/components/dropdown/dropdown-item.d.ts.map +1 -1
  243. package/es/components/dropdown/dropdown-item.js +3 -2
  244. package/es/components/dropdown/dropdown-item.js.map +1 -1
  245. package/es/components/dropdown/dropdown-skeleton.d.ts +1 -1
  246. package/es/components/dropdown/dropdown-skeleton.d.ts.map +1 -1
  247. package/es/components/dropdown/dropdown-skeleton.js +3 -2
  248. package/es/components/dropdown/dropdown-skeleton.js.map +1 -1
  249. package/es/components/dropdown/dropdown.d.ts.map +1 -1
  250. package/es/components/dropdown/dropdown.js +2 -1
  251. package/es/components/dropdown/dropdown.js.map +1 -1
  252. package/es/components/file-uploader/drop-container.d.ts +4 -1
  253. package/es/components/file-uploader/drop-container.d.ts.map +1 -1
  254. package/es/components/file-uploader/drop-container.js +3 -2
  255. package/es/components/file-uploader/drop-container.js.map +1 -1
  256. package/es/components/file-uploader/file-uploader-item.d.ts +1 -1
  257. package/es/components/file-uploader/file-uploader-item.d.ts.map +1 -1
  258. package/es/components/file-uploader/file-uploader-item.js +3 -2
  259. package/es/components/file-uploader/file-uploader-item.js.map +1 -1
  260. package/es/components/file-uploader/file-uploader.d.ts +1 -1
  261. package/es/components/file-uploader/file-uploader.d.ts.map +1 -1
  262. package/es/components/file-uploader/file-uploader.js +3 -2
  263. package/es/components/file-uploader/file-uploader.js.map +1 -1
  264. package/es/components/form/form-item.d.ts +1 -1
  265. package/es/components/form/form-item.d.ts.map +1 -1
  266. package/es/components/form/form-item.js +3 -2
  267. package/es/components/form/form-item.js.map +1 -1
  268. package/es/components/inline-loading/inline-loading.d.ts +1 -1
  269. package/es/components/inline-loading/inline-loading.d.ts.map +1 -1
  270. package/es/components/inline-loading/inline-loading.js +3 -2
  271. package/es/components/inline-loading/inline-loading.js.map +1 -1
  272. package/es/components/input/input.d.ts +1 -4
  273. package/es/components/input/input.d.ts.map +1 -1
  274. package/es/components/input/input.js +3 -2
  275. package/es/components/input/input.js.map +1 -1
  276. package/es/components/link/link.d.ts +1 -1
  277. package/es/components/link/link.d.ts.map +1 -1
  278. package/es/components/link/link.js +3 -2
  279. package/es/components/link/link.js.map +1 -1
  280. package/es/components/list/list-item.d.ts +1 -1
  281. package/es/components/list/list-item.d.ts.map +1 -1
  282. package/es/components/list/list-item.js +3 -2
  283. package/es/components/list/list-item.js.map +1 -1
  284. package/es/components/list/ordered-list.d.ts +1 -1
  285. package/es/components/list/ordered-list.d.ts.map +1 -1
  286. package/es/components/list/ordered-list.js +3 -2
  287. package/es/components/list/ordered-list.js.map +1 -1
  288. package/es/components/list/unordered-list.d.ts +1 -1
  289. package/es/components/list/unordered-list.d.ts.map +1 -1
  290. package/es/components/list/unordered-list.js +3 -2
  291. package/es/components/list/unordered-list.js.map +1 -1
  292. package/es/components/loading/loading.d.ts +1 -1
  293. package/es/components/loading/loading.d.ts.map +1 -1
  294. package/es/components/loading/loading.js +3 -2
  295. package/es/components/loading/loading.js.map +1 -1
  296. package/es/components/modal/modal-body.d.ts +1 -1
  297. package/es/components/modal/modal-body.d.ts.map +1 -1
  298. package/es/components/modal/modal-body.js +3 -2
  299. package/es/components/modal/modal-body.js.map +1 -1
  300. package/es/components/modal/modal-close-button.d.ts +1 -1
  301. package/es/components/modal/modal-close-button.d.ts.map +1 -1
  302. package/es/components/modal/modal-close-button.js +3 -2
  303. package/es/components/modal/modal-close-button.js.map +1 -1
  304. package/es/components/modal/modal-footer-button.d.ts +1 -1
  305. package/es/components/modal/modal-footer-button.d.ts.map +1 -1
  306. package/es/components/modal/modal-footer-button.js +2 -2
  307. package/es/components/modal/modal-footer-button.js.map +1 -1
  308. package/es/components/modal/modal-footer.d.ts +1 -1
  309. package/es/components/modal/modal-footer.d.ts.map +1 -1
  310. package/es/components/modal/modal-footer.js +3 -2
  311. package/es/components/modal/modal-footer.js.map +1 -1
  312. package/es/components/modal/modal-header.d.ts +1 -1
  313. package/es/components/modal/modal-header.d.ts.map +1 -1
  314. package/es/components/modal/modal-header.js +3 -2
  315. package/es/components/modal/modal-header.js.map +1 -1
  316. package/es/components/modal/modal-heading.d.ts +1 -1
  317. package/es/components/modal/modal-heading.d.ts.map +1 -1
  318. package/es/components/modal/modal-heading.js +3 -2
  319. package/es/components/modal/modal-heading.js.map +1 -1
  320. package/es/components/modal/modal-label.d.ts +1 -1
  321. package/es/components/modal/modal-label.d.ts.map +1 -1
  322. package/es/components/modal/modal-label.js +3 -2
  323. package/es/components/modal/modal-label.js.map +1 -1
  324. package/es/components/modal/modal.d.ts +1 -1
  325. package/es/components/modal/modal.d.ts.map +1 -1
  326. package/es/components/modal/modal.js +3 -2
  327. package/es/components/modal/modal.js.map +1 -1
  328. package/es/components/multi-select/multi-select-item.d.ts +1 -1
  329. package/es/components/multi-select/multi-select-item.d.ts.map +1 -1
  330. package/es/components/multi-select/multi-select-item.js +3 -2
  331. package/es/components/multi-select/multi-select-item.js.map +1 -1
  332. package/es/components/multi-select/multi-select.d.ts +1 -1
  333. package/es/components/multi-select/multi-select.d.ts.map +1 -1
  334. package/es/components/multi-select/multi-select.js +3 -2
  335. package/es/components/multi-select/multi-select.js.map +1 -1
  336. package/es/components/notification/inline-notification.d.ts +1 -1
  337. package/es/components/notification/inline-notification.d.ts.map +1 -1
  338. package/es/components/notification/inline-notification.js +4 -3
  339. package/es/components/notification/inline-notification.js.map +1 -1
  340. package/es/components/notification/toast-notification.d.ts +1 -1
  341. package/es/components/notification/toast-notification.d.ts.map +1 -1
  342. package/es/components/notification/toast-notification.js +3 -2
  343. package/es/components/notification/toast-notification.js.map +1 -1
  344. package/es/components/number-input/number-input-skeleton.d.ts +1 -1
  345. package/es/components/number-input/number-input-skeleton.d.ts.map +1 -1
  346. package/es/components/number-input/number-input-skeleton.js +3 -2
  347. package/es/components/number-input/number-input-skeleton.js.map +1 -1
  348. package/es/components/number-input/number-input.d.ts +1 -1
  349. package/es/components/number-input/number-input.d.ts.map +1 -1
  350. package/es/components/number-input/number-input.js +3 -2
  351. package/es/components/number-input/number-input.js.map +1 -1
  352. package/es/components/overflow-menu/overflow-menu-body.d.ts +1 -1
  353. package/es/components/overflow-menu/overflow-menu-body.d.ts.map +1 -1
  354. package/es/components/overflow-menu/overflow-menu-body.js +3 -2
  355. package/es/components/overflow-menu/overflow-menu-body.js.map +1 -1
  356. package/es/components/overflow-menu/overflow-menu-item.d.ts +1 -1
  357. package/es/components/overflow-menu/overflow-menu-item.d.ts.map +1 -1
  358. package/es/components/overflow-menu/overflow-menu-item.js +3 -2
  359. package/es/components/overflow-menu/overflow-menu-item.js.map +1 -1
  360. package/es/components/overflow-menu/overflow-menu.d.ts +4 -1
  361. package/es/components/overflow-menu/overflow-menu.d.ts.map +1 -1
  362. package/es/components/overflow-menu/overflow-menu.js +3 -2
  363. package/es/components/overflow-menu/overflow-menu.js.map +1 -1
  364. package/es/components/pagination/page-sizes-select.d.ts +1 -1
  365. package/es/components/pagination/page-sizes-select.d.ts.map +1 -1
  366. package/es/components/pagination/page-sizes-select.js +3 -2
  367. package/es/components/pagination/page-sizes-select.js.map +1 -1
  368. package/es/components/pagination/pages-select.d.ts +1 -1
  369. package/es/components/pagination/pages-select.d.ts.map +1 -1
  370. package/es/components/pagination/pages-select.js +3 -2
  371. package/es/components/pagination/pages-select.js.map +1 -1
  372. package/es/components/pagination/pagination.d.ts +1 -1
  373. package/es/components/pagination/pagination.d.ts.map +1 -1
  374. package/es/components/pagination/pagination.js +3 -2
  375. package/es/components/pagination/pagination.js.map +1 -1
  376. package/es/components/progress-indicator/progress-indicator-skeleton.d.ts +1 -1
  377. package/es/components/progress-indicator/progress-indicator-skeleton.d.ts.map +1 -1
  378. package/es/components/progress-indicator/progress-indicator-skeleton.js +3 -2
  379. package/es/components/progress-indicator/progress-indicator-skeleton.js.map +1 -1
  380. package/es/components/progress-indicator/progress-indicator.d.ts +1 -1
  381. package/es/components/progress-indicator/progress-indicator.d.ts.map +1 -1
  382. package/es/components/progress-indicator/progress-indicator.js +3 -2
  383. package/es/components/progress-indicator/progress-indicator.js.map +1 -1
  384. package/es/components/progress-indicator/progress-step-skeleton.d.ts +1 -1
  385. package/es/components/progress-indicator/progress-step-skeleton.d.ts.map +1 -1
  386. package/es/components/progress-indicator/progress-step-skeleton.js +3 -2
  387. package/es/components/progress-indicator/progress-step-skeleton.js.map +1 -1
  388. package/es/components/progress-indicator/progress-step.d.ts +1 -1
  389. package/es/components/progress-indicator/progress-step.d.ts.map +1 -1
  390. package/es/components/progress-indicator/progress-step.js +3 -2
  391. package/es/components/progress-indicator/progress-step.js.map +1 -1
  392. package/es/components/radio-button/radio-button-group.d.ts +1 -1
  393. package/es/components/radio-button/radio-button-group.d.ts.map +1 -1
  394. package/es/components/radio-button/radio-button-group.js +3 -2
  395. package/es/components/radio-button/radio-button-group.js.map +1 -1
  396. package/es/components/radio-button/radio-button-skeleton.d.ts +1 -1
  397. package/es/components/radio-button/radio-button-skeleton.d.ts.map +1 -1
  398. package/es/components/radio-button/radio-button-skeleton.js +3 -2
  399. package/es/components/radio-button/radio-button-skeleton.js.map +1 -1
  400. package/es/components/radio-button/radio-button.d.ts +1 -1
  401. package/es/components/radio-button/radio-button.d.ts.map +1 -1
  402. package/es/components/radio-button/radio-button.js +3 -2
  403. package/es/components/radio-button/radio-button.js.map +1 -1
  404. package/es/components/search/search-skeleton.d.ts +1 -1
  405. package/es/components/search/search-skeleton.d.ts.map +1 -1
  406. package/es/components/search/search-skeleton.js +3 -2
  407. package/es/components/search/search-skeleton.js.map +1 -1
  408. package/es/components/search/search.d.ts +1 -1
  409. package/es/components/search/search.d.ts.map +1 -1
  410. package/es/components/search/search.js +3 -2
  411. package/es/components/search/search.js.map +1 -1
  412. package/es/components/select/select-item-group.d.ts +1 -1
  413. package/es/components/select/select-item-group.d.ts.map +1 -1
  414. package/es/components/select/select-item-group.js +3 -2
  415. package/es/components/select/select-item-group.js.map +1 -1
  416. package/es/components/select/select-item.d.ts +1 -1
  417. package/es/components/select/select-item.d.ts.map +1 -1
  418. package/es/components/select/select-item.js +3 -2
  419. package/es/components/select/select-item.js.map +1 -1
  420. package/es/components/select/select.d.ts +6 -2
  421. package/es/components/select/select.d.ts.map +1 -1
  422. package/es/components/select/select.js +3 -2
  423. package/es/components/select/select.js.map +1 -1
  424. package/es/components/skeleton-placeholder/skeleton-placeholder.d.ts +1 -1
  425. package/es/components/skeleton-placeholder/skeleton-placeholder.d.ts.map +1 -1
  426. package/es/components/skeleton-placeholder/skeleton-placeholder.js +3 -2
  427. package/es/components/skeleton-placeholder/skeleton-placeholder.js.map +1 -1
  428. package/es/components/skeleton-text/skeleton-text.d.ts +1 -1
  429. package/es/components/skeleton-text/skeleton-text.d.ts.map +1 -1
  430. package/es/components/skeleton-text/skeleton-text.js +3 -2
  431. package/es/components/skeleton-text/skeleton-text.js.map +1 -1
  432. package/es/components/skip-to-content/skip-to-content.d.ts +1 -1
  433. package/es/components/skip-to-content/skip-to-content.d.ts.map +1 -1
  434. package/es/components/skip-to-content/skip-to-content.js +3 -2
  435. package/es/components/skip-to-content/skip-to-content.js.map +1 -1
  436. package/es/components/slider/slider-input.d.ts +1 -1
  437. package/es/components/slider/slider-input.d.ts.map +1 -1
  438. package/es/components/slider/slider-input.js +3 -2
  439. package/es/components/slider/slider-input.js.map +1 -1
  440. package/es/components/slider/slider-skeleton.d.ts +1 -1
  441. package/es/components/slider/slider-skeleton.d.ts.map +1 -1
  442. package/es/components/slider/slider-skeleton.js +3 -2
  443. package/es/components/slider/slider-skeleton.js.map +1 -1
  444. package/es/components/slider/slider.d.ts +1 -1
  445. package/es/components/slider/slider.d.ts.map +1 -1
  446. package/es/components/slider/slider.js +3 -2
  447. package/es/components/slider/slider.js.map +1 -1
  448. package/es/components/structured-list/structured-list-body.d.ts +1 -1
  449. package/es/components/structured-list/structured-list-body.d.ts.map +1 -1
  450. package/es/components/structured-list/structured-list-body.js +3 -2
  451. package/es/components/structured-list/structured-list-body.js.map +1 -1
  452. package/es/components/structured-list/structured-list-cell.d.ts +1 -1
  453. package/es/components/structured-list/structured-list-cell.d.ts.map +1 -1
  454. package/es/components/structured-list/structured-list-cell.js +3 -2
  455. package/es/components/structured-list/structured-list-cell.js.map +1 -1
  456. package/es/components/structured-list/structured-list-head.d.ts +1 -1
  457. package/es/components/structured-list/structured-list-head.d.ts.map +1 -1
  458. package/es/components/structured-list/structured-list-head.js +3 -2
  459. package/es/components/structured-list/structured-list-head.js.map +1 -1
  460. package/es/components/structured-list/structured-list-header-cell-skeleton.d.ts +1 -1
  461. package/es/components/structured-list/structured-list-header-cell-skeleton.d.ts.map +1 -1
  462. package/es/components/structured-list/structured-list-header-cell-skeleton.js +3 -2
  463. package/es/components/structured-list/structured-list-header-cell-skeleton.js.map +1 -1
  464. package/es/components/structured-list/structured-list-header-cell.d.ts +1 -1
  465. package/es/components/structured-list/structured-list-header-cell.d.ts.map +1 -1
  466. package/es/components/structured-list/structured-list-header-cell.js +3 -2
  467. package/es/components/structured-list/structured-list-header-cell.js.map +1 -1
  468. package/es/components/structured-list/structured-list-header-row.d.ts +1 -1
  469. package/es/components/structured-list/structured-list-header-row.d.ts.map +1 -1
  470. package/es/components/structured-list/structured-list-header-row.js +3 -2
  471. package/es/components/structured-list/structured-list-header-row.js.map +1 -1
  472. package/es/components/structured-list/structured-list-row.d.ts +1 -1
  473. package/es/components/structured-list/structured-list-row.d.ts.map +1 -1
  474. package/es/components/structured-list/structured-list-row.js +3 -2
  475. package/es/components/structured-list/structured-list-row.js.map +1 -1
  476. package/es/components/structured-list/structured-list.d.ts +1 -1
  477. package/es/components/structured-list/structured-list.d.ts.map +1 -1
  478. package/es/components/structured-list/structured-list.js +3 -2
  479. package/es/components/structured-list/structured-list.js.map +1 -1
  480. package/es/components/tabs/tab-skeleton.d.ts +1 -1
  481. package/es/components/tabs/tab-skeleton.d.ts.map +1 -1
  482. package/es/components/tabs/tab-skeleton.js +3 -2
  483. package/es/components/tabs/tab-skeleton.js.map +1 -1
  484. package/es/components/tabs/tab.d.ts +1 -1
  485. package/es/components/tabs/tab.d.ts.map +1 -1
  486. package/es/components/tabs/tab.js +3 -2
  487. package/es/components/tabs/tab.js.map +1 -1
  488. package/es/components/tabs/tabs-skeleton.d.ts +1 -1
  489. package/es/components/tabs/tabs-skeleton.d.ts.map +1 -1
  490. package/es/components/tabs/tabs-skeleton.js +3 -2
  491. package/es/components/tabs/tabs-skeleton.js.map +1 -1
  492. package/es/components/tabs/tabs.d.ts +3 -3
  493. package/es/components/tabs/tabs.d.ts.map +1 -1
  494. package/es/components/tabs/tabs.js +5 -4
  495. package/es/components/tabs/tabs.js.map +1 -1
  496. package/es/components/tag/filter-tag.d.ts +5 -2
  497. package/es/components/tag/filter-tag.d.ts.map +1 -1
  498. package/es/components/tag/filter-tag.js +3 -2
  499. package/es/components/tag/filter-tag.js.map +1 -1
  500. package/es/components/tag/tag.d.ts +1 -1
  501. package/es/components/tag/tag.d.ts.map +1 -1
  502. package/es/components/tag/tag.js +3 -2
  503. package/es/components/tag/tag.js.map +1 -1
  504. package/es/components/textarea/textarea-skeleton.d.ts +1 -1
  505. package/es/components/textarea/textarea-skeleton.d.ts.map +1 -1
  506. package/es/components/textarea/textarea-skeleton.js +3 -2
  507. package/es/components/textarea/textarea-skeleton.js.map +1 -1
  508. package/es/components/textarea/textarea.d.ts +1 -1
  509. package/es/components/textarea/textarea.d.ts.map +1 -1
  510. package/es/components/textarea/textarea.js +3 -2
  511. package/es/components/textarea/textarea.js.map +1 -1
  512. package/es/components/tile/clickable-tile.d.ts +1 -1
  513. package/es/components/tile/clickable-tile.d.ts.map +1 -1
  514. package/es/components/tile/clickable-tile.js +3 -2
  515. package/es/components/tile/clickable-tile.js.map +1 -1
  516. package/es/components/tile/expandable-tile.d.ts +1 -1
  517. package/es/components/tile/expandable-tile.d.ts.map +1 -1
  518. package/es/components/tile/expandable-tile.js +3 -2
  519. package/es/components/tile/expandable-tile.js.map +1 -1
  520. package/es/components/tile/radio-tile.d.ts +1 -1
  521. package/es/components/tile/radio-tile.d.ts.map +1 -1
  522. package/es/components/tile/radio-tile.js +2 -2
  523. package/es/components/tile/radio-tile.js.map +1 -1
  524. package/es/components/tile/selectable-tile.d.ts.map +1 -1
  525. package/es/components/tile/selectable-tile.js +2 -1
  526. package/es/components/tile/selectable-tile.js.map +1 -1
  527. package/es/components/tile/tile-group.d.ts +1 -1
  528. package/es/components/tile/tile-group.d.ts.map +1 -1
  529. package/es/components/tile/tile-group.js +3 -2
  530. package/es/components/tile/tile-group.js.map +1 -1
  531. package/es/components/tile/tile.d.ts +1 -1
  532. package/es/components/tile/tile.d.ts.map +1 -1
  533. package/es/components/tile/tile.js +3 -2
  534. package/es/components/tile/tile.js.map +1 -1
  535. package/es/components/toggle/toggle.d.ts +1 -1
  536. package/es/components/toggle/toggle.d.ts.map +1 -1
  537. package/es/components/toggle/toggle.js +3 -2
  538. package/es/components/toggle/toggle.js.map +1 -1
  539. package/es/components/tooltip/tooltip-body.d.ts.map +1 -1
  540. package/es/components/tooltip/tooltip-body.js +2 -1
  541. package/es/components/tooltip/tooltip-body.js.map +1 -1
  542. package/es/components/tooltip/tooltip-definition.d.ts +1 -1
  543. package/es/components/tooltip/tooltip-definition.d.ts.map +1 -1
  544. package/es/components/tooltip/tooltip-definition.js +3 -2
  545. package/es/components/tooltip/tooltip-definition.js.map +1 -1
  546. package/es/components/tooltip/tooltip-footer.d.ts +1 -1
  547. package/es/components/tooltip/tooltip-footer.d.ts.map +1 -1
  548. package/es/components/tooltip/tooltip-footer.js +3 -2
  549. package/es/components/tooltip/tooltip-footer.js.map +1 -1
  550. package/es/components/tooltip/tooltip-icon.d.ts +1 -1
  551. package/es/components/tooltip/tooltip-icon.d.ts.map +1 -1
  552. package/es/components/tooltip/tooltip-icon.js +3 -2
  553. package/es/components/tooltip/tooltip-icon.js.map +1 -1
  554. package/es/components/tooltip/tooltip.d.ts.map +1 -1
  555. package/es/components/tooltip/tooltip.js +2 -1
  556. package/es/components/tooltip/tooltip.js.map +1 -1
  557. package/es/components/ui-shell/header-menu-button.d.ts +1 -1
  558. package/es/components/ui-shell/header-menu-button.d.ts.map +1 -1
  559. package/es/components/ui-shell/header-menu-button.js +3 -2
  560. package/es/components/ui-shell/header-menu-button.js.map +1 -1
  561. package/es/components/ui-shell/header-menu-item.d.ts +1 -1
  562. package/es/components/ui-shell/header-menu-item.d.ts.map +1 -1
  563. package/es/components/ui-shell/header-menu-item.js +2 -2
  564. package/es/components/ui-shell/header-menu-item.js.map +1 -1
  565. package/es/components/ui-shell/header-menu.d.ts +1 -1
  566. package/es/components/ui-shell/header-menu.d.ts.map +1 -1
  567. package/es/components/ui-shell/header-menu.js +3 -2
  568. package/es/components/ui-shell/header-menu.js.map +1 -1
  569. package/es/components/ui-shell/header-name.d.ts +1 -1
  570. package/es/components/ui-shell/header-name.d.ts.map +1 -1
  571. package/es/components/ui-shell/header-name.js +3 -2
  572. package/es/components/ui-shell/header-name.js.map +1 -1
  573. package/es/components/ui-shell/header-nav-item.d.ts +1 -1
  574. package/es/components/ui-shell/header-nav-item.d.ts.map +1 -1
  575. package/es/components/ui-shell/header-nav-item.js +3 -2
  576. package/es/components/ui-shell/header-nav-item.js.map +1 -1
  577. package/es/components/ui-shell/header-nav.d.ts +1 -1
  578. package/es/components/ui-shell/header-nav.d.ts.map +1 -1
  579. package/es/components/ui-shell/header-nav.js +3 -2
  580. package/es/components/ui-shell/header-nav.js.map +1 -1
  581. package/es/components/ui-shell/header.d.ts +1 -1
  582. package/es/components/ui-shell/header.d.ts.map +1 -1
  583. package/es/components/ui-shell/header.js +3 -2
  584. package/es/components/ui-shell/header.js.map +1 -1
  585. package/es/components/ui-shell/side-nav-divider.d.ts +1 -1
  586. package/es/components/ui-shell/side-nav-divider.d.ts.map +1 -1
  587. package/es/components/ui-shell/side-nav-divider.js +3 -2
  588. package/es/components/ui-shell/side-nav-divider.js.map +1 -1
  589. package/es/components/ui-shell/side-nav-items.d.ts +1 -1
  590. package/es/components/ui-shell/side-nav-items.d.ts.map +1 -1
  591. package/es/components/ui-shell/side-nav-items.js +3 -2
  592. package/es/components/ui-shell/side-nav-items.js.map +1 -1
  593. package/es/components/ui-shell/side-nav-link.d.ts +1 -1
  594. package/es/components/ui-shell/side-nav-link.d.ts.map +1 -1
  595. package/es/components/ui-shell/side-nav-link.js +3 -2
  596. package/es/components/ui-shell/side-nav-link.js.map +1 -1
  597. package/es/components/ui-shell/side-nav-menu-item.d.ts +1 -1
  598. package/es/components/ui-shell/side-nav-menu-item.d.ts.map +1 -1
  599. package/es/components/ui-shell/side-nav-menu-item.js +3 -2
  600. package/es/components/ui-shell/side-nav-menu-item.js.map +1 -1
  601. package/es/components/ui-shell/side-nav-menu.d.ts +1 -1
  602. package/es/components/ui-shell/side-nav-menu.d.ts.map +1 -1
  603. package/es/components/ui-shell/side-nav-menu.js +3 -2
  604. package/es/components/ui-shell/side-nav-menu.js.map +1 -1
  605. package/es/components/ui-shell/side-nav.d.ts +1 -1
  606. package/es/components/ui-shell/side-nav.d.ts.map +1 -1
  607. package/es/components/ui-shell/side-nav.js +3 -2
  608. package/es/components/ui-shell/side-nav.js.map +1 -1
  609. package/es/globals/decorators/carbon-element.d.ts +235 -0
  610. package/es/globals/decorators/carbon-element.d.ts.map +1 -0
  611. package/es/globals/decorators/carbon-element.js +429 -0
  612. package/es/globals/decorators/carbon-element.js.map +1 -0
  613. package/package.json +2 -2
  614. package/dist/checkbox-0edcc860.js +0 -65
  615. package/dist/checkbox-155d2e12.js +0 -65
  616. package/dist/copy-button-d50482da.js +0 -65
  617. package/dist/copy-button-e0c0c272.js +0 -65
  618. package/dist/link-5cef0608.js +0 -65
  619. package/dist/link-c666ff67.js +0 -65
  620. package/dist/loading-3754cb83.js +0 -65
  621. package/dist/loading-a86f38a0.js +0 -65
  622. package/dist/search-11f3a241.js +0 -65
  623. package/dist/search-487b4714.js +0 -65
@@ -1 +1 @@
1
- {"version":3,"sources":["components/file-uploader/file-uploader-item.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiC,UAAU,EAAE,MAAM,aAAa,CAAC;AAMxE,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAG3E,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,CAAC;AAI7D;;;;;;;;;;GAUG;AACH,cACM,kBAAmB,SAAQ,UAAU;IACzC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAahC;;OAEG;IACH,OAAO,CAAC,cAAc;IAoBtB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACH,OAAO,CAAC,eAAe;IAQvB;;OAEG;IACH,OAAO,CAAC,aAAa;IAcrB;;OAEG;IAEH,mBAAmB,SAAsB;IAEzC;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IAEH,IAAI,0BAAmC;IAEvC;;OAEG;IAEH,KAAK,2BAAsC;IAE3C;;OAEG;IAEH,sBAAsB,SAAe;IAErC;;OAEG;IAEH,qBAAqB,SAAc;IAEnC;;OAEG;IAEH,eAAe,SAAM;IAErB,MAAM;IAkBN;;;OAGG;IACH,MAAM,KAAK,iBAAiB,WAE3B;IAED;;OAEG;IACH,MAAM,KAAK,WAAW,WAErB;IAED,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,kBAAkB,CAAC","file":"file-uploader-item.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, customElement, LitElement } from 'lit-element';\nimport CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16';\nimport Close16 from '@carbon/icons/lib/close/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport { LOADING_TYPE } from '../loading/loading';\nimport { FILE_UPLOADER_ITEM_SIZE, FILE_UPLOADER_ITEM_STATE } from './defs';\nimport styles from './file-uploader.scss';\n\nexport { FILE_UPLOADER_ITEM_SIZE, FILE_UPLOADER_ITEM_STATE };\n\nconst { prefix } = settings;\n\n/**\n * File uploader item.\n *\n * @element bx-file-uploader-item\n * @slot validity-message The validity message.\n * @slot validity-message-supplement The supplemental validity message.\n * @fires bx-file-uploader-item-beingdeleted\n * The custom event fired before this file uploader item is being deleted upon a user gesture.\n * Cancellation of this event stops the user-initiated action of deleting this file uploader item.\n * @fires bx-file-uploader-item-deleted - The custom event fired after this file uploader item is deleted upon a user gesture.\n */\n@customElement(`${prefix}-file-uploader-item`)\nclass BXFileUploaderItem extends LitElement {\n /**\n * Handles `click` event on the delete button.\n */\n private _handleClickDeleteButton() {\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n };\n const { eventBeforeDelete, eventDelete } = this\n .constructor as typeof BXFileUploaderItem;\n if (this.dispatchEvent(new CustomEvent(eventBeforeDelete, init))) {\n this.dispatchEvent(new CustomEvent(eventDelete, init));\n }\n }\n\n /**\n * @returns The content showing the editing UI of this file uploader item.\n */\n private _renderEditing() {\n const {\n deleteAssistiveText,\n invalid,\n _handleClickDeleteButton: handleClickDeleteButton,\n } = this;\n return html`\n ${!invalid\n ? undefined\n : WarningFilled16({ class: `${prefix}--file-invalid` })}\n <button\n type=\"button\"\n aria-label=\"${deleteAssistiveText}\"\n class=\"${prefix}--file-close\"\n @click=\"${handleClickDeleteButton}\">\n ${Close16()}\n </button>\n `;\n }\n\n /**\n * @returns The content showing this file uploader's file uploading status as in progress.\n */\n private _renderUploading() {\n const { uploadingAssistiveText } = this;\n return html`\n <bx-loading\n assistive-text=\"${uploadingAssistiveText}\"\n type=\"${LOADING_TYPE.SMALL}\"></bx-loading>\n `;\n }\n\n /**\n * @returns The content showing this file uploader's file uploading status as complete.\n */\n private _renderUploaded() {\n const { uploadedAssistiveText } = this;\n return CheckmarkFilled16({\n class: `${prefix}--file-complete`,\n 'aria-label': uploadedAssistiveText,\n });\n }\n\n /**\n * @returns The content showing this file uploader's status.\n */\n private _renderStatus() {\n const { state } = this;\n switch (state) {\n case FILE_UPLOADER_ITEM_STATE.EDITING:\n return this._renderEditing();\n case FILE_UPLOADER_ITEM_STATE.UPLOADING:\n return this._renderUploading();\n case FILE_UPLOADER_ITEM_STATE.UPLOADED:\n return this._renderUploaded();\n default:\n return undefined;\n }\n }\n\n /**\n * The `aria-label` attribute for the icon to delete this file uploader item.\n */\n @property({ attribute: 'delete-assistive-text' })\n deleteAssistiveText = 'Delete this file';\n\n /**\n * Controls the invalid state and visibility of the `validityMessage`.\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * The size of this file uploader item.\n */\n @property({ reflect: true })\n size = FILE_UPLOADER_ITEM_SIZE.REGULAR;\n\n /**\n * The state of this file uploader item.\n */\n @property({ reflect: true })\n state = FILE_UPLOADER_ITEM_STATE.UPLOADING;\n\n /**\n * The `aria-label` attribute for the icon to indicate file uploading is in progress.\n */\n @property({ attribute: 'uploading-assistive-text' })\n uploadingAssistiveText = 'Uploading';\n\n /**\n * The `aria-label` attribute for the icon to indicate file uploading is complete.\n */\n @property({ attribute: 'uploaded-assistive-text' })\n uploadedAssistiveText = 'Uploaded';\n\n /**\n * The validity message.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n render() {\n const { validityMessage } = this;\n return html`\n <p class=\"${prefix}--file-filename\"><slot></slot></p>\n <span class=\"${prefix}--file__state-container\"\n >${this._renderStatus()}</span\n >\n <div class=\"${prefix}--form-requirement\">\n <div class=\"${prefix}--form-requirement__title\">\n <slot name=\"validity-message\">${validityMessage}</slot>\n </div>\n <p class=\"${prefix}--form-requirement__supplement\">\n <slot name=\"validity-message-supplement\"></slot>\n </p>\n </div>\n `;\n }\n\n /**\n * The name of the custom event fired before this file uplodaer item is being deleted upon a user gesture.\n * Cancellation of this event stops the user-initiated action of deleting this file uploader item.\n */\n static get eventBeforeDelete() {\n return `${prefix}-file-uploader-item-beingdeleted`;\n }\n\n /**\n * The name of the custom event fired after this file uplodaer item is deleted upon a user gesture.\n */\n static get eventDelete() {\n return `${prefix}-file-uploader-item-deleted`;\n }\n\n static styles = styles;\n}\n\nexport default BXFileUploaderItem;\n"]}
1
+ {"version":3,"sources":["components/file-uploader/file-uploader-item.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAkB,UAAU,EAAE,MAAM,aAAa,CAAC;AAMzD,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAC;AAI3E,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,CAAC;AAI7D;;;;;;;;;;GAUG;AACH,cACM,kBAAmB,SAAQ,UAAU;IACzC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAahC;;OAEG;IACH,OAAO,CAAC,cAAc;IAoBtB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACH,OAAO,CAAC,eAAe;IAQvB;;OAEG;IACH,OAAO,CAAC,aAAa;IAcrB;;OAEG;IAEH,mBAAmB,SAAsB;IAEzC;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IAEH,IAAI,0BAAmC;IAEvC;;OAEG;IAEH,KAAK,2BAAsC;IAE3C;;OAEG;IAEH,sBAAsB,SAAe;IAErC;;OAEG;IAEH,qBAAqB,SAAc;IAEnC;;OAEG;IAEH,eAAe,SAAM;IAErB,MAAM;IAkBN;;;OAGG;IACH,MAAM,KAAK,iBAAiB,WAE3B;IAED;;OAEG;IACH,MAAM,KAAK,WAAW,WAErB;IAED,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,kBAAkB,CAAC","file":"file-uploader-item.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, LitElement } from 'lit-element';\nimport CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16';\nimport Close16 from '@carbon/icons/lib/close/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport { LOADING_TYPE } from '../loading/loading';\nimport { FILE_UPLOADER_ITEM_SIZE, FILE_UPLOADER_ITEM_STATE } from './defs';\nimport styles from './file-uploader.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { FILE_UPLOADER_ITEM_SIZE, FILE_UPLOADER_ITEM_STATE };\n\nconst { prefix } = settings;\n\n/**\n * File uploader item.\n *\n * @element bx-file-uploader-item\n * @slot validity-message The validity message.\n * @slot validity-message-supplement The supplemental validity message.\n * @fires bx-file-uploader-item-beingdeleted\n * The custom event fired before this file uploader item is being deleted upon a user gesture.\n * Cancellation of this event stops the user-initiated action of deleting this file uploader item.\n * @fires bx-file-uploader-item-deleted - The custom event fired after this file uploader item is deleted upon a user gesture.\n */\n@customElement(`${prefix}-file-uploader-item`)\nclass BXFileUploaderItem extends LitElement {\n /**\n * Handles `click` event on the delete button.\n */\n private _handleClickDeleteButton() {\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n };\n const { eventBeforeDelete, eventDelete } = this\n .constructor as typeof BXFileUploaderItem;\n if (this.dispatchEvent(new CustomEvent(eventBeforeDelete, init))) {\n this.dispatchEvent(new CustomEvent(eventDelete, init));\n }\n }\n\n /**\n * @returns The content showing the editing UI of this file uploader item.\n */\n private _renderEditing() {\n const {\n deleteAssistiveText,\n invalid,\n _handleClickDeleteButton: handleClickDeleteButton,\n } = this;\n return html`\n ${!invalid\n ? undefined\n : WarningFilled16({ class: `${prefix}--file-invalid` })}\n <button\n type=\"button\"\n aria-label=\"${deleteAssistiveText}\"\n class=\"${prefix}--file-close\"\n @click=\"${handleClickDeleteButton}\">\n ${Close16()}\n </button>\n `;\n }\n\n /**\n * @returns The content showing this file uploader's file uploading status as in progress.\n */\n private _renderUploading() {\n const { uploadingAssistiveText } = this;\n return html`\n <bx-loading\n assistive-text=\"${uploadingAssistiveText}\"\n type=\"${LOADING_TYPE.SMALL}\"></bx-loading>\n `;\n }\n\n /**\n * @returns The content showing this file uploader's file uploading status as complete.\n */\n private _renderUploaded() {\n const { uploadedAssistiveText } = this;\n return CheckmarkFilled16({\n class: `${prefix}--file-complete`,\n 'aria-label': uploadedAssistiveText,\n });\n }\n\n /**\n * @returns The content showing this file uploader's status.\n */\n private _renderStatus() {\n const { state } = this;\n switch (state) {\n case FILE_UPLOADER_ITEM_STATE.EDITING:\n return this._renderEditing();\n case FILE_UPLOADER_ITEM_STATE.UPLOADING:\n return this._renderUploading();\n case FILE_UPLOADER_ITEM_STATE.UPLOADED:\n return this._renderUploaded();\n default:\n return undefined;\n }\n }\n\n /**\n * The `aria-label` attribute for the icon to delete this file uploader item.\n */\n @property({ attribute: 'delete-assistive-text' })\n deleteAssistiveText = 'Delete this file';\n\n /**\n * Controls the invalid state and visibility of the `validityMessage`.\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * The size of this file uploader item.\n */\n @property({ reflect: true })\n size = FILE_UPLOADER_ITEM_SIZE.REGULAR;\n\n /**\n * The state of this file uploader item.\n */\n @property({ reflect: true })\n state = FILE_UPLOADER_ITEM_STATE.UPLOADING;\n\n /**\n * The `aria-label` attribute for the icon to indicate file uploading is in progress.\n */\n @property({ attribute: 'uploading-assistive-text' })\n uploadingAssistiveText = 'Uploading';\n\n /**\n * The `aria-label` attribute for the icon to indicate file uploading is complete.\n */\n @property({ attribute: 'uploaded-assistive-text' })\n uploadedAssistiveText = 'Uploaded';\n\n /**\n * The validity message.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n render() {\n const { validityMessage } = this;\n return html`\n <p class=\"${prefix}--file-filename\"><slot></slot></p>\n <span class=\"${prefix}--file__state-container\"\n >${this._renderStatus()}</span\n >\n <div class=\"${prefix}--form-requirement\">\n <div class=\"${prefix}--form-requirement__title\">\n <slot name=\"validity-message\">${validityMessage}</slot>\n </div>\n <p class=\"${prefix}--form-requirement__supplement\">\n <slot name=\"validity-message-supplement\"></slot>\n </p>\n </div>\n `;\n }\n\n /**\n * The name of the custom event fired before this file uplodaer item is being deleted upon a user gesture.\n * Cancellation of this event stops the user-initiated action of deleting this file uploader item.\n */\n static get eventBeforeDelete() {\n return `${prefix}-file-uploader-item-beingdeleted`;\n }\n\n /**\n * The name of the custom event fired after this file uplodaer item is deleted upon a user gesture.\n */\n static get eventDelete() {\n return `${prefix}-file-uploader-item-deleted`;\n }\n\n static styles = styles;\n}\n\nexport default BXFileUploaderItem;\n"]}
@@ -6,13 +6,13 @@ let _ = t => t,
6
6
  /**
7
7
  * @license
8
8
  *
9
- * Copyright IBM Corp. 2020, 2022
9
+ * Copyright IBM Corp. 2020, 2023
10
10
  *
11
11
  * This source code is licensed under the Apache-2.0 license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  */
14
14
 
15
- import { html, property, customElement, LitElement } from 'lit-element';
15
+ import { html, property, LitElement } from 'lit-element';
16
16
  import CheckmarkFilled16 from "../../icons/checkmark--filled/16";
17
17
  import Close16 from "../../icons/close/16";
18
18
  import WarningFilled16 from "../../icons/warning--filled/16";
@@ -20,6 +20,7 @@ import settings from 'carbon-components/es/globals/js/settings';
20
20
  import { LOADING_TYPE } from '../loading/loading';
21
21
  import { FILE_UPLOADER_ITEM_SIZE, FILE_UPLOADER_ITEM_STATE } from './defs';
22
22
  import styles from "././file-uploader.css.js";
23
+ import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
23
24
  export { FILE_UPLOADER_ITEM_SIZE, FILE_UPLOADER_ITEM_STATE };
24
25
  const {
25
26
  prefix
@@ -1 +1 @@
1
- {"version":3,"file":"file-uploader-item.js","names":["html","property","customElement","LitElement","CheckmarkFilled16","Close16","WarningFilled16","settings","LOADING_TYPE","FILE_UPLOADER_ITEM_SIZE","FILE_UPLOADER_ITEM_STATE","styles","prefix","BXFileUploaderItem","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","key","value","_handleClickDeleteButton","init","bubbles","cancelable","composed","eventBeforeDelete","eventDelete","dispatchEvent","CustomEvent","_renderEditing","deleteAssistiveText","invalid","handleClickDeleteButton","_t","_","undefined","class","_renderUploading","uploadingAssistiveText","_t2","SMALL","_renderUploaded","uploadedAssistiveText","_renderStatus","state","EDITING","UPLOADING","UPLOADED","decorators","attribute","type","Boolean","reflect","REGULAR","render","validityMessage","_t3","static"],"sources":["components/file-uploader/file-uploader-item.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, customElement, LitElement } from 'lit-element';\nimport CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16';\nimport Close16 from '@carbon/icons/lib/close/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport { LOADING_TYPE } from '../loading/loading';\nimport { FILE_UPLOADER_ITEM_SIZE, FILE_UPLOADER_ITEM_STATE } from './defs';\nimport styles from './file-uploader.scss';\n\nexport { FILE_UPLOADER_ITEM_SIZE, FILE_UPLOADER_ITEM_STATE };\n\nconst { prefix } = settings;\n\n/**\n * File uploader item.\n *\n * @element bx-file-uploader-item\n * @slot validity-message The validity message.\n * @slot validity-message-supplement The supplemental validity message.\n * @fires bx-file-uploader-item-beingdeleted\n * The custom event fired before this file uploader item is being deleted upon a user gesture.\n * Cancellation of this event stops the user-initiated action of deleting this file uploader item.\n * @fires bx-file-uploader-item-deleted - The custom event fired after this file uploader item is deleted upon a user gesture.\n */\n@customElement(`${prefix}-file-uploader-item`)\nclass BXFileUploaderItem extends LitElement {\n /**\n * Handles `click` event on the delete button.\n */\n private _handleClickDeleteButton() {\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n };\n const { eventBeforeDelete, eventDelete } = this\n .constructor as typeof BXFileUploaderItem;\n if (this.dispatchEvent(new CustomEvent(eventBeforeDelete, init))) {\n this.dispatchEvent(new CustomEvent(eventDelete, init));\n }\n }\n\n /**\n * @returns The content showing the editing UI of this file uploader item.\n */\n private _renderEditing() {\n const {\n deleteAssistiveText,\n invalid,\n _handleClickDeleteButton: handleClickDeleteButton,\n } = this;\n return html`\n ${!invalid\n ? undefined\n : WarningFilled16({ class: `${prefix}--file-invalid` })}\n <button\n type=\"button\"\n aria-label=\"${deleteAssistiveText}\"\n class=\"${prefix}--file-close\"\n @click=\"${handleClickDeleteButton}\">\n ${Close16()}\n </button>\n `;\n }\n\n /**\n * @returns The content showing this file uploader's file uploading status as in progress.\n */\n private _renderUploading() {\n const { uploadingAssistiveText } = this;\n return html`\n <bx-loading\n assistive-text=\"${uploadingAssistiveText}\"\n type=\"${LOADING_TYPE.SMALL}\"></bx-loading>\n `;\n }\n\n /**\n * @returns The content showing this file uploader's file uploading status as complete.\n */\n private _renderUploaded() {\n const { uploadedAssistiveText } = this;\n return CheckmarkFilled16({\n class: `${prefix}--file-complete`,\n 'aria-label': uploadedAssistiveText,\n });\n }\n\n /**\n * @returns The content showing this file uploader's status.\n */\n private _renderStatus() {\n const { state } = this;\n switch (state) {\n case FILE_UPLOADER_ITEM_STATE.EDITING:\n return this._renderEditing();\n case FILE_UPLOADER_ITEM_STATE.UPLOADING:\n return this._renderUploading();\n case FILE_UPLOADER_ITEM_STATE.UPLOADED:\n return this._renderUploaded();\n default:\n return undefined;\n }\n }\n\n /**\n * The `aria-label` attribute for the icon to delete this file uploader item.\n */\n @property({ attribute: 'delete-assistive-text' })\n deleteAssistiveText = 'Delete this file';\n\n /**\n * Controls the invalid state and visibility of the `validityMessage`.\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * The size of this file uploader item.\n */\n @property({ reflect: true })\n size = FILE_UPLOADER_ITEM_SIZE.REGULAR;\n\n /**\n * The state of this file uploader item.\n */\n @property({ reflect: true })\n state = FILE_UPLOADER_ITEM_STATE.UPLOADING;\n\n /**\n * The `aria-label` attribute for the icon to indicate file uploading is in progress.\n */\n @property({ attribute: 'uploading-assistive-text' })\n uploadingAssistiveText = 'Uploading';\n\n /**\n * The `aria-label` attribute for the icon to indicate file uploading is complete.\n */\n @property({ attribute: 'uploaded-assistive-text' })\n uploadedAssistiveText = 'Uploaded';\n\n /**\n * The validity message.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n render() {\n const { validityMessage } = this;\n return html`\n <p class=\"${prefix}--file-filename\"><slot></slot></p>\n <span class=\"${prefix}--file__state-container\"\n >${this._renderStatus()}</span\n >\n <div class=\"${prefix}--form-requirement\">\n <div class=\"${prefix}--form-requirement__title\">\n <slot name=\"validity-message\">${validityMessage}</slot>\n </div>\n <p class=\"${prefix}--form-requirement__supplement\">\n <slot name=\"validity-message-supplement\"></slot>\n </p>\n </div>\n `;\n }\n\n /**\n * The name of the custom event fired before this file uplodaer item is being deleted upon a user gesture.\n * Cancellation of this event stops the user-initiated action of deleting this file uploader item.\n */\n static get eventBeforeDelete() {\n return `${prefix}-file-uploader-item-beingdeleted`;\n }\n\n /**\n * The name of the custom event fired after this file uplodaer item is deleted upon a user gesture.\n */\n static get eventDelete() {\n return `${prefix}-file-uploader-item-deleted`;\n }\n\n static styles = styles;\n}\n\nexport default BXFileUploaderItem;\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,UAAU,QAAQ,aAAa;AACvE,OAAOC,iBAAiB,MAAM,kCAAwC;AACtE,OAAOC,OAAO,MAAM,sBAA4B;AAChD,OAAOC,eAAe,MAAM,gCAAsC;AAClE,OAAOC,QAAQ,MAAM,0CAA0C;AAC/D,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,uBAAuB,EAAEC,wBAAwB,QAAQ,QAAQ;AAC1E,OAAOC,MAAM,MAAM,0BAAsB;AAEzC,SAASF,uBAAuB,EAAEC,wBAAwB;AAE1D,MAAM;EAAEE;AAAO,CAAC,GAAGL,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA,IAYMM,kBAAkB,GAAAC,SAAA,EADvBZ,aAAa,CAAE,GAAEU,MAAO,qBAAoB,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAA9C,MACMH,kBAAkB,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA4J5C;EAAC;IAAAI,CAAA,EA5JKN,kBAAkB;IAAAO,CAAA;MAAAC,IAAA;MAAAC,GAAA;MAAAC,KAAA;MACtB;AACF;AACA;MACE,SAAAC,yBAAA,EAAmC;QACjC,MAAMC,IAAI,G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Close16","WarningFilled16","settings","LOADING_TYPE","FILE_UPLOADER_ITEM_SIZE","FILE_UPLOADER_ITEM_STATE","styles","carbonElement","customElement","prefix","BXFileUploaderItem","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","key","value","_handleClickDeleteButton","init","bubbles","cancelable","composed","eventBeforeDelete","eventDelete","dispatchEvent","CustomEvent","_renderEditing","deleteAssistiveText","invalid","handleClickDeleteButton","_t","_","undefined","class","_renderUploading","uploadingAssistiveText","_t2","SMALL","_renderUploaded","uploadedAssistiveText","_renderStatus","state","EDITING","UPLOADING","UPLOADED","decorators","attribute","type","Boolean","reflect","REGULAR","render","validityMessage","_t3","static"],"sources":["components/file-uploader/file-uploader-item.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, LitElement } from 'lit-element';\nimport CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16';\nimport Close16 from '@carbon/icons/lib/close/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport { LOADING_TYPE } from '../loading/loading';\nimport { FILE_UPLOADER_ITEM_SIZE, FILE_UPLOADER_ITEM_STATE } from './defs';\nimport styles from './file-uploader.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { FILE_UPLOADER_ITEM_SIZE, FILE_UPLOADER_ITEM_STATE };\n\nconst { prefix } = settings;\n\n/**\n * File uploader item.\n *\n * @element bx-file-uploader-item\n * @slot validity-message The validity message.\n * @slot validity-message-supplement The supplemental validity message.\n * @fires bx-file-uploader-item-beingdeleted\n * The custom event fired before this file uploader item is being deleted upon a user gesture.\n * Cancellation of this event stops the user-initiated action of deleting this file uploader item.\n * @fires bx-file-uploader-item-deleted - The custom event fired after this file uploader item is deleted upon a user gesture.\n */\n@customElement(`${prefix}-file-uploader-item`)\nclass BXFileUploaderItem extends LitElement {\n /**\n * Handles `click` event on the delete button.\n */\n private _handleClickDeleteButton() {\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n };\n const { eventBeforeDelete, eventDelete } = this\n .constructor as typeof BXFileUploaderItem;\n if (this.dispatchEvent(new CustomEvent(eventBeforeDelete, init))) {\n this.dispatchEvent(new CustomEvent(eventDelete, init));\n }\n }\n\n /**\n * @returns The content showing the editing UI of this file uploader item.\n */\n private _renderEditing() {\n const {\n deleteAssistiveText,\n invalid,\n _handleClickDeleteButton: handleClickDeleteButton,\n } = this;\n return html`\n ${!invalid\n ? undefined\n : WarningFilled16({ class: `${prefix}--file-invalid` })}\n <button\n type=\"button\"\n aria-label=\"${deleteAssistiveText}\"\n class=\"${prefix}--file-close\"\n @click=\"${handleClickDeleteButton}\">\n ${Close16()}\n </button>\n `;\n }\n\n /**\n * @returns The content showing this file uploader's file uploading status as in progress.\n */\n private _renderUploading() {\n const { uploadingAssistiveText } = this;\n return html`\n <bx-loading\n assistive-text=\"${uploadingAssistiveText}\"\n type=\"${LOADING_TYPE.SMALL}\"></bx-loading>\n `;\n }\n\n /**\n * @returns The content showing this file uploader's file uploading status as complete.\n */\n private _renderUploaded() {\n const { uploadedAssistiveText } = this;\n return CheckmarkFilled16({\n class: `${prefix}--file-complete`,\n 'aria-label': uploadedAssistiveText,\n });\n }\n\n /**\n * @returns The content showing this file uploader's status.\n */\n private _renderStatus() {\n const { state } = this;\n switch (state) {\n case FILE_UPLOADER_ITEM_STATE.EDITING:\n return this._renderEditing();\n case FILE_UPLOADER_ITEM_STATE.UPLOADING:\n return this._renderUploading();\n case FILE_UPLOADER_ITEM_STATE.UPLOADED:\n return this._renderUploaded();\n default:\n return undefined;\n }\n }\n\n /**\n * The `aria-label` attribute for the icon to delete this file uploader item.\n */\n @property({ attribute: 'delete-assistive-text' })\n deleteAssistiveText = 'Delete this file';\n\n /**\n * Controls the invalid state and visibility of the `validityMessage`.\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * The size of this file uploader item.\n */\n @property({ reflect: true })\n size = FILE_UPLOADER_ITEM_SIZE.REGULAR;\n\n /**\n * The state of this file uploader item.\n */\n @property({ reflect: true })\n state = FILE_UPLOADER_ITEM_STATE.UPLOADING;\n\n /**\n * The `aria-label` attribute for the icon to indicate file uploading is in progress.\n */\n @property({ attribute: 'uploading-assistive-text' })\n uploadingAssistiveText = 'Uploading';\n\n /**\n * The `aria-label` attribute for the icon to indicate file uploading is complete.\n */\n @property({ attribute: 'uploaded-assistive-text' })\n uploadedAssistiveText = 'Uploaded';\n\n /**\n * The validity message.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n render() {\n const { validityMessage } = this;\n return html`\n <p class=\"${prefix}--file-filename\"><slot></slot></p>\n <span class=\"${prefix}--file__state-container\"\n >${this._renderStatus()}</span\n >\n <div class=\"${prefix}--form-requirement\">\n <div class=\"${prefix}--form-requirement__title\">\n <slot name=\"validity-message\">${validityMessage}</slot>\n </div>\n <p class=\"${prefix}--form-requirement__supplement\">\n <slot name=\"validity-message-supplement\"></slot>\n </p>\n </div>\n `;\n }\n\n /**\n * The name of the custom event fired before this file uplodaer item is being deleted upon a user gesture.\n * Cancellation of this event stops the user-initiated action of deleting this file uploader item.\n */\n static get eventBeforeDelete() {\n return `${prefix}-file-uploader-item-beingdeleted`;\n }\n\n /**\n * The name of the custom event fired after this file uplodaer item is deleted upon a user gesture.\n */\n static get eventDelete() {\n return `${prefix}-file-uploader-item-deleted`;\n }\n\n static styles = styles;\n}\n\nexport default BXFileUploaderItem;\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,aAAa;AACxD,OAAOC,iBAAiB,MAAM,kCAAwC;AACtE,OAAOC,OAAO,MAAM,sBAA4B;AAChD,OAAOC,eAAe,MAAM,gCAAsC;AAClE,OAAOC,QAAQ,MAAM,0CAA0C;AAC/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QAChC,OAAO5D,IAAI,CAAA6D,GAAA,KAAAA,GAAA,GAAAtB,CAAA,2VACG1B,MAAM,EACHA,MAAM,EAChB,IAAI,CAACmC,aAAa,EAAE,EAEXnC,MAAM,EACJA,MAAM,EACc+C,eAAe,EAErC/C,MAAM;MAKxB;;MAEA;AACF;AACA;AACA;IAHE;MAAAS,IAAA;MAAAwC,MAAA;MAAAvC,GAAA;MAAAC,KAAA,EAIA,SAAAM,kBAAA,EAA+B;QAC7B,OAAQ,GAAEjB,MAAO,kCAAiC;MACpD;;MAEA;AACF;AACA;IAFE;MAAAS,IAAA;MAAAwC,MAAA;MAAAvC,GAAA;MAAAC,KAAA,EAGA,SAAAO,YAAA,EAAyB;QACvB,OAAQ,GAAElB,MAAO,6BAA4B;MAC/C;IAAC;MAAAS,IAAA;MAAAwC,MAAA;MAAAvC,GAAA;MAAAC,MAAA;QAAA,OAEed,MAAM;MAAA;IAAA;EAAA;AAAA,GA3JSR,UAAU;AA8J3C,eAAeY,kBAAkB"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2019, 2022
4
+ * Copyright IBM Corp. 2019, 2023
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -1 +1 @@
1
- {"version":3,"sources":["components/file-uploader/file-uploader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiC,UAAU,EAAE,MAAM,aAAa,CAAC;AAMxE;;;;;;GAMG;AACH,cACM,cAAe,SAAQ,UAAU;IACrC;;OAEG;IAEH,UAAU,SAAM;IAEhB;;OAEG;IAEH,SAAS,SAAM;IAEf,MAAM;IAgBN,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,cAAc,CAAC","file":"file-uploader.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, customElement, LitElement } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport styles from './file-uploader.scss';\n\nconst { prefix } = settings;\n\n/**\n * The shell UI for file uploader.\n *\n * @element bx-file-uploader\n * @slot helper-text The helper text.\n * @slot label-text The label text.\n */\n@customElement(`${prefix}-file-uploader`)\nclass BXFileUploader extends LitElement {\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n render() {\n const { helperText, labelText } = this;\n return html`\n <strong class=\"${prefix}--file--label\"\n ><slot name=\"label-text\">${labelText}</slot></strong\n >\n <p class=\"${prefix}--label-description\">\n <slot name=\"helperText-text\">${helperText}</slot>\n </p>\n <slot name=\"drop-container\"></slot>\n <div class=\"${prefix}--file-container\">\n <slot></slot>\n </div>\n `;\n }\n\n static styles = styles;\n}\n\nexport default BXFileUploader;\n"]}
1
+ {"version":3,"sources":["components/file-uploader/file-uploader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAkB,UAAU,EAAE,MAAM,aAAa,CAAC;AAOzD;;;;;;GAMG;AACH,cACM,cAAe,SAAQ,UAAU;IACrC;;OAEG;IAEH,UAAU,SAAM;IAEhB;;OAEG;IAEH,SAAS,SAAM;IAEf,MAAM;IAgBN,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,cAAc,CAAC","file":"file-uploader.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, LitElement } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport styles from './file-uploader.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nconst { prefix } = settings;\n\n/**\n * The shell UI for file uploader.\n *\n * @element bx-file-uploader\n * @slot helper-text The helper text.\n * @slot label-text The label text.\n */\n@customElement(`${prefix}-file-uploader`)\nclass BXFileUploader extends LitElement {\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n render() {\n const { helperText, labelText } = this;\n return html`\n <strong class=\"${prefix}--file--label\"\n ><slot name=\"label-text\">${labelText}</slot></strong\n >\n <p class=\"${prefix}--label-description\">\n <slot name=\"helperText-text\">${helperText}</slot>\n </p>\n <slot name=\"drop-container\"></slot>\n <div class=\"${prefix}--file-container\">\n <slot></slot>\n </div>\n `;\n }\n\n static styles = styles;\n}\n\nexport default BXFileUploader;\n"]}
@@ -4,15 +4,16 @@ let _ = t => t,
4
4
  /**
5
5
  * @license
6
6
  *
7
- * Copyright IBM Corp. 2019, 2022
7
+ * Copyright IBM Corp. 2019, 2023
8
8
  *
9
9
  * This source code is licensed under the Apache-2.0 license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
 
13
- import { html, property, customElement, LitElement } from 'lit-element';
13
+ import { html, property, LitElement } from 'lit-element';
14
14
  import settings from 'carbon-components/es/globals/js/settings';
15
15
  import styles from "././file-uploader.css.js";
16
+ import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
16
17
  const {
17
18
  prefix
18
19
  } = settings;
@@ -1 +1 @@
1
- {"version":3,"file":"file-uploader.js","names":["html","property","customElement","LitElement","settings","styles","prefix","BXFileUploader","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","attribute","key","value","render","helperText","labelText","_t","_","static"],"sources":["components/file-uploader/file-uploader.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, customElement, LitElement } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport styles from './file-uploader.scss';\n\nconst { prefix } = settings;\n\n/**\n * The shell UI for file uploader.\n *\n * @element bx-file-uploader\n * @slot helper-text The helper text.\n * @slot label-text The label text.\n */\n@customElement(`${prefix}-file-uploader`)\nclass BXFileUploader extends LitElement {\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n render() {\n const { helperText, labelText } = this;\n return html`\n <strong class=\"${prefix}--file--label\"\n ><slot name=\"label-text\">${labelText}</slot></strong\n >\n <p class=\"${prefix}--label-description\">\n <slot name=\"helperText-text\">${helperText}</slot>\n </p>\n <slot name=\"drop-container\"></slot>\n <div class=\"${prefix}--file-container\">\n <slot></slot>\n </div>\n `;\n }\n\n static styles = styles;\n}\n\nexport default BXFileUploader;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,UAAU,QAAQ,aAAa;AACvE,OAAOC,QAAQ,MAAM,0CAA0C;AAC/D,OAAOC,MAAM,MAAM,0BAAsB;AAEzC,MAAM;EAAEC;AAAO,CAAC,GAAGF,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAQMG,cAAc,GAAAC,SAAA,EADnBN,aAAa,CAAE,GAAEI,MAAO,gBAAe,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAAzC,MACMH,cAAc,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA8BxC;EAAC;IAAAI,CAAA,EA9BKN,cAAc;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIjBf,QAAQ,CAAC;QAAEgB,SAAS,EAAE;MAAc,CAAC,CAAC;MAAAC,GAAA;MAAAC,MAAA;QAAA,OAC1B,EAAE;MAAA;IAAA;MAAAJ,IAAA;MAAAC,UAAA,GAKdf,QAAQ,CAAC;QAAEgB,SAAS,EAAE;MAAa,CAAC,CAAC;MAAAC,GAAA;MAAAC,MAAA;QAAA,OAC1B,EAAE;MAAA;IAAA;MAAAJ,IAAA;MAAAG,GAAA;MAAAC,KAAA;MAVd;AACF;AACA;;MAIE;AACF;AACA;;MAIE,SAAAC,OAAA,EAAS;QACP,MAAM;UAAEC,UAAU;UAAEC;QAAU,CAAC,GAAG,IAAI;QACtC,OAAOtB,IAAI,CAAAuB,EAAA,KAAAA,EAAA,GAAAC,CAAA,mQACQlB,MAAM,EACMgB,SAAS,EAE1BhB,MAAM,EACee,UAAU,EAG7Bf,MAAM;MAIxB;IAAC;MAAAS,IAAA;MAAAU,MAAA;MAAAP,GAAA;MAAAC,MAAA;QAAA,OAEed,MAAM;MAAA;IAAA;EAAA;AAAA,GA7BKF,UAAU;AAgCvC,eAAeI,cAAc"}
1
+ {"version":3,"file":"file-uploader.js","names":["html","property","LitElement","settings","styles","carbonElement","customElement","prefix","BXFileUploader","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","decorators","attribute","key","value","render","helperText","labelText","_t","_","static"],"sources":["components/file-uploader/file-uploader.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, LitElement } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport styles from './file-uploader.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nconst { prefix } = settings;\n\n/**\n * The shell UI for file uploader.\n *\n * @element bx-file-uploader\n * @slot helper-text The helper text.\n * @slot label-text The label text.\n */\n@customElement(`${prefix}-file-uploader`)\nclass BXFileUploader extends LitElement {\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n render() {\n const { helperText, labelText } = this;\n return html`\n <strong class=\"${prefix}--file--label\"\n ><slot name=\"label-text\">${labelText}</slot></strong\n >\n <p class=\"${prefix}--label-description\">\n <slot name=\"helperText-text\">${helperText}</slot>\n </p>\n <slot name=\"drop-container\"></slot>\n <div class=\"${prefix}--file-container\">\n <slot></slot>\n </div>\n `;\n }\n\n static styles = styles;\n}\n\nexport default BXFileUploader;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,aAAa;AACxD,OAAOC,QAAQ,MAAM,0CAA0C;AAC/D,OAAOC,MAAM,MAAM,0BAAsB;AACzC,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AAExF,MAAM;EAAEC;AAAO,CAAC,GAAGJ,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAQMK,cAAc,GAAAC,SAAA,EADnBH,aAAa,CAAE,GAAEC,MAAO,gBAAe,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAAzC,MACMH,cAAc,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA8BxC;EAAC;IAAAI,CAAA,EA9BKN,cAAc;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIjBhB,QAAQ,CAAC;QAAEiB,SAAS,EAAE;MAAc,CAAC,CAAC;MAAAC,GAAA;MAAAC,MAAA;QAAA,OAC1B,EAAE;MAAA;IAAA;MAAAJ,IAAA;MAAAC,UAAA,GAKdhB,QAAQ,CAAC;QAAEiB,SAAS,EAAE;MAAa,CAAC,CAAC;MAAAC,GAAA;MAAAC,MAAA;QAAA,OAC1B,EAAE;MAAA;IAAA;MAAAJ,IAAA;MAAAG,GAAA;MAAAC,KAAA;MAVd;AACF;AACA;;MAIE;AACF;AACA;;MAIE,SAAAC,OAAA,EAAS;QACP,MAAM;UAAEC,UAAU;UAAEC;QAAU,CAAC,GAAG,IAAI;QACtC,OAAOvB,IAAI,CAAAwB,EAAA,KAAAA,EAAA,GAAAC,CAAA,mQACQlB,MAAM,EACMgB,SAAS,EAE1BhB,MAAM,EACee,UAAU,EAG7Bf,MAAM;MAIxB;IAAC;MAAAS,IAAA;MAAAU,MAAA;MAAAP,GAAA;MAAAC,MAAA;QAAA,OAEehB,MAAM;MAAA;IAAA;EAAA;AAAA,GA7BKF,UAAU;AAgCvC,eAAeM,cAAc"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2019, 2022
4
+ * Copyright IBM Corp. 2019, 2023
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -1 +1 @@
1
- {"version":3,"sources":["components/form/form-item.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAiB,UAAU,EAAQ,MAAM,aAAa,CAAC;AAK9D;;;;GAIG;AAEH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,UAAU;IAChD,MAAM;IAIN,MAAM,CAAC,MAAM,MAAU;CACxB","file":"form-item.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport settings from 'carbon-components/es/globals/js/settings';\nimport { customElement, LitElement, html } from 'lit-element';\nimport styles from './form-item.scss';\n\nconst { prefix } = settings;\n\n/**\n * Presentational element for form items\n *\n * @element bx-form-item\n */\n@customElement(`${prefix}-form-item`)\nexport default class BXFormItem extends LitElement {\n render() {\n return html` <slot></slot> `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n"]}
1
+ {"version":3,"sources":["components/form/form-item.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,UAAU,EAAQ,MAAM,aAAa,CAAC;AAM/C;;;;GAIG;AAEH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,UAAU;IAChD,MAAM;IAIN,MAAM,CAAC,MAAM,MAAU;CACxB","file":"form-item.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport settings from 'carbon-components/es/globals/js/settings';\nimport { LitElement, html } from 'lit-element';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport styles from './form-item.scss';\n\nconst { prefix } = settings;\n\n/**\n * Presentational element for form items\n *\n * @element bx-form-item\n */\n@customElement(`${prefix}-form-item`)\nexport default class BXFormItem extends LitElement {\n render() {\n return html` <slot></slot> `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n"]}
@@ -4,14 +4,15 @@ let _ = t => t,
4
4
  /**
5
5
  * @license
6
6
  *
7
- * Copyright IBM Corp. 2019, 2022
7
+ * Copyright IBM Corp. 2019, 2023
8
8
  *
9
9
  * This source code is licensed under the Apache-2.0 license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
 
13
13
  import settings from 'carbon-components/es/globals/js/settings';
14
- import { customElement, LitElement, html } from 'lit-element';
14
+ import { LitElement, html } from 'lit-element';
15
+ import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
15
16
  import styles from "././form-item.css.js";
16
17
  const {
17
18
  prefix
@@ -1 +1 @@
1
- {"version":3,"file":"form-item.js","names":["settings","customElement","LitElement","html","styles","prefix","BXFormItem","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","key","value","render","_t","_","static","default"],"sources":["components/form/form-item.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport settings from 'carbon-components/es/globals/js/settings';\nimport { customElement, LitElement, html } from 'lit-element';\nimport styles from './form-item.scss';\n\nconst { prefix } = settings;\n\n/**\n * Presentational element for form items\n *\n * @element bx-form-item\n */\n@customElement(`${prefix}-form-item`)\nexport default class BXFormItem extends LitElement {\n render() {\n return html` <slot></slot> `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,QAAQ,MAAM,0CAA0C;AAC/D,SAASC,aAAa,EAAEC,UAAU,EAAEC,IAAI,QAAQ,aAAa;AAC7D,OAAOC,MAAM,MAAM,sBAAkB;AAErC,MAAM;EAAEC;AAAO,CAAC,GAAGL,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AAJA,IAMqBM,UAAU,GAAAC,SAAA,EAD9BN,aAAa,CAAE,GAAEI,MAAO,YAAW,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAArC,MACqBH,UAAU,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAMnD;EAAC;IAAAI,CAAA,EANoBN,UAAU;IAAAO,CAAA;MAAAC,IAAA;MAAAC,GAAA;MAAAC,KAAA,EAC7B,SAAAC,OAAA,EAAS;QACP,OAAOd,IAAI,CAAAe,EAAA,KAAAA,EAAA,GAAAC,CAAA;MACb;IAAC;MAAAL,IAAA;MAAAM,MAAA;MAAAL,GAAA;MAAAC,MAAA;QAAA,OAEeZ,MAAM;MAAA;IAAA;EAAA;AAAA,GALgBF,UAAU;AAAA,SAA7BI,UAAU,IAAAe,OAAA"}
1
+ {"version":3,"file":"form-item.js","names":["settings","LitElement","html","carbonElement","customElement","styles","prefix","BXFormItem","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","key","value","render","_t","_","static","default"],"sources":["components/form/form-item.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport settings from 'carbon-components/es/globals/js/settings';\nimport { LitElement, html } from 'lit-element';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport styles from './form-item.scss';\n\nconst { prefix } = settings;\n\n/**\n * Presentational element for form items\n *\n * @element bx-form-item\n */\n@customElement(`${prefix}-form-item`)\nexport default class BXFormItem extends LitElement {\n render() {\n return html` <slot></slot> `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,QAAQ,MAAM,0CAA0C;AAC/D,SAASC,UAAU,EAAEC,IAAI,QAAQ,aAAa;AAC9C,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AACxF,OAAOC,MAAM,MAAM,sBAAkB;AAErC,MAAM;EAAEC;AAAO,CAAC,GAAGN,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AAJA,IAMqBO,UAAU,GAAAC,SAAA,EAD9BJ,aAAa,CAAE,GAAEE,MAAO,YAAW,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAArC,MACqBH,UAAU,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAMnD;EAAC;IAAAI,CAAA,EANoBN,UAAU;IAAAO,CAAA;MAAAC,IAAA;MAAAC,GAAA;MAAAC,KAAA,EAC7B,SAAAC,OAAA,EAAS;QACP,OAAOhB,IAAI,CAAAiB,EAAA,KAAAA,EAAA,GAAAC,CAAA;MACb;IAAC;MAAAL,IAAA;MAAAM,MAAA;MAAAL,GAAA;MAAAC,MAAA;QAAA,OAEeZ,MAAM;MAAA;IAAA;EAAA;AAAA,GALgBJ,UAAU;AAAA,SAA7BM,UAAU,IAAAe,OAAA"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2019, 2022
4
+ * Copyright IBM Corp. 2019, 2023
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -1 +1 @@
1
- {"version":3,"sources":["components/inline-loading/inline-loading.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAiC,UAAU,EAAE,MAAM,aAAa,CAAC;AAOxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAG9C,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAIhC;;;;GAIG;AACH,cACM,eAAgB,SAAQ,UAAU;IACtC;;OAEG;IACH,OAAO,CAAC,WAAW;IA8BnB;;OAEG;IAEH,MAAM,uBAA+B;IAErC,iBAAiB;IAOjB,MAAM;IAeN,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,eAAe,CAAC","file":"inline-loading.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, customElement, LitElement } from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\nimport CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16';\nimport ErrorFilled16 from '@carbon/icons/lib/error--filled/16';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport LOADING_TYPE from '../loading/types';\nimport getLoadingIcon from '../loading/loading-icon';\nimport { INLINE_LOADING_STATE } from './defs';\nimport styles from './inline-loading.scss';\n\nexport { INLINE_LOADING_STATE };\n\nconst { prefix } = settings;\n\n/**\n * Lnline loading spinner.\n *\n * @element bx-inline-loading\n */\n@customElement(`${prefix}-inline-loading`)\nclass BXInlineLoading extends LitElement {\n /**\n * @returns The template for the status icon.\n */\n private _renderIcon() {\n const { status } = this;\n if (status === INLINE_LOADING_STATE.ERROR) {\n return ErrorFilled16({\n class: `${prefix}--inline-loading--error`,\n });\n }\n if (status === INLINE_LOADING_STATE.FINISHED) {\n return CheckmarkFilled16({\n class: `${prefix}--inline-loading__checkmark-container ${prefix}--inline-loading__svg`,\n });\n }\n if (\n status === INLINE_LOADING_STATE.INACTIVE ||\n status === INLINE_LOADING_STATE.ACTIVE\n ) {\n const classes = classMap({\n [`${prefix}--loading`]: true,\n [`${prefix}--loading--small`]: true,\n [`${prefix}--loading--stop`]: status === INLINE_LOADING_STATE.INACTIVE,\n });\n return html`\n <div class=\"${classes}\">\n ${getLoadingIcon({ type: LOADING_TYPE.SMALL })}\n </div>\n `;\n }\n return undefined;\n }\n\n /**\n * The loading status.\n */\n @property({ reflect: true })\n status = INLINE_LOADING_STATE.ACTIVE;\n\n connectedCallback() {\n if (!this.hasAttribute('aria-live')) {\n this.setAttribute('aria-live', 'assertive');\n }\n super.connectedCallback();\n }\n\n render() {\n const statusIconResult = this._renderIcon();\n const statusIconWrapperResult = !statusIconResult\n ? undefined\n : html`\n <div class=\"${prefix}--inline-loading__animation\">\n ${statusIconResult}\n </div>\n `;\n return html`\n ${statusIconWrapperResult}\n <p class=\"${prefix}--inline-loading__text\"><slot></slot></p>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXInlineLoading;\n"]}
1
+ {"version":3,"sources":["components/inline-loading/inline-loading.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAkB,UAAU,EAAE,MAAM,aAAa,CAAC;AAOzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAI9C,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAIhC;;;;GAIG;AACH,cACM,eAAgB,SAAQ,UAAU;IACtC;;OAEG;IACH,OAAO,CAAC,WAAW;IA8BnB;;OAEG;IAEH,MAAM,uBAA+B;IAErC,iBAAiB;IAOjB,MAAM;IAeN,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,eAAe,CAAC","file":"inline-loading.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, LitElement } from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\nimport CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16';\nimport ErrorFilled16 from '@carbon/icons/lib/error--filled/16';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport LOADING_TYPE from '../loading/types';\nimport getLoadingIcon from '../loading/loading-icon';\nimport { INLINE_LOADING_STATE } from './defs';\nimport styles from './inline-loading.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { INLINE_LOADING_STATE };\n\nconst { prefix } = settings;\n\n/**\n * Lnline loading spinner.\n *\n * @element bx-inline-loading\n */\n@customElement(`${prefix}-inline-loading`)\nclass BXInlineLoading extends LitElement {\n /**\n * @returns The template for the status icon.\n */\n private _renderIcon() {\n const { status } = this;\n if (status === INLINE_LOADING_STATE.ERROR) {\n return ErrorFilled16({\n class: `${prefix}--inline-loading--error`,\n });\n }\n if (status === INLINE_LOADING_STATE.FINISHED) {\n return CheckmarkFilled16({\n class: `${prefix}--inline-loading__checkmark-container ${prefix}--inline-loading__svg`,\n });\n }\n if (\n status === INLINE_LOADING_STATE.INACTIVE ||\n status === INLINE_LOADING_STATE.ACTIVE\n ) {\n const classes = classMap({\n [`${prefix}--loading`]: true,\n [`${prefix}--loading--small`]: true,\n [`${prefix}--loading--stop`]: status === INLINE_LOADING_STATE.INACTIVE,\n });\n return html`\n <div class=\"${classes}\">\n ${getLoadingIcon({ type: LOADING_TYPE.SMALL })}\n </div>\n `;\n }\n return undefined;\n }\n\n /**\n * The loading status.\n */\n @property({ reflect: true })\n status = INLINE_LOADING_STATE.ACTIVE;\n\n connectedCallback() {\n if (!this.hasAttribute('aria-live')) {\n this.setAttribute('aria-live', 'assertive');\n }\n super.connectedCallback();\n }\n\n render() {\n const statusIconResult = this._renderIcon();\n const statusIconWrapperResult = !statusIconResult\n ? undefined\n : html`\n <div class=\"${prefix}--inline-loading__animation\">\n ${statusIconResult}\n </div>\n `;\n return html`\n ${statusIconWrapperResult}\n <p class=\"${prefix}--inline-loading__text\"><slot></slot></p>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXInlineLoading;\n"]}
@@ -8,13 +8,13 @@ let _ = t => t,
8
8
  /**
9
9
  * @license
10
10
  *
11
- * Copyright IBM Corp. 2019, 2022
11
+ * Copyright IBM Corp. 2019, 2023
12
12
  *
13
13
  * This source code is licensed under the Apache-2.0 license found in the
14
14
  * LICENSE file in the root directory of this source tree.
15
15
  */
16
16
 
17
- import { html, property, customElement, LitElement } from 'lit-element';
17
+ import { html, property, LitElement } from 'lit-element';
18
18
  import { classMap } from 'lit-html/directives/class-map';
19
19
  import CheckmarkFilled16 from "../../icons/checkmark--filled/16";
20
20
  import ErrorFilled16 from "../../icons/error--filled/16";
@@ -23,6 +23,7 @@ import LOADING_TYPE from '../loading/types';
23
23
  import getLoadingIcon from '../loading/loading-icon';
24
24
  import { INLINE_LOADING_STATE } from './defs';
25
25
  import styles from "././inline-loading.css.js";
26
+ import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
26
27
  export { INLINE_LOADING_STATE };
27
28
  const {
28
29
  prefix
@@ -1 +1 @@
1
- {"version":3,"file":"inline-loading.js","names":["html","property","customElement","LitElement","classMap","CheckmarkFilled16","ErrorFilled16","settings","LOADING_TYPE","getLoadingIcon","INLINE_LOADING_STATE","styles","prefix","BXInlineLoading","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","key","value","_renderIcon","status","ERROR","class","FINISHED","INACTIVE","ACTIVE","classes","_t","_","type","SMALL","undefined","decorators","reflect","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","render","statusIconResult","statusIconWrapperResult","_t2","_t3","static"],"sources":["components/inline-loading/inline-loading.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, customElement, LitElement } from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\nimport CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16';\nimport ErrorFilled16 from '@carbon/icons/lib/error--filled/16';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport LOADING_TYPE from '../loading/types';\nimport getLoadingIcon from '../loading/loading-icon';\nimport { INLINE_LOADING_STATE } from './defs';\nimport styles from './inline-loading.scss';\n\nexport { INLINE_LOADING_STATE };\n\nconst { prefix } = settings;\n\n/**\n * Lnline loading spinner.\n *\n * @element bx-inline-loading\n */\n@customElement(`${prefix}-inline-loading`)\nclass BXInlineLoading extends LitElement {\n /**\n * @returns The template for the status icon.\n */\n private _renderIcon() {\n const { status } = this;\n if (status === INLINE_LOADING_STATE.ERROR) {\n return ErrorFilled16({\n class: `${prefix}--inline-loading--error`,\n });\n }\n if (status === INLINE_LOADING_STATE.FINISHED) {\n return CheckmarkFilled16({\n class: `${prefix}--inline-loading__checkmark-container ${prefix}--inline-loading__svg`,\n });\n }\n if (\n status === INLINE_LOADING_STATE.INACTIVE ||\n status === INLINE_LOADING_STATE.ACTIVE\n ) {\n const classes = classMap({\n [`${prefix}--loading`]: true,\n [`${prefix}--loading--small`]: true,\n [`${prefix}--loading--stop`]: status === INLINE_LOADING_STATE.INACTIVE,\n });\n return html`\n <div class=\"${classes}\">\n ${getLoadingIcon({ type: LOADING_TYPE.SMALL })}\n </div>\n `;\n }\n return undefined;\n }\n\n /**\n * The loading status.\n */\n @property({ reflect: true })\n status = INLINE_LOADING_STATE.ACTIVE;\n\n connectedCallback() {\n if (!this.hasAttribute('aria-live')) {\n this.setAttribute('aria-live', 'assertive');\n }\n super.connectedCallback();\n }\n\n render() {\n const statusIconResult = this._renderIcon();\n const statusIconWrapperResult = !statusIconResult\n ? undefined\n : html`\n <div class=\"${prefix}--inline-loading__animation\">\n ${statusIconResult}\n </div>\n `;\n return html`\n ${statusIconWrapperResult}\n <p class=\"${prefix}--inline-loading__text\"><slot></slot></p>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXInlineLoading;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,UAAU,QAAQ,aAAa;AACvE,SAASC,QAAQ,QAAQ,+BAA+B;AACxD,OAAOC,iBAAiB,MAAM,kCAAwC;AACtE,OAAOC,aAAa,MAAM,8BAAoC;AAC9D,OAAOC,QAAQ,MAAM,0CAA0C;AAC/D,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,cAAc,MAAM,yBAAyB;AACpD,SAASC,oBAAoB,QAAQ,QAAQ;AAC7C,OAAOC,MAAM,MAAM,2BAAuB;AAE1C,SAASD,oBAAoB;AAE7B,MAAM;EAAEE;AAAO,CAAC,GAAGL,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AAJA,IAMMM,eAAe,GAAAC,SAAA,EADpBZ,aAAa,CAAE,GAAEU,MAAO,iBAAgB,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAA1C,MACMH,eAAe,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA+DzC;EAAC;IAAAI,CAAA,EA/DKN,eAAe;IAAAO,CAAA;MAAAC,IAAA;MAAAC,GAAA;MAAAC,KAAA;MACnB;AACF;AACA;MACE,SAAAC,YAAA,EAAsB;QACpB,MAAM;UAAEC;QAAO,CAAC,GAAG,IAAI;QACvB,IAAIA,MAAM,KAAKf,oBAAoB,CAACgB,KAAK,EAAE;UACzC,OAAOpB,aAAa,CAAC;YACnBqB,KAAK,EAAG,GAAEf,MAAO;UACnB,CAAC,CAAC;QACJ;QACA,IAAIa,MAAM,KAAKf,oBAAoB,CAACkB,QAAQ,EAAE;UAC5C,OAAOvB,iBAAiB,CAAC;YACvBsB,KAAK,EAAG,GAAEf,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A,gEACYrB,MAAM,EAChBmC,gBAAgB,CAErB;QACL,OAAO/C,IAAI,CAAAkD,GAAA,KAAAA,GAAA,GAAAjB,CAAA,mEACPe,uBAAuB,EACbpC,MAAM;MAEtB;IAAC;MAAAS,IAAA;MAAA8B,MAAA;MAAA7B,GAAA;MAAAC,MAAA;QAAA,OAEeZ,MAAM;MAAA;IAAA;EAAA;AAAA,GA9DMR,UAAU;AAiExC,eAAeU,eAAe"}
1
+ {"version":3,"file":"inline-loading.js","names":["html","property","LitElement","classMap","CheckmarkFilled16","ErrorFilled16","settings","LOADING_TYPE","getLoadingIcon","INLINE_LOADING_STATE","styles","carbonElement","customElement","prefix","BXInlineLoading","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","key","value","_renderIcon","status","ERROR","class","FINISHED","INACTIVE","ACTIVE","classes","_t","_","type","SMALL","undefined","decorators","reflect","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","render","statusIconResult","statusIconWrapperResult","_t2","_t3","static"],"sources":["components/inline-loading/inline-loading.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, LitElement } from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\nimport CheckmarkFilled16 from '@carbon/icons/lib/checkmark--filled/16';\nimport ErrorFilled16 from '@carbon/icons/lib/error--filled/16';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport LOADING_TYPE from '../loading/types';\nimport getLoadingIcon from '../loading/loading-icon';\nimport { INLINE_LOADING_STATE } from './defs';\nimport styles from './inline-loading.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { INLINE_LOADING_STATE };\n\nconst { prefix } = settings;\n\n/**\n * Lnline loading spinner.\n *\n * @element bx-inline-loading\n */\n@customElement(`${prefix}-inline-loading`)\nclass BXInlineLoading extends LitElement {\n /**\n * @returns The template for the status icon.\n */\n private _renderIcon() {\n const { status } = this;\n if (status === INLINE_LOADING_STATE.ERROR) {\n return ErrorFilled16({\n class: `${prefix}--inline-loading--error`,\n });\n }\n if (status === INLINE_LOADING_STATE.FINISHED) {\n return CheckmarkFilled16({\n class: `${prefix}--inline-loading__checkmark-container ${prefix}--inline-loading__svg`,\n });\n }\n if (\n status === INLINE_LOADING_STATE.INACTIVE ||\n status === INLINE_LOADING_STATE.ACTIVE\n ) {\n const classes = classMap({\n [`${prefix}--loading`]: true,\n [`${prefix}--loading--small`]: true,\n [`${prefix}--loading--stop`]: status === INLINE_LOADING_STATE.INACTIVE,\n });\n return html`\n <div class=\"${classes}\">\n ${getLoadingIcon({ type: LOADING_TYPE.SMALL })}\n </div>\n `;\n }\n return undefined;\n }\n\n /**\n * The loading status.\n */\n @property({ reflect: true })\n status = INLINE_LOADING_STATE.ACTIVE;\n\n connectedCallback() {\n if (!this.hasAttribute('aria-live')) {\n this.setAttribute('aria-live', 'assertive');\n }\n super.connectedCallback();\n }\n\n render() {\n const statusIconResult = this._renderIcon();\n const statusIconWrapperResult = !statusIconResult\n ? undefined\n : html`\n <div class=\"${prefix}--inline-loading__animation\">\n ${statusIconResult}\n </div>\n `;\n return html`\n ${statusIconWrapperResult}\n <p class=\"${prefix}--inline-loading__text\"><slot></slot></p>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXInlineLoading;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,aAAa;AACxD,SAASC,QAAQ,QAAQ,+BAA+B;AACxD,OAAOC,iBAAiB,MAAM,kCAAwC;AACtE,OAAOC,aAAa,MAAM,8BAAoC;AAC9D,OAAOC,QAAQ,MAAM,0CAA0C;AAC/D,OAAOC,YAAY,MAAM,kBAAkB;AAC3C,OAAOC,cAAc,MAAM,yBAAyB;AACpD,SAASC,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5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -18,9 +18,6 @@ declare const BXInput_base: (abstract new (...args: any[]) => {
18
18
  requiredValidityMessage: string;
19
19
  validityMessage: string;
20
20
  value: string;
21
- /**
22
- * Sets the input to be focussed automatically on page load. Defaults to false
23
- */
24
21
  checkValidity(): boolean;
25
22
  setCustomValidity(validityMessage: string): void;
26
23
  accessKey: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["components/input/input.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAwC,UAAU,EAAE,MAAM,aAAa,CAAC;AAM/E,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGpE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;;;;;;;;;IAgDpD;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;OAEG;IACH,OAAO,CAAC,8BAA8B;IAKtC,MAAM;IAgGN,MAAM,CAAC,MAAM,MAAU;CACxB","file":"input.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, query, customElement, LitElement } from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport View16 from '@carbon/icons/lib/view/16';\nimport ViewOff16 from '@carbon/icons/lib/view--off/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport {\n FLOATING_MENU_ALIGNMENT,\n FLOATING_MENU_DIRECTION,\n} from '../floating-menu/floating-menu';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport FormMixin from '../../globals/mixins/form';\nimport ValidityMixin from '../../globals/mixins/validity';\nimport { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE } from './defs';\nimport styles from './input.scss';\n\nexport { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE };\n\nconst { prefix } = settings;\n\n/**\n * Input element. Supports all the usual attributes for textual input types\n *\n * @element bx-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-input`)\nexport default class BXInput extends ValidityMixin(FormMixin(LitElement)) {\n /**\n * The underlying input element\n */\n @query('input')\n protected _input!: HTMLInputElement;\n\n /**\n * The internal value.\n */\n protected _value = '';\n\n /**\n * Handles `oninput` event on the `<input>`.\n *\n * @param event The event.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLInputElement).value;\n }\n\n _handleFormdata(event: Event) {\n const { formData } = event as any; // TODO: Wait for `FormDataEvent` being available in `lib.dom.d.ts`\n const { disabled, name, value } = this;\n if (!disabled) {\n formData.append(name, value);\n }\n }\n\n /**\n * May be any of the standard HTML autocomplete options\n */\n @property()\n autocomplete = '';\n\n /**\n * Sets the input to be focussed automatically on page load. Defaults to false\n */\n @property({ type: Boolean })\n autofocus = false;\n\n /**\n * The color scheme.\n */\n @property({ attribute: 'color-scheme', reflect: true })\n colorScheme = INPUT_COLOR_SCHEME.REGULAR;\n\n /**\n * Controls the disabled state of the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * Controls the invalid state and visibility of the `validityMessage`\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n /**\n * Name for the input in the `FormData`\n */\n @property()\n name = '';\n\n /**\n * Pattern to validate the input against for HTML validity checking\n */\n @property()\n pattern = '';\n\n /**\n * Value to display when the input has an empty `value`\n */\n @property({ reflect: true })\n placeholder = '';\n\n /**\n * Controls the readonly state of the input\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Boolean property to set the required status\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The special validity message for `required`.\n */\n @property({ attribute: 'required-validity-message' })\n requiredValidityMessage = 'Please fill out this field.';\n\n /**\n * \"Hide password\" tooltip text on password visibility toggle\n */\n @property()\n hidePasswordLabel = 'Hide password';\n\n /**\n * \"Show password\" tooltip text on password visibility toggle\n */\n @property()\n showPasswordLabel = 'Show password';\n\n /**\n * Boolean property to render password visibility toggle\n */\n @property({\n type: Boolean,\n attribute: 'show-password-visibility-toggle',\n reflect: true,\n })\n showPasswordVisibilityToggle = false;\n\n /**\n * The input box size.\n */\n @property({ reflect: true })\n size = INPUT_SIZE.REGULAR;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property()\n tooltipAlignment = FLOATING_MENU_ALIGNMENT.CENTER;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property()\n tooltipDirection = FLOATING_MENU_DIRECTION.BOTTOM;\n\n /**\n * The type of the input. Can be one of the types listed in the INPUT_TYPE enum\n */\n @property({ reflect: true })\n type = INPUT_TYPE.TEXT;\n\n /**\n * The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n /**\n * The value of the input.\n */\n @property({ reflect: true })\n get value() {\n // FIXME: Figure out how to deal with TS2611\n // once we have the input we can directly query for the value\n if (this._input) {\n return this._input.value;\n }\n // but before then _value will work fine\n return this._value;\n }\n\n set value(value) {\n const oldValue = this._value;\n this._value = value;\n // make sure that lit-element updates the right properties\n this.requestUpdate('value', oldValue);\n // we set the value directly on the input (when available)\n // so that programatic manipulation updates the UI correctly\n if (this._input) {\n this._input.value = value;\n }\n }\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n /**\n * Handles password visibility toggle button click\n */\n private handleTogglePasswordVisibility() {\n this.type =\n this.type === INPUT_TYPE.PASSWORD ? INPUT_TYPE.TEXT : INPUT_TYPE.PASSWORD;\n }\n\n render() {\n const { _handleInput: handleInput } = this;\n\n const invalidIcon = WarningFilled16({\n class: `${prefix}--text-input__invalid-icon`,\n });\n\n const inputClasses = classMap({\n [`${prefix}--text-input`]: true,\n [`${prefix}--text-input--${this.colorScheme}`]: this.colorScheme,\n [`${prefix}--text-input--invalid`]: this.invalid,\n [`${prefix}--text-input--${this.size}`]: this.size,\n [`${prefix}--password-input`]: this.type === INPUT_TYPE.PASSWORD,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--label--disabled`]: this.disabled,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: this.disabled,\n });\n\n const passwordIsVisible = this.type !== INPUT_TYPE.PASSWORD;\n const passwordVisibilityIcon = passwordIsVisible\n ? ViewOff16({ class: `${prefix}--icon-visibility-off` })\n : View16({ class: `${prefix}--icon-visibility-on` });\n\n const passwordVisibilityToggleClasses = classMap({\n [`${prefix}--text-input--password__visibility__toggle`]: true,\n [`${prefix}--btn`]: true,\n [`${prefix}--btn--icon-only`]: true,\n [`${prefix}--tooltip__trigger`]: true,\n [`${prefix}--tooltip--a11y`]: true,\n [`${prefix}--btn--disabled`]: this.disabled,\n [`${prefix}--tooltip--${this.tooltipDirection}`]: this.tooltipDirection,\n [`${prefix}--tooltip--align-${this.tooltipAlignment}`]:\n this.tooltipAlignment,\n });\n\n const passwordButtonLabel = html`\n <span class=\"${prefix}--assistive-text\">\n ${passwordIsVisible ? this.hidePasswordLabel : this.showPasswordLabel}\n </span>\n `;\n\n const passwordVisibilityButton = () => html`\n <button\n type=\"button\"\n class=\"${passwordVisibilityToggleClasses}\"\n ?disabled=\"${this.disabled}\"\n @click=\"${this.handleTogglePasswordVisibility}\">\n ${!this.disabled && passwordButtonLabel} ${passwordVisibilityIcon}\n </button>\n `;\n\n return html`\n <label class=\"${labelClasses}\" for=\"input\">\n <slot name=\"label-text\"> ${this.labelText} </slot>\n </label>\n <div\n class=\"${prefix}--text-input__field-wrapper\"\n ?data-invalid=\"${this.invalid}\">\n ${this.invalid ? invalidIcon : null}\n <input\n ?autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n class=\"${inputClasses}\"\n ?data-invalid=\"${this.invalid}\"\n ?disabled=\"${this.disabled}\"\n aria-describedby=\"helper-text\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${this.readonly}\"\n ?required=\"${this.required}\"\n type=\"${ifNonEmpty(this.type)}\"\n .value=\"${this._value}\"\n @input=\"${handleInput}\" />\n ${this.showPasswordVisibilityToggle &&\n (this.type === INPUT_TYPE.PASSWORD || this.type === INPUT_TYPE.TEXT)\n ? passwordVisibilityButton()\n : null}\n </div>\n <div class=\"${helperTextClasses}\" id=\"helper-text\">\n <slot name=\"helper-text\"> ${this.helperText} </slot>\n </div>\n <div class=\"${prefix}--form-requirement\">\n <slot name=\"validity-message\"> ${this.validityMessage} </slot>\n </div>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n"]}
1
+ {"version":3,"sources":["components/input/input.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAyB,UAAU,EAAE,MAAM,aAAa,CAAC;AAMhE,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAIpE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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N,MAAM,CAAC,MAAM,MAAU;CACxB","file":"input.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, query, LitElement } from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport View16 from '@carbon/icons/lib/view/16';\nimport ViewOff16 from '@carbon/icons/lib/view--off/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport {\n FLOATING_MENU_ALIGNMENT,\n FLOATING_MENU_DIRECTION,\n} from '../floating-menu/floating-menu';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport FormMixin from '../../globals/mixins/form';\nimport ValidityMixin from '../../globals/mixins/validity';\nimport { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE } from './defs';\nimport styles from './input.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE };\n\nconst { prefix } = settings;\n\n/**\n * Input element. Supports all the usual attributes for textual input types\n *\n * @element bx-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-input`)\nexport default class BXInput extends ValidityMixin(FormMixin(LitElement)) {\n /**\n * The underlying input element\n */\n @query('input')\n protected _input!: HTMLInputElement;\n\n /**\n * The internal value.\n */\n protected _value = '';\n\n /**\n * Handles `oninput` event on the `<input>`.\n *\n * @param event The event.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLInputElement).value;\n }\n\n _handleFormdata(event: Event) {\n const { formData } = event as any; // TODO: Wait for `FormDataEvent` being available in `lib.dom.d.ts`\n const { disabled, name, value } = this;\n if (!disabled) {\n formData.append(name, value);\n }\n }\n\n /**\n * May be any of the standard HTML autocomplete options\n */\n @property()\n autocomplete = '';\n\n /**\n * Sets the input to be focussed automatically on page load. Defaults to false\n */\n @property({ type: Boolean })\n autofocus = false;\n\n /**\n * The color scheme.\n */\n @property({ attribute: 'color-scheme', reflect: true })\n colorScheme = INPUT_COLOR_SCHEME.REGULAR;\n\n /**\n * Controls the disabled state of the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * Controls the invalid state and visibility of the `validityMessage`\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n /**\n * Name for the input in the `FormData`\n */\n @property()\n name = '';\n\n /**\n * Pattern to validate the input against for HTML validity checking\n */\n @property()\n pattern = '';\n\n /**\n * Value to display when the input has an empty `value`\n */\n @property({ reflect: true })\n placeholder = '';\n\n /**\n * Controls the readonly state of the input\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Boolean property to set the required status\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The special validity message for `required`.\n */\n @property({ attribute: 'required-validity-message' })\n requiredValidityMessage = 'Please fill out this field.';\n\n /**\n * \"Hide password\" tooltip text on password visibility toggle\n */\n @property()\n hidePasswordLabel = 'Hide password';\n\n /**\n * \"Show password\" tooltip text on password visibility toggle\n */\n @property()\n showPasswordLabel = 'Show password';\n\n /**\n * Boolean property to render password visibility toggle\n */\n @property({\n type: Boolean,\n attribute: 'show-password-visibility-toggle',\n reflect: true,\n })\n showPasswordVisibilityToggle = false;\n\n /**\n * The input box size.\n */\n @property({ reflect: true })\n size = INPUT_SIZE.REGULAR;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property()\n tooltipAlignment = FLOATING_MENU_ALIGNMENT.CENTER;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property()\n tooltipDirection = FLOATING_MENU_DIRECTION.BOTTOM;\n\n /**\n * The type of the input. Can be one of the types listed in the INPUT_TYPE enum\n */\n @property({ reflect: true })\n type = INPUT_TYPE.TEXT;\n\n /**\n * The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n /**\n * The value of the input.\n */\n @property({ reflect: true })\n get value() {\n // FIXME: Figure out how to deal with TS2611\n // once we have the input we can directly query for the value\n if (this._input) {\n return this._input.value;\n }\n // but before then _value will work fine\n return this._value;\n }\n\n set value(value) {\n const oldValue = this._value;\n this._value = value;\n // make sure that lit-element updates the right properties\n this.requestUpdate('value', oldValue);\n // we set the value directly on the input (when available)\n // so that programatic manipulation updates the UI correctly\n if (this._input) {\n this._input.value = value;\n }\n }\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n /**\n * Handles password visibility toggle button click\n */\n private handleTogglePasswordVisibility() {\n this.type =\n this.type === INPUT_TYPE.PASSWORD ? INPUT_TYPE.TEXT : INPUT_TYPE.PASSWORD;\n }\n\n render() {\n const { _handleInput: handleInput } = this;\n\n const invalidIcon = WarningFilled16({\n class: `${prefix}--text-input__invalid-icon`,\n });\n\n const inputClasses = classMap({\n [`${prefix}--text-input`]: true,\n [`${prefix}--text-input--${this.colorScheme}`]: this.colorScheme,\n [`${prefix}--text-input--invalid`]: this.invalid,\n [`${prefix}--text-input--${this.size}`]: this.size,\n [`${prefix}--password-input`]: this.type === INPUT_TYPE.PASSWORD,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--label--disabled`]: this.disabled,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: this.disabled,\n });\n\n const passwordIsVisible = this.type !== INPUT_TYPE.PASSWORD;\n const passwordVisibilityIcon = passwordIsVisible\n ? ViewOff16({ class: `${prefix}--icon-visibility-off` })\n : View16({ class: `${prefix}--icon-visibility-on` });\n\n const passwordVisibilityToggleClasses = classMap({\n [`${prefix}--text-input--password__visibility__toggle`]: true,\n [`${prefix}--btn`]: true,\n [`${prefix}--btn--icon-only`]: true,\n [`${prefix}--tooltip__trigger`]: true,\n [`${prefix}--tooltip--a11y`]: true,\n [`${prefix}--btn--disabled`]: this.disabled,\n [`${prefix}--tooltip--${this.tooltipDirection}`]: this.tooltipDirection,\n [`${prefix}--tooltip--align-${this.tooltipAlignment}`]:\n this.tooltipAlignment,\n });\n\n const passwordButtonLabel = html`\n <span class=\"${prefix}--assistive-text\">\n ${passwordIsVisible ? this.hidePasswordLabel : this.showPasswordLabel}\n </span>\n `;\n\n const passwordVisibilityButton = () => html`\n <button\n type=\"button\"\n class=\"${passwordVisibilityToggleClasses}\"\n ?disabled=\"${this.disabled}\"\n @click=\"${this.handleTogglePasswordVisibility}\">\n ${!this.disabled && passwordButtonLabel} ${passwordVisibilityIcon}\n </button>\n `;\n\n return html`\n <label class=\"${labelClasses}\" for=\"input\">\n <slot name=\"label-text\"> ${this.labelText} </slot>\n </label>\n <div\n class=\"${prefix}--text-input__field-wrapper\"\n ?data-invalid=\"${this.invalid}\">\n ${this.invalid ? invalidIcon : null}\n <input\n ?autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n class=\"${inputClasses}\"\n ?data-invalid=\"${this.invalid}\"\n ?disabled=\"${this.disabled}\"\n aria-describedby=\"helper-text\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${this.readonly}\"\n ?required=\"${this.required}\"\n type=\"${ifNonEmpty(this.type)}\"\n .value=\"${this._value}\"\n @input=\"${handleInput}\" />\n ${this.showPasswordVisibilityToggle &&\n (this.type === INPUT_TYPE.PASSWORD || this.type === INPUT_TYPE.TEXT)\n ? passwordVisibilityButton()\n : null}\n </div>\n <div class=\"${helperTextClasses}\" id=\"helper-text\">\n <slot name=\"helper-text\"> ${this.helperText} </slot>\n </div>\n <div class=\"${prefix}--form-requirement\">\n <slot name=\"validity-message\"> ${this.validityMessage} </slot>\n </div>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n"]}
@@ -6,13 +6,13 @@ let _ = t => t,
6
6
  /**
7
7
  * @license
8
8
  *
9
- * Copyright IBM Corp. 2019, 2022
9
+ * Copyright IBM Corp. 2019, 2023
10
10
  *
11
11
  * This source code is licensed under the Apache-2.0 license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  */
14
14
 
15
- import { html, property, query, customElement, LitElement } from 'lit-element';
15
+ import { html, property, query, LitElement } from 'lit-element';
16
16
  import { classMap } from 'lit-html/directives/class-map';
17
17
  import settings from 'carbon-components/es/globals/js/settings';
18
18
  import View16 from "../../icons/view/16";
@@ -24,6 +24,7 @@ import FormMixin from '../../globals/mixins/form';
24
24
  import ValidityMixin from '../../globals/mixins/validity';
25
25
  import { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE } from './defs';
26
26
  import styles from "././input.css.js";
27
+ import { carbonElement as customElement } from '../../globals/decorators/carbon-element';
27
28
  export { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE };
28
29
  const {
29
30
  prefix
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","names":["html","property","query","customElement","LitElement","classMap","settings","View16","ViewOff16","WarningFilled16","FLOATING_MENU_ALIGNMENT","FLOATING_MENU_DIRECTION","ifNonEmpty","FormMixin","ValidityMixin","INPUT_COLOR_SCHEME","INPUT_SIZE","INPUT_TYPE","styles","prefix","BXInput","_decorate","_initialize","_ValidityMixin","constructor","args","F","d","kind","decorators","key","value","_handleInput","target","_handleFormdata","event","formData","disabled","name","append","type","Boolean","attribute","reflect","REGULAR","CENTER","BOTTOM","TEXT","_input","_value","oldValue","requestUpdate","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","Number","exec","navigator","userAgent","handleTogglePasswordVisibility","PASSWORD","render","handleInput","invalidIcon","class","inputClasses","colorScheme","invalid","size","labelClasses","helperTextClasses","passwordIsVisible","passwordVisibilityIcon","passwordVisibilityToggleClasses","tooltipDirection","tooltipAlignment","passwordButtonLabel","_t","_","hidePasswordLabel","showPasswordLabel","passwordVisibilityButton","_t2","_t3","labelText","autocomplete","autofocus","pattern","placeholder","readonly","required","showPasswordVisibilityToggle","helperText","validityMessage","static","default"],"sources":["components/input/input.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, query, customElement, LitElement } from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport View16 from '@carbon/icons/lib/view/16';\nimport ViewOff16 from '@carbon/icons/lib/view--off/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport {\n FLOATING_MENU_ALIGNMENT,\n FLOATING_MENU_DIRECTION,\n} from '../floating-menu/floating-menu';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport FormMixin from '../../globals/mixins/form';\nimport ValidityMixin from '../../globals/mixins/validity';\nimport { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE } from './defs';\nimport styles from './input.scss';\n\nexport { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE };\n\nconst { prefix } = settings;\n\n/**\n * Input element. Supports all the usual attributes for textual input types\n *\n * @element bx-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-input`)\nexport default class BXInput extends ValidityMixin(FormMixin(LitElement)) {\n /**\n * The underlying input element\n */\n @query('input')\n protected _input!: HTMLInputElement;\n\n /**\n * The internal value.\n */\n protected _value = '';\n\n /**\n * Handles `oninput` event on the `<input>`.\n *\n * @param event The event.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLInputElement).value;\n }\n\n _handleFormdata(event: Event) {\n const { formData } = event as any; // TODO: Wait for `FormDataEvent` being available in `lib.dom.d.ts`\n const { disabled, name, value } = this;\n if (!disabled) {\n formData.append(name, value);\n }\n }\n\n /**\n * May be any of the standard HTML autocomplete options\n */\n @property()\n autocomplete = '';\n\n /**\n * Sets the input to be focussed automatically on page load. Defaults to false\n */\n @property({ type: Boolean })\n autofocus = false;\n\n /**\n * The color scheme.\n */\n @property({ attribute: 'color-scheme', reflect: true })\n colorScheme = INPUT_COLOR_SCHEME.REGULAR;\n\n /**\n * Controls the disabled state of the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * Controls the invalid state and visibility of the `validityMessage`\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n /**\n * Name for the input in the `FormData`\n */\n @property()\n name = '';\n\n /**\n * Pattern to validate the input against for HTML validity checking\n */\n @property()\n pattern = '';\n\n /**\n * Value to display when the input has an empty `value`\n */\n @property({ reflect: true })\n placeholder = '';\n\n /**\n * Controls the readonly state of the input\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Boolean property to set the required status\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The special validity message for `required`.\n */\n @property({ attribute: 'required-validity-message' })\n requiredValidityMessage = 'Please fill out this field.';\n\n /**\n * \"Hide password\" tooltip text on password visibility toggle\n */\n @property()\n hidePasswordLabel = 'Hide password';\n\n /**\n * \"Show password\" tooltip text on password visibility toggle\n */\n @property()\n showPasswordLabel = 'Show password';\n\n /**\n * Boolean property to render password visibility toggle\n */\n @property({\n type: Boolean,\n attribute: 'show-password-visibility-toggle',\n reflect: true,\n })\n showPasswordVisibilityToggle = false;\n\n /**\n * The input box size.\n */\n @property({ reflect: true })\n size = INPUT_SIZE.REGULAR;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property()\n tooltipAlignment = FLOATING_MENU_ALIGNMENT.CENTER;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property()\n tooltipDirection = FLOATING_MENU_DIRECTION.BOTTOM;\n\n /**\n * The type of the input. Can be one of the types listed in the INPUT_TYPE enum\n */\n @property({ reflect: true })\n type = INPUT_TYPE.TEXT;\n\n /**\n * The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n /**\n * The value of the input.\n */\n @property({ reflect: true })\n get value() {\n // FIXME: Figure out how to deal with TS2611\n // once we have the input we can directly query for the value\n if (this._input) {\n return this._input.value;\n }\n // but before then _value will work fine\n return this._value;\n }\n\n set value(value) {\n const oldValue = this._value;\n this._value = value;\n // make sure that lit-element updates the right properties\n this.requestUpdate('value', oldValue);\n // we set the value directly on the input (when available)\n // so that programatic manipulation updates the UI correctly\n if (this._input) {\n this._input.value = value;\n }\n }\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n /**\n * Handles password visibility toggle button click\n */\n private handleTogglePasswordVisibility() {\n this.type =\n this.type === INPUT_TYPE.PASSWORD ? INPUT_TYPE.TEXT : INPUT_TYPE.PASSWORD;\n }\n\n render() {\n const { _handleInput: handleInput } = this;\n\n const invalidIcon = WarningFilled16({\n class: `${prefix}--text-input__invalid-icon`,\n });\n\n const inputClasses = classMap({\n [`${prefix}--text-input`]: true,\n [`${prefix}--text-input--${this.colorScheme}`]: this.colorScheme,\n [`${prefix}--text-input--invalid`]: this.invalid,\n [`${prefix}--text-input--${this.size}`]: this.size,\n [`${prefix}--password-input`]: this.type === INPUT_TYPE.PASSWORD,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--label--disabled`]: this.disabled,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: this.disabled,\n });\n\n const passwordIsVisible = this.type !== INPUT_TYPE.PASSWORD;\n const passwordVisibilityIcon = passwordIsVisible\n ? ViewOff16({ class: `${prefix}--icon-visibility-off` })\n : View16({ class: `${prefix}--icon-visibility-on` });\n\n const passwordVisibilityToggleClasses = classMap({\n [`${prefix}--text-input--password__visibility__toggle`]: true,\n [`${prefix}--btn`]: true,\n [`${prefix}--btn--icon-only`]: true,\n [`${prefix}--tooltip__trigger`]: true,\n [`${prefix}--tooltip--a11y`]: true,\n [`${prefix}--btn--disabled`]: this.disabled,\n [`${prefix}--tooltip--${this.tooltipDirection}`]: this.tooltipDirection,\n [`${prefix}--tooltip--align-${this.tooltipAlignment}`]:\n this.tooltipAlignment,\n });\n\n const passwordButtonLabel = html`\n <span class=\"${prefix}--assistive-text\">\n ${passwordIsVisible ? this.hidePasswordLabel : this.showPasswordLabel}\n </span>\n `;\n\n const passwordVisibilityButton = () => html`\n <button\n type=\"button\"\n class=\"${passwordVisibilityToggleClasses}\"\n ?disabled=\"${this.disabled}\"\n @click=\"${this.handleTogglePasswordVisibility}\">\n ${!this.disabled && passwordButtonLabel} ${passwordVisibilityIcon}\n </button>\n `;\n\n return html`\n <label class=\"${labelClasses}\" for=\"input\">\n <slot name=\"label-text\"> ${this.labelText} </slot>\n </label>\n <div\n class=\"${prefix}--text-input__field-wrapper\"\n ?data-invalid=\"${this.invalid}\">\n ${this.invalid ? invalidIcon : null}\n <input\n ?autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n class=\"${inputClasses}\"\n ?data-invalid=\"${this.invalid}\"\n ?disabled=\"${this.disabled}\"\n aria-describedby=\"helper-text\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${this.readonly}\"\n ?required=\"${this.required}\"\n type=\"${ifNonEmpty(this.type)}\"\n .value=\"${this._value}\"\n @input=\"${handleInput}\" />\n ${this.showPasswordVisibilityToggle &&\n (this.type === INPUT_TYPE.PASSWORD || this.type === INPUT_TYPE.TEXT)\n ? passwordVisibilityButton()\n : null}\n </div>\n <div class=\"${helperTextClasses}\" id=\"helper-text\">\n <slot name=\"helper-text\"> ${this.helperText} </slot>\n </div>\n <div class=\"${prefix}--form-requirement\">\n <slot name=\"validity-message\"> ${this.validityMessage} </slot>\n </div>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,aAAa,EAAEC,UAAU,QAAQ,aAAa;AAC9E,SAASC,QAAQ,QAAQ,+BAA+B;AACxD,OAAOC,QAAQ,MAAM,0CAA0C;AAC/D,OAAOC,MAAM,MAAM,qBAA2B;AAC9C,OAAOC,SAAS,MAAM,0BAAgC;AACtD,OAAOC,eAAe,MAAM,gCAAsC;AAClE,SACEC,uBAAuB,EACvBC,uBAAuB,QAClB,gCAAgC;AACvC,OAAOC,UAAU,MAAM,uCAAuC;AAC9D,OAAOC,SAAS,MAAM,2BAA2B;AACjD,OAAOC,aAAa,MAAM,+BAA+B;AACzD,SAASC,kBAAkB,EAAEC,UAAU,EAAEC,UAAU,QAAQ,QAAQ;AACnE,OAAOC,MAAM,MAAM,kBAAc;AAEjC,SAASH,kBAAkB,EAAEC,UAAU,EAAEC,UAAU;AAEnD,MAAM;EAAEE;AAAO,CAAC,GAAGb,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAS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b,MAAM;MAAA;IAAA;EAAA;AAAA,GA5SaJ,aAAa,CAACD,SAAS,CAACT,UAAU,CAAC,CAAC;AAAA,SAApDgB,OAAO,IAAA6E,OAAA"}
1
+ {"version":3,"file":"input.js","names":["html","property","query","LitElement","classMap","settings","View16","ViewOff16","WarningFilled16","FLOATING_MENU_ALIGNMENT","FLOATING_MENU_DIRECTION","ifNonEmpty","FormMixin","ValidityMixin","INPUT_COLOR_SCHEME","INPUT_SIZE","INPUT_TYPE","styles","carbonElement","customElement","prefix","BXInput","_decorate","_initialize","_ValidityMixin","constructor","args","F","d","kind","decorators","key","value","_handleInput","target","_handleFormdata","event","formData","disabled","name","append","type","Boolean","attribute","reflect","REGULAR","CENTER","BOTTOM","TEXT","_input","_value","oldValue","requestUpdate","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","Number","exec","navigator","userAgent","handleTogglePasswordVisibility","PASSWORD","render","handleInput","invalidIcon","class","inputClasses","colorScheme","invalid","size","labelClasses","helperTextClasses","passwordIsVisible","passwordVisibilityIcon","passwordVisibilityToggleClasses","tooltipDirection","tooltipAlignment","passwordButtonLabel","_t","_","hidePasswordLabel","showPasswordLabel","passwordVisibilityButton","_t2","_t3","labelText","autocomplete","autofocus","pattern","placeholder","readonly","required","showPasswordVisibilityToggle","helperText","validityMessage","static","default"],"sources":["components/input/input.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, query, LitElement } from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport View16 from '@carbon/icons/lib/view/16';\nimport ViewOff16 from '@carbon/icons/lib/view--off/16';\nimport WarningFilled16 from '@carbon/icons/lib/warning--filled/16';\nimport {\n FLOATING_MENU_ALIGNMENT,\n FLOATING_MENU_DIRECTION,\n} from '../floating-menu/floating-menu';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport FormMixin from '../../globals/mixins/form';\nimport ValidityMixin from '../../globals/mixins/validity';\nimport { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE } from './defs';\nimport styles from './input.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { INPUT_COLOR_SCHEME, INPUT_SIZE, INPUT_TYPE };\n\nconst { prefix } = settings;\n\n/**\n * Input element. Supports all the usual attributes for textual input types\n *\n * @element bx-input\n * @slot helper-text - The helper text.\n * @slot label-text - The label text.\n * @slot validity-message - The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n@customElement(`${prefix}-input`)\nexport default class BXInput extends ValidityMixin(FormMixin(LitElement)) {\n /**\n * The underlying input element\n */\n @query('input')\n protected _input!: HTMLInputElement;\n\n /**\n * The internal value.\n */\n protected _value = '';\n\n /**\n * Handles `oninput` event on the `<input>`.\n *\n * @param event The event.\n */\n protected _handleInput({ target }: Event) {\n this.value = (target as HTMLInputElement).value;\n }\n\n _handleFormdata(event: Event) {\n const { formData } = event as any; // TODO: Wait for `FormDataEvent` being available in `lib.dom.d.ts`\n const { disabled, name, value } = this;\n if (!disabled) {\n formData.append(name, value);\n }\n }\n\n /**\n * May be any of the standard HTML autocomplete options\n */\n @property()\n autocomplete = '';\n\n /**\n * Sets the input to be focussed automatically on page load. Defaults to false\n */\n @property({ type: Boolean })\n autofocus = false;\n\n /**\n * The color scheme.\n */\n @property({ attribute: 'color-scheme', reflect: true })\n colorScheme = INPUT_COLOR_SCHEME.REGULAR;\n\n /**\n * Controls the disabled state of the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * The helper text.\n */\n @property({ attribute: 'helper-text' })\n helperText = '';\n\n /**\n * Controls the invalid state and visibility of the `validityMessage`\n */\n @property({ type: Boolean, reflect: true })\n invalid = false;\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = '';\n\n /**\n * Name for the input in the `FormData`\n */\n @property()\n name = '';\n\n /**\n * Pattern to validate the input against for HTML validity checking\n */\n @property()\n pattern = '';\n\n /**\n * Value to display when the input has an empty `value`\n */\n @property({ reflect: true })\n placeholder = '';\n\n /**\n * Controls the readonly state of the input\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Boolean property to set the required status\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * The special validity message for `required`.\n */\n @property({ attribute: 'required-validity-message' })\n requiredValidityMessage = 'Please fill out this field.';\n\n /**\n * \"Hide password\" tooltip text on password visibility toggle\n */\n @property()\n hidePasswordLabel = 'Hide password';\n\n /**\n * \"Show password\" tooltip text on password visibility toggle\n */\n @property()\n showPasswordLabel = 'Show password';\n\n /**\n * Boolean property to render password visibility toggle\n */\n @property({\n type: Boolean,\n attribute: 'show-password-visibility-toggle',\n reflect: true,\n })\n showPasswordVisibilityToggle = false;\n\n /**\n * The input box size.\n */\n @property({ reflect: true })\n size = INPUT_SIZE.REGULAR;\n\n /**\n * Specify the alignment of the tooltip to the icon-only button.\n * Can be one of: start, center, or end.\n */\n @property()\n tooltipAlignment = FLOATING_MENU_ALIGNMENT.CENTER;\n\n /**\n * Specify the direction of the tooltip for icon-only buttons.\n * Can be either top, right, bottom, or left.\n */\n @property()\n tooltipDirection = FLOATING_MENU_DIRECTION.BOTTOM;\n\n /**\n * The type of the input. Can be one of the types listed in the INPUT_TYPE enum\n */\n @property({ reflect: true })\n type = INPUT_TYPE.TEXT;\n\n /**\n * The validity message. If present and non-empty, this input shows the UI of its invalid state.\n */\n @property({ attribute: 'validity-message' })\n validityMessage = '';\n\n /**\n * The value of the input.\n */\n @property({ reflect: true })\n get value() {\n // FIXME: Figure out how to deal with TS2611\n // once we have the input we can directly query for the value\n if (this._input) {\n return this._input.value;\n }\n // but before then _value will work fine\n return this._value;\n }\n\n set value(value) {\n const oldValue = this._value;\n this._value = value;\n // make sure that lit-element updates the right properties\n this.requestUpdate('value', oldValue);\n // we set the value directly on the input (when available)\n // so that programatic manipulation updates the UI correctly\n if (this._input) {\n this._input.value = value;\n }\n }\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n /**\n * Handles password visibility toggle button click\n */\n private handleTogglePasswordVisibility() {\n this.type =\n this.type === INPUT_TYPE.PASSWORD ? INPUT_TYPE.TEXT : INPUT_TYPE.PASSWORD;\n }\n\n render() {\n const { _handleInput: handleInput } = this;\n\n const invalidIcon = WarningFilled16({\n class: `${prefix}--text-input__invalid-icon`,\n });\n\n const inputClasses = classMap({\n [`${prefix}--text-input`]: true,\n [`${prefix}--text-input--${this.colorScheme}`]: this.colorScheme,\n [`${prefix}--text-input--invalid`]: this.invalid,\n [`${prefix}--text-input--${this.size}`]: this.size,\n [`${prefix}--password-input`]: this.type === INPUT_TYPE.PASSWORD,\n });\n\n const labelClasses = classMap({\n [`${prefix}--label`]: true,\n [`${prefix}--label--disabled`]: this.disabled,\n });\n\n const helperTextClasses = classMap({\n [`${prefix}--form__helper-text`]: true,\n [`${prefix}--form__helper-text--disabled`]: this.disabled,\n });\n\n const passwordIsVisible = this.type !== INPUT_TYPE.PASSWORD;\n const passwordVisibilityIcon = passwordIsVisible\n ? ViewOff16({ class: `${prefix}--icon-visibility-off` })\n : View16({ class: `${prefix}--icon-visibility-on` });\n\n const passwordVisibilityToggleClasses = classMap({\n [`${prefix}--text-input--password__visibility__toggle`]: true,\n [`${prefix}--btn`]: true,\n [`${prefix}--btn--icon-only`]: true,\n [`${prefix}--tooltip__trigger`]: true,\n [`${prefix}--tooltip--a11y`]: true,\n [`${prefix}--btn--disabled`]: this.disabled,\n [`${prefix}--tooltip--${this.tooltipDirection}`]: this.tooltipDirection,\n [`${prefix}--tooltip--align-${this.tooltipAlignment}`]:\n this.tooltipAlignment,\n });\n\n const passwordButtonLabel = html`\n <span class=\"${prefix}--assistive-text\">\n ${passwordIsVisible ? this.hidePasswordLabel : this.showPasswordLabel}\n </span>\n `;\n\n const passwordVisibilityButton = () => html`\n <button\n type=\"button\"\n class=\"${passwordVisibilityToggleClasses}\"\n ?disabled=\"${this.disabled}\"\n @click=\"${this.handleTogglePasswordVisibility}\">\n ${!this.disabled && passwordButtonLabel} ${passwordVisibilityIcon}\n </button>\n `;\n\n return html`\n <label class=\"${labelClasses}\" for=\"input\">\n <slot name=\"label-text\"> ${this.labelText} </slot>\n </label>\n <div\n class=\"${prefix}--text-input__field-wrapper\"\n ?data-invalid=\"${this.invalid}\">\n ${this.invalid ? invalidIcon : null}\n <input\n ?autocomplete=\"${this.autocomplete}\"\n ?autofocus=\"${this.autofocus}\"\n class=\"${inputClasses}\"\n ?data-invalid=\"${this.invalid}\"\n ?disabled=\"${this.disabled}\"\n aria-describedby=\"helper-text\"\n id=\"input\"\n name=\"${ifNonEmpty(this.name)}\"\n pattern=\"${ifNonEmpty(this.pattern)}\"\n placeholder=\"${ifNonEmpty(this.placeholder)}\"\n ?readonly=\"${this.readonly}\"\n ?required=\"${this.required}\"\n type=\"${ifNonEmpty(this.type)}\"\n .value=\"${this._value}\"\n @input=\"${handleInput}\" />\n ${this.showPasswordVisibilityToggle &&\n (this.type === INPUT_TYPE.PASSWORD || this.type === INPUT_TYPE.TEXT)\n ? passwordVisibilityButton()\n : null}\n </div>\n <div class=\"${helperTextClasses}\" id=\"helper-text\">\n <slot name=\"helper-text\"> ${this.helperText} </slot>\n </div>\n <div class=\"${prefix}--form-requirement\">\n <slot name=\"validity-message\"> ${this.validityMessage} </slot>\n </div>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,UAAU,QAAQ,aAAa;AAC/D,SAASC,QAAQ,QAAQ,+BAA+B;AACxD,OAAOC,QAAQ,MAAM,0CAA0C;AAC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AC+E,OAAO,CAAC,EACpB/E,UAAU,CAAC,IAAI,CAACgF,WAAW,CAAC,EAC9B,IAAI,CAACC,QAAQ,EACb,IAAI,CAACC,QAAQ,EAClBlF,UAAU,CAAC,IAAI,CAAC8B,IAAI,CAAC,EACnB,IAAI,CAACS,MAAM,EACXe,WAAW,EACrB,IAAI,CAAC6B,4BAA4B,KAClC,IAAI,CAACrD,IAAI,KAAKzB,UAAU,CAAC+C,QAAQ,IAAI,IAAI,CAACtB,IAAI,KAAKzB,UAAU,CAACgC,IAAI,CAAC,GAChEoC,wBAAwB,EAAE,GAC1B,IAAI,EAEIX,iBAAiB,EACD,IAAI,CAACsB,UAAU,EAE/B3E,MAAM,EACe,IAAI,CAAC4E,eAAe;MAG3D;IAAC;MAAAnE,IAAA;MAAAoE,MAAA;MAAAlE,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GA5SaJ,aAAa,CAACD,SAAS,CAACT,UAAU,CAAC,CAAC;AAAA,SAApDkB,OAAO,IAAA6E,OAAA"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2019, 2022
4
+ * Copyright IBM Corp. 2019, 2023
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -1 +1 @@
1
- {"version":3,"sources":["components/link/link.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAiC,UAAU,EAAS,MAAM,aAAa,CAAC;AAQ/E;;GAEG;AACH,oBAAY,SAAS;IACnB;;OAEG;IACH,OAAO,KAAK;IAEZ;;OAEG;IACH,KAAK,OAAO;IAEZ;;OAEG;IACH,KAAK,OAAO;CACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Corp. 2019, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit-html/directives/class-map';\nimport { html, property, customElement, LitElement, query } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport ifNonNull from '../../globals/directives/if-non-null';\nimport FocusMixin from '../../globals/mixins/focus';\nimport styles from './link.scss';\n\nconst { prefix } = settings;\n\n/**\n * Link size.\n */\nexport enum LINK_SIZE {\n /**\n * Regular size\n */\n REGULAR = '',\n\n /**\n * Small size.\n */\n SMALL = 'sm',\n\n /**\n * Large size.\n */\n LARGE = 'lg',\n}\n\n/**\n * Link.\n *\n * @element bx-link\n * @csspart link The link.\n */\n@customElement(`${prefix}-link`)\nclass BXLink extends FocusMixin(LitElement) {\n /**\n * `true` if there is an icon.\n */\n private _hasIcon = false;\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlotChange({ target }: Event) {\n const { name } = target as HTMLSlotElement;\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .some(\n (node) => node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim()\n );\n this[name === 'icon' ? '_hasIcon' : ''] = hasContent;\n this.requestUpdate();\n }\n\n @query('#link')\n protected _linkNode?: HTMLAnchorElement | HTMLParagraphElement;\n\n /**\n * The CSS class list for the link node.\n */\n protected get _classes() {\n const { disabled, size } = this;\n return classMap({\n [`${prefix}--link`]: true,\n [`${prefix}--link--disabled`]: disabled,\n [`${prefix}--link--${size}`]: size,\n });\n }\n\n /**\n * Handles `click` event on the `<a>`.\n */\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n protected _handleClick(_: MouseEvent) {}\n\n /**\n * @returns The inner content.\n */\n // eslint-disable-next-line class-methods-use-this\n protected _renderInner() {\n const { _hasIcon: hasIcon, _handleSlotChange: handleSlotChange } = this;\n return html`\n <slot @slotchange=\"${handleSlotChange}\"></slot>\n <div ?hidden=\"${!hasIcon}\" class=\"${prefix}--link__icon\">\n <slot name=\"icon\" @slotchange=\"${handleSlotChange}\"></slot>\n </div>\n `;\n }\n\n /**\n * @returns The disabled link content.\n */\n protected _renderDisabledLink() {\n const { _classes: classes } = this;\n return html`\n <p id=\"link\" part=\"link\" class=\"${classes}\">${this._renderInner()}</p>\n `;\n }\n\n /**\n * @returns The link content.\n */\n protected _renderLink() {\n const {\n download,\n href,\n hreflang,\n linkRole,\n ping,\n rel,\n target,\n type,\n _classes: classes,\n _handleClick: handleClick,\n } = this;\n return html`\n <a\n id=\"link\"\n role=\"${ifNonNull(linkRole)}\"\n class=\"${classes}\"\n part=\"link\"\n download=\"${ifNonNull(download)}\"\n href=\"${ifNonNull(href)}\"\n hreflang=\"${ifNonNull(hreflang)}\"\n ping=\"${ifNonNull(ping)}\"\n rel=\"${ifNonNull(rel)}\"\n target=\"${ifNonNull(target)}\"\n type=\"${ifNonNull(type)}\"\n @click=\"${handleClick}\">\n ${this._renderInner()}\n </a>\n `;\n }\n\n /**\n * `true` if the button should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * The default file name.\n */\n @property({ reflect: true })\n download!: string;\n\n /**\n * Link `href`.\n */\n @property({ reflect: true })\n href!: string;\n\n /**\n * The language of what `href` points to.\n */\n @property({ reflect: true })\n hreflang!: string;\n\n /**\n * The a11y role for `<a>`.\n */\n @property({ attribute: 'link-role' })\n linkRole!: string;\n\n /**\n * URLs to ping.\n */\n @property({ reflect: true })\n ping!: string;\n\n /**\n * The link type.\n */\n @property({ reflect: true })\n rel!: string;\n\n /**\n * Link size.\n */\n @property({ reflect: true })\n size = LINK_SIZE.REGULAR;\n\n /**\n * The link target.\n */\n @property({ reflect: true })\n target!: string;\n\n /**\n * MIME type of the `target`.\n */\n @property({ reflect: true })\n type!: string;\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n render() {\n const { disabled } = this;\n return disabled ? this._renderDisabledLink() : this._renderLink();\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXLink;\n"]}
1
+ {"version":3,"sources":["components/link/link.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAkB,UAAU,EAAS,MAAM,aAAa,CAAC;AAShE;;GAEG;AACH,oBAAY,SAAS;IACnB;;OAEG;IACH,OAAO,KAAK;IAEZ;;OAEG;IACH,KAAK,OAAO;IAEZ;;OAEG;IACH,KAAK,OAAO;CACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED;;;;;GAKG;AACH,cACM,MAAO,SAAQ,WAAsB;IACzC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAS;IAEzB;;OAEG;IACH,SAAS,CAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK;IAY7C,SAAS,CAAC,SAAS,CAAC,EAAE,iBAAiB,GAAG,oBAAoB,CAAC;IAE/D;;OAEG;IACH,SAAS,KAAK,QAAQ,4CAOrB;IAED;;OAEG;IAEH,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU;IAEpC;;OAEG;IAEH,SAAS,CAAC,YAAY;IAUtB;;OAEG;IACH,SAAS,CAAC,mBAAmB;IAO7B;;OAEG;IACH,SAAS,CAAC,WAAW;IAgCrB;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,QAAQ,EAAG,MAAM,CAAC;IAElB;;OAEG;IAEH,IAAI,EAAG,MAAM,CAAC;IAEd;;OAEG;IAEH,QAAQ,EAAG,MAAM,CAAC;IAElB;;OAEG;IAEH,QAAQ,EAAG,MAAM,CAAC;IAElB;;OAEG;IAEH,IAAI,EAAG,MAAM,CAAC;IAEd;;OAEG;IAEH,GAAG,EAAG,MAAM,CAAC;IAEb;;OAEG;IAEH,IAAI,YAAqB;IAEzB;;OAEG;IAEH,MAAM,EAAG,MAAM,CAAC;IAEhB;;OAEG;IAEH,IAAI,EAAG,MAAM,CAAC;IAEd,gBAAgB;IAShB,MAAM;IAKN,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,MAAM,CAAC","file":"link.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit-html/directives/class-map';\nimport { html, property, LitElement, query } from 'lit-element';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport ifNonNull from '../../globals/directives/if-non-null';\nimport FocusMixin from '../../globals/mixins/focus';\nimport styles from './link.scss';\n\nconst { prefix } = settings;\n\n/**\n * Link size.\n */\nexport enum LINK_SIZE {\n /**\n * Regular size\n */\n REGULAR = '',\n\n /**\n * Small size.\n */\n SMALL = 'sm',\n\n /**\n * Large size.\n */\n LARGE = 'lg',\n}\n\n/**\n * Link.\n *\n * @element bx-link\n * @csspart link The link.\n */\n@customElement(`${prefix}-link`)\nclass BXLink extends FocusMixin(LitElement) {\n /**\n * `true` if there is an icon.\n */\n private _hasIcon = false;\n\n /**\n * Handles `slotchange` event.\n */\n protected _handleSlotChange({ target }: Event) {\n const { name } = target as HTMLSlotElement;\n const hasContent = (target as HTMLSlotElement)\n .assignedNodes()\n .some(\n (node) => node.nodeType !== Node.TEXT_NODE || node!.textContent!.trim()\n );\n this[name === 'icon' ? '_hasIcon' : ''] = hasContent;\n this.requestUpdate();\n }\n\n @query('#link')\n protected _linkNode?: HTMLAnchorElement | HTMLParagraphElement;\n\n /**\n * The CSS class list for the link node.\n */\n protected get _classes() {\n const { disabled, size } = this;\n return classMap({\n [`${prefix}--link`]: true,\n [`${prefix}--link--disabled`]: disabled,\n [`${prefix}--link--${size}`]: size,\n });\n }\n\n /**\n * Handles `click` event on the `<a>`.\n */\n // eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-unused-vars\n protected _handleClick(_: MouseEvent) {}\n\n /**\n * @returns The inner content.\n */\n // eslint-disable-next-line class-methods-use-this\n protected _renderInner() {\n const { _hasIcon: hasIcon, _handleSlotChange: handleSlotChange } = this;\n return html`\n <slot @slotchange=\"${handleSlotChange}\"></slot>\n <div ?hidden=\"${!hasIcon}\" class=\"${prefix}--link__icon\">\n <slot name=\"icon\" @slotchange=\"${handleSlotChange}\"></slot>\n </div>\n `;\n }\n\n /**\n * @returns The disabled link content.\n */\n protected _renderDisabledLink() {\n const { _classes: classes } = this;\n return html`\n <p id=\"link\" part=\"link\" class=\"${classes}\">${this._renderInner()}</p>\n `;\n }\n\n /**\n * @returns The link content.\n */\n protected _renderLink() {\n const {\n download,\n href,\n hreflang,\n linkRole,\n ping,\n rel,\n target,\n type,\n _classes: classes,\n _handleClick: handleClick,\n } = this;\n return html`\n <a\n id=\"link\"\n role=\"${ifNonNull(linkRole)}\"\n class=\"${classes}\"\n part=\"link\"\n download=\"${ifNonNull(download)}\"\n href=\"${ifNonNull(href)}\"\n hreflang=\"${ifNonNull(hreflang)}\"\n ping=\"${ifNonNull(ping)}\"\n rel=\"${ifNonNull(rel)}\"\n target=\"${ifNonNull(target)}\"\n type=\"${ifNonNull(type)}\"\n @click=\"${handleClick}\">\n ${this._renderInner()}\n </a>\n `;\n }\n\n /**\n * `true` if the button should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * The default file name.\n */\n @property({ reflect: true })\n download!: string;\n\n /**\n * Link `href`.\n */\n @property({ reflect: true })\n href!: string;\n\n /**\n * The language of what `href` points to.\n */\n @property({ reflect: true })\n hreflang!: string;\n\n /**\n * The a11y role for `<a>`.\n */\n @property({ attribute: 'link-role' })\n linkRole!: string;\n\n /**\n * URLs to ping.\n */\n @property({ reflect: true })\n ping!: string;\n\n /**\n * The link type.\n */\n @property({ reflect: true })\n rel!: string;\n\n /**\n * Link size.\n */\n @property({ reflect: true })\n size = LINK_SIZE.REGULAR;\n\n /**\n * The link target.\n */\n @property({ reflect: true })\n target!: string;\n\n /**\n * MIME type of the `target`.\n */\n @property({ reflect: true })\n type!: string;\n\n createRenderRoot() {\n return this.attachShadow({\n mode: 'open',\n delegatesFocus:\n Number((/Safari\\/(\\d+)/.exec(navigator.userAgent) ?? ['', 0])[1]) <=\n 537,\n });\n }\n\n render() {\n const { disabled } = this;\n return disabled ? this._renderDisabledLink() : this._renderLink();\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXLink;\n"]}