@govbr-ds/webcomponents 2.2.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +75 -24
- package/cem/custom-elements.json +1858 -1712
- package/cem/webcomponents.html-custom-data.json +73 -67
- package/dist/cjs/br-avatar.cjs.entry.js +2 -2
- package/dist/cjs/br-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/br-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/br-button_2.cjs.entry.js +10 -5
- package/dist/cjs/br-card.cjs.entry.js +2 -2
- package/dist/cjs/br-carousel-page.cjs.entry.js +2 -2
- package/dist/cjs/br-carousel.cjs.entry.js +2 -2
- package/dist/cjs/br-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/br-checkbox.cjs.entry.js +3 -3
- package/dist/cjs/br-checkgroup.cjs.entry.js +1 -1
- package/dist/cjs/br-collapse_2.cjs.entry.js +11 -7
- package/dist/cjs/br-cookiebar-cookie.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar-group.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar-header.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar-link.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar-note-group.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar-note.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar.cjs.entry.js +2 -2
- package/dist/cjs/br-crumb.cjs.entry.js +1 -1
- package/dist/cjs/br-date-picker_3.cjs.entry.js +869 -517
- package/dist/cjs/br-datetime-picker.cjs.entry.js +1347 -311
- package/dist/cjs/br-divider.cjs.entry.js +2 -2
- package/dist/cjs/br-dropdown_2.cjs.entry.js +282 -165
- package/dist/cjs/br-footer-category.cjs.entry.js +2 -2
- package/dist/cjs/br-footer-item.cjs.entry.js +2 -2
- package/dist/cjs/br-footer-legal.cjs.entry.js +2 -2
- package/dist/cjs/br-footer-logo.cjs.entry.js +2 -2
- package/dist/cjs/br-footer-social.cjs.entry.js +2 -2
- package/dist/cjs/br-footer.cjs.entry.js +2 -2
- package/dist/cjs/br-header-function.cjs.entry.js +2 -2
- package/dist/cjs/br-header-link.cjs.entry.js +2 -2
- package/dist/cjs/br-header-list.cjs.entry.js +2 -2
- package/dist/cjs/br-header-logo.cjs.entry.js +2 -2
- package/dist/cjs/br-header.cjs.entry.js +27 -23
- package/dist/cjs/br-icon.cjs.entry.js +4 -33
- package/dist/cjs/br-input.cjs.entry.js +31 -6
- package/dist/cjs/br-item.cjs.entry.js +5 -4
- package/dist/cjs/br-link.cjs.entry.js +2 -2
- package/dist/cjs/br-loading.cjs.entry.js +2 -2
- package/dist/cjs/br-magic-button.cjs.entry.js +21 -8
- package/dist/cjs/br-menu-group.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-header.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-info.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-link.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-list.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-logo.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-social.cjs.entry.js +2 -2
- package/dist/cjs/br-menu.cjs.entry.js +2 -2
- package/dist/cjs/br-modal.cjs.entry.js +20 -4
- package/dist/cjs/br-notification-body.cjs.entry.js +2 -2
- package/dist/cjs/br-notification-header.cjs.entry.js +2 -2
- package/dist/cjs/br-notification-item.cjs.entry.js +2 -2
- package/dist/cjs/br-notification.cjs.entry.js +2 -2
- package/dist/cjs/br-pagination.cjs.entry.js +4 -4
- package/dist/cjs/br-radio-group.cjs.entry.js +3 -3
- package/dist/cjs/br-radio.cjs.entry.js +3 -3
- package/dist/cjs/br-scrim.cjs.entry.js +2 -2
- package/dist/cjs/br-select-input_3.cjs.entry.js +286 -100
- package/dist/cjs/br-sign-in.cjs.entry.js +8 -4
- package/dist/cjs/br-skip-link-item.cjs.entry.js +1 -1
- package/dist/cjs/br-skip-link.cjs.entry.js +2 -2
- package/dist/cjs/br-skiplink-item.cjs.entry.js +2 -2
- package/dist/cjs/br-slider.cjs.entry.js +3 -3
- package/dist/cjs/br-step_2.cjs.entry.js +3 -3
- package/dist/cjs/br-switch.cjs.entry.js +3 -3
- package/dist/cjs/br-tab-item.cjs.entry.js +3 -3
- package/dist/cjs/br-tab.cjs.entry.js +38 -13
- package/dist/cjs/br-table-body.cjs.entry.js +2 -2
- package/dist/cjs/br-table-cell.cjs.entry.js +2 -2
- package/dist/cjs/br-table-header-cell.cjs.entry.js +2 -2
- package/dist/cjs/br-table-header.cjs.entry.js +2 -2
- package/dist/cjs/br-table-row.cjs.entry.js +2 -2
- package/dist/cjs/br-table.cjs.entry.js +2 -2
- package/dist/cjs/br-tag.cjs.entry.js +3 -3
- package/dist/cjs/br-textarea.cjs.entry.js +3 -3
- package/dist/cjs/br-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/br-upload.cjs.entry.js +7 -23
- package/dist/cjs/br-wizard-panel.cjs.entry.js +2 -2
- package/dist/cjs/br-wizard.cjs.entry.js +2 -2
- package/dist/cjs/{datetime-picker-constants-B5pWeOn1.js → datetime-picker-constants-CCeI5iW7.js} +20 -5
- package/dist/cjs/format-bytes-Cs8SH2w0.js +24 -0
- package/dist/cjs/icon.utils-DF6kMskA.js +46 -0
- package/dist/cjs/{index-CGgZBuyy.js → index-Bc30P_6z.js} +33 -27
- package/dist/cjs/{index-C92n55ch.js → index-C-IpVFDH.js} +13 -13
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{datetime-picker-props-validation-DmNKSXsy.js → isValid-CduHZTFc.js} +1 -483
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/select.utils-C38f5Kea.js +62 -0
- package/dist/cjs/{validator-CTCajtT9.js → validator-GkkueMOx.js} +18 -0
- package/dist/cjs/webcomponents.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/avatar/avatar.css +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.css +1 -1
- package/dist/collection/components/button/button.css +1 -1
- package/dist/collection/components/button/button.js +8 -3
- package/dist/collection/components/card/card.css +1 -1
- package/dist/collection/components/carousel/carousel-page/carousel-page.css +1 -1
- package/dist/collection/components/carousel/carousel.css +1 -1
- package/dist/collection/components/checkbox/checkbox.css +1 -1
- package/dist/collection/components/checkbox-group/checkbox-group.css +1 -1
- package/dist/collection/components/collapse/collapse.css +1 -1
- package/dist/collection/components/collapse/collapse.js +12 -6
- package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar.css +1 -1
- package/dist/collection/components/datetime-picker/date-picker/date-picker-locale.js +12 -12
- package/dist/collection/components/datetime-picker/date-picker/date-picker-props-validation.js +14 -13
- package/dist/collection/components/datetime-picker/date-picker/date-picker.css +1 -1
- package/dist/collection/components/datetime-picker/date-picker/date-picker.js +384 -280
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input-constants.js +59 -0
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input-props-validation.js +19 -15
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.css +1 -1
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.js +373 -211
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.types.js +1 -0
- package/dist/collection/components/datetime-picker/datetime-picker-constants.js +19 -5
- package/dist/collection/components/datetime-picker/datetime-picker-form-associated.js +92 -11
- package/dist/collection/components/datetime-picker/datetime-picker-props-validation.js +52 -33
- package/dist/collection/components/datetime-picker/datetime-picker.css +1 -1
- package/dist/collection/components/datetime-picker/datetime-picker.js +915 -362
- package/dist/collection/components/datetime-picker/datetime-picker.utils.js +62 -49
- package/dist/collection/components/datetime-picker/time-picker/time-picker-constants.js +3 -2
- package/dist/collection/components/datetime-picker/time-picker/time-picker.css +1 -1
- package/dist/collection/components/datetime-picker/time-picker/time-picker.js +148 -85
- package/dist/collection/components/divider/divider.css +1 -1
- package/dist/collection/components/dropdown/dropdown.css +1 -1
- package/dist/collection/components/dropdown/dropdown.js +32 -36
- package/dist/collection/components/footer/footer-category/footer-category.css +1 -1
- package/dist/collection/components/footer/footer-item/footer-item.css +1 -1
- package/dist/collection/components/footer/footer-legal/footer-legal.css +1 -1
- package/dist/collection/components/footer/footer-logo/footer-logo.css +1 -1
- package/dist/collection/components/footer/footer-social/footer-social.css +1 -1
- package/dist/collection/components/footer/footer.css +1 -1
- package/dist/collection/components/header/header-function/header-function.css +1 -1
- package/dist/collection/components/header/header-link/header-link.css +1 -1
- package/dist/collection/components/header/header-list/header-list.css +1 -1
- package/dist/collection/components/header/header-logo/header-logo.css +1 -1
- package/dist/collection/components/header/header.css +1 -1
- package/dist/collection/components/header/header.js +25 -21
- package/dist/collection/components/icon/icon.css +1 -1
- package/dist/collection/components/icon/icon.utils.js +8 -0
- package/dist/collection/components/input/input.css +1 -1
- package/dist/collection/components/input/input.js +50 -4
- package/dist/collection/components/item/item.css +1 -1
- package/dist/collection/components/item/item.js +4 -3
- package/dist/collection/components/link/link.css +1 -1
- package/dist/collection/components/list/list.css +1 -1
- package/dist/collection/components/loading/loading.css +1 -1
- package/dist/collection/components/magic-button/magic-button.css +1 -1
- package/dist/collection/components/magic-button/magic-button.js +20 -6
- package/dist/collection/components/menu/menu-group/menu-group.css +1 -1
- package/dist/collection/components/menu/menu-header/menu-header.css +1 -1
- package/dist/collection/components/menu/menu-info/menu-info.css +1 -1
- package/dist/collection/components/menu/menu-item/menu-item.css +1 -1
- package/dist/collection/components/menu/menu-link/menu-link.css +1 -1
- package/dist/collection/components/menu/menu-list/menu-list.css +1 -1
- package/dist/collection/components/menu/menu-logo/menu-logo.css +1 -1
- package/dist/collection/components/menu/menu-social/menu-social.css +1 -1
- package/dist/collection/components/menu/menu.css +1 -1
- package/dist/collection/components/message/message.css +1 -1
- package/dist/collection/components/modal/modal.css +1 -1
- package/dist/collection/components/modal/modal.js +19 -3
- package/dist/collection/components/notification/notification-body/notification-body.css +1 -1
- package/dist/collection/components/notification/notification-header/notification-header.css +1 -1
- package/dist/collection/components/notification/notification-item/notification-item.css +1 -1
- package/dist/collection/components/notification/notification.css +1 -1
- package/dist/collection/components/pagination/pagination.css +1 -1
- package/dist/collection/components/pagination/pagination.js +4 -2
- package/dist/collection/components/radio/radio.css +1 -1
- package/dist/collection/components/radio-group/radio-group.css +1 -1
- package/dist/collection/components/scrim/scrim.css +1 -1
- package/dist/collection/components/select/select-input/select-input.css +1 -1
- package/dist/collection/components/select/select-input/select-input.js +126 -18
- package/dist/collection/components/select/select-list/select-list.css +1 -1
- package/dist/collection/components/select/select-list/select-list.js +218 -66
- package/dist/collection/components/select/select-option/select-option.css +1 -1
- package/dist/collection/components/select/select-option/select-option.js +14 -5
- package/dist/collection/components/select/select.css +1 -1
- package/dist/collection/components/select/select.js +303 -94
- package/dist/collection/components/select/select.utils.js +29 -8
- package/dist/collection/components/sign-in/sign-in.css +1 -1
- package/dist/collection/components/sign-in/sign-in.js +8 -4
- package/dist/collection/components/skip-link/skip-link-item/skip-link-item.css +1 -1
- package/dist/collection/components/skip-link/skip-link.css +1 -1
- package/dist/collection/components/slider/slider.css +1 -1
- package/dist/collection/components/step/step-item/step-item.css +1 -1
- package/dist/collection/components/step/step.css +1 -1
- package/dist/collection/components/switch/switch.css +1 -1
- package/dist/collection/components/tab/tab-item/tab-item.css +1 -1
- package/dist/collection/components/tab/tab-item/tab-item.js +2 -2
- package/dist/collection/components/tab/tab.css +1 -1
- package/dist/collection/components/tab/tab.js +37 -10
- package/dist/collection/components/table/table-body/table-body.css +1 -1
- package/dist/collection/components/table/table-cell/table-cell.css +1 -1
- package/dist/collection/components/table/table-header/table-header.css +1 -1
- package/dist/collection/components/table/table-header-cell/table-header-cell.css +1 -1
- package/dist/collection/components/table/table-row/table-row.css +1 -1
- package/dist/collection/components/table/table.css +1 -1
- package/dist/collection/components/tag/tag.css +1 -1
- package/dist/collection/components/textarea/textarea.css +1 -1
- package/dist/collection/components/tooltip/tooltip.css +1 -1
- package/dist/collection/components/upload/upload.css +1 -1
- package/dist/collection/components/wizard/wizard-panel/wizard-panel.css +1 -1
- package/dist/collection/components/wizard/wizard.css +1 -1
- package/dist/collection/pages/components/select/remote.js +33 -0
- package/dist/collection/pages/components/select/virtualized.js +13 -0
- package/dist/collection/pages/components/upload/handler.js +25 -0
- package/dist/collection/pages/scripts/component-controls.js +15 -16
- package/dist/collection/pages/scripts/menu.js +0 -1
- package/dist/collection/pages/scripts/pageLoader.js +168 -91
- package/dist/collection/pages/scripts/pageloader-preview.js +37 -28
- package/dist/collection/shared/utils/form.js +17 -0
- package/dist/components/br-avatar.js +1 -1
- package/dist/components/br-breadcrumb-item.js +1 -1
- package/dist/components/br-breadcrumb.js +1 -1
- package/dist/components/br-button.js +1 -1
- package/dist/components/br-card.js +1 -1
- package/dist/components/br-carousel-page.js +1 -1
- package/dist/components/br-carousel.js +1 -1
- package/dist/components/br-checkbox-group.js +1 -1
- package/dist/components/br-checkbox.js +1 -1
- package/dist/components/br-checkgroup.js +1 -1
- package/dist/components/br-collapse.js +1 -1
- package/dist/components/br-cookiebar-cookie.js +1 -1
- package/dist/components/br-cookiebar-group.js +1 -1
- package/dist/components/br-cookiebar-header.js +1 -1
- package/dist/components/br-cookiebar-link.js +1 -1
- package/dist/components/br-cookiebar-note-group.js +1 -1
- package/dist/components/br-cookiebar-note.js +1 -1
- package/dist/components/br-cookiebar.js +1 -1
- package/dist/components/br-crumb.js +1 -1
- package/dist/components/br-date-picker.js +1 -1
- package/dist/components/br-datetime-input.js +1 -1
- package/dist/components/br-datetime-picker.js +1 -1
- package/dist/components/br-divider.js +1 -1
- package/dist/components/br-dropdown.js +1 -1
- package/dist/components/br-footer-category.js +1 -1
- package/dist/components/br-footer-item.js +1 -1
- package/dist/components/br-footer-legal.js +1 -1
- package/dist/components/br-footer-logo.js +1 -1
- package/dist/components/br-footer-social.js +1 -1
- package/dist/components/br-footer.js +1 -1
- package/dist/components/br-header-function.js +1 -1
- package/dist/components/br-header-link.js +1 -1
- package/dist/components/br-header-list.js +1 -1
- package/dist/components/br-header-logo.js +1 -1
- package/dist/components/br-header.js +1 -1
- package/dist/components/br-icon.js +1 -1
- package/dist/components/br-input.js +1 -1
- package/dist/components/br-item.js +1 -1
- package/dist/components/br-link.js +1 -1
- package/dist/components/br-list.js +1 -1
- package/dist/components/br-loading.js +1 -1
- package/dist/components/br-magic-button.js +1 -1
- package/dist/components/br-menu-group.js +1 -1
- package/dist/components/br-menu-header.js +1 -1
- package/dist/components/br-menu-info.js +1 -1
- package/dist/components/br-menu-item.js +1 -1
- package/dist/components/br-menu-link.js +1 -1
- package/dist/components/br-menu-list.js +1 -1
- package/dist/components/br-menu-logo.js +1 -1
- package/dist/components/br-menu-social.js +1 -1
- package/dist/components/br-menu.js +1 -1
- package/dist/components/br-message.js +1 -1
- package/dist/components/br-modal.js +1 -1
- package/dist/components/br-notification-body.js +1 -1
- package/dist/components/br-notification-header.js +1 -1
- package/dist/components/br-notification-item.js +1 -1
- package/dist/components/br-notification.js +1 -1
- package/dist/components/br-pagination.js +1 -1
- package/dist/components/br-radio-group.js +1 -1
- package/dist/components/br-radio.js +1 -1
- package/dist/components/br-scrim.js +1 -1
- package/dist/components/br-select-input.js +1 -1
- package/dist/components/br-select-list.js +1 -1
- package/dist/components/br-select-option.js +1 -1
- package/dist/components/br-select.js +1 -1
- package/dist/components/br-sign-in.js +1 -1
- package/dist/components/br-skip-link-item.js +1 -1
- package/dist/components/br-skip-link.js +1 -1
- package/dist/components/br-skiplink-item.js +1 -1
- package/dist/components/br-slider.js +1 -1
- package/dist/components/br-step-item.js +1 -1
- package/dist/components/br-step.js +1 -1
- package/dist/components/br-switch.js +1 -1
- package/dist/components/br-tab-item.js +1 -1
- package/dist/components/br-tab.js +1 -1
- package/dist/components/br-table-body.js +1 -1
- package/dist/components/br-table-cell.js +1 -1
- package/dist/components/br-table-header-cell.js +1 -1
- package/dist/components/br-table-header.js +1 -1
- package/dist/components/br-table-row.js +1 -1
- package/dist/components/br-table.js +1 -1
- package/dist/components/br-tag.js +1 -1
- package/dist/components/br-textarea.js +1 -1
- package/dist/components/br-time-picker.js +1 -1
- package/dist/components/br-tooltip.js +1 -1
- package/dist/components/br-upload.js +1 -1
- package/dist/components/br-wizard-panel.js +1 -1
- package/dist/components/br-wizard.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-5h-W9_JR.js +5 -0
- package/dist/components/p-848QkYoM.js +5 -0
- package/dist/components/p-B7bNfmgh.js +5 -0
- package/dist/components/p-BFHvuEnN.js +5 -0
- package/dist/components/p-BH6QYnAr.js +5 -0
- package/dist/{webcomponents/p-6c2fe5e4.entry.js → components/p-BcW8O6h2.js} +1 -1
- package/dist/components/p-BicHMcSS.js +5 -0
- package/dist/components/p-Bs7iRQTG.js +5 -0
- package/dist/components/{p-DSHbttu9.js → p-Bvrw9yWR.js} +1 -1
- package/dist/components/p-BzQFMh9j.js +5 -0
- package/dist/components/p-CBHd0-fF.js +5 -0
- package/dist/components/p-CCPHCJjw.js +5 -0
- package/dist/components/p-CDTENPaP.js +5 -0
- package/dist/components/{p-BcqVlof7.js → p-CbgKdASU.js} +1 -1
- package/dist/components/p-CeNELttN.js +5 -0
- package/dist/components/p-CjtmJTLO.js +5 -0
- package/dist/components/{p-DTGNra9m.js → p-D-3G3Ioq.js} +1 -1
- package/dist/components/p-DDu3JV_r.js +5 -0
- package/dist/components/p-DFWqyfUe.js +5 -0
- package/dist/components/p-DL6xuxGG.js +5 -0
- package/dist/components/p-DOX9Uwk1.js +5 -0
- package/dist/components/p-DUq7uT2-.js +5 -0
- package/dist/components/p-Devw08cc.js +5 -0
- package/dist/components/p-Di96UxvH.js +5 -0
- package/dist/components/p-Dp3MsSXu.js +5 -0
- package/dist/components/p-DsO4F0Cz.js +5 -0
- package/dist/components/p-DuLHFTpa.js +5 -0
- package/dist/components/p-DusornQ0.js +5 -0
- package/dist/components/{p-Dma14GVa.js → p-Jk_KQE5V.js} +1 -1
- package/dist/components/p-OQpiDEK9.js +5 -0
- package/dist/components/p-PV731d8s.js +5 -0
- package/dist/components/p-XW6Hp_Jk.js +5 -0
- package/dist/components/p-jOb1hCPi.js +5 -0
- package/dist/components/p-rMnkh3Cy.js +5 -0
- package/dist/components/p-ta-24T1Z.js +5 -0
- package/dist/esm/br-avatar.entry.js +2 -2
- package/dist/esm/br-breadcrumb-item.entry.js +1 -1
- package/dist/esm/br-breadcrumb.entry.js +2 -2
- package/dist/esm/br-button_2.entry.js +10 -5
- package/dist/esm/br-card.entry.js +2 -2
- package/dist/esm/br-carousel-page.entry.js +2 -2
- package/dist/esm/br-carousel.entry.js +3 -3
- package/dist/esm/br-checkbox-group.entry.js +2 -2
- package/dist/esm/br-checkbox.entry.js +4 -4
- package/dist/esm/br-checkgroup.entry.js +1 -1
- package/dist/esm/br-collapse_2.entry.js +12 -8
- package/dist/esm/br-cookiebar-cookie.entry.js +2 -2
- package/dist/esm/br-cookiebar-group.entry.js +2 -2
- package/dist/esm/br-cookiebar-header.entry.js +2 -2
- package/dist/esm/br-cookiebar-link.entry.js +2 -2
- package/dist/esm/br-cookiebar-note-group.entry.js +2 -2
- package/dist/esm/br-cookiebar-note.entry.js +2 -2
- package/dist/esm/br-cookiebar.entry.js +3 -3
- package/dist/esm/br-crumb.entry.js +1 -1
- package/dist/esm/br-date-picker_3.entry.js +844 -492
- package/dist/esm/br-datetime-picker.entry.js +1316 -280
- package/dist/esm/br-divider.entry.js +2 -2
- package/dist/esm/br-dropdown_2.entry.js +281 -164
- package/dist/esm/br-footer-category.entry.js +2 -2
- package/dist/esm/br-footer-item.entry.js +2 -2
- package/dist/esm/br-footer-legal.entry.js +2 -2
- package/dist/esm/br-footer-logo.entry.js +2 -2
- package/dist/esm/br-footer-social.entry.js +2 -2
- package/dist/esm/br-footer.entry.js +2 -2
- package/dist/esm/br-header-function.entry.js +2 -2
- package/dist/esm/br-header-link.entry.js +2 -2
- package/dist/esm/br-header-list.entry.js +3 -3
- package/dist/esm/br-header-logo.entry.js +2 -2
- package/dist/esm/br-header.entry.js +27 -23
- package/dist/esm/br-icon.entry.js +3 -32
- package/dist/esm/br-input.entry.js +32 -7
- package/dist/esm/br-item.entry.js +5 -4
- package/dist/esm/br-link.entry.js +2 -2
- package/dist/esm/br-loading.entry.js +2 -2
- package/dist/esm/br-magic-button.entry.js +21 -8
- package/dist/esm/br-menu-group.entry.js +2 -2
- package/dist/esm/br-menu-header.entry.js +2 -2
- package/dist/esm/br-menu-info.entry.js +2 -2
- package/dist/esm/br-menu-item.entry.js +2 -2
- package/dist/esm/br-menu-link.entry.js +2 -2
- package/dist/esm/br-menu-list.entry.js +2 -2
- package/dist/esm/br-menu-logo.entry.js +2 -2
- package/dist/esm/br-menu-social.entry.js +2 -2
- package/dist/esm/br-menu.entry.js +3 -3
- package/dist/esm/br-modal.entry.js +21 -5
- package/dist/esm/br-notification-body.entry.js +2 -2
- package/dist/esm/br-notification-header.entry.js +2 -2
- package/dist/esm/br-notification-item.entry.js +2 -2
- package/dist/esm/br-notification.entry.js +3 -3
- package/dist/esm/br-pagination.entry.js +4 -4
- package/dist/esm/br-radio-group.entry.js +4 -4
- package/dist/esm/br-radio.entry.js +4 -4
- package/dist/esm/br-scrim.entry.js +2 -2
- package/dist/esm/br-select-input_3.entry.js +286 -100
- package/dist/esm/br-sign-in.entry.js +8 -4
- package/dist/esm/br-skip-link-item.entry.js +1 -1
- package/dist/esm/br-skip-link.entry.js +2 -2
- package/dist/esm/br-skiplink-item.entry.js +2 -2
- package/dist/esm/br-slider.entry.js +4 -4
- package/dist/esm/br-step_2.entry.js +3 -3
- package/dist/esm/br-switch.entry.js +4 -4
- package/dist/esm/br-tab-item.entry.js +3 -3
- package/dist/esm/br-tab.entry.js +38 -13
- package/dist/esm/br-table-body.entry.js +2 -2
- package/dist/esm/br-table-cell.entry.js +2 -2
- package/dist/esm/br-table-header-cell.entry.js +2 -2
- package/dist/esm/br-table-header.entry.js +2 -2
- package/dist/esm/br-table-row.entry.js +2 -2
- package/dist/esm/br-table.entry.js +2 -2
- package/dist/esm/br-tag.entry.js +4 -4
- package/dist/esm/br-textarea.entry.js +4 -4
- package/dist/esm/br-tooltip.entry.js +3 -3
- package/dist/esm/br-upload.entry.js +5 -21
- package/dist/esm/br-wizard-panel.entry.js +2 -2
- package/dist/esm/br-wizard.entry.js +2 -2
- package/dist/esm/{datetime-picker-constants-BtRPYRvA.js → datetime-picker-constants-DDc4sADe.js} +20 -6
- package/dist/esm/{event-CfuJQ1DY.js → event-6Da1SZ3J.js} +1 -1
- package/dist/esm/format-bytes-B7bNfmgh.js +22 -0
- package/dist/esm/icon.utils-zlORkiHQ.js +43 -0
- package/dist/esm/{index-Dcn7tRST.js → index-ConyRdJe.js} +33 -27
- package/dist/esm/{index-BQPOWxe5.js → index-CytVKoHT.js} +13 -13
- package/dist/esm/index.js +2 -2
- package/dist/esm/{datetime-picker-props-validation-BeTcUTnE.js → isValid-Bee0Uvqc.js} +2 -477
- package/dist/esm/loader.js +3 -3
- package/dist/esm/select.utils-BYsh2ZdE.js +57 -0
- package/dist/esm/{validator-D3tVP32U.js → validator-BkWWrDEr.js} +18 -1
- package/dist/esm/webcomponents.js +4 -4
- package/dist/hydrate/index.js +3314 -1806
- package/dist/hydrate/index.mjs +3314 -1806
- package/dist/types/components/button/button.d.ts +2 -1
- package/dist/types/components/collapse/collapse.d.ts +6 -2
- package/dist/types/components/datetime-picker/date-picker/date-picker-locale.d.ts +9 -9
- package/dist/types/components/datetime-picker/date-picker/date-picker-props-validation.d.ts +14 -13
- package/dist/types/components/datetime-picker/date-picker/date-picker.d.ts +264 -161
- package/dist/types/components/datetime-picker/datetime-input/datetime-input-constants.d.ts +14 -0
- package/dist/types/components/datetime-picker/datetime-input/datetime-input-props-validation.d.ts +19 -15
- package/dist/types/components/datetime-picker/datetime-input/datetime-input.d.ts +229 -98
- package/dist/types/components/datetime-picker/datetime-input/datetime-input.types.d.ts +36 -0
- package/dist/types/components/datetime-picker/datetime-picker-constants.d.ts +19 -5
- package/dist/types/components/datetime-picker/datetime-picker-form-associated.d.ts +32 -5
- package/dist/types/components/datetime-picker/datetime-picker-props-validation.d.ts +22 -24
- package/dist/types/components/datetime-picker/datetime-picker.d.ts +508 -235
- package/dist/types/components/datetime-picker/datetime-picker.types.d.ts +75 -21
- package/dist/types/components/datetime-picker/datetime-picker.utils.d.ts +53 -47
- package/dist/types/components/datetime-picker/time-picker/time-picker-constants.d.ts +3 -2
- package/dist/types/components/datetime-picker/time-picker/time-picker.d.ts +126 -55
- package/dist/types/components/dropdown/dropdown.d.ts +12 -4
- package/dist/types/components/header/header.d.ts +2 -0
- package/dist/types/components/icon/icon.utils.d.ts +6 -0
- package/dist/types/components/input/input.d.ts +18 -1
- package/dist/types/components/input/input.types.d.ts +4 -0
- package/dist/types/components/item/item.d.ts +6 -1
- package/dist/types/components/magic-button/magic-button.d.ts +7 -3
- package/dist/types/components/modal/modal.d.ts +6 -0
- package/dist/types/components/pagination/pagination.d.ts +2 -0
- package/dist/types/components/select/select-input/select-input.d.ts +9 -2
- package/dist/types/components/select/select-list/select-list.d.ts +14 -2
- package/dist/types/components/select/select-option/select-option.d.ts +1 -0
- package/dist/types/components/select/select.d.ts +47 -7
- package/dist/types/components/select/select.types.d.ts +12 -0
- package/dist/types/components/select/select.utils.d.ts +3 -0
- package/dist/types/components/sign-in/sign-in.d.ts +3 -2
- package/dist/types/components/tab/tab-item/tab-item.d.ts +6 -2
- package/dist/types/components/tab/tab.d.ts +7 -0
- package/dist/types/components.d.ts +405 -318
- package/dist/types/shared/utils/form.d.ts +8 -0
- package/dist/types/stencil-public-runtime.d.ts +61 -55
- package/dist/webcomponents/index.esm.js +1 -1
- package/dist/webcomponents/p-01801ac1.entry.js +5 -0
- package/dist/webcomponents/p-05b459f2.entry.js +5 -0
- package/dist/webcomponents/p-08ac6f09.entry.js +5 -0
- package/dist/webcomponents/{p-cff24492.entry.js → p-09817344.entry.js} +1 -1
- package/dist/webcomponents/p-09c79c1d.entry.js +5 -0
- package/dist/webcomponents/p-0fc112fc.entry.js +5 -0
- package/dist/webcomponents/p-13babfc4.entry.js +5 -0
- package/dist/webcomponents/p-15022ab7.entry.js +5 -0
- package/dist/webcomponents/p-172d42c2.entry.js +5 -0
- package/dist/webcomponents/p-18cf093a.entry.js +5 -0
- package/dist/webcomponents/p-198aa844.entry.js +5 -0
- package/dist/webcomponents/p-1ba60d13.entry.js +5 -0
- package/dist/webcomponents/p-1bb96641.entry.js +5 -0
- package/dist/webcomponents/{p-7acf20d3.entry.js → p-20477061.entry.js} +1 -1
- package/dist/webcomponents/p-21feda62.entry.js +5 -0
- package/dist/webcomponents/p-23a5cfd7.entry.js +5 -0
- package/dist/webcomponents/{p-030c02f8.entry.js → p-2c8595d3.entry.js} +1 -1
- package/dist/webcomponents/{p-09770c98.entry.js → p-31a4694a.entry.js} +1 -1
- package/dist/webcomponents/p-32ea6342.entry.js +5 -0
- package/dist/webcomponents/p-3658adcf.entry.js +5 -0
- package/dist/webcomponents/p-37914e63.entry.js +5 -0
- package/dist/webcomponents/p-3b0dd0ff.entry.js +5 -0
- package/dist/webcomponents/p-42b60169.entry.js +5 -0
- package/dist/webcomponents/p-42c9c6c5.entry.js +5 -0
- package/dist/{components/p-SvVnvJdC.js → webcomponents/p-473561f2.entry.js} +1 -1
- package/dist/webcomponents/p-47c490ef.entry.js +5 -0
- package/dist/webcomponents/p-4b01c60f.entry.js +5 -0
- package/dist/webcomponents/p-5a5ed7d8.entry.js +5 -0
- package/dist/webcomponents/{p-c8b7bbab.entry.js → p-5a7c2031.entry.js} +1 -1
- package/dist/webcomponents/p-609cf652.entry.js +5 -0
- package/dist/webcomponents/p-614683d9.entry.js +5 -0
- package/dist/webcomponents/p-67605757.entry.js +5 -0
- package/dist/{components/p-CppRJiyC.js → webcomponents/p-67774920.entry.js} +1 -1
- package/dist/webcomponents/p-67d62559.entry.js +5 -0
- package/dist/webcomponents/p-695dbeb0.entry.js +5 -0
- package/dist/webcomponents/{p-CfuJQ1DY.js → p-6Da1SZ3J.js} +1 -1
- package/dist/webcomponents/p-6a293be8.entry.js +5 -0
- package/dist/webcomponents/{p-03359c92.entry.js → p-6f1a4fbe.entry.js} +1 -1
- package/dist/webcomponents/p-7352d459.entry.js +5 -0
- package/dist/webcomponents/p-745213f7.entry.js +5 -0
- package/dist/webcomponents/p-794b701b.entry.js +5 -0
- package/dist/webcomponents/{p-d826c052.entry.js → p-7ee564a1.entry.js} +1 -1
- package/dist/webcomponents/{p-e20188c0.entry.js → p-7fda8b89.entry.js} +1 -1
- package/dist/webcomponents/p-8116ee93.entry.js +5 -0
- package/dist/webcomponents/p-821341dc.entry.js +5 -0
- package/dist/webcomponents/p-8aa6f07c.entry.js +5 -0
- package/dist/webcomponents/p-8ddf3ce3.entry.js +5 -0
- package/dist/webcomponents/p-95f3c44a.entry.js +5 -0
- package/dist/webcomponents/p-96dbb585.entry.js +5 -0
- package/dist/webcomponents/p-9815ab95.entry.js +5 -0
- package/dist/webcomponents/{p-327f034f.entry.js → p-9e0324a7.entry.js} +1 -1
- package/dist/webcomponents/p-B7bNfmgh.js +5 -0
- package/dist/webcomponents/p-BYsh2ZdE.js +5 -0
- package/dist/webcomponents/p-BkWWrDEr.js +5 -0
- package/dist/webcomponents/p-CJipT0in.js +5 -0
- package/dist/webcomponents/{p-Dcn7tRST.js → p-ConyRdJe.js} +1 -1
- package/dist/webcomponents/{p-BtRPYRvA.js → p-DDc4sADe.js} +1 -1
- package/dist/webcomponents/p-a038be16.entry.js +5 -0
- package/dist/webcomponents/p-a32d17cb.entry.js +5 -0
- package/dist/webcomponents/p-a46f068e.entry.js +5 -0
- package/dist/webcomponents/p-a89b684d.entry.js +5 -0
- package/dist/webcomponents/{p-abaf2365.entry.js → p-ac68355e.entry.js} +1 -1
- package/dist/webcomponents/{p-ed5af0e4.entry.js → p-af888d13.entry.js} +1 -1
- package/dist/webcomponents/p-b0124459.entry.js +5 -0
- package/dist/webcomponents/p-b063c12f.entry.js +5 -0
- package/dist/webcomponents/p-b07bfdc5.entry.js +5 -0
- package/dist/webcomponents/{p-f558d7b9.entry.js → p-b55425b7.entry.js} +1 -1
- package/dist/webcomponents/{p-a0931550.entry.js → p-b5d25332.entry.js} +1 -1
- package/dist/webcomponents/p-b609b464.entry.js +5 -0
- package/dist/webcomponents/p-b66ab52d.entry.js +5 -0
- package/dist/webcomponents/p-b8d4ace3.entry.js +5 -0
- package/dist/webcomponents/p-c717c745.entry.js +5 -0
- package/dist/webcomponents/p-ce3d689c.entry.js +5 -0
- package/dist/webcomponents/p-d08b6266.entry.js +5 -0
- package/dist/webcomponents/p-d6165aa0.entry.js +5 -0
- package/dist/webcomponents/{p-01fb0754.entry.js → p-dacb7e2c.entry.js} +1 -1
- package/dist/webcomponents/p-db309a11.entry.js +5 -0
- package/dist/webcomponents/{p-edc6da0e.entry.js → p-dc23cb2e.entry.js} +1 -1
- package/dist/webcomponents/p-e241caf3.entry.js +5 -0
- package/dist/webcomponents/p-e661c024.entry.js +5 -0
- package/dist/webcomponents/p-e7107869.entry.js +5 -0
- package/dist/webcomponents/p-eb94199d.entry.js +5 -0
- package/dist/webcomponents/p-f8993ae4.entry.js +5 -0
- package/dist/webcomponents/{p-670e8fec.entry.js → p-f99d8c9c.entry.js} +1 -1
- package/dist/webcomponents/{p-DV-iW9Aj.js → p-fOJu6uZR.js} +1 -1
- package/dist/webcomponents/{p-a212fd85.entry.js → p-fb76b1e0.entry.js} +1 -1
- package/dist/webcomponents/p-fdcb54a3.entry.js +5 -0
- package/dist/webcomponents/{p-e3de5bb3.entry.js → p-fed02286.entry.js} +1 -1
- package/dist/webcomponents/p-zlORkiHQ.js +5 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +2 -2
- package/dist/components/p-B0o70fWP.js +0 -5
- package/dist/components/p-B96LROz9.js +0 -5
- package/dist/components/p-BDqef5-y.js +0 -5
- package/dist/components/p-BP5zMCxG.js +0 -5
- package/dist/components/p-BRaphxoP.js +0 -5
- package/dist/components/p-BUzBa9L1.js +0 -5
- package/dist/components/p-BblZlUp2.js +0 -5
- package/dist/components/p-Bc4nAk5i.js +0 -5
- package/dist/components/p-Bezou5CQ.js +0 -5
- package/dist/components/p-BrNh9KdF.js +0 -5
- package/dist/components/p-C5th2dxu.js +0 -5
- package/dist/components/p-CEdUp183.js +0 -5
- package/dist/components/p-CF7t0uxQ.js +0 -5
- package/dist/components/p-CFzHx6zV.js +0 -5
- package/dist/components/p-CG4em0S6.js +0 -5
- package/dist/components/p-CI4D3-pf.js +0 -5
- package/dist/components/p-CIrVPkVg.js +0 -5
- package/dist/components/p-CdDwqbBv.js +0 -5
- package/dist/components/p-Cvk1Ggs5.js +0 -5
- package/dist/components/p-D12US39c.js +0 -5
- package/dist/components/p-DGPJkJsj.js +0 -5
- package/dist/components/p-DX1wAFn4.js +0 -5
- package/dist/components/p-DpRZ4B0d.js +0 -5
- package/dist/components/p-G35qEQZd.js +0 -5
- package/dist/components/p-Ho_IybzR.js +0 -5
- package/dist/components/p-emAWunES.js +0 -5
- package/dist/components/p-fB79wKCm.js +0 -5
- package/dist/components/p-k7p4QJ8a.js +0 -5
- package/dist/webcomponents/p-01baafce.entry.js +0 -5
- package/dist/webcomponents/p-0b9714f1.entry.js +0 -5
- package/dist/webcomponents/p-12aa36a8.entry.js +0 -5
- package/dist/webcomponents/p-130b6e06.entry.js +0 -5
- package/dist/webcomponents/p-144f8c8d.entry.js +0 -5
- package/dist/webcomponents/p-14fe22e2.entry.js +0 -5
- package/dist/webcomponents/p-1ff9210a.entry.js +0 -5
- package/dist/webcomponents/p-2605cdc3.entry.js +0 -5
- package/dist/webcomponents/p-27afaec9.entry.js +0 -5
- package/dist/webcomponents/p-2a50e42d.entry.js +0 -5
- package/dist/webcomponents/p-342650b8.entry.js +0 -5
- package/dist/webcomponents/p-38f6a78b.entry.js +0 -5
- package/dist/webcomponents/p-3920fe3a.entry.js +0 -5
- package/dist/webcomponents/p-3ae97345.entry.js +0 -5
- package/dist/webcomponents/p-3cce767c.entry.js +0 -5
- package/dist/webcomponents/p-3df6c5d2.entry.js +0 -5
- package/dist/webcomponents/p-3e287899.entry.js +0 -5
- package/dist/webcomponents/p-3e5580ba.entry.js +0 -5
- package/dist/webcomponents/p-403637dd.entry.js +0 -5
- package/dist/webcomponents/p-435c8ef2.entry.js +0 -5
- package/dist/webcomponents/p-59da5b55.entry.js +0 -5
- package/dist/webcomponents/p-5dd4314c.entry.js +0 -5
- package/dist/webcomponents/p-646af6a5.entry.js +0 -5
- package/dist/webcomponents/p-68046544.entry.js +0 -5
- package/dist/webcomponents/p-68ec76b8.entry.js +0 -5
- package/dist/webcomponents/p-6c0ea20c.entry.js +0 -5
- package/dist/webcomponents/p-707df9b9.entry.js +0 -5
- package/dist/webcomponents/p-72b839fe.entry.js +0 -5
- package/dist/webcomponents/p-73dcc05b.entry.js +0 -5
- package/dist/webcomponents/p-7b01bddb.entry.js +0 -5
- package/dist/webcomponents/p-7cd38850.entry.js +0 -5
- package/dist/webcomponents/p-82454383.entry.js +0 -5
- package/dist/webcomponents/p-91e959a8.entry.js +0 -5
- package/dist/webcomponents/p-964c01e6.entry.js +0 -5
- package/dist/webcomponents/p-9858e42a.entry.js +0 -5
- package/dist/webcomponents/p-9c4200b0.entry.js +0 -5
- package/dist/webcomponents/p-9d9c87b1.entry.js +0 -5
- package/dist/webcomponents/p-B0PbhaxL.js +0 -5
- package/dist/webcomponents/p-D3tVP32U.js +0 -5
- package/dist/webcomponents/p-a2e75143.entry.js +0 -5
- package/dist/webcomponents/p-a3bb98c9.entry.js +0 -5
- package/dist/webcomponents/p-a8b5dba0.entry.js +0 -5
- package/dist/webcomponents/p-aa909443.entry.js +0 -5
- package/dist/webcomponents/p-aeb16645.entry.js +0 -5
- package/dist/webcomponents/p-b287c384.entry.js +0 -5
- package/dist/webcomponents/p-b506b0a1.entry.js +0 -5
- package/dist/webcomponents/p-b520c08c.entry.js +0 -5
- package/dist/webcomponents/p-b94c3f84.entry.js +0 -5
- package/dist/webcomponents/p-bda62f90.entry.js +0 -5
- package/dist/webcomponents/p-c201ae16.entry.js +0 -5
- package/dist/webcomponents/p-c7e899a1.entry.js +0 -5
- package/dist/webcomponents/p-cbf3e251.entry.js +0 -5
- package/dist/webcomponents/p-d35cf5b4.entry.js +0 -5
- package/dist/webcomponents/p-d45ffe9c.entry.js +0 -5
- package/dist/webcomponents/p-d719a4af.entry.js +0 -5
- package/dist/webcomponents/p-da21a60d.entry.js +0 -5
- package/dist/webcomponents/p-de0c7f26.entry.js +0 -5
- package/dist/webcomponents/p-e27882e1.entry.js +0 -5
- package/dist/webcomponents/p-e624ff04.entry.js +0 -5
- package/dist/webcomponents/p-f24fcf3d.entry.js +0 -5
- package/dist/webcomponents/p-f52ef0dc.entry.js +0 -5
- package/dist/webcomponents/p-fcab1428.entry.js +0 -5
- package/dist/webcomponents/p-fe1729a7.entry.js +0 -5
|
@@ -9,48 +9,52 @@ import { set } from "date-fns/set";
|
|
|
9
9
|
import { toDate } from "date-fns/toDate";
|
|
10
10
|
import { dispatchNativeFormEvent } from "../../shared/utils/event";
|
|
11
11
|
import { getFormValidationState, isFormControlDisabled, setFormValidity, } from "../../shared/utils/form";
|
|
12
|
-
import
|
|
13
|
-
import { reportInvalidPropValue } from "../../shared/utils/prop-warning";
|
|
12
|
+
import Helpers from "../../shared/utils/helpers";
|
|
14
13
|
import { hasAssignedSlotContent } from "../../shared/utils/slot";
|
|
15
14
|
import { resolveSsrLocalDate } from "../../shared/utils/ssr-date";
|
|
16
15
|
import { resolveFormValidator, runFormValidator } from "../../shared/utils/validator";
|
|
17
|
-
import { DATETIME_PICKER_LOCALE, DATETIME_PICKER_MODE } from "./datetime-picker-constants";
|
|
16
|
+
import { DATETIME_PICKER_LOCALE, DATETIME_PICKER_MODE, DATETIME_RANGE_ORDER_MESSAGE, } from "./datetime-picker-constants";
|
|
18
17
|
import { hasDatetimePickerMissingValue, parseDatetimePickerSerializedRange, parseDatetimePickerSerializedValue, serializeDatetimePickerFormValue, } from "./datetime-picker-form-associated";
|
|
19
|
-
import {
|
|
18
|
+
import { normalizeDatetimePickerDisabledDates, normalizeDatetimePickerInitialMoment, normalizeDatetimePickerMode, normalizeDatetimePickerSelectionMode, normalizeDatetimePickerWeekStartsOn, } from "./datetime-picker-props-validation";
|
|
20
19
|
/**
|
|
21
|
-
* O
|
|
20
|
+
* O `br-datetime-picker` é o controle completo do GovBR-DS para digitação e seleção visual de datas e horários. Orquestra o campo textual e os seletores internos, consolidando valor, validação e integração com formulários HTML.
|
|
22
21
|
*
|
|
23
22
|
* ### Para que serve
|
|
24
23
|
*
|
|
25
|
-
* -
|
|
26
|
-
* -
|
|
27
|
-
* -
|
|
24
|
+
* - Oferece os modos `date`, `time` e `datetime`, com seleção única (`single`) ou de intervalo (`range`).
|
|
25
|
+
* - Combina edição textual com máscara, calendário e ajuste de horas e minutos conforme o modo escolhido.
|
|
26
|
+
* - Centraliza restrições de seleção, validação e submissão do valor por meio de `formAssociated`.
|
|
28
27
|
*
|
|
29
28
|
* ### Quando utilizar
|
|
30
29
|
*
|
|
31
|
-
* -
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* -
|
|
35
|
-
*
|
|
30
|
+
* - Utilize quando o formulário precisar de um controle completo de data ou horário com digitação e seleção visual.
|
|
31
|
+
* - Utilize para períodos com início e fim, inclusive com horários nos modos `time` e `datetime`.
|
|
32
|
+
* - Evite quando precisar apenas apresentar uma data: prefira texto formatado.
|
|
33
|
+
* - Para um calendário permanentemente visível sem o campo textual, considere `br-date-picker`; a aplicação assume a integração com o restante do formulário.
|
|
34
|
+
* - A seleção não oferece uma coleção de datas independentes: use `single` para um valor ou `range` para um intervalo.
|
|
36
35
|
*
|
|
37
36
|
* ### Composição e Subcomponentes
|
|
38
37
|
*
|
|
39
|
-
* |
|
|
38
|
+
* | Componente | Papel | Regra de uso |
|
|
40
39
|
* | --- | --- | --- |
|
|
41
|
-
* | `br-datetime-picker` |
|
|
42
|
-
* | `br-datetime-input` |
|
|
43
|
-
* | `br-date-picker` |
|
|
44
|
-
* | `br-time-picker` |
|
|
40
|
+
* | `br-datetime-picker` | Orquestrador do valor consolidado, validação, formulário e abertura do painel. | Declare este controle no template para obter a composição completa. |
|
|
41
|
+
* | `br-datetime-input` | Campo textual com máscara, interpretação da entrada e ação de abertura do painel. | Instanciado internamente pelo pai; não deve ser fornecido em slot. |
|
|
42
|
+
* | `br-date-picker` | Calendário para navegação e seleção de data única ou intervalo. | Criado pelo pai nos modos `date` e `datetime`; pode ser usado isoladamente como calendário embutido. |
|
|
43
|
+
* | `br-time-picker` | Controles de hora e minuto. | Criado pelo pai nos modos `time` e `datetime`, com uma instância por limite quando a seleção é `range`. |
|
|
44
|
+
*
|
|
45
|
+
* O slot `feedback` recebe conteúdo declarativo de validação, normalmente um `br-message`; não substitui os seletores internos.
|
|
45
46
|
*
|
|
46
47
|
* ### Como os subcomponentes se relacionam
|
|
47
48
|
*
|
|
48
|
-
* O
|
|
49
|
+
* O pai fornece valores e configurações aos filhos por propriedades e consolida suas alterações por eventos DOM. O campo textual solicita a abertura do painel; o calendário e os controles de horário atualizam a seleção compartilhada, sem coordenar diretamente uns aos outros.
|
|
50
|
+
*
|
|
51
|
+
* `referenceDate` representa a referência de navegação visual, distinta da seleção efetiva. O orquestrador mantém o campo textual, os seletores e o valor de formulário sincronizados. A aplicação consome o valor e os eventos do pai, incluindo `brDatetimePickerChange` para a seleção completa e tipada.
|
|
49
52
|
*
|
|
50
|
-
*
|
|
53
|
+
* O uso isolado dos filhos exige que a aplicação assuma a coordenação de estado, validação e formulário; eles não herdam a associação nativa ao formulário do `br-datetime-picker`.
|
|
51
54
|
*
|
|
52
|
-
|
|
53
|
-
*
|
|
55
|
+
* Para a documentação completa de design, incluindo diretrizes de uso, acessibilidade e exemplos visuais, consulte o [Design System do GovBR](https://www.gov.br/ds/components/datetimepicker?tab=designer).
|
|
56
|
+
*
|
|
57
|
+
* @category Formulários
|
|
54
58
|
* @status stable
|
|
55
59
|
* @slot feedback - Mensagem de validação, normalmente um `br-message`.
|
|
56
60
|
* @part container - Parte para o container base do seletor.
|
|
@@ -63,188 +67,334 @@ import { isValidDatetimePickerDateRange, normalizeDatetimePickerDisabledDates, n
|
|
|
63
67
|
export class DatetimePicker {
|
|
64
68
|
constructor() {
|
|
65
69
|
/**
|
|
66
|
-
*
|
|
67
|
-
*/
|
|
68
|
-
this.isPickerOpen = false;
|
|
69
|
-
this.formDisabled = false;
|
|
70
|
-
this.hasFeedbackSlot = false;
|
|
71
|
-
this.customValidationMessage = '';
|
|
72
|
-
this.validatorMessage = null;
|
|
73
|
-
this.isValidating = false;
|
|
74
|
-
this.feedbackId = generateUniqueId('br-datetime-picker-feedback');
|
|
75
|
-
/** Lista normalizada de datas indisponíveis para seleção. */
|
|
76
|
-
this.normalizedDisabledDates = [];
|
|
77
|
-
/** Data final selecionada no modo de intervalo. */
|
|
78
|
-
this.rangeEnd = null;
|
|
79
|
-
/** Data inicial selecionada no modo de intervalo. */
|
|
80
|
-
this.rangeStart = null;
|
|
81
|
-
/**
|
|
82
|
-
* Mantém a data de referência que orienta a navegação visual do calendário.
|
|
83
|
-
*/
|
|
84
|
-
this.referenceDate = new Date();
|
|
85
|
-
/**
|
|
86
|
-
* Define o modo de seleção exibido pelo componente: data, horário ou ambos.
|
|
70
|
+
* Modo exibido pelo componente.
|
|
87
71
|
*
|
|
88
|
-
* Valores
|
|
89
|
-
* Valores inválidos são
|
|
90
|
-
* mantendo o atributo refletido sempre consistente com o modo exibido.
|
|
72
|
+
* Valores: `date` | `time` | `datetime`.
|
|
73
|
+
* Valores inválidos são normalizados para o padrão.
|
|
91
74
|
*
|
|
92
75
|
* @default 'datetime'
|
|
93
76
|
*/
|
|
94
77
|
this.mode = DATETIME_PICKER_MODE.DEFAULT;
|
|
95
78
|
/**
|
|
96
|
-
*
|
|
79
|
+
* Locale usado para formatação e rótulos.
|
|
97
80
|
*
|
|
98
81
|
* @default 'pt-BR'
|
|
99
82
|
*/
|
|
100
83
|
this.locale = DATETIME_PICKER_LOCALE.DEFAULT;
|
|
101
84
|
/**
|
|
102
|
-
*
|
|
85
|
+
* Texto placeholder exibido no input.
|
|
103
86
|
*
|
|
104
87
|
* @default ''
|
|
105
88
|
*/
|
|
106
89
|
this.placeholder = '';
|
|
107
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Nome do campo para submissão em formulários nativos.
|
|
92
|
+
*
|
|
93
|
+
* @default ''
|
|
94
|
+
*/
|
|
108
95
|
this.name = '';
|
|
109
|
-
/**
|
|
96
|
+
/**
|
|
97
|
+
* Indica se o campo é requerido para submissão do formulário.
|
|
98
|
+
*
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
110
101
|
this.required = false;
|
|
111
102
|
/**
|
|
112
|
-
* Menor data/
|
|
113
|
-
* Aceita texto no atributo HTML ou uma instância de `Date` por property binding.
|
|
103
|
+
* Menor data/hora aceito (Date | string | null).
|
|
114
104
|
*
|
|
115
|
-
* @
|
|
116
|
-
* ```html
|
|
117
|
-
* <br-datetime-picker mode="date" min="2026-01-01"></br-datetime-picker>
|
|
118
|
-
* ```
|
|
105
|
+
* @default null
|
|
119
106
|
*/
|
|
120
107
|
this.min = null;
|
|
121
108
|
/**
|
|
122
|
-
* Maior data/
|
|
123
|
-
* Aceita texto no atributo HTML ou uma instância de `Date` por property binding.
|
|
109
|
+
* Maior data/hora aceito (Date | string | null).
|
|
124
110
|
*
|
|
125
|
-
* @
|
|
126
|
-
* ```html
|
|
127
|
-
* <br-datetime-picker mode="date" max="2026-12-31"></br-datetime-picker>
|
|
128
|
-
* ```
|
|
111
|
+
* @default null
|
|
129
112
|
*/
|
|
130
113
|
this.max = null;
|
|
131
114
|
/**
|
|
132
|
-
*
|
|
115
|
+
* Tipo de seleção: `single` ou `range`.
|
|
133
116
|
*
|
|
134
|
-
*
|
|
135
|
-
* Se `selectionMode="range"` for informado, o componente ajusta automaticamente
|
|
136
|
-
* `mode` para `date`. Se `mode` mudar para `time` ou `datetime`, o componente
|
|
137
|
-
* normaliza `selectionMode` para `single` quando necessário.
|
|
138
|
-
* Valores inválidos usam `single`.
|
|
117
|
+
* @default 'single'
|
|
139
118
|
*/
|
|
140
119
|
this.selectionMode = 'single';
|
|
141
120
|
/**
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
* Valores suportados: 0 (domingo) a 6 (sábado).
|
|
121
|
+
* Dia inicial da semana exibido no calendário (0 = Dom, 6 = Sáb).
|
|
145
122
|
*
|
|
146
123
|
* @default 0
|
|
147
124
|
*/
|
|
148
125
|
this.weekStartsOn = 0;
|
|
149
126
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
* Aceita:
|
|
153
|
-
* - `'now'`: seleciona o momento atual.
|
|
154
|
-
* - `Date` ou `string`: seleciona uma data arbitrária.
|
|
155
|
-
* - `null`: inicia sem seleção.
|
|
156
|
-
*
|
|
157
|
-
* Reativo em runtime: mudanças na prop atualizam estado e subcomponentes.
|
|
127
|
+
* Valor inicial da seleção: `'now' | Date | string | null`.
|
|
158
128
|
*
|
|
159
129
|
* @default null
|
|
160
|
-
* @example
|
|
161
|
-
* ```html
|
|
162
|
-
* <br-datetime-picker initial-moment="now"></br-datetime-picker>
|
|
163
|
-
* ```
|
|
164
130
|
*/
|
|
165
131
|
this.initialMoment = null;
|
|
166
132
|
/**
|
|
167
|
-
*
|
|
168
|
-
* Pode ser controlada por property binding e é atualizada pelo evento `valueChange`.
|
|
169
|
-
* Para formulários e atributos textuais, use `serializedValue`.
|
|
133
|
+
* Valor selecionado pelo usuário (Date | null).
|
|
170
134
|
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
* picker.value = new Date(2026, 8, 7, 14, 30);
|
|
175
|
-
* ```
|
|
135
|
+
* Pode ser controlado externamente e é refletido internamente.
|
|
136
|
+
*
|
|
137
|
+
* @default null
|
|
176
138
|
*/
|
|
177
139
|
this.value = null;
|
|
178
140
|
/**
|
|
179
141
|
* Desabilita toda a interação do componente.
|
|
180
142
|
*
|
|
181
|
-
* Quando `true`, impede abrir o picker, alterar valores e navegar entre datas/horários.
|
|
182
|
-
*
|
|
183
143
|
* @default false
|
|
184
144
|
*/
|
|
185
145
|
this.disabled = false;
|
|
186
146
|
/**
|
|
187
|
-
*
|
|
147
|
+
* Datas indisponíveis para seleção. Aceita `Date[]`, `string` ou `null`.
|
|
188
148
|
*
|
|
189
|
-
*
|
|
190
|
-
* separadas por espaço em branco. Datas inválidas são ignoradas com warning.
|
|
191
|
-
* A comparação considera apenas o dia (ano/mês/dia), ignorando hora.
|
|
149
|
+
* Datas inválidas são ignoradas. A comparação considera apenas o dia.
|
|
192
150
|
*
|
|
193
151
|
* @default null
|
|
194
|
-
* @example
|
|
195
|
-
* ```html
|
|
196
|
-
* <br-datetime-picker mode="date" disabled-dates="2026-09-07 2026-09-08"></br-datetime-picker>
|
|
197
|
-
* ```
|
|
198
|
-
* @example
|
|
199
|
-
* ```js
|
|
200
|
-
* const picker = document.querySelector('br-datetime-picker');
|
|
201
|
-
* picker.disabledDates = [new Date(2026, 8, 7), '2026-09-08'];
|
|
202
|
-
* ```
|
|
203
152
|
*/
|
|
204
153
|
this.disabledDates = null;
|
|
205
154
|
/**
|
|
206
|
-
*
|
|
207
|
-
* ou variar conforme o mês.
|
|
208
|
-
*
|
|
209
|
-
* Quando `true`, o calendário sempre exibe 6 semanas completas.
|
|
210
|
-
* Quando `false`, o calendário adapta-se ao mês, exibindo apenas as semanas necessárias.
|
|
155
|
+
* Mantém número fixo de linhas no calendário (6 semanas) quando `true`.
|
|
211
156
|
*
|
|
212
157
|
* @default false
|
|
213
158
|
*/
|
|
214
159
|
this.fixedRowCount = false;
|
|
215
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* Controla se o conteúdo do picker está visível.
|
|
162
|
+
*
|
|
163
|
+
* @internal Estado reativo interno; não usar externamente.
|
|
164
|
+
*/
|
|
165
|
+
this.isPickerOpen = false;
|
|
166
|
+
/**
|
|
167
|
+
* Indica se o formulário associado desabilitou o componente.
|
|
168
|
+
*
|
|
169
|
+
* @internal Estado reativo interno.
|
|
170
|
+
*/
|
|
171
|
+
this.formDisabled = false;
|
|
172
|
+
/**
|
|
173
|
+
* Indica se existe slot `feedback` presente no host.
|
|
174
|
+
*
|
|
175
|
+
* @internal Estado reativo interno.
|
|
176
|
+
*/
|
|
177
|
+
this.hasFeedbackSlot = false;
|
|
178
|
+
/**
|
|
179
|
+
* Mensagem de validação customizada definida por `setCustomValidity`.
|
|
180
|
+
*
|
|
181
|
+
* @internal Estado reativo interno.
|
|
182
|
+
*/
|
|
183
|
+
this.customValidationMessage = '';
|
|
184
|
+
/**
|
|
185
|
+
* Mensagem retornada pelo validator customizado, se houver.
|
|
186
|
+
*
|
|
187
|
+
* @internal Estado reativo interno.
|
|
188
|
+
*/
|
|
189
|
+
this.validatorMessage = null;
|
|
190
|
+
/**
|
|
191
|
+
* Mensagem textual de validação proveniente do input interno.
|
|
192
|
+
*
|
|
193
|
+
* @internal Estado reativo interno.
|
|
194
|
+
*/
|
|
195
|
+
this.inputValidationMessage = '';
|
|
196
|
+
/**
|
|
197
|
+
* Indica que o usuário está editando o texto do input e que a validação
|
|
198
|
+
* textual está pendente (mensagem escondida até commit/blur).
|
|
199
|
+
*
|
|
200
|
+
* @internal
|
|
201
|
+
*/
|
|
202
|
+
this.inputValidationPending = false;
|
|
203
|
+
/**
|
|
204
|
+
* Indicador de execução do validator assíncrono.
|
|
205
|
+
*
|
|
206
|
+
* @internal Estado reativo interno.
|
|
207
|
+
*/
|
|
208
|
+
this.isValidating = false;
|
|
209
|
+
/**
|
|
210
|
+
* Lista normalizada de datas indisponíveis para seleção.
|
|
211
|
+
*
|
|
212
|
+
* @internal Mantida em formato `Date[]` para uso interno pelo calendário.
|
|
213
|
+
*/
|
|
214
|
+
this.normalizedDisabledDates = [];
|
|
215
|
+
/**
|
|
216
|
+
* Data final selecionada no modo de intervalo.
|
|
217
|
+
*
|
|
218
|
+
* @internal Estado reativo interno.
|
|
219
|
+
*/
|
|
220
|
+
this.rangeEnd = null;
|
|
221
|
+
/**
|
|
222
|
+
* Data inicial selecionada no modo de intervalo.
|
|
223
|
+
*
|
|
224
|
+
* @internal Estado reativo interno.
|
|
225
|
+
*/
|
|
226
|
+
this.rangeStart = null;
|
|
227
|
+
/**
|
|
228
|
+
* Data de referência usada para navegação visual (mês/semana exibidos).
|
|
229
|
+
*
|
|
230
|
+
* @internal Controle de navegação do calendário.
|
|
231
|
+
*/
|
|
232
|
+
this.referenceDate = new Date();
|
|
233
|
+
/**
|
|
234
|
+
* ID único do contêiner de feedback interno.
|
|
235
|
+
* Gerado por `Helpers.generateUniqueId` no momento da criação da instância
|
|
236
|
+
* e usado para associar mensagens de validação ao input interno.
|
|
237
|
+
*
|
|
238
|
+
* @internal
|
|
239
|
+
*/
|
|
240
|
+
this.feedbackId = Helpers.generateUniqueId('br-datetime-picker-feedback');
|
|
241
|
+
/**
|
|
242
|
+
* Snapshot da seleção inicial usada para restaurar em reset de formulário.
|
|
243
|
+
* Mantém uma cópia imutável do valor original para `formResetCallback`.
|
|
244
|
+
*
|
|
245
|
+
* @internal
|
|
246
|
+
*/
|
|
216
247
|
this.initialFormValue = null;
|
|
248
|
+
/**
|
|
249
|
+
* Contador monótono usado para invalidar execuções assíncronas de validação.
|
|
250
|
+
* Incrementado antes de cada execução; resultados com `runId` diferente são ignorados.
|
|
251
|
+
*
|
|
252
|
+
* @internal
|
|
253
|
+
*/
|
|
217
254
|
this.validationRunId = 0;
|
|
255
|
+
/**
|
|
256
|
+
* Indica se o componente já completou o ciclo `componentDidLoad`.
|
|
257
|
+
* Evita executar lógica de inicialização mais de uma vez.
|
|
258
|
+
*
|
|
259
|
+
* @internal
|
|
260
|
+
*/
|
|
218
261
|
this.isInitialized = false;
|
|
262
|
+
/**
|
|
263
|
+
* Flag para evitar loops de sincronização entre `value`, `valueAsDate` e `serializedValue`.
|
|
264
|
+
* Setada temporariamente durante operações programáticas de sincronização.
|
|
265
|
+
*
|
|
266
|
+
* @internal
|
|
267
|
+
*/
|
|
219
268
|
this.syncingCanonicalValues = false;
|
|
220
|
-
/**
|
|
269
|
+
/**
|
|
270
|
+
* Flag que sinaliza atualizações internas em `rangeValue`.
|
|
271
|
+
* Usada para distinguir atribuições programáticas de alterações externas.
|
|
272
|
+
*
|
|
273
|
+
* @internal
|
|
274
|
+
*/
|
|
275
|
+
this.syncingRangeValueInternally = false;
|
|
276
|
+
/**
|
|
277
|
+
* Mapeia cada modo para a função responsável por renderizar seu conteúdo.
|
|
278
|
+
* Facilita seleção de renderer sem condicionais espalhadas pelo código.
|
|
279
|
+
*
|
|
280
|
+
* @internal
|
|
281
|
+
*/
|
|
221
282
|
this.modeRendererMap = {
|
|
222
283
|
[DATETIME_PICKER_MODE.DATE]: () => this.renderDatePicker(),
|
|
223
|
-
[DATETIME_PICKER_MODE.TIME]: () => this.renderTimePicker(),
|
|
284
|
+
[DATETIME_PICKER_MODE.TIME]: () => this.selectionMode === 'range' ? this.renderRangeTimePickers() : this.renderTimePicker(),
|
|
224
285
|
[DATETIME_PICKER_MODE.DATETIME]: () => this.renderDateTimePicker(),
|
|
225
286
|
};
|
|
226
287
|
/**
|
|
227
|
-
*
|
|
288
|
+
* Indica se o listener global de clique fora do componente está anexado.
|
|
289
|
+
* Evita anexações/remoções redundantes do mesmo handler.
|
|
290
|
+
*
|
|
291
|
+
* @internal
|
|
292
|
+
*/
|
|
293
|
+
this.outsideClickListenerAttached = false;
|
|
294
|
+
/**
|
|
295
|
+
* Handler disparado por `br-datetime-input` para propagar mensagens de
|
|
296
|
+
* validação do input interno para o estado do componente.
|
|
297
|
+
*
|
|
298
|
+
* @param event CustomEvent<{ valid: boolean; message: string }> — detalhe com `valid` e `message`.
|
|
299
|
+
* @returns void
|
|
300
|
+
*/
|
|
301
|
+
this.handleInputValidationChange = (event) => {
|
|
302
|
+
event.stopPropagation();
|
|
303
|
+
const valid = event.detail.valid;
|
|
304
|
+
if (valid === null) {
|
|
305
|
+
// usuário está editando: escondemos a mensagem visual, mas mantemos
|
|
306
|
+
// o estado de validade indefinido até commit/blur/enter
|
|
307
|
+
this.inputValidationMessage = '';
|
|
308
|
+
this.inputValidationPending = true;
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
this.inputValidationMessage = valid ? '' : event.detail.message;
|
|
312
|
+
this.inputValidationPending = false;
|
|
313
|
+
}
|
|
314
|
+
this.syncFormValidity();
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* Handler principal que consolida eventos de `br-date-picker` / `br-time-picker`.
|
|
318
|
+
* Contém lógica de proteção contra valores desabilitados, navegação e emissão
|
|
319
|
+
* de eventos públicos apropriados.
|
|
228
320
|
*
|
|
229
|
-
* @param event
|
|
321
|
+
* @param event CustomEvent<DatetimePickerDateState> — detalhe com `referenceDate`, `value` e `range`.
|
|
230
322
|
*/
|
|
231
323
|
this.handleDateStateChange = (event) => {
|
|
232
|
-
// Evita que o evento interno dos subcomponentes vaze para fora do host.
|
|
233
324
|
event.stopPropagation();
|
|
234
325
|
if (this.isDisabled()) {
|
|
235
326
|
return;
|
|
236
327
|
}
|
|
328
|
+
const origin = event.detail.origin;
|
|
329
|
+
if (origin !== 'BR-DATETIME-INPUT') {
|
|
330
|
+
this.inputValidationMessage = '';
|
|
331
|
+
}
|
|
237
332
|
const { referenceDate, value, range } = event.detail;
|
|
333
|
+
if (this.isRangeNavigationState(value, range)) {
|
|
334
|
+
this.referenceDate = toDate(referenceDate);
|
|
335
|
+
this.updateFormInternals();
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
238
338
|
const selectedDate = this.resolveSelectedDateFromEvent(range, value);
|
|
239
339
|
if (selectedDate !== null && this.isDateDisabled(selectedDate)) {
|
|
240
340
|
return;
|
|
241
341
|
}
|
|
242
342
|
this.referenceDate = toDate(referenceDate);
|
|
243
343
|
const shouldEmitPublicEvent = this.resolvePublicEventEmissionForRange(range);
|
|
244
|
-
|
|
344
|
+
const nextValue = value === null ? null : toDate(value);
|
|
345
|
+
if (this.sameDate(this.value, nextValue)) {
|
|
346
|
+
this.handleUnchangedDateState(range, shouldEmitPublicEvent);
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
this.setComponentValue(nextValue, shouldEmitPublicEvent && this.isInitialized);
|
|
350
|
+
this.emitPendingRangeChange(range, shouldEmitPublicEvent);
|
|
245
351
|
};
|
|
352
|
+
/**
|
|
353
|
+
* Atualiza somente o horário de um dos limites do intervalo.
|
|
354
|
+
*
|
|
355
|
+
* @param boundary 'start' | 'end' — qual limite será atualizado.
|
|
356
|
+
* @param event CustomEvent<DatetimePickerDateState> — detalhe com novo `value`.
|
|
357
|
+
*/
|
|
358
|
+
this.handleRangeTimeStateChange = (boundary, event) => {
|
|
359
|
+
event.stopPropagation();
|
|
360
|
+
if (this.isDisabled() || event.detail.value === null)
|
|
361
|
+
return;
|
|
362
|
+
const displayedStart = this.cloneDate(this.rangeStart ?? this.referenceDate);
|
|
363
|
+
const displayedEnd = this.cloneDate(this.rangeEnd ?? this.referenceDate);
|
|
364
|
+
if (this.rangeStart === null)
|
|
365
|
+
this.rangeStart = displayedStart;
|
|
366
|
+
if (this.rangeEnd === null)
|
|
367
|
+
this.rangeEnd = displayedEnd;
|
|
368
|
+
const selected = toDate(event.detail.value);
|
|
369
|
+
const current = boundary === 'start' ? this.rangeStart : this.rangeEnd;
|
|
370
|
+
const base = current ?? this.referenceDate;
|
|
371
|
+
const next = set(base, {
|
|
372
|
+
hours: selected.getHours(),
|
|
373
|
+
minutes: selected.getMinutes(),
|
|
374
|
+
seconds: 0,
|
|
375
|
+
milliseconds: 0,
|
|
376
|
+
});
|
|
377
|
+
if (boundary === 'start')
|
|
378
|
+
this.rangeStart = next;
|
|
379
|
+
else
|
|
380
|
+
this.rangeEnd = next;
|
|
381
|
+
const nextComponentValue = this.rangeEnd ?? this.rangeStart;
|
|
382
|
+
if (!this.sameDate(this.value, nextComponentValue)) {
|
|
383
|
+
this.value = this.cloneDate(nextComponentValue);
|
|
384
|
+
}
|
|
385
|
+
this.syncCanonicalValues();
|
|
386
|
+
if (this.isInitialized) {
|
|
387
|
+
this.emitDateStateChange();
|
|
388
|
+
void this.validate();
|
|
389
|
+
}
|
|
390
|
+
this.updateFormInternals();
|
|
391
|
+
};
|
|
392
|
+
this.handleRangeStartTimeStateChange = (event) => this.handleRangeTimeStateChange('start', event);
|
|
393
|
+
this.handleRangeEndTimeStateChange = (event) => this.handleRangeTimeStateChange('end', event);
|
|
246
394
|
/**
|
|
247
395
|
* Alterna visibilidade do picker quando o input solicita.
|
|
396
|
+
*
|
|
397
|
+
* @param event Event — evento de toggle vindo do input.
|
|
248
398
|
*/
|
|
249
399
|
this.handleTogglePicker = (event) => {
|
|
250
400
|
if (this.isDisabled()) {
|
|
@@ -254,11 +404,14 @@ export class DatetimePicker {
|
|
|
254
404
|
const willOpen = !this.isPickerOpen;
|
|
255
405
|
if (willOpen) {
|
|
256
406
|
this.referenceDate = this.value === null ? toDate(new Date()) : toDate(this.value);
|
|
407
|
+
this.initializeTimeRangeBoundaries();
|
|
257
408
|
}
|
|
258
409
|
this.isPickerOpen = willOpen;
|
|
259
410
|
};
|
|
260
411
|
/**
|
|
261
412
|
* Fecha o picker quando o clique acontece fora do host.
|
|
413
|
+
*
|
|
414
|
+
* @param event MouseEvent — clique ocorrido no documento.
|
|
262
415
|
*/
|
|
263
416
|
this.handleOutsideClick = (event) => {
|
|
264
417
|
const eventPath = event.composedPath();
|
|
@@ -267,7 +420,6 @@ export class DatetimePicker {
|
|
|
267
420
|
}
|
|
268
421
|
this.isPickerOpen = false;
|
|
269
422
|
};
|
|
270
|
-
this.outsideClickListenerAttached = false;
|
|
271
423
|
/**
|
|
272
424
|
* Fecha o picker ao pressionar Escape, devolvendo o foco ao input interno.
|
|
273
425
|
*
|
|
@@ -278,42 +430,17 @@ export class DatetimePicker {
|
|
|
278
430
|
return;
|
|
279
431
|
event.stopPropagation();
|
|
280
432
|
this.isPickerOpen = false;
|
|
281
|
-
|
|
433
|
+
this.getNativeInputElement()?.focus();
|
|
282
434
|
};
|
|
283
435
|
}
|
|
284
|
-
formDisabledCallback(disabled) {
|
|
285
|
-
this.formDisabled = disabled;
|
|
286
|
-
}
|
|
287
|
-
/** API nativa de reset de form-associated custom elements. */
|
|
288
|
-
formResetCallback() {
|
|
289
|
-
this.customValidationMessage = '';
|
|
290
|
-
this.validatorMessage = null;
|
|
291
|
-
this.validationRunId++;
|
|
292
|
-
this.restoreSelection(this.initialFormValue);
|
|
293
|
-
}
|
|
294
|
-
/** API nativa de restauração de estado (histórico/autofill) do formulário. */
|
|
295
|
-
formStateRestoreCallback(state) {
|
|
296
|
-
if (typeof state !== 'string') {
|
|
297
|
-
this.restoreSelection(null);
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
if (this.isRangeRestoreMode()) {
|
|
301
|
-
this.restoreRangeStateFromSerialized(state);
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
this.restoreSingleStateFromSerialized(state);
|
|
305
|
-
}
|
|
306
436
|
/**
|
|
307
437
|
* Revalida o modo sempre que a prop mudar.
|
|
308
438
|
*
|
|
309
|
-
* @param newValue - Valor recebido via atributo/prop.
|
|
439
|
+
* @param {string} newValue - Valor recebido via atributo/prop.
|
|
310
440
|
*/
|
|
311
441
|
handleModeChange(newValue) {
|
|
312
442
|
this.ensureValidMode(newValue);
|
|
313
|
-
|
|
314
|
-
this.selectionMode = 'single';
|
|
315
|
-
return;
|
|
316
|
-
}
|
|
443
|
+
this.initializeTimeRangeBoundaries();
|
|
317
444
|
this.updateFormInternals();
|
|
318
445
|
}
|
|
319
446
|
/** Revalida o estado do formulário quando required mudar. */
|
|
@@ -330,14 +457,11 @@ export class DatetimePicker {
|
|
|
330
457
|
/** Reage a mudanças no modo de seleção e limpa intervalo quando necessário. */
|
|
331
458
|
handleSelectionModeChange(newValue) {
|
|
332
459
|
this.ensureValidSelectionMode(newValue);
|
|
333
|
-
if (this.selectionMode === 'range' && this.mode !== DATETIME_PICKER_MODE.DATE) {
|
|
334
|
-
this.mode = DATETIME_PICKER_MODE.DATE;
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
460
|
if (this.selectionMode === 'single') {
|
|
338
461
|
this.clearRangeState();
|
|
339
462
|
return;
|
|
340
463
|
}
|
|
464
|
+
this.initializeTimeRangeBoundaries();
|
|
341
465
|
this.updateFormInternals();
|
|
342
466
|
}
|
|
343
467
|
/** Revalida o dia inicial da semana sempre que a prop mudar. */
|
|
@@ -347,13 +471,16 @@ export class DatetimePicker {
|
|
|
347
471
|
/**
|
|
348
472
|
* Aplica ou limpa a seleção da data atual conforme o novo valor da prop.
|
|
349
473
|
*
|
|
350
|
-
* @param newValue - Novo estado da prop.
|
|
474
|
+
* @param {DatetimePickerInitialMoment} newValue - Novo estado da prop.
|
|
351
475
|
*/
|
|
352
476
|
handleInitialMomentChange(newValue) {
|
|
353
477
|
this.applyInitialMoment(newValue, this.isInitialized);
|
|
354
478
|
this.initialFormValue = this.cloneDate(this.value);
|
|
355
479
|
}
|
|
356
480
|
/** Sincroniza alterações externas do valor com o estado visual e o formulário nativo. */
|
|
481
|
+
/**
|
|
482
|
+
* @param {Date | null} newValue - Novo valor recebido via prop.
|
|
483
|
+
*/
|
|
357
484
|
handleValueChange(newValue) {
|
|
358
485
|
const normalizedValue = newValue instanceof Date && !Number.isNaN(newValue.getTime()) ? toDate(newValue) : null;
|
|
359
486
|
if (newValue !== null && normalizedValue === null) {
|
|
@@ -398,45 +525,33 @@ export class DatetimePicker {
|
|
|
398
525
|
this.syncDisabledDates(newValue);
|
|
399
526
|
}
|
|
400
527
|
handleRangeValueChange(newValue) {
|
|
401
|
-
if (!newValue || this.selectionMode !== 'range')
|
|
528
|
+
if (this.syncingRangeValueInternally || !newValue || this.selectionMode !== 'range')
|
|
402
529
|
return;
|
|
403
|
-
if (!isValidDatetimePickerDateRange(newValue)) {
|
|
404
|
-
reportInvalidPropValue(this.el, 'rangeValue', newValue, 'Informe um objeto com `start` e `end` como Date válido ou null.', 'Mantendo o último intervalo efetivo.');
|
|
405
|
-
return;
|
|
406
|
-
}
|
|
407
530
|
this.rangeStart = this.cloneDate(newValue.start);
|
|
408
531
|
this.rangeEnd = this.cloneDate(newValue.end);
|
|
409
|
-
const nextValue =
|
|
410
|
-
this.
|
|
411
|
-
this.setComponentValue(nextValue);
|
|
532
|
+
const nextValue = this.rangeEnd ?? this.rangeStart;
|
|
533
|
+
this.setComponentValue(nextValue, false);
|
|
412
534
|
}
|
|
413
|
-
/** Registra o listener global somente enquanto o picker está aberto. */
|
|
414
535
|
connectedCallback() {
|
|
415
536
|
if (this.isPickerOpen)
|
|
416
537
|
this.attachOutsideClickListener();
|
|
417
538
|
}
|
|
418
|
-
/** Remove o listener global para evitar vazamento de eventos ao desmontar. */
|
|
419
|
-
disconnectedCallback() {
|
|
420
|
-
this.detachOutsideClickListener();
|
|
421
|
-
}
|
|
422
|
-
/**
|
|
423
|
-
* Normaliza o modo antes da primeira renderização e aplica a data atual quando solicitado.
|
|
424
|
-
*/
|
|
425
539
|
componentWillLoad() {
|
|
426
|
-
|
|
427
|
-
const
|
|
540
|
+
const initialSerializedValue = this.serializedValue;
|
|
541
|
+
const initialValueAsDate = this.valueAsDate;
|
|
428
542
|
this.referenceDate = resolveSsrLocalDate(this.el, this.referenceDate);
|
|
429
543
|
this.initializeMode();
|
|
430
544
|
this.initializeSelectionMode();
|
|
431
545
|
this.initializeWeekStartsOn();
|
|
432
546
|
this.initializeDisabledDates();
|
|
433
547
|
this.initializeDefaultValue();
|
|
434
|
-
if (
|
|
435
|
-
this.restoreSerializedValue(
|
|
548
|
+
if (initialSerializedValue !== undefined) {
|
|
549
|
+
this.restoreSerializedValue(initialSerializedValue);
|
|
436
550
|
}
|
|
437
|
-
else if (
|
|
438
|
-
this.handleValueAsDateChange(
|
|
551
|
+
else if (initialValueAsDate !== undefined) {
|
|
552
|
+
this.handleValueAsDateChange(initialValueAsDate);
|
|
439
553
|
}
|
|
554
|
+
this.initializeTimeRangeBoundaries(true);
|
|
440
555
|
this.initialFormValue = this.cloneDate(this.value);
|
|
441
556
|
this.syncCanonicalValues();
|
|
442
557
|
this.updateFormInternals();
|
|
@@ -445,18 +560,58 @@ export class DatetimePicker {
|
|
|
445
560
|
this.isInitialized = true;
|
|
446
561
|
this.hasFeedbackSlot = this.el.querySelector('[slot="feedback"]') !== null;
|
|
447
562
|
}
|
|
563
|
+
disconnectedCallback() {
|
|
564
|
+
this.detachOutsideClickListener();
|
|
565
|
+
}
|
|
566
|
+
formDisabledCallback(disabled) {
|
|
567
|
+
this.formDisabled = disabled;
|
|
568
|
+
}
|
|
569
|
+
/** Restaura o estado do componente quando o formulário é restaurado. */
|
|
570
|
+
formResetCallback() {
|
|
571
|
+
this.customValidationMessage = '';
|
|
572
|
+
this.validatorMessage = null;
|
|
573
|
+
this.inputValidationMessage = '';
|
|
574
|
+
this.validationRunId++;
|
|
575
|
+
this.restoreSelection(this.initialFormValue);
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Restaura o estado do formulário (autofill / histórico).
|
|
579
|
+
*
|
|
580
|
+
* @param {string | File | FormData | null} state Estado serializado fornecido pelo navegador.
|
|
581
|
+
*/
|
|
582
|
+
formStateRestoreCallback(state) {
|
|
583
|
+
if (typeof state !== 'string') {
|
|
584
|
+
this.restoreSelection(null);
|
|
585
|
+
return;
|
|
586
|
+
}
|
|
587
|
+
if (this.isRangeRestoreMode()) {
|
|
588
|
+
this.restoreRangeStateFromSerialized(state);
|
|
589
|
+
return;
|
|
590
|
+
}
|
|
591
|
+
this.restoreSingleStateFromSerialized(state);
|
|
592
|
+
}
|
|
448
593
|
/**
|
|
449
|
-
* Define programaticamente as datas desabilitadas
|
|
594
|
+
* Define programaticamente as datas desabilitadas.
|
|
450
595
|
*
|
|
451
|
-
*
|
|
452
|
-
*
|
|
596
|
+
* Use quando scripts externos precisam fornecer uma lista tipada de
|
|
597
|
+
* datas a bloquear no calendário. Substitui a prop `disabledDates` para
|
|
598
|
+
* atualizações imperativas.
|
|
453
599
|
*
|
|
454
|
-
* @param dates
|
|
600
|
+
* @param dates Lista de datas (`Date` | `string`) a bloquear, ou `null` para limpar.
|
|
601
|
+
* @returns Promise<void> — resolve quando a atualização interna for aplicada.
|
|
455
602
|
*/
|
|
456
603
|
async setDisabledDates(dates) {
|
|
457
604
|
this.syncDisabledDates(dates);
|
|
458
605
|
}
|
|
459
|
-
/**
|
|
606
|
+
/**
|
|
607
|
+
* Define o valor do componente de forma imperativa.
|
|
608
|
+
*
|
|
609
|
+
* Aceita `Date`, string compatível com o `mode`, ou `null` para limpar a seleção.
|
|
610
|
+
* Validação de datas desabilitadas é aplicada antes da atribuição.
|
|
611
|
+
*
|
|
612
|
+
* @param value Date | string | null — valor a aplicar; `null` limpa a seleção.
|
|
613
|
+
* @returns Promise<void> — resolve quando o componente aplicar e sincronizar o valor.
|
|
614
|
+
*/
|
|
460
615
|
async setValue(value) {
|
|
461
616
|
if (this.isDisabled()) {
|
|
462
617
|
return;
|
|
@@ -473,18 +628,32 @@ export class DatetimePicker {
|
|
|
473
628
|
this.referenceDate = nextValue === null ? toDate(new Date()) : toDate(nextValue);
|
|
474
629
|
this.setComponentValue(nextValue);
|
|
475
630
|
}
|
|
476
|
-
/**
|
|
631
|
+
/**
|
|
632
|
+
* Retorna uma cópia do valor selecionado atualmente.
|
|
633
|
+
*
|
|
634
|
+
* @returns Promise<Date | null> — cópia imutável do `value` atual, ou `null`.
|
|
635
|
+
*/
|
|
477
636
|
async getValue() {
|
|
478
637
|
return this.cloneDate(this.value);
|
|
479
638
|
}
|
|
480
|
-
/**
|
|
639
|
+
/**
|
|
640
|
+
* Limpa valor e intervalo selecionados.
|
|
641
|
+
*
|
|
642
|
+
* Remove seleção atual e restaura a referência de navegação para a data atual.
|
|
643
|
+
*
|
|
644
|
+
* @returns Promise<void> — resolve após a limpeza e sincronização internas.
|
|
645
|
+
*/
|
|
481
646
|
async clear() {
|
|
482
647
|
this.rangeStart = null;
|
|
483
648
|
this.rangeEnd = null;
|
|
484
649
|
this.referenceDate = toDate(new Date());
|
|
485
650
|
this.setComponentValue(null);
|
|
486
651
|
}
|
|
487
|
-
/**
|
|
652
|
+
/**
|
|
653
|
+
* Abre o picker quando o componente estiver habilitado.
|
|
654
|
+
*
|
|
655
|
+
* @returns Promise<void> — resolve quando o estado visual for atualizado.
|
|
656
|
+
*/
|
|
488
657
|
async open() {
|
|
489
658
|
if (this.isDisabled()) {
|
|
490
659
|
return;
|
|
@@ -492,11 +661,19 @@ export class DatetimePicker {
|
|
|
492
661
|
this.referenceDate = this.value === null ? toDate(new Date()) : toDate(this.value);
|
|
493
662
|
this.isPickerOpen = true;
|
|
494
663
|
}
|
|
495
|
-
/**
|
|
664
|
+
/**
|
|
665
|
+
* Fecha o picker.
|
|
666
|
+
*
|
|
667
|
+
* @returns Promise<void> — resolve após atualização do estado de visibilidade.
|
|
668
|
+
*/
|
|
496
669
|
async close() {
|
|
497
670
|
this.isPickerOpen = false;
|
|
498
671
|
}
|
|
499
|
-
/**
|
|
672
|
+
/**
|
|
673
|
+
* Alterna o estado de abertura do picker.
|
|
674
|
+
*
|
|
675
|
+
* @returns Promise<void> — resolve quando a transição de estado terminar.
|
|
676
|
+
*/
|
|
500
677
|
async toggle() {
|
|
501
678
|
if (this.isPickerOpen) {
|
|
502
679
|
await this.close();
|
|
@@ -504,20 +681,32 @@ export class DatetimePicker {
|
|
|
504
681
|
}
|
|
505
682
|
await this.open();
|
|
506
683
|
}
|
|
507
|
-
/**
|
|
684
|
+
/**
|
|
685
|
+
* Move o foco para o input nativo interno.
|
|
686
|
+
*
|
|
687
|
+
* @returns Promise<void> — resolve imediatamente após tentar focar o elemento.
|
|
688
|
+
*/
|
|
508
689
|
async focusInput() {
|
|
509
|
-
|
|
510
|
-
await input?.focusInput?.();
|
|
690
|
+
this.getNativeInputElement()?.focus();
|
|
511
691
|
}
|
|
512
|
-
/**
|
|
692
|
+
/**
|
|
693
|
+
* Define um intervalo no modo atual e ativa `selectionMode="range"`.
|
|
694
|
+
*
|
|
695
|
+
* Valida datas contra bloqueios e sincroniza estado visual e de formulário.
|
|
696
|
+
* Em `datetime`, mantém os limites informados e sinaliza intervalo inválido
|
|
697
|
+
* quando o término precede o início, sem ajustar datas automaticamente.
|
|
698
|
+
*
|
|
699
|
+
* @param start Date | string | null — data inicial do intervalo.
|
|
700
|
+
* @param end Date | string | null — data final do intervalo.
|
|
701
|
+
* @returns Promise<void> — resolve quando o intervalo for aplicado e sincronizado.
|
|
702
|
+
*/
|
|
513
703
|
async setRange(start, end) {
|
|
514
704
|
if (this.isDisabled()) {
|
|
515
705
|
return;
|
|
516
706
|
}
|
|
517
707
|
this.selectionMode = 'range';
|
|
518
|
-
|
|
519
|
-
const
|
|
520
|
-
const normalizedEnd = this.parseMethodValue(end, DATETIME_PICKER_MODE.DATE);
|
|
708
|
+
const normalizedStart = this.parseMethodValue(start, this.mode);
|
|
709
|
+
const normalizedEnd = this.parseMethodValue(end, this.mode);
|
|
521
710
|
if ((normalizedStart !== null && this.isDateDisabled(normalizedStart)) ||
|
|
522
711
|
(normalizedEnd !== null && this.isDateDisabled(normalizedEnd))) {
|
|
523
712
|
this.clearRangeState();
|
|
@@ -525,17 +714,18 @@ export class DatetimePicker {
|
|
|
525
714
|
}
|
|
526
715
|
this.rangeStart = this.cloneDate(normalizedStart);
|
|
527
716
|
this.rangeEnd = this.cloneDate(normalizedEnd);
|
|
528
|
-
const nextValue =
|
|
717
|
+
const nextValue = this.rangeEnd ?? this.rangeStart;
|
|
529
718
|
this.referenceDate = nextValue === null ? toDate(new Date()) : toDate(nextValue);
|
|
530
719
|
this.setComponentValue(nextValue);
|
|
531
720
|
}
|
|
532
721
|
/**
|
|
533
722
|
* Retorna o intervalo de datas selecionado quando em modo `selectionMode="range"`.
|
|
534
723
|
*
|
|
535
|
-
* @returns
|
|
724
|
+
* @returns Promise<{ start: Date | null; end: Date | null } | null> — objeto com `start`/`end` ou `null` quando
|
|
725
|
+
* não estiver em modo `range`.
|
|
536
726
|
*/
|
|
537
727
|
async getRange() {
|
|
538
|
-
if (this.selectionMode !== 'range'
|
|
728
|
+
if (this.selectionMode !== 'range') {
|
|
539
729
|
return null;
|
|
540
730
|
}
|
|
541
731
|
return {
|
|
@@ -546,29 +736,52 @@ export class DatetimePicker {
|
|
|
546
736
|
/**
|
|
547
737
|
* Consulta se o picker está atualmente aberto.
|
|
548
738
|
*
|
|
549
|
-
* @returns `true` se o picker está visível, `false` caso contrário.
|
|
739
|
+
* @returns Promise<boolean> — `true` se o picker está visível, `false` caso contrário.
|
|
550
740
|
*/
|
|
551
741
|
async isOpen() {
|
|
552
742
|
return this.isPickerOpen;
|
|
553
743
|
}
|
|
554
|
-
/**
|
|
744
|
+
/**
|
|
745
|
+
* Restaura o estado inicial atualmente registrado para reset.
|
|
746
|
+
*
|
|
747
|
+
* @returns Promise<void> — resolve quando a seleção inicial for restaurada.
|
|
748
|
+
*/
|
|
555
749
|
async resetToInitial() {
|
|
556
750
|
this.restoreSelection(this.initialFormValue);
|
|
557
751
|
}
|
|
558
|
-
/**
|
|
752
|
+
/**
|
|
753
|
+
* Permite que consumidores acionem validação nativa do formulário via host.
|
|
754
|
+
*
|
|
755
|
+
* @returns Promise<boolean> — resultado da Constraint Validation API para o host.
|
|
756
|
+
*/
|
|
559
757
|
async checkValidity() {
|
|
560
758
|
return this.elementInternals.checkValidity();
|
|
561
759
|
}
|
|
562
|
-
/**
|
|
760
|
+
/**
|
|
761
|
+
* Permite exibir mensagens nativas de validação no host.
|
|
762
|
+
*
|
|
763
|
+
* @returns Promise<boolean> — `true` se a mensagem foi exibida e o formulário é válido.
|
|
764
|
+
*/
|
|
563
765
|
async reportValidity() {
|
|
564
766
|
return this.elementInternals.reportValidity();
|
|
565
767
|
}
|
|
566
|
-
/**
|
|
768
|
+
/**
|
|
769
|
+
* Define ou limpa uma mensagem de validade customizada.
|
|
770
|
+
*
|
|
771
|
+
* @param message string — mensagem de validação; string vazia remove a mensagem.
|
|
772
|
+
* @returns Promise<void> — resolve após sincronizar a validade no host.
|
|
773
|
+
*/
|
|
567
774
|
async setCustomValidity(message) {
|
|
568
775
|
this.customValidationMessage = message;
|
|
569
776
|
this.syncFormValidity();
|
|
570
777
|
}
|
|
571
|
-
/**
|
|
778
|
+
/**
|
|
779
|
+
* Executa o validator customizado (se houver) e valida o controle.
|
|
780
|
+
*
|
|
781
|
+
* Emite eventos de início/conclusão da validação e atualiza mensagens internas.
|
|
782
|
+
*
|
|
783
|
+
* @returns Promise<boolean> — `true` se a seleção for considerada válida.
|
|
784
|
+
*/
|
|
572
785
|
async validate() {
|
|
573
786
|
const validator = resolveFormValidator(this.validator);
|
|
574
787
|
if (!validator || this.isDisabled())
|
|
@@ -577,9 +790,16 @@ export class DatetimePicker {
|
|
|
577
790
|
this.isValidating = true;
|
|
578
791
|
this.validatorMessage = null;
|
|
579
792
|
this.syncFormValidity();
|
|
580
|
-
this.brDatetimePickerValidationChange.emit({
|
|
793
|
+
this.brDatetimePickerValidationChange.emit({
|
|
794
|
+
validating: true,
|
|
795
|
+
valid: null,
|
|
796
|
+
message: null,
|
|
797
|
+
});
|
|
581
798
|
const value = this.selectionMode === 'range'
|
|
582
|
-
? {
|
|
799
|
+
? {
|
|
800
|
+
start: this.cloneDate(this.rangeStart),
|
|
801
|
+
end: this.cloneDate(this.rangeEnd),
|
|
802
|
+
}
|
|
583
803
|
: this.cloneDate(this.value);
|
|
584
804
|
const message = await runFormValidator(validator, value);
|
|
585
805
|
if (runId !== this.validationRunId)
|
|
@@ -588,10 +808,19 @@ export class DatetimePicker {
|
|
|
588
808
|
this.isValidating = false;
|
|
589
809
|
this.syncFormValidity();
|
|
590
810
|
const valid = message === null && (await this.checkValidity());
|
|
591
|
-
this.brDatetimePickerValidationChange.emit({
|
|
811
|
+
this.brDatetimePickerValidationChange.emit({
|
|
812
|
+
validating: false,
|
|
813
|
+
valid,
|
|
814
|
+
message,
|
|
815
|
+
});
|
|
592
816
|
return valid;
|
|
593
817
|
}
|
|
594
|
-
/**
|
|
818
|
+
/**
|
|
819
|
+
* Retorna um snapshot serializável da Constraint Validation API.
|
|
820
|
+
*
|
|
821
|
+
* @returns Promise<FormValidationState> — estado atual de validação do host,
|
|
822
|
+
* pronto para conversão e restauração via `formStateRestoreCallback`.
|
|
823
|
+
*/
|
|
595
824
|
async getValidationState() {
|
|
596
825
|
return getFormValidationState(this.elementInternals);
|
|
597
826
|
}
|
|
@@ -603,36 +832,52 @@ export class DatetimePicker {
|
|
|
603
832
|
ensureValidSelectionMode(value) {
|
|
604
833
|
this.selectionMode = normalizeDatetimePickerSelectionMode(value);
|
|
605
834
|
}
|
|
606
|
-
/**
|
|
607
|
-
* Normaliza o modo de seleção logo na inicialização.
|
|
608
|
-
*/
|
|
609
835
|
initializeSelectionMode() {
|
|
610
836
|
this.handleSelectionModeChange(this.selectionMode);
|
|
611
837
|
}
|
|
612
|
-
/** Normaliza o dia inicial da semana logo na inicialização. */
|
|
613
838
|
initializeWeekStartsOn() {
|
|
614
839
|
this.handleWeekStartsOnChange(this.weekStartsOn);
|
|
615
840
|
}
|
|
616
|
-
/**
|
|
841
|
+
/**
|
|
842
|
+
* Valida o dia inicial da semana e corrige para padrão quando necessário.
|
|
843
|
+
*
|
|
844
|
+
* @param value unknown — valor recebido via prop/atributo a ser normalizado.
|
|
845
|
+
*/
|
|
617
846
|
ensureValidWeekStartsOn(value) {
|
|
618
847
|
this.weekStartsOn = normalizeDatetimePickerWeekStartsOn(value);
|
|
619
848
|
}
|
|
620
|
-
/**
|
|
621
|
-
* Limpa o estado do intervalo de datas ao mudar para modo single.
|
|
622
|
-
*/
|
|
623
849
|
clearRangeState() {
|
|
624
850
|
this.rangeStart = null;
|
|
625
851
|
this.rangeEnd = null;
|
|
626
852
|
this.updateFormInternals();
|
|
627
853
|
}
|
|
628
|
-
/**
|
|
854
|
+
/**
|
|
855
|
+
* Materializa os horários exibidos pelos dois timers como limites reais.
|
|
856
|
+
* Assim o range de horário já nasce completo, o input pode representá-lo na
|
|
857
|
+
* primeira renderização e nenhum timer depende da referência do outro.
|
|
858
|
+
*/
|
|
859
|
+
initializeTimeRangeBoundaries(duringInitialization = false) {
|
|
860
|
+
if ((!this.isInitialized && !duringInitialization) ||
|
|
861
|
+
this.selectionMode !== 'range' ||
|
|
862
|
+
this.mode !== DATETIME_PICKER_MODE.TIME) {
|
|
863
|
+
return;
|
|
864
|
+
}
|
|
865
|
+
const fallback = this.cloneDate(this.value ?? this.referenceDate);
|
|
866
|
+
if (this.rangeStart === null)
|
|
867
|
+
this.rangeStart = this.cloneDate(fallback);
|
|
868
|
+
if (this.rangeEnd === null)
|
|
869
|
+
this.rangeEnd = this.cloneDate(fallback);
|
|
870
|
+
this.value = this.cloneDate(this.rangeEnd);
|
|
871
|
+
}
|
|
629
872
|
isRangeDateSelectionMode() {
|
|
630
|
-
return this.selectionMode === 'range'
|
|
873
|
+
return this.selectionMode === 'range';
|
|
631
874
|
}
|
|
632
875
|
/**
|
|
633
|
-
*
|
|
876
|
+
* Decide se um evento público deve ser emitido após atualização vinda de
|
|
877
|
+
* subcomponentes (calendário/relógio).
|
|
634
878
|
*
|
|
635
|
-
*
|
|
879
|
+
* @param range DatetimePickerDateRange | undefined — estado parcial do range vindo do subcomponente.
|
|
880
|
+
* @returns boolean — `true` quando o evento deve ser emitido externamente.
|
|
636
881
|
*/
|
|
637
882
|
resolvePublicEventEmissionForRange(range) {
|
|
638
883
|
if (!this.isRangeDateSelectionMode()) {
|
|
@@ -645,13 +890,63 @@ export class DatetimePicker {
|
|
|
645
890
|
this.setRangeState(range);
|
|
646
891
|
return isFinalRangeClick;
|
|
647
892
|
}
|
|
648
|
-
/**
|
|
893
|
+
/**
|
|
894
|
+
* Resolve a data efetivamente selecionada no evento para validações e bloqueios.
|
|
895
|
+
*
|
|
896
|
+
* @param range DatetimePickerDateRange | undefined — intervalo parcial (quando aplicável).
|
|
897
|
+
* @param value Date | null — valor principal vindo do subcomponente.
|
|
898
|
+
* @returns Date | null — data final a ser considerada para validação.
|
|
899
|
+
*/
|
|
649
900
|
resolveSelectedDateFromEvent(range, value) {
|
|
650
901
|
if (!this.isRangeDateSelectionMode() || range === undefined) {
|
|
651
902
|
return value;
|
|
652
903
|
}
|
|
653
904
|
return range.end ?? range.start ?? value;
|
|
654
905
|
}
|
|
906
|
+
/**
|
|
907
|
+
* Identifica navegação visual que preserva integralmente o range selecionado.
|
|
908
|
+
*
|
|
909
|
+
* @param value Date | null — valor principal do evento.
|
|
910
|
+
* @param range DatetimePickerDateRange | undefined — range parcial do evento.
|
|
911
|
+
* @returns boolean — `true` quando a navegação não altera a seleção atual.
|
|
912
|
+
*/
|
|
913
|
+
isRangeNavigationState(value, range) {
|
|
914
|
+
return (range !== undefined &&
|
|
915
|
+
this.sameDate(range.start, this.rangeStart) &&
|
|
916
|
+
this.sameDate(range.end, this.rangeEnd) &&
|
|
917
|
+
this.sameDate(value, this.value));
|
|
918
|
+
}
|
|
919
|
+
/**
|
|
920
|
+
* Consolida um evento cujo valor principal permaneceu inalterado.
|
|
921
|
+
*
|
|
922
|
+
* @param range DatetimePickerDateRange | undefined — estado parcial do range.
|
|
923
|
+
* @param shouldEmitPublicEvent boolean — indica se o evento público deve ser emitido.
|
|
924
|
+
*/
|
|
925
|
+
handleUnchangedDateState(range, shouldEmitPublicEvent) {
|
|
926
|
+
this.syncCanonicalValues();
|
|
927
|
+
const shouldNotifyRange = this.isInitialized && this.isRangeDateSelectionMode() && range !== undefined;
|
|
928
|
+
if (shouldNotifyRange && shouldEmitPublicEvent) {
|
|
929
|
+
this.emitDateStateChange();
|
|
930
|
+
void this.validate();
|
|
931
|
+
}
|
|
932
|
+
else if (shouldNotifyRange) {
|
|
933
|
+
this.emitCanonicalChange(range);
|
|
934
|
+
}
|
|
935
|
+
this.updateFormInternals();
|
|
936
|
+
}
|
|
937
|
+
/**
|
|
938
|
+
* Emite a seleção parcial de range quando os eventos públicos foram adiados
|
|
939
|
+
* para evitar duplicidade com listeners legados.
|
|
940
|
+
*
|
|
941
|
+
* @param range DatetimePickerDateRange | undefined — snapshot parcial do range.
|
|
942
|
+
* @param shouldEmitPublicEvent boolean — se deve ser emitido publicamente.
|
|
943
|
+
*/
|
|
944
|
+
emitPendingRangeChange(range, shouldEmitPublicEvent) {
|
|
945
|
+
if (shouldEmitPublicEvent || !this.isInitialized || !this.isRangeDateSelectionMode() || range === undefined) {
|
|
946
|
+
return;
|
|
947
|
+
}
|
|
948
|
+
this.emitCanonicalChange(range);
|
|
949
|
+
}
|
|
655
950
|
attachOutsideClickListener() {
|
|
656
951
|
if (this.outsideClickListenerAttached)
|
|
657
952
|
return;
|
|
@@ -664,15 +959,9 @@ export class DatetimePicker {
|
|
|
664
959
|
document.removeEventListener('click', this.handleOutsideClick);
|
|
665
960
|
this.outsideClickListenerAttached = false;
|
|
666
961
|
}
|
|
667
|
-
/**
|
|
668
|
-
* Garante que o componente inicie com um modo suportado.
|
|
669
|
-
*/
|
|
670
962
|
initializeMode() {
|
|
671
963
|
this.ensureValidMode(this.mode);
|
|
672
964
|
}
|
|
673
|
-
/**
|
|
674
|
-
* Normaliza a coleção de datas desabilitadas na inicialização.
|
|
675
|
-
*/
|
|
676
965
|
initializeDisabledDates() {
|
|
677
966
|
this.syncDisabledDates(this.disabledDates);
|
|
678
967
|
}
|
|
@@ -693,9 +982,6 @@ export class DatetimePicker {
|
|
|
693
982
|
this.setComponentValue(null);
|
|
694
983
|
}
|
|
695
984
|
}
|
|
696
|
-
/**
|
|
697
|
-
* Aplica a seleção inicial configurada na prop.
|
|
698
|
-
*/
|
|
699
985
|
initializeDefaultValue() {
|
|
700
986
|
if (this.value instanceof Date && !Number.isNaN(this.value.getTime())) {
|
|
701
987
|
this.referenceDate = toDate(this.value);
|
|
@@ -736,13 +1022,16 @@ export class DatetimePicker {
|
|
|
736
1022
|
this.rangeEnd = null;
|
|
737
1023
|
this.setComponentValue(selectedDate, shouldEmitEvents);
|
|
738
1024
|
}
|
|
739
|
-
/** Indica se o estado serializado deve ser interpretado como intervalo. */
|
|
740
1025
|
isRangeRestoreMode() {
|
|
741
|
-
return this.selectionMode === 'range'
|
|
1026
|
+
return this.selectionMode === 'range';
|
|
742
1027
|
}
|
|
743
|
-
/**
|
|
1028
|
+
/**
|
|
1029
|
+
* Restaura estado de intervalo a partir do valor serializado do formulário.
|
|
1030
|
+
*
|
|
1031
|
+
* @param serializedState string — valor serializado vindo do formulário.
|
|
1032
|
+
*/
|
|
744
1033
|
restoreRangeStateFromSerialized(serializedState) {
|
|
745
|
-
const restoredRange = parseDatetimePickerSerializedRange(serializedState);
|
|
1034
|
+
const restoredRange = parseDatetimePickerSerializedRange(serializedState, this.mode, this.referenceDate);
|
|
746
1035
|
if (restoredRange === null) {
|
|
747
1036
|
this.restoreSelection(null);
|
|
748
1037
|
return;
|
|
@@ -752,7 +1041,11 @@ export class DatetimePicker {
|
|
|
752
1041
|
this.rangeEnd = end;
|
|
753
1042
|
this.restoreSelection(end);
|
|
754
1043
|
}
|
|
755
|
-
/**
|
|
1044
|
+
/**
|
|
1045
|
+
* Restaura estado de seleção única a partir do valor serializado do formulário.
|
|
1046
|
+
*
|
|
1047
|
+
* @param serializedState string — valor serializado vindo do formulário.
|
|
1048
|
+
*/
|
|
756
1049
|
restoreSingleStateFromSerialized(serializedState) {
|
|
757
1050
|
const restoredValue = parseDatetimePickerSerializedValue(serializedState, this.mode, this.referenceDate);
|
|
758
1051
|
if (restoredValue !== null && this.isDateDisabled(restoredValue)) {
|
|
@@ -761,7 +1054,13 @@ export class DatetimePicker {
|
|
|
761
1054
|
}
|
|
762
1055
|
this.restoreSelection(restoredValue);
|
|
763
1056
|
}
|
|
764
|
-
/**
|
|
1057
|
+
/**
|
|
1058
|
+
* Converte entradas aceitas por métodos públicos em `Date | null`.
|
|
1059
|
+
*
|
|
1060
|
+
* @param value Date | string | null — valor bruto recebido pelo método público.
|
|
1061
|
+
* @param mode DatetimePickerMode — modo atual para parsing de strings.
|
|
1062
|
+
* @returns Date | null — representação normalizada ou `null` se inválida.
|
|
1063
|
+
*/
|
|
765
1064
|
parseMethodValue(value, mode) {
|
|
766
1065
|
if (value === null) {
|
|
767
1066
|
return null;
|
|
@@ -771,7 +1070,11 @@ export class DatetimePicker {
|
|
|
771
1070
|
}
|
|
772
1071
|
return parseDatetimePickerSerializedValue(value, mode, this.referenceDate);
|
|
773
1072
|
}
|
|
774
|
-
/**
|
|
1073
|
+
/**
|
|
1074
|
+
* Aplica a ponte serializada usando os mesmos parsers já usados por restore de formulário.
|
|
1075
|
+
*
|
|
1076
|
+
* @param serializedValue string — valor serializado a ser restaurado.
|
|
1077
|
+
*/
|
|
775
1078
|
restoreSerializedValue(serializedValue) {
|
|
776
1079
|
if (this.isRangeRestoreMode()) {
|
|
777
1080
|
this.restoreRangeStateFromSerialized(serializedValue);
|
|
@@ -790,7 +1093,11 @@ export class DatetimePicker {
|
|
|
790
1093
|
this.valueAsDate = nextValueAsDate;
|
|
791
1094
|
this.syncingCanonicalValues = false;
|
|
792
1095
|
}
|
|
793
|
-
/**
|
|
1096
|
+
/**
|
|
1097
|
+
* Retorna o mesmo valor que será submetido pelo ElementInternals.
|
|
1098
|
+
*
|
|
1099
|
+
* @returns string — valor serializado pronto para `setFormValue`.
|
|
1100
|
+
*/
|
|
794
1101
|
getSerializedValue() {
|
|
795
1102
|
const zero = (date) => (date === null ? null : set(date, { seconds: 0, milliseconds: 0 }));
|
|
796
1103
|
return (serializeDatetimePickerFormValue(this.value === null ? null : zero(this.value), {
|
|
@@ -804,11 +1111,24 @@ export class DatetimePicker {
|
|
|
804
1111
|
sameDate(left, right) {
|
|
805
1112
|
return left === right || (left !== null && right !== null && left.getTime() === right.getTime());
|
|
806
1113
|
}
|
|
807
|
-
/**
|
|
1114
|
+
/**
|
|
1115
|
+
* Busca o input nativo interno para ações imperativas de foco.
|
|
1116
|
+
*
|
|
1117
|
+
* @returns HTMLElement | undefined — elemento `input` nativo interno, quando disponível.
|
|
1118
|
+
*/
|
|
808
1119
|
getNativeInputElement() {
|
|
809
|
-
return
|
|
1120
|
+
return this.el.shadowRoot
|
|
1121
|
+
?.querySelector('br-datetime-input')
|
|
1122
|
+
?.shadowRoot?.querySelector('br-input')
|
|
1123
|
+
?.shadowRoot?.querySelector('input');
|
|
810
1124
|
}
|
|
811
|
-
/**
|
|
1125
|
+
/**
|
|
1126
|
+
* Atualiza estado interno, FormData e validação com uma única chamada.
|
|
1127
|
+
*
|
|
1128
|
+
* @param nextValue Date | null — próximo valor a ser aplicado no componente.
|
|
1129
|
+
* @param shouldEmitPublicEvent boolean — controla emissão de eventos públicos.
|
|
1130
|
+
* @returns void
|
|
1131
|
+
*/
|
|
812
1132
|
setComponentValue(nextValue, shouldEmitPublicEvent = true) {
|
|
813
1133
|
this.value = this.cloneDate(nextValue);
|
|
814
1134
|
this.syncCanonicalValues();
|
|
@@ -820,13 +1140,13 @@ export class DatetimePicker {
|
|
|
820
1140
|
}
|
|
821
1141
|
/** Propaga o estado atual consolidado para consumidores externos do componente raiz. */
|
|
822
1142
|
emitDateStateChange() {
|
|
823
|
-
const range = this.selectionMode === 'range'
|
|
1143
|
+
const range = this.selectionMode === 'range'
|
|
824
1144
|
? {
|
|
825
1145
|
start: this.cloneDate(this.rangeStart),
|
|
826
1146
|
end: this.cloneDate(this.rangeEnd),
|
|
827
1147
|
}
|
|
828
1148
|
: undefined;
|
|
829
|
-
const rangeDates = range !== undefined && range.start !== null && range.end !== null
|
|
1149
|
+
const rangeDates = this.mode === DATETIME_PICKER_MODE.DATE && range !== undefined && range.start !== null && range.end !== null
|
|
830
1150
|
? this.buildRangeDatesState(range.start, range.end)
|
|
831
1151
|
: undefined;
|
|
832
1152
|
this.dateStateChange.emit({
|
|
@@ -835,13 +1155,118 @@ export class DatetimePicker {
|
|
|
835
1155
|
range,
|
|
836
1156
|
rangeDates,
|
|
837
1157
|
});
|
|
838
|
-
|
|
839
|
-
this.rangeValue = range;
|
|
1158
|
+
this.emitCanonicalChange(range);
|
|
840
1159
|
this.valueChange.emit(this.cloneDate(this.value));
|
|
841
1160
|
dispatchNativeFormEvent(this.el, 'input');
|
|
842
1161
|
dispatchNativeFormEvent(this.el, 'change');
|
|
843
1162
|
}
|
|
844
|
-
/**
|
|
1163
|
+
/** Emite o contrato público sem expor detalhes incidentais do estado interno. */
|
|
1164
|
+
emitCanonicalChange(rangeSnapshot) {
|
|
1165
|
+
const serializedValue = this.getSerializedValue();
|
|
1166
|
+
if (this.selectionMode === 'range') {
|
|
1167
|
+
const range = rangeSnapshot ?? {
|
|
1168
|
+
start: this.rangeStart,
|
|
1169
|
+
end: this.rangeEnd,
|
|
1170
|
+
};
|
|
1171
|
+
const rangeValue = {
|
|
1172
|
+
start: this.cloneDate(range.start),
|
|
1173
|
+
end: this.cloneDate(range.end),
|
|
1174
|
+
};
|
|
1175
|
+
this.syncingRangeValueInternally = true;
|
|
1176
|
+
this.rangeValue = rangeValue;
|
|
1177
|
+
this.syncingRangeValueInternally = false;
|
|
1178
|
+
const value = {
|
|
1179
|
+
start: this.serializeRangeBoundary(rangeValue.start),
|
|
1180
|
+
end: this.serializeRangeBoundary(rangeValue.end),
|
|
1181
|
+
};
|
|
1182
|
+
const detail = {
|
|
1183
|
+
selectionMode: 'range',
|
|
1184
|
+
value,
|
|
1185
|
+
serializedValue,
|
|
1186
|
+
complete: value.start !== null && value.end !== null,
|
|
1187
|
+
};
|
|
1188
|
+
if (this.mode === DATETIME_PICKER_MODE.DATE) {
|
|
1189
|
+
this.brDatetimePickerChange.emit({ mode: 'date', ...detail });
|
|
1190
|
+
}
|
|
1191
|
+
else if (this.mode === DATETIME_PICKER_MODE.TIME) {
|
|
1192
|
+
this.brDatetimePickerChange.emit({ mode: 'time', ...detail });
|
|
1193
|
+
}
|
|
1194
|
+
else {
|
|
1195
|
+
this.brDatetimePickerChange.emit({ mode: 'datetime', ...detail });
|
|
1196
|
+
}
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
if (this.mode === DATETIME_PICKER_MODE.TIME) {
|
|
1200
|
+
this.brDatetimePickerChange.emit({
|
|
1201
|
+
mode: 'time',
|
|
1202
|
+
selectionMode: 'single',
|
|
1203
|
+
value: this.value === null
|
|
1204
|
+
? null
|
|
1205
|
+
: {
|
|
1206
|
+
hours: this.value.getHours(),
|
|
1207
|
+
minutes: this.value.getMinutes(),
|
|
1208
|
+
},
|
|
1209
|
+
serializedValue,
|
|
1210
|
+
});
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
if (this.mode === DATETIME_PICKER_MODE.DATE) {
|
|
1214
|
+
this.brDatetimePickerChange.emit({
|
|
1215
|
+
mode: 'date',
|
|
1216
|
+
selectionMode: 'single',
|
|
1217
|
+
value: this.cloneDate(this.value),
|
|
1218
|
+
serializedValue,
|
|
1219
|
+
});
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
this.brDatetimePickerChange.emit({
|
|
1223
|
+
mode: 'datetime',
|
|
1224
|
+
selectionMode: 'single',
|
|
1225
|
+
value: this.cloneDate(this.value),
|
|
1226
|
+
serializedValue,
|
|
1227
|
+
});
|
|
1228
|
+
}
|
|
1229
|
+
/**
|
|
1230
|
+
* Serializa uma data civil sem conversão para UTC ou mudança de dia.
|
|
1231
|
+
*
|
|
1232
|
+
* @param value Date — data a serializar (somente componente civil).
|
|
1233
|
+
* @returns string — formato `YYYY-MM-DD`.
|
|
1234
|
+
*/
|
|
1235
|
+
serializeDateOnly(value) {
|
|
1236
|
+
const year = String(value.getFullYear()).padStart(4, '0');
|
|
1237
|
+
const month = String(value.getMonth() + 1).padStart(2, '0');
|
|
1238
|
+
const day = String(value.getDate()).padStart(2, '0');
|
|
1239
|
+
return `${year}-${month}-${day}`;
|
|
1240
|
+
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Serializa um limite do intervalo conforme o modo sem expor objetos Date no payload.
|
|
1243
|
+
*
|
|
1244
|
+
* @param value Date | null — limite a serializar.
|
|
1245
|
+
* @returns string | null — representação serializada do limite ou `null`.
|
|
1246
|
+
*/
|
|
1247
|
+
serializeRangeBoundary(value) {
|
|
1248
|
+
if (value === null)
|
|
1249
|
+
return null;
|
|
1250
|
+
if (this.mode === DATETIME_PICKER_MODE.DATE)
|
|
1251
|
+
return this.serializeDateOnly(value);
|
|
1252
|
+
if (this.mode === DATETIME_PICKER_MODE.TIME) {
|
|
1253
|
+
return `${String(value.getHours()).padStart(2, '0')}:${String(value.getMinutes()).padStart(2, '0')}`;
|
|
1254
|
+
}
|
|
1255
|
+
return serializeDatetimePickerFormValue(value, {
|
|
1256
|
+
mode: DATETIME_PICKER_MODE.DATETIME,
|
|
1257
|
+
selectionMode: 'single',
|
|
1258
|
+
rangeStart: null,
|
|
1259
|
+
rangeEnd: null,
|
|
1260
|
+
referenceDate: value,
|
|
1261
|
+
});
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* Expande o intervalo completo e marca quais dias estão desabilitados.
|
|
1265
|
+
*
|
|
1266
|
+
* @param start Date — início do intervalo.
|
|
1267
|
+
* @param end Date — fim do intervalo.
|
|
1268
|
+
* @returns Array<{date: Date, disabled: boolean}> — lista diária com flags.
|
|
1269
|
+
*/
|
|
845
1270
|
buildRangeDatesState(start, end) {
|
|
846
1271
|
const intervalStart = start.getTime() <= end.getTime() ? start : end;
|
|
847
1272
|
const intervalEnd = start.getTime() <= end.getTime() ? end : start;
|
|
@@ -853,8 +1278,13 @@ export class DatetimePicker {
|
|
|
853
1278
|
disabled: this.isDateDisabled(date),
|
|
854
1279
|
}));
|
|
855
1280
|
}
|
|
856
|
-
/**
|
|
1281
|
+
/**
|
|
1282
|
+
* Restaura seleção e data de referência a partir de uma data já validada.
|
|
1283
|
+
*
|
|
1284
|
+
* @param nextValue Date | null — valor validado a ser restaurado como seleção.
|
|
1285
|
+
*/
|
|
857
1286
|
restoreSelection(nextValue) {
|
|
1287
|
+
this.inputValidationMessage = '';
|
|
858
1288
|
this.value = this.cloneDate(nextValue);
|
|
859
1289
|
if (this.selectionMode === 'single') {
|
|
860
1290
|
this.rangeStart = null;
|
|
@@ -864,12 +1294,15 @@ export class DatetimePicker {
|
|
|
864
1294
|
this.syncCanonicalValues();
|
|
865
1295
|
this.updateFormInternals();
|
|
866
1296
|
}
|
|
867
|
-
/**
|
|
1297
|
+
/**
|
|
1298
|
+
* Atualiza o estado local de intervalo a partir do evento do calendário.
|
|
1299
|
+
*
|
|
1300
|
+
* @param nextRange DatetimePickerDateRange | undefined — novo snapshot do intervalo.
|
|
1301
|
+
*/
|
|
868
1302
|
setRangeState(nextRange) {
|
|
869
1303
|
this.rangeStart = this.cloneDate(nextRange?.start ?? null);
|
|
870
1304
|
this.rangeEnd = this.cloneDate(nextRange?.end ?? null);
|
|
871
1305
|
}
|
|
872
|
-
/** Mantém ElementInternals sincronizado com estado e regras do componente. */
|
|
873
1306
|
updateFormInternals() {
|
|
874
1307
|
this.syncFormValue();
|
|
875
1308
|
this.syncFormValidity();
|
|
@@ -889,9 +1322,20 @@ export class DatetimePicker {
|
|
|
889
1322
|
});
|
|
890
1323
|
this.elementInternals.setFormValue(nextValue);
|
|
891
1324
|
}
|
|
892
|
-
catch {
|
|
893
|
-
|
|
894
|
-
|
|
1325
|
+
catch { }
|
|
1326
|
+
}
|
|
1327
|
+
/** Deriva o erro de ordenação sem modificar os limites escolhidos. */
|
|
1328
|
+
getRangeOrderValidationMessage() {
|
|
1329
|
+
const invalidRange = this.selectionMode === 'range' &&
|
|
1330
|
+
this.mode !== DATETIME_PICKER_MODE.TIME &&
|
|
1331
|
+
this.rangeStart !== null &&
|
|
1332
|
+
this.rangeEnd !== null &&
|
|
1333
|
+
this.rangeStart.getTime() > this.rangeEnd.getTime();
|
|
1334
|
+
if (!invalidRange)
|
|
1335
|
+
return '';
|
|
1336
|
+
return this.mode === DATETIME_PICKER_MODE.DATETIME
|
|
1337
|
+
? DATETIME_RANGE_ORDER_MESSAGE
|
|
1338
|
+
: 'A data inicial deve anteceder a data final.';
|
|
895
1339
|
}
|
|
896
1340
|
/** Espelha a regra de required no mecanismo nativo de validade. */
|
|
897
1341
|
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: consolida flags nativos relacionados sem esconder a precedência das mensagens.
|
|
@@ -907,50 +1351,40 @@ export class DatetimePicker {
|
|
|
907
1351
|
rangeEnd: this.rangeEnd,
|
|
908
1352
|
referenceDate: this.referenceDate,
|
|
909
1353
|
});
|
|
910
|
-
const min = this.parseConstraintValue(this.min
|
|
911
|
-
const max = this.parseConstraintValue(this.max
|
|
1354
|
+
const min = this.parseConstraintValue(this.min);
|
|
1355
|
+
const max = this.parseConstraintValue(this.max);
|
|
912
1356
|
const values = this.selectionMode === 'range' ? [this.rangeStart, this.rangeEnd] : [this.value];
|
|
913
1357
|
const rangeUnderflow = min !== null && values.some((value) => value !== null && value.getTime() < min.getTime());
|
|
914
1358
|
const rangeOverflow = max !== null && values.some((value) => value !== null && value.getTime() > max.getTime());
|
|
915
|
-
const
|
|
916
|
-
this.rangeStart !== null &&
|
|
917
|
-
this.rangeEnd !== null &&
|
|
918
|
-
this.rangeStart.getTime() > this.rangeEnd.getTime();
|
|
1359
|
+
const rangeOrderMessage = this.getRangeOrderValidationMessage();
|
|
919
1360
|
const flags = {
|
|
920
|
-
customError: this.customValidationMessage !== '' ||
|
|
1361
|
+
customError: this.customValidationMessage !== '' ||
|
|
1362
|
+
this.inputValidationMessage !== '' ||
|
|
1363
|
+
Boolean(this.validatorMessage) ||
|
|
1364
|
+
rangeOrderMessage !== '' ||
|
|
1365
|
+
this.inputValidationPending,
|
|
921
1366
|
rangeOverflow,
|
|
922
1367
|
rangeUnderflow,
|
|
923
1368
|
valueMissing: missing,
|
|
924
1369
|
};
|
|
925
1370
|
const message = this.customValidationMessage ||
|
|
1371
|
+
this.inputValidationMessage ||
|
|
926
1372
|
this.validatorMessage ||
|
|
927
1373
|
(missing
|
|
928
1374
|
? 'Preencha este campo.'
|
|
929
|
-
:
|
|
930
|
-
?
|
|
1375
|
+
: rangeOrderMessage
|
|
1376
|
+
? rangeOrderMessage
|
|
931
1377
|
: rangeUnderflow
|
|
932
1378
|
? 'Selecione uma data igual ou posterior ao mínimo.'
|
|
933
1379
|
: rangeOverflow
|
|
934
1380
|
? 'Selecione uma data igual ou anterior ao máximo.'
|
|
935
1381
|
: '');
|
|
936
|
-
setFormValidity(this.elementInternals, flags, message, this.getNativeInputElement());
|
|
937
|
-
}
|
|
938
|
-
catch {
|
|
939
|
-
// Ambientes sem ElementInternals completo não devem falhar.
|
|
1382
|
+
setFormValidity(this.elementInternals, flags, message, this.getNativeInputElement() ?? undefined);
|
|
940
1383
|
}
|
|
1384
|
+
catch { }
|
|
941
1385
|
}
|
|
942
|
-
parseConstraintValue(value
|
|
943
|
-
|
|
944
|
-
return null;
|
|
945
|
-
if (!(value instanceof Date) && typeof value !== 'string') {
|
|
946
|
-
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).');
|
|
947
|
-
return null;
|
|
948
|
-
}
|
|
949
|
-
const parsedValue = this.parseMethodValue(value, this.mode);
|
|
950
|
-
if (parsedValue !== null)
|
|
951
|
-
return parsedValue;
|
|
952
|
-
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).');
|
|
953
|
-
return null;
|
|
1386
|
+
parseConstraintValue(value) {
|
|
1387
|
+
return value === null ? null : this.parseMethodValue(value, this.mode);
|
|
954
1388
|
}
|
|
955
1389
|
isDisabled() {
|
|
956
1390
|
return isFormControlDisabled(this.disabled, this.formDisabled);
|
|
@@ -1008,24 +1442,35 @@ export class DatetimePicker {
|
|
|
1008
1442
|
}
|
|
1009
1443
|
/** Renderiza o campo de entrada responsável por abrir e sincronizar o picker. */
|
|
1010
1444
|
renderInputField() {
|
|
1011
|
-
return (h("br-datetime-input", {
|
|
1012
|
-
this.datetimeInputElement = element;
|
|
1013
|
-
}, 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" }));
|
|
1445
|
+
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" }));
|
|
1014
1446
|
}
|
|
1015
1447
|
/** Renderiza apenas o seletor de data. */
|
|
1016
1448
|
renderDatePicker() {
|
|
1017
|
-
const effectiveSelectionMode = this.
|
|
1449
|
+
const effectiveSelectionMode = this.selectionMode;
|
|
1018
1450
|
return (h("br-date-picker", { ...this.getSharedDateStateBindings(), selectionMode: effectiveSelectionMode, weekStartsOn: this.weekStartsOn, locale: this.locale, disabled: this.isDisabled(), disabledDates: this.normalizedDisabledDates, fixedRowCount: this.fixedRowCount }));
|
|
1019
1451
|
}
|
|
1020
|
-
/** Renderiza
|
|
1021
|
-
renderTimePicker() {
|
|
1022
|
-
|
|
1452
|
+
/** Renderiza um seletor de hora simples ou um limite do intervalo. */
|
|
1453
|
+
renderTimePicker(boundary) {
|
|
1454
|
+
const rangeValue = boundary === 'start' ? this.rangeStart : this.rangeEnd;
|
|
1455
|
+
const referenceDate = this.cloneDate(rangeValue ?? this.referenceDate);
|
|
1456
|
+
const selectedValue = this.cloneDate(rangeValue);
|
|
1457
|
+
const timerKey = boundary === undefined ? 'single' : `${boundary}-${rangeValue?.getTime() ?? `empty-${referenceDate.getTime()}`}`;
|
|
1458
|
+
const handler = boundary === 'start'
|
|
1459
|
+
? this.handleRangeStartTimeStateChange
|
|
1460
|
+
: boundary === 'end'
|
|
1461
|
+
? this.handleRangeEndTimeStateChange
|
|
1462
|
+
: this.handleDateStateChange;
|
|
1463
|
+
return (h("br-time-picker", { key: timerKey, referenceDate: referenceDate, value: boundary === undefined ? this.cloneDate(this.value) : selectedValue, onDateStateChange: handler, disabled: this.isDisabled() }));
|
|
1464
|
+
}
|
|
1465
|
+
/** Renderiza os horários inicial e final lado a lado no modo range. */
|
|
1466
|
+
renderRangeTimePickers() {
|
|
1467
|
+
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'))));
|
|
1023
1468
|
}
|
|
1024
1469
|
/**
|
|
1025
1470
|
* Renderiza a combinação de data e horário no modo `datetime`.
|
|
1026
1471
|
*/
|
|
1027
1472
|
renderDateTimePicker() {
|
|
1028
|
-
return (h(Fragment, null, this.renderDatePicker(), this.renderDivider(), this.renderTimePicker()));
|
|
1473
|
+
return (h(Fragment, null, this.renderDatePicker(), this.renderDivider(), this.selectionMode === 'range' ? this.renderRangeTimePickers() : this.renderTimePicker()));
|
|
1029
1474
|
}
|
|
1030
1475
|
/** Renderiza o separador visual entre data e hora no modo combinado. */
|
|
1031
1476
|
renderDivider() {
|
|
@@ -1045,7 +1490,11 @@ export class DatetimePicker {
|
|
|
1045
1490
|
* Renderização principal do componente.
|
|
1046
1491
|
*/
|
|
1047
1492
|
render() {
|
|
1048
|
-
|
|
1493
|
+
const validationMessage = this.customValidationMessage ||
|
|
1494
|
+
this.inputValidationMessage ||
|
|
1495
|
+
this.validatorMessage ||
|
|
1496
|
+
(this.inputValidationPending ? '' : this.getRangeOrderValidationMessage());
|
|
1497
|
+
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)));
|
|
1049
1498
|
}
|
|
1050
1499
|
static get is() { return "br-datetime-picker"; }
|
|
1051
1500
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1084,7 +1533,7 @@ export class DatetimePicker {
|
|
|
1084
1533
|
"name": "default",
|
|
1085
1534
|
"text": "'datetime'"
|
|
1086
1535
|
}],
|
|
1087
|
-
"text": "
|
|
1536
|
+
"text": "Modo exibido pelo componente.\n\nValores: `date` | `time` | `datetime`.\nValores inv\u00E1lidos s\u00E3o normalizados para o padr\u00E3o."
|
|
1088
1537
|
},
|
|
1089
1538
|
"getter": false,
|
|
1090
1539
|
"setter": false,
|
|
@@ -1114,7 +1563,7 @@ export class DatetimePicker {
|
|
|
1114
1563
|
"name": "default",
|
|
1115
1564
|
"text": "'pt-BR'"
|
|
1116
1565
|
}],
|
|
1117
|
-
"text": "
|
|
1566
|
+
"text": "Locale usado para formata\u00E7\u00E3o e r\u00F3tulos."
|
|
1118
1567
|
},
|
|
1119
1568
|
"getter": false,
|
|
1120
1569
|
"setter": false,
|
|
@@ -1137,7 +1586,7 @@ export class DatetimePicker {
|
|
|
1137
1586
|
"name": "default",
|
|
1138
1587
|
"text": "''"
|
|
1139
1588
|
}],
|
|
1140
|
-
"text": "
|
|
1589
|
+
"text": "Texto placeholder exibido no input."
|
|
1141
1590
|
},
|
|
1142
1591
|
"getter": false,
|
|
1143
1592
|
"setter": false,
|
|
@@ -1156,7 +1605,10 @@ export class DatetimePicker {
|
|
|
1156
1605
|
"required": false,
|
|
1157
1606
|
"optional": false,
|
|
1158
1607
|
"docs": {
|
|
1159
|
-
"tags": [
|
|
1608
|
+
"tags": [{
|
|
1609
|
+
"name": "default",
|
|
1610
|
+
"text": "''"
|
|
1611
|
+
}],
|
|
1160
1612
|
"text": "Nome do campo para submiss\u00E3o em formul\u00E1rios nativos."
|
|
1161
1613
|
},
|
|
1162
1614
|
"getter": false,
|
|
@@ -1176,8 +1628,11 @@ export class DatetimePicker {
|
|
|
1176
1628
|
"required": false,
|
|
1177
1629
|
"optional": false,
|
|
1178
1630
|
"docs": {
|
|
1179
|
-
"tags": [
|
|
1180
|
-
|
|
1631
|
+
"tags": [{
|
|
1632
|
+
"name": "default",
|
|
1633
|
+
"text": "false"
|
|
1634
|
+
}],
|
|
1635
|
+
"text": "Indica se o campo \u00E9 requerido para submiss\u00E3o do formul\u00E1rio."
|
|
1181
1636
|
},
|
|
1182
1637
|
"getter": false,
|
|
1183
1638
|
"setter": false,
|
|
@@ -1202,10 +1657,10 @@ export class DatetimePicker {
|
|
|
1202
1657
|
"optional": false,
|
|
1203
1658
|
"docs": {
|
|
1204
1659
|
"tags": [{
|
|
1205
|
-
"name": "
|
|
1206
|
-
"text": "
|
|
1660
|
+
"name": "default",
|
|
1661
|
+
"text": "null"
|
|
1207
1662
|
}],
|
|
1208
|
-
"text": "Menor data/
|
|
1663
|
+
"text": "Menor data/hora aceito (Date | string | null)."
|
|
1209
1664
|
},
|
|
1210
1665
|
"getter": false,
|
|
1211
1666
|
"setter": false,
|
|
@@ -1230,10 +1685,10 @@ export class DatetimePicker {
|
|
|
1230
1685
|
"optional": false,
|
|
1231
1686
|
"docs": {
|
|
1232
1687
|
"tags": [{
|
|
1233
|
-
"name": "
|
|
1234
|
-
"text": "
|
|
1688
|
+
"name": "default",
|
|
1689
|
+
"text": "null"
|
|
1235
1690
|
}],
|
|
1236
|
-
"text": "Maior data/
|
|
1691
|
+
"text": "Maior data/hora aceito (Date | string | null)."
|
|
1237
1692
|
},
|
|
1238
1693
|
"getter": false,
|
|
1239
1694
|
"setter": false,
|
|
@@ -1260,10 +1715,10 @@ export class DatetimePicker {
|
|
|
1260
1715
|
"optional": true,
|
|
1261
1716
|
"docs": {
|
|
1262
1717
|
"tags": [{
|
|
1263
|
-
"name": "
|
|
1264
|
-
"text": "
|
|
1718
|
+
"name": "default",
|
|
1719
|
+
"text": "undefined"
|
|
1265
1720
|
}],
|
|
1266
|
-
"text": "
|
|
1721
|
+
"text": "Validador customizado (s\u00EDncrono ou ass\u00EDncrono) para a sele\u00E7\u00E3o.\n\nRecebe `Date | DatetimePickerDateRange | null` como valor."
|
|
1267
1722
|
},
|
|
1268
1723
|
"getter": false,
|
|
1269
1724
|
"setter": false
|
|
@@ -1286,8 +1741,11 @@ export class DatetimePicker {
|
|
|
1286
1741
|
"required": false,
|
|
1287
1742
|
"optional": false,
|
|
1288
1743
|
"docs": {
|
|
1289
|
-
"tags": [
|
|
1290
|
-
|
|
1744
|
+
"tags": [{
|
|
1745
|
+
"name": "default",
|
|
1746
|
+
"text": "'single'"
|
|
1747
|
+
}],
|
|
1748
|
+
"text": "Tipo de sele\u00E7\u00E3o: `single` ou `range`."
|
|
1291
1749
|
},
|
|
1292
1750
|
"getter": false,
|
|
1293
1751
|
"setter": false,
|
|
@@ -1317,7 +1775,7 @@ export class DatetimePicker {
|
|
|
1317
1775
|
"name": "default",
|
|
1318
1776
|
"text": "0"
|
|
1319
1777
|
}],
|
|
1320
|
-
"text": "
|
|
1778
|
+
"text": "Dia inicial da semana exibido no calend\u00E1rio (0 = Dom, 6 = S\u00E1b)."
|
|
1321
1779
|
},
|
|
1322
1780
|
"getter": false,
|
|
1323
1781
|
"setter": false,
|
|
@@ -1346,11 +1804,8 @@ export class DatetimePicker {
|
|
|
1346
1804
|
"tags": [{
|
|
1347
1805
|
"name": "default",
|
|
1348
1806
|
"text": "null"
|
|
1349
|
-
}, {
|
|
1350
|
-
"name": "example",
|
|
1351
|
-
"text": "```html\n<br-datetime-picker initial-moment=\"now\"></br-datetime-picker>\n```"
|
|
1352
1807
|
}],
|
|
1353
|
-
"text": "
|
|
1808
|
+
"text": "Valor inicial da sele\u00E7\u00E3o: `'now' | Date | string | null`."
|
|
1354
1809
|
},
|
|
1355
1810
|
"getter": false,
|
|
1356
1811
|
"setter": false,
|
|
@@ -1375,10 +1830,10 @@ export class DatetimePicker {
|
|
|
1375
1830
|
"optional": false,
|
|
1376
1831
|
"docs": {
|
|
1377
1832
|
"tags": [{
|
|
1378
|
-
"name": "
|
|
1379
|
-
"text": "
|
|
1833
|
+
"name": "default",
|
|
1834
|
+
"text": "null"
|
|
1380
1835
|
}],
|
|
1381
|
-
"text": "
|
|
1836
|
+
"text": "Valor selecionado pelo usu\u00E1rio (Date | null).\n\nPode ser controlado externamente e \u00E9 refletido internamente."
|
|
1382
1837
|
},
|
|
1383
1838
|
"getter": false,
|
|
1384
1839
|
"setter": false,
|
|
@@ -1396,10 +1851,10 @@ export class DatetimePicker {
|
|
|
1396
1851
|
"optional": true,
|
|
1397
1852
|
"docs": {
|
|
1398
1853
|
"tags": [{
|
|
1399
|
-
"name": "
|
|
1400
|
-
"text": "
|
|
1854
|
+
"name": "default",
|
|
1855
|
+
"text": "undefined"
|
|
1401
1856
|
}],
|
|
1402
|
-
"text": "Representa\u00E7\u00E3o serializada compat\u00EDvel com
|
|
1857
|
+
"text": "Representa\u00E7\u00E3o serializada compat\u00EDvel com controles HTML.\n\nFormatos variam conforme `mode`. Em intervalos, usa `in\u00EDcio/fim`."
|
|
1403
1858
|
},
|
|
1404
1859
|
"getter": false,
|
|
1405
1860
|
"setter": false,
|
|
@@ -1423,10 +1878,13 @@ export class DatetimePicker {
|
|
|
1423
1878
|
"optional": true,
|
|
1424
1879
|
"docs": {
|
|
1425
1880
|
"tags": [{
|
|
1426
|
-
"name": "
|
|
1427
|
-
"text": "
|
|
1881
|
+
"name": "internal",
|
|
1882
|
+
"text": "Mant\u00E9m compatibilidade com APIs legadas."
|
|
1883
|
+
}, {
|
|
1884
|
+
"name": "default",
|
|
1885
|
+
"text": "undefined"
|
|
1428
1886
|
}],
|
|
1429
|
-
"text": "Espelho tipado da sele\u00E7\u00E3o atual
|
|
1887
|
+
"text": "Espelho tipado da sele\u00E7\u00E3o atual (`valueAsDate`)."
|
|
1430
1888
|
},
|
|
1431
1889
|
"getter": false,
|
|
1432
1890
|
"setter": false
|
|
@@ -1450,10 +1908,10 @@ export class DatetimePicker {
|
|
|
1450
1908
|
"optional": true,
|
|
1451
1909
|
"docs": {
|
|
1452
1910
|
"tags": [{
|
|
1453
|
-
"name": "
|
|
1454
|
-
"text": "
|
|
1911
|
+
"name": "default",
|
|
1912
|
+
"text": "undefined"
|
|
1455
1913
|
}],
|
|
1456
|
-
"text": "Intervalo controlado quando `selectionMode=\"range\"`.\
|
|
1914
|
+
"text": "Intervalo controlado quando `selectionMode=\"range\"`.\n\nEm `datetime`, preserva as datas e hor\u00E1rios informados; t\u00E9rmino anterior ao\nin\u00EDcio torna o controle inv\u00E1lido, sem reordenar ou avan\u00E7ar datas."
|
|
1457
1915
|
},
|
|
1458
1916
|
"getter": false,
|
|
1459
1917
|
"setter": false
|
|
@@ -1473,7 +1931,7 @@ export class DatetimePicker {
|
|
|
1473
1931
|
"name": "default",
|
|
1474
1932
|
"text": "false"
|
|
1475
1933
|
}],
|
|
1476
|
-
"text": "Desabilita toda a intera\u00E7\u00E3o do componente
|
|
1934
|
+
"text": "Desabilita toda a intera\u00E7\u00E3o do componente."
|
|
1477
1935
|
},
|
|
1478
1936
|
"getter": false,
|
|
1479
1937
|
"setter": false,
|
|
@@ -1502,14 +1960,8 @@ export class DatetimePicker {
|
|
|
1502
1960
|
"tags": [{
|
|
1503
1961
|
"name": "default",
|
|
1504
1962
|
"text": "null"
|
|
1505
|
-
}, {
|
|
1506
|
-
"name": "example",
|
|
1507
|
-
"text": "```html\n<br-datetime-picker mode=\"date\" disabled-dates=\"2026-09-07 2026-09-08\"></br-datetime-picker>\n```"
|
|
1508
|
-
}, {
|
|
1509
|
-
"name": "example",
|
|
1510
|
-
"text": "```js\nconst picker = document.querySelector('br-datetime-picker');\npicker.disabledDates = [new Date(2026, 8, 7), '2026-09-08'];\n```"
|
|
1511
1963
|
}],
|
|
1512
|
-
"text": "
|
|
1964
|
+
"text": "Datas indispon\u00EDveis para sele\u00E7\u00E3o. Aceita `Date[]`, `string` ou `null`.\n\nDatas inv\u00E1lidas s\u00E3o ignoradas. A compara\u00E7\u00E3o considera apenas o dia."
|
|
1513
1965
|
},
|
|
1514
1966
|
"getter": false,
|
|
1515
1967
|
"setter": false,
|
|
@@ -1532,7 +1984,7 @@ export class DatetimePicker {
|
|
|
1532
1984
|
"name": "default",
|
|
1533
1985
|
"text": "false"
|
|
1534
1986
|
}],
|
|
1535
|
-
"text": "
|
|
1987
|
+
"text": "Mant\u00E9m n\u00FAmero fixo de linhas no calend\u00E1rio (6 semanas) quando `true`."
|
|
1536
1988
|
},
|
|
1537
1989
|
"getter": false,
|
|
1538
1990
|
"setter": false,
|
|
@@ -1549,6 +2001,8 @@ export class DatetimePicker {
|
|
|
1549
2001
|
"hasFeedbackSlot": {},
|
|
1550
2002
|
"customValidationMessage": {},
|
|
1551
2003
|
"validatorMessage": {},
|
|
2004
|
+
"inputValidationMessage": {},
|
|
2005
|
+
"inputValidationPending": {},
|
|
1552
2006
|
"isValidating": {},
|
|
1553
2007
|
"normalizedDisabledDates": {},
|
|
1554
2008
|
"rangeEnd": {},
|
|
@@ -1564,12 +2018,18 @@ export class DatetimePicker {
|
|
|
1564
2018
|
"cancelable": true,
|
|
1565
2019
|
"composed": true,
|
|
1566
2020
|
"docs": {
|
|
1567
|
-
"tags": [
|
|
1568
|
-
|
|
2021
|
+
"tags": [{
|
|
2022
|
+
"name": "event",
|
|
2023
|
+
"text": "dateStateChange"
|
|
2024
|
+
}, {
|
|
2025
|
+
"name": "type",
|
|
2026
|
+
"text": "{CustomEvent<DatetimePickerDateState>}"
|
|
2027
|
+
}],
|
|
2028
|
+
"text": "Evento p\u00FAblico emitido quando a data de refer\u00EAncia ou a sele\u00E7\u00E3o mudam.\n\nPayload (`DatetimePickerDateState`):\n- `referenceDate`: Date \u2014 data usada para navega\u00E7\u00E3o visual (m\u00EAs/semana exibidos).\n- `value`: Date | null \u2014 valor selecionado atualmente."
|
|
1569
2029
|
},
|
|
1570
2030
|
"complexType": {
|
|
1571
2031
|
"original": "DatetimePickerDateState",
|
|
1572
|
-
"resolved": "{ referenceDate: Date; value: Date; range?: DatetimePickerDateRange; rangeDates?: DatetimePickerRangeDateState[]; }",
|
|
2032
|
+
"resolved": "{ referenceDate: Date; value: Date; range?: DatetimePickerDateRange; rangeDates?: DatetimePickerRangeDateState[]; origin?: string; }",
|
|
1573
2033
|
"references": {
|
|
1574
2034
|
"DatetimePickerDateState": {
|
|
1575
2035
|
"location": "import",
|
|
@@ -1579,6 +2039,34 @@ export class DatetimePicker {
|
|
|
1579
2039
|
}
|
|
1580
2040
|
}
|
|
1581
2041
|
}
|
|
2042
|
+
}, {
|
|
2043
|
+
"method": "brDatetimePickerChange",
|
|
2044
|
+
"name": "brDatetimePickerChange",
|
|
2045
|
+
"bubbles": true,
|
|
2046
|
+
"cancelable": true,
|
|
2047
|
+
"composed": true,
|
|
2048
|
+
"docs": {
|
|
2049
|
+
"tags": [{
|
|
2050
|
+
"name": "event",
|
|
2051
|
+
"text": "brDatetimePickerChange"
|
|
2052
|
+
}, {
|
|
2053
|
+
"name": "type",
|
|
2054
|
+
"text": "{CustomEvent<DatetimePickerChangeDetail>}"
|
|
2055
|
+
}],
|
|
2056
|
+
"text": "Evento p\u00FAblico can\u00F4nico emitido quando a sele\u00E7\u00E3o muda.\n\nPayload (`DatetimePickerChangeDetail`):\n- `mode`: DatetimePickerMode \u2014 modo atual do componente (`date` | `time` | `datetime`).\n- `selectionMode`: DatetimePickerSelectionMode \u2014 `single` ou `range`.\n- `value`: Date | null | DatetimePickerDateRange \u2014 sele\u00E7\u00E3o atual (tipo depende de `selectionMode`).\n- `serializedValue`: string | undefined \u2014 representa\u00E7\u00E3o serializada para integra\u00E7\u00E3o com formul\u00E1rios."
|
|
2057
|
+
},
|
|
2058
|
+
"complexType": {
|
|
2059
|
+
"original": "DatetimePickerChangeDetail",
|
|
2060
|
+
"resolved": "{ mode: \"date\"; selectionMode: \"range\"; value: { start: string; end: string; }; serializedValue: string; complete: boolean; } | { mode: \"date\"; selectionMode: \"single\"; value: Date; serializedValue: string; } | { mode: \"datetime\"; selectionMode: \"range\"; value: { start: string; end: string; }; serializedValue: string; complete: boolean; } | { mode: \"datetime\"; selectionMode: \"single\"; value: Date; serializedValue: string; } | { mode: \"time\"; selectionMode: \"range\"; value: { start: string; end: string; }; serializedValue: string; complete: boolean; } | { mode: \"time\"; selectionMode: \"single\"; value: { hours: number; minutes: number; }; serializedValue: string; }",
|
|
2061
|
+
"references": {
|
|
2062
|
+
"DatetimePickerChangeDetail": {
|
|
2063
|
+
"location": "import",
|
|
2064
|
+
"path": "./datetime-picker.types",
|
|
2065
|
+
"id": "src/components/datetime-picker/datetime-picker.types.ts::DatetimePickerChangeDetail",
|
|
2066
|
+
"referenceLocation": "DatetimePickerChangeDetail"
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
1582
2070
|
}, {
|
|
1583
2071
|
"method": "valueChange",
|
|
1584
2072
|
"name": "valueChange",
|
|
@@ -1588,7 +2076,13 @@ export class DatetimePicker {
|
|
|
1588
2076
|
"docs": {
|
|
1589
2077
|
"tags": [{
|
|
1590
2078
|
"name": "deprecated",
|
|
1591
|
-
"text": "Use `
|
|
2079
|
+
"text": "Use `brDatetimePickerChange` para receber a sele\u00E7\u00E3o completa e tipada.\n\nPayload (legacy): `Date | null` \u2014 valor selecionado."
|
|
2080
|
+
}, {
|
|
2081
|
+
"name": "event",
|
|
2082
|
+
"text": "valueChange"
|
|
2083
|
+
}, {
|
|
2084
|
+
"name": "type",
|
|
2085
|
+
"text": "{CustomEvent<Date | null>}"
|
|
1592
2086
|
}],
|
|
1593
2087
|
"text": "Evento emitido quando o valor selecionado muda."
|
|
1594
2088
|
},
|
|
@@ -1609,8 +2103,14 @@ export class DatetimePicker {
|
|
|
1609
2103
|
"cancelable": true,
|
|
1610
2104
|
"composed": true,
|
|
1611
2105
|
"docs": {
|
|
1612
|
-
"tags": [
|
|
1613
|
-
|
|
2106
|
+
"tags": [{
|
|
2107
|
+
"name": "event",
|
|
2108
|
+
"text": "brDatetimePickerValidationChange"
|
|
2109
|
+
}, {
|
|
2110
|
+
"name": "type",
|
|
2111
|
+
"text": "{CustomEvent<FormValidationChangeDetail>}"
|
|
2112
|
+
}],
|
|
2113
|
+
"text": "Emitido ao iniciar e concluir a valida\u00E7\u00E3o customizada.\n\nPayload (`FormValidationChangeDetail`):\n- `validating`: boolean \u2014 indica se a valida\u00E7\u00E3o est\u00E1 em execu\u00E7\u00E3o.\n- `valid`: boolean | null \u2014 resultado da valida\u00E7\u00E3o (`null` enquanto valida).\n- `message`: string | null \u2014 mensagem de valida\u00E7\u00E3o associada."
|
|
1614
2114
|
},
|
|
1615
2115
|
"complexType": {
|
|
1616
2116
|
"original": "FormValidationChangeDetail",
|
|
@@ -1634,7 +2134,7 @@ export class DatetimePicker {
|
|
|
1634
2134
|
"parameters": [{
|
|
1635
2135
|
"name": "dates",
|
|
1636
2136
|
"type": "DatetimePickerDisabledDate[]",
|
|
1637
|
-
"docs": "
|
|
2137
|
+
"docs": "Lista de datas (`Date` | `string`) a bloquear, ou `null` para limpar."
|
|
1638
2138
|
}],
|
|
1639
2139
|
"references": {
|
|
1640
2140
|
"Promise": {
|
|
@@ -1651,10 +2151,13 @@ export class DatetimePicker {
|
|
|
1651
2151
|
"return": "Promise<void>"
|
|
1652
2152
|
},
|
|
1653
2153
|
"docs": {
|
|
1654
|
-
"text": "Define programaticamente as datas desabilitadas
|
|
2154
|
+
"text": "Define programaticamente as datas desabilitadas.\n\nUse quando scripts externos precisam fornecer uma lista tipada de\ndatas a bloquear no calend\u00E1rio. Substitui a prop `disabledDates` para\natualiza\u00E7\u00F5es imperativas.",
|
|
1655
2155
|
"tags": [{
|
|
1656
2156
|
"name": "param",
|
|
1657
|
-
"text": "dates
|
|
2157
|
+
"text": "dates Lista de datas (`Date` | `string`) a bloquear, ou `null` para limpar."
|
|
2158
|
+
}, {
|
|
2159
|
+
"name": "returns",
|
|
2160
|
+
"text": "Promise<void> \u2014 resolve quando a atualiza\u00E7\u00E3o interna for aplicada."
|
|
1658
2161
|
}]
|
|
1659
2162
|
}
|
|
1660
2163
|
},
|
|
@@ -1664,7 +2167,7 @@ export class DatetimePicker {
|
|
|
1664
2167
|
"parameters": [{
|
|
1665
2168
|
"name": "value",
|
|
1666
2169
|
"type": "string | Date",
|
|
1667
|
-
"docs": ""
|
|
2170
|
+
"docs": "Date | string | null \u2014 valor a aplicar; `null` limpa a sele\u00E7\u00E3o."
|
|
1668
2171
|
}],
|
|
1669
2172
|
"references": {
|
|
1670
2173
|
"Promise": {
|
|
@@ -1679,8 +2182,14 @@ export class DatetimePicker {
|
|
|
1679
2182
|
"return": "Promise<void>"
|
|
1680
2183
|
},
|
|
1681
2184
|
"docs": {
|
|
1682
|
-
"text": "Define o valor
|
|
1683
|
-
"tags": [
|
|
2185
|
+
"text": "Define o valor do componente de forma imperativa.\n\nAceita `Date`, string compat\u00EDvel com o `mode`, ou `null` para limpar a sele\u00E7\u00E3o.\nValida\u00E7\u00E3o de datas desabilitadas \u00E9 aplicada antes da atribui\u00E7\u00E3o.",
|
|
2186
|
+
"tags": [{
|
|
2187
|
+
"name": "param",
|
|
2188
|
+
"text": "value Date | string | null \u2014 valor a aplicar; `null` limpa a sele\u00E7\u00E3o."
|
|
2189
|
+
}, {
|
|
2190
|
+
"name": "returns",
|
|
2191
|
+
"text": "Promise<void> \u2014 resolve quando o componente aplicar e sincronizar o valor."
|
|
2192
|
+
}]
|
|
1684
2193
|
}
|
|
1685
2194
|
},
|
|
1686
2195
|
"getValue": {
|
|
@@ -1701,7 +2210,10 @@ export class DatetimePicker {
|
|
|
1701
2210
|
},
|
|
1702
2211
|
"docs": {
|
|
1703
2212
|
"text": "Retorna uma c\u00F3pia do valor selecionado atualmente.",
|
|
1704
|
-
"tags": [
|
|
2213
|
+
"tags": [{
|
|
2214
|
+
"name": "returns",
|
|
2215
|
+
"text": "Promise<Date | null> \u2014 c\u00F3pia imut\u00E1vel do `value` atual, ou `null`."
|
|
2216
|
+
}]
|
|
1705
2217
|
}
|
|
1706
2218
|
},
|
|
1707
2219
|
"clear": {
|
|
@@ -1717,8 +2229,11 @@ export class DatetimePicker {
|
|
|
1717
2229
|
"return": "Promise<void>"
|
|
1718
2230
|
},
|
|
1719
2231
|
"docs": {
|
|
1720
|
-
"text": "Limpa valor e intervalo selecionados.",
|
|
1721
|
-
"tags": [
|
|
2232
|
+
"text": "Limpa valor e intervalo selecionados.\n\nRemove sele\u00E7\u00E3o atual e restaura a refer\u00EAncia de navega\u00E7\u00E3o para a data atual.",
|
|
2233
|
+
"tags": [{
|
|
2234
|
+
"name": "returns",
|
|
2235
|
+
"text": "Promise<void> \u2014 resolve ap\u00F3s a limpeza e sincroniza\u00E7\u00E3o internas."
|
|
2236
|
+
}]
|
|
1722
2237
|
}
|
|
1723
2238
|
},
|
|
1724
2239
|
"open": {
|
|
@@ -1735,7 +2250,10 @@ export class DatetimePicker {
|
|
|
1735
2250
|
},
|
|
1736
2251
|
"docs": {
|
|
1737
2252
|
"text": "Abre o picker quando o componente estiver habilitado.",
|
|
1738
|
-
"tags": [
|
|
2253
|
+
"tags": [{
|
|
2254
|
+
"name": "returns",
|
|
2255
|
+
"text": "Promise<void> \u2014 resolve quando o estado visual for atualizado."
|
|
2256
|
+
}]
|
|
1739
2257
|
}
|
|
1740
2258
|
},
|
|
1741
2259
|
"close": {
|
|
@@ -1752,7 +2270,10 @@ export class DatetimePicker {
|
|
|
1752
2270
|
},
|
|
1753
2271
|
"docs": {
|
|
1754
2272
|
"text": "Fecha o picker.",
|
|
1755
|
-
"tags": [
|
|
2273
|
+
"tags": [{
|
|
2274
|
+
"name": "returns",
|
|
2275
|
+
"text": "Promise<void> \u2014 resolve ap\u00F3s atualiza\u00E7\u00E3o do estado de visibilidade."
|
|
2276
|
+
}]
|
|
1756
2277
|
}
|
|
1757
2278
|
},
|
|
1758
2279
|
"toggle": {
|
|
@@ -1769,7 +2290,10 @@ export class DatetimePicker {
|
|
|
1769
2290
|
},
|
|
1770
2291
|
"docs": {
|
|
1771
2292
|
"text": "Alterna o estado de abertura do picker.",
|
|
1772
|
-
"tags": [
|
|
2293
|
+
"tags": [{
|
|
2294
|
+
"name": "returns",
|
|
2295
|
+
"text": "Promise<void> \u2014 resolve quando a transi\u00E7\u00E3o de estado terminar."
|
|
2296
|
+
}]
|
|
1773
2297
|
}
|
|
1774
2298
|
},
|
|
1775
2299
|
"focusInput": {
|
|
@@ -1780,17 +2304,16 @@ export class DatetimePicker {
|
|
|
1780
2304
|
"Promise": {
|
|
1781
2305
|
"location": "global",
|
|
1782
2306
|
"id": "global::Promise"
|
|
1783
|
-
},
|
|
1784
|
-
"HTMLBrDatetimeInputElement": {
|
|
1785
|
-
"location": "global",
|
|
1786
|
-
"id": "global::HTMLBrDatetimeInputElement"
|
|
1787
2307
|
}
|
|
1788
2308
|
},
|
|
1789
2309
|
"return": "Promise<void>"
|
|
1790
2310
|
},
|
|
1791
2311
|
"docs": {
|
|
1792
2312
|
"text": "Move o foco para o input nativo interno.",
|
|
1793
|
-
"tags": [
|
|
2313
|
+
"tags": [{
|
|
2314
|
+
"name": "returns",
|
|
2315
|
+
"text": "Promise<void> \u2014 resolve imediatamente ap\u00F3s tentar focar o elemento."
|
|
2316
|
+
}]
|
|
1794
2317
|
}
|
|
1795
2318
|
},
|
|
1796
2319
|
"setRange": {
|
|
@@ -1799,11 +2322,11 @@ export class DatetimePicker {
|
|
|
1799
2322
|
"parameters": [{
|
|
1800
2323
|
"name": "start",
|
|
1801
2324
|
"type": "string | Date",
|
|
1802
|
-
"docs": ""
|
|
2325
|
+
"docs": "Date | string | null \u2014 data inicial do intervalo."
|
|
1803
2326
|
}, {
|
|
1804
2327
|
"name": "end",
|
|
1805
2328
|
"type": "string | Date",
|
|
1806
|
-
"docs": ""
|
|
2329
|
+
"docs": "Date | string | null \u2014 data final do intervalo."
|
|
1807
2330
|
}],
|
|
1808
2331
|
"references": {
|
|
1809
2332
|
"Promise": {
|
|
@@ -1818,8 +2341,17 @@ export class DatetimePicker {
|
|
|
1818
2341
|
"return": "Promise<void>"
|
|
1819
2342
|
},
|
|
1820
2343
|
"docs": {
|
|
1821
|
-
"text": "Define intervalo
|
|
1822
|
-
"tags": [
|
|
2344
|
+
"text": "Define um intervalo no modo atual e ativa `selectionMode=\"range\"`.\n\nValida datas contra bloqueios e sincroniza estado visual e de formul\u00E1rio.\nEm `datetime`, mant\u00E9m os limites informados e sinaliza intervalo inv\u00E1lido\nquando o t\u00E9rmino precede o in\u00EDcio, sem ajustar datas automaticamente.",
|
|
2345
|
+
"tags": [{
|
|
2346
|
+
"name": "param",
|
|
2347
|
+
"text": "start Date | string | null \u2014 data inicial do intervalo."
|
|
2348
|
+
}, {
|
|
2349
|
+
"name": "param",
|
|
2350
|
+
"text": "end Date | string | null \u2014 data final do intervalo."
|
|
2351
|
+
}, {
|
|
2352
|
+
"name": "returns",
|
|
2353
|
+
"text": "Promise<void> \u2014 resolve quando o intervalo for aplicado e sincronizado."
|
|
2354
|
+
}]
|
|
1823
2355
|
}
|
|
1824
2356
|
},
|
|
1825
2357
|
"getRange": {
|
|
@@ -1842,7 +2374,7 @@ export class DatetimePicker {
|
|
|
1842
2374
|
"text": "Retorna o intervalo de datas selecionado quando em modo `selectionMode=\"range\"`.",
|
|
1843
2375
|
"tags": [{
|
|
1844
2376
|
"name": "returns",
|
|
1845
|
-
"text": "
|
|
2377
|
+
"text": "Promise<{ start: Date | null; end: Date | null } | null> \u2014 objeto com `start`/`end` ou `null` quando\nn\u00E3o estiver em modo `range`."
|
|
1846
2378
|
}]
|
|
1847
2379
|
}
|
|
1848
2380
|
},
|
|
@@ -1862,7 +2394,7 @@ export class DatetimePicker {
|
|
|
1862
2394
|
"text": "Consulta se o picker est\u00E1 atualmente aberto.",
|
|
1863
2395
|
"tags": [{
|
|
1864
2396
|
"name": "returns",
|
|
1865
|
-
"text": "`true` se o picker est\u00E1 vis\u00EDvel, `false` caso contr\u00E1rio."
|
|
2397
|
+
"text": "Promise<boolean> \u2014 `true` se o picker est\u00E1 vis\u00EDvel, `false` caso contr\u00E1rio."
|
|
1866
2398
|
}]
|
|
1867
2399
|
}
|
|
1868
2400
|
},
|
|
@@ -1880,7 +2412,10 @@ export class DatetimePicker {
|
|
|
1880
2412
|
},
|
|
1881
2413
|
"docs": {
|
|
1882
2414
|
"text": "Restaura o estado inicial atualmente registrado para reset.",
|
|
1883
|
-
"tags": [
|
|
2415
|
+
"tags": [{
|
|
2416
|
+
"name": "returns",
|
|
2417
|
+
"text": "Promise<void> \u2014 resolve quando a sele\u00E7\u00E3o inicial for restaurada."
|
|
2418
|
+
}]
|
|
1884
2419
|
}
|
|
1885
2420
|
},
|
|
1886
2421
|
"checkValidity": {
|
|
@@ -1897,7 +2432,10 @@ export class DatetimePicker {
|
|
|
1897
2432
|
},
|
|
1898
2433
|
"docs": {
|
|
1899
2434
|
"text": "Permite que consumidores acionem valida\u00E7\u00E3o nativa do formul\u00E1rio via host.",
|
|
1900
|
-
"tags": [
|
|
2435
|
+
"tags": [{
|
|
2436
|
+
"name": "returns",
|
|
2437
|
+
"text": "Promise<boolean> \u2014 resultado da Constraint Validation API para o host."
|
|
2438
|
+
}]
|
|
1901
2439
|
}
|
|
1902
2440
|
},
|
|
1903
2441
|
"reportValidity": {
|
|
@@ -1914,7 +2452,10 @@ export class DatetimePicker {
|
|
|
1914
2452
|
},
|
|
1915
2453
|
"docs": {
|
|
1916
2454
|
"text": "Permite exibir mensagens nativas de valida\u00E7\u00E3o no host.",
|
|
1917
|
-
"tags": [
|
|
2455
|
+
"tags": [{
|
|
2456
|
+
"name": "returns",
|
|
2457
|
+
"text": "Promise<boolean> \u2014 `true` se a mensagem foi exibida e o formul\u00E1rio \u00E9 v\u00E1lido."
|
|
2458
|
+
}]
|
|
1918
2459
|
}
|
|
1919
2460
|
},
|
|
1920
2461
|
"setCustomValidity": {
|
|
@@ -1923,7 +2464,7 @@ export class DatetimePicker {
|
|
|
1923
2464
|
"parameters": [{
|
|
1924
2465
|
"name": "message",
|
|
1925
2466
|
"type": "string",
|
|
1926
|
-
"docs": ""
|
|
2467
|
+
"docs": "string \u2014 mensagem de valida\u00E7\u00E3o; string vazia remove a mensagem."
|
|
1927
2468
|
}],
|
|
1928
2469
|
"references": {
|
|
1929
2470
|
"Promise": {
|
|
@@ -1935,7 +2476,13 @@ export class DatetimePicker {
|
|
|
1935
2476
|
},
|
|
1936
2477
|
"docs": {
|
|
1937
2478
|
"text": "Define ou limpa uma mensagem de validade customizada.",
|
|
1938
|
-
"tags": [
|
|
2479
|
+
"tags": [{
|
|
2480
|
+
"name": "param",
|
|
2481
|
+
"text": "message string \u2014 mensagem de valida\u00E7\u00E3o; string vazia remove a mensagem."
|
|
2482
|
+
}, {
|
|
2483
|
+
"name": "returns",
|
|
2484
|
+
"text": "Promise<void> \u2014 resolve ap\u00F3s sincronizar a validade no host."
|
|
2485
|
+
}]
|
|
1939
2486
|
}
|
|
1940
2487
|
},
|
|
1941
2488
|
"validate": {
|
|
@@ -1961,8 +2508,11 @@ export class DatetimePicker {
|
|
|
1961
2508
|
"return": "Promise<boolean>"
|
|
1962
2509
|
},
|
|
1963
2510
|
"docs": {
|
|
1964
|
-
"text": "Executa o validator
|
|
1965
|
-
"tags": [
|
|
2511
|
+
"text": "Executa o validator customizado (se houver) e valida o controle.\n\nEmite eventos de in\u00EDcio/conclus\u00E3o da valida\u00E7\u00E3o e atualiza mensagens internas.",
|
|
2512
|
+
"tags": [{
|
|
2513
|
+
"name": "returns",
|
|
2514
|
+
"text": "Promise<boolean> \u2014 `true` se a sele\u00E7\u00E3o for considerada v\u00E1lida."
|
|
2515
|
+
}]
|
|
1966
2516
|
}
|
|
1967
2517
|
},
|
|
1968
2518
|
"getValidationState": {
|
|
@@ -1985,7 +2535,10 @@ export class DatetimePicker {
|
|
|
1985
2535
|
},
|
|
1986
2536
|
"docs": {
|
|
1987
2537
|
"text": "Retorna um snapshot serializ\u00E1vel da Constraint Validation API.",
|
|
1988
|
-
"tags": [
|
|
2538
|
+
"tags": [{
|
|
2539
|
+
"name": "returns",
|
|
2540
|
+
"text": "Promise<FormValidationState> \u2014 estado atual de valida\u00E7\u00E3o do host,\npronto para convers\u00E3o e restaura\u00E7\u00E3o via `formStateRestoreCallback`."
|
|
2541
|
+
}]
|
|
1989
2542
|
}
|
|
1990
2543
|
}
|
|
1991
2544
|
};
|