@cloudscape-design/components 3.0.221 → 3.0.223
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/alert/index.js +4 -4
- package/alert/index.js.map +1 -1
- package/alert/internal.js +14 -15
- package/alert/internal.js.map +1 -1
- package/annotation-context/annotation/annotation-icon.js +1 -2
- package/annotation-context/annotation/annotation-icon.js.map +1 -1
- package/annotation-context/annotation/annotation-popover.js +6 -7
- package/annotation-context/annotation/annotation-popover.js.map +1 -1
- package/annotation-context/annotation/annotation-trigger.js +4 -6
- package/annotation-context/annotation/annotation-trigger.js.map +1 -1
- package/annotation-context/annotation/closed-annotation.js +4 -5
- package/annotation-context/annotation/closed-annotation.js.map +1 -1
- package/annotation-context/annotation/open-annotation.js +2 -3
- package/annotation-context/annotation/open-annotation.js.map +1 -1
- package/annotation-context/context.js +7 -7
- package/annotation-context/context.js.map +1 -1
- package/annotation-context/index.js +62 -69
- package/annotation-context/index.js.map +1 -1
- package/app-layout/content-wrapper/index.js +2 -3
- package/app-layout/content-wrapper/index.js.map +1 -1
- package/app-layout/defaults.js +13 -14
- package/app-layout/defaults.js.map +1 -1
- package/app-layout/drawer.js +16 -18
- package/app-layout/drawer.js.map +1 -1
- package/app-layout/index.js +111 -113
- package/app-layout/index.js.map +1 -1
- package/app-layout/mobile-toolbar/index.js +7 -9
- package/app-layout/mobile-toolbar/index.js.map +1 -1
- package/app-layout/navigation-panel.js +5 -8
- package/app-layout/navigation-panel.js.map +1 -1
- package/app-layout/notifications/index.js +2 -2
- package/app-layout/notifications/index.js.map +1 -1
- package/app-layout/toggles/index.js +14 -22
- package/app-layout/toggles/index.js.map +1 -1
- package/app-layout/tools-and-split-panel.js +6 -9
- package/app-layout/tools-and-split-panel.js.map +1 -1
- package/app-layout/utils/use-content-height.js +14 -15
- package/app-layout/utils/use-content-height.js.map +1 -1
- package/app-layout/utils/use-content-width.js +8 -8
- package/app-layout/utils/use-content-width.js.map +1 -1
- package/app-layout/utils/use-focus-control.js +7 -8
- package/app-layout/utils/use-focus-control.js.map +1 -1
- package/app-layout/utils/use-observed-element.js +3 -3
- package/app-layout/utils/use-observed-element.js.map +1 -1
- package/app-layout/utils/use-window-width.js +4 -4
- package/app-layout/utils/use-window-width.js.map +1 -1
- package/app-layout/visual-refresh/app-bar.js +19 -20
- package/app-layout/visual-refresh/app-bar.js.map +1 -1
- package/app-layout/visual-refresh/background.js +9 -10
- package/app-layout/visual-refresh/background.js.map +1 -1
- package/app-layout/visual-refresh/context.js +101 -59
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/header.js +6 -7
- package/app-layout/visual-refresh/header.js.map +1 -1
- package/app-layout/visual-refresh/index.js +3 -4
- package/app-layout/visual-refresh/index.js.map +1 -1
- package/app-layout/visual-refresh/layout.js +18 -21
- package/app-layout/visual-refresh/layout.js.map +1 -1
- package/app-layout/visual-refresh/main.js +17 -18
- package/app-layout/visual-refresh/main.js.map +1 -1
- package/app-layout/visual-refresh/navigation.js +22 -24
- package/app-layout/visual-refresh/navigation.js.map +1 -1
- package/app-layout/visual-refresh/notifications.js +6 -7
- package/app-layout/visual-refresh/notifications.js.map +1 -1
- package/app-layout/visual-refresh/split-panel.js +36 -43
- package/app-layout/visual-refresh/split-panel.js.map +1 -1
- package/app-layout/visual-refresh/tools.js +32 -34
- package/app-layout/visual-refresh/tools.js.map +1 -1
- package/app-layout/visual-refresh/trigger-button.js +5 -8
- package/app-layout/visual-refresh/trigger-button.js.map +1 -1
- package/area-chart/chart-container.js +18 -19
- package/area-chart/chart-container.js.map +1 -1
- package/area-chart/elements/area-chart-filter.js +7 -8
- package/area-chart/elements/area-chart-filter.js.map +1 -1
- package/area-chart/elements/area-chart-legend.js +6 -9
- package/area-chart/elements/area-chart-legend.js.map +1 -1
- package/area-chart/elements/area-series.js +12 -13
- package/area-chart/elements/area-series.js.map +1 -1
- package/area-chart/elements/chart-popover.js +4 -6
- package/area-chart/elements/chart-popover.js.map +1 -1
- package/area-chart/elements/data-series.js +14 -17
- package/area-chart/elements/data-series.js.map +1 -1
- package/area-chart/elements/highlighted-point.js +6 -7
- package/area-chart/elements/highlighted-point.js.map +1 -1
- package/area-chart/elements/threshold-series.js +5 -7
- package/area-chart/elements/threshold-series.js.map +1 -1
- package/area-chart/elements/use-highlight-details.js +28 -30
- package/area-chart/elements/use-highlight-details.js.map +1 -1
- package/area-chart/elements/vertical-marker.js +6 -7
- package/area-chart/elements/vertical-marker.js.map +1 -1
- package/area-chart/index.js +4 -4
- package/area-chart/index.js.map +1 -1
- package/area-chart/internal.js +40 -41
- package/area-chart/internal.js.map +1 -1
- package/area-chart/model/async-store.js +23 -30
- package/area-chart/model/async-store.js.map +1 -1
- package/area-chart/model/compute-chart-props.js +11 -12
- package/area-chart/model/compute-chart-props.js.map +1 -1
- package/area-chart/model/create-series-decorator.js +11 -13
- package/area-chart/model/create-series-decorator.js.map +1 -1
- package/area-chart/model/interactions-store.js +47 -54
- package/area-chart/model/interactions-store.js.map +1 -1
- package/area-chart/model/use-chart-model.js +85 -89
- package/area-chart/model/use-chart-model.js.map +1 -1
- package/area-chart/model/use-filter-props.js +6 -6
- package/area-chart/model/use-filter-props.js.map +1 -1
- package/area-chart/model/use-highlight-props.js +6 -6
- package/area-chart/model/use-highlight-props.js.map +1 -1
- package/area-chart/model/utils.js +46 -59
- package/area-chart/model/utils.js.map +1 -1
- package/attribute-editor/additional-info.js +2 -5
- package/attribute-editor/additional-info.js.map +1 -1
- package/attribute-editor/index.js +5 -5
- package/attribute-editor/index.js.map +1 -1
- package/attribute-editor/internal.js +20 -20
- package/attribute-editor/internal.js.map +1 -1
- package/attribute-editor/row.js +17 -25
- package/attribute-editor/row.js.map +1 -1
- package/autosuggest/autosuggest-option.js +12 -12
- package/autosuggest/autosuggest-option.js.map +1 -1
- package/autosuggest/index.js +6 -6
- package/autosuggest/index.js.map +1 -1
- package/autosuggest/internal.js +39 -39
- package/autosuggest/internal.js.map +1 -1
- package/autosuggest/load-more-controller.js +10 -14
- package/autosuggest/load-more-controller.js.map +1 -1
- package/autosuggest/options-controller.js +31 -32
- package/autosuggest/options-controller.js.map +1 -1
- package/autosuggest/options-list.js +12 -13
- package/autosuggest/options-list.js.map +1 -1
- package/autosuggest/plain-list.js +15 -17
- package/autosuggest/plain-list.js.map +1 -1
- package/autosuggest/utils/utils.js +12 -12
- package/autosuggest/utils/utils.js.map +1 -1
- package/autosuggest/virtual-list.js +14 -16
- package/autosuggest/virtual-list.js.map +1 -1
- package/badge/index.js +6 -6
- package/badge/index.js.map +1 -1
- package/bar-chart/index.js +6 -6
- package/bar-chart/index.js.map +1 -1
- package/box/index.js +4 -4
- package/box/index.js.map +1 -1
- package/box/internal.js +12 -12
- package/box/internal.js.map +1 -1
- package/breadcrumb-group/index.js +4 -4
- package/breadcrumb-group/index.js.map +1 -1
- package/breadcrumb-group/internal.js +24 -25
- package/breadcrumb-group/internal.js.map +1 -1
- package/breadcrumb-group/item/item.js +32 -34
- package/breadcrumb-group/item/item.js.map +1 -1
- package/button/icon-helper.js +6 -6
- package/button/icon-helper.js.map +1 -1
- package/button/index.js +6 -6
- package/button/index.js.map +1 -1
- package/button/internal.js +32 -33
- package/button/internal.js.map +1 -1
- package/button-dropdown/category-elements/category-element.js +3 -5
- package/button-dropdown/category-elements/category-element.js.map +1 -1
- package/button-dropdown/category-elements/expandable-category-element.js +23 -26
- package/button-dropdown/category-elements/expandable-category-element.js.map +1 -1
- package/button-dropdown/category-elements/mobile-expandable-category-element.js +27 -30
- package/button-dropdown/category-elements/mobile-expandable-category-element.js.map +1 -1
- package/button-dropdown/index.js +6 -6
- package/button-dropdown/index.js.map +1 -1
- package/button-dropdown/internal.js +28 -29
- package/button-dropdown/internal.js.map +1 -1
- package/button-dropdown/item-element/index.js +30 -36
- package/button-dropdown/item-element/index.js.map +1 -1
- package/button-dropdown/items-list.js +3 -4
- package/button-dropdown/items-list.js.map +1 -1
- package/button-dropdown/mobile-expandable-group/mobile-expandable-group.js +2 -4
- package/button-dropdown/mobile-expandable-group/mobile-expandable-group.js.map +1 -1
- package/button-dropdown/tooltip.js +22 -24
- package/button-dropdown/tooltip.js.map +1 -1
- package/button-dropdown/utils/create-items-tree.js +21 -23
- package/button-dropdown/utils/create-items-tree.js.map +1 -1
- package/button-dropdown/utils/menu-item.js +6 -9
- package/button-dropdown/utils/menu-item.js.map +1 -1
- package/button-dropdown/utils/move-highlight.js +3 -4
- package/button-dropdown/utils/move-highlight.js.map +1 -1
- package/button-dropdown/utils/use-button-dropdown.js +31 -33
- package/button-dropdown/utils/use-button-dropdown.js.map +1 -1
- package/button-dropdown/utils/use-hidden-description.js +3 -3
- package/button-dropdown/utils/use-hidden-description.js.map +1 -1
- package/button-dropdown/utils/use-highlighted-menu.js +40 -42
- package/button-dropdown/utils/use-highlighted-menu.js.map +1 -1
- package/button-dropdown/utils/utils.js +5 -9
- package/button-dropdown/utils/utils.js.map +1 -1
- package/calendar/grid/index.js +25 -28
- package/calendar/grid/index.js.map +1 -1
- package/calendar/header/header-button.js +4 -6
- package/calendar/header/header-button.js.map +1 -1
- package/calendar/header/index.js +1 -2
- package/calendar/header/index.js.map +1 -1
- package/calendar/index.js +4 -4
- package/calendar/index.js.map +1 -1
- package/calendar/internal.js +27 -27
- package/calendar/internal.js.map +1 -1
- package/calendar/utils/intl.js +12 -13
- package/calendar/utils/intl.js.map +1 -1
- package/calendar/utils/navigation.js +3 -3
- package/calendar/utils/navigation.js.map +1 -1
- package/cards/cards-layout-helper.js +12 -12
- package/cards/cards-layout-helper.js.map +1 -1
- package/cards/index.js +53 -63
- package/cards/index.js.map +1 -1
- package/checkbox/index.js +4 -4
- package/checkbox/index.js.map +1 -1
- package/checkbox/internal.d.ts +1 -0
- package/checkbox/internal.d.ts.map +1 -1
- package/checkbox/internal.js +9 -9
- package/checkbox/internal.js.map +1 -1
- package/code-editor/ace-modes.js +1 -1
- package/code-editor/ace-modes.js.map +1 -1
- package/code-editor/ace-themes.js +2 -2
- package/code-editor/ace-themes.js.map +1 -1
- package/code-editor/error-screen.js +3 -4
- package/code-editor/error-screen.js.map +1 -1
- package/code-editor/index.js +61 -65
- package/code-editor/index.js.map +1 -1
- package/code-editor/listeners.js +5 -5
- package/code-editor/listeners.js.map +1 -1
- package/code-editor/loading-screen.js +2 -2
- package/code-editor/loading-screen.js.map +1 -1
- package/code-editor/pane.js +21 -25
- package/code-editor/pane.js.map +1 -1
- package/code-editor/preferences-modal.js +12 -13
- package/code-editor/preferences-modal.js.map +1 -1
- package/code-editor/resizable-box/index.js +14 -15
- package/code-editor/resizable-box/index.js.map +1 -1
- package/code-editor/setup-editor.js +20 -20
- package/code-editor/setup-editor.js.map +1 -1
- package/code-editor/status-bar.js +19 -22
- package/code-editor/status-bar.js.map +1 -1
- package/code-editor/tab-button.js +7 -10
- package/code-editor/tab-button.js.map +1 -1
- package/code-editor/util.js +6 -6
- package/code-editor/util.js.map +1 -1
- package/collection-preferences/index.js +21 -23
- package/collection-preferences/index.js.map +1 -1
- package/collection-preferences/utils.js +25 -57
- package/collection-preferences/utils.js.map +1 -1
- package/collection-preferences/visible-content.js +23 -27
- package/collection-preferences/visible-content.js.map +1 -1
- package/column-layout/index.js +6 -6
- package/column-layout/index.js.map +1 -1
- package/column-layout/internal.js +20 -21
- package/column-layout/internal.js.map +1 -1
- package/column-layout/util.js +2 -2
- package/column-layout/util.js.map +1 -1
- package/container/index.js +5 -5
- package/container/index.js.map +1 -1
- package/container/internal.js +30 -31
- package/container/internal.js.map +1 -1
- package/container/use-sticky-header.js +25 -25
- package/container/use-sticky-header.js.map +1 -1
- package/content-layout/index.js +2 -3
- package/content-layout/index.js.map +1 -1
- package/content-layout/internal.js +15 -16
- package/content-layout/internal.js.map +1 -1
- package/date-input/index.js +3 -4
- package/date-input/index.js.map +1 -1
- package/date-input/interfaces.d.ts +4 -0
- package/date-input/interfaces.d.ts.map +1 -1
- package/date-input/interfaces.js.map +1 -1
- package/date-input/internal.js +8 -8
- package/date-input/internal.js.map +1 -1
- package/date-picker/index.js +28 -28
- package/date-picker/index.js.map +1 -1
- package/date-range-picker/calendar/grids/grid.js +54 -57
- package/date-range-picker/calendar/grids/grid.js.map +1 -1
- package/date-range-picker/calendar/grids/index.js +27 -28
- package/date-range-picker/calendar/grids/index.js.map +1 -1
- package/date-range-picker/calendar/header/header-button.js +4 -6
- package/date-range-picker/calendar/header/header-button.js.map +1 -1
- package/date-range-picker/calendar/header/index.js +6 -7
- package/date-range-picker/calendar/header/index.js.map +1 -1
- package/date-range-picker/calendar/index.js +40 -45
- package/date-range-picker/calendar/index.js.map +1 -1
- package/date-range-picker/calendar/range-inputs.js +5 -6
- package/date-range-picker/calendar/range-inputs.js.map +1 -1
- package/date-range-picker/calendar/utils.js +2 -2
- package/date-range-picker/calendar/utils.js.map +1 -1
- package/date-range-picker/dropdown.js +29 -34
- package/date-range-picker/dropdown.js.map +1 -1
- package/date-range-picker/index.js +40 -43
- package/date-range-picker/index.js.map +1 -1
- package/date-range-picker/mode-switcher.js +2 -3
- package/date-range-picker/mode-switcher.js.map +1 -1
- package/date-range-picker/relative-range/index.js +36 -40
- package/date-range-picker/relative-range/index.js.map +1 -1
- package/date-range-picker/time-offset.js +5 -5
- package/date-range-picker/time-offset.js.map +1 -1
- package/date-range-picker/utils.js +4 -5
- package/date-range-picker/utils.js.map +1 -1
- package/expandable-section/expandable-section-container.js +5 -5
- package/expandable-section/expandable-section-container.js.map +1 -1
- package/expandable-section/expandable-section-header.js +18 -23
- package/expandable-section/expandable-section-header.js.map +1 -1
- package/expandable-section/index.js +4 -4
- package/expandable-section/index.js.map +1 -1
- package/expandable-section/internal.js +22 -22
- package/expandable-section/internal.js.map +1 -1
- package/flashbar/collapsible-flashbar.js +103 -118
- package/flashbar/collapsible-flashbar.js.map +1 -1
- package/flashbar/common.js +26 -35
- package/flashbar/common.js.map +1 -1
- package/flashbar/constant.js +1 -1
- package/flashbar/constant.js.map +1 -1
- package/flashbar/flash.js +23 -26
- package/flashbar/flash.js.map +1 -1
- package/flashbar/index.js +3 -4
- package/flashbar/index.js.map +1 -1
- package/flashbar/internal/analytics.js +12 -12
- package/flashbar/internal/analytics.js.map +1 -1
- package/flashbar/non-collapsible-flashbar.js +10 -10
- package/flashbar/non-collapsible-flashbar.js.map +1 -1
- package/flashbar/utils.js +25 -27
- package/flashbar/utils.js.map +1 -1
- package/form/index.js +4 -4
- package/form/index.js.map +1 -1
- package/form/internal.js +5 -6
- package/form/internal.js.map +1 -1
- package/form-field/index.js +4 -4
- package/form-field/index.js.map +1 -1
- package/form-field/internal.js +20 -23
- package/form-field/internal.js.map +1 -1
- package/form-field/util.js +9 -10
- package/form-field/util.js.map +1 -1
- package/grid/index.js +6 -6
- package/grid/index.js.map +1 -1
- package/grid/internal.js +14 -15
- package/grid/internal.js.map +1 -1
- package/header/index.js +4 -4
- package/header/index.js.map +1 -1
- package/header/internal.js +15 -15
- package/header/internal.js.map +1 -1
- package/help-panel/index.js +7 -7
- package/help-panel/index.js.map +1 -1
- package/hotspot/index.js +12 -12
- package/hotspot/index.js.map +1 -1
- package/icon/index.js +4 -4
- package/icon/index.js.map +1 -1
- package/icon/internal.js +18 -18
- package/icon/internal.js.map +1 -1
- package/input/index.js +36 -17
- package/input/index.js.map +1 -1
- package/input/internal.js +30 -25
- package/input/internal.js.map +1 -1
- package/input/utils.js +4 -5
- package/input/utils.js.map +1 -1
- package/internal/animate.js +27 -32
- package/internal/animate.js.map +1 -1
- package/internal/base-component/index.js +2 -2
- package/internal/base-component/index.js.map +1 -1
- package/internal/breakpoints.js +7 -12
- package/internal/breakpoints.js.map +1 -1
- package/internal/components/abstract-switch/index.d.ts +2 -1
- package/internal/components/abstract-switch/index.d.ts.map +1 -1
- package/internal/components/abstract-switch/index.js +19 -19
- package/internal/components/abstract-switch/index.js.map +1 -1
- package/internal/components/abstract-switch/styles.css.js +13 -12
- package/internal/components/abstract-switch/styles.scoped.css +21 -21
- package/internal/components/abstract-switch/styles.selectors.js +13 -12
- package/internal/components/autosuggest-input/index.js +38 -38
- package/internal/components/autosuggest-input/index.js.map +1 -1
- package/internal/components/button-trigger/index.js +7 -7
- package/internal/components/button-trigger/index.js.map +1 -1
- package/internal/components/cartesian-chart/axis-label.js +1 -2
- package/internal/components/cartesian-chart/axis-label.js.map +1 -1
- package/internal/components/cartesian-chart/bottom-labels.js +20 -26
- package/internal/components/cartesian-chart/bottom-labels.js.map +1 -1
- package/internal/components/cartesian-chart/constants.js +5 -5
- package/internal/components/cartesian-chart/constants.js.map +1 -1
- package/internal/components/cartesian-chart/emphasized-baseline.js +4 -5
- package/internal/components/cartesian-chart/emphasized-baseline.js.map +1 -1
- package/internal/components/cartesian-chart/highlighted-point.js +1 -2
- package/internal/components/cartesian-chart/highlighted-point.js.map +1 -1
- package/internal/components/cartesian-chart/label-utils.js +20 -24
- package/internal/components/cartesian-chart/label-utils.js.map +1 -1
- package/internal/components/cartesian-chart/labels-measure.js +6 -7
- package/internal/components/cartesian-chart/labels-measure.js.map +1 -1
- package/internal/components/cartesian-chart/left-labels.js +13 -17
- package/internal/components/cartesian-chart/left-labels.js.map +1 -1
- package/internal/components/cartesian-chart/scales.js +21 -26
- package/internal/components/cartesian-chart/scales.js.map +1 -1
- package/internal/components/cartesian-chart/ticks.js +9 -10
- package/internal/components/cartesian-chart/ticks.js.map +1 -1
- package/internal/components/cartesian-chart/vertical-grid-lines.js +3 -4
- package/internal/components/cartesian-chart/vertical-grid-lines.js.map +1 -1
- package/internal/components/cartesian-chart/vertical-marker.js +3 -4
- package/internal/components/cartesian-chart/vertical-marker.js.map +1 -1
- package/internal/components/chart-filter/index.js +13 -14
- package/internal/components/chart-filter/index.js.map +1 -1
- package/internal/components/chart-legend/index.js +26 -29
- package/internal/components/chart-legend/index.js.map +1 -1
- package/internal/components/chart-plot/application-controller.js +21 -25
- package/internal/components/chart-plot/application-controller.js.map +1 -1
- package/internal/components/chart-plot/focus-outline.js +7 -8
- package/internal/components/chart-plot/focus-outline.js.map +1 -1
- package/internal/components/chart-plot/index.js +33 -34
- package/internal/components/chart-plot/index.js.map +1 -1
- package/internal/components/chart-popover/index.js +11 -12
- package/internal/components/chart-popover/index.js.map +1 -1
- package/internal/components/chart-series-details/index.js +13 -17
- package/internal/components/chart-series-details/index.js.map +1 -1
- package/internal/components/chart-series-marker/index.js +2 -3
- package/internal/components/chart-series-marker/index.js.map +1 -1
- package/internal/components/chart-status-container/index.js +8 -10
- package/internal/components/chart-status-container/index.js.map +1 -1
- package/internal/components/checkbox-icon/index.js +18 -19
- package/internal/components/checkbox-icon/index.js.map +1 -1
- package/internal/components/dark-ribbon/index.js +13 -14
- package/internal/components/dark-ribbon/index.js.map +1 -1
- package/internal/components/dropdown/context.js +4 -5
- package/internal/components/dropdown/context.js.map +1 -1
- package/internal/components/dropdown/dropdown-fit-handler.js +74 -81
- package/internal/components/dropdown/dropdown-fit-handler.js.map +1 -1
- package/internal/components/dropdown/index.js +57 -65
- package/internal/components/dropdown/index.js.map +1 -1
- package/internal/components/dropdown-footer/index.js +2 -6
- package/internal/components/dropdown-footer/index.js.map +1 -1
- package/internal/components/dropdown-status/index.js +5 -7
- package/internal/components/dropdown-status/index.js.map +1 -1
- package/internal/components/filtering-token/index.js +4 -6
- package/internal/components/filtering-token/index.js.map +1 -1
- package/internal/components/focus-lock/index.js +10 -11
- package/internal/components/focus-lock/index.js.map +1 -1
- package/internal/components/focus-lock/utils.js +4 -4
- package/internal/components/focus-lock/utils.js.map +1 -1
- package/internal/components/live-region/index.js +10 -10
- package/internal/components/live-region/index.js.map +1 -1
- package/internal/components/masked-input/index.js +22 -24
- package/internal/components/masked-input/index.js.map +1 -1
- package/internal/components/masked-input/keyboard-handler.js +18 -18
- package/internal/components/masked-input/keyboard-handler.js.map +1 -1
- package/internal/components/masked-input/use-mask.js +24 -28
- package/internal/components/masked-input/use-mask.js.map +1 -1
- package/internal/components/masked-input/utils/keys.js +4 -6
- package/internal/components/masked-input/utils/keys.js.map +1 -1
- package/internal/components/masked-input/utils/mask-format.js +103 -113
- package/internal/components/masked-input/utils/mask-format.js.map +1 -1
- package/internal/components/masked-input/utils/strings.js +1 -4
- package/internal/components/masked-input/utils/strings.js.map +1 -1
- package/internal/components/menu-dropdown/index.js +10 -12
- package/internal/components/menu-dropdown/index.js.map +1 -1
- package/internal/components/option/highlight-match.js +14 -18
- package/internal/components/option/highlight-match.js.map +1 -1
- package/internal/components/option/index.js +13 -13
- package/internal/components/option/index.js.map +1 -1
- package/internal/components/option/option-announcer.js +1 -1
- package/internal/components/option/option-announcer.js.map +1 -1
- package/internal/components/option/option-parts.js +28 -45
- package/internal/components/option/option-parts.js.map +1 -1
- package/internal/components/option/utils/filter-options.js +16 -19
- package/internal/components/option/utils/filter-options.js.map +1 -1
- package/internal/components/option/utils/flatten-options.js +15 -15
- package/internal/components/option/utils/flatten-options.js.map +1 -1
- package/internal/components/option/utils/prepare-options.js +3 -3
- package/internal/components/option/utils/prepare-options.js.map +1 -1
- package/internal/components/options-list/index.js +19 -20
- package/internal/components/options-list/index.js.map +1 -1
- package/internal/components/options-list/utils/test-indexes.js +11 -11
- package/internal/components/options-list/utils/test-indexes.js.map +1 -1
- package/internal/components/options-list/utils/use-highlight-option.js +17 -21
- package/internal/components/options-list/utils/use-highlight-option.js.map +1 -1
- package/internal/components/options-list/utils/use-ids.js +2 -2
- package/internal/components/options-list/utils/use-ids.js.map +1 -1
- package/internal/components/options-list/utils/use-keyboard.js +6 -8
- package/internal/components/options-list/utils/use-keyboard.js.map +1 -1
- package/internal/components/options-list/utils/use-open-state.js +6 -7
- package/internal/components/options-list/utils/use-open-state.js.map +1 -1
- package/internal/components/portal/index.js +5 -6
- package/internal/components/portal/index.js.map +1 -1
- package/internal/components/screenreader-only/index.js +1 -2
- package/internal/components/screenreader-only/index.js.map +1 -1
- package/internal/components/selectable-item/index.js +25 -26
- package/internal/components/selectable-item/index.js.map +1 -1
- package/internal/components/tab-trap/index.js +1 -2
- package/internal/components/tab-trap/index.js.map +1 -1
- package/internal/components/transition/index.js +16 -16
- package/internal/components/transition/index.js.map +1 -1
- package/internal/components/visual-context/index.js +6 -7
- package/internal/components/visual-context/index.js.map +1 -1
- package/internal/context/app-layout-context.js +2 -2
- package/internal/context/app-layout-context.js.map +1 -1
- package/internal/context/form-field-context.js +4 -4
- package/internal/context/form-field-context.js.map +1 -1
- package/internal/context/split-panel-context.js +3 -3
- package/internal/context/split-panel-context.js.map +1 -1
- package/internal/debounce.js +6 -11
- package/internal/debounce.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/events/index.js +12 -16
- package/internal/events/index.js.map +1 -1
- package/internal/focus-tracker.js +22 -27
- package/internal/focus-tracker.js.map +1 -1
- package/internal/generated/custom-css-properties/index.js +2 -2
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/hooks/check-controlled/index.js +1 -1
- package/internal/hooks/check-controlled/index.js.map +1 -1
- package/internal/hooks/container-queries/use-container-breakpoints.js +2 -2
- package/internal/hooks/container-queries/use-container-breakpoints.js.map +1 -1
- package/internal/hooks/container-queries/use-container-query.js +5 -6
- package/internal/hooks/container-queries/use-container-query.js.map +1 -1
- package/internal/hooks/container-queries/use-resize-observer.js +13 -13
- package/internal/hooks/container-queries/use-resize-observer.js.map +1 -1
- package/internal/hooks/focus-visible/index.js +8 -8
- package/internal/hooks/focus-visible/index.js.map +1 -1
- package/internal/hooks/forward-focus/index.js +5 -9
- package/internal/hooks/forward-focus/index.js.map +1 -1
- package/internal/hooks/forward-focus/radio-group.js +7 -7
- package/internal/hooks/forward-focus/radio-group.js.map +1 -1
- package/internal/hooks/use-base-component/component-metadata.js +5 -5
- package/internal/hooks/use-base-component/component-metadata.js.map +1 -1
- package/internal/hooks/use-base-component/index.js +1 -1
- package/internal/hooks/use-base-component/index.js.map +1 -1
- package/internal/hooks/use-controllable/index.js +16 -17
- package/internal/hooks/use-controllable/index.js.map +1 -1
- package/internal/hooks/use-date-cache/index.js +2 -2
- package/internal/hooks/use-date-cache/index.js.map +1 -1
- package/internal/hooks/use-debounce-callback/index.js +3 -7
- package/internal/hooks/use-debounce-callback/index.js.map +1 -1
- package/internal/hooks/use-dynamic-overlap/index.js +4 -4
- package/internal/hooks/use-dynamic-overlap/index.js.map +1 -1
- package/internal/hooks/use-effect-on-update.js +2 -2
- package/internal/hooks/use-effect-on-update.js.map +1 -1
- package/internal/hooks/use-focus-tracker.js +7 -8
- package/internal/hooks/use-focus-tracker.js.map +1 -1
- package/internal/hooks/use-has-rendered/index.js +6 -6
- package/internal/hooks/use-has-rendered/index.js.map +1 -1
- package/internal/hooks/use-merge-refs/index.js +5 -9
- package/internal/hooks/use-merge-refs/index.js.map +1 -1
- package/internal/hooks/use-mobile/index.js +7 -7
- package/internal/hooks/use-mobile/index.js.map +1 -1
- package/internal/hooks/use-mouse-down-target.js +5 -5
- package/internal/hooks/use-mouse-down-target.js.map +1 -1
- package/internal/hooks/use-mutation-observer/index.js +5 -5
- package/internal/hooks/use-mutation-observer/index.js.map +1 -1
- package/internal/hooks/use-portal-mode-classes/index.js +10 -12
- package/internal/hooks/use-portal-mode-classes/index.js.map +1 -1
- package/internal/hooks/use-previous/index.js +3 -3
- package/internal/hooks/use-previous/index.js.map +1 -1
- package/internal/hooks/use-scroll-sync/index.js +8 -9
- package/internal/hooks/use-scroll-sync/index.js.map +1 -1
- package/internal/hooks/use-singleton-handler/index.js +12 -14
- package/internal/hooks/use-singleton-handler/index.js.map +1 -1
- package/internal/hooks/use-stable-event-handler/index.js +3 -10
- package/internal/hooks/use-stable-event-handler/index.js.map +1 -1
- package/internal/hooks/use-telemetry/index.js +2 -2
- package/internal/hooks/use-telemetry/index.js.map +1 -1
- package/internal/hooks/use-telemetry/telemetry.js +3 -4
- package/internal/hooks/use-telemetry/telemetry.js.map +1 -1
- package/internal/hooks/use-unique-id/index.js +3 -3
- package/internal/hooks/use-unique-id/index.js.map +1 -1
- package/internal/hooks/use-visual-mode/index.js +11 -11
- package/internal/hooks/use-visual-mode/index.js.map +1 -1
- package/internal/is-development.js +1 -1
- package/internal/is-development.js.map +1 -1
- package/internal/logging.js +2 -2
- package/internal/logging.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/internal/metrics/log-clients.js +18 -27
- package/internal/metrics/log-clients.js.map +1 -1
- package/internal/metrics/metrics-formatters.js +11 -14
- package/internal/metrics/metrics-formatters.js.map +1 -1
- package/internal/metrics/metrics.js +27 -33
- package/internal/metrics/metrics.js.map +1 -1
- package/internal/motion.js +2 -2
- package/internal/motion.js.map +1 -1
- package/internal/styles/colors.js +1 -1
- package/internal/styles/colors.js.map +1 -1
- package/internal/utils/browser-scrollbar-size.js +5 -5
- package/internal/utils/browser-scrollbar-size.js.map +1 -1
- package/internal/utils/calculate-once.js +2 -2
- package/internal/utils/calculate-once.js.map +1 -1
- package/internal/utils/check-safe-url.js +4 -4
- package/internal/utils/check-safe-url.js.map +1 -1
- package/internal/utils/create-category-color-scale.js +6 -9
- package/internal/utils/create-category-color-scale.js.map +1 -1
- package/internal/utils/date-time/format-date-range.js +3 -3
- package/internal/utils/date-time/format-date-range.js.map +1 -1
- package/internal/utils/date-time/format-date.js +4 -4
- package/internal/utils/date-time/format-date.js.map +1 -1
- package/internal/utils/date-time/format-time.js +5 -5
- package/internal/utils/date-time/format-time.js.map +1 -1
- package/internal/utils/date-time/format-timezone-offset.js +4 -4
- package/internal/utils/date-time/format-timezone-offset.js.map +1 -1
- package/internal/utils/date-time/is-iso-date-only.js +1 -1
- package/internal/utils/date-time/is-iso-date-only.js.map +1 -1
- package/internal/utils/date-time/join-date-time.js +3 -3
- package/internal/utils/date-time/join-date-time.js.map +1 -1
- package/internal/utils/date-time/parse-date.js +5 -6
- package/internal/utils/date-time/parse-date.js.map +1 -1
- package/internal/utils/date-time/parse-timezone-offset.js +5 -5
- package/internal/utils/date-time/parse-timezone-offset.js.map +1 -1
- package/internal/utils/date-time/shift-timezone-offset.js +6 -6
- package/internal/utils/date-time/shift-timezone-offset.js.map +1 -1
- package/internal/utils/dom.js +12 -12
- package/internal/utils/dom.js.map +1 -1
- package/internal/utils/external-props.js +3 -3
- package/internal/utils/external-props.js.map +1 -1
- package/internal/utils/focus-svg-element.js +1 -1
- package/internal/utils/focus-svg-element.js.map +1 -1
- package/internal/utils/locale/merge-locales.js +1 -1
- package/internal/utils/locale/merge-locales.js.map +1 -1
- package/internal/utils/locale/normalize-locale.js +3 -3
- package/internal/utils/locale/normalize-locale.js.map +1 -1
- package/internal/utils/promises.js +7 -11
- package/internal/utils/promises.js.map +1 -1
- package/internal/utils/scrollable-containers.js +14 -18
- package/internal/utils/scrollable-containers.js.map +1 -1
- package/internal/utils/strings/join-strings.js +1 -5
- package/internal/utils/strings/join-strings.js.map +1 -1
- package/internal/utils/strings/pad-left-zeros.js +1 -1
- package/internal/utils/strings/pad-left-zeros.js.map +1 -1
- package/internal/utils/throttle.js +10 -15
- package/internal/utils/throttle.js.map +1 -1
- package/internal/utils/use-container-width.js +3 -5
- package/internal/utils/use-container-width.js.map +1 -1
- package/line-chart/index.js +6 -6
- package/line-chart/index.js.map +1 -1
- package/link/index.js +5 -5
- package/link/index.js.map +1 -1
- package/link/internal.js +25 -25
- package/link/internal.js.map +1 -1
- package/mixed-line-bar-chart/bar-groups.js +3 -4
- package/mixed-line-bar-chart/bar-groups.js.map +1 -1
- package/mixed-line-bar-chart/bar-series.js +24 -33
- package/mixed-line-bar-chart/bar-series.js.map +1 -1
- package/mixed-line-bar-chart/chart-container.js +123 -138
- package/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/mixed-line-bar-chart/chart-filters.js +10 -17
- package/mixed-line-bar-chart/chart-filters.js.map +1 -1
- package/mixed-line-bar-chart/chart-legend.js +9 -13
- package/mixed-line-bar-chart/chart-legend.js.map +1 -1
- package/mixed-line-bar-chart/chart-popover.js +3 -4
- package/mixed-line-bar-chart/chart-popover.js.map +1 -1
- package/mixed-line-bar-chart/data-series.js +13 -17
- package/mixed-line-bar-chart/data-series.js.map +1 -1
- package/mixed-line-bar-chart/domain.js +32 -39
- package/mixed-line-bar-chart/domain.js.map +1 -1
- package/mixed-line-bar-chart/format-highlighted.js +13 -14
- package/mixed-line-bar-chart/format-highlighted.js.map +1 -1
- package/mixed-line-bar-chart/hooks/use-mouse-hover.js +32 -34
- package/mixed-line-bar-chart/hooks/use-mouse-hover.js.map +1 -1
- package/mixed-line-bar-chart/hooks/use-navigation.js +48 -57
- package/mixed-line-bar-chart/hooks/use-navigation.js.map +1 -1
- package/mixed-line-bar-chart/hooks/use-popover.js +7 -7
- package/mixed-line-bar-chart/hooks/use-popover.js.map +1 -1
- package/mixed-line-bar-chart/index.js +4 -4
- package/mixed-line-bar-chart/index.js.map +1 -1
- package/mixed-line-bar-chart/internal.js +47 -49
- package/mixed-line-bar-chart/internal.js.map +1 -1
- package/mixed-line-bar-chart/line-series.js +19 -24
- package/mixed-line-bar-chart/line-series.js.map +1 -1
- package/mixed-line-bar-chart/make-scaled-bar-groups.js +10 -11
- package/mixed-line-bar-chart/make-scaled-bar-groups.js.map +1 -1
- package/mixed-line-bar-chart/make-scaled-series.js +30 -38
- package/mixed-line-bar-chart/make-scaled-series.js.map +1 -1
- package/mixed-line-bar-chart/utils.js +18 -21
- package/mixed-line-bar-chart/utils.js.map +1 -1
- package/modal/body-scroll.js +4 -4
- package/modal/body-scroll.js.map +1 -1
- package/modal/index.js +4 -4
- package/modal/index.js.map +1 -1
- package/modal/internal.js +24 -25
- package/modal/internal.js.map +1 -1
- package/multiselect/index.js +5 -5
- package/multiselect/index.js.map +1 -1
- package/multiselect/internal.js +81 -88
- package/multiselect/internal.js.map +1 -1
- package/package.json +1 -1
- package/pagination/index.js +2 -3
- package/pagination/index.js.map +1 -1
- package/pagination/internal.js +16 -17
- package/pagination/internal.js.map +1 -1
- package/pagination/utils.js +12 -12
- package/pagination/utils.js.map +1 -1
- package/pie-chart/index.js +38 -39
- package/pie-chart/index.js.map +1 -1
- package/pie-chart/labels.js +38 -42
- package/pie-chart/labels.js.map +1 -1
- package/pie-chart/pie-chart.js +65 -67
- package/pie-chart/pie-chart.js.map +1 -1
- package/pie-chart/responsive-text.js +9 -10
- package/pie-chart/responsive-text.js.map +1 -1
- package/pie-chart/segments.js +27 -31
- package/pie-chart/segments.js.map +1 -1
- package/pie-chart/utils.js +32 -35
- package/pie-chart/utils.js.map +1 -1
- package/popover/arrow.js +2 -2
- package/popover/arrow.js.map +1 -1
- package/popover/body.js +16 -19
- package/popover/body.js.map +1 -1
- package/popover/container.js +52 -55
- package/popover/container.js.map +1 -1
- package/popover/index.js +6 -6
- package/popover/index.js.map +1 -1
- package/popover/internal.js +28 -28
- package/popover/internal.js.map +1 -1
- package/popover/utils/positions.js +54 -66
- package/popover/utils/positions.js.map +1 -1
- package/progress-bar/index.js +17 -17
- package/progress-bar/index.js.map +1 -1
- package/progress-bar/internal.js +12 -16
- package/progress-bar/internal.js.map +1 -1
- package/property-filter/controller.js +117 -125
- package/property-filter/controller.js.map +1 -1
- package/property-filter/filter-options.js +8 -11
- package/property-filter/filter-options.js.map +1 -1
- package/property-filter/index.js +50 -50
- package/property-filter/index.js.map +1 -1
- package/property-filter/property-editor.js +4 -5
- package/property-filter/property-editor.js.map +1 -1
- package/property-filter/property-filter-autosuggest.js +39 -39
- package/property-filter/property-filter-autosuggest.js.map +1 -1
- package/property-filter/token-editor.js +55 -66
- package/property-filter/token-editor.js.map +1 -1
- package/property-filter/token.js +9 -11
- package/property-filter/token.js.map +1 -1
- package/property-filter/use-load-items.js +8 -12
- package/property-filter/use-load-items.js.map +1 -1
- package/property-filter/utils.js +13 -18
- package/property-filter/utils.js.map +1 -1
- package/radio-group/index.js +3 -4
- package/radio-group/index.js.map +1 -1
- package/radio-group/internal.js +9 -9
- package/radio-group/internal.js.map +1 -1
- package/radio-group/radio-button.js +12 -15
- package/radio-group/radio-button.js.map +1 -1
- package/s3-resource-selector/index.js +29 -29
- package/s3-resource-selector/index.js.map +1 -1
- package/s3-resource-selector/s3-in-context/index.js +16 -18
- package/s3-resource-selector/s3-in-context/index.js.map +1 -1
- package/s3-resource-selector/s3-in-context/search-input.js +3 -4
- package/s3-resource-selector/s3-in-context/search-input.js.map +1 -1
- package/s3-resource-selector/s3-in-context/use-versions-fetch.js +16 -16
- package/s3-resource-selector/s3-in-context/use-versions-fetch.js.map +1 -1
- package/s3-resource-selector/s3-in-context/validation.js +6 -6
- package/s3-resource-selector/s3-in-context/validation.js.map +1 -1
- package/s3-resource-selector/s3-modal/basic-table.js +19 -20
- package/s3-resource-selector/s3-modal/basic-table.js.map +1 -1
- package/s3-resource-selector/s3-modal/buckets-table.js +11 -13
- package/s3-resource-selector/s3-modal/buckets-table.js.map +1 -1
- package/s3-resource-selector/s3-modal/column-formats.js +5 -5
- package/s3-resource-selector/s3-modal/column-formats.js.map +1 -1
- package/s3-resource-selector/s3-modal/empty-state.js +1 -2
- package/s3-resource-selector/s3-modal/empty-state.js.map +1 -1
- package/s3-resource-selector/s3-modal/index.js +37 -43
- package/s3-resource-selector/s3-modal/index.js.map +1 -1
- package/s3-resource-selector/s3-modal/objects-table.js +12 -14
- package/s3-resource-selector/s3-modal/objects-table.js.map +1 -1
- package/s3-resource-selector/s3-modal/table-utils.js +9 -12
- package/s3-resource-selector/s3-modal/table-utils.js.map +1 -1
- package/s3-resource-selector/s3-modal/versions-table.js +10 -12
- package/s3-resource-selector/s3-modal/versions-table.js.map +1 -1
- package/s3-resource-selector/utils.js +1 -1
- package/s3-resource-selector/utils.js.map +1 -1
- package/segmented-control/index.js +2 -3
- package/segmented-control/index.js.map +1 -1
- package/segmented-control/internal-segmented-control.js +16 -17
- package/segmented-control/internal-segmented-control.js.map +1 -1
- package/segmented-control/internal.js +14 -14
- package/segmented-control/internal.js.map +1 -1
- package/segmented-control/segment.js +3 -6
- package/segmented-control/segment.js.map +1 -1
- package/select/index.js +6 -6
- package/select/index.js.map +1 -1
- package/select/internal.js +58 -58
- package/select/internal.js.map +1 -1
- package/select/parts/filter.js +4 -4
- package/select/parts/filter.js.map +1 -1
- package/select/parts/item.js +10 -10
- package/select/parts/item.js.map +1 -1
- package/select/parts/multiselect-item.js +13 -14
- package/select/parts/multiselect-item.js.map +1 -1
- package/select/parts/plain-list.js +13 -15
- package/select/parts/plain-list.js.map +1 -1
- package/select/parts/trigger.js +7 -9
- package/select/parts/trigger.js.map +1 -1
- package/select/parts/virtual-list.js +27 -33
- package/select/parts/virtual-list.js.map +1 -1
- package/select/utils/check-option-value-field.js +2 -2
- package/select/utils/check-option-value-field.js.map +1 -1
- package/select/utils/connect-options.js +6 -7
- package/select/utils/connect-options.js.map +1 -1
- package/select/utils/get-item-props.js +4 -7
- package/select/utils/get-item-props.js.map +1 -1
- package/select/utils/render-options.js +13 -15
- package/select/utils/render-options.js.map +1 -1
- package/select/utils/use-announcement.js +10 -11
- package/select/utils/use-announcement.js.map +1 -1
- package/select/utils/use-load-items.js +16 -19
- package/select/utils/use-load-items.js.map +1 -1
- package/select/utils/use-native-search.js +20 -29
- package/select/utils/use-native-search.js.map +1 -1
- package/select/utils/use-select.js +89 -96
- package/select/utils/use-select.js.map +1 -1
- package/side-navigation/index.js +10 -10
- package/side-navigation/index.js.map +1 -1
- package/side-navigation/internal.js +35 -46
- package/side-navigation/internal.js.map +1 -1
- package/side-navigation/util.js +9 -12
- package/side-navigation/util.js.map +1 -1
- package/space-between/index.js +4 -4
- package/space-between/index.js.map +1 -1
- package/space-between/internal.js +7 -7
- package/space-between/internal.js.map +1 -1
- package/spinner/index.js +4 -4
- package/spinner/index.js.map +1 -1
- package/spinner/internal.js +4 -4
- package/spinner/internal.js.map +1 -1
- package/split-panel/bottom.js +22 -25
- package/split-panel/bottom.js.map +1 -1
- package/split-panel/icons/bottom-icon-refresh.js +11 -13
- package/split-panel/icons/bottom-icon-refresh.js.map +1 -1
- package/split-panel/icons/bottom-icon.js +1 -1
- package/split-panel/icons/bottom-icon.js.map +1 -1
- package/split-panel/icons/resize-handler.js +3 -6
- package/split-panel/icons/resize-handler.js.map +1 -1
- package/split-panel/icons/side-position-refresh.js +12 -14
- package/split-panel/icons/side-position-refresh.js.map +1 -1
- package/split-panel/icons/side-position.js +1 -1
- package/split-panel/icons/side-position.js.map +1 -1
- package/split-panel/index.js +65 -65
- package/split-panel/index.js.map +1 -1
- package/split-panel/preferences-modal.js +9 -9
- package/split-panel/preferences-modal.js.map +1 -1
- package/split-panel/side.js +12 -15
- package/split-panel/side.js.map +1 -1
- package/split-panel/utils/size-utils.js +3 -3
- package/split-panel/utils/size-utils.js.map +1 -1
- package/split-panel/utils/use-keyboard-events.js +13 -17
- package/split-panel/utils/use-keyboard-events.js.map +1 -1
- package/split-panel/utils/use-pointer-events.js +12 -13
- package/split-panel/utils/use-pointer-events.js.map +1 -1
- package/status-indicator/index.js +4 -4
- package/status-indicator/index.js.map +1 -1
- package/status-indicator/internal.js +9 -10
- package/status-indicator/internal.js.map +1 -1
- package/table/body-cell/click-away.js +9 -10
- package/table/body-cell/click-away.js.map +1 -1
- package/table/body-cell/index.js +18 -18
- package/table/body-cell/index.js.map +1 -1
- package/table/body-cell/inline-editor.js +32 -46
- package/table/body-cell/inline-editor.js.map +1 -1
- package/table/body-cell/td-element.js +2 -4
- package/table/body-cell/td-element.js.map +1 -1
- package/table/body-cell/use-stable-scroll-position.js +10 -13
- package/table/body-cell/use-stable-scroll-position.js.map +1 -1
- package/table/header-cell/index.d.ts +4 -2
- package/table/header-cell/index.d.ts.map +1 -1
- package/table/header-cell/index.js +33 -34
- package/table/header-cell/index.js.map +1 -1
- package/table/header-cell/utils.js +10 -12
- package/table/header-cell/utils.js.map +1 -1
- package/table/index.js +5 -5
- package/table/index.js.map +1 -1
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +94 -118
- package/table/internal.js.map +1 -1
- package/table/resizer/index.d.ts +5 -1
- package/table/resizer/index.d.ts.map +1 -1
- package/table/resizer/index.js +40 -39
- package/table/resizer/index.js.map +1 -1
- package/table/selection-control/index.d.ts +4 -1
- package/table/selection-control/index.d.ts.map +1 -1
- package/table/selection-control/index.js +11 -11
- package/table/selection-control/index.js.map +1 -1
- package/table/sticky-header.d.ts +2 -2
- package/table/sticky-header.d.ts.map +1 -1
- package/table/sticky-header.js +16 -15
- package/table/sticky-header.js.map +1 -1
- package/table/sticky-scrollbar.js +5 -6
- package/table/sticky-scrollbar.js.map +1 -1
- package/table/sticky-scrolling.js +10 -10
- package/table/sticky-scrolling.js.map +1 -1
- package/table/thead.d.ts +11 -3
- package/table/thead.d.ts.map +1 -1
- package/table/thead.js +13 -13
- package/table/thead.js.map +1 -1
- package/table/tools-header.js +4 -5
- package/table/tools-header.js.map +1 -1
- package/table/use-column-widths.js +34 -44
- package/table/use-column-widths.js.map +1 -1
- package/table/use-row-events.js +10 -11
- package/table/use-row-events.js.map +1 -1
- package/table/use-selection.js +75 -81
- package/table/use-selection.js.map +1 -1
- package/table/use-sticky-header.js +16 -16
- package/table/use-sticky-header.js.map +1 -1
- package/table/use-sticky-scrollbar.js +42 -42
- package/table/use-sticky-scrollbar.js.map +1 -1
- package/table/use-table-focus-navigation.js +27 -28
- package/table/use-table-focus-navigation.js.map +1 -1
- package/table/utils.js +7 -7
- package/table/utils.js.map +1 -1
- package/tabs/index.js +30 -33
- package/tabs/index.js.map +1 -1
- package/tabs/scroll-utils.js +12 -13
- package/tabs/scroll-utils.js.map +1 -1
- package/tabs/smooth-scroll.js +17 -17
- package/tabs/smooth-scroll.js.map +1 -1
- package/tabs/tab-header-bar.js +61 -66
- package/tabs/tab-header-bar.js.map +1 -1
- package/tag-editor/index.js +59 -72
- package/tag-editor/index.js.map +1 -1
- package/tag-editor/internal.js +21 -29
- package/tag-editor/internal.js.map +1 -1
- package/tag-editor/utils.js +7 -8
- package/tag-editor/utils.js.map +1 -1
- package/tag-editor/validation.js +16 -18
- package/tag-editor/validation.js.map +1 -1
- package/text-content/index.js +6 -6
- package/text-content/index.js.map +1 -1
- package/text-filter/index.js +3 -4
- package/text-filter/index.js.map +1 -1
- package/text-filter/internal.js +10 -10
- package/text-filter/internal.js.map +1 -1
- package/textarea/index.js +23 -24
- package/textarea/index.js.map +1 -1
- package/theming/index.js +2 -3
- package/theming/index.js.map +1 -1
- package/tiles/index.js +3 -4
- package/tiles/index.js.map +1 -1
- package/tiles/internal.js +17 -17
- package/tiles/internal.js.map +1 -1
- package/tiles/tile.js +7 -9
- package/tiles/tile.js.map +1 -1
- package/time-input/index.js +5 -5
- package/time-input/index.js.map +1 -1
- package/time-input/internal.js +9 -9
- package/time-input/internal.js.map +1 -1
- package/toggle/index.js +3 -4
- package/toggle/index.js.map +1 -1
- package/toggle/internal.js +15 -16
- package/toggle/internal.js.map +1 -1
- package/token-group/dismiss-button.js +5 -7
- package/token-group/dismiss-button.js.map +1 -1
- package/token-group/index.js +4 -4
- package/token-group/index.js.map +1 -1
- package/token-group/internal.js +14 -14
- package/token-group/internal.js.map +1 -1
- package/token-group/toggle.js +7 -9
- package/token-group/toggle.js.map +1 -1
- package/top-navigation/1.0-beta/index.js +4 -4
- package/top-navigation/1.0-beta/index.js.map +1 -1
- package/top-navigation/1.0-beta/internal.js +43 -46
- package/top-navigation/1.0-beta/internal.js.map +1 -1
- package/top-navigation/1.0-beta/parts/overflow-menu.js +16 -17
- package/top-navigation/1.0-beta/parts/overflow-menu.js.map +1 -1
- package/top-navigation/1.0-beta/parts/utility.js +9 -12
- package/top-navigation/1.0-beta/parts/utility.js.map +1 -1
- package/top-navigation/1.0-beta/use-top-navigation.js +46 -54
- package/top-navigation/1.0-beta/use-top-navigation.js.map +1 -1
- package/top-navigation/index.js +4 -4
- package/top-navigation/index.js.map +1 -1
- package/top-navigation/internal.js +64 -71
- package/top-navigation/internal.js.map +1 -1
- package/top-navigation/parts/overflow-menu/header.js +3 -4
- package/top-navigation/parts/overflow-menu/header.js.map +1 -1
- package/top-navigation/parts/overflow-menu/index.js +4 -5
- package/top-navigation/parts/overflow-menu/index.js.map +1 -1
- package/top-navigation/parts/overflow-menu/menu-item.js +56 -61
- package/top-navigation/parts/overflow-menu/menu-item.js.map +1 -1
- package/top-navigation/parts/overflow-menu/router.js +11 -13
- package/top-navigation/parts/overflow-menu/router.js.map +1 -1
- package/top-navigation/parts/overflow-menu/views/submenu.js +6 -8
- package/top-navigation/parts/overflow-menu/views/submenu.js.map +1 -1
- package/top-navigation/parts/overflow-menu/views/utilities.js +5 -7
- package/top-navigation/parts/overflow-menu/views/utilities.js.map +1 -1
- package/top-navigation/parts/utility.js +12 -15
- package/top-navigation/parts/utility.js.map +1 -1
- package/top-navigation/use-top-navigation.js +52 -59
- package/top-navigation/use-top-navigation.js.map +1 -1
- package/tutorial-panel/components/tutorial-detail-view/congratulation-screen.js +5 -7
- package/tutorial-panel/components/tutorial-detail-view/congratulation-screen.js.map +1 -1
- package/tutorial-panel/components/tutorial-detail-view/index.js +6 -7
- package/tutorial-panel/components/tutorial-detail-view/index.js.map +1 -1
- package/tutorial-panel/components/tutorial-detail-view/task-list.js +8 -15
- package/tutorial-panel/components/tutorial-detail-view/task-list.js.map +1 -1
- package/tutorial-panel/components/tutorial-detail-view/task.js +5 -6
- package/tutorial-panel/components/tutorial-detail-view/task.js.map +1 -1
- package/tutorial-panel/components/tutorial-list/index.js +19 -22
- package/tutorial-panel/components/tutorial-list/index.js.map +1 -1
- package/tutorial-panel/index.js +8 -8
- package/tutorial-panel/index.js.map +1 -1
- package/wizard/index.js +28 -28
- package/wizard/index.js.map +1 -1
- package/wizard/internal/analytics.js +32 -42
- package/wizard/internal/analytics.js.map +1 -1
- package/wizard/unmount.js +6 -13
- package/wizard/unmount.js.map +1 -1
- package/wizard/wizard-actions.js +7 -8
- package/wizard/wizard-actions.js.map +1 -1
- package/wizard/wizard-form-header.js +2 -3
- package/wizard/wizard-form-header.js.map +1 -1
- package/wizard/wizard-form.js +14 -16
- package/wizard/wizard-form.js.map +1 -1
- package/wizard/wizard-navigation.js +19 -25
- package/wizard/wizard-navigation.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-filters.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/chart-filters.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,MAA4B,MAAM,qCAAqC,CAAC;AAG/E,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAWrC,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAmC,
|
|
1
|
+
{"version":3,"file":"chart-filters.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/chart-filters.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,MAA4B,MAAM,qCAAqC,CAAC;AAG/E,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAWrC,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAmC,EAC7E,MAAM,EACN,aAAa,EACb,QAAQ,EACR,WAAW,EACX,UAAU,EACV,iBAAiB,GACY;IAC7B,MAAM,WAAW,GAAsE,OAAO,CAC5F,GAAG,EAAE,CACH,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;QACjC,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC;QACjC,KAAK;QACL,KAAK,EAAE,MAAM;KACd,CAAC,CAAC,EACL,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,OAAO,CACL,oBAAC,oBAAoB,IACnB,IAAI,EAAC,GAAG,EACR,SAAS,EAAC,YAAY,EACtB,SAAS,EAAE,IAAI,CAAC;YACd,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,UAAU;SAC5C,CAAC;QAED,CAAC,UAAU,IAAI,CACd,oBAAC,MAAM,IAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,GAAI,CAC7G;QACA,iBAAiB,CACG,CACxB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\nimport clsx from 'clsx';\n\nimport InternalSpaceBetween from '../space-between/internal';\nimport Filter, { ChartFilterProps } from '../internal/components/chart-filter';\n\nimport { ChartDataTypes, MixedLineBarChartProps, InternalChartSeries } from './interfaces';\nimport { chartLegendMap } from './utils';\nimport styles from './styles.css.js';\n\ninterface InternalChartFiltersProps<T extends ChartDataTypes> {\n series: ReadonlyArray<InternalChartSeries<T>>;\n visibleSeries: ReadonlyArray<MixedLineBarChartProps.ChartSeries<T>>;\n onChange: (selectedSeries: ReadonlyArray<MixedLineBarChartProps.ChartSeries<T>>) => void;\n i18nStrings: MixedLineBarChartProps<T>['i18nStrings'];\n hideFilter?: boolean;\n additionalFilters?: React.ReactNode;\n}\n\nexport default function InternalChartFilters<T extends number | string | Date>({\n series,\n visibleSeries,\n onChange,\n i18nStrings,\n hideFilter,\n additionalFilters,\n}: InternalChartFiltersProps<T>) {\n const filterItems: ChartFilterProps<MixedLineBarChartProps.ChartSeries<T>>['series'] = useMemo(\n () =>\n series.map(({ series, color }) => ({\n label: series.title,\n type: chartLegendMap[series.type],\n color,\n datum: series,\n })),\n [series]\n );\n\n return (\n <InternalSpaceBetween\n size=\"l\"\n direction=\"horizontal\"\n className={clsx({\n [styles['has-default-filter']]: !hideFilter,\n })}\n >\n {!hideFilter && (\n <Filter series={filterItems} onChange={onChange} selectedSeries={visibleSeries} i18nStrings={i18nStrings} />\n )}\n {additionalFilters}\n </InternalSpaceBetween>\n );\n}\n"]}
|
|
@@ -3,20 +3,16 @@
|
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
4
|
import ChartLegend from '../internal/components/chart-legend';
|
|
5
5
|
import { chartLegendMap } from './utils';
|
|
6
|
-
export default function InternalChartLegend(
|
|
7
|
-
|
|
8
|
-
var legendItems = useMemo(function () {
|
|
6
|
+
export default function InternalChartLegend({ series, visibleSeries, highlightedSeries, onHighlightChange, legendTitle, ariaLabel, plotContainerRef, }) {
|
|
7
|
+
const legendItems = useMemo(() => {
|
|
9
8
|
return series
|
|
10
|
-
.filter(
|
|
11
|
-
.map(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
datum: series
|
|
18
|
-
});
|
|
19
|
-
});
|
|
9
|
+
.filter(s => visibleSeries.indexOf(s.series) !== -1)
|
|
10
|
+
.map(({ series, color }) => ({
|
|
11
|
+
label: series.title,
|
|
12
|
+
type: chartLegendMap[series.type],
|
|
13
|
+
color,
|
|
14
|
+
datum: series,
|
|
15
|
+
}));
|
|
20
16
|
}, [series, visibleSeries]);
|
|
21
17
|
return (React.createElement(ChartLegend, { series: legendItems, highlightedSeries: highlightedSeries || null, onHighlightChange: onHighlightChange, legendTitle: legendTitle, ariaLabel: ariaLabel, plotContainerRef: plotContainerRef }));
|
|
22
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-legend.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/chart-legend.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAI9D,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAYzC,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAmC,
|
|
1
|
+
{"version":3,"file":"chart-legend.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/chart-legend.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,WAAW,MAAM,qCAAqC,CAAC;AAI9D,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAYzC,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAmC,EAC5E,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,gBAAgB,GACY;IAC5B,MAAM,WAAW,GAAsE,OAAO,CAAC,GAAG,EAAE;QAClG,OAAO,MAAM;aACV,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;aACnD,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;YAC3B,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC;YACjC,KAAK;YACL,KAAK,EAAE,MAAM;SACd,CAAC,CAAC,CAAC;IACR,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;IAE5B,OAAO,CACL,oBAAC,WAAW,IACV,MAAM,EAAE,WAAW,EACnB,iBAAiB,EAAE,iBAAiB,IAAI,IAAI,EAC5C,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\n\nimport ChartLegend from '../internal/components/chart-legend';\nimport { ChartFilterProps } from '../internal/components/chart-filter';\n\nimport { ChartDataTypes, MixedLineBarChartProps, InternalChartSeries } from './interfaces';\nimport { chartLegendMap } from './utils';\n\ninterface InternalChartLegendProps<T extends ChartDataTypes> {\n series: ReadonlyArray<InternalChartSeries<T>>;\n visibleSeries: ReadonlyArray<MixedLineBarChartProps.ChartSeries<T>>;\n plotContainerRef: React.RefObject<HTMLDivElement>;\n highlightedSeries?: MixedLineBarChartProps.ChartSeries<T> | null;\n onHighlightChange: (series: MixedLineBarChartProps.ChartSeries<T> | null) => void;\n legendTitle?: string;\n ariaLabel?: string;\n}\n\nexport default function InternalChartLegend<T extends number | string | Date>({\n series,\n visibleSeries,\n highlightedSeries,\n onHighlightChange,\n legendTitle,\n ariaLabel,\n plotContainerRef,\n}: InternalChartLegendProps<T>) {\n const legendItems: ChartFilterProps<MixedLineBarChartProps.ChartSeries<T>>['series'] = useMemo(() => {\n return series\n .filter(s => visibleSeries.indexOf(s.series) !== -1)\n .map(({ series, color }) => ({\n label: series.title,\n type: chartLegendMap[series.type],\n color,\n datum: series,\n }));\n }, [series, visibleSeries]);\n\n return (\n <ChartLegend<MixedLineBarChartProps.ChartSeries<T>>\n series={legendItems}\n highlightedSeries={highlightedSeries || null}\n onHighlightChange={onHighlightChange}\n legendTitle={legendTitle}\n ariaLabel={ariaLabel}\n plotContainerRef={plotContainerRef}\n />\n );\n}\n"]}
|
|
@@ -7,9 +7,8 @@ import ChartSeriesDetails from '../internal/components/chart-series-details';
|
|
|
7
7
|
import styles from './styles.css.js';
|
|
8
8
|
import { Transition } from '../internal/components/transition';
|
|
9
9
|
export default React.forwardRef(MixedChartPopover);
|
|
10
|
-
function MixedChartPopover(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
React.createElement(ChartSeriesDetails, { details: highlightDetails.details }))))); }));
|
|
10
|
+
function MixedChartPopover({ containerRef, trackRef, isOpen, isPinned, highlightDetails, onDismiss, size = 'medium', dismissAriaLabel, onMouseEnter, onMouseLeave, }, popoverRef) {
|
|
11
|
+
return (React.createElement(Transition, { in: isOpen }, (state, ref) => (React.createElement("div", { ref: ref, className: clsx(state === 'exiting' && styles.exiting) }, (isOpen || state !== 'exited') && highlightDetails && (React.createElement(ChartPopover, { ref: popoverRef, title: highlightDetails.position, trackRef: trackRef, trackKey: highlightDetails.position, dismissButton: isPinned, dismissAriaLabel: dismissAriaLabel, onDismiss: onDismiss, container: containerRef.current, size: size, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave },
|
|
12
|
+
React.createElement(ChartSeriesDetails, { details: highlightDetails.details })))))));
|
|
14
13
|
}
|
|
15
14
|
//# sourceMappingURL=chart-popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-popover.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/chart-popover.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,OAAO,kBAAkB,MAAM,6CAA6C,CAAC;AAG7E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAgB/D,eAAe,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAEnD,SAAS,iBAAiB,CACxB,
|
|
1
|
+
{"version":3,"file":"chart-popover.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/chart-popover.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,YAAY,MAAM,sCAAsC,CAAC;AAChE,OAAO,kBAAkB,MAAM,6CAA6C,CAAC;AAG7E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAgB/D,eAAe,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAEnD,SAAS,iBAAiB,CACxB,EACE,YAAY,EACZ,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,IAAI,GAAG,QAAQ,EACf,gBAAgB,EAChB,YAAY,EACZ,YAAY,GACc,EAC5B,UAAkC;IAElC,OAAO,CACL,oBAAC,UAAU,IAAC,EAAE,EAAE,MAAM,IACnB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CACf,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,CAAC,IAClE,CAAC,MAAM,IAAI,KAAK,KAAK,QAAQ,CAAC,IAAI,gBAAgB,IAAI,CACrD,oBAAC,YAAY,IACX,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,gBAAgB,CAAC,QAAQ,EAChC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,EACnC,aAAa,EAAE,QAAQ,EACvB,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,YAAY,CAAC,OAAO,EAC/B,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY;QAE1B,oBAAC,kBAAkB,IAAC,OAAO,EAAE,gBAAgB,CAAC,OAAO,GAAI,CAC5C,CAChB,CACG,CACP,CACU,CACd,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport ChartPopover from '../internal/components/chart-popover';\nimport ChartSeriesDetails from '../internal/components/chart-series-details';\nimport { ChartDataTypes, MixedLineBarChartProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport { Transition } from '../internal/components/transition';\nimport { HighlightDetails } from './format-highlighted';\n\nexport interface MixedChartPopoverProps<T extends ChartDataTypes> {\n containerRef: React.RefObject<HTMLDivElement>;\n trackRef: React.RefObject<SVGElement>;\n isOpen: boolean;\n isPinned: boolean;\n highlightDetails: null | HighlightDetails;\n onDismiss(): void;\n size: MixedLineBarChartProps<T>['detailPopoverSize'];\n dismissAriaLabel?: string;\n onMouseEnter?: (event: React.MouseEvent) => void;\n onMouseLeave?: (event: React.MouseEvent) => void;\n}\n\nexport default React.forwardRef(MixedChartPopover);\n\nfunction MixedChartPopover<T extends ChartDataTypes>(\n {\n containerRef,\n trackRef,\n isOpen,\n isPinned,\n highlightDetails,\n onDismiss,\n size = 'medium',\n dismissAriaLabel,\n onMouseEnter,\n onMouseLeave,\n }: MixedChartPopoverProps<T>,\n popoverRef: React.Ref<HTMLElement>\n) {\n return (\n <Transition in={isOpen}>\n {(state, ref) => (\n <div ref={ref} className={clsx(state === 'exiting' && styles.exiting)}>\n {(isOpen || state !== 'exited') && highlightDetails && (\n <ChartPopover\n ref={popoverRef}\n title={highlightDetails.position}\n trackRef={trackRef}\n trackKey={highlightDetails.position}\n dismissButton={isPinned}\n dismissAriaLabel={dismissAriaLabel}\n onDismiss={onDismiss}\n container={containerRef.current}\n size={size}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n >\n <ChartSeriesDetails details={highlightDetails.details} />\n </ChartPopover>\n )}\n </div>\n )}\n </Transition>\n );\n}\n"]}
|
|
@@ -7,16 +7,14 @@ import LineSeries from './line-series';
|
|
|
7
7
|
import BarSeries from './bar-series';
|
|
8
8
|
import styles from './styles.css.js';
|
|
9
9
|
import { calculateOffsetMaps } from './utils';
|
|
10
|
-
export default function DataSeries(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var stackedBarOffsetMaps = useMemo(function () {
|
|
10
|
+
export default function DataSeries({ axis, plotHeight, plotWidth, highlightedGroupIndex, highlightedSeries, stackedBars, isGroupNavigation, visibleSeries, xScale, yScale, }) {
|
|
11
|
+
const chartAreaClipPath = useUniqueId('awsui-mixed-line-bar-chart__chart-area-');
|
|
12
|
+
const stackedBarOffsetMaps = useMemo(() => {
|
|
14
13
|
if (!stackedBars) {
|
|
15
14
|
return [];
|
|
16
15
|
}
|
|
17
|
-
|
|
18
|
-
visibleSeries.forEach(
|
|
19
|
-
var series = _a.series;
|
|
16
|
+
const barData = [];
|
|
17
|
+
visibleSeries.forEach(({ series }) => {
|
|
20
18
|
if (series.type === 'bar') {
|
|
21
19
|
barData.push(series.data);
|
|
22
20
|
}
|
|
@@ -27,22 +25,20 @@ export default function DataSeries(_a) {
|
|
|
27
25
|
React.createElement("defs", { "aria-hidden": "true" },
|
|
28
26
|
React.createElement("clipPath", { id: chartAreaClipPath },
|
|
29
27
|
React.createElement("rect", { x: 0, y: 0, width: plotWidth, height: plotHeight }))),
|
|
30
|
-
React.createElement("g", { "aria-hidden": isGroupNavigation ? true : undefined, role: "group" }, visibleSeries.map(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var isHighlighted = series === highlightedSeries;
|
|
34
|
-
var isDimmed = !!highlightedSeries && !isHighlighted;
|
|
28
|
+
React.createElement("g", { "aria-hidden": isGroupNavigation ? true : undefined, role: "group" }, visibleSeries.map(({ series, color }, index) => {
|
|
29
|
+
const isHighlighted = series === highlightedSeries;
|
|
30
|
+
const isDimmed = !!highlightedSeries && !isHighlighted;
|
|
35
31
|
switch (series.type) {
|
|
36
32
|
case 'line':
|
|
37
33
|
case 'threshold': {
|
|
38
|
-
return (React.createElement("g", { key: index, role: "group", "aria-label": series.title, className: clsx(styles.series, styles[
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
return (React.createElement("g", { key: index, role: "group", "aria-label": series.title, className: clsx(styles.series, styles[`series--${series.type}`], {
|
|
35
|
+
[styles['series--highlighted']]: isHighlighted,
|
|
36
|
+
[styles['series--dimmed']]: isDimmed,
|
|
37
|
+
}) },
|
|
42
38
|
React.createElement(LineSeries, { axis: axis, series: series, color: color, xScale: xScale, yScale: yScale, chartAreaClipPath: chartAreaClipPath })));
|
|
43
39
|
}
|
|
44
40
|
case 'bar':
|
|
45
|
-
return (React.createElement(BarSeries, { key: index, axis: axis, series: series, color: color, totalSeriesCount: visibleSeries.filter(
|
|
41
|
+
return (React.createElement(BarSeries, { key: index, axis: axis, series: series, color: color, totalSeriesCount: visibleSeries.filter(s => s.series.type === 'bar').length, seriesIndex: index, xScale: xScale, yScale: yScale, plotSize: axis === 'y' ? plotWidth : plotHeight, highlighted: isHighlighted, dimmed: isDimmed, chartAreaClipPath: chartAreaClipPath, stackedBarOffsets: stackedBarOffsetMaps[index], highlightedGroupIndex: highlightedGroupIndex }));
|
|
46
42
|
}
|
|
47
43
|
}))));
|
|
48
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-series.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/data-series.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAkB,MAAM,SAAS,CAAC;AAmB9D,MAAM,CAAC,OAAO,UAAU,UAAU,CAA2B,
|
|
1
|
+
{"version":3,"file":"data-series.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/data-series.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;A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CAAC,CAAC,UAAU,EAC/C,WAAW,EAAE,aAAa,EAC1B,MAAM,EAAE,QAAQ,EAChB,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,oBAAoB,CAAC,KAAK,CAAC,EAC9C,qBAAqB,EAAE,qBAAqB,GAC5C,CACH,CAAC;aACL;QACH,CAAC,CAAC,CACA,CACH,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { ChartScale, NumericChartScale } from '../internal/components/cartesian-chart/scales';\nimport LineSeries from './line-series';\nimport BarSeries from './bar-series';\nimport { ChartDataTypes, InternalChartSeries, MixedLineBarChartProps } from './interfaces';\n\nimport styles from './styles.css.js';\nimport { calculateOffsetMaps, StackedOffsets } from './utils';\n\nexport interface DataSeriesProps<T> {\n axis: 'x' | 'y';\n\n plotHeight: number;\n plotWidth: number;\n\n highlightedSeries: MixedLineBarChartProps.ChartSeries<T> | null;\n highlightedGroupIndex: number | null;\n\n stackedBars: boolean;\n isGroupNavigation: boolean;\n\n visibleSeries: ReadonlyArray<InternalChartSeries<T>>;\n xScale: ChartScale;\n yScale: NumericChartScale;\n}\n\nexport default function DataSeries<T extends ChartDataTypes>({\n axis,\n plotHeight,\n plotWidth,\n highlightedGroupIndex,\n highlightedSeries,\n stackedBars,\n isGroupNavigation,\n visibleSeries,\n xScale,\n yScale,\n}: DataSeriesProps<T>) {\n const chartAreaClipPath = useUniqueId('awsui-mixed-line-bar-chart__chart-area-');\n\n const stackedBarOffsetMaps: StackedOffsets[] = useMemo(() => {\n if (!stackedBars) {\n return [];\n }\n\n const barData: Array<readonly MixedLineBarChartProps.Datum<ChartDataTypes>[]> = [];\n visibleSeries.forEach(({ series }) => {\n if (series.type === 'bar') {\n barData.push(series.data);\n }\n });\n return calculateOffsetMaps(barData);\n }, [visibleSeries, stackedBars]);\n\n return (\n <>\n <defs aria-hidden=\"true\">\n <clipPath id={chartAreaClipPath}>\n <rect x={0} y={0} width={plotWidth} height={plotHeight} />\n </clipPath>\n </defs>\n <g aria-hidden={isGroupNavigation ? true : undefined} role=\"group\">\n {visibleSeries.map(({ series, color }, index) => {\n const isHighlighted = series === highlightedSeries;\n const isDimmed = !!highlightedSeries && !isHighlighted;\n\n switch (series.type) {\n case 'line':\n case 'threshold': {\n return (\n <g\n key={index}\n role=\"group\"\n aria-label={series.title}\n className={clsx(styles.series, styles[`series--${series.type}`], {\n [styles['series--highlighted']]: isHighlighted,\n [styles['series--dimmed']]: isDimmed,\n })}\n >\n <LineSeries\n axis={axis}\n series={series}\n color={color}\n xScale={xScale}\n yScale={yScale}\n chartAreaClipPath={chartAreaClipPath}\n />\n </g>\n );\n }\n\n case 'bar':\n return (\n <BarSeries\n key={index}\n axis={axis}\n series={series}\n color={color}\n totalSeriesCount={visibleSeries.filter(s => s.series.type === 'bar').length}\n seriesIndex={index}\n xScale={xScale}\n yScale={yScale}\n plotSize={axis === 'y' ? plotWidth : plotHeight}\n highlighted={isHighlighted}\n dimmed={isDimmed}\n chartAreaClipPath={chartAreaClipPath}\n stackedBarOffsets={stackedBarOffsetMaps[index]}\n highlightedGroupIndex={highlightedGroupIndex}\n />\n );\n }\n })}\n </g>\n </>\n );\n}\n"]}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { __spreadArray } from "tslib";
|
|
4
3
|
import { isDataSeries, isXThreshold, isYThreshold, matchesX } from './utils';
|
|
5
4
|
export function computeDomainX(series, xScaleType) {
|
|
6
5
|
if (xScaleType === 'categorical') {
|
|
7
|
-
return series.reduce(
|
|
6
|
+
return series.reduce((acc, s) => {
|
|
8
7
|
if (isDataSeries(s.series)) {
|
|
9
|
-
s.series.data.forEach(
|
|
10
|
-
var x = _a.x;
|
|
8
|
+
s.series.data.forEach(({ x }) => {
|
|
11
9
|
if (acc.indexOf(x) === -1) {
|
|
12
10
|
acc.push(x);
|
|
13
11
|
}
|
|
@@ -21,25 +19,23 @@ export function computeDomainX(series, xScaleType) {
|
|
|
21
19
|
return acc;
|
|
22
20
|
}, []);
|
|
23
21
|
}
|
|
24
|
-
return series.reduce(
|
|
22
|
+
return series.reduce((acc, curr) => {
|
|
25
23
|
// Y-thresholds don't have X value.
|
|
26
24
|
if (isYThreshold(curr.series)) {
|
|
27
25
|
return acc;
|
|
28
26
|
}
|
|
29
27
|
// Compare x-threshold X with current min, max.
|
|
30
28
|
if (isXThreshold(curr.series)) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
const [min, max] = acc;
|
|
30
|
+
const newMin = min === undefined || min === null || curr.series.x < min ? curr.series.x : min;
|
|
31
|
+
const newMax = max === undefined || max === null || max < curr.series.x ? curr.series.x : max;
|
|
34
32
|
return [newMin, newMax];
|
|
35
33
|
}
|
|
36
34
|
// Compare all series X values with current min, max.
|
|
37
35
|
if (isDataSeries(curr.series)) {
|
|
38
|
-
return curr.series.data.reduce(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var newMin = min === undefined || min === null || x < min ? x : min;
|
|
42
|
-
var newMax = max === undefined || max === null || max < x ? x : max;
|
|
36
|
+
return curr.series.data.reduce(([min, max], { x }) => {
|
|
37
|
+
const newMin = min === undefined || min === null || x < min ? x : min;
|
|
38
|
+
const newMax = max === undefined || max === null || max < x ? x : max;
|
|
43
39
|
return [newMin, newMax];
|
|
44
40
|
}, acc);
|
|
45
41
|
}
|
|
@@ -47,8 +43,8 @@ export function computeDomainX(series, xScaleType) {
|
|
|
47
43
|
}, []);
|
|
48
44
|
}
|
|
49
45
|
function find(arr, func) {
|
|
50
|
-
for (
|
|
51
|
-
|
|
46
|
+
for (let i = 0; i < arr.length; i++) {
|
|
47
|
+
const found = func(arr[i]);
|
|
52
48
|
if (found) {
|
|
53
49
|
return arr[i];
|
|
54
50
|
}
|
|
@@ -56,20 +52,19 @@ function find(arr, func) {
|
|
|
56
52
|
return null;
|
|
57
53
|
}
|
|
58
54
|
export function computeDomainY(series, scaleType, stackedBars) {
|
|
59
|
-
|
|
55
|
+
let _series = series;
|
|
60
56
|
// For stacked bars, we need to accumulate all the bar series into a positive and a negative series
|
|
61
57
|
if (stackedBars) {
|
|
62
|
-
|
|
58
|
+
const { positiveData, negativeData } = series.reduce((acc, curr) => {
|
|
63
59
|
if (curr.series.type === 'bar') {
|
|
64
|
-
curr.series.data.forEach(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
var stackedDatum = find(data, function (el) { return matchesX(el.x, x); });
|
|
60
|
+
curr.series.data.forEach(({ x, y }) => {
|
|
61
|
+
const data = y < 0 ? acc.negativeData : acc.positiveData;
|
|
62
|
+
const stackedDatum = find(data, el => matchesX(el.x, x));
|
|
68
63
|
if (stackedDatum) {
|
|
69
64
|
stackedDatum.y += y;
|
|
70
65
|
}
|
|
71
66
|
else {
|
|
72
|
-
data.push({ x
|
|
67
|
+
data.push({ x, y });
|
|
73
68
|
}
|
|
74
69
|
return acc;
|
|
75
70
|
});
|
|
@@ -77,18 +72,18 @@ export function computeDomainY(series, scaleType, stackedBars) {
|
|
|
77
72
|
return acc;
|
|
78
73
|
}, {
|
|
79
74
|
positiveData: [],
|
|
80
|
-
negativeData: []
|
|
81
|
-
})
|
|
75
|
+
negativeData: [],
|
|
76
|
+
});
|
|
82
77
|
// Artificial series with the sum of all bars when stacked
|
|
83
|
-
|
|
78
|
+
const stackedSeries = [
|
|
84
79
|
{
|
|
85
80
|
color: '',
|
|
86
81
|
index: NaN,
|
|
87
82
|
series: {
|
|
88
83
|
type: 'bar',
|
|
89
84
|
title: 'positive',
|
|
90
|
-
data: positiveData
|
|
91
|
-
}
|
|
85
|
+
data: positiveData,
|
|
86
|
+
},
|
|
92
87
|
},
|
|
93
88
|
{
|
|
94
89
|
color: '',
|
|
@@ -96,21 +91,21 @@ export function computeDomainY(series, scaleType, stackedBars) {
|
|
|
96
91
|
series: {
|
|
97
92
|
type: 'bar',
|
|
98
93
|
title: 'negative',
|
|
99
|
-
data: negativeData
|
|
100
|
-
}
|
|
94
|
+
data: negativeData,
|
|
95
|
+
},
|
|
101
96
|
},
|
|
102
97
|
];
|
|
103
98
|
// MixedLineBarChart can also contain other non-bar series,
|
|
104
99
|
// so we replace all bars with the artificial bar series
|
|
105
100
|
// Then proceed to compute range with it and the remaining (non-bar) series
|
|
106
|
-
_series =
|
|
101
|
+
_series = [...stackedSeries, ..._series.filter(s => s.series.type !== 'bar')];
|
|
107
102
|
}
|
|
108
|
-
|
|
103
|
+
const domain = _series.reduce((acc, curr) => {
|
|
109
104
|
// Compare threshold Y value with current min, max.
|
|
110
105
|
if (isYThreshold(curr.series)) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
106
|
+
const [min, max] = acc;
|
|
107
|
+
const newMin = min === undefined || curr.series.y < min ? curr.series.y : min;
|
|
108
|
+
const newMax = max === undefined || max < curr.series.y ? curr.series.y : max;
|
|
114
109
|
return [newMin, newMax];
|
|
115
110
|
}
|
|
116
111
|
// X-thresholds don't have Y value.
|
|
@@ -119,11 +114,9 @@ export function computeDomainY(series, scaleType, stackedBars) {
|
|
|
119
114
|
}
|
|
120
115
|
// Compare all series Y values with current min, max.
|
|
121
116
|
if (isDataSeries(curr.series)) {
|
|
122
|
-
return curr.series.data.reduce(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
var newMin = min === undefined || y < min ? y : min;
|
|
126
|
-
var newMax = max === undefined || max < y ? y : max;
|
|
117
|
+
return curr.series.data.reduce(([min, max], { y }) => {
|
|
118
|
+
const newMin = min === undefined || y < min ? y : min;
|
|
119
|
+
const newMax = max === undefined || max < y ? y : max;
|
|
127
120
|
return [newMin, newMax];
|
|
128
121
|
}, acc);
|
|
129
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/domain.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC
|
|
1
|
+
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/domain.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAGtC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAE7E,MAAM,UAAU,cAAc,CAAI,MAAyC,EAAE,UAAqB;IAChG,IAAI,UAAU,KAAK,aAAa,EAAE;QAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YAC9B,IAAI,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;gBAC1B,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE;oBAC9B,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;wBACzB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBACb;gBACH,CAAC,CAAC,CAAC;aACJ;YACD,IAAI,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;gBAC1B,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;oBAClC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;iBACtB;aACF;YACD,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAS,CAAC,CAAC;KACf;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QACjC,mCAAmC;QACnC,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAC7B,OAA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9E,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SACzB;QAED,mCAAmC;QACnC,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAC7B,OAAO,GAAG,CAAC;SACZ;QAED,qDAAqD;QACrD,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;YAC7B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE;gBACnD,MAAM,MAAM,GAAG,GAAG,KAAK,SAAS,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBACtD,MAAM,MAAM,GAAG,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;gBACtD,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC1B,CAAC,EAAE,GAAG,CAAC,CAAC;SACT;QAED,OAAO,GAAG,CAAC;IACb,CAAC,EACD,CAAC,CAAC,EAAE,CAAC,CAAC,CACP,CAAC;IAEF,+DAA+D;IAC/D,IAAI,SAAS,KAAK,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;QAC3D,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;KACvB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { InternalChartSeries, MixedLineBarChartProps, ScaleType } from './interfaces';\nimport { isDataSeries, isXThreshold, isYThreshold, matchesX } from './utils';\n\nexport function computeDomainX<T>(series: readonly InternalChartSeries<T>[], xScaleType: ScaleType) {\n if (xScaleType === 'categorical') {\n return series.reduce((acc, s) => {\n if (isDataSeries(s.series)) {\n s.series.data.forEach(({ x }) => {\n if (acc.indexOf(x) === -1) {\n acc.push(x);\n }\n });\n }\n if (isXThreshold(s.series)) {\n if (acc.indexOf(s.series.x) === -1) {\n acc.push(s.series.x);\n }\n }\n return acc;\n }, [] as T[]);\n }\n\n return series.reduce((acc, curr) => {\n // Y-thresholds don't have X value.\n if (isYThreshold(curr.series)) {\n return acc;\n }\n\n // Compare x-threshold X with current min, max.\n if (isXThreshold(curr.series)) {\n const [min, max] = acc;\n const newMin = min === undefined || min === null || curr.series.x < min ? curr.series.x : min;\n const newMax = max === undefined || max === null || max < curr.series.x ? curr.series.x : max;\n return [newMin, newMax] as T[];\n }\n\n // Compare all series X values with current min, max.\n if (isDataSeries(curr.series)) {\n return curr.series.data.reduce(([min, max], { x }) => {\n const newMin = min === undefined || min === null || x < min ? x : min;\n const newMax = max === undefined || max === null || max < x ? x : max;\n return [newMin, newMax] as T[];\n }, acc);\n }\n\n return acc;\n }, [] as T[]);\n}\n\nfunction find<Q>(arr: readonly Q[], func: (el: Q) => boolean) {\n for (let i = 0; i < arr.length; i++) {\n const found = func(arr[i]);\n if (found) {\n return arr[i];\n }\n }\n return null;\n}\n\nexport function computeDomainY<T>(\n series: readonly InternalChartSeries<T>[],\n scaleType: 'linear' | 'log',\n stackedBars: boolean\n) {\n let _series = series;\n\n // For stacked bars, we need to accumulate all the bar series into a positive and a negative series\n if (stackedBars) {\n const { positiveData, negativeData } = series.reduce(\n (acc, curr) => {\n if (curr.series.type === 'bar') {\n curr.series.data.forEach(({ x, y }) => {\n const data = y < 0 ? acc.negativeData : acc.positiveData;\n const stackedDatum = find(data, el => matchesX(el.x, x));\n if (stackedDatum) {\n stackedDatum.y += y;\n } else {\n data.push({ x, y });\n }\n return acc;\n });\n }\n return acc;\n },\n {\n positiveData: [] as MixedLineBarChartProps.Datum<T>[],\n negativeData: [] as MixedLineBarChartProps.Datum<T>[],\n }\n );\n\n // Artificial series with the sum of all bars when stacked\n const stackedSeries: InternalChartSeries<T>[] = [\n {\n color: '',\n index: NaN,\n series: {\n type: 'bar',\n title: 'positive',\n data: positiveData as any,\n },\n },\n {\n color: '',\n index: NaN,\n series: {\n type: 'bar',\n title: 'negative',\n data: negativeData as any,\n },\n },\n ];\n\n // MixedLineBarChart can also contain other non-bar series,\n // so we replace all bars with the artificial bar series\n // Then proceed to compute range with it and the remaining (non-bar) series\n _series = [...stackedSeries, ..._series.filter(s => s.series.type !== 'bar')];\n }\n\n const domain = _series.reduce(\n (acc, curr) => {\n // Compare threshold Y value with current min, max.\n if (isYThreshold(curr.series)) {\n const [min, max] = acc;\n const newMin = min === undefined || curr.series.y < min ? curr.series.y : min;\n const newMax = max === undefined || max < curr.series.y ? curr.series.y : max;\n return [newMin, newMax];\n }\n\n // X-thresholds don't have Y value.\n if (isXThreshold(curr.series)) {\n return acc;\n }\n\n // Compare all series Y values with current min, max.\n if (isDataSeries(curr.series)) {\n return curr.series.data.reduce(([min, max], { y }) => {\n const newMin = min === undefined || y < min ? y : min;\n const newMax = max === undefined || max < y ? y : max;\n return [newMin, newMax];\n }, acc);\n }\n\n return acc;\n },\n [0, 0]\n );\n\n // Log scales can't start from 0, so if possible, start from 1.\n if (scaleType === 'log' && domain[0] === 0 && domain[1] > 1) {\n return [1, domain[1]];\n }\n return domain;\n}\n"]}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { isDataSeries, isXThreshold, isYThreshold, matchesX } from './utils';
|
|
2
2
|
/** Formats provided x-position and its corresponding series values. */
|
|
3
3
|
export default function formatHighlighted(position, series, xTickFormatter) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
series.forEach(
|
|
7
|
-
|
|
4
|
+
const formattedPosition = xTickFormatter ? xTickFormatter(position) : position.toString();
|
|
5
|
+
const details = [];
|
|
6
|
+
series.forEach(s => {
|
|
7
|
+
const detail = getSeriesDetail(s, position);
|
|
8
8
|
if (detail) {
|
|
9
9
|
details.push(detail);
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
return { position: formattedPosition, details
|
|
12
|
+
return { position: formattedPosition, details };
|
|
13
13
|
}
|
|
14
14
|
function getSeriesDetail(internalSeries, targetX) {
|
|
15
|
-
|
|
15
|
+
const { series, color } = internalSeries;
|
|
16
16
|
// X-thresholds are only shown when X matches.
|
|
17
17
|
if (isXThreshold(series)) {
|
|
18
18
|
return series.x === targetX
|
|
19
19
|
? {
|
|
20
20
|
key: series.title,
|
|
21
21
|
value: '',
|
|
22
|
-
color
|
|
23
|
-
markerType: 'dashed'
|
|
22
|
+
color,
|
|
23
|
+
markerType: 'dashed',
|
|
24
24
|
}
|
|
25
25
|
: null;
|
|
26
26
|
}
|
|
@@ -28,19 +28,18 @@ function getSeriesDetail(internalSeries, targetX) {
|
|
|
28
28
|
return {
|
|
29
29
|
key: series.title,
|
|
30
30
|
value: series.valueFormatter ? series.valueFormatter(series.y) : series.y,
|
|
31
|
-
color
|
|
32
|
-
markerType: 'dashed'
|
|
31
|
+
color,
|
|
32
|
+
markerType: 'dashed',
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
if (isDataSeries(series)) {
|
|
36
|
-
for (
|
|
37
|
-
var datum = _a[_i];
|
|
36
|
+
for (const datum of series.data) {
|
|
38
37
|
if (matchesX(targetX, datum.x)) {
|
|
39
38
|
return {
|
|
40
39
|
key: series.title,
|
|
41
40
|
value: series.valueFormatter ? series.valueFormatter(datum.y, targetX) : datum.y,
|
|
42
|
-
color
|
|
43
|
-
markerType: series.type === 'line' ? 'line' : 'rectangle'
|
|
41
|
+
color,
|
|
42
|
+
markerType: series.type === 'line' ? 'line' : 'rectangle',
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-highlighted.js","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/format-highlighted.ts"],"names":[],"mappings":"AAKA,OAAO,E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ACH,CAAC,CAAC,IAAI,CAAC;KACV;IAED,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE;QACxB,OAAO;YACL,GAAG,EAAE,MAAM,CAAC,KAAK;YACjB,KAAK,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YACzE,KAAK;YACL,UAAU,EAAE,QAAQ;SACrB,CAAC;KACH;IAED,IAAI,YAAY,CAAC,MAAM,CAAC,EAAE;QACxB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,IAAI,EAAE;YAC/B,IAAI,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE;gBAC9B,OAAO;oBACL,GAAG,EAAE,MAAM,CAAC,KAAK;oBACjB,KAAK,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;oBAChF,KAAK;oBACL,UAAU,EAAE,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW;iBAC1D,CAAC;aACH;SACF;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ChartDataTypes, InternalChartSeries } from './interfaces';\nimport { ChartSeriesDetailItem } from '../internal/components/chart-series-details';\nimport { CartesianChartProps } from '../internal/components/cartesian-chart/interfaces';\nimport { isDataSeries, isXThreshold, isYThreshold, matchesX } from './utils';\n\nexport interface HighlightDetails {\n position: string;\n details: ChartSeriesDetailItem[];\n}\n\n/** Formats provided x-position and its corresponding series values. */\nexport default function formatHighlighted<T extends ChartDataTypes>(\n position: T,\n series: readonly InternalChartSeries<T>[],\n xTickFormatter?: CartesianChartProps.TickFormatter<T>\n): HighlightDetails {\n const formattedPosition = xTickFormatter ? xTickFormatter(position) : position.toString();\n\n const details: ChartSeriesDetailItem[] = [];\n series.forEach(s => {\n const detail = getSeriesDetail(s, position);\n if (detail) {\n details.push(detail);\n }\n });\n\n return { position: formattedPosition, details };\n}\n\nfunction getSeriesDetail<T>(internalSeries: InternalChartSeries<T>, targetX: T): ChartSeriesDetailItem | null {\n const { series, color } = internalSeries;\n\n // X-thresholds are only shown when X matches.\n if (isXThreshold(series)) {\n return series.x === targetX\n ? {\n key: series.title,\n value: '',\n color,\n markerType: 'dashed',\n }\n : null;\n }\n\n if (isYThreshold(series)) {\n return {\n key: series.title,\n value: series.valueFormatter ? series.valueFormatter(series.y) : series.y,\n color,\n markerType: 'dashed',\n };\n }\n\n if (isDataSeries(series)) {\n for (const datum of series.data) {\n if (matchesX(targetX, datum.x)) {\n return {\n key: series.title,\n value: series.valueFormatter ? series.valueFormatter(datum.y, targetX) : datum.y,\n color,\n markerType: series.type === 'line' ? 'line' : 'rectangle',\n };\n }\n }\n }\n\n return null;\n}\n"]}
|
|
@@ -3,14 +3,13 @@
|
|
|
3
3
|
import { nodeContains } from '../../internal/utils/dom';
|
|
4
4
|
import styles from '../styles.css.js';
|
|
5
5
|
import { isYThreshold } from '../utils';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export function useMouseHover(
|
|
9
|
-
|
|
10
|
-
var isMouseOverPopover = function (event) {
|
|
6
|
+
const MAX_HOVER_MARGIN = 6;
|
|
7
|
+
const POPOVER_DEADZONE = 12;
|
|
8
|
+
export function useMouseHover({ plotRef, popoverRef, scaledSeries, barGroups, highlightPoint, highlightGroup, clearHighlightedSeries, isGroupNavigation, isHandlersDisabled, highlightX, }) {
|
|
9
|
+
const isMouseOverPopover = (event) => {
|
|
11
10
|
var _a;
|
|
12
11
|
if ((_a = popoverRef.current) === null || _a === void 0 ? void 0 : _a.firstChild) {
|
|
13
|
-
|
|
12
|
+
const popoverPosition = popoverRef.current.firstChild.getBoundingClientRect();
|
|
14
13
|
if (event.clientX > popoverPosition.x - POPOVER_DEADZONE &&
|
|
15
14
|
event.clientX < popoverPosition.x + popoverPosition.width + POPOVER_DEADZONE &&
|
|
16
15
|
event.clientY > popoverPosition.y - POPOVER_DEADZONE &&
|
|
@@ -20,29 +19,28 @@ export function useMouseHover(_a) {
|
|
|
20
19
|
}
|
|
21
20
|
return false;
|
|
22
21
|
};
|
|
23
|
-
|
|
22
|
+
const onSeriesMouseMove = (event) => {
|
|
24
23
|
var _a, _b;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.map(
|
|
29
|
-
.reduce(
|
|
24
|
+
const svgRect = event.target.getBoundingClientRect();
|
|
25
|
+
const offsetX = event.clientX - svgRect.left;
|
|
26
|
+
const closestX = scaledSeries
|
|
27
|
+
.map(v => v.x)
|
|
28
|
+
.reduce((prev, curr) => (Math.abs(curr - offsetX) < Math.abs(prev - offsetX) ? curr : prev), -Infinity);
|
|
30
29
|
if (isFinite(closestX)) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
.filter(
|
|
34
|
-
.map(
|
|
35
|
-
.reduce(
|
|
36
|
-
if (isFinite(
|
|
30
|
+
const offsetY = event.clientY - svgRect.top;
|
|
31
|
+
const closestY = scaledSeries
|
|
32
|
+
.filter(v => v.x === closestX || isYThreshold(v.series))
|
|
33
|
+
.map(v => v.y)
|
|
34
|
+
.reduce((prev, curr) => (Math.abs(curr - offsetY) < Math.abs(prev - offsetY) ? curr : prev), -Infinity);
|
|
35
|
+
if (isFinite(closestY) &&
|
|
37
36
|
Math.abs(offsetX - closestX) < MAX_HOVER_MARGIN &&
|
|
38
|
-
Math.abs(
|
|
39
|
-
|
|
40
|
-
highlightPoint({ x: closestX, y:
|
|
37
|
+
Math.abs(offsetY - closestY) < MAX_HOVER_MARGIN) {
|
|
38
|
+
const [{ color, datum, series }] = scaledSeries.filter(s => (s.x === closestX || isYThreshold(s.series)) && s.y === closestY);
|
|
39
|
+
highlightPoint({ x: closestX, y: closestY, color, datum, series });
|
|
41
40
|
}
|
|
42
41
|
else {
|
|
43
|
-
|
|
44
|
-
for (
|
|
45
|
-
var point = scaledSeries_1[_i];
|
|
42
|
+
let datumX = null;
|
|
43
|
+
for (const point of scaledSeries) {
|
|
46
44
|
if (point.x === closestX) {
|
|
47
45
|
datumX = (_b = (_a = point.datum) === null || _a === void 0 ? void 0 : _a.x) !== null && _b !== void 0 ? _b : null;
|
|
48
46
|
break;
|
|
@@ -52,13 +50,13 @@ export function useMouseHover(_a) {
|
|
|
52
50
|
}
|
|
53
51
|
}
|
|
54
52
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
const onGroupMouseMove = (event) => {
|
|
54
|
+
const svgRect = event.target.getBoundingClientRect();
|
|
55
|
+
const offsetX = event.clientX - svgRect.left;
|
|
56
|
+
const offsetY = event.clientY - svgRect.top;
|
|
59
57
|
// If hovering over some group - highlight it.
|
|
60
|
-
for (
|
|
61
|
-
|
|
58
|
+
for (let groupIndex = 0; groupIndex < barGroups.length; groupIndex++) {
|
|
59
|
+
const { position: { x, y, width, height }, } = barGroups[groupIndex];
|
|
62
60
|
if (x <= offsetX && offsetX <= x + width && y <= offsetY && offsetY <= y + height) {
|
|
63
61
|
highlightGroup(groupIndex);
|
|
64
62
|
return;
|
|
@@ -67,7 +65,7 @@ export function useMouseHover(_a) {
|
|
|
67
65
|
// Otherwise - clear the highlight.
|
|
68
66
|
clearHighlightedSeries();
|
|
69
67
|
};
|
|
70
|
-
|
|
68
|
+
const onSVGMouseMove = (event) => {
|
|
71
69
|
if (event.target === plotRef.current.svg && !isHandlersDisabled && !isMouseOverPopover(event)) {
|
|
72
70
|
if (isGroupNavigation) {
|
|
73
71
|
onGroupMouseMove(event);
|
|
@@ -77,7 +75,7 @@ export function useMouseHover(_a) {
|
|
|
77
75
|
}
|
|
78
76
|
}
|
|
79
77
|
};
|
|
80
|
-
|
|
78
|
+
const onSVGMouseOut = (event) => {
|
|
81
79
|
if (isHandlersDisabled || isMouseOverPopover(event)) {
|
|
82
80
|
return;
|
|
83
81
|
}
|
|
@@ -87,12 +85,12 @@ export function useMouseHover(_a) {
|
|
|
87
85
|
clearHighlightedSeries();
|
|
88
86
|
}
|
|
89
87
|
};
|
|
90
|
-
|
|
88
|
+
const onPopoverLeave = (event) => {
|
|
91
89
|
if (!plotRef.current.svg.contains(event.relatedTarget)) {
|
|
92
90
|
highlightX(null);
|
|
93
91
|
clearHighlightedSeries();
|
|
94
92
|
}
|
|
95
93
|
};
|
|
96
|
-
return { onSVGMouseMove
|
|
94
|
+
return { onSVGMouseMove, onSVGMouseOut, onPopoverLeave };
|
|
97
95
|
}
|
|
98
96
|
//# sourceMappingURL=use-mouse-hover.js.map
|