@carbon/web-components 1.33.0 → 1.34.0-rc.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 (356) hide show
  1. package/custom-elements.json +21 -8
  2. package/dist/16-0941dd83.js +65 -0
  3. package/dist/16-28bddc31.js +65 -0
  4. package/dist/{16-61723e38.js → 16-8e34a1fb.js} +1 -1
  5. package/dist/{16-1e54ef69.js → 16-967865d0.js} +1 -1
  6. package/dist/{16-83c13872.js → 16-9e2c1ff1.js} +1 -1
  7. package/dist/16-a2e61b42.js +65 -0
  8. package/dist/{16-604aab02.js → 16-a6a38475.js} +1 -1
  9. package/dist/{16-61622d26.js → 16-a993279d.js} +1 -1
  10. package/dist/{16-897e344d.js → 16-deefa0c3.js} +1 -1
  11. package/dist/{16-481c3b8f.js → 16-efa1f157.js} +1 -1
  12. package/dist/20-68dfa4ba.js +65 -0
  13. package/dist/{16-4e44b70d.js → 20-f2be7924.js} +1 -1
  14. package/dist/accordion.min.js +1 -1
  15. package/dist/accordion.rtl.min.js +1 -1
  16. package/dist/breadcrumb.min.js +1 -1
  17. package/dist/breadcrumb.rtl.min.js +1 -1
  18. package/dist/{button-c71594fa.js → button-4e0b32c8.js} +1 -1
  19. package/dist/{button-e31ba29e.js → button-99f6b809.js} +1 -1
  20. package/dist/button.min.js +1 -1
  21. package/dist/button.rtl.min.js +1 -1
  22. package/dist/{checkbox-724e95de.js → checkbox-33a1eaf8.js} +1 -1
  23. package/dist/checkbox-7352ebd3.js +65 -0
  24. package/dist/checkbox.min.js +1 -1
  25. package/dist/checkbox.rtl.min.js +1 -1
  26. package/dist/{class-map-20d48808.js → class-map-bd61e03f.js} +2 -2
  27. package/dist/code-snippet.min.js +1 -1
  28. package/dist/code-snippet.rtl.min.js +2 -2
  29. package/dist/combo-box.min.js +1 -1
  30. package/dist/combo-box.rtl.min.js +1 -1
  31. package/dist/{content-switcher-item-96395561.js → content-switcher-item-55452b53.js} +1 -1
  32. package/dist/{content-switcher-item-77b690a9.js → content-switcher-item-f853369b.js} +1 -1
  33. package/dist/content-switcher.min.js +1 -1
  34. package/dist/content-switcher.rtl.min.js +1 -1
  35. package/dist/{copy-button-9cb9a0c6.js → copy-button-7a7bbaf8.js} +1 -1
  36. package/dist/{copy-button-50221d0f.js → copy-button-9fb90a01.js} +1 -1
  37. package/dist/copy-button.min.js +1 -1
  38. package/dist/copy-button.rtl.min.js +1 -1
  39. package/dist/data-table.min.js +1 -1
  40. package/dist/data-table.rtl.min.js +1 -1
  41. package/dist/date-picker.min.js +1 -1
  42. package/dist/date-picker.rtl.min.js +1 -1
  43. package/dist/{defineProperty-3aba2ee5.js → defineProperty-93eef18e.js} +1 -1
  44. package/dist/{dropdown-item-ba6ae5c0.js → dropdown-item-2d248e51.js} +1 -1
  45. package/dist/{dropdown-item-53fb6bdf.js → dropdown-item-9c062c1c.js} +1 -1
  46. package/dist/dropdown.min.js +1 -1
  47. package/dist/dropdown.rtl.min.js +1 -1
  48. package/dist/file-uploader.min.js +1 -1
  49. package/dist/file-uploader.rtl.min.js +1 -1
  50. package/dist/{floating-menu-821f738e.js → floating-menu-72acc1bc.js} +1 -1
  51. package/dist/floating-menu.min.js +1 -1
  52. package/dist/floating-menu.rtl.min.js +1 -1
  53. package/dist/{focus-d79d88d5.js → focus-1800056c.js} +1 -1
  54. package/dist/{form-79cb55d3.js → form-80943f8c.js} +1 -1
  55. package/dist/form.min.js +1 -1
  56. package/dist/form.rtl.min.js +1 -1
  57. package/dist/{host-listener-7ba48376.js → host-listener-01e0a787.js} +1 -1
  58. package/dist/{if-defined-e752b789.js → if-defined-dd1fb04b.js} +1 -1
  59. package/dist/{if-non-empty-e64f4f53.js → if-non-empty-f23befc6.js} +2 -2
  60. package/dist/{if-non-null-06324b2b.js → if-non-null-63ecd660.js} +2 -2
  61. package/dist/inline-loading.min.js +1 -1
  62. package/dist/inline-loading.rtl.min.js +1 -1
  63. package/dist/{input-5ec944df.js → input-47bf976e.js} +2 -2
  64. package/dist/{input-ecba9b56.js → input-e5442b90.js} +2 -2
  65. package/dist/input.min.js +1 -1
  66. package/dist/input.rtl.min.js +1 -1
  67. package/dist/{link-3c734b06.js → link-3bb57cfd.js} +1 -1
  68. package/dist/{link-aecb4d2a.js → link-d64eff5e.js} +1 -1
  69. package/dist/link.min.js +1 -1
  70. package/dist/link.rtl.min.js +1 -1
  71. package/dist/list.min.js +1 -1
  72. package/dist/list.rtl.min.js +1 -1
  73. package/dist/{loading-9ce928f0.js → loading-926a29f5.js} +1 -1
  74. package/dist/{loading-c77e0b8d.js → loading-a1c01e84.js} +1 -1
  75. package/dist/{loading-icon-45c89d9a.js → loading-icon-9d1c486a.js} +2 -2
  76. package/dist/loading.min.js +1 -1
  77. package/dist/loading.rtl.min.js +1 -1
  78. package/dist/modal.min.js +1 -1
  79. package/dist/modal.rtl.min.js +1 -1
  80. package/dist/multi-select.min.js +1 -1
  81. package/dist/multi-select.rtl.min.js +1 -1
  82. package/dist/notification.min.js +1 -1
  83. package/dist/notification.rtl.min.js +1 -1
  84. package/dist/number-input.min.js +1 -1
  85. package/dist/number-input.rtl.min.js +1 -1
  86. package/dist/{objectSpread2-65402b05.js → objectSpread2-8dc8a158.js} +1 -1
  87. package/dist/overflow-menu.min.js +1 -1
  88. package/dist/overflow-menu.rtl.min.js +1 -1
  89. package/dist/pagination.min.js +1 -1
  90. package/dist/pagination.rtl.min.js +1 -1
  91. package/dist/progress-indicator.min.js +1 -1
  92. package/dist/progress-indicator.rtl.min.js +1 -1
  93. package/dist/radio-button.min.js +1 -1
  94. package/dist/radio-button.rtl.min.js +1 -1
  95. package/dist/{radio-group-manager-eb1598f5.js → radio-group-manager-e095bcbf.js} +1 -1
  96. package/dist/{search-1a7ba563.js → search-87761b5e.js} +1 -1
  97. package/dist/{search-ce08ae42.js → search-f2955dfc.js} +1 -1
  98. package/dist/search.min.js +1 -1
  99. package/dist/search.rtl.min.js +1 -1
  100. package/dist/select.min.js +1 -1
  101. package/dist/select.rtl.min.js +1 -1
  102. package/dist/skeleton-placeholder.min.js +1 -1
  103. package/dist/skeleton-placeholder.rtl.min.js +1 -1
  104. package/dist/skeleton-text.min.js +1 -1
  105. package/dist/skeleton-text.rtl.min.js +1 -1
  106. package/dist/skip-to-content.min.js +1 -1
  107. package/dist/skip-to-content.rtl.min.js +1 -1
  108. package/dist/slider.min.js +1 -1
  109. package/dist/slider.rtl.min.js +1 -1
  110. package/dist/{spread-dc4ee429.js → spread-989d7408.js} +1 -1
  111. package/dist/structured-list.min.js +1 -1
  112. package/dist/structured-list.rtl.min.js +1 -1
  113. package/dist/tabs.min.js +2 -2
  114. package/dist/tabs.rtl.min.js +2 -2
  115. package/dist/tag.min.js +1 -1
  116. package/dist/tag.rtl.min.js +1 -1
  117. package/dist/textarea.min.js +1 -1
  118. package/dist/textarea.rtl.min.js +1 -1
  119. package/dist/tile.min.js +1 -1
  120. package/dist/tile.rtl.min.js +1 -1
  121. package/dist/toggle.min.js +2 -2
  122. package/dist/toggle.rtl.min.js +1 -1
  123. package/dist/tooltip.min.js +1 -1
  124. package/dist/tooltip.rtl.min.js +1 -1
  125. package/dist/ui-shell.min.js +2 -2
  126. package/dist/ui-shell.rtl.min.js +2 -2
  127. package/es/components/data-table/table-toolbar-search.js +1 -1
  128. package/es/components/data-table/table-toolbar-search.js.map +1 -1
  129. package/es/components/file-uploader/drop-container.js +1 -1
  130. package/es/components/file-uploader/drop-container.js.map +1 -1
  131. package/es/components/input/input.d.ts +4 -5
  132. package/es/components/input/input.d.ts.map +1 -1
  133. package/es/components/input/input.js +16 -35
  134. package/es/components/input/input.js.map +1 -1
  135. package/es/components/overflow-menu/overflow-menu-body.js +1 -1
  136. package/es/components/overflow-menu/overflow-menu-body.js.map +1 -1
  137. package/es/components/overflow-menu/overflow-menu.js +1 -1
  138. package/es/components/overflow-menu/overflow-menu.js.map +1 -1
  139. package/es/components/pagination/page-sizes-select.js +1 -1
  140. package/es/components/pagination/page-sizes-select.js.map +1 -1
  141. package/es/components/slider/slider.js +1 -1
  142. package/es/components/slider/slider.js.map +1 -1
  143. package/es/components/structured-list/structured-list-row.js +1 -1
  144. package/es/components/structured-list/structured-list-row.js.map +1 -1
  145. package/es/components/tabs/tab.d.ts +8 -0
  146. package/es/components/tabs/tab.d.ts.map +1 -1
  147. package/es/components/tabs/tab.js +28 -4
  148. package/es/components/tabs/tab.js.map +1 -1
  149. package/es/components/tooltip/tooltip.js +2 -2
  150. package/es/components/tooltip/tooltip.js.map +1 -1
  151. package/es/components/ui-shell/side-nav-link.js +1 -1
  152. package/es/components/ui-shell/side-nav-link.js.map +1 -1
  153. package/es/components/ui-shell/side-nav-menu-item.d.ts +1 -0
  154. package/es/components/ui-shell/side-nav-menu-item.d.ts.map +1 -1
  155. package/es/components/ui-shell/side-nav-menu-item.js +11 -0
  156. package/es/components/ui-shell/side-nav-menu-item.js.map +1 -1
  157. package/es/components/ui-shell/side-nav-menu.js +1 -1
  158. package/es/components/ui-shell/side-nav-menu.js.map +1 -1
  159. package/es/components/ui-shell/side-nav.js +1 -1
  160. package/es/components/ui-shell/side-nav.js.map +1 -1
  161. package/es/components-react/input/input.d.ts +4 -4
  162. package/es/components-react/input/input.js +2 -2
  163. package/es/components-react/tabs/tab.d.ts +4 -0
  164. package/es/components-react/tabs/tab.js +2 -0
  165. package/es/globals/wrappers/createReactCustomElementType.js +2 -1
  166. package/es/globals/wrappers/createReactCustomElementType.js.map +1 -1
  167. package/lib/components/accordion/defs.js +2 -4
  168. package/lib/components/accordion/defs.js.map +1 -1
  169. package/lib/components/button/defs.js +3 -6
  170. package/lib/components/button/defs.js.map +1 -1
  171. package/lib/components/code-snippet/defs.js +1 -2
  172. package/lib/components/code-snippet/defs.js.map +1 -1
  173. package/lib/components/content-switcher/defs.js +2 -4
  174. package/lib/components/content-switcher/defs.js.map +1 -1
  175. package/lib/components/data-table/defs.js +5 -10
  176. package/lib/components/data-table/defs.js.map +1 -1
  177. package/lib/components/date-picker/defs.js +2 -4
  178. package/lib/components/date-picker/defs.js.map +1 -1
  179. package/lib/components/dropdown/defs.js +4 -8
  180. package/lib/components/dropdown/defs.js.map +1 -1
  181. package/lib/components/file-uploader/defs.js +2 -4
  182. package/lib/components/file-uploader/defs.js.map +1 -1
  183. package/lib/components/floating-menu/defs.js +4 -8
  184. package/lib/components/floating-menu/defs.js.map +1 -1
  185. package/lib/components/inline-loading/defs.js +1 -2
  186. package/lib/components/inline-loading/defs.js.map +1 -1
  187. package/lib/components/input/defs.js +2 -4
  188. package/lib/components/input/defs.js.map +1 -1
  189. package/lib/components/loading/defs.js +1 -2
  190. package/lib/components/loading/defs.js.map +1 -1
  191. package/lib/components/modal/defs.js +1 -2
  192. package/lib/components/modal/defs.js.map +1 -1
  193. package/lib/components/notification/defs.js +2 -4
  194. package/lib/components/notification/defs.js.map +1 -1
  195. package/lib/components/number-input/defs.js +1 -2
  196. package/lib/components/number-input/defs.js.map +1 -1
  197. package/lib/components/overflow-menu/defs.js +2 -4
  198. package/lib/components/overflow-menu/defs.js.map +1 -1
  199. package/lib/components/progress-indicator/defs.js +1 -2
  200. package/lib/components/progress-indicator/defs.js.map +1 -1
  201. package/lib/components/radio-button/defs.js +2 -4
  202. package/lib/components/radio-button/defs.js.map +1 -1
  203. package/lib/components/skeleton-text/defs.js +1 -2
  204. package/lib/components/skeleton-text/defs.js.map +1 -1
  205. package/lib/components/tabs/defs.js +3 -6
  206. package/lib/components/tabs/defs.js.map +1 -1
  207. package/lib/components/tag/defs.js +2 -4
  208. package/lib/components/tag/defs.js.map +1 -1
  209. package/lib/components/toggle/defs.js +1 -2
  210. package/lib/components/toggle/defs.js.map +1 -1
  211. package/lib/components/tooltip/defs.js +2 -4
  212. package/lib/components/tooltip/defs.js.map +1 -1
  213. package/lib/components/ui-shell/defs.js +2 -4
  214. package/lib/components/ui-shell/defs.js.map +1 -1
  215. package/lib/components-react-node/accordion/accordion-item.js +25 -45
  216. package/lib/components-react-node/accordion/accordion.js +5 -8
  217. package/lib/components-react-node/breadcrumb/breadcrumb-item.js +3 -6
  218. package/lib/components-react-node/breadcrumb/breadcrumb-link.js +3 -6
  219. package/lib/components-react-node/breadcrumb/breadcrumb-overflow-menu.js +11 -6
  220. package/lib/components-react-node/breadcrumb/breadcrumb.js +3 -6
  221. package/lib/components-react-node/button/button-skeleton.js +7 -6
  222. package/lib/components-react-node/button/button.js +25 -45
  223. package/lib/components-react-node/checkbox/checkbox.js +25 -45
  224. package/lib/components-react-node/code-snippet/code-snippet-skeleton.js +5 -8
  225. package/lib/components-react-node/code-snippet/code-snippet.js +25 -45
  226. package/lib/components-react-node/combo-box/combo-box-item.js +11 -6
  227. package/lib/components-react-node/combo-box/combo-box.js +5 -8
  228. package/lib/components-react-node/content-switcher/content-switcher-item.js +25 -45
  229. package/lib/components-react-node/content-switcher/content-switcher.js +5 -8
  230. package/lib/components-react-node/copy-button/copy-button.js +25 -45
  231. package/lib/components-react-node/data-table/table-batch-actions.js +25 -45
  232. package/lib/components-react-node/data-table/table-body.js +5 -8
  233. package/lib/components-react-node/data-table/table-cell-skeleton.js +11 -6
  234. package/lib/components-react-node/data-table/table-cell.js +3 -6
  235. package/lib/components-react-node/data-table/table-expand-row.js +25 -45
  236. package/lib/components-react-node/data-table/table-expanded-row.js +25 -45
  237. package/lib/components-react-node/data-table/table-head.js +3 -6
  238. package/lib/components-react-node/data-table/table-header-cell-skeleton.js +11 -6
  239. package/lib/components-react-node/data-table/table-header-cell.js +25 -45
  240. package/lib/components-react-node/data-table/table-header-expand-row.js +25 -20
  241. package/lib/components-react-node/data-table/table-header-row.js +5 -8
  242. package/lib/components-react-node/data-table/table-row.js +25 -45
  243. package/lib/components-react-node/data-table/table-toolbar-content.js +25 -45
  244. package/lib/components-react-node/data-table/table-toolbar-search.js +25 -45
  245. package/lib/components-react-node/data-table/table-toolbar.js +3 -6
  246. package/lib/components-react-node/data-table/table.js +25 -45
  247. package/lib/components-react-node/date-picker/date-picker-input-skeleton.js +5 -8
  248. package/lib/components-react-node/date-picker/date-picker-input.js +25 -45
  249. package/lib/components-react-node/date-picker/date-picker.js +25 -45
  250. package/lib/components-react-node/dropdown/dropdown-item.js +25 -45
  251. package/lib/components-react-node/dropdown/dropdown-skeleton.js +3 -6
  252. package/lib/components-react-node/dropdown/dropdown.js +25 -45
  253. package/lib/components-react-node/file-uploader/drop-container.js +25 -45
  254. package/lib/components-react-node/file-uploader/file-uploader-item.js +25 -45
  255. package/lib/components-react-node/file-uploader/file-uploader.js +5 -8
  256. package/lib/components-react-node/floating-menu/floating-menu.js +2 -4
  257. package/lib/components-react-node/form/form-item.js +3 -6
  258. package/lib/components-react-node/inline-loading/inline-loading.js +5 -8
  259. package/lib/components-react-node/input/input.js +27 -47
  260. package/lib/components-react-node/link/link.js +25 -45
  261. package/lib/components-react-node/list/list-item.js +25 -45
  262. package/lib/components-react-node/list/ordered-list.js +11 -6
  263. package/lib/components-react-node/list/unordered-list.js +25 -45
  264. package/lib/components-react-node/loading/loading.js +25 -45
  265. package/lib/components-react-node/modal/modal-body.js +3 -6
  266. package/lib/components-react-node/modal/modal-close-button.js +5 -8
  267. package/lib/components-react-node/modal/modal-footer-button.js +7 -6
  268. package/lib/components-react-node/modal/modal-footer.js +3 -6
  269. package/lib/components-react-node/modal/modal-header.js +3 -6
  270. package/lib/components-react-node/modal/modal-heading.js +3 -6
  271. package/lib/components-react-node/modal/modal-label.js +3 -6
  272. package/lib/components-react-node/modal/modal.js +25 -45
  273. package/lib/components-react-node/multi-select/multi-select-item.js +41 -53
  274. package/lib/components-react-node/multi-select/multi-select.js +25 -45
  275. package/lib/components-react-node/notification/inline-notification.js +25 -45
  276. package/lib/components-react-node/notification/toast-notification.js +15 -10
  277. package/lib/components-react-node/number-input/number-input-skeleton.js +25 -45
  278. package/lib/components-react-node/number-input/number-input.js +25 -45
  279. package/lib/components-react-node/overflow-menu/overflow-menu-body.js +45 -57
  280. package/lib/components-react-node/overflow-menu/overflow-menu-item.js +25 -45
  281. package/lib/components-react-node/overflow-menu/overflow-menu.js +25 -45
  282. package/lib/components-react-node/pagination/page-sizes-select.js +25 -45
  283. package/lib/components-react-node/pagination/pages-select.js +25 -45
  284. package/lib/components-react-node/pagination/pagination.js +25 -45
  285. package/lib/components-react-node/progress-indicator/progress-indicator-skeleton.js +25 -45
  286. package/lib/components-react-node/progress-indicator/progress-indicator.js +25 -45
  287. package/lib/components-react-node/progress-indicator/progress-step-skeleton.js +25 -45
  288. package/lib/components-react-node/progress-indicator/progress-step.js +25 -45
  289. package/lib/components-react-node/radio-button/radio-button-group.js +25 -45
  290. package/lib/components-react-node/radio-button/radio-button-skeleton.js +3 -6
  291. package/lib/components-react-node/radio-button/radio-button.js +25 -45
  292. package/lib/components-react-node/search/search-skeleton.js +5 -8
  293. package/lib/components-react-node/search/search.js +25 -45
  294. package/lib/components-react-node/select/select-item-group.js +25 -45
  295. package/lib/components-react-node/select/select-item.js +25 -45
  296. package/lib/components-react-node/select/select.js +25 -45
  297. package/lib/components-react-node/skeleton-placeholder/skeleton-placeholder.js +3 -6
  298. package/lib/components-react-node/skeleton-text/skeleton-text.js +5 -8
  299. package/lib/components-react-node/skip-to-content/skip-to-content.js +5 -8
  300. package/lib/components-react-node/slider/slider-input.js +25 -45
  301. package/lib/components-react-node/slider/slider-skeleton.js +3 -6
  302. package/lib/components-react-node/slider/slider.js +25 -45
  303. package/lib/components-react-node/structured-list/structured-list-body.js +3 -6
  304. package/lib/components-react-node/structured-list/structured-list-cell.js +3 -6
  305. package/lib/components-react-node/structured-list/structured-list-head.js +3 -6
  306. package/lib/components-react-node/structured-list/structured-list-header-cell-skeleton.js +3 -6
  307. package/lib/components-react-node/structured-list/structured-list-header-cell.js +3 -6
  308. package/lib/components-react-node/structured-list/structured-list-header-row.js +5 -8
  309. package/lib/components-react-node/structured-list/structured-list-row.js +25 -45
  310. package/lib/components-react-node/structured-list/structured-list.js +5 -8
  311. package/lib/components-react-node/tabs/tab-skeleton.js +3 -6
  312. package/lib/components-react-node/tabs/tab.js +41 -51
  313. package/lib/components-react-node/tabs/tabs-skeleton.js +3 -6
  314. package/lib/components-react-node/tabs/tabs.js +39 -34
  315. package/lib/components-react-node/tag/filter-tag.js +25 -45
  316. package/lib/components-react-node/tag/tag.js +25 -45
  317. package/lib/components-react-node/textarea/textarea-skeleton.js +3 -6
  318. package/lib/components-react-node/textarea/textarea.js +25 -45
  319. package/lib/components-react-node/tile/clickable-tile.js +5 -8
  320. package/lib/components-react-node/tile/expandable-tile.js +25 -45
  321. package/lib/components-react-node/tile/radio-tile.js +11 -6
  322. package/lib/components-react-node/tile/selectable-tile.js +25 -45
  323. package/lib/components-react-node/tile/tile-group.js +3 -6
  324. package/lib/components-react-node/tile/tile.js +5 -8
  325. package/lib/components-react-node/toggle/toggle.js +5 -8
  326. package/lib/components-react-node/tooltip/tooltip-body.js +41 -53
  327. package/lib/components-react-node/tooltip/tooltip-definition.js +5 -8
  328. package/lib/components-react-node/tooltip/tooltip-footer.js +3 -6
  329. package/lib/components-react-node/tooltip/tooltip-icon.js +11 -6
  330. package/lib/components-react-node/tooltip/tooltip.js +25 -45
  331. package/lib/components-react-node/ui-shell/header-menu-button.js +25 -45
  332. package/lib/components-react-node/ui-shell/header-menu-item.js +11 -6
  333. package/lib/components-react-node/ui-shell/header-menu.js +25 -45
  334. package/lib/components-react-node/ui-shell/header-name.js +5 -8
  335. package/lib/components-react-node/ui-shell/header-nav-item.js +5 -8
  336. package/lib/components-react-node/ui-shell/header-nav.js +5 -8
  337. package/lib/components-react-node/ui-shell/header.js +3 -6
  338. package/lib/components-react-node/ui-shell/side-nav-divider.js +3 -6
  339. package/lib/components-react-node/ui-shell/side-nav-items.js +3 -6
  340. package/lib/components-react-node/ui-shell/side-nav-link.js +25 -45
  341. package/lib/components-react-node/ui-shell/side-nav-menu-item.js +25 -45
  342. package/lib/components-react-node/ui-shell/side-nav-menu.js +25 -45
  343. package/lib/components-react-node/ui-shell/side-nav.js +25 -45
  344. package/lib/globals/settings.js +1 -2
  345. package/lib/globals/settings.js.map +1 -1
  346. package/lib/globals/shared-enums.js +1 -2
  347. package/lib/globals/shared-enums.js.map +1 -1
  348. package/lib/globals/wrappers/createReactCustomElementType.js +3 -4
  349. package/lib/globals/wrappers/createReactCustomElementType.js.map +1 -1
  350. package/package.json +8 -8
  351. package/dist/16-b206f640.js +0 -65
  352. package/dist/16-ce95fee1.js +0 -65
  353. package/dist/20-434c5bc4.js +0 -65
  354. package/dist/20-99b4c026.js +0 -65
  355. package/dist/checkbox-a3f539a3.js +0 -65
  356. /package/dist/{settings-f1ddfc10.js → settings-898bd7b0.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"table-toolbar-search.js","names":["classMap","html","property","query","settings","HostListenerMixin","HostListener","INPUT_SIZE","BXSearch","styles","carbonElement","customElement","prefix","BXTableToolbarSearch","_decorate","_initialize","_HostListenerMixin","constructor","args","F","d","kind","decorators","key","value","_handleUserInitiatedExpand","expanded","updateComplete","_inputNode","inputNode","focus","_handleFocusIn","_handleFocusOut","event","contains","relatedTarget","_handleSearchClick","type","Boolean","reflect","SMALL","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","Number","exec","navigator","userAgent","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","render","result","size","handleSearchClick","classes","_t","_","static","eventInput"],"sources":["components/data-table/table-toolbar-search.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, query } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport HostListener from '../../globals/decorators/host-listener';\nimport { INPUT_SIZE } from '../input/input';\nimport BXSearch from '../search/search';\nimport styles from './data-table.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nconst { prefix } = settings;\n\n/**\n * Table toolbar search.\n *\n * @element bx-table-toolbar-search\n * @fires bx-search-input - The custom event fired after the search content is changed upon a user gesture.\n */\n@customElement(`${prefix}-table-toolbar-search`)\nclass BXTableToolbarSearch extends HostListenerMixin(BXSearch) {\n @query('input')\n private _inputNode!: HTMLInputElement;\n\n /**\n * Handles user-initiated gestures for expanding the search box.\n */\n private async _handleUserInitiatedExpand() {\n this.expanded = true;\n await this.updateComplete;\n const { _inputNode: inputNode } = this;\n inputNode?.focus();\n }\n\n /**\n * Handles `focus` event handler on this element.\n */\n @HostListener('focusin')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleFocusIn() {\n this._handleUserInitiatedExpand();\n }\n\n /**\n * Handles `blur` event handler on this element.\n *\n * @param event The event.\n */\n @HostListener('focusout')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleFocusOut(event: FocusEvent) {\n if (!this.contains(event.relatedTarget as Node) && !this.value) {\n this.expanded = false;\n }\n }\n\n /**\n * Handles `click` event handler on the search box.\n */\n private _handleSearchClick() {\n this._handleUserInitiatedExpand();\n }\n\n /**\n * `true` if the search box should be expanded.\n */\n @property({ type: Boolean, reflect: true })\n expanded = false;\n\n /**\n * The search box size.\n */\n @property({ reflect: true })\n size = INPUT_SIZE.SMALL;\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 connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'search');\n }\n super.connectedCallback();\n }\n\n render() {\n const result = super.render();\n const { expanded, size, _handleSearchClick: handleSearchClick } = this;\n const classes = classMap({\n [`${prefix}--search`]: true,\n [`${prefix}--search--${size}`]: size,\n });\n return html`\n <div\n class=\"${classes}\"\n tabindex=\"${expanded ? '-1' : '0'}\"\n @click=\"${handleSearchClick}\">\n ${result}\n </div>\n `;\n }\n\n /**\n * The name of the custom event fired after the search content is changed upon a user gesture.\n */\n static get eventInput() {\n // The code uses on in `<bx-search>`, but definition is done also here for React event generation\n return `${prefix}-search-input`;\n }\n\n static styles = styles;\n}\n\nexport default BXTableToolbarSearch;\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,+BAA+B;AACxD,SAASC,IAAI,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,aAAa;AACnD,OAAOC,QAAQ,MAAM,0CAA0C;AAC/D,OAAOC,iBAAiB,MAAM,oCAAoC;AAClE,OAAOC,YAAY,MAAM,wCAAwC;AACjE,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,OAAOC,QAAQ,MAAM,kBAAkB;AACvC,OAAOC,MAAM,MAAM,uBAAmB;AACtC,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AAExF,MAAM;EAAEC;AAAO,CAAC,GAAGR,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AALA,IAOMS,oBAAoB,GAAAC,SAAA,EADzBH,aAAa,CAAE,GAAEC,MAAO,uBAAsB,CAAC,aAAAG,WAAA,EAAAC,kBAAA;EAAhD,MACMH,oBAAoB,SAAAG,kBAAA,CAAqC;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EAiG/D;EAAC;IAAAI,CAAA,EAjGKN,oBAAoB;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GACvBnB,KAAK,CAAC,OAAO,CAAC;MAAAoB,GAAA;MAAAC,KAAA;IAAA;MAAAH,IAAA;MAAAE,GAAA;MAAAC,KAAA;MAGf;AACF;AACA;MACE,eAAAC,2BAAA,EAA2C;QACzC,IAAI,CAACC,QAAQ,GAAG,IAAI;QACpB,MAAM,IAAI,CAACC,cAAc;QACzB,MAAM;UAAEC,UAAU,EAAEC;QAAU,CAAC,GAAG,IAAI;QACtCA,SAAS,aAATA,SAAS,uBAATA,SAAS,CAAEC,KAAK,CAAC,CAAC;MACpB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GAhGWJ,iBAAiB,CAACG,QAAQ,CAAC;AAmG9D,eAAeK,oBAAoB"}
1
+ {"version":3,"file":"table-toolbar-search.js","names":["classMap","html","property","query","settings","HostListenerMixin","HostListener","INPUT_SIZE","BXSearch","styles","carbonElement","customElement","prefix","BXTableToolbarSearch","_decorate","_initialize","_HostListenerMixin","constructor","args","F","d","kind","decorators","key","value","_handleUserInitiatedExpand","expanded","updateComplete","_inputNode","inputNode","focus","_handleFocusIn","_handleFocusOut","event","contains","relatedTarget","_handleSearchClick","type","Boolean","reflect","SMALL","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","Number","exec","navigator","userAgent","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","render","result","size","handleSearchClick","classes","_t","_","static","eventInput"],"sources":["components/data-table/table-toolbar-search.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, query } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport HostListener from '../../globals/decorators/host-listener';\nimport { INPUT_SIZE } from '../input/input';\nimport BXSearch from '../search/search';\nimport styles from './data-table.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nconst { prefix } = settings;\n\n/**\n * Table toolbar search.\n *\n * @element bx-table-toolbar-search\n * @fires bx-search-input - The custom event fired after the search content is changed upon a user gesture.\n */\n@customElement(`${prefix}-table-toolbar-search`)\nclass BXTableToolbarSearch extends HostListenerMixin(BXSearch) {\n @query('input')\n private _inputNode!: HTMLInputElement;\n\n /**\n * Handles user-initiated gestures for expanding the search box.\n */\n private async _handleUserInitiatedExpand() {\n this.expanded = true;\n await this.updateComplete;\n const { _inputNode: inputNode } = this;\n inputNode?.focus();\n }\n\n /**\n * Handles `focus` event handler on this element.\n */\n @HostListener('focusin')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleFocusIn() {\n this._handleUserInitiatedExpand();\n }\n\n /**\n * Handles `blur` event handler on this element.\n *\n * @param event The event.\n */\n @HostListener('focusout')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleFocusOut(event: FocusEvent) {\n if (!this.contains(event.relatedTarget as Node) && !this.value) {\n this.expanded = false;\n }\n }\n\n /**\n * Handles `click` event handler on the search box.\n */\n private _handleSearchClick() {\n this._handleUserInitiatedExpand();\n }\n\n /**\n * `true` if the search box should be expanded.\n */\n @property({ type: Boolean, reflect: true })\n expanded = false;\n\n /**\n * The search box size.\n */\n @property({ reflect: true })\n size = INPUT_SIZE.SMALL;\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 connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'search');\n }\n super.connectedCallback();\n }\n\n render() {\n const result = super.render();\n const { expanded, size, _handleSearchClick: handleSearchClick } = this;\n const classes = classMap({\n [`${prefix}--search`]: true,\n [`${prefix}--search--${size}`]: size,\n });\n return html`\n <div\n class=\"${classes}\"\n tabindex=\"${expanded ? '-1' : '0'}\"\n @click=\"${handleSearchClick}\">\n ${result}\n </div>\n `;\n }\n\n /**\n * The name of the custom event fired after the search content is changed upon a user gesture.\n */\n static get eventInput() {\n // The code uses on in `<bx-search>`, but definition is done also here for React event generation\n return `${prefix}-search-input`;\n }\n\n static styles = styles;\n}\n\nexport default BXTableToolbarSearch;\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,+BAA+B;AACxD,SAASC,IAAI,EAAEC,QAAQ,EAAEC,KAAK,QAAQ,aAAa;AACnD,OAAOC,QAAQ,MAAM,0CAA0C;AAC/D,OAAOC,iBAA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QAAQ,CAAC;QACrC;QACAC,IAAA,CAAAC,eAAA,CApEEzC,oBAAoB,CAAA0C,SAAA,8BAAAC,IAAA;MAqExB;IAAC;MAAAnC,IAAA;MAAAE,GAAA;MAAAC,KAAA,EAED,SAAAiC,OAAA,EAAS;QACP,MAAMC,MAAM,GAAAL,IAAA,CAAAC,eAAA,CAxEVzC,oBAAoB,CAAA0C,SAAA,mBAAAC,IAAA,MAwEO;QAC7B,MAAM;UAAE9B,QAAQ;UAAEiC,IAAI;UAAEvB,kBAAkB,EAAEwB;QAAkB,CAAC,GAAG,IAAI;QACtE,MAAMC,OAAO,GAAG7D,QAAQ,CAAC;UACvB,CAAE,GAAEY,MAAO,UAAS,GAAG,IAAI;UAC3B,CAAE,GAAEA,MAAO,aAAY+C,IAAK,EAAC,GAAGA;QAClC,CAAC,CAAC;QACF,OAAO1D,IAAI,CAAA6D,EAAA,KAAAA,EAAA,GAAAC,CAAA,mEAEEF,OAAO,EACJnC,QAAQ,GAAG,IAAI,GAAG,GAAG,EACvBkC,iBAAiB,EACzBF,MAAM;MAGd;;MAEA;AACF;AACA;IAFE;MAAArC,IAAA;MAAA2C,MAAA;MAAAzC,GAAA;MAAAC,KAAA,EAGA,SAAAyC,WAAA,EAAwB;QACtB;QACA,OAAQ,GAAErD,MAAO,eAAc;MACjC;IAAC;MAAAS,IAAA;MAAA2C,MAAA;MAAAzC,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GAhGWJ,iBAAiB,CAACG,QAAQ,CAAC;AAmG9D,eAAeK,oBAAoB"}
@@ -79,7 +79,7 @@ let BXFileDropContainer = _decorate([customElement(`${prefix}-file-drop-containe
79
79
  addedFiles
80
80
  }
81
81
  }));
82
- const fileInput = this === null || this === void 0 ? void 0 : (_this$shadowRoot = this.shadowRoot) === null || _this$shadowRoot === void 0 ? void 0 : _this$shadowRoot.querySelector(selectorInput);
82
+ const fileInput = this === null || this === void 0 || (_this$shadowRoot = this.shadowRoot) === null || _this$shadowRoot === void 0 ? void 0 : _this$shadowRoot.querySelector(selectorInput);
83
83
  if (fileInput) {
84
84
  fileInput.value = ''; // carbon-web-components#904
85
85
  }
@@ -1 +1 @@
1
- {"version":3,"file":"drop-container.js","names":["classMap","html","property","LitElement","settings","HostListenerMixin","HostListener","ifNonEmpty","styles","carbonElement","customElement","FORM_ELEMENT_COLOR_SCHEME","TILE_COLOR_SCHEME","prefix","dropEffects","dragover","dragleave","BXFileDropContainer","_decorate","_initialize","_HostListenerMixin","constructor","args","F","d","kind","key","value","_handleChange","event","_this$shadowRoot","addedFiles","_getFiles","eventChange","selectorInput","dispatchEvent","CustomEvent","bubbles","composed","detail","fileInput","shadowRoot","querySelector","decorators","_handleDrag","preventDefault","disabled","dataTransfer","type","dropEffect","_active","requestUpdate","_ref","files","target","accept","test","Array","from","acceptedTypes","Set","split","prototype","filter","call","name","mimeType","_fileExtensionRegExp$","fileExtensionRegExp","hasFileExtension","fileExtension","undefined","exec","has","Boolean","reflect","render","multiple","active","handleChange","labelClasses","dropareaClasses","_t","_","static"],"sources":["components/file-uploader/drop-container.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 { classMap } from 'lit-html/directives/class-map';\nimport { html, property, LitElement } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport HostListener from '../../globals/decorators/host-listener';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport styles from './file-uploader.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { FORM_ELEMENT_COLOR_SCHEME as TILE_COLOR_SCHEME } from '../../globals/shared-enums';\n\nconst { prefix } = settings;\n\n/**\n * The value to set to `event.dataTransfer.dropEffect`, keyed by the event nane.\n */\nconst dropEffects = {\n dragover: 'copy',\n dragleave: 'move',\n};\n\n/**\n * File drop container.\n *\n * @element bx-file-drop-container\n * @fires bx-file-drop-container-changed The custom event fired when there is a user gesture to select files to upload.\n */\n@customElement(`${prefix}-file-drop-container`)\nclass BXFileDropContainer extends HostListenerMixin(LitElement) {\n /**\n * `true` to show the active state of this UI.\n */\n private _active = false;\n\n /**\n * Handles user gesture to select files to upload.\n *\n * @param event The event.\n */\n private _handleChange(event: Event | DragEvent) {\n const addedFiles = this._getFiles(event);\n const { eventChange, selectorInput } = this\n .constructor as typeof BXFileDropContainer;\n this.dispatchEvent(\n new CustomEvent(eventChange, {\n bubbles: true,\n composed: true,\n detail: {\n addedFiles,\n },\n })\n );\n\n const fileInput = this?.shadowRoot?.querySelector(selectorInput);\n if (fileInput) {\n (fileInput as HTMLInputElement).value = ''; // carbon-web-components#904\n }\n }\n\n /**\n * Handles `dragover`, `dragleave` and `drop` events.\n *\n * @param event The event.\n */\n @HostListener('dragover')\n @HostListener('dragleave')\n @HostListener('drop')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleDrag(event: DragEvent) {\n event.preventDefault(); // Prevents page navigation upon dropping\n if (this.disabled) {\n return;\n }\n const { dataTransfer, type } = event;\n const dropEffect = dropEffects[type];\n if (dataTransfer && dropEffect) {\n dataTransfer.dropEffect = dropEffect;\n }\n this._active = type === 'dragover';\n if (type === 'drop') {\n this._handleChange(event);\n }\n this.requestUpdate();\n }\n\n /**\n * @param event The event.\n * @returns The list of files user chose to upload.\n */\n private _getFiles(event: Event | DragEvent) {\n const { files } =\n (event.type === 'drop'\n ? (event as DragEvent).dataTransfer\n : (event.target as HTMLInputElement)) ?? {};\n const { accept } = this;\n if (!accept || !/^(change|drop)$/.test(event.type)) {\n return Array.from(files ?? []);\n }\n const acceptedTypes = new Set(accept.split(' '));\n return Array.prototype.filter.call(\n files,\n ({ name, type: mimeType = '' }) => {\n const fileExtensionRegExp = /\\.[^.]+$/;\n const hasFileExtension = fileExtensionRegExp.test(name);\n const [fileExtension] = !hasFileExtension\n ? [undefined]\n : fileExtensionRegExp.exec(name) ?? [];\n return (\n acceptedTypes.has(mimeType) ||\n (fileExtension && acceptedTypes.has(fileExtension))\n );\n }\n ) as File[];\n }\n\n /**\n * The file types the file input should accept, separated by space.\n */\n @property()\n accept = '';\n\n /**\n * `true` if this drop container should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * `true` if this drop container should accept more than one files at once.\n * Note that even with `false` set here, user _can_ select multiple files one by one.\n */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /**\n * The shadow DOM slot to put this drop container in.\n */\n @property({ reflect: true })\n slot = 'drop-container';\n\n render() {\n const {\n accept,\n disabled,\n multiple,\n _active: active,\n _handleChange: handleChange,\n } = this;\n const labelClasses = classMap({\n [`${prefix}--file-browse-btn`]: true,\n [`${prefix}--file-browse-btn--disabled`]: disabled,\n });\n const dropareaClasses = classMap({\n [`${prefix}--file__drop-container`]: true,\n [`${prefix}--file__drop-container--drag-over`]: active,\n });\n return html`\n <label class=\"${labelClasses}\" for=\"file\" tabindex=\"0\">\n <div class=\"${dropareaClasses}\" role=\"button\">\n <slot></slot>\n <input\n id=\"file\"\n type=\"file\"\n class=\"${prefix}--file-input\"\n tabindex=\"-1\"\n accept=\"${ifNonEmpty(accept)}\"\n ?disabled=\"${disabled}\"\n ?multiple=\"${multiple}\"\n @change=\"${handleChange}\" />\n </div>\n </label>\n `;\n }\n\n /**\n * The name of the custom event fired when there is a user gesture to select files to upload.\n */\n static get eventChange() {\n return `${prefix}-file-drop-container-changed`;\n }\n\n /**\n * A selector that will return the file `<input>`.\n */\n static get selectorInput() {\n return `.${prefix}--file-input`;\n }\n\n static styles = styles;\n}\n\nexport default BXFileDropContainer;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,+BAA+B;AACxD,SAASC,IAAI,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,aAAa;AACxD,OAAOC,QA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AO,cAAA,EAA2B;QACzB,OAAQ,IAAGrB,MAAO,cAAa;MACjC;IAAC;MAAAY,IAAA;MAAA2D,MAAA;MAAA1D,GAAA;MAAAC,MAAA;QAAA,OAEenB,MAAM;MAAA;IAAA;EAAA;AAAA,GAhKUH,iBAAiB,CAACF,UAAU,CAAC;AAmK/D,eAAec,mBAAmB"}
1
+ {"version":3,"file":"drop-container.js","names":["classMap","html","property","LitElement","settings","HostListenerMixin","HostListener","ifNonEmpty","styles","carbonElement","customElement","FORM_ELEMENT_COLOR_SCHEME","TILE_COLOR_SCHEME","prefix","dropEffects","dragover","dragleave","BXFileDropContainer","_decorate","_initialize","_HostListenerMixin","constructor","args","F","d","kind","key","value","_handleChange","event","_this$shadowRoot","addedFiles","_getFiles","eventChange","selectorInput","dispatchEvent","CustomEvent","bubbles","composed","detail","fileInput","shadowRoot","querySelector","decorators","_handleDrag","preventDefault","disabled","dataTransfer","type","dropEffect","_active","requestUpdate","_ref","files","target","accept","test","Array","from","acceptedTypes","Set","split","prototype","filter","call","name","mimeType","_fileExtensionRegExp$","fileExtensionRegExp","hasFileExtension","fileExtension","undefined","exec","has","Boolean","reflect","render","multiple","active","handleChange","labelClasses","dropareaClasses","_t","_","static"],"sources":["components/file-uploader/drop-container.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 { classMap } from 'lit-html/directives/class-map';\nimport { html, property, LitElement } from 'lit-element';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport HostListener from '../../globals/decorators/host-listener';\nimport ifNonEmpty from '../../globals/directives/if-non-empty';\nimport styles from './file-uploader.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { FORM_ELEMENT_COLOR_SCHEME as TILE_COLOR_SCHEME } from '../../globals/shared-enums';\n\nconst { prefix } = settings;\n\n/**\n * The value to set to `event.dataTransfer.dropEffect`, keyed by the event nane.\n */\nconst dropEffects = {\n dragover: 'copy',\n dragleave: 'move',\n};\n\n/**\n * File drop container.\n *\n * @element bx-file-drop-container\n * @fires bx-file-drop-container-changed The custom event fired when there is a user gesture to select files to upload.\n */\n@customElement(`${prefix}-file-drop-container`)\nclass BXFileDropContainer extends HostListenerMixin(LitElement) {\n /**\n * `true` to show the active state of this UI.\n */\n private _active = false;\n\n /**\n * Handles user gesture to select files to upload.\n *\n * @param event The event.\n */\n private _handleChange(event: Event | DragEvent) {\n const addedFiles = this._getFiles(event);\n const { eventChange, selectorInput } = this\n .constructor as typeof BXFileDropContainer;\n this.dispatchEvent(\n new CustomEvent(eventChange, {\n bubbles: true,\n composed: true,\n detail: {\n addedFiles,\n },\n })\n );\n\n const fileInput = this?.shadowRoot?.querySelector(selectorInput);\n if (fileInput) {\n (fileInput as HTMLInputElement).value = ''; // carbon-web-components#904\n }\n }\n\n /**\n * Handles `dragover`, `dragleave` and `drop` events.\n *\n * @param event The event.\n */\n @HostListener('dragover')\n @HostListener('dragleave')\n @HostListener('drop')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleDrag(event: DragEvent) {\n event.preventDefault(); // Prevents page navigation upon dropping\n if (this.disabled) {\n return;\n }\n const { dataTransfer, type } = event;\n const dropEffect = dropEffects[type];\n if (dataTransfer && dropEffect) {\n dataTransfer.dropEffect = dropEffect;\n }\n this._active = type === 'dragover';\n if (type === 'drop') {\n this._handleChange(event);\n }\n this.requestUpdate();\n }\n\n /**\n * @param event The event.\n * @returns The list of files user chose to upload.\n */\n private _getFiles(event: Event | DragEvent) {\n const { files } =\n (event.type === 'drop'\n ? (event as DragEvent).dataTransfer\n : (event.target as HTMLInputElement)) ?? {};\n const { accept } = this;\n if (!accept || !/^(change|drop)$/.test(event.type)) {\n return Array.from(files ?? []);\n }\n const acceptedTypes = new Set(accept.split(' '));\n return Array.prototype.filter.call(\n files,\n ({ name, type: mimeType = '' }) => {\n const fileExtensionRegExp = /\\.[^.]+$/;\n const hasFileExtension = fileExtensionRegExp.test(name);\n const [fileExtension] = !hasFileExtension\n ? [undefined]\n : fileExtensionRegExp.exec(name) ?? [];\n return (\n acceptedTypes.has(mimeType) ||\n (fileExtension && acceptedTypes.has(fileExtension))\n );\n }\n ) as File[];\n }\n\n /**\n * The file types the file input should accept, separated by space.\n */\n @property()\n accept = '';\n\n /**\n * `true` if this drop container should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * `true` if this drop container should accept more than one files at once.\n * Note that even with `false` set here, user _can_ select multiple files one by one.\n */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /**\n * The shadow DOM slot to put this drop container in.\n */\n @property({ reflect: true })\n slot = 'drop-container';\n\n render() {\n const {\n accept,\n disabled,\n multiple,\n _active: active,\n _handleChange: handleChange,\n } = this;\n const labelClasses = classMap({\n [`${prefix}--file-browse-btn`]: true,\n [`${prefix}--file-browse-btn--disabled`]: disabled,\n });\n const dropareaClasses = classMap({\n [`${prefix}--file__drop-container`]: true,\n [`${prefix}--file__drop-container--drag-over`]: active,\n });\n return html`\n <label class=\"${labelClasses}\" for=\"file\" tabindex=\"0\">\n <div class=\"${dropareaClasses}\" role=\"button\">\n <slot></slot>\n <input\n id=\"file\"\n type=\"file\"\n class=\"${prefix}--file-input\"\n tabindex=\"-1\"\n accept=\"${ifNonEmpty(accept)}\"\n ?disabled=\"${disabled}\"\n ?multiple=\"${multiple}\"\n @change=\"${handleChange}\" />\n </div>\n </label>\n `;\n }\n\n /**\n * The name of the custom event fired when there is a user gesture to select files to upload.\n */\n static get eventChange() {\n return `${prefix}-file-drop-container-changed`;\n }\n\n /**\n * A selector that will return the file `<input>`.\n */\n static get selectorInput() {\n return `.${prefix}--file-input`;\n }\n\n static styles = styles;\n}\n\nexport default BXFileDropContainer;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ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ChD;;MAEA;AACF;AACA;IAFE;MAAAY,IAAA;MAAA2D,MAAA;MAAA1D,GAAA;MAAAC,KAAA,EAGA,SAAAO,cAAA,EAA2B;QACzB,OAAQ,IAAGrB,MAAO,cAAa;MACjC;IAAC;MAAAY,IAAA;MAAA2D,MAAA;MAAA1D,GAAA;MAAAC,MAAA;QAAA,OAEenB,MAAM;MAAA;IAAA;EAAA;AAAA,GAhKUH,iBAAiB,CAACF,UAAU,CAAC;AAmK/D,eAAec,mBAAmB"}
@@ -647,6 +647,10 @@ export default class BXInput extends BXInput_base {
647
647
  * The internal value.
648
648
  */
649
649
  protected _value: string;
650
+ /**
651
+ * Set initial value of input
652
+ */
653
+ value: string;
650
654
  /**
651
655
  * Handles `oninput` event on the `<input>`.
652
656
  *
@@ -740,11 +744,6 @@ export default class BXInput extends BXInput_base {
740
744
  * The validity message. If present and non-empty, this input shows the UI of its invalid state.
741
745
  */
742
746
  validityMessage: string;
743
- /**
744
- * The value of the input.
745
- */
746
- get value(): string;
747
- set value(value: string);
748
747
  createRenderRoot(): ShadowRoot;
749
748
  /**
750
749
  * Handles password visibility toggle button click
@@ -1 +1 @@
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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EG;IAEH,uBAAuB,SAAiC;IAExD;;OAEG;IAEH,iBAAiB,SAAmB;IAEpC;;OAEG;IAEH,iBAAiB,SAAmB;IAEpC;;OAEG;IAMH,4BAA4B,UAAS;IAErC;;OAEG;IAEH,IAAI,aAAsB;IAE1B;;;OAGG;IAEH,gBAAgB,0BAAkC;IAElD;;;OAGG;IAEH,gBAAgB,0BAAkC;IAElD;;OAEG;IAEH,IAAI,aAAmB;IAEvB;;OAEG;IAEH,eAAe,SAAM;IAErB;;OAEG;IACH,IACI,KAAK,WAQR;IAED,IAAI,KAAK,CAAC,KAAK,QAAA,EAUd;IAED,gBAAgB;IAShB;;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, 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"]}
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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;IAEjB;;OAEG;IAEH,uBAAuB,SAAiC;IAExD;;OAEG;IAEH,iBAAiB,SAAmB;IAEpC;;OAEG;IAEH,iBAAiB,SAAmB;IAEpC;;OAEG;IAMH,4BAA4B,UAAS;IAErC;;OAEG;IAEH,IAAI,aAAsB;IAE1B;;;OAGG;IAEH,gBAAgB,0BAAkC;IAElD;;;OAGG;IAEH,gBAAgB,0BAAkC;IAElD;;OAEG;IAEH,IAAI,aAAmB;IAEvB;;OAEG;IAEH,eAAe,SAAM;IAErB,gBAAgB;IAShB;;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, 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 * Set initial value of input\n */\n @property({ reflect: true })\n 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 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"]}
@@ -58,6 +58,15 @@ let BXInput = _decorate([customElement(`${prefix}-input`)], function (_initializ
58
58
  value() {
59
59
  return '';
60
60
  }
61
+ }, {
62
+ kind: "field",
63
+ decorators: [property({
64
+ reflect: true
65
+ })],
66
+ key: "value",
67
+ value() {
68
+ return '';
69
+ }
61
70
  }, {
62
71
  kind: "method",
63
72
  key: "_handleInput",
@@ -70,6 +79,10 @@ let BXInput = _decorate([customElement(`${prefix}-input`)], function (_initializ
70
79
  * The internal value.
71
80
  */
72
81
 
82
+ /**
83
+ * Set initial value of input
84
+ */
85
+
73
86
  /**
74
87
  * Handles `oninput` event on the `<input>`.
75
88
  *
@@ -283,11 +296,8 @@ let BXInput = _decorate([customElement(`${prefix}-input`)], function (_initializ
283
296
  return '';
284
297
  }
285
298
  }, {
286
- kind: "get",
287
- decorators: [property({
288
- reflect: true
289
- })],
290
- key: "value",
299
+ kind: "method",
300
+ key: "createRenderRoot",
291
301
  value:
292
302
  /**
293
303
  * Sets the input to be focussed automatically on page load. Defaults to false
@@ -351,36 +361,7 @@ let BXInput = _decorate([customElement(`${prefix}-input`)], function (_initializ
351
361
  /**
352
362
  * The validity message. If present and non-empty, this input shows the UI of its invalid state.
353
363
  */
354
- /**
355
- * The value of the input.
356
- */
357
- function value() {
358
- // FIXME: Figure out how to deal with TS2611
359
- // once we have the input we can directly query for the value
360
- if (this._input) {
361
- return this._input.value;
362
- }
363
- // but before then _value will work fine
364
- return this._value;
365
- }
366
- }, {
367
- kind: "set",
368
- key: "value",
369
- value: function value(_value) {
370
- const oldValue = this._value;
371
- this._value = _value;
372
- // make sure that lit-element updates the right properties
373
- this.requestUpdate('value', oldValue);
374
- // we set the value directly on the input (when available)
375
- // so that programatic manipulation updates the UI correctly
376
- if (this._input) {
377
- this._input.value = _value;
378
- }
379
- }
380
- }, {
381
- kind: "method",
382
- key: "createRenderRoot",
383
- value: function createRenderRoot() {
364
+ function createRenderRoot() {
384
365
  var _exec;
385
366
  return this.attachShadow({
386
367
  mode: 'open',
@@ -1 +1 @@
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/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;AACjC,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AAExF,SAASL,kBAAkB,EAAEC,UAAU,EAAEC,UAAU;AAEnD,MAAM;EAAEI;AAAO,CAAC,GAAGf,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IASqBgB,OAAO,GAAAC,SAAA,EAD3BH,aAAa,CAAE,GAAEC,MAAO,QAAO,CAAC,aAAAG,WAAA,EAAAC,cAAA;EAAjC,MACqBH,OAAO,SAAAG,cAAA,CAA8C;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA6S1E;EAAC;IAAAI,CAAA,EA7SoBN,OAAO;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIzB5B,KAAK,CAAC,OAAO,CAAC;MAAA6B,GAAA;MAAAC,KAAA;IAAA;MAAAH,IAAA;MAAAE,GAAA;MAAAC,MAAA;QAAA,OAMI,EAAE;MAAA;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BACOT,YAAY,EACC,IAAI,CAACe,SAAS,EAGhCnE,MAAM,EACE,IAAI,CAACkD,OAAO,EAC3B,IAAI,CAACA,OAAO,GAAGJ,WAAW,GAAG,IAAI,EAEjB,IAAI,CAACsB,YAAY,EACnB,IAAI,CAACC,SAAS,EACnBrB,YAAY,EACJ,IAAI,CAACE,OAAO,EAChB,IAAI,CAAChC,QAAQ,EAGlB3B,UAAU,CAAC,IAAI,CAAC4B,IAAI,CAAC,EAClB5B,UAAU,CAAC,IAAI,CAAC+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,CAAC,CAAC,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
+ {"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","reflect","_handleInput","target","_handleFormdata","event","formData","disabled","name","append","type","Boolean","attribute","REGULAR","CENTER","BOTTOM","TEXT","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","_value","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 * Set initial value of input\n */\n @property({ reflect: true })\n 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 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/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;AACjC,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AAExF,SAASL,kBAAkB,EAAEC,UAAU,EAAEC,UAAU;AAEnD,MAAM;EAAEI;AAAO,CAAC,GAAGf,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IASqBgB,OAAO,GAAAC,SAAA,EAD3BH,aAAa,CAAE,GAAEC,MAAO,QAAO,CAAC,aAAAG,WAAA,EAAAC,cAAA;EA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,YAAY,EACnB,IAAI,CAACC,SAAS,EACnBrB,YAAY,EACJ,IAAI,CAACE,OAAO,EAChB,IAAI,CAAC3B,QAAQ,EAGlB5B,UAAU,CAAC,IAAI,CAAC6B,IAAI,CAAC,EAClB7B,UAAU,CAAC,IAAI,CAAC2E,OAAO,CAAC,EACpB3E,UAAU,CAAC,IAAI,CAAC4E,WAAW,CAAC,EAC9B,IAAI,CAACC,QAAQ,EACb,IAAI,CAACC,QAAQ,EAClB9E,UAAU,CAAC,IAAI,CAAC+B,IAAI,CAAC,EACnB,IAAI,CAACgD,MAAM,EACX7B,WAAW,EACrB,IAAI,CAAC8B,4BAA4B,KAClC,IAAI,CAACjD,IAAI,KAAK1B,UAAU,CAAC2C,QAAQ,IAAI,IAAI,CAACjB,IAAI,KAAK1B,UAAU,CAACgC,IAAI,CAAC,GAChEgC,wBAAwB,CAAC,CAAC,GAC1B,IAAI,EAEIX,iBAAiB,EACD,IAAI,CAACuB,UAAU,EAE/BxE,MAAM,EACe,IAAI,CAACyE,eAAe;MAG3D;IAAC;MAAAhE,IAAA;MAAAiE,MAAA;MAAA/D,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GAxRaJ,aAAa,CAACD,SAAS,CAACT,UAAU,CAAC,CAAC;AAAA,SAApDkB,OAAO,IAAA0E,OAAA"}
@@ -141,7 +141,7 @@ let BXOverflowMenuBody = _decorate([customElement(`${prefix}-overflow-menu-body`
141
141
  value: function _navigate(direction) {
142
142
  if (this.selected) {
143
143
  const nextItem = this._getNextItem(this.selected, direction);
144
- nextItem === null || nextItem === void 0 ? void 0 : nextItem.focus();
144
+ nextItem === null || nextItem === void 0 || nextItem.focus();
145
145
  }
146
146
  }
147
147
 
@@ -1 +1 @@
1
- {"version":3,"file":"overflow-menu-body.js","names":["settings","html","property","BXFloatingMenu","FLOATING_MENU_ALIGNMENT","FLOATING_MENU_DIRECTION","NAVIGATION_DIRECTION","OVERFLOW_MENU_COLOR_SCHEME","styles","HostListener","indexOf","carbonElement","customElement","prefix","capIndex","index","length","BXOverflowMenuBody","_decorate","_initialize","_BXFloatingMenu","constructor","args","F","d","kind","decorators","key","value","START","attribute","reflect","REGULAR","BOTTOM","type","Boolean","_getNextItem","currentItem","direction","selectorItemEnabled","menuItems","querySelectorAll","currentIndex","nextIndex","_navigate","selected","nextItem","focus","event","open","contains","document","activeElement","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","render","_t","_","static","selectorMenuItem"],"sources":["components/overflow-menu/overflow-menu-body.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 { html, property } from 'lit-element';\nimport BXFloatingMenu, {\n FLOATING_MENU_ALIGNMENT,\n FLOATING_MENU_DIRECTION,\n} from '../floating-menu/floating-menu';\nimport { NAVIGATION_DIRECTION, OVERFLOW_MENU_COLOR_SCHEME } from './defs';\nimport styles from './overflow-menu.scss';\nimport BXOverflowMenuItem from './overflow-menu-item';\nimport HostListener from '../../globals/decorators/host-listener';\nimport { indexOf } from '../../globals/internal/collection-helpers';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nconst { prefix } = settings;\n\n/**\n * @param index The index\n * @param length The length of the array.\n * @returns The new index, adjusting overflow/underflow.\n */\nconst capIndex = (index: number, length: number) => {\n if (index < 0) {\n return length - 1;\n }\n if (index >= length) {\n return 0;\n }\n return index;\n};\n\n/**\n * Overflow menu body.\n *\n * @element bx-overflow-menu-body\n */\n@customElement(`${prefix}-overflow-menu-body`)\nclass BXOverflowMenuBody extends BXFloatingMenu {\n /**\n * How the menu is aligned to the trigger button.\n */\n @property()\n alignment = FLOATING_MENU_ALIGNMENT.START;\n\n /**\n * The color scheme.\n */\n @property({ attribute: 'color-scheme', reflect: true })\n colorScheme = OVERFLOW_MENU_COLOR_SCHEME.REGULAR;\n\n /**\n * The menu direction.\n */\n @property()\n direction = FLOATING_MENU_DIRECTION.BOTTOM;\n\n /**\n * `true` if the menu should be open.\n *\n * @private\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n selected: BXOverflowMenuItem | null = null;\n\n /**\n * @param currentItem The currently selected item.\n * @param direction The navigation direction.\n * @returns The item to be selected.\n */\n protected _getNextItem(currentItem: BXOverflowMenuItem, direction: number) {\n const { selectorItemEnabled } = this\n .constructor as typeof BXOverflowMenuBody;\n const menuItems = this.querySelectorAll(selectorItemEnabled);\n const currentIndex = indexOf(menuItems, currentItem);\n const nextIndex = capIndex(currentIndex + direction, menuItems.length);\n return nextIndex === currentIndex ? null : menuItems[nextIndex];\n }\n\n /**\n * Navigates through overflow menu items.\n *\n * @param direction `-1` to navigate backward, `1` to navigate forward.\n */\n protected _navigate(direction: number) {\n if (this.selected) {\n const nextItem = this._getNextItem(this.selected, direction);\n (nextItem as HTMLElement)?.focus();\n }\n }\n\n /**\n * Handles `keydown` event on the menu body.\n */\n @HostListener('keydown')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n protected _handleKeydown = async (event: KeyboardEvent) => {\n const { key } = event;\n if (this.open) {\n /**\n * sets this.selected to focused menu item. the menu item is focused\n * automatically due to FocusMixin\n */\n if (this.contains(document.activeElement)) {\n this.selected = document.activeElement as BXOverflowMenuItem;\n }\n\n if (key in NAVIGATION_DIRECTION) {\n this._navigate(NAVIGATION_DIRECTION[key]);\n }\n\n if (key === 'Escape') {\n this.open = false;\n }\n }\n };\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'menu');\n }\n if (!this.hasAttribute('tabindex')) {\n // TODO: Should we use a property?\n this.setAttribute('tabindex', '-1');\n }\n super.connectedCallback();\n }\n\n render() {\n return html` <slot></slot> `;\n }\n\n /**\n * A selector that will return menu items.\n */\n static get selectorMenuItem() {\n return `${prefix}-overflow-menu-item`;\n }\n\n /**\n * A selector that will return enabled menu items.\n */\n static get selectorItemEnabled() {\n return `${prefix}-overflow-menu-item:not([disabled])`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXOverflowMenuBody;\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,QAAQ,MAAM,0CAA0C;AAC/D,SAASC,IAAI,EAAEC,QAAQ,QAAQ,aAAa;AAC5C,OAAOC,cAAc,IACnBC,uBAAuB,EACvBC,uBAAuB,QAClB,gCAAgC;AACvC,SAASC,oBAAoB,EAAEC,0BAA0B,QAAQ,QAAQ;AACzE,OAAOC,MAAM,MAAM,0BAAsB;AAEzC,OAAOC,YAAY,MAAM,wCAAwC;AACjE,SAASC,OAAO,QAAQ,2CAA2C;AACnE,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AAExF,MAAM;EAAEC;AAAO,CAAC,GAAGb,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA,MAAMc,QAAQ,GAAGA,CAACC,KAAa,EAAEC,MAAc,KAAK;EAClD,IAAID,KAAK,GAAG,CAAC,EAAE;IACb,OAAOC,MAAM,GAAG,CAAC;EACnB;EACA,IAAID,KAAK,IAAIC,MAAM,EAAE;IACnB,OAAO,CAAC;EACV;EACA,OAAOD,KAAK;AACd,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJA,IAMME,kBAAkB,GAAAC,SAAA,EADvBN,aAAa,CAAE,GAAEC,MAAO,qBAAoB,CAAC,aAAAM,WAAA,EAAAC,eAAA;EAA9C,MACMH,kBAAkB,SAAAG,eAAA,CAAwB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA+GhD;EAAC;IAAAI,CAAA,EA/GKN,kBAAkB;IAAAO,CAAA;MAAAC,IAAA;MAAAC,UAAA,GAIrBxB,QAAQ,CAAC,CAAC;MAAAyB,GAAA;MAAAC,MAAA;QAAA,OACCxB,uBAAuB,CA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tB;IAAC;MAAAlC,IAAA;MAAAE,GAAA;MAAAC,KAAA,EAED,SAAAgC,OAAA,EAAS;QACP,OAAO3D,IAAI,CAAA4D,EAAA,KAAAA,EAAA,GAAAC,CAAA;MACb;;MAEA;AACF;AACA;IAFE;MAAArC,IAAA;MAAAsC,MAAA;MAAApC,GAAA;MAAAC,KAAA,EAGA,SAAAoC,iBAAA,EAA8B;QAC5B,OAAQ,GAAEnD,MAAO,qBAAoB;MACvC;;MAEA;AACF;AACA;IAFE;MAAAY,IAAA;MAAAsC,MAAA;MAAApC,GAAA;MAAAC,KAAA,EAGA,SAAAW,oBAAA,EAAiC;QAC/B,OAAQ,GAAE1B,MAAO,qCAAoC;MACvD;IAAC;MAAAY,IAAA;MAAAsC,MAAA;MAAApC,GAAA;MAAAC,MAAA;QAAA,OAEepB,MAAM;MAAA;IAAA;EAAA;AAAA,GA9GSL,cAAc;AAiH/C,eAAec,kBAAkB"}
1
+ {"version":3,"file":"overflow-menu-body.js","names":["settings","html","property","BXFloatingMenu","FLOATING_MENU_ALIGNMENT","FLOATING_MENU_DIRECTION","NAVIGATION_DIRECTION","OVERFLOW_MENU_COLOR_SCHEME","styles","HostListener","indexOf","carbonElement","customElement","prefix","capIndex","index","length","BXOverflowMenuBody","_decorate","_initialize","_BXFloatingMenu","constructor","args","F","d","kind","decorators","key","value","START","attribute","reflect","REGULAR","BOTTOM","type","Boolean","_getNextItem","currentItem","direction","selectorItemEnabled","menuItems","querySelectorAll","currentIndex","nextIndex","_navigate","selected","nextItem","focus","event","open","contains","document","activeElement","connectedCallback","hasAttribute","setAttribute","_get","_getPrototypeOf","prototype","call","render","_t","_","static","selectorMenuItem"],"sources":["components/overflow-menu/overflow-menu-body.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 { html, property } from 'lit-element';\nimport BXFloatingMenu, {\n FLOATING_MENU_ALIGNMENT,\n FLOATING_MENU_DIRECTION,\n} from '../floating-menu/floating-menu';\nimport { NAVIGATION_DIRECTION, OVERFLOW_MENU_COLOR_SCHEME } from './defs';\nimport styles from './overflow-menu.scss';\nimport BXOverflowMenuItem from './overflow-menu-item';\nimport HostListener from '../../globals/decorators/host-listener';\nimport { indexOf } from '../../globals/internal/collection-helpers';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nconst { prefix } = settings;\n\n/**\n * @param index The index\n * @param length The length of the array.\n * @returns The new index, adjusting overflow/underflow.\n */\nconst capIndex = (index: number, length: number) => {\n if (index < 0) {\n return length - 1;\n }\n if (index >= length) {\n return 0;\n }\n return index;\n};\n\n/**\n * Overflow menu body.\n *\n * @element bx-overflow-menu-body\n */\n@customElement(`${prefix}-overflow-menu-body`)\nclass BXOverflowMenuBody extends BXFloatingMenu {\n /**\n * How the menu is aligned to the trigger button.\n */\n @property()\n alignment = FLOATING_MENU_ALIGNMENT.START;\n\n /**\n * The color scheme.\n */\n @property({ attribute: 'color-scheme', reflect: true })\n colorScheme = OVERFLOW_MENU_COLOR_SCHEME.REGULAR;\n\n /**\n * The menu direction.\n */\n @property()\n direction = FLOATING_MENU_DIRECTION.BOTTOM;\n\n /**\n * `true` if the menu should be open.\n *\n * @private\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n selected: BXOverflowMenuItem | null = null;\n\n /**\n * @param currentItem The currently selected item.\n * @param direction The navigation direction.\n * @returns The item to be selected.\n */\n protected _getNextItem(currentItem: BXOverflowMenuItem, direction: number) {\n const { selectorItemEnabled } = this\n .constructor as typeof BXOverflowMenuBody;\n const menuItems = this.querySelectorAll(selectorItemEnabled);\n const currentIndex = indexOf(menuItems, currentItem);\n const nextIndex = capIndex(currentIndex + direction, menuItems.length);\n return nextIndex === currentIndex ? null : menuItems[nextIndex];\n }\n\n /**\n * Navigates through overflow menu items.\n *\n * @param direction `-1` to navigate backward, `1` to navigate forward.\n */\n protected _navigate(direction: number) {\n if (this.selected) {\n const nextItem = this._getNextItem(this.selected, direction);\n (nextItem as HTMLElement)?.focus();\n }\n }\n\n /**\n * Handles `keydown` event on the menu body.\n */\n @HostListener('keydown')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n protected _handleKeydown = async (event: KeyboardEvent) => {\n const { key } = event;\n if (this.open) {\n /**\n * sets this.selected to focused menu item. the menu item is focused\n * automatically due to FocusMixin\n */\n if (this.contains(document.activeElement)) {\n this.selected = document.activeElement as BXOverflowMenuItem;\n }\n\n if (key in NAVIGATION_DIRECTION) {\n this._navigate(NAVIGATION_DIRECTION[key]);\n }\n\n if (key === 'Escape') {\n this.open = false;\n }\n }\n };\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'menu');\n }\n if (!this.hasAttribute('tabindex')) {\n // TODO: Should we use a property?\n this.setAttribute('tabindex', '-1');\n }\n super.connectedCallback();\n }\n\n render() {\n return html` <slot></slot> `;\n }\n\n /**\n * A selector that will return menu items.\n */\n static get selectorMenuItem() {\n return `${prefix}-overflow-menu-item`;\n }\n\n /**\n * A selector that will return enabled menu items.\n */\n static get selectorItemEnabled() {\n return `${prefix}-overflow-menu-item:not([disabled])`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXOverflowMenuBody;\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,QAAQ,MAAM,0CAA0C;AAC/D,SAASC,IAAI,EAAEC,QAAQ,QAAQ,aAAa;AAC5C,OAAOC,cAAc,IACnBC,uBAAuB,EACvBC,uBAAuB,QAClB,gCAAgC;AACvC,SAASC,oBAAoB,EAAEC,0BAA0B,QAAQ,QAAQ;AACzE,OAAOC,MAAM,MAAM,0BAAsB;AAEzC,OAAOC,YAAY,MAAM,wCAAwC;AACjE,SAASC,OAAO,QAAQ,2CAA2C;AACnE,SAASC,aAAa,IAAIC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M;MAAA;IAAA;EAAA;AAAA,GA9GSL,cAAc;AAiH/C,eAAec,kBAAkB"}
@@ -70,7 +70,7 @@ let BXOverflowMenu = _decorate([customElement(`${prefix}-overflow-menu`)], funct
70
70
  const {
71
71
  _menuBody: menuBody
72
72
  } = this;
73
- menuBody === null || menuBody === void 0 ? void 0 : menuBody.focus();
73
+ menuBody === null || menuBody === void 0 || menuBody.focus();
74
74
  }
75
75
  }
76
76
 
@@ -1 +1 @@
1
- {"version":3,"file":"overflow-menu.js","names":["settings","html","property","LitElement","OverflowMenuVertical16","HostListener","FocusMixin","HostListenerMixin","find","OVERFLOW_MENU_COLOR_SCHEME","OVERFLOW_MENU_SIZE","styles","carbonElement","customElement","prefix","BXOverflowMenu","_decorate","_initialize","_HostListenerMixin","constructor","args","F","d","kind","key","value","_handleUserInitiatedToggle","open","updateComplete","_menuBody","menuBody","focus","decorators","attribute","reflect","REGULAR","type","Boolean","triggerPosition","getBoundingClientRect","connectedCallback","hasAttribute","setAttribute","shadowRoot","attachShadow","mode","_get","_getPrototypeOf","prototype","call","updated","changedProperties","has","colorScheme","childNodes","elem","FLOATING_MENU","String","render","_t","_","class","static"],"sources":["components/overflow-menu/overflow-menu.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 { html, property, LitElement } from 'lit-element';\nimport OverflowMenuVertical16 from '@carbon/icons/lib/overflow-menu--vertical/16';\nimport HostListener from '../../globals/decorators/host-listener';\nimport FocusMixin from '../../globals/mixins/focus';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport { find } from '../../globals/internal/collection-helpers';\nimport BXFloatingMenuTrigger from '../floating-menu/floating-menu-trigger';\nimport { OVERFLOW_MENU_COLOR_SCHEME, OVERFLOW_MENU_SIZE } from './defs';\nimport BXOverflowMenuBody from './overflow-menu-body';\nimport styles from './overflow-menu.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { OVERFLOW_MENU_COLOR_SCHEME, OVERFLOW_MENU_SIZE };\n\nconst { prefix } = settings;\n\n/**\n * Overflow menu.\n *\n * @element bx-overflow-menu\n * @slot icon - The icon for the trigger button.\n */\n@customElement(`${prefix}-overflow-menu`)\nclass BXOverflowMenu\n extends HostListenerMixin(FocusMixin(LitElement))\n implements BXFloatingMenuTrigger\n{\n /**\n * The menu body.\n */\n private _menuBody: BXOverflowMenuBody | null = null;\n\n /**\n * Handles user-initiated toggling of the menu.\n */\n private async _handleUserInitiatedToggle() {\n this.open = !this.open;\n const { open, updateComplete } = this;\n if (open) {\n await updateComplete;\n const { _menuBody: menuBody } = this;\n menuBody?.focus();\n }\n }\n\n /**\n * Handles `click` event on the trigger button.\n */\n @HostListener('click')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleClickTrigger = async () => {\n this._handleUserInitiatedToggle();\n };\n\n /**\n * Handles `keydown` event on the trigger button.\n */\n @HostListener('keydown')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleKeydownTrigger = async ({ key }) => {\n if (key === ' ' || key === 'Enter') {\n this._handleUserInitiatedToggle();\n }\n };\n\n /**\n * The color scheme.\n */\n @property({ attribute: 'color-scheme', reflect: true })\n colorScheme = OVERFLOW_MENU_COLOR_SCHEME.REGULAR;\n\n /**\n * `true` if this overflow menu should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * `true` if the dropdown should be open.\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Overflow menu size.\n */\n @property({ reflect: true })\n size = OVERFLOW_MENU_SIZE.REGULAR;\n\n /**\n * @returns The position of the trigger button in the viewport.\n */\n get triggerPosition() {\n return this.getBoundingClientRect();\n }\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'button');\n }\n if (!this.hasAttribute('tabindex')) {\n // TODO: Should we use a property?\n this.setAttribute('tabindex', '0');\n }\n if (!this.hasAttribute('aria-haspopup')) {\n this.setAttribute('aria-haspopup', 'true');\n }\n if (!this.hasAttribute('aria-expanded')) {\n this.setAttribute('aria-expanded', 'false');\n }\n if (!this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n super.connectedCallback();\n }\n\n updated(changedProperties) {\n if (changedProperties.has('open')) {\n const { colorScheme, open } = this;\n if (open && !this._menuBody) {\n this._menuBody = find(\n this.childNodes,\n (elem) =>\n (elem.constructor as typeof BXOverflowMenuBody).FLOATING_MENU\n );\n }\n const { _menuBody: menuBody } = this;\n if (menuBody) {\n menuBody.colorScheme = colorScheme;\n menuBody.open = open;\n this.setAttribute('aria-expanded', String(Boolean(open)));\n }\n }\n if (changedProperties.has('colorScheme')) {\n const { colorScheme } = this;\n const { _menuBody: menuBody } = this;\n if (menuBody) {\n menuBody.colorScheme = colorScheme;\n }\n }\n }\n\n render() {\n return html`\n <slot name=\"icon\">\n ${OverflowMenuVertical16({\n class: `${prefix}--overflow-menu__icon`,\n })}\n </slot>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXOverflowMenu;\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,QAAQ,MAAM,0CAA0C;AAC/D,SAASC,IAAI,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,aAAa;AACxD,OAAOC,sBAAsB,MAAM,wCAA8C;AACjF,OAAOC,YAAY,MAAM,wCAAwC;AACjE,OAAOC,UAAU,MAAM,4BAA4B;AACnD,OAAOC,iBAAiB,MAAM,oCAAoC;AAClE,SAASC,IAAI,QAAQ,2CAA2C;AAEhE,SAASC,0BAA0B,EAAEC,kBAAkB,QAAQ,QAAQ;AAEvE,OAAOC,MAAM,MAAM,0BAAsB;AACzC,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AAExF,SAASJ,0BAA0B,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SAAS,EAAEC;UAAS,CAAC,GAAG,IAAI;UACpC,IAAIA,QAAQ,EAAE;YACZA,QAAQ,CAACuB,WAAW,GAAGA,WAAW;UACpC;QACF;MACF;IAAC;MAAA9B,IAAA;MAAAC,GAAA;MAAAC,KAAA,EAED,SAAAiC,OAAA,EAAS;QACP,OAAOzD,IAAI,CAAA0D,EAAA,KAAAA,EAAA,GAAAC,CAAA,sCAELxD,sBAAsB,CAAC;UACvByD,KAAK,EAAG,GAAE/C,MAAO;QACnB,CAAC,CAAC;MAGR;IAAC;MAAAS,IAAA;MAAAuC,MAAA;MAAAtC,GAAA;MAAAC,MAAA;QAAA,OAEed,MAAM;MAAA;IAAA;EAAA;AAAA,GAhIdJ,iBAAiB,CAACD,UAAU,CAACH,UAAU,CAAC,CAAC;AAmInD,eAAeY,cAAc"}
1
+ {"version":3,"file":"overflow-menu.js","names":["settings","html","property","LitElement","OverflowMenuVertical16","HostListener","FocusMixin","HostListenerMixin","find","OVERFLOW_MENU_COLOR_SCHEME","OVERFLOW_MENU_SIZE","styles","carbonElement","customElement","prefix","BXOverflowMenu","_decorate","_initialize","_HostListenerMixin","constructor","args","F","d","kind","key","value","_handleUserInitiatedToggle","open","updateComplete","_menuBody","menuBody","focus","decorators","attribute","reflect","REGULAR","type","Boolean","triggerPosition","getBoundingClientRect","connectedCallback","hasAttribute","setAttribute","shadowRoot","attachShadow","mode","_get","_getPrototypeOf","prototype","call","updated","changedProperties","has","colorScheme","childNodes","elem","FLOATING_MENU","String","render","_t","_","class","static"],"sources":["components/overflow-menu/overflow-menu.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 { html, property, LitElement } from 'lit-element';\nimport OverflowMenuVertical16 from '@carbon/icons/lib/overflow-menu--vertical/16';\nimport HostListener from '../../globals/decorators/host-listener';\nimport FocusMixin from '../../globals/mixins/focus';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport { find } from '../../globals/internal/collection-helpers';\nimport BXFloatingMenuTrigger from '../floating-menu/floating-menu-trigger';\nimport { OVERFLOW_MENU_COLOR_SCHEME, OVERFLOW_MENU_SIZE } from './defs';\nimport BXOverflowMenuBody from './overflow-menu-body';\nimport styles from './overflow-menu.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { OVERFLOW_MENU_COLOR_SCHEME, OVERFLOW_MENU_SIZE };\n\nconst { prefix } = settings;\n\n/**\n * Overflow menu.\n *\n * @element bx-overflow-menu\n * @slot icon - The icon for the trigger button.\n */\n@customElement(`${prefix}-overflow-menu`)\nclass BXOverflowMenu\n extends HostListenerMixin(FocusMixin(LitElement))\n implements BXFloatingMenuTrigger\n{\n /**\n * The menu body.\n */\n private _menuBody: BXOverflowMenuBody | null = null;\n\n /**\n * Handles user-initiated toggling of the menu.\n */\n private async _handleUserInitiatedToggle() {\n this.open = !this.open;\n const { open, updateComplete } = this;\n if (open) {\n await updateComplete;\n const { _menuBody: menuBody } = this;\n menuBody?.focus();\n }\n }\n\n /**\n * Handles `click` event on the trigger button.\n */\n @HostListener('click')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleClickTrigger = async () => {\n this._handleUserInitiatedToggle();\n };\n\n /**\n * Handles `keydown` event on the trigger button.\n */\n @HostListener('keydown')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleKeydownTrigger = async ({ key }) => {\n if (key === ' ' || key === 'Enter') {\n this._handleUserInitiatedToggle();\n }\n };\n\n /**\n * The color scheme.\n */\n @property({ attribute: 'color-scheme', reflect: true })\n colorScheme = OVERFLOW_MENU_COLOR_SCHEME.REGULAR;\n\n /**\n * `true` if this overflow menu should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * `true` if the dropdown should be open.\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * Overflow menu size.\n */\n @property({ reflect: true })\n size = OVERFLOW_MENU_SIZE.REGULAR;\n\n /**\n * @returns The position of the trigger button in the viewport.\n */\n get triggerPosition() {\n return this.getBoundingClientRect();\n }\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'button');\n }\n if (!this.hasAttribute('tabindex')) {\n // TODO: Should we use a property?\n this.setAttribute('tabindex', '0');\n }\n if (!this.hasAttribute('aria-haspopup')) {\n this.setAttribute('aria-haspopup', 'true');\n }\n if (!this.hasAttribute('aria-expanded')) {\n this.setAttribute('aria-expanded', 'false');\n }\n if (!this.shadowRoot) {\n this.attachShadow({ mode: 'open' });\n }\n super.connectedCallback();\n }\n\n updated(changedProperties) {\n if (changedProperties.has('open')) {\n const { colorScheme, open } = this;\n if (open && !this._menuBody) {\n this._menuBody = find(\n this.childNodes,\n (elem) =>\n (elem.constructor as typeof BXOverflowMenuBody).FLOATING_MENU\n );\n }\n const { _menuBody: menuBody } = this;\n if (menuBody) {\n menuBody.colorScheme = colorScheme;\n menuBody.open = open;\n this.setAttribute('aria-expanded', String(Boolean(open)));\n }\n }\n if (changedProperties.has('colorScheme')) {\n const { colorScheme } = this;\n const { _menuBody: menuBody } = this;\n if (menuBody) {\n menuBody.colorScheme = colorScheme;\n }\n }\n }\n\n render() {\n return html`\n <slot name=\"icon\">\n ${OverflowMenuVertical16({\n class: `${prefix}--overflow-menu__icon`,\n })}\n </slot>\n `;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXOverflowMenu;\n"],"mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,QAAQ,MAAM,0CAA0C;AAC/D,SAASC,IAAI,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,aAAa;AACxD,OAAOC,sBAAsB,MAAM,wCAA8C;AACjF,OAAOC,YAAY,MAAM,wCAAwC;AACjE,OAAOC,UAAU,MAAM,4BAA4B;A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B,IAAI,CAACe,YAAY,CAAC,eAAe,EAAEe,MAAM,CAACpB,OAAO,CAACV,IAAI,CAAC,CAAC,CAAC;UAC3D;QACF;QACA,IAAIwB,iBAAiB,CAACC,GAAG,CAAC,aAAa,CAAC,EAAE;UACxC,MAAM;YAAEC;UAAY,CAAC,GAAG,IAAI;UAC5B,MAAM;YAAExB,SAAS,EAAEC;UAAS,CAAC,GAAG,IAAI;UACpC,IAAIA,QAAQ,EAAE;YACZA,QAAQ,CAACuB,WAAW,GAAGA,WAAW;UACpC;QACF;MACF;IAAC;MAAA9B,IAAA;MAAAC,GAAA;MAAAC,KAAA,EAED,SAAAiC,OAAA,EAAS;QACP,OAAOzD,IAAI,CAAA0D,EAAA,KAAAA,EAAA,GAAAC,CAAA,sCAELxD,sBAAsB,CAAC;UACvByD,KAAK,EAAG,GAAE/C,MAAO;QACnB,CAAC,CAAC;MAGR;IAAC;MAAAS,IAAA;MAAAuC,MAAA;MAAAtC,GAAA;MAAAC,MAAA;QAAA,OAEed,MAAM;MAAA;IAAA;EAAA;AAAA,GAhIdJ,iBAAiB,CAACD,UAAU,CAACH,UAAU,CAAC,CAAC;AAmInD,eAAeY,cAAc"}
@@ -85,7 +85,7 @@ let BXPageSizesSelect = _decorate([customElement(`${prefix}-page-sizes-select`)]
85
85
  if (value && Number(optionElement.value) === value) {
86
86
  optionElement.selected = true;
87
87
  }
88
- selectNode === null || selectNode === void 0 ? void 0 : selectNode.appendChild(optionElement);
88
+ selectNode === null || selectNode === void 0 || selectNode.appendChild(optionElement);
89
89
  });
90
90
  }
91
91
 
@@ -1 +1 @@
1
- {"version":3,"file":"page-sizes-select.js","names":["html","property","query","LitElement","ChevronDown16","settings","FocusMixin","styles","carbonElement","customElement","prefix","BXPageSizesSelect","_decorate","_initialize","_FocusMixin","constructor","args","F","d","kind","decorators","key","value","_handleChange","target","Number","dispatchEvent","CustomEvent","eventChange","bubbles","composed","detail","_handleSlotChange","_selectNode","selectNode","firstChild","removeChild","assignedNodes","forEach","item","optionElement","cloneNode","selected","appendChild","attribute","type","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","exec","navigator","userAgent","render","labelText","handleChange","handleSlotChange","_t","_","class","static"],"sources":["components/pagination/page-sizes-select.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 ChevronDown16 from '@carbon/icons/lib/chevron--down/16';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport styles from './pagination.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nconst { prefix } = settings;\n\n/**\n * The select box for page sizes.\n *\n * @element bx-page-sizes-select\n * @slot label-text - The label text.\n * @fires bx-page-sizes-select-changed - The custom event fired after the page size is changed.\n */\n@customElement(`${prefix}-page-sizes-select`)\nclass BXPageSizesSelect extends FocusMixin(LitElement) {\n @query('select')\n private _selectNode!: HTMLSelectElement;\n\n /**\n * Handles `change` event on the `<select>` to select page size.\n */\n private _handleChange({ target }: Event) {\n const value = Number((target as HTMLSelectElement).value);\n this.dispatchEvent(\n new CustomEvent(\n (this.constructor as typeof BXPageSizesSelect).eventChange,\n {\n bubbles: true,\n composed: true,\n detail: {\n value,\n },\n }\n )\n );\n this.value = value;\n }\n\n /**\n * Handles `slotchange` event for the `<slot>` for `<options>`.\n *\n * @param event The event.\n */\n private _handleSlotChange({ target }: Event) {\n const { _selectNode: selectNode, value } = this;\n while (selectNode.firstChild) {\n selectNode.removeChild(selectNode.firstChild);\n }\n (\n (target as HTMLSlotElement).assignedNodes() as HTMLOptionElement[]\n ).forEach((item) => {\n const optionElement = item.cloneNode(true) as HTMLOptionElement;\n if (value && Number(optionElement.value) === value) {\n optionElement.selected = true;\n }\n selectNode?.appendChild(optionElement);\n });\n }\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = 'Items per page:';\n\n /**\n * The value, working as the current page size.\n */\n @property({ type: Number })\n value!: number;\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 {\n labelText,\n value,\n _handleChange: handleChange,\n _handleSlotChange: handleSlotChange,\n } = this;\n return html`\n <label for=\"select\" class=\"${prefix}--pagination__text\"\n ><slot name=\"label-text\">${labelText}</slot></label\n >\n <div class=\"${prefix}--select__item-count\">\n <select\n id=\"select\"\n class=\"${prefix}--select-input\"\n .value=\"${value}\"\n @change=${handleChange}></select>\n ${ChevronDown16({ class: `${prefix}--select__arrow` })}\n </div>\n <div hidden><slot @slotchange=\"${handleSlotChange}\"></slot></div>\n `;\n }\n\n /**\n * The name of the custom event fired after the page size is changed.\n */\n static get eventChange() {\n return `${prefix}-page-sizes-select-changed`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXPageSizesSelect;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,UAAU,QAAQ,aAAa;AAC/D,OAAOC,aAAa,MAAM,8BAAoC;AAC9D,OAAOC,QAAQ,MAAM,0CAA0C;AAC/D,OAAOC,UAAU,MAAM,4BAA4B;AACnD,OAAOC,MAAM,MAAM,uBAAmB;AACtC,SAASC,aAAa,IAAIC,aAAa,QAAQ,yCAAyC;AAExF,MAAM;EAAEC;AAAO,CAAC,GAAGL,QAAQ;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAQMM,iBAAiB,GAAAC,SAAA,EADtBH,aAAa,CAAE,GAAEC,MAAO,oBAAmB,CAAC,aAAAG,WAAA,EAAAC,WAAA;EAA7C,MACMH,iBAAiB,SAAAG,WAAA,CAAgC;IAAAC,YAAA,GAAAC,IAAA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GAAElB,MAAO,4BAA2B;MAC9C;IAAC;MAAAS,IAAA;MAAA0C,MAAA;MAAAxC,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GAhGQD,UAAU,CAACH,UAAU,CAAC;AAmGtD,eAAeQ,iBAAiB"}
1
+ {"version":3,"file":"page-sizes-select.js","names":["html","property","query","LitElement","ChevronDown16","settings","FocusMixin","styles","carbonElement","customElement","prefix","BXPageSizesSelect","_decorate","_initialize","_FocusMixin","constructor","args","F","d","kind","decorators","key","value","_handleChange","target","Number","dispatchEvent","CustomEvent","eventChange","bubbles","composed","detail","_handleSlotChange","_selectNode","selectNode","firstChild","removeChild","assignedNodes","forEach","item","optionElement","cloneNode","selected","appendChild","attribute","type","createRenderRoot","_exec","attachShadow","mode","delegatesFocus","exec","navigator","userAgent","render","labelText","handleChange","handleSlotChange","_t","_","class","static"],"sources":["components/pagination/page-sizes-select.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 ChevronDown16 from '@carbon/icons/lib/chevron--down/16';\nimport settings from 'carbon-components/es/globals/js/settings';\nimport FocusMixin from '../../globals/mixins/focus';\nimport styles from './pagination.scss';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nconst { prefix } = settings;\n\n/**\n * The select box for page sizes.\n *\n * @element bx-page-sizes-select\n * @slot label-text - The label text.\n * @fires bx-page-sizes-select-changed - The custom event fired after the page size is changed.\n */\n@customElement(`${prefix}-page-sizes-select`)\nclass BXPageSizesSelect extends FocusMixin(LitElement) {\n @query('select')\n private _selectNode!: HTMLSelectElement;\n\n /**\n * Handles `change` event on the `<select>` to select page size.\n */\n private _handleChange({ target }: Event) {\n const value = Number((target as HTMLSelectElement).value);\n this.dispatchEvent(\n new CustomEvent(\n (this.constructor as typeof BXPageSizesSelect).eventChange,\n {\n bubbles: true,\n composed: true,\n detail: {\n value,\n },\n }\n )\n );\n this.value = value;\n }\n\n /**\n * Handles `slotchange` event for the `<slot>` for `<options>`.\n *\n * @param event The event.\n */\n private _handleSlotChange({ target }: Event) {\n const { _selectNode: selectNode, value } = this;\n while (selectNode.firstChild) {\n selectNode.removeChild(selectNode.firstChild);\n }\n (\n (target as HTMLSlotElement).assignedNodes() as HTMLOptionElement[]\n ).forEach((item) => {\n const optionElement = item.cloneNode(true) as HTMLOptionElement;\n if (value && Number(optionElement.value) === value) {\n optionElement.selected = true;\n }\n selectNode?.appendChild(optionElement);\n });\n }\n\n /**\n * The label text.\n */\n @property({ attribute: 'label-text' })\n labelText = 'Items per page:';\n\n /**\n * The value, working as the current page size.\n */\n @property({ type: Number })\n value!: number;\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 {\n labelText,\n value,\n _handleChange: handleChange,\n _handleSlotChange: handleSlotChange,\n } = this;\n return html`\n <label for=\"select\" class=\"${prefix}--pagination__text\"\n ><slot name=\"label-text\">${labelText}</slot></label\n >\n <div class=\"${prefix}--select__item-count\">\n <select\n id=\"select\"\n class=\"${prefix}--select-input\"\n .value=\"${value}\"\n @change=${handleChange}></select>\n ${ChevronDown16({ class: `${prefix}--select__arrow` })}\n </div>\n <div hidden><slot @slotchange=\"${handleSlotChange}\"></slot></div>\n `;\n }\n\n /**\n * The name of the custom event fired after the page size is changed.\n */\n static get eventChange() {\n return `${prefix}-page-sizes-select-changed`;\n }\n\n static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader\n}\n\nexport default BXPageSizesSelect;\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,UAAU,QAAQ,aAAa;AAC/D,OA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LC,aAAa,EAAEiC,YAAY;UAC3BxB,iBAAiB,EAAEyB;QACrB,CAAC,GAAG,IAAI;QACR,OAAOzD,IAAI,CAAA0D,EAAA,KAAAA,EAAA,GAAAC,CAAA,iSACoBjD,MAAM,EACN6C,SAAS,EAExB7C,MAAM,EAGPA,MAAM,EACLY,KAAK,EACLkC,YAAY,EACtBpD,aAAa,CAAC;UAAEwD,KAAK,EAAG,GAAElD,MAAO;QAAiB,CAAC,CAAC,EAEvB+C,gBAAgB;MAErD;;MAEA;AACF;AACA;IAFE;MAAAtC,IAAA;MAAA0C,MAAA;MAAAxC,GAAA;MAAAC,KAAA,EAGA,SAAAM,YAAA,EAAyB;QACvB,OAAQ,GAAElB,MAAO,4BAA2B;MAC9C;IAAC;MAAAS,IAAA;MAAA0C,MAAA;MAAAxC,GAAA;MAAAC,MAAA;QAAA,OAEef,MAAM;MAAA;IAAA;EAAA;AAAA,GAhGQD,UAAU,CAACH,UAAU,CAAC;AAmGtD,eAAeQ,iBAAiB"}
@@ -172,7 +172,7 @@ let BXSlider = _decorate([customElement(`${prefix}-slider`)], function (_initial
172
172
  */
173
173
  function _handleClickLabel() {
174
174
  var _this$_thumbNode;
175
- (_this$_thumbNode = this._thumbNode) === null || _this$_thumbNode === void 0 ? void 0 : _this$_thumbNode.focus();
175
+ (_this$_thumbNode = this._thumbNode) === null || _this$_thumbNode === void 0 || _this$_thumbNode.focus();
176
176
  }
177
177
  }, {
178
178
  kind: "method",