@heartlandone/vega 2.76.0 → 2.77.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/dist/cjs/{app-globals-12b7d808.js → app-globals-04e7024b.js} +2 -2
- package/dist/cjs/aria-attributes-value-mapper-f58c73f8.js +136 -0
- package/dist/cjs/{child-nodes-event-prevent-slimmer-84435957.js → child-nodes-event-prevent-slimmer-cc6d2919.js} +1 -1
- package/dist/cjs/{design-token-41baf118.js → design-token-c49717c8.js} +1 -1
- package/dist/cjs/{element-appender-slimmer-34e4eb56.js → element-appender-slimmer-38583ca9.js} +2 -2
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/legend-input-processor-1e53e5bc.js +2126 -0
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{responsive-format-facade-ea59bdcd.js → responsive-format-facade-acc39a40.js} +1 -1
- package/dist/cjs/{style-formatter-0c3ced39.js → style-formatter-028af284.js} +1 -1
- package/dist/cjs/{token-extension-07cac85d.js → token-extension-ffcaeae0.js} +98 -77
- package/dist/cjs/vega-accordion.cjs.entry.js +5 -5
- package/dist/cjs/vega-app-header-button.cjs.entry.js +18 -143
- package/dist/cjs/vega-banner.cjs.entry.js +1 -1
- package/dist/cjs/vega-bar-chart.cjs.entry.js +2 -2
- package/dist/cjs/vega-box.cjs.entry.js +4 -4
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/vega-button-circle.cjs.entry.js +21 -6
- package/dist/cjs/vega-button-group_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-button-link.cjs.entry.js +2 -2
- package/dist/cjs/vega-button.cjs.entry.js +3 -3
- package/dist/cjs/vega-calendar_4.cjs.entry.js +2 -2
- package/dist/cjs/vega-card.cjs.entry.js +3 -3
- package/dist/cjs/vega-carousel.cjs.entry.js +2 -2
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-chip.cjs.entry.js +4 -4
- package/dist/cjs/vega-code-block.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +2 -2
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +29 -7
- package/dist/cjs/vega-dialog_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-divider.cjs.entry.js +3 -3
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +4 -4
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-flag-icon.cjs.entry.js +3 -3
- package/dist/cjs/vega-flex.cjs.entry.js +4 -4
- package/dist/cjs/vega-font.cjs.entry.js +3 -3
- package/dist/cjs/vega-form.cjs.entry.js +2 -2
- package/dist/cjs/vega-grid.cjs.entry.js +3 -3
- package/dist/cjs/vega-icon.cjs.entry.js +3 -3
- package/dist/cjs/vega-image-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-numeric.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-passcode.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +4753 -5585
- package/dist/cjs/vega-input-range.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-select.cjs.entry.js +3 -3
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +3 -3
- package/dist/cjs/vega-line-chart.cjs.entry.js +325 -23
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +3 -3
- package/dist/cjs/vega-pie-chart.cjs.entry.js +5 -88
- package/dist/cjs/vega-popover_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-radio_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +14 -0
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +2 -2
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +2 -2
- package/dist/cjs/vega-signature-capture.cjs.entry.js +3 -3
- package/dist/cjs/vega-stepper.cjs.entry.js +2 -2
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-table_11.cjs.entry.js +3 -3
- package/dist/cjs/vega-textarea.cjs.entry.js +2 -2
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +3 -3
- package/dist/cjs/vega.cjs.js +4 -4
- package/dist/cjs/y-axis-input-processor-54a26515.js +832 -0
- package/dist/collection/components/vega-accordion/slimmers/vega-accordion-renderer.js +1 -1
- package/dist/collection/components/vega-accordion/vega-accordion.css +5 -0
- package/dist/collection/components/vega-button-circle/vega-button-circle.js +17 -3
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.js +16 -2
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.css +184 -207
- package/dist/collection/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.js +32 -0
- package/dist/collection/components/vega-input-phone-number/slimmers/controllers/country-select-controller.js +1 -1
- package/dist/collection/components/vega-input-phone-number/slimmers/controllers/vega-input-phone-number-value-controller.js +1 -1
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/country-select-renderer.js +1 -1
- package/dist/collection/components/vega-input-phone-number/slimmers/renderers/phone-number-input-renderer.js +1 -1
- package/dist/collection/components/vega-input-phone-number/vega-input-phone-number.js +4 -4
- package/dist/collection/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.js +15 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +15 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +2 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/function-extension.js +0 -11
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +23 -23
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-extension.js +0 -10
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.js +7 -17
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +12 -16
- package/dist/collection/components/vega-rich-text-editor/helpers/extension-context-manager.js +31 -0
- package/dist/collection/components/vega-rich-text-editor/helpers/extension-context-manager.test.js +19 -0
- package/dist/collection/components/vega-rich-text-editor/test/extensions/extension-test-utils.js +41 -0
- package/dist/collection/helpers/chart/input-processors/format-time-positions-input-processor.js +2 -2
- package/dist/collection/helpers/chart/input-processors/pie-chart-arc-path-input-processor.js +1 -1
- package/dist/collection/helpers/chart/input-processors/x-axis-input-processor.js +5 -3
- package/dist/collection/helpers/chart/input-processors/x-axis-label-formatter-input-processor.js +2 -1
- package/dist/collection/helpers/chart/input-processors/y-axis-input-processor.js +7 -5
- package/dist/collection/helpers/chart/interacting-entry-generator/arc-path-hover-generator.js +1 -1
- package/dist/collection/helpers/chart/interacting-entry-generator/pie-legend-hover-generator.js +1 -1
- package/dist/collection/helpers/chart/renderers/canvas-renderer.js +1 -1
- package/dist/collection/helpers/chart/renderers/svg-renderer.js +1 -1
- package/dist/collection/helpers/chart/test/drawers/arc-path-drawer.test.js +1 -1
- package/dist/collection/helpers/chart/test/input-processors/format-time-positions-input-processor.test.js +1 -1
- package/dist/collection/helpers/chart/test/input-processors/sort-positions-input-processor.test.js +1 -1
- package/dist/collection/helpers/chart/test/input-processors/x-axis-input-processor.test.js +39 -0
- package/dist/collection/helpers/chart/test/input-processors/x-axis-label-formatter-input-processor.test.js +61 -14
- package/dist/collection/helpers/chart/test/input-processors/y-axis-input-processor.coverage.test.js +39 -0
- package/dist/collection/helpers/chart/test/input-processors/y-axis-input-processor.test.js +14 -0
- package/dist/collection/helpers/chart/test/renderers/svg-renderer.test.js +1 -1
- package/dist/collection/helpers/common/test/wait-for-component-did-render.test.js +67 -0
- package/dist/collection/helpers/slimmers/mutation-observer/aria-attributes-value-mapper.js +4 -0
- package/dist/collection/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.js +1 -1
- package/dist/collection/helpers/validator/rules/valid-phone-number-rule.js +1 -1
- package/dist/collection/helpers/validator/test/rules/valid-phone-number-rule.test.js +10 -0
- package/dist/collection/polyfill/d3/d3-array-polyfill.js +89 -0
- package/dist/collection/polyfill/d3/d3-axis-polyfill.js +195 -0
- package/dist/collection/polyfill/d3/d3-scale-polyfill.js +582 -0
- package/dist/collection/polyfill/d3/d3-selection-polyfill.js +274 -0
- package/dist/collection/polyfill/d3/d3-shape-polyfill.js +252 -0
- package/dist/collection/polyfill/d3/d3-time-format-polyfill.js +207 -0
- package/dist/collection/polyfill/d3/d3-time-polyfill.js +99 -0
- package/dist/collection/polyfill/d3/index.js +31 -0
- package/dist/collection/polyfill/d3/test/d3-array-polyfill.test.js +72 -0
- package/dist/collection/polyfill/d3/test/d3-axis-polyfill.test.js +171 -0
- package/dist/collection/polyfill/d3/test/d3-integration.test.js +137 -0
- package/dist/collection/polyfill/d3/test/d3-scale-polyfill.test.js +382 -0
- package/dist/collection/polyfill/d3/test/d3-selection-polyfill.test.js +239 -0
- package/dist/collection/polyfill/d3/test/d3-shape-polyfill.test.js +225 -0
- package/dist/collection/polyfill/d3/test/d3-time-format-polyfill.test.js +162 -0
- package/dist/collection/polyfill/d3/test/d3-time-polyfill.test.js +76 -0
- package/dist/collection/polyfill/d3/test/index.test.js +78 -0
- package/dist/collection/polyfill/libphonenumber/as-you-type.js +405 -0
- package/dist/collection/polyfill/libphonenumber/format-helpers.js +186 -0
- package/dist/collection/polyfill/libphonenumber/index.js +22 -0
- package/dist/collection/polyfill/libphonenumber/metadata.js +150 -0
- package/dist/collection/polyfill/libphonenumber/metadata.json.js +3900 -0
- package/dist/collection/polyfill/libphonenumber/parse-phone-number.js +127 -0
- package/dist/collection/polyfill/libphonenumber/phone-number.js +38 -0
- package/dist/collection/polyfill/libphonenumber/test/as-you-type.test.js +309 -0
- package/dist/collection/polyfill/libphonenumber/test/format-helpers.test.js +192 -0
- package/dist/collection/polyfill/libphonenumber/test/index.test.js +16 -0
- package/dist/collection/polyfill/libphonenumber/test/metadata.test.js +196 -0
- package/dist/collection/polyfill/libphonenumber/test/parse-phone-number.test.js +218 -0
- package/dist/collection/polyfill/libphonenumber/test/phone-number.test.js +56 -0
- package/dist/collection/polyfill/libphonenumber/types.js +23 -0
- package/dist/esm/{app-globals-c0676920.js → app-globals-32055795.js} +2 -2
- package/dist/esm/aria-attributes-value-mapper-d4fef46a.js +134 -0
- package/dist/esm/{child-nodes-event-prevent-slimmer-649b9d30.js → child-nodes-event-prevent-slimmer-331312b8.js} +1 -1
- package/dist/esm/{design-token-4aee1c56.js → design-token-5bc034e1.js} +1 -1
- package/dist/esm/{element-appender-slimmer-e4713a72.js → element-appender-slimmer-9ea377d0.js} +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/legend-input-processor-122008c5.js +2116 -0
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{responsive-format-facade-7a071174.js → responsive-format-facade-aa705823.js} +1 -1
- package/dist/esm/{style-formatter-3d06b72d.js → style-formatter-28138f5c.js} +1 -1
- package/dist/esm/{token-extension-e33fd151.js → token-extension-73e4460a.js} +98 -77
- package/dist/esm/vega-accordion.entry.js +5 -5
- package/dist/esm/vega-app-header-button.entry.js +17 -142
- package/dist/esm/vega-banner.entry.js +1 -1
- package/dist/esm/vega-bar-chart.entry.js +2 -2
- package/dist/esm/vega-box.entry.js +4 -4
- package/dist/esm/vega-breadcrumb.entry.js +2 -2
- package/dist/esm/vega-button-circle.entry.js +21 -6
- package/dist/esm/vega-button-group_2.entry.js +2 -2
- package/dist/esm/vega-button-link.entry.js +2 -2
- package/dist/esm/vega-button.entry.js +3 -3
- package/dist/esm/vega-calendar_4.entry.js +2 -2
- package/dist/esm/vega-card.entry.js +3 -3
- package/dist/esm/vega-carousel.entry.js +2 -2
- package/dist/esm/vega-checkbox_2.entry.js +2 -2
- package/dist/esm/vega-chip.entry.js +4 -4
- package/dist/esm/vega-code-block.entry.js +2 -2
- package/dist/esm/vega-combo-box.entry.js +2 -2
- package/dist/esm/vega-date-picker_2.entry.js +29 -7
- package/dist/esm/vega-dialog_2.entry.js +4 -4
- package/dist/esm/vega-divider.entry.js +3 -3
- package/dist/esm/vega-dropdown_5.entry.js +4 -4
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-flag-icon.entry.js +3 -3
- package/dist/esm/vega-flex.entry.js +4 -4
- package/dist/esm/vega-font.entry.js +3 -3
- package/dist/esm/vega-form.entry.js +2 -2
- package/dist/esm/vega-grid.entry.js +3 -3
- package/dist/esm/vega-icon.entry.js +3 -3
- package/dist/esm/vega-image-uploader.entry.js +3 -3
- package/dist/esm/vega-input-credit-card.entry.js +2 -2
- package/dist/esm/vega-input-numeric.entry.js +2 -2
- package/dist/esm/vega-input-passcode.entry.js +2 -2
- package/dist/esm/vega-input-phone-number.entry.js +4753 -5585
- package/dist/esm/vega-input-range.entry.js +2 -2
- package/dist/esm/vega-input-select.entry.js +3 -3
- package/dist/esm/vega-left-nav_5.entry.js +3 -3
- package/dist/esm/vega-line-chart.entry.js +311 -9
- package/dist/esm/vega-loader-wrapper_2.entry.js +2 -2
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +3 -3
- package/dist/esm/vega-pie-chart.entry.js +5 -88
- package/dist/esm/vega-popover_2.entry.js +4 -4
- package/dist/esm/vega-progress-tracker_2.entry.js +2 -2
- package/dist/esm/vega-radio_2.entry.js +2 -2
- package/dist/esm/vega-rich-text-content.entry.js +14 -0
- package/dist/esm/vega-rich-text-editor_4.entry.js +2 -2
- package/dist/esm/vega-selection-chip_2.entry.js +3 -3
- package/dist/esm/vega-selection-tile_2.entry.js +2 -2
- package/dist/esm/vega-sidenav_3.entry.js +2 -2
- package/dist/esm/vega-signature-capture.entry.js +3 -3
- package/dist/esm/vega-stepper.entry.js +2 -2
- package/dist/esm/vega-tab-group_2.entry.js +2 -2
- package/dist/esm/vega-table_11.entry.js +3 -3
- package/dist/esm/vega-textarea.entry.js +2 -2
- package/dist/esm/vega-time-picker_2.entry.js +4 -4
- package/dist/esm/vega-tooltip_2.entry.js +3 -3
- package/dist/esm/vega.js +4 -4
- package/dist/esm/y-axis-input-processor-c7e05353.js +826 -0
- package/dist/sri/vega-sri-manifest.json +234 -230
- package/dist/types/components/vega-button-circle/vega-button-circle.d.ts +2 -0
- package/dist/types/components/vega-date-picker/types.d.ts +14 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/slimmers/renderers/vega-date-picker-month-item-renderer.d.ts +3 -0
- package/dist/types/components/vega-date-picker/vega-date-picker-calendar/vega-date-picker-calendar.d.ts +9 -1
- package/dist/types/components/vega-rich-text-content/slimmers/renderers/vega-rich-text-content-renderer.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/extensions/base-extension-renderer.d.ts +9 -1
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +9 -1
- package/dist/types/components/vega-rich-text-editor/extensions/functions/function-extension.d.ts +0 -7
- package/dist/types/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.d.ts +5 -10
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +1 -5
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.d.ts +3 -8
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.d.ts +5 -9
- package/dist/types/components/vega-rich-text-editor/helpers/extension-context-manager.d.ts +26 -0
- package/dist/types/components/vega-rich-text-editor/helpers/extension-context-manager.test.d.ts +1 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +4 -0
- package/dist/types/components/vega-rich-text-editor/test/extensions/extension-test-utils.d.ts +21 -0
- package/dist/types/components.d.ts +11 -1
- package/dist/types/helpers/chart/test/input-processors/y-axis-input-processor.coverage.test.d.ts +1 -0
- package/dist/types/helpers/common/test/wait-for-component-did-render.test.d.ts +1 -0
- package/dist/types/polyfill/d3/d3-array-polyfill.d.ts +48 -0
- package/dist/types/polyfill/d3/d3-axis-polyfill.d.ts +53 -0
- package/dist/types/polyfill/d3/d3-scale-polyfill.d.ts +42 -0
- package/dist/types/polyfill/d3/d3-selection-polyfill.d.ts +173 -0
- package/dist/types/polyfill/d3/d3-shape-polyfill.d.ts +129 -0
- package/dist/types/polyfill/d3/d3-time-format-polyfill.d.ts +28 -0
- package/dist/types/polyfill/d3/d3-time-polyfill.d.ts +68 -0
- package/dist/types/polyfill/d3/index.d.ts +27 -0
- package/dist/types/polyfill/d3/test/d3-array-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-axis-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-integration.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-scale-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-selection-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-shape-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-time-format-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/d3-time-polyfill.test.d.ts +1 -0
- package/dist/types/polyfill/d3/test/index.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/as-you-type.d.ts +154 -0
- package/dist/types/polyfill/libphonenumber/format-helpers.d.ts +64 -0
- package/dist/types/polyfill/libphonenumber/index.d.ts +22 -0
- package/dist/types/polyfill/libphonenumber/metadata.d.ts +45 -0
- package/dist/types/polyfill/libphonenumber/metadata.json.d.ts +470 -0
- package/dist/types/polyfill/libphonenumber/parse-phone-number.d.ts +26 -0
- package/dist/types/polyfill/libphonenumber/phone-number.d.ts +24 -0
- package/dist/types/polyfill/libphonenumber/test/as-you-type.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/test/format-helpers.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/test/index.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/test/metadata.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/test/parse-phone-number.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/test/phone-number.test.d.ts +1 -0
- package/dist/types/polyfill/libphonenumber/types.d.ts +77 -0
- package/dist/types/types/components.type.d.ts +1 -0
- package/dist/types/types/flag.type.d.ts +255 -4
- package/dist/types/types/vega-chart.d.ts +10 -11
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-d8fadcdc.entry.js → p-0037068c.entry.js} +1 -1
- package/dist/vega/{p-3d8122ab.entry.js → p-010ff53d.entry.js} +1 -1
- package/dist/vega/{p-bb5e0192.entry.js → p-03004a05.entry.js} +1 -1
- package/dist/vega/{p-f05b8f76.entry.js → p-0572c393.entry.js} +1 -1
- package/dist/vega/{p-02a7d60c.entry.js → p-0a3a285b.entry.js} +1 -1
- package/dist/vega/p-0d4cb1c7.entry.js +1 -0
- package/dist/vega/{p-a7a8a4eb.entry.js → p-100b44c3.entry.js} +1 -1
- package/dist/vega/{p-8dbdd609.entry.js → p-168bb296.entry.js} +1 -1
- package/dist/vega/{p-b136ebba.entry.js → p-1a011d47.entry.js} +1 -1
- package/dist/vega/{p-10734a00.js → p-1a51bf6f.js} +1 -1
- package/dist/vega/{p-6dcdb580.entry.js → p-1deedff2.entry.js} +1 -1
- package/dist/vega/{p-3244c605.entry.js → p-1fa0c7da.entry.js} +1 -1
- package/dist/vega/{p-dd3a94f4.entry.js → p-22056609.entry.js} +1 -1
- package/dist/vega/{p-c29068fb.entry.js → p-2b142818.entry.js} +1 -1
- package/dist/vega/{p-2ba78982.entry.js → p-34bcf4ed.entry.js} +1 -1
- package/dist/vega/{p-94a77fbe.entry.js → p-36a09524.entry.js} +1 -1
- package/dist/vega/{p-154f9cf7.entry.js → p-3c05abd9.entry.js} +1 -1
- package/dist/vega/{p-fd7ddd64.entry.js → p-3ce2b05c.entry.js} +1 -1
- package/dist/vega/{p-28ad1864.entry.js → p-43ff48c0.entry.js} +1 -1
- package/dist/vega/{p-ca5898dc.entry.js → p-4742feef.entry.js} +1 -1
- package/dist/vega/{p-eda988d5.entry.js → p-4aa52ed2.entry.js} +1 -1
- package/dist/vega/{p-d555f677.entry.js → p-4aa94940.entry.js} +1 -1
- package/dist/vega/p-4bee4202.entry.js +1 -0
- package/dist/vega/{p-01d58eb8.entry.js → p-50d074ed.entry.js} +1 -1
- package/dist/vega/{p-033c31d8.entry.js → p-5485c387.entry.js} +1 -1
- package/dist/vega/{p-f14a5eae.entry.js → p-560d2f48.entry.js} +1 -1
- package/dist/vega/{p-bebfbe95.entry.js → p-5833f33b.entry.js} +1 -1
- package/dist/vega/{p-b366deff.entry.js → p-592296d7.entry.js} +1 -1
- package/dist/vega/{p-5831d6d3.entry.js → p-5cfce62d.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-e1431c14.entry.js → p-60f77f5f.entry.js} +1 -1
- package/dist/vega/p-641cdb5c.entry.js +1 -0
- package/dist/vega/{p-32183637.entry.js → p-67745549.entry.js} +1 -1
- package/dist/vega/{p-087ea379.entry.js → p-70df91fb.entry.js} +1 -1
- package/dist/vega/{p-76181a70.entry.js → p-7425cedc.entry.js} +1 -1
- package/dist/vega/{p-89f2e16d.entry.js → p-857069a5.entry.js} +1 -1
- package/dist/vega/p-8e34b266.js +1 -0
- package/dist/vega/{p-32faa460.entry.js → p-9441f2ba.entry.js} +1 -1
- package/dist/vega/{p-2b49686d.entry.js → p-9fb877c1.entry.js} +1 -1
- package/dist/vega/p-a46e977b.entry.js +1 -0
- package/dist/vega/p-ac82b9f9.entry.js +1 -0
- package/dist/vega/p-b1773281.entry.js +1 -0
- package/dist/vega/{p-6d60b66a.entry.js → p-b54dc37c.entry.js} +1 -1
- package/dist/vega/{p-179aad4f.entry.js → p-b5f18f4b.entry.js} +1 -1
- package/dist/vega/{p-7181861a.js → p-bff57aa4.js} +1 -1
- package/dist/vega/{p-d7a78c5e.entry.js → p-c165232c.entry.js} +1 -1
- package/dist/vega/{p-8950987b.entry.js → p-c292ade4.entry.js} +1 -1
- package/dist/vega/p-c2d2faa0.js +1 -0
- package/dist/vega/{p-fc1fa345.js → p-cc5eaa1b.js} +1 -1
- package/dist/vega/p-cccd7648.entry.js +1 -0
- package/dist/vega/{p-7958614a.entry.js → p-cfecc1cb.entry.js} +1 -1
- package/dist/vega/{p-57927b10.entry.js → p-d07f5d5a.entry.js} +1 -1
- package/dist/vega/{p-9a137bab.entry.js → p-d1cfe972.entry.js} +1 -1
- package/dist/vega/{p-d6dbbe61.entry.js → p-d2ee5711.entry.js} +1 -1
- package/dist/vega/{p-b256b7a4.js → p-d78f6ede.js} +1 -1
- package/dist/vega/p-d8180e42.entry.js +1 -0
- package/dist/vega/{p-8b153acd.entry.js → p-daa60a59.entry.js} +1 -1
- package/dist/vega/{p-249df6d2.entry.js → p-db5fa164.entry.js} +1 -1
- package/dist/vega/p-de64f6e6.js +1 -0
- package/dist/vega/p-e4917e76.js +1 -0
- package/dist/vega/{p-2cc9d126.entry.js → p-e6cf2ace.entry.js} +1 -1
- package/dist/vega/p-e7fbef97.js +1 -0
- package/dist/vega/p-f3e6483c.js +1 -0
- package/dist/vega/{p-a560d8c5.entry.js → p-f428086c.entry.js} +1 -1
- package/dist/vega/{p-4e017458.entry.js → p-fc9ac6e9.entry.js} +1 -1
- package/dist/vega/{p-e2af0e24.entry.js → p-ffd48e37.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +2 -6
- package/dist/cjs/legend-input-processor-27c65353.js +0 -4759
- package/dist/cjs/y-axis-input-processor-9fbfd5e7.js +0 -2302
- package/dist/esm/legend-input-processor-5ecae3a7.js +0 -4742
- package/dist/esm/y-axis-input-processor-bc54314a.js +0 -2290
- package/dist/vega/p-1f5e35dc.entry.js +0 -1
- package/dist/vega/p-2e91295d.entry.js +0 -1
- package/dist/vega/p-32033e7a.js +0 -1
- package/dist/vega/p-46b077d9.js +0 -1
- package/dist/vega/p-4e4a0228.entry.js +0 -1
- package/dist/vega/p-644f701a.js +0 -1
- package/dist/vega/p-6a62e476.entry.js +0 -1
- package/dist/vega/p-a13a73fa.entry.js +0 -1
- package/dist/vega/p-be23bef2.js +0 -1
- package/dist/vega/p-c1d13eec.entry.js +0 -1
- package/dist/vega/p-e89e3ede.entry.js +0 -1
- package/dist/vega/p-f3d0f2dc.js +0 -1
- package/dist/vega/p-f5bafc45.entry.js +0 -1
- /package/dist/cjs/{feature-flag-controller-04cb1e69.js → feature-flag-controller-9129ef52.js} +0 -0
- /package/dist/esm/{feature-flag-controller-09ea7e87.js → feature-flag-controller-30f7b625.js} +0 -0
- /package/dist/vega/{p-07cb0243.js → p-18e8d9b7.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FormatTimePositionsInputProcessor } from '../../input-processors/format-time-positions-input-processor';
|
|
2
|
-
import { timeParse as d3TimeParse } from 'd3';
|
|
2
|
+
import { timeParse as d3TimeParse } from '../../../../polyfill/d3';
|
|
3
3
|
describe('formatTimePositionsInputProcessor', () => {
|
|
4
4
|
const formatTimePositionsInputProcessor = new FormatTimePositionsInputProcessor();
|
|
5
5
|
it('should return expect result when call the process function ', () => {
|
package/dist/collection/helpers/chart/test/input-processors/sort-positions-input-processor.test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SortPositionsInputProcessor } from '../../input-processors/sort-positions-input-processor';
|
|
2
|
-
import { timeParse as d3TimeParse } from 'd3';
|
|
2
|
+
import { timeParse as d3TimeParse } from '../../../../polyfill/d3';
|
|
3
3
|
describe('sortPositionsInputProcessor', () => {
|
|
4
4
|
const sortPositionsInputProcessor = new SortPositionsInputProcessor();
|
|
5
5
|
it('should return expect result when call the process function ', () => {
|
|
@@ -36,4 +36,43 @@ describe('scaleGenerator', () => {
|
|
|
36
36
|
expect(xAxisInputProcessor['getScale'](stringData, width, 'category').domain()).toEqual(stringData.map((item) => item.x));
|
|
37
37
|
expect(xAxisInputProcessor['getScale'](stringDataNeedSort, width, 'category', 1, (item, nextItem) => 'ABCD'.indexOf(item) - 'ABCD'.indexOf(nextItem)).domain()).toEqual(['A', 'B', 'C', 'D']);
|
|
38
38
|
});
|
|
39
|
+
it('should fall back to default domains when input data is empty', () => {
|
|
40
|
+
const width = 200;
|
|
41
|
+
expect(xAxisInputProcessor['getScale']([], width, 'value').domain()).toEqual([0, 0]);
|
|
42
|
+
const timeDomain = xAxisInputProcessor['getScale']([], width, 'time', 1).domain();
|
|
43
|
+
expect(timeDomain[0]).toBeInstanceOf(Date);
|
|
44
|
+
expect(timeDomain[1]).toBeInstanceOf(Date);
|
|
45
|
+
expect(Math.abs(timeDomain[1].getTime() - timeDomain[0].getTime())).toBeLessThan(10);
|
|
46
|
+
});
|
|
47
|
+
it('should pass correct padding to getScale based on container tagName', () => {
|
|
48
|
+
const getScaleSpy = jest
|
|
49
|
+
.spyOn(xAxisInputProcessor, 'getScale')
|
|
50
|
+
.mockReturnValue({});
|
|
51
|
+
const previousOutput = {
|
|
52
|
+
width: 200,
|
|
53
|
+
height: 100,
|
|
54
|
+
innerWidth: 200,
|
|
55
|
+
innerHeight: 100,
|
|
56
|
+
top: 0,
|
|
57
|
+
left: 0,
|
|
58
|
+
right: 0,
|
|
59
|
+
bottom: 0,
|
|
60
|
+
};
|
|
61
|
+
const dataSource = [];
|
|
62
|
+
const lineChartInput = {
|
|
63
|
+
dataSource,
|
|
64
|
+
container: document.createElement('vega-line-chart'),
|
|
65
|
+
xAxis: { type: 'value' },
|
|
66
|
+
};
|
|
67
|
+
xAxisInputProcessor.process(lineChartInput, previousOutput);
|
|
68
|
+
expect(getScaleSpy).toHaveBeenLastCalledWith(dataSource, 200, 'value', 1, undefined);
|
|
69
|
+
const divChartInput = {
|
|
70
|
+
dataSource,
|
|
71
|
+
container: document.createElement('div'),
|
|
72
|
+
xAxis: { type: 'value' },
|
|
73
|
+
};
|
|
74
|
+
xAxisInputProcessor.process(divChartInput, previousOutput);
|
|
75
|
+
expect(getScaleSpy).toHaveBeenLastCalledWith(dataSource, 200, 'value', 0.1, undefined);
|
|
76
|
+
getScaleSpy.mockRestore();
|
|
77
|
+
});
|
|
39
78
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { XAxisLabelFormatterInputProcessor } from '../../input-processors/x-axis-label-formatter-input-processor';
|
|
2
|
-
import { scaleTime } from 'd3';
|
|
2
|
+
import { scaleTime } from '../../../../polyfill/d3';
|
|
3
3
|
describe('xAxisLabelFormatterInputProcessor', () => {
|
|
4
4
|
const xAxisLabelFormatterInputProcessor = new XAxisLabelFormatterInputProcessor();
|
|
5
5
|
it('should not override the default scale formatter function when the type is not time or labelFormatter is not empty', () => {
|
|
@@ -41,22 +41,69 @@ describe('xAxisLabelFormatterInputProcessor', () => {
|
|
|
41
41
|
});
|
|
42
42
|
it('should call the expect function when call the time formatter function', () => {
|
|
43
43
|
const mockXAxisLabelFormatterInputProcessor = new XAxisLabelFormatterInputProcessor();
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
|
|
44
|
+
const mockMillisecond = jest.fn((_date) => {
|
|
45
|
+
void _date;
|
|
46
|
+
return '';
|
|
47
|
+
});
|
|
48
|
+
const mockSecond = jest.fn((_date) => {
|
|
49
|
+
void _date;
|
|
50
|
+
return '';
|
|
51
|
+
});
|
|
52
|
+
const mockMinute = jest.fn((_date) => {
|
|
53
|
+
void _date;
|
|
54
|
+
return '';
|
|
55
|
+
});
|
|
56
|
+
const mockHour = jest.fn((_date) => {
|
|
57
|
+
void _date;
|
|
58
|
+
return '';
|
|
59
|
+
});
|
|
60
|
+
const mockDay = jest.fn((_date) => {
|
|
61
|
+
void _date;
|
|
62
|
+
return '';
|
|
63
|
+
});
|
|
64
|
+
const mockWeek = jest.fn((_date) => {
|
|
65
|
+
void _date;
|
|
66
|
+
return '';
|
|
67
|
+
});
|
|
68
|
+
const mockMonth = jest.fn((_date) => {
|
|
69
|
+
void _date;
|
|
70
|
+
return '';
|
|
71
|
+
});
|
|
72
|
+
const mockYear = jest.fn((_date) => {
|
|
73
|
+
void _date;
|
|
74
|
+
return '';
|
|
75
|
+
});
|
|
76
|
+
mockXAxisLabelFormatterInputProcessor['formatMillisecond'] = mockMillisecond;
|
|
77
|
+
mockXAxisLabelFormatterInputProcessor['formatSecond'] = mockSecond;
|
|
78
|
+
mockXAxisLabelFormatterInputProcessor['formatMinute'] = mockMinute;
|
|
79
|
+
mockXAxisLabelFormatterInputProcessor['formatHour'] = mockHour;
|
|
80
|
+
mockXAxisLabelFormatterInputProcessor['formatDay'] = mockDay;
|
|
81
|
+
mockXAxisLabelFormatterInputProcessor['formatWeek'] = mockWeek;
|
|
82
|
+
mockXAxisLabelFormatterInputProcessor['formatMonth'] = mockMonth;
|
|
83
|
+
mockXAxisLabelFormatterInputProcessor['formatYear'] = mockYear;
|
|
84
|
+
// millisecond: has ms
|
|
85
|
+
mockXAxisLabelFormatterInputProcessor['timeFormatter'](new Date('2023-03-02T00:00:00.100Z'));
|
|
86
|
+
expect(mockMillisecond).toBeCalledTimes(1);
|
|
87
|
+
// second: at second boundary but within a minute
|
|
88
|
+
mockXAxisLabelFormatterInputProcessor['timeFormatter'](new Date('2023-03-02T00:00:01.000Z'));
|
|
54
89
|
expect(mockSecond).toBeCalledTimes(1);
|
|
55
|
-
|
|
90
|
+
// minute: at minute boundary but within an hour
|
|
91
|
+
mockXAxisLabelFormatterInputProcessor['timeFormatter'](new Date('2023-03-02T00:01:00.000Z'));
|
|
56
92
|
expect(mockMinute).toBeCalledTimes(1);
|
|
57
|
-
|
|
93
|
+
// hour: at hour boundary but within a day
|
|
94
|
+
mockXAxisLabelFormatterInputProcessor['timeFormatter'](new Date('2023-03-02T01:00:00.000Z'));
|
|
58
95
|
expect(mockHour).toBeCalledTimes(1);
|
|
59
|
-
|
|
96
|
+
// day: at day boundary but not week boundary (Thu)
|
|
97
|
+
mockXAxisLabelFormatterInputProcessor['timeFormatter'](new Date('2023-03-02T00:00:00.000Z'));
|
|
60
98
|
expect(mockDay).toBeCalledTimes(1);
|
|
99
|
+
// week: at week boundary (Sun) but not month boundary
|
|
100
|
+
mockXAxisLabelFormatterInputProcessor['timeFormatter'](new Date('2023-03-05T00:00:00.000Z'));
|
|
101
|
+
expect(mockWeek).toBeCalledTimes(1);
|
|
102
|
+
// month: at month boundary but not year boundary
|
|
103
|
+
mockXAxisLabelFormatterInputProcessor['timeFormatter'](new Date('2023-02-01T00:00:00.000Z'));
|
|
104
|
+
expect(mockMonth).toBeCalledTimes(1);
|
|
105
|
+
// year: at year boundary
|
|
106
|
+
mockXAxisLabelFormatterInputProcessor['timeFormatter'](new Date('2023-01-01T00:00:00.000Z'));
|
|
107
|
+
expect(mockYear).toBeCalledTimes(1);
|
|
61
108
|
});
|
|
62
109
|
});
|
package/dist/collection/helpers/chart/test/input-processors/y-axis-input-processor.coverage.test.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
describe('YAxisInputProcessor - coverage-only branches', () => {
|
|
2
|
+
it('should fall back when polyfill returns undefined/empty', () => {
|
|
3
|
+
jest.isolateModules(() => {
|
|
4
|
+
const createdScales = [];
|
|
5
|
+
jest.doMock('../../../../polyfill/d3', () => {
|
|
6
|
+
const scaleLinear = jest.fn(() => {
|
|
7
|
+
const scale = {
|
|
8
|
+
domain: jest.fn(function () {
|
|
9
|
+
return this;
|
|
10
|
+
}),
|
|
11
|
+
range: jest.fn(function () {
|
|
12
|
+
return this;
|
|
13
|
+
}),
|
|
14
|
+
// intentionally no ticks()
|
|
15
|
+
};
|
|
16
|
+
createdScales.push(scale);
|
|
17
|
+
return scale;
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
scaleLinear,
|
|
21
|
+
max: jest.fn(() => undefined),
|
|
22
|
+
min: jest.fn(() => undefined),
|
|
23
|
+
extent: jest.fn(() => [undefined, undefined]),
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
27
|
+
const requiredModule = require('../../input-processors/y-axis-input-processor');
|
|
28
|
+
const processor = new requiredModule.YAxisInputProcessor();
|
|
29
|
+
const data = [{ x: 1, y: 0 }];
|
|
30
|
+
const result = processor['getScale'](data, [200, 0], 4);
|
|
31
|
+
expect(result.ticks).toBe(4);
|
|
32
|
+
expect(createdScales.length).toBe(2);
|
|
33
|
+
expect(createdScales[0].domain).toHaveBeenCalledWith([0, 0]);
|
|
34
|
+
expect(createdScales[1].domain).toHaveBeenCalledWith([0, 0]);
|
|
35
|
+
expect(createdScales[1].range).toHaveBeenCalledWith([200, 0]);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
export {};
|
|
@@ -14,6 +14,20 @@ describe('scaleGenerator', () => {
|
|
|
14
14
|
]);
|
|
15
15
|
expect(yAxisInputProcessor['getScale'](numberData, [height, 0], 4).scale.domain()[0]).toEqual(0);
|
|
16
16
|
});
|
|
17
|
+
it('should expand domain/ticks when tick rounding excludes min/max', () => {
|
|
18
|
+
// Use values where the generated tick start/stop (based on a rounded step)
|
|
19
|
+
// does not include the data min/max, forcing both min and max adjustments.
|
|
20
|
+
const numberData = [
|
|
21
|
+
{ x: 1, y: -125 },
|
|
22
|
+
{ x: 2, y: 210 },
|
|
23
|
+
];
|
|
24
|
+
const height = 200;
|
|
25
|
+
const result = yAxisInputProcessor['getScale'](numberData, [height, 0], 4);
|
|
26
|
+
const domain = result.scale.domain();
|
|
27
|
+
expect(domain[0]).toBeLessThanOrEqual(-125);
|
|
28
|
+
expect(domain[1]).toBeGreaterThanOrEqual(210);
|
|
29
|
+
expect(result.ticks).toBeGreaterThan(4);
|
|
30
|
+
});
|
|
17
31
|
// VD-992
|
|
18
32
|
it('should return the correct min data when call the getScale function', () => {
|
|
19
33
|
const numberData = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SVGRenderer } from '../../renderers/svg-renderer';
|
|
2
|
-
import { scaleLinear } from 'd3';
|
|
2
|
+
import { scaleLinear } from '../../../../polyfill/d3';
|
|
3
3
|
describe('svg renderer', () => {
|
|
4
4
|
it('should set context layout when run the set layout function', () => {
|
|
5
5
|
const context = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { waitForComponentDidRender } from '../index';
|
|
2
|
+
import ChangeManager from '../../change-manager/change-manager';
|
|
3
|
+
import domNodeSubjectFactory from '../../change-manager/subject/dom-node-subject/dom-node-subject-factory';
|
|
4
|
+
import { VegaInternalComponentDidRender } from '../../event-manager/event-id/vega-internal-event-id';
|
|
5
|
+
/**
|
|
6
|
+
* Creates a minimal HTMLStencilElement-compatible HTMLElement for testing.
|
|
7
|
+
*/
|
|
8
|
+
function createComponentRef() {
|
|
9
|
+
return document.createElement('div');
|
|
10
|
+
}
|
|
11
|
+
describe('waitForComponentDidRender', () => {
|
|
12
|
+
it('resolves the promise when ChangeManager notifies the subject', async () => {
|
|
13
|
+
const componentRef = createComponentRef();
|
|
14
|
+
// Start waiting — do NOT await yet; we need to trigger the notify first.
|
|
15
|
+
const waitPromise = waitForComponentDidRender(componentRef);
|
|
16
|
+
// Grab the subject that the function just registered an observer on.
|
|
17
|
+
const subject = domNodeSubjectFactory.getSubject(componentRef, VegaInternalComponentDidRender);
|
|
18
|
+
// Simulate the component firing its "componentDidRender" internal event.
|
|
19
|
+
ChangeManager.notify(subject, null);
|
|
20
|
+
// The promise should now be resolved.
|
|
21
|
+
await expect(waitPromise).resolves.toBeNull();
|
|
22
|
+
});
|
|
23
|
+
it('un registers the observer from ChangeManager after the promise resolves', async () => {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
const componentRef = createComponentRef();
|
|
26
|
+
const waitPromise = waitForComponentDidRender(componentRef);
|
|
27
|
+
const subject = domNodeSubjectFactory.getSubject(componentRef, VegaInternalComponentDidRender);
|
|
28
|
+
// Capture the observer count before notification.
|
|
29
|
+
const observersBefore = ((_a = ChangeManager['pubSubMap'].get(subject)) !== null && _a !== void 0 ? _a : []).length;
|
|
30
|
+
// Notify once — this should resolve the promise AND unregister the observer.
|
|
31
|
+
ChangeManager.notify(subject, null);
|
|
32
|
+
await waitPromise;
|
|
33
|
+
// After resolving, the observer must have been removed.
|
|
34
|
+
const observersAfter = ((_b = ChangeManager['pubSubMap'].get(subject)) !== null && _b !== void 0 ? _b : []).length;
|
|
35
|
+
expect(observersAfter).toBe(observersBefore - 1);
|
|
36
|
+
});
|
|
37
|
+
it('resolves with null', async () => {
|
|
38
|
+
const componentRef = createComponentRef();
|
|
39
|
+
const waitPromise = waitForComponentDidRender(componentRef);
|
|
40
|
+
const subject = domNodeSubjectFactory.getSubject(componentRef, VegaInternalComponentDidRender);
|
|
41
|
+
ChangeManager.notify(subject, null);
|
|
42
|
+
const result = await waitPromise;
|
|
43
|
+
expect(result).toBeNull();
|
|
44
|
+
});
|
|
45
|
+
it('registers an observer with ChangeManager before the event fires', async () => {
|
|
46
|
+
const componentRef = createComponentRef();
|
|
47
|
+
// Spy on register BEFORE calling the function under test.
|
|
48
|
+
const registerSpy = jest.spyOn(ChangeManager, 'register');
|
|
49
|
+
const waitPromise = waitForComponentDidRender(componentRef);
|
|
50
|
+
expect(registerSpy).toHaveBeenCalledTimes(1);
|
|
51
|
+
// Clean up — trigger resolve so the promise does not leak.
|
|
52
|
+
const subject = domNodeSubjectFactory.getSubject(componentRef, VegaInternalComponentDidRender);
|
|
53
|
+
ChangeManager.notify(subject, null);
|
|
54
|
+
await waitPromise;
|
|
55
|
+
registerSpy.mockRestore();
|
|
56
|
+
});
|
|
57
|
+
it('calls ChangeManager.unregister when the observer is notified', async () => {
|
|
58
|
+
const componentRef = createComponentRef();
|
|
59
|
+
const unregisterSpy = jest.spyOn(ChangeManager, 'unregister');
|
|
60
|
+
const waitPromise = waitForComponentDidRender(componentRef);
|
|
61
|
+
const subject = domNodeSubjectFactory.getSubject(componentRef, VegaInternalComponentDidRender);
|
|
62
|
+
ChangeManager.notify(subject, null);
|
|
63
|
+
await waitPromise;
|
|
64
|
+
expect(unregisterSpy).toHaveBeenCalledTimes(1);
|
|
65
|
+
unregisterSpy.mockRestore();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -105,6 +105,10 @@ export class AriaAttributesValueMapper extends MutationObserverSlimmer {
|
|
|
105
105
|
finalValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : '';
|
|
106
106
|
}
|
|
107
107
|
try {
|
|
108
|
+
if (String(finalValue).trim() === '') {
|
|
109
|
+
target.removeAttribute(ariaAttr);
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
108
112
|
const existing = target.getAttribute(ariaAttr);
|
|
109
113
|
if (existing !== finalValue) {
|
|
110
114
|
target.setAttribute(ariaAttr, finalValue);
|
package/dist/collection/helpers/slimmers/mutation-observer/test/aria-attributes-value-mapper.test.js
CHANGED
|
@@ -178,7 +178,7 @@ describe('AriaAttributesValueMapper', () => {
|
|
|
178
178
|
comp.connectedCallback();
|
|
179
179
|
comp.componentDidLoad();
|
|
180
180
|
// should set attribute to empty string when no defaultValue provided
|
|
181
|
-
expect(button.getAttribute('aria-label')).toBe(
|
|
181
|
+
expect(button.getAttribute('aria-label')).toBe(null);
|
|
182
182
|
});
|
|
183
183
|
it('should handle empty mutations array (pass undefined to performMapping)', () => {
|
|
184
184
|
const comp = new MockedComponent();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCountryCallingCode, parsePhoneNumber } from 'libphonenumber
|
|
1
|
+
import { getCountryCallingCode, parsePhoneNumber } from '../../../polyfill/libphonenumber';
|
|
2
2
|
import { InternalFormFieldValidationRule } from './internal-form-field-validation-rule.abstract';
|
|
3
3
|
/**
|
|
4
4
|
* A rule that checks if it's a valid phone number
|
|
@@ -74,6 +74,16 @@ describe('ValidPhoneNumberRule', () => {
|
|
|
74
74
|
visible: true,
|
|
75
75
|
})).toEqual(false);
|
|
76
76
|
});
|
|
77
|
+
test('should return invalid result when parsePhoneNumber throws an exception', () => {
|
|
78
|
+
const rule = new ValidPhoneNumberRule(() => 'US');
|
|
79
|
+
// Input containing letters causes parsePhoneNumber to throw NOT_A_NUMBER
|
|
80
|
+
// when extract: false, exercising the catch block in isValidPhoneNumberForCountry
|
|
81
|
+
// eslint-disable-next-line spellcheck/spell-checker
|
|
82
|
+
expect(rule.evaluate('abc123')).toEqual({
|
|
83
|
+
isValid: false,
|
|
84
|
+
message: `Phone number is not valid`,
|
|
85
|
+
});
|
|
86
|
+
});
|
|
77
87
|
test('should return false when the input is empty', () => {
|
|
78
88
|
const rule = new ValidPhoneNumberRule(() => 'US', true);
|
|
79
89
|
expect(rule.canEvaluate('')).toBeFalsy();
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* D3 Array Polyfill - Lightweight array utility functions.
|
|
3
|
+
*
|
|
4
|
+
* This is a drop-in replacement for d3-array, implementing only the methods
|
|
5
|
+
* used in the Vega chart rendering system: min, max, extent, and map.
|
|
6
|
+
*
|
|
7
|
+
* @see VD-5022 - [Zero Dependencies] remove d3 dependency
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Returns the minimum value in the array.
|
|
11
|
+
* Mimics d3.min().
|
|
12
|
+
*
|
|
13
|
+
* @template T
|
|
14
|
+
* @param {T[]} array - Array of values.
|
|
15
|
+
* @param {Function} [accessor] - Optional accessor function.
|
|
16
|
+
* @returns {number | undefined} The minimum value, or undefined for empty arrays.
|
|
17
|
+
*/
|
|
18
|
+
export function min(array, accessor) {
|
|
19
|
+
let result;
|
|
20
|
+
for (let i = 0; i < array.length; i++) {
|
|
21
|
+
const value = accessor ? accessor(array[i], i) : Number(array[i]);
|
|
22
|
+
if (value != null && !Number.isNaN(value)) {
|
|
23
|
+
if (result === undefined || value < result) {
|
|
24
|
+
result = value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Returns the maximum value in the array.
|
|
32
|
+
* Mimics d3.max().
|
|
33
|
+
*
|
|
34
|
+
* @template T
|
|
35
|
+
* @param {T[]} array - Array of values.
|
|
36
|
+
* @param {Function} [accessor] - Optional accessor function.
|
|
37
|
+
* @returns {number | undefined} The maximum value, or undefined for empty arrays.
|
|
38
|
+
*/
|
|
39
|
+
export function max(array, accessor) {
|
|
40
|
+
let result;
|
|
41
|
+
for (let i = 0; i < array.length; i++) {
|
|
42
|
+
const value = accessor ? accessor(array[i], i) : Number(array[i]);
|
|
43
|
+
if (value != null && !Number.isNaN(value)) {
|
|
44
|
+
if (result === undefined || value > result) {
|
|
45
|
+
result = value;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Returns the [min, max] of the array.
|
|
53
|
+
* Mimics d3.extent().
|
|
54
|
+
*
|
|
55
|
+
* @template T
|
|
56
|
+
* @param {T[]} array - Array of values.
|
|
57
|
+
* @returns {[T, T] | [undefined, undefined]} Tuple of [min, max], or [undefined, undefined] for empty arrays.
|
|
58
|
+
*/
|
|
59
|
+
export function extent(array) {
|
|
60
|
+
let minVal;
|
|
61
|
+
let maxVal;
|
|
62
|
+
for (const value of array) {
|
|
63
|
+
if (value != null && value >= value) {
|
|
64
|
+
if (minVal === undefined || value < minVal) {
|
|
65
|
+
minVal = value;
|
|
66
|
+
}
|
|
67
|
+
if (maxVal === undefined || value > maxVal) {
|
|
68
|
+
maxVal = value;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (minVal === undefined || maxVal === undefined) {
|
|
73
|
+
return [undefined, undefined];
|
|
74
|
+
}
|
|
75
|
+
return [minVal, maxVal];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Maps each element of the array through a transform function.
|
|
79
|
+
* Mimics d3.map() (the array mapping function from d3-array, not the Map collection).
|
|
80
|
+
*
|
|
81
|
+
* @template T
|
|
82
|
+
* @template U
|
|
83
|
+
* @param {T[]} array - Input array.
|
|
84
|
+
* @param {Function} mapper - Transform function called with (element, index).
|
|
85
|
+
* @returns {U[]} New array of transformed values.
|
|
86
|
+
*/
|
|
87
|
+
export function map(array, mapper) {
|
|
88
|
+
return array.map(mapper);
|
|
89
|
+
}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* D3 Axis Polyfill - Lightweight SVG axis generators.
|
|
3
|
+
*
|
|
4
|
+
* This is a drop-in replacement for d3-axis, implementing only the methods
|
|
5
|
+
* used in the Vega chart rendering system: axisBottom and axisLeft.
|
|
6
|
+
*
|
|
7
|
+
* @see VD-5022 - [Zero Dependencies] remove d3 dependency
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Internal axis generator class.
|
|
11
|
+
*/
|
|
12
|
+
class AxisGenerator {
|
|
13
|
+
/**
|
|
14
|
+
* @param {AxisScale} scale - The scale to use for the axis.
|
|
15
|
+
* @param {string} orientation - 'bottom' for x-axis, 'left' for y-axis.
|
|
16
|
+
*/
|
|
17
|
+
constructor(scale, orientation) {
|
|
18
|
+
this._tickCount = 10;
|
|
19
|
+
this._tickFormatter = null;
|
|
20
|
+
this._scale = scale;
|
|
21
|
+
this._orientation = orientation;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Sets the number of ticks.
|
|
25
|
+
*
|
|
26
|
+
* @param {number} count - Desired number of ticks.
|
|
27
|
+
*/
|
|
28
|
+
setTickCount(count) {
|
|
29
|
+
this._tickCount = count;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Sets a custom tick format function.
|
|
33
|
+
*
|
|
34
|
+
* @param {Function} formatter - Function to format tick labels.
|
|
35
|
+
*/
|
|
36
|
+
setTickFormatter(formatter) {
|
|
37
|
+
this._tickFormatter = formatter;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Renders the axis into the given SVG <g> selection.
|
|
41
|
+
* Creates a domain path, tick lines, and tick text labels.
|
|
42
|
+
*
|
|
43
|
+
* @param {D3SelectionPolyfill} selection - A D3SelectionPolyfill wrapping an SVG <g> element.
|
|
44
|
+
*/
|
|
45
|
+
render(selection) {
|
|
46
|
+
const g = selection.node();
|
|
47
|
+
if (!g)
|
|
48
|
+
return;
|
|
49
|
+
const doc = g.ownerDocument;
|
|
50
|
+
const tickValues = this.getTickValues();
|
|
51
|
+
const formatter = this.getFormatter();
|
|
52
|
+
const offset = 0.5;
|
|
53
|
+
// Compute band centering offset (d3's center() function)
|
|
54
|
+
const bandOffset = typeof this._scale.bandwidth === 'function'
|
|
55
|
+
? Math.max(0, this._scale.bandwidth() - offset * 2) / 2
|
|
56
|
+
: 0;
|
|
57
|
+
const range = this._scale.range();
|
|
58
|
+
const range0 = +range[0] + offset;
|
|
59
|
+
const range1 = +range[range.length - 1] + offset;
|
|
60
|
+
// Create domain path (with outer tick marks, matching d3's tickSizeOuter = 6)
|
|
61
|
+
const domain = doc.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
62
|
+
domain.setAttribute('class', 'domain');
|
|
63
|
+
domain.setAttribute('stroke', 'currentColor');
|
|
64
|
+
if (this._orientation === 'bottom') {
|
|
65
|
+
domain.setAttribute('d', `M${range0},6V${offset}H${range1}V6`);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
domain.setAttribute('d', `M-6,${range0}H${offset}V${range1}H-6`);
|
|
69
|
+
}
|
|
70
|
+
g.appendChild(domain);
|
|
71
|
+
// Create ticks
|
|
72
|
+
for (const tickValue of tickValues) {
|
|
73
|
+
const position = this._scale(tickValue);
|
|
74
|
+
if (position === undefined)
|
|
75
|
+
continue;
|
|
76
|
+
const finalPosition = position + bandOffset + offset;
|
|
77
|
+
const tickG = doc.createElementNS('http://www.w3.org/2000/svg', 'g');
|
|
78
|
+
tickG.setAttribute('class', 'tick');
|
|
79
|
+
tickG.setAttribute('opacity', '1');
|
|
80
|
+
const tickLine = doc.createElementNS('http://www.w3.org/2000/svg', 'line');
|
|
81
|
+
tickLine.setAttribute('stroke', 'currentColor');
|
|
82
|
+
const tickText = doc.createElementNS('http://www.w3.org/2000/svg', 'text');
|
|
83
|
+
tickText.setAttribute('fill', 'currentColor');
|
|
84
|
+
tickText.textContent = formatter(tickValue);
|
|
85
|
+
// eslint-disable-next-line spellcheck/spell-checker
|
|
86
|
+
const verticalOffset = this._orientation === 'bottom' ? '0.71em' : '0.32em';
|
|
87
|
+
if (this._orientation === 'bottom') {
|
|
88
|
+
tickG.setAttribute('transform', `translate(${finalPosition},0)`);
|
|
89
|
+
tickLine.setAttribute('y2', '6');
|
|
90
|
+
tickText.setAttribute('y', '9');
|
|
91
|
+
// eslint-disable-next-line spellcheck/spell-checker
|
|
92
|
+
tickText.setAttribute('dy', verticalOffset);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
tickG.setAttribute('transform', `translate(0,${finalPosition})`);
|
|
96
|
+
tickLine.setAttribute('x2', '-6');
|
|
97
|
+
tickText.setAttribute('x', '-9');
|
|
98
|
+
// eslint-disable-next-line spellcheck/spell-checker
|
|
99
|
+
tickText.setAttribute('dy', verticalOffset);
|
|
100
|
+
}
|
|
101
|
+
tickG.appendChild(tickLine);
|
|
102
|
+
tickG.appendChild(tickText);
|
|
103
|
+
g.appendChild(tickG);
|
|
104
|
+
}
|
|
105
|
+
// Set axis group attributes (matching d3)
|
|
106
|
+
g.setAttribute('fill', 'none');
|
|
107
|
+
g.setAttribute('font-size', '10');
|
|
108
|
+
g.setAttribute('font-family', 'sans-serif');
|
|
109
|
+
g.setAttribute('text-anchor', this._orientation === 'bottom' ? 'middle' : 'end');
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Gets tick values from the scale.
|
|
113
|
+
*
|
|
114
|
+
* @template Domain
|
|
115
|
+
* @returns {Domain[]} Array of tick domain values.
|
|
116
|
+
*/
|
|
117
|
+
getTickValues() {
|
|
118
|
+
if (this._scale.ticks) {
|
|
119
|
+
return this._scale.ticks(this._tickCount);
|
|
120
|
+
}
|
|
121
|
+
if (this._scale.domain) {
|
|
122
|
+
return this._scale.domain();
|
|
123
|
+
}
|
|
124
|
+
return [];
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Gets the tick formatter function.
|
|
128
|
+
*
|
|
129
|
+
* @template Domain
|
|
130
|
+
* @returns {(d: Domain) => string} A function that converts tick values to strings.
|
|
131
|
+
*/
|
|
132
|
+
getFormatter() {
|
|
133
|
+
if (this._tickFormatter) {
|
|
134
|
+
return this._tickFormatter;
|
|
135
|
+
}
|
|
136
|
+
if (this._scale.tickFormat) {
|
|
137
|
+
return this._scale.tickFormat(this._tickCount);
|
|
138
|
+
}
|
|
139
|
+
return (d) => String(d);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Creates a bottom-oriented axis generator. Mimics d3.axisBottom().
|
|
144
|
+
*
|
|
145
|
+
* @template Domain
|
|
146
|
+
* @param {AxisScale} scale - The scale to use.
|
|
147
|
+
* @returns {Axis<Domain>} An Axis callable that renders into a <g> element.
|
|
148
|
+
*/
|
|
149
|
+
export function axisBottom(scale) {
|
|
150
|
+
const generator = new AxisGenerator(scale, 'bottom');
|
|
151
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
152
|
+
const axisFn = Object.assign(
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
154
|
+
(selection) => {
|
|
155
|
+
generator.render(selection);
|
|
156
|
+
}, {
|
|
157
|
+
ticks: (count) => {
|
|
158
|
+
generator.setTickCount(count);
|
|
159
|
+
return axisFn;
|
|
160
|
+
},
|
|
161
|
+
tickFormat: (formatter) => {
|
|
162
|
+
generator.setTickFormatter(formatter);
|
|
163
|
+
return axisFn;
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
/* eslint-enable jsdoc/require-jsdoc */
|
|
167
|
+
return axisFn;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Creates a left-oriented axis generator. Mimics d3.axisLeft().
|
|
171
|
+
*
|
|
172
|
+
* @template Domain
|
|
173
|
+
* @param {AxisScale} scale - The scale to use.
|
|
174
|
+
* @returns {Axis<Domain>} An Axis callable that renders into a <g> element.
|
|
175
|
+
*/
|
|
176
|
+
export function axisLeft(scale) {
|
|
177
|
+
const generator = new AxisGenerator(scale, 'left');
|
|
178
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
179
|
+
const axisFn = Object.assign(
|
|
180
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
181
|
+
(selection) => {
|
|
182
|
+
generator.render(selection);
|
|
183
|
+
}, {
|
|
184
|
+
ticks: (count) => {
|
|
185
|
+
generator.setTickCount(count);
|
|
186
|
+
return axisFn;
|
|
187
|
+
},
|
|
188
|
+
tickFormat: (formatter) => {
|
|
189
|
+
generator.setTickFormatter(formatter);
|
|
190
|
+
return axisFn;
|
|
191
|
+
},
|
|
192
|
+
});
|
|
193
|
+
/* eslint-enable jsdoc/require-jsdoc */
|
|
194
|
+
return axisFn;
|
|
195
|
+
}
|