@ngstarter-ui/components 1.0.21
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 +0 -0
- package/fesm2022/ngstarter-ui-components-action-required.mjs +42 -0
- package/fesm2022/ngstarter-ui-components-action-required.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-alert.mjs +132 -0
- package/fesm2022/ngstarter-ui-components-alert.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-announcement.mjs +86 -0
- package/fesm2022/ngstarter-ui-components-announcement.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs +360 -0
- package/fesm2022/ngstarter-ui-components-autocomplete.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-avatar.mjs +235 -0
- package/fesm2022/ngstarter-ui-components-avatar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-badge.mjs +97 -0
- package/fesm2022/ngstarter-ui-components-badge.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-block-loader.mjs +48 -0
- package/fesm2022/ngstarter-ui-components-block-loader.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs +327 -0
- package/fesm2022/ngstarter-ui-components-bottom-sheet.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs +209 -0
- package/fesm2022/ngstarter-ui-components-breadcrumbs.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs +175 -0
- package/fesm2022/ngstarter-ui-components-button-toggle.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-button.mjs +70 -0
- package/fesm2022/ngstarter-ui-components-button.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-card-overlay.mjs +49 -0
- package/fesm2022/ngstarter-ui-components-card-overlay.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-card.mjs +199 -0
- package/fesm2022/ngstarter-ui-components-card.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-carousel.mjs +614 -0
- package/fesm2022/ngstarter-ui-components-carousel.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-checkbox.mjs +300 -0
- package/fesm2022/ngstarter-ui-components-checkbox.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-chips.mjs +589 -0
- package/fesm2022/ngstarter-ui-components-chips.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs +347 -0
- package/fesm2022/ngstarter-ui-components-code-highlighter.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-color-picker.mjs +713 -0
- package/fesm2022/ngstarter-ui-components-color-picker.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-color-scheme.mjs +106 -0
- package/fesm2022/ngstarter-ui-components-color-scheme.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs +72 -0
- package/fesm2022/ngstarter-ui-components-color-switcher.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-command-bar.mjs +57 -0
- package/fesm2022/ngstarter-ui-components-command-bar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs +1024 -0
- package/fesm2022/ngstarter-ui-components-comment-editor.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-comparison-slider.mjs +177 -0
- package/fesm2022/ngstarter-ui-components-comparison-slider.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-confirm.mjs +85 -0
- package/fesm2022/ngstarter-ui-components-confirm.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-Bk6QTli8.mjs +173 -0
- package/fesm2022/ngstarter-ui-components-content-editor-code-block.component-Bk6QTli8.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-content-editor-content-editable.directive-Bvfa2dqh.mjs +124 -0
- package/fesm2022/ngstarter-ui-components-content-editor-content-editor-content-editable.directive-Bvfa2dqh.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs +99 -0
- package/fesm2022/ngstarter-ui-components-content-editor-cursor-controller-4Ak8VqGX.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-C_iRTCPH.mjs +33 -0
- package/fesm2022/ngstarter-ui-components-content-editor-divider-block.component-C_iRTCPH.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-BbkC_t86.mjs +354 -0
- package/fesm2022/ngstarter-ui-components-content-editor-embed-block-BbkC_t86.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-D9_CxTY1.mjs +114 -0
- package/fesm2022/ngstarter-ui-components-content-editor-heading-block.component-D9_CxTY1.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-B4zJyUg1.mjs +146 -0
- package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-B4zJyUg1.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-Cv6wx5Xe.mjs +215 -0
- package/fesm2022/ngstarter-ui-components-content-editor-list-block.component-Cv6wx5Xe.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-1Zi2nAX5.mjs +2548 -0
- package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-1Zi2nAX5.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-C9bQvDYU.mjs +110 -0
- package/fesm2022/ngstarter-ui-components-content-editor-paragraph-block.component-C9bQvDYU.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BbHds2r2.mjs +141 -0
- package/fesm2022/ngstarter-ui-components-content-editor-quote-block.component-BbHds2r2.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-DlDh7Fnn.mjs +1604 -0
- package/fesm2022/ngstarter-ui-components-content-editor-table-block.component-DlDh7Fnn.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-m4DTihP2.mjs +175 -0
- package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-m4DTihP2.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-editor.mjs +2 -0
- package/fesm2022/ngstarter-ui-components-content-editor.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-content-fade.mjs +35 -0
- package/fesm2022/ngstarter-ui-components-content-fade.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs +107 -0
- package/fesm2022/ngstarter-ui-components-cookie-popup.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-core.mjs +1330 -0
- package/fesm2022/ngstarter-ui-components-core.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-country-select.mjs +489 -0
- package/fesm2022/ngstarter-ui-components-country-select.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-crop.mjs +183 -0
- package/fesm2022/ngstarter-ui-components-crop.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-currency-select.mjs +397 -0
- package/fesm2022/ngstarter-ui-components-currency-select.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-data-view.mjs +1494 -0
- package/fesm2022/ngstarter-ui-components-data-view.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs +154 -0
- package/fesm2022/ngstarter-ui-components-date-format-select.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-datepicker.mjs +1159 -0
- package/fesm2022/ngstarter-ui-components-datepicker.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-dialog.mjs +357 -0
- package/fesm2022/ngstarter-ui-components-dialog.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-divider.mjs +42 -0
- package/fesm2022/ngstarter-ui-components-divider.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-drawer.mjs +132 -0
- package/fesm2022/ngstarter-ui-components-drawer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs +245 -0
- package/fesm2022/ngstarter-ui-components-emoji-picker.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-empty-state.mjs +75 -0
- package/fesm2022/ngstarter-ui-components-empty-state.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-expand.mjs +56 -0
- package/fesm2022/ngstarter-ui-components-expand.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-expansion.mjs +193 -0
- package/fesm2022/ngstarter-ui-components-expansion.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs +333 -0
- package/fesm2022/ngstarter-ui-components-filter-builder.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-field.mjs +230 -0
- package/fesm2022/ngstarter-ui-components-form-field.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-autocomplete-many-field-BKQVlZHV.mjs +124 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-autocomplete-many-field-BKQVlZHV.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-checkbox-field-CoyKdvhV.mjs +22 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-checkbox-field-CoyKdvhV.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-datepicker-field-Bzc0TPO9.mjs +44 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-datepicker-field-Bzc0TPO9.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-divider-content-CwGzDCZv.mjs +17 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-divider-content-CwGzDCZv.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-image-content-ICTwkZPa.mjs +17 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-image-content-ICTwkZPa.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-input-field-RYxi-Mpw.mjs +35 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-input-field-RYxi-Mpw.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-radio-group-field-Cv3AGpoq.mjs +38 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-radio-group-field-Cv3AGpoq.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-select-field-eLcwI-BY.mjs +39 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-select-field-eLcwI-BY.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-text-content-BjzH_M3-.mjs +24 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-text-content-BjzH_M3-.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-textarea-field-4zH7FTQ1.mjs +37 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-textarea-field-4zH7FTQ1.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-timezone-field-BpH65Hd-.mjs +35 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-timezone-field-BpH65Hd-.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-toggle-field-iyqUrWxt.mjs +22 -0
- package/fesm2022/ngstarter-ui-components-form-renderer-toggle-field-iyqUrWxt.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-form-renderer.mjs +317 -0
- package/fesm2022/ngstarter-ui-components-form-renderer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-gauge.mjs +44 -0
- package/fesm2022/ngstarter-ui-components-gauge.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-grid.mjs +78 -0
- package/fesm2022/ngstarter-ui-components-grid.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs +736 -0
- package/fesm2022/ngstarter-ui-components-guided-tour.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-headless-stepper.mjs +192 -0
- package/fesm2022/ngstarter-ui-components-headless-stepper.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-icon.mjs +61 -0
- package/fesm2022/ngstarter-ui-components-icon.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-image-designer.mjs +4016 -0
- package/fesm2022/ngstarter-ui-components-image-designer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs +20 -0
- package/fesm2022/ngstarter-ui-components-image-placeholder.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs +151 -0
- package/fesm2022/ngstarter-ui-components-image-resizer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs +349 -0
- package/fesm2022/ngstarter-ui-components-image-viewer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs +162 -0
- package/fesm2022/ngstarter-ui-components-image-zoom-viewer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-incidents.mjs +257 -0
- package/fesm2022/ngstarter-ui-components-incidents.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs +179 -0
- package/fesm2022/ngstarter-ui-components-inline-text-edit.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-input-mask.mjs +180 -0
- package/fesm2022/ngstarter-ui-components-input-mask.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-input-validator.mjs +24 -0
- package/fesm2022/ngstarter-ui-components-input-validator.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-input.mjs +152 -0
- package/fesm2022/ngstarter-ui-components-input.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs +156 -0
- package/fesm2022/ngstarter-ui-components-kanban-board.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-kbd.mjs +31 -0
- package/fesm2022/ngstarter-ui-components-kbd.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-layout.mjs +199 -0
- package/fesm2022/ngstarter-ui-components-layout.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-list.mjs +279 -0
- package/fesm2022/ngstarter-ui-components-list.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-logo.mjs +51 -0
- package/fesm2022/ngstarter-ui-components-logo.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-marquee.mjs +76 -0
- package/fesm2022/ngstarter-ui-components-marquee.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-menu.mjs +851 -0
- package/fesm2022/ngstarter-ui-components-menu.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs +928 -0
- package/fesm2022/ngstarter-ui-components-micro-chart.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-navigation.mjs +439 -0
- package/fesm2022/ngstarter-ui-components-navigation.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-notifications.mjs +181 -0
- package/fesm2022/ngstarter-ui-components-notifications.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-number-input.mjs +293 -0
- package/fesm2022/ngstarter-ui-components-number-input.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-option.mjs +157 -0
- package/fesm2022/ngstarter-ui-components-option.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-overlay.mjs +112 -0
- package/fesm2022/ngstarter-ui-components-overlay.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs +77 -0
- package/fesm2022/ngstarter-ui-components-page-loading-bar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-paginator.mjs +297 -0
- package/fesm2022/ngstarter-ui-components-paginator.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-panel.mjs +123 -0
- package/fesm2022/ngstarter-ui-components-panel.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-password-strength.mjs +335 -0
- package/fesm2022/ngstarter-ui-components-password-strength.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-phone-input.mjs +651 -0
- package/fesm2022/ngstarter-ui-components-phone-input.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-pin-input.mjs +193 -0
- package/fesm2022/ngstarter-ui-components-pin-input.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-popover.mjs +302 -0
- package/fesm2022/ngstarter-ui-components-popover.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs +68 -0
- package/fesm2022/ngstarter-ui-components-progress-bar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-radio-card.mjs +102 -0
- package/fesm2022/ngstarter-ui-components-radio-card.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-radio.mjs +147 -0
- package/fesm2022/ngstarter-ui-components-radio.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs +87 -0
- package/fesm2022/ngstarter-ui-components-rail-nav.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs +74 -0
- package/fesm2022/ngstarter-ui-components-resizable-container.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs +95 -0
- package/fesm2022/ngstarter-ui-components-screen-loader.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs +219 -0
- package/fesm2022/ngstarter-ui-components-scroll-spy.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs +459 -0
- package/fesm2022/ngstarter-ui-components-scrollbar-area.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-segmented.mjs +218 -0
- package/fesm2022/ngstarter-ui-components-segmented.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-select.mjs +496 -0
- package/fesm2022/ngstarter-ui-components-select.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-side-panel.mjs +107 -0
- package/fesm2022/ngstarter-ui-components-side-panel.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-sidebar.mjs +435 -0
- package/fesm2022/ngstarter-ui-components-sidebar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-sidenav.mjs +354 -0
- package/fesm2022/ngstarter-ui-components-sidenav.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs +452 -0
- package/fesm2022/ngstarter-ui-components-signature-pad.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-skeleton.mjs +22 -0
- package/fesm2022/ngstarter-ui-components-skeleton.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs +93 -0
- package/fesm2022/ngstarter-ui-components-slide-toggle.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-slider.mjs +481 -0
- package/fesm2022/ngstarter-ui-components-slider.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs +354 -0
- package/fesm2022/ngstarter-ui-components-snack-bar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-sort.mjs +140 -0
- package/fesm2022/ngstarter-ui-components-sort.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-spinner.mjs +75 -0
- package/fesm2022/ngstarter-ui-components-spinner.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs +93 -0
- package/fesm2022/ngstarter-ui-components-splash-screen.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-split.mjs +948 -0
- package/fesm2022/ngstarter-ui-components-split.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-stepper.mjs +103 -0
- package/fesm2022/ngstarter-ui-components-stepper.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-suggestions.mjs +72 -0
- package/fesm2022/ngstarter-ui-components-suggestions.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs +265 -0
- package/fesm2022/ngstarter-ui-components-tab-panel.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-table.mjs +648 -0
- package/fesm2022/ngstarter-ui-components-table.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-tabs.mjs +591 -0
- package/fesm2022/ngstarter-ui-components-tabs.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-text-editor.mjs +1012 -0
- package/fesm2022/ngstarter-ui-components-text-editor.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs +212 -0
- package/fesm2022/ngstarter-ui-components-thumbnail-maker.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-tiles.mjs +634 -0
- package/fesm2022/ngstarter-ui-components-tiles.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-timeline.mjs +122 -0
- package/fesm2022/ngstarter-ui-components-timeline.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-timepicker.mjs +486 -0
- package/fesm2022/ngstarter-ui-components-timepicker.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs +371 -0
- package/fesm2022/ngstarter-ui-components-timezone-select.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-toolbar.mjs +299 -0
- package/fesm2022/ngstarter-ui-components-toolbar.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-tooltip.mjs +506 -0
- package/fesm2022/ngstarter-ui-components-tooltip.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-tree.mjs +200 -0
- package/fesm2022/ngstarter-ui-components-tree.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-upload.mjs +330 -0
- package/fesm2022/ngstarter-ui-components-upload.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-video-player.mjs +516 -0
- package/fesm2022/ngstarter-ui-components-video-player.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs +218 -0
- package/fesm2022/ngstarter-ui-components-video-viewer.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components-visual-builder.mjs +18 -0
- package/fesm2022/ngstarter-ui-components-visual-builder.mjs.map +1 -0
- package/fesm2022/ngstarter-ui-components.mjs +6 -0
- package/fesm2022/ngstarter-ui-components.mjs.map +1 -0
- package/package.json +535 -0
- package/styles/_common.scss +456 -0
- package/styles/_global.scss +91 -0
- package/styles/themes/default.scss +2 -0
- package/types/ngstarter-ui-components-action-required.d.ts +14 -0
- package/types/ngstarter-ui-components-alert.d.ts +50 -0
- package/types/ngstarter-ui-components-announcement.d.ts +59 -0
- package/types/ngstarter-ui-components-autocomplete.d.ts +83 -0
- package/types/ngstarter-ui-components-avatar.d.ts +69 -0
- package/types/ngstarter-ui-components-badge.d.ts +38 -0
- package/types/ngstarter-ui-components-block-loader.d.ts +21 -0
- package/types/ngstarter-ui-components-bottom-sheet.d.ts +149 -0
- package/types/ngstarter-ui-components-breadcrumbs.d.ts +104 -0
- package/types/ngstarter-ui-components-button-toggle.d.ts +54 -0
- package/types/ngstarter-ui-components-button.d.ts +27 -0
- package/types/ngstarter-ui-components-card-overlay.d.ts +20 -0
- package/types/ngstarter-ui-components-card.d.ts +85 -0
- package/types/ngstarter-ui-components-carousel.d.ts +76 -0
- package/types/ngstarter-ui-components-checkbox.d.ts +94 -0
- package/types/ngstarter-ui-components-chips.d.ts +189 -0
- package/types/ngstarter-ui-components-code-highlighter.d.ts +28 -0
- package/types/ngstarter-ui-components-color-picker.d.ts +92 -0
- package/types/ngstarter-ui-components-color-scheme.d.ts +44 -0
- package/types/ngstarter-ui-components-color-switcher.d.ts +26 -0
- package/types/ngstarter-ui-components-command-bar.d.ts +28 -0
- package/types/ngstarter-ui-components-comment-editor.d.ts +194 -0
- package/types/ngstarter-ui-components-comparison-slider.d.ts +42 -0
- package/types/ngstarter-ui-components-confirm.d.ts +34 -0
- package/types/ngstarter-ui-components-content-editor.d.ts +321 -0
- package/types/ngstarter-ui-components-content-fade.d.ts +17 -0
- package/types/ngstarter-ui-components-cookie-popup.d.ts +41 -0
- package/types/ngstarter-ui-components-core.d.ts +421 -0
- package/types/ngstarter-ui-components-country-select.d.ts +78 -0
- package/types/ngstarter-ui-components-crop.d.ts +59 -0
- package/types/ngstarter-ui-components-currency-select.d.ts +82 -0
- package/types/ngstarter-ui-components-data-view.d.ts +391 -0
- package/types/ngstarter-ui-components-date-format-select.d.ts +59 -0
- package/types/ngstarter-ui-components-datepicker.d.ts +384 -0
- package/types/ngstarter-ui-components-dialog.d.ts +115 -0
- package/types/ngstarter-ui-components-divider.d.ts +18 -0
- package/types/ngstarter-ui-components-drawer.d.ts +32 -0
- package/types/ngstarter-ui-components-emoji-picker.d.ts +49 -0
- package/types/ngstarter-ui-components-empty-state.d.ts +33 -0
- package/types/ngstarter-ui-components-expand.d.ts +26 -0
- package/types/ngstarter-ui-components-expansion.d.ts +68 -0
- package/types/ngstarter-ui-components-filter-builder.d.ts +106 -0
- package/types/ngstarter-ui-components-form-field.d.ts +107 -0
- package/types/ngstarter-ui-components-form-renderer.d.ts +121 -0
- package/types/ngstarter-ui-components-gauge.d.ts +21 -0
- package/types/ngstarter-ui-components-grid.d.ts +45 -0
- package/types/ngstarter-ui-components-guided-tour.d.ts +227 -0
- package/types/ngstarter-ui-components-headless-stepper.d.ts +65 -0
- package/types/ngstarter-ui-components-icon.d.ts +17 -0
- package/types/ngstarter-ui-components-image-designer.d.ts +357 -0
- package/types/ngstarter-ui-components-image-placeholder.d.ts +8 -0
- package/types/ngstarter-ui-components-image-resizer.d.ts +35 -0
- package/types/ngstarter-ui-components-image-viewer.d.ts +63 -0
- package/types/ngstarter-ui-components-image-zoom-viewer.d.ts +34 -0
- package/types/ngstarter-ui-components-incidents.d.ts +119 -0
- package/types/ngstarter-ui-components-inline-text-edit.d.ts +39 -0
- package/types/ngstarter-ui-components-input-mask.d.ts +36 -0
- package/types/ngstarter-ui-components-input-validator.d.ts +5 -0
- package/types/ngstarter-ui-components-input.d.ts +53 -0
- package/types/ngstarter-ui-components-kanban-board.d.ts +68 -0
- package/types/ngstarter-ui-components-kbd.d.ts +13 -0
- package/types/ngstarter-ui-components-layout.d.ts +83 -0
- package/types/ngstarter-ui-components-list.d.ts +98 -0
- package/types/ngstarter-ui-components-logo.d.ts +26 -0
- package/types/ngstarter-ui-components-marquee.d.ts +27 -0
- package/types/ngstarter-ui-components-menu.d.ts +199 -0
- package/types/ngstarter-ui-components-micro-chart.d.ts +195 -0
- package/types/ngstarter-ui-components-navigation.d.ts +136 -0
- package/types/ngstarter-ui-components-notifications.d.ts +84 -0
- package/types/ngstarter-ui-components-number-input.d.ts +99 -0
- package/types/ngstarter-ui-components-option.d.ts +61 -0
- package/types/ngstarter-ui-components-overlay.d.ts +12 -0
- package/types/ngstarter-ui-components-page-loading-bar.d.ts +20 -0
- package/types/ngstarter-ui-components-paginator.d.ts +145 -0
- package/types/ngstarter-ui-components-panel.d.ts +59 -0
- package/types/ngstarter-ui-components-password-strength.d.ts +109 -0
- package/types/ngstarter-ui-components-phone-input.d.ts +103 -0
- package/types/ngstarter-ui-components-pin-input.d.ts +48 -0
- package/types/ngstarter-ui-components-popover.d.ts +94 -0
- package/types/ngstarter-ui-components-progress-bar.d.ts +30 -0
- package/types/ngstarter-ui-components-radio-card.d.ts +37 -0
- package/types/ngstarter-ui-components-radio.d.ts +45 -0
- package/types/ngstarter-ui-components-rail-nav.d.ts +36 -0
- package/types/ngstarter-ui-components-resizable-container.d.ts +25 -0
- package/types/ngstarter-ui-components-screen-loader.d.ts +34 -0
- package/types/ngstarter-ui-components-scroll-spy.d.ts +63 -0
- package/types/ngstarter-ui-components-scrollbar-area.d.ts +67 -0
- package/types/ngstarter-ui-components-segmented.d.ts +65 -0
- package/types/ngstarter-ui-components-select.d.ts +126 -0
- package/types/ngstarter-ui-components-side-panel.d.ts +42 -0
- package/types/ngstarter-ui-components-sidebar.d.ts +143 -0
- package/types/ngstarter-ui-components-sidenav.d.ts +86 -0
- package/types/ngstarter-ui-components-signature-pad.d.ts +49 -0
- package/types/ngstarter-ui-components-skeleton.d.ts +9 -0
- package/types/ngstarter-ui-components-slide-toggle.d.ts +41 -0
- package/types/ngstarter-ui-components-slider.d.ts +85 -0
- package/types/ngstarter-ui-components-snack-bar.d.ts +142 -0
- package/types/ngstarter-ui-components-sort.d.ts +66 -0
- package/types/ngstarter-ui-components-spinner.d.ts +28 -0
- package/types/ngstarter-ui-components-splash-screen.d.ts +31 -0
- package/types/ngstarter-ui-components-split.d.ts +210 -0
- package/types/ngstarter-ui-components-stepper.d.ts +44 -0
- package/types/ngstarter-ui-components-suggestions.d.ts +32 -0
- package/types/ngstarter-ui-components-tab-panel.d.ts +96 -0
- package/types/ngstarter-ui-components-table.d.ts +277 -0
- package/types/ngstarter-ui-components-tabs.d.ts +145 -0
- package/types/ngstarter-ui-components-text-editor.d.ts +191 -0
- package/types/ngstarter-ui-components-thumbnail-maker.d.ts +35 -0
- package/types/ngstarter-ui-components-tiles.d.ts +109 -0
- package/types/ngstarter-ui-components-timeline.d.ts +57 -0
- package/types/ngstarter-ui-components-timepicker.d.ts +115 -0
- package/types/ngstarter-ui-components-timezone-select.d.ts +75 -0
- package/types/ngstarter-ui-components-toolbar.d.ts +74 -0
- package/types/ngstarter-ui-components-tooltip.d.ts +52 -0
- package/types/ngstarter-ui-components-tree.d.ts +60 -0
- package/types/ngstarter-ui-components-upload.d.ts +134 -0
- package/types/ngstarter-ui-components-video-player.d.ts +67 -0
- package/types/ngstarter-ui-components-video-viewer.d.ts +98 -0
- package/types/ngstarter-ui-components-visual-builder.d.ts +8 -0
- package/types/ngstarter-ui-components.d.ts +2 -0
|
@@ -0,0 +1,1159 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, LOCALE_ID, Injectable, input, output, signal, computed, ChangeDetectionStrategy, Component, effect, ViewContainerRef, viewChild, contentChild, ViewEncapsulation, forwardRef, Directive, ElementRef, untracked } from '@angular/core';
|
|
3
|
+
import { Overlay, OverlayModule } from '@angular/cdk/overlay';
|
|
4
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
5
|
+
import { Subject } from 'rxjs';
|
|
6
|
+
import { Button } from '@ngstarter-ui/components/button';
|
|
7
|
+
import { Icon } from '@ngstarter-ui/components/icon';
|
|
8
|
+
import { NgComponentOutlet } from '@angular/common';
|
|
9
|
+
import { NG_VALUE_ACCESSOR, NgControl } from '@angular/forms';
|
|
10
|
+
import { FormField, FormFieldControl, FORM_FIELD } from '@ngstarter-ui/components/form-field';
|
|
11
|
+
|
|
12
|
+
/** Injection token for the DateAdapter's locale. */
|
|
13
|
+
const MAT_DATE_LOCALE = new InjectionToken('MAT_DATE_LOCALE');
|
|
14
|
+
/** Injection token for the DateAdapter's formats. */
|
|
15
|
+
const MAT_DATE_FORMATS = new InjectionToken('MAT_DATE_FORMATS');
|
|
16
|
+
class DateAdapter {
|
|
17
|
+
_localeChanges = new Subject();
|
|
18
|
+
localeChanges = this._localeChanges;
|
|
19
|
+
setLocale(locale) {
|
|
20
|
+
this.locale = locale;
|
|
21
|
+
this._localeChanges.next();
|
|
22
|
+
}
|
|
23
|
+
locale = inject(LOCALE_ID);
|
|
24
|
+
compareDate(first, second) {
|
|
25
|
+
return (this.getYear(first) - this.getYear(second) ||
|
|
26
|
+
this.getMonth(first) - this.getMonth(second) ||
|
|
27
|
+
this.getDate(first) - this.getDate(second));
|
|
28
|
+
}
|
|
29
|
+
sameDate(first, second) {
|
|
30
|
+
if (first && second) {
|
|
31
|
+
let firstValid = this.isValid(first);
|
|
32
|
+
let secondValid = this.isValid(second);
|
|
33
|
+
if (firstValid && secondValid) {
|
|
34
|
+
return !this.compareDate(first, second);
|
|
35
|
+
}
|
|
36
|
+
return firstValid === secondValid;
|
|
37
|
+
}
|
|
38
|
+
return first === second;
|
|
39
|
+
}
|
|
40
|
+
clampDate(date, min, max) {
|
|
41
|
+
if (min && this.compareDate(date, min) < 0) {
|
|
42
|
+
return min;
|
|
43
|
+
}
|
|
44
|
+
if (max && this.compareDate(date, max) > 0) {
|
|
45
|
+
return max;
|
|
46
|
+
}
|
|
47
|
+
return date;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
class DatepickerIntl {
|
|
52
|
+
changes = new Subject();
|
|
53
|
+
calendarLabel = 'Calendar';
|
|
54
|
+
openCalendarLabel = 'Open calendar';
|
|
55
|
+
prevMonthLabel = 'Previous month';
|
|
56
|
+
nextMonthLabel = 'Next month';
|
|
57
|
+
prevYearLabel = 'Previous year';
|
|
58
|
+
nextYearLabel = 'Next year';
|
|
59
|
+
prevMultiYearLabel = 'Previous 24 years';
|
|
60
|
+
nextMultiYearLabel = 'Next 24 years';
|
|
61
|
+
switchToMonthViewLabel = 'Choose date';
|
|
62
|
+
switchToMultiYearViewLabel = 'Choose month and year';
|
|
63
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerIntl, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
64
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerIntl, providedIn: 'root' });
|
|
65
|
+
}
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerIntl, decorators: [{
|
|
67
|
+
type: Injectable,
|
|
68
|
+
args: [{ providedIn: 'root' }]
|
|
69
|
+
}] });
|
|
70
|
+
|
|
71
|
+
class DateRange {
|
|
72
|
+
start;
|
|
73
|
+
end;
|
|
74
|
+
constructor(
|
|
75
|
+
/** The start date of the range. */
|
|
76
|
+
start,
|
|
77
|
+
/** The end date of the range. */
|
|
78
|
+
end) {
|
|
79
|
+
this.start = start;
|
|
80
|
+
this.end = end;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
class MonthView {
|
|
85
|
+
_dateAdapter = inject(DateAdapter);
|
|
86
|
+
activeDate = input.required(...(ngDevMode ? [{ debugName: "activeDate" }] : /* istanbul ignore next */ []));
|
|
87
|
+
selected = input(null, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
88
|
+
minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
89
|
+
maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
90
|
+
selectedChange = output();
|
|
91
|
+
hoveredDate = signal(null, ...(ngDevMode ? [{ debugName: "hoveredDate" }] : /* istanbul ignore next */ []));
|
|
92
|
+
weekdays = computed(() => {
|
|
93
|
+
return this._dateAdapter.getDayOfWeekNames('short');
|
|
94
|
+
}, ...(ngDevMode ? [{ debugName: "weekdays" }] : /* istanbul ignore next */ []));
|
|
95
|
+
weeks = computed(() => {
|
|
96
|
+
const activeDate = this.activeDate();
|
|
97
|
+
const hoveredDate = this.hoveredDate();
|
|
98
|
+
const firstDayOfMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(activeDate), this._dateAdapter.getMonth(activeDate), 1);
|
|
99
|
+
const daysInMonth = this._dateAdapter.getNumDaysInMonth(activeDate);
|
|
100
|
+
const firstDayOfWeek = this._dateAdapter.getDayOfWeek(firstDayOfMonth);
|
|
101
|
+
const weeks = [];
|
|
102
|
+
let currentWeek = [];
|
|
103
|
+
// Offset for the first week
|
|
104
|
+
for (let i = 0; i < firstDayOfWeek; i++) {
|
|
105
|
+
currentWeek.push({ date: null, label: '', selected: false, current: false, inRange: false, rangeStart: false, rangeEnd: false });
|
|
106
|
+
}
|
|
107
|
+
const today = this._dateAdapter.today();
|
|
108
|
+
const selected = this.selected();
|
|
109
|
+
for (let i = 1; i <= daysInMonth; i++) {
|
|
110
|
+
const date = this._dateAdapter.createDate(this._dateAdapter.getYear(activeDate), this._dateAdapter.getMonth(activeDate), i);
|
|
111
|
+
let isSelected = false;
|
|
112
|
+
let inRange = false;
|
|
113
|
+
let rangeStart = false;
|
|
114
|
+
let rangeEnd = false;
|
|
115
|
+
if (selected instanceof DateRange) {
|
|
116
|
+
if (selected.start && selected.end) {
|
|
117
|
+
inRange = this._dateAdapter.compareDate(date, selected.start) >= 0 &&
|
|
118
|
+
this._dateAdapter.compareDate(date, selected.end) <= 0;
|
|
119
|
+
rangeStart = this._dateAdapter.sameDate(date, selected.start);
|
|
120
|
+
rangeEnd = this._dateAdapter.sameDate(date, selected.end);
|
|
121
|
+
}
|
|
122
|
+
else if (selected.start) {
|
|
123
|
+
isSelected = this._dateAdapter.sameDate(date, selected.start);
|
|
124
|
+
rangeStart = isSelected;
|
|
125
|
+
if (hoveredDate) {
|
|
126
|
+
const comparison = this._dateAdapter.compareDate(date, selected.start);
|
|
127
|
+
const hoverComparison = this._dateAdapter.compareDate(date, hoveredDate);
|
|
128
|
+
if (this._dateAdapter.compareDate(hoveredDate, selected.start) >= 0) {
|
|
129
|
+
inRange = comparison >= 0 && hoverComparison <= 0;
|
|
130
|
+
rangeEnd = this._dateAdapter.sameDate(date, hoveredDate);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
inRange = comparison <= 0 && hoverComparison >= 0;
|
|
134
|
+
rangeStart = this._dateAdapter.sameDate(date, hoveredDate);
|
|
135
|
+
rangeEnd = isSelected;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else if (selected.end) {
|
|
140
|
+
isSelected = this._dateAdapter.sameDate(date, selected.end);
|
|
141
|
+
rangeEnd = isSelected;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
isSelected = this._dateAdapter.sameDate(date, selected);
|
|
146
|
+
}
|
|
147
|
+
currentWeek.push({
|
|
148
|
+
date,
|
|
149
|
+
label: i.toString(),
|
|
150
|
+
selected: isSelected,
|
|
151
|
+
current: this._dateAdapter.sameDate(date, today),
|
|
152
|
+
inRange,
|
|
153
|
+
rangeStart,
|
|
154
|
+
rangeEnd
|
|
155
|
+
});
|
|
156
|
+
if (currentWeek.length === 7) {
|
|
157
|
+
weeks.push(currentWeek);
|
|
158
|
+
currentWeek = [];
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (currentWeek.length > 0) {
|
|
162
|
+
while (currentWeek.length < 7) {
|
|
163
|
+
currentWeek.push({ date: null, label: '', selected: false, current: false, inRange: false, rangeStart: false, rangeEnd: false });
|
|
164
|
+
}
|
|
165
|
+
weeks.push(currentWeek);
|
|
166
|
+
}
|
|
167
|
+
return weeks;
|
|
168
|
+
}, ...(ngDevMode ? [{ debugName: "weeks" }] : /* istanbul ignore next */ []));
|
|
169
|
+
selectDate(date) {
|
|
170
|
+
if (date) {
|
|
171
|
+
this.selectedChange.emit(date);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
handleHover(date) {
|
|
175
|
+
this.hoveredDate.set(date);
|
|
176
|
+
}
|
|
177
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MonthView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
178
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: MonthView, isStandalone: true, selector: "ngs-month-view", inputs: { activeDate: { classPropertyName: "activeDate", publicName: "activeDate", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange" }, host: { listeners: { "mouseleave": "handleHover(null)" }, classAttribute: "ngs-month-view" }, ngImport: i0, template: "<table class=\"ngs-calendar-table\">\n <thead class=\"ngs-calendar-table-header\">\n <tr>\n @for (day of weekdays(); track $index) {\n <th scope=\"col\">{{ day }}</th>\n }\n </tr>\n </thead>\n <tbody class=\"ngs-calendar-table-body\">\n @for (week of weeks(); track $index) {\n @if (week[0].date || week[6].date) {\n <tr>\n @for (day of week; track $index) {\n <td\n class=\"ngs-calendar-cell\"\n [class.ngs-calendar-cell-selected]=\"day.selected\"\n [class.ngs-calendar-cell-today]=\"day.current\"\n [class.ngs-calendar-cell-empty]=\"!day.date\"\n [class.ngs-calendar-cell-in-range]=\"day.inRange\"\n [class.ngs-calendar-cell-range-start]=\"day.rangeStart\"\n [class.ngs-calendar-cell-range-end]=\"day.rangeEnd\"\n (click)=\"selectDate(day.date)\"\n (mouseenter)=\"handleHover(day.date)\"\n >\n <div class=\"ngs-calendar-cell-content\">\n {{ day.label }}\n </div>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n</table>\n", styles: [":host{display:block;height:100%;min-height:calc(var(--ngs-calendar-cell-size) * 6 + calc(var(--spacing, .25rem) * 2))}:host .ngs-calendar-table{width:100%;border-collapse:collapse;border-spacing:0}:host .ngs-calendar-table th{padding:8px 0;font-size:.75rem;color:var(--color-on-surface-variant);text-align:center}:host .ngs-calendar-cell{width:var(--ngs-calendar-cell-size);height:var(--ngs-calendar-cell-size);border-radius:var(--ngs-calendar-cell-radius);text-align:center;cursor:pointer;position:relative;box-sizing:border-box}:host .ngs-calendar-cell.ngs-calendar-cell-selected{background:var(--ngs-calendar-cell-selected-bg);color:var(--ngs-calendar-cell-selected-color);z-index:1}:host .ngs-calendar-cell.ngs-calendar-cell-in-range{background:var(--ngs-calendar-cell-in-range-bg);border-radius:0}:host .ngs-calendar-cell.ngs-calendar-cell-range-start{border-top-left-radius:var(--ngs-calendar-cell-radius);border-bottom-left-radius:var(--ngs-calendar-cell-radius);background:var(--ngs-calendar-cell-selected-bg);color:var(--ngs-calendar-cell-selected-color);z-index:1}:host .ngs-calendar-cell.ngs-calendar-cell-range-end{border-top-right-radius:var(--ngs-calendar-cell-radius);border-bottom-right-radius:var(--ngs-calendar-cell-radius);background:var(--ngs-calendar-cell-selected-bg);color:var(--ngs-calendar-cell-selected-color);z-index:1}:host .ngs-calendar-cell.ngs-calendar-cell-range-start.ngs-calendar-cell-range-end{border-radius:var(--ngs-calendar-cell-radius)}:host .ngs-calendar-cell:not(.ngs-calendar-cell-empty):not(.ngs-calendar-cell-selected):not(.ngs-calendar-cell-range-start):not(.ngs-calendar-cell-range-end):hover{background:var(--ngs-calendar-cell-hover-bg)}:host .ngs-calendar-cell-empty{cursor:default}:host .ngs-calendar-cell-today{z-index:1}:host .ngs-calendar-cell-today .ngs-calendar-cell-content{outline:var(--ngs-calendar-cell-today-border);border-radius:inherit}:host .ngs-calendar-cell-content{display:flex;align-items:center;justify-content:center;height:100%}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
179
|
+
}
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MonthView, decorators: [{
|
|
181
|
+
type: Component,
|
|
182
|
+
args: [{ selector: 'ngs-month-view', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
183
|
+
'class': 'ngs-month-view',
|
|
184
|
+
'(mouseleave)': 'handleHover(null)'
|
|
185
|
+
}, template: "<table class=\"ngs-calendar-table\">\n <thead class=\"ngs-calendar-table-header\">\n <tr>\n @for (day of weekdays(); track $index) {\n <th scope=\"col\">{{ day }}</th>\n }\n </tr>\n </thead>\n <tbody class=\"ngs-calendar-table-body\">\n @for (week of weeks(); track $index) {\n @if (week[0].date || week[6].date) {\n <tr>\n @for (day of week; track $index) {\n <td\n class=\"ngs-calendar-cell\"\n [class.ngs-calendar-cell-selected]=\"day.selected\"\n [class.ngs-calendar-cell-today]=\"day.current\"\n [class.ngs-calendar-cell-empty]=\"!day.date\"\n [class.ngs-calendar-cell-in-range]=\"day.inRange\"\n [class.ngs-calendar-cell-range-start]=\"day.rangeStart\"\n [class.ngs-calendar-cell-range-end]=\"day.rangeEnd\"\n (click)=\"selectDate(day.date)\"\n (mouseenter)=\"handleHover(day.date)\"\n >\n <div class=\"ngs-calendar-cell-content\">\n {{ day.label }}\n </div>\n </td>\n }\n </tr>\n }\n }\n </tbody>\n</table>\n", styles: [":host{display:block;height:100%;min-height:calc(var(--ngs-calendar-cell-size) * 6 + calc(var(--spacing, .25rem) * 2))}:host .ngs-calendar-table{width:100%;border-collapse:collapse;border-spacing:0}:host .ngs-calendar-table th{padding:8px 0;font-size:.75rem;color:var(--color-on-surface-variant);text-align:center}:host .ngs-calendar-cell{width:var(--ngs-calendar-cell-size);height:var(--ngs-calendar-cell-size);border-radius:var(--ngs-calendar-cell-radius);text-align:center;cursor:pointer;position:relative;box-sizing:border-box}:host .ngs-calendar-cell.ngs-calendar-cell-selected{background:var(--ngs-calendar-cell-selected-bg);color:var(--ngs-calendar-cell-selected-color);z-index:1}:host .ngs-calendar-cell.ngs-calendar-cell-in-range{background:var(--ngs-calendar-cell-in-range-bg);border-radius:0}:host .ngs-calendar-cell.ngs-calendar-cell-range-start{border-top-left-radius:var(--ngs-calendar-cell-radius);border-bottom-left-radius:var(--ngs-calendar-cell-radius);background:var(--ngs-calendar-cell-selected-bg);color:var(--ngs-calendar-cell-selected-color);z-index:1}:host .ngs-calendar-cell.ngs-calendar-cell-range-end{border-top-right-radius:var(--ngs-calendar-cell-radius);border-bottom-right-radius:var(--ngs-calendar-cell-radius);background:var(--ngs-calendar-cell-selected-bg);color:var(--ngs-calendar-cell-selected-color);z-index:1}:host .ngs-calendar-cell.ngs-calendar-cell-range-start.ngs-calendar-cell-range-end{border-radius:var(--ngs-calendar-cell-radius)}:host .ngs-calendar-cell:not(.ngs-calendar-cell-empty):not(.ngs-calendar-cell-selected):not(.ngs-calendar-cell-range-start):not(.ngs-calendar-cell-range-end):hover{background:var(--ngs-calendar-cell-hover-bg)}:host .ngs-calendar-cell-empty{cursor:default}:host .ngs-calendar-cell-today{z-index:1}:host .ngs-calendar-cell-today .ngs-calendar-cell-content{outline:var(--ngs-calendar-cell-today-border);border-radius:inherit}:host .ngs-calendar-cell-content{display:flex;align-items:center;justify-content:center;height:100%}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
186
|
+
}], propDecorators: { activeDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeDate", required: true }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], selectedChange: [{ type: i0.Output, args: ["selectedChange"] }] } });
|
|
187
|
+
|
|
188
|
+
class YearView {
|
|
189
|
+
_dateAdapter = inject(DateAdapter);
|
|
190
|
+
activeDate = input.required(...(ngDevMode ? [{ debugName: "activeDate" }] : /* istanbul ignore next */ []));
|
|
191
|
+
selected = input(null, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
192
|
+
monthSelected = output();
|
|
193
|
+
months = computed(() => {
|
|
194
|
+
const activeDate = this.activeDate();
|
|
195
|
+
const monthNames = this._dateAdapter.getMonthNames('short');
|
|
196
|
+
const today = this._dateAdapter.today();
|
|
197
|
+
const currentYear = this._dateAdapter.getYear(activeDate);
|
|
198
|
+
const selectedYear = this.selected() ? this._dateAdapter.getYear(this.selected()) : null;
|
|
199
|
+
const selectedMonth = this.selected() ? this._dateAdapter.getMonth(this.selected()) : null;
|
|
200
|
+
const todayYear = this._dateAdapter.getYear(today);
|
|
201
|
+
const todayMonth = this._dateAdapter.getMonth(today);
|
|
202
|
+
const months = [];
|
|
203
|
+
let currentRow = [];
|
|
204
|
+
for (let i = 0; i < 12; i++) {
|
|
205
|
+
currentRow.push({
|
|
206
|
+
index: i,
|
|
207
|
+
label: monthNames[i],
|
|
208
|
+
selected: currentYear === selectedYear && i === selectedMonth,
|
|
209
|
+
current: currentYear === todayYear && i === todayMonth,
|
|
210
|
+
});
|
|
211
|
+
if (currentRow.length === 4) {
|
|
212
|
+
months.push(currentRow);
|
|
213
|
+
currentRow = [];
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return months;
|
|
217
|
+
}, ...(ngDevMode ? [{ debugName: "months" }] : /* istanbul ignore next */ []));
|
|
218
|
+
selectMonth(month) {
|
|
219
|
+
const date = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate()), month, 1);
|
|
220
|
+
this.monthSelected.emit(date);
|
|
221
|
+
}
|
|
222
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: YearView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
223
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: YearView, isStandalone: true, selector: "ngs-year-view", inputs: { activeDate: { classPropertyName: "activeDate", publicName: "activeDate", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { monthSelected: "monthSelected" }, host: { classAttribute: "ngs-year-view" }, ngImport: i0, template: "<table class=\"ngs-calendar-table\">\n <tbody class=\"ngs-calendar-table-body\">\n @for (row of months(); track row) {\n <tr>\n @for (month of row; track month.index) {\n <td\n class=\"ngs-calendar-cell\"\n [class.ngs-calendar-cell-selected]=\"month.selected\"\n [class.ngs-calendar-cell-today]=\"month.current\"\n (click)=\"selectMonth(month.index)\"\n >\n <div class=\"ngs-calendar-cell-content\">\n {{ month.label }}\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n", styles: [":host{display:block;height:100%}:host .ngs-calendar-table{width:100%;border-collapse:collapse;border-spacing:0}:host .ngs-calendar-cell{width:var(--ngs-calendar-cell-size);height:var(--ngs-calendar-cell-size);text-align:center;cursor:pointer;border-radius:var(--ngs-calendar-cell-radius);position:relative;box-sizing:border-box}:host .ngs-calendar-cell.ngs-calendar-cell-selected{background:var(--ngs-calendar-cell-selected-bg);color:var(--ngs-calendar-cell-selected-color);z-index:1}:host .ngs-calendar-cell:not(.ngs-calendar-cell-empty):not(.ngs-calendar-cell-selected):hover{background:var(--ngs-calendar-cell-hover-bg)}:host .ngs-calendar-cell-today{z-index:1}:host .ngs-calendar-cell-today .ngs-calendar-cell-content{outline:var(--ngs-calendar-cell-today-border);border-radius:inherit}:host .ngs-calendar-cell-content{display:flex;align-items:center;justify-content:center;height:100%}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
224
|
+
}
|
|
225
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: YearView, decorators: [{
|
|
226
|
+
type: Component,
|
|
227
|
+
args: [{ selector: 'ngs-year-view', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
228
|
+
'class': 'ngs-year-view',
|
|
229
|
+
}, template: "<table class=\"ngs-calendar-table\">\n <tbody class=\"ngs-calendar-table-body\">\n @for (row of months(); track row) {\n <tr>\n @for (month of row; track month.index) {\n <td\n class=\"ngs-calendar-cell\"\n [class.ngs-calendar-cell-selected]=\"month.selected\"\n [class.ngs-calendar-cell-today]=\"month.current\"\n (click)=\"selectMonth(month.index)\"\n >\n <div class=\"ngs-calendar-cell-content\">\n {{ month.label }}\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n", styles: [":host{display:block;height:100%}:host .ngs-calendar-table{width:100%;border-collapse:collapse;border-spacing:0}:host .ngs-calendar-cell{width:var(--ngs-calendar-cell-size);height:var(--ngs-calendar-cell-size);text-align:center;cursor:pointer;border-radius:var(--ngs-calendar-cell-radius);position:relative;box-sizing:border-box}:host .ngs-calendar-cell.ngs-calendar-cell-selected{background:var(--ngs-calendar-cell-selected-bg);color:var(--ngs-calendar-cell-selected-color);z-index:1}:host .ngs-calendar-cell:not(.ngs-calendar-cell-empty):not(.ngs-calendar-cell-selected):hover{background:var(--ngs-calendar-cell-hover-bg)}:host .ngs-calendar-cell-today{z-index:1}:host .ngs-calendar-cell-today .ngs-calendar-cell-content{outline:var(--ngs-calendar-cell-today-border);border-radius:inherit}:host .ngs-calendar-cell-content{display:flex;align-items:center;justify-content:center;height:100%}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
230
|
+
}], propDecorators: { activeDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeDate", required: true }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], monthSelected: [{ type: i0.Output, args: ["monthSelected"] }] } });
|
|
231
|
+
|
|
232
|
+
const YEARS_PER_ROW = 4;
|
|
233
|
+
const YEARS_PER_PAGE = 24;
|
|
234
|
+
class MultiYearView {
|
|
235
|
+
_dateAdapter = inject(DateAdapter);
|
|
236
|
+
activeDate = input.required(...(ngDevMode ? [{ debugName: "activeDate" }] : /* istanbul ignore next */ []));
|
|
237
|
+
selected = input(null, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
238
|
+
yearSelected = output();
|
|
239
|
+
years = computed(() => {
|
|
240
|
+
const activeDate = this.activeDate();
|
|
241
|
+
const today = this._dateAdapter.today();
|
|
242
|
+
const currentYear = this._dateAdapter.getYear(activeDate);
|
|
243
|
+
const selectedYear = this.selected() ? this._dateAdapter.getYear(this.selected()) : null;
|
|
244
|
+
const todayYear = this._dateAdapter.getYear(today);
|
|
245
|
+
const startYear = Math.floor(currentYear / YEARS_PER_PAGE) * YEARS_PER_PAGE;
|
|
246
|
+
const years = [];
|
|
247
|
+
let currentRow = [];
|
|
248
|
+
for (let i = 0; i < YEARS_PER_PAGE; i++) {
|
|
249
|
+
const yearValue = startYear + i;
|
|
250
|
+
const date = this._dateAdapter.createDate(yearValue, 0, 1);
|
|
251
|
+
currentRow.push({
|
|
252
|
+
value: yearValue,
|
|
253
|
+
label: this._dateAdapter.getYearName(date),
|
|
254
|
+
selected: yearValue === selectedYear,
|
|
255
|
+
current: yearValue === todayYear,
|
|
256
|
+
});
|
|
257
|
+
if (currentRow.length === YEARS_PER_ROW) {
|
|
258
|
+
years.push(currentRow);
|
|
259
|
+
currentRow = [];
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return years;
|
|
263
|
+
}, ...(ngDevMode ? [{ debugName: "years" }] : /* istanbul ignore next */ []));
|
|
264
|
+
selectYear(year) {
|
|
265
|
+
const date = this._dateAdapter.createDate(year, 0, 1);
|
|
266
|
+
this.yearSelected.emit(date);
|
|
267
|
+
}
|
|
268
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MultiYearView, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
269
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: MultiYearView, isStandalone: true, selector: "ngs-multi-year-view", inputs: { activeDate: { classPropertyName: "activeDate", publicName: "activeDate", isSignal: true, isRequired: true, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { yearSelected: "yearSelected" }, host: { classAttribute: "ngs-multi-year-view" }, ngImport: i0, template: "<table class=\"ngs-calendar-table\">\n <tbody class=\"ngs-calendar-table-body\">\n @for (row of years(); track row) {\n <tr>\n @for (year of row; track year.label) {\n <td\n class=\"ngs-calendar-cell\"\n [class.ngs-calendar-cell-selected]=\"year.selected\"\n [class.ngs-calendar-cell-today]=\"year.current\"\n (click)=\"selectYear(year.value)\"\n >\n <div class=\"ngs-calendar-cell-content\">\n {{ year.label }}\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n", styles: [":host{display:block;height:100%}:host .ngs-calendar-table{width:100%;border-collapse:collapse;border-spacing:0}:host .ngs-calendar-cell{width:var(--ngs-calendar-cell-size);height:var(--ngs-calendar-cell-size);text-align:center;cursor:pointer;border-radius:var(--ngs-calendar-cell-radius);position:relative;box-sizing:border-box}:host .ngs-calendar-cell.ngs-calendar-cell-selected{background:var(--ngs-calendar-cell-selected-bg);color:var(--ngs-calendar-cell-selected-color);z-index:1}:host .ngs-calendar-cell:not(.ngs-calendar-cell-empty):not(.ngs-calendar-cell-selected):hover{background:var(--ngs-calendar-cell-hover-bg)}:host .ngs-calendar-cell-today{z-index:1}:host .ngs-calendar-cell-today .ngs-calendar-cell-content{outline:var(--ngs-calendar-cell-today-border);border-radius:inherit}:host .ngs-calendar-cell-content{display:flex;align-items:center;justify-content:center;height:100%}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
270
|
+
}
|
|
271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: MultiYearView, decorators: [{
|
|
272
|
+
type: Component,
|
|
273
|
+
args: [{ selector: 'ngs-multi-year-view', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
274
|
+
'class': 'ngs-multi-year-view',
|
|
275
|
+
}, template: "<table class=\"ngs-calendar-table\">\n <tbody class=\"ngs-calendar-table-body\">\n @for (row of years(); track row) {\n <tr>\n @for (year of row; track year.label) {\n <td\n class=\"ngs-calendar-cell\"\n [class.ngs-calendar-cell-selected]=\"year.selected\"\n [class.ngs-calendar-cell-today]=\"year.current\"\n (click)=\"selectYear(year.value)\"\n >\n <div class=\"ngs-calendar-cell-content\">\n {{ year.label }}\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n", styles: [":host{display:block;height:100%}:host .ngs-calendar-table{width:100%;border-collapse:collapse;border-spacing:0}:host .ngs-calendar-cell{width:var(--ngs-calendar-cell-size);height:var(--ngs-calendar-cell-size);text-align:center;cursor:pointer;border-radius:var(--ngs-calendar-cell-radius);position:relative;box-sizing:border-box}:host .ngs-calendar-cell.ngs-calendar-cell-selected{background:var(--ngs-calendar-cell-selected-bg);color:var(--ngs-calendar-cell-selected-color);z-index:1}:host .ngs-calendar-cell:not(.ngs-calendar-cell-empty):not(.ngs-calendar-cell-selected):hover{background:var(--ngs-calendar-cell-hover-bg)}:host .ngs-calendar-cell-today{z-index:1}:host .ngs-calendar-cell-today .ngs-calendar-cell-content{outline:var(--ngs-calendar-cell-today-border);border-radius:inherit}:host .ngs-calendar-cell-content{display:flex;align-items:center;justify-content:center;height:100%}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
276
|
+
}], propDecorators: { activeDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeDate", required: true }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], yearSelected: [{ type: i0.Output, args: ["yearSelected"] }] } });
|
|
277
|
+
|
|
278
|
+
class Calendar {
|
|
279
|
+
_dateAdapter = inject(DateAdapter);
|
|
280
|
+
_intl = inject(DatepickerIntl);
|
|
281
|
+
startAt = input(null, ...(ngDevMode ? [{ debugName: "startAt" }] : /* istanbul ignore next */ []));
|
|
282
|
+
selected = input(null, ...(ngDevMode ? [{ debugName: "selected" }] : /* istanbul ignore next */ []));
|
|
283
|
+
minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
284
|
+
maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
285
|
+
headerComponent = input(null, ...(ngDevMode ? [{ debugName: "headerComponent" }] : /* istanbul ignore next */ []));
|
|
286
|
+
selectedChange = output();
|
|
287
|
+
yearSelected = output();
|
|
288
|
+
monthSelected = output();
|
|
289
|
+
activeDate = signal(this.startAt() || this._dateAdapter.today(), ...(ngDevMode ? [{ debugName: "activeDate" }] : /* istanbul ignore next */ []));
|
|
290
|
+
constructor() {
|
|
291
|
+
effect(() => {
|
|
292
|
+
const selected = this.selected();
|
|
293
|
+
if (selected instanceof DateRange) {
|
|
294
|
+
if (selected.start) {
|
|
295
|
+
this.activeDate.set(selected.start);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
else if (selected) {
|
|
299
|
+
this.activeDate.set(selected);
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
effect(() => {
|
|
303
|
+
const startAt = this.startAt();
|
|
304
|
+
if (startAt) {
|
|
305
|
+
this.activeDate.set(startAt);
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
currentView = signal('month', ...(ngDevMode ? [{ debugName: "currentView" }] : /* istanbul ignore next */ []));
|
|
310
|
+
_selectedDate = computed(() => {
|
|
311
|
+
const selected = this.selected();
|
|
312
|
+
if (selected instanceof DateRange) {
|
|
313
|
+
return selected.start;
|
|
314
|
+
}
|
|
315
|
+
return selected;
|
|
316
|
+
}, ...(ngDevMode ? [{ debugName: "_selectedDate" }] : /* istanbul ignore next */ []));
|
|
317
|
+
periodButtonText = computed(() => {
|
|
318
|
+
const activeDate = this.activeDate();
|
|
319
|
+
if (!activeDate || !this._dateAdapter.isValid(activeDate)) {
|
|
320
|
+
return '';
|
|
321
|
+
}
|
|
322
|
+
if (this.currentView() === 'month') {
|
|
323
|
+
return this._dateAdapter.format(activeDate, { month: 'long', year: 'numeric' });
|
|
324
|
+
}
|
|
325
|
+
if (this.currentView() === 'year') {
|
|
326
|
+
return this._dateAdapter.getYearName(activeDate);
|
|
327
|
+
}
|
|
328
|
+
if (this.currentView() === 'multi-year') {
|
|
329
|
+
const currentYear = this._dateAdapter.getYear(activeDate);
|
|
330
|
+
const startYear = Math.floor(currentYear / 24) * 24;
|
|
331
|
+
const endYear = startYear + 23;
|
|
332
|
+
const startDate = this._dateAdapter.createDate(startYear, 0, 1);
|
|
333
|
+
const endDate = this._dateAdapter.createDate(endYear, 0, 1);
|
|
334
|
+
return `${this._dateAdapter.getYearName(startDate)} - ${this._dateAdapter.getYearName(endDate)}`;
|
|
335
|
+
}
|
|
336
|
+
return '';
|
|
337
|
+
}, ...(ngDevMode ? [{ debugName: "periodButtonText" }] : /* istanbul ignore next */ []));
|
|
338
|
+
prevPage() {
|
|
339
|
+
this.activeDate.update(date => {
|
|
340
|
+
if (this.currentView() === 'month') {
|
|
341
|
+
return this._dateAdapter.addCalendarMonths(date, -1);
|
|
342
|
+
}
|
|
343
|
+
if (this.currentView() === 'year') {
|
|
344
|
+
return this._dateAdapter.addCalendarYears(date, -1);
|
|
345
|
+
}
|
|
346
|
+
if (this.currentView() === 'multi-year') {
|
|
347
|
+
return this._dateAdapter.addCalendarYears(date, -24);
|
|
348
|
+
}
|
|
349
|
+
return date;
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
nextPage() {
|
|
353
|
+
this.activeDate.update(date => {
|
|
354
|
+
if (this.currentView() === 'month') {
|
|
355
|
+
return this._dateAdapter.addCalendarMonths(date, 1);
|
|
356
|
+
}
|
|
357
|
+
if (this.currentView() === 'year') {
|
|
358
|
+
return this._dateAdapter.addCalendarYears(date, 1);
|
|
359
|
+
}
|
|
360
|
+
if (this.currentView() === 'multi-year') {
|
|
361
|
+
return this._dateAdapter.addCalendarYears(date, 24);
|
|
362
|
+
}
|
|
363
|
+
return date;
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
toggleView() {
|
|
367
|
+
this.currentView.update(view => {
|
|
368
|
+
if (view === 'month') {
|
|
369
|
+
return 'multi-year';
|
|
370
|
+
}
|
|
371
|
+
if (view === 'year') {
|
|
372
|
+
return 'multi-year';
|
|
373
|
+
}
|
|
374
|
+
return 'month';
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
_monthSelectedInYearView(date) {
|
|
378
|
+
this.activeDate.set(date);
|
|
379
|
+
this.currentView.set('month');
|
|
380
|
+
this.monthSelected.emit(date);
|
|
381
|
+
}
|
|
382
|
+
_yearSelectedInMultiYearView(date) {
|
|
383
|
+
this.activeDate.set(date);
|
|
384
|
+
this.currentView.set('year');
|
|
385
|
+
this.yearSelected.emit(date);
|
|
386
|
+
}
|
|
387
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Calendar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
388
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: Calendar, isStandalone: true, selector: "ngs-calendar", inputs: { startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null }, selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, headerComponent: { classPropertyName: "headerComponent", publicName: "headerComponent", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectedChange: "selectedChange", yearSelected: "yearSelected", monthSelected: "monthSelected" }, host: { classAttribute: "ngs-calendar" }, exportAs: ["ngsCalendar"], ngImport: i0, template: "@if (headerComponent()) {\n <ng-container *ngComponentOutlet=\"headerComponent()\" />\n} @else {\n <div class=\"ngs-calendar-header\">\n <button type=\"button\" (click)=\"toggleView()\" class=\"ngs-calendar-period-button\">\n {{ periodButtonText() }}\n </button>\n <div class=\"ngs-calendar-header-actions\">\n <button type=\"button\" ngsIconButton (click)=\"prevPage()\" class=\"ngs-calendar-previous-button\">\n <ngs-icon name=\"fluent:chevron-left-24-regular\" />\n </button>\n <button type=\"button\" ngsIconButton (click)=\"nextPage()\" class=\"ngs-calendar-next-button\">\n <ngs-icon name=\"fluent:chevron-right-24-regular\" />\n </button>\n </div>\n </div>\n}\n\n<div class=\"ngs-calendar-content\">\n @if (currentView() === 'month') {\n <ngs-month-view [activeDate]=\"activeDate()\"\n [selected]=\"selected()\"\n (selectedChange)=\"selectedChange.emit($event)\"\n />\n } @else if (currentView() === 'year') {\n <ngs-year-view [activeDate]=\"activeDate()\"\n [selected]=\"_selectedDate()\"\n (monthSelected)=\"_monthSelectedInYearView($event)\"\n />\n } @else if (currentView() === 'multi-year') {\n <ngs-multi-year-view [activeDate]=\"activeDate()\"\n [selected]=\"_selectedDate()\"\n (yearSelected)=\"_yearSelectedInMultiYearView($event)\"\n />\n }\n</div>\n", styles: [":host{display:flex;flex-direction:column;width:calc(var(--ngs-calendar-cell-size) * 7 + var(--ngs-calendar-padding) * 2 + calc(var(--spacing, .25rem) * 2));min-height:calc(var(--ngs-calendar-cell-size) * 5 + calc(var(--spacing, .25rem) * 2));padding:calc(var(--spacing, .25rem) * 2)}:host .ngs-calendar-header{display:flex;justify-content:space-between;align-items:center;padding-bottom:var(--ngs-calendar-header-padding);flex-shrink:0;margin-inline-start:calc(var(--spacing, .25rem) * 2)}:host .ngs-calendar-period-button{background:transparent;border:none;cursor:pointer;font-weight:700}:host .ngs-calendar-period-button:hover{color:var(--color-primary)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: MonthView, selector: "ngs-month-view", inputs: ["activeDate", "selected", "minDate", "maxDate"], outputs: ["selectedChange"] }, { kind: "component", type: YearView, selector: "ngs-year-view", inputs: ["activeDate", "selected"], outputs: ["monthSelected"] }, { kind: "component", type: MultiYearView, selector: "ngs-multi-year-view", inputs: ["activeDate", "selected"], outputs: ["yearSelected"] }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
389
|
+
}
|
|
390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Calendar, decorators: [{
|
|
391
|
+
type: Component,
|
|
392
|
+
args: [{ selector: 'ngs-calendar', standalone: true, imports: [MonthView, YearView, MultiYearView, Button, Icon, NgComponentOutlet], changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'ngsCalendar', host: {
|
|
393
|
+
'class': 'ngs-calendar',
|
|
394
|
+
}, template: "@if (headerComponent()) {\n <ng-container *ngComponentOutlet=\"headerComponent()\" />\n} @else {\n <div class=\"ngs-calendar-header\">\n <button type=\"button\" (click)=\"toggleView()\" class=\"ngs-calendar-period-button\">\n {{ periodButtonText() }}\n </button>\n <div class=\"ngs-calendar-header-actions\">\n <button type=\"button\" ngsIconButton (click)=\"prevPage()\" class=\"ngs-calendar-previous-button\">\n <ngs-icon name=\"fluent:chevron-left-24-regular\" />\n </button>\n <button type=\"button\" ngsIconButton (click)=\"nextPage()\" class=\"ngs-calendar-next-button\">\n <ngs-icon name=\"fluent:chevron-right-24-regular\" />\n </button>\n </div>\n </div>\n}\n\n<div class=\"ngs-calendar-content\">\n @if (currentView() === 'month') {\n <ngs-month-view [activeDate]=\"activeDate()\"\n [selected]=\"selected()\"\n (selectedChange)=\"selectedChange.emit($event)\"\n />\n } @else if (currentView() === 'year') {\n <ngs-year-view [activeDate]=\"activeDate()\"\n [selected]=\"_selectedDate()\"\n (monthSelected)=\"_monthSelectedInYearView($event)\"\n />\n } @else if (currentView() === 'multi-year') {\n <ngs-multi-year-view [activeDate]=\"activeDate()\"\n [selected]=\"_selectedDate()\"\n (yearSelected)=\"_yearSelectedInMultiYearView($event)\"\n />\n }\n</div>\n", styles: [":host{display:flex;flex-direction:column;width:calc(var(--ngs-calendar-cell-size) * 7 + var(--ngs-calendar-padding) * 2 + calc(var(--spacing, .25rem) * 2));min-height:calc(var(--ngs-calendar-cell-size) * 5 + calc(var(--spacing, .25rem) * 2));padding:calc(var(--spacing, .25rem) * 2)}:host .ngs-calendar-header{display:flex;justify-content:space-between;align-items:center;padding-bottom:var(--ngs-calendar-header-padding);flex-shrink:0;margin-inline-start:calc(var(--spacing, .25rem) * 2)}:host .ngs-calendar-period-button{background:transparent;border:none;cursor:pointer;font-weight:700}:host .ngs-calendar-period-button:hover{color:var(--color-primary)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
395
|
+
}], ctorParameters: () => [], propDecorators: { startAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "startAt", required: false }] }], selected: [{ type: i0.Input, args: [{ isSignal: true, alias: "selected", required: false }] }], minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], headerComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerComponent", required: false }] }], selectedChange: [{ type: i0.Output, args: ["selectedChange"] }], yearSelected: [{ type: i0.Output, args: ["yearSelected"] }], monthSelected: [{ type: i0.Output, args: ["monthSelected"] }] } });
|
|
396
|
+
|
|
397
|
+
class DatepickerActions {
|
|
398
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerActions, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
399
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: DatepickerActions, isStandalone: true, selector: "ngs-datepicker-actions", ngImport: i0, template: `
|
|
400
|
+
<div class="ngs-datepicker-actions">
|
|
401
|
+
<ng-content />
|
|
402
|
+
</div>
|
|
403
|
+
`, isInline: true, styles: [".ngs-datepicker-actions{display:flex;justify-content:flex-end;gap:8px;padding:8px;border-top:1px solid var(--ngs-datepicker-divider-color, rgba(0, 0, 0, .12))}\n"] });
|
|
404
|
+
}
|
|
405
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerActions, decorators: [{
|
|
406
|
+
type: Component,
|
|
407
|
+
args: [{ selector: 'ngs-datepicker-actions', standalone: true, template: `
|
|
408
|
+
<div class="ngs-datepicker-actions">
|
|
409
|
+
<ng-content />
|
|
410
|
+
</div>
|
|
411
|
+
`, styles: [".ngs-datepicker-actions{display:flex;justify-content:flex-end;gap:8px;padding:8px;border-top:1px solid var(--ngs-datepicker-divider-color, rgba(0, 0, 0, .12))}\n"] }]
|
|
412
|
+
}] });
|
|
413
|
+
|
|
414
|
+
class Datepicker {
|
|
415
|
+
_overlay = inject(Overlay);
|
|
416
|
+
_viewContainerRef = inject(ViewContainerRef);
|
|
417
|
+
_portalTemplate = viewChild.required('portal');
|
|
418
|
+
actions = contentChild(DatepickerActions, ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
419
|
+
startAt = input(null, ...(ngDevMode ? [{ debugName: "startAt" }] : /* istanbul ignore next */ []));
|
|
420
|
+
calendarHeaderComponent = input(null, ...(ngDevMode ? [{ debugName: "calendarHeaderComponent" }] : /* istanbul ignore next */ []));
|
|
421
|
+
quickPresets = input([], ...(ngDevMode ? [{ debugName: "quickPresets" }] : /* istanbul ignore next */ []));
|
|
422
|
+
showQuickPresets = input(false, ...(ngDevMode ? [{ debugName: "showQuickPresets" }] : /* istanbul ignore next */ []));
|
|
423
|
+
_datepickerInput;
|
|
424
|
+
_selected = signal(null, ...(ngDevMode ? [{ debugName: "_selected" }] : /* istanbul ignore next */ []));
|
|
425
|
+
_isAbove = signal(false, ...(ngDevMode ? [{ debugName: "_isAbove" }] : /* istanbul ignore next */ []));
|
|
426
|
+
_overlayRef = null;
|
|
427
|
+
ngOnDestroy() {
|
|
428
|
+
this.close();
|
|
429
|
+
}
|
|
430
|
+
_registerInput(input) {
|
|
431
|
+
this._datepickerInput = input;
|
|
432
|
+
input._valueChange.subscribe((value) => this._selected.set(value));
|
|
433
|
+
}
|
|
434
|
+
open() {
|
|
435
|
+
if (this._overlayRef || !this._datepickerInput)
|
|
436
|
+
return;
|
|
437
|
+
const strategy = this._overlay
|
|
438
|
+
.position()
|
|
439
|
+
.flexibleConnectedTo(this._datepickerInput.getConnectedOverlayOrigin())
|
|
440
|
+
.withPositions([
|
|
441
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },
|
|
442
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },
|
|
443
|
+
]);
|
|
444
|
+
strategy.positionChanges.subscribe(change => {
|
|
445
|
+
this._isAbove.set(change.connectionPair.overlayY === 'bottom');
|
|
446
|
+
});
|
|
447
|
+
this._overlayRef = this._overlay.create({
|
|
448
|
+
positionStrategy: strategy,
|
|
449
|
+
hasBackdrop: true,
|
|
450
|
+
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
451
|
+
});
|
|
452
|
+
this._overlayRef.backdropClick().subscribe(() => this.close());
|
|
453
|
+
const portal = new TemplatePortal(this._portalTemplate(), this._viewContainerRef);
|
|
454
|
+
this._overlayRef.attach(portal);
|
|
455
|
+
}
|
|
456
|
+
close() {
|
|
457
|
+
if (this._overlayRef) {
|
|
458
|
+
this._overlayRef.detach();
|
|
459
|
+
this._overlayRef.dispose();
|
|
460
|
+
this._overlayRef = null;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
_select(date) {
|
|
464
|
+
this._selected.set(date);
|
|
465
|
+
if (!this.actions()) {
|
|
466
|
+
this.apply();
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
_selectPreset(preset) {
|
|
470
|
+
const value = preset.value;
|
|
471
|
+
if (value instanceof DateRange) {
|
|
472
|
+
// For single datepicker we don't expect DateRange, but if it happens, we take start
|
|
473
|
+
this._selected.set(value.start);
|
|
474
|
+
}
|
|
475
|
+
else {
|
|
476
|
+
this._selected.set(value);
|
|
477
|
+
}
|
|
478
|
+
if (!this.actions()) {
|
|
479
|
+
this.apply();
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
apply() {
|
|
483
|
+
const date = this._selected();
|
|
484
|
+
if (this._datepickerInput && date) {
|
|
485
|
+
this._datepickerInput.writeValue(date);
|
|
486
|
+
this._datepickerInput._onChange(date);
|
|
487
|
+
}
|
|
488
|
+
this.close();
|
|
489
|
+
}
|
|
490
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Datepicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
491
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: Datepicker, isStandalone: true, selector: "ngs-datepicker", inputs: { startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null }, calendarHeaderComponent: { classPropertyName: "calendarHeaderComponent", publicName: "calendarHeaderComponent", isSignal: true, isRequired: false, transformFunction: null }, quickPresets: { classPropertyName: "quickPresets", publicName: "quickPresets", isSignal: true, isRequired: false, transformFunction: null }, showQuickPresets: { classPropertyName: "showQuickPresets", publicName: "showQuickPresets", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "actions", first: true, predicate: DatepickerActions, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_portalTemplate", first: true, predicate: ["portal"], descendants: true, isSignal: true }], exportAs: ["ngsDatepicker"], ngImport: i0, template: "<ng-template #portal>\n <div class=\"ngs-datepicker-content\" [class.ngs-datepicker-above]=\"_isAbove()\" [class.ngs-datepicker-below]=\"!_isAbove()\">\n <div class=\"ngs-datepicker-inner-container\">\n @if (showQuickPresets() && quickPresets().length > 0) {\n <div class=\"ngs-datepicker-presets\">\n @for (preset of quickPresets(); track preset.label) {\n <button type=\"button\" class=\"ngs-datepicker-preset\" (click)=\"_selectPreset(preset)\">\n {{ preset.label }}\n </button>\n }\n </div>\n }\n\n <ngs-calendar\n [startAt]=\"startAt()\"\n [selected]=\"_selected()\"\n [headerComponent]=\"calendarHeaderComponent()\"\n (selectedChange)=\"_select($event)\"\n />\n </div>\n\n @if (actions()) {\n <ng-content select=\"ngs-datepicker-actions\"/>\n }\n </div>\n</ng-template>\n", styles: [".ngs-datepicker-content{--ngs-datepicker-bg: var(--dropdown-bg);--ngs-datepicker-color: var(--color-on-surface);--ngs-datepicker-shadow: var(--dropdown-shadow);--ngs-datepicker-radius: var(--dropdown-radius);--ngs-datepicker-border: var(--dropdown-border);--ngs-calendar-padding: calc(var(--spacing, .25rem) * 2);--ngs-calendar-cell-size: calc(var(--spacing, .25rem) * 9);--ngs-calendar-cell-radius: .5rem;--ngs-calendar-cell-hover-bg: var(--color-surface-container-high);--ngs-calendar-cell-selected-bg: var(--color-primary);--ngs-calendar-cell-selected-color: var(--color-on-primary);--ngs-calendar-cell-today-border: 1px solid var(--color-outline);--ngs-calendar-header-padding: 8px;--ngs-calendar-cell-in-range-bg: var(--color-primary-container);--ngs-datepicker-preset-hover-bg: var(--color-surface-container-high);--ngs-datepicker-preset-padding: 8px 16px;--ngs-datepicker-presets-border: 1px solid var(--color-border);background:var(--ngs-datepicker-bg);color:var(--ngs-datepicker-color);box-shadow:var(--ngs-datepicker-shadow);border-radius:var(--ngs-datepicker-radius);border:var(--ngs-datepicker-border);animation:ngs-datepicker-panel-showing .15s cubic-bezier(0,0,.2,1)}.ngs-datepicker-content.ngs-datepicker-below{transform-origin:top}.ngs-datepicker-content.ngs-datepicker-above{transform-origin:bottom}@keyframes ngs-datepicker-panel-showing{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:scaleY(1)}}.ngs-datepicker-content .ngs-datepicker-inner-container{display:flex}.ngs-datepicker-content .ngs-datepicker-presets{display:flex;flex-direction:column;padding:8px 0;border-inline-end:var(--ngs-datepicker-presets-border);min-width:120px}.ngs-datepicker-content .ngs-datepicker-preset{background:transparent;border:none;cursor:pointer;padding:var(--ngs-datepicker-preset-padding);text-align:start;font-size:.875rem;white-space:nowrap}.ngs-datepicker-content .ngs-datepicker-preset:hover{background:var(--ngs-datepicker-preset-hover-bg)}.ngs-date-range-input{display:flex;width:100%}.ngs-date-range-input.ngs-date-range-input-floating .ngs-date-range-input-container{opacity:1}.ngs-date-range-input:not(.ngs-date-range-input-floating) .ngs-date-range-input-container{opacity:0}.ngs-date-range-input-container{display:flex;align-items:center;gap:8px;width:100%;transition:opacity .2s,visibility .2s}.ngs-date-range-input-separator{flex-shrink:0}.ngs-date-range-input-start,.ngs-date-range-input-end{background:transparent;border:none;outline:none;width:80px}.ngs-date-range-input-start input::placeholder,.ngs-date-range-input-end input::placeholder{color:var(--input-label-color)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: OverlayModule }, { kind: "component", type: Calendar, selector: "ngs-calendar", inputs: ["startAt", "selected", "minDate", "maxDate", "headerComponent"], outputs: ["selectedChange", "yearSelected", "monthSelected"], exportAs: ["ngsCalendar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
492
|
+
}
|
|
493
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: Datepicker, decorators: [{
|
|
494
|
+
type: Component,
|
|
495
|
+
args: [{ selector: 'ngs-datepicker', exportAs: 'ngsDatepicker', standalone: true, imports: [
|
|
496
|
+
OverlayModule,
|
|
497
|
+
Calendar
|
|
498
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<ng-template #portal>\n <div class=\"ngs-datepicker-content\" [class.ngs-datepicker-above]=\"_isAbove()\" [class.ngs-datepicker-below]=\"!_isAbove()\">\n <div class=\"ngs-datepicker-inner-container\">\n @if (showQuickPresets() && quickPresets().length > 0) {\n <div class=\"ngs-datepicker-presets\">\n @for (preset of quickPresets(); track preset.label) {\n <button type=\"button\" class=\"ngs-datepicker-preset\" (click)=\"_selectPreset(preset)\">\n {{ preset.label }}\n </button>\n }\n </div>\n }\n\n <ngs-calendar\n [startAt]=\"startAt()\"\n [selected]=\"_selected()\"\n [headerComponent]=\"calendarHeaderComponent()\"\n (selectedChange)=\"_select($event)\"\n />\n </div>\n\n @if (actions()) {\n <ng-content select=\"ngs-datepicker-actions\"/>\n }\n </div>\n</ng-template>\n", styles: [".ngs-datepicker-content{--ngs-datepicker-bg: var(--dropdown-bg);--ngs-datepicker-color: var(--color-on-surface);--ngs-datepicker-shadow: var(--dropdown-shadow);--ngs-datepicker-radius: var(--dropdown-radius);--ngs-datepicker-border: var(--dropdown-border);--ngs-calendar-padding: calc(var(--spacing, .25rem) * 2);--ngs-calendar-cell-size: calc(var(--spacing, .25rem) * 9);--ngs-calendar-cell-radius: .5rem;--ngs-calendar-cell-hover-bg: var(--color-surface-container-high);--ngs-calendar-cell-selected-bg: var(--color-primary);--ngs-calendar-cell-selected-color: var(--color-on-primary);--ngs-calendar-cell-today-border: 1px solid var(--color-outline);--ngs-calendar-header-padding: 8px;--ngs-calendar-cell-in-range-bg: var(--color-primary-container);--ngs-datepicker-preset-hover-bg: var(--color-surface-container-high);--ngs-datepicker-preset-padding: 8px 16px;--ngs-datepicker-presets-border: 1px solid var(--color-border);background:var(--ngs-datepicker-bg);color:var(--ngs-datepicker-color);box-shadow:var(--ngs-datepicker-shadow);border-radius:var(--ngs-datepicker-radius);border:var(--ngs-datepicker-border);animation:ngs-datepicker-panel-showing .15s cubic-bezier(0,0,.2,1)}.ngs-datepicker-content.ngs-datepicker-below{transform-origin:top}.ngs-datepicker-content.ngs-datepicker-above{transform-origin:bottom}@keyframes ngs-datepicker-panel-showing{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:scaleY(1)}}.ngs-datepicker-content .ngs-datepicker-inner-container{display:flex}.ngs-datepicker-content .ngs-datepicker-presets{display:flex;flex-direction:column;padding:8px 0;border-inline-end:var(--ngs-datepicker-presets-border);min-width:120px}.ngs-datepicker-content .ngs-datepicker-preset{background:transparent;border:none;cursor:pointer;padding:var(--ngs-datepicker-preset-padding);text-align:start;font-size:.875rem;white-space:nowrap}.ngs-datepicker-content .ngs-datepicker-preset:hover{background:var(--ngs-datepicker-preset-hover-bg)}.ngs-date-range-input{display:flex;width:100%}.ngs-date-range-input.ngs-date-range-input-floating .ngs-date-range-input-container{opacity:1}.ngs-date-range-input:not(.ngs-date-range-input-floating) .ngs-date-range-input-container{opacity:0}.ngs-date-range-input-container{display:flex;align-items:center;gap:8px;width:100%;transition:opacity .2s,visibility .2s}.ngs-date-range-input-separator{flex-shrink:0}.ngs-date-range-input-start,.ngs-date-range-input-end{background:transparent;border:none;outline:none;width:80px}.ngs-date-range-input-start input::placeholder,.ngs-date-range-input-end input::placeholder{color:var(--input-label-color)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
499
|
+
}], propDecorators: { _portalTemplate: [{ type: i0.ViewChild, args: ['portal', { isSignal: true }] }], actions: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DatepickerActions), { isSignal: true }] }], startAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "startAt", required: false }] }], calendarHeaderComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarHeaderComponent", required: false }] }], quickPresets: [{ type: i0.Input, args: [{ isSignal: true, alias: "quickPresets", required: false }] }], showQuickPresets: [{ type: i0.Input, args: [{ isSignal: true, alias: "showQuickPresets", required: false }] }] } });
|
|
500
|
+
|
|
501
|
+
class DatepickerApply {
|
|
502
|
+
_datepicker = inject(forwardRef(() => Datepicker));
|
|
503
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerApply, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
504
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: DatepickerApply, isStandalone: true, selector: "[ngsDatepickerApply]", host: { listeners: { "click": "_datepicker.apply()" } }, ngImport: i0 });
|
|
505
|
+
}
|
|
506
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerApply, decorators: [{
|
|
507
|
+
type: Directive,
|
|
508
|
+
args: [{
|
|
509
|
+
selector: '[ngsDatepickerApply]',
|
|
510
|
+
standalone: true,
|
|
511
|
+
host: {
|
|
512
|
+
'(click)': '_datepicker.apply()'
|
|
513
|
+
}
|
|
514
|
+
}]
|
|
515
|
+
}] });
|
|
516
|
+
class DatepickerCancel {
|
|
517
|
+
_datepicker = inject(forwardRef(() => Datepicker));
|
|
518
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerCancel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
519
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: DatepickerCancel, isStandalone: true, selector: "[ngsDatepickerCancel]", host: { listeners: { "click": "_datepicker.close()" } }, ngImport: i0 });
|
|
520
|
+
}
|
|
521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerCancel, decorators: [{
|
|
522
|
+
type: Directive,
|
|
523
|
+
args: [{
|
|
524
|
+
selector: '[ngsDatepickerCancel]',
|
|
525
|
+
standalone: true,
|
|
526
|
+
host: {
|
|
527
|
+
'(click)': '_datepicker.close()'
|
|
528
|
+
}
|
|
529
|
+
}]
|
|
530
|
+
}] });
|
|
531
|
+
|
|
532
|
+
class DateRangePicker {
|
|
533
|
+
_overlay = inject(Overlay);
|
|
534
|
+
_viewContainerRef = inject(ViewContainerRef);
|
|
535
|
+
_dateAdapter = inject(DateAdapter);
|
|
536
|
+
startAt = input(null, ...(ngDevMode ? [{ debugName: "startAt" }] : /* istanbul ignore next */ []));
|
|
537
|
+
calendarHeaderComponent = input(null, ...(ngDevMode ? [{ debugName: "calendarHeaderComponent" }] : /* istanbul ignore next */ []));
|
|
538
|
+
quickPresets = input(null, ...(ngDevMode ? [{ debugName: "quickPresets" }] : /* istanbul ignore next */ []));
|
|
539
|
+
showQuickPresets = input(false, ...(ngDevMode ? [{ debugName: "showQuickPresets" }] : /* istanbul ignore next */ []));
|
|
540
|
+
_portalTemplate = viewChild.required('portal');
|
|
541
|
+
actions = contentChild(DatepickerActions, ...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
542
|
+
_datepickerInput; // Will be DateRangeInput
|
|
543
|
+
_selectedRange = signal(new DateRange(null, null), ...(ngDevMode ? [{ debugName: "_selectedRange" }] : /* istanbul ignore next */ []));
|
|
544
|
+
_isAbove = signal(false, ...(ngDevMode ? [{ debugName: "_isAbove" }] : /* istanbul ignore next */ []));
|
|
545
|
+
_effectivePresets = computed(() => {
|
|
546
|
+
const userPresets = this.quickPresets();
|
|
547
|
+
if (userPresets) {
|
|
548
|
+
return userPresets;
|
|
549
|
+
}
|
|
550
|
+
const today = this._dateAdapter.today();
|
|
551
|
+
return [
|
|
552
|
+
{
|
|
553
|
+
label: 'Today',
|
|
554
|
+
value: new DateRange(today, today)
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
label: 'Last 7 Days',
|
|
558
|
+
value: new DateRange(this._dateAdapter.addCalendarDays(today, -6), today)
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
label: 'Last 30 Days',
|
|
562
|
+
value: new DateRange(this._dateAdapter.addCalendarDays(today, -29), today)
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
label: 'This Month',
|
|
566
|
+
value: () => {
|
|
567
|
+
const year = this._dateAdapter.getYear(today);
|
|
568
|
+
const month = this._dateAdapter.getMonth(today);
|
|
569
|
+
const start = this._dateAdapter.createDate(year, month, 1);
|
|
570
|
+
const daysInMonth = this._dateAdapter.getNumDaysInMonth(start);
|
|
571
|
+
const end = this._dateAdapter.createDate(year, month, daysInMonth);
|
|
572
|
+
return new DateRange(start, end);
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
].map(p => ({
|
|
576
|
+
...p,
|
|
577
|
+
value: typeof p.value === 'function' ? p.value() : p.value
|
|
578
|
+
}));
|
|
579
|
+
}, ...(ngDevMode ? [{ debugName: "_effectivePresets" }] : /* istanbul ignore next */ []));
|
|
580
|
+
_overlayRef = null;
|
|
581
|
+
ngOnDestroy() {
|
|
582
|
+
this.close();
|
|
583
|
+
}
|
|
584
|
+
_registerInput(input) {
|
|
585
|
+
this._datepickerInput = input;
|
|
586
|
+
// Assuming input will provide the range
|
|
587
|
+
}
|
|
588
|
+
open() {
|
|
589
|
+
if (this._overlayRef || !this._datepickerInput)
|
|
590
|
+
return;
|
|
591
|
+
const strategy = this._overlay
|
|
592
|
+
.position()
|
|
593
|
+
.flexibleConnectedTo(this._datepickerInput.getConnectedOverlayOrigin())
|
|
594
|
+
.withPositions([
|
|
595
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },
|
|
596
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },
|
|
597
|
+
]);
|
|
598
|
+
strategy.positionChanges.subscribe(change => {
|
|
599
|
+
this._isAbove.set(change.connectionPair.overlayY === 'bottom');
|
|
600
|
+
});
|
|
601
|
+
this._overlayRef = this._overlay.create({
|
|
602
|
+
positionStrategy: strategy,
|
|
603
|
+
hasBackdrop: true,
|
|
604
|
+
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
605
|
+
});
|
|
606
|
+
this._overlayRef.backdropClick().subscribe(() => this.close());
|
|
607
|
+
const portal = new TemplatePortal(this._portalTemplate(), this._viewContainerRef);
|
|
608
|
+
this._overlayRef.attach(portal);
|
|
609
|
+
}
|
|
610
|
+
close() {
|
|
611
|
+
if (this._overlayRef) {
|
|
612
|
+
this._overlayRef.detach();
|
|
613
|
+
this._overlayRef.dispose();
|
|
614
|
+
this._overlayRef = null;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
_select(date) {
|
|
618
|
+
const currentRange = this._selectedRange();
|
|
619
|
+
let newRange;
|
|
620
|
+
if (!currentRange.start || (currentRange.start && currentRange.end)) {
|
|
621
|
+
newRange = new DateRange(date, null);
|
|
622
|
+
}
|
|
623
|
+
else {
|
|
624
|
+
if (this._dateAdapter.compareDate(date, currentRange.start) < 0) {
|
|
625
|
+
newRange = new DateRange(date, currentRange.start);
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
newRange = new DateRange(currentRange.start, date);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
this._updateSelectedRange(newRange);
|
|
632
|
+
}
|
|
633
|
+
_selectPreset(preset) {
|
|
634
|
+
const value = preset.value;
|
|
635
|
+
if (value instanceof DateRange) {
|
|
636
|
+
this._updateSelectedRange(value);
|
|
637
|
+
}
|
|
638
|
+
else if (value) {
|
|
639
|
+
this._updateSelectedRange(new DateRange(value, null));
|
|
640
|
+
}
|
|
641
|
+
else {
|
|
642
|
+
this._updateSelectedRange(new DateRange(null, null));
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
_updateSelectedRange(newRange) {
|
|
646
|
+
this._selectedRange.set(newRange);
|
|
647
|
+
if (this._datepickerInput) {
|
|
648
|
+
this._datepickerInput._rangeUpdated(newRange);
|
|
649
|
+
}
|
|
650
|
+
if (!this.actions()) {
|
|
651
|
+
if (newRange.start && newRange.end) {
|
|
652
|
+
this.close();
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
apply() {
|
|
657
|
+
const range = this._selectedRange();
|
|
658
|
+
if (this._datepickerInput && range.start && range.end) {
|
|
659
|
+
this._datepickerInput._rangeUpdated(range);
|
|
660
|
+
}
|
|
661
|
+
this.close();
|
|
662
|
+
}
|
|
663
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DateRangePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
664
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: DateRangePicker, isStandalone: true, selector: "ngs-date-range-picker", inputs: { startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null }, calendarHeaderComponent: { classPropertyName: "calendarHeaderComponent", publicName: "calendarHeaderComponent", isSignal: true, isRequired: false, transformFunction: null }, quickPresets: { classPropertyName: "quickPresets", publicName: "quickPresets", isSignal: true, isRequired: false, transformFunction: null }, showQuickPresets: { classPropertyName: "showQuickPresets", publicName: "showQuickPresets", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "actions", first: true, predicate: DatepickerActions, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_portalTemplate", first: true, predicate: ["portal"], descendants: true, isSignal: true }], exportAs: ["ngsDateRangePicker"], ngImport: i0, template: "<ng-template #portal>\n <div class=\"ngs-datepicker-content\" [class.ngs-datepicker-above]=\"_isAbove()\" [class.ngs-datepicker-below]=\"!_isAbove()\">\n <div class=\"ngs-datepicker-inner-container\">\n @if (showQuickPresets() && _effectivePresets().length > 0) {\n <div class=\"ngs-datepicker-presets\">\n @for (preset of _effectivePresets(); track preset.label) {\n <button type=\"button\" class=\"ngs-datepicker-preset\" (click)=\"_selectPreset(preset)\">\n {{ preset.label }}\n </button>\n }\n </div>\n }\n\n <ngs-calendar [startAt]=\"startAt()\"\n [selected]=\"_selectedRange()\"\n [headerComponent]=\"calendarHeaderComponent()\"\n (selectedChange)=\"_select($event)\"\n />\n </div>\n\n @if (actions()) {\n <ng-content select=\"ngs-datepicker-actions\" />\n }\n </div>\n</ng-template>\n", styles: [".ngs-datepicker-content{--ngs-datepicker-bg: var(--dropdown-bg);--ngs-datepicker-color: var(--color-on-surface);--ngs-datepicker-shadow: var(--dropdown-shadow);--ngs-datepicker-radius: var(--dropdown-radius);--ngs-datepicker-border: var(--dropdown-border);--ngs-calendar-padding: calc(var(--spacing, .25rem) * 2);--ngs-calendar-cell-size: calc(var(--spacing, .25rem) * 9);--ngs-calendar-cell-radius: .5rem;--ngs-calendar-cell-hover-bg: var(--color-surface-container-high);--ngs-calendar-cell-selected-bg: var(--color-primary);--ngs-calendar-cell-selected-color: var(--color-on-primary);--ngs-calendar-cell-today-border: 1px solid var(--color-outline);--ngs-calendar-header-padding: 8px;--ngs-calendar-cell-in-range-bg: var(--color-primary-container);--ngs-datepicker-preset-hover-bg: var(--color-surface-container-high);--ngs-datepicker-preset-padding: 8px 16px;--ngs-datepicker-presets-border: 1px solid var(--color-border);background:var(--ngs-datepicker-bg);color:var(--ngs-datepicker-color);box-shadow:var(--ngs-datepicker-shadow);border-radius:var(--ngs-datepicker-radius);border:var(--ngs-datepicker-border);animation:ngs-datepicker-panel-showing .15s cubic-bezier(0,0,.2,1)}.ngs-datepicker-content.ngs-datepicker-below{transform-origin:top}.ngs-datepicker-content.ngs-datepicker-above{transform-origin:bottom}@keyframes ngs-datepicker-panel-showing{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:scaleY(1)}}.ngs-datepicker-content .ngs-datepicker-inner-container{display:flex}.ngs-datepicker-content .ngs-datepicker-presets{display:flex;flex-direction:column;padding:8px 0;border-inline-end:var(--ngs-datepicker-presets-border);min-width:120px}.ngs-datepicker-content .ngs-datepicker-preset{background:transparent;border:none;cursor:pointer;padding:var(--ngs-datepicker-preset-padding);text-align:start;font-size:.875rem;white-space:nowrap}.ngs-datepicker-content .ngs-datepicker-preset:hover{background:var(--ngs-datepicker-preset-hover-bg)}.ngs-date-range-input{display:flex;width:100%}.ngs-date-range-input.ngs-date-range-input-floating .ngs-date-range-input-container{opacity:1}.ngs-date-range-input:not(.ngs-date-range-input-floating) .ngs-date-range-input-container{opacity:0}.ngs-date-range-input-container{display:flex;align-items:center;gap:8px;width:100%;transition:opacity .2s,visibility .2s}.ngs-date-range-input-separator{flex-shrink:0}.ngs-date-range-input-start,.ngs-date-range-input-end{background:transparent;border:none;outline:none;width:80px}.ngs-date-range-input-start input::placeholder,.ngs-date-range-input-end input::placeholder{color:var(--input-label-color)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: OverlayModule }, { kind: "component", type: Calendar, selector: "ngs-calendar", inputs: ["startAt", "selected", "minDate", "maxDate", "headerComponent"], outputs: ["selectedChange", "yearSelected", "monthSelected"], exportAs: ["ngsCalendar"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
665
|
+
}
|
|
666
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DateRangePicker, decorators: [{
|
|
667
|
+
type: Component,
|
|
668
|
+
args: [{ selector: 'ngs-date-range-picker', standalone: true, imports: [OverlayModule, Calendar], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, exportAs: 'ngsDateRangePicker', template: "<ng-template #portal>\n <div class=\"ngs-datepicker-content\" [class.ngs-datepicker-above]=\"_isAbove()\" [class.ngs-datepicker-below]=\"!_isAbove()\">\n <div class=\"ngs-datepicker-inner-container\">\n @if (showQuickPresets() && _effectivePresets().length > 0) {\n <div class=\"ngs-datepicker-presets\">\n @for (preset of _effectivePresets(); track preset.label) {\n <button type=\"button\" class=\"ngs-datepicker-preset\" (click)=\"_selectPreset(preset)\">\n {{ preset.label }}\n </button>\n }\n </div>\n }\n\n <ngs-calendar [startAt]=\"startAt()\"\n [selected]=\"_selectedRange()\"\n [headerComponent]=\"calendarHeaderComponent()\"\n (selectedChange)=\"_select($event)\"\n />\n </div>\n\n @if (actions()) {\n <ng-content select=\"ngs-datepicker-actions\" />\n }\n </div>\n</ng-template>\n", styles: [".ngs-datepicker-content{--ngs-datepicker-bg: var(--dropdown-bg);--ngs-datepicker-color: var(--color-on-surface);--ngs-datepicker-shadow: var(--dropdown-shadow);--ngs-datepicker-radius: var(--dropdown-radius);--ngs-datepicker-border: var(--dropdown-border);--ngs-calendar-padding: calc(var(--spacing, .25rem) * 2);--ngs-calendar-cell-size: calc(var(--spacing, .25rem) * 9);--ngs-calendar-cell-radius: .5rem;--ngs-calendar-cell-hover-bg: var(--color-surface-container-high);--ngs-calendar-cell-selected-bg: var(--color-primary);--ngs-calendar-cell-selected-color: var(--color-on-primary);--ngs-calendar-cell-today-border: 1px solid var(--color-outline);--ngs-calendar-header-padding: 8px;--ngs-calendar-cell-in-range-bg: var(--color-primary-container);--ngs-datepicker-preset-hover-bg: var(--color-surface-container-high);--ngs-datepicker-preset-padding: 8px 16px;--ngs-datepicker-presets-border: 1px solid var(--color-border);background:var(--ngs-datepicker-bg);color:var(--ngs-datepicker-color);box-shadow:var(--ngs-datepicker-shadow);border-radius:var(--ngs-datepicker-radius);border:var(--ngs-datepicker-border);animation:ngs-datepicker-panel-showing .15s cubic-bezier(0,0,.2,1)}.ngs-datepicker-content.ngs-datepicker-below{transform-origin:top}.ngs-datepicker-content.ngs-datepicker-above{transform-origin:bottom}@keyframes ngs-datepicker-panel-showing{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:scaleY(1)}}.ngs-datepicker-content .ngs-datepicker-inner-container{display:flex}.ngs-datepicker-content .ngs-datepicker-presets{display:flex;flex-direction:column;padding:8px 0;border-inline-end:var(--ngs-datepicker-presets-border);min-width:120px}.ngs-datepicker-content .ngs-datepicker-preset{background:transparent;border:none;cursor:pointer;padding:var(--ngs-datepicker-preset-padding);text-align:start;font-size:.875rem;white-space:nowrap}.ngs-datepicker-content .ngs-datepicker-preset:hover{background:var(--ngs-datepicker-preset-hover-bg)}.ngs-date-range-input{display:flex;width:100%}.ngs-date-range-input.ngs-date-range-input-floating .ngs-date-range-input-container{opacity:1}.ngs-date-range-input:not(.ngs-date-range-input-floating) .ngs-date-range-input-container{opacity:0}.ngs-date-range-input-container{display:flex;align-items:center;gap:8px;width:100%;transition:opacity .2s,visibility .2s}.ngs-date-range-input-separator{flex-shrink:0}.ngs-date-range-input-start,.ngs-date-range-input-end{background:transparent;border:none;outline:none;width:80px}.ngs-date-range-input-start input::placeholder,.ngs-date-range-input-end input::placeholder{color:var(--input-label-color)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
669
|
+
}], propDecorators: { startAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "startAt", required: false }] }], calendarHeaderComponent: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendarHeaderComponent", required: false }] }], quickPresets: [{ type: i0.Input, args: [{ isSignal: true, alias: "quickPresets", required: false }] }], showQuickPresets: [{ type: i0.Input, args: [{ isSignal: true, alias: "showQuickPresets", required: false }] }], _portalTemplate: [{ type: i0.ViewChild, args: ['portal', { isSignal: true }] }], actions: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DatepickerActions), { isSignal: true }] }] } });
|
|
670
|
+
|
|
671
|
+
class DatepickerInput {
|
|
672
|
+
_elementRef = inject(ElementRef);
|
|
673
|
+
_formField = inject(FormField, { optional: true });
|
|
674
|
+
_dateAdapter = inject(DateAdapter);
|
|
675
|
+
ngsDatepicker = input.required(...(ngDevMode ? [{ debugName: "ngsDatepicker" }] : /* istanbul ignore next */ []));
|
|
676
|
+
_value = null;
|
|
677
|
+
_onChange = () => { };
|
|
678
|
+
_onTouched = () => { };
|
|
679
|
+
_valueChange = new Subject();
|
|
680
|
+
constructor() {
|
|
681
|
+
effect(() => {
|
|
682
|
+
const picker = this.ngsDatepicker();
|
|
683
|
+
untracked(() => {
|
|
684
|
+
if (picker) {
|
|
685
|
+
picker._registerInput(this);
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
ngOnInit() {
|
|
691
|
+
}
|
|
692
|
+
ngOnDestroy() {
|
|
693
|
+
this._valueChange.complete();
|
|
694
|
+
}
|
|
695
|
+
writeValue(value) {
|
|
696
|
+
this._value = value;
|
|
697
|
+
this._formatValue(value);
|
|
698
|
+
}
|
|
699
|
+
registerOnChange(fn) {
|
|
700
|
+
this._onChange = fn;
|
|
701
|
+
}
|
|
702
|
+
registerOnTouched(fn) {
|
|
703
|
+
this._onTouched = fn;
|
|
704
|
+
}
|
|
705
|
+
setDisabledState(isDisabled) {
|
|
706
|
+
this._elementRef.nativeElement.disabled = isDisabled;
|
|
707
|
+
}
|
|
708
|
+
_onInput(value) {
|
|
709
|
+
const date = this._dateAdapter.parse(value, null);
|
|
710
|
+
this._value = date;
|
|
711
|
+
this._onChange(date);
|
|
712
|
+
this._valueChange.next(date);
|
|
713
|
+
}
|
|
714
|
+
_formatValue(value) {
|
|
715
|
+
this._elementRef.nativeElement.value = (value && this._dateAdapter.isDateInstance(value) && this._dateAdapter.isValid(value))
|
|
716
|
+
? this._dateAdapter.format(value, { year: 'numeric', month: '2-digit', day: '2-digit' })
|
|
717
|
+
: '';
|
|
718
|
+
}
|
|
719
|
+
getConnectedOverlayOrigin() {
|
|
720
|
+
if (this._formField) {
|
|
721
|
+
return this._formField.container();
|
|
722
|
+
}
|
|
723
|
+
return this._elementRef;
|
|
724
|
+
}
|
|
725
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerInput, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
726
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.4", type: DatepickerInput, isStandalone: true, selector: "input[ngsDatepicker]", inputs: { ngsDatepicker: { classPropertyName: "ngsDatepicker", publicName: "ngsDatepicker", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "input": "_onInput($any($event).target.value)", "blur": "_onTouched()" }, classAttribute: "ngs-datepicker-input" }, providers: [
|
|
727
|
+
{
|
|
728
|
+
provide: NG_VALUE_ACCESSOR,
|
|
729
|
+
useExisting: forwardRef(() => DatepickerInput),
|
|
730
|
+
multi: true,
|
|
731
|
+
},
|
|
732
|
+
], ngImport: i0 });
|
|
733
|
+
}
|
|
734
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerInput, decorators: [{
|
|
735
|
+
type: Directive,
|
|
736
|
+
args: [{
|
|
737
|
+
selector: 'input[ngsDatepicker]',
|
|
738
|
+
standalone: true,
|
|
739
|
+
providers: [
|
|
740
|
+
{
|
|
741
|
+
provide: NG_VALUE_ACCESSOR,
|
|
742
|
+
useExisting: forwardRef(() => DatepickerInput),
|
|
743
|
+
multi: true,
|
|
744
|
+
},
|
|
745
|
+
],
|
|
746
|
+
host: {
|
|
747
|
+
'class': 'ngs-datepicker-input',
|
|
748
|
+
'(input)': '_onInput($any($event).target.value)',
|
|
749
|
+
'(blur)': '_onTouched()',
|
|
750
|
+
},
|
|
751
|
+
}]
|
|
752
|
+
}], ctorParameters: () => [], propDecorators: { ngsDatepicker: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngsDatepicker", required: true }] }] } });
|
|
753
|
+
|
|
754
|
+
class StartDate {
|
|
755
|
+
_elementRef = inject(ElementRef);
|
|
756
|
+
_dateAdapter = inject(DateAdapter);
|
|
757
|
+
_rangeInput;
|
|
758
|
+
_onInput(value) {
|
|
759
|
+
const date = this._dateAdapter.parse(value, null);
|
|
760
|
+
this._rangeInput._startUpdated(date);
|
|
761
|
+
this._rangeInput._inputUpdated();
|
|
762
|
+
}
|
|
763
|
+
_formatValue(value) {
|
|
764
|
+
this._elementRef.nativeElement.value = value ? this._dateAdapter.format(value, { year: 'numeric', month: '2-digit', day: '2-digit' }) : '';
|
|
765
|
+
this._rangeInput._inputUpdated();
|
|
766
|
+
}
|
|
767
|
+
_onFocus() {
|
|
768
|
+
this._rangeInput._handleFocus();
|
|
769
|
+
}
|
|
770
|
+
_onBlur() {
|
|
771
|
+
this._rangeInput._handleBlur();
|
|
772
|
+
}
|
|
773
|
+
isEmpty() {
|
|
774
|
+
return !this._elementRef.nativeElement.value;
|
|
775
|
+
}
|
|
776
|
+
focus() {
|
|
777
|
+
this._elementRef.nativeElement.focus();
|
|
778
|
+
}
|
|
779
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: StartDate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
780
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: StartDate, isStandalone: true, selector: "input[ngsStartDate]", host: { listeners: { "input": "_onInput($any($event).target.value)", "focus": "_onFocus()", "blur": "_onBlur()" }, classAttribute: "ngs-date-range-input-start" }, ngImport: i0 });
|
|
781
|
+
}
|
|
782
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: StartDate, decorators: [{
|
|
783
|
+
type: Directive,
|
|
784
|
+
args: [{
|
|
785
|
+
selector: 'input[ngsStartDate]',
|
|
786
|
+
standalone: true,
|
|
787
|
+
host: {
|
|
788
|
+
'class': 'ngs-date-range-input-start',
|
|
789
|
+
'(input)': '_onInput($any($event).target.value)',
|
|
790
|
+
'(focus)': '_onFocus()',
|
|
791
|
+
'(blur)': '_onBlur()',
|
|
792
|
+
},
|
|
793
|
+
}]
|
|
794
|
+
}] });
|
|
795
|
+
class EndDate {
|
|
796
|
+
_elementRef = inject(ElementRef);
|
|
797
|
+
_dateAdapter = inject(DateAdapter);
|
|
798
|
+
_rangeInput;
|
|
799
|
+
_onInput(value) {
|
|
800
|
+
const date = this._dateAdapter.parse(value, null);
|
|
801
|
+
this._rangeInput._endUpdated(date);
|
|
802
|
+
this._rangeInput._inputUpdated();
|
|
803
|
+
}
|
|
804
|
+
_formatValue(value) {
|
|
805
|
+
this._elementRef.nativeElement.value = value ? this._dateAdapter.format(value, { year: 'numeric', month: '2-digit', day: '2-digit' }) : '';
|
|
806
|
+
this._rangeInput._inputUpdated();
|
|
807
|
+
}
|
|
808
|
+
_onFocus() {
|
|
809
|
+
this._rangeInput._handleFocus();
|
|
810
|
+
}
|
|
811
|
+
_onBlur() {
|
|
812
|
+
this._rangeInput._handleBlur();
|
|
813
|
+
}
|
|
814
|
+
isEmpty() {
|
|
815
|
+
return !this._elementRef.nativeElement.value;
|
|
816
|
+
}
|
|
817
|
+
focus() {
|
|
818
|
+
this._elementRef.nativeElement.focus();
|
|
819
|
+
}
|
|
820
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: EndDate, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
821
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: EndDate, isStandalone: true, selector: "input[ngsEndDate]", host: { listeners: { "input": "_onInput($any($event).target.value)", "focus": "_onFocus()", "blur": "_onBlur()" }, classAttribute: "ngs-date-range-input-end" }, ngImport: i0 });
|
|
822
|
+
}
|
|
823
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: EndDate, decorators: [{
|
|
824
|
+
type: Directive,
|
|
825
|
+
args: [{
|
|
826
|
+
selector: 'input[ngsEndDate]',
|
|
827
|
+
standalone: true,
|
|
828
|
+
host: {
|
|
829
|
+
'class': 'ngs-date-range-input-end',
|
|
830
|
+
'(input)': '_onInput($any($event).target.value)',
|
|
831
|
+
'(focus)': '_onFocus()',
|
|
832
|
+
'(blur)': '_onBlur()',
|
|
833
|
+
},
|
|
834
|
+
}]
|
|
835
|
+
}] });
|
|
836
|
+
class DateRangeInput {
|
|
837
|
+
_elementRef = inject(ElementRef);
|
|
838
|
+
_formField = inject(FormField, { optional: true });
|
|
839
|
+
rangePicker = input.required(...(ngDevMode ? [{ debugName: "rangePicker" }] : /* istanbul ignore next */ []));
|
|
840
|
+
separator = input('–', ...(ngDevMode ? [{ debugName: "separator" }] : /* istanbul ignore next */ []));
|
|
841
|
+
ngControl = inject(NgControl, { optional: true, self: true });
|
|
842
|
+
_startInput = contentChild(StartDate, ...(ngDevMode ? [{ debugName: "_startInput" }] : /* istanbul ignore next */ []));
|
|
843
|
+
_endInput = contentChild(EndDate, ...(ngDevMode ? [{ debugName: "_endInput" }] : /* istanbul ignore next */ []));
|
|
844
|
+
_value = null;
|
|
845
|
+
get value() {
|
|
846
|
+
return this._value;
|
|
847
|
+
}
|
|
848
|
+
_focused = signal(false, ...(ngDevMode ? [{ debugName: "_focused" }] : /* istanbul ignore next */ []));
|
|
849
|
+
get focused() {
|
|
850
|
+
return this._focused();
|
|
851
|
+
}
|
|
852
|
+
_empty = computed(() => {
|
|
853
|
+
this._inputStateChanges();
|
|
854
|
+
const startInput = this._startInput();
|
|
855
|
+
const endInput = this._endInput();
|
|
856
|
+
return (!this._value || (!this._value.start && !this._value.end)) &&
|
|
857
|
+
(!startInput || startInput.isEmpty()) &&
|
|
858
|
+
(!endInput || endInput.isEmpty());
|
|
859
|
+
}, ...(ngDevMode ? [{ debugName: "_empty" }] : /* istanbul ignore next */ []));
|
|
860
|
+
get empty() {
|
|
861
|
+
return this._empty();
|
|
862
|
+
}
|
|
863
|
+
_shouldLabelFloat = computed(() => {
|
|
864
|
+
return this.focused || !this.empty;
|
|
865
|
+
}, ...(ngDevMode ? [{ debugName: "_shouldLabelFloat" }] : /* istanbul ignore next */ []));
|
|
866
|
+
get shouldLabelFloat() {
|
|
867
|
+
return this._shouldLabelFloat();
|
|
868
|
+
}
|
|
869
|
+
stateChanges = new Subject();
|
|
870
|
+
_inputStateChanges = signal(0, ...(ngDevMode ? [{ debugName: "_inputStateChanges" }] : /* istanbul ignore next */ []));
|
|
871
|
+
id = `ngs-date-range-input-${nextUniqueId++}`;
|
|
872
|
+
placeholder = '';
|
|
873
|
+
required = false;
|
|
874
|
+
disabled = false;
|
|
875
|
+
errorState = false;
|
|
876
|
+
constructor() {
|
|
877
|
+
effect(() => {
|
|
878
|
+
const picker = this.rangePicker();
|
|
879
|
+
untracked(() => {
|
|
880
|
+
if (picker) {
|
|
881
|
+
picker._registerInput(this);
|
|
882
|
+
}
|
|
883
|
+
});
|
|
884
|
+
});
|
|
885
|
+
effect(() => {
|
|
886
|
+
const start = this._startInput();
|
|
887
|
+
if (start) {
|
|
888
|
+
start._rangeInput = this;
|
|
889
|
+
}
|
|
890
|
+
});
|
|
891
|
+
effect(() => {
|
|
892
|
+
const end = this._endInput();
|
|
893
|
+
if (end) {
|
|
894
|
+
end._rangeInput = this;
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
ngOnInit() { }
|
|
899
|
+
ngOnDestroy() {
|
|
900
|
+
this.stateChanges.complete();
|
|
901
|
+
}
|
|
902
|
+
_startUpdated(date) {
|
|
903
|
+
this._value = new DateRange(date, this._value?.end || null);
|
|
904
|
+
this.rangePicker()._selectedRange.set(this._value);
|
|
905
|
+
this.stateChanges.next();
|
|
906
|
+
}
|
|
907
|
+
_endUpdated(date) {
|
|
908
|
+
this._value = new DateRange(this._value?.start || null, date);
|
|
909
|
+
this.rangePicker()._selectedRange.set(this._value);
|
|
910
|
+
this.stateChanges.next();
|
|
911
|
+
}
|
|
912
|
+
_rangeUpdated(range) {
|
|
913
|
+
const prevStart = this._value?.start;
|
|
914
|
+
this._value = range;
|
|
915
|
+
this._startInput()?._formatValue(range.start);
|
|
916
|
+
this._endInput()?._formatValue(range.end);
|
|
917
|
+
this.stateChanges.next();
|
|
918
|
+
if (range.start && !range.end && range.start !== prevStart) {
|
|
919
|
+
this._endInput()?.focus();
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
_handleFocus() {
|
|
923
|
+
if (!this._focused()) {
|
|
924
|
+
this._focused.set(true);
|
|
925
|
+
this.stateChanges.next();
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
_handleBlur() {
|
|
929
|
+
// Use setTimeout to check if focus moved to another input within the same component
|
|
930
|
+
setTimeout(() => {
|
|
931
|
+
if (!this._elementRef.nativeElement.contains(document.activeElement)) {
|
|
932
|
+
this._focused.set(false);
|
|
933
|
+
this.stateChanges.next();
|
|
934
|
+
}
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
_inputUpdated() {
|
|
938
|
+
this._inputStateChanges.update(v => v + 1);
|
|
939
|
+
this.stateChanges.next();
|
|
940
|
+
}
|
|
941
|
+
getConnectedOverlayOrigin() {
|
|
942
|
+
if (this._formField) {
|
|
943
|
+
return this._formField.container();
|
|
944
|
+
}
|
|
945
|
+
return this._elementRef;
|
|
946
|
+
}
|
|
947
|
+
focus() {
|
|
948
|
+
const startInput = this._startInput();
|
|
949
|
+
if (startInput && !this.focused) {
|
|
950
|
+
startInput.focus();
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DateRangeInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
954
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.4", type: DateRangeInput, isStandalone: true, selector: "ngs-date-range-input", inputs: { rangePicker: { classPropertyName: "rangePicker", publicName: "rangePicker", isSignal: true, isRequired: true, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "focus()" }, properties: { "attr.id": "id", "class.ngs-date-range-input-floating": "shouldLabelFloat" }, classAttribute: "ngs-date-range-input" }, providers: [
|
|
955
|
+
{
|
|
956
|
+
provide: FormFieldControl,
|
|
957
|
+
useExisting: forwardRef(() => DateRangeInput)
|
|
958
|
+
}
|
|
959
|
+
], queries: [{ propertyName: "_startInput", first: true, predicate: StartDate, descendants: true, isSignal: true }, { propertyName: "_endInput", first: true, predicate: EndDate, descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ngs-date-range-input-container\">\n <div class=\"ngs-date-range-input-start-wrapper\">\n <ng-content select=\"input[ngsStartDate]\"/>\n </div>\n <span class=\"ngs-date-range-input-separator\">{{ separator() }}</span>\n <div class=\"ngs-date-range-input-end-wrapper\">\n <ng-content select=\"input[ngsEndDate]\"/>\n </div>\n</div>\n", styles: [":host{display:block}\n", ".ngs-datepicker-content{--ngs-datepicker-bg: var(--dropdown-bg);--ngs-datepicker-color: var(--color-on-surface);--ngs-datepicker-shadow: var(--dropdown-shadow);--ngs-datepicker-radius: var(--dropdown-radius);--ngs-datepicker-border: var(--dropdown-border);--ngs-calendar-padding: calc(var(--spacing, .25rem) * 2);--ngs-calendar-cell-size: calc(var(--spacing, .25rem) * 9);--ngs-calendar-cell-radius: .5rem;--ngs-calendar-cell-hover-bg: var(--color-surface-container-high);--ngs-calendar-cell-selected-bg: var(--color-primary);--ngs-calendar-cell-selected-color: var(--color-on-primary);--ngs-calendar-cell-today-border: 1px solid var(--color-outline);--ngs-calendar-header-padding: 8px;--ngs-calendar-cell-in-range-bg: var(--color-primary-container);--ngs-datepicker-preset-hover-bg: var(--color-surface-container-high);--ngs-datepicker-preset-padding: 8px 16px;--ngs-datepicker-presets-border: 1px solid var(--color-border);background:var(--ngs-datepicker-bg);color:var(--ngs-datepicker-color);box-shadow:var(--ngs-datepicker-shadow);border-radius:var(--ngs-datepicker-radius);border:var(--ngs-datepicker-border);animation:ngs-datepicker-panel-showing .15s cubic-bezier(0,0,.2,1)}.ngs-datepicker-content.ngs-datepicker-below{transform-origin:top}.ngs-datepicker-content.ngs-datepicker-above{transform-origin:bottom}@keyframes ngs-datepicker-panel-showing{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:scaleY(1)}}.ngs-datepicker-content .ngs-datepicker-inner-container{display:flex}.ngs-datepicker-content .ngs-datepicker-presets{display:flex;flex-direction:column;padding:8px 0;border-inline-end:var(--ngs-datepicker-presets-border);min-width:120px}.ngs-datepicker-content .ngs-datepicker-preset{background:transparent;border:none;cursor:pointer;padding:var(--ngs-datepicker-preset-padding);text-align:start;font-size:.875rem;white-space:nowrap}.ngs-datepicker-content .ngs-datepicker-preset:hover{background:var(--ngs-datepicker-preset-hover-bg)}.ngs-date-range-input{display:flex;width:100%}.ngs-date-range-input.ngs-date-range-input-floating .ngs-date-range-input-container{opacity:1}.ngs-date-range-input:not(.ngs-date-range-input-floating) .ngs-date-range-input-container{opacity:0}.ngs-date-range-input-container{display:flex;align-items:center;gap:8px;width:100%;transition:opacity .2s,visibility .2s}.ngs-date-range-input-separator{flex-shrink:0}.ngs-date-range-input-start,.ngs-date-range-input-end{background:transparent;border:none;outline:none;width:80px}.ngs-date-range-input-start input::placeholder,.ngs-date-range-input-end input::placeholder{color:var(--input-label-color)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
960
|
+
}
|
|
961
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DateRangeInput, decorators: [{
|
|
962
|
+
type: Component,
|
|
963
|
+
args: [{ selector: 'ngs-date-range-input', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
964
|
+
'class': 'ngs-date-range-input',
|
|
965
|
+
'[attr.id]': 'id',
|
|
966
|
+
'[class.ngs-date-range-input-floating]': 'shouldLabelFloat',
|
|
967
|
+
'(click)': 'focus()',
|
|
968
|
+
}, providers: [
|
|
969
|
+
{
|
|
970
|
+
provide: FormFieldControl,
|
|
971
|
+
useExisting: forwardRef(() => DateRangeInput)
|
|
972
|
+
}
|
|
973
|
+
], template: "<div class=\"ngs-date-range-input-container\">\n <div class=\"ngs-date-range-input-start-wrapper\">\n <ng-content select=\"input[ngsStartDate]\"/>\n </div>\n <span class=\"ngs-date-range-input-separator\">{{ separator() }}</span>\n <div class=\"ngs-date-range-input-end-wrapper\">\n <ng-content select=\"input[ngsEndDate]\"/>\n </div>\n</div>\n", styles: [":host{display:block}\n", ".ngs-datepicker-content{--ngs-datepicker-bg: var(--dropdown-bg);--ngs-datepicker-color: var(--color-on-surface);--ngs-datepicker-shadow: var(--dropdown-shadow);--ngs-datepicker-radius: var(--dropdown-radius);--ngs-datepicker-border: var(--dropdown-border);--ngs-calendar-padding: calc(var(--spacing, .25rem) * 2);--ngs-calendar-cell-size: calc(var(--spacing, .25rem) * 9);--ngs-calendar-cell-radius: .5rem;--ngs-calendar-cell-hover-bg: var(--color-surface-container-high);--ngs-calendar-cell-selected-bg: var(--color-primary);--ngs-calendar-cell-selected-color: var(--color-on-primary);--ngs-calendar-cell-today-border: 1px solid var(--color-outline);--ngs-calendar-header-padding: 8px;--ngs-calendar-cell-in-range-bg: var(--color-primary-container);--ngs-datepicker-preset-hover-bg: var(--color-surface-container-high);--ngs-datepicker-preset-padding: 8px 16px;--ngs-datepicker-presets-border: 1px solid var(--color-border);background:var(--ngs-datepicker-bg);color:var(--ngs-datepicker-color);box-shadow:var(--ngs-datepicker-shadow);border-radius:var(--ngs-datepicker-radius);border:var(--ngs-datepicker-border);animation:ngs-datepicker-panel-showing .15s cubic-bezier(0,0,.2,1)}.ngs-datepicker-content.ngs-datepicker-below{transform-origin:top}.ngs-datepicker-content.ngs-datepicker-above{transform-origin:bottom}@keyframes ngs-datepicker-panel-showing{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:scaleY(1)}}.ngs-datepicker-content .ngs-datepicker-inner-container{display:flex}.ngs-datepicker-content .ngs-datepicker-presets{display:flex;flex-direction:column;padding:8px 0;border-inline-end:var(--ngs-datepicker-presets-border);min-width:120px}.ngs-datepicker-content .ngs-datepicker-preset{background:transparent;border:none;cursor:pointer;padding:var(--ngs-datepicker-preset-padding);text-align:start;font-size:.875rem;white-space:nowrap}.ngs-datepicker-content .ngs-datepicker-preset:hover{background:var(--ngs-datepicker-preset-hover-bg)}.ngs-date-range-input{display:flex;width:100%}.ngs-date-range-input.ngs-date-range-input-floating .ngs-date-range-input-container{opacity:1}.ngs-date-range-input:not(.ngs-date-range-input-floating) .ngs-date-range-input-container{opacity:0}.ngs-date-range-input-container{display:flex;align-items:center;gap:8px;width:100%;transition:opacity .2s,visibility .2s}.ngs-date-range-input-separator{flex-shrink:0}.ngs-date-range-input-start,.ngs-date-range-input-end{background:transparent;border:none;outline:none;width:80px}.ngs-date-range-input-start input::placeholder,.ngs-date-range-input-end input::placeholder{color:var(--input-label-color)}\n/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
974
|
+
}], ctorParameters: () => [], propDecorators: { rangePicker: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangePicker", required: true }] }], separator: [{ type: i0.Input, args: [{ isSignal: true, alias: "separator", required: false }] }], _startInput: [{ type: i0.ContentChild, args: [i0.forwardRef(() => StartDate), { isSignal: true }] }], _endInput: [{ type: i0.ContentChild, args: [i0.forwardRef(() => EndDate), { isSignal: true }] }] } });
|
|
975
|
+
let nextUniqueId = 0;
|
|
976
|
+
|
|
977
|
+
class DatepickerToggleIcon {
|
|
978
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerToggleIcon, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
979
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: DatepickerToggleIcon, isStandalone: true, selector: "[ngsDatepickerToggleIcon]", ngImport: i0 });
|
|
980
|
+
}
|
|
981
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerToggleIcon, decorators: [{
|
|
982
|
+
type: Directive,
|
|
983
|
+
args: [{
|
|
984
|
+
selector: '[ngsDatepickerToggleIcon]',
|
|
985
|
+
standalone: true
|
|
986
|
+
}]
|
|
987
|
+
}] });
|
|
988
|
+
|
|
989
|
+
class DatepickerToggle {
|
|
990
|
+
_intl = inject(DatepickerIntl);
|
|
991
|
+
_formField = inject(FORM_FIELD, { optional: true });
|
|
992
|
+
for = input.required(...(ngDevMode ? [{ debugName: "for" }] : /* istanbul ignore next */ [])); // Reference to the datepicker
|
|
993
|
+
customIcon = contentChild(DatepickerToggleIcon, ...(ngDevMode ? [{ debugName: "customIcon" }] : /* istanbul ignore next */ []));
|
|
994
|
+
_open(event) {
|
|
995
|
+
if (this.for()) {
|
|
996
|
+
this.for().open();
|
|
997
|
+
event.stopPropagation();
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerToggle, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1001
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: DatepickerToggle, isStandalone: true, selector: "ngs-datepicker-toggle", inputs: { for: { classPropertyName: "for", publicName: "for", isSignal: true, isRequired: true, transformFunction: null } }, host: { classAttribute: "ngs-datepicker-toggle" }, queries: [{ propertyName: "customIcon", first: true, predicate: DatepickerToggleIcon, descendants: true, isSignal: true }], exportAs: ["ngsDatepickerToggle"], ngImport: i0, template: "<button ngsIconButton type=\"button\" (click)=\"_open($event)\" class=\"ngs-datepicker-toggle-button\">\n @if (customIcon()) {\n <ng-content select=\"[ngsDatepickerToggleIcon]\"/>\n } @else {\n <svg viewBox=\"0 0 24 24\" class=\"size-6\">\n <path fill=\"currentColor\"\n d=\"M17.75 3A3.25 3.25 0 0 1 21 6.25v11.5A3.25 3.25 0 0 1 17.75 21H6.25A3.25 3.25 0 0 1 3 17.75V6.25A3.25 3.25 0 0 1 6.25 3zm1.75 5.5h-15v9.25c0 .966.784 1.75 1.75 1.75h11.5a1.75 1.75 0 0 0 1.75-1.75zm-11.75 6a1.25 1.25 0 1 1 0 2.5a1.25 1.25 0 0 1 0-2.5m4.25 0a1.25 1.25 0 1 1 0 2.5a1.25 1.25 0 0 1 0-2.5m-4.25-4a1.25 1.25 0 1 1 0 2.5a1.25 1.25 0 0 1 0-2.5m4.25 0a1.25 1.25 0 1 1 0 2.5a1.25 1.25 0 0 1 0-2.5m4.25 0a1.25 1.25 0 1 1 0 2.5a1.25 1.25 0 0 1 0-2.5m1.5-6H6.25A1.75 1.75 0 0 0 4.5 6.25V7h15v-.75a1.75 1.75 0 0 0-1.75-1.75\"></path>\n </svg>\n }\n</button>\n", styles: ["/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1002
|
+
}
|
|
1003
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: DatepickerToggle, decorators: [{
|
|
1004
|
+
type: Component,
|
|
1005
|
+
args: [{ selector: 'ngs-datepicker-toggle', exportAs: 'ngsDatepickerToggle', imports: [
|
|
1006
|
+
Button
|
|
1007
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1008
|
+
'class': 'ngs-datepicker-toggle',
|
|
1009
|
+
}, template: "<button ngsIconButton type=\"button\" (click)=\"_open($event)\" class=\"ngs-datepicker-toggle-button\">\n @if (customIcon()) {\n <ng-content select=\"[ngsDatepickerToggleIcon]\"/>\n } @else {\n <svg viewBox=\"0 0 24 24\" class=\"size-6\">\n <path fill=\"currentColor\"\n d=\"M17.75 3A3.25 3.25 0 0 1 21 6.25v11.5A3.25 3.25 0 0 1 17.75 21H6.25A3.25 3.25 0 0 1 3 17.75V6.25A3.25 3.25 0 0 1 6.25 3zm1.75 5.5h-15v9.25c0 .966.784 1.75 1.75 1.75h11.5a1.75 1.75 0 0 0 1.75-1.75zm-11.75 6a1.25 1.25 0 1 1 0 2.5a1.25 1.25 0 0 1 0-2.5m4.25 0a1.25 1.25 0 1 1 0 2.5a1.25 1.25 0 0 1 0-2.5m-4.25-4a1.25 1.25 0 1 1 0 2.5a1.25 1.25 0 0 1 0-2.5m4.25 0a1.25 1.25 0 1 1 0 2.5a1.25 1.25 0 0 1 0-2.5m4.25 0a1.25 1.25 0 1 1 0 2.5a1.25 1.25 0 0 1 0-2.5m1.5-6H6.25A1.75 1.75 0 0 0 4.5 6.25V7h15v-.75a1.75 1.75 0 0 0-1.75-1.75\"></path>\n </svg>\n }\n</button>\n", styles: ["/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */\n"] }]
|
|
1010
|
+
}], propDecorators: { for: [{ type: i0.Input, args: [{ isSignal: true, alias: "for", required: true }] }], customIcon: [{ type: i0.ContentChild, args: [i0.forwardRef(() => DatepickerToggleIcon), { isSignal: true }] }] } });
|
|
1011
|
+
|
|
1012
|
+
class NativeDateAdapter extends DateAdapter {
|
|
1013
|
+
getYear(date) {
|
|
1014
|
+
return date.getFullYear();
|
|
1015
|
+
}
|
|
1016
|
+
getMonth(date) {
|
|
1017
|
+
return date.getMonth();
|
|
1018
|
+
}
|
|
1019
|
+
getDate(date) {
|
|
1020
|
+
return date.getDate();
|
|
1021
|
+
}
|
|
1022
|
+
getDayOfWeek(date) {
|
|
1023
|
+
return date.getDay();
|
|
1024
|
+
}
|
|
1025
|
+
getMonthNames(style) {
|
|
1026
|
+
const dtf = new Intl.DateTimeFormat(this.locale, { month: style, timeZone: 'UTC' });
|
|
1027
|
+
return Array.from({ length: 12 }, (_, i) => this._stripDirectionMarkers(dtf.format(new Date(Date.UTC(2017, i, 1)))));
|
|
1028
|
+
}
|
|
1029
|
+
getDateNames() {
|
|
1030
|
+
const dtf = new Intl.DateTimeFormat(this.locale, { day: 'numeric', timeZone: 'UTC' });
|
|
1031
|
+
return Array.from({ length: 31 }, (_, i) => this._stripDirectionMarkers(dtf.format(new Date(Date.UTC(2017, 0, i + 1)))));
|
|
1032
|
+
}
|
|
1033
|
+
getDayOfWeekNames(style) {
|
|
1034
|
+
const dtf = new Intl.DateTimeFormat(this.locale, { weekday: style, timeZone: 'UTC' });
|
|
1035
|
+
return Array.from({ length: 7 }, (_, i) => this._stripDirectionMarkers(dtf.format(new Date(Date.UTC(2017, 0, i + 8)))));
|
|
1036
|
+
}
|
|
1037
|
+
getYearName(date) {
|
|
1038
|
+
const dtf = new Intl.DateTimeFormat(this.locale, { year: 'numeric', timeZone: 'UTC' });
|
|
1039
|
+
return this._stripDirectionMarkers(dtf.format(new Date(Date.UTC(date.getFullYear(), 0, 1))));
|
|
1040
|
+
}
|
|
1041
|
+
getFirstDayOfWeek() {
|
|
1042
|
+
return 0; // Sunday
|
|
1043
|
+
}
|
|
1044
|
+
getNumDaysInMonth(date) {
|
|
1045
|
+
return this._createDateWithOverflow(this.getYear(date), this.getMonth(date) + 1, 0).getDate();
|
|
1046
|
+
}
|
|
1047
|
+
clone(date) {
|
|
1048
|
+
return new Date(date.getTime());
|
|
1049
|
+
}
|
|
1050
|
+
createDate(year, month, date) {
|
|
1051
|
+
if (month < 0 || month > 11) {
|
|
1052
|
+
throw Error(`Invalid month index "${month}". Month index must be between 0 and 11.`);
|
|
1053
|
+
}
|
|
1054
|
+
if (date < 1) {
|
|
1055
|
+
throw Error(`Invalid date "${date}". Date must be greater than 0.`);
|
|
1056
|
+
}
|
|
1057
|
+
const result = this._createDateWithOverflow(year, month, date);
|
|
1058
|
+
if (result.getMonth() !== month) {
|
|
1059
|
+
throw Error(`Invalid date "${date}" for month with index "${month}".`);
|
|
1060
|
+
}
|
|
1061
|
+
return result;
|
|
1062
|
+
}
|
|
1063
|
+
today() {
|
|
1064
|
+
return new Date();
|
|
1065
|
+
}
|
|
1066
|
+
parse(value) {
|
|
1067
|
+
if (typeof value === 'number') {
|
|
1068
|
+
return new Date(value);
|
|
1069
|
+
}
|
|
1070
|
+
if (value && typeof value === 'string') {
|
|
1071
|
+
const parts = value.split('/');
|
|
1072
|
+
if (parts.length === 3) {
|
|
1073
|
+
const month = parseInt(parts[0], 10) - 1;
|
|
1074
|
+
const day = parseInt(parts[1], 10);
|
|
1075
|
+
const year = parseInt(parts[2], 10);
|
|
1076
|
+
if (!isNaN(month) && !isNaN(day) && !isNaN(year)) {
|
|
1077
|
+
return this.createDate(year, month, day);
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
return new Date(Date.parse(value));
|
|
1081
|
+
}
|
|
1082
|
+
return value ? new Date(Date.parse(value)) : null;
|
|
1083
|
+
}
|
|
1084
|
+
format(date, displayFormat) {
|
|
1085
|
+
if (!this.isValid(date)) {
|
|
1086
|
+
throw Error('NativeDateAdapter: Cannot format invalid date.');
|
|
1087
|
+
}
|
|
1088
|
+
const dtf = new Intl.DateTimeFormat(this.locale, { ...displayFormat, timeZone: 'UTC' });
|
|
1089
|
+
return this._stripDirectionMarkers(dtf.format(new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()))));
|
|
1090
|
+
}
|
|
1091
|
+
addCalendarYears(date, years) {
|
|
1092
|
+
return this.addCalendarMonths(date, years * 12);
|
|
1093
|
+
}
|
|
1094
|
+
addCalendarMonths(date, months) {
|
|
1095
|
+
let newDate = this._createDateWithOverflow(this.getYear(date), this.getMonth(date) + months, this.getDate(date));
|
|
1096
|
+
if (this.getMonth(newDate) !== (this.getMonth(date) + months) % 12) {
|
|
1097
|
+
newDate = this._createDateWithOverflow(this.getYear(newDate), this.getMonth(newDate), 0);
|
|
1098
|
+
}
|
|
1099
|
+
return newDate;
|
|
1100
|
+
}
|
|
1101
|
+
addCalendarDays(date, days) {
|
|
1102
|
+
return this._createDateWithOverflow(this.getYear(date), this.getMonth(date), this.getDate(date) + days);
|
|
1103
|
+
}
|
|
1104
|
+
toIso8601(date) {
|
|
1105
|
+
return [date.getUTCFullYear(), this._2digit(date.getUTCMonth() + 1), this._2digit(date.getUTCDate())].join('-');
|
|
1106
|
+
}
|
|
1107
|
+
isDateInstance(obj) {
|
|
1108
|
+
return obj instanceof Date;
|
|
1109
|
+
}
|
|
1110
|
+
isValid(date) {
|
|
1111
|
+
return this.isDateInstance(date) && !isNaN(date.getTime());
|
|
1112
|
+
}
|
|
1113
|
+
invalid() {
|
|
1114
|
+
return new Date(NaN);
|
|
1115
|
+
}
|
|
1116
|
+
_2digit(n) {
|
|
1117
|
+
return ('00' + n).slice(-2);
|
|
1118
|
+
}
|
|
1119
|
+
_stripDirectionMarkers(str) {
|
|
1120
|
+
return str.replace(/[\u200e\u200f]/g, '');
|
|
1121
|
+
}
|
|
1122
|
+
_createDateWithOverflow(year, month, date) {
|
|
1123
|
+
const result = new Date(year, month, date);
|
|
1124
|
+
if (year >= 0 && year < 100) {
|
|
1125
|
+
result.setFullYear(year);
|
|
1126
|
+
}
|
|
1127
|
+
return result;
|
|
1128
|
+
}
|
|
1129
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: NativeDateAdapter, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1130
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: NativeDateAdapter });
|
|
1131
|
+
}
|
|
1132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: NativeDateAdapter, decorators: [{
|
|
1133
|
+
type: Injectable
|
|
1134
|
+
}] });
|
|
1135
|
+
|
|
1136
|
+
const MAT_NATIVE_DATE_FORMATS = {
|
|
1137
|
+
parse: {
|
|
1138
|
+
dateInput: null,
|
|
1139
|
+
},
|
|
1140
|
+
display: {
|
|
1141
|
+
dateInput: { month: 'short', year: 'numeric', day: 'numeric' },
|
|
1142
|
+
monthYearLabel: { month: 'short', year: 'numeric' },
|
|
1143
|
+
dateA11yLabel: { month: 'long', year: 'numeric', day: 'numeric' },
|
|
1144
|
+
monthYearA11yLabel: { month: 'long', year: 'numeric' },
|
|
1145
|
+
}
|
|
1146
|
+
};
|
|
1147
|
+
function provideNativeDateAdapter() {
|
|
1148
|
+
return [
|
|
1149
|
+
{ provide: DateAdapter, useClass: NativeDateAdapter },
|
|
1150
|
+
{ provide: MAT_DATE_FORMATS, useValue: MAT_NATIVE_DATE_FORMATS }
|
|
1151
|
+
];
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* Generated bundle index. Do not edit.
|
|
1156
|
+
*/
|
|
1157
|
+
|
|
1158
|
+
export { Calendar, DateAdapter, DateRange, DateRangeInput, DateRangePicker, Datepicker, DatepickerActions, DatepickerApply, DatepickerCancel, DatepickerInput, DatepickerIntl, DatepickerToggle, DatepickerToggleIcon, EndDate, MAT_DATE_FORMATS, MAT_DATE_LOCALE, MAT_NATIVE_DATE_FORMATS, MonthView, MultiYearView, NativeDateAdapter, StartDate, YearView, provideNativeDateAdapter };
|
|
1159
|
+
//# sourceMappingURL=ngstarter-ui-components-datepicker.mjs.map
|