@govbr-ds/webcomponents 2.1.1 → 2.1.3
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.
- package/README.md +0 -11
- package/cem/custom-elements.json +219 -11
- package/cem/webcomponents.html-custom-data.json +1 -1
- package/dist/cjs/br-avatar.cjs.entry.js +1 -1
- package/dist/cjs/br-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/br-button_2.cjs.entry.js +2 -2
- package/dist/cjs/br-card.cjs.entry.js +1 -1
- package/dist/cjs/br-carousel-page.cjs.entry.js +1 -1
- package/dist/cjs/br-carousel.cjs.entry.js +1 -1
- package/dist/cjs/br-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/br-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/br-collapse_2.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar-cookie.cjs.entry.js +1 -1
- package/dist/cjs/br-cookiebar-group.cjs.entry.js +1 -1
- package/dist/cjs/br-cookiebar-header.cjs.entry.js +1 -1
- package/dist/cjs/br-cookiebar-link.cjs.entry.js +3 -2
- package/dist/cjs/br-cookiebar-note-group.cjs.entry.js +1 -1
- package/dist/cjs/br-cookiebar-note.cjs.entry.js +1 -1
- package/dist/cjs/br-cookiebar.cjs.entry.js +1 -1
- package/dist/cjs/br-date-picker_3.cjs.entry.js +5 -4
- package/dist/cjs/br-datetime-picker.cjs.entry.js +2 -3
- package/dist/cjs/br-divider.cjs.entry.js +1 -1
- package/dist/cjs/br-dropdown_2.cjs.entry.js +263 -110
- package/dist/cjs/br-footer-category.cjs.entry.js +1 -1
- package/dist/cjs/br-footer-item.cjs.entry.js +1 -1
- package/dist/cjs/br-footer-legal.cjs.entry.js +1 -1
- package/dist/cjs/br-footer-logo.cjs.entry.js +1 -1
- package/dist/cjs/br-footer-social.cjs.entry.js +1 -1
- package/dist/cjs/br-footer.cjs.entry.js +1 -1
- package/dist/cjs/br-header-function.cjs.entry.js +1 -1
- package/dist/cjs/br-header-link.cjs.entry.js +1 -1
- package/dist/cjs/br-header-list.cjs.entry.js +1 -1
- package/dist/cjs/br-header-logo.cjs.entry.js +3 -2
- package/dist/cjs/br-header.cjs.entry.js +1 -1
- package/dist/cjs/br-icon.cjs.entry.js +2 -2
- package/dist/cjs/br-input.cjs.entry.js +1 -1
- package/dist/cjs/br-item.cjs.entry.js +26 -15
- package/dist/cjs/br-link.cjs.entry.js +3 -2
- package/dist/cjs/br-loading.cjs.entry.js +1 -1
- package/dist/cjs/br-magic-button.cjs.entry.js +3 -2
- package/dist/cjs/br-menu-group.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-header.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-info.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-link.cjs.entry.js +3 -2
- package/dist/cjs/br-menu-list.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-logo.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-social.cjs.entry.js +1 -1
- package/dist/cjs/br-menu.cjs.entry.js +7 -11
- package/dist/cjs/br-modal.cjs.entry.js +1 -1
- package/dist/cjs/br-notification-body.cjs.entry.js +1 -1
- package/dist/cjs/br-notification-header.cjs.entry.js +1 -1
- package/dist/cjs/br-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/br-notification.cjs.entry.js +1 -1
- package/dist/cjs/br-pagination.cjs.entry.js +1 -1
- package/dist/cjs/br-radio-group.cjs.entry.js +2 -2
- package/dist/cjs/br-radio.cjs.entry.js +1 -1
- package/dist/cjs/br-scrim.cjs.entry.js +1 -1
- package/dist/cjs/br-select-input_3.cjs.entry.js +48 -14
- package/dist/cjs/br-sign-in.cjs.entry.js +3 -2
- package/dist/cjs/br-skip-link.cjs.entry.js +1 -1
- package/dist/cjs/br-skiplink-item.cjs.entry.js +1 -1
- package/dist/cjs/br-slider.cjs.entry.js +2 -3
- package/dist/cjs/br-step_2.cjs.entry.js +2 -2
- package/dist/cjs/br-switch.cjs.entry.js +1 -1
- package/dist/cjs/br-tab-item.cjs.entry.js +1 -1
- package/dist/cjs/br-tab.cjs.entry.js +1 -1
- package/dist/cjs/br-table-body.cjs.entry.js +1 -1
- package/dist/cjs/br-table-cell.cjs.entry.js +1 -1
- package/dist/cjs/br-table-header-cell.cjs.entry.js +1 -1
- package/dist/cjs/br-table-header.cjs.entry.js +1 -1
- package/dist/cjs/br-table-row.cjs.entry.js +1 -1
- package/dist/cjs/br-table.cjs.entry.js +1 -1
- package/dist/cjs/br-tag.cjs.entry.js +3 -4
- package/dist/cjs/br-textarea.cjs.entry.js +1 -1
- package/dist/cjs/br-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/br-upload.cjs.entry.js +3 -4
- package/dist/cjs/br-wizard-panel.cjs.entry.js +1 -1
- package/dist/cjs/br-wizard.cjs.entry.js +1 -1
- package/dist/cjs/index-CRdcutym.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/avatar/avatar.css +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.css +1 -1
- package/dist/collection/components/button/button.css +1 -1
- package/dist/collection/components/card/card.css +1 -1
- package/dist/collection/components/carousel/carousel-page/carousel-page.css +1 -1
- package/dist/collection/components/carousel/carousel.css +1 -1
- package/dist/collection/components/checkbox/checkbox.css +1 -1
- package/dist/collection/components/checkbox-group/checkbox-group.css +1 -1
- package/dist/collection/components/collapse/collapse.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.js +2 -1
- package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar.css +1 -1
- package/dist/collection/components/datetime-picker/date-picker/date-picker.css +1 -1
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.css +1 -1
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.js +2 -1
- package/dist/collection/components/datetime-picker/datetime-picker.css +1 -1
- package/dist/collection/components/datetime-picker/datetime-picker.js +1 -2
- package/dist/collection/components/datetime-picker/time-picker/time-picker.css +1 -1
- package/dist/collection/components/divider/divider.css +1 -1
- package/dist/collection/components/dropdown/dropdown.css +1 -1
- package/dist/collection/components/footer/footer-category/footer-category.css +1 -1
- package/dist/collection/components/footer/footer-item/footer-item.css +1 -1
- package/dist/collection/components/footer/footer-legal/footer-legal.css +1 -1
- package/dist/collection/components/footer/footer-logo/footer-logo.css +1 -1
- package/dist/collection/components/footer/footer-social/footer-social.css +1 -1
- package/dist/collection/components/footer/footer.css +1 -1
- package/dist/collection/components/header/header-function/header-function.css +1 -1
- package/dist/collection/components/header/header-link/header-link.css +1 -1
- package/dist/collection/components/header/header-list/header-list.css +1 -1
- package/dist/collection/components/header/header-logo/header-logo.css +1 -1
- package/dist/collection/components/header/header-logo/header-logo.js +2 -1
- package/dist/collection/components/header/header.css +1 -1
- package/dist/collection/components/icon/icon.css +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/input/input.css +1 -1
- package/dist/collection/components/item/item.css +1 -1
- package/dist/collection/components/item/item.js +25 -14
- package/dist/collection/components/link/link.css +1 -1
- package/dist/collection/components/link/link.js +2 -1
- package/dist/collection/components/list/list.css +1 -1
- package/dist/collection/components/loading/loading.css +1 -1
- package/dist/collection/components/magic-button/magic-button.css +1 -1
- package/dist/collection/components/magic-button/magic-button.js +2 -1
- package/dist/collection/components/menu/menu-group/menu-group.css +1 -1
- package/dist/collection/components/menu/menu-header/menu-header.css +1 -1
- package/dist/collection/components/menu/menu-info/menu-info.css +1 -1
- package/dist/collection/components/menu/menu-item/menu-item.css +1 -1
- package/dist/collection/components/menu/menu-link/menu-link.css +1 -1
- package/dist/collection/components/menu/menu-link/menu-link.js +2 -1
- package/dist/collection/components/menu/menu-list/menu-list.css +1 -1
- package/dist/collection/components/menu/menu-logo/menu-logo.css +1 -1
- package/dist/collection/components/menu/menu-social/menu-social.css +1 -1
- package/dist/collection/components/menu/menu.css +1 -1
- package/dist/collection/components/menu/menu.js +7 -11
- package/dist/collection/components/message/message.css +1 -1
- package/dist/collection/components/modal/modal.css +1 -1
- package/dist/collection/components/notification/notification-body/notification-body.css +1 -1
- package/dist/collection/components/notification/notification-header/notification-header.css +1 -1
- package/dist/collection/components/notification/notification-item/notification-item.css +1 -1
- package/dist/collection/components/notification/notification.css +1 -1
- package/dist/collection/components/pagination/pagination.css +1 -1
- package/dist/collection/components/radio/radio.css +1 -1
- package/dist/collection/components/radio-group/radio-group.css +1 -1
- package/dist/collection/components/radio-group/radio-group.js +2 -2
- package/dist/collection/components/scrim/scrim.css +1 -1
- package/dist/collection/components/select/select-input/select-input.css +1 -1
- package/dist/collection/components/select/select-input/select-input.js +2 -1
- package/dist/collection/components/select/select-list/select-list.css +1 -1
- package/dist/collection/components/select/select-list/select-list.js +17 -5
- package/dist/collection/components/select/select-option/select-option.css +1 -1
- package/dist/collection/components/select/select-option/select-option.js +28 -7
- package/dist/collection/components/select/select.css +1 -1
- package/dist/collection/components/select/select.js +235 -109
- package/dist/collection/components/select/select.utils.js +34 -0
- package/dist/collection/components/sign-in/sign-in.css +1 -1
- package/dist/collection/components/sign-in/sign-in.js +2 -1
- package/dist/collection/components/skip-link/skip-link-item/skip-link-item.css +1 -1
- package/dist/collection/components/skip-link/skip-link.css +1 -1
- package/dist/collection/components/slider/slider.css +1 -1
- package/dist/collection/components/slider/slider.js +1 -2
- package/dist/collection/components/step/step-item/step-item.css +1 -1
- package/dist/collection/components/step/step.css +1 -1
- package/dist/collection/components/switch/switch.css +1 -1
- package/dist/collection/components/tab/tab-item/tab-item.css +1 -1
- package/dist/collection/components/tab/tab.css +1 -1
- package/dist/collection/components/table/table-body/table-body.css +1 -1
- package/dist/collection/components/table/table-cell/table-cell.css +1 -1
- package/dist/collection/components/table/table-header/table-header.css +1 -1
- package/dist/collection/components/table/table-header-cell/table-header-cell.css +1 -1
- package/dist/collection/components/table/table-row/table-row.css +1 -1
- package/dist/collection/components/table/table.css +1 -1
- package/dist/collection/components/tag/tag.css +1 -1
- package/dist/collection/components/tag/tag.js +2 -3
- package/dist/collection/components/textarea/textarea.css +1 -1
- package/dist/collection/components/tooltip/tooltip.css +1 -1
- package/dist/collection/components/upload/upload.css +1 -1
- package/dist/collection/components/upload/upload.js +2 -3
- package/dist/collection/components/wizard/wizard-panel/wizard-panel.css +1 -1
- package/dist/collection/components/wizard/wizard.css +1 -1
- package/dist/collection/pages/scripts/component-controls.js +34 -4
- package/dist/collection/pages/scripts/menu.js +11 -2
- package/dist/collection/pages/scripts/pageLoader.js +20 -4
- package/dist/components/br-avatar.js +1 -1
- package/dist/components/br-breadcrumb.js +1 -1
- package/dist/components/br-button.js +1 -1
- package/dist/components/br-card.js +1 -1
- package/dist/components/br-carousel-page.js +1 -1
- package/dist/components/br-carousel.js +1 -1
- package/dist/components/br-checkbox-group.js +1 -1
- package/dist/components/br-checkbox.js +1 -1
- package/dist/components/br-checkgroup.js +1 -1
- package/dist/components/br-collapse.js +1 -1
- package/dist/components/br-cookiebar-cookie.js +1 -1
- package/dist/components/br-cookiebar-group.js +1 -1
- package/dist/components/br-cookiebar-header.js +1 -1
- package/dist/components/br-cookiebar-link.js +1 -1
- package/dist/components/br-cookiebar-note-group.js +1 -1
- package/dist/components/br-cookiebar-note.js +1 -1
- package/dist/components/br-cookiebar.js +1 -1
- package/dist/components/br-date-picker.js +1 -1
- package/dist/components/br-datetime-input.js +1 -1
- package/dist/components/br-datetime-picker.js +1 -1
- package/dist/components/br-divider.js +1 -1
- package/dist/components/br-dropdown.js +1 -1
- package/dist/components/br-footer-category.js +1 -1
- package/dist/components/br-footer-item.js +1 -1
- package/dist/components/br-footer-legal.js +1 -1
- package/dist/components/br-footer-logo.js +1 -1
- package/dist/components/br-footer-social.js +1 -1
- package/dist/components/br-footer.js +1 -1
- package/dist/components/br-header-function.js +1 -1
- package/dist/components/br-header-link.js +1 -1
- package/dist/components/br-header-list.js +1 -1
- package/dist/components/br-header-logo.js +1 -1
- package/dist/components/br-header.js +1 -1
- package/dist/components/br-icon.js +1 -1
- package/dist/components/br-input.js +1 -1
- package/dist/components/br-item.js +1 -1
- package/dist/components/br-link.js +1 -1
- package/dist/components/br-list.js +1 -1
- package/dist/components/br-loading.js +1 -1
- package/dist/components/br-magic-button.js +1 -1
- package/dist/components/br-menu-group.js +1 -1
- package/dist/components/br-menu-header.js +1 -1
- package/dist/components/br-menu-info.js +1 -1
- package/dist/components/br-menu-item.js +1 -1
- package/dist/components/br-menu-link.js +1 -1
- package/dist/components/br-menu-list.js +1 -1
- package/dist/components/br-menu-logo.js +1 -1
- package/dist/components/br-menu-social.js +1 -1
- package/dist/components/br-menu.js +1 -1
- package/dist/components/br-message.js +1 -1
- package/dist/components/br-modal.js +1 -1
- package/dist/components/br-notification-body.js +1 -1
- package/dist/components/br-notification-header.js +1 -1
- package/dist/components/br-notification-item.js +1 -1
- package/dist/components/br-notification.js +1 -1
- package/dist/components/br-pagination.js +1 -1
- package/dist/components/br-radio-group.js +1 -1
- package/dist/components/br-radio.js +1 -1
- package/dist/components/br-scrim.js +1 -1
- package/dist/components/br-select-input.js +1 -1
- package/dist/components/br-select-list.js +1 -1
- package/dist/components/br-select-option.js +1 -1
- package/dist/components/br-select.js +1 -1
- package/dist/components/br-sign-in.js +1 -1
- package/dist/components/br-skip-link-item.js +1 -1
- package/dist/components/br-skip-link.js +1 -1
- package/dist/components/br-skiplink-item.js +1 -1
- package/dist/components/br-slider.js +1 -1
- package/dist/components/br-step-item.js +1 -1
- package/dist/components/br-step.js +1 -1
- package/dist/components/br-switch.js +1 -1
- package/dist/components/br-tab-item.js +1 -1
- package/dist/components/br-tab.js +1 -1
- package/dist/components/br-table-body.js +1 -1
- package/dist/components/br-table-cell.js +1 -1
- package/dist/components/br-table-header-cell.js +1 -1
- package/dist/components/br-table-header.js +1 -1
- package/dist/components/br-table-row.js +1 -1
- package/dist/components/br-table.js +1 -1
- package/dist/components/br-tag.js +1 -1
- package/dist/components/br-textarea.js +1 -1
- package/dist/components/br-time-picker.js +1 -1
- package/dist/components/br-tooltip.js +1 -1
- package/dist/components/br-upload.js +1 -1
- package/dist/components/br-wizard-panel.js +1 -1
- package/dist/components/br-wizard.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-AmOh1cks.js +5 -0
- package/dist/components/p-B4ylcipx.js +5 -0
- package/dist/components/p-BCv4PCOx.js +5 -0
- package/dist/components/p-BLOyd_iF.js +5 -0
- package/dist/components/p-BODem6tr.js +5 -0
- package/dist/components/p-BeFK-82z.js +5 -0
- package/dist/components/p-BloE-KAN.js +5 -0
- package/dist/components/{p-DBP6K_aq.js → p-BoSc_kmY.js} +1 -1
- package/dist/components/p-BrH3r7eL.js +5 -0
- package/dist/components/{p-ttI0nvv_.js → p-BsZ0Ny88.js} +1 -1
- package/dist/components/{p-DoXNfcTT.js → p-ByHVf7zy.js} +1 -1
- package/dist/components/p-CdF-gmk1.js +5 -0
- package/dist/components/p-CfyjGPGI.js +5 -0
- package/dist/components/{p-D9SpD3Ay.js → p-CjF7pBVQ.js} +1 -1
- package/dist/components/p-ClqtllDH.js +5 -0
- package/dist/components/p-CqW2Yh34.js +5 -0
- package/dist/components/{p-C98-mHmV.js → p-DLE5ioJN.js} +1 -1
- package/dist/components/p-DRnCpVrL.js +5 -0
- package/dist/components/p-DVdlaP7z.js +5 -0
- package/dist/components/{p-41XwlWiS.js → p-DeeF6ok0.js} +1 -1
- package/dist/components/p-Dim2PnUm.js +5 -0
- package/dist/components/p-Dk8rfQjL.js +5 -0
- package/dist/components/{p-LmeJrLxH.js → p-DkmEpoef.js} +1 -1
- package/dist/components/p-DwfAYaEv.js +5 -0
- package/dist/components/p-P2Z_MmH6.js +5 -0
- package/dist/components/p-Xa0Mj4pP.js +5 -0
- package/dist/components/p-_vsQvdxD.js +5 -0
- package/dist/components/p-aNjo4Alx.js +5 -0
- package/dist/components/{p-DYnkGWii.js → p-rB-s1M3Q.js} +1 -1
- package/dist/esm/br-avatar.entry.js +1 -1
- package/dist/esm/br-breadcrumb.entry.js +1 -1
- package/dist/esm/br-button_2.entry.js +2 -2
- package/dist/esm/br-card.entry.js +1 -1
- package/dist/esm/br-carousel-page.entry.js +1 -1
- package/dist/esm/br-carousel.entry.js +1 -1
- package/dist/esm/br-checkbox-group.entry.js +1 -1
- package/dist/esm/br-checkbox.entry.js +1 -1
- package/dist/esm/br-collapse_2.entry.js +2 -2
- package/dist/esm/br-cookiebar-cookie.entry.js +1 -1
- package/dist/esm/br-cookiebar-group.entry.js +1 -1
- package/dist/esm/br-cookiebar-header.entry.js +1 -1
- package/dist/esm/br-cookiebar-link.entry.js +3 -2
- package/dist/esm/br-cookiebar-note-group.entry.js +1 -1
- package/dist/esm/br-cookiebar-note.entry.js +1 -1
- package/dist/esm/br-cookiebar.entry.js +1 -1
- package/dist/esm/br-date-picker_3.entry.js +5 -4
- package/dist/esm/br-datetime-picker.entry.js +2 -3
- package/dist/esm/br-divider.entry.js +1 -1
- package/dist/esm/br-dropdown_2.entry.js +263 -110
- package/dist/esm/br-footer-category.entry.js +1 -1
- package/dist/esm/br-footer-item.entry.js +1 -1
- package/dist/esm/br-footer-legal.entry.js +1 -1
- package/dist/esm/br-footer-logo.entry.js +1 -1
- package/dist/esm/br-footer-social.entry.js +1 -1
- package/dist/esm/br-footer.entry.js +1 -1
- package/dist/esm/br-header-function.entry.js +1 -1
- package/dist/esm/br-header-link.entry.js +1 -1
- package/dist/esm/br-header-list.entry.js +1 -1
- package/dist/esm/br-header-logo.entry.js +3 -2
- package/dist/esm/br-header.entry.js +1 -1
- package/dist/esm/br-icon.entry.js +2 -2
- package/dist/esm/br-input.entry.js +1 -1
- package/dist/esm/br-item.entry.js +26 -15
- package/dist/esm/br-link.entry.js +3 -2
- package/dist/esm/br-loading.entry.js +1 -1
- package/dist/esm/br-magic-button.entry.js +3 -2
- package/dist/esm/br-menu-group.entry.js +1 -1
- package/dist/esm/br-menu-header.entry.js +1 -1
- package/dist/esm/br-menu-info.entry.js +1 -1
- package/dist/esm/br-menu-item.entry.js +1 -1
- package/dist/esm/br-menu-link.entry.js +3 -2
- package/dist/esm/br-menu-list.entry.js +1 -1
- package/dist/esm/br-menu-logo.entry.js +1 -1
- package/dist/esm/br-menu-social.entry.js +1 -1
- package/dist/esm/br-menu.entry.js +7 -11
- package/dist/esm/br-modal.entry.js +1 -1
- package/dist/esm/br-notification-body.entry.js +1 -1
- package/dist/esm/br-notification-header.entry.js +1 -1
- package/dist/esm/br-notification-item.entry.js +1 -1
- package/dist/esm/br-notification.entry.js +1 -1
- package/dist/esm/br-pagination.entry.js +1 -1
- package/dist/esm/br-radio-group.entry.js +2 -2
- package/dist/esm/br-radio.entry.js +1 -1
- package/dist/esm/br-scrim.entry.js +1 -1
- package/dist/esm/br-select-input_3.entry.js +48 -14
- package/dist/esm/br-sign-in.entry.js +3 -2
- package/dist/esm/br-skip-link.entry.js +1 -1
- package/dist/esm/br-skiplink-item.entry.js +1 -1
- package/dist/esm/br-slider.entry.js +2 -3
- package/dist/esm/br-step_2.entry.js +2 -2
- package/dist/esm/br-switch.entry.js +1 -1
- package/dist/esm/br-tab-item.entry.js +1 -1
- package/dist/esm/br-tab.entry.js +1 -1
- package/dist/esm/br-table-body.entry.js +1 -1
- package/dist/esm/br-table-cell.entry.js +1 -1
- package/dist/esm/br-table-header-cell.entry.js +1 -1
- package/dist/esm/br-table-header.entry.js +1 -1
- package/dist/esm/br-table-row.entry.js +1 -1
- package/dist/esm/br-table.entry.js +1 -1
- package/dist/esm/br-tag.entry.js +3 -4
- package/dist/esm/br-textarea.entry.js +1 -1
- package/dist/esm/br-tooltip.entry.js +1 -1
- package/dist/esm/br-upload.entry.js +3 -4
- package/dist/esm/br-wizard-panel.entry.js +1 -1
- package/dist/esm/br-wizard.entry.js +1 -1
- package/dist/esm/index-C2RBydfd.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/hydrate/index.js +457 -259
- package/dist/hydrate/index.mjs +457 -259
- package/dist/types/components/item/item.d.ts +1 -0
- package/dist/types/components/menu/menu.d.ts +3 -3
- package/dist/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/types/components/select/select-list/select-list.d.ts +1 -0
- package/dist/types/components/select/select-option/select-option.d.ts +1 -0
- package/dist/types/components/select/select.d.ts +14 -0
- package/dist/types/components/select/select.types.d.ts +2 -0
- package/dist/types/components/select/select.utils.d.ts +13 -0
- package/dist/types/components.d.ts +6 -6
- package/dist/webcomponents/p-00cc31f9.entry.js +5 -0
- package/dist/webcomponents/p-026475bd.entry.js +5 -0
- package/dist/webcomponents/p-0291ab28.entry.js +5 -0
- package/dist/webcomponents/p-03e5a7dc.entry.js +5 -0
- package/dist/webcomponents/{p-966ad32f.entry.js → p-060df8ee.entry.js} +1 -1
- package/dist/webcomponents/{p-f078f972.entry.js → p-09fce2a5.entry.js} +1 -1
- package/dist/webcomponents/p-1002bbff.entry.js +5 -0
- package/dist/webcomponents/{p-45356e9a.entry.js → p-1124de33.entry.js} +1 -1
- package/dist/webcomponents/p-12e97d80.entry.js +5 -0
- package/dist/webcomponents/p-1b19b191.entry.js +5 -0
- package/dist/webcomponents/p-2baf353b.entry.js +5 -0
- package/dist/webcomponents/{p-c846e784.entry.js → p-2eb9a42c.entry.js} +1 -1
- package/dist/webcomponents/{p-a382e115.entry.js → p-30c82805.entry.js} +1 -1
- package/dist/webcomponents/p-31bd1c74.entry.js +5 -0
- package/dist/webcomponents/{p-224daaac.entry.js → p-31db2313.entry.js} +1 -1
- package/dist/webcomponents/{p-d38d82cc.entry.js → p-33a3dc63.entry.js} +1 -1
- package/dist/webcomponents/{p-c211af17.entry.js → p-3889c51f.entry.js} +1 -1
- package/dist/webcomponents/{p-5ce7db4a.entry.js → p-3f2c179a.entry.js} +1 -1
- package/dist/webcomponents/{p-82200563.entry.js → p-470eb770.entry.js} +1 -1
- package/dist/webcomponents/p-4ae387ae.entry.js +5 -0
- package/dist/webcomponents/p-4e65df84.entry.js +5 -0
- package/dist/webcomponents/p-51a62876.entry.js +5 -0
- package/dist/webcomponents/p-5860b96b.entry.js +5 -0
- package/dist/webcomponents/p-5b9c01e9.entry.js +5 -0
- package/dist/webcomponents/{p-0caa4d12.entry.js → p-5df2f1dd.entry.js} +1 -1
- package/dist/webcomponents/p-5f3f7b3f.entry.js +5 -0
- package/dist/webcomponents/{p-1d6b0b6f.entry.js → p-5f9c28a7.entry.js} +1 -1
- package/dist/webcomponents/p-62511921.entry.js +5 -0
- package/dist/webcomponents/p-63b52947.entry.js +5 -0
- package/dist/webcomponents/p-67a8e0b7.entry.js +5 -0
- package/dist/webcomponents/p-7b2a5fec.entry.js +5 -0
- package/dist/webcomponents/p-7f95e2f5.entry.js +5 -0
- package/dist/webcomponents/p-8128833c.entry.js +5 -0
- package/dist/webcomponents/p-8200ccb1.entry.js +5 -0
- package/dist/webcomponents/{p-5b257a4b.entry.js → p-82b100fd.entry.js} +1 -1
- package/dist/webcomponents/p-8806df15.entry.js +5 -0
- package/dist/webcomponents/p-881eb81a.entry.js +5 -0
- package/dist/webcomponents/{p-0d4f718d.entry.js → p-8bd3d541.entry.js} +1 -1
- package/dist/webcomponents/p-90648343.entry.js +5 -0
- package/dist/webcomponents/p-9100a5f7.entry.js +5 -0
- package/dist/webcomponents/p-91313d77.entry.js +5 -0
- package/dist/webcomponents/{p-0196804a.entry.js → p-946b2ac0.entry.js} +1 -1
- package/dist/webcomponents/{p-569134cf.entry.js → p-98e7ccb9.entry.js} +1 -1
- package/dist/webcomponents/{p-9679d230.entry.js → p-99f2bddb.entry.js} +1 -1
- package/dist/webcomponents/p-9adbdb0a.entry.js +5 -0
- package/dist/webcomponents/p-9c260049.entry.js +5 -0
- package/dist/webcomponents/p-9ed51017.entry.js +5 -0
- package/dist/webcomponents/p-a0b299dd.entry.js +5 -0
- package/dist/webcomponents/p-a2c5fad0.entry.js +5 -0
- package/dist/webcomponents/p-a3e044d7.entry.js +5 -0
- package/dist/webcomponents/p-a9f23aa7.entry.js +5 -0
- package/dist/webcomponents/p-a9f2fcbc.entry.js +5 -0
- package/dist/webcomponents/p-b6c68136.entry.js +5 -0
- package/dist/webcomponents/{p-52df61cb.entry.js → p-b6e9b8d1.entry.js} +1 -1
- package/dist/webcomponents/p-c333eac6.entry.js +5 -0
- package/dist/webcomponents/p-c3732fd6.entry.js +5 -0
- package/dist/webcomponents/p-c458ed0e.entry.js +5 -0
- package/dist/webcomponents/{p-60cc820c.entry.js → p-c91000ff.entry.js} +1 -1
- package/dist/webcomponents/p-c9c6ab2d.entry.js +5 -0
- package/dist/webcomponents/p-cd2550d6.entry.js +5 -0
- package/dist/webcomponents/p-cf42613f.entry.js +5 -0
- package/dist/webcomponents/{p-a9ff7c25.entry.js → p-d0b0b420.entry.js} +1 -1
- package/dist/webcomponents/p-d1b32ee8.entry.js +5 -0
- package/dist/webcomponents/{p-66b13fd9.entry.js → p-db65b083.entry.js} +1 -1
- package/dist/webcomponents/p-de7c101d.entry.js +5 -0
- package/dist/webcomponents/p-dfb77dd0.entry.js +5 -0
- package/dist/webcomponents/{p-d1e899cd.entry.js → p-e258da78.entry.js} +1 -1
- package/dist/webcomponents/p-e31ddd42.entry.js +5 -0
- package/dist/webcomponents/p-e8d82227.entry.js +5 -0
- package/dist/webcomponents/p-e988cf1d.entry.js +5 -0
- package/dist/webcomponents/p-ed9122a1.entry.js +5 -0
- package/dist/webcomponents/p-ee347d2e.entry.js +5 -0
- package/dist/webcomponents/{p-2abd2da0.entry.js → p-f1c01d52.entry.js} +1 -1
- package/dist/webcomponents/p-f5baf8be.entry.js +5 -0
- package/dist/webcomponents/{p-96dd663b.entry.js → p-fb593739.entry.js} +1 -1
- package/dist/webcomponents/p-fff9acd4.entry.js +5 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +3 -7
- package/dist/components/p-0IYmyaTi.js +0 -5
- package/dist/components/p-B-sbd1_h.js +0 -5
- package/dist/components/p-BPJpHGOW.js +0 -5
- package/dist/components/p-BW0_ORNA.js +0 -5
- package/dist/components/p-Bm0ECvfB.js +0 -5
- package/dist/components/p-C3LQSQpc.js +0 -5
- package/dist/components/p-CDZFuUlU.js +0 -5
- package/dist/components/p-CRfi23Rd.js +0 -5
- package/dist/components/p-CUI5zWGf.js +0 -5
- package/dist/components/p-CxviDiCr.js +0 -5
- package/dist/components/p-D6zroLx5.js +0 -5
- package/dist/components/p-DCrVo-8T.js +0 -5
- package/dist/components/p-DWPmUV72.js +0 -5
- package/dist/components/p-D_CSvOY9.js +0 -5
- package/dist/components/p-DaeGwqw0.js +0 -5
- package/dist/components/p-Dkg2scYZ.js +0 -5
- package/dist/components/p-DvrdmqoQ.js +0 -5
- package/dist/components/p-TFWd_UBV.js +0 -5
- package/dist/components/p-aF8bGN3t.js +0 -5
- package/dist/components/p-cfPt-vKA.js +0 -5
- package/dist/components/p-nJOJGpyl.js +0 -5
- package/dist/webcomponents/p-0410186a.entry.js +0 -5
- package/dist/webcomponents/p-0415ef22.entry.js +0 -5
- package/dist/webcomponents/p-059c3d6c.entry.js +0 -5
- package/dist/webcomponents/p-0b8f39bc.entry.js +0 -5
- package/dist/webcomponents/p-0e84c9e8.entry.js +0 -5
- package/dist/webcomponents/p-147ac8d3.entry.js +0 -5
- package/dist/webcomponents/p-1b138f1c.entry.js +0 -5
- package/dist/webcomponents/p-1bca4499.entry.js +0 -5
- package/dist/webcomponents/p-1d8cb8fd.entry.js +0 -5
- package/dist/webcomponents/p-22443c08.entry.js +0 -5
- package/dist/webcomponents/p-28426d2a.entry.js +0 -5
- package/dist/webcomponents/p-2fdc51ae.entry.js +0 -5
- package/dist/webcomponents/p-30c428b6.entry.js +0 -5
- package/dist/webcomponents/p-36bbea4e.entry.js +0 -5
- package/dist/webcomponents/p-3907ebfa.entry.js +0 -5
- package/dist/webcomponents/p-39a16f9d.entry.js +0 -5
- package/dist/webcomponents/p-3ebbd2f5.entry.js +0 -5
- package/dist/webcomponents/p-3ef7eac8.entry.js +0 -5
- package/dist/webcomponents/p-46513db4.entry.js +0 -5
- package/dist/webcomponents/p-4fe12a72.entry.js +0 -5
- package/dist/webcomponents/p-5f373708.entry.js +0 -5
- package/dist/webcomponents/p-5fc7ba4c.entry.js +0 -5
- package/dist/webcomponents/p-66006312.entry.js +0 -5
- package/dist/webcomponents/p-6c5f6cb6.entry.js +0 -5
- package/dist/webcomponents/p-6f1c4425.entry.js +0 -5
- package/dist/webcomponents/p-750799b7.entry.js +0 -5
- package/dist/webcomponents/p-756ff2ad.entry.js +0 -5
- package/dist/webcomponents/p-765bfe27.entry.js +0 -5
- package/dist/webcomponents/p-7ab96c11.entry.js +0 -5
- package/dist/webcomponents/p-7c2ff8b4.entry.js +0 -5
- package/dist/webcomponents/p-7cf9f4e5.entry.js +0 -5
- package/dist/webcomponents/p-7e1856e4.entry.js +0 -5
- package/dist/webcomponents/p-7fb03a49.entry.js +0 -5
- package/dist/webcomponents/p-85f8063b.entry.js +0 -5
- package/dist/webcomponents/p-8b558233.entry.js +0 -5
- package/dist/webcomponents/p-8e6c2767.entry.js +0 -5
- package/dist/webcomponents/p-98843fa3.entry.js +0 -5
- package/dist/webcomponents/p-9a375eff.entry.js +0 -5
- package/dist/webcomponents/p-9b358cff.entry.js +0 -5
- package/dist/webcomponents/p-9f7558c7.entry.js +0 -5
- package/dist/webcomponents/p-bba9fc09.entry.js +0 -5
- package/dist/webcomponents/p-c0b0f531.entry.js +0 -5
- package/dist/webcomponents/p-c492d926.entry.js +0 -5
- package/dist/webcomponents/p-c4cfe599.entry.js +0 -5
- package/dist/webcomponents/p-cedb8eea.entry.js +0 -5
- package/dist/webcomponents/p-dba376cb.entry.js +0 -5
- package/dist/webcomponents/p-e0ce536a.entry.js +0 -5
- package/dist/webcomponents/p-e1331288.entry.js +0 -5
- package/dist/webcomponents/p-e360a463.entry.js +0 -5
- package/dist/webcomponents/p-e80a1eb0.entry.js +0 -5
- package/dist/webcomponents/p-f6318e94.entry.js +0 -5
- package/dist/webcomponents/p-fcd4ae48.entry.js +0 -5
|
@@ -8,6 +8,7 @@ import { listenForExternalBlockingSurface } from "../../shared/utils/floating-su
|
|
|
8
8
|
import { getFormValidationState, isFormControlDisabled, safeSetFormValue, syncNativeFormValidity, } from "../../shared/utils/form";
|
|
9
9
|
import { hasAssignedSlotContent, hasNamedLightDomSlot } from "../../shared/utils/slot";
|
|
10
10
|
import { resolveFormValidator } from "../../shared/utils/validator";
|
|
11
|
+
import { transitionAllSelection, transitionSelection } from "./select.utils";
|
|
11
12
|
let selectId = 0;
|
|
12
13
|
/**
|
|
13
14
|
* ## Design System
|
|
@@ -192,6 +193,7 @@ export class Select {
|
|
|
192
193
|
this.validatorMessage = null;
|
|
193
194
|
this.hasFeedbackSlot = false;
|
|
194
195
|
this.hasValidationLoadingSlot = false;
|
|
196
|
+
this.selectedValuesState = [];
|
|
195
197
|
this.customValidationMessage = '';
|
|
196
198
|
this.validationRunId = 0;
|
|
197
199
|
this.lastAnnouncedOpen = false;
|
|
@@ -199,6 +201,9 @@ export class Select {
|
|
|
199
201
|
this.suppressValueChange = false;
|
|
200
202
|
this.hasImperativeOptions = false;
|
|
201
203
|
this.remoteSelectedOptions = new Map();
|
|
204
|
+
this.selectionInitialized = false;
|
|
205
|
+
this.selectedValues = [];
|
|
206
|
+
this.suppressFocusOpen = false;
|
|
202
207
|
/**
|
|
203
208
|
* Sincroniza as opções declaradas no slot com a lista interna renderizada.
|
|
204
209
|
*
|
|
@@ -209,10 +214,11 @@ export class Select {
|
|
|
209
214
|
this.syncOptionsFromSlot = (updateDisplayValue = true) => {
|
|
210
215
|
if (this.hasImperativeOptions)
|
|
211
216
|
return;
|
|
212
|
-
const nodes = this.slotElement?.assignedNodes({ flatten: true }) ??
|
|
217
|
+
const nodes = this.slotElement?.assignedNodes({ flatten: true }) ?? Array.from(this.el.childNodes);
|
|
213
218
|
const options = nodes.map((n) => this.nodeToOption(n)).filter((o) => Boolean(o));
|
|
214
219
|
// Envia opções para o br-select-list
|
|
215
|
-
this.selectListElement
|
|
220
|
+
if (this.selectListElement)
|
|
221
|
+
this.selectListElement.options = this.getListOptions(options);
|
|
216
222
|
if (updateDisplayValue)
|
|
217
223
|
this.syncDisplayValue(options);
|
|
218
224
|
};
|
|
@@ -242,6 +248,10 @@ export class Select {
|
|
|
242
248
|
this.setSelectionMode(this.effectiveMultiple);
|
|
243
249
|
const initialOptions = this.getHostOptions();
|
|
244
250
|
const propOptions = this.getOptionsProp();
|
|
251
|
+
const sourceOptions = initialOptions.length === 0 && propOptions.length > 0 ? propOptions : initialOptions;
|
|
252
|
+
this.setSelectedValues(this.valueFromPublicValue(this.value) ??
|
|
253
|
+
sourceOptions.filter((option) => option.selected).map((option) => option.value));
|
|
254
|
+
this.selectionInitialized = true;
|
|
245
255
|
if (initialOptions.length === 0 && propOptions.length > 0) {
|
|
246
256
|
this.pendingOptions = propOptions;
|
|
247
257
|
this.syncDisplayValue(propOptions);
|
|
@@ -263,7 +273,7 @@ export class Select {
|
|
|
263
273
|
this.slotElement.addEventListener('slotchange', this.handleSlotChange);
|
|
264
274
|
}
|
|
265
275
|
if (this.pendingOptions && this.selectListElement) {
|
|
266
|
-
this.selectListElement.
|
|
276
|
+
this.selectListElement.options = this.getListOptions(this.pendingOptions);
|
|
267
277
|
this.pendingOptions = null;
|
|
268
278
|
}
|
|
269
279
|
this.isValueChangeReady = true;
|
|
@@ -272,6 +282,10 @@ export class Select {
|
|
|
272
282
|
this.attachBlockingSurfaceListener();
|
|
273
283
|
this.updateValidity();
|
|
274
284
|
}
|
|
285
|
+
componentDidRender() {
|
|
286
|
+
this.syncNativeSelectSelection();
|
|
287
|
+
this.updateValidity();
|
|
288
|
+
}
|
|
275
289
|
disconnectedCallback() {
|
|
276
290
|
if (this.slotElement) {
|
|
277
291
|
this.slotElement.removeEventListener('slotchange', this.handleSlotChange);
|
|
@@ -288,6 +302,49 @@ export class Select {
|
|
|
288
302
|
get effectiveOpen() {
|
|
289
303
|
return this.open ?? this.isOpen;
|
|
290
304
|
}
|
|
305
|
+
valueFromPublicValue(value) {
|
|
306
|
+
if (this.effectiveMultiple)
|
|
307
|
+
return Array.isArray(value) ? [...new Set(value.filter(Boolean))] : null;
|
|
308
|
+
return typeof value === 'string' && value ? [value] : null;
|
|
309
|
+
}
|
|
310
|
+
setSelectedValues(values) {
|
|
311
|
+
const next = [...new Set(values.filter(Boolean))];
|
|
312
|
+
if (!this.effectiveMultiple && next.length > 1)
|
|
313
|
+
next.splice(1);
|
|
314
|
+
if (this.selectedValues.length === next.length &&
|
|
315
|
+
this.selectedValues.every((value, index) => value === next[index]))
|
|
316
|
+
return;
|
|
317
|
+
this.selectedValues = next;
|
|
318
|
+
this.selectedValuesState = next;
|
|
319
|
+
}
|
|
320
|
+
get canonicalSelectedValues() {
|
|
321
|
+
// A leitura do @State registra a dependência reativa; o campo síncrono evita snapshots atrasados na mesma interação.
|
|
322
|
+
void this.selectedValuesState;
|
|
323
|
+
return this.selectedValues;
|
|
324
|
+
}
|
|
325
|
+
applyCanonicalSelection(options, values = this.canonicalSelectedValues) {
|
|
326
|
+
if (!this.selectionInitialized)
|
|
327
|
+
return options.map((option) => ({ ...option }));
|
|
328
|
+
const selected = new Set(values);
|
|
329
|
+
return options.map((option) => ({ ...option, selected: selected.has(option.value) }));
|
|
330
|
+
}
|
|
331
|
+
getListOptions(options) {
|
|
332
|
+
const normalized = this.applyCanonicalSelection(options).filter((option) => option.value !== '__select_all__');
|
|
333
|
+
if (!this.effectiveMultiple)
|
|
334
|
+
return normalized;
|
|
335
|
+
const selectable = normalized.filter((option) => !this.isSelectAllLabel(this.getOptionLabel(option)));
|
|
336
|
+
const allSelected = selectable.length > 0 && selectable.every((option) => Boolean(option.selected));
|
|
337
|
+
const anySelected = selectable.some((option) => Boolean(option.selected));
|
|
338
|
+
return [
|
|
339
|
+
{
|
|
340
|
+
value: '__select_all__',
|
|
341
|
+
label: allSelected ? this.unselectAllLabel : this.selectAllLabel,
|
|
342
|
+
selected: allSelected,
|
|
343
|
+
indeterminate: anySelected && !allSelected,
|
|
344
|
+
},
|
|
345
|
+
...selectable,
|
|
346
|
+
];
|
|
347
|
+
}
|
|
291
348
|
isDisabled() {
|
|
292
349
|
return isFormControlDisabled(this.disabled, this.formDisabled);
|
|
293
350
|
}
|
|
@@ -360,6 +417,8 @@ export class Select {
|
|
|
360
417
|
}
|
|
361
418
|
handleSelectInputFocus() {
|
|
362
419
|
this.activeOptionIndex = -1;
|
|
420
|
+
if (this.suppressFocusOpen)
|
|
421
|
+
return;
|
|
363
422
|
if (this.filterable && !this.effectiveOpen) {
|
|
364
423
|
this.clearSearch();
|
|
365
424
|
void this.show();
|
|
@@ -396,16 +455,50 @@ export class Select {
|
|
|
396
455
|
this.toggleOpenFromPointer();
|
|
397
456
|
}
|
|
398
457
|
handleSelectOptionStateChange(event) {
|
|
399
|
-
this.syncSlottedOptionSelection(event.detail);
|
|
400
|
-
this.rememberRemoteSelections(this.getCurrentOptions());
|
|
401
|
-
this.syncDisplayValue();
|
|
402
|
-
this.syncActiveOptionIndex(event.detail);
|
|
403
458
|
event.stopPropagation();
|
|
404
|
-
const detail =
|
|
459
|
+
const detail = event.detail;
|
|
460
|
+
// Use a lista interna para preservar rótulos e opções remotas enquanto as
|
|
461
|
+
// props projetadas aguardam a próxima renderização.
|
|
462
|
+
const listOptions = this.getSelectListController()?.options;
|
|
463
|
+
const sourceOptions = Array.isArray(listOptions) && listOptions.length > 0
|
|
464
|
+
? listOptions.map((option) => ({ ...option }))
|
|
465
|
+
: this.getCurrentOptions();
|
|
466
|
+
// No modo simples, o evento é a decisão final da interação. A lista
|
|
467
|
+
// virtualizada e as opções projetadas podem ainda conter o snapshot da
|
|
468
|
+
// interação anterior durante cliques consecutivos; derivar a coleção a
|
|
469
|
+
// partir do valor do evento evita que esse snapshot reapareça no valor
|
|
470
|
+
// público ou no formulário.
|
|
471
|
+
const selectableValues = sourceOptions
|
|
472
|
+
.filter((option) => !this.isSelectAllLabel(this.getOptionLabel(option)))
|
|
473
|
+
.map((option) => option.value);
|
|
474
|
+
const transition = this.isSelectAllLabel(detail.label ?? detail.value)
|
|
475
|
+
? transitionAllSelection(this.selectedValues, Boolean(detail.selected), selectableValues)
|
|
476
|
+
: transitionSelection({
|
|
477
|
+
currentValues: this.selectedValues,
|
|
478
|
+
multiple: this.effectiveMultiple,
|
|
479
|
+
value: detail.value,
|
|
480
|
+
selected: Boolean(detail.selected),
|
|
481
|
+
});
|
|
482
|
+
this.setSelectedValues(transition.values);
|
|
483
|
+
const options = this.applyCanonicalSelection(sourceOptions, transition.values);
|
|
484
|
+
if (this.selectListElement)
|
|
485
|
+
this.selectListElement.options = this.getListOptions(options);
|
|
486
|
+
this.reflectRenderedListSelection(transition.values, options);
|
|
487
|
+
this.syncSlottedOptionSelection(transition.values);
|
|
488
|
+
this.rememberRemoteSelections(options);
|
|
489
|
+
this.syncDisplayValue(options);
|
|
490
|
+
this.syncActiveOptionIndex(event.detail);
|
|
405
491
|
this.emitStateChange(detail);
|
|
406
492
|
this.updateValidity();
|
|
407
|
-
if (!
|
|
408
|
-
|
|
493
|
+
if (!transition.changed)
|
|
494
|
+
return;
|
|
495
|
+
if (!this.effectiveMultiple) {
|
|
496
|
+
this.suppressFocusOpen = true;
|
|
497
|
+
void this.selectInputElement?.setFocus?.();
|
|
498
|
+
void this.close().finally(() => {
|
|
499
|
+
this.suppressFocusOpen = false;
|
|
500
|
+
});
|
|
501
|
+
}
|
|
409
502
|
dispatchNativeFormEvent(this.el, 'input');
|
|
410
503
|
dispatchNativeFormEvent(this.el, 'change');
|
|
411
504
|
}
|
|
@@ -622,7 +715,7 @@ export class Select {
|
|
|
622
715
|
this.suppressValueChange = true;
|
|
623
716
|
try {
|
|
624
717
|
if (this.selectListElement) {
|
|
625
|
-
|
|
718
|
+
this.selectListElement.options = this.getListOptions(nextOptions);
|
|
626
719
|
}
|
|
627
720
|
else {
|
|
628
721
|
this.pendingOptions = nextOptions;
|
|
@@ -641,20 +734,20 @@ export class Select {
|
|
|
641
734
|
*/
|
|
642
735
|
async setOption(option) {
|
|
643
736
|
this.hasImperativeOptions = true;
|
|
737
|
+
const currentOptions = this.getCurrentOptions();
|
|
738
|
+
const index = currentOptions.findIndex((currentOption) => currentOption.value === option.value);
|
|
739
|
+
const nextOptions = [...currentOptions];
|
|
740
|
+
if (index === -1)
|
|
741
|
+
nextOptions.push(option);
|
|
742
|
+
else
|
|
743
|
+
nextOptions[index] = option;
|
|
644
744
|
if (this.selectListElement) {
|
|
645
|
-
|
|
646
|
-
}
|
|
647
|
-
else if (this.pendingOptions) {
|
|
648
|
-
const index = this.pendingOptions.findIndex((currentOption) => currentOption.value === option.value);
|
|
649
|
-
if (index !== -1)
|
|
650
|
-
this.pendingOptions[index] = option;
|
|
651
|
-
else
|
|
652
|
-
this.pendingOptions.push(option);
|
|
745
|
+
this.selectListElement.options = this.getListOptions(nextOptions);
|
|
653
746
|
}
|
|
654
747
|
else {
|
|
655
|
-
this.pendingOptions =
|
|
748
|
+
this.pendingOptions = nextOptions;
|
|
656
749
|
}
|
|
657
|
-
this.syncDisplayValue();
|
|
750
|
+
this.syncDisplayValue(nextOptions);
|
|
658
751
|
}
|
|
659
752
|
getHostOptions() {
|
|
660
753
|
return Array.from(this.el.childNodes)
|
|
@@ -683,15 +776,16 @@ export class Select {
|
|
|
683
776
|
const rawLabel = el.getAttribute('label') ?? el.label ?? '';
|
|
684
777
|
let value = String(rawValue || '').trim();
|
|
685
778
|
let label = String(rawLabel || '').trim();
|
|
779
|
+
const inner = this.extractInnerTextFromOption(el);
|
|
780
|
+
const content = (el.innerHTML || '').trim();
|
|
686
781
|
const selected = el.hasAttribute('selected') || Boolean(el.selected);
|
|
687
782
|
if (!value) {
|
|
688
|
-
const inner = this.extractInnerTextFromOption(el);
|
|
689
783
|
if (inner)
|
|
690
784
|
value = inner.trim();
|
|
691
785
|
}
|
|
692
786
|
if (!label)
|
|
693
|
-
label = value;
|
|
694
|
-
return { value: value || '', label: label || undefined, selected };
|
|
787
|
+
label = inner?.trim() || value;
|
|
788
|
+
return { value: value || '', label: label || undefined, selected, content: content || undefined };
|
|
695
789
|
}
|
|
696
790
|
extractInnerTextFromOption(el) {
|
|
697
791
|
const fromSlot = this.getAssignedSlotText(el);
|
|
@@ -744,6 +838,9 @@ export class Select {
|
|
|
744
838
|
this.syncValue(resolvedOptions);
|
|
745
839
|
}
|
|
746
840
|
syncValue(options) {
|
|
841
|
+
this.setSelectedValues(options
|
|
842
|
+
.filter((option) => option.selected && !this.isSelectAllLabel(this.getOptionLabel(option)))
|
|
843
|
+
.map((option) => option.value));
|
|
747
844
|
const nextValue = this.getSerializedValue(options);
|
|
748
845
|
this.syncFormState(options);
|
|
749
846
|
if (this.value === nextValue)
|
|
@@ -783,15 +880,18 @@ export class Select {
|
|
|
783
880
|
}
|
|
784
881
|
applySelectedValue(value) {
|
|
785
882
|
const currentOptions = this.getCurrentOptions();
|
|
883
|
+
const requestedValues = this.valueFromPublicValue(value) ?? [];
|
|
884
|
+
this.setSelectedValues(requestedValues);
|
|
786
885
|
const options = currentOptions.map((option) => ({
|
|
787
886
|
...option,
|
|
788
|
-
selected:
|
|
887
|
+
selected: requestedValues.includes(option.value),
|
|
789
888
|
}));
|
|
790
889
|
this.isApplyingExternalValue = true;
|
|
791
890
|
if (this.selectListElement)
|
|
792
|
-
|
|
891
|
+
this.selectListElement.options = this.getListOptions(options);
|
|
793
892
|
else
|
|
794
893
|
this.pendingOptions = options;
|
|
894
|
+
this.reflectRenderedListSelection(requestedValues, options);
|
|
795
895
|
this.value = value;
|
|
796
896
|
this.isApplyingExternalValue = false;
|
|
797
897
|
this.remoteSelectedOptions.clear();
|
|
@@ -814,7 +914,7 @@ export class Select {
|
|
|
814
914
|
}
|
|
815
915
|
applyRemoteSelection(options) {
|
|
816
916
|
this.rememberRemoteSelections(this.getCurrentOptions());
|
|
817
|
-
const selectedValues = new Set(
|
|
917
|
+
const selectedValues = new Set(this.selectedValues);
|
|
818
918
|
const nextOptions = options.map((option) => ({
|
|
819
919
|
...option,
|
|
820
920
|
selected: selectedValues.has(option.value) || Boolean(option.selected),
|
|
@@ -849,38 +949,36 @@ export class Select {
|
|
|
849
949
|
const selectedValues = selected.map((option) => option.value);
|
|
850
950
|
const formValue = this.effectiveMultiple ? JSON.stringify(selectedValues) : (selectedValues[0] ?? null);
|
|
851
951
|
safeSetFormValue(this.elementInternals, formValue);
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
const selectedSet = new Set(selectedValues);
|
|
855
|
-
const optionNodes = Array.from(this.nativeSelect.options);
|
|
856
|
-
selectedSet.forEach((value) => {
|
|
857
|
-
if (optionNodes.some((option) => option.value === value))
|
|
858
|
-
return;
|
|
859
|
-
const option = document.createElement('option');
|
|
860
|
-
option.value = value;
|
|
861
|
-
this.nativeSelect?.append(option);
|
|
862
|
-
});
|
|
863
|
-
optionNodes.forEach((option) => {
|
|
864
|
-
if (option.value !== '' && !selectedSet.has(option.value))
|
|
865
|
-
option.remove();
|
|
866
|
-
else
|
|
867
|
-
option.selected = selectedSet.has(option.value);
|
|
868
|
-
});
|
|
869
|
-
this.nativeSelect.value = selectedValues[0] ?? '';
|
|
870
|
-
}
|
|
871
|
-
this.updateValidity();
|
|
952
|
+
this.syncNativeSelectSelection(selectedValues);
|
|
953
|
+
this.updateValidity(selectedValues.length);
|
|
872
954
|
}
|
|
873
|
-
|
|
874
|
-
|
|
955
|
+
syncNativeSelectSelection(values = this.getSelectedValues()) {
|
|
956
|
+
const nativeSelect = this.getNativeSelect();
|
|
957
|
+
if (!nativeSelect)
|
|
958
|
+
return;
|
|
959
|
+
const selectedValues = new Set(values);
|
|
960
|
+
Array.from(nativeSelect.options).forEach((option) => {
|
|
961
|
+
option.selected = option.value === '' ? selectedValues.size === 0 : selectedValues.has(option.value);
|
|
962
|
+
});
|
|
963
|
+
}
|
|
964
|
+
getSelectedValues() {
|
|
965
|
+
return [...this.selectedValues];
|
|
966
|
+
}
|
|
967
|
+
updateValidity(selectedCount = this.getSelectedValues().length) {
|
|
968
|
+
const nativeSelect = this.getNativeSelect();
|
|
969
|
+
if (!nativeSelect)
|
|
875
970
|
return;
|
|
876
|
-
const selectedCount = this.getFormOptions(this.getCurrentOptions()).filter((option) => option.selected).length;
|
|
877
971
|
const selectionMessage = this.effectiveMultiple && this.minSelections > 0 && selectedCount < this.minSelections
|
|
878
972
|
? `Selecione pelo menos ${this.minSelections} opções.`
|
|
879
973
|
: this.effectiveMultiple && this.maxSelections > 0 && selectedCount > this.maxSelections
|
|
880
974
|
? `Selecione no máximo ${this.maxSelections} opções.`
|
|
881
975
|
: '';
|
|
882
|
-
|
|
883
|
-
syncNativeFormValidity(this.elementInternals,
|
|
976
|
+
nativeSelect.setCustomValidity(this.customValidationMessage || this.validatorMessage || selectionMessage);
|
|
977
|
+
syncNativeFormValidity(this.elementInternals, nativeSelect);
|
|
978
|
+
}
|
|
979
|
+
getNativeSelect() {
|
|
980
|
+
return (this.el.shadowRoot?.querySelector('select[part="hidden-select"]') ??
|
|
981
|
+
this.nativeSelect);
|
|
884
982
|
}
|
|
885
983
|
resolveValidator() {
|
|
886
984
|
return resolveFormValidator(this.validator);
|
|
@@ -991,6 +1089,17 @@ export class Select {
|
|
|
991
1089
|
const index = this.getCurrentActiveIndex();
|
|
992
1090
|
const option = options[index];
|
|
993
1091
|
const nextSelected = this.effectiveMultiple ? !option?.selected : true;
|
|
1092
|
+
if (this.effectiveMultiple && index === 0 && option && !this.isSelectAllLabel(this.getOptionLabel(option))) {
|
|
1093
|
+
this.handleSelectOptionStateChange(new CustomEvent('brSelectOptionStateChange', {
|
|
1094
|
+
detail: {
|
|
1095
|
+
value: '__select_all__',
|
|
1096
|
+
label: this.selectAllLabel,
|
|
1097
|
+
selected: true,
|
|
1098
|
+
disabled: false,
|
|
1099
|
+
},
|
|
1100
|
+
}));
|
|
1101
|
+
return;
|
|
1102
|
+
}
|
|
994
1103
|
const didSelect = await this.getSelectListController()?.setOptionSelected?.(index, nextSelected);
|
|
995
1104
|
if (didSelect) {
|
|
996
1105
|
this.activeOptionIndex = index;
|
|
@@ -1011,55 +1120,19 @@ export class Select {
|
|
|
1011
1120
|
* Essa sincronização mantém as props/atributos das opções declaradas pelo consumidor em
|
|
1012
1121
|
* conformidade com o estado calculado internamente, inclusive no caso do "selecionar todos".
|
|
1013
1122
|
*/
|
|
1014
|
-
syncSlottedOptionSelection(
|
|
1015
|
-
|
|
1016
|
-
return;
|
|
1017
|
-
const slottedOptions = this.slotElement
|
|
1018
|
-
.assignedElements({ flatten: true })
|
|
1019
|
-
.filter((el) => el.tagName.toLowerCase() === 'br-select-option');
|
|
1123
|
+
syncSlottedOptionSelection(values = this.selectedValues) {
|
|
1124
|
+
const slottedOptions = Array.from(this.el.children).filter((el) => el.tagName.toLowerCase() === 'br-select-option');
|
|
1020
1125
|
if (slottedOptions.length === 0)
|
|
1021
1126
|
return;
|
|
1022
|
-
const
|
|
1023
|
-
const isSelectAll = this.isSelectAllLabel(detailLabel);
|
|
1024
|
-
if (this.effectiveMultiple && isSelectAll) {
|
|
1025
|
-
slottedOptions.forEach((option) => {
|
|
1026
|
-
const optionLabel = (option.label ?? option.value).trim();
|
|
1027
|
-
const isSelectAllOption = this.isSelectAllLabel(optionLabel);
|
|
1028
|
-
if (isSelectAllOption) {
|
|
1029
|
-
option.indeterminate = false;
|
|
1030
|
-
option.selected = Boolean(detail.selected);
|
|
1031
|
-
this.normalizeSelectAllState(option);
|
|
1032
|
-
if (option.selected)
|
|
1033
|
-
option.setAttribute('selected', '');
|
|
1034
|
-
else
|
|
1035
|
-
option.removeAttribute('selected');
|
|
1036
|
-
return;
|
|
1037
|
-
}
|
|
1038
|
-
option.selected = Boolean(detail.selected);
|
|
1039
|
-
if (option.selected)
|
|
1040
|
-
option.setAttribute('selected', '');
|
|
1041
|
-
else
|
|
1042
|
-
option.removeAttribute('selected');
|
|
1043
|
-
});
|
|
1044
|
-
return;
|
|
1045
|
-
}
|
|
1127
|
+
const selectedValues = new Set(values);
|
|
1046
1128
|
slottedOptions.forEach((option) => {
|
|
1047
|
-
const
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
}
|
|
1052
|
-
option.selected = nextSelected;
|
|
1053
|
-
if (nextSelected) {
|
|
1129
|
+
const resolved = this.optionElementToData(option).value;
|
|
1130
|
+
option.selected = selectedValues.has(resolved);
|
|
1131
|
+
option.indeterminate = false;
|
|
1132
|
+
if (option.selected)
|
|
1054
1133
|
option.setAttribute('selected', '');
|
|
1055
|
-
|
|
1056
|
-
else {
|
|
1057
|
-
option.removeAttribute('selected');
|
|
1058
|
-
}
|
|
1059
|
-
if (!this.effectiveMultiple && !isTarget) {
|
|
1060
|
-
option.selected = false;
|
|
1134
|
+
else
|
|
1061
1135
|
option.removeAttribute('selected');
|
|
1062
|
-
}
|
|
1063
1136
|
});
|
|
1064
1137
|
if (!this.effectiveMultiple)
|
|
1065
1138
|
return;
|
|
@@ -1082,6 +1155,26 @@ export class Select {
|
|
|
1082
1155
|
option.removeAttribute('selected');
|
|
1083
1156
|
});
|
|
1084
1157
|
}
|
|
1158
|
+
reflectRenderedListSelection(values, sourceOptions) {
|
|
1159
|
+
const renderedOptions = this.selectListElement?.shadowRoot?.querySelectorAll('br-select-option');
|
|
1160
|
+
if (!renderedOptions)
|
|
1161
|
+
return;
|
|
1162
|
+
const selectedValues = new Set(values);
|
|
1163
|
+
const selectableOptions = (sourceOptions?.length
|
|
1164
|
+
? sourceOptions
|
|
1165
|
+
: Array.from(renderedOptions).map((option) => ({ label: option.label, value: option.value }))).filter((option) => !this.isSelectAllLabel(this.getOptionLabel(option)));
|
|
1166
|
+
const allSelected = selectableOptions.length > 0 && selectableOptions.every((option) => selectedValues.has(option.value));
|
|
1167
|
+
const anySelected = selectableOptions.some((option) => selectedValues.has(option.value));
|
|
1168
|
+
renderedOptions.forEach((option) => {
|
|
1169
|
+
if (this.isSelectAllLabel(option.label ?? option.value)) {
|
|
1170
|
+
option.indeterminate = anySelected && !allSelected;
|
|
1171
|
+
option.selected = allSelected;
|
|
1172
|
+
option.label = this.getSelectAllLabel(allSelected, option.indeterminate);
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
option.selected = selectedValues.has(option.value);
|
|
1176
|
+
});
|
|
1177
|
+
}
|
|
1085
1178
|
isSelectAllLabel(label) {
|
|
1086
1179
|
return label === this.selectAllLabel || label === this.unselectAllLabel;
|
|
1087
1180
|
}
|
|
@@ -1162,6 +1255,7 @@ export class Select {
|
|
|
1162
1255
|
* A precedência é: lista interna, opções pendentes, conteúdo do slot e, por último,
|
|
1163
1256
|
* os filhos atuais do host.
|
|
1164
1257
|
*/
|
|
1258
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: prioriza a precedência entre slot, lista e opções remotas.
|
|
1165
1259
|
getCurrentOptions() {
|
|
1166
1260
|
// As opções projetadas são a fonte canônica quando não há coleção
|
|
1167
1261
|
// imperativa: a lista virtualizada pode manter um snapshot enquanto o
|
|
@@ -1171,21 +1265,53 @@ export class Select {
|
|
|
1171
1265
|
const slotOptions = nodes
|
|
1172
1266
|
.map((node) => this.nodeToOption(node))
|
|
1173
1267
|
.filter((option) => Boolean(option));
|
|
1174
|
-
if (slotOptions.length > 0)
|
|
1175
|
-
|
|
1268
|
+
if (slotOptions.length > 0) {
|
|
1269
|
+
const normalizedSlotOptions = this.applyCanonicalSelection(slotOptions);
|
|
1270
|
+
if (this.effectiveMultiple &&
|
|
1271
|
+
!normalizedSlotOptions.some((option) => this.isSelectAllLabel(this.getOptionLabel(option)))) {
|
|
1272
|
+
normalizedSlotOptions.unshift({
|
|
1273
|
+
value: '__select_all__',
|
|
1274
|
+
label: this.selectAllLabel,
|
|
1275
|
+
selected: false,
|
|
1276
|
+
indeterminate: false,
|
|
1277
|
+
});
|
|
1278
|
+
}
|
|
1279
|
+
return normalizedSlotOptions;
|
|
1280
|
+
}
|
|
1176
1281
|
}
|
|
1177
1282
|
const listOptions = this.getSelectListController()?.options;
|
|
1178
1283
|
if (Array.isArray(listOptions) && listOptions.length > 0) {
|
|
1179
1284
|
const normalizedListOptions = listOptions.map((option) => ({ ...option }));
|
|
1180
1285
|
const hasRealOptions = normalizedListOptions.some((option) => !this.isSelectAllLabel(this.getOptionLabel(option)));
|
|
1181
1286
|
if (hasRealOptions) {
|
|
1182
|
-
|
|
1287
|
+
if (this.effectiveMultiple &&
|
|
1288
|
+
!normalizedListOptions.some((option) => this.isSelectAllLabel(this.getOptionLabel(option)))) {
|
|
1289
|
+
normalizedListOptions.unshift({
|
|
1290
|
+
value: '__select_all__',
|
|
1291
|
+
label: this.selectAllLabel,
|
|
1292
|
+
selected: false,
|
|
1293
|
+
indeterminate: false,
|
|
1294
|
+
});
|
|
1295
|
+
}
|
|
1296
|
+
return this.applyCanonicalSelection(normalizedListOptions);
|
|
1183
1297
|
}
|
|
1184
1298
|
}
|
|
1185
1299
|
if (this.pendingOptions) {
|
|
1186
|
-
return this.pendingOptions
|
|
1300
|
+
return this.applyCanonicalSelection(this.pendingOptions);
|
|
1187
1301
|
}
|
|
1188
|
-
|
|
1302
|
+
const hostOptions = this.applyCanonicalSelection(this.getHostOptions());
|
|
1303
|
+
if (this.effectiveMultiple && hostOptions.length > 0) {
|
|
1304
|
+
return [
|
|
1305
|
+
{
|
|
1306
|
+
value: '__select_all__',
|
|
1307
|
+
label: this.selectAllLabel,
|
|
1308
|
+
selected: false,
|
|
1309
|
+
indeterminate: false,
|
|
1310
|
+
},
|
|
1311
|
+
...hostOptions,
|
|
1312
|
+
];
|
|
1313
|
+
}
|
|
1314
|
+
return hostOptions;
|
|
1189
1315
|
}
|
|
1190
1316
|
normalizeSearchText(value) {
|
|
1191
1317
|
return value
|
|
@@ -1235,7 +1361,7 @@ export class Select {
|
|
|
1235
1361
|
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", ref: (el) => (this.selectInputElement = el), "aria-activedescendant": this.getActiveDescendant(), "aria-controls": this.listboxId, "aria-disabled": String(this.isDisabled()), "aria-expanded": String(this.effectiveOpen), "aria-haspopup": "listbox", "aria-label": this.getAccessibleLabel(), "aria-required": String(this.required), borderless: this.borderless, "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, autocomplete: this.autocomplete, "input-width": this.inputWidth, role: "combobox", value: this.filterable && this.effectiveOpen ? this.searchTerm : this.getRenderedDisplayValue() }));
|
|
1236
1362
|
}
|
|
1237
1363
|
renderSelectList() {
|
|
1238
|
-
return (h("br-select-list", { part: "list", exportparts: "list, option, checkbox, select-all, empty-option, option-checkbox, option-radio", "active-option-index": this.activeOptionIndex, "aria-label": this.getAccessibleLabel(), "aria-multiselectable": this.effectiveMultiple ? 'true' : 'false', id: this.listboxId, "visible-items": this.visibleItems, "item-height": this.itemHeight, overscan: this.overscan, "search-term": this.filterable && this.searchMode === 'local' ? this.searchTerm : '', role: "listbox", "select-all-label": this.selectAllLabel, "unselect-all-label": this.unselectAllLabel, ref: (el) => {
|
|
1364
|
+
return (h("br-select-list", { part: "list", options: this.getCurrentOptions(), exportparts: "list, option, checkbox, select-all, empty-option, option-checkbox, option-radio", "active-option-index": this.activeOptionIndex, "aria-label": this.getAccessibleLabel(), "aria-multiselectable": this.effectiveMultiple ? 'true' : 'false', id: this.listboxId, "visible-items": this.visibleItems, "item-height": this.itemHeight, overscan: this.overscan, "search-term": this.filterable && this.searchMode === 'local' ? this.searchTerm : '', role: "listbox", "select-all-label": this.selectAllLabel, "unselect-all-label": this.unselectAllLabel, ref: (el) => {
|
|
1239
1365
|
this.selectListElement = el;
|
|
1240
1366
|
this.selectListElement.loading = this.loading;
|
|
1241
1367
|
this.setSelectionMode(this.effectiveMultiple);
|
|
@@ -1243,9 +1369,8 @@ export class Select {
|
|
|
1243
1369
|
} }, h("slot", null), h("slot", { name: "loading", slot: "loading" })));
|
|
1244
1370
|
}
|
|
1245
1371
|
renderHiddenSelect() {
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
.filter((option) => option.selected);
|
|
1372
|
+
const options = this.getFormOptions(this.getCurrentOptions()).filter((option) => !this.isSelectAllLabel(this.getOptionLabel(option)));
|
|
1373
|
+
const hasSelection = options.some((option) => option.selected);
|
|
1249
1374
|
return (h("select", { ref: (el) => (this.nativeSelect = el), part: "hidden-select", name: this.name, autocomplete: this.autocomplete, multiple: this.effectiveMultiple, required: this.required, disabled: this.isDisabled(), tabIndex: -1, "aria-hidden": "true", style: {
|
|
1250
1375
|
position: 'absolute',
|
|
1251
1376
|
width: '1px',
|
|
@@ -1256,10 +1381,10 @@ export class Select {
|
|
|
1256
1381
|
clip: 'rect(0, 0, 0, 0)',
|
|
1257
1382
|
whiteSpace: 'nowrap',
|
|
1258
1383
|
border: '0',
|
|
1259
|
-
}, onChange: (event) => event.preventDefault() }, h("option", { value: "", selected:
|
|
1384
|
+
}, onChange: (event) => event.preventDefault() }, h("option", { value: "", selected: !hasSelection }), options.map((option) => (h("option", { key: option.value, value: option.value, selected: option.selected, disabled: option.disabled })))));
|
|
1260
1385
|
}
|
|
1261
1386
|
render() {
|
|
1262
|
-
return (h(Host, { key: '
|
|
1387
|
+
return (h(Host, { key: '81db917bc8a39989db84e7e0c9f4aa1272d52af0', "aria-busy": this.isValidating || this.loading ? 'true' : null }, h("div", { key: '150cc02f7a66f90546741550586ba254b9b6728a', class: this.getCssClassMap(), part: "container" }, this.renderSelectInput(), this.renderSelectList(), h("div", { key: 'd3a981fd4da448b3e2355b78bab07fb7245624d8', part: "feedback", hidden: !this.hasFeedbackSlot && !this.validatorMessage }, h("slot", { key: '9f40bb218c36ab6b19579ceac0a849e40ec00ad4', name: "feedback", onSlotchange: (event) => (this.hasFeedbackSlot = hasAssignedSlotContent(event.currentTarget)) }, this.validatorMessage)), h("div", { key: 'd33a5d0ebd54ebeda226e06de1a60b0f75e5b94c', part: "validation-loading", hidden: !this.hasValidationLoadingSlot || !this.isValidating }, h("slot", { key: '8b098ffce8ca2ed341f5a06252bf662574343717', name: "validation-loading" })), this.renderHiddenSelect())));
|
|
1263
1388
|
}
|
|
1264
1389
|
static get is() { return "br-select"; }
|
|
1265
1390
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1992,7 +2117,8 @@ export class Select {
|
|
|
1992
2117
|
"isValidating": {},
|
|
1993
2118
|
"validatorMessage": {},
|
|
1994
2119
|
"hasFeedbackSlot": {},
|
|
1995
|
-
"hasValidationLoadingSlot": {}
|
|
2120
|
+
"hasValidationLoadingSlot": {},
|
|
2121
|
+
"selectedValuesState": {}
|
|
1996
2122
|
};
|
|
1997
2123
|
}
|
|
1998
2124
|
static get events() {
|
|
@@ -2457,7 +2583,7 @@ export class Select {
|
|
|
2457
2583
|
"signature": "(option: SelectOptionData) => Promise<void>",
|
|
2458
2584
|
"parameters": [{
|
|
2459
2585
|
"name": "option",
|
|
2460
|
-
"type": "{ disabled?: boolean; indeterminate?: boolean; label?: string; selected?: boolean; value: string; }",
|
|
2586
|
+
"type": "{ content?: string; disabled?: boolean; indeterminate?: boolean; label?: string; selected?: boolean; value: string; }",
|
|
2461
2587
|
"docs": "Op\u00E7\u00E3o que deve ser inserida ou atualizada."
|
|
2462
2588
|
}],
|
|
2463
2589
|
"references": {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Construído por SERPRO
|
|
3
|
+
* © https://serpro.gov.br/ - MIT License.
|
|
4
|
+
*/
|
|
5
|
+
export function transitionSelection({ currentValues, multiple, value, selected, selectableValues = [], }) {
|
|
6
|
+
const current = [...new Set(currentValues)];
|
|
7
|
+
if (!multiple) {
|
|
8
|
+
const values = selected && value ? [value] : [];
|
|
9
|
+
return { values, changed: values.length !== current.length || values[0] !== current[0] };
|
|
10
|
+
}
|
|
11
|
+
if (!value && selectableValues.length > 0) {
|
|
12
|
+
const values = selected ? [...new Set(selectableValues)] : [];
|
|
13
|
+
return {
|
|
14
|
+
values,
|
|
15
|
+
changed: values.length !== current.length || values.some((item, index) => item !== current[index]),
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const next = new Set(current);
|
|
19
|
+
if (selected)
|
|
20
|
+
next.add(value);
|
|
21
|
+
else
|
|
22
|
+
next.delete(value);
|
|
23
|
+
const values = [...next];
|
|
24
|
+
return { values, changed: values.length !== current.length || values.some((item, index) => item !== current[index]) };
|
|
25
|
+
}
|
|
26
|
+
export function transitionAllSelection(currentValues, selected, selectableValues) {
|
|
27
|
+
return transitionSelection({
|
|
28
|
+
currentValues,
|
|
29
|
+
multiple: true,
|
|
30
|
+
value: '',
|
|
31
|
+
selected,
|
|
32
|
+
selectableValues,
|
|
33
|
+
});
|
|
34
|
+
}
|