ngwr 16.4.0 → 16.6.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/back-top/styles/_index.scss +6 -0
- package/breadcrumbs/styles/_rules.scss +34 -0
- package/cascader/styles/_rules.scss +7 -0
- package/charts/bar-chart/styles/_index.scss +494 -305
- package/charts/boxplot-chart/styles/_index.scss +114 -48
- package/charts/bullet-chart/styles/_index.scss +113 -42
- package/charts/calendar-heatmap/styles/_index.scss +111 -20
- package/charts/candlestick-chart/styles/_index.scss +61 -26
- package/charts/chart-legend/styles/_index.scss +120 -10
- package/charts/core/styles/_index.scss +201 -5
- package/charts/donut-chart/styles/_index.scss +76 -21
- package/charts/funnel-chart/styles/_index.scss +66 -38
- package/charts/gauge/styles/_index.scss +12 -1
- package/charts/heatmap-chart/styles/_index.scss +90 -53
- package/charts/line-chart/styles/_index.scss +143 -139
- package/charts/meter-group/styles/_index.scss +87 -25
- package/charts/radar-chart/styles/_index.scss +82 -40
- package/charts/scatter-chart/styles/_index.scss +117 -44
- package/charts/sparkline/styles/_index.scss +7 -1
- package/charts/treemap-chart/styles/_index.scss +94 -42
- package/charts/waterfall-chart/styles/_index.scss +150 -87
- package/color-picker/styles/_index.scss +7 -3
- package/copy-value/styles/_index.scss +21 -2
- package/counter/styles/_index.scss +1 -8
- package/date-picker/styles/_index.scss +15 -9
- package/date-stamp/styles/_index.scss +2 -1
- package/dialog/styles/_index.scss +43 -0
- package/drawer/styles/_index.scss +5 -1
- package/editor/styles/_index.scss +1 -8
- package/event-calendar/styles/_index.scss +2 -6
- package/fesm2022/ngwr-affix.mjs +1 -1
- package/fesm2022/ngwr-affix.mjs.map +1 -1
- package/fesm2022/ngwr-anchor.mjs +9 -2
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-aurora.mjs.map +1 -1
- package/fesm2022/ngwr-animations-blur-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-click-sparks.mjs.map +1 -1
- package/fesm2022/ngwr-animations-confetti.mjs.map +1 -1
- package/fesm2022/ngwr-animations-decode.mjs.map +1 -1
- package/fesm2022/ngwr-animations-destruct.mjs.map +1 -1
- package/fesm2022/ngwr-animations-dot-grid.mjs.map +1 -1
- package/fesm2022/ngwr-animations-falling-letters.mjs.map +1 -1
- package/fesm2022/ngwr-animations-flow-lines.mjs.map +1 -1
- package/fesm2022/ngwr-animations-fluid-cursor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-glitch.mjs.map +1 -1
- package/fesm2022/ngwr-animations-glow-border.mjs.map +1 -1
- package/fesm2022/ngwr-animations-gradient-flow.mjs.map +1 -1
- package/fesm2022/ngwr-animations-marquee.mjs.map +1 -1
- package/fesm2022/ngwr-animations-orbit.mjs.map +1 -1
- package/fesm2022/ngwr-animations-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-ripple-grid.mjs.map +1 -1
- package/fesm2022/ngwr-animations-rotate-reveal.mjs.map +1 -1
- package/fesm2022/ngwr-animations-shimmer.mjs.map +1 -1
- package/fesm2022/ngwr-animations-spotlight.mjs.map +1 -1
- package/fesm2022/ngwr-animations-thread-lines.mjs.map +1 -1
- package/fesm2022/ngwr-animations-tilt.mjs +20 -13
- package/fesm2022/ngwr-animations-tilt.mjs.map +1 -1
- package/fesm2022/ngwr-animations-typewriter.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs.mjs +40 -7
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-button.mjs +12 -3
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-carousel-testing.mjs +4 -1
- package/fesm2022/ngwr-carousel-testing.mjs.map +1 -1
- package/fesm2022/ngwr-carousel.mjs +27 -2
- package/fesm2022/ngwr-carousel.mjs.map +1 -1
- package/fesm2022/ngwr-cascader-testing.mjs.map +1 -1
- package/fesm2022/ngwr-cascader.mjs +72 -8
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart-testing.mjs +16 -14
- package/fesm2022/ngwr-charts-bar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +399 -141
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs +19 -5
- package/fesm2022/ngwr-charts-boxplot-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +250 -56
- package/fesm2022/ngwr-charts-boxplot-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bullet-chart.mjs +118 -18
- package/fesm2022/ngwr-charts-bullet-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +266 -46
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs.map +1 -1
- package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs +21 -10
- package/fesm2022/ngwr-charts-candlestick-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +319 -72
- package/fesm2022/ngwr-charts-candlestick-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-chart-legend.mjs +211 -9
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +311 -23
- package/fesm2022/ngwr-charts-core.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-donut-chart.mjs +206 -27
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart-testing.mjs +4 -4
- package/fesm2022/ngwr-charts-funnel-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart.mjs +113 -10
- package/fesm2022/ngwr-charts-funnel-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-gauge-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-gauge.mjs +98 -12
- package/fesm2022/ngwr-charts-gauge.mjs.map +1 -1
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +226 -31
- package/fesm2022/ngwr-charts-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart-testing.mjs +16 -4
- package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +407 -172
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group-testing.mjs +4 -4
- package/fesm2022/ngwr-charts-meter-group-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +225 -31
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart-testing.mjs +2 -1
- package/fesm2022/ngwr-charts-radar-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +255 -66
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart-testing.mjs +39 -18
- package/fesm2022/ngwr-charts-scatter-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +431 -53
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline.mjs +19 -8
- package/fesm2022/ngwr-charts-sparkline.mjs.map +1 -1
- package/fesm2022/ngwr-charts-treemap-chart.mjs +253 -44
- package/fesm2022/ngwr-charts-treemap-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs +15 -7
- package/fesm2022/ngwr-charts-waterfall-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +151 -23
- package/fesm2022/ngwr-charts-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ngwr-checkbox.mjs +3 -2
- package/fesm2022/ngwr-checkbox.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +65 -5
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu-testing.mjs.map +1 -1
- package/fesm2022/ngwr-context-menu.mjs +51 -24
- package/fesm2022/ngwr-context-menu.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value-testing.mjs +5 -1
- package/fesm2022/ngwr-copy-value-testing.mjs.map +1 -1
- package/fesm2022/ngwr-copy-value.mjs +38 -2
- package/fesm2022/ngwr-copy-value.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +105 -9
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-dialog.mjs +29 -11
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +9 -6
- package/fesm2022/ngwr-directives.mjs.map +1 -1
- package/fesm2022/ngwr-drawer.mjs +19 -3
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +35 -6
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +1 -0
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-event-calendar.mjs +20 -9
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +170 -3
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +81 -13
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ar.mjs +20 -0
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +20 -0
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +20 -0
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +20 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +20 -0
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +20 -0
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +20 -0
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +20 -0
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +20 -0
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +20 -0
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +20 -0
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +20 -0
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +20 -0
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +20 -0
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +20 -0
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +20 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +20 -0
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +20 -0
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +20 -0
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +20 -0
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +20 -0
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +20 -0
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +82 -11
- package/fesm2022/ngwr-i18n.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +24 -1
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +2 -2
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +10 -2
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-layout.mjs.map +1 -1
- package/fesm2022/ngwr-lightbox.mjs +20 -3
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +1 -1
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar-router.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +2 -2
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-mention.mjs +8 -0
- package/fesm2022/ngwr-mention.mjs.map +1 -1
- package/fesm2022/ngwr-meta.mjs +9 -6
- package/fesm2022/ngwr-meta.mjs.map +1 -1
- package/fesm2022/ngwr-overlay.mjs +21 -2
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +21 -0
- package/fesm2022/ngwr-page-header.mjs.map +1 -1
- package/fesm2022/ngwr-pagination.mjs +2 -0
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +8 -1
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs +4 -1
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +43 -6
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +114 -15
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-qr.mjs +6 -2
- package/fesm2022/ngwr-qr.mjs.map +1 -1
- package/fesm2022/ngwr-radio.mjs +71 -5
- package/fesm2022/ngwr-radio.mjs.map +1 -1
- package/fesm2022/ngwr-schema-form.mjs +12 -1
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +1 -3
- package/fesm2022/ngwr-scroll.mjs.map +1 -1
- package/fesm2022/ngwr-segmented.mjs +20 -0
- package/fesm2022/ngwr-segmented.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +80 -9
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +16 -4
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +1 -1
- package/fesm2022/ngwr-storage.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +2 -2
- package/fesm2022/ngwr-switch.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +43 -7
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +2 -2
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-toast.mjs +28 -0
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-tour.mjs +16 -11
- package/fesm2022/ngwr-tour.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +49 -16
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +20 -0
- package/fesm2022/ngwr-typography.mjs.map +1 -1
- package/fesm2022/ngwr-utils-router.mjs.map +1 -1
- package/fesm2022/ngwr-utils.mjs +46 -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-window.mjs +16 -9
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/form/styles/_index.scss +37 -0
- package/graph/styles/_index.scss +1 -9
- package/i18n/ar.json +20 -0
- package/i18n/cs.json +20 -0
- package/i18n/de.json +20 -0
- package/i18n/en.json +20 -0
- package/i18n/es.json +20 -0
- package/i18n/fr.json +20 -0
- package/i18n/he.json +20 -0
- package/i18n/hi.json +20 -0
- package/i18n/id.json +20 -0
- package/i18n/it.json +20 -0
- package/i18n/ja.json +20 -0
- package/i18n/ko.json +20 -0
- package/i18n/nl.json +20 -0
- package/i18n/pl.json +20 -0
- package/i18n/pt.json +20 -0
- package/i18n/ru.json +20 -0
- package/i18n/sv.json +20 -0
- package/i18n/tr.json +20 -0
- package/i18n/uk.json +20 -0
- package/i18n/vi.json +20 -0
- package/i18n/zh-TW.json +20 -0
- package/i18n/zh.json +20 -0
- 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 +17 -17
- package/llms.txt +7 -3
- package/loading-bar/styles/_rules.scss +6 -0
- package/package.json +2 -2
- package/page-header/styles/_index.scss +18 -0
- package/popconfirm/styles/_index.scss +6 -0
- package/popover/styles/_index.scss +31 -13
- package/schematics/use/symbol-map.json +3 -0
- package/segmented/styles/_index.scss +7 -0
- package/select/styles/_index.scss +7 -0
- package/sidebar/styles/_index.scss +6 -0
- package/skills/ngwr/references/catalog.md +2 -2
- 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 +49 -0
- package/theme/_index.scss +12 -1
- package/theme/styles/_colors.scss +11 -0
- package/theme/styles/_contrast.scss +6 -0
- 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 +14 -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-breadcrumbs.d.ts +25 -0
- package/types/ngwr-button.d.ts +23 -3
- package/types/ngwr-carousel-testing.d.ts +6 -4
- package/types/ngwr-carousel.d.ts +16 -3
- package/types/ngwr-cascader-testing.d.ts +4 -3
- package/types/ngwr-cascader.d.ts +34 -3
- package/types/ngwr-charts-bar-chart-testing.d.ts +15 -13
- package/types/ngwr-charts-bar-chart.d.ts +220 -48
- package/types/ngwr-charts-boxplot-chart-testing.d.ts +9 -2
- package/types/ngwr-charts-boxplot-chart.d.ts +110 -19
- package/types/ngwr-charts-bullet-chart.d.ts +72 -12
- package/types/ngwr-charts-calendar-heatmap.d.ts +119 -15
- package/types/ngwr-charts-candlestick-chart-testing.d.ts +19 -9
- package/types/ngwr-charts-candlestick-chart.d.ts +195 -62
- package/types/ngwr-charts-chart-legend.d.ts +142 -5
- package/types/ngwr-charts-core.d.ts +275 -21
- package/types/ngwr-charts-donut-chart-testing.d.ts +11 -5
- package/types/ngwr-charts-donut-chart.d.ts +124 -16
- package/types/ngwr-charts-funnel-chart.d.ts +62 -6
- package/types/ngwr-charts-gauge-testing.d.ts +5 -1
- package/types/ngwr-charts-gauge.d.ts +72 -10
- package/types/ngwr-charts-heatmap-chart.d.ts +103 -20
- package/types/ngwr-charts-line-chart-testing.d.ts +16 -2
- package/types/ngwr-charts-line-chart.d.ts +215 -86
- package/types/ngwr-charts-meter-group.d.ts +98 -7
- package/types/ngwr-charts-radar-chart-testing.d.ts +14 -3
- package/types/ngwr-charts-radar-chart.d.ts +148 -28
- package/types/ngwr-charts-scatter-chart-testing.d.ts +22 -10
- package/types/ngwr-charts-scatter-chart.d.ts +188 -18
- package/types/ngwr-charts-sparkline.d.ts +26 -4
- package/types/ngwr-charts-treemap-chart.d.ts +121 -23
- package/types/ngwr-charts-waterfall-chart-testing.d.ts +8 -1
- package/types/ngwr-charts-waterfall-chart.d.ts +108 -21
- package/types/ngwr-checkbox.d.ts +1 -0
- package/types/ngwr-color-picker.d.ts +28 -0
- package/types/ngwr-context-menu-testing.d.ts +10 -9
- package/types/ngwr-context-menu.d.ts +18 -1
- package/types/ngwr-copy-value.d.ts +8 -0
- package/types/ngwr-date-picker.d.ts +53 -2
- package/types/ngwr-dialog.d.ts +64 -13
- package/types/ngwr-directives.d.ts +12 -4
- package/types/ngwr-drawer.d.ts +33 -2
- package/types/ngwr-dropdown-testing.d.ts +8 -5
- package/types/ngwr-dropdown.d.ts +29 -6
- package/types/ngwr-event-calendar.d.ts +4 -0
- package/types/ngwr-form.d.ts +85 -1
- package/types/ngwr-graph.d.ts +22 -6
- package/types/ngwr-i18n.d.ts +65 -5
- 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-lightbox.d.ts +15 -0
- package/types/ngwr-loading-bar-router.d.ts +6 -0
- package/types/ngwr-overlay.d.ts +16 -1
- package/types/ngwr-page-header.d.ts +23 -1
- package/types/ngwr-popconfirm-testing.d.ts +11 -2
- package/types/ngwr-popconfirm.d.ts +29 -2
- package/types/ngwr-popover.d.ts +87 -13
- package/types/ngwr-radio.d.ts +47 -5
- package/types/ngwr-segmented.d.ts +7 -0
- package/types/ngwr-select.d.ts +57 -13
- package/types/ngwr-sortable-list.d.ts +20 -7
- package/types/ngwr-table.d.ts +59 -6
- package/types/ngwr-tabs-router.d.ts +6 -0
- package/types/ngwr-toast.d.ts +11 -0
- package/types/ngwr-tour.d.ts +21 -3
- package/types/ngwr-tree-testing.d.ts +1 -2
- package/types/ngwr-tree.d.ts +33 -2
- package/types/ngwr-typography.d.ts +7 -0
- package/types/ngwr-utils-router.d.ts +6 -0
- package/types/ngwr-utils.d.ts +56 -2
- package/types/ngwr-validators.d.ts +49 -1
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +14 -11
- package/typography/styles/_index.scss +4 -0
- package/window/styles/_index.scss +6 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-i18n-zh.mjs","names":[],"sources":["../../../projects/lib/i18n/zh/public-api.ts"],"sourcesContent":["import { type WrI18nCatalog } from 'ngwr/i18n';\n\n/** Base Simplified Chinese catalog for ngwr built-in component strings. */\nexport const wrZh: WrI18nCatalog = {\n common: {\n ok: '确定',\n cancel: '取消',\n close: '关闭',\n confirm: '确认',\n delete: '删除',\n save: '保存',\n edit: '编辑',\n add: '添加',\n remove: '移除',\n clear: '清除',\n search: '搜索',\n loading: '加载中…',\n select: '选择',\n next: '下一步',\n previous: '上一步',\n back: '返回',\n today: '今天',\n yesterday: '昨天',\n tomorrow: '明天',\n of: '共',\n },\n pagination: {\n prev: '上一页',\n next: '下一页',\n itemsPerPage: '每页条数',\n perPage: '{{size}} 条/页',\n goToPage: '跳转到第 {{page}} 页',\n label: '分页',\n pageOf: '第 {{current}} 页,共 {{total}} 页',\n range: '{{from}}–{{to}},共 {{total}} 条',\n compact: '{{current}} / {{total}}',\n },\n table: {\n empty: '暂无数据',\n loading: '加载中…',\n sort: '对{{column}}列排序',\n filter: '筛选{{column}}列',\n selectAll: '选择所有行',\n selectRow: '选择行',\n expandRow: '展开或收起行详情',\n toggleRow: '展开或收起子行',\n selectGroup: '选择分组',\n toggleGroup: '展开或收起分组',\n noMatches: '无匹配结果',\n search: '搜索',\n reset: '重置',\n columns: '列',\n showAllColumns: '显示全部',\n selected: '已选择 {{count}} 项',\n clearSelection: '清除选择',\n },\n eventCalendar: {\n today: '今天',\n previous: '上一个',\n next: '下一个',\n month: '月',\n week: '周',\n day: '日',\n time: '时间',\n allDay: '全天',\n label: '日历',\n more: '+{{count}} 项',\n header: '{{year}}年{{month}}',\n range: '{{from}} – {{to}}',\n chipLabel: '{{title}},{{time}}',\n slotLabel: '{{date}} {{time}}',\n allDayCellLabel: '{{date}} {{label}}',\n },\n tour: {\n next: '下一步',\n back: '上一步',\n done: '完成',\n skip: '跳过引导',\n progress: '第 {{current}} 步,共 {{total}} 步',\n },\n resizable: {\n handle: '调整大小',\n },\n splitter: {\n divider: '调整面板大小',\n },\n stepper: {\n optional: '可选',\n completed: '已完成',\n },\n transfer: {\n source: '待选',\n target: '已选',\n search: '搜索',\n empty: '暂无内容',\n selectAll: '全选',\n toTarget: '移至已选',\n toSource: '移回待选',\n count: '{{checked}} / {{total}}',\n selectAllAria: '{{pane}} — {{action}}',\n },\n form: {\n optional: '选填',\n },\n select: {\n label: '选择',\n placeholder: '请选择',\n empty: '暂无选项',\n clearSelection: '清除选择',\n removeItem: '移除 {{label}}',\n noResults: '无搜索结果',\n results: '结果:{{count}}',\n loading: '加载中…',\n loadError: '无法加载结果',\n retry: '重试',\n more: '+{{count}} 项',\n selectAll: '全选',\n },\n tree: {\n expand: '展开',\n collapse: '收起',\n placeholder: '请选择',\n clearSelection: '清除选择',\n removeItem: '移除 {{label}}',\n more: '+{{count}} 项',\n moveKeyHelp: '按 Alt+Enter 键拿起此项,然后用方向键移动。' + '按 Enter 键放下,或按 Esc 键放回原位。',\n },\n commandPalette: {\n label: '命令面板',\n placeholder: '输入命令或搜索…',\n noResults: '无搜索结果',\n loading: '搜索中…',\n escHint: 'esc',\n },\n empty: {\n noData: '暂无数据',\n },\n fileUpload: {\n browse: '点击选择文件',\n dropZone: '或将文件拖放到此处',\n removeFile: '移除 {{name}}',\n size: '{{value}} {{unit}}',\n unitByte: 'B',\n unitKb: 'KB',\n unitMb: 'MB',\n unitGb: 'GB',\n unitTb: 'TB',\n uploading: '正在上传',\n uploaded: '已上传',\n failed: '上传失败',\n status: '{{name}}: {{status}}',\n retry: '重试',\n },\n popconfirm: {\n label: '确认操作',\n confirm: '确认',\n cancel: '取消',\n },\n toast: {\n region: '通知',\n close: '关闭',\n copy: '复制',\n copied: '已复制',\n closeAll: '全部关闭',\n },\n copyValue: {\n copy: '复制',\n copied: '已复制',\n empty: '-',\n },\n copyToClipboard: {\n copied: '已复制',\n },\n input: {\n showPassword: '显示密码',\n hidePassword: '隐藏密码',\n },\n inputNumber: {\n increment: '增加',\n decrement: '减少',\n },\n inputOtp: {\n label: '验证码',\n digit: '第 {{index}} 位数字',\n character: '第 {{index}} 个字符',\n },\n anchor: {\n label: '目录',\n },\n avatar: {\n alt: '头像',\n },\n backTop: {\n label: '返回顶部',\n },\n breadcrumbs: {\n label: '面包屑导航',\n },\n burger: {\n label: '打开或关闭菜单',\n },\n calendar: {\n prevMonth: '上个月',\n nextMonth: '下个月',\n prevYear: '上一年',\n nextYear: '下一年',\n monthList: '月份',\n yearList: '年份',\n quarterList: '季度',\n quarter: '第{{quarter}}季度',\n prevYears: '前 12 年',\n nextYears: '后 12 年',\n header: '{{year}}年{{month}}',\n yearRange: '{{from}} – {{to}}',\n dayLabel: '{{date}} {{weekday}}',\n },\n imageCropper: {\n empty: '暂无图片',\n window: '裁剪区域',\n keyHelp:\n '方向键移动裁剪框。按住 Alt 加方向键可调整大小,按住 Shift 可加大步长。' +\n '裁剪框会以图像像素为单位,依次朗读左、上、宽、高四个值。',\n },\n sortableList: {\n keyHelp: '按空格键拿起此项,然后用方向键移动。再次按空格键放下,或按 Esc 键放回原位。',\n grabbed: '已拿起。第 {{index}} 项,共 {{total}} 项。',\n moved: '第 {{index}} 项,共 {{total}} 项。',\n dropped: '已放下。第 {{index}} 项,共 {{total}} 项。',\n cancelled: '已取消移动。',\n groupKeyHelp:\n '按空格键拿起此项,然后用方向键在列表内移动或移到相邻列表。' + '再次按空格键放下,或按 Esc 键放回原位。',\n movedTo: '已移至{{list}}。第 {{index}} 项,共 {{total}} 项。',\n listPosition: '第 {{index}} 个列表,共 {{total}} 个',\n },\n colorPicker: {\n area: '饱和度 {{saturation}}%,明度 {{brightness}}%',\n hue: '色相',\n alpha: '不透明度',\n formatHex: 'HEX',\n formatRgb: 'RGB',\n formatHsl: 'HSL',\n channelHex: 'HEX',\n channelRed: 'R',\n channelGreen: 'G',\n channelBlue: 'B',\n channelHue: 'H',\n channelSaturation: 'S%',\n channelLightness: 'L%',\n channelAlpha: 'A%',\n },\n barChart: {\n label: '柱状图',\n total: '合计',\n value: '值',\n datum: '{{label}}: {{value}}',\n },\n calendarHeatmap: {\n label: '日历热力图',\n cell: '{{date}}: {{count}}',\n },\n lineChart: {\n label: '折线图',\n areaLabel: '面积图',\n },\n donutChart: {\n label: '环形图',\n pieLabel: '饼图',\n },\n chartLegend: {\n toggleLabel: '切换系列显示',\n hidden: '已隐藏',\n },\n scatterChart: {\n label: '散点图',\n x: 'X',\n y: 'Y',\n size: '大小',\n },\n radarChart: {\n label: '雷达图',\n polarAreaLabel: '极坐标面积图',\n },\n heatmapChart: {\n label: '热力图',\n noData: '无数据',\n },\n funnelChart: {\n label: '漏斗图',\n stage: '阶段',\n value: '值',\n fromPrevious: '较上一阶段',\n fromFirst: '较第一阶段',\n ofPrevious: '上一阶段的 {{percent}}',\n ofFirst: '第一阶段的 {{percent}}',\n stageName: '{{label}}: {{value}}',\n stageNameOne: '{{label}}: {{value}},{{conversion}}',\n stageNameBoth: '{{label}}: {{value}},{{previous}},{{first}}',\n },\n waterfallChart: {\n label: '瀑布图',\n step: '步骤',\n change: '变化',\n runningTotal: '累计',\n changeStep: '{{label}}: {{change}},累计 {{total}}',\n totalStep: '{{label}}: 合计 {{total}}',\n },\n treemapChart: {\n label: '矩形树图',\n value: '值',\n share: '占比',\n },\n bulletChart: {\n label: '子弹图',\n target: '目标',\n summary: '{{label}}: {{value}},目标 {{target}}',\n summaryNoTarget: '{{label}}: {{value}}',\n summaryNoValue: '{{label}}: 无值,目标 {{target}}',\n noValue: '{{label}}: 无值',\n },\n boxplotChart: {\n label: '箱线图',\n group: '分组',\n upperWhisker: '上须',\n q3: 'Q3',\n median: '中位数',\n q1: 'Q1',\n lowerWhisker: '下须',\n outliers: '异常值',\n moreOutliers: '另有 {{count}} 个',\n },\n candlestickChart: {\n label: 'K 线图',\n open: '开盘',\n high: '最高',\n low: '最低',\n close: '收盘',\n },\n compare: {\n label: '对比分隔条',\n },\n carousel: {\n label: '轮播图',\n goToSlide: '转到第 {{index}} 张幻灯片',\n position: '第 {{current}} 张幻灯片,共 {{total}} 张',\n prev: '上一张幻灯片',\n next: '下一张幻灯片',\n pagination: '轮播分页',\n roledescription: '轮播图',\n slideRoledescription: '幻灯片',\n },\n alert: {\n close: '关闭提示',\n },\n tag: {\n remove: '移除 {{label}}',\n },\n qr: {\n label: '二维码',\n },\n image: {\n viewer: '图片预览',\n open: '打开预览',\n close: '关闭预览',\n counter: '{{current}} / {{total}}',\n position: '第 {{current}} 张图片,共 {{total}} 张',\n },\n window: {\n close: '关闭',\n minimize: '最小化',\n maximize: '最大化',\n restore: '还原',\n restoreDown: '向下还原',\n restoreWindow: '还原 {{title}}',\n closeWindow: '关闭窗口',\n untitled: '无标题',\n taskbar: '已最小化的窗口',\n taskbarAll: '已打开的窗口',\n taskbarMore: '其他窗口: {{count}}',\n moveMode: '正在移动窗口。使用方向键移动,按 Enter 键完成,按 Esc 键取消。',\n resizeMode: '正在调整窗口大小。使用方向键调整,按 Enter 键完成,按 Esc 键取消。',\n moved: '窗口已移动到 {{x}},{{y}}',\n resized: '窗口大小已调整为宽 {{width}}、高 {{height}}',\n },\n dialog: {\n close: '关闭对话框',\n },\n popover: {\n label: '弹出面板',\n },\n editor: {\n label: '富文本',\n toolbar: '格式',\n bold: '加粗',\n italic: '斜体',\n underline: '下划线',\n strike: '删除线',\n code: '行内代码',\n paragraph: '正文',\n heading: '标题 {{level}}',\n bulletList: '项目符号列表',\n orderedList: '编号列表',\n blockquote: '引用',\n codeBlock: '代码块',\n link: '插入链接',\n horizontalRule: '水平线',\n undo: '撤销',\n redo: '重做',\n linkUrl: '链接地址',\n linkApply: '应用',\n linkRemove: '移除链接',\n linkInvalid: '此地址不能用作链接。',\n shortcut: '{{label}}({{keys}})',\n keyCtrl: 'Ctrl',\n keyShift: 'Shift',\n keyAlt: 'Alt',\n taskDone: '已完成:',\n taskTodo: '待办:',\n },\n kbd: {\n ctrl: 'Ctrl',\n shift: 'Shift',\n alt: 'Alt',\n enter: 'Enter',\n esc: 'Esc',\n tab: 'Tab',\n space: '空格',\n backspace: 'Backspace',\n delete: 'Delete',\n home: 'Home',\n end: 'End',\n pageUp: 'Page Up',\n pageDown: 'Page Down',\n },\n mention: {\n listbox: '提及',\n available: '匹配项:{{count}}',\n inserted: '已插入:{{label}}',\n },\n comment: {\n send: '发送',\n replies: '回复',\n },\n drawer: {\n close: '关闭抽屉',\n },\n datePicker: {\n open: '打开日历',\n openTime: '打开时间选择器',\n openDateTime: '打开日期时间选择器',\n openRange: '打开日期范围日历',\n panel: '选择日期',\n panelTime: '选择时间',\n panelDateTime: '选择日期和时间',\n panelRange: '选择日期范围',\n panelRangeDateTime: '选择日期和时间范围',\n quarterValue: '{{year}}年第{{quarter}}季度',\n weekValue: '{{year}}年第{{week}}周',\n rangeStart: '起始日期',\n rangeEnd: '结束日期',\n startTime: '开始时间',\n endTime: '结束时间',\n hours: '小时',\n minutes: '分钟',\n seconds: '秒',\n incrementHours: '增加小时',\n decrementHours: '减少小时',\n incrementMinutes: '增加分钟',\n decrementMinutes: '减少分钟',\n incrementSeconds: '增加秒',\n decrementSeconds: '减少秒',\n toggleAmPm: '切换上午/下午',\n am: '上午',\n pm: '下午',\n },\n sidebar: {\n label: '侧边栏',\n containsCurrent: '包含当前页面',\n subpages: '{{title}} 的子页面',\n separator: ',',\n },\n spinner: {\n label: '加载中',\n },\n rating: {\n label: '评分',\n },\n gauge: {\n label: '仪表盘',\n },\n graph: {\n label: '图',\n parents: '父节点:{{names}}。',\n children: '子节点:{{names}}。',\n zoomIn: '放大',\n zoomOut: '缩小',\n fit: '适应视图',\n },\n progress: {\n label: '进度',\n },\n meterGroup: {\n label: '计量条',\n },\n knob: {\n label: '数值',\n },\n slider: {\n label: '数值',\n lower: '下限值',\n upper: '上限值',\n },\n speedDial: {\n label: '操作',\n },\n statistic: {\n delta: '{{value}}{{suffix}}',\n deltaSuffix: '%',\n },\n result: {\n notFound: '抱歉,您访问的页面不存在。',\n forbidden: '抱歉,您无权访问此页面。',\n serverError: '抱歉,出错了。',\n },\n loadState: {\n failed: '无法加载',\n retry: '重试',\n },\n date: {\n months: {\n jan: '一月',\n feb: '二月',\n mar: '三月',\n apr: '四月',\n may: '五月',\n jun: '六月',\n jul: '七月',\n aug: '八月',\n sep: '九月',\n oct: '十月',\n nov: '十一月',\n dec: '十二月',\n },\n },\n rotateReveal: {\n conjunction: '和',\n },\n marquee: {\n pause: '暂停',\n play: '播放',\n },\n};\n"],"mappings":"AAGA,MAAa,OAAsB;CACjC,QAAQ;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AAW;CACZ;CACD,SAAS,EACP,OAAO,MACR;CACD,QAAQ,EACN,OAAO,KACR;CACD,OAAO,EACL,OAAO,MACR;CACD,OAAO;EACL,OAAO;EACP,SAAS;EACT,UAAU;EACV,QAAQ;EACR,SAAS;EACT,KAAK;CACN;CACD,UAAU,EACR,OAAO,KACR;CACD,YAAY,EACV,OAAO,MACR;CACD,MAAM,EACJ,OAAO,KACR;CACD,QAAQ;EACN,OAAO;EACP,OAAO;EACP,OAAO;CACR;CACD,WAAW,EACT,OAAO,KACR;CACD,WAAW;EACT,OAAO;EACP,aAAa;CACd;CACD,QAAQ;EACN,UAAU;EACV,WAAW;EACX,aAAa;CACd;CACD,WAAW;EACT,QAAQ;EACR,OAAO;CACR;CACD,MAAM,EACJ,QAAQ;EACN,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;CACN,EACF;CACD,cAAc,EACZ,aAAa,IACd;CACD,SAAS;EACP,OAAO;EACP,MAAM;CACP;AACF"}
|
|
1
|
+
{"version":3,"file":"ngwr-i18n-zh.mjs","names":[],"sources":["../../../projects/lib/i18n/zh/public-api.ts"],"sourcesContent":["import { type WrI18nCatalog } from 'ngwr/i18n';\n\n/** Base Simplified Chinese catalog for ngwr built-in component strings. */\nexport const wrZh: WrI18nCatalog = {\n common: {\n ok: '确定',\n cancel: '取消',\n close: '关闭',\n confirm: '确认',\n delete: '删除',\n save: '保存',\n edit: '编辑',\n add: '添加',\n remove: '移除',\n clear: '清除',\n search: '搜索',\n loading: '加载中…',\n select: '选择',\n next: '下一步',\n previous: '上一步',\n back: '返回',\n today: '今天',\n yesterday: '昨天',\n tomorrow: '明天',\n of: '共',\n },\n pagination: {\n prev: '上一页',\n next: '下一页',\n itemsPerPage: '每页条数',\n perPage: '{{size}} 条/页',\n goToPage: '跳转到第 {{page}} 页',\n label: '分页',\n pageOf: '第 {{current}} 页,共 {{total}} 页',\n range: '{{from}}–{{to}},共 {{total}} 条',\n compact: '{{current}} / {{total}}',\n },\n table: {\n empty: '暂无数据',\n loading: '加载中…',\n sort: '对{{column}}列排序',\n filter: '筛选{{column}}列',\n selectAll: '选择所有行',\n selectRow: '选择行',\n expandRow: '展开或收起行详情',\n toggleRow: '展开或收起子行',\n selectGroup: '选择分组',\n toggleGroup: '展开或收起分组',\n noMatches: '无匹配结果',\n search: '搜索',\n reset: '重置',\n columns: '列',\n showAllColumns: '显示全部',\n selected: '已选择 {{count}} 项',\n clearSelection: '清除选择',\n },\n eventCalendar: {\n today: '今天',\n previous: '上一个',\n next: '下一个',\n month: '月',\n week: '周',\n day: '日',\n time: '时间',\n allDay: '全天',\n label: '日历',\n more: '+{{count}} 项',\n header: '{{year}}年{{month}}',\n range: '{{from}} – {{to}}',\n chipLabel: '{{title}},{{time}}',\n slotLabel: '{{date}} {{time}}',\n allDayCellLabel: '{{date}} {{label}}',\n },\n tour: {\n next: '下一步',\n back: '上一步',\n done: '完成',\n skip: '跳过引导',\n progress: '第 {{current}} 步,共 {{total}} 步',\n },\n resizable: {\n handle: '调整大小',\n },\n splitter: {\n divider: '调整面板大小',\n },\n stepper: {\n optional: '可选',\n completed: '已完成',\n },\n transfer: {\n source: '待选',\n target: '已选',\n search: '搜索',\n empty: '暂无内容',\n selectAll: '全选',\n toTarget: '移至已选',\n toSource: '移回待选',\n count: '{{checked}} / {{total}}',\n selectAllAria: '{{pane}} — {{action}}',\n },\n form: {\n optional: '选填',\n },\n select: {\n label: '选择',\n placeholder: '请选择',\n empty: '暂无选项',\n clearSelection: '清除选择',\n removeItem: '移除 {{label}}',\n noResults: '无搜索结果',\n results: '结果:{{count}}',\n loading: '加载中…',\n loadError: '无法加载结果',\n retry: '重试',\n more: '+{{count}} 项',\n selectAll: '全选',\n },\n tree: {\n expand: '展开',\n collapse: '收起',\n placeholder: '请选择',\n clearSelection: '清除选择',\n removeItem: '移除 {{label}}',\n more: '+{{count}} 项',\n moveKeyHelp: '按 Alt+Enter 键拿起此项,然后用方向键移动。' + '按 Enter 键放下,或按 Esc 键放回原位。',\n },\n commandPalette: {\n label: '命令面板',\n placeholder: '输入命令或搜索…',\n noResults: '无搜索结果',\n loading: '搜索中…',\n escHint: 'esc',\n },\n empty: {\n noData: '暂无数据',\n },\n fileUpload: {\n browse: '点击选择文件',\n dropZone: '或将文件拖放到此处',\n removeFile: '移除 {{name}}',\n size: '{{value}} {{unit}}',\n unitByte: 'B',\n unitKb: 'KB',\n unitMb: 'MB',\n unitGb: 'GB',\n unitTb: 'TB',\n uploading: '正在上传',\n uploaded: '已上传',\n failed: '上传失败',\n status: '{{name}}: {{status}}',\n retry: '重试',\n },\n popconfirm: {\n label: '确认操作',\n confirm: '确认',\n cancel: '取消',\n },\n toast: {\n region: '通知',\n close: '关闭',\n copy: '复制',\n copied: '已复制',\n closeAll: '全部关闭',\n },\n copyValue: {\n copy: '复制',\n copied: '已复制',\n empty: '-',\n },\n copyToClipboard: {\n copied: '已复制',\n },\n input: {\n showPassword: '显示密码',\n hidePassword: '隐藏密码',\n },\n inputNumber: {\n increment: '增加',\n decrement: '减少',\n },\n inputOtp: {\n label: '验证码',\n digit: '第 {{index}} 位数字',\n character: '第 {{index}} 个字符',\n },\n anchor: {\n label: '目录',\n },\n avatar: {\n alt: '头像',\n },\n backTop: {\n label: '返回顶部',\n },\n breadcrumbs: {\n label: '面包屑导航',\n },\n burger: {\n label: '打开或关闭菜单',\n },\n calendar: {\n prevMonth: '上个月',\n nextMonth: '下个月',\n prevYear: '上一年',\n nextYear: '下一年',\n monthList: '月份',\n yearList: '年份',\n quarterList: '季度',\n quarter: '第{{quarter}}季度',\n prevYears: '前 12 年',\n nextYears: '后 12 年',\n header: '{{year}}年{{month}}',\n yearRange: '{{from}} – {{to}}',\n dayLabel: '{{date}} {{weekday}}',\n },\n imageCropper: {\n empty: '暂无图片',\n window: '裁剪区域',\n keyHelp:\n '方向键移动裁剪框。按住 Alt 加方向键可调整大小,按住 Shift 可加大步长。' +\n '裁剪框会以图像像素为单位,依次朗读左、上、宽、高四个值。',\n },\n sortableList: {\n keyHelp: '按空格键拿起此项,然后用方向键移动。再次按空格键放下,或按 Esc 键放回原位。',\n grabbed: '已拿起。第 {{index}} 项,共 {{total}} 项。',\n moved: '第 {{index}} 项,共 {{total}} 项。',\n dropped: '已放下。第 {{index}} 项,共 {{total}} 项。',\n cancelled: '已取消移动。',\n groupKeyHelp:\n '按空格键拿起此项,然后用方向键在列表内移动或移到相邻列表。' + '再次按空格键放下,或按 Esc 键放回原位。',\n movedTo: '已移至{{list}}。第 {{index}} 项,共 {{total}} 项。',\n listPosition: '第 {{index}} 个列表,共 {{total}} 个',\n },\n colorPicker: {\n area: '饱和度 {{saturation}}%,明度 {{brightness}}%',\n hue: '色相',\n alpha: '不透明度',\n formatHex: 'HEX',\n formatRgb: 'RGB',\n formatHsl: 'HSL',\n channelHex: 'HEX',\n channelRed: 'R',\n channelGreen: 'G',\n channelBlue: 'B',\n channelHue: 'H',\n channelSaturation: 'S%',\n channelLightness: 'L%',\n channelAlpha: 'A%',\n },\n // What a chart shows in place of its marks: no data, a request in flight, a failed\n // load. One set for every chart; each has a `*Label` input over it.\n chart: {\n empty: '无数据',\n loading: '加载中…',\n error: '无法加载',\n },\n barChart: {\n label: '柱状图',\n total: '合计',\n value: '值',\n datum: '{{label}}: {{value}}',\n },\n calendarHeatmap: {\n label: '日历热力图',\n cell: '{{date}}: {{count}}',\n },\n lineChart: {\n label: '折线图',\n areaLabel: '面积图',\n },\n donutChart: {\n label: '环形图',\n pieLabel: '饼图',\n },\n chartLegend: {\n toggleLabel: '切换系列显示',\n hidden: '已隐藏',\n },\n scatterChart: {\n label: '散点图',\n x: 'X',\n y: 'Y',\n size: '大小',\n },\n radarChart: {\n label: '雷达图',\n polarAreaLabel: '极坐标面积图',\n },\n heatmapChart: {\n label: '热力图',\n noData: '无数据',\n },\n funnelChart: {\n label: '漏斗图',\n stage: '阶段',\n value: '值',\n fromPrevious: '较上一阶段',\n fromFirst: '较第一阶段',\n ofPrevious: '上一阶段的 {{percent}}',\n ofFirst: '第一阶段的 {{percent}}',\n stageName: '{{label}}: {{value}}',\n stageNameOne: '{{label}}: {{value}},{{conversion}}',\n stageNameBoth: '{{label}}: {{value}},{{previous}},{{first}}',\n },\n waterfallChart: {\n label: '瀑布图',\n step: '步骤',\n change: '变化',\n runningTotal: '累计',\n changeStep: '{{label}}: {{change}},累计 {{total}}',\n totalStep: '{{label}}: 合计 {{total}}',\n },\n treemapChart: {\n label: '矩形树图',\n value: '值',\n share: '占比',\n },\n bulletChart: {\n label: '子弹图',\n target: '目标',\n summary: '{{label}}: {{value}},目标 {{target}}',\n summaryNoTarget: '{{label}}: {{value}}',\n summaryNoValue: '{{label}}: 无值,目标 {{target}}',\n noValue: '{{label}}: 无值',\n },\n boxplotChart: {\n label: '箱线图',\n group: '分组',\n upperWhisker: '上须',\n q3: 'Q3',\n median: '中位数',\n q1: 'Q1',\n lowerWhisker: '下须',\n outliers: '异常值',\n moreOutliers: '另有 {{count}} 个',\n },\n candlestickChart: {\n label: 'K 线图',\n open: '开盘',\n high: '最高',\n low: '最低',\n close: '收盘',\n },\n compare: {\n label: '对比分隔条',\n },\n carousel: {\n label: '轮播图',\n goToSlide: '转到第 {{index}} 张幻灯片',\n position: '第 {{current}} 张幻灯片,共 {{total}} 张',\n prev: '上一张幻灯片',\n next: '下一张幻灯片',\n pagination: '轮播分页',\n roledescription: '轮播图',\n slideRoledescription: '幻灯片',\n },\n alert: {\n close: '关闭提示',\n },\n tag: {\n remove: '移除 {{label}}',\n },\n qr: {\n label: '二维码',\n },\n image: {\n viewer: '图片预览',\n open: '打开预览',\n close: '关闭预览',\n counter: '{{current}} / {{total}}',\n position: '第 {{current}} 张图片,共 {{total}} 张',\n },\n window: {\n close: '关闭',\n minimize: '最小化',\n maximize: '最大化',\n restore: '还原',\n restoreDown: '向下还原',\n restoreWindow: '还原 {{title}}',\n closeWindow: '关闭窗口',\n untitled: '无标题',\n taskbar: '已最小化的窗口',\n taskbarAll: '已打开的窗口',\n taskbarMore: '其他窗口: {{count}}',\n moveMode: '正在移动窗口。使用方向键移动,按 Enter 键完成,按 Esc 键取消。',\n resizeMode: '正在调整窗口大小。使用方向键调整,按 Enter 键完成,按 Esc 键取消。',\n moved: '窗口已移动到 {{x}},{{y}}',\n resized: '窗口大小已调整为宽 {{width}}、高 {{height}}',\n },\n dialog: {\n close: '关闭对话框',\n },\n popover: {\n label: '弹出面板',\n },\n editor: {\n label: '富文本',\n toolbar: '格式',\n bold: '加粗',\n italic: '斜体',\n underline: '下划线',\n strike: '删除线',\n code: '行内代码',\n paragraph: '正文',\n heading: '标题 {{level}}',\n bulletList: '项目符号列表',\n orderedList: '编号列表',\n blockquote: '引用',\n codeBlock: '代码块',\n link: '插入链接',\n horizontalRule: '水平线',\n undo: '撤销',\n redo: '重做',\n linkUrl: '链接地址',\n linkApply: '应用',\n linkRemove: '移除链接',\n linkInvalid: '此地址不能用作链接。',\n shortcut: '{{label}}({{keys}})',\n keyCtrl: 'Ctrl',\n keyShift: 'Shift',\n keyAlt: 'Alt',\n taskDone: '已完成:',\n taskTodo: '待办:',\n },\n kbd: {\n ctrl: 'Ctrl',\n shift: 'Shift',\n alt: 'Alt',\n enter: 'Enter',\n esc: 'Esc',\n tab: 'Tab',\n space: '空格',\n backspace: 'Backspace',\n delete: 'Delete',\n home: 'Home',\n end: 'End',\n pageUp: 'Page Up',\n pageDown: 'Page Down',\n },\n mention: {\n listbox: '提及',\n available: '匹配项:{{count}}',\n inserted: '已插入:{{label}}',\n },\n comment: {\n send: '发送',\n replies: '回复',\n },\n drawer: {\n close: '关闭抽屉',\n },\n datePicker: {\n open: '打开日历',\n openTime: '打开时间选择器',\n openDateTime: '打开日期时间选择器',\n openRange: '打开日期范围日历',\n panel: '选择日期',\n panelTime: '选择时间',\n panelDateTime: '选择日期和时间',\n panelRange: '选择日期范围',\n panelRangeDateTime: '选择日期和时间范围',\n quarterValue: '{{year}}年第{{quarter}}季度',\n weekValue: '{{year}}年第{{week}}周',\n rangeStart: '起始日期',\n rangeEnd: '结束日期',\n startTime: '开始时间',\n endTime: '结束时间',\n hours: '小时',\n minutes: '分钟',\n seconds: '秒',\n incrementHours: '增加小时',\n decrementHours: '减少小时',\n incrementMinutes: '增加分钟',\n decrementMinutes: '减少分钟',\n incrementSeconds: '增加秒',\n decrementSeconds: '减少秒',\n toggleAmPm: '切换上午/下午',\n am: '上午',\n pm: '下午',\n },\n sidebar: {\n label: '侧边栏',\n containsCurrent: '包含当前页面',\n subpages: '{{title}} 的子页面',\n separator: ',',\n },\n spinner: {\n label: '加载中',\n },\n rating: {\n label: '评分',\n },\n gauge: {\n label: '仪表盘',\n },\n graph: {\n label: '图',\n parents: '父节点:{{names}}。',\n children: '子节点:{{names}}。',\n zoomIn: '放大',\n zoomOut: '缩小',\n fit: '适应视图',\n },\n progress: {\n label: '进度',\n },\n meterGroup: {\n label: '计量条',\n },\n knob: {\n label: '数值',\n },\n slider: {\n label: '数值',\n lower: '下限值',\n upper: '上限值',\n },\n speedDial: {\n label: '操作',\n },\n statistic: {\n delta: '{{value}}{{suffix}}',\n deltaSuffix: '%',\n },\n result: {\n notFound: '抱歉,您访问的页面不存在。',\n forbidden: '抱歉,您无权访问此页面。',\n serverError: '抱歉,出错了。',\n },\n loadState: {\n failed: '无法加载',\n retry: '重试',\n },\n date: {\n months: {\n jan: '一月',\n feb: '二月',\n mar: '三月',\n apr: '四月',\n may: '五月',\n jun: '六月',\n jul: '七月',\n aug: '八月',\n sep: '九月',\n oct: '十月',\n nov: '十一月',\n dec: '十二月',\n },\n },\n rotateReveal: {\n conjunction: '和',\n },\n marquee: {\n pause: '暂停',\n play: '播放',\n },\n httpError: {\n network: '无法连接服务器。请检查网络后重试。',\n 400: '服务器未接受数据。请检查各字段。',\n 401: '会话已结束。请重新登录。',\n 403: '您没有执行此操作的权限。',\n 404: '未找到。该内容可能已被删除。',\n 409: '与现有数据冲突。请刷新页面后重试。',\n 413: '数据过大,无法发送。',\n 422: '部分数据无效。请检查各字段。',\n 429: '请求过多。请稍后重试。',\n 503: '服务器不可用。请一分钟后重试。',\n '4xx': '请求被拒绝。错误代码:{{status}}。',\n '5xx': '服务器出错。请稍后重试。错误代码:{{status}}。',\n unknown: '出了点问题。请稍后重试。',\n },\n};\n"],"mappings":"AAGA,MAAa,OAAsB;CACjC,QAAQ;EACN,IAAI;EACJ,QAAQ;EACR,OAAO;EACP,SAAS;EACT,QAAQ;EACR,MAAM;EACN,MAAM;EACN,KAAK;EACL,QAAQ;EACR,OAAO;EACP,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,MAAM;EACN,UAAU;EACV,MAAM;EACN,OAAO;EACP,WAAW;EACX,UAAU;EACV,IAAI;CACL;CACD,YAAY;EACV,MAAM;EACN,MAAM;EACN,cAAc;EACd,SAAS;EACT,UAAU;EACV,OAAO;EACP,QAAQ;EACR,OAAO;EACP,SAAS;CACV;CACD,OAAO;EACL,OAAO;EACP,SAAS;EACT,MAAM;EACN,QAAQ;EACR,WAAW;EACX,WAAW;EACX,WAAW;EACX,WAAW;EACX,aAAa;EACb,aAAa;EACb,WAAW;EACX,QAAQ;EACR,OAAO;EACP,SAAS;EACT,gBAAgB;EAChB,UAAU;EACV,gBAAgB;CACjB;CACD,eAAe;EACb,OAAO;EACP,UAAU;EACV,MAAM;EACN,OAAO;EACP,MAAM;EACN,KAAK;EACL,MAAM;EACN,QAAQ;EACR,OAAO;EACP,MAAM;EACN,QAAQ;EACR,OAAO;EACP,WAAW;EACX,WAAW;EACX,iBAAiB;CAClB;CACD,MAAM;EACJ,MAAM;EACN,MAAM;EACN,MAAM;EACN,MAAM;EACN,UAAU;CACX;CACD,WAAW,EACT,QAAQ,OACT;CACD,UAAU,EACR,SAAS,SACV;CACD,SAAS;EACP,UAAU;EACV,WAAW;CACZ;CACD,UAAU;EACR,QAAQ;EACR,QAAQ;EACR,QAAQ;EACR,OAAO;EACP,W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W;EACX,eAAe;EACf,YAAY;EACZ,oBAAoB;EACpB,cAAc;EACd,WAAW;EACX,YAAY;EACZ,UAAU;EACV,WAAW;EACX,SAAS;EACT,OAAO;EACP,SAAS;EACT,SAAS;EACT,gBAAgB;EAChB,gBAAgB;EAChB,kBAAkB;EAClB,kBAAkB;EAClB,kBAAkB;EAClB,kBAAkB;EAClB,YAAY;EACZ,IAAI;EACJ,IAAI;CACL;CACD,SAAS;EACP,OAAO;EACP,iBAAiB;EACjB,UAAU;EACV,WAAW;CACZ;CACD,SAAS,EACP,OAAO,MACR;CACD,QAAQ,EACN,OAAO,KACR;CACD,OAAO,EACL,OAAO,MACR;CACD,OAAO;EACL,OAAO;EACP,SAAS;EACT,UAAU;EACV,QAAQ;EACR,SAAS;EACT,KAAK;CACN;CACD,UAAU,EACR,OAAO,KACR;CACD,YAAY,EACV,OAAO,MACR;CACD,MAAM,EACJ,OAAO,KACR;CACD,QAAQ;EACN,OAAO;EACP,OAAO;EACP,OAAO;CACR;CACD,WAAW,EACT,OAAO,KACR;CACD,WAAW;EACT,OAAO;EACP,aAAa;CACd;CACD,QAAQ;EACN,UAAU;EACV,WAAW;EACX,aAAa;CACd;CACD,WAAW;EACT,QAAQ;EACR,OAAO;CACR;CACD,MAAM,EACJ,QAAQ;EACN,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;CACN,EACF;CACD,cAAc,EACZ,aAAa,IACd;CACD,SAAS;EACP,OAAO;EACP,MAAM;CACP;CACD,WAAW;EACT,SAAS;EACT,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,OAAO;EACP,OAAO;EACP,SAAS;CACV;AACF"}
|
package/fesm2022/ngwr-i18n.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { ApplicationRef, Directive, ElementRef, EnvironmentInjector, InjectionToken, LOCALE_ID, Pipe, Service, computed, effect, inject, input, isDevMode, makeEnvironmentProviders, provideEnvironmentInitializer, signal } from "@angular/core";
|
|
3
3
|
import { WR_LIVE_LOCALE } from "ngwr/utils";
|
|
4
|
-
import {
|
|
4
|
+
import { firstValueFrom, of } from "rxjs";
|
|
5
5
|
import { WrStorage } from "ngwr/storage";
|
|
6
6
|
import { HttpClient } from "@angular/common/http";
|
|
7
7
|
/**
|
|
@@ -87,6 +87,7 @@ var WrI18n = class WrI18n {
|
|
|
87
87
|
catalogs = /* @__PURE__ */ new Map();
|
|
88
88
|
revision = signal(0, ...ngDevMode ? [{ debugName: "revision" }] : /* istanbul ignore next */ []);
|
|
89
89
|
inflight = /* @__PURE__ */ new Map();
|
|
90
|
+
failed = /* @__PURE__ */ new Set();
|
|
90
91
|
scopes = /* @__PURE__ */ new Set();
|
|
91
92
|
_locale = signal(this.initialLocale(), ...ngDevMode ? [{ debugName: "_locale" }] : /* istanbul ignore next */ []);
|
|
92
93
|
locale = this._locale.asReadonly();
|
|
@@ -102,6 +103,8 @@ var WrI18n = class WrI18n {
|
|
|
102
103
|
const previous = this._locale();
|
|
103
104
|
this._locale.set(locale);
|
|
104
105
|
if (this.config.storageKey) this.storage.set(this.config.storageKey, locale);
|
|
106
|
+
this.loadChain(locale, null);
|
|
107
|
+
for (const sc of this.scopes) this.loadChain(locale, sc);
|
|
105
108
|
if (isDevMode() && previous !== locale) this.warnOnLocaleIdDrift(locale);
|
|
106
109
|
}
|
|
107
110
|
available() {
|
|
@@ -128,7 +131,7 @@ var WrI18n = class WrI18n {
|
|
|
128
131
|
}
|
|
129
132
|
hit ??= this.walkBase(chain, key);
|
|
130
133
|
if (hit === null) {
|
|
131
|
-
this.loadChain(lc, scope ?? null);
|
|
134
|
+
this.loadChain(lc, scope ?? null, true);
|
|
132
135
|
return options?.fallback ?? this.config.missingHandler(key, lc);
|
|
133
136
|
}
|
|
134
137
|
return wrInterpolate(hit, params);
|
|
@@ -150,8 +153,8 @@ var WrI18n = class WrI18n {
|
|
|
150
153
|
}
|
|
151
154
|
return this.config.defaultLocale;
|
|
152
155
|
}
|
|
153
|
-
loadChain(locale, scope) {
|
|
154
|
-
return Promise.all(localeChain(locale).map((candidate) => this.loadCatalog(candidate, scope)));
|
|
156
|
+
loadChain(locale, scope, auto = false) {
|
|
157
|
+
return Promise.all(localeChain(locale).map((candidate) => this.loadCatalog(candidate, scope, auto)));
|
|
155
158
|
}
|
|
156
159
|
warnedLocaleIdDrift = false;
|
|
157
160
|
warnOnLocaleIdDrift(locale) {
|
|
@@ -159,22 +162,23 @@ var WrI18n = class WrI18n {
|
|
|
159
162
|
this.warnedLocaleIdDrift = true;
|
|
160
163
|
console.warn(`[NGWR] WrI18n.use('${locale}') switched the catalog, but LOCALE_ID is still '${this.localeId}'. Dates follow the switch (wrDate, wr-calendar, wr-date-picker), unless withDates({ locale }) pinned them. LOCALE_ID is an Angular constant, so formatted numbers do not and stay on '${this.localeId}': the wrNumber / wrPlural pipes, wr-input-number, wr-statistic, wr-counter, wr-pagination's total and wr-file-upload's sizes. Reload the app with the new LOCALE_ID to move those.`);
|
|
161
164
|
}
|
|
162
|
-
loadCatalog(locale, scope) {
|
|
165
|
+
loadCatalog(locale, scope, auto = false) {
|
|
163
166
|
const ck = cacheKey(locale, scope);
|
|
164
167
|
const cached = this.catalogs.get(ck);
|
|
165
168
|
if (cached) return Promise.resolve(cached);
|
|
169
|
+
if (auto && this.failed.has(ck)) return Promise.resolve({});
|
|
166
170
|
const pending = this.inflight.get(ck);
|
|
167
171
|
if (pending) return pending;
|
|
168
172
|
const stream = this.loader.load(locale, scope);
|
|
169
173
|
const promise = firstValueFrom(stream).then((catalog) => {
|
|
174
|
+
this.failed.delete(ck);
|
|
170
175
|
this.catalogs.set(ck, catalog);
|
|
171
176
|
this.revision.update((v) => v + 1);
|
|
172
177
|
return catalog;
|
|
173
178
|
}).catch((err) => {
|
|
174
179
|
console.warn(`[ngwr/i18n] failed to load (${locale}, ${scope ?? "root"})`, err);
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return empty;
|
|
180
|
+
this.failed.add(ck);
|
|
181
|
+
return {};
|
|
178
182
|
}).finally(() => {
|
|
179
183
|
this.inflight.delete(ck);
|
|
180
184
|
});
|
|
@@ -391,8 +395,8 @@ var WrI18nHttpLoader = class {
|
|
|
391
395
|
this.config = config;
|
|
392
396
|
}
|
|
393
397
|
load(locale, scope) {
|
|
394
|
-
const url = (scope === null ? this.config.rootPath ?? this.config.path : this.config.path).
|
|
395
|
-
return this.http.get(url)
|
|
398
|
+
const url = (scope === null ? this.config.rootPath ?? this.config.path : this.config.path).replaceAll("{locale}", locale).replaceAll("{scope}", scope ?? "");
|
|
399
|
+
return this.http.get(url);
|
|
396
400
|
}
|
|
397
401
|
};
|
|
398
402
|
/**
|
|
@@ -480,6 +484,73 @@ function useI18nFormatter(key, fallback) {
|
|
|
480
484
|
return v === key ? wrInterpolate(fallback, params) : v;
|
|
481
485
|
};
|
|
482
486
|
}
|
|
483
|
-
|
|
487
|
+
/**
|
|
488
|
+
* @license
|
|
489
|
+
*
|
|
490
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
491
|
+
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
|
|
492
|
+
*/
|
|
493
|
+
const FALLBACK = {
|
|
494
|
+
network: "No connection to the server. Check your network and try again.",
|
|
495
|
+
400: "The server did not accept the data. Check the fields.",
|
|
496
|
+
401: "Your session has ended. Sign in again.",
|
|
497
|
+
403: "You do not have permission for this action.",
|
|
498
|
+
404: "Not found. It may have been deleted.",
|
|
499
|
+
409: "This conflicts with existing data. Refresh the page and try again.",
|
|
500
|
+
413: "The data is too large to send.",
|
|
501
|
+
422: "Some of the data is not valid. Check the fields.",
|
|
502
|
+
429: "Too many requests. Try again in a moment.",
|
|
503
|
+
503: "The server is unavailable. Try again in a minute.",
|
|
504
|
+
"4xx": "The request was refused. Error code: {{status}}.",
|
|
505
|
+
"5xx": "The server failed. Try again later. Error code: {{status}}.",
|
|
506
|
+
unknown: "Something went wrong. Try again later."
|
|
507
|
+
};
|
|
508
|
+
function catalogKeys(status) {
|
|
509
|
+
if (status === null) return ["unknown"];
|
|
510
|
+
if (status === 0) return ["network"];
|
|
511
|
+
if (status >= 400 && status < 500) return [
|
|
512
|
+
String(status),
|
|
513
|
+
"4xx",
|
|
514
|
+
"unknown"
|
|
515
|
+
];
|
|
516
|
+
if (status >= 500 && status < 600) return [
|
|
517
|
+
String(status),
|
|
518
|
+
"5xx",
|
|
519
|
+
"unknown"
|
|
520
|
+
];
|
|
521
|
+
return [String(status), "unknown"];
|
|
522
|
+
}
|
|
523
|
+
function serverMessage(error) {
|
|
524
|
+
const body = error?.error;
|
|
525
|
+
if (typeof body === "string") {
|
|
526
|
+
const text = body.trim();
|
|
527
|
+
return text === "" || text.startsWith("<") ? null : text;
|
|
528
|
+
}
|
|
529
|
+
const message = body?.message;
|
|
530
|
+
return typeof message === "string" && message.trim() !== "" ? message.trim() : null;
|
|
531
|
+
}
|
|
532
|
+
function wrHttpStatus(error) {
|
|
533
|
+
const status = error?.status;
|
|
534
|
+
return typeof status === "number" && Number.isInteger(status) && status >= 0 ? status : null;
|
|
535
|
+
}
|
|
536
|
+
function wrHttpErrorText(error, options = {}) {
|
|
537
|
+
const status = wrHttpStatus(error);
|
|
538
|
+
const override = status === null ? void 0 : options.overrides?.[status];
|
|
539
|
+
if (override !== void 0) return typeof override === "function" ? override(error) : override;
|
|
540
|
+
if (options.serverMessage && status !== null) {
|
|
541
|
+
const said = serverMessage(error);
|
|
542
|
+
if (said !== null) return said;
|
|
543
|
+
}
|
|
544
|
+
const i18n = options.injector ? options.injector.get(WrI18n, null) : inject(WrI18n, { optional: true });
|
|
545
|
+
const keys = catalogKeys(status);
|
|
546
|
+
const params = { status };
|
|
547
|
+
for (const key of keys) {
|
|
548
|
+
const hit = i18n?.t(`httpError.${key}`, params, { fallback: "" });
|
|
549
|
+
if (hit) return hit;
|
|
550
|
+
}
|
|
551
|
+
for (const key of keys) if (key in FALLBACK) return wrInterpolate(FALLBACK[key], params);
|
|
552
|
+
return FALLBACK["unknown"];
|
|
553
|
+
}
|
|
554
|
+
export { DEFAULT_WR_I18N_CONFIG, WR_I18N_BASE_CATALOGS, WR_I18N_CONFIG, WR_I18N_LOADER, WrI18n, WrI18nHttpLoader, WrI18nStaticLoader, WrTDirective, WrTPipe, provideWrI18n, provideWrI18nBaseCatalogs, provideWrI18nHttpLoader, provideWrI18nStaticLoader, useI18nFormatter, useI18nText, wrHttpErrorText, wrHttpStatus, wrReadI18nText };
|
|
484
555
|
|
|
485
556
|
//# sourceMappingURL=ngwr-i18n.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-i18n.mjs","names":[],"sources":["../../../projects/lib/i18n/i18n-base-catalogs.ts","../../../projects/lib/i18n/i18n-config.ts","../../../projects/lib/i18n/i18n-loader.ts","../../../projects/lib/i18n/i18n.ts","../../../projects/lib/i18n/t.pipe.ts","../../../projects/lib/i18n/t.directive.ts","../../../projects/lib/i18n/loaders/static-loader.ts","../../../projects/lib/i18n/loaders/http-loader.ts","../../../projects/lib/i18n/provide-wr-i18n.ts","../../../projects/lib/i18n/util.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 { InjectionToken } from '@angular/core';\n\nimport { type WrI18nCatalog } from './i18n-config';\n\n/** Base catalogs keyed by locale, contributed by {@link provideWrI18nBaseCatalogs}. */\nexport type WrI18nBaseCatalogs = Readonly<Record<string, WrI18nCatalog>>;\n\n/**\n * Catalogs consulted *underneath* whatever the loader returned — the place for\n * ngwr's own built-in strings.\n *\n * A loader **replaces** the catalog for a locale rather than extending it, so an\n * app whose JSON holds only its own keys used to lose every built-in label to\n * its hardcoded English fallback, silently. Registering `wrRu` / `wrEn` here\n * puts them back without the app having to merge anything itself.\n *\n * `multi`, so several features can each contribute; later contributions win on\n * a key collision, and anything the loader returned still wins over all of them.\n *\n * It has to be handed in by the consumer rather than wired up inside\n * `provideWrI18n()`: the catalogs are their own entry points (`ngwr/i18n/ru`)\n * and they already import from `ngwr/i18n`, so importing them back here would\n * be a circular dependency between entry points. Passing them in also keeps\n * the locales you don't ship out of your bundle.\n */\nexport const WR_I18N_BASE_CATALOGS = new InjectionToken<readonly WrI18nBaseCatalogs[]>('WR_I18N_BASE_CATALOGS');\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 { InjectionToken, LOCALE_ID, inject } from '@angular/core';\n\n/** Translation catalog — flat or nested record of strings. */\nexport interface WrI18nCatalog {\n readonly [key: string]: string | WrI18nCatalog;\n}\n\n/** Parameters passed to interpolation — coerced to strings via `String(v)`. */\nexport type WrI18nParams = Readonly<Record<string, unknown>>;\n\n/**\n * The third argument of `WrI18n.t()`, `WrI18n.translate()` and the `wrT` pipe,\n * where a bare string is the scope.\n */\nexport interface WrI18nTranslateOptions {\n /** Scoped lookup first, then the root catalog. */\n readonly scope?: string;\n\n /**\n * Returned as is when the key is missing: no interpolation, no\n * `missingHandler` call. `null` and `undefined` mean no fallback.\n */\n readonly fallback?: string | null;\n}\n\n/** Hook called once on every key that resolves to nothing. */\nexport type WrI18nMissingHandler = (key: string, locale: string) => string;\n\n/** User-facing config for {@link provideWrI18n}. */\nexport interface WrI18nConfig {\n /**\n * BCP-47 tag used until the user calls `use()`.\n *\n * Omitted, it is Angular's own `LOCALE_ID` — the app already states its\n * locale there, and ngwr having a second, unrelated default is how a fully\n * Russian app came to render an English calendar inside itself. See\n * {@link WrI18n} for the whole precedence.\n *\n * @default LOCALE_ID\n */\n readonly defaultLocale?: string;\n\n /**\n * Whitelisted locales — `use()` ignores anything outside this list. Omitted,\n * it is `[defaultLocale]`: it used to be a hardcoded `['en']`, so\n * `provideWrI18n({ defaultLocale: 'ru' })` produced a service whose own\n * default locale was not switchable back to.\n *\n * @default [defaultLocale]\n */\n readonly availableLocales?: readonly string[];\n\n /**\n * Storage key for persisting the active locale (via `WrStorage`).\n * Set to `null` to disable persistence. @default 'wr:i18n:locale'\n */\n readonly storageKey?: string | null;\n\n /** Called when a key is missing. Default returns the key itself. */\n readonly missingHandler?: WrI18nMissingHandler;\n}\n\n/** Resolved config — every field non-optional. @internal */\nexport interface WrI18nConfigResolved {\n readonly defaultLocale: string;\n readonly availableLocales: readonly string[];\n readonly storageKey: string | null;\n readonly missingHandler: WrI18nMissingHandler;\n}\n\n/**\n * Everything but the locale, which cannot be a constant: it is resolved from\n * `LOCALE_ID` in an injection context. @internal\n */\nexport const DEFAULT_WR_I18N_CONFIG: Omit<WrI18nConfigResolved, 'defaultLocale' | 'availableLocales'> = {\n storageKey: 'wr:i18n:locale',\n missingHandler: key => key,\n};\n\n/**\n * Resolve the locale half of the config. Callable only from an injection\n * context, because the seed is `LOCALE_ID`. @internal\n */\nexport function resolveWrI18nLocales(\n config: WrI18nConfig\n): Pick<WrI18nConfigResolved, 'defaultLocale' | 'availableLocales'> {\n const defaultLocale = config.defaultLocale ?? inject(LOCALE_ID);\n return { defaultLocale, availableLocales: config.availableLocales ?? [defaultLocale] };\n}\n\nexport const WR_I18N_CONFIG = new InjectionToken<WrI18nConfigResolved>('WR_I18N_CONFIG', {\n factory: () => ({ ...DEFAULT_WR_I18N_CONFIG, ...resolveWrI18nLocales({}) }),\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 { InjectionToken } from '@angular/core';\n\nimport { of, type Observable } from 'rxjs';\n\nimport { type WrI18nCatalog } from './i18n-config';\n\n/**\n * Loads a catalog for a `(locale, scope)` pair. `scope` is `null` for the\n * root catalog. Implementations may return the catalog synchronously\n * (via `of(...)`) for static catalogs or asynchronously (via HTTP) for\n * lazy fetches.\n */\nexport interface WrI18nLoader {\n load(locale: string, scope: string | null): Observable<WrI18nCatalog>;\n}\n\n/**\n * The active loader.\n *\n * Defaults to one that serves an empty catalog, which is what makes\n * `provideWrI18n()` genuinely optional: every ngwr component routes its\n * built-in strings through `useI18nText` / `wrReadI18nText`, those inject\n * `WrI18n` optionally — and because `WrI18n` is `providedIn: 'root'`, an\n * optional inject still CONSTRUCTS it. Without a default here that construction\n * threw `NG0201: No provider found for WR_I18N_LOADER`, so an app that had\n * simply not configured i18n could not render `<wr-alert>` at all.\n *\n * With the empty catalog, every lookup misses, `t()` hands back the key, and\n * the helpers fall through to the component's own English default — the\n * documented no-i18n behaviour.\n */\nexport const WR_I18N_LOADER = new InjectionToken<WrI18nLoader>('WR_I18N_LOADER', {\n providedIn: 'root',\n factory: () => ({ load: () => of({}) }),\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 { LOCALE_ID, Service, type Signal, computed, effect, inject, isDevMode, signal } from '@angular/core';\n\nimport { type Observable, firstValueFrom } from 'rxjs';\n\nimport { WrStorage } from 'ngwr/storage';\n\nimport { WR_I18N_BASE_CATALOGS } from './i18n-base-catalogs';\nimport { WR_I18N_CONFIG, type WrI18nCatalog, type WrI18nParams, type WrI18nTranslateOptions } from './i18n-config';\nimport { WR_I18N_LOADER } from './i18n-loader';\n\n/** Cache key shape: `<locale>::<scope|''>`. @internal */\nfunction cacheKey(locale: string, scope: string | null): string {\n return `${locale}::${scope ?? ''}`;\n}\n\n/**\n * A locale and the language under it: `'ru-RU'` gives `['ru-RU', 'ru']`.\n *\n * Every lookup and every load walks this, so a catalog registered as `ru`\n * answers an app running `ru-RU`. Without it the two spellings are unrelated\n * strings, and the miss is silent — `t()` returns the key, `useI18nText` reads\n * that as \"missing\" and serves the English fallback, so a fully translated app\n * renders English with nothing logged. It only ever truncates: an `en` lookup\n * never reaches an `en-US` catalog, because a language is not a region.\n *\n * @internal\n */\nfunction localeChain(locale: string): readonly string[] {\n const dash = locale.indexOf('-');\n return dash > 0 ? [locale, locale.slice(0, dash)] : [locale];\n}\n\n/** Walk a dotted path through a catalog tree. Returns string | null. @internal */\nfunction walk(cat: WrI18nCatalog | null, key: string): string | null {\n if (!cat) return null;\n let node: string | WrI18nCatalog | undefined = cat;\n for (const part of key.split('.')) {\n if (node === undefined || typeof node === 'string') return null;\n node = node[part];\n }\n return typeof node === 'string' ? node : null;\n}\n\n/**\n * `{{name}}` interpolation. Missing params resolve to `''`. Exported so\n * helpers in `util.ts` can interpolate the fallback template when no\n * `WrI18n` provider is wired up.\n *\n * @internal\n */\nexport function wrInterpolate(template: string, params: WrI18nParams | undefined): string {\n if (!params) return template;\n return template.replace(/\\{\\{\\s*([\\w.-]+)\\s*\\}\\}/g, (_match, name: string) => {\n const v = params[name];\n if (v === undefined || v === null) return '';\n if (typeof v === 'string') return v;\n if (typeof v === 'number' || typeof v === 'boolean') return String(v);\n try {\n return JSON.stringify(v);\n } catch {\n return '';\n }\n });\n}\n\n/**\n * Reactive i18n service. Holds:\n *\n * - the active locale as a `Signal<string>`\n * - per-`(locale, scope)` catalogs in a `Map` (loaded once, then cached)\n * - a per-locale signal counter so every `translate()` reading the signal\n * re-evaluates the moment a new catalog finishes loading\n *\n * Translations are looked up scope-first then root, per locale, and the locale\n * itself is tried as the full tag before the bare language underneath it — so\n * an app running `ru-RU` resolves against a catalog registered as `ru`, and a\n * regional catalog is never shadowed by a scope in the base language. For an\n * app that spells its locale one way, which is every app that existed before\n * the chain, the order is exactly what it always was.\n *\n * ## Which locale wins\n *\n * ngwr has three locale inputs and they used to be three unrelated answers — an\n * app that set `LOCALE_ID: 'ru-RU'` correctly still rendered an English\n * calendar, because the date token defaulted to `navigator.language`. The\n * precedence is now stated, highest first:\n *\n * 1. **A subsystem's own explicit option.** `withDates({ locale })` pins\n * dates; `provideWrI18n({ defaultLocale })` pins the catalog. The most\n * specific statement wins, because it can only have been deliberate.\n * 2. **`WrI18n.locale()` — the runtime value.** The only one of the three that\n * can change without a reload, so it is what a language switcher writes.\n * With `provideWrI18n()` in the app, dates are written in it.\n * 3. **`LOCALE_ID`.** Angular's app-wide constant, and the seed for both of the\n * above when neither was given. One statement, one answer.\n * 4. `'en-US'`, which is what `LOCALE_ID` itself falls back to.\n *\n * `navigator.language` is deliberately NOT in that list. It is the browser's\n * preference, not the application's, and reading it made prerendered output and\n * the hydrated page disagree.\n *\n * **What a runtime switch reaches, and what it does not.** `use()` repaints\n * every catalog string, and every date: the date adapter, and so\n * `wr-calendar`, `wr-date-picker`, `wrDate` and `wr-date-stamp`, formats in\n * this locale unless `withDates({ locale })` pinned another. It does not move\n * `LOCALE_ID`, which is a constant, so anything keyed on it — `wrNumber` /\n * `wrPlural`, `wr-input-number`, `wr-statistic`, `wr-counter` — stays where it\n * was. `use()` says so once in dev mode rather than leaving it to be\n * discovered.\n *\n * @example\n * ```ts\n * const i18n = inject(WrI18n);\n * i18n.use('ru'); // switch locale\n * i18n.t('cart.checkout'); // → 'Оформить заказ'\n * i18n.t('greeting', { name: 'Ada' }); // → 'Hello, Ada!'\n * i18n.t(`types.${type}`, undefined, { fallback: type }); // → type, when no key\n *\n * effect(() => console.log(i18n.translate('hi')())); // re-runs on locale change\n * ```\n *\n * @see https://ngwr.dev/reference/services/i18n\n */\n@Service()\nexport class WrI18n {\n private readonly config = inject(WR_I18N_CONFIG);\n private readonly loader = inject(WR_I18N_LOADER);\n private readonly storage = inject(WrStorage);\n\n /**\n * Angular's own locale. Read for the dev-mode drift warning only — the\n * resolved default already folded it in through `WR_I18N_CONFIG`. @internal\n */\n private readonly localeId = inject(LOCALE_ID);\n\n /**\n * Catalogs registered via `provideWrI18nBaseCatalogs()` — the floor under the\n * loader's own catalogs, so ngwr's built-in strings survive an app that only\n * ships its own keys. @internal\n */\n private readonly baseCatalogs = inject(WR_I18N_BASE_CATALOGS, { optional: true }) ?? [];\n\n /** Per-(locale,scope) catalogs, populated by `loadCatalog`. @internal */\n private readonly catalogs = new Map<string, WrI18nCatalog>();\n\n /** Bumped after each catalog write so reactive translates recompute. @internal */\n private readonly revision = signal(0);\n\n /** In-flight load promises — dedupes parallel `t()` callers. @internal */\n private readonly inflight = new Map<string, Promise<WrI18nCatalog>>();\n\n /** Registered scopes — auto-loaded whenever the locale changes. @internal */\n private readonly scopes = new Set<string>();\n\n /** Active locale. Writes go through `use()` so storage stays in sync. */\n private readonly _locale = signal<string>(this.initialLocale());\n readonly locale: Signal<string> = this._locale.asReadonly();\n\n constructor() {\n // Eagerly load the root catalog + every registered scope for the\n // current locale. Subsequent locale changes refire the same effect.\n effect(() => {\n const lc = this._locale();\n void this.loadChain(lc, null);\n for (const sc of this.scopes) void this.loadChain(lc, sc);\n });\n }\n\n // Locale\n\n /**\n * Switch active locale. Ignored when not whitelisted.\n *\n * Text and dates — see the class docs for what a runtime switch cannot reach. The\n * dev-mode warning below is the whole reporting of that limit; without it the\n * failure is a screen showing German labels beside `1,234.5`, with nothing\n * anywhere saying why.\n */\n use(locale: string): void {\n if (!this.config.availableLocales.includes(locale)) return;\n const previous = this._locale();\n this._locale.set(locale);\n if (this.config.storageKey) this.storage.set(this.config.storageKey, locale);\n if (isDevMode() && previous !== locale) this.warnOnLocaleIdDrift(locale);\n }\n\n /** Available locales — pass-through from config. */\n available(): readonly string[] {\n return this.config.availableLocales;\n }\n\n // Scopes\n\n /**\n * Register a scope so its catalog loads alongside the root one. Idempotent.\n * Returns a promise resolving once the current locale's scope catalog is in\n * the cache — handy for feature `canActivate` guards.\n */\n registerScope(scope: string): Promise<WrI18nCatalog> {\n this.scopes.add(scope);\n const lc = this._locale();\n // Resolve on the exact tag: the promise is what a `canActivate` waits on,\n // and the base-language catalog is only ever a fallback under it.\n const exact = this.loadCatalog(lc, scope);\n void this.loadChain(lc, scope);\n return exact;\n }\n\n // Translate\n\n /**\n * Eager translate — returns the current value or the missing-handler\n * fallback. Does NOT auto-load missing catalogs; combine with the\n * reactive `translate(...)` if you want load-on-demand.\n *\n * The third argument is a scope, or `{ scope, fallback }`. With a `fallback`\n * a missing key returns it as is, not interpolated, and `missingHandler` is\n * not called: for a key built from a server value that may have no\n * translation.\n */\n t(key: string, params?: WrI18nParams, scopeOrOptions?: string | WrI18nTranslateOptions): string {\n // Read revision so callers inside computed/effect re-run on updates.\n this.revision();\n const lc = this._locale();\n const options = typeof scopeOrOptions === 'string' ? { scope: scopeOrOptions } : scopeOrOptions;\n const scope = options?.scope;\n\n const chain = localeChain(lc);\n let hit: string | null = null;\n for (const candidate of chain) {\n if (scope) hit = walk(this.catalogs.get(cacheKey(candidate, scope)) ?? null, key);\n hit ??= walk(this.catalogs.get(cacheKey(candidate, null)) ?? null, key);\n if (hit !== null) break;\n }\n // Base catalogs are the floor: consulted only once the loader's own catalogs\n // have missed, so an app's keys always win, but ngwr's built-in strings are\n // still there when the app's catalog doesn't carry them.\n hit ??= this.walkBase(chain, key);\n\n if (hit === null) {\n // Fire a background load so a future read can resolve it.\n void this.loadChain(lc, scope ?? null);\n return options?.fallback ?? this.config.missingHandler(key, lc);\n }\n return wrInterpolate(hit, params);\n }\n\n /** Reactive translate — re-evaluates on locale or catalog updates. */\n translate(key: string, params?: WrI18nParams, scopeOrOptions?: string | WrI18nTranslateOptions): Signal<string> {\n return computed(() => this.t(key, params, scopeOrOptions));\n }\n\n // Internals\n\n /**\n * Look a key up in the registered base catalogs, later contributions first so\n * a feature can shadow an earlier one.\n */\n private walkBase(chain: readonly string[], key: string): string | null {\n for (const locale of chain) {\n for (let i = this.baseCatalogs.length - 1; i >= 0; i--) {\n const hit = walk(this.baseCatalogs[i][locale] ?? null, key);\n if (hit !== null) return hit;\n }\n }\n return null;\n }\n\n private initialLocale(): string {\n if (this.config.storageKey) {\n const saved = this.storage.get<string>(this.config.storageKey);\n if (saved && this.config.availableLocales.includes(saved)) return saved;\n }\n return this.config.defaultLocale;\n }\n\n /**\n * Load a `(locale, scope)` catalog and, when the locale carries a region, the\n * bare-language one under it. Both go in the cache; `t()` reads them in that\n * order.\n */\n private loadChain(locale: string, scope: string | null): Promise<unknown> {\n return Promise.all(localeChain(locale).map(candidate => this.loadCatalog(candidate, scope)));\n }\n\n /** One warning per service, not one per switch. @internal */\n private warnedLocaleIdDrift = false;\n\n /**\n * Say once, in dev, that a runtime switch moved the text and nothing else.\n *\n * The mismatch is otherwise invisible in the way that costs the most time:\n * the catalog strings and the dates all change, which reads as \"the switch\n * worked\", and the numbers beside them are still correct-looking output in\n * the old locale. Silent when the new locale IS `LOCALE_ID`, because then nothing is\n * out of step and a warning that fires when everything agrees is one people\n * learn to ignore. Production builds drop the call entirely via `isDevMode()`\n * tree-shaking.\n */\n private warnOnLocaleIdDrift(locale: string): void {\n if (this.warnedLocaleIdDrift || locale === this.localeId) return;\n this.warnedLocaleIdDrift = true;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] WrI18n.use('${locale}') switched the catalog, but LOCALE_ID is still '${this.localeId}'. ` +\n `Dates follow the switch (wrDate, wr-calendar, wr-date-picker), unless withDates({ locale }) pinned ` +\n `them. LOCALE_ID is an Angular constant, so formatted numbers do not and stay on '${this.localeId}': ` +\n `the wrNumber / wrPlural pipes, wr-input-number, wr-statistic, wr-counter, wr-pagination's total ` +\n `and wr-file-upload's sizes. Reload the app with the new LOCALE_ID to move those.`\n );\n }\n\n private loadCatalog(locale: string, scope: string | null): Promise<WrI18nCatalog> {\n const ck = cacheKey(locale, scope);\n const cached = this.catalogs.get(ck);\n if (cached) return Promise.resolve(cached);\n\n const pending = this.inflight.get(ck);\n if (pending) return pending;\n\n const stream: Observable<WrI18nCatalog> = this.loader.load(locale, scope);\n const promise = firstValueFrom(stream)\n .then(catalog => {\n this.catalogs.set(ck, catalog);\n this.revision.update(v => v + 1);\n return catalog;\n })\n .catch((err: unknown) => {\n // eslint-disable-next-line no-console -- intentional diagnostic for missing catalog\n console.warn(`[ngwr/i18n] failed to load (${locale}, ${scope ?? 'root'})`, err);\n const empty: WrI18nCatalog = {};\n this.catalogs.set(ck, empty);\n return empty;\n })\n .finally(() => {\n this.inflight.delete(ck);\n });\n\n this.inflight.set(ck, promise);\n return promise;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe, type PipeTransform, inject } from '@angular/core';\n\nimport { WrI18n } from './i18n';\nimport { type WrI18nParams, type WrI18nTranslateOptions } from './i18n-config';\n\n/**\n * Translate a key. Impure — re-evaluates on every CD so locale switches\n * and catalog loads propagate without a manual refresh.\n *\n * @example\n * ```html\n * <h1>{{ 'home.title' | wrT }}</h1>\n * <p>{{ 'greeting' | wrT: { name: user().name } }}</p>\n * <button>{{ 'forms.save' | wrT: null : 'checkout' }}</button>\n * <span>{{ 'types.' + type | wrT: null : { fallback: type } }}</span>\n * ```\n */\n// eslint-disable-next-line @angular-eslint/no-pipe-impure -- intentional: locale + catalog updates must propagate even when args are stable\n@Pipe({ name: 'wrT', pure: false })\nexport class WrTPipe implements PipeTransform {\n private readonly i18n = inject(WrI18n);\n\n transform(key: string, params?: WrI18nParams | null, scopeOrOptions?: string | WrI18nTranslateOptions): string {\n return this.i18n.t(key, params ?? undefined, scopeOrOptions);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, ElementRef, computed, effect, inject, input } from '@angular/core';\n\nimport { WrI18n } from './i18n';\nimport { type WrI18nParams } from './i18n-config';\n\n/**\n * Attribute directive that sets `textContent` of its host to the translation\n * of the bound key. Reactive — re-renders on locale + catalog changes.\n *\n * @example\n * ```html\n * <span [wrT]=\"'home.title'\"></span>\n * <span [wrT]=\"'greeting'\" [wrTParams]=\"{ name: user().name }\"></span>\n * <span [wrT]=\"'forms.save'\" wrTScope=\"checkout\"></span>\n * <span [wrT]=\"'types.' + type\" [wrTFallback]=\"type\"></span>\n * ```\n */\n@Directive({\n selector: '[wrT]',\n})\nexport class WrTDirective {\n /** Translation key. Required. */\n readonly wrT = input.required<string>();\n\n /** Interpolation params for `{{name}}` tokens. */\n readonly wrTParams = input<WrI18nParams | null>(null);\n\n /** Optional scope — scoped lookup first, then root fallback. */\n readonly wrTScope = input<string | null>(null);\n\n /** Text shown as is when the key is missing; `missingHandler` is not called. */\n readonly wrTFallback = input<string | null>(null);\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly i18n = inject(WrI18n);\n\n private readonly text = computed(() =>\n this.i18n.t(this.wrT(), this.wrTParams() ?? undefined, {\n scope: this.wrTScope() ?? undefined,\n fallback: this.wrTFallback(),\n })\n );\n\n constructor() {\n effect(() => {\n this.host.nativeElement.textContent = this.text();\n });\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Observable, of } from 'rxjs';\n\nimport { type WrI18nCatalog } from '../i18n-config';\nimport { type WrI18nLoader } from '../i18n-loader';\n\n/** Root catalogs keyed by locale: `{ en: catalog, ru: catalog, … }`. */\nexport type WrI18nStaticCatalogs = Readonly<Record<string, WrI18nCatalog>>;\n\n/** Per-scope catalogs: `{ checkout: { en: catalog, ru: catalog }, … }`. */\nexport type WrI18nStaticScopedCatalogs = Readonly<Record<string, WrI18nStaticCatalogs>>;\n\n/**\n * Loader for catalogs already in memory (imported from JSON or generated).\n *\n * - Pass `catalogs` for the root catalog of every locale.\n * - Pass `scopes` if you ship per-feature catalogs the loader should serve\n * to `WrI18n.registerScope(name)` calls.\n *\n * Missing locale or scope resolves to `{}` — the missing-key handler then\n * decides what to render.\n */\nexport class WrI18nStaticLoader implements WrI18nLoader {\n constructor(\n private readonly catalogs: WrI18nStaticCatalogs,\n private readonly scopes: WrI18nStaticScopedCatalogs = {}\n ) {}\n\n load(locale: string, scope: string | null): Observable<WrI18nCatalog> {\n if (scope === null) return of(this.catalogs[locale] ?? {});\n return of(this.scopes[scope]?.[locale] ?? {});\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { HttpClient } from '@angular/common/http';\nimport { inject } from '@angular/core';\n\nimport { type Observable, catchError, of } from 'rxjs';\n\nimport { type WrI18nCatalog } from '../i18n-config';\nimport { type WrI18nLoader } from '../i18n-loader';\n\n/** Configuration for {@link WrI18nHttpLoader}. */\nexport interface WrI18nHttpLoaderConfig {\n /**\n * URL template. Tokens:\n * - `{locale}` — required, BCP-47 tag (e.g. `en`).\n * - `{scope}` — optional, scope name. Use the `rootPath` if you need a\n * different path entirely for the root catalog.\n *\n * @example\n * ```ts\n * { path: '/assets/i18n/{locale}.json' } // root only\n * { path: '/assets/i18n/{scope}/{locale}.json',\n * rootPath: '/assets/i18n/{locale}.json' } // root + scopes\n * ```\n */\n readonly path: string;\n /** Path template for the root catalog. Defaults to `path`. */\n readonly rootPath?: string;\n}\n\n/**\n * Loader that fetches catalogs via `HttpClient`. Failures resolve to `{}`\n * (logged once at the service layer) so a missing file never throws into\n * user code.\n */\nexport class WrI18nHttpLoader implements WrI18nLoader {\n private readonly http = inject(HttpClient);\n\n constructor(private readonly config: WrI18nHttpLoaderConfig) {}\n\n load(locale: string, scope: string | null): Observable<WrI18nCatalog> {\n const template = scope === null ? (this.config.rootPath ?? this.config.path) : this.config.path;\n const url = template.replace('{locale}', locale).replace('{scope}', scope ?? '');\n return this.http.get<WrI18nCatalog>(url).pipe(catchError(() => of<WrI18nCatalog>({})));\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ApplicationRef,\n EnvironmentInjector,\n type EnvironmentProviders,\n type Provider,\n inject,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n} from '@angular/core';\n\nimport { WR_LIVE_LOCALE } from 'ngwr/utils';\n\nimport { WrI18n } from './i18n';\nimport { WR_I18N_BASE_CATALOGS, type WrI18nBaseCatalogs } from './i18n-base-catalogs';\nimport {\n DEFAULT_WR_I18N_CONFIG,\n WR_I18N_CONFIG,\n type WrI18nConfig,\n type WrI18nConfigResolved,\n resolveWrI18nLocales,\n} from './i18n-config';\nimport { WR_I18N_LOADER, type WrI18nLoader } from './i18n-loader';\nimport { WrI18nHttpLoader, type WrI18nHttpLoaderConfig } from './loaders/http-loader';\nimport {\n WrI18nStaticLoader,\n type WrI18nStaticCatalogs,\n type WrI18nStaticScopedCatalogs,\n} from './loaders/static-loader';\n\n/**\n * Configure {@link WrI18n}. Either pass a `loader` directly, or use the\n * `provideWrI18nHttpLoader` / `provideWrI18nStaticLoader` helpers in the\n * same providers array.\n */\nexport interface ProvideWrI18nOptions extends WrI18nConfig {\n readonly loader?: WrI18nLoader;\n}\n\n/**\n * Configure {@link WrI18n} for the application.\n *\n * Call it in the application's root providers (`bootstrapApplication` or\n * `ApplicationConfig`), together with {@link provideWrI18nBaseCatalogs} and the\n * loader. `WrI18n` is a root service: a route's `providers` or a lazy module\n * never reach it, so a locale or catalogs given there do nothing, and dev mode\n * warns. A lazy area switches the language at runtime with\n * `inject(WrI18n).use('de')`, for example in its resolver. The switch is\n * app-wide, and the locale must be in the root `availableLocales`. The area's\n * own keys load with `registerScope()`.\n */\nexport function provideWrI18n(options: ProvideWrI18nOptions = {}): EnvironmentProviders {\n const { loader, ...config } = options;\n\n const providers: (Provider | EnvironmentProviders)[] = [\n {\n provide: WR_I18N_CONFIG,\n // A factory rather than a value: `defaultLocale` falls back to `LOCALE_ID`,\n // which only an injection context can read.\n useFactory: (): WrI18nConfigResolved => ({\n ...DEFAULT_WR_I18N_CONFIG,\n ...config,\n ...resolveWrI18nLocales(config),\n }),\n },\n ];\n if (loader) providers.push({ provide: WR_I18N_LOADER, useValue: loader });\n // What `ngwr/date` formats in, so dates follow `use()` without importing this entry point.\n providers.push({ provide: WR_LIVE_LOCALE, useFactory: () => inject(WrI18n).locale });\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n providers.push(\n provideEnvironmentInitializer(() => {\n const here = inject(EnvironmentInjector);\n if (here === inject(ApplicationRef, { optional: true })?.injector) return;\n // An injector that lists WrI18n itself owns an instance that does read this config.\n if (here.get(WrI18n, null, { self: true })) return;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n '[NGWR] provideWrI18n() is in a route or child injector. WrI18n is a root service, so this ' +\n \"configuration is ignored. Move provideWrI18n() and the catalogs to the application's root \" +\n 'providers, and switch a lazy area with inject(WrI18n).use(locale).'\n );\n })\n );\n }\n\n return makeEnvironmentProviders(providers);\n}\n\n/**\n * Provide a static loader — catalogs already in memory.\n *\n * A loader serves only the catalog you pass it, and ngwr registers none of its\n * own. Pass only your own keys here and register ngwr's catalogs with\n * {@link provideWrI18nBaseCatalogs} — not `{ ...wrRu, ...yours }`. A spread is\n * shallow, so any namespace you share with ngwr, e.g. `common`, `form`,\n * `table`, keeps only the keys of the side spread last, and the other side's\n * keys stop resolving with nothing logged: ngwr's components fall back to their\n * English defaults, and a `wrT` read of a lost key renders the raw key under the\n * default missing handler.\n *\n * @param catalogs Root catalogs keyed by locale.\n * @param scopes Optional per-scope catalogs served to `registerScope(name)`.\n */\nexport function provideWrI18nStaticLoader(\n catalogs: WrI18nStaticCatalogs,\n scopes?: WrI18nStaticScopedCatalogs\n): Provider {\n return { provide: WR_I18N_LOADER, useValue: new WrI18nStaticLoader(catalogs, scopes) };\n}\n\n/**\n * Register catalogs consulted *underneath* the loader — this is how ngwr's own\n * built-in strings survive when you supply your own catalogs.\n *\n * A loader replaces the catalog for a locale instead of extending it, so a JSON\n * file holding only your keys leaves every built-in label on its hardcoded\n * English fallback, with nothing logged. One line fixes it, on either loader:\n *\n * @example\n * ```ts\n * import { wrRu } from 'ngwr/i18n/ru';\n *\n * providers: [\n * provideWrI18n({ defaultLocale: 'ru', availableLocales: ['ru'] }),\n * provideWrI18nBaseCatalogs({ ru: wrRu }),\n * provideWrI18nHttpLoader({ path: '/assets/i18n/{locale}.json' }),\n * ]\n * ```\n *\n * Pass only the locales you ship — the ones you leave out stay out of the\n * bundle. Your own keys always win; this is a floor, not an override.\n *\n * Use it instead of spreading `wrRu` into your own catalog, too: the lookup\n * walks these key by key after the loader's catalog misses, so a namespace both\n * define keeps both halves, where a shallow spread keeps only one.\n */\nexport function provideWrI18nBaseCatalogs(catalogs: WrI18nBaseCatalogs): Provider {\n return { provide: WR_I18N_BASE_CATALOGS, useValue: catalogs, multi: true };\n}\n\n/** Provide an HTTP loader — catalogs fetched from URLs. Requires `provideHttpClient`. */\nexport function provideWrI18nHttpLoader(config: WrI18nHttpLoaderConfig): Provider {\n return { provide: WR_I18N_LOADER, useFactory: () => new WrI18nHttpLoader(config) };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Signal, computed, inject, signal } from '@angular/core';\n\nimport { WrI18n, wrInterpolate } from './i18n';\nimport type { WrI18nParams } from './i18n-config';\n\n/**\n * Helper for component default text. Returns a reactive string that:\n *\n * 1. Prefers the consumer's override (an `input<string | null>()` value).\n * 2. Falls back to the i18n catalog under `key` — re-renders on locale\n * change so a switcher updates the DOM live.\n * 3. Falls back to `fallback` when no `WrI18n` is provided OR the catalog\n * is missing the key.\n *\n * Components don't need a hard dependency on `provideWrI18n` — without it,\n * the fallback is returned and everything still works.\n *\n * @example\n * ```ts\n * readonly emptyText = input<string | null>(null);\n * protected readonly empty = useI18nText(this.emptyText, 'table.empty', 'No data');\n *\n * // In template: <div>{{ empty() }}</div>\n * ```\n */\nexport function useI18nText(binding: Signal<string | null | undefined>, key: string, fallback: string): Signal<string> {\n const i18n = inject(WrI18n, { optional: true });\n if (!i18n) {\n return computed(() => {\n const v = binding();\n return v ?? fallback;\n });\n }\n\n return computed(() => {\n const v = binding();\n if (v !== null && v !== undefined && v !== '') return v;\n const translated = i18n.t(key);\n // Default missing handler returns the key itself — treat that as \"missing\"\n // and use our explicit fallback.\n return translated === key ? fallback : translated;\n });\n}\n\n/**\n * {@link useI18nText} without a binding to forward — for a built-in string the\n * component exposes no override input for. Same reactivity, same fallback\n * rules; the only difference is the missing first argument.\n *\n * It used to return a plain `string`, resolved once at injection time, and\n * that was wrong in the ordinary case rather than an edge one: `WrI18n` writes\n * every loader-backed catalog from `firstValueFrom(...).then(...)`, so even a\n * static loader serving an object literal lands a microtask AFTER the first\n * change-detection pass. Every component built in that pass read an empty\n * catalog and froze its English fallback for the life of the app — in one\n * `<wr-date-picker>` the field said \"Открыть календарь\" and the calendar\n * button beside it \"Open calendar\", off the same key.\n */\nexport function wrReadI18nText(key: string, fallback: string): Signal<string> {\n const i18n = inject(WrI18n, { optional: true });\n if (!i18n) return computed(() => fallback);\n\n return computed(() => {\n const v = i18n.t(key);\n return v === key ? fallback : v;\n });\n}\n\n/** Tiny shim — useful when the caller doesn't have an `input` to forward. */\nexport function nullSignal(): Signal<null> {\n return signal(null).asReadonly();\n}\n\n/**\n * Build a per-call formatter for parametrized labels (e.g. ARIA labels\n * that interpolate a per-row value: `\"Remove {{label}}\"`). Returns a\n * function the template calls with the params for the current item.\n *\n * The returned function:\n * - Re-resolves the i18n catalog on every call (live locale switches just\n * work — re-rendered templates pick up new strings).\n * - Falls back to the literal `fallback` template with the same\n * `{{name}}` syntax when no `WrI18n` provider is present, or when the\n * key is missing.\n *\n * Use this for labels that vary per row. For static labels, prefer\n * {@link useI18nText} or {@link wrReadI18nText}.\n *\n * @example\n * ```ts\n * protected readonly removeChipLabel = useI18nFormatter('select.removeItem', 'Remove {{label}}');\n *\n * // In template:\n * // [attr.aria-label]=\"removeChipLabel({ label: chip.label })\"\n * ```\n */\nexport function useI18nFormatter(key: string, fallback: string): (params?: WrI18nParams) => string {\n const i18n = inject(WrI18n, { optional: true });\n if (!i18n) {\n return (params?: WrI18nParams) => wrInterpolate(fallback, params);\n }\n return (params?: WrI18nParams) => {\n const v = i18n.t(key, params);\n return v === key ? wrInterpolate(fallback, params) : v;\n };\n}\n"],"mappings":";;;;;;;;;;;;AAgCA,MAAa,wBAAwB,IAAI,eAA8C,uBAAuB;;;;;;;ACiD9G,MAAa,yBAA2F;CACtG,YAAY;CACZ,iBAAgB,QAAO;AACxB;AAMD,SAAgB,qBACd,QAAoB;CAEpB,MAAM,gBAAgB,OAAO,iBAAiB,OAAO,SAAS;CAC9D,OAAO;EAAE;EAAe,kBAAkB,OAAO,oBAAoB,CAAC,aAAa;CAAC;AACtF;AAEA,MAAa,iBAAiB,IAAI,eAAqC,kBAAkB,EACvF,gBAAgB;CAAE,GAAG;CAAwB,GAAG,qBAAqB,CAAA,CAAE;AAAC,GACzE,CAAA;;;;;;;AC7DD,MAAa,iBAAiB,IAAI,eAA6B,kBAAkB;CAC/E,YAAY;CACZ,gBAAgB,EAAE,YAAY,GAAG,CAAA,CAAE,EAAC;AACrC,CAAA;;;;;;;ACvBD,SAAS,SAAS,QAAgB,OAAoB;CACpD,OAAO,GAAG,OAAM,IAAK,SAAS;AAChC;AAcA,SAAS,YAAY,QAAc;CACjC,MAAM,OAAO,OAAO,QAAQ,GAAG;CAC/B,OAAO,OAAO,IAAI,CAAC,QAAQ,OAAO,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM;AAC7D;AAGA,SAAS,KAAK,KAA2B,KAAW;CAClD,IAAI,CAAC,KAAK,OAAO;CACjB,IAAI,OAA2C;CAC/C,KAAK,MAAM,QAAQ,IAAI,MAAM,GAAG,GAAG;EACjC,IAAI,SAAS,UAAa,OAAO,SAAS,UAAU,OAAO;EAC3D,OAAO,KAAK;CACd;CACA,OAAO,OAAO,SAAS,WAAW,OAAO;AAC3C;AASA,SAAgB,cAAc,UAAkB,QA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AAM,MAAM,cAAc,UAAU,MAAM,IAAI;CACvD;AACF"}
|
|
1
|
+
{"version":3,"file":"ngwr-i18n.mjs","names":[],"sources":["../../../projects/lib/i18n/i18n-base-catalogs.ts","../../../projects/lib/i18n/i18n-config.ts","../../../projects/lib/i18n/i18n-loader.ts","../../../projects/lib/i18n/i18n.ts","../../../projects/lib/i18n/t.pipe.ts","../../../projects/lib/i18n/t.directive.ts","../../../projects/lib/i18n/loaders/static-loader.ts","../../../projects/lib/i18n/loaders/http-loader.ts","../../../projects/lib/i18n/provide-wr-i18n.ts","../../../projects/lib/i18n/util.ts","../../../projects/lib/i18n/http-error.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 { InjectionToken } from '@angular/core';\n\nimport { type WrI18nCatalog } from './i18n-config';\n\n/** Base catalogs keyed by locale, contributed by {@link provideWrI18nBaseCatalogs}. */\nexport type WrI18nBaseCatalogs = Readonly<Record<string, WrI18nCatalog>>;\n\n/**\n * Catalogs consulted *underneath* whatever the loader returned — the place for\n * ngwr's own built-in strings.\n *\n * A loader **replaces** the catalog for a locale rather than extending it, so an\n * app whose JSON holds only its own keys used to lose every built-in label to\n * its hardcoded English fallback, silently. Registering `wrRu` / `wrEn` here\n * puts them back without the app having to merge anything itself.\n *\n * `multi`, so several features can each contribute; later contributions win on\n * a key collision, and anything the loader returned still wins over all of them.\n *\n * It has to be handed in by the consumer rather than wired up inside\n * `provideWrI18n()`: the catalogs are their own entry points (`ngwr/i18n/ru`)\n * and they already import from `ngwr/i18n`, so importing them back here would\n * be a circular dependency between entry points. Passing them in also keeps\n * the locales you don't ship out of your bundle.\n */\nexport const WR_I18N_BASE_CATALOGS = new InjectionToken<readonly WrI18nBaseCatalogs[]>('WR_I18N_BASE_CATALOGS');\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 { InjectionToken, LOCALE_ID, inject } from '@angular/core';\n\n/** Translation catalog — flat or nested record of strings. */\nexport interface WrI18nCatalog {\n readonly [key: string]: string | WrI18nCatalog;\n}\n\n/** Parameters passed to interpolation — coerced to strings via `String(v)`. */\nexport type WrI18nParams = Readonly<Record<string, unknown>>;\n\n/**\n * The third argument of `WrI18n.t()`, `WrI18n.translate()` and the `wrT` pipe,\n * where a bare string is the scope.\n */\nexport interface WrI18nTranslateOptions {\n /** Scoped lookup first, then the root catalog. */\n readonly scope?: string;\n\n /**\n * Returned as is when the key is missing: no interpolation, no\n * `missingHandler` call. `null` and `undefined` mean no fallback.\n */\n readonly fallback?: string | null;\n}\n\n/** Hook called once on every key that resolves to nothing. */\nexport type WrI18nMissingHandler = (key: string, locale: string) => string;\n\n/** User-facing config for {@link provideWrI18n}. */\nexport interface WrI18nConfig {\n /**\n * BCP-47 tag used until the user calls `use()`.\n *\n * Omitted, it is Angular's own `LOCALE_ID` — the app already states its\n * locale there, and ngwr having a second, unrelated default is how a fully\n * Russian app came to render an English calendar inside itself. See\n * {@link WrI18n} for the whole precedence.\n *\n * @default LOCALE_ID\n */\n readonly defaultLocale?: string;\n\n /**\n * Whitelisted locales — `use()` ignores anything outside this list. Omitted,\n * it is `[defaultLocale]`: it used to be a hardcoded `['en']`, so\n * `provideWrI18n({ defaultLocale: 'ru' })` produced a service whose own\n * default locale was not switchable back to.\n *\n * @default [defaultLocale]\n */\n readonly availableLocales?: readonly string[];\n\n /**\n * Storage key for persisting the active locale (via `WrStorage`).\n * Set to `null` to disable persistence. @default 'wr:i18n:locale'\n */\n readonly storageKey?: string | null;\n\n /** Called when a key is missing. Default returns the key itself. */\n readonly missingHandler?: WrI18nMissingHandler;\n}\n\n/** Resolved config — every field non-optional. @internal */\nexport interface WrI18nConfigResolved {\n readonly defaultLocale: string;\n readonly availableLocales: readonly string[];\n readonly storageKey: string | null;\n readonly missingHandler: WrI18nMissingHandler;\n}\n\n/**\n * Everything but the locale, which cannot be a constant: it is resolved from\n * `LOCALE_ID` in an injection context. @internal\n */\nexport const DEFAULT_WR_I18N_CONFIG: Omit<WrI18nConfigResolved, 'defaultLocale' | 'availableLocales'> = {\n storageKey: 'wr:i18n:locale',\n missingHandler: key => key,\n};\n\n/**\n * Resolve the locale half of the config. Callable only from an injection\n * context, because the seed is `LOCALE_ID`. @internal\n */\nexport function resolveWrI18nLocales(\n config: WrI18nConfig\n): Pick<WrI18nConfigResolved, 'defaultLocale' | 'availableLocales'> {\n const defaultLocale = config.defaultLocale ?? inject(LOCALE_ID);\n return { defaultLocale, availableLocales: config.availableLocales ?? [defaultLocale] };\n}\n\nexport const WR_I18N_CONFIG = new InjectionToken<WrI18nConfigResolved>('WR_I18N_CONFIG', {\n factory: () => ({ ...DEFAULT_WR_I18N_CONFIG, ...resolveWrI18nLocales({}) }),\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 { InjectionToken } from '@angular/core';\n\nimport { of, type Observable } from 'rxjs';\n\nimport { type WrI18nCatalog } from './i18n-config';\n\n/**\n * Loads a catalog for a `(locale, scope)` pair. `scope` is `null` for the\n * root catalog. Implementations may return the catalog synchronously\n * (via `of(...)`) for static catalogs or asynchronously (via HTTP) for\n * lazy fetches.\n */\nexport interface WrI18nLoader {\n load(locale: string, scope: string | null): Observable<WrI18nCatalog>;\n}\n\n/**\n * The active loader.\n *\n * Defaults to one that serves an empty catalog, which is what makes\n * `provideWrI18n()` genuinely optional: every ngwr component routes its\n * built-in strings through `useI18nText` / `wrReadI18nText`, those inject\n * `WrI18n` optionally — and because `WrI18n` is `providedIn: 'root'`, an\n * optional inject still CONSTRUCTS it. Without a default here that construction\n * threw `NG0201: No provider found for WR_I18N_LOADER`, so an app that had\n * simply not configured i18n could not render `<wr-alert>` at all.\n *\n * With the empty catalog, every lookup misses, `t()` hands back the key, and\n * the helpers fall through to the component's own English default — the\n * documented no-i18n behaviour.\n */\nexport const WR_I18N_LOADER = new InjectionToken<WrI18nLoader>('WR_I18N_LOADER', {\n providedIn: 'root',\n factory: () => ({ load: () => of({}) }),\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 { LOCALE_ID, Service, type Signal, computed, effect, inject, isDevMode, signal } from '@angular/core';\n\nimport { type Observable, firstValueFrom } from 'rxjs';\n\nimport { WrStorage } from 'ngwr/storage';\n\nimport { WR_I18N_BASE_CATALOGS } from './i18n-base-catalogs';\nimport { WR_I18N_CONFIG, type WrI18nCatalog, type WrI18nParams, type WrI18nTranslateOptions } from './i18n-config';\nimport { WR_I18N_LOADER } from './i18n-loader';\n\n/** Cache key shape: `<locale>::<scope|''>`. @internal */\nfunction cacheKey(locale: string, scope: string | null): string {\n return `${locale}::${scope ?? ''}`;\n}\n\n/**\n * A locale and the language under it: `'ru-RU'` gives `['ru-RU', 'ru']`.\n *\n * Every lookup and every load walks this, so a catalog registered as `ru`\n * answers an app running `ru-RU`. Without it the two spellings are unrelated\n * strings, and the miss is silent — `t()` returns the key, `useI18nText` reads\n * that as \"missing\" and serves the English fallback, so a fully translated app\n * renders English with nothing logged. It only ever truncates: an `en` lookup\n * never reaches an `en-US` catalog, because a language is not a region.\n *\n * @internal\n */\nfunction localeChain(locale: string): readonly string[] {\n const dash = locale.indexOf('-');\n return dash > 0 ? [locale, locale.slice(0, dash)] : [locale];\n}\n\n/** Walk a dotted path through a catalog tree. Returns string | null. @internal */\nfunction walk(cat: WrI18nCatalog | null, key: string): string | null {\n if (!cat) return null;\n let node: string | WrI18nCatalog | undefined = cat;\n for (const part of key.split('.')) {\n if (node === undefined || typeof node === 'string') return null;\n node = node[part];\n }\n return typeof node === 'string' ? node : null;\n}\n\n/**\n * `{{name}}` interpolation. Missing params resolve to `''`. Exported so\n * helpers in `util.ts` can interpolate the fallback template when no\n * `WrI18n` provider is wired up.\n *\n * @internal\n */\nexport function wrInterpolate(template: string, params: WrI18nParams | undefined): string {\n if (!params) return template;\n return template.replace(/\\{\\{\\s*([\\w.-]+)\\s*\\}\\}/g, (_match, name: string) => {\n const v = params[name];\n if (v === undefined || v === null) return '';\n if (typeof v === 'string') return v;\n if (typeof v === 'number' || typeof v === 'boolean') return String(v);\n try {\n return JSON.stringify(v);\n } catch {\n return '';\n }\n });\n}\n\n/**\n * Reactive i18n service. Holds:\n *\n * - the active locale as a `Signal<string>`\n * - per-`(locale, scope)` catalogs in a `Map` (loaded once, then cached)\n * - a per-locale signal counter so every `translate()` reading the signal\n * re-evaluates the moment a new catalog finishes loading\n *\n * Translations are looked up scope-first then root, per locale, and the locale\n * itself is tried as the full tag before the bare language underneath it — so\n * an app running `ru-RU` resolves against a catalog registered as `ru`, and a\n * regional catalog is never shadowed by a scope in the base language. For an\n * app that spells its locale one way, which is every app that existed before\n * the chain, the order is exactly what it always was.\n *\n * ## Which locale wins\n *\n * ngwr has three locale inputs and they used to be three unrelated answers — an\n * app that set `LOCALE_ID: 'ru-RU'` correctly still rendered an English\n * calendar, because the date token defaulted to `navigator.language`. The\n * precedence is now stated, highest first:\n *\n * 1. **A subsystem's own explicit option.** `withDates({ locale })` pins\n * dates; `provideWrI18n({ defaultLocale })` pins the catalog. The most\n * specific statement wins, because it can only have been deliberate.\n * 2. **`WrI18n.locale()` — the runtime value.** The only one of the three that\n * can change without a reload, so it is what a language switcher writes.\n * With `provideWrI18n()` in the app, dates are written in it.\n * 3. **`LOCALE_ID`.** Angular's app-wide constant, and the seed for both of the\n * above when neither was given. One statement, one answer.\n * 4. `'en-US'`, which is what `LOCALE_ID` itself falls back to.\n *\n * `navigator.language` is deliberately NOT in that list. It is the browser's\n * preference, not the application's, and reading it made prerendered output and\n * the hydrated page disagree.\n *\n * **What a runtime switch reaches, and what it does not.** `use()` repaints\n * every catalog string, and every date: the date adapter, and so\n * `wr-calendar`, `wr-date-picker`, `wrDate` and `wr-date-stamp`, formats in\n * this locale unless `withDates({ locale })` pinned another. It does not move\n * `LOCALE_ID`, which is a constant, so anything keyed on it — `wrNumber` /\n * `wrPlural`, `wr-input-number`, `wr-statistic`, `wr-counter` — stays where it\n * was. `use()` says so once in dev mode rather than leaving it to be\n * discovered.\n *\n * @example\n * ```ts\n * const i18n = inject(WrI18n);\n * i18n.use('ru'); // switch locale\n * i18n.t('cart.checkout'); // → 'Оформить заказ'\n * i18n.t('greeting', { name: 'Ada' }); // → 'Hello, Ada!'\n * i18n.t(`types.${type}`, undefined, { fallback: type }); // → type, when no key\n *\n * effect(() => console.log(i18n.translate('hi')())); // re-runs on locale change\n * ```\n *\n * @see https://ngwr.dev/reference/services/i18n\n */\n@Service()\nexport class WrI18n {\n private readonly config = inject(WR_I18N_CONFIG);\n private readonly loader = inject(WR_I18N_LOADER);\n private readonly storage = inject(WrStorage);\n\n /**\n * Angular's own locale. Read for the dev-mode drift warning only — the\n * resolved default already folded it in through `WR_I18N_CONFIG`. @internal\n */\n private readonly localeId = inject(LOCALE_ID);\n\n /**\n * Catalogs registered via `provideWrI18nBaseCatalogs()` — the floor under the\n * loader's own catalogs, so ngwr's built-in strings survive an app that only\n * ships its own keys. @internal\n */\n private readonly baseCatalogs = inject(WR_I18N_BASE_CATALOGS, { optional: true }) ?? [];\n\n /** Per-(locale,scope) catalogs, populated by `loadCatalog`. @internal */\n private readonly catalogs = new Map<string, WrI18nCatalog>();\n\n /** Bumped after each catalog write so reactive translates recompute. @internal */\n private readonly revision = signal(0);\n\n /** In-flight load promises — dedupes parallel `t()` callers. @internal */\n private readonly inflight = new Map<string, Promise<WrI18nCatalog>>();\n\n /** Keys whose last load failed: `t()` does not retry them, `use()` and `registerScope()` do. @internal */\n private readonly failed = new Set<string>();\n\n /** Registered scopes — auto-loaded whenever the locale changes. @internal */\n private readonly scopes = new Set<string>();\n\n /** Active locale. Writes go through `use()` so storage stays in sync. */\n private readonly _locale = signal<string>(this.initialLocale());\n readonly locale: Signal<string> = this._locale.asReadonly();\n\n constructor() {\n // Eagerly load the root catalog + every registered scope for the\n // current locale. Subsequent locale changes refire the same effect.\n effect(() => {\n const lc = this._locale();\n void this.loadChain(lc, null);\n for (const sc of this.scopes) void this.loadChain(lc, sc);\n });\n }\n\n // Locale\n\n /**\n * Switch active locale. Ignored when not whitelisted.\n *\n * Text and dates — see the class docs for what a runtime switch cannot reach. The\n * dev-mode warning below is the whole reporting of that limit; without it the\n * failure is a screen showing German labels beside `1,234.5`, with nothing\n * anywhere saying why.\n */\n use(locale: string): void {\n if (!this.config.availableLocales.includes(locale)) return;\n const previous = this._locale();\n this._locale.set(locale);\n if (this.config.storageKey) this.storage.set(this.config.storageKey, locale);\n void this.loadChain(locale, null);\n for (const sc of this.scopes) void this.loadChain(locale, sc);\n if (isDevMode() && previous !== locale) this.warnOnLocaleIdDrift(locale);\n }\n\n /** Available locales — pass-through from config. */\n available(): readonly string[] {\n return this.config.availableLocales;\n }\n\n // Scopes\n\n /**\n * Register a scope so its catalog loads alongside the root one. Idempotent.\n * Returns a promise resolving once the current locale's scope catalog is in\n * the cache — handy for feature `canActivate` guards.\n */\n registerScope(scope: string): Promise<WrI18nCatalog> {\n this.scopes.add(scope);\n const lc = this._locale();\n // Resolve on the exact tag: the promise is what a `canActivate` waits on,\n // and the base-language catalog is only ever a fallback under it.\n const exact = this.loadCatalog(lc, scope);\n void this.loadChain(lc, scope);\n return exact;\n }\n\n // Translate\n\n /**\n * Eager translate — returns the current value or the missing-handler\n * fallback. Does NOT auto-load missing catalogs; combine with the\n * reactive `translate(...)` if you want load-on-demand.\n *\n * The third argument is a scope, or `{ scope, fallback }`. With a `fallback`\n * a missing key returns it as is, not interpolated, and `missingHandler` is\n * not called: for a key built from a server value that may have no\n * translation.\n */\n t(key: string, params?: WrI18nParams, scopeOrOptions?: string | WrI18nTranslateOptions): string {\n // Read revision so callers inside computed/effect re-run on updates.\n this.revision();\n const lc = this._locale();\n const options = typeof scopeOrOptions === 'string' ? { scope: scopeOrOptions } : scopeOrOptions;\n const scope = options?.scope;\n\n const chain = localeChain(lc);\n let hit: string | null = null;\n for (const candidate of chain) {\n if (scope) hit = walk(this.catalogs.get(cacheKey(candidate, scope)) ?? null, key);\n hit ??= walk(this.catalogs.get(cacheKey(candidate, null)) ?? null, key);\n if (hit !== null) break;\n }\n // Base catalogs are the floor: consulted only once the loader's own catalogs\n // have missed, so an app's keys always win, but ngwr's built-in strings are\n // still there when the app's catalog doesn't carry them.\n hit ??= this.walkBase(chain, key);\n\n if (hit === null) {\n // Fire a background load so a future read can resolve it.\n void this.loadChain(lc, scope ?? null, true);\n return options?.fallback ?? this.config.missingHandler(key, lc);\n }\n return wrInterpolate(hit, params);\n }\n\n /** Reactive translate — re-evaluates on locale or catalog updates. */\n translate(key: string, params?: WrI18nParams, scopeOrOptions?: string | WrI18nTranslateOptions): Signal<string> {\n return computed(() => this.t(key, params, scopeOrOptions));\n }\n\n // Internals\n\n /**\n * Look a key up in the registered base catalogs, later contributions first so\n * a feature can shadow an earlier one.\n */\n private walkBase(chain: readonly string[], key: string): string | null {\n for (const locale of chain) {\n for (let i = this.baseCatalogs.length - 1; i >= 0; i--) {\n const hit = walk(this.baseCatalogs[i][locale] ?? null, key);\n if (hit !== null) return hit;\n }\n }\n return null;\n }\n\n private initialLocale(): string {\n if (this.config.storageKey) {\n const saved = this.storage.get<string>(this.config.storageKey);\n if (saved && this.config.availableLocales.includes(saved)) return saved;\n }\n return this.config.defaultLocale;\n }\n\n /**\n * Load a `(locale, scope)` catalog and, when the locale carries a region, the\n * bare-language one under it. Both go in the cache; `t()` reads them in that\n * order.\n */\n private loadChain(locale: string, scope: string | null, auto = false): Promise<unknown> {\n return Promise.all(localeChain(locale).map(candidate => this.loadCatalog(candidate, scope, auto)));\n }\n\n /** One warning per service, not one per switch. @internal */\n private warnedLocaleIdDrift = false;\n\n /**\n * Say once, in dev, that a runtime switch moved the text and nothing else.\n *\n * The mismatch is otherwise invisible in the way that costs the most time:\n * the catalog strings and the dates all change, which reads as \"the switch\n * worked\", and the numbers beside them are still correct-looking output in\n * the old locale. Silent when the new locale IS `LOCALE_ID`, because then nothing is\n * out of step and a warning that fires when everything agrees is one people\n * learn to ignore. Production builds drop the call entirely via `isDevMode()`\n * tree-shaking.\n */\n private warnOnLocaleIdDrift(locale: string): void {\n if (this.warnedLocaleIdDrift || locale === this.localeId) return;\n this.warnedLocaleIdDrift = true;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n `[NGWR] WrI18n.use('${locale}') switched the catalog, but LOCALE_ID is still '${this.localeId}'. ` +\n `Dates follow the switch (wrDate, wr-calendar, wr-date-picker), unless withDates({ locale }) pinned ` +\n `them. LOCALE_ID is an Angular constant, so formatted numbers do not and stay on '${this.localeId}': ` +\n `the wrNumber / wrPlural pipes, wr-input-number, wr-statistic, wr-counter, wr-pagination's total ` +\n `and wr-file-upload's sizes. Reload the app with the new LOCALE_ID to move those.`\n );\n }\n\n private loadCatalog(locale: string, scope: string | null, auto = false): Promise<WrI18nCatalog> {\n const ck = cacheKey(locale, scope);\n const cached = this.catalogs.get(ck);\n if (cached) return Promise.resolve(cached);\n if (auto && this.failed.has(ck)) return Promise.resolve({});\n\n const pending = this.inflight.get(ck);\n if (pending) return pending;\n\n const stream: Observable<WrI18nCatalog> = this.loader.load(locale, scope);\n const promise = firstValueFrom(stream)\n .then(catalog => {\n this.failed.delete(ck);\n this.catalogs.set(ck, catalog);\n this.revision.update(v => v + 1);\n return catalog;\n })\n .catch((err: unknown) => {\n // eslint-disable-next-line no-console -- intentional diagnostic for missing catalog\n console.warn(`[ngwr/i18n] failed to load (${locale}, ${scope ?? 'root'})`, err);\n this.failed.add(ck);\n const empty: WrI18nCatalog = {};\n return empty;\n })\n .finally(() => {\n this.inflight.delete(ck);\n });\n\n this.inflight.set(ck, promise);\n return promise;\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Pipe, type PipeTransform, inject } from '@angular/core';\n\nimport { WrI18n } from './i18n';\nimport { type WrI18nParams, type WrI18nTranslateOptions } from './i18n-config';\n\n/**\n * Translate a key. Impure — re-evaluates on every CD so locale switches\n * and catalog loads propagate without a manual refresh.\n *\n * @example\n * ```html\n * <h1>{{ 'home.title' | wrT }}</h1>\n * <p>{{ 'greeting' | wrT: { name: user().name } }}</p>\n * <button>{{ 'forms.save' | wrT: null : 'checkout' }}</button>\n * <span>{{ 'types.' + type | wrT: null : { fallback: type } }}</span>\n * ```\n */\n// eslint-disable-next-line @angular-eslint/no-pipe-impure -- intentional: locale + catalog updates must propagate even when args are stable\n@Pipe({ name: 'wrT', pure: false })\nexport class WrTPipe implements PipeTransform {\n private readonly i18n = inject(WrI18n);\n\n transform(key: string, params?: WrI18nParams | null, scopeOrOptions?: string | WrI18nTranslateOptions): string {\n return this.i18n.t(key, params ?? undefined, scopeOrOptions);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { Directive, ElementRef, computed, effect, inject, input } from '@angular/core';\n\nimport { WrI18n } from './i18n';\nimport { type WrI18nParams } from './i18n-config';\n\n/**\n * Attribute directive that sets `textContent` of its host to the translation\n * of the bound key. Reactive — re-renders on locale + catalog changes.\n *\n * @example\n * ```html\n * <span [wrT]=\"'home.title'\"></span>\n * <span [wrT]=\"'greeting'\" [wrTParams]=\"{ name: user().name }\"></span>\n * <span [wrT]=\"'forms.save'\" wrTScope=\"checkout\"></span>\n * <span [wrT]=\"'types.' + type\" [wrTFallback]=\"type\"></span>\n * ```\n */\n@Directive({\n selector: '[wrT]',\n})\nexport class WrTDirective {\n /** Translation key. Required. */\n readonly wrT = input.required<string>();\n\n /** Interpolation params for `{{name}}` tokens. */\n readonly wrTParams = input<WrI18nParams | null>(null);\n\n /** Optional scope — scoped lookup first, then root fallback. */\n readonly wrTScope = input<string | null>(null);\n\n /** Text shown as is when the key is missing; `missingHandler` is not called. */\n readonly wrTFallback = input<string | null>(null);\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly i18n = inject(WrI18n);\n\n private readonly text = computed(() =>\n this.i18n.t(this.wrT(), this.wrTParams() ?? undefined, {\n scope: this.wrTScope() ?? undefined,\n fallback: this.wrTFallback(),\n })\n );\n\n constructor() {\n effect(() => {\n this.host.nativeElement.textContent = this.text();\n });\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Observable, of } from 'rxjs';\n\nimport { type WrI18nCatalog } from '../i18n-config';\nimport { type WrI18nLoader } from '../i18n-loader';\n\n/** Root catalogs keyed by locale: `{ en: catalog, ru: catalog, … }`. */\nexport type WrI18nStaticCatalogs = Readonly<Record<string, WrI18nCatalog>>;\n\n/** Per-scope catalogs: `{ checkout: { en: catalog, ru: catalog }, … }`. */\nexport type WrI18nStaticScopedCatalogs = Readonly<Record<string, WrI18nStaticCatalogs>>;\n\n/**\n * Loader for catalogs already in memory (imported from JSON or generated).\n *\n * - Pass `catalogs` for the root catalog of every locale.\n * - Pass `scopes` if you ship per-feature catalogs the loader should serve\n * to `WrI18n.registerScope(name)` calls.\n *\n * Missing locale or scope resolves to `{}` — the missing-key handler then\n * decides what to render.\n */\nexport class WrI18nStaticLoader implements WrI18nLoader {\n constructor(\n private readonly catalogs: WrI18nStaticCatalogs,\n private readonly scopes: WrI18nStaticScopedCatalogs = {}\n ) {}\n\n load(locale: string, scope: string | null): Observable<WrI18nCatalog> {\n if (scope === null) return of(this.catalogs[locale] ?? {});\n return of(this.scopes[scope]?.[locale] ?? {});\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { HttpClient } from '@angular/common/http';\nimport { inject } from '@angular/core';\n\nimport { type Observable } from 'rxjs';\n\nimport { type WrI18nCatalog } from '../i18n-config';\nimport { type WrI18nLoader } from '../i18n-loader';\n\n/** Configuration for {@link WrI18nHttpLoader}. */\nexport interface WrI18nHttpLoaderConfig {\n /**\n * URL template. Tokens:\n * - `{locale}` — required, BCP-47 tag (e.g. `en`).\n * - `{scope}` — optional, scope name. Use the `rootPath` if you need a\n * different path entirely for the root catalog.\n *\n * @example\n * ```ts\n * { path: '/assets/i18n/{locale}.json' } // root only\n * { path: '/assets/i18n/{scope}/{locale}.json',\n * rootPath: '/assets/i18n/{locale}.json' } // root + scopes\n * ```\n */\n readonly path: string;\n /** Path template for the root catalog. Defaults to `path`. */\n readonly rootPath?: string;\n}\n\n/**\n * Loader that fetches catalogs via `HttpClient`. A failure errors the stream;\n * the service logs it, serves the key and retries on the next `use()`.\n */\nexport class WrI18nHttpLoader implements WrI18nLoader {\n private readonly http = inject(HttpClient);\n\n constructor(private readonly config: WrI18nHttpLoaderConfig) {}\n\n load(locale: string, scope: string | null): Observable<WrI18nCatalog> {\n const template = scope === null ? (this.config.rootPath ?? this.config.path) : this.config.path;\n const url = template.replaceAll('{locale}', locale).replaceAll('{scope}', scope ?? '');\n return this.http.get<WrI18nCatalog>(url);\n }\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport {\n ApplicationRef,\n EnvironmentInjector,\n type EnvironmentProviders,\n type Provider,\n inject,\n makeEnvironmentProviders,\n provideEnvironmentInitializer,\n} from '@angular/core';\n\nimport { WR_LIVE_LOCALE } from 'ngwr/utils';\n\nimport { WrI18n } from './i18n';\nimport { WR_I18N_BASE_CATALOGS, type WrI18nBaseCatalogs } from './i18n-base-catalogs';\nimport {\n DEFAULT_WR_I18N_CONFIG,\n WR_I18N_CONFIG,\n type WrI18nConfig,\n type WrI18nConfigResolved,\n resolveWrI18nLocales,\n} from './i18n-config';\nimport { WR_I18N_LOADER, type WrI18nLoader } from './i18n-loader';\nimport { WrI18nHttpLoader, type WrI18nHttpLoaderConfig } from './loaders/http-loader';\nimport {\n WrI18nStaticLoader,\n type WrI18nStaticCatalogs,\n type WrI18nStaticScopedCatalogs,\n} from './loaders/static-loader';\n\n/**\n * Configure {@link WrI18n}. Either pass a `loader` directly, or use the\n * `provideWrI18nHttpLoader` / `provideWrI18nStaticLoader` helpers in the\n * same providers array.\n */\nexport interface ProvideWrI18nOptions extends WrI18nConfig {\n readonly loader?: WrI18nLoader;\n}\n\n/**\n * Configure {@link WrI18n} for the application.\n *\n * Call it in the application's root providers (`bootstrapApplication` or\n * `ApplicationConfig`), together with {@link provideWrI18nBaseCatalogs} and the\n * loader. `WrI18n` is a root service: a route's `providers` or a lazy module\n * never reach it, so a locale or catalogs given there do nothing, and dev mode\n * warns. A lazy area switches the language at runtime with\n * `inject(WrI18n).use('de')`, for example in its resolver. The switch is\n * app-wide, and the locale must be in the root `availableLocales`. The area's\n * own keys load with `registerScope()`.\n */\nexport function provideWrI18n(options: ProvideWrI18nOptions = {}): EnvironmentProviders {\n const { loader, ...config } = options;\n\n const providers: (Provider | EnvironmentProviders)[] = [\n {\n provide: WR_I18N_CONFIG,\n // A factory rather than a value: `defaultLocale` falls back to `LOCALE_ID`,\n // which only an injection context can read.\n useFactory: (): WrI18nConfigResolved => ({\n ...DEFAULT_WR_I18N_CONFIG,\n ...config,\n ...resolveWrI18nLocales(config),\n }),\n },\n ];\n if (loader) providers.push({ provide: WR_I18N_LOADER, useValue: loader });\n // What `ngwr/date` formats in, so dates follow `use()` without importing this entry point.\n providers.push({ provide: WR_LIVE_LOCALE, useFactory: () => inject(WrI18n).locale });\n\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n providers.push(\n provideEnvironmentInitializer(() => {\n const here = inject(EnvironmentInjector);\n if (here === inject(ApplicationRef, { optional: true })?.injector) return;\n // An injector that lists WrI18n itself owns an instance that does read this config.\n if (here.get(WrI18n, null, { self: true })) return;\n // eslint-disable-next-line no-console -- dev-mode validation\n console.warn(\n '[NGWR] provideWrI18n() is in a route or child injector. WrI18n is a root service, so this ' +\n \"configuration is ignored. Move provideWrI18n() and the catalogs to the application's root \" +\n 'providers, and switch a lazy area with inject(WrI18n).use(locale).'\n );\n })\n );\n }\n\n return makeEnvironmentProviders(providers);\n}\n\n/**\n * Provide a static loader — catalogs already in memory.\n *\n * A loader serves only the catalog you pass it, and ngwr registers none of its\n * own. Pass only your own keys here and register ngwr's catalogs with\n * {@link provideWrI18nBaseCatalogs} — not `{ ...wrRu, ...yours }`. A spread is\n * shallow, so any namespace you share with ngwr, e.g. `common`, `form`,\n * `table`, keeps only the keys of the side spread last, and the other side's\n * keys stop resolving with nothing logged: ngwr's components fall back to their\n * English defaults, and a `wrT` read of a lost key renders the raw key under the\n * default missing handler.\n *\n * @param catalogs Root catalogs keyed by locale.\n * @param scopes Optional per-scope catalogs served to `registerScope(name)`.\n */\nexport function provideWrI18nStaticLoader(\n catalogs: WrI18nStaticCatalogs,\n scopes?: WrI18nStaticScopedCatalogs\n): Provider {\n return { provide: WR_I18N_LOADER, useValue: new WrI18nStaticLoader(catalogs, scopes) };\n}\n\n/**\n * Register catalogs consulted *underneath* the loader — this is how ngwr's own\n * built-in strings survive when you supply your own catalogs.\n *\n * A loader replaces the catalog for a locale instead of extending it, so a JSON\n * file holding only your keys leaves every built-in label on its hardcoded\n * English fallback, with nothing logged. One line fixes it, on either loader:\n *\n * @example\n * ```ts\n * import { wrRu } from 'ngwr/i18n/ru';\n *\n * providers: [\n * provideWrI18n({ defaultLocale: 'ru', availableLocales: ['ru'] }),\n * provideWrI18nBaseCatalogs({ ru: wrRu }),\n * provideWrI18nHttpLoader({ path: '/assets/i18n/{locale}.json' }),\n * ]\n * ```\n *\n * Pass only the locales you ship — the ones you leave out stay out of the\n * bundle. Your own keys always win; this is a floor, not an override.\n *\n * Use it instead of spreading `wrRu` into your own catalog, too: the lookup\n * walks these key by key after the loader's catalog misses, so a namespace both\n * define keeps both halves, where a shallow spread keeps only one.\n */\nexport function provideWrI18nBaseCatalogs(catalogs: WrI18nBaseCatalogs): Provider {\n return { provide: WR_I18N_BASE_CATALOGS, useValue: catalogs, multi: true };\n}\n\n/** Provide an HTTP loader — catalogs fetched from URLs. Requires `provideHttpClient`. */\nexport function provideWrI18nHttpLoader(config: WrI18nHttpLoaderConfig): Provider {\n return { provide: WR_I18N_LOADER, useFactory: () => new WrI18nHttpLoader(config) };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Signal, computed, inject, signal } from '@angular/core';\n\nimport { WrI18n, wrInterpolate } from './i18n';\nimport type { WrI18nParams } from './i18n-config';\n\n/**\n * Helper for component default text. Returns a reactive string that:\n *\n * 1. Prefers the consumer's override (an `input<string | null>()` value).\n * 2. Falls back to the i18n catalog under `key` — re-renders on locale\n * change so a switcher updates the DOM live.\n * 3. Falls back to `fallback` when no `WrI18n` is provided OR the catalog\n * is missing the key.\n *\n * Components don't need a hard dependency on `provideWrI18n` — without it,\n * the fallback is returned and everything still works.\n *\n * @example\n * ```ts\n * readonly emptyText = input<string | null>(null);\n * protected readonly empty = useI18nText(this.emptyText, 'table.empty', 'No data');\n *\n * // In template: <div>{{ empty() }}</div>\n * ```\n */\nexport function useI18nText(binding: Signal<string | null | undefined>, key: string, fallback: string): Signal<string> {\n const i18n = inject(WrI18n, { optional: true });\n if (!i18n) {\n return computed(() => {\n const v = binding();\n return v ?? fallback;\n });\n }\n\n return computed(() => {\n const v = binding();\n if (v !== null && v !== undefined && v !== '') return v;\n const translated = i18n.t(key);\n // Default missing handler returns the key itself — treat that as \"missing\"\n // and use our explicit fallback.\n return translated === key ? fallback : translated;\n });\n}\n\n/**\n * {@link useI18nText} without a binding to forward — for a built-in string the\n * component exposes no override input for. Same reactivity, same fallback\n * rules; the only difference is the missing first argument.\n *\n * It used to return a plain `string`, resolved once at injection time, and\n * that was wrong in the ordinary case rather than an edge one: `WrI18n` writes\n * every loader-backed catalog from `firstValueFrom(...).then(...)`, so even a\n * static loader serving an object literal lands a microtask AFTER the first\n * change-detection pass. Every component built in that pass read an empty\n * catalog and froze its English fallback for the life of the app — in one\n * `<wr-date-picker>` the field said \"Открыть календарь\" and the calendar\n * button beside it \"Open calendar\", off the same key.\n */\nexport function wrReadI18nText(key: string, fallback: string): Signal<string> {\n const i18n = inject(WrI18n, { optional: true });\n if (!i18n) return computed(() => fallback);\n\n return computed(() => {\n const v = i18n.t(key);\n return v === key ? fallback : v;\n });\n}\n\n/** Tiny shim — useful when the caller doesn't have an `input` to forward. */\nexport function nullSignal(): Signal<null> {\n return signal(null).asReadonly();\n}\n\n/**\n * Build a per-call formatter for parametrized labels (e.g. ARIA labels\n * that interpolate a per-row value: `\"Remove {{label}}\"`). Returns a\n * function the template calls with the params for the current item.\n *\n * The returned function:\n * - Re-resolves the i18n catalog on every call (live locale switches just\n * work — re-rendered templates pick up new strings).\n * - Falls back to the literal `fallback` template with the same\n * `{{name}}` syntax when no `WrI18n` provider is present, or when the\n * key is missing.\n *\n * Use this for labels that vary per row. For static labels, prefer\n * {@link useI18nText} or {@link wrReadI18nText}.\n *\n * @example\n * ```ts\n * protected readonly removeChipLabel = useI18nFormatter('select.removeItem', 'Remove {{label}}');\n *\n * // In template:\n * // [attr.aria-label]=\"removeChipLabel({ label: chip.label })\"\n * ```\n */\nexport function useI18nFormatter(key: string, fallback: string): (params?: WrI18nParams) => string {\n const i18n = inject(WrI18n, { optional: true });\n if (!i18n) {\n return (params?: WrI18nParams) => wrInterpolate(fallback, params);\n }\n return (params?: WrI18nParams) => {\n const v = i18n.t(key, params);\n return v === key ? wrInterpolate(fallback, params) : v;\n };\n}\n","/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { type Injector, inject } from '@angular/core';\n\nimport { WrI18n, wrInterpolate } from './i18n';\n\n/** The English catalog's `httpError`, for an app with no catalog registered. */\nconst FALLBACK: Readonly<Record<string, string>> = {\n network: 'No connection to the server. Check your network and try again.',\n 400: 'The server did not accept the data. Check the fields.',\n 401: 'Your session has ended. Sign in again.',\n 403: 'You do not have permission for this action.',\n 404: 'Not found. It may have been deleted.',\n 409: 'This conflicts with existing data. Refresh the page and try again.',\n 413: 'The data is too large to send.',\n 422: 'Some of the data is not valid. Check the fields.',\n 429: 'Too many requests. Try again in a moment.',\n 503: 'The server is unavailable. Try again in a minute.',\n '4xx': 'The request was refused. Error code: {{status}}.',\n '5xx': 'The server failed. Try again later. Error code: {{status}}.',\n unknown: 'Something went wrong. Try again later.',\n};\n\n/** Most specific first. */\nfunction catalogKeys(status: number | null): readonly string[] {\n if (status === null) return ['unknown'];\n if (status === 0) return ['network'];\n if (status >= 400 && status < 500) return [String(status), '4xx', 'unknown'];\n if (status >= 500 && status < 600) return [String(status), '5xx', 'unknown'];\n return [String(status), 'unknown'];\n}\n\nfunction serverMessage(error: unknown): string | null {\n const body = (error as { error?: unknown } | null | undefined)?.error;\n if (typeof body === 'string') {\n const text = body.trim();\n // A proxy answers with an HTML page, which is a string body too.\n return text === '' || text.startsWith('<') ? null : text;\n }\n const message = (body as { message?: unknown } | null | undefined)?.message;\n return typeof message === 'string' && message.trim() !== '' ? message.trim() : null;\n}\n\n/** A screen's own sentence for one status: the text, or a function of the error. */\nexport type WrHttpErrorOverride = string | ((error: unknown) => string);\n\n/** Options of {@link wrHttpErrorText}. */\nexport interface WrHttpErrorTextOptions {\n /** The screen's own sentence per status, `0` being a network failure. Wins over everything else. */\n readonly overrides?: Readonly<Partial<Record<number, WrHttpErrorOverride>>>;\n /**\n * Prefer the sentence the server put in the body: `error.error.message`, or\n * a body that is a plain string. For an API that writes its errors for the\n * person at the screen.\n * @default false\n */\n readonly serverMessage?: boolean;\n /** Where to read `WrI18n` from when the call is outside an injection context, such as a `catch`. */\n readonly injector?: Injector;\n}\n\n/**\n * The HTTP status of a failed request: of an `HttpErrorResponse`, a `Response`\n * or anything else carrying a numeric `status`. `0` is a request nothing\n * answered (offline, CORS, a dropped connection); `null` is a value that is not\n * an HTTP error at all.\n *\n * @example\n * ```ts\n * if (wrHttpStatus(error) === 401) void router.navigate(['/login']);\n * ```\n *\n * @see https://ngwr.dev/reference/utils/wr-http-error-text\n */\nexport function wrHttpStatus(error: unknown): number | null {\n const status = (error as { status?: unknown } | null | undefined)?.status;\n return typeof status === 'number' && Number.isInteger(status) && status >= 0 ? status : null;\n}\n\n/**\n * A sentence for a failed request, in the active language. Highest first:\n *\n * 1. `overrides[status]`, the screen's own wording.\n * 2. With `serverMessage`, the sentence in the response body.\n * 3. The catalog: `httpError.<status>`, then `httpError.4xx` / `httpError.5xx`\n * (both take `{{status}}`), `httpError.network` for status `0`, and\n * `httpError.unknown` for the rest. An app's own catalog wins over ngwr's,\n * and English is the floor when neither has the key.\n *\n * Call it in an injection context, or pass `injector` from a `catch` or a\n * callback.\n *\n * @example\n * ```ts\n * private readonly injector = inject(Injector);\n *\n * try {\n * await this.api.save(order);\n * } catch (error) {\n * this.toast.danger(\n * wrHttpErrorText(error, { injector: this.injector, overrides: { 409: 'This name is taken.' } })\n * );\n * }\n * ```\n *\n * @see https://ngwr.dev/reference/utils/wr-http-error-text\n */\nexport function wrHttpErrorText(error: unknown, options: WrHttpErrorTextOptions = {}): string {\n const status = wrHttpStatus(error);\n\n const override = status === null ? undefined : options.overrides?.[status];\n if (override !== undefined) return typeof override === 'function' ? override(error) : override;\n\n if (options.serverMessage && status !== null) {\n const said = serverMessage(error);\n if (said !== null) return said;\n }\n\n const i18n = options.injector ? options.injector.get(WrI18n, null) : inject(WrI18n, { optional: true });\n const keys = catalogKeys(status);\n const params = { status };\n\n for (const key of keys) {\n const hit = i18n?.t(`httpError.${key}`, params, { fallback: '' });\n if (hit) return hit;\n }\n for (const key of keys) {\n if (key in FALLBACK) return wr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EAC5C,MAAM,OAAO,cAAc,KAAK;EAChC,IAAI,SAAS,MAAM,OAAO;CAC5B;CAEA,MAAM,OAAO,QAAQ,WAAW,QAAQ,SAAS,IAAI,QAAQ,IAAI,IAAI,OAAO,QAAQ,EAAE,UAAU,KAAI,CAAE;CACtG,MAAM,OAAO,YAAY,MAAM;CAC/B,MAAM,SAAS,EAAE,OAAM;CAEvB,KAAK,MAAM,OAAO,MAAM;EACtB,MAAM,MAAM,MAAM,EAAE,aAAa,OAAO,QAAQ,EAAE,UAAU,GAAE,CAAE;EAChE,IAAI,KAAK,OAAO;CAClB;CACA,KAAK,MAAM,OAAO,MAChB,IAAI,OAAO,UAAU,OAAO,cAAc,SAAS,MAAM,MAAM;CAEjE,OAAO,SAAS;AAClB"}
|
|
@@ -69,6 +69,10 @@ var WrInputNumber = class WrInputNumber {
|
|
|
69
69
|
transform: coerceBooleanProperty
|
|
70
70
|
});
|
|
71
71
|
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
72
|
+
block = input(false, {
|
|
73
|
+
...ngDevMode ? { debugName: "block" } : /* istanbul ignore next */ {},
|
|
74
|
+
transform: coerceBooleanProperty
|
|
75
|
+
});
|
|
72
76
|
rounded = input(false, {
|
|
73
77
|
...ngDevMode ? { debugName: "rounded" } : /* istanbul ignore next */ {},
|
|
74
78
|
transform: coerceBooleanProperty
|
|
@@ -110,6 +114,7 @@ var WrInputNumber = class WrInputNumber {
|
|
|
110
114
|
numerals = resolveNumerals(this.locale);
|
|
111
115
|
group = groupPattern(this.separators.group);
|
|
112
116
|
text = signal("", ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
117
|
+
lastCommitted = void 0;
|
|
113
118
|
focused = signal(false, ...ngDevMode ? [{ debugName: "focused" }] : /* istanbul ignore next */ []);
|
|
114
119
|
field = viewChild.required("input", ...ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []);
|
|
115
120
|
interactive = computed(() => !this.disabled() && !this.readonly(), ...ngDevMode ? [{ debugName: "interactive" }] : /* istanbul ignore next */ []);
|
|
@@ -139,6 +144,7 @@ var WrInputNumber = class WrInputNumber {
|
|
|
139
144
|
const size = this.size();
|
|
140
145
|
if (size !== "md") parts.push(`wr-input-number--${size}`);
|
|
141
146
|
if (this.rounded()) parts.push("wr-input-number--rounded");
|
|
147
|
+
if (this.block()) parts.push("wr-input-number--block");
|
|
142
148
|
if (this.disabled()) parts.push("wr-input-number--disabled");
|
|
143
149
|
return parts.join(" ");
|
|
144
150
|
}, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
|
|
@@ -149,7 +155,8 @@ var WrInputNumber = class WrInputNumber {
|
|
|
149
155
|
if (typeof ngDevMode === "undefined" || ngDevMode) wrCheckStyles("input-number");
|
|
150
156
|
effect(() => {
|
|
151
157
|
const v = this.value();
|
|
152
|
-
if (this.focused()) return;
|
|
158
|
+
if (this.focused() && Object.is(v, this.lastCommitted)) return;
|
|
159
|
+
this.lastCommitted = v;
|
|
153
160
|
if (v === null || Number.isNaN(v)) {
|
|
154
161
|
this.text.set("");
|
|
155
162
|
return;
|
|
@@ -198,6 +205,7 @@ var WrInputNumber = class WrInputNumber {
|
|
|
198
205
|
this.bump(direction);
|
|
199
206
|
}
|
|
200
207
|
commit(next) {
|
|
208
|
+
this.lastCommitted = next;
|
|
201
209
|
this.value.set(next);
|
|
202
210
|
}
|
|
203
211
|
bump(units) {
|
|
@@ -357,6 +365,13 @@ var WrInputNumber = class WrInputNumber {
|
|
|
357
365
|
isRequired: false,
|
|
358
366
|
transformFunction: null
|
|
359
367
|
},
|
|
368
|
+
block: {
|
|
369
|
+
classPropertyName: "block",
|
|
370
|
+
publicName: "block",
|
|
371
|
+
isSignal: true,
|
|
372
|
+
isRequired: false,
|
|
373
|
+
transformFunction: null
|
|
374
|
+
},
|
|
360
375
|
rounded: {
|
|
361
376
|
classPropertyName: "rounded",
|
|
362
377
|
publicName: "rounded",
|
|
@@ -580,6 +595,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
580
595
|
required: false
|
|
581
596
|
}]
|
|
582
597
|
}],
|
|
598
|
+
block: [{
|
|
599
|
+
type: i0.Input,
|
|
600
|
+
args: [{
|
|
601
|
+
isSignal: true,
|
|
602
|
+
alias: "block",
|
|
603
|
+
required: false
|
|
604
|
+
}]
|
|
605
|
+
}],
|
|
583
606
|
rounded: [{
|
|
584
607
|
type: i0.Input,
|
|
585
608
|
args: [{
|