ngwr 16.1.0 → 16.3.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/badge/styles/_tag.scss +73 -1
- package/calendar/styles/_index.scss +22 -0
- package/cascader/styles/_rules.scss +7 -0
- package/color-picker/styles/_index.scss +21 -0
- package/date-picker/styles/_index.scss +108 -1
- package/dropdown/styles/_index.scss +40 -10
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert-testing.mjs +70 -0
- package/fesm2022/ngwr-alert-testing.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +17 -6
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-aurora.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
- package/fesm2022/ngwr-animations-confetti.mjs +3 -3
- package/fesm2022/ngwr-animations-decode.mjs +3 -3
- package/fesm2022/ngwr-animations-destruct.mjs +3 -3
- package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
- package/fesm2022/ngwr-animations-glitch.mjs +3 -3
- package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
- package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
- package/fesm2022/ngwr-animations-marquee.mjs +3 -3
- package/fesm2022/ngwr-animations-orbit.mjs +3 -3
- package/fesm2022/ngwr-animations-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
- package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
- package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-tilt.mjs +3 -3
- package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +129 -11
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs-testing.mjs +83 -0
- package/fesm2022/ngwr-breadcrumbs-testing.mjs.map +1 -0
- package/fesm2022/ngwr-breadcrumbs.mjs +8 -8
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger-testing.mjs +45 -0
- package/fesm2022/ngwr-burger-testing.mjs.map +1 -0
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +6 -6
- package/fesm2022/ngwr-calendar-testing.mjs +18 -0
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +500 -73
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-cascader.mjs +37 -16
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-chart-legend.mjs +26 -11
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +3 -3
- package/fesm2022/ngwr-charts-donut-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-gauge.mjs +3 -3
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-line-chart-testing.mjs +3 -2
- package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +17 -7
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +5 -4
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
- package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker-testing.mjs +11 -1
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +153 -37
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-comment.mjs +10 -6
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare-testing.mjs +84 -0
- package/fesm2022/ngwr-compare-testing.mjs.map +1 -0
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +12 -12
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-copy-value.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-picker-testing.mjs +48 -4
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +492 -75
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +76 -12
- package/fesm2022/ngwr-date-stamp.mjs.map +1 -1
- package/fesm2022/ngwr-date.mjs +144 -12
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +18 -18
- package/fesm2022/ngwr-directives.mjs +15 -15
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs +51 -29
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs +48 -5
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +407 -116
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +4 -3
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +186 -33
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +34 -2
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +274 -15
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +9 -9
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +3 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +102 -42
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +26 -6
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +26 -6
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +26 -6
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +26 -6
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +26 -6
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +26 -6
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +26 -6
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +26 -6
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +26 -6
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +26 -6
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +26 -6
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +26 -6
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +26 -6
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +26 -6
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +26 -6
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +26 -6
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +26 -6
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +26 -6
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +26 -6
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +26 -6
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +26 -6
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +26 -6
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +9 -9
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper.mjs +3 -3
- package/fesm2022/ngwr-input-number-testing.mjs +11 -0
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +68 -7
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +23 -3
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs +24 -1
- package/fesm2022/ngwr-input-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +152 -36
- package/fesm2022/ngwr-input.mjs.map +1 -1
- 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-testing.mjs +26 -0
- package/fesm2022/ngwr-lightbox-testing.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +249 -13
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +8 -8
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +15 -15
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-overlay.mjs +175 -13
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination.mjs +5 -3
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +57 -33
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm-testing.mjs +5 -2
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +44 -63
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +7 -1
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +58 -156
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +50 -9
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh-testing.mjs +57 -0
- package/fesm2022/ngwr-pull-to-refresh-testing.mjs.map +1 -0
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-resizable-testing.mjs +113 -0
- package/fesm2022/ngwr-resizable-testing.mjs.map +1 -0
- package/fesm2022/ngwr-resizable.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-schema-form-testing.mjs +336 -0
- package/fesm2022/ngwr-schema-form-testing.mjs.map +1 -0
- package/fesm2022/ngwr-schema-form.mjs +418 -19
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-select-testing.mjs +19 -0
- package/fesm2022/ngwr-select-testing.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +263 -83
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar-testing.mjs +176 -0
- package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -0
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider-testing.mjs +23 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +108 -14
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list-testing.mjs +103 -0
- package/fesm2022/ngwr-sortable-list-testing.mjs.map +1 -0
- package/fesm2022/ngwr-sortable-list.mjs +284 -63
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper.mjs +42 -11
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table-testing.mjs +88 -2
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +891 -74
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +3 -3
- package/fesm2022/ngwr-tabs-testing.mjs +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +15 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs +11 -0
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +128 -16
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +40 -19
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +6 -6
- package/fesm2022/ngwr-transfer-testing.mjs +6 -0
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +24 -5
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +62 -2
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +966 -78
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-utils-router.mjs +3 -3
- package/fesm2022/ngwr-utils.mjs +34 -1
- 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 +3 -3
- package/fesm2022/ngwr-window.mjs +33 -22
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +156 -0
- package/i18n/ar.json +28 -6
- package/i18n/cs.json +28 -6
- package/i18n/de.json +28 -6
- package/i18n/en.json +28 -6
- package/i18n/es.json +28 -6
- package/i18n/fr.json +28 -6
- package/i18n/he.json +28 -6
- package/i18n/hi.json +28 -6
- package/i18n/id.json +28 -6
- package/i18n/it.json +28 -6
- package/i18n/ja.json +28 -6
- package/i18n/ko.json +28 -6
- package/i18n/nl.json +28 -6
- package/i18n/pl.json +28 -6
- package/i18n/pt.json +28 -6
- package/i18n/ru.json +28 -6
- package/i18n/sv.json +28 -6
- package/i18n/tr.json +28 -6
- package/i18n/uk.json +28 -6
- package/i18n/vi.json +28 -6
- package/i18n/zh-TW.json +28 -6
- package/i18n/zh.json +28 -6
- package/input/styles/_index.scss +68 -1
- package/input-otp/styles/_index.scss +14 -0
- package/lightbox/styles/_rules.scss +96 -0
- package/llms-full.txt +61 -25
- package/llms.txt +12 -0
- package/overlay/styles/_arrow.scss +4 -4
- package/package.json +37 -1
- package/popconfirm/styles/_index.scss +3 -11
- package/progress/styles/_index.scss +32 -0
- package/schema-form/styles/_index.scss +78 -0
- package/schematics/use/rule.js +2 -0
- package/schematics/use/symbol-map.json +5 -0
- package/select/styles/_index.scss +114 -22
- package/skills/ngwr/SKILL.md +1 -1
- package/skills/ngwr/references/catalog.md +11 -2
- package/slider/styles/_index.scss +128 -0
- package/sortable-list/styles/_rules.scss +23 -1
- package/table/styles/_index.scss +167 -3
- package/textarea/styles/_index.scss +80 -0
- package/theme/styles/_focus.scss +5 -0
- package/theme/styles/_motion.scss +5 -0
- package/transfer/styles/_index.scss +84 -0
- package/tree/styles/_index.scss +138 -5
- package/types/ngwr-alert-testing.d.ts +88 -0
- package/types/ngwr-badge.d.ts +72 -2
- package/types/ngwr-breadcrumbs-testing.d.ts +92 -0
- package/types/ngwr-burger-testing.d.ts +51 -0
- package/types/ngwr-calendar-testing.d.ts +18 -6
- package/types/ngwr-calendar.d.ts +272 -22
- package/types/ngwr-cascader.d.ts +10 -1
- package/types/ngwr-charts-chart-legend.d.ts +9 -4
- package/types/ngwr-charts-line-chart-testing.d.ts +4 -1
- package/types/ngwr-charts-line-chart.d.ts +7 -4
- package/types/ngwr-color-picker-testing.d.ts +15 -4
- package/types/ngwr-color-picker.d.ts +76 -6
- package/types/ngwr-compare-testing.d.ts +72 -0
- package/types/ngwr-date-picker-testing.d.ts +40 -8
- package/types/ngwr-date-picker.d.ts +178 -10
- package/types/ngwr-date-stamp-testing.d.ts +1 -1
- package/types/ngwr-date-stamp.d.ts +53 -7
- package/types/ngwr-date.d.ts +188 -15
- package/types/ngwr-drawer.d.ts +9 -0
- package/types/ngwr-dropdown-testing.d.ts +73 -5
- package/types/ngwr-dropdown.d.ts +124 -6
- package/types/ngwr-event-calendar.d.ts +66 -8
- package/types/ngwr-file-upload-testing.d.ts +31 -2
- package/types/ngwr-file-upload.d.ts +148 -1
- package/types/ngwr-form.d.ts +47 -3
- package/types/ngwr-graph-testing.d.ts +8 -3
- package/types/ngwr-graph.d.ts +147 -7
- package/types/ngwr-input-number-testing.d.ts +10 -0
- package/types/ngwr-input-number.d.ts +30 -1
- package/types/ngwr-input-otp.d.ts +10 -0
- package/types/ngwr-input-testing.d.ts +30 -0
- package/types/ngwr-input.d.ts +54 -3
- package/types/ngwr-lightbox-testing.d.ts +27 -0
- package/types/ngwr-lightbox.d.ts +71 -6
- package/types/ngwr-overlay.d.ts +84 -5
- package/types/ngwr-pipes.d.ts +34 -13
- package/types/ngwr-popconfirm-testing.d.ts +12 -3
- package/types/ngwr-popconfirm.d.ts +28 -3
- package/types/ngwr-popover-testing.d.ts +19 -2
- package/types/ngwr-popover.d.ts +22 -2
- package/types/ngwr-progress.d.ts +29 -1
- package/types/ngwr-pull-to-refresh-testing.d.ts +83 -0
- package/types/ngwr-resizable-testing.d.ts +116 -0
- package/types/ngwr-schema-form-testing.d.ts +260 -0
- package/types/ngwr-schema-form.d.ts +76 -6
- package/types/ngwr-select-testing.d.ts +20 -0
- package/types/ngwr-select.d.ts +112 -11
- package/types/ngwr-sidebar-testing.d.ts +176 -0
- package/types/ngwr-slider-testing.d.ts +10 -1
- package/types/ngwr-slider.d.ts +109 -3
- package/types/ngwr-sortable-list-testing.d.ts +79 -0
- package/types/ngwr-sortable-list.d.ts +119 -10
- package/types/ngwr-stepper.d.ts +20 -11
- package/types/ngwr-table-testing.d.ts +70 -6
- package/types/ngwr-table.d.ts +480 -50
- package/types/ngwr-tabs-testing.d.ts +14 -17
- package/types/ngwr-tabs.d.ts +6 -0
- package/types/ngwr-textarea-testing.d.ts +10 -0
- package/types/ngwr-textarea.d.ts +48 -2
- package/types/ngwr-toast.d.ts +8 -1
- package/types/ngwr-transfer-testing.d.ts +3 -0
- package/types/ngwr-transfer.d.ts +24 -1
- package/types/ngwr-tree-testing.d.ts +65 -1
- package/types/ngwr-tree.d.ts +333 -12
- package/types/ngwr-utils.d.ts +28 -0
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +7 -4
|
@@ -4,11 +4,11 @@ import { coerceBooleanProperty, coerceNumberProperty } from "@angular/cdk/coerci
|
|
|
4
4
|
import { wrCheckStyles, wrClamp, wrGetFocusableElements, wrToClassList } from "ngwr/utils";
|
|
5
5
|
import { useI18nFormatter, useI18nText, wrReadI18nText } from "ngwr/i18n";
|
|
6
6
|
import { Directionality } from "@angular/cdk/bidi";
|
|
7
|
-
import { WrDateAdapter, wrDateLocale } from "ngwr/date";
|
|
7
|
+
import { WrDateAdapter, wrDateLocale, wrPeriodEnd, wrPeriodStart, wrWeekOfYear, wrWeekStart } from "ngwr/date";
|
|
8
|
+
import { WR_FORM_FIELD } from "ngwr/form";
|
|
8
9
|
import { ScrollStrategyOptions } from "@angular/cdk/overlay";
|
|
9
10
|
import { ComponentPortal } from "@angular/cdk/portal";
|
|
10
11
|
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
11
|
-
import { WR_FORM_FIELD } from "ngwr/form";
|
|
12
12
|
import { WR_OVERLAY, WrOutsideClick, wrFollowDirection, wrFollowSize } from "ngwr/overlay";
|
|
13
13
|
import { WrCalendar } from "ngwr/calendar";
|
|
14
14
|
import { WrInput, WrInputGroup, WrInputSuffix } from "ngwr/input";
|
|
@@ -256,7 +256,7 @@ var WrTimePanel = class WrTimePanel {
|
|
|
256
256
|
}
|
|
257
257
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
258
258
|
minVersion: "12.0.0",
|
|
259
|
-
version: "22.2.
|
|
259
|
+
version: "22.2.6",
|
|
260
260
|
ngImport: i0,
|
|
261
261
|
type: WrTimePanel,
|
|
262
262
|
deps: [],
|
|
@@ -264,7 +264,7 @@ var WrTimePanel = class WrTimePanel {
|
|
|
264
264
|
});
|
|
265
265
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
266
266
|
minVersion: "17.0.0",
|
|
267
|
-
version: "22.2.
|
|
267
|
+
version: "22.2.6",
|
|
268
268
|
type: WrTimePanel,
|
|
269
269
|
isStandalone: true,
|
|
270
270
|
selector: "wr-time-picker",
|
|
@@ -334,7 +334,7 @@ var WrTimePanel = class WrTimePanel {
|
|
|
334
334
|
};
|
|
335
335
|
i0.ɵɵngDeclareClassMetadata({
|
|
336
336
|
minVersion: "12.0.0",
|
|
337
|
-
version: "22.2.
|
|
337
|
+
version: "22.2.6",
|
|
338
338
|
ngImport: i0,
|
|
339
339
|
type: WrTimePanel,
|
|
340
340
|
decorators: [{
|
|
@@ -458,7 +458,7 @@ var WrDateTimePanel = class WrDateTimePanel {
|
|
|
458
458
|
}
|
|
459
459
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
460
460
|
minVersion: "12.0.0",
|
|
461
|
-
version: "22.2.
|
|
461
|
+
version: "22.2.6",
|
|
462
462
|
ngImport: i0,
|
|
463
463
|
type: WrDateTimePanel,
|
|
464
464
|
deps: [],
|
|
@@ -466,7 +466,7 @@ var WrDateTimePanel = class WrDateTimePanel {
|
|
|
466
466
|
});
|
|
467
467
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
468
468
|
minVersion: "17.2.0",
|
|
469
|
-
version: "22.2.
|
|
469
|
+
version: "22.2.6",
|
|
470
470
|
type: WrDateTimePanel,
|
|
471
471
|
isStandalone: true,
|
|
472
472
|
selector: "wr-date-time-panel",
|
|
@@ -552,15 +552,33 @@ var WrDateTimePanel = class WrDateTimePanel {
|
|
|
552
552
|
selector: "wr-calendar",
|
|
553
553
|
inputs: [
|
|
554
554
|
"mode",
|
|
555
|
+
"granularity",
|
|
555
556
|
"date",
|
|
556
557
|
"range",
|
|
558
|
+
"value",
|
|
557
559
|
"min",
|
|
558
560
|
"max",
|
|
559
561
|
"dateFilter",
|
|
560
562
|
"autoFocus",
|
|
561
|
-
"disabled"
|
|
563
|
+
"disabled",
|
|
564
|
+
"readonly",
|
|
565
|
+
"ariaLabel",
|
|
566
|
+
"prevMonthLabel",
|
|
567
|
+
"nextMonthLabel",
|
|
568
|
+
"monthListLabel",
|
|
569
|
+
"yearListLabel",
|
|
570
|
+
"quarterListLabel",
|
|
571
|
+
"prevYearLabel",
|
|
572
|
+
"nextYearLabel",
|
|
573
|
+
"prevYearsLabel",
|
|
574
|
+
"nextYearsLabel"
|
|
562
575
|
],
|
|
563
|
-
outputs: [
|
|
576
|
+
outputs: [
|
|
577
|
+
"dateChange",
|
|
578
|
+
"rangeChange",
|
|
579
|
+
"valueChange",
|
|
580
|
+
"touch"
|
|
581
|
+
]
|
|
564
582
|
}, {
|
|
565
583
|
kind: "component",
|
|
566
584
|
type: WrTimePanel,
|
|
@@ -581,7 +599,7 @@ var WrDateTimePanel = class WrDateTimePanel {
|
|
|
581
599
|
};
|
|
582
600
|
i0.ɵɵngDeclareClassMetadata({
|
|
583
601
|
minVersion: "12.0.0",
|
|
584
|
-
version: "22.2.
|
|
602
|
+
version: "22.2.6",
|
|
585
603
|
ngImport: i0,
|
|
586
604
|
type: WrDateTimePanel,
|
|
587
605
|
decorators: [{
|
|
@@ -706,9 +724,16 @@ function useDateInputRefusals(pick) {
|
|
|
706
724
|
message: formatText({ example })
|
|
707
725
|
};
|
|
708
726
|
},
|
|
709
|
-
|
|
727
|
+
unreadableAs(example) {
|
|
728
|
+
return {
|
|
729
|
+
kind: "dateFormat",
|
|
730
|
+
example,
|
|
731
|
+
message: formatText({ example })
|
|
732
|
+
};
|
|
733
|
+
},
|
|
734
|
+
outOfBounds(date, { min, max, filter }, end = date) {
|
|
710
735
|
const adapter = dates();
|
|
711
|
-
if (min && adapter.compareDate(
|
|
736
|
+
if (min && adapter.compareDate(end, min) < 0) return {
|
|
712
737
|
kind: "minDate",
|
|
713
738
|
date,
|
|
714
739
|
min,
|
|
@@ -720,11 +745,17 @@ function useDateInputRefusals(pick) {
|
|
|
720
745
|
max,
|
|
721
746
|
message: maxText()
|
|
722
747
|
};
|
|
723
|
-
if (filter
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
748
|
+
if (filter) {
|
|
749
|
+
let day = date;
|
|
750
|
+
while (!filter(day)) {
|
|
751
|
+
if (adapter.compareDate(day, end) >= 0) return {
|
|
752
|
+
kind: "dateFilter",
|
|
753
|
+
date,
|
|
754
|
+
message: filterText()
|
|
755
|
+
};
|
|
756
|
+
day = adapter.addDays(day, 1);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
728
759
|
return null;
|
|
729
760
|
}
|
|
730
761
|
};
|
|
@@ -788,7 +819,7 @@ var WrDateInputField = class WrDateInputField {
|
|
|
788
819
|
}
|
|
789
820
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
790
821
|
minVersion: "12.0.0",
|
|
791
|
-
version: "22.2.
|
|
822
|
+
version: "22.2.6",
|
|
792
823
|
ngImport: i0,
|
|
793
824
|
type: WrDateInputField,
|
|
794
825
|
deps: [],
|
|
@@ -796,14 +827,14 @@ var WrDateInputField = class WrDateInputField {
|
|
|
796
827
|
});
|
|
797
828
|
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
798
829
|
minVersion: "12.0.0",
|
|
799
|
-
version: "22.2.
|
|
830
|
+
version: "22.2.6",
|
|
800
831
|
ngImport: i0,
|
|
801
832
|
type: WrDateInputField
|
|
802
833
|
});
|
|
803
834
|
};
|
|
804
835
|
i0.ɵɵngDeclareClassMetadata({
|
|
805
836
|
minVersion: "12.0.0",
|
|
806
|
-
version: "22.2.
|
|
837
|
+
version: "22.2.6",
|
|
807
838
|
ngImport: i0,
|
|
808
839
|
type: WrDateInputField,
|
|
809
840
|
decorators: [{ type: Injectable }]
|
|
@@ -818,6 +849,133 @@ const WR_DATE_INPUT_FIELD_VIEW_PROVIDER = {
|
|
|
818
849
|
* Use of this source code is governed by an MIT-style license that can be
|
|
819
850
|
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
820
851
|
*/
|
|
852
|
+
const MARK = 57344;
|
|
853
|
+
const MARKS = /([\ue000-\ue00f])/;
|
|
854
|
+
const REGEX_META = /[.*+?^${}()|[\]\\]/g;
|
|
855
|
+
const PERIODS = /* @__PURE__ */ new Set([
|
|
856
|
+
"week",
|
|
857
|
+
"month",
|
|
858
|
+
"quarter",
|
|
859
|
+
"year"
|
|
860
|
+
]);
|
|
861
|
+
function escapeRegex(value) {
|
|
862
|
+
return value.replace(REGEX_META, "\\$&");
|
|
863
|
+
}
|
|
864
|
+
function literal(text) {
|
|
865
|
+
return text.split(/\s+/).map(escapeRegex).join("\\s*");
|
|
866
|
+
}
|
|
867
|
+
function readTemplate(text, format, fields) {
|
|
868
|
+
const names = Object.keys(fields);
|
|
869
|
+
const marked = format(Object.fromEntries(names.map((name, i) => [name, String.fromCharCode(MARK + i)])));
|
|
870
|
+
const order = [];
|
|
871
|
+
let source = "";
|
|
872
|
+
for (const piece of marked.split(MARKS)) {
|
|
873
|
+
const name = piece.length === 1 ? names[piece.charCodeAt(0) - MARK] : void 0;
|
|
874
|
+
if (name) {
|
|
875
|
+
order.push(name);
|
|
876
|
+
source += `(${fields[name]})`;
|
|
877
|
+
} else source += literal(piece);
|
|
878
|
+
}
|
|
879
|
+
const match = new RegExp(`^\\s*${source}\\s*$`, "iu").exec(text);
|
|
880
|
+
if (!match || order.length !== names.length) return null;
|
|
881
|
+
return Object.fromEntries(order.map((name, i) => [name, match[i + 1]]));
|
|
882
|
+
}
|
|
883
|
+
const YEAR = "\\d{4}";
|
|
884
|
+
function wrPickerPeriod(mode) {
|
|
885
|
+
return PERIODS.has(mode) ? mode : null;
|
|
886
|
+
}
|
|
887
|
+
function usePickerText(source) {
|
|
888
|
+
const monthText = useI18nFormatter("calendar.header", "{{month}} {{year}}");
|
|
889
|
+
const quarterText = useI18nFormatter("datePicker.quarterValue", "Q{{quarter}} {{year}}");
|
|
890
|
+
const weekText = useI18nFormatter("datePicker.weekValue", "Week {{week}}, {{year}}");
|
|
891
|
+
const own = () => source.explicit() ? null : source.period();
|
|
892
|
+
const showPeriod = (date, period) => {
|
|
893
|
+
const adapter = source.adapter();
|
|
894
|
+
const year = adapter.getYear(date);
|
|
895
|
+
const month = adapter.getMonth(date);
|
|
896
|
+
switch (period) {
|
|
897
|
+
case "year": return String(year);
|
|
898
|
+
case "month": return monthText({
|
|
899
|
+
month: adapter.getMonthNames("long")[month],
|
|
900
|
+
year
|
|
901
|
+
});
|
|
902
|
+
case "quarter": return quarterText({
|
|
903
|
+
quarter: Math.floor(month / 3) + 1,
|
|
904
|
+
year
|
|
905
|
+
});
|
|
906
|
+
case "week": return weekText({ ...wrWeekOfYear(adapter, date) });
|
|
907
|
+
}
|
|
908
|
+
};
|
|
909
|
+
const readPeriod = (raw, period) => {
|
|
910
|
+
const adapter = source.adapter();
|
|
911
|
+
switch (period) {
|
|
912
|
+
case "year": {
|
|
913
|
+
const text = raw.trim();
|
|
914
|
+
return new RegExp(`^${YEAR}$`).test(text) ? adapter.createDate(Number(text), 0, 1) : null;
|
|
915
|
+
}
|
|
916
|
+
case "month": {
|
|
917
|
+
const long = adapter.getMonthNames("long").map((name) => name.toLowerCase());
|
|
918
|
+
const short = adapter.getMonthNames("short").map((name) => name.toLowerCase());
|
|
919
|
+
const names = [...long, ...short].sort((a, b) => b.length - a.length).map(escapeRegex);
|
|
920
|
+
const read = readTemplate(raw, monthText, {
|
|
921
|
+
month: names.join("|"),
|
|
922
|
+
year: YEAR
|
|
923
|
+
});
|
|
924
|
+
if (!read) return null;
|
|
925
|
+
const typed = read["month"].toLowerCase();
|
|
926
|
+
const index = long.includes(typed) ? long.indexOf(typed) : short.indexOf(typed);
|
|
927
|
+
return index < 0 ? null : adapter.createDate(Number(read["year"]), index, 1);
|
|
928
|
+
}
|
|
929
|
+
case "quarter": {
|
|
930
|
+
const read = readTemplate(raw, quarterText, {
|
|
931
|
+
quarter: "[1-4]",
|
|
932
|
+
year: YEAR
|
|
933
|
+
});
|
|
934
|
+
return read ? adapter.createDate(Number(read["year"]), (Number(read["quarter"]) - 1) * 3, 1) : null;
|
|
935
|
+
}
|
|
936
|
+
case "week": {
|
|
937
|
+
const read = readTemplate(raw, weekText, {
|
|
938
|
+
week: "\\d{1,2}",
|
|
939
|
+
year: YEAR
|
|
940
|
+
});
|
|
941
|
+
return read ? wrWeekStart(adapter, Number(read["year"]), Number(read["week"])) : null;
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
};
|
|
945
|
+
const reference = () => {
|
|
946
|
+
const adapter = source.adapter();
|
|
947
|
+
return adapter.createDate(adapter.getYear(adapter.today()), 11, 31);
|
|
948
|
+
};
|
|
949
|
+
return {
|
|
950
|
+
show(date) {
|
|
951
|
+
const period = own();
|
|
952
|
+
return period ? showPeriod(date, period) : source.adapter().format(date, source.format());
|
|
953
|
+
},
|
|
954
|
+
read(raw) {
|
|
955
|
+
const adapter = source.adapter();
|
|
956
|
+
const period = own();
|
|
957
|
+
const parsed = period ? readPeriod(raw, period) : adapter.parse(raw, source.format());
|
|
958
|
+
if (!parsed || !adapter.isValid(parsed)) return null;
|
|
959
|
+
const snap = source.period();
|
|
960
|
+
return snap ? wrPeriodStart(adapter, parsed, snap) : parsed;
|
|
961
|
+
},
|
|
962
|
+
unreadable() {
|
|
963
|
+
const period = own();
|
|
964
|
+
return period ? source.refusals.unreadableAs(showPeriod(reference(), period)) : source.refusals.unreadable(source.format());
|
|
965
|
+
},
|
|
966
|
+
key() {
|
|
967
|
+
const period = own();
|
|
968
|
+
const adapter = source.adapter();
|
|
969
|
+
return period ? `${period}|${showPeriod(reference(), period)}|${adapter.displayKey()}` : `${source.format()}|${adapter.displayKey()}`;
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* @license
|
|
975
|
+
*
|
|
976
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
977
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
978
|
+
*/
|
|
821
979
|
function tabLeavesPane(pane, event) {
|
|
822
980
|
if (event.key !== "Tab" || event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return false;
|
|
823
981
|
const active = pane.ownerDocument.activeElement;
|
|
@@ -870,6 +1028,10 @@ var WrDatePicker = class WrDatePicker {
|
|
|
870
1028
|
transform: (v) => Math.max(1, coerceNumberProperty(v, 1))
|
|
871
1029
|
});
|
|
872
1030
|
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
1031
|
+
rounded = input(false, {
|
|
1032
|
+
...ngDevMode ? { debugName: "rounded" } : /* istanbul ignore next */ {},
|
|
1033
|
+
transform: coerceBooleanProperty
|
|
1034
|
+
});
|
|
873
1035
|
clearable = input(false, {
|
|
874
1036
|
...ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {},
|
|
875
1037
|
transform: coerceBooleanProperty
|
|
@@ -887,7 +1049,8 @@ var WrDatePicker = class WrDatePicker {
|
|
|
887
1049
|
dayAdapter = inject(WrDateAdapter);
|
|
888
1050
|
environment = inject(EnvironmentInjector);
|
|
889
1051
|
get adapter() {
|
|
890
|
-
|
|
1052
|
+
const mode = this.mode();
|
|
1053
|
+
return wrPickerAdapter(this.dayAdapter, mode === "time" || mode === "datetime");
|
|
891
1054
|
}
|
|
892
1055
|
overlay = inject(WR_OVERLAY);
|
|
893
1056
|
outsideClick = inject(WrOutsideClick);
|
|
@@ -905,17 +1068,19 @@ var WrDatePicker = class WrDatePicker {
|
|
|
905
1068
|
text = signal("", ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
906
1069
|
hasValue = computed(() => this.value() != null, ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
|
|
907
1070
|
overlayOpen = signal(false, ...ngDevMode ? [{ debugName: "overlayOpen" }] : /* istanbul ignore next */ []);
|
|
1071
|
+
isOpen = this.overlayOpen.asReadonly();
|
|
908
1072
|
openedFrom = null;
|
|
909
1073
|
autoFocusPanel = false;
|
|
910
1074
|
resolvedFormat = computed(() => {
|
|
911
1075
|
const explicit = this.format();
|
|
912
1076
|
if (explicit) return explicit;
|
|
913
1077
|
const m = this.mode();
|
|
914
|
-
if (m
|
|
1078
|
+
if (m !== "time" && m !== "datetime") return "shortDate";
|
|
915
1079
|
return clockFormat(m === "datetime" ? "shortDateTime" : "time", this.timeFormat(), this.showSeconds());
|
|
916
1080
|
}, ...ngDevMode ? [{ debugName: "resolvedFormat" }] : /* istanbul ignore next */ []);
|
|
917
1081
|
isTime = computed(() => this.mode() === "time", ...ngDevMode ? [{ debugName: "isTime" }] : /* istanbul ignore next */ []);
|
|
918
1082
|
isDateTime = computed(() => this.mode() === "datetime", ...ngDevMode ? [{ debugName: "isDateTime" }] : /* istanbul ignore next */ []);
|
|
1083
|
+
period = computed(() => wrPickerPeriod(this.mode()), ...ngDevMode ? [{ debugName: "period" }] : /* istanbul ignore next */ []);
|
|
919
1084
|
labelDate = wrReadI18nText("datePicker.open", "Open calendar");
|
|
920
1085
|
labelTime = wrReadI18nText("datePicker.openTime", "Open time picker");
|
|
921
1086
|
labelDateTime = wrReadI18nText("datePicker.openDateTime", "Open date and time picker");
|
|
@@ -948,6 +1113,13 @@ var WrDatePicker = class WrDatePicker {
|
|
|
948
1113
|
return this.panelLabelDate();
|
|
949
1114
|
}, ...ngDevMode ? [{ debugName: "resolvedPanelLabel" }] : /* istanbul ignore next */ []);
|
|
950
1115
|
refusals = useDateInputRefusals(() => this.adapter);
|
|
1116
|
+
fieldText = usePickerText({
|
|
1117
|
+
adapter: () => this.adapter,
|
|
1118
|
+
period: () => this.period(),
|
|
1119
|
+
explicit: () => this.format(),
|
|
1120
|
+
format: () => this.resolvedFormat(),
|
|
1121
|
+
refusals: this.refusals
|
|
1122
|
+
});
|
|
951
1123
|
reportToForm = useFormParseErrors(this.value, () => this.onFormReset());
|
|
952
1124
|
inputField = inject(WrDateInputField);
|
|
953
1125
|
refusal = signal(null, ...ngDevMode ? [{ debugName: "refusal" }] : /* istanbul ignore next */ []);
|
|
@@ -969,6 +1141,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
969
1141
|
const parts = [`wr-date-picker--${this.mode()}`];
|
|
970
1142
|
const size = this.size();
|
|
971
1143
|
if (size !== "md") parts.push(`wr-date-picker--${size}`);
|
|
1144
|
+
if (this.rounded()) parts.push("wr-date-picker--rounded");
|
|
972
1145
|
if (this.disabled()) parts.push("wr-date-picker--disabled");
|
|
973
1146
|
if (this.inputError()) parts.push("wr-date-picker--invalid");
|
|
974
1147
|
return parts.join(" ");
|
|
@@ -990,7 +1163,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
990
1163
|
effect(() => {
|
|
991
1164
|
const v = this.value();
|
|
992
1165
|
const fmt = this.resolvedFormat();
|
|
993
|
-
const key = this.
|
|
1166
|
+
const key = this.fieldText.key();
|
|
994
1167
|
untracked(() => {
|
|
995
1168
|
const outside = v !== this.lastValue;
|
|
996
1169
|
const echo = this.sameDate(v, this.lastValue) && fmt === this.lastFormat && key === this.lastKey;
|
|
@@ -998,7 +1171,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
998
1171
|
this.lastFormat = fmt;
|
|
999
1172
|
this.lastKey = key;
|
|
1000
1173
|
if (echo && !(outside && this.refusal())) return;
|
|
1001
|
-
this.text.set(v && this.adapter.isValid(v) ? this.
|
|
1174
|
+
this.text.set(v && this.adapter.isValid(v) ? this.fieldText.show(v) : "");
|
|
1002
1175
|
this.refuse(null);
|
|
1003
1176
|
});
|
|
1004
1177
|
});
|
|
@@ -1019,6 +1192,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1019
1192
|
ref.setInput("min", this.min());
|
|
1020
1193
|
ref.setInput("max", this.max());
|
|
1021
1194
|
ref.setInput("dateFilter", this.dateFilter());
|
|
1195
|
+
ref.setInput("granularity", this.period() ?? "day");
|
|
1022
1196
|
});
|
|
1023
1197
|
effect(() => {
|
|
1024
1198
|
const ref = this.timeRef();
|
|
@@ -1050,9 +1224,9 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1050
1224
|
this.refuse(null);
|
|
1051
1225
|
return;
|
|
1052
1226
|
}
|
|
1053
|
-
const parsed = this.
|
|
1054
|
-
if (!parsed
|
|
1055
|
-
this.refuse(this.
|
|
1227
|
+
const parsed = this.fieldText.read(raw);
|
|
1228
|
+
if (!parsed) {
|
|
1229
|
+
this.refuse(this.fieldText.unreadable());
|
|
1056
1230
|
return;
|
|
1057
1231
|
}
|
|
1058
1232
|
const outOfBounds = this.outOfBounds(parsed);
|
|
@@ -1104,7 +1278,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1104
1278
|
}
|
|
1105
1279
|
settleText() {
|
|
1106
1280
|
const v = this.value();
|
|
1107
|
-
if (v && this.adapter.isValid(v)) this.text.set(this.
|
|
1281
|
+
if (v && this.adapter.isValid(v)) this.text.set(this.fieldText.show(v));
|
|
1108
1282
|
else if (!this.text()) this.commitValue(null);
|
|
1109
1283
|
}
|
|
1110
1284
|
refuse(next) {
|
|
@@ -1118,7 +1292,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1118
1292
|
onFormReset() {
|
|
1119
1293
|
if (!this.refusal()) return;
|
|
1120
1294
|
const v = this.value();
|
|
1121
|
-
this.text.set(v && this.adapter.isValid(v) ? this.
|
|
1295
|
+
this.text.set(v && this.adapter.isValid(v) ? this.fieldText.show(v) : "");
|
|
1122
1296
|
this.refuse(null);
|
|
1123
1297
|
}
|
|
1124
1298
|
onPaneFocusOut = (event) => {
|
|
@@ -1157,7 +1331,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1157
1331
|
}
|
|
1158
1332
|
focusPanel() {
|
|
1159
1333
|
const pane = this.overlayRef?.overlayElement;
|
|
1160
|
-
(pane?.querySelector(".wr-calendar__day--focused:not([disabled])") ?? pane?.querySelector(".wr-time-picker__input"))?.focus();
|
|
1334
|
+
(pane?.querySelector(".wr-calendar__day--focused:not([disabled])") ?? pane?.querySelector(".wr-calendar__chip[tabindex=\"0\"]") ?? pane?.querySelector(".wr-time-picker__input"))?.focus();
|
|
1161
1335
|
}
|
|
1162
1336
|
restoreFocus() {
|
|
1163
1337
|
(this.openedFrom?.isConnected ? this.openedFrom : this.inputEl().nativeElement)?.focus();
|
|
@@ -1244,6 +1418,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1244
1418
|
attachDate() {
|
|
1245
1419
|
if (!this.overlayRef) return;
|
|
1246
1420
|
const ref = this.overlayRef.attach(new ComponentPortal(WrCalendar));
|
|
1421
|
+
ref.setInput("granularity", this.period() ?? "day");
|
|
1247
1422
|
ref.setInput("date", this.value());
|
|
1248
1423
|
this.dateRef.set(ref);
|
|
1249
1424
|
ref.setInput("min", this.min());
|
|
@@ -1293,7 +1468,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1293
1468
|
}
|
|
1294
1469
|
commit(next) {
|
|
1295
1470
|
if (this.readonly() || this.disabled()) return;
|
|
1296
|
-
this.text.set(this.
|
|
1471
|
+
this.text.set(this.fieldText.show(next));
|
|
1297
1472
|
this.commitValue(next);
|
|
1298
1473
|
this.refuse(null);
|
|
1299
1474
|
}
|
|
@@ -1325,11 +1500,12 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1325
1500
|
}
|
|
1326
1501
|
outOfBounds(date) {
|
|
1327
1502
|
if (this.mode() === "time") return null;
|
|
1503
|
+
const period = this.period();
|
|
1328
1504
|
return this.refusals.outOfBounds(date, {
|
|
1329
1505
|
min: this.min(),
|
|
1330
1506
|
max: this.max(),
|
|
1331
1507
|
filter: this.dateFilter()
|
|
1332
|
-
});
|
|
1508
|
+
}, period ? wrPeriodEnd(this.adapter, date, period) : date);
|
|
1333
1509
|
}
|
|
1334
1510
|
sameDate(a, b) {
|
|
1335
1511
|
if (a === b) return true;
|
|
@@ -1338,7 +1514,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1338
1514
|
}
|
|
1339
1515
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1340
1516
|
minVersion: "12.0.0",
|
|
1341
|
-
version: "22.2.
|
|
1517
|
+
version: "22.2.6",
|
|
1342
1518
|
ngImport: i0,
|
|
1343
1519
|
type: WrDatePicker,
|
|
1344
1520
|
deps: [],
|
|
@@ -1346,7 +1522,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1346
1522
|
});
|
|
1347
1523
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1348
1524
|
minVersion: "17.0.0",
|
|
1349
|
-
version: "22.2.
|
|
1525
|
+
version: "22.2.6",
|
|
1350
1526
|
type: WrDatePicker,
|
|
1351
1527
|
isStandalone: true,
|
|
1352
1528
|
selector: "wr-date-picker",
|
|
@@ -1421,6 +1597,13 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1421
1597
|
isRequired: false,
|
|
1422
1598
|
transformFunction: null
|
|
1423
1599
|
},
|
|
1600
|
+
rounded: {
|
|
1601
|
+
classPropertyName: "rounded",
|
|
1602
|
+
publicName: "rounded",
|
|
1603
|
+
isSignal: true,
|
|
1604
|
+
isRequired: false,
|
|
1605
|
+
transformFunction: null
|
|
1606
|
+
},
|
|
1424
1607
|
clearable: {
|
|
1425
1608
|
classPropertyName: "clearable",
|
|
1426
1609
|
publicName: "clearable",
|
|
@@ -1503,7 +1686,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1503
1686
|
isSignal: true
|
|
1504
1687
|
}],
|
|
1505
1688
|
ngImport: i0,
|
|
1506
|
-
template: "<wr-input-group>\n <!--\n A plain textbox, per the APG date-picker-dialog pattern: `aria-haspopup` and\n `aria-expanded` are not permitted on `textbox` and belong to the trigger\n button below, which is the thing that opens the dialog.\n -->\n <input\n #input\n wrInput\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [size]=\"size()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"ownAriaInvalid()\"\n [attr.aria-describedby]=\"ownDescribedBy()\"\n [value]=\"text()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput()\"\n (keydown)=\"onFieldKey($event)\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- Pointer-only, as the select's is: emptying the field is the keyboard way to clear. -->\n @if (clearable() && hasValue() && !disabled() && !readonly()) {\n <span\n class=\"wr-date-picker__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clear($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\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 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n <button\n #trigger\n type=\"button\"\n wrInputSuffix\n class=\"wr-date-picker__trigger\"\n [attr.aria-label]=\"triggerLabel()\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-expanded]=\"overlayOpen()\"\n [attr.aria-controls]=\"overlayOpen() ? panelId : null\"\n [disabled]=\"disabled()\"\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<!--\n Why a typed entry was refused, for a screen reader: written when the refusal is\n shown (Enter, or leaving the field) and emptied when the text is corrected. Silent\n inside a <wr-form-field> bound to the same control, whose message says it instead,\n and silent when the app's catalog has no `validation.*` sentence for the refusal.\n-->\n<span class=\"wr-date-picker__sr-only\" role=\"status\" [id]=\"statusId\">{{ announcement() }}</span>\n",
|
|
1689
|
+
template: "<wr-input-group [rounded]=\"rounded()\">\n <!--\n A plain textbox, per the APG date-picker-dialog pattern: `aria-haspopup` and\n `aria-expanded` are not permitted on `textbox` and belong to the trigger\n button below, which is the thing that opens the dialog.\n -->\n <input\n #input\n wrInput\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"ownAriaInvalid()\"\n [attr.aria-describedby]=\"ownDescribedBy()\"\n [value]=\"text()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput()\"\n (keydown)=\"onFieldKey($event)\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- Pointer-only, as the select's is: emptying the field is the keyboard way to clear. -->\n @if (clearable() && hasValue() && !disabled() && !readonly()) {\n <span\n class=\"wr-date-picker__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clear($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\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 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n <button\n #trigger\n type=\"button\"\n wrInputSuffix\n class=\"wr-date-picker__trigger\"\n [attr.aria-label]=\"triggerLabel()\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-expanded]=\"overlayOpen()\"\n [attr.aria-controls]=\"overlayOpen() ? panelId : null\"\n [disabled]=\"disabled()\"\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<!--\n Why a typed entry was refused, for a screen reader: written when the refusal is\n shown (Enter, or leaving the field) and emptied when the text is corrected. Silent\n inside a <wr-form-field> bound to the same control, whose message says it instead,\n and silent when the app's catalog has no `validation.*` sentence for the refusal.\n-->\n<span class=\"wr-date-picker__sr-only\" role=\"status\" [id]=\"statusId\">{{ announcement() }}</span>\n",
|
|
1507
1690
|
dependencies: [
|
|
1508
1691
|
{
|
|
1509
1692
|
kind: "directive",
|
|
@@ -1515,7 +1698,13 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1515
1698
|
kind: "component",
|
|
1516
1699
|
type: WrInputGroup,
|
|
1517
1700
|
selector: "wr-input-group",
|
|
1518
|
-
inputs: [
|
|
1701
|
+
inputs: [
|
|
1702
|
+
"rounded",
|
|
1703
|
+
"clearable",
|
|
1704
|
+
"clearLabel",
|
|
1705
|
+
"loading"
|
|
1706
|
+
],
|
|
1707
|
+
outputs: ["cleared"]
|
|
1519
1708
|
},
|
|
1520
1709
|
{
|
|
1521
1710
|
kind: "directive",
|
|
@@ -1529,7 +1718,7 @@ var WrDatePicker = class WrDatePicker {
|
|
|
1529
1718
|
};
|
|
1530
1719
|
i0.ɵɵngDeclareClassMetadata({
|
|
1531
1720
|
minVersion: "12.0.0",
|
|
1532
|
-
version: "22.2.
|
|
1721
|
+
version: "22.2.6",
|
|
1533
1722
|
ngImport: i0,
|
|
1534
1723
|
type: WrDatePicker,
|
|
1535
1724
|
decorators: [{
|
|
@@ -1548,7 +1737,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1548
1737
|
],
|
|
1549
1738
|
providers: [WrDateInputField],
|
|
1550
1739
|
viewProviders: [WR_DATE_INPUT_FIELD_VIEW_PROVIDER],
|
|
1551
|
-
template: "<wr-input-group>\n <!--\n A plain textbox, per the APG date-picker-dialog pattern: `aria-haspopup` and\n `aria-expanded` are not permitted on `textbox` and belong to the trigger\n button below, which is the thing that opens the dialog.\n -->\n <input\n #input\n wrInput\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [size]=\"size()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"ownAriaInvalid()\"\n [attr.aria-describedby]=\"ownDescribedBy()\"\n [value]=\"text()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput()\"\n (keydown)=\"onFieldKey($event)\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- Pointer-only, as the select's is: emptying the field is the keyboard way to clear. -->\n @if (clearable() && hasValue() && !disabled() && !readonly()) {\n <span\n class=\"wr-date-picker__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clear($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\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 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n <button\n #trigger\n type=\"button\"\n wrInputSuffix\n class=\"wr-date-picker__trigger\"\n [attr.aria-label]=\"triggerLabel()\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-expanded]=\"overlayOpen()\"\n [attr.aria-controls]=\"overlayOpen() ? panelId : null\"\n [disabled]=\"disabled()\"\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<!--\n Why a typed entry was refused, for a screen reader: written when the refusal is\n shown (Enter, or leaving the field) and emptied when the text is corrected. Silent\n inside a <wr-form-field> bound to the same control, whose message says it instead,\n and silent when the app's catalog has no `validation.*` sentence for the refusal.\n-->\n<span class=\"wr-date-picker__sr-only\" role=\"status\" [id]=\"statusId\">{{ announcement() }}</span>\n"
|
|
1740
|
+
template: "<wr-input-group [rounded]=\"rounded()\">\n <!--\n A plain textbox, per the APG date-picker-dialog pattern: `aria-haspopup` and\n `aria-expanded` are not permitted on `textbox` and belong to the trigger\n button below, which is the thing that opens the dialog.\n -->\n <input\n #input\n wrInput\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [attr.aria-label]=\"nameLabel()\"\n [attr.aria-labelledby]=\"labelledBy()\"\n [attr.aria-invalid]=\"ownAriaInvalid()\"\n [attr.aria-describedby]=\"ownDescribedBy()\"\n [value]=\"text()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput()\"\n (keydown)=\"onFieldKey($event)\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- Pointer-only, as the select's is: emptying the field is the keyboard way to clear. -->\n @if (clearable() && hasValue() && !disabled() && !readonly()) {\n <span\n class=\"wr-date-picker__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clear($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\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 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n <button\n #trigger\n type=\"button\"\n wrInputSuffix\n class=\"wr-date-picker__trigger\"\n [attr.aria-label]=\"triggerLabel()\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-expanded]=\"overlayOpen()\"\n [attr.aria-controls]=\"overlayOpen() ? panelId : null\"\n [disabled]=\"disabled()\"\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<!--\n Why a typed entry was refused, for a screen reader: written when the refusal is\n shown (Enter, or leaving the field) and emptied when the text is corrected. Silent\n inside a <wr-form-field> bound to the same control, whose message says it instead,\n and silent when the app's catalog has no `validation.*` sentence for the refusal.\n-->\n<span class=\"wr-date-picker__sr-only\" role=\"status\" [id]=\"statusId\">{{ announcement() }}</span>\n"
|
|
1552
1741
|
}]
|
|
1553
1742
|
}],
|
|
1554
1743
|
ctorParameters: () => [],
|
|
@@ -1633,6 +1822,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1633
1822
|
required: false
|
|
1634
1823
|
}]
|
|
1635
1824
|
}],
|
|
1825
|
+
rounded: [{
|
|
1826
|
+
type: i0.Input,
|
|
1827
|
+
args: [{
|
|
1828
|
+
isSignal: true,
|
|
1829
|
+
alias: "rounded",
|
|
1830
|
+
required: false
|
|
1831
|
+
}]
|
|
1832
|
+
}],
|
|
1636
1833
|
clearable: [{
|
|
1637
1834
|
type: i0.Input,
|
|
1638
1835
|
args: [{
|
|
@@ -1737,12 +1934,16 @@ var WrDateRangePanel = class WrDateRangePanel {
|
|
|
1737
1934
|
max = input(null, ...ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []);
|
|
1738
1935
|
dateFilter = input(null, ...ngDevMode ? [{ debugName: "dateFilter" }] : /* istanbul ignore next */ []);
|
|
1739
1936
|
withTime = input(false, ...ngDevMode ? [{ debugName: "withTime" }] : /* istanbul ignore next */ []);
|
|
1937
|
+
granularity = input("day", ...ngDevMode ? [{ debugName: "granularity" }] : /* istanbul ignore next */ []);
|
|
1740
1938
|
timeFormat = input("auto", ...ngDevMode ? [{ debugName: "timeFormat" }] : /* istanbul ignore next */ []);
|
|
1741
1939
|
showSeconds = input(false, ...ngDevMode ? [{ debugName: "showSeconds" }] : /* istanbul ignore next */ []);
|
|
1742
1940
|
step = input(1, ...ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []);
|
|
1941
|
+
presets = input([], ...ngDevMode ? [{ debugName: "presets" }] : /* istanbul ignore next */ []);
|
|
1942
|
+
presetsLabel = input(null, ...ngDevMode ? [{ debugName: "presetsLabel" }] : /* istanbul ignore next */ []);
|
|
1743
1943
|
autoFocus = input(false, ...ngDevMode ? [{ debugName: "autoFocus" }] : /* istanbul ignore next */ []);
|
|
1744
1944
|
changed = output();
|
|
1745
1945
|
timeChanged = output();
|
|
1946
|
+
presetPicked = output();
|
|
1746
1947
|
adapter = inject(WrDateAdapter);
|
|
1747
1948
|
startTimeLabel = wrReadI18nText("datePicker.startTime", "Start time");
|
|
1748
1949
|
endTimeLabel = wrReadI18nText("datePicker.endTime", "End time");
|
|
@@ -1750,9 +1951,38 @@ var WrDateRangePanel = class WrDateRangePanel {
|
|
|
1750
1951
|
pendingEndTime = signal(null, ...ngDevMode ? [{ debugName: "pendingEndTime" }] : /* istanbul ignore next */ []);
|
|
1751
1952
|
calendarRange = computed(() => this.value(), ...ngDevMode ? [{ debugName: "calendarRange" }] : /* istanbul ignore next */ []);
|
|
1752
1953
|
dayStart = computed(() => {
|
|
1753
|
-
const
|
|
1754
|
-
|
|
1954
|
+
const zoned = this.adapter.zoned();
|
|
1955
|
+
const t = zoned.today();
|
|
1956
|
+
return this.adapter.createDate(zoned.getYear(t), zoned.getMonth(t), zoned.getDate(t));
|
|
1755
1957
|
}, ...ngDevMode ? [{ debugName: "dayStart" }] : /* istanbul ignore next */ []);
|
|
1958
|
+
resolvedPresets = computed(() => {
|
|
1959
|
+
const presets = this.presets();
|
|
1960
|
+
if (!presets.length) return [];
|
|
1961
|
+
const context = {
|
|
1962
|
+
adapter: this.adapter,
|
|
1963
|
+
today: this.dayStart()
|
|
1964
|
+
};
|
|
1965
|
+
const [start, end] = this.value();
|
|
1966
|
+
const [min, max] = [this.min(), this.max()];
|
|
1967
|
+
return presets.map((preset) => {
|
|
1968
|
+
const [from, to] = typeof preset.range === "function" ? preset.range(context) : preset.range;
|
|
1969
|
+
const valid = this.adapter.isValid(from) && this.adapter.isValid(to);
|
|
1970
|
+
const range = valid && !this.withTime() ? [this.dayOf(from), this.dayOf(to)] : [from, to];
|
|
1971
|
+
return {
|
|
1972
|
+
label: preset.label,
|
|
1973
|
+
range,
|
|
1974
|
+
active: valid && this.sameEnd(start, range[0]) && this.sameEnd(end, range[1]),
|
|
1975
|
+
disabled: !valid || !!min && this.adapter.compareDate(from, min) < 0 || !!max && this.adapter.compareDate(to, max) > 0
|
|
1976
|
+
};
|
|
1977
|
+
});
|
|
1978
|
+
}, ...ngDevMode ? [{ debugName: "resolvedPresets" }] : /* istanbul ignore next */ []);
|
|
1979
|
+
dayOf(date) {
|
|
1980
|
+
return this.adapter.createDate(this.adapter.getYear(date), this.adapter.getMonth(date), this.adapter.getDate(date));
|
|
1981
|
+
}
|
|
1982
|
+
sameEnd(a, b) {
|
|
1983
|
+
if (!a || !b) return false;
|
|
1984
|
+
return this.withTime() ? a.getTime() === b.getTime() : this.adapter.isSameDay(a, b);
|
|
1985
|
+
}
|
|
1756
1986
|
startTime = computed(() => this.value()[0] ?? this.pendingStartTime() ?? this.dayStart(), ...ngDevMode ? [{ debugName: "startTime" }] : /* istanbul ignore next */ []);
|
|
1757
1987
|
endTime = computed(() => this.value()[1] ?? this.pendingEndTime() ?? this.dayStart(), ...ngDevMode ? [{ debugName: "endTime" }] : /* istanbul ignore next */ []);
|
|
1758
1988
|
onRangeChange(range) {
|
|
@@ -1786,7 +2016,7 @@ var WrDateRangePanel = class WrDateRangePanel {
|
|
|
1786
2016
|
}
|
|
1787
2017
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1788
2018
|
minVersion: "12.0.0",
|
|
1789
|
-
version: "22.2.
|
|
2019
|
+
version: "22.2.6",
|
|
1790
2020
|
ngImport: i0,
|
|
1791
2021
|
type: WrDateRangePanel,
|
|
1792
2022
|
deps: [],
|
|
@@ -1794,7 +2024,7 @@ var WrDateRangePanel = class WrDateRangePanel {
|
|
|
1794
2024
|
});
|
|
1795
2025
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
1796
2026
|
minVersion: "17.0.0",
|
|
1797
|
-
version: "22.2.
|
|
2027
|
+
version: "22.2.6",
|
|
1798
2028
|
type: WrDateRangePanel,
|
|
1799
2029
|
isStandalone: true,
|
|
1800
2030
|
selector: "wr-date-range-panel",
|
|
@@ -1834,6 +2064,13 @@ var WrDateRangePanel = class WrDateRangePanel {
|
|
|
1834
2064
|
isRequired: false,
|
|
1835
2065
|
transformFunction: null
|
|
1836
2066
|
},
|
|
2067
|
+
granularity: {
|
|
2068
|
+
classPropertyName: "granularity",
|
|
2069
|
+
publicName: "granularity",
|
|
2070
|
+
isSignal: true,
|
|
2071
|
+
isRequired: false,
|
|
2072
|
+
transformFunction: null
|
|
2073
|
+
},
|
|
1837
2074
|
timeFormat: {
|
|
1838
2075
|
classPropertyName: "timeFormat",
|
|
1839
2076
|
publicName: "timeFormat",
|
|
@@ -1855,6 +2092,20 @@ var WrDateRangePanel = class WrDateRangePanel {
|
|
|
1855
2092
|
isRequired: false,
|
|
1856
2093
|
transformFunction: null
|
|
1857
2094
|
},
|
|
2095
|
+
presets: {
|
|
2096
|
+
classPropertyName: "presets",
|
|
2097
|
+
publicName: "presets",
|
|
2098
|
+
isSignal: true,
|
|
2099
|
+
isRequired: false,
|
|
2100
|
+
transformFunction: null
|
|
2101
|
+
},
|
|
2102
|
+
presetsLabel: {
|
|
2103
|
+
classPropertyName: "presetsLabel",
|
|
2104
|
+
publicName: "presetsLabel",
|
|
2105
|
+
isSignal: true,
|
|
2106
|
+
isRequired: false,
|
|
2107
|
+
transformFunction: null
|
|
2108
|
+
},
|
|
1858
2109
|
autoFocus: {
|
|
1859
2110
|
classPropertyName: "autoFocus",
|
|
1860
2111
|
publicName: "autoFocus",
|
|
@@ -1865,29 +2116,51 @@ var WrDateRangePanel = class WrDateRangePanel {
|
|
|
1865
2116
|
},
|
|
1866
2117
|
outputs: {
|
|
1867
2118
|
changed: "changed",
|
|
1868
|
-
timeChanged: "timeChanged"
|
|
2119
|
+
timeChanged: "timeChanged",
|
|
2120
|
+
presetPicked: "presetPicked"
|
|
1869
2121
|
},
|
|
1870
2122
|
host: {
|
|
1871
|
-
properties: {
|
|
2123
|
+
properties: {
|
|
2124
|
+
"class.wr-date-range-panel--timed": "withTime()",
|
|
2125
|
+
"class.wr-date-range-panel--presets": "presets().length > 0"
|
|
2126
|
+
},
|
|
1872
2127
|
classAttribute: "wr-date-range-panel"
|
|
1873
2128
|
},
|
|
1874
2129
|
ngImport: i0,
|
|
1875
|
-
template: "<wr-calendar\n mode=\"range\"\n [range]=\"calendarRange()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [dateFilter]=\"dateFilter()\"\n [autoFocus]=\"autoFocus()\"\n (rangeChange)=\"onRangeChange($event)\"\n/>\n\n@if (withTime()) {\n <div class=\"wr-date-range-panel__times\">\n <!-- A time picker is several inputs, not one control, so each end is a\n labelled group rather than a <label>. -->\n <div class=\"wr-date-range-panel__time\" role=\"group\" [attr.aria-label]=\"startTimeLabel()\">\n <span class=\"wr-date-range-panel__time-label\" aria-hidden=\"true\">{{ startTimeLabel() }}</span>\n <wr-time-picker\n [value]=\"startTime()\"\n [format]=\"timeFormat()\"\n [showSeconds]=\"showSeconds()\"\n [step]=\"step()\"\n (valueChange)=\"onStartTimeChange($event)\"\n />\n </div>\n <div class=\"wr-date-range-panel__time\" role=\"group\" [attr.aria-label]=\"endTimeLabel()\">\n <span class=\"wr-date-range-panel__time-label\" aria-hidden=\"true\">{{ endTimeLabel() }}</span>\n <wr-time-picker\n [value]=\"endTime()\"\n [format]=\"timeFormat()\"\n [showSeconds]=\"showSeconds()\"\n [step]=\"step()\"\n (valueChange)=\"onEndTimeChange($event)\"\n />\n </div>\n </div>\n}\n",
|
|
2130
|
+
template: "@if (resolvedPresets().length) {\n <div class=\"wr-date-range-presets\" role=\"group\" [attr.aria-label]=\"presetsLabel()\">\n @for (preset of resolvedPresets(); track $index) {\n <button\n type=\"button\"\n class=\"wr-date-range-presets__item\"\n [class.wr-date-range-presets__item--active]=\"preset.active\"\n [attr.aria-pressed]=\"preset.active\"\n [disabled]=\"preset.disabled\"\n (click)=\"presetPicked.emit(preset.range)\"\n >\n {{ preset.label }}\n </button>\n }\n </div>\n}\n\n<wr-calendar\n mode=\"range\"\n [granularity]=\"granularity()\"\n [range]=\"calendarRange()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [dateFilter]=\"dateFilter()\"\n [autoFocus]=\"autoFocus()\"\n (rangeChange)=\"onRangeChange($event)\"\n/>\n\n@if (withTime()) {\n <div class=\"wr-date-range-panel__times\">\n <!-- A time picker is several inputs, not one control, so each end is a\n labelled group rather than a <label>. -->\n <div class=\"wr-date-range-panel__time\" role=\"group\" [attr.aria-label]=\"startTimeLabel()\">\n <span class=\"wr-date-range-panel__time-label\" aria-hidden=\"true\">{{ startTimeLabel() }}</span>\n <wr-time-picker\n [value]=\"startTime()\"\n [format]=\"timeFormat()\"\n [showSeconds]=\"showSeconds()\"\n [step]=\"step()\"\n (valueChange)=\"onStartTimeChange($event)\"\n />\n </div>\n <div class=\"wr-date-range-panel__time\" role=\"group\" [attr.aria-label]=\"endTimeLabel()\">\n <span class=\"wr-date-range-panel__time-label\" aria-hidden=\"true\">{{ endTimeLabel() }}</span>\n <wr-time-picker\n [value]=\"endTime()\"\n [format]=\"timeFormat()\"\n [showSeconds]=\"showSeconds()\"\n [step]=\"step()\"\n (valueChange)=\"onEndTimeChange($event)\"\n />\n </div>\n </div>\n}\n",
|
|
1876
2131
|
dependencies: [{
|
|
1877
2132
|
kind: "component",
|
|
1878
2133
|
type: WrCalendar,
|
|
1879
2134
|
selector: "wr-calendar",
|
|
1880
2135
|
inputs: [
|
|
1881
2136
|
"mode",
|
|
2137
|
+
"granularity",
|
|
1882
2138
|
"date",
|
|
1883
2139
|
"range",
|
|
2140
|
+
"value",
|
|
1884
2141
|
"min",
|
|
1885
2142
|
"max",
|
|
1886
2143
|
"dateFilter",
|
|
1887
2144
|
"autoFocus",
|
|
1888
|
-
"disabled"
|
|
2145
|
+
"disabled",
|
|
2146
|
+
"readonly",
|
|
2147
|
+
"ariaLabel",
|
|
2148
|
+
"prevMonthLabel",
|
|
2149
|
+
"nextMonthLabel",
|
|
2150
|
+
"monthListLabel",
|
|
2151
|
+
"yearListLabel",
|
|
2152
|
+
"quarterListLabel",
|
|
2153
|
+
"prevYearLabel",
|
|
2154
|
+
"nextYearLabel",
|
|
2155
|
+
"prevYearsLabel",
|
|
2156
|
+
"nextYearsLabel"
|
|
1889
2157
|
],
|
|
1890
|
-
outputs: [
|
|
2158
|
+
outputs: [
|
|
2159
|
+
"dateChange",
|
|
2160
|
+
"rangeChange",
|
|
2161
|
+
"valueChange",
|
|
2162
|
+
"touch"
|
|
2163
|
+
]
|
|
1891
2164
|
}, {
|
|
1892
2165
|
kind: "component",
|
|
1893
2166
|
type: WrTimePanel,
|
|
@@ -1908,7 +2181,7 @@ var WrDateRangePanel = class WrDateRangePanel {
|
|
|
1908
2181
|
};
|
|
1909
2182
|
i0.ɵɵngDeclareClassMetadata({
|
|
1910
2183
|
minVersion: "12.0.0",
|
|
1911
|
-
version: "22.2.
|
|
2184
|
+
version: "22.2.6",
|
|
1912
2185
|
ngImport: i0,
|
|
1913
2186
|
type: WrDateRangePanel,
|
|
1914
2187
|
decorators: [{
|
|
@@ -1918,10 +2191,11 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1918
2191
|
encapsulation: ViewEncapsulation.None,
|
|
1919
2192
|
host: {
|
|
1920
2193
|
class: "wr-date-range-panel",
|
|
1921
|
-
"[class.wr-date-range-panel--timed]": "withTime()"
|
|
2194
|
+
"[class.wr-date-range-panel--timed]": "withTime()",
|
|
2195
|
+
"[class.wr-date-range-panel--presets]": "presets().length > 0"
|
|
1922
2196
|
},
|
|
1923
2197
|
imports: [WrCalendar, WrTimePanel],
|
|
1924
|
-
template: "<wr-calendar\n mode=\"range\"\n [range]=\"calendarRange()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [dateFilter]=\"dateFilter()\"\n [autoFocus]=\"autoFocus()\"\n (rangeChange)=\"onRangeChange($event)\"\n/>\n\n@if (withTime()) {\n <div class=\"wr-date-range-panel__times\">\n <!-- A time picker is several inputs, not one control, so each end is a\n labelled group rather than a <label>. -->\n <div class=\"wr-date-range-panel__time\" role=\"group\" [attr.aria-label]=\"startTimeLabel()\">\n <span class=\"wr-date-range-panel__time-label\" aria-hidden=\"true\">{{ startTimeLabel() }}</span>\n <wr-time-picker\n [value]=\"startTime()\"\n [format]=\"timeFormat()\"\n [showSeconds]=\"showSeconds()\"\n [step]=\"step()\"\n (valueChange)=\"onStartTimeChange($event)\"\n />\n </div>\n <div class=\"wr-date-range-panel__time\" role=\"group\" [attr.aria-label]=\"endTimeLabel()\">\n <span class=\"wr-date-range-panel__time-label\" aria-hidden=\"true\">{{ endTimeLabel() }}</span>\n <wr-time-picker\n [value]=\"endTime()\"\n [format]=\"timeFormat()\"\n [showSeconds]=\"showSeconds()\"\n [step]=\"step()\"\n (valueChange)=\"onEndTimeChange($event)\"\n />\n </div>\n </div>\n}\n"
|
|
2198
|
+
template: "@if (resolvedPresets().length) {\n <div class=\"wr-date-range-presets\" role=\"group\" [attr.aria-label]=\"presetsLabel()\">\n @for (preset of resolvedPresets(); track $index) {\n <button\n type=\"button\"\n class=\"wr-date-range-presets__item\"\n [class.wr-date-range-presets__item--active]=\"preset.active\"\n [attr.aria-pressed]=\"preset.active\"\n [disabled]=\"preset.disabled\"\n (click)=\"presetPicked.emit(preset.range)\"\n >\n {{ preset.label }}\n </button>\n }\n </div>\n}\n\n<wr-calendar\n mode=\"range\"\n [granularity]=\"granularity()\"\n [range]=\"calendarRange()\"\n [min]=\"min()\"\n [max]=\"max()\"\n [dateFilter]=\"dateFilter()\"\n [autoFocus]=\"autoFocus()\"\n (rangeChange)=\"onRangeChange($event)\"\n/>\n\n@if (withTime()) {\n <div class=\"wr-date-range-panel__times\">\n <!-- A time picker is several inputs, not one control, so each end is a\n labelled group rather than a <label>. -->\n <div class=\"wr-date-range-panel__time\" role=\"group\" [attr.aria-label]=\"startTimeLabel()\">\n <span class=\"wr-date-range-panel__time-label\" aria-hidden=\"true\">{{ startTimeLabel() }}</span>\n <wr-time-picker\n [value]=\"startTime()\"\n [format]=\"timeFormat()\"\n [showSeconds]=\"showSeconds()\"\n [step]=\"step()\"\n (valueChange)=\"onStartTimeChange($event)\"\n />\n </div>\n <div class=\"wr-date-range-panel__time\" role=\"group\" [attr.aria-label]=\"endTimeLabel()\">\n <span class=\"wr-date-range-panel__time-label\" aria-hidden=\"true\">{{ endTimeLabel() }}</span>\n <wr-time-picker\n [value]=\"endTime()\"\n [format]=\"timeFormat()\"\n [showSeconds]=\"showSeconds()\"\n [step]=\"step()\"\n (valueChange)=\"onEndTimeChange($event)\"\n />\n </div>\n </div>\n}\n"
|
|
1925
2199
|
}]
|
|
1926
2200
|
}],
|
|
1927
2201
|
ctorParameters: () => [],
|
|
@@ -1966,6 +2240,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1966
2240
|
required: false
|
|
1967
2241
|
}]
|
|
1968
2242
|
}],
|
|
2243
|
+
granularity: [{
|
|
2244
|
+
type: i0.Input,
|
|
2245
|
+
args: [{
|
|
2246
|
+
isSignal: true,
|
|
2247
|
+
alias: "granularity",
|
|
2248
|
+
required: false
|
|
2249
|
+
}]
|
|
2250
|
+
}],
|
|
1969
2251
|
timeFormat: [{
|
|
1970
2252
|
type: i0.Input,
|
|
1971
2253
|
args: [{
|
|
@@ -1990,6 +2272,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
1990
2272
|
required: false
|
|
1991
2273
|
}]
|
|
1992
2274
|
}],
|
|
2275
|
+
presets: [{
|
|
2276
|
+
type: i0.Input,
|
|
2277
|
+
args: [{
|
|
2278
|
+
isSignal: true,
|
|
2279
|
+
alias: "presets",
|
|
2280
|
+
required: false
|
|
2281
|
+
}]
|
|
2282
|
+
}],
|
|
2283
|
+
presetsLabel: [{
|
|
2284
|
+
type: i0.Input,
|
|
2285
|
+
args: [{
|
|
2286
|
+
isSignal: true,
|
|
2287
|
+
alias: "presetsLabel",
|
|
2288
|
+
required: false
|
|
2289
|
+
}]
|
|
2290
|
+
}],
|
|
1993
2291
|
autoFocus: [{
|
|
1994
2292
|
type: i0.Input,
|
|
1995
2293
|
args: [{
|
|
@@ -2005,6 +2303,10 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2005
2303
|
timeChanged: [{
|
|
2006
2304
|
type: i0.Output,
|
|
2007
2305
|
args: ["timeChanged"]
|
|
2306
|
+
}],
|
|
2307
|
+
presetPicked: [{
|
|
2308
|
+
type: i0.Output,
|
|
2309
|
+
args: ["presetPicked"]
|
|
2008
2310
|
}]
|
|
2009
2311
|
}
|
|
2010
2312
|
});
|
|
@@ -2020,7 +2322,7 @@ var WrDateRangeEndInput = class WrDateRangeEndInput {
|
|
|
2020
2322
|
}
|
|
2021
2323
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2022
2324
|
minVersion: "12.0.0",
|
|
2023
|
-
version: "22.2.
|
|
2325
|
+
version: "22.2.6",
|
|
2024
2326
|
ngImport: i0,
|
|
2025
2327
|
type: WrDateRangeEndInput,
|
|
2026
2328
|
deps: [],
|
|
@@ -2028,7 +2330,7 @@ var WrDateRangeEndInput = class WrDateRangeEndInput {
|
|
|
2028
2330
|
});
|
|
2029
2331
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
2030
2332
|
minVersion: "14.0.0",
|
|
2031
|
-
version: "22.2.
|
|
2333
|
+
version: "22.2.6",
|
|
2032
2334
|
type: WrDateRangeEndInput,
|
|
2033
2335
|
isStandalone: true,
|
|
2034
2336
|
selector: "input[wrDateRangeEnd]",
|
|
@@ -2041,7 +2343,7 @@ var WrDateRangeEndInput = class WrDateRangeEndInput {
|
|
|
2041
2343
|
};
|
|
2042
2344
|
i0.ɵɵngDeclareClassMetadata({
|
|
2043
2345
|
minVersion: "12.0.0",
|
|
2044
|
-
version: "22.2.
|
|
2346
|
+
version: "22.2.6",
|
|
2045
2347
|
ngImport: i0,
|
|
2046
2348
|
type: WrDateRangeEndInput,
|
|
2047
2349
|
decorators: [{
|
|
@@ -2083,10 +2385,16 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2083
2385
|
transform: (v) => Math.max(1, coerceNumberProperty(v, 1))
|
|
2084
2386
|
});
|
|
2085
2387
|
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
2388
|
+
rounded = input(false, {
|
|
2389
|
+
...ngDevMode ? { debugName: "rounded" } : /* istanbul ignore next */ {},
|
|
2390
|
+
transform: coerceBooleanProperty
|
|
2391
|
+
});
|
|
2086
2392
|
clearable = input(false, {
|
|
2087
2393
|
...ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {},
|
|
2088
2394
|
transform: coerceBooleanProperty
|
|
2089
2395
|
});
|
|
2396
|
+
presets = input([], ...ngDevMode ? [{ debugName: "presets" }] : /* istanbul ignore next */ []);
|
|
2397
|
+
presetsLabel = input(null, ...ngDevMode ? [{ debugName: "presetsLabel" }] : /* istanbul ignore next */ []);
|
|
2090
2398
|
clearLabel = input(null, ...ngDevMode ? [{ debugName: "clearLabel" }] : /* istanbul ignore next */ []);
|
|
2091
2399
|
resolvedClear = useI18nText(this.clearLabel, "common.clear", "Clear");
|
|
2092
2400
|
disabled = input(false, {
|
|
@@ -2123,6 +2431,7 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2123
2431
|
return start != null || end != null;
|
|
2124
2432
|
}, ...ngDevMode ? [{ debugName: "hasValue" }] : /* istanbul ignore next */ []);
|
|
2125
2433
|
overlayOpen = signal(false, ...ngDevMode ? [{ debugName: "overlayOpen" }] : /* istanbul ignore next */ []);
|
|
2434
|
+
isOpen = this.overlayOpen.asReadonly();
|
|
2126
2435
|
openedFrom = null;
|
|
2127
2436
|
autoFocusPanel = false;
|
|
2128
2437
|
resolvedFormat = computed(() => {
|
|
@@ -2132,6 +2441,7 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2132
2441
|
return clockFormat("shortDateTime", this.timeFormat(), this.showSeconds());
|
|
2133
2442
|
}, ...ngDevMode ? [{ debugName: "resolvedFormat" }] : /* istanbul ignore next */ []);
|
|
2134
2443
|
isDateTime = computed(() => this.mode() === "datetime", ...ngDevMode ? [{ debugName: "isDateTime" }] : /* istanbul ignore next */ []);
|
|
2444
|
+
period = computed(() => wrPickerPeriod(this.mode()), ...ngDevMode ? [{ debugName: "period" }] : /* istanbul ignore next */ []);
|
|
2135
2445
|
triggerLabel = wrReadI18nText("datePicker.openRange", "Open range calendar");
|
|
2136
2446
|
startLabel = wrReadI18nText("datePicker.rangeStart", "Range start");
|
|
2137
2447
|
endLabel = wrReadI18nText("datePicker.rangeEnd", "Range end");
|
|
@@ -2146,6 +2456,13 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2146
2456
|
return this.isDateTime() ? this.panelLabelRangeDateTime() : this.panelLabelRange();
|
|
2147
2457
|
}, ...ngDevMode ? [{ debugName: "resolvedPanelLabel" }] : /* istanbul ignore next */ []);
|
|
2148
2458
|
refusalBuilder = useDateInputRefusals(() => this.adapter);
|
|
2459
|
+
fieldText = usePickerText({
|
|
2460
|
+
adapter: () => this.adapter,
|
|
2461
|
+
period: () => this.period(),
|
|
2462
|
+
explicit: () => this.format(),
|
|
2463
|
+
format: () => this.resolvedFormat(),
|
|
2464
|
+
refusals: this.refusalBuilder
|
|
2465
|
+
});
|
|
2149
2466
|
reportToForm = useFormParseErrors(this.value, () => this.onFormReset());
|
|
2150
2467
|
inputField = inject(WrDateInputField);
|
|
2151
2468
|
refusals = signal([null, null], ...ngDevMode ? [{ debugName: "refusals" }] : /* istanbul ignore next */ []);
|
|
@@ -2188,6 +2505,7 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2188
2505
|
const parts = [`wr-date-range-picker--${this.mode()}`];
|
|
2189
2506
|
const size = this.size();
|
|
2190
2507
|
if (size !== "md") parts.push(`wr-date-range-picker--${size}`);
|
|
2508
|
+
if (this.rounded()) parts.push("wr-date-range-picker--rounded");
|
|
2191
2509
|
if (this.disabled()) parts.push("wr-date-range-picker--disabled");
|
|
2192
2510
|
if (this.shownErrors().some(Boolean)) parts.push("wr-date-range-picker--invalid");
|
|
2193
2511
|
return parts.join(" ");
|
|
@@ -2205,7 +2523,7 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2205
2523
|
this.inputField.describe(computed(() => this.shownErrors()[0]));
|
|
2206
2524
|
effect(() => {
|
|
2207
2525
|
const v = this.value();
|
|
2208
|
-
const fmt =
|
|
2526
|
+
const fmt = this.fieldText.key();
|
|
2209
2527
|
untracked(() => {
|
|
2210
2528
|
const formatMoved = this.lastFormat !== null && fmt !== this.lastFormat;
|
|
2211
2529
|
this.lastFormat = fmt;
|
|
@@ -2239,6 +2557,9 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2239
2557
|
ref.setInput("timeFormat", this.timeFormat());
|
|
2240
2558
|
ref.setInput("showSeconds", this.showSeconds());
|
|
2241
2559
|
ref.setInput("step", this.step());
|
|
2560
|
+
ref.setInput("presets", this.presets());
|
|
2561
|
+
ref.setInput("presetsLabel", this.presetsLabel());
|
|
2562
|
+
ref.setInput("granularity", this.period() ?? "day");
|
|
2242
2563
|
});
|
|
2243
2564
|
}
|
|
2244
2565
|
onStartInput(event) {
|
|
@@ -2344,7 +2665,7 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2344
2665
|
}
|
|
2345
2666
|
focusPanel() {
|
|
2346
2667
|
const pane = this.overlayRef?.overlayElement;
|
|
2347
|
-
(pane?.querySelector(".wr-calendar__day--focused:not([disabled])") ?? pane?.querySelector(".wr-time-picker__input"))?.focus();
|
|
2668
|
+
(pane?.querySelector(".wr-calendar__day--focused:not([disabled])") ?? pane?.querySelector(".wr-calendar__chip[tabindex=\"0\"]") ?? pane?.querySelector(".wr-time-picker__input"))?.focus();
|
|
2348
2669
|
}
|
|
2349
2670
|
restoreFocus() {
|
|
2350
2671
|
const opener = this.openedFrom?.isConnected ? this.openedFrom : null;
|
|
@@ -2360,9 +2681,9 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2360
2681
|
this.refuse(end, null);
|
|
2361
2682
|
return;
|
|
2362
2683
|
}
|
|
2363
|
-
const parsed = this.
|
|
2364
|
-
if (!parsed
|
|
2365
|
-
this.refuse(end, this.
|
|
2684
|
+
const parsed = this.parseText(raw, end);
|
|
2685
|
+
if (!parsed) {
|
|
2686
|
+
this.refuse(end, this.fieldText.unreadable());
|
|
2366
2687
|
return;
|
|
2367
2688
|
}
|
|
2368
2689
|
const outOfBounds = this.outOfBounds(parsed);
|
|
@@ -2439,6 +2760,7 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2439
2760
|
pane.setAttribute("aria-label", this.resolvedPanelLabel());
|
|
2440
2761
|
pane.addEventListener("focusout", this.onPaneFocusOut);
|
|
2441
2762
|
const ref = this.overlayRef.attach(new ComponentPortal(WrDateRangePanel, null, wrPickerPanelInjector(this.environment, this.adapter)));
|
|
2763
|
+
ref.setInput("granularity", this.period() ?? "day");
|
|
2442
2764
|
ref.setInput("value", this.value() ?? [null, null]);
|
|
2443
2765
|
ref.setInput("autoFocus", this.autoFocusPanel);
|
|
2444
2766
|
this.panelRef.set(ref);
|
|
@@ -2448,6 +2770,13 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2448
2770
|
const committed = this.commitRange(next, { normalise: true });
|
|
2449
2771
|
if (!this.isDateTime() && committed[0] && committed[1]) this.closeOverlay();
|
|
2450
2772
|
});
|
|
2773
|
+
ref.instance.presetPicked.subscribe((range) => {
|
|
2774
|
+
this.refuse(0, null);
|
|
2775
|
+
this.refuse(1, null);
|
|
2776
|
+
this.commitRange(range, { normalise: true });
|
|
2777
|
+
this.closeOverlay();
|
|
2778
|
+
this.touch.emit();
|
|
2779
|
+
});
|
|
2451
2780
|
this.outsideClick.outsidePointerEvents(this.overlayRef).pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {
|
|
2452
2781
|
if (this.host.nativeElement.contains(event.target)) return;
|
|
2453
2782
|
this.closeOverlay();
|
|
@@ -2498,25 +2827,27 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2498
2827
|
if (movedEnd) this.refuse(1, null);
|
|
2499
2828
|
const [refusedStart, refusedEnd] = this.refusals();
|
|
2500
2829
|
this.reportToForm(this.raised());
|
|
2501
|
-
if (!refusedStart && !this.sameDate(normalised[0], this.parseText(this.startText()))) this.startText.set(this.display(normalised[0]));
|
|
2502
|
-
if (!refusedEnd && !this.sameDate(normalised[1], this.parseText(this.endText()))) this.endText.set(this.display(normalised[1]));
|
|
2830
|
+
if (!refusedStart && !this.sameDate(normalised[0], this.parseText(this.startText(), 0))) this.startText.set(this.display(normalised[0]));
|
|
2831
|
+
if (!refusedEnd && !this.sameDate(normalised[1], this.parseText(this.endText(), 1))) this.endText.set(this.display(normalised[1]));
|
|
2503
2832
|
return normalised;
|
|
2504
2833
|
}
|
|
2505
2834
|
current() {
|
|
2506
2835
|
return this.value() ?? [null, null];
|
|
2507
2836
|
}
|
|
2508
2837
|
display(date) {
|
|
2509
|
-
return date && this.adapter.isValid(date) ? this.
|
|
2838
|
+
return date && this.adapter.isValid(date) ? this.fieldText.show(date) : "";
|
|
2510
2839
|
}
|
|
2511
|
-
parseText(raw) {
|
|
2840
|
+
parseText(raw, end) {
|
|
2512
2841
|
if (!raw) return null;
|
|
2513
|
-
const parsed = this.
|
|
2514
|
-
|
|
2842
|
+
const parsed = this.fieldText.read(raw);
|
|
2843
|
+
const period = this.period();
|
|
2844
|
+
return parsed && period && end === 1 ? wrPeriodEnd(this.adapter, parsed, period) : parsed;
|
|
2515
2845
|
}
|
|
2516
2846
|
normalise(range) {
|
|
2517
2847
|
const [start, end] = range;
|
|
2518
|
-
if (start
|
|
2519
|
-
|
|
2848
|
+
if (!start || !end || this.compareEnds(start, end) <= 0) return [start, end];
|
|
2849
|
+
const period = this.period();
|
|
2850
|
+
return period ? [wrPeriodStart(this.adapter, end, period), wrPeriodEnd(this.adapter, start, period)] : [end, start];
|
|
2520
2851
|
}
|
|
2521
2852
|
compareEnds(a, b) {
|
|
2522
2853
|
const byDay = this.adapter.compareDate(a, b);
|
|
@@ -2525,11 +2856,14 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2525
2856
|
return clock(a) - clock(b);
|
|
2526
2857
|
}
|
|
2527
2858
|
outOfBounds(date) {
|
|
2528
|
-
|
|
2859
|
+
const bounds = {
|
|
2529
2860
|
min: this.minDate(),
|
|
2530
2861
|
max: this.maxDate(),
|
|
2531
2862
|
filter: this.dateFilter()
|
|
2532
|
-
}
|
|
2863
|
+
};
|
|
2864
|
+
const period = this.period();
|
|
2865
|
+
if (!period) return this.refusalBuilder.outOfBounds(date, bounds);
|
|
2866
|
+
return this.refusalBuilder.outOfBounds(wrPeriodStart(this.adapter, date, period), bounds, wrPeriodEnd(this.adapter, date, period));
|
|
2533
2867
|
}
|
|
2534
2868
|
sameDate(a, b) {
|
|
2535
2869
|
if (a === b) return true;
|
|
@@ -2544,7 +2878,7 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2544
2878
|
}
|
|
2545
2879
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
2546
2880
|
minVersion: "12.0.0",
|
|
2547
|
-
version: "22.2.
|
|
2881
|
+
version: "22.2.6",
|
|
2548
2882
|
ngImport: i0,
|
|
2549
2883
|
type: WrDateRangePicker,
|
|
2550
2884
|
deps: [],
|
|
@@ -2552,7 +2886,7 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2552
2886
|
});
|
|
2553
2887
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
2554
2888
|
minVersion: "17.0.0",
|
|
2555
|
-
version: "22.2.
|
|
2889
|
+
version: "22.2.6",
|
|
2556
2890
|
type: WrDateRangePicker,
|
|
2557
2891
|
isStandalone: true,
|
|
2558
2892
|
selector: "wr-date-range-picker",
|
|
@@ -2641,6 +2975,13 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2641
2975
|
isRequired: false,
|
|
2642
2976
|
transformFunction: null
|
|
2643
2977
|
},
|
|
2978
|
+
rounded: {
|
|
2979
|
+
classPropertyName: "rounded",
|
|
2980
|
+
publicName: "rounded",
|
|
2981
|
+
isSignal: true,
|
|
2982
|
+
isRequired: false,
|
|
2983
|
+
transformFunction: null
|
|
2984
|
+
},
|
|
2644
2985
|
clearable: {
|
|
2645
2986
|
classPropertyName: "clearable",
|
|
2646
2987
|
publicName: "clearable",
|
|
@@ -2648,6 +2989,20 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2648
2989
|
isRequired: false,
|
|
2649
2990
|
transformFunction: null
|
|
2650
2991
|
},
|
|
2992
|
+
presets: {
|
|
2993
|
+
classPropertyName: "presets",
|
|
2994
|
+
publicName: "presets",
|
|
2995
|
+
isSignal: true,
|
|
2996
|
+
isRequired: false,
|
|
2997
|
+
transformFunction: null
|
|
2998
|
+
},
|
|
2999
|
+
presetsLabel: {
|
|
3000
|
+
classPropertyName: "presetsLabel",
|
|
3001
|
+
publicName: "presetsLabel",
|
|
3002
|
+
isSignal: true,
|
|
3003
|
+
isRequired: false,
|
|
3004
|
+
transformFunction: null
|
|
3005
|
+
},
|
|
2651
3006
|
clearLabel: {
|
|
2652
3007
|
classPropertyName: "clearLabel",
|
|
2653
3008
|
publicName: "clearLabel",
|
|
@@ -2726,7 +3081,7 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2726
3081
|
}
|
|
2727
3082
|
],
|
|
2728
3083
|
ngImport: i0,
|
|
2729
|
-
template: "<wr-input-group>\n <input\n #startInput\n wrInput\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n class=\"wr-date-range-picker__input\"\n [size]=\"size()\"\n [attr.aria-label]=\"startLabel()\"\n [attr.aria-invalid]=\"startAriaInvalid()\"\n [attr.aria-describedby]=\"startDescribedBy()\"\n [value]=\"startText()\"\n [placeholder]=\"startPlaceholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput(0)\"\n (keydown)=\"onFieldKey($event, 0)\"\n (input)=\"onStartInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"wr-date-range-picker__separator\" aria-hidden=\"true\">{{ separator() }}</span>\n <!--\n `wrDateRangeEnd` hides the surrounding `<wr-form-field>` from this input, so\n only the start one adopts its `controlId` — see the directive for why the\n second half of a range carries no id at all.\n -->\n <input\n #endInput\n wrInput\n wrDateRangeEnd\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n class=\"wr-date-range-picker__input\"\n [size]=\"size()\"\n [attr.aria-label]=\"endLabel()\"\n [attr.aria-invalid]=\"endAriaInvalid()\"\n [attr.aria-describedby]=\"endDescribedBy()\"\n [value]=\"endText()\"\n [placeholder]=\"endPlaceholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput(1)\"\n (keydown)=\"onFieldKey($event, 1)\"\n (input)=\"onEndInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- Pointer-only, as the select's is: emptying both fields is the keyboard way to clear. -->\n @if (clearable() && hasValue() && !disabled() && !readonly()) {\n <span\n class=\"wr-date-picker__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clear($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\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 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n <!--\n `readonly` refuses to open the popup, so the trigger is disabled with it —\n otherwise it stays a focusable button advertising `aria-haspopup=\"dialog\"`\n for a dialog it will never show.\n -->\n <button\n #trigger\n type=\"button\"\n wrInputSuffix\n class=\"wr-date-picker__trigger\"\n [attr.aria-label]=\"triggerLabel()\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-expanded]=\"overlayOpen()\"\n [attr.aria-controls]=\"overlayOpen() ? panelId : null\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"toggleOverlay()\"\n (blur)=\"onBlur($event)\"\n >\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 </button>\n</wr-input-group>\n<!--\n Why a typed end was refused, for a screen reader — the same live region\n <wr-date-picker> carries, written when a refusal is shown and emptied when it is\n corrected. Silent inside a <wr-form-field> bound to the same control, and for a\n refusal the app's catalog has no `validation.*` sentence for.\n-->\n<span class=\"wr-date-range-picker__sr-only\" role=\"status\" [id]=\"statusId\">{{ announcement() }}</span>\n",
|
|
3084
|
+
template: "<wr-input-group [rounded]=\"rounded()\">\n <input\n #startInput\n wrInput\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n class=\"wr-date-range-picker__input\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [attr.aria-label]=\"startLabel()\"\n [attr.aria-invalid]=\"startAriaInvalid()\"\n [attr.aria-describedby]=\"startDescribedBy()\"\n [value]=\"startText()\"\n [placeholder]=\"startPlaceholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput(0)\"\n (keydown)=\"onFieldKey($event, 0)\"\n (input)=\"onStartInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"wr-date-range-picker__separator\" aria-hidden=\"true\">{{ separator() }}</span>\n <!--\n `wrDateRangeEnd` hides the surrounding `<wr-form-field>` from this input, so\n only the start one adopts its `controlId` — see the directive for why the\n second half of a range carries no id at all.\n -->\n <input\n #endInput\n wrInput\n wrDateRangeEnd\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n class=\"wr-date-range-picker__input\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [attr.aria-label]=\"endLabel()\"\n [attr.aria-invalid]=\"endAriaInvalid()\"\n [attr.aria-describedby]=\"endDescribedBy()\"\n [value]=\"endText()\"\n [placeholder]=\"endPlaceholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput(1)\"\n (keydown)=\"onFieldKey($event, 1)\"\n (input)=\"onEndInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- Pointer-only, as the select's is: emptying both fields is the keyboard way to clear. -->\n @if (clearable() && hasValue() && !disabled() && !readonly()) {\n <span\n class=\"wr-date-picker__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clear($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\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 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n <!--\n `readonly` refuses to open the popup, so the trigger is disabled with it —\n otherwise it stays a focusable button advertising `aria-haspopup=\"dialog\"`\n for a dialog it will never show.\n -->\n <button\n #trigger\n type=\"button\"\n wrInputSuffix\n class=\"wr-date-picker__trigger\"\n [attr.aria-label]=\"triggerLabel()\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-expanded]=\"overlayOpen()\"\n [attr.aria-controls]=\"overlayOpen() ? panelId : null\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"toggleOverlay()\"\n (blur)=\"onBlur($event)\"\n >\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 </button>\n</wr-input-group>\n<!--\n Why a typed end was refused, for a screen reader — the same live region\n <wr-date-picker> carries, written when a refusal is shown and emptied when it is\n corrected. Silent inside a <wr-form-field> bound to the same control, and for a\n refusal the app's catalog has no `validation.*` sentence for.\n-->\n<span class=\"wr-date-range-picker__sr-only\" role=\"status\" [id]=\"statusId\">{{ announcement() }}</span>\n",
|
|
2730
3085
|
dependencies: [
|
|
2731
3086
|
{
|
|
2732
3087
|
kind: "directive",
|
|
@@ -2743,7 +3098,13 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2743
3098
|
kind: "component",
|
|
2744
3099
|
type: WrInputGroup,
|
|
2745
3100
|
selector: "wr-input-group",
|
|
2746
|
-
inputs: [
|
|
3101
|
+
inputs: [
|
|
3102
|
+
"rounded",
|
|
3103
|
+
"clearable",
|
|
3104
|
+
"clearLabel",
|
|
3105
|
+
"loading"
|
|
3106
|
+
],
|
|
3107
|
+
outputs: ["cleared"]
|
|
2747
3108
|
},
|
|
2748
3109
|
{
|
|
2749
3110
|
kind: "directive",
|
|
@@ -2757,7 +3118,7 @@ var WrDateRangePicker = class WrDateRangePicker {
|
|
|
2757
3118
|
};
|
|
2758
3119
|
i0.ɵɵngDeclareClassMetadata({
|
|
2759
3120
|
minVersion: "12.0.0",
|
|
2760
|
-
version: "22.2.
|
|
3121
|
+
version: "22.2.6",
|
|
2761
3122
|
ngImport: i0,
|
|
2762
3123
|
type: WrDateRangePicker,
|
|
2763
3124
|
decorators: [{
|
|
@@ -2777,7 +3138,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2777
3138
|
],
|
|
2778
3139
|
providers: [WrDateInputField],
|
|
2779
3140
|
viewProviders: [WR_DATE_INPUT_FIELD_VIEW_PROVIDER],
|
|
2780
|
-
template: "<wr-input-group>\n <input\n #startInput\n wrInput\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n class=\"wr-date-range-picker__input\"\n [size]=\"size()\"\n [attr.aria-label]=\"startLabel()\"\n [attr.aria-invalid]=\"startAriaInvalid()\"\n [attr.aria-describedby]=\"startDescribedBy()\"\n [value]=\"startText()\"\n [placeholder]=\"startPlaceholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput(0)\"\n (keydown)=\"onFieldKey($event, 0)\"\n (input)=\"onStartInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"wr-date-range-picker__separator\" aria-hidden=\"true\">{{ separator() }}</span>\n <!--\n `wrDateRangeEnd` hides the surrounding `<wr-form-field>` from this input, so\n only the start one adopts its `controlId` — see the directive for why the\n second half of a range carries no id at all.\n -->\n <input\n #endInput\n wrInput\n wrDateRangeEnd\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n class=\"wr-date-range-picker__input\"\n [size]=\"size()\"\n [attr.aria-label]=\"endLabel()\"\n [attr.aria-invalid]=\"endAriaInvalid()\"\n [attr.aria-describedby]=\"endDescribedBy()\"\n [value]=\"endText()\"\n [placeholder]=\"endPlaceholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput(1)\"\n (keydown)=\"onFieldKey($event, 1)\"\n (input)=\"onEndInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- Pointer-only, as the select's is: emptying both fields is the keyboard way to clear. -->\n @if (clearable() && hasValue() && !disabled() && !readonly()) {\n <span\n class=\"wr-date-picker__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clear($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\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 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n <!--\n `readonly` refuses to open the popup, so the trigger is disabled with it —\n otherwise it stays a focusable button advertising `aria-haspopup=\"dialog\"`\n for a dialog it will never show.\n -->\n <button\n #trigger\n type=\"button\"\n wrInputSuffix\n class=\"wr-date-picker__trigger\"\n [attr.aria-label]=\"triggerLabel()\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-expanded]=\"overlayOpen()\"\n [attr.aria-controls]=\"overlayOpen() ? panelId : null\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"toggleOverlay()\"\n (blur)=\"onBlur($event)\"\n >\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 </button>\n</wr-input-group>\n<!--\n Why a typed end was refused, for a screen reader — the same live region\n <wr-date-picker> carries, written when a refusal is shown and emptied when it is\n corrected. Silent inside a <wr-form-field> bound to the same control, and for a\n refusal the app's catalog has no `validation.*` sentence for.\n-->\n<span class=\"wr-date-range-picker__sr-only\" role=\"status\" [id]=\"statusId\">{{ announcement() }}</span>\n"
|
|
3141
|
+
template: "<wr-input-group [rounded]=\"rounded()\">\n <input\n #startInput\n wrInput\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n class=\"wr-date-range-picker__input\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [attr.aria-label]=\"startLabel()\"\n [attr.aria-invalid]=\"startAriaInvalid()\"\n [attr.aria-describedby]=\"startDescribedBy()\"\n [value]=\"startText()\"\n [placeholder]=\"startPlaceholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput(0)\"\n (keydown)=\"onFieldKey($event, 0)\"\n (input)=\"onStartInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"wr-date-range-picker__separator\" aria-hidden=\"true\">{{ separator() }}</span>\n <!--\n `wrDateRangeEnd` hides the surrounding `<wr-form-field>` from this input, so\n only the start one adopts its `controlId` — see the directive for why the\n second half of a range carries no id at all.\n -->\n <input\n #endInput\n wrInput\n wrDateRangeEnd\n type=\"text\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n class=\"wr-date-range-picker__input\"\n [size]=\"size()\"\n [rounded]=\"rounded()\"\n [attr.aria-label]=\"endLabel()\"\n [attr.aria-invalid]=\"endAriaInvalid()\"\n [attr.aria-describedby]=\"endDescribedBy()\"\n [value]=\"endText()\"\n [placeholder]=\"endPlaceholder()\"\n [disabled]=\"disabled()\"\n [readonly]=\"readonly()\"\n (click)=\"openOnInput(1)\"\n (keydown)=\"onFieldKey($event, 1)\"\n (input)=\"onEndInput($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- Pointer-only, as the select's is: emptying both fields is the keyboard way to clear. -->\n @if (clearable() && hasValue() && !disabled() && !readonly()) {\n <span\n class=\"wr-date-picker__clear\"\n role=\"button\"\n [attr.aria-label]=\"resolvedClear()\"\n tabindex=\"-1\"\n (click)=\"clear($event)\"\n >\n <svg\n class=\"wr-icon__svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\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 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n </span>\n }\n <!--\n `readonly` refuses to open the popup, so the trigger is disabled with it —\n otherwise it stays a focusable button advertising `aria-haspopup=\"dialog\"`\n for a dialog it will never show.\n -->\n <button\n #trigger\n type=\"button\"\n wrInputSuffix\n class=\"wr-date-picker__trigger\"\n [attr.aria-label]=\"triggerLabel()\"\n [attr.aria-haspopup]=\"'dialog'\"\n [attr.aria-expanded]=\"overlayOpen()\"\n [attr.aria-controls]=\"overlayOpen() ? panelId : null\"\n [disabled]=\"disabled() || readonly()\"\n (click)=\"toggleOverlay()\"\n (blur)=\"onBlur($event)\"\n >\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 </button>\n</wr-input-group>\n<!--\n Why a typed end was refused, for a screen reader — the same live region\n <wr-date-picker> carries, written when a refusal is shown and emptied when it is\n corrected. Silent inside a <wr-form-field> bound to the same control, and for a\n refusal the app's catalog has no `validation.*` sentence for.\n-->\n<span class=\"wr-date-range-picker__sr-only\" role=\"status\" [id]=\"statusId\">{{ announcement() }}</span>\n"
|
|
2781
3142
|
}]
|
|
2782
3143
|
}],
|
|
2783
3144
|
ctorParameters: () => [],
|
|
@@ -2878,6 +3239,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2878
3239
|
required: false
|
|
2879
3240
|
}]
|
|
2880
3241
|
}],
|
|
3242
|
+
rounded: [{
|
|
3243
|
+
type: i0.Input,
|
|
3244
|
+
args: [{
|
|
3245
|
+
isSignal: true,
|
|
3246
|
+
alias: "rounded",
|
|
3247
|
+
required: false
|
|
3248
|
+
}]
|
|
3249
|
+
}],
|
|
2881
3250
|
clearable: [{
|
|
2882
3251
|
type: i0.Input,
|
|
2883
3252
|
args: [{
|
|
@@ -2886,6 +3255,22 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2886
3255
|
required: false
|
|
2887
3256
|
}]
|
|
2888
3257
|
}],
|
|
3258
|
+
presets: [{
|
|
3259
|
+
type: i0.Input,
|
|
3260
|
+
args: [{
|
|
3261
|
+
isSignal: true,
|
|
3262
|
+
alias: "presets",
|
|
3263
|
+
required: false
|
|
3264
|
+
}]
|
|
3265
|
+
}],
|
|
3266
|
+
presetsLabel: [{
|
|
3267
|
+
type: i0.Input,
|
|
3268
|
+
args: [{
|
|
3269
|
+
isSignal: true,
|
|
3270
|
+
alias: "presetsLabel",
|
|
3271
|
+
required: false
|
|
3272
|
+
}]
|
|
3273
|
+
}],
|
|
2889
3274
|
clearLabel: [{
|
|
2890
3275
|
type: i0.Input,
|
|
2891
3276
|
args: [{
|
|
@@ -2963,6 +3348,38 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2963
3348
|
}]
|
|
2964
3349
|
}
|
|
2965
3350
|
});
|
|
2966
|
-
|
|
3351
|
+
/**
|
|
3352
|
+
* @license
|
|
3353
|
+
*
|
|
3354
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
3355
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
3356
|
+
*/
|
|
3357
|
+
function endOfDay(adapter, day) {
|
|
3358
|
+
return adapter.setTime(day, 23, 59, 59);
|
|
3359
|
+
}
|
|
3360
|
+
function startOfMonth(adapter, date) {
|
|
3361
|
+
return adapter.createDate(adapter.getYear(date), adapter.getMonth(date), 1);
|
|
3362
|
+
}
|
|
3363
|
+
function wholeMonth(adapter, first) {
|
|
3364
|
+
return [first, endOfDay(adapter, adapter.addDays(first, adapter.getDaysInMonth(first) - 1))];
|
|
3365
|
+
}
|
|
3366
|
+
function wrLastDays(days) {
|
|
3367
|
+
const back = Math.max(1, Math.trunc(days)) - 1;
|
|
3368
|
+
return ({ adapter, today }) => [adapter.addDays(today, -back), endOfDay(adapter, today)];
|
|
3369
|
+
}
|
|
3370
|
+
function wrThisWeek() {
|
|
3371
|
+
return ({ adapter, today }) => {
|
|
3372
|
+
const offset = (adapter.getDayOfWeek(today) - adapter.getFirstDayOfWeek() + 7) % 7;
|
|
3373
|
+
const first = adapter.addDays(today, -offset);
|
|
3374
|
+
return [first, endOfDay(adapter, adapter.addDays(first, 6))];
|
|
3375
|
+
};
|
|
3376
|
+
}
|
|
3377
|
+
function wrThisMonth() {
|
|
3378
|
+
return ({ adapter, today }) => wholeMonth(adapter, startOfMonth(adapter, today));
|
|
3379
|
+
}
|
|
3380
|
+
function wrLastMonth() {
|
|
3381
|
+
return ({ adapter, today }) => wholeMonth(adapter, adapter.addMonths(startOfMonth(adapter, today), -1));
|
|
3382
|
+
}
|
|
3383
|
+
export { WrDatePicker, WrDateRangePicker, wrLastDays, wrLastMonth, wrThisMonth, wrThisWeek };
|
|
2967
3384
|
|
|
2968
3385
|
//# sourceMappingURL=ngwr-date-picker.mjs.map
|