ngwr 16.2.0 → 16.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/badge/styles/_tag.scss +73 -1
- package/calendar/styles/_index.scss +22 -0
- package/cascader/styles/_rules.scss +7 -0
- package/color-picker/styles/_index.scss +21 -0
- package/date-picker/styles/_index.scss +19 -0
- package/dropdown/styles/_index.scss +13 -19
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert-testing.mjs +70 -0
- package/fesm2022/ngwr-alert-testing.mjs.map +1 -0
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +17 -6
- package/fesm2022/ngwr-anchor.mjs.map +1 -1
- package/fesm2022/ngwr-animations-aurora.mjs +3 -3
- package/fesm2022/ngwr-animations-blur-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-click-sparks.mjs +3 -3
- package/fesm2022/ngwr-animations-confetti.mjs +3 -3
- package/fesm2022/ngwr-animations-decode.mjs +3 -3
- package/fesm2022/ngwr-animations-destruct.mjs +3 -3
- package/fesm2022/ngwr-animations-dot-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-falling-letters.mjs +3 -3
- package/fesm2022/ngwr-animations-flow-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-fluid-cursor.mjs +3 -3
- package/fesm2022/ngwr-animations-glitch.mjs +3 -3
- package/fesm2022/ngwr-animations-glow-border.mjs +3 -3
- package/fesm2022/ngwr-animations-gradient-flow.mjs +3 -3
- package/fesm2022/ngwr-animations-marquee.mjs +3 -3
- package/fesm2022/ngwr-animations-orbit.mjs +3 -3
- package/fesm2022/ngwr-animations-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-ripple-grid.mjs +3 -3
- package/fesm2022/ngwr-animations-rotate-reveal.mjs +3 -3
- package/fesm2022/ngwr-animations-shimmer.mjs +3 -3
- package/fesm2022/ngwr-animations-spotlight.mjs +3 -3
- package/fesm2022/ngwr-animations-thread-lines.mjs +3 -3
- package/fesm2022/ngwr-animations-tilt.mjs +3 -3
- package/fesm2022/ngwr-animations-typewriter.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +129 -11
- package/fesm2022/ngwr-badge.mjs.map +1 -1
- package/fesm2022/ngwr-breadcrumbs-testing.mjs +83 -0
- package/fesm2022/ngwr-breadcrumbs-testing.mjs.map +1 -0
- package/fesm2022/ngwr-breadcrumbs.mjs +8 -8
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger-testing.mjs +45 -0
- package/fesm2022/ngwr-burger-testing.mjs.map +1 -0
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +6 -6
- package/fesm2022/ngwr-calendar-testing.mjs +18 -0
- package/fesm2022/ngwr-calendar-testing.mjs.map +1 -1
- package/fesm2022/ngwr-calendar.mjs +500 -73
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +9 -9
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-cascader.mjs +37 -16
- package/fesm2022/ngwr-cascader.mjs.map +1 -1
- package/fesm2022/ngwr-charts-bar-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-bar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-boxplot-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-bullet-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-calendar-heatmap.mjs +3 -3
- package/fesm2022/ngwr-charts-candlestick-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-chart-legend.mjs +26 -11
- package/fesm2022/ngwr-charts-chart-legend.mjs.map +1 -1
- package/fesm2022/ngwr-charts-core.mjs +3 -3
- package/fesm2022/ngwr-charts-donut-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-donut-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-funnel-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-gauge.mjs +3 -3
- package/fesm2022/ngwr-charts-heatmap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-line-chart-testing.mjs +3 -2
- package/fesm2022/ngwr-charts-line-chart-testing.mjs.map +1 -1
- package/fesm2022/ngwr-charts-line-chart.mjs +17 -7
- package/fesm2022/ngwr-charts-line-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-meter-group.mjs +5 -4
- package/fesm2022/ngwr-charts-meter-group.mjs.map +1 -1
- package/fesm2022/ngwr-charts-radar-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-radar-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-scatter-chart.mjs +5 -4
- package/fesm2022/ngwr-charts-scatter-chart.mjs.map +1 -1
- package/fesm2022/ngwr-charts-sparkline.mjs +3 -3
- package/fesm2022/ngwr-charts-treemap-chart.mjs +3 -3
- package/fesm2022/ngwr-charts-waterfall-chart.mjs +3 -3
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-clipboard.mjs +3 -3
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker-testing.mjs +11 -1
- package/fesm2022/ngwr-color-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-color-picker.mjs +153 -37
- package/fesm2022/ngwr-color-picker.mjs.map +1 -1
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-comment.mjs +10 -6
- package/fesm2022/ngwr-comment.mjs.map +1 -1
- package/fesm2022/ngwr-compare-testing.mjs +84 -0
- package/fesm2022/ngwr-compare-testing.mjs.map +1 -0
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +12 -12
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-copy-value.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-picker-testing.mjs +30 -4
- package/fesm2022/ngwr-date-picker-testing.mjs.map +1 -1
- package/fesm2022/ngwr-date-picker.mjs +342 -69
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-date-stamp.mjs +3 -3
- package/fesm2022/ngwr-date.mjs +59 -8
- package/fesm2022/ngwr-date.mjs.map +1 -1
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +18 -18
- package/fesm2022/ngwr-directives.mjs +15 -15
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-drawer.mjs +51 -29
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown-testing.mjs +11 -3
- package/fesm2022/ngwr-dropdown-testing.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +52 -95
- package/fesm2022/ngwr-dropdown.mjs.map +1 -1
- package/fesm2022/ngwr-editor.mjs +4 -3
- package/fesm2022/ngwr-editor.mjs.map +1 -1
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +186 -33
- package/fesm2022/ngwr-event-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload-testing.mjs +34 -2
- package/fesm2022/ngwr-file-upload-testing.mjs.map +1 -1
- package/fesm2022/ngwr-file-upload.mjs +274 -15
- package/fesm2022/ngwr-file-upload.mjs.map +1 -1
- package/fesm2022/ngwr-form.mjs +9 -9
- package/fesm2022/ngwr-form.mjs.map +1 -1
- package/fesm2022/ngwr-graph-testing.mjs +3 -0
- package/fesm2022/ngwr-graph-testing.mjs.map +1 -1
- package/fesm2022/ngwr-graph.mjs +102 -42
- package/fesm2022/ngwr-graph.mjs.map +1 -1
- package/fesm2022/ngwr-hotkey.mjs +6 -6
- package/fesm2022/ngwr-i18n-ar.mjs +19 -4
- package/fesm2022/ngwr-i18n-ar.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-cs.mjs +19 -4
- package/fesm2022/ngwr-i18n-cs.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-de.mjs +19 -4
- package/fesm2022/ngwr-i18n-de.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +19 -4
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-es.mjs +19 -4
- package/fesm2022/ngwr-i18n-es.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-fr.mjs +19 -4
- package/fesm2022/ngwr-i18n-fr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-he.mjs +19 -4
- package/fesm2022/ngwr-i18n-he.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-hi.mjs +19 -4
- package/fesm2022/ngwr-i18n-hi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-id.mjs +19 -4
- package/fesm2022/ngwr-i18n-id.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-it.mjs +19 -4
- package/fesm2022/ngwr-i18n-it.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ja.mjs +19 -4
- package/fesm2022/ngwr-i18n-ja.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ko.mjs +19 -4
- package/fesm2022/ngwr-i18n-ko.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-nl.mjs +19 -4
- package/fesm2022/ngwr-i18n-nl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pl.mjs +19 -4
- package/fesm2022/ngwr-i18n-pl.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-pt.mjs +19 -4
- package/fesm2022/ngwr-i18n-pt.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +19 -4
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-sv.mjs +19 -4
- package/fesm2022/ngwr-i18n-sv.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-tr.mjs +19 -4
- package/fesm2022/ngwr-i18n-tr.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-uk.mjs +19 -4
- package/fesm2022/ngwr-i18n-uk.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-vi.mjs +19 -4
- package/fesm2022/ngwr-i18n-vi.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh-tw.mjs +19 -4
- package/fesm2022/ngwr-i18n-zh-tw.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-zh.mjs +19 -4
- package/fesm2022/ngwr-i18n-zh.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +9 -9
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper.mjs +3 -3
- package/fesm2022/ngwr-input-number-testing.mjs +11 -0
- package/fesm2022/ngwr-input-number-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input-number.mjs +68 -7
- package/fesm2022/ngwr-input-number.mjs.map +1 -1
- package/fesm2022/ngwr-input-otp.mjs +23 -3
- package/fesm2022/ngwr-input-otp.mjs.map +1 -1
- package/fesm2022/ngwr-input-testing.mjs +24 -1
- package/fesm2022/ngwr-input-testing.mjs.map +1 -1
- package/fesm2022/ngwr-input.mjs +152 -36
- package/fesm2022/ngwr-input.mjs.map +1 -1
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox.mjs +8 -8
- package/fesm2022/ngwr-lightbox.mjs.map +1 -1
- package/fesm2022/ngwr-list.mjs +8 -8
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-load-state.mjs +15 -15
- package/fesm2022/ngwr-loading-bar.mjs +6 -6
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-overlay.mjs +175 -13
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination.mjs +5 -3
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +31 -29
- package/fesm2022/ngwr-pipes.mjs.map +1 -1
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm-testing.mjs +5 -2
- package/fesm2022/ngwr-popconfirm-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popconfirm.mjs +44 -63
- package/fesm2022/ngwr-popconfirm.mjs.map +1 -1
- package/fesm2022/ngwr-popover-testing.mjs +7 -1
- package/fesm2022/ngwr-popover-testing.mjs.map +1 -1
- package/fesm2022/ngwr-popover.mjs +58 -156
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +50 -9
- package/fesm2022/ngwr-progress.mjs.map +1 -1
- package/fesm2022/ngwr-pull-to-refresh-testing.mjs +57 -0
- package/fesm2022/ngwr-pull-to-refresh-testing.mjs.map +1 -0
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-resizable-testing.mjs +113 -0
- package/fesm2022/ngwr-resizable-testing.mjs.map +1 -0
- package/fesm2022/ngwr-resizable.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-schema-form-testing.mjs +336 -0
- package/fesm2022/ngwr-schema-form-testing.mjs.map +1 -0
- package/fesm2022/ngwr-schema-form.mjs +415 -19
- package/fesm2022/ngwr-schema-form.mjs.map +1 -1
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-select-testing.mjs +19 -0
- package/fesm2022/ngwr-select-testing.mjs.map +1 -1
- package/fesm2022/ngwr-select.mjs +263 -83
- package/fesm2022/ngwr-select.mjs.map +1 -1
- package/fesm2022/ngwr-sidebar-testing.mjs +176 -0
- package/fesm2022/ngwr-sidebar-testing.mjs.map +1 -0
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider-testing.mjs +6 -0
- package/fesm2022/ngwr-slider-testing.mjs.map +1 -1
- package/fesm2022/ngwr-slider.mjs +21 -3
- package/fesm2022/ngwr-slider.mjs.map +1 -1
- package/fesm2022/ngwr-sortable-list.mjs +29 -12
- package/fesm2022/ngwr-sortable-list.mjs.map +1 -1
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper.mjs +42 -11
- package/fesm2022/ngwr-stepper.mjs.map +1 -1
- package/fesm2022/ngwr-storage.mjs +3 -3
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table-testing.mjs +88 -2
- package/fesm2022/ngwr-table-testing.mjs.map +1 -1
- package/fesm2022/ngwr-table.mjs +891 -74
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs-router.mjs +3 -3
- package/fesm2022/ngwr-tabs-testing.mjs +1 -1
- package/fesm2022/ngwr-tabs-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +15 -10
- package/fesm2022/ngwr-tabs.mjs.map +1 -1
- package/fesm2022/ngwr-textarea-testing.mjs +11 -0
- package/fesm2022/ngwr-textarea-testing.mjs.map +1 -1
- package/fesm2022/ngwr-textarea.mjs +128 -16
- package/fesm2022/ngwr-textarea.mjs.map +1 -1
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +40 -19
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +6 -6
- package/fesm2022/ngwr-transfer-testing.mjs +6 -0
- package/fesm2022/ngwr-transfer-testing.mjs.map +1 -1
- package/fesm2022/ngwr-transfer.mjs +24 -5
- package/fesm2022/ngwr-transfer.mjs.map +1 -1
- package/fesm2022/ngwr-tree-testing.mjs +62 -2
- package/fesm2022/ngwr-tree-testing.mjs.map +1 -1
- package/fesm2022/ngwr-tree.mjs +966 -78
- package/fesm2022/ngwr-tree.mjs.map +1 -1
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-utils-router.mjs +3 -3
- package/fesm2022/ngwr-utils.mjs +34 -1
- package/fesm2022/ngwr-utils.mjs.map +1 -1
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +3 -3
- package/fesm2022/ngwr-window.mjs +33 -22
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/file-upload/styles/_index.scss +156 -0
- package/i18n/ar.json +21 -4
- package/i18n/cs.json +21 -4
- package/i18n/de.json +21 -4
- package/i18n/en.json +21 -4
- package/i18n/es.json +21 -4
- package/i18n/fr.json +21 -4
- package/i18n/he.json +21 -4
- package/i18n/hi.json +21 -4
- package/i18n/id.json +21 -4
- package/i18n/it.json +21 -4
- package/i18n/ja.json +21 -4
- package/i18n/ko.json +21 -4
- package/i18n/nl.json +21 -4
- package/i18n/pl.json +21 -4
- package/i18n/pt.json +21 -4
- package/i18n/ru.json +21 -4
- package/i18n/sv.json +21 -4
- package/i18n/tr.json +21 -4
- package/i18n/uk.json +21 -4
- package/i18n/vi.json +21 -4
- package/i18n/zh-TW.json +21 -4
- package/i18n/zh.json +21 -4
- package/input/styles/_index.scss +68 -1
- package/input-otp/styles/_index.scss +14 -0
- package/llms-full.txt +52 -20
- package/overlay/styles/_arrow.scss +4 -4
- package/package.json +33 -1
- package/popconfirm/styles/_index.scss +3 -11
- package/progress/styles/_index.scss +32 -0
- package/schema-form/styles/_index.scss +78 -0
- package/schematics/use/rule.js +2 -0
- package/schematics/use/symbol-map.json +4 -0
- package/select/styles/_index.scss +114 -22
- package/skills/ngwr/SKILL.md +1 -1
- package/skills/ngwr/references/catalog.md +9 -1
- package/slider/styles/_index.scss +22 -0
- package/table/styles/_index.scss +167 -3
- package/textarea/styles/_index.scss +80 -0
- package/theme/styles/_focus.scss +5 -0
- package/theme/styles/_motion.scss +5 -0
- package/transfer/styles/_index.scss +84 -0
- package/tree/styles/_index.scss +138 -5
- package/types/ngwr-alert-testing.d.ts +88 -0
- package/types/ngwr-badge.d.ts +72 -2
- package/types/ngwr-breadcrumbs-testing.d.ts +92 -0
- package/types/ngwr-burger-testing.d.ts +51 -0
- package/types/ngwr-calendar-testing.d.ts +18 -6
- package/types/ngwr-calendar.d.ts +272 -22
- package/types/ngwr-cascader.d.ts +10 -1
- package/types/ngwr-charts-chart-legend.d.ts +9 -4
- package/types/ngwr-charts-line-chart-testing.d.ts +4 -1
- package/types/ngwr-charts-line-chart.d.ts +7 -4
- package/types/ngwr-color-picker-testing.d.ts +15 -4
- package/types/ngwr-color-picker.d.ts +76 -6
- package/types/ngwr-compare-testing.d.ts +72 -0
- package/types/ngwr-date-picker-testing.d.ts +23 -8
- package/types/ngwr-date-picker.d.ts +100 -9
- package/types/ngwr-date.d.ts +71 -1
- package/types/ngwr-drawer.d.ts +9 -0
- package/types/ngwr-dropdown-testing.d.ts +20 -0
- package/types/ngwr-dropdown.d.ts +24 -6
- package/types/ngwr-event-calendar.d.ts +66 -8
- package/types/ngwr-file-upload-testing.d.ts +31 -2
- package/types/ngwr-file-upload.d.ts +148 -1
- package/types/ngwr-form.d.ts +47 -3
- package/types/ngwr-graph-testing.d.ts +8 -3
- package/types/ngwr-graph.d.ts +147 -7
- package/types/ngwr-input-number-testing.d.ts +10 -0
- package/types/ngwr-input-number.d.ts +30 -1
- package/types/ngwr-input-otp.d.ts +10 -0
- package/types/ngwr-input-testing.d.ts +30 -0
- package/types/ngwr-input.d.ts +54 -3
- package/types/ngwr-overlay.d.ts +84 -5
- package/types/ngwr-pipes.d.ts +2 -1
- package/types/ngwr-popconfirm-testing.d.ts +12 -3
- package/types/ngwr-popconfirm.d.ts +28 -3
- package/types/ngwr-popover-testing.d.ts +19 -2
- package/types/ngwr-popover.d.ts +22 -2
- package/types/ngwr-progress.d.ts +29 -1
- package/types/ngwr-pull-to-refresh-testing.d.ts +83 -0
- package/types/ngwr-resizable-testing.d.ts +116 -0
- package/types/ngwr-schema-form-testing.d.ts +260 -0
- package/types/ngwr-schema-form.d.ts +76 -6
- package/types/ngwr-select-testing.d.ts +20 -0
- package/types/ngwr-select.d.ts +112 -11
- package/types/ngwr-sidebar-testing.d.ts +176 -0
- package/types/ngwr-slider-testing.d.ts +3 -1
- package/types/ngwr-slider.d.ts +21 -1
- package/types/ngwr-sortable-list.d.ts +6 -0
- package/types/ngwr-stepper.d.ts +20 -11
- package/types/ngwr-table-testing.d.ts +70 -6
- package/types/ngwr-table.d.ts +480 -50
- package/types/ngwr-tabs-testing.d.ts +14 -17
- package/types/ngwr-tabs.d.ts +6 -0
- package/types/ngwr-textarea-testing.d.ts +10 -0
- package/types/ngwr-textarea.d.ts +48 -2
- package/types/ngwr-toast.d.ts +8 -1
- package/types/ngwr-transfer-testing.d.ts +3 -0
- package/types/ngwr-transfer.d.ts +24 -1
- package/types/ngwr-tree-testing.d.ts +65 -1
- package/types/ngwr-tree.d.ts +333 -12
- package/types/ngwr-utils.d.ts +28 -0
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +7 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-charts-scatter-chart.mjs","names":[],"sources":["../../../projects/lib/charts/scatter-chart/scatter-chart.ts","../../../projects/lib/charts/scatter-chart/scatter-chart.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n type ElementRef,\n LOCALE_ID,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n viewChild,\n} from '@angular/core';\n\nimport { WrChartLegend, type WrChartLegendItem } from 'ngwr/charts/chart-legend';\nimport {\n type WrChartAxis,\n type WrChartMarkerExtent,\n type WrChartMarkerShape,\n WrChartTable,\n type WrChartTableData,\n wrChartAxis,\n wrChartColor,\n wrChartMarker,\n wrChartMarkerExtent,\n wrChartMarkerPath,\n useChartNumbers,\n} from 'ngwr/charts/core';\nimport { useI18nText } from 'ngwr/i18n';\nimport { type WrChartTooltipRow, useChartTooltip } from 'ngwr/popover';\nimport { wrRound, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrScatterAxis, WrScatterSeries } from './types';\n\n/** The radius, in px, of a point with no `size`: a marker as large as a 10px circle. */\nconst POINT_RADIUS = 5;\n\n/** The smallest radius a sized point is drawn at, in px, however small its size: still a mark, still hoverable. */\nconst MIN_RADIUS = 4;\n\n/** How far from a marker's centre, in px, the pointer still reads that point — or as far as the marker reaches, if farther. */\nconst HIT_RADIUS = 16;\n\n/** How far outside its marker the hovered point's ring is drawn, in px. */\nconst HALO_GAP = 3;\n\n/** A percentage to three decimals, so an attribute stays short. */\nconst percent = (value: number): number => Math.round(value * 1000) / 1000;\n\n/** One point as the chart draws it: its data, where it sits and how large it is. */\ninterface DrawnPoint {\n /** Its series' position and its own position in that series' `data`, which no other point shares. */\n readonly key: string;\n /** Its series' position in `series`. */\n readonly series: number;\n readonly seriesLabel: string;\n readonly color: string;\n readonly marker: WrChartMarkerShape;\n /** Its position in its series' `data`, from 1: the row header of a point with no `label`. */\n readonly n: number;\n readonly x: number;\n readonly y: number;\n readonly size: number | null;\n readonly label: string | null;\n /** Its centre, as percentages of the drawing's width from the left and height from the top. */\n readonly left: number;\n readonly top: number;\n /** Its radius in px. */\n readonly r: number;\n /** Its marker's path about the origin. */\n readonly d: string;\n /** How far its hover ring reaches from its centre, in px: what the tooltip points at and the pointer reads. */\n readonly halo: WrChartMarkerExtent;\n}\n\n/**\n * Points on two numeric axes: one series per marker shape, and an optional third value\n * drawn as each point's area, which makes it a bubble chart. SVG-only — no external\n * dependency.\n *\n * @example\n * ```html\n * <wr-scatter-chart\n * xLabel=\"Price\"\n * yLabel=\"Rating\"\n * [series]=\"[\n * { label: 'Laptops', data: [{ x: 899, y: 4.1 }, { x: 1299, y: 4.6 }] },\n * { label: 'Tablets', data: [{ x: 329, y: 3.9 }, { x: 599, y: 4.4 }] }\n * ]\"\n * />\n * ```\n *\n * Each series is told apart by its marker's SHAPE as well as its colour — a circle, a\n * square, a triangle, a diamond, a cross, a downward triangle — since the palette's\n * colours sit too close in lightness to be read alone. Neither axis is forced to include\n * zero: each is fitted to its data and snapped outward to a readable step, so no point\n * lands exactly on the frame, and a single value sits in the middle with a step either\n * side. A point can still sit a hair inside the frame, so the plot's padding grows to\n * the largest marker drawn, and a bubble at the edge stays inside the chart's own box.\n *\n * The drawing is one named `role=\"img\"` and takes no tab stop; the tooltip is pointer\n * only. `dataTable` renders every value as a table only assistive technology reaches.\n * The legend is a `ul[wr-chart-legend]` (`ngwr/charts/chart-legend`), and with\n * `toggleableLegend` its rows show and hide their series through `hiddenSeries`.\n *\n * Hovering finds the nearest point by measuring every one, so a chart meant for more\n * than a few thousand points is better served by binning them first.\n *\n * @see https://ngwr.dev/charts/scatter-chart\n */\n@Component({\n selector: 'wr-scatter-chart',\n templateUrl: './scatter-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-scatter-chart',\n // A bubble chart's markers overlap as a rule, so they are drawn see-through.\n '[class.wr-scatter-chart--bubbles]': 'sized()',\n // How far the largest marker reaches, ring included: the stylesheet grows the plot's\n // padding to it, so a marker on the frame stays inside the plot.\n '[style.--wr-scatter-chart-reach-x]': 'reach().x',\n '[style.--wr-scatter-chart-reach-y]': 'reach().y',\n },\n imports: [WrChartLegend, WrChartTable],\n})\nexport class WrScatterChart {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/scatter-chart');\n }\n\n /**\n * One entry per series. A series with no `color` takes the next entry from the chart's\n * palette, and every series takes the next marker shape, so several series are told\n * apart unconfigured.\n */\n readonly series = input<readonly WrScatterSeries[]>([]);\n\n /**\n * Accessible name of the chart. The legend carries the series NAMES only — the values\n * are nowhere in text unless `dataTable` puts them there — so say what the chart shows.\n * Falls back to `scatterChart.label` (\"Scatter chart\").\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'scatterChart.label', 'Scatter chart');\n\n /**\n * The x axis' name. Drawn under the axis only when given; either way it names the x\n * row of the tooltip and the x column of the data table, which fall back to\n * `scatterChart.x` (\"X\").\n */\n readonly xLabel = input<string | null>(null);\n\n /**\n * The y axis' name. Drawn above the axis only when given; either way it names the y\n * row of the tooltip and the y column of the data table, which fall back to\n * `scatterChart.y` (\"Y\").\n */\n readonly yLabel = input<string | null>(null);\n\n /**\n * What a point's `size` measures. It names the size row of the tooltip and the size\n * column of the data table, which appear only when a point has a size, and falls back\n * to `scatterChart.size` (\"Size\").\n */\n readonly sizeLabel = input<string | null>(null);\n\n protected readonly xName = useI18nText(this.xLabel, 'scatterChart.x', 'X');\n protected readonly yName = useI18nText(this.yLabel, 'scatterChart.y', 'Y');\n protected readonly sizeName = useI18nText(this.sizeLabel, 'scatterChart.size', 'Size');\n\n /**\n * Writes every number the chart shows — the axis ticks, the tooltip and the data table —\n * and is told which number it is writing: `'x'`, `'y'` or `'size'`, so the two axes can\n * carry different units. A `(value) => string` written for another chart fits too. `null`\n * uses `Intl.NumberFormat` in `LOCALE_ID`, with compact ticks (`1.2K`, `3.4M`) unless the\n * full numbers are shorter.\n */\n readonly valueFormat = input<((value: number, axis: WrScatterAxis) => string) | null>(null);\n\n /** The exact figures and the axes' compact ticks, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers<[WrScatterAxis]>(this.valueFormat);\n\n /** The row headers of points with no `label`, which number them in the reader's own digits. */\n private readonly ordinals = new Intl.NumberFormat(inject(LOCALE_ID));\n\n /** The plot's height in px, at least 80. @default 240 */\n readonly height = input(240, { transform: (v: unknown): number => Math.max(80, coerceNumberProperty(v, 240)) });\n\n /** Show the gridlines and the tick labels of both axes. @default true */\n readonly showGrid = input(true, { transform: coerceBooleanProperty });\n\n /** Show the legend above the chart. @default true */\n readonly showLegend = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Make each legend row a toggle button that shows and hides its series, through\n * `hiddenSeries`. A row is a `<button aria-pressed>`, pressed while its series is\n * shown, so the legend becomes one tab stop per series. @default false\n */\n readonly toggleableLegend = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The positions in `series` of the series that are hidden. Positions rather than\n * labels, since two series may share a label. A toggleable legend writes it, and a host\n * may bind it with or without one: `[(hiddenSeries)]`.\n *\n * A hidden series is left out of everything that reads its values: it draws no points,\n * the tooltip cannot land on them, the data table drops its rows, and both axes and the\n * bubble scale are fitted to the series still shown, so hiding an outlier lets the rest\n * fill the plot. Its legend row stays, struck through, so it can be shown again. With\n * every series hidden the plot is the empty 0 to 1 frame. A position past the end of\n * `series` is kept and ignored.\n */\n readonly hiddenSeries = model<readonly number[]>([]);\n\n /** Show a tooltip with the series, x, y and size of the point under the pointer. Pointer only. @default true */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Render every point's values as a table only assistive technology reaches, beside the\n * drawing: one group of rows per series shown, headed by the series' name, a row per\n * point, and a column for x, for y and, when a point has one, for size. The drawing is\n * one named image, so without it the values are nowhere a screen reader can walk.\n * @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The radius, in px, the largest `size` shown is drawn at. Every other sized point is\n * scaled by AREA against it — a point of half the size has half the area, not half the\n * radius — and none is drawn under 4px. At least 4. @default 20\n */\n readonly maxRadius = input(20, {\n transform: (v: unknown): number => Math.max(MIN_RADIUS, coerceNumberProperty(v, 20)),\n });\n\n private readonly svg = viewChild<ElementRef<SVGSVGElement>>('svg');\n\n /**\n * Every series, resolved: its palette colour, its marker shape, and its points with\n * every one dropped whose `x` or `y` is not a finite number. Hidden ones included, since\n * the legend lists them.\n *\n * A point that cannot be placed is left out rather than kept: one NaN in the pooled\n * minimum makes every coordinate in every series NaN, and the whole chart vanishes\n * instead of one point. A point keeps its position in its series' `data` all the same,\n * so the data table numbers the rest as the consumer numbered them.\n */\n protected readonly resolvedSeries = computed(() =>\n this.series().map((s, index) => ({\n index,\n label: s.label,\n color: s.color ?? wrChartColor(index),\n marker: wrChartMarker(index),\n points: s.data.flatMap((p, i) =>\n Number.isFinite(p.x) && Number.isFinite(p.y)\n ? [\n {\n n: i + 1,\n x: p.x,\n y: p.y,\n size: typeof p.size === 'number' && Number.isFinite(p.size) && p.size >= 0 ? p.size : null,\n label: p.label ?? null,\n },\n ]\n : []\n ),\n }))\n );\n\n /** The legend's rows: every series, keyed by its own marker. */\n protected readonly legendItems = computed<readonly WrChartLegendItem[]>(() =>\n this.resolvedSeries().map(({ label, color, marker }) => ({ label, color, marker }))\n );\n\n /** The series drawn, read and fitted to: every one `hiddenSeries` does not name. */\n protected readonly visibleSeries = computed(() => {\n const hidden = new Set(this.hiddenSeries());\n return this.resolvedSeries().filter(s => !hidden.has(s.index));\n });\n\n /** The largest `size` among the points shown, or `null` when none has one — a plain scatter. */\n private readonly maxSize = computed(() => {\n let max: number | null = null;\n for (const s of this.visibleSeries())\n for (const p of s.points) if (p.size !== null) max = Math.max(max ?? 0, p.size);\n return max;\n });\n\n /** Whether any point shown has a size, which adds the size row and column. */\n protected readonly sized = computed(() => this.maxSize() !== null);\n\n /**\n * The x axis, from `wrChartAxis` over the points shown: fitted to the data with no zero\n * forced in, since a scatter has no baseline, snapped outward at both ends and lifted a\n * step at EITHER end a point would sit on (`symmetric`), so no point lands exactly on\n * the frame. A single value — one point, or a column of them — is centred with a step\n * either side. With nothing to fit, the 0 to 1 frame.\n */\n protected readonly xAxis = computed(() => this.fit(p => p.x));\n\n /** The y axis, fitted the way {@link xAxis} is. */\n protected readonly yAxis = computed(() => this.fit(p => p.y));\n\n /**\n * The points as drawn: placed by percentage on both axes, sized, and ordered LARGEST\n * FIRST so a small bubble is never buried under a large one. Points of equal size keep\n * the series' order, so a plain scatter draws series by series.\n */\n protected readonly points = computed<readonly DrawnPoint[]>(() => {\n const x = this.xAxis();\n const y = this.yAxis();\n const maxSize = this.maxSize();\n const maxRadius = this.maxRadius();\n const drawn = this.visibleSeries().flatMap(s =>\n s.points.map(p => {\n const r =\n p.size === null || maxSize === null\n ? POINT_RADIUS\n : Math.max(MIN_RADIUS, maxRadius * Math.sqrt(maxSize > 0 ? p.size / maxSize : 0));\n const halo = wrChartMarkerExtent(s.marker, r + HALO_GAP);\n return {\n key: `${s.index}:${p.n}`,\n series: s.index,\n seriesLabel: s.label,\n color: s.color,\n marker: s.marker,\n n: p.n,\n x: p.x,\n y: p.y,\n size: p.size,\n label: p.label,\n left: percent(((p.x - x.min) / (x.max - x.min)) * 100),\n top: percent(((y.max - p.y) / (y.max - y.min)) * 100),\n r,\n d: wrChartMarkerPath(s.marker, r),\n halo,\n };\n })\n );\n return drawn.sort((a, b) => b.r - a.r);\n });\n\n /**\n * How far the largest marker drawn reaches past its centre, in px, sideways and up or\n * down — its hover ring included, so hovering moves nothing. The axes keep a point\n * off the frame only when it lands exactly on it, and one a fraction of a step inside\n * sits a few px from it; the stylesheet takes the larger of this and the plot's inset\n * tokens as the plot's padding, so the marker stays inside the plot rather than over\n * the tick labels or past the chart's own box. By SHAPE, not radius: a triangle's\n * point reaches 1.56 times its radius up. The ring's stroke is the stylesheet's.\n *\n * Up or down it is held to a quarter of `height`, so a short plot with a large\n * `maxRadius` keeps half its height for the drawing and lets the marker overhang.\n */\n protected readonly reach = computed(() => {\n let x = 0;\n let y = 0;\n for (const { halo } of this.points()) {\n x = Math.max(x, halo.side);\n y = Math.max(y, halo.top, halo.bottom);\n }\n return { x: wrRound(x, 3), y: wrRound(Math.min(y, this.height() / 4), 3) };\n });\n\n /** The y ticks, top to bottom: each value's label and its gridline's distance from the top, in percent. */\n protected readonly yTicks = computed(() => {\n const { min, max, step, ticks } = this.yAxis();\n const labels = this.numbers.ticks(ticks, step, 'y');\n return ticks.map((value, i) => ({ label: labels[i], top: percent(((max - value) / (max - min)) * 100) }));\n });\n\n /** The x ticks, left to right: each value's label and its gridline's distance from the left, in percent. */\n protected readonly xTicks = computed(() => {\n const { min, max, step, ticks } = this.xAxis();\n const values = [...ticks].reverse();\n const labels = this.numbers.ticks(values, step, 'x');\n return values.map((value, i) => ({ label: labels[i], left: percent(((value - min) / (max - min)) * 100) }));\n });\n\n /**\n * How far apart two neighbouring x ticks are, as a percentage of the drawing's width —\n * the room each tick label has, half on either side of its gridline, which the\n * stylesheet bounds it to and ellipsises past.\n */\n protected readonly xSlot = computed(() => {\n const count = this.xTicks().length;\n return count <= 1 ? 100 : percent(100 / (count - 1));\n });\n\n /**\n * One tooltip for the point under the pointer: the series' swatch and name with the\n * point's own label as its heading, then a row each for x, y and size. It points at\n * the box of the marker's hover ring from above, so the chip clears a large bubble and\n * a triangle's point rather than sitting on its centre.\n *\n * Points are found by POSITION — the nearest within 16px of the pointer, or anywhere a\n * larger marker reaches — so a point under the open chip can still be reached by\n * moving onto it, the way a sparkline is scrubbed.\n */\n protected readonly tip = useChartTooltip(\n this.tooltip,\n index => {\n const point = this.points()[index];\n const svg = this.svg()?.nativeElement;\n if (!point || !svg) return null;\n const box = svg.getBoundingClientRect();\n const x = box.left + (point.left / 100) * box.width;\n const y = box.top + (point.top / 100) * box.height;\n const rows: WrChartTooltipRow[] = [\n { label: this.xName(), value: this.numbers.value(point.x, 'x') },\n { label: this.yName(), value: this.numbers.value(point.y, 'y') },\n ];\n if (point.size !== null) rows.push({ label: this.sizeName(), value: this.numbers.value(point.size, 'size') });\n return {\n datum: { label: point.seriesLabel, value: point.label ?? '', color: point.color, rows },\n anchor: {\n x: x - point.halo.side,\n y: y - point.halo.top,\n width: point.halo.side * 2,\n height: point.halo.top + point.halo.bottom,\n },\n };\n },\n (x, y) => this.pointAt(x, y)\n );\n\n /** The point the tooltip is reading, ringed in the drawing. */\n protected readonly activePoint = computed(() => {\n const index = this.tip.active();\n return index === null ? null : (this.points()[index] ?? null);\n });\n\n /** The ring round the hovered point: its own shape, a little larger. */\n protected readonly haloPath = computed(() => {\n const point = this.activePoint();\n return point ? wrChartMarkerPath(point.marker, point.r + HALO_GAP) : '';\n });\n\n /**\n * The figures for `dataTable`: the chart's name as the caption, one group per series\n * shown and headed by its name, and a row per point headed by the point's `label` or\n * its position in the series. Every value is written as the tooltip writes it; a point\n * with no size has an empty size cell in a chart where others have one.\n */\n protected readonly tableData = computed<WrChartTableData>(() => {\n const sized = this.sized();\n const value = (v: number, axis: WrScatterAxis): string => this.numbers.value(v, axis);\n return {\n caption: this.resolvedAriaLabel(),\n columns: sized ? [this.xName(), this.yName(), this.sizeName()] : [this.xName(), this.yName()],\n groups: this.visibleSeries().map(s => ({\n header: s.label,\n rows: s.points.map(p => {\n const cells = [value(p.x, 'x'), value(p.y, 'y')];\n if (sized) cells.push(p.size === null ? '' : value(p.size, 'size'));\n return { header: p.label ?? this.ordinals.format(p.n), cells };\n }),\n })),\n };\n });\n\n /**\n * The point under the pointer. A MOUSE event, as every chart's is: a tap fires the\n * compatibility `mousemove` and no `pointermove`. Off every point, the open tooltip\n * starts its grace period.\n */\n protected onPointerMove(event: MouseEvent): void {\n if (!this.tooltip()) return;\n const index = this.pointAt(event.clientX, event.clientY);\n if (index === null) this.tip.leave(event);\n else this.tip.enter(index);\n }\n\n /**\n * The point nearest a viewport position: within 16px of its centre, or within the\n * circle its hover ring fits in where that is larger — a triangle's point or a\n * diamond's tips reach past its radius — and the nearest centre where several qualify.\n * A drawing with no box (nothing laid out yet) answers nothing.\n */\n private pointAt(clientX: number, clientY: number): number | null {\n const svg = this.svg()?.nativeElement;\n if (!svg) return null;\n const box = svg.getBoundingClientRect();\n if (box.width <= 0 || box.height <= 0) return null;\n let best: number | null = null;\n let nearest = Number.POSITIVE_INFINITY;\n this.points().forEach((point, index) => {\n const distance = Math.hypot(\n box.left + (point.left / 100) * box.width - clientX,\n box.top + (point.top / 100) * box.height - clientY\n );\n if (distance <= Math.max(HIT_RADIUS, point.halo.radius) && distance < nearest) {\n nearest = distance;\n best = index;\n }\n });\n return best;\n }\n\n /** One axis over the points shown: `wrChartAxis` with both ends kept off the data, and one value centred. */\n private fit(read: (point: { readonly x: number; readonly y: number }) => number): WrChartAxis {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n for (const s of this.visibleSeries()) {\n for (const p of s.points) {\n const v = read(p);\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n // No point at all leaves both infinite, which `wrChartAxis` answers with the empty frame;\n // one value, or a column of them, it centres between a step on either side.\n return wrChartAxis(min, max, { symmetric: true });\n }\n}\n\nexport type { WrScatterAxis, WrScatterPoint, WrScatterSeries } from './types';\n","@let active = activePoint();\n@if (showLegend() && resolvedSeries().length > 0) {\n <!-- Every row keys its series by the series' own marker shape, the channel that tells\n the points apart where the colours do not. Rows are tracked by position, so two\n series that share a label are two rows. -->\n <ul\n wr-chart-legend\n class=\"wr-scatter-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n ></ul>\n}\n\n<!-- Two columns: the y tick labels at inline start and the drawing beside them, with the\n y axis' name above and the x tick labels and the x axis' name under the drawing\n only, so their percentages are the drawing's. -->\n<div class=\"wr-scatter-chart__body\">\n @if (yLabel()) {\n <div class=\"wr-scatter-chart__y-title\">{{ yLabel() }}</div>\n }\n\n @if (showGrid()) {\n <!-- HTML beside the drawing rather than `<text>` inside it, in flow, so the column is\n exactly as wide as the longest label; each one hands the stylesheet the y of its\n own gridline. Hidden, as the drawing is one image: its name is what is announced,\n and the values are the data table's. -->\n <div class=\"wr-scatter-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of yTicks(); track $index) {\n <span class=\"wr-scatter-chart__y-tick\" [style.--wr-scatter-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <div\n class=\"wr-scatter-chart__plot\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\n (mousemove)=\"onPointerMove($event)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n <!-- No viewBox: every position is a PERCENTAGE of the drawing, so nothing stretches.\n A viewBox with `preserveAspectRatio=\"none\"` would squash each marker with the\n drawing, a circle into an oval and a square into a bar, and a scatter's marker is\n its series' only channel besides colour. -->\n <!-- Hidden as well as presentational: `img` already makes it so, but every point is\n an `<svg>` of its own, and a tree that holds a node per point for thousands of\n them is work for nothing. -->\n <svg #svg class=\"wr-scatter-chart__svg\" aria-hidden=\"true\">\n @if (showGrid()) {\n @for (tick of yTicks(); track $index) {\n <line\n class=\"wr-scatter-chart__grid-line\"\n x1=\"0\"\n x2=\"100%\"\n [attr.y1]=\"`${tick.top}%`\"\n [attr.y2]=\"`${tick.top}%`\"\n />\n }\n @for (tick of xTicks(); track $index) {\n <line\n class=\"wr-scatter-chart__grid-line wr-scatter-chart__grid-line--x\"\n [attr.x1]=\"`${tick.left}%`\"\n [attr.x2]=\"`${tick.left}%`\"\n y1=\"0\"\n y2=\"100%\"\n />\n }\n }\n\n @for (p of points(); track p.key) {\n <!-- A nested `<svg>` placed by percentage, its marker drawn about its origin in\n px: an SVG's `x` and `y` take a percentage where a `transform` does not, so\n the marker sits on its point at any size and keeps its own. Its viewport is\n the drawing's whole box, painted nowhere, and `overflow` lets the marker\n reach outside it. -->\n <svg\n class=\"wr-scatter-chart__point\"\n [attr.x]=\"`${p.left}%`\"\n [attr.y]=\"`${p.top}%`\"\n overflow=\"visible\"\n [attr.data-series]=\"p.series\"\n [attr.data-x]=\"p.x\"\n [attr.data-y]=\"p.y\"\n [attr.data-size]=\"p.size\"\n [attr.data-radius]=\"p.r\"\n [attr.data-marker]=\"p.marker\"\n >\n <path class=\"wr-scatter-chart__marker\" [attr.d]=\"p.d\" [attr.fill]=\"p.color\" />\n </svg>\n }\n\n @if (active) {\n <!-- A ring of the point's own shape just outside it, so the reading is marked by\n outline as well as by the tooltip's arrow. -->\n <svg class=\"wr-scatter-chart__halo\" [attr.x]=\"`${active.left}%`\" [attr.y]=\"`${active.top}%`\" overflow=\"visible\">\n <path [attr.d]=\"haloPath()\" fill=\"none\" [attr.stroke]=\"active.color\" />\n </svg>\n }\n </svg>\n </div>\n\n @if (showGrid()) {\n <!-- The strip is as wide as the plot, and hands the stylesheet the distance between\n two ticks; each label hands it the x of its gridline, as a percentage of the\n drawing's width. -->\n <div class=\"wr-scatter-chart__x-axis\" aria-hidden=\"true\" [style.--wr-scatter-chart-x-slot]=\"xSlot()\">\n @for (tick of xTicks(); track $index) {\n <span class=\"wr-scatter-chart__x-tick\" [style.--wr-scatter-chart-x]=\"tick.left\">{{ tick.label }}</span>\n }\n </div>\n }\n\n @if (xLabel()) {\n <div class=\"wr-scatter-chart__x-title\">{{ xLabel() }}</div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the plot's `img` and never inside it:\n `img` makes everything it holds presentational. Clipped to nothing by its own\n stylesheet, so it takes no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;;AAyCA,MAAM,eAAe;AAGrB,MAAM,aAAa;AAGnB,MAAM,aAAa;AAGnB,MAAM,WAAW;AAGjB,MAAM,WAAW,UAA0B,KAAK,MAAM,QAAQ,GAAI,IAAI;AA8EtE,IAAa,iBAAb,MAAa,eAAc;CACzB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,sBAAsB;CACzF;CAOS,SAAS,MAAkC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAO9C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A;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,KAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAK,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"ngwr-charts-scatter-chart.mjs","names":[],"sources":["../../../projects/lib/charts/scatter-chart/scatter-chart.ts","../../../projects/lib/charts/scatter-chart/scatter-chart.html"],"sourcesContent":["/**\n * @license\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE\n */\n\nimport { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';\nimport {\n Component,\n type ElementRef,\n LOCALE_ID,\n ViewEncapsulation,\n computed,\n inject,\n input,\n model,\n viewChild,\n} from '@angular/core';\n\nimport { WrChartLegend, type WrChartLegendItem } from 'ngwr/charts/chart-legend';\nimport {\n type WrChartAxis,\n type WrChartMarkerExtent,\n type WrChartMarkerShape,\n WrChartTable,\n type WrChartTableData,\n wrChartAxis,\n wrChartColor,\n wrChartMarker,\n wrChartMarkerExtent,\n wrChartMarkerPath,\n useChartNumbers,\n} from 'ngwr/charts/core';\nimport { useI18nText } from 'ngwr/i18n';\nimport { type WrChartTooltipRow, useChartTooltip } from 'ngwr/popover';\nimport { wrRound, wrCheckStyles } from 'ngwr/utils';\n\nimport type { WrScatterAxis, WrScatterSeries } from './types';\n\n/** The radius, in px, of a point with no `size`: a marker as large as a 10px circle. */\nconst POINT_RADIUS = 5;\n\n/** The smallest radius a sized point is drawn at, in px, however small its size: still a mark, still hoverable. */\nconst MIN_RADIUS = 4;\n\n/** How far from a marker's centre, in px, the pointer still reads that point — or as far as the marker reaches, if farther. */\nconst HIT_RADIUS = 16;\n\n/** How far outside its marker the hovered point's ring is drawn, in px. */\nconst HALO_GAP = 3;\n\n/** A percentage to three decimals, so an attribute stays short. */\nconst percent = (value: number): number => Math.round(value * 1000) / 1000;\n\n/** One point as the chart draws it: its data, where it sits and how large it is. */\ninterface DrawnPoint {\n /** Its series' position and its own position in that series' `data`, which no other point shares. */\n readonly key: string;\n /** Its series' position in `series`. */\n readonly series: number;\n readonly seriesLabel: string;\n readonly color: string;\n readonly marker: WrChartMarkerShape;\n /** Its position in its series' `data`, from 1: the row header of a point with no `label`. */\n readonly n: number;\n readonly x: number;\n readonly y: number;\n readonly size: number | null;\n readonly label: string | null;\n /** Its centre, as percentages of the drawing's width from the left and height from the top. */\n readonly left: number;\n readonly top: number;\n /** Its radius in px. */\n readonly r: number;\n /** Its marker's path about the origin. */\n readonly d: string;\n /** How far its hover ring reaches from its centre, in px: what the tooltip points at and the pointer reads. */\n readonly halo: WrChartMarkerExtent;\n}\n\n/**\n * Points on two numeric axes: one series per marker shape, and an optional third value\n * drawn as each point's area, which makes it a bubble chart. SVG-only — no external\n * dependency.\n *\n * @example\n * ```html\n * <wr-scatter-chart\n * xLabel=\"Price\"\n * yLabel=\"Rating\"\n * [series]=\"[\n * { label: 'Laptops', data: [{ x: 899, y: 4.1 }, { x: 1299, y: 4.6 }] },\n * { label: 'Tablets', data: [{ x: 329, y: 3.9 }, { x: 599, y: 4.4 }] }\n * ]\"\n * />\n * ```\n *\n * Each series is told apart by its marker's SHAPE as well as its colour — a circle, a\n * square, a triangle, a diamond, a cross, a downward triangle — since the palette's\n * colours sit too close in lightness to be read alone. Neither axis is forced to include\n * zero: each is fitted to its data and snapped outward to a readable step, so no point\n * lands exactly on the frame, and a single value sits in the middle with a step either\n * side. A point can still sit a hair inside the frame, so the plot's padding grows to\n * the largest marker drawn, and a bubble at the edge stays inside the chart's own box.\n *\n * The drawing is one named `role=\"img\"` and takes no tab stop; the tooltip is pointer\n * only. `dataTable` renders every value as a table only assistive technology reaches.\n * The legend is a `ul[wr-chart-legend]` (`ngwr/charts/chart-legend`), and with\n * `toggleableLegend` its rows show and hide their series through `hiddenSeries`.\n *\n * Hovering finds the nearest point by measuring every one, so a chart meant for more\n * than a few thousand points is better served by binning them first.\n *\n * @see https://ngwr.dev/charts/scatter-chart\n */\n@Component({\n selector: 'wr-scatter-chart',\n templateUrl: './scatter-chart.html',\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'wr-scatter-chart',\n // A bubble chart's markers overlap as a rule, so they are drawn see-through.\n '[class.wr-scatter-chart--bubbles]': 'sized()',\n // How far the largest marker reaches, ring included: the stylesheet grows the plot's\n // padding to it, so a marker on the frame stays inside the plot.\n '[style.--wr-scatter-chart-reach-x]': 'reach().x',\n '[style.--wr-scatter-chart-reach-y]': 'reach().y',\n },\n imports: [WrChartLegend, WrChartTable],\n})\nexport class WrScatterChart {\n constructor() {\n if (typeof ngDevMode === 'undefined' || ngDevMode) wrCheckStyles('charts/scatter-chart');\n }\n\n /**\n * One entry per series. A series with no `color` takes the next entry from the chart's\n * palette, and every series takes the next marker shape, so several series are told\n * apart unconfigured.\n */\n readonly series = input<readonly WrScatterSeries[]>([]);\n\n /**\n * Accessible name of the chart. The legend carries the series NAMES only — the values\n * are nowhere in text unless `dataTable` puts them there — so say what the chart shows.\n * Falls back to `scatterChart.label` (\"Scatter chart\").\n */\n readonly ariaLabel = input<string | null>(null);\n\n protected readonly resolvedAriaLabel = useI18nText(this.ariaLabel, 'scatterChart.label', 'Scatter chart');\n\n /**\n * The x axis' name. Drawn under the axis only when given; either way it names the x\n * row of the tooltip and the x column of the data table, which fall back to\n * `scatterChart.x` (\"X\").\n */\n readonly xLabel = input<string | null>(null);\n\n /**\n * The y axis' name. Drawn above the axis only when given; either way it names the y\n * row of the tooltip and the y column of the data table, which fall back to\n * `scatterChart.y` (\"Y\").\n */\n readonly yLabel = input<string | null>(null);\n\n /**\n * What a point's `size` measures. It names the size row of the tooltip and the size\n * column of the data table, which appear only when a point has a size, and falls back\n * to `scatterChart.size` (\"Size\").\n */\n readonly sizeLabel = input<string | null>(null);\n\n protected readonly xName = useI18nText(this.xLabel, 'scatterChart.x', 'X');\n protected readonly yName = useI18nText(this.yLabel, 'scatterChart.y', 'Y');\n protected readonly sizeName = useI18nText(this.sizeLabel, 'scatterChart.size', 'Size');\n\n /**\n * Writes every number the chart shows — the axis ticks, the tooltip and the data table —\n * and is told which number it is writing: `'x'`, `'y'` or `'size'`, so the two axes can\n * carry different units. A `(value) => string` written for another chart fits too. `null`\n * uses `Intl.NumberFormat` in `LOCALE_ID`, with compact ticks (`1.2K`, `3.4M`) unless the\n * full numbers are shorter.\n */\n readonly valueFormat = input<((value: number, axis: WrScatterAxis) => string) | null>(null);\n\n /** The exact figures and the axes' compact ticks, in `LOCALE_ID` unless `valueFormat` is given. */\n private readonly numbers = useChartNumbers<[WrScatterAxis]>(this.valueFormat);\n\n /** The row headers of points with no `label`, which number them in the reader's own digits. */\n private readonly ordinals = new Intl.NumberFormat(inject(LOCALE_ID));\n\n /** The plot's height in px, at least 80. @default 240 */\n readonly height = input(240, { transform: (v: unknown): number => Math.max(80, coerceNumberProperty(v, 240)) });\n\n /** Show the gridlines and the tick labels of both axes. @default true */\n readonly showGrid = input(true, { transform: coerceBooleanProperty });\n\n /** Show the legend above the chart. @default true */\n readonly showLegend = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Make each legend row a toggle button that shows and hides its series, through\n * `hiddenSeries`. A row is a `<button aria-pressed>`, pressed while its series is\n * shown, so the legend becomes one tab stop per series. @default false\n */\n readonly toggleableLegend = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The positions in `series` of the series that are hidden. Positions rather than\n * labels, since two series may share a label. A toggleable legend writes it, and a host\n * may bind it with or without one: `[(hiddenSeries)]`.\n *\n * A hidden series is left out of everything that reads its values: it draws no points,\n * the tooltip cannot land on them, the data table drops its rows, and both axes and the\n * bubble scale are fitted to the series still shown, so hiding an outlier lets the rest\n * fill the plot. Its legend row stays, struck through, so it can be shown again. With\n * every series hidden the plot is the empty 0 to 1 frame. A position past the end of\n * `series` is kept and ignored.\n */\n readonly hiddenSeries = model<readonly number[]>([]);\n\n /** Show a tooltip with the series, x, y and size of the point under the pointer. Pointer only. @default true */\n readonly tooltip = input(true, { transform: coerceBooleanProperty });\n\n /**\n * Render every point's values as a table only assistive technology reaches, beside the\n * drawing: one group of rows per series shown, headed by the series' name, a row per\n * point, and a column for x, for y and, when a point has one, for size. The drawing is\n * one named image, so without it the values are nowhere a screen reader can walk.\n * @default false\n */\n readonly dataTable = input(false, { transform: coerceBooleanProperty });\n\n /**\n * The radius, in px, the largest `size` shown is drawn at. Every other sized point is\n * scaled by AREA against it — a point of half the size has half the area, not half the\n * radius — and none is drawn under 4px. At least 4. @default 20\n */\n readonly maxRadius = input(20, {\n transform: (v: unknown): number => Math.max(MIN_RADIUS, coerceNumberProperty(v, 20)),\n });\n\n private readonly svg = viewChild<ElementRef<SVGSVGElement>>('svg');\n\n /**\n * Every series, resolved: its palette colour, its marker shape, and its points with\n * every one dropped whose `x` or `y` is not a finite number. Hidden ones included, since\n * the legend lists them.\n *\n * A point that cannot be placed is left out rather than kept: one NaN in the pooled\n * minimum makes every coordinate in every series NaN, and the whole chart vanishes\n * instead of one point. A point keeps its position in its series' `data` all the same,\n * so the data table numbers the rest as the consumer numbered them.\n */\n protected readonly resolvedSeries = computed(() =>\n this.series().map((s, index) => ({\n index,\n label: s.label,\n color: s.color ?? wrChartColor(index),\n marker: wrChartMarker(index),\n points: s.data.flatMap((p, i) =>\n Number.isFinite(p.x) && Number.isFinite(p.y)\n ? [\n {\n n: i + 1,\n x: p.x,\n y: p.y,\n size: typeof p.size === 'number' && Number.isFinite(p.size) && p.size >= 0 ? p.size : null,\n label: p.label ?? null,\n },\n ]\n : []\n ),\n }))\n );\n\n /** The legend's rows: every series, keyed by its own marker. */\n protected readonly legendItems = computed<readonly WrChartLegendItem[]>(() =>\n this.resolvedSeries().map(({ label, color, marker }) => ({ label, color, marker }))\n );\n\n /** The series drawn, read and fitted to: every one `hiddenSeries` does not name. */\n protected readonly visibleSeries = computed(() => {\n const hidden = new Set(this.hiddenSeries());\n return this.resolvedSeries().filter(s => !hidden.has(s.index));\n });\n\n /** The largest `size` among the points shown, or `null` when none has one — a plain scatter. */\n private readonly maxSize = computed(() => {\n let max: number | null = null;\n for (const s of this.visibleSeries())\n for (const p of s.points) if (p.size !== null) max = Math.max(max ?? 0, p.size);\n return max;\n });\n\n /** Whether any point shown has a size, which adds the size row and column. */\n protected readonly sized = computed(() => this.maxSize() !== null);\n\n /**\n * The x axis, from `wrChartAxis` over the points shown: fitted to the data with no zero\n * forced in, since a scatter has no baseline, snapped outward at both ends and lifted a\n * step at EITHER end a point would sit on (`symmetric`), so no point lands exactly on\n * the frame. A single value — one point, or a column of them — is centred with a step\n * either side. With nothing to fit, the 0 to 1 frame.\n */\n protected readonly xAxis = computed(() => this.fit(p => p.x));\n\n /** The y axis, fitted the way {@link xAxis} is. */\n protected readonly yAxis = computed(() => this.fit(p => p.y));\n\n /**\n * The points as drawn: placed by percentage on both axes, sized, and ordered LARGEST\n * FIRST so a small bubble is never buried under a large one. Points of equal size keep\n * the series' order, so a plain scatter draws series by series.\n */\n protected readonly points = computed<readonly DrawnPoint[]>(() => {\n const x = this.xAxis();\n const y = this.yAxis();\n const maxSize = this.maxSize();\n const maxRadius = this.maxRadius();\n const drawn = this.visibleSeries().flatMap(s =>\n s.points.map(p => {\n const r =\n p.size === null || maxSize === null\n ? POINT_RADIUS\n : Math.max(MIN_RADIUS, maxRadius * Math.sqrt(maxSize > 0 ? p.size / maxSize : 0));\n const halo = wrChartMarkerExtent(s.marker, r + HALO_GAP);\n return {\n key: `${s.index}:${p.n}`,\n series: s.index,\n seriesLabel: s.label,\n color: s.color,\n marker: s.marker,\n n: p.n,\n x: p.x,\n y: p.y,\n size: p.size,\n label: p.label,\n left: percent(((p.x - x.min) / (x.max - x.min)) * 100),\n top: percent(((y.max - p.y) / (y.max - y.min)) * 100),\n r,\n d: wrChartMarkerPath(s.marker, r),\n halo,\n };\n })\n );\n return drawn.sort((a, b) => b.r - a.r);\n });\n\n /**\n * How far the largest marker drawn reaches past its centre, in px, sideways and up or\n * down — its hover ring included, so hovering moves nothing. The axes keep a point\n * off the frame only when it lands exactly on it, and one a fraction of a step inside\n * sits a few px from it; the stylesheet takes the larger of this and the plot's inset\n * tokens as the plot's padding, so the marker stays inside the plot rather than over\n * the tick labels or past the chart's own box. By SHAPE, not radius: a triangle's\n * point reaches 1.56 times its radius up. The ring's stroke is the stylesheet's.\n *\n * Up or down it is held to a quarter of `height`, so a short plot with a large\n * `maxRadius` keeps half its height for the drawing and lets the marker overhang.\n */\n protected readonly reach = computed(() => {\n let x = 0;\n let y = 0;\n for (const { halo } of this.points()) {\n x = Math.max(x, halo.side);\n y = Math.max(y, halo.top, halo.bottom);\n }\n return { x: wrRound(x, 3), y: wrRound(Math.min(y, this.height() / 4), 3) };\n });\n\n /** The y ticks, top to bottom: each value's label and its gridline's distance from the top, in percent. */\n protected readonly yTicks = computed(() => {\n const { min, max, step, ticks } = this.yAxis();\n const labels = this.numbers.ticks(ticks, step, 'y');\n return ticks.map((value, i) => ({ label: labels[i], top: percent(((max - value) / (max - min)) * 100) }));\n });\n\n /** The x ticks, left to right: each value's label and its gridline's distance from the left, in percent. */\n protected readonly xTicks = computed(() => {\n const { min, max, step, ticks } = this.xAxis();\n const values = [...ticks].reverse();\n const labels = this.numbers.ticks(values, step, 'x');\n return values.map((value, i) => ({ label: labels[i], left: percent(((value - min) / (max - min)) * 100) }));\n });\n\n /**\n * How far apart two neighbouring x ticks are, as a percentage of the drawing's width —\n * the room each tick label has, half on either side of its gridline, which the\n * stylesheet bounds it to and ellipsises past.\n */\n protected readonly xSlot = computed(() => {\n const count = this.xTicks().length;\n return count <= 1 ? 100 : percent(100 / (count - 1));\n });\n\n /**\n * One tooltip for the point under the pointer: the series' swatch and name with the\n * point's own label as its heading, then a row each for x, y and size. It points at\n * the box of the marker's hover ring from above, so the chip clears a large bubble and\n * a triangle's point rather than sitting on its centre.\n *\n * Points are found by POSITION — the nearest within 16px of the pointer, or anywhere a\n * larger marker reaches — so a point under the open chip can still be reached by\n * moving onto it, the way a sparkline is scrubbed.\n */\n protected readonly tip = useChartTooltip(\n this.tooltip,\n index => {\n const point = this.points()[index];\n const svg = this.svg()?.nativeElement;\n if (!point || !svg) return null;\n const box = svg.getBoundingClientRect();\n const x = box.left + (point.left / 100) * box.width;\n const y = box.top + (point.top / 100) * box.height;\n const rows: WrChartTooltipRow[] = [\n { label: this.xName(), value: this.numbers.value(point.x, 'x') },\n { label: this.yName(), value: this.numbers.value(point.y, 'y') },\n ];\n if (point.size !== null) rows.push({ label: this.sizeName(), value: this.numbers.value(point.size, 'size') });\n return {\n datum: { label: point.seriesLabel, value: point.label ?? '', color: point.color, rows },\n anchor: {\n x: x - point.halo.side,\n y: y - point.halo.top,\n width: point.halo.side * 2,\n height: point.halo.top + point.halo.bottom,\n },\n };\n },\n (x, y) => this.pointAt(x, y)\n );\n\n /** The point the tooltip is reading, ringed in the drawing. */\n protected readonly activePoint = computed(() => {\n const index = this.tip.active();\n return index === null ? null : (this.points()[index] ?? null);\n });\n\n /** The ring round the hovered point: its own shape, a little larger. */\n protected readonly haloPath = computed(() => {\n const point = this.activePoint();\n return point ? wrChartMarkerPath(point.marker, point.r + HALO_GAP) : '';\n });\n\n /**\n * The figures for `dataTable`: the chart's name as the caption, one group per series\n * shown and headed by its name, and a row per point headed by the point's `label` or\n * its position in the series. Every value is written as the tooltip writes it; a point\n * with no size has an empty size cell in a chart where others have one.\n */\n protected readonly tableData = computed<WrChartTableData>(() => {\n const sized = this.sized();\n const value = (v: number, axis: WrScatterAxis): string => this.numbers.value(v, axis);\n return {\n caption: this.resolvedAriaLabel(),\n columns: sized ? [this.xName(), this.yName(), this.sizeName()] : [this.xName(), this.yName()],\n groups: this.visibleSeries().map(s => ({\n header: s.label,\n rows: s.points.map(p => {\n const cells = [value(p.x, 'x'), value(p.y, 'y')];\n if (sized) cells.push(p.size === null ? '' : value(p.size, 'size'));\n return { header: p.label ?? this.ordinals.format(p.n), cells };\n }),\n })),\n };\n });\n\n /**\n * The point under the pointer. A MOUSE event, as every chart's is: a tap fires the\n * compatibility `mousemove` and no `pointermove`. Off every point, the open tooltip\n * starts its grace period.\n */\n protected onPointerMove(event: MouseEvent): void {\n if (!this.tooltip()) return;\n const index = this.pointAt(event.clientX, event.clientY);\n if (index === null) this.tip.leave(event);\n else this.tip.enter(index);\n }\n\n /**\n * The point nearest a viewport position: within 16px of its centre, or within the\n * circle its hover ring fits in where that is larger — a triangle's point or a\n * diamond's tips reach past its radius — and the nearest centre where several qualify.\n * A drawing with no box (nothing laid out yet) answers nothing.\n */\n private pointAt(clientX: number, clientY: number): number | null {\n const svg = this.svg()?.nativeElement;\n if (!svg) return null;\n const box = svg.getBoundingClientRect();\n if (box.width <= 0 || box.height <= 0) return null;\n let best: number | null = null;\n let nearest = Number.POSITIVE_INFINITY;\n this.points().forEach((point, index) => {\n const distance = Math.hypot(\n box.left + (point.left / 100) * box.width - clientX,\n box.top + (point.top / 100) * box.height - clientY\n );\n if (distance <= Math.max(HIT_RADIUS, point.halo.radius) && distance < nearest) {\n nearest = distance;\n best = index;\n }\n });\n return best;\n }\n\n /** One axis over the points shown: `wrChartAxis` with both ends kept off the data, and one value centred. */\n private fit(read: (point: { readonly x: number; readonly y: number }) => number): WrChartAxis {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n for (const s of this.visibleSeries()) {\n for (const p of s.points) {\n const v = read(p);\n if (v < min) min = v;\n if (v > max) max = v;\n }\n }\n // No point at all leaves both infinite, which `wrChartAxis` answers with the empty frame;\n // one value, or a column of them, it centres between a step on either side.\n return wrChartAxis(min, max, { symmetric: true });\n }\n}\n\nexport type { WrScatterAxis, WrScatterPoint, WrScatterSeries } from './types';\n","@let active = activePoint();\n@if (showLegend() && resolvedSeries().length > 0) {\n <!-- Every row keys its series by the series' own marker shape, the channel that tells\n the points apart where the colours do not. Rows are tracked by position, so two\n series that share a label are two rows. -->\n <ul\n wr-chart-legend\n class=\"wr-scatter-chart__legend\"\n [items]=\"legendItems()\"\n [toggleable]=\"toggleableLegend()\"\n [(hiddenSeries)]=\"hiddenSeries\"\n ></ul>\n}\n\n<!-- Two columns: the y tick labels at inline start and the drawing beside them, with the\n y axis' name above and the x tick labels and the x axis' name under the drawing\n only, so their percentages are the drawing's. -->\n<div class=\"wr-scatter-chart__body\">\n @if (yLabel()) {\n <div class=\"wr-scatter-chart__y-title\">{{ yLabel() }}</div>\n }\n\n @if (showGrid()) {\n <!-- HTML beside the drawing rather than `<text>` inside it, in flow, so the column is\n exactly as wide as the longest label; each one hands the stylesheet the y of its\n own gridline. Hidden, as the drawing is one image: its name is what is announced,\n and the values are the data table's. -->\n <div class=\"wr-scatter-chart__y-axis\" aria-hidden=\"true\">\n @for (tick of yTicks(); track $index) {\n <span class=\"wr-scatter-chart__y-tick\" [style.--wr-scatter-chart-y]=\"tick.top\">{{ tick.label }}</span>\n }\n </div>\n }\n\n <div\n class=\"wr-scatter-chart__plot\"\n role=\"img\"\n [attr.aria-label]=\"resolvedAriaLabel()\"\n [style.height.px]=\"height()\"\n (mousemove)=\"onPointerMove($event)\"\n (mouseleave)=\"tip.leave($event)\"\n >\n <!-- No viewBox: every position is a PERCENTAGE of the drawing, so nothing stretches.\n A viewBox with `preserveAspectRatio=\"none\"` would squash each marker with the\n drawing, a circle into an oval and a square into a bar, and a scatter's marker is\n its series' only channel besides colour. -->\n <!-- Hidden as well as presentational: `img` already makes it so, but every point is\n an `<svg>` of its own, and a tree that holds a node per point for thousands of\n them is work for nothing. -->\n <svg #svg class=\"wr-scatter-chart__svg\" aria-hidden=\"true\">\n @if (showGrid()) {\n @for (tick of yTicks(); track $index) {\n <line\n class=\"wr-scatter-chart__grid-line\"\n x1=\"0\"\n x2=\"100%\"\n [attr.y1]=\"`${tick.top}%`\"\n [attr.y2]=\"`${tick.top}%`\"\n />\n }\n @for (tick of xTicks(); track $index) {\n <line\n class=\"wr-scatter-chart__grid-line wr-scatter-chart__grid-line--x\"\n [attr.x1]=\"`${tick.left}%`\"\n [attr.x2]=\"`${tick.left}%`\"\n y1=\"0\"\n y2=\"100%\"\n />\n }\n }\n\n @for (p of points(); track p.key) {\n <!-- A nested `<svg>` placed by percentage, its marker drawn about its origin in\n px: an SVG's `x` and `y` take a percentage where a `transform` does not, so\n the marker sits on its point at any size and keeps its own. Its viewport is\n the drawing's whole box, painted nowhere, and `overflow` lets the marker\n reach outside it. -->\n <svg\n class=\"wr-scatter-chart__point\"\n [attr.x]=\"`${p.left}%`\"\n [attr.y]=\"`${p.top}%`\"\n overflow=\"visible\"\n [attr.data-series]=\"p.series\"\n [attr.data-x]=\"p.x\"\n [attr.data-y]=\"p.y\"\n [attr.data-size]=\"p.size\"\n [attr.data-radius]=\"p.r\"\n [attr.data-marker]=\"p.marker\"\n >\n <path class=\"wr-scatter-chart__marker\" [attr.d]=\"p.d\" [attr.fill]=\"p.color\" />\n </svg>\n }\n\n @if (active) {\n <!-- A ring of the point's own shape just outside it, so the reading is marked by\n outline as well as by the tooltip's arrow. -->\n <svg class=\"wr-scatter-chart__halo\" [attr.x]=\"`${active.left}%`\" [attr.y]=\"`${active.top}%`\" overflow=\"visible\">\n <path [attr.d]=\"haloPath()\" fill=\"none\" [attr.stroke]=\"active.color\" />\n </svg>\n }\n </svg>\n </div>\n\n @if (showGrid()) {\n <!-- The strip is as wide as the plot, and hands the stylesheet the distance between\n two ticks; each label hands it the x of its gridline, as a percentage of the\n drawing's width. -->\n <div class=\"wr-scatter-chart__x-axis\" aria-hidden=\"true\" [style.--wr-scatter-chart-x-slot]=\"xSlot()\">\n @for (tick of xTicks(); track $index) {\n <span class=\"wr-scatter-chart__x-tick\" [style.--wr-scatter-chart-x]=\"tick.left\">{{ tick.label }}</span>\n }\n </div>\n }\n\n @if (xLabel()) {\n <div class=\"wr-scatter-chart__x-title\">{{ xLabel() }}</div>\n }\n</div>\n\n@if (dataTable()) {\n <!-- The figures for a screen reader, beside the plot's `img` and never inside it:\n `img` makes everything it holds presentational. Clipped to nothing by its own\n stylesheet, so it takes no room and draws nothing. -->\n <wr-chart-table [data]=\"tableData()\" />\n}\n"],"mappings":";;;;;;;;;;;;;;AAyCA,MAAM,eAAe;AAGrB,MAAM,aAAa;AAGnB,MAAM,aAAa;AAGnB,MAAM,WAAW;AAGjB,MAAM,WAAW,UAA0B,KAAK,MAAM,QAAQ,GAAI,IAAI;AA8EtE,IAAa,iBAAb,MAAa,eAAc;CACzB,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW,cAAc,sBAAsB;CACzF;CAOS,SAAS,MAAkC,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAO9C,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,oBAAoB,YAAY,KAAK,WAAW,sBAAsB,eAAe;CAO/F,SAAS,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAOnC,SAAS,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,SAAA,CAAA,+BAAA,CAAA,CAAA;CAOnC,YAAY,MAAqB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAE5B,QAAQ,YAAY,KAAK,QAAQ,kBAAkB,GAAG;CACtD,QAAQ,YAAY,KAAK,QAAQ,kBAAkB,GAAG;CACtD,WAAW,YAAY,KAAK,WAAW,qBAAqB,MAAM;CAS5E,cAAc,MAA+D,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAG1E,UAAU,gBAAiC,KAAK,WAAW;CAG3D,WAAW,IAAI,KAAK,aAAa,OAAO,SAAS,CAAC;CAG1D,SAAS,MAAM,KAAG;EAAA,GAA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EAAA,kBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,oBAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,KAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAK,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -132,7 +132,7 @@ var WrSparkline = class WrSparkline {
|
|
|
132
132
|
}
|
|
133
133
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
134
134
|
minVersion: "12.0.0",
|
|
135
|
-
version: "22.2.
|
|
135
|
+
version: "22.2.6",
|
|
136
136
|
ngImport: i0,
|
|
137
137
|
type: WrSparkline,
|
|
138
138
|
deps: [],
|
|
@@ -140,7 +140,7 @@ var WrSparkline = class WrSparkline {
|
|
|
140
140
|
});
|
|
141
141
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
142
142
|
minVersion: "17.0.0",
|
|
143
|
-
version: "22.2.
|
|
143
|
+
version: "22.2.6",
|
|
144
144
|
type: WrSparkline,
|
|
145
145
|
isStandalone: true,
|
|
146
146
|
selector: "wr-sparkline",
|
|
@@ -237,7 +237,7 @@ var WrSparkline = class WrSparkline {
|
|
|
237
237
|
};
|
|
238
238
|
i0.ɵɵngDeclareClassMetadata({
|
|
239
239
|
minVersion: "12.0.0",
|
|
240
|
-
version: "22.2.
|
|
240
|
+
version: "22.2.6",
|
|
241
241
|
ngImport: i0,
|
|
242
242
|
type: WrSparkline,
|
|
243
243
|
decorators: [{
|
|
@@ -317,7 +317,7 @@ var WrTreemapChart = class WrTreemapChart {
|
|
|
317
317
|
}
|
|
318
318
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
319
319
|
minVersion: "12.0.0",
|
|
320
|
-
version: "22.2.
|
|
320
|
+
version: "22.2.6",
|
|
321
321
|
ngImport: i0,
|
|
322
322
|
type: WrTreemapChart,
|
|
323
323
|
deps: [],
|
|
@@ -325,7 +325,7 @@ var WrTreemapChart = class WrTreemapChart {
|
|
|
325
325
|
});
|
|
326
326
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
327
327
|
minVersion: "17.0.0",
|
|
328
|
-
version: "22.2.
|
|
328
|
+
version: "22.2.6",
|
|
329
329
|
type: WrTreemapChart,
|
|
330
330
|
isStandalone: true,
|
|
331
331
|
selector: "wr-treemap-chart",
|
|
@@ -427,7 +427,7 @@ var WrTreemapChart = class WrTreemapChart {
|
|
|
427
427
|
};
|
|
428
428
|
i0.ɵɵngDeclareClassMetadata({
|
|
429
429
|
minVersion: "12.0.0",
|
|
430
|
-
version: "22.2.
|
|
430
|
+
version: "22.2.6",
|
|
431
431
|
ngImport: i0,
|
|
432
432
|
type: WrTreemapChart,
|
|
433
433
|
decorators: [{
|
|
@@ -214,7 +214,7 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
214
214
|
}
|
|
215
215
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
216
216
|
minVersion: "12.0.0",
|
|
217
|
-
version: "22.2.
|
|
217
|
+
version: "22.2.6",
|
|
218
218
|
ngImport: i0,
|
|
219
219
|
type: WrWaterfallChart,
|
|
220
220
|
deps: [],
|
|
@@ -222,7 +222,7 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
222
222
|
});
|
|
223
223
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
224
224
|
minVersion: "17.0.0",
|
|
225
|
-
version: "22.2.
|
|
225
|
+
version: "22.2.6",
|
|
226
226
|
type: WrWaterfallChart,
|
|
227
227
|
isStandalone: true,
|
|
228
228
|
selector: "wr-waterfall-chart",
|
|
@@ -338,7 +338,7 @@ var WrWaterfallChart = class WrWaterfallChart {
|
|
|
338
338
|
};
|
|
339
339
|
i0.ɵɵngDeclareClassMetadata({
|
|
340
340
|
minVersion: "12.0.0",
|
|
341
|
-
version: "22.2.
|
|
341
|
+
version: "22.2.6",
|
|
342
342
|
ngImport: i0,
|
|
343
343
|
type: WrWaterfallChart,
|
|
344
344
|
decorators: [{
|
|
@@ -96,7 +96,7 @@ var WrCheckbox = class WrCheckbox {
|
|
|
96
96
|
}
|
|
97
97
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
98
98
|
minVersion: "12.0.0",
|
|
99
|
-
version: "22.2.
|
|
99
|
+
version: "22.2.6",
|
|
100
100
|
ngImport: i0,
|
|
101
101
|
type: WrCheckbox,
|
|
102
102
|
deps: [],
|
|
@@ -104,7 +104,7 @@ var WrCheckbox = class WrCheckbox {
|
|
|
104
104
|
});
|
|
105
105
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
106
106
|
minVersion: "17.0.0",
|
|
107
|
-
version: "22.2.
|
|
107
|
+
version: "22.2.6",
|
|
108
108
|
type: WrCheckbox,
|
|
109
109
|
isStandalone: true,
|
|
110
110
|
selector: "wr-checkbox",
|
|
@@ -212,7 +212,7 @@ var WrCheckbox = class WrCheckbox {
|
|
|
212
212
|
};
|
|
213
213
|
i0.ɵɵngDeclareClassMetadata({
|
|
214
214
|
minVersion: "12.0.0",
|
|
215
|
-
version: "22.2.
|
|
215
|
+
version: "22.2.6",
|
|
216
216
|
ngImport: i0,
|
|
217
217
|
type: WrCheckbox,
|
|
218
218
|
decorators: [{
|
|
@@ -373,7 +373,7 @@ var WrCheckboxGroup = class WrCheckboxGroup {
|
|
|
373
373
|
}
|
|
374
374
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
375
375
|
minVersion: "12.0.0",
|
|
376
|
-
version: "22.2.
|
|
376
|
+
version: "22.2.6",
|
|
377
377
|
ngImport: i0,
|
|
378
378
|
type: WrCheckboxGroup,
|
|
379
379
|
deps: [],
|
|
@@ -381,7 +381,7 @@ var WrCheckboxGroup = class WrCheckboxGroup {
|
|
|
381
381
|
});
|
|
382
382
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
383
383
|
minVersion: "17.1.0",
|
|
384
|
-
version: "22.2.
|
|
384
|
+
version: "22.2.6",
|
|
385
385
|
type: WrCheckboxGroup,
|
|
386
386
|
isStandalone: true,
|
|
387
387
|
selector: "wr-checkbox-group",
|
|
@@ -433,7 +433,7 @@ var WrCheckboxGroup = class WrCheckboxGroup {
|
|
|
433
433
|
};
|
|
434
434
|
i0.ɵɵngDeclareClassMetadata({
|
|
435
435
|
minVersion: "12.0.0",
|
|
436
|
-
version: "22.2.
|
|
436
|
+
version: "22.2.6",
|
|
437
437
|
ngImport: i0,
|
|
438
438
|
type: WrCheckboxGroup,
|
|
439
439
|
decorators: [{
|
|
@@ -76,7 +76,7 @@ var WrClipboard = class WrClipboard {
|
|
|
76
76
|
}
|
|
77
77
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
78
78
|
minVersion: "12.0.0",
|
|
79
|
-
version: "22.2.
|
|
79
|
+
version: "22.2.6",
|
|
80
80
|
ngImport: i0,
|
|
81
81
|
type: WrClipboard,
|
|
82
82
|
deps: [],
|
|
@@ -84,14 +84,14 @@ var WrClipboard = class WrClipboard {
|
|
|
84
84
|
});
|
|
85
85
|
static ɵprov = i0.ɵɵngDeclareService({
|
|
86
86
|
minVersion: "22.0.0",
|
|
87
|
-
version: "22.2.
|
|
87
|
+
version: "22.2.6",
|
|
88
88
|
ngImport: i0,
|
|
89
89
|
type: WrClipboard
|
|
90
90
|
});
|
|
91
91
|
};
|
|
92
92
|
i0.ɵɵngDeclareClassMetadata({
|
|
93
93
|
minVersion: "12.0.0",
|
|
94
|
-
version: "22.2.
|
|
94
|
+
version: "22.2.6",
|
|
95
95
|
ngImport: i0,
|
|
96
96
|
type: WrClipboard,
|
|
97
97
|
decorators: [{ type: Service }]
|
|
@@ -64,7 +64,7 @@ var WrCollapse = class WrCollapse {
|
|
|
64
64
|
}
|
|
65
65
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
66
66
|
minVersion: "12.0.0",
|
|
67
|
-
version: "22.2.
|
|
67
|
+
version: "22.2.6",
|
|
68
68
|
ngImport: i0,
|
|
69
69
|
type: WrCollapse,
|
|
70
70
|
deps: [],
|
|
@@ -72,7 +72,7 @@ var WrCollapse = class WrCollapse {
|
|
|
72
72
|
});
|
|
73
73
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
74
74
|
minVersion: "17.0.0",
|
|
75
|
-
version: "22.2.
|
|
75
|
+
version: "22.2.6",
|
|
76
76
|
type: WrCollapse,
|
|
77
77
|
isStandalone: true,
|
|
78
78
|
selector: "wr-collapse",
|
|
@@ -128,7 +128,7 @@ var WrCollapse = class WrCollapse {
|
|
|
128
128
|
};
|
|
129
129
|
i0.ɵɵngDeclareClassMetadata({
|
|
130
130
|
minVersion: "12.0.0",
|
|
131
|
-
version: "22.2.
|
|
131
|
+
version: "22.2.6",
|
|
132
132
|
ngImport: i0,
|
|
133
133
|
type: WrCollapse,
|
|
134
134
|
decorators: [{
|
|
@@ -218,7 +218,7 @@ var WrCollapseGroup = class WrCollapseGroup {
|
|
|
218
218
|
}
|
|
219
219
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
220
220
|
minVersion: "12.0.0",
|
|
221
|
-
version: "22.2.
|
|
221
|
+
version: "22.2.6",
|
|
222
222
|
ngImport: i0,
|
|
223
223
|
type: WrCollapseGroup,
|
|
224
224
|
deps: [],
|
|
@@ -226,7 +226,7 @@ var WrCollapseGroup = class WrCollapseGroup {
|
|
|
226
226
|
});
|
|
227
227
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
228
228
|
minVersion: "17.1.0",
|
|
229
|
-
version: "22.2.
|
|
229
|
+
version: "22.2.6",
|
|
230
230
|
type: WrCollapseGroup,
|
|
231
231
|
isStandalone: true,
|
|
232
232
|
selector: "wr-collapse-group",
|
|
@@ -250,7 +250,7 @@ var WrCollapseGroup = class WrCollapseGroup {
|
|
|
250
250
|
};
|
|
251
251
|
i0.ɵɵngDeclareClassMetadata({
|
|
252
252
|
minVersion: "12.0.0",
|
|
253
|
-
version: "22.2.
|
|
253
|
+
version: "22.2.6",
|
|
254
254
|
ngImport: i0,
|
|
255
255
|
type: WrCollapseGroup,
|
|
256
256
|
decorators: [{
|
|
@@ -299,7 +299,7 @@ var WrAccordion = class WrAccordion {
|
|
|
299
299
|
}
|
|
300
300
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
301
301
|
minVersion: "12.0.0",
|
|
302
|
-
version: "22.2.
|
|
302
|
+
version: "22.2.6",
|
|
303
303
|
ngImport: i0,
|
|
304
304
|
type: WrAccordion,
|
|
305
305
|
deps: [],
|
|
@@ -307,7 +307,7 @@ var WrAccordion = class WrAccordion {
|
|
|
307
307
|
});
|
|
308
308
|
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
309
309
|
minVersion: "14.0.0",
|
|
310
|
-
version: "22.2.
|
|
310
|
+
version: "22.2.6",
|
|
311
311
|
type: WrAccordion,
|
|
312
312
|
isStandalone: true,
|
|
313
313
|
selector: "wr-accordion",
|
|
@@ -324,7 +324,7 @@ var WrAccordion = class WrAccordion {
|
|
|
324
324
|
};
|
|
325
325
|
i0.ɵɵngDeclareClassMetadata({
|
|
326
326
|
minVersion: "12.0.0",
|
|
327
|
-
version: "22.2.
|
|
327
|
+
version: "22.2.6",
|
|
328
328
|
ngImport: i0,
|
|
329
329
|
type: WrAccordion,
|
|
330
330
|
decorators: [{
|
|
@@ -111,17 +111,27 @@ var WrColorPickerHarness = class WrColorPickerHarness extends ComponentHarness {
|
|
|
111
111
|
return (await this.host()).hasClass("wr-color-picker--disabled");
|
|
112
112
|
}
|
|
113
113
|
async getSwatches() {
|
|
114
|
+
const swatches = await this.locatorForAll(".wr-color-picker__swatch")();
|
|
115
|
+
return Promise.all(swatches.map(async (swatch) => await swatch.getAttribute("data-color") ?? ""));
|
|
116
|
+
}
|
|
117
|
+
async getSwatchLabels() {
|
|
114
118
|
const swatches = await this.locatorForAll(".wr-color-picker__swatch")();
|
|
115
119
|
return Promise.all(swatches.map(async (swatch) => await swatch.getAttribute("aria-label") ?? ""));
|
|
116
120
|
}
|
|
117
121
|
async pickSwatch(color) {
|
|
118
122
|
const swatches = await this.locatorForAll(".wr-color-picker__swatch")();
|
|
119
|
-
for (const swatch of swatches) if (await swatch.getAttribute("aria-label") === color) {
|
|
123
|
+
for (const swatch of swatches) if (await swatch.getAttribute("data-color") === color || await swatch.getAttribute("aria-label") === color) {
|
|
120
124
|
await swatch.click();
|
|
121
125
|
return;
|
|
122
126
|
}
|
|
123
127
|
throw new Error(`WrColorPickerHarness.pickSwatch(): no swatch for "${color}". The picker offers: ${(await this.getSwatches()).join(", ")}.`);
|
|
124
128
|
}
|
|
129
|
+
async getSize() {
|
|
130
|
+
const host = await this.host();
|
|
131
|
+
if (await host.hasClass("wr-color-picker--sm")) return "sm";
|
|
132
|
+
if (await host.hasClass("wr-color-picker--lg")) return "lg";
|
|
133
|
+
return "md";
|
|
134
|
+
}
|
|
125
135
|
async getThumbs() {
|
|
126
136
|
const sv = await this.locatorFor(".wr-color-picker__sv .wr-color-picker__thumb")();
|
|
127
137
|
const hue = await this.locatorFor(".wr-color-picker__slider--hue .wr-color-picker__thumb")();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngwr-color-picker-testing.mjs","names":[],"sources":["../../../projects/lib/color-picker/testing/wr-color-picker-harness.ts","../../../projects/lib/color-picker/testing/wr-color-picker-trigger-harness.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 { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport { WrSegmentedHarness } from 'ngwr/segmented/testing';\n\nimport type { WrColorPickerHarnessFilters, WrColorPickerTab, WrColorPickerThumbs } from './types';\n\n/**\n * One labelled numeric field — internal. A `TestElement` cannot be queried into, so\n * pairing an input with the label printed under it means a harness anchored on the\n * `<label>` that holds both.\n */\nclass FieldHarness extends ComponentHarness {\n static hostSelector = '.wr-color-picker__field';\n\n async getLabel(): Promise<string> {\n return (await this.locatorFor('.wr-color-picker__field-label')()).text();\n }\n\n async getInput(): Promise<TestElement> {\n return this.locatorFor('input')();\n }\n\n async getValue(): Promise<string> {\n return (await this.getInput()).getProperty<string>('value');\n }\n}\n\n/**\n * The percentage a thumb carries, out of its inline `style`.\n *\n * Three properties and not two, because the surfaces do not agree on the inline\n * axis and that disagreement is the contract: the SV canvas is a picture and\n * keeps a physical `left`, while the hue and alpha tracks are one-value sliders\n * that mirror under `dir=\"rtl\"` and so are placed with `inset-inline-start`.\n * Reading `left` off a slider thumb therefore finds nothing, which is exactly\n * what should happen if one of them ever regresses to the physical property.\n */\nconst THUMB_POS = {\n left: /(?:^|;)\\s*left\\s*:\\s*([\\d.]+)%/,\n top: /(?:^|;)\\s*top\\s*:\\s*([\\d.]+)%/,\n 'inset-inline-start': /(?:^|;)\\s*inset-inline-start\\s*:\\s*([\\d.]+)%/,\n} as const;\n\n/** One thumb's declared offset. See {@link WrColorPickerHarness.getThumbs} for why this is not `getCssValue()`. */\nasync function percent(thumb: TestElement, side: keyof typeof THUMB_POS, surface: string): Promise<number> {\n const style = await thumb.getAttribute('style');\n const match = THUMB_POS[side].exec(style ?? '');\n\n if (!match) {\n throw new Error(\n `WrColorPickerHarness.getThumbs(): the ${surface} thumb carries no inline ${side} percentage ` +\n `(style: \"${style ?? ''}\"). The component writes one on every render, so its absence is the bug — ` +\n `and the stylesheet declares \\`${side}: 0\\`, so reporting 0 would read as a thumb parked at the origin.`\n );\n }\n return Number.parseFloat(match[1]);\n}\n\n/**\n * Test harness for `<wr-color-picker>` — the inline picker, and the one the\n * `[wrColorPickerTrigger]` directive mounts in an overlay.\n *\n * **What this harness will not do: drag.** The SV canvas and the hue / alpha\n * sliders are pointer surfaces that read `getBoundingClientRect()` and divide by\n * its width. A unit test has no layout, so every box is 0×0 and the division is\n * `NaN` — a `setHue()` built on a synthetic pointer event would report success and\n * write nothing, or write garbage. The numeric fields reach the same state and are\n * also the only keyboard path the component has, so they are the whole write API\n * here. {@link getThumbs} reads where the thumbs ARE, from the percentages the\n * component writes inline, which is how a spec checks a surface followed a value.\n *\n * **And it will not read the preview swatch.** The preview paints the current\n * colour as a CSS background, and jsdom normalises that to `rgb(…)` — dropping the\n * alpha channel entirely, so `#ff880080` and `#ff8800ff` come back identical. A\n * `getColor()` reading it would answer one thing in a unit test and another in a\n * browser. {@link getHex} is the colour: the field holds the canonical 8-digit\n * string, alpha included, whatever `format` writes into `value`.\n *\n * @example\n * ```ts\n * const picker = await loader.getHarness(WrColorPickerHarness);\n *\n * await picker.setHex('#3969e2');\n * expect(await picker.getHex()).toBe('#3969e2ff');\n *\n * await picker.setTab('rgb');\n * expect(await picker.getRgb()).toEqual({ r: 57, g: 105, b: 226 });\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrColorPickerHarness extends ComponentHarness {\n static hostSelector = 'wr-color-picker';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrColorPickerHarnessFilters = {}): HarnessPredicate<WrColorPickerHarness> {\n return new HarnessPredicate(WrColorPickerHarness, options)\n .addOption('color', options.color, (harness, color) => HarnessPredicate.stringMatches(harness.readHex(), color))\n .addOption('tab', options.tab, async (harness, tab) => (await harness.getTab()) === tab)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n private readonly hexField = this.locatorForOptional('.wr-color-picker__inputs--hex input');\n private readonly tabs = this.locatorFor(WrSegmentedHarness.with({ selector: '.wr-color-picker__tabs' }));\n\n /**\n * The tab switcher, as a {@link WrSegmentedHarness}.\n *\n * Handed back rather than re-queried: the switcher IS a `<wr-segmented>`, which\n * already knows that the roving tab stop is not the selection and how the sliding\n * thumb reports itself. Re-reading its buttons here would be a second, worse copy.\n */\n async getTabs(): Promise<WrSegmentedHarness> {\n return this.tabs();\n }\n\n /** Which set of numeric fields is showing. */\n async getTab(): Promise<WrColorPickerTab> {\n const label = await (await this.tabs()).getSelectedLabel();\n return (label ?? 'HEX').toLowerCase() as WrColorPickerTab;\n }\n\n /** Show a different set of numeric fields. An already-active tab is left alone. */\n async setTab(tab: WrColorPickerTab): Promise<void> {\n if ((await this.getTab()) === tab) return;\n await (await this.tabs()).select({ label: tab.toUpperCase() });\n }\n\n /**\n * The canonical hex string, as the HEX field shows it — 8 digits while `alpha` is\n * on, 6 while it is off.\n *\n * This is the picker's colour, and deliberately not the same thing as its `value`:\n * `format` decides whether `value` is written as hex, `rgb()` or `hsl()`, while the\n * field always shows hex. A spec that cares about the emitted string should read\n * the bound signal; one that cares about the COLOUR should read this.\n *\n * Throws off the HEX tab, where the field does not exist — see {@link setTab}.\n */\n async getHex(): Promise<string> {\n const field = await this.hexField();\n if (!field) {\n throw new Error(\n `WrColorPickerHarness.getHex(): the HEX field is not rendered — the picker is showing the ` +\n `${(await this.getTab()).toUpperCase()} tab. Call setTab('hex') first.`\n );\n }\n return field.getProperty<string>('value');\n }\n\n /**\n * Type a colour into the HEX field.\n *\n * Typed rather than assigned, because that is the path the component is built\n * around: it re-parses on every keystroke and applies the first spelling that\n * parses, so a partial `#ff8` commits a colour on its way to `#ff8800`. An\n * unparseable string leaves the committed colour ALONE and lives in the field\n * until {@link blurHex} snaps it back — assert that rather than expecting a throw.\n */\n async setHex(value: string): Promise<void> {\n const field = await this.requireHexField('setHex');\n await field.clear();\n await field.sendKeys(value);\n }\n\n /**\n * Blur the HEX field — re-syncing it with the committed colour and emitting\n * `touch`.\n *\n * The re-sync is the visible half: a field left holding text that never parsed\n * goes back to the canonical hex here, and nowhere else.\n */\n async blurHex(): Promise<void> {\n await (await this.requireHexField('blurHex')).blur();\n }\n\n /** Whether the HEX field currently holds focus. */\n async isHexFocused(): Promise<boolean> {\n return (await this.requireHexField('isHexFocused')).isFocused();\n }\n\n /** The three RGB channels as the RGB tab shows them. Throws off that tab. */\n async getRgb(): Promise<{ r: number; g: number; b: number }> {\n const [r, g, b] = await this.channelValues('rgb', ['R', 'G', 'B']);\n return { r, g, b };\n }\n\n /** Write one RGB channel, 0–255. Out-of-range numbers are clamped by the component. */\n async setRgbChannel(channel: 'r' | 'g' | 'b', value: number): Promise<void> {\n await this.writeChannel('rgb', channel.toUpperCase(), value);\n }\n\n /**\n * Hue, saturation and lightness as the HSL tab shows them — degrees and whole\n * percents, already rounded for display. Throws off that tab.\n */\n async getHsl(): Promise<{ h: number; s: number; l: number }> {\n const [h, s, l] = await this.channelValues('hsl', ['H', 'S%', 'L%']);\n return { h, s, l };\n }\n\n /** Write one HSL channel — `h` in degrees, `s` / `l` in percent. */\n async setHslChannel(channel: 'h' | 's' | 'l', value: number): Promise<void> {\n await this.writeChannel('hsl', channel === 'h' ? 'H' : `${channel.toUpperCase()}%`, value);\n }\n\n /**\n * Alpha as the whole percent the numeric tabs show, or `null` when the picker was\n * built without alpha.\n *\n * Only the RGB and HSL tabs carry the field — the HEX tab spells alpha into the\n * hex string instead — so this throws on the HEX tab rather than answering `null`,\n * which would read as \"this picker has no alpha\".\n */\n async getAlphaPercent(): Promise<number | null> {\n const tab = await this.getTab();\n if (tab === 'hex') {\n throw new Error(\n 'WrColorPickerHarness.getAlphaPercent(): the HEX tab has no alpha field — the alpha is the last two ' +\n \"digits of getHex(). Call setTab('rgb') or setTab('hsl') to read it as a percent.\"\n );\n }\n if (!(await this.hasAlpha())) return null;\n const [alpha] = await this.channelValues(tab, ['A%']);\n return alpha;\n }\n\n /** Write alpha as a whole percent, 0–100. */\n async setAlphaPercent(value: number): Promise<void> {\n const tab = await this.getTab();\n if (tab === 'hex') {\n throw new Error(\n \"WrColorPickerHarness.setAlphaPercent(): the HEX tab has no alpha field. Call setTab('rgb') first, \" +\n 'or write the two alpha digits through setHex().'\n );\n }\n await this.writeChannel(tab, 'A%', value);\n }\n\n /**\n * Whether the picker offers alpha at all.\n *\n * From the host modifier, which is the one answer that holds on every tab: the\n * alpha SLIDER is always rendered when it is on, while the `A%` field only exists\n * on the two numeric tabs.\n */\n async hasAlpha(): Promise<boolean> {\n return (await this.host()).hasClass('wr-color-picker--alpha');\n }\n\n /**\n * Whether the picker refuses interaction.\n *\n * Read from the modifier the host paints rather than from a field's `disabled`\n * property, because the fields come and go with the tab while the state does not —\n * and the drag surfaces, which have no `disabled` of their own, are gated by the\n * same signal.\n */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).hasClass('wr-color-picker--disabled');\n }\n\n /** The preset colours offered under the fields, as the strings the consumer passed. */\n async getSwatches(): Promise<string[]> {\n const swatches = await this.locatorForAll('.wr-color-picker__swatch')();\n return Promise.all(swatches.map(async swatch => (await swatch.getAttribute('aria-label')) ?? ''));\n }\n\n /**\n * Click a preset.\n *\n * Matched on the string the consumer passed, which is what the button publishes as\n * its accessible name — the rendered background is a CSS colour and would come back\n * normalised and alpha-stripped. Throws when nothing matches, naming what is offered.\n */\n async pickSwatch(color: string): Promise<void> {\n const swatches = await this.locatorForAll('.wr-color-picker__swatch')();\n for (const swatch of swatches) {\n if ((await swatch.getAttribute('aria-label')) === color) {\n await swatch.click();\n return;\n }\n }\n throw new Error(\n `WrColorPickerHarness.pickSwatch(): no swatch for \"${color}\". The picker offers: ` +\n `${(await this.getSwatches()).join(', ')}.`\n );\n }\n\n /**\n * Where the three thumbs sit, in percent along their surfaces.\n *\n * The component writes these as inline percentages, so they are readable with no\n * layout at all — which makes them the only evidence a spec has that the surfaces\n * followed a colour set through the fields. A measured position would be zero for\n * all three.\n *\n * The number is always \"along the surface from its own start\", so it is direction\n * free: the SV canvas reports a physical `left` because it does not mirror, and\n * the two tracks report `inset-inline-start` because they do. An RTL spec reads\n * the same value as an LTR one, which is the point — what mirrors is where that\n * fraction lands on screen, not the fraction.\n *\n * Read off the `style` ATTRIBUTE rather than through `getCssValue()`, and the\n * difference is not cosmetic: `getCssValue()` is `getComputedStyle()`, and `left` /\n * `top` on a positioned element resolve to the USED value — so the declared `40%`\n * comes straight back in jsdom and arrives as pixels in a real browser, and the same\n * harness answered 40 here and 96 under a browser runner with nothing to say which\n * one you got. The stylesheet's own `top: 0; left: 0` is a second way that read lies,\n * turning a thumb whose binding is gone into one parked at the origin.\n */\n async getThumbs(): Promise<WrColorPickerThumbs> {\n const sv = await this.locatorFor('.wr-color-picker__sv .wr-color-picker__thumb')();\n const hue = await this.locatorFor('.wr-color-picker__slider--hue .wr-color-picker__thumb')();\n const alpha = await this.locatorForOptional('.wr-color-picker__slider--alpha .wr-color-picker__thumb')();\n\n return {\n sv: { x: await percent(sv, 'left', 'SV'), y: await percent(sv, 'top', 'SV') },\n hue: await percent(hue, 'inset-inline-start', 'hue'),\n alpha: alpha ? await percent(alpha, 'inset-inline-start', 'alpha') : null,\n };\n }\n\n /** The HEX field's value without the tab check — for filters, which must not throw. */\n private async readHex(): Promise<string> {\n const field = await this.hexField();\n return field ? field.getProperty<string>('value') : '';\n }\n\n private async requireHexField(method: string): Promise<TestElement> {\n const field = await this.hexField();\n if (!field) {\n throw new Error(\n `WrColorPickerHarness.${method}(): the HEX field is not rendered — the picker is showing the ` +\n `${(await this.getTab()).toUpperCase()} tab. Call setTab('hex') first.`\n );\n }\n return field;\n }\n\n private async channelValues(tab: WrColorPickerTab, labels: readonly string[]): Promise<number[]> {\n await this.requireTab(tab, 'read');\n const inputs = await this.inputsByLabel();\n\n return labels.map(label => {\n const input = inputs.get(label);\n if (!input) throw new Error(`WrColorPickerHarness: the ${tab.toUpperCase()} tab has no \"${label}\" field.`);\n return Number(input.value);\n });\n }\n\n private async writeChannel(tab: WrColorPickerTab, label: string, value: number): Promise<void> {\n await this.requireTab(tab, 'write');\n const inputs = await this.inputsByLabel();\n const found = inputs.get(label);\n if (!found) {\n throw new Error(\n `WrColorPickerHarness: the ${tab.toUpperCase()} tab has no \"${label}\" field. ${\n label === 'A%' ? 'This picker was built with `[alpha]=\"false\"`.' : ''\n }`\n );\n }\n\n // Set and dispatch once, rather than clearing and typing. Each of these inputs\n // is bound to `[value]`, and the component commits on every `input` event — so\n // typing 128 would land 1, then 12, then 128, and CLEARING would land 0 first,\n // because `Number('')` is 0 rather than NaN. A spec that asked for one colour\n // would get four, the first of them black.\n await found.element.setInputValue(String(value));\n await found.element.dispatchEvent('input');\n }\n\n private async requireTab(tab: WrColorPickerTab, verb: string): Promise<void> {\n const current = await this.getTab();\n if (current !== tab) {\n throw new Error(\n `WrColorPickerHarness: cannot ${verb} the ${tab.toUpperCase()} channels while the picker is showing ` +\n `the ${current.toUpperCase()} tab — those fields are not rendered. Call setTab('${tab}') first.`\n );\n }\n }\n\n /** Every numeric input of the current tab, keyed by the label printed under it. */\n private async inputsByLabel(): Promise<Map<string, { element: TestElement; value: string }>> {\n const found = new Map<string, { element: TestElement; value: string }>();\n\n for (const field of await this.locatorForAll(FieldHarness)()) {\n const label = await field.getLabel();\n found.set(label, { element: await field.getInput(), value: await field.getValue() });\n }\n return found;\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 { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrColorPickerTriggerHarnessFilters } from './types';\nimport { WrColorPickerHarness } from './wr-color-picker-harness';\n\n/**\n * Test harness for `[wrColorPickerTrigger]` — the element that opens a\n * `<wr-color-picker>` in an overlay.\n *\n * The trigger stays in your fixture; the picker it opens does not. So this harness\n * is loaded from the fixture loader like any element, and {@link getPicker} reaches\n * ACROSS into the overlay container for you — scoped by the panel id the trigger\n * publishes through `aria-controls`, never by `.wr-color-picker-overlay`, which\n * answers with whichever trigger opened first.\n *\n * @example\n * ```ts\n * const trigger = await loader.getHarness(WrColorPickerTriggerHarness);\n * const picker = await trigger.open();\n *\n * await picker.setHex('#3969e2');\n * await trigger.sendEscape();\n * expect(await trigger.isOpen()).toBe(false);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrColorPickerTriggerHarness extends ComponentHarness {\n static hostSelector = '[wrColorPickerTrigger]';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrColorPickerTriggerHarnessFilters = {}): HarnessPredicate<WrColorPickerTriggerHarness> {\n return new HarnessPredicate(WrColorPickerTriggerHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);\n }\n\n /** The trigger's own text, trimmed. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Whether the picker is showing, from the trigger's `aria-expanded`. */\n async isOpen(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-expanded')) === 'true';\n }\n\n /**\n * Whether the trigger refuses to open.\n *\n * From `aria-disabled`, which the directive writes for its own `disabled` input.\n * The host is usually a `<button>`, but the directive does not touch its `disabled`\n * PROPERTY — a consumer who binds that as well turns the element off at the DOM\n * level, which is a stronger thing and reads here too.\n */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-disabled')) === 'true' || (await host.getProperty<boolean>('disabled'));\n }\n\n /**\n * The picker this trigger opened, or `null` while it is closed.\n *\n * Scoped by the id in `aria-controls`, so two triggers open at once — which\n * nothing in the component prevents, since only an outside click closes one —\n * answer with their own panels rather than with whichever came first.\n */\n async getPicker(): Promise<WrColorPickerHarness | null> {\n const id = await (await this.host()).getAttribute('aria-controls');\n if (!id) return null;\n\n return this.documentRootLocatorFactory().locatorForOptional(WrColorPickerHarness.with({ ancestor: `#${id}` }))();\n }\n\n /**\n * Open the picker and hand it back. An already-open trigger is left alone.\n *\n * Throws on a disabled trigger rather than answering `null` three lines later:\n * `toggle()` returns early while `disabled` is set, so the click lands and nothing\n * happens at all.\n */\n async open(): Promise<WrColorPickerHarness> {\n if (!(await this.isOpen())) {\n if (await this.isDisabled()) {\n throw new Error(\n `WrColorPickerTriggerHarness.open(): \"${await this.getText()}\" is disabled — the directive turns its ` +\n 'own toggle away, so the click would land and change nothing.'\n );\n }\n await (await this.host()).click();\n }\n\n const picker = await this.getPicker();\n if (!picker) {\n throw new Error(\n 'WrColorPickerTriggerHarness.open(): the trigger reports itself open but published no panel to find. ' +\n 'That is a broken `aria-controls` pairing, not a timing problem.'\n );\n }\n return picker;\n }\n\n /** Close the picker. An already-closed trigger is left alone. */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n await (await this.host()).click();\n }\n\n /** Click the trigger once, whichever way that takes it. */\n async toggle(): Promise<void> {\n await (await this.host()).click();\n }\n\n /**\n * Press Escape.\n *\n * Sent to the TRIGGER, and it still reaches the picker: the overlay listens through\n * the CDK's keyboard dispatcher, which keeps one document listener and routes to\n * the top-most overlay — so this does not depend on where focus happens to be.\n */\n async sendEscape(): Promise<void> {\n await (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n\n /** The role the trigger claims to open — `dialog`. */\n async getHasPopup(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-haspopup');\n }\n}\n"],"mappings":";;;;;;;;AAkBA,IAAM,eAAN,cAA2B,iBAAgB;CACzC,OAAO,eAAe;CAEtB,MAAM,WAAQ;EACZ,QAAQ,MAAM,KAAK,WAAW,+BAA+B,CAAC,CAAA,EAAA,CAAI,KAAI;CACxE;CAEA,MAAM,WAAQ;EACZ,OAA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,MAAM,KAAK,WAAU,GACvB,MAAM,IAAI,MACR,wCAAwC,MAAM,KAAK,QAAO,EAAE,qGACI;GAGpE,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,MAAK;EACjC;EAEA,MAAM,SAAS,MAAM,KAAK,UAAS;EACnC,IAAI,CAAC,QACH,MAAM,IAAI,MACR,qKACmE;EAGvE,OAAO;CACT;CAGA,MAAM,QAAK;EACT,IAAI,CAAE,MAAM,KAAK,OAAM,GAAK;EAC5B,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,MAAK;CACjC;CAGA,MAAM,SAAM;EACV,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,MAAK;CACjC;CASA,MAAM,aAAU;EACd,OAAO,MAAM,KAAK,KAAI,EAAA,CAAI,SAAS,QAAQ,MAAM;CACnD;CAGA,MAAM,cAAW;EACf,QAAQ,MAAM,KAAK,KAAI,EAAA,CAAI,aAAa,eAAe;CACzD"}
|
|
1
|
+
{"version":3,"file":"ngwr-color-picker-testing.mjs","names":[],"sources":["../../../projects/lib/color-picker/testing/wr-color-picker-harness.ts","../../../projects/lib/color-picker/testing/wr-color-picker-trigger-harness.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 { ComponentHarness, HarnessPredicate, type TestElement } from '@angular/cdk/testing';\n\nimport type { WrColorPickerSize } from 'ngwr/color-picker';\nimport { WrSegmentedHarness } from 'ngwr/segmented/testing';\n\nimport type { WrColorPickerHarnessFilters, WrColorPickerTab, WrColorPickerThumbs } from './types';\n\n/**\n * One labelled numeric field — internal. A `TestElement` cannot be queried into, so\n * pairing an input with the label printed under it means a harness anchored on the\n * `<label>` that holds both.\n */\nclass FieldHarness extends ComponentHarness {\n static hostSelector = '.wr-color-picker__field';\n\n async getLabel(): Promise<string> {\n return (await this.locatorFor('.wr-color-picker__field-label')()).text();\n }\n\n async getInput(): Promise<TestElement> {\n return this.locatorFor('input')();\n }\n\n async getValue(): Promise<string> {\n return (await this.getInput()).getProperty<string>('value');\n }\n}\n\n/**\n * The percentage a thumb carries, out of its inline `style`.\n *\n * Three properties and not two, because the surfaces do not agree on the inline\n * axis and that disagreement is the contract: the SV canvas is a picture and\n * keeps a physical `left`, while the hue and alpha tracks are one-value sliders\n * that mirror under `dir=\"rtl\"` and so are placed with `inset-inline-start`.\n * Reading `left` off a slider thumb therefore finds nothing, which is exactly\n * what should happen if one of them ever regresses to the physical property.\n */\nconst THUMB_POS = {\n left: /(?:^|;)\\s*left\\s*:\\s*([\\d.]+)%/,\n top: /(?:^|;)\\s*top\\s*:\\s*([\\d.]+)%/,\n 'inset-inline-start': /(?:^|;)\\s*inset-inline-start\\s*:\\s*([\\d.]+)%/,\n} as const;\n\n/** One thumb's declared offset. See {@link WrColorPickerHarness.getThumbs} for why this is not `getCssValue()`. */\nasync function percent(thumb: TestElement, side: keyof typeof THUMB_POS, surface: string): Promise<number> {\n const style = await thumb.getAttribute('style');\n const match = THUMB_POS[side].exec(style ?? '');\n\n if (!match) {\n throw new Error(\n `WrColorPickerHarness.getThumbs(): the ${surface} thumb carries no inline ${side} percentage ` +\n `(style: \"${style ?? ''}\"). The component writes one on every render, so its absence is the bug — ` +\n `and the stylesheet declares \\`${side}: 0\\`, so reporting 0 would read as a thumb parked at the origin.`\n );\n }\n return Number.parseFloat(match[1]);\n}\n\n/**\n * Test harness for `<wr-color-picker>` — the inline picker, and the one the\n * `[wrColorPickerTrigger]` directive mounts in an overlay.\n *\n * **What this harness will not do: drag.** The SV canvas and the hue / alpha\n * sliders are pointer surfaces that read `getBoundingClientRect()` and divide by\n * its width. A unit test has no layout, so every box is 0×0 and the division is\n * `NaN` — a `setHue()` built on a synthetic pointer event would report success and\n * write nothing, or write garbage. The numeric fields reach the same state and are\n * also the only keyboard path the component has, so they are the whole write API\n * here. {@link getThumbs} reads where the thumbs ARE, from the percentages the\n * component writes inline, which is how a spec checks a surface followed a value.\n *\n * **And it will not read the preview swatch.** The preview paints the current\n * colour as a CSS background, and jsdom normalises that to `rgb(…)` — dropping the\n * alpha channel entirely, so `#ff880080` and `#ff8800ff` come back identical. A\n * `getColor()` reading it would answer one thing in a unit test and another in a\n * browser. {@link getHex} is the colour: the field holds the canonical 8-digit\n * string, alpha included, whatever `format` writes into `value`.\n *\n * @example\n * ```ts\n * const picker = await loader.getHarness(WrColorPickerHarness);\n *\n * await picker.setHex('#3969e2');\n * expect(await picker.getHex()).toBe('#3969e2ff');\n *\n * await picker.setTab('rgb');\n * expect(await picker.getRgb()).toEqual({ r: 57, g: 105, b: 226 });\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrColorPickerHarness extends ComponentHarness {\n static hostSelector = 'wr-color-picker';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrColorPickerHarnessFilters = {}): HarnessPredicate<WrColorPickerHarness> {\n return new HarnessPredicate(WrColorPickerHarness, options)\n .addOption('color', options.color, (harness, color) => HarnessPredicate.stringMatches(harness.readHex(), color))\n .addOption('tab', options.tab, async (harness, tab) => (await harness.getTab()) === tab)\n .addOption('disabled', options.disabled, async (harness, disabled) => (await harness.isDisabled()) === disabled);\n }\n\n private readonly hexField = this.locatorForOptional('.wr-color-picker__inputs--hex input');\n private readonly tabs = this.locatorFor(WrSegmentedHarness.with({ selector: '.wr-color-picker__tabs' }));\n\n /**\n * The tab switcher, as a {@link WrSegmentedHarness}.\n *\n * Handed back rather than re-queried: the switcher IS a `<wr-segmented>`, which\n * already knows that the roving tab stop is not the selection and how the sliding\n * thumb reports itself. Re-reading its buttons here would be a second, worse copy.\n */\n async getTabs(): Promise<WrSegmentedHarness> {\n return this.tabs();\n }\n\n /** Which set of numeric fields is showing. */\n async getTab(): Promise<WrColorPickerTab> {\n const label = await (await this.tabs()).getSelectedLabel();\n return (label ?? 'HEX').toLowerCase() as WrColorPickerTab;\n }\n\n /** Show a different set of numeric fields. An already-active tab is left alone. */\n async setTab(tab: WrColorPickerTab): Promise<void> {\n if ((await this.getTab()) === tab) return;\n await (await this.tabs()).select({ label: tab.toUpperCase() });\n }\n\n /**\n * The canonical hex string, as the HEX field shows it — 8 digits while `alpha` is\n * on, 6 while it is off.\n *\n * This is the picker's colour, and deliberately not the same thing as its `value`:\n * `format` decides whether `value` is written as hex, `rgb()` or `hsl()`, while the\n * field always shows hex. A spec that cares about the emitted string should read\n * the bound signal; one that cares about the COLOUR should read this.\n *\n * Throws off the HEX tab, where the field does not exist — see {@link setTab}.\n */\n async getHex(): Promise<string> {\n const field = await this.hexField();\n if (!field) {\n throw new Error(\n `WrColorPickerHarness.getHex(): the HEX field is not rendered — the picker is showing the ` +\n `${(await this.getTab()).toUpperCase()} tab. Call setTab('hex') first.`\n );\n }\n return field.getProperty<string>('value');\n }\n\n /**\n * Type a colour into the HEX field.\n *\n * Typed rather than assigned, because that is the path the component is built\n * around: it re-parses on every keystroke and applies the first spelling that\n * parses, so a partial `#ff8` commits a colour on its way to `#ff8800`. An\n * unparseable string leaves the committed colour ALONE and lives in the field\n * until {@link blurHex} snaps it back — assert that rather than expecting a throw.\n */\n async setHex(value: string): Promise<void> {\n const field = await this.requireHexField('setHex');\n await field.clear();\n await field.sendKeys(value);\n }\n\n /**\n * Blur the HEX field — re-syncing it with the committed colour and emitting\n * `touch`.\n *\n * The re-sync is the visible half: a field left holding text that never parsed\n * goes back to the canonical hex here, and nowhere else.\n */\n async blurHex(): Promise<void> {\n await (await this.requireHexField('blurHex')).blur();\n }\n\n /** Whether the HEX field currently holds focus. */\n async isHexFocused(): Promise<boolean> {\n return (await this.requireHexField('isHexFocused')).isFocused();\n }\n\n /** The three RGB channels as the RGB tab shows them. Throws off that tab. */\n async getRgb(): Promise<{ r: number; g: number; b: number }> {\n const [r, g, b] = await this.channelValues('rgb', ['R', 'G', 'B']);\n return { r, g, b };\n }\n\n /** Write one RGB channel, 0–255. Out-of-range numbers are clamped by the component. */\n async setRgbChannel(channel: 'r' | 'g' | 'b', value: number): Promise<void> {\n await this.writeChannel('rgb', channel.toUpperCase(), value);\n }\n\n /**\n * Hue, saturation and lightness as the HSL tab shows them — degrees and whole\n * percents, already rounded for display. Throws off that tab.\n */\n async getHsl(): Promise<{ h: number; s: number; l: number }> {\n const [h, s, l] = await this.channelValues('hsl', ['H', 'S%', 'L%']);\n return { h, s, l };\n }\n\n /** Write one HSL channel — `h` in degrees, `s` / `l` in percent. */\n async setHslChannel(channel: 'h' | 's' | 'l', value: number): Promise<void> {\n await this.writeChannel('hsl', channel === 'h' ? 'H' : `${channel.toUpperCase()}%`, value);\n }\n\n /**\n * Alpha as the whole percent the numeric tabs show, or `null` when the picker was\n * built without alpha.\n *\n * Only the RGB and HSL tabs carry the field — the HEX tab spells alpha into the\n * hex string instead — so this throws on the HEX tab rather than answering `null`,\n * which would read as \"this picker has no alpha\".\n */\n async getAlphaPercent(): Promise<number | null> {\n const tab = await this.getTab();\n if (tab === 'hex') {\n throw new Error(\n 'WrColorPickerHarness.getAlphaPercent(): the HEX tab has no alpha field — the alpha is the last two ' +\n \"digits of getHex(). Call setTab('rgb') or setTab('hsl') to read it as a percent.\"\n );\n }\n if (!(await this.hasAlpha())) return null;\n const [alpha] = await this.channelValues(tab, ['A%']);\n return alpha;\n }\n\n /** Write alpha as a whole percent, 0–100. */\n async setAlphaPercent(value: number): Promise<void> {\n const tab = await this.getTab();\n if (tab === 'hex') {\n throw new Error(\n \"WrColorPickerHarness.setAlphaPercent(): the HEX tab has no alpha field. Call setTab('rgb') first, \" +\n 'or write the two alpha digits through setHex().'\n );\n }\n await this.writeChannel(tab, 'A%', value);\n }\n\n /**\n * Whether the picker offers alpha at all.\n *\n * From the host modifier, which is the one answer that holds on every tab: the\n * alpha SLIDER is always rendered when it is on, while the `A%` field only exists\n * on the two numeric tabs.\n */\n async hasAlpha(): Promise<boolean> {\n return (await this.host()).hasClass('wr-color-picker--alpha');\n }\n\n /**\n * Whether the picker refuses interaction.\n *\n * Read from the modifier the host paints rather than from a field's `disabled`\n * property, because the fields come and go with the tab while the state does not —\n * and the drag surfaces, which have no `disabled` of their own, are gated by the\n * same signal.\n */\n async isDisabled(): Promise<boolean> {\n return (await this.host()).hasClass('wr-color-picker--disabled');\n }\n\n /**\n * The preset colours offered under the fields: the string the consumer passed, or\n * the `value` of a named preset.\n */\n async getSwatches(): Promise<string[]> {\n const swatches = await this.locatorForAll('.wr-color-picker__swatch')();\n return Promise.all(swatches.map(async swatch => (await swatch.getAttribute('data-color')) ?? ''));\n }\n\n /**\n * What each preset button announces, in order: the `label` of a named preset, and\n * the colour string itself for a bare one.\n */\n async getSwatchLabels(): Promise<string[]> {\n const swatches = await this.locatorForAll('.wr-color-picker__swatch')();\n return Promise.all(swatches.map(async swatch => (await swatch.getAttribute('aria-label')) ?? ''));\n }\n\n /**\n * Click a preset.\n *\n * Matched on the colour string the consumer passed, or on a named preset's label —\n * the rendered background is a CSS colour and would come back normalised and\n * alpha-stripped. Throws when nothing matches, naming what is offered.\n */\n async pickSwatch(color: string): Promise<void> {\n const swatches = await this.locatorForAll('.wr-color-picker__swatch')();\n for (const swatch of swatches) {\n if ((await swatch.getAttribute('data-color')) === color || (await swatch.getAttribute('aria-label')) === color) {\n await swatch.click();\n return;\n }\n }\n throw new Error(\n `WrColorPickerHarness.pickSwatch(): no swatch for \"${color}\". The picker offers: ` +\n `${(await this.getSwatches()).join(', ')}.`\n );\n }\n\n /** The panel size. `'md'` is the default and paints no modifier of its own. */\n async getSize(): Promise<WrColorPickerSize> {\n const host = await this.host();\n if (await host.hasClass('wr-color-picker--sm')) return 'sm';\n if (await host.hasClass('wr-color-picker--lg')) return 'lg';\n return 'md';\n }\n\n /**\n * Where the three thumbs sit, in percent along their surfaces.\n *\n * The component writes these as inline percentages, so they are readable with no\n * layout at all — which makes them the only evidence a spec has that the surfaces\n * followed a colour set through the fields. A measured position would be zero for\n * all three.\n *\n * The number is always \"along the surface from its own start\", so it is direction\n * free: the SV canvas reports a physical `left` because it does not mirror, and\n * the two tracks report `inset-inline-start` because they do. An RTL spec reads\n * the same value as an LTR one, which is the point — what mirrors is where that\n * fraction lands on screen, not the fraction.\n *\n * Read off the `style` ATTRIBUTE rather than through `getCssValue()`, and the\n * difference is not cosmetic: `getCssValue()` is `getComputedStyle()`, and `left` /\n * `top` on a positioned element resolve to the USED value — so the declared `40%`\n * comes straight back in jsdom and arrives as pixels in a real browser, and the same\n * harness answered 40 here and 96 under a browser runner with nothing to say which\n * one you got. The stylesheet's own `top: 0; left: 0` is a second way that read lies,\n * turning a thumb whose binding is gone into one parked at the origin.\n */\n async getThumbs(): Promise<WrColorPickerThumbs> {\n const sv = await this.locatorFor('.wr-color-picker__sv .wr-color-picker__thumb')();\n const hue = await this.locatorFor('.wr-color-picker__slider--hue .wr-color-picker__thumb')();\n const alpha = await this.locatorForOptional('.wr-color-picker__slider--alpha .wr-color-picker__thumb')();\n\n return {\n sv: { x: await percent(sv, 'left', 'SV'), y: await percent(sv, 'top', 'SV') },\n hue: await percent(hue, 'inset-inline-start', 'hue'),\n alpha: alpha ? await percent(alpha, 'inset-inline-start', 'alpha') : null,\n };\n }\n\n /** The HEX field's value without the tab check — for filters, which must not throw. */\n private async readHex(): Promise<string> {\n const field = await this.hexField();\n return field ? field.getProperty<string>('value') : '';\n }\n\n private async requireHexField(method: string): Promise<TestElement> {\n const field = await this.hexField();\n if (!field) {\n throw new Error(\n `WrColorPickerHarness.${method}(): the HEX field is not rendered — the picker is showing the ` +\n `${(await this.getTab()).toUpperCase()} tab. Call setTab('hex') first.`\n );\n }\n return field;\n }\n\n private async channelValues(tab: WrColorPickerTab, labels: readonly string[]): Promise<number[]> {\n await this.requireTab(tab, 'read');\n const inputs = await this.inputsByLabel();\n\n return labels.map(label => {\n const input = inputs.get(label);\n if (!input) throw new Error(`WrColorPickerHarness: the ${tab.toUpperCase()} tab has no \"${label}\" field.`);\n return Number(input.value);\n });\n }\n\n private async writeChannel(tab: WrColorPickerTab, label: string, value: number): Promise<void> {\n await this.requireTab(tab, 'write');\n const inputs = await this.inputsByLabel();\n const found = inputs.get(label);\n if (!found) {\n throw new Error(\n `WrColorPickerHarness: the ${tab.toUpperCase()} tab has no \"${label}\" field. ${\n label === 'A%' ? 'This picker was built with `[alpha]=\"false\"`.' : ''\n }`\n );\n }\n\n // Set and dispatch once, rather than clearing and typing. Each of these inputs\n // is bound to `[value]`, and the component commits on every `input` event — so\n // typing 128 would land 1, then 12, then 128, and CLEARING would land 0 first,\n // because `Number('')` is 0 rather than NaN. A spec that asked for one colour\n // would get four, the first of them black.\n await found.element.setInputValue(String(value));\n await found.element.dispatchEvent('input');\n }\n\n private async requireTab(tab: WrColorPickerTab, verb: string): Promise<void> {\n const current = await this.getTab();\n if (current !== tab) {\n throw new Error(\n `WrColorPickerHarness: cannot ${verb} the ${tab.toUpperCase()} channels while the picker is showing ` +\n `the ${current.toUpperCase()} tab — those fields are not rendered. Call setTab('${tab}') first.`\n );\n }\n }\n\n /** Every numeric input of the current tab, keyed by the label printed under it. */\n private async inputsByLabel(): Promise<Map<string, { element: TestElement; value: string }>> {\n const found = new Map<string, { element: TestElement; value: string }>();\n\n for (const field of await this.locatorForAll(FieldHarness)()) {\n const label = await field.getLabel();\n found.set(label, { element: await field.getInput(), value: await field.getValue() });\n }\n return found;\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 { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';\n\nimport type { WrColorPickerTriggerHarnessFilters } from './types';\nimport { WrColorPickerHarness } from './wr-color-picker-harness';\n\n/**\n * Test harness for `[wrColorPickerTrigger]` — the element that opens a\n * `<wr-color-picker>` in an overlay.\n *\n * The trigger stays in your fixture; the picker it opens does not. So this harness\n * is loaded from the fixture loader like any element, and {@link getPicker} reaches\n * ACROSS into the overlay container for you — scoped by the panel id the trigger\n * publishes through `aria-controls`, never by `.wr-color-picker-overlay`, which\n * answers with whichever trigger opened first.\n *\n * @example\n * ```ts\n * const trigger = await loader.getHarness(WrColorPickerTriggerHarness);\n * const picker = await trigger.open();\n *\n * await picker.setHex('#3969e2');\n * await trigger.sendEscape();\n * expect(await trigger.isOpen()).toBe(false);\n * ```\n *\n * @see https://ngwr.dev/guides/testing\n */\nexport class WrColorPickerTriggerHarness extends ComponentHarness {\n static hostSelector = '[wrColorPickerTrigger]';\n\n /** Build a predicate that narrows the query — pass to `getHarness` / `getAllHarnesses`. */\n static with(options: WrColorPickerTriggerHarnessFilters = {}): HarnessPredicate<WrColorPickerTriggerHarness> {\n return new HarnessPredicate(WrColorPickerTriggerHarness, options)\n .addOption('text', options.text, (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text))\n .addOption('open', options.open, async (harness, open) => (await harness.isOpen()) === open);\n }\n\n /** The trigger's own text, trimmed. */\n async getText(): Promise<string> {\n return (await this.host()).text();\n }\n\n /** Whether the picker is showing, from the trigger's `aria-expanded`. */\n async isOpen(): Promise<boolean> {\n return (await (await this.host()).getAttribute('aria-expanded')) === 'true';\n }\n\n /**\n * Whether the trigger refuses to open.\n *\n * From `aria-disabled`, which the directive writes for its own `disabled` input.\n * The host is usually a `<button>`, but the directive does not touch its `disabled`\n * PROPERTY — a consumer who binds that as well turns the element off at the DOM\n * level, which is a stronger thing and reads here too.\n */\n async isDisabled(): Promise<boolean> {\n const host = await this.host();\n return (await host.getAttribute('aria-disabled')) === 'true' || (await host.getProperty<boolean>('disabled'));\n }\n\n /**\n * The picker this trigger opened, or `null` while it is closed.\n *\n * Scoped by the id in `aria-controls`, so two triggers open at once — which\n * nothing in the component prevents, since only an outside click closes one —\n * answer with their own panels rather than with whichever came first.\n */\n async getPicker(): Promise<WrColorPickerHarness | null> {\n const id = await (await this.host()).getAttribute('aria-controls');\n if (!id) return null;\n\n return this.documentRootLocatorFactory().locatorForOptional(WrColorPickerHarness.with({ ancestor: `#${id}` }))();\n }\n\n /**\n * Open the picker and hand it back. An already-open trigger is left alone.\n *\n * Throws on a disabled trigger rather than answering `null` three lines later:\n * `toggle()` returns early while `disabled` is set, so the click lands and nothing\n * happens at all.\n */\n async open(): Promise<WrColorPickerHarness> {\n if (!(await this.isOpen())) {\n if (await this.isDisabled()) {\n throw new Error(\n `WrColorPickerTriggerHarness.open(): \"${await this.getText()}\" is disabled — the directive turns its ` +\n 'own toggle away, so the click would land and change nothing.'\n );\n }\n await (await this.host()).click();\n }\n\n const picker = await this.getPicker();\n if (!picker) {\n throw new Error(\n 'WrColorPickerTriggerHarness.open(): the trigger reports itself open but published no panel to find. ' +\n 'That is a broken `aria-controls` pairing, not a timing problem.'\n );\n }\n return picker;\n }\n\n /** Close the picker. An already-closed trigger is left alone. */\n async close(): Promise<void> {\n if (!(await this.isOpen())) return;\n await (await this.host()).click();\n }\n\n /** Click the trigger once, whichever way that takes it. */\n async toggle(): Promise<void> {\n await (await this.host()).click();\n }\n\n /**\n * Press Escape.\n *\n * Sent to the TRIGGER, and it still reaches the picker: the overlay listens through\n * the CDK's keyboard dispatcher, which keeps one document listener and routes to\n * the top-most overlay — so this does not depend on where focus happens to be.\n */\n async sendEscape(): Promise<void> {\n await (await this.host()).sendKeys(TestKey.ESCAPE);\n }\n\n /** The role the trigger claims to open — `dialog`. */\n async getHasPopup(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-haspopup');\n }\n}\n"],"mappings":";;;;;;;;AAmBA,IAAM,eAAN,cAA2B,iBAAgB;CACzC,OAAO,eAAe;CAEtB,MAAM,WAAQ;EACZ,QAAQ,MAAM,KAAK,WAAW,+BAA+B,CAAC,CAAA,EAAA,CAAI,KAAI;CACxE;CAEA,MAAM,WAAQ;EACZ,OAAO,KAAK,WAAW,OAAO,CAAC,CAAA;CACjC;CAEA,MAAM,WAAQ;EACZ,QAAQ,MAAM,KAAK,SAAQ,EAAA,CAAI,YAAoB,OAAO;CAC5D;;AAaF,MAAM,YAAY;CAChB,MAAM;CACN,KAAK;CACL,sBAAsB;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