@govbr-ds/webcomponents 2.4.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (850) hide show
  1. package/README.md +2 -2
  2. package/cem/custom-elements.json +4438 -1034
  3. package/cem/webcomponents.html-custom-data.json +491 -160
  4. package/dist/cjs/br-avatar.cjs.entry.js +4 -4
  5. package/dist/cjs/br-breadcrumb-item.cjs.entry.js +2 -2
  6. package/dist/cjs/br-breadcrumb.cjs.entry.js +11 -11
  7. package/dist/cjs/br-button_2.cjs.entry.js +6 -6
  8. package/dist/cjs/br-card.cjs.entry.js +4 -4
  9. package/dist/cjs/br-carousel-page.cjs.entry.js +3 -3
  10. package/dist/cjs/br-carousel.cjs.entry.js +5 -5
  11. package/dist/cjs/br-checkbox-group.cjs.entry.js +4 -4
  12. package/dist/cjs/br-checkbox.cjs.entry.js +5 -5
  13. package/dist/cjs/br-checkgroup.cjs.entry.js +2 -2
  14. package/dist/cjs/br-collapse_2.cjs.entry.js +10 -10
  15. package/dist/cjs/br-cookiebar-cookie.cjs.entry.js +3 -3
  16. package/dist/cjs/br-cookiebar-group.cjs.entry.js +4 -4
  17. package/dist/cjs/br-cookiebar-header.cjs.entry.js +3 -3
  18. package/dist/cjs/br-cookiebar-link.cjs.entry.js +3 -3
  19. package/dist/cjs/br-cookiebar-note-group.cjs.entry.js +3 -3
  20. package/dist/cjs/br-cookiebar-note.cjs.entry.js +3 -3
  21. package/dist/cjs/br-cookiebar.cjs.entry.js +5 -5
  22. package/dist/cjs/br-crumb.cjs.entry.js +2 -2
  23. package/dist/cjs/br-date-picker_3.cjs.entry.js +165 -78
  24. package/dist/cjs/br-datetime-picker.cjs.entry.js +11 -28
  25. package/dist/cjs/br-divider.cjs.entry.js +4 -4
  26. package/dist/cjs/br-dropdown.cjs.entry.js +677 -0
  27. package/dist/cjs/br-footer-category.cjs.entry.js +4 -4
  28. package/dist/cjs/br-footer-item.cjs.entry.js +3 -3
  29. package/dist/cjs/br-footer-legal.cjs.entry.js +3 -3
  30. package/dist/cjs/br-footer-logo.cjs.entry.js +3 -3
  31. package/dist/cjs/br-footer-social.cjs.entry.js +3 -3
  32. package/dist/cjs/br-footer.cjs.entry.js +5 -5
  33. package/dist/cjs/br-header-function.cjs.entry.js +3 -3
  34. package/dist/cjs/br-header-link.cjs.entry.js +3 -3
  35. package/dist/cjs/br-header-list.cjs.entry.js +4 -4
  36. package/dist/cjs/br-header-logo.cjs.entry.js +3 -3
  37. package/dist/cjs/br-header.cjs.entry.js +6 -6
  38. package/dist/cjs/br-icon.cjs.entry.js +173 -159
  39. package/dist/cjs/br-input_2.cjs.entry.js +1427 -0
  40. package/dist/cjs/br-item.cjs.entry.js +4 -4
  41. package/dist/cjs/br-link.cjs.entry.js +9 -9
  42. package/dist/cjs/br-magic-button.cjs.entry.js +11 -12
  43. package/dist/cjs/br-menu-group.cjs.entry.js +3 -3
  44. package/dist/cjs/br-menu-header.cjs.entry.js +3 -3
  45. package/dist/cjs/br-menu-info.cjs.entry.js +3 -3
  46. package/dist/cjs/br-menu-item.cjs.entry.js +3 -3
  47. package/dist/cjs/br-menu-link.cjs.entry.js +3 -3
  48. package/dist/cjs/br-menu-list.cjs.entry.js +2 -2
  49. package/dist/cjs/br-menu-logo.cjs.entry.js +3 -3
  50. package/dist/cjs/br-menu-social.cjs.entry.js +2 -2
  51. package/dist/cjs/br-menu.cjs.entry.js +5 -5
  52. package/dist/cjs/br-modal.cjs.entry.js +2 -2
  53. package/dist/cjs/br-notification-body.cjs.entry.js +3 -3
  54. package/dist/cjs/br-notification-header.cjs.entry.js +3 -3
  55. package/dist/cjs/br-notification-item.cjs.entry.js +3 -3
  56. package/dist/cjs/br-notification.cjs.entry.js +4 -4
  57. package/dist/cjs/br-pagination_2.cjs.entry.js +2578 -0
  58. package/dist/cjs/br-radio-group.cjs.entry.js +5 -5
  59. package/dist/cjs/br-radio.cjs.entry.js +5 -5
  60. package/dist/cjs/br-scrim.cjs.entry.js +4 -4
  61. package/dist/cjs/br-select-input_3.cjs.entry.js +49 -103
  62. package/dist/cjs/br-sign-in.cjs.entry.js +4 -4
  63. package/dist/cjs/br-skip-link-item.cjs.entry.js +2 -2
  64. package/dist/cjs/br-skip-link.cjs.entry.js +3 -3
  65. package/dist/cjs/br-skiplink-item.cjs.entry.js +3 -3
  66. package/dist/cjs/br-slider.cjs.entry.js +4 -4
  67. package/dist/cjs/br-step_2.cjs.entry.js +7 -7
  68. package/dist/cjs/br-switch.cjs.entry.js +5 -5
  69. package/dist/cjs/br-tab-item.cjs.entry.js +3 -3
  70. package/dist/cjs/br-tab.cjs.entry.js +8 -8
  71. package/dist/cjs/br-table-action_6.cjs.entry.js +1500 -0
  72. package/dist/cjs/br-table-body.cjs.entry.js +4 -16
  73. package/dist/cjs/br-table-header.cjs.entry.js +4 -16
  74. package/dist/cjs/br-table.cjs.entry.js +2616 -433
  75. package/dist/cjs/br-tag.cjs.entry.js +5 -5
  76. package/dist/cjs/br-textarea.cjs.entry.js +4 -4
  77. package/dist/cjs/br-tooltip.cjs.entry.js +5 -29
  78. package/dist/cjs/br-upload.cjs.entry.js +5 -5
  79. package/dist/cjs/br-wizard-panel.cjs.entry.js +3 -3
  80. package/dist/cjs/br-wizard.cjs.entry.js +3 -3
  81. package/dist/cjs/{datetime-picker-constants-CCeI5iW7.js → datetime-picker-constants-CTf1kVJ1.js} +1 -0
  82. package/dist/cjs/helpers-DkkDubv1.js +28 -0
  83. package/dist/cjs/{icon.utils-DF6kMskA.js → icon.utils-CMs0ukvR.js} +1 -1
  84. package/dist/cjs/{iconify-icon-DfODV9bf.js → iconify-icon-LjavbM-D.js} +103 -57
  85. package/dist/cjs/{index-Bc30P_6z.js → index-BP8UIQro.js} +34 -34
  86. package/dist/cjs/{index-C-IpVFDH.js → index-Caoez3xb.js} +64 -16
  87. package/dist/cjs/index.cjs.js +2 -2
  88. package/dist/cjs/{isValid-CduHZTFc.js → isValid-DgJ-noPS.js} +1 -1
  89. package/dist/cjs/loader.cjs.js +2 -2
  90. package/dist/cjs/{slot-DAllytTj.js → slot-CjaqqX7y.js} +1 -1
  91. package/dist/cjs/table.utils-De-9_NgJ.js +749 -0
  92. package/dist/cjs/webcomponents.cjs.js +2 -2
  93. package/dist/collection/collection-manifest.json +3 -0
  94. package/dist/collection/components/avatar/avatar.css +1 -1
  95. package/dist/collection/components/avatar/avatar.js +21 -21
  96. package/dist/collection/components/breadcrumb/breadcrumb-item/breadcrumb-item.js +4 -12
  97. package/dist/collection/components/breadcrumb/breadcrumb.css +1 -1
  98. package/dist/collection/components/breadcrumb/breadcrumb.js +39 -34
  99. package/dist/collection/components/breadcrumb/crumb/crumb.js +2 -13
  100. package/dist/collection/components/button/button.css +1 -1
  101. package/dist/collection/components/button/button.js +22 -22
  102. package/dist/collection/components/card/card.css +1 -1
  103. package/dist/collection/components/card/card.js +20 -22
  104. package/dist/collection/components/carousel/carousel-page/carousel-page.css +1 -1
  105. package/dist/collection/components/carousel/carousel-page/carousel-page.js +3 -13
  106. package/dist/collection/components/carousel/carousel.css +1 -1
  107. package/dist/collection/components/carousel/carousel.js +25 -32
  108. package/dist/collection/components/checkbox/checkbox.css +1 -1
  109. package/dist/collection/components/checkbox/checkbox.js +18 -24
  110. package/dist/collection/components/checkbox-group/checkbox-group.css +1 -1
  111. package/dist/collection/components/checkbox-group/checkbox-group.js +19 -20
  112. package/dist/collection/components/checkgroup/checkgroup.js +2 -14
  113. package/dist/collection/components/collapse/collapse.css +1 -1
  114. package/dist/collection/components/collapse/collapse.js +33 -29
  115. package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.css +1 -1
  116. package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.js +3 -16
  117. package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.css +1 -1
  118. package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.js +4 -17
  119. package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.css +1 -1
  120. package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.js +3 -16
  121. package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.css +1 -1
  122. package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.js +3 -15
  123. package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.css +1 -1
  124. package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.js +3 -14
  125. package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.css +1 -1
  126. package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.js +3 -14
  127. package/dist/collection/components/cookiebar/cookiebar.css +1 -1
  128. package/dist/collection/components/cookiebar/cookiebar.js +33 -28
  129. package/dist/collection/components/datetime-picker/date-picker/date-picker-locale.js +62 -15
  130. package/dist/collection/components/datetime-picker/date-picker/date-picker.css +1 -1
  131. package/dist/collection/components/datetime-picker/date-picker/date-picker.js +123 -74
  132. package/dist/collection/components/datetime-picker/datetime-input/datetime-input.css +1 -1
  133. package/dist/collection/components/datetime-picker/datetime-input/datetime-input.js +5 -15
  134. package/dist/collection/components/datetime-picker/datetime-picker.css +1 -1
  135. package/dist/collection/components/datetime-picker/datetime-picker.js +23 -27
  136. package/dist/collection/components/datetime-picker/datetime-picker.utils.js +6 -6
  137. package/dist/collection/components/datetime-picker/time-picker/time-picker.css +1 -1
  138. package/dist/collection/components/datetime-picker/time-picker/time-picker.js +7 -17
  139. package/dist/collection/components/divider/divider.css +1 -1
  140. package/dist/collection/components/divider/divider.js +15 -19
  141. package/dist/collection/components/dropdown/dropdown.css +1 -1
  142. package/dist/collection/components/dropdown/dropdown.js +27 -28
  143. package/dist/collection/components/footer/footer-category/footer-category.css +1 -1
  144. package/dist/collection/components/footer/footer-category/footer-category.js +4 -17
  145. package/dist/collection/components/footer/footer-item/footer-item.css +1 -1
  146. package/dist/collection/components/footer/footer-item/footer-item.js +3 -16
  147. package/dist/collection/components/footer/footer-legal/footer-legal.css +1 -1
  148. package/dist/collection/components/footer/footer-legal/footer-legal.js +2 -16
  149. package/dist/collection/components/footer/footer-logo/footer-logo.css +1 -1
  150. package/dist/collection/components/footer/footer-logo/footer-logo.js +3 -16
  151. package/dist/collection/components/footer/footer-social/footer-social.css +1 -1
  152. package/dist/collection/components/footer/footer-social/footer-social.js +4 -16
  153. package/dist/collection/components/footer/footer.css +1 -1
  154. package/dist/collection/components/footer/footer.js +25 -29
  155. package/dist/collection/components/header/header-function/header-function.css +1 -1
  156. package/dist/collection/components/header/header-function/header-function.js +10 -14
  157. package/dist/collection/components/header/header-link/header-link.css +1 -1
  158. package/dist/collection/components/header/header-link/header-link.js +3 -16
  159. package/dist/collection/components/header/header-list/header-list.css +1 -1
  160. package/dist/collection/components/header/header-list/header-list.js +4 -17
  161. package/dist/collection/components/header/header-logo/header-logo.css +1 -1
  162. package/dist/collection/components/header/header-logo/header-logo.js +3 -16
  163. package/dist/collection/components/header/header.css +1 -1
  164. package/dist/collection/components/header/header.js +33 -30
  165. package/dist/collection/components/icon/default-icons-cache.js +159 -146
  166. package/dist/collection/components/icon/icon.css +1 -1
  167. package/dist/collection/components/icon/icon.js +38 -29
  168. package/dist/collection/components/icon/icon.utils.js +1 -1
  169. package/dist/collection/components/input/input.css +1 -1
  170. package/dist/collection/components/input/input.js +216 -30
  171. package/dist/collection/components/item/item.css +1 -1
  172. package/dist/collection/components/item/item.js +18 -22
  173. package/dist/collection/components/link/link.css +1 -1
  174. package/dist/collection/components/link/link.js +25 -29
  175. package/dist/collection/components/list/list.css +1 -1
  176. package/dist/collection/components/list/list.js +17 -21
  177. package/dist/collection/components/loading/loading.css +1 -1
  178. package/dist/collection/components/loading/loading.js +17 -24
  179. package/dist/collection/components/magic-button/magic-button.css +1 -1
  180. package/dist/collection/components/magic-button/magic-button.js +21 -29
  181. package/dist/collection/components/menu/menu-group/menu-group.css +1 -1
  182. package/dist/collection/components/menu/menu-group/menu-group.js +3 -16
  183. package/dist/collection/components/menu/menu-header/menu-header.css +1 -1
  184. package/dist/collection/components/menu/menu-header/menu-header.js +3 -16
  185. package/dist/collection/components/menu/menu-info/menu-info.css +1 -1
  186. package/dist/collection/components/menu/menu-info/menu-info.js +2 -15
  187. package/dist/collection/components/menu/menu-item/menu-item.css +1 -1
  188. package/dist/collection/components/menu/menu-item/menu-item.js +3 -16
  189. package/dist/collection/components/menu/menu-link/menu-link.css +1 -1
  190. package/dist/collection/components/menu/menu-link/menu-link.js +5 -17
  191. package/dist/collection/components/menu/menu-list/menu-list.css +1 -1
  192. package/dist/collection/components/menu/menu-list/menu-list.js +2 -15
  193. package/dist/collection/components/menu/menu-logo/menu-logo.css +1 -1
  194. package/dist/collection/components/menu/menu-logo/menu-logo.js +2 -15
  195. package/dist/collection/components/menu/menu-social/menu-social.css +1 -1
  196. package/dist/collection/components/menu/menu-social/menu-social.js +3 -16
  197. package/dist/collection/components/menu/menu.css +1 -1
  198. package/dist/collection/components/menu/menu.js +28 -35
  199. package/dist/collection/components/message/message.css +1 -1
  200. package/dist/collection/components/message/message.js +22 -25
  201. package/dist/collection/components/modal/modal.css +1 -1
  202. package/dist/collection/components/modal/modal.js +18 -21
  203. package/dist/collection/components/notification/notification-body/notification-body.css +1 -1
  204. package/dist/collection/components/notification/notification-body/notification-body.js +3 -13
  205. package/dist/collection/components/notification/notification-header/notification-header.css +1 -1
  206. package/dist/collection/components/notification/notification-header/notification-header.js +3 -14
  207. package/dist/collection/components/notification/notification-item/notification-item.css +1 -1
  208. package/dist/collection/components/notification/notification-item/notification-item.js +3 -16
  209. package/dist/collection/components/notification/notification.css +1 -1
  210. package/dist/collection/components/notification/notification.js +20 -29
  211. package/dist/collection/components/pagination/pagination.css +1 -1
  212. package/dist/collection/components/pagination/pagination.js +19 -27
  213. package/dist/collection/components/radio/radio.css +1 -1
  214. package/dist/collection/components/radio/radio.js +17 -20
  215. package/dist/collection/components/radio-group/radio-group.css +1 -1
  216. package/dist/collection/components/radio-group/radio-group.js +20 -20
  217. package/dist/collection/components/scrim/scrim.css +1 -1
  218. package/dist/collection/components/scrim/scrim.js +14 -17
  219. package/dist/collection/components/select/select-input/select-input.css +1 -1
  220. package/dist/collection/components/select/select-input/select-input.js +48 -102
  221. package/dist/collection/components/select/select-list/select-list.css +1 -1
  222. package/dist/collection/components/select/select-list/select-list.js +52 -15
  223. package/dist/collection/components/select/select-option/select-option.css +1 -1
  224. package/dist/collection/components/select/select-option/select-option.js +13 -17
  225. package/dist/collection/components/select/select.css +1 -1
  226. package/dist/collection/components/select/select.js +104 -110
  227. package/dist/collection/components/sign-in/sign-in.css +1 -1
  228. package/dist/collection/components/sign-in/sign-in.js +12 -16
  229. package/dist/collection/components/skip-link/skip-link-item/skip-link-item-alias.js +8 -4
  230. package/dist/collection/components/skip-link/skip-link-item/skip-link-item.css +1 -1
  231. package/dist/collection/components/skip-link/skip-link-item/skip-link-item.js +5 -15
  232. package/dist/collection/components/skip-link/skip-link.css +1 -1
  233. package/dist/collection/components/skip-link/skip-link.js +18 -24
  234. package/dist/collection/components/slider/slider.css +1 -1
  235. package/dist/collection/components/slider/slider.js +18 -28
  236. package/dist/collection/components/step/step-item/step-item.css +1 -1
  237. package/dist/collection/components/step/step-item/step-item.js +5 -15
  238. package/dist/collection/components/step/step.css +1 -1
  239. package/dist/collection/components/step/step.js +16 -25
  240. package/dist/collection/components/switch/switch.css +1 -1
  241. package/dist/collection/components/switch/switch.js +16 -20
  242. package/dist/collection/components/tab/tab-item/tab-item.css +1 -1
  243. package/dist/collection/components/tab/tab-item/tab-item.js +6 -16
  244. package/dist/collection/components/tab/tab.css +1 -1
  245. package/dist/collection/components/tab/tab.js +24 -31
  246. package/dist/collection/components/table/table-action/table-action.css +1 -0
  247. package/dist/collection/components/table/table-action/table-action.js +349 -0
  248. package/dist/collection/components/table/table-bar/table-bar.css +1 -0
  249. package/dist/collection/components/table/table-bar/table-bar.js +652 -0
  250. package/dist/collection/components/table/table-body/table-body.css +1 -1
  251. package/dist/collection/components/table/table-body/table-body.js +11 -26
  252. package/dist/collection/components/table/table-cell/table-cell.css +1 -1
  253. package/dist/collection/components/table/table-cell/table-cell.js +555 -91
  254. package/dist/collection/components/table/table-footer/table-footer.css +1 -0
  255. package/dist/collection/components/table/table-footer/table-footer.js +233 -0
  256. package/dist/collection/components/table/table-header/table-header.css +1 -1
  257. package/dist/collection/components/table/table-header/table-header.js +10 -26
  258. package/dist/collection/components/table/table-header-cell/table-header-cell.css +1 -1
  259. package/dist/collection/components/table/table-header-cell/table-header-cell.js +286 -95
  260. package/dist/collection/components/table/table-row/table-row.css +1 -1
  261. package/dist/collection/components/table/table-row/table-row.js +311 -66
  262. package/dist/collection/components/table/table.actions-tooltip.js +33 -0
  263. package/dist/collection/components/table/{table-constants.js → table.constants.js} +54 -77
  264. package/dist/collection/components/table/table.css +1 -1
  265. package/dist/collection/components/table/table.data.js +461 -0
  266. package/dist/collection/components/table/table.expansion.elements.js +70 -0
  267. package/dist/collection/components/table/table.expansion.js +179 -0
  268. package/dist/collection/components/table/table.grouping.js +97 -0
  269. package/dist/collection/components/table/table.header-height.js +47 -0
  270. package/dist/collection/components/table/table.js +2499 -625
  271. package/dist/collection/components/table/table.keyboard.js +340 -0
  272. package/dist/collection/components/table/table.scroll-shadows.js +36 -0
  273. package/dist/collection/components/table/table.selection.elements.js +63 -0
  274. package/dist/collection/components/table/table.selection.js +239 -0
  275. package/dist/collection/components/table/table.tokens.js +28 -0
  276. package/dist/collection/components/table/table.types.js +1 -0
  277. package/dist/collection/components/table/table.utils.js +75 -0
  278. package/dist/collection/components/table/table.virtual-list.js +342 -0
  279. package/dist/collection/components/tag/tag.css +1 -1
  280. package/dist/collection/components/tag/tag.js +17 -26
  281. package/dist/collection/components/textarea/textarea.css +1 -1
  282. package/dist/collection/components/textarea/textarea.js +14 -22
  283. package/dist/collection/components/tooltip/tooltip.css +1 -1
  284. package/dist/collection/components/tooltip/tooltip.js +15 -45
  285. package/dist/collection/components/upload/upload.css +1 -1
  286. package/dist/collection/components/upload/upload.js +36 -29
  287. package/dist/collection/components/wizard/wizard-panel/wizard-panel.css +1 -1
  288. package/dist/collection/components/wizard/wizard-panel/wizard-panel.js +3 -13
  289. package/dist/collection/components/wizard/wizard.css +1 -1
  290. package/dist/collection/components/wizard/wizard.js +22 -26
  291. package/dist/collection/pages/components/select/remote-options.js +87 -0
  292. package/dist/collection/pages/scripts/code-editor.js +28 -3
  293. package/dist/collection/pages/scripts/pageLoader.js +286 -20
  294. package/dist/collection/pages/scripts/pageloader-preview.js +3 -1
  295. package/dist/collection/shared/utils/slot.js +1 -1
  296. package/dist/components/br-avatar.js +1 -1
  297. package/dist/components/br-breadcrumb-item.js +1 -1
  298. package/dist/components/br-breadcrumb.js +1 -1
  299. package/dist/components/br-button.js +1 -1
  300. package/dist/components/br-card.js +1 -1
  301. package/dist/components/br-carousel-page.js +1 -1
  302. package/dist/components/br-carousel.js +1 -1
  303. package/dist/components/br-checkbox-group.js +1 -1
  304. package/dist/components/br-checkbox.js +1 -1
  305. package/dist/components/br-checkgroup.js +1 -1
  306. package/dist/components/br-collapse.js +1 -1
  307. package/dist/components/br-cookiebar-cookie.js +1 -1
  308. package/dist/components/br-cookiebar-group.js +1 -1
  309. package/dist/components/br-cookiebar-header.js +1 -1
  310. package/dist/components/br-cookiebar-link.js +1 -1
  311. package/dist/components/br-cookiebar-note-group.js +1 -1
  312. package/dist/components/br-cookiebar-note.js +1 -1
  313. package/dist/components/br-cookiebar.js +1 -1
  314. package/dist/components/br-crumb.js +1 -1
  315. package/dist/components/br-date-picker.js +1 -1
  316. package/dist/components/br-datetime-input.js +1 -1
  317. package/dist/components/br-datetime-picker.js +1 -1
  318. package/dist/components/br-divider.js +1 -1
  319. package/dist/components/br-dropdown.js +1 -1
  320. package/dist/components/br-footer-category.js +1 -1
  321. package/dist/components/br-footer-item.js +1 -1
  322. package/dist/components/br-footer-legal.js +1 -1
  323. package/dist/components/br-footer-logo.js +1 -1
  324. package/dist/components/br-footer-social.js +1 -1
  325. package/dist/components/br-footer.js +1 -1
  326. package/dist/components/br-header-function.js +1 -1
  327. package/dist/components/br-header-link.js +1 -1
  328. package/dist/components/br-header-list.js +1 -1
  329. package/dist/components/br-header-logo.js +1 -1
  330. package/dist/components/br-header.js +1 -1
  331. package/dist/components/br-icon.js +1 -1
  332. package/dist/components/br-input.js +1 -1
  333. package/dist/components/br-item.js +1 -1
  334. package/dist/components/br-link.js +1 -1
  335. package/dist/components/br-list.js +1 -1
  336. package/dist/components/br-loading.js +1 -1
  337. package/dist/components/br-magic-button.js +1 -1
  338. package/dist/components/br-menu-group.js +1 -1
  339. package/dist/components/br-menu-header.js +1 -1
  340. package/dist/components/br-menu-info.js +1 -1
  341. package/dist/components/br-menu-item.js +1 -1
  342. package/dist/components/br-menu-link.js +1 -1
  343. package/dist/components/br-menu-list.js +1 -1
  344. package/dist/components/br-menu-logo.js +1 -1
  345. package/dist/components/br-menu-social.js +1 -1
  346. package/dist/components/br-menu.js +1 -1
  347. package/dist/components/br-message.js +1 -1
  348. package/dist/components/br-modal.js +1 -1
  349. package/dist/components/br-notification-body.js +1 -1
  350. package/dist/components/br-notification-header.js +1 -1
  351. package/dist/components/br-notification-item.js +1 -1
  352. package/dist/components/br-notification.js +1 -1
  353. package/dist/components/br-pagination.js +1 -1
  354. package/dist/components/br-radio-group.js +1 -1
  355. package/dist/components/br-radio.js +1 -1
  356. package/dist/components/br-scrim.js +1 -1
  357. package/dist/components/br-select-input.js +1 -1
  358. package/dist/components/br-select-list.js +1 -1
  359. package/dist/components/br-select-option.js +1 -1
  360. package/dist/components/br-select.js +1 -1
  361. package/dist/components/br-sign-in.js +1 -1
  362. package/dist/components/br-skip-link-item.js +1 -1
  363. package/dist/components/br-skip-link.js +1 -1
  364. package/dist/components/br-skiplink-item.js +1 -1
  365. package/dist/components/br-slider.js +1 -1
  366. package/dist/components/br-step-item.js +1 -1
  367. package/dist/components/br-step.js +1 -1
  368. package/dist/components/br-switch.js +1 -1
  369. package/dist/components/br-tab-item.js +1 -1
  370. package/dist/components/br-tab.js +1 -1
  371. package/dist/components/br-table-action.d.ts +11 -0
  372. package/dist/components/br-table-action.js +5 -0
  373. package/dist/components/br-table-bar.d.ts +11 -0
  374. package/dist/components/br-table-bar.js +5 -0
  375. package/dist/components/br-table-body.js +1 -1
  376. package/dist/components/br-table-cell.js +1 -1
  377. package/dist/components/br-table-footer.d.ts +11 -0
  378. package/dist/components/br-table-footer.js +5 -0
  379. package/dist/components/br-table-header-cell.js +1 -1
  380. package/dist/components/br-table-header.js +1 -1
  381. package/dist/components/br-table-row.js +1 -1
  382. package/dist/components/br-table.js +1 -1
  383. package/dist/components/br-tag.js +1 -1
  384. package/dist/components/br-textarea.js +1 -1
  385. package/dist/components/br-time-picker.js +1 -1
  386. package/dist/components/br-tooltip.js +1 -1
  387. package/dist/components/br-upload.js +1 -1
  388. package/dist/components/br-wizard-panel.js +1 -1
  389. package/dist/components/br-wizard.js +1 -1
  390. package/dist/components/index.d.ts +6 -0
  391. package/dist/components/index.js +1 -1
  392. package/dist/components/p-082jxuTj.js +5 -0
  393. package/dist/components/p-381n6AwK.js +5 -0
  394. package/dist/components/p-B5_zbRAr.js +5 -0
  395. package/dist/components/p-BE1gDPwC.js +5 -0
  396. package/dist/components/p-BV-c2pxt.js +5 -0
  397. package/dist/components/p-BfFbYAuJ.js +5 -0
  398. package/dist/components/{p-ta-24T1Z.js → p-Bi2E_w9Q.js} +1 -1
  399. package/dist/components/p-Bk8YcMql.js +5 -0
  400. package/dist/components/p-C3ISxUGw.js +5 -0
  401. package/dist/components/p-C3J0TVQO.js +5 -0
  402. package/dist/components/p-C6m13lCc.js +5 -0
  403. package/dist/components/{p-DBmwzG9E.js → p-CCWJ-H33.js} +1 -1
  404. package/dist/components/p-CJuHirYK.js +5 -0
  405. package/dist/components/{p-PV731d8s.js → p-CKS7ggLM.js} +1 -1
  406. package/dist/components/p-COSFBwu9.js +5 -0
  407. package/dist/components/{p-DsO4F0Cz.js → p-CVz_akHx.js} +1 -1
  408. package/dist/components/p-CWPrXYam.js +5 -0
  409. package/dist/components/p-C_DC6oQW.js +16 -0
  410. package/dist/components/p-Ca89D_0s.js +5 -0
  411. package/dist/components/p-CbN58CFi.js +5 -0
  412. package/dist/components/p-CjjxTkKb.js +5 -0
  413. package/dist/components/p-Ck9t4WSb.js +5 -0
  414. package/dist/components/p-CvfVwD6_.js +5 -0
  415. package/dist/components/p-D-1sfjhG.js +5 -0
  416. package/dist/components/p-D-p4vLlP.js +5 -0
  417. package/dist/components/p-D6DArHGH.js +5 -0
  418. package/dist/components/p-DD3BItoS.js +5 -0
  419. package/dist/components/{p-jOb1hCPi.js → p-DEIKwFIf.js} +1 -1
  420. package/dist/components/p-DHHAIESt.js +5 -0
  421. package/dist/components/{p-Jk_KQE5V.js → p-DMj5iO7_.js} +1 -1
  422. package/dist/components/p-DUI-S07G.js +5 -0
  423. package/dist/components/p-D_K9JH6J.js +5 -0
  424. package/dist/components/p-DiQp2Lap.js +5 -0
  425. package/dist/components/{p-rMnkh3Cy.js → p-Dn36Mj2E.js} +1 -1
  426. package/dist/components/{p-D-3G3Ioq.js → p-Dvbqhybt.js} +1 -1
  427. package/dist/components/p-Dy7MSvt-.js +5 -0
  428. package/dist/components/p-DywTXNHQ.js +5 -0
  429. package/dist/components/p-Ft_P7Roz.js +5 -0
  430. package/dist/components/{p-CbgKdASU.js → p-JkJjzmGm.js} +1 -1
  431. package/dist/components/p-KuiFoKDl.js +5 -0
  432. package/dist/components/p-MiiczSWA.js +5 -0
  433. package/dist/components/p-Um3K2SHu.js +5 -0
  434. package/dist/components/p-YxddSP6q.js +5 -0
  435. package/dist/components/p-Zk91ebVT.js +5 -0
  436. package/dist/components/p-jv2oG0vH.js +5 -0
  437. package/dist/components/p-nrG_Gd0c.js +5 -0
  438. package/dist/components/p-syLEZrcg.js +5 -0
  439. package/dist/components/p-ydfWTgrA.js +5 -0
  440. package/dist/esm/br-avatar.entry.js +5 -5
  441. package/dist/esm/br-breadcrumb-item.entry.js +2 -2
  442. package/dist/esm/br-breadcrumb.entry.js +12 -12
  443. package/dist/esm/br-button_2.entry.js +7 -7
  444. package/dist/esm/br-card.entry.js +4 -4
  445. package/dist/esm/br-carousel-page.entry.js +3 -3
  446. package/dist/esm/br-carousel.entry.js +6 -6
  447. package/dist/esm/br-checkbox-group.entry.js +5 -5
  448. package/dist/esm/br-checkbox.entry.js +6 -6
  449. package/dist/esm/br-checkgroup.entry.js +2 -2
  450. package/dist/esm/br-collapse_2.entry.js +11 -11
  451. package/dist/esm/br-cookiebar-cookie.entry.js +3 -3
  452. package/dist/esm/br-cookiebar-group.entry.js +4 -4
  453. package/dist/esm/br-cookiebar-header.entry.js +3 -3
  454. package/dist/esm/br-cookiebar-link.entry.js +4 -4
  455. package/dist/esm/br-cookiebar-note-group.entry.js +3 -3
  456. package/dist/esm/br-cookiebar-note.entry.js +3 -3
  457. package/dist/esm/br-cookiebar.entry.js +6 -6
  458. package/dist/esm/br-crumb.entry.js +2 -2
  459. package/dist/esm/br-date-picker_3.entry.js +165 -78
  460. package/dist/esm/br-datetime-picker.entry.js +10 -27
  461. package/dist/esm/br-divider.entry.js +5 -5
  462. package/dist/esm/br-dropdown.entry.js +675 -0
  463. package/dist/esm/br-footer-category.entry.js +4 -4
  464. package/dist/esm/br-footer-item.entry.js +4 -4
  465. package/dist/esm/br-footer-legal.entry.js +3 -3
  466. package/dist/esm/br-footer-logo.entry.js +4 -4
  467. package/dist/esm/br-footer-social.entry.js +4 -4
  468. package/dist/esm/br-footer.entry.js +6 -6
  469. package/dist/esm/br-header-function.entry.js +4 -4
  470. package/dist/esm/br-header-link.entry.js +4 -4
  471. package/dist/esm/br-header-list.entry.js +4 -4
  472. package/dist/esm/br-header-logo.entry.js +4 -4
  473. package/dist/esm/br-header.entry.js +7 -7
  474. package/dist/esm/br-icon.entry.js +174 -160
  475. package/dist/esm/br-input_2.entry.js +1424 -0
  476. package/dist/esm/br-item.entry.js +5 -5
  477. package/dist/esm/br-link.entry.js +10 -10
  478. package/dist/esm/br-magic-button.entry.js +12 -13
  479. package/dist/esm/br-menu-group.entry.js +3 -3
  480. package/dist/esm/br-menu-header.entry.js +3 -3
  481. package/dist/esm/br-menu-info.entry.js +3 -3
  482. package/dist/esm/br-menu-item.entry.js +4 -4
  483. package/dist/esm/br-menu-link.entry.js +4 -4
  484. package/dist/esm/br-menu-list.entry.js +2 -2
  485. package/dist/esm/br-menu-logo.entry.js +3 -3
  486. package/dist/esm/br-menu-social.entry.js +3 -3
  487. package/dist/esm/br-menu.entry.js +6 -6
  488. package/dist/esm/br-modal.entry.js +3 -3
  489. package/dist/esm/br-notification-body.entry.js +3 -3
  490. package/dist/esm/br-notification-header.entry.js +3 -3
  491. package/dist/esm/br-notification-item.entry.js +4 -4
  492. package/dist/esm/br-notification.entry.js +5 -5
  493. package/dist/esm/br-pagination_2.entry.js +2575 -0
  494. package/dist/esm/br-radio-group.entry.js +6 -6
  495. package/dist/esm/br-radio.entry.js +6 -6
  496. package/dist/esm/br-scrim.entry.js +5 -5
  497. package/dist/esm/br-select-input_3.entry.js +50 -104
  498. package/dist/esm/br-sign-in.entry.js +5 -5
  499. package/dist/esm/br-skip-link-item.entry.js +2 -2
  500. package/dist/esm/br-skip-link.entry.js +4 -4
  501. package/dist/esm/br-skiplink-item.entry.js +4 -4
  502. package/dist/esm/br-slider.entry.js +5 -5
  503. package/dist/esm/br-step_2.entry.js +8 -8
  504. package/dist/esm/br-switch.entry.js +6 -6
  505. package/dist/esm/br-tab-item.entry.js +4 -4
  506. package/dist/esm/br-tab.entry.js +9 -9
  507. package/dist/esm/br-table-action_6.entry.js +1493 -0
  508. package/dist/esm/br-table-body.entry.js +4 -16
  509. package/dist/esm/br-table-header.entry.js +4 -16
  510. package/dist/esm/br-table.entry.js +2591 -408
  511. package/dist/esm/br-tag.entry.js +6 -6
  512. package/dist/esm/br-textarea.entry.js +5 -5
  513. package/dist/esm/br-tooltip.entry.js +6 -30
  514. package/dist/esm/br-upload.entry.js +6 -6
  515. package/dist/esm/br-wizard-panel.entry.js +3 -3
  516. package/dist/esm/br-wizard.entry.js +4 -4
  517. package/dist/esm/{datetime-picker-constants-DDc4sADe.js → datetime-picker-constants-1l4_-FEJ.js} +1 -1
  518. package/dist/esm/helpers-BNW9pAhl.js +26 -0
  519. package/dist/esm/{icon.utils-zlORkiHQ.js → icon.utils-CXDYKUBz.js} +1 -1
  520. package/dist/esm/{iconify-icon-D3usVJE2.js → iconify-icon-C_DC6oQW.js} +103 -57
  521. package/dist/esm/{index-CytVKoHT.js → index-BQRBKuY0.js} +64 -17
  522. package/dist/esm/{index-ConyRdJe.js → index-CwL52661.js} +34 -35
  523. package/dist/esm/index.js +2 -2
  524. package/dist/esm/{isValid-Bee0Uvqc.js → isValid-wU7S6MI2.js} +1 -1
  525. package/dist/esm/loader.js +3 -3
  526. package/dist/esm/{props-D07GjR4_.js → props-BbxNgEcJ.js} +1 -1
  527. package/dist/esm/{slot-BIG-yees.js → slot-Bt01zQ7-.js} +1 -1
  528. package/dist/esm/table.utils-CtVdlcgI.js +706 -0
  529. package/dist/esm/webcomponents.js +3 -3
  530. package/dist/hydrate/index.js +6573 -3030
  531. package/dist/hydrate/index.mjs +6573 -3030
  532. package/dist/types/components/avatar/avatar.d.ts +20 -20
  533. package/dist/types/components/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +3 -11
  534. package/dist/types/components/breadcrumb/breadcrumb.d.ts +30 -25
  535. package/dist/types/components/breadcrumb/crumb/crumb.d.ts +1 -12
  536. package/dist/types/components/button/button.d.ts +20 -20
  537. package/dist/types/components/card/card.d.ts +19 -21
  538. package/dist/types/components/carousel/carousel-page/carousel-page.d.ts +2 -12
  539. package/dist/types/components/carousel/carousel.d.ts +22 -29
  540. package/dist/types/components/checkbox/checkbox.d.ts +16 -22
  541. package/dist/types/components/checkbox-group/checkbox-group.d.ts +17 -18
  542. package/dist/types/components/checkgroup/checkgroup.d.ts +1 -13
  543. package/dist/types/components/collapse/collapse.d.ts +26 -22
  544. package/dist/types/components/cookiebar/cookiebar-cookie/cookiebar-cookie.d.ts +2 -15
  545. package/dist/types/components/cookiebar/cookiebar-group/cookiebar-group.d.ts +2 -15
  546. package/dist/types/components/cookiebar/cookiebar-header/cookiebar-header.d.ts +2 -15
  547. package/dist/types/components/cookiebar/cookiebar-link/cookiebar-link.d.ts +2 -14
  548. package/dist/types/components/cookiebar/cookiebar-note/cookiebar-note.d.ts +2 -13
  549. package/dist/types/components/cookiebar/cookiebar-note-group/cookiebar-note-group.d.ts +2 -13
  550. package/dist/types/components/cookiebar/cookiebar.d.ts +30 -25
  551. package/dist/types/components/datetime-picker/date-picker/date-picker-locale.d.ts +12 -4
  552. package/dist/types/components/datetime-picker/date-picker/date-picker.d.ts +57 -11
  553. package/dist/types/components/datetime-picker/datetime-input/datetime-input.d.ts +2 -12
  554. package/dist/types/components/datetime-picker/datetime-picker.d.ts +22 -26
  555. package/dist/types/components/datetime-picker/time-picker/time-picker.d.ts +3 -13
  556. package/dist/types/components/divider/divider.d.ts +14 -18
  557. package/dist/types/components/dropdown/dropdown.d.ts +21 -20
  558. package/dist/types/components/footer/footer-category/footer-category.d.ts +2 -15
  559. package/dist/types/components/footer/footer-item/footer-item.d.ts +2 -15
  560. package/dist/types/components/footer/footer-legal/footer-legal.d.ts +1 -15
  561. package/dist/types/components/footer/footer-logo/footer-logo.d.ts +2 -15
  562. package/dist/types/components/footer/footer-social/footer-social.d.ts +4 -17
  563. package/dist/types/components/footer/footer.d.ts +23 -27
  564. package/dist/types/components/header/header-function/header-function.d.ts +9 -13
  565. package/dist/types/components/header/header-link/header-link.d.ts +2 -15
  566. package/dist/types/components/header/header-list/header-list.d.ts +2 -15
  567. package/dist/types/components/header/header-logo/header-logo.d.ts +2 -15
  568. package/dist/types/components/header/header.d.ts +29 -26
  569. package/dist/types/components/icon/icon.d.ts +27 -22
  570. package/dist/types/components/icon/icon.utils.d.ts +1 -1
  571. package/dist/types/components/input/input.d.ts +46 -23
  572. package/dist/types/components/input/input.types.d.ts +18 -0
  573. package/dist/types/components/item/item.d.ts +17 -21
  574. package/dist/types/components/link/link.d.ts +18 -22
  575. package/dist/types/components/list/list.d.ts +16 -20
  576. package/dist/types/components/loading/loading.d.ts +16 -23
  577. package/dist/types/components/magic-button/magic-button.d.ts +17 -25
  578. package/dist/types/components/menu/menu-group/menu-group.d.ts +2 -15
  579. package/dist/types/components/menu/menu-header/menu-header.d.ts +2 -15
  580. package/dist/types/components/menu/menu-info/menu-info.d.ts +1 -14
  581. package/dist/types/components/menu/menu-item/menu-item.d.ts +2 -15
  582. package/dist/types/components/menu/menu-link/menu-link.d.ts +4 -16
  583. package/dist/types/components/menu/menu-list/menu-list.d.ts +2 -15
  584. package/dist/types/components/menu/menu-logo/menu-logo.d.ts +1 -14
  585. package/dist/types/components/menu/menu-social/menu-social.d.ts +4 -18
  586. package/dist/types/components/menu/menu.d.ts +25 -32
  587. package/dist/types/components/message/message.d.ts +21 -24
  588. package/dist/types/components/modal/modal.d.ts +18 -21
  589. package/dist/types/components/notification/notification-body/notification-body.d.ts +2 -12
  590. package/dist/types/components/notification/notification-header/notification-header.d.ts +2 -13
  591. package/dist/types/components/notification/notification-item/notification-item.d.ts +2 -15
  592. package/dist/types/components/notification/notification.d.ts +18 -27
  593. package/dist/types/components/pagination/pagination.d.ts +13 -21
  594. package/dist/types/components/radio/radio.d.ts +15 -18
  595. package/dist/types/components/radio-group/radio-group.d.ts +18 -18
  596. package/dist/types/components/scrim/scrim.d.ts +12 -15
  597. package/dist/types/components/select/select-input/select-input.d.ts +12 -14
  598. package/dist/types/components/select/select-list/select-list.d.ts +13 -12
  599. package/dist/types/components/select/select-option/select-option.d.ts +8 -11
  600. package/dist/types/components/select/select.d.ts +42 -94
  601. package/dist/types/components/sign-in/sign-in.d.ts +11 -15
  602. package/dist/types/components/skip-link/skip-link-item/skip-link-item-alias.d.ts +7 -3
  603. package/dist/types/components/skip-link/skip-link-item/skip-link-item.d.ts +4 -14
  604. package/dist/types/components/skip-link/skip-link.d.ts +17 -23
  605. package/dist/types/components/slider/slider.d.ts +18 -28
  606. package/dist/types/components/step/step-item/step-item.d.ts +2 -12
  607. package/dist/types/components/step/step.d.ts +15 -24
  608. package/dist/types/components/switch/switch.d.ts +14 -18
  609. package/dist/types/components/tab/tab-item/tab-item.d.ts +6 -16
  610. package/dist/types/components/tab/tab.d.ts +20 -27
  611. package/dist/types/components/table/table-action/table-action.d.ts +107 -0
  612. package/dist/types/components/table/table-bar/table-bar.d.ts +193 -0
  613. package/dist/types/components/table/table-body/table-body.d.ts +10 -25
  614. package/dist/types/components/table/table-cell/table-cell.d.ts +177 -46
  615. package/dist/types/components/table/table-footer/table-footer.d.ts +40 -0
  616. package/dist/types/components/table/table-footer/table-footer.types.d.ts +12 -0
  617. package/dist/types/components/table/table-header/table-header.d.ts +9 -25
  618. package/dist/types/components/table/table-header-cell/table-header-cell.d.ts +101 -62
  619. package/dist/types/components/table/table-row/table-row.d.ts +87 -38
  620. package/dist/types/components/table/table.actions-tooltip.d.ts +11 -0
  621. package/dist/types/components/table/{table-constants.d.ts → table.constants.d.ts} +50 -77
  622. package/dist/types/components/table/table.d.ts +601 -229
  623. package/dist/types/components/table/table.data.d.ts +78 -0
  624. package/dist/types/components/table/table.expansion.d.ts +65 -0
  625. package/dist/types/components/table/table.expansion.elements.d.ts +30 -0
  626. package/dist/types/components/table/table.grouping.d.ts +25 -0
  627. package/dist/types/components/table/table.header-height.d.ts +17 -0
  628. package/dist/types/components/table/table.keyboard.d.ts +53 -0
  629. package/dist/types/components/table/table.scroll-shadows.d.ts +11 -0
  630. package/dist/types/components/table/table.selection.d.ts +84 -0
  631. package/dist/types/components/table/table.selection.elements.d.ts +42 -0
  632. package/dist/types/components/table/table.tokens.d.ts +24 -0
  633. package/dist/types/components/table/table.types.d.ts +199 -0
  634. package/dist/types/components/table/table.utils.d.ts +52 -0
  635. package/dist/types/components/table/table.virtual-list.d.ts +96 -0
  636. package/dist/types/components/tag/tag.d.ts +15 -24
  637. package/dist/types/components/textarea/textarea.d.ts +13 -21
  638. package/dist/types/components/tooltip/tooltip.d.ts +12 -18
  639. package/dist/types/components/upload/upload.d.ts +20 -27
  640. package/dist/types/components/wizard/wizard-panel/wizard-panel.d.ts +2 -12
  641. package/dist/types/components/wizard/wizard.d.ts +21 -25
  642. package/dist/types/components.d.ts +4646 -5087
  643. package/dist/webcomponents/index.esm.js +1 -1
  644. package/dist/webcomponents/{p-6f1a4fbe.entry.js → p-07e80bf8.entry.js} +1 -1
  645. package/dist/webcomponents/p-10d81622.entry.js +5 -0
  646. package/dist/webcomponents/p-12d5f533.entry.js +5 -0
  647. package/dist/webcomponents/p-15699e8a.entry.js +5 -0
  648. package/dist/webcomponents/{p-7fda8b89.entry.js → p-15e2f5cc.entry.js} +1 -1
  649. package/dist/webcomponents/{p-198aa844.entry.js → p-16d27d5c.entry.js} +1 -1
  650. package/dist/webcomponents/p-18d3fab8.entry.js +5 -0
  651. package/dist/webcomponents/{p-DDc4sADe.js → p-1l4_-FEJ.js} +1 -1
  652. package/dist/webcomponents/p-23c916d9.entry.js +5 -0
  653. package/dist/webcomponents/p-2aee69fd.entry.js +5 -0
  654. package/dist/webcomponents/p-2d3db296.entry.js +5 -0
  655. package/dist/webcomponents/p-2ed6afdd.entry.js +5 -0
  656. package/dist/webcomponents/{p-42b60169.entry.js → p-30c865e6.entry.js} +1 -1
  657. package/dist/webcomponents/p-32afb78c.entry.js +5 -0
  658. package/dist/webcomponents/p-33d24cbd.entry.js +5 -0
  659. package/dist/webcomponents/p-35d63edd.entry.js +5 -0
  660. package/dist/webcomponents/p-3b1ff55e.entry.js +5 -0
  661. package/dist/webcomponents/p-3c7246cf.entry.js +5 -0
  662. package/dist/webcomponents/{p-6a293be8.entry.js → p-407e7b69.entry.js} +1 -1
  663. package/dist/webcomponents/p-41b12e3c.entry.js +5 -0
  664. package/dist/webcomponents/p-47adc17f.entry.js +5 -0
  665. package/dist/webcomponents/{p-18cf093a.entry.js → p-48fc8e56.entry.js} +1 -1
  666. package/dist/webcomponents/p-4a44c8b8.entry.js +5 -0
  667. package/dist/webcomponents/{p-ac68355e.entry.js → p-4b0f3701.entry.js} +1 -1
  668. package/dist/webcomponents/p-4b66200c.entry.js +5 -0
  669. package/dist/webcomponents/{p-5a7c2031.entry.js → p-4c0a1c05.entry.js} +1 -1
  670. package/dist/webcomponents/p-4c72d706.entry.js +5 -0
  671. package/dist/webcomponents/p-505173e0.entry.js +5 -0
  672. package/dist/webcomponents/p-50caea68.entry.js +5 -0
  673. package/dist/webcomponents/p-5419fd2c.entry.js +5 -0
  674. package/dist/webcomponents/{p-20477061.entry.js → p-5693e0e7.entry.js} +1 -1
  675. package/dist/webcomponents/p-58247764.entry.js +5 -0
  676. package/dist/webcomponents/p-5d0f4851.entry.js +5 -0
  677. package/dist/webcomponents/p-60c949c8.entry.js +5 -0
  678. package/dist/webcomponents/p-61b84035.entry.js +5 -0
  679. package/dist/webcomponents/p-62a74e0a.entry.js +5 -0
  680. package/dist/webcomponents/p-6450913e.entry.js +5 -0
  681. package/dist/webcomponents/p-66c8b8d9.entry.js +5 -0
  682. package/dist/webcomponents/{p-b55425b7.entry.js → p-67281ef1.entry.js} +1 -1
  683. package/dist/webcomponents/{p-0fc112fc.entry.js → p-6e128c7a.entry.js} +1 -1
  684. package/dist/webcomponents/p-725e92ab.entry.js +5 -0
  685. package/dist/webcomponents/{p-09c79c1d.entry.js → p-74726f20.entry.js} +1 -1
  686. package/dist/webcomponents/p-75bd655b.entry.js +5 -0
  687. package/dist/webcomponents/p-7bf78e48.entry.js +5 -0
  688. package/dist/webcomponents/p-7cc28ecf.entry.js +5 -0
  689. package/dist/webcomponents/p-7ec01a99.entry.js +5 -0
  690. package/dist/webcomponents/{p-2c8595d3.entry.js → p-7f17dbca.entry.js} +1 -1
  691. package/dist/webcomponents/p-8120f3ce.entry.js +5 -0
  692. package/dist/webcomponents/p-8ded7870.entry.js +5 -0
  693. package/dist/webcomponents/p-9ab989d1.entry.js +5 -0
  694. package/dist/webcomponents/p-9be642ff.entry.js +5 -0
  695. package/dist/webcomponents/p-9d41995a.entry.js +5 -0
  696. package/dist/webcomponents/p-C_DC6oQW.js +16 -0
  697. package/dist/webcomponents/{p-EbtQZm5s.js → p-CjVabz-h.js} +1 -1
  698. package/dist/webcomponents/{p-fOJu6uZR.js → p-CpE_G6IZ.js} +1 -1
  699. package/dist/webcomponents/{p-ConyRdJe.js → p-CwL52661.js} +2 -2
  700. package/dist/webcomponents/p-DnwERaeQ.js +5 -0
  701. package/dist/webcomponents/p-Zk91ebVT.js +5 -0
  702. package/dist/webcomponents/p-_BMaB_68.js +5 -0
  703. package/dist/webcomponents/p-a150b61d.entry.js +5 -0
  704. package/dist/webcomponents/p-a264acf6.entry.js +5 -0
  705. package/dist/webcomponents/p-a5616523.entry.js +5 -0
  706. package/dist/webcomponents/p-ae3dfb9c.entry.js +5 -0
  707. package/dist/webcomponents/p-b1aeb805.entry.js +5 -0
  708. package/dist/webcomponents/p-b8eea3ef.entry.js +5 -0
  709. package/dist/webcomponents/p-c6952f8d.entry.js +5 -0
  710. package/dist/webcomponents/p-c743e5c5.entry.js +5 -0
  711. package/dist/webcomponents/p-d0c659c3.entry.js +5 -0
  712. package/dist/webcomponents/p-d3dec923.entry.js +5 -0
  713. package/dist/webcomponents/{p-31a4694a.entry.js → p-d5405bbe.entry.js} +1 -1
  714. package/dist/webcomponents/{p-794b701b.entry.js → p-d6d3a552.entry.js} +1 -1
  715. package/dist/webcomponents/p-dab66328.entry.js +5 -0
  716. package/dist/webcomponents/{p-8116ee93.entry.js → p-db02533d.entry.js} +1 -1
  717. package/dist/webcomponents/p-dda22999.entry.js +5 -0
  718. package/dist/webcomponents/p-e2a46f44.entry.js +5 -0
  719. package/dist/webcomponents/{p-67774920.entry.js → p-e3680ff8.entry.js} +1 -1
  720. package/dist/webcomponents/p-e5b9652d.entry.js +5 -0
  721. package/dist/webcomponents/{p-fb76b1e0.entry.js → p-e7f02302.entry.js} +1 -1
  722. package/dist/webcomponents/p-f0720e23.entry.js +5 -0
  723. package/dist/webcomponents/p-f244009d.entry.js +5 -0
  724. package/dist/webcomponents/p-f32c40ee.entry.js +5 -0
  725. package/dist/webcomponents/p-f697abbd.entry.js +5 -0
  726. package/dist/webcomponents/p-f7ed35ef.entry.js +5 -0
  727. package/dist/webcomponents/p-f8576e0a.entry.js +5 -0
  728. package/dist/webcomponents/p-fcc62731.entry.js +5 -0
  729. package/dist/webcomponents/webcomponents.esm.js +1 -1
  730. package/package.json +1 -1
  731. package/dist/cjs/br-dropdown_2.cjs.entry.js +0 -2299
  732. package/dist/cjs/br-input.cjs.entry.js +0 -715
  733. package/dist/cjs/br-loading.cjs.entry.js +0 -567
  734. package/dist/cjs/br-pagination.cjs.entry.js +0 -916
  735. package/dist/cjs/br-table-cell.cjs.entry.js +0 -201
  736. package/dist/cjs/br-table-header-cell.cjs.entry.js +0 -189
  737. package/dist/cjs/br-table-row.cjs.entry.js +0 -95
  738. package/dist/cjs/table-constants-BOPSay0B.js +0 -183
  739. package/dist/collection/components/table/table-tokens.js +0 -50
  740. package/dist/collection/components/table/table-utils.js +0 -44
  741. package/dist/collection/pages/components/select/remote.js +0 -33
  742. package/dist/collection/pages/components/select/virtualized.js +0 -13
  743. package/dist/components/p-5h-W9_JR.js +0 -5
  744. package/dist/components/p-848QkYoM.js +0 -5
  745. package/dist/components/p-BFHvuEnN.js +0 -5
  746. package/dist/components/p-BH6QYnAr.js +0 -5
  747. package/dist/components/p-BcW8O6h2.js +0 -5
  748. package/dist/components/p-BicHMcSS.js +0 -5
  749. package/dist/components/p-Bs7iRQTG.js +0 -5
  750. package/dist/components/p-Bvrw9yWR.js +0 -5
  751. package/dist/components/p-BzQFMh9j.js +0 -5
  752. package/dist/components/p-CBHd0-fF.js +0 -5
  753. package/dist/components/p-CCPHCJjw.js +0 -5
  754. package/dist/components/p-CXMwM9m4.js +0 -5
  755. package/dist/components/p-CeNELttN.js +0 -5
  756. package/dist/components/p-CjtmJTLO.js +0 -5
  757. package/dist/components/p-D3usVJE2.js +0 -16
  758. package/dist/components/p-DDu3JV_r.js +0 -5
  759. package/dist/components/p-DFWqyfUe.js +0 -5
  760. package/dist/components/p-DL6xuxGG.js +0 -5
  761. package/dist/components/p-DOX9Uwk1.js +0 -5
  762. package/dist/components/p-DUq7uT2-.js +0 -5
  763. package/dist/components/p-Devw08cc.js +0 -5
  764. package/dist/components/p-Di96UxvH.js +0 -5
  765. package/dist/components/p-DiLI514I.js +0 -5
  766. package/dist/components/p-Dp3MsSXu.js +0 -5
  767. package/dist/components/p-DuLHFTpa.js +0 -5
  768. package/dist/components/p-DusornQ0.js +0 -5
  769. package/dist/components/p-OQpiDEK9.js +0 -5
  770. package/dist/components/p-XW6Hp_Jk.js +0 -5
  771. package/dist/esm/br-dropdown_2.entry.js +0 -2296
  772. package/dist/esm/br-input.entry.js +0 -713
  773. package/dist/esm/br-loading.entry.js +0 -565
  774. package/dist/esm/br-pagination.entry.js +0 -914
  775. package/dist/esm/br-table-cell.entry.js +0 -199
  776. package/dist/esm/br-table-header-cell.entry.js +0 -187
  777. package/dist/esm/br-table-row.entry.js +0 -93
  778. package/dist/esm/table-constants-CXMwM9m4.js +0 -170
  779. package/dist/types/components/table/table-tokens.d.ts +0 -46
  780. package/dist/types/components/table/table-types.d.ts +0 -107
  781. package/dist/types/components/table/table-utils.d.ts +0 -47
  782. package/dist/webcomponents/p-01801ac1.entry.js +0 -5
  783. package/dist/webcomponents/p-05b459f2.entry.js +0 -5
  784. package/dist/webcomponents/p-08ac6f09.entry.js +0 -5
  785. package/dist/webcomponents/p-09817344.entry.js +0 -5
  786. package/dist/webcomponents/p-13babfc4.entry.js +0 -5
  787. package/dist/webcomponents/p-15022ab7.entry.js +0 -5
  788. package/dist/webcomponents/p-172d42c2.entry.js +0 -5
  789. package/dist/webcomponents/p-1ba60d13.entry.js +0 -5
  790. package/dist/webcomponents/p-1bb96641.entry.js +0 -5
  791. package/dist/webcomponents/p-21feda62.entry.js +0 -5
  792. package/dist/webcomponents/p-23a5cfd7.entry.js +0 -5
  793. package/dist/webcomponents/p-32ea6342.entry.js +0 -5
  794. package/dist/webcomponents/p-3658adcf.entry.js +0 -5
  795. package/dist/webcomponents/p-37914e63.entry.js +0 -5
  796. package/dist/webcomponents/p-3b0dd0ff.entry.js +0 -5
  797. package/dist/webcomponents/p-42c9c6c5.entry.js +0 -5
  798. package/dist/webcomponents/p-473561f2.entry.js +0 -5
  799. package/dist/webcomponents/p-47c490ef.entry.js +0 -5
  800. package/dist/webcomponents/p-4b01c60f.entry.js +0 -5
  801. package/dist/webcomponents/p-5a5ed7d8.entry.js +0 -5
  802. package/dist/webcomponents/p-609cf652.entry.js +0 -5
  803. package/dist/webcomponents/p-614683d9.entry.js +0 -5
  804. package/dist/webcomponents/p-67605757.entry.js +0 -5
  805. package/dist/webcomponents/p-67d62559.entry.js +0 -5
  806. package/dist/webcomponents/p-695dbeb0.entry.js +0 -5
  807. package/dist/webcomponents/p-7352d459.entry.js +0 -5
  808. package/dist/webcomponents/p-745213f7.entry.js +0 -5
  809. package/dist/webcomponents/p-7ee564a1.entry.js +0 -5
  810. package/dist/webcomponents/p-821341dc.entry.js +0 -5
  811. package/dist/webcomponents/p-8aa6f07c.entry.js +0 -5
  812. package/dist/webcomponents/p-8ddf3ce3.entry.js +0 -5
  813. package/dist/webcomponents/p-95f3c44a.entry.js +0 -5
  814. package/dist/webcomponents/p-96dbb585.entry.js +0 -5
  815. package/dist/webcomponents/p-9815ab95.entry.js +0 -5
  816. package/dist/webcomponents/p-9e0324a7.entry.js +0 -5
  817. package/dist/webcomponents/p-CJipT0in.js +0 -5
  818. package/dist/webcomponents/p-CXMwM9m4.js +0 -5
  819. package/dist/webcomponents/p-D3usVJE2.js +0 -16
  820. package/dist/webcomponents/p-a038be16.entry.js +0 -5
  821. package/dist/webcomponents/p-a32d17cb.entry.js +0 -5
  822. package/dist/webcomponents/p-a46f068e.entry.js +0 -5
  823. package/dist/webcomponents/p-a89b684d.entry.js +0 -5
  824. package/dist/webcomponents/p-af888d13.entry.js +0 -5
  825. package/dist/webcomponents/p-b0124459.entry.js +0 -5
  826. package/dist/webcomponents/p-b063c12f.entry.js +0 -5
  827. package/dist/webcomponents/p-b07bfdc5.entry.js +0 -5
  828. package/dist/webcomponents/p-b5d25332.entry.js +0 -5
  829. package/dist/webcomponents/p-b609b464.entry.js +0 -5
  830. package/dist/webcomponents/p-b66ab52d.entry.js +0 -5
  831. package/dist/webcomponents/p-b8d4ace3.entry.js +0 -5
  832. package/dist/webcomponents/p-c717c745.entry.js +0 -5
  833. package/dist/webcomponents/p-ce3d689c.entry.js +0 -5
  834. package/dist/webcomponents/p-d08b6266.entry.js +0 -5
  835. package/dist/webcomponents/p-d6165aa0.entry.js +0 -5
  836. package/dist/webcomponents/p-dacb7e2c.entry.js +0 -5
  837. package/dist/webcomponents/p-db309a11.entry.js +0 -5
  838. package/dist/webcomponents/p-dc23cb2e.entry.js +0 -5
  839. package/dist/webcomponents/p-e241caf3.entry.js +0 -5
  840. package/dist/webcomponents/p-e661c024.entry.js +0 -5
  841. package/dist/webcomponents/p-e7107869.entry.js +0 -5
  842. package/dist/webcomponents/p-eb94199d.entry.js +0 -5
  843. package/dist/webcomponents/p-f8993ae4.entry.js +0 -5
  844. package/dist/webcomponents/p-f99d8c9c.entry.js +0 -5
  845. package/dist/webcomponents/p-fdcb54a3.entry.js +0 -5
  846. package/dist/webcomponents/p-fed02286.entry.js +0 -5
  847. /package/dist/collection/components/table/{table-types.js → table-footer/table-footer.types.js} +0 -0
  848. /package/dist/components/{p-5z6jgH1D.js → p-BNckUhK6.js} +0 -0
  849. /package/dist/webcomponents/{p-BIG-yees.js → p-Bt01zQ7-.js} +0 -0
  850. /package/dist/webcomponents/{p-zlORkiHQ.js → p-CXDYKUBz.js} +0 -0
