@govbr-ds/webcomponents 2.2.0 → 2.4.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.
- package/README.md +75 -24
- package/cem/custom-elements.json +1858 -1712
- package/cem/webcomponents.html-custom-data.json +73 -67
- package/dist/cjs/br-avatar.cjs.entry.js +2 -2
- package/dist/cjs/br-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/br-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/br-button_2.cjs.entry.js +10 -5
- package/dist/cjs/br-card.cjs.entry.js +2 -2
- package/dist/cjs/br-carousel-page.cjs.entry.js +2 -2
- package/dist/cjs/br-carousel.cjs.entry.js +2 -2
- package/dist/cjs/br-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/br-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/br-checkgroup.cjs.entry.js +1 -1
- package/dist/cjs/br-collapse_2.cjs.entry.js +11 -7
- package/dist/cjs/br-cookiebar-cookie.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar-group.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar-header.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar-link.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar-note-group.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar-note.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar.cjs.entry.js +2 -2
- package/dist/cjs/br-crumb.cjs.entry.js +1 -1
- package/dist/cjs/br-date-picker_3.cjs.entry.js +869 -517
- package/dist/cjs/br-datetime-picker.cjs.entry.js +1347 -311
- package/dist/cjs/br-divider.cjs.entry.js +2 -2
- package/dist/cjs/br-dropdown_2.cjs.entry.js +282 -165
- package/dist/cjs/br-footer-category.cjs.entry.js +2 -2
- package/dist/cjs/br-footer-item.cjs.entry.js +2 -2
- package/dist/cjs/br-footer-legal.cjs.entry.js +2 -2
- package/dist/cjs/br-footer-logo.cjs.entry.js +2 -2
- package/dist/cjs/br-footer-social.cjs.entry.js +2 -2
- package/dist/cjs/br-footer.cjs.entry.js +2 -2
- package/dist/cjs/br-header-function.cjs.entry.js +2 -2
- package/dist/cjs/br-header-link.cjs.entry.js +2 -2
- package/dist/cjs/br-header-list.cjs.entry.js +2 -2
- package/dist/cjs/br-header-logo.cjs.entry.js +2 -2
- package/dist/cjs/br-header.cjs.entry.js +27 -23
- package/dist/cjs/br-icon.cjs.entry.js +4 -33
- package/dist/cjs/br-input.cjs.entry.js +31 -6
- package/dist/cjs/br-item.cjs.entry.js +5 -4
- package/dist/cjs/br-link.cjs.entry.js +2 -2
- package/dist/cjs/br-loading.cjs.entry.js +2 -2
- package/dist/cjs/br-magic-button.cjs.entry.js +21 -8
- package/dist/cjs/br-menu-group.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-header.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-info.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-link.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-list.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-logo.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-social.cjs.entry.js +2 -2
- package/dist/cjs/br-menu.cjs.entry.js +2 -2
- package/dist/cjs/br-modal.cjs.entry.js +20 -4
- package/dist/cjs/br-notification-body.cjs.entry.js +2 -2
- package/dist/cjs/br-notification-header.cjs.entry.js +2 -2
- package/dist/cjs/br-notification-item.cjs.entry.js +2 -2
- package/dist/cjs/br-notification.cjs.entry.js +2 -2
- package/dist/cjs/br-pagination.cjs.entry.js +4 -4
- package/dist/cjs/br-radio-group.cjs.entry.js +3 -3
- package/dist/cjs/br-radio.cjs.entry.js +3 -3
- package/dist/cjs/br-scrim.cjs.entry.js +2 -2
- package/dist/cjs/br-select-input_3.cjs.entry.js +286 -100
- package/dist/cjs/br-sign-in.cjs.entry.js +8 -4
- package/dist/cjs/br-skip-link-item.cjs.entry.js +1 -1
- package/dist/cjs/br-skip-link.cjs.entry.js +2 -2
- package/dist/cjs/br-skiplink-item.cjs.entry.js +2 -2
- package/dist/cjs/br-slider.cjs.entry.js +3 -3
- package/dist/cjs/br-step_2.cjs.entry.js +3 -3
- package/dist/cjs/br-switch.cjs.entry.js +3 -3
- package/dist/cjs/br-tab-item.cjs.entry.js +3 -3
- package/dist/cjs/br-tab.cjs.entry.js +38 -13
- package/dist/cjs/br-table-body.cjs.entry.js +2 -2
- package/dist/cjs/br-table-cell.cjs.entry.js +2 -2
- package/dist/cjs/br-table-header-cell.cjs.entry.js +2 -2
- package/dist/cjs/br-table-header.cjs.entry.js +2 -2
- package/dist/cjs/br-table-row.cjs.entry.js +2 -2
- package/dist/cjs/br-table.cjs.entry.js +2 -2
- package/dist/cjs/br-tag.cjs.entry.js +3 -3
- package/dist/cjs/br-textarea.cjs.entry.js +3 -3
- package/dist/cjs/br-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/br-upload.cjs.entry.js +7 -23
- package/dist/cjs/br-wizard-panel.cjs.entry.js +2 -2
- package/dist/cjs/br-wizard.cjs.entry.js +2 -2
- package/dist/cjs/{datetime-picker-constants-B5pWeOn1.js → datetime-picker-constants-CCeI5iW7.js} +20 -5
- package/dist/cjs/format-bytes-Cs8SH2w0.js +24 -0
- package/dist/cjs/icon.utils-DF6kMskA.js +46 -0
- package/dist/cjs/{index-CGgZBuyy.js → index-Bc30P_6z.js} +33 -27
- package/dist/cjs/{index-C92n55ch.js → index-C-IpVFDH.js} +13 -13
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{datetime-picker-props-validation-DmNKSXsy.js → isValid-CduHZTFc.js} +1 -483
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/select.utils-C38f5Kea.js +62 -0
- package/dist/cjs/{validator-CTCajtT9.js → validator-GkkueMOx.js} +18 -0
- package/dist/cjs/webcomponents.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +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/button/button.js +8 -3
- 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/collapse/collapse.js +12 -6
- 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-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-locale.js +12 -12
- package/dist/collection/components/datetime-picker/date-picker/date-picker-props-validation.js +14 -13
- package/dist/collection/components/datetime-picker/date-picker/date-picker.css +1 -1
- package/dist/collection/components/datetime-picker/date-picker/date-picker.js +384 -280
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input-constants.js +59 -0
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input-props-validation.js +19 -15
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.css +1 -1
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.js +373 -211
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.types.js +1 -0
- package/dist/collection/components/datetime-picker/datetime-picker-constants.js +19 -5
- package/dist/collection/components/datetime-picker/datetime-picker-form-associated.js +92 -11
- package/dist/collection/components/datetime-picker/datetime-picker-props-validation.js +52 -33
- package/dist/collection/components/datetime-picker/datetime-picker.css +1 -1
- package/dist/collection/components/datetime-picker/datetime-picker.js +915 -362
- package/dist/collection/components/datetime-picker/datetime-picker.utils.js +62 -49
- package/dist/collection/components/datetime-picker/time-picker/time-picker-constants.js +3 -2
- package/dist/collection/components/datetime-picker/time-picker/time-picker.css +1 -1
- package/dist/collection/components/datetime-picker/time-picker/time-picker.js +148 -85
- package/dist/collection/components/divider/divider.css +1 -1
- package/dist/collection/components/dropdown/dropdown.css +1 -1
- package/dist/collection/components/dropdown/dropdown.js +32 -36
- 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.css +1 -1
- package/dist/collection/components/header/header.js +25 -21
- package/dist/collection/components/icon/icon.css +1 -1
- package/dist/collection/components/icon/icon.utils.js +8 -0
- package/dist/collection/components/input/input.css +1 -1
- package/dist/collection/components/input/input.js +50 -4
- package/dist/collection/components/item/item.css +1 -1
- package/dist/collection/components/item/item.js +4 -3
- package/dist/collection/components/link/link.css +1 -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 +20 -6
- 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-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/message/message.css +1 -1
- package/dist/collection/components/modal/modal.css +1 -1
- package/dist/collection/components/modal/modal.js +19 -3
- 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/pagination/pagination.js +4 -2
- package/dist/collection/components/radio/radio.css +1 -1
- package/dist/collection/components/radio-group/radio-group.css +1 -1
- 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 +126 -18
- package/dist/collection/components/select/select-list/select-list.css +1 -1
- package/dist/collection/components/select/select-list/select-list.js +218 -66
- package/dist/collection/components/select/select-option/select-option.css +1 -1
- package/dist/collection/components/select/select-option/select-option.js +14 -5
- package/dist/collection/components/select/select.css +1 -1
- package/dist/collection/components/select/select.js +303 -94
- package/dist/collection/components/select/select.utils.js +29 -8
- package/dist/collection/components/sign-in/sign-in.css +1 -1
- package/dist/collection/components/sign-in/sign-in.js +8 -4
- 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/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-item/tab-item.js +2 -2
- package/dist/collection/components/tab/tab.css +1 -1
- package/dist/collection/components/tab/tab.js +37 -10
- 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/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/wizard/wizard-panel/wizard-panel.css +1 -1
- package/dist/collection/components/wizard/wizard.css +1 -1
- package/dist/collection/pages/components/select/remote.js +33 -0
- package/dist/collection/pages/components/select/virtualized.js +13 -0
- package/dist/collection/pages/components/upload/handler.js +25 -0
- package/dist/collection/pages/scripts/component-controls.js +15 -16
- package/dist/collection/pages/scripts/menu.js +0 -1
- package/dist/collection/pages/scripts/pageLoader.js +168 -91
- package/dist/collection/pages/scripts/pageloader-preview.js +37 -28
- package/dist/collection/shared/utils/form.js +17 -0
- package/dist/components/br-avatar.js +1 -1
- package/dist/components/br-breadcrumb-item.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-crumb.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-5h-W9_JR.js +5 -0
- package/dist/components/p-848QkYoM.js +5 -0
- package/dist/components/p-B7bNfmgh.js +5 -0
- package/dist/components/p-BFHvuEnN.js +5 -0
- package/dist/components/p-BH6QYnAr.js +5 -0
- package/dist/{webcomponents/p-6c2fe5e4.entry.js → components/p-BcW8O6h2.js} +1 -1
- package/dist/components/p-BicHMcSS.js +5 -0
- package/dist/components/p-Bs7iRQTG.js +5 -0
- package/dist/components/{p-DSHbttu9.js → p-Bvrw9yWR.js} +1 -1
- package/dist/components/p-BzQFMh9j.js +5 -0
- package/dist/components/p-CBHd0-fF.js +5 -0
- package/dist/components/p-CCPHCJjw.js +5 -0
- package/dist/components/p-CDTENPaP.js +5 -0
- package/dist/components/{p-BcqVlof7.js → p-CbgKdASU.js} +1 -1
- package/dist/components/p-CeNELttN.js +5 -0
- package/dist/components/p-CjtmJTLO.js +5 -0
- package/dist/components/{p-DTGNra9m.js → p-D-3G3Ioq.js} +1 -1
- package/dist/components/p-DDu3JV_r.js +5 -0
- package/dist/components/p-DFWqyfUe.js +5 -0
- package/dist/components/p-DL6xuxGG.js +5 -0
- package/dist/components/p-DOX9Uwk1.js +5 -0
- package/dist/components/p-DUq7uT2-.js +5 -0
- package/dist/components/p-Devw08cc.js +5 -0
- package/dist/components/p-Di96UxvH.js +5 -0
- package/dist/components/p-Dp3MsSXu.js +5 -0
- package/dist/components/p-DsO4F0Cz.js +5 -0
- package/dist/components/p-DuLHFTpa.js +5 -0
- package/dist/components/p-DusornQ0.js +5 -0
- package/dist/components/{p-Dma14GVa.js → p-Jk_KQE5V.js} +1 -1
- package/dist/components/p-OQpiDEK9.js +5 -0
- package/dist/components/p-PV731d8s.js +5 -0
- package/dist/components/p-XW6Hp_Jk.js +5 -0
- package/dist/components/p-jOb1hCPi.js +5 -0
- package/dist/components/p-rMnkh3Cy.js +5 -0
- package/dist/components/p-ta-24T1Z.js +5 -0
- package/dist/esm/br-avatar.entry.js +2 -2
- package/dist/esm/br-breadcrumb-item.entry.js +1 -1
- package/dist/esm/br-breadcrumb.entry.js +2 -2
- package/dist/esm/br-button_2.entry.js +10 -5
- package/dist/esm/br-card.entry.js +2 -2
- package/dist/esm/br-carousel-page.entry.js +2 -2
- package/dist/esm/br-carousel.entry.js +3 -3
- package/dist/esm/br-checkbox-group.entry.js +2 -2
- package/dist/esm/br-checkbox.entry.js +4 -4
- package/dist/esm/br-checkgroup.entry.js +1 -1
- package/dist/esm/br-collapse_2.entry.js +12 -8
- package/dist/esm/br-cookiebar-cookie.entry.js +2 -2
- package/dist/esm/br-cookiebar-group.entry.js +2 -2
- package/dist/esm/br-cookiebar-header.entry.js +2 -2
- package/dist/esm/br-cookiebar-link.entry.js +2 -2
- package/dist/esm/br-cookiebar-note-group.entry.js +2 -2
- package/dist/esm/br-cookiebar-note.entry.js +2 -2
- package/dist/esm/br-cookiebar.entry.js +3 -3
- package/dist/esm/br-crumb.entry.js +1 -1
- package/dist/esm/br-date-picker_3.entry.js +844 -492
- package/dist/esm/br-datetime-picker.entry.js +1316 -280
- package/dist/esm/br-divider.entry.js +2 -2
- package/dist/esm/br-dropdown_2.entry.js +281 -164
- package/dist/esm/br-footer-category.entry.js +2 -2
- package/dist/esm/br-footer-item.entry.js +2 -2
- package/dist/esm/br-footer-legal.entry.js +2 -2
- package/dist/esm/br-footer-logo.entry.js +2 -2
- package/dist/esm/br-footer-social.entry.js +2 -2
- package/dist/esm/br-footer.entry.js +2 -2
- package/dist/esm/br-header-function.entry.js +2 -2
- package/dist/esm/br-header-link.entry.js +2 -2
- package/dist/esm/br-header-list.entry.js +3 -3
- package/dist/esm/br-header-logo.entry.js +2 -2
- package/dist/esm/br-header.entry.js +27 -23
- package/dist/esm/br-icon.entry.js +3 -32
- package/dist/esm/br-input.entry.js +32 -7
- package/dist/esm/br-item.entry.js +5 -4
- package/dist/esm/br-link.entry.js +2 -2
- package/dist/esm/br-loading.entry.js +2 -2
- package/dist/esm/br-magic-button.entry.js +21 -8
- package/dist/esm/br-menu-group.entry.js +2 -2
- package/dist/esm/br-menu-header.entry.js +2 -2
- package/dist/esm/br-menu-info.entry.js +2 -2
- package/dist/esm/br-menu-item.entry.js +2 -2
- package/dist/esm/br-menu-link.entry.js +2 -2
- package/dist/esm/br-menu-list.entry.js +2 -2
- package/dist/esm/br-menu-logo.entry.js +2 -2
- package/dist/esm/br-menu-social.entry.js +2 -2
- package/dist/esm/br-menu.entry.js +3 -3
- package/dist/esm/br-modal.entry.js +21 -5
- package/dist/esm/br-notification-body.entry.js +2 -2
- package/dist/esm/br-notification-header.entry.js +2 -2
- package/dist/esm/br-notification-item.entry.js +2 -2
- package/dist/esm/br-notification.entry.js +3 -3
- package/dist/esm/br-pagination.entry.js +4 -4
- package/dist/esm/br-radio-group.entry.js +4 -4
- package/dist/esm/br-radio.entry.js +4 -4
- package/dist/esm/br-scrim.entry.js +2 -2
- package/dist/esm/br-select-input_3.entry.js +286 -100
- package/dist/esm/br-sign-in.entry.js +8 -4
- package/dist/esm/br-skip-link-item.entry.js +1 -1
- package/dist/esm/br-skip-link.entry.js +2 -2
- package/dist/esm/br-skiplink-item.entry.js +2 -2
- package/dist/esm/br-slider.entry.js +4 -4
- package/dist/esm/br-step_2.entry.js +3 -3
- package/dist/esm/br-switch.entry.js +4 -4
- package/dist/esm/br-tab-item.entry.js +3 -3
- package/dist/esm/br-tab.entry.js +38 -13
- package/dist/esm/br-table-body.entry.js +2 -2
- package/dist/esm/br-table-cell.entry.js +2 -2
- package/dist/esm/br-table-header-cell.entry.js +2 -2
- package/dist/esm/br-table-header.entry.js +2 -2
- package/dist/esm/br-table-row.entry.js +2 -2
- package/dist/esm/br-table.entry.js +2 -2
- package/dist/esm/br-tag.entry.js +4 -4
- package/dist/esm/br-textarea.entry.js +4 -4
- package/dist/esm/br-tooltip.entry.js +3 -3
- package/dist/esm/br-upload.entry.js +5 -21
- package/dist/esm/br-wizard-panel.entry.js +2 -2
- package/dist/esm/br-wizard.entry.js +2 -2
- package/dist/esm/{datetime-picker-constants-BtRPYRvA.js → datetime-picker-constants-DDc4sADe.js} +20 -6
- package/dist/esm/{event-CfuJQ1DY.js → event-6Da1SZ3J.js} +1 -1
- package/dist/esm/format-bytes-B7bNfmgh.js +22 -0
- package/dist/esm/icon.utils-zlORkiHQ.js +43 -0
- package/dist/esm/{index-Dcn7tRST.js → index-ConyRdJe.js} +33 -27
- package/dist/esm/{index-BQPOWxe5.js → index-CytVKoHT.js} +13 -13
- package/dist/esm/index.js +2 -2
- package/dist/esm/{datetime-picker-props-validation-BeTcUTnE.js → isValid-Bee0Uvqc.js} +2 -477
- package/dist/esm/loader.js +3 -3
- package/dist/esm/select.utils-BYsh2ZdE.js +57 -0
- package/dist/esm/{validator-D3tVP32U.js → validator-BkWWrDEr.js} +18 -1
- package/dist/esm/webcomponents.js +4 -4
- package/dist/hydrate/index.js +3314 -1806
- package/dist/hydrate/index.mjs +3314 -1806
- package/dist/types/components/button/button.d.ts +2 -1
- package/dist/types/components/collapse/collapse.d.ts +6 -2
- package/dist/types/components/datetime-picker/date-picker/date-picker-locale.d.ts +9 -9
- package/dist/types/components/datetime-picker/date-picker/date-picker-props-validation.d.ts +14 -13
- package/dist/types/components/datetime-picker/date-picker/date-picker.d.ts +264 -161
- package/dist/types/components/datetime-picker/datetime-input/datetime-input-constants.d.ts +14 -0
- package/dist/types/components/datetime-picker/datetime-input/datetime-input-props-validation.d.ts +19 -15
- package/dist/types/components/datetime-picker/datetime-input/datetime-input.d.ts +229 -98
- package/dist/types/components/datetime-picker/datetime-input/datetime-input.types.d.ts +36 -0
- package/dist/types/components/datetime-picker/datetime-picker-constants.d.ts +19 -5
- package/dist/types/components/datetime-picker/datetime-picker-form-associated.d.ts +32 -5
- package/dist/types/components/datetime-picker/datetime-picker-props-validation.d.ts +22 -24
- package/dist/types/components/datetime-picker/datetime-picker.d.ts +508 -235
- package/dist/types/components/datetime-picker/datetime-picker.types.d.ts +75 -21
- package/dist/types/components/datetime-picker/datetime-picker.utils.d.ts +53 -47
- package/dist/types/components/datetime-picker/time-picker/time-picker-constants.d.ts +3 -2
- package/dist/types/components/datetime-picker/time-picker/time-picker.d.ts +126 -55
- package/dist/types/components/dropdown/dropdown.d.ts +12 -4
- package/dist/types/components/header/header.d.ts +2 -0
- package/dist/types/components/icon/icon.utils.d.ts +6 -0
- package/dist/types/components/input/input.d.ts +18 -1
- package/dist/types/components/input/input.types.d.ts +4 -0
- package/dist/types/components/item/item.d.ts +6 -1
- package/dist/types/components/magic-button/magic-button.d.ts +7 -3
- package/dist/types/components/modal/modal.d.ts +6 -0
- package/dist/types/components/pagination/pagination.d.ts +2 -0
- package/dist/types/components/select/select-input/select-input.d.ts +9 -2
- package/dist/types/components/select/select-list/select-list.d.ts +14 -2
- package/dist/types/components/select/select-option/select-option.d.ts +1 -0
- package/dist/types/components/select/select.d.ts +47 -7
- package/dist/types/components/select/select.types.d.ts +12 -0
- package/dist/types/components/select/select.utils.d.ts +3 -0
- package/dist/types/components/sign-in/sign-in.d.ts +3 -2
- package/dist/types/components/tab/tab-item/tab-item.d.ts +6 -2
- package/dist/types/components/tab/tab.d.ts +7 -0
- package/dist/types/components.d.ts +405 -318
- package/dist/types/shared/utils/form.d.ts +8 -0
- package/dist/types/stencil-public-runtime.d.ts +61 -55
- package/dist/webcomponents/index.esm.js +1 -1
- package/dist/webcomponents/p-01801ac1.entry.js +5 -0
- package/dist/webcomponents/p-05b459f2.entry.js +5 -0
- package/dist/webcomponents/p-08ac6f09.entry.js +5 -0
- package/dist/webcomponents/{p-cff24492.entry.js → p-09817344.entry.js} +1 -1
- package/dist/webcomponents/p-09c79c1d.entry.js +5 -0
- package/dist/webcomponents/p-0fc112fc.entry.js +5 -0
- package/dist/webcomponents/p-13babfc4.entry.js +5 -0
- package/dist/webcomponents/p-15022ab7.entry.js +5 -0
- package/dist/webcomponents/p-172d42c2.entry.js +5 -0
- package/dist/webcomponents/p-18cf093a.entry.js +5 -0
- package/dist/webcomponents/p-198aa844.entry.js +5 -0
- package/dist/webcomponents/p-1ba60d13.entry.js +5 -0
- package/dist/webcomponents/p-1bb96641.entry.js +5 -0
- package/dist/webcomponents/{p-7acf20d3.entry.js → p-20477061.entry.js} +1 -1
- package/dist/webcomponents/p-21feda62.entry.js +5 -0
- package/dist/webcomponents/p-23a5cfd7.entry.js +5 -0
- package/dist/webcomponents/{p-030c02f8.entry.js → p-2c8595d3.entry.js} +1 -1
- package/dist/webcomponents/{p-09770c98.entry.js → p-31a4694a.entry.js} +1 -1
- package/dist/webcomponents/p-32ea6342.entry.js +5 -0
- package/dist/webcomponents/p-3658adcf.entry.js +5 -0
- package/dist/webcomponents/p-37914e63.entry.js +5 -0
- package/dist/webcomponents/p-3b0dd0ff.entry.js +5 -0
- package/dist/webcomponents/p-42b60169.entry.js +5 -0
- package/dist/webcomponents/p-42c9c6c5.entry.js +5 -0
- package/dist/{components/p-SvVnvJdC.js → webcomponents/p-473561f2.entry.js} +1 -1
- package/dist/webcomponents/p-47c490ef.entry.js +5 -0
- package/dist/webcomponents/p-4b01c60f.entry.js +5 -0
- package/dist/webcomponents/p-5a5ed7d8.entry.js +5 -0
- package/dist/webcomponents/{p-c8b7bbab.entry.js → p-5a7c2031.entry.js} +1 -1
- package/dist/webcomponents/p-609cf652.entry.js +5 -0
- package/dist/webcomponents/p-614683d9.entry.js +5 -0
- package/dist/webcomponents/p-67605757.entry.js +5 -0
- package/dist/{components/p-CppRJiyC.js → webcomponents/p-67774920.entry.js} +1 -1
- package/dist/webcomponents/p-67d62559.entry.js +5 -0
- package/dist/webcomponents/p-695dbeb0.entry.js +5 -0
- package/dist/webcomponents/{p-CfuJQ1DY.js → p-6Da1SZ3J.js} +1 -1
- package/dist/webcomponents/p-6a293be8.entry.js +5 -0
- package/dist/webcomponents/{p-03359c92.entry.js → p-6f1a4fbe.entry.js} +1 -1
- package/dist/webcomponents/p-7352d459.entry.js +5 -0
- package/dist/webcomponents/p-745213f7.entry.js +5 -0
- package/dist/webcomponents/p-794b701b.entry.js +5 -0
- package/dist/webcomponents/{p-d826c052.entry.js → p-7ee564a1.entry.js} +1 -1
- package/dist/webcomponents/{p-e20188c0.entry.js → p-7fda8b89.entry.js} +1 -1
- package/dist/webcomponents/p-8116ee93.entry.js +5 -0
- package/dist/webcomponents/p-821341dc.entry.js +5 -0
- package/dist/webcomponents/p-8aa6f07c.entry.js +5 -0
- package/dist/webcomponents/p-8ddf3ce3.entry.js +5 -0
- package/dist/webcomponents/p-95f3c44a.entry.js +5 -0
- package/dist/webcomponents/p-96dbb585.entry.js +5 -0
- package/dist/webcomponents/p-9815ab95.entry.js +5 -0
- package/dist/webcomponents/{p-327f034f.entry.js → p-9e0324a7.entry.js} +1 -1
- package/dist/webcomponents/p-B7bNfmgh.js +5 -0
- package/dist/webcomponents/p-BYsh2ZdE.js +5 -0
- package/dist/webcomponents/p-BkWWrDEr.js +5 -0
- package/dist/webcomponents/p-CJipT0in.js +5 -0
- package/dist/webcomponents/{p-Dcn7tRST.js → p-ConyRdJe.js} +1 -1
- package/dist/webcomponents/{p-BtRPYRvA.js → p-DDc4sADe.js} +1 -1
- package/dist/webcomponents/p-a038be16.entry.js +5 -0
- package/dist/webcomponents/p-a32d17cb.entry.js +5 -0
- package/dist/webcomponents/p-a46f068e.entry.js +5 -0
- package/dist/webcomponents/p-a89b684d.entry.js +5 -0
- package/dist/webcomponents/{p-abaf2365.entry.js → p-ac68355e.entry.js} +1 -1
- package/dist/webcomponents/{p-ed5af0e4.entry.js → p-af888d13.entry.js} +1 -1
- package/dist/webcomponents/p-b0124459.entry.js +5 -0
- package/dist/webcomponents/p-b063c12f.entry.js +5 -0
- package/dist/webcomponents/p-b07bfdc5.entry.js +5 -0
- package/dist/webcomponents/{p-f558d7b9.entry.js → p-b55425b7.entry.js} +1 -1
- package/dist/webcomponents/{p-a0931550.entry.js → p-b5d25332.entry.js} +1 -1
- package/dist/webcomponents/p-b609b464.entry.js +5 -0
- package/dist/webcomponents/p-b66ab52d.entry.js +5 -0
- package/dist/webcomponents/p-b8d4ace3.entry.js +5 -0
- package/dist/webcomponents/p-c717c745.entry.js +5 -0
- package/dist/webcomponents/p-ce3d689c.entry.js +5 -0
- package/dist/webcomponents/p-d08b6266.entry.js +5 -0
- package/dist/webcomponents/p-d6165aa0.entry.js +5 -0
- package/dist/webcomponents/{p-01fb0754.entry.js → p-dacb7e2c.entry.js} +1 -1
- package/dist/webcomponents/p-db309a11.entry.js +5 -0
- package/dist/webcomponents/{p-edc6da0e.entry.js → p-dc23cb2e.entry.js} +1 -1
- package/dist/webcomponents/p-e241caf3.entry.js +5 -0
- package/dist/webcomponents/p-e661c024.entry.js +5 -0
- package/dist/webcomponents/p-e7107869.entry.js +5 -0
- package/dist/webcomponents/p-eb94199d.entry.js +5 -0
- package/dist/webcomponents/p-f8993ae4.entry.js +5 -0
- package/dist/webcomponents/{p-670e8fec.entry.js → p-f99d8c9c.entry.js} +1 -1
- package/dist/webcomponents/{p-DV-iW9Aj.js → p-fOJu6uZR.js} +1 -1
- package/dist/webcomponents/{p-a212fd85.entry.js → p-fb76b1e0.entry.js} +1 -1
- package/dist/webcomponents/p-fdcb54a3.entry.js +5 -0
- package/dist/webcomponents/{p-e3de5bb3.entry.js → p-fed02286.entry.js} +1 -1
- package/dist/webcomponents/p-zlORkiHQ.js +5 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +2 -2
- package/dist/components/p-B0o70fWP.js +0 -5
- package/dist/components/p-B96LROz9.js +0 -5
- package/dist/components/p-BDqef5-y.js +0 -5
- package/dist/components/p-BP5zMCxG.js +0 -5
- package/dist/components/p-BRaphxoP.js +0 -5
- package/dist/components/p-BUzBa9L1.js +0 -5
- package/dist/components/p-BblZlUp2.js +0 -5
- package/dist/components/p-Bc4nAk5i.js +0 -5
- package/dist/components/p-Bezou5CQ.js +0 -5
- package/dist/components/p-BrNh9KdF.js +0 -5
- package/dist/components/p-C5th2dxu.js +0 -5
- package/dist/components/p-CEdUp183.js +0 -5
- package/dist/components/p-CF7t0uxQ.js +0 -5
- package/dist/components/p-CFzHx6zV.js +0 -5
- package/dist/components/p-CG4em0S6.js +0 -5
- package/dist/components/p-CI4D3-pf.js +0 -5
- package/dist/components/p-CIrVPkVg.js +0 -5
- package/dist/components/p-CdDwqbBv.js +0 -5
- package/dist/components/p-Cvk1Ggs5.js +0 -5
- package/dist/components/p-D12US39c.js +0 -5
- package/dist/components/p-DGPJkJsj.js +0 -5
- package/dist/components/p-DX1wAFn4.js +0 -5
- package/dist/components/p-DpRZ4B0d.js +0 -5
- package/dist/components/p-G35qEQZd.js +0 -5
- package/dist/components/p-Ho_IybzR.js +0 -5
- package/dist/components/p-emAWunES.js +0 -5
- package/dist/components/p-fB79wKCm.js +0 -5
- package/dist/components/p-k7p4QJ8a.js +0 -5
- package/dist/webcomponents/p-01baafce.entry.js +0 -5
- package/dist/webcomponents/p-0b9714f1.entry.js +0 -5
- package/dist/webcomponents/p-12aa36a8.entry.js +0 -5
- package/dist/webcomponents/p-130b6e06.entry.js +0 -5
- package/dist/webcomponents/p-144f8c8d.entry.js +0 -5
- package/dist/webcomponents/p-14fe22e2.entry.js +0 -5
- package/dist/webcomponents/p-1ff9210a.entry.js +0 -5
- package/dist/webcomponents/p-2605cdc3.entry.js +0 -5
- package/dist/webcomponents/p-27afaec9.entry.js +0 -5
- package/dist/webcomponents/p-2a50e42d.entry.js +0 -5
- package/dist/webcomponents/p-342650b8.entry.js +0 -5
- package/dist/webcomponents/p-38f6a78b.entry.js +0 -5
- package/dist/webcomponents/p-3920fe3a.entry.js +0 -5
- package/dist/webcomponents/p-3ae97345.entry.js +0 -5
- package/dist/webcomponents/p-3cce767c.entry.js +0 -5
- package/dist/webcomponents/p-3df6c5d2.entry.js +0 -5
- package/dist/webcomponents/p-3e287899.entry.js +0 -5
- package/dist/webcomponents/p-3e5580ba.entry.js +0 -5
- package/dist/webcomponents/p-403637dd.entry.js +0 -5
- package/dist/webcomponents/p-435c8ef2.entry.js +0 -5
- package/dist/webcomponents/p-59da5b55.entry.js +0 -5
- package/dist/webcomponents/p-5dd4314c.entry.js +0 -5
- package/dist/webcomponents/p-646af6a5.entry.js +0 -5
- package/dist/webcomponents/p-68046544.entry.js +0 -5
- package/dist/webcomponents/p-68ec76b8.entry.js +0 -5
- package/dist/webcomponents/p-6c0ea20c.entry.js +0 -5
- package/dist/webcomponents/p-707df9b9.entry.js +0 -5
- package/dist/webcomponents/p-72b839fe.entry.js +0 -5
- package/dist/webcomponents/p-73dcc05b.entry.js +0 -5
- package/dist/webcomponents/p-7b01bddb.entry.js +0 -5
- package/dist/webcomponents/p-7cd38850.entry.js +0 -5
- package/dist/webcomponents/p-82454383.entry.js +0 -5
- package/dist/webcomponents/p-91e959a8.entry.js +0 -5
- package/dist/webcomponents/p-964c01e6.entry.js +0 -5
- package/dist/webcomponents/p-9858e42a.entry.js +0 -5
- package/dist/webcomponents/p-9c4200b0.entry.js +0 -5
- package/dist/webcomponents/p-9d9c87b1.entry.js +0 -5
- package/dist/webcomponents/p-B0PbhaxL.js +0 -5
- package/dist/webcomponents/p-D3tVP32U.js +0 -5
- package/dist/webcomponents/p-a2e75143.entry.js +0 -5
- package/dist/webcomponents/p-a3bb98c9.entry.js +0 -5
- package/dist/webcomponents/p-a8b5dba0.entry.js +0 -5
- package/dist/webcomponents/p-aa909443.entry.js +0 -5
- package/dist/webcomponents/p-aeb16645.entry.js +0 -5
- package/dist/webcomponents/p-b287c384.entry.js +0 -5
- package/dist/webcomponents/p-b506b0a1.entry.js +0 -5
- package/dist/webcomponents/p-b520c08c.entry.js +0 -5
- package/dist/webcomponents/p-b94c3f84.entry.js +0 -5
- package/dist/webcomponents/p-bda62f90.entry.js +0 -5
- package/dist/webcomponents/p-c201ae16.entry.js +0 -5
- package/dist/webcomponents/p-c7e899a1.entry.js +0 -5
- package/dist/webcomponents/p-cbf3e251.entry.js +0 -5
- package/dist/webcomponents/p-d35cf5b4.entry.js +0 -5
- package/dist/webcomponents/p-d45ffe9c.entry.js +0 -5
- package/dist/webcomponents/p-d719a4af.entry.js +0 -5
- package/dist/webcomponents/p-da21a60d.entry.js +0 -5
- package/dist/webcomponents/p-de0c7f26.entry.js +0 -5
- package/dist/webcomponents/p-e27882e1.entry.js +0 -5
- package/dist/webcomponents/p-e624ff04.entry.js +0 -5
- package/dist/webcomponents/p-f24fcf3d.entry.js +0 -5
- package/dist/webcomponents/p-f52ef0dc.entry.js +0 -5
- package/dist/webcomponents/p-fcab1428.entry.js +0 -5
- package/dist/webcomponents/p-fe1729a7.entry.js +0 -5
|
@@ -12,7 +12,7 @@ import { reportInvalidPropValue } from "../../shared/utils/prop-warning";
|
|
|
12
12
|
import { resolveAllowedPropValue, resolveDensity, resolveIntegerPropValue, resolveNumberPropValue, } from "../../shared/utils/props";
|
|
13
13
|
import { hasAssignedSlotContent, hasNamedLightDomSlot } from "../../shared/utils/slot";
|
|
14
14
|
import { resolveFormValidator } from "../../shared/utils/validator";
|
|
15
|
-
import { transitionAllSelection, transitionSelection } from "./select.utils";
|
|
15
|
+
import { filterSelectOptions, SELECT_ALL_OPTION_VALUE, transitionAllSelection, transitionSelection, } from "./select.utils";
|
|
16
16
|
const SELECT_SEARCH_MODES = ['local', 'remote'];
|
|
17
17
|
const SELECT_AUTOCOMPLETE_VALUES = ['on', 'off'];
|
|
18
18
|
/**
|
|
@@ -27,6 +27,20 @@ const SELECT_AUTOCOMPLETE_VALUES = ['on', 'off'];
|
|
|
27
27
|
* - **Integração com formulários:** É associado a formulários nativos (`formAssociated`), comunicando seu valor, estado de validação (válido/inválido), mensagens de erro contextuais e eventos padrão (`change`, `input`).
|
|
28
28
|
* - **Navegação acessível:** Suporta controle total via teclado (setas para cima/baixo, Enter, Escape, Home, End), foco gerenciado e anúncios para leitores de tela.
|
|
29
29
|
*
|
|
30
|
+
* ### Navegação por teclado
|
|
31
|
+
*
|
|
32
|
+
* O foco permanece no campo `combobox` enquanto a lista está aberta; a opção em destaque é comunicada por `aria-activedescendant`.
|
|
33
|
+
* Ao receber foco, o campo abre a lista sem alterar a seleção atual.
|
|
34
|
+
*
|
|
35
|
+
* - **ArrowDown / ArrowUp:** abre a lista e destaca a próxima opção na direção pressionada; com a lista aberta, move o destaque sem mover o foco físico.
|
|
36
|
+
* - **Home / End:** em modo não filtrável, destaca a primeira ou a última opção habilitada; em modo filtrável, preserva o movimento do cursor no texto.
|
|
37
|
+
* - **Enter:** abre a lista quando fechada e confirma a opção destacada quando aberta.
|
|
38
|
+
* - **Espaço:** confirma a opção destacada em modo não filtrável; em modo filtrável, insere um espaço no campo de busca.
|
|
39
|
+
* - **Escape:** fecha a lista, remove o destaque e devolve o foco ao campo.
|
|
40
|
+
* - **Tab:** fecha a lista e deixa o navegador mover o foco para o próximo controle, sem alterar a seleção implicitamente.
|
|
41
|
+
* - **Busca incremental:** em modo não filtrável, caracteres consecutivos destacam a primeira opção habilitada correspondente; em modo filtrável, a digitação filtra a lista.
|
|
42
|
+
* - **Alt+ArrowDown / Alt+ArrowUp:** abre ou fecha a lista sem alterar a seleção.
|
|
43
|
+
*
|
|
30
44
|
* ### Quando utilizar
|
|
31
45
|
*
|
|
32
46
|
* - **Utilize quando:**
|
|
@@ -143,6 +157,7 @@ export class Select {
|
|
|
143
157
|
/**
|
|
144
158
|
* Define a densidade visual compartilhada pelo campo e pela lista de opções.
|
|
145
159
|
* Aceita `small`, `medium` ou `large`. Valores inválidos usam `medium`.
|
|
160
|
+
* A opção sintética de selecionar todos permanece com densidade `small`.
|
|
146
161
|
*
|
|
147
162
|
* @default 'medium'
|
|
148
163
|
*/
|
|
@@ -198,6 +213,11 @@ export class Select {
|
|
|
198
213
|
* @default 1
|
|
199
214
|
*/
|
|
200
215
|
this.overscan = 1;
|
|
216
|
+
/**
|
|
217
|
+
* Oculta os divisores entre opções consecutivas, sem alterar a altura das linhas.
|
|
218
|
+
* @default false
|
|
219
|
+
*/
|
|
220
|
+
this.hideDividers = false;
|
|
201
221
|
/**
|
|
202
222
|
* Controla o estado aberto/fechado da lista.
|
|
203
223
|
*
|
|
@@ -292,6 +312,8 @@ export class Select {
|
|
|
292
312
|
/** Quantidade máxima de opções selecionadas no modo múltiplo. Deve ser um inteiro não negativo; valores inválidos usam 0. */
|
|
293
313
|
this.maxSelections = 0;
|
|
294
314
|
this.shouldRestoreSelectedOptionOnOpen = false;
|
|
315
|
+
this.isSelectInputPointerDown = false;
|
|
316
|
+
this.skipSelectInputClickToggle = false;
|
|
295
317
|
this.pendingOptions = null;
|
|
296
318
|
this.slotElement = null;
|
|
297
319
|
this.handleSlotChange = () => this.slotReconciler.schedule();
|
|
@@ -300,7 +322,15 @@ export class Select {
|
|
|
300
322
|
this.isStateChangeReady = false;
|
|
301
323
|
this.isValueChangeReady = false;
|
|
302
324
|
this.listboxId = `${this.customId}-listbox`;
|
|
325
|
+
this.checkingValidity = false;
|
|
326
|
+
this.showValidationErrors = false;
|
|
327
|
+
this.validationErrorMessage = '';
|
|
303
328
|
this.activeOptionIndex = -1;
|
|
329
|
+
/**
|
|
330
|
+
* Oculta o indicador visual da opção ativa após interação por ponteiro, como `:focus-visible`.
|
|
331
|
+
* O índice ativo e o `aria-activedescendant` são preservados; o teclado volta a exibi-lo.
|
|
332
|
+
*/
|
|
333
|
+
this.isActiveIndicatorHidden = false;
|
|
304
334
|
this.searchTerm = '';
|
|
305
335
|
this.formDisabled = false;
|
|
306
336
|
this.isValidating = false;
|
|
@@ -316,8 +346,9 @@ export class Select {
|
|
|
316
346
|
this.hasImperativeOptions = false;
|
|
317
347
|
this.remoteSelectedOptions = new Map();
|
|
318
348
|
this.selectionInitialized = false;
|
|
349
|
+
this.typeAhead = '';
|
|
350
|
+
this.lastTypeAheadTime = 0;
|
|
319
351
|
this.selectedValues = [];
|
|
320
|
-
this.suppressFocusOpen = false;
|
|
321
352
|
/**
|
|
322
353
|
* Sincroniza as opções declaradas no slot com a lista interna renderizada.
|
|
323
354
|
*
|
|
@@ -341,6 +372,8 @@ export class Select {
|
|
|
341
372
|
this.formDisabled = disabled;
|
|
342
373
|
}
|
|
343
374
|
formResetCallback() {
|
|
375
|
+
this.showValidationErrors = false;
|
|
376
|
+
this.validationErrorMessage = '';
|
|
344
377
|
this.validationRunId++;
|
|
345
378
|
this.validatorMessage = null;
|
|
346
379
|
this.customValidationMessage = '';
|
|
@@ -476,7 +509,7 @@ export class Select {
|
|
|
476
509
|
const anySelected = selectable.some((option) => Boolean(option.selected));
|
|
477
510
|
return [
|
|
478
511
|
{
|
|
479
|
-
value:
|
|
512
|
+
value: SELECT_ALL_OPTION_VALUE,
|
|
480
513
|
label: allSelected ? this.unselectAllLabel : this.selectAllLabel,
|
|
481
514
|
selected: allSelected,
|
|
482
515
|
indeterminate: anySelected && !allSelected,
|
|
@@ -554,14 +587,33 @@ export class Select {
|
|
|
554
587
|
this.cleanupBlockingSurfaceDismissal?.();
|
|
555
588
|
this.cleanupBlockingSurfaceDismissal = undefined;
|
|
556
589
|
}
|
|
590
|
+
handleSelectFocusOut(event) {
|
|
591
|
+
if (!this.getEventPath(event).includes(this.selectInputElement))
|
|
592
|
+
return;
|
|
593
|
+
// Aguarda o foco atravessar os Shadow Roots antes de decidir se saiu do select.
|
|
594
|
+
queueMicrotask(() => {
|
|
595
|
+
if (!this.el.isConnected || this.el.matches(':focus-within') || this.isDisabled())
|
|
596
|
+
return;
|
|
597
|
+
void this.validate();
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
handleSelectInvalid(event) {
|
|
601
|
+
if (event.target !== this.el || this.checkingValidity)
|
|
602
|
+
return;
|
|
603
|
+
this.showValidationErrors = true;
|
|
604
|
+
void this.syncComboboxAccessibility();
|
|
605
|
+
}
|
|
557
606
|
handleSelectInputFocus() {
|
|
558
|
-
this.
|
|
559
|
-
if (this.suppressFocusOpen)
|
|
607
|
+
if (this.effectiveOpen)
|
|
560
608
|
return;
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
609
|
+
this.activeOptionIndex = -1;
|
|
610
|
+
this.skipSelectInputClickToggle = this.isSelectInputPointerDown;
|
|
611
|
+
void this.show();
|
|
612
|
+
}
|
|
613
|
+
handleSelectPointerDown(event) {
|
|
614
|
+
this.isActiveIndicatorHidden = true;
|
|
615
|
+
this.skipSelectInputClickToggle = false;
|
|
616
|
+
this.isSelectInputPointerDown = this.getEventPath(event).includes(this.selectInputElement);
|
|
565
617
|
}
|
|
566
618
|
handleSelectInputValueChange(event) {
|
|
567
619
|
if (!this.filterable || this.isDisabled())
|
|
@@ -581,21 +633,27 @@ export class Select {
|
|
|
581
633
|
}
|
|
582
634
|
}
|
|
583
635
|
handleSelectInputActionClick() {
|
|
636
|
+
// O botão de ação fica dentro do campo: o foco do mesmo clique já abriu a lista.
|
|
637
|
+
if (this.consumeFocusOpenClick())
|
|
638
|
+
return;
|
|
584
639
|
this.toggleOpenFromPointer();
|
|
585
640
|
}
|
|
586
641
|
handleSelectInputClick() {
|
|
642
|
+
if (this.consumeFocusOpenClick())
|
|
643
|
+
return;
|
|
587
644
|
if (this.filterable) {
|
|
588
|
-
if (!this.effectiveOpen)
|
|
589
|
-
this.shouldRestoreSelectedOptionOnOpen = true;
|
|
645
|
+
if (!this.effectiveOpen)
|
|
590
646
|
void this.show();
|
|
591
|
-
}
|
|
592
647
|
return;
|
|
593
648
|
}
|
|
594
|
-
this.
|
|
649
|
+
this.shouldRestoreSelectedOptionOnOpen = true;
|
|
650
|
+
void this.toggleOpenFromPointer();
|
|
595
651
|
}
|
|
596
|
-
handleSelectOptionStateChange(event) {
|
|
652
|
+
handleSelectOptionStateChange(event, restoreFocus = true) {
|
|
597
653
|
event.stopPropagation();
|
|
598
654
|
const detail = event.detail;
|
|
655
|
+
if (detail.disabled)
|
|
656
|
+
return;
|
|
599
657
|
// Use a lista interna para preservar rótulos e opções remotas enquanto as
|
|
600
658
|
// props projetadas aguardam a próxima renderização.
|
|
601
659
|
const listOptions = this.getSelectListController()?.options;
|
|
@@ -608,9 +666,9 @@ export class Select {
|
|
|
608
666
|
// partir do valor do evento evita que esse snapshot reapareça no valor
|
|
609
667
|
// público ou no formulário.
|
|
610
668
|
const selectableValues = sourceOptions
|
|
611
|
-
.filter((option) => !this.
|
|
669
|
+
.filter((option) => !this.isSelectAllOption(option) && !option.disabled)
|
|
612
670
|
.map((option) => option.value);
|
|
613
|
-
const transition = this.
|
|
671
|
+
const transition = this.isSelectAllOption(detail)
|
|
614
672
|
? transitionAllSelection(this.selectedValues, Boolean(detail.selected), selectableValues)
|
|
615
673
|
: transitionSelection({
|
|
616
674
|
currentValues: this.selectedValues,
|
|
@@ -629,15 +687,12 @@ export class Select {
|
|
|
629
687
|
this.syncActiveOptionIndex(event.detail);
|
|
630
688
|
this.emitStateChange(detail);
|
|
631
689
|
this.updateValidity();
|
|
632
|
-
if (!
|
|
633
|
-
return;
|
|
634
|
-
if (!this.effectiveMultiple) {
|
|
635
|
-
this.suppressFocusOpen = true;
|
|
690
|
+
if (!this.effectiveMultiple && restoreFocus) {
|
|
636
691
|
void this.selectInputElement?.setFocus?.();
|
|
637
|
-
void this.close()
|
|
638
|
-
this.suppressFocusOpen = false;
|
|
639
|
-
});
|
|
692
|
+
void this.close();
|
|
640
693
|
}
|
|
694
|
+
if (!transition.changed)
|
|
695
|
+
return;
|
|
641
696
|
dispatchNativeFormEvent(this.el, 'input');
|
|
642
697
|
dispatchNativeFormEvent(this.el, 'change');
|
|
643
698
|
}
|
|
@@ -663,13 +718,31 @@ export class Select {
|
|
|
663
718
|
}
|
|
664
719
|
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: centraliza a navegação por teclado do componente.
|
|
665
720
|
async handleKeyDown(event) {
|
|
666
|
-
if (this.isDisabled())
|
|
721
|
+
if (this.isDisabled() || event.isComposing)
|
|
667
722
|
return;
|
|
668
723
|
const path = this.getEventPath(event);
|
|
669
724
|
const isFromInput = path.includes(this.selectInputElement);
|
|
670
725
|
const isFromList = path.includes(this.selectListElement);
|
|
671
726
|
if (!isFromInput && !isFromList)
|
|
672
727
|
return;
|
|
728
|
+
this.isActiveIndicatorHidden = false;
|
|
729
|
+
if (event.altKey && event.key === 'ArrowDown') {
|
|
730
|
+
if (!this.effectiveOpen) {
|
|
731
|
+
event.preventDefault();
|
|
732
|
+
await this.show();
|
|
733
|
+
}
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
if (event.altKey && event.key === 'ArrowUp') {
|
|
737
|
+
if (this.effectiveOpen) {
|
|
738
|
+
event.preventDefault();
|
|
739
|
+
await this.close();
|
|
740
|
+
this.activeOptionIndex = -1;
|
|
741
|
+
}
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
if (event.altKey || event.ctrlKey || event.metaKey)
|
|
745
|
+
return;
|
|
673
746
|
switch (event.key) {
|
|
674
747
|
case 'ArrowDown':
|
|
675
748
|
event.preventDefault();
|
|
@@ -680,29 +753,39 @@ export class Select {
|
|
|
680
753
|
await this.openAndFocusBoundary(isFromInput, -1);
|
|
681
754
|
return;
|
|
682
755
|
case 'Home':
|
|
683
|
-
if (
|
|
756
|
+
if (isFromInput && this.filterable)
|
|
684
757
|
return;
|
|
685
758
|
event.preventDefault();
|
|
686
|
-
|
|
759
|
+
if (!this.effectiveOpen)
|
|
760
|
+
await this.show();
|
|
761
|
+
await this.focusOptionByIndex(this.getNavigableOptions().findIndex((option) => !option.disabled));
|
|
687
762
|
return;
|
|
688
763
|
case 'End':
|
|
689
|
-
if (
|
|
764
|
+
if (isFromInput && this.filterable)
|
|
690
765
|
return;
|
|
691
766
|
event.preventDefault();
|
|
692
|
-
|
|
767
|
+
if (!this.effectiveOpen)
|
|
768
|
+
await this.show();
|
|
769
|
+
await this.focusOptionByIndex(this.getNavigableOptions()
|
|
770
|
+
.map((option) => !option.disabled)
|
|
771
|
+
.lastIndexOf(true), true);
|
|
693
772
|
return;
|
|
694
773
|
case 'Enter':
|
|
695
774
|
case ' ':
|
|
696
775
|
if (isFromInput && this.filterable && event.key === ' ') {
|
|
697
776
|
return;
|
|
698
777
|
}
|
|
699
|
-
|
|
778
|
+
// No campo editável fechado, Enter mantém a ação nativa do formulário.
|
|
779
|
+
if (isFromInput && this.filterable && event.key === 'Enter' && !this.effectiveOpen)
|
|
700
780
|
return;
|
|
701
|
-
}
|
|
702
781
|
event.preventDefault();
|
|
703
782
|
if (!this.effectiveOpen) {
|
|
704
783
|
await this.show();
|
|
705
|
-
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
if (this.activeOptionIndex < 0) {
|
|
787
|
+
await this.close();
|
|
788
|
+
this.activeOptionIndex = -1;
|
|
706
789
|
return;
|
|
707
790
|
}
|
|
708
791
|
await this.selectFocusedOption();
|
|
@@ -722,6 +805,10 @@ export class Select {
|
|
|
722
805
|
this.activeOptionIndex = -1;
|
|
723
806
|
return;
|
|
724
807
|
default:
|
|
808
|
+
if (!this.filterable && event.key.length === 1 && event.key !== ' ') {
|
|
809
|
+
event.preventDefault();
|
|
810
|
+
await this.focusOptionByTypedCharacters(event.key);
|
|
811
|
+
}
|
|
725
812
|
return;
|
|
726
813
|
}
|
|
727
814
|
}
|
|
@@ -769,6 +856,7 @@ export class Select {
|
|
|
769
856
|
this.open = false;
|
|
770
857
|
else
|
|
771
858
|
this.isOpen = false;
|
|
859
|
+
this.typeAhead = '';
|
|
772
860
|
this.clearSearch();
|
|
773
861
|
}
|
|
774
862
|
/**
|
|
@@ -817,9 +905,18 @@ export class Select {
|
|
|
817
905
|
await this.selectInputElement?.setFocus?.();
|
|
818
906
|
}
|
|
819
907
|
async checkValidity() {
|
|
820
|
-
|
|
908
|
+
this.checkingValidity = true;
|
|
909
|
+
try {
|
|
910
|
+
return this.elementInternals?.checkValidity?.() ?? true;
|
|
911
|
+
}
|
|
912
|
+
finally {
|
|
913
|
+
this.checkingValidity = false;
|
|
914
|
+
}
|
|
821
915
|
}
|
|
822
916
|
async reportValidity() {
|
|
917
|
+
this.showValidationErrors = true;
|
|
918
|
+
this.updateValidity();
|
|
919
|
+
await this.syncComboboxAccessibility();
|
|
823
920
|
return this.elementInternals?.reportValidity?.() ?? true;
|
|
824
921
|
}
|
|
825
922
|
async setCustomValidity(message) {
|
|
@@ -830,6 +927,9 @@ export class Select {
|
|
|
830
927
|
return getFormValidationState(this.elementInternals);
|
|
831
928
|
}
|
|
832
929
|
async validate() {
|
|
930
|
+
this.showValidationErrors = true;
|
|
931
|
+
this.updateValidity();
|
|
932
|
+
await this.syncComboboxAccessibility();
|
|
833
933
|
const validator = this.resolveValidator();
|
|
834
934
|
if (!validator || this.isDisabled())
|
|
835
935
|
return this.checkValidity();
|
|
@@ -936,11 +1036,19 @@ export class Select {
|
|
|
936
1036
|
const inner = this.extractInnerTextFromOption(el);
|
|
937
1037
|
const content = (el.innerHTML || '').trim();
|
|
938
1038
|
const selected = el.hasAttribute('selected') || Boolean(el.selected);
|
|
1039
|
+
const disabled = el.hasAttribute('disabled') || Boolean(el.disabled);
|
|
939
1040
|
if (!value && inner)
|
|
940
1041
|
value = inner.trim();
|
|
941
1042
|
if (!label)
|
|
942
1043
|
label = inner?.trim() || value;
|
|
943
|
-
return {
|
|
1044
|
+
return {
|
|
1045
|
+
value: value || '',
|
|
1046
|
+
label: label || undefined,
|
|
1047
|
+
group,
|
|
1048
|
+
selected,
|
|
1049
|
+
disabled,
|
|
1050
|
+
content: content || undefined,
|
|
1051
|
+
};
|
|
944
1052
|
}
|
|
945
1053
|
getOptionElementGroup(el) {
|
|
946
1054
|
return String(el.getAttribute('group') ?? el.group ?? '').trim() || undefined;
|
|
@@ -1142,6 +1250,7 @@ export class Select {
|
|
|
1142
1250
|
: '';
|
|
1143
1251
|
nativeSelect.setCustomValidity(this.customValidationMessage || this.validatorMessage || selectionMessage);
|
|
1144
1252
|
syncNativeFormValidity(this.elementInternals, nativeSelect);
|
|
1253
|
+
void this.syncComboboxAccessibility();
|
|
1145
1254
|
}
|
|
1146
1255
|
getNativeSelect() {
|
|
1147
1256
|
return (this.el.shadowRoot?.querySelector('select[part="hidden-select"]') ??
|
|
@@ -1158,10 +1267,38 @@ export class Select {
|
|
|
1158
1267
|
*
|
|
1159
1268
|
* @returns O id da opção ativa ou `undefined` quando a lista está fechada.
|
|
1160
1269
|
*/
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1270
|
+
async syncComboboxAccessibility() {
|
|
1271
|
+
const nativeSelect = this.getNativeSelect();
|
|
1272
|
+
const invalid = this.showValidationErrors && Boolean(nativeSelect && !nativeSelect.validity.valid);
|
|
1273
|
+
const errorMessage = !invalid
|
|
1274
|
+
? ''
|
|
1275
|
+
: nativeSelect?.validity.customError
|
|
1276
|
+
? nativeSelect.validationMessage
|
|
1277
|
+
: nativeSelect?.validity.valueMissing
|
|
1278
|
+
? 'Este campo é obrigatório.'
|
|
1279
|
+
: nativeSelect?.validationMessage || '';
|
|
1280
|
+
this.validationErrorMessage = errorMessage;
|
|
1281
|
+
await this.selectInputElement?.syncCombobox?.({
|
|
1282
|
+
options: this.getNavigableOptions(),
|
|
1283
|
+
activeIndex: this.effectiveOpen ? this.activeOptionIndex : -1,
|
|
1284
|
+
expanded: this.effectiveOpen,
|
|
1285
|
+
multiple: this.effectiveMultiple,
|
|
1286
|
+
label: this.getAccessibleLabel(),
|
|
1287
|
+
loading: this.loading,
|
|
1288
|
+
required: this.required,
|
|
1289
|
+
invalid,
|
|
1290
|
+
errorMessage,
|
|
1291
|
+
});
|
|
1292
|
+
}
|
|
1293
|
+
/**
|
|
1294
|
+
* Indica se o clique atual foi o mesmo que deu foco ao campo e abriu a lista,
|
|
1295
|
+
* limpando o estado do ponteiro. Esse clique não deve alternar a lista de novo.
|
|
1296
|
+
*/
|
|
1297
|
+
consumeFocusOpenClick() {
|
|
1298
|
+
const skip = this.skipSelectInputClickToggle;
|
|
1299
|
+
this.skipSelectInputClickToggle = false;
|
|
1300
|
+
this.isSelectInputPointerDown = false;
|
|
1301
|
+
return skip;
|
|
1165
1302
|
}
|
|
1166
1303
|
toggleOpenFromPointer() {
|
|
1167
1304
|
if (!this.effectiveOpen) {
|
|
@@ -1189,6 +1326,7 @@ export class Select {
|
|
|
1189
1326
|
async openAndFocusBoundary(fromInput, direction) {
|
|
1190
1327
|
if (!this.effectiveOpen) {
|
|
1191
1328
|
await this.show();
|
|
1329
|
+
await this.selectListElement?.open?.();
|
|
1192
1330
|
await this.focusInitialOption(direction);
|
|
1193
1331
|
return;
|
|
1194
1332
|
}
|
|
@@ -1198,17 +1336,55 @@ export class Select {
|
|
|
1198
1336
|
}
|
|
1199
1337
|
await this.moveActiveOption(direction);
|
|
1200
1338
|
}
|
|
1339
|
+
async focusOptionByTypedCharacters(character) {
|
|
1340
|
+
const now = Date.now();
|
|
1341
|
+
this.typeAhead = now - this.lastTypeAheadTime < 700 ? this.typeAhead + character : character;
|
|
1342
|
+
this.lastTypeAheadTime = now;
|
|
1343
|
+
const options = this.getNavigableOptions();
|
|
1344
|
+
if (!options.length)
|
|
1345
|
+
return;
|
|
1346
|
+
const normalize = (value) => value
|
|
1347
|
+
.normalize('NFD')
|
|
1348
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
1349
|
+
.toLocaleLowerCase('pt-BR');
|
|
1350
|
+
const search = (query) => {
|
|
1351
|
+
for (let offset = 1; offset <= options.length; offset++) {
|
|
1352
|
+
const index = (this.activeOptionIndex + offset + options.length) % options.length;
|
|
1353
|
+
const option = options[index];
|
|
1354
|
+
if (!option.disabled && normalize(this.getOptionLabel(option)).startsWith(normalize(query)))
|
|
1355
|
+
return index;
|
|
1356
|
+
}
|
|
1357
|
+
return -1;
|
|
1358
|
+
};
|
|
1359
|
+
let index = search(this.typeAhead);
|
|
1360
|
+
if (index < 0 && /^(.)(\1)+$/u.test(this.typeAhead))
|
|
1361
|
+
index = search(character);
|
|
1362
|
+
if (index < 0)
|
|
1363
|
+
return;
|
|
1364
|
+
if (!this.effectiveOpen)
|
|
1365
|
+
await this.show();
|
|
1366
|
+
await this.focusOptionByIndex(index);
|
|
1367
|
+
}
|
|
1201
1368
|
/**
|
|
1202
|
-
* Define qual opção deve receber foco ao abrir
|
|
1369
|
+
* Define qual opção deve receber foco ao abrir ou iniciar a navegação pelo teclado.
|
|
1203
1370
|
*
|
|
1204
|
-
* @param direction Direção inicial da navegação. `1`
|
|
1371
|
+
* @param direction Direção inicial da navegação. `1` avança e `-1` recua.
|
|
1205
1372
|
*/
|
|
1206
1373
|
async focusInitialOption(direction) {
|
|
1207
1374
|
const options = this.getNavigableOptions();
|
|
1208
1375
|
if (options.length === 0)
|
|
1209
1376
|
return;
|
|
1210
|
-
const selectedIndex = options.findIndex((option) => Boolean(option.selected));
|
|
1211
|
-
|
|
1377
|
+
const selectedIndex = options.findIndex((option) => !option.disabled && !this.isSelectAllOption(option) && Boolean(option.selected));
|
|
1378
|
+
if (selectedIndex >= 0) {
|
|
1379
|
+
let nextIndex = selectedIndex + direction;
|
|
1380
|
+
while (nextIndex >= 0 && nextIndex < options.length && options[nextIndex].disabled)
|
|
1381
|
+
nextIndex += direction;
|
|
1382
|
+
await this.focusOptionByIndex(nextIndex >= 0 && nextIndex < options.length ? nextIndex : selectedIndex, true);
|
|
1383
|
+
return;
|
|
1384
|
+
}
|
|
1385
|
+
const fallbackIndex = direction > 0
|
|
1386
|
+
? options.findIndex((option) => !option.disabled)
|
|
1387
|
+
: options.map((option) => !option.disabled).lastIndexOf(true);
|
|
1212
1388
|
const initialIndex = selectedIndex >= 0 ? selectedIndex : fallbackIndex;
|
|
1213
1389
|
await this.focusOptionByIndex(initialIndex);
|
|
1214
1390
|
}
|
|
@@ -1217,8 +1393,11 @@ export class Select {
|
|
|
1217
1393
|
if (options.length === 0)
|
|
1218
1394
|
return;
|
|
1219
1395
|
const baseIndex = this.getCurrentActiveIndex();
|
|
1220
|
-
|
|
1221
|
-
|
|
1396
|
+
let nextIndex = baseIndex + step;
|
|
1397
|
+
while (nextIndex >= 0 && nextIndex < options.length && options[nextIndex].disabled)
|
|
1398
|
+
nextIndex += step;
|
|
1399
|
+
if (nextIndex >= 0 && nextIndex < options.length)
|
|
1400
|
+
await this.focusOptionByIndex(nextIndex);
|
|
1222
1401
|
}
|
|
1223
1402
|
/**
|
|
1224
1403
|
* Resolve o índice ativo atual a partir do estado local ou da opção já selecionada.
|
|
@@ -1229,47 +1408,45 @@ export class Select {
|
|
|
1229
1408
|
if (this.activeOptionIndex >= 0)
|
|
1230
1409
|
return this.activeOptionIndex;
|
|
1231
1410
|
const options = this.getNavigableOptions();
|
|
1232
|
-
const selectedIndex = options.findIndex((option) => Boolean(option.selected));
|
|
1411
|
+
const selectedIndex = options.findIndex((option) => !option.disabled && !this.isSelectAllOption(option) && Boolean(option.selected));
|
|
1233
1412
|
return selectedIndex >= 0 ? selectedIndex : 0;
|
|
1234
1413
|
}
|
|
1235
1414
|
/**
|
|
1236
1415
|
* Encaminha o foco lógico para uma opção específica da lista interna.
|
|
1237
1416
|
*
|
|
1238
1417
|
* @param index Índice da opção que deve receber foco.
|
|
1418
|
+
* @param scrollToTop Posiciona a opção no topo da viewport quando verdadeiro.
|
|
1239
1419
|
*/
|
|
1240
|
-
async focusOptionByIndex(index) {
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1420
|
+
async focusOptionByIndex(index, scrollToTop = false) {
|
|
1421
|
+
if (!this.getNavigableOptions()[index] || this.getNavigableOptions()[index].disabled)
|
|
1422
|
+
return;
|
|
1423
|
+
this.activeOptionIndex = index;
|
|
1424
|
+
const listController = this.getSelectListController();
|
|
1425
|
+
if (scrollToTop)
|
|
1426
|
+
await listController?.scrollOptionToTop?.(index);
|
|
1427
|
+
else
|
|
1428
|
+
await listController?.revealOption?.(index);
|
|
1245
1429
|
}
|
|
1246
1430
|
/**
|
|
1247
1431
|
* Seleciona a opção atualmente ativa sem duplicar a lógica de seleção da lista.
|
|
1248
1432
|
*
|
|
1249
1433
|
* @remarks
|
|
1250
|
-
* Em modo simples, a opção ativa
|
|
1434
|
+
* Em modo simples, confirma a opção ativa; no múltiplo, alterna sua seleção.
|
|
1251
1435
|
*/
|
|
1252
|
-
async selectFocusedOption() {
|
|
1436
|
+
async selectFocusedOption(restoreFocus = true) {
|
|
1253
1437
|
const options = this.getNavigableOptions();
|
|
1254
1438
|
if (options.length === 0)
|
|
1255
1439
|
return;
|
|
1256
|
-
const index = this.
|
|
1440
|
+
const index = this.activeOptionIndex;
|
|
1257
1441
|
const option = options[index];
|
|
1258
|
-
|
|
1259
|
-
if (this.effectiveMultiple && index === 0 && option && !this.isSelectAllLabel(this.getOptionLabel(option))) {
|
|
1260
|
-
this.handleSelectOptionStateChange(new CustomEvent('brSelectOptionStateChange', {
|
|
1261
|
-
detail: {
|
|
1262
|
-
value: '__select_all__',
|
|
1263
|
-
label: this.selectAllLabel,
|
|
1264
|
-
selected: true,
|
|
1265
|
-
disabled: false,
|
|
1266
|
-
},
|
|
1267
|
-
}));
|
|
1442
|
+
if (!option || option.disabled)
|
|
1268
1443
|
return;
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1444
|
+
this.handleSelectOptionStateChange(new CustomEvent('brSelectOptionStateChange', {
|
|
1445
|
+
detail: { ...option, selected: this.effectiveMultiple ? !option.selected : true },
|
|
1446
|
+
}), restoreFocus);
|
|
1447
|
+
if (!this.effectiveMultiple && restoreFocus) {
|
|
1448
|
+
await this.close();
|
|
1449
|
+
await this.selectInputElement?.setFocus();
|
|
1273
1450
|
}
|
|
1274
1451
|
}
|
|
1275
1452
|
syncActiveOptionIndex(detail) {
|
|
@@ -1304,13 +1481,13 @@ export class Select {
|
|
|
1304
1481
|
if (!this.effectiveMultiple)
|
|
1305
1482
|
return;
|
|
1306
1483
|
const selectableOptions = slottedOptions.filter((option) => {
|
|
1307
|
-
const optionLabel = (option.label ?? option.value).trim();
|
|
1484
|
+
const optionLabel = (option.label ?? option.value ?? '').trim();
|
|
1308
1485
|
return !this.isSelectAllLabel(optionLabel);
|
|
1309
1486
|
});
|
|
1310
1487
|
const allSelected = selectableOptions.length > 0 && selectableOptions.every((option) => Boolean(option.selected));
|
|
1311
1488
|
const anySelected = selectableOptions.some((option) => Boolean(option.selected));
|
|
1312
1489
|
slottedOptions.forEach((option) => {
|
|
1313
|
-
const optionLabel = (option.label ?? option.value).trim();
|
|
1490
|
+
const optionLabel = (option.label ?? option.value ?? '').trim();
|
|
1314
1491
|
if (!this.isSelectAllLabel(optionLabel))
|
|
1315
1492
|
return;
|
|
1316
1493
|
option.indeterminate = anySelected && !allSelected;
|
|
@@ -1334,9 +1511,7 @@ export class Select {
|
|
|
1334
1511
|
return label === this.selectAllLabel || label === this.unselectAllLabel;
|
|
1335
1512
|
}
|
|
1336
1513
|
isSelectAllOption(option) {
|
|
1337
|
-
return
|
|
1338
|
-
option.value === 'Alternar todos' ||
|
|
1339
|
-
this.isSelectAllLabel(this.getOptionLabel(option)));
|
|
1514
|
+
return option.value === SELECT_ALL_OPTION_VALUE || this.isSelectAllLabel(this.getOptionLabel(option));
|
|
1340
1515
|
}
|
|
1341
1516
|
getSelectAllLabel(selected, indeterminate) {
|
|
1342
1517
|
return selected && !indeterminate ? this.unselectAllLabel : this.selectAllLabel;
|
|
@@ -1443,25 +1618,12 @@ export class Select {
|
|
|
1443
1618
|
const hostOptions = this.applyCanonicalSelection(this.getHostOptions());
|
|
1444
1619
|
return this.getListOptions(hostOptions);
|
|
1445
1620
|
}
|
|
1446
|
-
normalizeSearchText(value) {
|
|
1447
|
-
return value
|
|
1448
|
-
.normalize('NFD')
|
|
1449
|
-
.replace(/[\u0300-\u036f]/g, '')
|
|
1450
|
-
.toLocaleLowerCase('pt-BR')
|
|
1451
|
-
.trim();
|
|
1452
|
-
}
|
|
1453
1621
|
getNavigableOptions() {
|
|
1454
|
-
const
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
return options.
|
|
1459
|
-
if (this.isSelectAllLabel(this.getOptionLabel(option)))
|
|
1460
|
-
return this.effectiveMultiple;
|
|
1461
|
-
const label = this.normalizeSearchText(this.getOptionLabel(option));
|
|
1462
|
-
const value = this.normalizeSearchText(option.value);
|
|
1463
|
-
return label.includes(normalizedTerm) || value.includes(normalizedTerm);
|
|
1464
|
-
});
|
|
1622
|
+
const currentOptions = this.getCurrentOptions();
|
|
1623
|
+
const hostOptions = this.hasImperativeOptions ? [] : this.getHostOptions();
|
|
1624
|
+
const hostDisabledState = new Map(hostOptions.map((option) => [option.value, Boolean(option.disabled)]));
|
|
1625
|
+
const options = currentOptions.map((option) => hostDisabledState.has(option.value) ? { ...option, disabled: hostDisabledState.get(option.value) } : option);
|
|
1626
|
+
return filterSelectOptions(options, this.filterable && this.effectiveSearchMode === 'local' ? this.searchTerm : '', this.selectAllLabel, this.unselectAllLabel);
|
|
1465
1627
|
}
|
|
1466
1628
|
clearSearch() {
|
|
1467
1629
|
if (!this.searchTerm)
|
|
@@ -1488,14 +1650,17 @@ export class Select {
|
|
|
1488
1650
|
this.selectListElement?.setMultiple(isMultiple);
|
|
1489
1651
|
}
|
|
1490
1652
|
renderSelectInput() {
|
|
1491
|
-
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-
|
|
1653
|
+
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-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, autocomplete: this.effectiveAutocomplete, "input-width": this.inputWidth, value: this.filterable && this.effectiveOpen ? this.searchTerm : this.getRenderedDisplayValue() }));
|
|
1492
1654
|
}
|
|
1493
1655
|
renderSelectList() {
|
|
1494
|
-
return (h("br-select-list", { part: "list",
|
|
1656
|
+
return (h("br-select-list", { part: "list", "aria-hidden": "true", onMouseDown: (event) => {
|
|
1657
|
+
event.preventDefault();
|
|
1658
|
+
void this.selectInputElement?.setFocus();
|
|
1659
|
+
}, 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.filterable && this.effectiveSearchMode === 'local' ? this.searchTerm : '', role: "listbox", "select-all-label": this.selectAllLabel, "unselect-all-label": this.unselectAllLabel, ref: (el) => {
|
|
1495
1660
|
this.selectListElement = el;
|
|
1496
1661
|
this.selectListElement.loading = this.loading;
|
|
1497
1662
|
this.setSelectionMode(this.effectiveMultiple);
|
|
1498
|
-
void this.getSelectListController()?.setSearchTerm?.(this.filterable ? this.searchTerm : '');
|
|
1663
|
+
void this.getSelectListController()?.setSearchTerm?.(this.filterable && this.effectiveSearchMode === 'local' ? this.searchTerm : '');
|
|
1499
1664
|
} }, h("slot", null), h("slot", { name: "loading", slot: "loading" })));
|
|
1500
1665
|
}
|
|
1501
1666
|
renderHiddenSelect() {
|
|
@@ -1535,7 +1700,7 @@ export class Select {
|
|
|
1535
1700
|
return (h("option", { key: option.value, value: option.value, selected: option.selected, disabled: option.disabled }));
|
|
1536
1701
|
}
|
|
1537
1702
|
render() {
|
|
1538
|
-
return (h(Host, { key: '
|
|
1703
|
+
return (h(Host, { key: '4ed2f91b85ca8a208a3a090d65391b91d8dcd27b', "aria-busy": this.isValidating || this.loading ? 'true' : null }, h("div", { key: 'cef813f9d0a45140eb99bc63343991b4012c7599', class: this.getCssClassMap(), part: "container" }, this.renderSelectInput(), this.renderSelectList(), h("div", { key: '9b80f32b29b8496d35d6f77c320d777cf855ac03', part: "feedback", hidden: !this.hasFeedbackSlot && !this.validationErrorMessage }, h("slot", { key: 'd998e50ccc9ac15515ec9c58c31c444212a6a555', 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: '2bf9e897eb977caa4349242960580fd3ec9dd1bc', part: "validation-loading", hidden: !this.hasValidationLoadingSlot || !this.isValidating }, h("slot", { key: 'e0579acbfb5a288ecce89b85f8f6899640dee957', name: "validation-loading" })), this.renderHiddenSelect())));
|
|
1539
1704
|
}
|
|
1540
1705
|
static get is() { return "br-select"; }
|
|
1541
1706
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1620,7 +1785,7 @@ export class Select {
|
|
|
1620
1785
|
"name": "default",
|
|
1621
1786
|
"text": "'medium'"
|
|
1622
1787
|
}],
|
|
1623
|
-
"text": "Define a densidade visual compartilhada pelo campo e pela lista de op\u00E7\u00F5es.\nAceita `small`, `medium` ou `large`. Valores inv\u00E1lidos usam `medium`."
|
|
1788
|
+
"text": "Define a densidade visual compartilhada pelo campo e pela lista de op\u00E7\u00F5es.\nAceita `small`, `medium` ou `large`. Valores inv\u00E1lidos usam `medium`.\nA op\u00E7\u00E3o sint\u00E9tica de selecionar todos permanece com densidade `small`."
|
|
1624
1789
|
},
|
|
1625
1790
|
"getter": false,
|
|
1626
1791
|
"setter": false,
|
|
@@ -1839,6 +2004,29 @@ export class Select {
|
|
|
1839
2004
|
"attribute": "overscan",
|
|
1840
2005
|
"defaultValue": "1"
|
|
1841
2006
|
},
|
|
2007
|
+
"hideDividers": {
|
|
2008
|
+
"type": "boolean",
|
|
2009
|
+
"mutable": false,
|
|
2010
|
+
"complexType": {
|
|
2011
|
+
"original": "boolean",
|
|
2012
|
+
"resolved": "boolean",
|
|
2013
|
+
"references": {}
|
|
2014
|
+
},
|
|
2015
|
+
"required": false,
|
|
2016
|
+
"optional": false,
|
|
2017
|
+
"docs": {
|
|
2018
|
+
"tags": [{
|
|
2019
|
+
"name": "default",
|
|
2020
|
+
"text": "false"
|
|
2021
|
+
}],
|
|
2022
|
+
"text": "Oculta os divisores entre op\u00E7\u00F5es consecutivas, sem alterar a altura das linhas."
|
|
2023
|
+
},
|
|
2024
|
+
"getter": false,
|
|
2025
|
+
"setter": false,
|
|
2026
|
+
"reflect": true,
|
|
2027
|
+
"attribute": "hide-dividers",
|
|
2028
|
+
"defaultValue": "false"
|
|
2029
|
+
},
|
|
1842
2030
|
"isOpen": {
|
|
1843
2031
|
"type": "boolean",
|
|
1844
2032
|
"mutable": true,
|
|
@@ -2300,7 +2488,10 @@ export class Select {
|
|
|
2300
2488
|
}
|
|
2301
2489
|
static get states() {
|
|
2302
2490
|
return {
|
|
2491
|
+
"showValidationErrors": {},
|
|
2492
|
+
"validationErrorMessage": {},
|
|
2303
2493
|
"activeOptionIndex": {},
|
|
2494
|
+
"isActiveIndicatorHidden": {},
|
|
2304
2495
|
"displayValue": {},
|
|
2305
2496
|
"searchTerm": {},
|
|
2306
2497
|
"formDisabled": {},
|
|
@@ -2836,11 +3027,29 @@ export class Select {
|
|
|
2836
3027
|
}
|
|
2837
3028
|
static get listeners() {
|
|
2838
3029
|
return [{
|
|
3030
|
+
"name": "focusout",
|
|
3031
|
+
"method": "handleSelectFocusOut",
|
|
3032
|
+
"target": undefined,
|
|
3033
|
+
"capture": false,
|
|
3034
|
+
"passive": false
|
|
3035
|
+
}, {
|
|
3036
|
+
"name": "invalid",
|
|
3037
|
+
"method": "handleSelectInvalid",
|
|
3038
|
+
"target": undefined,
|
|
3039
|
+
"capture": true,
|
|
3040
|
+
"passive": false
|
|
3041
|
+
}, {
|
|
2839
3042
|
"name": "brSelectInputFocus",
|
|
2840
3043
|
"method": "handleSelectInputFocus",
|
|
2841
3044
|
"target": undefined,
|
|
2842
3045
|
"capture": false,
|
|
2843
3046
|
"passive": false
|
|
3047
|
+
}, {
|
|
3048
|
+
"name": "pointerdown",
|
|
3049
|
+
"method": "handleSelectPointerDown",
|
|
3050
|
+
"target": undefined,
|
|
3051
|
+
"capture": false,
|
|
3052
|
+
"passive": true
|
|
2844
3053
|
}, {
|
|
2845
3054
|
"name": "brSelectInputValueChange",
|
|
2846
3055
|
"method": "handleSelectInputValueChange",
|