@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
|
@@ -3,13 +3,32 @@
|
|
|
3
3
|
* © https://serpro.gov.br/ - MIT License.
|
|
4
4
|
*/
|
|
5
5
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, g as getElement } from './index-ConyRdJe.js';
|
|
6
|
-
import { r as requireParse,
|
|
7
|
-
import { d as dispatchNativeFormEvent } from './event-
|
|
6
|
+
import { r as requireParse, i as isValidExports, p as parseExports, t as toDateExports, s as setExports, a as resolveSsrLocalDate, e as eachDayOfIntervalExports, b as isSameDayExports } from './isValid-Bee0Uvqc.js';
|
|
7
|
+
import { d as dispatchNativeFormEvent } from './event-6Da1SZ3J.js';
|
|
8
8
|
import { r as resolveFormValidator, a as runFormValidator, g as getFormValidationState, c as setFormValidity, i as isFormControlDisabled } from './validator-BkWWrDEr.js';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { f as formatBytes$1 } from './format-bytes-B7bNfmgh.js';
|
|
10
|
+
import { g as generateUniqueId$1 } from './id-BeJxz5TQ.js';
|
|
11
11
|
import { a as hasAssignedSlotContent } from './slot-BIG-yees.js';
|
|
12
|
-
import { r as requireIsValid, D as DATETIME_PICKER_MODE, f as formatExports,
|
|
12
|
+
import { r as requireIsValid, a as requireConstructFrom, b as requireToDate, c as requireConstants, D as DATETIME_PICKER_MODE, f as formatExports, d as DATETIME_PICKER_LOCALE, e as DATETIME_RANGE_ORDER_MESSAGE } from './datetime-picker-constants-DDc4sADe.js';
|
|
13
|
+
import { w as warnInvalidPropValue } from './prop-warning-BlGV-x0w.js';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Utilitários Helpers com funções auxiliares para geração de IDs e formatação de bytes.
|
|
17
|
+
* Mantemos um `default` export com a API compatível para não quebrar importações existentes.
|
|
18
|
+
*/
|
|
19
|
+
function generateUniqueId(prefix) {
|
|
20
|
+
return generateUniqueId$1(prefix);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Formata um valor em bytes para uma representação humana (KB, MB, GB...).
|
|
24
|
+
* @param bytes Quantidade em bytes.
|
|
25
|
+
* @param decimals Número de casas decimais (padrão: 2).
|
|
26
|
+
* @returns Valor formatado com unidade.
|
|
27
|
+
*/
|
|
28
|
+
function formatBytes(bytes, decimals = 2) {
|
|
29
|
+
return formatBytes$1(bytes, decimals);
|
|
30
|
+
}
|
|
31
|
+
const Helpers = { generateUniqueId, formatBytes };
|
|
13
32
|
|
|
14
33
|
var isMatch = {};
|
|
15
34
|
|
|
@@ -320,10 +339,323 @@ function requireIsMatch () {
|
|
|
320
339
|
|
|
321
340
|
var isMatchExports = /*@__PURE__*/ requireIsMatch();
|
|
322
341
|
|
|
323
|
-
|
|
342
|
+
var parseISO = {};
|
|
343
|
+
|
|
344
|
+
var hasRequiredParseISO;
|
|
345
|
+
|
|
346
|
+
function requireParseISO () {
|
|
347
|
+
if (hasRequiredParseISO) return parseISO;
|
|
348
|
+
hasRequiredParseISO = 1;
|
|
349
|
+
parseISO.parseISO = parseISO$1;
|
|
350
|
+
var _index = /*@__PURE__*/ requireConstants();
|
|
351
|
+
|
|
352
|
+
var _index2 = /*@__PURE__*/ requireConstructFrom();
|
|
353
|
+
var _index3 = /*@__PURE__*/ requireToDate();
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* The {@link parseISO} function options.
|
|
357
|
+
*/
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* @name parseISO
|
|
361
|
+
* @category Common Helpers
|
|
362
|
+
* @summary Parse ISO string
|
|
363
|
+
*
|
|
364
|
+
* @description
|
|
365
|
+
* Parse the given string in ISO 8601 format and return an instance of Date.
|
|
366
|
+
*
|
|
367
|
+
* Function accepts complete ISO 8601 formats as well as partial implementations.
|
|
368
|
+
* ISO 8601: http://en.wikipedia.org/wiki/ISO_8601
|
|
369
|
+
*
|
|
370
|
+
* If the argument isn't a string, the function cannot parse the string or
|
|
371
|
+
* the values are invalid, it returns Invalid Date.
|
|
372
|
+
*
|
|
373
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
374
|
+
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
|
|
375
|
+
*
|
|
376
|
+
* @param argument - The value to convert
|
|
377
|
+
* @param options - An object with options
|
|
378
|
+
*
|
|
379
|
+
* @returns The parsed date in the local time zone
|
|
380
|
+
*
|
|
381
|
+
* @example
|
|
382
|
+
* // Convert string '2014-02-11T11:30:30' to date:
|
|
383
|
+
* const result = parseISO('2014-02-11T11:30:30')
|
|
384
|
+
* //=> Tue Feb 11 2014 11:30:30
|
|
385
|
+
*
|
|
386
|
+
* @example
|
|
387
|
+
* // Convert string '+02014101' to date,
|
|
388
|
+
* // if the additional number of digits in the extended year format is 1:
|
|
389
|
+
* const result = parseISO('+02014101', { additionalDigits: 1 })
|
|
390
|
+
* //=> Fri Apr 11 2014 00:00:00
|
|
391
|
+
*/
|
|
392
|
+
function parseISO$1(argument, options) {
|
|
393
|
+
const invalidDate = () => (0, _index2.constructFrom)(options?.in, NaN);
|
|
394
|
+
|
|
395
|
+
const additionalDigits = options?.additionalDigits ?? 2;
|
|
396
|
+
const dateStrings = splitDateString(argument);
|
|
397
|
+
|
|
398
|
+
let date;
|
|
399
|
+
if (dateStrings.date) {
|
|
400
|
+
const parseYearResult = parseYear(dateStrings.date, additionalDigits);
|
|
401
|
+
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
if (!date || isNaN(+date)) return invalidDate();
|
|
405
|
+
|
|
406
|
+
const timestamp = +date;
|
|
407
|
+
let time = 0;
|
|
408
|
+
let offset;
|
|
409
|
+
|
|
410
|
+
if (dateStrings.time) {
|
|
411
|
+
time = parseTime(dateStrings.time);
|
|
412
|
+
if (isNaN(time)) return invalidDate();
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
if (dateStrings.timezone) {
|
|
416
|
+
offset = parseTimezone(dateStrings.timezone);
|
|
417
|
+
if (isNaN(offset)) return invalidDate();
|
|
418
|
+
} else {
|
|
419
|
+
const tmpDate = new Date(timestamp + time);
|
|
420
|
+
const result = (0, _index3.toDate)(0, options?.in);
|
|
421
|
+
result.setFullYear(
|
|
422
|
+
tmpDate.getUTCFullYear(),
|
|
423
|
+
tmpDate.getUTCMonth(),
|
|
424
|
+
tmpDate.getUTCDate(),
|
|
425
|
+
);
|
|
426
|
+
result.setHours(
|
|
427
|
+
tmpDate.getUTCHours(),
|
|
428
|
+
tmpDate.getUTCMinutes(),
|
|
429
|
+
tmpDate.getUTCSeconds(),
|
|
430
|
+
tmpDate.getUTCMilliseconds(),
|
|
431
|
+
);
|
|
432
|
+
return result;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
return (0, _index3.toDate)(timestamp + time + offset, options?.in);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
const patterns = {
|
|
439
|
+
dateTimeDelimiter: /[T ]/,
|
|
440
|
+
timeZoneDelimiter: /[Z ]/i,
|
|
441
|
+
timezone: /([Z+-].*)$/,
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
const dateRegex =
|
|
445
|
+
/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
|
|
446
|
+
const timeRegex =
|
|
447
|
+
/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
|
|
448
|
+
const timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
449
|
+
|
|
450
|
+
function splitDateString(dateString) {
|
|
451
|
+
const dateStrings = {};
|
|
452
|
+
const array = dateString.split(patterns.dateTimeDelimiter);
|
|
453
|
+
let timeString;
|
|
454
|
+
|
|
455
|
+
// The regex match should only return at maximum two array elements.
|
|
456
|
+
// [date], [time], or [date, time].
|
|
457
|
+
if (array.length > 2) {
|
|
458
|
+
return dateStrings;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
if (/:/.test(array[0])) {
|
|
462
|
+
timeString = array[0];
|
|
463
|
+
} else {
|
|
464
|
+
dateStrings.date = array[0];
|
|
465
|
+
timeString = array[1];
|
|
466
|
+
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
|
|
467
|
+
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
|
|
468
|
+
timeString = dateString.substr(
|
|
469
|
+
dateStrings.date.length,
|
|
470
|
+
dateString.length,
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (timeString) {
|
|
476
|
+
const token = patterns.timezone.exec(timeString);
|
|
477
|
+
if (token) {
|
|
478
|
+
dateStrings.time = timeString.replace(token[1], "");
|
|
479
|
+
dateStrings.timezone = token[1];
|
|
480
|
+
} else {
|
|
481
|
+
dateStrings.time = timeString;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
return dateStrings;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function parseYear(dateString, additionalDigits) {
|
|
489
|
+
const regex = new RegExp(
|
|
490
|
+
"^(?:(\\d{4}|[+-]\\d{" +
|
|
491
|
+
(4 + additionalDigits) +
|
|
492
|
+
"})|(\\d{2}|[+-]\\d{" +
|
|
493
|
+
(2 + additionalDigits) +
|
|
494
|
+
"})$)",
|
|
495
|
+
);
|
|
496
|
+
|
|
497
|
+
const captures = dateString.match(regex);
|
|
498
|
+
// Invalid ISO-formatted year
|
|
499
|
+
if (!captures) return { year: NaN, restDateString: "" };
|
|
500
|
+
|
|
501
|
+
const year = captures[1] ? parseInt(captures[1]) : null;
|
|
502
|
+
const century = captures[2] ? parseInt(captures[2]) : null;
|
|
503
|
+
|
|
504
|
+
// either year or century is null, not both
|
|
505
|
+
return {
|
|
506
|
+
year: century === null ? year : century * 100,
|
|
507
|
+
restDateString: dateString.slice((captures[1] || captures[2]).length),
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
function parseDate(dateString, year) {
|
|
512
|
+
// Invalid ISO-formatted year
|
|
513
|
+
if (year === null) return new Date(NaN);
|
|
514
|
+
|
|
515
|
+
const captures = dateString.match(dateRegex);
|
|
516
|
+
// Invalid ISO-formatted string
|
|
517
|
+
if (!captures) return new Date(NaN);
|
|
518
|
+
|
|
519
|
+
const isWeekDate = !!captures[4];
|
|
520
|
+
const dayOfYear = parseDateUnit(captures[1]);
|
|
521
|
+
const month = parseDateUnit(captures[2]) - 1;
|
|
522
|
+
const day = parseDateUnit(captures[3]);
|
|
523
|
+
const week = parseDateUnit(captures[4]);
|
|
524
|
+
const dayOfWeek = parseDateUnit(captures[5]) - 1;
|
|
525
|
+
|
|
526
|
+
if (isWeekDate) {
|
|
527
|
+
if (!validateWeekDate(year, week, dayOfWeek)) {
|
|
528
|
+
return new Date(NaN);
|
|
529
|
+
}
|
|
530
|
+
return dayOfISOWeekYear(year, week, dayOfWeek);
|
|
531
|
+
} else {
|
|
532
|
+
const date = new Date(0);
|
|
533
|
+
if (
|
|
534
|
+
!validateDate(year, month, day) ||
|
|
535
|
+
!validateDayOfYearDate(year, dayOfYear)
|
|
536
|
+
) {
|
|
537
|
+
return new Date(NaN);
|
|
538
|
+
}
|
|
539
|
+
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
|
|
540
|
+
return date;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
function parseDateUnit(value) {
|
|
545
|
+
return value ? parseInt(value) : 1;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
function parseTime(timeString) {
|
|
549
|
+
const captures = timeString.match(timeRegex);
|
|
550
|
+
if (!captures) return NaN; // Invalid ISO-formatted time
|
|
551
|
+
|
|
552
|
+
const hours = parseTimeUnit(captures[1]);
|
|
553
|
+
const minutes = parseTimeUnit(captures[2]);
|
|
554
|
+
const seconds = parseTimeUnit(captures[3]);
|
|
555
|
+
|
|
556
|
+
if (!validateTime(hours, minutes, seconds)) {
|
|
557
|
+
return NaN;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
return (
|
|
561
|
+
hours * _index.millisecondsInHour +
|
|
562
|
+
minutes * _index.millisecondsInMinute +
|
|
563
|
+
seconds * 1000
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
function parseTimeUnit(value) {
|
|
568
|
+
return (value && parseFloat(value.replace(",", "."))) || 0;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
function parseTimezone(timezoneString) {
|
|
572
|
+
if (timezoneString === "Z") return 0;
|
|
573
|
+
|
|
574
|
+
const captures = timezoneString.match(timezoneRegex);
|
|
575
|
+
if (!captures) return 0;
|
|
576
|
+
|
|
577
|
+
const sign = captures[1] === "+" ? -1 : 1;
|
|
578
|
+
const hours = parseInt(captures[2]);
|
|
579
|
+
const minutes = (captures[3] && parseInt(captures[3])) || 0;
|
|
580
|
+
|
|
581
|
+
if (!validateTimezone(hours, minutes)) {
|
|
582
|
+
return NaN;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
return (
|
|
586
|
+
sign *
|
|
587
|
+
(hours * _index.millisecondsInHour + minutes * _index.millisecondsInMinute)
|
|
588
|
+
);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
function dayOfISOWeekYear(isoWeekYear, week, day) {
|
|
592
|
+
const date = new Date(0);
|
|
593
|
+
date.setUTCFullYear(isoWeekYear, 0, 4);
|
|
594
|
+
const fourthOfJanuaryDay = date.getUTCDay() || 7;
|
|
595
|
+
const diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
|
|
596
|
+
date.setUTCDate(date.getUTCDate() + diff);
|
|
597
|
+
return date;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
// Validation functions
|
|
601
|
+
|
|
602
|
+
// February is null to handle the leap year (using ||)
|
|
603
|
+
const daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
604
|
+
|
|
605
|
+
function isLeapYearIndex(year) {
|
|
606
|
+
return year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
function validateDate(year, month, date) {
|
|
610
|
+
return (
|
|
611
|
+
month >= 0 &&
|
|
612
|
+
month <= 11 &&
|
|
613
|
+
date >= 1 &&
|
|
614
|
+
date <= (daysInMonths[month] || (isLeapYearIndex(year) ? 29 : 28))
|
|
615
|
+
);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
function validateDayOfYearDate(year, dayOfYear) {
|
|
619
|
+
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex(year) ? 366 : 365);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
function validateWeekDate(_year, week, day) {
|
|
623
|
+
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
function validateTime(hours, minutes, seconds) {
|
|
627
|
+
if (hours === 24) {
|
|
628
|
+
return minutes === 0 && seconds === 0;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
return (
|
|
632
|
+
seconds >= 0 &&
|
|
633
|
+
seconds < 60 &&
|
|
634
|
+
minutes >= 0 &&
|
|
635
|
+
minutes < 60 &&
|
|
636
|
+
hours >= 0 &&
|
|
637
|
+
hours < 25
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
function validateTimezone(_hours, minutes) {
|
|
642
|
+
return minutes >= 0 && minutes <= 59;
|
|
643
|
+
}
|
|
644
|
+
return parseISO;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
var parseISOExports = /*@__PURE__*/ requireParseISO();
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Serializa o valor atual para envio em FormData conforme o modo ativo.
|
|
651
|
+
*
|
|
652
|
+
* @param {Date | null} value - Valor selecionado a ser serializado para submissão.
|
|
653
|
+
* @param {DatetimePickerFormContext} context - Contexto com `mode`, `selectionMode` e limites (rangeStart/rangeEnd).
|
|
654
|
+
* @returns {string | null} Representação serializada pronta para `FormData`, ou `null` quando não houver valor.
|
|
655
|
+
*/
|
|
324
656
|
function serializeDatetimePickerFormValue(value, context) {
|
|
325
657
|
if (isDateRangeMode(context)) {
|
|
326
|
-
return serializeRangeFormValue(context.rangeStart, context.rangeEnd);
|
|
658
|
+
return serializeRangeFormValue(context.rangeStart, context.rangeEnd, context.mode);
|
|
327
659
|
}
|
|
328
660
|
if (value === null) {
|
|
329
661
|
return null;
|
|
@@ -339,7 +671,14 @@ function serializeDatetimePickerFormValue(value, context) {
|
|
|
339
671
|
return formatExports.format(value, "yyyy-MM-dd'T'HH:mm:ssXXX");
|
|
340
672
|
}
|
|
341
673
|
}
|
|
342
|
-
/**
|
|
674
|
+
/**
|
|
675
|
+
* Analisa um valor serializado de formulário para `Date` respeitando o modo atual.
|
|
676
|
+
*
|
|
677
|
+
* @param {string} value - String serializada vinda do formulário.
|
|
678
|
+
* @param {DatetimePickerMode} mode - Modo (`date` | `time` | `datetime`) que dita o parser a ser usado.
|
|
679
|
+
* @param {Date} referenceDate - Data de referência usada ao analisar valores de hora.
|
|
680
|
+
* @returns {Date | null} Objeto Date quando a análise for bem-sucedida, ou `null` quando inválido.
|
|
681
|
+
*/
|
|
343
682
|
function parseDatetimePickerSerializedValue(value, mode, referenceDate) {
|
|
344
683
|
if (isBlankValue(value)) {
|
|
345
684
|
return null;
|
|
@@ -353,20 +692,34 @@ function parseDatetimePickerSerializedValue(value, mode, referenceDate) {
|
|
|
353
692
|
return parseIsoDate(value);
|
|
354
693
|
}
|
|
355
694
|
}
|
|
356
|
-
/**
|
|
357
|
-
|
|
695
|
+
/**
|
|
696
|
+
* Analisa um intervalo serializado no formato `start/end` conforme o modo ativo.
|
|
697
|
+
*
|
|
698
|
+
* @param {string} value - String no formato `start/end` contendo os dois lados do intervalo.
|
|
699
|
+
* @param {DatetimePickerMode} mode - Modo a ser usado para análise (padrão: `date`).
|
|
700
|
+
* @param {Date} referenceDate - Data de referência para análise de horários.
|
|
701
|
+
* @returns {DatetimePickerDateRange | null} `{ start, end }` quando válido, ou `null` quando inválido.
|
|
702
|
+
*/
|
|
703
|
+
function parseDatetimePickerSerializedRange(value, mode = DATETIME_PICKER_MODE.DATE, referenceDate = new Date()) {
|
|
358
704
|
const [startRaw, endRaw] = value.split('/');
|
|
359
705
|
if (startRaw === undefined || endRaw === undefined) {
|
|
360
706
|
return null;
|
|
361
707
|
}
|
|
362
|
-
const start =
|
|
363
|
-
const end =
|
|
708
|
+
const start = parseDatetimePickerSerializedValue(startRaw, mode, referenceDate);
|
|
709
|
+
const end = parseDatetimePickerSerializedValue(endRaw, mode, referenceDate);
|
|
364
710
|
if (start === null || end === null) {
|
|
365
711
|
return null;
|
|
366
712
|
}
|
|
367
713
|
return { start, end };
|
|
368
714
|
}
|
|
369
|
-
/**
|
|
715
|
+
/**
|
|
716
|
+
* Indica se o componente deve sinalizar `valueMissing` na validação nativa.
|
|
717
|
+
*
|
|
718
|
+
* A função considera `required`, `disabled` e se o valor (ou intervalo) está incompleto.
|
|
719
|
+
*
|
|
720
|
+
* @param {DatetimePickerMissingValueContext} context - Contexto contendo `required`, `disabled`, `value` e, quando aplicável, `rangeStart`/`rangeEnd`.
|
|
721
|
+
* @returns {boolean} `true` quando o controle deve reportar `valueMissing`.
|
|
722
|
+
*/
|
|
370
723
|
function hasDatetimePickerMissingValue(context) {
|
|
371
724
|
const { required, disabled, value } = context;
|
|
372
725
|
if (!required || disabled) {
|
|
@@ -375,18 +728,52 @@ function hasDatetimePickerMissingValue(context) {
|
|
|
375
728
|
const isRangeIncomplete = isDateRangeMode(context) && (context.rangeStart === null || context.rangeEnd === null);
|
|
376
729
|
return value === null || isRangeIncomplete;
|
|
377
730
|
}
|
|
731
|
+
/**
|
|
732
|
+
* Retorna `true` quando a `value` dada é vazia ou composta apenas por espaços.
|
|
733
|
+
*
|
|
734
|
+
* @param {string} value - String a ser verificada.
|
|
735
|
+
* @returns {boolean} `true` quando a string é em branco.
|
|
736
|
+
*/
|
|
378
737
|
function isBlankValue(value) {
|
|
379
738
|
return value.trim() === '';
|
|
380
739
|
}
|
|
740
|
+
/**
|
|
741
|
+
* Verifica se o contexto está no modo de intervalo (`selectionMode === 'range'`).
|
|
742
|
+
*
|
|
743
|
+
* @param {DatetimePickerFormContext} context - Contexto do formulário do componente.
|
|
744
|
+
* @returns {boolean} `true` quando `selectionMode` é `range`.
|
|
745
|
+
*/
|
|
381
746
|
function isDateRangeMode(context) {
|
|
382
|
-
return context.selectionMode === 'range'
|
|
747
|
+
return context.selectionMode === 'range';
|
|
383
748
|
}
|
|
384
|
-
|
|
749
|
+
/**
|
|
750
|
+
* Serializa um par `rangeStart`/`rangeEnd` conforme o modo para submissão.
|
|
751
|
+
*
|
|
752
|
+
* @param {Date | null} rangeStart - Data inicial do intervalo (ou `null`).
|
|
753
|
+
* @param {Date | null} rangeEnd - Data final do intervalo (ou `null`).
|
|
754
|
+
* @param {DatetimePickerMode | undefined} mode - Modo que define o formato usado na conversão (date/time/datetime).
|
|
755
|
+
* @returns {string | null} String `start/end` quando ambos existem, caso contrário `null`.
|
|
756
|
+
*/
|
|
757
|
+
function serializeRangeFormValue(rangeStart, rangeEnd, mode) {
|
|
385
758
|
if (rangeStart === null || rangeEnd === null) {
|
|
386
759
|
return null;
|
|
387
760
|
}
|
|
388
|
-
|
|
761
|
+
const serialize = (date) => {
|
|
762
|
+
if (mode === DATETIME_PICKER_MODE.TIME)
|
|
763
|
+
return formatExports.format(date, 'HH:mm');
|
|
764
|
+
if (mode === DATETIME_PICKER_MODE.DATETIME)
|
|
765
|
+
return formatExports.format(date, "yyyy-MM-dd'T'HH:mm:ssXXX");
|
|
766
|
+
return serializeDate(date);
|
|
767
|
+
};
|
|
768
|
+
return `${serialize(rangeStart)}/${serialize(rangeEnd)}`;
|
|
389
769
|
}
|
|
770
|
+
/**
|
|
771
|
+
* Converte uma string de tempo `HH:mm` em um objeto `Date` combinando-a com a `referenceDate`.
|
|
772
|
+
*
|
|
773
|
+
* @param {string} value - String no formato `HH:mm`.
|
|
774
|
+
* @param {Date} referenceDate - Data base que receberá as horas e minutos analisados.
|
|
775
|
+
* @returns {Date | null} Data ajustada com horas/minutos, ou `null` se inválida.
|
|
776
|
+
*/
|
|
390
777
|
function parseTimeValue(value, referenceDate) {
|
|
391
778
|
if (!isMatchExports.isMatch(value, 'HH:mm')) {
|
|
392
779
|
return null;
|
|
@@ -399,10 +786,24 @@ function parseTimeValue(value, referenceDate) {
|
|
|
399
786
|
baseDate.setHours(parsedTime.getHours(), parsedTime.getMinutes(), 0, 0);
|
|
400
787
|
return baseDate;
|
|
401
788
|
}
|
|
789
|
+
/**
|
|
790
|
+
* Analisa uma string ISO em `Date` quando válida.
|
|
791
|
+
*
|
|
792
|
+
* @param {string} value - String ISO (ex: `2023-01-01T12:00:00-03:00`).
|
|
793
|
+
* @returns {Date | null} Objeto Date quando válido, ou `null` quando inválido.
|
|
794
|
+
*/
|
|
402
795
|
function parseIsoDate(value) {
|
|
403
796
|
const parsedDate = parseISOExports.parseISO(value);
|
|
404
797
|
return isValidExports.isValid(parsedDate) ? parsedDate : null;
|
|
405
798
|
}
|
|
799
|
+
/**
|
|
800
|
+
* Analisa uma string no formato `yyyy-MM-dd` em `Date`.
|
|
801
|
+
*
|
|
802
|
+
* Realiza validação estrita para evitar rollover de dias e zera horas.
|
|
803
|
+
*
|
|
804
|
+
* @param {string} value - String no formato `yyyy-MM-dd`.
|
|
805
|
+
* @returns {Date | null} Data normalizada (meia-noite) ou `null` quando inválida.
|
|
806
|
+
*/
|
|
406
807
|
function parseDate(value) {
|
|
407
808
|
if (!isMatchExports.isMatch(value, 'yyyy-MM-dd')) {
|
|
408
809
|
return null;
|
|
@@ -418,16 +819,209 @@ function parseDate(value) {
|
|
|
418
819
|
parsedDate.setHours(0, 0, 0, 0);
|
|
419
820
|
return parsedDate;
|
|
420
821
|
}
|
|
822
|
+
/**
|
|
823
|
+
* Serializa uma `Date` para o formato `yyyy-MM-dd`.
|
|
824
|
+
*
|
|
825
|
+
* @param {Date} value - Data a ser serializada.
|
|
826
|
+
* @returns {string} Representação no formato `yyyy-MM-dd`.
|
|
827
|
+
*/
|
|
421
828
|
function serializeDate(value) {
|
|
422
829
|
return formatExports.format(value, 'yyyy-MM-dd');
|
|
423
830
|
}
|
|
424
831
|
|
|
425
|
-
const datetimePickerCss = () => `*,*::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{box-sizing:border-box;display:block;margin-bottom:var(--spacing-scale-base);max-width:var(--br-datetime-picker-width, none);position:relative;width:100%}:host([mode=time]){max-width:var(--br-datetime-picker-time-width, var(--br-datetime-picker-width, none));width:100%}:host([mode=date]){max-width:var(--br-datetime-picker-date-width, var(--br-datetime-picker-width, none));width:100%}:host([mode=datetime]){max-width:var(--br-datetime-picker-datetime-width, var(--br-datetime-picker-width, none));width:100%}.br-datetime-picker{width:100%}.br-datetime-picker br-datetime-input,.br-datetime-picker br-card{display:block;width:100%}.br-datetime-picker br-card{font-size:var(--font-size-scale-base);animation:none}@media (prefers-reduced-motion: no-preference){.br-datetime-picker br-card{animation:datetime-panel-open var(--duration-fast, 300ms) var(--animation-ease-out, ease-out) both}}@keyframes datetime-panel-open{from{opacity:0}to{opacity:1}}`;
|
|
832
|
+
const VALID_WEEK_START_DAYS = [0, 1, 2, 3, 4, 5, 6];
|
|
833
|
+
const INITIAL_MOMENT_DATE_FORMATS = ['dd/MM/yyyy HH:mm', 'dd/MM/yyyy', 'yyyy-MM-dd HH:mm', 'yyyy-MM-dd'];
|
|
834
|
+
/**
|
|
835
|
+
* Tenta analisar uma string que representa um momento inicial aceitável pelo componente.
|
|
836
|
+
*
|
|
837
|
+
* Suporta formatos ISO e padrões definidos em `INITIAL_MOMENT_DATE_FORMATS`.
|
|
838
|
+
* Retorna `null` quando a string não representa uma data válida.
|
|
839
|
+
*
|
|
840
|
+
* @param {string} value - String contendo a data/hora a ser analisada.
|
|
841
|
+
* @returns {Date | null} Date normalizada quando a string é válida, ou `null` caso contrário.
|
|
842
|
+
*/
|
|
843
|
+
function parseInitialMomentString(value) {
|
|
844
|
+
const trimmedValue = value.trim();
|
|
845
|
+
if (trimmedValue === '') {
|
|
846
|
+
return null;
|
|
847
|
+
}
|
|
848
|
+
const isoDate = parseISOExports.parseISO(trimmedValue);
|
|
849
|
+
if (isValidExports.isValid(isoDate)) {
|
|
850
|
+
return isoDate;
|
|
851
|
+
}
|
|
852
|
+
for (const formatPattern of INITIAL_MOMENT_DATE_FORMATS) {
|
|
853
|
+
const parsedDate = parseExports.parse(trimmedValue, formatPattern, new Date());
|
|
854
|
+
if (isValidExports.isValid(parsedDate)) {
|
|
855
|
+
return parsedDate;
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
return null;
|
|
859
|
+
}
|
|
860
|
+
/**
|
|
861
|
+
* Normaliza um candidato a data em um objeto `Date` válido.
|
|
862
|
+
*
|
|
863
|
+
* Aceita instâncias de `Date` e strings (repassadas a `parseInitialMomentString`).
|
|
864
|
+
* Retorna `null` quando o candidato não representa uma data válida.
|
|
865
|
+
*
|
|
866
|
+
* @param {unknown} value - Valor recebido via prop (pode ser `Date`, `string` ou outro).
|
|
867
|
+
* @returns {Date | null} `Date` quando válido ou `null` quando inválido.
|
|
868
|
+
*/
|
|
869
|
+
function normalizeDateCandidate(value) {
|
|
870
|
+
if (value instanceof Date) {
|
|
871
|
+
if (!Number.isNaN(value.getTime())) {
|
|
872
|
+
return new Date(value);
|
|
873
|
+
}
|
|
874
|
+
return null;
|
|
875
|
+
}
|
|
876
|
+
if (typeof value === 'string') {
|
|
877
|
+
return parseInitialMomentString(value);
|
|
878
|
+
}
|
|
879
|
+
return null;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Divide uma string de datas desabilitadas em tokens individuais.
|
|
883
|
+
*
|
|
884
|
+
* A string pode conter várias datas separadas por espaços; tokens vazios são
|
|
885
|
+
* descartados.
|
|
886
|
+
*
|
|
887
|
+
* @param {string} value - String contendo uma ou mais datas separadas por espaço.
|
|
888
|
+
* @returns {string[]} Array de tokens não vazios representando cada data individual.
|
|
889
|
+
*/
|
|
890
|
+
function tokenizeDisabledDatesString(value) {
|
|
891
|
+
return value
|
|
892
|
+
.trim()
|
|
893
|
+
.split(/\s+/)
|
|
894
|
+
.filter((token) => token.length > 0);
|
|
895
|
+
}
|
|
896
|
+
/**
|
|
897
|
+
* Verifica se o valor informado corresponde a um modo suportado pelo componente.
|
|
898
|
+
*
|
|
899
|
+
* @param {string} value - Valor recebido via prop ou atributo.
|
|
900
|
+
* @returns {boolean} `true` quando o valor pertence ao conjunto aceito de modos.
|
|
901
|
+
*/
|
|
902
|
+
function isValidDatetimePickerMode(value) {
|
|
903
|
+
return Object.values(DATETIME_PICKER_MODE).includes(value);
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* Normaliza o modo informado e aplica o valor padrão quando necessário.
|
|
907
|
+
*
|
|
908
|
+
* @param {string} value - Valor bruto recebido do consumidor do componente.
|
|
909
|
+
* @returns {DatetimePickerMode} O modo válido correspondente, ou o valor padrão quando o input for inválido.
|
|
910
|
+
*/
|
|
911
|
+
function normalizeDatetimePickerMode(value) {
|
|
912
|
+
if (isValidDatetimePickerMode(value))
|
|
913
|
+
return value;
|
|
914
|
+
warnInvalidPropValue('br-datetime-picker', 'mode', value, DATETIME_PICKER_MODE.DEFAULT);
|
|
915
|
+
return DATETIME_PICKER_MODE.DEFAULT;
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* Verifica se o valor representa um modo de seleção suportado.
|
|
919
|
+
*
|
|
920
|
+
* @param {string} value - Valor bruto recebido via prop.
|
|
921
|
+
* @returns {boolean} `true` quando o valor é `'single'` ou `'range'`.
|
|
922
|
+
*/
|
|
923
|
+
function isValidDatetimePickerSelectionMode(value) {
|
|
924
|
+
return value === 'single' || value === 'range';
|
|
925
|
+
}
|
|
926
|
+
/**
|
|
927
|
+
* Normaliza o modo de seleção informado e aplica o valor padrão quando necessário.
|
|
928
|
+
*
|
|
929
|
+
* @param {string} value - Valor bruto recebido do consumidor do componente.
|
|
930
|
+
* @returns {DatetimePickerSelectionMode} O modo de seleção válido correspondente, ou `'single'` quando o input for inválido.
|
|
931
|
+
*/
|
|
932
|
+
function normalizeDatetimePickerSelectionMode(value) {
|
|
933
|
+
if (isValidDatetimePickerSelectionMode(value))
|
|
934
|
+
return value;
|
|
935
|
+
warnInvalidPropValue('br-datetime-picker', 'selectionMode', value, 'single');
|
|
936
|
+
return 'single';
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Normaliza a seleção inicial para um valor aplicável pelo componente.
|
|
940
|
+
*
|
|
941
|
+
* @param {unknown} value - Valor bruto recebido via prop.
|
|
942
|
+
* @returns {'now' | Date | null} `'now'`, `Date` normalizada ou `null` quando inválido.
|
|
943
|
+
*/
|
|
944
|
+
function normalizeDatetimePickerInitialMoment(value) {
|
|
945
|
+
if (value === null)
|
|
946
|
+
return null;
|
|
947
|
+
if (value === 'now')
|
|
948
|
+
return 'now';
|
|
949
|
+
const normalizedDate = normalizeDateCandidate(value);
|
|
950
|
+
if (normalizedDate !== null) {
|
|
951
|
+
return normalizedDate;
|
|
952
|
+
}
|
|
953
|
+
warnInvalidPropValue('br-datetime-picker', 'initialMoment', value, 'null');
|
|
954
|
+
return null;
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Normaliza a lista de datas desabilitadas para uma coleção de `Date` válidas.
|
|
958
|
+
*
|
|
959
|
+
* @param {unknown} value - Valor bruto recebido via prop.
|
|
960
|
+
* @returns {Date[]} Lista normalizada de datas; retorna array vazio quando inválido.
|
|
961
|
+
*/
|
|
962
|
+
function normalizeDatetimePickerDisabledDates(value) {
|
|
963
|
+
if (value === null) {
|
|
964
|
+
return [];
|
|
965
|
+
}
|
|
966
|
+
if (typeof value === 'string') {
|
|
967
|
+
const tokens = tokenizeDisabledDatesString(value);
|
|
968
|
+
if (tokens.length === 0) {
|
|
969
|
+
warnInvalidPropValue('br-datetime-picker', 'disabledDates', value, '[]');
|
|
970
|
+
return [];
|
|
971
|
+
}
|
|
972
|
+
const normalizedDates = tokens
|
|
973
|
+
.map((dateCandidate) => normalizeDateCandidate(dateCandidate))
|
|
974
|
+
.filter((dateCandidate) => dateCandidate !== null);
|
|
975
|
+
if (normalizedDates.length !== tokens.length) {
|
|
976
|
+
warnInvalidPropValue('br-datetime-picker', 'disabledDates', value, '[]');
|
|
977
|
+
}
|
|
978
|
+
return normalizedDates;
|
|
979
|
+
}
|
|
980
|
+
if (!Array.isArray(value)) {
|
|
981
|
+
warnInvalidPropValue('br-datetime-picker', 'disabledDates', value, '[]');
|
|
982
|
+
return [];
|
|
983
|
+
}
|
|
984
|
+
const normalizedDates = value
|
|
985
|
+
.map((dateCandidate) => normalizeDateCandidate(dateCandidate))
|
|
986
|
+
.filter((dateCandidate) => dateCandidate !== null);
|
|
987
|
+
if (normalizedDates.length !== value.length) {
|
|
988
|
+
warnInvalidPropValue('br-datetime-picker', 'disabledDates', value, '[]');
|
|
989
|
+
}
|
|
990
|
+
return normalizedDates;
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Verifica se o valor informado representa um índice válido de início da semana.
|
|
994
|
+
*
|
|
995
|
+
* @param {number} value - Valor bruto recebido via prop.
|
|
996
|
+
* @returns {boolean} `true` quando o valor está entre `0` e `6`.
|
|
997
|
+
*/
|
|
998
|
+
function isValidDatetimePickerWeekStartsOn(value) {
|
|
999
|
+
return VALID_WEEK_START_DAYS.includes(value);
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Normaliza o índice de início da semana e aplica `0` quando o valor é inválido.
|
|
1003
|
+
*
|
|
1004
|
+
* @param {unknown} value - Valor bruto recebido do consumidor do componente.
|
|
1005
|
+
* @returns {DatetimePickerWeekDayIndex} Índice normalizado para o primeiro dia da semana.
|
|
1006
|
+
*/
|
|
1007
|
+
function normalizeDatetimePickerWeekStartsOn(value) {
|
|
1008
|
+
const numericValue = typeof value === 'string' ? Number(value) : value;
|
|
1009
|
+
if (typeof numericValue === 'number' &&
|
|
1010
|
+
Number.isInteger(numericValue) &&
|
|
1011
|
+
isValidDatetimePickerWeekStartsOn(numericValue)) {
|
|
1012
|
+
return numericValue;
|
|
1013
|
+
}
|
|
1014
|
+
warnInvalidPropValue('br-datetime-picker', 'weekStartsOn', String(value), '0');
|
|
1015
|
+
return 0;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
const datetimePickerCss = () => `*,*::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{box-sizing:border-box;display:block;margin-bottom:var(--spacing-scale-base);max-width:var(--br-datetime-picker-width, none);position:relative;width:100%}:host([mode=time]){max-width:var(--br-datetime-picker-time-width, var(--br-datetime-picker-width, none));width:100%}:host([mode=time][selection-mode=range]){width:var(--br-datetime-picker-time-range-width, 304px)}:host([mode=date]){max-width:var(--br-datetime-picker-date-width, var(--br-datetime-picker-width, none));width:100%}:host([mode=datetime]){max-width:var(--br-datetime-picker-datetime-width, var(--br-datetime-picker-width, none));width:100%}:host([mode=datetime][selection-mode=range]){width:var(--br-datetime-picker-datetime-range-width, 320px)}.br-datetime-picker{width:100%}.br-datetime-picker br-datetime-input,.br-datetime-picker br-card{display:block;width:100%}.br-datetime-picker br-card{font-size:var(--font-size-scale-base);animation:none}@media (prefers-reduced-motion: no-preference){.br-datetime-picker br-card{animation:datetime-panel-open var(--duration-fast, 300ms) var(--animation-ease-out, ease-out) both}}@keyframes datetime-panel-open{from{opacity:0}to{opacity:1}}.range-time-pickers{align-items:center;box-sizing:border-box;display:flex;gap:var(--spacing-scale-half, 4px);justify-content:center;margin-inline:auto;max-width:304px;padding:0;width:100%}.range-time-picker{align-items:center;display:flex;flex:0 0 144px;flex-direction:column;min-width:0}.range-time-label{font-size:var(--font-size-scale-down-01, 0.875rem);font-weight:var(--font-weight-semi-bold, 600);margin-bottom:var(--spacing-scale-base, 8px)}.range-time-separator{align-self:center;color:var(--gray-70);flex:0 0 auto;font-size:var(--font-size-scale-up-01, 1.2rem);font-weight:var(--font-weight-semi-bold, 600);margin-top:calc(var(--font-size-scale-down-01, 0.875rem) + var(--spacing-scale-base, 8px))}.br-datetime-picker br-date-picker{margin-inline:auto}:host([selection-mode=range]) br-card{text-align:initial}`;
|
|
426
1019
|
|
|
427
1020
|
const DatetimePicker = class {
|
|
428
1021
|
constructor(hostRef) {
|
|
429
1022
|
registerInstance(this, hostRef);
|
|
430
1023
|
this.dateStateChange = createEvent(this, "dateStateChange", 7);
|
|
1024
|
+
this.brDatetimePickerChange = createEvent(this, "brDatetimePickerChange", 7);
|
|
431
1025
|
this.valueChange = createEvent(this, "valueChange", 7);
|
|
432
1026
|
this.brDatetimePickerValidationChange = createEvent(this, "brDatetimePickerValidationChange", 7);
|
|
433
1027
|
if (hostRef.$hostElement$["s-ei"]) {
|
|
@@ -438,188 +1032,334 @@ const DatetimePicker = class {
|
|
|
438
1032
|
hostRef.$hostElement$["s-ei"] = this.elementInternals;
|
|
439
1033
|
}
|
|
440
1034
|
/**
|
|
441
|
-
*
|
|
442
|
-
*/
|
|
443
|
-
this.isPickerOpen = false;
|
|
444
|
-
this.formDisabled = false;
|
|
445
|
-
this.hasFeedbackSlot = false;
|
|
446
|
-
this.customValidationMessage = '';
|
|
447
|
-
this.validatorMessage = null;
|
|
448
|
-
this.isValidating = false;
|
|
449
|
-
this.feedbackId = generateUniqueId('br-datetime-picker-feedback');
|
|
450
|
-
/** Lista normalizada de datas indisponíveis para seleção. */
|
|
451
|
-
this.normalizedDisabledDates = [];
|
|
452
|
-
/** Data final selecionada no modo de intervalo. */
|
|
453
|
-
this.rangeEnd = null;
|
|
454
|
-
/** Data inicial selecionada no modo de intervalo. */
|
|
455
|
-
this.rangeStart = null;
|
|
456
|
-
/**
|
|
457
|
-
* Mantém a data de referência que orienta a navegação visual do calendário.
|
|
458
|
-
*/
|
|
459
|
-
this.referenceDate = new Date();
|
|
460
|
-
/**
|
|
461
|
-
* Define o modo de seleção exibido pelo componente: data, horário ou ambos.
|
|
1035
|
+
* Modo exibido pelo componente.
|
|
462
1036
|
*
|
|
463
|
-
* Valores
|
|
464
|
-
* Valores inválidos são
|
|
465
|
-
* mantendo o atributo refletido sempre consistente com o modo exibido.
|
|
1037
|
+
* Valores: `date` | `time` | `datetime`.
|
|
1038
|
+
* Valores inválidos são normalizados para o padrão.
|
|
466
1039
|
*
|
|
467
1040
|
* @default 'datetime'
|
|
468
1041
|
*/
|
|
469
1042
|
this.mode = DATETIME_PICKER_MODE.DEFAULT;
|
|
470
1043
|
/**
|
|
471
|
-
*
|
|
1044
|
+
* Locale usado para formatação e rótulos.
|
|
472
1045
|
*
|
|
473
1046
|
* @default 'pt-BR'
|
|
474
1047
|
*/
|
|
475
1048
|
this.locale = DATETIME_PICKER_LOCALE.DEFAULT;
|
|
476
1049
|
/**
|
|
477
|
-
*
|
|
1050
|
+
* Texto placeholder exibido no input.
|
|
478
1051
|
*
|
|
479
1052
|
* @default ''
|
|
480
1053
|
*/
|
|
481
1054
|
this.placeholder = '';
|
|
482
|
-
/**
|
|
1055
|
+
/**
|
|
1056
|
+
* Nome do campo para submissão em formulários nativos.
|
|
1057
|
+
*
|
|
1058
|
+
* @default ''
|
|
1059
|
+
*/
|
|
483
1060
|
this.name = '';
|
|
484
|
-
/**
|
|
1061
|
+
/**
|
|
1062
|
+
* Indica se o campo é requerido para submissão do formulário.
|
|
1063
|
+
*
|
|
1064
|
+
* @default false
|
|
1065
|
+
*/
|
|
485
1066
|
this.required = false;
|
|
486
1067
|
/**
|
|
487
|
-
* Menor data/
|
|
488
|
-
* Aceita texto no atributo HTML ou uma instância de `Date` por property binding.
|
|
1068
|
+
* Menor data/hora aceito (Date | string | null).
|
|
489
1069
|
*
|
|
490
|
-
* @
|
|
491
|
-
* ```html
|
|
492
|
-
* <br-datetime-picker mode="date" min="2026-01-01"></br-datetime-picker>
|
|
493
|
-
* ```
|
|
1070
|
+
* @default null
|
|
494
1071
|
*/
|
|
495
1072
|
this.min = null;
|
|
496
1073
|
/**
|
|
497
|
-
* Maior data/
|
|
498
|
-
* Aceita texto no atributo HTML ou uma instância de `Date` por property binding.
|
|
1074
|
+
* Maior data/hora aceito (Date | string | null).
|
|
499
1075
|
*
|
|
500
|
-
* @
|
|
501
|
-
* ```html
|
|
502
|
-
* <br-datetime-picker mode="date" max="2026-12-31"></br-datetime-picker>
|
|
503
|
-
* ```
|
|
1076
|
+
* @default null
|
|
504
1077
|
*/
|
|
505
1078
|
this.max = null;
|
|
506
1079
|
/**
|
|
507
|
-
*
|
|
1080
|
+
* Tipo de seleção: `single` ou `range`.
|
|
508
1081
|
*
|
|
509
|
-
*
|
|
510
|
-
* Se `selectionMode="range"` for informado, o componente ajusta automaticamente
|
|
511
|
-
* `mode` para `date`. Se `mode` mudar para `time` ou `datetime`, o componente
|
|
512
|
-
* normaliza `selectionMode` para `single` quando necessário.
|
|
513
|
-
* Valores inválidos usam `single`.
|
|
1082
|
+
* @default 'single'
|
|
514
1083
|
*/
|
|
515
1084
|
this.selectionMode = 'single';
|
|
516
1085
|
/**
|
|
517
|
-
*
|
|
518
|
-
*
|
|
519
|
-
* Valores suportados: 0 (domingo) a 6 (sábado).
|
|
1086
|
+
* Dia inicial da semana exibido no calendário (0 = Dom, 6 = Sáb).
|
|
520
1087
|
*
|
|
521
1088
|
* @default 0
|
|
522
1089
|
*/
|
|
523
1090
|
this.weekStartsOn = 0;
|
|
524
1091
|
/**
|
|
525
|
-
*
|
|
526
|
-
*
|
|
527
|
-
* Aceita:
|
|
528
|
-
* - `'now'`: seleciona o momento atual.
|
|
529
|
-
* - `Date` ou `string`: seleciona uma data arbitrária.
|
|
530
|
-
* - `null`: inicia sem seleção.
|
|
531
|
-
*
|
|
532
|
-
* Reativo em runtime: mudanças na prop atualizam estado e subcomponentes.
|
|
1092
|
+
* Valor inicial da seleção: `'now' | Date | string | null`.
|
|
533
1093
|
*
|
|
534
1094
|
* @default null
|
|
535
|
-
* @example
|
|
536
|
-
* ```html
|
|
537
|
-
* <br-datetime-picker initial-moment="now"></br-datetime-picker>
|
|
538
|
-
* ```
|
|
539
1095
|
*/
|
|
540
1096
|
this.initialMoment = null;
|
|
541
1097
|
/**
|
|
542
|
-
*
|
|
543
|
-
*
|
|
544
|
-
*
|
|
1098
|
+
* Valor selecionado pelo usuário (Date | null).
|
|
1099
|
+
*
|
|
1100
|
+
* Pode ser controlado externamente e é refletido internamente.
|
|
545
1101
|
*
|
|
546
|
-
* @
|
|
547
|
-
* ```js
|
|
548
|
-
* const picker = document.querySelector('br-datetime-picker');
|
|
549
|
-
* picker.value = new Date(2026, 8, 7, 14, 30);
|
|
550
|
-
* ```
|
|
1102
|
+
* @default null
|
|
551
1103
|
*/
|
|
552
1104
|
this.value = null;
|
|
553
1105
|
/**
|
|
554
1106
|
* Desabilita toda a interação do componente.
|
|
555
1107
|
*
|
|
556
|
-
* Quando `true`, impede abrir o picker, alterar valores e navegar entre datas/horários.
|
|
557
|
-
*
|
|
558
1108
|
* @default false
|
|
559
1109
|
*/
|
|
560
1110
|
this.disabled = false;
|
|
561
1111
|
/**
|
|
562
|
-
*
|
|
1112
|
+
* Datas indisponíveis para seleção. Aceita `Date[]`, `string` ou `null`.
|
|
563
1113
|
*
|
|
564
|
-
*
|
|
565
|
-
* separadas por espaço em branco. Datas inválidas são ignoradas com warning.
|
|
566
|
-
* A comparação considera apenas o dia (ano/mês/dia), ignorando hora.
|
|
1114
|
+
* Datas inválidas são ignoradas. A comparação considera apenas o dia.
|
|
567
1115
|
*
|
|
568
1116
|
* @default null
|
|
569
|
-
* @example
|
|
570
|
-
* ```html
|
|
571
|
-
* <br-datetime-picker mode="date" disabled-dates="2026-09-07 2026-09-08"></br-datetime-picker>
|
|
572
|
-
* ```
|
|
573
|
-
* @example
|
|
574
|
-
* ```js
|
|
575
|
-
* const picker = document.querySelector('br-datetime-picker');
|
|
576
|
-
* picker.disabledDates = [new Date(2026, 8, 7), '2026-09-08'];
|
|
577
|
-
* ```
|
|
578
1117
|
*/
|
|
579
1118
|
this.disabledDates = null;
|
|
580
1119
|
/**
|
|
581
|
-
*
|
|
582
|
-
* ou variar conforme o mês.
|
|
583
|
-
*
|
|
584
|
-
* Quando `true`, o calendário sempre exibe 6 semanas completas.
|
|
585
|
-
* Quando `false`, o calendário adapta-se ao mês, exibindo apenas as semanas necessárias.
|
|
1120
|
+
* Mantém número fixo de linhas no calendário (6 semanas) quando `true`.
|
|
586
1121
|
*
|
|
587
1122
|
* @default false
|
|
588
1123
|
*/
|
|
589
1124
|
this.fixedRowCount = false;
|
|
590
|
-
/**
|
|
1125
|
+
/**
|
|
1126
|
+
* Controla se o conteúdo do picker está visível.
|
|
1127
|
+
*
|
|
1128
|
+
* @internal Estado reativo interno; não usar externamente.
|
|
1129
|
+
*/
|
|
1130
|
+
this.isPickerOpen = false;
|
|
1131
|
+
/**
|
|
1132
|
+
* Indica se o formulário associado desabilitou o componente.
|
|
1133
|
+
*
|
|
1134
|
+
* @internal Estado reativo interno.
|
|
1135
|
+
*/
|
|
1136
|
+
this.formDisabled = false;
|
|
1137
|
+
/**
|
|
1138
|
+
* Indica se existe slot `feedback` presente no host.
|
|
1139
|
+
*
|
|
1140
|
+
* @internal Estado reativo interno.
|
|
1141
|
+
*/
|
|
1142
|
+
this.hasFeedbackSlot = false;
|
|
1143
|
+
/**
|
|
1144
|
+
* Mensagem de validação customizada definida por `setCustomValidity`.
|
|
1145
|
+
*
|
|
1146
|
+
* @internal Estado reativo interno.
|
|
1147
|
+
*/
|
|
1148
|
+
this.customValidationMessage = '';
|
|
1149
|
+
/**
|
|
1150
|
+
* Mensagem retornada pelo validator customizado, se houver.
|
|
1151
|
+
*
|
|
1152
|
+
* @internal Estado reativo interno.
|
|
1153
|
+
*/
|
|
1154
|
+
this.validatorMessage = null;
|
|
1155
|
+
/**
|
|
1156
|
+
* Mensagem textual de validação proveniente do input interno.
|
|
1157
|
+
*
|
|
1158
|
+
* @internal Estado reativo interno.
|
|
1159
|
+
*/
|
|
1160
|
+
this.inputValidationMessage = '';
|
|
1161
|
+
/**
|
|
1162
|
+
* Indica que o usuário está editando o texto do input e que a validação
|
|
1163
|
+
* textual está pendente (mensagem escondida até commit/blur).
|
|
1164
|
+
*
|
|
1165
|
+
* @internal
|
|
1166
|
+
*/
|
|
1167
|
+
this.inputValidationPending = false;
|
|
1168
|
+
/**
|
|
1169
|
+
* Indicador de execução do validator assíncrono.
|
|
1170
|
+
*
|
|
1171
|
+
* @internal Estado reativo interno.
|
|
1172
|
+
*/
|
|
1173
|
+
this.isValidating = false;
|
|
1174
|
+
/**
|
|
1175
|
+
* Lista normalizada de datas indisponíveis para seleção.
|
|
1176
|
+
*
|
|
1177
|
+
* @internal Mantida em formato `Date[]` para uso interno pelo calendário.
|
|
1178
|
+
*/
|
|
1179
|
+
this.normalizedDisabledDates = [];
|
|
1180
|
+
/**
|
|
1181
|
+
* Data final selecionada no modo de intervalo.
|
|
1182
|
+
*
|
|
1183
|
+
* @internal Estado reativo interno.
|
|
1184
|
+
*/
|
|
1185
|
+
this.rangeEnd = null;
|
|
1186
|
+
/**
|
|
1187
|
+
* Data inicial selecionada no modo de intervalo.
|
|
1188
|
+
*
|
|
1189
|
+
* @internal Estado reativo interno.
|
|
1190
|
+
*/
|
|
1191
|
+
this.rangeStart = null;
|
|
1192
|
+
/**
|
|
1193
|
+
* Data de referência usada para navegação visual (mês/semana exibidos).
|
|
1194
|
+
*
|
|
1195
|
+
* @internal Controle de navegação do calendário.
|
|
1196
|
+
*/
|
|
1197
|
+
this.referenceDate = new Date();
|
|
1198
|
+
/**
|
|
1199
|
+
* ID único do contêiner de feedback interno.
|
|
1200
|
+
* Gerado por `Helpers.generateUniqueId` no momento da criação da instância
|
|
1201
|
+
* e usado para associar mensagens de validação ao input interno.
|
|
1202
|
+
*
|
|
1203
|
+
* @internal
|
|
1204
|
+
*/
|
|
1205
|
+
this.feedbackId = Helpers.generateUniqueId('br-datetime-picker-feedback');
|
|
1206
|
+
/**
|
|
1207
|
+
* Snapshot da seleção inicial usada para restaurar em reset de formulário.
|
|
1208
|
+
* Mantém uma cópia imutável do valor original para `formResetCallback`.
|
|
1209
|
+
*
|
|
1210
|
+
* @internal
|
|
1211
|
+
*/
|
|
591
1212
|
this.initialFormValue = null;
|
|
1213
|
+
/**
|
|
1214
|
+
* Contador monótono usado para invalidar execuções assíncronas de validação.
|
|
1215
|
+
* Incrementado antes de cada execução; resultados com `runId` diferente são ignorados.
|
|
1216
|
+
*
|
|
1217
|
+
* @internal
|
|
1218
|
+
*/
|
|
592
1219
|
this.validationRunId = 0;
|
|
1220
|
+
/**
|
|
1221
|
+
* Indica se o componente já completou o ciclo `componentDidLoad`.
|
|
1222
|
+
* Evita executar lógica de inicialização mais de uma vez.
|
|
1223
|
+
*
|
|
1224
|
+
* @internal
|
|
1225
|
+
*/
|
|
593
1226
|
this.isInitialized = false;
|
|
1227
|
+
/**
|
|
1228
|
+
* Flag para evitar loops de sincronização entre `value`, `valueAsDate` e `serializedValue`.
|
|
1229
|
+
* Setada temporariamente durante operações programáticas de sincronização.
|
|
1230
|
+
*
|
|
1231
|
+
* @internal
|
|
1232
|
+
*/
|
|
594
1233
|
this.syncingCanonicalValues = false;
|
|
595
|
-
/**
|
|
1234
|
+
/**
|
|
1235
|
+
* Flag que sinaliza atualizações internas em `rangeValue`.
|
|
1236
|
+
* Usada para distinguir atribuições programáticas de alterações externas.
|
|
1237
|
+
*
|
|
1238
|
+
* @internal
|
|
1239
|
+
*/
|
|
1240
|
+
this.syncingRangeValueInternally = false;
|
|
1241
|
+
/**
|
|
1242
|
+
* Mapeia cada modo para a função responsável por renderizar seu conteúdo.
|
|
1243
|
+
* Facilita seleção de renderer sem condicionais espalhadas pelo código.
|
|
1244
|
+
*
|
|
1245
|
+
* @internal
|
|
1246
|
+
*/
|
|
596
1247
|
this.modeRendererMap = {
|
|
597
1248
|
[DATETIME_PICKER_MODE.DATE]: () => this.renderDatePicker(),
|
|
598
|
-
[DATETIME_PICKER_MODE.TIME]: () => this.renderTimePicker(),
|
|
1249
|
+
[DATETIME_PICKER_MODE.TIME]: () => this.selectionMode === 'range' ? this.renderRangeTimePickers() : this.renderTimePicker(),
|
|
599
1250
|
[DATETIME_PICKER_MODE.DATETIME]: () => this.renderDateTimePicker(),
|
|
600
1251
|
};
|
|
601
1252
|
/**
|
|
602
|
-
*
|
|
1253
|
+
* Indica se o listener global de clique fora do componente está anexado.
|
|
1254
|
+
* Evita anexações/remoções redundantes do mesmo handler.
|
|
603
1255
|
*
|
|
604
|
-
* @
|
|
1256
|
+
* @internal
|
|
1257
|
+
*/
|
|
1258
|
+
this.outsideClickListenerAttached = false;
|
|
1259
|
+
/**
|
|
1260
|
+
* Handler disparado por `br-datetime-input` para propagar mensagens de
|
|
1261
|
+
* validação do input interno para o estado do componente.
|
|
1262
|
+
*
|
|
1263
|
+
* @param event CustomEvent<{ valid: boolean; message: string }> — detalhe com `valid` e `message`.
|
|
1264
|
+
* @returns void
|
|
1265
|
+
*/
|
|
1266
|
+
this.handleInputValidationChange = (event) => {
|
|
1267
|
+
event.stopPropagation();
|
|
1268
|
+
const valid = event.detail.valid;
|
|
1269
|
+
if (valid === null) {
|
|
1270
|
+
// usuário está editando: escondemos a mensagem visual, mas mantemos
|
|
1271
|
+
// o estado de validade indefinido até commit/blur/enter
|
|
1272
|
+
this.inputValidationMessage = '';
|
|
1273
|
+
this.inputValidationPending = true;
|
|
1274
|
+
}
|
|
1275
|
+
else {
|
|
1276
|
+
this.inputValidationMessage = valid ? '' : event.detail.message;
|
|
1277
|
+
this.inputValidationPending = false;
|
|
1278
|
+
}
|
|
1279
|
+
this.syncFormValidity();
|
|
1280
|
+
};
|
|
1281
|
+
/**
|
|
1282
|
+
* Handler principal que consolida eventos de `br-date-picker` / `br-time-picker`.
|
|
1283
|
+
* Contém lógica de proteção contra valores desabilitados, navegação e emissão
|
|
1284
|
+
* de eventos públicos apropriados.
|
|
1285
|
+
*
|
|
1286
|
+
* @param event CustomEvent<DatetimePickerDateState> — detalhe com `referenceDate`, `value` e `range`.
|
|
605
1287
|
*/
|
|
606
1288
|
this.handleDateStateChange = (event) => {
|
|
607
|
-
// Evita que o evento interno dos subcomponentes vaze para fora do host.
|
|
608
1289
|
event.stopPropagation();
|
|
609
1290
|
if (this.isDisabled()) {
|
|
610
1291
|
return;
|
|
611
1292
|
}
|
|
1293
|
+
const origin = event.detail.origin;
|
|
1294
|
+
if (origin !== 'BR-DATETIME-INPUT') {
|
|
1295
|
+
this.inputValidationMessage = '';
|
|
1296
|
+
}
|
|
612
1297
|
const { referenceDate, value, range } = event.detail;
|
|
1298
|
+
if (this.isRangeNavigationState(value, range)) {
|
|
1299
|
+
this.referenceDate = toDateExports.toDate(referenceDate);
|
|
1300
|
+
this.updateFormInternals();
|
|
1301
|
+
return;
|
|
1302
|
+
}
|
|
613
1303
|
const selectedDate = this.resolveSelectedDateFromEvent(range, value);
|
|
614
1304
|
if (selectedDate !== null && this.isDateDisabled(selectedDate)) {
|
|
615
1305
|
return;
|
|
616
1306
|
}
|
|
617
1307
|
this.referenceDate = toDateExports.toDate(referenceDate);
|
|
618
1308
|
const shouldEmitPublicEvent = this.resolvePublicEventEmissionForRange(range);
|
|
619
|
-
|
|
1309
|
+
const nextValue = value === null ? null : toDateExports.toDate(value);
|
|
1310
|
+
if (this.sameDate(this.value, nextValue)) {
|
|
1311
|
+
this.handleUnchangedDateState(range, shouldEmitPublicEvent);
|
|
1312
|
+
return;
|
|
1313
|
+
}
|
|
1314
|
+
this.setComponentValue(nextValue, shouldEmitPublicEvent && this.isInitialized);
|
|
1315
|
+
this.emitPendingRangeChange(range, shouldEmitPublicEvent);
|
|
620
1316
|
};
|
|
1317
|
+
/**
|
|
1318
|
+
* Atualiza somente o horário de um dos limites do intervalo.
|
|
1319
|
+
*
|
|
1320
|
+
* @param boundary 'start' | 'end' — qual limite será atualizado.
|
|
1321
|
+
* @param event CustomEvent<DatetimePickerDateState> — detalhe com novo `value`.
|
|
1322
|
+
*/
|
|
1323
|
+
this.handleRangeTimeStateChange = (boundary, event) => {
|
|
1324
|
+
event.stopPropagation();
|
|
1325
|
+
if (this.isDisabled() || event.detail.value === null)
|
|
1326
|
+
return;
|
|
1327
|
+
const displayedStart = this.cloneDate(this.rangeStart ?? this.referenceDate);
|
|
1328
|
+
const displayedEnd = this.cloneDate(this.rangeEnd ?? this.referenceDate);
|
|
1329
|
+
if (this.rangeStart === null)
|
|
1330
|
+
this.rangeStart = displayedStart;
|
|
1331
|
+
if (this.rangeEnd === null)
|
|
1332
|
+
this.rangeEnd = displayedEnd;
|
|
1333
|
+
const selected = toDateExports.toDate(event.detail.value);
|
|
1334
|
+
const current = boundary === 'start' ? this.rangeStart : this.rangeEnd;
|
|
1335
|
+
const base = current ?? this.referenceDate;
|
|
1336
|
+
const next = setExports.set(base, {
|
|
1337
|
+
hours: selected.getHours(),
|
|
1338
|
+
minutes: selected.getMinutes(),
|
|
1339
|
+
seconds: 0,
|
|
1340
|
+
milliseconds: 0,
|
|
1341
|
+
});
|
|
1342
|
+
if (boundary === 'start')
|
|
1343
|
+
this.rangeStart = next;
|
|
1344
|
+
else
|
|
1345
|
+
this.rangeEnd = next;
|
|
1346
|
+
const nextComponentValue = this.rangeEnd ?? this.rangeStart;
|
|
1347
|
+
if (!this.sameDate(this.value, nextComponentValue)) {
|
|
1348
|
+
this.value = this.cloneDate(nextComponentValue);
|
|
1349
|
+
}
|
|
1350
|
+
this.syncCanonicalValues();
|
|
1351
|
+
if (this.isInitialized) {
|
|
1352
|
+
this.emitDateStateChange();
|
|
1353
|
+
void this.validate();
|
|
1354
|
+
}
|
|
1355
|
+
this.updateFormInternals();
|
|
1356
|
+
};
|
|
1357
|
+
this.handleRangeStartTimeStateChange = (event) => this.handleRangeTimeStateChange('start', event);
|
|
1358
|
+
this.handleRangeEndTimeStateChange = (event) => this.handleRangeTimeStateChange('end', event);
|
|
621
1359
|
/**
|
|
622
1360
|
* Alterna visibilidade do picker quando o input solicita.
|
|
1361
|
+
*
|
|
1362
|
+
* @param event Event — evento de toggle vindo do input.
|
|
623
1363
|
*/
|
|
624
1364
|
this.handleTogglePicker = (event) => {
|
|
625
1365
|
if (this.isDisabled()) {
|
|
@@ -629,11 +1369,14 @@ const DatetimePicker = class {
|
|
|
629
1369
|
const willOpen = !this.isPickerOpen;
|
|
630
1370
|
if (willOpen) {
|
|
631
1371
|
this.referenceDate = this.value === null ? toDateExports.toDate(new Date()) : toDateExports.toDate(this.value);
|
|
1372
|
+
this.initializeTimeRangeBoundaries();
|
|
632
1373
|
}
|
|
633
1374
|
this.isPickerOpen = willOpen;
|
|
634
1375
|
};
|
|
635
1376
|
/**
|
|
636
1377
|
* Fecha o picker quando o clique acontece fora do host.
|
|
1378
|
+
*
|
|
1379
|
+
* @param event MouseEvent — clique ocorrido no documento.
|
|
637
1380
|
*/
|
|
638
1381
|
this.handleOutsideClick = (event) => {
|
|
639
1382
|
const eventPath = event.composedPath();
|
|
@@ -642,7 +1385,6 @@ const DatetimePicker = class {
|
|
|
642
1385
|
}
|
|
643
1386
|
this.isPickerOpen = false;
|
|
644
1387
|
};
|
|
645
|
-
this.outsideClickListenerAttached = false;
|
|
646
1388
|
/**
|
|
647
1389
|
* Fecha o picker ao pressionar Escape, devolvendo o foco ao input interno.
|
|
648
1390
|
*
|
|
@@ -653,42 +1395,17 @@ const DatetimePicker = class {
|
|
|
653
1395
|
return;
|
|
654
1396
|
event.stopPropagation();
|
|
655
1397
|
this.isPickerOpen = false;
|
|
656
|
-
|
|
1398
|
+
this.getNativeInputElement()?.focus();
|
|
657
1399
|
};
|
|
658
1400
|
}
|
|
659
|
-
formDisabledCallback(disabled) {
|
|
660
|
-
this.formDisabled = disabled;
|
|
661
|
-
}
|
|
662
|
-
/** API nativa de reset de form-associated custom elements. */
|
|
663
|
-
formResetCallback() {
|
|
664
|
-
this.customValidationMessage = '';
|
|
665
|
-
this.validatorMessage = null;
|
|
666
|
-
this.validationRunId++;
|
|
667
|
-
this.restoreSelection(this.initialFormValue);
|
|
668
|
-
}
|
|
669
|
-
/** API nativa de restauração de estado (histórico/autofill) do formulário. */
|
|
670
|
-
formStateRestoreCallback(state) {
|
|
671
|
-
if (typeof state !== 'string') {
|
|
672
|
-
this.restoreSelection(null);
|
|
673
|
-
return;
|
|
674
|
-
}
|
|
675
|
-
if (this.isRangeRestoreMode()) {
|
|
676
|
-
this.restoreRangeStateFromSerialized(state);
|
|
677
|
-
return;
|
|
678
|
-
}
|
|
679
|
-
this.restoreSingleStateFromSerialized(state);
|
|
680
|
-
}
|
|
681
1401
|
/**
|
|
682
1402
|
* Revalida o modo sempre que a prop mudar.
|
|
683
1403
|
*
|
|
684
|
-
* @param newValue - Valor recebido via atributo/prop.
|
|
1404
|
+
* @param {string} newValue - Valor recebido via atributo/prop.
|
|
685
1405
|
*/
|
|
686
1406
|
handleModeChange(newValue) {
|
|
687
1407
|
this.ensureValidMode(newValue);
|
|
688
|
-
|
|
689
|
-
this.selectionMode = 'single';
|
|
690
|
-
return;
|
|
691
|
-
}
|
|
1408
|
+
this.initializeTimeRangeBoundaries();
|
|
692
1409
|
this.updateFormInternals();
|
|
693
1410
|
}
|
|
694
1411
|
/** Revalida o estado do formulário quando required mudar. */
|
|
@@ -705,14 +1422,11 @@ const DatetimePicker = class {
|
|
|
705
1422
|
/** Reage a mudanças no modo de seleção e limpa intervalo quando necessário. */
|
|
706
1423
|
handleSelectionModeChange(newValue) {
|
|
707
1424
|
this.ensureValidSelectionMode(newValue);
|
|
708
|
-
if (this.selectionMode === 'range' && this.mode !== DATETIME_PICKER_MODE.DATE) {
|
|
709
|
-
this.mode = DATETIME_PICKER_MODE.DATE;
|
|
710
|
-
return;
|
|
711
|
-
}
|
|
712
1425
|
if (this.selectionMode === 'single') {
|
|
713
1426
|
this.clearRangeState();
|
|
714
1427
|
return;
|
|
715
1428
|
}
|
|
1429
|
+
this.initializeTimeRangeBoundaries();
|
|
716
1430
|
this.updateFormInternals();
|
|
717
1431
|
}
|
|
718
1432
|
/** Revalida o dia inicial da semana sempre que a prop mudar. */
|
|
@@ -722,13 +1436,16 @@ const DatetimePicker = class {
|
|
|
722
1436
|
/**
|
|
723
1437
|
* Aplica ou limpa a seleção da data atual conforme o novo valor da prop.
|
|
724
1438
|
*
|
|
725
|
-
* @param newValue - Novo estado da prop.
|
|
1439
|
+
* @param {DatetimePickerInitialMoment} newValue - Novo estado da prop.
|
|
726
1440
|
*/
|
|
727
1441
|
handleInitialMomentChange(newValue) {
|
|
728
1442
|
this.applyInitialMoment(newValue, this.isInitialized);
|
|
729
1443
|
this.initialFormValue = this.cloneDate(this.value);
|
|
730
1444
|
}
|
|
731
1445
|
/** Sincroniza alterações externas do valor com o estado visual e o formulário nativo. */
|
|
1446
|
+
/**
|
|
1447
|
+
* @param {Date | null} newValue - Novo valor recebido via prop.
|
|
1448
|
+
*/
|
|
732
1449
|
handleValueChange(newValue) {
|
|
733
1450
|
const normalizedValue = newValue instanceof Date && !Number.isNaN(newValue.getTime()) ? toDateExports.toDate(newValue) : null;
|
|
734
1451
|
if (newValue !== null && normalizedValue === null) {
|
|
@@ -773,45 +1490,33 @@ const DatetimePicker = class {
|
|
|
773
1490
|
this.syncDisabledDates(newValue);
|
|
774
1491
|
}
|
|
775
1492
|
handleRangeValueChange(newValue) {
|
|
776
|
-
if (!newValue || this.selectionMode !== 'range')
|
|
1493
|
+
if (this.syncingRangeValueInternally || !newValue || this.selectionMode !== 'range')
|
|
777
1494
|
return;
|
|
778
|
-
if (!isValidDatetimePickerDateRange(newValue)) {
|
|
779
|
-
reportInvalidPropValue(this.el, 'rangeValue', newValue, 'Informe um objeto com `start` e `end` como Date válido ou null.', 'Mantendo o último intervalo efetivo.');
|
|
780
|
-
return;
|
|
781
|
-
}
|
|
782
1495
|
this.rangeStart = this.cloneDate(newValue.start);
|
|
783
1496
|
this.rangeEnd = this.cloneDate(newValue.end);
|
|
784
|
-
const nextValue =
|
|
785
|
-
this.
|
|
786
|
-
this.setComponentValue(nextValue);
|
|
1497
|
+
const nextValue = this.rangeEnd ?? this.rangeStart;
|
|
1498
|
+
this.setComponentValue(nextValue, false);
|
|
787
1499
|
}
|
|
788
|
-
/** Registra o listener global somente enquanto o picker está aberto. */
|
|
789
1500
|
connectedCallback() {
|
|
790
1501
|
if (this.isPickerOpen)
|
|
791
1502
|
this.attachOutsideClickListener();
|
|
792
1503
|
}
|
|
793
|
-
/** Remove o listener global para evitar vazamento de eventos ao desmontar. */
|
|
794
|
-
disconnectedCallback() {
|
|
795
|
-
this.detachOutsideClickListener();
|
|
796
|
-
}
|
|
797
|
-
/**
|
|
798
|
-
* Normaliza o modo antes da primeira renderização e aplica a data atual quando solicitado.
|
|
799
|
-
*/
|
|
800
1504
|
componentWillLoad() {
|
|
801
|
-
|
|
802
|
-
const
|
|
1505
|
+
const initialSerializedValue = this.serializedValue;
|
|
1506
|
+
const initialValueAsDate = this.valueAsDate;
|
|
803
1507
|
this.referenceDate = resolveSsrLocalDate(this.el, this.referenceDate);
|
|
804
1508
|
this.initializeMode();
|
|
805
1509
|
this.initializeSelectionMode();
|
|
806
1510
|
this.initializeWeekStartsOn();
|
|
807
1511
|
this.initializeDisabledDates();
|
|
808
1512
|
this.initializeDefaultValue();
|
|
809
|
-
if (
|
|
810
|
-
this.restoreSerializedValue(
|
|
1513
|
+
if (initialSerializedValue !== undefined) {
|
|
1514
|
+
this.restoreSerializedValue(initialSerializedValue);
|
|
811
1515
|
}
|
|
812
|
-
else if (
|
|
813
|
-
this.handleValueAsDateChange(
|
|
1516
|
+
else if (initialValueAsDate !== undefined) {
|
|
1517
|
+
this.handleValueAsDateChange(initialValueAsDate);
|
|
814
1518
|
}
|
|
1519
|
+
this.initializeTimeRangeBoundaries(true);
|
|
815
1520
|
this.initialFormValue = this.cloneDate(this.value);
|
|
816
1521
|
this.syncCanonicalValues();
|
|
817
1522
|
this.updateFormInternals();
|
|
@@ -820,18 +1525,58 @@ const DatetimePicker = class {
|
|
|
820
1525
|
this.isInitialized = true;
|
|
821
1526
|
this.hasFeedbackSlot = this.el.querySelector('[slot="feedback"]') !== null;
|
|
822
1527
|
}
|
|
1528
|
+
disconnectedCallback() {
|
|
1529
|
+
this.detachOutsideClickListener();
|
|
1530
|
+
}
|
|
1531
|
+
formDisabledCallback(disabled) {
|
|
1532
|
+
this.formDisabled = disabled;
|
|
1533
|
+
}
|
|
1534
|
+
/** Restaura o estado do componente quando o formulário é restaurado. */
|
|
1535
|
+
formResetCallback() {
|
|
1536
|
+
this.customValidationMessage = '';
|
|
1537
|
+
this.validatorMessage = null;
|
|
1538
|
+
this.inputValidationMessage = '';
|
|
1539
|
+
this.validationRunId++;
|
|
1540
|
+
this.restoreSelection(this.initialFormValue);
|
|
1541
|
+
}
|
|
823
1542
|
/**
|
|
824
|
-
*
|
|
1543
|
+
* Restaura o estado do formulário (autofill / histórico).
|
|
825
1544
|
*
|
|
826
|
-
*
|
|
827
|
-
|
|
1545
|
+
* @param {string | File | FormData | null} state Estado serializado fornecido pelo navegador.
|
|
1546
|
+
*/
|
|
1547
|
+
formStateRestoreCallback(state) {
|
|
1548
|
+
if (typeof state !== 'string') {
|
|
1549
|
+
this.restoreSelection(null);
|
|
1550
|
+
return;
|
|
1551
|
+
}
|
|
1552
|
+
if (this.isRangeRestoreMode()) {
|
|
1553
|
+
this.restoreRangeStateFromSerialized(state);
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
this.restoreSingleStateFromSerialized(state);
|
|
1557
|
+
}
|
|
1558
|
+
/**
|
|
1559
|
+
* Define programaticamente as datas desabilitadas.
|
|
828
1560
|
*
|
|
829
|
-
*
|
|
1561
|
+
* Use quando scripts externos precisam fornecer uma lista tipada de
|
|
1562
|
+
* datas a bloquear no calendário. Substitui a prop `disabledDates` para
|
|
1563
|
+
* atualizações imperativas.
|
|
1564
|
+
*
|
|
1565
|
+
* @param dates Lista de datas (`Date` | `string`) a bloquear, ou `null` para limpar.
|
|
1566
|
+
* @returns Promise<void> — resolve quando a atualização interna for aplicada.
|
|
830
1567
|
*/
|
|
831
1568
|
async setDisabledDates(dates) {
|
|
832
1569
|
this.syncDisabledDates(dates);
|
|
833
1570
|
}
|
|
834
|
-
/**
|
|
1571
|
+
/**
|
|
1572
|
+
* Define o valor do componente de forma imperativa.
|
|
1573
|
+
*
|
|
1574
|
+
* Aceita `Date`, string compatível com o `mode`, ou `null` para limpar a seleção.
|
|
1575
|
+
* Validação de datas desabilitadas é aplicada antes da atribuição.
|
|
1576
|
+
*
|
|
1577
|
+
* @param value Date | string | null — valor a aplicar; `null` limpa a seleção.
|
|
1578
|
+
* @returns Promise<void> — resolve quando o componente aplicar e sincronizar o valor.
|
|
1579
|
+
*/
|
|
835
1580
|
async setValue(value) {
|
|
836
1581
|
if (this.isDisabled()) {
|
|
837
1582
|
return;
|
|
@@ -848,18 +1593,32 @@ const DatetimePicker = class {
|
|
|
848
1593
|
this.referenceDate = nextValue === null ? toDateExports.toDate(new Date()) : toDateExports.toDate(nextValue);
|
|
849
1594
|
this.setComponentValue(nextValue);
|
|
850
1595
|
}
|
|
851
|
-
/**
|
|
1596
|
+
/**
|
|
1597
|
+
* Retorna uma cópia do valor selecionado atualmente.
|
|
1598
|
+
*
|
|
1599
|
+
* @returns Promise<Date | null> — cópia imutável do `value` atual, ou `null`.
|
|
1600
|
+
*/
|
|
852
1601
|
async getValue() {
|
|
853
1602
|
return this.cloneDate(this.value);
|
|
854
1603
|
}
|
|
855
|
-
/**
|
|
1604
|
+
/**
|
|
1605
|
+
* Limpa valor e intervalo selecionados.
|
|
1606
|
+
*
|
|
1607
|
+
* Remove seleção atual e restaura a referência de navegação para a data atual.
|
|
1608
|
+
*
|
|
1609
|
+
* @returns Promise<void> — resolve após a limpeza e sincronização internas.
|
|
1610
|
+
*/
|
|
856
1611
|
async clear() {
|
|
857
1612
|
this.rangeStart = null;
|
|
858
1613
|
this.rangeEnd = null;
|
|
859
1614
|
this.referenceDate = toDateExports.toDate(new Date());
|
|
860
1615
|
this.setComponentValue(null);
|
|
861
1616
|
}
|
|
862
|
-
/**
|
|
1617
|
+
/**
|
|
1618
|
+
* Abre o picker quando o componente estiver habilitado.
|
|
1619
|
+
*
|
|
1620
|
+
* @returns Promise<void> — resolve quando o estado visual for atualizado.
|
|
1621
|
+
*/
|
|
863
1622
|
async open() {
|
|
864
1623
|
if (this.isDisabled()) {
|
|
865
1624
|
return;
|
|
@@ -867,11 +1626,19 @@ const DatetimePicker = class {
|
|
|
867
1626
|
this.referenceDate = this.value === null ? toDateExports.toDate(new Date()) : toDateExports.toDate(this.value);
|
|
868
1627
|
this.isPickerOpen = true;
|
|
869
1628
|
}
|
|
870
|
-
/**
|
|
1629
|
+
/**
|
|
1630
|
+
* Fecha o picker.
|
|
1631
|
+
*
|
|
1632
|
+
* @returns Promise<void> — resolve após atualização do estado de visibilidade.
|
|
1633
|
+
*/
|
|
871
1634
|
async close() {
|
|
872
1635
|
this.isPickerOpen = false;
|
|
873
1636
|
}
|
|
874
|
-
/**
|
|
1637
|
+
/**
|
|
1638
|
+
* Alterna o estado de abertura do picker.
|
|
1639
|
+
*
|
|
1640
|
+
* @returns Promise<void> — resolve quando a transição de estado terminar.
|
|
1641
|
+
*/
|
|
875
1642
|
async toggle() {
|
|
876
1643
|
if (this.isPickerOpen) {
|
|
877
1644
|
await this.close();
|
|
@@ -879,20 +1646,32 @@ const DatetimePicker = class {
|
|
|
879
1646
|
}
|
|
880
1647
|
await this.open();
|
|
881
1648
|
}
|
|
882
|
-
/**
|
|
1649
|
+
/**
|
|
1650
|
+
* Move o foco para o input nativo interno.
|
|
1651
|
+
*
|
|
1652
|
+
* @returns Promise<void> — resolve imediatamente após tentar focar o elemento.
|
|
1653
|
+
*/
|
|
883
1654
|
async focusInput() {
|
|
884
|
-
|
|
885
|
-
await input?.focusInput?.();
|
|
1655
|
+
this.getNativeInputElement()?.focus();
|
|
886
1656
|
}
|
|
887
|
-
/**
|
|
1657
|
+
/**
|
|
1658
|
+
* Define um intervalo no modo atual e ativa `selectionMode="range"`.
|
|
1659
|
+
*
|
|
1660
|
+
* Valida datas contra bloqueios e sincroniza estado visual e de formulário.
|
|
1661
|
+
* Em `datetime`, mantém os limites informados e sinaliza intervalo inválido
|
|
1662
|
+
* quando o término precede o início, sem ajustar datas automaticamente.
|
|
1663
|
+
*
|
|
1664
|
+
* @param start Date | string | null — data inicial do intervalo.
|
|
1665
|
+
* @param end Date | string | null — data final do intervalo.
|
|
1666
|
+
* @returns Promise<void> — resolve quando o intervalo for aplicado e sincronizado.
|
|
1667
|
+
*/
|
|
888
1668
|
async setRange(start, end) {
|
|
889
1669
|
if (this.isDisabled()) {
|
|
890
1670
|
return;
|
|
891
1671
|
}
|
|
892
1672
|
this.selectionMode = 'range';
|
|
893
|
-
|
|
894
|
-
const
|
|
895
|
-
const normalizedEnd = this.parseMethodValue(end, DATETIME_PICKER_MODE.DATE);
|
|
1673
|
+
const normalizedStart = this.parseMethodValue(start, this.mode);
|
|
1674
|
+
const normalizedEnd = this.parseMethodValue(end, this.mode);
|
|
896
1675
|
if ((normalizedStart !== null && this.isDateDisabled(normalizedStart)) ||
|
|
897
1676
|
(normalizedEnd !== null && this.isDateDisabled(normalizedEnd))) {
|
|
898
1677
|
this.clearRangeState();
|
|
@@ -900,17 +1679,18 @@ const DatetimePicker = class {
|
|
|
900
1679
|
}
|
|
901
1680
|
this.rangeStart = this.cloneDate(normalizedStart);
|
|
902
1681
|
this.rangeEnd = this.cloneDate(normalizedEnd);
|
|
903
|
-
const nextValue =
|
|
1682
|
+
const nextValue = this.rangeEnd ?? this.rangeStart;
|
|
904
1683
|
this.referenceDate = nextValue === null ? toDateExports.toDate(new Date()) : toDateExports.toDate(nextValue);
|
|
905
1684
|
this.setComponentValue(nextValue);
|
|
906
1685
|
}
|
|
907
1686
|
/**
|
|
908
1687
|
* Retorna o intervalo de datas selecionado quando em modo `selectionMode="range"`.
|
|
909
1688
|
*
|
|
910
|
-
* @returns
|
|
1689
|
+
* @returns Promise<{ start: Date | null; end: Date | null } | null> — objeto com `start`/`end` ou `null` quando
|
|
1690
|
+
* não estiver em modo `range`.
|
|
911
1691
|
*/
|
|
912
1692
|
async getRange() {
|
|
913
|
-
if (this.selectionMode !== 'range'
|
|
1693
|
+
if (this.selectionMode !== 'range') {
|
|
914
1694
|
return null;
|
|
915
1695
|
}
|
|
916
1696
|
return {
|
|
@@ -921,29 +1701,52 @@ const DatetimePicker = class {
|
|
|
921
1701
|
/**
|
|
922
1702
|
* Consulta se o picker está atualmente aberto.
|
|
923
1703
|
*
|
|
924
|
-
* @returns `true` se o picker está visível, `false` caso contrário.
|
|
1704
|
+
* @returns Promise<boolean> — `true` se o picker está visível, `false` caso contrário.
|
|
925
1705
|
*/
|
|
926
1706
|
async isOpen() {
|
|
927
1707
|
return this.isPickerOpen;
|
|
928
1708
|
}
|
|
929
|
-
/**
|
|
1709
|
+
/**
|
|
1710
|
+
* Restaura o estado inicial atualmente registrado para reset.
|
|
1711
|
+
*
|
|
1712
|
+
* @returns Promise<void> — resolve quando a seleção inicial for restaurada.
|
|
1713
|
+
*/
|
|
930
1714
|
async resetToInitial() {
|
|
931
1715
|
this.restoreSelection(this.initialFormValue);
|
|
932
1716
|
}
|
|
933
|
-
/**
|
|
1717
|
+
/**
|
|
1718
|
+
* Permite que consumidores acionem validação nativa do formulário via host.
|
|
1719
|
+
*
|
|
1720
|
+
* @returns Promise<boolean> — resultado da Constraint Validation API para o host.
|
|
1721
|
+
*/
|
|
934
1722
|
async checkValidity() {
|
|
935
1723
|
return this.elementInternals.checkValidity();
|
|
936
1724
|
}
|
|
937
|
-
/**
|
|
1725
|
+
/**
|
|
1726
|
+
* Permite exibir mensagens nativas de validação no host.
|
|
1727
|
+
*
|
|
1728
|
+
* @returns Promise<boolean> — `true` se a mensagem foi exibida e o formulário é válido.
|
|
1729
|
+
*/
|
|
938
1730
|
async reportValidity() {
|
|
939
1731
|
return this.elementInternals.reportValidity();
|
|
940
1732
|
}
|
|
941
|
-
/**
|
|
1733
|
+
/**
|
|
1734
|
+
* Define ou limpa uma mensagem de validade customizada.
|
|
1735
|
+
*
|
|
1736
|
+
* @param message string — mensagem de validação; string vazia remove a mensagem.
|
|
1737
|
+
* @returns Promise<void> — resolve após sincronizar a validade no host.
|
|
1738
|
+
*/
|
|
942
1739
|
async setCustomValidity(message) {
|
|
943
1740
|
this.customValidationMessage = message;
|
|
944
1741
|
this.syncFormValidity();
|
|
945
1742
|
}
|
|
946
|
-
/**
|
|
1743
|
+
/**
|
|
1744
|
+
* Executa o validator customizado (se houver) e valida o controle.
|
|
1745
|
+
*
|
|
1746
|
+
* Emite eventos de início/conclusão da validação e atualiza mensagens internas.
|
|
1747
|
+
*
|
|
1748
|
+
* @returns Promise<boolean> — `true` se a seleção for considerada válida.
|
|
1749
|
+
*/
|
|
947
1750
|
async validate() {
|
|
948
1751
|
const validator = resolveFormValidator(this.validator);
|
|
949
1752
|
if (!validator || this.isDisabled())
|
|
@@ -952,9 +1755,16 @@ const DatetimePicker = class {
|
|
|
952
1755
|
this.isValidating = true;
|
|
953
1756
|
this.validatorMessage = null;
|
|
954
1757
|
this.syncFormValidity();
|
|
955
|
-
this.brDatetimePickerValidationChange.emit({
|
|
1758
|
+
this.brDatetimePickerValidationChange.emit({
|
|
1759
|
+
validating: true,
|
|
1760
|
+
valid: null,
|
|
1761
|
+
message: null,
|
|
1762
|
+
});
|
|
956
1763
|
const value = this.selectionMode === 'range'
|
|
957
|
-
? {
|
|
1764
|
+
? {
|
|
1765
|
+
start: this.cloneDate(this.rangeStart),
|
|
1766
|
+
end: this.cloneDate(this.rangeEnd),
|
|
1767
|
+
}
|
|
958
1768
|
: this.cloneDate(this.value);
|
|
959
1769
|
const message = await runFormValidator(validator, value);
|
|
960
1770
|
if (runId !== this.validationRunId)
|
|
@@ -963,10 +1773,19 @@ const DatetimePicker = class {
|
|
|
963
1773
|
this.isValidating = false;
|
|
964
1774
|
this.syncFormValidity();
|
|
965
1775
|
const valid = message === null && (await this.checkValidity());
|
|
966
|
-
this.brDatetimePickerValidationChange.emit({
|
|
1776
|
+
this.brDatetimePickerValidationChange.emit({
|
|
1777
|
+
validating: false,
|
|
1778
|
+
valid,
|
|
1779
|
+
message,
|
|
1780
|
+
});
|
|
967
1781
|
return valid;
|
|
968
1782
|
}
|
|
969
|
-
/**
|
|
1783
|
+
/**
|
|
1784
|
+
* Retorna um snapshot serializável da Constraint Validation API.
|
|
1785
|
+
*
|
|
1786
|
+
* @returns Promise<FormValidationState> — estado atual de validação do host,
|
|
1787
|
+
* pronto para conversão e restauração via `formStateRestoreCallback`.
|
|
1788
|
+
*/
|
|
970
1789
|
async getValidationState() {
|
|
971
1790
|
return getFormValidationState(this.elementInternals);
|
|
972
1791
|
}
|
|
@@ -978,36 +1797,52 @@ const DatetimePicker = class {
|
|
|
978
1797
|
ensureValidSelectionMode(value) {
|
|
979
1798
|
this.selectionMode = normalizeDatetimePickerSelectionMode(value);
|
|
980
1799
|
}
|
|
981
|
-
/**
|
|
982
|
-
* Normaliza o modo de seleção logo na inicialização.
|
|
983
|
-
*/
|
|
984
1800
|
initializeSelectionMode() {
|
|
985
1801
|
this.handleSelectionModeChange(this.selectionMode);
|
|
986
1802
|
}
|
|
987
|
-
/** Normaliza o dia inicial da semana logo na inicialização. */
|
|
988
1803
|
initializeWeekStartsOn() {
|
|
989
1804
|
this.handleWeekStartsOnChange(this.weekStartsOn);
|
|
990
1805
|
}
|
|
991
|
-
/**
|
|
1806
|
+
/**
|
|
1807
|
+
* Valida o dia inicial da semana e corrige para padrão quando necessário.
|
|
1808
|
+
*
|
|
1809
|
+
* @param value unknown — valor recebido via prop/atributo a ser normalizado.
|
|
1810
|
+
*/
|
|
992
1811
|
ensureValidWeekStartsOn(value) {
|
|
993
1812
|
this.weekStartsOn = normalizeDatetimePickerWeekStartsOn(value);
|
|
994
1813
|
}
|
|
995
|
-
/**
|
|
996
|
-
* Limpa o estado do intervalo de datas ao mudar para modo single.
|
|
997
|
-
*/
|
|
998
1814
|
clearRangeState() {
|
|
999
1815
|
this.rangeStart = null;
|
|
1000
1816
|
this.rangeEnd = null;
|
|
1001
1817
|
this.updateFormInternals();
|
|
1002
1818
|
}
|
|
1003
|
-
/**
|
|
1819
|
+
/**
|
|
1820
|
+
* Materializa os horários exibidos pelos dois timers como limites reais.
|
|
1821
|
+
* Assim o range de horário já nasce completo, o input pode representá-lo na
|
|
1822
|
+
* primeira renderização e nenhum timer depende da referência do outro.
|
|
1823
|
+
*/
|
|
1824
|
+
initializeTimeRangeBoundaries(duringInitialization = false) {
|
|
1825
|
+
if ((!this.isInitialized && !duringInitialization) ||
|
|
1826
|
+
this.selectionMode !== 'range' ||
|
|
1827
|
+
this.mode !== DATETIME_PICKER_MODE.TIME) {
|
|
1828
|
+
return;
|
|
1829
|
+
}
|
|
1830
|
+
const fallback = this.cloneDate(this.value ?? this.referenceDate);
|
|
1831
|
+
if (this.rangeStart === null)
|
|
1832
|
+
this.rangeStart = this.cloneDate(fallback);
|
|
1833
|
+
if (this.rangeEnd === null)
|
|
1834
|
+
this.rangeEnd = this.cloneDate(fallback);
|
|
1835
|
+
this.value = this.cloneDate(this.rangeEnd);
|
|
1836
|
+
}
|
|
1004
1837
|
isRangeDateSelectionMode() {
|
|
1005
|
-
return this.selectionMode === 'range'
|
|
1838
|
+
return this.selectionMode === 'range';
|
|
1006
1839
|
}
|
|
1007
1840
|
/**
|
|
1008
|
-
*
|
|
1841
|
+
* Decide se um evento público deve ser emitido após atualização vinda de
|
|
1842
|
+
* subcomponentes (calendário/relógio).
|
|
1009
1843
|
*
|
|
1010
|
-
*
|
|
1844
|
+
* @param range DatetimePickerDateRange | undefined — estado parcial do range vindo do subcomponente.
|
|
1845
|
+
* @returns boolean — `true` quando o evento deve ser emitido externamente.
|
|
1011
1846
|
*/
|
|
1012
1847
|
resolvePublicEventEmissionForRange(range) {
|
|
1013
1848
|
if (!this.isRangeDateSelectionMode()) {
|
|
@@ -1020,13 +1855,63 @@ const DatetimePicker = class {
|
|
|
1020
1855
|
this.setRangeState(range);
|
|
1021
1856
|
return isFinalRangeClick;
|
|
1022
1857
|
}
|
|
1023
|
-
/**
|
|
1858
|
+
/**
|
|
1859
|
+
* Resolve a data efetivamente selecionada no evento para validações e bloqueios.
|
|
1860
|
+
*
|
|
1861
|
+
* @param range DatetimePickerDateRange | undefined — intervalo parcial (quando aplicável).
|
|
1862
|
+
* @param value Date | null — valor principal vindo do subcomponente.
|
|
1863
|
+
* @returns Date | null — data final a ser considerada para validação.
|
|
1864
|
+
*/
|
|
1024
1865
|
resolveSelectedDateFromEvent(range, value) {
|
|
1025
1866
|
if (!this.isRangeDateSelectionMode() || range === undefined) {
|
|
1026
1867
|
return value;
|
|
1027
1868
|
}
|
|
1028
1869
|
return range.end ?? range.start ?? value;
|
|
1029
1870
|
}
|
|
1871
|
+
/**
|
|
1872
|
+
* Identifica navegação visual que preserva integralmente o range selecionado.
|
|
1873
|
+
*
|
|
1874
|
+
* @param value Date | null — valor principal do evento.
|
|
1875
|
+
* @param range DatetimePickerDateRange | undefined — range parcial do evento.
|
|
1876
|
+
* @returns boolean — `true` quando a navegação não altera a seleção atual.
|
|
1877
|
+
*/
|
|
1878
|
+
isRangeNavigationState(value, range) {
|
|
1879
|
+
return (range !== undefined &&
|
|
1880
|
+
this.sameDate(range.start, this.rangeStart) &&
|
|
1881
|
+
this.sameDate(range.end, this.rangeEnd) &&
|
|
1882
|
+
this.sameDate(value, this.value));
|
|
1883
|
+
}
|
|
1884
|
+
/**
|
|
1885
|
+
* Consolida um evento cujo valor principal permaneceu inalterado.
|
|
1886
|
+
*
|
|
1887
|
+
* @param range DatetimePickerDateRange | undefined — estado parcial do range.
|
|
1888
|
+
* @param shouldEmitPublicEvent boolean — indica se o evento público deve ser emitido.
|
|
1889
|
+
*/
|
|
1890
|
+
handleUnchangedDateState(range, shouldEmitPublicEvent) {
|
|
1891
|
+
this.syncCanonicalValues();
|
|
1892
|
+
const shouldNotifyRange = this.isInitialized && this.isRangeDateSelectionMode() && range !== undefined;
|
|
1893
|
+
if (shouldNotifyRange && shouldEmitPublicEvent) {
|
|
1894
|
+
this.emitDateStateChange();
|
|
1895
|
+
void this.validate();
|
|
1896
|
+
}
|
|
1897
|
+
else if (shouldNotifyRange) {
|
|
1898
|
+
this.emitCanonicalChange(range);
|
|
1899
|
+
}
|
|
1900
|
+
this.updateFormInternals();
|
|
1901
|
+
}
|
|
1902
|
+
/**
|
|
1903
|
+
* Emite a seleção parcial de range quando os eventos públicos foram adiados
|
|
1904
|
+
* para evitar duplicidade com listeners legados.
|
|
1905
|
+
*
|
|
1906
|
+
* @param range DatetimePickerDateRange | undefined — snapshot parcial do range.
|
|
1907
|
+
* @param shouldEmitPublicEvent boolean — se deve ser emitido publicamente.
|
|
1908
|
+
*/
|
|
1909
|
+
emitPendingRangeChange(range, shouldEmitPublicEvent) {
|
|
1910
|
+
if (shouldEmitPublicEvent || !this.isInitialized || !this.isRangeDateSelectionMode() || range === undefined) {
|
|
1911
|
+
return;
|
|
1912
|
+
}
|
|
1913
|
+
this.emitCanonicalChange(range);
|
|
1914
|
+
}
|
|
1030
1915
|
attachOutsideClickListener() {
|
|
1031
1916
|
if (this.outsideClickListenerAttached)
|
|
1032
1917
|
return;
|
|
@@ -1039,15 +1924,9 @@ const DatetimePicker = class {
|
|
|
1039
1924
|
document.removeEventListener('click', this.handleOutsideClick);
|
|
1040
1925
|
this.outsideClickListenerAttached = false;
|
|
1041
1926
|
}
|
|
1042
|
-
/**
|
|
1043
|
-
* Garante que o componente inicie com um modo suportado.
|
|
1044
|
-
*/
|
|
1045
1927
|
initializeMode() {
|
|
1046
1928
|
this.ensureValidMode(this.mode);
|
|
1047
1929
|
}
|
|
1048
|
-
/**
|
|
1049
|
-
* Normaliza a coleção de datas desabilitadas na inicialização.
|
|
1050
|
-
*/
|
|
1051
1930
|
initializeDisabledDates() {
|
|
1052
1931
|
this.syncDisabledDates(this.disabledDates);
|
|
1053
1932
|
}
|
|
@@ -1068,9 +1947,6 @@ const DatetimePicker = class {
|
|
|
1068
1947
|
this.setComponentValue(null);
|
|
1069
1948
|
}
|
|
1070
1949
|
}
|
|
1071
|
-
/**
|
|
1072
|
-
* Aplica a seleção inicial configurada na prop.
|
|
1073
|
-
*/
|
|
1074
1950
|
initializeDefaultValue() {
|
|
1075
1951
|
if (this.value instanceof Date && !Number.isNaN(this.value.getTime())) {
|
|
1076
1952
|
this.referenceDate = toDateExports.toDate(this.value);
|
|
@@ -1111,13 +1987,16 @@ const DatetimePicker = class {
|
|
|
1111
1987
|
this.rangeEnd = null;
|
|
1112
1988
|
this.setComponentValue(selectedDate, shouldEmitEvents);
|
|
1113
1989
|
}
|
|
1114
|
-
/** Indica se o estado serializado deve ser interpretado como intervalo. */
|
|
1115
1990
|
isRangeRestoreMode() {
|
|
1116
|
-
return this.selectionMode === 'range'
|
|
1991
|
+
return this.selectionMode === 'range';
|
|
1117
1992
|
}
|
|
1118
|
-
/**
|
|
1993
|
+
/**
|
|
1994
|
+
* Restaura estado de intervalo a partir do valor serializado do formulário.
|
|
1995
|
+
*
|
|
1996
|
+
* @param serializedState string — valor serializado vindo do formulário.
|
|
1997
|
+
*/
|
|
1119
1998
|
restoreRangeStateFromSerialized(serializedState) {
|
|
1120
|
-
const restoredRange = parseDatetimePickerSerializedRange(serializedState);
|
|
1999
|
+
const restoredRange = parseDatetimePickerSerializedRange(serializedState, this.mode, this.referenceDate);
|
|
1121
2000
|
if (restoredRange === null) {
|
|
1122
2001
|
this.restoreSelection(null);
|
|
1123
2002
|
return;
|
|
@@ -1127,7 +2006,11 @@ const DatetimePicker = class {
|
|
|
1127
2006
|
this.rangeEnd = end;
|
|
1128
2007
|
this.restoreSelection(end);
|
|
1129
2008
|
}
|
|
1130
|
-
/**
|
|
2009
|
+
/**
|
|
2010
|
+
* Restaura estado de seleção única a partir do valor serializado do formulário.
|
|
2011
|
+
*
|
|
2012
|
+
* @param serializedState string — valor serializado vindo do formulário.
|
|
2013
|
+
*/
|
|
1131
2014
|
restoreSingleStateFromSerialized(serializedState) {
|
|
1132
2015
|
const restoredValue = parseDatetimePickerSerializedValue(serializedState, this.mode, this.referenceDate);
|
|
1133
2016
|
if (restoredValue !== null && this.isDateDisabled(restoredValue)) {
|
|
@@ -1136,7 +2019,13 @@ const DatetimePicker = class {
|
|
|
1136
2019
|
}
|
|
1137
2020
|
this.restoreSelection(restoredValue);
|
|
1138
2021
|
}
|
|
1139
|
-
/**
|
|
2022
|
+
/**
|
|
2023
|
+
* Converte entradas aceitas por métodos públicos em `Date | null`.
|
|
2024
|
+
*
|
|
2025
|
+
* @param value Date | string | null — valor bruto recebido pelo método público.
|
|
2026
|
+
* @param mode DatetimePickerMode — modo atual para parsing de strings.
|
|
2027
|
+
* @returns Date | null — representação normalizada ou `null` se inválida.
|
|
2028
|
+
*/
|
|
1140
2029
|
parseMethodValue(value, mode) {
|
|
1141
2030
|
if (value === null) {
|
|
1142
2031
|
return null;
|
|
@@ -1146,7 +2035,11 @@ const DatetimePicker = class {
|
|
|
1146
2035
|
}
|
|
1147
2036
|
return parseDatetimePickerSerializedValue(value, mode, this.referenceDate);
|
|
1148
2037
|
}
|
|
1149
|
-
/**
|
|
2038
|
+
/**
|
|
2039
|
+
* Aplica a ponte serializada usando os mesmos parsers já usados por restore de formulário.
|
|
2040
|
+
*
|
|
2041
|
+
* @param serializedValue string — valor serializado a ser restaurado.
|
|
2042
|
+
*/
|
|
1150
2043
|
restoreSerializedValue(serializedValue) {
|
|
1151
2044
|
if (this.isRangeRestoreMode()) {
|
|
1152
2045
|
this.restoreRangeStateFromSerialized(serializedValue);
|
|
@@ -1165,7 +2058,11 @@ const DatetimePicker = class {
|
|
|
1165
2058
|
this.valueAsDate = nextValueAsDate;
|
|
1166
2059
|
this.syncingCanonicalValues = false;
|
|
1167
2060
|
}
|
|
1168
|
-
/**
|
|
2061
|
+
/**
|
|
2062
|
+
* Retorna o mesmo valor que será submetido pelo ElementInternals.
|
|
2063
|
+
*
|
|
2064
|
+
* @returns string — valor serializado pronto para `setFormValue`.
|
|
2065
|
+
*/
|
|
1169
2066
|
getSerializedValue() {
|
|
1170
2067
|
const zero = (date) => (date === null ? null : setExports.set(date, { seconds: 0, milliseconds: 0 }));
|
|
1171
2068
|
return (serializeDatetimePickerFormValue(this.value === null ? null : zero(this.value), {
|
|
@@ -1179,11 +2076,24 @@ const DatetimePicker = class {
|
|
|
1179
2076
|
sameDate(left, right) {
|
|
1180
2077
|
return left === right || (left !== null && right !== null && left.getTime() === right.getTime());
|
|
1181
2078
|
}
|
|
1182
|
-
/**
|
|
2079
|
+
/**
|
|
2080
|
+
* Busca o input nativo interno para ações imperativas de foco.
|
|
2081
|
+
*
|
|
2082
|
+
* @returns HTMLElement | undefined — elemento `input` nativo interno, quando disponível.
|
|
2083
|
+
*/
|
|
1183
2084
|
getNativeInputElement() {
|
|
1184
|
-
return
|
|
2085
|
+
return this.el.shadowRoot
|
|
2086
|
+
?.querySelector('br-datetime-input')
|
|
2087
|
+
?.shadowRoot?.querySelector('br-input')
|
|
2088
|
+
?.shadowRoot?.querySelector('input');
|
|
1185
2089
|
}
|
|
1186
|
-
/**
|
|
2090
|
+
/**
|
|
2091
|
+
* Atualiza estado interno, FormData e validação com uma única chamada.
|
|
2092
|
+
*
|
|
2093
|
+
* @param nextValue Date | null — próximo valor a ser aplicado no componente.
|
|
2094
|
+
* @param shouldEmitPublicEvent boolean — controla emissão de eventos públicos.
|
|
2095
|
+
* @returns void
|
|
2096
|
+
*/
|
|
1187
2097
|
setComponentValue(nextValue, shouldEmitPublicEvent = true) {
|
|
1188
2098
|
this.value = this.cloneDate(nextValue);
|
|
1189
2099
|
this.syncCanonicalValues();
|
|
@@ -1195,13 +2105,13 @@ const DatetimePicker = class {
|
|
|
1195
2105
|
}
|
|
1196
2106
|
/** Propaga o estado atual consolidado para consumidores externos do componente raiz. */
|
|
1197
2107
|
emitDateStateChange() {
|
|
1198
|
-
const range = this.selectionMode === 'range'
|
|
2108
|
+
const range = this.selectionMode === 'range'
|
|
1199
2109
|
? {
|
|
1200
2110
|
start: this.cloneDate(this.rangeStart),
|
|
1201
2111
|
end: this.cloneDate(this.rangeEnd),
|
|
1202
2112
|
}
|
|
1203
2113
|
: undefined;
|
|
1204
|
-
const rangeDates = range !== undefined && range.start !== null && range.end !== null
|
|
2114
|
+
const rangeDates = this.mode === DATETIME_PICKER_MODE.DATE && range !== undefined && range.start !== null && range.end !== null
|
|
1205
2115
|
? this.buildRangeDatesState(range.start, range.end)
|
|
1206
2116
|
: undefined;
|
|
1207
2117
|
this.dateStateChange.emit({
|
|
@@ -1210,13 +2120,116 @@ const DatetimePicker = class {
|
|
|
1210
2120
|
range,
|
|
1211
2121
|
rangeDates,
|
|
1212
2122
|
});
|
|
1213
|
-
|
|
1214
|
-
this.rangeValue = range;
|
|
2123
|
+
this.emitCanonicalChange(range);
|
|
1215
2124
|
this.valueChange.emit(this.cloneDate(this.value));
|
|
1216
2125
|
dispatchNativeFormEvent(this.el, 'input');
|
|
1217
2126
|
dispatchNativeFormEvent(this.el, 'change');
|
|
1218
2127
|
}
|
|
1219
|
-
/**
|
|
2128
|
+
/** Emite o contrato público sem expor detalhes incidentais do estado interno. */
|
|
2129
|
+
emitCanonicalChange(rangeSnapshot) {
|
|
2130
|
+
const serializedValue = this.getSerializedValue();
|
|
2131
|
+
if (this.selectionMode === 'range') {
|
|
2132
|
+
const range = rangeSnapshot ?? {
|
|
2133
|
+
start: this.rangeStart,
|
|
2134
|
+
end: this.rangeEnd,
|
|
2135
|
+
};
|
|
2136
|
+
const rangeValue = {
|
|
2137
|
+
start: this.cloneDate(range.start),
|
|
2138
|
+
end: this.cloneDate(range.end),
|
|
2139
|
+
};
|
|
2140
|
+
this.syncingRangeValueInternally = true;
|
|
2141
|
+
this.rangeValue = rangeValue;
|
|
2142
|
+
this.syncingRangeValueInternally = false;
|
|
2143
|
+
const value = {
|
|
2144
|
+
start: this.serializeRangeBoundary(rangeValue.start),
|
|
2145
|
+
end: this.serializeRangeBoundary(rangeValue.end),
|
|
2146
|
+
};
|
|
2147
|
+
const detail = {
|
|
2148
|
+
selectionMode: 'range',
|
|
2149
|
+
value,
|
|
2150
|
+
serializedValue,
|
|
2151
|
+
complete: value.start !== null && value.end !== null,
|
|
2152
|
+
};
|
|
2153
|
+
if (this.mode === DATETIME_PICKER_MODE.DATE) {
|
|
2154
|
+
this.brDatetimePickerChange.emit({ mode: 'date', ...detail });
|
|
2155
|
+
}
|
|
2156
|
+
else if (this.mode === DATETIME_PICKER_MODE.TIME) {
|
|
2157
|
+
this.brDatetimePickerChange.emit({ mode: 'time', ...detail });
|
|
2158
|
+
}
|
|
2159
|
+
else {
|
|
2160
|
+
this.brDatetimePickerChange.emit({ mode: 'datetime', ...detail });
|
|
2161
|
+
}
|
|
2162
|
+
return;
|
|
2163
|
+
}
|
|
2164
|
+
if (this.mode === DATETIME_PICKER_MODE.TIME) {
|
|
2165
|
+
this.brDatetimePickerChange.emit({
|
|
2166
|
+
mode: 'time',
|
|
2167
|
+
selectionMode: 'single',
|
|
2168
|
+
value: this.value === null
|
|
2169
|
+
? null
|
|
2170
|
+
: {
|
|
2171
|
+
hours: this.value.getHours(),
|
|
2172
|
+
minutes: this.value.getMinutes(),
|
|
2173
|
+
},
|
|
2174
|
+
serializedValue,
|
|
2175
|
+
});
|
|
2176
|
+
return;
|
|
2177
|
+
}
|
|
2178
|
+
if (this.mode === DATETIME_PICKER_MODE.DATE) {
|
|
2179
|
+
this.brDatetimePickerChange.emit({
|
|
2180
|
+
mode: 'date',
|
|
2181
|
+
selectionMode: 'single',
|
|
2182
|
+
value: this.cloneDate(this.value),
|
|
2183
|
+
serializedValue,
|
|
2184
|
+
});
|
|
2185
|
+
return;
|
|
2186
|
+
}
|
|
2187
|
+
this.brDatetimePickerChange.emit({
|
|
2188
|
+
mode: 'datetime',
|
|
2189
|
+
selectionMode: 'single',
|
|
2190
|
+
value: this.cloneDate(this.value),
|
|
2191
|
+
serializedValue,
|
|
2192
|
+
});
|
|
2193
|
+
}
|
|
2194
|
+
/**
|
|
2195
|
+
* Serializa uma data civil sem conversão para UTC ou mudança de dia.
|
|
2196
|
+
*
|
|
2197
|
+
* @param value Date — data a serializar (somente componente civil).
|
|
2198
|
+
* @returns string — formato `YYYY-MM-DD`.
|
|
2199
|
+
*/
|
|
2200
|
+
serializeDateOnly(value) {
|
|
2201
|
+
const year = String(value.getFullYear()).padStart(4, '0');
|
|
2202
|
+
const month = String(value.getMonth() + 1).padStart(2, '0');
|
|
2203
|
+
const day = String(value.getDate()).padStart(2, '0');
|
|
2204
|
+
return `${year}-${month}-${day}`;
|
|
2205
|
+
}
|
|
2206
|
+
/**
|
|
2207
|
+
* Serializa um limite do intervalo conforme o modo sem expor objetos Date no payload.
|
|
2208
|
+
*
|
|
2209
|
+
* @param value Date | null — limite a serializar.
|
|
2210
|
+
* @returns string | null — representação serializada do limite ou `null`.
|
|
2211
|
+
*/
|
|
2212
|
+
serializeRangeBoundary(value) {
|
|
2213
|
+
if (value === null)
|
|
2214
|
+
return null;
|
|
2215
|
+
if (this.mode === DATETIME_PICKER_MODE.DATE)
|
|
2216
|
+
return this.serializeDateOnly(value);
|
|
2217
|
+
if (this.mode === DATETIME_PICKER_MODE.TIME) {
|
|
2218
|
+
return `${String(value.getHours()).padStart(2, '0')}:${String(value.getMinutes()).padStart(2, '0')}`;
|
|
2219
|
+
}
|
|
2220
|
+
return serializeDatetimePickerFormValue(value, {
|
|
2221
|
+
mode: DATETIME_PICKER_MODE.DATETIME,
|
|
2222
|
+
selectionMode: 'single',
|
|
2223
|
+
rangeStart: null,
|
|
2224
|
+
rangeEnd: null});
|
|
2225
|
+
}
|
|
2226
|
+
/**
|
|
2227
|
+
* Expande o intervalo completo e marca quais dias estão desabilitados.
|
|
2228
|
+
*
|
|
2229
|
+
* @param start Date — início do intervalo.
|
|
2230
|
+
* @param end Date — fim do intervalo.
|
|
2231
|
+
* @returns Array<{date: Date, disabled: boolean}> — lista diária com flags.
|
|
2232
|
+
*/
|
|
1220
2233
|
buildRangeDatesState(start, end) {
|
|
1221
2234
|
const intervalStart = start.getTime() <= end.getTime() ? start : end;
|
|
1222
2235
|
const intervalEnd = start.getTime() <= end.getTime() ? end : start;
|
|
@@ -1228,8 +2241,13 @@ const DatetimePicker = class {
|
|
|
1228
2241
|
disabled: this.isDateDisabled(date),
|
|
1229
2242
|
}));
|
|
1230
2243
|
}
|
|
1231
|
-
/**
|
|
2244
|
+
/**
|
|
2245
|
+
* Restaura seleção e data de referência a partir de uma data já validada.
|
|
2246
|
+
*
|
|
2247
|
+
* @param nextValue Date | null — valor validado a ser restaurado como seleção.
|
|
2248
|
+
*/
|
|
1232
2249
|
restoreSelection(nextValue) {
|
|
2250
|
+
this.inputValidationMessage = '';
|
|
1233
2251
|
this.value = this.cloneDate(nextValue);
|
|
1234
2252
|
if (this.selectionMode === 'single') {
|
|
1235
2253
|
this.rangeStart = null;
|
|
@@ -1239,12 +2257,15 @@ const DatetimePicker = class {
|
|
|
1239
2257
|
this.syncCanonicalValues();
|
|
1240
2258
|
this.updateFormInternals();
|
|
1241
2259
|
}
|
|
1242
|
-
/**
|
|
2260
|
+
/**
|
|
2261
|
+
* Atualiza o estado local de intervalo a partir do evento do calendário.
|
|
2262
|
+
*
|
|
2263
|
+
* @param nextRange DatetimePickerDateRange | undefined — novo snapshot do intervalo.
|
|
2264
|
+
*/
|
|
1243
2265
|
setRangeState(nextRange) {
|
|
1244
2266
|
this.rangeStart = this.cloneDate(nextRange?.start ?? null);
|
|
1245
2267
|
this.rangeEnd = this.cloneDate(nextRange?.end ?? null);
|
|
1246
2268
|
}
|
|
1247
|
-
/** Mantém ElementInternals sincronizado com estado e regras do componente. */
|
|
1248
2269
|
updateFormInternals() {
|
|
1249
2270
|
this.syncFormValue();
|
|
1250
2271
|
this.syncFormValidity();
|
|
@@ -1264,9 +2285,20 @@ const DatetimePicker = class {
|
|
|
1264
2285
|
});
|
|
1265
2286
|
this.elementInternals.setFormValue(nextValue);
|
|
1266
2287
|
}
|
|
1267
|
-
catch {
|
|
1268
|
-
|
|
1269
|
-
|
|
2288
|
+
catch { }
|
|
2289
|
+
}
|
|
2290
|
+
/** Deriva o erro de ordenação sem modificar os limites escolhidos. */
|
|
2291
|
+
getRangeOrderValidationMessage() {
|
|
2292
|
+
const invalidRange = this.selectionMode === 'range' &&
|
|
2293
|
+
this.mode !== DATETIME_PICKER_MODE.TIME &&
|
|
2294
|
+
this.rangeStart !== null &&
|
|
2295
|
+
this.rangeEnd !== null &&
|
|
2296
|
+
this.rangeStart.getTime() > this.rangeEnd.getTime();
|
|
2297
|
+
if (!invalidRange)
|
|
2298
|
+
return '';
|
|
2299
|
+
return this.mode === DATETIME_PICKER_MODE.DATETIME
|
|
2300
|
+
? DATETIME_RANGE_ORDER_MESSAGE
|
|
2301
|
+
: 'A data inicial deve anteceder a data final.';
|
|
1270
2302
|
}
|
|
1271
2303
|
/** Espelha a regra de required no mecanismo nativo de validade. */
|
|
1272
2304
|
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: consolida flags nativos relacionados sem esconder a precedência das mensagens.
|
|
@@ -1276,54 +2308,43 @@ const DatetimePicker = class {
|
|
|
1276
2308
|
required: this.required,
|
|
1277
2309
|
disabled: this.isDisabled(),
|
|
1278
2310
|
value: this.value,
|
|
1279
|
-
mode: this.mode,
|
|
1280
2311
|
selectionMode: this.selectionMode,
|
|
1281
2312
|
rangeStart: this.rangeStart,
|
|
1282
2313
|
rangeEnd: this.rangeEnd});
|
|
1283
|
-
const min = this.parseConstraintValue(this.min
|
|
1284
|
-
const max = this.parseConstraintValue(this.max
|
|
2314
|
+
const min = this.parseConstraintValue(this.min);
|
|
2315
|
+
const max = this.parseConstraintValue(this.max);
|
|
1285
2316
|
const values = this.selectionMode === 'range' ? [this.rangeStart, this.rangeEnd] : [this.value];
|
|
1286
2317
|
const rangeUnderflow = min !== null && values.some((value) => value !== null && value.getTime() < min.getTime());
|
|
1287
2318
|
const rangeOverflow = max !== null && values.some((value) => value !== null && value.getTime() > max.getTime());
|
|
1288
|
-
const
|
|
1289
|
-
this.rangeStart !== null &&
|
|
1290
|
-
this.rangeEnd !== null &&
|
|
1291
|
-
this.rangeStart.getTime() > this.rangeEnd.getTime();
|
|
2319
|
+
const rangeOrderMessage = this.getRangeOrderValidationMessage();
|
|
1292
2320
|
const flags = {
|
|
1293
|
-
customError: this.customValidationMessage !== '' ||
|
|
2321
|
+
customError: this.customValidationMessage !== '' ||
|
|
2322
|
+
this.inputValidationMessage !== '' ||
|
|
2323
|
+
Boolean(this.validatorMessage) ||
|
|
2324
|
+
rangeOrderMessage !== '' ||
|
|
2325
|
+
this.inputValidationPending,
|
|
1294
2326
|
rangeOverflow,
|
|
1295
2327
|
rangeUnderflow,
|
|
1296
2328
|
valueMissing: missing,
|
|
1297
2329
|
};
|
|
1298
2330
|
const message = this.customValidationMessage ||
|
|
2331
|
+
this.inputValidationMessage ||
|
|
1299
2332
|
this.validatorMessage ||
|
|
1300
2333
|
(missing
|
|
1301
2334
|
? 'Preencha este campo.'
|
|
1302
|
-
:
|
|
1303
|
-
?
|
|
2335
|
+
: rangeOrderMessage
|
|
2336
|
+
? rangeOrderMessage
|
|
1304
2337
|
: rangeUnderflow
|
|
1305
2338
|
? 'Selecione uma data igual ou posterior ao mínimo.'
|
|
1306
2339
|
: rangeOverflow
|
|
1307
2340
|
? 'Selecione uma data igual ou anterior ao máximo.'
|
|
1308
2341
|
: '');
|
|
1309
|
-
setFormValidity(this.elementInternals, flags, message, this.getNativeInputElement());
|
|
1310
|
-
}
|
|
1311
|
-
catch {
|
|
1312
|
-
// Ambientes sem ElementInternals completo não devem falhar.
|
|
2342
|
+
setFormValidity(this.elementInternals, flags, message, this.getNativeInputElement() ?? undefined);
|
|
1313
2343
|
}
|
|
2344
|
+
catch { }
|
|
1314
2345
|
}
|
|
1315
|
-
parseConstraintValue(value
|
|
1316
|
-
|
|
1317
|
-
return null;
|
|
1318
|
-
if (!(value instanceof Date) && typeof value !== 'string') {
|
|
1319
|
-
reportInvalidPropValue(this.el, propertyName, value, 'Informe uma data válida como Date ou string compatível com o modo atual.', 'Aplicando fallback null (sem limite).');
|
|
1320
|
-
return null;
|
|
1321
|
-
}
|
|
1322
|
-
const parsedValue = this.parseMethodValue(value, this.mode);
|
|
1323
|
-
if (parsedValue !== null)
|
|
1324
|
-
return parsedValue;
|
|
1325
|
-
reportInvalidPropValue(this.el, propertyName, value, 'Informe uma data válida como Date ou string compatível com o modo atual.', 'Aplicando fallback null (sem limite).');
|
|
1326
|
-
return null;
|
|
2346
|
+
parseConstraintValue(value) {
|
|
2347
|
+
return value === null ? null : this.parseMethodValue(value, this.mode);
|
|
1327
2348
|
}
|
|
1328
2349
|
isDisabled() {
|
|
1329
2350
|
return isFormControlDisabled(this.disabled, this.formDisabled);
|
|
@@ -1381,24 +2402,35 @@ const DatetimePicker = class {
|
|
|
1381
2402
|
}
|
|
1382
2403
|
/** Renderiza o campo de entrada responsável por abrir e sincronizar o picker. */
|
|
1383
2404
|
renderInputField() {
|
|
1384
|
-
return (h("br-datetime-input", {
|
|
1385
|
-
this.datetimeInputElement = element;
|
|
1386
|
-
}, referenceDate: this.referenceDate, value: this.value, selectionMode: this.selectionMode, rangeStart: this.rangeStart, rangeEnd: this.rangeEnd, placeholder: this.placeholder, mode: this.mode, disabled: this.isDisabled(), onDateStateChange: this.handleDateStateChange, onTogglePicker: this.handleTogglePicker, exportparts: "container: input-container, input: input-field, icon: input-icon" }));
|
|
2405
|
+
return (h("br-datetime-input", { referenceDate: this.referenceDate, value: this.value, selectionMode: this.selectionMode, rangeStart: this.rangeStart, rangeEnd: this.rangeEnd, placeholder: this.placeholder, mode: this.mode, disabled: this.isDisabled(), onDateStateChange: this.handleDateStateChange, onInputValidationChange: this.handleInputValidationChange, onTogglePicker: this.handleTogglePicker, exportparts: "container: input-container, input: input-field, icon: input-icon" }));
|
|
1387
2406
|
}
|
|
1388
2407
|
/** Renderiza apenas o seletor de data. */
|
|
1389
2408
|
renderDatePicker() {
|
|
1390
|
-
const effectiveSelectionMode = this.
|
|
2409
|
+
const effectiveSelectionMode = this.selectionMode;
|
|
1391
2410
|
return (h("br-date-picker", { ...this.getSharedDateStateBindings(), selectionMode: effectiveSelectionMode, weekStartsOn: this.weekStartsOn, locale: this.locale, disabled: this.isDisabled(), disabledDates: this.normalizedDisabledDates, fixedRowCount: this.fixedRowCount }));
|
|
1392
2411
|
}
|
|
1393
|
-
/** Renderiza
|
|
1394
|
-
renderTimePicker() {
|
|
1395
|
-
|
|
2412
|
+
/** Renderiza um seletor de hora simples ou um limite do intervalo. */
|
|
2413
|
+
renderTimePicker(boundary) {
|
|
2414
|
+
const rangeValue = boundary === 'start' ? this.rangeStart : this.rangeEnd;
|
|
2415
|
+
const referenceDate = this.cloneDate(rangeValue ?? this.referenceDate);
|
|
2416
|
+
const selectedValue = this.cloneDate(rangeValue);
|
|
2417
|
+
const timerKey = boundary === undefined ? 'single' : `${boundary}-${rangeValue?.getTime() ?? `empty-${referenceDate.getTime()}`}`;
|
|
2418
|
+
const handler = boundary === 'start'
|
|
2419
|
+
? this.handleRangeStartTimeStateChange
|
|
2420
|
+
: boundary === 'end'
|
|
2421
|
+
? this.handleRangeEndTimeStateChange
|
|
2422
|
+
: this.handleDateStateChange;
|
|
2423
|
+
return (h("br-time-picker", { key: timerKey, referenceDate: referenceDate, value: boundary === undefined ? this.cloneDate(this.value) : selectedValue, onDateStateChange: handler, disabled: this.isDisabled() }));
|
|
2424
|
+
}
|
|
2425
|
+
/** Renderiza os horários inicial e final lado a lado no modo range. */
|
|
2426
|
+
renderRangeTimePickers() {
|
|
2427
|
+
return (h("div", { class: "range-time-pickers", role: "group", "aria-label": "Intervalo de hor\u00E1rios" }, h("div", { class: "range-time-picker" }, h("span", { class: "range-time-label" }, "In\u00EDcio"), this.renderTimePicker('start')), h("span", { class: "range-time-separator", "aria-hidden": "true" }, "-"), h("div", { class: "range-time-picker" }, h("span", { class: "range-time-label" }, "Fim"), this.renderTimePicker('end'))));
|
|
1396
2428
|
}
|
|
1397
2429
|
/**
|
|
1398
2430
|
* Renderiza a combinação de data e horário no modo `datetime`.
|
|
1399
2431
|
*/
|
|
1400
2432
|
renderDateTimePicker() {
|
|
1401
|
-
return (h(Fragment, null, this.renderDatePicker(), this.renderDivider(), this.renderTimePicker()));
|
|
2433
|
+
return (h(Fragment, null, this.renderDatePicker(), this.renderDivider(), this.selectionMode === 'range' ? this.renderRangeTimePickers() : this.renderTimePicker()));
|
|
1402
2434
|
}
|
|
1403
2435
|
/** Renderiza o separador visual entre data e hora no modo combinado. */
|
|
1404
2436
|
renderDivider() {
|
|
@@ -1418,7 +2450,11 @@ const DatetimePicker = class {
|
|
|
1418
2450
|
* Renderização principal do componente.
|
|
1419
2451
|
*/
|
|
1420
2452
|
render() {
|
|
1421
|
-
|
|
2453
|
+
const validationMessage = this.customValidationMessage ||
|
|
2454
|
+
this.inputValidationMessage ||
|
|
2455
|
+
this.validatorMessage ||
|
|
2456
|
+
(this.inputValidationPending ? '' : this.getRangeOrderValidationMessage());
|
|
2457
|
+
return (h(Host, { key: '0640504e844713daaf31d7c8a34b96fb48bcf499', onKeyDown: this.handlePickerKeydown, "aria-busy": this.isValidating ? 'true' : null, "aria-describedby": this.hasFeedbackSlot || validationMessage ? this.feedbackId : null, "aria-errormessage": validationMessage || this.hasFeedbackSlot ? this.feedbackId : null }, h("div", { key: '7512ed8a4437a99d6d0702351af659bfa1d270b0', class: this.getCssClassMap(), part: "container" }, this.renderInputField(), this.renderPickerContent()), h("div", { key: '80a8d3a717ceacc4dfb6bd0ac4850b61e3b2d311', id: this.feedbackId, part: "feedback", hidden: !this.hasFeedbackSlot && !validationMessage }, h("slot", { key: '41a8e4fad5edaa3729d63b7ee469f248a53129a1', name: "feedback", onSlotchange: (event) => (this.hasFeedbackSlot = hasAssignedSlotContent(event.currentTarget)) }), !this.hasFeedbackSlot && validationMessage ? (h("br-message", { state: "danger", "attr:message": validationMessage, feedback: true })) : null)));
|
|
1422
2458
|
}
|
|
1423
2459
|
static get formAssociated() { return true; }
|
|
1424
2460
|
get el() { return getElement(this); }
|