@carbon/web-components 2.0.0-beta.2 → 2.0.0-beta.4

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 (615) hide show
  1. package/README.md +9 -9
  2. package/custom-elements.json +4026 -1801
  3. package/es/components/breadcrumb/breadcrumb.css.js +1 -1
  4. package/es/components/breadcrumb/breadcrumb.rtl.css.js +1 -1
  5. package/es/components/button/button.css.js +1 -1
  6. package/es/components/button/button.d.ts +12 -4
  7. package/es/components/button/button.d.ts.map +1 -1
  8. package/es/components/button/button.js +57 -19
  9. package/es/components/button/button.js.map +1 -1
  10. package/es/components/button/button.rtl.css.js +1 -1
  11. package/es/components/checkbox/checkbox.css.js +1 -1
  12. package/es/components/checkbox/checkbox.d.ts +9 -0
  13. package/es/components/checkbox/checkbox.d.ts.map +1 -1
  14. package/es/components/checkbox/checkbox.js +32 -1
  15. package/es/components/checkbox/checkbox.js.map +1 -1
  16. package/es/components/checkbox/checkbox.rtl.css.js +1 -1
  17. package/es/components/code-snippet/code-snippet-skeleton.d.ts +2 -2
  18. package/es/components/code-snippet/code-snippet-skeleton.d.ts.map +1 -1
  19. package/es/components/code-snippet/code-snippet-skeleton.js +4 -4
  20. package/es/components/code-snippet/code-snippet-skeleton.js.map +1 -1
  21. package/es/components/code-snippet/code-snippet.css.js +1 -1
  22. package/es/components/code-snippet/code-snippet.d.ts +75 -29
  23. package/es/components/code-snippet/code-snippet.d.ts.map +1 -1
  24. package/es/components/code-snippet/code-snippet.js +370 -164
  25. package/es/components/code-snippet/code-snippet.js.map +1 -1
  26. package/es/components/code-snippet/code-snippet.rtl.css.js +1 -1
  27. package/es/components/copy/copy.d.ts +1 -2
  28. package/es/components/copy/copy.d.ts.map +1 -1
  29. package/es/components/copy/copy.js +6 -13
  30. package/es/components/copy/copy.js.map +1 -1
  31. package/es/components/copy-button/copy-button.css.js +1 -1
  32. package/es/components/copy-button/copy-button.d.ts +8 -0
  33. package/es/components/copy-button/copy-button.d.ts.map +1 -1
  34. package/es/components/copy-button/copy-button.js +38 -2
  35. package/es/components/copy-button/copy-button.js.map +1 -1
  36. package/es/components/copy-button/copy-button.rtl.css.js +1 -1
  37. package/es/components/data-table/data-table.css.js +1 -1
  38. package/es/components/data-table/data-table.rtl.css.js +1 -1
  39. package/es/components/data-table/defs.d.ts +0 -13
  40. package/es/components/data-table/defs.d.ts.map +1 -1
  41. package/es/components/data-table/defs.js +0 -9
  42. package/es/components/data-table/defs.js.map +1 -1
  43. package/es/components/data-table/index.d.ts +6 -5
  44. package/es/components/data-table/index.d.ts.map +1 -1
  45. package/es/components/data-table/index.js +6 -5
  46. package/es/components/data-table/index.js.map +1 -1
  47. package/es/components/data-table/table-batch-actions.d.ts +7 -2
  48. package/es/components/data-table/table-batch-actions.d.ts.map +1 -1
  49. package/es/components/data-table/table-batch-actions.js +25 -6
  50. package/es/components/data-table/table-batch-actions.js.map +1 -1
  51. package/es/components/data-table/table-body.d.ts +8 -4
  52. package/es/components/data-table/table-body.d.ts.map +1 -1
  53. package/es/components/data-table/table-body.js +21 -14
  54. package/es/components/data-table/table-body.js.map +1 -1
  55. package/es/components/data-table/table-cell-content.d.ts +21 -0
  56. package/es/components/data-table/table-cell-content.d.ts.map +1 -0
  57. package/es/components/data-table/table-cell-content.js +53 -0
  58. package/es/components/data-table/table-cell-content.js.map +1 -0
  59. package/es/components/data-table/table-cell.d.ts +15 -2
  60. package/es/components/data-table/table-cell.d.ts.map +1 -1
  61. package/es/components/data-table/table-cell.js +43 -8
  62. package/es/components/data-table/table-cell.js.map +1 -1
  63. package/es/components/data-table/table-expanded-row.d.ts +336 -2
  64. package/es/components/data-table/table-expanded-row.d.ts.map +1 -1
  65. package/es/components/data-table/table-expanded-row.js +69 -16
  66. package/es/components/data-table/table-expanded-row.js.map +1 -1
  67. package/es/components/data-table/table-head.d.ts +7 -2
  68. package/es/components/data-table/table-head.d.ts.map +1 -1
  69. package/es/components/data-table/table-head.js +15 -6
  70. package/es/components/data-table/table-head.js.map +1 -1
  71. package/es/components/data-table/table-header-cell.d.ts +21 -3
  72. package/es/components/data-table/table-header-cell.d.ts.map +1 -1
  73. package/es/components/data-table/table-header-cell.js +67 -10
  74. package/es/components/data-table/table-header-cell.js.map +1 -1
  75. package/es/components/data-table/table-header-description.d.ts +21 -0
  76. package/es/components/data-table/table-header-description.d.ts.map +1 -0
  77. package/es/components/data-table/table-header-description.js +53 -0
  78. package/es/components/data-table/table-header-description.js.map +1 -0
  79. package/es/components/data-table/table-header-row.d.ts +3 -3
  80. package/es/components/data-table/table-header-row.d.ts.map +1 -1
  81. package/es/components/data-table/table-header-row.js +6 -6
  82. package/es/components/data-table/table-header-row.js.map +1 -1
  83. package/es/components/data-table/table-header-title.d.ts +21 -0
  84. package/es/components/data-table/table-header-title.d.ts.map +1 -0
  85. package/es/components/data-table/table-header-title.js +53 -0
  86. package/es/components/data-table/table-header-title.js.map +1 -0
  87. package/es/components/data-table/table-row.d.ts +413 -5
  88. package/es/components/data-table/table-row.d.ts.map +1 -1
  89. package/es/components/data-table/table-row.js +386 -45
  90. package/es/components/data-table/table-row.js.map +1 -1
  91. package/es/components/data-table/table-skeleton.d.ts +59 -0
  92. package/es/components/data-table/table-skeleton.d.ts.map +1 -0
  93. package/es/components/data-table/table-skeleton.js +259 -0
  94. package/es/components/data-table/table-skeleton.js.map +1 -0
  95. package/es/components/data-table/table-toolbar-content.d.ts +6 -2
  96. package/es/components/data-table/table-toolbar-content.d.ts.map +1 -1
  97. package/es/components/data-table/table-toolbar-content.js +21 -4
  98. package/es/components/data-table/table-toolbar-content.js.map +1 -1
  99. package/es/components/data-table/table-toolbar-search.d.ts +7 -3
  100. package/es/components/data-table/table-toolbar-search.d.ts.map +1 -1
  101. package/es/components/data-table/table-toolbar-search.js +25 -8
  102. package/es/components/data-table/table-toolbar-search.js.map +1 -1
  103. package/es/components/data-table/table-toolbar.d.ts +19 -2
  104. package/es/components/data-table/table-toolbar.d.ts.map +1 -1
  105. package/es/components/data-table/table-toolbar.js +68 -13
  106. package/es/components/data-table/table-toolbar.js.map +1 -1
  107. package/es/components/data-table/table.d.ts +556 -6
  108. package/es/components/data-table/table.d.ts.map +1 -1
  109. package/es/components/data-table/table.js +1012 -15
  110. package/es/components/data-table/table.js.map +1 -1
  111. package/es/components/dropdown/defs.d.ts +6 -6
  112. package/es/components/dropdown/defs.d.ts.map +1 -1
  113. package/es/components/dropdown/defs.js +2 -2
  114. package/es/components/dropdown/defs.js.map +1 -1
  115. package/es/components/dropdown/dropdown-item.d.ts.map +1 -1
  116. package/es/components/dropdown/dropdown-item.js +1 -1
  117. package/es/components/dropdown/dropdown-item.js.map +1 -1
  118. package/es/components/dropdown/dropdown.d.ts +9 -2
  119. package/es/components/dropdown/dropdown.d.ts.map +1 -1
  120. package/es/components/dropdown/dropdown.js +83 -62
  121. package/es/components/dropdown/dropdown.js.map +1 -1
  122. package/es/components/file-uploader/demo-file-uploader.d.ts +1 -1
  123. package/es/components/file-uploader/demo-file-uploader.d.ts.map +1 -1
  124. package/es/components/file-uploader/demo-file-uploader.js +38 -4
  125. package/es/components/file-uploader/demo-file-uploader.js.map +1 -1
  126. package/es/components/floating-menu/defs.d.ts +1 -39
  127. package/es/components/floating-menu/defs.d.ts.map +1 -1
  128. package/es/components/floating-menu/defs.js +2 -23
  129. package/es/components/floating-menu/defs.js.map +1 -1
  130. package/es/components/floating-menu/floating-menu-trigger.d.ts +3 -3
  131. package/es/components/floating-menu/floating-menu-trigger.d.ts.map +1 -1
  132. package/es/components/floating-menu/floating-menu.d.ts +11 -13
  133. package/es/components/floating-menu/floating-menu.d.ts.map +1 -1
  134. package/es/components/floating-menu/floating-menu.js +44 -54
  135. package/es/components/floating-menu/floating-menu.js.map +1 -1
  136. package/es/components/form/form-item.d.ts +2 -2
  137. package/es/components/form/form-item.d.ts.map +1 -1
  138. package/es/components/form/form-item.js +4 -4
  139. package/es/components/form/form-item.js.map +1 -1
  140. package/es/components/form-group/form-group.css.js +12 -0
  141. package/es/components/form-group/form-group.d.ts +44 -0
  142. package/es/components/form-group/form-group.d.ts.map +1 -0
  143. package/es/components/form-group/form-group.js +141 -0
  144. package/es/components/form-group/form-group.js.map +1 -0
  145. package/es/components/form-group/form-group.rtl.css.js +12 -0
  146. package/es/components/form-group/index.d.ts +11 -0
  147. package/es/components/form-group/index.d.ts.map +1 -0
  148. package/es/components/form-group/index.js +11 -0
  149. package/es/components/form-group/index.js.map +1 -0
  150. package/es/components/icon-button/icon-button.css.js +1 -1
  151. package/es/components/icon-button/icon-button.d.ts +1 -1
  152. package/es/components/icon-button/icon-button.d.ts.map +1 -1
  153. package/es/components/icon-button/icon-button.js +5 -3
  154. package/es/components/icon-button/icon-button.js.map +1 -1
  155. package/es/components/icon-button/icon-button.rtl.css.js +1 -1
  156. package/es/components/list/list.css.js +1 -1
  157. package/es/components/list/list.rtl.css.js +1 -1
  158. package/es/components/modal/defs.d.ts +3 -3
  159. package/es/components/modal/defs.d.ts.map +1 -1
  160. package/es/components/modal/defs.js +2 -2
  161. package/es/components/modal/defs.js.map +1 -1
  162. package/es/components/modal/index.d.ts +2 -1
  163. package/es/components/modal/index.d.ts.map +1 -1
  164. package/es/components/modal/index.js +2 -1
  165. package/es/components/modal/index.js.map +1 -1
  166. package/es/components/modal/modal-body-content.d.ts +21 -0
  167. package/es/components/modal/modal-body-content.d.ts.map +1 -0
  168. package/es/components/modal/modal-body-content.js +53 -0
  169. package/es/components/modal/modal-body-content.js.map +1 -0
  170. package/es/components/modal/modal-body.d.ts +2 -2
  171. package/es/components/modal/modal-body.d.ts.map +1 -1
  172. package/es/components/modal/modal-body.js +4 -4
  173. package/es/components/modal/modal-body.js.map +1 -1
  174. package/es/components/modal/modal-close-button.d.ts +5 -5
  175. package/es/components/modal/modal-close-button.d.ts.map +1 -1
  176. package/es/components/modal/modal-close-button.js +9 -9
  177. package/es/components/modal/modal-close-button.js.map +1 -1
  178. package/es/components/modal/modal-footer.d.ts +3 -3
  179. package/es/components/modal/modal-footer.d.ts.map +1 -1
  180. package/es/components/modal/modal-footer.js +13 -21
  181. package/es/components/modal/modal-footer.js.map +1 -1
  182. package/es/components/modal/modal-header.d.ts +2 -2
  183. package/es/components/modal/modal-header.d.ts.map +1 -1
  184. package/es/components/modal/modal-header.js +4 -4
  185. package/es/components/modal/modal-header.js.map +1 -1
  186. package/es/components/modal/modal-heading.d.ts +2 -2
  187. package/es/components/modal/modal-heading.d.ts.map +1 -1
  188. package/es/components/modal/modal-heading.js +4 -4
  189. package/es/components/modal/modal-heading.js.map +1 -1
  190. package/es/components/modal/modal-label.d.ts +2 -2
  191. package/es/components/modal/modal-label.d.ts.map +1 -1
  192. package/es/components/modal/modal-label.js +4 -4
  193. package/es/components/modal/modal-label.js.map +1 -1
  194. package/es/components/modal/modal.css.js +1 -1
  195. package/es/components/modal/modal.d.ts +33 -3
  196. package/es/components/modal/modal.d.ts.map +1 -1
  197. package/es/components/modal/modal.js +121 -14
  198. package/es/components/modal/modal.js.map +1 -1
  199. package/es/components/modal/modal.rtl.css.js +1 -1
  200. package/es/components/multi-select/defs.d.ts +27 -0
  201. package/es/components/multi-select/defs.d.ts.map +1 -0
  202. package/es/components/multi-select/defs.js +19 -0
  203. package/es/components/multi-select/defs.js.map +1 -0
  204. package/es/components/multi-select/multi-select-item.d.ts.map +1 -1
  205. package/es/components/multi-select/multi-select-item.js +9 -14
  206. package/es/components/multi-select/multi-select-item.js.map +1 -1
  207. package/es/components/multi-select/multi-select.css.js +1 -1
  208. package/es/components/multi-select/multi-select.d.ts +44 -5
  209. package/es/components/multi-select/multi-select.d.ts.map +1 -1
  210. package/es/components/multi-select/multi-select.js +250 -32
  211. package/es/components/multi-select/multi-select.js.map +1 -1
  212. package/es/components/multi-select/multi-select.rtl.css.js +1 -1
  213. package/es/components/number-input/number-input.css.js +1 -1
  214. package/es/components/number-input/number-input.d.ts.map +1 -1
  215. package/es/components/number-input/number-input.js +1 -1
  216. package/es/components/number-input/number-input.js.map +1 -1
  217. package/es/components/number-input/number-input.rtl.css.js +1 -1
  218. package/es/components/overflow-menu/defs.d.ts +4 -9
  219. package/es/components/overflow-menu/defs.d.ts.map +1 -1
  220. package/es/components/overflow-menu/defs.js +1 -4
  221. package/es/components/overflow-menu/defs.js.map +1 -1
  222. package/es/components/overflow-menu/overflow-menu-body.d.ts +16 -15
  223. package/es/components/overflow-menu/overflow-menu-body.d.ts.map +1 -1
  224. package/es/components/overflow-menu/overflow-menu-body.js +49 -28
  225. package/es/components/overflow-menu/overflow-menu-body.js.map +1 -1
  226. package/es/components/overflow-menu/overflow-menu-item.d.ts +12 -3
  227. package/es/components/overflow-menu/overflow-menu-item.d.ts.map +1 -1
  228. package/es/components/overflow-menu/overflow-menu-item.js +44 -12
  229. package/es/components/overflow-menu/overflow-menu-item.js.map +1 -1
  230. package/es/components/overflow-menu/overflow-menu.css.js +1 -1
  231. package/es/components/overflow-menu/overflow-menu.d.ts +22 -10
  232. package/es/components/overflow-menu/overflow-menu.d.ts.map +1 -1
  233. package/es/components/overflow-menu/overflow-menu.js +89 -40
  234. package/es/components/overflow-menu/overflow-menu.js.map +1 -1
  235. package/es/components/overflow-menu/overflow-menu.rtl.css.js +1 -1
  236. package/es/components/pagination/defs.d.ts +27 -0
  237. package/es/components/pagination/defs.d.ts.map +1 -0
  238. package/es/components/pagination/defs.js +19 -0
  239. package/es/components/pagination/defs.js.map +1 -0
  240. package/es/components/pagination/index.d.ts +1 -3
  241. package/es/components/pagination/index.d.ts.map +1 -1
  242. package/es/components/pagination/index.js +1 -3
  243. package/es/components/pagination/index.js.map +1 -1
  244. package/es/components/pagination/pagination.css.js +1 -1
  245. package/es/components/pagination/pagination.d.ts +55 -20
  246. package/es/components/pagination/pagination.d.ts.map +1 -1
  247. package/es/components/pagination/pagination.js +303 -123
  248. package/es/components/pagination/pagination.js.map +1 -1
  249. package/es/components/pagination/pagination.rtl.css.js +1 -1
  250. package/es/components/progress-indicator/progress-indicator-skeleton.d.ts +1 -2
  251. package/es/components/progress-indicator/progress-indicator-skeleton.d.ts.map +1 -1
  252. package/es/components/progress-indicator/progress-indicator-skeleton.js +5 -5
  253. package/es/components/progress-indicator/progress-indicator-skeleton.js.map +1 -1
  254. package/es/components/progress-indicator/progress-indicator.css.js +1 -1
  255. package/es/components/progress-indicator/progress-indicator.d.ts +8 -3
  256. package/es/components/progress-indicator/progress-indicator.d.ts.map +1 -1
  257. package/es/components/progress-indicator/progress-indicator.js +35 -8
  258. package/es/components/progress-indicator/progress-indicator.js.map +1 -1
  259. package/es/components/progress-indicator/progress-indicator.rtl.css.js +1 -1
  260. package/es/components/progress-indicator/progress-step-skeleton.d.ts +2 -2
  261. package/es/components/progress-indicator/progress-step-skeleton.d.ts.map +1 -1
  262. package/es/components/progress-indicator/progress-step-skeleton.js +12 -12
  263. package/es/components/progress-indicator/progress-step-skeleton.js.map +1 -1
  264. package/es/components/progress-indicator/progress-step.d.ts +11 -3
  265. package/es/components/progress-indicator/progress-step.d.ts.map +1 -1
  266. package/es/components/progress-indicator/progress-step.js +65 -24
  267. package/es/components/progress-indicator/progress-step.js.map +1 -1
  268. package/es/components/radio-button/radio-button.css.js +1 -1
  269. package/es/components/radio-button/radio-button.d.ts +4 -0
  270. package/es/components/radio-button/radio-button.d.ts.map +1 -1
  271. package/es/components/radio-button/radio-button.js +22 -0
  272. package/es/components/radio-button/radio-button.js.map +1 -1
  273. package/es/components/radio-button/radio-button.rtl.css.js +1 -1
  274. package/es/components/select/select.css.js +1 -1
  275. package/es/components/select/select.d.ts.map +1 -1
  276. package/es/components/select/select.js +3 -1
  277. package/es/components/select/select.js.map +1 -1
  278. package/es/components/select/select.rtl.css.js +1 -1
  279. package/es/components/slider/slider.css.js +1 -1
  280. package/es/components/slider/slider.rtl.css.js +1 -1
  281. package/es/components/stack/defs.d.ts +29 -0
  282. package/es/components/stack/defs.d.ts.map +1 -0
  283. package/es/components/stack/defs.js +31 -0
  284. package/es/components/stack/defs.js.map +1 -0
  285. package/es/components/stack/index.d.ts +11 -0
  286. package/es/components/stack/index.d.ts.map +1 -0
  287. package/es/components/stack/index.js +11 -0
  288. package/es/components/stack/index.js.map +1 -0
  289. package/es/components/stack/stack.css.js +12 -0
  290. package/es/components/stack/stack.d.ts +46 -0
  291. package/es/components/stack/stack.d.ts.map +1 -0
  292. package/es/components/stack/stack.js +116 -0
  293. package/es/components/stack/stack.js.map +1 -0
  294. package/es/components/stack/stack.rtl.css.js +12 -0
  295. package/es/components/structured-list/structured-list.css.js +1 -1
  296. package/es/components/structured-list/structured-list.d.ts +9 -0
  297. package/es/components/structured-list/structured-list.d.ts.map +1 -1
  298. package/es/components/structured-list/structured-list.js +47 -1
  299. package/es/components/structured-list/structured-list.js.map +1 -1
  300. package/es/components/structured-list/structured-list.rtl.css.js +1 -1
  301. package/es/components/tabs/tabs.css.js +1 -1
  302. package/es/components/tabs/tabs.rtl.css.js +1 -1
  303. package/es/components/text-input/defs.d.ts +38 -0
  304. package/es/components/text-input/defs.d.ts.map +1 -1
  305. package/es/components/text-input/defs.js +24 -3
  306. package/es/components/text-input/defs.js.map +1 -1
  307. package/es/components/text-input/text-input.d.ts +4 -5
  308. package/es/components/text-input/text-input.d.ts.map +1 -1
  309. package/es/components/text-input/text-input.js +5 -6
  310. package/es/components/text-input/text-input.js.map +1 -1
  311. package/es/components/textarea/textarea.d.ts.map +1 -1
  312. package/es/components/textarea/textarea.js +1 -1
  313. package/es/components/textarea/textarea.js.map +1 -1
  314. package/es/components/tile/expandable-tile.d.ts +1 -3
  315. package/es/components/tile/expandable-tile.d.ts.map +1 -1
  316. package/es/components/tile/expandable-tile.js +1 -1
  317. package/es/components/tile/expandable-tile.js.map +1 -1
  318. package/es/components/tile/radio-tile.d.ts.map +1 -1
  319. package/es/components/tile/radio-tile.js +2 -2
  320. package/es/components/tile/radio-tile.js.map +1 -1
  321. package/es/components/toggle-tip/toggletip.d.ts +1 -1
  322. package/es/components/toggle-tip/toggletip.d.ts.map +1 -1
  323. package/es/components/toggle-tip/toggletip.js +28 -3
  324. package/es/components/toggle-tip/toggletip.js.map +1 -1
  325. package/es/components/tooltip/tooltip.css.js +1 -1
  326. package/es/components/tooltip/tooltip.d.ts +12 -1
  327. package/es/components/tooltip/tooltip.d.ts.map +1 -1
  328. package/es/components/tooltip/tooltip.js +47 -1
  329. package/es/components/tooltip/tooltip.js.map +1 -1
  330. package/es/components/tooltip/tooltip.rtl.css.js +1 -1
  331. package/es/components/ui-shell/header-global-action.d.ts +31 -0
  332. package/es/components/ui-shell/header-global-action.d.ts.map +1 -0
  333. package/es/components/ui-shell/header-global-action.js +88 -0
  334. package/es/components/ui-shell/header-global-action.js.map +1 -0
  335. package/es/components/ui-shell/header-menu-button.d.ts +6 -6
  336. package/es/components/ui-shell/header-menu-button.d.ts.map +1 -1
  337. package/es/components/ui-shell/header-menu-button.js +10 -10
  338. package/es/components/ui-shell/header-menu-button.js.map +1 -1
  339. package/es/components/ui-shell/header-menu-item.d.ts +3 -3
  340. package/es/components/ui-shell/header-menu-item.d.ts.map +1 -1
  341. package/es/components/ui-shell/header-menu-item.js +6 -6
  342. package/es/components/ui-shell/header-menu-item.js.map +1 -1
  343. package/es/components/ui-shell/header-menu.d.ts +11 -3
  344. package/es/components/ui-shell/header-menu.d.ts.map +1 -1
  345. package/es/components/ui-shell/header-menu.js +47 -7
  346. package/es/components/ui-shell/header-menu.js.map +1 -1
  347. package/es/components/ui-shell/header-name.d.ts +3 -3
  348. package/es/components/ui-shell/header-name.d.ts.map +1 -1
  349. package/es/components/ui-shell/header-name.js +4 -4
  350. package/es/components/ui-shell/header-name.js.map +1 -1
  351. package/es/components/ui-shell/header-nav-item.d.ts +11 -3
  352. package/es/components/ui-shell/header-nav-item.d.ts.map +1 -1
  353. package/es/components/ui-shell/header-nav-item.js +39 -6
  354. package/es/components/ui-shell/header-nav-item.js.map +1 -1
  355. package/es/components/ui-shell/header-nav.d.ts +2 -2
  356. package/es/components/ui-shell/header-nav.d.ts.map +1 -1
  357. package/es/components/ui-shell/header-nav.js +5 -5
  358. package/es/components/ui-shell/header-nav.js.map +1 -1
  359. package/es/components/ui-shell/header-panel.d.ts +30 -0
  360. package/es/components/ui-shell/header-panel.d.ts.map +1 -0
  361. package/es/components/ui-shell/header-panel.js +72 -0
  362. package/es/components/ui-shell/header-panel.js.map +1 -0
  363. package/es/components/ui-shell/header-side-nav-items.d.ts +27 -0
  364. package/es/components/ui-shell/header-side-nav-items.d.ts.map +1 -0
  365. package/es/components/ui-shell/header-side-nav-items.js +80 -0
  366. package/es/components/ui-shell/header-side-nav-items.js.map +1 -0
  367. package/es/components/ui-shell/header.css.js +1 -1
  368. package/es/components/ui-shell/header.d.ts +2 -2
  369. package/es/components/ui-shell/header.d.ts.map +1 -1
  370. package/es/components/ui-shell/header.js +5 -5
  371. package/es/components/ui-shell/header.js.map +1 -1
  372. package/es/components/ui-shell/header.rtl.css.js +1 -1
  373. package/es/components/ui-shell/index.d.ts +5 -0
  374. package/es/components/ui-shell/index.d.ts.map +1 -1
  375. package/es/components/ui-shell/index.js +5 -0
  376. package/es/components/ui-shell/index.js.map +1 -1
  377. package/es/components/ui-shell/side-nav-divider.d.ts +2 -2
  378. package/es/components/ui-shell/side-nav-divider.d.ts.map +1 -1
  379. package/es/components/ui-shell/side-nav-divider.js +5 -5
  380. package/es/components/ui-shell/side-nav-divider.js.map +1 -1
  381. package/es/components/ui-shell/side-nav-items.d.ts +2 -2
  382. package/es/components/ui-shell/side-nav-items.d.ts.map +1 -1
  383. package/es/components/ui-shell/side-nav-items.js +6 -6
  384. package/es/components/ui-shell/side-nav-items.js.map +1 -1
  385. package/es/components/ui-shell/side-nav-link.d.ts +7 -3
  386. package/es/components/ui-shell/side-nav-link.d.ts.map +1 -1
  387. package/es/components/ui-shell/side-nav-link.js +18 -5
  388. package/es/components/ui-shell/side-nav-link.js.map +1 -1
  389. package/es/components/ui-shell/side-nav-menu-item.d.ts +3 -3
  390. package/es/components/ui-shell/side-nav-menu-item.d.ts.map +1 -1
  391. package/es/components/ui-shell/side-nav-menu-item.js +4 -4
  392. package/es/components/ui-shell/side-nav-menu-item.js.map +1 -1
  393. package/es/components/ui-shell/side-nav-menu.d.ts +7 -3
  394. package/es/components/ui-shell/side-nav-menu.d.ts.map +1 -1
  395. package/es/components/ui-shell/side-nav-menu.js +18 -5
  396. package/es/components/ui-shell/side-nav-menu.js.map +1 -1
  397. package/es/components/ui-shell/side-nav.css.js +1 -1
  398. package/es/components/ui-shell/side-nav.d.ts +35 -13
  399. package/es/components/ui-shell/side-nav.d.ts.map +1 -1
  400. package/es/components/ui-shell/side-nav.js +142 -48
  401. package/es/components/ui-shell/side-nav.js.map +1 -1
  402. package/es/components/ui-shell/side-nav.rtl.css.js +1 -1
  403. package/es/components/ui-shell/switcher-divider.d.ts +21 -0
  404. package/es/components/ui-shell/switcher-divider.d.ts.map +1 -0
  405. package/es/components/ui-shell/switcher-divider.js +56 -0
  406. package/es/components/ui-shell/switcher-divider.js.map +1 -0
  407. package/es/components/{pagination/page-sizes-select.d.ts → ui-shell/switcher-item.d.ts} +18 -22
  408. package/es/components/ui-shell/switcher-item.d.ts.map +1 -0
  409. package/es/components/ui-shell/switcher-item.js +162 -0
  410. package/es/components/ui-shell/switcher-item.js.map +1 -0
  411. package/es/components/ui-shell/switcher.d.ts +35 -0
  412. package/es/components/ui-shell/switcher.d.ts.map +1 -0
  413. package/es/components/ui-shell/switcher.js +95 -0
  414. package/es/components/ui-shell/switcher.js.map +1 -0
  415. package/es/components-react/code-snippet/code-snippet-skeleton.d.ts +2 -2
  416. package/es/components-react/code-snippet/code-snippet.d.ts +2 -2
  417. package/es/components-react/data-table/table-batch-actions.d.ts +2 -2
  418. package/es/components-react/data-table/table-body.d.ts +2 -2
  419. package/es/components-react/{pagination/pages-select.d.ts → data-table/table-cell-content.d.ts} +2 -6
  420. package/es/components-react/{pagination/pages-select.js → data-table/table-cell-content.js} +4 -10
  421. package/es/components-react/data-table/table-cell.d.ts +2 -2
  422. package/es/components-react/data-table/table-expanded-row.d.ts +2 -2
  423. package/es/components-react/data-table/table-head.d.ts +2 -2
  424. package/es/components-react/data-table/table-header-cell.d.ts +2 -2
  425. package/es/components-react/{pagination/page-sizes-select.d.ts → data-table/table-header-description.d.ts} +2 -6
  426. package/es/components-react/{pagination/page-sizes-select.js → data-table/table-header-description.js} +4 -10
  427. package/es/components-react/data-table/table-header-row.d.ts +2 -2
  428. package/es/components-react/data-table/table-header-title.d.ts +15 -0
  429. package/es/components-react/data-table/{table-header-cell-skeleton.js → table-header-title.js} +4 -6
  430. package/es/components-react/data-table/table-row.d.ts +19 -2
  431. package/es/components-react/data-table/table-row.js +16 -0
  432. package/es/components-react/data-table/table-skeleton.d.ts +15 -0
  433. package/es/components-react/data-table/table-skeleton.js +21 -0
  434. package/es/components-react/data-table/table-toolbar-content.d.ts +2 -2
  435. package/es/components-react/data-table/table-toolbar-search.d.ts +2 -2
  436. package/es/components-react/data-table/table-toolbar.d.ts +2 -2
  437. package/es/components-react/data-table/table.d.ts +44 -2
  438. package/es/components-react/data-table/table.js +45 -3
  439. package/es/components-react/file-uploader/demo-file-uploader.d.ts +0 -49
  440. package/es/components-react/file-uploader/demo-file-uploader.js +3 -51
  441. package/es/components-react/floating-menu/floating-menu.d.ts +2 -2
  442. package/es/components-react/floating-menu/floating-menu.js +0 -2
  443. package/es/components-react/form/form-item.d.ts +2 -2
  444. package/es/components-react/form-group/form-group.d.ts +15 -0
  445. package/es/components-react/form-group/form-group.js +21 -0
  446. package/es/components-react/form-group/index.d.ts +14 -0
  447. package/es/components-react/form-group/index.js +8 -0
  448. package/es/components-react/modal/modal-body-content.d.ts +15 -0
  449. package/es/components-react/modal/modal-body-content.js +21 -0
  450. package/es/components-react/modal/modal-body.d.ts +2 -2
  451. package/es/components-react/modal/modal-close-button.d.ts +2 -2
  452. package/es/components-react/modal/modal-footer.d.ts +2 -2
  453. package/es/components-react/modal/modal-header.d.ts +2 -2
  454. package/es/components-react/modal/modal-heading.d.ts +2 -2
  455. package/es/components-react/modal/modal-label.d.ts +2 -2
  456. package/es/components-react/modal/modal.d.ts +2 -2
  457. package/es/components-react/multi-select/defs.d.ts +14 -0
  458. package/es/components-react/multi-select/defs.js +9 -0
  459. package/es/components-react/multi-select/multi-select.js +6 -1
  460. package/es/components-react/overflow-menu/overflow-menu-body.d.ts +2 -2
  461. package/es/components-react/overflow-menu/overflow-menu-item.d.ts +2 -2
  462. package/es/components-react/overflow-menu/overflow-menu.d.ts +4 -5
  463. package/es/components-react/overflow-menu/overflow-menu.js +5 -3
  464. package/es/components-react/pagination/defs.d.ts +14 -0
  465. package/es/components-react/pagination/defs.js +9 -0
  466. package/es/components-react/pagination/pagination.d.ts +3 -7
  467. package/es/components-react/pagination/pagination.js +3 -7
  468. package/es/components-react/progress-indicator/progress-indicator-skeleton.d.ts +2 -3
  469. package/es/components-react/progress-indicator/progress-indicator.d.ts +2 -3
  470. package/es/components-react/progress-indicator/progress-step-skeleton.d.ts +2 -3
  471. package/es/components-react/progress-indicator/progress-step.d.ts +2 -3
  472. package/es/components-react/stack/defs.d.ts +14 -0
  473. package/es/components-react/stack/defs.js +9 -0
  474. package/es/components-react/stack/index.d.ts +14 -0
  475. package/es/components-react/stack/index.js +8 -0
  476. package/es/components-react/stack/stack.d.ts +15 -0
  477. package/es/components-react/stack/stack.js +22 -0
  478. package/es/components-react/text-input/text-input.js +7 -1
  479. package/es/components-react/toggle-tip/toggletip.d.ts +0 -5
  480. package/es/components-react/toggle-tip/toggletip.js +3 -13
  481. package/es/components-react/{data-table/table-cell-skeleton.d.ts → ui-shell/header-global-action.d.ts} +3 -3
  482. package/es/components-react/{data-table/table-cell-skeleton.js → ui-shell/header-global-action.js} +4 -4
  483. package/es/components-react/ui-shell/header-menu-button.d.ts +2 -2
  484. package/es/components-react/ui-shell/header-menu-item.d.ts +2 -2
  485. package/es/components-react/ui-shell/header-menu.d.ts +2 -2
  486. package/es/components-react/ui-shell/header-name.d.ts +2 -2
  487. package/es/components-react/ui-shell/header-nav-item.d.ts +2 -2
  488. package/es/components-react/ui-shell/header-nav.d.ts +2 -2
  489. package/es/components-react/ui-shell/header-panel.d.ts +15 -0
  490. package/es/components-react/ui-shell/header-panel.js +21 -0
  491. package/es/components-react/ui-shell/header-side-nav-items.d.ts +15 -0
  492. package/es/components-react/ui-shell/header-side-nav-items.js +21 -0
  493. package/es/components-react/ui-shell/header.d.ts +2 -2
  494. package/es/components-react/ui-shell/side-nav-divider.d.ts +2 -2
  495. package/es/components-react/ui-shell/side-nav-items.d.ts +2 -2
  496. package/es/components-react/ui-shell/side-nav-link.d.ts +2 -2
  497. package/es/components-react/ui-shell/side-nav-menu-item.d.ts +2 -2
  498. package/es/components-react/ui-shell/side-nav-menu.d.ts +2 -2
  499. package/es/components-react/ui-shell/side-nav.d.ts +2 -2
  500. package/es/components-react/ui-shell/switcher-divider.d.ts +15 -0
  501. package/es/components-react/ui-shell/switcher-divider.js +21 -0
  502. package/es/components-react/ui-shell/switcher-item.d.ts +15 -0
  503. package/es/components-react/ui-shell/switcher-item.js +21 -0
  504. package/es/components-react/ui-shell/switcher.d.ts +15 -0
  505. package/es/components-react/ui-shell/switcher.js +21 -0
  506. package/es/icons/arrow--down/16.js +1 -1
  507. package/es/icons/arrow--down/32.js +1 -1
  508. package/es/icons/arrows--vertical/16.js +1 -1
  509. package/es/icons/arrows--vertical/32.js +1 -1
  510. package/es/icons/overflow-menu--vertical/16.js +1 -1
  511. package/es/index.d.ts +12 -2
  512. package/es/index.d.ts.map +1 -1
  513. package/es/index.js +12 -2
  514. package/es/index.js.map +1 -1
  515. package/lib/components/data-table/defs.js +1 -10
  516. package/lib/components/data-table/defs.js.map +1 -1
  517. package/lib/components/dropdown/defs.js +2 -2
  518. package/lib/components/dropdown/defs.js.map +1 -1
  519. package/lib/components/floating-menu/defs.js +3 -24
  520. package/lib/components/floating-menu/defs.js.map +1 -1
  521. package/lib/components/modal/defs.js +2 -2
  522. package/lib/components/modal/defs.js.map +1 -1
  523. package/lib/components/multi-select/defs.js +25 -0
  524. package/lib/components/multi-select/defs.js.map +1 -0
  525. package/lib/components/overflow-menu/defs.js +2 -11
  526. package/lib/components/overflow-menu/defs.js.map +1 -1
  527. package/lib/components/pagination/defs.js +25 -0
  528. package/lib/components/pagination/defs.js.map +1 -0
  529. package/lib/components/stack/defs.js +36 -0
  530. package/lib/components/stack/defs.js.map +1 -0
  531. package/lib/components/text-input/defs.js +25 -4
  532. package/lib/components/text-input/defs.js.map +1 -1
  533. package/lib/components-react-node/{pagination/pages-select.js → data-table/table-cell-content.js} +3 -9
  534. package/lib/components-react-node/{pagination/page-sizes-select.js → data-table/table-header-description.js} +3 -9
  535. package/lib/components-react-node/data-table/{table-cell-skeleton.js → table-header-title.js} +3 -4
  536. package/lib/components-react-node/data-table/table-row.js +16 -0
  537. package/lib/components-react-node/data-table/{table-header-cell-skeleton.js → table-skeleton.js} +3 -4
  538. package/lib/components-react-node/data-table/table.js +44 -8
  539. package/lib/components-react-node/file-uploader/demo-file-uploader.js +3 -89
  540. package/lib/components-react-node/floating-menu/floating-menu.js +0 -12
  541. package/lib/components-react-node/form-group/form-group.js +36 -0
  542. package/lib/components-react-node/form-group/index.js +9 -0
  543. package/lib/components-react-node/modal/modal-body-content.js +36 -0
  544. package/lib/components-react-node/multi-select/defs.js +24 -0
  545. package/lib/components-react-node/multi-select/multi-select.js +13 -0
  546. package/lib/components-react-node/overflow-menu/overflow-menu.js +3 -8
  547. package/lib/components-react-node/pagination/defs.js +24 -0
  548. package/lib/components-react-node/pagination/pagination.js +3 -7
  549. package/lib/components-react-node/stack/defs.js +24 -0
  550. package/lib/components-react-node/stack/index.js +9 -0
  551. package/lib/components-react-node/stack/stack.js +49 -0
  552. package/lib/components-react-node/text-input/text-input.js +12 -0
  553. package/lib/components-react-node/toggle-tip/toggletip.js +3 -51
  554. package/lib/components-react-node/ui-shell/header-global-action.js +37 -0
  555. package/lib/components-react-node/ui-shell/header-panel.js +36 -0
  556. package/lib/components-react-node/ui-shell/header-side-nav-items.js +36 -0
  557. package/lib/components-react-node/ui-shell/switcher-divider.js +36 -0
  558. package/lib/components-react-node/ui-shell/switcher-item.js +36 -0
  559. package/lib/components-react-node/ui-shell/switcher.js +36 -0
  560. package/package.json +6 -7
  561. package/scss/components/button/button.scss +48 -1
  562. package/scss/components/checkbox/checkbox.scss +16 -0
  563. package/scss/components/code-snippet/code-snippet.scss +82 -101
  564. package/scss/components/copy-button/copy-button.scss +17 -0
  565. package/scss/components/data-table/_table-action.scss +50 -32
  566. package/scss/components/data-table/_table-core.scss +253 -29
  567. package/scss/components/data-table/_table-expandable.scss +25 -32
  568. package/scss/components/data-table/_table-selection.scss +36 -20
  569. package/scss/components/data-table/_table-sizes.scss +162 -20
  570. package/scss/components/data-table/_table-sort.scss +5 -21
  571. package/scss/components/data-table/data-table.scss +4 -3
  572. package/scss/components/form-group/form-group.scss +23 -0
  573. package/scss/components/modal/modal.scss +61 -87
  574. package/scss/components/multi-select/multi-select.scss +54 -19
  575. package/scss/components/overflow-menu/overflow-menu.scss +21 -9
  576. package/scss/components/pagination/pagination.scss +0 -66
  577. package/scss/components/progress-indicator/progress-indicator.scss +11 -10
  578. package/scss/components/radio-button/radio-button.scss +11 -1
  579. package/scss/components/select/select.scss +28 -1
  580. package/scss/components/stack/stack.scss +33 -0
  581. package/scss/components/structured-list/structured-list.scss +90 -20
  582. package/scss/components/tooltip/tooltip.scss +26 -0
  583. package/scss/components/ui-shell/header.scss +69 -0
  584. package/scss/components/ui-shell/side-nav.scss +27 -49
  585. package/es/components/data-table/table-cell-skeleton.d.ts +0 -20
  586. package/es/components/data-table/table-cell-skeleton.d.ts.map +0 -1
  587. package/es/components/data-table/table-cell-skeleton.js +0 -42
  588. package/es/components/data-table/table-cell-skeleton.js.map +0 -1
  589. package/es/components/data-table/table-expand-row.d.ts +0 -371
  590. package/es/components/data-table/table-expand-row.d.ts.map +0 -1
  591. package/es/components/data-table/table-expand-row.js +0 -192
  592. package/es/components/data-table/table-expand-row.js.map +0 -1
  593. package/es/components/data-table/table-header-cell-skeleton.d.ts +0 -19
  594. package/es/components/data-table/table-header-cell-skeleton.d.ts.map +0 -1
  595. package/es/components/data-table/table-header-cell-skeleton.js +0 -33
  596. package/es/components/data-table/table-header-cell-skeleton.js.map +0 -1
  597. package/es/components/data-table/table-header-expand-row.d.ts +0 -33
  598. package/es/components/data-table/table-header-expand-row.d.ts.map +0 -1
  599. package/es/components/data-table/table-header-expand-row.js +0 -68
  600. package/es/components/data-table/table-header-expand-row.js.map +0 -1
  601. package/es/components/pagination/page-sizes-select.d.ts.map +0 -1
  602. package/es/components/pagination/page-sizes-select.js +0 -172
  603. package/es/components/pagination/page-sizes-select.js.map +0 -1
  604. package/es/components/pagination/pages-select.d.ts +0 -362
  605. package/es/components/pagination/pages-select.d.ts.map +0 -1
  606. package/es/components/pagination/pages-select.js +0 -185
  607. package/es/components/pagination/pages-select.js.map +0 -1
  608. package/es/components-react/data-table/table-expand-row.d.ts +0 -24
  609. package/es/components-react/data-table/table-expand-row.js +0 -33
  610. package/es/components-react/data-table/table-header-cell-skeleton.d.ts +0 -14
  611. package/es/components-react/data-table/table-header-expand-row.d.ts +0 -29
  612. package/es/components-react/data-table/table-header-expand-row.js +0 -37
  613. package/lib/components-react-node/data-table/table-expand-row.js +0 -47
  614. package/lib/components-react-node/data-table/table-header-expand-row.js +0 -51
  615. package/scss/components/data-table/_table-skeleton.scss +0 -27
