@govbr-ds/webcomponents 2.3.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/cem/custom-elements.json +1764 -1575
- package/cem/webcomponents.html-custom-data.json +194 -163
- package/dist/cjs/br-avatar.cjs.entry.js +3 -3
- package/dist/cjs/br-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/br-breadcrumb.cjs.entry.js +3 -3
- package/dist/cjs/br-button_2.cjs.entry.js +4 -4
- package/dist/cjs/br-card.cjs.entry.js +3 -3
- 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 +3 -3
- package/dist/cjs/br-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/br-checkgroup.cjs.entry.js +1 -1
- package/dist/cjs/br-collapse_2.cjs.entry.js +5 -5
- 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 +1 -1
- package/dist/cjs/br-cookiebar-note.cjs.entry.js +2 -2
- package/dist/cjs/br-cookiebar.cjs.entry.js +3 -3
- package/dist/cjs/br-crumb.cjs.entry.js +1 -1
- package/dist/cjs/br-date-picker_3.cjs.entry.js +984 -545
- package/dist/cjs/br-datetime-picker.cjs.entry.js +1346 -310
- package/dist/cjs/br-divider.cjs.entry.js +3 -3
- package/dist/cjs/br-dropdown_2.cjs.entry.js +282 -139
- package/dist/cjs/br-footer-category.cjs.entry.js +3 -3
- 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 +4 -4
- 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 +2 -2
- package/dist/cjs/br-icon.cjs.entry.js +3 -3
- package/dist/cjs/br-input.cjs.entry.js +64 -10
- package/dist/cjs/br-item.cjs.entry.js +3 -3
- package/dist/cjs/br-link.cjs.entry.js +8 -8
- package/dist/cjs/br-loading.cjs.entry.js +2 -2
- package/dist/cjs/br-magic-button.cjs.entry.js +2 -2
- 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 +1 -1
- package/dist/cjs/br-menu-logo.cjs.entry.js +2 -2
- package/dist/cjs/br-menu-social.cjs.entry.js +1 -1
- package/dist/cjs/br-menu.cjs.entry.js +4 -4
- package/dist/cjs/br-modal.cjs.entry.js +1 -1
- 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 +3 -3
- package/dist/cjs/br-pagination.cjs.entry.js +3 -3
- package/dist/cjs/br-radio-group.cjs.entry.js +4 -4
- package/dist/cjs/br-radio.cjs.entry.js +4 -4
- package/dist/cjs/br-scrim.cjs.entry.js +3 -3
- package/dist/cjs/br-select-input_3.cjs.entry.js +308 -101
- package/dist/cjs/br-sign-in.cjs.entry.js +3 -3
- 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 +6 -6
- package/dist/cjs/br-switch.cjs.entry.js +4 -4
- package/dist/cjs/br-tab-item.cjs.entry.js +2 -2
- package/dist/cjs/br-tab.cjs.entry.js +4 -4
- 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 +4 -4
- 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 +8 -24
- 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-CTf1kVJ1.js} +21 -5
- package/dist/cjs/format-bytes-Cs8SH2w0.js +24 -0
- package/dist/cjs/{iconify-icon-DfODV9bf.js → iconify-icon-LjavbM-D.js} +103 -57
- package/dist/cjs/index-Bc30P_6z.js +14 -14
- package/dist/cjs/{index-C92n55ch.js → index-Caoez3xb.js} +75 -27
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{datetime-picker-props-validation-DmNKSXsy.js → isValid-DgJ-noPS.js} +1 -483
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/select.utils-C38f5Kea.js +62 -0
- package/dist/cjs/{slot-DAllytTj.js → slot-CjaqqX7y.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/avatar/avatar.css +1 -1
- package/dist/collection/components/avatar/avatar.js +21 -21
- package/dist/collection/components/breadcrumb/breadcrumb-item/breadcrumb-item.js +4 -12
- package/dist/collection/components/breadcrumb/breadcrumb.css +1 -1
- package/dist/collection/components/breadcrumb/breadcrumb.js +32 -27
- package/dist/collection/components/breadcrumb/crumb/crumb.js +2 -13
- package/dist/collection/components/button/button.css +1 -1
- package/dist/collection/components/button/button.js +21 -21
- package/dist/collection/components/card/card.css +1 -1
- package/dist/collection/components/card/card.js +20 -22
- package/dist/collection/components/carousel/carousel-page/carousel-page.css +1 -1
- package/dist/collection/components/carousel/carousel-page/carousel-page.js +3 -13
- package/dist/collection/components/carousel/carousel.css +1 -1
- package/dist/collection/components/carousel/carousel.js +23 -30
- package/dist/collection/components/checkbox/checkbox.css +1 -1
- package/dist/collection/components/checkbox/checkbox.js +18 -24
- package/dist/collection/components/checkbox-group/checkbox-group.css +1 -1
- package/dist/collection/components/checkbox-group/checkbox-group.js +19 -20
- package/dist/collection/components/checkgroup/checkgroup.js +2 -14
- package/dist/collection/components/collapse/collapse.css +1 -1
- package/dist/collection/components/collapse/collapse.js +25 -21
- package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.js +3 -16
- package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.js +3 -16
- package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.js +3 -16
- package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.js +3 -15
- package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.js +3 -14
- package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.js +2 -13
- package/dist/collection/components/cookiebar/cookiebar.css +1 -1
- package/dist/collection/components/cookiebar/cookiebar.js +32 -27
- package/dist/collection/components/datetime-picker/date-picker/date-picker-locale.js +73 -26
- 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 +474 -321
- 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 +370 -218
- 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 +917 -368
- 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 +145 -92
- package/dist/collection/components/divider/divider.css +1 -1
- package/dist/collection/components/divider/divider.js +15 -19
- package/dist/collection/components/dropdown/dropdown.css +1 -1
- package/dist/collection/components/dropdown/dropdown.js +22 -21
- package/dist/collection/components/footer/footer-category/footer-category.css +1 -1
- package/dist/collection/components/footer/footer-category/footer-category.js +4 -17
- package/dist/collection/components/footer/footer-item/footer-item.css +1 -1
- package/dist/collection/components/footer/footer-item/footer-item.js +3 -16
- package/dist/collection/components/footer/footer-legal/footer-legal.css +1 -1
- package/dist/collection/components/footer/footer-legal/footer-legal.js +2 -16
- package/dist/collection/components/footer/footer-logo/footer-logo.css +1 -1
- package/dist/collection/components/footer/footer-logo/footer-logo.js +3 -16
- package/dist/collection/components/footer/footer-social/footer-social.css +1 -1
- package/dist/collection/components/footer/footer-social/footer-social.js +3 -15
- package/dist/collection/components/footer/footer.css +1 -1
- package/dist/collection/components/footer/footer.js +25 -29
- package/dist/collection/components/header/header-function/header-function.css +1 -1
- package/dist/collection/components/header/header-function/header-function.js +10 -14
- package/dist/collection/components/header/header-link/header-link.css +1 -1
- package/dist/collection/components/header/header-link/header-link.js +3 -16
- package/dist/collection/components/header/header-list/header-list.css +1 -1
- package/dist/collection/components/header/header-list/header-list.js +3 -16
- package/dist/collection/components/header/header-logo/header-logo.css +1 -1
- package/dist/collection/components/header/header-logo/header-logo.js +3 -16
- package/dist/collection/components/header/header.css +1 -1
- package/dist/collection/components/header/header.js +30 -27
- package/dist/collection/components/icon/icon.css +1 -1
- package/dist/collection/components/icon/icon.js +22 -17
- package/dist/collection/components/input/input.css +1 -1
- package/dist/collection/components/input/input.js +125 -30
- package/dist/collection/components/item/item.css +1 -1
- package/dist/collection/components/item/item.js +18 -22
- package/dist/collection/components/link/link.css +1 -1
- package/dist/collection/components/link/link.js +25 -29
- package/dist/collection/components/list/list.css +1 -1
- package/dist/collection/components/list/list.js +17 -21
- package/dist/collection/components/loading/loading.css +1 -1
- package/dist/collection/components/loading/loading.js +17 -24
- package/dist/collection/components/magic-button/magic-button.css +1 -1
- package/dist/collection/components/magic-button/magic-button.js +13 -20
- package/dist/collection/components/menu/menu-group/menu-group.css +1 -1
- package/dist/collection/components/menu/menu-group/menu-group.js +3 -16
- package/dist/collection/components/menu/menu-header/menu-header.css +1 -1
- package/dist/collection/components/menu/menu-header/menu-header.js +3 -16
- package/dist/collection/components/menu/menu-info/menu-info.css +1 -1
- package/dist/collection/components/menu/menu-info/menu-info.js +2 -15
- package/dist/collection/components/menu/menu-item/menu-item.css +1 -1
- package/dist/collection/components/menu/menu-item/menu-item.js +3 -16
- package/dist/collection/components/menu/menu-link/menu-link.css +1 -1
- package/dist/collection/components/menu/menu-link/menu-link.js +5 -17
- package/dist/collection/components/menu/menu-list/menu-list.css +1 -1
- package/dist/collection/components/menu/menu-list/menu-list.js +2 -15
- package/dist/collection/components/menu/menu-logo/menu-logo.css +1 -1
- package/dist/collection/components/menu/menu-logo/menu-logo.js +2 -15
- package/dist/collection/components/menu/menu-social/menu-social.css +1 -1
- package/dist/collection/components/menu/menu-social/menu-social.js +2 -15
- package/dist/collection/components/menu/menu.css +1 -1
- package/dist/collection/components/menu/menu.js +28 -35
- package/dist/collection/components/message/message.css +1 -1
- package/dist/collection/components/message/message.js +22 -25
- package/dist/collection/components/modal/modal.css +1 -1
- package/dist/collection/components/modal/modal.js +18 -21
- package/dist/collection/components/notification/notification-body/notification-body.css +1 -1
- package/dist/collection/components/notification/notification-body/notification-body.js +3 -13
- package/dist/collection/components/notification/notification-header/notification-header.css +1 -1
- package/dist/collection/components/notification/notification-header/notification-header.js +3 -14
- package/dist/collection/components/notification/notification-item/notification-item.css +1 -1
- package/dist/collection/components/notification/notification-item/notification-item.js +3 -16
- package/dist/collection/components/notification/notification.css +1 -1
- package/dist/collection/components/notification/notification.js +20 -29
- package/dist/collection/components/pagination/pagination.css +1 -1
- package/dist/collection/components/pagination/pagination.js +15 -23
- package/dist/collection/components/radio/radio.css +1 -1
- package/dist/collection/components/radio/radio.js +17 -20
- package/dist/collection/components/radio-group/radio-group.css +1 -1
- package/dist/collection/components/radio-group/radio-group.js +20 -20
- package/dist/collection/components/scrim/scrim.css +1 -1
- package/dist/collection/components/scrim/scrim.js +14 -17
- package/dist/collection/components/select/select-input/select-input.css +1 -1
- package/dist/collection/components/select/select-input/select-input.js +157 -27
- package/dist/collection/components/select/select-list/select-list.css +1 -1
- package/dist/collection/components/select/select-list/select-list.js +269 -80
- package/dist/collection/components/select/select-option/select-option.css +1 -1
- package/dist/collection/components/select/select-option/select-option.js +20 -16
- package/dist/collection/components/select/select.css +1 -1
- package/dist/collection/components/select/select.js +367 -180
- package/dist/collection/components/select/select.utils.js +26 -7
- package/dist/collection/components/sign-in/sign-in.css +1 -1
- package/dist/collection/components/sign-in/sign-in.js +12 -16
- package/dist/collection/components/skip-link/skip-link-item/skip-link-item-alias.js +8 -4
- package/dist/collection/components/skip-link/skip-link-item/skip-link-item.css +1 -1
- package/dist/collection/components/skip-link/skip-link-item/skip-link-item.js +5 -15
- package/dist/collection/components/skip-link/skip-link.css +1 -1
- package/dist/collection/components/skip-link/skip-link.js +18 -24
- package/dist/collection/components/slider/slider.css +1 -1
- package/dist/collection/components/slider/slider.js +15 -25
- package/dist/collection/components/step/step-item/step-item.css +1 -1
- package/dist/collection/components/step/step-item/step-item.js +5 -15
- package/dist/collection/components/step/step.css +1 -1
- package/dist/collection/components/step/step.js +16 -25
- package/dist/collection/components/switch/switch.css +1 -1
- package/dist/collection/components/switch/switch.js +16 -20
- package/dist/collection/components/tab/tab-item/tab-item.css +1 -1
- package/dist/collection/components/tab/tab-item/tab-item.js +5 -15
- package/dist/collection/components/tab/tab.css +1 -1
- package/dist/collection/components/tab/tab.js +22 -29
- package/dist/collection/components/table/table-body/table-body.css +1 -1
- package/dist/collection/components/table/table-body/table-body.js +3 -13
- package/dist/collection/components/table/table-cell/table-cell.css +1 -1
- package/dist/collection/components/table/table-cell/table-cell.js +3 -12
- package/dist/collection/components/table/table-header/table-header.css +1 -1
- package/dist/collection/components/table/table-header/table-header.js +3 -13
- package/dist/collection/components/table/table-header-cell/table-header-cell.css +1 -1
- package/dist/collection/components/table/table-header-cell/table-header-cell.js +3 -13
- package/dist/collection/components/table/table-row/table-row.css +1 -1
- package/dist/collection/components/table/table-row/table-row.js +3 -13
- package/dist/collection/components/table/table.css +1 -1
- package/dist/collection/components/table/table.js +25 -32
- package/dist/collection/components/tag/tag.css +1 -1
- package/dist/collection/components/tag/tag.js +17 -26
- package/dist/collection/components/textarea/textarea.css +1 -1
- package/dist/collection/components/textarea/textarea.js +14 -22
- package/dist/collection/components/tooltip/tooltip.css +1 -1
- package/dist/collection/components/tooltip/tooltip.js +13 -19
- package/dist/collection/components/upload/upload.css +1 -1
- package/dist/collection/components/upload/upload.js +36 -29
- package/dist/collection/components/wizard/wizard-panel/wizard-panel.css +1 -1
- package/dist/collection/components/wizard/wizard-panel/wizard-panel.js +3 -13
- package/dist/collection/components/wizard/wizard.css +1 -1
- package/dist/collection/components/wizard/wizard.js +22 -26
- package/dist/collection/pages/components/select/remote-options.js +87 -0
- package/dist/collection/shared/utils/slot.js +1 -1
- package/dist/components/br-avatar.js +1 -1
- package/dist/components/br-breadcrumb-item.js +1 -1
- package/dist/components/br-breadcrumb.js +1 -1
- package/dist/components/br-button.js +1 -1
- package/dist/components/br-card.js +1 -1
- package/dist/components/br-carousel-page.js +1 -1
- package/dist/components/br-carousel.js +1 -1
- package/dist/components/br-checkbox-group.js +1 -1
- package/dist/components/br-checkbox.js +1 -1
- package/dist/components/br-checkgroup.js +1 -1
- package/dist/components/br-collapse.js +1 -1
- package/dist/components/br-cookiebar-cookie.js +1 -1
- package/dist/components/br-cookiebar-group.js +1 -1
- package/dist/components/br-cookiebar-header.js +1 -1
- package/dist/components/br-cookiebar-link.js +1 -1
- package/dist/components/br-cookiebar-note-group.js +1 -1
- package/dist/components/br-cookiebar-note.js +1 -1
- package/dist/components/br-cookiebar.js +1 -1
- package/dist/components/br-crumb.js +1 -1
- package/dist/components/br-date-picker.js +1 -1
- package/dist/components/br-datetime-input.js +1 -1
- package/dist/components/br-datetime-picker.js +1 -1
- package/dist/components/br-divider.js +1 -1
- package/dist/components/br-dropdown.js +1 -1
- package/dist/components/br-footer-category.js +1 -1
- package/dist/components/br-footer-item.js +1 -1
- package/dist/components/br-footer-legal.js +1 -1
- package/dist/components/br-footer-logo.js +1 -1
- package/dist/components/br-footer-social.js +1 -1
- package/dist/components/br-footer.js +1 -1
- package/dist/components/br-header-function.js +1 -1
- package/dist/components/br-header-link.js +1 -1
- package/dist/components/br-header-list.js +1 -1
- package/dist/components/br-header-logo.js +1 -1
- package/dist/components/br-header.js +1 -1
- package/dist/components/br-icon.js +1 -1
- package/dist/components/br-input.js +1 -1
- package/dist/components/br-item.js +1 -1
- package/dist/components/br-link.js +1 -1
- package/dist/components/br-list.js +1 -1
- package/dist/components/br-loading.js +1 -1
- package/dist/components/br-magic-button.js +1 -1
- package/dist/components/br-menu-group.js +1 -1
- package/dist/components/br-menu-header.js +1 -1
- package/dist/components/br-menu-info.js +1 -1
- package/dist/components/br-menu-item.js +1 -1
- package/dist/components/br-menu-link.js +1 -1
- package/dist/components/br-menu-list.js +1 -1
- package/dist/components/br-menu-logo.js +1 -1
- package/dist/components/br-menu-social.js +1 -1
- package/dist/components/br-menu.js +1 -1
- package/dist/components/br-message.js +1 -1
- package/dist/components/br-modal.js +1 -1
- package/dist/components/br-notification-body.js +1 -1
- package/dist/components/br-notification-header.js +1 -1
- package/dist/components/br-notification-item.js +1 -1
- package/dist/components/br-notification.js +1 -1
- package/dist/components/br-pagination.js +1 -1
- package/dist/components/br-radio-group.js +1 -1
- package/dist/components/br-radio.js +1 -1
- package/dist/components/br-scrim.js +1 -1
- package/dist/components/br-select-input.js +1 -1
- package/dist/components/br-select-list.js +1 -1
- package/dist/components/br-select-option.js +1 -1
- package/dist/components/br-select.js +1 -1
- package/dist/components/br-sign-in.js +1 -1
- package/dist/components/br-skip-link-item.js +1 -1
- package/dist/components/br-skip-link.js +1 -1
- package/dist/components/br-skiplink-item.js +1 -1
- package/dist/components/br-slider.js +1 -1
- package/dist/components/br-step-item.js +1 -1
- package/dist/components/br-step.js +1 -1
- package/dist/components/br-switch.js +1 -1
- package/dist/components/br-tab-item.js +1 -1
- package/dist/components/br-tab.js +1 -1
- package/dist/components/br-table-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-448Z5r2f.js +5 -0
- package/dist/{webcomponents/p-5f422a69.entry.js → components/p-AhfgJCUp.js} +1 -1
- package/dist/components/p-AoNL6BaW.js +5 -0
- package/dist/components/p-B468MCYC.js +5 -0
- package/dist/components/p-B7bNfmgh.js +5 -0
- package/dist/components/p-B985Ov_x.js +5 -0
- package/dist/components/p-BOWQIHQA.js +5 -0
- package/dist/components/p-BPQrgCRr.js +5 -0
- package/dist/components/p-BwQT0fOJ.js +5 -0
- package/dist/components/p-CAgbUwsx.js +5 -0
- package/dist/components/p-CFXey8i8.js +5 -0
- package/dist/components/p-CVz_akHx.js +5 -0
- package/dist/components/p-CW8xwk6J.js +5 -0
- package/dist/components/p-CYZVdKeO.js +5 -0
- package/dist/components/p-C_DC6oQW.js +16 -0
- package/dist/components/p-CeWbZN7V.js +5 -0
- package/dist/components/p-CyXVsiz9.js +5 -0
- package/dist/components/p-DDe0tQEO.js +5 -0
- package/dist/components/{p-CZZVc2gK.js → p-DJKZ8ktB.js} +1 -1
- package/dist/components/p-DRsZ9GNg.js +5 -0
- package/dist/components/p-DU54cqCf.js +5 -0
- package/dist/components/p-DVJlmlEX.js +5 -0
- package/dist/components/p-DcMjwTqu.js +5 -0
- package/dist/components/p-Dd1qCWAK.js +5 -0
- package/dist/components/p-Dn36Mj2E.js +5 -0
- package/dist/components/p-DoWy_P8b.js +5 -0
- package/dist/components/p-HbhTnepI.js +5 -0
- package/dist/components/{p-BcqVlof7.js → p-JkJjzmGm.js} +1 -1
- package/dist/components/{p-Nze3Utvd.js → p-Or3FLzbz.js} +1 -1
- package/dist/components/p-SWQlgYWR.js +5 -0
- package/dist/components/p-Zb9nyfTY.js +5 -0
- package/dist/components/p-jvKQA6x7.js +5 -0
- package/dist/components/p-pQb-3jFY.js +5 -0
- package/dist/components/p-qX6sHxOk.js +5 -0
- package/dist/esm/br-avatar.entry.js +3 -3
- package/dist/esm/br-breadcrumb-item.entry.js +1 -1
- package/dist/esm/br-breadcrumb.entry.js +3 -3
- package/dist/esm/br-button_2.entry.js +4 -4
- package/dist/esm/br-card.entry.js +3 -3
- 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 +3 -3
- package/dist/esm/br-checkbox.entry.js +5 -5
- package/dist/esm/br-checkgroup.entry.js +1 -1
- package/dist/esm/br-collapse_2.entry.js +6 -6
- 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 +1 -1
- package/dist/esm/br-cookiebar-note.entry.js +2 -2
- package/dist/esm/br-cookiebar.entry.js +4 -4
- package/dist/esm/br-crumb.entry.js +1 -1
- package/dist/esm/br-date-picker_3.entry.js +966 -527
- package/dist/esm/br-datetime-picker.entry.js +1316 -280
- package/dist/esm/br-divider.entry.js +3 -3
- package/dist/esm/br-dropdown_2.entry.js +281 -138
- package/dist/esm/br-footer-category.entry.js +3 -3
- 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 +4 -4
- 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 +2 -2
- package/dist/esm/br-icon.entry.js +3 -3
- package/dist/esm/br-input.entry.js +65 -11
- package/dist/esm/br-item.entry.js +3 -3
- package/dist/esm/br-link.entry.js +8 -8
- package/dist/esm/br-loading.entry.js +2 -2
- package/dist/esm/br-magic-button.entry.js +2 -2
- 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 +1 -1
- package/dist/esm/br-menu-logo.entry.js +2 -2
- package/dist/esm/br-menu-social.entry.js +1 -1
- package/dist/esm/br-menu.entry.js +5 -5
- package/dist/esm/br-modal.entry.js +1 -1
- 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 +4 -4
- package/dist/esm/br-pagination.entry.js +3 -3
- package/dist/esm/br-radio-group.entry.js +5 -5
- package/dist/esm/br-radio.entry.js +5 -5
- package/dist/esm/br-scrim.entry.js +3 -3
- package/dist/esm/br-select-input_3.entry.js +308 -101
- package/dist/esm/br-sign-in.entry.js +3 -3
- 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 +6 -6
- package/dist/esm/br-switch.entry.js +5 -5
- package/dist/esm/br-tab-item.entry.js +2 -2
- package/dist/esm/br-tab.entry.js +4 -4
- 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 +5 -5
- 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 +6 -22
- 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-1l4_-FEJ.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/{iconify-icon-D3usVJE2.js → iconify-icon-C_DC6oQW.js} +103 -57
- package/dist/esm/{index-BQPOWxe5.js → index-BQRBKuY0.js} +75 -28
- package/dist/esm/index-ConyRdJe.js +14 -14
- package/dist/esm/index.js +2 -2
- package/dist/esm/{datetime-picker-props-validation-BeTcUTnE.js → isValid-wU7S6MI2.js} +2 -477
- package/dist/esm/loader.js +1 -1
- package/dist/esm/select.utils-BYsh2ZdE.js +57 -0
- package/dist/esm/{slot-BIG-yees.js → slot-Bt01zQ7-.js} +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/hydrate/index.js +4459 -3577
- package/dist/hydrate/index.mjs +4459 -3577
- package/dist/types/components/avatar/avatar.d.ts +20 -20
- package/dist/types/components/breadcrumb/breadcrumb-item/breadcrumb-item.d.ts +3 -11
- package/dist/types/components/breadcrumb/breadcrumb.d.ts +30 -25
- package/dist/types/components/breadcrumb/crumb/crumb.d.ts +1 -12
- package/dist/types/components/button/button.d.ts +20 -20
- package/dist/types/components/card/card.d.ts +19 -21
- package/dist/types/components/carousel/carousel-page/carousel-page.d.ts +2 -12
- package/dist/types/components/carousel/carousel.d.ts +22 -29
- package/dist/types/components/checkbox/checkbox.d.ts +16 -22
- package/dist/types/components/checkbox-group/checkbox-group.d.ts +17 -18
- package/dist/types/components/checkgroup/checkgroup.d.ts +1 -13
- package/dist/types/components/collapse/collapse.d.ts +24 -20
- package/dist/types/components/cookiebar/cookiebar-cookie/cookiebar-cookie.d.ts +2 -15
- package/dist/types/components/cookiebar/cookiebar-group/cookiebar-group.d.ts +2 -15
- package/dist/types/components/cookiebar/cookiebar-header/cookiebar-header.d.ts +2 -15
- package/dist/types/components/cookiebar/cookiebar-link/cookiebar-link.d.ts +2 -14
- package/dist/types/components/cookiebar/cookiebar-note/cookiebar-note.d.ts +2 -13
- package/dist/types/components/cookiebar/cookiebar-note-group/cookiebar-note-group.d.ts +2 -13
- package/dist/types/components/cookiebar/cookiebar.d.ts +30 -25
- package/dist/types/components/datetime-picker/date-picker/date-picker-locale.d.ts +20 -12
- 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 +313 -164
- 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 +226 -105
- 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 +510 -241
- 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 +123 -62
- package/dist/types/components/divider/divider.d.ts +14 -18
- package/dist/types/components/dropdown/dropdown.d.ts +21 -20
- package/dist/types/components/footer/footer-category/footer-category.d.ts +2 -15
- package/dist/types/components/footer/footer-item/footer-item.d.ts +2 -15
- package/dist/types/components/footer/footer-legal/footer-legal.d.ts +1 -15
- package/dist/types/components/footer/footer-logo/footer-logo.d.ts +2 -15
- package/dist/types/components/footer/footer-social/footer-social.d.ts +2 -14
- package/dist/types/components/footer/footer.d.ts +23 -27
- package/dist/types/components/header/header-function/header-function.d.ts +9 -13
- package/dist/types/components/header/header-link/header-link.d.ts +2 -15
- package/dist/types/components/header/header-list/header-list.d.ts +2 -15
- package/dist/types/components/header/header-logo/header-logo.d.ts +2 -15
- package/dist/types/components/header/header.d.ts +29 -26
- package/dist/types/components/icon/icon.d.ts +21 -16
- package/dist/types/components/input/input.d.ts +48 -23
- package/dist/types/components/input/input.types.d.ts +4 -0
- package/dist/types/components/item/item.d.ts +17 -21
- package/dist/types/components/link/link.d.ts +18 -22
- package/dist/types/components/list/list.d.ts +16 -20
- package/dist/types/components/loading/loading.d.ts +16 -23
- package/dist/types/components/magic-button/magic-button.d.ts +12 -19
- package/dist/types/components/menu/menu-group/menu-group.d.ts +2 -15
- package/dist/types/components/menu/menu-header/menu-header.d.ts +2 -15
- package/dist/types/components/menu/menu-info/menu-info.d.ts +1 -14
- package/dist/types/components/menu/menu-item/menu-item.d.ts +2 -15
- package/dist/types/components/menu/menu-link/menu-link.d.ts +4 -16
- package/dist/types/components/menu/menu-list/menu-list.d.ts +2 -15
- package/dist/types/components/menu/menu-logo/menu-logo.d.ts +1 -14
- package/dist/types/components/menu/menu-social/menu-social.d.ts +2 -15
- package/dist/types/components/menu/menu.d.ts +25 -32
- package/dist/types/components/message/message.d.ts +21 -24
- package/dist/types/components/modal/modal.d.ts +18 -21
- package/dist/types/components/notification/notification-body/notification-body.d.ts +2 -12
- package/dist/types/components/notification/notification-header/notification-header.d.ts +2 -13
- package/dist/types/components/notification/notification-item/notification-item.d.ts +2 -15
- package/dist/types/components/notification/notification.d.ts +18 -27
- package/dist/types/components/pagination/pagination.d.ts +13 -21
- package/dist/types/components/radio/radio.d.ts +15 -18
- package/dist/types/components/radio-group/radio-group.d.ts +18 -18
- package/dist/types/components/scrim/scrim.d.ts +12 -15
- package/dist/types/components/select/select-input/select-input.d.ts +20 -12
- package/dist/types/components/select/select-list/select-list.d.ts +27 -14
- package/dist/types/components/select/select-option/select-option.d.ts +6 -10
- package/dist/types/components/select/select.d.ts +75 -87
- 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 +11 -15
- package/dist/types/components/skip-link/skip-link-item/skip-link-item-alias.d.ts +7 -3
- package/dist/types/components/skip-link/skip-link-item/skip-link-item.d.ts +4 -14
- package/dist/types/components/skip-link/skip-link.d.ts +17 -23
- package/dist/types/components/slider/slider.d.ts +14 -24
- package/dist/types/components/step/step-item/step-item.d.ts +2 -12
- package/dist/types/components/step/step.d.ts +15 -24
- package/dist/types/components/switch/switch.d.ts +14 -18
- package/dist/types/components/tab/tab-item/tab-item.d.ts +4 -14
- package/dist/types/components/tab/tab.d.ts +19 -26
- package/dist/types/components/table/table-body/table-body.d.ts +2 -12
- package/dist/types/components/table/table-cell/table-cell.d.ts +2 -11
- package/dist/types/components/table/table-header/table-header.d.ts +2 -12
- package/dist/types/components/table/table-header-cell/table-header-cell.d.ts +2 -12
- package/dist/types/components/table/table-row/table-row.d.ts +2 -12
- package/dist/types/components/table/table.d.ts +24 -31
- package/dist/types/components/tag/tag.d.ts +15 -24
- package/dist/types/components/textarea/textarea.d.ts +13 -21
- package/dist/types/components/tooltip/tooltip.d.ts +12 -18
- package/dist/types/components/upload/upload.d.ts +20 -27
- package/dist/types/components/wizard/wizard-panel/wizard-panel.d.ts +2 -12
- package/dist/types/components/wizard/wizard.d.ts +21 -25
- package/dist/types/components.d.ts +3586 -5062
- package/dist/webcomponents/index.esm.js +1 -1
- package/dist/webcomponents/p-031a2256.entry.js +5 -0
- package/dist/webcomponents/p-0602e5b1.entry.js +5 -0
- package/dist/webcomponents/p-079d5f69.entry.js +5 -0
- package/dist/webcomponents/p-087ed5e7.entry.js +5 -0
- package/dist/webcomponents/p-0d5a9ebf.entry.js +5 -0
- package/dist/webcomponents/p-105b4d06.entry.js +5 -0
- package/dist/webcomponents/p-11d4edc5.entry.js +5 -0
- package/dist/webcomponents/p-12dd22af.entry.js +5 -0
- package/dist/webcomponents/p-14aedf0d.entry.js +5 -0
- package/dist/webcomponents/p-152482f9.entry.js +5 -0
- package/dist/webcomponents/p-19b4b1b7.entry.js +5 -0
- package/dist/webcomponents/p-1cd1126e.entry.js +5 -0
- package/dist/webcomponents/{p-BtRPYRvA.js → p-1l4_-FEJ.js} +1 -1
- package/dist/webcomponents/p-21e10074.entry.js +5 -0
- package/dist/webcomponents/p-2271ea84.entry.js +5 -0
- package/dist/webcomponents/p-271b1ede.entry.js +5 -0
- package/dist/webcomponents/p-28f732fc.entry.js +5 -0
- package/dist/webcomponents/{p-c1dafd8d.entry.js → p-2971d38a.entry.js} +1 -1
- package/dist/{components/p-DOJ1vYOl.js → webcomponents/p-2ac48875.entry.js} +1 -1
- package/dist/webcomponents/p-2b1a919c.entry.js +5 -0
- package/dist/webcomponents/p-2da57966.entry.js +5 -0
- package/dist/webcomponents/p-2e81b0b3.entry.js +5 -0
- package/dist/webcomponents/p-2eececed.entry.js +5 -0
- package/dist/webcomponents/{p-513ee754.entry.js → p-2f904c4a.entry.js} +1 -1
- package/dist/webcomponents/p-32414f1c.entry.js +5 -0
- package/dist/webcomponents/{p-5a7c2031.entry.js → p-324afbce.entry.js} +1 -1
- package/dist/webcomponents/p-32ea6342.entry.js +5 -0
- package/dist/webcomponents/p-330ec8ab.entry.js +5 -0
- package/dist/webcomponents/p-374f83b1.entry.js +5 -0
- package/dist/webcomponents/p-3926cc91.entry.js +5 -0
- package/dist/webcomponents/p-39a7826d.entry.js +5 -0
- package/dist/webcomponents/p-3bcc2c58.entry.js +5 -0
- package/dist/webcomponents/p-3c7ce0e4.entry.js +5 -0
- package/dist/webcomponents/p-467842ca.entry.js +5 -0
- package/dist/webcomponents/p-53550e8c.entry.js +5 -0
- package/dist/webcomponents/p-53e71a8a.entry.js +5 -0
- package/dist/webcomponents/p-5528b466.entry.js +5 -0
- package/dist/webcomponents/p-55e0822d.entry.js +5 -0
- package/dist/webcomponents/p-58bacbe1.entry.js +5 -0
- package/dist/webcomponents/p-5a5ed7d8.entry.js +5 -0
- package/dist/webcomponents/p-621f0fa8.entry.js +5 -0
- package/dist/webcomponents/p-6514a75d.entry.js +5 -0
- package/dist/webcomponents/{p-19a38e20.entry.js → p-678b43a6.entry.js} +1 -1
- package/dist/webcomponents/{p-CfuJQ1DY.js → p-6Da1SZ3J.js} +1 -1
- package/dist/webcomponents/p-6b6be415.entry.js +5 -0
- package/dist/webcomponents/{p-0d2ca2f7.entry.js → p-6d58ab4f.entry.js} +1 -1
- package/dist/webcomponents/p-6ff9b26e.entry.js +5 -0
- package/dist/webcomponents/p-84dfbfdd.entry.js +5 -0
- package/dist/webcomponents/{p-d5d2205c.entry.js → p-85c8d060.entry.js} +1 -1
- package/dist/webcomponents/p-913d6f28.entry.js +5 -0
- package/dist/webcomponents/{p-94848046.entry.js → p-975ea5c7.entry.js} +1 -1
- package/dist/webcomponents/p-992167bc.entry.js +5 -0
- package/dist/webcomponents/p-B7bNfmgh.js +5 -0
- package/dist/webcomponents/p-BYsh2ZdE.js +5 -0
- package/dist/webcomponents/p-C_DC6oQW.js +16 -0
- package/dist/webcomponents/{p-DV-iW9Aj.js → p-CpE_G6IZ.js} +1 -1
- package/dist/webcomponents/p-DnwERaeQ.js +5 -0
- package/dist/webcomponents/p-a21872bf.entry.js +5 -0
- package/dist/webcomponents/{p-0b0cf355.entry.js → p-a9f16a65.entry.js} +1 -1
- package/dist/webcomponents/p-b8d4ace3.entry.js +5 -0
- package/dist/webcomponents/{p-6850e98e.entry.js → p-bbcde1ea.entry.js} +1 -1
- package/dist/webcomponents/p-bbf47e78.entry.js +5 -0
- package/dist/webcomponents/p-bf35e506.entry.js +5 -0
- package/dist/webcomponents/{p-b02a7218.entry.js → p-c09af3cd.entry.js} +1 -1
- package/dist/webcomponents/p-c29268b5.entry.js +5 -0
- package/dist/webcomponents/p-c3e61c39.entry.js +5 -0
- package/dist/webcomponents/{p-b16590fc.entry.js → p-c6b2545a.entry.js} +1 -1
- package/dist/webcomponents/{p-b55425b7.entry.js → p-c6f2f17b.entry.js} +1 -1
- package/dist/webcomponents/p-cae39e13.entry.js +5 -0
- package/dist/webcomponents/p-cb1e08b1.entry.js +5 -0
- package/dist/webcomponents/{p-e94a52ac.entry.js → p-cb690a87.entry.js} +1 -1
- package/dist/webcomponents/p-d0be7243.entry.js +5 -0
- package/dist/webcomponents/p-d191c6e3.entry.js +5 -0
- package/dist/webcomponents/p-d205f3fd.entry.js +5 -0
- package/dist/webcomponents/p-d3bd2c40.entry.js +5 -0
- package/dist/webcomponents/{p-61977114.entry.js → p-dbeea64e.entry.js} +1 -1
- package/dist/webcomponents/p-df475129.entry.js +5 -0
- package/dist/webcomponents/p-e0ccf189.entry.js +5 -0
- package/dist/webcomponents/p-e121429a.entry.js +5 -0
- package/dist/webcomponents/p-e4b968b5.entry.js +5 -0
- package/dist/webcomponents/p-e661c024.entry.js +5 -0
- package/dist/webcomponents/p-e6c6f305.entry.js +5 -0
- package/dist/webcomponents/p-e8291be2.entry.js +5 -0
- package/dist/webcomponents/p-eb5806c7.entry.js +5 -0
- package/dist/webcomponents/{p-82759002.entry.js → p-ed3fa8ec.entry.js} +1 -1
- package/dist/webcomponents/p-f9084f16.entry.js +5 -0
- package/dist/webcomponents/{p-4118b878.entry.js → p-fad3aa61.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +2 -2
- package/dist/collection/pages/components/select/remote.js +0 -33
- package/dist/collection/pages/components/select/virtualized.js +0 -13
- package/dist/components/p-0qmYp77w.js +0 -5
- package/dist/components/p-5c3rNBXh.js +0 -5
- package/dist/components/p-B8oIvH3q.js +0 -5
- package/dist/components/p-BECz8XWJ.js +0 -5
- package/dist/components/p-BM4Ys6hX.js +0 -5
- package/dist/components/p-BXWh9s7p.js +0 -5
- package/dist/components/p-BblZlUp2.js +0 -5
- package/dist/components/p-Bezou5CQ.js +0 -5
- package/dist/components/p-BjeUETWJ.js +0 -5
- package/dist/components/p-Cd6udSDt.js +0 -5
- package/dist/components/p-Ci0_RqAE.js +0 -5
- package/dist/components/p-CuBgClZm.js +0 -5
- package/dist/components/p-D0QYZSoP.js +0 -5
- package/dist/components/p-D3usVJE2.js +0 -16
- package/dist/components/p-D4SWpW6-.js +0 -5
- package/dist/components/p-D579DS7x.js +0 -5
- package/dist/components/p-D8K7rhHd.js +0 -5
- package/dist/components/p-D9nXlCuS.js +0 -5
- package/dist/components/p-DKFO6Q_g.js +0 -5
- package/dist/components/p-DNJSSCNi.js +0 -5
- package/dist/components/p-DYI30IZL.js +0 -5
- package/dist/components/p-DcVldfL0.js +0 -5
- package/dist/components/p-DhvmHPp4.js +0 -5
- package/dist/components/p-DwgiHL0b.js +0 -5
- package/dist/components/p-WxDB6Dk4.js +0 -5
- package/dist/components/p-ZLoeVagg.js +0 -5
- package/dist/components/p-gbYJ9sfc.js +0 -5
- package/dist/components/p-uc8ABlC_.js +0 -5
- package/dist/components/p-v60ypfxD.js +0 -5
- package/dist/webcomponents/p-078bd760.entry.js +0 -5
- package/dist/webcomponents/p-07c2cdff.entry.js +0 -5
- package/dist/webcomponents/p-09817344.entry.js +0 -5
- package/dist/webcomponents/p-0d79ca44.entry.js +0 -5
- package/dist/webcomponents/p-0fe3c47b.entry.js +0 -5
- package/dist/webcomponents/p-116b53c9.entry.js +0 -5
- package/dist/webcomponents/p-1240dae7.entry.js +0 -5
- package/dist/webcomponents/p-14ff5865.entry.js +0 -5
- package/dist/webcomponents/p-15743a02.entry.js +0 -5
- package/dist/webcomponents/p-16cebf49.entry.js +0 -5
- package/dist/webcomponents/p-1884b9d3.entry.js +0 -5
- package/dist/webcomponents/p-1d36c8fa.entry.js +0 -5
- package/dist/webcomponents/p-1fa4b5b2.entry.js +0 -5
- package/dist/webcomponents/p-212c069b.entry.js +0 -5
- package/dist/webcomponents/p-23f37cd6.entry.js +0 -5
- package/dist/webcomponents/p-24502b63.entry.js +0 -5
- package/dist/webcomponents/p-27fb81f3.entry.js +0 -5
- package/dist/webcomponents/p-28844490.entry.js +0 -5
- package/dist/webcomponents/p-2b41bdcc.entry.js +0 -5
- package/dist/webcomponents/p-2cb1e09b.entry.js +0 -5
- package/dist/webcomponents/p-2fcda70b.entry.js +0 -5
- package/dist/webcomponents/p-3378300c.entry.js +0 -5
- package/dist/webcomponents/p-3ae9cf69.entry.js +0 -5
- package/dist/webcomponents/p-3b79cd49.entry.js +0 -5
- package/dist/webcomponents/p-3c1513ec.entry.js +0 -5
- package/dist/webcomponents/p-4534a3c3.entry.js +0 -5
- package/dist/webcomponents/p-48abf568.entry.js +0 -5
- package/dist/webcomponents/p-4e5ea05c.entry.js +0 -5
- package/dist/webcomponents/p-521a1076.entry.js +0 -5
- package/dist/webcomponents/p-59fc52c0.entry.js +0 -5
- package/dist/webcomponents/p-5a9f4ea2.entry.js +0 -5
- package/dist/webcomponents/p-71853dfc.entry.js +0 -5
- package/dist/webcomponents/p-76d51654.entry.js +0 -5
- package/dist/webcomponents/p-77e242f3.entry.js +0 -5
- package/dist/webcomponents/p-7b849472.entry.js +0 -5
- package/dist/webcomponents/p-7dbfb875.entry.js +0 -5
- package/dist/webcomponents/p-7fa7f052.entry.js +0 -5
- package/dist/webcomponents/p-81c65747.entry.js +0 -5
- package/dist/webcomponents/p-91a5329f.entry.js +0 -5
- package/dist/webcomponents/p-966773a9.entry.js +0 -5
- package/dist/webcomponents/p-9abb5a53.entry.js +0 -5
- package/dist/webcomponents/p-9bf2e325.entry.js +0 -5
- package/dist/webcomponents/p-9c943b40.entry.js +0 -5
- package/dist/webcomponents/p-9ec3ca00.entry.js +0 -5
- package/dist/webcomponents/p-B0PbhaxL.js +0 -5
- package/dist/webcomponents/p-D3usVJE2.js +0 -16
- package/dist/webcomponents/p-ad91f149.entry.js +0 -5
- package/dist/webcomponents/p-aeea1f17.entry.js +0 -5
- package/dist/webcomponents/p-c2ca0289.entry.js +0 -5
- package/dist/webcomponents/p-c8af334e.entry.js +0 -5
- package/dist/webcomponents/p-cac49c6a.entry.js +0 -5
- package/dist/webcomponents/p-cb9ebfbe.entry.js +0 -5
- package/dist/webcomponents/p-ce3d689c.entry.js +0 -5
- package/dist/webcomponents/p-d11f95a0.entry.js +0 -5
- package/dist/webcomponents/p-dad03b49.entry.js +0 -5
- package/dist/webcomponents/p-db8e6322.entry.js +0 -5
- package/dist/webcomponents/p-dea8015f.entry.js +0 -5
- package/dist/webcomponents/p-e07e309d.entry.js +0 -5
- package/dist/webcomponents/p-e53d874b.entry.js +0 -5
- package/dist/webcomponents/p-e5540387.entry.js +0 -5
- package/dist/webcomponents/p-e9be4d3f.entry.js +0 -5
- package/dist/webcomponents/p-e9db9381.entry.js +0 -5
- package/dist/webcomponents/p-edca5de1.entry.js +0 -5
- package/dist/webcomponents/p-ee5b9fc9.entry.js +0 -5
- package/dist/webcomponents/p-f4ef8c63.entry.js +0 -5
- /package/dist/components/{p-5z6jgH1D.js → p-BNckUhK6.js} +0 -0
- /package/dist/webcomponents/{p-BIG-yees.js → p-Bt01zQ7-.js} +0 -0
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
'use strict';
|
|
6
6
|
|
|
7
7
|
var index$1 = require('./index-Bc30P_6z.js');
|
|
8
|
-
var index = require('./index-
|
|
9
|
-
var datetimePickerConstants = require('./datetime-picker-constants-
|
|
10
|
-
var
|
|
8
|
+
var index = require('./index-Caoez3xb.js');
|
|
9
|
+
var datetimePickerConstants = require('./datetime-picker-constants-CTf1kVJ1.js');
|
|
10
|
+
var isValid = require('./isValid-DgJ-noPS.js');
|
|
11
11
|
var event = require('./event-CmVdNHxl.js');
|
|
12
12
|
var propWarning = require('./prop-warning-xvEHQz8H.js');
|
|
13
|
-
var props = require('./props-D8dybmr0.js');
|
|
14
13
|
|
|
15
14
|
var addMonths = {};
|
|
16
15
|
|
|
@@ -101,6 +100,50 @@ function requireAddMonths () {
|
|
|
101
100
|
|
|
102
101
|
var addMonthsExports = /*@__PURE__*/ requireAddMonths();
|
|
103
102
|
|
|
103
|
+
var addYears = {};
|
|
104
|
+
|
|
105
|
+
var hasRequiredAddYears;
|
|
106
|
+
|
|
107
|
+
function requireAddYears () {
|
|
108
|
+
if (hasRequiredAddYears) return addYears;
|
|
109
|
+
hasRequiredAddYears = 1;
|
|
110
|
+
addYears.addYears = addYears$1;
|
|
111
|
+
var _index = /*@__PURE__*/ requireAddMonths();
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* The {@link addYears} function options.
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @name addYears
|
|
119
|
+
* @category Year Helpers
|
|
120
|
+
* @summary Add the specified number of years to the given date.
|
|
121
|
+
*
|
|
122
|
+
* @description
|
|
123
|
+
* Add the specified number of years to the given date.
|
|
124
|
+
*
|
|
125
|
+
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
|
|
126
|
+
* @typeParam ResultDate - The result `Date` type.
|
|
127
|
+
*
|
|
128
|
+
* @param date - The date to be changed
|
|
129
|
+
* @param amount - The amount of years to be added.
|
|
130
|
+
* @param options - The options
|
|
131
|
+
*
|
|
132
|
+
* @returns The new date with the years added
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* // Add 5 years to 1 September 2014:
|
|
136
|
+
* const result = addYears(new Date(2014, 8, 1), 5)
|
|
137
|
+
* //=> Sun Sep 01 2019 00:00:00
|
|
138
|
+
*/
|
|
139
|
+
function addYears$1(date, amount, options) {
|
|
140
|
+
return (0, _index.addMonths)(date, amount * 12, options);
|
|
141
|
+
}
|
|
142
|
+
return addYears;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
var addYearsExports = /*@__PURE__*/ requireAddYears();
|
|
146
|
+
|
|
104
147
|
var compareAsc = {};
|
|
105
148
|
|
|
106
149
|
var hasRequiredCompareAsc;
|
|
@@ -269,6 +312,8 @@ function requireEndOfWeek () {
|
|
|
269
312
|
|
|
270
313
|
var endOfWeekExports = /*@__PURE__*/ requireEndOfWeek();
|
|
271
314
|
|
|
315
|
+
var getDaysInMonthExports = /*@__PURE__*/ datetimePickerConstants.requireGetDaysInMonth();
|
|
316
|
+
|
|
272
317
|
var isAfter = {};
|
|
273
318
|
|
|
274
319
|
var hasRequiredIsAfter;
|
|
@@ -395,6 +440,8 @@ function requireIsSameMonth () {
|
|
|
395
440
|
|
|
396
441
|
var isSameMonthExports = /*@__PURE__*/ requireIsSameMonth();
|
|
397
442
|
|
|
443
|
+
var startOfDayExports = /*@__PURE__*/ datetimePickerConstants.requireStartOfDay();
|
|
444
|
+
|
|
398
445
|
var startOfMonth = {};
|
|
399
446
|
|
|
400
447
|
var hasRequiredStartOfMonth;
|
|
@@ -489,19 +536,20 @@ var subMonthsExports = /*@__PURE__*/ requireSubMonths();
|
|
|
489
536
|
|
|
490
537
|
const VALID_WEEK_START_DAYS = [0, 1, 2, 3, 4, 5, 6];
|
|
491
538
|
/**
|
|
492
|
-
* Verifica se
|
|
539
|
+
* Verifica se um valor representa um índice válido para o primeiro dia da semana (0-6).
|
|
493
540
|
*
|
|
494
|
-
* @param value
|
|
495
|
-
* @returns `true` quando
|
|
541
|
+
* @param {number} value Valor a validar (possivelmente vindo de uma `@Prop`).
|
|
542
|
+
* @returns {value is WeekDayIndex} `true` quando `value` é um `WeekDayIndex` válido (0..6).
|
|
496
543
|
*/
|
|
497
544
|
function isValidWeekStartsOn(value) {
|
|
498
545
|
return VALID_WEEK_START_DAYS.includes(value);
|
|
499
546
|
}
|
|
500
547
|
/**
|
|
501
|
-
* Normaliza o índice de início da semana
|
|
548
|
+
* Normaliza o índice de início da semana.
|
|
549
|
+
* Quando o valor é inválido, emite um aviso e retorna o fallback `0`.
|
|
502
550
|
*
|
|
503
|
-
* @param value
|
|
504
|
-
* @returns Índice normalizado
|
|
551
|
+
* @param {number} value Valor informado pelo consumidor.
|
|
552
|
+
* @returns {WeekDayIndex} Índice normalizado (`WeekDayIndex`).
|
|
505
553
|
*/
|
|
506
554
|
function normalizeWeekStartsOn(value) {
|
|
507
555
|
if (isValidWeekStartsOn(value))
|
|
@@ -510,11 +558,10 @@ function normalizeWeekStartsOn(value) {
|
|
|
510
558
|
return 0;
|
|
511
559
|
}
|
|
512
560
|
/**
|
|
513
|
-
*
|
|
514
|
-
* Retorna true se a resolução for bem-sucedida (inclui fallback).
|
|
561
|
+
* Verifica se um código de `locale` pode ser resolvido pelo date-fns.
|
|
515
562
|
*
|
|
516
|
-
* @param value
|
|
517
|
-
* @returns `true`
|
|
563
|
+
* @param {string} value Código de locale (ex.: "pt-BR").
|
|
564
|
+
* @returns {boolean} `true` se a resolução for bem-sucedida; `false` caso contrário.
|
|
518
565
|
*/
|
|
519
566
|
function isValidLocaleCode(value) {
|
|
520
567
|
try {
|
|
@@ -526,10 +573,11 @@ function isValidLocaleCode(value) {
|
|
|
526
573
|
}
|
|
527
574
|
}
|
|
528
575
|
/**
|
|
529
|
-
* Normaliza o locale informado
|
|
576
|
+
* Normaliza o código de `locale` informado pelo consumidor.
|
|
577
|
+
* Se inválido, emite aviso e retorna o `DATETIME_PICKER_LOCALE.DEFAULT`.
|
|
530
578
|
*
|
|
531
|
-
* @param value
|
|
532
|
-
* @returns
|
|
579
|
+
* @param {string} value Código de locale informado pelo consumidor.
|
|
580
|
+
* @returns {string} Código de locale validado (ou o default do componente).
|
|
533
581
|
*/
|
|
534
582
|
function normalizeLocale(value) {
|
|
535
583
|
if (isValidLocaleCode(value))
|
|
@@ -538,79 +586,86 @@ function normalizeLocale(value) {
|
|
|
538
586
|
return datetimePickerConstants.DATETIME_PICKER_LOCALE.DEFAULT;
|
|
539
587
|
}
|
|
540
588
|
|
|
541
|
-
const datePickerCss = () => `*,*::before,*::after{box-sizing:border-box}:host{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}main{display:block}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:rgba(0,0,0,0)}b,strong{font-weight:bolder}code{font-family:monospace;font-size:1em}small{font-size:80%}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.d-none{display:none !important}@media (min-width: 576px){.d-sm-block{display:block !important}.d-sm-flex{display:flex !important}}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown>.br-notification{left:auto;right:0}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.justify-content-start{justify-content:flex-start !important}.justify-content-end{justify-content:flex-end !important}.justify-content-center{justify-content:center !important}.align-items-center{align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter)*.5);padding-right:calc(var(--grid-gutter)*.5);width:100%}.col{flex:1 0 0%;min-width:8.3333333333%}.col-auto{flex:0 0 auto;width:auto}.col-2{flex-basis:16.6666666667%;max-width:16.6666666667%}.container,.container-fluid,.container-lg{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:flex;flex-wrap:wrap;margin-left:calc(var(--grid-gutter)*-0.5);margin-right:calc(var(--grid-gutter)*-0.5)}@media (min-width: 576px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}.col-sm-4{flex-basis:33.3333333333%;max-width:33.3333333333%}}@media (min-width: 992px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}.col-lg-3{flex-basis:25%;max-width:25%}}@media (min-width: 1600px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.ease{animation-timing-function:cubic-bezier(0.25, 0.1, 0.25, 1)}.ease-out{animation-timing-function:cubic-bezier(0, 0, 0.58, 1)}.ease-in-out{animation-timing-function:cubic-bezier(0.42, 0, 0.58, 1)}.fast{animation-duration:var(--duration-fast)}.slow{animation-duration:var(--duration-slow)}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mb-1{margin-bottom:var(--spacing-scale-half) !important}.ml-1{margin-left:var(--spacing-scale-half) !important}.mx-3{margin-left:var(--spacing-scale-2x) !important;margin-right:var(--spacing-scale-2x) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.ml-auto{margin-left:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}@media (min-width: 576px){.ml-sm-0{margin-left:var(--spacing-scale-default) !important}}.highlight{background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}fieldset[disabled]{opacity:1}.text-center{text-align:center !important}.text-right{text-align:right !important}.text-nowrap{white-space:nowrap !important}.text-uppercase{text-transform:uppercase !important}.text-bold{font-weight:700 !important}.text-base{font-size:var(--font-size-scale-base) !important}.text-down-01{font-size:var(--font-size-scale-down-01) !important}@media (min-width: 576px){.text-sm-center{text-align:center !important}.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half)}a:focus{outline:none}a.focus-visible,a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}a{color:var(--interactive);text-decoration:none}.main-content a{text-decoration:underline}button{cursor:pointer}img{max-width:100%;vertical-align:middle}h2,.h2{color:var(--color);font-size:var(--font-size-scale-up-03);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2xh);margin-top:var(--spacing-scale-3xh);padding-bottom:var(--spacing-scale-2xh)}@media (min-width: 576px){.h2,h2{font-size:var(--font-size-scale-up-05);font-weight:var(--font-weight-regular)}}ul,ol{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}table{--table-background:var(--background);--table-color:var(--color);--table-border-color:var(--gray-20);--table-border-style:solid;--table-border-width:1px;--table-hover:var(--color-rgb);--table-padding:var(--spacing-scale-3x);--table-font-weight:var(--font-weight-medium);--table-th-background:var(--background-alternative);--table-th-font-weight:var(--font-weight-semi-bold);--table-row-size:var(--spacing-scale-2x);border-collapse:collapse;width:100%}tr.selected,tr.is-selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}fieldset,.fieldset{border:var(--surface-width-none);margin-bottom:var(--spacing-scale-5x);margin-top:0;padding:0}legend,.legend{color:var(--color);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2x);margin-top:var(--spacing-scale-2x)}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}code,.code{background:var(--gray-5);border-radius:4px;color:var(--gray-80);display:inline-block;font-family:monospace;font-size:var(--font-size-scale-base);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);padding:var(--spacing-scale-half)}pre,.pre{background:var(--gray-5);margin:var(--spacing-scale-2x) 0 var(--spacing-scale-4x);padding:var(--spacing-scale-2x)}pre code,.pre code{display:inline;padding:0}*[data-toggle=collapse]:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}*[data-toggle=collapse]:focus{outline:none}*[data-toggle=collapse].focus-visible,*[data-toggle=collapse]:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}@media (prefers-reduced-motion: reduce){:host,:host::before,:host::after,:host *,:host *::before,:host *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}}:host-context([data-wbc-reduced-motion=true])::before,:host-context([data-wbc-reduced-motion=true])::after,:host-context([data-wbc-reduced-motion=true]) *,:host-context([data-wbc-reduced-motion=true]) *::before,:host-context([data-wbc-reduced-motion=true]) *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}:host{display:block;width:100%;max-width:304px;height:auto;box-sizing:border-box}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--spacing-scale-base);width:100%;box-sizing:border-box}select{appearance:none;border:none;background:rgba(0,0,0,0);padding-right:20px;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);color:var(--blue-warm-vivid-70);outline:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path fill='%231351b4' d='M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L224 285.229l154.706-154.705c9.373-9.373 24.569-9.373 33.941 0l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.373-24.569 9.373-33.942 0z'/></svg>");background-repeat:no-repeat;background-position:right .35rem center;background-size:10px}select option{color:var(--color)}select:focus{outline:none}select:focus-visible{outline:var(--focus) var(--focus-style) var(--focus-width);outline-offset:var(--focus-offset)}select:hover{cursor:pointer}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;white-space:nowrap;border:0}input[type=number]{width:70px;padding:4px;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);background-color:var(--gray-0);color:var(--gray-80);text-align:center;border-color:var(--border-color-alternative);border-radius:var(--surface-rounder-sm);border-style:var(--border-style);border-width:var(--border-width)}input[type=number]:hover{background:linear-gradient(rgb(var(--color-rgb), var(--hover)), rgb(var(--color-rgb), var(--hover)))}.weekdays{margin-bottom:var(--spacing-scale-half)}.weekdays,.monthdays{display:grid;grid-template-columns:repeat(7, 1fr);place-items:center center;text-align:center;gap:var(--spacing-scale-half) var(--spacing-scale-half);width:100%;box-sizing:border-box}.weekday{display:flex;align-items:center;justify-content:center;font-weight:var(--font-weight-medium);color:var(--gray-70);width:var(--spacing-scale-4x)}.week{display:contents}.day{display:flex;align-items:center;justify-content:center;justify-self:center;padding:var(--spacing-scale-half);font-weight:var(--font-weight-semi-bold);color:var(--blue-warm-vivid-70);border-radius:50%;width:var(--spacing-scale-4x);height:var(--spacing-scale-4x)}.day:hover{background:var(--hover-effect);cursor:pointer}.day:focus-visible{outline:var(--focus) var(--focus-style) var(--focus-width);outline-offset:var(--focus-offset)}.day.selected{background:var(--blue-warm-vivid-70);color:var(--color-secondary-01);font-weight:var(--font-weight-bold)}.day.in-range{background:var(--blue-warm-vivid-10);color:var(--blue-warm-vivid-70);border-radius:0;place-self:stretch stretch;width:100%;height:100%;overflow:hidden}.day.range-start{background:var(--blue-warm-vivid-70);color:var(--color-secondary-01);font-weight:var(--font-weight-bold);width:100%;height:100%;border-radius:var(--surface-rounder-pill) 0 0 var(--surface-rounder-pill);place-self:stretch stretch;overflow:hidden}.day.range-end{background:var(--blue-warm-vivid-70);color:var(--color-secondary-01);font-weight:var(--font-weight-bold);width:100%;height:100%;border-radius:0 var(--surface-rounder-pill) var(--surface-rounder-pill) 0;place-self:stretch stretch;overflow:hidden}.day.range-start.range-end{border-radius:var(--surface-rounder-pill);height:100%;overflow:hidden}.day.disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.outside-month{font-weight:var(--font-weight-regular);color:var(--gray-70)}.today{background:var(--orange-vivid-5);color:var(--gray-80)}`;
|
|
589
|
+
const datePickerCss = () => `*,*::before,*::after{box-sizing:border-box}:host{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}main{display:block}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:rgba(0,0,0,0)}b,strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.d-none{display:none !important}@media (min-width: 576px){.d-sm-block{display:block !important}.d-sm-flex{display:flex !important}}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown>.br-notification{left:auto;right:0}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.justify-content-start{justify-content:flex-start !important}.justify-content-end{justify-content:flex-end !important}.justify-content-center{justify-content:center !important}.align-items-center{align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter)*.5);padding-right:calc(var(--grid-gutter)*.5);width:100%}.col{flex:1 0 0%;min-width:8.3333333333%}.col-auto{flex:0 0 auto;width:auto}.col-2{flex-basis:16.6666666667%;max-width:16.6666666667%}.container,.container-fluid,.container-lg{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:flex;flex-wrap:wrap;margin-left:calc(var(--grid-gutter)*-0.5);margin-right:calc(var(--grid-gutter)*-0.5)}@media (min-width: 576px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}.col-sm-4{flex-basis:33.3333333333%;max-width:33.3333333333%}}@media (min-width: 992px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}.col-lg-3{flex-basis:25%;max-width:25%}}@media (min-width: 1600px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.ease{animation-timing-function:cubic-bezier(0.25, 0.1, 0.25, 1)}.ease-out{animation-timing-function:cubic-bezier(0, 0, 0.58, 1)}.ease-in-out{animation-timing-function:cubic-bezier(0.42, 0, 0.58, 1)}.fast{animation-duration:var(--duration-fast)}.slow{animation-duration:var(--duration-slow)}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mb-1{margin-bottom:var(--spacing-scale-half) !important}.ml-1{margin-left:var(--spacing-scale-half) !important}.mx-3{margin-left:var(--spacing-scale-2x) !important;margin-right:var(--spacing-scale-2x) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.ml-auto{margin-left:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}@media (min-width: 576px){.ml-sm-0{margin-left:var(--spacing-scale-default) !important}}.highlight{background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}fieldset[disabled]{opacity:1}.text-center{text-align:center !important}.text-right{text-align:right !important}.text-nowrap{white-space:nowrap !important}.text-uppercase{text-transform:uppercase !important}.text-bold{font-weight:700 !important}.text-base{font-size:var(--font-size-scale-base) !important}.text-down-01{font-size:var(--font-size-scale-down-01) !important}@media (min-width: 576px){.text-sm-center{text-align:center !important}.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half)}a:focus{outline:none}a.focus-visible,a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}a{color:var(--interactive);text-decoration:none}.main-content a{text-decoration:underline}button{cursor:pointer}img{max-width:100%;vertical-align:middle}h2,.h2{color:var(--color);font-size:var(--font-size-scale-up-03);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2xh);margin-top:var(--spacing-scale-3xh);padding-bottom:var(--spacing-scale-2xh)}@media (min-width: 576px){.h2,h2{font-size:var(--font-size-scale-up-05);font-weight:var(--font-weight-regular)}}ul,ol{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}table{--table-background:var(--background);--table-color:var(--color);--table-border-color:var(--gray-20);--table-border-style:solid;--table-border-width:1px;--table-hover:var(--color-rgb);--table-padding:var(--spacing-scale-3x);--table-font-weight:var(--font-weight-medium);--table-th-background:var(--background-alternative);--table-th-font-weight:var(--font-weight-semi-bold);--table-row-size:var(--spacing-scale-2x);border-collapse:collapse;width:100%}tr.selected,tr.is-selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}fieldset,.fieldset{border:var(--surface-width-none);margin-bottom:var(--spacing-scale-5x);margin-top:0;padding:0}legend,.legend{color:var(--color);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2x);margin-top:var(--spacing-scale-2x)}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}pre,.pre{background:var(--gray-5);margin:var(--spacing-scale-2x) 0 var(--spacing-scale-4x);padding:var(--spacing-scale-2x)}*[data-toggle=collapse]:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}*[data-toggle=collapse]:focus{outline:none}*[data-toggle=collapse].focus-visible,*[data-toggle=collapse]:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}@media (prefers-reduced-motion: reduce){:host,:host::before,:host::after,:host *,:host *::before,:host *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}}:host-context([data-wbc-reduced-motion=true])::before,:host-context([data-wbc-reduced-motion=true])::after,:host-context([data-wbc-reduced-motion=true]) *,:host-context([data-wbc-reduced-motion=true]) *::before,:host-context([data-wbc-reduced-motion=true]) *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}:host{display:block;width:100%;max-width:304px;height:auto;box-sizing:border-box}.header{display:flex;align-items:center;justify-content:space-between;margin-bottom:var(--spacing-scale-base);width:100%;box-sizing:border-box}select{appearance:none;border:none;background:rgba(0,0,0,0);padding-right:20px;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);color:var(--blue-warm-vivid-70);outline:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512'><path fill='%231351b4' d='M207.029 381.476L12.686 187.132c-9.373-9.373-9.373-24.569 0-33.941l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L224 285.229l154.706-154.705c9.373-9.373 24.569-9.373 33.941 0l22.667 22.667c9.373 9.373 9.373 24.569 0 33.941L240.971 381.476c-9.373 9.373-24.569 9.373-33.942 0z'/></svg>");background-repeat:no-repeat;background-position:right .35rem center;background-size:10px}select option{color:var(--color)}select:focus{outline:none}select:focus-visible{outline:var(--focus) var(--focus-style) var(--focus-width);outline-offset:var(--focus-offset)}select:hover{cursor:pointer}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;white-space:nowrap;border:0}input[type=number]{width:70px;padding:4px;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);background-color:var(--gray-0);color:var(--gray-80);text-align:center;border-color:var(--border-color-alternative);border-radius:var(--surface-rounder-sm);border-style:var(--border-style);border-width:var(--border-width)}input[type=number]:hover{background:linear-gradient(rgb(var(--color-rgb), var(--hover)), rgb(var(--color-rgb), var(--hover)))}.weekdays{margin-bottom:var(--spacing-scale-half)}.weekdays,.monthdays{display:grid;grid-template-columns:repeat(7, 1fr);place-items:center center;text-align:center;gap:var(--spacing-scale-half) var(--spacing-scale-half);width:100%;box-sizing:border-box}.weekday{display:flex;align-items:center;justify-content:center;font-weight:var(--font-weight-medium);color:var(--gray-70);width:var(--spacing-scale-4x)}.week{display:contents}.day{display:flex;align-items:center;justify-content:center;justify-self:center;padding:var(--spacing-scale-half);font-weight:var(--font-weight-semi-bold);color:var(--blue-warm-vivid-70);border-radius:50%;width:var(--spacing-scale-4x);height:var(--spacing-scale-4x)}.day:hover{background:var(--hover-effect);cursor:pointer}.day:focus-visible{outline:var(--focus) var(--focus-style) var(--focus-width);outline-offset:var(--focus-offset)}.day.selected{background:var(--blue-warm-vivid-70);color:var(--color-secondary-01);font-weight:var(--font-weight-bold)}.day.in-range{background:var(--blue-warm-vivid-10);color:var(--blue-warm-vivid-70);border-radius:0;place-self:stretch stretch;width:100%;height:100%;overflow:hidden}.day.range-start{background:var(--blue-warm-vivid-70);color:var(--color-secondary-01);font-weight:var(--font-weight-bold);width:100%;height:100%;border-radius:var(--surface-rounder-pill) 0 0 var(--surface-rounder-pill);place-self:stretch stretch;overflow:hidden}.day.range-end{background:var(--blue-warm-vivid-70);color:var(--color-secondary-01);font-weight:var(--font-weight-bold);width:100%;height:100%;border-radius:0 var(--surface-rounder-pill) var(--surface-rounder-pill) 0;place-self:stretch stretch;overflow:hidden}.day.range-start.range-end{border-radius:var(--surface-rounder-pill);height:100%;overflow:hidden}.day.disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.outside-month{font-weight:var(--font-weight-regular);color:var(--gray-70)}.today{background:var(--orange-vivid-5);color:var(--gray-80)}`;
|
|
542
590
|
|
|
591
|
+
/** Formato da chave local de dia usada em `data-date` e nas buscas de datas bloqueadas. */
|
|
592
|
+
const DAY_KEY_FORMAT = 'yyyy-MM-dd';
|
|
543
593
|
const DatePicker = class {
|
|
544
594
|
constructor(hostRef) {
|
|
545
595
|
index$1.registerInstance(this, hostRef);
|
|
546
596
|
this.dateStateChange = index$1.createEvent(this, "dateStateChange", 7);
|
|
547
|
-
/**
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
/** Define o índice do dia em que a semana começa na interface do calendário. */
|
|
597
|
+
/**
|
|
598
|
+
* Índice do dia em que a semana começa na interface do calendário.
|
|
599
|
+
* @default 0
|
|
600
|
+
*/
|
|
552
601
|
this.weekStartsOn = 0;
|
|
553
602
|
/**
|
|
554
|
-
* Data usada como base visual para o mês atualmente exibido
|
|
555
|
-
*
|
|
556
|
-
*
|
|
557
|
-
* @example
|
|
558
|
-
* ```js
|
|
559
|
-
* const calendar = document.querySelector('br-date-picker');
|
|
560
|
-
* calendar.referenceDate = new Date(2026, 8, 1);
|
|
561
|
-
* ```
|
|
603
|
+
* Data usada como base visual para o mês atualmente exibido.
|
|
604
|
+
* @default new Date()
|
|
562
605
|
*/
|
|
563
606
|
this.referenceDate = new Date();
|
|
564
607
|
/**
|
|
565
|
-
* Data
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
* @example
|
|
569
|
-
* ```js
|
|
570
|
-
* const calendar = document.querySelector('br-date-picker');
|
|
571
|
-
* calendar.value = new Date(2026, 8, 7);
|
|
572
|
-
* ```
|
|
608
|
+
* Data atualmente selecionada pelo usuário, ou `null` quando não há seleção.
|
|
609
|
+
* @default null
|
|
573
610
|
*/
|
|
574
611
|
this.value = null;
|
|
575
|
-
/**
|
|
612
|
+
/**
|
|
613
|
+
* Define se a seleção ocorre por data única ou por intervalo.
|
|
614
|
+
* @default 'single'
|
|
615
|
+
*/
|
|
576
616
|
this.selectionMode = 'single';
|
|
577
|
-
/**
|
|
617
|
+
/**
|
|
618
|
+
* Data inicial selecionada quando o calendário opera no modo de intervalo.
|
|
619
|
+
* @default null
|
|
620
|
+
*/
|
|
578
621
|
this.rangeStart = null;
|
|
579
|
-
/**
|
|
622
|
+
/**
|
|
623
|
+
* Data final selecionada quando o calendário opera no modo de intervalo.
|
|
624
|
+
* @default null
|
|
625
|
+
*/
|
|
580
626
|
this.rangeEnd = null;
|
|
581
|
-
/**
|
|
627
|
+
/**
|
|
628
|
+
* Desabilita a interação do calendário quando `true`.
|
|
629
|
+
* @default false
|
|
630
|
+
*/
|
|
582
631
|
this.disabled = false;
|
|
583
632
|
/**
|
|
584
633
|
* Lista de datas indisponíveis para seleção no calendário.
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
* @example
|
|
588
|
-
* ```js
|
|
589
|
-
* const calendar = document.querySelector('br-date-picker');
|
|
590
|
-
* calendar.disabledDates = [new Date(2026, 8, 7), new Date(2026, 8, 8)];
|
|
591
|
-
* ```
|
|
634
|
+
* @default []
|
|
592
635
|
*/
|
|
593
636
|
this.disabledDates = [];
|
|
594
|
-
/**
|
|
637
|
+
/**
|
|
638
|
+
* Locale usado para gerar nomes de meses e dias da semana.
|
|
639
|
+
* @default DATETIME_PICKER_LOCALE.DEFAULT
|
|
640
|
+
*/
|
|
595
641
|
this.locale = datetimePickerConstants.DATETIME_PICKER_LOCALE.DEFAULT;
|
|
596
642
|
/**
|
|
597
|
-
*
|
|
598
|
-
* ou variar conforme o mês.
|
|
599
|
-
*
|
|
600
|
-
* Quando `true`, o calendário sempre exibe 6 semanas completas.
|
|
601
|
-
* Quando `false`, o calendário adapta-se ao mês, exibindo apenas as semanas necessárias.
|
|
602
|
-
*
|
|
643
|
+
* Se `true`, o calendário sempre exibe 6 semanas (42 dias); caso contrário, adapta-se ao mês.
|
|
603
644
|
* @default false
|
|
604
645
|
*/
|
|
605
646
|
this.fixedRowCount = false;
|
|
606
|
-
/**
|
|
647
|
+
/**
|
|
648
|
+
* Data atualmente com foco para navegação por teclado.
|
|
649
|
+
* Usada para controlar qual célula do calendário recebe `tabindex=0`.
|
|
650
|
+
* @type {Date}
|
|
651
|
+
* @default new Date()
|
|
652
|
+
* @internal
|
|
653
|
+
*/
|
|
654
|
+
this.focusedDate = new Date();
|
|
655
|
+
/**
|
|
656
|
+
* Sinaliza ao `componentDidRender` que o foco deve ser movido para a célula atual.
|
|
657
|
+
* @internal
|
|
658
|
+
*/
|
|
607
659
|
this.shouldFocusDate = false;
|
|
608
|
-
/** Mantém handlers estáveis por data para evitar recriação a cada renderização. */
|
|
609
|
-
this.dayClickHandlers = new WeakMap();
|
|
610
660
|
/**
|
|
611
|
-
*
|
|
612
|
-
*
|
|
613
|
-
|
|
661
|
+
* Chaves `yyyy-MM-dd` das datas bloqueadas, para consulta O(1) por célula.
|
|
662
|
+
* @internal
|
|
663
|
+
*/
|
|
664
|
+
this.disabledDateKeysCache = new Set();
|
|
665
|
+
/**
|
|
666
|
+
* Handler de mudança do seletor de mês.
|
|
667
|
+
* @param event - evento de mudança do `<select>`
|
|
668
|
+
* @internal
|
|
614
669
|
*/
|
|
615
670
|
this.handleMonthChange = (event) => {
|
|
616
671
|
if (this.disabled) {
|
|
@@ -622,16 +677,21 @@ const DatePicker = class {
|
|
|
622
677
|
console.warn(`Índice de mês inválido selecionado: ${select.value}`);
|
|
623
678
|
return;
|
|
624
679
|
}
|
|
625
|
-
|
|
626
|
-
this.emitDateStateChange(date);
|
|
680
|
+
this.navigateToMonth(isValid.setExports.set(this.baseDate, { month: monthIndex, date: 1 }));
|
|
627
681
|
};
|
|
628
682
|
/**
|
|
629
|
-
*
|
|
630
|
-
*
|
|
631
|
-
* @
|
|
683
|
+
* Trata cliques nos botões de navegação do calendário.
|
|
684
|
+
* @param event - evento de clique
|
|
685
|
+
* @internal
|
|
632
686
|
*/
|
|
633
687
|
this.handleNavigationClick = (event) => {
|
|
634
|
-
|
|
688
|
+
if (this.disabled) {
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
const actionFromPath = event
|
|
692
|
+
.composedPath()
|
|
693
|
+
.find((target) => target instanceof HTMLElement && target.dataset.action !== undefined);
|
|
694
|
+
const action = (actionFromPath?.dataset.action ?? event.currentTarget?.dataset.action);
|
|
635
695
|
if (action === undefined) {
|
|
636
696
|
console.warn('Botão de navegação clicado sem data-action definido');
|
|
637
697
|
return;
|
|
@@ -648,9 +708,10 @@ const DatePicker = class {
|
|
|
648
708
|
}
|
|
649
709
|
};
|
|
650
710
|
/**
|
|
651
|
-
*
|
|
652
|
-
*
|
|
653
|
-
* @param event -
|
|
711
|
+
* Handler de alteração do campo ano.
|
|
712
|
+
* Valida o ano antes de aplicar a mudança.
|
|
713
|
+
* @param event - evento de mudança do input de ano
|
|
714
|
+
* @internal
|
|
654
715
|
*/
|
|
655
716
|
this.handleYearChange = (event) => {
|
|
656
717
|
if (this.disabled) {
|
|
@@ -662,23 +723,35 @@ const DatePicker = class {
|
|
|
662
723
|
console.warn(`Ano inválido digitado: ${input.value}`);
|
|
663
724
|
return;
|
|
664
725
|
}
|
|
665
|
-
|
|
666
|
-
const range = this.effectiveSelectionMode === 'range' && this.rangeStart !== null && this.rangeEnd !== null
|
|
667
|
-
? { start: this.rangeStart, end: this.rangeEnd }
|
|
668
|
-
: undefined;
|
|
669
|
-
this.emitDateStateChange(date, this.value, range);
|
|
726
|
+
this.navigateToMonth(isValid.setExports.set(this.baseDate, { year, month: this.baseDate.getMonth(), date: 1 }));
|
|
670
727
|
};
|
|
671
728
|
/**
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
*
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
729
|
+
* Trata cliques com um handler compartilhado, lendo a data local da célula.
|
|
730
|
+
* @param event - evento de clique da célula
|
|
731
|
+
* @internal
|
|
732
|
+
*/
|
|
733
|
+
this.handleDayCellClick = (event) => {
|
|
734
|
+
const cell = event.currentTarget;
|
|
735
|
+
if (!(cell instanceof HTMLElement) || cell.dataset.date === undefined) {
|
|
736
|
+
console.warn('Célula de dia clicada sem data-date definido');
|
|
737
|
+
return;
|
|
738
|
+
}
|
|
739
|
+
const date = isValid.parseExports.parse(cell.dataset.date, DAY_KEY_FORMAT, this.baseDate);
|
|
740
|
+
if (Number.isNaN(date.getTime())) {
|
|
741
|
+
console.warn(`Data inválida na célula de dia: ${cell.dataset.date}`);
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
this.handleDayClick(date);
|
|
745
|
+
};
|
|
746
|
+
/**
|
|
747
|
+
* Gerencia navegação por teclado dentro da grade de dias.
|
|
748
|
+
* Teclas suportadas: ArrowLeft/Right/Up/Down, PageUp/PageDown (mês), Shift+PageUp/PageDown (ano),
|
|
749
|
+
* Home/End, Enter/Space.
|
|
680
750
|
*
|
|
681
|
-
*
|
|
751
|
+
* Permanece ativo em datas bloqueadas para que o foco não fique preso nelas; somente a seleção é ignorada.
|
|
752
|
+
* @param event - evento de teclado
|
|
753
|
+
* @returns void
|
|
754
|
+
* @internal
|
|
682
755
|
*/
|
|
683
756
|
this.handleGridKeydown = (event) => {
|
|
684
757
|
const HANDLED_KEYS = [
|
|
@@ -695,12 +768,22 @@ const DatePicker = class {
|
|
|
695
768
|
];
|
|
696
769
|
if (!HANDLED_KEYS.includes(event.key))
|
|
697
770
|
return;
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
771
|
+
// O `event.target` pode ser um nó interno (texto) ou o foco pode estar
|
|
772
|
+
// em um container; tentamos localizar a célula com `data-date`.
|
|
773
|
+
const targetEl = event.target?.closest?.('[data-date]');
|
|
774
|
+
// Se encontrarmos a célula, usamos sua data; caso contrário, usamos a
|
|
775
|
+
// data atualmente focada (`focusedDate`) como fallback. Em ambos os casos
|
|
776
|
+
// prevenimos o comportamento padrão para manter consistência.
|
|
777
|
+
let current;
|
|
778
|
+
if (targetEl && targetEl.dataset?.date !== undefined) {
|
|
779
|
+
const dateKey = targetEl.dataset.date;
|
|
780
|
+
event.preventDefault();
|
|
781
|
+
current = isValid.parseExports.parse(dateKey, DAY_KEY_FORMAT, new Date());
|
|
782
|
+
}
|
|
783
|
+
else {
|
|
784
|
+
event.preventDefault();
|
|
785
|
+
current = this.getNormalizedFocusedDate();
|
|
786
|
+
}
|
|
704
787
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
705
788
|
if (!this.isDateDisabled(current)) {
|
|
706
789
|
this.handleDayClick(current);
|
|
@@ -722,10 +805,10 @@ const DatePicker = class {
|
|
|
722
805
|
next = index.addDaysExports.addDays(current, 7);
|
|
723
806
|
break;
|
|
724
807
|
case 'PageUp':
|
|
725
|
-
next = addMonthsExports.addMonths(current, -1);
|
|
808
|
+
next = event.shiftKey ? addYearsExports.addYears(current, -1) : addMonthsExports.addMonths(current, -1);
|
|
726
809
|
break;
|
|
727
810
|
case 'PageDown':
|
|
728
|
-
next = addMonthsExports.addMonths(current, 1);
|
|
811
|
+
next = event.shiftKey ? addYearsExports.addYears(current, 1) : addMonthsExports.addMonths(current, 1);
|
|
729
812
|
break;
|
|
730
813
|
case 'Home':
|
|
731
814
|
next = index.startOfWeekExports.startOfWeek(current, { weekStartsOn: this.weekStartsOn });
|
|
@@ -739,47 +822,43 @@ const DatePicker = class {
|
|
|
739
822
|
this.moveFocusTo(next);
|
|
740
823
|
};
|
|
741
824
|
}
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
825
|
+
/**
|
|
826
|
+
* Observador para a prop `rangeValue` — sincroniza `rangeStart` e `rangeEnd`.
|
|
827
|
+
* @param {DatetimePickerDateRange | undefined} newValue - novo intervalo controlado recebido (`undefined` quando não fornecido)
|
|
828
|
+
* @internal
|
|
829
|
+
*/
|
|
745
830
|
handleRangeValueChange(newValue) {
|
|
746
831
|
if (!newValue)
|
|
747
832
|
return;
|
|
748
|
-
if (!datetimePickerPropsValidation.isValidDatetimePickerDateRange(newValue)) {
|
|
749
|
-
propWarning.reportInvalidPropValue(this.el, 'rangeValue', newValue, 'Informe um objeto com `start` e `end` como Date válido ou null.', 'Ignorando o intervalo inválido e mantendo o último intervalo efetivo.');
|
|
750
|
-
return;
|
|
751
|
-
}
|
|
752
833
|
this.rangeStart = newValue.start;
|
|
753
834
|
this.rangeEnd = newValue.end;
|
|
754
835
|
}
|
|
755
836
|
/**
|
|
756
837
|
* Sincroniza `focusedDate` quando o valor selecionado muda externamente.
|
|
757
838
|
*
|
|
758
|
-
* @param newValue - Novo valor recebido via prop.
|
|
839
|
+
* @param {Date | null} newValue - Novo valor recebido via prop.
|
|
759
840
|
*/
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
const normalizedReferenceDate = this.normalizeDateProp(newValue, 'referenceDate', new Date());
|
|
771
|
-
const receivedTime = newValue instanceof Date && !Number.isNaN(newValue.getTime()) ? newValue.getTime() : null;
|
|
772
|
-
if (normalizedReferenceDate.getTime() !== receivedTime) {
|
|
773
|
-
this.referenceDate = normalizedReferenceDate;
|
|
774
|
-
return;
|
|
841
|
+
/**
|
|
842
|
+
* Observador para a prop `value` — atualiza `focusedDate` quando a seleção externa muda.
|
|
843
|
+
* @param {Date | null} newValue - novo valor de seleção (ou `null`)
|
|
844
|
+
* @param {Date | null} oldValue - valor anterior da seleção
|
|
845
|
+
* @internal
|
|
846
|
+
*/
|
|
847
|
+
handleValueChange(newValue, oldValue) {
|
|
848
|
+
// Reatribuições com o mesmo instante (ex.: navegação entre meses) não devem mover o foco.
|
|
849
|
+
if (newValue !== null && newValue.getTime() !== oldValue?.getTime()) {
|
|
850
|
+
this.focusedDate = isValid.toDateExports.toDate(newValue);
|
|
775
851
|
}
|
|
776
|
-
if (this.value === null)
|
|
777
|
-
this.focusedDate = datetimePickerPropsValidation.toDateExports.toDate(normalizedReferenceDate);
|
|
778
852
|
}
|
|
779
853
|
/**
|
|
780
854
|
* Revalida a configuração quando o início da semana muda.
|
|
781
855
|
*
|
|
782
|
-
* @param newValue - Novo valor recebido via prop.
|
|
856
|
+
* @param {number} newValue - Novo valor recebido via prop.
|
|
857
|
+
*/
|
|
858
|
+
/**
|
|
859
|
+
* Observador para `weekStartsOn` — revalida a configuração quando alterada externamente.
|
|
860
|
+
* @param {number} newValue - novo índice do início da semana
|
|
861
|
+
* @internal
|
|
783
862
|
*/
|
|
784
863
|
handleWeekStartsOnChange(newValue) {
|
|
785
864
|
this.ensureValidWeekStartsOn(newValue);
|
|
@@ -787,42 +866,35 @@ const DatePicker = class {
|
|
|
787
866
|
/**
|
|
788
867
|
* Revalida o locale quando a prop muda.
|
|
789
868
|
*
|
|
790
|
-
* @param newValue - Novo valor recebido via prop.
|
|
869
|
+
* @param {string} newValue - Novo valor recebido via prop.
|
|
870
|
+
*/
|
|
871
|
+
/**
|
|
872
|
+
* Observador para `locale` — revalida/normaliza o locale informado.
|
|
873
|
+
* @param {string} newValue - nova string de locale
|
|
874
|
+
* @internal
|
|
791
875
|
*/
|
|
792
876
|
handleLocaleChange(newValue) {
|
|
793
877
|
this.ensureValidLocale(newValue);
|
|
794
878
|
}
|
|
795
|
-
handleDisabledDatesChange(newValue) {
|
|
796
|
-
this.normalizedDisabledDates = datetimePickerPropsValidation.normalizeDatetimePickerDisabledDates(newValue, 'br-date-picker');
|
|
797
|
-
}
|
|
798
|
-
/**
|
|
799
|
-
* Normaliza os valores públicos antes da primeira renderização.
|
|
800
|
-
*/
|
|
801
879
|
componentWillLoad() {
|
|
802
|
-
this.referenceDate =
|
|
803
|
-
this.value = this.normalizeDateProp(this.value, 'value', null);
|
|
804
|
-
this.referenceDate = datetimePickerPropsValidation.resolveSsrLocalDate(this.el, this.referenceDate);
|
|
880
|
+
this.referenceDate = isValid.resolveSsrLocalDate(this.el, this.referenceDate);
|
|
805
881
|
this.ensureValidWeekStartsOn();
|
|
806
882
|
this.ensureValidLocale();
|
|
807
|
-
this.
|
|
808
|
-
this.focusedDate = datetimePickerPropsValidation.toDateExports.toDate(this.value ?? this.referenceDate);
|
|
883
|
+
this.focusedDate = isValid.toDateExports.toDate(this.value ?? this.referenceDate);
|
|
809
884
|
}
|
|
810
|
-
/**
|
|
811
|
-
* Move o foco para a célula correspondente ao `focusedDate` após re-renderização.
|
|
812
|
-
*/
|
|
813
885
|
componentDidRender() {
|
|
814
886
|
if (!this.shouldFocusDate)
|
|
815
887
|
return;
|
|
816
888
|
this.shouldFocusDate = false;
|
|
817
889
|
const normalizedDate = this.getNormalizedFocusedDate();
|
|
818
|
-
const dateKey = datetimePickerConstants.formatExports.format(normalizedDate,
|
|
890
|
+
const dateKey = datetimePickerConstants.formatExports.format(normalizedDate, DAY_KEY_FORMAT);
|
|
819
891
|
const cell = this.el.shadowRoot?.querySelector(`[data-date="${dateKey}"]`);
|
|
820
892
|
cell?.focus();
|
|
821
893
|
}
|
|
822
894
|
/**
|
|
823
|
-
*
|
|
824
|
-
*
|
|
895
|
+
* Valida e normaliza `weekStartsOn`.
|
|
825
896
|
* @param value - Valor bruto informado pelo consumidor.
|
|
897
|
+
* @internal
|
|
826
898
|
*/
|
|
827
899
|
ensureValidWeekStartsOn(value = this.weekStartsOn) {
|
|
828
900
|
const normalizedWeekStartsOn = normalizeWeekStartsOn(value);
|
|
@@ -830,18 +902,10 @@ const DatePicker = class {
|
|
|
830
902
|
this.weekStartsOn = normalizedWeekStartsOn;
|
|
831
903
|
}
|
|
832
904
|
}
|
|
833
|
-
normalizeDateProp(value, propertyName, fallback) {
|
|
834
|
-
if (value === null && fallback === null)
|
|
835
|
-
return null;
|
|
836
|
-
if (value instanceof Date && !Number.isNaN(value.getTime()))
|
|
837
|
-
return datetimePickerPropsValidation.toDateExports.toDate(value);
|
|
838
|
-
propWarning.reportInvalidPropValue(this.el, propertyName, value, 'Informe uma instância de Date válida.', `Aplicando fallback ${fallback === null ? 'null' : 'new Date()'}.`);
|
|
839
|
-
return fallback === null ? null : datetimePickerPropsValidation.toDateExports.toDate(fallback);
|
|
840
|
-
}
|
|
841
905
|
/**
|
|
842
|
-
*
|
|
843
|
-
*
|
|
906
|
+
* Valida e normaliza o `locale` informado.
|
|
844
907
|
* @param value - Valor bruto informado pelo consumidor.
|
|
908
|
+
* @internal
|
|
845
909
|
*/
|
|
846
910
|
ensureValidLocale(value = this.locale) {
|
|
847
911
|
const normalizedLocale = normalizeLocale(value);
|
|
@@ -850,16 +914,20 @@ const DatePicker = class {
|
|
|
850
914
|
}
|
|
851
915
|
}
|
|
852
916
|
/**
|
|
853
|
-
* Emite
|
|
917
|
+
* Emite `dateStateChange` atualizando `referenceDate`, `value` e `range`.
|
|
918
|
+
* Zera segundos/milissegundos para consistência.
|
|
854
919
|
*
|
|
855
|
-
* @param nextReferenceDate -
|
|
856
|
-
* @param nextValue -
|
|
920
|
+
* @param nextReferenceDate - nova data de referência
|
|
921
|
+
* @param nextValue - data selecionada ou `null` (por padrão, mantém `this.value`)
|
|
922
|
+
* @param nextRange - intervalo de datas quando aplicável
|
|
923
|
+
* @internal
|
|
857
924
|
*/
|
|
858
925
|
emitDateStateChange(nextReferenceDate, nextValue = this.value, nextRange = undefined) {
|
|
859
926
|
// Garantir segundos zerados (componente não manipula segundos)
|
|
860
|
-
const normalizedReference =
|
|
861
|
-
const normalizedValue = nextValue === null ? null :
|
|
927
|
+
const normalizedReference = isValid.setExports.set(nextReferenceDate, { seconds: 0, milliseconds: 0 });
|
|
928
|
+
const normalizedValue = nextValue === null ? null : isValid.setExports.set(nextValue, { seconds: 0, milliseconds: 0 });
|
|
862
929
|
const valueChanged = this.value?.getTime() !== normalizedValue?.getTime();
|
|
930
|
+
this.referenceDate = normalizedReference;
|
|
863
931
|
this.value = normalizedValue;
|
|
864
932
|
this.dateStateChange.emit({
|
|
865
933
|
referenceDate: normalizedReference,
|
|
@@ -874,10 +942,10 @@ const DatePicker = class {
|
|
|
874
942
|
}
|
|
875
943
|
}
|
|
876
944
|
/**
|
|
877
|
-
* Resolve o ícone
|
|
878
|
-
*
|
|
879
|
-
* @
|
|
880
|
-
* @
|
|
945
|
+
* Resolve o nome do ícone para a ação de navegação.
|
|
946
|
+
* @param action - Ação de navegação
|
|
947
|
+
* @returns Nome do ícone
|
|
948
|
+
* @internal
|
|
881
949
|
*/
|
|
882
950
|
getIconForAction(action) {
|
|
883
951
|
switch (action) {
|
|
@@ -890,27 +958,31 @@ const DatePicker = class {
|
|
|
890
958
|
}
|
|
891
959
|
}
|
|
892
960
|
/**
|
|
893
|
-
*
|
|
894
|
-
*
|
|
895
|
-
* @
|
|
961
|
+
* Trata o clique numa célula de dia: aplica seleção ou atualiza intervalo.
|
|
962
|
+
* @param date - dia clicado
|
|
963
|
+
* @internal
|
|
896
964
|
*/
|
|
897
965
|
handleDayClick(date) {
|
|
898
966
|
if (this.disabled || this.isDateDisabled(date)) {
|
|
899
967
|
return;
|
|
900
968
|
}
|
|
901
|
-
const newDate =
|
|
969
|
+
const newDate = isValid.setExports.set(date, {
|
|
902
970
|
hours: this.referenceDate.getHours(),
|
|
903
971
|
minutes: this.referenceDate.getMinutes(),
|
|
904
972
|
seconds: 0,
|
|
905
973
|
milliseconds: 0,
|
|
906
974
|
});
|
|
907
|
-
if (this.
|
|
975
|
+
if (this.selectionMode === 'range') {
|
|
908
976
|
this.handleRangeDayClick(newDate);
|
|
909
977
|
return;
|
|
910
978
|
}
|
|
911
979
|
this.emitDateStateChange(newDate, newDate);
|
|
912
980
|
}
|
|
913
|
-
/**
|
|
981
|
+
/**
|
|
982
|
+
* Atualiza o intervalo selecionado no modo `range`.
|
|
983
|
+
* @param clickedDate - data clicada pelo usuário
|
|
984
|
+
* @internal
|
|
985
|
+
*/
|
|
914
986
|
handleRangeDayClick(clickedDate) {
|
|
915
987
|
const start = this.rangeStart;
|
|
916
988
|
const end = this.rangeEnd;
|
|
@@ -927,153 +999,205 @@ const DatePicker = class {
|
|
|
927
999
|
end: normalizedEnd,
|
|
928
1000
|
});
|
|
929
1001
|
}
|
|
930
|
-
/**
|
|
1002
|
+
/**
|
|
1003
|
+
* Decrementa o mês exibido e preserva seleção/intervalo quando aplicável.
|
|
1004
|
+
* @internal
|
|
1005
|
+
*/
|
|
931
1006
|
decreaseMonth() {
|
|
932
1007
|
if (this.disabled) {
|
|
933
1008
|
return;
|
|
934
1009
|
}
|
|
935
|
-
|
|
936
|
-
const range = this.effectiveSelectionMode === 'range' && this.rangeStart !== null && this.rangeEnd !== null
|
|
937
|
-
? { start: this.rangeStart, end: this.rangeEnd }
|
|
938
|
-
: undefined;
|
|
939
|
-
this.emitDateStateChange(date, this.value, range);
|
|
1010
|
+
this.navigateToMonth(isValid.setExports.set(subMonthsExports.subMonths(this.baseDate, 1), { date: 1 }));
|
|
940
1011
|
}
|
|
941
|
-
/**
|
|
1012
|
+
/**
|
|
1013
|
+
* Incrementa o mês exibido e preserva seleção/intervalo quando aplicável.
|
|
1014
|
+
* @internal
|
|
1015
|
+
*/
|
|
942
1016
|
increaseMonth() {
|
|
943
1017
|
if (this.disabled) {
|
|
944
1018
|
return;
|
|
945
1019
|
}
|
|
946
|
-
|
|
947
|
-
|
|
1020
|
+
this.navigateToMonth(isValid.setExports.set(addMonthsExports.addMonths(this.baseDate, 1), { date: 1 }));
|
|
1021
|
+
}
|
|
1022
|
+
/**
|
|
1023
|
+
* Exibe o mês informado preservando a seleção, o intervalo completo e o dia em foco.
|
|
1024
|
+
*
|
|
1025
|
+
* O foco vai para a data selecionada quando ela pertence ao novo mês; caso
|
|
1026
|
+
* contrário, mantém o mesmo dia do mês, limitado ao último dia disponível
|
|
1027
|
+
* (ex.: 31/01 → 28/02).
|
|
1028
|
+
*
|
|
1029
|
+
* @param monthDate - primeiro dia do mês de destino
|
|
1030
|
+
* @internal
|
|
1031
|
+
*/
|
|
1032
|
+
navigateToMonth(monthDate) {
|
|
1033
|
+
const value = this.value;
|
|
1034
|
+
this.focusedDate =
|
|
1035
|
+
value !== null && isSameMonthExports.isSameMonth(value, monthDate)
|
|
1036
|
+
? value
|
|
1037
|
+
: isValid.setExports.set(monthDate, { date: Math.min(this.focusedDate.getDate(), getDaysInMonthExports.getDaysInMonth(monthDate)) });
|
|
1038
|
+
const range = this.selectionMode === 'range' && this.rangeStart !== null && this.rangeEnd !== null
|
|
948
1039
|
? { start: this.rangeStart, end: this.rangeEnd }
|
|
949
1040
|
: undefined;
|
|
950
|
-
this.emitDateStateChange(
|
|
1041
|
+
this.emitDateStateChange(monthDate, value, range);
|
|
951
1042
|
}
|
|
952
|
-
/**
|
|
1043
|
+
/**
|
|
1044
|
+
* Verifica se uma data está indisponível para seleção.
|
|
1045
|
+
* @param date - data a verificar
|
|
1046
|
+
* @returns `true` se a data estiver na lista de `disabledDates`
|
|
1047
|
+
* @internal
|
|
1048
|
+
*/
|
|
953
1049
|
isDateDisabled(date) {
|
|
954
|
-
return this.
|
|
1050
|
+
return this.disabledDateKeys.has(datetimePickerConstants.formatExports.format(date, DAY_KEY_FORMAT));
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Chaves locais das datas bloqueadas, recalculadas somente quando `disabledDates` é substituída.
|
|
1054
|
+
* Entradas inválidas são ignoradas.
|
|
1055
|
+
* @internal
|
|
1056
|
+
*/
|
|
1057
|
+
get disabledDateKeys() {
|
|
1058
|
+
if (this.disabledDateKeysSource !== this.disabledDates) {
|
|
1059
|
+
this.disabledDateKeysSource = this.disabledDates;
|
|
1060
|
+
this.disabledDateKeysCache = new Set((this.disabledDates ?? [])
|
|
1061
|
+
.map((disabledDate) => isValid.toDateExports.toDate(disabledDate))
|
|
1062
|
+
.filter((disabledDate) => !Number.isNaN(disabledDate.getTime()))
|
|
1063
|
+
.map((disabledDate) => datetimePickerConstants.formatExports.format(disabledDate, DAY_KEY_FORMAT)));
|
|
1064
|
+
}
|
|
1065
|
+
return this.disabledDateKeysCache;
|
|
955
1066
|
}
|
|
956
|
-
/**
|
|
1067
|
+
/**
|
|
1068
|
+
* Data base usada para todos os cálculos de calendário.
|
|
1069
|
+
* @returns data de referência interna
|
|
1070
|
+
* @internal
|
|
1071
|
+
*/
|
|
957
1072
|
get baseDate() {
|
|
958
1073
|
return this.referenceDate;
|
|
959
1074
|
}
|
|
960
1075
|
/**
|
|
961
|
-
*
|
|
962
|
-
*
|
|
963
|
-
* @
|
|
964
|
-
* @
|
|
1076
|
+
* Formata o dia exibido com zero à esquerda (ex: '01', '09').
|
|
1077
|
+
* @param date - data a formatar
|
|
1078
|
+
* @returns string com dois dígitos do dia
|
|
1079
|
+
* @internal
|
|
965
1080
|
*/
|
|
966
|
-
getDayClickHandler(date) {
|
|
967
|
-
let handler = this.dayClickHandlers.get(date);
|
|
968
|
-
if (handler === undefined) {
|
|
969
|
-
handler = () => this.handleDayClick(date);
|
|
970
|
-
this.dayClickHandlers.set(date, handler);
|
|
971
|
-
}
|
|
972
|
-
return handler;
|
|
973
|
-
}
|
|
974
|
-
/** Formata o dia exibido com zero à esquerda. */
|
|
975
1081
|
getDayWithLeadingZero(date) {
|
|
976
1082
|
return datetimePickerConstants.formatExports.format(date, 'dd');
|
|
977
1083
|
}
|
|
978
1084
|
/**
|
|
979
|
-
* Constrói o rótulo acessível
|
|
980
|
-
*
|
|
981
|
-
* @param
|
|
982
|
-
* @returns
|
|
1085
|
+
* Constrói o rótulo acessível da célula de dia, incluindo estado (selecionado/início/fim).
|
|
1086
|
+
* @param date - dia representado pela célula
|
|
1087
|
+
* @param state - estado já calculado da célula
|
|
1088
|
+
* @returns string para `aria-label`
|
|
1089
|
+
* @internal
|
|
983
1090
|
*/
|
|
984
|
-
getDayCellAriaLabel(date) {
|
|
1091
|
+
getDayCellAriaLabel(date, state) {
|
|
985
1092
|
const fullDate = datetimePickerConstants.formatExports.format(date, "d 'de' MMMM 'de' yyyy", { locale: this.dateFnsLocale });
|
|
986
|
-
|
|
987
|
-
const isRangeStart = this.effectiveSelectionMode === 'range' && this.rangeStart !== null && datetimePickerPropsValidation.isSameDayExports.isSameDay(date, this.rangeStart);
|
|
988
|
-
const isRangeEnd = this.effectiveSelectionMode === 'range' && this.rangeEnd !== null && datetimePickerPropsValidation.isSameDayExports.isSameDay(date, this.rangeEnd);
|
|
989
|
-
const isBetween = this.effectiveSelectionMode === 'range' &&
|
|
990
|
-
this.rangeStart !== null &&
|
|
991
|
-
this.rangeEnd !== null &&
|
|
992
|
-
this.isDateBetweenRange(date, this.rangeStart, this.rangeEnd);
|
|
993
|
-
if (isSelected)
|
|
1093
|
+
if (state.isSelected)
|
|
994
1094
|
return `${fullDate}, selecionado`;
|
|
995
|
-
if (isRangeStart)
|
|
1095
|
+
if (state.isRangeStart)
|
|
996
1096
|
return `${fullDate}, início do intervalo`;
|
|
997
|
-
if (isRangeEnd)
|
|
1097
|
+
if (state.isRangeEnd)
|
|
998
1098
|
return `${fullDate}, fim do intervalo`;
|
|
999
|
-
if (
|
|
1099
|
+
if (state.isInRange)
|
|
1000
1100
|
return `${fullDate}, no intervalo selecionado`;
|
|
1001
1101
|
return fullDate;
|
|
1002
1102
|
}
|
|
1003
|
-
/**
|
|
1103
|
+
/**
|
|
1104
|
+
* Locale do `date-fns` derivado da prop pública `locale`.
|
|
1105
|
+
* @internal
|
|
1106
|
+
*/
|
|
1004
1107
|
get dateFnsLocale() {
|
|
1005
1108
|
return index.resolveDateFnsLocale(this.locale);
|
|
1006
1109
|
}
|
|
1007
1110
|
/**
|
|
1008
|
-
* Calcula
|
|
1009
|
-
*
|
|
1010
|
-
* @param
|
|
1111
|
+
* Calcula uma única vez o estado de seleção da célula, compartilhado por classes, ARIA e foco.
|
|
1112
|
+
* @param date - dia da grade
|
|
1113
|
+
* @param today - instante atual compartilhado pela renderização da grade
|
|
1114
|
+
* @returns estado da célula
|
|
1115
|
+
* @internal
|
|
1116
|
+
*/
|
|
1117
|
+
getDayCellState(date, today) {
|
|
1118
|
+
const isRange = this.selectionMode === 'range';
|
|
1119
|
+
const { value, rangeStart, rangeEnd } = this;
|
|
1120
|
+
return {
|
|
1121
|
+
isToday: isValid.isSameDayExports.isSameDay(date, today),
|
|
1122
|
+
isOutsideMonth: !isSameMonthExports.isSameMonth(date, this.baseDate),
|
|
1123
|
+
isSelected: !isRange && value !== null && isValid.isSameDayExports.isSameDay(date, value),
|
|
1124
|
+
isRangeStart: isRange && rangeStart !== null && isValid.isSameDayExports.isSameDay(date, rangeStart),
|
|
1125
|
+
isRangeEnd: isRange && rangeEnd !== null && isValid.isSameDayExports.isSameDay(date, rangeEnd),
|
|
1126
|
+
isInRange: isRange && rangeStart !== null && rangeEnd !== null && this.isDateBetweenRange(date, rangeStart, rangeEnd),
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
/**
|
|
1130
|
+
* Calcula o mapa de classes CSS da célula do dia.
|
|
1131
|
+
* @param state - estado já calculado da célula
|
|
1132
|
+
* @param disabled - indica se a célula está bloqueada
|
|
1133
|
+
* @returns mapa de classes booleanas
|
|
1134
|
+
* @internal
|
|
1011
1135
|
*/
|
|
1012
|
-
getDayCssClasses(
|
|
1013
|
-
const selected = this.value;
|
|
1014
|
-
const rangeStart = this.rangeStart;
|
|
1015
|
-
const rangeEnd = this.rangeEnd;
|
|
1016
|
-
const hasRange = rangeStart !== null && rangeEnd !== null;
|
|
1017
|
-
const isRangeStart = rangeStart !== null && datetimePickerPropsValidation.isSameDayExports.isSameDay(date, rangeStart);
|
|
1018
|
-
const isRangeEnd = rangeEnd !== null && datetimePickerPropsValidation.isSameDayExports.isSameDay(date, rangeEnd);
|
|
1019
|
-
const isBetweenRange = hasRange && this.isDateBetweenRange(date, rangeStart, rangeEnd);
|
|
1136
|
+
getDayCssClasses(state, disabled) {
|
|
1020
1137
|
return {
|
|
1021
1138
|
day: true,
|
|
1022
|
-
'outside-month':
|
|
1023
|
-
today:
|
|
1024
|
-
selected:
|
|
1025
|
-
'range-start':
|
|
1026
|
-
'range-end':
|
|
1027
|
-
'in-range':
|
|
1139
|
+
'outside-month': state.isOutsideMonth,
|
|
1140
|
+
today: state.isToday,
|
|
1141
|
+
selected: state.isSelected,
|
|
1142
|
+
'range-start': state.isRangeStart,
|
|
1143
|
+
'range-end': state.isRangeEnd,
|
|
1144
|
+
'in-range': state.isInRange,
|
|
1145
|
+
disabled,
|
|
1028
1146
|
};
|
|
1029
1147
|
}
|
|
1030
|
-
/**
|
|
1148
|
+
/**
|
|
1149
|
+
* Normaliza os limites do intervalo garantindo ordem cronológica (start <= end).
|
|
1150
|
+
* @param start - data de início
|
|
1151
|
+
* @param end - data de fim
|
|
1152
|
+
* @returns tupla [start, end] na ordem correta
|
|
1153
|
+
* @internal
|
|
1154
|
+
*/
|
|
1031
1155
|
normalizeRangeBounds(start, end) {
|
|
1032
1156
|
return compareAscExports.compareAsc(start, end) <= 0 ? [start, end] : [end, start];
|
|
1033
1157
|
}
|
|
1034
|
-
/**
|
|
1158
|
+
/**
|
|
1159
|
+
* Verifica se uma data está estritamente entre `start` e `end`.
|
|
1160
|
+
* @param date - data a verificar
|
|
1161
|
+
* @param start - início do intervalo
|
|
1162
|
+
* @param end - fim do intervalo
|
|
1163
|
+
* @returns `true` se `start < date < end`
|
|
1164
|
+
* @internal
|
|
1165
|
+
*/
|
|
1035
1166
|
isDateBetweenRange(date, start, end) {
|
|
1036
1167
|
return isAfterExports.isAfter(date, start) && isBeforeExports.isBefore(date, end);
|
|
1037
1168
|
}
|
|
1038
|
-
/**
|
|
1039
|
-
|
|
1169
|
+
/**
|
|
1170
|
+
* Calcula os limites da grade do mês, respeitando `fixedRowCount`, sem gerar suas datas.
|
|
1171
|
+
* @returns limites inclusivos da grade
|
|
1172
|
+
* @internal
|
|
1173
|
+
*/
|
|
1174
|
+
getMonthViewInterval() {
|
|
1040
1175
|
const start = index.startOfWeekExports.startOfWeek(startOfMonthExports.startOfMonth(this.baseDate), { weekStartsOn: this.weekStartsOn });
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
const normalizedDates = datetimePickerPropsValidation.eachDayOfIntervalExports.eachDayOfInterval({ start, end });
|
|
1046
|
-
const currentWeekCount = Math.ceil(normalizedDates.length / 7);
|
|
1047
|
-
const targetWeekCount = 6;
|
|
1048
|
-
// Se não houver 6 semanas, estende o final para alcançar 42 dias
|
|
1049
|
-
if (currentWeekCount < targetWeekCount) {
|
|
1050
|
-
const daysToAdd = (targetWeekCount - currentWeekCount) * 7;
|
|
1051
|
-
end = index.addDaysExports.addDays(end, daysToAdd);
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
return datetimePickerPropsValidation.eachDayOfIntervalExports.eachDayOfInterval({ start, end });
|
|
1176
|
+
const end = this.fixedRowCount
|
|
1177
|
+
? index.addDaysExports.addDays(start, 41)
|
|
1178
|
+
: endOfWeekExports.endOfWeek(endOfMonthExports.endOfMonth(this.baseDate), { weekStartsOn: this.weekStartsOn });
|
|
1179
|
+
return { start, end };
|
|
1055
1180
|
}
|
|
1056
1181
|
/**
|
|
1057
|
-
* Retorna o `focusedDate` normalizado para estar
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1061
|
-
*
|
|
1062
|
-
* @returns Data focada normalizada ou primeiro dia da grade.
|
|
1182
|
+
* Retorna o `focusedDate` normalizado para estar dentro da grade visível.
|
|
1183
|
+
* Se não estiver visível, retorna o primeiro dia da grade.
|
|
1184
|
+
* @param interval - limites da grade atual; calculados quando não fornecidos
|
|
1185
|
+
* @returns data normalizada para foco
|
|
1186
|
+
* @internal
|
|
1063
1187
|
*/
|
|
1064
|
-
getNormalizedFocusedDate() {
|
|
1065
|
-
const
|
|
1066
|
-
const
|
|
1067
|
-
if (
|
|
1188
|
+
getNormalizedFocusedDate(interval = this.getMonthViewInterval()) {
|
|
1189
|
+
const focusedDay = startOfDayExports.startOfDay(this.focusedDate).getTime();
|
|
1190
|
+
const isVisible = focusedDay >= interval.start.getTime() && focusedDay <= interval.end.getTime();
|
|
1191
|
+
if (isVisible) {
|
|
1068
1192
|
return this.focusedDate;
|
|
1069
1193
|
}
|
|
1070
|
-
return
|
|
1194
|
+
return interval.start;
|
|
1071
1195
|
}
|
|
1072
1196
|
/**
|
|
1073
|
-
* Constrói o rótulo acessível
|
|
1074
|
-
*
|
|
1075
|
-
* @
|
|
1076
|
-
* @
|
|
1197
|
+
* Constrói o rótulo acessível para os botões de navegação.
|
|
1198
|
+
* @param action - ação de navegação
|
|
1199
|
+
* @returns rótulo para `aria-label`
|
|
1200
|
+
* @internal
|
|
1077
1201
|
*/
|
|
1078
1202
|
getNavigationAriaLabel(action) {
|
|
1079
1203
|
switch (action) {
|
|
@@ -1085,78 +1209,126 @@ const DatePicker = class {
|
|
|
1085
1209
|
return 'Navegar';
|
|
1086
1210
|
}
|
|
1087
1211
|
}
|
|
1088
|
-
/**
|
|
1212
|
+
/**
|
|
1213
|
+
* Retorna os rótulos dos dias da semana conforme `locale` e `weekStartsOn`.
|
|
1214
|
+
* @internal
|
|
1215
|
+
*/
|
|
1089
1216
|
getWeekdayLabels() {
|
|
1090
1217
|
return index.getWeekdayLabels(this.locale, this.weekStartsOn);
|
|
1091
1218
|
}
|
|
1092
|
-
/**
|
|
1219
|
+
/**
|
|
1220
|
+
* Retorna os rótulos dos meses no locale atual.
|
|
1221
|
+
* @internal
|
|
1222
|
+
*/
|
|
1093
1223
|
getMonthLabels() {
|
|
1094
1224
|
return index.getMonthLabels(this.locale);
|
|
1095
1225
|
}
|
|
1096
1226
|
/**
|
|
1097
|
-
*
|
|
1098
|
-
*
|
|
1099
|
-
* @
|
|
1227
|
+
* Move o foco de teclado para a data informada e atualiza `referenceDate` se necessário.
|
|
1228
|
+
* @param date - data alvo do foco
|
|
1229
|
+
* @returns void
|
|
1230
|
+
* @internal
|
|
1231
|
+
*/
|
|
1232
|
+
moveFocusTo(date) {
|
|
1233
|
+
this.focusedDate = date;
|
|
1234
|
+
this.shouldFocusDate = true;
|
|
1235
|
+
if (!isSameMonthExports.isSameMonth(date, this.baseDate)) {
|
|
1236
|
+
this.emitDateStateChange(date, this.value);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Renderiza um botão de navegação consistente para o calendário.
|
|
1241
|
+
* @param action - ação do botão
|
|
1242
|
+
* @returns elemento JSX do botão de navegação
|
|
1243
|
+
* @internal
|
|
1100
1244
|
*/
|
|
1101
1245
|
renderNavigationButton(action) {
|
|
1102
|
-
return (index$1.h("br-button", { emphasis: "tertiary", density: "small", shape: "circle", disabled: this.disabled, "data-action": action, "aria-label": this.getNavigationAriaLabel(action), onClick: this.handleNavigationClick }, index$1.h("br-icon", { iconName: this.getIconForAction(action), width: "20", height: "20", "aria-hidden": "true" })));
|
|
1246
|
+
return (index$1.h("br-button", { type: "button", emphasis: "tertiary", density: "small", shape: "circle", disabled: this.disabled, "data-action": action, "aria-label": this.getNavigationAriaLabel(action), onClick: this.handleNavigationClick }, index$1.h("br-icon", { iconName: this.getIconForAction(action), width: "20", height: "20", "aria-hidden": "true" })));
|
|
1103
1247
|
}
|
|
1104
|
-
/**
|
|
1248
|
+
/**
|
|
1249
|
+
* Renderiza o cabeçalho do calendário (navegação, mês e ano).
|
|
1250
|
+
* @returns elemento JSX do cabeçalho
|
|
1251
|
+
* @internal
|
|
1252
|
+
*/
|
|
1105
1253
|
renderCalendarHeader() {
|
|
1106
1254
|
return (index$1.h("div", { class: "header", part: "header" }, this.renderNavigationButton(datetimePickerConstants.NAVIGATION_ACTION.PREVIOUS_MONTH), this.renderMonthSelection(), this.renderYearSelection(), this.renderNavigationButton(datetimePickerConstants.NAVIGATION_ACTION.NEXT_MONTH)));
|
|
1107
1255
|
}
|
|
1108
|
-
/**
|
|
1256
|
+
/**
|
|
1257
|
+
* Renderiza o seletor de mês com rótulo acessível.
|
|
1258
|
+
* @returns elemento JSX do seletor de mês
|
|
1259
|
+
* @internal
|
|
1260
|
+
*/
|
|
1109
1261
|
renderMonthSelection() {
|
|
1110
1262
|
return (index$1.h("label", { class: "month-selection" }, index$1.h("span", { class: "visually-hidden" }, "Selecionar m\u00EAs"), index$1.h("select", { onChange: this.handleMonthChange, "aria-label": "Selecionar m\u00EAs", disabled: this.disabled, part: "month-select" }, this.getMonthLabels().map(this.renderMonthOption, this))));
|
|
1111
1263
|
}
|
|
1112
|
-
/**
|
|
1264
|
+
/**
|
|
1265
|
+
* Renderiza o campo de ano com rótulo acessível.
|
|
1266
|
+
* @returns elemento JSX do campo de ano
|
|
1267
|
+
* @internal
|
|
1268
|
+
*/
|
|
1113
1269
|
renderYearSelection() {
|
|
1114
1270
|
return (index$1.h("label", { class: "year-selection" }, index$1.h("span", { class: "visually-hidden" }, "Selecionar ano"), index$1.h("input", { type: "number", value: this.referenceDate.getFullYear(), onChange: this.handleYearChange, "aria-label": "Selecionar ano", disabled: this.disabled, part: "year-input" })));
|
|
1115
1271
|
}
|
|
1116
|
-
/**
|
|
1272
|
+
/**
|
|
1273
|
+
* Renderiza uma opção do seletor de meses.
|
|
1274
|
+
* @param month - label do mês
|
|
1275
|
+
* @param index - índice do mês (0-11)
|
|
1276
|
+
* @returns elemento `<option>` para o mês
|
|
1277
|
+
* @internal
|
|
1278
|
+
*/
|
|
1117
1279
|
renderMonthOption(month, index) {
|
|
1118
1280
|
return (index$1.h("option", { key: `month-${index}`, value: index, selected: index === this.referenceDate.getMonth() }, month));
|
|
1119
1281
|
}
|
|
1120
|
-
/**
|
|
1282
|
+
/**
|
|
1283
|
+
* Renderiza a estrutura principal do calendário (grade e cabeçalho).
|
|
1284
|
+
* @returns elemento JSX com a grade do calendário
|
|
1285
|
+
* @internal
|
|
1286
|
+
*/
|
|
1121
1287
|
renderCalendar() {
|
|
1122
1288
|
const monthLabel = datetimePickerConstants.formatExports.format(this.baseDate, "MMMM 'de' yyyy", { locale: this.dateFnsLocale });
|
|
1123
|
-
return (index$1.h("div", { class: "calendar", role: "grid", "aria-label": `Calendário de ${monthLabel}`, part: "calendar" }, this.renderWeekdays(), this.renderMonthGrid()));
|
|
1289
|
+
return (index$1.h(index$1.Fragment, null, index$1.h("div", { class: "visually-hidden", "aria-live": "polite" }, monthLabel), index$1.h("div", { class: "calendar", role: "grid", "aria-label": `Calendário de ${monthLabel}`, part: "calendar" }, this.renderWeekdays(), this.renderMonthGrid())));
|
|
1124
1290
|
}
|
|
1125
|
-
/**
|
|
1291
|
+
/**
|
|
1292
|
+
* Renderiza os rótulos dos dias da semana.
|
|
1293
|
+
* @returns elemento JSX com os cabeçalhos das colunas dos dias
|
|
1294
|
+
* @internal
|
|
1295
|
+
*/
|
|
1126
1296
|
renderWeekdays() {
|
|
1127
1297
|
const labels = this.getWeekdayLabels();
|
|
1128
|
-
|
|
1298
|
+
const fullNames = index.getWeekdayFullNames(this.locale, this.weekStartsOn);
|
|
1299
|
+
return (index$1.h("div", { class: "weekdays", role: "row", tabIndex: -1, part: "weekdays" }, labels.map((label, index) => (index$1.h("div", { key: `weekday-${index}`, class: "weekday", role: "columnheader", tabIndex: -1, "aria-label": fullNames[index], part: "weekday" }, label)))));
|
|
1129
1300
|
}
|
|
1130
|
-
/**
|
|
1301
|
+
/**
|
|
1302
|
+
* Renderiza a grade de dias do mês atual.
|
|
1303
|
+
* @returns elemento JSX contendo semanas e dias
|
|
1304
|
+
* @internal
|
|
1305
|
+
*/
|
|
1131
1306
|
renderMonthGrid() {
|
|
1132
|
-
const
|
|
1307
|
+
const interval = this.getMonthViewInterval();
|
|
1308
|
+
const dates = isValid.eachDayOfIntervalExports.eachDayOfInterval(interval);
|
|
1309
|
+
const normalizedFocusedDate = this.getNormalizedFocusedDate(interval);
|
|
1310
|
+
const today = new Date();
|
|
1133
1311
|
const weeks = Array.from({ length: Math.ceil(dates.length / 7) }, (_, index) => dates.slice(index * 7, index * 7 + 7));
|
|
1134
|
-
return (index$1.h("div", { class: "monthdays", role: "rowgroup",
|
|
1312
|
+
return (index$1.h("div", { class: "monthdays", role: "rowgroup", part: "grid" }, weeks.map((week) => (index$1.h("div", { key: `week-${datetimePickerConstants.formatExports.format(week[0], DAY_KEY_FORMAT)}`, class: "week", role: "row", tabIndex: -1 }, week.map((date) => this.renderDayCell(date, normalizedFocusedDate, today)))))));
|
|
1135
1313
|
}
|
|
1136
1314
|
/**
|
|
1137
|
-
*
|
|
1138
|
-
*
|
|
1139
|
-
* @param
|
|
1315
|
+
* Renderiza uma célula de dia com estado visual apropriado.
|
|
1316
|
+
* @param date - data representada pela célula
|
|
1317
|
+
* @param normalizedFocusedDate - data de foco normalizada para a grade atual
|
|
1318
|
+
* @param today - instante atual compartilhado pela renderização da grade
|
|
1319
|
+
* @returns elemento JSX da célula de dia
|
|
1320
|
+
* @internal
|
|
1140
1321
|
*/
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
this.
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
/** Renderiza uma célula de dia com estado visual apropriado. */
|
|
1149
|
-
renderDayCell(date) {
|
|
1150
|
-
const disabled = this.disabled || this.isDateDisabled(date);
|
|
1151
|
-
const isSelected = this.effectiveSelectionMode === 'single' && this.value !== null && datetimePickerPropsValidation.isSameDayExports.isSameDay(date, this.value);
|
|
1152
|
-
const isRangeStart = this.effectiveSelectionMode === 'range' && this.rangeStart !== null && datetimePickerPropsValidation.isSameDayExports.isSameDay(date, this.rangeStart);
|
|
1153
|
-
const isRangeEnd = this.effectiveSelectionMode === 'range' && this.rangeEnd !== null && datetimePickerPropsValidation.isSameDayExports.isSameDay(date, this.rangeEnd);
|
|
1154
|
-
const isActiveDay = isSelected || isRangeStart || isRangeEnd;
|
|
1155
|
-
const isFocused = datetimePickerPropsValidation.isSameDayExports.isSameDay(date, this.getNormalizedFocusedDate());
|
|
1156
|
-
return (index$1.h("div", { key: datetimePickerConstants.formatExports.format(date, 'yyyy-MM-dd'), role: "gridcell", tabIndex: this.disabled ? undefined : isFocused ? 0 : -1, "data-date": datetimePickerConstants.formatExports.format(date, 'yyyy-MM-dd'), class: { ...this.getDayCssClasses(date), disabled }, onClick: disabled ? undefined : this.getDayClickHandler(date), onKeyDown: disabled ? undefined : this.handleGridKeydown, "aria-label": this.getDayCellAriaLabel(date), "aria-selected": isActiveDay ? 'true' : 'false', "aria-disabled": disabled ? 'true' : null, part: "day" }, this.getDayWithLeadingZero(date)));
|
|
1322
|
+
renderDayCell(date, normalizedFocusedDate, today) {
|
|
1323
|
+
const dateKey = datetimePickerConstants.formatExports.format(date, DAY_KEY_FORMAT);
|
|
1324
|
+
const disabled = this.disabled || this.disabledDateKeys.has(dateKey);
|
|
1325
|
+
const state = this.getDayCellState(date, today);
|
|
1326
|
+
const isActiveDay = state.isSelected || state.isRangeStart || state.isRangeEnd;
|
|
1327
|
+
const isFocused = isValid.isSameDayExports.isSameDay(date, normalizedFocusedDate);
|
|
1328
|
+
return (index$1.h("div", { key: dateKey, role: "gridcell", tabIndex: this.disabled ? undefined : isFocused ? 0 : -1, "data-date": dateKey, class: this.getDayCssClasses(state, disabled), onClick: disabled ? undefined : this.handleDayCellClick, onKeyDown: this.handleGridKeydown, "aria-label": this.getDayCellAriaLabel(date, state), "aria-selected": isActiveDay ? 'true' : 'false', "aria-current": state.isToday ? 'date' : null, "aria-disabled": disabled ? 'true' : null, part: "day" }, this.getDayWithLeadingZero(date)));
|
|
1157
1329
|
}
|
|
1158
1330
|
render() {
|
|
1159
|
-
return (index$1.h(index$1.Host, { key: '
|
|
1331
|
+
return (index$1.h(index$1.Host, { key: 'd909c9c84061f6b456a0350e2ab3fe6e50cc5d83' }, index$1.h("div", { key: 'aba7fc5f0b7bce2a9aa2d95bae9897f138dd8146', class: "br-date-picker", part: "container" }, this.renderCalendarHeader(), this.renderCalendar())));
|
|
1160
1332
|
}
|
|
1161
1333
|
get el() { return index$1.getElement(this); }
|
|
1162
1334
|
static get watchers() { return {
|
|
@@ -1166,17 +1338,11 @@ const DatePicker = class {
|
|
|
1166
1338
|
"value": [{
|
|
1167
1339
|
"handleValueChange": 0
|
|
1168
1340
|
}],
|
|
1169
|
-
"referenceDate": [{
|
|
1170
|
-
"handleReferenceDateChange": 0
|
|
1171
|
-
}],
|
|
1172
1341
|
"weekStartsOn": [{
|
|
1173
1342
|
"handleWeekStartsOnChange": 0
|
|
1174
1343
|
}],
|
|
1175
1344
|
"locale": [{
|
|
1176
1345
|
"handleLocaleChange": 0
|
|
1177
|
-
}],
|
|
1178
|
-
"disabledDates": [{
|
|
1179
|
-
"handleDisabledDatesChange": 0
|
|
1180
1346
|
}]
|
|
1181
1347
|
}; }
|
|
1182
1348
|
};
|
|
@@ -1262,6 +1428,62 @@ function requireGetMinutes () {
|
|
|
1262
1428
|
|
|
1263
1429
|
var getMinutesExports = /*@__PURE__*/ requireGetMinutes();
|
|
1264
1430
|
|
|
1431
|
+
/**
|
|
1432
|
+
* Configurações de formato e mensagens usadas por `br-datetime-input`.
|
|
1433
|
+
*
|
|
1434
|
+
* Cada chave representa um modo suportado (`date`, `time`, `datetime`) e
|
|
1435
|
+
* mapeia para um `InputFormatConfig` que descreve máscara de entrada,
|
|
1436
|
+
* contagens de dígitos aceitas, formatos de exibição/parse e mensagens de
|
|
1437
|
+
* validação específicas do modo.
|
|
1438
|
+
*
|
|
1439
|
+
* Mantemos a configuração centralizada para evitar lógica dispersa pelo
|
|
1440
|
+
* componente e permitir alterações de formato em um único local.
|
|
1441
|
+
*/
|
|
1442
|
+
const INPUT_FORMAT_CONFIG = {
|
|
1443
|
+
date: {
|
|
1444
|
+
mask: '##/##/####',
|
|
1445
|
+
acceptedDigitCounts: [8],
|
|
1446
|
+
fullDigitCount: 8,
|
|
1447
|
+
displayFormat: 'dd/MM/yyyy',
|
|
1448
|
+
parseFormats: ['dd/MM/yyyy'],
|
|
1449
|
+
messages: {
|
|
1450
|
+
incomplete: 'Complete a data no formato DD/MM/AAAA.',
|
|
1451
|
+
invalid: 'Informe uma data válida.',
|
|
1452
|
+
incompleteRange: 'Complete o intervalo no formato DD/MM/AAAA - DD/MM/AAAA.',
|
|
1453
|
+
invalidRange: 'Informe um intervalo de datas válido.',
|
|
1454
|
+
},
|
|
1455
|
+
rangeFormat: 'DD/MM/AAAA - DD/MM/AAAA',
|
|
1456
|
+
},
|
|
1457
|
+
time: {
|
|
1458
|
+
mask: '##:##',
|
|
1459
|
+
acceptedDigitCounts: [4],
|
|
1460
|
+
fullDigitCount: 4,
|
|
1461
|
+
displayFormat: 'HH:mm',
|
|
1462
|
+
parseFormats: ['HH:mm'],
|
|
1463
|
+
messages: {
|
|
1464
|
+
incomplete: 'Complete o horário no formato HH:MM.',
|
|
1465
|
+
invalid: 'Informe um horário válido.',
|
|
1466
|
+
incompleteRange: 'Complete o intervalo no formato HH:MM - HH:MM.',
|
|
1467
|
+
invalidRange: 'Informe um intervalo de horários válido.',
|
|
1468
|
+
},
|
|
1469
|
+
rangeFormat: 'HH:MM - HH:MM',
|
|
1470
|
+
},
|
|
1471
|
+
datetime: {
|
|
1472
|
+
mask: '##/##/#### ##:##',
|
|
1473
|
+
acceptedDigitCounts: [8, 12],
|
|
1474
|
+
fullDigitCount: 12,
|
|
1475
|
+
displayFormat: 'dd/MM/yyyy HH:mm',
|
|
1476
|
+
parseFormats: ['dd/MM/yyyy HH:mm', 'dd/MM/yyyy'],
|
|
1477
|
+
messages: {
|
|
1478
|
+
incomplete: 'Complete a data e hora no formato DD/MM/AAAA HH:MM.',
|
|
1479
|
+
invalid: 'Informe uma data e hora válidas.',
|
|
1480
|
+
incompleteRange: 'Complete o intervalo no formato DD/MM/AAAA HH:MM - DD/MM/AAAA HH:MM.',
|
|
1481
|
+
invalidRange: 'Informe um intervalo de data e hora válido.',
|
|
1482
|
+
},
|
|
1483
|
+
rangeFormat: 'DD/MM/AAAA HH:MM - DD/MM/AAAA HH:MM',
|
|
1484
|
+
},
|
|
1485
|
+
};
|
|
1486
|
+
|
|
1265
1487
|
var formatISO = {};
|
|
1266
1488
|
|
|
1267
1489
|
var hasRequiredFormatISO;
|
|
@@ -1380,19 +1602,20 @@ function requireFormatISO () {
|
|
|
1380
1602
|
var formatISOExports = /*@__PURE__*/ requireFormatISO();
|
|
1381
1603
|
|
|
1382
1604
|
/**
|
|
1383
|
-
*
|
|
1605
|
+
* Verifica se `value` é um modo suportado pelo `br-datetime-input`.
|
|
1384
1606
|
*
|
|
1385
|
-
* @param value - Valor recebido via prop/atributo.
|
|
1386
|
-
* @returns `true` quando
|
|
1607
|
+
* @param {string} value - Valor recebido via prop/atributo.
|
|
1608
|
+
* @returns {value is DatetimePickerMode} `true` quando pertence ao conjunto suportado.
|
|
1387
1609
|
*/
|
|
1388
1610
|
function isValidDatetimeInputMode(value) {
|
|
1389
1611
|
return Object.values(datetimePickerConstants.DATETIME_PICKER_MODE).includes(value);
|
|
1390
1612
|
}
|
|
1391
1613
|
/**
|
|
1392
|
-
* Normaliza o modo do
|
|
1614
|
+
* Normaliza o modo do componente, aplicando o valor padrão quando inválido.
|
|
1615
|
+
* Emite um aviso via `warnInvalidPropValue` quando o valor é inválido.
|
|
1393
1616
|
*
|
|
1394
|
-
* @param value - Valor bruto
|
|
1395
|
-
* @returns Modo válido
|
|
1617
|
+
* @param {string} value - Valor bruto recebido via prop.
|
|
1618
|
+
* @returns {DatetimePickerMode} - Modo válido (ou `DATETIME_PICKER_MODE.DEFAULT`).
|
|
1396
1619
|
*/
|
|
1397
1620
|
function normalizeDatetimeInputMode(value) {
|
|
1398
1621
|
if (isValidDatetimeInputMode(value))
|
|
@@ -1401,32 +1624,35 @@ function normalizeDatetimeInputMode(value) {
|
|
|
1401
1624
|
return datetimePickerConstants.DATETIME_PICKER_MODE.DEFAULT;
|
|
1402
1625
|
}
|
|
1403
1626
|
/**
|
|
1404
|
-
*
|
|
1627
|
+
* Retorna `true` quando `value` é uma instância válida de `Date`.
|
|
1405
1628
|
*
|
|
1406
|
-
* @param value - Valor
|
|
1407
|
-
* @returns `true`
|
|
1629
|
+
* @param {unknown} value - Valor a ser verificado.
|
|
1630
|
+
* @returns {value is Date} - `true` para instâncias de Date válidas.
|
|
1408
1631
|
*/
|
|
1409
1632
|
function isValidDateInstance(value) {
|
|
1410
1633
|
return value instanceof Date && !Number.isNaN(value.getTime());
|
|
1411
1634
|
}
|
|
1412
1635
|
/**
|
|
1413
|
-
* Normaliza a
|
|
1636
|
+
* Normaliza a `referenceDate` garantindo uma `Date` válida.
|
|
1637
|
+
* Quando `value` for inválido, retorna um fallback (data atual) e emite
|
|
1638
|
+
* um warning com o valor sugerido em ISO.
|
|
1414
1639
|
*
|
|
1415
|
-
* @param value - Valor recebido via prop.
|
|
1416
|
-
* @returns Date
|
|
1640
|
+
* @param {unknown} value - Valor recebido via prop.
|
|
1641
|
+
* @returns {Date} - Data válida para uso interno.
|
|
1417
1642
|
*/
|
|
1418
1643
|
function normalizeDatetimeInputReferenceDate(value) {
|
|
1419
1644
|
if (isValidDateInstance(value))
|
|
1420
1645
|
return value;
|
|
1421
|
-
const fallback =
|
|
1646
|
+
const fallback = isValid.toDateExports.toDate(new Date());
|
|
1422
1647
|
propWarning.warnInvalidPropValue('br-datetime-input', 'referenceDate', value, formatISOExports.formatISO(fallback));
|
|
1423
1648
|
return fallback;
|
|
1424
1649
|
}
|
|
1425
1650
|
/**
|
|
1426
|
-
* Normaliza o
|
|
1651
|
+
* Normaliza o `value` da prop para `Date` válido ou `null`.
|
|
1652
|
+
* Emite warning quando o valor é inválido e retorna `null`.
|
|
1427
1653
|
*
|
|
1428
|
-
* @param value - Valor recebido via prop.
|
|
1429
|
-
* @returns Date
|
|
1654
|
+
* @param {unknown} value - Valor recebido via prop.
|
|
1655
|
+
* @returns {Date | null} - Data válida ou `null`.
|
|
1430
1656
|
*/
|
|
1431
1657
|
function normalizeDatetimeInputValue(value) {
|
|
1432
1658
|
if (value === null)
|
|
@@ -1437,112 +1663,135 @@ function normalizeDatetimeInputValue(value) {
|
|
|
1437
1663
|
return null;
|
|
1438
1664
|
}
|
|
1439
1665
|
|
|
1440
|
-
const datetimeInputCss = () => `*,*::before,*::after{box-sizing:border-box}:host{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}main{display:block}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:rgba(0,0,0,0)}b,strong{font-weight:bolder}code{font-family:monospace;font-size:1em}small{font-size:80%}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.d-none{display:none !important}@media (min-width: 576px){.d-sm-block{display:block !important}.d-sm-flex{display:flex !important}}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown>.br-notification{left:auto;right:0}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.justify-content-start{justify-content:flex-start !important}.justify-content-end{justify-content:flex-end !important}.justify-content-center{justify-content:center !important}.align-items-center{align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter)*.5);padding-right:calc(var(--grid-gutter)*.5);width:100%}.col{flex:1 0 0%;min-width:8.3333333333%}.col-auto{flex:0 0 auto;width:auto}.col-2{flex-basis:16.6666666667%;max-width:16.6666666667%}.container,.container-fluid,.container-lg{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:flex;flex-wrap:wrap;margin-left:calc(var(--grid-gutter)*-0.5);margin-right:calc(var(--grid-gutter)*-0.5)}@media (min-width: 576px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}.col-sm-4{flex-basis:33.3333333333%;max-width:33.3333333333%}}@media (min-width: 992px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}.col-lg-3{flex-basis:25%;max-width:25%}}@media (min-width: 1600px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.ease{animation-timing-function:cubic-bezier(0.25, 0.1, 0.25, 1)}.ease-out{animation-timing-function:cubic-bezier(0, 0, 0.58, 1)}.ease-in-out{animation-timing-function:cubic-bezier(0.42, 0, 0.58, 1)}.fast{animation-duration:var(--duration-fast)}.slow{animation-duration:var(--duration-slow)}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mb-1{margin-bottom:var(--spacing-scale-half) !important}.ml-1{margin-left:var(--spacing-scale-half) !important}.mx-3{margin-left:var(--spacing-scale-2x) !important;margin-right:var(--spacing-scale-2x) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.ml-auto{margin-left:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}@media (min-width: 576px){.ml-sm-0{margin-left:var(--spacing-scale-default) !important}}.highlight{background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}fieldset[disabled]{opacity:1}.text-center{text-align:center !important}.text-right{text-align:right !important}.text-nowrap{white-space:nowrap !important}.text-uppercase{text-transform:uppercase !important}.text-bold{font-weight:700 !important}.text-base{font-size:var(--font-size-scale-base) !important}.text-down-01{font-size:var(--font-size-scale-down-01) !important}@media (min-width: 576px){.text-sm-center{text-align:center !important}.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half)}a:focus{outline:none}a.focus-visible,a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}a{color:var(--interactive);text-decoration:none}.main-content a{text-decoration:underline}button{cursor:pointer}img{max-width:100%;vertical-align:middle}h2,.h2{color:var(--color);font-size:var(--font-size-scale-up-03);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2xh);margin-top:var(--spacing-scale-3xh);padding-bottom:var(--spacing-scale-2xh)}@media (min-width: 576px){.h2,h2{font-size:var(--font-size-scale-up-05);font-weight:var(--font-weight-regular)}}ul,ol{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}table{--table-background:var(--background);--table-color:var(--color);--table-border-color:var(--gray-20);--table-border-style:solid;--table-border-width:1px;--table-hover:var(--color-rgb);--table-padding:var(--spacing-scale-3x);--table-font-weight:var(--font-weight-medium);--table-th-background:var(--background-alternative);--table-th-font-weight:var(--font-weight-semi-bold);--table-row-size:var(--spacing-scale-2x);border-collapse:collapse;width:100%}tr.selected,tr.is-selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}fieldset,.fieldset{border:var(--surface-width-none);margin-bottom:var(--spacing-scale-5x);margin-top:0;padding:0}legend,.legend{color:var(--color);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2x);margin-top:var(--spacing-scale-2x)}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}code,.code{background:var(--gray-5);border-radius:4px;color:var(--gray-80);display:inline-block;font-family:monospace;font-size:var(--font-size-scale-base);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);padding:var(--spacing-scale-half)}pre,.pre{background:var(--gray-5);margin:var(--spacing-scale-2x) 0 var(--spacing-scale-4x);padding:var(--spacing-scale-2x)}pre code,.pre code{display:inline;padding:0}*[data-toggle=collapse]:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}*[data-toggle=collapse]:focus{outline:none}*[data-toggle=collapse].focus-visible,*[data-toggle=collapse]:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}@media (prefers-reduced-motion: reduce){:host,:host::before,:host::after,:host *,:host *::before,:host *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}}:host-context([data-wbc-reduced-motion=true])::before,:host-context([data-wbc-reduced-motion=true])::after,:host-context([data-wbc-reduced-motion=true]) *,:host-context([data-wbc-reduced-motion=true]) *::before,:host-context([data-wbc-reduced-motion=true]) *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}:host{display:block;width:100%}br-input[disabled]{opacity:1}`;
|
|
1666
|
+
const datetimeInputCss = () => `*,*::before,*::after{box-sizing:border-box}:host{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}main{display:block}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:rgba(0,0,0,0)}b,strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.d-none{display:none !important}@media (min-width: 576px){.d-sm-block{display:block !important}.d-sm-flex{display:flex !important}}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown>.br-notification{left:auto;right:0}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.justify-content-start{justify-content:flex-start !important}.justify-content-end{justify-content:flex-end !important}.justify-content-center{justify-content:center !important}.align-items-center{align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter)*.5);padding-right:calc(var(--grid-gutter)*.5);width:100%}.col{flex:1 0 0%;min-width:8.3333333333%}.col-auto{flex:0 0 auto;width:auto}.col-2{flex-basis:16.6666666667%;max-width:16.6666666667%}.container,.container-fluid,.container-lg{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:flex;flex-wrap:wrap;margin-left:calc(var(--grid-gutter)*-0.5);margin-right:calc(var(--grid-gutter)*-0.5)}@media (min-width: 576px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}.col-sm-4{flex-basis:33.3333333333%;max-width:33.3333333333%}}@media (min-width: 992px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}.col-lg-3{flex-basis:25%;max-width:25%}}@media (min-width: 1600px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.ease{animation-timing-function:cubic-bezier(0.25, 0.1, 0.25, 1)}.ease-out{animation-timing-function:cubic-bezier(0, 0, 0.58, 1)}.ease-in-out{animation-timing-function:cubic-bezier(0.42, 0, 0.58, 1)}.fast{animation-duration:var(--duration-fast)}.slow{animation-duration:var(--duration-slow)}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mb-1{margin-bottom:var(--spacing-scale-half) !important}.ml-1{margin-left:var(--spacing-scale-half) !important}.mx-3{margin-left:var(--spacing-scale-2x) !important;margin-right:var(--spacing-scale-2x) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.ml-auto{margin-left:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}@media (min-width: 576px){.ml-sm-0{margin-left:var(--spacing-scale-default) !important}}.highlight{background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}fieldset[disabled]{opacity:1}.text-center{text-align:center !important}.text-right{text-align:right !important}.text-nowrap{white-space:nowrap !important}.text-uppercase{text-transform:uppercase !important}.text-bold{font-weight:700 !important}.text-base{font-size:var(--font-size-scale-base) !important}.text-down-01{font-size:var(--font-size-scale-down-01) !important}@media (min-width: 576px){.text-sm-center{text-align:center !important}.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half)}a:focus{outline:none}a.focus-visible,a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}a{color:var(--interactive);text-decoration:none}.main-content a{text-decoration:underline}button{cursor:pointer}img{max-width:100%;vertical-align:middle}h2,.h2{color:var(--color);font-size:var(--font-size-scale-up-03);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2xh);margin-top:var(--spacing-scale-3xh);padding-bottom:var(--spacing-scale-2xh)}@media (min-width: 576px){.h2,h2{font-size:var(--font-size-scale-up-05);font-weight:var(--font-weight-regular)}}ul,ol{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}table{--table-background:var(--background);--table-color:var(--color);--table-border-color:var(--gray-20);--table-border-style:solid;--table-border-width:1px;--table-hover:var(--color-rgb);--table-padding:var(--spacing-scale-3x);--table-font-weight:var(--font-weight-medium);--table-th-background:var(--background-alternative);--table-th-font-weight:var(--font-weight-semi-bold);--table-row-size:var(--spacing-scale-2x);border-collapse:collapse;width:100%}tr.selected,tr.is-selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}fieldset,.fieldset{border:var(--surface-width-none);margin-bottom:var(--spacing-scale-5x);margin-top:0;padding:0}legend,.legend{color:var(--color);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2x);margin-top:var(--spacing-scale-2x)}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}pre,.pre{background:var(--gray-5);margin:var(--spacing-scale-2x) 0 var(--spacing-scale-4x);padding:var(--spacing-scale-2x)}*[data-toggle=collapse]:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}*[data-toggle=collapse]:focus{outline:none}*[data-toggle=collapse].focus-visible,*[data-toggle=collapse]:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}@media (prefers-reduced-motion: reduce){:host,:host::before,:host::after,:host *,:host *::before,:host *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}}:host-context([data-wbc-reduced-motion=true])::before,:host-context([data-wbc-reduced-motion=true])::after,:host-context([data-wbc-reduced-motion=true]) *,:host-context([data-wbc-reduced-motion=true]) *::before,:host-context([data-wbc-reduced-motion=true]) *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}:host{display:block;width:100%}br-input[disabled]{opacity:1}`;
|
|
1441
1667
|
|
|
1442
1668
|
const DatetimeInput = class {
|
|
1443
1669
|
constructor(hostRef) {
|
|
1444
1670
|
index$1.registerInstance(this, hostRef);
|
|
1445
1671
|
this.dateStateChange = index$1.createEvent(this, "dateStateChange", 7);
|
|
1446
1672
|
this.togglePicker = index$1.createEvent(this, "togglePicker", 7);
|
|
1447
|
-
|
|
1448
|
-
this.inputValue = '';
|
|
1673
|
+
this.inputValidationChange = index$1.createEvent(this, "inputValidationChange", 7);
|
|
1449
1674
|
/**
|
|
1450
|
-
*
|
|
1675
|
+
* Texto de placeholder exibido quando o campo estiver vazio.
|
|
1451
1676
|
*
|
|
1452
1677
|
* @default ''
|
|
1453
1678
|
*/
|
|
1454
1679
|
this.placeholder = '';
|
|
1455
1680
|
/**
|
|
1456
|
-
*
|
|
1681
|
+
* Modo de entrada que controla máscara, parser e formato exibido.
|
|
1457
1682
|
*
|
|
1458
1683
|
* @default 'datetime'
|
|
1459
1684
|
*/
|
|
1460
1685
|
this.mode = 'datetime';
|
|
1461
1686
|
/**
|
|
1462
|
-
* Data de referência
|
|
1463
|
-
* Recebe uma instância de `Date` por property binding.
|
|
1687
|
+
* Data de referência usada para navegação e preenchimento de valores parciais.
|
|
1464
1688
|
*
|
|
1465
1689
|
* @default new Date()
|
|
1466
|
-
* @example
|
|
1467
|
-
* ```js
|
|
1468
|
-
* const input = document.querySelector('br-datetime-input');
|
|
1469
|
-
* input.referenceDate = new Date(2026, 8, 1);
|
|
1470
|
-
* ```
|
|
1471
1690
|
*/
|
|
1472
1691
|
this.referenceDate = new Date();
|
|
1473
1692
|
/**
|
|
1474
|
-
*
|
|
1475
|
-
* de `referenceDate`, que controla apenas a referência visual.
|
|
1476
|
-
* Recebe uma instância de `Date` por property binding.
|
|
1693
|
+
* Valor atualmente selecionado pelo componente.
|
|
1477
1694
|
*
|
|
1478
1695
|
* @default null
|
|
1479
|
-
* @example
|
|
1480
|
-
* ```js
|
|
1481
|
-
* const input = document.querySelector('br-datetime-input');
|
|
1482
|
-
* input.value = new Date(2026, 8, 7, 14, 30);
|
|
1483
|
-
* ```
|
|
1484
1696
|
*/
|
|
1485
1697
|
this.value = null;
|
|
1486
1698
|
/**
|
|
1487
|
-
*
|
|
1699
|
+
* Controla os estados de read-only ou bloqueio de formulário.
|
|
1488
1700
|
*
|
|
1489
1701
|
* @default false
|
|
1490
1702
|
*/
|
|
1491
1703
|
this.disabled = false;
|
|
1492
1704
|
/**
|
|
1493
|
-
* Define
|
|
1494
|
-
* Aceita `single` ou `range`; valores inválidos usam `single`.
|
|
1705
|
+
* Define o modo de seleção: `single` (valor único) ou `range` (intervalo).
|
|
1495
1706
|
*
|
|
1496
1707
|
* @default 'single'
|
|
1497
1708
|
*/
|
|
1498
1709
|
this.selectionMode = 'single';
|
|
1499
1710
|
/**
|
|
1500
|
-
*
|
|
1711
|
+
* Início do intervalo em `selectionMode === 'range'`.
|
|
1501
1712
|
*
|
|
1502
1713
|
* @default null
|
|
1503
1714
|
*/
|
|
1504
1715
|
this.rangeStart = null;
|
|
1505
1716
|
/**
|
|
1506
|
-
*
|
|
1717
|
+
* Fim do intervalo em `selectionMode === 'range'`.
|
|
1507
1718
|
*
|
|
1508
1719
|
* @default null
|
|
1509
1720
|
*/
|
|
1510
1721
|
this.rangeEnd = null;
|
|
1722
|
+
/**
|
|
1723
|
+
* Marcador do último texto confirmado (commit) exibido no input.
|
|
1724
|
+
*
|
|
1725
|
+
* @internal
|
|
1726
|
+
* @type {string | null}
|
|
1727
|
+
* @default null
|
|
1728
|
+
*/
|
|
1729
|
+
this.lastCommittedInputText = null;
|
|
1730
|
+
/**
|
|
1731
|
+
* Texto atual do campo usado durante a edição manual.
|
|
1732
|
+
*
|
|
1733
|
+
* @internal Mantido localmente; não faz parte do contrato público do componente.
|
|
1734
|
+
* @type {string}
|
|
1735
|
+
* @default ''
|
|
1736
|
+
*/
|
|
1737
|
+
this.inputValue = '';
|
|
1738
|
+
/**
|
|
1739
|
+
* Handler do clique no botão de ação interno.
|
|
1740
|
+
*
|
|
1741
|
+
* @param event - Ativação pública da ação do br-input.
|
|
1742
|
+
* @returns {void}
|
|
1743
|
+
*/
|
|
1511
1744
|
this.handleActionButtonClick = (event) => {
|
|
1512
1745
|
if (this.disabled)
|
|
1513
1746
|
return;
|
|
1514
1747
|
event.stopPropagation();
|
|
1748
|
+
event.detail.originalEvent.stopPropagation();
|
|
1515
1749
|
this.togglePicker.emit();
|
|
1516
1750
|
};
|
|
1517
1751
|
/**
|
|
1518
|
-
*
|
|
1519
|
-
*
|
|
1752
|
+
* Blur handler: consome o evento e confirma o conteúdo atual.
|
|
1753
|
+
*
|
|
1754
|
+
* @param {FocusEvent} event - Evento de blur do input.
|
|
1755
|
+
* @returns {void}
|
|
1520
1756
|
*/
|
|
1521
1757
|
this.handleInputBlur = (event) => {
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1758
|
+
event.stopPropagation();
|
|
1759
|
+
this.commitCurrentInput();
|
|
1760
|
+
};
|
|
1761
|
+
/**
|
|
1762
|
+
* Handler para commit disparado pelo `change` do `br-input`.
|
|
1763
|
+
*
|
|
1764
|
+
* @param {Event} event - Evento de change.
|
|
1765
|
+
* @returns {void}
|
|
1766
|
+
*/
|
|
1767
|
+
this.handleInputCommit = (event) => {
|
|
1768
|
+
event.stopPropagation();
|
|
1769
|
+
this.commitCurrentInput();
|
|
1529
1770
|
};
|
|
1530
1771
|
/**
|
|
1531
1772
|
* Atualiza o estado local com o valor digitado no campo.
|
|
1532
1773
|
*
|
|
1533
|
-
* @param event - Evento de input
|
|
1774
|
+
* @param {Event} event - Evento de input redistribuído pelo `br-input`.
|
|
1775
|
+
* @returns {void}
|
|
1534
1776
|
*/
|
|
1535
1777
|
this.handleInputChange = (event) => {
|
|
1778
|
+
event.stopPropagation();
|
|
1536
1779
|
if (this.disabled) {
|
|
1537
1780
|
return;
|
|
1538
1781
|
}
|
|
1539
1782
|
const input = event.target;
|
|
1540
|
-
this.
|
|
1783
|
+
this.lastCommittedInputText = null;
|
|
1784
|
+
this.emitInputValidation(null);
|
|
1785
|
+
this.setInternalInputValue(input.value ?? '');
|
|
1541
1786
|
};
|
|
1542
1787
|
/**
|
|
1543
|
-
*
|
|
1788
|
+
* Handler de teclado no campo de entrada.
|
|
1789
|
+
*
|
|
1790
|
+
* Suporta atalhos ARIA (Alt+ArrowDown / F4) para abrir/fechar o picker
|
|
1791
|
+
* e Enter para confirmar a edição.
|
|
1544
1792
|
*
|
|
1545
|
-
* @param event - Evento de teclado
|
|
1793
|
+
* @param {KeyboardEvent} event - Evento de teclado.
|
|
1794
|
+
* @returns {void}
|
|
1546
1795
|
*/
|
|
1547
1796
|
this.handleInputKeydown = (event) => {
|
|
1548
1797
|
if (this.disabled) {
|
|
@@ -1554,37 +1803,23 @@ const DatetimeInput = class {
|
|
|
1554
1803
|
this.togglePicker.emit();
|
|
1555
1804
|
return;
|
|
1556
1805
|
}
|
|
1557
|
-
if (event.key === 'Enter') {
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
* Evita propagação do clique e solicita a abertura/fechamento do picker.
|
|
1563
|
-
*
|
|
1564
|
-
* @param event - Evento de clique no ícone de ação.
|
|
1565
|
-
*/
|
|
1566
|
-
this.handleToggleDropdown = (event) => {
|
|
1567
|
-
if (this.disabled) {
|
|
1568
|
-
return;
|
|
1806
|
+
if (event.key === 'Enter' && event.composedPath().some((target) => target instanceof HTMLInputElement)) {
|
|
1807
|
+
// Previne submissão de formulários e garante deduplicação
|
|
1808
|
+
// usando a mesma rotina que blur/change usam.
|
|
1809
|
+
event.preventDefault();
|
|
1810
|
+
this.commitCurrentInput();
|
|
1569
1811
|
}
|
|
1570
|
-
event.stopPropagation();
|
|
1571
|
-
this.togglePicker.emit();
|
|
1572
1812
|
};
|
|
1573
1813
|
}
|
|
1574
|
-
/**
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
}
|
|
1814
|
+
/**
|
|
1815
|
+
* Watcher: sincroniza `rangeStart`/`rangeEnd` a partir de `rangeValue` controlado.
|
|
1816
|
+
*
|
|
1817
|
+
* @param {DatetimePickerDateRange | undefined} newValue - Novo intervalo ou `undefined`.
|
|
1818
|
+
* @returns {void}
|
|
1819
|
+
*/
|
|
1581
1820
|
handleRangeValueChange(newValue) {
|
|
1582
1821
|
if (!newValue)
|
|
1583
1822
|
return;
|
|
1584
|
-
if (!datetimePickerPropsValidation.isValidDatetimePickerDateRange(newValue)) {
|
|
1585
|
-
propWarning.reportInvalidPropValue(this.el, 'rangeValue', newValue, 'Informe um objeto com `start` e `end` como Date válido ou null.', 'Ignorando o intervalo inválido e mantendo o último intervalo efetivo.');
|
|
1586
|
-
return;
|
|
1587
|
-
}
|
|
1588
1823
|
this.rangeStart = newValue.start;
|
|
1589
1824
|
this.rangeEnd = newValue.end;
|
|
1590
1825
|
this.syncInputValueFromProps();
|
|
@@ -1594,6 +1829,13 @@ const DatetimeInput = class {
|
|
|
1594
1829
|
*
|
|
1595
1830
|
* @param newValue - Novo valor recebido via prop.
|
|
1596
1831
|
*/
|
|
1832
|
+
/**
|
|
1833
|
+
* Watcher: reage a mudanças externas em `value`, normalizando e sincronizando
|
|
1834
|
+
* o texto exibido no input.
|
|
1835
|
+
*
|
|
1836
|
+
* @param {Date | null} newValue - Novo valor recebido via prop.
|
|
1837
|
+
* @returns {void}
|
|
1838
|
+
*/
|
|
1597
1839
|
handleValueChange(newValue) {
|
|
1598
1840
|
this.ensureValidValue(newValue);
|
|
1599
1841
|
this.syncInputValueFromProps();
|
|
@@ -1603,6 +1845,12 @@ const DatetimeInput = class {
|
|
|
1603
1845
|
*
|
|
1604
1846
|
* @param newValue - Novo modo recebido via prop.
|
|
1605
1847
|
*/
|
|
1848
|
+
/**
|
|
1849
|
+
* Watcher: aplica normalização do `mode` e atualiza a máscara/valor exibido.
|
|
1850
|
+
*
|
|
1851
|
+
* @param {string} newValue - Novo modo recebido via prop.
|
|
1852
|
+
* @returns {void}
|
|
1853
|
+
*/
|
|
1606
1854
|
handleModeChange(newValue) {
|
|
1607
1855
|
this.ensureValidMode(newValue);
|
|
1608
1856
|
this.syncInputValueFromProps();
|
|
@@ -1612,6 +1860,12 @@ const DatetimeInput = class {
|
|
|
1612
1860
|
*
|
|
1613
1861
|
* @param newValue - Nova data de referência recebida.
|
|
1614
1862
|
*/
|
|
1863
|
+
/**
|
|
1864
|
+
* Watcher: valida `referenceDate` e resina o input quando não há seleção.
|
|
1865
|
+
*
|
|
1866
|
+
* @param {Date} newValue - Nova data de referência recebida.
|
|
1867
|
+
* @returns {void}
|
|
1868
|
+
*/
|
|
1615
1869
|
handleReferenceDateChange(newValue) {
|
|
1616
1870
|
this.ensureValidReferenceDate(newValue);
|
|
1617
1871
|
if (this.value === null) {
|
|
@@ -1623,8 +1877,13 @@ const DatetimeInput = class {
|
|
|
1623
1877
|
*
|
|
1624
1878
|
* @param newValue - Nova data inicial do range.
|
|
1625
1879
|
*/
|
|
1880
|
+
/**
|
|
1881
|
+
* Watcher: atualiza a representação textual quando o início do range muda.
|
|
1882
|
+
*
|
|
1883
|
+
* @returns {void}
|
|
1884
|
+
*/
|
|
1626
1885
|
handleRangeStartChange() {
|
|
1627
|
-
if (this.
|
|
1886
|
+
if (this.selectionMode === 'range') {
|
|
1628
1887
|
this.syncInputValueFromProps();
|
|
1629
1888
|
}
|
|
1630
1889
|
}
|
|
@@ -1633,8 +1892,13 @@ const DatetimeInput = class {
|
|
|
1633
1892
|
*
|
|
1634
1893
|
* @param newValue - Nova data final do range.
|
|
1635
1894
|
*/
|
|
1895
|
+
/**
|
|
1896
|
+
* Watcher: atualiza a representação textual quando o fim do range muda.
|
|
1897
|
+
*
|
|
1898
|
+
* @returns {void}
|
|
1899
|
+
*/
|
|
1636
1900
|
handleRangeEndChange() {
|
|
1637
|
-
if (this.
|
|
1901
|
+
if (this.selectionMode === 'range') {
|
|
1638
1902
|
this.syncInputValueFromProps();
|
|
1639
1903
|
}
|
|
1640
1904
|
}
|
|
@@ -1642,48 +1906,43 @@ const DatetimeInput = class {
|
|
|
1642
1906
|
* Valida props iniciais e sincroniza o texto exibido no input.
|
|
1643
1907
|
*/
|
|
1644
1908
|
componentWillLoad() {
|
|
1645
|
-
this.referenceDate =
|
|
1909
|
+
this.referenceDate = isValid.resolveSsrLocalDate(this.el, this.referenceDate);
|
|
1646
1910
|
this.ensureValidMode();
|
|
1647
1911
|
this.ensureValidReferenceDate();
|
|
1648
1912
|
this.ensureValidValue();
|
|
1649
1913
|
this.syncInputValueFromProps();
|
|
1650
1914
|
}
|
|
1651
1915
|
/**
|
|
1652
|
-
*
|
|
1916
|
+
* Confirma o conteúdo atual evitando commits duplicados (blur + change).
|
|
1653
1917
|
*
|
|
1654
|
-
*
|
|
1655
|
-
* o browser dispara um click sintético. Adicionamos um listener imperativo para
|
|
1656
|
-
* garantir que o clique no botão de ação acione o toggle. O blur é observado na raiz
|
|
1657
|
-
* interna porque mover o foco do input para essa ação não desfoca o host `br-input`.
|
|
1918
|
+
* @returns {void}
|
|
1658
1919
|
*/
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
const brInput = this.el.shadowRoot?.querySelector('br-input');
|
|
1662
|
-
if (!brInput)
|
|
1663
|
-
return;
|
|
1664
|
-
if (!brInput.shadowRoot)
|
|
1665
|
-
await brInput.componentOnReady();
|
|
1666
|
-
if (!this.el.isConnected || !brInput.shadowRoot)
|
|
1920
|
+
commitCurrentInput() {
|
|
1921
|
+
if (this.disabled)
|
|
1667
1922
|
return;
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
const actionButton = this.inputShadowRoot.querySelector('br-button.button-transform');
|
|
1671
|
-
if (!actionButton)
|
|
1923
|
+
const currentText = this.inputValue.trim();
|
|
1924
|
+
if (this.lastCommittedInputText === currentText)
|
|
1672
1925
|
return;
|
|
1673
|
-
this.
|
|
1674
|
-
|
|
1675
|
-
|
|
1926
|
+
this.lastCommittedInputText = currentText;
|
|
1927
|
+
this.commitInputValue();
|
|
1928
|
+
this.lastCommittedInputText = this.inputValue.trim();
|
|
1676
1929
|
}
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1930
|
+
/**
|
|
1931
|
+
* Retorna a máscara delegada ao `br-input` de acordo com o modo atual.
|
|
1932
|
+
*
|
|
1933
|
+
* @returns {string | undefined} - Máscara a ser aplicada, ou `undefined` quando indisponível.
|
|
1934
|
+
*/
|
|
1935
|
+
getInputMask() {
|
|
1936
|
+
if (this.selectionMode === 'range') {
|
|
1937
|
+
const boundaryMask = INPUT_FORMAT_CONFIG[this.mode].mask;
|
|
1938
|
+
return `${boundaryMask} - ${boundaryMask}`;
|
|
1939
|
+
}
|
|
1940
|
+
return INPUT_FORMAT_CONFIG[this.mode].mask;
|
|
1682
1941
|
}
|
|
1683
1942
|
/**
|
|
1684
1943
|
* Retorna o rótulo acessível do botão de alternância do picker.
|
|
1685
1944
|
*
|
|
1686
|
-
* @returns Texto anunciado pelo leitor de tela para o ícone de ação.
|
|
1945
|
+
* @returns {string} - Texto anunciado pelo leitor de tela para o ícone de ação.
|
|
1687
1946
|
*/
|
|
1688
1947
|
getToggleAriaLabel() {
|
|
1689
1948
|
switch (this.mode) {
|
|
@@ -1696,9 +1955,10 @@ const DatetimeInput = class {
|
|
|
1696
1955
|
}
|
|
1697
1956
|
}
|
|
1698
1957
|
/**
|
|
1699
|
-
* Normaliza
|
|
1958
|
+
* Normaliza e aplica um modo válido (`date` | `time` | `datetime`).
|
|
1700
1959
|
*
|
|
1701
|
-
* @param value - Modo informado externamente.
|
|
1960
|
+
* @param {string} value - Modo informado externamente.
|
|
1961
|
+
* @returns {void}
|
|
1702
1962
|
*/
|
|
1703
1963
|
ensureValidMode(value = this.mode) {
|
|
1704
1964
|
const normalizedMode = normalizeDatetimeInputMode(value);
|
|
@@ -1707,9 +1967,10 @@ const DatetimeInput = class {
|
|
|
1707
1967
|
}
|
|
1708
1968
|
}
|
|
1709
1969
|
/**
|
|
1710
|
-
* Garante que
|
|
1970
|
+
* Garante que `referenceDate` seja uma `Date` válida; caso contrário, normaliza.
|
|
1711
1971
|
*
|
|
1712
|
-
* @param value - Data de referência recebida via prop.
|
|
1972
|
+
* @param {Date} value - Data de referência recebida via prop.
|
|
1973
|
+
* @returns {void}
|
|
1713
1974
|
*/
|
|
1714
1975
|
ensureValidReferenceDate(value = this.referenceDate) {
|
|
1715
1976
|
const normalizedReferenceDate = normalizeDatetimeInputReferenceDate(value);
|
|
@@ -1720,7 +1981,8 @@ const DatetimeInput = class {
|
|
|
1720
1981
|
/**
|
|
1721
1982
|
* Normaliza o valor selecionado para `Date` válido ou `null`.
|
|
1722
1983
|
*
|
|
1723
|
-
* @param value - Valor recebido via prop.
|
|
1984
|
+
* @param {Date | null} value - Valor recebido via prop.
|
|
1985
|
+
* @returns {void}
|
|
1724
1986
|
*/
|
|
1725
1987
|
ensureValidValue(value = this.value) {
|
|
1726
1988
|
const normalizedValue = normalizeDatetimeInputValue(value);
|
|
@@ -1730,47 +1992,131 @@ const DatetimeInput = class {
|
|
|
1730
1992
|
}
|
|
1731
1993
|
/**
|
|
1732
1994
|
* Consolida o texto digitado, tenta analisar e emite o novo estado selecionado.
|
|
1995
|
+
*
|
|
1996
|
+
* Trata modos `single` e `range` e valida mensagens de erro apropriadas.
|
|
1997
|
+
*
|
|
1998
|
+
* @returns {void}
|
|
1733
1999
|
*/
|
|
1734
2000
|
commitInputValue() {
|
|
1735
2001
|
const inputText = this.inputValue.trim();
|
|
1736
2002
|
if (inputText === '') {
|
|
2003
|
+
this.emitInputValidation(true);
|
|
1737
2004
|
this.value = null;
|
|
1738
2005
|
this.dateStateChange.emit({
|
|
1739
2006
|
referenceDate: this.referenceDate,
|
|
1740
2007
|
value: null,
|
|
2008
|
+
origin: this.el.tagName,
|
|
1741
2009
|
});
|
|
1742
2010
|
this.emitNativeValueChange();
|
|
1743
2011
|
return;
|
|
1744
2012
|
}
|
|
1745
|
-
if (this.
|
|
2013
|
+
if (this.selectionMode === 'range') {
|
|
1746
2014
|
const parsedRange = this.parseRangeInput(inputText);
|
|
1747
|
-
if (parsedRange === null)
|
|
2015
|
+
if (parsedRange === null) {
|
|
2016
|
+
this.emitInputValidation(false, this.getRangeValidationMessage(inputText));
|
|
2017
|
+
return;
|
|
2018
|
+
}
|
|
2019
|
+
if (this.mode === 'datetime' && compareAscExports.compareAsc(parsedRange.end, parsedRange.start) < 0) {
|
|
2020
|
+
this.emitInputValidation(false, datetimePickerConstants.DATETIME_RANGE_ORDER_MESSAGE);
|
|
1748
2021
|
return;
|
|
2022
|
+
}
|
|
1749
2023
|
const normalizedRange = this.normalizeRangeBounds(parsedRange.start, parsedRange.end);
|
|
2024
|
+
this.emitInputValidation(true);
|
|
1750
2025
|
this.rangeValue = normalizedRange;
|
|
1751
|
-
this.
|
|
2026
|
+
this.setInternalInputValue(`${this.formatDateByMode(normalizedRange.start)} - ${this.formatDateByMode(normalizedRange.end)}`);
|
|
1752
2027
|
this.value = normalizedRange.end;
|
|
1753
2028
|
this.dateStateChange.emit({
|
|
1754
2029
|
referenceDate: normalizedRange.end,
|
|
1755
2030
|
value: normalizedRange.end,
|
|
1756
2031
|
range: normalizedRange,
|
|
2032
|
+
origin: this.el.tagName,
|
|
1757
2033
|
});
|
|
1758
2034
|
this.emitNativeValueChange();
|
|
1759
2035
|
return;
|
|
1760
2036
|
}
|
|
2037
|
+
if (!this.isInputComplete(inputText)) {
|
|
2038
|
+
this.emitInputValidation(false, this.getInputValidationMessage(inputText));
|
|
2039
|
+
return;
|
|
2040
|
+
}
|
|
1761
2041
|
const parsed = this.parseInputValue(inputText);
|
|
1762
|
-
if (parsed === null)
|
|
2042
|
+
if (parsed === null) {
|
|
2043
|
+
this.emitInputValidation(false, this.getInputValidationMessage(inputText));
|
|
1763
2044
|
return;
|
|
2045
|
+
}
|
|
2046
|
+
this.emitInputValidation(true);
|
|
1764
2047
|
const newDate = new Date(parsed);
|
|
1765
2048
|
newDate.setSeconds(0, 0);
|
|
1766
|
-
this.
|
|
2049
|
+
this.setInternalInputValue(this.formatDateByMode(newDate));
|
|
1767
2050
|
this.value = newDate;
|
|
1768
2051
|
this.dateStateChange.emit({
|
|
1769
2052
|
referenceDate: newDate,
|
|
1770
2053
|
value: newDate,
|
|
2054
|
+
origin: this.el.tagName,
|
|
1771
2055
|
});
|
|
1772
2056
|
this.emitNativeValueChange();
|
|
1773
2057
|
}
|
|
2058
|
+
/**
|
|
2059
|
+
* Emite o resultado da validação textual sem alterar o valor selecionado.
|
|
2060
|
+
*
|
|
2061
|
+
* @param {boolean} valid - Indica se a entrada é válida.
|
|
2062
|
+
* @param {string} [message] - Mensagem de erro quando inválido.
|
|
2063
|
+
* @returns {void}
|
|
2064
|
+
*/
|
|
2065
|
+
emitInputValidation(valid, message = '') {
|
|
2066
|
+
this.inputValidationChange.emit({ valid, message: valid ? '' : message, origin: this.el.tagName });
|
|
2067
|
+
}
|
|
2068
|
+
/**
|
|
2069
|
+
* Verifica se a entrada possui a quantidade de dígitos esperada para o modo atual.
|
|
2070
|
+
*
|
|
2071
|
+
* @param {string} value - Texto de entrada a ser verificado.
|
|
2072
|
+
* @returns {boolean} - `true` quando completo.
|
|
2073
|
+
*/
|
|
2074
|
+
isInputComplete(value) {
|
|
2075
|
+
const digits = value.replace(/\D/g, '');
|
|
2076
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2077
|
+
return config.acceptedDigitCounts.includes(digits.length);
|
|
2078
|
+
}
|
|
2079
|
+
/**
|
|
2080
|
+
* Retorna mensagem de validação contextual para uma entrada incompleta ou inválida.
|
|
2081
|
+
*
|
|
2082
|
+
* @param {string} value - Texto de entrada a ser avaliado.
|
|
2083
|
+
* @returns {string} - Mensagem de validação apropriada.
|
|
2084
|
+
*/
|
|
2085
|
+
getInputValidationMessage(value) {
|
|
2086
|
+
const digits = value.replace(/\D/g, '');
|
|
2087
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2088
|
+
if (!config)
|
|
2089
|
+
return 'Informe um valor válido.';
|
|
2090
|
+
const digitCount = digits.length;
|
|
2091
|
+
if (this.mode === 'datetime' &&
|
|
2092
|
+
config.acceptedDigitCounts.includes(digitCount) &&
|
|
2093
|
+
digitCount < config.fullDigitCount) {
|
|
2094
|
+
return config.messages.invalid;
|
|
2095
|
+
}
|
|
2096
|
+
return digitCount < config.fullDigitCount ? config.messages.incomplete : config.messages.invalid;
|
|
2097
|
+
}
|
|
2098
|
+
/**
|
|
2099
|
+
* Mensagem específica para o formato de intervalo do modo atual.
|
|
2100
|
+
*
|
|
2101
|
+
* @param {string} value - Texto de intervalo informado no input.
|
|
2102
|
+
* @returns {string} - Mensagem de validação do intervalo.
|
|
2103
|
+
*/
|
|
2104
|
+
getRangeValidationMessage(value) {
|
|
2105
|
+
const [startRaw = '', endRaw = ''] = value.split(/\s*-\s*/, 2);
|
|
2106
|
+
const startDigits = startRaw.replace(/\D/g, '');
|
|
2107
|
+
const endDigits = endRaw.replace(/\D/g, '');
|
|
2108
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2109
|
+
const expectedDigits = config.fullDigitCount;
|
|
2110
|
+
if (startDigits.length < expectedDigits || endDigits.length < expectedDigits) {
|
|
2111
|
+
return `Complete o intervalo no formato ${config.rangeFormat}.`;
|
|
2112
|
+
}
|
|
2113
|
+
return config.messages.invalidRange;
|
|
2114
|
+
}
|
|
2115
|
+
/**
|
|
2116
|
+
* Dispara eventos nativos `input` e `change` para compatibilidade com forms.
|
|
2117
|
+
*
|
|
2118
|
+
* @returns {void}
|
|
2119
|
+
*/
|
|
1774
2120
|
emitNativeValueChange() {
|
|
1775
2121
|
event.dispatchNativeFormEvent(this.el, 'input');
|
|
1776
2122
|
event.dispatchNativeFormEvent(this.el, 'change');
|
|
@@ -1791,56 +2137,91 @@ const DatetimeInput = class {
|
|
|
1791
2137
|
if (startText === '' || endText === '') {
|
|
1792
2138
|
return null;
|
|
1793
2139
|
}
|
|
1794
|
-
const base = this.referenceDate ??
|
|
1795
|
-
const parsedStart = this.
|
|
1796
|
-
const parsedEnd = this.
|
|
2140
|
+
const base = this.referenceDate ?? isValid.toDateExports.toDate(new Date());
|
|
2141
|
+
const parsedStart = this.parseInputValue(startText, this.rangeStart ?? base);
|
|
2142
|
+
const parsedEnd = this.parseInputValue(endText, this.rangeEnd ?? base);
|
|
1797
2143
|
if (parsedStart === null || parsedEnd === null) {
|
|
1798
2144
|
return null;
|
|
1799
2145
|
}
|
|
1800
2146
|
return { start: parsedStart, end: parsedEnd };
|
|
1801
2147
|
}
|
|
1802
|
-
/**
|
|
2148
|
+
/**
|
|
2149
|
+
* Normaliza os limites do intervalo para garantir ordem cronológica.
|
|
2150
|
+
*
|
|
2151
|
+
* - Em `time` e `datetime` mantém os limites informados.
|
|
2152
|
+
* - Em `date` reordena caso necessário.
|
|
2153
|
+
*
|
|
2154
|
+
* @param {Date} start - Data de início.
|
|
2155
|
+
* @param {Date} end - Data de término.
|
|
2156
|
+
* @returns {{ start: Date; end: Date }} - Limites normalizados.
|
|
2157
|
+
*/
|
|
1803
2158
|
normalizeRangeBounds(start, end) {
|
|
2159
|
+
if (this.mode !== 'date')
|
|
2160
|
+
return { start, end };
|
|
1804
2161
|
return compareAscExports.compareAsc(start, end) <= 0 ? { start, end } : { start: end, end: start };
|
|
1805
2162
|
}
|
|
1806
2163
|
/**
|
|
1807
|
-
* Sincroniza o texto do
|
|
2164
|
+
* Sincroniza o texto do input com as props `value`/`rangeStart`/`rangeEnd` e `mode`.
|
|
2165
|
+
*
|
|
2166
|
+
* @returns {void}
|
|
1808
2167
|
*/
|
|
1809
2168
|
syncInputValueFromProps() {
|
|
1810
|
-
if (this.
|
|
2169
|
+
if (this.selectionMode === 'range') {
|
|
1811
2170
|
if (this.rangeStart === null || this.rangeEnd === null) {
|
|
1812
|
-
this.
|
|
2171
|
+
this.setInternalInputValue('');
|
|
1813
2172
|
return;
|
|
1814
2173
|
}
|
|
1815
2174
|
const startFormatted = this.formatDateByMode(this.rangeStart);
|
|
1816
2175
|
const endFormatted = this.formatDateByMode(this.rangeEnd);
|
|
1817
|
-
this.
|
|
2176
|
+
this.setInternalInputValue(`${startFormatted} - ${endFormatted}`);
|
|
1818
2177
|
return;
|
|
1819
2178
|
}
|
|
1820
2179
|
if (this.value === null) {
|
|
1821
|
-
this.
|
|
2180
|
+
this.setInternalInputValue('');
|
|
1822
2181
|
return;
|
|
1823
2182
|
}
|
|
1824
|
-
this.
|
|
2183
|
+
this.setInternalInputValue(this.formatDateByMode(this.value));
|
|
2184
|
+
}
|
|
2185
|
+
/**
|
|
2186
|
+
* Retorna o elemento interno `<br-input>` quando disponível.
|
|
2187
|
+
*
|
|
2188
|
+
* @internal
|
|
2189
|
+
* @returns {HTMLBrInputElement | null} Elemento interno `<br-input>` ou `null` se não estiver disponível.
|
|
2190
|
+
*/
|
|
2191
|
+
getBrInputElement() {
|
|
2192
|
+
return this.el.shadowRoot?.querySelector('br-input');
|
|
2193
|
+
}
|
|
2194
|
+
/**
|
|
2195
|
+
* Define o valor interno do input imperativamente.
|
|
2196
|
+
*
|
|
2197
|
+
* @internal Define o valor interno do input sem re-renderizar o host.
|
|
2198
|
+
* @param {string} value Valor a ser definido no input interno.
|
|
2199
|
+
*/
|
|
2200
|
+
setInternalInputValue(value) {
|
|
2201
|
+
this.inputValue = value;
|
|
2202
|
+
const br = this.getBrInputElement();
|
|
2203
|
+
if (br) {
|
|
2204
|
+
// atualiza imperativamente o componente filho sem re-renderizar o host
|
|
2205
|
+
try {
|
|
2206
|
+
br.value = value;
|
|
2207
|
+
}
|
|
2208
|
+
catch { }
|
|
2209
|
+
}
|
|
1825
2210
|
}
|
|
1826
2211
|
/**
|
|
1827
2212
|
* Formata uma data de acordo com o modo atual do componente.
|
|
1828
2213
|
*
|
|
1829
|
-
* @param date - Data a ser formatada para exibição no input.
|
|
1830
|
-
* @returns Representação textual da data/hora no padrão esperado.
|
|
2214
|
+
* @param {Date} date - Data a ser formatada para exibição no input.
|
|
2215
|
+
* @returns {string} - Representação textual da data/hora no padrão esperado.
|
|
1831
2216
|
*/
|
|
1832
2217
|
formatDateByMode(date) {
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
return datetimePickerConstants.formatExports.format(date, 'dd/MM/yyyy');
|
|
1836
|
-
case 'time':
|
|
1837
|
-
return datetimePickerConstants.formatExports.format(date, 'HH:mm');
|
|
1838
|
-
default:
|
|
1839
|
-
return datetimePickerConstants.formatExports.format(date, 'dd/MM/yyyy HH:mm');
|
|
1840
|
-
}
|
|
2218
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2219
|
+
return datetimePickerConstants.formatExports.format(date, config.displayFormat);
|
|
1841
2220
|
}
|
|
1842
2221
|
/**
|
|
1843
|
-
* Retorna
|
|
2222
|
+
* Retorna o mapa de classes CSS aplicado ao host do componente.
|
|
2223
|
+
*
|
|
2224
|
+
* @returns {CssClassMap}
|
|
1844
2225
|
*/
|
|
1845
2226
|
getCssClassMap() {
|
|
1846
2227
|
return {
|
|
@@ -1850,7 +2231,7 @@ const DatetimeInput = class {
|
|
|
1850
2231
|
/**
|
|
1851
2232
|
* Seleciona o ícone do campo conforme o modo de entrada ativo.
|
|
1852
2233
|
*
|
|
1853
|
-
* @returns Nome do ícone usado na ação lateral do input.
|
|
2234
|
+
* @returns {string} - Nome do ícone usado na ação lateral do input.
|
|
1854
2235
|
*/
|
|
1855
2236
|
getInputIcon() {
|
|
1856
2237
|
switch (this.mode) {
|
|
@@ -1863,11 +2244,11 @@ const DatetimeInput = class {
|
|
|
1863
2244
|
/**
|
|
1864
2245
|
* Converte o texto digitado em `Date` com base no modo configurado.
|
|
1865
2246
|
*
|
|
1866
|
-
* @param value - Texto informado pelo usuário no input.
|
|
1867
|
-
* @
|
|
2247
|
+
* @param {string} value - Texto informado pelo usuário no input.
|
|
2248
|
+
* @param {Date} [base] - Data base usada para completar valores parciais.
|
|
2249
|
+
* @returns {Date | null} - Data convertida ou `null` quando inválida.
|
|
1868
2250
|
*/
|
|
1869
|
-
parseInputValue(value) {
|
|
1870
|
-
const base = this.value ?? this.referenceDate ?? datetimePickerPropsValidation.toDateExports.toDate(new Date());
|
|
2251
|
+
parseInputValue(value, base = this.value ?? this.referenceDate ?? isValid.toDateExports.toDate(new Date())) {
|
|
1871
2252
|
switch (this.mode) {
|
|
1872
2253
|
case 'date':
|
|
1873
2254
|
return this.parseDateInput(value, base);
|
|
@@ -1882,15 +2263,17 @@ const DatetimeInput = class {
|
|
|
1882
2263
|
/**
|
|
1883
2264
|
* Faz parse de uma data no formato `dd/MM/yyyy`, preservando hora e minuto base.
|
|
1884
2265
|
*
|
|
1885
|
-
* @param value - Texto de data digitado pelo usuário.
|
|
1886
|
-
* @param base - Data base usada para completar informações de tempo.
|
|
1887
|
-
* @returns Data válida normalizada ou `null` quando o parse falhar.
|
|
2266
|
+
* @param {string} value - Texto de data digitado pelo usuário.
|
|
2267
|
+
* @param {Date} base - Data base usada para completar informações de tempo.
|
|
2268
|
+
* @returns {Date | null} - Data válida normalizada ou `null` quando o parse falhar.
|
|
1888
2269
|
*/
|
|
1889
2270
|
parseDateInput(value, base) {
|
|
1890
|
-
const
|
|
1891
|
-
|
|
2271
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2272
|
+
const datePattern = config.parseFormats[0];
|
|
2273
|
+
const parsedDate = isValid.parseExports.parse(value, datePattern, base);
|
|
2274
|
+
if (!isValid.isValidExports.isValid(parsedDate))
|
|
1892
2275
|
return null;
|
|
1893
|
-
return
|
|
2276
|
+
return isValid.setExports.set(parsedDate, {
|
|
1894
2277
|
hours: getHoursExports.getHours(base),
|
|
1895
2278
|
minutes: getMinutesExports.getMinutes(base),
|
|
1896
2279
|
seconds: 0,
|
|
@@ -1900,15 +2283,17 @@ const DatetimeInput = class {
|
|
|
1900
2283
|
/**
|
|
1901
2284
|
* Faz parse de hora no formato `HH:mm`, preservando o dia da data base.
|
|
1902
2285
|
*
|
|
1903
|
-
* @param value - Texto de hora digitado pelo usuário.
|
|
1904
|
-
* @param base - Data base usada para manter dia, mês e ano.
|
|
1905
|
-
* @returns Data válida com hora ajustada ou `null` quando inválida.
|
|
2286
|
+
* @param {string} value - Texto de hora digitado pelo usuário.
|
|
2287
|
+
* @param {Date} base - Data base usada para manter dia, mês e ano.
|
|
2288
|
+
* @returns {Date | null} - Data válida com hora ajustada ou `null` quando inválida.
|
|
1906
2289
|
*/
|
|
1907
2290
|
parseTimeInput(value, base) {
|
|
1908
|
-
const
|
|
1909
|
-
|
|
2291
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2292
|
+
const timePattern = config.parseFormats[0];
|
|
2293
|
+
const parsedTime = isValid.parseExports.parse(value, timePattern, base);
|
|
2294
|
+
if (!isValid.isValidExports.isValid(parsedTime))
|
|
1910
2295
|
return null;
|
|
1911
|
-
return
|
|
2296
|
+
return isValid.setExports.set(base, {
|
|
1912
2297
|
hours: getHoursExports.getHours(parsedTime),
|
|
1913
2298
|
minutes: getMinutesExports.getMinutes(parsedTime),
|
|
1914
2299
|
seconds: 0,
|
|
@@ -1916,35 +2301,31 @@ const DatetimeInput = class {
|
|
|
1916
2301
|
});
|
|
1917
2302
|
}
|
|
1918
2303
|
/**
|
|
1919
|
-
* Faz parse de data e hora completas,
|
|
2304
|
+
* Faz parse de data e hora completas, aceitando somente a data como fallback.
|
|
1920
2305
|
*
|
|
1921
|
-
* @param value - Texto digitado no input.
|
|
1922
|
-
* @param base - Data base usada como contexto para completar o parse.
|
|
1923
|
-
* @returns Data válida a partir da entrada ou `null` quando não reconhecida.
|
|
2306
|
+
* @param {string} value - Texto digitado no input.
|
|
2307
|
+
* @param {Date} base - Data base usada como contexto para completar o parse.
|
|
2308
|
+
* @returns {Date | null} - Data válida a partir da entrada ou `null` quando não reconhecida.
|
|
1924
2309
|
*/
|
|
1925
2310
|
parseDateTimeInput(value, base) {
|
|
2311
|
+
const config = INPUT_FORMAT_CONFIG[this.mode];
|
|
2312
|
+
const fullPattern = config.parseFormats[0];
|
|
2313
|
+
const fallbackDatePattern = config.parseFormats[1];
|
|
1926
2314
|
// data + hora
|
|
1927
|
-
const full =
|
|
1928
|
-
if (
|
|
2315
|
+
const full = isValid.parseExports.parse(value, fullPattern, base);
|
|
2316
|
+
if (isValid.isValidExports.isValid(full))
|
|
1929
2317
|
return full;
|
|
1930
|
-
//
|
|
1931
|
-
const date =
|
|
1932
|
-
if (date
|
|
1933
|
-
return
|
|
2318
|
+
// somente data -> preserva a hora da data base
|
|
2319
|
+
const date = isValid.parseExports.parse(value, fallbackDatePattern, base);
|
|
2320
|
+
if (isValid.isValidExports.isValid(date)) {
|
|
2321
|
+
return isValid.setExports.set(date, {
|
|
1934
2322
|
hours: getHoursExports.getHours(base),
|
|
1935
2323
|
minutes: getMinutesExports.getMinutes(base),
|
|
1936
2324
|
seconds: 0,
|
|
1937
2325
|
milliseconds: 0,
|
|
1938
2326
|
});
|
|
1939
2327
|
}
|
|
1940
|
-
|
|
1941
|
-
return this.parseTimeInput(value, base);
|
|
1942
|
-
}
|
|
1943
|
-
/**
|
|
1944
|
-
* Renderiza o campo textual e o ícone de ação do datetime input.
|
|
1945
|
-
*/
|
|
1946
|
-
renderInputField() {
|
|
1947
|
-
return (index$1.h("br-input", { type: "text", value: this.inputValue, placeholder: this.placeholder, disabled: this.disabled, actionLabel: this.getToggleAriaLabel(), onInput: this.handleInputChange, onKeyDown: this.handleInputKeydown, "aria-label": this.getInputAriaLabel(), part: "input" }, index$1.h("br-icon", { slot: "action", iconName: this.getInputIcon(), width: "16", height: "16", "aria-hidden": "true", onClick: this.handleToggleDropdown, part: "icon" })));
|
|
2328
|
+
return null;
|
|
1948
2329
|
}
|
|
1949
2330
|
/**
|
|
1950
2331
|
* Retorna o rótulo acessível do campo de entrada de acordo com o modo ativo.
|
|
@@ -1961,11 +2342,19 @@ const DatetimeInput = class {
|
|
|
1961
2342
|
return 'Campo de data e hora';
|
|
1962
2343
|
}
|
|
1963
2344
|
}
|
|
2345
|
+
/**
|
|
2346
|
+
* Renderiza o campo textual e o ícone de ação do datetime input.
|
|
2347
|
+
*
|
|
2348
|
+
* @returns {JSX.Element}
|
|
2349
|
+
*/
|
|
2350
|
+
renderInputField() {
|
|
2351
|
+
return (index$1.h("br-input", { type: "text", mask: this.getInputMask(), placeholder: this.placeholder, disabled: this.disabled, actionLabel: this.getToggleAriaLabel(), onInput: this.handleInputChange, onChange: this.handleInputCommit, onBlur: this.handleInputBlur, onKeyDown: this.handleInputKeydown, onBrInputActionClick: this.handleActionButtonClick, "aria-label": this.getInputAriaLabel(), part: "input" }, index$1.h("br-icon", { slot: "action", iconName: this.getInputIcon(), width: "16", height: "16", "aria-hidden": "true", part: "icon" })));
|
|
2352
|
+
}
|
|
1964
2353
|
/**
|
|
1965
2354
|
* Renderização principal do componente.
|
|
1966
2355
|
*/
|
|
1967
2356
|
render() {
|
|
1968
|
-
return (index$1.h(index$1.Host, { key: '
|
|
2357
|
+
return (index$1.h(index$1.Host, { key: 'dd5b4fa7df2b33edc9c262b4d7cf0d161ae195b8' }, index$1.h("div", { key: '83035393364d795eeb46f7a9f03309e33d53aa42', class: this.getCssClassMap(), part: "container" }, this.renderInputField())));
|
|
1969
2358
|
}
|
|
1970
2359
|
static get delegatesFocus() { return true; }
|
|
1971
2360
|
get el() { return index$1.getElement(this); }
|
|
@@ -2223,57 +2612,79 @@ function requireSubMinutes () {
|
|
|
2223
2612
|
var subMinutesExports = /*@__PURE__*/ requireSubMinutes();
|
|
2224
2613
|
|
|
2225
2614
|
/**
|
|
2226
|
-
* Conjunto
|
|
2615
|
+
* Conjunto imutável dos campos suportados pelo `br-time-picker`.
|
|
2227
2616
|
*
|
|
2228
|
-
*
|
|
2617
|
+
* @readonly
|
|
2618
|
+
* @constant {Readonly<Record<string, string>>}
|
|
2229
2619
|
*/
|
|
2230
2620
|
const INPUT_TIME_TYPE = {
|
|
2231
2621
|
HOUR: 'hour',
|
|
2232
2622
|
MINUTE: 'minute',
|
|
2233
2623
|
};
|
|
2234
2624
|
|
|
2235
|
-
const timePickerCss = () => `*,*::before,*::after{box-sizing:border-box}:host{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}main{display:block}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:rgba(0,0,0,0)}b,strong{font-weight:bolder}code{font-family:monospace;font-size:1em}small{font-size:80%}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.d-none{display:none !important}@media (min-width: 576px){.d-sm-block{display:block !important}.d-sm-flex{display:flex !important}}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown>.br-notification{left:auto;right:0}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.justify-content-start{justify-content:flex-start !important}.justify-content-end{justify-content:flex-end !important}.justify-content-center{justify-content:center !important}.align-items-center{align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter)*.5);padding-right:calc(var(--grid-gutter)*.5);width:100%}.col{flex:1 0 0%;min-width:8.3333333333%}.col-auto{flex:0 0 auto;width:auto}.col-2{flex-basis:16.6666666667%;max-width:16.6666666667%}.container,.container-fluid,.container-lg{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:flex;flex-wrap:wrap;margin-left:calc(var(--grid-gutter)*-0.5);margin-right:calc(var(--grid-gutter)*-0.5)}@media (min-width: 576px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}.col-sm-4{flex-basis:33.3333333333%;max-width:33.3333333333%}}@media (min-width: 992px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}.col-lg-3{flex-basis:25%;max-width:25%}}@media (min-width: 1600px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.ease{animation-timing-function:cubic-bezier(0.25, 0.1, 0.25, 1)}.ease-out{animation-timing-function:cubic-bezier(0, 0, 0.58, 1)}.ease-in-out{animation-timing-function:cubic-bezier(0.42, 0, 0.58, 1)}.fast{animation-duration:var(--duration-fast)}.slow{animation-duration:var(--duration-slow)}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mb-1{margin-bottom:var(--spacing-scale-half) !important}.ml-1{margin-left:var(--spacing-scale-half) !important}.mx-3{margin-left:var(--spacing-scale-2x) !important;margin-right:var(--spacing-scale-2x) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.ml-auto{margin-left:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}@media (min-width: 576px){.ml-sm-0{margin-left:var(--spacing-scale-default) !important}}.highlight{background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}fieldset[disabled]{opacity:1}.text-center{text-align:center !important}.text-right{text-align:right !important}.text-nowrap{white-space:nowrap !important}.text-uppercase{text-transform:uppercase !important}.text-bold{font-weight:700 !important}.text-base{font-size:var(--font-size-scale-base) !important}.text-down-01{font-size:var(--font-size-scale-down-01) !important}@media (min-width: 576px){.text-sm-center{text-align:center !important}.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half)}a:focus{outline:none}a.focus-visible,a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}a{color:var(--interactive);text-decoration:none}.main-content a{text-decoration:underline}button{cursor:pointer}img{max-width:100%;vertical-align:middle}h2,.h2{color:var(--color);font-size:var(--font-size-scale-up-03);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2xh);margin-top:var(--spacing-scale-3xh);padding-bottom:var(--spacing-scale-2xh)}@media (min-width: 576px){.h2,h2{font-size:var(--font-size-scale-up-05);font-weight:var(--font-weight-regular)}}ul,ol{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}table{--table-background:var(--background);--table-color:var(--color);--table-border-color:var(--gray-20);--table-border-style:solid;--table-border-width:1px;--table-hover:var(--color-rgb);--table-padding:var(--spacing-scale-3x);--table-font-weight:var(--font-weight-medium);--table-th-background:var(--background-alternative);--table-th-font-weight:var(--font-weight-semi-bold);--table-row-size:var(--spacing-scale-2x);border-collapse:collapse;width:100%}tr.selected,tr.is-selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}fieldset,.fieldset{border:var(--surface-width-none);margin-bottom:var(--spacing-scale-5x);margin-top:0;padding:0}legend,.legend{color:var(--color);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2x);margin-top:var(--spacing-scale-2x)}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}code,.code{background:var(--gray-5);border-radius:4px;color:var(--gray-80);display:inline-block;font-family:monospace;font-size:var(--font-size-scale-base);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);padding:var(--spacing-scale-half)}pre,.pre{background:var(--gray-5);margin:var(--spacing-scale-2x) 0 var(--spacing-scale-4x);padding:var(--spacing-scale-2x)}pre code,.pre code{display:inline;padding:0}*[data-toggle=collapse]:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}*[data-toggle=collapse]:focus{outline:none}*[data-toggle=collapse].focus-visible,*[data-toggle=collapse]:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}@media (prefers-reduced-motion: reduce){:host,:host::before,:host::after,:host *,:host *::before,:host *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}}:host-context([data-wbc-reduced-motion=true])::before,:host-context([data-wbc-reduced-motion=true])::after,:host-context([data-wbc-reduced-motion=true]) *,:host-context([data-wbc-reduced-motion=true]) *::before,:host-context([data-wbc-reduced-motion=true]) *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}:host{display:block;width:100%;max-width:144px;height:116px;margin-inline:auto;box-sizing:border-box}.br-time-picker{display:flex;justify-content:center;align-items:center;width:100%;height:100%;box-sizing:border-box}.timer{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:var(--spacing-scale-sm);width:100%;box-sizing:border-box}.time-field{display:flex;flex-direction:column;align-items:center;justify-content:flex-end}.time-field label{font-size:var(--font-size-scale-down-01);color:var(--gray-70);margin-bottom:4px}.time-field input{width:var(--spacing-scale-6x);height:var(--spacing-scale-6x);padding:4px;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);text-align:center;border-color:var(--border-color-alternative);border-radius:var(--surface-rounder-sm);border-style:var(--border-style);border-width:var(--border-width)}.time-field input:hover{background:linear-gradient(rgb(var(--color-rgb), var(--hover)), rgb(var(--color-rgb), var(--hover)))}.time-separator{display:inline-block;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);color:var(--gray-70);align-self:center;line-height:1;padding:0 var(--spacing-scale-base)}`;
|
|
2625
|
+
const timePickerCss = () => `*,*::before,*::after{box-sizing:border-box}:host{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}main{display:block}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace;font-size:1em}a{background-color:rgba(0,0,0,0)}b,strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{appearance:none}::-webkit-file-upload-button{appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}.d-none{display:none !important}@media (min-width: 576px){.d-sm-block{display:block !important}.d-sm-flex{display:flex !important}}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown>.br-notification{left:auto;right:0}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.justify-content-start{justify-content:flex-start !important}.justify-content-end{justify-content:flex-end !important}.justify-content-center{justify-content:center !important}.align-items-center{align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter)*.5);padding-right:calc(var(--grid-gutter)*.5);width:100%}.col{flex:1 0 0%;min-width:8.3333333333%}.col-auto{flex:0 0 auto;width:auto}.col-2{flex-basis:16.6666666667%;max-width:16.6666666667%}.container,.container-fluid,.container-lg{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:flex;flex-wrap:wrap;margin-left:calc(var(--grid-gutter)*-0.5);margin-right:calc(var(--grid-gutter)*-0.5)}@media (min-width: 576px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}.col-sm-4{flex-basis:33.3333333333%;max-width:33.3333333333%}}@media (min-width: 992px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}.col-lg-3{flex-basis:25%;max-width:25%}}@media (min-width: 1600px){.container,.container-lg,.container-fluid{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container,.container-lg{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.ease{animation-timing-function:cubic-bezier(0.25, 0.1, 0.25, 1)}.ease-out{animation-timing-function:cubic-bezier(0, 0, 0.58, 1)}.ease-in-out{animation-timing-function:cubic-bezier(0.42, 0, 0.58, 1)}.fast{animation-duration:var(--duration-fast)}.slow{animation-duration:var(--duration-slow)}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mb-1{margin-bottom:var(--spacing-scale-half) !important}.ml-1{margin-left:var(--spacing-scale-half) !important}.mx-3{margin-left:var(--spacing-scale-2x) !important;margin-right:var(--spacing-scale-2x) !important}.mb-4{margin-bottom:var(--spacing-scale-3x) !important}.ml-auto{margin-left:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}@media (min-width: 576px){.ml-sm-0{margin-left:var(--spacing-scale-default) !important}}.highlight{background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}fieldset[disabled]{opacity:1}.text-center{text-align:center !important}.text-right{text-align:right !important}.text-nowrap{white-space:nowrap !important}.text-uppercase{text-transform:uppercase !important}.text-bold{font-weight:700 !important}.text-base{font-size:var(--font-size-scale-base) !important}.text-down-01{font-size:var(--font-size-scale-down-01) !important}@media (min-width: 576px){.text-sm-center{text-align:center !important}.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half)}a:focus{outline:none}a.focus-visible,a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}a{color:var(--interactive);text-decoration:none}.main-content a{text-decoration:underline}button{cursor:pointer}img{max-width:100%;vertical-align:middle}h2,.h2{color:var(--color);font-size:var(--font-size-scale-up-03);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2xh);margin-top:var(--spacing-scale-3xh);padding-bottom:var(--spacing-scale-2xh)}@media (min-width: 576px){.h2,h2{font-size:var(--font-size-scale-up-05);font-weight:var(--font-weight-regular)}}ul,ol{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}table{--table-background:var(--background);--table-color:var(--color);--table-border-color:var(--gray-20);--table-border-style:solid;--table-border-width:1px;--table-hover:var(--color-rgb);--table-padding:var(--spacing-scale-3x);--table-font-weight:var(--font-weight-medium);--table-th-background:var(--background-alternative);--table-th-font-weight:var(--font-weight-semi-bold);--table-row-size:var(--spacing-scale-2x);border-collapse:collapse;width:100%}tr.selected,tr.is-selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}fieldset,.fieldset{border:var(--surface-width-none);margin-bottom:var(--spacing-scale-5x);margin-top:0;padding:0}legend,.legend{color:var(--color);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-2x);margin-top:var(--spacing-scale-2x)}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}pre,.pre{background:var(--gray-5);margin:var(--spacing-scale-2x) 0 var(--spacing-scale-4x);padding:var(--spacing-scale-2x)}*[data-toggle=collapse]:not(:disabled):hover{background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}*[data-toggle=collapse]:focus{outline:none}*[data-toggle=collapse].focus-visible,*[data-toggle=collapse]:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}@media (prefers-reduced-motion: reduce){:host,:host::before,:host::after,:host *,:host *::before,:host *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}}:host-context([data-wbc-reduced-motion=true])::before,:host-context([data-wbc-reduced-motion=true])::after,:host-context([data-wbc-reduced-motion=true]) *,:host-context([data-wbc-reduced-motion=true]) *::before,:host-context([data-wbc-reduced-motion=true]) *::after{animation:none !important;scroll-behavior:auto !important;transition:none !important}:host{display:block;width:100%;max-width:144px;height:116px;margin-inline:auto;box-sizing:border-box}.br-time-picker{display:flex;justify-content:center;align-items:center;width:100%;height:100%;box-sizing:border-box}.timer{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:var(--spacing-scale-sm);width:100%;box-sizing:border-box}.time-field{display:flex;flex-direction:column;align-items:center;justify-content:flex-end}.time-field label{font-size:var(--font-size-scale-down-01);color:var(--gray-70);margin-bottom:4px}.time-field input{width:var(--spacing-scale-6x);height:var(--spacing-scale-6x);padding:4px;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);text-align:center;border-color:var(--border-color-alternative);border-radius:var(--surface-rounder-sm);border-style:var(--border-style);border-width:var(--border-width)}.time-field input:hover{background:linear-gradient(rgb(var(--color-rgb), var(--hover)), rgb(var(--color-rgb), var(--hover)))}.time-separator{display:inline-block;font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-semi-bold);color:var(--gray-70);align-self:center;line-height:1;padding:0 var(--spacing-scale-base)}`;
|
|
2236
2626
|
|
|
2237
2627
|
const TimePicker = class {
|
|
2238
2628
|
constructor(hostRef) {
|
|
2239
2629
|
index$1.registerInstance(this, hostRef);
|
|
2240
2630
|
this.dateStateChange = index$1.createEvent(this, "dateStateChange", 7);
|
|
2241
|
-
/** Mantém o rascunho digitado por campo para evitar aplicar valor parcial prematuramente. */
|
|
2242
|
-
this.timeDraft = {};
|
|
2243
2631
|
/**
|
|
2244
|
-
* Data
|
|
2245
|
-
* Recebe uma instância de `Date` por property binding; valores inválidos usam a data atual.
|
|
2632
|
+
* Data de referência usada para exibir e ajustar hora e minuto.
|
|
2246
2633
|
*
|
|
2247
|
-
* @
|
|
2248
|
-
* ```js
|
|
2249
|
-
* const timePicker = document.querySelector('br-time-picker');
|
|
2250
|
-
* timePicker.referenceDate = new Date(2026, 8, 7, 9);
|
|
2251
|
-
* ```
|
|
2634
|
+
* @default new Date()
|
|
2252
2635
|
*/
|
|
2253
2636
|
this.referenceDate = new Date();
|
|
2254
2637
|
/**
|
|
2255
|
-
*
|
|
2256
|
-
* Recebe uma instância de `Date` por property binding; datas inválidas usam `null`.
|
|
2638
|
+
* Valor selecionado pelo usuário.
|
|
2257
2639
|
*
|
|
2258
|
-
* @
|
|
2259
|
-
* ```js
|
|
2260
|
-
* const timePicker = document.querySelector('br-time-picker');
|
|
2261
|
-
* timePicker.value = new Date(2026, 8, 7, 14, 30);
|
|
2262
|
-
* ```
|
|
2640
|
+
* @default null
|
|
2263
2641
|
*/
|
|
2264
2642
|
this.value = null;
|
|
2265
|
-
/**
|
|
2643
|
+
/**
|
|
2644
|
+
* Indica se os controles do seletor estão desabilitados.
|
|
2645
|
+
*
|
|
2646
|
+
* @default false
|
|
2647
|
+
*/
|
|
2266
2648
|
this.disabled = false;
|
|
2267
|
-
/**
|
|
2649
|
+
/**
|
|
2650
|
+
* Rascunho dos valores digitados por cada campo (`hour` | `minute`).
|
|
2651
|
+
* Mantém entradas parciais até o commit por blur/Enter.
|
|
2652
|
+
*/
|
|
2653
|
+
this.timeDraft = {};
|
|
2654
|
+
/**
|
|
2655
|
+
* Mapa memorizado de handlers para o evento `input` por tipo de campo.
|
|
2656
|
+
*
|
|
2657
|
+
* Motivo: evita recriar closures a cada render, reduz alocação e mantém
|
|
2658
|
+
* identidade das funções (útil para comparação/remoção quando necessário).
|
|
2659
|
+
*
|
|
2660
|
+
* @private
|
|
2661
|
+
* @type {Map<InputTimeType, (event: Event) => void>}
|
|
2662
|
+
*/
|
|
2268
2663
|
this.timeInputChangeHandlers = new Map();
|
|
2269
|
-
/**
|
|
2664
|
+
/**
|
|
2665
|
+
* Mapa memorizado de handlers de commit (blur/confirm) por tipo de campo.
|
|
2666
|
+
*
|
|
2667
|
+
* Contém funções que finalizam o rascunho e aplicam o valor via
|
|
2668
|
+
* `handleTimeInputCommit(type)`.
|
|
2669
|
+
*
|
|
2670
|
+
* @private
|
|
2671
|
+
* @type {Map<InputTimeType, () => void>}
|
|
2672
|
+
*/
|
|
2270
2673
|
this.timeInputCommitHandlers = new Map();
|
|
2271
|
-
/**
|
|
2674
|
+
/**
|
|
2675
|
+
* Mapa memorizado de handlers de teclado por tipo de campo.
|
|
2676
|
+
*
|
|
2677
|
+
* Suporta comportamento de `Enter` (confirma) e setas para ajuste.
|
|
2678
|
+
* Memorizar evita recriar closures e melhora performance em re-renders.
|
|
2679
|
+
*
|
|
2680
|
+
* @private
|
|
2681
|
+
* @type {Map<InputTimeType, (event: KeyboardEvent) => void>}
|
|
2682
|
+
*/
|
|
2272
2683
|
this.timeInputKeydownHandlers = new Map();
|
|
2273
2684
|
/**
|
|
2274
2685
|
* Executa a navegação associada ao botão clicado.
|
|
2275
2686
|
*
|
|
2276
|
-
* @param event - Clique disparado pelo botão de navegação.
|
|
2687
|
+
* @param {MouseEvent} event - Clique disparado pelo botão de navegação.
|
|
2277
2688
|
*/
|
|
2278
2689
|
this.handleNavigationClick = (event) => {
|
|
2279
2690
|
if (this.disabled) {
|
|
@@ -2303,8 +2714,8 @@ const TimePicker = class {
|
|
|
2303
2714
|
/**
|
|
2304
2715
|
* Atualiza o rascunho do campo removendo qualquer caractere não numérico.
|
|
2305
2716
|
*
|
|
2306
|
-
* @param event - Evento de input do campo de hora ou minuto.
|
|
2307
|
-
* @param type - Campo que está sendo editado.
|
|
2717
|
+
* @param {Event} event - Evento de input do campo de hora ou minuto.
|
|
2718
|
+
* @param {InputTimeType} type - Campo que está sendo editado.
|
|
2308
2719
|
*/
|
|
2309
2720
|
this.handleTimeInputChange = (event, type) => {
|
|
2310
2721
|
if (this.disabled) {
|
|
@@ -2315,41 +2726,38 @@ const TimePicker = class {
|
|
|
2315
2726
|
this.timeDraft = { ...this.timeDraft, [type]: value };
|
|
2316
2727
|
};
|
|
2317
2728
|
}
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2729
|
+
/**
|
|
2730
|
+
* Sincroniza `referenceDate` quando a prop `value` muda.
|
|
2731
|
+
*
|
|
2732
|
+
* Normaliza segundos/milissegundos e restaura rascunhos locais.
|
|
2733
|
+
*
|
|
2734
|
+
* @param {Date | null} newValue - Novo valor vindo da prop `value`.
|
|
2735
|
+
* @returns {void}
|
|
2736
|
+
*/
|
|
2324
2737
|
handleValueChange(newValue) {
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2738
|
+
if (newValue === null || !(newValue instanceof Date) || Number.isNaN(newValue.getTime())) {
|
|
2739
|
+
return;
|
|
2740
|
+
}
|
|
2741
|
+
const normalizedValue = isValid.setExports.set(isValid.toDateExports.toDate(newValue), { seconds: 0, milliseconds: 0 });
|
|
2742
|
+
if (this.referenceDate.getTime() !== normalizedValue.getTime()) {
|
|
2743
|
+
this.referenceDate = normalizedValue;
|
|
2744
|
+
}
|
|
2745
|
+
this.timeDraft = {};
|
|
2329
2746
|
}
|
|
2330
2747
|
componentWillLoad() {
|
|
2331
|
-
this.referenceDate =
|
|
2332
|
-
this.value = this.normalizeDateProp(this.value, 'value', null);
|
|
2333
|
-
this.referenceDate = datetimePickerPropsValidation.resolveSsrLocalDate(this.el, this.referenceDate);
|
|
2334
|
-
}
|
|
2335
|
-
normalizeDateProp(value, propertyName, fallback) {
|
|
2336
|
-
if (value === null && fallback === null)
|
|
2337
|
-
return null;
|
|
2338
|
-
if (value instanceof Date && !Number.isNaN(value.getTime()))
|
|
2339
|
-
return datetimePickerPropsValidation.toDateExports.toDate(value);
|
|
2340
|
-
propWarning.reportInvalidPropValue(this.el, propertyName, value, 'Informe uma instância de Date válida.', `Aplicando fallback ${fallback === null ? 'null' : 'new Date()'}.`);
|
|
2341
|
-
return fallback === null ? null : datetimePickerPropsValidation.toDateExports.toDate(fallback);
|
|
2748
|
+
this.referenceDate = isValid.resolveSsrLocalDate(this.el, this.referenceDate);
|
|
2342
2749
|
}
|
|
2343
2750
|
/**
|
|
2344
2751
|
* Emite o estado consolidado para manter hora, minuto e data sincronizados.
|
|
2345
2752
|
*
|
|
2346
|
-
* @param nextReferenceDate - Nova data de referência após a interação.
|
|
2347
|
-
* @param nextValue - Valor final selecionado; quando omitido, assume a data de referência.
|
|
2753
|
+
* @param {Date} nextReferenceDate - Nova data de referência após a interação.
|
|
2754
|
+
* @param {Date | null} nextValue - Valor final selecionado; quando omitido, assume a data de referência.
|
|
2348
2755
|
*/
|
|
2349
|
-
emitDateStateChange(nextReferenceDate, nextValue =
|
|
2756
|
+
emitDateStateChange(nextReferenceDate, nextValue = isValid.toDateExports.toDate(new Date(nextReferenceDate))) {
|
|
2350
2757
|
// Ao emitir, garantir segundos zerados (componente não controla segundos)
|
|
2351
|
-
const normalizedReference =
|
|
2352
|
-
const normalizedValue = nextValue === null ? null :
|
|
2758
|
+
const normalizedReference = isValid.setExports.set(nextReferenceDate, { seconds: 0, milliseconds: 0 });
|
|
2759
|
+
const normalizedValue = nextValue === null ? null : isValid.setExports.set(nextValue, { seconds: 0, milliseconds: 0 });
|
|
2760
|
+
this.referenceDate = normalizedReference;
|
|
2353
2761
|
this.value = normalizedValue;
|
|
2354
2762
|
this.dateStateChange.emit({
|
|
2355
2763
|
referenceDate: normalizedReference,
|
|
@@ -2361,8 +2769,8 @@ const TimePicker = class {
|
|
|
2361
2769
|
/**
|
|
2362
2770
|
* Resolve o ícone associado à ação de navegação.
|
|
2363
2771
|
*
|
|
2364
|
-
* @param action - Ação representada pelo botão.
|
|
2365
|
-
* @returns O nome do ícone ou uma string vazia quando a ação não é reconhecida.
|
|
2772
|
+
* @param {NavigationAction} action - Ação representada pelo botão.
|
|
2773
|
+
* @returns {string} O nome do ícone ou uma string vazia quando a ação não é reconhecida.
|
|
2366
2774
|
*/
|
|
2367
2775
|
getIconForAction(action) {
|
|
2368
2776
|
switch (action) {
|
|
@@ -2379,7 +2787,7 @@ const TimePicker = class {
|
|
|
2379
2787
|
/**
|
|
2380
2788
|
* Aplica o valor digitado ao estado do componente quando o campo é concluído.
|
|
2381
2789
|
*
|
|
2382
|
-
* @param type - Campo que será aplicado.
|
|
2790
|
+
* @param {InputTimeType} type - Campo que será aplicado.
|
|
2383
2791
|
*/
|
|
2384
2792
|
handleTimeInputCommit(type) {
|
|
2385
2793
|
if (this.disabled) {
|
|
@@ -2391,16 +2799,16 @@ const TimePicker = class {
|
|
|
2391
2799
|
const numeric = Number(draft);
|
|
2392
2800
|
if (Number.isNaN(numeric))
|
|
2393
2801
|
return;
|
|
2394
|
-
let date =
|
|
2802
|
+
let date = isValid.toDateExports.toDate(new Date(this.referenceDate));
|
|
2395
2803
|
if (type === INPUT_TIME_TYPE.HOUR) {
|
|
2396
2804
|
if (numeric < 0 || numeric > 23)
|
|
2397
2805
|
return;
|
|
2398
|
-
date =
|
|
2806
|
+
date = isValid.setExports.set(date, { hours: numeric });
|
|
2399
2807
|
}
|
|
2400
2808
|
if (type === INPUT_TIME_TYPE.MINUTE) {
|
|
2401
2809
|
if (numeric < 0 || numeric > 59)
|
|
2402
2810
|
return;
|
|
2403
|
-
date =
|
|
2811
|
+
date = isValid.setExports.set(date, { minutes: numeric });
|
|
2404
2812
|
}
|
|
2405
2813
|
this.emitDateStateChange(date);
|
|
2406
2814
|
const { [type]: _discarded, ...remainingDraft } = this.timeDraft;
|
|
@@ -2409,8 +2817,8 @@ const TimePicker = class {
|
|
|
2409
2817
|
/**
|
|
2410
2818
|
* Constrói o rótulo acessível das ações de navegação com base no valor atual.
|
|
2411
2819
|
*
|
|
2412
|
-
* @param action - Ação que o botão executa.
|
|
2413
|
-
* @returns Texto acessível do botão.
|
|
2820
|
+
* @param {NavigationAction} action - Ação que o botão executa.
|
|
2821
|
+
* @returns {string} Texto acessível do botão.
|
|
2414
2822
|
*/
|
|
2415
2823
|
getNavigationAriaLabel(action) {
|
|
2416
2824
|
switch (action) {
|
|
@@ -2534,6 +2942,13 @@ const TimePicker = class {
|
|
|
2534
2942
|
}
|
|
2535
2943
|
return handler;
|
|
2536
2944
|
}
|
|
2945
|
+
/**
|
|
2946
|
+
* Ajusta o valor do campo via teclado (ArrowUp/ArrowDown).
|
|
2947
|
+
*
|
|
2948
|
+
* @param event - Evento de teclado que disparou a ação.
|
|
2949
|
+
* @param type - Tipo do campo (`hour` | `minute`) a ser ajustado.
|
|
2950
|
+
* @returns void
|
|
2951
|
+
*/
|
|
2537
2952
|
adjustTimeInputWithKeyboard(event, type) {
|
|
2538
2953
|
if (event.key !== 'ArrowUp' && event.key !== 'ArrowDown')
|
|
2539
2954
|
return;
|
|
@@ -2544,22 +2959,38 @@ const TimePicker = class {
|
|
|
2544
2959
|
}
|
|
2545
2960
|
type === INPUT_TIME_TYPE.HOUR ? this.decreaseHour() : this.decreaseMinute();
|
|
2546
2961
|
}
|
|
2547
|
-
/**
|
|
2962
|
+
/**
|
|
2963
|
+
* Incrementa a hora sem alterar os demais componentes da data.
|
|
2964
|
+
*
|
|
2965
|
+
* @returns void
|
|
2966
|
+
*/
|
|
2548
2967
|
increaseHour() {
|
|
2549
2968
|
const date = addHoursExports.addHours(this.referenceDate, 1);
|
|
2550
2969
|
this.emitDateStateChange(date);
|
|
2551
2970
|
}
|
|
2552
|
-
/**
|
|
2971
|
+
/**
|
|
2972
|
+
* Incrementa o minuto sem alterar os demais componentes da data.
|
|
2973
|
+
*
|
|
2974
|
+
* @returns void
|
|
2975
|
+
*/
|
|
2553
2976
|
increaseMinute() {
|
|
2554
2977
|
const date = addMinutesExports.addMinutes(this.referenceDate, 1);
|
|
2555
2978
|
this.emitDateStateChange(date);
|
|
2556
2979
|
}
|
|
2557
|
-
/**
|
|
2980
|
+
/**
|
|
2981
|
+
* Decrementa a hora sem alterar os demais componentes da data.
|
|
2982
|
+
*
|
|
2983
|
+
* @returns void
|
|
2984
|
+
*/
|
|
2558
2985
|
decreaseHour() {
|
|
2559
2986
|
const date = subHoursExports.subHours(this.referenceDate, 1);
|
|
2560
2987
|
this.emitDateStateChange(date);
|
|
2561
2988
|
}
|
|
2562
|
-
/**
|
|
2989
|
+
/**
|
|
2990
|
+
* Decrementa o minuto sem alterar os demais componentes da data.
|
|
2991
|
+
*
|
|
2992
|
+
* @returns void
|
|
2993
|
+
*/
|
|
2563
2994
|
decreaseMinute() {
|
|
2564
2995
|
const date = subMinutesExports.subMinutes(this.referenceDate, 1);
|
|
2565
2996
|
this.emitDateStateChange(date);
|
|
@@ -2567,32 +2998,40 @@ const TimePicker = class {
|
|
|
2567
2998
|
/**
|
|
2568
2999
|
* Renderiza um botão de navegação consistente para hora ou minuto.
|
|
2569
3000
|
*
|
|
2570
|
-
* @param action - Ação que o botão executará.
|
|
3001
|
+
* @param {NavigationAction} action - Ação que o botão executará.
|
|
3002
|
+
* @returns {JSX.Element}
|
|
2571
3003
|
*/
|
|
2572
3004
|
renderNavigationButton(action) {
|
|
2573
3005
|
return (index$1.h("br-button", { type: "button", emphasis: "tertiary", density: "small", shape: "circle", disabled: this.disabled, "data-action": action, "aria-label": this.getNavigationAriaLabel(action), onClick: this.handleNavigationClick }, index$1.h("br-icon", { iconName: this.getIconForAction(action), width: "20", height: "20", "aria-hidden": "true" })));
|
|
2574
3006
|
}
|
|
2575
|
-
/**
|
|
3007
|
+
/**
|
|
3008
|
+
* Renderiza o bloco completo de hora e minuto.
|
|
3009
|
+
*
|
|
3010
|
+
* @returns {JSX.Element}
|
|
3011
|
+
*/
|
|
2576
3012
|
renderTimePicker() {
|
|
2577
3013
|
return (index$1.h("div", { class: "timer", role: "group", "aria-label": "Seletor de hora e minuto", part: "timer" }, this.renderTimeField(INPUT_TIME_TYPE.HOUR), index$1.h("span", { class: "time-separator", "aria-hidden": "true", part: "separator" }, ":"), this.renderTimeField(INPUT_TIME_TYPE.MINUTE)));
|
|
2578
3014
|
}
|
|
2579
3015
|
/**
|
|
2580
3016
|
* Renderiza um campo de edição com navegação lateral.
|
|
2581
3017
|
*
|
|
2582
|
-
* @param type - Tipo do campo a ser exibido.
|
|
3018
|
+
* @param {InputTimeType} type - Tipo do campo a ser exibido.
|
|
3019
|
+
* @returns {JSX.Element}
|
|
2583
3020
|
*/
|
|
2584
3021
|
renderTimeField(type) {
|
|
2585
3022
|
const { nextAction, prevAction } = this.getTimeFieldConfig(type);
|
|
2586
3023
|
return (index$1.h("div", { class: "time-field", part: "field" }, this.renderNavigationButton(nextAction), index$1.h("input", { type: "text", inputmode: "numeric", maxLength: 2, value: this.timeDraft[type] ?? this.getTimeFieldValue(type), "aria-label": this.getTimeFieldAriaLabel(type), onInput: this.getTimeInputChangeHandler(type), onBlur: this.getTimeInputCommitHandler(type), onKeyDown: this.getTimeInputKeydownHandler(type), disabled: this.disabled, part: "input" }), this.renderNavigationButton(prevAction)));
|
|
2587
3024
|
}
|
|
3025
|
+
/**
|
|
3026
|
+
* Render principal do componente.
|
|
3027
|
+
*
|
|
3028
|
+
* @returns {JSX.Element}
|
|
3029
|
+
*/
|
|
2588
3030
|
render() {
|
|
2589
|
-
return (index$1.h(index$1.Host, { key: '
|
|
3031
|
+
return (index$1.h(index$1.Host, { key: 'e81125092811d06b37cdd61d562998de83020880' }, index$1.h("div", { key: 'df218ea0cc8424f55ed0689e5479ef47cdbee74c', class: "br-time-picker", part: "container" }, this.renderTimePicker())));
|
|
2590
3032
|
}
|
|
2591
3033
|
get el() { return index$1.getElement(this); }
|
|
2592
3034
|
static get watchers() { return {
|
|
2593
|
-
"referenceDate": [{
|
|
2594
|
-
"handleReferenceDateChange": 0
|
|
2595
|
-
}],
|
|
2596
3035
|
"value": [{
|
|
2597
3036
|
"handleValueChange": 0
|
|
2598
3037
|
}]
|