ngwr 16.5.0 → 16.7.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/avatar/styles/_index.scss +39 -0
- package/back-top/styles/_index.scss +6 -0
- package/breadcrumbs/styles/_rules.scss +34 -0
- package/button/styles/_index.scss +45 -2
- package/cascader/styles/_rules.scss +7 -0
- package/charts/chart-legend/styles/_index.scss +1 -9
- package/copy-value/styles/_index.scss +4 -0
- package/counter/styles/_index.scss +1 -8
- package/date-picker/styles/_index.scss +15 -9
- package/dialog/styles/_index.scss +37 -0
- package/dropdown/styles/_index.scss +17 -0
- package/editor/styles/_index.scss +1 -8
- package/event-calendar/styles/_index.scss +2 -6
- package/fesm2022/ngwr-affix.mjs +4 -4
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +12 -5
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-aurora.mjs +3 -3
- package/fesm2022/ngwr-animations-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
- package/fesm2022/ngwr-animations-click-sparks.mjs.map +1 -1
- package/fesm2022/ngwr-animations-confetti.mjs +3 -3
- package/fesm2022/ngwr-animations-confetti.mjs.map +1 -1
- package/fesm2022/ngwr-animations-decode.mjs +3 -3
- package/fesm2022/ngwr-animations-decode.mjs.map +1 -1
- package/fesm2022/ngwr-animations-destruct.mjs +3 -3
- package/fesm2022/ngwr-animations-destruct.mjs.map +1 -1
- package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-dot-grid.mjs.map +1 -1
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs.map +1 -1
- package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-flow-lines.mjs.map +1 -1
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
- package/fesm2022/ngwr-animations-fluid-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-glitch.mjs +3 -3
- package/fesm2022/ngwr-animations-glitch.mjs.map +1 -1
- package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
- package/fesm2022/ngwr-animations-glow-border.mjs.map +1 -1
- package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
- package/fesm2022/ngwr-animations-gradient-flow.mjs.map +1 -1
- package/fesm2022/ngwr-animations-marquee.mjs +4 -3
- package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-animations-orbit.mjs +3 -3
- package/fesm2022/ngwr-animations-orbit.mjs.map +1 -1
- package/fesm2022/ngwr-animations-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-ripple-grid.mjs.map +1 -1
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-rotate-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
- package/fesm2022/ngwr-animations-shimmer.mjs.map +1 -1
- package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
- package/fesm2022/ngwr-animations-spotlight.mjs.map +1 -1
- package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-thread-lines.mjs.map +1 -1
- package/fesm2022/ngwr-animations-tilt.mjs +23 -16
- package/fesm2022/ngwr-animations-tilt.mjs.map +1 -1
- package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
- package/fesm2022/ngwr-animations-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-avatar.mjs +171 -6
- package/fesm2022/ngwr-avatar.mjs.map +1 -1
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +6 -6
- package/fesm2022/ngwr-breadcrumbs.mjs +47 -13
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +38 -9
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +3 -3
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-carousel.mjs +14 -8
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +27 -7
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +3 -3
- 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 +9 -9
- package/fesm2022/ngwr-charts-core.mjs +18 -11
- package/fesm2022/ngwr-charts-core.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart.mjs +3 -3
- 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.mjs +3 -3
- package/fesm2022/ngwr-charts-meter-group.mjs +7 -5
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-scatter-chart.mjs +3 -3
- 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 +9 -8
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker.mjs +27 -7
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-comment.mjs +7 -6
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +16 -17
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- 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 +35 -0
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +151 -54
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +3 -3
- package/fesm2022/ngwr-date.mjs +40 -16
- 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 +35 -24
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +189 -23
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs +18 -18
- package/fesm2022/ngwr-dropdown-testing.mjs +5 -1
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +59 -16
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +6 -5
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +27 -15
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +5 -0
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +68 -13
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +181 -12
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +30 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +100 -11
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +21 -2
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +21 -2
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +21 -2
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +21 -2
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +21 -2
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +21 -2
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +21 -2
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +21 -2
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +21 -2
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +21 -2
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +21 -2
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-kk.mjs +520 -0
- package/fesm2022/ngwr-i18n-kk.mjs.map +1 -0
- package/fesm2022/ngwr-i18n-ko.mjs +21 -2
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +21 -2
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +21 -2
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +21 -2
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +21 -2
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +21 -2
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +21 -2
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +21 -2
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +21 -2
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +21 -2
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +21 -2
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +91 -20
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper.mjs +8 -4
- package/fesm2022/ngwr-image-cropper.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +27 -4
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +5 -5
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +25 -17
- 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-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +8 -8
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +9 -9
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +16 -15
- package/fesm2022/ngwr-load-state.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +8 -8
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +14 -6
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +15 -12
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +9 -9
- package/fesm2022/ngwr-page-header.mjs +24 -3
- package/fesm2022/ngwr-page-header.mjs.map +1 -1
- package/fesm2022/ngwr-pagination-testing.mjs +3 -0
- package/fesm2022/ngwr-pagination-testing.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +34 -5
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +35 -28
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm.mjs +9 -7
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +162 -18
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +75 -10
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +9 -5
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +77 -11
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-resizable.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-schema-form.mjs +20 -7
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +233 -10
- package/fesm2022/ngwr-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +23 -3
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +106 -26
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar-testing.mjs +17 -1
- package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar.mjs +66 -11
- package/fesm2022/ngwr-sidebar.mjs.map +1 -1
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider.mjs +3 -3
- package/fesm2022/ngwr-sortable-list.mjs +27 -15
- 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 +6 -6
- package/fesm2022/ngwr-storage.mjs +4 -4
- package/fesm2022/ngwr-storage.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +5 -5
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table-router.mjs +89 -0
- package/fesm2022/ngwr-table-router.mjs.map +1 -0
- package/fesm2022/ngwr-table-testing.mjs +5 -0
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +307 -47
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +9 -5
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs +8 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +60 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +5 -5
- 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 +43 -15
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +9 -8
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +4 -3
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +3 -3
- package/fesm2022/ngwr-typography.mjs +23 -3
- package/fesm2022/ngwr-typography.mjs.map +1 -1
- package/fesm2022/ngwr-utils-router.mjs +3 -3
- package/fesm2022/ngwr-utils-router.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +74 -4
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-validators.mjs +33 -1
- package/fesm2022/ngwr-validators.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 +18 -13
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +16 -0
- package/form/styles/_index.scss +37 -0
- package/graph/styles/_index.scss +49 -9
- package/i18n/ar.json +19 -2
- package/i18n/cs.json +19 -2
- package/i18n/de.json +19 -2
- package/i18n/en.json +19 -2
- package/i18n/es.json +19 -2
- package/i18n/fr.json +19 -2
- package/i18n/he.json +19 -2
- package/i18n/hi.json +19 -2
- package/i18n/id.json +19 -2
- package/i18n/it.json +19 -2
- package/i18n/ja.json +19 -2
- package/i18n/kk.json +567 -0
- package/i18n/ko.json +19 -2
- package/i18n/nl.json +19 -2
- package/i18n/pl.json +19 -2
- package/i18n/pt.json +19 -2
- package/i18n/ru.json +19 -2
- package/i18n/sv.json +19 -2
- package/i18n/tr.json +19 -2
- package/i18n/uk.json +19 -2
- package/i18n/vi.json +19 -2
- package/i18n/zh-TW.json +19 -2
- package/i18n/zh.json +19 -2
- package/image-cropper/styles/_index.scss +1 -9
- package/input-number/styles/_index.scss +7 -0
- package/layout/styles/_index.scss +13 -1
- package/llms-full.txt +37 -26
- package/llms.txt +4 -1
- package/loading-bar/styles/_rules.scss +6 -0
- package/package.json +16 -8
- package/page-header/styles/_index.scss +18 -0
- package/pagination/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +9 -0
- package/progress/styles/_index.scss +64 -0
- package/schematics/use/symbol-map.json +7 -0
- package/segmented/styles/_index.scss +7 -0
- package/select/styles/_index.scss +7 -0
- package/sidebar/styles/_index.scss +64 -6
- package/skills/ngwr/SKILL.md +7 -6
- package/skills/ngwr/references/catalog.md +7 -5
- package/sortable-list/styles/_rules.scss +1 -9
- package/speed-dial/styles/_index.scss +6 -0
- package/stepper/styles/_index.scss +1 -9
- package/table/styles/_index.scss +168 -30
- package/tabs/styles/_index.scss +9 -0
- package/theme/_index.scss +12 -1
- package/theme/styles/_colors.scss +11 -0
- package/theme/styles/_contrast.scss +6 -0
- package/theme/styles/_focus.scss +3 -1
- package/theme/styles/_index.scss +1 -0
- package/theme/styles/_mixins.scss +45 -0
- package/theme/styles/_print.scss +17 -0
- package/toast/styles/_index.scss +7 -0
- package/tour/styles/_index.scss +9 -0
- package/tree/styles/_index.scss +1 -9
- package/types/ngwr-anchor.d.ts +3 -0
- package/types/ngwr-animations-aurora.d.ts +6 -0
- package/types/ngwr-animations-blur-reveal.d.ts +6 -0
- package/types/ngwr-animations-click-sparks.d.ts +6 -0
- package/types/ngwr-animations-confetti.d.ts +6 -0
- package/types/ngwr-animations-decode.d.ts +6 -0
- package/types/ngwr-animations-destruct.d.ts +6 -0
- package/types/ngwr-animations-dot-grid.d.ts +6 -0
- package/types/ngwr-animations-falling-letters.d.ts +6 -0
- package/types/ngwr-animations-flow-lines.d.ts +6 -0
- package/types/ngwr-animations-fluid-cursor.d.ts +6 -0
- package/types/ngwr-animations-glitch.d.ts +6 -0
- package/types/ngwr-animations-glow-border.d.ts +6 -0
- package/types/ngwr-animations-gradient-flow.d.ts +6 -0
- package/types/ngwr-animations-marquee.d.ts +6 -0
- package/types/ngwr-animations-orbit.d.ts +6 -0
- package/types/ngwr-animations-reveal.d.ts +6 -0
- package/types/ngwr-animations-ripple-grid.d.ts +6 -0
- package/types/ngwr-animations-rotate-reveal.d.ts +6 -0
- package/types/ngwr-animations-shimmer.d.ts +6 -0
- package/types/ngwr-animations-spotlight.d.ts +6 -0
- package/types/ngwr-animations-thread-lines.d.ts +6 -0
- package/types/ngwr-animations-tilt.d.ts +10 -0
- package/types/ngwr-animations-typewriter.d.ts +6 -0
- package/types/ngwr-avatar.d.ts +39 -0
- package/types/ngwr-breadcrumbs.d.ts +25 -0
- package/types/ngwr-button.d.ts +35 -3
- package/types/ngwr-carousel.d.ts +2 -0
- package/types/ngwr-cascader.d.ts +7 -0
- package/types/ngwr-charts-core.d.ts +16 -0
- package/types/ngwr-charts-meter-group.d.ts +2 -0
- package/types/ngwr-checkbox.d.ts +1 -0
- package/types/ngwr-color-picker.d.ts +1 -0
- package/types/ngwr-context-menu.d.ts +1 -1
- package/types/ngwr-date-picker-testing.d.ts +22 -0
- package/types/ngwr-date-picker.d.ts +97 -17
- package/types/ngwr-date.d.ts +51 -0
- package/types/ngwr-dialog.d.ts +39 -8
- package/types/ngwr-directives.d.ts +57 -4
- package/types/ngwr-drawer.d.ts +1 -1
- package/types/ngwr-dropdown-testing.d.ts +8 -1
- package/types/ngwr-dropdown.d.ts +30 -1
- package/types/ngwr-event-calendar.d.ts +4 -0
- package/types/ngwr-file-upload-testing.d.ts +10 -0
- package/types/ngwr-file-upload.d.ts +55 -1
- package/types/ngwr-form.d.ts +87 -1
- package/types/ngwr-graph-testing.d.ts +28 -1
- package/types/ngwr-graph.d.ts +53 -3
- package/types/ngwr-i18n-kk.d.ts +3 -0
- package/types/ngwr-i18n.d.ts +65 -5
- package/types/ngwr-image-cropper.d.ts +6 -0
- package/types/ngwr-input-number.d.ts +8 -0
- package/types/ngwr-input.d.ts +7 -0
- package/types/ngwr-layout.d.ts +1 -1
- package/types/ngwr-loading-bar-router.d.ts +6 -0
- package/types/ngwr-page-header.d.ts +23 -1
- package/types/ngwr-pagination-testing.d.ts +8 -0
- package/types/ngwr-pagination.d.ts +16 -0
- package/types/ngwr-popconfirm.d.ts +1 -1
- package/types/ngwr-popover.d.ts +67 -4
- package/types/ngwr-progress.d.ts +63 -1
- package/types/ngwr-radio.d.ts +47 -5
- package/types/ngwr-scroll.d.ts +86 -0
- package/types/ngwr-segmented.d.ts +7 -0
- package/types/ngwr-select.d.ts +88 -25
- package/types/ngwr-sidebar-testing.d.ts +21 -7
- package/types/ngwr-sidebar.d.ts +66 -4
- package/types/ngwr-sortable-list.d.ts +20 -7
- package/types/ngwr-table-router.d.ts +49 -0
- package/types/ngwr-table-testing.d.ts +7 -0
- package/types/ngwr-table.d.ts +241 -10
- package/types/ngwr-tabs-router.d.ts +7 -1
- package/types/ngwr-tabs-testing.d.ts +5 -1
- package/types/ngwr-tabs.d.ts +34 -1
- package/types/ngwr-toast.d.ts +11 -0
- package/types/ngwr-tour.d.ts +0 -1
- package/types/ngwr-typography.d.ts +7 -0
- package/types/ngwr-utils-router.d.ts +6 -0
- package/types/ngwr-utils.d.ts +69 -2
- package/types/ngwr-validators.d.ts +49 -1
- package/types/ngwr-version.d.ts +1 -1
- package/typography/styles/_index.scss +4 -0
- package/window/styles/_index.scss +1 -9
|
@@ -21,7 +21,7 @@ var WrLoadStateContent = class WrLoadStateContent {
|
|
|
21
21
|
}
|
|
22
22
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
23
23
|
minVersion: "12.0.0",
|
|
24
|
-
version: "22.
|
|
24
|
+
version: "22.3.0",
|
|
25
25
|
ngImport: i0,
|
|
26
26
|
type: WrLoadStateContent,
|
|
27
27
|
deps: [],
|
|
@@ -29,7 +29,7 @@ var WrLoadStateContent = class WrLoadStateContent {
|
|
|
29
29
|
});
|
|
30
30
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
31
31
|
minVersion: "17.1.0",
|
|
32
|
-
version: "22.
|
|
32
|
+
version: "22.3.0",
|
|
33
33
|
type: WrLoadStateContent,
|
|
34
34
|
isStandalone: true,
|
|
35
35
|
selector: "ng-template[wrLoadStateContent]",
|
|
@@ -45,7 +45,7 @@ var WrLoadStateContent = class WrLoadStateContent {
|
|
|
45
45
|
};
|
|
46
46
|
i0.ɵɵngDeclareClassMetadata({
|
|
47
47
|
minVersion: "12.0.0",
|
|
48
|
-
version: "22.
|
|
48
|
+
version: "22.3.0",
|
|
49
49
|
ngImport: i0,
|
|
50
50
|
type: WrLoadStateContent,
|
|
51
51
|
decorators: [{
|
|
@@ -65,7 +65,7 @@ var WrLoadStateLoading = class WrLoadStateLoading {
|
|
|
65
65
|
template = inject(TemplateRef);
|
|
66
66
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
67
67
|
minVersion: "12.0.0",
|
|
68
|
-
version: "22.
|
|
68
|
+
version: "22.3.0",
|
|
69
69
|
ngImport: i0,
|
|
70
70
|
type: WrLoadStateLoading,
|
|
71
71
|
deps: [],
|
|
@@ -73,7 +73,7 @@ var WrLoadStateLoading = class WrLoadStateLoading {
|
|
|
73
73
|
});
|
|
74
74
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
75
75
|
minVersion: "14.0.0",
|
|
76
|
-
version: "22.
|
|
76
|
+
version: "22.3.0",
|
|
77
77
|
type: WrLoadStateLoading,
|
|
78
78
|
isStandalone: true,
|
|
79
79
|
selector: "ng-template[wrLoadStateLoading]",
|
|
@@ -82,7 +82,7 @@ var WrLoadStateLoading = class WrLoadStateLoading {
|
|
|
82
82
|
};
|
|
83
83
|
i0.ɵɵngDeclareClassMetadata({
|
|
84
84
|
minVersion: "12.0.0",
|
|
85
|
-
version: "22.
|
|
85
|
+
version: "22.3.0",
|
|
86
86
|
ngImport: i0,
|
|
87
87
|
type: WrLoadStateLoading,
|
|
88
88
|
decorators: [{
|
|
@@ -97,7 +97,7 @@ var WrLoadStateError = class WrLoadStateError {
|
|
|
97
97
|
}
|
|
98
98
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
99
99
|
minVersion: "12.0.0",
|
|
100
|
-
version: "22.
|
|
100
|
+
version: "22.3.0",
|
|
101
101
|
ngImport: i0,
|
|
102
102
|
type: WrLoadStateError,
|
|
103
103
|
deps: [],
|
|
@@ -105,7 +105,7 @@ var WrLoadStateError = class WrLoadStateError {
|
|
|
105
105
|
});
|
|
106
106
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
107
107
|
minVersion: "14.0.0",
|
|
108
|
-
version: "22.
|
|
108
|
+
version: "22.3.0",
|
|
109
109
|
type: WrLoadStateError,
|
|
110
110
|
isStandalone: true,
|
|
111
111
|
selector: "ng-template[wrLoadStateError]",
|
|
@@ -114,7 +114,7 @@ var WrLoadStateError = class WrLoadStateError {
|
|
|
114
114
|
};
|
|
115
115
|
i0.ɵɵngDeclareClassMetadata({
|
|
116
116
|
minVersion: "12.0.0",
|
|
117
|
-
version: "22.
|
|
117
|
+
version: "22.3.0",
|
|
118
118
|
ngImport: i0,
|
|
119
119
|
type: WrLoadStateError,
|
|
120
120
|
decorators: [{
|
|
@@ -126,7 +126,7 @@ var WrLoadStateEmpty = class WrLoadStateEmpty {
|
|
|
126
126
|
template = inject(TemplateRef);
|
|
127
127
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
128
128
|
minVersion: "12.0.0",
|
|
129
|
-
version: "22.
|
|
129
|
+
version: "22.3.0",
|
|
130
130
|
ngImport: i0,
|
|
131
131
|
type: WrLoadStateEmpty,
|
|
132
132
|
deps: [],
|
|
@@ -134,7 +134,7 @@ var WrLoadStateEmpty = class WrLoadStateEmpty {
|
|
|
134
134
|
});
|
|
135
135
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
136
136
|
minVersion: "14.0.0",
|
|
137
|
-
version: "22.
|
|
137
|
+
version: "22.3.0",
|
|
138
138
|
type: WrLoadStateEmpty,
|
|
139
139
|
isStandalone: true,
|
|
140
140
|
selector: "ng-template[wrLoadStateEmpty]",
|
|
@@ -143,7 +143,7 @@ var WrLoadStateEmpty = class WrLoadStateEmpty {
|
|
|
143
143
|
};
|
|
144
144
|
i0.ɵɵngDeclareClassMetadata({
|
|
145
145
|
minVersion: "12.0.0",
|
|
146
|
-
version: "22.
|
|
146
|
+
version: "22.3.0",
|
|
147
147
|
ngImport: i0,
|
|
148
148
|
type: WrLoadStateEmpty,
|
|
149
149
|
decorators: [{
|
|
@@ -224,7 +224,7 @@ var WrLoadState = class WrLoadState {
|
|
|
224
224
|
}
|
|
225
225
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
226
226
|
minVersion: "12.0.0",
|
|
227
|
-
version: "22.
|
|
227
|
+
version: "22.3.0",
|
|
228
228
|
ngImport: i0,
|
|
229
229
|
type: WrLoadState,
|
|
230
230
|
deps: [],
|
|
@@ -232,7 +232,7 @@ var WrLoadState = class WrLoadState {
|
|
|
232
232
|
});
|
|
233
233
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
234
234
|
minVersion: "17.0.0",
|
|
235
|
-
version: "22.
|
|
235
|
+
version: "22.3.0",
|
|
236
236
|
type: WrLoadState,
|
|
237
237
|
isStandalone: true,
|
|
238
238
|
selector: "wr-load-state",
|
|
@@ -380,6 +380,7 @@ var WrLoadState = class WrLoadState {
|
|
|
380
380
|
"iconPosition",
|
|
381
381
|
"disabled",
|
|
382
382
|
"outlined",
|
|
383
|
+
"ghost",
|
|
383
384
|
"block",
|
|
384
385
|
"loading",
|
|
385
386
|
"disabledWhenLoading"
|
|
@@ -391,7 +392,7 @@ var WrLoadState = class WrLoadState {
|
|
|
391
392
|
};
|
|
392
393
|
i0.ɵɵngDeclareClassMetadata({
|
|
393
394
|
minVersion: "12.0.0",
|
|
394
|
-
version: "22.
|
|
395
|
+
version: "22.3.0",
|
|
395
396
|
ngImport: i0,
|
|
396
397
|
type: WrLoadState,
|
|
397
398
|
decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-load-state.mjs","names":[],"sources":["../../../projects/lib/load-state/load-state-templates.ts","../../../projects/lib/load-state/load-state.ts","../../../projects/lib/load-state/load-state.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, type Resource, TemplateRef, inject, input } from '@angular/core';\n\nimport type { WrSafeAny } from 'ngwr/utils';\n\nimport type { WrLoadStateContentContext, WrLoadStateErrorContext } from './types';\n\n/**\n * The content `<wr-load-state>` draws once the data is ready. A template rather\n * than projected content, so nothing of it is created before that: a plain\n * `<ng-content>` would be instantiated in every state.\n *\n * Name the resource through `[wrLoadStateContentOf]` and `let-value` arrives\n * typed. The input is read by the type checker only, the way `[wrTableCellOf]`\n * types a table cell: the wrapper hands the template the same context whether\n * or not it is set.\n *\n * @example\n * ```html\n * <wr-load-state [resource]=\"users\">\n * <ng-template wrLoadStateContent [wrLoadStateContentOf]=\"users\" let-users>\n * <wr-table [items]=\"users\" [columns]=\"columns\" />\n * </ng-template>\n * </wr-load-state>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrLoadStateContent]',\n})\nexport class WrLoadStateContent<T = WrSafeAny> {\n /**\n * The resource the template draws, for the type checker: nothing reads it at\n * runtime. Bind the same resource as the wrapper's `[resource]`.\n */\n readonly wrLoadStateContentOf = input<Resource<T | undefined> | null | undefined>(undefined);\n\n readonly template = inject<TemplateRef<WrLoadStateContentContext<T>>>(TemplateRef);\n\n /**\n * Types the template's `let-` variables under `strictTemplates`. `T` defaults\n * to `WrSafeAny` for the reason `WrOptionLeading` gives: without\n * `[wrLoadStateContentOf]` nothing infers the value, and narrowed to\n * `unknown` every `value.length` would stop compiling.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- a guard's parameters exist to be narrowed, never read\n static ngTemplateContextGuard<T>(_dir: WrLoadStateContent<T>, _ctx: unknown): _ctx is WrLoadStateContentContext<T> {\n return true;\n }\n}\n\n/**\n * Replaces the default skeleton while `<wr-load-state>` loads for the first time.\n *\n * @example\n * ```html\n * <ng-template wrLoadStateLoading><wr-spinner /></ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrLoadStateLoading]',\n})\nexport class WrLoadStateLoading {\n readonly template = inject<TemplateRef<void>>(TemplateRef);\n}\n\n/**\n * Replaces the default failure of `<wr-load-state>`. The context carries the\n * error, `retry()` and `retrying`; the error's message is the app's to show.\n *\n * @example\n * ```html\n * <ng-template wrLoadStateError let-error let-retry=\"retry\" let-retrying=\"retrying\">\n * <wr-alert type=\"danger\" title=\"Could not load\" [message]=\"error.message\">\n * <wr-btn wrAlertActions size=\"sm\" [loading]=\"retrying\" (click)=\"retry()\">Try again</wr-btn>\n * </wr-alert>\n * </ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrLoadStateError]',\n})\nexport class WrLoadStateError<E = WrSafeAny> {\n readonly template = inject<TemplateRef<WrLoadStateErrorContext<E>>>(TemplateRef);\n\n /**\n * Types the template's `let-` variables under `strictTemplates`. `E` defaults\n * to `WrSafeAny` for the reason `WrOptionLeading` gives: nothing infers the error\n * type, and narrowed to `unknown`, `error.message` would not compile.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- a guard's parameters exist to be narrowed, never read\n static ngTemplateContextGuard<E>(_dir: WrLoadStateError<E>, _ctx: unknown): _ctx is WrLoadStateErrorContext<E> {\n return true;\n }\n}\n\n/**\n * Replaces the default `<wr-empty>` of `<wr-load-state>`.\n *\n * @example\n * ```html\n * <ng-template wrLoadStateEmpty>\n * <wr-empty title=\"No orders yet\"><wr-btn wrEmptyActions (click)=\"create()\">Create one</wr-btn></wr-empty>\n * </ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrLoadStateEmpty]',\n})\nexport class WrLoadStateEmpty {\n readonly template = inject<TemplateRef<void>>(TemplateRef);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n type Resource,\n ViewEncapsulation,\n type WritableResource,\n computed,\n contentChild,\n input,\n linkedSignal,\n output,\n} from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { WrEmpty } from 'ngwr/empty';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrResult } from 'ngwr/result';\nimport { WrSkeleton } from 'ngwr/skeleton';\nimport { wrNumAttr, type WrSafeAny, wrCheckStyles } from 'ngwr/utils';\n\nimport { WrLoadStateContent, WrLoadStateEmpty, WrLoadStateError, WrLoadStateLoading } from './load-state-templates';\nimport type { WrLoadStateContentContext, WrLoadStateErrorContext, WrLoadStateStatus } from './types';\n\n/** The default `isEmpty`: nothing, or a list with nothing in it. */\nconst isEmptyValue = (value: unknown): boolean => value == null || (Array.isArray(value) && value.length === 0);\n\n/**\n * One wrapper for the four states of a screen that loads: the skeleton, the\n * failure with a retry, the empty slot and the content. Give it a `resource`\n * and it reads the state from there; give it a `status` and the app decides.\n * Never both.\n *\n * The content and any custom part are templates, so nothing of the content is\n * created before it is ready. The defaults are `<wr-skeleton [lines]>`,\n * `<wr-result status=\"error\">` with a retry button, and `<wr-empty>`, so the\n * minimal use is the resource and a content template.\n *\n * What each resource status draws:\n *\n * | `resource.status()` | Drawn |\n * | --------------------- | --------------------------------------------------------------------- |\n * | `loading` | the skeleton |\n * | `reloading` | what was on screen, marked busy; the failure, with its button busy, after a failed load; the skeleton when there is no value yet |\n * | `error` | the failure |\n * | `resolved`, `local` | the empty slot when `isEmpty(value)`, else the content |\n * | `idle` | the content or the empty slot by `isEmpty`: nothing was asked for, so nothing loads |\n *\n * Accessibility: the host carries `aria-busy` while a load is in flight, the\n * failure's title is announced once through a polite live region, nothing is\n * announced for a reload that keeps the content, and focus is never moved.\n *\n * @example\n * ```html\n * <wr-load-state [resource]=\"users\">\n * <ng-template wrLoadStateContent [wrLoadStateContentOf]=\"users\" let-users>\n * <wr-table [items]=\"users\" [columns]=\"columns\" />\n * </ng-template>\n * </wr-load-state>\n *\n * <wr-load-state [status]=\"status()\" (retry)=\"load()\">\n * <ng-template wrLoadStateContent>{{ text() }}</ng-template>\n * </wr-load-state>\n * ```\n *\n * @see https://ngwr.dev/reference/components/load-state\n */\n@Component({\n selector: 'wr-load-state',\n templateUrl: './load-state.html',\n imports: [NgTemplateOutlet, WrSkeleton, WrResult, WrEmpty, WrButton],\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-load-state',\n '[class]': 'classes()',\n '[attr.aria-busy]': 'busy() ? \"true\" : null',\n },\n})\nexport class WrLoadState<T = WrSafeAny> {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('load-state');\n }\n\n /**\n * The state, when the app decides it. Ignored while `resource` is set.\n *\n * @default null\n */\n readonly status = input<WrLoadStateStatus | null>(null);\n\n /**\n * The resource to read the state from: `resource()`, `rxResource()` and\n * `httpResource()` alike. The retry button calls its `reload()`.\n *\n * @default null\n */\n readonly resource = input<Resource<T | undefined> | null>(null);\n\n /**\n * Decides whether a settled value shows the empty slot instead of the content.\n * The default is empty for `null`, `undefined` and an empty array.\n *\n * @default isEmptyValue\n */\n readonly isEmpty = input<(value: T | undefined) => boolean>(isEmptyValue);\n\n /**\n * How many lines the default skeleton draws.\n *\n * @default 3\n */\n readonly lines = input(3, { transform: wrNumAttr(3) });\n\n /** The failure's title. Falls back to `loadState.failed`, then `'Could not load'`. */\n readonly errorLabel = input<string | null>(null);\n\n /** The retry button's label. Falls back to `loadState.retry`, then `'Try again'`. */\n readonly retryLabel = input<string | null>(null);\n\n /** The default empty slot's title. Falls back to `empty.noData` through `<wr-empty>`. */\n readonly emptyLabel = input<string | null>(null);\n\n /**\n * Emitted when the retry button is pressed, once per press that starts a\n * retry. With a `resource`, `reload()` has been called as well.\n */\n readonly retry = output<void>();\n\n protected readonly resolvedErrorLabel = useI18nText(this.errorLabel, 'loadState.failed', 'Could not load');\n protected readonly resolvedRetryLabel = useI18nText(this.retryLabel, 'loadState.retry', 'Try again');\n\n protected readonly contentTpl = contentChild<WrLoadStateContent<T>>(WrLoadStateContent);\n protected readonly loadingTpl = contentChild(WrLoadStateLoading);\n protected readonly errorTpl = contentChild(WrLoadStateError);\n protected readonly emptyTpl = contentChild(WrLoadStateEmpty);\n\n protected readonly state = computed<WrLoadStateStatus>(() => {\n const resource = this.resource();\n if (!resource) return this.status() ?? 'loading';\n const status = resource.status();\n if (status === 'loading') return 'loading';\n if (status === 'error') return 'error';\n const held = resource.hasValue();\n if (status === 'reloading' && !held) return resource.error() !== undefined ? 'error' : 'loading';\n return this.isEmpty()(held ? resource.value() : undefined) ? 'empty' : 'ready';\n });\n\n /** A load is in flight: the first one, or a reload behind whatever is on screen. */\n protected readonly busy = computed(() => {\n const resource = this.resource();\n return resource ? resource.isLoading() : this.state() === 'loading';\n });\n\n /**\n * A press that has not reached the resource's status yet. `reload()` flips the\n * status in the same tick, so with a resource this covers only the gap before\n * it; with a `status` it holds until the app answers the `retry` output.\n */\n private readonly pressed = linkedSignal({\n source: () => [this.status(), this.resource()?.status()],\n computation: () => false,\n });\n\n protected readonly retrying = computed(() => this.pressed() || (this.resource()?.isLoading() ?? false));\n\n protected readonly classes = computed(() => {\n const parts = [`wr-load-state--${this.state()}`];\n if (this.busy()) parts.push('wr-load-state--busy');\n return parts.join(' ');\n });\n\n protected readonly contentContext = computed<WrLoadStateContentContext<T | undefined>>(() => {\n const resource = this.resource();\n return {\n $implicit: resource?.hasValue() ? resource.value() : undefined,\n reloading: this.busy(),\n };\n });\n\n protected readonly errorContext = computed<WrLoadStateErrorContext>(() => ({\n $implicit: this.resource()?.error(),\n retry: () => this.onRetry(),\n retrying: this.retrying(),\n }));\n\n /** A second press while one is in flight starts nothing. */\n protected onRetry(): void {\n if (this.retrying()) return;\n this.pressed.set(true);\n this.retry.emit();\n (this.resource() as Partial<WritableResource<T | undefined>> | null)?.reload?.();\n }\n}\n","@switch (state()) {\n @case ('loading') {\n @if (loadingTpl(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" />\n } @else {\n <wr-skeleton class=\"wr-load-state__skeleton\" [lines]=\"lines()\" />\n }\n }\n @case ('error') {\n @if (errorTpl(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"errorContext()\" />\n } @else {\n <wr-result class=\"wr-load-state__error\" status=\"error\" [title]=\"resolvedErrorLabel()\">\n <wr-btn wrResultExtra class=\"wr-load-state__retry\" size=\"sm\" [loading]=\"retrying()\" (click)=\"onRetry()\">\n {{ resolvedRetryLabel() }}\n </wr-btn>\n </wr-result>\n }\n }\n @case ('empty') {\n @if (emptyTpl(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" />\n } @else {\n <wr-empty class=\"wr-load-state__empty\" [title]=\"emptyLabel()\" />\n }\n }\n @case ('ready') {\n @if (contentTpl(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"contentContext()\" />\n }\n }\n}\n<!-- Always in the DOM, so a screen reader is watching it before the failure\n lands. The text leaves while a retry runs and comes back if that fails, so\n a second failure is announced too; a reload behind the content never\n touches it. -->\n<span class=\"wr-load-state__announce\" role=\"status\" aria-live=\"polite\">\n @if (state() === 'error' && !retrying()) {\n {{ resolvedErrorL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,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-load-state.mjs","names":[],"sources":["../../../projects/lib/load-state/load-state-templates.ts","../../../projects/lib/load-state/load-state.ts","../../../projects/lib/load-state/load-state.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, type Resource, TemplateRef, inject, input } from '@angular/core';\n\nimport type { WrSafeAny } from 'ngwr/utils';\n\nimport type { WrLoadStateContentContext, WrLoadStateErrorContext } from './types';\n\n/**\n * The content `<wr-load-state>` draws once the data is ready. A template rather\n * than projected content, so nothing of it is created before that: a plain\n * `<ng-content>` would be instantiated in every state.\n *\n * Name the resource through `[wrLoadStateContentOf]` and `let-value` arrives\n * typed. The input is read by the type checker only, the way `[wrTableCellOf]`\n * types a table cell: the wrapper hands the template the same context whether\n * or not it is set.\n *\n * @example\n * ```html\n * <wr-load-state [resource]=\"users\">\n * <ng-template wrLoadStateContent [wrLoadStateContentOf]=\"users\" let-users>\n * <wr-table [items]=\"users\" [columns]=\"columns\" />\n * </ng-template>\n * </wr-load-state>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrLoadStateContent]',\n})\nexport class WrLoadStateContent<T = WrSafeAny> {\n /**\n * The resource the template draws, for the type checker: nothing reads it at\n * runtime. Bind the same resource as the wrapper's `[resource]`.\n */\n readonly wrLoadStateContentOf = input<Resource<T | undefined> | null | undefined>(undefined);\n\n readonly template = inject<TemplateRef<WrLoadStateContentContext<T>>>(TemplateRef);\n\n /**\n * Types the template's `let-` variables under `strictTemplates`. `T` defaults\n * to `WrSafeAny` for the reason `WrOptionLeading` gives: without\n * `[wrLoadStateContentOf]` nothing infers the value, and narrowed to\n * `unknown` every `value.length` would stop compiling.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- a guard's parameters exist to be narrowed, never read\n static ngTemplateContextGuard<T>(_dir: WrLoadStateContent<T>, _ctx: unknown): _ctx is WrLoadStateContentContext<T> {\n return true;\n }\n}\n\n/**\n * Replaces the default skeleton while `<wr-load-state>` loads for the first time.\n *\n * @example\n * ```html\n * <ng-template wrLoadStateLoading><wr-spinner /></ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrLoadStateLoading]',\n})\nexport class WrLoadStateLoading {\n readonly template = inject<TemplateRef<void>>(TemplateRef);\n}\n\n/**\n * Replaces the default failure of `<wr-load-state>`. The context carries the\n * error, `retry()` and `retrying`; the error's message is the app's to show.\n *\n * @example\n * ```html\n * <ng-template wrLoadStateError let-error let-retry=\"retry\" let-retrying=\"retrying\">\n * <wr-alert type=\"danger\" title=\"Could not load\" [message]=\"error.message\">\n * <wr-btn wrAlertActions size=\"sm\" [loading]=\"retrying\" (click)=\"retry()\">Try again</wr-btn>\n * </wr-alert>\n * </ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrLoadStateError]',\n})\nexport class WrLoadStateError<E = WrSafeAny> {\n readonly template = inject<TemplateRef<WrLoadStateErrorContext<E>>>(TemplateRef);\n\n /**\n * Types the template's `let-` variables under `strictTemplates`. `E` defaults\n * to `WrSafeAny` for the reason `WrOptionLeading` gives: nothing infers the error\n * type, and narrowed to `unknown`, `error.message` would not compile.\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars -- a guard's parameters exist to be narrowed, never read\n static ngTemplateContextGuard<E>(_dir: WrLoadStateError<E>, _ctx: unknown): _ctx is WrLoadStateErrorContext<E> {\n return true;\n }\n}\n\n/**\n * Replaces the default `<wr-empty>` of `<wr-load-state>`.\n *\n * @example\n * ```html\n * <ng-template wrLoadStateEmpty>\n * <wr-empty title=\"No orders yet\"><wr-btn wrEmptyActions (click)=\"create()\">Create one</wr-btn></wr-empty>\n * </ng-template>\n * ```\n */\n@Directive({\n selector: 'ng-template[wrLoadStateEmpty]',\n})\nexport class WrLoadStateEmpty {\n readonly template = inject<TemplateRef<void>>(TemplateRef);\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n Component,\n type Resource,\n ViewEncapsulation,\n type WritableResource,\n computed,\n contentChild,\n input,\n linkedSignal,\n output,\n} from '@angular/core';\n\nimport { WrButton } from 'ngwr/button';\nimport { WrEmpty } from 'ngwr/empty';\nimport { useI18nText } from 'ngwr/i18n';\nimport { WrResult } from 'ngwr/result';\nimport { WrSkeleton } from 'ngwr/skeleton';\nimport { wrNumAttr, type WrSafeAny, wrCheckStyles } from 'ngwr/utils';\n\nimport { WrLoadStateContent, WrLoadStateEmpty, WrLoadStateError, WrLoadStateLoading } from './load-state-templates';\nimport type { WrLoadStateContentContext, WrLoadStateErrorContext, WrLoadStateStatus } from './types';\n\n/** The default `isEmpty`: nothing, or a list with nothing in it. */\nconst isEmptyValue = (value: unknown): boolean => value == null || (Array.isArray(value) && value.length === 0);\n\n/**\n * One wrapper for the four states of a screen that loads: the skeleton, the\n * failure with a retry, the empty slot and the content. Give it a `resource`\n * and it reads the state from there; give it a `status` and the app decides.\n * Never both.\n *\n * The content and any custom part are templates, so nothing of the content is\n * created before it is ready. The defaults are `<wr-skeleton [lines]>`,\n * `<wr-result status=\"error\">` with a retry button, and `<wr-empty>`, so the\n * minimal use is the resource and a content template.\n *\n * What each resource status draws:\n *\n * | `resource.status()` | Drawn |\n * | --------------------- | --------------------------------------------------------------------- |\n * | `loading` | the skeleton |\n * | `reloading` | what was on screen, marked busy; the failure, with its button busy, after a failed load; the skeleton when there is no value yet |\n * | `error` | the failure |\n * | `resolved`, `local` | the empty slot when `isEmpty(value)`, else the content |\n * | `idle` | the content or the empty slot by `isEmpty`: nothing was asked for, so nothing loads |\n *\n * Accessibility: the host carries `aria-busy` while a load is in flight, the\n * failure's title is announced once through a polite live region, nothing is\n * announced for a reload that keeps the content, and focus is never moved.\n *\n * @example\n * ```html\n * <wr-load-state [resource]=\"users\">\n * <ng-template wrLoadStateContent [wrLoadStateContentOf]=\"users\" let-users>\n * <wr-table [items]=\"users\" [columns]=\"columns\" />\n * </ng-template>\n * </wr-load-state>\n *\n * <wr-load-state [status]=\"status()\" (retry)=\"load()\">\n * <ng-template wrLoadStateContent>{{ text() }}</ng-template>\n * </wr-load-state>\n * ```\n *\n * @see https://ngwr.dev/reference/components/load-state\n */\n@Component({\n selector: 'wr-load-state',\n templateUrl: './load-state.html',\n imports: [NgTemplateOutlet, WrSkeleton, WrResult, WrEmpty, WrButton],\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-load-state',\n '[class]': 'classes()',\n '[attr.aria-busy]': 'busy() ? \"true\" : null',\n },\n})\nexport class WrLoadState<T = WrSafeAny> {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('load-state');\n }\n\n /**\n * The state, when the app decides it. Ignored while `resource` is set.\n *\n * @default null\n */\n readonly status = input<WrLoadStateStatus | null>(null);\n\n /**\n * The resource to read the state from: `resource()`, `rxResource()` and\n * `httpResource()` alike. The retry button calls its `reload()`.\n *\n * @default null\n */\n readonly resource = input<Resource<T | undefined> | null>(null);\n\n /**\n * Decides whether a settled value shows the empty slot instead of the content.\n * The default is empty for `null`, `undefined` and an empty array.\n *\n * @default isEmptyValue\n */\n readonly isEmpty = input<(value: T | undefined) => boolean>(isEmptyValue);\n\n /**\n * How many lines the default skeleton draws.\n *\n * @default 3\n */\n readonly lines = input(3, { transform: wrNumAttr(3) });\n\n /** The failure's title. Falls back to `loadState.failed`, then `'Could not load'`. */\n readonly errorLabel = input<string | null>(null);\n\n /** The retry button's label. Falls back to `loadState.retry`, then `'Try again'`. */\n readonly retryLabel = input<string | null>(null);\n\n /** The default empty slot's title. Falls back to `empty.noData` through `<wr-empty>`. */\n readonly emptyLabel = input<string | null>(null);\n\n /**\n * Emitted when the retry button is pressed, once per press that starts a\n * retry. With a `resource`, `reload()` has been called as well.\n */\n readonly retry = output<void>();\n\n protected readonly resolvedErrorLabel = useI18nText(this.errorLabel, 'loadState.failed', 'Could not load');\n protected readonly resolvedRetryLabel = useI18nText(this.retryLabel, 'loadState.retry', 'Try again');\n\n protected readonly contentTpl = contentChild<WrLoadStateContent<T>>(WrLoadStateContent);\n protected readonly loadingTpl = contentChild(WrLoadStateLoading);\n protected readonly errorTpl = contentChild(WrLoadStateError);\n protected readonly emptyTpl = contentChild(WrLoadStateEmpty);\n\n protected readonly state = computed<WrLoadStateStatus>(() => {\n const resource = this.resource();\n if (!resource) return this.status() ?? 'loading';\n const status = resource.status();\n if (status === 'loading') return 'loading';\n if (status === 'error') return 'error';\n const held = resource.hasValue();\n if (status === 'reloading' && !held) return resource.error() !== undefined ? 'error' : 'loading';\n return this.isEmpty()(held ? resource.value() : undefined) ? 'empty' : 'ready';\n });\n\n /** A load is in flight: the first one, or a reload behind whatever is on screen. */\n protected readonly busy = computed(() => {\n const resource = this.resource();\n return resource ? resource.isLoading() : this.state() === 'loading';\n });\n\n /**\n * A press that has not reached the resource's status yet. `reload()` flips the\n * status in the same tick, so with a resource this covers only the gap before\n * it; with a `status` it holds until the app answers the `retry` output.\n */\n private readonly pressed = linkedSignal({\n source: () => [this.status(), this.resource()?.status()],\n computation: () => false,\n });\n\n protected readonly retrying = computed(() => this.pressed() || (this.resource()?.isLoading() ?? false));\n\n protected readonly classes = computed(() => {\n const parts = [`wr-load-state--${this.state()}`];\n if (this.busy()) parts.push('wr-load-state--busy');\n return parts.join(' ');\n });\n\n protected readonly contentContext = computed<WrLoadStateContentContext<T | undefined>>(() => {\n const resource = this.resource();\n return {\n $implicit: resource?.hasValue() ? resource.value() : undefined,\n reloading: this.busy(),\n };\n });\n\n protected readonly errorContext = computed<WrLoadStateErrorContext>(() => ({\n $implicit: this.resource()?.error(),\n retry: () => this.onRetry(),\n retrying: this.retrying(),\n }));\n\n /** A second press while one is in flight starts nothing. */\n protected onRetry(): void {\n if (this.retrying()) return;\n this.pressed.set(true);\n this.retry.emit();\n (this.resource() as Partial<WritableResource<T | undefined>> | null)?.reload?.();\n }\n}\n","@switch (state()) {\n @case ('loading') {\n @if (loadingTpl(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" />\n } @else {\n <wr-skeleton class=\"wr-load-state__skeleton\" [lines]=\"lines()\" />\n }\n }\n @case ('error') {\n @if (errorTpl(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"errorContext()\" />\n } @else {\n <wr-result class=\"wr-load-state__error\" status=\"error\" [title]=\"resolvedErrorLabel()\">\n <wr-btn wrResultExtra class=\"wr-load-state__retry\" size=\"sm\" [loading]=\"retrying()\" (click)=\"onRetry()\">\n {{ resolvedRetryLabel() }}\n </wr-btn>\n </wr-result>\n }\n }\n @case ('empty') {\n @if (emptyTpl(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" />\n } @else {\n <wr-empty class=\"wr-load-state__empty\" [title]=\"emptyLabel()\" />\n }\n }\n @case ('ready') {\n @if (contentTpl(); as custom) {\n <ng-container [ngTemplateOutlet]=\"custom.template\" [ngTemplateOutletContext]=\"contentContext()\" />\n }\n }\n}\n<!-- Always in the DOM, so a screen reader is watching it before the failure\n lands. The text leaves while a retry runs and comes back if that fails, so\n a second failure is announced too; a reload behind the content never\n touches it. -->\n<span class=\"wr-load-state__announce\" role=\"status\" aria-live=\"polite\">\n @if (state() === 'error' && !retrying()) {\n {{ resolvedErrorLabel() }}\n }\n</span>\n"],"mappings":";;;;;;;;;;;;;;;AAmCA,IAAa,qBAAb,MAAa,mBAAkB;CAKpB,uBAAuB,MAAkD,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,uBAAA,CAAA,+BAAA,CAAA,CAAA;CAEnF,WAAW,OAAkD,WAAW;CASjF,OAAO,uBAA0B,MAA6B,MAAa;EACzE,OAAO;CACT;CAlBW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAA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A,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,kBAAkB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBACzC,kBAAkB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBACpB,gBAAgB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAChB,gBAAgB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-loading-bar-router.mjs","names":[],"sources":["../../../projects/lib/loading-bar/router/provide-wr-loading-bar-router.ts"
|
|
1
|
+
{"version":3,"file":"ngwr-loading-bar-router.mjs","names":[],"sources":["../../../projects/lib/loading-bar/router/provide-wr-loading-bar-router.ts"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n DestroyRef,\n type EnvironmentProviders,\n PLATFORM_ID,\n inject,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n} from '@angular/core';\nimport { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router } from '@angular/router';\n\nimport { WrLoadingBar } from 'ngwr/loading-bar';\n\n/**\n * Drive {@link WrLoadingBar} from router navigations: `NavigationStart` takes a\n * slot, and each of `NavigationEnd` / `NavigationCancel` / `NavigationError`\n * releases one.\n *\n * @example\n * ```ts\n * import { provideWrLoadingBarRouter } from 'ngwr/loading-bar/router';\n *\n * bootstrapApplication(App, {\n * providers: [provideRouter(routes), provideWrLoadingBarRouter()],\n * });\n * ```\n *\n * **Why this is a call and not the default.** `WrLoadingBar` used to inject\n * `Router` itself, so navigations drove the bar with no configuration — and\n * every app that rendered `<wr-loading-bar>` paid 66.3 kB of `@angular/router`\n * for it, two thirds of the entry point's total cost, whether or not it had\n * routes. `{ optional: true }` does not help: an optional inject still names the\n * class as the token, and it measured byte-for-byte identical to a required one.\n * An automatic integration and a router-free bundle cannot both exist in a\n * statically linked app, so the automatic half moved here.\n */\nexport function provideWrLoadingBarRouter(): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideEnvironmentInitializer(() => {\n // Browser only. During prerender the initial navigation runs the whole\n // cycle in the Node worker — including the bar's 150 ms interval — and\n // leaves `progress` at 1, because the reset that clears it is deferred and\n // the HTML is serialized first: every prerendered page then ships a\n // full-width bar across the top until hydration.\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n\n const bar = inject(WrLoadingBar);\n const destroyRef = inject(DestroyRef);\n const sub = inject(Router).events.subscribe(event => {\n if (event instanceof NavigationStart) bar.start();\n else if (\n event instanceof NavigationEnd ||\n event instanceof NavigationCancel ||\n event instanceof NavigationError\n ) {\n bar.complete();\n }\n });\n destroyRef.onDestroy(() => sub.unsubscribe());\n }),\n ]);\n}\n"],"mappings":";;;;;;;;;;AA2CA,SAAgB,4BAAyB;CACvC,OAAO,yBAAyB,CAC9B,oCAAmC;EAMjC,IAAI,CAAC,kBAAkB,OAAO,WAAW,CAAC,GAAG;EAE7C,MAAM,MAAM,OAAO,YAAY;EAC/B,MAAM,aAAa,OAAO,UAAU;EACpC,MAAM,MAAM,OAAO,MAAM,CAAC,CAAC,OAAO,WAAU,UAAQ;GAClD,IAAI,iBAAiB,iBAAiB,IAAI,MAAK;QAC1C,IACH,iBAAiB,iBACjB,iBAAiB,oBACjB,iBAAiB,iBAEjB,IAAI,SAAQ;EAEhB,CAAC;EACD,WAAW,gBAAgB,IAAI,YAAW,CAAE;CAC9C,CAAC,CACF,CAAA;AACH"}
|
|
@@ -69,7 +69,7 @@ var WrLoadingBar = class WrLoadingBar {
|
|
|
69
69
|
}
|
|
70
70
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
71
71
|
minVersion: "12.0.0",
|
|
72
|
-
version: "22.
|
|
72
|
+
version: "22.3.0",
|
|
73
73
|
ngImport: i0,
|
|
74
74
|
type: WrLoadingBar,
|
|
75
75
|
deps: [],
|
|
@@ -77,14 +77,14 @@ var WrLoadingBar = class WrLoadingBar {
|
|
|
77
77
|
});
|
|
78
78
|
static ɵprov = i0.ɵɵngDeclareService({
|
|
79
79
|
minVersion: "22.0.0",
|
|
80
|
-
version: "22.
|
|
80
|
+
version: "22.3.0",
|
|
81
81
|
ngImport: i0,
|
|
82
82
|
type: WrLoadingBar
|
|
83
83
|
});
|
|
84
84
|
};
|
|
85
85
|
i0.ɵɵngDeclareClassMetadata({
|
|
86
86
|
minVersion: "12.0.0",
|
|
87
|
-
version: "22.
|
|
87
|
+
version: "22.3.0",
|
|
88
88
|
ngImport: i0,
|
|
89
89
|
type: WrLoadingBar,
|
|
90
90
|
decorators: [{ type: Service }]
|
|
@@ -102,7 +102,7 @@ var WrLoadingBarComponent = class WrLoadingBarComponent {
|
|
|
102
102
|
active = computed(() => this.bar.state() !== "idle", ...ngDevMode ? [{ debugName: "active" }] : /* istanbul ignore next */ []);
|
|
103
103
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
104
104
|
minVersion: "12.0.0",
|
|
105
|
-
version: "22.
|
|
105
|
+
version: "22.3.0",
|
|
106
106
|
ngImport: i0,
|
|
107
107
|
type: WrLoadingBarComponent,
|
|
108
108
|
deps: [],
|
|
@@ -110,7 +110,7 @@ var WrLoadingBarComponent = class WrLoadingBarComponent {
|
|
|
110
110
|
});
|
|
111
111
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
112
112
|
minVersion: "17.1.0",
|
|
113
|
-
version: "22.
|
|
113
|
+
version: "22.3.0",
|
|
114
114
|
type: WrLoadingBarComponent,
|
|
115
115
|
isStandalone: true,
|
|
116
116
|
selector: "wr-loading-bar",
|
|
@@ -133,13 +133,13 @@ var WrLoadingBarComponent = class WrLoadingBarComponent {
|
|
|
133
133
|
host: { classAttribute: "wr-loading-bar" },
|
|
134
134
|
ngImport: i0,
|
|
135
135
|
template: "<div class=\"wr-loading-bar__track\" [class.wr-loading-bar--active]=\"active()\">\n <div\n class=\"wr-loading-bar__fill\"\n [style.width.%]=\"bar.progress() * 100\"\n [style.background]=\"color()\"\n [style.height]=\"height()\"\n ></div>\n</div>\n",
|
|
136
|
-
styles: [".wr-loading-bar{position:fixed;top:0;inset-inline:0;z-index:var(--wr-z-top, 9999);pointer-events:none}.wr-loading-bar__track{width:100%;overflow:hidden;opacity:0;transition:opacity .2s ease}.wr-loading-bar__track:not(.wr-loading-bar--active) .wr-loading-bar__fill{transition:width 0s linear .2s}.wr-loading-bar--active{opacity:1}.wr-loading-bar__fill{width:0;height:2px;background:var(--wr-color-primary);box-shadow:0 0 8px color-mix(in srgb,var(--wr-color-primary) 60%,transparent);transition:width .15s ease-out,opacity .2s ease}\n"],
|
|
136
|
+
styles: [".wr-loading-bar{position:fixed;top:0;inset-inline:0;z-index:var(--wr-z-top, 9999);pointer-events:none}.wr-loading-bar__track{width:100%;overflow:hidden;opacity:0;transition:opacity .2s ease}.wr-loading-bar__track:not(.wr-loading-bar--active) .wr-loading-bar__fill{transition:width 0s linear .2s}.wr-loading-bar--active{opacity:1}.wr-loading-bar__fill{width:0;height:2px;background:var(--wr-color-primary);box-shadow:0 0 8px color-mix(in srgb,var(--wr-color-primary) 60%,transparent);transition:width .15s ease-out,opacity .2s ease}@media print{.wr-loading-bar{display:none}}\n"],
|
|
137
137
|
encapsulation: i0.ViewEncapsulation.None
|
|
138
138
|
});
|
|
139
139
|
};
|
|
140
140
|
i0.ɵɵngDeclareClassMetadata({
|
|
141
141
|
minVersion: "12.0.0",
|
|
142
|
-
version: "22.
|
|
142
|
+
version: "22.3.0",
|
|
143
143
|
ngImport: i0,
|
|
144
144
|
type: WrLoadingBarComponent,
|
|
145
145
|
decorators: [{
|
|
@@ -149,7 +149,7 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
149
149
|
encapsulation: ViewEncapsulation.None,
|
|
150
150
|
host: { class: "wr-loading-bar" },
|
|
151
151
|
template: "<div class=\"wr-loading-bar__track\" [class.wr-loading-bar--active]=\"active()\">\n <div\n class=\"wr-loading-bar__fill\"\n [style.width.%]=\"bar.progress() * 100\"\n [style.background]=\"color()\"\n [style.height]=\"height()\"\n ></div>\n</div>\n",
|
|
152
|
-
styles: [".wr-loading-bar{position:fixed;top:0;inset-inline:0;z-index:var(--wr-z-top, 9999);pointer-events:none}.wr-loading-bar__track{width:100%;overflow:hidden;opacity:0;transition:opacity .2s ease}.wr-loading-bar__track:not(.wr-loading-bar--active) .wr-loading-bar__fill{transition:width 0s linear .2s}.wr-loading-bar--active{opacity:1}.wr-loading-bar__fill{width:0;height:2px;background:var(--wr-color-primary);box-shadow:0 0 8px color-mix(in srgb,var(--wr-color-primary) 60%,transparent);transition:width .15s ease-out,opacity .2s ease}\n"]
|
|
152
|
+
styles: [".wr-loading-bar{position:fixed;top:0;inset-inline:0;z-index:var(--wr-z-top, 9999);pointer-events:none}.wr-loading-bar__track{width:100%;overflow:hidden;opacity:0;transition:opacity .2s ease}.wr-loading-bar__track:not(.wr-loading-bar--active) .wr-loading-bar__fill{transition:width 0s linear .2s}.wr-loading-bar--active{opacity:1}.wr-loading-bar__fill{width:0;height:2px;background:var(--wr-color-primary);box-shadow:0 0 8px color-mix(in srgb,var(--wr-color-primary) 60%,transparent);transition:width .15s ease-out,opacity .2s ease}@media print{.wr-loading-bar{display:none}}\n"]
|
|
153
153
|
}]
|
|
154
154
|
}],
|
|
155
155
|
propDecorators: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-loading-bar.mjs","names":[],"sources":["../../../projects/lib/loading-bar/services/loading-bar.ts","../../../projects/lib/loading-bar/loading-bar.component.ts","../../../projects/lib/loading-bar/loading-bar.component.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { isPlatformBrowser } from '@angular/common';\nimport { Service, PLATFORM_ID, type Signal, computed, inject, signal } from '@angular/core';\n\nimport type { WrLoadingState } from '../types';\n\n/**\n * Singleton state machine for a top-of-page progress indicator: a counter of\n * in-flight tasks and a tween between 0 and 1, driven through `start()` /\n * `complete()`.\n *\n * Pair with `<wr-loading-bar>` to render the bar at the top of your shell.\n *\n * It knows nothing about the router on purpose. Naming `Router` here — even\n * `{ optional: true }`, which is byte-for-byte identical to a required inject —\n * put 66.3 kB of `@angular/router` into every app that rendered the bar,\n * two thirds of what `ngwr/loading-bar` cost and 27× the component's own code.\n * Call `provideWrLoadingBarRouter()` from `ngwr/loading-bar/router` to have\n * navigations drive it.\n *\n * @example\n * ```ts\n * // From an HttpInterceptor:\n * const bar = inject(WrLoadingBar);\n * bar.start();\n * return next(req).pipe(finalize(() => bar.complete()));\n * ```\n *\n * @see https://ngwr.dev/reference/services/loading-bar\n */\n@Service()\nexport class WrLoadingBar {\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /** Live count of pending \"tasks\" (manual + router). */\n private readonly count = signal(0);\n\n /** Tween value `[0, 1]` — the bar's actual width. */\n private readonly _progress = signal(0);\n readonly progress: Signal<number> = this._progress.asReadonly();\n\n readonly state: Signal<WrLoadingState> = computed(() => {\n if (this.count() > 0) return 'running';\n return this._progress() > 0 ? 'completing' : 'idle';\n });\n\n private timer: ReturnType<typeof setInterval> | null = null;\n private holdTimer: ReturnType<typeof setTimeout> | null = null;\n\n /** Reserve a slot. The bar starts trickling as long as `count > 0`. */\n start(): void {\n if (this.count() === 0) this.beginTrickle();\n this.count.update(v => v + 1);\n }\n\n /** Release a slot. When the last one closes, the bar fast-forwards to 100% then resets. */\n complete(): void {\n // Only a call that actually RELEASED something may finish. `Math.max` turns\n // a stray `complete()` into a no-op on the count, but the old code still\n // read the resulting zero as \"the last task just ended\" and flashed the bar\n // to 100% — reachable from a `finalize` that runs twice, or any\n // `complete()` after a `reset()`.\n if (this.count() === 0) return;\n this.count.update(v => v - 1);\n if (this.count() === 0) this.finish();\n }\n\n /** Cancel without animating the bar to 100%. Resets immediately. */\n reset(): void {\n this.count.set(0);\n this.stopTrickle();\n this.clearHold();\n this._progress.set(0);\n }\n\n // Internals\n\n private beginTrickle(): void {\n this.stopTrickle();\n this.clearHold();\n\n // Nothing paints during prerender, so there is nothing to animate. The\n // count still moves — a task really is in flight — but no 150 ms interval\n // is left spinning inside the render worker, and the serialized bar stays\n // at zero width whether or not the task finishes before serialization.\n if (!this.isBrowser) return;\n\n // Unconditionally, not `if (progress === 0)`. A task that starts inside the\n // 220 ms hold found progress at 1, kept it, and then trickled the WRONG WAY:\n // `p + (0.9 - p) * 0.08` approaches 0.9 from above, so the bar sat at ~99%\n // and crept backwards for the whole task. A redirecting route guard hits\n // that window on every navigation.\n this._progress.set(0.08);\n this.timer = setInterval(() => {\n const p = this._progress();\n // Approach 90% asymptotically — we want the user-visible final jump\n // to clearly indicate completion.\n const next = p + (0.9 - p) * 0.08;\n this._progress.set(next);\n }, 150);\n }\n\n private stopTrickle(): void {\n if (this.timer === null) return;\n clearInterval(this.timer);\n this.timer = null;\n }\n\n private clearHold(): void {\n if (this.holdTimer === null) return;\n clearTimeout(this.holdTimer);\n this.holdTimer = null;\n }\n\n private finish(): void {\n this.stopTrickle();\n this.clearHold();\n\n // Nothing animates during prerender and nothing will run the reset before\n // the HTML is serialized, so there is no 100% worth holding — go straight\n // to rest and leave the markup clean.\n if (!this.isBrowser) {\n this._progress.set(0);\n return;\n }\n\n this._progress.set(1);\n // Give the bar a moment to render the final 100% width before resetting.\n // The handle is kept so a later cycle's hold is not cut short by this\n // one's leftover timer.\n this.holdTimer = setTimeout(() => {\n this.holdTimer = null;\n if (this.count() === 0) this._progress.set(0);\n }, 220);\n }\n}\n\nexport type { WrLoadingState } from '../types';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation, computed, inject, input } from '@angular/core';\n\nimport { WrLoadingBar } from './services/loading-bar';\n\n/**\n * Thin progress bar fixed to the top of the viewport.\n *\n * Drop one at the root of your shell. Reads the singleton {@link WrLoadingBar},\n * which is driven manually by `start()` / `complete()` — an HTTP interceptor, a\n * long save, anything with a beginning and an end.\n *\n * Router navigations drive it too, but only once you add\n * `provideWrLoadingBarRouter()` from `ngwr/loading-bar/router`. That is an opt-in\n * because the subscription is what pulls `@angular/router` into the bundle: this\n * component is 2.4 kB of its own code and used to carry 66 kB of router into\n * apps that never routed.\n *\n * @example\n * ```html\n * <wr-loading-bar /> <!-- top, primary color -->\n * <wr-loading-bar color=\"#9b51e0\" height=\"3px\" />\n * ```\n */\n@Component({\n selector: 'wr-loading-bar',\n templateUrl: './loading-bar.component.html',\n styleUrl: './loading-bar.scss',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-loading-bar' },\n})\nexport class WrLoadingBarComponent {\n /** Bar colour. Defaults to the primary brand colour. */\n readonly color = input<string>('var(--wr-color-primary)');\n\n /** Bar height. */\n readonly height = input<string>('2px');\n\n protected readonly bar = inject(WrLoadingBar);\n\n protected readonly active = computed(() => this.bar.state() !== 'idle');\n}\n","<div class=\"wr-loading-bar__track\" [class.wr-loading-bar--active]=\"active()\">\n <div\n class=\"wr-loading-bar__fill\"\n [style.width.%]=\"bar.progress() * 100\"\n [style.background]=\"color()\"\n [style.height]=\"height()\"\n ></div>\n</div>\n"],"mappings":";;;;;;;;;AAqCA,IAAa,eAAb,MAAa,aAAY;CACN,YAAY,kBAAkB,OAAO,WAAW,CAAC;CAGjD,QAAQ,OAAO,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAGjB,YAAY,OAAO,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,WAA2B,KAAK,UAAU,WAAU;CAEpD,QAAgC,eAAc;EACrD,IAAI,KAAK,MAAK,IAAK,GAAG,OAAO;EAC7B,OAAO,KAAK,UAAS,IAAK,IAAI,eAAe;CAC/C,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEM,QAA+C;CAC/C,YAAkD;CAG1D,QAAK;EACH,IAAI,KAAK,MAAK,MAAO,GAAG,KAAK,aAAY;EACzC,KAAK,MAAM,QAAO,MAAK,IAAI,CAAC;CAC9B;CAGA,WAAQ;EAMN,IAAI,KAAK,MAAK,MAAO,GAAG;EACxB,KAAK,MAAM,QAAO,MAAK,IAAI,CAAC;EAC5B,IAAI,KAAK,MAAK,MAAO,GAAG,KAAK,OAAM;CACrC;CAGA,QAAK;EACH,KAAK,MAAM,IAAI,CAAC;EAChB,KAAK,YAAW;EAChB,KAAK,UAAS;EACd,KAAK,UAAU,IAAI,CAAC;CACtB;CAIQ,eAAY;EAClB,KAAK,YAAW;EAChB,KAAK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AA;CAEnB,MAAM,OAAO,YAAY;CAEzB,SAAS,eAAe,KAAK,IAAI,MAAK,MAAO,QAAO,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAT5D,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAqB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAArB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAqB,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,QAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA,EAAA,gBAAA,iBAAA;EAAA,UAAA;EAAA,UCrClC;EAQA,QAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"ngwr-loading-bar.mjs","names":[],"sources":["../../../projects/lib/loading-bar/services/loading-bar.ts","../../../projects/lib/loading-bar/loading-bar.component.ts","../../../projects/lib/loading-bar/loading-bar.component.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { isPlatformBrowser } from '@angular/common';\nimport { Service, PLATFORM_ID, type Signal, computed, inject, signal } from '@angular/core';\n\nimport type { WrLoadingState } from '../types';\n\n/**\n * Singleton state machine for a top-of-page progress indicator: a counter of\n * in-flight tasks and a tween between 0 and 1, driven through `start()` /\n * `complete()`.\n *\n * Pair with `<wr-loading-bar>` to render the bar at the top of your shell.\n *\n * It knows nothing about the router on purpose. Naming `Router` here — even\n * `{ optional: true }`, which is byte-for-byte identical to a required inject —\n * put 66.3 kB of `@angular/router` into every app that rendered the bar,\n * two thirds of what `ngwr/loading-bar` cost and 27× the component's own code.\n * Call `provideWrLoadingBarRouter()` from `ngwr/loading-bar/router` to have\n * navigations drive it.\n *\n * @example\n * ```ts\n * // From an HttpInterceptor:\n * const bar = inject(WrLoadingBar);\n * bar.start();\n * return next(req).pipe(finalize(() => bar.complete()));\n * ```\n *\n * @see https://ngwr.dev/reference/services/loading-bar\n */\n@Service()\nexport class WrLoadingBar {\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n\n /** Live count of pending \"tasks\" (manual + router). */\n private readonly count = signal(0);\n\n /** Tween value `[0, 1]` — the bar's actual width. */\n private readonly _progress = signal(0);\n readonly progress: Signal<number> = this._progress.asReadonly();\n\n readonly state: Signal<WrLoadingState> = computed(() => {\n if (this.count() > 0) return 'running';\n return this._progress() > 0 ? 'completing' : 'idle';\n });\n\n private timer: ReturnType<typeof setInterval> | null = null;\n private holdTimer: ReturnType<typeof setTimeout> | null = null;\n\n /** Reserve a slot. The bar starts trickling as long as `count > 0`. */\n start(): void {\n if (this.count() === 0) this.beginTrickle();\n this.count.update(v => v + 1);\n }\n\n /** Release a slot. When the last one closes, the bar fast-forwards to 100% then resets. */\n complete(): void {\n // Only a call that actually RELEASED something may finish. `Math.max` turns\n // a stray `complete()` into a no-op on the count, but the old code still\n // read the resulting zero as \"the last task just ended\" and flashed the bar\n // to 100% — reachable from a `finalize` that runs twice, or any\n // `complete()` after a `reset()`.\n if (this.count() === 0) return;\n this.count.update(v => v - 1);\n if (this.count() === 0) this.finish();\n }\n\n /** Cancel without animating the bar to 100%. Resets immediately. */\n reset(): void {\n this.count.set(0);\n this.stopTrickle();\n this.clearHold();\n this._progress.set(0);\n }\n\n // Internals\n\n private beginTrickle(): void {\n this.stopTrickle();\n this.clearHold();\n\n // Nothing paints during prerender, so there is nothing to animate. The\n // count still moves — a task really is in flight — but no 150 ms interval\n // is left spinning inside the render worker, and the serialized bar stays\n // at zero width whether or not the task finishes before serialization.\n if (!this.isBrowser) return;\n\n // Unconditionally, not `if (progress === 0)`. A task that starts inside the\n // 220 ms hold found progress at 1, kept it, and then trickled the WRONG WAY:\n // `p + (0.9 - p) * 0.08` approaches 0.9 from above, so the bar sat at ~99%\n // and crept backwards for the whole task. A redirecting route guard hits\n // that window on every navigation.\n this._progress.set(0.08);\n this.timer = setInterval(() => {\n const p = this._progress();\n // Approach 90% asymptotically — we want the user-visible final jump\n // to clearly indicate completion.\n const next = p + (0.9 - p) * 0.08;\n this._progress.set(next);\n }, 150);\n }\n\n private stopTrickle(): void {\n if (this.timer === null) return;\n clearInterval(this.timer);\n this.timer = null;\n }\n\n private clearHold(): void {\n if (this.holdTimer === null) return;\n clearTimeout(this.holdTimer);\n this.holdTimer = null;\n }\n\n private finish(): void {\n this.stopTrickle();\n this.clearHold();\n\n // Nothing animates during prerender and nothing will run the reset before\n // the HTML is serialized, so there is no 100% worth holding — go straight\n // to rest and leave the markup clean.\n if (!this.isBrowser) {\n this._progress.set(0);\n return;\n }\n\n this._progress.set(1);\n // Give the bar a moment to render the final 100% width before resetting.\n // The handle is kept so a later cycle's hold is not cut short by this\n // one's leftover timer.\n this.holdTimer = setTimeout(() => {\n this.holdTimer = null;\n if (this.count() === 0) this._progress.set(0);\n }, 220);\n }\n}\n\nexport type { WrLoadingState } from '../types';\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Component, ViewEncapsulation, computed, inject, input } from '@angular/core';\n\nimport { WrLoadingBar } from './services/loading-bar';\n\n/**\n * Thin progress bar fixed to the top of the viewport.\n *\n * Drop one at the root of your shell. Reads the singleton {@link WrLoadingBar},\n * which is driven manually by `start()` / `complete()` — an HTTP interceptor, a\n * long save, anything with a beginning and an end.\n *\n * Router navigations drive it too, but only once you add\n * `provideWrLoadingBarRouter()` from `ngwr/loading-bar/router`. That is an opt-in\n * because the subscription is what pulls `@angular/router` into the bundle: this\n * component is 2.4 kB of its own code and used to carry 66 kB of router into\n * apps that never routed.\n *\n * @example\n * ```html\n * <wr-loading-bar /> <!-- top, primary color -->\n * <wr-loading-bar color=\"#9b51e0\" height=\"3px\" />\n * ```\n */\n@Component({\n selector: 'wr-loading-bar',\n templateUrl: './loading-bar.component.html',\n styleUrl: './loading-bar.scss',\n encapsulation: ViewEncapsulation.None,\n host: { class: 'wr-loading-bar' },\n})\nexport class WrLoadingBarComponent {\n /** Bar colour. Defaults to the primary brand colour. */\n readonly color = input<string>('var(--wr-color-primary)');\n\n /** Bar height. */\n readonly height = input<string>('2px');\n\n protected readonly bar = inject(WrLoadingBar);\n\n protected readonly active = computed(() => this.bar.state() !== 'idle');\n}\n","<div class=\"wr-loading-bar__track\" [class.wr-loading-bar--active]=\"active()\">\n <div\n class=\"wr-loading-bar__fill\"\n [style.width.%]=\"bar.progress() * 100\"\n [style.background]=\"color()\"\n [style.height]=\"height()\"\n ></div>\n</div>\n"],"mappings":";;;;;;;;;AAqCA,IAAa,eAAb,MAAa,aAAY;CACN,YAAY,kBAAkB,OAAO,WAAW,CAAC;CAGjD,QAAQ,OAAO,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAGjB,YAAY,OAAO,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAC7B,WAA2B,KAAK,UAAU,WAAU;CAEpD,QAAgC,eAAc;EACrD,IAAI,KAAK,MAAK,IAAK,GAAG,OAAO;EAC7B,OAAO,KAAK,UAAS,IAAK,IAAI,eAAe;CAC/C,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEM,QAA+C;CAC/C,YAAkD;CAG1D,QAAK;EACH,IAAI,KAAK,MAAK,MAAO,GAAG,KAAK,aAAY;EACzC,KAAK,MAAM,QAAO,MAAK,IAAI,CAAC;CAC9B;CAGA,WAAQ;EAMN,IAAI,KAAK,MAAK,MAAO,GAAG;EACxB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
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
123
123
|
minVersion: "12.0.0",
|
|
124
|
-
version: "22.
|
|
124
|
+
version: "22.3.0",
|
|
125
125
|
ngImport: i0,
|
|
126
126
|
type: WrMentionPanel,
|
|
127
127
|
deps: [],
|
|
@@ -129,7 +129,7 @@ var WrMentionPanel = class WrMentionPanel {
|
|
|
129
129
|
});
|
|
130
130
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
131
131
|
minVersion: "17.0.0",
|
|
132
|
-
version: "22.
|
|
132
|
+
version: "22.3.0",
|
|
133
133
|
type: WrMentionPanel,
|
|
134
134
|
isStandalone: true,
|
|
135
135
|
selector: "wr-mention-panel",
|
|
@@ -182,7 +182,7 @@ var WrMentionPanel = class WrMentionPanel {
|
|
|
182
182
|
};
|
|
183
183
|
i0.ɵɵngDeclareClassMetadata({
|
|
184
184
|
minVersion: "12.0.0",
|
|
185
|
-
version: "22.
|
|
185
|
+
version: "22.3.0",
|
|
186
186
|
ngImport: i0,
|
|
187
187
|
type: WrMentionPanel,
|
|
188
188
|
decorators: [{
|
|
@@ -380,6 +380,10 @@ var WrMention = class WrMention {
|
|
|
380
380
|
}
|
|
381
381
|
detect() {
|
|
382
382
|
const el = this.host.nativeElement;
|
|
383
|
+
if (el.disabled || el.readOnly) {
|
|
384
|
+
this.close();
|
|
385
|
+
return false;
|
|
386
|
+
}
|
|
383
387
|
const caret = el.selectionStart ?? 0;
|
|
384
388
|
const text = el.value.substring(0, caret);
|
|
385
389
|
const triggers = this.triggers();
|
|
@@ -511,6 +515,10 @@ var WrMention = class WrMention {
|
|
|
511
515
|
const state = this.state;
|
|
512
516
|
if (!state) return;
|
|
513
517
|
const el = this.host.nativeElement;
|
|
518
|
+
if (el.disabled || el.readOnly) {
|
|
519
|
+
this.close();
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
514
522
|
const value = el.value;
|
|
515
523
|
const caret = el.selectionStart ?? value.length;
|
|
516
524
|
const valueFn = this.valueWith();
|
|
@@ -532,7 +540,7 @@ var WrMention = class WrMention {
|
|
|
532
540
|
}
|
|
533
541
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
534
542
|
minVersion: "12.0.0",
|
|
535
|
-
version: "22.
|
|
543
|
+
version: "22.3.0",
|
|
536
544
|
ngImport: i0,
|
|
537
545
|
type: WrMention,
|
|
538
546
|
deps: [],
|
|
@@ -540,7 +548,7 @@ var WrMention = class WrMention {
|
|
|
540
548
|
});
|
|
541
549
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
542
550
|
minVersion: "17.1.0",
|
|
543
|
-
version: "22.
|
|
551
|
+
version: "22.3.0",
|
|
544
552
|
type: WrMention,
|
|
545
553
|
isStandalone: true,
|
|
546
554
|
selector: "[wrMention]",
|
|
@@ -621,7 +629,7 @@ var WrMention = class WrMention {
|
|
|
621
629
|
};
|
|
622
630
|
i0.ɵɵngDeclareClassMetadata({
|
|
623
631
|
minVersion: "12.0.0",
|
|
624
|
-
version: "22.
|
|
632
|
+
version: "22.3.0",
|
|
625
633
|
ngImport: i0,
|
|
626
634
|
type: WrMention,
|
|
627
635
|
decorators: [{
|