ngwr 6.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -3
- package/README.md +179 -32
- package/affix/styles/_index.scss +12 -0
- package/alert/styles/_index.scss +75 -32
- package/anchor/styles/_index.scss +59 -0
- package/aurora/aurora.scss +1 -0
- package/aurora/styles/_index.scss +30 -0
- package/avatar/styles/_index.scss +30 -14
- package/back-top/styles/_index.scss +42 -0
- package/badge/styles/_index.scss +80 -0
- package/badge/styles/_tag.scss +81 -0
- package/bar-chart/styles/_index.scss +56 -0
- package/blur-text/blur-text.scss +1 -0
- package/blur-text/styles/_index.scss +14 -0
- package/border-glow/border-glow.scss +4 -0
- package/border-glow/styles/_index.scss +228 -0
- package/breadcrumbs/breadcrumbs.scss +1 -0
- package/breadcrumbs/styles/_index.scss +76 -0
- package/button/styles/_index.scss +148 -125
- package/calendar/styles/_index.scss +252 -0
- package/calendar-heatmap/styles/_index.scss +69 -0
- package/card/card.scss +1 -0
- package/card/styles/_index.scss +96 -0
- package/carousel/styles/_index.scss +102 -0
- package/cascader/cascader.scss +1 -0
- package/cascader/styles/_index.scss +174 -0
- package/checkbox/styles/_index.scss +76 -60
- package/circular-text/circular-text.scss +1 -0
- package/circular-text/styles/_index.scss +45 -0
- package/click-spark/click-spark.scss +1 -0
- package/click-spark/styles/_index.scss +16 -0
- package/collapse/styles/_index.scss +92 -0
- package/color-picker/styles/_index.scss +247 -0
- package/command-palette/styles/_index.scss +188 -0
- package/compare/styles/_index.scss +100 -0
- package/context-menu/styles/_index.scss +112 -0
- package/counter/styles/_index.scss +44 -0
- package/date-picker/styles/_index.scss +204 -0
- package/decrypt-text/decrypt-text.scss +1 -0
- package/decrypt-text/styles/_index.scss +26 -0
- package/density/styles/_index.scss +37 -0
- package/descriptions/styles/_index.scss +104 -0
- package/dialog/styles/_index.scss +101 -27
- package/divider/styles/_index.scss +43 -24
- package/donut-chart/styles/_index.scss +76 -0
- package/drag-drop/sortable-list.scss +1 -0
- package/drag-drop/styles/_index.scss +99 -0
- package/drawer/styles/_index.scss +164 -0
- package/dropdown/styles/_index.scss +76 -56
- package/empty/styles/_index.scss +49 -0
- package/falling-text/falling-text.scss +1 -0
- package/falling-text/styles/_index.scss +30 -0
- package/fesm2022/ngwr-affix.mjs +102 -0
- package/fesm2022/ngwr-affix.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +70 -52
- package/fesm2022/ngwr-alert.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +103 -0
- package/fesm2022/ngwr-anchor.mjs.map +1 -0
- package/fesm2022/ngwr-aurora.mjs +309 -0
- package/fesm2022/ngwr-aurora.mjs.map +1 -0
- package/fesm2022/ngwr-avatar.mjs +81 -71
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +81 -0
- package/fesm2022/ngwr-back-top.mjs.map +1 -0
- package/fesm2022/ngwr-badge.mjs +192 -0
- package/fesm2022/ngwr-badge.mjs.map +1 -0
- package/fesm2022/ngwr-bar-chart.mjs +69 -0
- package/fesm2022/ngwr-bar-chart.mjs.map +1 -0
- package/fesm2022/ngwr-blur-text.mjs +181 -0
- package/fesm2022/ngwr-blur-text.mjs.map +1 -0
- package/fesm2022/ngwr-border-glow.mjs +278 -0
- package/fesm2022/ngwr-border-glow.mjs.map +1 -0
- package/fesm2022/ngwr-breadcrumbs.mjs +101 -0
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -0
- package/fesm2022/ngwr-button.mjs +179 -104
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +145 -0
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -0
- package/fesm2022/ngwr-calendar.mjs +402 -0
- package/fesm2022/ngwr-calendar.mjs.map +1 -0
- package/fesm2022/ngwr-card.mjs +100 -0
- package/fesm2022/ngwr-card.mjs.map +1 -0
- package/fesm2022/ngwr-carousel.mjs +128 -0
- package/fesm2022/ngwr-carousel.mjs.map +1 -0
- package/fesm2022/ngwr-cascader.mjs +280 -0
- package/fesm2022/ngwr-cascader.mjs.map +1 -0
- package/fesm2022/ngwr-checkbox.mjs +214 -54
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-circular-text.mjs +168 -0
- package/fesm2022/ngwr-circular-text.mjs.map +1 -0
- package/fesm2022/ngwr-click-spark.mjs +163 -0
- package/fesm2022/ngwr-click-spark.mjs.map +1 -0
- package/fesm2022/ngwr-clipboard.mjs +130 -0
- package/fesm2022/ngwr-clipboard.mjs.map +1 -0
- package/fesm2022/ngwr-collapse.mjs +232 -0
- package/fesm2022/ngwr-collapse.mjs.map +1 -0
- package/fesm2022/ngwr-color-picker.mjs +646 -0
- package/fesm2022/ngwr-color-picker.mjs.map +1 -0
- package/fesm2022/ngwr-command-palette.mjs +259 -0
- package/fesm2022/ngwr-command-palette.mjs.map +1 -0
- package/fesm2022/ngwr-compare.mjs +137 -0
- package/fesm2022/ngwr-compare.mjs.map +1 -0
- package/fesm2022/ngwr-confetti.mjs +160 -0
- package/fesm2022/ngwr-confetti.mjs.map +1 -0
- package/fesm2022/ngwr-context-menu.mjs +653 -0
- package/fesm2022/ngwr-context-menu.mjs.map +1 -0
- package/fesm2022/ngwr-cookie.mjs +127 -0
- package/fesm2022/ngwr-cookie.mjs.map +1 -0
- package/fesm2022/ngwr-counter.mjs +415 -0
- package/fesm2022/ngwr-counter.mjs.map +1 -0
- package/fesm2022/ngwr-date-adapter-fns.mjs +180 -0
- package/fesm2022/ngwr-date-adapter-fns.mjs.map +1 -0
- package/fesm2022/ngwr-date-adapter-luxon.mjs +201 -0
- package/fesm2022/ngwr-date-adapter-luxon.mjs.map +1 -0
- package/fesm2022/ngwr-date-adapter.mjs +419 -0
- package/fesm2022/ngwr-date-adapter.mjs.map +1 -0
- package/fesm2022/ngwr-date-picker.mjs +624 -0
- package/fesm2022/ngwr-date-picker.mjs.map +1 -0
- package/fesm2022/ngwr-decrypt-text.mjs +396 -0
- package/fesm2022/ngwr-decrypt-text.mjs.map +1 -0
- package/fesm2022/ngwr-density.mjs +157 -0
- package/fesm2022/ngwr-density.mjs.map +1 -0
- package/fesm2022/ngwr-descriptions.mjs +83 -0
- package/fesm2022/ngwr-descriptions.mjs.map +1 -0
- package/fesm2022/ngwr-dialog.mjs +249 -383
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +315 -0
- package/fesm2022/ngwr-directives.mjs.map +1 -0
- package/fesm2022/ngwr-divider.mjs +74 -59
- package/fesm2022/ngwr-divider.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +131 -0
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -0
- package/fesm2022/ngwr-drag-drop.mjs +117 -0
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -0
- package/fesm2022/ngwr-drawer.mjs +315 -0
- package/fesm2022/ngwr-drawer.mjs.map +1 -0
- package/fesm2022/ngwr-dropdown.mjs +276 -229
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +57 -0
- package/fesm2022/ngwr-empty.mjs.map +1 -0
- package/fesm2022/ngwr-falling-text.mjs +316 -0
- package/fesm2022/ngwr-falling-text.mjs.map +1 -0
- package/fesm2022/ngwr-file-upload.mjs +260 -0
- package/fesm2022/ngwr-file-upload.mjs.map +1 -0
- package/fesm2022/ngwr-form.mjs +133 -48
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +373 -0
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -0
- package/fesm2022/ngwr-gauge.mjs +83 -0
- package/fesm2022/ngwr-gauge.mjs.map +1 -0
- package/fesm2022/ngwr-glitch-text.mjs +67 -0
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -0
- package/fesm2022/ngwr-gradient-text.mjs +109 -0
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -0
- package/fesm2022/ngwr-hotkey.mjs +263 -0
- package/fesm2022/ngwr-hotkey.mjs.map +1 -0
- package/fesm2022/ngwr-i18n-en.mjs +168 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -0
- package/fesm2022/ngwr-i18n-ru.mjs +156 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -0
- package/fesm2022/ngwr-i18n.mjs +478 -0
- package/fesm2022/ngwr-i18n.mjs.map +1 -0
- package/fesm2022/ngwr-icon-adapters-feather.mjs +74 -0
- package/fesm2022/ngwr-icon-adapters-feather.mjs.map +1 -0
- package/fesm2022/ngwr-icon-adapters-lucide.mjs +88 -0
- package/fesm2022/ngwr-icon-adapters-lucide.mjs.map +1 -0
- package/fesm2022/ngwr-icon.mjs +189 -650
- package/fesm2022/ngwr-icon.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +299 -0
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -0
- package/fesm2022/ngwr-input-number.mjs +239 -0
- package/fesm2022/ngwr-input-number.mjs.map +1 -0
- package/fesm2022/ngwr-input-otp.mjs +216 -0
- package/fesm2022/ngwr-input-otp.mjs.map +1 -0
- package/fesm2022/ngwr-input.mjs +183 -104
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +47 -0
- package/fesm2022/ngwr-keyboard.mjs.map +1 -0
- package/fesm2022/ngwr-knob.mjs +227 -0
- package/fesm2022/ngwr-knob.mjs.map +1 -0
- package/fesm2022/ngwr-layout.mjs +197 -0
- package/fesm2022/ngwr-layout.mjs.map +1 -0
- package/fesm2022/ngwr-lightbox.mjs +131 -0
- package/fesm2022/ngwr-lightbox.mjs.map +1 -0
- package/fesm2022/ngwr-line-chart.mjs +176 -0
- package/fesm2022/ngwr-line-chart.mjs.map +1 -0
- package/fesm2022/ngwr-list.mjs +132 -0
- package/fesm2022/ngwr-list.mjs.map +1 -0
- package/fesm2022/ngwr-loading-bar.mjs +160 -0
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -0
- package/fesm2022/ngwr-marquee.mjs +224 -0
- package/fesm2022/ngwr-marquee.mjs.map +1 -0
- package/fesm2022/ngwr-media.mjs +132 -0
- package/fesm2022/ngwr-media.mjs.map +1 -0
- package/fesm2022/ngwr-mention.mjs +374 -0
- package/fesm2022/ngwr-mention.mjs.map +1 -0
- package/fesm2022/ngwr-meta.mjs +266 -0
- package/fesm2022/ngwr-meta.mjs.map +1 -0
- package/fesm2022/ngwr-meter-group.mjs +73 -0
- package/fesm2022/ngwr-meter-group.mjs.map +1 -0
- package/fesm2022/ngwr-overlay.mjs +145 -0
- package/fesm2022/ngwr-overlay.mjs.map +1 -0
- package/fesm2022/ngwr-page-header.mjs +53 -0
- package/fesm2022/ngwr-page-header.mjs.map +1 -0
- package/fesm2022/ngwr-pagination.mjs +152 -96
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +290 -11
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +63 -0
- package/fesm2022/ngwr-platform.mjs.map +1 -0
- package/fesm2022/ngwr-popconfirm.mjs +188 -0
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -0
- package/fesm2022/ngwr-popover.mjs +361 -0
- package/fesm2022/ngwr-popover.mjs.map +1 -0
- package/fesm2022/ngwr-progress.mjs +47 -39
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +168 -190
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +204 -0
- package/fesm2022/ngwr-radio.mjs.map +1 -0
- package/fesm2022/ngwr-rating.mjs +180 -0
- package/fesm2022/ngwr-rating.mjs.map +1 -0
- package/fesm2022/ngwr-result.mjs +119 -0
- package/fesm2022/ngwr-result.mjs.map +1 -0
- package/fesm2022/ngwr-rotating-text.mjs +256 -0
- package/fesm2022/ngwr-rotating-text.mjs.map +1 -0
- package/fesm2022/ngwr-scramble-text.mjs +165 -0
- package/fesm2022/ngwr-scramble-text.mjs.map +1 -0
- package/fesm2022/ngwr-scroll.mjs +107 -0
- package/fesm2022/ngwr-scroll.mjs.map +1 -0
- package/fesm2022/ngwr-segmented.mjs +96 -0
- package/fesm2022/ngwr-segmented.mjs.map +1 -0
- package/fesm2022/ngwr-select.mjs +842 -307
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +127 -0
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -0
- package/fesm2022/ngwr-sidebar.mjs +134 -0
- package/fesm2022/ngwr-sidebar.mjs.map +1 -0
- package/fesm2022/ngwr-skeleton.mjs +59 -34
- package/fesm2022/ngwr-skeleton.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +234 -0
- package/fesm2022/ngwr-slider.mjs.map +1 -0
- package/fesm2022/ngwr-sparkline.mjs +104 -0
- package/fesm2022/ngwr-sparkline.mjs.map +1 -0
- package/fesm2022/ngwr-speed-dial.mjs +79 -0
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -0
- package/fesm2022/ngwr-spinner.mjs +34 -28
- package/fesm2022/ngwr-spinner.mjs.map +1 -1
- package/fesm2022/ngwr-splash-cursor.mjs +970 -0
- package/fesm2022/ngwr-splash-cursor.mjs.map +1 -0
- package/fesm2022/ngwr-split-text.mjs +200 -0
- package/fesm2022/ngwr-split-text.mjs.map +1 -0
- package/fesm2022/ngwr-splitter.mjs +125 -0
- package/fesm2022/ngwr-splitter.mjs.map +1 -0
- package/fesm2022/ngwr-spotlight-card.mjs +138 -0
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -0
- package/fesm2022/ngwr-squircle.mjs +320 -0
- package/fesm2022/ngwr-squircle.mjs.map +1 -0
- package/fesm2022/ngwr-star-border.mjs +72 -0
- package/fesm2022/ngwr-star-border.mjs.map +1 -0
- package/fesm2022/ngwr-statistic.mjs +220 -0
- package/fesm2022/ngwr-statistic.mjs.map +1 -0
- package/fesm2022/ngwr-stepper.mjs +186 -0
- package/fesm2022/ngwr-stepper.mjs.map +1 -0
- package/fesm2022/ngwr-storage.mjs +317 -0
- package/fesm2022/ngwr-storage.mjs.map +1 -0
- package/fesm2022/ngwr-switch.mjs +99 -0
- package/fesm2022/ngwr-switch.mjs.map +1 -0
- package/fesm2022/ngwr-table.mjs +218 -207
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +217 -0
- package/fesm2022/ngwr-tabs.mjs.map +1 -0
- package/fesm2022/ngwr-textarea.mjs +106 -120
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +152 -0
- package/fesm2022/ngwr-theme.mjs.map +1 -0
- package/fesm2022/ngwr-tilt-card.mjs +137 -0
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -0
- package/fesm2022/ngwr-timeline.mjs +73 -0
- package/fesm2022/ngwr-timeline.mjs.map +1 -0
- package/fesm2022/ngwr-toast.mjs +446 -0
- package/fesm2022/ngwr-toast.mjs.map +1 -0
- package/fesm2022/ngwr-toolbar.mjs +46 -0
- package/fesm2022/ngwr-toolbar.mjs.map +1 -0
- package/fesm2022/ngwr-tree.mjs +483 -0
- package/fesm2022/ngwr-tree.mjs.map +1 -0
- package/fesm2022/ngwr-typewriter.mjs +229 -0
- package/fesm2022/ngwr-typewriter.mjs.map +1 -0
- package/fesm2022/ngwr-typography.mjs +79 -0
- package/fesm2022/ngwr-typography.mjs.map +1 -0
- package/fesm2022/ngwr-utils.mjs +535 -0
- package/fesm2022/ngwr-utils.mjs.map +1 -0
- package/fesm2022/ngwr-validators.mjs +214 -0
- package/fesm2022/ngwr-validators.mjs.map +1 -0
- package/fesm2022/ngwr-version.mjs +51 -0
- package/fesm2022/ngwr-version.mjs.map +1 -0
- package/fesm2022/ngwr-virtual-scroll.mjs +99 -0
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -0
- package/fesm2022/ngwr-waves.mjs +356 -0
- package/fesm2022/ngwr-waves.mjs.map +1 -0
- package/fesm2022/ngwr-window.mjs +1141 -0
- package/fesm2022/ngwr-window.mjs.map +1 -0
- package/fesm2022/ngwr.mjs +0 -3
- package/fesm2022/ngwr.mjs.map +1 -1
- package/file-upload/styles/_index.scss +152 -0
- package/form/styles/_index.scss +85 -42
- package/gauge/styles/_index.scss +37 -0
- package/glitch-text/glitch-text.scss +1 -0
- package/glitch-text/styles/_index.scss +144 -0
- package/gradient-text/gradient-text.scss +1 -0
- package/gradient-text/styles/_index.scss +113 -0
- package/icon/styles/_index.scss +21 -15
- package/image-cropper/styles/_index.scss +114 -0
- package/input/styles/_index.scss +133 -93
- package/input-number/styles/_index.scss +75 -0
- package/input-otp/styles/_index.scss +53 -0
- package/keyboard/styles/_index.scss +55 -0
- package/knob/styles/_index.scss +54 -0
- package/layout/styles/_index.scss +65 -0
- package/lightbox/lightbox.scss +1 -0
- package/lightbox/styles/_index.scss +144 -0
- package/line-chart/styles/_index.scss +93 -0
- package/list/list.scss +1 -0
- package/list/styles/_index.scss +101 -0
- package/loading-bar/loading-bar.scss +1 -0
- package/loading-bar/styles/_index.scss +29 -0
- package/marquee/marquee.scss +1 -0
- package/marquee/styles/_index.scss +138 -0
- package/mention/styles/_index.scss +47 -0
- package/meter-group/styles/_index.scss +61 -0
- package/package.json +576 -99
- package/page-header/styles/_index.scss +78 -0
- package/pagination/styles/_index.scss +89 -34
- package/popconfirm/styles/_index.scss +32 -0
- package/popover/styles/_index.scss +83 -0
- package/progress/styles/_index.scss +29 -14
- package/qr/styles/_index.scss +6 -3
- package/radio/styles/_index.scss +111 -0
- package/rating/styles/_index.scss +63 -0
- package/result/styles/_index.scss +69 -0
- package/rotating-text/rotating-text.scss +1 -0
- package/rotating-text/styles/_index.scss +39 -0
- package/schematics/collection.json +37 -0
- package/schematics/component-style/index.js +49 -0
- package/{alert/alert-type.d.ts → schematics/component-style/schema.js} +2 -1
- package/schematics/component-style/schema.json +20 -0
- package/schematics/icon-set/index.js +96 -0
- package/{avatar/public-api.d.ts → schematics/icon-set/schema.js} +2 -1
- package/schematics/icon-set/schema.json +39 -0
- package/schematics/migrations/v7/index.js +187 -0
- package/schematics/migrations.json +10 -0
- package/schematics/ng-add/index.js +180 -0
- package/{cdk/public-api.d.ts → schematics/ng-add/schema.js} +2 -1
- package/schematics/ng-add/schema.json +80 -0
- package/schematics/page/index.js +63 -0
- package/{alert/public-api.d.ts → schematics/page/schema.js} +2 -2
- package/schematics/page/schema.json +39 -0
- package/schematics/page/templates.js +198 -0
- package/schematics/provider/index.js +126 -0
- package/schematics/provider/schema.js +8 -0
- package/schematics/provider/schema.json +52 -0
- package/schematics/use/index.js +143 -0
- package/schematics/use/schema.js +8 -0
- package/schematics/use/schema.json +25 -0
- package/schematics/use/symbol-map.json +356 -0
- package/scramble-text/scramble-text.scss +1 -0
- package/scramble-text/styles/_index.scss +8 -0
- package/segmented/styles/_index.scss +92 -0
- package/select/styles/_index.scss +245 -159
- package/shiny-text/shiny-text.scss +1 -0
- package/shiny-text/styles/_index.scss +101 -0
- package/sidebar/styles/_index.scss +208 -0
- package/skeleton/styles/_index.scss +33 -33
- package/slider/styles/_index.scss +77 -0
- package/sparkline/styles/_index.scss +9 -0
- package/speed-dial/styles/_index.scss +158 -0
- package/spinner/styles/_index.scss +38 -22
- package/splash-cursor/splash-cursor.scss +1 -0
- package/splash-cursor/styles/_index.scss +27 -0
- package/split-text/split-text.scss +1 -0
- package/split-text/styles/_index.scss +22 -0
- package/splitter/styles/_index.scss +85 -0
- package/spotlight-card/spotlight-card.scss +1 -0
- package/spotlight-card/styles/_index.scss +43 -0
- package/squircle/styles/_index.scss +34 -0
- package/star-border/star-border.scss +1 -0
- package/star-border/styles/_index.scss +118 -0
- package/statistic/styles/_index.scss +54 -0
- package/stepper/styles/_index.scss +162 -0
- package/styles/_animations.scss +198 -0
- package/styles/_breakpoints.scss +75 -0
- package/styles/_grid.scss +71 -0
- package/styles/_reset.scss +123 -0
- package/styles/_typography.scss +122 -0
- package/styles.scss +102 -13
- package/switch/styles/_index.scss +82 -0
- package/table/styles/_index.scss +255 -4
- package/tabs/styles/_index.scss +71 -0
- package/textarea/styles/_index.scss +47 -56
- package/theme/styles/_colors.scss +83 -0
- package/theme/styles/_dark.scss +85 -0
- package/theme/styles/_focus.scss +93 -0
- package/theme/styles/_index.scss +5 -0
- package/theme/styles/_mixins.scss +57 -0
- package/theme/styles/_variables.scss +118 -0
- package/tilt-card/styles/_index.scss +40 -0
- package/tilt-card/tilt-card.scss +1 -0
- package/timeline/styles/_index.scss +127 -0
- package/toast/styles/_index.scss +263 -0
- package/toolbar/styles/_index.scss +65 -0
- package/tree/styles/_index.scss +271 -0
- package/types/ngwr-affix.d.ts +43 -0
- package/types/ngwr-alert.d.ts +68 -0
- package/types/ngwr-anchor.d.ts +53 -0
- package/types/ngwr-aurora.d.ts +52 -0
- package/types/ngwr-avatar.d.ts +90 -0
- package/types/ngwr-back-top.d.ts +37 -0
- package/types/ngwr-badge.d.ts +158 -0
- package/types/ngwr-bar-chart.d.ts +47 -0
- package/types/ngwr-blur-text.d.ts +62 -0
- package/types/ngwr-border-glow.d.ts +66 -0
- package/types/ngwr-breadcrumbs.d.ts +61 -0
- package/types/ngwr-button.d.ts +176 -0
- package/types/ngwr-calendar-heatmap.d.ts +58 -0
- package/types/ngwr-calendar.d.ts +116 -0
- package/types/ngwr-card.d.ts +50 -0
- package/types/ngwr-carousel.d.ts +57 -0
- package/types/ngwr-cascader.d.ts +107 -0
- package/types/ngwr-checkbox.d.ts +139 -0
- package/types/ngwr-circular-text.d.ts +49 -0
- package/types/ngwr-click-spark.d.ts +52 -0
- package/types/ngwr-clipboard.d.ts +53 -0
- package/types/ngwr-collapse.d.ts +139 -0
- package/types/ngwr-color-picker.d.ts +302 -0
- package/types/ngwr-command-palette.d.ts +113 -0
- package/types/ngwr-compare.d.ts +55 -0
- package/types/ngwr-confetti.d.ts +70 -0
- package/types/ngwr-context-menu.d.ts +207 -0
- package/types/ngwr-cookie.d.ts +60 -0
- package/types/ngwr-counter.d.ts +182 -0
- package/types/ngwr-date-adapter-fns.d.ts +73 -0
- package/types/ngwr-date-adapter-luxon.d.ts +73 -0
- package/types/ngwr-date-adapter.d.ts +198 -0
- package/types/ngwr-date-picker.d.ts +117 -0
- package/types/ngwr-decrypt-text.d.ts +85 -0
- package/types/ngwr-density.d.ts +97 -0
- package/types/ngwr-descriptions.d.ts +41 -0
- package/types/ngwr-dialog.d.ts +210 -0
- package/types/ngwr-directives.d.ts +125 -0
- package/types/ngwr-divider.d.ts +73 -0
- package/types/ngwr-donut-chart.d.ts +53 -0
- package/types/ngwr-drag-drop.d.ts +83 -0
- package/types/ngwr-drawer.d.ts +155 -0
- package/types/ngwr-dropdown.d.ts +124 -0
- package/types/ngwr-empty.d.ts +38 -0
- package/types/ngwr-falling-text.d.ts +63 -0
- package/types/ngwr-file-upload.d.ts +94 -0
- package/types/ngwr-form.d.ts +95 -0
- package/types/ngwr-fuzzy-text.d.ts +74 -0
- package/types/ngwr-gauge.d.ts +39 -0
- package/types/ngwr-glitch-text.d.ts +31 -0
- package/types/ngwr-gradient-text.d.ts +46 -0
- package/types/ngwr-hotkey.d.ts +142 -0
- package/types/ngwr-i18n-en.d.ts +18 -0
- package/types/ngwr-i18n-ru.d.ts +6 -0
- package/types/ngwr-i18n.d.ts +336 -0
- package/types/ngwr-icon-adapters-feather.d.ts +44 -0
- package/types/ngwr-icon-adapters-lucide.d.ts +54 -0
- package/types/ngwr-icon.d.ts +180 -0
- package/types/ngwr-image-cropper.d.ts +110 -0
- package/types/ngwr-input-number.d.ts +77 -0
- package/types/ngwr-input-otp.d.ts +78 -0
- package/types/ngwr-input.d.ts +131 -0
- package/types/ngwr-keyboard.d.ts +34 -0
- package/types/ngwr-knob.d.ts +77 -0
- package/types/ngwr-layout.d.ts +89 -0
- package/types/ngwr-lightbox.d.ts +50 -0
- package/types/ngwr-line-chart.d.ts +90 -0
- package/types/ngwr-list.d.ts +71 -0
- package/types/ngwr-loading-bar.d.ts +79 -0
- package/types/ngwr-marquee.d.ts +95 -0
- package/types/ngwr-media.d.ts +74 -0
- package/types/ngwr-mention.d.ts +110 -0
- package/types/ngwr-meta.d.ts +164 -0
- package/types/ngwr-meter-group.d.ts +57 -0
- package/types/ngwr-overlay.d.ts +110 -0
- package/types/ngwr-page-header.d.ts +35 -0
- package/types/ngwr-pagination.d.ts +119 -0
- package/types/ngwr-pipes.d.ts +177 -0
- package/types/ngwr-platform.d.ts +38 -0
- package/types/ngwr-popconfirm.d.ts +79 -0
- package/types/ngwr-popover.d.ts +90 -0
- package/types/ngwr-progress.d.ts +33 -0
- package/types/ngwr-qr.d.ts +56 -0
- package/types/ngwr-radio.d.ts +120 -0
- package/types/ngwr-rating.d.ts +62 -0
- package/types/ngwr-result.d.ts +64 -0
- package/types/ngwr-rotating-text.d.ts +72 -0
- package/types/ngwr-scramble-text.d.ts +49 -0
- package/types/ngwr-scroll.d.ts +65 -0
- package/types/ngwr-segmented.d.ts +65 -0
- package/types/ngwr-select.d.ts +413 -0
- package/types/ngwr-shiny-text.d.ts +70 -0
- package/types/ngwr-sidebar.d.ts +83 -0
- package/types/ngwr-skeleton.d.ts +41 -0
- package/types/ngwr-slider.d.ts +86 -0
- package/types/ngwr-sparkline.d.ts +48 -0
- package/types/ngwr-speed-dial.d.ts +51 -0
- package/types/ngwr-spinner.d.ts +41 -0
- package/types/ngwr-splash-cursor.d.ts +94 -0
- package/types/ngwr-split-text.d.ts +83 -0
- package/types/ngwr-splitter.d.ts +52 -0
- package/types/ngwr-spotlight-card.d.ts +71 -0
- package/types/ngwr-squircle.d.ts +132 -0
- package/types/ngwr-star-border.d.ts +40 -0
- package/types/ngwr-statistic.d.ts +88 -0
- package/types/ngwr-stepper.d.ts +99 -0
- package/types/ngwr-storage.d.ts +178 -0
- package/types/ngwr-switch.d.ts +39 -0
- package/types/ngwr-table.d.ts +237 -0
- package/types/ngwr-tabs.d.ts +125 -0
- package/types/ngwr-textarea.d.ts +60 -0
- package/types/ngwr-theme.d.ts +124 -0
- package/types/ngwr-tilt-card.d.ts +63 -0
- package/types/ngwr-timeline.d.ts +40 -0
- package/types/ngwr-toast.d.ts +230 -0
- package/types/ngwr-toolbar.d.ts +30 -0
- package/types/ngwr-tree.d.ts +150 -0
- package/types/ngwr-typewriter.d.ts +84 -0
- package/types/ngwr-typography.d.ts +56 -0
- package/types/ngwr-utils.d.ts +447 -0
- package/types/ngwr-validators.d.ts +70 -0
- package/types/ngwr-version.d.ts +44 -0
- package/types/ngwr-virtual-scroll.d.ts +64 -0
- package/types/ngwr-waves.d.ts +71 -0
- package/types/ngwr-window.d.ts +437 -0
- package/types/ngwr.d.ts +2 -0
- package/typewriter/styles/_index.scss +33 -0
- package/typewriter/typewriter.scss +1 -0
- package/typography/styles/_index.scss +211 -0
- package/virtual-scroll/styles/_index.scss +27 -0
- package/virtual-scroll/virtual-scroll.scss +1 -0
- package/waves/styles/_index.scss +24 -0
- package/waves/waves.scss +1 -0
- package/window/styles/_index.scss +430 -0
- package/alert/alert.component.d.ts +0 -21
- package/alert/index.d.ts +0 -5
- package/alert/styles/theming.scss +0 -26
- package/alert/styles/vars.scss +0 -11
- package/avatar/avatar.component.d.ts +0 -27
- package/avatar/index.d.ts +0 -5
- package/button/button-group.component.d.ts +0 -12
- package/button/button.component.d.ts +0 -31
- package/button/index.d.ts +0 -5
- package/button/public-api.d.ts +0 -8
- package/button/styles/vars.scss +0 -13
- package/cdk/base.directive.d.ts +0 -20
- package/cdk/index.d.ts +0 -5
- package/cdk/rxjs/index.d.ts +0 -5
- package/cdk/rxjs/is-array.d.ts +0 -8
- package/cdk/rxjs/is-defined.d.ts +0 -8
- package/cdk/rxjs/is-not-empty-array.d.ts +0 -8
- package/cdk/rxjs/is-observable.d.ts +0 -9
- package/cdk/rxjs/public-api.d.ts +0 -10
- package/cdk/types/index.d.ts +0 -5
- package/cdk/types/maybe.d.ts +0 -7
- package/cdk/types/public-api.d.ts +0 -9
- package/cdk/types/safe-any.d.ts +0 -7
- package/cdk/types/theme-color.d.ts +0 -8
- package/cdk/utils/generate-random-id.d.ts +0 -12
- package/cdk/utils/index.d.ts +0 -5
- package/cdk/utils/public-api.d.ts +0 -7
- package/checkbox/checkbox.component.d.ts +0 -28
- package/checkbox/index.d.ts +0 -5
- package/checkbox/public-api.d.ts +0 -7
- package/checkbox/styles/vars.scss +0 -16
- package/dialog/dialog-animations.d.ts +0 -22
- package/dialog/dialog-base.directive.d.ts +0 -40
- package/dialog/dialog-close.directive.d.ts +0 -9
- package/dialog/dialog-content.directive.d.ts +0 -6
- package/dialog/dialog-data.token.d.ts +0 -8
- package/dialog/dialog-footer.directive.d.ts +0 -8
- package/dialog/dialog-options.d.ts +0 -19
- package/dialog/dialog-ref.d.ts +0 -26
- package/dialog/dialog-title.directive.d.ts +0 -6
- package/dialog/dialog.component.d.ts +0 -28
- package/dialog/dialog.module.d.ts +0 -6
- package/dialog/dialog.service.d.ts +0 -28
- package/dialog/index.d.ts +0 -5
- package/dialog/public-api.d.ts +0 -18
- package/dialog/styles/vars.scss +0 -7
- package/divider/divider.component.d.ts +0 -13
- package/divider/index.d.ts +0 -5
- package/divider/public-api.d.ts +0 -7
- package/dropdown/dropdown-menu-item.component.d.ts +0 -12
- package/dropdown/dropdown-menu.component.d.ts +0 -14
- package/dropdown/dropdown.directive.d.ts +0 -29
- package/dropdown/dropdown.types.d.ts +0 -9
- package/dropdown/index.d.ts +0 -5
- package/dropdown/public-api.d.ts +0 -10
- package/dropdown/styles/vars.scss +0 -18
- package/fesm2022/ngwr-cdk-rxjs.mjs +0 -53
- package/fesm2022/ngwr-cdk-rxjs.mjs.map +0 -1
- package/fesm2022/ngwr-cdk-types.mjs +0 -44
- package/fesm2022/ngwr-cdk-types.mjs.map +0 -1
- package/fesm2022/ngwr-cdk-utils.mjs +0 -30
- package/fesm2022/ngwr-cdk-utils.mjs.map +0 -1
- package/fesm2022/ngwr-cdk.mjs +0 -46
- package/fesm2022/ngwr-cdk.mjs.map +0 -1
- package/fesm2022/ngwr-tag.mjs +0 -87
- package/fesm2022/ngwr-tag.mjs.map +0 -1
- package/form/form-error.component.d.ts +0 -11
- package/form/form-item.component.d.ts +0 -14
- package/form/index.d.ts +0 -5
- package/form/public-api.d.ts +0 -8
- package/icon/icon.component.d.ts +0 -24
- package/icon/icon.service.d.ts +0 -23
- package/icon/icons.d.ts +0 -770
- package/icon/index.d.ts +0 -5
- package/icon/provide-wr-icons.d.ts +0 -9
- package/icon/public-api.d.ts +0 -10
- package/icon/styles/vars.scss +0 -3
- package/index.d.ts +0 -5
- package/input/index.d.ts +0 -5
- package/input/input-types.d.ts +0 -1
- package/input/input.component.d.ts +0 -38
- package/input/public-api.d.ts +0 -8
- package/input/styles/vars.scss +0 -17
- package/pagination/index.d.ts +0 -5
- package/pagination/pagination.component.d.ts +0 -23
- package/pagination/pagination.types.d.ts +0 -7
- package/pagination/public-api.d.ts +0 -8
- package/pagination/styles/vars.scss +0 -14
- package/pipes/index.d.ts +0 -5
- package/pipes/new-array.pipe.d.ts +0 -13
- package/pipes/public-api.d.ts +0 -7
- package/progress/index.d.ts +0 -5
- package/progress/progress.component.d.ts +0 -10
- package/progress/public-api.d.ts +0 -7
- package/progress/styles/theming.scss +0 -8
- package/progress/styles/vars.scss +0 -6
- package/public-api.d.ts +0 -2
- package/qr/generator.d.ts +0 -7
- package/qr/index.d.ts +0 -5
- package/qr/public-api.d.ts +0 -7
- package/qr/qr.component.d.ts +0 -31
- package/qr/qrcodegen.d.ts +0 -94
- package/select/index.d.ts +0 -5
- package/select/public-api.d.ts +0 -10
- package/select/select-option-group.component.d.ts +0 -19
- package/select/select-option.component.d.ts +0 -22
- package/select/select.component.d.ts +0 -63
- package/select/select.types.d.ts +0 -17
- package/select/styles/vars.scss +0 -32
- package/skeleton/index.d.ts +0 -1
- package/skeleton/skeleton.component.d.ts +0 -10
- package/spinner/index.d.ts +0 -1
- package/spinner/spinner.component.d.ts +0 -13
- package/spinner/spinner.types.d.ts +0 -7
- package/styles/animations.scss +0 -92
- package/styles/cdk.scss +0 -5
- package/styles/colors.scss +0 -72
- package/styles/grid.scss +0 -99
- package/styles/maps.scss +0 -31
- package/styles/reset.scss +0 -112
- package/styles/variables.scss +0 -72
- package/table/index.d.ts +0 -5
- package/table/public-api.d.ts +0 -11
- package/table/styles/table-filter.scss +0 -202
- package/table/styles/table-sort.scss +0 -47
- package/table/styles/table.scss +0 -232
- package/table/styles/vars.scss +0 -21
- package/table/table-cell/index.d.ts +0 -7
- package/table/table-cell/table-cell.directive.d.ts +0 -8
- package/table/table-filter/index.d.ts +0 -7
- package/table/table-filter/table-filter.component.d.ts +0 -18
- package/table/table-sort/index.d.ts +0 -7
- package/table/table-sort/table-sort.component.d.ts +0 -8
- package/table/table.component.d.ts +0 -33
- package/table/types/index.d.ts +0 -6
- package/table/types/table-cell-context.d.ts +0 -6
- package/table/types/table-columns.d.ts +0 -7
- package/table/types/table-filter-emit.d.ts +0 -5
- package/table/types/table-filter-item.d.ts +0 -6
- package/table/types/table-order-item.d.ts +0 -5
- package/table/types/table-order.enum.d.ts +0 -5
- package/tag/index.d.ts +0 -5
- package/tag/public-api.d.ts +0 -7
- package/tag/styles/_index.scss +0 -32
- package/tag/styles/theming.scss +0 -21
- package/tag/styles/vars.scss +0 -12
- package/tag/tag.component.d.ts +0 -21
- package/textarea/index.d.ts +0 -7
- package/textarea/public-api.d.ts +0 -7
- package/textarea/styles/vars.scss +0 -17
- package/textarea/textarea.component.d.ts +0 -44
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
|
2
|
+
import { ScrollStrategyOptions } from '@angular/cdk/overlay';
|
|
3
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { input, inject, signal, computed, forwardRef, ViewEncapsulation, Component, output, ElementRef, DestroyRef, viewChild } from '@angular/core';
|
|
6
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
|
+
import * as i1 from '@angular/forms';
|
|
8
|
+
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
9
|
+
import { WrCalendar } from 'ngwr/calendar';
|
|
10
|
+
import { WrDateAdapter, WR_DATE_LOCALE } from 'ngwr/date-adapter';
|
|
11
|
+
import { readI18nText } from 'ngwr/i18n';
|
|
12
|
+
import { WrInput, WrInputGroup, WrInputSuffix } from 'ngwr/input';
|
|
13
|
+
import { WR_OVERLAY } from 'ngwr/overlay';
|
|
14
|
+
import { noop, clamp } from 'ngwr/utils';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @license
|
|
18
|
+
*
|
|
19
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
20
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
21
|
+
*/
|
|
22
|
+
function pad(n) {
|
|
23
|
+
return String(n).padStart(2, '0');
|
|
24
|
+
}
|
|
25
|
+
/** Wraps a value into `[0, modulus)` so steppers cycle nicely. */
|
|
26
|
+
function wrap(v, modulus) {
|
|
27
|
+
return ((v % modulus) + modulus) % modulus;
|
|
28
|
+
}
|
|
29
|
+
/** Detect whether a locale uses 12-hour time by default. */
|
|
30
|
+
function isLocaleHour12(locale) {
|
|
31
|
+
try {
|
|
32
|
+
return new Intl.DateTimeFormat(locale, { hour: 'numeric' }).resolvedOptions().hour12 === true;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Internal time stepper panel rendered by `<wr-date-picker mode="time">`
|
|
40
|
+
* (standalone) and `mode="datetime"` (composed with the calendar). Not part
|
|
41
|
+
* of the public API — use `<wr-date-picker mode="time">` instead.
|
|
42
|
+
*
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
class WrTimePanel {
|
|
46
|
+
/** 12 / 24-hour mode. @default 'auto' (derived from the locale) */
|
|
47
|
+
format = input('auto', /* @ts-ignore */
|
|
48
|
+
...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
|
|
49
|
+
/** Render a third column for seconds. @default false */
|
|
50
|
+
showSeconds = input(false, { ...(ngDevMode ? { debugName: "showSeconds" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
51
|
+
/** Step applied to minutes / seconds steppers. @default 1 */
|
|
52
|
+
step = input(1, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: (v) => Math.max(1, coerceNumberProperty(v, 1)) });
|
|
53
|
+
/** Disable interaction. @default false */
|
|
54
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
55
|
+
/** Read-only — values cannot be changed. @default false */
|
|
56
|
+
readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
57
|
+
adapter = inject(WrDateAdapter);
|
|
58
|
+
locale = inject(WR_DATE_LOCALE);
|
|
59
|
+
/** Source of truth — stores h/m/s in 24-hour form. */
|
|
60
|
+
hours = signal(0, /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "hours" }] : /* istanbul ignore next */ []));
|
|
62
|
+
minutes = signal(0, /* @ts-ignore */
|
|
63
|
+
...(ngDevMode ? [{ debugName: "minutes" }] : /* istanbul ignore next */ []));
|
|
64
|
+
seconds = signal(0, /* @ts-ignore */
|
|
65
|
+
...(ngDevMode ? [{ debugName: "seconds" }] : /* istanbul ignore next */ []));
|
|
66
|
+
/** Date portion preserved across updates (today's date if none was supplied). */
|
|
67
|
+
basis = signal(this.adapter.today(), /* @ts-ignore */
|
|
68
|
+
...(ngDevMode ? [{ debugName: "basis" }] : /* istanbul ignore next */ []));
|
|
69
|
+
disabledFromCva = signal(false, /* @ts-ignore */
|
|
70
|
+
...(ngDevMode ? [{ debugName: "disabledFromCva" }] : /* istanbul ignore next */ []));
|
|
71
|
+
effectiveDisabled = computed(() => this.disabled() || this.disabledFromCva(), /* @ts-ignore */
|
|
72
|
+
...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
73
|
+
interactive = computed(() => !this.effectiveDisabled() && !this.readonly(), /* @ts-ignore */
|
|
74
|
+
...(ngDevMode ? [{ debugName: "interactive" }] : /* istanbul ignore next */ []));
|
|
75
|
+
/** Resolved format — turns 'auto' into '12h' or '24h' based on the locale. */
|
|
76
|
+
is12h = computed(() => {
|
|
77
|
+
const f = this.format();
|
|
78
|
+
if (f === '12h')
|
|
79
|
+
return true;
|
|
80
|
+
if (f === '24h')
|
|
81
|
+
return false;
|
|
82
|
+
return isLocaleHour12(this.locale);
|
|
83
|
+
}, /* @ts-ignore */
|
|
84
|
+
...(ngDevMode ? [{ debugName: "is12h" }] : /* istanbul ignore next */ []));
|
|
85
|
+
/** Hours value shown in the input (1-12 in 12h mode, 0-23 otherwise). */
|
|
86
|
+
displayHours = computed(() => {
|
|
87
|
+
if (!this.is12h())
|
|
88
|
+
return this.hours();
|
|
89
|
+
const h = this.hours() % 12;
|
|
90
|
+
return h === 0 ? 12 : h;
|
|
91
|
+
}, /* @ts-ignore */
|
|
92
|
+
...(ngDevMode ? [{ debugName: "displayHours" }] : /* istanbul ignore next */ []));
|
|
93
|
+
isPm = computed(() => this.hours() >= 12, /* @ts-ignore */
|
|
94
|
+
...(ngDevMode ? [{ debugName: "isPm" }] : /* istanbul ignore next */ []));
|
|
95
|
+
amPmLabel = computed(() => (this.isPm() ? 'PM' : 'AM'), /* @ts-ignore */
|
|
96
|
+
...(ngDevMode ? [{ debugName: "amPmLabel" }] : /* istanbul ignore next */ []));
|
|
97
|
+
hoursDisplay = computed(() => pad(this.displayHours()), /* @ts-ignore */
|
|
98
|
+
...(ngDevMode ? [{ debugName: "hoursDisplay" }] : /* istanbul ignore next */ []));
|
|
99
|
+
minutesDisplay = computed(() => pad(this.minutes()), /* @ts-ignore */
|
|
100
|
+
...(ngDevMode ? [{ debugName: "minutesDisplay" }] : /* istanbul ignore next */ []));
|
|
101
|
+
secondsDisplay = computed(() => pad(this.seconds()), /* @ts-ignore */
|
|
102
|
+
...(ngDevMode ? [{ debugName: "secondsDisplay" }] : /* istanbul ignore next */ []));
|
|
103
|
+
classes = computed(() => {
|
|
104
|
+
const parts = ['wr-time-picker'];
|
|
105
|
+
if (this.is12h())
|
|
106
|
+
parts.push('wr-time-picker--12h');
|
|
107
|
+
if (this.showSeconds())
|
|
108
|
+
parts.push('wr-time-picker--with-seconds');
|
|
109
|
+
if (this.effectiveDisabled())
|
|
110
|
+
parts.push('wr-time-picker--disabled');
|
|
111
|
+
return parts.join(' ');
|
|
112
|
+
}, /* @ts-ignore */
|
|
113
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
114
|
+
// ControlValueAccessor
|
|
115
|
+
onChange = noop;
|
|
116
|
+
onTouched = noop;
|
|
117
|
+
writeValue(value) {
|
|
118
|
+
if (value && this.adapter.isValid(value)) {
|
|
119
|
+
this.basis.set(this.adapter.clone(value));
|
|
120
|
+
this.hours.set(this.adapter.getHours(value));
|
|
121
|
+
this.minutes.set(this.adapter.getMinutes(value));
|
|
122
|
+
this.seconds.set(this.adapter.getSeconds(value));
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
this.basis.set(this.adapter.today());
|
|
126
|
+
this.hours.set(0);
|
|
127
|
+
this.minutes.set(0);
|
|
128
|
+
this.seconds.set(0);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
registerOnChange(fn) {
|
|
132
|
+
this.onChange = fn;
|
|
133
|
+
}
|
|
134
|
+
registerOnTouched(fn) {
|
|
135
|
+
this.onTouched = fn;
|
|
136
|
+
}
|
|
137
|
+
setDisabledState(isDisabled) {
|
|
138
|
+
this.disabledFromCva.set(coerceBooleanProperty(isDisabled));
|
|
139
|
+
}
|
|
140
|
+
// Typed-input handlers
|
|
141
|
+
onHoursInput(event) {
|
|
142
|
+
const n = Number(event.target.value);
|
|
143
|
+
if (Number.isNaN(n))
|
|
144
|
+
return;
|
|
145
|
+
if (this.is12h()) {
|
|
146
|
+
const h12 = clamp(Math.trunc(n), 1, 12) % 12;
|
|
147
|
+
this.hours.set(this.isPm() ? h12 + 12 : h12);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
this.hours.set(clamp(Math.trunc(n), 0, 23));
|
|
151
|
+
}
|
|
152
|
+
this.emit();
|
|
153
|
+
}
|
|
154
|
+
onMinutesInput(event) {
|
|
155
|
+
const n = Number(event.target.value);
|
|
156
|
+
if (Number.isNaN(n))
|
|
157
|
+
return;
|
|
158
|
+
this.minutes.set(clamp(Math.trunc(n), 0, 59));
|
|
159
|
+
this.emit();
|
|
160
|
+
}
|
|
161
|
+
onSecondsInput(event) {
|
|
162
|
+
const n = Number(event.target.value);
|
|
163
|
+
if (Number.isNaN(n))
|
|
164
|
+
return;
|
|
165
|
+
this.seconds.set(clamp(Math.trunc(n), 0, 59));
|
|
166
|
+
this.emit();
|
|
167
|
+
}
|
|
168
|
+
onBlur() {
|
|
169
|
+
this.onTouched();
|
|
170
|
+
}
|
|
171
|
+
// Stepper handlers (▲ / ▼ buttons)
|
|
172
|
+
stepHours(direction) {
|
|
173
|
+
if (!this.interactive())
|
|
174
|
+
return;
|
|
175
|
+
this.hours.set(wrap(this.hours() + direction, 24));
|
|
176
|
+
this.emit();
|
|
177
|
+
}
|
|
178
|
+
stepMinutes(direction) {
|
|
179
|
+
if (!this.interactive())
|
|
180
|
+
return;
|
|
181
|
+
this.minutes.set(wrap(this.minutes() + direction * this.step(), 60));
|
|
182
|
+
this.emit();
|
|
183
|
+
}
|
|
184
|
+
stepSeconds(direction) {
|
|
185
|
+
if (!this.interactive())
|
|
186
|
+
return;
|
|
187
|
+
this.seconds.set(wrap(this.seconds() + direction * this.step(), 60));
|
|
188
|
+
this.emit();
|
|
189
|
+
}
|
|
190
|
+
toggleAmPm() {
|
|
191
|
+
if (!this.interactive())
|
|
192
|
+
return;
|
|
193
|
+
// ±12 hours flips AM ↔ PM; wrap handles overflow.
|
|
194
|
+
this.hours.set(wrap(this.hours() + 12, 24));
|
|
195
|
+
this.emit();
|
|
196
|
+
}
|
|
197
|
+
// Emission
|
|
198
|
+
emit() {
|
|
199
|
+
const next = this.adapter.setTime(this.basis(), this.hours(), this.minutes(), this.seconds());
|
|
200
|
+
this.onChange(next);
|
|
201
|
+
}
|
|
202
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrTimePanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
203
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: WrTimePanel, isStandalone: true, selector: "wr-time-picker", inputs: { format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, providers: [
|
|
204
|
+
{
|
|
205
|
+
provide: NG_VALUE_ACCESSOR,
|
|
206
|
+
// eslint-disable-next-line @angular-eslint/no-forward-ref
|
|
207
|
+
useExisting: forwardRef(() => WrTimePanel),
|
|
208
|
+
multi: true,
|
|
209
|
+
},
|
|
210
|
+
], ngImport: i0, template: "<div class=\"wr-time-picker__col\">\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--up\"\n aria-label=\"Increment hours\"\n [disabled]=\"!interactive()\"\n (click)=\"stepHours(1)\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m18 15-6-6-6 6\" />\n </svg>\n </button>\n <input\n class=\"wr-time-picker__input\"\n type=\"text\"\n inputmode=\"numeric\"\n aria-label=\"Hours\"\n [value]=\"hoursDisplay()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onHoursInput($event)\"\n (blur)=\"onBlur()\"\n />\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--down\"\n aria-label=\"Decrement hours\"\n [disabled]=\"!interactive()\"\n (click)=\"stepHours(-1)\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n</div>\n\n<span class=\"wr-time-picker__sep\" aria-hidden=\"true\">:</span>\n\n<div class=\"wr-time-picker__col\">\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--up\"\n aria-label=\"Increment minutes\"\n [disabled]=\"!interactive()\"\n (click)=\"stepMinutes(1)\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m18 15-6-6-6 6\" />\n </svg>\n </button>\n <input\n class=\"wr-time-picker__input\"\n type=\"text\"\n inputmode=\"numeric\"\n aria-label=\"Minutes\"\n [value]=\"minutesDisplay()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onMinutesInput($event)\"\n (blur)=\"onBlur()\"\n />\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--down\"\n aria-label=\"Decrement minutes\"\n [disabled]=\"!interactive()\"\n (click)=\"stepMinutes(-1)\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n</div>\n\n@if (showSeconds()) {\n <span class=\"wr-time-picker__sep\" aria-hidden=\"true\">:</span>\n\n <div class=\"wr-time-picker__col\">\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--up\"\n aria-label=\"Increment seconds\"\n [disabled]=\"!interactive()\"\n (click)=\"stepSeconds(1)\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m18 15-6-6-6 6\" />\n </svg>\n </button>\n <input\n class=\"wr-time-picker__input\"\n type=\"text\"\n inputmode=\"numeric\"\n aria-label=\"Seconds\"\n [value]=\"secondsDisplay()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onSecondsInput($event)\"\n (blur)=\"onBlur()\"\n />\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--down\"\n aria-label=\"Decrement seconds\"\n [disabled]=\"!interactive()\"\n (click)=\"stepSeconds(-1)\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n </div>\n}\n\n@if (is12h()) {\n <div class=\"wr-time-picker__col wr-time-picker__col--ampm\">\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--up\"\n aria-label=\"Toggle AM / PM\"\n [disabled]=\"!interactive()\"\n (click)=\"toggleAmPm()\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m18 15-6-6-6 6\" />\n </svg>\n </button>\n <span class=\"wr-time-picker__label\" aria-live=\"polite\">{{ amPmLabel() }}</span>\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--down\"\n aria-label=\"Toggle AM / PM\"\n [disabled]=\"!interactive()\"\n (click)=\"toggleAmPm()\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n </div>\n}\n", encapsulation: i0.ViewEncapsulation.None });
|
|
211
|
+
}
|
|
212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrTimePanel, decorators: [{
|
|
213
|
+
type: Component,
|
|
214
|
+
args: [{ selector: 'wr-time-picker', encapsulation: ViewEncapsulation.None, host: { '[class]': 'classes()' }, providers: [
|
|
215
|
+
{
|
|
216
|
+
provide: NG_VALUE_ACCESSOR,
|
|
217
|
+
// eslint-disable-next-line @angular-eslint/no-forward-ref
|
|
218
|
+
useExisting: forwardRef(() => WrTimePanel),
|
|
219
|
+
multi: true,
|
|
220
|
+
},
|
|
221
|
+
], template: "<div class=\"wr-time-picker__col\">\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--up\"\n aria-label=\"Increment hours\"\n [disabled]=\"!interactive()\"\n (click)=\"stepHours(1)\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m18 15-6-6-6 6\" />\n </svg>\n </button>\n <input\n class=\"wr-time-picker__input\"\n type=\"text\"\n inputmode=\"numeric\"\n aria-label=\"Hours\"\n [value]=\"hoursDisplay()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onHoursInput($event)\"\n (blur)=\"onBlur()\"\n />\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--down\"\n aria-label=\"Decrement hours\"\n [disabled]=\"!interactive()\"\n (click)=\"stepHours(-1)\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n</div>\n\n<span class=\"wr-time-picker__sep\" aria-hidden=\"true\">:</span>\n\n<div class=\"wr-time-picker__col\">\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--up\"\n aria-label=\"Increment minutes\"\n [disabled]=\"!interactive()\"\n (click)=\"stepMinutes(1)\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m18 15-6-6-6 6\" />\n </svg>\n </button>\n <input\n class=\"wr-time-picker__input\"\n type=\"text\"\n inputmode=\"numeric\"\n aria-label=\"Minutes\"\n [value]=\"minutesDisplay()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onMinutesInput($event)\"\n (blur)=\"onBlur()\"\n />\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--down\"\n aria-label=\"Decrement minutes\"\n [disabled]=\"!interactive()\"\n (click)=\"stepMinutes(-1)\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n</div>\n\n@if (showSeconds()) {\n <span class=\"wr-time-picker__sep\" aria-hidden=\"true\">:</span>\n\n <div class=\"wr-time-picker__col\">\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--up\"\n aria-label=\"Increment seconds\"\n [disabled]=\"!interactive()\"\n (click)=\"stepSeconds(1)\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m18 15-6-6-6 6\" />\n </svg>\n </button>\n <input\n class=\"wr-time-picker__input\"\n type=\"text\"\n inputmode=\"numeric\"\n aria-label=\"Seconds\"\n [value]=\"secondsDisplay()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (input)=\"onSecondsInput($event)\"\n (blur)=\"onBlur()\"\n />\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--down\"\n aria-label=\"Decrement seconds\"\n [disabled]=\"!interactive()\"\n (click)=\"stepSeconds(-1)\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n </div>\n}\n\n@if (is12h()) {\n <div class=\"wr-time-picker__col wr-time-picker__col--ampm\">\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--up\"\n aria-label=\"Toggle AM / PM\"\n [disabled]=\"!interactive()\"\n (click)=\"toggleAmPm()\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m18 15-6-6-6 6\" />\n </svg>\n </button>\n <span class=\"wr-time-picker__label\" aria-live=\"polite\">{{ amPmLabel() }}</span>\n <button\n type=\"button\"\n class=\"wr-time-picker__step wr-time-picker__step--down\"\n aria-label=\"Toggle AM / PM\"\n [disabled]=\"!interactive()\"\n (click)=\"toggleAmPm()\"\n >\n <svg\n class=\"wr-time-picker__chevron\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </button>\n </div>\n}\n" }]
|
|
222
|
+
}], propDecorators: { format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }] } });
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* @license
|
|
226
|
+
*
|
|
227
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
228
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
229
|
+
*/
|
|
230
|
+
/**
|
|
231
|
+
* Internal panel that stacks a `<wr-calendar>` and a `<wr-time-picker>`,
|
|
232
|
+
* combining their selections into a single `Date`. Owned by
|
|
233
|
+
* `<wr-date-picker mode="datetime">` — not part of the public API.
|
|
234
|
+
*
|
|
235
|
+
* @internal
|
|
236
|
+
*/
|
|
237
|
+
class WrDateTimePanel {
|
|
238
|
+
value = input(null, /* @ts-ignore */
|
|
239
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
240
|
+
min = input(null, /* @ts-ignore */
|
|
241
|
+
...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
242
|
+
max = input(null, /* @ts-ignore */
|
|
243
|
+
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
244
|
+
dateFilter = input(null, /* @ts-ignore */
|
|
245
|
+
...(ngDevMode ? [{ debugName: "dateFilter" }] : /* istanbul ignore next */ []));
|
|
246
|
+
timeFormat = input('auto', /* @ts-ignore */
|
|
247
|
+
...(ngDevMode ? [{ debugName: "timeFormat" }] : /* istanbul ignore next */ []));
|
|
248
|
+
showSeconds = input(false, /* @ts-ignore */
|
|
249
|
+
...(ngDevMode ? [{ debugName: "showSeconds" }] : /* istanbul ignore next */ []));
|
|
250
|
+
step = input(1, /* @ts-ignore */
|
|
251
|
+
...(ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []));
|
|
252
|
+
changed = output();
|
|
253
|
+
adapter = inject(WrDateAdapter);
|
|
254
|
+
/** Date portion used by the calendar — falls back to today when value is null. */
|
|
255
|
+
calendarValue = computed(() => this.value() ?? this.adapter.today(), /* @ts-ignore */
|
|
256
|
+
...(ngDevMode ? [{ debugName: "calendarValue" }] : /* istanbul ignore next */ []));
|
|
257
|
+
/** Value passed to the time picker — falls back to today (00:00) when null. */
|
|
258
|
+
timeValue = computed(() => this.value() ?? this.adapter.today(), /* @ts-ignore */
|
|
259
|
+
...(ngDevMode ? [{ debugName: "timeValue" }] : /* istanbul ignore next */ []));
|
|
260
|
+
onCalendarSelect(date) {
|
|
261
|
+
if (!date)
|
|
262
|
+
return;
|
|
263
|
+
const base = this.value() ?? this.adapter.today();
|
|
264
|
+
const combined = this.adapter.setTime(this.adapter.createDate(this.adapter.getYear(date), this.adapter.getMonth(date), this.adapter.getDate(date)), this.adapter.getHours(base), this.adapter.getMinutes(base), this.adapter.getSeconds(base));
|
|
265
|
+
this.changed.emit(combined);
|
|
266
|
+
}
|
|
267
|
+
onTimeChange(time) {
|
|
268
|
+
if (!time)
|
|
269
|
+
return;
|
|
270
|
+
const base = this.value() ?? this.adapter.today();
|
|
271
|
+
const combined = this.adapter.setTime(this.adapter.createDate(this.adapter.getYear(base), this.adapter.getMonth(base), this.adapter.getDate(base)), this.adapter.getHours(time), this.adapter.getMinutes(time), this.adapter.getSeconds(time));
|
|
272
|
+
this.changed.emit(combined);
|
|
273
|
+
}
|
|
274
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrDateTimePanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
275
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.1", type: WrDateTimePanel, isStandalone: true, selector: "wr-date-time-panel", inputs: { value: { classPropertyName: "value", publicName: "value", 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 }, dateFilter: { classPropertyName: "dateFilter", publicName: "dateFilter", isSignal: true, isRequired: false, transformFunction: null }, timeFormat: { classPropertyName: "timeFormat", publicName: "timeFormat", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { changed: "changed" }, host: { classAttribute: "wr-date-time-panel" }, ngImport: i0, template: "<wr-calendar\n [date]=\"calendarValue()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [dateFilter]=\"dateFilter()\"\n (dateChange)=\"onCalendarSelect($event)\"\n/>\n\n<div class=\"wr-date-time-panel__time\">\n <wr-time-picker\n [ngModel]=\"timeValue()\"\n [format]=\"timeFormat()\"\n [showSeconds]=\"showSeconds()\"\n [step]=\"step()\"\n (ngModelChange)=\"onTimeChange($event)\"\n />\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: WrCalendar, selector: "wr-calendar", inputs: ["mode", "date", "range", "min", "max", "dateFilter", "disabled"], outputs: ["dateChange", "rangeChange"] }, { kind: "component", type: WrTimePanel, selector: "wr-time-picker", inputs: ["format", "showSeconds", "step", "disabled", "readonly"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
276
|
+
}
|
|
277
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrDateTimePanel, decorators: [{
|
|
278
|
+
type: Component,
|
|
279
|
+
args: [{ selector: 'wr-date-time-panel', encapsulation: ViewEncapsulation.None, host: { class: 'wr-date-time-panel' }, imports: [FormsModule, WrCalendar, WrTimePanel], template: "<wr-calendar\n [date]=\"calendarValue()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [dateFilter]=\"dateFilter()\"\n (dateChange)=\"onCalendarSelect($event)\"\n/>\n\n<div class=\"wr-date-time-panel__time\">\n <wr-time-picker\n [ngModel]=\"timeValue()\"\n [format]=\"timeFormat()\"\n [showSeconds]=\"showSeconds()\"\n [step]=\"step()\"\n (ngModelChange)=\"onTimeChange($event)\"\n />\n</div>\n" }]
|
|
280
|
+
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], dateFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateFilter", required: false }] }], timeFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "timeFormat", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], changed: [{ type: i0.Output, args: ["changed"] }] } });
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* @license
|
|
284
|
+
*
|
|
285
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
286
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
287
|
+
*/
|
|
288
|
+
/**
|
|
289
|
+
* Unified date / time / date-time picker. Same `<input>` + popover skeleton
|
|
290
|
+
* for every mode — the overlay content swaps based on `[mode]`:
|
|
291
|
+
*
|
|
292
|
+
* - `'date'` (default) — popover renders a calendar. Picking a date closes
|
|
293
|
+
* the overlay.
|
|
294
|
+
* - `'time'` — popover renders an `HH:MM[:SS]` stepper with optional AM/PM.
|
|
295
|
+
* Stays open while editing; close with outside-click or Escape.
|
|
296
|
+
* - `'datetime'` — popover stacks calendar + time stepper. Picking a date
|
|
297
|
+
* does NOT close (the user typically wants to set the time next).
|
|
298
|
+
*
|
|
299
|
+
* Implements `ControlValueAccessor` — bind via `[(ngModel)]`, `[formControl]`,
|
|
300
|
+
* or `formControlName`. Value type is `Date | null` for every mode.
|
|
301
|
+
*
|
|
302
|
+
* Parses the input on every keystroke (silently — only emits when valid) and
|
|
303
|
+
* re-formats canonical on blur. Format is driven by {@link WrDateAdapter}: it
|
|
304
|
+
* accepts both named keys (`'shortDate'`, `'mediumDateTime'`, …) and raw
|
|
305
|
+
* token strings (`'dd.MM.yyyy'`, `'HH:mm'`). When `format` is left at the
|
|
306
|
+
* default (`null`), the picker derives the right named key from `mode`:
|
|
307
|
+
* `'date'` → `'shortDate'`, `'time'` → `'shortTime'`, `'datetime'` →
|
|
308
|
+
* `'shortDateTime'`.
|
|
309
|
+
*
|
|
310
|
+
* @example
|
|
311
|
+
* ```html
|
|
312
|
+
* <!-- Date only -->
|
|
313
|
+
* <wr-date-picker [(ngModel)]="picked" format="dd.MM.yyyy" [min]="minDate" />
|
|
314
|
+
*
|
|
315
|
+
* <!-- Time only -->
|
|
316
|
+
* <wr-date-picker mode="time" [(ngModel)]="picked" timeFormat="24h" />
|
|
317
|
+
*
|
|
318
|
+
* <!-- Date + time -->
|
|
319
|
+
* <wr-date-picker mode="datetime" [(ngModel)]="when" [showSeconds]="true" [step]="5" />
|
|
320
|
+
* ```
|
|
321
|
+
*
|
|
322
|
+
* @see https://ngwr.dev/components/date-picker
|
|
323
|
+
*/
|
|
324
|
+
class WrDatePicker {
|
|
325
|
+
/** Picker behavior — see class doc. @default 'date' */
|
|
326
|
+
mode = input('date', /* @ts-ignore */
|
|
327
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
328
|
+
/**
|
|
329
|
+
* Format used for both display and parsing. When `null` (default), the
|
|
330
|
+
* format is derived from `mode` (`shortDate` / `shortTime` /
|
|
331
|
+
* `shortDateTime`). Pass a named key or raw token string to override.
|
|
332
|
+
*/
|
|
333
|
+
format = input(null, /* @ts-ignore */
|
|
334
|
+
...(ngDevMode ? [{ debugName: "format" }] : /* istanbul ignore next */ []));
|
|
335
|
+
/** Placeholder shown when the input is empty. */
|
|
336
|
+
placeholder = input('', /* @ts-ignore */
|
|
337
|
+
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
338
|
+
/** Min selectable date (forwarded to the calendar). Ignored in `time` mode. */
|
|
339
|
+
min = input(null, /* @ts-ignore */
|
|
340
|
+
...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
341
|
+
/** Max selectable date (forwarded to the calendar). Ignored in `time` mode. */
|
|
342
|
+
max = input(null, /* @ts-ignore */
|
|
343
|
+
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
344
|
+
/** Predicate to disable specific dates (forwarded to the calendar). Ignored in `time` mode. */
|
|
345
|
+
dateFilter = input(null, /* @ts-ignore */
|
|
346
|
+
...(ngDevMode ? [{ debugName: "dateFilter" }] : /* istanbul ignore next */ []));
|
|
347
|
+
/** Time-panel 12 / 24-hour format. Applies in `time` + `datetime` modes. @default 'auto' */
|
|
348
|
+
timeFormat = input('auto', /* @ts-ignore */
|
|
349
|
+
...(ngDevMode ? [{ debugName: "timeFormat" }] : /* istanbul ignore next */ []));
|
|
350
|
+
/** Render the seconds column. Applies in `time` + `datetime` modes. @default false */
|
|
351
|
+
showSeconds = input(false, { ...(ngDevMode ? { debugName: "showSeconds" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
352
|
+
/** Minute / second step for the time panel. @default 1 */
|
|
353
|
+
step = input(1, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: (v) => Math.max(1, coerceNumberProperty(v, 1)) });
|
|
354
|
+
/** Disable interaction. @default false */
|
|
355
|
+
disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
356
|
+
/** Read-only — input not typeable, but the trigger icon still opens the overlay. @default false */
|
|
357
|
+
readonly = input(false, { ...(ngDevMode ? { debugName: "readonly" } : /* istanbul ignore next */ {}), transform: coerceBooleanProperty });
|
|
358
|
+
adapter = inject(WrDateAdapter);
|
|
359
|
+
overlay = inject(WR_OVERLAY);
|
|
360
|
+
scrollStrategies = inject(ScrollStrategyOptions);
|
|
361
|
+
host = inject(ElementRef);
|
|
362
|
+
destroyRef = inject(DestroyRef);
|
|
363
|
+
inputEl = viewChild.required('input');
|
|
364
|
+
/** The picked Date. Mirrored from the CVA. */
|
|
365
|
+
value = signal(null, /* @ts-ignore */
|
|
366
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
367
|
+
/** Text currently in the input (may be partial / invalid mid-type). */
|
|
368
|
+
text = signal('', /* @ts-ignore */
|
|
369
|
+
...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
|
|
370
|
+
disabledFromCva = signal(false, /* @ts-ignore */
|
|
371
|
+
...(ngDevMode ? [{ debugName: "disabledFromCva" }] : /* istanbul ignore next */ []));
|
|
372
|
+
effectiveDisabled = computed(() => this.disabled() || this.disabledFromCva(), /* @ts-ignore */
|
|
373
|
+
...(ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []));
|
|
374
|
+
/** Whether the popover is currently open. */
|
|
375
|
+
overlayOpen = signal(false, /* @ts-ignore */
|
|
376
|
+
...(ngDevMode ? [{ debugName: "overlayOpen" }] : /* istanbul ignore next */ []));
|
|
377
|
+
/** Resolved format — falls back to a mode-appropriate default. */
|
|
378
|
+
resolvedFormat = computed(() => {
|
|
379
|
+
const explicit = this.format();
|
|
380
|
+
if (explicit)
|
|
381
|
+
return explicit;
|
|
382
|
+
const m = this.mode();
|
|
383
|
+
if (m === 'datetime')
|
|
384
|
+
return 'shortDateTime';
|
|
385
|
+
if (m === 'time')
|
|
386
|
+
return 'shortTime';
|
|
387
|
+
return 'shortDate';
|
|
388
|
+
}, /* @ts-ignore */
|
|
389
|
+
...(ngDevMode ? [{ debugName: "resolvedFormat" }] : /* istanbul ignore next */ []));
|
|
390
|
+
isTime = computed(() => this.mode() === 'time', /* @ts-ignore */
|
|
391
|
+
...(ngDevMode ? [{ debugName: "isTime" }] : /* istanbul ignore next */ []));
|
|
392
|
+
isDateTime = computed(() => this.mode() === 'datetime', /* @ts-ignore */
|
|
393
|
+
...(ngDevMode ? [{ debugName: "isDateTime" }] : /* istanbul ignore next */ []));
|
|
394
|
+
// Resolved at injection time — i18n catalog reads pick up live locale
|
|
395
|
+
// changes via re-render of the host attribute binding.
|
|
396
|
+
labelDate = readI18nText('datePicker.open', 'Open calendar');
|
|
397
|
+
labelTime = readI18nText('datePicker.openTime', 'Open time picker');
|
|
398
|
+
labelDateTime = readI18nText('datePicker.openDateTime', 'Open date and time picker');
|
|
399
|
+
triggerLabel = computed(() => {
|
|
400
|
+
const m = this.mode();
|
|
401
|
+
if (m === 'time')
|
|
402
|
+
return this.labelTime;
|
|
403
|
+
if (m === 'datetime')
|
|
404
|
+
return this.labelDateTime;
|
|
405
|
+
return this.labelDate;
|
|
406
|
+
}, /* @ts-ignore */
|
|
407
|
+
...(ngDevMode ? [{ debugName: "triggerLabel" }] : /* istanbul ignore next */ []));
|
|
408
|
+
classes = computed(() => {
|
|
409
|
+
const parts = ['wr-date-picker', `wr-date-picker--${this.mode()}`];
|
|
410
|
+
if (this.effectiveDisabled())
|
|
411
|
+
parts.push('wr-date-picker--disabled');
|
|
412
|
+
return parts.join(' ');
|
|
413
|
+
}, /* @ts-ignore */
|
|
414
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
415
|
+
overlayRef = null;
|
|
416
|
+
constructor() {
|
|
417
|
+
this.destroyRef.onDestroy(() => this.dispose());
|
|
418
|
+
}
|
|
419
|
+
// ControlValueAccessor
|
|
420
|
+
onChange = noop;
|
|
421
|
+
onTouched = noop;
|
|
422
|
+
writeValue(value) {
|
|
423
|
+
this.value.set(value);
|
|
424
|
+
this.text.set(value && this.adapter.isValid(value) ? this.adapter.format(value, this.resolvedFormat()) : '');
|
|
425
|
+
}
|
|
426
|
+
registerOnChange(fn) {
|
|
427
|
+
this.onChange = fn;
|
|
428
|
+
}
|
|
429
|
+
registerOnTouched(fn) {
|
|
430
|
+
this.onTouched = fn;
|
|
431
|
+
}
|
|
432
|
+
setDisabledState(isDisabled) {
|
|
433
|
+
this.disabledFromCva.set(coerceBooleanProperty(isDisabled));
|
|
434
|
+
}
|
|
435
|
+
// Template handlers
|
|
436
|
+
onInput(event) {
|
|
437
|
+
const raw = event.target.value;
|
|
438
|
+
this.text.set(raw);
|
|
439
|
+
if (!raw) {
|
|
440
|
+
this.value.set(null);
|
|
441
|
+
this.onChange(null);
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
const parsed = this.adapter.parse(raw, this.resolvedFormat());
|
|
445
|
+
if (parsed && this.adapter.isValid(parsed) && !this.isOutOfBounds(parsed)) {
|
|
446
|
+
this.value.set(parsed);
|
|
447
|
+
this.onChange(parsed);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
onBlur() {
|
|
451
|
+
this.onTouched();
|
|
452
|
+
// Reformat to canonical on blur (cleans up `1/5/25` → `1/5/2025`).
|
|
453
|
+
const v = this.value();
|
|
454
|
+
if (v && this.adapter.isValid(v)) {
|
|
455
|
+
this.text.set(this.adapter.format(v, this.resolvedFormat()));
|
|
456
|
+
}
|
|
457
|
+
else if (!this.text()) {
|
|
458
|
+
this.value.set(null);
|
|
459
|
+
this.onChange(null);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
/** Called by the input's click — opens the overlay if it isn't open already. */
|
|
463
|
+
openOnInput() {
|
|
464
|
+
if (this.effectiveDisabled() || this.overlayRef)
|
|
465
|
+
return;
|
|
466
|
+
this.openOverlay();
|
|
467
|
+
}
|
|
468
|
+
toggleOverlay() {
|
|
469
|
+
if (this.effectiveDisabled())
|
|
470
|
+
return;
|
|
471
|
+
if (this.overlayRef) {
|
|
472
|
+
this.closeOverlay();
|
|
473
|
+
}
|
|
474
|
+
else {
|
|
475
|
+
this.openOverlay();
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
// Overlay
|
|
479
|
+
openOverlay() {
|
|
480
|
+
if (this.overlayRef)
|
|
481
|
+
return;
|
|
482
|
+
const positionStrategy = this.overlay
|
|
483
|
+
.position()
|
|
484
|
+
.flexibleConnectedTo(this.host)
|
|
485
|
+
.withPositions([
|
|
486
|
+
{ originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },
|
|
487
|
+
{ originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },
|
|
488
|
+
{ originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },
|
|
489
|
+
{ originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },
|
|
490
|
+
])
|
|
491
|
+
.withPush(true);
|
|
492
|
+
this.overlayRef = this.overlay.create({
|
|
493
|
+
positionStrategy,
|
|
494
|
+
scrollStrategy: this.scrollStrategies.reposition(),
|
|
495
|
+
panelClass: 'wr-date-picker-overlay',
|
|
496
|
+
});
|
|
497
|
+
this.overlayOpen.set(true);
|
|
498
|
+
// Dispatch by mode — pick the panel + wire its emissions.
|
|
499
|
+
const m = this.mode();
|
|
500
|
+
if (m === 'time')
|
|
501
|
+
this.attachTime();
|
|
502
|
+
else if (m === 'datetime')
|
|
503
|
+
this.attachDateTime();
|
|
504
|
+
else
|
|
505
|
+
this.attachDate();
|
|
506
|
+
this.overlayRef
|
|
507
|
+
.outsidePointerEvents()
|
|
508
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
509
|
+
.subscribe(event => {
|
|
510
|
+
if (this.host.nativeElement.contains(event.target))
|
|
511
|
+
return;
|
|
512
|
+
this.closeOverlay();
|
|
513
|
+
});
|
|
514
|
+
this.overlayRef
|
|
515
|
+
.keydownEvents()
|
|
516
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
517
|
+
.subscribe(event => {
|
|
518
|
+
if (event.key === 'Escape') {
|
|
519
|
+
event.preventDefault();
|
|
520
|
+
this.closeOverlay();
|
|
521
|
+
this.inputEl().nativeElement.focus();
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
attachDate() {
|
|
526
|
+
if (!this.overlayRef)
|
|
527
|
+
return;
|
|
528
|
+
const ref = this.overlayRef.attach(new ComponentPortal(WrCalendar));
|
|
529
|
+
ref.setInput('date', this.value());
|
|
530
|
+
ref.setInput('min', this.min());
|
|
531
|
+
ref.setInput('max', this.max());
|
|
532
|
+
ref.setInput('dateFilter', this.dateFilter());
|
|
533
|
+
ref.instance.date.subscribe(next => {
|
|
534
|
+
if (!next)
|
|
535
|
+
return;
|
|
536
|
+
this.commit(next);
|
|
537
|
+
this.closeOverlay();
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
attachTime() {
|
|
541
|
+
if (!this.overlayRef)
|
|
542
|
+
return;
|
|
543
|
+
const ref = this.overlayRef.attach(new ComponentPortal(WrTimePanel));
|
|
544
|
+
ref.setInput('format', this.timeFormat());
|
|
545
|
+
ref.setInput('showSeconds', this.showSeconds());
|
|
546
|
+
ref.setInput('step', this.step());
|
|
547
|
+
ref.instance.writeValue(this.value() ?? this.adapter.today());
|
|
548
|
+
ref.instance.registerOnChange((next) => {
|
|
549
|
+
if (!next)
|
|
550
|
+
return;
|
|
551
|
+
this.commit(next);
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
attachDateTime() {
|
|
555
|
+
if (!this.overlayRef)
|
|
556
|
+
return;
|
|
557
|
+
const ref = this.overlayRef.attach(new ComponentPortal(WrDateTimePanel));
|
|
558
|
+
ref.setInput('value', this.value());
|
|
559
|
+
ref.setInput('min', this.min());
|
|
560
|
+
ref.setInput('max', this.max());
|
|
561
|
+
ref.setInput('dateFilter', this.dateFilter());
|
|
562
|
+
ref.setInput('timeFormat', this.timeFormat());
|
|
563
|
+
ref.setInput('showSeconds', this.showSeconds());
|
|
564
|
+
ref.setInput('step', this.step());
|
|
565
|
+
ref.instance.changed.subscribe(next => {
|
|
566
|
+
this.commit(next);
|
|
567
|
+
ref.setInput('value', next);
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
commit(next) {
|
|
571
|
+
this.value.set(next);
|
|
572
|
+
this.text.set(this.adapter.format(next, this.resolvedFormat()));
|
|
573
|
+
this.onChange(next);
|
|
574
|
+
}
|
|
575
|
+
closeOverlay() {
|
|
576
|
+
this.dispose();
|
|
577
|
+
}
|
|
578
|
+
dispose() {
|
|
579
|
+
if (this.overlayRef) {
|
|
580
|
+
this.overlayRef.dispose();
|
|
581
|
+
this.overlayRef = null;
|
|
582
|
+
}
|
|
583
|
+
this.overlayOpen.set(false);
|
|
584
|
+
}
|
|
585
|
+
// Helpers
|
|
586
|
+
isOutOfBounds(date) {
|
|
587
|
+
if (this.mode() === 'time')
|
|
588
|
+
return false;
|
|
589
|
+
const min = this.min();
|
|
590
|
+
if (min && this.adapter.compareDate(date, min) < 0)
|
|
591
|
+
return true;
|
|
592
|
+
const max = this.max();
|
|
593
|
+
if (max && this.adapter.compareDate(date, max) > 0)
|
|
594
|
+
return true;
|
|
595
|
+
return false;
|
|
596
|
+
}
|
|
597
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrDatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
598
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: WrDatePicker, isStandalone: true, selector: "wr-date-picker", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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 }, dateFilter: { classPropertyName: "dateFilter", publicName: "dateFilter", isSignal: true, isRequired: false, transformFunction: null }, timeFormat: { classPropertyName: "timeFormat", publicName: "timeFormat", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "classes()" } }, providers: [
|
|
599
|
+
{
|
|
600
|
+
provide: NG_VALUE_ACCESSOR,
|
|
601
|
+
// eslint-disable-next-line @angular-eslint/no-forward-ref
|
|
602
|
+
useExisting: forwardRef(() => WrDatePicker),
|
|
603
|
+
multi: true,
|
|
604
|
+
},
|
|
605
|
+
], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["input"], descendants: true, isSignal: true }], ngImport: i0, template: "<wr-input-group>\n <input\n #input\n wrInput\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-expanded]=\"overlayOpen()\"\n [value]=\"text()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n <button\n type=\"button\"\n wrInputSuffix\n class=\"wr-date-picker__trigger\"\n [attr.aria-label]=\"triggerLabel()\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"toggleOverlay()\"\n >\n @if (isTime()) {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"5.75\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.2\" />\n <line x1=\"7\" y1=\"7\" x2=\"7\" y2=\"3.75\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" />\n <line x1=\"7\" y1=\"7\" x2=\"9.5\" y2=\"7\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" />\n </svg>\n } @else {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <rect x=\"1.5\" y=\"2.5\" width=\"11\" height=\"10\" rx=\"1.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.2\" />\n <line x1=\"1.5\" y1=\"5.5\" x2=\"12.5\" y2=\"5.5\" stroke=\"currentColor\" stroke-width=\"1.2\" />\n <line x1=\"4\" y1=\"1\" x2=\"4\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" />\n <line x1=\"10\" y1=\"1\" x2=\"10\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" />\n @if (isDateTime()) {\n <circle cx=\"7\" cy=\"9\" r=\"1.5\" fill=\"currentColor\" />\n }\n </svg>\n }\n </button>\n</wr-input-group>\n", dependencies: [{ kind: "directive", type: WrInput, selector: "input[wrInput], textarea[wrInput]", inputs: ["rounded"] }, { kind: "component", type: WrInputGroup, selector: "wr-input-group", inputs: ["rounded"] }, { kind: "directive", type: WrInputSuffix, selector: "[wrInputSuffix]" }], encapsulation: i0.ViewEncapsulation.None });
|
|
606
|
+
}
|
|
607
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: WrDatePicker, decorators: [{
|
|
608
|
+
type: Component,
|
|
609
|
+
args: [{ selector: 'wr-date-picker', encapsulation: ViewEncapsulation.None, host: { '[class]': 'classes()' }, imports: [WrInput, WrInputGroup, WrInputSuffix], providers: [
|
|
610
|
+
{
|
|
611
|
+
provide: NG_VALUE_ACCESSOR,
|
|
612
|
+
// eslint-disable-next-line @angular-eslint/no-forward-ref
|
|
613
|
+
useExisting: forwardRef(() => WrDatePicker),
|
|
614
|
+
multi: true,
|
|
615
|
+
},
|
|
616
|
+
], template: "<wr-input-group>\n <input\n #input\n wrInput\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-expanded]=\"overlayOpen()\"\n [value]=\"text()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"effectiveDisabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n />\n <button\n type=\"button\"\n wrInputSuffix\n class=\"wr-date-picker__trigger\"\n [attr.aria-label]=\"triggerLabel()\"\n [disabled]=\"effectiveDisabled()\"\n (click)=\"toggleOverlay()\"\n >\n @if (isTime()) {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <circle cx=\"7\" cy=\"7\" r=\"5.75\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.2\" />\n <line x1=\"7\" y1=\"7\" x2=\"7\" y2=\"3.75\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" />\n <line x1=\"7\" y1=\"7\" x2=\"9.5\" y2=\"7\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" />\n </svg>\n } @else {\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n <rect x=\"1.5\" y=\"2.5\" width=\"11\" height=\"10\" rx=\"1.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.2\" />\n <line x1=\"1.5\" y1=\"5.5\" x2=\"12.5\" y2=\"5.5\" stroke=\"currentColor\" stroke-width=\"1.2\" />\n <line x1=\"4\" y1=\"1\" x2=\"4\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" />\n <line x1=\"10\" y1=\"1\" x2=\"10\" y2=\"4\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" />\n @if (isDateTime()) {\n <circle cx=\"7\" cy=\"9\" r=\"1.5\" fill=\"currentColor\" />\n }\n </svg>\n }\n </button>\n</wr-input-group>\n" }]
|
|
617
|
+
}], ctorParameters: () => [], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], dateFilter: [{ type: i0.Input, args: [{ isSignal: true, alias: "dateFilter", required: false }] }], timeFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "timeFormat", required: false }] }], showSeconds: [{ type: i0.Input, args: [{ isSignal: true, alias: "showSeconds", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], inputEl: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Generated bundle index. Do not edit.
|
|
621
|
+
*/
|
|
622
|
+
|
|
623
|
+
export { WrDatePicker };
|
|
624
|
+
//# sourceMappingURL=ngwr-date-picker.mjs.map
|