@govbr-ds/webcomponents 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cem/custom-elements.json +1404 -1387
- package/cem/webcomponents.html-custom-data.json +62 -56
- package/dist/cjs/br-avatar.cjs.entry.js +1 -1
- package/dist/cjs/br-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/br-button_2.cjs.entry.js +2 -2
- package/dist/cjs/br-card.cjs.entry.js +1 -1
- package/dist/cjs/br-carousel-page.cjs.entry.js +1 -1
- package/dist/cjs/br-carousel.cjs.entry.js +1 -1
- package/dist/cjs/br-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/br-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/br-collapse_2.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar-cookie.cjs.entry.js +1 -1
- package/dist/cjs/br-cookiebar-group.cjs.entry.js +1 -1
- package/dist/cjs/br-cookiebar-header.cjs.entry.js +1 -1
- package/dist/cjs/br-cookiebar-link.cjs.entry.js +1 -1
- package/dist/cjs/br-cookiebar-note-group.cjs.entry.js +1 -1
- package/dist/cjs/br-cookiebar-note.cjs.entry.js +1 -1
- package/dist/cjs/br-cookiebar.cjs.entry.js +1 -1
- package/dist/cjs/br-date-picker_3.cjs.entry.js +868 -516
- package/dist/cjs/br-datetime-picker.cjs.entry.js +1345 -309
- package/dist/cjs/br-divider.cjs.entry.js +1 -1
- package/dist/cjs/br-dropdown_2.cjs.entry.js +248 -129
- package/dist/cjs/br-footer-category.cjs.entry.js +1 -1
- package/dist/cjs/br-footer-item.cjs.entry.js +1 -1
- package/dist/cjs/br-footer-legal.cjs.entry.js +1 -1
- package/dist/cjs/br-footer-logo.cjs.entry.js +1 -1
- package/dist/cjs/br-footer-social.cjs.entry.js +1 -1
- package/dist/cjs/br-footer.cjs.entry.js +1 -1
- package/dist/cjs/br-header-function.cjs.entry.js +1 -1
- package/dist/cjs/br-header-link.cjs.entry.js +1 -1
- package/dist/cjs/br-header-list.cjs.entry.js +1 -1
- package/dist/cjs/br-header-logo.cjs.entry.js +1 -1
- package/dist/cjs/br-header.cjs.entry.js +1 -1
- package/dist/cjs/br-icon.cjs.entry.js +1 -1
- package/dist/cjs/br-input.cjs.entry.js +9 -3
- package/dist/cjs/br-item.cjs.entry.js +1 -1
- package/dist/cjs/br-link.cjs.entry.js +1 -1
- package/dist/cjs/br-loading.cjs.entry.js +1 -1
- package/dist/cjs/br-magic-button.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-group.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-header.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-info.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-link.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-list.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-logo.cjs.entry.js +1 -1
- package/dist/cjs/br-menu-social.cjs.entry.js +1 -1
- package/dist/cjs/br-menu.cjs.entry.js +1 -1
- package/dist/cjs/br-modal.cjs.entry.js +1 -1
- package/dist/cjs/br-notification-body.cjs.entry.js +1 -1
- package/dist/cjs/br-notification-header.cjs.entry.js +1 -1
- package/dist/cjs/br-notification-item.cjs.entry.js +1 -1
- package/dist/cjs/br-notification.cjs.entry.js +1 -1
- package/dist/cjs/br-pagination.cjs.entry.js +1 -1
- package/dist/cjs/br-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/br-radio.cjs.entry.js +1 -1
- package/dist/cjs/br-scrim.cjs.entry.js +1 -1
- package/dist/cjs/br-select-input_3.cjs.entry.js +282 -98
- package/dist/cjs/br-sign-in.cjs.entry.js +1 -1
- package/dist/cjs/br-skip-link.cjs.entry.js +1 -1
- package/dist/cjs/br-skiplink-item.cjs.entry.js +1 -1
- package/dist/cjs/br-slider.cjs.entry.js +1 -1
- package/dist/cjs/br-step_2.cjs.entry.js +2 -2
- package/dist/cjs/br-switch.cjs.entry.js +1 -1
- package/dist/cjs/br-tab-item.cjs.entry.js +1 -1
- package/dist/cjs/br-tab.cjs.entry.js +1 -1
- package/dist/cjs/br-table-body.cjs.entry.js +1 -1
- package/dist/cjs/br-table-cell.cjs.entry.js +1 -1
- package/dist/cjs/br-table-header-cell.cjs.entry.js +1 -1
- package/dist/cjs/br-table-header.cjs.entry.js +1 -1
- package/dist/cjs/br-table-row.cjs.entry.js +1 -1
- package/dist/cjs/br-table.cjs.entry.js +1 -1
- package/dist/cjs/br-tag.cjs.entry.js +1 -1
- package/dist/cjs/br-textarea.cjs.entry.js +1 -1
- package/dist/cjs/br-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/br-upload.cjs.entry.js +5 -21
- package/dist/cjs/br-wizard-panel.cjs.entry.js +1 -1
- package/dist/cjs/br-wizard.cjs.entry.js +1 -1
- package/dist/cjs/{datetime-picker-constants-B5pWeOn1.js → datetime-picker-constants-CCeI5iW7.js} +20 -5
- package/dist/cjs/format-bytes-Cs8SH2w0.js +24 -0
- package/dist/cjs/index-Bc30P_6z.js +14 -14
- package/dist/cjs/{index-C92n55ch.js → index-C-IpVFDH.js} +13 -13
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{datetime-picker-props-validation-DmNKSXsy.js → isValid-CduHZTFc.js} +1 -483
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/select.utils-C38f5Kea.js +62 -0
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/avatar/avatar.css +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.css +1 -1
- package/dist/collection/components/button/button.css +1 -1
- package/dist/collection/components/card/card.css +1 -1
- package/dist/collection/components/carousel/carousel-page/carousel-page.css +1 -1
- package/dist/collection/components/carousel/carousel.css +1 -1
- package/dist/collection/components/checkbox/checkbox.css +1 -1
- package/dist/collection/components/checkbox-group/checkbox-group.css +1 -1
- package/dist/collection/components/collapse/collapse.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar.css +1 -1
- package/dist/collection/components/datetime-picker/date-picker/date-picker-locale.js +12 -12
- package/dist/collection/components/datetime-picker/date-picker/date-picker-props-validation.js +14 -13
- package/dist/collection/components/datetime-picker/date-picker/date-picker.css +1 -1
- package/dist/collection/components/datetime-picker/date-picker/date-picker.js +384 -280
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input-constants.js +59 -0
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input-props-validation.js +19 -15
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.css +1 -1
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.js +373 -211
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.types.js +1 -0
- package/dist/collection/components/datetime-picker/datetime-picker-constants.js +19 -5
- package/dist/collection/components/datetime-picker/datetime-picker-form-associated.js +92 -11
- package/dist/collection/components/datetime-picker/datetime-picker-props-validation.js +52 -33
- package/dist/collection/components/datetime-picker/datetime-picker.css +1 -1
- package/dist/collection/components/datetime-picker/datetime-picker.js +915 -362
- package/dist/collection/components/datetime-picker/datetime-picker.utils.js +62 -49
- package/dist/collection/components/datetime-picker/time-picker/time-picker-constants.js +3 -2
- package/dist/collection/components/datetime-picker/time-picker/time-picker.css +1 -1
- package/dist/collection/components/datetime-picker/time-picker/time-picker.js +148 -85
- package/dist/collection/components/divider/divider.css +1 -1
- package/dist/collection/components/dropdown/dropdown.css +1 -1
- package/dist/collection/components/footer/footer-category/footer-category.css +1 -1
- package/dist/collection/components/footer/footer-item/footer-item.css +1 -1
- package/dist/collection/components/footer/footer-legal/footer-legal.css +1 -1
- package/dist/collection/components/footer/footer-logo/footer-logo.css +1 -1
- package/dist/collection/components/footer/footer-social/footer-social.css +1 -1
- package/dist/collection/components/footer/footer.css +1 -1
- package/dist/collection/components/header/header-function/header-function.css +1 -1
- package/dist/collection/components/header/header-link/header-link.css +1 -1
- package/dist/collection/components/header/header-list/header-list.css +1 -1
- package/dist/collection/components/header/header-logo/header-logo.css +1 -1
- package/dist/collection/components/header/header.css +1 -1
- package/dist/collection/components/icon/icon.css +1 -1
- package/dist/collection/components/input/input.css +1 -1
- package/dist/collection/components/input/input.js +29 -2
- package/dist/collection/components/item/item.css +1 -1
- package/dist/collection/components/link/link.css +1 -1
- package/dist/collection/components/list/list.css +1 -1
- package/dist/collection/components/loading/loading.css +1 -1
- package/dist/collection/components/magic-button/magic-button.css +1 -1
- package/dist/collection/components/menu/menu-group/menu-group.css +1 -1
- package/dist/collection/components/menu/menu-header/menu-header.css +1 -1
- package/dist/collection/components/menu/menu-info/menu-info.css +1 -1
- package/dist/collection/components/menu/menu-item/menu-item.css +1 -1
- package/dist/collection/components/menu/menu-link/menu-link.css +1 -1
- package/dist/collection/components/menu/menu-list/menu-list.css +1 -1
- package/dist/collection/components/menu/menu-logo/menu-logo.css +1 -1
- package/dist/collection/components/menu/menu-social/menu-social.css +1 -1
- package/dist/collection/components/menu/menu.css +1 -1
- package/dist/collection/components/message/message.css +1 -1
- package/dist/collection/components/modal/modal.css +1 -1
- package/dist/collection/components/notification/notification-body/notification-body.css +1 -1
- package/dist/collection/components/notification/notification-header/notification-header.css +1 -1
- package/dist/collection/components/notification/notification-item/notification-item.css +1 -1
- package/dist/collection/components/notification/notification.css +1 -1
- package/dist/collection/components/pagination/pagination.css +1 -1
- package/dist/collection/components/radio/radio.css +1 -1
- package/dist/collection/components/radio-group/radio-group.css +1 -1
- package/dist/collection/components/scrim/scrim.css +1 -1
- package/dist/collection/components/select/select-input/select-input.css +1 -1
- package/dist/collection/components/select/select-input/select-input.js +123 -17
- package/dist/collection/components/select/select-list/select-list.css +1 -1
- package/dist/collection/components/select/select-list/select-list.js +218 -66
- package/dist/collection/components/select/select-option/select-option.css +1 -1
- package/dist/collection/components/select/select-option/select-option.js +14 -5
- package/dist/collection/components/select/select.css +1 -1
- package/dist/collection/components/select/select.js +303 -94
- package/dist/collection/components/select/select.utils.js +26 -7
- package/dist/collection/components/sign-in/sign-in.css +1 -1
- package/dist/collection/components/skip-link/skip-link-item/skip-link-item.css +1 -1
- package/dist/collection/components/skip-link/skip-link.css +1 -1
- package/dist/collection/components/slider/slider.css +1 -1
- package/dist/collection/components/step/step-item/step-item.css +1 -1
- package/dist/collection/components/step/step.css +1 -1
- package/dist/collection/components/switch/switch.css +1 -1
- package/dist/collection/components/tab/tab-item/tab-item.css +1 -1
- package/dist/collection/components/tab/tab.css +1 -1
- package/dist/collection/components/table/table-body/table-body.css +1 -1
- package/dist/collection/components/table/table-cell/table-cell.css +1 -1
- package/dist/collection/components/table/table-header/table-header.css +1 -1
- package/dist/collection/components/table/table-header-cell/table-header-cell.css +1 -1
- package/dist/collection/components/table/table-row/table-row.css +1 -1
- package/dist/collection/components/table/table.css +1 -1
- package/dist/collection/components/tag/tag.css +1 -1
- package/dist/collection/components/textarea/textarea.css +1 -1
- package/dist/collection/components/tooltip/tooltip.css +1 -1
- package/dist/collection/components/upload/upload.css +1 -1
- package/dist/collection/components/wizard/wizard-panel/wizard-panel.css +1 -1
- package/dist/collection/components/wizard/wizard.css +1 -1
- package/dist/components/br-avatar.js +1 -1
- package/dist/components/br-breadcrumb.js +1 -1
- package/dist/components/br-button.js +1 -1
- package/dist/components/br-card.js +1 -1
- package/dist/components/br-carousel-page.js +1 -1
- package/dist/components/br-carousel.js +1 -1
- package/dist/components/br-checkbox-group.js +1 -1
- package/dist/components/br-checkbox.js +1 -1
- package/dist/components/br-checkgroup.js +1 -1
- package/dist/components/br-collapse.js +1 -1
- package/dist/components/br-cookiebar-cookie.js +1 -1
- package/dist/components/br-cookiebar-group.js +1 -1
- package/dist/components/br-cookiebar-header.js +1 -1
- package/dist/components/br-cookiebar-link.js +1 -1
- package/dist/components/br-cookiebar-note-group.js +1 -1
- package/dist/components/br-cookiebar-note.js +1 -1
- package/dist/components/br-cookiebar.js +1 -1
- package/dist/components/br-date-picker.js +1 -1
- package/dist/components/br-datetime-input.js +1 -1
- package/dist/components/br-datetime-picker.js +1 -1
- package/dist/components/br-divider.js +1 -1
- package/dist/components/br-dropdown.js +1 -1
- package/dist/components/br-footer-category.js +1 -1
- package/dist/components/br-footer-item.js +1 -1
- package/dist/components/br-footer-legal.js +1 -1
- package/dist/components/br-footer-logo.js +1 -1
- package/dist/components/br-footer-social.js +1 -1
- package/dist/components/br-footer.js +1 -1
- package/dist/components/br-header-function.js +1 -1
- package/dist/components/br-header-link.js +1 -1
- package/dist/components/br-header-list.js +1 -1
- package/dist/components/br-header-logo.js +1 -1
- package/dist/components/br-header.js +1 -1
- package/dist/components/br-icon.js +1 -1
- package/dist/components/br-input.js +1 -1
- package/dist/components/br-item.js +1 -1
- package/dist/components/br-link.js +1 -1
- package/dist/components/br-list.js +1 -1
- package/dist/components/br-loading.js +1 -1
- package/dist/components/br-magic-button.js +1 -1
- package/dist/components/br-menu-group.js +1 -1
- package/dist/components/br-menu-header.js +1 -1
- package/dist/components/br-menu-info.js +1 -1
- package/dist/components/br-menu-item.js +1 -1
- package/dist/components/br-menu-link.js +1 -1
- package/dist/components/br-menu-list.js +1 -1
- package/dist/components/br-menu-logo.js +1 -1
- package/dist/components/br-menu-social.js +1 -1
- package/dist/components/br-menu.js +1 -1
- package/dist/components/br-message.js +1 -1
- package/dist/components/br-modal.js +1 -1
- package/dist/components/br-notification-body.js +1 -1
- package/dist/components/br-notification-header.js +1 -1
- package/dist/components/br-notification-item.js +1 -1
- package/dist/components/br-notification.js +1 -1
- package/dist/components/br-pagination.js +1 -1
- package/dist/components/br-radio-group.js +1 -1
- package/dist/components/br-radio.js +1 -1
- package/dist/components/br-scrim.js +1 -1
- package/dist/components/br-select-input.js +1 -1
- package/dist/components/br-select-list.js +1 -1
- package/dist/components/br-select-option.js +1 -1
- package/dist/components/br-select.js +1 -1
- package/dist/components/br-sign-in.js +1 -1
- package/dist/components/br-skip-link-item.js +1 -1
- package/dist/components/br-skip-link.js +1 -1
- package/dist/components/br-skiplink-item.js +1 -1
- package/dist/components/br-slider.js +1 -1
- package/dist/components/br-step-item.js +1 -1
- package/dist/components/br-step.js +1 -1
- package/dist/components/br-switch.js +1 -1
- package/dist/components/br-tab-item.js +1 -1
- package/dist/components/br-tab.js +1 -1
- package/dist/components/br-table-body.js +1 -1
- package/dist/components/br-table-cell.js +1 -1
- package/dist/components/br-table-header-cell.js +1 -1
- package/dist/components/br-table-header.js +1 -1
- package/dist/components/br-table-row.js +1 -1
- package/dist/components/br-table.js +1 -1
- package/dist/components/br-tag.js +1 -1
- package/dist/components/br-textarea.js +1 -1
- package/dist/components/br-time-picker.js +1 -1
- package/dist/components/br-tooltip.js +1 -1
- package/dist/components/br-upload.js +1 -1
- package/dist/components/br-wizard-panel.js +1 -1
- package/dist/components/br-wizard.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-5h-W9_JR.js +5 -0
- package/dist/components/p-848QkYoM.js +5 -0
- package/dist/components/p-B7bNfmgh.js +5 -0
- package/dist/components/p-BFHvuEnN.js +5 -0
- package/dist/components/p-BH6QYnAr.js +5 -0
- package/dist/{webcomponents/p-5f422a69.entry.js → components/p-BcW8O6h2.js} +1 -1
- package/dist/components/p-BicHMcSS.js +5 -0
- package/dist/components/p-Bs7iRQTG.js +5 -0
- package/dist/components/{p-Nze3Utvd.js → p-Bvrw9yWR.js} +1 -1
- package/dist/components/p-BzQFMh9j.js +5 -0
- package/dist/components/p-CBHd0-fF.js +5 -0
- package/dist/components/p-CCPHCJjw.js +5 -0
- package/dist/components/{p-BcqVlof7.js → p-CbgKdASU.js} +1 -1
- package/dist/components/p-CeNELttN.js +5 -0
- package/dist/components/p-CjtmJTLO.js +5 -0
- package/dist/components/{p-CZZVc2gK.js → p-D-3G3Ioq.js} +1 -1
- package/dist/components/p-DDu3JV_r.js +5 -0
- package/dist/components/p-DFWqyfUe.js +5 -0
- package/dist/components/p-DL6xuxGG.js +5 -0
- package/dist/components/p-DOX9Uwk1.js +5 -0
- package/dist/components/p-DUq7uT2-.js +5 -0
- package/dist/components/p-Devw08cc.js +5 -0
- package/dist/components/p-Di96UxvH.js +5 -0
- package/dist/components/p-Dp3MsSXu.js +5 -0
- package/dist/components/p-DsO4F0Cz.js +5 -0
- package/dist/components/p-DuLHFTpa.js +5 -0
- package/dist/components/p-DusornQ0.js +5 -0
- package/dist/components/p-OQpiDEK9.js +5 -0
- package/dist/components/p-PV731d8s.js +5 -0
- package/dist/components/p-XW6Hp_Jk.js +5 -0
- package/dist/components/p-jOb1hCPi.js +5 -0
- package/dist/components/p-rMnkh3Cy.js +5 -0
- package/dist/components/p-ta-24T1Z.js +5 -0
- package/dist/esm/br-avatar.entry.js +1 -1
- package/dist/esm/br-breadcrumb.entry.js +1 -1
- package/dist/esm/br-button_2.entry.js +2 -2
- package/dist/esm/br-card.entry.js +1 -1
- package/dist/esm/br-carousel-page.entry.js +1 -1
- package/dist/esm/br-carousel.entry.js +2 -2
- package/dist/esm/br-checkbox-group.entry.js +1 -1
- package/dist/esm/br-checkbox.entry.js +2 -2
- package/dist/esm/br-collapse_2.entry.js +3 -3
- package/dist/esm/br-cookiebar-cookie.entry.js +1 -1
- package/dist/esm/br-cookiebar-group.entry.js +1 -1
- package/dist/esm/br-cookiebar-header.entry.js +1 -1
- package/dist/esm/br-cookiebar-link.entry.js +1 -1
- package/dist/esm/br-cookiebar-note-group.entry.js +1 -1
- package/dist/esm/br-cookiebar-note.entry.js +1 -1
- package/dist/esm/br-cookiebar.entry.js +2 -2
- package/dist/esm/br-date-picker_3.entry.js +843 -491
- package/dist/esm/br-datetime-picker.entry.js +1314 -278
- package/dist/esm/br-divider.entry.js +1 -1
- package/dist/esm/br-dropdown_2.entry.js +247 -128
- package/dist/esm/br-footer-category.entry.js +1 -1
- package/dist/esm/br-footer-item.entry.js +1 -1
- package/dist/esm/br-footer-legal.entry.js +1 -1
- package/dist/esm/br-footer-logo.entry.js +1 -1
- package/dist/esm/br-footer-social.entry.js +1 -1
- package/dist/esm/br-footer.entry.js +1 -1
- package/dist/esm/br-header-function.entry.js +1 -1
- package/dist/esm/br-header-link.entry.js +1 -1
- package/dist/esm/br-header-list.entry.js +2 -2
- package/dist/esm/br-header-logo.entry.js +1 -1
- package/dist/esm/br-header.entry.js +1 -1
- package/dist/esm/br-icon.entry.js +1 -1
- package/dist/esm/br-input.entry.js +10 -4
- package/dist/esm/br-item.entry.js +1 -1
- package/dist/esm/br-link.entry.js +1 -1
- package/dist/esm/br-loading.entry.js +1 -1
- package/dist/esm/br-magic-button.entry.js +1 -1
- package/dist/esm/br-menu-group.entry.js +1 -1
- package/dist/esm/br-menu-header.entry.js +1 -1
- package/dist/esm/br-menu-info.entry.js +1 -1
- package/dist/esm/br-menu-item.entry.js +1 -1
- package/dist/esm/br-menu-link.entry.js +1 -1
- package/dist/esm/br-menu-list.entry.js +1 -1
- package/dist/esm/br-menu-logo.entry.js +1 -1
- package/dist/esm/br-menu-social.entry.js +1 -1
- package/dist/esm/br-menu.entry.js +2 -2
- package/dist/esm/br-modal.entry.js +1 -1
- package/dist/esm/br-notification-body.entry.js +1 -1
- package/dist/esm/br-notification-header.entry.js +1 -1
- package/dist/esm/br-notification-item.entry.js +1 -1
- package/dist/esm/br-notification.entry.js +2 -2
- package/dist/esm/br-pagination.entry.js +1 -1
- package/dist/esm/br-radio-group.entry.js +2 -2
- package/dist/esm/br-radio.entry.js +2 -2
- package/dist/esm/br-scrim.entry.js +1 -1
- package/dist/esm/br-select-input_3.entry.js +282 -98
- package/dist/esm/br-sign-in.entry.js +1 -1
- package/dist/esm/br-skip-link.entry.js +1 -1
- package/dist/esm/br-skiplink-item.entry.js +1 -1
- package/dist/esm/br-slider.entry.js +2 -2
- package/dist/esm/br-step_2.entry.js +2 -2
- package/dist/esm/br-switch.entry.js +2 -2
- package/dist/esm/br-tab-item.entry.js +1 -1
- package/dist/esm/br-tab.entry.js +1 -1
- package/dist/esm/br-table-body.entry.js +1 -1
- package/dist/esm/br-table-cell.entry.js +1 -1
- package/dist/esm/br-table-header-cell.entry.js +1 -1
- package/dist/esm/br-table-header.entry.js +1 -1
- package/dist/esm/br-table-row.entry.js +1 -1
- package/dist/esm/br-table.entry.js +1 -1
- package/dist/esm/br-tag.entry.js +2 -2
- package/dist/esm/br-textarea.entry.js +2 -2
- package/dist/esm/br-tooltip.entry.js +2 -2
- package/dist/esm/br-upload.entry.js +3 -19
- package/dist/esm/br-wizard-panel.entry.js +1 -1
- package/dist/esm/br-wizard.entry.js +1 -1
- package/dist/esm/{datetime-picker-constants-BtRPYRvA.js → datetime-picker-constants-DDc4sADe.js} +20 -6
- package/dist/esm/{event-CfuJQ1DY.js → event-6Da1SZ3J.js} +1 -1
- package/dist/esm/format-bytes-B7bNfmgh.js +22 -0
- package/dist/esm/index-ConyRdJe.js +14 -14
- package/dist/esm/{index-BQPOWxe5.js → index-CytVKoHT.js} +13 -13
- package/dist/esm/index.js +2 -2
- package/dist/esm/{datetime-picker-props-validation-BeTcUTnE.js → isValid-Bee0Uvqc.js} +2 -477
- package/dist/esm/loader.js +1 -1
- package/dist/esm/select.utils-BYsh2ZdE.js +57 -0
- package/dist/esm/webcomponents.js +1 -1
- package/dist/hydrate/index.js +2979 -1673
- package/dist/hydrate/index.mjs +2979 -1673
- package/dist/types/components/datetime-picker/date-picker/date-picker-locale.d.ts +9 -9
- package/dist/types/components/datetime-picker/date-picker/date-picker-props-validation.d.ts +14 -13
- package/dist/types/components/datetime-picker/date-picker/date-picker.d.ts +264 -161
- package/dist/types/components/datetime-picker/datetime-input/datetime-input-constants.d.ts +14 -0
- package/dist/types/components/datetime-picker/datetime-input/datetime-input-props-validation.d.ts +19 -15
- package/dist/types/components/datetime-picker/datetime-input/datetime-input.d.ts +229 -98
- package/dist/types/components/datetime-picker/datetime-input/datetime-input.types.d.ts +36 -0
- package/dist/types/components/datetime-picker/datetime-picker-constants.d.ts +19 -5
- package/dist/types/components/datetime-picker/datetime-picker-form-associated.d.ts +32 -5
- package/dist/types/components/datetime-picker/datetime-picker-props-validation.d.ts +22 -24
- package/dist/types/components/datetime-picker/datetime-picker.d.ts +508 -235
- package/dist/types/components/datetime-picker/datetime-picker.types.d.ts +75 -21
- package/dist/types/components/datetime-picker/datetime-picker.utils.d.ts +53 -47
- package/dist/types/components/datetime-picker/time-picker/time-picker-constants.d.ts +3 -2
- package/dist/types/components/datetime-picker/time-picker/time-picker.d.ts +126 -55
- package/dist/types/components/input/input.d.ts +9 -1
- package/dist/types/components/input/input.types.d.ts +4 -0
- package/dist/types/components/select/select-input/select-input.d.ts +9 -2
- package/dist/types/components/select/select-list/select-list.d.ts +14 -2
- package/dist/types/components/select/select-option/select-option.d.ts +1 -0
- package/dist/types/components/select/select.d.ts +47 -7
- package/dist/types/components/select/select.types.d.ts +12 -0
- package/dist/types/components/select/select.utils.d.ts +3 -0
- package/dist/types/components.d.ts +387 -300
- package/dist/webcomponents/index.esm.js +1 -1
- package/dist/webcomponents/p-01801ac1.entry.js +5 -0
- package/dist/webcomponents/p-05b459f2.entry.js +5 -0
- package/dist/webcomponents/p-08ac6f09.entry.js +5 -0
- package/dist/webcomponents/p-09c79c1d.entry.js +5 -0
- package/dist/webcomponents/p-0fc112fc.entry.js +5 -0
- package/dist/webcomponents/p-13babfc4.entry.js +5 -0
- package/dist/webcomponents/p-15022ab7.entry.js +5 -0
- package/dist/webcomponents/p-172d42c2.entry.js +5 -0
- package/dist/webcomponents/p-18cf093a.entry.js +5 -0
- package/dist/webcomponents/p-198aa844.entry.js +5 -0
- package/dist/webcomponents/p-1ba60d13.entry.js +5 -0
- package/dist/webcomponents/p-1bb96641.entry.js +5 -0
- package/dist/webcomponents/{p-82759002.entry.js → p-20477061.entry.js} +1 -1
- package/dist/webcomponents/p-21feda62.entry.js +5 -0
- package/dist/webcomponents/p-23a5cfd7.entry.js +5 -0
- package/dist/webcomponents/{p-0b0cf355.entry.js → p-2c8595d3.entry.js} +1 -1
- package/dist/webcomponents/{p-76d51654.entry.js → p-31a4694a.entry.js} +1 -1
- package/dist/webcomponents/p-32ea6342.entry.js +5 -0
- package/dist/webcomponents/p-3658adcf.entry.js +5 -0
- package/dist/webcomponents/p-37914e63.entry.js +5 -0
- package/dist/webcomponents/p-3b0dd0ff.entry.js +5 -0
- package/dist/webcomponents/p-42b60169.entry.js +5 -0
- package/dist/webcomponents/p-42c9c6c5.entry.js +5 -0
- package/dist/{components/p-DOJ1vYOl.js → webcomponents/p-473561f2.entry.js} +1 -1
- package/dist/webcomponents/p-47c490ef.entry.js +5 -0
- package/dist/webcomponents/p-4b01c60f.entry.js +5 -0
- package/dist/webcomponents/p-5a5ed7d8.entry.js +5 -0
- package/dist/webcomponents/p-609cf652.entry.js +5 -0
- package/dist/webcomponents/p-614683d9.entry.js +5 -0
- package/dist/webcomponents/p-67605757.entry.js +5 -0
- package/dist/webcomponents/p-67774920.entry.js +5 -0
- package/dist/webcomponents/p-67d62559.entry.js +5 -0
- package/dist/webcomponents/{p-4118b878.entry.js → p-695dbeb0.entry.js} +1 -1
- package/dist/webcomponents/{p-CfuJQ1DY.js → p-6Da1SZ3J.js} +1 -1
- package/dist/webcomponents/p-6a293be8.entry.js +5 -0
- package/dist/webcomponents/{p-d5d2205c.entry.js → p-6f1a4fbe.entry.js} +1 -1
- package/dist/webcomponents/p-7352d459.entry.js +5 -0
- package/dist/webcomponents/p-745213f7.entry.js +5 -0
- package/dist/webcomponents/p-794b701b.entry.js +5 -0
- package/dist/webcomponents/p-7ee564a1.entry.js +5 -0
- package/dist/webcomponents/{p-6850e98e.entry.js → p-7fda8b89.entry.js} +1 -1
- package/dist/webcomponents/p-8116ee93.entry.js +5 -0
- package/dist/webcomponents/p-821341dc.entry.js +5 -0
- package/dist/webcomponents/p-8aa6f07c.entry.js +5 -0
- package/dist/webcomponents/p-8ddf3ce3.entry.js +5 -0
- package/dist/webcomponents/p-95f3c44a.entry.js +5 -0
- package/dist/webcomponents/p-96dbb585.entry.js +5 -0
- package/dist/webcomponents/p-9815ab95.entry.js +5 -0
- package/dist/webcomponents/{p-b02a7218.entry.js → p-9e0324a7.entry.js} +1 -1
- package/dist/webcomponents/p-B7bNfmgh.js +5 -0
- package/dist/webcomponents/p-BYsh2ZdE.js +5 -0
- package/dist/webcomponents/p-CJipT0in.js +5 -0
- package/dist/webcomponents/{p-BtRPYRvA.js → p-DDc4sADe.js} +1 -1
- package/dist/webcomponents/p-a038be16.entry.js +5 -0
- package/dist/webcomponents/p-a32d17cb.entry.js +5 -0
- package/dist/webcomponents/p-a46f068e.entry.js +5 -0
- package/dist/webcomponents/p-a89b684d.entry.js +5 -0
- package/dist/webcomponents/{p-0d2ca2f7.entry.js → p-ac68355e.entry.js} +1 -1
- package/dist/webcomponents/{p-61977114.entry.js → p-af888d13.entry.js} +1 -1
- package/dist/webcomponents/p-b0124459.entry.js +5 -0
- package/dist/webcomponents/p-b063c12f.entry.js +5 -0
- package/dist/webcomponents/p-b07bfdc5.entry.js +5 -0
- package/dist/webcomponents/{p-c1dafd8d.entry.js → p-b5d25332.entry.js} +1 -1
- package/dist/webcomponents/p-b609b464.entry.js +5 -0
- package/dist/webcomponents/p-b66ab52d.entry.js +5 -0
- package/dist/webcomponents/p-b8d4ace3.entry.js +5 -0
- package/dist/webcomponents/p-c717c745.entry.js +5 -0
- package/dist/webcomponents/p-d08b6266.entry.js +5 -0
- package/dist/webcomponents/p-d6165aa0.entry.js +5 -0
- package/dist/webcomponents/{p-14ff5865.entry.js → p-dacb7e2c.entry.js} +1 -1
- package/dist/webcomponents/p-db309a11.entry.js +5 -0
- package/dist/webcomponents/{p-19a38e20.entry.js → p-dc23cb2e.entry.js} +1 -1
- package/dist/webcomponents/p-e241caf3.entry.js +5 -0
- package/dist/webcomponents/p-e661c024.entry.js +5 -0
- package/dist/webcomponents/p-e7107869.entry.js +5 -0
- package/dist/webcomponents/p-eb94199d.entry.js +5 -0
- package/dist/webcomponents/{p-e07e309d.entry.js → p-f8993ae4.entry.js} +1 -1
- package/dist/webcomponents/{p-513ee754.entry.js → p-f99d8c9c.entry.js} +1 -1
- package/dist/webcomponents/{p-DV-iW9Aj.js → p-fOJu6uZR.js} +1 -1
- package/dist/webcomponents/{p-b16590fc.entry.js → p-fb76b1e0.entry.js} +1 -1
- package/dist/webcomponents/p-fdcb54a3.entry.js +5 -0
- package/dist/webcomponents/{p-94848046.entry.js → p-fed02286.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +2 -2
- package/dist/components/p-0qmYp77w.js +0 -5
- package/dist/components/p-5c3rNBXh.js +0 -5
- package/dist/components/p-B8oIvH3q.js +0 -5
- package/dist/components/p-BECz8XWJ.js +0 -5
- package/dist/components/p-BM4Ys6hX.js +0 -5
- package/dist/components/p-BXWh9s7p.js +0 -5
- package/dist/components/p-BblZlUp2.js +0 -5
- package/dist/components/p-Bezou5CQ.js +0 -5
- package/dist/components/p-BjeUETWJ.js +0 -5
- package/dist/components/p-Cd6udSDt.js +0 -5
- package/dist/components/p-Ci0_RqAE.js +0 -5
- package/dist/components/p-CuBgClZm.js +0 -5
- package/dist/components/p-D0QYZSoP.js +0 -5
- package/dist/components/p-D4SWpW6-.js +0 -5
- package/dist/components/p-D579DS7x.js +0 -5
- package/dist/components/p-D8K7rhHd.js +0 -5
- package/dist/components/p-D9nXlCuS.js +0 -5
- package/dist/components/p-DKFO6Q_g.js +0 -5
- package/dist/components/p-DNJSSCNi.js +0 -5
- package/dist/components/p-DYI30IZL.js +0 -5
- package/dist/components/p-DcVldfL0.js +0 -5
- package/dist/components/p-DhvmHPp4.js +0 -5
- package/dist/components/p-DwgiHL0b.js +0 -5
- package/dist/components/p-WxDB6Dk4.js +0 -5
- package/dist/components/p-ZLoeVagg.js +0 -5
- package/dist/components/p-gbYJ9sfc.js +0 -5
- package/dist/components/p-uc8ABlC_.js +0 -5
- package/dist/components/p-v60ypfxD.js +0 -5
- package/dist/webcomponents/p-078bd760.entry.js +0 -5
- package/dist/webcomponents/p-07c2cdff.entry.js +0 -5
- package/dist/webcomponents/p-0d79ca44.entry.js +0 -5
- package/dist/webcomponents/p-0fe3c47b.entry.js +0 -5
- package/dist/webcomponents/p-116b53c9.entry.js +0 -5
- package/dist/webcomponents/p-1240dae7.entry.js +0 -5
- package/dist/webcomponents/p-15743a02.entry.js +0 -5
- package/dist/webcomponents/p-16cebf49.entry.js +0 -5
- package/dist/webcomponents/p-1884b9d3.entry.js +0 -5
- package/dist/webcomponents/p-1d36c8fa.entry.js +0 -5
- package/dist/webcomponents/p-1fa4b5b2.entry.js +0 -5
- package/dist/webcomponents/p-212c069b.entry.js +0 -5
- package/dist/webcomponents/p-23f37cd6.entry.js +0 -5
- package/dist/webcomponents/p-24502b63.entry.js +0 -5
- package/dist/webcomponents/p-27fb81f3.entry.js +0 -5
- package/dist/webcomponents/p-28844490.entry.js +0 -5
- package/dist/webcomponents/p-2b41bdcc.entry.js +0 -5
- package/dist/webcomponents/p-2cb1e09b.entry.js +0 -5
- package/dist/webcomponents/p-2fcda70b.entry.js +0 -5
- package/dist/webcomponents/p-3378300c.entry.js +0 -5
- package/dist/webcomponents/p-3ae9cf69.entry.js +0 -5
- package/dist/webcomponents/p-3b79cd49.entry.js +0 -5
- package/dist/webcomponents/p-3c1513ec.entry.js +0 -5
- package/dist/webcomponents/p-4534a3c3.entry.js +0 -5
- package/dist/webcomponents/p-48abf568.entry.js +0 -5
- package/dist/webcomponents/p-4e5ea05c.entry.js +0 -5
- package/dist/webcomponents/p-521a1076.entry.js +0 -5
- package/dist/webcomponents/p-59fc52c0.entry.js +0 -5
- package/dist/webcomponents/p-5a9f4ea2.entry.js +0 -5
- package/dist/webcomponents/p-71853dfc.entry.js +0 -5
- package/dist/webcomponents/p-77e242f3.entry.js +0 -5
- package/dist/webcomponents/p-7b849472.entry.js +0 -5
- package/dist/webcomponents/p-7dbfb875.entry.js +0 -5
- package/dist/webcomponents/p-7fa7f052.entry.js +0 -5
- package/dist/webcomponents/p-81c65747.entry.js +0 -5
- package/dist/webcomponents/p-91a5329f.entry.js +0 -5
- package/dist/webcomponents/p-966773a9.entry.js +0 -5
- package/dist/webcomponents/p-9abb5a53.entry.js +0 -5
- package/dist/webcomponents/p-9bf2e325.entry.js +0 -5
- package/dist/webcomponents/p-9c943b40.entry.js +0 -5
- package/dist/webcomponents/p-9ec3ca00.entry.js +0 -5
- package/dist/webcomponents/p-B0PbhaxL.js +0 -5
- package/dist/webcomponents/p-ad91f149.entry.js +0 -5
- package/dist/webcomponents/p-aeea1f17.entry.js +0 -5
- package/dist/webcomponents/p-c2ca0289.entry.js +0 -5
- package/dist/webcomponents/p-c8af334e.entry.js +0 -5
- package/dist/webcomponents/p-cac49c6a.entry.js +0 -5
- package/dist/webcomponents/p-cb9ebfbe.entry.js +0 -5
- package/dist/webcomponents/p-d11f95a0.entry.js +0 -5
- package/dist/webcomponents/p-dad03b49.entry.js +0 -5
- package/dist/webcomponents/p-db8e6322.entry.js +0 -5
- package/dist/webcomponents/p-dea8015f.entry.js +0 -5
- package/dist/webcomponents/p-e53d874b.entry.js +0 -5
- package/dist/webcomponents/p-e5540387.entry.js +0 -5
- package/dist/webcomponents/p-e94a52ac.entry.js +0 -5
- package/dist/webcomponents/p-e9be4d3f.entry.js +0 -5
- package/dist/webcomponents/p-e9db9381.entry.js +0 -5
- package/dist/webcomponents/p-edca5de1.entry.js +0 -5
- package/dist/webcomponents/p-ee5b9fc9.entry.js +0 -5
- package/dist/webcomponents/p-f4ef8c63.entry.js +0 -5
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
'use strict';
|
|
6
6
|
|
|
7
7
|
var index$1 = require('./index-Bc30P_6z.js');
|
|
8
|
-
var index = require('./index-
|
|
9
|
-
var datetimePickerConstants = require('./datetime-picker-constants-
|
|
10
|
-
var
|
|
8
|
+
var index = require('./index-C-IpVFDH.js');
|
|
9
|
+
var datetimePickerConstants = require('./datetime-picker-constants-CCeI5iW7.js');
|
|
10
|
+
var isValid = require('./isValid-CduHZTFc.js');
|
|
11
11
|
var event = require('./event-CmVdNHxl.js');
|
|
12
12
|
var propWarning = require('./prop-warning-xvEHQz8H.js');
|
|
13
|
-
var props = require('./props-D8dybmr0.js');
|
|
14
13
|
|
|
15
14
|
var addMonths = {};
|
|
16
15
|
|
|
@@ -395,6 +394,8 @@ function requireIsSameMonth () {
|
|
|
395
394
|
|
|
396
395
|
var isSameMonthExports = /*@__PURE__*/ requireIsSameMonth();
|
|
397
396
|
|
|
397
|
+
var startOfDayExports = /*@__PURE__*/ datetimePickerConstants.requireStartOfDay();
|
|
398
|
+
|
|
398
399
|
var startOfMonth = {};
|
|
399
400
|
|
|
400
401
|
var hasRequiredStartOfMonth;
|
|
@@ -489,19 +490,20 @@ var subMonthsExports = /*@__PURE__*/ requireSubMonths();
|
|
|
489
490
|
|
|
490
491
|
const VALID_WEEK_START_DAYS = [0, 1, 2, 3, 4, 5, 6];
|
|
491
492
|
/**
|
|
492
|
-
* Verifica se
|
|
493
|
+
* Verifica se um valor representa um índice válido para o primeiro dia da semana (0-6).
|
|
493
494
|
*
|
|
494
|
-
* @param value
|
|
495
|
-
* @returns `true` quando
|
|
495
|
+
* @param {number} value Valor a validar (possivelmente vindo de uma `@Prop`).
|
|
496
|
+
* @returns {value is WeekDayIndex} `true` quando `value` é um `WeekDayIndex` válido (0..6).
|
|
496
497
|
*/
|
|
497
498
|
function isValidWeekStartsOn(value) {
|
|
498
499
|
return VALID_WEEK_START_DAYS.includes(value);
|
|
499
500
|
}
|
|
500
501
|
/**
|
|
501
|
-
* Normaliza o índice de início da semana
|
|
502
|
+
* Normaliza o índice de início da semana.
|
|
503
|
+
* Quando o valor é inválido, emite um aviso e retorna o fallback `0`.
|
|
502
504
|
*
|
|
503
|
-
* @param value
|
|
504
|
-
* @returns Índice normalizado
|
|
505
|
+
* @param {number} value Valor informado pelo consumidor.
|
|
506
|
+
* @returns {WeekDayIndex} Índice normalizado (`WeekDayIndex`).
|
|
505
507
|
*/
|
|
506
508
|
function normalizeWeekStartsOn(value) {
|
|
507
509
|
if (isValidWeekStartsOn(value))
|
|
@@ -510,11 +512,10 @@ function normalizeWeekStartsOn(value) {
|
|
|
510
512
|
return 0;
|
|
511
513
|
}
|
|
512
514
|
/**
|
|
513
|
-
*
|
|
514
|
-
* Retorna true se a resolução for bem-sucedida (inclui fallback).
|
|
515
|
+
* Verifica se um código de `locale` pode ser resolvido pelo date-fns.
|
|
515
516
|
*
|
|
516
|
-
* @param value
|
|
517
|
-
* @returns `true`
|
|
517
|
+
* @param {string} value Código de locale (ex.: "pt-BR").
|
|
518
|
+
* @returns {boolean} `true` se a resolução for bem-sucedida; `false` caso contrário.
|
|
518
519
|
*/
|
|
519
520
|
function isValidLocaleCode(value) {
|
|
520
521
|
try {
|
|
@@ -526,10 +527,11 @@ function isValidLocaleCode(value) {
|
|
|
526
527
|
}
|
|
527
528
|
}
|
|
528
529
|
/**
|
|
529
|
-
* Normaliza o locale informado
|
|
530
|
+
* Normaliza o código de `locale` informado pelo consumidor.
|
|
531
|
+
* Se inválido, emite aviso e retorna o `DATETIME_PICKER_LOCALE.DEFAULT`.
|
|
530
532
|
*
|
|
531
|
-
* @param value
|
|
532
|
-
* @returns
|
|
533
|
+
* @param {string} value Código de locale informado pelo consumidor.
|
|
534
|
+
* @returns {string} Código de locale validado (ou o default do componente).
|
|
533
535
|
*/
|
|
534
536
|
function normalizeLocale(value) {
|
|
535
537
|
if (isValidLocaleCode(value))
|
|
@@ -538,79 +540,79 @@ function normalizeLocale(value) {
|
|
|
538
540
|
return datetimePickerConstants.DATETIME_PICKER_LOCALE.DEFAULT;
|
|
539
541
|
}
|
|
540
542
|
|
|
541
|
-
const datePickerCss = () => `*,*::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}code{font-family:monospace;font-size:1em}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}.mx-3{margin-left:var(--spacing-scale-2x) !important;margin-right:var(--spacing-scale-2x) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.ml-auto{margin-left:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}@media (min-width: 576px){.ml-sm-0{margin-left:var(--spacing-scale-default) !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)}code,.code{background:var(--gray-5);border-radius:4px;color:var(--gray-80);display:inline-block;font-family:monospace;font-size:var(--font-size-scale-base);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);padding: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)}pre code,.pre code{display:inline;padding:0}*[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:block;width:100%;max-width:304px;height:auto;box-sizing:border-box}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--spacing-scale-base);width:100%;box-sizing:border-box}select{appearance:none;border:none;background:rgba(0,0,0,0);padding-right:20px;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);color:var(--blue-warm-vivid-70);outline:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path fill='%231351b4' d='M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L224 285.229l154.706-154.705c9.373-9.373 24.569-9.373 33.941 0l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.373-24.569 9.373-33.942 0z'/></svg>");background-repeat:no-repeat;background-position:right .35rem center;background-size:10px}select option{color:var(--color)}select:focus{outline:none}select:focus-visible{outline:var(--focus) var(--focus-style) var(--focus-width);outline-offset:var(--focus-offset)}select:hover{cursor:pointer}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;white-space:nowrap;border:0}input[type=number]{width:70px;padding:4px;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);background-color:var(--gray-0);color:var(--gray-80);text-align:center;border-color:var(--border-color-alternative);border-radius:var(--surface-rounder-sm);border-style:var(--border-style);border-width:var(--border-width)}input[type=number]:hover{background:linear-gradient(rgb(var(--color-rgb), var(--hover)), rgb(var(--color-rgb), var(--hover)))}.weekdays{margin-bottom:var(--spacing-scale-half)}.weekdays,.monthdays{display:grid;grid-template-columns:repeat(7, 1fr);place-items:center center;text-align:center;gap:var(--spacing-scale-half) var(--spacing-scale-half);width:100%;box-sizing:border-box}.weekday{display:flex;align-items:center;justify-content:center;font-weight:var(--font-weight-medium);color:var(--gray-70);width:var(--spacing-scale-4x)}.week{display:contents}.day{display:flex;align-items:center;justify-content:center;justify-self:center;padding:var(--spacing-scale-half);font-weight:var(--font-weight-semi-bold);color:var(--blue-warm-vivid-70);border-radius:50%;width:var(--spacing-scale-4x);height:var(--spacing-scale-4x)}.day:hover{background:var(--hover-effect);cursor:pointer}.day:focus-visible{outline:var(--focus) var(--focus-style) var(--focus-width);outline-offset:var(--focus-offset)}.day.selected{background:var(--blue-warm-vivid-70);color:var(--color-secondary-01);font-weight:var(--font-weight-bold)}.day.in-range{background:var(--blue-warm-vivid-10);color:var(--blue-warm-vivid-70);border-radius:0;place-self:stretch stretch;width:100%;height:100%;overflow:hidden}.day.range-start{background:var(--blue-warm-vivid-70);color:var(--color-secondary-01);font-weight:var(--font-weight-bold);width:100%;height:100%;border-radius:var(--surface-rounder-pill) 0 0 var(--surface-rounder-pill);place-self:stretch stretch;overflow:hidden}.day.range-end{background:var(--blue-warm-vivid-70);color:var(--color-secondary-01);font-weight:var(--font-weight-bold);width:100%;height:100%;border-radius:0 var(--surface-rounder-pill) var(--surface-rounder-pill) 0;place-self:stretch stretch;overflow:hidden}.day.range-start.range-end{border-radius:var(--surface-rounder-pill);height:100%;overflow:hidden}.day.disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.outside-month{font-weight:var(--font-weight-regular);color:var(--gray-70)}.today{background:var(--orange-vivid-5);color:var(--gray-80)}`;
|
|
543
|
+
const datePickerCss = () => `*,*::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}.mx-3{margin-left:var(--spacing-scale-2x) !important;margin-right:var(--spacing-scale-2x) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.ml-auto{margin-left:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}@media (min-width: 576px){.ml-sm-0{margin-left:var(--spacing-scale-default) !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)}*[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:block;width:100%;max-width:304px;height:auto;box-sizing:border-box}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--spacing-scale-base);width:100%;box-sizing:border-box}select{appearance:none;border:none;background:rgba(0,0,0,0);padding-right:20px;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);color:var(--blue-warm-vivid-70);outline:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path fill='%231351b4' d='M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L224 285.229l154.706-154.705c9.373-9.373 24.569-9.373 33.941 0l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.373-24.569 9.373-33.942 0z'/></svg>");background-repeat:no-repeat;background-position:right .35rem center;background-size:10px}select option{color:var(--color)}select:focus{outline:none}select:focus-visible{outline:var(--focus) var(--focus-style) var(--focus-width);outline-offset:var(--focus-offset)}select:hover{cursor:pointer}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;white-space:nowrap;border:0}input[type=number]{width:70px;padding:4px;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);background-color:var(--gray-0);color:var(--gray-80);text-align:center;border-color:var(--border-color-alternative);border-radius:var(--surface-rounder-sm);border-style:var(--border-style);border-width:var(--border-width)}input[type=number]:hover{background:linear-gradient(rgb(var(--color-rgb), var(--hover)), rgb(var(--color-rgb), var(--hover)))}.weekdays{margin-bottom:var(--spacing-scale-half)}.weekdays,.monthdays{display:grid;grid-template-columns:repeat(7, 1fr);place-items:center center;text-align:center;gap:var(--spacing-scale-half) var(--spacing-scale-half);width:100%;box-sizing:border-box}.weekday{display:flex;align-items:center;justify-content:center;font-weight:var(--font-weight-medium);color:var(--gray-70);width:var(--spacing-scale-4x)}.week{display:contents}.day{display:flex;align-items:center;justify-content:center;justify-self:center;padding:var(--spacing-scale-half);font-weight:var(--font-weight-semi-bold);color:var(--blue-warm-vivid-70);border-radius:50%;width:var(--spacing-scale-4x);height:var(--spacing-scale-4x)}.day:hover{background:var(--hover-effect);cursor:pointer}.day:focus-visible{outline:var(--focus) var(--focus-style) var(--focus-width);outline-offset:var(--focus-offset)}.day.selected{background:var(--blue-warm-vivid-70);color:var(--color-secondary-01);font-weight:var(--font-weight-bold)}.day.in-range{background:var(--blue-warm-vivid-10);color:var(--blue-warm-vivid-70);border-radius:0;place-self:stretch stretch;width:100%;height:100%;overflow:hidden}.day.range-start{background:var(--blue-warm-vivid-70);color:var(--color-secondary-01);font-weight:var(--font-weight-bold);width:100%;height:100%;border-radius:var(--surface-rounder-pill) 0 0 var(--surface-rounder-pill);place-self:stretch stretch;overflow:hidden}.day.range-end{background:var(--blue-warm-vivid-70);color:var(--color-secondary-01);font-weight:var(--font-weight-bold);width:100%;height:100%;border-radius:0 var(--surface-rounder-pill) var(--surface-rounder-pill) 0;place-self:stretch stretch;overflow:hidden}.day.range-start.range-end{border-radius:var(--surface-rounder-pill);height:100%;overflow:hidden}.day.disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.outside-month{font-weight:var(--font-weight-regular);color:var(--gray-70)}.today{background:var(--orange-vivid-5);color:var(--gray-80)}`;
|
|
542
544
|
|
|
543
545
|
const DatePicker = class {
|
|
544
546
|
constructor(hostRef) {
|
|
545
547
|
index$1.registerInstance(this, hostRef);
|
|
546
548
|
this.dateStateChange = index$1.createEvent(this, "dateStateChange", 7);
|
|
547
|
-
/**
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
/** Define o índice do dia em que a semana começa na interface do calendário. */
|
|
549
|
+
/**
|
|
550
|
+
* Índice do dia em que a semana começa na interface do calendário.
|
|
551
|
+
* @default 0
|
|
552
|
+
*/
|
|
552
553
|
this.weekStartsOn = 0;
|
|
553
554
|
/**
|
|
554
|
-
* Data usada como base visual para o mês atualmente exibido
|
|
555
|
-
*
|
|
556
|
-
*
|
|
557
|
-
* @example
|
|
558
|
-
* ```js
|
|
559
|
-
* const calendar = document.querySelector('br-date-picker');
|
|
560
|
-
* calendar.referenceDate = new Date(2026, 8, 1);
|
|
561
|
-
* ```
|
|
555
|
+
* Data usada como base visual para o mês atualmente exibido.
|
|
556
|
+
* @default new Date()
|
|
562
557
|
*/
|
|
563
558
|
this.referenceDate = new Date();
|
|
564
559
|
/**
|
|
565
|
-
* Data
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
* @example
|
|
569
|
-
* ```js
|
|
570
|
-
* const calendar = document.querySelector('br-date-picker');
|
|
571
|
-
* calendar.value = new Date(2026, 8, 7);
|
|
572
|
-
* ```
|
|
560
|
+
* Data atualmente selecionada pelo usuário, ou `null` quando não há seleção.
|
|
561
|
+
* @default null
|
|
573
562
|
*/
|
|
574
563
|
this.value = null;
|
|
575
|
-
/**
|
|
564
|
+
/**
|
|
565
|
+
* Define se a seleção ocorre por data única ou por intervalo.
|
|
566
|
+
* @default 'single'
|
|
567
|
+
*/
|
|
576
568
|
this.selectionMode = 'single';
|
|
577
|
-
/**
|
|
569
|
+
/**
|
|
570
|
+
* Data inicial selecionada quando o calendário opera no modo de intervalo.
|
|
571
|
+
* @default null
|
|
572
|
+
*/
|
|
578
573
|
this.rangeStart = null;
|
|
579
|
-
/**
|
|
574
|
+
/**
|
|
575
|
+
* Data final selecionada quando o calendário opera no modo de intervalo.
|
|
576
|
+
* @default null
|
|
577
|
+
*/
|
|
580
578
|
this.rangeEnd = null;
|
|
581
|
-
/**
|
|
579
|
+
/**
|
|
580
|
+
* Desabilita a interação do calendário quando `true`.
|
|
581
|
+
* @default false
|
|
582
|
+
*/
|
|
582
583
|
this.disabled = false;
|
|
583
584
|
/**
|
|
584
585
|
* Lista de datas indisponíveis para seleção no calendário.
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
* @example
|
|
588
|
-
* ```js
|
|
589
|
-
* const calendar = document.querySelector('br-date-picker');
|
|
590
|
-
* calendar.disabledDates = [new Date(2026, 8, 7), new Date(2026, 8, 8)];
|
|
591
|
-
* ```
|
|
586
|
+
* @default []
|
|
592
587
|
*/
|
|
593
588
|
this.disabledDates = [];
|
|
594
|
-
/**
|
|
589
|
+
/**
|
|
590
|
+
* Locale usado para gerar nomes de meses e dias da semana.
|
|
591
|
+
* @default DATETIME_PICKER_LOCALE.DEFAULT
|
|
592
|
+
*/
|
|
595
593
|
this.locale = datetimePickerConstants.DATETIME_PICKER_LOCALE.DEFAULT;
|
|
596
594
|
/**
|
|
597
|
-
*
|
|
598
|
-
* ou variar conforme o mês.
|
|
599
|
-
*
|
|
600
|
-
* Quando `true`, o calendário sempre exibe 6 semanas completas.
|
|
601
|
-
* Quando `false`, o calendário adapta-se ao mês, exibindo apenas as semanas necessárias.
|
|
602
|
-
*
|
|
595
|
+
* Se `true`, o calendário sempre exibe 6 semanas (42 dias); caso contrário, adapta-se ao mês.
|
|
603
596
|
* @default false
|
|
604
597
|
*/
|
|
605
598
|
this.fixedRowCount = false;
|
|
606
|
-
/**
|
|
599
|
+
/**
|
|
600
|
+
* Data atualmente com foco para navegação por teclado.
|
|
601
|
+
* Usada para controlar qual célula do calendário recebe `tabindex=0`.
|
|
602
|
+
* @type {Date}
|
|
603
|
+
* @default new Date()
|
|
604
|
+
* @internal
|
|
605
|
+
*/
|
|
606
|
+
this.focusedDate = new Date();
|
|
607
|
+
/**
|
|
608
|
+
* Sinaliza ao `componentDidRender` que o foco deve ser movido para a célula atual.
|
|
609
|
+
* @internal
|
|
610
|
+
*/
|
|
607
611
|
this.shouldFocusDate = false;
|
|
608
|
-
/** Mantém handlers estáveis por data para evitar recriação a cada renderização. */
|
|
609
|
-
this.dayClickHandlers = new WeakMap();
|
|
610
612
|
/**
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
* @
|
|
613
|
+
* Handler de mudança do seletor de mês.
|
|
614
|
+
* @param event - evento de mudança do `<select>`
|
|
615
|
+
* @internal
|
|
614
616
|
*/
|
|
615
617
|
this.handleMonthChange = (event) => {
|
|
616
618
|
if (this.disabled) {
|
|
@@ -622,16 +624,22 @@ const DatePicker = class {
|
|
|
622
624
|
console.warn(`Índice de mês inválido selecionado: ${select.value}`);
|
|
623
625
|
return;
|
|
624
626
|
}
|
|
625
|
-
const date =
|
|
627
|
+
const date = isValid.setExports.set(this.baseDate, { month: monthIndex, date: 1 });
|
|
626
628
|
this.emitDateStateChange(date);
|
|
627
629
|
};
|
|
628
630
|
/**
|
|
629
|
-
*
|
|
630
|
-
*
|
|
631
|
-
* @
|
|
631
|
+
* Trata cliques nos botões de navegação do calendário.
|
|
632
|
+
* @param event - evento de clique
|
|
633
|
+
* @internal
|
|
632
634
|
*/
|
|
633
635
|
this.handleNavigationClick = (event) => {
|
|
634
|
-
|
|
636
|
+
if (this.disabled) {
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
const actionFromPath = event
|
|
640
|
+
.composedPath()
|
|
641
|
+
.find((target) => target instanceof HTMLElement && target.dataset.action !== undefined);
|
|
642
|
+
const action = (actionFromPath?.dataset.action ?? event.currentTarget?.dataset.action);
|
|
635
643
|
if (action === undefined) {
|
|
636
644
|
console.warn('Botão de navegação clicado sem data-action definido');
|
|
637
645
|
return;
|
|
@@ -648,9 +656,10 @@ const DatePicker = class {
|
|
|
648
656
|
}
|
|
649
657
|
};
|
|
650
658
|
/**
|
|
651
|
-
*
|
|
652
|
-
*
|
|
653
|
-
* @param event -
|
|
659
|
+
* Handler de alteração do campo ano.
|
|
660
|
+
* Valida o ano antes de aplicar a mudança.
|
|
661
|
+
* @param event - evento de mudança do input de ano
|
|
662
|
+
* @internal
|
|
654
663
|
*/
|
|
655
664
|
this.handleYearChange = (event) => {
|
|
656
665
|
if (this.disabled) {
|
|
@@ -662,23 +671,36 @@ const DatePicker = class {
|
|
|
662
671
|
console.warn(`Ano inválido digitado: ${input.value}`);
|
|
663
672
|
return;
|
|
664
673
|
}
|
|
665
|
-
const date =
|
|
666
|
-
const range = this.
|
|
674
|
+
const date = isValid.setExports.set(this.baseDate, { year, month: this.baseDate.getMonth(), date: 1 });
|
|
675
|
+
const range = this.selectionMode === 'range' && this.rangeStart !== null && this.rangeEnd !== null
|
|
667
676
|
? { start: this.rangeStart, end: this.rangeEnd }
|
|
668
677
|
: undefined;
|
|
669
678
|
this.emitDateStateChange(date, this.value, range);
|
|
670
679
|
};
|
|
671
680
|
/**
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
*
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
681
|
+
* Trata cliques com um handler compartilhado, lendo a data local da célula.
|
|
682
|
+
* @param event - evento de clique da célula
|
|
683
|
+
* @internal
|
|
684
|
+
*/
|
|
685
|
+
this.handleDayCellClick = (event) => {
|
|
686
|
+
const cell = event.currentTarget;
|
|
687
|
+
if (!(cell instanceof HTMLElement) || cell.dataset.date === undefined) {
|
|
688
|
+
console.warn('Célula de dia clicada sem data-date definido');
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
const date = isValid.parseExports.parse(cell.dataset.date, 'yyyy-MM-dd', this.baseDate);
|
|
692
|
+
if (Number.isNaN(date.getTime())) {
|
|
693
|
+
console.warn(`Data inválida na célula de dia: ${cell.dataset.date}`);
|
|
694
|
+
return;
|
|
695
|
+
}
|
|
696
|
+
this.handleDayClick(date);
|
|
697
|
+
};
|
|
698
|
+
/**
|
|
699
|
+
* Gerencia navegação por teclado dentro da grade de dias.
|
|
700
|
+
* Teclas suportadas: ArrowLeft/Right/Up/Down, PageUp/PageDown, Home/End, Enter/Space.
|
|
701
|
+
* @param event - evento de teclado
|
|
702
|
+
* @returns void
|
|
703
|
+
* @internal
|
|
682
704
|
*/
|
|
683
705
|
this.handleGridKeydown = (event) => {
|
|
684
706
|
const HANDLED_KEYS = [
|
|
@@ -695,12 +717,22 @@ const DatePicker = class {
|
|
|
695
717
|
];
|
|
696
718
|
if (!HANDLED_KEYS.includes(event.key))
|
|
697
719
|
return;
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
720
|
+
// O `event.target` pode ser um nó interno (texto) ou o foco pode estar
|
|
721
|
+
// em um container; tentamos localizar a célula com `data-date`.
|
|
722
|
+
const targetEl = event.target?.closest?.('[data-date]');
|
|
723
|
+
// Se encontrarmos a célula, usamos sua data; caso contrário, usamos a
|
|
724
|
+
// data atualmente focada (`focusedDate`) como fallback. Em ambos os casos
|
|
725
|
+
// prevenimos o comportamento padrão para manter consistência.
|
|
726
|
+
let current;
|
|
727
|
+
if (targetEl && targetEl.dataset?.date !== undefined) {
|
|
728
|
+
const dateKey = targetEl.dataset.date;
|
|
729
|
+
event.preventDefault();
|
|
730
|
+
current = isValid.parseExports.parse(dateKey, 'yyyy-MM-dd', new Date());
|
|
731
|
+
}
|
|
732
|
+
else {
|
|
733
|
+
event.preventDefault();
|
|
734
|
+
current = this.getNormalizedFocusedDate();
|
|
735
|
+
}
|
|
704
736
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
705
737
|
if (!this.isDateDisabled(current)) {
|
|
706
738
|
this.handleDayClick(current);
|
|
@@ -739,47 +771,41 @@ const DatePicker = class {
|
|
|
739
771
|
this.moveFocusTo(next);
|
|
740
772
|
};
|
|
741
773
|
}
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
774
|
+
/**
|
|
775
|
+
* Observador para a prop `rangeValue` — sincroniza `rangeStart` e `rangeEnd`.
|
|
776
|
+
* @param {DatetimePickerDateRange | undefined} newValue - novo intervalo controlado recebido (`undefined` quando não fornecido)
|
|
777
|
+
* @internal
|
|
778
|
+
*/
|
|
745
779
|
handleRangeValueChange(newValue) {
|
|
746
780
|
if (!newValue)
|
|
747
781
|
return;
|
|
748
|
-
if (!datetimePickerPropsValidation.isValidDatetimePickerDateRange(newValue)) {
|
|
749
|
-
propWarning.reportInvalidPropValue(this.el, 'rangeValue', newValue, 'Informe um objeto com `start` e `end` como Date válido ou null.', 'Ignorando o intervalo inválido e mantendo o último intervalo efetivo.');
|
|
750
|
-
return;
|
|
751
|
-
}
|
|
752
782
|
this.rangeStart = newValue.start;
|
|
753
783
|
this.rangeEnd = newValue.end;
|
|
754
784
|
}
|
|
755
785
|
/**
|
|
756
786
|
* Sincroniza `focusedDate` quando o valor selecionado muda externamente.
|
|
757
787
|
*
|
|
758
|
-
* @param newValue - Novo valor recebido via prop.
|
|
788
|
+
* @param {Date | null} newValue - Novo valor recebido via prop.
|
|
789
|
+
*/
|
|
790
|
+
/**
|
|
791
|
+
* Observador para a prop `value` — atualiza `focusedDate` quando a seleção externa muda.
|
|
792
|
+
* @param {Date | null} newValue - novo valor de seleção (ou `null`)
|
|
793
|
+
* @internal
|
|
759
794
|
*/
|
|
760
795
|
handleValueChange(newValue) {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
if ((normalizedValue?.getTime() ?? null) !== receivedTime) {
|
|
764
|
-
this.value = normalizedValue;
|
|
765
|
-
return;
|
|
766
|
-
}
|
|
767
|
-
this.focusedDate = datetimePickerPropsValidation.toDateExports.toDate(normalizedValue ?? this.referenceDate);
|
|
768
|
-
}
|
|
769
|
-
handleReferenceDateChange(newValue) {
|
|
770
|
-
const normalizedReferenceDate = this.normalizeDateProp(newValue, 'referenceDate', new Date());
|
|
771
|
-
const receivedTime = newValue instanceof Date && !Number.isNaN(newValue.getTime()) ? newValue.getTime() : null;
|
|
772
|
-
if (normalizedReferenceDate.getTime() !== receivedTime) {
|
|
773
|
-
this.referenceDate = normalizedReferenceDate;
|
|
774
|
-
return;
|
|
796
|
+
if (newValue !== null) {
|
|
797
|
+
this.focusedDate = isValid.toDateExports.toDate(newValue);
|
|
775
798
|
}
|
|
776
|
-
if (this.value === null)
|
|
777
|
-
this.focusedDate = datetimePickerPropsValidation.toDateExports.toDate(normalizedReferenceDate);
|
|
778
799
|
}
|
|
779
800
|
/**
|
|
780
801
|
* Revalida a configuração quando o início da semana muda.
|
|
781
802
|
*
|
|
782
|
-
* @param newValue - Novo valor recebido via prop.
|
|
803
|
+
* @param {number} newValue - Novo valor recebido via prop.
|
|
804
|
+
*/
|
|
805
|
+
/**
|
|
806
|
+
* Observador para `weekStartsOn` — revalida a configuração quando alterada externamente.
|
|
807
|
+
* @param {number} newValue - novo índice do início da semana
|
|
808
|
+
* @internal
|
|
783
809
|
*/
|
|
784
810
|
handleWeekStartsOnChange(newValue) {
|
|
785
811
|
this.ensureValidWeekStartsOn(newValue);
|
|
@@ -787,29 +813,22 @@ const DatePicker = class {
|
|
|
787
813
|
/**
|
|
788
814
|
* Revalida o locale quando a prop muda.
|
|
789
815
|
*
|
|
790
|
-
* @param newValue - Novo valor recebido via prop.
|
|
816
|
+
* @param {string} newValue - Novo valor recebido via prop.
|
|
817
|
+
*/
|
|
818
|
+
/**
|
|
819
|
+
* Observador para `locale` — revalida/normaliza o locale informado.
|
|
820
|
+
* @param {string} newValue - nova string de locale
|
|
821
|
+
* @internal
|
|
791
822
|
*/
|
|
792
823
|
handleLocaleChange(newValue) {
|
|
793
824
|
this.ensureValidLocale(newValue);
|
|
794
825
|
}
|
|
795
|
-
handleDisabledDatesChange(newValue) {
|
|
796
|
-
this.normalizedDisabledDates = datetimePickerPropsValidation.normalizeDatetimePickerDisabledDates(newValue, 'br-date-picker');
|
|
797
|
-
}
|
|
798
|
-
/**
|
|
799
|
-
* Normaliza os valores públicos antes da primeira renderização.
|
|
800
|
-
*/
|
|
801
826
|
componentWillLoad() {
|
|
802
|
-
this.referenceDate =
|
|
803
|
-
this.value = this.normalizeDateProp(this.value, 'value', null);
|
|
804
|
-
this.referenceDate = datetimePickerPropsValidation.resolveSsrLocalDate(this.el, this.referenceDate);
|
|
827
|
+
this.referenceDate = isValid.resolveSsrLocalDate(this.el, this.referenceDate);
|
|
805
828
|
this.ensureValidWeekStartsOn();
|
|
806
829
|
this.ensureValidLocale();
|
|
807
|
-
this.
|
|
808
|
-
this.focusedDate = datetimePickerPropsValidation.toDateExports.toDate(this.value ?? this.referenceDate);
|
|
830
|
+
this.focusedDate = isValid.toDateExports.toDate(this.value ?? this.referenceDate);
|
|
809
831
|
}
|
|
810
|
-
/**
|
|
811
|
-
* Move o foco para a célula correspondente ao `focusedDate` após re-renderização.
|
|
812
|
-
*/
|
|
813
832
|
componentDidRender() {
|
|
814
833
|
if (!this.shouldFocusDate)
|
|
815
834
|
return;
|
|
@@ -820,9 +839,9 @@ const DatePicker = class {
|
|
|
820
839
|
cell?.focus();
|
|
821
840
|
}
|
|
822
841
|
/**
|
|
823
|
-
*
|
|
824
|
-
*
|
|
842
|
+
* Valida e normaliza `weekStartsOn`.
|
|
825
843
|
* @param value - Valor bruto informado pelo consumidor.
|
|
844
|
+
* @internal
|
|
826
845
|
*/
|
|
827
846
|
ensureValidWeekStartsOn(value = this.weekStartsOn) {
|
|
828
847
|
const normalizedWeekStartsOn = normalizeWeekStartsOn(value);
|
|
@@ -830,18 +849,10 @@ const DatePicker = class {
|
|
|
830
849
|
this.weekStartsOn = normalizedWeekStartsOn;
|
|
831
850
|
}
|
|
832
851
|
}
|
|
833
|
-
normalizeDateProp(value, propertyName, fallback) {
|
|
834
|
-
if (value === null && fallback === null)
|
|
835
|
-
return null;
|
|
836
|
-
if (value instanceof Date && !Number.isNaN(value.getTime()))
|
|
837
|
-
return datetimePickerPropsValidation.toDateExports.toDate(value);
|
|
838
|
-
propWarning.reportInvalidPropValue(this.el, propertyName, value, 'Informe uma instância de Date válida.', `Aplicando fallback ${fallback === null ? 'null' : 'new Date()'}.`);
|
|
839
|
-
return fallback === null ? null : datetimePickerPropsValidation.toDateExports.toDate(fallback);
|
|
840
|
-
}
|
|
841
852
|
/**
|
|
842
|
-
*
|
|
843
|
-
*
|
|
853
|
+
* Valida e normaliza o `locale` informado.
|
|
844
854
|
* @param value - Valor bruto informado pelo consumidor.
|
|
855
|
+
* @internal
|
|
845
856
|
*/
|
|
846
857
|
ensureValidLocale(value = this.locale) {
|
|
847
858
|
const normalizedLocale = normalizeLocale(value);
|
|
@@ -850,16 +861,20 @@ const DatePicker = class {
|
|
|
850
861
|
}
|
|
851
862
|
}
|
|
852
863
|
/**
|
|
853
|
-
* Emite
|
|
864
|
+
* Emite `dateStateChange` atualizando `referenceDate`, `value` e `range`.
|
|
865
|
+
* Zera segundos/milissegundos para consistência.
|
|
854
866
|
*
|
|
855
|
-
* @param nextReferenceDate -
|
|
856
|
-
* @param nextValue -
|
|
867
|
+
* @param nextReferenceDate - nova data de referência
|
|
868
|
+
* @param nextValue - data selecionada ou `null` (por padrão, mantém `this.value`)
|
|
869
|
+
* @param nextRange - intervalo de datas quando aplicável
|
|
870
|
+
* @internal
|
|
857
871
|
*/
|
|
858
872
|
emitDateStateChange(nextReferenceDate, nextValue = this.value, nextRange = undefined) {
|
|
859
873
|
// Garantir segundos zerados (componente não manipula segundos)
|
|
860
|
-
const normalizedReference =
|
|
861
|
-
const normalizedValue = nextValue === null ? null :
|
|
874
|
+
const normalizedReference = isValid.setExports.set(nextReferenceDate, { seconds: 0, milliseconds: 0 });
|
|
875
|
+
const normalizedValue = nextValue === null ? null : isValid.setExports.set(nextValue, { seconds: 0, milliseconds: 0 });
|
|
862
876
|
const valueChanged = this.value?.getTime() !== normalizedValue?.getTime();
|
|
877
|
+
this.referenceDate = normalizedReference;
|
|
863
878
|
this.value = normalizedValue;
|
|
864
879
|
this.dateStateChange.emit({
|
|
865
880
|
referenceDate: normalizedReference,
|
|
@@ -874,10 +889,10 @@ const DatePicker = class {
|
|
|
874
889
|
}
|
|
875
890
|
}
|
|
876
891
|
/**
|
|
877
|
-
* Resolve o ícone
|
|
878
|
-
*
|
|
879
|
-
* @
|
|
880
|
-
* @
|
|
892
|
+
* Resolve o nome do ícone para a ação de navegação.
|
|
893
|
+
* @param action - Ação de navegação
|
|
894
|
+
* @returns Nome do ícone
|
|
895
|
+
* @internal
|
|
881
896
|
*/
|
|
882
897
|
getIconForAction(action) {
|
|
883
898
|
switch (action) {
|
|
@@ -890,27 +905,31 @@ const DatePicker = class {
|
|
|
890
905
|
}
|
|
891
906
|
}
|
|
892
907
|
/**
|
|
893
|
-
*
|
|
894
|
-
*
|
|
895
|
-
* @
|
|
908
|
+
* Trata o clique numa célula de dia: aplica seleção ou atualiza intervalo.
|
|
909
|
+
* @param date - dia clicado
|
|
910
|
+
* @internal
|
|
896
911
|
*/
|
|
897
912
|
handleDayClick(date) {
|
|
898
913
|
if (this.disabled || this.isDateDisabled(date)) {
|
|
899
914
|
return;
|
|
900
915
|
}
|
|
901
|
-
const newDate =
|
|
916
|
+
const newDate = isValid.setExports.set(date, {
|
|
902
917
|
hours: this.referenceDate.getHours(),
|
|
903
918
|
minutes: this.referenceDate.getMinutes(),
|
|
904
919
|
seconds: 0,
|
|
905
920
|
milliseconds: 0,
|
|
906
921
|
});
|
|
907
|
-
if (this.
|
|
922
|
+
if (this.selectionMode === 'range') {
|
|
908
923
|
this.handleRangeDayClick(newDate);
|
|
909
924
|
return;
|
|
910
925
|
}
|
|
911
926
|
this.emitDateStateChange(newDate, newDate);
|
|
912
927
|
}
|
|
913
|
-
/**
|
|
928
|
+
/**
|
|
929
|
+
* Atualiza o intervalo selecionado no modo `range`.
|
|
930
|
+
* @param clickedDate - data clicada pelo usuário
|
|
931
|
+
* @internal
|
|
932
|
+
*/
|
|
914
933
|
handleRangeDayClick(clickedDate) {
|
|
915
934
|
const start = this.rangeStart;
|
|
916
935
|
const end = this.rangeEnd;
|
|
@@ -927,66 +946,72 @@ const DatePicker = class {
|
|
|
927
946
|
end: normalizedEnd,
|
|
928
947
|
});
|
|
929
948
|
}
|
|
930
|
-
/**
|
|
949
|
+
/**
|
|
950
|
+
* Decrementa o mês exibido e preserva seleção/intervalo quando aplicável.
|
|
951
|
+
* @internal
|
|
952
|
+
*/
|
|
931
953
|
decreaseMonth() {
|
|
932
954
|
if (this.disabled) {
|
|
933
955
|
return;
|
|
934
956
|
}
|
|
935
|
-
const date =
|
|
936
|
-
const range = this.
|
|
957
|
+
const date = isValid.setExports.set(subMonthsExports.subMonths(this.baseDate, 1), { date: 1 });
|
|
958
|
+
const range = this.selectionMode === 'range' && this.rangeStart !== null && this.rangeEnd !== null
|
|
937
959
|
? { start: this.rangeStart, end: this.rangeEnd }
|
|
938
960
|
: undefined;
|
|
939
961
|
this.emitDateStateChange(date, this.value, range);
|
|
940
962
|
}
|
|
941
|
-
/**
|
|
963
|
+
/**
|
|
964
|
+
* Incrementa o mês exibido e preserva seleção/intervalo quando aplicável.
|
|
965
|
+
* @internal
|
|
966
|
+
*/
|
|
942
967
|
increaseMonth() {
|
|
943
968
|
if (this.disabled) {
|
|
944
969
|
return;
|
|
945
970
|
}
|
|
946
|
-
const date =
|
|
947
|
-
const range = this.
|
|
971
|
+
const date = isValid.setExports.set(addMonthsExports.addMonths(this.baseDate, 1), { date: 1 });
|
|
972
|
+
const range = this.selectionMode === 'range' && this.rangeStart !== null && this.rangeEnd !== null
|
|
948
973
|
? { start: this.rangeStart, end: this.rangeEnd }
|
|
949
974
|
: undefined;
|
|
950
975
|
this.emitDateStateChange(date, this.value, range);
|
|
951
976
|
}
|
|
952
|
-
/**
|
|
977
|
+
/**
|
|
978
|
+
* Verifica se uma data está indisponível para seleção.
|
|
979
|
+
* @param date - data a verificar
|
|
980
|
+
* @returns `true` se a data estiver na lista de `disabledDates`
|
|
981
|
+
* @internal
|
|
982
|
+
*/
|
|
953
983
|
isDateDisabled(date) {
|
|
954
|
-
return this.
|
|
984
|
+
return this.disabledDates.some((disabledDate) => isValid.isSameDayExports.isSameDay(disabledDate, date));
|
|
955
985
|
}
|
|
956
|
-
/**
|
|
986
|
+
/**
|
|
987
|
+
* Data base usada para todos os cálculos de calendário.
|
|
988
|
+
* @returns data de referência interna
|
|
989
|
+
* @internal
|
|
990
|
+
*/
|
|
957
991
|
get baseDate() {
|
|
958
992
|
return this.referenceDate;
|
|
959
993
|
}
|
|
960
994
|
/**
|
|
961
|
-
*
|
|
962
|
-
*
|
|
963
|
-
* @
|
|
964
|
-
* @
|
|
995
|
+
* Formata o dia exibido com zero à esquerda (ex: '01', '09').
|
|
996
|
+
* @param date - data a formatar
|
|
997
|
+
* @returns string com dois dígitos do dia
|
|
998
|
+
* @internal
|
|
965
999
|
*/
|
|
966
|
-
getDayClickHandler(date) {
|
|
967
|
-
let handler = this.dayClickHandlers.get(date);
|
|
968
|
-
if (handler === undefined) {
|
|
969
|
-
handler = () => this.handleDayClick(date);
|
|
970
|
-
this.dayClickHandlers.set(date, handler);
|
|
971
|
-
}
|
|
972
|
-
return handler;
|
|
973
|
-
}
|
|
974
|
-
/** Formata o dia exibido com zero à esquerda. */
|
|
975
1000
|
getDayWithLeadingZero(date) {
|
|
976
1001
|
return datetimePickerConstants.formatExports.format(date, 'dd');
|
|
977
1002
|
}
|
|
978
1003
|
/**
|
|
979
|
-
* Constrói o rótulo acessível
|
|
980
|
-
*
|
|
981
|
-
* @
|
|
982
|
-
* @
|
|
1004
|
+
* Constrói o rótulo acessível da célula de dia, incluindo estado (selecionado/início/fim).
|
|
1005
|
+
* @param date - dia representado pela célula
|
|
1006
|
+
* @returns string para `aria-label`
|
|
1007
|
+
* @internal
|
|
983
1008
|
*/
|
|
984
1009
|
getDayCellAriaLabel(date) {
|
|
985
1010
|
const fullDate = datetimePickerConstants.formatExports.format(date, "d 'de' MMMM 'de' yyyy", { locale: this.dateFnsLocale });
|
|
986
|
-
const isSelected = this.
|
|
987
|
-
const isRangeStart = this.
|
|
988
|
-
const isRangeEnd = this.
|
|
989
|
-
const isBetween = this.
|
|
1011
|
+
const isSelected = this.selectionMode === 'single' && this.value !== null && isValid.isSameDayExports.isSameDay(date, this.value);
|
|
1012
|
+
const isRangeStart = this.selectionMode === 'range' && this.rangeStart !== null && isValid.isSameDayExports.isSameDay(date, this.rangeStart);
|
|
1013
|
+
const isRangeEnd = this.selectionMode === 'range' && this.rangeEnd !== null && isValid.isSameDayExports.isSameDay(date, this.rangeEnd);
|
|
1014
|
+
const isBetween = this.selectionMode === 'range' &&
|
|
990
1015
|
this.rangeStart !== null &&
|
|
991
1016
|
this.rangeEnd !== null &&
|
|
992
1017
|
this.isDateBetweenRange(date, this.rangeStart, this.rangeEnd);
|
|
@@ -1000,80 +1025,91 @@ const DatePicker = class {
|
|
|
1000
1025
|
return `${fullDate}, no intervalo selecionado`;
|
|
1001
1026
|
return fullDate;
|
|
1002
1027
|
}
|
|
1003
|
-
/**
|
|
1028
|
+
/**
|
|
1029
|
+
* Locale do `date-fns` derivado da prop pública `locale`.
|
|
1030
|
+
* @internal
|
|
1031
|
+
*/
|
|
1004
1032
|
get dateFnsLocale() {
|
|
1005
1033
|
return index.resolveDateFnsLocale(this.locale);
|
|
1006
1034
|
}
|
|
1007
1035
|
/**
|
|
1008
|
-
* Calcula
|
|
1009
|
-
*
|
|
1010
|
-
* @param
|
|
1036
|
+
* Calcula o mapa de classes CSS da célula do dia.
|
|
1037
|
+
* @param date - dia da grade
|
|
1038
|
+
* @param today - instante atual compartilhado pela renderização da grade
|
|
1039
|
+
* @returns mapa de classes booleanas
|
|
1040
|
+
* @internal
|
|
1011
1041
|
*/
|
|
1012
|
-
getDayCssClasses(date) {
|
|
1042
|
+
getDayCssClasses(date, today) {
|
|
1013
1043
|
const selected = this.value;
|
|
1014
1044
|
const rangeStart = this.rangeStart;
|
|
1015
1045
|
const rangeEnd = this.rangeEnd;
|
|
1016
1046
|
const hasRange = rangeStart !== null && rangeEnd !== null;
|
|
1017
|
-
const isRangeStart = rangeStart !== null &&
|
|
1018
|
-
const isRangeEnd = rangeEnd !== null &&
|
|
1047
|
+
const isRangeStart = rangeStart !== null && isValid.isSameDayExports.isSameDay(date, rangeStart);
|
|
1048
|
+
const isRangeEnd = rangeEnd !== null && isValid.isSameDayExports.isSameDay(date, rangeEnd);
|
|
1019
1049
|
const isBetweenRange = hasRange && this.isDateBetweenRange(date, rangeStart, rangeEnd);
|
|
1020
1050
|
return {
|
|
1021
1051
|
day: true,
|
|
1022
1052
|
'outside-month': !isSameMonthExports.isSameMonth(date, this.baseDate),
|
|
1023
|
-
today:
|
|
1024
|
-
selected: this.
|
|
1025
|
-
'range-start': this.
|
|
1026
|
-
'range-end': this.
|
|
1027
|
-
'in-range': this.
|
|
1053
|
+
today: isValid.isSameDayExports.isSameDay(date, today),
|
|
1054
|
+
selected: this.selectionMode === 'single' && selected !== null && isValid.isSameDayExports.isSameDay(date, selected),
|
|
1055
|
+
'range-start': this.selectionMode === 'range' && isRangeStart,
|
|
1056
|
+
'range-end': this.selectionMode === 'range' && isRangeEnd,
|
|
1057
|
+
'in-range': this.selectionMode === 'range' && isBetweenRange,
|
|
1028
1058
|
};
|
|
1029
1059
|
}
|
|
1030
|
-
/**
|
|
1060
|
+
/**
|
|
1061
|
+
* Normaliza os limites do intervalo garantindo ordem cronológica (start <= end).
|
|
1062
|
+
* @param start - data de início
|
|
1063
|
+
* @param end - data de fim
|
|
1064
|
+
* @returns tupla [start, end] na ordem correta
|
|
1065
|
+
* @internal
|
|
1066
|
+
*/
|
|
1031
1067
|
normalizeRangeBounds(start, end) {
|
|
1032
1068
|
return compareAscExports.compareAsc(start, end) <= 0 ? [start, end] : [end, start];
|
|
1033
1069
|
}
|
|
1034
|
-
/**
|
|
1070
|
+
/**
|
|
1071
|
+
* Verifica se uma data está estritamente entre `start` e `end`.
|
|
1072
|
+
* @param date - data a verificar
|
|
1073
|
+
* @param start - início do intervalo
|
|
1074
|
+
* @param end - fim do intervalo
|
|
1075
|
+
* @returns `true` se `start < date < end`
|
|
1076
|
+
* @internal
|
|
1077
|
+
*/
|
|
1035
1078
|
isDateBetweenRange(date, start, end) {
|
|
1036
1079
|
return isAfterExports.isAfter(date, start) && isBeforeExports.isBefore(date, end);
|
|
1037
1080
|
}
|
|
1038
|
-
/**
|
|
1039
|
-
|
|
1081
|
+
/**
|
|
1082
|
+
* Calcula os limites da grade do mês, respeitando `fixedRowCount`, sem gerar suas datas.
|
|
1083
|
+
* @returns limites inclusivos da grade
|
|
1084
|
+
* @internal
|
|
1085
|
+
*/
|
|
1086
|
+
getMonthViewInterval() {
|
|
1040
1087
|
const start = index.startOfWeekExports.startOfWeek(startOfMonthExports.startOfMonth(this.baseDate), { weekStartsOn: this.weekStartsOn });
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
const normalizedDates = datetimePickerPropsValidation.eachDayOfIntervalExports.eachDayOfInterval({ start, end });
|
|
1046
|
-
const currentWeekCount = Math.ceil(normalizedDates.length / 7);
|
|
1047
|
-
const targetWeekCount = 6;
|
|
1048
|
-
// Se não houver 6 semanas, estende o final para alcançar 42 dias
|
|
1049
|
-
if (currentWeekCount < targetWeekCount) {
|
|
1050
|
-
const daysToAdd = (targetWeekCount - currentWeekCount) * 7;
|
|
1051
|
-
end = index.addDaysExports.addDays(end, daysToAdd);
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
return datetimePickerPropsValidation.eachDayOfIntervalExports.eachDayOfInterval({ start, end });
|
|
1088
|
+
const end = this.fixedRowCount
|
|
1089
|
+
? index.addDaysExports.addDays(start, 41)
|
|
1090
|
+
: endOfWeekExports.endOfWeek(endOfMonthExports.endOfMonth(this.baseDate), { weekStartsOn: this.weekStartsOn });
|
|
1091
|
+
return { start, end };
|
|
1055
1092
|
}
|
|
1056
1093
|
/**
|
|
1057
|
-
* Retorna o `focusedDate` normalizado para estar
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1061
|
-
*
|
|
1062
|
-
* @returns Data focada normalizada ou primeiro dia da grade.
|
|
1094
|
+
* Retorna o `focusedDate` normalizado para estar dentro da grade visível.
|
|
1095
|
+
* Se não estiver visível, retorna o primeiro dia da grade.
|
|
1096
|
+
* @param interval - limites da grade atual; calculados quando não fornecidos
|
|
1097
|
+
* @returns data normalizada para foco
|
|
1098
|
+
* @internal
|
|
1063
1099
|
*/
|
|
1064
|
-
getNormalizedFocusedDate() {
|
|
1065
|
-
const
|
|
1066
|
-
const
|
|
1067
|
-
if (
|
|
1100
|
+
getNormalizedFocusedDate(interval = this.getMonthViewInterval()) {
|
|
1101
|
+
const focusedDay = startOfDayExports.startOfDay(this.focusedDate).getTime();
|
|
1102
|
+
const isVisible = focusedDay >= interval.start.getTime() && focusedDay <= interval.end.getTime();
|
|
1103
|
+
if (isVisible) {
|
|
1068
1104
|
return this.focusedDate;
|
|
1069
1105
|
}
|
|
1070
|
-
return
|
|
1106
|
+
return interval.start;
|
|
1071
1107
|
}
|
|
1072
1108
|
/**
|
|
1073
|
-
* Constrói o rótulo acessível
|
|
1074
|
-
*
|
|
1075
|
-
* @
|
|
1076
|
-
* @
|
|
1109
|
+
* Constrói o rótulo acessível para os botões de navegação.
|
|
1110
|
+
* @param action - ação de navegação
|
|
1111
|
+
* @returns rótulo para `aria-label`
|
|
1112
|
+
* @internal
|
|
1077
1113
|
*/
|
|
1078
1114
|
getNavigationAriaLabel(action) {
|
|
1079
1115
|
switch (action) {
|
|
@@ -1085,78 +1121,127 @@ const DatePicker = class {
|
|
|
1085
1121
|
return 'Navegar';
|
|
1086
1122
|
}
|
|
1087
1123
|
}
|
|
1088
|
-
/**
|
|
1124
|
+
/**
|
|
1125
|
+
* Retorna os rótulos dos dias da semana conforme `locale` e `weekStartsOn`.
|
|
1126
|
+
* @internal
|
|
1127
|
+
*/
|
|
1089
1128
|
getWeekdayLabels() {
|
|
1090
1129
|
return index.getWeekdayLabels(this.locale, this.weekStartsOn);
|
|
1091
1130
|
}
|
|
1092
|
-
/**
|
|
1131
|
+
/**
|
|
1132
|
+
* Retorna os rótulos dos meses no locale atual.
|
|
1133
|
+
* @internal
|
|
1134
|
+
*/
|
|
1093
1135
|
getMonthLabels() {
|
|
1094
1136
|
return index.getMonthLabels(this.locale);
|
|
1095
1137
|
}
|
|
1096
1138
|
/**
|
|
1097
|
-
*
|
|
1098
|
-
*
|
|
1099
|
-
* @
|
|
1139
|
+
* Move o foco de teclado para a data informada e atualiza `referenceDate` se necessário.
|
|
1140
|
+
* @param date - data alvo do foco
|
|
1141
|
+
* @returns void
|
|
1142
|
+
* @internal
|
|
1143
|
+
*/
|
|
1144
|
+
moveFocusTo(date) {
|
|
1145
|
+
this.focusedDate = date;
|
|
1146
|
+
this.shouldFocusDate = true;
|
|
1147
|
+
if (!isSameMonthExports.isSameMonth(date, this.baseDate)) {
|
|
1148
|
+
this.emitDateStateChange(date, this.value);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
/**
|
|
1152
|
+
* Renderiza um botão de navegação consistente para o calendário.
|
|
1153
|
+
* @param action - ação do botão
|
|
1154
|
+
* @returns elemento JSX do botão de navegação
|
|
1155
|
+
* @internal
|
|
1100
1156
|
*/
|
|
1101
1157
|
renderNavigationButton(action) {
|
|
1102
|
-
return (index$1.h("br-button", { emphasis: "tertiary", density: "small", shape: "circle", disabled: this.disabled, "data-action": action, "aria-label": this.getNavigationAriaLabel(action), onClick: this.handleNavigationClick }, index$1.h("br-icon", { iconName: this.getIconForAction(action), width: "20", height: "20", "aria-hidden": "true" })));
|
|
1158
|
+
return (index$1.h("br-button", { type: "button", emphasis: "tertiary", density: "small", shape: "circle", disabled: this.disabled, "data-action": action, "aria-label": this.getNavigationAriaLabel(action), onClick: this.handleNavigationClick }, index$1.h("br-icon", { iconName: this.getIconForAction(action), width: "20", height: "20", "aria-hidden": "true" })));
|
|
1103
1159
|
}
|
|
1104
|
-
/**
|
|
1160
|
+
/**
|
|
1161
|
+
* Renderiza o cabeçalho do calendário (navegação, mês e ano).
|
|
1162
|
+
* @returns elemento JSX do cabeçalho
|
|
1163
|
+
* @internal
|
|
1164
|
+
*/
|
|
1105
1165
|
renderCalendarHeader() {
|
|
1106
1166
|
return (index$1.h("div", { class: "header", part: "header" }, this.renderNavigationButton(datetimePickerConstants.NAVIGATION_ACTION.PREVIOUS_MONTH), this.renderMonthSelection(), this.renderYearSelection(), this.renderNavigationButton(datetimePickerConstants.NAVIGATION_ACTION.NEXT_MONTH)));
|
|
1107
1167
|
}
|
|
1108
|
-
/**
|
|
1168
|
+
/**
|
|
1169
|
+
* Renderiza o seletor de mês com rótulo acessível.
|
|
1170
|
+
* @returns elemento JSX do seletor de mês
|
|
1171
|
+
* @internal
|
|
1172
|
+
*/
|
|
1109
1173
|
renderMonthSelection() {
|
|
1110
1174
|
return (index$1.h("label", { class: "month-selection" }, index$1.h("span", { class: "visually-hidden" }, "Selecionar m\u00EAs"), index$1.h("select", { onChange: this.handleMonthChange, "aria-label": "Selecionar m\u00EAs", disabled: this.disabled, part: "month-select" }, this.getMonthLabels().map(this.renderMonthOption, this))));
|
|
1111
1175
|
}
|
|
1112
|
-
/**
|
|
1176
|
+
/**
|
|
1177
|
+
* Renderiza o campo de ano com rótulo acessível.
|
|
1178
|
+
* @returns elemento JSX do campo de ano
|
|
1179
|
+
* @internal
|
|
1180
|
+
*/
|
|
1113
1181
|
renderYearSelection() {
|
|
1114
1182
|
return (index$1.h("label", { class: "year-selection" }, index$1.h("span", { class: "visually-hidden" }, "Selecionar ano"), index$1.h("input", { type: "number", value: this.referenceDate.getFullYear(), onChange: this.handleYearChange, "aria-label": "Selecionar ano", disabled: this.disabled, part: "year-input" })));
|
|
1115
1183
|
}
|
|
1116
|
-
/**
|
|
1184
|
+
/**
|
|
1185
|
+
* Renderiza uma opção do seletor de meses.
|
|
1186
|
+
* @param month - label do mês
|
|
1187
|
+
* @param index - índice do mês (0-11)
|
|
1188
|
+
* @returns elemento `<option>` para o mês
|
|
1189
|
+
* @internal
|
|
1190
|
+
*/
|
|
1117
1191
|
renderMonthOption(month, index) {
|
|
1118
1192
|
return (index$1.h("option", { key: `month-${index}`, value: index, selected: index === this.referenceDate.getMonth() }, month));
|
|
1119
1193
|
}
|
|
1120
|
-
/**
|
|
1194
|
+
/**
|
|
1195
|
+
* Renderiza a estrutura principal do calendário (grade e cabeçalho).
|
|
1196
|
+
* @returns elemento JSX com a grade do calendário
|
|
1197
|
+
* @internal
|
|
1198
|
+
*/
|
|
1121
1199
|
renderCalendar() {
|
|
1122
1200
|
const monthLabel = datetimePickerConstants.formatExports.format(this.baseDate, "MMMM 'de' yyyy", { locale: this.dateFnsLocale });
|
|
1123
1201
|
return (index$1.h("div", { class: "calendar", role: "grid", "aria-label": `Calendário de ${monthLabel}`, part: "calendar" }, this.renderWeekdays(), this.renderMonthGrid()));
|
|
1124
1202
|
}
|
|
1125
|
-
/**
|
|
1203
|
+
/**
|
|
1204
|
+
* Renderiza os rótulos dos dias da semana.
|
|
1205
|
+
* @returns elemento JSX com os cabeçalhos das colunas dos dias
|
|
1206
|
+
* @internal
|
|
1207
|
+
*/
|
|
1126
1208
|
renderWeekdays() {
|
|
1127
1209
|
const labels = this.getWeekdayLabels();
|
|
1128
1210
|
return (index$1.h("div", { class: "weekdays", role: "row", tabIndex: -1, part: "weekdays" }, labels.map((label, index) => (index$1.h("div", { key: `weekday-${index}`, class: "weekday", role: "columnheader", tabIndex: -1, "aria-label": label, part: "weekday" }, label)))));
|
|
1129
1211
|
}
|
|
1130
|
-
/**
|
|
1212
|
+
/**
|
|
1213
|
+
* Renderiza a grade de dias do mês atual.
|
|
1214
|
+
* @returns elemento JSX contendo semanas e dias
|
|
1215
|
+
* @internal
|
|
1216
|
+
*/
|
|
1131
1217
|
renderMonthGrid() {
|
|
1132
|
-
const
|
|
1218
|
+
const interval = this.getMonthViewInterval();
|
|
1219
|
+
const dates = isValid.eachDayOfIntervalExports.eachDayOfInterval(interval);
|
|
1220
|
+
const normalizedFocusedDate = this.getNormalizedFocusedDate(interval);
|
|
1221
|
+
const today = new Date();
|
|
1133
1222
|
const weeks = Array.from({ length: Math.ceil(dates.length / 7) }, (_, index) => dates.slice(index * 7, index * 7 + 7));
|
|
1134
|
-
return (index$1.h("div", { class: "monthdays", role: "rowgroup",
|
|
1223
|
+
return (index$1.h("div", { class: "monthdays", role: "rowgroup", part: "grid" }, weeks.map((week) => (index$1.h("div", { key: `week-${datetimePickerConstants.formatExports.format(week[0], 'yyyy-MM-dd')}`, class: "week", role: "row", tabIndex: -1 }, week.map((date) => this.renderDayCell(date, normalizedFocusedDate, today)))))));
|
|
1135
1224
|
}
|
|
1136
1225
|
/**
|
|
1137
|
-
*
|
|
1138
|
-
*
|
|
1139
|
-
* @param
|
|
1226
|
+
* Renderiza uma célula de dia com estado visual apropriado.
|
|
1227
|
+
* @param date - data representada pela célula
|
|
1228
|
+
* @param normalizedFocusedDate - data de foco normalizada para a grade atual
|
|
1229
|
+
* @param today - instante atual compartilhado pela renderização da grade
|
|
1230
|
+
* @returns elemento JSX da célula de dia
|
|
1231
|
+
* @internal
|
|
1140
1232
|
*/
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
this.shouldFocusDate = true;
|
|
1144
|
-
if (!isSameMonthExports.isSameMonth(date, this.baseDate)) {
|
|
1145
|
-
this.emitDateStateChange(date, this.value);
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
/** Renderiza uma célula de dia com estado visual apropriado. */
|
|
1149
|
-
renderDayCell(date) {
|
|
1233
|
+
renderDayCell(date, normalizedFocusedDate, today) {
|
|
1234
|
+
const dateKey = datetimePickerConstants.formatExports.format(date, 'yyyy-MM-dd');
|
|
1150
1235
|
const disabled = this.disabled || this.isDateDisabled(date);
|
|
1151
|
-
const isSelected = this.
|
|
1152
|
-
const isRangeStart = this.
|
|
1153
|
-
const isRangeEnd = this.
|
|
1236
|
+
const isSelected = this.selectionMode === 'single' && this.value !== null && isValid.isSameDayExports.isSameDay(date, this.value);
|
|
1237
|
+
const isRangeStart = this.selectionMode === 'range' && this.rangeStart !== null && isValid.isSameDayExports.isSameDay(date, this.rangeStart);
|
|
1238
|
+
const isRangeEnd = this.selectionMode === 'range' && this.rangeEnd !== null && isValid.isSameDayExports.isSameDay(date, this.rangeEnd);
|
|
1154
1239
|
const isActiveDay = isSelected || isRangeStart || isRangeEnd;
|
|
1155
|
-
const isFocused =
|
|
1156
|
-
return (index$1.h("div", { key:
|
|
1240
|
+
const isFocused = isValid.isSameDayExports.isSameDay(date, normalizedFocusedDate);
|
|
1241
|
+
return (index$1.h("div", { key: dateKey, role: "gridcell", tabIndex: this.disabled ? undefined : isFocused ? 0 : -1, "data-date": dateKey, class: { ...this.getDayCssClasses(date, today), disabled }, onClick: disabled ? undefined : this.handleDayCellClick, onKeyDown: disabled ? undefined : this.handleGridKeydown, "aria-label": this.getDayCellAriaLabel(date), "aria-selected": isActiveDay ? 'true' : 'false', "aria-disabled": disabled ? 'true' : null, part: "day" }, this.getDayWithLeadingZero(date)));
|
|
1157
1242
|
}
|
|
1158
1243
|
render() {
|
|
1159
|
-
return (index$1.h(index$1.Host, { key: '
|
|
1244
|
+
return (index$1.h(index$1.Host, { key: '652b18891338dd9d009e87fb2383dc3c1c78c6ee' }, index$1.h("div", { key: '3c441b0df40d69767ee4c3e8166e9403988def5d', class: "br-date-picker", part: "container" }, this.renderCalendarHeader(), this.renderCalendar())));
|
|
1160
1245
|
}
|
|
1161
1246
|
get el() { return index$1.getElement(this); }
|
|
1162
1247
|
static get watchers() { return {
|
|
@@ -1166,17 +1251,11 @@ const DatePicker = class {
|
|
|
1166
1251
|
"value": [{
|
|
1167
1252
|
"handleValueChange": 0
|
|
1168
1253
|
}],
|
|
1169
|
-
"referenceDate": [{
|
|
1170
|
-
"handleReferenceDateChange": 0
|
|
1171
|
-
}],
|
|
1172
1254
|
"weekStartsOn": [{
|
|
1173
1255
|
"handleWeekStartsOnChange": 0
|
|
1174
1256
|
}],
|
|
1175
1257
|
"locale": [{
|
|
1176
1258
|
"handleLocaleChange": 0
|
|
1177
|
-
}],
|
|
1178
|
-
"disabledDates": [{
|
|
1179
|
-
"handleDisabledDatesChange": 0
|
|
1180
1259
|
}]
|
|
1181
1260
|
}; }
|
|
1182
1261
|
};
|
|
@@ -1262,6 +1341,62 @@ function requireGetMinutes () {
|
|
|
1262
1341
|
|
|
1263
1342
|
var getMinutesExports = /*@__PURE__*/ requireGetMinutes();
|
|
1264
1343
|
|
|
1344
|
+
/**
|
|
1345
|
+
* Configurações de formato e mensagens usadas por `br-datetime-input`.
|
|
1346
|
+
*
|
|
1347
|
+
* Cada chave representa um modo suportado (`date`, `time`, `datetime`) e
|
|
1348
|
+
* mapeia para um `InputFormatConfig` que descreve máscara de entrada,
|
|
1349
|
+
* contagens de dígitos aceitas, formatos de exibição/parse e mensagens de
|
|
1350
|
+
* validação específicas do modo.
|
|
1351
|
+
*
|
|
1352
|
+
* Mantemos a configuração centralizada para evitar lógica dispersa pelo
|
|
1353
|
+
* componente e permitir alterações de formato em um único local.
|
|
1354
|
+
*/
|
|
1355
|
+
const INPUT_FORMAT_CONFIG = {
|
|
1356
|
+
date: {
|
|
1357
|
+
mask: '##/##/####',
|
|
1358
|
+
acceptedDigitCounts: [8],
|
|
1359
|
+
fullDigitCount: 8,
|
|
1360
|
+
displayFormat: 'dd/MM/yyyy',
|
|
1361
|
+
parseFormats: ['dd/MM/yyyy'],
|
|
1362
|
+
messages: {
|
|
1363
|
+
incomplete: 'Complete a data no formato DD/MM/AAAA.',
|
|
1364
|
+
invalid: 'Informe uma data válida.',
|
|
1365
|
+
incompleteRange: 'Complete o intervalo no formato DD/MM/AAAA - DD/MM/AAAA.',
|
|
1366
|
+
invalidRange: 'Informe um intervalo de datas válido.',
|
|
1367
|
+
},
|
|
1368
|
+
rangeFormat: 'DD/MM/AAAA - DD/MM/AAAA',
|
|
1369
|
+
},
|
|
1370
|
+
time: {
|
|
1371
|
+
mask: '##:##',
|
|
1372
|
+
acceptedDigitCounts: [4],
|
|
1373
|
+
fullDigitCount: 4,
|
|
1374
|
+
displayFormat: 'HH:mm',
|
|
1375
|
+
parseFormats: ['HH:mm'],
|
|
1376
|
+
messages: {
|
|
1377
|
+
incomplete: 'Complete o horário no formato HH:MM.',
|
|
1378
|
+
invalid: 'Informe um horário válido.',
|
|
1379
|
+
incompleteRange: 'Complete o intervalo no formato HH:MM - HH:MM.',
|
|
1380
|
+
invalidRange: 'Informe um intervalo de horários válido.',
|
|
1381
|
+
},
|
|
1382
|
+
rangeFormat: 'HH:MM - HH:MM',
|
|
1383
|
+
},
|
|
1384
|
+
datetime: {
|
|
1385
|
+
mask: '##/##/#### ##:##',
|
|
1386
|
+
acceptedDigitCounts: [8, 12],
|
|
1387
|
+
fullDigitCount: 12,
|
|
1388
|
+
displayFormat: 'dd/MM/yyyy HH:mm',
|
|
1389
|
+
parseFormats: ['dd/MM/yyyy HH:mm', 'dd/MM/yyyy'],
|
|
1390
|
+
messages: {
|
|
1391
|
+
incomplete: 'Complete a data e hora no formato DD/MM/AAAA HH:MM.',
|
|
1392
|
+
invalid: 'Informe uma data e hora válidas.',
|
|
1393
|
+
incompleteRange: 'Complete o intervalo no formato DD/MM/AAAA HH:MM - DD/MM/AAAA HH:MM.',
|
|
1394
|
+
invalidRange: 'Informe um intervalo de data e hora válido.',
|
|
1395
|
+
},
|
|
1396
|
+
rangeFormat: 'DD/MM/AAAA HH:MM - DD/MM/AAAA HH:MM',
|
|
1397
|
+
},
|
|
1398
|
+
};
|
|
1399
|
+
|
|
1265
1400
|
var formatISO = {};
|
|
1266
1401
|
|
|
1267
1402
|
var hasRequiredFormatISO;
|
|
@@ -1380,19 +1515,20 @@ function requireFormatISO () {
|
|
|
1380
1515
|
var formatISOExports = /*@__PURE__*/ requireFormatISO();
|
|
1381
1516
|
|
|
1382
1517
|
/**
|
|
1383
|
-
*
|
|
1518
|
+
* Verifica se `value` é um modo suportado pelo `br-datetime-input`.
|
|
1384
1519
|
*
|
|
1385
|
-
* @param value - Valor recebido via prop/atributo.
|
|
1386
|
-
* @returns `true` quando
|
|
1520
|
+
* @param {string} value - Valor recebido via prop/atributo.
|
|
1521
|
+
* @returns {value is DatetimePickerMode} `true` quando pertence ao conjunto suportado.
|
|
1387
1522
|
*/
|
|
1388
1523
|
function isValidDatetimeInputMode(value) {
|
|
1389
1524
|
return Object.values(datetimePickerConstants.DATETIME_PICKER_MODE).includes(value);
|
|
1390
1525
|
}
|
|
1391
1526
|
/**
|
|
1392
|
-
* Normaliza o modo do
|
|
1527
|
+
* Normaliza o modo do componente, aplicando o valor padrão quando inválido.
|
|
1528
|
+
* Emite um aviso via `warnInvalidPropValue` quando o valor é inválido.
|
|
1393
1529
|
*
|
|
1394
|
-
* @param value - Valor bruto
|
|
1395
|
-
* @returns Modo válido
|
|
1530
|
+
* @param {string} value - Valor bruto recebido via prop.
|
|
1531
|
+
* @returns {DatetimePickerMode} - Modo válido (ou `DATETIME_PICKER_MODE.DEFAULT`).
|
|
1396
1532
|
*/
|
|
1397
1533
|
function normalizeDatetimeInputMode(value) {
|
|
1398
1534
|
if (isValidDatetimeInputMode(value))
|
|
@@ -1401,32 +1537,35 @@ function normalizeDatetimeInputMode(value) {
|
|
|
1401
1537
|
return datetimePickerConstants.DATETIME_PICKER_MODE.DEFAULT;
|
|
1402
1538
|
}
|
|
1403
1539
|
/**
|
|
1404
|
-
*
|
|
1540
|
+
* Retorna `true` quando `value` é uma instância válida de `Date`.
|
|
1405
1541
|
*
|
|
1406
|
-
* @param value - Valor
|
|
1407
|
-
* @returns `true`
|
|
1542
|
+
* @param {unknown} value - Valor a ser verificado.
|
|
1543
|
+
* @returns {value is Date} - `true` para instâncias de Date válidas.
|
|
1408
1544
|
*/
|
|
1409
1545
|
function isValidDateInstance(value) {
|
|
1410
1546
|
return value instanceof Date && !Number.isNaN(value.getTime());
|
|
1411
1547
|
}
|
|
1412
1548
|
/**
|
|
1413
|
-
* Normaliza a
|
|
1549
|
+
* Normaliza a `referenceDate` garantindo uma `Date` válida.
|
|
1550
|
+
* Quando `value` for inválido, retorna um fallback (data atual) e emite
|
|
1551
|
+
* um warning com o valor sugerido em ISO.
|
|
1414
1552
|
*
|
|
1415
|
-
* @param value - Valor recebido via prop.
|
|
1416
|
-
* @returns Date
|
|
1553
|
+
* @param {unknown} value - Valor recebido via prop.
|
|
1554
|
+
* @returns {Date} - Data válida para uso interno.
|
|
1417
1555
|
*/
|
|
1418
1556
|
function normalizeDatetimeInputReferenceDate(value) {
|
|
1419
1557
|
if (isValidDateInstance(value))
|
|
1420
1558
|
return value;
|
|
1421
|
-
const fallback =
|
|
1559
|
+
const fallback = isValid.toDateExports.toDate(new Date());
|
|
1422
1560
|
propWarning.warnInvalidPropValue('br-datetime-input', 'referenceDate', value, formatISOExports.formatISO(fallback));
|
|
1423
1561
|
return fallback;
|
|
1424
1562
|
}
|
|
1425
1563
|
/**
|
|
1426
|
-
* Normaliza o
|
|
1564
|
+
* Normaliza o `value` da prop para `Date` válido ou `null`.
|
|
1565
|
+
* Emite warning quando o valor é inválido e retorna `null`.
|
|
1427
1566
|
*
|
|
1428
|
-
* @param value - Valor recebido via prop.
|
|
1429
|
-
* @returns Date
|
|
1567
|
+
* @param {unknown} value - Valor recebido via prop.
|
|
1568
|
+
* @returns {Date | null} - Data válida ou `null`.
|
|
1430
1569
|
*/
|
|
1431
1570
|
function normalizeDatetimeInputValue(value) {
|
|
1432
1571
|
if (value === null)
|
|
@@ -1437,112 +1576,135 @@ function normalizeDatetimeInputValue(value) {
|
|
|
1437
1576
|
return null;
|
|
1438
1577
|
}
|
|
1439
1578
|
|
|
1440
|
-
const datetimeInputCss = () => `*,*::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}code{font-family:monospace;font-size:1em}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}.mx-3{margin-left:var(--spacing-scale-2x) !important;margin-right:var(--spacing-scale-2x) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.ml-auto{margin-left:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}@media (min-width: 576px){.ml-sm-0{margin-left:var(--spacing-scale-default) !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)}code,.code{background:var(--gray-5);border-radius:4px;color:var(--gray-80);display:inline-block;font-family:monospace;font-size:var(--font-size-scale-base);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);padding: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)}pre code,.pre code{display:inline;padding:0}*[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:block;width:100%}br-input[disabled]{opacity:1}`;
|
|
1579
|
+
const datetimeInputCss = () => `*,*::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}.mx-3{margin-left:var(--spacing-scale-2x) !important;margin-right:var(--spacing-scale-2x) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.ml-auto{margin-left:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}@media (min-width: 576px){.ml-sm-0{margin-left:var(--spacing-scale-default) !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)}*[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:block;width:100%}br-input[disabled]{opacity:1}`;
|
|
1441
1580
|
|
|
1442
1581
|
const DatetimeInput = class {
|
|
1443
1582
|
constructor(hostRef) {
|
|
1444
1583
|
index$1.registerInstance(this, hostRef);
|
|
1445
1584
|
this.dateStateChange = index$1.createEvent(this, "dateStateChange", 7);
|
|
1446
1585
|
this.togglePicker = index$1.createEvent(this, "togglePicker", 7);
|
|
1447
|
-
|
|
1448
|
-
this.inputValue = '';
|
|
1586
|
+
this.inputValidationChange = index$1.createEvent(this, "inputValidationChange", 7);
|
|
1449
1587
|
/**
|
|
1450
|
-
*
|
|
1588
|
+
* Texto de placeholder exibido quando o campo estiver vazio.
|
|
1451
1589
|
*
|
|
1452
1590
|
* @default ''
|
|
1453
1591
|
*/
|
|
1454
1592
|
this.placeholder = '';
|
|
1455
1593
|
/**
|
|
1456
|
-
*
|
|
1594
|
+
* Modo de entrada que controla máscara, parser e formato exibido.
|
|
1457
1595
|
*
|
|
1458
1596
|
* @default 'datetime'
|
|
1459
1597
|
*/
|
|
1460
1598
|
this.mode = 'datetime';
|
|
1461
1599
|
/**
|
|
1462
|
-
* Data de referência
|
|
1463
|
-
* Recebe uma instância de `Date` por property binding.
|
|
1600
|
+
* Data de referência usada para navegação e preenchimento de valores parciais.
|
|
1464
1601
|
*
|
|
1465
1602
|
* @default new Date()
|
|
1466
|
-
* @example
|
|
1467
|
-
* ```js
|
|
1468
|
-
* const input = document.querySelector('br-datetime-input');
|
|
1469
|
-
* input.referenceDate = new Date(2026, 8, 1);
|
|
1470
|
-
* ```
|
|
1471
1603
|
*/
|
|
1472
1604
|
this.referenceDate = new Date();
|
|
1473
1605
|
/**
|
|
1474
|
-
*
|
|
1475
|
-
* de `referenceDate`, que controla apenas a referência visual.
|
|
1476
|
-
* Recebe uma instância de `Date` por property binding.
|
|
1606
|
+
* Valor atualmente selecionado pelo componente.
|
|
1477
1607
|
*
|
|
1478
1608
|
* @default null
|
|
1479
|
-
* @example
|
|
1480
|
-
* ```js
|
|
1481
|
-
* const input = document.querySelector('br-datetime-input');
|
|
1482
|
-
* input.value = new Date(2026, 8, 7, 14, 30);
|
|
1483
|
-
* ```
|
|
1484
1609
|
*/
|
|
1485
1610
|
this.value = null;
|
|
1486
1611
|
/**
|
|
1487
|
-
*
|
|
1612
|
+
* Controla os estados de read-only ou bloqueio de formulário.
|
|
1488
1613
|
*
|
|
1489
1614
|
* @default false
|
|
1490
1615
|
*/
|
|
1491
1616
|
this.disabled = false;
|
|
1492
1617
|
/**
|
|
1493
|
-
* Define
|
|
1494
|
-
* Aceita `single` ou `range`; valores inválidos usam `single`.
|
|
1618
|
+
* Define o modo de seleção: `single` (valor único) ou `range` (intervalo).
|
|
1495
1619
|
*
|
|
1496
1620
|
* @default 'single'
|
|
1497
1621
|
*/
|
|
1498
1622
|
this.selectionMode = 'single';
|
|
1499
1623
|
/**
|
|
1500
|
-
*
|
|
1624
|
+
* Início do intervalo em `selectionMode === 'range'`.
|
|
1501
1625
|
*
|
|
1502
1626
|
* @default null
|
|
1503
1627
|
*/
|
|
1504
1628
|
this.rangeStart = null;
|
|
1505
1629
|
/**
|
|
1506
|
-
*
|
|
1630
|
+
* Fim do intervalo em `selectionMode === 'range'`.
|
|
1507
1631
|
*
|
|
1508
1632
|
* @default null
|
|
1509
1633
|
*/
|
|
1510
1634
|
this.rangeEnd = null;
|
|
1635
|
+
/**
|
|
1636
|
+
* Marcador do último texto confirmado (commit) exibido no input.
|
|
1637
|
+
*
|
|
1638
|
+
* @internal
|
|
1639
|
+
* @type {string | null}
|
|
1640
|
+
* @default null
|
|
1641
|
+
*/
|
|
1642
|
+
this.lastCommittedInputText = null;
|
|
1643
|
+
/**
|
|
1644
|
+
* Texto atual do campo usado durante a edição manual.
|
|
1645
|
+
*
|
|
1646
|
+
* @internal Mantido localmente; não faz parte do contrato público do componente.
|
|
1647
|
+
* @type {string}
|
|
1648
|
+
* @default ''
|
|
1649
|
+
*/
|
|
1650
|
+
this.inputValue = '';
|
|
1651
|
+
/**
|
|
1652
|
+
* Handler do clique no botão de ação interno.
|
|
1653
|
+
*
|
|
1654
|
+
* @param event - Ativação pública da ação do br-input.
|
|
1655
|
+
* @returns {void}
|
|
1656
|
+
*/
|
|
1511
1657
|
this.handleActionButtonClick = (event) => {
|
|
1512
1658
|
if (this.disabled)
|
|
1513
1659
|
return;
|
|
1514
1660
|
event.stopPropagation();
|
|
1661
|
+
event.detail.originalEvent.stopPropagation();
|
|
1515
1662
|
this.togglePicker.emit();
|
|
1516
1663
|
};
|
|
1517
1664
|
/**
|
|
1518
|
-
*
|
|
1519
|
-
*
|
|
1665
|
+
* Blur handler: consome o evento e confirma o conteúdo atual.
|
|
1666
|
+
*
|
|
1667
|
+
* @param {FocusEvent} event - Evento de blur do input.
|
|
1668
|
+
* @returns {void}
|
|
1520
1669
|
*/
|
|
1521
1670
|
this.handleInputBlur = (event) => {
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1671
|
+
event.stopPropagation();
|
|
1672
|
+
this.commitCurrentInput();
|
|
1673
|
+
};
|
|
1674
|
+
/**
|
|
1675
|
+
* Handler para commit disparado pelo `change` do `br-input`.
|
|
1676
|
+
*
|
|
1677
|
+
* @param {Event} event - Evento de change.
|
|
1678
|
+
* @returns {void}
|
|
1679
|
+
*/
|
|
1680
|
+
this.handleInputCommit = (event) => {
|
|
1681
|
+
event.stopPropagation();
|
|
1682
|
+
this.commitCurrentInput();
|
|
1529
1683
|
};
|
|
1530
1684
|
/**
|
|
1531
1685
|
* Atualiza o estado local com o valor digitado no campo.
|
|
1532
1686
|
*
|
|
1533
|
-
* @param event - Evento de input
|
|
1687
|
+
* @param {Event} event - Evento de input redistribuído pelo `br-input`.
|
|
1688
|
+
* @returns {void}
|
|
1534
1689
|
*/
|
|
1535
1690
|
this.handleInputChange = (event) => {
|
|
1691
|
+
event.stopPropagation();
|
|
1536
1692
|
if (this.disabled) {
|
|
1537
1693
|
return;
|
|
1538
1694
|
}
|
|
1539
1695
|
const input = event.target;
|
|
1540
|
-
this.
|
|
1696
|
+
this.lastCommittedInputText = null;
|
|
1697
|
+
this.emitInputValidation(null);
|
|
1698
|
+
this.setInternalInputValue(input.value ?? '');
|
|
1541
1699
|
};
|
|
1542
1700
|
/**
|
|
1543
|
-
*
|
|
1701
|
+
* Handler de teclado no campo de entrada.
|
|
1702
|
+
*
|
|
1703
|
+
* Suporta atalhos ARIA (Alt+ArrowDown / F4) para abrir/fechar o picker
|
|
1704
|
+
* e Enter para confirmar a edição.
|
|
1544
1705
|
*
|
|
1545
|
-
* @param event - Evento de teclado
|
|
1706
|
+
* @param {KeyboardEvent} event - Evento de teclado.
|
|
1707
|
+
* @returns {void}
|
|
1546
1708
|
*/
|
|
1547
1709
|
this.handleInputKeydown = (event) => {
|
|
1548
1710
|
if (this.disabled) {
|
|
@@ -1554,37 +1716,23 @@ const DatetimeInput = class {
|
|
|
1554
1716
|
this.togglePicker.emit();
|
|
1555
1717
|
return;
|
|
1556
1718
|
}
|
|
1557
|
-
if (event.key === 'Enter') {
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
* Evita propagação do clique e solicita a abertura/fechamento do picker.
|
|
1563
|
-
*
|
|
1564
|
-
* @param event - Evento de clique no ícone de ação.
|
|
1565
|
-
*/
|
|
1566
|
-
this.handleToggleDropdown = (event) => {
|
|
1567
|
-
if (this.disabled) {
|
|
1568
|
-
return;
|
|
1719
|
+
if (event.key === 'Enter' && event.composedPath().some((target) => target instanceof HTMLInputElement)) {
|
|
1720
|
+
// Previne submissão de formulários e garante deduplicação
|
|
1721
|
+
// usando a mesma rotina que blur/change usam.
|
|
1722
|
+
event.preventDefault();
|
|
1723
|
+
this.commitCurrentInput();
|
|
1569
1724
|
}
|
|
1570
|
-
event.stopPropagation();
|
|
1571
|
-
this.togglePicker.emit();
|
|
1572
1725
|
};
|
|
1573
1726
|
}
|
|
1574
|
-
/**
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
}
|
|
1727
|
+
/**
|
|
1728
|
+
* Watcher: sincroniza `rangeStart`/`rangeEnd` a partir de `rangeValue` controlado.
|
|
1729
|
+
*
|
|
1730
|
+
* @param {DatetimePickerDateRange | undefined} newValue - Novo intervalo ou `undefined`.
|
|
1731
|
+
* @returns {void}
|
|
1732
|
+
*/
|
|
1581
1733
|
handleRangeValueChange(newValue) {
|
|
1582
1734
|
if (!newValue)
|
|
1583
1735
|
return;
|
|
1584
|
-
if (!datetimePickerPropsValidation.isValidDatetimePickerDateRange(newValue)) {
|
|
1585
|
-
propWarning.reportInvalidPropValue(this.el, 'rangeValue', newValue, 'Informe um objeto com `start` e `end` como Date válido ou null.', 'Ignorando o intervalo inválido e mantendo o último intervalo efetivo.');
|
|
1586
|
-
return;
|
|
1587
|
-
}
|
|
1588
1736
|
this.rangeStart = newValue.start;
|
|
1589
1737
|
this.rangeEnd = newValue.end;
|
|
1590
1738
|
this.syncInputValueFromProps();
|
|
@@ -1594,6 +1742,13 @@ const DatetimeInput = class {
|
|
|
1594
1742
|
*
|
|
1595
1743
|
* @param newValue - Novo valor recebido via prop.
|
|
1596
1744
|
*/
|
|
1745
|
+
/**
|
|
1746
|
+
* Watcher: reage a mudanças externas em `value`, normalizando e sincronizando
|
|
1747
|
+
* o texto exibido no input.
|
|
1748
|
+
*
|
|
1749
|
+
* @param {Date | null} newValue - Novo valor recebido via prop.
|
|
1750
|
+
* @returns {void}
|
|
1751
|
+
*/
|
|
1597
1752
|
handleValueChange(newValue) {
|
|
1598
1753
|
this.ensureValidValue(newValue);
|
|
1599
1754
|
this.syncInputValueFromProps();
|
|
@@ -1603,6 +1758,12 @@ const DatetimeInput = class {
|
|
|
1603
1758
|
*
|
|
1604
1759
|
* @param newValue - Novo modo recebido via prop.
|
|
1605
1760
|
*/
|
|
1761
|
+
/**
|
|
1762
|
+
* Watcher: aplica normalização do `mode` e atualiza a máscara/valor exibido.
|
|
1763
|
+
*
|
|
1764
|
+
* @param {string} newValue - Novo modo recebido via prop.
|
|
1765
|
+
* @returns {void}
|
|
1766
|
+
*/
|
|
1606
1767
|
handleModeChange(newValue) {
|
|
1607
1768
|
this.ensureValidMode(newValue);
|
|
1608
1769
|
this.syncInputValueFromProps();
|
|
@@ -1612,6 +1773,12 @@ const DatetimeInput = class {
|
|
|
1612
1773
|
*
|
|
1613
1774
|
* @param newValue - Nova data de referência recebida.
|
|
1614
1775
|
*/
|
|
1776
|
+
/**
|
|
1777
|
+
* Watcher: valida `referenceDate` e resina o input quando não há seleção.
|
|
1778
|
+
*
|
|
1779
|
+
* @param {Date} newValue - Nova data de referência recebida.
|
|
1780
|
+
* @returns {void}
|
|
1781
|
+
*/
|
|
1615
1782
|
handleReferenceDateChange(newValue) {
|
|
1616
1783
|
this.ensureValidReferenceDate(newValue);
|
|
1617
1784
|
if (this.value === null) {
|
|
@@ -1623,8 +1790,13 @@ const DatetimeInput = class {
|
|
|
1623
1790
|
*
|
|
1624
1791
|
* @param newValue - Nova data inicial do range.
|
|
1625
1792
|
*/
|
|
1793
|
+
/**
|
|
1794
|
+
* Watcher: atualiza a representação textual quando o início do range muda.
|
|
1795
|
+
*
|
|
1796
|
+
* @returns {void}
|
|
1797
|
+
*/
|
|
1626
1798
|
handleRangeStartChange() {
|
|
1627
|
-
if (this.
|
|
1799
|
+
if (this.selectionMode === 'range') {
|
|
1628
1800
|
this.syncInputValueFromProps();
|
|
1629
1801
|
}
|
|
1630
1802
|
}
|
|
@@ -1633,8 +1805,13 @@ const DatetimeInput = class {
|
|
|
1633
1805
|
*
|
|
1634
1806
|
* @param newValue - Nova data final do range.
|
|
1635
1807
|
*/
|
|
1808
|
+
/**
|
|
1809
|
+
* Watcher: atualiza a representação textual quando o fim do range muda.
|
|
1810
|
+
*
|
|
1811
|
+
* @returns {void}
|
|
1812
|
+
*/
|
|
1636
1813
|
handleRangeEndChange() {
|
|
1637
|
-
if (this.
|
|
1814
|
+
if (this.selectionMode === 'range') {
|
|
1638
1815
|
this.syncInputValueFromProps();
|
|
1639
1816
|
}
|
|
1640
1817
|
}
|
|
@@ -1642,48 +1819,43 @@ const DatetimeInput = class {
|
|
|
1642
1819
|
* Valida props iniciais e sincroniza o texto exibido no input.
|
|
1643
1820
|
*/
|
|
1644
1821
|
componentWillLoad() {
|
|
1645
|
-
this.referenceDate =
|
|
1822
|
+
this.referenceDate = isValid.resolveSsrLocalDate(this.el, this.referenceDate);
|
|
1646
1823
|
this.ensureValidMode();
|
|
1647
1824
|
this.ensureValidReferenceDate();
|
|
1648
1825
|
this.ensureValidValue();
|
|
1649
1826
|
this.syncInputValueFromProps();
|
|
1650
1827
|
}
|
|
1651
1828
|
/**
|
|
1652
|
-
*
|
|
1829
|
+
* Confirma o conteúdo atual evitando commits duplicados (blur + change).
|
|
1653
1830
|
*
|
|
1654
|
-
*
|
|
1655
|
-
* o browser dispara um click sintético. Adicionamos um listener imperativo para
|
|
1656
|
-
* garantir que o clique no botão de ação acione o toggle. O blur é observado na raiz
|
|
1657
|
-
* interna porque mover o foco do input para essa ação não desfoca o host `br-input`.
|
|
1831
|
+
* @returns {void}
|
|
1658
1832
|
*/
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
const brInput = this.el.shadowRoot?.querySelector('br-input');
|
|
1662
|
-
if (!brInput)
|
|
1663
|
-
return;
|
|
1664
|
-
if (!brInput.shadowRoot)
|
|
1665
|
-
await brInput.componentOnReady();
|
|
1666
|
-
if (!this.el.isConnected || !brInput.shadowRoot)
|
|
1833
|
+
commitCurrentInput() {
|
|
1834
|
+
if (this.disabled)
|
|
1667
1835
|
return;
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
const actionButton = this.inputShadowRoot.querySelector('br-button.button-transform');
|
|
1671
|
-
if (!actionButton)
|
|
1836
|
+
const currentText = this.inputValue.trim();
|
|
1837
|
+
if (this.lastCommittedInputText === currentText)
|
|
1672
1838
|
return;
|
|
1673
|
-
this.
|
|
1674
|
-
|
|
1675
|
-
|
|
1839
|
+
this.lastCommittedInputText = currentText;
|
|
1840
|
+
this.commitInputValue();
|
|
1841
|
+
this.lastCommittedInputText = this.inputValue.trim();
|
|
1676
1842
|
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1843
|
+
/**
|
|
1844
|
+
* Retorna a máscara delegada ao `br-input` de acordo com o modo atual.
|
|
1845
|
+
*
|
|
1846
|
+
* @returns {string | undefined} - Máscara a ser aplicada, ou `undefined` quando indisponível.
|
|
1847
|
+
*/
|
|
1848
|
+
getInputMask() {
|
|
1849
|
+
if (this.selectionMode === 'range') {
|
|
1850
|
+
const boundaryMask = INPUT_FORMAT_CONFIG[this.mode].mask;
|
|
1851
|
+
return `${boundaryMask} - ${boundaryMask}`;
|
|
1852
|
+
}
|
|
1853
|
+
return INPUT_FORMAT_CONFIG[this.mode].mask;
|
|
1682
1854
|
}
|
|
1683
1855
|
/**
|
|
1684
1856
|
* Retorna o rótulo acessível do botão de alternância do picker.
|
|
1685
1857
|
*
|
|
1686
|
-
* @returns Texto anunciado pelo leitor de tela para o ícone de ação.
|
|
1858
|
+
* @returns {string} - Texto anunciado pelo leitor de tela para o ícone de ação.
|
|
1687
1859
|
*/
|
|
1688
1860
|
getToggleAriaLabel() {
|
|
1689
1861
|
switch (this.mode) {
|
|
@@ -1696,9 +1868,10 @@ const DatetimeInput = class {
|
|
|
1696
1868
|
}
|
|
1697
1869
|
}
|
|
1698
1870
|
/**
|
|
1699
|
-
* Normaliza
|
|
1871
|
+
* Normaliza e aplica um modo válido (`date` | `time` | `datetime`).
|
|
1700
1872
|
*
|
|
1701
|
-
* @param value - Modo informado externamente.
|
|
1873
|
+
* @param {string} value - Modo informado externamente.
|
|
1874
|
+
* @returns {void}
|
|
1702
1875
|
*/
|
|
1703
1876
|
ensureValidMode(value = this.mode) {
|
|
1704
1877
|
const normalizedMode = normalizeDatetimeInputMode(value);
|
|
@@ -1707,9 +1880,10 @@ const DatetimeInput = class {
|
|
|
1707
1880
|
}
|
|
1708
1881
|
}
|
|
1709
1882
|
/**
|
|
1710
|
-
* Garante que
|
|
1883
|
+
* Garante que `referenceDate` seja uma `Date` válida; caso contrário, normaliza.
|
|
1711
1884
|
*
|
|
1712
|
-
* @param value - Data de referência recebida via prop.
|
|
1885
|
+
* @param {Date} value - Data de referência recebida via prop.
|
|
1886
|
+
* @returns {void}
|
|
1713
1887
|
*/
|
|
1714
1888
|
ensureValidReferenceDate(value = this.referenceDate) {
|
|
1715
1889
|
const normalizedReferenceDate = normalizeDatetimeInputReferenceDate(value);
|
|
@@ -1720,7 +1894,8 @@ const DatetimeInput = class {
|
|
|
1720
1894
|
/**
|
|
1721
1895
|
* Normaliza o valor selecionado para `Date` válido ou `null`.
|
|
1722
1896
|
*
|
|
1723
|
-
* @param value - Valor recebido via prop.
|
|
1897
|
+
* @param {Date | null} value - Valor recebido via prop.
|
|
1898
|
+
* @returns {void}
|
|
1724
1899
|
*/
|
|
1725
1900
|
ensureValidValue(value = this.value) {
|
|
1726
1901
|
const normalizedValue = normalizeDatetimeInputValue(value);
|
|
@@ -1730,47 +1905,131 @@ const DatetimeInput = class {
|
|
|
1730
1905
|
}
|
|
1731
1906
|
/**
|
|
1732
1907
|
* Consolida o texto digitado, tenta analisar e emite o novo estado selecionado.
|
|
1908
|
+
*
|
|
1909
|
+
* Trata modos `single` e `range` e valida mensagens de erro apropriadas.
|
|
1910
|
+
*
|
|
1911
|
+
* @returns {void}
|
|
1733
1912
|
*/
|
|
1734
1913
|
commitInputValue() {
|
|
1735
1914
|
const inputText = this.inputValue.trim();
|
|
1736
1915
|
if (inputText === '') {
|
|
1916
|
+
this.emitInputValidation(true);
|
|
1737
1917
|
this.value = null;
|
|
1738
1918
|
this.dateStateChange.emit({
|
|
1739
1919
|
referenceDate: this.referenceDate,
|
|
1740
1920
|
value: null,
|
|
1921
|
+
origin: this.el.tagName,
|
|
1741
1922
|
});
|
|
1742
1923
|
this.emitNativeValueChange();
|
|
1743
1924
|
return;
|
|
1744
1925
|
}
|
|
1745
|
-
if (this.
|
|
1926
|
+
if (this.selectionMode === 'range') {
|
|
1746
1927
|
const parsedRange = this.parseRangeInput(inputText);
|
|
1747
|
-
if (parsedRange === null)
|
|
1928
|
+
if (parsedRange === null) {
|
|
1929
|
+
this.emitInputValidation(false, this.getRangeValidationMessage(inputText));
|
|
1748
1930
|
return;
|
|
1931
|
+
}
|
|
1932
|
+
if (this.mode === 'datetime' && compareAscExports.compareAsc(parsedRange.end, parsedRange.start) < 0) {
|
|
1933
|
+
this.emitInputValidation(false, datetimePickerConstants.DATETIME_RANGE_ORDER_MESSAGE);
|
|
1934
|
+
return;
|
|
1935
|
+
}
|
|
1749
1936
|
const normalizedRange = this.normalizeRangeBounds(parsedRange.start, parsedRange.end);
|
|
1937
|
+
this.emitInputValidation(true);
|
|
1750
1938
|
this.rangeValue = normalizedRange;
|
|
1751
|
-
this.
|
|
1939
|
+
this.setInternalInputValue(`${this.formatDateByMode(normalizedRange.start)} - ${this.formatDateByMode(normalizedRange.end)}`);
|
|
1752
1940
|
this.value = normalizedRange.end;
|
|
1753
1941
|
this.dateStateChange.emit({
|
|
1754
1942
|
referenceDate: normalizedRange.end,
|
|
1755
1943
|
value: normalizedRange.end,
|
|
1756
1944
|
range: normalizedRange,
|
|
1945
|
+
origin: this.el.tagName,
|
|
1757
1946
|
});
|
|
1758
1947
|
this.emitNativeValueChange();
|
|
1759
1948
|
return;
|
|
1760
1949
|
}
|
|
1950
|
+
if (!this.isInputComplete(inputText)) {
|
|
1951
|
+
this.emitInputValidation(false, this.getInputValidationMessage(inputText));
|
|
1952
|
+
return;
|
|
1953
|
+
}
|
|
1761
1954
|
const parsed = this.parseInputValue(inputText);
|
|
1762
|
-
if (parsed === null)
|
|
1955
|
+
if (parsed === null) {
|
|
1956
|
+
this.emitInputValidation(false, this.getInputValidationMessage(inputText));
|
|
1763
1957
|
return;
|
|
1958
|
+
}
|
|
1959
|
+
this.emitInputValidation(true);
|
|
1764
1960
|
const newDate = new Date(parsed);
|
|
1765
1961
|
newDate.setSeconds(0, 0);
|
|
1766
|
-
this.
|
|
1962
|
+
this.setInternalInputValue(this.formatDateByMode(newDate));
|
|
1767
1963
|
this.value = newDate;
|
|
1768
1964
|
this.dateStateChange.emit({
|
|
1769
1965
|
referenceDate: newDate,
|
|
1770
1966
|
value: newDate,
|
|
1967
|
+
origin: this.el.tagName,
|
|
1771
1968
|
});
|
|
1772
1969
|
this.emitNativeValueChange();
|
|
1773
1970
|
}
|
|
1971
|
+
/**
|
|
1972
|
+
* Emite o resultado da validação textual sem alterar o valor selecionado.
|
|
1973
|
+
*
|
|
1974
|
+
* @param {boolean} valid - Indica se a entrada é válida.
|
|
1975
|
+
* @param {string} [message] - Mensagem de erro quando inválido.
|
|
1976
|
+
* @returns {void}
|
|
1977
|
+
*/
|
|
1978
|
+
emitInputValidation(valid, message = '') {
|
|
1979
|
+
this.inputValidationChange.emit({ valid, message: valid ? '' : message, origin: this.el.tagName });
|
|
1980
|
+
}
|
|
1981
|
+
/**
|
|
1982
|
+
* Verifica se a entrada possui a quantidade de dígitos esperada para o modo atual.
|
|
1983
|
+
*
|
|
1984
|
+
* @param {string} value - Texto de entrada a ser verificado.
|
|
1985
|
+
* @returns {boolean} - `true` quando completo.
|
|
1986
|
+
*/
|
|
1987
|
+
isInputComplete(value) {
|
|
1988
|
+
const digits = value.replace(/\D/g, '');
|
|
1989
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
1990
|
+
return config.acceptedDigitCounts.includes(digits.length);
|
|
1991
|
+
}
|
|
1992
|
+
/**
|
|
1993
|
+
* Retorna mensagem de validação contextual para uma entrada incompleta ou inválida.
|
|
1994
|
+
*
|
|
1995
|
+
* @param {string} value - Texto de entrada a ser avaliado.
|
|
1996
|
+
* @returns {string} - Mensagem de validação apropriada.
|
|
1997
|
+
*/
|
|
1998
|
+
getInputValidationMessage(value) {
|
|
1999
|
+
const digits = value.replace(/\D/g, '');
|
|
2000
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2001
|
+
if (!config)
|
|
2002
|
+
return 'Informe um valor válido.';
|
|
2003
|
+
const digitCount = digits.length;
|
|
2004
|
+
if (this.mode === 'datetime' &&
|
|
2005
|
+
config.acceptedDigitCounts.includes(digitCount) &&
|
|
2006
|
+
digitCount < config.fullDigitCount) {
|
|
2007
|
+
return config.messages.invalid;
|
|
2008
|
+
}
|
|
2009
|
+
return digitCount < config.fullDigitCount ? config.messages.incomplete : config.messages.invalid;
|
|
2010
|
+
}
|
|
2011
|
+
/**
|
|
2012
|
+
* Mensagem específica para o formato de intervalo do modo atual.
|
|
2013
|
+
*
|
|
2014
|
+
* @param {string} value - Texto de intervalo informado no input.
|
|
2015
|
+
* @returns {string} - Mensagem de validação do intervalo.
|
|
2016
|
+
*/
|
|
2017
|
+
getRangeValidationMessage(value) {
|
|
2018
|
+
const [startRaw = '', endRaw = ''] = value.split(/\s*-\s*/, 2);
|
|
2019
|
+
const startDigits = startRaw.replace(/\D/g, '');
|
|
2020
|
+
const endDigits = endRaw.replace(/\D/g, '');
|
|
2021
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2022
|
+
const expectedDigits = config.fullDigitCount;
|
|
2023
|
+
if (startDigits.length < expectedDigits || endDigits.length < expectedDigits) {
|
|
2024
|
+
return `Complete o intervalo no formato ${config.rangeFormat}.`;
|
|
2025
|
+
}
|
|
2026
|
+
return config.messages.invalidRange;
|
|
2027
|
+
}
|
|
2028
|
+
/**
|
|
2029
|
+
* Dispara eventos nativos `input` e `change` para compatibilidade com forms.
|
|
2030
|
+
*
|
|
2031
|
+
* @returns {void}
|
|
2032
|
+
*/
|
|
1774
2033
|
emitNativeValueChange() {
|
|
1775
2034
|
event.dispatchNativeFormEvent(this.el, 'input');
|
|
1776
2035
|
event.dispatchNativeFormEvent(this.el, 'change');
|
|
@@ -1791,56 +2050,91 @@ const DatetimeInput = class {
|
|
|
1791
2050
|
if (startText === '' || endText === '') {
|
|
1792
2051
|
return null;
|
|
1793
2052
|
}
|
|
1794
|
-
const base = this.referenceDate ??
|
|
1795
|
-
const parsedStart = this.
|
|
1796
|
-
const parsedEnd = this.
|
|
2053
|
+
const base = this.referenceDate ?? isValid.toDateExports.toDate(new Date());
|
|
2054
|
+
const parsedStart = this.parseInputValue(startText, this.rangeStart ?? base);
|
|
2055
|
+
const parsedEnd = this.parseInputValue(endText, this.rangeEnd ?? base);
|
|
1797
2056
|
if (parsedStart === null || parsedEnd === null) {
|
|
1798
2057
|
return null;
|
|
1799
2058
|
}
|
|
1800
2059
|
return { start: parsedStart, end: parsedEnd };
|
|
1801
2060
|
}
|
|
1802
|
-
/**
|
|
2061
|
+
/**
|
|
2062
|
+
* Normaliza os limites do intervalo para garantir ordem cronológica.
|
|
2063
|
+
*
|
|
2064
|
+
* - Em `time` e `datetime` mantém os limites informados.
|
|
2065
|
+
* - Em `date` reordena caso necessário.
|
|
2066
|
+
*
|
|
2067
|
+
* @param {Date} start - Data de início.
|
|
2068
|
+
* @param {Date} end - Data de término.
|
|
2069
|
+
* @returns {{ start: Date; end: Date }} - Limites normalizados.
|
|
2070
|
+
*/
|
|
1803
2071
|
normalizeRangeBounds(start, end) {
|
|
2072
|
+
if (this.mode !== 'date')
|
|
2073
|
+
return { start, end };
|
|
1804
2074
|
return compareAscExports.compareAsc(start, end) <= 0 ? { start, end } : { start: end, end: start };
|
|
1805
2075
|
}
|
|
1806
2076
|
/**
|
|
1807
|
-
* Sincroniza o texto do
|
|
2077
|
+
* Sincroniza o texto do input com as props `value`/`rangeStart`/`rangeEnd` e `mode`.
|
|
2078
|
+
*
|
|
2079
|
+
* @returns {void}
|
|
1808
2080
|
*/
|
|
1809
2081
|
syncInputValueFromProps() {
|
|
1810
|
-
if (this.
|
|
2082
|
+
if (this.selectionMode === 'range') {
|
|
1811
2083
|
if (this.rangeStart === null || this.rangeEnd === null) {
|
|
1812
|
-
this.
|
|
2084
|
+
this.setInternalInputValue('');
|
|
1813
2085
|
return;
|
|
1814
2086
|
}
|
|
1815
2087
|
const startFormatted = this.formatDateByMode(this.rangeStart);
|
|
1816
2088
|
const endFormatted = this.formatDateByMode(this.rangeEnd);
|
|
1817
|
-
this.
|
|
2089
|
+
this.setInternalInputValue(`${startFormatted} - ${endFormatted}`);
|
|
1818
2090
|
return;
|
|
1819
2091
|
}
|
|
1820
2092
|
if (this.value === null) {
|
|
1821
|
-
this.
|
|
2093
|
+
this.setInternalInputValue('');
|
|
1822
2094
|
return;
|
|
1823
2095
|
}
|
|
1824
|
-
this.
|
|
2096
|
+
this.setInternalInputValue(this.formatDateByMode(this.value));
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* Retorna o elemento interno `<br-input>` quando disponível.
|
|
2100
|
+
*
|
|
2101
|
+
* @internal
|
|
2102
|
+
* @returns {HTMLBrInputElement | null} Elemento interno `<br-input>` ou `null` se não estiver disponível.
|
|
2103
|
+
*/
|
|
2104
|
+
getBrInputElement() {
|
|
2105
|
+
return this.el.shadowRoot?.querySelector('br-input');
|
|
2106
|
+
}
|
|
2107
|
+
/**
|
|
2108
|
+
* Define o valor interno do input imperativamente.
|
|
2109
|
+
*
|
|
2110
|
+
* @internal Define o valor interno do input sem re-renderizar o host.
|
|
2111
|
+
* @param {string} value Valor a ser definido no input interno.
|
|
2112
|
+
*/
|
|
2113
|
+
setInternalInputValue(value) {
|
|
2114
|
+
this.inputValue = value;
|
|
2115
|
+
const br = this.getBrInputElement();
|
|
2116
|
+
if (br) {
|
|
2117
|
+
// atualiza imperativamente o componente filho sem re-renderizar o host
|
|
2118
|
+
try {
|
|
2119
|
+
br.value = value;
|
|
2120
|
+
}
|
|
2121
|
+
catch { }
|
|
2122
|
+
}
|
|
1825
2123
|
}
|
|
1826
2124
|
/**
|
|
1827
2125
|
* Formata uma data de acordo com o modo atual do componente.
|
|
1828
2126
|
*
|
|
1829
|
-
* @param date - Data a ser formatada para exibição no input.
|
|
1830
|
-
* @returns Representação textual da data/hora no padrão esperado.
|
|
2127
|
+
* @param {Date} date - Data a ser formatada para exibição no input.
|
|
2128
|
+
* @returns {string} - Representação textual da data/hora no padrão esperado.
|
|
1831
2129
|
*/
|
|
1832
2130
|
formatDateByMode(date) {
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
return datetimePickerConstants.formatExports.format(date, 'dd/MM/yyyy');
|
|
1836
|
-
case 'time':
|
|
1837
|
-
return datetimePickerConstants.formatExports.format(date, 'HH:mm');
|
|
1838
|
-
default:
|
|
1839
|
-
return datetimePickerConstants.formatExports.format(date, 'dd/MM/yyyy HH:mm');
|
|
1840
|
-
}
|
|
2131
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2132
|
+
return datetimePickerConstants.formatExports.format(date, config.displayFormat);
|
|
1841
2133
|
}
|
|
1842
2134
|
/**
|
|
1843
|
-
* Retorna
|
|
2135
|
+
* Retorna o mapa de classes CSS aplicado ao host do componente.
|
|
2136
|
+
*
|
|
2137
|
+
* @returns {CssClassMap}
|
|
1844
2138
|
*/
|
|
1845
2139
|
getCssClassMap() {
|
|
1846
2140
|
return {
|
|
@@ -1850,7 +2144,7 @@ const DatetimeInput = class {
|
|
|
1850
2144
|
/**
|
|
1851
2145
|
* Seleciona o ícone do campo conforme o modo de entrada ativo.
|
|
1852
2146
|
*
|
|
1853
|
-
* @returns Nome do ícone usado na ação lateral do input.
|
|
2147
|
+
* @returns {string} - Nome do ícone usado na ação lateral do input.
|
|
1854
2148
|
*/
|
|
1855
2149
|
getInputIcon() {
|
|
1856
2150
|
switch (this.mode) {
|
|
@@ -1863,11 +2157,11 @@ const DatetimeInput = class {
|
|
|
1863
2157
|
/**
|
|
1864
2158
|
* Converte o texto digitado em `Date` com base no modo configurado.
|
|
1865
2159
|
*
|
|
1866
|
-
* @param value - Texto informado pelo usuário no input.
|
|
1867
|
-
* @
|
|
2160
|
+
* @param {string} value - Texto informado pelo usuário no input.
|
|
2161
|
+
* @param {Date} [base] - Data base usada para completar valores parciais.
|
|
2162
|
+
* @returns {Date | null} - Data convertida ou `null` quando inválida.
|
|
1868
2163
|
*/
|
|
1869
|
-
parseInputValue(value) {
|
|
1870
|
-
const base = this.value ?? this.referenceDate ?? datetimePickerPropsValidation.toDateExports.toDate(new Date());
|
|
2164
|
+
parseInputValue(value, base = this.value ?? this.referenceDate ?? isValid.toDateExports.toDate(new Date())) {
|
|
1871
2165
|
switch (this.mode) {
|
|
1872
2166
|
case 'date':
|
|
1873
2167
|
return this.parseDateInput(value, base);
|
|
@@ -1882,15 +2176,17 @@ const DatetimeInput = class {
|
|
|
1882
2176
|
/**
|
|
1883
2177
|
* Faz parse de uma data no formato `dd/MM/yyyy`, preservando hora e minuto base.
|
|
1884
2178
|
*
|
|
1885
|
-
* @param value - Texto de data digitado pelo usuário.
|
|
1886
|
-
* @param base - Data base usada para completar informações de tempo.
|
|
1887
|
-
* @returns Data válida normalizada ou `null` quando o parse falhar.
|
|
2179
|
+
* @param {string} value - Texto de data digitado pelo usuário.
|
|
2180
|
+
* @param {Date} base - Data base usada para completar informações de tempo.
|
|
2181
|
+
* @returns {Date | null} - Data válida normalizada ou `null` quando o parse falhar.
|
|
1888
2182
|
*/
|
|
1889
2183
|
parseDateInput(value, base) {
|
|
1890
|
-
const
|
|
1891
|
-
|
|
2184
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2185
|
+
const datePattern = config.parseFormats[0];
|
|
2186
|
+
const parsedDate = isValid.parseExports.parse(value, datePattern, base);
|
|
2187
|
+
if (!isValid.isValidExports.isValid(parsedDate))
|
|
1892
2188
|
return null;
|
|
1893
|
-
return
|
|
2189
|
+
return isValid.setExports.set(parsedDate, {
|
|
1894
2190
|
hours: getHoursExports.getHours(base),
|
|
1895
2191
|
minutes: getMinutesExports.getMinutes(base),
|
|
1896
2192
|
seconds: 0,
|
|
@@ -1900,15 +2196,17 @@ const DatetimeInput = class {
|
|
|
1900
2196
|
/**
|
|
1901
2197
|
* Faz parse de hora no formato `HH:mm`, preservando o dia da data base.
|
|
1902
2198
|
*
|
|
1903
|
-
* @param value - Texto de hora digitado pelo usuário.
|
|
1904
|
-
* @param base - Data base usada para manter dia, mês e ano.
|
|
1905
|
-
* @returns Data válida com hora ajustada ou `null` quando inválida.
|
|
2199
|
+
* @param {string} value - Texto de hora digitado pelo usuário.
|
|
2200
|
+
* @param {Date} base - Data base usada para manter dia, mês e ano.
|
|
2201
|
+
* @returns {Date | null} - Data válida com hora ajustada ou `null` quando inválida.
|
|
1906
2202
|
*/
|
|
1907
2203
|
parseTimeInput(value, base) {
|
|
1908
|
-
const
|
|
1909
|
-
|
|
2204
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2205
|
+
const timePattern = config.parseFormats[0];
|
|
2206
|
+
const parsedTime = isValid.parseExports.parse(value, timePattern, base);
|
|
2207
|
+
if (!isValid.isValidExports.isValid(parsedTime))
|
|
1910
2208
|
return null;
|
|
1911
|
-
return
|
|
2209
|
+
return isValid.setExports.set(base, {
|
|
1912
2210
|
hours: getHoursExports.getHours(parsedTime),
|
|
1913
2211
|
minutes: getMinutesExports.getMinutes(parsedTime),
|
|
1914
2212
|
seconds: 0,
|
|
@@ -1916,35 +2214,31 @@ const DatetimeInput = class {
|
|
|
1916
2214
|
});
|
|
1917
2215
|
}
|
|
1918
2216
|
/**
|
|
1919
|
-
* Faz parse de data e hora completas,
|
|
2217
|
+
* Faz parse de data e hora completas, aceitando somente a data como fallback.
|
|
1920
2218
|
*
|
|
1921
|
-
* @param value - Texto digitado no input.
|
|
1922
|
-
* @param base - Data base usada como contexto para completar o parse.
|
|
1923
|
-
* @returns Data válida a partir da entrada ou `null` quando não reconhecida.
|
|
2219
|
+
* @param {string} value - Texto digitado no input.
|
|
2220
|
+
* @param {Date} base - Data base usada como contexto para completar o parse.
|
|
2221
|
+
* @returns {Date | null} - Data válida a partir da entrada ou `null` quando não reconhecida.
|
|
1924
2222
|
*/
|
|
1925
2223
|
parseDateTimeInput(value, base) {
|
|
2224
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2225
|
+
const fullPattern = config.parseFormats[0];
|
|
2226
|
+
const fallbackDatePattern = config.parseFormats[1];
|
|
1926
2227
|
// data + hora
|
|
1927
|
-
const full =
|
|
1928
|
-
if (
|
|
2228
|
+
const full = isValid.parseExports.parse(value, fullPattern, base);
|
|
2229
|
+
if (isValid.isValidExports.isValid(full))
|
|
1929
2230
|
return full;
|
|
1930
|
-
//
|
|
1931
|
-
const date =
|
|
1932
|
-
if (date
|
|
1933
|
-
return
|
|
2231
|
+
// somente data -> preserva a hora da data base
|
|
2232
|
+
const date = isValid.parseExports.parse(value, fallbackDatePattern, base);
|
|
2233
|
+
if (isValid.isValidExports.isValid(date)) {
|
|
2234
|
+
return isValid.setExports.set(date, {
|
|
1934
2235
|
hours: getHoursExports.getHours(base),
|
|
1935
2236
|
minutes: getMinutesExports.getMinutes(base),
|
|
1936
2237
|
seconds: 0,
|
|
1937
2238
|
milliseconds: 0,
|
|
1938
2239
|
});
|
|
1939
2240
|
}
|
|
1940
|
-
|
|
1941
|
-
return this.parseTimeInput(value, base);
|
|
1942
|
-
}
|
|
1943
|
-
/**
|
|
1944
|
-
* Renderiza o campo textual e o ícone de ação do datetime input.
|
|
1945
|
-
*/
|
|
1946
|
-
renderInputField() {
|
|
1947
|
-
return (index$1.h("br-input", { type: "text", value: this.inputValue, placeholder: this.placeholder, disabled: this.disabled, actionLabel: this.getToggleAriaLabel(), onInput: this.handleInputChange, onKeyDown: this.handleInputKeydown, "aria-label": this.getInputAriaLabel(), part: "input" }, index$1.h("br-icon", { slot: "action", iconName: this.getInputIcon(), width: "16", height: "16", "aria-hidden": "true", onClick: this.handleToggleDropdown, part: "icon" })));
|
|
2241
|
+
return null;
|
|
1948
2242
|
}
|
|
1949
2243
|
/**
|
|
1950
2244
|
* Retorna o rótulo acessível do campo de entrada de acordo com o modo ativo.
|
|
@@ -1961,11 +2255,19 @@ const DatetimeInput = class {
|
|
|
1961
2255
|
return 'Campo de data e hora';
|
|
1962
2256
|
}
|
|
1963
2257
|
}
|
|
2258
|
+
/**
|
|
2259
|
+
* Renderiza o campo textual e o ícone de ação do datetime input.
|
|
2260
|
+
*
|
|
2261
|
+
* @returns {JSX.Element}
|
|
2262
|
+
*/
|
|
2263
|
+
renderInputField() {
|
|
2264
|
+
return (index$1.h("br-input", { type: "text", mask: this.getInputMask(), placeholder: this.placeholder, disabled: this.disabled, actionLabel: this.getToggleAriaLabel(), onInput: this.handleInputChange, onChange: this.handleInputCommit, onBlur: this.handleInputBlur, onKeyDown: this.handleInputKeydown, onBrInputActionClick: this.handleActionButtonClick, "aria-label": this.getInputAriaLabel(), part: "input" }, index$1.h("br-icon", { slot: "action", iconName: this.getInputIcon(), width: "16", height: "16", "aria-hidden": "true", part: "icon" })));
|
|
2265
|
+
}
|
|
1964
2266
|
/**
|
|
1965
2267
|
* Renderização principal do componente.
|
|
1966
2268
|
*/
|
|
1967
2269
|
render() {
|
|
1968
|
-
return (index$1.h(index$1.Host, { key: '
|
|
2270
|
+
return (index$1.h(index$1.Host, { key: '40033b7b73bd1760cf07c5b4797a86e918fde54b' }, index$1.h("div", { key: '31e968efbb7a6f43acb8a67fb225d6e0159af7f9', class: this.getCssClassMap(), part: "container" }, this.renderInputField())));
|
|
1969
2271
|
}
|
|
1970
2272
|
static get delegatesFocus() { return true; }
|
|
1971
2273
|
get el() { return index$1.getElement(this); }
|
|
@@ -2223,57 +2525,79 @@ function requireSubMinutes () {
|
|
|
2223
2525
|
var subMinutesExports = /*@__PURE__*/ requireSubMinutes();
|
|
2224
2526
|
|
|
2225
2527
|
/**
|
|
2226
|
-
* Conjunto
|
|
2528
|
+
* Conjunto imutável dos campos suportados pelo `br-time-picker`.
|
|
2227
2529
|
*
|
|
2228
|
-
*
|
|
2530
|
+
* @readonly
|
|
2531
|
+
* @constant {Readonly<Record<string, string>>}
|
|
2229
2532
|
*/
|
|
2230
2533
|
const INPUT_TIME_TYPE = {
|
|
2231
2534
|
HOUR: 'hour',
|
|
2232
2535
|
MINUTE: 'minute',
|
|
2233
2536
|
};
|
|
2234
2537
|
|
|
2235
|
-
const timePickerCss = () => `*,*::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}code{font-family:monospace;font-size:1em}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}.mx-3{margin-left:var(--spacing-scale-2x) !important;margin-right:var(--spacing-scale-2x) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.ml-auto{margin-left:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}@media (min-width: 576px){.ml-sm-0{margin-left:var(--spacing-scale-default) !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)}code,.code{background:var(--gray-5);border-radius:4px;color:var(--gray-80);display:inline-block;font-family:monospace;font-size:var(--font-size-scale-base);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);padding: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)}pre code,.pre code{display:inline;padding:0}*[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:block;width:100%;max-width:144px;height:116px;margin-inline:auto;box-sizing:border-box}.br-time-picker{display:flex;justify-content:center;align-items:center;width:100%;height:100%;box-sizing:border-box}.timer{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:var(--spacing-scale-sm);width:100%;box-sizing:border-box}.time-field{display:flex;flex-direction:column;align-items:center;justify-content:flex-end}.time-field label{font-size:var(--font-size-scale-down-01);color:var(--gray-70);margin-bottom:4px}.time-field input{width:var(--spacing-scale-6x);height:var(--spacing-scale-6x);padding:4px;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);text-align:center;border-color:var(--border-color-alternative);border-radius:var(--surface-rounder-sm);border-style:var(--border-style);border-width:var(--border-width)}.time-field input:hover{background:linear-gradient(rgb(var(--color-rgb), var(--hover)), rgb(var(--color-rgb), var(--hover)))}.time-separator{display:inline-block;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);color:var(--gray-70);align-self:center;line-height:1;padding:0 var(--spacing-scale-base)}`;
|
|
2538
|
+
const timePickerCss = () => `*,*::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}.mx-3{margin-left:var(--spacing-scale-2x) !important;margin-right:var(--spacing-scale-2x) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.ml-auto{margin-left:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}@media (min-width: 576px){.ml-sm-0{margin-left:var(--spacing-scale-default) !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)}*[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:block;width:100%;max-width:144px;height:116px;margin-inline:auto;box-sizing:border-box}.br-time-picker{display:flex;justify-content:center;align-items:center;width:100%;height:100%;box-sizing:border-box}.timer{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:var(--spacing-scale-sm);width:100%;box-sizing:border-box}.time-field{display:flex;flex-direction:column;align-items:center;justify-content:flex-end}.time-field label{font-size:var(--font-size-scale-down-01);color:var(--gray-70);margin-bottom:4px}.time-field input{width:var(--spacing-scale-6x);height:var(--spacing-scale-6x);padding:4px;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);text-align:center;border-color:var(--border-color-alternative);border-radius:var(--surface-rounder-sm);border-style:var(--border-style);border-width:var(--border-width)}.time-field input:hover{background:linear-gradient(rgb(var(--color-rgb), var(--hover)), rgb(var(--color-rgb), var(--hover)))}.time-separator{display:inline-block;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);color:var(--gray-70);align-self:center;line-height:1;padding:0 var(--spacing-scale-base)}`;
|
|
2236
2539
|
|
|
2237
2540
|
const TimePicker = class {
|
|
2238
2541
|
constructor(hostRef) {
|
|
2239
2542
|
index$1.registerInstance(this, hostRef);
|
|
2240
2543
|
this.dateStateChange = index$1.createEvent(this, "dateStateChange", 7);
|
|
2241
|
-
/** Mantém o rascunho digitado por campo para evitar aplicar valor parcial prematuramente. */
|
|
2242
|
-
this.timeDraft = {};
|
|
2243
2544
|
/**
|
|
2244
|
-
* Data
|
|
2245
|
-
* Recebe uma instância de `Date` por property binding; valores inválidos usam a data atual.
|
|
2545
|
+
* Data de referência usada para exibir e ajustar hora e minuto.
|
|
2246
2546
|
*
|
|
2247
|
-
* @
|
|
2248
|
-
* ```js
|
|
2249
|
-
* const timePicker = document.querySelector('br-time-picker');
|
|
2250
|
-
* timePicker.referenceDate = new Date(2026, 8, 7, 9);
|
|
2251
|
-
* ```
|
|
2547
|
+
* @default new Date()
|
|
2252
2548
|
*/
|
|
2253
2549
|
this.referenceDate = new Date();
|
|
2254
2550
|
/**
|
|
2255
|
-
*
|
|
2256
|
-
* Recebe uma instância de `Date` por property binding; datas inválidas usam `null`.
|
|
2551
|
+
* Valor canônico selecionado pelo usuário.
|
|
2257
2552
|
*
|
|
2258
|
-
* @
|
|
2259
|
-
* ```js
|
|
2260
|
-
* const timePicker = document.querySelector('br-time-picker');
|
|
2261
|
-
* timePicker.value = new Date(2026, 8, 7, 14, 30);
|
|
2262
|
-
* ```
|
|
2553
|
+
* @default null
|
|
2263
2554
|
*/
|
|
2264
2555
|
this.value = null;
|
|
2265
|
-
/**
|
|
2556
|
+
/**
|
|
2557
|
+
* Indica se os controles do seletor estão desabilitados.
|
|
2558
|
+
*
|
|
2559
|
+
* @default false
|
|
2560
|
+
*/
|
|
2266
2561
|
this.disabled = false;
|
|
2267
|
-
/**
|
|
2562
|
+
/**
|
|
2563
|
+
* Rascunho dos valores digitados por cada campo (`hour` | `minute`).
|
|
2564
|
+
* Mantém entradas parciais até o commit por blur/Enter.
|
|
2565
|
+
*/
|
|
2566
|
+
this.timeDraft = {};
|
|
2567
|
+
/**
|
|
2568
|
+
* Mapa memorizado de handlers para o evento `input` por tipo de campo.
|
|
2569
|
+
*
|
|
2570
|
+
* Motivo: evita recriar closures a cada render, reduz alocação e mantém
|
|
2571
|
+
* identidade das funções (útil para comparação/remoção quando necessário).
|
|
2572
|
+
*
|
|
2573
|
+
* @private
|
|
2574
|
+
* @type {Map<InputTimeType, (event: Event) => void>}
|
|
2575
|
+
*/
|
|
2268
2576
|
this.timeInputChangeHandlers = new Map();
|
|
2269
|
-
/**
|
|
2577
|
+
/**
|
|
2578
|
+
* Mapa memorizado de handlers de commit (blur/confirm) por tipo de campo.
|
|
2579
|
+
*
|
|
2580
|
+
* Contém funções que finalizam o rascunho e aplicam o valor via
|
|
2581
|
+
* `handleTimeInputCommit(type)`.
|
|
2582
|
+
*
|
|
2583
|
+
* @private
|
|
2584
|
+
* @type {Map<InputTimeType, () => void>}
|
|
2585
|
+
*/
|
|
2270
2586
|
this.timeInputCommitHandlers = new Map();
|
|
2271
|
-
/**
|
|
2587
|
+
/**
|
|
2588
|
+
* Mapa memorizado de handlers de teclado por tipo de campo.
|
|
2589
|
+
*
|
|
2590
|
+
* Suporta comportamento de `Enter` (confirma) e setas para ajuste.
|
|
2591
|
+
* Memorizar evita recriar closures e melhora performance em re-renders.
|
|
2592
|
+
*
|
|
2593
|
+
* @private
|
|
2594
|
+
* @type {Map<InputTimeType, (event: KeyboardEvent) => void>}
|
|
2595
|
+
*/
|
|
2272
2596
|
this.timeInputKeydownHandlers = new Map();
|
|
2273
2597
|
/**
|
|
2274
2598
|
* Executa a navegação associada ao botão clicado.
|
|
2275
2599
|
*
|
|
2276
|
-
* @param event - Clique disparado pelo botão de navegação.
|
|
2600
|
+
* @param {MouseEvent} event - Clique disparado pelo botão de navegação.
|
|
2277
2601
|
*/
|
|
2278
2602
|
this.handleNavigationClick = (event) => {
|
|
2279
2603
|
if (this.disabled) {
|
|
@@ -2303,8 +2627,8 @@ const TimePicker = class {
|
|
|
2303
2627
|
/**
|
|
2304
2628
|
* Atualiza o rascunho do campo removendo qualquer caractere não numérico.
|
|
2305
2629
|
*
|
|
2306
|
-
* @param event - Evento de input do campo de hora ou minuto.
|
|
2307
|
-
* @param type - Campo que está sendo editado.
|
|
2630
|
+
* @param {Event} event - Evento de input do campo de hora ou minuto.
|
|
2631
|
+
* @param {InputTimeType} type - Campo que está sendo editado.
|
|
2308
2632
|
*/
|
|
2309
2633
|
this.handleTimeInputChange = (event, type) => {
|
|
2310
2634
|
if (this.disabled) {
|
|
@@ -2315,41 +2639,38 @@ const TimePicker = class {
|
|
|
2315
2639
|
this.timeDraft = { ...this.timeDraft, [type]: value };
|
|
2316
2640
|
};
|
|
2317
2641
|
}
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2642
|
+
/**
|
|
2643
|
+
* Sincroniza `referenceDate` quando a prop `value` muda.
|
|
2644
|
+
*
|
|
2645
|
+
* Normaliza segundos/milissegundos e restaura rascunhos locais.
|
|
2646
|
+
*
|
|
2647
|
+
* @param {Date | null} newValue - Novo valor vindo da prop `value`.
|
|
2648
|
+
* @returns {void}
|
|
2649
|
+
*/
|
|
2324
2650
|
handleValueChange(newValue) {
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2651
|
+
if (newValue === null || !(newValue instanceof Date) || Number.isNaN(newValue.getTime())) {
|
|
2652
|
+
return;
|
|
2653
|
+
}
|
|
2654
|
+
const normalizedValue = isValid.setExports.set(isValid.toDateExports.toDate(newValue), { seconds: 0, milliseconds: 0 });
|
|
2655
|
+
if (this.referenceDate.getTime() !== normalizedValue.getTime()) {
|
|
2656
|
+
this.referenceDate = normalizedValue;
|
|
2657
|
+
}
|
|
2658
|
+
this.timeDraft = {};
|
|
2329
2659
|
}
|
|
2330
2660
|
componentWillLoad() {
|
|
2331
|
-
this.referenceDate =
|
|
2332
|
-
this.value = this.normalizeDateProp(this.value, 'value', null);
|
|
2333
|
-
this.referenceDate = datetimePickerPropsValidation.resolveSsrLocalDate(this.el, this.referenceDate);
|
|
2334
|
-
}
|
|
2335
|
-
normalizeDateProp(value, propertyName, fallback) {
|
|
2336
|
-
if (value === null && fallback === null)
|
|
2337
|
-
return null;
|
|
2338
|
-
if (value instanceof Date && !Number.isNaN(value.getTime()))
|
|
2339
|
-
return datetimePickerPropsValidation.toDateExports.toDate(value);
|
|
2340
|
-
propWarning.reportInvalidPropValue(this.el, propertyName, value, 'Informe uma instância de Date válida.', `Aplicando fallback ${fallback === null ? 'null' : 'new Date()'}.`);
|
|
2341
|
-
return fallback === null ? null : datetimePickerPropsValidation.toDateExports.toDate(fallback);
|
|
2661
|
+
this.referenceDate = isValid.resolveSsrLocalDate(this.el, this.referenceDate);
|
|
2342
2662
|
}
|
|
2343
2663
|
/**
|
|
2344
2664
|
* Emite o estado consolidado para manter hora, minuto e data sincronizados.
|
|
2345
2665
|
*
|
|
2346
|
-
* @param nextReferenceDate - Nova data de referência após a interação.
|
|
2347
|
-
* @param nextValue - Valor final selecionado; quando omitido, assume a data de referência.
|
|
2666
|
+
* @param {Date} nextReferenceDate - Nova data de referência após a interação.
|
|
2667
|
+
* @param {Date | null} nextValue - Valor final selecionado; quando omitido, assume a data de referência.
|
|
2348
2668
|
*/
|
|
2349
|
-
emitDateStateChange(nextReferenceDate, nextValue =
|
|
2669
|
+
emitDateStateChange(nextReferenceDate, nextValue = isValid.toDateExports.toDate(new Date(nextReferenceDate))) {
|
|
2350
2670
|
// Ao emitir, garantir segundos zerados (componente não controla segundos)
|
|
2351
|
-
const normalizedReference =
|
|
2352
|
-
const normalizedValue = nextValue === null ? null :
|
|
2671
|
+
const normalizedReference = isValid.setExports.set(nextReferenceDate, { seconds: 0, milliseconds: 0 });
|
|
2672
|
+
const normalizedValue = nextValue === null ? null : isValid.setExports.set(nextValue, { seconds: 0, milliseconds: 0 });
|
|
2673
|
+
this.referenceDate = normalizedReference;
|
|
2353
2674
|
this.value = normalizedValue;
|
|
2354
2675
|
this.dateStateChange.emit({
|
|
2355
2676
|
referenceDate: normalizedReference,
|
|
@@ -2361,8 +2682,8 @@ const TimePicker = class {
|
|
|
2361
2682
|
/**
|
|
2362
2683
|
* Resolve o ícone associado à ação de navegação.
|
|
2363
2684
|
*
|
|
2364
|
-
* @param action - Ação representada pelo botão.
|
|
2365
|
-
* @returns O nome do ícone ou uma string vazia quando a ação não é reconhecida.
|
|
2685
|
+
* @param {NavigationAction} action - Ação representada pelo botão.
|
|
2686
|
+
* @returns {string} O nome do ícone ou uma string vazia quando a ação não é reconhecida.
|
|
2366
2687
|
*/
|
|
2367
2688
|
getIconForAction(action) {
|
|
2368
2689
|
switch (action) {
|
|
@@ -2379,7 +2700,7 @@ const TimePicker = class {
|
|
|
2379
2700
|
/**
|
|
2380
2701
|
* Aplica o valor digitado ao estado do componente quando o campo é concluído.
|
|
2381
2702
|
*
|
|
2382
|
-
* @param type - Campo que será aplicado.
|
|
2703
|
+
* @param {InputTimeType} type - Campo que será aplicado.
|
|
2383
2704
|
*/
|
|
2384
2705
|
handleTimeInputCommit(type) {
|
|
2385
2706
|
if (this.disabled) {
|
|
@@ -2391,16 +2712,16 @@ const TimePicker = class {
|
|
|
2391
2712
|
const numeric = Number(draft);
|
|
2392
2713
|
if (Number.isNaN(numeric))
|
|
2393
2714
|
return;
|
|
2394
|
-
let date =
|
|
2715
|
+
let date = isValid.toDateExports.toDate(new Date(this.referenceDate));
|
|
2395
2716
|
if (type === INPUT_TIME_TYPE.HOUR) {
|
|
2396
2717
|
if (numeric < 0 || numeric > 23)
|
|
2397
2718
|
return;
|
|
2398
|
-
date =
|
|
2719
|
+
date = isValid.setExports.set(date, { hours: numeric });
|
|
2399
2720
|
}
|
|
2400
2721
|
if (type === INPUT_TIME_TYPE.MINUTE) {
|
|
2401
2722
|
if (numeric < 0 || numeric > 59)
|
|
2402
2723
|
return;
|
|
2403
|
-
date =
|
|
2724
|
+
date = isValid.setExports.set(date, { minutes: numeric });
|
|
2404
2725
|
}
|
|
2405
2726
|
this.emitDateStateChange(date);
|
|
2406
2727
|
const { [type]: _discarded, ...remainingDraft } = this.timeDraft;
|
|
@@ -2409,8 +2730,8 @@ const TimePicker = class {
|
|
|
2409
2730
|
/**
|
|
2410
2731
|
* Constrói o rótulo acessível das ações de navegação com base no valor atual.
|
|
2411
2732
|
*
|
|
2412
|
-
* @param action - Ação que o botão executa.
|
|
2413
|
-
* @returns Texto acessível do botão.
|
|
2733
|
+
* @param {NavigationAction} action - Ação que o botão executa.
|
|
2734
|
+
* @returns {string} Texto acessível do botão.
|
|
2414
2735
|
*/
|
|
2415
2736
|
getNavigationAriaLabel(action) {
|
|
2416
2737
|
switch (action) {
|
|
@@ -2534,6 +2855,13 @@ const TimePicker = class {
|
|
|
2534
2855
|
}
|
|
2535
2856
|
return handler;
|
|
2536
2857
|
}
|
|
2858
|
+
/**
|
|
2859
|
+
* Ajusta o valor do campo via teclado (ArrowUp/ArrowDown).
|
|
2860
|
+
*
|
|
2861
|
+
* @param event - Evento de teclado que disparou a ação.
|
|
2862
|
+
* @param type - Tipo do campo (`hour` | `minute`) a ser ajustado.
|
|
2863
|
+
* @returns void
|
|
2864
|
+
*/
|
|
2537
2865
|
adjustTimeInputWithKeyboard(event, type) {
|
|
2538
2866
|
if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown')
|
|
2539
2867
|
return;
|
|
@@ -2544,22 +2872,38 @@ const TimePicker = class {
|
|
|
2544
2872
|
}
|
|
2545
2873
|
type === INPUT_TIME_TYPE.HOUR ? this.decreaseHour() : this.decreaseMinute();
|
|
2546
2874
|
}
|
|
2547
|
-
/**
|
|
2875
|
+
/**
|
|
2876
|
+
* Incrementa a hora sem alterar os demais componentes da data.
|
|
2877
|
+
*
|
|
2878
|
+
* @returns void
|
|
2879
|
+
*/
|
|
2548
2880
|
increaseHour() {
|
|
2549
2881
|
const date = addHoursExports.addHours(this.referenceDate, 1);
|
|
2550
2882
|
this.emitDateStateChange(date);
|
|
2551
2883
|
}
|
|
2552
|
-
/**
|
|
2884
|
+
/**
|
|
2885
|
+
* Incrementa o minuto sem alterar os demais componentes da data.
|
|
2886
|
+
*
|
|
2887
|
+
* @returns void
|
|
2888
|
+
*/
|
|
2553
2889
|
increaseMinute() {
|
|
2554
2890
|
const date = addMinutesExports.addMinutes(this.referenceDate, 1);
|
|
2555
2891
|
this.emitDateStateChange(date);
|
|
2556
2892
|
}
|
|
2557
|
-
/**
|
|
2893
|
+
/**
|
|
2894
|
+
* Decrementa a hora sem alterar os demais componentes da data.
|
|
2895
|
+
*
|
|
2896
|
+
* @returns void
|
|
2897
|
+
*/
|
|
2558
2898
|
decreaseHour() {
|
|
2559
2899
|
const date = subHoursExports.subHours(this.referenceDate, 1);
|
|
2560
2900
|
this.emitDateStateChange(date);
|
|
2561
2901
|
}
|
|
2562
|
-
/**
|
|
2902
|
+
/**
|
|
2903
|
+
* Decrementa o minuto sem alterar os demais componentes da data.
|
|
2904
|
+
*
|
|
2905
|
+
* @returns void
|
|
2906
|
+
*/
|
|
2563
2907
|
decreaseMinute() {
|
|
2564
2908
|
const date = subMinutesExports.subMinutes(this.referenceDate, 1);
|
|
2565
2909
|
this.emitDateStateChange(date);
|
|
@@ -2567,32 +2911,40 @@ const TimePicker = class {
|
|
|
2567
2911
|
/**
|
|
2568
2912
|
* Renderiza um botão de navegação consistente para hora ou minuto.
|
|
2569
2913
|
*
|
|
2570
|
-
* @param action - Ação que o botão executará.
|
|
2914
|
+
* @param {NavigationAction} action - Ação que o botão executará.
|
|
2915
|
+
* @returns {JSX.Element}
|
|
2571
2916
|
*/
|
|
2572
2917
|
renderNavigationButton(action) {
|
|
2573
2918
|
return (index$1.h("br-button", { type: "button", emphasis: "tertiary", density: "small", shape: "circle", disabled: this.disabled, "data-action": action, "aria-label": this.getNavigationAriaLabel(action), onClick: this.handleNavigationClick }, index$1.h("br-icon", { iconName: this.getIconForAction(action), width: "20", height: "20", "aria-hidden": "true" })));
|
|
2574
2919
|
}
|
|
2575
|
-
/**
|
|
2920
|
+
/**
|
|
2921
|
+
* Renderiza o bloco completo de hora e minuto.
|
|
2922
|
+
*
|
|
2923
|
+
* @returns {JSX.Element}
|
|
2924
|
+
*/
|
|
2576
2925
|
renderTimePicker() {
|
|
2577
2926
|
return (index$1.h("div", { class: "timer", role: "group", "aria-label": "Seletor de hora e minuto", part: "timer" }, this.renderTimeField(INPUT_TIME_TYPE.HOUR), index$1.h("span", { class: "time-separator", "aria-hidden": "true", part: "separator" }, ":"), this.renderTimeField(INPUT_TIME_TYPE.MINUTE)));
|
|
2578
2927
|
}
|
|
2579
2928
|
/**
|
|
2580
2929
|
* Renderiza um campo de edição com navegação lateral.
|
|
2581
2930
|
*
|
|
2582
|
-
* @param type - Tipo do campo a ser exibido.
|
|
2931
|
+
* @param {InputTimeType} type - Tipo do campo a ser exibido.
|
|
2932
|
+
* @returns {JSX.Element}
|
|
2583
2933
|
*/
|
|
2584
2934
|
renderTimeField(type) {
|
|
2585
2935
|
const { nextAction, prevAction } = this.getTimeFieldConfig(type);
|
|
2586
2936
|
return (index$1.h("div", { class: "time-field", part: "field" }, this.renderNavigationButton(nextAction), index$1.h("input", { type: "text", inputmode: "numeric", maxLength: 2, value: this.timeDraft[type] ?? this.getTimeFieldValue(type), "aria-label": this.getTimeFieldAriaLabel(type), onInput: this.getTimeInputChangeHandler(type), onBlur: this.getTimeInputCommitHandler(type), onKeyDown: this.getTimeInputKeydownHandler(type), disabled: this.disabled, part: "input" }), this.renderNavigationButton(prevAction)));
|
|
2587
2937
|
}
|
|
2938
|
+
/**
|
|
2939
|
+
* Render principal do componente.
|
|
2940
|
+
*
|
|
2941
|
+
* @returns {JSX.Element}
|
|
2942
|
+
*/
|
|
2588
2943
|
render() {
|
|
2589
|
-
return (index$1.h(index$1.Host, { key: '
|
|
2944
|
+
return (index$1.h(index$1.Host, { key: '1957a00098311a26b250bad62c885fc636072b30' }, index$1.h("div", { key: '0dd334340ba7da6cbc53d72183b862770d275856', class: "br-time-picker", part: "container" }, this.renderTimePicker())));
|
|
2590
2945
|
}
|
|
2591
2946
|
get el() { return index$1.getElement(this); }
|
|
2592
2947
|
static get watchers() { return {
|
|
2593
|
-
"referenceDate": [{
|
|
2594
|
-
"handleReferenceDateChange": 0
|
|
2595
|
-
}],
|
|
2596
2948
|
"value": [{
|
|
2597
2949
|
"handleValueChange": 0
|
|
2598
2950
|
}]
|