@ojiepermana/angular 22.1.10 → 22.1.12
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 +32 -26
- package/chart/README.md +272 -0
- package/component/README.md +89 -0
- package/component/accordion/README.md +195 -0
- package/component/alert/README.md +184 -0
- package/component/alert-dialog/README.md +255 -0
- package/component/aspect-ratio/README.md +116 -0
- package/component/avatar/README.md +182 -0
- package/component/badge/README.md +143 -0
- package/component/breadcrumb/README.md +223 -0
- package/component/button/README.md +141 -0
- package/component/button-group/README.md +214 -0
- package/component/calendar/README.md +137 -0
- package/component/card/README.md +232 -0
- package/component/carousel/README.md +276 -0
- package/component/checkbox/README.md +153 -0
- package/component/collapsible/README.md +216 -0
- package/component/combobox/README.md +202 -0
- package/component/command/README.md +287 -0
- package/component/composer/README.md +241 -0
- package/component/context-menu/README.md +268 -0
- package/component/date-picker/README.md +202 -0
- package/component/dialog/README.md +276 -0
- package/component/drawer/README.md +147 -0
- package/component/dropdown-menu/README.md +336 -0
- package/component/editor/README.md +152 -0
- package/component/empty/README.md +193 -0
- package/component/form/README.md +216 -0
- package/component/hover-card/README.md +150 -0
- package/component/icon/README.md +25 -0
- package/component/input/README.md +160 -0
- package/component/input-group/README.md +245 -0
- package/component/input-otp/README.md +331 -0
- package/component/item/README.md +254 -0
- package/component/kanban/README.md +81 -0
- package/component/kbd/README.md +141 -0
- package/component/label/README.md +137 -0
- package/component/menubar/README.md +270 -0
- package/component/native-select/README.md +176 -0
- package/component/navigation-menu/README.md +165 -0
- package/component/pagination/README.md +151 -0
- package/component/pillbox/README.md +68 -0
- package/component/popover/README.md +54 -0
- package/component/progress/README.md +160 -0
- package/component/radio/README.md +212 -0
- package/component/resizable/README.md +178 -0
- package/component/scroll-area/README.md +150 -0
- package/component/select/README.md +228 -0
- package/component/separator/README.md +175 -0
- package/component/sheet/README.md +190 -0
- package/component/skeleton/README.md +158 -0
- package/component/slider/README.md +207 -0
- package/component/spinner/README.md +160 -0
- package/component/switch/README.md +170 -0
- package/component/table/README.md +292 -0
- package/component/tabs/README.md +220 -0
- package/component/textarea/README.md +169 -0
- package/component/timeline/README.md +94 -0
- package/component/toast/README.md +173 -0
- package/component/toggle/README.md +133 -0
- package/component/toggle-group/README.md +234 -0
- package/component/tooltip/README.md +230 -0
- package/fesm2022/ojiepermana-angular-chart-area.mjs +289 -3
- package/fesm2022/ojiepermana-angular-chart-bar.mjs +722 -3
- package/fesm2022/ojiepermana-angular-chart-core.mjs +1482 -3
- package/fesm2022/ojiepermana-angular-chart-line.mjs +294 -3
- package/fesm2022/ojiepermana-angular-chart-pie.mjs +291 -3
- package/fesm2022/ojiepermana-angular-chart-primitives.mjs +1301 -3
- package/fesm2022/ojiepermana-angular-chart-radar.mjs +421 -3
- package/fesm2022/ojiepermana-angular-chart-radial.mjs +295 -3
- package/fesm2022/ojiepermana-angular-chart-scatter.mjs +306 -3
- package/fesm2022/ojiepermana-angular-chart.mjs +12 -3
- package/fesm2022/ojiepermana-angular-component-accordion.mjs +267 -3
- package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +359 -3
- package/fesm2022/ojiepermana-angular-component-alert.mjs +101 -3
- package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +31 -3
- package/fesm2022/ojiepermana-angular-component-avatar.mjs +139 -3
- package/fesm2022/ojiepermana-angular-component-badge.mjs +57 -3
- package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +192 -3
- package/fesm2022/ojiepermana-angular-component-button-group.mjs +95 -3
- package/fesm2022/ojiepermana-angular-component-button.mjs +73 -3
- package/fesm2022/ojiepermana-angular-component-calendar.mjs +718 -3
- package/fesm2022/ojiepermana-angular-component-card.mjs +167 -3
- package/fesm2022/ojiepermana-angular-component-carousel.mjs +326 -3
- package/fesm2022/ojiepermana-angular-component-checkbox.mjs +190 -3
- package/fesm2022/ojiepermana-angular-component-collapsible.mjs +117 -3
- package/fesm2022/ojiepermana-angular-component-combobox.mjs +327 -3
- package/fesm2022/ojiepermana-angular-component-command.mjs +351 -3
- package/fesm2022/ojiepermana-angular-component-composer.mjs +359 -3
- package/fesm2022/ojiepermana-angular-component-context-menu.mjs +158 -3
- package/fesm2022/ojiepermana-angular-component-date-picker.mjs +482 -3
- package/fesm2022/ojiepermana-angular-component-dialog.mjs +400 -3
- package/fesm2022/ojiepermana-angular-component-drawer.mjs +1 -3
- package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +689 -3
- package/fesm2022/ojiepermana-angular-component-editor.mjs +511 -3
- package/fesm2022/ojiepermana-angular-component-empty.mjs +134 -3
- package/fesm2022/ojiepermana-angular-component-form.mjs +438 -3
- package/fesm2022/ojiepermana-angular-component-hover-card.mjs +273 -3
- package/fesm2022/ojiepermana-angular-component-icon.mjs +139 -3
- package/fesm2022/ojiepermana-angular-component-input-group.mjs +176 -3
- package/fesm2022/ojiepermana-angular-component-input-otp.mjs +550 -3
- package/fesm2022/ojiepermana-angular-component-input.mjs +52 -3
- package/fesm2022/ojiepermana-angular-component-item.mjs +264 -3
- package/fesm2022/ojiepermana-angular-component-kanban.mjs +310 -3
- package/fesm2022/ojiepermana-angular-component-kbd.mjs +48 -3
- package/fesm2022/ojiepermana-angular-component-label.mjs +27 -3
- package/fesm2022/ojiepermana-angular-component-menubar.mjs +327 -3
- package/fesm2022/ojiepermana-angular-component-native-select.mjs +62 -3
- package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +378 -3
- package/fesm2022/ojiepermana-angular-component-pagination.mjs +238 -3
- package/fesm2022/ojiepermana-angular-component-pillbox.mjs +999 -3
- package/fesm2022/ojiepermana-angular-component-popover.mjs +201 -3
- package/fesm2022/ojiepermana-angular-component-progress.mjs +57 -3
- package/fesm2022/ojiepermana-angular-component-radio.mjs +180 -3
- package/fesm2022/ojiepermana-angular-component-resizable.mjs +493 -3
- package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +51 -3
- package/fesm2022/ojiepermana-angular-component-segmented-control.mjs +227 -3
- package/fesm2022/ojiepermana-angular-component-select.mjs +609 -3
- package/fesm2022/ojiepermana-angular-component-separator.mjs +31 -3
- package/fesm2022/ojiepermana-angular-component-sheet.mjs +407 -3
- package/fesm2022/ojiepermana-angular-component-skeleton.mjs +25 -3
- package/fesm2022/ojiepermana-angular-component-slider.mjs +456 -3
- package/fesm2022/ojiepermana-angular-component-spinner.mjs +56 -3
- package/fesm2022/ojiepermana-angular-component-switch.mjs +145 -3
- package/fesm2022/ojiepermana-angular-component-table.mjs +155 -3
- package/fesm2022/ojiepermana-angular-component-tabs.mjs +315 -3
- package/fesm2022/ojiepermana-angular-component-textarea.mjs +46 -3
- package/fesm2022/ojiepermana-angular-component-timeline.mjs +237 -3
- package/fesm2022/ojiepermana-angular-component-toast.mjs +241 -3
- package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +290 -3
- package/fesm2022/ojiepermana-angular-component-toggle.mjs +76 -3
- package/fesm2022/ojiepermana-angular-component-tooltip.mjs +519 -3
- package/fesm2022/ojiepermana-angular-component-utils-core.mjs +310 -3
- package/fesm2022/ojiepermana-angular-component-utils-overlay.mjs +62 -3
- package/fesm2022/ojiepermana-angular-component-utils-scale.mjs +34 -3
- package/fesm2022/ojiepermana-angular-component-utils.mjs +3 -2
- package/fesm2022/ojiepermana-angular-component.mjs +4 -4
- package/fesm2022/ojiepermana-angular-navigation-core.mjs +21 -3
- package/fesm2022/ojiepermana-angular-navigation-icon.mjs +20 -3
- package/fesm2022/ojiepermana-angular-navigation-navigation-badge-count.component-CDBxQ8rk.mjs +91 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-dockbar-menu.component-DBQHdvGa.mjs +512 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-entry-grid.component-Cd-jh6tg.mjs +623 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-flyout-menu.component-BCGvhoYj.mjs +404 -0
- package/fesm2022/ojiepermana-angular-navigation-navigation-horizontal.component-Dk_03e-6.mjs +466 -0
- package/fesm2022/ojiepermana-angular-navigation-ojiepermana-angular-navigation-DNKU6viC.mjs +2642 -0
- package/fesm2022/ojiepermana-angular-navigation-service.mjs +725 -3
- package/fesm2022/ojiepermana-angular-navigation-types.mjs +65 -4
- package/fesm2022/ojiepermana-angular-navigation.mjs +4 -10
- package/fesm2022/ojiepermana-angular-sdk.mjs +204 -4
- package/fesm2022/ojiepermana-angular-theme-component-settings.mjs +1387 -3
- package/fesm2022/ojiepermana-angular-theme-layout-services.mjs +331 -3
- package/fesm2022/ojiepermana-angular-theme-layout-types.mjs +45 -4
- package/fesm2022/ojiepermana-angular-theme-layout-wrapper.mjs +1044 -3
- package/fesm2022/ojiepermana-angular-theme-layout.mjs +729 -3
- package/fesm2022/ojiepermana-angular-theme-page-core.mjs +381 -3
- package/fesm2022/ojiepermana-angular-theme-page-filter.mjs +267 -3
- package/fesm2022/ojiepermana-angular-theme-page-root.mjs +361 -3
- package/fesm2022/ojiepermana-angular-theme-page-side.mjs +198 -3
- package/fesm2022/ojiepermana-angular-theme-page-slots.mjs +110 -3
- package/fesm2022/ojiepermana-angular-theme-page.mjs +7 -2
- package/fesm2022/ojiepermana-angular-theme-shell-services.mjs +338 -3
- package/fesm2022/ojiepermana-angular-theme-shell-types.mjs +160 -4
- package/fesm2022/ojiepermana-angular-theme-shell.mjs +811 -3
- package/fesm2022/ojiepermana-angular-theme-styles.mjs +783 -3
- package/fesm2022/ojiepermana-angular-theme.mjs +4 -4
- package/fesm2022/ojiepermana-angular.mjs +6 -11
- package/navigation/README.md +374 -0
- package/package.json +81 -20
- package/sdk/README.md +212 -0
- package/sdk/schematics/collection.json +20 -0
- package/sdk/schematics/init/index.js +83 -0
- package/sdk/schematics/init/schema.json +19 -0
- package/sdk/schematics/ng-add/index.js +147 -0
- package/sdk/schematics/ng-add/schema.json +14 -0
- package/sdk/schematics/package.json +3 -0
- package/sdk/schematics/sdk/index.js +175 -0
- package/sdk/schematics/sdk/schema.json +19 -0
- package/sdk/sdk.config.example.json +24 -0
- package/sdk/src/config/loader.js +43 -0
- package/sdk/src/config/schema.js +59 -0
- package/sdk/src/emit/client.js +251 -0
- package/sdk/src/emit/metadata.js +310 -0
- package/sdk/src/emit/models.js +104 -0
- package/sdk/src/emit/navigation.js +56 -0
- package/sdk/src/emit/operations.js +118 -0
- package/sdk/src/emit/public-api.js +54 -0
- package/sdk/src/emit/services.js +110 -0
- package/sdk/src/engine.js +67 -0
- package/sdk/src/layout/per-domain.js +360 -0
- package/sdk/src/package.json +3 -0
- package/sdk/src/parser/bundle.js +25 -0
- package/sdk/src/parser/ir.js +429 -0
- package/sdk/src/parser/types.js +7 -0
- package/sdk/src/render/template.js +152 -0
- package/sdk/src/writer/index.js +286 -0
- package/theme/README.md +126 -0
- package/theme/component/settings/README.md +135 -0
- package/theme/layout/README.md +539 -0
- package/theme/page/README.md +453 -0
- package/theme/shell/README.md +340 -0
- package/theme/styles/README.md +178 -0
- package/theme/styles/css/base/components.css +553 -0
- package/theme/styles/css/base/index.css +14 -0
- package/theme/styles/css/base/package.css +9 -0
- package/theme/styles/css/base/prefers-dark.css +86 -0
- package/theme/styles/css/base/print.css +62 -0
- package/theme/styles/css/base/status.css +38 -0
- package/theme/styles/css/base/tailwind.css +165 -0
- package/theme/styles/css/base/theme.css +373 -0
- package/theme/styles/css/base/tokens.css +361 -0
- package/theme/styles/css/color/amber.css +72 -0
- package/theme/styles/css/color/blue.css +72 -0
- package/theme/styles/css/color/brand.css +38 -0
- package/theme/styles/css/color/cyan.css +72 -0
- package/theme/styles/css/color/emerald.css +72 -0
- package/theme/styles/css/color/fuchsia.css +72 -0
- package/theme/styles/css/color/green.css +72 -0
- package/theme/styles/css/color/index.css +19 -0
- package/theme/styles/css/color/indigo.css +72 -0
- package/theme/styles/css/color/lime.css +72 -0
- package/theme/styles/css/color/orange.css +72 -0
- package/theme/styles/css/color/pink.css +72 -0
- package/theme/styles/css/color/purple.css +72 -0
- package/theme/styles/css/color/red.css +72 -0
- package/theme/styles/css/color/rose.css +72 -0
- package/theme/styles/css/color/sky.css +72 -0
- package/theme/styles/css/color/teal.css +72 -0
- package/theme/styles/css/color/violet.css +72 -0
- package/theme/styles/css/color/yellow.css +72 -0
- package/theme/styles/css/index.css +18 -0
- package/theme/styles/css/neutral/gray.css +63 -0
- package/theme/styles/css/neutral/index.css +11 -0
- package/theme/styles/css/neutral/mauve.css +63 -0
- package/theme/styles/css/neutral/mist.css +63 -0
- package/theme/styles/css/neutral/neutral.css +63 -0
- package/theme/styles/css/neutral/olive.css +63 -0
- package/theme/styles/css/neutral/slate.css +63 -0
- package/theme/styles/css/neutral/stone.css +63 -0
- package/theme/styles/css/neutral/taupe.css +63 -0
- package/theme/styles/css/neutral/zinc.css +63 -0
- package/theme/styles/css/radius/index.css +30 -0
- package/theme/styles/css/space/index.css +20 -0
- package/types/ojiepermana-angular-chart-area.d.ts +76 -1
- package/types/ojiepermana-angular-chart-bar.d.ts +201 -1
- package/types/ojiepermana-angular-chart-core.d.ts +811 -1
- package/types/ojiepermana-angular-chart-line.d.ts +75 -1
- package/types/ojiepermana-angular-chart-pie.d.ts +131 -1
- package/types/ojiepermana-angular-chart-primitives.d.ts +291 -1
- package/types/ojiepermana-angular-chart-radar.d.ts +116 -1
- package/types/ojiepermana-angular-chart-radial.d.ts +116 -1
- package/types/ojiepermana-angular-chart-scatter.d.ts +125 -1
- package/types/ojiepermana-angular-chart.d.ts +2 -1
- package/types/ojiepermana-angular-component-accordion.d.ts +85 -1
- package/types/ojiepermana-angular-component-alert-dialog.d.ts +140 -1
- package/types/ojiepermana-angular-component-alert.d.ts +42 -1
- package/types/ojiepermana-angular-component-aspect-ratio.d.ts +12 -1
- package/types/ojiepermana-angular-component-avatar.d.ts +56 -1
- package/types/ojiepermana-angular-component-badge.d.ts +24 -1
- package/types/ojiepermana-angular-component-breadcrumb.d.ts +46 -1
- package/types/ojiepermana-angular-component-button-group.d.ts +26 -1
- package/types/ojiepermana-angular-component-button.d.ts +27 -1
- package/types/ojiepermana-angular-component-calendar.d.ts +111 -1
- package/types/ojiepermana-angular-component-card.d.ts +69 -1
- package/types/ojiepermana-angular-component-carousel.d.ts +86 -1
- package/types/ojiepermana-angular-component-checkbox.d.ts +42 -1
- package/types/ojiepermana-angular-component-collapsible.d.ts +42 -1
- package/types/ojiepermana-angular-component-combobox.d.ts +60 -1
- package/types/ojiepermana-angular-component-command.d.ts +130 -1
- package/types/ojiepermana-angular-component-composer.d.ts +90 -1
- package/types/ojiepermana-angular-component-context-menu.d.ts +54 -1
- package/types/ojiepermana-angular-component-date-picker.d.ts +109 -1
- package/types/ojiepermana-angular-component-dialog.d.ts +136 -1
- package/types/ojiepermana-angular-component-drawer.d.ts +1 -1
- package/types/ojiepermana-angular-component-dropdown-menu.d.ts +248 -1
- package/types/ojiepermana-angular-component-editor.d.ts +135 -1
- package/types/ojiepermana-angular-component-empty.d.ts +50 -1
- package/types/ojiepermana-angular-component-form.d.ts +159 -1
- package/types/ojiepermana-angular-component-hover-card.d.ts +75 -1
- package/types/ojiepermana-angular-component-icon.d.ts +89 -1
- package/types/ojiepermana-angular-component-input-group.d.ts +51 -1
- package/types/ojiepermana-angular-component-input-otp.d.ts +155 -1
- package/types/ojiepermana-angular-component-input.d.ts +21 -1
- package/types/ojiepermana-angular-component-item.d.ts +93 -1
- package/types/ojiepermana-angular-component-kanban.d.ts +70 -1
- package/types/ojiepermana-angular-component-kbd.d.ts +16 -1
- package/types/ojiepermana-angular-component-label.d.ts +11 -1
- package/types/ojiepermana-angular-component-menubar.d.ts +93 -1
- package/types/ojiepermana-angular-component-native-select.d.ts +26 -1
- package/types/ojiepermana-angular-component-navigation-menu.d.ts +104 -1
- package/types/ojiepermana-angular-component-pagination.d.ts +33 -1
- package/types/ojiepermana-angular-component-pillbox.d.ts +222 -1
- package/types/ojiepermana-angular-component-popover.d.ts +66 -1
- package/types/ojiepermana-angular-component-progress.d.ts +17 -1
- package/types/ojiepermana-angular-component-radio.d.ts +60 -1
- package/types/ojiepermana-angular-component-resizable.d.ts +117 -1
- package/types/ojiepermana-angular-component-scroll-area.d.ts +19 -1
- package/types/ojiepermana-angular-component-segmented-control.d.ts +58 -1
- package/types/ojiepermana-angular-component-select.d.ts +122 -1
- package/types/ojiepermana-angular-component-separator.d.ts +14 -1
- package/types/ojiepermana-angular-component-sheet.d.ts +130 -1
- package/types/ojiepermana-angular-component-skeleton.d.ts +10 -1
- package/types/ojiepermana-angular-component-slider.d.ts +83 -1
- package/types/ojiepermana-angular-component-spinner.d.ts +13 -1
- package/types/ojiepermana-angular-component-switch.d.ts +44 -1
- package/types/ojiepermana-angular-component-table.d.ts +57 -1
- package/types/ojiepermana-angular-component-tabs.d.ts +124 -1
- package/types/ojiepermana-angular-component-textarea.d.ts +17 -1
- package/types/ojiepermana-angular-component-timeline.d.ts +64 -1
- package/types/ojiepermana-angular-component-toast.d.ts +64 -1
- package/types/ojiepermana-angular-component-toggle-group.d.ts +90 -1
- package/types/ojiepermana-angular-component-toggle.d.ts +25 -1
- package/types/ojiepermana-angular-component-tooltip.d.ts +143 -1
- package/types/ojiepermana-angular-component-utils-core.d.ts +184 -1
- package/types/ojiepermana-angular-component-utils-overlay.d.ts +21 -1
- package/types/ojiepermana-angular-component-utils-scale.d.ts +19 -1
- package/types/ojiepermana-angular-component-utils.d.ts +2 -1
- package/types/ojiepermana-angular-component.d.ts +2 -1
- package/types/ojiepermana-angular-navigation-core.d.ts +59 -1
- package/types/ojiepermana-angular-navigation-icon.d.ts +12 -1
- package/types/ojiepermana-angular-navigation-service.d.ts +116 -1
- package/types/ojiepermana-angular-navigation-types.d.ts +144 -1
- package/types/ojiepermana-angular-navigation.d.ts +507 -1
- package/types/ojiepermana-angular-sdk.d.ts +89 -1
- package/types/ojiepermana-angular-theme-component-settings.d.ts +154 -1
- package/types/ojiepermana-angular-theme-layout-services.d.ts +147 -1
- package/types/ojiepermana-angular-theme-layout-types.d.ts +40 -1
- package/types/ojiepermana-angular-theme-layout-wrapper.d.ts +299 -1
- package/types/ojiepermana-angular-theme-layout.d.ts +129 -1
- package/types/ojiepermana-angular-theme-page-core.d.ts +157 -1
- package/types/ojiepermana-angular-theme-page-filter.d.ts +77 -1
- package/types/ojiepermana-angular-theme-page-root.d.ts +88 -1
- package/types/ojiepermana-angular-theme-page-side.d.ts +50 -1
- package/types/ojiepermana-angular-theme-page-slots.d.ts +40 -1
- package/types/ojiepermana-angular-theme-page.d.ts +5 -1
- package/types/ojiepermana-angular-theme-shell-services.d.ts +193 -1
- package/types/ojiepermana-angular-theme-shell-types.d.ts +105 -1
- package/types/ojiepermana-angular-theme-shell.d.ts +100 -1
- package/types/ojiepermana-angular-theme-styles.d.ts +319 -1
- package/types/ojiepermana-angular-theme.d.ts +2 -1
- package/types/ojiepermana-angular.d.ts +5 -5
|
@@ -1,7 +1,486 @@
|
|
|
1
|
-
|
|
1
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
2
|
+
import { TemplatePortal } from '@angular/cdk/portal';
|
|
3
|
+
import { DOCUMENT } from '@angular/common';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { inject, DestroyRef, Injector, ViewContainerRef, model, input, booleanAttribute, signal, linkedSignal, untracked, viewChild, computed, effect, afterNextRender, forwardRef, Component } from '@angular/core';
|
|
6
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
|
+
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
8
|
+
import { formatIsoDate, parseIsoDate, startOfDay, CalendarComponent } from '@ojiepermana/angular/component/calendar';
|
|
9
|
+
import { injectUniqueId, cn } from '@ojiepermana/angular/component/utils/core';
|
|
10
|
+
import { overlayDismissals } from '@ojiepermana/angular/component/utils/overlay';
|
|
2
11
|
|
|
3
|
-
|
|
12
|
+
class DatePickerComponent {
|
|
13
|
+
overlay = inject(Overlay);
|
|
14
|
+
documentRef = inject(DOCUMENT);
|
|
15
|
+
destroyRef = inject(DestroyRef);
|
|
16
|
+
injector = inject(Injector);
|
|
17
|
+
viewContainerRef = inject(ViewContainerRef);
|
|
18
|
+
instanceId = injectUniqueId('DatePicker');
|
|
19
|
+
value = model(null, /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
21
|
+
id = input(null, /* @ts-ignore */
|
|
22
|
+
...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
23
|
+
placeholder = input('Pick a date', /* @ts-ignore */
|
|
24
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
25
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
26
|
+
min = input(null, /* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
28
|
+
max = input(null, /* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
30
|
+
startAt = input(null, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "startAt" }] : /* istanbul ignore next */ []));
|
|
32
|
+
startView = input('month', /* @ts-ignore */
|
|
33
|
+
...(ngDevMode ? [{ debugName: "startView" }] : /* istanbul ignore next */ []));
|
|
34
|
+
touchUi = input(false, { ...(ngDevMode ? { debugName: "touchUi" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
35
|
+
dateFilter = input(null, /* @ts-ignore */
|
|
36
|
+
...(ngDevMode ? [{ debugName: "dateFilter" }] : /* istanbul ignore next */ []));
|
|
37
|
+
panelClass = input('datepicker-panel', /* @ts-ignore */
|
|
38
|
+
...(ngDevMode ? [{ debugName: "panelClass" }] : /* istanbul ignore next */ []));
|
|
39
|
+
panelAriaLabel = input('Choose a date', /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "panelAriaLabel" }] : /* istanbul ignore next */ []));
|
|
41
|
+
invalidFormatMessage = input('Enter a valid date in YYYY-MM-DD format.', /* @ts-ignore */
|
|
42
|
+
...(ngDevMode ? [{ debugName: "invalidFormatMessage" }] : /* istanbul ignore next */ []));
|
|
43
|
+
ariaLabel = input(null, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
44
|
+
ariaLabelledby = input(null, { ...(ngDevMode ? { debugName: "ariaLabelledby" } : /* istanbul ignore next */ {}), alias: 'aria-labelledby' });
|
|
45
|
+
ariaDescribedby = input(null, { ...(ngDevMode ? { debugName: "ariaDescribedby" } : /* istanbul ignore next */ {}), alias: 'aria-describedby' });
|
|
46
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
47
|
+
class = input('', /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "class" }] : /* istanbul ignore next */ []));
|
|
49
|
+
isEditing = signal(false, /* @ts-ignore */
|
|
50
|
+
...(ngDevMode ? [{ debugName: "isEditing" }] : /* istanbul ignore next */ []));
|
|
51
|
+
isOpen = signal(false, /* @ts-ignore */
|
|
52
|
+
...(ngDevMode ? [{ debugName: "isOpen" }] : /* istanbul ignore next */ []));
|
|
53
|
+
/**
|
|
54
|
+
* The text the field shows. Re-seeds from `value`, but a draft the user is
|
|
55
|
+
* still editing -- or one already refused -- outlives an incoming binding
|
|
56
|
+
* change, so their typing is never swapped out from under them.
|
|
57
|
+
*/
|
|
58
|
+
inputValue = linkedSignal({ ...(ngDevMode ? { debugName: "inputValue" } : /* istanbul ignore next */ {}), source: () => this.value(),
|
|
59
|
+
computation: (value, previous) => previous && untracked(() => this.isEditing() || !!this.draftError())
|
|
60
|
+
? previous.value
|
|
61
|
+
: value
|
|
62
|
+
? formatIsoDate(value)
|
|
63
|
+
: '' });
|
|
64
|
+
panelId = `${this.instanceId}-panel`;
|
|
65
|
+
errorId = `${this.instanceId}-error`;
|
|
66
|
+
draftError = signal(null, /* @ts-ignore */
|
|
67
|
+
...(ngDevMode ? [{ debugName: "draftError" }] : /* istanbul ignore next */ []));
|
|
68
|
+
cvaDisabled = signal(false, /* @ts-ignore */
|
|
69
|
+
...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
70
|
+
overlayRef = null;
|
|
71
|
+
restoreFocusElement = null;
|
|
72
|
+
validatorNotified = false;
|
|
73
|
+
onChangeFn = () => { };
|
|
74
|
+
onTouchedFn = () => { };
|
|
75
|
+
onValidatorChangeFn = () => { };
|
|
76
|
+
origin = viewChild.required('origin', /* @ts-ignore */
|
|
77
|
+
...(ngDevMode ? [{ debugName: "origin" }] : /* istanbul ignore next */ []));
|
|
78
|
+
input = viewChild.required('input', /* @ts-ignore */
|
|
79
|
+
...(ngDevMode ? [{ debugName: "input" }] : /* istanbul ignore next */ []));
|
|
80
|
+
panel = viewChild.required('panel', /* @ts-ignore */
|
|
81
|
+
...(ngDevMode ? [{ debugName: "panel" }] : /* istanbul ignore next */ []));
|
|
82
|
+
calendar = viewChild('calendar', /* @ts-ignore */
|
|
83
|
+
...(ngDevMode ? [{ debugName: "calendar" }] : /* istanbul ignore next */ []));
|
|
84
|
+
classes = computed(() => cn('date-picker block w-full', this.class()), /* @ts-ignore */
|
|
85
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
86
|
+
inputClasses = computed(() => cn('date-picker-input w-full', this.isDisabled() ? 'opacity-60' : ''), /* @ts-ignore */
|
|
87
|
+
...(ngDevMode ? [{ debugName: "inputClasses" }] : /* istanbul ignore next */ []));
|
|
88
|
+
resolvedId = computed(() => this.id() ?? this.instanceId, /* @ts-ignore */
|
|
89
|
+
...(ngDevMode ? [{ debugName: "resolvedId" }] : /* istanbul ignore next */ []));
|
|
90
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), /* @ts-ignore */
|
|
91
|
+
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
92
|
+
/**
|
|
93
|
+
* What a bound control is told. A refused draft is reported here as well as
|
|
94
|
+
* painted on the field, so the form cannot call itself valid while the input
|
|
95
|
+
* is showing an error the user has to fix.
|
|
96
|
+
*/
|
|
97
|
+
validationErrors = computed(() => {
|
|
98
|
+
const draft = this.draftError();
|
|
99
|
+
if (draft) {
|
|
100
|
+
return draft;
|
|
101
|
+
}
|
|
102
|
+
const value = this.value();
|
|
103
|
+
return value ? this.rangeError(value) : null;
|
|
104
|
+
}, /* @ts-ignore */
|
|
105
|
+
...(ngDevMode ? [{ debugName: "validationErrors" }] : /* istanbul ignore next */ []));
|
|
106
|
+
validationError = computed(() => this.validationErrors() ? this.invalidFormatMessage() : null, /* @ts-ignore */
|
|
107
|
+
...(ngDevMode ? [{ debugName: "validationError" }] : /* istanbul ignore next */ []));
|
|
108
|
+
resolvedAriaDescribedby = computed(() => [this.ariaDescribedby(), this.validationError() ? this.errorId : null]
|
|
109
|
+
.filter((value) => !!value)
|
|
110
|
+
.join(' ') || null, /* @ts-ignore */
|
|
111
|
+
...(ngDevMode ? [{ debugName: "resolvedAriaDescribedby" }] : /* istanbul ignore next */ []));
|
|
112
|
+
constructor() {
|
|
113
|
+
this.destroyRef.onDestroy(() => {
|
|
114
|
+
// Nothing survives the teardown to hand focus back to, so drop the target
|
|
115
|
+
// before closing: the overlay still has to be disposed of.
|
|
116
|
+
this.restoreFocusElement = null;
|
|
117
|
+
this.close();
|
|
118
|
+
});
|
|
119
|
+
effect(() => {
|
|
120
|
+
this.validationErrors();
|
|
121
|
+
untracked(() => this.notifyValidatorChange());
|
|
122
|
+
});
|
|
123
|
+
effect(() => {
|
|
124
|
+
if (this.isDisabled() && this.isOpen()) {
|
|
125
|
+
this.close();
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
open(restoreFocusElement) {
|
|
130
|
+
if (this.isDisabled() || this.isOpen()) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const originEl = this.origin().nativeElement;
|
|
134
|
+
this.restoreFocusElement =
|
|
135
|
+
restoreFocusElement ??
|
|
136
|
+
(this.documentRef.activeElement instanceof HTMLElement
|
|
137
|
+
? this.documentRef.activeElement
|
|
138
|
+
: this.input().nativeElement);
|
|
139
|
+
this.overlayRef = this.overlay.create({
|
|
140
|
+
positionStrategy: this.overlay
|
|
141
|
+
.position()
|
|
142
|
+
.flexibleConnectedTo(originEl)
|
|
143
|
+
.withPositions([
|
|
144
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 8 },
|
|
145
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -8 },
|
|
146
|
+
])
|
|
147
|
+
.withPush(true)
|
|
148
|
+
.withViewportMargin(8),
|
|
149
|
+
scrollStrategy: this.overlay.scrollStrategies.reposition(),
|
|
150
|
+
hasBackdrop: true,
|
|
151
|
+
backdropClass: 'cdk-overlay-transparent-backdrop',
|
|
152
|
+
panelClass: this.panelClass(),
|
|
153
|
+
});
|
|
154
|
+
const portal = new TemplatePortal(this.panel(), this.viewContainerRef);
|
|
155
|
+
const overlayRef = this.overlayRef;
|
|
156
|
+
if (!overlayRef) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
overlayRef.attach(portal);
|
|
160
|
+
overlayDismissals(overlayRef, originEl)
|
|
161
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
162
|
+
.subscribe(() => this.close());
|
|
163
|
+
this.isOpen.set(true);
|
|
164
|
+
afterNextRender({ read: () => this.calendar()?.focusActiveCell() }, { injector: this.injector });
|
|
165
|
+
}
|
|
166
|
+
close() {
|
|
167
|
+
if (!this.isOpen()) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
this.overlayRef?.dispose();
|
|
171
|
+
this.overlayRef = null;
|
|
172
|
+
this.isOpen.set(false);
|
|
173
|
+
const restoreFocusElement = this.restoreFocusElement;
|
|
174
|
+
this.restoreFocusElement = null;
|
|
175
|
+
this.restoreFocusAfterOverlayTeardown(restoreFocusElement);
|
|
176
|
+
}
|
|
177
|
+
toggle(event) {
|
|
178
|
+
if (this.isOpen()) {
|
|
179
|
+
this.close();
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
this.open(event?.currentTarget instanceof HTMLElement ? event.currentTarget : null);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
onInput(event) {
|
|
186
|
+
const text = event.target.value;
|
|
187
|
+
this.isEditing.set(true);
|
|
188
|
+
this.inputValue.set(text);
|
|
189
|
+
const parsed = parseIsoDate(text);
|
|
190
|
+
if (parsed && this.isSelectable(parsed)) {
|
|
191
|
+
this.setValue(parsed, true);
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
this.draftError.set(null);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
onBlur() {
|
|
198
|
+
this.isEditing.set(false);
|
|
199
|
+
this.commitInput();
|
|
200
|
+
this.onTouchedFn();
|
|
201
|
+
}
|
|
202
|
+
onEnter(event) {
|
|
203
|
+
event.preventDefault();
|
|
204
|
+
this.commitInput();
|
|
205
|
+
}
|
|
206
|
+
onCalendarSelect(date) {
|
|
207
|
+
this.setValue(date, true);
|
|
208
|
+
this.close();
|
|
209
|
+
}
|
|
210
|
+
writeValue(value) {
|
|
211
|
+
this.setValue(value, false);
|
|
212
|
+
}
|
|
213
|
+
registerOnChange(fn) {
|
|
214
|
+
this.onChangeFn = fn;
|
|
215
|
+
}
|
|
216
|
+
registerOnTouched(fn) {
|
|
217
|
+
this.onTouchedFn = fn;
|
|
218
|
+
}
|
|
219
|
+
setDisabledState(state) {
|
|
220
|
+
this.cvaDisabled.set(state);
|
|
221
|
+
}
|
|
222
|
+
validate() {
|
|
223
|
+
return this.validationErrors();
|
|
224
|
+
}
|
|
225
|
+
registerOnValidatorChange(fn) {
|
|
226
|
+
this.onValidatorChangeFn = fn;
|
|
227
|
+
}
|
|
228
|
+
commitInput() {
|
|
229
|
+
const draft = this.inputValue().trim();
|
|
230
|
+
if (!draft && !this.required()) {
|
|
231
|
+
this.setValue(null, true);
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
const parsed = parseIsoDate(draft);
|
|
235
|
+
if (!parsed) {
|
|
236
|
+
this.draftError.set({ dateParse: { text: draft } });
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
const rangeError = this.rangeError(parsed);
|
|
240
|
+
if (rangeError) {
|
|
241
|
+
this.draftError.set(rangeError);
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
this.setValue(parsed, true);
|
|
245
|
+
}
|
|
246
|
+
setValue(value, emit) {
|
|
247
|
+
const next = value ? new Date(value.getTime()) : null;
|
|
248
|
+
this.value.set(next);
|
|
249
|
+
this.inputValue.set(next ? formatIsoDate(next) : '');
|
|
250
|
+
this.draftError.set(null);
|
|
251
|
+
if (emit) {
|
|
252
|
+
this.onChangeFn(next);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* A refused draft never reaches the control, so nothing else would tell the
|
|
257
|
+
* forms API to ask again. The first flush is the initial computation, which
|
|
258
|
+
* the control's own set-up validation already covers.
|
|
259
|
+
*/
|
|
260
|
+
notifyValidatorChange() {
|
|
261
|
+
if (!this.validatorNotified) {
|
|
262
|
+
this.validatorNotified = true;
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
this.onValidatorChangeFn();
|
|
266
|
+
}
|
|
267
|
+
isSelectable(date) {
|
|
268
|
+
return !this.rangeError(date);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* The same question the calendar answers, answered the same way, and named.
|
|
272
|
+
*
|
|
273
|
+
* This used to compare raw `Date` values while the calendar normalised to the
|
|
274
|
+
* start of the day, so a `min` or `max` carrying a time component split the
|
|
275
|
+
* two apart: a boundary date typed into the field was rejected, while the very
|
|
276
|
+
* same date clicked in the popup was accepted. One rule, one helper, one
|
|
277
|
+
* answer -- and the answer now says which constraint refused the date, so a
|
|
278
|
+
* bound control can report it.
|
|
279
|
+
*/
|
|
280
|
+
rangeError(date) {
|
|
281
|
+
const day = startOfDay(date).getTime();
|
|
282
|
+
const min = this.min();
|
|
283
|
+
if (min && day < startOfDay(min).getTime()) {
|
|
284
|
+
return { dateMin: { min, actual: date } };
|
|
285
|
+
}
|
|
286
|
+
const max = this.max();
|
|
287
|
+
if (max && day > startOfDay(max).getTime()) {
|
|
288
|
+
return { dateMax: { max, actual: date } };
|
|
289
|
+
}
|
|
290
|
+
const filter = this.dateFilter();
|
|
291
|
+
return filter && !filter(date) ? { dateFilter: { actual: date } } : null;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* CDK disposes its overlay during the current event turn. Restoring focus in
|
|
295
|
+
* that same turn works in Chromium but WebKit may move it back to the body
|
|
296
|
+
* while it removes the pane. Defer until the post-disposal frame so every
|
|
297
|
+
* browser receives a stable focus restoration.
|
|
298
|
+
*/
|
|
299
|
+
restoreFocusAfterOverlayTeardown(element) {
|
|
300
|
+
if (!element?.isConnected || this.isDisabled()) {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
const view = this.documentRef.defaultView;
|
|
304
|
+
if (!view) {
|
|
305
|
+
queueMicrotask(() => {
|
|
306
|
+
if (element.isConnected && !this.isDisabled()) {
|
|
307
|
+
element.focus();
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
view.requestAnimationFrame(() => {
|
|
313
|
+
if (element.isConnected && !this.isDisabled()) {
|
|
314
|
+
element.focus();
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
319
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: DatePickerComponent, isStandalone: true, selector: "DatePicker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null }, startView: { classPropertyName: "startView", publicName: "startView", isSignal: true, isRequired: false, transformFunction: null }, touchUi: { classPropertyName: "touchUi", publicName: "touchUi", isSignal: true, isRequired: false, transformFunction: null }, dateFilter: { classPropertyName: "dateFilter", publicName: "dateFilter", isSignal: true, isRequired: false, transformFunction: null }, panelClass: { classPropertyName: "panelClass", publicName: "panelClass", isSignal: true, isRequired: false, transformFunction: null }, panelAriaLabel: { classPropertyName: "panelAriaLabel", publicName: "panelAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, invalidFormatMessage: { classPropertyName: "invalidFormatMessage", publicName: "invalidFormatMessage", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, class: { classPropertyName: "class", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "class": "classes()" } }, providers: [
|
|
320
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DatePickerComponent), multi: true },
|
|
321
|
+
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => DatePickerComponent), multi: true },
|
|
322
|
+
], viewQueries: [{ propertyName: "origin", first: true, predicate: ["origin"], descendants: true, isSignal: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }, { propertyName: "panel", first: true, predicate: ["panel"], descendants: true, isSignal: true }, { propertyName: "calendar", first: true, predicate: ["calendar"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
323
|
+
<div #origin class="date-picker-shell">
|
|
324
|
+
<input
|
|
325
|
+
#input
|
|
326
|
+
type="text"
|
|
327
|
+
[id]="resolvedId()"
|
|
328
|
+
[class]="inputClasses()"
|
|
329
|
+
[attr.aria-label]="ariaLabel()"
|
|
330
|
+
[attr.aria-labelledby]="ariaLabelledby()"
|
|
331
|
+
[attr.aria-describedby]="resolvedAriaDescribedby()"
|
|
332
|
+
[attr.aria-invalid]="validationError() ? 'true' : null"
|
|
333
|
+
[attr.placeholder]="placeholder()"
|
|
334
|
+
[required]="required()"
|
|
335
|
+
[disabled]="isDisabled()"
|
|
336
|
+
[value]="inputValue()"
|
|
337
|
+
(input)="onInput($any($event))"
|
|
338
|
+
(blur)="onBlur()"
|
|
339
|
+
(keydown.enter)="onEnter($any($event))"
|
|
340
|
+
/>
|
|
341
|
+
|
|
342
|
+
<button
|
|
343
|
+
type="button"
|
|
344
|
+
class="date-picker-toggle"
|
|
345
|
+
[attr.aria-label]="isOpen() ? 'Close calendar' : 'Open calendar'"
|
|
346
|
+
[attr.aria-controls]="panelId"
|
|
347
|
+
[attr.aria-expanded]="isOpen()"
|
|
348
|
+
aria-haspopup="dialog"
|
|
349
|
+
[disabled]="isDisabled()"
|
|
350
|
+
(click)="toggle($event)"
|
|
351
|
+
>
|
|
352
|
+
<svg
|
|
353
|
+
aria-hidden="true"
|
|
354
|
+
viewBox="0 0 24 24"
|
|
355
|
+
width="18"
|
|
356
|
+
height="18"
|
|
357
|
+
fill="none"
|
|
358
|
+
stroke="currentColor"
|
|
359
|
+
stroke-width="2"
|
|
360
|
+
stroke-linecap="round"
|
|
361
|
+
stroke-linejoin="round"
|
|
362
|
+
>
|
|
363
|
+
<rect x="3" y="5" width="18" height="16" rx="2" />
|
|
364
|
+
<path d="M8 3v4" />
|
|
365
|
+
<path d="M16 3v4" />
|
|
366
|
+
<path d="M3 11h18" />
|
|
367
|
+
</svg>
|
|
368
|
+
</button>
|
|
369
|
+
</div>
|
|
370
|
+
|
|
371
|
+
@if (validationError(); as error) {
|
|
372
|
+
<p [id]="errorId" class="date-picker-error" role="status">{{ error }}</p>
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
<ng-template #panel>
|
|
376
|
+
<div
|
|
377
|
+
[id]="panelId"
|
|
378
|
+
class="date-picker-panel"
|
|
379
|
+
role="dialog"
|
|
380
|
+
aria-modal="false"
|
|
381
|
+
[attr.aria-label]="panelAriaLabel()"
|
|
382
|
+
[attr.data-touch-ui]="touchUi() ? 'true' : null"
|
|
383
|
+
>
|
|
384
|
+
<Calendar
|
|
385
|
+
#calendar
|
|
386
|
+
[value]="value()"
|
|
387
|
+
[min]="min()"
|
|
388
|
+
[max]="max()"
|
|
389
|
+
[startAt]="startAt()"
|
|
390
|
+
[startView]="startView()"
|
|
391
|
+
[dateFilter]="dateFilter()"
|
|
392
|
+
[disabled]="isDisabled()"
|
|
393
|
+
(valueChange)="onCalendarSelect($event)"
|
|
394
|
+
/>
|
|
395
|
+
</div>
|
|
396
|
+
</ng-template>
|
|
397
|
+
`, isInline: true, styles: [":host{display:block;min-width:0}.date-picker-shell{position:relative;width:100%}.date-picker-input{display:block;width:100%;height:var(--control-height-md);min-width:0;border:1px solid hsl(var(--input));border-radius:var(--radius);background:transparent;padding:calc(var(--spacing-base) * 2) calc(var(--spacing-base) * 11) calc(var(--spacing-base) * 2) calc(var(--spacing-base) * 3);color:hsl(var(--foreground));font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--text-sm--line-height);box-shadow:var(--shadow-sm, 0 1px 2px hsl(var(--foreground) / .05));transition:border-color .15s ease,box-shadow .15s ease}.date-picker-input::placeholder{color:hsl(var(--muted-foreground))}.date-picker-input:hover:not(:disabled){border-color:hsl(var(--foreground) / .45)}.date-picker-input:focus-visible{outline:none;border-color:hsl(var(--ring));box-shadow:0 0 0 1px hsl(var(--ring))}.date-picker-input:disabled{cursor:not-allowed;background:hsl(var(--muted) / .45)}.date-picker-toggle{position:absolute;inset-block-start:50%;inset-inline-end:var(--spacing-base);display:inline-flex;width:calc(var(--spacing-base) * 7);height:calc(var(--spacing-base) * 7);transform:translateY(-50%);align-items:center;justify-content:center;border:0;border-radius:calc(var(--radius) - .125rem);background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background-color .15s ease,color .15s ease}.date-picker-toggle:hover:not(:disabled){background:hsl(var(--accent));color:hsl(var(--accent-foreground))}.date-picker-toggle:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:2px}.date-picker-toggle:disabled{cursor:not-allowed;opacity:.5}.date-picker-panel{width:fit-content;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--popover));color:hsl(var(--popover-foreground));box-shadow:var(--shadow-md, 0 12px 24px -16px hsl(var(--foreground) / .35))}.date-picker-panel Calendar{border:0;border-radius:inherit;background:transparent}.date-picker-panel[data-touch-ui=true]{max-width:min(100vw - calc(var(--spacing-base) * 8),calc(var(--spacing-base) * 88))}.date-picker-error{margin:calc(var(--spacing-base) * 1.5) 0 0;color:hsl(var(--destructive));font-size:var(--text-sm);line-height:var(--text-sm--line-height)}\n"], dependencies: [{ kind: "component", type: CalendarComponent, selector: "Calendar", inputs: ["value", "min", "max", "startAt", "startView", "dateFilter", "disabled", "class"], outputs: ["valueChange"] }] });
|
|
398
|
+
}
|
|
399
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: DatePickerComponent, decorators: [{
|
|
400
|
+
type: Component,
|
|
401
|
+
args: [{ selector: 'DatePicker', imports: [CalendarComponent], providers: [
|
|
402
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DatePickerComponent), multi: true },
|
|
403
|
+
{ provide: NG_VALIDATORS, useExisting: forwardRef(() => DatePickerComponent), multi: true },
|
|
404
|
+
], host: { '[class]': 'classes()' }, template: `
|
|
405
|
+
<div #origin class="date-picker-shell">
|
|
406
|
+
<input
|
|
407
|
+
#input
|
|
408
|
+
type="text"
|
|
409
|
+
[id]="resolvedId()"
|
|
410
|
+
[class]="inputClasses()"
|
|
411
|
+
[attr.aria-label]="ariaLabel()"
|
|
412
|
+
[attr.aria-labelledby]="ariaLabelledby()"
|
|
413
|
+
[attr.aria-describedby]="resolvedAriaDescribedby()"
|
|
414
|
+
[attr.aria-invalid]="validationError() ? 'true' : null"
|
|
415
|
+
[attr.placeholder]="placeholder()"
|
|
416
|
+
[required]="required()"
|
|
417
|
+
[disabled]="isDisabled()"
|
|
418
|
+
[value]="inputValue()"
|
|
419
|
+
(input)="onInput($any($event))"
|
|
420
|
+
(blur)="onBlur()"
|
|
421
|
+
(keydown.enter)="onEnter($any($event))"
|
|
422
|
+
/>
|
|
423
|
+
|
|
424
|
+
<button
|
|
425
|
+
type="button"
|
|
426
|
+
class="date-picker-toggle"
|
|
427
|
+
[attr.aria-label]="isOpen() ? 'Close calendar' : 'Open calendar'"
|
|
428
|
+
[attr.aria-controls]="panelId"
|
|
429
|
+
[attr.aria-expanded]="isOpen()"
|
|
430
|
+
aria-haspopup="dialog"
|
|
431
|
+
[disabled]="isDisabled()"
|
|
432
|
+
(click)="toggle($event)"
|
|
433
|
+
>
|
|
434
|
+
<svg
|
|
435
|
+
aria-hidden="true"
|
|
436
|
+
viewBox="0 0 24 24"
|
|
437
|
+
width="18"
|
|
438
|
+
height="18"
|
|
439
|
+
fill="none"
|
|
440
|
+
stroke="currentColor"
|
|
441
|
+
stroke-width="2"
|
|
442
|
+
stroke-linecap="round"
|
|
443
|
+
stroke-linejoin="round"
|
|
444
|
+
>
|
|
445
|
+
<rect x="3" y="5" width="18" height="16" rx="2" />
|
|
446
|
+
<path d="M8 3v4" />
|
|
447
|
+
<path d="M16 3v4" />
|
|
448
|
+
<path d="M3 11h18" />
|
|
449
|
+
</svg>
|
|
450
|
+
</button>
|
|
451
|
+
</div>
|
|
452
|
+
|
|
453
|
+
@if (validationError(); as error) {
|
|
454
|
+
<p [id]="errorId" class="date-picker-error" role="status">{{ error }}</p>
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
<ng-template #panel>
|
|
458
|
+
<div
|
|
459
|
+
[id]="panelId"
|
|
460
|
+
class="date-picker-panel"
|
|
461
|
+
role="dialog"
|
|
462
|
+
aria-modal="false"
|
|
463
|
+
[attr.aria-label]="panelAriaLabel()"
|
|
464
|
+
[attr.data-touch-ui]="touchUi() ? 'true' : null"
|
|
465
|
+
>
|
|
466
|
+
<Calendar
|
|
467
|
+
#calendar
|
|
468
|
+
[value]="value()"
|
|
469
|
+
[min]="min()"
|
|
470
|
+
[max]="max()"
|
|
471
|
+
[startAt]="startAt()"
|
|
472
|
+
[startView]="startView()"
|
|
473
|
+
[dateFilter]="dateFilter()"
|
|
474
|
+
[disabled]="isDisabled()"
|
|
475
|
+
(valueChange)="onCalendarSelect($event)"
|
|
476
|
+
/>
|
|
477
|
+
</div>
|
|
478
|
+
</ng-template>
|
|
479
|
+
`, styles: [":host{display:block;min-width:0}.date-picker-shell{position:relative;width:100%}.date-picker-input{display:block;width:100%;height:var(--control-height-md);min-width:0;border:1px solid hsl(var(--input));border-radius:var(--radius);background:transparent;padding:calc(var(--spacing-base) * 2) calc(var(--spacing-base) * 11) calc(var(--spacing-base) * 2) calc(var(--spacing-base) * 3);color:hsl(var(--foreground));font-family:var(--font-sans);font-size:var(--text-sm);line-height:var(--text-sm--line-height);box-shadow:var(--shadow-sm, 0 1px 2px hsl(var(--foreground) / .05));transition:border-color .15s ease,box-shadow .15s ease}.date-picker-input::placeholder{color:hsl(var(--muted-foreground))}.date-picker-input:hover:not(:disabled){border-color:hsl(var(--foreground) / .45)}.date-picker-input:focus-visible{outline:none;border-color:hsl(var(--ring));box-shadow:0 0 0 1px hsl(var(--ring))}.date-picker-input:disabled{cursor:not-allowed;background:hsl(var(--muted) / .45)}.date-picker-toggle{position:absolute;inset-block-start:50%;inset-inline-end:var(--spacing-base);display:inline-flex;width:calc(var(--spacing-base) * 7);height:calc(var(--spacing-base) * 7);transform:translateY(-50%);align-items:center;justify-content:center;border:0;border-radius:calc(var(--radius) - .125rem);background:transparent;color:hsl(var(--muted-foreground));cursor:pointer;transition:background-color .15s ease,color .15s ease}.date-picker-toggle:hover:not(:disabled){background:hsl(var(--accent));color:hsl(var(--accent-foreground))}.date-picker-toggle:focus-visible{outline:2px solid hsl(var(--ring));outline-offset:2px}.date-picker-toggle:disabled{cursor:not-allowed;opacity:.5}.date-picker-panel{width:fit-content;border:1px solid hsl(var(--border));border-radius:var(--radius);background:hsl(var(--popover));color:hsl(var(--popover-foreground));box-shadow:var(--shadow-md, 0 12px 24px -16px hsl(var(--foreground) / .35))}.date-picker-panel Calendar{border:0;border-radius:inherit;background:transparent}.date-picker-panel[data-touch-ui=true]{max-width:min(100vw - calc(var(--spacing-base) * 8),calc(var(--spacing-base) * 88))}.date-picker-error{margin:calc(var(--spacing-base) * 1.5) 0 0;color:hsl(var(--destructive));font-size:var(--text-sm);line-height:var(--text-sm--line-height)}\n"] }]
|
|
480
|
+
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], startAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "startAt", required: false }] }], startView: [{ type: i0.Input, args: [{ isSignal: true, alias: "startView", required: false }] }], touchUi: [{ type: i0.Input, args: [{ isSignal: true, alias: "touchUi", required: false }] }], dateFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateFilter", required: false }] }], panelClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelClass", required: false }] }], panelAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelAriaLabel", required: false }] }], invalidFormatMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidFormatMessage", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], ariaLabelledby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaDescribedby: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-describedby", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], class: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], origin: [{ type: i0.ViewChild, args: ['origin', { isSignal: true }] }], input: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], panel: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], calendar: [{ type: i0.ViewChild, args: ['calendar', { isSignal: true }] }] } });
|
|
4
481
|
|
|
5
482
|
/**
|
|
6
483
|
* Generated bundle index. Do not edit.
|
|
7
|
-
*/
|
|
484
|
+
*/
|
|
485
|
+
|
|
486
|
+
export { DatePickerComponent };
|