@@ -1 +1 @@
1
- {"version":3,"file":"demo-file-uploader.js","names":["html","property","LitElement","customElement","delay","prefix","ifDefined","FILE_UPLOADER_ITEM_STATE","BUTTON_SIZE","CDSCEDemoFileUploader","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","key","value","_handleChange","event","addedFiles","detail","newFiles","map","item","id","Math","random","toString","slice","file","state","UPLOADING","multiple","_files","files","_simulateUpload","simulateUpload","concat","requestUpdate","forEach","length","_handleDelete","fileId","idToDelete","target","dataset","filter","data","size","_objectSpread","EDIT","invalid","errorSubject","errorBody","rand","COMPLETE","decorators","type","Boolean","reflect","attribute","MEDIUM","render","accept","button","buttonKind","buttonLabel","disabled","labelDescription","labelTitle","inputState","iconDescription","handleChange","handleDelete","_t","_","_t2","inputName","_t3","_t4","name","default"],"sources":["components/file-uploader/demo-file-uploader.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, property, LitElement, customElement } from 'lit-element';\n\nimport { delay } from 'bluebird';\nimport { prefix } from '../../globals/settings';\nimport { ifDefined } from 'lit/directives/if-defined';\nimport './index';\nimport { FILE_UPLOADER_ITEM_STATE } from './file-uploader-item';\nimport { BUTTON_SIZE } from '../button/button';\nimport { FileData } from './stories/types';\n\n/**\n * A class to manage file uploading states, like sending file contents to server.\n * DEMONSTRATION-PURPOSE ONLY.\n * Data/state handling in file uploading tends to involve lots of application-specific logics\n * and thus abstracting everything in a library won't be a good return on investment\n * vs. letting users copy code here and implement features that fit their needs.\n */\n@customElement(`${prefix}-ce-demo-file-uploader`)\nexport default class CDSCEDemoFileUploader extends LitElement {\n /**\n * The files being uploaded.\n */\n private _files: FileData[] = [];\n\n /**\n * Handles `cds-drop-container-changed` on `<cds-file-drop-container>`.\n *\n * @param event The event.\n */\n private _handleChange(event: CustomEvent) {\n const { addedFiles } = event.detail;\n const newFiles: FileData[] = addedFiles.map(\n (item) =>\n ({\n id: Math.random().toString(36).slice(2),\n file: item,\n state: FILE_UPLOADER_ITEM_STATE.UPLOADING,\n } as FileData)\n );\n const { multiple, _files: files, _simulateUpload: simulateUpload } = this;\n if (multiple) {\n this._files = files.concat(newFiles);\n this.requestUpdate();\n newFiles.forEach(simulateUpload, this);\n } else if (addedFiles.length > 0) {\n this._files = files.concat(newFiles[0]);\n this.requestUpdate();\n this._simulateUpload(newFiles[0]);\n }\n }\n\n /**\n * Handles `cds-file-uploader-item-deleted` on `<cds-file-uploader-item>`.\n *\n * @param event The event.\n */\n private _handleDelete(event: CustomEvent) {\n const { fileId: idToDelete } = (event.target as HTMLElement).dataset;\n this._files = this._files.filter(({ id }) => idToDelete !== id);\n this.requestUpdate();\n }\n\n /**\n * Simulates updating file.\n *\n * @param data The data of the file being uploaded.\n */\n private async _simulateUpload(data: FileData) {\n const { id, file } = data;\n if (file.size > 524288) {\n this._files = this._files.map((item) =>\n id !== item.id\n ? item\n : {\n ...item,\n state: FILE_UPLOADER_ITEM_STATE.EDIT,\n invalid: true,\n errorSubject: 'File size exceeds limit',\n errorBody:\n '500kb max file size. Select a new file and try again.',\n }\n );\n this.requestUpdate();\n } else {\n // Simulates network request time\n const rand = Math.random() * 1000;\n await delay(rand);\n this._files = this._files.map((item) =>\n id !== item.id\n ? item\n : {\n ...item,\n state: FILE_UPLOADER_ITEM_STATE.COMPLETE,\n }\n );\n this.requestUpdate();\n // Shows x icon after 1 second\n await delay(1000);\n this._files = this._files.map((item) =>\n id !== item.id\n ? item\n : {\n ...item,\n state: FILE_UPLOADER_ITEM_STATE.EDIT,\n }\n );\n this.requestUpdate();\n }\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 the drop container should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n button = false;\n\n /**\n * Button kind.\n */\n @property({ attribute: 'button-kind' })\n buttonKind = 'primary';\n\n /**\n * Button label.\n */\n @property({ attribute: 'button-label' })\n buttonLabel = 'Add file';\n\n /**\n * `true` if the drop container should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Icon description.\n */\n @property({ attribute: 'icon-description' })\n iconDescription = '';\n\n /**\n * The input name.\n */\n @property({ attribute: 'input-name' })\n inputName = '';\n\n /**\n * The label description text.\n */\n @property({ attribute: 'label-description' })\n labelDescription = '';\n\n /**\n * The label title.\n */\n @property({ attribute: 'label-title' })\n labelTitle = '';\n\n /**\n * `true` if the 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 size of the button item.\n */\n @property({ reflect: true })\n size = BUTTON_SIZE.MEDIUM;\n\n /**\n * The state of this file uploader item.\n */\n @property({ reflect: true, attribute: 'input-state' })\n inputState = '';\n\n render() {\n const {\n accept,\n button,\n buttonKind,\n buttonLabel,\n disabled,\n labelDescription,\n labelTitle,\n multiple,\n size,\n inputState,\n iconDescription,\n _files: files,\n _handleChange: handleChange,\n _handleDelete: handleDelete,\n } = this;\n return html`\n <cds-file-uploader\n label-description=\"${ifDefined(labelDescription)}\"\n label-title=\"${ifDefined(labelTitle)}\"\n ?disabled=\"${disabled}\">\n ${!button\n ? html` <cds-file-uploader-drop-container\n accept=\"${ifDefined(accept)}\"\n ?multiple=\"${multiple}\"\n name=\"${ifDefined(this.inputName)}\"\n @cds-file-uploader-drop-container-changed=\"${handleChange}\">\n Drag and drop files here or click to upload\n </cds-file-uploader-drop-container>`\n : html` <cds-file-uploader-button\n size=\"${ifDefined(size)}\"\n button-kind=\"${buttonKind}\"\n accept=\"${ifDefined(accept)}\"\n name=\"${ifDefined(this.inputName)}\"\n ?multiple=\"${multiple}\"\n @cds-file-uploader-button-changed=\"${handleChange}\">\n ${buttonLabel}\n </cds-file-uploader-button>`}\n ${files.map(\n ({ id, invalid, file, state, errorSubject, errorBody }) => html`\n <cds-file-uploader-item\n data-file-id=\"${id}\"\n ?invalid=\"${invalid}\"\n state=\"${inputState || ifDefined(state)}\"\n icon-description=\"${ifDefined(iconDescription)}\"\n error-subject=\"${ifDefined(errorSubject)}\"\n error-body=\"${ifDefined(errorBody)}\"\n @cds-file-uploader-item-deleted=\"${handleDelete}\">\n ${file.name}\n </cds-file-uploader-item>\n `\n )}\n </cds-file-uploader>\n `;\n }\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,aAAa,QAAQ,aAAa;AAEvE,SAASC,KAAK,QAAQ,UAAU;A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AKxD,IAAI,CAAAkF,GAAA,KAAAA,GAAA,GAAAJ,CAAA,qNAE3CnD,EAAE,EACN2B,OAAO,EACVmB,UAAU,IAAInE,SAAS,CAAC2B,KAAK,CAAC,EACnB3B,SAAS,CAACoE,eAAe,CAAC,EAC7BpE,SAAS,CAACiD,YAAY,CAAC,EAC1BjD,SAAS,CAACkD,SAAS,CAAC,EACCoB,YAAY,EAC7C5C,IAAI,CAACmD,IAAI,CAEd,CACF;MAGP;IAAC;EAAA;AAAA,GA5NgDjF,UAAU;AAAA,SAAxCO,qBAAqB,IAAA2E,OAAA"}
1
+ {"version":3,"file":"demo-file-uploader.js","names":["html","LitElement","customElement","property","delay","prefix","ifDefined","FILE_UPLOADER_ITEM_STATE","BUTTON_SIZE","CDSCEDemoFileUploader","_decorate","_initialize","_LitElement","constructor","args","F","d","kind","key","value","_handleChange","event","addedFiles","detail","newFiles","map","item","id","Math","random","toString","slice","file","state","UPLOADING","multiple","_files","files","_simulateUpload","simulateUpload","concat","requestUpdate","forEach","length","_handleDelete","fileId","idToDelete","target","dataset","filter","data","size","_objectSpread","EDIT","invalid","errorSubject","errorBody","rand","COMPLETE","decorators","type","Boolean","reflect","attribute","MEDIUM","render","accept","button","buttonKind","buttonLabel","disabled","labelDescription","labelTitle","inputState","iconDescription","handleChange","handleDelete","_t","_","_t2","inputName","_t3","_t4","name","default"],"sources":["components/file-uploader/demo-file-uploader.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\n\nimport { delay } from 'bluebird';\nimport { prefix } from '../../globals/settings';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport './index';\nimport { FILE_UPLOADER_ITEM_STATE } from './file-uploader-item';\nimport { BUTTON_SIZE } from '../button/button';\nimport { FileData } from './stories/types';\n\n/**\n * A class to manage file uploading states, like sending file contents to server.\n * DEMONSTRATION-PURPOSE ONLY.\n * Data/state handling in file uploading tends to involve lots of application-specific logics\n * and thus abstracting everything in a library won't be a good return on investment\n * vs. letting users copy code here and implement features that fit their needs.\n */\n@customElement(`${prefix}-ce-demo-file-uploader`)\nexport default class CDSCEDemoFileUploader extends LitElement {\n /**\n * The files being uploaded.\n */\n private _files: FileData[] = [];\n\n /**\n * Handles `cds-drop-container-changed` on `<cds-file-drop-container>`.\n *\n * @param event The event.\n */\n private _handleChange(event: CustomEvent) {\n const { addedFiles } = event.detail;\n const newFiles: FileData[] = addedFiles.map(\n (item) =>\n ({\n id: Math.random().toString(36).slice(2),\n file: item,\n state: FILE_UPLOADER_ITEM_STATE.UPLOADING,\n } as FileData)\n );\n const { multiple, _files: files, _simulateUpload: simulateUpload } = this;\n if (multiple) {\n this._files = files.concat(newFiles);\n this.requestUpdate();\n newFiles.forEach(simulateUpload, this);\n } else if (addedFiles.length > 0) {\n this._files = files.concat(newFiles[0]);\n this.requestUpdate();\n this._simulateUpload(newFiles[0]);\n }\n }\n\n /**\n * Handles `cds-file-uploader-item-deleted` on `<cds-file-uploader-item>`.\n *\n * @param event The event.\n */\n private _handleDelete(event: CustomEvent) {\n const { fileId: idToDelete } = (event.target as HTMLElement).dataset;\n this._files = this._files.filter(({ id }) => idToDelete !== id);\n this.requestUpdate();\n }\n\n /**\n * Simulates updating file.\n *\n * @param data The data of the file being uploaded.\n */\n private async _simulateUpload(data: FileData) {\n const { id, file } = data;\n if (file.size > 524288) {\n this._files = this._files.map((item) =>\n id !== item.id\n ? item\n : {\n ...item,\n state: FILE_UPLOADER_ITEM_STATE.EDIT,\n invalid: true,\n errorSubject: 'File size exceeds limit',\n errorBody:\n '500kb max file size. Select a new file and try again.',\n }\n );\n this.requestUpdate();\n } else {\n // Simulates network request time\n const rand = Math.random() * 1000;\n await delay(rand);\n this._files = this._files.map((item) =>\n id !== item.id\n ? item\n : {\n ...item,\n state: FILE_UPLOADER_ITEM_STATE.COMPLETE,\n }\n );\n this.requestUpdate();\n // Shows x icon after 1 second\n await delay(1000);\n this._files = this._files.map((item) =>\n id !== item.id\n ? item\n : {\n ...item,\n state: FILE_UPLOADER_ITEM_STATE.EDIT,\n }\n );\n this.requestUpdate();\n }\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 the drop container should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n button = false;\n\n /**\n * Button kind.\n */\n @property({ attribute: 'button-kind' })\n buttonKind = 'primary';\n\n /**\n * Button label.\n */\n @property({ attribute: 'button-label' })\n buttonLabel = 'Add file';\n\n /**\n * `true` if the drop container should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Icon description.\n */\n @property({ attribute: 'icon-description' })\n iconDescription = '';\n\n /**\n * The input name.\n */\n @property({ attribute: 'input-name' })\n inputName = '';\n\n /**\n * The label description text.\n */\n @property({ attribute: 'label-description' })\n labelDescription = '';\n\n /**\n * The label title.\n */\n @property({ attribute: 'label-title' })\n labelTitle = '';\n\n /**\n * `true` if the 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 size of the button item.\n */\n @property({ reflect: true })\n size = BUTTON_SIZE.MEDIUM;\n\n /**\n * The state of this file uploader item.\n */\n @property({ reflect: true, attribute: 'input-state' })\n inputState = '';\n\n render() {\n const {\n accept,\n button,\n buttonKind,\n buttonLabel,\n disabled,\n labelDescription,\n labelTitle,\n multiple,\n size,\n inputState,\n iconDescription,\n _files: files,\n _handleChange: handleChange,\n _handleDelete: handleDelete,\n } = this;\n return html`\n <cds-file-uploader\n label-description=\"${ifDefined(labelDescription)}\"\n label-title=\"${ifDefined(labelTitle)}\"\n ?disabled=\"${disabled}\">\n ${!button\n ? html` <cds-file-uploader-drop-container\n accept=\"${ifDefined(accept)}\"\n ?multiple=\"${multiple}\"\n name=\"${ifDefined(this.inputName)}\"\n @cds-file-uploader-drop-container-changed=\"${handleChange}\">\n Drag and drop files here or click to upload\n </cds-file-uploader-drop-container>`\n : html` <cds-file-uploader-button\n size=\"${ifDefined(size)}\"\n button-kind=\"${buttonKind}\"\n accept=\"${ifDefined(accept)}\"\n name=\"${ifDefined(this.inputName)}\"\n ?multiple=\"${multiple}\"\n @cds-file-uploader-button-changed=\"${handleChange}\">\n ${buttonLabel}\n </cds-file-uploader-button>`}\n ${files.map(\n ({ id, invalid, file, state, errorSubject, errorBody }) => html`\n <cds-file-uploader-item\n data-file-id=\"${id}\"\n ?invalid=\"${invalid}\"\n state=\"${inputState || ifDefined(state)}\"\n icon-description=\"${ifDefined(iconDescription)}\"\n error-subject=\"${ifDefined(errorSubject)}\"\n error-body=\"${ifDefined(errorBody)}\"\n @cds-file-uploader-item-deleted=\"${handleDelete}\">\n ${file.name}\n </cds-file-uploader-item>\n `\n )}\n </cds-file-uploader>\n `;\n }\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,IAAI,EAAEC,UAAU,QAAQ,KAAK;AACtC,SAASC,aAAa,EAAEC,QAAQ,QAAQ,mBAAmB;AAE3D,SAASC,KAAK,QAAQ,UAAU;AAChC,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,SAAS,QAAQ,8BAA8B;AACxD,OAAO,SAAS;AAChB,SAASC,wBAAwB,QAAQ,sBAAsB;AAC/D,SAASC,WAAW,QAAQ,kBAAkB;AAG9C;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAQqBC,qBAAqB,GAAAC,SAAA,EADzCR,aAAa,CAAE,GAAEG,MAAO,wBAAuB,CAAC,aAAAM,WAAA,EAAAC,WAAA;EAAjD,MACqBH,qBAAqB,SAAAG,WAAA,CAAoB;IAAAC,YAAA,GAAAC,IAAA;MAAA,SAAAA,IAAA;MAAAH,WAAA;IAAA;EA6N9D;EAAC;IAAAI,CAAA,EA7NoBN,qB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;AAC1E;AACA,8BAA4B,CAAK;AACjC,0BAAwB,CAAU;AAClC,uBAAqB,CAAiC;AACtD,kCAAgC,CAA6B;AAC7D,+BAA6B,CAA0B;AACvD,4BAA0B,CAAuB;AACjD,iDAA+C,CAAe;AAC9D,gBAAc,CAAY;AAC1B;AACA,WAAU,GAToBnD,EAAE,EACN2B,OAAO,EACVmB,UAAU,IAAInE,SAAS,CAAC2B,KAAK,CAAC,EACnB3B,SAAS,CAACoE,eAAe,CAAC,EAC7BpE,SAAS,CAACiD,YAAY,CAAC,EAC1BjD,SAAS,CAACkD,SAAS,CAAC,EACCoB,YAAY,EAC7C5C,IAAI,CAACmD,IAAI,CAEd,CACF;MAGP;IAAC;EAAA;AAAA,GA5NgDlF,UAAU;AAAA,SAAxCQ,qBAAqB,IAAA2E,OAAA"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2020
4
+ * Copyright IBM Corp. 2020, 2023
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -19,56 +19,18 @@ export declare enum FLOATING_MENU_POSITION_DIRECTION {
19
19
  */
20
20
  RTL = "rtl"
21
21
  }
22
- /**
23
- * The alignment choices of floating menu.
24
- */
25
- export declare enum FLOATING_MENU_ALIGNMENT {
26
- /**
27
- * Align the top/left position menu body to the one of its trigger button.
28
- */
29
- START = "start",
30
- /**
31
- * Align the center position menu body to the one of its trigger button.
32
- */
33
- CENTER = "center",
34
- /**
35
- * Align the bottom/right position menu body to the one of its trigger button.
36
- */
37
- END = "end"
38
- }
39
22
  /**
40
23
  * The direction/positioning/orientation choices of floating menu.
41
24
  */
42
25
  export declare enum FLOATING_MENU_DIRECTION {
43
- /**
44
- * Put menu body at the left of its trigger button.
45
- */
46
- LEFT = "left",
47
26
  /**
48
27
  * Put menu body at the top of its trigger button.
49
28
  */
50
29
  TOP = "top",
51
- /**
52
- * Put menu body at the right of its trigger button.
53
- */
54
- RIGHT = "right",
55
30
  /**
56
31
  * Put menu body at the bottom of its trigger button.
57
32
  */
58
33
  BOTTOM = "bottom"
59
34
  }
60
- /**
61
- * The group of the direction/positioning/orientation choices of floating menu.
62
- */
63
- export declare enum FLOATING_MENU_DIRECTION_GROUP {
64
- /**
65
- * Put menu body at the left/right of its trigger button.
66
- */
67
- HORIZONTAL = "horizontal",
68
- /**
69
- * Put menu body at the top/bottom of its trigger button.
70
- */
71
- VERTICAL = "vertical"
72
- }
73
35
 
74
36
  //# sourceMappingURL=defs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"sources":["components/floating-menu/defs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,oBAAY,gCAAgC;IAC1C;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,GAAG,QAAQ;CACZ;AAED;;GAEG;AACH,oBAAY,uBAAuB;IACjC;;OAEG;IACH,KAAK,UAAU;IAEf;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,GAAG,QAAQ;CACZ;AAED;;GAEG;AACH,oBAAY,uBAAuB;IACjC;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,KAAK,UAAU;IAEf;;OAEG;IACH,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,oBAAY,6BAA6B;IACvC;;OAEG;IACH,UAAU,eAAe;IAEzB;;OAEG;IACH,QAAQ,aAAa;CACtB","file":"defs.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020\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\n/**\n * The LTR/RTL direction used for positioning floating menu.\n */\nexport enum FLOATING_MENU_POSITION_DIRECTION {\n /**\n * LTR.\n */\n LTR = 'ltr',\n\n /**\n * RTL.\n */\n RTL = 'rtl',\n}\n\n/**\n * The alignment choices of floating menu.\n */\nexport enum FLOATING_MENU_ALIGNMENT {\n /**\n * Align the top/left position menu body to the one of its trigger button.\n */\n START = 'start',\n\n /**\n * Align the center position menu body to the one of its trigger button.\n */\n CENTER = 'center',\n\n /**\n * Align the bottom/right position menu body to the one of its trigger button.\n */\n END = 'end',\n}\n\n/**\n * The direction/positioning/orientation choices of floating menu.\n */\nexport enum FLOATING_MENU_DIRECTION {\n /**\n * Put menu body at the left of its trigger button.\n */\n LEFT = 'left',\n\n /**\n * Put menu body at the top of its trigger button.\n */\n TOP = 'top',\n\n /**\n * Put menu body at the right of its trigger button.\n */\n RIGHT = 'right',\n\n /**\n * Put menu body at the bottom of its trigger button.\n */\n BOTTOM = 'bottom',\n}\n\n/**\n * The group of the direction/positioning/orientation choices of floating menu.\n */\nexport enum FLOATING_MENU_DIRECTION_GROUP {\n /**\n * Put menu body at the left/right of its trigger button.\n */\n HORIZONTAL = 'horizontal',\n\n /**\n * Put menu body at the top/bottom of its trigger button.\n */\n VERTICAL = 'vertical',\n}\n"]}
1
+ {"version":3,"sources":["components/floating-menu/defs.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,oBAAY,gCAAgC;IAC1C;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,GAAG,QAAQ;CACZ;AAED;;GAEG;AACH,oBAAY,uBAAuB;IACjC;;OAEG;IACH,GAAG,QAAQ;IAEX;;OAEG;IACH,MAAM,WAAW;CAClB","file":"defs.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * The LTR/RTL direction used for positioning floating menu.\n */\nexport enum FLOATING_MENU_POSITION_DIRECTION {\n /**\n * LTR.\n */\n LTR = 'ltr',\n\n /**\n * RTL.\n */\n RTL = 'rtl',\n}\n\n/**\n * The direction/positioning/orientation choices of floating menu.\n */\nexport enum FLOATING_MENU_DIRECTION {\n /**\n * Put menu body at the top of its trigger button.\n */\n TOP = 'top',\n\n /**\n * Put menu body at the bottom of its trigger button.\n */\n BOTTOM = 'bottom',\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2020
4
+ * Copyright IBM Corp. 2020, 2023
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -13,36 +13,15 @@
13
13
  export let FLOATING_MENU_POSITION_DIRECTION;
14
14
 
15
15
  /**
16
- * The alignment choices of floating menu.
16
+ * The direction/positioning/orientation choices of floating menu.
17
17
  */
18
18
  (function (FLOATING_MENU_POSITION_DIRECTION) {
19
19
  FLOATING_MENU_POSITION_DIRECTION["LTR"] = "ltr";
20
20
  FLOATING_MENU_POSITION_DIRECTION["RTL"] = "rtl";
21
21
  })(FLOATING_MENU_POSITION_DIRECTION || (FLOATING_MENU_POSITION_DIRECTION = {}));
22
- export let FLOATING_MENU_ALIGNMENT;
23
-
24
- /**
25
- * The direction/positioning/orientation choices of floating menu.
26
- */
27
- (function (FLOATING_MENU_ALIGNMENT) {
28
- FLOATING_MENU_ALIGNMENT["START"] = "start";
29
- FLOATING_MENU_ALIGNMENT["CENTER"] = "center";
30
- FLOATING_MENU_ALIGNMENT["END"] = "end";
31
- })(FLOATING_MENU_ALIGNMENT || (FLOATING_MENU_ALIGNMENT = {}));
32
22
  export let FLOATING_MENU_DIRECTION;
33
-
34
- /**
35
- * The group of the direction/positioning/orientation choices of floating menu.
36
- */
37
23
  (function (FLOATING_MENU_DIRECTION) {
38
- FLOATING_MENU_DIRECTION["LEFT"] = "left";
39
24
  FLOATING_MENU_DIRECTION["TOP"] = "top";
40
- FLOATING_MENU_DIRECTION["RIGHT"] = "right";
41
25
  FLOATING_MENU_DIRECTION["BOTTOM"] = "bottom";
42
26
  })(FLOATING_MENU_DIRECTION || (FLOATING_MENU_DIRECTION = {}));
43
- export let FLOATING_MENU_DIRECTION_GROUP;
44
- (function (FLOATING_MENU_DIRECTION_GROUP) {
45
- FLOATING_MENU_DIRECTION_GROUP["HORIZONTAL"] = "horizontal";
46
- FLOATING_MENU_DIRECTION_GROUP["VERTICAL"] = "vertical";
47
- })(FLOATING_MENU_DIRECTION_GROUP || (FLOATING_MENU_DIRECTION_GROUP = {}));
48
27
  //# sourceMappingURL=defs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defs.js","names":["FLOATING_MENU_POSITION_DIRECTION","FLOATING_MENU_ALIGNMENT","FLOATING_MENU_DIRECTION","FLOATING_MENU_DIRECTION_GROUP"],"sources":["components/floating-menu/defs.ts"],"sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2020\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\n/**\n * The LTR/RTL direction used for positioning floating menu.\n */\nexport enum FLOATING_MENU_POSITION_DIRECTION {\n /**\n * LTR.\n */\n LTR = 'ltr',\n\n /**\n * RTL.\n */\n RTL = 'rtl',\n}\n\n/**\n * The alignment choices of floating menu.\n */\nexport enum FLOATING_MENU_ALIGNMENT {\n /**\n * Align the top/left position menu body to the one of its trigger button.\n */\n START = 'start',\n\n /**\n * Align the center position menu body to the one of its trigger button.\n */\n CENTER = 'center',\n\n /**\n * Align the bottom/right position menu body to the one of its trigger button.\n */\n END = 'end',\n}\n\n/**\n * The direction/positioning/orientation choices of floating menu.\n */\nexport enum FLOATING_MENU_DIRECTION {\n /**\n * Put menu body at the left of its trigger button.\n */\n LEFT = 'left',\n\n /**\n * Put menu body at the top of its trigger button.\n */\n TOP = 'top',\n\n /**\n * Put menu body at the right of its trigger button.\n */\n RIGHT = 'right',\n\n /**\n * Put menu body at the bottom of its trigger button.\n */\n BOTTOM = 'bottom',\n}\n\n/**\n * The group of the direction/positioning/orientation choices of floating menu.\n */\nexport enum FLOATING_MENU_DIRECTION_GROUP {\n /**\n * Put menu body at the left/right of its trigger button.\n */\n HORIZONTAL = 'horizontal',\n\n /**\n * Put menu body at the top/bottom of its trigger button.\n */\n VERTICAL = 'vertical',\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAYA,gCAAgC;;AAY5C;AACA;AACA;AAFA,WAZYA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;AAAA,GAAhCA,gCAAgC,KAAhCA,gCAAgC;AAe5C,WAAYC,uBAAuB;;AAiBnC;AACA;AACA;AAFA,WAjBYA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;AAAA,GAAvBA,uBAAuB,KAAvBA,uBAAuB;AAoBnC,WAAYC,uBAAuB;;AAsBnC;AACA;AACA;AAFA,WAtBYA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;AAAA,GAAvBA,uBAAuB,KAAvBA,uBAAuB;AAyBnC,WAAYC,6BAA6B;AAUxC,WAVWA,6BAA6B;EAA7BA,6BAA6B;EAA7BA,6BAA6B;AAAA,GAA7BA,6BAA6B,KAA7BA,6BAA6B"}
1
+ {"version":3,"file":"defs.js","names":["FLOATING_MENU_POSITION_DIRECTION","FLOATING_MENU_DIRECTION"],"sources":["components/floating-menu/defs.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\n/**\n * The LTR/RTL direction used for positioning floating menu.\n */\nexport enum FLOATING_MENU_POSITION_DIRECTION {\n /**\n * LTR.\n */\n LTR = 'ltr',\n\n /**\n * RTL.\n */\n RTL = 'rtl',\n}\n\n/**\n * The direction/positioning/orientation choices of floating menu.\n */\nexport enum FLOATING_MENU_DIRECTION {\n /**\n * Put menu body at the top of its trigger button.\n */\n TOP = 'top',\n\n /**\n * Put menu body at the bottom of its trigger button.\n */\n BOTTOM = 'bottom',\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAYA,gCAAgC;;AAY5C;AACA;AACA;AAFA,WAZYA,gCAAgC;EAAhCA,gCAAgC;EAAhCA,gCAAgC;AAAA,GAAhCA,gCAAgC,KAAhCA,gCAAgC;AAe5C,WAAYC,uBAAuB;AAUlC,WAVWA,uBAAuB;EAAvBA,uBAAuB;EAAvBA,uBAAuB;AAAA,GAAvBA,uBAAuB,KAAvBA,uBAAuB"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @license
3
3
  *
4
- * Copyright IBM Corp. 2019, 2020
4
+ * Copyright IBM Corp. 2019, 2023
5
5
  *
6
6
  * This source code is licensed under the Apache-2.0 license found in the
7
7
  * LICENSE file in the root directory of this source tree.
@@ -9,7 +9,7 @@
9
9
  /**
10
10
  * The interface of floating menus containing the trigger button.
11
11
  */
12
- interface BXFloatingMenuTrigger extends HTMLElement {
12
+ interface CDSFloatingMenuTrigger extends HTMLElement {
13
13
  /**
14
14
  * `true` if the menu should be open.
15
15
  */
@@ -19,6 +19,6 @@ interface BXFloatingMenuTrigger extends HTMLElement {
19
19
  */
20
20
  triggerPosition: ClientRect;
21
21
  }
22
- export default BXFloatingMenuTrigger;
22
+ export default CDSFloatingMenuTrigger;
23
23
 
24
24
  //# sourceMappingURL=floating-menu-trigger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"sources":["components/floating-menu/floating-menu-trigger.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,UAAU,qBAAsB,SAAQ,WAAW;IACjD;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,eAAe,EAAE,UAAU,CAAC;CAC7B;AAGD,eAAe,qBAAqB,CAAC","file":"floating-menu-trigger.d.ts","sourcesContent":["/**\n * @license\n *\n * Copyright IBM Corp. 2019, 2020\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\n/**\n * The interface of floating menus containing the trigger button.\n */\ninterface BXFloatingMenuTrigger extends HTMLElement {\n /**\n * `true` if the menu should be open.\n */\n open: boolean;\n\n /**\n * The position of the trigger button.\n */\n triggerPosition: ClientRect;\n}\n\n// eslint-disable-next-line no-undef\nexport default BXFloatingMenuTrigger;\n"]}
1
+ {"version":3,"sources":["components/floating-menu/floating-menu-trigger.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;GAEG;AACH,UAAU,sBAAuB,SAAQ,WAAW;IAClD;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,eAAe,EAAE,UAAU,CAAC;CAC7B;AAGD,eAAe,sBAAsB,CAAC","file":"floating-menu-trigger.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\n/**\n * The interface of floating menus containing the trigger button.\n */\ninterface CDSFloatingMenuTrigger extends HTMLElement {\n /**\n * `true` if the menu should be open.\n */\n open: boolean;\n\n /**\n * The position of the trigger button.\n */\n triggerPosition: ClientRect;\n}\n\n// eslint-disable-next-line no-undef\nexport default CDSFloatingMenuTrigger;\n"]}
@@ -8,9 +8,9 @@
8
8
  */
9
9
  import { LitElement } from 'lit';
10
10
  import Handle from '../../globals/internal/handle';
11
- import { FLOATING_MENU_ALIGNMENT, FLOATING_MENU_DIRECTION, FLOATING_MENU_DIRECTION_GROUP, FLOATING_MENU_POSITION_DIRECTION } from './defs';
12
- import BXFloatingMenuTrigger from './floating-menu-trigger';
13
- export { FLOATING_MENU_ALIGNMENT, FLOATING_MENU_DIRECTION, FLOATING_MENU_DIRECTION_GROUP, FLOATING_MENU_POSITION_DIRECTION, };
11
+ import { FLOATING_MENU_DIRECTION, FLOATING_MENU_POSITION_DIRECTION } from './defs';
12
+ import CDSFloatingMenuTrigger from './floating-menu-trigger';
13
+ export { FLOATING_MENU_DIRECTION, FLOATING_MENU_POSITION_DIRECTION };
14
14
  /**
15
15
  * Position of floating menu, or trigger button of floating menu.
16
16
  */
@@ -28,7 +28,7 @@ export interface FloatingMenuPosition {
28
28
  */
29
29
  top: number;
30
30
  }
31
- declare const BXFloatingMenu_base: {
31
+ declare const CDSFloatingMenu_base: {
32
32
  new (...args: any[]): {
33
33
  _handles: Set<Handle>;
34
34
  connectedCallback(): void;
@@ -652,7 +652,7 @@ declare const BXFloatingMenu_base: {
652
652
  /**
653
653
  * Floating menu.
654
654
  */
655
- declare abstract class BXFloatingMenu extends BXFloatingMenu_base {
655
+ declare abstract class CDSFloatingMenu extends CDSFloatingMenu_base {
656
656
  /**
657
657
  * The handle for observing resize of the element containing the trigger button.
658
658
  */
@@ -666,14 +666,12 @@ declare abstract class BXFloatingMenu extends BXFloatingMenu_base {
666
666
  */
667
667
  private _resizeObserver;
668
668
  private _handleBlur;
669
+ private _click;
670
+ private _handleKeyDown;
669
671
  /**
670
672
  * The DOM element, typically a custom element in this library, launching this floating menu.
671
673
  */
672
- protected parent: BXFloatingMenuTrigger | null;
673
- /**
674
- * How the menu is aligned to the trigger button.
675
- */
676
- abstract alignment: FLOATING_MENU_ALIGNMENT;
674
+ protected parent: CDSFloatingMenuTrigger | null;
677
675
  /**
678
676
  * The menu direction.
679
677
  */
@@ -683,9 +681,9 @@ declare abstract class BXFloatingMenu extends BXFloatingMenu_base {
683
681
  */
684
682
  abstract open: boolean;
685
683
  /**
686
- * The horizontal/vertical direction with regard to how the menu is aligned to the trigger button.
684
+ * `true` if the menu alignment should be flipped.
687
685
  */
688
- get alignmentDirection(): FLOATING_MENU_DIRECTION_GROUP;
686
+ abstract flipped: boolean;
689
687
  /**
690
688
  * The DOM element to put this menu into.
691
689
  */
@@ -710,6 +708,6 @@ declare abstract class BXFloatingMenu extends BXFloatingMenu_base {
710
708
  slotAssignment?: SlotAssignmentMode | undefined;
711
709
  };
712
710
  }
713
- export default BXFloatingMenu;
711
+ export default CDSFloatingMenu;
714
712
 
715
713
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCD;;GAEG;AACH,uBAAe,cAAe,SAAQ,mBAErC;IACC;;OAEG;IACH,OAAO,CAAC,qBAAqB,CAAuB;IAEpD;;OAEG;IACH,OAAO,CAAC,wBAAwB,CAAuB;IAEvD;;OAEG;IAGH,OAAO,CAAC,eAAe,CASpB;IAIH,OAAO,CAAC,WAAW,CAQjB;IAEF;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CAAQ;IAEtD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,IAAI,kBAAkB,kCAQrB;IAED;;OAEG;IACH,IAAI,SAAS,QAOZ;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAqGnC;IAED,oBAAoB;IASpB,OAAO,CAAC,iBAAiB,KAAA;IA0CzB;;OAEG;IACH,MAAM,CAAC,aAAa,UAAQ;IAE5B;;OAEG;IACH,MAAM,KAAK,iBAAiB,WAE3B;IACD,MAAM,CAAC,iBAAiB;;;;MAGtB;CACH;AAED,eAAe,cAAc,CAAC","file":"floating-menu.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 { LitElement } from 'lit';\nimport HostListener from '../../globals/decorators/host-listener';\nimport FocusMixin from '../../globals/mixins/focus';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport Handle from '../../globals/internal/handle';\nimport {\n FLOATING_MENU_ALIGNMENT,\n FLOATING_MENU_DIRECTION,\n FLOATING_MENU_DIRECTION_GROUP,\n FLOATING_MENU_POSITION_DIRECTION,\n} from './defs';\nimport BXFloatingMenuTrigger from './floating-menu-trigger';\nimport { prefix } from '../../globals/settings';\n\nexport {\n FLOATING_MENU_ALIGNMENT,\n FLOATING_MENU_DIRECTION,\n FLOATING_MENU_DIRECTION_GROUP,\n FLOATING_MENU_POSITION_DIRECTION,\n};\n\n/**\n * Position of floating menu, or trigger button of floating menu.\n */\nexport interface FloatingMenuPosition {\n /**\n * The LTR/RTL direction used for positioning floating menu.\n */\n direction: FLOATING_MENU_POSITION_DIRECTION;\n\n /**\n * The start position (Left position for LTR, right position for RTL).\n */\n start: number;\n\n /**\n * The top position.\n */\n top: number;\n}\n\n/**\n * Observes resize of the given element with the given resize observer.\n *\n * @param observer The resize observer.\n * @param elem The element to observe the resize.\n */\nconst observeResize = (observer: ResizeObserver, elem: Element) => {\n observer.observe(elem);\n return {\n release() {\n observer.unobserve(elem);\n return null;\n },\n } as Handle;\n};\n\n/**\n * @param elem The starting element.\n * @param selector The CSS selector.\n * @returns {Element}\n * The closest ancestor node of the given element that matches the given selector, crossing Shadow DOM boundary.\n */\nconst closestComposed = (elem: Element, selector: string) => {\n const found = elem.closest(selector);\n if (found) {\n return found;\n }\n const { host } = elem.getRootNode() as ShadowRoot;\n if (host) {\n return closestComposed(host, selector);\n }\n return null;\n};\n\n/**\n * Floating menu.\n */\nabstract class BXFloatingMenu extends HostListenerMixin(\n FocusMixin(LitElement)\n) {\n /**\n * The handle for observing resize of the element containing the trigger button.\n */\n private _hObserveResizeParent: Handle | null = null;\n\n /**\n * The handle for observing resize of the floating menu container.\n */\n private _hObserveResizeContainer: Handle | null = null;\n\n /**\n * The `ResizeObserver` instance for observing element resizes for re-positioning floating menu position.\n */\n // TODO: Wait for `.d.ts` update to support `ResizeObserver`\n // @ts-ignore\n private _resizeObserver = new ResizeObserver(() => {\n const { container, open, parent, position } = this;\n if (container && open && parent) {\n const { direction, start, top } = position;\n this.style[\n direction !== FLOATING_MENU_POSITION_DIRECTION.RTL ? 'left' : 'right'\n ] = `${start}px`;\n this.style.top = `${top}px`;\n }\n });\n\n @HostListener('focusout')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleBlur = ({ relatedTarget }: FocusEvent) => {\n if (!this.contains(relatedTarget as Node)) {\n const { parent } = this;\n if (parent) {\n parent.open = false;\n HTMLElement.prototype.focus.call(this.parent); // SVGElement in IE11 does not have `.focus()` method\n }\n }\n };\n\n /**\n * The DOM element, typically a custom element in this library, launching this floating menu.\n */\n protected parent: BXFloatingMenuTrigger | null = null;\n\n /**\n * How the menu is aligned to the trigger button.\n */\n abstract alignment: FLOATING_MENU_ALIGNMENT;\n\n /**\n * The menu direction.\n */\n abstract direction: FLOATING_MENU_DIRECTION;\n\n /**\n * `true` if the menu should be open.\n */\n abstract open: boolean;\n\n /**\n * The horizontal/vertical direction with regard to how the menu is aligned to the trigger button.\n */\n get alignmentDirection() {\n return {\n [FLOATING_MENU_DIRECTION.LEFT]: FLOATING_MENU_DIRECTION_GROUP.VERTICAL,\n [FLOATING_MENU_DIRECTION.TOP]: FLOATING_MENU_DIRECTION_GROUP.HORIZONTAL,\n [FLOATING_MENU_DIRECTION.RIGHT]: FLOATING_MENU_DIRECTION_GROUP.VERTICAL,\n [FLOATING_MENU_DIRECTION.BOTTOM]:\n FLOATING_MENU_DIRECTION_GROUP.HORIZONTAL,\n }[this.direction];\n }\n\n /**\n * The DOM element to put this menu into.\n */\n get container() {\n return (\n closestComposed(\n this,\n (this.constructor as typeof BXFloatingMenu).selectorContainer\n ) || this.ownerDocument!.body\n );\n }\n\n /**\n * The position of this floating menu.\n */\n get position(): FloatingMenuPosition {\n const { triggerPosition } = this.parent!;\n if (!triggerPosition) {\n throw new TypeError('Missing information of trigger button position.');\n }\n\n const { container } = this;\n const {\n left: refLeft = 0,\n top: refTop = 0,\n right: refRight = 0,\n bottom: refBottom = 0,\n } = triggerPosition;\n const { width, height } = this.getBoundingClientRect();\n const {\n left: containerLeft = 0,\n right: containerRight = 0,\n top: containerTop = 0,\n } = container.getBoundingClientRect();\n const refCenterHorizontal = (refLeft + refRight) / 2;\n const refCenterVertical = (refTop + refBottom) / 2;\n\n const containerComputedStyle =\n container.ownerDocument!.defaultView!.getComputedStyle(container);\n const positionDirection = containerComputedStyle.getPropertyValue(\n 'direction'\n ) as FLOATING_MENU_POSITION_DIRECTION;\n const isRtl = positionDirection === FLOATING_MENU_POSITION_DIRECTION.RTL;\n const containerStartFromViewport = !isRtl\n ? containerLeft\n : container.ownerDocument!.defaultView!.innerWidth - containerRight;\n const refStartFromContainer = !isRtl\n ? refLeft - containerLeft\n : containerRight - refRight;\n const refEndFromContainer = !isRtl\n ? refRight - containerLeft\n : containerRight - refLeft;\n const refCenterHorizontalFromContainer = !isRtl\n ? refCenterHorizontal - containerLeft\n : containerRight - refCenterHorizontal;\n const refTopFromContainer = refTop - containerTop;\n const refCenterVerticalFromContainer = refCenterVertical - containerTop;\n\n if (\n (container !== this.ownerDocument!.body ||\n containerStartFromViewport !== 0 ||\n containerTop !== 0) &&\n containerComputedStyle.getPropertyValue('position') === 'static'\n ) {\n throw new Error(\n 'Floating menu container must not have `position:static`.'\n );\n }\n\n const { alignment, alignmentDirection, direction } = this;\n if (Object.values(FLOATING_MENU_ALIGNMENT).indexOf(alignment) < 0) {\n throw new Error(`Wrong menu alignment: ${alignment}`);\n }\n if (Object.values(FLOATING_MENU_DIRECTION).indexOf(direction) < 0) {\n throw new Error(`Wrong menu position direction: ${direction}`);\n }\n\n const alignmentStart = {\n [FLOATING_MENU_DIRECTION_GROUP.HORIZONTAL]: {\n [FLOATING_MENU_ALIGNMENT.START]: () => refStartFromContainer,\n [FLOATING_MENU_ALIGNMENT.CENTER]: () =>\n refCenterHorizontalFromContainer - width / 2,\n [FLOATING_MENU_ALIGNMENT.END]: () => refEndFromContainer - width,\n },\n [FLOATING_MENU_DIRECTION_GROUP.VERTICAL]: {\n [FLOATING_MENU_ALIGNMENT.START]: () => refTopFromContainer,\n [FLOATING_MENU_ALIGNMENT.CENTER]: () =>\n refCenterVerticalFromContainer - height / 2,\n [FLOATING_MENU_ALIGNMENT.END]: () => refBottom - height,\n },\n }[alignmentDirection][alignment]();\n\n const { start, top } = {\n [FLOATING_MENU_DIRECTION.LEFT]: () => ({\n start: refStartFromContainer - width,\n top: alignmentStart,\n }),\n [FLOATING_MENU_DIRECTION.TOP]: () => ({\n start: alignmentStart,\n top: refTopFromContainer - height,\n }),\n [FLOATING_MENU_DIRECTION.RIGHT]: () => ({\n start: refEndFromContainer,\n top: alignmentStart,\n }),\n [FLOATING_MENU_DIRECTION.BOTTOM]: () => ({\n start: alignmentStart,\n top: refBottom,\n }),\n }[direction]();\n\n return {\n direction: positionDirection,\n start,\n top,\n };\n }\n\n disconnectedCallback() {\n if (this._hObserveResizeContainer) {\n this._hObserveResizeContainer = this._hObserveResizeContainer.release();\n }\n if (this._hObserveResizeParent) {\n this._hObserveResizeParent = this._hObserveResizeParent.release();\n }\n }\n\n updated(changedProperties) {\n const { container, open, parent } = this;\n if (\n (changedProperties.has('alignment') ||\n changedProperties.has('direction') ||\n changedProperties.has('open')) &&\n open\n ) {\n if (!parent) {\n this.parent = this.parentElement as BXFloatingMenuTrigger;\n container.appendChild(this);\n }\n // Note: `this.position` cannot be referenced until `this.parent` is set\n const { direction, start, top } = this.position;\n this.style[\n direction !== FLOATING_MENU_POSITION_DIRECTION.RTL ? 'left' : 'right'\n ] = `${start}px`;\n this.style.top = `${top}px`;\n }\n if (changedProperties.has('open')) {\n if (this._hObserveResizeContainer) {\n this._hObserveResizeContainer = this._hObserveResizeContainer.release();\n }\n if (this._hObserveResizeParent) {\n this._hObserveResizeParent = this._hObserveResizeParent.release();\n }\n if (open) {\n const { parentElement } = this.parent ?? {};\n this._hObserveResizeContainer = observeResize(\n this._resizeObserver,\n container\n );\n if (parentElement) {\n this._hObserveResizeParent = observeResize(\n this._resizeObserver,\n parentElement\n );\n }\n }\n }\n }\n\n /**\n * A constant indicating that this class is a floating menu.\n */\n static FLOATING_MENU = true;\n\n /**\n * The CSS selector to find the element to put this floating menu in.\n */\n static get selectorContainer() {\n return `[data-floating-menu-container],${prefix}-modal`;\n }\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n}\n\nexport default BXFloatingMenu;\n"]}
1
+ {"version":3,"sources":["components/floating-menu/floating-menu.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAIjC,OAAO,MAAM,MAAM,+BAA+B,CAAC;AACnD,OAAO,EACL,uBAAuB,EACvB,gCAAgC,EACjC,MAAM,QAAQ,CAAC;AAChB,OAAO,sBAAsB,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,uBAAuB,EAAE,gCAAgC,EAAE,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,SAAS,EAAE,gCAAgC,CAAC;IAE5C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCD;;GAEG;AACH,uBAAe,eAAgB,SAAQ,oBAEtC;IACC;;OAEG;IACH,OAAO,CAAC,qBAAqB,CAAuB;IAEpD;;OAEG;IACH,OAAO,CAAC,wBAAwB,CAAuB;IAEvD;;OAEG;IAGH,OAAO,CAAC,eAAe,CASpB;IAIH,OAAO,CAAC,WAAW,CAQjB;IAIF,OAAO,CAAC,MAAM,CAKZ;IAIF,OAAO,CAAC,cAAc,CASpB;IAEF;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAQ;IAEvD;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,uBAAuB,CAAC;IAE5C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAEvB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,IAAI,SAAS,QAOZ;IAED;;OAEG;IACH,IAAI,QAAQ,IAAI,oBAAoB,CAyEnC;IAED,oBAAoB;IASpB,OAAO,CAAC,iBAAiB,KAAA;IA0CzB;;OAEG;IACH,MAAM,CAAC,aAAa,UAAQ;IAE5B;;OAEG;IACH,MAAM,KAAK,iBAAiB,WAE3B;IACD,MAAM,CAAC,iBAAiB;;;;MAGtB;CACH;AAED,eAAe,eAAe,CAAC","file":"floating-menu.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 { LitElement } from 'lit';\nimport HostListener from '../../globals/decorators/host-listener';\nimport FocusMixin from '../../globals/mixins/focus';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport Handle from '../../globals/internal/handle';\nimport {\n FLOATING_MENU_DIRECTION,\n FLOATING_MENU_POSITION_DIRECTION,\n} from './defs';\nimport CDSFloatingMenuTrigger from './floating-menu-trigger';\nimport { prefix } from '../../globals/settings';\n\nexport { FLOATING_MENU_DIRECTION, FLOATING_MENU_POSITION_DIRECTION };\n\n/**\n * Position of floating menu, or trigger button of floating menu.\n */\nexport interface FloatingMenuPosition {\n /**\n * The LTR/RTL direction used for positioning floating menu.\n */\n direction: FLOATING_MENU_POSITION_DIRECTION;\n\n /**\n * The start position (Left position for LTR, right position for RTL).\n */\n start: number;\n\n /**\n * The top position.\n */\n top: number;\n}\n\n/**\n * Observes resize of the given element with the given resize observer.\n *\n * @param observer The resize observer.\n * @param elem The element to observe the resize.\n */\nconst observeResize = (observer: ResizeObserver, elem: Element) => {\n observer.observe(elem);\n return {\n release() {\n observer.unobserve(elem);\n return null;\n },\n } as Handle;\n};\n\n/**\n * @param elem The starting element.\n * @param selector The CSS selector.\n * @returns {Element}\n * The closest ancestor node of the given element that matches the given selector, crossing Shadow DOM boundary.\n */\nconst closestComposed = (elem: Element, selector: string) => {\n const found = elem.closest(selector);\n if (found) {\n return found;\n }\n const { host } = elem.getRootNode() as ShadowRoot;\n if (host) {\n return closestComposed(host, selector);\n }\n return null;\n};\n\n/**\n * Floating menu.\n */\nabstract class CDSFloatingMenu extends HostListenerMixin(\n FocusMixin(LitElement)\n) {\n /**\n * The handle for observing resize of the element containing the trigger button.\n */\n private _hObserveResizeParent: Handle | null = null;\n\n /**\n * The handle for observing resize of the floating menu container.\n */\n private _hObserveResizeContainer: Handle | null = null;\n\n /**\n * The `ResizeObserver` instance for observing element resizes for re-positioning floating menu position.\n */\n // TODO: Wait for `.d.ts` update to support `ResizeObserver`\n // @ts-ignore\n private _resizeObserver = new ResizeObserver(() => {\n const { container, open, parent, position } = this;\n if (container && open && parent) {\n const { direction, start, top } = position;\n this.style[\n direction !== FLOATING_MENU_POSITION_DIRECTION.RTL ? 'left' : 'right'\n ] = `${start}px`;\n this.style.top = `${top}px`;\n }\n });\n\n @HostListener('focusout')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleBlur = ({ relatedTarget }: FocusEvent) => {\n if (!this.contains(relatedTarget as Node)) {\n const { parent } = this;\n if (parent && parent !== relatedTarget) {\n parent.open = false;\n HTMLElement.prototype.focus.call(this.parent); // SVGElement in IE11 does not have `.focus()` method\n }\n }\n };\n\n @HostListener('click')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _click = (event: MouseEvent) => {\n const { parent } = this;\n if (parent) {\n parent.open = false;\n }\n };\n\n @HostListener('keydown')\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n const { parent } = this;\n if (parent) {\n parent.open = false;\n }\n }\n }\n };\n\n /**\n * The DOM element, typically a custom element in this library, launching this floating menu.\n */\n protected parent: CDSFloatingMenuTrigger | null = null;\n\n /**\n * The menu direction.\n */\n abstract direction: FLOATING_MENU_DIRECTION;\n\n /**\n * `true` if the menu should be open.\n */\n abstract open: boolean;\n\n /**\n * `true` if the menu alignment should be flipped.\n */\n abstract flipped: boolean;\n\n /**\n * The DOM element to put this menu into.\n */\n get container() {\n return (\n closestComposed(\n this,\n (this.constructor as typeof CDSFloatingMenu).selectorContainer\n ) || this.ownerDocument!.body\n );\n }\n\n /**\n * The position of this floating menu.\n */\n get position(): FloatingMenuPosition {\n const { triggerPosition } = this.parent!;\n if (!triggerPosition) {\n throw new TypeError('Missing information of trigger button position.');\n }\n\n const { container } = this;\n const {\n left: refLeft = 0,\n top: refTop = 0,\n right: refRight = 0,\n bottom: refBottom = 0,\n } = triggerPosition;\n const { width, height } = this.getBoundingClientRect();\n const {\n left: containerLeft = 0,\n right: containerRight = 0,\n top: containerTop = 0,\n } = container.getBoundingClientRect();\n\n const containerComputedStyle =\n container.ownerDocument!.defaultView!.getComputedStyle(container);\n const positionDirection = containerComputedStyle.getPropertyValue(\n 'direction'\n ) as FLOATING_MENU_POSITION_DIRECTION;\n const isRtl = positionDirection === FLOATING_MENU_POSITION_DIRECTION.RTL;\n const containerStartFromViewport = !isRtl\n ? containerLeft\n : container.ownerDocument!.defaultView!.innerWidth - containerRight;\n const refStartFromContainer = !isRtl\n ? refLeft - containerLeft\n : containerRight - refRight;\n const refEndFromContainer = !isRtl\n ? refRight - containerLeft\n : containerRight - refLeft;\n const refTopFromContainer = refTop - containerTop;\n\n if (\n (container !== this.ownerDocument!.body ||\n containerStartFromViewport !== 0 ||\n containerTop !== 0) &&\n containerComputedStyle.getPropertyValue('position') === 'static'\n ) {\n throw new Error(\n 'Floating menu container must not have `position:static`.'\n );\n }\n\n const { flipped, direction } = this;\n if (Object.values(FLOATING_MENU_DIRECTION).indexOf(direction) < 0) {\n throw new Error(`Wrong menu position direction: ${direction}`);\n }\n\n const alignmentStart = flipped\n ? refEndFromContainer - width\n : refStartFromContainer;\n\n const { start, top } = {\n [FLOATING_MENU_DIRECTION.TOP]: () => ({\n start: alignmentStart,\n top: refTopFromContainer - height,\n }),\n [FLOATING_MENU_DIRECTION.BOTTOM]: () => ({\n start: alignmentStart,\n top: refBottom,\n }),\n }[direction]();\n\n return {\n direction: positionDirection,\n start,\n top,\n };\n }\n\n disconnectedCallback() {\n if (this._hObserveResizeContainer) {\n this._hObserveResizeContainer = this._hObserveResizeContainer.release();\n }\n if (this._hObserveResizeParent) {\n this._hObserveResizeParent = this._hObserveResizeParent.release();\n }\n }\n\n updated(changedProperties) {\n const { container, open, parent } = this;\n if (\n (changedProperties.has('flipped') ||\n changedProperties.has('direction') ||\n changedProperties.has('open')) &&\n open\n ) {\n if (!parent) {\n this.parent = this.parentElement as CDSFloatingMenuTrigger;\n container.appendChild(this);\n }\n // Note: `this.position` cannot be referenced until `this.parent` is set\n const { direction, start, top } = this.position;\n this.style[\n direction !== FLOATING_MENU_POSITION_DIRECTION.RTL ? 'left' : 'right'\n ] = `${start}px`;\n this.style.top = `${top}px`;\n }\n if (changedProperties.has('open')) {\n if (this._hObserveResizeContainer) {\n this._hObserveResizeContainer = this._hObserveResizeContainer.release();\n }\n if (this._hObserveResizeParent) {\n this._hObserveResizeParent = this._hObserveResizeParent.release();\n }\n if (open) {\n const { parentElement } = this.parent ?? {};\n this._hObserveResizeContainer = observeResize(\n this._resizeObserver,\n container\n );\n if (parentElement) {\n this._hObserveResizeParent = observeResize(\n this._resizeObserver,\n parentElement\n );\n }\n }\n }\n }\n\n /**\n * A constant indicating that this class is a floating menu.\n */\n static FLOATING_MENU = true;\n\n /**\n * The CSS selector to find the element to put this floating menu in.\n */\n static get selectorContainer() {\n return `[data-floating-menu-container],${prefix}-modal`;\n }\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n}\n\nexport default CDSFloatingMenu;\n"]}
@@ -13,9 +13,9 @@ import { LitElement } from 'lit';
13
13
  import HostListener from '../../globals/decorators/host-listener';
14
14
  import FocusMixin from '../../globals/mixins/focus';
15
15
  import HostListenerMixin from '../../globals/mixins/host-listener';
16
- import { FLOATING_MENU_ALIGNMENT, FLOATING_MENU_DIRECTION, FLOATING_MENU_DIRECTION_GROUP, FLOATING_MENU_POSITION_DIRECTION } from './defs';
16
+ import { FLOATING_MENU_DIRECTION, FLOATING_MENU_POSITION_DIRECTION } from './defs';
17
17
  import { prefix } from '../../globals/settings';
18
- export { FLOATING_MENU_ALIGNMENT, FLOATING_MENU_DIRECTION, FLOATING_MENU_DIRECTION_GROUP, FLOATING_MENU_POSITION_DIRECTION };
18
+ export { FLOATING_MENU_DIRECTION, FLOATING_MENU_POSITION_DIRECTION };
19
19
 
20
20
  /**
21
21
  * Position of floating menu, or trigger button of floating menu.
@@ -60,15 +60,15 @@ const closestComposed = (elem, selector) => {
60
60
  /**
61
61
  * Floating menu.
62
62
  */
63
- let BXFloatingMenu = _decorate(null, function (_initialize, _HostListenerMixin) {
64
- class BXFloatingMenu extends _HostListenerMixin {
63
+ let CDSFloatingMenu = _decorate(null, function (_initialize, _HostListenerMixin) {
64
+ class CDSFloatingMenu extends _HostListenerMixin {
65
65
  constructor(...args) {
66
66
  super(...args);
67
67
  _initialize(this);
68
68
  }
69
69
  }
70
70
  return {
71
- F: BXFloatingMenu,
71
+ F: CDSFloatingMenu,
72
72
  d: [{
73
73
  kind: "field",
74
74
  key: "_hObserveResizeParent",
@@ -115,13 +115,45 @@ let BXFloatingMenu = _decorate(null, function (_initialize, _HostListenerMixin)
115
115
  const {
116
116
  parent
117
117
  } = this;
118
- if (parent) {
118
+ if (parent && parent !== relatedTarget) {
119
119
  parent.open = false;
120
120
  HTMLElement.prototype.focus.call(this.parent); // SVGElement in IE11 does not have `.focus()` method
121
121
  }
122
122
  }
123
123
  };
124
124
  }
125
+ }, {
126
+ kind: "field",
127
+ decorators: [HostListener('click')],
128
+ key: "_click",
129
+ value() {
130
+ return event => {
131
+ const {
132
+ parent
133
+ } = this;
134
+ if (parent) {
135
+ parent.open = false;
136
+ }
137
+ };
138
+ }
139
+ }, {
140
+ kind: "field",
141
+ decorators: [HostListener('keydown')],
142
+ key: "_handleKeyDown",
143
+ value() {
144
+ return event => {
145
+ if (event.key === 'Tab') {
146
+ if (event.shiftKey) {
147
+ const {
148
+ parent
149
+ } = this;
150
+ if (parent) {
151
+ parent.open = false;
152
+ }
153
+ }
154
+ }
155
+ };
156
+ }
125
157
  }, {
126
158
  kind: "field",
127
159
  key: "parent",
@@ -130,7 +162,7 @@ let BXFloatingMenu = _decorate(null, function (_initialize, _HostListenerMixin)
130
162
  }
131
163
  }, {
132
164
  kind: "get",
133
- key: "alignmentDirection",
165
+ key: "container",
134
166
  value:
135
167
  /**
136
168
  * The handle for observing resize of the element containing the trigger button.
@@ -150,25 +182,10 @@ let BXFloatingMenu = _decorate(null, function (_initialize, _HostListenerMixin)
150
182
  * The DOM element, typically a custom element in this library, launching this floating menu.
151
183
  */
152
184
 
153
- /**
154
- * The horizontal/vertical direction with regard to how the menu is aligned to the trigger button.
155
- */
156
- function alignmentDirection() {
157
- return {
158
- [FLOATING_MENU_DIRECTION.LEFT]: FLOATING_MENU_DIRECTION_GROUP.VERTICAL,
159
- [FLOATING_MENU_DIRECTION.TOP]: FLOATING_MENU_DIRECTION_GROUP.HORIZONTAL,
160
- [FLOATING_MENU_DIRECTION.RIGHT]: FLOATING_MENU_DIRECTION_GROUP.VERTICAL,
161
- [FLOATING_MENU_DIRECTION.BOTTOM]: FLOATING_MENU_DIRECTION_GROUP.HORIZONTAL
162
- }[this.direction];
163
- }
164
-
165
185
  /**
166
186
  * The DOM element to put this menu into.
167
187
  */
168
- }, {
169
- kind: "get",
170
- key: "container",
171
- value: function container() {
188
+ function container() {
172
189
  return closestComposed(this, this.constructor.selectorContainer) || this.ownerDocument.body;
173
190
  }
174
191
 
@@ -203,59 +220,32 @@ let BXFloatingMenu = _decorate(null, function (_initialize, _HostListenerMixin)
203
220
  right: containerRight = 0,
204
221
  top: containerTop = 0
205
222
  } = container.getBoundingClientRect();
206
- const refCenterHorizontal = (refLeft + refRight) / 2;
207
- const refCenterVertical = (refTop + refBottom) / 2;
208
223
  const containerComputedStyle = container.ownerDocument.defaultView.getComputedStyle(container);
209
224
  const positionDirection = containerComputedStyle.getPropertyValue('direction');
210
225
  const isRtl = positionDirection === FLOATING_MENU_POSITION_DIRECTION.RTL;
211
226
  const containerStartFromViewport = !isRtl ? containerLeft : container.ownerDocument.defaultView.innerWidth - containerRight;
212
227
  const refStartFromContainer = !isRtl ? refLeft - containerLeft : containerRight - refRight;
213
228
  const refEndFromContainer = !isRtl ? refRight - containerLeft : containerRight - refLeft;
214
- const refCenterHorizontalFromContainer = !isRtl ? refCenterHorizontal - containerLeft : containerRight - refCenterHorizontal;
215
229
  const refTopFromContainer = refTop - containerTop;
216
- const refCenterVerticalFromContainer = refCenterVertical - containerTop;
217
230
  if ((container !== this.ownerDocument.body || containerStartFromViewport !== 0 || containerTop !== 0) && containerComputedStyle.getPropertyValue('position') === 'static') {
218
231
  throw new Error('Floating menu container must not have `position:static`.');
219
232
  }
220
233
  const {
221
- alignment,
222
- alignmentDirection,
234
+ flipped,
223
235
  direction
224
236
  } = this;
225
- if (Object.values(FLOATING_MENU_ALIGNMENT).indexOf(alignment) < 0) {
226
- throw new Error(`Wrong menu alignment: ${alignment}`);
227
- }
228
237
  if (Object.values(FLOATING_MENU_DIRECTION).indexOf(direction) < 0) {
229
238
  throw new Error(`Wrong menu position direction: ${direction}`);
230
239
  }
231
- const alignmentStart = {
232
- [FLOATING_MENU_DIRECTION_GROUP.HORIZONTAL]: {
233
- [FLOATING_MENU_ALIGNMENT.START]: () => refStartFromContainer,
234
- [FLOATING_MENU_ALIGNMENT.CENTER]: () => refCenterHorizontalFromContainer - width / 2,
235
- [FLOATING_MENU_ALIGNMENT.END]: () => refEndFromContainer - width
236
- },
237
- [FLOATING_MENU_DIRECTION_GROUP.VERTICAL]: {
238
- [FLOATING_MENU_ALIGNMENT.START]: () => refTopFromContainer,
239
- [FLOATING_MENU_ALIGNMENT.CENTER]: () => refCenterVerticalFromContainer - height / 2,
240
- [FLOATING_MENU_ALIGNMENT.END]: () => refBottom - height
241
- }
242
- }[alignmentDirection][alignment]();
240
+ const alignmentStart = flipped ? refEndFromContainer - width : refStartFromContainer;
243
241
  const {
244
242
  start,
245
243
  top
246
244
  } = {
247
- [FLOATING_MENU_DIRECTION.LEFT]: () => ({
248
- start: refStartFromContainer - width,
249
- top: alignmentStart
250
- }),
251
245
  [FLOATING_MENU_DIRECTION.TOP]: () => ({
252
246
  start: alignmentStart,
253
247
  top: refTopFromContainer - height
254
248
  }),
255
- [FLOATING_MENU_DIRECTION.RIGHT]: () => ({
256
- start: refEndFromContainer,
257
- top: alignmentStart
258
- }),
259
249
  [FLOATING_MENU_DIRECTION.BOTTOM]: () => ({
260
250
  start: alignmentStart,
261
251
  top: refBottom
@@ -287,7 +277,7 @@ let BXFloatingMenu = _decorate(null, function (_initialize, _HostListenerMixin)
287
277
  open,
288
278
  parent
289
279
  } = this;
290
- if ((changedProperties.has('alignment') || changedProperties.has('direction') || changedProperties.has('open')) && open) {
280
+ if ((changedProperties.has('flipped') || changedProperties.has('direction') || changedProperties.has('open')) && open) {
291
281
  if (!parent) {
292
282
  this.parent = this.parentElement;
293
283
  container.appendChild(this);
@@ -354,5 +344,5 @@ let BXFloatingMenu = _decorate(null, function (_initialize, _HostListenerMixin)
354
344
  }]
355
345
  };
356
346
  }, HostListenerMixin(FocusMixin(LitElement)));
357
- export default BXFloatingMenu;
347
+ export default CDSFloatingMenu;
358
348
  //# sourceMappingURL=floating-menu.js.map