ngwr 11.2.0 → 12.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/README.md +7 -7
- package/burger/styles/_index.scss +1 -1
- package/button/styles/_index.scss +2 -2
- package/calendar/styles/_index.scss +32 -12
- package/calendar-heatmap/styles/_index.scss +20 -0
- package/carousel/styles/_index.scss +23 -1
- package/cascader/styles/_index.scss +15 -3
- package/checkbox/styles/_index.scss +2 -2
- package/collapse/styles/_index.scss +2 -2
- package/color-picker/styles/_index.scss +3 -3
- package/compare/styles/_index.scss +18 -2
- package/context-menu/styles/_index.scss +21 -2
- package/date-picker/styles/_index.scss +5 -5
- package/descriptions/styles/_index.scss +1 -1
- package/drag-drop/styles/_index.scss +28 -1
- package/drawer/styles/_index.scss +37 -0
- package/dropdown/styles/_index.scss +2 -2
- package/event-calendar/styles/_index.scss +67 -10
- package/fesm2022/ngwr-action-sheet.mjs +3 -3
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +3 -3
- package/fesm2022/ngwr-aurora.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +6 -6
- package/fesm2022/ngwr-bar-chart-testing.mjs +20 -2
- package/fesm2022/ngwr-bar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-bar-chart.mjs +3 -3
- package/fesm2022/ngwr-blur-text.mjs +3 -3
- package/fesm2022/ngwr-blur-text.mjs.map +1 -1
- package/fesm2022/ngwr-border-glow.mjs +4 -4
- package/fesm2022/ngwr-border-glow.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +29 -17
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +6 -6
- package/fesm2022/ngwr-calendar-heatmap.mjs +17 -5
- package/fesm2022/ngwr-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-testing.mjs +1 -1
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +187 -9
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +10 -10
- package/fesm2022/ngwr-card.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +124 -24
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +48 -5
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-circular-text.mjs +4 -4
- package/fesm2022/ngwr-circular-text.mjs.map +1 -1
- package/fesm2022/ngwr-click-spark.mjs +27 -7
- package/fesm2022/ngwr-click-spark.mjs.map +1 -1
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker-testing.mjs +26 -6
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +98 -8
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +14 -5
- package/fesm2022/ngwr-command-palette.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-confetti.mjs +31 -6
- package/fesm2022/ngwr-confetti.mjs.map +1 -1
- package/fesm2022/ngwr-config.mjs +9 -0
- package/fesm2022/ngwr-config.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu-testing.mjs +30 -11
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +333 -43
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +25 -9
- package/fesm2022/ngwr-counter.mjs.map +1 -1
- package/fesm2022/{ngwr-date-adapter-fns.mjs → ngwr-date-adapters-fns.mjs} +37 -10
- package/fesm2022/ngwr-date-adapters-fns.mjs.map +1 -0
- package/fesm2022/{ngwr-date-adapter-luxon.mjs → ngwr-date-adapters-luxon.mjs} +5 -5
- package/fesm2022/ngwr-date-adapters-luxon.mjs.map +1 -0
- package/fesm2022/ngwr-date-picker-testing.mjs +11 -6
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +119 -37
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/{ngwr-date-adapter.mjs → ngwr-date.mjs} +36 -10
- package/fesm2022/ngwr-date.mjs.map +1 -0
- package/fesm2022/ngwr-decrypt-text.mjs +3 -3
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +73 -18
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +12 -12
- package/fesm2022/ngwr-divider.mjs +52 -5
- package/fesm2022/ngwr-divider.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart-testing.mjs +8 -4
- package/fesm2022/ngwr-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-donut-chart.mjs +7 -7
- package/fesm2022/ngwr-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-drag-drop.mjs +160 -11
- package/fesm2022/ngwr-drag-drop.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +121 -58
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +26 -10
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +28 -15
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text-testing.mjs +5 -3
- package/fesm2022/ngwr-falling-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-falling-text.mjs +75 -46
- package/fesm2022/ngwr-falling-text.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +3 -3
- package/fesm2022/ngwr-form.mjs +32 -15
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-fuzzy-text.mjs +21 -11
- package/fesm2022/ngwr-fuzzy-text.mjs.map +1 -1
- package/fesm2022/ngwr-gauge.mjs +3 -3
- package/fesm2022/ngwr-glitch-text-testing.mjs +51 -17
- package/fesm2022/ngwr-glitch-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-glitch-text.mjs +7 -7
- package/fesm2022/ngwr-glitch-text.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text-testing.mjs +46 -11
- package/fesm2022/ngwr-gradient-text-testing.mjs.map +1 -1
- package/fesm2022/ngwr-gradient-text.mjs +4 -4
- package/fesm2022/ngwr-gradient-text.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +24 -9
- package/fesm2022/ngwr-hotkey.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +73 -1
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +55 -1
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +26 -15
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper-testing.mjs +53 -9
- package/fesm2022/ngwr-image-cropper-testing.mjs.map +1 -1
- package/fesm2022/ngwr-image-cropper.mjs +150 -12
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number-testing.mjs +15 -10
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +17 -10
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp-testing.mjs +12 -6
- package/fesm2022/ngwr-input-otp-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +24 -5
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +15 -15
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox.mjs +4 -4
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-line-chart.mjs +73 -26
- package/fesm2022/ngwr-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +7 -7
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +7 -7
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-markdown.mjs +66 -8
- package/fesm2022/ngwr-markdown.mjs.map +1 -1
- package/fesm2022/ngwr-marquee.mjs +4 -4
- package/fesm2022/ngwr-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-media.mjs +3 -3
- package/fesm2022/ngwr-mention.mjs +108 -13
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-meter-group-testing.mjs +26 -6
- package/fesm2022/ngwr-meter-group-testing.mjs.map +1 -1
- package/fesm2022/ngwr-meter-group.mjs +3 -3
- package/fesm2022/ngwr-overlay.mjs +6 -6
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination-testing.mjs +6 -6
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +17 -13
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +39 -26
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm.mjs +6 -6
- package/fesm2022/ngwr-popover-testing.mjs +7 -2
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +155 -33
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +3 -3
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +42 -5
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +21 -30
- package/fesm2022/ngwr-result.mjs.map +1 -1
- package/fesm2022/ngwr-rotating-text.mjs +3 -3
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-segmented-testing.mjs +14 -1
- package/fesm2022/ngwr-segmented-testing.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +29 -6
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +159 -34
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-shiny-text.mjs +11 -9
- package/fesm2022/ngwr-shiny-text.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +31 -16
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider.mjs +100 -9
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sparkline.mjs +3 -3
- package/fesm2022/ngwr-speed-dial-testing.mjs +15 -13
- package/fesm2022/ngwr-speed-dial-testing.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +27 -12
- package/fesm2022/ngwr-speed-dial.mjs.map +1 -1
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splash-cursor.mjs +3 -3
- package/fesm2022/ngwr-split-text.mjs +17 -5
- package/fesm2022/ngwr-split-text.mjs.map +1 -1
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-spotlight-card.mjs +7 -7
- package/fesm2022/ngwr-spotlight-card.mjs.map +1 -1
- package/fesm2022/ngwr-squircle.mjs +6 -6
- package/fesm2022/ngwr-star-border.mjs +4 -4
- package/fesm2022/ngwr-star-border.mjs.map +1 -1
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper-testing.mjs +8 -8
- package/fesm2022/ngwr-stepper-testing.mjs.map +1 -1
- package/fesm2022/ngwr-stepper.mjs +33 -8
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +17 -5
- package/fesm2022/ngwr-storage.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table.mjs +99 -39
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs +11 -10
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +36 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +3 -3
- package/fesm2022/ngwr-theme.mjs +181 -4
- package/fesm2022/ngwr-theme.mjs.map +1 -1
- package/fesm2022/ngwr-tilt-card.mjs +7 -7
- package/fesm2022/ngwr-tilt-card.mjs.map +1 -1
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +9 -9
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +34 -10
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +3 -3
- package/fesm2022/ngwr-tree.mjs +28 -10
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter-testing.mjs +15 -1
- package/fesm2022/ngwr-typewriter-testing.mjs.map +1 -1
- package/fesm2022/ngwr-typewriter.mjs +13 -5
- package/fesm2022/ngwr-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-utils.mjs +5 -2
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +4 -4
- package/fesm2022/ngwr-virtual-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-waves.mjs +4 -4
- package/fesm2022/ngwr-waves.mjs.map +1 -1
- package/fesm2022/ngwr-window.mjs +94 -24
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +2 -2
- package/glitch-text/styles/_index.scss +27 -12
- package/i18n/en.json +56 -6
- package/i18n/ru.json +56 -6
- package/image-cropper/styles/_index.scss +19 -0
- package/input/styles/_index.scss +2 -2
- package/input-number/styles/_index.scss +2 -2
- package/input-otp/styles/_index.scss +9 -2
- package/knob/styles/_index.scss +1 -1
- package/lightbox/styles/_index.scss +16 -2
- package/line-chart/styles/_index.scss +28 -14
- package/list/styles/_index.scss +1 -1
- package/llms-full.txt +18 -23
- package/llms.txt +22 -6
- package/markdown/styles/_index.scss +3 -3
- package/mcp/api.js +6 -4
- package/mcp/catalog.js +40 -3
- package/mcp/providers.js +16 -3
- package/mcp/tools.js +21 -1
- package/meter-group/styles/_index.scss +1 -1
- package/overlay/styles/_index.scss +33 -1
- package/package.json +17 -12
- package/pagination/styles/_index.scss +23 -1
- package/popover/styles/_index.scss +16 -7
- package/progress/styles/_index.scss +1 -1
- package/radio/styles/_index.scss +2 -2
- package/rating/styles/_index.scss +1 -1
- package/schematics/collection.json +1 -1
- package/schematics/migrations/v12/index.js +65 -0
- package/schematics/migrations/v7/index.js +12 -1
- package/schematics/migrations/v8/index.js +10 -1
- package/schematics/migrations.json +5 -0
- package/schematics/ng-add/index.js +8 -3
- package/schematics/provider/index.js +80 -13
- package/schematics/use/index.js +9 -129
- package/schematics/use/rule.js +206 -0
- package/schematics/use/symbol-map.json +4 -4
- package/segmented/styles/_index.scss +14 -3
- package/select/styles/_index.scss +14 -2
- package/sidebar/styles/_index.scss +12 -10
- package/skills/ngwr/SKILL.md +7 -5
- package/skills/ngwr/references/catalog.md +9 -9
- package/skills/ngwr/references/setup.md +10 -5
- package/slider/styles/_index.scss +1 -1
- package/speed-dial/styles/_index.scss +1 -1
- package/stepper/styles/_index.scss +12 -3
- package/switch/styles/_index.scss +2 -2
- package/table/styles/_index.scss +61 -12
- package/tabs/styles/_index.scss +1 -1
- package/textarea/styles/_index.scss +1 -1
- package/theme/styles/_colors.scss +142 -56
- package/theme/styles/_dark.scss +46 -3
- package/theme/styles/_focus.scss +28 -5
- package/theme/styles/_mixins.scss +1 -1
- package/theme/styles/_variables.scss +67 -0
- package/transfer/styles/_index.scss +26 -3
- package/tree/styles/_index.scss +29 -6
- package/types/ngwr-bar-chart-testing.d.ts +9 -1
- package/types/ngwr-blur-text.d.ts +8 -4
- package/types/ngwr-breadcrumbs.d.ts +17 -10
- package/types/ngwr-calendar-testing.d.ts +1 -1
- package/types/ngwr-calendar.d.ts +66 -0
- package/types/ngwr-carousel.d.ts +85 -6
- package/types/ngwr-cascader.d.ts +17 -0
- package/types/ngwr-click-spark.d.ts +4 -0
- package/types/ngwr-color-picker-testing.d.ts +8 -0
- package/types/ngwr-color-picker.d.ts +21 -1
- package/types/ngwr-confetti.d.ts +8 -0
- package/types/ngwr-config.d.ts +10 -1
- package/types/ngwr-context-menu-testing.d.ts +24 -11
- package/types/ngwr-context-menu.d.ts +56 -0
- package/types/ngwr-counter.d.ts +1 -0
- package/types/{ngwr-date-adapter-fns.d.ts → ngwr-date-adapters-fns.d.ts} +33 -6
- package/types/{ngwr-date-adapter-luxon.d.ts → ngwr-date-adapters-luxon.d.ts} +1 -1
- package/types/ngwr-date-picker-testing.d.ts +11 -6
- package/types/ngwr-date-picker.d.ts +8 -4
- package/types/{ngwr-date-adapter.d.ts → ngwr-date.d.ts} +24 -5
- package/types/ngwr-dialog.d.ts +38 -1
- package/types/ngwr-divider.d.ts +25 -0
- package/types/ngwr-donut-chart-testing.d.ts +7 -3
- package/types/ngwr-donut-chart.d.ts +3 -3
- package/types/ngwr-drag-drop.d.ts +56 -2
- package/types/ngwr-drawer.d.ts +56 -5
- package/types/ngwr-event-calendar.d.ts +8 -2
- package/types/ngwr-falling-text-testing.d.ts +5 -3
- package/types/ngwr-falling-text.d.ts +1 -1
- package/types/ngwr-form.d.ts +12 -2
- package/types/ngwr-glitch-text-testing.d.ts +37 -8
- package/types/ngwr-gradient-text-testing.d.ts +16 -3
- package/types/ngwr-i18n.d.ts +13 -4
- package/types/ngwr-image-cropper-testing.d.ts +49 -10
- package/types/ngwr-image-cropper.d.ts +70 -5
- package/types/ngwr-input-number-testing.d.ts +15 -10
- package/types/ngwr-input-number.d.ts +11 -4
- package/types/ngwr-input-otp-testing.d.ts +12 -6
- package/types/ngwr-input-otp.d.ts +15 -1
- package/types/ngwr-line-chart.d.ts +20 -3
- package/types/ngwr-markdown.d.ts +11 -0
- package/types/ngwr-mention.d.ts +32 -0
- package/types/ngwr-meter-group-testing.d.ts +12 -2
- package/types/ngwr-overlay.d.ts +1 -0
- package/types/ngwr-pagination-testing.d.ts +4 -4
- package/types/ngwr-pipes.d.ts +1 -1
- package/types/ngwr-popover-testing.d.ts +7 -2
- package/types/ngwr-popover.d.ts +1 -0
- package/types/ngwr-result.d.ts +6 -0
- package/types/ngwr-segmented-testing.d.ts +9 -0
- package/types/ngwr-segmented.d.ts +21 -1
- package/types/ngwr-select.d.ts +68 -6
- package/types/ngwr-shiny-text.d.ts +4 -2
- package/types/ngwr-sidebar.d.ts +14 -5
- package/types/ngwr-slider.d.ts +69 -1
- package/types/ngwr-speed-dial-testing.d.ts +15 -11
- package/types/ngwr-speed-dial.d.ts +22 -3
- package/types/ngwr-split-text.d.ts +9 -0
- package/types/ngwr-stepper-testing.d.ts +5 -5
- package/types/ngwr-stepper.d.ts +8 -0
- package/types/ngwr-storage.d.ts +1 -0
- package/types/ngwr-table.d.ts +104 -11
- package/types/ngwr-tabs-testing.d.ts +11 -10
- package/types/ngwr-tabs.d.ts +2 -0
- package/types/ngwr-theme.d.ts +82 -1
- package/types/ngwr-tour.d.ts +22 -4
- package/types/ngwr-tree.d.ts +5 -4
- package/types/ngwr-typewriter-testing.d.ts +10 -0
- package/types/ngwr-utils.d.ts +5 -2
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +39 -11
- package/typography/styles/_index.scss +1 -1
- package/window/styles/_index.scss +72 -26
- package/fesm2022/ngwr-date-adapter-fns.mjs.map +0 -1
- package/fesm2022/ngwr-date-adapter-luxon.mjs.map +0 -1
- package/fesm2022/ngwr-date-adapter.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-counter.mjs","sources":["../../../projects/lib/counter/easing.ts","../../../projects/lib/counter/counter.ts","../../../projects/lib/counter/counter.html","../../../projects/lib/counter/count-up.ts","../../../projects/lib/counter/ngwr-counter.ts"],"sourcesContent":["/** Cubic ease-out — the shared tween curve for counter / count-up. */\nexport function easeOutCubic(t: number): number {\n return 1 - Math.pow(1 - t, 3);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n LOCALE_ID,\n PLATFORM_ID,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\n\nimport { easeOutCubic } from './easing';\nimport type { WrCounterMode } from './interfaces';\n\n/** Visual cell in odometer mode — either a 0-9 column or a static glyph. */\ntype Cell = { readonly kind: 'digit'; readonly fraction: number } | { readonly kind: 'static'; readonly char: string };\n\n/**\n * Animated number display with two modes:\n *\n * - **`odometer`** (default) — each digit is a vertical strip of 0-9 that\n * rolls into place, continuously interpolated for smooth motion when the\n * value changes.\n * - **`tween`** — a single eased count-up between the previous and new value,\n * rendered through `Intl.NumberFormat`.\n *\n * Reacts to `[value]` changes — animate from any number to any number.\n *\n * @example\n * ```html\n * <wr-counter [value]=\"123456\" mode=\"odometer\" />\n * <wr-counter [value]=\"9.99\" mode=\"tween\" [decimals]=\"2\" prefix=\"$\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/counter\n */\n@Component({\n selector: 'wr-counter',\n templateUrl: './counter.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-counter' },\n})\nexport class WrCounter {\n /** Target value. */\n /**\n * The number to show. Coerced like every other numeric input here — it was the only one\n * without it, and `Intl.NumberFormat().format(NaN)` renders the literal text `NaN`.\n */\n readonly value = input.required<number, unknown>({\n transform: (v: unknown): number => coerceNumberProperty(v, 0),\n });\n\n /** Animation mode. @default 'odometer' */\n readonly mode = input<WrCounterMode>('odometer');\n\n /** Duration (ms). @default 900 */\n readonly duration = input(900, {\n transform: (v: unknown): number => Math.max(100, coerceNumberProperty(v, 900)),\n });\n\n /** Fixed number of decimals. @default 0 */\n readonly decimals = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /** Optional prefix (e.g. `'$'`). */\n readonly prefix = input<string>('');\n\n /** Optional suffix (e.g. `'%'`). */\n readonly suffix = input<string>('');\n\n /** Group thousands. @default true */\n readonly grouping = input<boolean>(true);\n\n /** Pad integer part to at least this many digits. @default 0 (no padding) */\n readonly minIntegerDigits = input(0, {\n transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)),\n });\n\n private readonly current = signal<number>(0);\n private readonly locale = inject(LOCALE_ID);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly platform = inject(WrPlatform);\n private rafId: number | null = null;\n\n /** Tween-mode formatted output. */\n protected readonly tweenText = computed(() => this.format(this.current()));\n\n /**\n * Odometer-mode text for assistive tech and prerendered output. The strip\n * renders every digit 0-9 per column and picks one with a transform, so its\n * markup carries no usable text — screen readers would announce all ten, and\n * static HTML would ship the same noise. This node holds the real value.\n */\n protected readonly odoText = computed(() => `${this.prefix()}${this.format(this.value())}${this.suffix()}`);\n\n /** Odometer cells — one per character in the formatted target string. */\n protected readonly cells = computed<readonly Cell[]>(() => {\n // Build the string with target sign + max length so we can interpolate\n // each digit position smoothly.\n const target = this.value();\n const live = this.current();\n const formattedTarget = this.format(target);\n const formattedLive = this.format(live);\n\n // Right-align so trailing digits line up.\n const maxLen = Math.max(formattedTarget.length, formattedLive.length);\n const padTarget = formattedTarget.padStart(maxLen, ' ');\n const padLive = formattedLive.padStart(maxLen, ' ');\n\n const cells: Cell[] = [];\n for (let i = 0; i < maxLen; i++) {\n const t = padTarget[i];\n const l = padLive[i];\n if (/[0-9]/.test(t) && /[0-9]/.test(l)) {\n // Interpolate the fractional digit so the strip rolls smoothly —\n // multi-digit rollover (9 → 0 carries 1) looks continuous.\n const fraction = this.digitFractionAt(live, target, i, maxLen);\n cells.push({ kind: 'digit', fraction });\n } else {\n cells.push({ kind: 'static', char: t === ' ' ? '' : t });\n }\n }\n return cells;\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.cancel());\n\n effect(() => {\n const target = this.value();\n // Snapshot the current value WITHOUT tracking it — the RAF tick below\n // writes `current` every frame, and tracking it here would re-trigger\n // this effect each frame, cancelling + restarting the tween endlessly\n // (the wheels hang mid-roll and only snap once the restarts converge).\n const start = untracked(() => this.current());\n // Straight to the answer when there is nothing to animate for: no browser, or a\n // reader who asked for less motion. `wr-scroll` already falls back the same way, and a\n // component whose entire purpose is a count-up should be the first to honour it.\n if (!this.isBrowser || this.platform.prefersReducedMotion()) {\n this.current.set(target);\n return;\n }\n this.cancel();\n const startTs = performance.now();\n const dur = this.duration();\n const tick = (now: number): void => {\n const t = Math.min(1, (now - startTs) / dur);\n // Snap exactly to target on the final frame. Without this,\n // `start + (target - start) * 1` carries FP rounding (e.g.\n // 0.1 + (0.3 - 0.1) * 1 = 0.30000000000000004), so\n // `digitFractionAt`'s `live === target` rest-state check\n // fails — wheels visibly stop on a fractional position and\n // never settle to the clean integer glyph.\n const v = t >= 1 ? target : start + (target - start) * easeOutCubic(t);\n this.current.set(v);\n if (t < 1) this.rafId = requestAnimationFrame(tick);\n else this.rafId = null;\n };\n this.rafId = requestAnimationFrame(tick);\n });\n }\n\n private cancel(): void {\n if (this.rafId !== null) cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n\n private format(n: number): string {\n return new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: this.decimals(),\n maximumFractionDigits: this.decimals(),\n minimumIntegerDigits: this.minIntegerDigits() || 1,\n useGrouping: this.grouping(),\n }).format(n);\n }\n\n /**\n * Compute the smoothly-interpolated digit (0..10) at column `i` of the\n * formatted live string. Returns the integer digit + a fraction so the\n * strip CSS translate looks like a real rolling odometer.\n */\n private digitFractionAt(live: number, target: number, columnIndex: number, totalLen: number): number {\n // Determine the place value at this column. Account for grouping separators\n // and the decimal point by counting digits to the right of this column in\n // the formatted target.\n const formattedTarget = this.format(target);\n const padded = formattedTarget.padStart(totalLen, ' ');\n const tail = padded.slice(columnIndex + 1);\n const digitsRight = (tail.match(/[0-9]/g) ?? []).length;\n const placePower = digitsRight - this.decimals();\n const place = Math.pow(10, placePower);\n const absLive = Math.abs(live);\n const raw = absLive / place;\n // Modulo 10 gives the digit at this column with fractional rollover —\n // mid-animation this looks like a real wheel rolling between digits.\n const mod = raw - Math.floor(raw / 10) * 10;\n // At rest (live === target) every wheel must rest on an exact integer\n // — otherwise upper digits show as partial (e.g. tens reads \"5.6\"\n // for value 123456, visibly clipping between 5 and 6 in the\n // overflow:hidden window). The continuous-mechanical look is only\n // wanted DURING the tween, not after it settles.\n if (live === target) return Math.floor(mod + 1e-9);\n return mod;\n }\n}\n","@if (mode() === 'tween') {\n <span class=\"wr-counter__tween\">{{ prefix() }}{{ tweenText() }}{{ suffix() }}</span>\n} @else {\n <span class=\"wr-counter__sr-only\">{{ odoText() }}</span>\n <span class=\"wr-counter__odo\" aria-hidden=\"true\">\n @if (prefix()) {\n <span class=\"wr-counter__static\">{{ prefix() }}</span>\n }\n @for (cell of cells(); track $index) {\n @if (cell.kind === 'digit') {\n <span class=\"wr-counter__digit\">\n <span class=\"wr-counter__strip\" [style.transform]=\"`translateY(-${cell.fraction}em)`\">\n <span>0</span><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span\n ><span>7</span><span>8</span><span>9</span>\n </span>\n </span>\n } @else {\n <span class=\"wr-counter__static\">{{ cell.char }}</span>\n }\n }\n @if (suffix()) {\n <span class=\"wr-counter__static\">{{ suffix() }}</span>\n }\n </span>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * The spring-physics path is an adaptation of the CountUp effect by\n * David Haz / reactbits.dev (https://www.reactbits.dev/text-animations/count-up).\n * Same critically-damped formula, implemented inline with rAF — no\n * external dependency.\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n LOCALE_ID,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { numAttr } from 'ngwr/utils';\n\nimport { easeOutCubic } from './easing';\nimport type { WrCountUpDirection, WrCountUpEasing, WrCountUpTrigger } from './interfaces';\n\n/**\n * Animated number tick. Animates from `from` to the current `to`, formatting\n * via `Intl.NumberFormat`. Re-runs whenever `to` changes.\n *\n * @example Basic\n * ```html\n * <wr-count-up [to]=\"12345\" />\n * <wr-count-up [to]=\"9.99\" [decimals]=\"2\" prefix=\"$\" />\n * ```\n *\n * @example Reactbits-style — spring curve + viewport trigger\n * ```html\n * <wr-count-up [to]=\"100\" easing=\"spring\" trigger=\"visible\" [delay]=\"200\" />\n * ```\n *\n * @example Count down\n * ```html\n * <wr-count-up [from]=\"60\" [to]=\"0\" direction=\"down\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/counter\n */\n@Component({\n selector: 'wr-count-up',\n template: `{{ prefix() }}{{ formatted() }}{{ suffix() }}`,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-count-up' },\n})\nexport class WrCountUp {\n /** Starting value. @default 0 */\n readonly from = input(0, { transform: numAttr(0) });\n\n /** Target value. */\n readonly to = input.required<number>();\n\n /**\n * Animation duration. Units depend on `easing`:\n *\n * - `ease-out` — milliseconds (default 1200, min 100)\n * - `spring` — seconds (tunes spring stiffness; default 2)\n */\n readonly duration = input(1200, { transform: numAttr(1200) });\n\n /** Optional delay (ms) before the animation starts. @default 0 */\n readonly delay = input(0, { transform: numAttr(0) });\n\n /** Animation curve. @default 'ease-out' */\n readonly easing = input<WrCountUpEasing>('ease-out');\n\n /**\n * When to start the animation.\n *\n * - `'mount'` (default) — start as soon as the component is rendered.\n * - `'visible'` — wait for the host to enter the viewport\n * (IntersectionObserver). Useful for long pages or hero numbers\n * below the fold.\n */\n readonly trigger = input<WrCountUpTrigger>('mount');\n\n /** Counting direction. `'down'` swaps `from` ↔ `to`. @default 'up' */\n readonly direction = input<WrCountUpDirection>('up');\n\n /** Fixed number of decimals. @default 0 */\n readonly decimals = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /** Optional prefix (e.g. `'$'`). */\n readonly prefix = input<string>('');\n\n /** Optional suffix (e.g. `'%'`). */\n readonly suffix = input<string>('');\n\n /** Disable grouping separators (`1,234` → `1234`). @default true (grouping on) */\n readonly grouping = input<boolean>(true);\n\n /** Emits when the animation begins. */\n readonly started = output<void>();\n\n /** Emits when the animation settles. */\n readonly completed = output<void>();\n\n private readonly value = signal<number>(0);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly locale = inject(LOCALE_ID);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly destroyRef = inject(DestroyRef);\n\n private rafId: number | null = null;\n private delayTimer: ReturnType<typeof setTimeout> | undefined;\n private observer: IntersectionObserver | null = null;\n private hasFiredForVisible = false;\n\n protected readonly formatted = computed(() => {\n return new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: this.decimals(),\n maximumFractionDigits: this.decimals(),\n useGrouping: this.grouping(),\n }).format(this.value());\n });\n\n constructor() {\n if (!this.isBrowser) {\n // SSR: settle on the value the animation ENDS on. Seeding the start\n // instead would bake the placeholder (usually 0) into prerendered HTML,\n // so readers and crawlers would get 0 rather than the real figure. The\n // browser rewinds to the start and animates once it boots.\n effect(() => this.value.set(this.direction() === 'down' ? this.from() : this.to()));\n return;\n }\n\n // Seed the resting value so first paint shows the start, not 0.\n effect(() => {\n const initial = this.direction() === 'down' ? this.to() : this.from();\n this.value.set(initial);\n });\n\n // Run the animation whenever the `to` target changes (or on first mount).\n // For `trigger=\"visible\"` the first run waits for the IntersectionObserver\n // to fire; subsequent `to` changes re-run immediately.\n effect(() => {\n // Establish dependencies so the effect re-runs on `to` changes.\n this.to();\n this.from();\n this.direction();\n this.duration();\n this.easing();\n this.delay();\n\n if (this.trigger() === 'visible' && !this.hasFiredForVisible) return;\n this.scheduleRun();\n });\n\n afterNextRender(() => {\n if (this.trigger() === 'visible') this.setupViewportTrigger();\n });\n\n this.destroyRef.onDestroy(() => {\n this.cancel();\n // `cancel()` only stops timers and the rAF loop. The IntersectionObserver\n // disconnects itself from inside its callback, which never fires if the\n // host is destroyed before it ever scrolls into view — so it would keep\n // observing a detached element for the life of the page.\n this.observer?.disconnect();\n this.observer = null;\n });\n }\n\n // Scheduling\n\n private setupViewportTrigger(): void {\n this.observer = new IntersectionObserver(\n (entries, obs) => {\n for (const e of entries) {\n if (e.isIntersecting && !this.hasFiredForVisible) {\n obs.disconnect();\n this.hasFiredForVisible = true;\n this.scheduleRun();\n break;\n }\n }\n },\n { threshold: 0, rootMargin: '0px' }\n );\n this.observer.observe(this.host.nativeElement);\n }\n\n private scheduleRun(): void {\n this.cancel();\n const d = this.delay();\n if (d > 0) {\n this.delayTimer = setTimeout(() => this.run(), d);\n } else {\n this.run();\n }\n }\n\n private run(): void {\n const start = this.direction() === 'down' ? this.to() : this.from();\n const end = this.direction() === 'down' ? this.from() : this.to();\n this.started.emit();\n if (this.easing() === 'spring') this.tweenSpring(start, end);\n else this.tweenEaseOut(start, end);\n }\n\n // Tweens\n\n private tweenEaseOut(start: number, target: number): void {\n const duration = Math.max(100, this.duration());\n const startTs = performance.now();\n const tick = (now: number): void => {\n const t = Math.min(1, (now - startTs) / duration);\n const v = start + (target - start) * easeOutCubic(t);\n this.value.set(v);\n if (t < 1) {\n this.rafId = requestAnimationFrame(tick);\n } else {\n this.completed.emit();\n }\n };\n this.rafId = requestAnimationFrame(tick);\n }\n\n /**\n * Critically-damped spring tween. Same formula as `motion/react`'s\n * `useSpring` with mass = 1:\n *\n * damping = 20 + 40 / duration\n * stiffness = 100 / duration\n *\n * We integrate `(spring force − damping force)` each frame until both\n * displacement and velocity fall below epsilon.\n */\n private tweenSpring(start: number, target: number): void {\n const duration = Math.max(0.05, this.duration());\n const damping = 20 + 40 / duration;\n const stiffness = 100 / duration;\n let current = start;\n let velocity = 0;\n let lastTs = 0;\n const epsilon = 0.001 * Math.max(1, Math.abs(target - start));\n\n const step = (ts: number): void => {\n const dt = lastTs === 0 ? 1 / 60 : Math.min(0.05, (ts - lastTs) / 1000);\n lastTs = ts;\n\n const displacement = current - target;\n const accel = -stiffness * displacement - damping * velocity;\n velocity += accel * dt;\n current += velocity * dt;\n this.value.set(current);\n\n if (Math.abs(current - target) < epsilon && Math.abs(velocity) < epsilon * 10) {\n this.value.set(target);\n this.completed.emit();\n return;\n }\n this.rafId = requestAnimationFrame(step);\n };\n this.rafId = requestAnimationFrame(step);\n }\n\n // Cleanup\n\n private cancel(): void {\n if (this.rafId !== null) cancelAnimationFrame(this.rafId);\n this.rafId = null;\n if (this.delayTimer !== undefined) {\n clearTimeout(this.delayTimer);\n this.delayTimer = undefined;\n }\n }\n}\n\nexport type { WrCountUpEasing, WrCountUpTrigger, WrCountUpDirection } from './interfaces';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;AACM,SAAU,YAAY,CAAC,CAAS,EAAA;AACpC,IAAA,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAC/B;;ACHA;;;;;AAKG;AA0BH;;;;;;;;;;;;;;;;;;AAkBG;MAOU,SAAS,CAAA;;AAEpB;;;AAGG;AACM,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EAC7B,SAAS,EAAE,CAAC,CAAU,KAAa,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC7D;;IAGO,IAAI,GAAG,KAAK,CAAgB,UAAU;6EAAC;;IAGvC,QAAQ,GAAG,KAAK,CAAC,GAAG,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,UAAA,EAAA,8BAAA,EAAA,CAAA,EAC3B,SAAS,EAAE,CAAC,CAAU,KAAa,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,EAAA,CAC9E;;IAGO,QAAQ,GAAG,KAAK,CAAC,CAAC,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,UAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,SAAS,EAAE,CAAC,CAAU,KAAa,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAA,CAAG;;IAGnG,MAAM,GAAG,KAAK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EAAA,CAAA;AAAT,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,SAAS,sgDAJV,CAAA,6CAAA,CAA+C,EAAA,QAAA,EAAA,IAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA;;2FAI9C,SAAS,EAAA,UAAA,EAAA,CAAA;kBANrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,CAAA,6CAAA,CAA+C;oBACzD,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;AAC/B,iBAAA;;;AC9DD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngwr-counter.mjs","sources":["../../../projects/lib/counter/easing.ts","../../../projects/lib/counter/counter.ts","../../../projects/lib/counter/counter.html","../../../projects/lib/counter/count-up.ts","../../../projects/lib/counter/ngwr-counter.ts"],"sourcesContent":["/** Cubic ease-out — the shared tween curve for counter / count-up. */\nexport function easeOutCubic(t: number): number {\n return 1 - Math.pow(1 - t, 3);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n LOCALE_ID,\n PLATFORM_ID,\n ViewEncapsulation,\n computed,\n effect,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\n\nimport { easeOutCubic } from './easing';\nimport type { WrCounterMode } from './interfaces';\n\n/** Visual cell in odometer mode — either a 0-9 column or a static glyph. */\ntype Cell = { readonly kind: 'digit'; readonly fraction: number } | { readonly kind: 'static'; readonly char: string };\n\n/**\n * Animated number display with two modes:\n *\n * - **`odometer`** (default) — each digit is a vertical strip of 0-9 that\n * rolls into place, continuously interpolated for smooth motion when the\n * value changes.\n * - **`tween`** — a single eased count-up between the previous and new value,\n * rendered through `Intl.NumberFormat`.\n *\n * Reacts to `[value]` changes — animate from any number to any number.\n *\n * @example\n * ```html\n * <wr-counter [value]=\"123456\" mode=\"odometer\" />\n * <wr-counter [value]=\"9.99\" mode=\"tween\" [decimals]=\"2\" prefix=\"$\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/counter\n */\n@Component({\n selector: 'wr-counter',\n templateUrl: './counter.html',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-counter' },\n})\nexport class WrCounter {\n /** Target value. */\n /**\n * The number to show. Coerced like every other numeric input here — it was the only one\n * without it, and `Intl.NumberFormat().format(NaN)` renders the literal text `NaN`.\n */\n readonly value = input.required<number, unknown>({\n transform: (v: unknown): number => coerceNumberProperty(v, 0),\n });\n\n /** Animation mode. @default 'odometer' */\n readonly mode = input<WrCounterMode>('odometer');\n\n /** Duration (ms). @default 900 */\n readonly duration = input(900, {\n transform: (v: unknown): number => Math.max(100, coerceNumberProperty(v, 900)),\n });\n\n /** Fixed number of decimals. @default 0 */\n readonly decimals = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /** Optional prefix (e.g. `'$'`). */\n readonly prefix = input<string>('');\n\n /** Optional suffix (e.g. `'%'`). */\n readonly suffix = input<string>('');\n\n /** Group thousands. @default true */\n readonly grouping = input<boolean>(true);\n\n /** Pad integer part to at least this many digits. @default 0 (no padding) */\n readonly minIntegerDigits = input(0, {\n transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)),\n });\n\n private readonly current = signal<number>(0);\n private readonly locale = inject(LOCALE_ID);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly platform = inject(WrPlatform);\n private rafId: number | null = null;\n\n /** Tween-mode formatted output. */\n protected readonly tweenText = computed(() => this.format(this.current()));\n\n /**\n * Odometer-mode text for assistive tech and prerendered output. The strip\n * renders every digit 0-9 per column and picks one with a transform, so its\n * markup carries no usable text — screen readers would announce all ten, and\n * static HTML would ship the same noise. This node holds the real value.\n */\n protected readonly odoText = computed(() => `${this.prefix()}${this.format(this.value())}${this.suffix()}`);\n\n /** Odometer cells — one per character in the formatted target string. */\n protected readonly cells = computed<readonly Cell[]>(() => {\n // Build the string with target sign + max length so we can interpolate\n // each digit position smoothly.\n const target = this.value();\n const live = this.current();\n const formattedTarget = this.format(target);\n const formattedLive = this.format(live);\n\n // Right-align so trailing digits line up.\n const maxLen = Math.max(formattedTarget.length, formattedLive.length);\n const padTarget = formattedTarget.padStart(maxLen, ' ');\n const padLive = formattedLive.padStart(maxLen, ' ');\n\n const cells: Cell[] = [];\n for (let i = 0; i < maxLen; i++) {\n const t = padTarget[i];\n const l = padLive[i];\n if (/[0-9]/.test(t) && /[0-9]/.test(l)) {\n // Interpolate the fractional digit so the strip rolls smoothly —\n // multi-digit rollover (9 → 0 carries 1) looks continuous.\n const fraction = this.digitFractionAt(live, target, i, maxLen);\n cells.push({ kind: 'digit', fraction });\n } else {\n cells.push({ kind: 'static', char: t === ' ' ? '' : t });\n }\n }\n return cells;\n });\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.cancel());\n\n effect(() => {\n const target = this.value();\n // Snapshot the current value WITHOUT tracking it — the RAF tick below\n // writes `current` every frame, and tracking it here would re-trigger\n // this effect each frame, cancelling + restarting the tween endlessly\n // (the wheels hang mid-roll and only snap once the restarts converge).\n const start = untracked(() => this.current());\n // Straight to the answer when there is nothing to animate for: no browser, or a\n // reader who asked for less motion. `wr-scroll` already falls back the same way, and a\n // component whose entire purpose is a count-up should be the first to honour it.\n if (!this.isBrowser || this.platform.prefersReducedMotion()) {\n this.current.set(target);\n return;\n }\n this.cancel();\n const startTs = performance.now();\n const dur = this.duration();\n const tick = (now: number): void => {\n const t = Math.min(1, (now - startTs) / dur);\n // Snap exactly to target on the final frame. Without this,\n // `start + (target - start) * 1` carries FP rounding (e.g.\n // 0.1 + (0.3 - 0.1) * 1 = 0.30000000000000004), so\n // `digitFractionAt`'s `live === target` rest-state check\n // fails — wheels visibly stop on a fractional position and\n // never settle to the clean integer glyph.\n const v = t >= 1 ? target : start + (target - start) * easeOutCubic(t);\n this.current.set(v);\n if (t < 1) this.rafId = requestAnimationFrame(tick);\n else this.rafId = null;\n };\n this.rafId = requestAnimationFrame(tick);\n });\n }\n\n private cancel(): void {\n if (this.rafId !== null) cancelAnimationFrame(this.rafId);\n this.rafId = null;\n }\n\n private format(n: number): string {\n return new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: this.decimals(),\n maximumFractionDigits: this.decimals(),\n minimumIntegerDigits: this.minIntegerDigits() || 1,\n useGrouping: this.grouping(),\n }).format(n);\n }\n\n /**\n * Compute the smoothly-interpolated digit (0..10) at column `i` of the\n * formatted live string. Returns the integer digit + a fraction so the\n * strip CSS translate looks like a real rolling odometer.\n */\n private digitFractionAt(live: number, target: number, columnIndex: number, totalLen: number): number {\n // Determine the place value at this column. Account for grouping separators\n // and the decimal point by counting digits to the right of this column in\n // the formatted target.\n const formattedTarget = this.format(target);\n const padded = formattedTarget.padStart(totalLen, ' ');\n const tail = padded.slice(columnIndex + 1);\n const digitsRight = (tail.match(/[0-9]/g) ?? []).length;\n const placePower = digitsRight - this.decimals();\n const place = Math.pow(10, placePower);\n const absLive = Math.abs(live);\n const raw = absLive / place;\n // Modulo 10 gives the digit at this column with fractional rollover —\n // mid-animation this looks like a real wheel rolling between digits.\n const mod = raw - Math.floor(raw / 10) * 10;\n // At rest (live === target) every wheel must rest on an exact integer\n // — otherwise upper digits show as partial (e.g. tens reads \"5.6\"\n // for value 123456, visibly clipping between 5 and 6 in the\n // overflow:hidden window). The continuous-mechanical look is only\n // wanted DURING the tween, not after it settles.\n if (live === target) return Math.floor(mod + 1e-9);\n return mod;\n }\n}\n","@if (mode() === 'tween') {\n <span class=\"wr-counter__tween\">{{ prefix() }}{{ tweenText() }}{{ suffix() }}</span>\n} @else {\n <span class=\"wr-counter__sr-only\">{{ odoText() }}</span>\n <span class=\"wr-counter__odo\" aria-hidden=\"true\">\n @if (prefix()) {\n <span class=\"wr-counter__static\">{{ prefix() }}</span>\n }\n @for (cell of cells(); track $index) {\n @if (cell.kind === 'digit') {\n <span class=\"wr-counter__digit\">\n <span class=\"wr-counter__strip\" [style.transform]=\"`translateY(-${cell.fraction}em)`\">\n <span>0</span><span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span\n ><span>7</span><span>8</span><span>9</span>\n </span>\n </span>\n } @else {\n <span class=\"wr-counter__static\">{{ cell.char }}</span>\n }\n }\n @if (suffix()) {\n <span class=\"wr-counter__static\">{{ suffix() }}</span>\n }\n </span>\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n *\n * The spring-physics path is an adaptation of the CountUp effect by\n * David Haz / reactbits.dev (https://www.reactbits.dev/text-animations/count-up).\n * Same critically-damped formula, implemented inline with rAF — no\n * external dependency.\n */\n\nimport { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n Component,\n DestroyRef,\n ElementRef,\n LOCALE_ID,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { WrPlatform } from 'ngwr/platform';\nimport { numAttr } from 'ngwr/utils';\n\nimport { easeOutCubic } from './easing';\nimport type { WrCountUpDirection, WrCountUpEasing, WrCountUpTrigger } from './interfaces';\n\n/**\n * Animated number tick. Animates from `from` to the current `to`, formatting\n * via `Intl.NumberFormat`. Re-runs whenever `to` changes.\n *\n * @example Basic\n * ```html\n * <wr-count-up [to]=\"12345\" />\n * <wr-count-up [to]=\"9.99\" [decimals]=\"2\" prefix=\"$\" />\n * ```\n *\n * @example Reactbits-style — spring curve + viewport trigger\n * ```html\n * <wr-count-up [to]=\"100\" easing=\"spring\" trigger=\"visible\" [delay]=\"200\" />\n * ```\n *\n * @example Count down\n * ```html\n * <wr-count-up [from]=\"60\" [to]=\"0\" direction=\"down\" />\n * ```\n *\n * @see https://ngwr.dev/reference/components/counter\n */\n@Component({\n selector: 'wr-count-up',\n template: `{{ prefix() }}{{ formatted() }}{{ suffix() }}`,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-count-up' },\n})\nexport class WrCountUp {\n /** Starting value. @default 0 */\n readonly from = input(0, { transform: numAttr(0) });\n\n /** Target value. */\n readonly to = input.required<number>();\n\n /**\n * Animation duration. Units depend on `easing`:\n *\n * - `ease-out` — milliseconds (default 1200, min 100)\n * - `spring` — seconds (tunes spring stiffness; default 2)\n */\n readonly duration = input(1200, { transform: numAttr(1200) });\n\n /** Optional delay (ms) before the animation starts. @default 0 */\n readonly delay = input(0, { transform: numAttr(0) });\n\n /** Animation curve. @default 'ease-out' */\n readonly easing = input<WrCountUpEasing>('ease-out');\n\n /**\n * When to start the animation.\n *\n * - `'mount'` (default) — start as soon as the component is rendered.\n * - `'visible'` — wait for the host to enter the viewport\n * (IntersectionObserver). Useful for long pages or hero numbers\n * below the fold.\n */\n readonly trigger = input<WrCountUpTrigger>('mount');\n\n /** Counting direction. `'down'` swaps `from` ↔ `to`. @default 'up' */\n readonly direction = input<WrCountUpDirection>('up');\n\n /** Fixed number of decimals. @default 0 */\n readonly decimals = input(0, { transform: (v: unknown): number => Math.max(0, coerceNumberProperty(v, 0)) });\n\n /** Optional prefix (e.g. `'$'`). */\n readonly prefix = input<string>('');\n\n /** Optional suffix (e.g. `'%'`). */\n readonly suffix = input<string>('');\n\n /** Disable grouping separators (`1,234` → `1234`). @default true (grouping on) */\n readonly grouping = input<boolean>(true);\n\n /** Emits when the animation begins. */\n readonly started = output<void>();\n\n /** Emits when the animation settles. */\n readonly completed = output<void>();\n\n private readonly value = signal<number>(0);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly locale = inject(LOCALE_ID);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly platform = inject(WrPlatform);\n private readonly destroyRef = inject(DestroyRef);\n\n private rafId: number | null = null;\n private delayTimer: ReturnType<typeof setTimeout> | undefined;\n private observer: IntersectionObserver | null = null;\n private hasFiredForVisible = false;\n\n protected readonly formatted = computed(() => {\n return new Intl.NumberFormat(this.locale, {\n minimumFractionDigits: this.decimals(),\n maximumFractionDigits: this.decimals(),\n useGrouping: this.grouping(),\n }).format(this.value());\n });\n\n constructor() {\n if (!this.isBrowser) {\n // SSR: settle on the value the animation ENDS on. Seeding the start\n // instead would bake the placeholder (usually 0) into prerendered HTML,\n // so readers and crawlers would get 0 rather than the real figure. The\n // browser rewinds to the start and animates once it boots.\n effect(() => this.value.set(this.direction() === 'down' ? this.from() : this.to()));\n return;\n }\n\n // Seed the resting value so first paint shows the start, not 0 — except for a reader\n // who asked for less motion, who is seeded on the value the animation ENDS on, the\n // same way the server branch above is. Seeding the start for them would leave the\n // placeholder on screen, and with `trigger=\"visible\"` it would stay there until the\n // host scrolls into view and then never be animated off it.\n effect(() => {\n const down = this.direction() === 'down';\n const start = down ? this.to() : this.from();\n const end = down ? this.from() : this.to();\n this.value.set(this.platform.prefersReducedMotion() ? end : start);\n });\n\n // Run the animation whenever the `to` target changes (or on first mount).\n // For `trigger=\"visible\"` the first run waits for the IntersectionObserver\n // to fire; subsequent `to` changes re-run immediately.\n effect(() => {\n // Establish dependencies so the effect re-runs on `to` changes.\n this.to();\n this.from();\n this.direction();\n this.duration();\n this.easing();\n this.delay();\n\n if (this.trigger() === 'visible' && !this.hasFiredForVisible) return;\n this.scheduleRun();\n });\n\n afterNextRender(() => {\n if (this.trigger() === 'visible') this.setupViewportTrigger();\n });\n\n this.destroyRef.onDestroy(() => {\n this.cancel();\n // `cancel()` only stops timers and the rAF loop. The IntersectionObserver\n // disconnects itself from inside its callback, which never fires if the\n // host is destroyed before it ever scrolls into view — so it would keep\n // observing a detached element for the life of the page.\n this.observer?.disconnect();\n this.observer = null;\n });\n }\n\n // Scheduling\n\n private setupViewportTrigger(): void {\n this.observer = new IntersectionObserver(\n (entries, obs) => {\n for (const e of entries) {\n if (e.isIntersecting && !this.hasFiredForVisible) {\n obs.disconnect();\n this.hasFiredForVisible = true;\n this.scheduleRun();\n break;\n }\n }\n },\n { threshold: 0, rootMargin: '0px' }\n );\n this.observer.observe(this.host.nativeElement);\n }\n\n private scheduleRun(): void {\n this.cancel();\n const d = this.delay();\n if (d > 0) {\n this.delayTimer = setTimeout(() => this.run(), d);\n } else {\n this.run();\n }\n }\n\n private run(): void {\n const start = this.direction() === 'down' ? this.to() : this.from();\n const end = this.direction() === 'down' ? this.from() : this.to();\n this.started.emit();\n // Straight to the answer for a reader who asked for less motion — `wr-counter` in this\n // same folder already does this, and a component whose entire purpose is a count-up\n // should not be the one that ignores it. Both outputs still fire, in order, so a\n // consumer wired to `completed` is not left waiting on a tween that never ran.\n if (this.platform.prefersReducedMotion()) {\n this.value.set(end);\n this.completed.emit();\n return;\n }\n if (this.easing() === 'spring') this.tweenSpring(start, end);\n else this.tweenEaseOut(start, end);\n }\n\n // Tweens\n\n private tweenEaseOut(start: number, target: number): void {\n const duration = Math.max(100, this.duration());\n const startTs = performance.now();\n const tick = (now: number): void => {\n const t = Math.min(1, (now - startTs) / duration);\n const v = start + (target - start) * easeOutCubic(t);\n this.value.set(v);\n if (t < 1) {\n this.rafId = requestAnimationFrame(tick);\n } else {\n this.completed.emit();\n }\n };\n this.rafId = requestAnimationFrame(tick);\n }\n\n /**\n * Critically-damped spring tween. Same formula as `motion/react`'s\n * `useSpring` with mass = 1:\n *\n * damping = 20 + 40 / duration\n * stiffness = 100 / duration\n *\n * We integrate `(spring force − damping force)` each frame until both\n * displacement and velocity fall below epsilon.\n */\n private tweenSpring(start: number, target: number): void {\n const duration = Math.max(0.05, this.duration());\n const damping = 20 + 40 / duration;\n const stiffness = 100 / duration;\n let current = start;\n let velocity = 0;\n let lastTs = 0;\n const epsilon = 0.001 * Math.max(1, Math.abs(target - start));\n\n const step = (ts: number): void => {\n const dt = lastTs === 0 ? 1 / 60 : Math.min(0.05, (ts - lastTs) / 1000);\n lastTs = ts;\n\n const displacement = current - target;\n const accel = -stiffness * displacement - damping * velocity;\n velocity += accel * dt;\n current += velocity * dt;\n this.value.set(current);\n\n if (Math.abs(current - target) < epsilon && Math.abs(velocity) < epsilon * 10) {\n this.value.set(target);\n this.completed.emit();\n return;\n }\n this.rafId = requestAnimationFrame(step);\n };\n this.rafId = requestAnimationFrame(step);\n }\n\n // Cleanup\n\n private cancel(): void {\n if (this.rafId !== null) cancelAnimationFrame(this.rafId);\n this.rafId = null;\n if (this.delayTimer !== undefined) {\n clearTimeout(this.delayTimer);\n this.delayTimer = undefined;\n }\n }\n}\n\nexport type { WrCountUpEasing, WrCountUpTrigger, WrCountUpDirection } from './interfaces';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;AACM,SAAU,YAAY,CAAC,CAAS,EAAA;AACpC,IAAA,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAC/B;;ACHA;;;;;AAKG;AA0BH;;;;;;;;;;;;;;;;;;AAkBG;MAOU,SAAS,CAAA;;AAEpB;;;AAGG;AACM,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,OAAA,EAAA,8BAAA,EAAA,CAAA,EAC7B,SAAS,EAAE,CAAC,CAAU,KAAa,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC7D;;IAGO,IAAI,GAAG,KAAK,CAAgB,UAAU;6EAAC;;IAGvC,QAAQ,GAAG,KAAK,CAAC,GAAG,EAAA,EAAA,IAAA,SAAA,GA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A,QAAQ,EAAE,aAAa;AACvB,oBAAA,QAAQ,EAAE,CAAA,6CAAA,CAA+C;oBACzD,aAAa,EAAE,iBAAiB,CAAC,IAAI;AACrC,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;AAC/B,iBAAA;;;AC/DD;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, Service } from '@angular/core';
|
|
3
3
|
import { isValid, getYear, getMonth, getDate, getDay, getDaysInMonth, getHours, getMinutes, getSeconds, addYears, addMonths, addDays, set, isSameDay, isSameMonth, compareAsc, startOfDay, format, parse } from 'date-fns';
|
|
4
|
-
import { WrDateAdapter, WR_DATE_LOCALE, isNamedFormat, provideWrDateAdapter } from 'ngwr/date
|
|
4
|
+
import { WrDateAdapter, WR_DATE_LOCALE, isNamedFormat, provideWrDateAdapter } from 'ngwr/date';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @license
|
|
@@ -19,9 +19,31 @@ const NAMED_PATTERNS = {
|
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* {@link WrDateAdapter} backed by `date-fns`. Same `Date` value type as the
|
|
22
|
-
* native adapter, but defers all math, formatting, and parsing to date-fns
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* native adapter, but defers all math, formatting, and parsing to date-fns —
|
|
23
|
+
* pick this when you want its long patterns (`P`, `PP`, `PPP`, `p`) without
|
|
24
|
+
* writing them by hand.
|
|
25
|
+
*
|
|
26
|
+
* **{@link WR_DATE_LOCALE} does not reach `format` or `parse`, and that is not
|
|
27
|
+
* an oversight.** date-fns resolves those patterns against a date-fns `Locale`
|
|
28
|
+
* OBJECT rather than a BCP 47 tag, and the objects are separate modules —
|
|
29
|
+
* mapping a tag onto one would mean importing all of them, which defeats the
|
|
30
|
+
* tree-shaking that is the reason this is an opt-in entry point. So the named
|
|
31
|
+
* formats render AND read in en-US whatever the tag says, while
|
|
32
|
+
* `getFirstDayOfWeek`, `getDayOfWeekNames` and `getMonthNames` go through `Intl`
|
|
33
|
+
* and do honour it: a calendar heads its columns `пн вт ср` beside a trigger
|
|
34
|
+
* reading `08/11/2025`. Reading is the sharper edge — `11/08/2025` typed by a
|
|
35
|
+
* user in a dd/MM locale parses as 8 November, valid and wrong.
|
|
36
|
+
*
|
|
37
|
+
* The lever is date-fns's own module default, and the adapter passing no locale
|
|
38
|
+
* is precisely what keeps it working. Set it once at bootstrap, or take
|
|
39
|
+
* `provideWrLuxonAdapter()`, which forwards the tag itself:
|
|
40
|
+
*
|
|
41
|
+
* ```ts
|
|
42
|
+
* import { setDefaultOptions } from 'date-fns';
|
|
43
|
+
* import { ru } from 'date-fns/locale';
|
|
44
|
+
*
|
|
45
|
+
* setDefaultOptions({ locale: ru });
|
|
46
|
+
* ```
|
|
25
47
|
*
|
|
26
48
|
* @example
|
|
27
49
|
* ```ts
|
|
@@ -143,10 +165,10 @@ class WrDateFnsAdapter extends WrDateAdapter {
|
|
|
143
165
|
out.push(formatter.format(new Date(2024, i, 15)));
|
|
144
166
|
return out;
|
|
145
167
|
}
|
|
146
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
147
|
-
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.
|
|
168
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: WrDateFnsAdapter, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
169
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.2", ngImport: i0, type: WrDateFnsAdapter });
|
|
148
170
|
}
|
|
149
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: WrDateFnsAdapter, decorators: [{
|
|
150
172
|
type: Service
|
|
151
173
|
}] });
|
|
152
174
|
|
|
@@ -158,8 +180,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
|
|
|
158
180
|
*/
|
|
159
181
|
/**
|
|
160
182
|
* Register the {@link WrDateFnsAdapter} so date-pickers / calendars in this
|
|
161
|
-
* app use `date-fns` for all math and formatting.
|
|
162
|
-
*
|
|
183
|
+
* app use `date-fns` for all math and formatting.
|
|
184
|
+
*
|
|
185
|
+
* `locale` sets {@link WR_DATE_LOCALE}, which this adapter reads for the first
|
|
186
|
+
* day of the week and nothing else — its `format` and `parse` do not pass a
|
|
187
|
+
* locale to date-fns. For localized month names and patterns, set date-fns's own
|
|
188
|
+
* module default with `setDefaultOptions`, or use the luxon adapter, which does
|
|
189
|
+
* thread the tag through everything.
|
|
163
190
|
*
|
|
164
191
|
* @example
|
|
165
192
|
* ```ts
|
|
@@ -177,4 +204,4 @@ function provideWrDateFnsAdapter(options = {}) {
|
|
|
177
204
|
*/
|
|
178
205
|
|
|
179
206
|
export { WrDateFnsAdapter, provideWrDateFnsAdapter };
|
|
180
|
-
//# sourceMappingURL=ngwr-date-
|
|
207
|
+
//# sourceMappingURL=ngwr-date-adapters-fns.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngwr-date-adapters-fns.mjs","sources":["../../../projects/lib/date/adapters/fns/wr-date-fns-adapter.ts","../../../projects/lib/date/adapters/fns/provide-wr-date-fns-adapter.ts","../../../projects/lib/date/adapters/fns/ngwr-date-adapters-fns.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Service, inject } from '@angular/core';\n\nimport {\n addDays as dfAddDays,\n addMonths as dfAddMonths,\n addYears as dfAddYears,\n compareAsc,\n format as dfFormat,\n getDate,\n getDay,\n getDaysInMonth,\n getHours,\n getMinutes,\n getMonth,\n getSeconds,\n getYear,\n isSameDay,\n isSameMonth,\n isValid,\n parse as dfParse,\n set as dfSet,\n startOfDay,\n} from 'date-fns';\nimport { WrDateAdapter, WR_DATE_LOCALE, type WrDateFormat, isNamedFormat } from 'ngwr/date';\n\nconst NAMED_PATTERNS: Readonly<Record<WrDateFormat, string>> = {\n shortDate: 'P',\n mediumDate: 'PP',\n longDate: 'PPP',\n time: 'p',\n shortDateTime: 'P p',\n mediumDateTime: 'PP p',\n};\n\n/**\n * {@link WrDateAdapter} backed by `date-fns`. Same `Date` value type as the\n * native adapter, but defers all math, formatting, and parsing to date-fns —\n * pick this when you want its long patterns (`P`, `PP`, `PPP`, `p`) without\n * writing them by hand.\n *\n * **{@link WR_DATE_LOCALE} does not reach `format` or `parse`, and that is not\n * an oversight.** date-fns resolves those patterns against a date-fns `Locale`\n * OBJECT rather than a BCP 47 tag, and the objects are separate modules —\n * mapping a tag onto one would mean importing all of them, which defeats the\n * tree-shaking that is the reason this is an opt-in entry point. So the named\n * formats render AND read in en-US whatever the tag says, while\n * `getFirstDayOfWeek`, `getDayOfWeekNames` and `getMonthNames` go through `Intl`\n * and do honour it: a calendar heads its columns `пн вт ср` beside a trigger\n * reading `08/11/2025`. Reading is the sharper edge — `11/08/2025` typed by a\n * user in a dd/MM locale parses as 8 November, valid and wrong.\n *\n * The lever is date-fns's own module default, and the adapter passing no locale\n * is precisely what keeps it working. Set it once at bootstrap, or take\n * `provideWrLuxonAdapter()`, which forwards the tag itself:\n *\n * ```ts\n * import { setDefaultOptions } from 'date-fns';\n * import { ru } from 'date-fns/locale';\n *\n * setDefaultOptions({ locale: ru });\n * ```\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideWrDateFnsAdapter()],\n * });\n * ```\n *\n * Peer dep: `date-fns@^3` (or `^4`).\n */\n@Service()\nexport class WrDateFnsAdapter extends WrDateAdapter<Date> {\n private readonly locale = inject(WR_DATE_LOCALE);\n\n // Construction & identity\n\n today(): Date {\n return new Date();\n }\n\n clone(date: Date): Date {\n return new Date(date.getTime());\n }\n\n createDate(year: number, month: number, day: number): Date {\n const d = new Date(year, month, day);\n if (year >= 0 && year < 100) d.setFullYear(year);\n return d;\n }\n\n isValid(date: Date): boolean {\n return isValid(date);\n }\n\n // Accessors\n\n getYear(date: Date): number {\n return getYear(date);\n }\n getMonth(date: Date): number {\n return getMonth(date);\n }\n getDate(date: Date): number {\n return getDate(date);\n }\n getDayOfWeek(date: Date): number {\n return getDay(date);\n }\n getDaysInMonth(date: Date): number {\n return getDaysInMonth(date);\n }\n getHours(date: Date): number {\n return getHours(date);\n }\n getMinutes(date: Date): number {\n return getMinutes(date);\n }\n getSeconds(date: Date): number {\n return getSeconds(date);\n }\n\n // Immutable math\n\n addYears(date: Date, amount: number): Date {\n return dfAddYears(date, amount);\n }\n addMonths(date: Date, amount: number): Date {\n return dfAddMonths(date, amount);\n }\n addDays(date: Date, amount: number): Date {\n return dfAddDays(date, amount);\n }\n setTime(date: Date, hours: number, minutes: number, seconds: number): Date {\n return dfSet(date, { hours, minutes, seconds, milliseconds: 0 });\n }\n\n // Comparison\n\n isSameDay(a: Date, b: Date): boolean {\n return isSameDay(a, b);\n }\n isSameMonth(a: Date, b: Date): boolean {\n return isSameMonth(a, b);\n }\n compareDate(a: Date, b: Date): number {\n return compareAsc(startOfDay(a), startOfDay(b));\n }\n\n // Formatting / parsing\n\n format(date: Date, formatKeyOrString: WrDateFormat | (string & {})): string {\n const pattern = isNamedFormat(formatKeyOrString) ? NAMED_PATTERNS[formatKeyOrString] : formatKeyOrString;\n return dfFormat(date, pattern);\n }\n\n parse(value: string, formatKeyOrString: WrDateFormat | (string & {})): Date | null {\n const raw = value?.trim();\n if (!raw) return null;\n const pattern = isNamedFormat(formatKeyOrString) ? NAMED_PATTERNS[formatKeyOrString] : formatKeyOrString;\n const result = dfParse(raw, pattern, new Date());\n return isValid(result) ? result : null;\n }\n\n // Locale info\n\n getFirstDayOfWeek(): number {\n try {\n const locale = new Intl.Locale(this.locale) as unknown as { getWeekInfo?: () => { firstDay: number } };\n const info = locale.getWeekInfo?.();\n if (info && typeof info.firstDay === 'number') return info.firstDay % 7;\n } catch {\n // Intl.Locale unsupported — fall through.\n }\n return this.locale.toLowerCase().startsWith('en-us') ? 0 : 1;\n }\n\n getDayOfWeekNames(style: 'narrow' | 'short' | 'long'): readonly string[] {\n const formatter = new Intl.DateTimeFormat(this.locale, { weekday: style });\n const first = this.getFirstDayOfWeek();\n const base = new Date(2024, 0, 7); // Sunday\n const out: string[] = [];\n for (let i = 0; i < 7; i++) {\n const d = new Date(base);\n d.setDate(base.getDate() + ((first + i) % 7));\n out.push(formatter.format(d));\n }\n return out;\n }\n\n getMonthNames(style: 'narrow' | 'short' | 'long'): readonly string[] {\n const formatter = new Intl.DateTimeFormat(this.locale, { month: style });\n const out: string[] = [];\n for (let i = 0; i < 12; i++) out.push(formatter.format(new Date(2024, i, 15)));\n return out;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { EnvironmentProviders } from '@angular/core';\n\nimport { provideWrDateAdapter } from 'ngwr/date';\n\nimport { WrDateFnsAdapter } from './wr-date-fns-adapter';\n\n/**\n * Register the {@link WrDateFnsAdapter} so date-pickers / calendars in this\n * app use `date-fns` for all math and formatting.\n *\n * `locale` sets {@link WR_DATE_LOCALE}, which this adapter reads for the first\n * day of the week and nothing else — its `format` and `parse` do not pass a\n * locale to date-fns. For localized month names and patterns, set date-fns's own\n * module default with `setDefaultOptions`, or use the luxon adapter, which does\n * thread the tag through everything.\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideWrDateFnsAdapter()],\n * });\n * ```\n */\nexport function provideWrDateFnsAdapter(options: { readonly locale?: string } = {}): EnvironmentProviders {\n return provideWrDateAdapter({ adapter: WrDateFnsAdapter, locale: options.locale });\n}\n","/**\n * Generated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;;;;;;;;;AAgBG;AACG,SAAU,uBAAuB,CAAC,OAAA,GAAwC,EAAE,EAAA;AAChF,IAAA,OAAO,oBAAoB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AACpF;;AChCA;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, Service } from '@angular/core';
|
|
3
3
|
import { DateTime, Info } from 'luxon';
|
|
4
|
-
import { WrDateAdapter, WR_DATE_LOCALE, isNamedFormat, provideWrDateAdapter } from 'ngwr/date
|
|
4
|
+
import { WrDateAdapter, WR_DATE_LOCALE, isNamedFormat, provideWrDateAdapter } from 'ngwr/date';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @license
|
|
@@ -212,10 +212,10 @@ class WrLuxonAdapter extends WrDateAdapter {
|
|
|
212
212
|
getMonthNames(style) {
|
|
213
213
|
return Info.months(style, { locale: this.locale });
|
|
214
214
|
}
|
|
215
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
216
|
-
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.
|
|
215
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: WrLuxonAdapter, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
216
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.2", ngImport: i0, type: WrLuxonAdapter });
|
|
217
217
|
}
|
|
218
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
218
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: WrLuxonAdapter, decorators: [{
|
|
219
219
|
type: Service
|
|
220
220
|
}] });
|
|
221
221
|
|
|
@@ -246,4 +246,4 @@ function provideWrLuxonAdapter(options = {}) {
|
|
|
246
246
|
*/
|
|
247
247
|
|
|
248
248
|
export { WrLuxonAdapter, provideWrLuxonAdapter };
|
|
249
|
-
//# sourceMappingURL=ngwr-date-
|
|
249
|
+
//# sourceMappingURL=ngwr-date-adapters-luxon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngwr-date-adapters-luxon.mjs","sources":["../../../projects/lib/date/adapters/luxon/wr-luxon-adapter.ts","../../../projects/lib/date/adapters/luxon/provide-wr-luxon-adapter.ts","../../../projects/lib/date/adapters/luxon/ngwr-date-adapters-luxon.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Service, inject } from '@angular/core';\n\nimport { DateTime, Info } from 'luxon';\nimport { WrDateAdapter, WR_DATE_LOCALE, type WrDateFormat, isNamedFormat } from 'ngwr/date';\n\nconst NAMED_PATTERNS: Readonly<Record<WrDateFormat, string>> = {\n shortDate: 'D',\n mediumDate: 'DD',\n longDate: 'DDD',\n time: 't',\n shortDateTime: 'f',\n mediumDateTime: 'ff',\n};\n\n/**\n * Token translation table — our token grammar (matches the native adapter)\n * mapped to luxon's. Notably `MMMM`/`MMM` (month names) become luxon's\n * standalone-month tokens `LLLL`/`LLL`.\n */\nconst TOKEN_MAP: Readonly<Record<string, string>> = {\n yyyy: 'yyyy',\n yy: 'yy',\n MMMM: 'LLLL',\n MMM: 'LLL',\n MM: 'MM',\n M: 'M',\n dd: 'dd',\n d: 'd',\n HH: 'HH',\n H: 'H',\n hh: 'hh',\n h: 'h',\n mm: 'mm',\n ss: 'ss',\n a: 'a',\n};\n\nconst TOKEN_RE = /yyyy|yy|MMMM|MMM|MM|M|dd|d|HH|H|hh|h|mm|ss|a/g;\n\n/**\n * A quoted literal, in Luxon's own syntax: text between single quotes, where\n * `''` is an escaped quote. Split on this and the odd-numbered pieces are the\n * literals — which must reach Luxon untouched.\n */\nconst QUOTED_RE = /('(?:[^']|'')*')/;\n\n/**\n * Rewrite the library's tokens into Luxon's, LEAVING QUOTED TEXT ALONE.\n *\n * The tokens are mostly shared, but a few are not — `MMMM` is Luxon's standalone\n * `LLLL`, for one — so the pattern is translated on the way in. Doing that over\n * the whole string also rewrote the caller's own literals: `\"MMMM 'MMMM'\"`, a\n * month name followed by the word, printed \"August LLLL\". Splitting on quotes\n * first keeps the substitution where it belongs.\n */\nfunction translatePattern(pattern: string): string {\n return pattern\n .split(QUOTED_RE)\n .map((part, index) => (index % 2 === 1 ? part : part.replace(TOKEN_RE, t => TOKEN_MAP[t] ?? t)))\n .join('');\n}\n\n/**\n * {@link WrDateAdapter} backed by Luxon `DateTime`. Use this when you need\n * proper timezone-aware math or IANA zone handling (the native + date-fns\n * adapters both work on plain `Date` and inherit JS quirks).\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideWrLuxonAdapter()],\n * });\n * ```\n *\n * Peer dep: `luxon@^3`.\n */\n@Service()\nexport class WrLuxonAdapter extends WrDateAdapter<DateTime> {\n private readonly locale = inject(WR_DATE_LOCALE);\n\n // Construction & identity\n\n today(): DateTime {\n return DateTime.now().setLocale(this.locale);\n }\n\n clone(date: DateTime): DateTime {\n return DateTime.fromMillis(date.toMillis(), { zone: date.zone, locale: this.locale });\n }\n\n createDate(year: number, month: number, day: number): DateTime {\n // `month` is 0-based on our API; luxon's months are 1-based.\n return DateTime.fromObject({ year, month: month + 1, day }, { locale: this.locale });\n }\n\n isValid(date: DateTime): boolean {\n return date.isValid;\n }\n\n // Accessors\n\n getYear(date: DateTime): number {\n return date.year;\n }\n getMonth(date: DateTime): number {\n return date.month - 1;\n }\n getDate(date: DateTime): number {\n return date.day;\n }\n getDayOfWeek(date: DateTime): number {\n // Luxon weekday: 1 (Mon) – 7 (Sun). Our API: 0 (Sun) – 6 (Sat).\n return date.weekday % 7;\n }\n getDaysInMonth(date: DateTime): number {\n return date.daysInMonth ?? 30;\n }\n getHours(date: DateTime): number {\n return date.hour;\n }\n getMinutes(date: DateTime): number {\n return date.minute;\n }\n getSeconds(date: DateTime): number {\n return date.second;\n }\n\n // Immutable math\n\n addYears(date: DateTime, amount: number): DateTime {\n return date.plus({ years: amount });\n }\n addMonths(date: DateTime, amount: number): DateTime {\n return date.plus({ months: amount });\n }\n addDays(date: DateTime, amount: number): DateTime {\n return date.plus({ days: amount });\n }\n setTime(date: DateTime, hours: number, minutes: number, seconds: number): DateTime {\n return date.set({ hour: hours, minute: minutes, second: seconds, millisecond: 0 });\n }\n\n // Comparison\n\n /**\n * The comparison trio, all three answering the same question: what CALENDAR DAY\n * does each value display?\n *\n * Field comparison rather than Luxon's own helpers, and deliberately. This\n * adapter exists for zone-aware apps, so its values do not all share a zone —\n * the grid is built with `createDate` in the app's zone while the selected value\n * may arrive as `DateTime.utc()`. Two things went wrong when the zone was left\n * in the answer:\n *\n * `compareDate` subtracted `startOf('day')` millis, and `startOf` respects each\n * value's OWN zone, so two values both reading \"1 August\" came out three hours\n * apart. Non-zero means \"different day\" to every caller — including\n * `isWithinRange`, which the base class documents as inclusive and which\n * therefore dropped its own endpoint.\n *\n * `hasSame` is the other tempting one-liner, and it asks a third question: it\n * re-expresses one side in the other's zone and tests that instant against the\n * day's bounds. That mostly agrees with a field comparison — but only mostly,\n * and only in this version of luxon, whose `hasSame` keeps the local time\n * while an earlier one kept the instant. Where a date's midnight is ambiguous\n * or missing (Cuba rewinds 01:00 to 00:00 on 2 November 2025) the bounds stop\n * lining up and it answers false for two values a user reads as the same date.\n * The native adapter compares fields; agreeing with it is what keeps a\n * calendar built on either adapter rendering the same thing.\n */\n isSameDay(a: DateTime, b: DateTime): boolean {\n return a.year === b.year && a.month === b.month && a.day === b.day;\n }\n isSameMonth(a: DateTime, b: DateTime): boolean {\n return a.year === b.year && a.month === b.month;\n }\n compareDate(a: DateTime, b: DateTime): number {\n if (a.year !== b.year) return a.year - b.year;\n if (a.month !== b.month) return a.month - b.month;\n return a.day - b.day;\n }\n\n // Formatting / parsing\n\n format(date: DateTime, formatKeyOrString: WrDateFormat | (string & {})): string {\n if (isNamedFormat(formatKeyOrString)) {\n return date.setLocale(this.locale).toFormat(NAMED_PATTERNS[formatKeyOrString]);\n }\n return date.setLocale(this.locale).toFormat(translatePattern(formatKeyOrString));\n }\n\n parse(value: string, formatKeyOrString: WrDateFormat | (string & {})): DateTime | null {\n const raw = value?.trim();\n if (!raw) return null;\n const pattern = isNamedFormat(formatKeyOrString)\n ? NAMED_PATTERNS[formatKeyOrString]\n : translatePattern(formatKeyOrString);\n const parsed = DateTime.fromFormat(raw, pattern, { locale: this.locale });\n return parsed.isValid ? parsed : null;\n }\n\n // Locale info\n\n getFirstDayOfWeek(): number {\n try {\n const locale = new Intl.Locale(this.locale) as unknown as { getWeekInfo?: () => { firstDay: number } };\n const info = locale.getWeekInfo?.();\n if (info && typeof info.firstDay === 'number') return info.firstDay % 7;\n } catch {\n // Intl.Locale unsupported — fall through.\n }\n return this.locale.toLowerCase().startsWith('en-us') ? 0 : 1;\n }\n\n getDayOfWeekNames(style: 'narrow' | 'short' | 'long'): readonly string[] {\n // Luxon returns Mon-first; reorder according to our locale's first day.\n const names = Info.weekdays(style, { locale: this.locale });\n const first = this.getFirstDayOfWeek();\n // Convert Mon-first (index 0 = Mon) to our Sun-first then rotate.\n // Easier: pad to Sun-first using known offset (luxon Mon=0, Sun=6).\n const sunFirst = [names[6], ...names.slice(0, 6)];\n return [...sunFirst.slice(first), ...sunFirst.slice(0, first)];\n }\n\n getMonthNames(style: 'narrow' | 'short' | 'long'): readonly string[] {\n return Info.months(style, { locale: this.locale });\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport type { EnvironmentProviders } from '@angular/core';\n\nimport { provideWrDateAdapter } from 'ngwr/date';\n\nimport { WrLuxonAdapter } from './wr-luxon-adapter';\n\n/**\n * Register the {@link WrLuxonAdapter} so date-pickers / calendars in this\n * app use Luxon `DateTime` for all math and formatting. Pass `locale` to\n * override the BCP 47 tag.\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideWrLuxonAdapter()],\n * });\n * ```\n */\nexport function provideWrLuxonAdapter(options: { readonly locale?: string } = {}): EnvironmentProviders {\n return provideWrDateAdapter({ adapter: WrLuxonAdapter, locale: options.locale });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAAA;;;;;AAKG;AAOH,MAAM,cAAc,GAA2C;AAC7D,IAAA,SAAS,EAAE,GAAG;AACd,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,QAAQ,EAAE,KAAK;AACf,IAAA,IAAI,EAAE,GAAG;AACT,IAAA,aAAa,EAAE,GAAG;AAClB,IAAA,cAAc,EAAE,IAAI;CACrB;AAED;;;;AAIG;AACH,MAAM,SAAS,GAAqC;AAClD,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,GAAG,EAAE,KAAK;AACV,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,CAAC,EAAE,GAAG;AACN,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,CAAC,EAAE,GAAG;AACN,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,CAAC,EAAE,GAAG;AACN,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,CAAC,EAAE,GAAG;AACN,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,EAAE,EAAE,IAAI;AACR,IAAA,CAAC,EAAE,GAAG;CACP;AAED,MAAM,QAAQ,GAAG,+CAA+C;AAEhE;;;;AAIG;AACH,MAAM,SAAS,GAAG,kBAAkB;AAEpC;;;;;;;;AAQG;AACH,SAAS,gBAAgB,CAAC,OAAe,EAAA;AACvC,IAAA,OAAO;SAC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;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B;;;ACnFD;;;;;AAKG;AAQH;;;;;;;;;;;AAWG;AACG,SAAU,qBAAqB,CAAC,OAAA,GAAwC,EAAE,EAAA;AAC9E,IAAA,OAAO,oBAAoB,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;AAClF;;AC3BA;;AAEG;;;;"}
|
|
@@ -40,16 +40,16 @@ function missingColumn(unit, method) {
|
|
|
40
40
|
* independently instead of by CSS nth-of-type gymnastics.
|
|
41
41
|
*
|
|
42
42
|
* Units are addressed by position, not by the boxes' `aria-label`: every string
|
|
43
|
-
* in this panel
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* is the layout contract.
|
|
43
|
+
* in this panel now resolves through the i18n catalog (`datePicker.hours`,
|
|
44
|
+
* `datePicker.incrementHours`, `datePicker.am` …), so keying on them would make
|
|
45
|
+
* this harness answer in whatever locale the app under test is configured for.
|
|
46
|
+
* Column order is the layout contract.
|
|
47
47
|
*
|
|
48
48
|
* @internal
|
|
49
49
|
*/
|
|
50
50
|
class WrTimePanelHarness extends ComponentHarness {
|
|
51
51
|
static hostSelector = '.wr-time-picker';
|
|
52
|
-
/** The stepper's value as `HH:MM`, plus `:SS` and
|
|
52
|
+
/** The stepper's value as `HH:MM`, plus `:SS` and a space-joined {@link getMeridiem} when those columns exist. */
|
|
53
53
|
async getTimeText() {
|
|
54
54
|
const parts = [await this.getValue('hours'), await this.getValue('minutes')];
|
|
55
55
|
const seconds = await this.getOptionalValue('seconds');
|
|
@@ -58,7 +58,12 @@ class WrTimePanelHarness extends ComponentHarness {
|
|
|
58
58
|
const meridiem = await this.getMeridiem();
|
|
59
59
|
return meridiem ? `${parts.join(':')} ${meridiem}` : parts.join(':');
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* The meridiem column's rendered text, or `null` when the stepper is in
|
|
63
|
+
* 24-hour mode. `'AM'` / `'PM'` on the built-in fallbacks — it reads whatever
|
|
64
|
+
* `datePicker.am` / `datePicker.pm` resolve to, so a configured catalog
|
|
65
|
+
* changes the answer.
|
|
66
|
+
*/
|
|
62
67
|
async getMeridiem() {
|
|
63
68
|
const label = await this.locatorForOptional('.wr-time-picker__label')();
|
|
64
69
|
return label ? label.text() : null;
|