@masmarino/gabarit 2.0.0 → 2.1.1
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 +131 -85
- package/accordion/README.md +56 -0
- package/alert/README.md +87 -0
- package/app-shell/README.md +133 -0
- package/auth/README.md +155 -0
- package/auth-activate/README.md +119 -0
- package/auth-login/README.md +113 -0
- package/auth-register/README.md +104 -0
- package/auth-reset-password/README.md +120 -0
- package/autocomplete/README.md +77 -0
- package/avatar/README.md +34 -0
- package/avatar-group/README.md +47 -0
- package/badge/README.md +177 -0
- package/bar-chart/README.md +44 -0
- package/breadcrumb/README.md +38 -0
- package/button/README.md +175 -0
- package/card/README.md +179 -0
- package/checkbox/README.md +50 -0
- package/checkbox-group/README.md +78 -0
- package/confirm-danger-modal/README.md +77 -0
- package/copy-button/README.md +90 -0
- package/copy-field/README.md +54 -0
- package/date-picker/README.md +84 -0
- package/description-list/README.md +63 -0
- package/dimension-card/README.md +39 -0
- package/disclosure/README.md +48 -0
- package/divider/README.md +31 -0
- package/drawer/README.md +49 -0
- package/empty-state/README.md +84 -0
- package/fesm2022/masmarino-gabarit-accordion.mjs +243 -0
- package/fesm2022/masmarino-gabarit-accordion.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-alert.mjs +208 -0
- package/fesm2022/masmarino-gabarit-alert.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-app-shell.mjs +378 -0
- package/fesm2022/masmarino-gabarit-app-shell.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-activate.mjs +415 -0
- package/fesm2022/masmarino-gabarit-auth-activate.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-login.mjs +467 -0
- package/fesm2022/masmarino-gabarit-auth-login.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-register.mjs +457 -0
- package/fesm2022/masmarino-gabarit-auth-register.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-reset-password.mjs +364 -0
- package/fesm2022/masmarino-gabarit-auth-reset-password.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth.mjs +844 -0
- package/fesm2022/masmarino-gabarit-auth.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-autocomplete.mjs +475 -0
- package/fesm2022/masmarino-gabarit-autocomplete.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-avatar-group.mjs +202 -0
- package/fesm2022/masmarino-gabarit-avatar-group.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-avatar.mjs +107 -0
- package/fesm2022/masmarino-gabarit-avatar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-badge.mjs +449 -0
- package/fesm2022/masmarino-gabarit-badge.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-bar-chart.mjs +408 -0
- package/fesm2022/masmarino-gabarit-bar-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-breadcrumb.mjs +59 -0
- package/fesm2022/masmarino-gabarit-breadcrumb.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-button.mjs +374 -0
- package/fesm2022/masmarino-gabarit-button.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-card.mjs +400 -0
- package/fesm2022/masmarino-gabarit-card.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-chart.mjs +1289 -0
- package/fesm2022/masmarino-gabarit-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-checkbox-group.mjs +335 -0
- package/fesm2022/masmarino-gabarit-checkbox-group.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-checkbox.mjs +170 -0
- package/fesm2022/masmarino-gabarit-checkbox.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-confirm-danger-modal.mjs +387 -0
- package/fesm2022/masmarino-gabarit-confirm-danger-modal.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-copy-button.mjs +407 -0
- package/fesm2022/masmarino-gabarit-copy-button.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-copy-field.mjs +229 -0
- package/fesm2022/masmarino-gabarit-copy-field.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-date-picker.mjs +1242 -0
- package/fesm2022/masmarino-gabarit-date-picker.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-description-list.mjs +127 -0
- package/fesm2022/masmarino-gabarit-description-list.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-dimension-card.mjs +162 -0
- package/fesm2022/masmarino-gabarit-dimension-card.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-disclosure.mjs +154 -0
- package/fesm2022/masmarino-gabarit-disclosure.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-divider.mjs +90 -0
- package/fesm2022/masmarino-gabarit-divider.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-docs.mjs +16 -2
- package/fesm2022/masmarino-gabarit-docs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-drawer.mjs +209 -0
- package/fesm2022/masmarino-gabarit-drawer.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-empty-state.mjs +226 -0
- package/fesm2022/masmarino-gabarit-empty-state.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-file-upload.mjs +335 -0
- package/fesm2022/masmarino-gabarit-file-upload.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-floating-panel.mjs +24 -0
- package/fesm2022/masmarino-gabarit-floating-panel.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-format.mjs +345 -0
- package/fesm2022/masmarino-gabarit-format.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-funnel-chart.mjs +247 -0
- package/fesm2022/masmarino-gabarit-funnel-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-gauge-bar.mjs +180 -0
- package/fesm2022/masmarino-gabarit-gauge-bar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-git-field.mjs +127 -0
- package/fesm2022/masmarino-gabarit-git-field.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-icon-marker.mjs +150 -0
- package/fesm2022/masmarino-gabarit-icon-marker.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-icon.mjs +308 -0
- package/fesm2022/masmarino-gabarit-icon.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-input.mjs +493 -0
- package/fesm2022/masmarino-gabarit-input.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-job-graph.mjs +216 -0
- package/fesm2022/masmarino-gabarit-job-graph.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-job-status.mjs +104 -0
- package/fesm2022/masmarino-gabarit-job-status.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-line-chart.mjs +574 -0
- package/fesm2022/masmarino-gabarit-line-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-list-card.mjs +320 -0
- package/fesm2022/masmarino-gabarit-list-card.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-list-row.mjs +58 -0
- package/fesm2022/masmarino-gabarit-list-row.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs +369 -0
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-menu.mjs +464 -0
- package/fesm2022/masmarino-gabarit-menu.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs +897 -0
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs +629 -0
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-modal.mjs +260 -0
- package/fesm2022/masmarino-gabarit-modal.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs +332 -0
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-notification-dot.mjs +119 -0
- package/fesm2022/masmarino-gabarit-notification-dot.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-page-header.mjs +78 -0
- package/fesm2022/masmarino-gabarit-page-header.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-page-layout.mjs +157 -0
- package/fesm2022/masmarino-gabarit-page-layout.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-pagination.mjs +415 -0
- package/fesm2022/masmarino-gabarit-pagination.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-panel.mjs +80 -0
- package/fesm2022/masmarino-gabarit-panel.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs +606 -0
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-pie-chart.mjs +317 -0
- package/fesm2022/masmarino-gabarit-pie-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-popover.mjs +142 -0
- package/fesm2022/masmarino-gabarit-popover.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-radio-group.mjs +202 -0
- package/fesm2022/masmarino-gabarit-radio-group.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-save-status.mjs +142 -0
- package/fesm2022/masmarino-gabarit-save-status.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-search-bar.mjs +576 -0
- package/fesm2022/masmarino-gabarit-search-bar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-secret-reveal.mjs +348 -0
- package/fesm2022/masmarino-gabarit-secret-reveal.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-segmented-control.mjs +272 -0
- package/fesm2022/masmarino-gabarit-segmented-control.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-select.mjs +512 -0
- package/fesm2022/masmarino-gabarit-select.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs +189 -0
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-skeleton.mjs +109 -0
- package/fesm2022/masmarino-gabarit-skeleton.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-slider.mjs +239 -0
- package/fesm2022/masmarino-gabarit-slider.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-sparkline.mjs +276 -0
- package/fesm2022/masmarino-gabarit-sparkline.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-spinner.mjs +86 -0
- package/fesm2022/masmarino-gabarit-spinner.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-stat-grid.mjs +139 -0
- package/fesm2022/masmarino-gabarit-stat-grid.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-stat-tile.mjs +312 -0
- package/fesm2022/masmarino-gabarit-stat-tile.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-stepper.mjs +219 -0
- package/fesm2022/masmarino-gabarit-stepper.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-switch.mjs +151 -0
- package/fesm2022/masmarino-gabarit-switch.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-table.mjs +206 -0
- package/fesm2022/masmarino-gabarit-table.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tabs.mjs +210 -0
- package/fesm2022/masmarino-gabarit-tabs.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tag-input.mjs +288 -0
- package/fesm2022/masmarino-gabarit-tag-input.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tag.mjs +155 -0
- package/fesm2022/masmarino-gabarit-tag.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-textarea.mjs +369 -0
- package/fesm2022/masmarino-gabarit-textarea.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-timeline-chart.mjs +521 -0
- package/fesm2022/masmarino-gabarit-timeline-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-toaster.mjs +220 -0
- package/fesm2022/masmarino-gabarit-toaster.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tooltip.mjs +185 -0
- package/fesm2022/masmarino-gabarit-tooltip.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tree.mjs +258 -0
- package/fesm2022/masmarino-gabarit-tree.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-user-chip.mjs +106 -0
- package/fesm2022/masmarino-gabarit-user-chip.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit.mjs +83 -24785
- package/fesm2022/masmarino-gabarit.mjs.map +1 -1
- package/file-upload/README.md +47 -0
- package/funnel-chart/README.md +39 -0
- package/gauge-bar/README.md +35 -0
- package/git-field/README.md +34 -0
- package/icon/README.md +52 -0
- package/icon-marker/README.md +37 -0
- package/input/README.md +120 -0
- package/job-graph/README.md +76 -0
- package/job-status/README.md +34 -0
- package/line-chart/README.md +52 -0
- package/list-card/README.md +144 -0
- package/list-row/README.md +72 -0
- package/list-toolbar/README.md +52 -0
- package/menu/README.md +90 -0
- package/mfa-enrollment/README.md +189 -0
- package/mfa-settings/README.md +154 -0
- package/modal/README.md +72 -0
- package/nav-tabs/README.md +106 -0
- package/notification-dot/README.md +43 -0
- package/package.json +329 -1
- package/page-header/README.md +56 -0
- package/page-layout/README.md +76 -0
- package/pagination/README.md +73 -0
- package/panel/README.md +56 -0
- package/passkey-settings/README.md +120 -0
- package/pie-chart/README.md +85 -0
- package/popover/README.md +62 -0
- package/radio-group/README.md +47 -0
- package/save-status/README.md +44 -0
- package/search-bar/README.md +84 -0
- package/secret-reveal/README.md +60 -0
- package/segmented-control/README.md +79 -0
- package/select/README.md +61 -0
- package/skeleton/README.md +49 -0
- package/skeleton-list/README.md +40 -0
- package/slider/README.md +44 -0
- package/sparkline/README.md +37 -0
- package/spinner/README.md +41 -0
- package/stat-grid/README.md +47 -0
- package/stat-tile/README.md +75 -0
- package/stepper/README.md +67 -0
- package/switch/README.md +51 -0
- package/table/README.md +75 -0
- package/tabs/README.md +34 -0
- package/tag/README.md +34 -0
- package/tag-input/README.md +45 -0
- package/textarea/README.md +76 -0
- package/timeline-chart/README.md +49 -0
- package/toaster/README.md +92 -0
- package/tooltip/README.md +50 -0
- package/tree/README.md +79 -0
- package/types/masmarino-gabarit-accordion.d.ts +54 -0
- package/types/masmarino-gabarit-alert.d.ts +65 -0
- package/types/masmarino-gabarit-app-shell.d.ts +102 -0
- package/types/masmarino-gabarit-auth-activate.d.ts +70 -0
- package/types/masmarino-gabarit-auth-login.d.ts +63 -0
- package/types/masmarino-gabarit-auth-register.d.ts +66 -0
- package/types/masmarino-gabarit-auth-reset-password.d.ts +53 -0
- package/types/masmarino-gabarit-auth.d.ts +543 -0
- package/types/masmarino-gabarit-autocomplete.d.ts +140 -0
- package/types/masmarino-gabarit-avatar-group.d.ts +60 -0
- package/types/masmarino-gabarit-avatar.d.ts +31 -0
- package/types/masmarino-gabarit-badge.d.ts +139 -0
- package/types/masmarino-gabarit-bar-chart.d.ts +111 -0
- package/types/masmarino-gabarit-breadcrumb.d.ts +12 -0
- package/types/masmarino-gabarit-button.d.ts +108 -0
- package/types/masmarino-gabarit-card.d.ts +102 -0
- package/types/masmarino-gabarit-chart.d.ts +361 -0
- package/types/masmarino-gabarit-checkbox-group.d.ts +113 -0
- package/types/masmarino-gabarit-checkbox.d.ts +49 -0
- package/types/masmarino-gabarit-confirm-danger-modal.d.ts +94 -0
- package/types/masmarino-gabarit-copy-button.d.ts +111 -0
- package/types/masmarino-gabarit-copy-field.d.ts +64 -0
- package/types/masmarino-gabarit-date-picker.d.ts +399 -0
- package/types/masmarino-gabarit-description-list.d.ts +40 -0
- package/types/masmarino-gabarit-dimension-card.d.ts +55 -0
- package/types/masmarino-gabarit-disclosure.d.ts +44 -0
- package/types/masmarino-gabarit-divider.d.ts +20 -0
- package/types/masmarino-gabarit-docs.d.ts +2 -1
- package/types/masmarino-gabarit-drawer.d.ts +51 -0
- package/types/masmarino-gabarit-empty-state.d.ts +67 -0
- package/types/masmarino-gabarit-file-upload.d.ts +95 -0
- package/types/masmarino-gabarit-floating-panel.d.ts +14 -0
- package/types/masmarino-gabarit-format.d.ts +54 -0
- package/types/masmarino-gabarit-funnel-chart.d.ts +78 -0
- package/types/masmarino-gabarit-gauge-bar.d.ts +54 -0
- package/types/masmarino-gabarit-git-field.d.ts +39 -0
- package/types/masmarino-gabarit-icon-marker.d.ts +47 -0
- package/types/masmarino-gabarit-icon.d.ts +23 -0
- package/types/masmarino-gabarit-input.d.ts +181 -0
- package/types/masmarino-gabarit-job-graph.d.ts +63 -0
- package/types/masmarino-gabarit-job-status.d.ts +20 -0
- package/types/masmarino-gabarit-line-chart.d.ts +153 -0
- package/types/masmarino-gabarit-list-card.d.ts +87 -0
- package/types/masmarino-gabarit-list-row.d.ts +14 -0
- package/types/masmarino-gabarit-list-toolbar.d.ts +100 -0
- package/types/masmarino-gabarit-menu.d.ts +93 -0
- package/types/masmarino-gabarit-mfa-enrollment.d.ts +142 -0
- package/types/masmarino-gabarit-mfa-settings.d.ts +89 -0
- package/types/masmarino-gabarit-modal.d.ts +60 -0
- package/types/masmarino-gabarit-nav-tabs.d.ts +65 -0
- package/types/masmarino-gabarit-notification-dot.d.ts +34 -0
- package/types/masmarino-gabarit-page-header.d.ts +20 -0
- package/types/masmarino-gabarit-page-layout.d.ts +46 -0
- package/types/masmarino-gabarit-pagination.d.ts +109 -0
- package/types/masmarino-gabarit-panel.d.ts +21 -0
- package/types/masmarino-gabarit-passkey-settings.d.ts +94 -0
- package/types/masmarino-gabarit-pie-chart.d.ts +94 -0
- package/types/masmarino-gabarit-popover.d.ts +33 -0
- package/types/masmarino-gabarit-radio-group.d.ts +66 -0
- package/types/masmarino-gabarit-save-status.d.ts +39 -0
- package/types/masmarino-gabarit-search-bar.d.ts +183 -0
- package/types/masmarino-gabarit-secret-reveal.d.ts +95 -0
- package/types/masmarino-gabarit-segmented-control.d.ts +76 -0
- package/types/masmarino-gabarit-select.d.ts +146 -0
- package/types/masmarino-gabarit-skeleton-list.d.ts +54 -0
- package/types/masmarino-gabarit-skeleton.d.ts +26 -0
- package/types/masmarino-gabarit-slider.d.ts +73 -0
- package/types/masmarino-gabarit-sparkline.d.ts +70 -0
- package/types/masmarino-gabarit-spinner.d.ts +20 -0
- package/types/masmarino-gabarit-stat-grid.d.ts +39 -0
- package/types/masmarino-gabarit-stat-tile.d.ts +79 -0
- package/types/masmarino-gabarit-stepper.d.ts +67 -0
- package/types/masmarino-gabarit-switch.d.ts +42 -0
- package/types/masmarino-gabarit-table.d.ts +60 -0
- package/types/masmarino-gabarit-tabs.d.ts +40 -0
- package/types/masmarino-gabarit-tag-input.d.ts +78 -0
- package/types/masmarino-gabarit-tag.d.ts +35 -0
- package/types/masmarino-gabarit-textarea.d.ts +109 -0
- package/types/masmarino-gabarit-timeline-chart.d.ts +145 -0
- package/types/masmarino-gabarit-toaster.d.ts +62 -0
- package/types/masmarino-gabarit-tooltip.d.ts +39 -0
- package/types/masmarino-gabarit-tree.d.ts +71 -0
- package/types/masmarino-gabarit-user-chip.d.ts +26 -0
- package/types/masmarino-gabarit.d.ts +83 -6599
- package/user-chip/README.md +42 -0
|
@@ -0,0 +1,1242 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, ElementRef, Injector, afterNextRender, booleanAttribute, computed, forwardRef, inject, input, signal } from "@angular/core";
|
|
3
|
+
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
4
|
+
import { Icon } from "@masmarino/gabarit/icon";
|
|
5
|
+
import { floatingPanelAnchor, followPageScroll } from "@masmarino/gabarit/floating-panel";
|
|
6
|
+
function isSameDay(a, b) {
|
|
7
|
+
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
8
|
+
}
|
|
9
|
+
function addMonths(date, delta) {
|
|
10
|
+
const day = date.getDate();
|
|
11
|
+
const firstOfTarget = new Date(date.getFullYear(), date.getMonth() + delta, 1);
|
|
12
|
+
const daysInTarget = new Date(firstOfTarget.getFullYear(), firstOfTarget.getMonth() + 1, 0).getDate();
|
|
13
|
+
return new Date(firstOfTarget.getFullYear(), firstOfTarget.getMonth(), Math.min(day, daysInTarget));
|
|
14
|
+
}
|
|
15
|
+
function addYears(date, delta) {
|
|
16
|
+
return addMonths(date, delta * 12);
|
|
17
|
+
}
|
|
18
|
+
function shiftDays(date, delta) {
|
|
19
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate() + delta);
|
|
20
|
+
}
|
|
21
|
+
function startOfWeek(date, weekStartsOn) {
|
|
22
|
+
const diff = (date.getDay() - weekStartsOn + 7) % 7;
|
|
23
|
+
const result = new Date(date.getFullYear(), date.getMonth(), date.getDate());
|
|
24
|
+
result.setDate(result.getDate() - diff);
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
function endOfWeek(date, weekStartsOn) {
|
|
28
|
+
const start = startOfWeek(date, weekStartsOn);
|
|
29
|
+
start.setDate(start.getDate() + 6);
|
|
30
|
+
return start;
|
|
31
|
+
}
|
|
32
|
+
function buildCalendarGrid(year, month, weekStartsOn) {
|
|
33
|
+
const gridStart = startOfWeek(new Date(year, month, 1), weekStartsOn);
|
|
34
|
+
const today = /* @__PURE__ */ new Date();
|
|
35
|
+
const days = [];
|
|
36
|
+
for (let i = 0; i < 42; i++) {
|
|
37
|
+
const date = new Date(gridStart.getFullYear(), gridStart.getMonth(), gridStart.getDate() + i);
|
|
38
|
+
days.push({
|
|
39
|
+
date,
|
|
40
|
+
inCurrentMonth: date.getMonth() === month,
|
|
41
|
+
isToday: isSameDay(date, today)
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return days;
|
|
45
|
+
}
|
|
46
|
+
function weekdayLabels(locale, weekStartsOn) {
|
|
47
|
+
const formatter = new Intl.DateTimeFormat(locale, { weekday: "short" });
|
|
48
|
+
const reference = new Date(2024, 0, 7 + weekStartsOn);
|
|
49
|
+
return Array.from({ length: 7 }, (_, i) => {
|
|
50
|
+
const date = new Date(reference.getFullYear(), reference.getMonth(), reference.getDate() + i);
|
|
51
|
+
return formatter.format(date);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
var CalendarPanel = class {
|
|
55
|
+
deps;
|
|
56
|
+
open = signal(false, ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
57
|
+
anchorDate = signal(/* @__PURE__ */ new Date(), ...ngDevMode ? [{ debugName: "anchorDate" }] : /* istanbul ignore next */ []);
|
|
58
|
+
focusedDate = signal(/* @__PURE__ */ new Date(), ...ngDevMode ? [{ debugName: "focusedDate" }] : /* istanbul ignore next */ []);
|
|
59
|
+
panelStyle = signal(null, ...ngDevMode ? [{ debugName: "panelStyle" }] : /* istanbul ignore next */ []);
|
|
60
|
+
monthViews = computed(() => {
|
|
61
|
+
const anchor = this.anchorDate();
|
|
62
|
+
const count = this.deps.visibleMonths();
|
|
63
|
+
const formatter = new Intl.DateTimeFormat(this.deps.locale(), {
|
|
64
|
+
month: "long",
|
|
65
|
+
year: "numeric"
|
|
66
|
+
});
|
|
67
|
+
const views = Array.from({ length: count }, (_, i) => {
|
|
68
|
+
const monthDate = new Date(anchor.getFullYear(), anchor.getMonth() + i, 1);
|
|
69
|
+
const year = monthDate.getFullYear();
|
|
70
|
+
const month = monthDate.getMonth();
|
|
71
|
+
const days = buildCalendarGrid(year, month, this.deps.weekStartsOn());
|
|
72
|
+
const weeks = [];
|
|
73
|
+
for (let d = 0; d < days.length; d += 7) weeks.push(days.slice(d, d + 7));
|
|
74
|
+
return {
|
|
75
|
+
year,
|
|
76
|
+
month,
|
|
77
|
+
label: formatter.format(monthDate),
|
|
78
|
+
weeks
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
const neededWeeks = views.map((view) => {
|
|
82
|
+
let last = view.weeks.length;
|
|
83
|
+
while (last > 1 && view.weeks[last - 1].every((day) => !day.inCurrentMonth)) last--;
|
|
84
|
+
return last;
|
|
85
|
+
});
|
|
86
|
+
const sharedWeeks = Math.max(...neededWeeks);
|
|
87
|
+
return views.map((view) => ({
|
|
88
|
+
...view,
|
|
89
|
+
weeks: view.weeks.slice(0, sharedWeeks)
|
|
90
|
+
}));
|
|
91
|
+
}, ...ngDevMode ? [{ debugName: "monthViews" }] : /* istanbul ignore next */ []);
|
|
92
|
+
panelLabel = computed(() => {
|
|
93
|
+
const views = this.monthViews();
|
|
94
|
+
return views.length === 1 ? views[0].label : `${views[0].label} – ${views[views.length - 1].label}`;
|
|
95
|
+
}, ...ngDevMode ? [{ debugName: "panelLabel" }] : /* istanbul ignore next */ []);
|
|
96
|
+
weekdayLabels = computed(() => weekdayLabels(this.deps.locale(), this.deps.weekStartsOn()), ...ngDevMode ? [{ debugName: "weekdayLabels" }] : /* istanbul ignore next */ []);
|
|
97
|
+
monthOptions = computed(() => {
|
|
98
|
+
const formatter = new Intl.DateTimeFormat(this.deps.locale(), { month: "long" });
|
|
99
|
+
return Array.from({ length: 12 }, (_, i) => ({
|
|
100
|
+
value: i,
|
|
101
|
+
label: formatter.format(new Date(2024, i, 1))
|
|
102
|
+
}));
|
|
103
|
+
}, ...ngDevMode ? [{ debugName: "monthOptions" }] : /* istanbul ignore next */ []);
|
|
104
|
+
yearOptions = computed(() => {
|
|
105
|
+
const min = this.deps.minYear();
|
|
106
|
+
const max = this.deps.maxYear();
|
|
107
|
+
return Array.from({ length: max - min + 1 }, (_, i) => min + i);
|
|
108
|
+
}, ...ngDevMode ? [{ debugName: "yearOptions" }] : /* istanbul ignore next */ []);
|
|
109
|
+
constructor(deps) {
|
|
110
|
+
this.deps = deps;
|
|
111
|
+
}
|
|
112
|
+
cellId(date) {
|
|
113
|
+
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
|
|
114
|
+
}
|
|
115
|
+
isFocused(date) {
|
|
116
|
+
return isSameDay(this.focusedDate(), date);
|
|
117
|
+
}
|
|
118
|
+
toggle(onOpen) {
|
|
119
|
+
this.open.update((value) => !value);
|
|
120
|
+
if (this.open()) {
|
|
121
|
+
const target = onOpen();
|
|
122
|
+
this.focusedDate.set(target);
|
|
123
|
+
this.anchorDate.set(new Date(target.getFullYear(), target.getMonth(), 1));
|
|
124
|
+
this.updatePanelPosition();
|
|
125
|
+
this.focusCellAfterRender();
|
|
126
|
+
} else this.deps.onTouched();
|
|
127
|
+
}
|
|
128
|
+
close(returnFocus) {
|
|
129
|
+
if (!this.open()) return;
|
|
130
|
+
this.open.set(false);
|
|
131
|
+
this.deps.onTouched();
|
|
132
|
+
if (returnFocus) this.trigger()?.focus();
|
|
133
|
+
}
|
|
134
|
+
shiftMonth(delta) {
|
|
135
|
+
this.anchorDate.set(addMonths(this.anchorDate(), delta));
|
|
136
|
+
this.focusedDate.set(addMonths(this.focusedDate(), delta));
|
|
137
|
+
this.updatePanelPosition();
|
|
138
|
+
this.focusCellAfterRender();
|
|
139
|
+
}
|
|
140
|
+
onMonthSelect(value) {
|
|
141
|
+
this.setAnchorMonth(this.anchorDate().getFullYear(), Number(value));
|
|
142
|
+
}
|
|
143
|
+
onYearSelect(value) {
|
|
144
|
+
this.setAnchorMonth(Number(value), this.anchorDate().getMonth());
|
|
145
|
+
}
|
|
146
|
+
setAnchorMonth(year, month) {
|
|
147
|
+
const dayOfMonth = this.focusedDate().getDate();
|
|
148
|
+
const daysInTarget = new Date(year, month + 1, 0).getDate();
|
|
149
|
+
this.anchorDate.set(new Date(year, month, 1));
|
|
150
|
+
this.focusedDate.set(new Date(year, month, Math.min(dayOfMonth, daysInTarget)));
|
|
151
|
+
this.updatePanelPosition();
|
|
152
|
+
this.focusCellAfterRender();
|
|
153
|
+
}
|
|
154
|
+
handleNavigationKeydown(event) {
|
|
155
|
+
const current = this.focusedDate();
|
|
156
|
+
if (event.key === "PageDown" || event.key === "PageUp") {
|
|
157
|
+
event.preventDefault();
|
|
158
|
+
const delta = event.key === "PageDown" ? 1 : -1;
|
|
159
|
+
if (event.shiftKey) {
|
|
160
|
+
this.anchorDate.set(addYears(this.anchorDate(), delta));
|
|
161
|
+
this.focusedDate.set(addYears(current, delta));
|
|
162
|
+
} else {
|
|
163
|
+
this.anchorDate.set(addMonths(this.anchorDate(), delta));
|
|
164
|
+
this.focusedDate.set(addMonths(current, delta));
|
|
165
|
+
}
|
|
166
|
+
this.updatePanelPosition();
|
|
167
|
+
this.focusCellAfterRender();
|
|
168
|
+
return "month-changed";
|
|
169
|
+
}
|
|
170
|
+
const next = this.nextFocusedDate(current, event);
|
|
171
|
+
if (next === null) return "unhandled";
|
|
172
|
+
event.preventDefault();
|
|
173
|
+
this.ensureVisible(next);
|
|
174
|
+
this.focusedDate.set(next);
|
|
175
|
+
this.focusCellAfterRender();
|
|
176
|
+
return "day-changed";
|
|
177
|
+
}
|
|
178
|
+
nextFocusedDate(current, event) {
|
|
179
|
+
switch (event.key) {
|
|
180
|
+
case "ArrowRight": return shiftDays(current, 1);
|
|
181
|
+
case "ArrowLeft": return shiftDays(current, -1);
|
|
182
|
+
case "ArrowDown": return shiftDays(current, 7);
|
|
183
|
+
case "ArrowUp": return shiftDays(current, -7);
|
|
184
|
+
case "Home": return startOfWeek(current, this.deps.weekStartsOn());
|
|
185
|
+
case "End": return endOfWeek(current, this.deps.weekStartsOn());
|
|
186
|
+
default: return null;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
ensureVisible(date) {
|
|
190
|
+
const anchor = this.anchorDate();
|
|
191
|
+
const visibleMonths = this.deps.visibleMonths();
|
|
192
|
+
const monthsDiff = (date.getFullYear() - anchor.getFullYear()) * 12 + (date.getMonth() - anchor.getMonth());
|
|
193
|
+
if (monthsDiff < 0) this.anchorDate.set(new Date(date.getFullYear(), date.getMonth(), 1));
|
|
194
|
+
else if (monthsDiff >= visibleMonths) this.anchorDate.set(addMonths(anchor, monthsDiff - visibleMonths + 1));
|
|
195
|
+
}
|
|
196
|
+
onEscape(event) {
|
|
197
|
+
if (event.key === "Escape" && this.open()) {
|
|
198
|
+
event.preventDefault();
|
|
199
|
+
event.stopPropagation();
|
|
200
|
+
this.close(true);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
handleClickOutside(event) {
|
|
204
|
+
if (this.open() && !this.deps.elementRef.nativeElement.contains(event.target)) this.close(false);
|
|
205
|
+
}
|
|
206
|
+
updatePanelPosition() {
|
|
207
|
+
const anchor = floatingPanelAnchor(this.open(), this.trigger());
|
|
208
|
+
if (anchor) this.panelStyle.set({
|
|
209
|
+
top: `${anchor.bottom}px`,
|
|
210
|
+
left: `${anchor.left}px`
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
trigger() {
|
|
214
|
+
return this.deps.elementRef.nativeElement.querySelector(this.deps.triggerSelector);
|
|
215
|
+
}
|
|
216
|
+
focusCellAfterRender() {
|
|
217
|
+
afterNextRender(() => {
|
|
218
|
+
const id = this.cellId(this.focusedDate());
|
|
219
|
+
this.deps.elementRef.nativeElement.querySelector(`[data-date="${id}"]`)?.focus();
|
|
220
|
+
}, { injector: this.deps.injector });
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
let nextDatePickerId = 0;
|
|
224
|
+
const CURRENT_YEAR$1 = (/* @__PURE__ */ new Date()).getFullYear();
|
|
225
|
+
var DatePicker = class DatePicker {
|
|
226
|
+
elementRef = inject(ElementRef);
|
|
227
|
+
injector = inject(Injector);
|
|
228
|
+
id = input(`gbt-date-picker-${++nextDatePickerId}`, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
229
|
+
label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
230
|
+
placeholder = input("Select a date…", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
231
|
+
locale = input("en-US", ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
232
|
+
weekStartsOn = input(1, ...ngDevMode ? [{ debugName: "weekStartsOn" }] : /* istanbul ignore next */ []);
|
|
233
|
+
disabled = input(false, {
|
|
234
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
235
|
+
transform: booleanAttribute
|
|
236
|
+
});
|
|
237
|
+
required = input(false, {
|
|
238
|
+
...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
|
|
239
|
+
transform: booleanAttribute
|
|
240
|
+
});
|
|
241
|
+
errorMessage = input(null, ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
|
|
242
|
+
previousMonthLabel = input("Previous month", ...ngDevMode ? [{ debugName: "previousMonthLabel" }] : /* istanbul ignore next */ []);
|
|
243
|
+
nextMonthLabel = input("Next month", ...ngDevMode ? [{ debugName: "nextMonthLabel" }] : /* istanbul ignore next */ []);
|
|
244
|
+
clearable = input(false, {
|
|
245
|
+
...ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {},
|
|
246
|
+
transform: booleanAttribute
|
|
247
|
+
});
|
|
248
|
+
clearLabel = input("Clear date", ...ngDevMode ? [{ debugName: "clearLabel" }] : /* istanbul ignore next */ []);
|
|
249
|
+
visibleMonths = input(1, ...ngDevMode ? [{ debugName: "visibleMonths" }] : /* istanbul ignore next */ []);
|
|
250
|
+
monthSelectLabel = input("Month", ...ngDevMode ? [{ debugName: "monthSelectLabel" }] : /* istanbul ignore next */ []);
|
|
251
|
+
yearSelectLabel = input("Year", ...ngDevMode ? [{ debugName: "yearSelectLabel" }] : /* istanbul ignore next */ []);
|
|
252
|
+
minYear = input(CURRENT_YEAR$1 - 100, ...ngDevMode ? [{ debugName: "minYear" }] : /* istanbul ignore next */ []);
|
|
253
|
+
maxYear = input(CURRENT_YEAR$1 + 10, ...ngDevMode ? [{ debugName: "maxYear" }] : /* istanbul ignore next */ []);
|
|
254
|
+
panel = new CalendarPanel({
|
|
255
|
+
elementRef: this.elementRef,
|
|
256
|
+
injector: this.injector,
|
|
257
|
+
triggerSelector: ".gbt-date-picker__trigger",
|
|
258
|
+
locale: () => this.locale(),
|
|
259
|
+
weekStartsOn: () => this.weekStartsOn(),
|
|
260
|
+
visibleMonths: () => this.visibleMonths(),
|
|
261
|
+
minYear: () => this.minYear(),
|
|
262
|
+
maxYear: () => this.maxYear(),
|
|
263
|
+
onTouched: () => this.onTouched()
|
|
264
|
+
});
|
|
265
|
+
open = this.panel.open;
|
|
266
|
+
selected = signal(null, ...ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []);
|
|
267
|
+
focusedDate = this.panel.focusedDate;
|
|
268
|
+
anchorDate = this.panel.anchorDate;
|
|
269
|
+
panelStyle = this.panel.panelStyle;
|
|
270
|
+
formDisabled = signal(false, ...ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []);
|
|
271
|
+
onChange = () => {};
|
|
272
|
+
onTouched = () => {};
|
|
273
|
+
isDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
274
|
+
showClear = computed(() => this.clearable() && this.selected() !== null && !this.isDisabled(), ...ngDevMode ? [{ debugName: "showClear" }] : /* istanbul ignore next */ []);
|
|
275
|
+
monthViews = this.panel.monthViews;
|
|
276
|
+
panelLabel = this.panel.panelLabel;
|
|
277
|
+
weekdayLabels = this.panel.weekdayLabels;
|
|
278
|
+
monthOptions = this.panel.monthOptions;
|
|
279
|
+
yearOptions = this.panel.yearOptions;
|
|
280
|
+
triggerLabel = computed(() => {
|
|
281
|
+
const value = this.selected();
|
|
282
|
+
return value ? new Intl.DateTimeFormat(this.locale(), { dateStyle: "medium" }).format(value) : "";
|
|
283
|
+
}, ...ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []);
|
|
284
|
+
writeValue(value) {
|
|
285
|
+
this.selected.set(value);
|
|
286
|
+
if (value) {
|
|
287
|
+
this.focusedDate.set(value);
|
|
288
|
+
this.anchorDate.set(new Date(value.getFullYear(), value.getMonth(), 1));
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
registerOnChange(fn) {
|
|
292
|
+
this.onChange = fn;
|
|
293
|
+
}
|
|
294
|
+
registerOnTouched(fn) {
|
|
295
|
+
this.onTouched = fn;
|
|
296
|
+
}
|
|
297
|
+
setDisabledState(isDisabled) {
|
|
298
|
+
this.formDisabled.set(isDisabled);
|
|
299
|
+
}
|
|
300
|
+
isSelected(date) {
|
|
301
|
+
const value = this.selected();
|
|
302
|
+
return value !== null && isSameDay(value, date);
|
|
303
|
+
}
|
|
304
|
+
isFocused(date) {
|
|
305
|
+
return this.panel.isFocused(date);
|
|
306
|
+
}
|
|
307
|
+
cellId(date) {
|
|
308
|
+
return this.panel.cellId(date);
|
|
309
|
+
}
|
|
310
|
+
toggleOpen() {
|
|
311
|
+
if (this.isDisabled()) return;
|
|
312
|
+
this.panel.toggle(() => this.selected() ?? /* @__PURE__ */ new Date());
|
|
313
|
+
}
|
|
314
|
+
close(returnFocus) {
|
|
315
|
+
this.panel.close(returnFocus);
|
|
316
|
+
}
|
|
317
|
+
clear(event) {
|
|
318
|
+
event.stopPropagation();
|
|
319
|
+
if (this.isDisabled()) return;
|
|
320
|
+
this.selected.set(null);
|
|
321
|
+
this.onChange(null);
|
|
322
|
+
this.onTouched();
|
|
323
|
+
this.panel.close(false);
|
|
324
|
+
}
|
|
325
|
+
selectDay(day) {
|
|
326
|
+
if (this.isDisabled()) return;
|
|
327
|
+
this.selected.set(day.date);
|
|
328
|
+
this.focusedDate.set(day.date);
|
|
329
|
+
this.panel.ensureVisible(day.date);
|
|
330
|
+
this.onChange(day.date);
|
|
331
|
+
this.panel.close(true);
|
|
332
|
+
}
|
|
333
|
+
shiftMonth(delta) {
|
|
334
|
+
this.panel.shiftMonth(delta);
|
|
335
|
+
}
|
|
336
|
+
onMonthSelect(value) {
|
|
337
|
+
this.panel.onMonthSelect(value);
|
|
338
|
+
}
|
|
339
|
+
onYearSelect(value) {
|
|
340
|
+
this.panel.onYearSelect(value);
|
|
341
|
+
}
|
|
342
|
+
onGridKeydown(event) {
|
|
343
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
344
|
+
event.preventDefault();
|
|
345
|
+
const current = this.focusedDate();
|
|
346
|
+
this.selectDay({
|
|
347
|
+
date: current,
|
|
348
|
+
inCurrentMonth: true,
|
|
349
|
+
isToday: isSameDay(current, /* @__PURE__ */ new Date())
|
|
350
|
+
});
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
this.panel.handleNavigationKeydown(event);
|
|
354
|
+
}
|
|
355
|
+
onEscape(event) {
|
|
356
|
+
this.panel.onEscape(event);
|
|
357
|
+
}
|
|
358
|
+
handleClickOutside(event) {
|
|
359
|
+
this.panel.handleClickOutside(event);
|
|
360
|
+
}
|
|
361
|
+
constructor() {
|
|
362
|
+
followPageScroll(() => this.updatePanelPosition());
|
|
363
|
+
}
|
|
364
|
+
updatePanelPosition() {
|
|
365
|
+
this.panel.updatePanelPosition();
|
|
366
|
+
}
|
|
367
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
368
|
+
minVersion: "12.0.0",
|
|
369
|
+
version: "22.2.0",
|
|
370
|
+
ngImport: i0,
|
|
371
|
+
type: DatePicker,
|
|
372
|
+
deps: [],
|
|
373
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
374
|
+
});
|
|
375
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
376
|
+
minVersion: "17.0.0",
|
|
377
|
+
version: "22.2.0",
|
|
378
|
+
type: DatePicker,
|
|
379
|
+
isStandalone: true,
|
|
380
|
+
selector: "gbt-date-picker",
|
|
381
|
+
inputs: {
|
|
382
|
+
id: {
|
|
383
|
+
classPropertyName: "id",
|
|
384
|
+
publicName: "id",
|
|
385
|
+
isSignal: true,
|
|
386
|
+
isRequired: false,
|
|
387
|
+
transformFunction: null
|
|
388
|
+
},
|
|
389
|
+
label: {
|
|
390
|
+
classPropertyName: "label",
|
|
391
|
+
publicName: "label",
|
|
392
|
+
isSignal: true,
|
|
393
|
+
isRequired: false,
|
|
394
|
+
transformFunction: null
|
|
395
|
+
},
|
|
396
|
+
placeholder: {
|
|
397
|
+
classPropertyName: "placeholder",
|
|
398
|
+
publicName: "placeholder",
|
|
399
|
+
isSignal: true,
|
|
400
|
+
isRequired: false,
|
|
401
|
+
transformFunction: null
|
|
402
|
+
},
|
|
403
|
+
locale: {
|
|
404
|
+
classPropertyName: "locale",
|
|
405
|
+
publicName: "locale",
|
|
406
|
+
isSignal: true,
|
|
407
|
+
isRequired: false,
|
|
408
|
+
transformFunction: null
|
|
409
|
+
},
|
|
410
|
+
weekStartsOn: {
|
|
411
|
+
classPropertyName: "weekStartsOn",
|
|
412
|
+
publicName: "weekStartsOn",
|
|
413
|
+
isSignal: true,
|
|
414
|
+
isRequired: false,
|
|
415
|
+
transformFunction: null
|
|
416
|
+
},
|
|
417
|
+
disabled: {
|
|
418
|
+
classPropertyName: "disabled",
|
|
419
|
+
publicName: "disabled",
|
|
420
|
+
isSignal: true,
|
|
421
|
+
isRequired: false,
|
|
422
|
+
transformFunction: null
|
|
423
|
+
},
|
|
424
|
+
required: {
|
|
425
|
+
classPropertyName: "required",
|
|
426
|
+
publicName: "required",
|
|
427
|
+
isSignal: true,
|
|
428
|
+
isRequired: false,
|
|
429
|
+
transformFunction: null
|
|
430
|
+
},
|
|
431
|
+
errorMessage: {
|
|
432
|
+
classPropertyName: "errorMessage",
|
|
433
|
+
publicName: "errorMessage",
|
|
434
|
+
isSignal: true,
|
|
435
|
+
isRequired: false,
|
|
436
|
+
transformFunction: null
|
|
437
|
+
},
|
|
438
|
+
previousMonthLabel: {
|
|
439
|
+
classPropertyName: "previousMonthLabel",
|
|
440
|
+
publicName: "previousMonthLabel",
|
|
441
|
+
isSignal: true,
|
|
442
|
+
isRequired: false,
|
|
443
|
+
transformFunction: null
|
|
444
|
+
},
|
|
445
|
+
nextMonthLabel: {
|
|
446
|
+
classPropertyName: "nextMonthLabel",
|
|
447
|
+
publicName: "nextMonthLabel",
|
|
448
|
+
isSignal: true,
|
|
449
|
+
isRequired: false,
|
|
450
|
+
transformFunction: null
|
|
451
|
+
},
|
|
452
|
+
clearable: {
|
|
453
|
+
classPropertyName: "clearable",
|
|
454
|
+
publicName: "clearable",
|
|
455
|
+
isSignal: true,
|
|
456
|
+
isRequired: false,
|
|
457
|
+
transformFunction: null
|
|
458
|
+
},
|
|
459
|
+
clearLabel: {
|
|
460
|
+
classPropertyName: "clearLabel",
|
|
461
|
+
publicName: "clearLabel",
|
|
462
|
+
isSignal: true,
|
|
463
|
+
isRequired: false,
|
|
464
|
+
transformFunction: null
|
|
465
|
+
},
|
|
466
|
+
visibleMonths: {
|
|
467
|
+
classPropertyName: "visibleMonths",
|
|
468
|
+
publicName: "visibleMonths",
|
|
469
|
+
isSignal: true,
|
|
470
|
+
isRequired: false,
|
|
471
|
+
transformFunction: null
|
|
472
|
+
},
|
|
473
|
+
monthSelectLabel: {
|
|
474
|
+
classPropertyName: "monthSelectLabel",
|
|
475
|
+
publicName: "monthSelectLabel",
|
|
476
|
+
isSignal: true,
|
|
477
|
+
isRequired: false,
|
|
478
|
+
transformFunction: null
|
|
479
|
+
},
|
|
480
|
+
yearSelectLabel: {
|
|
481
|
+
classPropertyName: "yearSelectLabel",
|
|
482
|
+
publicName: "yearSelectLabel",
|
|
483
|
+
isSignal: true,
|
|
484
|
+
isRequired: false,
|
|
485
|
+
transformFunction: null
|
|
486
|
+
},
|
|
487
|
+
minYear: {
|
|
488
|
+
classPropertyName: "minYear",
|
|
489
|
+
publicName: "minYear",
|
|
490
|
+
isSignal: true,
|
|
491
|
+
isRequired: false,
|
|
492
|
+
transformFunction: null
|
|
493
|
+
},
|
|
494
|
+
maxYear: {
|
|
495
|
+
classPropertyName: "maxYear",
|
|
496
|
+
publicName: "maxYear",
|
|
497
|
+
isSignal: true,
|
|
498
|
+
isRequired: false,
|
|
499
|
+
transformFunction: null
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
host: { listeners: {
|
|
503
|
+
"document:click": "handleClickOutside($event)",
|
|
504
|
+
"keydown": "onEscape($event)",
|
|
505
|
+
"window:resize": "updatePanelPosition()"
|
|
506
|
+
} },
|
|
507
|
+
providers: [{
|
|
508
|
+
provide: NG_VALUE_ACCESSOR,
|
|
509
|
+
useExisting: forwardRef(() => DatePicker),
|
|
510
|
+
multi: true
|
|
511
|
+
}],
|
|
512
|
+
ngImport: i0,
|
|
513
|
+
template: "<div class=\"gbt-date-picker\">\n @if (label()) {\n <label [for]=\"id()\" class=\"gbt-date-picker__label\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n <div class=\"gbt-date-picker__field\">\n <button\n type=\"button\"\n [id]=\"id()\"\n class=\"gbt-date-picker__trigger\"\n [class.gbt-date-picker__trigger--open]=\"open()\"\n [disabled]=\"isDisabled()\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (click)=\"toggleOpen()\"\n >\n <span\n class=\"gbt-date-picker__trigger-label\"\n [class.gbt-date-picker__trigger-label--placeholder]=\"!triggerLabel()\"\n >\n {{ triggerLabel() || placeholder() }}\n </span>\n </button>\n @if (showClear()) {\n <button\n type=\"button\"\n class=\"gbt-date-picker__clear\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear($event)\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n } @else {\n <gbt-icon name=\"calendar\" class=\"gbt-date-picker__icon\" aria-hidden=\"true\" />\n }\n </div>\n @if (open() && panelStyle(); as pos) {\n <div\n class=\"gbt-date-picker__panel\"\n role=\"dialog\"\n aria-modal=\"false\"\n [attr.aria-label]=\"panelLabel()\"\n [style.top]=\"pos.top\"\n [style.left]=\"pos.left\"\n >\n <div class=\"gbt-date-picker__nav\">\n <button\n type=\"button\"\n class=\"gbt-date-picker__nav-button\"\n [attr.aria-label]=\"previousMonthLabel()\"\n (click)=\"shiftMonth(-1)\"\n >\n <gbt-icon name=\"chevron-left\" aria-hidden=\"true\" />\n </button>\n <div class=\"gbt-date-picker__headings\">\n @for (view of monthViews(); track view.year + '-' + view.month; let i = $index) {\n <div class=\"gbt-date-picker__month-heading\">\n @if (i === 0) {\n <select\n #monthSelect\n class=\"gbt-date-picker__select\"\n [attr.aria-label]=\"monthSelectLabel()\"\n (change)=\"onMonthSelect(monthSelect.value)\"\n >\n @for (opt of monthOptions(); track opt.value) {\n <option [value]=\"opt.value\" [selected]=\"opt.value === anchorDate().getMonth()\">\n {{ opt.label }}\n </option>\n }\n </select>\n <select\n #yearSelect\n class=\"gbt-date-picker__select\"\n [attr.aria-label]=\"yearSelectLabel()\"\n (change)=\"onYearSelect(yearSelect.value)\"\n >\n @for (year of yearOptions(); track year) {\n <option [value]=\"year\" [selected]=\"year === anchorDate().getFullYear()\">\n {{ year }}\n </option>\n }\n </select>\n } @else {\n <span class=\"gbt-date-picker__month-label\">{{ view.label }}</span>\n }\n </div>\n }\n </div>\n <button\n type=\"button\"\n class=\"gbt-date-picker__nav-button\"\n [attr.aria-label]=\"nextMonthLabel()\"\n (click)=\"shiftMonth(1)\"\n >\n <gbt-icon name=\"chevron-right\" aria-hidden=\"true\" />\n </button>\n </div>\n <div class=\"gbt-date-picker__months\">\n @for (view of monthViews(); track view.year + '-' + view.month) {\n <div class=\"gbt-date-picker__month\">\n <div\n class=\"gbt-date-picker__grid\"\n role=\"grid\"\n tabindex=\"-1\"\n [attr.aria-label]=\"view.label\"\n (keydown)=\"onGridKeydown($event)\"\n >\n <div class=\"gbt-date-picker__row gbt-date-picker__row--head\" role=\"row\">\n @for (wd of weekdayLabels(); track $index) {\n <span role=\"columnheader\" class=\"gbt-date-picker__weekday\">{{ wd }}</span>\n }\n </div>\n @for (week of view.weeks; track $index) {\n <div class=\"gbt-date-picker__row\" role=\"row\">\n @for (day of week; track day.date.getTime()) {\n @if (day.inCurrentMonth) {\n <button\n type=\"button\"\n role=\"gridcell\"\n class=\"gbt-date-picker__day\"\n [class.gbt-date-picker__day--today]=\"day.isToday\"\n [class.gbt-date-picker__day--selected]=\"isSelected(day.date)\"\n [attr.data-date]=\"cellId(day.date)\"\n [attr.aria-selected]=\"isSelected(day.date)\"\n [attr.aria-current]=\"day.isToday ? 'date' : null\"\n [tabIndex]=\"isFocused(day.date) ? 0 : -1\"\n (click)=\"selectDay(day)\"\n >\n {{ day.date.getDate() }}\n </button>\n } @else {\n <span\n role=\"gridcell\"\n class=\"gbt-date-picker__day gbt-date-picker__day--empty\"\n ></span>\n }\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n </div>\n }\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-date-picker__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
|
|
514
|
+
styles: [".gbt-date-picker{display:inline-flex;flex-direction:column;gap:.375rem}.gbt-date-picker__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-date-picker__error{margin:0;font-size:.75rem;color:var(--color-error-text)}.gbt-date-picker__field{position:relative;display:inline-flex}.gbt-date-picker__trigger{box-sizing:border-box;display:flex;align-items:center;width:220px;height:var(--gbt-control-height-md);padding:0 34px 0 10px;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:14px;cursor:pointer;transition:border-color .15s cubic-bezier(.4,0,.2,1)}.gbt-date-picker__trigger--open{border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-date-picker__trigger:disabled{cursor:not-allowed;opacity:.5}.gbt-date-picker__trigger:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-picker__trigger-label{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}.gbt-date-picker__trigger-label--placeholder{color:var(--text-discret)}.gbt-date-picker__icon{position:absolute;top:50%;right:10px;transform:translateY(-50%);color:var(--text-secondary);pointer-events:none}.gbt-date-picker__clear{position:absolute;top:50%;right:6px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;background:none;border:none;border-radius:50%;color:var(--text-secondary);cursor:pointer}.gbt-date-picker__clear:hover{background:var(--bg-hover);color:var(--text-primary)}.gbt-date-picker__clear:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-picker__panel{box-sizing:border-box;position:fixed;z-index:1000;padding:.75rem;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);box-shadow:var(--site-shadow-lg);animation:gbt-date-picker-scale-in .15s cubic-bezier(.34,1.56,.64,1) both}.gbt-date-picker__nav{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.gbt-date-picker__headings{display:flex;flex:1;justify-content:center;gap:1.25rem}.gbt-date-picker__nav-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:none;border:none;border-radius:var(--site-border-radius-sm);color:var(--text-secondary);cursor:pointer}.gbt-date-picker__nav-button:hover{background:var(--bg-hover);color:var(--text-primary)}.gbt-date-picker__nav-button:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-picker__select{box-sizing:border-box;height:28px;padding:0 6px;background:none;border:none;border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:13px;font-weight:600;cursor:pointer}.gbt-date-picker__select:hover{background:var(--bg-hover)}.gbt-date-picker__select:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-picker__months{display:flex;justify-content:center;gap:1.25rem;margin-inline:.65rem;margin-bottom:.65rem}.gbt-date-picker__month-heading{box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:.375rem;width:184px;height:28px}.gbt-date-picker__month-label{font-size:14px;font-weight:600;color:var(--text-primary);text-align:center}.gbt-date-picker__row{display:grid;grid-template-columns:repeat(7,32px)}.gbt-date-picker__row--head{margin-bottom:.25rem;margin-top:.25rem}.gbt-date-picker__weekday{display:flex;align-items:center;justify-content:center;height:24px;font-size:13px;font-weight:600;color:var(--text-secondary)}.gbt-date-picker__day{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:32px;height:32px;background:none;border:none;border-radius:50%;color:var(--text-primary);font-size:13px;cursor:pointer}.gbt-date-picker__day:hover:not(:disabled):not(.gbt-date-picker__day--empty){background:var(--bg-hover)}.gbt-date-picker__day:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:-2px}.gbt-date-picker__day--empty{cursor:default}.gbt-date-picker__day--today{font-weight:700;box-shadow:inset 0 0 0 1px var(--border-color)}.gbt-date-picker__day--selected{background:var(--primary);color:var(--text-on-primary);font-weight:600}@media(prefers-reduced-motion:reduce){.gbt-date-picker__panel{animation:none}.gbt-date-picker__trigger{transition:none}}@keyframes gbt-date-picker-scale-in{0%{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}\n"],
|
|
515
|
+
dependencies: [{
|
|
516
|
+
kind: "component",
|
|
517
|
+
type: Icon,
|
|
518
|
+
selector: "gbt-icon",
|
|
519
|
+
inputs: ["name"]
|
|
520
|
+
}],
|
|
521
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
522
|
+
});
|
|
523
|
+
};
|
|
524
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
525
|
+
minVersion: "12.0.0",
|
|
526
|
+
version: "22.2.0",
|
|
527
|
+
ngImport: i0,
|
|
528
|
+
type: DatePicker,
|
|
529
|
+
decorators: [{
|
|
530
|
+
type: Component,
|
|
531
|
+
args: [{
|
|
532
|
+
selector: "gbt-date-picker",
|
|
533
|
+
standalone: true,
|
|
534
|
+
imports: [Icon],
|
|
535
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
536
|
+
host: {
|
|
537
|
+
"(document:click)": "handleClickOutside($event)",
|
|
538
|
+
"(keydown)": "onEscape($event)",
|
|
539
|
+
"(window:resize)": "updatePanelPosition()"
|
|
540
|
+
},
|
|
541
|
+
providers: [{
|
|
542
|
+
provide: NG_VALUE_ACCESSOR,
|
|
543
|
+
useExisting: forwardRef(() => DatePicker),
|
|
544
|
+
multi: true
|
|
545
|
+
}],
|
|
546
|
+
template: "<div class=\"gbt-date-picker\">\n @if (label()) {\n <label [for]=\"id()\" class=\"gbt-date-picker__label\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n <div class=\"gbt-date-picker__field\">\n <button\n type=\"button\"\n [id]=\"id()\"\n class=\"gbt-date-picker__trigger\"\n [class.gbt-date-picker__trigger--open]=\"open()\"\n [disabled]=\"isDisabled()\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (click)=\"toggleOpen()\"\n >\n <span\n class=\"gbt-date-picker__trigger-label\"\n [class.gbt-date-picker__trigger-label--placeholder]=\"!triggerLabel()\"\n >\n {{ triggerLabel() || placeholder() }}\n </span>\n </button>\n @if (showClear()) {\n <button\n type=\"button\"\n class=\"gbt-date-picker__clear\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear($event)\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n } @else {\n <gbt-icon name=\"calendar\" class=\"gbt-date-picker__icon\" aria-hidden=\"true\" />\n }\n </div>\n @if (open() && panelStyle(); as pos) {\n <div\n class=\"gbt-date-picker__panel\"\n role=\"dialog\"\n aria-modal=\"false\"\n [attr.aria-label]=\"panelLabel()\"\n [style.top]=\"pos.top\"\n [style.left]=\"pos.left\"\n >\n <div class=\"gbt-date-picker__nav\">\n <button\n type=\"button\"\n class=\"gbt-date-picker__nav-button\"\n [attr.aria-label]=\"previousMonthLabel()\"\n (click)=\"shiftMonth(-1)\"\n >\n <gbt-icon name=\"chevron-left\" aria-hidden=\"true\" />\n </button>\n <div class=\"gbt-date-picker__headings\">\n @for (view of monthViews(); track view.year + '-' + view.month; let i = $index) {\n <div class=\"gbt-date-picker__month-heading\">\n @if (i === 0) {\n <select\n #monthSelect\n class=\"gbt-date-picker__select\"\n [attr.aria-label]=\"monthSelectLabel()\"\n (change)=\"onMonthSelect(monthSelect.value)\"\n >\n @for (opt of monthOptions(); track opt.value) {\n <option [value]=\"opt.value\" [selected]=\"opt.value === anchorDate().getMonth()\">\n {{ opt.label }}\n </option>\n }\n </select>\n <select\n #yearSelect\n class=\"gbt-date-picker__select\"\n [attr.aria-label]=\"yearSelectLabel()\"\n (change)=\"onYearSelect(yearSelect.value)\"\n >\n @for (year of yearOptions(); track year) {\n <option [value]=\"year\" [selected]=\"year === anchorDate().getFullYear()\">\n {{ year }}\n </option>\n }\n </select>\n } @else {\n <span class=\"gbt-date-picker__month-label\">{{ view.label }}</span>\n }\n </div>\n }\n </div>\n <button\n type=\"button\"\n class=\"gbt-date-picker__nav-button\"\n [attr.aria-label]=\"nextMonthLabel()\"\n (click)=\"shiftMonth(1)\"\n >\n <gbt-icon name=\"chevron-right\" aria-hidden=\"true\" />\n </button>\n </div>\n <div class=\"gbt-date-picker__months\">\n @for (view of monthViews(); track view.year + '-' + view.month) {\n <div class=\"gbt-date-picker__month\">\n <div\n class=\"gbt-date-picker__grid\"\n role=\"grid\"\n tabindex=\"-1\"\n [attr.aria-label]=\"view.label\"\n (keydown)=\"onGridKeydown($event)\"\n >\n <div class=\"gbt-date-picker__row gbt-date-picker__row--head\" role=\"row\">\n @for (wd of weekdayLabels(); track $index) {\n <span role=\"columnheader\" class=\"gbt-date-picker__weekday\">{{ wd }}</span>\n }\n </div>\n @for (week of view.weeks; track $index) {\n <div class=\"gbt-date-picker__row\" role=\"row\">\n @for (day of week; track day.date.getTime()) {\n @if (day.inCurrentMonth) {\n <button\n type=\"button\"\n role=\"gridcell\"\n class=\"gbt-date-picker__day\"\n [class.gbt-date-picker__day--today]=\"day.isToday\"\n [class.gbt-date-picker__day--selected]=\"isSelected(day.date)\"\n [attr.data-date]=\"cellId(day.date)\"\n [attr.aria-selected]=\"isSelected(day.date)\"\n [attr.aria-current]=\"day.isToday ? 'date' : null\"\n [tabIndex]=\"isFocused(day.date) ? 0 : -1\"\n (click)=\"selectDay(day)\"\n >\n {{ day.date.getDate() }}\n </button>\n } @else {\n <span\n role=\"gridcell\"\n class=\"gbt-date-picker__day gbt-date-picker__day--empty\"\n ></span>\n }\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n </div>\n }\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-date-picker__error\" role=\"alert\">{{ errorMessage() }}</p>\n }\n</div>\n",
|
|
547
|
+
styles: [".gbt-date-picker{display:inline-flex;flex-direction:column;gap:.375rem}.gbt-date-picker__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-date-picker__error{margin:0;font-size:.75rem;color:var(--color-error-text)}.gbt-date-picker__field{position:relative;display:inline-flex}.gbt-date-picker__trigger{box-sizing:border-box;display:flex;align-items:center;width:220px;height:var(--gbt-control-height-md);padding:0 34px 0 10px;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:14px;cursor:pointer;transition:border-color .15s cubic-bezier(.4,0,.2,1)}.gbt-date-picker__trigger--open{border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-date-picker__trigger:disabled{cursor:not-allowed;opacity:.5}.gbt-date-picker__trigger:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-picker__trigger-label{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}.gbt-date-picker__trigger-label--placeholder{color:var(--text-discret)}.gbt-date-picker__icon{position:absolute;top:50%;right:10px;transform:translateY(-50%);color:var(--text-secondary);pointer-events:none}.gbt-date-picker__clear{position:absolute;top:50%;right:6px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;background:none;border:none;border-radius:50%;color:var(--text-secondary);cursor:pointer}.gbt-date-picker__clear:hover{background:var(--bg-hover);color:var(--text-primary)}.gbt-date-picker__clear:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-picker__panel{box-sizing:border-box;position:fixed;z-index:1000;padding:.75rem;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);box-shadow:var(--site-shadow-lg);animation:gbt-date-picker-scale-in .15s cubic-bezier(.34,1.56,.64,1) both}.gbt-date-picker__nav{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.gbt-date-picker__headings{display:flex;flex:1;justify-content:center;gap:1.25rem}.gbt-date-picker__nav-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:none;border:none;border-radius:var(--site-border-radius-sm);color:var(--text-secondary);cursor:pointer}.gbt-date-picker__nav-button:hover{background:var(--bg-hover);color:var(--text-primary)}.gbt-date-picker__nav-button:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-picker__select{box-sizing:border-box;height:28px;padding:0 6px;background:none;border:none;border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:13px;font-weight:600;cursor:pointer}.gbt-date-picker__select:hover{background:var(--bg-hover)}.gbt-date-picker__select:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-picker__months{display:flex;justify-content:center;gap:1.25rem;margin-inline:.65rem;margin-bottom:.65rem}.gbt-date-picker__month-heading{box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:.375rem;width:184px;height:28px}.gbt-date-picker__month-label{font-size:14px;font-weight:600;color:var(--text-primary);text-align:center}.gbt-date-picker__row{display:grid;grid-template-columns:repeat(7,32px)}.gbt-date-picker__row--head{margin-bottom:.25rem;margin-top:.25rem}.gbt-date-picker__weekday{display:flex;align-items:center;justify-content:center;height:24px;font-size:13px;font-weight:600;color:var(--text-secondary)}.gbt-date-picker__day{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:32px;height:32px;background:none;border:none;border-radius:50%;color:var(--text-primary);font-size:13px;cursor:pointer}.gbt-date-picker__day:hover:not(:disabled):not(.gbt-date-picker__day--empty){background:var(--bg-hover)}.gbt-date-picker__day:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:-2px}.gbt-date-picker__day--empty{cursor:default}.gbt-date-picker__day--today{font-weight:700;box-shadow:inset 0 0 0 1px var(--border-color)}.gbt-date-picker__day--selected{background:var(--primary);color:var(--text-on-primary);font-weight:600}@media(prefers-reduced-motion:reduce){.gbt-date-picker__panel{animation:none}.gbt-date-picker__trigger{transition:none}}@keyframes gbt-date-picker-scale-in{0%{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}\n"]
|
|
548
|
+
}]
|
|
549
|
+
}],
|
|
550
|
+
ctorParameters: () => [],
|
|
551
|
+
propDecorators: {
|
|
552
|
+
id: [{
|
|
553
|
+
type: i0.Input,
|
|
554
|
+
args: [{
|
|
555
|
+
isSignal: true,
|
|
556
|
+
alias: "id",
|
|
557
|
+
required: false
|
|
558
|
+
}]
|
|
559
|
+
}],
|
|
560
|
+
label: [{
|
|
561
|
+
type: i0.Input,
|
|
562
|
+
args: [{
|
|
563
|
+
isSignal: true,
|
|
564
|
+
alias: "label",
|
|
565
|
+
required: false
|
|
566
|
+
}]
|
|
567
|
+
}],
|
|
568
|
+
placeholder: [{
|
|
569
|
+
type: i0.Input,
|
|
570
|
+
args: [{
|
|
571
|
+
isSignal: true,
|
|
572
|
+
alias: "placeholder",
|
|
573
|
+
required: false
|
|
574
|
+
}]
|
|
575
|
+
}],
|
|
576
|
+
locale: [{
|
|
577
|
+
type: i0.Input,
|
|
578
|
+
args: [{
|
|
579
|
+
isSignal: true,
|
|
580
|
+
alias: "locale",
|
|
581
|
+
required: false
|
|
582
|
+
}]
|
|
583
|
+
}],
|
|
584
|
+
weekStartsOn: [{
|
|
585
|
+
type: i0.Input,
|
|
586
|
+
args: [{
|
|
587
|
+
isSignal: true,
|
|
588
|
+
alias: "weekStartsOn",
|
|
589
|
+
required: false
|
|
590
|
+
}]
|
|
591
|
+
}],
|
|
592
|
+
disabled: [{
|
|
593
|
+
type: i0.Input,
|
|
594
|
+
args: [{
|
|
595
|
+
isSignal: true,
|
|
596
|
+
alias: "disabled",
|
|
597
|
+
required: false
|
|
598
|
+
}]
|
|
599
|
+
}],
|
|
600
|
+
required: [{
|
|
601
|
+
type: i0.Input,
|
|
602
|
+
args: [{
|
|
603
|
+
isSignal: true,
|
|
604
|
+
alias: "required",
|
|
605
|
+
required: false
|
|
606
|
+
}]
|
|
607
|
+
}],
|
|
608
|
+
errorMessage: [{
|
|
609
|
+
type: i0.Input,
|
|
610
|
+
args: [{
|
|
611
|
+
isSignal: true,
|
|
612
|
+
alias: "errorMessage",
|
|
613
|
+
required: false
|
|
614
|
+
}]
|
|
615
|
+
}],
|
|
616
|
+
previousMonthLabel: [{
|
|
617
|
+
type: i0.Input,
|
|
618
|
+
args: [{
|
|
619
|
+
isSignal: true,
|
|
620
|
+
alias: "previousMonthLabel",
|
|
621
|
+
required: false
|
|
622
|
+
}]
|
|
623
|
+
}],
|
|
624
|
+
nextMonthLabel: [{
|
|
625
|
+
type: i0.Input,
|
|
626
|
+
args: [{
|
|
627
|
+
isSignal: true,
|
|
628
|
+
alias: "nextMonthLabel",
|
|
629
|
+
required: false
|
|
630
|
+
}]
|
|
631
|
+
}],
|
|
632
|
+
clearable: [{
|
|
633
|
+
type: i0.Input,
|
|
634
|
+
args: [{
|
|
635
|
+
isSignal: true,
|
|
636
|
+
alias: "clearable",
|
|
637
|
+
required: false
|
|
638
|
+
}]
|
|
639
|
+
}],
|
|
640
|
+
clearLabel: [{
|
|
641
|
+
type: i0.Input,
|
|
642
|
+
args: [{
|
|
643
|
+
isSignal: true,
|
|
644
|
+
alias: "clearLabel",
|
|
645
|
+
required: false
|
|
646
|
+
}]
|
|
647
|
+
}],
|
|
648
|
+
visibleMonths: [{
|
|
649
|
+
type: i0.Input,
|
|
650
|
+
args: [{
|
|
651
|
+
isSignal: true,
|
|
652
|
+
alias: "visibleMonths",
|
|
653
|
+
required: false
|
|
654
|
+
}]
|
|
655
|
+
}],
|
|
656
|
+
monthSelectLabel: [{
|
|
657
|
+
type: i0.Input,
|
|
658
|
+
args: [{
|
|
659
|
+
isSignal: true,
|
|
660
|
+
alias: "monthSelectLabel",
|
|
661
|
+
required: false
|
|
662
|
+
}]
|
|
663
|
+
}],
|
|
664
|
+
yearSelectLabel: [{
|
|
665
|
+
type: i0.Input,
|
|
666
|
+
args: [{
|
|
667
|
+
isSignal: true,
|
|
668
|
+
alias: "yearSelectLabel",
|
|
669
|
+
required: false
|
|
670
|
+
}]
|
|
671
|
+
}],
|
|
672
|
+
minYear: [{
|
|
673
|
+
type: i0.Input,
|
|
674
|
+
args: [{
|
|
675
|
+
isSignal: true,
|
|
676
|
+
alias: "minYear",
|
|
677
|
+
required: false
|
|
678
|
+
}]
|
|
679
|
+
}],
|
|
680
|
+
maxYear: [{
|
|
681
|
+
type: i0.Input,
|
|
682
|
+
args: [{
|
|
683
|
+
isSignal: true,
|
|
684
|
+
alias: "maxYear",
|
|
685
|
+
required: false
|
|
686
|
+
}]
|
|
687
|
+
}]
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
let nextId = 0;
|
|
691
|
+
const CURRENT_YEAR = (/* @__PURE__ */ new Date()).getFullYear();
|
|
692
|
+
var DateRangePicker = class DateRangePicker {
|
|
693
|
+
elementRef = inject(ElementRef);
|
|
694
|
+
injector = inject(Injector);
|
|
695
|
+
id = input(`gbt-date-range-picker-${++nextId}`, ...ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []);
|
|
696
|
+
label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
697
|
+
placeholder = input("Select a date range…", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
698
|
+
locale = input("en-US", ...ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []);
|
|
699
|
+
weekStartsOn = input(1, ...ngDevMode ? [{ debugName: "weekStartsOn" }] : /* istanbul ignore next */ []);
|
|
700
|
+
disabled = input(false, {
|
|
701
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
702
|
+
transform: booleanAttribute
|
|
703
|
+
});
|
|
704
|
+
required = input(false, {
|
|
705
|
+
...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
|
|
706
|
+
transform: booleanAttribute
|
|
707
|
+
});
|
|
708
|
+
errorMessage = input(null, ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
|
|
709
|
+
previousMonthLabel = input("Previous month", ...ngDevMode ? [{ debugName: "previousMonthLabel" }] : /* istanbul ignore next */ []);
|
|
710
|
+
nextMonthLabel = input("Next month", ...ngDevMode ? [{ debugName: "nextMonthLabel" }] : /* istanbul ignore next */ []);
|
|
711
|
+
clearable = input(false, {
|
|
712
|
+
...ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {},
|
|
713
|
+
transform: booleanAttribute
|
|
714
|
+
});
|
|
715
|
+
clearLabel = input("Clear date range", ...ngDevMode ? [{ debugName: "clearLabel" }] : /* istanbul ignore next */ []);
|
|
716
|
+
visibleMonths = input(2, ...ngDevMode ? [{ debugName: "visibleMonths" }] : /* istanbul ignore next */ []);
|
|
717
|
+
monthSelectLabel = input("Month", ...ngDevMode ? [{ debugName: "monthSelectLabel" }] : /* istanbul ignore next */ []);
|
|
718
|
+
yearSelectLabel = input("Year", ...ngDevMode ? [{ debugName: "yearSelectLabel" }] : /* istanbul ignore next */ []);
|
|
719
|
+
minYear = input(CURRENT_YEAR - 100, ...ngDevMode ? [{ debugName: "minYear" }] : /* istanbul ignore next */ []);
|
|
720
|
+
maxYear = input(CURRENT_YEAR + 10, ...ngDevMode ? [{ debugName: "maxYear" }] : /* istanbul ignore next */ []);
|
|
721
|
+
rangeStatus = input((start, end) => {
|
|
722
|
+
if (!start) return "";
|
|
723
|
+
if (!end) return `${start} selected as the start date. Choose an end date.`;
|
|
724
|
+
return `Date range: ${start} to ${end}.`;
|
|
725
|
+
}, ...ngDevMode ? [{ debugName: "rangeStatus" }] : /* istanbul ignore next */ []);
|
|
726
|
+
panel = new CalendarPanel({
|
|
727
|
+
elementRef: this.elementRef,
|
|
728
|
+
injector: this.injector,
|
|
729
|
+
triggerSelector: ".gbt-date-range-picker__trigger",
|
|
730
|
+
locale: () => this.locale(),
|
|
731
|
+
weekStartsOn: () => this.weekStartsOn(),
|
|
732
|
+
visibleMonths: () => this.visibleMonths(),
|
|
733
|
+
minYear: () => this.minYear(),
|
|
734
|
+
maxYear: () => this.maxYear(),
|
|
735
|
+
onTouched: () => this.onTouched()
|
|
736
|
+
});
|
|
737
|
+
open = this.panel.open;
|
|
738
|
+
value = signal(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
739
|
+
draftStart = signal(null, ...ngDevMode ? [{ debugName: "draftStart" }] : /* istanbul ignore next */ []);
|
|
740
|
+
draftEnd = signal(null, ...ngDevMode ? [{ debugName: "draftEnd" }] : /* istanbul ignore next */ []);
|
|
741
|
+
hoveredDate = signal(null, ...ngDevMode ? [{ debugName: "hoveredDate" }] : /* istanbul ignore next */ []);
|
|
742
|
+
focusedDate = this.panel.focusedDate;
|
|
743
|
+
anchorDate = this.panel.anchorDate;
|
|
744
|
+
panelStyle = this.panel.panelStyle;
|
|
745
|
+
formDisabled = signal(false, ...ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []);
|
|
746
|
+
onChange = () => {};
|
|
747
|
+
onTouched = () => {};
|
|
748
|
+
isDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
749
|
+
showClear = computed(() => this.clearable() && this.value() !== null && !this.isDisabled(), ...ngDevMode ? [{ debugName: "showClear" }] : /* istanbul ignore next */ []);
|
|
750
|
+
monthViews = this.panel.monthViews;
|
|
751
|
+
panelLabel = this.panel.panelLabel;
|
|
752
|
+
weekdayLabels = this.panel.weekdayLabels;
|
|
753
|
+
monthOptions = this.panel.monthOptions;
|
|
754
|
+
yearOptions = this.panel.yearOptions;
|
|
755
|
+
dateFormatter = computed(() => new Intl.DateTimeFormat(this.locale(), { dateStyle: "medium" }), ...ngDevMode ? [{ debugName: "dateFormatter" }] : /* istanbul ignore next */ []);
|
|
756
|
+
triggerLabel = computed(() => {
|
|
757
|
+
const v = this.value();
|
|
758
|
+
if (!v) return "";
|
|
759
|
+
const formatter = this.dateFormatter();
|
|
760
|
+
if (!v.end) return formatter.format(v.start);
|
|
761
|
+
return `${formatter.format(v.start)} – ${formatter.format(v.end)}`;
|
|
762
|
+
}, ...ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []);
|
|
763
|
+
previewBounds = computed(() => {
|
|
764
|
+
const start = this.draftStart();
|
|
765
|
+
if (!start) return null;
|
|
766
|
+
const other = this.draftEnd() ?? this.hoveredDate();
|
|
767
|
+
if (!other) return null;
|
|
768
|
+
return start.getTime() <= other.getTime() ? {
|
|
769
|
+
lower: start,
|
|
770
|
+
upper: other
|
|
771
|
+
} : {
|
|
772
|
+
lower: other,
|
|
773
|
+
upper: start
|
|
774
|
+
};
|
|
775
|
+
}, ...ngDevMode ? [{ debugName: "previewBounds" }] : /* istanbul ignore next */ []);
|
|
776
|
+
isPreviewing = computed(() => this.draftStart() !== null && this.draftEnd() === null, ...ngDevMode ? [{ debugName: "isPreviewing" }] : /* istanbul ignore next */ []);
|
|
777
|
+
statusMessage = computed(() => {
|
|
778
|
+
const start = this.draftStart();
|
|
779
|
+
if (!start) return "";
|
|
780
|
+
const formatter = this.dateFormatter();
|
|
781
|
+
const end = this.draftEnd();
|
|
782
|
+
return this.rangeStatus()(formatter.format(start), end ? formatter.format(end) : null);
|
|
783
|
+
}, ...ngDevMode ? [{ debugName: "statusMessage" }] : /* istanbul ignore next */ []);
|
|
784
|
+
writeValue(value) {
|
|
785
|
+
this.value.set(value);
|
|
786
|
+
if (value) {
|
|
787
|
+
this.focusedDate.set(value.start);
|
|
788
|
+
this.anchorDate.set(new Date(value.start.getFullYear(), value.start.getMonth(), 1));
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
registerOnChange(fn) {
|
|
792
|
+
this.onChange = fn;
|
|
793
|
+
}
|
|
794
|
+
registerOnTouched(fn) {
|
|
795
|
+
this.onTouched = fn;
|
|
796
|
+
}
|
|
797
|
+
setDisabledState(isDisabled) {
|
|
798
|
+
this.formDisabled.set(isDisabled);
|
|
799
|
+
}
|
|
800
|
+
isRangeStartCap(date) {
|
|
801
|
+
const bounds = this.previewBounds();
|
|
802
|
+
return bounds !== null && isSameDay(date, bounds.lower);
|
|
803
|
+
}
|
|
804
|
+
isRangeEndCap(date) {
|
|
805
|
+
const bounds = this.previewBounds();
|
|
806
|
+
return bounds !== null && isSameDay(date, bounds.upper);
|
|
807
|
+
}
|
|
808
|
+
isInRange(date) {
|
|
809
|
+
const bounds = this.previewBounds();
|
|
810
|
+
return bounds !== null && date.getTime() > bounds.lower.getTime() && date.getTime() < bounds.upper.getTime();
|
|
811
|
+
}
|
|
812
|
+
isFocused(date) {
|
|
813
|
+
return this.panel.isFocused(date);
|
|
814
|
+
}
|
|
815
|
+
cellId(date) {
|
|
816
|
+
return this.panel.cellId(date);
|
|
817
|
+
}
|
|
818
|
+
toggleOpen() {
|
|
819
|
+
if (this.isDisabled()) return;
|
|
820
|
+
this.panel.toggle(() => {
|
|
821
|
+
const value = this.value();
|
|
822
|
+
this.draftStart.set(value?.start ?? null);
|
|
823
|
+
this.draftEnd.set(value?.end ?? null);
|
|
824
|
+
this.hoveredDate.set(null);
|
|
825
|
+
return value?.start ?? /* @__PURE__ */ new Date();
|
|
826
|
+
});
|
|
827
|
+
}
|
|
828
|
+
close(returnFocus) {
|
|
829
|
+
this.panel.close(returnFocus);
|
|
830
|
+
}
|
|
831
|
+
clear(event) {
|
|
832
|
+
event.stopPropagation();
|
|
833
|
+
if (this.isDisabled()) return;
|
|
834
|
+
this.value.set(null);
|
|
835
|
+
this.draftStart.set(null);
|
|
836
|
+
this.draftEnd.set(null);
|
|
837
|
+
this.onChange(null);
|
|
838
|
+
this.onTouched();
|
|
839
|
+
this.panel.close(false);
|
|
840
|
+
}
|
|
841
|
+
selectDay(date) {
|
|
842
|
+
if (this.isDisabled()) return;
|
|
843
|
+
const start = this.draftStart();
|
|
844
|
+
const complete = start !== null && this.draftEnd() !== null;
|
|
845
|
+
if (!start || complete) {
|
|
846
|
+
this.draftStart.set(date);
|
|
847
|
+
this.draftEnd.set(null);
|
|
848
|
+
this.focusedDate.set(date);
|
|
849
|
+
this.panel.ensureVisible(date);
|
|
850
|
+
this.panel.focusCellAfterRender();
|
|
851
|
+
return;
|
|
852
|
+
}
|
|
853
|
+
const [rangeStart, rangeEnd] = start.getTime() <= date.getTime() ? [start, date] : [date, start];
|
|
854
|
+
this.draftStart.set(rangeStart);
|
|
855
|
+
this.draftEnd.set(rangeEnd);
|
|
856
|
+
this.focusedDate.set(date);
|
|
857
|
+
this.panel.ensureVisible(date);
|
|
858
|
+
const next = {
|
|
859
|
+
start: rangeStart,
|
|
860
|
+
end: rangeEnd
|
|
861
|
+
};
|
|
862
|
+
this.value.set(next);
|
|
863
|
+
this.onChange(next);
|
|
864
|
+
this.onTouched();
|
|
865
|
+
this.panel.close(true);
|
|
866
|
+
}
|
|
867
|
+
onDayMouseEnter(date) {
|
|
868
|
+
this.hoveredDate.set(date);
|
|
869
|
+
}
|
|
870
|
+
onDayMouseLeave() {
|
|
871
|
+
this.hoveredDate.set(null);
|
|
872
|
+
}
|
|
873
|
+
shiftMonth(delta) {
|
|
874
|
+
this.panel.shiftMonth(delta);
|
|
875
|
+
}
|
|
876
|
+
onMonthSelect(value) {
|
|
877
|
+
this.panel.onMonthSelect(value);
|
|
878
|
+
}
|
|
879
|
+
onYearSelect(value) {
|
|
880
|
+
this.panel.onYearSelect(value);
|
|
881
|
+
}
|
|
882
|
+
onGridKeydown(event) {
|
|
883
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
884
|
+
event.preventDefault();
|
|
885
|
+
this.selectDay(this.focusedDate());
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
this.panel.handleNavigationKeydown(event);
|
|
889
|
+
}
|
|
890
|
+
onEscape(event) {
|
|
891
|
+
this.panel.onEscape(event);
|
|
892
|
+
}
|
|
893
|
+
handleClickOutside(event) {
|
|
894
|
+
this.panel.handleClickOutside(event);
|
|
895
|
+
}
|
|
896
|
+
constructor() {
|
|
897
|
+
followPageScroll(() => this.updatePanelPosition());
|
|
898
|
+
}
|
|
899
|
+
updatePanelPosition() {
|
|
900
|
+
this.panel.updatePanelPosition();
|
|
901
|
+
}
|
|
902
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
903
|
+
minVersion: "12.0.0",
|
|
904
|
+
version: "22.2.0",
|
|
905
|
+
ngImport: i0,
|
|
906
|
+
type: DateRangePicker,
|
|
907
|
+
deps: [],
|
|
908
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
909
|
+
});
|
|
910
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
911
|
+
minVersion: "17.0.0",
|
|
912
|
+
version: "22.2.0",
|
|
913
|
+
type: DateRangePicker,
|
|
914
|
+
isStandalone: true,
|
|
915
|
+
selector: "gbt-date-range-picker",
|
|
916
|
+
inputs: {
|
|
917
|
+
id: {
|
|
918
|
+
classPropertyName: "id",
|
|
919
|
+
publicName: "id",
|
|
920
|
+
isSignal: true,
|
|
921
|
+
isRequired: false,
|
|
922
|
+
transformFunction: null
|
|
923
|
+
},
|
|
924
|
+
label: {
|
|
925
|
+
classPropertyName: "label",
|
|
926
|
+
publicName: "label",
|
|
927
|
+
isSignal: true,
|
|
928
|
+
isRequired: false,
|
|
929
|
+
transformFunction: null
|
|
930
|
+
},
|
|
931
|
+
placeholder: {
|
|
932
|
+
classPropertyName: "placeholder",
|
|
933
|
+
publicName: "placeholder",
|
|
934
|
+
isSignal: true,
|
|
935
|
+
isRequired: false,
|
|
936
|
+
transformFunction: null
|
|
937
|
+
},
|
|
938
|
+
locale: {
|
|
939
|
+
classPropertyName: "locale",
|
|
940
|
+
publicName: "locale",
|
|
941
|
+
isSignal: true,
|
|
942
|
+
isRequired: false,
|
|
943
|
+
transformFunction: null
|
|
944
|
+
},
|
|
945
|
+
weekStartsOn: {
|
|
946
|
+
classPropertyName: "weekStartsOn",
|
|
947
|
+
publicName: "weekStartsOn",
|
|
948
|
+
isSignal: true,
|
|
949
|
+
isRequired: false,
|
|
950
|
+
transformFunction: null
|
|
951
|
+
},
|
|
952
|
+
disabled: {
|
|
953
|
+
classPropertyName: "disabled",
|
|
954
|
+
publicName: "disabled",
|
|
955
|
+
isSignal: true,
|
|
956
|
+
isRequired: false,
|
|
957
|
+
transformFunction: null
|
|
958
|
+
},
|
|
959
|
+
required: {
|
|
960
|
+
classPropertyName: "required",
|
|
961
|
+
publicName: "required",
|
|
962
|
+
isSignal: true,
|
|
963
|
+
isRequired: false,
|
|
964
|
+
transformFunction: null
|
|
965
|
+
},
|
|
966
|
+
errorMessage: {
|
|
967
|
+
classPropertyName: "errorMessage",
|
|
968
|
+
publicName: "errorMessage",
|
|
969
|
+
isSignal: true,
|
|
970
|
+
isRequired: false,
|
|
971
|
+
transformFunction: null
|
|
972
|
+
},
|
|
973
|
+
previousMonthLabel: {
|
|
974
|
+
classPropertyName: "previousMonthLabel",
|
|
975
|
+
publicName: "previousMonthLabel",
|
|
976
|
+
isSignal: true,
|
|
977
|
+
isRequired: false,
|
|
978
|
+
transformFunction: null
|
|
979
|
+
},
|
|
980
|
+
nextMonthLabel: {
|
|
981
|
+
classPropertyName: "nextMonthLabel",
|
|
982
|
+
publicName: "nextMonthLabel",
|
|
983
|
+
isSignal: true,
|
|
984
|
+
isRequired: false,
|
|
985
|
+
transformFunction: null
|
|
986
|
+
},
|
|
987
|
+
clearable: {
|
|
988
|
+
classPropertyName: "clearable",
|
|
989
|
+
publicName: "clearable",
|
|
990
|
+
isSignal: true,
|
|
991
|
+
isRequired: false,
|
|
992
|
+
transformFunction: null
|
|
993
|
+
},
|
|
994
|
+
clearLabel: {
|
|
995
|
+
classPropertyName: "clearLabel",
|
|
996
|
+
publicName: "clearLabel",
|
|
997
|
+
isSignal: true,
|
|
998
|
+
isRequired: false,
|
|
999
|
+
transformFunction: null
|
|
1000
|
+
},
|
|
1001
|
+
visibleMonths: {
|
|
1002
|
+
classPropertyName: "visibleMonths",
|
|
1003
|
+
publicName: "visibleMonths",
|
|
1004
|
+
isSignal: true,
|
|
1005
|
+
isRequired: false,
|
|
1006
|
+
transformFunction: null
|
|
1007
|
+
},
|
|
1008
|
+
monthSelectLabel: {
|
|
1009
|
+
classPropertyName: "monthSelectLabel",
|
|
1010
|
+
publicName: "monthSelectLabel",
|
|
1011
|
+
isSignal: true,
|
|
1012
|
+
isRequired: false,
|
|
1013
|
+
transformFunction: null
|
|
1014
|
+
},
|
|
1015
|
+
yearSelectLabel: {
|
|
1016
|
+
classPropertyName: "yearSelectLabel",
|
|
1017
|
+
publicName: "yearSelectLabel",
|
|
1018
|
+
isSignal: true,
|
|
1019
|
+
isRequired: false,
|
|
1020
|
+
transformFunction: null
|
|
1021
|
+
},
|
|
1022
|
+
minYear: {
|
|
1023
|
+
classPropertyName: "minYear",
|
|
1024
|
+
publicName: "minYear",
|
|
1025
|
+
isSignal: true,
|
|
1026
|
+
isRequired: false,
|
|
1027
|
+
transformFunction: null
|
|
1028
|
+
},
|
|
1029
|
+
maxYear: {
|
|
1030
|
+
classPropertyName: "maxYear",
|
|
1031
|
+
publicName: "maxYear",
|
|
1032
|
+
isSignal: true,
|
|
1033
|
+
isRequired: false,
|
|
1034
|
+
transformFunction: null
|
|
1035
|
+
},
|
|
1036
|
+
rangeStatus: {
|
|
1037
|
+
classPropertyName: "rangeStatus",
|
|
1038
|
+
publicName: "rangeStatus",
|
|
1039
|
+
isSignal: true,
|
|
1040
|
+
isRequired: false,
|
|
1041
|
+
transformFunction: null
|
|
1042
|
+
}
|
|
1043
|
+
},
|
|
1044
|
+
host: { listeners: {
|
|
1045
|
+
"document:click": "handleClickOutside($event)",
|
|
1046
|
+
"keydown": "onEscape($event)",
|
|
1047
|
+
"window:resize": "updatePanelPosition()"
|
|
1048
|
+
} },
|
|
1049
|
+
providers: [{
|
|
1050
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1051
|
+
useExisting: forwardRef(() => DateRangePicker),
|
|
1052
|
+
multi: true
|
|
1053
|
+
}],
|
|
1054
|
+
ngImport: i0,
|
|
1055
|
+
template: "<div class=\"gbt-date-range-picker\">\n @if (label()) {\n <label [for]=\"id()\" class=\"gbt-date-range-picker__label\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n <div class=\"gbt-date-range-picker__field\">\n <button\n type=\"button\"\n [id]=\"id()\"\n class=\"gbt-date-range-picker__trigger\"\n [class.gbt-date-range-picker__trigger--open]=\"open()\"\n [disabled]=\"isDisabled()\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (click)=\"toggleOpen()\"\n >\n <span\n class=\"gbt-date-range-picker__trigger-label\"\n [class.gbt-date-range-picker__trigger-label--placeholder]=\"!triggerLabel()\"\n >\n {{ triggerLabel() || placeholder() }}\n </span>\n </button>\n @if (showClear()) {\n <button\n type=\"button\"\n class=\"gbt-date-range-picker__clear\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear($event)\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n } @else {\n <gbt-icon name=\"calendar\" class=\"gbt-date-range-picker__icon\" aria-hidden=\"true\" />\n }\n </div>\n @if (open() && panelStyle(); as pos) {\n <div\n class=\"gbt-date-range-picker__panel\"\n role=\"dialog\"\n aria-modal=\"false\"\n [attr.aria-label]=\"panelLabel()\"\n [style.top]=\"pos.top\"\n [style.left]=\"pos.left\"\n >\n <div class=\"gbt-date-range-picker__nav\">\n <button\n type=\"button\"\n class=\"gbt-date-range-picker__nav-button\"\n [attr.aria-label]=\"previousMonthLabel()\"\n (click)=\"shiftMonth(-1)\"\n >\n <gbt-icon name=\"chevron-left\" aria-hidden=\"true\" />\n </button>\n <div class=\"gbt-date-range-picker__headings\">\n @for (view of monthViews(); track view.year + '-' + view.month; let i = $index) {\n <div class=\"gbt-date-range-picker__month-heading\">\n @if (i === 0) {\n <select\n #monthSelect\n class=\"gbt-date-range-picker__select\"\n [attr.aria-label]=\"monthSelectLabel()\"\n (change)=\"onMonthSelect(monthSelect.value)\"\n >\n @for (opt of monthOptions(); track opt.value) {\n <option [value]=\"opt.value\" [selected]=\"opt.value === anchorDate().getMonth()\">\n {{ opt.label }}\n </option>\n }\n </select>\n <select\n #yearSelect\n class=\"gbt-date-range-picker__select\"\n [attr.aria-label]=\"yearSelectLabel()\"\n (change)=\"onYearSelect(yearSelect.value)\"\n >\n @for (year of yearOptions(); track year) {\n <option [value]=\"year\" [selected]=\"year === anchorDate().getFullYear()\">\n {{ year }}\n </option>\n }\n </select>\n } @else {\n <span class=\"gbt-date-range-picker__month-label\">{{ view.label }}</span>\n }\n </div>\n }\n </div>\n <button\n type=\"button\"\n class=\"gbt-date-range-picker__nav-button\"\n [attr.aria-label]=\"nextMonthLabel()\"\n (click)=\"shiftMonth(1)\"\n >\n <gbt-icon name=\"chevron-right\" aria-hidden=\"true\" />\n </button>\n </div>\n <div class=\"gbt-date-range-picker__months\">\n @for (view of monthViews(); track view.year + '-' + view.month) {\n <div class=\"gbt-date-range-picker__month\">\n <div\n class=\"gbt-date-range-picker__grid\"\n role=\"grid\"\n tabindex=\"-1\"\n [attr.aria-label]=\"view.label\"\n (keydown)=\"onGridKeydown($event)\"\n >\n <div class=\"gbt-date-range-picker__row gbt-date-range-picker__row--head\" role=\"row\">\n @for (wd of weekdayLabels(); track $index) {\n <span role=\"columnheader\" class=\"gbt-date-range-picker__weekday\">{{ wd }}</span>\n }\n </div>\n @for (week of view.weeks; track $index) {\n <div class=\"gbt-date-range-picker__row\" role=\"row\">\n @for (day of week; track day.date.getTime()) {\n @if (day.inCurrentMonth) {\n <button\n type=\"button\"\n role=\"gridcell\"\n class=\"gbt-date-range-picker__day\"\n [class.gbt-date-range-picker__day--today]=\"day.isToday\"\n [class.gbt-date-range-picker__day--start-cap]=\"isRangeStartCap(day.date)\"\n [class.gbt-date-range-picker__day--end-cap]=\"isRangeEndCap(day.date)\"\n [class.gbt-date-range-picker__day--in-range]=\"isInRange(day.date)\"\n [class.gbt-date-range-picker__day--preview]=\"isPreviewing()\"\n [attr.data-date]=\"cellId(day.date)\"\n [attr.aria-current]=\"day.isToday ? 'date' : null\"\n [tabIndex]=\"isFocused(day.date) ? 0 : -1\"\n (click)=\"selectDay(day.date)\"\n (mouseenter)=\"onDayMouseEnter(day.date)\"\n (mouseleave)=\"onDayMouseLeave()\"\n >\n {{ day.date.getDate() }}\n </button>\n } @else {\n <span\n role=\"gridcell\"\n class=\"gbt-date-range-picker__day gbt-date-range-picker__day--empty\"\n ></span>\n }\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n <div class=\"gbt-sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ statusMessage() }}\n </div>\n </div>\n }\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-date-range-picker__error\" role=\"alert\">\n {{ errorMessage() }}\n </p>\n }\n</div>\n",
|
|
1056
|
+
styles: [".gbt-date-range-picker{display:inline-flex;flex-direction:column;gap:.375rem}.gbt-date-range-picker__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-date-range-picker__error{margin:0;font-size:.75rem;color:var(--color-error-text)}.gbt-date-range-picker__field{position:relative;display:inline-flex}.gbt-date-range-picker__trigger{box-sizing:border-box;display:flex;align-items:center;width:260px;height:var(--gbt-control-height-md);padding:0 34px 0 10px;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:14px;cursor:pointer;transition:border-color .15s cubic-bezier(.4,0,.2,1)}.gbt-date-range-picker__trigger--open{border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-date-range-picker__trigger:disabled{cursor:not-allowed;opacity:.5}.gbt-date-range-picker__trigger:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-range-picker__trigger-label{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}.gbt-date-range-picker__trigger-label--placeholder{color:var(--text-discret)}.gbt-date-range-picker__icon{position:absolute;top:50%;right:10px;transform:translateY(-50%);color:var(--text-secondary);pointer-events:none}.gbt-date-range-picker__clear{position:absolute;top:50%;right:6px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;background:none;border:none;border-radius:50%;color:var(--text-secondary);cursor:pointer}.gbt-date-range-picker__clear:hover{background:var(--bg-hover);color:var(--text-primary)}.gbt-date-range-picker__clear:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-range-picker__panel{box-sizing:border-box;position:fixed;z-index:1000;padding:.75rem;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);box-shadow:var(--site-shadow-lg);animation:gbt-date-range-picker-scale-in .15s cubic-bezier(.34,1.56,.64,1) both}.gbt-date-range-picker__nav{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.gbt-date-range-picker__headings{display:flex;flex:1;justify-content:center;gap:1.25rem}.gbt-date-range-picker__nav-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:none;border:none;border-radius:var(--site-border-radius-sm);color:var(--text-secondary);cursor:pointer}.gbt-date-range-picker__nav-button:hover{background:var(--bg-hover);color:var(--text-primary)}.gbt-date-range-picker__nav-button:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-range-picker__select{box-sizing:border-box;height:28px;padding:0 6px;background:none;border:none;border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:13px;font-weight:600;cursor:pointer}.gbt-date-range-picker__select:hover{background:var(--bg-hover)}.gbt-date-range-picker__select:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-range-picker__months{display:flex;justify-content:center;gap:1.25rem;margin-inline:.65rem;margin-bottom:.65rem}.gbt-date-range-picker__month-heading{box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:.375rem;width:184px;height:28px}.gbt-date-range-picker__month-label{font-size:14px;font-weight:600;color:var(--text-primary);text-align:center}.gbt-date-range-picker__row{display:grid;grid-template-columns:repeat(7,32px)}.gbt-date-range-picker__row--head{margin-top:.25rem;margin-bottom:.25rem}.gbt-date-range-picker__weekday{display:flex;align-items:center;justify-content:center;height:24px;font-size:13px;font-weight:600;color:var(--text-secondary)}.gbt-date-range-picker__day{position:relative;z-index:0;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:32px;height:32px;background:none;border:none;color:var(--text-primary);font-size:13px;cursor:pointer}.gbt-date-range-picker__day:before{content:\"\";position:absolute;inset:0;z-index:-1}.gbt-date-range-picker__day:hover:not(:disabled):not(.gbt-date-range-picker__day--empty){border-radius:50%;background:var(--bg-hover)}.gbt-date-range-picker__day:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:-2px;border-radius:50%}.gbt-date-range-picker__day--empty{cursor:default}.gbt-date-range-picker__day--today{font-weight:700;box-shadow:inset 0 0 0 1px var(--border-color);border-radius:50%}.gbt-date-range-picker__day--in-range:before{background:color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-date-range-picker__day--start-cap,.gbt-date-range-picker__day--end-cap{color:var(--text-on-primary);font-weight:600}.gbt-date-range-picker__day--start-cap:before{background:var(--primary);color:var(--text-on-primary);border-radius:50% 0 0 50%}.gbt-date-range-picker__day--end-cap:before{background:var(--primary);color:var(--text-on-primary);border-radius:0 50% 50% 0}.gbt-date-range-picker__day--start-cap.gbt-date-range-picker__day--end-cap:before{border-radius:50%}.gbt-date-range-picker__day--preview.gbt-date-range-picker__day--in-range:before,.gbt-date-range-picker__day--preview.gbt-date-range-picker__day--start-cap:before,.gbt-date-range-picker__day--preview.gbt-date-range-picker__day--end-cap:before{opacity:.6}.gbt-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}@media(prefers-reduced-motion:reduce){.gbt-date-range-picker__panel{animation:none}.gbt-date-range-picker__trigger{transition:none}}@keyframes gbt-date-range-picker-scale-in{0%{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}\n"],
|
|
1057
|
+
dependencies: [{
|
|
1058
|
+
kind: "component",
|
|
1059
|
+
type: Icon,
|
|
1060
|
+
selector: "gbt-icon",
|
|
1061
|
+
inputs: ["name"]
|
|
1062
|
+
}],
|
|
1063
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
1064
|
+
});
|
|
1065
|
+
};
|
|
1066
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1067
|
+
minVersion: "12.0.0",
|
|
1068
|
+
version: "22.2.0",
|
|
1069
|
+
ngImport: i0,
|
|
1070
|
+
type: DateRangePicker,
|
|
1071
|
+
decorators: [{
|
|
1072
|
+
type: Component,
|
|
1073
|
+
args: [{
|
|
1074
|
+
selector: "gbt-date-range-picker",
|
|
1075
|
+
standalone: true,
|
|
1076
|
+
imports: [Icon],
|
|
1077
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1078
|
+
host: {
|
|
1079
|
+
"(document:click)": "handleClickOutside($event)",
|
|
1080
|
+
"(keydown)": "onEscape($event)",
|
|
1081
|
+
"(window:resize)": "updatePanelPosition()"
|
|
1082
|
+
},
|
|
1083
|
+
providers: [{
|
|
1084
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1085
|
+
useExisting: forwardRef(() => DateRangePicker),
|
|
1086
|
+
multi: true
|
|
1087
|
+
}],
|
|
1088
|
+
template: "<div class=\"gbt-date-range-picker\">\n @if (label()) {\n <label [for]=\"id()\" class=\"gbt-date-range-picker__label\"\n >{{ label() }}{{ required() ? ' *' : '' }}</label\n >\n }\n <div class=\"gbt-date-range-picker__field\">\n <button\n type=\"button\"\n [id]=\"id()\"\n class=\"gbt-date-range-picker__trigger\"\n [class.gbt-date-range-picker__trigger--open]=\"open()\"\n [disabled]=\"isDisabled()\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-invalid]=\"errorMessage() ? true : null\"\n [attr.aria-describedby]=\"errorMessage() ? id() + '-error' : null\"\n (click)=\"toggleOpen()\"\n >\n <span\n class=\"gbt-date-range-picker__trigger-label\"\n [class.gbt-date-range-picker__trigger-label--placeholder]=\"!triggerLabel()\"\n >\n {{ triggerLabel() || placeholder() }}\n </span>\n </button>\n @if (showClear()) {\n <button\n type=\"button\"\n class=\"gbt-date-range-picker__clear\"\n [attr.aria-label]=\"clearLabel()\"\n (click)=\"clear($event)\"\n >\n <gbt-icon name=\"x\" aria-hidden=\"true\" />\n </button>\n } @else {\n <gbt-icon name=\"calendar\" class=\"gbt-date-range-picker__icon\" aria-hidden=\"true\" />\n }\n </div>\n @if (open() && panelStyle(); as pos) {\n <div\n class=\"gbt-date-range-picker__panel\"\n role=\"dialog\"\n aria-modal=\"false\"\n [attr.aria-label]=\"panelLabel()\"\n [style.top]=\"pos.top\"\n [style.left]=\"pos.left\"\n >\n <div class=\"gbt-date-range-picker__nav\">\n <button\n type=\"button\"\n class=\"gbt-date-range-picker__nav-button\"\n [attr.aria-label]=\"previousMonthLabel()\"\n (click)=\"shiftMonth(-1)\"\n >\n <gbt-icon name=\"chevron-left\" aria-hidden=\"true\" />\n </button>\n <div class=\"gbt-date-range-picker__headings\">\n @for (view of monthViews(); track view.year + '-' + view.month; let i = $index) {\n <div class=\"gbt-date-range-picker__month-heading\">\n @if (i === 0) {\n <select\n #monthSelect\n class=\"gbt-date-range-picker__select\"\n [attr.aria-label]=\"monthSelectLabel()\"\n (change)=\"onMonthSelect(monthSelect.value)\"\n >\n @for (opt of monthOptions(); track opt.value) {\n <option [value]=\"opt.value\" [selected]=\"opt.value === anchorDate().getMonth()\">\n {{ opt.label }}\n </option>\n }\n </select>\n <select\n #yearSelect\n class=\"gbt-date-range-picker__select\"\n [attr.aria-label]=\"yearSelectLabel()\"\n (change)=\"onYearSelect(yearSelect.value)\"\n >\n @for (year of yearOptions(); track year) {\n <option [value]=\"year\" [selected]=\"year === anchorDate().getFullYear()\">\n {{ year }}\n </option>\n }\n </select>\n } @else {\n <span class=\"gbt-date-range-picker__month-label\">{{ view.label }}</span>\n }\n </div>\n }\n </div>\n <button\n type=\"button\"\n class=\"gbt-date-range-picker__nav-button\"\n [attr.aria-label]=\"nextMonthLabel()\"\n (click)=\"shiftMonth(1)\"\n >\n <gbt-icon name=\"chevron-right\" aria-hidden=\"true\" />\n </button>\n </div>\n <div class=\"gbt-date-range-picker__months\">\n @for (view of monthViews(); track view.year + '-' + view.month) {\n <div class=\"gbt-date-range-picker__month\">\n <div\n class=\"gbt-date-range-picker__grid\"\n role=\"grid\"\n tabindex=\"-1\"\n [attr.aria-label]=\"view.label\"\n (keydown)=\"onGridKeydown($event)\"\n >\n <div class=\"gbt-date-range-picker__row gbt-date-range-picker__row--head\" role=\"row\">\n @for (wd of weekdayLabels(); track $index) {\n <span role=\"columnheader\" class=\"gbt-date-range-picker__weekday\">{{ wd }}</span>\n }\n </div>\n @for (week of view.weeks; track $index) {\n <div class=\"gbt-date-range-picker__row\" role=\"row\">\n @for (day of week; track day.date.getTime()) {\n @if (day.inCurrentMonth) {\n <button\n type=\"button\"\n role=\"gridcell\"\n class=\"gbt-date-range-picker__day\"\n [class.gbt-date-range-picker__day--today]=\"day.isToday\"\n [class.gbt-date-range-picker__day--start-cap]=\"isRangeStartCap(day.date)\"\n [class.gbt-date-range-picker__day--end-cap]=\"isRangeEndCap(day.date)\"\n [class.gbt-date-range-picker__day--in-range]=\"isInRange(day.date)\"\n [class.gbt-date-range-picker__day--preview]=\"isPreviewing()\"\n [attr.data-date]=\"cellId(day.date)\"\n [attr.aria-current]=\"day.isToday ? 'date' : null\"\n [tabIndex]=\"isFocused(day.date) ? 0 : -1\"\n (click)=\"selectDay(day.date)\"\n (mouseenter)=\"onDayMouseEnter(day.date)\"\n (mouseleave)=\"onDayMouseLeave()\"\n >\n {{ day.date.getDate() }}\n </button>\n } @else {\n <span\n role=\"gridcell\"\n class=\"gbt-date-range-picker__day gbt-date-range-picker__day--empty\"\n ></span>\n }\n }\n </div>\n }\n </div>\n </div>\n }\n </div>\n <div class=\"gbt-sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">\n {{ statusMessage() }}\n </div>\n </div>\n }\n @if (errorMessage()) {\n <p [id]=\"id() + '-error'\" class=\"gbt-date-range-picker__error\" role=\"alert\">\n {{ errorMessage() }}\n </p>\n }\n</div>\n",
|
|
1089
|
+
styles: [".gbt-date-range-picker{display:inline-flex;flex-direction:column;gap:.375rem}.gbt-date-range-picker__label{font-size:.8125rem;font-weight:600;color:var(--text-secondary)}.gbt-date-range-picker__error{margin:0;font-size:.75rem;color:var(--color-error-text)}.gbt-date-range-picker__field{position:relative;display:inline-flex}.gbt-date-range-picker__trigger{box-sizing:border-box;display:flex;align-items:center;width:260px;height:var(--gbt-control-height-md);padding:0 34px 0 10px;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:14px;cursor:pointer;transition:border-color .15s cubic-bezier(.4,0,.2,1)}.gbt-date-range-picker__trigger--open{border-color:var(--primary);box-shadow:0 0 0 4px color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-date-range-picker__trigger:disabled{cursor:not-allowed;opacity:.5}.gbt-date-range-picker__trigger:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-range-picker__trigger-label{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}.gbt-date-range-picker__trigger-label--placeholder{color:var(--text-discret)}.gbt-date-range-picker__icon{position:absolute;top:50%;right:10px;transform:translateY(-50%);color:var(--text-secondary);pointer-events:none}.gbt-date-range-picker__clear{position:absolute;top:50%;right:6px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;background:none;border:none;border-radius:50%;color:var(--text-secondary);cursor:pointer}.gbt-date-range-picker__clear:hover{background:var(--bg-hover);color:var(--text-primary)}.gbt-date-range-picker__clear:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-range-picker__panel{box-sizing:border-box;position:fixed;z-index:1000;padding:.75rem;background:var(--bg-principal);border:1px solid var(--border-color);border-radius:var(--site-border-radius-sm);box-shadow:var(--site-shadow-lg);animation:gbt-date-range-picker-scale-in .15s cubic-bezier(.34,1.56,.64,1) both}.gbt-date-range-picker__nav{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.gbt-date-range-picker__headings{display:flex;flex:1;justify-content:center;gap:1.25rem}.gbt-date-range-picker__nav-button{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;background:none;border:none;border-radius:var(--site-border-radius-sm);color:var(--text-secondary);cursor:pointer}.gbt-date-range-picker__nav-button:hover{background:var(--bg-hover);color:var(--text-primary)}.gbt-date-range-picker__nav-button:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-range-picker__select{box-sizing:border-box;height:28px;padding:0 6px;background:none;border:none;border-radius:var(--site-border-radius-sm);color:var(--text-primary);font-size:13px;font-weight:600;cursor:pointer}.gbt-date-range-picker__select:hover{background:var(--bg-hover)}.gbt-date-range-picker__select:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:2px}.gbt-date-range-picker__months{display:flex;justify-content:center;gap:1.25rem;margin-inline:.65rem;margin-bottom:.65rem}.gbt-date-range-picker__month-heading{box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:.375rem;width:184px;height:28px}.gbt-date-range-picker__month-label{font-size:14px;font-weight:600;color:var(--text-primary);text-align:center}.gbt-date-range-picker__row{display:grid;grid-template-columns:repeat(7,32px)}.gbt-date-range-picker__row--head{margin-top:.25rem;margin-bottom:.25rem}.gbt-date-range-picker__weekday{display:flex;align-items:center;justify-content:center;height:24px;font-size:13px;font-weight:600;color:var(--text-secondary)}.gbt-date-range-picker__day{position:relative;z-index:0;box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:32px;height:32px;background:none;border:none;color:var(--text-primary);font-size:13px;cursor:pointer}.gbt-date-range-picker__day:before{content:\"\";position:absolute;inset:0;z-index:-1}.gbt-date-range-picker__day:hover:not(:disabled):not(.gbt-date-range-picker__day--empty){border-radius:50%;background:var(--bg-hover)}.gbt-date-range-picker__day:focus-visible{outline:2px solid var(--gbt-focus-ring, var(--focus-ring));outline-offset:-2px;border-radius:50%}.gbt-date-range-picker__day--empty{cursor:default}.gbt-date-range-picker__day--today{font-weight:700;box-shadow:inset 0 0 0 1px var(--border-color);border-radius:50%}.gbt-date-range-picker__day--in-range:before{background:color-mix(in srgb,var(--primary) 12%,transparent)}.gbt-date-range-picker__day--start-cap,.gbt-date-range-picker__day--end-cap{color:var(--text-on-primary);font-weight:600}.gbt-date-range-picker__day--start-cap:before{background:var(--primary);color:var(--text-on-primary);border-radius:50% 0 0 50%}.gbt-date-range-picker__day--end-cap:before{background:var(--primary);color:var(--text-on-primary);border-radius:0 50% 50% 0}.gbt-date-range-picker__day--start-cap.gbt-date-range-picker__day--end-cap:before{border-radius:50%}.gbt-date-range-picker__day--preview.gbt-date-range-picker__day--in-range:before,.gbt-date-range-picker__day--preview.gbt-date-range-picker__day--start-cap:before,.gbt-date-range-picker__day--preview.gbt-date-range-picker__day--end-cap:before{opacity:.6}.gbt-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}@media(prefers-reduced-motion:reduce){.gbt-date-range-picker__panel{animation:none}.gbt-date-range-picker__trigger{transition:none}}@keyframes gbt-date-range-picker-scale-in{0%{opacity:0;transform:scale(.97) translateY(-4px)}to{opacity:1;transform:scale(1) translateY(0)}}\n"]
|
|
1090
|
+
}]
|
|
1091
|
+
}],
|
|
1092
|
+
ctorParameters: () => [],
|
|
1093
|
+
propDecorators: {
|
|
1094
|
+
id: [{
|
|
1095
|
+
type: i0.Input,
|
|
1096
|
+
args: [{
|
|
1097
|
+
isSignal: true,
|
|
1098
|
+
alias: "id",
|
|
1099
|
+
required: false
|
|
1100
|
+
}]
|
|
1101
|
+
}],
|
|
1102
|
+
label: [{
|
|
1103
|
+
type: i0.Input,
|
|
1104
|
+
args: [{
|
|
1105
|
+
isSignal: true,
|
|
1106
|
+
alias: "label",
|
|
1107
|
+
required: false
|
|
1108
|
+
}]
|
|
1109
|
+
}],
|
|
1110
|
+
placeholder: [{
|
|
1111
|
+
type: i0.Input,
|
|
1112
|
+
args: [{
|
|
1113
|
+
isSignal: true,
|
|
1114
|
+
alias: "placeholder",
|
|
1115
|
+
required: false
|
|
1116
|
+
}]
|
|
1117
|
+
}],
|
|
1118
|
+
locale: [{
|
|
1119
|
+
type: i0.Input,
|
|
1120
|
+
args: [{
|
|
1121
|
+
isSignal: true,
|
|
1122
|
+
alias: "locale",
|
|
1123
|
+
required: false
|
|
1124
|
+
}]
|
|
1125
|
+
}],
|
|
1126
|
+
weekStartsOn: [{
|
|
1127
|
+
type: i0.Input,
|
|
1128
|
+
args: [{
|
|
1129
|
+
isSignal: true,
|
|
1130
|
+
alias: "weekStartsOn",
|
|
1131
|
+
required: false
|
|
1132
|
+
}]
|
|
1133
|
+
}],
|
|
1134
|
+
disabled: [{
|
|
1135
|
+
type: i0.Input,
|
|
1136
|
+
args: [{
|
|
1137
|
+
isSignal: true,
|
|
1138
|
+
alias: "disabled",
|
|
1139
|
+
required: false
|
|
1140
|
+
}]
|
|
1141
|
+
}],
|
|
1142
|
+
required: [{
|
|
1143
|
+
type: i0.Input,
|
|
1144
|
+
args: [{
|
|
1145
|
+
isSignal: true,
|
|
1146
|
+
alias: "required",
|
|
1147
|
+
required: false
|
|
1148
|
+
}]
|
|
1149
|
+
}],
|
|
1150
|
+
errorMessage: [{
|
|
1151
|
+
type: i0.Input,
|
|
1152
|
+
args: [{
|
|
1153
|
+
isSignal: true,
|
|
1154
|
+
alias: "errorMessage",
|
|
1155
|
+
required: false
|
|
1156
|
+
}]
|
|
1157
|
+
}],
|
|
1158
|
+
previousMonthLabel: [{
|
|
1159
|
+
type: i0.Input,
|
|
1160
|
+
args: [{
|
|
1161
|
+
isSignal: true,
|
|
1162
|
+
alias: "previousMonthLabel",
|
|
1163
|
+
required: false
|
|
1164
|
+
}]
|
|
1165
|
+
}],
|
|
1166
|
+
nextMonthLabel: [{
|
|
1167
|
+
type: i0.Input,
|
|
1168
|
+
args: [{
|
|
1169
|
+
isSignal: true,
|
|
1170
|
+
alias: "nextMonthLabel",
|
|
1171
|
+
required: false
|
|
1172
|
+
}]
|
|
1173
|
+
}],
|
|
1174
|
+
clearable: [{
|
|
1175
|
+
type: i0.Input,
|
|
1176
|
+
args: [{
|
|
1177
|
+
isSignal: true,
|
|
1178
|
+
alias: "clearable",
|
|
1179
|
+
required: false
|
|
1180
|
+
}]
|
|
1181
|
+
}],
|
|
1182
|
+
clearLabel: [{
|
|
1183
|
+
type: i0.Input,
|
|
1184
|
+
args: [{
|
|
1185
|
+
isSignal: true,
|
|
1186
|
+
alias: "clearLabel",
|
|
1187
|
+
required: false
|
|
1188
|
+
}]
|
|
1189
|
+
}],
|
|
1190
|
+
visibleMonths: [{
|
|
1191
|
+
type: i0.Input,
|
|
1192
|
+
args: [{
|
|
1193
|
+
isSignal: true,
|
|
1194
|
+
alias: "visibleMonths",
|
|
1195
|
+
required: false
|
|
1196
|
+
}]
|
|
1197
|
+
}],
|
|
1198
|
+
monthSelectLabel: [{
|
|
1199
|
+
type: i0.Input,
|
|
1200
|
+
args: [{
|
|
1201
|
+
isSignal: true,
|
|
1202
|
+
alias: "monthSelectLabel",
|
|
1203
|
+
required: false
|
|
1204
|
+
}]
|
|
1205
|
+
}],
|
|
1206
|
+
yearSelectLabel: [{
|
|
1207
|
+
type: i0.Input,
|
|
1208
|
+
args: [{
|
|
1209
|
+
isSignal: true,
|
|
1210
|
+
alias: "yearSelectLabel",
|
|
1211
|
+
required: false
|
|
1212
|
+
}]
|
|
1213
|
+
}],
|
|
1214
|
+
minYear: [{
|
|
1215
|
+
type: i0.Input,
|
|
1216
|
+
args: [{
|
|
1217
|
+
isSignal: true,
|
|
1218
|
+
alias: "minYear",
|
|
1219
|
+
required: false
|
|
1220
|
+
}]
|
|
1221
|
+
}],
|
|
1222
|
+
maxYear: [{
|
|
1223
|
+
type: i0.Input,
|
|
1224
|
+
args: [{
|
|
1225
|
+
isSignal: true,
|
|
1226
|
+
alias: "maxYear",
|
|
1227
|
+
required: false
|
|
1228
|
+
}]
|
|
1229
|
+
}],
|
|
1230
|
+
rangeStatus: [{
|
|
1231
|
+
type: i0.Input,
|
|
1232
|
+
args: [{
|
|
1233
|
+
isSignal: true,
|
|
1234
|
+
alias: "rangeStatus",
|
|
1235
|
+
required: false
|
|
1236
|
+
}]
|
|
1237
|
+
}]
|
|
1238
|
+
}
|
|
1239
|
+
});
|
|
1240
|
+
export { DatePicker, DateRangePicker };
|
|
1241
|
+
|
|
1242
|
+
//# sourceMappingURL=masmarino-gabarit-date-picker.mjs.map
|