@govbr-ds/webcomponents 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/cem/custom-elements.json +4438 -1034
- package/cem/webcomponents.html-custom-data.json +491 -160
- package/dist/cjs/br-avatar.cjs.entry.js +4 -4
- package/dist/cjs/br-breadcrumb-item.cjs.entry.js +2 -2
- package/dist/cjs/br-breadcrumb.cjs.entry.js +11 -11
- package/dist/cjs/br-button_2.cjs.entry.js +6 -6
- package/dist/cjs/br-card.cjs.entry.js +4 -4
- package/dist/cjs/br-carousel-page.cjs.entry.js +3 -3
- package/dist/cjs/br-carousel.cjs.entry.js +5 -5
- package/dist/cjs/br-checkbox-group.cjs.entry.js +4 -4
- package/dist/cjs/br-checkbox.cjs.entry.js +5 -5
- package/dist/cjs/br-checkgroup.cjs.entry.js +2 -2
- package/dist/cjs/br-collapse_2.cjs.entry.js +10 -10
- package/dist/cjs/br-cookiebar-cookie.cjs.entry.js +3 -3
- package/dist/cjs/br-cookiebar-group.cjs.entry.js +4 -4
- package/dist/cjs/br-cookiebar-header.cjs.entry.js +3 -3
- package/dist/cjs/br-cookiebar-link.cjs.entry.js +3 -3
- package/dist/cjs/br-cookiebar-note-group.cjs.entry.js +3 -3
- package/dist/cjs/br-cookiebar-note.cjs.entry.js +3 -3
- package/dist/cjs/br-cookiebar.cjs.entry.js +5 -5
- package/dist/cjs/br-crumb.cjs.entry.js +2 -2
- package/dist/cjs/br-date-picker_3.cjs.entry.js +165 -78
- package/dist/cjs/br-datetime-picker.cjs.entry.js +11 -28
- package/dist/cjs/br-divider.cjs.entry.js +4 -4
- package/dist/cjs/br-dropdown.cjs.entry.js +677 -0
- package/dist/cjs/br-footer-category.cjs.entry.js +4 -4
- package/dist/cjs/br-footer-item.cjs.entry.js +3 -3
- package/dist/cjs/br-footer-legal.cjs.entry.js +3 -3
- package/dist/cjs/br-footer-logo.cjs.entry.js +3 -3
- package/dist/cjs/br-footer-social.cjs.entry.js +3 -3
- package/dist/cjs/br-footer.cjs.entry.js +5 -5
- package/dist/cjs/br-header-function.cjs.entry.js +3 -3
- package/dist/cjs/br-header-link.cjs.entry.js +3 -3
- package/dist/cjs/br-header-list.cjs.entry.js +4 -4
- package/dist/cjs/br-header-logo.cjs.entry.js +3 -3
- package/dist/cjs/br-header.cjs.entry.js +6 -6
- package/dist/cjs/br-icon.cjs.entry.js +173 -159
- package/dist/cjs/br-input_2.cjs.entry.js +1427 -0
- package/dist/cjs/br-item.cjs.entry.js +4 -4
- package/dist/cjs/br-link.cjs.entry.js +9 -9
- package/dist/cjs/br-magic-button.cjs.entry.js +11 -12
- package/dist/cjs/br-menu-group.cjs.entry.js +3 -3
- package/dist/cjs/br-menu-header.cjs.entry.js +3 -3
- package/dist/cjs/br-menu-info.cjs.entry.js +3 -3
- package/dist/cjs/br-menu-item.cjs.entry.js +3 -3
- package/dist/cjs/br-menu-link.cjs.entry.js +3 -3
- package/dist/cjs/br-menu-list.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-logo.cjs.entry.js +3 -3
- package/dist/cjs/br-menu-social.cjs.entry.js +2 -2
- package/dist/cjs/br-menu.cjs.entry.js +5 -5
- package/dist/cjs/br-modal.cjs.entry.js +2 -2
- package/dist/cjs/br-notification-body.cjs.entry.js +3 -3
- package/dist/cjs/br-notification-header.cjs.entry.js +3 -3
- package/dist/cjs/br-notification-item.cjs.entry.js +3 -3
- package/dist/cjs/br-notification.cjs.entry.js +4 -4
- package/dist/cjs/br-pagination_2.cjs.entry.js +2578 -0
- package/dist/cjs/br-radio-group.cjs.entry.js +5 -5
- package/dist/cjs/br-radio.cjs.entry.js +5 -5
- package/dist/cjs/br-scrim.cjs.entry.js +4 -4
- package/dist/cjs/br-select-input_3.cjs.entry.js +49 -103
- package/dist/cjs/br-sign-in.cjs.entry.js +4 -4
- package/dist/cjs/br-skip-link-item.cjs.entry.js +2 -2
- package/dist/cjs/br-skip-link.cjs.entry.js +3 -3
- package/dist/cjs/br-skiplink-item.cjs.entry.js +3 -3
- package/dist/cjs/br-slider.cjs.entry.js +4 -4
- package/dist/cjs/br-step_2.cjs.entry.js +7 -7
- package/dist/cjs/br-switch.cjs.entry.js +5 -5
- package/dist/cjs/br-tab-item.cjs.entry.js +3 -3
- package/dist/cjs/br-tab.cjs.entry.js +8 -8
- package/dist/cjs/br-table-action_6.cjs.entry.js +1500 -0
- package/dist/cjs/br-table-body.cjs.entry.js +4 -16
- package/dist/cjs/br-table-header.cjs.entry.js +4 -16
- package/dist/cjs/br-table.cjs.entry.js +2616 -433
- package/dist/cjs/br-tag.cjs.entry.js +5 -5
- package/dist/cjs/br-textarea.cjs.entry.js +4 -4
- package/dist/cjs/br-tooltip.cjs.entry.js +5 -29
- package/dist/cjs/br-upload.cjs.entry.js +5 -5
- package/dist/cjs/br-wizard-panel.cjs.entry.js +3 -3
- package/dist/cjs/br-wizard.cjs.entry.js +3 -3
- package/dist/cjs/{datetime-picker-constants-CCeI5iW7.js → datetime-picker-constants-CTf1kVJ1.js} +1 -0
- package/dist/cjs/helpers-DkkDubv1.js +28 -0
- package/dist/cjs/{icon.utils-DF6kMskA.js → icon.utils-CMs0ukvR.js} +1 -1
- package/dist/cjs/{iconify-icon-DfODV9bf.js → iconify-icon-LjavbM-D.js} +103 -57
- package/dist/cjs/{index-Bc30P_6z.js → index-BP8UIQro.js} +34 -34
- package/dist/cjs/{index-C-IpVFDH.js → index-Caoez3xb.js} +64 -16
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{isValid-CduHZTFc.js → isValid-DgJ-noPS.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{slot-DAllytTj.js → slot-CjaqqX7y.js} +1 -1
- package/dist/cjs/table.utils-De-9_NgJ.js +749 -0
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/avatar/avatar.css +1 -1
- package/dist/collection/components/avatar/avatar.js +21 -21
- package/dist/collection/components/breadcrumb/breadcrumb-item/breadcrumb-item.js +4 -12
- package/dist/collection/components/breadcrumb/breadcrumb.css +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.js +39 -34
- package/dist/collection/components/breadcrumb/crumb/crumb.js +2 -13
- package/dist/collection/components/button/button.css +1 -1
- package/dist/collection/components/button/button.js +22 -22
- package/dist/collection/components/card/card.css +1 -1
- package/dist/collection/components/card/card.js +20 -22
- package/dist/collection/components/carousel/carousel-page/carousel-page.css +1 -1
- package/dist/collection/components/carousel/carousel-page/carousel-page.js +3 -13
- package/dist/collection/components/carousel/carousel.css +1 -1
- package/dist/collection/components/carousel/carousel.js +25 -32
- package/dist/collection/components/checkbox/checkbox.css +1 -1
- package/dist/collection/components/checkbox/checkbox.js +18 -24
- package/dist/collection/components/checkbox-group/checkbox-group.css +1 -1
- package/dist/collection/components/checkbox-group/checkbox-group.js +19 -20
- package/dist/collection/components/checkgroup/checkgroup.js +2 -14
- package/dist/collection/components/collapse/collapse.css +1 -1
- package/dist/collection/components/collapse/collapse.js +33 -29
- package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.js +3 -16
- package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.js +4 -17
- package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.js +3 -16
- package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.js +3 -15
- package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.js +3 -14
- package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.js +3 -14
- package/dist/collection/components/cookiebar/cookiebar.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar.js +33 -28
- package/dist/collection/components/datetime-picker/date-picker/date-picker-locale.js +62 -15
- package/dist/collection/components/datetime-picker/date-picker/date-picker.css +1 -1
- package/dist/collection/components/datetime-picker/date-picker/date-picker.js +123 -74
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.css +1 -1
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.js +5 -15
- package/dist/collection/components/datetime-picker/datetime-picker.css +1 -1
- package/dist/collection/components/datetime-picker/datetime-picker.js +23 -27
- package/dist/collection/components/datetime-picker/datetime-picker.utils.js +6 -6
- package/dist/collection/components/datetime-picker/time-picker/time-picker.css +1 -1
- package/dist/collection/components/datetime-picker/time-picker/time-picker.js +7 -17
- package/dist/collection/components/divider/divider.css +1 -1
- package/dist/collection/components/divider/divider.js +15 -19
- package/dist/collection/components/dropdown/dropdown.css +1 -1
- package/dist/collection/components/dropdown/dropdown.js +27 -28
- package/dist/collection/components/footer/footer-category/footer-category.css +1 -1
- package/dist/collection/components/footer/footer-category/footer-category.js +4 -17
- package/dist/collection/components/footer/footer-item/footer-item.css +1 -1
- package/dist/collection/components/footer/footer-item/footer-item.js +3 -16
- package/dist/collection/components/footer/footer-legal/footer-legal.css +1 -1
- package/dist/collection/components/footer/footer-legal/footer-legal.js +2 -16
- package/dist/collection/components/footer/footer-logo/footer-logo.css +1 -1
- package/dist/collection/components/footer/footer-logo/footer-logo.js +3 -16
- package/dist/collection/components/footer/footer-social/footer-social.css +1 -1
- package/dist/collection/components/footer/footer-social/footer-social.js +4 -16
- package/dist/collection/components/footer/footer.css +1 -1
- package/dist/collection/components/footer/footer.js +25 -29
- package/dist/collection/components/header/header-function/header-function.css +1 -1
- package/dist/collection/components/header/header-function/header-function.js +10 -14
- package/dist/collection/components/header/header-link/header-link.css +1 -1
- package/dist/collection/components/header/header-link/header-link.js +3 -16
- package/dist/collection/components/header/header-list/header-list.css +1 -1
- package/dist/collection/components/header/header-list/header-list.js +4 -17
- package/dist/collection/components/header/header-logo/header-logo.css +1 -1
- package/dist/collection/components/header/header-logo/header-logo.js +3 -16
- package/dist/collection/components/header/header.css +1 -1
- package/dist/collection/components/header/header.js +33 -30
- package/dist/collection/components/icon/default-icons-cache.js +159 -146
- package/dist/collection/components/icon/icon.css +1 -1
- package/dist/collection/components/icon/icon.js +38 -29
- package/dist/collection/components/icon/icon.utils.js +1 -1
- package/dist/collection/components/input/input.css +1 -1
- package/dist/collection/components/input/input.js +216 -30
- package/dist/collection/components/item/item.css +1 -1
- package/dist/collection/components/item/item.js +18 -22
- package/dist/collection/components/link/link.css +1 -1
- package/dist/collection/components/link/link.js +25 -29
- package/dist/collection/components/list/list.css +1 -1
- package/dist/collection/components/list/list.js +17 -21
- package/dist/collection/components/loading/loading.css +1 -1
- package/dist/collection/components/loading/loading.js +17 -24
- package/dist/collection/components/magic-button/magic-button.css +1 -1
- package/dist/collection/components/magic-button/magic-button.js +21 -29
- package/dist/collection/components/menu/menu-group/menu-group.css +1 -1
- package/dist/collection/components/menu/menu-group/menu-group.js +3 -16
- package/dist/collection/components/menu/menu-header/menu-header.css +1 -1
- package/dist/collection/components/menu/menu-header/menu-header.js +3 -16
- package/dist/collection/components/menu/menu-info/menu-info.css +1 -1
- package/dist/collection/components/menu/menu-info/menu-info.js +2 -15
- package/dist/collection/components/menu/menu-item/menu-item.css +1 -1
- package/dist/collection/components/menu/menu-item/menu-item.js +3 -16
- package/dist/collection/components/menu/menu-link/menu-link.css +1 -1
- package/dist/collection/components/menu/menu-link/menu-link.js +5 -17
- package/dist/collection/components/menu/menu-list/menu-list.css +1 -1
- package/dist/collection/components/menu/menu-list/menu-list.js +2 -15
- package/dist/collection/components/menu/menu-logo/menu-logo.css +1 -1
- package/dist/collection/components/menu/menu-logo/menu-logo.js +2 -15
- package/dist/collection/components/menu/menu-social/menu-social.css +1 -1
- package/dist/collection/components/menu/menu-social/menu-social.js +3 -16
- package/dist/collection/components/menu/menu.css +1 -1
- package/dist/collection/components/menu/menu.js +28 -35
- package/dist/collection/components/message/message.css +1 -1
- package/dist/collection/components/message/message.js +22 -25
- package/dist/collection/components/modal/modal.css +1 -1
- package/dist/collection/components/modal/modal.js +18 -21
- package/dist/collection/components/notification/notification-body/notification-body.css +1 -1
- package/dist/collection/components/notification/notification-body/notification-body.js +3 -13
- package/dist/collection/components/notification/notification-header/notification-header.css +1 -1
- package/dist/collection/components/notification/notification-header/notification-header.js +3 -14
- package/dist/collection/components/notification/notification-item/notification-item.css +1 -1
- package/dist/collection/components/notification/notification-item/notification-item.js +3 -16
- package/dist/collection/components/notification/notification.css +1 -1
- package/dist/collection/components/notification/notification.js +20 -29
- package/dist/collection/components/pagination/pagination.css +1 -1
- package/dist/collection/components/pagination/pagination.js +19 -27
- package/dist/collection/components/radio/radio.css +1 -1
- package/dist/collection/components/radio/radio.js +17 -20
- package/dist/collection/components/radio-group/radio-group.css +1 -1
- package/dist/collection/components/radio-group/radio-group.js +20 -20
- package/dist/collection/components/scrim/scrim.css +1 -1
- package/dist/collection/components/scrim/scrim.js +14 -17
- package/dist/collection/components/select/select-input/select-input.css +1 -1
- package/dist/collection/components/select/select-input/select-input.js +48 -102
- package/dist/collection/components/select/select-list/select-list.css +1 -1
- package/dist/collection/components/select/select-list/select-list.js +52 -15
- package/dist/collection/components/select/select-option/select-option.css +1 -1
- package/dist/collection/components/select/select-option/select-option.js +13 -17
- package/dist/collection/components/select/select.css +1 -1
- package/dist/collection/components/select/select.js +104 -110
- package/dist/collection/components/sign-in/sign-in.css +1 -1
- package/dist/collection/components/sign-in/sign-in.js +12 -16
- package/dist/collection/components/skip-link/skip-link-item/skip-link-item-alias.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-item/skip-link-item.js +5 -15
- package/dist/collection/components/skip-link/skip-link.css +1 -1
- package/dist/collection/components/skip-link/skip-link.js +18 -24
- package/dist/collection/components/slider/slider.css +1 -1
- package/dist/collection/components/slider/slider.js +18 -28
- package/dist/collection/components/step/step-item/step-item.css +1 -1
- package/dist/collection/components/step/step-item/step-item.js +5 -15
- package/dist/collection/components/step/step.css +1 -1
- package/dist/collection/components/step/step.js +16 -25
- package/dist/collection/components/switch/switch.css +1 -1
- package/dist/collection/components/switch/switch.js +16 -20
- package/dist/collection/components/tab/tab-item/tab-item.css +1 -1
- package/dist/collection/components/tab/tab-item/tab-item.js +6 -16
- package/dist/collection/components/tab/tab.css +1 -1
- package/dist/collection/components/tab/tab.js +24 -31
- package/dist/collection/components/table/table-action/table-action.css +1 -0
- package/dist/collection/components/table/table-action/table-action.js +349 -0
- package/dist/collection/components/table/table-bar/table-bar.css +1 -0
- package/dist/collection/components/table/table-bar/table-bar.js +652 -0
- package/dist/collection/components/table/table-body/table-body.css +1 -1
- package/dist/collection/components/table/table-body/table-body.js +11 -26
- package/dist/collection/components/table/table-cell/table-cell.css +1 -1
- package/dist/collection/components/table/table-cell/table-cell.js +555 -91
- package/dist/collection/components/table/table-footer/table-footer.css +1 -0
- package/dist/collection/components/table/table-footer/table-footer.js +233 -0
- package/dist/collection/components/table/table-header/table-header.css +1 -1
- package/dist/collection/components/table/table-header/table-header.js +10 -26
- package/dist/collection/components/table/table-header-cell/table-header-cell.css +1 -1
- package/dist/collection/components/table/table-header-cell/table-header-cell.js +286 -95
- package/dist/collection/components/table/table-row/table-row.css +1 -1
- package/dist/collection/components/table/table-row/table-row.js +311 -66
- package/dist/collection/components/table/table.actions-tooltip.js +33 -0
- package/dist/collection/components/table/{table-constants.js → table.constants.js} +54 -77
- package/dist/collection/components/table/table.css +1 -1
- package/dist/collection/components/table/table.data.js +461 -0
- package/dist/collection/components/table/table.expansion.elements.js +70 -0
- package/dist/collection/components/table/table.expansion.js +179 -0
- package/dist/collection/components/table/table.grouping.js +97 -0
- package/dist/collection/components/table/table.header-height.js +47 -0
- package/dist/collection/components/table/table.js +2499 -625
- package/dist/collection/components/table/table.keyboard.js +340 -0
- package/dist/collection/components/table/table.scroll-shadows.js +36 -0
- package/dist/collection/components/table/table.selection.elements.js +63 -0
- package/dist/collection/components/table/table.selection.js +239 -0
- package/dist/collection/components/table/table.tokens.js +28 -0
- package/dist/collection/components/table/table.types.js +1 -0
- package/dist/collection/components/table/table.utils.js +75 -0
- package/dist/collection/components/table/table.virtual-list.js +342 -0
- package/dist/collection/components/tag/tag.css +1 -1
- package/dist/collection/components/tag/tag.js +17 -26
- package/dist/collection/components/textarea/textarea.css +1 -1
- package/dist/collection/components/textarea/textarea.js +14 -22
- package/dist/collection/components/tooltip/tooltip.css +1 -1
- package/dist/collection/components/tooltip/tooltip.js +15 -45
- package/dist/collection/components/upload/upload.css +1 -1
- package/dist/collection/components/upload/upload.js +36 -29
- package/dist/collection/components/wizard/wizard-panel/wizard-panel.css +1 -1
- package/dist/collection/components/wizard/wizard-panel/wizard-panel.js +3 -13
- package/dist/collection/components/wizard/wizard.css +1 -1
- package/dist/collection/components/wizard/wizard.js +22 -26
- package/dist/collection/pages/components/select/remote-options.js +87 -0
- package/dist/collection/pages/scripts/code-editor.js +28 -3
- package/dist/collection/pages/scripts/pageLoader.js +286 -20
- package/dist/collection/pages/scripts/pageloader-preview.js +3 -1
- package/dist/collection/shared/utils/slot.js +1 -1
- 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-action.d.ts +11 -0
- package/dist/components/br-table-action.js +5 -0
- package/dist/components/br-table-bar.d.ts +11 -0
- package/dist/components/br-table-bar.js +5 -0
- package/dist/components/br-table-body.js +1 -1
- package/dist/components/br-table-cell.js +1 -1
- package/dist/components/br-table-footer.d.ts +11 -0
- package/dist/components/br-table-footer.js +5 -0
- 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.d.ts +6 -0
- package/dist/components/index.js +1 -1
- package/dist/components/p-082jxuTj.js +5 -0
- package/dist/components/p-381n6AwK.js +5 -0
- package/dist/components/p-B5_zbRAr.js +5 -0
- package/dist/components/p-BE1gDPwC.js +5 -0
- package/dist/components/p-BV-c2pxt.js +5 -0
- package/dist/components/p-BfFbYAuJ.js +5 -0
- package/dist/components/{p-ta-24T1Z.js → p-Bi2E_w9Q.js} +1 -1
- package/dist/components/p-Bk8YcMql.js +5 -0
- package/dist/components/p-C3ISxUGw.js +5 -0
- package/dist/components/p-C3J0TVQO.js +5 -0
- package/dist/components/p-C6m13lCc.js +5 -0
- package/dist/components/{p-DBmwzG9E.js → p-CCWJ-H33.js} +1 -1
- package/dist/components/p-CJuHirYK.js +5 -0
- package/dist/components/{p-PV731d8s.js → p-CKS7ggLM.js} +1 -1
- package/dist/components/p-COSFBwu9.js +5 -0
- package/dist/components/{p-DsO4F0Cz.js → p-CVz_akHx.js} +1 -1
- package/dist/components/p-CWPrXYam.js +5 -0
- package/dist/components/p-C_DC6oQW.js +16 -0
- package/dist/components/p-Ca89D_0s.js +5 -0
- package/dist/components/p-CbN58CFi.js +5 -0
- package/dist/components/p-CjjxTkKb.js +5 -0
- package/dist/components/p-Ck9t4WSb.js +5 -0
- package/dist/components/p-CvfVwD6_.js +5 -0
- package/dist/components/p-D-1sfjhG.js +5 -0
- package/dist/components/p-D-p4vLlP.js +5 -0
- package/dist/components/p-D6DArHGH.js +5 -0
- package/dist/components/p-DD3BItoS.js +5 -0
- package/dist/components/{p-jOb1hCPi.js → p-DEIKwFIf.js} +1 -1
- package/dist/components/p-DHHAIESt.js +5 -0
- package/dist/components/{p-Jk_KQE5V.js → p-DMj5iO7_.js} +1 -1
- package/dist/components/p-DUI-S07G.js +5 -0
- package/dist/components/p-D_K9JH6J.js +5 -0
- package/dist/components/p-DiQp2Lap.js +5 -0
- package/dist/components/{p-rMnkh3Cy.js → p-Dn36Mj2E.js} +1 -1
- package/dist/components/{p-D-3G3Ioq.js → p-Dvbqhybt.js} +1 -1
- package/dist/components/p-Dy7MSvt-.js +5 -0
- package/dist/components/p-DywTXNHQ.js +5 -0
- package/dist/components/p-Ft_P7Roz.js +5 -0
- package/dist/components/{p-CbgKdASU.js → p-JkJjzmGm.js} +1 -1
- package/dist/components/p-KuiFoKDl.js +5 -0
- package/dist/components/p-MiiczSWA.js +5 -0
- package/dist/components/p-Um3K2SHu.js +5 -0
- package/dist/components/p-YxddSP6q.js +5 -0
- package/dist/components/p-Zk91ebVT.js +5 -0
- package/dist/components/p-jv2oG0vH.js +5 -0
- package/dist/components/p-nrG_Gd0c.js +5 -0
- package/dist/components/p-syLEZrcg.js +5 -0
- package/dist/components/p-ydfWTgrA.js +5 -0
- package/dist/esm/br-avatar.entry.js +5 -5
- package/dist/esm/br-breadcrumb-item.entry.js +2 -2
- package/dist/esm/br-breadcrumb.entry.js +12 -12
- package/dist/esm/br-button_2.entry.js +7 -7
- package/dist/esm/br-card.entry.js +4 -4
- package/dist/esm/br-carousel-page.entry.js +3 -3
- package/dist/esm/br-carousel.entry.js +6 -6
- package/dist/esm/br-checkbox-group.entry.js +5 -5
- package/dist/esm/br-checkbox.entry.js +6 -6
- package/dist/esm/br-checkgroup.entry.js +2 -2
- package/dist/esm/br-collapse_2.entry.js +11 -11
- package/dist/esm/br-cookiebar-cookie.entry.js +3 -3
- package/dist/esm/br-cookiebar-group.entry.js +4 -4
- package/dist/esm/br-cookiebar-header.entry.js +3 -3
- package/dist/esm/br-cookiebar-link.entry.js +4 -4
- package/dist/esm/br-cookiebar-note-group.entry.js +3 -3
- package/dist/esm/br-cookiebar-note.entry.js +3 -3
- package/dist/esm/br-cookiebar.entry.js +6 -6
- package/dist/esm/br-crumb.entry.js +2 -2
- package/dist/esm/br-date-picker_3.entry.js +165 -78
- package/dist/esm/br-datetime-picker.entry.js +10 -27
- package/dist/esm/br-divider.entry.js +5 -5
- package/dist/esm/br-dropdown.entry.js +675 -0
- package/dist/esm/br-footer-category.entry.js +4 -4
- package/dist/esm/br-footer-item.entry.js +4 -4
- package/dist/esm/br-footer-legal.entry.js +3 -3
- package/dist/esm/br-footer-logo.entry.js +4 -4
- package/dist/esm/br-footer-social.entry.js +4 -4
- package/dist/esm/br-footer.entry.js +6 -6
- package/dist/esm/br-header-function.entry.js +4 -4
- package/dist/esm/br-header-link.entry.js +4 -4
- package/dist/esm/br-header-list.entry.js +4 -4
- package/dist/esm/br-header-logo.entry.js +4 -4
- package/dist/esm/br-header.entry.js +7 -7
- package/dist/esm/br-icon.entry.js +174 -160
- package/dist/esm/br-input_2.entry.js +1424 -0
- package/dist/esm/br-item.entry.js +5 -5
- package/dist/esm/br-link.entry.js +10 -10
- package/dist/esm/br-magic-button.entry.js +12 -13
- package/dist/esm/br-menu-group.entry.js +3 -3
- package/dist/esm/br-menu-header.entry.js +3 -3
- package/dist/esm/br-menu-info.entry.js +3 -3
- package/dist/esm/br-menu-item.entry.js +4 -4
- package/dist/esm/br-menu-link.entry.js +4 -4
- package/dist/esm/br-menu-list.entry.js +2 -2
- package/dist/esm/br-menu-logo.entry.js +3 -3
- package/dist/esm/br-menu-social.entry.js +3 -3
- package/dist/esm/br-menu.entry.js +6 -6
- package/dist/esm/br-modal.entry.js +3 -3
- package/dist/esm/br-notification-body.entry.js +3 -3
- package/dist/esm/br-notification-header.entry.js +3 -3
- package/dist/esm/br-notification-item.entry.js +4 -4
- package/dist/esm/br-notification.entry.js +5 -5
- package/dist/esm/br-pagination_2.entry.js +2575 -0
- package/dist/esm/br-radio-group.entry.js +6 -6
- package/dist/esm/br-radio.entry.js +6 -6
- package/dist/esm/br-scrim.entry.js +5 -5
- package/dist/esm/br-select-input_3.entry.js +50 -104
- package/dist/esm/br-sign-in.entry.js +5 -5
- package/dist/esm/br-skip-link-item.entry.js +2 -2
- package/dist/esm/br-skip-link.entry.js +4 -4
- package/dist/esm/br-skiplink-item.entry.js +4 -4
- package/dist/esm/br-slider.entry.js +5 -5
- package/dist/esm/br-step_2.entry.js +8 -8
- package/dist/esm/br-switch.entry.js +6 -6
- package/dist/esm/br-tab-item.entry.js +4 -4
- package/dist/esm/br-tab.entry.js +9 -9
- package/dist/esm/br-table-action_6.entry.js +1493 -0
- package/dist/esm/br-table-body.entry.js +4 -16
- package/dist/esm/br-table-header.entry.js +4 -16
- package/dist/esm/br-table.entry.js +2591 -408
- package/dist/esm/br-tag.entry.js +6 -6
- package/dist/esm/br-textarea.entry.js +5 -5
- package/dist/esm/br-tooltip.entry.js +6 -30
- package/dist/esm/br-upload.entry.js +6 -6
- package/dist/esm/br-wizard-panel.entry.js +3 -3
- package/dist/esm/br-wizard.entry.js +4 -4
- package/dist/esm/{datetime-picker-constants-DDc4sADe.js → datetime-picker-constants-1l4_-FEJ.js} +1 -1
- package/dist/esm/helpers-BNW9pAhl.js +26 -0
- package/dist/esm/{icon.utils-zlORkiHQ.js → icon.utils-CXDYKUBz.js} +1 -1
- package/dist/esm/{iconify-icon-D3usVJE2.js → iconify-icon-C_DC6oQW.js} +103 -57
- package/dist/esm/{index-CytVKoHT.js → index-BQRBKuY0.js} +64 -17
- package/dist/esm/{index-ConyRdJe.js → index-CwL52661.js} +34 -35
- package/dist/esm/index.js +2 -2
- package/dist/esm/{isValid-Bee0Uvqc.js → isValid-wU7S6MI2.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{props-D07GjR4_.js → props-BbxNgEcJ.js} +1 -1
- package/dist/esm/{slot-BIG-yees.js → slot-Bt01zQ7-.js} +1 -1
- package/dist/esm/table.utils-CtVdlcgI.js +706 -0
- package/dist/esm/webcomponents.js +3 -3
- package/dist/hydrate/index.js +6573 -3030
- package/dist/hydrate/index.mjs +6573 -3030
- package/dist/types/components/avatar/avatar.d.ts +20 -20
- package/dist/types/components/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +3 -11
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +30 -25
- package/dist/types/components/breadcrumb/crumb/crumb.d.ts +1 -12
- package/dist/types/components/button/button.d.ts +20 -20
- package/dist/types/components/card/card.d.ts +19 -21
- package/dist/types/components/carousel/carousel-page/carousel-page.d.ts +2 -12
- package/dist/types/components/carousel/carousel.d.ts +22 -29
- package/dist/types/components/checkbox/checkbox.d.ts +16 -22
- package/dist/types/components/checkbox-group/checkbox-group.d.ts +17 -18
- package/dist/types/components/checkgroup/checkgroup.d.ts +1 -13
- package/dist/types/components/collapse/collapse.d.ts +26 -22
- package/dist/types/components/cookiebar/cookiebar-cookie/cookiebar-cookie.d.ts +2 -15
- package/dist/types/components/cookiebar/cookiebar-group/cookiebar-group.d.ts +2 -15
- package/dist/types/components/cookiebar/cookiebar-header/cookiebar-header.d.ts +2 -15
- package/dist/types/components/cookiebar/cookiebar-link/cookiebar-link.d.ts +2 -14
- package/dist/types/components/cookiebar/cookiebar-note/cookiebar-note.d.ts +2 -13
- package/dist/types/components/cookiebar/cookiebar-note-group/cookiebar-note-group.d.ts +2 -13
- package/dist/types/components/cookiebar/cookiebar.d.ts +30 -25
- package/dist/types/components/datetime-picker/date-picker/date-picker-locale.d.ts +12 -4
- package/dist/types/components/datetime-picker/date-picker/date-picker.d.ts +57 -11
- package/dist/types/components/datetime-picker/datetime-input/datetime-input.d.ts +2 -12
- package/dist/types/components/datetime-picker/datetime-picker.d.ts +22 -26
- package/dist/types/components/datetime-picker/time-picker/time-picker.d.ts +3 -13
- package/dist/types/components/divider/divider.d.ts +14 -18
- package/dist/types/components/dropdown/dropdown.d.ts +21 -20
- package/dist/types/components/footer/footer-category/footer-category.d.ts +2 -15
- package/dist/types/components/footer/footer-item/footer-item.d.ts +2 -15
- package/dist/types/components/footer/footer-legal/footer-legal.d.ts +1 -15
- package/dist/types/components/footer/footer-logo/footer-logo.d.ts +2 -15
- package/dist/types/components/footer/footer-social/footer-social.d.ts +4 -17
- package/dist/types/components/footer/footer.d.ts +23 -27
- package/dist/types/components/header/header-function/header-function.d.ts +9 -13
- package/dist/types/components/header/header-link/header-link.d.ts +2 -15
- package/dist/types/components/header/header-list/header-list.d.ts +2 -15
- package/dist/types/components/header/header-logo/header-logo.d.ts +2 -15
- package/dist/types/components/header/header.d.ts +29 -26
- package/dist/types/components/icon/icon.d.ts +27 -22
- package/dist/types/components/icon/icon.utils.d.ts +1 -1
- package/dist/types/components/input/input.d.ts +46 -23
- package/dist/types/components/input/input.types.d.ts +18 -0
- package/dist/types/components/item/item.d.ts +17 -21
- package/dist/types/components/link/link.d.ts +18 -22
- package/dist/types/components/list/list.d.ts +16 -20
- package/dist/types/components/loading/loading.d.ts +16 -23
- package/dist/types/components/magic-button/magic-button.d.ts +17 -25
- package/dist/types/components/menu/menu-group/menu-group.d.ts +2 -15
- package/dist/types/components/menu/menu-header/menu-header.d.ts +2 -15
- package/dist/types/components/menu/menu-info/menu-info.d.ts +1 -14
- package/dist/types/components/menu/menu-item/menu-item.d.ts +2 -15
- package/dist/types/components/menu/menu-link/menu-link.d.ts +4 -16
- package/dist/types/components/menu/menu-list/menu-list.d.ts +2 -15
- package/dist/types/components/menu/menu-logo/menu-logo.d.ts +1 -14
- package/dist/types/components/menu/menu-social/menu-social.d.ts +4 -18
- package/dist/types/components/menu/menu.d.ts +25 -32
- package/dist/types/components/message/message.d.ts +21 -24
- package/dist/types/components/modal/modal.d.ts +18 -21
- package/dist/types/components/notification/notification-body/notification-body.d.ts +2 -12
- package/dist/types/components/notification/notification-header/notification-header.d.ts +2 -13
- package/dist/types/components/notification/notification-item/notification-item.d.ts +2 -15
- package/dist/types/components/notification/notification.d.ts +18 -27
- package/dist/types/components/pagination/pagination.d.ts +13 -21
- package/dist/types/components/radio/radio.d.ts +15 -18
- package/dist/types/components/radio-group/radio-group.d.ts +18 -18
- package/dist/types/components/scrim/scrim.d.ts +12 -15
- package/dist/types/components/select/select-input/select-input.d.ts +12 -14
- package/dist/types/components/select/select-list/select-list.d.ts +13 -12
- package/dist/types/components/select/select-option/select-option.d.ts +8 -11
- package/dist/types/components/select/select.d.ts +42 -94
- package/dist/types/components/sign-in/sign-in.d.ts +11 -15
- package/dist/types/components/skip-link/skip-link-item/skip-link-item-alias.d.ts +7 -3
- package/dist/types/components/skip-link/skip-link-item/skip-link-item.d.ts +4 -14
- package/dist/types/components/skip-link/skip-link.d.ts +17 -23
- package/dist/types/components/slider/slider.d.ts +18 -28
- package/dist/types/components/step/step-item/step-item.d.ts +2 -12
- package/dist/types/components/step/step.d.ts +15 -24
- package/dist/types/components/switch/switch.d.ts +14 -18
- package/dist/types/components/tab/tab-item/tab-item.d.ts +6 -16
- package/dist/types/components/tab/tab.d.ts +20 -27
- package/dist/types/components/table/table-action/table-action.d.ts +107 -0
- package/dist/types/components/table/table-bar/table-bar.d.ts +193 -0
- package/dist/types/components/table/table-body/table-body.d.ts +10 -25
- package/dist/types/components/table/table-cell/table-cell.d.ts +177 -46
- package/dist/types/components/table/table-footer/table-footer.d.ts +40 -0
- package/dist/types/components/table/table-footer/table-footer.types.d.ts +12 -0
- package/dist/types/components/table/table-header/table-header.d.ts +9 -25
- package/dist/types/components/table/table-header-cell/table-header-cell.d.ts +101 -62
- package/dist/types/components/table/table-row/table-row.d.ts +87 -38
- package/dist/types/components/table/table.actions-tooltip.d.ts +11 -0
- package/dist/types/components/table/{table-constants.d.ts → table.constants.d.ts} +50 -77
- package/dist/types/components/table/table.d.ts +601 -229
- package/dist/types/components/table/table.data.d.ts +78 -0
- package/dist/types/components/table/table.expansion.d.ts +65 -0
- package/dist/types/components/table/table.expansion.elements.d.ts +30 -0
- package/dist/types/components/table/table.grouping.d.ts +25 -0
- package/dist/types/components/table/table.header-height.d.ts +17 -0
- package/dist/types/components/table/table.keyboard.d.ts +53 -0
- package/dist/types/components/table/table.scroll-shadows.d.ts +11 -0
- package/dist/types/components/table/table.selection.d.ts +84 -0
- package/dist/types/components/table/table.selection.elements.d.ts +42 -0
- package/dist/types/components/table/table.tokens.d.ts +24 -0
- package/dist/types/components/table/table.types.d.ts +199 -0
- package/dist/types/components/table/table.utils.d.ts +52 -0
- package/dist/types/components/table/table.virtual-list.d.ts +96 -0
- package/dist/types/components/tag/tag.d.ts +15 -24
- package/dist/types/components/textarea/textarea.d.ts +13 -21
- package/dist/types/components/tooltip/tooltip.d.ts +12 -18
- package/dist/types/components/upload/upload.d.ts +20 -27
- package/dist/types/components/wizard/wizard-panel/wizard-panel.d.ts +2 -12
- package/dist/types/components/wizard/wizard.d.ts +21 -25
- package/dist/types/components.d.ts +4646 -5087
- package/dist/webcomponents/index.esm.js +1 -1
- package/dist/webcomponents/{p-6f1a4fbe.entry.js → p-07e80bf8.entry.js} +1 -1
- package/dist/webcomponents/p-10d81622.entry.js +5 -0
- package/dist/webcomponents/p-12d5f533.entry.js +5 -0
- package/dist/webcomponents/p-15699e8a.entry.js +5 -0
- package/dist/webcomponents/{p-7fda8b89.entry.js → p-15e2f5cc.entry.js} +1 -1
- package/dist/webcomponents/{p-198aa844.entry.js → p-16d27d5c.entry.js} +1 -1
- package/dist/webcomponents/p-18d3fab8.entry.js +5 -0
- package/dist/webcomponents/{p-DDc4sADe.js → p-1l4_-FEJ.js} +1 -1
- package/dist/webcomponents/p-23c916d9.entry.js +5 -0
- package/dist/webcomponents/p-2aee69fd.entry.js +5 -0
- package/dist/webcomponents/p-2d3db296.entry.js +5 -0
- package/dist/webcomponents/p-2ed6afdd.entry.js +5 -0
- package/dist/webcomponents/{p-42b60169.entry.js → p-30c865e6.entry.js} +1 -1
- package/dist/webcomponents/p-32afb78c.entry.js +5 -0
- package/dist/webcomponents/p-33d24cbd.entry.js +5 -0
- package/dist/webcomponents/p-35d63edd.entry.js +5 -0
- package/dist/webcomponents/p-3b1ff55e.entry.js +5 -0
- package/dist/webcomponents/p-3c7246cf.entry.js +5 -0
- package/dist/webcomponents/{p-6a293be8.entry.js → p-407e7b69.entry.js} +1 -1
- package/dist/webcomponents/p-41b12e3c.entry.js +5 -0
- package/dist/webcomponents/p-47adc17f.entry.js +5 -0
- package/dist/webcomponents/{p-18cf093a.entry.js → p-48fc8e56.entry.js} +1 -1
- package/dist/webcomponents/p-4a44c8b8.entry.js +5 -0
- package/dist/webcomponents/{p-ac68355e.entry.js → p-4b0f3701.entry.js} +1 -1
- package/dist/webcomponents/p-4b66200c.entry.js +5 -0
- package/dist/webcomponents/{p-5a7c2031.entry.js → p-4c0a1c05.entry.js} +1 -1
- package/dist/webcomponents/p-4c72d706.entry.js +5 -0
- package/dist/webcomponents/p-505173e0.entry.js +5 -0
- package/dist/webcomponents/p-50caea68.entry.js +5 -0
- package/dist/webcomponents/p-5419fd2c.entry.js +5 -0
- package/dist/webcomponents/{p-20477061.entry.js → p-5693e0e7.entry.js} +1 -1
- package/dist/webcomponents/p-58247764.entry.js +5 -0
- package/dist/webcomponents/p-5d0f4851.entry.js +5 -0
- package/dist/webcomponents/p-60c949c8.entry.js +5 -0
- package/dist/webcomponents/p-61b84035.entry.js +5 -0
- package/dist/webcomponents/p-62a74e0a.entry.js +5 -0
- package/dist/webcomponents/p-6450913e.entry.js +5 -0
- package/dist/webcomponents/p-66c8b8d9.entry.js +5 -0
- package/dist/webcomponents/{p-b55425b7.entry.js → p-67281ef1.entry.js} +1 -1
- package/dist/webcomponents/{p-0fc112fc.entry.js → p-6e128c7a.entry.js} +1 -1
- package/dist/webcomponents/p-725e92ab.entry.js +5 -0
- package/dist/webcomponents/{p-09c79c1d.entry.js → p-74726f20.entry.js} +1 -1
- package/dist/webcomponents/p-75bd655b.entry.js +5 -0
- package/dist/webcomponents/p-7bf78e48.entry.js +5 -0
- package/dist/webcomponents/p-7cc28ecf.entry.js +5 -0
- package/dist/webcomponents/p-7ec01a99.entry.js +5 -0
- package/dist/webcomponents/{p-2c8595d3.entry.js → p-7f17dbca.entry.js} +1 -1
- package/dist/webcomponents/p-8120f3ce.entry.js +5 -0
- package/dist/webcomponents/p-8ded7870.entry.js +5 -0
- package/dist/webcomponents/p-9ab989d1.entry.js +5 -0
- package/dist/webcomponents/p-9be642ff.entry.js +5 -0
- package/dist/webcomponents/p-9d41995a.entry.js +5 -0
- package/dist/webcomponents/p-C_DC6oQW.js +16 -0
- package/dist/webcomponents/{p-EbtQZm5s.js → p-CjVabz-h.js} +1 -1
- package/dist/webcomponents/{p-fOJu6uZR.js → p-CpE_G6IZ.js} +1 -1
- package/dist/webcomponents/{p-ConyRdJe.js → p-CwL52661.js} +2 -2
- package/dist/webcomponents/p-DnwERaeQ.js +5 -0
- package/dist/webcomponents/p-Zk91ebVT.js +5 -0
- package/dist/webcomponents/p-_BMaB_68.js +5 -0
- package/dist/webcomponents/p-a150b61d.entry.js +5 -0
- package/dist/webcomponents/p-a264acf6.entry.js +5 -0
- package/dist/webcomponents/p-a5616523.entry.js +5 -0
- package/dist/webcomponents/p-ae3dfb9c.entry.js +5 -0
- package/dist/webcomponents/p-b1aeb805.entry.js +5 -0
- package/dist/webcomponents/p-b8eea3ef.entry.js +5 -0
- package/dist/webcomponents/p-c6952f8d.entry.js +5 -0
- package/dist/webcomponents/p-c743e5c5.entry.js +5 -0
- package/dist/webcomponents/p-d0c659c3.entry.js +5 -0
- package/dist/webcomponents/p-d3dec923.entry.js +5 -0
- package/dist/webcomponents/{p-31a4694a.entry.js → p-d5405bbe.entry.js} +1 -1
- package/dist/webcomponents/{p-794b701b.entry.js → p-d6d3a552.entry.js} +1 -1
- package/dist/webcomponents/p-dab66328.entry.js +5 -0
- package/dist/webcomponents/{p-8116ee93.entry.js → p-db02533d.entry.js} +1 -1
- package/dist/webcomponents/p-dda22999.entry.js +5 -0
- package/dist/webcomponents/p-e2a46f44.entry.js +5 -0
- package/dist/webcomponents/{p-67774920.entry.js → p-e3680ff8.entry.js} +1 -1
- package/dist/webcomponents/p-e5b9652d.entry.js +5 -0
- package/dist/webcomponents/{p-fb76b1e0.entry.js → p-e7f02302.entry.js} +1 -1
- package/dist/webcomponents/p-f0720e23.entry.js +5 -0
- package/dist/webcomponents/p-f244009d.entry.js +5 -0
- package/dist/webcomponents/p-f32c40ee.entry.js +5 -0
- package/dist/webcomponents/p-f697abbd.entry.js +5 -0
- package/dist/webcomponents/p-f7ed35ef.entry.js +5 -0
- package/dist/webcomponents/p-f8576e0a.entry.js +5 -0
- package/dist/webcomponents/p-fcc62731.entry.js +5 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/br-dropdown_2.cjs.entry.js +0 -2299
- package/dist/cjs/br-input.cjs.entry.js +0 -715
- package/dist/cjs/br-loading.cjs.entry.js +0 -567
- package/dist/cjs/br-pagination.cjs.entry.js +0 -916
- package/dist/cjs/br-table-cell.cjs.entry.js +0 -201
- package/dist/cjs/br-table-header-cell.cjs.entry.js +0 -189
- package/dist/cjs/br-table-row.cjs.entry.js +0 -95
- package/dist/cjs/table-constants-BOPSay0B.js +0 -183
- package/dist/collection/components/table/table-tokens.js +0 -50
- package/dist/collection/components/table/table-utils.js +0 -44
- package/dist/collection/pages/components/select/remote.js +0 -33
- package/dist/collection/pages/components/select/virtualized.js +0 -13
- package/dist/components/p-5h-W9_JR.js +0 -5
- package/dist/components/p-848QkYoM.js +0 -5
- package/dist/components/p-BFHvuEnN.js +0 -5
- package/dist/components/p-BH6QYnAr.js +0 -5
- package/dist/components/p-BcW8O6h2.js +0 -5
- package/dist/components/p-BicHMcSS.js +0 -5
- package/dist/components/p-Bs7iRQTG.js +0 -5
- package/dist/components/p-Bvrw9yWR.js +0 -5
- package/dist/components/p-BzQFMh9j.js +0 -5
- package/dist/components/p-CBHd0-fF.js +0 -5
- package/dist/components/p-CCPHCJjw.js +0 -5
- package/dist/components/p-CXMwM9m4.js +0 -5
- package/dist/components/p-CeNELttN.js +0 -5
- package/dist/components/p-CjtmJTLO.js +0 -5
- package/dist/components/p-D3usVJE2.js +0 -16
- package/dist/components/p-DDu3JV_r.js +0 -5
- package/dist/components/p-DFWqyfUe.js +0 -5
- package/dist/components/p-DL6xuxGG.js +0 -5
- package/dist/components/p-DOX9Uwk1.js +0 -5
- package/dist/components/p-DUq7uT2-.js +0 -5
- package/dist/components/p-Devw08cc.js +0 -5
- package/dist/components/p-Di96UxvH.js +0 -5
- package/dist/components/p-DiLI514I.js +0 -5
- package/dist/components/p-Dp3MsSXu.js +0 -5
- package/dist/components/p-DuLHFTpa.js +0 -5
- package/dist/components/p-DusornQ0.js +0 -5
- package/dist/components/p-OQpiDEK9.js +0 -5
- package/dist/components/p-XW6Hp_Jk.js +0 -5
- package/dist/esm/br-dropdown_2.entry.js +0 -2296
- package/dist/esm/br-input.entry.js +0 -713
- package/dist/esm/br-loading.entry.js +0 -565
- package/dist/esm/br-pagination.entry.js +0 -914
- package/dist/esm/br-table-cell.entry.js +0 -199
- package/dist/esm/br-table-header-cell.entry.js +0 -187
- package/dist/esm/br-table-row.entry.js +0 -93
- package/dist/esm/table-constants-CXMwM9m4.js +0 -170
- package/dist/types/components/table/table-tokens.d.ts +0 -46
- package/dist/types/components/table/table-types.d.ts +0 -107
- package/dist/types/components/table/table-utils.d.ts +0 -47
- package/dist/webcomponents/p-01801ac1.entry.js +0 -5
- package/dist/webcomponents/p-05b459f2.entry.js +0 -5
- package/dist/webcomponents/p-08ac6f09.entry.js +0 -5
- package/dist/webcomponents/p-09817344.entry.js +0 -5
- package/dist/webcomponents/p-13babfc4.entry.js +0 -5
- package/dist/webcomponents/p-15022ab7.entry.js +0 -5
- package/dist/webcomponents/p-172d42c2.entry.js +0 -5
- package/dist/webcomponents/p-1ba60d13.entry.js +0 -5
- package/dist/webcomponents/p-1bb96641.entry.js +0 -5
- package/dist/webcomponents/p-21feda62.entry.js +0 -5
- package/dist/webcomponents/p-23a5cfd7.entry.js +0 -5
- package/dist/webcomponents/p-32ea6342.entry.js +0 -5
- package/dist/webcomponents/p-3658adcf.entry.js +0 -5
- package/dist/webcomponents/p-37914e63.entry.js +0 -5
- package/dist/webcomponents/p-3b0dd0ff.entry.js +0 -5
- package/dist/webcomponents/p-42c9c6c5.entry.js +0 -5
- package/dist/webcomponents/p-473561f2.entry.js +0 -5
- package/dist/webcomponents/p-47c490ef.entry.js +0 -5
- package/dist/webcomponents/p-4b01c60f.entry.js +0 -5
- package/dist/webcomponents/p-5a5ed7d8.entry.js +0 -5
- package/dist/webcomponents/p-609cf652.entry.js +0 -5
- package/dist/webcomponents/p-614683d9.entry.js +0 -5
- package/dist/webcomponents/p-67605757.entry.js +0 -5
- package/dist/webcomponents/p-67d62559.entry.js +0 -5
- package/dist/webcomponents/p-695dbeb0.entry.js +0 -5
- package/dist/webcomponents/p-7352d459.entry.js +0 -5
- package/dist/webcomponents/p-745213f7.entry.js +0 -5
- package/dist/webcomponents/p-7ee564a1.entry.js +0 -5
- package/dist/webcomponents/p-821341dc.entry.js +0 -5
- package/dist/webcomponents/p-8aa6f07c.entry.js +0 -5
- package/dist/webcomponents/p-8ddf3ce3.entry.js +0 -5
- package/dist/webcomponents/p-95f3c44a.entry.js +0 -5
- package/dist/webcomponents/p-96dbb585.entry.js +0 -5
- package/dist/webcomponents/p-9815ab95.entry.js +0 -5
- package/dist/webcomponents/p-9e0324a7.entry.js +0 -5
- package/dist/webcomponents/p-CJipT0in.js +0 -5
- package/dist/webcomponents/p-CXMwM9m4.js +0 -5
- package/dist/webcomponents/p-D3usVJE2.js +0 -16
- package/dist/webcomponents/p-a038be16.entry.js +0 -5
- package/dist/webcomponents/p-a32d17cb.entry.js +0 -5
- package/dist/webcomponents/p-a46f068e.entry.js +0 -5
- package/dist/webcomponents/p-a89b684d.entry.js +0 -5
- package/dist/webcomponents/p-af888d13.entry.js +0 -5
- package/dist/webcomponents/p-b0124459.entry.js +0 -5
- package/dist/webcomponents/p-b063c12f.entry.js +0 -5
- package/dist/webcomponents/p-b07bfdc5.entry.js +0 -5
- package/dist/webcomponents/p-b5d25332.entry.js +0 -5
- package/dist/webcomponents/p-b609b464.entry.js +0 -5
- package/dist/webcomponents/p-b66ab52d.entry.js +0 -5
- package/dist/webcomponents/p-b8d4ace3.entry.js +0 -5
- package/dist/webcomponents/p-c717c745.entry.js +0 -5
- package/dist/webcomponents/p-ce3d689c.entry.js +0 -5
- package/dist/webcomponents/p-d08b6266.entry.js +0 -5
- package/dist/webcomponents/p-d6165aa0.entry.js +0 -5
- package/dist/webcomponents/p-dacb7e2c.entry.js +0 -5
- package/dist/webcomponents/p-db309a11.entry.js +0 -5
- package/dist/webcomponents/p-dc23cb2e.entry.js +0 -5
- package/dist/webcomponents/p-e241caf3.entry.js +0 -5
- package/dist/webcomponents/p-e661c024.entry.js +0 -5
- package/dist/webcomponents/p-e7107869.entry.js +0 -5
- package/dist/webcomponents/p-eb94199d.entry.js +0 -5
- package/dist/webcomponents/p-f8993ae4.entry.js +0 -5
- package/dist/webcomponents/p-f99d8c9c.entry.js +0 -5
- package/dist/webcomponents/p-fdcb54a3.entry.js +0 -5
- package/dist/webcomponents/p-fed02286.entry.js +0 -5
- /package/dist/collection/components/table/{table-types.js → table-footer/table-footer.types.js} +0 -0
- /package/dist/components/{p-5z6jgH1D.js → p-BNckUhK6.js} +0 -0
- /package/dist/webcomponents/{p-BIG-yees.js → p-Bt01zQ7-.js} +0 -0
- /package/dist/webcomponents/{p-zlORkiHQ.js → p-CXDYKUBz.js} +0 -0
|
@@ -0,0 +1,1427 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Construído por SERPRO
|
|
3
|
+
* © https://serpro.gov.br/ - MIT License.
|
|
4
|
+
*/
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
var index = require('./index-BP8UIQro.js');
|
|
8
|
+
var event = require('./event-CmVdNHxl.js');
|
|
9
|
+
var validator = require('./validator-GkkueMOx.js');
|
|
10
|
+
var id = require('./id-DE4jSi-L.js');
|
|
11
|
+
var parts = require('./parts-D5K3ae2C.js');
|
|
12
|
+
var props = require('./props-D8dybmr0.js');
|
|
13
|
+
var slot = require('./slot-CjaqqX7y.js');
|
|
14
|
+
require('./prop-warning-xvEHQz8H.js');
|
|
15
|
+
|
|
16
|
+
const inputCss = () => `*,*::before,*::after{box-sizing:border-box}:host{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}main{display:block}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:rgba(0,0,0,0)}b,strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.d-none{display:none !important}@media (min-width: 576px){.d-sm-block{display:block !important}.d-sm-flex{display:flex !important}}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown>.br-notification{left:auto;right:0}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.justify-content-start{justify-content:flex-start !important}.justify-content-end{justify-content:flex-end !important}.justify-content-center{justify-content:center !important}.align-items-center{align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter)*.5);padding-right:calc(var(--grid-gutter)*.5);width:100%}.col{flex:1 0 0%;min-width:8.3333333333%}.col-auto{flex:0 0 auto;width:auto}.col-2{flex-basis:16.6666666667%;max-width:16.6666666667%}.container,.container-fluid,.container-lg{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:flex;flex-wrap:wrap;margin-left:calc(var(--grid-gutter)*-0.5);margin-right:calc(var(--grid-gutter)*-0.5)}@media (min-width: 576px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}.col-sm-4{flex-basis:33.3333333333%;max-width:33.3333333333%}}@media (min-width: 992px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}.col-lg-3{flex-basis:25%;max-width:25%}}@media (min-width: 1600px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.ease{animation-timing-function:cubic-bezier(0.25, 0.1, 0.25, 1)}.ease-out{animation-timing-function:cubic-bezier(0, 0, 0.58, 1)}.ease-in-out{animation-timing-function:cubic-bezier(0.42, 0, 0.58, 1)}.fast{animation-duration:var(--duration-fast)}.slow{animation-duration:var(--duration-slow)}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mb-1{margin-bottom:var(--spacing-scale-half) !important}.ml-1{margin-left:var(--spacing-scale-half) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.pt-half{padding-top:var(--spacing-scale-half) !important}.highlight{background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}fieldset[disabled]{opacity:1}.text-center{text-align:center !important}.text-right{text-align:right !important}.text-nowrap{white-space:nowrap !important}.text-uppercase{text-transform:uppercase !important}.text-bold{font-weight:700 !important}.text-base{font-size:var(--font-size-scale-base) !important}.text-down-01{font-size:var(--font-size-scale-down-01) !important}@media (min-width: 576px){.text-sm-center{text-align:center !important}.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half)}a:focus{outline:none}a.focus-visible,a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}a{color:var(--interactive);text-decoration:none}.main-content a{text-decoration:underline}button{cursor:pointer}img{max-width:100%;vertical-align:middle}h2,.h2{color:var(--color);font-size:var(--font-size-scale-up-03);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2xh);margin-top:var(--spacing-scale-3xh);padding-bottom:var(--spacing-scale-2xh)}@media (min-width: 576px){.h2,h2{font-size:var(--font-size-scale-up-05);font-weight:var(--font-weight-regular)}}ul,ol{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}table{--table-background:var(--background);--table-color:var(--color);--table-border-color:var(--gray-20);--table-border-style:solid;--table-border-width:1px;--table-hover:var(--color-rgb);--table-padding:var(--spacing-scale-3x);--table-font-weight:var(--font-weight-medium);--table-th-background:var(--background-alternative);--table-th-font-weight:var(--font-weight-semi-bold);--table-row-size:var(--spacing-scale-2x);border-collapse:collapse;width:100%}tr.selected,tr.is-selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}fieldset,.fieldset{border:var(--surface-width-none);margin-bottom:var(--spacing-scale-5x);margin-top:0;padding:0}legend,.legend{color:var(--color);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2x);margin-top:var(--spacing-scale-2x)}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}pre,.pre{background:var(--gray-5);margin:var(--spacing-scale-2x) 0 var(--spacing-scale-4x);padding:var(--spacing-scale-2x)}mark,.mark{background:var(--red-warm-vivid-10);color:var(--color)}*[data-toggle=collapse]:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}*[data-toggle=collapse]:focus{outline:none}*[data-toggle=collapse].focus-visible,*[data-toggle=collapse]:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}@media (prefers-reduced-motion: reduce){:host,:host::before,:host::after,:host *,:host *::before,:host *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}}:host-context([data-wbc-reduced-motion=true])::before,:host-context([data-wbc-reduced-motion=true])::after,:host-context([data-wbc-reduced-motion=true]) *,:host-context([data-wbc-reduced-motion=true]) *::before,:host-context([data-wbc-reduced-motion=true]) *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}.br-input{--input-button-margin:var(--spacing-scale-half);--input-padding:0 var(--spacing-scale-2x);--input-padding-button:var(--spacing-scale-5x);--input-padding-icon:var(--spacing-scale-5x);--input-size:var(--input-medium);--input-small:32px;--input-medium:40px;--input-large:48px;--input-highlight:56px;--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--interactive-light-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);color:var(--color);position:relative}.br-input input{background-color:var(--background-light);border-color:var(--border-color-alternative);border-radius:var(--surface-rounder-sm);border-style:var(--border-style);border-width:var(--border-width);color:var(--color-light);display:block;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);height:var(--input-size);margin-top:var(--spacing-scale-half);padding-bottom:0;padding-left:var(--spacing-scale-2x);padding-right:var(--spacing-scale-2x);padding-top:0;width:100%}.br-input input::-ms-reveal,.br-input input::-ms-clear,.br-input input::-webkit-calendar-picker-indicator{display:none}.br-input input[type=search]::-webkit-search-decoration,.br-input input[type=search]::-webkit-search-cancel-button,.br-input input[type=search]::-webkit-search-results-button,.br-input input[type=search]::-webkit-search-results-decoration{appearance:none}.br-input.input-inline{display:flex}.br-input.input-inline .input-label{margin-right:var(--spacing-scale-baseh);margin-top:calc(var(--input-size)*.5 - var(--spacing-scale-half))}.br-input.input-inline .input-content{flex:1}.br-input .input-group{position:relative}.br-input .input-icon{align-items:center;color:var(--border-color-alternative);display:flex;height:var(--input-size);margin-left:var(--spacing-scale-baseh);position:absolute}.br-input .input-icon+input{padding-left:var(--input-padding-icon)}.br-input .br-button{--button-size:var(--button-small);--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--interactive-light-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);border-radius:50%;float:right;margin-right:var(--input-button-margin);margin-top:calc((var(--input-size) + var(--spacing-scale-half))*-1);padding:0;position:relative;transform:translateY(calc((var(--input-size) - var(--button-size)) * 0.5));width:var(--button-size)}.br-input.input-button input{padding-right:var(--input-padding-button)}.br-input.input-highlight{--input-button-margin:var(--spacing-scale-2x);--input-padding:0 var(--spacing-scale-3x);--input-padding-button:var(--spacing-scale-7x);--input-padding-icon:var(--spacing-scale-7x);--input-size:var(--input-highlight)}.br-input.input-highlight input{background-color:var(--gray-2);border-color:rgba(0,0,0,0);padding-left:var(--spacing-scale-3x);padding-right:var(--spacing-scale-3x)}.br-input.input-highlight .input-icon{margin-left:var(--spacing-scale-3x)}.br-input.input-highlight .input-icon+input{padding-left:var(--spacing-scale-7x)}.br-input .br-list{box-shadow:var(--surface-shadow-md);max-height:530px;overflow:auto;position:absolute;width:100%;z-index:var(--z-index-layer-2)}.br-input .br-list::-webkit-scrollbar{height:var(--spacing-scale-base);width:var(--spacing-scale-base)}.br-input .br-list::-webkit-scrollbar-track{background:var(--gray-10)}.br-input .br-list::-webkit-scrollbar-thumb{background:var(--gray-30)}.br-input .br-list:hover::-webkit-scrollbar-thumb{background:var(--gray-40)}.br-input .br-list .br-item{--item-padding-y:var(--spacing-scale-2x)}.br-input .br-list .br-item:not(:disabled):hover{background-image:linear-gradient(rgba(var(--color-rgb), var(--hover)), rgba(var(--color-rgb), var(--hover)))}.br-input .br-list .br-item:not(:first-child){border-top:var(--surface-width-sm) solid var(--border-color)}.br-input.success input{border-color:var(--success);border-width:2px}.br-input.danger input{border-color:var(--danger);border-width:2px}.br-input.warning input{border-color:var(--warning);border-width:2px}.br-input.info input{border-color:var(--info);border-width:2px}.br-input input:not(:disabled):hover{background-image:linear-gradient(rgba(var(--color-rgb), var(--hover)), rgba(var(--color-rgb), var(--hover)))}.br-input input:focus,.br-input input:focus-visible,.br-input input.focus-visible{border-color:var(--focus) !important;box-shadow:0 0 0 var(--surface-width-md) var(--focus);outline:none}.br-input .feedback{margin-bottom:var(--spacing-scale-half)}.br-input.small{--input-size:var(--input-small)}.br-input.medium{--input-size:var(--input-medium)}.br-input.large{--input-size:var(--input-large)}.br-input.inverted,.br-input.inverted label,.br-input.dark-mode,.br-input.dark-mode label{--color:var(--color-dark);--focus-color:var(--focus-color-dark)}:host{box-sizing:border-box;display:block;margin-bottom:var(--br-input-margin-bottom, var(--spacing-scale-base));max-width:100%;width:100%}:host .br-input .input-icon{margin:var(--spacing-scale-half) var(--spacing-scale-2x) 0}:host .br-input .input-icon+input{padding-left:var(--spacing-scale-6x)}:host([disabled]){opacity:1 !important}.br-input input::placeholder{font-size:var(--input-placeholder-font-size, inherit)}.br-input input[type=color]{width:100%;height:var(--input-size);padding:var(--spacing-scale-half);cursor:pointer}.br-input input[type=color]::-webkit-color-swatch-wrapper{padding:0;display:flex;align-items:center}.br-input input[type=color]::-webkit-color-swatch{border:1px solid var(--border-color-alternative);border-radius:calc(var(--surface-rounder-sm) - 2px);width:calc(var(--input-size) - var(--spacing-scale-2x));height:100%;box-sizing:border-box}.br-input input[type=color]::-moz-color-swatch{border:1px solid var(--border-color-alternative);border-radius:calc(var(--surface-rounder-sm) - 2px);width:calc(var(--input-size) - var(--spacing-scale-2x));height:100%;box-sizing:border-box}.br-input br-button{float:right;margin-right:var(--input-button-margin);margin-top:calc((var(--input-size) + var(--spacing-scale-half))*-1);padding:0;position:relative}.br-input br-button.button-transform{transform:translateY(calc((var(--input-size) - 32px) * 0.5))}.br-input .input-label{margin-top:0 !important}.br-input.input-clear input{padding-right:var(--input-padding-button)}.br-input.input-clear.input-button input{padding-right:calc(var(--input-padding-button)*2)}.br-input.input-clear.input-button br-button.clear-button{margin-right:var(--input-padding-button)}.br-input.input-inline{display:flex;align-items:flex-start}.br-input.input-inline .input-label{display:flex;align-items:center;min-height:var(--input-size)}:host([borderless]) .br-input input{border-color:rgba(0,0,0,0)}:host([borderless]) .br-input input:focus,:host([borderless]) .br-input input:focus-visible{border-color:var(--border-color-alternative)}::slotted([slot=feedback]){display:none}::slotted(br-message[hidden]){display:none !important}:host([state]) ::slotted([slot=feedback]){display:block}`;
|
|
17
|
+
|
|
18
|
+
const INPUT_STATES = ['info', 'warning', 'danger', 'success'];
|
|
19
|
+
const INPUT_AUTOCOMPLETE_VALUES = ['on', 'off'];
|
|
20
|
+
const INPUT_TYPES = [
|
|
21
|
+
'color',
|
|
22
|
+
'email',
|
|
23
|
+
'hidden',
|
|
24
|
+
'password',
|
|
25
|
+
'range',
|
|
26
|
+
'search',
|
|
27
|
+
'number',
|
|
28
|
+
'tel',
|
|
29
|
+
'text',
|
|
30
|
+
'url',
|
|
31
|
+
];
|
|
32
|
+
const Input = class {
|
|
33
|
+
constructor(hostRef) {
|
|
34
|
+
index.registerInstance(this, hostRef);
|
|
35
|
+
this.valueChange = index.createEvent(this, "valueChange", 7);
|
|
36
|
+
this.brClear = index.createEvent(this, "brClear", 7);
|
|
37
|
+
this.brInputActionClick = index.createEvent(this, "brInputActionClick", 6);
|
|
38
|
+
this.brInputValidationChange = index.createEvent(this, "brInputValidationChange", 7);
|
|
39
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
40
|
+
this.elementInternals = hostRef.$hostElement$["s-ei"];
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.elementInternals = hostRef.$hostElement$.attachInternals();
|
|
44
|
+
hostRef.$hostElement$["s-ei"] = this.elementInternals;
|
|
45
|
+
}
|
|
46
|
+
this.formDisabled = false;
|
|
47
|
+
this.hasActionSlot = false;
|
|
48
|
+
this.hasFeedbackSlot = false;
|
|
49
|
+
this.hasValidationLoadingSlot = false;
|
|
50
|
+
this.hasIconSlot = false;
|
|
51
|
+
this.isValidating = false;
|
|
52
|
+
this.validatorMessage = null;
|
|
53
|
+
this.isPasswordVisible = false;
|
|
54
|
+
/**
|
|
55
|
+
* Especifica o tipo de entrada do campo.
|
|
56
|
+
*/
|
|
57
|
+
this.type = 'text';
|
|
58
|
+
/**
|
|
59
|
+
* Ajusta a densidade, alterando o espaçamento interno para um visual mais compacto ou mais expandido.
|
|
60
|
+
* Aceita `small`, `medium` ou `large`. Valores inválidos usam `medium`.
|
|
61
|
+
*/
|
|
62
|
+
this.density = 'medium';
|
|
63
|
+
/**
|
|
64
|
+
* Desativa o input, tornando-o não interativo.
|
|
65
|
+
*/
|
|
66
|
+
this.disabled = false;
|
|
67
|
+
/**
|
|
68
|
+
* Se verdadeiro, o rótulo e o input estarão na mesma linha (layout inline).
|
|
69
|
+
* @deprecated Use `inline`.
|
|
70
|
+
*/
|
|
71
|
+
this.isInline = false;
|
|
72
|
+
/**
|
|
73
|
+
* Se verdadeiro, o input terá destaque visual.
|
|
74
|
+
* @deprecated Use `highlight`.
|
|
75
|
+
*/
|
|
76
|
+
this.isHighlight = false;
|
|
77
|
+
/** Nome acessível usado quando não há um rótulo visual. */
|
|
78
|
+
this.ariaLabel = null;
|
|
79
|
+
/**
|
|
80
|
+
* Identificador único.
|
|
81
|
+
* Caso não seja fornecido, um ID gerado automaticamente será usado.
|
|
82
|
+
*/
|
|
83
|
+
this.customId = id.generateUniqueId('br-input');
|
|
84
|
+
/**
|
|
85
|
+
* Se verdadeiro, o valor do input é exibido, mas não pode ser editado pelo usuário.
|
|
86
|
+
*/
|
|
87
|
+
this.readonly = false;
|
|
88
|
+
/**
|
|
89
|
+
* Se verdadeiro, o input é obrigatório e deve ser preenchido antes que o formulário possa ser enviado.
|
|
90
|
+
*/
|
|
91
|
+
this.required = false;
|
|
92
|
+
/**
|
|
93
|
+
* Valor exibido no input.
|
|
94
|
+
* Pode ser alterado pelo usuário se a propriedade `readonly` não estiver ativa.
|
|
95
|
+
*/
|
|
96
|
+
this.value = '';
|
|
97
|
+
/**
|
|
98
|
+
* Remove a borda do input quando não está em foco.
|
|
99
|
+
* Útil para composições contextuais (ex.: paginação).
|
|
100
|
+
*/
|
|
101
|
+
this.borderless = false;
|
|
102
|
+
/**
|
|
103
|
+
* Controla a correção automática do texto.
|
|
104
|
+
*/
|
|
105
|
+
this.autocorrect = 'off';
|
|
106
|
+
/**
|
|
107
|
+
* Se verdadeiro, permite a entrada de múltiplos e-mails (quando type="email").
|
|
108
|
+
*/
|
|
109
|
+
this.multiple = false;
|
|
110
|
+
/**
|
|
111
|
+
* Exibe um botão para limpar o texto enquanto o campo tem valor e aceita edição.
|
|
112
|
+
* O botão fica à esquerda do botão de ação, quando houver. Ao ser acionado,
|
|
113
|
+
* limpa o valor, emite `input` uma única vez e `brClear`, e devolve o foco ao campo.
|
|
114
|
+
* Não é exibido com `disabled` ou `readonly`.
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
117
|
+
this.clearable = false;
|
|
118
|
+
this.initialValue = '';
|
|
119
|
+
this.manualValidationMessage = '';
|
|
120
|
+
this.validationRunId = 0;
|
|
121
|
+
/**
|
|
122
|
+
* Manipula o evento de input, aplicando máscara se necessário e emitindo o valor atualizado.
|
|
123
|
+
* @param event Evento de input do elemento HTMLInputElement
|
|
124
|
+
*/
|
|
125
|
+
this.handleInput = (event$1) => {
|
|
126
|
+
const inputElement = event$1.target;
|
|
127
|
+
let nextValue = inputElement.value ?? '';
|
|
128
|
+
if (this.hasMaskConfigured()) {
|
|
129
|
+
const maskedValue = this.applyMask(nextValue);
|
|
130
|
+
if (maskedValue !== nextValue) {
|
|
131
|
+
inputElement.value = maskedValue;
|
|
132
|
+
}
|
|
133
|
+
nextValue = maskedValue;
|
|
134
|
+
}
|
|
135
|
+
this.nativeValueUpdate = true;
|
|
136
|
+
try {
|
|
137
|
+
this.value = nextValue;
|
|
138
|
+
}
|
|
139
|
+
finally {
|
|
140
|
+
this.nativeValueUpdate = false;
|
|
141
|
+
}
|
|
142
|
+
this.valueChange.emit(this.value);
|
|
143
|
+
event.redispatchNativeFormEvent(this.el, event$1, 'input');
|
|
144
|
+
};
|
|
145
|
+
this.handleChange = (event$1) => {
|
|
146
|
+
event.redispatchNativeFormEvent(this.el, event$1, 'change');
|
|
147
|
+
void this.validate();
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Renderiza o rótulo do input, considerando se está em modo inline ou não.
|
|
151
|
+
* @returns JSX.Element representando o rótulo do input.
|
|
152
|
+
*/
|
|
153
|
+
this.renderLabel = () => {
|
|
154
|
+
if (typeof this.label === 'string' && this.label.length > 0) {
|
|
155
|
+
if (this.inline ?? this.isInline) {
|
|
156
|
+
return (index.h("div", { class: "input-label" }, index.h("label", { part: "label", class: "text-nowrap", htmlFor: this.customId }, this.label)));
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
return (index.h("label", { part: "label", htmlFor: this.customId }, this.label));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
this.handleSlotChange = (event) => {
|
|
164
|
+
const slot$1 = event.currentTarget;
|
|
165
|
+
const hasContent = slot.hasAssignedSlotContent(slot$1);
|
|
166
|
+
switch (slot$1.name) {
|
|
167
|
+
case 'action':
|
|
168
|
+
this.hasActionSlot = hasContent;
|
|
169
|
+
break;
|
|
170
|
+
case 'feedback':
|
|
171
|
+
this.hasFeedbackSlot = hasContent;
|
|
172
|
+
this.propagateStateToFeedback();
|
|
173
|
+
break;
|
|
174
|
+
case 'icon':
|
|
175
|
+
this.hasIconSlot = hasContent;
|
|
176
|
+
break;
|
|
177
|
+
case 'validation-loading':
|
|
178
|
+
this.hasValidationLoadingSlot = hasContent;
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
this.nativeValueUpdate = false;
|
|
183
|
+
/**
|
|
184
|
+
* Reproduz a submissão implícita do `<input>` nativo: o campo interno fica no
|
|
185
|
+
* Shadow DOM e não pertence ao `<form>` do documento. Segue o botão padrão do
|
|
186
|
+
* formulário (o primeiro com `type="submit"`, inclusive `br-button`): se ele
|
|
187
|
+
* estiver desabilitado, não há envio. A submissão ocorre depois do despacho da
|
|
188
|
+
* tecla, para respeitar `preventDefault()` do consumidor e não ativar o elemento
|
|
189
|
+
* que receber o foco durante o envio.
|
|
190
|
+
*/
|
|
191
|
+
this.handleKeyDown = (event) => {
|
|
192
|
+
if (event.key !== 'Enter' || event.isComposing || event.altKey || event.ctrlKey || event.metaKey)
|
|
193
|
+
return;
|
|
194
|
+
const form = this.elementInternals?.form;
|
|
195
|
+
if (!form || this.isDisabled())
|
|
196
|
+
return;
|
|
197
|
+
setTimeout(() => {
|
|
198
|
+
if (!event.defaultPrevented)
|
|
199
|
+
validator.submitImplicitly(form);
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
this.renderInput = () => {
|
|
203
|
+
return (index.h("input", { part: "input", "aria-label": this.ariaLabel || null, "aria-describedby": [
|
|
204
|
+
this.helpText ? `${this.customId}-help` : '',
|
|
205
|
+
this.hasFeedbackSlot || this.validatorMessage ? `${this.customId}-feedback` : '',
|
|
206
|
+
]
|
|
207
|
+
.filter(Boolean)
|
|
208
|
+
.join(' ') || null, "aria-errormessage": (this.hasFeedbackSlot || this.validatorMessage) && this.internalState === 'danger'
|
|
209
|
+
? `${this.customId}-feedback`
|
|
210
|
+
: null, "aria-busy": this.isValidating ? 'true' : null, ref: (el) => (this.nativeInput = el), class: (this.highlight ?? this.isHighlight) ? 'input-highlight' : null, id: this.customId, style: this.controlWidth != null ? { width: this.controlWidth } : undefined, autocomplete: this.effectiveAutocomplete, disabled: this.isDisabled(), autoCorrect: this.autocorrect, min: this.effectiveMin, max: this.effectiveMax, minLength: this.effectiveMinLength, maxLength: this.effectiveMaxLength, multiple: this.multiple, name: this.name, pattern: this.pattern, step: this.effectiveStep, onInput: this.handleInput, onChange: this.handleChange, onKeyDown: this.handleKeyDown, placeholder: this.placeholder, readonly: this.readonly, required: this.required, title: this.el.title, type: this.effectiveType, value: this.value }));
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Renderiza o texto de ajuda do input, considerando se está definido como string ou slot.
|
|
214
|
+
* @returns JSX.Element representando o texto de ajuda.
|
|
215
|
+
*/
|
|
216
|
+
this.renderHelpText = () => {
|
|
217
|
+
return typeof this.helpText === 'string' && this.helpText.length > 0 ? (index.h("p", { id: `${this.customId}-help`, part: "help-text" }, this.helpText)) : (index.h("span", { part: "help-text" }, index.h("slot", { name: "help-text", onSlotchange: this.handleSlotChange })));
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Renderiza o ícone de visibilidade da senha, alternando entre mostrar e esconder.
|
|
221
|
+
* @returns JSX.Element representando o ícone de visibilidade da senha.
|
|
222
|
+
*/
|
|
223
|
+
this.renderIconPassword = () => {
|
|
224
|
+
const iconName = this.isPasswordVisible ? 'fa-solid:eye-slash' : 'fa-solid:eye';
|
|
225
|
+
return index.h("br-icon", { iconName: iconName, width: "16", height: "16" });
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Alterna a visibilidade da senha, mudando o tipo do input entre 'text' e 'password'.
|
|
229
|
+
* @returns void
|
|
230
|
+
*/
|
|
231
|
+
this.togglePasswordVisibility = () => {
|
|
232
|
+
const input = this.el.shadowRoot?.querySelector('input');
|
|
233
|
+
if (input === null || input === undefined) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
this.isPasswordVisible = !this.isPasswordVisible;
|
|
237
|
+
input.type = this.isPasswordVisible ? 'text' : 'password';
|
|
238
|
+
};
|
|
239
|
+
/** Mantém o foco no campo ao clicar no botão de limpar, como o "x" de um campo de busca nativo. */
|
|
240
|
+
this.keepInputFocus = (event) => {
|
|
241
|
+
event.preventDefault();
|
|
242
|
+
};
|
|
243
|
+
this.handleClearClick = () => {
|
|
244
|
+
if (!this.isClearButtonVisible())
|
|
245
|
+
return;
|
|
246
|
+
this.nativeValueUpdate = true;
|
|
247
|
+
try {
|
|
248
|
+
this.value = '';
|
|
249
|
+
}
|
|
250
|
+
finally {
|
|
251
|
+
this.nativeValueUpdate = false;
|
|
252
|
+
}
|
|
253
|
+
if (this.nativeInput)
|
|
254
|
+
this.nativeInput.value = '';
|
|
255
|
+
this.valueChange.emit('');
|
|
256
|
+
event.dispatchNativeFormEvent(this.el, 'input');
|
|
257
|
+
this.brClear.emit();
|
|
258
|
+
this.nativeInput?.focus();
|
|
259
|
+
};
|
|
260
|
+
this.handleActionClick = (event) => {
|
|
261
|
+
if (this.isDisabled())
|
|
262
|
+
return;
|
|
263
|
+
this.brInputActionClick.emit({ originalEvent: event });
|
|
264
|
+
};
|
|
265
|
+
/**
|
|
266
|
+
* Renderiza o conteúdo do input quando está em linha, considerando se há ícone ou não.
|
|
267
|
+
* @returns JSX.Element representando o conteúdo do input em linha.
|
|
268
|
+
*/
|
|
269
|
+
this.renderInlineInputContent = () => {
|
|
270
|
+
if (this.hasIconSlot) {
|
|
271
|
+
return index.h("div", { class: "input-content" }, this.renderInputWithIcon());
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
return index.h("div", { class: "input-content" }, this.renderInputWithoutIcon());
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Renderiza o conteúdo do input, considerando se há ícone ou não.
|
|
279
|
+
* @returns JSX.Element representando o conteúdo do input.
|
|
280
|
+
*/
|
|
281
|
+
this.renderInputContent = () => {
|
|
282
|
+
return this.hasIconSlot ? this.renderInputWithIcon() : this.renderInputWithoutIcon();
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* Renderiza o conteúdo do input com ícone, organizando os elementos em um grupo e aplicando estilos de largura quando necessário.
|
|
286
|
+
*/
|
|
287
|
+
this.renderInputWithIcon = () => {
|
|
288
|
+
return (index.h("div", { class: "input-group", part: "group", style: this.controlWidth !== undefined && this.controlWidth !== null ? { width: this.controlWidth } : undefined }, this.renderIconSlot(), this.renderInput(), this.renderButton(), this.renderClearButton(), this.renderHelpText()));
|
|
289
|
+
};
|
|
290
|
+
/**
|
|
291
|
+
* Renderiza o conteúdo do input sem ícone, organizando os elementos em um grupo.
|
|
292
|
+
* @returns JSX.Element representando o conteúdo do input sem ícone.
|
|
293
|
+
*/
|
|
294
|
+
this.renderInputWithoutIcon = () => {
|
|
295
|
+
return [this.renderInput(), this.renderButton(), this.renderClearButton(), this.renderHelpText()];
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
formDisabledCallback(disabled) {
|
|
299
|
+
this.formDisabled = disabled;
|
|
300
|
+
}
|
|
301
|
+
formResetCallback() {
|
|
302
|
+
this.validationRunId++;
|
|
303
|
+
this.validatorMessage = null;
|
|
304
|
+
this.isValidating = false;
|
|
305
|
+
this.manualValidationMessage = '';
|
|
306
|
+
this.value = this.initialValue;
|
|
307
|
+
if (this.nativeInput) {
|
|
308
|
+
this.nativeInput.value = this.initialValue;
|
|
309
|
+
this.nativeInput.setCustomValidity('');
|
|
310
|
+
}
|
|
311
|
+
this.syncFormState(this.initialValue);
|
|
312
|
+
}
|
|
313
|
+
formStateRestoreCallback(state) {
|
|
314
|
+
const restoredValue = typeof state === 'string' ? state : '';
|
|
315
|
+
this.value = restoredValue;
|
|
316
|
+
if (this.nativeInput) {
|
|
317
|
+
this.nativeInput.value = restoredValue;
|
|
318
|
+
}
|
|
319
|
+
this.syncFormState(restoredValue);
|
|
320
|
+
}
|
|
321
|
+
handleValueChange(newValue) {
|
|
322
|
+
this.validationRunId++;
|
|
323
|
+
this.validatorMessage = null;
|
|
324
|
+
if (this.state === undefined && this.feedbackState === undefined)
|
|
325
|
+
this.internalState = undefined;
|
|
326
|
+
this.syncFormState(newValue ?? '');
|
|
327
|
+
if (this.nativeValueUpdate) {
|
|
328
|
+
this.updateValidity();
|
|
329
|
+
}
|
|
330
|
+
if (!this.hasMaskConfigured()) {
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
const maskedValue = this.applyMask(newValue ?? '');
|
|
334
|
+
if (maskedValue !== newValue) {
|
|
335
|
+
this.value = maskedValue;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
handleMaskChange() {
|
|
339
|
+
this.applyMaskToValue();
|
|
340
|
+
}
|
|
341
|
+
handleStateChange() {
|
|
342
|
+
if (this.feedbackState === undefined)
|
|
343
|
+
this.updateInternalState();
|
|
344
|
+
}
|
|
345
|
+
handleFeedbackStateChange() {
|
|
346
|
+
this.updateInternalState();
|
|
347
|
+
}
|
|
348
|
+
updateInternalState() {
|
|
349
|
+
this.internalState = this.effectiveState;
|
|
350
|
+
// 🔥 novo comportamento centralizado
|
|
351
|
+
this.propagateStateToFeedback();
|
|
352
|
+
}
|
|
353
|
+
componentWillLoad() {
|
|
354
|
+
this.syncSlotState();
|
|
355
|
+
this.initialValue = this.value ?? '';
|
|
356
|
+
this.internalState = this.effectiveState;
|
|
357
|
+
this.applyMaskToValue();
|
|
358
|
+
this.syncFormState();
|
|
359
|
+
}
|
|
360
|
+
componentDidLoad() {
|
|
361
|
+
this.updateValidity();
|
|
362
|
+
if (this.el.hasAttribute('autofocus'))
|
|
363
|
+
this.el.focus();
|
|
364
|
+
if (this.hasFeedbackSlot) {
|
|
365
|
+
this.propagateStateToFeedback();
|
|
366
|
+
}
|
|
367
|
+
if (typeof MutationObserver !== 'undefined') {
|
|
368
|
+
this.slotContentObserver = new MutationObserver(() => this.syncSlotState());
|
|
369
|
+
this.slotContentObserver.observe(this.el, {
|
|
370
|
+
attributes: true,
|
|
371
|
+
attributeFilter: ['slot'],
|
|
372
|
+
childList: true,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
disconnectedCallback() {
|
|
377
|
+
this.slotContentObserver?.disconnect();
|
|
378
|
+
this.slotContentObserver = undefined;
|
|
379
|
+
}
|
|
380
|
+
componentDidUpdate() {
|
|
381
|
+
// Constraints e valores recebidos antes dos watchers também precisam refletir o DOM atualizado.
|
|
382
|
+
this.syncFormState();
|
|
383
|
+
this.updateValidity();
|
|
384
|
+
}
|
|
385
|
+
componentShouldUpdate(newValue, oldValue, propName) {
|
|
386
|
+
if (propName !== 'value' || !this.nativeValueUpdate)
|
|
387
|
+
return true;
|
|
388
|
+
// A digitação não re-renderiza, exceto quando o botão de limpar precisa aparecer ou sumir.
|
|
389
|
+
return this.clearable && Boolean(newValue) !== Boolean(oldValue);
|
|
390
|
+
}
|
|
391
|
+
componentDidRender() {
|
|
392
|
+
this.syncCssPartAttributes();
|
|
393
|
+
this.applyComboboxState();
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Retorna `true` se o valor do input for válido, caso contrário `false`.
|
|
397
|
+
* Se o input for inválido, exibe uma mensagem de erro padrão do navegador.
|
|
398
|
+
*/
|
|
399
|
+
async reportValidity() {
|
|
400
|
+
return this.elementInternals?.reportValidity?.() ?? true;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Define uma mensagem de validação customizada para o input.
|
|
404
|
+
* Se a mensagem for uma string vazia, o erro customizado é limpo.
|
|
405
|
+
*
|
|
406
|
+
* @param message - Mensagem de erro customizada ou string vazia para limpar
|
|
407
|
+
* @example
|
|
408
|
+
* ```typescript
|
|
409
|
+
* const input = document.querySelector('br-input');
|
|
410
|
+
*
|
|
411
|
+
* // Define erro customizado
|
|
412
|
+
* await input.setCustomValidity('CPF inválido');
|
|
413
|
+
*
|
|
414
|
+
* // Limpa o erro
|
|
415
|
+
* await input.setCustomValidity('');
|
|
416
|
+
* ```
|
|
417
|
+
*/
|
|
418
|
+
async setCustomValidity(message) {
|
|
419
|
+
this.manualValidationMessage = message;
|
|
420
|
+
this.updateValidity();
|
|
421
|
+
}
|
|
422
|
+
resolveValidator() {
|
|
423
|
+
return validator.resolveFormValidator(this.validator);
|
|
424
|
+
}
|
|
425
|
+
async runValidator(validatorFn) {
|
|
426
|
+
try {
|
|
427
|
+
return (await validatorFn(this.value ?? '')) || null;
|
|
428
|
+
}
|
|
429
|
+
catch {
|
|
430
|
+
return 'Não foi possível validar o campo.';
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* Executa a regra customizada e retorna se o campo está válido.
|
|
435
|
+
* Se o validator for assíncrono, aguarda a resposta e ignora resultados
|
|
436
|
+
* antigos quando uma execução posterior já começou.
|
|
437
|
+
*/
|
|
438
|
+
async validate() {
|
|
439
|
+
const validatorFn = this.resolveValidator();
|
|
440
|
+
if (validatorFn == null || this.isDisabled())
|
|
441
|
+
return this.checkValidity();
|
|
442
|
+
const runId = ++this.validationRunId;
|
|
443
|
+
this.isValidating = true;
|
|
444
|
+
this.validatorMessage = null;
|
|
445
|
+
if (this.state === undefined && this.feedbackState === undefined)
|
|
446
|
+
this.internalState = undefined;
|
|
447
|
+
this.updateValidity();
|
|
448
|
+
this.brInputValidationChange.emit({ validating: true, valid: null, message: null });
|
|
449
|
+
await Promise.resolve();
|
|
450
|
+
const message = await this.runValidator(validatorFn);
|
|
451
|
+
if (runId !== this.validationRunId)
|
|
452
|
+
return false;
|
|
453
|
+
this.validatorMessage = message;
|
|
454
|
+
this.isValidating = false;
|
|
455
|
+
if (this.state === undefined && this.feedbackState === undefined) {
|
|
456
|
+
this.internalState = message ? 'danger' : undefined;
|
|
457
|
+
}
|
|
458
|
+
if (message) {
|
|
459
|
+
const feedbackMessage = this.el.shadowRoot?.querySelector('br-message');
|
|
460
|
+
if (feedbackMessage)
|
|
461
|
+
feedbackMessage.message = message;
|
|
462
|
+
}
|
|
463
|
+
this.updateValidity();
|
|
464
|
+
const valid = message === null && (await this.checkValidity());
|
|
465
|
+
this.brInputValidationChange.emit({ validating: false, valid, message });
|
|
466
|
+
return valid;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Retorna `true` se o valor do input for válido, caso contrário `false`.
|
|
470
|
+
* Se o input for inválido, dispara um evento 'invalid'.
|
|
471
|
+
*/
|
|
472
|
+
async checkValidity() {
|
|
473
|
+
return this.elementInternals?.checkValidity?.() ?? true;
|
|
474
|
+
}
|
|
475
|
+
/** Retorna um snapshot serializável da Constraint Validation API. */
|
|
476
|
+
async getValidationState() {
|
|
477
|
+
return validator.getFormValidationState(this.elementInternals);
|
|
478
|
+
}
|
|
479
|
+
/** Seleciona todo o texto do controle nativo, conforme HTMLInputElement.select(). */
|
|
480
|
+
async select() {
|
|
481
|
+
this.nativeInput?.select();
|
|
482
|
+
}
|
|
483
|
+
/** Substitui um intervalo de texto usando a API nativa do input. */
|
|
484
|
+
async setRangeText(replacement, start, end, selectionMode) {
|
|
485
|
+
if (!this.nativeInput)
|
|
486
|
+
return;
|
|
487
|
+
if (start === undefined || end === undefined) {
|
|
488
|
+
this.nativeInput.setRangeText(replacement);
|
|
489
|
+
this.syncProgrammaticValue();
|
|
490
|
+
return;
|
|
491
|
+
}
|
|
492
|
+
this.nativeInput.setRangeText(replacement, start, end, selectionMode);
|
|
493
|
+
this.syncProgrammaticValue();
|
|
494
|
+
}
|
|
495
|
+
/** Define o intervalo selecionado no controle nativo. */
|
|
496
|
+
async setSelectionRange(start, end, direction) {
|
|
497
|
+
this.nativeInput?.setSelectionRange(start, end, direction);
|
|
498
|
+
}
|
|
499
|
+
/** Incrementa o valor numérico pelo step nativo. */
|
|
500
|
+
async stepUp(n) {
|
|
501
|
+
this.nativeInput?.stepUp(n);
|
|
502
|
+
this.syncProgrammaticValue();
|
|
503
|
+
}
|
|
504
|
+
/** Decrementa o valor numérico pelo step nativo. */
|
|
505
|
+
async stepDown(n) {
|
|
506
|
+
this.nativeInput?.stepDown(n);
|
|
507
|
+
this.syncProgrammaticValue();
|
|
508
|
+
}
|
|
509
|
+
/** Abre o picker nativo quando o navegador e o tipo do input oferecem essa API. */
|
|
510
|
+
async showPicker() {
|
|
511
|
+
this.nativeInput?.showPicker?.();
|
|
512
|
+
}
|
|
513
|
+
syncProgrammaticValue() {
|
|
514
|
+
if (!this.nativeInput || this.value === this.nativeInput.value)
|
|
515
|
+
return;
|
|
516
|
+
this.value = this.nativeInput.value;
|
|
517
|
+
this.syncFormState(this.value);
|
|
518
|
+
this.updateValidity();
|
|
519
|
+
}
|
|
520
|
+
updateValidity() {
|
|
521
|
+
if (this.nativeInput) {
|
|
522
|
+
this.nativeInput.setCustomValidity(this.manualValidationMessage || this.validatorMessage || '');
|
|
523
|
+
}
|
|
524
|
+
validator.syncNativeFormValidity(this.elementInternals, this.nativeInput);
|
|
525
|
+
}
|
|
526
|
+
normalizeState(value) {
|
|
527
|
+
return props.normalizePropValue(value, INPUT_STATES, undefined);
|
|
528
|
+
}
|
|
529
|
+
get effectiveType() {
|
|
530
|
+
return props.resolveAllowedPropValue(this.el, 'type', this.type, INPUT_TYPES, 'text');
|
|
531
|
+
}
|
|
532
|
+
get effectiveAutocomplete() {
|
|
533
|
+
return props.resolveAllowedPropValue(this.el, 'autocomplete', this.autocomplete, INPUT_AUTOCOMPLETE_VALUES, undefined, { allowUndefined: true });
|
|
534
|
+
}
|
|
535
|
+
get effectiveState() {
|
|
536
|
+
if (this.feedbackState !== undefined) {
|
|
537
|
+
return props.resolveAllowedPropValue(this.el, 'feedbackState', this.feedbackState, INPUT_STATES, 'info');
|
|
538
|
+
}
|
|
539
|
+
return props.resolveAllowedPropValue(this.el, 'state', this.state, INPUT_STATES, 'info', {
|
|
540
|
+
allowUndefined: true,
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
get effectiveMin() {
|
|
544
|
+
return props.resolveNumberPropValue(this.el, 'min', this.min, -Number.MAX_VALUE, Number.MAX_VALUE, undefined, {
|
|
545
|
+
allowUndefined: true,
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
get effectiveMax() {
|
|
549
|
+
return props.resolveNumberPropValue(this.el, 'max', this.max, -Number.MAX_VALUE, Number.MAX_VALUE, undefined, {
|
|
550
|
+
allowUndefined: true,
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
get effectiveMinLength() {
|
|
554
|
+
return props.resolveIntegerPropValue(this.el, 'minlength', this.minlength, 0, Number.MAX_SAFE_INTEGER, undefined, { allowUndefined: true });
|
|
555
|
+
}
|
|
556
|
+
get effectiveMaxLength() {
|
|
557
|
+
return props.resolveIntegerPropValue(this.el, 'maxlength', this.maxlength, 0, Number.MAX_SAFE_INTEGER, undefined, { allowUndefined: true });
|
|
558
|
+
}
|
|
559
|
+
get effectiveStep() {
|
|
560
|
+
return props.resolvePositiveNumberPropValue(this.el, 'step', this.step, Number.MAX_SAFE_INTEGER, undefined, {
|
|
561
|
+
allowUndefined: true,
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
get effectiveActionTabIndex() {
|
|
565
|
+
return props.resolveIntegerPropValue(this.el, 'actionTabIndex', this.actionTabIndex, -1, Number.MAX_SAFE_INTEGER, undefined, { allowUndefined: true });
|
|
566
|
+
}
|
|
567
|
+
syncCssPartAttributes() {
|
|
568
|
+
if (!this.hasActionSlot)
|
|
569
|
+
return;
|
|
570
|
+
// O botão de limpar tem part próprio (`clear`) e não recebe as parts da ação.
|
|
571
|
+
this.el.shadowRoot
|
|
572
|
+
?.querySelectorAll('br-button.button-transform:not(.clear-button)')
|
|
573
|
+
.forEach((button) => {
|
|
574
|
+
parts.setPartAttributes(button, 'action', 'button: action-button');
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
propagateStateToFeedback() {
|
|
578
|
+
const messageElements = this.el.querySelectorAll('br-message');
|
|
579
|
+
messageElements.forEach((message) => {
|
|
580
|
+
const messageState = this.normalizeState(message.getAttribute('state'));
|
|
581
|
+
if (this.internalState !== undefined && messageState === this.internalState) {
|
|
582
|
+
message.removeAttribute('hidden');
|
|
583
|
+
}
|
|
584
|
+
else {
|
|
585
|
+
message.setAttribute('hidden', 'true');
|
|
586
|
+
}
|
|
587
|
+
});
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Retorna um mapa de classes CSS para o input, baseado no estado interno e nas propriedades do componente.
|
|
591
|
+
* @returns Um objeto representando as classes CSS a serem aplicadas ao input.
|
|
592
|
+
*/
|
|
593
|
+
getInputCssClassMap() {
|
|
594
|
+
const density = props.resolveDensity(this.el, this.density);
|
|
595
|
+
return {
|
|
596
|
+
'br-input': true,
|
|
597
|
+
'input-button': this.hasActionSlot,
|
|
598
|
+
'input-clear': this.isClearButtonVisible(),
|
|
599
|
+
small: density === 'small',
|
|
600
|
+
large: density === 'large',
|
|
601
|
+
medium: density === 'medium',
|
|
602
|
+
'input-inline': this.inline ?? this.isInline,
|
|
603
|
+
'input-highlight': this.highlight ?? this.isHighlight,
|
|
604
|
+
success: this.internalState === 'success',
|
|
605
|
+
danger: this.internalState === 'danger',
|
|
606
|
+
info: this.internalState === 'info',
|
|
607
|
+
warning: this.internalState === 'warning',
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
isDisabled() {
|
|
611
|
+
return validator.isFormControlDisabled(this.disabled, this.formDisabled);
|
|
612
|
+
}
|
|
613
|
+
/**
|
|
614
|
+
* Verifica se um slot específico possui conteúdo.
|
|
615
|
+
* @param slotName Nome do slot a ser verificado
|
|
616
|
+
* @returns true se o slot possui conteúdo, false caso contrário
|
|
617
|
+
*/
|
|
618
|
+
hasSlotContent(slotName) {
|
|
619
|
+
return slot.hasNamedLightDomSlot(this.el, slotName);
|
|
620
|
+
}
|
|
621
|
+
syncSlotState() {
|
|
622
|
+
const next = {
|
|
623
|
+
action: this.hasSlotContent('action'),
|
|
624
|
+
feedback: this.hasSlotContent('feedback'),
|
|
625
|
+
icon: this.hasSlotContent('icon'),
|
|
626
|
+
validationLoading: this.hasSlotContent('validation-loading'),
|
|
627
|
+
};
|
|
628
|
+
if (this.hasActionSlot !== next.action)
|
|
629
|
+
this.hasActionSlot = next.action;
|
|
630
|
+
if (this.hasFeedbackSlot !== next.feedback)
|
|
631
|
+
this.hasFeedbackSlot = next.feedback;
|
|
632
|
+
if (this.hasIconSlot !== next.icon)
|
|
633
|
+
this.hasIconSlot = next.icon;
|
|
634
|
+
if (this.hasValidationLoadingSlot !== next.validationLoading) {
|
|
635
|
+
this.hasValidationLoadingSlot = next.validationLoading;
|
|
636
|
+
}
|
|
637
|
+
if (next.feedback)
|
|
638
|
+
this.propagateStateToFeedback();
|
|
639
|
+
}
|
|
640
|
+
syncFormState(value = this.value ?? '') {
|
|
641
|
+
validator.safeSetFormValue(this.elementInternals, value);
|
|
642
|
+
}
|
|
643
|
+
handleComboboxSync(event) {
|
|
644
|
+
this.comboboxState = event.detail;
|
|
645
|
+
this.applyComboboxState();
|
|
646
|
+
}
|
|
647
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: sincroniza a representação acessível do combobox em uma única transação.
|
|
648
|
+
applyComboboxState() {
|
|
649
|
+
const state = this.comboboxState;
|
|
650
|
+
const root = this.el.shadowRoot;
|
|
651
|
+
const input = root?.querySelector('input');
|
|
652
|
+
if (!state || !root || !input)
|
|
653
|
+
return;
|
|
654
|
+
// A representação acessível compartilha o escopo de IDs do input nativo.
|
|
655
|
+
// A lista visual virtualizada é aria-hidden no orquestrador.
|
|
656
|
+
if (!this.accessibleList || !root.contains(this.accessibleList)) {
|
|
657
|
+
this.accessibleList = document.createElement('div');
|
|
658
|
+
this.accessibleList.id = 'select-accessible-list';
|
|
659
|
+
this.accessibleList.style.cssText =
|
|
660
|
+
'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;';
|
|
661
|
+
root.appendChild(this.accessibleList);
|
|
662
|
+
}
|
|
663
|
+
if (!this.accessibleStatus || !root.contains(this.accessibleStatus)) {
|
|
664
|
+
this.accessibleStatus = document.createElement('div');
|
|
665
|
+
this.accessibleStatus.setAttribute('role', 'status');
|
|
666
|
+
this.accessibleStatus.setAttribute('aria-live', 'polite');
|
|
667
|
+
this.accessibleStatus.style.cssText =
|
|
668
|
+
'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;';
|
|
669
|
+
root.appendChild(this.accessibleStatus);
|
|
670
|
+
}
|
|
671
|
+
if (!this.accessibleDescription || !root.contains(this.accessibleDescription)) {
|
|
672
|
+
this.accessibleDescription = document.createElement('div');
|
|
673
|
+
this.accessibleDescription.id = 'select-accessible-description';
|
|
674
|
+
this.accessibleDescription.style.cssText =
|
|
675
|
+
'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0;';
|
|
676
|
+
root.appendChild(this.accessibleDescription);
|
|
677
|
+
}
|
|
678
|
+
const list = this.accessibleList;
|
|
679
|
+
list.setAttribute('role', 'listbox');
|
|
680
|
+
list.setAttribute('aria-label', state.label);
|
|
681
|
+
list.setAttribute('aria-multiselectable', String(state.multiple));
|
|
682
|
+
list.setAttribute('aria-busy', String(state.loading));
|
|
683
|
+
list.hidden = !state.expanded;
|
|
684
|
+
this.accessibleStatus.textContent =
|
|
685
|
+
state.expanded && state.options.length === 0 ? 'Nenhum resultado encontrado' : '';
|
|
686
|
+
const start = Math.max(0, Math.min(state.activeIndex - 10, state.options.length - 21));
|
|
687
|
+
const end = Math.min(start + 21, state.options.length);
|
|
688
|
+
const desired = new Set();
|
|
689
|
+
const occurrences = new Map();
|
|
690
|
+
let activeId;
|
|
691
|
+
for (let index = 0; index < end; index++) {
|
|
692
|
+
const option = state.options[index];
|
|
693
|
+
// Valores repetidos são distinguidos pelo grupo, rótulo e ordem entre
|
|
694
|
+
// entradas idênticas, sem usar a posição global da opção na coleção.
|
|
695
|
+
const identity = JSON.stringify([option.value, option.group ?? null, option.label ?? null]);
|
|
696
|
+
const occurrence = occurrences.get(identity) ?? 0;
|
|
697
|
+
occurrences.set(identity, occurrence + 1);
|
|
698
|
+
if (index < start)
|
|
699
|
+
continue;
|
|
700
|
+
const encoded = Array.from(identity, (character) => (character.codePointAt(0) ?? 0).toString(36)).join('-');
|
|
701
|
+
const id = `${this.customId}-option-${encoded}-${occurrence}`;
|
|
702
|
+
if (index === state.activeIndex)
|
|
703
|
+
activeId = id;
|
|
704
|
+
desired.add(id);
|
|
705
|
+
let element = Array.from(list.children).find((child) => child.id === id);
|
|
706
|
+
if (!element) {
|
|
707
|
+
element = document.createElement('div');
|
|
708
|
+
element.id = id;
|
|
709
|
+
element.setAttribute('role', 'option');
|
|
710
|
+
}
|
|
711
|
+
element.setAttribute('aria-selected', String(Boolean(option.selected)));
|
|
712
|
+
element.setAttribute('aria-disabled', String(Boolean(option.disabled)));
|
|
713
|
+
element.setAttribute('aria-posinset', String(index + 1));
|
|
714
|
+
element.setAttribute('aria-setsize', String(state.options.length));
|
|
715
|
+
const label = [option.group, option.label ?? option.value].filter(Boolean).join(': ');
|
|
716
|
+
if (element.textContent !== label)
|
|
717
|
+
element.textContent = label;
|
|
718
|
+
const reference = list.children[index - start];
|
|
719
|
+
if (reference !== element)
|
|
720
|
+
list.insertBefore(element, reference ?? null);
|
|
721
|
+
}
|
|
722
|
+
for (const child of Array.from(list.children)) {
|
|
723
|
+
if (!desired.has(child.id))
|
|
724
|
+
child.remove();
|
|
725
|
+
}
|
|
726
|
+
input.setAttribute('role', 'combobox');
|
|
727
|
+
input.setAttribute('aria-label', state.label);
|
|
728
|
+
input.setAttribute('aria-haspopup', 'listbox');
|
|
729
|
+
input.setAttribute('aria-expanded', String(state.expanded));
|
|
730
|
+
input.setAttribute('aria-controls', list.id);
|
|
731
|
+
input.setAttribute('aria-autocomplete', this.readonly ? 'none' : 'list');
|
|
732
|
+
input.setAttribute('aria-required', String(state.required));
|
|
733
|
+
input.setAttribute('aria-invalid', String(state.invalid));
|
|
734
|
+
const description = state.invalid ? state.errorMessage : '';
|
|
735
|
+
this.accessibleDescription.textContent = description;
|
|
736
|
+
const describedBy = new Set((input.getAttribute('aria-describedby') || '').split(/\s+/).filter(Boolean));
|
|
737
|
+
describedBy.delete(this.accessibleDescription.id);
|
|
738
|
+
if (description)
|
|
739
|
+
describedBy.add(this.accessibleDescription.id);
|
|
740
|
+
if (describedBy.size)
|
|
741
|
+
input.setAttribute('aria-describedby', [...describedBy].join(' '));
|
|
742
|
+
else
|
|
743
|
+
input.removeAttribute('aria-describedby');
|
|
744
|
+
if (state.expanded && activeId) {
|
|
745
|
+
input.setAttribute('aria-activedescendant', activeId);
|
|
746
|
+
}
|
|
747
|
+
else {
|
|
748
|
+
input.removeAttribute('aria-activedescendant');
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Renderiza o slot de ícone, caso exista.
|
|
753
|
+
* @returns JSX.Element representando o slot de ícone.
|
|
754
|
+
*/
|
|
755
|
+
renderIconSlot() {
|
|
756
|
+
if (this.hasSlotContent('icon')) {
|
|
757
|
+
return (index.h("div", { class: "input-icon", part: "icon" }, index.h("slot", { name: "icon", onSlotchange: this.handleSlotChange })));
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
isClearButtonVisible() {
|
|
761
|
+
return this.clearable && Boolean(this.value) && !this.readonly && !this.isDisabled();
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Renderiza o botão de limpar quando `clearable` está ativo e há texto editável.
|
|
765
|
+
* @returns JSX.Element do botão ou `null`.
|
|
766
|
+
*/
|
|
767
|
+
renderClearButton() {
|
|
768
|
+
if (!this.isClearButtonVisible())
|
|
769
|
+
return null;
|
|
770
|
+
return (index.h("br-button", { key: "clear", class: "button-transform clear-button", shape: "circle", density: "small", "aria-label": "Limpar texto", onMouseDown: this.keepInputFocus, onClick: this.handleClearClick, part: "clear" }, index.h("br-icon", { iconName: "fa-solid:times", width: "16", height: "16", "aria-hidden": "true" })));
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Renderiza o botão de ação do input, considerando o tipo de input e slots disponíveis.
|
|
774
|
+
* @returns JSX.Element representando o botão de ação.
|
|
775
|
+
*/
|
|
776
|
+
renderButton() {
|
|
777
|
+
if (this.effectiveType === 'password') {
|
|
778
|
+
return (index.h("br-button", { key: "password", class: "button-transform", shape: "circle", density: "small", "aria-label": this.isPasswordVisible ? 'Esconder senha' : 'Mostrar senha', onClick: this.togglePasswordVisibility, part: "action" }, this.renderIconPassword()));
|
|
779
|
+
}
|
|
780
|
+
else if (this.hasSlotContent('action')) {
|
|
781
|
+
return (index.h("br-button", { key: "action", class: "button-transform", shape: "circle", density: "small", "aria-label": this.actionLabel, customTabIndex: this.effectiveActionTabIndex, onClick: this.handleActionClick, part: "action" }, index.h("slot", { name: "action", onSlotchange: this.handleSlotChange })));
|
|
782
|
+
}
|
|
783
|
+
return null;
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* Renderiza o slot de feedback, caso exista, permitindo que mensagens de feedback sejam exibidas em resposta a interações do usuário com o input.
|
|
787
|
+
* @returns JSX.Element representando o slot de feedback.
|
|
788
|
+
*/
|
|
789
|
+
renderFeedback() {
|
|
790
|
+
return (index.h("span", { id: `${this.customId}-feedback`, part: "feedback", hidden: this.internalState === undefined && !this.validatorMessage && !this.hasFeedbackSlot }, index.h("slot", { name: "feedback", onSlotchange: this.handleSlotChange }), !this.hasFeedbackSlot && this.validatorMessage ? (index.h("br-message", { state: "danger", message: this.validatorMessage })) : null));
|
|
791
|
+
}
|
|
792
|
+
renderValidationLoading() {
|
|
793
|
+
if (!this.isValidating)
|
|
794
|
+
return null;
|
|
795
|
+
return this.hasValidationLoadingSlot ? (index.h("span", { class: "validation-loading", "aria-live": "polite" }, index.h("slot", { name: "validation-loading", onSlotchange: this.handleSlotChange }))) : (index.h("span", { class: "validation-loading", "aria-live": "polite" }, index.h("br-loading", { size: "small", label: "Validando" })));
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* Aplica a máscara configurada ao valor do input, se houver.
|
|
799
|
+
* @returns void
|
|
800
|
+
*/
|
|
801
|
+
applyMaskToValue() {
|
|
802
|
+
if (!this.hasMaskConfigured() || this.value == null) {
|
|
803
|
+
return;
|
|
804
|
+
}
|
|
805
|
+
const maskedValue = this.applyMask(this.value);
|
|
806
|
+
if (this.value !== maskedValue) {
|
|
807
|
+
this.value = maskedValue;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Aplica a máscara configurada a um valor específico.
|
|
812
|
+
* @param value O valor a ser mascarado.
|
|
813
|
+
* @returns O valor mascarado.
|
|
814
|
+
*/
|
|
815
|
+
applyMask(value) {
|
|
816
|
+
if (!this.hasMaskConfigured()) {
|
|
817
|
+
return value ?? '';
|
|
818
|
+
}
|
|
819
|
+
const mask = this.mask || '';
|
|
820
|
+
const digits = (value ?? '').replace(/\D/g, '');
|
|
821
|
+
if (digits.length === 0) {
|
|
822
|
+
return '';
|
|
823
|
+
}
|
|
824
|
+
let maskedValue = '';
|
|
825
|
+
let digitIndex = 0;
|
|
826
|
+
for (let i = 0; i < mask.length && digitIndex < digits.length; i++) {
|
|
827
|
+
const maskChar = mask[i];
|
|
828
|
+
if (maskChar === '#') {
|
|
829
|
+
maskedValue += digits[digitIndex];
|
|
830
|
+
digitIndex++;
|
|
831
|
+
}
|
|
832
|
+
else {
|
|
833
|
+
maskedValue += maskChar;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
return maskedValue;
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Verifica se uma máscara está configurada.
|
|
840
|
+
* @returns boolean indicando se uma máscara está configurada.
|
|
841
|
+
*/
|
|
842
|
+
hasMaskConfigured() {
|
|
843
|
+
return typeof this.mask === 'string' && this.mask.length > 0;
|
|
844
|
+
}
|
|
845
|
+
/**
|
|
846
|
+
* Renderiza o componente de input.
|
|
847
|
+
* @returns JSX.Element representando o componente de input.
|
|
848
|
+
*/
|
|
849
|
+
render() {
|
|
850
|
+
return (index.h(index.Host, { key: 'f8e512ce62ed261fc8365496cde577cfa89ad357' }, index.h("div", { key: '0f982af831529124c67c1110007c94060a551b26', class: this.getInputCssClassMap(), part: "container" }, this.renderLabel(), (this.inline ?? this.isInline) ? this.renderInlineInputContent() : this.renderInputContent(), this.renderFeedback(), this.renderValidationLoading())));
|
|
851
|
+
}
|
|
852
|
+
static get delegatesFocus() { return true; }
|
|
853
|
+
static get formAssociated() { return true; }
|
|
854
|
+
get el() { return index.getElement(this); }
|
|
855
|
+
static get watchers() { return {
|
|
856
|
+
"value": [{
|
|
857
|
+
"handleValueChange": 0
|
|
858
|
+
}],
|
|
859
|
+
"mask": [{
|
|
860
|
+
"handleMaskChange": 0
|
|
861
|
+
}],
|
|
862
|
+
"state": [{
|
|
863
|
+
"handleStateChange": 0
|
|
864
|
+
}],
|
|
865
|
+
"feedbackState": [{
|
|
866
|
+
"handleFeedbackStateChange": 0
|
|
867
|
+
}]
|
|
868
|
+
}; }
|
|
869
|
+
};
|
|
870
|
+
Input.style = inputCss();
|
|
871
|
+
|
|
872
|
+
const loadingCss = () => `*,*::before,*::after{box-sizing:border-box}:host{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}main{display:block}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:rgba(0,0,0,0)}b,strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.d-none{display:none !important}@media (min-width: 576px){.d-sm-block{display:block !important}.d-sm-flex{display:flex !important}}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown>.br-notification{left:auto;right:0}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.justify-content-start{justify-content:flex-start !important}.justify-content-end{justify-content:flex-end !important}.justify-content-center{justify-content:center !important}.align-items-center{align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter)*.5);padding-right:calc(var(--grid-gutter)*.5);width:100%}.col{flex:1 0 0%;min-width:8.3333333333%}.col-auto{flex:0 0 auto;width:auto}.col-2{flex-basis:16.6666666667%;max-width:16.6666666667%}.container,.container-fluid,.container-lg{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:flex;flex-wrap:wrap;margin-left:calc(var(--grid-gutter)*-0.5);margin-right:calc(var(--grid-gutter)*-0.5)}@media (min-width: 576px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}.col-sm-4{flex-basis:33.3333333333%;max-width:33.3333333333%}}@media (min-width: 992px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}.col-lg-3{flex-basis:25%;max-width:25%}}@media (min-width: 1600px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.ease{animation-timing-function:cubic-bezier(0.25, 0.1, 0.25, 1)}.ease-out{animation-timing-function:cubic-bezier(0, 0, 0.58, 1)}.ease-in-out{animation-timing-function:cubic-bezier(0.42, 0, 0.58, 1)}.fast{animation-duration:var(--duration-fast)}.slow{animation-duration:var(--duration-slow)}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mb-1{margin-bottom:var(--spacing-scale-half) !important}.ml-1{margin-left:var(--spacing-scale-half) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.pt-half{padding-top:var(--spacing-scale-half) !important}.highlight{background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}fieldset[disabled]{opacity:1}.text-center{text-align:center !important}.text-right{text-align:right !important}.text-nowrap{white-space:nowrap !important}.text-uppercase{text-transform:uppercase !important}.text-bold{font-weight:700 !important}.text-base{font-size:var(--font-size-scale-base) !important}.text-down-01{font-size:var(--font-size-scale-down-01) !important}@media (min-width: 576px){.text-sm-center{text-align:center !important}.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half)}a:focus{outline:none}a.focus-visible,a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}a{color:var(--interactive);text-decoration:none}.main-content a{text-decoration:underline}button{cursor:pointer}img{max-width:100%;vertical-align:middle}h2,.h2{color:var(--color);font-size:var(--font-size-scale-up-03);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2xh);margin-top:var(--spacing-scale-3xh);padding-bottom:var(--spacing-scale-2xh)}@media (min-width: 576px){.h2,h2{font-size:var(--font-size-scale-up-05);font-weight:var(--font-weight-regular)}}ul,ol{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}table{--table-background:var(--background);--table-color:var(--color);--table-border-color:var(--gray-20);--table-border-style:solid;--table-border-width:1px;--table-hover:var(--color-rgb);--table-padding:var(--spacing-scale-3x);--table-font-weight:var(--font-weight-medium);--table-th-background:var(--background-alternative);--table-th-font-weight:var(--font-weight-semi-bold);--table-row-size:var(--spacing-scale-2x);border-collapse:collapse;width:100%}tr.selected,tr.is-selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}fieldset,.fieldset{border:var(--surface-width-none);margin-bottom:var(--spacing-scale-5x);margin-top:0;padding:0}legend,.legend{color:var(--color);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2x);margin-top:var(--spacing-scale-2x)}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}pre,.pre{background:var(--gray-5);margin:var(--spacing-scale-2x) 0 var(--spacing-scale-4x);padding:var(--spacing-scale-2x)}mark,.mark{background:var(--red-warm-vivid-10);color:var(--color)}*[data-toggle=collapse]:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}*[data-toggle=collapse]:focus{outline:none}*[data-toggle=collapse].focus-visible,*[data-toggle=collapse]:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}@media (prefers-reduced-motion: reduce){:host,:host::before,:host::after,:host *,:host *::before,:host *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}}:host-context([data-wbc-reduced-motion=true])::before,:host-context([data-wbc-reduced-motion=true])::after,:host-context([data-wbc-reduced-motion=true]) *,:host-context([data-wbc-reduced-motion=true]) *::before,:host-context([data-wbc-reduced-motion=true]) *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}:host{display:inline-flex;--loading-animation-duration:2s;--loading-transition-duration:var(--duration-moderate, 500ms)}.br-loading{display:flex;align-items:center;justify-content:center}.br-loading.loading-mode-spinner{margin:16px}.br-loading.loading-mode-progress{margin:28px}:host([compact]) .br-loading{margin:0}:host([compact]) .loading-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.loading-wrapper{display:flex;align-items:center;gap:8px}.loading-label-top{flex-direction:column}.loading-label-bottom{flex-direction:column}.loading-label-right{flex-direction:row}.loading-label-left{flex-direction:row}.loading-label-top .loading-label{margin-bottom:8px;margin-top:0;text-align:center}.loading-label-bottom .loading-label{margin-top:8px;margin-bottom:0;text-align:center}.loading-label-right .loading-label{margin-left:8px;margin-right:0;text-align:left}.loading-label-left .loading-label{margin-left:8px;margin-right:0;text-align:left}.loading-spinner,.loading-progress{display:block;transform-origin:center}.loading-spinner{animation:none}@media (prefers-reduced-motion: no-preference){.loading-spinner{animation:loading-rotate var(--loading-animation-duration) var(--animation-ease-linear, linear) infinite}}.loading-spinner-track{stroke:var(--gray-20);transform:rotate(-90deg);transform-origin:center}.loading-indicator{stroke:var(--blue-warm-vivid-70);stroke-linecap:round;animation:none}@media (prefers-reduced-motion: no-preference){.loading-indicator{animation:loading-dash var(--loading-animation-duration) var(--animation-ease-in-out, ease-in-out) infinite}}@media (prefers-reduced-motion: no-preference){.br-loading.loading-large .loading-indicator{animation-name:loading-dash-large}}@media (prefers-reduced-motion: no-preference){.br-loading.loading-medium .loading-indicator{animation-name:loading-dash-medium}}@media (prefers-reduced-motion: no-preference){.br-loading.loading-small .loading-indicator{animation-name:loading-dash-small}}.loading-indicator-progress{stroke:var(--blue-warm-vivid-70);stroke-linecap:round;transition:none}@media (prefers-reduced-motion: no-preference){.loading-indicator-progress{transition:stroke-dashoffset var(--loading-transition-duration) var(--animation-ease, ease)}}.loading-indicator-progress{transform:rotate(-90deg);transform-origin:center}.loading-percentage{font-size:var(--loading-percentage-font-size, var(--font-size-scale-up-02));font-weight:var(--font-weight-semi-bold);fill:var(--blue-warm-vivid-70);pointer-events:none}.loading-label{font-size:var(--font-size-scale-base);font-weight:var(--font-weight-medium);color:var(--gray-80);text-align:center;margin-top:16px}@keyframes loading-rotate{100%{transform:rotate(360deg)}}@keyframes loading-dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}@keyframes loading-dash-large{0%{stroke-dasharray:1,218;stroke-dashoffset:0}50%{stroke-dasharray:131,218;stroke-dashoffset:-51}100%{stroke-dasharray:131,218;stroke-dashoffset:-181}}@keyframes loading-dash-medium{0%{stroke-dasharray:6,129;stroke-dashoffset:0}50%{stroke-dasharray:78,129;stroke-dashoffset:-30}100%{stroke-dasharray:78,129;stroke-dashoffset:-107}}@keyframes loading-dash-small{0%{stroke-dasharray:1,80;stroke-dashoffset:0}50%{stroke-dasharray:48,80;stroke-dashoffset:-19}100%{stroke-dasharray:48,80;stroke-dashoffset:-66}}`;
|
|
873
|
+
|
|
874
|
+
/** Mapa que relaciona `LoadingMode` e `LoadingSize` com a dimensão do SVG em pixels. */
|
|
875
|
+
const DIMENSION_MAP = {
|
|
876
|
+
spinner: {
|
|
877
|
+
small: 24,
|
|
878
|
+
medium: 44,
|
|
879
|
+
large: 64,
|
|
880
|
+
},
|
|
881
|
+
progress: {
|
|
882
|
+
small: 64,
|
|
883
|
+
medium: 84,
|
|
884
|
+
large: 104,
|
|
885
|
+
},
|
|
886
|
+
};
|
|
887
|
+
/** Mapa que relaciona `LoadingMode` e `LoadingSize` com a espessura do traço. */
|
|
888
|
+
const STROKE_WIDTH_MAP = {
|
|
889
|
+
spinner: {
|
|
890
|
+
small: 2,
|
|
891
|
+
medium: 3,
|
|
892
|
+
large: 4,
|
|
893
|
+
},
|
|
894
|
+
progress: {
|
|
895
|
+
small: 3,
|
|
896
|
+
medium: 4,
|
|
897
|
+
large: 5,
|
|
898
|
+
},
|
|
899
|
+
};
|
|
900
|
+
/** Mapa que relaciona `LoadingSize` com o tamanho da fonte do percentual no modo `progress`. */
|
|
901
|
+
const PERCENTAGE_FONT_SIZE_MAP = {
|
|
902
|
+
small: 'var(--font-size-scale-base)',
|
|
903
|
+
medium: 'var(--font-size-scale-up-02)',
|
|
904
|
+
large: 'var(--font-size-scale-up-03)',
|
|
905
|
+
};
|
|
906
|
+
/**
|
|
907
|
+
* Mapa que relaciona `LoadingSpeed` com a duração da animação (s)
|
|
908
|
+
*/
|
|
909
|
+
const SPEED_MAP = {
|
|
910
|
+
fast: 1.4,
|
|
911
|
+
normal: 2,
|
|
912
|
+
slow: 2.6,
|
|
913
|
+
};
|
|
914
|
+
/**
|
|
915
|
+
* Mapa que relaciona `LoadingSpeed` com a duração da transição (s) no modo `progress`.
|
|
916
|
+
*/
|
|
917
|
+
const TRANSITION_MAP = {
|
|
918
|
+
fast: 0.3,
|
|
919
|
+
normal: 0.5,
|
|
920
|
+
slow: 0.8,
|
|
921
|
+
};
|
|
922
|
+
const LOADING_LABEL_POSITIONS = ['top', 'right', 'bottom', 'left'];
|
|
923
|
+
const LOADING_MODES = ['spinner', 'progress'];
|
|
924
|
+
const LOADING_SPEEDS = ['slow', 'normal', 'fast'];
|
|
925
|
+
const LOADING_COMPLETIONS = ['persist', 'reset', 'hide'];
|
|
926
|
+
const Loading = class {
|
|
927
|
+
constructor(hostRef) {
|
|
928
|
+
index.registerInstance(this, hostRef);
|
|
929
|
+
this.brLoadingChange = index.createEvent(this, "brLoadingChange", 6);
|
|
930
|
+
this.brLoadingComplete = index.createEvent(this, "brLoadingComplete", 6);
|
|
931
|
+
this.brLoadingReset = index.createEvent(this, "brLoadingReset", 6);
|
|
932
|
+
this.brLoadingCancel = index.createEvent(this, "brLoadingCancel", 6);
|
|
933
|
+
this.brIndeterminateStateChange = index.createEvent(this, "brIndeterminateStateChange", 6);
|
|
934
|
+
this.brDidShow = index.createEvent(this, "brDidShow", 6);
|
|
935
|
+
this.brLoadingShow = index.createEvent(this, "brLoadingShow", 6);
|
|
936
|
+
this.brDidHide = index.createEvent(this, "brDidHide", 6);
|
|
937
|
+
this.brLoadingHide = index.createEvent(this, "brLoadingHide", 6);
|
|
938
|
+
/**
|
|
939
|
+
* Valor exibido no texto de progresso durante a transição.
|
|
940
|
+
*/
|
|
941
|
+
this.displayedValue = 0;
|
|
942
|
+
/**
|
|
943
|
+
* Define a posição da label em relação ao loading. Valores inválidos usam `bottom`.
|
|
944
|
+
* @default 'bottom'
|
|
945
|
+
*/
|
|
946
|
+
this.labelPosition = 'bottom';
|
|
947
|
+
/**
|
|
948
|
+
* Identificador único do componente.
|
|
949
|
+
* Quando omitido, um valor é gerado automaticamente.
|
|
950
|
+
*
|
|
951
|
+
* > **Padrão:** valor único gerado por generateUniqueId().
|
|
952
|
+
*
|
|
953
|
+
*/
|
|
954
|
+
this.customId = id.generateUniqueId();
|
|
955
|
+
/**
|
|
956
|
+
* Define o modo de exibição do componente. Valores inválidos usam `spinner`.
|
|
957
|
+
* @default 'spinner'
|
|
958
|
+
*/
|
|
959
|
+
this.mode = 'spinner';
|
|
960
|
+
/**
|
|
961
|
+
* Define o tamanho visual nos modos `spinner` e `progress`.
|
|
962
|
+
* @default 'medium'
|
|
963
|
+
* @deprecated Use `density`.
|
|
964
|
+
*/
|
|
965
|
+
this.size = 'medium';
|
|
966
|
+
/**
|
|
967
|
+
* Remove o espaçamento externo e oculta visualmente o rótulo, mantendo-o
|
|
968
|
+
* disponível para tecnologias assistivas. Use em áreas compactas, como
|
|
969
|
+
* controles de paginação ou campos de formulário.
|
|
970
|
+
* @default false
|
|
971
|
+
*/
|
|
972
|
+
this.compact = false;
|
|
973
|
+
/**
|
|
974
|
+
* Define a velocidade da animação/transição. Valores inválidos usam `normal`.
|
|
975
|
+
* @default 'normal'
|
|
976
|
+
*/
|
|
977
|
+
this.speed = 'normal';
|
|
978
|
+
/**
|
|
979
|
+
* Define o progresso no modo `progress`.
|
|
980
|
+
* No modo `spinner`, esta prop não tem efeito.
|
|
981
|
+
* Valores não numéricos usam `0`; valores fora de `0`–`100` são limitados ao intervalo.
|
|
982
|
+
* @default 0
|
|
983
|
+
*/
|
|
984
|
+
this.value = 0;
|
|
985
|
+
/**
|
|
986
|
+
* Define o comportamento quando o progresso atinge 100. Valores inválidos usam `persist`.
|
|
987
|
+
* No modo `spinner`, esta prop não tem efeito.
|
|
988
|
+
* @default 'persist'
|
|
989
|
+
*/
|
|
990
|
+
this.completion = 'persist';
|
|
991
|
+
/**
|
|
992
|
+
* Define se o botão de cancelamento será exibido.
|
|
993
|
+
* Ao pressionar o botão, o evento `brLoadingCancel` é emitido.
|
|
994
|
+
* No modo `spinner`, esta prop não tem efeito.
|
|
995
|
+
* @default false
|
|
996
|
+
*/
|
|
997
|
+
this.cancelable = false;
|
|
998
|
+
/**
|
|
999
|
+
* Define o texto do botão de cancelamento.
|
|
1000
|
+
* No modo `spinner`, esta prop não tem efeito.
|
|
1001
|
+
* @default 'Cancelar'
|
|
1002
|
+
*/
|
|
1003
|
+
this.cancelLabel = 'Cancelar';
|
|
1004
|
+
this.reducedMotionMediaQuery = null;
|
|
1005
|
+
/** Último estado lógico de atividade no modo `spinner`. */
|
|
1006
|
+
this.isIndeterminateActive = false;
|
|
1007
|
+
/**
|
|
1008
|
+
* Trata o clique no botão de cancelamento.
|
|
1009
|
+
*/
|
|
1010
|
+
this.handleCancelClick = () => {
|
|
1011
|
+
if (this.effectiveMode !== 'progress' || !this.cancelable)
|
|
1012
|
+
return;
|
|
1013
|
+
this.brLoadingCancel.emit({ value: this.normalizedValue });
|
|
1014
|
+
};
|
|
1015
|
+
this.onReducedMotionChange = (event) => {
|
|
1016
|
+
if (!event.matches)
|
|
1017
|
+
return;
|
|
1018
|
+
this.stopProgressAnimation();
|
|
1019
|
+
this.normalizeInputValue(this.value);
|
|
1020
|
+
this.displayedValue = this.normalizedValue;
|
|
1021
|
+
};
|
|
1022
|
+
this.onReducedMotionOverrideChange = (event) => {
|
|
1023
|
+
const reducedMotion = event.detail?.reducedMotion;
|
|
1024
|
+
if (reducedMotion === true) {
|
|
1025
|
+
this.stopProgressAnimation();
|
|
1026
|
+
this.normalizeInputValue(this.value);
|
|
1027
|
+
this.displayedValue = this.normalizedValue;
|
|
1028
|
+
}
|
|
1029
|
+
else if (reducedMotion === false && this.effectiveMode === 'progress') {
|
|
1030
|
+
this.syncDisplayedProgress(this.normalizedValue);
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* Reage a mudanças em `value` no modo `progress`.
|
|
1036
|
+
* @param newValue Novo valor recebido.
|
|
1037
|
+
*/
|
|
1038
|
+
handleCompletion(newValue) {
|
|
1039
|
+
const sanitizedValue = this.normalizeInputValue(newValue);
|
|
1040
|
+
if (sanitizedValue !== newValue) {
|
|
1041
|
+
return;
|
|
1042
|
+
}
|
|
1043
|
+
if (this.effectiveMode !== 'progress')
|
|
1044
|
+
return;
|
|
1045
|
+
this.brLoadingChange.emit({ value: this.normalizedValue });
|
|
1046
|
+
this.syncDisplayedProgress(this.normalizedValue);
|
|
1047
|
+
this.applyCompletionBehavior(newValue);
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Reage a mudanças em `mode` e atualiza o estado lógico de atividade.
|
|
1051
|
+
*/
|
|
1052
|
+
handleModeChange() {
|
|
1053
|
+
this.syncIndeterminateActiveState();
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* Etapa do ciclo de vida: desmontagem do componente.
|
|
1057
|
+
* Libera recursos de animação pendentes.
|
|
1058
|
+
*/
|
|
1059
|
+
disconnectedCallback() {
|
|
1060
|
+
this.cleanupProgressResources();
|
|
1061
|
+
this.reducedMotionMediaQuery?.removeEventListener('change', this.onReducedMotionChange);
|
|
1062
|
+
if (typeof document !== 'undefined') {
|
|
1063
|
+
document.removeEventListener('wbcReducedMotionChange', this.onReducedMotionOverrideChange);
|
|
1064
|
+
}
|
|
1065
|
+
this.reducedMotionMediaQuery = null;
|
|
1066
|
+
if (this.isIndeterminateActive) {
|
|
1067
|
+
this.isIndeterminateActive = false;
|
|
1068
|
+
this.brIndeterminateStateChange.emit({ active: false });
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* Etapa do ciclo de vida: antes da primeira renderização.
|
|
1073
|
+
* Inicializa o estado visual do progresso.
|
|
1074
|
+
*/
|
|
1075
|
+
componentWillLoad() {
|
|
1076
|
+
this.normalizeInputValue(this.value);
|
|
1077
|
+
this.initializeProgressDisplay();
|
|
1078
|
+
this.syncIndeterminateActiveState();
|
|
1079
|
+
}
|
|
1080
|
+
componentDidLoad() {
|
|
1081
|
+
if (typeof window === 'undefined' || typeof window.matchMedia !== 'function')
|
|
1082
|
+
return;
|
|
1083
|
+
this.reducedMotionMediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)');
|
|
1084
|
+
this.reducedMotionMediaQuery.addEventListener('change', this.onReducedMotionChange);
|
|
1085
|
+
document.addEventListener('wbcReducedMotionChange', this.onReducedMotionOverrideChange);
|
|
1086
|
+
if (this.effectiveMode === 'progress') {
|
|
1087
|
+
this.syncDisplayedProgress(this.normalizedValue);
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* Define o valor do progresso.
|
|
1092
|
+
* @param value Valor desejado.
|
|
1093
|
+
* @returns Progresso normalizado.
|
|
1094
|
+
*/
|
|
1095
|
+
async setValue(value) {
|
|
1096
|
+
this.normalizeInputValue(value);
|
|
1097
|
+
return { value: this.normalizedValue };
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* Soma um valor ao progresso atual.
|
|
1101
|
+
* @param step Incremento aplicado.
|
|
1102
|
+
* @returns Progresso normalizado.
|
|
1103
|
+
*/
|
|
1104
|
+
async incrementValue(step = 1) {
|
|
1105
|
+
this.value = this.normalizedValue + step;
|
|
1106
|
+
return { value: this.normalizedValue };
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* Define o progresso como concluído.
|
|
1110
|
+
* @returns Progresso normalizado.
|
|
1111
|
+
*/
|
|
1112
|
+
async complete() {
|
|
1113
|
+
this.value = 100;
|
|
1114
|
+
return { value: this.normalizedValue };
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* Reinicia o progresso e exibe o componente.
|
|
1118
|
+
* @returns Progresso normalizado.
|
|
1119
|
+
*/
|
|
1120
|
+
async reset() {
|
|
1121
|
+
this.value = 0;
|
|
1122
|
+
this.setVisibility(true);
|
|
1123
|
+
if (this.effectiveMode === 'progress') {
|
|
1124
|
+
this.brLoadingReset.emit({ value: this.normalizedValue });
|
|
1125
|
+
}
|
|
1126
|
+
return { value: this.normalizedValue };
|
|
1127
|
+
}
|
|
1128
|
+
/**
|
|
1129
|
+
* Exibe o componente.
|
|
1130
|
+
* @returns Estado de visibilidade.
|
|
1131
|
+
*/
|
|
1132
|
+
async show() {
|
|
1133
|
+
this.setVisibility(true);
|
|
1134
|
+
return { visible: true };
|
|
1135
|
+
}
|
|
1136
|
+
/**
|
|
1137
|
+
* Oculta o componente.
|
|
1138
|
+
* @returns Estado de visibilidade.
|
|
1139
|
+
*/
|
|
1140
|
+
async hide() {
|
|
1141
|
+
this.setVisibility(false);
|
|
1142
|
+
return { visible: false };
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Retorna o progresso no intervalo de 0 a 100.
|
|
1146
|
+
* @private
|
|
1147
|
+
*/
|
|
1148
|
+
get normalizedValue() {
|
|
1149
|
+
return this.toValidProgressValue(this.value);
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* Retorna a dimensão do SVG.
|
|
1153
|
+
* @private
|
|
1154
|
+
*/
|
|
1155
|
+
get dimension() {
|
|
1156
|
+
return DIMENSION_MAP[this.effectiveMode][this.effectiveDensity];
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Retorna a espessura do traço do círculo.
|
|
1160
|
+
* @private
|
|
1161
|
+
*/
|
|
1162
|
+
get strokeWidth() {
|
|
1163
|
+
return STROKE_WIDTH_MAP[this.effectiveMode][this.effectiveDensity];
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* Retorna o tamanho da fonte do percentual no modo `progress`.
|
|
1167
|
+
* @private
|
|
1168
|
+
*/
|
|
1169
|
+
get percentageFontSize() {
|
|
1170
|
+
return PERCENTAGE_FONT_SIZE_MAP[this.effectiveDensity];
|
|
1171
|
+
}
|
|
1172
|
+
get effectiveDensity() {
|
|
1173
|
+
const density = props.resolveDensity(this.el, this.density, { allowUndefined: true });
|
|
1174
|
+
return (density ?? props.resolveDensity(this.el, this.size, { propertyName: 'size' }) ?? 'medium');
|
|
1175
|
+
}
|
|
1176
|
+
get effectiveLabelPosition() {
|
|
1177
|
+
return props.resolveAllowedPropValue(this.el, 'labelPosition', this.labelPosition, LOADING_LABEL_POSITIONS, 'bottom');
|
|
1178
|
+
}
|
|
1179
|
+
get effectiveMode() {
|
|
1180
|
+
return props.resolveAllowedPropValue(this.el, 'mode', this.mode, LOADING_MODES, 'spinner');
|
|
1181
|
+
}
|
|
1182
|
+
get effectiveSpeed() {
|
|
1183
|
+
return props.resolveAllowedPropValue(this.el, 'speed', this.speed, LOADING_SPEEDS, 'normal');
|
|
1184
|
+
}
|
|
1185
|
+
get effectiveCompletion() {
|
|
1186
|
+
return props.resolveAllowedPropValue(this.el, 'completion', this.completion, LOADING_COMPLETIONS, 'persist');
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* Retorna a coordenada central do SVG.
|
|
1190
|
+
* @private
|
|
1191
|
+
*/
|
|
1192
|
+
get center() {
|
|
1193
|
+
return this.dimension / 2;
|
|
1194
|
+
}
|
|
1195
|
+
/**
|
|
1196
|
+
* Retorna o raio útil do círculo.
|
|
1197
|
+
* @private
|
|
1198
|
+
*/
|
|
1199
|
+
get radius() {
|
|
1200
|
+
return this.center - this.strokeWidth / 2;
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* Retorna a circunferência do círculo.
|
|
1204
|
+
* @private
|
|
1205
|
+
*/
|
|
1206
|
+
get circumference() {
|
|
1207
|
+
return 2 * Math.PI * this.radius;
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Retorna o deslocamento do traço conforme o progresso.
|
|
1211
|
+
* @private
|
|
1212
|
+
*/
|
|
1213
|
+
get progressOffset() {
|
|
1214
|
+
const progress = this.displayedValue / 100;
|
|
1215
|
+
return this.circumference * (1 - progress);
|
|
1216
|
+
}
|
|
1217
|
+
/**
|
|
1218
|
+
* Aplica a ação configurada ao atingir 100% no modo `progress`.
|
|
1219
|
+
* @param value Valor atual do progresso.
|
|
1220
|
+
*/
|
|
1221
|
+
applyCompletionBehavior(value) {
|
|
1222
|
+
if (this.effectiveMode !== 'progress')
|
|
1223
|
+
return;
|
|
1224
|
+
if (value >= 100) {
|
|
1225
|
+
this.brLoadingComplete.emit({ value: 100, completion: this.effectiveCompletion });
|
|
1226
|
+
if (this.effectiveCompletion === 'reset') {
|
|
1227
|
+
setTimeout(() => this.reset(), 300);
|
|
1228
|
+
}
|
|
1229
|
+
if (this.effectiveCompletion === 'hide') {
|
|
1230
|
+
this.setVisibility(false);
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* Inicializa o valor exibido no texto de progresso.
|
|
1236
|
+
*/
|
|
1237
|
+
initializeProgressDisplay() {
|
|
1238
|
+
this.displayedValue = this.effectiveMode === 'progress' ? 0 : this.normalizedValue;
|
|
1239
|
+
}
|
|
1240
|
+
/**
|
|
1241
|
+
* Libera recursos usados pela animação de progresso.
|
|
1242
|
+
*/
|
|
1243
|
+
cleanupProgressResources() {
|
|
1244
|
+
this.stopProgressAnimation();
|
|
1245
|
+
}
|
|
1246
|
+
/**
|
|
1247
|
+
* Emite mudança de estado lógico para o modo `spinner` quando necessário.
|
|
1248
|
+
*/
|
|
1249
|
+
syncIndeterminateActiveState() {
|
|
1250
|
+
const shouldBeActive = this.effectiveMode === 'spinner' && this.el.style.display !== 'none';
|
|
1251
|
+
if (this.isIndeterminateActive === shouldBeActive)
|
|
1252
|
+
return;
|
|
1253
|
+
this.isIndeterminateActive = shouldBeActive;
|
|
1254
|
+
this.brIndeterminateStateChange.emit({ active: shouldBeActive });
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* Sincroniza o texto de percentual com a transição visual do círculo.
|
|
1258
|
+
* @param targetValue Valor final do progresso normalizado.
|
|
1259
|
+
*/
|
|
1260
|
+
syncDisplayedProgress(targetValue) {
|
|
1261
|
+
if (this.effectiveMode !== 'progress') {
|
|
1262
|
+
this.displayedValue = targetValue;
|
|
1263
|
+
return;
|
|
1264
|
+
}
|
|
1265
|
+
this.stopProgressAnimation();
|
|
1266
|
+
const from = this.displayedValue;
|
|
1267
|
+
const to = targetValue;
|
|
1268
|
+
const durationMs = TRANSITION_MAP[this.effectiveSpeed] * 1000;
|
|
1269
|
+
if (from === to || durationMs <= 0) {
|
|
1270
|
+
this.displayedValue = to;
|
|
1271
|
+
return;
|
|
1272
|
+
}
|
|
1273
|
+
if (this.prefersReducedMotion()) {
|
|
1274
|
+
this.displayedValue = to;
|
|
1275
|
+
return;
|
|
1276
|
+
}
|
|
1277
|
+
const startedAt = performance.now();
|
|
1278
|
+
const step = (now) => {
|
|
1279
|
+
if (typeof document !== 'undefined' && document.hidden) {
|
|
1280
|
+
this.displayedValue = to;
|
|
1281
|
+
this.progressAnimationFrameId = undefined;
|
|
1282
|
+
return;
|
|
1283
|
+
}
|
|
1284
|
+
const elapsed = Math.min((now - startedAt) / durationMs, 1);
|
|
1285
|
+
const eased = this.easeProgress(elapsed);
|
|
1286
|
+
this.displayedValue = Math.round(from + (to - from) * eased);
|
|
1287
|
+
if (elapsed < 1) {
|
|
1288
|
+
this.progressAnimationFrameId = requestAnimationFrame(step);
|
|
1289
|
+
return;
|
|
1290
|
+
}
|
|
1291
|
+
this.displayedValue = to;
|
|
1292
|
+
this.progressAnimationFrameId = undefined;
|
|
1293
|
+
};
|
|
1294
|
+
this.progressAnimationFrameId = requestAnimationFrame(step);
|
|
1295
|
+
}
|
|
1296
|
+
/**
|
|
1297
|
+
* Interpolação para suavizar a animação do percentual.
|
|
1298
|
+
* @param time Progresso normalizado da animação (0 a 1).
|
|
1299
|
+
* @returns Valor interpolado entre 0 e 1.
|
|
1300
|
+
*/
|
|
1301
|
+
easeProgress(time) {
|
|
1302
|
+
return time < 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time;
|
|
1303
|
+
}
|
|
1304
|
+
/** Cancela a animação de percentual em andamento. */
|
|
1305
|
+
stopProgressAnimation() {
|
|
1306
|
+
if (this.progressAnimationFrameId === undefined)
|
|
1307
|
+
return;
|
|
1308
|
+
cancelAnimationFrame(this.progressAnimationFrameId);
|
|
1309
|
+
this.progressAnimationFrameId = undefined;
|
|
1310
|
+
}
|
|
1311
|
+
prefersReducedMotion() {
|
|
1312
|
+
return (typeof window === 'undefined' ||
|
|
1313
|
+
typeof window.matchMedia !== 'function' ||
|
|
1314
|
+
(typeof document !== 'undefined' && document.documentElement.dataset.wbcReducedMotion === 'true') ||
|
|
1315
|
+
window.matchMedia('(prefers-reduced-motion: reduce)').matches);
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* Atualiza a visibilidade e emite o evento correspondente.
|
|
1319
|
+
* @param visible Define se o componente ficará visível.
|
|
1320
|
+
* @private
|
|
1321
|
+
*/
|
|
1322
|
+
setVisibility(visible) {
|
|
1323
|
+
this.el.style.display = visible ? '' : 'none';
|
|
1324
|
+
this.syncIndeterminateActiveState();
|
|
1325
|
+
if (visible) {
|
|
1326
|
+
this.brDidShow.emit();
|
|
1327
|
+
this.brLoadingShow.emit();
|
|
1328
|
+
return;
|
|
1329
|
+
}
|
|
1330
|
+
this.brDidHide.emit();
|
|
1331
|
+
this.brLoadingHide.emit();
|
|
1332
|
+
}
|
|
1333
|
+
/**
|
|
1334
|
+
* Normaliza um valor arbitrário de progresso para o intervalo de 0 a 100.
|
|
1335
|
+
* Valores inválidos (incluindo string vazia e NaN) são convertidos para 0.
|
|
1336
|
+
* Também sincroniza `this.value` internamente quando necessário.
|
|
1337
|
+
*/
|
|
1338
|
+
normalizeInputValue(value) {
|
|
1339
|
+
const normalizedValue = this.toValidProgressValue(value);
|
|
1340
|
+
if (this.value !== normalizedValue) {
|
|
1341
|
+
this.value = normalizedValue;
|
|
1342
|
+
}
|
|
1343
|
+
return normalizedValue;
|
|
1344
|
+
}
|
|
1345
|
+
toValidProgressValue(value) {
|
|
1346
|
+
if (typeof value === 'string' && value.trim() === '') {
|
|
1347
|
+
return 0;
|
|
1348
|
+
}
|
|
1349
|
+
return props.resolveNumberPropValue(this.el, 'value', value, 0, 100, 0);
|
|
1350
|
+
}
|
|
1351
|
+
/**
|
|
1352
|
+
* Monta o mapa de classes CSS do host interno.
|
|
1353
|
+
* @returns Mapa de classes aplicadas.
|
|
1354
|
+
* @private
|
|
1355
|
+
*/
|
|
1356
|
+
getCssClassMap() {
|
|
1357
|
+
const density = this.effectiveDensity;
|
|
1358
|
+
const cssClassMap = {
|
|
1359
|
+
'br-loading': true,
|
|
1360
|
+
[`loading-mode-${this.effectiveMode}`]: true,
|
|
1361
|
+
[`loading-${this.effectiveSpeed}`]: true,
|
|
1362
|
+
[`loading-${density}`]: true,
|
|
1363
|
+
};
|
|
1364
|
+
return cssClassMap;
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* Renderiza o modo `spinner`.
|
|
1368
|
+
* @returns Estrutura JSX do spinner.
|
|
1369
|
+
*/
|
|
1370
|
+
renderIndeterminate() {
|
|
1371
|
+
const duration = `${SPEED_MAP[this.effectiveSpeed]}s`;
|
|
1372
|
+
return this.renderSpinnerWithLabelPosition(duration);
|
|
1373
|
+
}
|
|
1374
|
+
/**
|
|
1375
|
+
* Renderiza spinner com label em qualquer posição.
|
|
1376
|
+
*/
|
|
1377
|
+
renderSpinnerWithLabelPosition(duration) {
|
|
1378
|
+
const label = this.label && (index.h("div", { class: `loading-label loading-label-${this.effectiveLabelPosition}`, part: "label-wrapper" }, index.h("slot", { name: "label" }, this.label)));
|
|
1379
|
+
const spinner = (index.h("svg", { part: "svg", class: "loading-spinner", width: this.dimension, height: this.dimension, viewBox: `0 0 ${this.dimension} ${this.dimension}`, role: "progressbar", "aria-busy": "true", "aria-label": this.label || 'Carregando', style: {
|
|
1380
|
+
'--loading-animation-duration': duration,
|
|
1381
|
+
} }, index.h("circle", { class: "loading-indicator", cx: this.center, cy: this.center, r: this.radius, fill: "none", "stroke-width": this.strokeWidth, "stroke-dasharray": this.circumference, "stroke-dashoffset": this.circumference * 0.75 })));
|
|
1382
|
+
// Layout flexível para cada posição
|
|
1383
|
+
switch (this.effectiveLabelPosition) {
|
|
1384
|
+
case 'top':
|
|
1385
|
+
return (index.h("div", { class: "loading-wrapper loading-label-top", part: "wrapper" }, label, spinner));
|
|
1386
|
+
case 'right':
|
|
1387
|
+
return (index.h("div", { class: "loading-wrapper loading-label-right", part: "wrapper" }, spinner, label));
|
|
1388
|
+
case 'left':
|
|
1389
|
+
return (index.h("div", { class: "loading-wrapper loading-label-left", part: "wrapper" }, label, spinner));
|
|
1390
|
+
default:
|
|
1391
|
+
return (index.h("div", { class: "loading-wrapper loading-label-bottom", part: "wrapper" }, spinner, label));
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* Renderiza o modo `progress`.
|
|
1396
|
+
* @returns Estrutura JSX do progresso circular.
|
|
1397
|
+
* @private
|
|
1398
|
+
*/
|
|
1399
|
+
renderDeterminate() {
|
|
1400
|
+
const transitionDuration = `${TRANSITION_MAP[this.effectiveSpeed]}s`;
|
|
1401
|
+
const progressStyle = {
|
|
1402
|
+
'--loading-transition-duration': transitionDuration,
|
|
1403
|
+
'--loading-percentage-font-size': this.percentageFontSize,
|
|
1404
|
+
};
|
|
1405
|
+
return (index.h("div", { class: "loading-wrapper", part: "wrapper" }, index.h("svg", { part: "svg", class: "loading-progress", width: this.dimension, height: this.dimension, viewBox: `0 0 ${this.dimension} ${this.dimension}`, role: "progressbar", "aria-valuemin": "0", "aria-valuemax": "100", "aria-valuenow": this.normalizedValue, style: progressStyle }, index.h("circle", { class: "loading-spinner-track", cx: this.center, cy: this.center, r: this.radius, fill: "none", "stroke-width": this.strokeWidth }), index.h("circle", { class: "loading-indicator-progress", cx: this.center, cy: this.center, r: this.radius, fill: "none", "stroke-width": this.strokeWidth, "stroke-dasharray": this.circumference, "stroke-dashoffset": this.progressOffset }), index.h("text", { part: "percentage", class: "loading-percentage", x: "50%", y: "50%", dy: ".35em", "text-anchor": "middle" }, this.displayedValue, "%")), this.cancelable && (index.h("br-button", { ref: (el) => parts.setPartAttributes(el, 'cancel-button', 'button: cancel-button-inner'), emphasis: "tertiary", density: this.effectiveDensity, type: "button", "prop:ariaLabel": this.cancelLabel, onClick: this.handleCancelClick }, index.h("slot", { name: "cancel-button" }, this.cancelLabel)))));
|
|
1406
|
+
}
|
|
1407
|
+
/**
|
|
1408
|
+
* Renderiza o componente conforme o modo atual.
|
|
1409
|
+
* @returns Estrutura JSX final.
|
|
1410
|
+
*/
|
|
1411
|
+
render() {
|
|
1412
|
+
return (index.h(index.Host, { key: 'e4c9196da0b7f07f82d3f9302ee86fb611aa537a' }, index.h("div", { key: '9cb95ff4956953e0b8d969cc2aca2f6084520442', class: this.getCssClassMap(), part: "container" }, this.effectiveMode === 'spinner' ? this.renderIndeterminate() : this.renderDeterminate())));
|
|
1413
|
+
}
|
|
1414
|
+
get el() { return index.getElement(this); }
|
|
1415
|
+
static get watchers() { return {
|
|
1416
|
+
"value": [{
|
|
1417
|
+
"handleCompletion": 0
|
|
1418
|
+
}],
|
|
1419
|
+
"mode": [{
|
|
1420
|
+
"handleModeChange": 0
|
|
1421
|
+
}]
|
|
1422
|
+
}; }
|
|
1423
|
+
};
|
|
1424
|
+
Loading.style = loadingCss();
|
|
1425
|
+
|
|
1426
|
+
exports.br_input = Input;
|
|
1427
|
+
exports.br_loading = Loading;
|