@@ -0,0 +1,2575 @@
1
+ /*!
2
+ * Construído por SERPRO
3
+ * © https://serpro.gov.br/ - MIT License.
4
+ */
5
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-CwL52661.js';
6
+ import { g as generateUniqueId } from './id-BeJxz5TQ.js';
7
+ import { r as reportInvalidPropValue } from './prop-warning-BlGV-x0w.js';
8
+ import { b as resolveIntegerPropValue, a as resolveDensity, r as resolveAllowedPropValue, c as resolveNumberPropValue } from './props-BbxNgEcJ.js';
9
+ import { d as dispatchNativeFormEvent } from './event-6Da1SZ3J.js';
10
+ import { l as listenForExternalBlockingSurface } from './floating-surface-dismiss-BWXfdbQH.js';
11
+ import { i as isFormControlDisabled, g as getFormValidationState, s as safeSetFormValue, e as syncNativeFormValidity, r as resolveFormValidator } from './validator-BkWWrDEr.js';
12
+ import { c as createMicrotaskReconciler, f as findComposedOwner } from './ownership-CDtFCbKp.js';
13
+ import { h as hasNamedLightDomSlot, a as hasAssignedSlotContent } from './slot-Bt01zQ7-.js';
14
+ import { S as SELECT_ALL_OPTION_VALUE, t as transitionAllSelection, a as transitionSelection, f as filterSelectOptions } from './select.utils-BYsh2ZdE.js';
15
+
16
+ const paginationCss = () => `*,*::before,*::after{box-sizing:border-box}:host{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}main{display:block}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:rgba(0,0,0,0)}b,strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.d-none{display:none !important}@media (min-width: 576px){.d-sm-block{display:block !important}.d-sm-flex{display:flex !important}}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown>.br-notification{left:auto;right:0}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.justify-content-start{justify-content:flex-start !important}.justify-content-end{justify-content:flex-end !important}.justify-content-center{justify-content:center !important}.align-items-center{align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter)*.5);padding-right:calc(var(--grid-gutter)*.5);width:100%}.col{flex:1 0 0%;min-width:8.3333333333%}.col-auto{flex:0 0 auto;width:auto}.col-2{flex-basis:16.6666666667%;max-width:16.6666666667%}.container,.container-fluid,.container-lg{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:flex;flex-wrap:wrap;margin-left:calc(var(--grid-gutter)*-0.5);margin-right:calc(var(--grid-gutter)*-0.5)}@media (min-width: 576px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}.col-sm-4{flex-basis:33.3333333333%;max-width:33.3333333333%}}@media (min-width: 992px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}.col-lg-3{flex-basis:25%;max-width:25%}}@media (min-width: 1600px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.ease{animation-timing-function:cubic-bezier(0.25, 0.1, 0.25, 1)}.ease-out{animation-timing-function:cubic-bezier(0, 0, 0.58, 1)}.ease-in-out{animation-timing-function:cubic-bezier(0.42, 0, 0.58, 1)}.fast{animation-duration:var(--duration-fast)}.slow{animation-duration:var(--duration-slow)}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mb-1{margin-bottom:var(--spacing-scale-half) !important}.ml-1{margin-left:var(--spacing-scale-half) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.pt-half{padding-top:var(--spacing-scale-half) !important}.highlight{background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}fieldset[disabled]{opacity:1}.text-center{text-align:center !important}.text-right{text-align:right !important}.text-nowrap{white-space:nowrap !important}.text-uppercase{text-transform:uppercase !important}.text-bold{font-weight:700 !important}.text-base{font-size:var(--font-size-scale-base) !important}.text-down-01{font-size:var(--font-size-scale-down-01) !important}@media (min-width: 576px){.text-sm-center{text-align:center !important}.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half)}a:focus{outline:none}a.focus-visible,a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}a{color:var(--interactive);text-decoration:none}.main-content a{text-decoration:underline}button{cursor:pointer}img{max-width:100%;vertical-align:middle}h2,.h2{color:var(--color);font-size:var(--font-size-scale-up-03);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2xh);margin-top:var(--spacing-scale-3xh);padding-bottom:var(--spacing-scale-2xh)}@media (min-width: 576px){.h2,h2{font-size:var(--font-size-scale-up-05);font-weight:var(--font-weight-regular)}}ul,ol{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}table{--table-background:var(--background);--table-color:var(--color);--table-border-color:var(--gray-20);--table-border-style:solid;--table-border-width:1px;--table-hover:var(--color-rgb);--table-padding:var(--spacing-scale-3x);--table-font-weight:var(--font-weight-medium);--table-th-background:var(--background-alternative);--table-th-font-weight:var(--font-weight-semi-bold);--table-row-size:var(--spacing-scale-2x);border-collapse:collapse;width:100%}tr.selected,tr.is-selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}fieldset,.fieldset{border:var(--surface-width-none);margin-bottom:var(--spacing-scale-5x);margin-top:0;padding:0}legend,.legend{color:var(--color);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2x);margin-top:var(--spacing-scale-2x)}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}pre,.pre{background:var(--gray-5);margin:var(--spacing-scale-2x) 0 var(--spacing-scale-4x);padding:var(--spacing-scale-2x)}mark,.mark{background:var(--red-warm-vivid-10);color:var(--color)}*[data-toggle=collapse]:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}*[data-toggle=collapse]:focus{outline:none}*[data-toggle=collapse].focus-visible,*[data-toggle=collapse]:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}@media (prefers-reduced-motion: reduce){:host,:host::before,:host::after,:host *,:host *::before,:host *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}}:host-context([data-wbc-reduced-motion=true])::before,:host-context([data-wbc-reduced-motion=true])::after,:host-context([data-wbc-reduced-motion=true]) *,:host-context([data-wbc-reduced-motion=true]) *::before,:host-context([data-wbc-reduced-motion=true]) *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}.br-pagination{--pagination-margin:var(--spacing-scale-base);--pagination-select-width:88px;--pagination-size:var(--pagination-medium);--pagination-small:24px;--pagination-medium:32px;--pagination-large:40px;color:var(--color);display:flex;flex-wrap:wrap;font-weight:var(--font-weight);justify-content:center}.br-pagination ul{align-items:center;display:flex;list-style:none;margin:0;padding:0}.br-pagination li{padding:0}.br-pagination.dark-mode .page{color:var(--color-dark)}.br-pagination.dark-mode .br-select .br-item label{color:var(--color-dark)}.br-pagination .page:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}.br-pagination .page{align-items:center;border:1px solid rgba(0,0,0,0);border-radius:100em;color:var(--interactive);display:inline-flex;justify-content:center;margin:0 calc(var(--pagination-margin)*.5);min-height:var(--pagination-size);min-width:var(--pagination-size);padding:0 var(--spacing-scale-base);white-space:nowrap}.br-pagination .page.active{background:var(--active);color:var(--color-dark);font-weight:var(--font-weight-semi-bold)}.br-pagination .pagination-ellipsis{margin:0 calc(var(--pagination-margin)*.5);position:relative}.br-pagination .pagination-ellipsis .br-button{--button-size:var(--pagination-size)}.br-pagination .pagination-ellipsis .br-list::-webkit-scrollbar{height:var(--spacing-scale-base);width:var(--spacing-scale-base)}.br-pagination .pagination-ellipsis .br-list::-webkit-scrollbar-track{background:var(--gray-10)}.br-pagination .pagination-ellipsis .br-list::-webkit-scrollbar-thumb{background:var(--gray-30)}.br-pagination .pagination-ellipsis .br-list:hover::-webkit-scrollbar-thumb{background:var(--gray-40)}.br-pagination .pagination-ellipsis .br-list{max-height:220px;min-width:4em;overflow-y:auto;z-index:var(--z-index-layer-1)}.br-pagination.small{--pagination-size:var(--pagination-small)}.br-pagination.medium{--pagination-size:var(--pagination-medium)}.br-pagination.large{--pagination-size:var(--pagination-large)}.br-pagination .pagination-information{align-items:center;display:flex}.br-pagination .pagination-per-page,.br-pagination .pagination-go-to-page{align-items:center;display:flex}.br-pagination .pagination-per-page .br-input,.br-pagination .pagination-go-to-page .br-input{align-items:center;display:flex}.br-pagination .pagination-per-page .br-input label,.br-pagination .pagination-go-to-page .br-input label{font-weight:var(--font-weight-regular);margin-bottom:0;margin-right:var(--spacing-scale-base);padding-bottom:0}.br-pagination .pagination-per-page .br-input input,.br-pagination .pagination-go-to-page .br-input input{--input-size:var(--pagination-medium);padding-left:var(--spacing-scale-base);padding-right:calc(var(--spacing-scale-baseh) + 32px);text-align:right;width:var(--pagination-select-width)}.br-pagination .pagination-per-page .br-input input:not(:focus),.br-pagination .pagination-go-to-page .br-input input:not(:focus){border-color:rgba(0,0,0,0)}.br-pagination .pagination-per-page .br-list,.br-pagination .pagination-go-to-page .br-list{min-width:5em;right:0;width:auto}.br-pagination .pagination-arrows{align-items:center;display:flex}.br-pagination .br-select .br-input .br-button{bottom:auto;margin-top:0;position:absolute;right:var(--spacing-scale-half);top:auto;transform:none}.br-pagination .br-divider{border-right-width:var(--divider-size);border-top:0}.br-pagination.inverted,.br-pagination.dark-mode{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.br-pagination.inverted.inverted .br-input,.br-pagination.inverted.inverted .br-input label,.br-pagination.inverted.dark-mode .br-input,.br-pagination.inverted.dark-mode .br-input label,.br-pagination.dark-mode.inverted .br-input,.br-pagination.dark-mode.inverted .br-input label,.br-pagination.dark-mode.dark-mode .br-input,.br-pagination.dark-mode.dark-mode .br-input label{--color:var(--color-dark);--focus-color:var(--focus-color-dark)}.br-pagination.inverted .page.active,.br-pagination.dark-mode .page.active{--interactive-rgb:var(--active-rgb);background-color:var(--background-light);color:var(--active)}.br-pagination .input-group .input-icon{display:none}.br-divider,hr{--divider-size:var(--surface-width-sm);border-color:var(--border-color);border-style:solid;border-width:0;border-top-width:var(--divider-size);display:block}.br-divider.content,hr.content{align-items:center;border:0;display:flex;justify-content:center}.br-divider.content::after,.br-divider.content::before,hr.content::after,hr.content::before{border-color:var(--border-color);border-style:solid;border-width:0;border-top-width:var(--divider-size);content:"";flex:1}.br-divider.content::after,hr.content::after{margin-left:var(--spacing-scale-base)}.br-divider.content::before,hr.content::before{margin-right:var(--spacing-scale-base)}.br-divider.vertical,hr.vertical{align-self:stretch;border-right-width:var(--divider-size);border-top-width:0}.br-divider.vertical.content,hr.vertical.content{flex-direction:column}.br-divider.vertical.content::after,.br-divider.vertical.content::before,hr.vertical.content::after,hr.vertical.content::before{border-right-width:var(--divider-size);border-top-width:0;margin:0}.br-divider.inverted,.br-divider.dark-mode,hr.inverted,hr.dark-mode{--border-color:var(--pure-0)}.br-divider.dashed,hr.dashed{border-style:dashed}.br-divider.sm,hr.sm{--divider-size:var(--surface-width-sm)}hr{--divider-padding:var(--spacing-scale-2x);margin:var(--divider-padding) 0}:host{display:block}:host .pagination-ellipsis br-list{max-height:none;overflow:visible}:host .pagination-ellipsis br-list.has-scroll{max-height:220px;overflow-y:auto}:host .pagination-ellipsis br-list.has-scroll::-webkit-scrollbar{height:var(--spacing-scale-base);width:var(--spacing-scale-base)}:host .pagination-ellipsis br-list.has-scroll::-webkit-scrollbar-track{background:var(--gray-10)}:host .pagination-ellipsis br-list.has-scroll::-webkit-scrollbar-thumb{background:var(--gray-30)}:host .pagination-ellipsis br-list.has-scroll:hover::-webkit-scrollbar-thumb{background:var(--gray-40)}:host .pagination-ellipsis .pagination-ellipsis-virtual-spacer{display:block;width:100%}:host .br-pagination button.page:not(.active){background-color:rgba(0,0,0,0)}:host([variant=contextual]) .br-pagination{justify-content:space-between}.pagination-leading,.pagination-trailing{display:flex;align-items:center;min-width:0}.pagination-leading{flex:0 1 auto}.pagination-trailing{flex:0 0 auto}:host([variant=contextual]) .pagination-divider{flex:0 0 auto;width:0;height:calc(var(--pagination-size) + var(--spacing-scale-base));margin-inline:var(--spacing-scale-base);border:0;border-right:var(--divider-size) solid var(--border-color)}:host([variant=contextual]) .pagination-per-page,:host([variant=contextual]) .pagination-go-to-page{flex:0 0 auto;width:max-content}:host([variant=contextual]) .pagination-per-page br-select,:host([variant=contextual]) .pagination-go-to-page br-select{width:max-content}.pagination-per-page br-select,.pagination-go-to-page br-select{--input-size:var(--pagination-size);--br-input-margin-bottom:0}.pagination-per-page br-select::part(input-container),.pagination-go-to-page br-select::part(input-container){transform:translateY(2px)}.pagination-per-page br-select::part(input-label),.pagination-go-to-page br-select::part(input-label){display:inline-flex;align-items:center;height:var(--pagination-medium);line-height:1;font-weight:var(--font-weight-regular);margin-bottom:0;margin-right:var(--spacing-scale-base);padding-bottom:0}.pagination-per-page br-select::part(input-clear),.pagination-go-to-page br-select::part(input-clear){display:none}.pagination-per-page br-select::part(input-field),.pagination-go-to-page br-select::part(input-field){--input-size:var(--pagination-medium);margin-top:0;padding-left:var(--spacing-scale-base);text-align:left}:host(:not([variant=contextual])) .br-pagination{justify-content:center}:host([variant=contextual]) .br-pagination ul{justify-content:center;width:100%}:host([color-mode=dark]) br-select{--color:var(--color-dark);--focus-color:var(--focus-color-dark)}:host([color-mode=dark]) br-select::part(label){color:var(--color-dark)}:host([color-mode=dark]) .br-pagination a.page:not(.active),:host([color-mode=dark]) .br-pagination button.page:not(.active){color:var(--color);background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0)}.br-pagination.dark-mode .br-select .br-item label,.br-pagination.dark-mode .page{color:var(--color-dark);background-color:rgba(0,0,0,0)}:host([color-mode=dark]) .br-pagination a.page:not(.active):hover,:host([color-mode=dark]) .br-pagination a.page:not(.active):focus,:host([color-mode=dark]) .br-pagination a.page:not(.active):focus-visible,:host([color-mode=dark]) .br-pagination button.page:not(.active):hover,:host([color-mode=dark]) .br-pagination button.page:not(.active):focus,:host([color-mode=dark]) .br-pagination button.page:not(.active):focus-visible{color:var(--interactive)}.br-pagination .page:focus-visible{outline:var(--focus) var(--focus-style) var(--focus-width);outline-offset:var(--focus-offset)}.pagination-ellipsis br-button::part(button){--button-size:var(--pagination-size)}.pagination-ellipsis br-button:focus-visible{outline:var(--focus) var(--focus-style) var(--focus-width);outline-offset:var(--focus-offset);border-radius:50%}.br-pagination>ul{position:relative}:host([loading]) .br-pagination>ul>li.pagination-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;visibility:visible}:host([loading]) .br-pagination>ul>li.pagination-loading .pagination-loading{display:flex;align-items:center;justify-content:center}:host([loading]) .br-pagination>ul>li:not(.pagination-loading):not(:first-child):not(:last-child){visibility:hidden}.pagination-information{position:relative}.pagination-information .pagination-loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}.visually-hidden{position:absolute !important;height:1px;width:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:host([color-mode=dark]) br-select::part(radio-label){color:var(--color-dark)}`;
17
+
18
+ const PAGINATION_COLOR_MODES = ['dark'];
19
+ const PAGINATION_VARIANTS = ['default', 'contextual'];
20
+ const Pagination = class {
21
+ constructor(hostRef) {
22
+ registerInstance(this, hostRef);
23
+ this.pageChange = createEvent(this, "pageChange", 7);
24
+ this.brPaginationPageChange = createEvent(this, "brPaginationPageChange", 6);
25
+ this.perPageChange = createEvent(this, "perPageChange", 7);
26
+ this.brPaginationPerPageChange = createEvent(this, "brPaginationPerPageChange", 6);
27
+ /**
28
+ * Estado interno para responsividade. Verdadeiro quando viewport < sm.
29
+ */
30
+ this.isSmall = false;
31
+ /** Materializa as opções completas somente após a primeira abertura do seletor. */
32
+ this.goToOptionsReady = false;
33
+ this.goToSearchTerm = '';
34
+ /**
35
+ * Controla a janela visível de cada dropdown de reticências.
36
+ */
37
+ this.ellipsisScrollOffsets = {};
38
+ /**
39
+ * Altura efetiva dos itens do dropdown de reticências.
40
+ * O valor fixo é usado somente até a primeira medição válida do DOM.
41
+ */
42
+ this.ellipsisItemHeight = Pagination.ELLIPSIS_ITEM_HEIGHT_FALLBACK;
43
+ /**
44
+ * Identificador único do componente.
45
+ * Quando omitido, um valor é gerado automaticamente.
46
+ *
47
+ * > **Padrão:** valor único gerado por `generateUniqueId()`.
48
+ *
49
+ * > **Uso compartilhado:** mantenha esta descrição idêntica em todos os componentes que usam `customId`.
50
+ */
51
+ this.customId = generateUniqueId();
52
+ /** Quantidade total de páginas (inteiro mínimo 1). Valores inválidos usam 1. */
53
+ this.total = 1;
54
+ /** Página atual (inteira e 1-indexada). Valores inválidos usam 1; valores fora do intervalo são ajustados. */
55
+ this.current = 1;
56
+ /**
57
+ * Rótulo acessível do botão de página anterior.
58
+ */
59
+ this.previousLabel = 'Voltar página';
60
+ /**
61
+ * Rótulo acessível do botão de próxima página.
62
+ */
63
+ this.nextLabel = 'Página seguinte';
64
+ /**
65
+ * Rótulo acessível do botão de reticências que abre a lista de páginas ocultas.
66
+ */
67
+ this.ellipsisLabel = 'Abrir ou fechar a lista de paginação';
68
+ /**
69
+ * Define a densidade visual do componente.
70
+ *
71
+ * - `small`: Alta densidade (componente menor, mais compacto e com menos espaçamento).
72
+ * - `medium`: Densidade intermediária, padrão recomendado para a maioria dos casos.
73
+ * - `large`: Baixa densidade (componente maior, mais espaçamento e altura).
74
+ *
75
+ * > **Uso compartilhado:** mantenha esta descrição idêntica em todos os componentes que usam `density`.
76
+ * Valores inválidos usam `medium`.
77
+ */
78
+ this.density = 'medium';
79
+ /**
80
+ * Variante de renderização do componente. Valores inválidos usam `default`.
81
+ * - `default`: paginação numérica (padrão)
82
+ * - `contextual`: paginação contextual com seletores e informação de itens
83
+ */
84
+ this.variant = 'default';
85
+ /**
86
+ * Mantém `current` e `perPage` sob controle da aplicação.
87
+ *
88
+ * Quando ativo, interações apenas emitem a intenção de mudança. A aplicação
89
+ * deve atualizar a propriedade correspondente após concluir seu processamento.
90
+ *
91
+ * @default false
92
+ */
93
+ this.controlled = false;
94
+ /** Indica que a página solicitada ainda está sendo carregada pelo consumidor.
95
+ * @default false
96
+ */
97
+ this.loading = false;
98
+ /** Itens por página (inteiro positivo, aplicável na variante contextual). Valores inválidos usam 10. */
99
+ this.perPage = 10;
100
+ /**
101
+ * Opções disponíveis de itens por página na variante `contextual`.
102
+ * Passe o array por property binding; atributos HTML não representam arrays.
103
+ *
104
+ * @example
105
+ * ```js
106
+ * const pagination = document.querySelector('br-pagination');
107
+ * pagination.perPageOptions = [10, 25, 50, 100];
108
+ * ```
109
+ */
110
+ this.perPageOptions = [10, 20, 30];
111
+ /**
112
+ * Rótulo do seletor de itens por página (variante contextual).
113
+ */
114
+ this.perPageLabel = 'Exibir';
115
+ /**
116
+ * Rótulo do seletor "ir para página" (variante contextual).
117
+ */
118
+ this.goToPageLabel = 'Página';
119
+ /**
120
+ * Sufixo textual para a informação de quantidade de itens (variante contextual).
121
+ */
122
+ this.itemsText = 'itens';
123
+ this.ellipsisScrollFrame = null;
124
+ this.pendingEllipsisScrollOffsets = {};
125
+ this.pendingEllipsisFocus = null;
126
+ this.goToOptionsCache = null;
127
+ this.pendingGoToResetFrame = null;
128
+ this.goTo = (page) => {
129
+ if (this.loading)
130
+ return;
131
+ const next = this.clampPage(page);
132
+ if (next !== this.effectiveCurrent) {
133
+ if (!this.controlled) {
134
+ this.current = next;
135
+ if (this.currentPage !== undefined)
136
+ this.currentPage = next;
137
+ }
138
+ this.pageChange.emit({ page: next });
139
+ this.brPaginationPageChange.emit({ page: next });
140
+ }
141
+ // Gerenciar foco após mudanças iniciadas pelo usuário
142
+ this.queueFocusAfterNavigation();
143
+ };
144
+ this.handlePrevClick = (event) => {
145
+ event.preventDefault();
146
+ if (this.effectiveCurrent > 1) {
147
+ this.goTo(this.effectiveCurrent - 1);
148
+ }
149
+ };
150
+ this.handleNextClick = (event) => {
151
+ event.preventDefault();
152
+ const maxPages = this.effectiveVariant === 'contextual' ? this.getTotalPages() : this.getDefaultTotalPages();
153
+ if (this.effectiveCurrent < maxPages) {
154
+ this.goTo(this.effectiveCurrent + 1);
155
+ }
156
+ };
157
+ this.handlePageClickFactory = (page) => {
158
+ return (event) => {
159
+ event.preventDefault();
160
+ if (this.loading)
161
+ return;
162
+ this.lastInteraction = 'number';
163
+ this.goTo(page);
164
+ };
165
+ };
166
+ this.handleEllipsisItemClickFactory = (page) => {
167
+ return () => {
168
+ if (this.loading)
169
+ return;
170
+ this.lastInteraction = 'ellipsis';
171
+ this.goTo(page);
172
+ };
173
+ };
174
+ this.handlePageKeyDown = (ev) => {
175
+ const target = ev.target;
176
+ // Aceita tanto o botão de página quanto o botão de reticências
177
+ if (!(target?.matches('button.page[part="page"]') || target?.matches('.pagination-ellipsis br-button[slot="trigger"]'))) {
178
+ return;
179
+ }
180
+ const buttons = this.getVisiblePageButtons();
181
+ const idx = buttons.indexOf(target);
182
+ if (idx === -1)
183
+ return;
184
+ switch (ev.key) {
185
+ case 'ArrowRight':
186
+ case 'ArrowDown':
187
+ ev.preventDefault();
188
+ this.focusPageButtonByIndex(idx + 1);
189
+ break;
190
+ case 'ArrowLeft':
191
+ case 'ArrowUp':
192
+ ev.preventDefault();
193
+ this.focusPageButtonByIndex(idx - 1);
194
+ break;
195
+ case 'Home':
196
+ ev.preventDefault();
197
+ this.focusPageButtonByIndex(0);
198
+ break;
199
+ case 'End':
200
+ ev.preventDefault();
201
+ this.focusPageButtonByIndex(buttons.length - 1);
202
+ break;
203
+ }
204
+ };
205
+ this.handleEllipsisScrollFactory = (key, totalItems) => {
206
+ return (event) => {
207
+ const list = event.currentTarget;
208
+ if (list === null)
209
+ return;
210
+ this.pendingEllipsisScrollOffsets[key] = list.scrollTop;
211
+ if (this.ellipsisScrollFrame !== null)
212
+ return;
213
+ this.ellipsisScrollFrame = requestAnimationFrame(() => {
214
+ this.ellipsisScrollFrame = null;
215
+ const offsets = this.pendingEllipsisScrollOffsets;
216
+ this.pendingEllipsisScrollOffsets = {};
217
+ Object.entries(offsets).forEach(([offsetKey, scrollTop]) => {
218
+ this.setEllipsisScrollOffset(offsetKey, scrollTop, totalItems);
219
+ });
220
+ });
221
+ };
222
+ };
223
+ this.handleEllipsisItemKeyDownFactory = (key, totalItems) => {
224
+ return (event) => {
225
+ const item = event.currentTarget;
226
+ const pageIndex = Number(item?.getAttribute('data-page-index'));
227
+ if (item === null || !Number.isInteger(pageIndex))
228
+ return;
229
+ if (event.key === 'Escape') {
230
+ event.preventDefault();
231
+ event.stopImmediatePropagation();
232
+ this.handleEllipsisEscape(item, key);
233
+ return;
234
+ }
235
+ this.handleEllipsisBoundaryNavigation(event, key, totalItems, pageIndex);
236
+ };
237
+ };
238
+ this.handlePerPageChange = (event) => {
239
+ if (this.loading)
240
+ return;
241
+ const value = Number(event.detail);
242
+ // Ignora se o valor não for um número finito ou não tiver mudado
243
+ if (!Number.isFinite(value) || value === this.effectivePerPage) {
244
+ return;
245
+ }
246
+ const nextPerPage = resolveIntegerPropValue(this.el, 'perPage', value, 1, Number.MAX_SAFE_INTEGER, 10);
247
+ if (!this.controlled) {
248
+ this.perPage = nextPerPage;
249
+ this.current = this.clampPage(this.current); // Ajusta a página atual
250
+ }
251
+ const detail = { perPage: nextPerPage };
252
+ this.perPageChange.emit(detail);
253
+ this.brPaginationPerPageChange.emit(detail);
254
+ // Gerencia o foco após a interação
255
+ this.lastInteraction = 'perPage';
256
+ this.queueFocusAfterNavigation();
257
+ };
258
+ this.handleGoToPageChange = (event) => {
259
+ if (this.loading)
260
+ return;
261
+ const value = Number(event.detail);
262
+ if (this.pendingGoToPage !== undefined)
263
+ return;
264
+ // O fallback para this.current garante que não tentemos navegar para NaN.
265
+ const next = this.clampPage(Number.isFinite(value) ? value : this.effectiveCurrent);
266
+ if (next !== this.effectiveCurrent) {
267
+ this.lastInteraction = 'goTo';
268
+ this.pendingGoToPage = next;
269
+ if (this.pendingGoToResetFrame !== null)
270
+ cancelAnimationFrame(this.pendingGoToResetFrame);
271
+ this.pendingGoToResetFrame = requestAnimationFrame(() => {
272
+ this.pendingGoToResetFrame = null;
273
+ this.pendingGoToPage = undefined;
274
+ });
275
+ this.goTo(next);
276
+ }
277
+ };
278
+ this.handleGoToSelectOpened = () => {
279
+ if (this.goToOptionsReady)
280
+ return;
281
+ this.goToOptionsReady = true;
282
+ };
283
+ }
284
+ handleTotalChange() {
285
+ this.goToOptionsCache = null;
286
+ this.goToOptionsReady = false;
287
+ this.resetAllEllipsisScrollOffsets();
288
+ this.current = this.clampPage(this.current);
289
+ }
290
+ handleTotalPagesChange(newValue) {
291
+ this.goToOptionsCache = null;
292
+ this.goToOptionsReady = false;
293
+ if (newValue !== undefined && newValue !== this.total)
294
+ this.total = newValue;
295
+ }
296
+ handleCurrentChange(newValue) {
297
+ this.resetAllEllipsisScrollOffsets();
298
+ const clamped = this.clampPage(newValue);
299
+ if (clamped !== newValue) {
300
+ this.current = clamped;
301
+ }
302
+ if (this.currentPage !== undefined && this.currentPage !== clamped)
303
+ this.currentPage = clamped;
304
+ }
305
+ handleCurrentPageChange(newValue) {
306
+ if (newValue !== undefined && newValue !== this.current)
307
+ this.current = newValue;
308
+ }
309
+ handlePerPagePropChange(newValue) {
310
+ this.goToOptionsCache = null;
311
+ this.goToOptionsReady = false;
312
+ if (this.effectiveVariant !== 'contextual')
313
+ return;
314
+ const nextPerPage = this.effectivePerPage;
315
+ if (nextPerPage !== newValue) {
316
+ this.perPage = nextPerPage;
317
+ return;
318
+ }
319
+ this.current = this.clampPage(this.current);
320
+ }
321
+ handleTotalItemsChange() {
322
+ this.goToOptionsCache = null;
323
+ this.goToOptionsReady = false;
324
+ if (this.effectiveVariant !== 'contextual')
325
+ return;
326
+ this.current = this.clampPage(this.current);
327
+ }
328
+ handleDensityChange() {
329
+ this.ellipsisScrollOffsets = {};
330
+ this.pendingEllipsisFocus = null;
331
+ this.ellipsisItemHeight = this.computeItemHeightForDensity();
332
+ }
333
+ connectedCallback() {
334
+ this.setupMediaQuery();
335
+ }
336
+ disconnectedCallback() {
337
+ this.cleanupMediaQuery();
338
+ this.pendingEllipsisFocus = null;
339
+ if (this.ellipsisScrollFrame !== null) {
340
+ cancelAnimationFrame(this.ellipsisScrollFrame);
341
+ this.ellipsisScrollFrame = null;
342
+ }
343
+ if (this.pendingGoToResetFrame !== null) {
344
+ cancelAnimationFrame(this.pendingGoToResetFrame);
345
+ this.pendingGoToResetFrame = null;
346
+ }
347
+ this.pendingGoToPage = undefined;
348
+ }
349
+ componentWillLoad() {
350
+ if (this.totalPages !== undefined)
351
+ this.total = this.effectiveTotalPages ?? this.effectiveTotal;
352
+ if (this.currentPage !== undefined)
353
+ this.current = this.effectiveCurrentPage ?? this.effectiveCurrent;
354
+ this.current = this.clampPage(this.current);
355
+ }
356
+ componentDidLoad() {
357
+ this.ellipsisItemHeight = this.computeItemHeightForDensity();
358
+ }
359
+ componentDidRender() {
360
+ this.flushPendingEllipsisFocus();
361
+ }
362
+ /**
363
+ * Define programaticamente a página atual dentro do intervalo permitido.
364
+ * @param page Página desejada (1-indexada).
365
+ * Em `controlled`, emite a solicitação sem alterar `current`.
366
+ */
367
+ async setPage(page) {
368
+ this.goTo(page);
369
+ }
370
+ /**
371
+ * Solicita navegação programática para uma página (1-indexada).
372
+ * Em `controlled`, aguarda a confirmação externa para alterar `current`.
373
+ */
374
+ async goToPage(page) {
375
+ this.goTo(page);
376
+ }
377
+ // Calcula a altura do item com base nos tokens de density do GovBR-DS.
378
+ // py-3 = spacing-scale-2x (medium), py-4 = spacing-scale-3x (large), base para small.
379
+ computeItemHeightForDensity() {
380
+ if (typeof window === 'undefined')
381
+ return Pagination.ELLIPSIS_ITEM_HEIGHT_FALLBACK;
382
+ const style = getComputedStyle(this.el);
383
+ const spacingBase = parseFloat(style.getPropertyValue('--spacing-scale-base'));
384
+ const fontSize = parseFloat(style.getPropertyValue('--font-size-scale-base'));
385
+ const lineHeight = parseFloat(style.getPropertyValue('--font-line-height-medium'));
386
+ if (!Number.isFinite(spacingBase) || !Number.isFinite(fontSize) || !Number.isFinite(lineHeight)) {
387
+ return Pagination.ELLIPSIS_ITEM_HEIGHT_FALLBACK;
388
+ }
389
+ const paddingY = this.effectiveDensity === 'large'
390
+ ? spacingBase * 3
391
+ : this.effectiveDensity === 'medium'
392
+ ? spacingBase * 2
393
+ : spacingBase;
394
+ return Math.ceil(fontSize * lineHeight + paddingY * 2);
395
+ }
396
+ setupMediaQuery() {
397
+ if (typeof window === 'undefined' || typeof window.matchMedia !== 'function')
398
+ return;
399
+ const query = '(max-width: 575.98px)';
400
+ this.cleanupMediaQuery();
401
+ try {
402
+ this.mqlSmall = window.matchMedia(query);
403
+ this.isSmall = this.mqlSmall.matches;
404
+ this.mqlSmallHandler = (event) => {
405
+ this.isSmall = event.matches;
406
+ };
407
+ const legacyMediaQueryList = this.mqlSmall;
408
+ if (typeof this.mqlSmall.addEventListener === 'function') {
409
+ this.mqlSmall.addEventListener('change', this.mqlSmallHandler);
410
+ }
411
+ else if (typeof legacyMediaQueryList.addListener === 'function') {
412
+ legacyMediaQueryList.addListener(this.mqlSmallHandler);
413
+ }
414
+ }
415
+ catch {
416
+ console.warn(`Media Query "${query}" is not supported in this browser.`);
417
+ this.mqlSmall = undefined;
418
+ this.mqlSmallHandler = undefined;
419
+ this.isSmall = false;
420
+ }
421
+ }
422
+ cleanupMediaQuery() {
423
+ if (this.mqlSmall === undefined || this.mqlSmallHandler === undefined) {
424
+ this.mqlSmall = undefined;
425
+ this.mqlSmallHandler = undefined;
426
+ return;
427
+ }
428
+ if (typeof this.mqlSmall.removeEventListener === 'function') {
429
+ this.mqlSmall.removeEventListener('change', this.mqlSmallHandler);
430
+ }
431
+ else {
432
+ const legacyMediaQueryList = this.mqlSmall;
433
+ if (typeof legacyMediaQueryList.removeListener === 'function') {
434
+ legacyMediaQueryList.removeListener(this.mqlSmallHandler);
435
+ }
436
+ }
437
+ this.mqlSmall = undefined;
438
+ this.mqlSmallHandler = undefined;
439
+ }
440
+ getCssClassMap() {
441
+ const density = this.effectiveDensity;
442
+ return {
443
+ 'br-pagination': true,
444
+ small: density === 'small',
445
+ large: density === 'large',
446
+ medium: density === 'medium',
447
+ 'dark-mode': this.effectiveColorMode === 'dark',
448
+ };
449
+ }
450
+ get effectiveDensity() {
451
+ return resolveDensity(this.el, this.density);
452
+ }
453
+ get effectiveColorMode() {
454
+ return resolveAllowedPropValue(this.el, 'colorMode', this.colorMode, PAGINATION_COLOR_MODES, undefined, {
455
+ allowUndefined: true,
456
+ });
457
+ }
458
+ get effectiveVariant() {
459
+ return resolveAllowedPropValue(this.el, 'variant', this.variant, PAGINATION_VARIANTS, 'default');
460
+ }
461
+ get effectiveTotal() {
462
+ return resolveIntegerPropValue(this.el, 'total', this.total, 1, Number.MAX_SAFE_INTEGER, 1);
463
+ }
464
+ get effectiveTotalPages() {
465
+ return resolveIntegerPropValue(this.el, 'totalPages', this.totalPages, 1, Number.MAX_SAFE_INTEGER, 1, {
466
+ allowUndefined: true,
467
+ });
468
+ }
469
+ get effectiveCurrentPage() {
470
+ return resolveIntegerPropValue(this.el, 'currentPage', this.currentPage, 1, Number.MAX_SAFE_INTEGER, 1, {
471
+ allowUndefined: true,
472
+ });
473
+ }
474
+ get effectiveTotalItems() {
475
+ return (resolveIntegerPropValue(this.el, 'totalItems', this.totalItems, 0, Number.MAX_SAFE_INTEGER, 0, {
476
+ allowUndefined: true,
477
+ }) ?? 0);
478
+ }
479
+ get effectivePerPage() {
480
+ return resolveIntegerPropValue(this.el, 'perPage', this.perPage, 1, Number.MAX_SAFE_INTEGER, 10);
481
+ }
482
+ get effectivePerPageOptions() {
483
+ const options = Array.isArray(this.perPageOptions)
484
+ ? this.perPageOptions.map((option) => Number(option)).filter((option) => Number.isInteger(option) && option >= 1)
485
+ : [];
486
+ const uniqueOptions = [...new Set(options)];
487
+ if (!Array.isArray(this.perPageOptions) ||
488
+ uniqueOptions.length === 0 ||
489
+ uniqueOptions.length !== this.perPageOptions.length) {
490
+ reportInvalidPropValue(this.el, 'perPageOptions', this.perPageOptions, 'Informe uma lista com inteiros positivos, sem valores inválidos ou duplicados.', 'Aplicando fallback [10, 20, 30] quando nenhuma opção válida for informada e ignorando entradas inválidas.');
491
+ }
492
+ return uniqueOptions.length > 0 ? uniqueOptions : [10, 20, 30];
493
+ }
494
+ getDefaultTotalPages() {
495
+ return this.effectiveTotalPages ?? this.effectiveTotal;
496
+ }
497
+ get effectiveCurrent() {
498
+ return this.clampPage(resolveIntegerPropValue(this.el, 'current', this.current, 1, Number.MAX_SAFE_INTEGER, 1));
499
+ }
500
+ clampPage(value) {
501
+ const total = this.effectiveVariant === 'contextual' ? this.getTotalPages() : this.getDefaultTotalPages();
502
+ const clampedValue = Math.max(1, resolveIntegerPropValue(this.el, 'current', value, 1, Number.MAX_SAFE_INTEGER, 1));
503
+ return Math.min(clampedValue, total);
504
+ }
505
+ getVisiblePageButtons() {
506
+ const root = this.el.shadowRoot;
507
+ if (root === null)
508
+ return [];
509
+ return Array.from(root.querySelectorAll('button.page[part="page"], .pagination-ellipsis br-button[slot="trigger"]'));
510
+ }
511
+ focusPageButtonByIndex(index) {
512
+ const buttons = this.getVisiblePageButtons();
513
+ if (buttons.length === 0)
514
+ return;
515
+ const clamped = Math.max(0, Math.min(index, buttons.length - 1));
516
+ const btn = buttons[clamped];
517
+ // Garantir roving tabindex
518
+ buttons.forEach((b, i) => {
519
+ b.tabIndex = i === clamped ? 0 : -1;
520
+ });
521
+ btn.focus();
522
+ }
523
+ queueFocusAfterNavigation() {
524
+ // Diferir para após renderização (fallback em ambientes sem RAF)
525
+ const defer = typeof requestAnimationFrame === 'function'
526
+ ? requestAnimationFrame
527
+ : (cb) => setTimeout(() => cb(0), 0);
528
+ defer(() => {
529
+ if (this.effectiveVariant === 'contextual') {
530
+ this.lastInteraction = undefined;
531
+ return;
532
+ }
533
+ // Variant default: focar no botão da página atual ao vir de reticências
534
+ if (this.lastInteraction === 'ellipsis' || this.lastInteraction === 'number') {
535
+ const buttons = this.getVisiblePageButtons();
536
+ const currentBtn = buttons.find((b) => b.getAttribute('aria-current') === 'page');
537
+ if (currentBtn !== null && currentBtn !== undefined) {
538
+ // Roving tabindex: somente o atual recebe 0
539
+ buttons.forEach((b) => {
540
+ b.tabIndex = b === currentBtn ? 0 : -1;
541
+ });
542
+ currentBtn.focus();
543
+ }
544
+ }
545
+ this.lastInteraction = undefined;
546
+ });
547
+ }
548
+ getComputedNavAriaLabel() {
549
+ // Respeita o valor fornecido externamente
550
+ if (this.ariaLabel && String(this.ariaLabel).trim().length > 0)
551
+ return this.ariaLabel;
552
+ const totalPages = this.effectiveVariant === 'contextual' ? this.getTotalPages() : this.getDefaultTotalPages();
553
+ return `Paginação: página ${this.effectiveCurrent} de ${totalPages}`;
554
+ }
555
+ renderPageButton(page) {
556
+ return (h("li", { key: page }, h("button", { part: "page", class: { page: true, active: page === this.effectiveCurrent }, "aria-label": `Página ${page}`, "aria-current": page === this.effectiveCurrent ? 'page' : null, type: "button", tabIndex: page === this.effectiveCurrent ? 0 : -1, onClick: this.handlePageClickFactory(page), onKeyDown: this.handlePageKeyDown, disabled: this.loading }, page)));
557
+ }
558
+ getEllipsisRangeKey(position, from, to) {
559
+ return `${position}:${from}:${to}`;
560
+ }
561
+ resetAllEllipsisScrollOffsets() {
562
+ this.pendingEllipsisFocus = null;
563
+ if (Object.keys(this.ellipsisScrollOffsets).length === 0)
564
+ return;
565
+ this.ellipsisScrollOffsets = {};
566
+ }
567
+ resetEllipsisScrollOffset(key) {
568
+ if (this.pendingEllipsisFocus?.key === key) {
569
+ this.pendingEllipsisFocus = null;
570
+ }
571
+ if (!(key in this.ellipsisScrollOffsets))
572
+ return;
573
+ const nextOffsets = { ...this.ellipsisScrollOffsets };
574
+ delete nextOffsets[key];
575
+ this.ellipsisScrollOffsets = nextOffsets;
576
+ }
577
+ getEllipsisMetrics(key, totalItems) {
578
+ const itemHeight = this.ellipsisItemHeight;
579
+ const safeTotalItems = Math.max(0, totalItems);
580
+ const shouldVirtualize = safeTotalItems > Pagination.ELLIPSIS_VISIBLE_ITEMS;
581
+ const visibleItems = Math.min(safeTotalItems, Pagination.ELLIPSIS_VISIBLE_ITEMS);
582
+ const viewportHeight = visibleItems * itemHeight;
583
+ const maxScrollTop = Math.max(0, safeTotalItems * itemHeight - viewportHeight);
584
+ const storedScrollTop = shouldVirtualize ? (this.ellipsisScrollOffsets[key] ?? 0) : 0;
585
+ const scrollTop = Math.min(Math.max(0, storedScrollTop), maxScrollTop);
586
+ if (safeTotalItems === 0) {
587
+ return {
588
+ shouldVirtualize,
589
+ visibleItems,
590
+ scrollTop: 0,
591
+ renderedStartIndex: 0,
592
+ renderedEndIndex: -1,
593
+ viewportHeight,
594
+ };
595
+ }
596
+ const firstVisibleIndex = Math.min(safeTotalItems - 1, Math.floor(scrollTop / itemHeight));
597
+ const lastVisibleIndex = shouldVirtualize
598
+ ? Math.min(safeTotalItems - 1, Math.ceil((scrollTop + viewportHeight) / itemHeight) - 1)
599
+ : safeTotalItems - 1;
600
+ const renderedStartIndex = shouldVirtualize
601
+ ? Math.max(0, Math.min(safeTotalItems - 1, firstVisibleIndex - Pagination.ELLIPSIS_OVERSCAN))
602
+ : 0;
603
+ const renderedEndIndex = shouldVirtualize
604
+ ? Math.max(renderedStartIndex, Math.min(safeTotalItems - 1, lastVisibleIndex + Pagination.ELLIPSIS_OVERSCAN))
605
+ : safeTotalItems - 1;
606
+ return {
607
+ shouldVirtualize,
608
+ visibleItems,
609
+ scrollTop,
610
+ renderedStartIndex,
611
+ renderedEndIndex,
612
+ viewportHeight,
613
+ };
614
+ }
615
+ setEllipsisScrollOffset(key, scrollTop, totalItems) {
616
+ const viewportHeight = Math.min(totalItems ?? 0, Pagination.ELLIPSIS_VISIBLE_ITEMS) * this.ellipsisItemHeight;
617
+ const maxScrollTop = totalItems === undefined
618
+ ? Number.POSITIVE_INFINITY
619
+ : Math.max(0, totalItems * this.ellipsisItemHeight - viewportHeight);
620
+ const nextScrollTop = Math.min(Math.max(0, scrollTop), maxScrollTop);
621
+ if ((this.ellipsisScrollOffsets[key] ?? 0) === nextScrollTop)
622
+ return;
623
+ this.ellipsisScrollOffsets = {
624
+ ...this.ellipsisScrollOffsets,
625
+ [key]: nextScrollTop,
626
+ };
627
+ }
628
+ getEllipsisListElement(key) {
629
+ return (this.el.shadowRoot?.querySelector(`.pagination-ellipsis[data-ellipsis-key="${key}"] br-list`) ?? null);
630
+ }
631
+ focusEllipsisItemNow(key, pageIndex) {
632
+ const item = this.el.shadowRoot?.querySelector(`.pagination-ellipsis[data-ellipsis-key="${key}"] br-item[data-page-index="${pageIndex}"]`);
633
+ if (item === null || item === undefined)
634
+ return false;
635
+ if ('setFocus' in item) {
636
+ void item.setFocus();
637
+ return true;
638
+ }
639
+ item.focus();
640
+ return true;
641
+ }
642
+ flushPendingEllipsisFocus() {
643
+ const pendingFocus = this.pendingEllipsisFocus;
644
+ if (pendingFocus === null)
645
+ return;
646
+ const list = this.getEllipsisListElement(pendingFocus.key);
647
+ if (list === null)
648
+ return;
649
+ list.scrollTop = pendingFocus.scrollTop;
650
+ if (!this.focusEllipsisItemNow(pendingFocus.key, pendingFocus.pageIndex)) {
651
+ return;
652
+ }
653
+ this.pendingEllipsisFocus = null;
654
+ }
655
+ ensureEllipsisItemVisible(key, totalItems, pageIndex) {
656
+ const { scrollTop, viewportHeight } = this.getEllipsisMetrics(key, totalItems);
657
+ const itemHeight = this.ellipsisItemHeight;
658
+ const maxScrollTop = Math.max(0, totalItems * itemHeight - viewportHeight);
659
+ const itemTop = pageIndex * itemHeight;
660
+ const itemBottom = itemTop + itemHeight;
661
+ let nextScrollTop = scrollTop;
662
+ if (itemTop < scrollTop) {
663
+ nextScrollTop = itemTop;
664
+ }
665
+ else if (itemBottom > scrollTop + viewportHeight) {
666
+ nextScrollTop = itemBottom - viewportHeight;
667
+ }
668
+ nextScrollTop = Math.min(Math.max(0, nextScrollTop), maxScrollTop);
669
+ if (nextScrollTop !== scrollTop) {
670
+ this.pendingEllipsisFocus = {
671
+ key,
672
+ pageIndex,
673
+ scrollTop: nextScrollTop,
674
+ };
675
+ this.setEllipsisScrollOffset(key, nextScrollTop, totalItems);
676
+ return;
677
+ }
678
+ this.focusEllipsisItemNow(key, pageIndex);
679
+ }
680
+ getEllipsisBoundaryNavigationIndex(eventKey, pageIndex, totalItems, visibleItems, renderedStartIndex, renderedEndIndex) {
681
+ if (eventKey === 'Home')
682
+ return 0;
683
+ if (eventKey === 'End')
684
+ return totalItems - 1;
685
+ if (eventKey === 'PageDown')
686
+ return Math.min(totalItems - 1, pageIndex + visibleItems);
687
+ if (eventKey === 'PageUp')
688
+ return Math.max(0, pageIndex - visibleItems);
689
+ if (eventKey === 'ArrowDown') {
690
+ if (pageIndex === totalItems - 1)
691
+ return pageIndex;
692
+ if (pageIndex + 1 > renderedEndIndex)
693
+ return pageIndex + 1;
694
+ }
695
+ if (eventKey === 'ArrowUp') {
696
+ if (pageIndex === 0)
697
+ return pageIndex;
698
+ if (pageIndex - 1 < renderedStartIndex)
699
+ return pageIndex - 1;
700
+ }
701
+ return null;
702
+ }
703
+ handleEllipsisEscape(item, key) {
704
+ this.resetEllipsisScrollOffset(key);
705
+ const dropdown = item.closest('br-dropdown');
706
+ void dropdown?.hide();
707
+ }
708
+ handleEllipsisBoundaryNavigation(event, key, totalItems, pageIndex) {
709
+ const { visibleItems, renderedStartIndex, renderedEndIndex } = this.getEllipsisMetrics(key, totalItems);
710
+ const nextIndex = this.getEllipsisBoundaryNavigationIndex(event.key, pageIndex, totalItems, visibleItems, renderedStartIndex, renderedEndIndex);
711
+ if (nextIndex === null)
712
+ return;
713
+ event.preventDefault();
714
+ event.stopImmediatePropagation();
715
+ if (nextIndex === pageIndex)
716
+ return;
717
+ this.ensureEllipsisItemVisible(key, totalItems, nextIndex);
718
+ }
719
+ renderEllipsis(from, to, position) {
720
+ if (to < from)
721
+ return null;
722
+ const totalItems = to - from + 1;
723
+ const key = this.getEllipsisRangeKey(position, from, to);
724
+ const { shouldVirtualize, renderedStartIndex, renderedEndIndex, viewportHeight } = this.getEllipsisMetrics(key, totalItems);
725
+ const items = [];
726
+ for (let pageIndex = renderedStartIndex; pageIndex <= renderedEndIndex; pageIndex++) {
727
+ const page = from + pageIndex;
728
+ items.push(h("br-item", { key: `ellipsis-item-${key}-${page}`, "data-page-index": pageIndex, "prop:density": this.effectiveDensity, isButton: true, role: "menuitem", "aria-posinset": pageIndex + 1, "aria-setsize": totalItems, onBrDidClick: this.handleEllipsisItemClickFactory(page), onKeyDown: this.handleEllipsisItemKeyDownFactory(key, totalItems), "aria-label": `Página ${page}` }, page));
729
+ }
730
+ const topSpacerHeight = renderedStartIndex * this.ellipsisItemHeight;
731
+ const bottomSpacerHeight = Math.max(0, totalItems - renderedEndIndex - 1) * this.ellipsisItemHeight;
732
+ return (h("li", { class: "pagination-ellipsis", part: "ellipsis", key: `ellipsis-${key}`, "data-ellipsis-key": key, "data-ellipsis-position": position }, h("br-dropdown", null, h("br-button", { part: "ellipsis", exportparts: "button: ellipsis-button", slot: "trigger", shape: "circle", density: this.effectiveDensity, type: "button", "prop:ariaLabel": this.ellipsisLabel, tabIndex: -1, disabled: this.loading, onClick: () => {
733
+ this.resetEllipsisScrollOffset(key);
734
+ }, onKeyDown: this.handlePageKeyDown }, h("br-icon", { "attr:iconName": "fa-solid:ellipsis-h", width: "16", height: "16", "aria-hidden": "true" }), h("span", { class: "visually-hidden" }, this.ellipsisLabel)), h("br-list", { class: { 'has-scroll': shouldVirtualize, 'is-virtualized': shouldVirtualize }, density: this.effectiveDensity, slot: "target", role: "menu", "aria-label": `Páginas ocultas de ${from} até ${to}`, "aria-orientation": "vertical", onScroll: shouldVirtualize ? this.handleEllipsisScrollFactory(key, totalItems) : undefined, style: shouldVirtualize ? { maxHeight: `${viewportHeight}px` } : undefined }, shouldVirtualize && topSpacerHeight > 0 ? (h("div", { class: "pagination-ellipsis-virtual-spacer", role: "presentation", "aria-hidden": "true", style: { height: `${topSpacerHeight}px` } })) : null, items, shouldVirtualize && bottomSpacerHeight > 0 ? (h("div", { class: "pagination-ellipsis-virtual-spacer", role: "presentation", "aria-hidden": "true", style: { height: `${bottomSpacerHeight}px` } })) : null))));
735
+ }
736
+ renderPagesSmall(total, current) {
737
+ const nodes = [];
738
+ if (total <= 3) {
739
+ for (let p = 1; p <= total; p++)
740
+ nodes.push(this.renderPageButton(p));
741
+ return nodes;
742
+ }
743
+ if (current <= 2) {
744
+ nodes.push(this.renderPageButton(1));
745
+ nodes.push(this.renderPageButton(2));
746
+ nodes.push(this.renderEllipsis(3, total - 1, 'start'));
747
+ nodes.push(this.renderPageButton(total));
748
+ return nodes;
749
+ }
750
+ if (current >= total - 1) {
751
+ nodes.push(this.renderPageButton(1));
752
+ nodes.push(this.renderEllipsis(2, total - 2, 'end'));
753
+ nodes.push(this.renderPageButton(total - 1));
754
+ nodes.push(this.renderPageButton(total));
755
+ return nodes;
756
+ }
757
+ nodes.push(this.renderPageButton(1));
758
+ nodes.push(this.renderEllipsis(2, current - 1, 'left'));
759
+ nodes.push(this.renderPageButton(current));
760
+ nodes.push(this.renderEllipsis(current + 1, total - 1, 'right'));
761
+ nodes.push(this.renderPageButton(total));
762
+ return nodes;
763
+ }
764
+ renderPagesStandard(total, current) {
765
+ const nodes = [];
766
+ if (total <= 7) {
767
+ for (let p = 1; p <= total; p++)
768
+ nodes.push(this.renderPageButton(p));
769
+ return nodes;
770
+ }
771
+ if (current <= 4) {
772
+ for (let p = 1; p <= 4; p++)
773
+ nodes.push(this.renderPageButton(p));
774
+ nodes.push(this.renderEllipsis(5, total - 1, 'start'));
775
+ nodes.push(this.renderPageButton(total));
776
+ return nodes;
777
+ }
778
+ if (current >= total - 3) {
779
+ nodes.push(this.renderPageButton(1));
780
+ nodes.push(this.renderEllipsis(2, total - 4, 'end'));
781
+ for (let p = total - 3; p <= total; p++)
782
+ nodes.push(this.renderPageButton(p));
783
+ return nodes;
784
+ }
785
+ nodes.push(this.renderPageButton(1));
786
+ nodes.push(this.renderEllipsis(2, current - 2, 'left'));
787
+ for (let p = current - 1; p <= current + 1; p++)
788
+ nodes.push(this.renderPageButton(p));
789
+ nodes.push(this.renderEllipsis(current + 2, total - 1, 'right'));
790
+ nodes.push(this.renderPageButton(total));
791
+ return nodes;
792
+ }
793
+ renderPages() {
794
+ const total = this.getDefaultTotalPages();
795
+ const current = this.effectiveCurrent;
796
+ return this.isSmall ? this.renderPagesSmall(total, current) : this.renderPagesStandard(total, current);
797
+ }
798
+ renderLoading() {
799
+ if (!this.loading)
800
+ return null;
801
+ return (h("span", { part: "loading", class: "pagination-loading", role: "status", "aria-live": "polite", "aria-label": "Carregando" }, h("slot", { name: "loading" }, h("br-loading", { size: "small", compact: true, label: "Carregando" }))));
802
+ }
803
+ getTotalPages() {
804
+ const items = this.effectiveTotalItems;
805
+ const perPage = this.effectivePerPage;
806
+ return Math.max(1, Math.ceil(items / perPage));
807
+ }
808
+ getRangeInfo() {
809
+ const total = this.effectiveTotalItems;
810
+ const perPage = this.effectivePerPage;
811
+ const current = this.effectiveCurrent;
812
+ if (total === 0)
813
+ return { start: 0, end: 0, total };
814
+ const start = (current - 1) * perPage + 1;
815
+ const end = Math.min(current * perPage, total);
816
+ return { start, end, total };
817
+ }
818
+ handleContextualSelectChange(event) {
819
+ const select = event
820
+ .composedPath()
821
+ .find((node) => node instanceof HTMLElement && node.tagName === 'BR-SELECT');
822
+ if (!(select instanceof HTMLElement) || select.tagName !== 'BR-SELECT')
823
+ return;
824
+ const container = select.parentElement;
825
+ if (container?.classList.contains('pagination-per-page'))
826
+ this.handlePerPageChange(event);
827
+ else if (container?.classList.contains('pagination-go-to-page'))
828
+ this.handleGoToPageChange(event);
829
+ }
830
+ renderPerPageDropdown() {
831
+ return (h("br-select", { part: "per-page", exportparts: "container: per-page-container, input: per-page-input, input-container: per-page-input-container, input-field: per-page-input-field, input-label: per-page-input-label, input-action: per-page-input-action, list: per-page-list", label: this.perPageLabel, isInline: true, inputWidth: "88px", borderless: true, density: this.effectiveDensity, disabled: this.loading, hideSearchIcon: true }, this.effectivePerPageOptions.map((perPageOption) => (h("br-select-option", { key: String(perPageOption), value: String(perPageOption), selected: perPageOption === this.effectivePerPage }, perPageOption)))));
832
+ }
833
+ renderPerPageSelect() {
834
+ return (h("div", { class: "pagination-per-page", part: "per-page" }, this.renderPerPageDropdown()));
835
+ }
836
+ renderGoToSelect() {
837
+ const totalPages = this.getTotalPages();
838
+ const largePageSet = totalPages > Pagination.LARGE_PAGE_THRESHOLD;
839
+ const goToInputWidth = `${Math.max(88, String(totalPages).length * 16 + 48)}px`;
840
+ return (h("div", { class: "pagination-go-to-page d-none d-sm-flex" }, h("br-select", { part: "go-to", exportparts: "container: go-to-container, input: go-to-input, input-container: go-to-input-container, input-field: go-to-input-field, input-label: go-to-input-label, input-action: go-to-input-action, list: go-to-list", label: this.goToPageLabel, options: largePageSet
841
+ ? this.getWindowedGoToOptions(totalPages, this.goToSearchTerm)
842
+ : this.goToOptionsReady
843
+ ? this.getGoToOptions(totalPages)
844
+ : this.getCurrentGoToOption(totalPages), onOpened: this.handleGoToSelectOpened, onClosed: () => (this.goToSearchTerm = ''), onBrSelectSearch: (event) => (this.goToSearchTerm = event.detail.query), value: String(this.effectiveCurrent), isInline: true, inputWidth: goToInputWidth, density: this.effectiveDensity, "visible-items": 7, filterable: true, searchMode: largePageSet ? 'remote' : 'local', borderless: true, disabled: this.loading, hideSearchIcon: true })));
845
+ }
846
+ getWindowedGoToOptions(totalPages, query) {
847
+ const parsed = Number.parseInt(query.trim(), 10);
848
+ const center = Number.isInteger(parsed) && parsed >= 1 && parsed <= totalPages ? parsed : this.effectiveCurrent;
849
+ const radius = query.trim() ? 10 : 50;
850
+ const pages = new Set([1, totalPages]);
851
+ if (!query.trim())
852
+ pages.add(Math.min(Math.max(this.effectiveCurrent, 1), totalPages));
853
+ for (let page = center - radius; page <= center + radius; page++) {
854
+ if (page >= 1 && page <= totalPages)
855
+ pages.add(page);
856
+ }
857
+ if (query.trim() && (!Number.isInteger(parsed) || parsed < 1 || parsed > totalPages))
858
+ return [];
859
+ return [...pages]
860
+ .sort((a, b) => a - b)
861
+ .map((page) => ({ value: String(page), label: String(page), selected: page === this.effectiveCurrent }));
862
+ }
863
+ getCurrentGoToOption(totalPages) {
864
+ const current = Math.min(Math.max(this.effectiveCurrent, 1), totalPages);
865
+ return [{ value: String(current), label: String(current), selected: true }];
866
+ }
867
+ getGoToOptions(totalPages) {
868
+ if (this.goToOptionsCache !== null && this.goToOptionsCache.length === totalPages) {
869
+ return this.goToOptionsCache;
870
+ }
871
+ this.goToOptionsCache = Array.from({ length: totalPages }, (_, index) => {
872
+ const page = index + 1;
873
+ return { value: String(page), label: String(page) };
874
+ });
875
+ return this.goToOptionsCache;
876
+ }
877
+ renderContextual() {
878
+ const { start, end, total } = this.getRangeInfo();
879
+ const totalPages = this.getTotalPages();
880
+ return (h("nav", { part: "nav", class: this.getCssClassMap(), "aria-busy": this.loading ? 'true' : null, "aria-label": this.getComputedNavAriaLabel(), tabIndex: -1, "data-total": total, "data-current": this.effectiveCurrent, "data-per-page": this.effectivePerPage, id: this.customId }, h("div", { class: "pagination-leading" }, this.renderPerPageSelect(), h("span", { class: "br-divider pagination-divider d-none d-sm-block" }), h("div", { class: "pagination-information d-none d-sm-flex", "aria-live": "polite" }, h("slot", { name: "pagination-info" }, h("span", { class: "current" }, start), "-", h("span", { class: "per-page" }, end), "\u00A0de\u00A0", h("span", { class: "total" }, total), "\u00A0", this.itemsText), this.renderLoading())), h("div", { class: "pagination-trailing" }, this.renderGoToSelect(), h("span", { class: "br-divider pagination-divider d-none d-sm-block" }), h("div", { class: "pagination-arrows" }, h("br-button", { part: "prev-button", exportparts: "button: prev-button-inner", shape: "circle", density: this.effectiveDensity, type: "button", "data-previous-page": true, "prop:ariaLabel": this.previousLabel, onClick: this.handlePrevClick, disabled: this.loading || this.effectiveCurrent <= 1 }, h("br-icon", { "attr:iconName": "fa-solid:angle-left", width: "16", height: "16", "aria-hidden": "true" }), h("span", { class: "visually-hidden" }, this.previousLabel)), h("br-button", { part: "next-button", exportparts: "button: next-button-inner", shape: "circle", density: this.effectiveDensity, type: "button", "data-next-page": true, "prop:ariaLabel": this.nextLabel, onClick: this.handleNextClick, disabled: this.loading || this.effectiveCurrent >= totalPages }, h("br-icon", { "attr:iconName": "fa-solid:angle-right", width: "16", height: "16", "aria-hidden": "true" }), h("span", { class: "visually-hidden" }, this.nextLabel)))), h("span", { class: "visually-hidden", "aria-live": "polite" }, "P\u00E1gina ", this.effectiveCurrent, " de ", totalPages)));
881
+ }
882
+ render() {
883
+ if (this.effectiveVariant === 'contextual') {
884
+ return h(Host, null, this.renderContextual());
885
+ }
886
+ const totalPages = this.getDefaultTotalPages();
887
+ return (h(Host, null, h("nav", { part: "nav", class: this.getCssClassMap(), "aria-busy": this.loading ? 'true' : null, "aria-label": this.getComputedNavAriaLabel(), tabIndex: -1, "data-total": totalPages, "data-current": this.effectiveCurrent, id: this.customId }, h("ul", { part: "list" }, h("li", null, h("br-button", { part: "prev-button", exportparts: "button: prev-button-inner", shape: "circle", density: this.effectiveDensity, type: "button", "data-previous-page": true, "prop:ariaLabel": this.previousLabel, onClick: this.handlePrevClick, disabled: this.loading || this.effectiveCurrent <= 1 }, h("br-icon", { "attr:iconName": "fa-solid:angle-left", width: "16", height: "16", "aria-hidden": "true" }), h("span", { class: "visually-hidden" }, this.previousLabel))), this.renderPages(), this.loading ? (h("li", { part: "loading", class: "pagination-loading" }, this.renderLoading())) : null, h("li", null, h("br-button", { part: "next-button", exportparts: "button: next-button-inner", shape: "circle", density: this.effectiveDensity, type: "button", "data-next-page": true, "prop:ariaLabel": this.nextLabel, onClick: this.handleNextClick, disabled: this.loading || this.effectiveCurrent >= totalPages }, h("br-icon", { "attr:iconName": "fa-solid:angle-right", width: "16", height: "16", "aria-hidden": "true" }), h("span", { class: "visually-hidden" }, this.nextLabel)))), h("span", { class: "visually-hidden", "aria-live": "polite" }, "P\u00E1gina ", this.effectiveCurrent, " de ", totalPages))));
888
+ }
889
+ get el() { return getElement(this); }
890
+ static get watchers() { return {
891
+ "total": [{
892
+ "handleTotalChange": 0
893
+ }],
894
+ "totalPages": [{
895
+ "handleTotalPagesChange": 0
896
+ }],
897
+ "current": [{
898
+ "handleCurrentChange": 0
899
+ }],
900
+ "currentPage": [{
901
+ "handleCurrentPageChange": 0
902
+ }],
903
+ "perPage": [{
904
+ "handlePerPagePropChange": 0
905
+ }],
906
+ "totalItems": [{
907
+ "handleTotalItemsChange": 0
908
+ }],
909
+ "density": [{
910
+ "handleDensityChange": 0
911
+ }]
912
+ }; }
913
+ };
914
+ Pagination.ELLIPSIS_VISIBLE_ITEMS = 4;
915
+ Pagination.ELLIPSIS_ITEM_HEIGHT_FALLBACK = 56;
916
+ Pagination.ELLIPSIS_OVERSCAN = 1;
917
+ Pagination.LARGE_PAGE_THRESHOLD = 10000;
918
+ Pagination.style = paginationCss();
919
+
920
+ const selectCss = () => `*,*::before,*::after{box-sizing:border-box}:host{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}main{display:block}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:rgba(0,0,0,0)}b,strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.d-none{display:none !important}@media (min-width: 576px){.d-sm-block{display:block !important}.d-sm-flex{display:flex !important}}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown>.br-notification{left:auto;right:0}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.justify-content-start{justify-content:flex-start !important}.justify-content-end{justify-content:flex-end !important}.justify-content-center{justify-content:center !important}.align-items-center{align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter)*.5);padding-right:calc(var(--grid-gutter)*.5);width:100%}.col{flex:1 0 0%;min-width:8.3333333333%}.col-auto{flex:0 0 auto;width:auto}.col-2{flex-basis:16.6666666667%;max-width:16.6666666667%}.container,.container-fluid,.container-lg{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:flex;flex-wrap:wrap;margin-left:calc(var(--grid-gutter)*-0.5);margin-right:calc(var(--grid-gutter)*-0.5)}@media (min-width: 576px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}.col-sm-4{flex-basis:33.3333333333%;max-width:33.3333333333%}}@media (min-width: 992px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}.col-lg-3{flex-basis:25%;max-width:25%}}@media (min-width: 1600px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.ease{animation-timing-function:cubic-bezier(0.25, 0.1, 0.25, 1)}.ease-out{animation-timing-function:cubic-bezier(0, 0, 0.58, 1)}.ease-in-out{animation-timing-function:cubic-bezier(0.42, 0, 0.58, 1)}.fast{animation-duration:var(--duration-fast)}.slow{animation-duration:var(--duration-slow)}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mb-1{margin-bottom:var(--spacing-scale-half) !important}.ml-1{margin-left:var(--spacing-scale-half) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.pt-half{padding-top:var(--spacing-scale-half) !important}.highlight{background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}fieldset[disabled]{opacity:1}.text-center{text-align:center !important}.text-right{text-align:right !important}.text-nowrap{white-space:nowrap !important}.text-uppercase{text-transform:uppercase !important}.text-bold{font-weight:700 !important}.text-base{font-size:var(--font-size-scale-base) !important}.text-down-01{font-size:var(--font-size-scale-down-01) !important}@media (min-width: 576px){.text-sm-center{text-align:center !important}.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half)}a:focus{outline:none}a.focus-visible,a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}a{color:var(--interactive);text-decoration:none}.main-content a{text-decoration:underline}button{cursor:pointer}img{max-width:100%;vertical-align:middle}h2,.h2{color:var(--color);font-size:var(--font-size-scale-up-03);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2xh);margin-top:var(--spacing-scale-3xh);padding-bottom:var(--spacing-scale-2xh)}@media (min-width: 576px){.h2,h2{font-size:var(--font-size-scale-up-05);font-weight:var(--font-weight-regular)}}ul,ol{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}table{--table-background:var(--background);--table-color:var(--color);--table-border-color:var(--gray-20);--table-border-style:solid;--table-border-width:1px;--table-hover:var(--color-rgb);--table-padding:var(--spacing-scale-3x);--table-font-weight:var(--font-weight-medium);--table-th-background:var(--background-alternative);--table-th-font-weight:var(--font-weight-semi-bold);--table-row-size:var(--spacing-scale-2x);border-collapse:collapse;width:100%}tr.selected,tr.is-selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}fieldset,.fieldset{border:var(--surface-width-none);margin-bottom:var(--spacing-scale-5x);margin-top:0;padding:0}legend,.legend{color:var(--color);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2x);margin-top:var(--spacing-scale-2x)}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}pre,.pre{background:var(--gray-5);margin:var(--spacing-scale-2x) 0 var(--spacing-scale-4x);padding:var(--spacing-scale-2x)}mark,.mark{background:var(--red-warm-vivid-10);color:var(--color)}*[data-toggle=collapse]:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}*[data-toggle=collapse]:focus{outline:none}*[data-toggle=collapse].focus-visible,*[data-toggle=collapse]:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}@media (prefers-reduced-motion: reduce){:host,:host::before,:host::after,:host *,:host *::before,:host *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}}:host-context([data-wbc-reduced-motion=true])::before,:host-context([data-wbc-reduced-motion=true])::after,:host-context([data-wbc-reduced-motion=true]) *,:host-context([data-wbc-reduced-motion=true]) *::before,:host-context([data-wbc-reduced-motion=true]) *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}.br-select{--select-divider:1px solid var(--color-secondary-04);--select-shadow:var(--surface-shadow-md)}.br-select .br-input input{padding-right:29px;text-overflow:ellipsis}.br-select .br-input input::after{bottom:0;padding:0 5px;position:absolute;right:0}.br-select{max-width:400px;min-width:100px;position:relative}.br-select .br-list{background:var(--bg-color);box-shadow:var(--select-shadow);display:none;margin-top:-2px;max-height:404px;overflow:auto;position:absolute;resize:none;width:100%;z-index:1}.br-select .br-list::-webkit-scrollbar{height:var(--spacing-scale-base);width:var(--spacing-scale-base)}.br-select .br-list::-webkit-scrollbar-track{background:var(--gray-10)}.br-select .br-list::-webkit-scrollbar-thumb{background:var(--gray-30)}.br-select .br-list:hover::-webkit-scrollbar-thumb{background:var(--gray-40)}.br-select .br-list:focus,.br-select .br-list:active{color:var(--color-secondary-09);outline:none}.br-select .br-list:hover::-webkit-scrollbar-thumb{background:var(--color-secondary-07)}.br-select .br-list[expanded]{display:block}.br-select .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--interactive-light-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x)}.br-select .br-item .content{padding:0}.br-select .br-item .br-checkbox,.br-select .br-item .br-radio{--item-padding-x:var(--spacing-scale-2x);--item-padding-y:var(--spacing-scale-2x)}.br-select .br-item .br-checkbox input:hover:not(:disabled)+label::before,.br-select .br-item .br-radio input:hover:not(:disabled)+label::before{background-image:none}.br-select .br-item .br-checkbox input+label,.br-select .br-item .br-radio input+label{padding-left:calc(var(--checkbox-padding) + var(--checkbox-size) + var(--item-padding-x))}.br-select .br-item .br-radio input+label{color:var(--text-color);display:block;height:auto;min-height:0;padding:var(--item-padding)}.br-select .br-item .br-radio input+label::before,.br-select .br-item .br-radio input+label::after{content:none}.br-select .br-item:not(:last-child){border-bottom:var(--select-divider)}.br-select .br-item:not([disabled]){--focus-offset:calc(var(--spacing-scale-half) * -1)}.br-select .br-item:not([disabled]):focus{outline:none}.br-select .br-item:not([disabled]).focus-visible,.br-select .br-item:not([disabled]):focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}.br-select .br-item:not([disabled]):not(:disabled):hover{background-image:linear-gradient(rgba(var(--color-rgb), var(--hover)), rgba(var(--color-rgb), var(--hover)))}.br-select .br-item.selected,.br-select .br-item[selected]{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.br-select .br-item.selected:focus,.br-select .br-item[selected]:focus{outline:none}.br-select .br-item.selected.focus-visible,.br-select .br-item.selected:focus-visible,.br-select .br-item[selected].focus-visible,.br-select .br-item[selected]:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}.br-select .br-item.selected:not(:disabled):hover,.br-select .br-item[selected]:not(:disabled):hover{background-image:linear-gradient(rgba(var(--color-rgb), var(--hover)), rgba(var(--color-rgb), var(--hover)))}.br-select .br-item.disabled{line-height:calc(var(--font-line-height-high)*2);padding-left:calc(var(--item-padding) + var(--spacing-scale-base))}.br-select.inverted .br-input,.br-select.inverted .br-input label,.br-select.dark-mode .br-input,.br-select.dark-mode .br-input label{--color:var(--color-dark);--focus-color:var(--focus-color-dark)}:host{box-sizing:border-box;display:block;max-width:100%;width:100%}.br-select{box-sizing:border-box;min-width:0;position:relative;width:100%;max-width:100%}:host([hide-search-icon]) br-select-input::part(icon){display:none}:host([multiple]) .br-select{min-width:0}`;
921
+
922
+ const SELECT_SEARCH_MODES = ['local', 'remote'];
923
+ const SELECT_AUTOCOMPLETE_VALUES = ['on', 'off'];
924
+ const Select = class {
925
+ constructor(hostRef) {
926
+ registerInstance(this, hostRef);
927
+ this.brSelectStateChange = createEvent(this, "brSelectStateChange", 7);
928
+ this.valueChange = createEvent(this, "valueChange", 7);
929
+ this.optionHover = createEvent(this, "optionHover", 7);
930
+ this.brSelectSearch = createEvent(this, "brSelectSearch", 6);
931
+ this.opened = createEvent(this, "opened", 7);
932
+ this.closed = createEvent(this, "closed", 7);
933
+ this.brSelectValidationChange = createEvent(this, "brSelectValidationChange", 7);
934
+ if (hostRef.$hostElement$["s-ei"]) {
935
+ this.elementInternals = hostRef.$hostElement$["s-ei"];
936
+ }
937
+ else {
938
+ this.elementInternals = hostRef.$hostElement$.attachInternals();
939
+ hostRef.$hostElement$["s-ei"] = this.elementInternals;
940
+ }
941
+ /**
942
+ * Remove a borda do input quando o componente não está em foco.
943
+ *
944
+ * @default false
945
+ */
946
+ this.borderless = false;
947
+ /**
948
+ * Desativa toda a interação do select.
949
+ *
950
+ * @default false
951
+ */
952
+ this.disabled = false;
953
+ /**
954
+ * Define a densidade visual compartilhada pelo campo e pela lista de opções.
955
+ * Aceita `small`, `medium` ou `large`. Valores inválidos usam `medium`.
956
+ * A opção sintética de selecionar todos permanece com densidade `small`.
957
+ *
958
+ * @default 'medium'
959
+ */
960
+ this.density = 'medium';
961
+ /**
962
+ * Exibe label e campo na mesma linha.
963
+ *
964
+ * @default false
965
+ * @deprecated Use `inline`.
966
+ */
967
+ this.isInline = false;
968
+ /**
969
+ * Habilita o modo de seleção múltipla.
970
+ *
971
+ * @default false
972
+ * @deprecated Use `multiple`.
973
+ */
974
+ this.isMultiple = false;
975
+ /**
976
+ * Mantém a lista aberta depois de uma seleção.
977
+ *
978
+ * @default false
979
+ * @deprecated O comportamento atual usa o fechamento padrão do select; mantenha esta prop
980
+ * apenas para compatibilidade com integrações legadas.
981
+ */
982
+ this.keepOpenOnSelect = false;
983
+ /**
984
+ * Define quantas linhas visuais ficam visíveis na janela da lista.
985
+ * Cabeçalhos de grupo também ocupam uma linha quando existem.
986
+ * Deve ser um inteiro positivo; valores inválidos usam 6.
987
+ *
988
+ * @default 6
989
+ */
990
+ this.visibleItems = 6;
991
+ /**
992
+ * Informa a altura base de cada opção ou cabeçalho para o cálculo de virtual scroll.
993
+ * Deve ser um número finito positivo; valores inválidos usam 40.
994
+ *
995
+ * @default 40
996
+ */
997
+ this.itemHeight = 40;
998
+ /**
999
+ * Controla a largura do campo de entrada.
1000
+ *
1001
+ * @type {string}
1002
+ * @example '20rem'
1003
+ */
1004
+ this.inputWidth = undefined;
1005
+ /**
1006
+ * Define quantas opções extras são renderizadas antes e depois da área visível no virtual scroll.
1007
+ * Deve ser um inteiro não negativo; valores inválidos usam 1.
1008
+ *
1009
+ * @default 1
1010
+ */
1011
+ this.overscan = 1;
1012
+ /**
1013
+ * Oculta os divisores entre opções consecutivas, sem alterar a altura das linhas.
1014
+ * @default false
1015
+ */
1016
+ this.hideDividers = false;
1017
+ /**
1018
+ * Controla o estado aberto/fechado da lista.
1019
+ *
1020
+ * @default false
1021
+ * @deprecated Use `open`.
1022
+ */
1023
+ this.isOpen = false;
1024
+ /**
1025
+ * Valor público do select baseado nas opções atualmente selecionadas.
1026
+ *
1027
+ * @type {string | string[] | undefined}
1028
+ * @remarks Em modo múltiplo, o valor público é um array de strings.
1029
+ * @example
1030
+ * ```js
1031
+ * const select = document.querySelector('br-select');
1032
+ * select.multiple = true;
1033
+ * select.value = ['df', 'sp'];
1034
+ * ```
1035
+ */
1036
+ this.value = '';
1037
+ /**
1038
+ * Texto exibido quando não há seleção.
1039
+ *
1040
+ * @type {string | undefined}
1041
+ */
1042
+ this.placeholder = '';
1043
+ /**
1044
+ * Indica que o preenchimento do select é obrigatório.
1045
+ *
1046
+ * @default false
1047
+ */
1048
+ this.required = false;
1049
+ /**
1050
+ * Rótulo apresentado para a opção de selecionar todos no modo múltiplo.
1051
+ *
1052
+ * @default 'Selecionar todos'
1053
+ */
1054
+ this.selectAllLabel = Select.SELECT_ALL_LABEL;
1055
+ /**
1056
+ * Habilita a filtragem textual das opções por rótulo ou valor.
1057
+ *
1058
+ * @default true
1059
+ */
1060
+ this.filterable = true;
1061
+ /**
1062
+ * Define se as opções são filtradas localmente ou fornecidas por uma busca remota.
1063
+ * Em `remote`, o componente emite `brSelectSearch` e exibe as opções recebidas
1064
+ * sem filtrá-las de novo pelo termo digitado; a aplicação deve buscar, validar e
1065
+ * aplicar a resposta com `setOptions()` ou re-renderizando os `br-select-option`.
1066
+ * A seleção é preservada mesmo quando não aparece na resposta seguinte.
1067
+ * @default 'local'
1068
+ */
1069
+ this.searchMode = 'local';
1070
+ /**
1071
+ * Indica que uma busca remota de opções está pendente.
1072
+ * Enquanto ativo, a lista exibe o slot `loading` (padrão: "Pesquisando…") e novas
1073
+ * opções não podem ser selecionadas; a aplicação continua responsável por
1074
+ * debounce, cancelamento, erros e autenticação.
1075
+ * @default false
1076
+ */
1077
+ this.loading = false;
1078
+ /**
1079
+ * Exibe a lupa mesmo quando o select não é filtrável; selects com `filterable`
1080
+ * já a exibem. A lupa é omitida quando o campo é estreito demais (menos de
1081
+ * 128px) para comportar lupa, valor e seta.
1082
+ *
1083
+ * @default false
1084
+ */
1085
+ this.showSearchIcon = false;
1086
+ /**
1087
+ * Oculta a lupa mesmo quando `filterable` está ativo, sem desabilitar a busca.
1088
+ * Tem precedência visual sobre `showSearchIcon` e não altera o comportamento padrão.
1089
+ *
1090
+ * @default false
1091
+ */
1092
+ this.hideSearchIcon = false;
1093
+ /**
1094
+ * Rótulo apresentado quando todas as opções já estão selecionadas no modo múltiplo.
1095
+ *
1096
+ * @default 'Desselecionar todos'
1097
+ */
1098
+ this.unselectAllLabel = Select.DESELECT_ALL_LABEL;
1099
+ /**
1100
+ * Fornece opções como array ou JSON, além das opções projetadas por slot.
1101
+ * Use property binding para arrays em JavaScript e frameworks; no atributo
1102
+ * HTML, informe uma string JSON válida. Na inicialização, opções no slot têm
1103
+ * precedência quando existem. Depois de uma alteração nesta prop ou de uma
1104
+ * chamada a `setOptions()`, a coleção imperativa passa a ser a fonte de dados.
1105
+ * Não use em código novo. Declare `br-select-option` no slot padrão ou, para
1106
+ * respostas dinâmicas/remotas, atualize a coleção com `setOptions()`.
1107
+ *
1108
+ * @example
1109
+ * ```html
1110
+ * <!-- Compatibilidade legada; prefira elementos br-select-option. -->
1111
+ * <br-select options='[{"label":"Distrito Federal","value":"df"}]'></br-select>
1112
+ * ```
1113
+ * @deprecated Use `br-select-option` no slot padrão ou `setOptions()` para respostas dinâmicas/remotas.
1114
+ */
1115
+ this.options = [];
1116
+ /** Identificador público do controle. */
1117
+ this.customId = generateUniqueId('br-select');
1118
+ /** Quantidade mínima de opções selecionadas no modo múltiplo. Deve ser um inteiro não negativo; valores inválidos usam 0. */
1119
+ this.minSelections = 0;
1120
+ /** Quantidade máxima de opções selecionadas no modo múltiplo. Deve ser um inteiro não negativo; valores inválidos usam 0. */
1121
+ this.maxSelections = 0;
1122
+ this.shouldRestoreSelectedOptionOnOpen = false;
1123
+ this.isSelectInputPointerDown = false;
1124
+ this.skipSelectInputClickToggle = false;
1125
+ this.pendingOptions = null;
1126
+ this.slotElement = null;
1127
+ this.handleSlotChange = () => this.slotReconciler.schedule();
1128
+ this.slotReconciler = createMicrotaskReconciler(() => this.syncOptionsFromSlot());
1129
+ this.lastEmittedStateKey = '';
1130
+ this.isStateChangeReady = false;
1131
+ this.isValueChangeReady = false;
1132
+ this.listboxId = `${this.customId}-listbox`;
1133
+ this.checkingValidity = false;
1134
+ this.showValidationErrors = false;
1135
+ this.validationErrorMessage = '';
1136
+ this.activeOptionIndex = -1;
1137
+ /**
1138
+ * Oculta o indicador visual da opção ativa após interação por ponteiro, como `:focus-visible`.
1139
+ * O índice ativo e o `aria-activedescendant` são preservados; o teclado volta a exibi-lo.
1140
+ */
1141
+ this.isActiveIndicatorHidden = false;
1142
+ this.searchTerm = '';
1143
+ this.formDisabled = false;
1144
+ this.isValidating = false;
1145
+ this.validatorMessage = null;
1146
+ this.hasFeedbackSlot = false;
1147
+ this.hasValidationLoadingSlot = false;
1148
+ this.selectedValuesState = [];
1149
+ this.customValidationMessage = '';
1150
+ this.validationRunId = 0;
1151
+ this.lastAnnouncedOpen = false;
1152
+ this.isApplyingExternalValue = false;
1153
+ this.suppressValueChange = false;
1154
+ this.hasImperativeOptions = false;
1155
+ this.remoteSelectedOptions = new Map();
1156
+ this.selectionInitialized = false;
1157
+ this.typeAhead = '';
1158
+ this.lastTypeAheadTime = 0;
1159
+ this.selectedValues = [];
1160
+ /**
1161
+ * Sincroniza as opções declaradas no slot com a lista interna renderizada.
1162
+ *
1163
+ * @remarks
1164
+ * Esse passo mantém alinhados o estado visual da lista e o texto exibido no input
1165
+ * quando as opções são adicionadas, removidas ou alteradas dinamicamente.
1166
+ */
1167
+ this.syncOptionsFromSlot = (updateDisplayValue = true) => {
1168
+ if (this.hasImperativeOptions)
1169
+ return;
1170
+ const nodes = this.slotElement?.assignedNodes({ flatten: true }) ?? Array.from(this.el.childNodes);
1171
+ const options = nodes.map((n) => this.nodeToOption(n)).filter((o) => Boolean(o));
1172
+ // Envia opções para o br-select-list
1173
+ if (this.selectListElement)
1174
+ this.selectListElement.options = this.getListOptions(options);
1175
+ if (updateDisplayValue)
1176
+ this.syncDisplayValue(options);
1177
+ };
1178
+ }
1179
+ formDisabledCallback(disabled) {
1180
+ this.formDisabled = disabled;
1181
+ }
1182
+ formResetCallback() {
1183
+ this.showValidationErrors = false;
1184
+ this.validationErrorMessage = '';
1185
+ this.validationRunId++;
1186
+ this.validatorMessage = null;
1187
+ this.customValidationMessage = '';
1188
+ this.applySelectedValue(this.initialValue);
1189
+ }
1190
+ formStateRestoreCallback(state) {
1191
+ if (typeof state !== 'string' || state === '')
1192
+ return;
1193
+ try {
1194
+ this.applySelectedValue(JSON.parse(state));
1195
+ }
1196
+ catch {
1197
+ this.applySelectedValue(state);
1198
+ }
1199
+ }
1200
+ get effectiveVisibleItems() {
1201
+ return resolveIntegerPropValue(this.el, 'visibleItems', this.visibleItems, 1, Number.MAX_SAFE_INTEGER, 6);
1202
+ }
1203
+ get effectiveDensity() {
1204
+ return resolveDensity(this.el, this.density);
1205
+ }
1206
+ get effectiveItemHeight() {
1207
+ return resolveNumberPropValue(this.el, 'itemHeight', this.itemHeight, 1, Number.MAX_SAFE_INTEGER, 40);
1208
+ }
1209
+ get effectiveOverscan() {
1210
+ return resolveIntegerPropValue(this.el, 'overscan', this.overscan, 0, Number.MAX_SAFE_INTEGER, 1);
1211
+ }
1212
+ /**
1213
+ * Termo repassado à lista. Ela só filtra no modo local; no remoto, usa o termo
1214
+ * apenas para exibir a mensagem de lista vazia.
1215
+ */
1216
+ get listSearchTerm() {
1217
+ return this.filterable ? this.searchTerm : '';
1218
+ }
1219
+ get effectiveSearchMode() {
1220
+ return resolveAllowedPropValue(this.el, 'searchMode', this.searchMode, SELECT_SEARCH_MODES, 'local');
1221
+ }
1222
+ get effectiveMinSelections() {
1223
+ return resolveIntegerPropValue(this.el, 'minSelections', this.minSelections, 0, Number.MAX_SAFE_INTEGER, 0);
1224
+ }
1225
+ get effectiveAutocomplete() {
1226
+ return resolveAllowedPropValue(this.el, 'autocomplete', this.autocomplete, SELECT_AUTOCOMPLETE_VALUES, undefined, { allowUndefined: true });
1227
+ }
1228
+ get effectiveMaxSelections() {
1229
+ return resolveIntegerPropValue(this.el, 'maxSelections', this.maxSelections, 0, Number.MAX_SAFE_INTEGER, 0);
1230
+ }
1231
+ componentWillLoad() {
1232
+ this.hasFeedbackSlot = hasNamedLightDomSlot(this.el, 'feedback');
1233
+ this.hasValidationLoadingSlot = hasNamedLightDomSlot(this.el, 'validation-loading');
1234
+ this.setSelectionMode(this.effectiveMultiple);
1235
+ const initialOptions = this.getHostOptions();
1236
+ const propOptions = this.getOptionsProp();
1237
+ const sourceOptions = initialOptions.length === 0 && propOptions.length > 0 ? propOptions : initialOptions;
1238
+ this.setSelectedValues(this.valueFromPublicValue(this.value) ??
1239
+ sourceOptions.filter((option) => option.selected).map((option) => option.value));
1240
+ this.selectionInitialized = true;
1241
+ if (initialOptions.length === 0 && propOptions.length > 0) {
1242
+ this.pendingOptions = propOptions;
1243
+ this.syncDisplayValue(propOptions);
1244
+ }
1245
+ else {
1246
+ this.syncDisplayValue(initialOptions);
1247
+ }
1248
+ this.initialValue = Array.isArray(this.value) ? [...this.value] : this.value;
1249
+ this.syncFormState();
1250
+ }
1251
+ componentDidLoad() {
1252
+ this.lastEmittedStateKey = this.getStateChangeKey();
1253
+ this.isStateChangeReady = true;
1254
+ this.setSelectionMode(this.effectiveMultiple);
1255
+ // Inicializa sincronização de opções a partir do slot
1256
+ this.slotElement = this.el.shadowRoot?.querySelector('slot:not([name])');
1257
+ if (this.slotElement) {
1258
+ this.syncOptionsFromSlot(false);
1259
+ this.slotElement.addEventListener('slotchange', this.handleSlotChange);
1260
+ }
1261
+ if (this.pendingOptions && this.selectListElement) {
1262
+ this.selectListElement.options = this.getListOptions(this.pendingOptions);
1263
+ this.pendingOptions = null;
1264
+ }
1265
+ this.isValueChangeReady = true;
1266
+ this.lastAnnouncedOpen = this.effectiveOpen;
1267
+ if (this.effectiveOpen)
1268
+ this.attachBlockingSurfaceListener();
1269
+ this.updateValidity();
1270
+ }
1271
+ componentDidRender() {
1272
+ this.syncNativeSelectSelection();
1273
+ this.updateValidity();
1274
+ }
1275
+ disconnectedCallback() {
1276
+ this.slotReconciler.cancel();
1277
+ if (this.slotElement) {
1278
+ this.slotElement.removeEventListener('slotchange', this.handleSlotChange);
1279
+ this.slotElement = null;
1280
+ }
1281
+ this.detachBlockingSurfaceListener();
1282
+ }
1283
+ get effectiveMultiple() {
1284
+ return this.multiple ?? this.isMultiple;
1285
+ }
1286
+ get effectiveInline() {
1287
+ return this.inline ?? this.isInline;
1288
+ }
1289
+ get effectiveOpen() {
1290
+ return this.open ?? this.isOpen;
1291
+ }
1292
+ valueFromPublicValue(value) {
1293
+ if (this.effectiveMultiple)
1294
+ return Array.isArray(value) ? [...new Set(value.filter(Boolean))] : null;
1295
+ return typeof value === 'string' && value ? [value] : null;
1296
+ }
1297
+ setSelectedValues(values) {
1298
+ const next = [...new Set(values.filter(Boolean))];
1299
+ if (!this.effectiveMultiple && next.length > 1)
1300
+ next.splice(1);
1301
+ if (this.selectedValues.length === next.length &&
1302
+ this.selectedValues.every((value, index) => value === next[index]))
1303
+ return;
1304
+ this.selectedValues = next;
1305
+ this.selectedValuesState = next;
1306
+ }
1307
+ get canonicalSelectedValues() {
1308
+ return this.selectedValues;
1309
+ }
1310
+ applyCanonicalSelection(options, values = this.canonicalSelectedValues) {
1311
+ if (!this.selectionInitialized)
1312
+ return options.map((option) => ({ ...option }));
1313
+ const selected = new Set(values);
1314
+ return options.map((option) => ({ ...option, selected: selected.has(option.value) }));
1315
+ }
1316
+ getListOptions(options) {
1317
+ const normalized = this.applyCanonicalSelection(options).filter((option) => !this.isSelectAllOption(option));
1318
+ if (!this.effectiveMultiple)
1319
+ return normalized;
1320
+ const selectable = normalized.filter((option) => !this.isSelectAllOption(option));
1321
+ const allSelected = selectable.length > 0 && selectable.every((option) => Boolean(option.selected));
1322
+ const anySelected = selectable.some((option) => Boolean(option.selected));
1323
+ return [
1324
+ {
1325
+ value: SELECT_ALL_OPTION_VALUE,
1326
+ label: allSelected ? this.unselectAllLabel : this.selectAllLabel,
1327
+ selected: allSelected,
1328
+ indeterminate: anySelected && !allSelected,
1329
+ },
1330
+ ...selectable,
1331
+ ];
1332
+ }
1333
+ isDisabled() {
1334
+ return isFormControlDisabled(this.disabled, this.formDisabled);
1335
+ }
1336
+ handleDisabledChange(isDisabled) {
1337
+ if (isDisabled && this.effectiveOpen) {
1338
+ this.close();
1339
+ return;
1340
+ }
1341
+ this.emitStateChange();
1342
+ }
1343
+ handleIsOpenChange(isOpen) {
1344
+ if (this.open === undefined)
1345
+ this.syncOpenState(isOpen);
1346
+ }
1347
+ handleFilterableChange(filterable) {
1348
+ if (!filterable) {
1349
+ this.clearSearch();
1350
+ }
1351
+ }
1352
+ handleLoadingChange(loading) {
1353
+ if (this.selectListElement)
1354
+ this.selectListElement.loading = loading;
1355
+ }
1356
+ handleIsMultipleChange(isMultiple) {
1357
+ if (this.multiple === undefined)
1358
+ this.setSelectionMode(isMultiple);
1359
+ this.syncDisplayValue();
1360
+ }
1361
+ handleMultipleChange(multiple) {
1362
+ if (multiple !== undefined)
1363
+ this.setSelectionMode(multiple);
1364
+ this.syncDisplayValue();
1365
+ }
1366
+ handleOpenChange(open) {
1367
+ if (open !== undefined)
1368
+ this.syncOpenState(open);
1369
+ }
1370
+ handleExternalValueChange(value) {
1371
+ if (this.isApplyingExternalValue)
1372
+ return;
1373
+ this.applySelectedValue(value);
1374
+ }
1375
+ handleOptionsChange() {
1376
+ const options = this.getOptionsProp();
1377
+ void this.setOptions(options);
1378
+ }
1379
+ syncOpenState(isOpen) {
1380
+ if (this.lastAnnouncedOpen !== isOpen) {
1381
+ (isOpen ? this.opened : this.closed).emit();
1382
+ this.lastAnnouncedOpen = isOpen;
1383
+ }
1384
+ if (isOpen) {
1385
+ this.attachBlockingSurfaceListener();
1386
+ this.selectInputElement?.flipUp();
1387
+ void this.openListAndRestorePointerFocus();
1388
+ }
1389
+ else {
1390
+ this.detachBlockingSurfaceListener();
1391
+ this.selectInputElement?.flipDown();
1392
+ void this.selectListElement?.close();
1393
+ }
1394
+ this.emitStateChange();
1395
+ }
1396
+ attachBlockingSurfaceListener() {
1397
+ this.cleanupBlockingSurfaceDismissal ?? (this.cleanupBlockingSurfaceDismissal = listenForExternalBlockingSurface(this.el, () => void this.close()));
1398
+ }
1399
+ detachBlockingSurfaceListener() {
1400
+ this.cleanupBlockingSurfaceDismissal?.();
1401
+ this.cleanupBlockingSurfaceDismissal = undefined;
1402
+ }
1403
+ handleSelectFocusOut(event) {
1404
+ if (!this.getEventPath(event).includes(this.selectInputElement))
1405
+ return;
1406
+ // Aguarda o foco atravessar os Shadow Roots antes de decidir se saiu do select.
1407
+ queueMicrotask(() => {
1408
+ if (!this.el.isConnected || this.el.matches(':focus-within') || this.isDisabled())
1409
+ return;
1410
+ void this.validate();
1411
+ });
1412
+ }
1413
+ handleSelectInvalid(event) {
1414
+ if (event.target !== this.el || this.checkingValidity)
1415
+ return;
1416
+ this.showValidationErrors = true;
1417
+ void this.syncComboboxAccessibility();
1418
+ }
1419
+ handleSelectInputFocus() {
1420
+ if (this.effectiveOpen)
1421
+ return;
1422
+ this.activeOptionIndex = -1;
1423
+ this.skipSelectInputClickToggle = this.isSelectInputPointerDown;
1424
+ void this.show();
1425
+ }
1426
+ handleSelectPointerDown(event) {
1427
+ this.isActiveIndicatorHidden = true;
1428
+ this.skipSelectInputClickToggle = false;
1429
+ this.isSelectInputPointerDown = this.getEventPath(event).includes(this.selectInputElement);
1430
+ }
1431
+ handleSelectInputValueChange(event) {
1432
+ if (!this.filterable || this.isDisabled())
1433
+ return;
1434
+ const nextSearchTerm = event.detail ?? '';
1435
+ this.searchTerm = nextSearchTerm;
1436
+ this.activeOptionIndex = -1;
1437
+ this.brSelectSearch.emit({ query: nextSearchTerm });
1438
+ /*
1439
+ * A chamada imperativa garante que a transição para string vazia também
1440
+ * alcance a lista interna. Isso evita depender apenas da remoção/atualização
1441
+ * do atributo `search-term` no custom element.
1442
+ */
1443
+ void this.getSelectListController()?.setSearchTerm?.(this.listSearchTerm);
1444
+ if (!this.effectiveOpen) {
1445
+ void this.show();
1446
+ }
1447
+ }
1448
+ handleSelectInputActionClick() {
1449
+ // O botão de ação fica dentro do campo: o foco do mesmo clique já abriu a lista.
1450
+ if (this.consumeFocusOpenClick())
1451
+ return;
1452
+ this.toggleOpenFromPointer();
1453
+ }
1454
+ handleSelectInputClick() {
1455
+ if (this.consumeFocusOpenClick())
1456
+ return;
1457
+ if (this.filterable) {
1458
+ if (!this.effectiveOpen)
1459
+ void this.show();
1460
+ return;
1461
+ }
1462
+ this.shouldRestoreSelectedOptionOnOpen = true;
1463
+ void this.toggleOpenFromPointer();
1464
+ }
1465
+ handleSelectOptionStateChange(event, restoreFocus = true) {
1466
+ event.stopPropagation();
1467
+ const detail = event.detail;
1468
+ if (detail.disabled)
1469
+ return;
1470
+ // Use a lista interna para preservar rótulos e opções remotas enquanto as
1471
+ // props projetadas aguardam a próxima renderização.
1472
+ const listOptions = this.getSelectListController()?.options;
1473
+ const sourceOptions = Array.isArray(listOptions) && listOptions.length > 0
1474
+ ? listOptions.map((option) => ({ ...option }))
1475
+ : this.getCurrentOptions();
1476
+ // No modo simples, o evento é a decisão final da interação. A lista
1477
+ // virtualizada e as opções projetadas podem ainda conter o snapshot da
1478
+ // interação anterior durante cliques consecutivos; derivar a coleção a
1479
+ // partir do valor do evento evita que esse snapshot reapareça no valor
1480
+ // público ou no formulário.
1481
+ const selectableValues = sourceOptions
1482
+ .filter((option) => !this.isSelectAllOption(option) && !option.disabled)
1483
+ .map((option) => option.value);
1484
+ const transition = this.isSelectAllOption(detail)
1485
+ ? transitionAllSelection(this.selectedValues, Boolean(detail.selected), selectableValues)
1486
+ : transitionSelection({
1487
+ currentValues: this.selectedValues,
1488
+ multiple: this.effectiveMultiple,
1489
+ value: detail.value,
1490
+ selected: Boolean(detail.selected),
1491
+ });
1492
+ this.setSelectedValues(transition.values);
1493
+ const options = this.applyCanonicalSelection(sourceOptions, transition.values);
1494
+ if (this.selectListElement)
1495
+ this.selectListElement.options = this.getListOptions(options);
1496
+ this.reflectRenderedListSelection(transition.values, options);
1497
+ this.syncSlottedOptionSelection(transition.values);
1498
+ this.rememberRemoteSelections(options);
1499
+ this.syncDisplayValue(options);
1500
+ this.syncActiveOptionIndex(event.detail);
1501
+ this.emitStateChange(detail);
1502
+ this.updateValidity();
1503
+ if (!this.effectiveMultiple && restoreFocus) {
1504
+ void this.selectInputElement?.setFocus?.();
1505
+ void this.close();
1506
+ }
1507
+ if (!transition.changed)
1508
+ return;
1509
+ dispatchNativeFormEvent(this.el, 'input');
1510
+ dispatchNativeFormEvent(this.el, 'change');
1511
+ }
1512
+ /**
1513
+ * Recalcula a coleção quando uma opção projetada muda por atribuição direta
1514
+ * de `selected`, `disabled`, `label`, `group` ou `value`. A lista virtualizada em
1515
+ * Shadow DOM não é uma fonte independente; ela recebe o snapshot pelo seu
1516
+ * contrato público `options`.
1517
+ */
1518
+ handleSelectOptionPropsChange(event) {
1519
+ const path = event.composedPath();
1520
+ const target = path.find((node) => node.tagName?.toLowerCase() === 'br-select-option');
1521
+ // O slot também atravessa br-select-list; filtre a origem, não os ancestrais do evento.
1522
+ if (!(target instanceof HTMLElement) ||
1523
+ !this.el.contains(target) ||
1524
+ findComposedOwner(target, 'br-select') !== this.el)
1525
+ return;
1526
+ if (this.hasImperativeOptions)
1527
+ return;
1528
+ const option = this.optionElementToData(target);
1529
+ if (Boolean(option.selected) !== this.selectedValues.includes(option.value)) {
1530
+ const values = this.isSelectAllOption(option)
1531
+ ? transitionAllSelection(this.selectedValues, Boolean(option.selected), this.getHostOptions()
1532
+ .filter((item) => !this.isSelectAllOption(item) && !item.disabled)
1533
+ .map((item) => item.value)).values
1534
+ : transitionSelection({
1535
+ currentValues: this.selectedValues,
1536
+ multiple: this.effectiveMultiple,
1537
+ value: option.value,
1538
+ selected: Boolean(option.selected),
1539
+ }).values;
1540
+ this.applySelectedValue(this.effectiveMultiple ? values : (values[0] ?? ''));
1541
+ }
1542
+ this.slotReconciler.schedule();
1543
+ }
1544
+ handleSelectOptionHover(event) {
1545
+ this.optionHover.emit(event.detail);
1546
+ }
1547
+ // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: centraliza a navegação por teclado do componente.
1548
+ async handleKeyDown(event) {
1549
+ if (this.isDisabled() || event.isComposing)
1550
+ return;
1551
+ const path = this.getEventPath(event);
1552
+ const isFromInput = path.includes(this.selectInputElement);
1553
+ const isFromList = path.includes(this.selectListElement);
1554
+ if (!isFromInput && !isFromList)
1555
+ return;
1556
+ this.isActiveIndicatorHidden = false;
1557
+ if (event.altKey && event.key === 'ArrowDown') {
1558
+ if (!this.effectiveOpen) {
1559
+ event.preventDefault();
1560
+ await this.show();
1561
+ }
1562
+ return;
1563
+ }
1564
+ if (event.altKey && event.key === 'ArrowUp') {
1565
+ if (this.effectiveOpen) {
1566
+ event.preventDefault();
1567
+ await this.close();
1568
+ this.activeOptionIndex = -1;
1569
+ }
1570
+ return;
1571
+ }
1572
+ if (event.altKey || event.ctrlKey || event.metaKey)
1573
+ return;
1574
+ switch (event.key) {
1575
+ case 'ArrowDown':
1576
+ event.preventDefault();
1577
+ await this.openAndFocusBoundary(isFromInput, 1);
1578
+ return;
1579
+ case 'ArrowUp':
1580
+ event.preventDefault();
1581
+ await this.openAndFocusBoundary(isFromInput, -1);
1582
+ return;
1583
+ case 'Home':
1584
+ if (isFromInput && this.filterable)
1585
+ return;
1586
+ event.preventDefault();
1587
+ if (!this.effectiveOpen)
1588
+ await this.show();
1589
+ await this.focusOptionByIndex(this.getNavigableOptions().findIndex((option) => !option.disabled));
1590
+ return;
1591
+ case 'End':
1592
+ if (isFromInput && this.filterable)
1593
+ return;
1594
+ event.preventDefault();
1595
+ if (!this.effectiveOpen)
1596
+ await this.show();
1597
+ await this.focusOptionByIndex(this.getNavigableOptions()
1598
+ .map((option) => !option.disabled)
1599
+ .lastIndexOf(true), true);
1600
+ return;
1601
+ case 'Enter':
1602
+ case ' ':
1603
+ if (isFromInput && this.filterable && event.key === ' ') {
1604
+ return;
1605
+ }
1606
+ // No campo editável fechado, Enter mantém a ação nativa do formulário.
1607
+ if (isFromInput && this.filterable && event.key === 'Enter' && !this.effectiveOpen)
1608
+ return;
1609
+ event.preventDefault();
1610
+ if (!this.effectiveOpen) {
1611
+ await this.show();
1612
+ return;
1613
+ }
1614
+ if (this.activeOptionIndex < 0) {
1615
+ await this.close();
1616
+ this.activeOptionIndex = -1;
1617
+ return;
1618
+ }
1619
+ await this.selectFocusedOption();
1620
+ return;
1621
+ case 'Escape':
1622
+ if (!this.effectiveOpen)
1623
+ return;
1624
+ event.preventDefault();
1625
+ await this.close();
1626
+ this.activeOptionIndex = -1;
1627
+ await this.selectInputElement?.setFocus?.();
1628
+ return;
1629
+ case 'Tab':
1630
+ if (!this.effectiveOpen)
1631
+ return;
1632
+ await this.close();
1633
+ this.activeOptionIndex = -1;
1634
+ return;
1635
+ default:
1636
+ if (!this.filterable && event.key.length === 1 && event.key !== ' ') {
1637
+ event.preventDefault();
1638
+ await this.focusOptionByTypedCharacters(event.key);
1639
+ }
1640
+ return;
1641
+ }
1642
+ }
1643
+ handleWindowClick(ev) {
1644
+ this.handleOutsideClick(ev);
1645
+ }
1646
+ /**
1647
+ * Habilita o select para interação do usuário.
1648
+ *
1649
+ * @returns Uma promise concluída após a atualização do estado.
1650
+ */
1651
+ async enable() {
1652
+ this.disabled = false;
1653
+ }
1654
+ /**
1655
+ * Desabilita o select e impede novas interações.
1656
+ *
1657
+ * @returns Uma promise concluída após a atualização do estado.
1658
+ */
1659
+ async disable() {
1660
+ this.disabled = true;
1661
+ }
1662
+ /**
1663
+ * Abre a lista de opções quando o componente está habilitado.
1664
+ *
1665
+ * @returns Uma promise concluída após a atualização do estado.
1666
+ */
1667
+ async show() {
1668
+ if (this.isDisabled())
1669
+ return;
1670
+ if (this.open !== undefined)
1671
+ this.open = true;
1672
+ else
1673
+ this.isOpen = true;
1674
+ }
1675
+ /**
1676
+ * Fecha a lista de opções quando o componente está habilitado.
1677
+ *
1678
+ * @returns Uma promise concluída após a atualização do estado.
1679
+ */
1680
+ async close() {
1681
+ if (this.isDisabled())
1682
+ return;
1683
+ if (this.open !== undefined)
1684
+ this.open = false;
1685
+ else
1686
+ this.isOpen = false;
1687
+ this.typeAhead = '';
1688
+ this.clearSearch();
1689
+ }
1690
+ /**
1691
+ * Alterna entre os estados aberto e fechado do select.
1692
+ *
1693
+ * @returns {Promise<void>} Uma promise concluída após a atualização do estado.
1694
+ */
1695
+ async toggleOpen() {
1696
+ if (this.isDisabled())
1697
+ return;
1698
+ if (this.open !== undefined)
1699
+ this.open = !this.open;
1700
+ else
1701
+ this.isOpen = !this.isOpen;
1702
+ }
1703
+ /**
1704
+ * Limpa a seleção atual.
1705
+ *
1706
+ * @deprecated Use `setValue('')` ou a API de formulário.
1707
+ */
1708
+ async clear() {
1709
+ await this.setValue(this.effectiveMultiple ? [] : '');
1710
+ }
1711
+ /**
1712
+ * Retorna o valor público atual.
1713
+ *
1714
+ * @deprecated Leia a propriedade `value` diretamente.
1715
+ */
1716
+ async getValue() {
1717
+ return this.value ?? (this.effectiveMultiple ? [] : '');
1718
+ }
1719
+ /**
1720
+ * Define o valor público do select.
1721
+ *
1722
+ * @deprecated Atribua a propriedade `value` diretamente.
1723
+ */
1724
+ async setValue(value) {
1725
+ this.applySelectedValue(value);
1726
+ }
1727
+ /**
1728
+ * Move o foco para o campo interno.
1729
+ *
1730
+ * @deprecated Use o foco nativo do componente quando possível.
1731
+ */
1732
+ async setFocus() {
1733
+ await this.selectInputElement?.setFocus?.();
1734
+ }
1735
+ async checkValidity() {
1736
+ this.checkingValidity = true;
1737
+ try {
1738
+ return this.elementInternals?.checkValidity?.() ?? true;
1739
+ }
1740
+ finally {
1741
+ this.checkingValidity = false;
1742
+ }
1743
+ }
1744
+ async reportValidity() {
1745
+ this.showValidationErrors = true;
1746
+ this.updateValidity();
1747
+ await this.syncComboboxAccessibility();
1748
+ return this.elementInternals?.reportValidity?.() ?? true;
1749
+ }
1750
+ async setCustomValidity(message) {
1751
+ this.customValidationMessage = message;
1752
+ this.updateValidity();
1753
+ }
1754
+ async getValidationState() {
1755
+ return getFormValidationState(this.elementInternals);
1756
+ }
1757
+ async validate() {
1758
+ this.showValidationErrors = true;
1759
+ this.updateValidity();
1760
+ await this.syncComboboxAccessibility();
1761
+ const validator = this.resolveValidator();
1762
+ if (!validator || this.isDisabled())
1763
+ return this.checkValidity();
1764
+ const runId = ++this.validationRunId;
1765
+ this.isValidating = true;
1766
+ this.validatorMessage = null;
1767
+ this.updateValidity();
1768
+ this.brSelectValidationChange.emit({ validating: true, valid: null, message: null });
1769
+ let message = null;
1770
+ try {
1771
+ const currentValue = this.effectiveMultiple
1772
+ ? [...(Array.isArray(this.value) ? this.value : [])]
1773
+ : String(this.value ?? '');
1774
+ message = (await validator(currentValue)) || null;
1775
+ }
1776
+ catch {
1777
+ message = 'Não foi possível validar a seleção.';
1778
+ }
1779
+ if (runId !== this.validationRunId)
1780
+ return false;
1781
+ this.validatorMessage = message;
1782
+ this.isValidating = false;
1783
+ this.updateValidity();
1784
+ const valid = message === null && (await this.checkValidity());
1785
+ this.brSelectValidationChange.emit({ validating: false, valid, message });
1786
+ return valid;
1787
+ }
1788
+ /**
1789
+ * Substitui a coleção atual de opções por uma nova lista.
1790
+ *
1791
+ * @param options Opções que devem ser exibidas pela lista interna.
1792
+ * Em `search-mode="remote"`, a seleção atual é preservada mesmo quando não
1793
+ * aparece na resposta recebida.
1794
+ * @returns Uma promise concluída após a sincronização das opções.
1795
+ */
1796
+ async setOptions(options) {
1797
+ this.hasImperativeOptions = true;
1798
+ const nextOptions = this.effectiveSearchMode === 'remote' ? this.applyRemoteSelection(options) : options;
1799
+ this.suppressValueChange = true;
1800
+ try {
1801
+ if (this.selectListElement) {
1802
+ this.selectListElement.options = this.getListOptions(nextOptions);
1803
+ }
1804
+ else {
1805
+ this.pendingOptions = nextOptions;
1806
+ }
1807
+ this.syncDisplayValue(nextOptions);
1808
+ }
1809
+ finally {
1810
+ this.suppressValueChange = false;
1811
+ }
1812
+ }
1813
+ /**
1814
+ * Adiciona ou atualiza uma única opção na coleção interna.
1815
+ *
1816
+ * @param option Opção que deve ser inserida ou atualizada.
1817
+ * @returns Uma promise concluída após a sincronização da opção.
1818
+ */
1819
+ async setOption(option) {
1820
+ this.hasImperativeOptions = true;
1821
+ const currentOptions = this.getCurrentOptions();
1822
+ const index = currentOptions.findIndex((currentOption) => currentOption.value === option.value);
1823
+ const nextOptions = [...currentOptions];
1824
+ if (index === -1)
1825
+ nextOptions.push(option);
1826
+ else
1827
+ nextOptions[index] = option;
1828
+ if (this.selectListElement) {
1829
+ this.selectListElement.options = this.getListOptions(nextOptions);
1830
+ }
1831
+ else {
1832
+ this.pendingOptions = nextOptions;
1833
+ }
1834
+ this.syncDisplayValue(nextOptions);
1835
+ }
1836
+ getHostOptions() {
1837
+ return Array.from(this.el.childNodes)
1838
+ .map((node) => this.nodeToOption(node))
1839
+ .filter((option) => Boolean(option));
1840
+ }
1841
+ nodeToOption(node) {
1842
+ if (node.nodeType === Node.ELEMENT_NODE)
1843
+ return this.elementToOption(node);
1844
+ if (node.nodeType === Node.TEXT_NODE)
1845
+ return this.textNodeToOption(node);
1846
+ return null;
1847
+ }
1848
+ elementToOption(el) {
1849
+ if (el.tagName.toLowerCase() === 'br-select-option')
1850
+ return this.optionElementToData(el);
1851
+ const text = (el.textContent || '').trim();
1852
+ return text ? { value: text, label: text } : null;
1853
+ }
1854
+ textNodeToOption(textNode) {
1855
+ const text = (textNode.textContent || '').trim();
1856
+ return text ? { value: text, label: text } : null;
1857
+ }
1858
+ optionElementToData(el) {
1859
+ const rawValue = el.getAttribute('value') ?? el.value ?? '';
1860
+ const rawLabel = el.getAttribute('label') ?? el.label ?? '';
1861
+ let value = String(rawValue || '').trim();
1862
+ let label = String(rawLabel || '').trim();
1863
+ const group = this.getOptionElementGroup(el);
1864
+ const inner = this.extractInnerTextFromOption(el);
1865
+ const content = (el.innerHTML || '').trim();
1866
+ const selected = el.selected ?? el.hasAttribute('selected');
1867
+ const disabled = el.disabled ?? el.hasAttribute('disabled');
1868
+ if (!value && inner)
1869
+ value = inner.trim();
1870
+ if (!label)
1871
+ label = inner?.trim() || value;
1872
+ return {
1873
+ value: value || '',
1874
+ label: label || undefined,
1875
+ group,
1876
+ selected,
1877
+ disabled,
1878
+ content: content || undefined,
1879
+ };
1880
+ }
1881
+ getOptionElementGroup(el) {
1882
+ return String(el.getAttribute('group') ?? el.group ?? '').trim() || undefined;
1883
+ }
1884
+ extractInnerTextFromOption(el) {
1885
+ const fallback = (el.textContent || '').trim();
1886
+ return fallback || null;
1887
+ }
1888
+ getOptionLabel(option) {
1889
+ return (option.label ?? option.value).trim();
1890
+ }
1891
+ getDisplayValue(options = this.getCurrentOptions()) {
1892
+ const selectedOptions = options.filter((option) => {
1893
+ if (!option.selected)
1894
+ return false;
1895
+ const optionLabel = this.getOptionLabel(option);
1896
+ return !this.isSelectAllLabel(optionLabel);
1897
+ });
1898
+ if (selectedOptions.length === 0)
1899
+ return '';
1900
+ if (!this.effectiveMultiple) {
1901
+ return this.getOptionLabel(selectedOptions[0]);
1902
+ }
1903
+ const [firstSelected, ...otherSelected] = selectedOptions;
1904
+ const firstLabel = this.getOptionLabel(firstSelected);
1905
+ if (otherSelected.length === 0)
1906
+ return firstLabel;
1907
+ return `${firstLabel} + (${otherSelected.length})`;
1908
+ }
1909
+ syncDisplayValue(options) {
1910
+ const resolvedOptions = this.getFormOptions(options ?? this.getCurrentOptions());
1911
+ this.displayValue = this.getDisplayValue(resolvedOptions);
1912
+ this.syncValue(resolvedOptions);
1913
+ }
1914
+ syncValue(options) {
1915
+ this.setSelectedValues(options
1916
+ .filter((option) => option.selected && !this.isSelectAllLabel(this.getOptionLabel(option)))
1917
+ .map((option) => option.value));
1918
+ const nextValue = this.getSerializedValue(options);
1919
+ this.syncFormState(options);
1920
+ if (this.value === nextValue)
1921
+ return;
1922
+ this.isApplyingExternalValue = true;
1923
+ this.value = nextValue;
1924
+ this.isApplyingExternalValue = false;
1925
+ if (!this.isValueChangeReady || this.suppressValueChange)
1926
+ return;
1927
+ this.valueChange.emit(Array.isArray(nextValue) ? nextValue.join(',') : nextValue);
1928
+ }
1929
+ getSerializedValue(options) {
1930
+ const selectedValues = options
1931
+ .filter((option) => {
1932
+ if (!option.selected)
1933
+ return false;
1934
+ const optionLabel = this.getOptionLabel(option);
1935
+ return !this.isSelectAllLabel(optionLabel);
1936
+ })
1937
+ .map((option) => option.value);
1938
+ if (this.effectiveMultiple)
1939
+ return selectedValues;
1940
+ if (selectedValues.length === 0)
1941
+ return '';
1942
+ return selectedValues[0];
1943
+ }
1944
+ getOptionsProp() {
1945
+ let parsed = this.options;
1946
+ if (!Array.isArray(this.options)) {
1947
+ try {
1948
+ parsed = JSON.parse(this.options || '[]');
1949
+ }
1950
+ catch {
1951
+ reportInvalidPropValue(this.el, 'options', this.options, 'Informe um array de opções ou uma string JSON válida.', 'Aplicando fallback [].');
1952
+ return [];
1953
+ }
1954
+ }
1955
+ if (!Array.isArray(parsed)) {
1956
+ reportInvalidPropValue(this.el, 'options', this.options, 'Informe um array de opções ou uma string JSON válida.', 'Aplicando fallback [].');
1957
+ return [];
1958
+ }
1959
+ const validOptions = parsed.filter((option) => {
1960
+ return typeof option === 'object' && option !== null && typeof option.value === 'string';
1961
+ });
1962
+ const hasInvalidLabels = parsed.some((option) => {
1963
+ if (typeof option !== 'object' || option === null)
1964
+ return false;
1965
+ const label = option.label;
1966
+ return label !== undefined && typeof label !== 'string';
1967
+ });
1968
+ const hasInvalidGroups = parsed.some((option) => {
1969
+ if (typeof option !== 'object' || option === null)
1970
+ return false;
1971
+ const group = option.group;
1972
+ return group !== undefined && typeof group !== 'string';
1973
+ });
1974
+ const normalizedOptions = validOptions.map((option) => ({
1975
+ ...option,
1976
+ group: typeof option.group === 'string' ? option.group.trim() || undefined : undefined,
1977
+ label: typeof option.label === 'string' ? option.label : undefined,
1978
+ }));
1979
+ if (validOptions.length !== parsed.length || hasInvalidLabels || hasInvalidGroups) {
1980
+ reportInvalidPropValue(this.el, 'options', this.options, 'Cada opção deve ter `value` string e pode ter `label` e `group` como strings.', 'Ignorando opções inválidas e removendo rótulos ou grupos com tipo incompatível.');
1981
+ }
1982
+ return normalizedOptions;
1983
+ }
1984
+ applySelectedValue(value) {
1985
+ const currentOptions = this.getCurrentOptions();
1986
+ const requestedValues = this.valueFromPublicValue(value) ?? [];
1987
+ this.setSelectedValues(requestedValues);
1988
+ this.syncSlottedOptionSelection(requestedValues);
1989
+ const options = currentOptions.map((option) => ({
1990
+ ...option,
1991
+ selected: requestedValues.includes(option.value),
1992
+ }));
1993
+ this.isApplyingExternalValue = true;
1994
+ if (this.selectListElement)
1995
+ this.selectListElement.options = this.getListOptions(options);
1996
+ else
1997
+ this.pendingOptions = options;
1998
+ this.reflectRenderedListSelection(requestedValues, options);
1999
+ this.value = value;
2000
+ this.isApplyingExternalValue = false;
2001
+ this.remoteSelectedOptions.clear();
2002
+ this.rememberRemoteSelections(options);
2003
+ if (this.effectiveSearchMode === 'remote') {
2004
+ const selectedValues = new Set(Array.isArray(value) ? value : [value ?? '']);
2005
+ selectedValues.forEach((selectedValue) => {
2006
+ if (selectedValue && !currentOptions.some((option) => option.value === selectedValue)) {
2007
+ this.remoteSelectedOptions.set(selectedValue, {
2008
+ value: selectedValue,
2009
+ label: selectedValue,
2010
+ selected: true,
2011
+ });
2012
+ }
2013
+ });
2014
+ this.syncDisplayValue(this.getCurrentOptions());
2015
+ return;
2016
+ }
2017
+ this.syncDisplayValue(options);
2018
+ }
2019
+ applyRemoteSelection(options) {
2020
+ this.rememberRemoteSelections(this.getCurrentOptions());
2021
+ const selectedValues = new Set(this.selectedValues);
2022
+ const nextOptions = options.map((option) => ({
2023
+ ...option,
2024
+ selected: selectedValues.has(option.value) || Boolean(option.selected),
2025
+ }));
2026
+ this.rememberRemoteSelections(nextOptions);
2027
+ return nextOptions;
2028
+ }
2029
+ rememberRemoteSelections(options) {
2030
+ if (this.effectiveSearchMode !== 'remote')
2031
+ return;
2032
+ const visibleValues = new Set(options.map((option) => option.value));
2033
+ options.forEach((option) => {
2034
+ if (option.selected)
2035
+ this.remoteSelectedOptions.set(option.value, { ...option, selected: true });
2036
+ else if (visibleValues.has(option.value))
2037
+ this.remoteSelectedOptions.delete(option.value);
2038
+ });
2039
+ }
2040
+ getFormOptions(options) {
2041
+ if (this.effectiveSearchMode !== 'remote')
2042
+ return options;
2043
+ const result = options.map((option) => ({ ...option }));
2044
+ const existingValues = new Set(result.map((option) => option.value));
2045
+ this.remoteSelectedOptions.forEach((option, value) => {
2046
+ if (!existingValues.has(value))
2047
+ result.push({ ...option, selected: true });
2048
+ });
2049
+ return result;
2050
+ }
2051
+ syncFormState(options = this.getCurrentOptions()) {
2052
+ const selected = this.getFormOptions(options).filter((option) => option.selected && !this.isSelectAllLabel(this.getOptionLabel(option)));
2053
+ const selectedValues = selected.map((option) => option.value);
2054
+ const formValue = this.effectiveMultiple ? JSON.stringify(selectedValues) : (selectedValues[0] ?? null);
2055
+ safeSetFormValue(this.elementInternals, formValue);
2056
+ this.syncNativeSelectSelection(selectedValues);
2057
+ this.updateValidity(selectedValues.length);
2058
+ }
2059
+ syncNativeSelectSelection(values = this.getSelectedValues()) {
2060
+ const nativeSelect = this.getNativeSelect();
2061
+ if (!nativeSelect)
2062
+ return;
2063
+ const selectedValues = new Set(values);
2064
+ Array.from(nativeSelect.options).forEach((option) => {
2065
+ option.selected = option.value === '' ? selectedValues.size === 0 : selectedValues.has(option.value);
2066
+ });
2067
+ }
2068
+ getSelectedValues() {
2069
+ return [...this.selectedValues];
2070
+ }
2071
+ updateValidity(selectedCount = this.getSelectedValues().length) {
2072
+ const nativeSelect = this.getNativeSelect();
2073
+ if (!nativeSelect)
2074
+ return;
2075
+ const selectionMessage = this.effectiveMultiple && this.effectiveMinSelections > 0 && selectedCount < this.effectiveMinSelections
2076
+ ? `Selecione pelo menos ${this.effectiveMinSelections} opções.`
2077
+ : this.effectiveMultiple && this.effectiveMaxSelections > 0 && selectedCount > this.effectiveMaxSelections
2078
+ ? `Selecione no máximo ${this.effectiveMaxSelections} opções.`
2079
+ : '';
2080
+ nativeSelect.setCustomValidity(this.customValidationMessage || this.validatorMessage || selectionMessage);
2081
+ syncNativeFormValidity(this.elementInternals, nativeSelect);
2082
+ void this.syncComboboxAccessibility();
2083
+ }
2084
+ getNativeSelect() {
2085
+ return (this.el.shadowRoot?.querySelector('select[part="hidden-select"]') ??
2086
+ this.nativeSelect);
2087
+ }
2088
+ resolveValidator() {
2089
+ return resolveFormValidator(this.validator);
2090
+ }
2091
+ getRenderedDisplayValue() {
2092
+ return this.displayValue ?? this.getDisplayValue();
2093
+ }
2094
+ /**
2095
+ * Retorna o id da opção atualmente ativa para consumo do `aria-activedescendant`.
2096
+ *
2097
+ * @returns O id da opção ativa ou `undefined` quando a lista está fechada.
2098
+ */
2099
+ async syncComboboxAccessibility() {
2100
+ const nativeSelect = this.getNativeSelect();
2101
+ const invalid = this.showValidationErrors && Boolean(nativeSelect && !nativeSelect.validity.valid);
2102
+ const errorMessage = !invalid
2103
+ ? ''
2104
+ : nativeSelect?.validity.customError
2105
+ ? nativeSelect.validationMessage
2106
+ : nativeSelect?.validity.valueMissing
2107
+ ? 'Este campo é obrigatório.'
2108
+ : nativeSelect?.validationMessage || '';
2109
+ this.validationErrorMessage = errorMessage;
2110
+ await this.selectInputElement?.syncCombobox?.({
2111
+ options: this.getNavigableOptions(),
2112
+ activeIndex: this.effectiveOpen ? this.activeOptionIndex : -1,
2113
+ expanded: this.effectiveOpen,
2114
+ multiple: this.effectiveMultiple,
2115
+ label: this.getAccessibleLabel(),
2116
+ loading: this.loading,
2117
+ required: this.required,
2118
+ invalid,
2119
+ errorMessage,
2120
+ });
2121
+ }
2122
+ /**
2123
+ * Indica se o clique atual foi o mesmo que deu foco ao campo e abriu a lista,
2124
+ * limpando o estado do ponteiro. Esse clique não deve alternar a lista de novo.
2125
+ */
2126
+ consumeFocusOpenClick() {
2127
+ const skip = this.skipSelectInputClickToggle;
2128
+ this.skipSelectInputClickToggle = false;
2129
+ this.isSelectInputPointerDown = false;
2130
+ return skip;
2131
+ }
2132
+ toggleOpenFromPointer() {
2133
+ if (!this.effectiveOpen) {
2134
+ this.shouldRestoreSelectedOptionOnOpen = true;
2135
+ }
2136
+ void this.toggleOpen();
2137
+ }
2138
+ async openListAndRestorePointerFocus() {
2139
+ await this.selectListElement?.open();
2140
+ if (!this.shouldRestoreSelectedOptionOnOpen)
2141
+ return;
2142
+ this.shouldRestoreSelectedOptionOnOpen = false;
2143
+ await this.scrollFirstSelectedOptionToTop();
2144
+ }
2145
+ async scrollFirstSelectedOptionToTop() {
2146
+ const options = this.getNavigableOptions();
2147
+ const firstSelectedIndex = options.findIndex((option) => !this.isSelectAllLabel(this.getOptionLabel(option)) && Boolean(option.selected));
2148
+ if (firstSelectedIndex < 0)
2149
+ return;
2150
+ const didScroll = await this.getSelectListController()?.scrollFirstSelectedOptionToTop?.();
2151
+ if (didScroll) {
2152
+ this.activeOptionIndex = firstSelectedIndex;
2153
+ }
2154
+ }
2155
+ async openAndFocusBoundary(fromInput, direction) {
2156
+ if (!this.effectiveOpen) {
2157
+ await this.show();
2158
+ await this.selectListElement?.open?.();
2159
+ await this.focusInitialOption(direction);
2160
+ return;
2161
+ }
2162
+ if (fromInput && this.activeOptionIndex < 0) {
2163
+ await this.focusInitialOption(direction);
2164
+ return;
2165
+ }
2166
+ await this.moveActiveOption(direction);
2167
+ }
2168
+ async focusOptionByTypedCharacters(character) {
2169
+ const now = Date.now();
2170
+ this.typeAhead = now - this.lastTypeAheadTime < 700 ? this.typeAhead + character : character;
2171
+ this.lastTypeAheadTime = now;
2172
+ const options = this.getNavigableOptions();
2173
+ if (!options.length)
2174
+ return;
2175
+ const normalize = (value) => value
2176
+ .normalize('NFD')
2177
+ .replace(/[\u0300-\u036f]/g, '')
2178
+ .toLocaleLowerCase('pt-BR');
2179
+ const search = (query) => {
2180
+ for (let offset = 1; offset <= options.length; offset++) {
2181
+ const index = (this.activeOptionIndex + offset + options.length) % options.length;
2182
+ const option = options[index];
2183
+ if (!option.disabled && normalize(this.getOptionLabel(option)).startsWith(normalize(query)))
2184
+ return index;
2185
+ }
2186
+ return -1;
2187
+ };
2188
+ let index = search(this.typeAhead);
2189
+ if (index < 0 && /^(.)(\1)+$/u.test(this.typeAhead))
2190
+ index = search(character);
2191
+ if (index < 0)
2192
+ return;
2193
+ if (!this.effectiveOpen)
2194
+ await this.show();
2195
+ await this.focusOptionByIndex(index);
2196
+ }
2197
+ /**
2198
+ * Define qual opção deve receber foco ao abrir ou iniciar a navegação pelo teclado.
2199
+ *
2200
+ * @param direction Direção inicial da navegação. `1` avança e `-1` recua.
2201
+ */
2202
+ async focusInitialOption(direction) {
2203
+ const options = this.getNavigableOptions();
2204
+ if (options.length === 0)
2205
+ return;
2206
+ const selectedIndex = options.findIndex((option) => !option.disabled && !this.isSelectAllOption(option) && Boolean(option.selected));
2207
+ if (selectedIndex >= 0) {
2208
+ let nextIndex = selectedIndex + direction;
2209
+ while (nextIndex >= 0 && nextIndex < options.length && options[nextIndex].disabled)
2210
+ nextIndex += direction;
2211
+ await this.focusOptionByIndex(nextIndex >= 0 && nextIndex < options.length ? nextIndex : selectedIndex, true);
2212
+ return;
2213
+ }
2214
+ const fallbackIndex = direction > 0
2215
+ ? options.findIndex((option) => !option.disabled)
2216
+ : options.map((option) => !option.disabled).lastIndexOf(true);
2217
+ const initialIndex = selectedIndex >= 0 ? selectedIndex : fallbackIndex;
2218
+ await this.focusOptionByIndex(initialIndex);
2219
+ }
2220
+ async moveActiveOption(step) {
2221
+ const options = this.getNavigableOptions();
2222
+ if (options.length === 0)
2223
+ return;
2224
+ const baseIndex = this.getCurrentActiveIndex();
2225
+ let nextIndex = baseIndex + step;
2226
+ while (nextIndex >= 0 && nextIndex < options.length && options[nextIndex].disabled)
2227
+ nextIndex += step;
2228
+ if (nextIndex >= 0 && nextIndex < options.length)
2229
+ await this.focusOptionByIndex(nextIndex);
2230
+ }
2231
+ /**
2232
+ * Resolve o índice ativo atual a partir do estado local ou da opção já selecionada.
2233
+ *
2234
+ * @returns O índice que deve servir como base para a próxima navegação por teclado.
2235
+ */
2236
+ getCurrentActiveIndex() {
2237
+ if (this.activeOptionIndex >= 0)
2238
+ return this.activeOptionIndex;
2239
+ const options = this.getNavigableOptions();
2240
+ const selectedIndex = options.findIndex((option) => !option.disabled && !this.isSelectAllOption(option) && Boolean(option.selected));
2241
+ return selectedIndex >= 0 ? selectedIndex : 0;
2242
+ }
2243
+ /**
2244
+ * Encaminha o foco lógico para uma opção específica da lista interna.
2245
+ *
2246
+ * @param index Índice da opção que deve receber foco.
2247
+ * @param scrollToTop Posiciona a opção no topo da viewport quando verdadeiro.
2248
+ */
2249
+ async focusOptionByIndex(index, scrollToTop = false) {
2250
+ if (!this.getNavigableOptions()[index] || this.getNavigableOptions()[index].disabled)
2251
+ return;
2252
+ this.activeOptionIndex = index;
2253
+ const listController = this.getSelectListController();
2254
+ if (scrollToTop)
2255
+ await listController?.scrollOptionToTop?.(index);
2256
+ else
2257
+ await listController?.revealOption?.(index);
2258
+ }
2259
+ /**
2260
+ * Seleciona a opção atualmente ativa sem duplicar a lógica de seleção da lista.
2261
+ *
2262
+ * @remarks
2263
+ * Em modo simples, confirma a opção ativa; no múltiplo, alterna sua seleção.
2264
+ */
2265
+ async selectFocusedOption(restoreFocus = true) {
2266
+ const options = this.getNavigableOptions();
2267
+ if (options.length === 0)
2268
+ return;
2269
+ const index = this.activeOptionIndex;
2270
+ const option = options[index];
2271
+ if (!option || option.disabled)
2272
+ return;
2273
+ this.handleSelectOptionStateChange(new CustomEvent('brSelectOptionStateChange', {
2274
+ detail: { ...option, selected: this.effectiveMultiple ? !option.selected : true },
2275
+ }), restoreFocus);
2276
+ if (!this.effectiveMultiple && restoreFocus) {
2277
+ await this.close();
2278
+ await this.selectInputElement?.setFocus();
2279
+ }
2280
+ }
2281
+ syncActiveOptionIndex(detail) {
2282
+ const options = this.getNavigableOptions();
2283
+ const optionIndex = options.findIndex((option) => option.value === detail.value);
2284
+ if (optionIndex >= 0) {
2285
+ this.activeOptionIndex = optionIndex;
2286
+ }
2287
+ }
2288
+ /**
2289
+ * Reflete no slot a seleção que foi consolidada pela lista interna.
2290
+ *
2291
+ * @param detail Estado emitido pela opção que disparou a mudança.
2292
+ * @remarks
2293
+ * Essa sincronização mantém as props/atributos das opções declaradas pelo consumidor em
2294
+ * conformidade com o estado calculado internamente, inclusive no caso do "selecionar todos".
2295
+ */
2296
+ syncSlottedOptionSelection(values = this.selectedValues) {
2297
+ const slottedOptions = Array.from(this.el.children).filter((el) => el.tagName.toLowerCase() === 'br-select-option');
2298
+ if (slottedOptions.length === 0)
2299
+ return;
2300
+ const selectedValues = new Set(values);
2301
+ slottedOptions.forEach((option) => {
2302
+ const resolved = this.optionElementToData(option).value;
2303
+ option.selected = selectedValues.has(resolved);
2304
+ option.indeterminate = false;
2305
+ if (option.selected)
2306
+ option.setAttribute('selected', '');
2307
+ else
2308
+ option.removeAttribute('selected');
2309
+ });
2310
+ if (!this.effectiveMultiple)
2311
+ return;
2312
+ const selectableOptions = slottedOptions.filter((option) => {
2313
+ const optionLabel = (option.label ?? option.value ?? '').trim();
2314
+ return !this.isSelectAllLabel(optionLabel);
2315
+ });
2316
+ const allSelected = selectableOptions.length > 0 && selectableOptions.every((option) => Boolean(option.selected));
2317
+ const anySelected = selectableOptions.some((option) => Boolean(option.selected));
2318
+ slottedOptions.forEach((option) => {
2319
+ const optionLabel = (option.label ?? option.value ?? '').trim();
2320
+ if (!this.isSelectAllLabel(optionLabel))
2321
+ return;
2322
+ option.indeterminate = anySelected && !allSelected;
2323
+ option.selected = allSelected;
2324
+ this.normalizeSelectAllState(option);
2325
+ if (option.selected)
2326
+ option.setAttribute('selected', '');
2327
+ else
2328
+ option.removeAttribute('selected');
2329
+ });
2330
+ }
2331
+ reflectRenderedListSelection(values, sourceOptions) {
2332
+ if (!this.selectListElement)
2333
+ return;
2334
+ const options = sourceOptions ?? this.getCurrentOptions();
2335
+ // `select-list` expõe uma coleção controlada; o pai não precisa conhecer
2336
+ // os nós internos (nem atravessar `shadowRoot`) para refletir a seleção.
2337
+ this.selectListElement.options = this.getListOptions(options.map((option) => ({ ...option, selected: values.includes(option.value) })));
2338
+ }
2339
+ isSelectAllLabel(label) {
2340
+ return label === this.selectAllLabel || label === this.unselectAllLabel;
2341
+ }
2342
+ isSelectAllOption(option) {
2343
+ return option.value === SELECT_ALL_OPTION_VALUE || this.isSelectAllLabel(this.getOptionLabel(option));
2344
+ }
2345
+ getSelectAllLabel(selected, indeterminate) {
2346
+ return selected && !indeterminate ? this.unselectAllLabel : this.selectAllLabel;
2347
+ }
2348
+ normalizeSelectAllState(option) {
2349
+ const selected = Boolean(option.selected) && !option.indeterminate;
2350
+ const indeterminate = Boolean(option.indeterminate);
2351
+ option.selected = selected;
2352
+ option.indeterminate = indeterminate;
2353
+ option.label = this.getSelectAllLabel(selected, indeterminate);
2354
+ }
2355
+ handleOutsideClick(ev) {
2356
+ if (!this.effectiveOpen)
2357
+ return;
2358
+ const clickPath = this.getEventPath(ev);
2359
+ const isClickInsideSelect = clickPath.includes(this.el);
2360
+ if (isClickInsideSelect)
2361
+ return;
2362
+ this.close();
2363
+ }
2364
+ emitStateChange(option) {
2365
+ const payload = this.getStateChangeDetail(option);
2366
+ const nextStateKey = JSON.stringify(payload);
2367
+ if (!this.isStateChangeReady) {
2368
+ this.lastEmittedStateKey = nextStateKey;
2369
+ return;
2370
+ }
2371
+ if (this.lastEmittedStateKey === nextStateKey)
2372
+ return;
2373
+ this.lastEmittedStateKey = nextStateKey;
2374
+ this.brSelectStateChange.emit(payload);
2375
+ }
2376
+ getStateChangeDetail(optionChange) {
2377
+ const payload = {
2378
+ isOpen: this.effectiveOpen,
2379
+ };
2380
+ const currentOptions = this.getFormOptions(this.getCurrentOptions());
2381
+ if (this.effectiveMultiple) {
2382
+ payload.options = currentOptions
2383
+ .filter((option) => !this.isSelectAllLabel((option.label ?? option.value).trim()))
2384
+ .map((option) => this.normalizeOptionForOutput(option));
2385
+ return payload;
2386
+ }
2387
+ const selectedOption = currentOptions.find((option) => Boolean(option.selected));
2388
+ if (selectedOption) {
2389
+ payload.option = this.normalizeOptionForOutput(selectedOption);
2390
+ return payload;
2391
+ }
2392
+ if (optionChange?.value) {
2393
+ const { disabled: _disabled, ...normalizedOption } = optionChange;
2394
+ payload.option = {
2395
+ ...normalizedOption,
2396
+ label: optionChange.label ?? optionChange.value,
2397
+ };
2398
+ }
2399
+ return payload;
2400
+ }
2401
+ normalizeOptionForOutput(option) {
2402
+ const optionLabel = (option.label ?? option.value).trim();
2403
+ const isSelectAll = this.isSelectAllLabel(optionLabel);
2404
+ const { disabled: _disabled, ...optionWithoutDisabled } = option;
2405
+ if (isSelectAll) {
2406
+ return optionWithoutDisabled;
2407
+ }
2408
+ const { indeterminate, ...normalized } = optionWithoutDisabled;
2409
+ return normalized;
2410
+ }
2411
+ getStateChangeKey() {
2412
+ return JSON.stringify(this.getStateChangeDetail());
2413
+ }
2414
+ /**
2415
+ * Obtém o snapshot atual das opções respeitando a fonte mais atual disponível.
2416
+ *
2417
+ * @returns A coleção de opções normalizadas para leitura do estado público.
2418
+ * @remarks
2419
+ * A precedência é: lista interna, opções pendentes, conteúdo do slot e, por último,
2420
+ * os filhos atuais do host.
2421
+ */
2422
+ getCurrentOptions() {
2423
+ // As opções projetadas são a fonte principal quando não há coleção
2424
+ // imperativa: a lista virtualizada pode manter um snapshot enquanto o
2425
+ // consumidor altera `selected` diretamente no slot.
2426
+ if (!this.hasImperativeOptions && this.slotElement) {
2427
+ const nodes = this.slotElement.assignedNodes({ flatten: true }) ?? [];
2428
+ const slotOptions = nodes
2429
+ .map((node) => this.nodeToOption(node))
2430
+ .filter((option) => Boolean(option));
2431
+ if (slotOptions.length > 0) {
2432
+ const normalizedSlotOptions = this.applyCanonicalSelection(slotOptions);
2433
+ return this.getListOptions(normalizedSlotOptions);
2434
+ }
2435
+ }
2436
+ const listOptions = this.getSelectListController()?.options;
2437
+ if (Array.isArray(listOptions) && listOptions.length > 0) {
2438
+ const normalizedListOptions = listOptions.map((option) => ({ ...option }));
2439
+ const hasRealOptions = normalizedListOptions.some((option) => !this.isSelectAllLabel(this.getOptionLabel(option)));
2440
+ if (hasRealOptions) {
2441
+ return this.getListOptions(normalizedListOptions);
2442
+ }
2443
+ }
2444
+ if (this.pendingOptions) {
2445
+ return this.getListOptions(this.pendingOptions);
2446
+ }
2447
+ // Depois de setOptions(), a coleção imperativa é a fonte: uma resposta vazia
2448
+ // não volta a exibir as opções declaradas no HTML.
2449
+ if (this.hasImperativeOptions)
2450
+ return this.getListOptions([]);
2451
+ const hostOptions = this.applyCanonicalSelection(this.getHostOptions());
2452
+ return this.getListOptions(hostOptions);
2453
+ }
2454
+ getNavigableOptions() {
2455
+ const currentOptions = this.getCurrentOptions();
2456
+ const hostOptions = this.hasImperativeOptions ? [] : this.getHostOptions();
2457
+ const hostDisabledState = new Map(hostOptions.map((option) => [option.value, Boolean(option.disabled)]));
2458
+ const options = currentOptions.map((option) => hostDisabledState.has(option.value) ? { ...option, disabled: hostDisabledState.get(option.value) } : option);
2459
+ const localSearchTerm = this.effectiveSearchMode === 'local' ? this.listSearchTerm : '';
2460
+ return filterSelectOptions(options, localSearchTerm, this.selectAllLabel, this.unselectAllLabel);
2461
+ }
2462
+ clearSearch() {
2463
+ if (!this.searchTerm)
2464
+ return;
2465
+ this.searchTerm = '';
2466
+ this.activeOptionIndex = -1;
2467
+ void this.getSelectListController()?.setSearchTerm?.('');
2468
+ }
2469
+ getEventPath(ev) {
2470
+ return ev.composedPath ? ev.composedPath() : (ev.path ?? []);
2471
+ }
2472
+ getSelectListController() {
2473
+ return this.selectListElement;
2474
+ }
2475
+ getCssClassMap() {
2476
+ return {
2477
+ 'br-select': true,
2478
+ };
2479
+ }
2480
+ getAccessibleLabel() {
2481
+ return this.label?.trim() || this.placeholder?.trim() || 'Selecao';
2482
+ }
2483
+ setSelectionMode(isMultiple) {
2484
+ this.selectListElement?.setMultiple(isMultiple);
2485
+ }
2486
+ renderSelectInput() {
2487
+ return (h("br-select-input", { part: "input", exportparts: "container:input-container, input:input-field, label:input-label, group:input-group, icon:input-icon, action:input-action, action-button:input-action-button, clear:input-clear", ref: (el) => (this.selectInputElement = el), "aria-disabled": String(this.isDisabled()), "aria-label": this.getAccessibleLabel(), borderless: this.borderless, density: this.effectiveDensity, "is-inline": this.effectiveInline, "is-open": this.effectiveOpen, label: this.label, name: this.name, placeholder: this.placeholder, required: this.required, disabled: this.isDisabled(), filterable: this.filterable, showSearchIcon: this.showSearchIcon, clearable: this.filterable && this.effectiveOpen, autocomplete: this.effectiveAutocomplete, "input-width": this.inputWidth, value: this.filterable && this.effectiveOpen ? this.searchTerm : this.getRenderedDisplayValue() }));
2488
+ }
2489
+ renderSelectList() {
2490
+ return (h("br-select-list", { part: "list", "aria-hidden": "true", onMouseDown: (event) => {
2491
+ event.preventDefault();
2492
+ void this.selectInputElement?.setFocus();
2493
+ }, options: this.getListOptions(this.getCurrentOptions()), exportparts: "list, option, checkbox, select-all, empty-option, option-checkbox, option-radio, option-group", "active-option-index": this.isActiveIndicatorHidden ? -1 : this.activeOptionIndex, "aria-label": this.getAccessibleLabel(), "aria-multiselectable": this.effectiveMultiple ? 'true' : 'false', density: this.effectiveDensity, id: this.listboxId, "visible-items": this.effectiveVisibleItems, "item-height": this.effectiveItemHeight, overscan: this.effectiveOverscan, hideDividers: this.hideDividers, "search-term": this.listSearchTerm, "search-mode": this.effectiveSearchMode, role: "listbox", "select-all-label": this.selectAllLabel, "unselect-all-label": this.unselectAllLabel, ref: (el) => {
2494
+ this.selectListElement = el;
2495
+ this.selectListElement.loading = this.loading;
2496
+ this.setSelectionMode(this.effectiveMultiple);
2497
+ void this.getSelectListController()?.setSearchTerm?.(this.listSearchTerm);
2498
+ } }, h("slot", null), h("slot", { name: "loading", slot: "loading" }, h("br-loading", { size: "small", label: "Pesquisando\u2026", labelPosition: "right" }))));
2499
+ }
2500
+ renderHiddenSelect() {
2501
+ const options = this.getFormOptions(this.getCurrentOptions()).filter((option) => !this.isSelectAllLabel(this.getOptionLabel(option)));
2502
+ const hasSelection = options.some((option) => option.selected);
2503
+ return (h("select", { ref: (el) => (this.nativeSelect = el), part: "hidden-select", name: this.name, autocomplete: this.effectiveAutocomplete, multiple: this.effectiveMultiple, required: this.required, disabled: this.isDisabled(), tabIndex: -1, "aria-hidden": "true", style: {
2504
+ position: 'absolute',
2505
+ width: '1px',
2506
+ height: '1px',
2507
+ padding: '0',
2508
+ margin: '-1px',
2509
+ overflow: 'hidden',
2510
+ clip: 'rect(0, 0, 0, 0)',
2511
+ whiteSpace: 'nowrap',
2512
+ border: '0',
2513
+ }, onChange: (event) => event.preventDefault() }, h("option", { value: "", selected: !hasSelection }), this.getNativeOptionGroups(options).map((optionGroup, groupIndex) => {
2514
+ const nativeOptions = optionGroup.options.map((option) => this.renderNativeOption(option));
2515
+ if (!optionGroup.group)
2516
+ return nativeOptions;
2517
+ return (h("optgroup", { key: `${optionGroup.group}:${groupIndex}`, label: optionGroup.group }, nativeOptions));
2518
+ })));
2519
+ }
2520
+ getNativeOptionGroups(options) {
2521
+ return options.reduce((groups, option) => {
2522
+ const group = option.group?.trim() || undefined;
2523
+ const currentGroup = groups.at(-1);
2524
+ if (!currentGroup || currentGroup.group !== group) {
2525
+ groups.push({ group, options: [option] });
2526
+ }
2527
+ else {
2528
+ currentGroup.options.push(option);
2529
+ }
2530
+ return groups;
2531
+ }, []);
2532
+ }
2533
+ renderNativeOption(option) {
2534
+ return (h("option", { key: option.value, value: option.value, selected: option.selected, disabled: option.disabled }));
2535
+ }
2536
+ render() {
2537
+ return (h(Host, { key: '069ea9baa54541cd5a244ec5844076688667fb2f', "aria-busy": this.isValidating || this.loading ? 'true' : null }, h("div", { key: '06f1ad8ab886e38e44dc32aba6e9844fa8f7005d', class: this.getCssClassMap(), part: "container" }, this.renderSelectInput(), this.renderSelectList(), h("div", { key: '854c1652fdd2f7898161bf5e2b1f421777b13f67', part: "feedback", hidden: !this.hasFeedbackSlot && !this.validationErrorMessage }, h("slot", { key: 'e2f9e8d2cf923c141ad99548199a83220875c856', name: "feedback", onSlotchange: (event) => (this.hasFeedbackSlot = hasAssignedSlotContent(event.currentTarget)) }, this.validationErrorMessage ? (h("br-message", { "is-feedback": true, state: "danger", message: this.validationErrorMessage })) : null)), h("div", { key: 'eeae8b42349885ab811d70e713efcd8d07a14901', part: "validation-loading", hidden: !this.hasValidationLoadingSlot || !this.isValidating }, h("slot", { key: 'c0f8cf4f917845629b34e32f597409571abf402e', name: "validation-loading" })), this.renderHiddenSelect())));
2538
+ }
2539
+ static get formAssociated() { return true; }
2540
+ get el() { return getElement(this); }
2541
+ static get watchers() { return {
2542
+ "disabled": [{
2543
+ "handleDisabledChange": 0
2544
+ }],
2545
+ "isOpen": [{
2546
+ "handleIsOpenChange": 0
2547
+ }],
2548
+ "filterable": [{
2549
+ "handleFilterableChange": 0
2550
+ }],
2551
+ "loading": [{
2552
+ "handleLoadingChange": 0
2553
+ }],
2554
+ "isMultiple": [{
2555
+ "handleIsMultipleChange": 0
2556
+ }],
2557
+ "multiple": [{
2558
+ "handleMultipleChange": 0
2559
+ }],
2560
+ "open": [{
2561
+ "handleOpenChange": 0
2562
+ }],
2563
+ "value": [{
2564
+ "handleExternalValueChange": 0
2565
+ }],
2566
+ "options": [{
2567
+ "handleOptionsChange": 0
2568
+ }]
2569
+ }; }
2570
+ };
2571
+ Select.SELECT_ALL_LABEL = 'Selecionar todos';
2572
+ Select.DESELECT_ALL_LABEL = 'Desselecionar todos';
2573
+ Select.style = selectCss();
2574
+
2575
+ export { Pagination as br_pagination, Select as br_select };