@cloudscape-design/components 3.0.1099 → 3.0.1101
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/interfaces.d.ts +3 -0
- package/alert/interfaces.d.ts.map +1 -1
- package/alert/interfaces.js.map +1 -1
- package/alert/internal.js +2 -2
- package/alert/internal.js.map +1 -1
- package/alert/style.d.ts +3 -0
- package/alert/style.d.ts.map +1 -1
- package/alert/style.js +9 -0
- package/alert/style.js.map +1 -1
- package/alert/styles.css.js +27 -27
- package/alert/styles.scoped.css +50 -50
- package/alert/styles.selectors.js +27 -27
- package/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +32 -32
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/classic.js +11 -11
- package/app-layout/classic.js.map +1 -1
- package/app-layout/notifications/styles.css.js +3 -3
- package/app-layout/notifications/styles.scoped.css +7 -7
- package/app-layout/notifications/styles.selectors.js +3 -3
- package/app-layout/utils/use-focus-control.d.ts +4 -1
- package/app-layout/utils/use-focus-control.d.ts.map +1 -1
- package/app-layout/utils/use-focus-control.js +7 -4
- package/app-layout/utils/use-focus-control.js.map +1 -1
- package/app-layout/visual-refresh/context.d.ts.map +1 -1
- package/app-layout/visual-refresh/context.js +10 -12
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +86 -86
- package/app-layout/visual-refresh/styles.scoped.css +258 -258
- package/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/app-layout/visual-refresh-toolbar/drawer/styles.css.js +25 -25
- package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +73 -73
- package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +25 -25
- package/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
- package/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
- package/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
- package/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +25 -25
- package/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +50 -50
- package/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +25 -25
- package/app-layout/visual-refresh-toolbar/state/use-app-layout.js +10 -10
- package/app-layout/visual-refresh-toolbar/state/use-app-layout.js.map +1 -1
- package/area-chart/model/use-chart-model.d.ts.map +1 -1
- package/area-chart/model/use-chart-model.js +6 -0
- package/area-chart/model/use-chart-model.js.map +1 -1
- package/area-chart/model/utils.d.ts +1 -1
- package/area-chart/model/utils.d.ts.map +1 -1
- package/area-chart/model/utils.js +1 -1
- package/area-chart/model/utils.js.map +1 -1
- package/attribute-editor/styles.css.js +15 -15
- package/attribute-editor/styles.scoped.css +28 -28
- package/attribute-editor/styles.selectors.js +15 -15
- package/breadcrumb-group/item/styles.css.js +7 -7
- package/breadcrumb-group/item/styles.scoped.css +28 -28
- package/breadcrumb-group/item/styles.selectors.js +7 -7
- package/button/styles.css.js +22 -22
- package/button/styles.scoped.css +256 -256
- package/button/styles.selectors.js +22 -22
- package/button-dropdown/item-element/styles.css.js +16 -16
- package/button-dropdown/item-element/styles.scoped.css +27 -27
- package/button-dropdown/item-element/styles.selectors.js +16 -16
- package/checkbox/styles.css.js +3 -3
- package/checkbox/styles.scoped.css +11 -11
- package/checkbox/styles.selectors.js +3 -3
- package/content-layout/styles.css.js +14 -14
- package/content-layout/styles.scoped.css +27 -27
- package/content-layout/styles.selectors.js +14 -14
- package/flashbar/styles.css.js +50 -50
- package/flashbar/styles.scoped.css +187 -187
- package/flashbar/styles.selectors.js +50 -50
- package/help-panel/styles.css.js +6 -6
- package/help-panel/styles.scoped.css +73 -73
- package/help-panel/styles.selectors.js +6 -6
- package/internal/base-component/styles.scoped.css +1 -1
- package/internal/components/drag-handle/hooks/use-drag-handle-interaction-state.js +1 -1
- package/internal/components/drag-handle/hooks/use-drag-handle-interaction-state.js.map +1 -1
- package/internal/components/drag-handle-wrapper/styles.css.js +21 -21
- package/internal/components/drag-handle-wrapper/styles.scoped.css +44 -44
- package/internal/components/drag-handle-wrapper/styles.selectors.js +21 -21
- package/internal/components/dropdown/styles.css.js +20 -20
- package/internal/components/dropdown/styles.scoped.css +38 -38
- package/internal/components/dropdown/styles.selectors.js +20 -20
- package/internal/components/token-list/styles.css.js +10 -10
- package/internal/components/token-list/styles.scoped.css +25 -25
- package/internal/components/token-list/styles.selectors.js +10 -10
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/generated/custom-css-properties/index.d.ts +1 -0
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +85 -84
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/link/styles.css.js +20 -20
- package/link/styles.scoped.css +103 -103
- package/link/styles.selectors.js +20 -20
- package/mixed-line-bar-chart/chart-container.js +1 -1
- package/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/package.json +1 -1
- package/property-filter/interfaces.d.ts +2 -0
- package/property-filter/interfaces.d.ts.map +1 -1
- package/property-filter/interfaces.js.map +1 -1
- package/radio-group/styles.css.js +10 -10
- package/radio-group/styles.scoped.css +22 -22
- package/radio-group/styles.selectors.js +10 -10
- package/slider/styles.css.js +26 -26
- package/slider/styles.scoped.css +86 -86
- package/slider/styles.selectors.js +26 -26
- package/spinner/styles.css.js +13 -13
- package/spinner/styles.scoped.css +39 -39
- package/spinner/styles.selectors.js +13 -13
- package/tag-editor/styles.css.js +3 -3
- package/tag-editor/styles.scoped.css +13 -13
- package/tag-editor/styles.selectors.js +3 -3
- package/text-content/styles.css.js +1 -1
- package/text-content/styles.scoped.css +66 -66
- package/text-content/styles.selectors.js +1 -1
- package/toggle/styles.css.js +10 -10
- package/toggle/styles.scoped.css +23 -23
- package/toggle/styles.selectors.js +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-chart-model.js","sourceRoot":"","sources":["../../../../src/area-chart/model/use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,8CAA8C;IAC9C,WAAW,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;IAExF,uEAAuE;IACvE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,iBAAiB,KAAK,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,iBAAiB,EAAE;YACpE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;SACvD;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE/B,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { MouseEvent, RefObject, useEffect, useMemo, useRef } from 'react';\n\nimport { nodeContains } from '@cloudscape-design/component-toolkit/dom';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { XDomain, XScaleType, YDomain, YScaleType } from '../../internal/components/cartesian-chart/interfaces';\nimport { ChartPlotRef } from '../../internal/components/chart-plot';\nimport { useHeightMeasure } from '../../internal/hooks/container-queries/use-height-measure';\nimport { KeyCode } from '../../internal/keycode';\nimport { circleIndex } from '../../internal/utils/circle-index';\nimport handleKey from '../../internal/utils/handle-key';\nimport { nodeBelongs } from '../../internal/utils/node-belongs';\nimport { throttle } from '../../internal/utils/throttle';\nimport { useReaction } from '../async-store';\nimport { AreaChartProps } from '../interfaces';\nimport computeChartProps from './compute-chart-props';\nimport createSeriesDecorator from './create-series-decorator';\nimport { ChartModel } from './index';\nimport InteractionsStore from './interactions-store';\nimport { findClosest } from './utils';\n\nconst MAX_HOVER_MARGIN = 6;\nconst SVG_HOVER_THROTTLE = 25;\nconst POPOVER_DEADZONE = 12;\n\nexport interface UseChartModelProps<T extends AreaChartProps.DataTypes> {\n isRtl?: boolean;\n fitHeight?: boolean;\n externalSeries: readonly AreaChartProps.Series<T>[];\n visibleSeries: readonly AreaChartProps.Series<T>[];\n setVisibleSeries: (series: readonly AreaChartProps.Series<T>[]) => void;\n highlightedSeries: null | AreaChartProps.Series<T>;\n setHighlightedSeries: (series: null | AreaChartProps.Series<T>) => void;\n xDomain?: XDomain<T>;\n yDomain?: YDomain;\n xScaleType: XScaleType;\n yScaleType: YScaleType;\n height: number;\n width: number;\n popoverRef: RefObject<HTMLElement>;\n statusType: 'loading' | 'finished' | 'error';\n}\n\n// Represents the core the chart logic, including the model of all allowed user interactions.\nexport default function useChartModel<T extends AreaChartProps.DataTypes>({\n isRtl,\n fitHeight,\n externalSeries: allSeries,\n visibleSeries: series,\n setVisibleSeries,\n highlightedSeries,\n setHighlightedSeries,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height: explicitHeight,\n width,\n popoverRef,\n statusType,\n}: UseChartModelProps<T>): ChartModel<T> {\n // Chart elements refs used in handlers.\n const plotRef = useRef<ChartPlotRef>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const verticalMarkerRef = useRef<SVGLineElement>(null);\n\n const plotMeasureRef = useRef<SVGLineElement>(null);\n const hasVisibleSeries = series.length > 0;\n const height =\n useHeightMeasure(() => plotMeasureRef.current, !fitHeight, [hasVisibleSeries, statusType]) ?? explicitHeight;\n const stableSetVisibleSeries = useStableCallback(setVisibleSeries);\n\n const model = useMemo(() => {\n // Compute scales, ticks and two-dimensional plots.\n const computed = computeChartProps({\n isRtl,\n series,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n });\n\n // A store for chart interactions that don't require plot recomputation.\n const interactions = new InteractionsStore(series, computed.plot);\n\n const containsMultipleSeries = interactions.series.length > 1;\n\n // A series decorator to provide extra props such as color and marker type.\n const getInternalSeries = createSeriesDecorator(allSeries);\n\n const isMouseOverPopover = (clientX: number, clientY: number) => {\n if (popoverRef.current?.firstChild) {\n const popoverPosition = (popoverRef.current.firstChild as HTMLElement).getBoundingClientRect();\n if (\n clientX > popoverPosition.x - POPOVER_DEADZONE &&\n clientX < popoverPosition.x + popoverPosition.width + POPOVER_DEADZONE &&\n clientY > popoverPosition.y - POPOVER_DEADZONE &&\n clientY < popoverPosition.y + popoverPosition.height + POPOVER_DEADZONE\n ) {\n return true;\n }\n }\n return false;\n };\n\n // A Callback for svg mouseover to hover the plot points.\n // Throttling is necessary for a substantially smoother customer experience.\n const onSVGMouseMoveThrottled = throttle((clientX: number, clientY: number) => {\n // No hover logic when the popover is pinned or no data available.\n if (\n interactions.get().isPopoverPinned ||\n !plotRef.current ||\n interactions.plot.xy.length === 0 ||\n isMouseOverPopover(clientX, clientY)\n ) {\n return;\n }\n\n const svgRect = plotRef.current.svg.getBoundingClientRect();\n const offsetX = clientX - svgRect.left;\n const offsetY = clientY - svgRect.top;\n\n const closestX = findClosest(interactions.plot.xy, offsetX, xPoints => xPoints[0].scaled.x);\n const closestPoint = findClosest(closestX, offsetY, point => point.scaled.y1);\n\n // If close enough to the point - highlight the point and its column.\n // If not - only highlight the closest column.\n if (\n Math.abs(offsetX - closestPoint.scaled.x) < MAX_HOVER_MARGIN &&\n Math.abs(offsetY - closestPoint.scaled.y1) < MAX_HOVER_MARGIN\n ) {\n interactions.highlightPoint(closestPoint);\n } else {\n interactions.highlightX(closestX);\n }\n }, SVG_HOVER_THROTTLE);\n\n const onSVGMouseMove = ({ clientX, clientY }: React.MouseEvent<SVGElement>) =>\n onSVGMouseMoveThrottled(clientX, clientY);\n\n // A callback for svg mouseout to clear all highlights.\n const onSVGMouseOut = (event: React.MouseEvent<SVGElement>) => {\n // Because the mouseover is throttled, in can occur slightly after the mouseout,\n // neglecting its effect; cancelling the throttled function prevents that.\n onSVGMouseMoveThrottled.cancel();\n\n // No hover logic when the popover is pinned or mouse is over popover\n if (interactions.get().isPopoverPinned || isMouseOverPopover(event.clientX, event.clientY)) {\n return;\n }\n\n // Check if the target is contained within svg to allow hovering on the popover body.\n if (!nodeContains(plotRef.current!.svg, event.relatedTarget as Element)) {\n interactions.clearHighlightedLegend();\n interactions.clearHighlight();\n }\n };\n\n // A callback for svg click to pin/unpin the popover.\n const onSVGMouseDown = (event: React.MouseEvent<SVGSVGElement>) => {\n interactions.togglePopoverPin();\n event.preventDefault();\n };\n\n const moveWithinXAxis = (direction: -1 | 1) => {\n if (interactions.get().highlightedPoint) {\n return moveWithinSeries(direction);\n } else if (containsMultipleSeries) {\n const { highlightedX } = interactions.get();\n if (highlightedX) {\n const currentXIndex = highlightedX[0].index.x;\n const nextXIndex = circleIndex(currentXIndex + direction, [0, interactions.plot.xy.length - 1]);\n interactions.highlightX(interactions.plot.xy[nextXIndex]);\n }\n }\n };\n\n // A helper function to highlight the next or previous point within selected series.\n const moveWithinSeries = (direction: -1 | 1) => {\n // Can only use motion when a particular point is highlighted.\n const point = interactions.get().highlightedPoint;\n if (!point) {\n return;\n }\n\n // Take the index of the currently highlighted series.\n const sIndex = point.index.s;\n // Take the incremented(circularly) x-index of the currently highlighted point.\n const xIndex = circleIndex(point.index.x + direction, [0, interactions.plot.xs.length - 1]);\n // Highlight the next point using x:s grouped data.\n interactions.highlightPoint(interactions.plot.xs[xIndex][sIndex]);\n };\n\n // A helper function to highlight the next or previous point within the selected column.\n const moveBetweenSeries = (direction: -1 | 1) => {\n const point = interactions.get().highlightedPoint;\n if (!point) {\n const { highlightedX } = interactions.get();\n if (highlightedX) {\n const xIndex = highlightedX[0].index.x;\n const points = interactions.plot.xy[xIndex];\n const yIndex = direction === 1 ? 0 : points.length - 1;\n interactions.highlightPoint(points[yIndex]);\n }\n return;\n }\n\n // Take the index of the currently highlighted column.\n const xIndex = point.index.x;\n const currentYIndex = point.index.y;\n\n if (\n containsMultipleSeries &&\n ((currentYIndex === 0 && direction === -1) ||\n (currentYIndex === interactions.plot.xy[xIndex].length - 1 && direction === 1))\n ) {\n interactions.highlightX(interactions.plot.xy[xIndex]);\n } else {\n // Take the incremented(circularly) y-index of the currently highlighted point.\n const nextYIndex = circleIndex(currentYIndex + direction, [0, interactions.plot.xy[xIndex].length - 1]);\n // Highlight the next point using x:y grouped data.\n interactions.highlightPoint(interactions.plot.xy[xIndex][nextYIndex]);\n }\n };\n\n // A callback for svg keydown to enable motions and popover pin with the keyboard.\n const onSVGKeyDown = (event: React.KeyboardEvent<HTMLElement | SVGElement>) => {\n const keyCode = event.keyCode;\n if (\n keyCode !== KeyCode.up &&\n keyCode !== KeyCode.right &&\n keyCode !== KeyCode.down &&\n keyCode !== KeyCode.left &&\n keyCode !== KeyCode.space &&\n keyCode !== KeyCode.enter\n ) {\n return;\n }\n\n // Preventing default fixes an issue in Safari+VO when VO additionally interprets arrow keys as its commands.\n event.preventDefault();\n\n // No keydown logic when the popover is pinned.\n if (interactions.get().isPopoverPinned) {\n return;\n }\n\n handleKey(event, {\n onBlockEnd: () => moveBetweenSeries(-1),\n onBlockStart: () => moveBetweenSeries(1),\n onInlineStart: () => moveWithinXAxis(-1),\n onInlineEnd: () => moveWithinXAxis(1),\n onActivate: () => interactions.pinPopover(),\n });\n };\n\n const highlightFirstX = () => {\n interactions.highlightX(interactions.plot.xy[0]);\n };\n\n // A callback for application focus to highlight series.\n const onApplicationFocus = (_event: React.FocusEvent, trigger: 'mouse' | 'keyboard') => {\n // When focus is caused by a click event nothing is expected as clicks are handled separately.\n if (trigger === 'keyboard') {\n const { highlightedX, highlightedPoint, highlightedSeries, legendSeries } = interactions.get();\n if (containsMultipleSeries && !highlightedX && !highlightedPoint && !highlightedSeries && !legendSeries) {\n highlightFirstX();\n } else if (!highlightedX) {\n interactions.highlightFirstPoint();\n }\n }\n };\n\n // A callback for application blur to clear all highlights unless the popover is pinned.\n const onApplicationBlur = (event: React.FocusEvent<Element>) => {\n // Pinned popover stays pinned even if the focus is lost.\n // If blur is not caused by the popover, forget the previously highlighted point.\n if (!nodeBelongs(containerRef.current, event.relatedTarget) && !interactions.get().isPopoverPinned) {\n interactions.clearHighlight();\n }\n };\n\n const onFilterSeries = (series: readonly AreaChartProps.Series<T>[]) => {\n stableSetVisibleSeries(series);\n };\n\n const onLegendHighlight = (series: null | AreaChartProps.Series<T>) => {\n interactions.highlightSeries(series);\n };\n\n const onPopoverDismiss = (outsideClick?: boolean) => {\n interactions.unpinPopover();\n\n // Return focus back to the application or plot (when no point is highlighted).\n if (!outsideClick) {\n // The delay is needed to bypass focus events caused by click or keypress needed to unpin the popover.\n setTimeout(() => {\n if (interactions.get().highlightedPoint || interactions.get().highlightedX) {\n plotRef.current!.focusApplication();\n } else {\n interactions.clearHighlight();\n plotRef.current!.focusPlot();\n }\n }, 0);\n }\n };\n\n const onContainerBlur = () => {\n interactions.clearState();\n };\n\n const onDocumentKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n interactions.clearHighlight();\n interactions.clearHighlightedLegend();\n }\n };\n\n const onPopoverLeave = (event: MouseEvent) => {\n if (nodeContains(plotRef.current!.svg, event.relatedTarget as Element) || interactions.get().isPopoverPinned) {\n return;\n }\n interactions.clearHighlight();\n interactions.clearHighlightedLegend();\n };\n return {\n width,\n height,\n series,\n allSeries,\n getInternalSeries,\n computed,\n interactions,\n handlers: {\n onSVGMouseMove,\n onSVGMouseOut,\n onSVGMouseDown,\n onSVGKeyDown,\n onApplicationFocus,\n onApplicationBlur,\n onFilterSeries,\n onLegendHighlight,\n onPopoverDismiss,\n onContainerBlur,\n onDocumentKeyDown,\n onPopoverLeave,\n },\n refs: {\n plot: plotRef,\n plotMeasure: plotMeasureRef,\n container: containerRef,\n verticalMarker: verticalMarkerRef,\n popoverRef,\n },\n };\n }, [\n allSeries,\n series,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n stableSetVisibleSeries,\n popoverRef,\n isRtl,\n ]);\n\n // Notify client when series highlight change.\n useReaction(model.interactions, state => state.highlightedSeries, setHighlightedSeries);\n\n // Update interactions store when series highlight in a controlled way.\n useEffect(() => {\n if (highlightedSeries !== model.interactions.get().highlightedSeries) {\n model.interactions.highlightSeries(highlightedSeries);\n }\n }, [model, highlightedSeries]);\n\n return model;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"use-chart-model.js","sourceRoot":"","sources":["../../../../src/area-chart/model/use-chart-model.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAc,EAAyB,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAIlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,SAAS,MAAM,iCAAiC,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,iBAAiB,MAAM,uBAAuB,CAAC;AACtD,OAAO,qBAAqB,MAAM,2BAA2B,CAAC;AAE9D,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAoB5B,6FAA6F;AAC7F,MAAM,CAAC,OAAO,UAAU,aAAa,CAAqC,EACxE,KAAK,EACL,SAAS,EACT,cAAc,EAAE,SAAS,EACzB,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,OAAO,EACP,OAAO,EACP,UAAU,EACV,UAAU,EACV,MAAM,EAAE,cAAc,EACtB,KAAK,EACL,UAAU,EACV,UAAU,G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BACjC,UAAU;aACX;SACF,CAAC;IACJ,CAAC,EAAE;QACD,SAAS;QACT,MAAM;QACN,OAAO;QACP,OAAO;QACP,UAAU;QACV,UAAU;QACV,MAAM;QACN,KAAK;QACL,sBAAsB;QACtB,UAAU;QACV,KAAK;KACN,CAAC,CAAC;IAEH,8CAA8C;IAC9C,WAAW,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,CAAC;IAExF,uEAAuE;IACvE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,iBAAiB,KAAK,KAAK,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,iBAAiB,EAAE;YACpE,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC;SACvD;IACH,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE/B,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { MouseEvent, RefObject, useEffect, useMemo, useRef } from 'react';\n\nimport { nodeContains } from '@cloudscape-design/component-toolkit/dom';\nimport { useStableCallback } from '@cloudscape-design/component-toolkit/internal';\n\nimport { XDomain, XScaleType, YDomain, YScaleType } from '../../internal/components/cartesian-chart/interfaces';\nimport { ChartPlotRef } from '../../internal/components/chart-plot';\nimport { useHeightMeasure } from '../../internal/hooks/container-queries/use-height-measure';\nimport { KeyCode } from '../../internal/keycode';\nimport { circleIndex } from '../../internal/utils/circle-index';\nimport handleKey from '../../internal/utils/handle-key';\nimport { nodeBelongs } from '../../internal/utils/node-belongs';\nimport { throttle } from '../../internal/utils/throttle';\nimport { useReaction } from '../async-store';\nimport { AreaChartProps } from '../interfaces';\nimport computeChartProps from './compute-chart-props';\nimport createSeriesDecorator from './create-series-decorator';\nimport { ChartModel } from './index';\nimport InteractionsStore from './interactions-store';\nimport { findClosest } from './utils';\n\nconst MAX_HOVER_MARGIN = 6;\nconst SVG_HOVER_THROTTLE = 25;\nconst POPOVER_DEADZONE = 12;\n\nexport interface UseChartModelProps<T extends AreaChartProps.DataTypes> {\n isRtl?: boolean;\n fitHeight?: boolean;\n externalSeries: readonly AreaChartProps.Series<T>[];\n visibleSeries: readonly AreaChartProps.Series<T>[];\n setVisibleSeries: (series: readonly AreaChartProps.Series<T>[]) => void;\n highlightedSeries: null | AreaChartProps.Series<T>;\n setHighlightedSeries: (series: null | AreaChartProps.Series<T>) => void;\n xDomain?: XDomain<T>;\n yDomain?: YDomain;\n xScaleType: XScaleType;\n yScaleType: YScaleType;\n height: number;\n width: number;\n popoverRef: RefObject<HTMLElement>;\n statusType: 'loading' | 'finished' | 'error';\n}\n\n// Represents the core the chart logic, including the model of all allowed user interactions.\nexport default function useChartModel<T extends AreaChartProps.DataTypes>({\n isRtl,\n fitHeight,\n externalSeries: allSeries,\n visibleSeries: series,\n setVisibleSeries,\n highlightedSeries,\n setHighlightedSeries,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height: explicitHeight,\n width,\n popoverRef,\n statusType,\n}: UseChartModelProps<T>): ChartModel<T> {\n // Chart elements refs used in handlers.\n const plotRef = useRef<ChartPlotRef>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const verticalMarkerRef = useRef<SVGLineElement>(null);\n\n const plotMeasureRef = useRef<SVGLineElement>(null);\n const hasVisibleSeries = series.length > 0;\n const height =\n useHeightMeasure(() => plotMeasureRef.current, !fitHeight, [hasVisibleSeries, statusType]) ?? explicitHeight;\n const stableSetVisibleSeries = useStableCallback(setVisibleSeries);\n\n const model = useMemo(() => {\n // Compute scales, ticks and two-dimensional plots.\n const computed = computeChartProps({\n isRtl,\n series,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n });\n\n // A store for chart interactions that don't require plot recomputation.\n const interactions = new InteractionsStore(series, computed.plot);\n\n const containsMultipleSeries = interactions.series.length > 1;\n\n // A series decorator to provide extra props such as color and marker type.\n const getInternalSeries = createSeriesDecorator(allSeries);\n\n const isMouseOverPopover = (clientX: number, clientY: number) => {\n if (popoverRef.current?.firstChild) {\n const popoverPosition = (popoverRef.current.firstChild as HTMLElement).getBoundingClientRect();\n if (\n clientX > popoverPosition.x - POPOVER_DEADZONE &&\n clientX < popoverPosition.x + popoverPosition.width + POPOVER_DEADZONE &&\n clientY > popoverPosition.y - POPOVER_DEADZONE &&\n clientY < popoverPosition.y + popoverPosition.height + POPOVER_DEADZONE\n ) {\n return true;\n }\n }\n return false;\n };\n\n // A Callback for svg mouseover to hover the plot points.\n // Throttling is necessary for a substantially smoother customer experience.\n const onSVGMouseMoveThrottled = throttle((clientX: number, clientY: number) => {\n // No hover logic when the popover is pinned or no data available.\n if (\n interactions.get().isPopoverPinned ||\n !plotRef.current ||\n interactions.plot.xy.length === 0 ||\n isMouseOverPopover(clientX, clientY)\n ) {\n return;\n }\n\n const svgRect = plotRef.current.svg.getBoundingClientRect();\n const offsetX = clientX - svgRect.left;\n const offsetY = clientY - svgRect.top;\n\n const closestX = findClosest(interactions.plot.xy, offsetX, xPoints => xPoints[0].scaled.x);\n if (closestX === null) {\n return;\n }\n\n const closestPoint = findClosest(closestX, offsetY, point => point.scaled.y1);\n if (closestPoint === null) {\n return;\n }\n\n // If close enough to the point - highlight the point and its column.\n // If not - only highlight the closest column.\n if (\n Math.abs(offsetX - closestPoint.scaled.x) < MAX_HOVER_MARGIN &&\n Math.abs(offsetY - closestPoint.scaled.y1) < MAX_HOVER_MARGIN\n ) {\n interactions.highlightPoint(closestPoint);\n } else {\n interactions.highlightX(closestX);\n }\n }, SVG_HOVER_THROTTLE);\n\n const onSVGMouseMove = ({ clientX, clientY }: React.MouseEvent<SVGElement>) =>\n onSVGMouseMoveThrottled(clientX, clientY);\n\n // A callback for svg mouseout to clear all highlights.\n const onSVGMouseOut = (event: React.MouseEvent<SVGElement>) => {\n // Because the mouseover is throttled, in can occur slightly after the mouseout,\n // neglecting its effect; cancelling the throttled function prevents that.\n onSVGMouseMoveThrottled.cancel();\n\n // No hover logic when the popover is pinned or mouse is over popover\n if (interactions.get().isPopoverPinned || isMouseOverPopover(event.clientX, event.clientY)) {\n return;\n }\n\n // Check if the target is contained within svg to allow hovering on the popover body.\n if (!nodeContains(plotRef.current!.svg, event.relatedTarget as Element)) {\n interactions.clearHighlightedLegend();\n interactions.clearHighlight();\n }\n };\n\n // A callback for svg click to pin/unpin the popover.\n const onSVGMouseDown = (event: React.MouseEvent<SVGSVGElement>) => {\n interactions.togglePopoverPin();\n event.preventDefault();\n };\n\n const moveWithinXAxis = (direction: -1 | 1) => {\n if (interactions.get().highlightedPoint) {\n return moveWithinSeries(direction);\n } else if (containsMultipleSeries) {\n const { highlightedX } = interactions.get();\n if (highlightedX) {\n const currentXIndex = highlightedX[0].index.x;\n const nextXIndex = circleIndex(currentXIndex + direction, [0, interactions.plot.xy.length - 1]);\n interactions.highlightX(interactions.plot.xy[nextXIndex]);\n }\n }\n };\n\n // A helper function to highlight the next or previous point within selected series.\n const moveWithinSeries = (direction: -1 | 1) => {\n // Can only use motion when a particular point is highlighted.\n const point = interactions.get().highlightedPoint;\n if (!point) {\n return;\n }\n\n // Take the index of the currently highlighted series.\n const sIndex = point.index.s;\n // Take the incremented(circularly) x-index of the currently highlighted point.\n const xIndex = circleIndex(point.index.x + direction, [0, interactions.plot.xs.length - 1]);\n // Highlight the next point using x:s grouped data.\n interactions.highlightPoint(interactions.plot.xs[xIndex][sIndex]);\n };\n\n // A helper function to highlight the next or previous point within the selected column.\n const moveBetweenSeries = (direction: -1 | 1) => {\n const point = interactions.get().highlightedPoint;\n if (!point) {\n const { highlightedX } = interactions.get();\n if (highlightedX) {\n const xIndex = highlightedX[0].index.x;\n const points = interactions.plot.xy[xIndex];\n const yIndex = direction === 1 ? 0 : points.length - 1;\n interactions.highlightPoint(points[yIndex]);\n }\n return;\n }\n\n // Take the index of the currently highlighted column.\n const xIndex = point.index.x;\n const currentYIndex = point.index.y;\n\n if (\n containsMultipleSeries &&\n ((currentYIndex === 0 && direction === -1) ||\n (currentYIndex === interactions.plot.xy[xIndex].length - 1 && direction === 1))\n ) {\n interactions.highlightX(interactions.plot.xy[xIndex]);\n } else {\n // Take the incremented(circularly) y-index of the currently highlighted point.\n const nextYIndex = circleIndex(currentYIndex + direction, [0, interactions.plot.xy[xIndex].length - 1]);\n // Highlight the next point using x:y grouped data.\n interactions.highlightPoint(interactions.plot.xy[xIndex][nextYIndex]);\n }\n };\n\n // A callback for svg keydown to enable motions and popover pin with the keyboard.\n const onSVGKeyDown = (event: React.KeyboardEvent<HTMLElement | SVGElement>) => {\n const keyCode = event.keyCode;\n if (\n keyCode !== KeyCode.up &&\n keyCode !== KeyCode.right &&\n keyCode !== KeyCode.down &&\n keyCode !== KeyCode.left &&\n keyCode !== KeyCode.space &&\n keyCode !== KeyCode.enter\n ) {\n return;\n }\n\n // Preventing default fixes an issue in Safari+VO when VO additionally interprets arrow keys as its commands.\n event.preventDefault();\n\n // No keydown logic when the popover is pinned.\n if (interactions.get().isPopoverPinned) {\n return;\n }\n\n handleKey(event, {\n onBlockEnd: () => moveBetweenSeries(-1),\n onBlockStart: () => moveBetweenSeries(1),\n onInlineStart: () => moveWithinXAxis(-1),\n onInlineEnd: () => moveWithinXAxis(1),\n onActivate: () => interactions.pinPopover(),\n });\n };\n\n const highlightFirstX = () => {\n interactions.highlightX(interactions.plot.xy[0]);\n };\n\n // A callback for application focus to highlight series.\n const onApplicationFocus = (_event: React.FocusEvent, trigger: 'mouse' | 'keyboard') => {\n // When focus is caused by a click event nothing is expected as clicks are handled separately.\n if (trigger === 'keyboard') {\n const { highlightedX, highlightedPoint, highlightedSeries, legendSeries } = interactions.get();\n if (containsMultipleSeries && !highlightedX && !highlightedPoint && !highlightedSeries && !legendSeries) {\n highlightFirstX();\n } else if (!highlightedX) {\n interactions.highlightFirstPoint();\n }\n }\n };\n\n // A callback for application blur to clear all highlights unless the popover is pinned.\n const onApplicationBlur = (event: React.FocusEvent<Element>) => {\n // Pinned popover stays pinned even if the focus is lost.\n // If blur is not caused by the popover, forget the previously highlighted point.\n if (!nodeBelongs(containerRef.current, event.relatedTarget) && !interactions.get().isPopoverPinned) {\n interactions.clearHighlight();\n }\n };\n\n const onFilterSeries = (series: readonly AreaChartProps.Series<T>[]) => {\n stableSetVisibleSeries(series);\n };\n\n const onLegendHighlight = (series: null | AreaChartProps.Series<T>) => {\n interactions.highlightSeries(series);\n };\n\n const onPopoverDismiss = (outsideClick?: boolean) => {\n interactions.unpinPopover();\n\n // Return focus back to the application or plot (when no point is highlighted).\n if (!outsideClick) {\n // The delay is needed to bypass focus events caused by click or keypress needed to unpin the popover.\n setTimeout(() => {\n if (interactions.get().highlightedPoint || interactions.get().highlightedX) {\n plotRef.current!.focusApplication();\n } else {\n interactions.clearHighlight();\n plotRef.current!.focusPlot();\n }\n }, 0);\n }\n };\n\n const onContainerBlur = () => {\n interactions.clearState();\n };\n\n const onDocumentKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n interactions.clearHighlight();\n interactions.clearHighlightedLegend();\n }\n };\n\n const onPopoverLeave = (event: MouseEvent) => {\n if (nodeContains(plotRef.current!.svg, event.relatedTarget as Element) || interactions.get().isPopoverPinned) {\n return;\n }\n interactions.clearHighlight();\n interactions.clearHighlightedLegend();\n };\n return {\n width,\n height,\n series,\n allSeries,\n getInternalSeries,\n computed,\n interactions,\n handlers: {\n onSVGMouseMove,\n onSVGMouseOut,\n onSVGMouseDown,\n onSVGKeyDown,\n onApplicationFocus,\n onApplicationBlur,\n onFilterSeries,\n onLegendHighlight,\n onPopoverDismiss,\n onContainerBlur,\n onDocumentKeyDown,\n onPopoverLeave,\n },\n refs: {\n plot: plotRef,\n plotMeasure: plotMeasureRef,\n container: containerRef,\n verticalMarker: verticalMarkerRef,\n popoverRef,\n },\n };\n }, [\n allSeries,\n series,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n stableSetVisibleSeries,\n popoverRef,\n isRtl,\n ]);\n\n // Notify client when series highlight change.\n useReaction(model.interactions, state => state.highlightedSeries, setHighlightedSeries);\n\n // Update interactions store when series highlight in a controlled way.\n useEffect(() => {\n if (highlightedSeries !== model.interactions.get().highlightedSeries) {\n model.interactions.highlightSeries(highlightedSeries);\n }\n }, [model, highlightedSeries]);\n\n return model;\n}\n"]}
|
|
@@ -9,5 +9,5 @@ export declare function computePlotPoints<T>(series: readonly AreaChartProps.Ser
|
|
|
9
9
|
xs: ChartModel.PlotPoint<T>[][];
|
|
10
10
|
sx: ChartModel.PlotPoint<T>[][];
|
|
11
11
|
};
|
|
12
|
-
export declare function findClosest<T>(sortedArray: readonly T[], target: number, getter: (item: T) => number): T;
|
|
12
|
+
export declare function findClosest<T>(sortedArray: readonly T[], target: number, getter: (item: T) => number): null | T;
|
|
13
13
|
export declare function isSeriesValid<T>(series: readonly AreaChartProps.Series<T>[]): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/area-chart/model/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,sDAAsD,CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAQrC,wBAAgB,cAAc,CAAC,CAAC,SAAS,cAAc,EAAE,MAAM,EAAE,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAkBhH;AAGD,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,UAAU,GA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,MAAM,EAAE,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAC3C,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,iBAAiB,GACxB;IACD,EAAE,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAChC,EAAE,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAChC,EAAE,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;CACjC,CA6DA;AAGD,wBAAgB,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,IAAI,GAAG,CAAC,CAqB/G;AAGD,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,WAc3E"}
|
|
@@ -112,7 +112,7 @@ export function computePlotPoints(series, xScale, yScale) {
|
|
|
112
112
|
export function findClosest(sortedArray, target, getter) {
|
|
113
113
|
// The method guarantees to return a point hence empty arrays are not allowed.
|
|
114
114
|
if (sortedArray.length === 0) {
|
|
115
|
-
|
|
115
|
+
return null;
|
|
116
116
|
}
|
|
117
117
|
const isAscending = getter(sortedArray[0]) < getter(sortedArray[sortedArray.length - 1]);
|
|
118
118
|
const compare = (x) => (isAscending ? getter(x) < target : getter(x) > target);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/area-chart/model/utils.ts"],"names":[],"mappings":"AAOA,8BAA8B;AAC9B,kEAAkE;AAClE,sGAAsG;AACtG,MAAM,OAAO,GAAG,eAAe,CAAC;AAEhC,8EAA8E;AAC9E,MAAM,UAAU,cAAc,CAA2B,MAA2C;IAClG,MAAM,OAAO,GAAG,UAAU,CAAC,MAA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AE,GAAW,EAAE,KAAQ;IAC5E,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;QAChB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;KAClB;IACD,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC3B,CAAC;AAED,kEAAkE;AAClE,SAAS,IAAI,CAAI,GAAiB;IAChC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;IACtB,MAAM,SAAS,GAAQ,EAAE,CAAC;IAE1B,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE;QACvB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACnB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACf,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACvB;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ChartDataTypes, XDomain, YDomain, YScaleType } from '../../internal/components/cartesian-chart/interfaces';\nimport { ChartScale, NumericChartScale } from '../../internal/components/cartesian-chart/scales';\nimport { AreaChartProps } from '../interfaces';\nimport { ChartModel } from './index';\n\n// A sufficiently small value.\n// The Number.EPSILON is not available in the target ECMA version.\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON\nconst EPSILON = 0.0000000000001;\n\n// When x-domain is not set explicitly - guess it based on the available data.\nexport function computeDomainX<T extends ChartDataTypes>(series: readonly AreaChartProps.Series<T>[]): XDomain<T> {\n const xValues = getXValues(series);\n\n if (xValues.length === 0) {\n return [] as unknown as XDomain<T>;\n }\n\n // Assuming categorical domain.\n // In that case, all values are to be included.\n if (typeof xValues[0] === 'string') {\n return uniq(xValues) as unknown as XDomain<T>;\n }\n\n // For non-categorical domain find min and max bounds.\n return xValues.reduce(\n ([min, max], x) => [x < min ? x : min, max < x ? x : max],\n [xValues[0], xValues[0]]\n ) as unknown as XDomain<T>;\n}\n\n// When y-domain is not set explicitly - guess it based on the available data and series.\nexport function computeDomainY<T>(series: readonly AreaChartProps.Series<T>[], scaleType: YScaleType): YDomain {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n // Find the min and max for threshold series.\n series.forEach(s => {\n if (s.type === 'threshold') {\n min = Math.min(min, s.y);\n max = Math.max(max, s.y);\n }\n });\n\n // Find the min and max for area series considering their stacking.\n getXValues(series).forEach((_, xIndex) => {\n // Maintains the prev stack level.\n let stackY = scaleType === 'linear' ? 0 : EPSILON;\n\n for (const s of series) {\n if (s.type === 'area') {\n stackY = stackY + (s.data[xIndex]?.y || 0);\n min = Math.min(min, stackY);\n max = Math.max(max, stackY);\n }\n }\n });\n\n // If min/max is not overridden than either series or series data is empty.\n if (min === Number.POSITIVE_INFINITY) {\n return [];\n }\n\n // Log scales can't start from 0, so, if possible, start from 1.\n if (scaleType === 'log' && min === 0 && max > 1) {\n return [1, max];\n }\n\n return [min, max];\n}\n\n// For given data, series and scales, compute all points and group them as\n// x:y, x:series and series:x to allow constant time access to the required point or subset.\nexport function computePlotPoints<T>(\n series: readonly AreaChartProps.Series<T>[],\n xScale: ChartScale,\n yScale: NumericChartScale\n): {\n xy: ChartModel.PlotPoint<T>[][];\n xs: ChartModel.PlotPoint<T>[][];\n sx: ChartModel.PlotPoint<T>[][];\n} {\n const xValues = getXValues(series);\n\n // Lookup for xy[xIndex][yIndex]\n const xy: ChartModel.PlotPoint<T>[][] = [];\n // Lookup for xs[xIndex][seriesIndex]\n const xs: ChartModel.PlotPoint<T>[][] = [];\n // Lookup for sx[seriesIndex][xIndex]\n const sx: ChartModel.PlotPoint<T>[][] = [];\n\n // Filter out the data which is beyond the plot for whatever reason.\n getVisibleData(xValues, xScale).forEach(({ x, scaledX }, xIndex) => {\n // Maintains the prev stack level. Starting from epsilon to not break log scales.\n let stackY = yScale.scaleType === 'linear' ? 0 : EPSILON;\n\n // A column of series points related to the same x.\n const points: ChartModel.PlotPoint<T>[] = [];\n\n // Collect the points, leaving y-index as 0 for now.\n series.forEach((s, sIndex) => {\n if (s.type === 'threshold') {\n const scaledY = yScale.d3Scale(s.y) || 0;\n points.push({\n x: x,\n y0: s.y,\n y1: s.y,\n scaled: { x: scaledX, y0: scaledY, y1: scaledY },\n index: { x: xIndex, s: sIndex, y: 0 },\n value: 0,\n });\n } else {\n const value = s.data[xIndex]?.y || 0;\n const y0 = stackY;\n const y1 = stackY + value;\n points.push({\n x: x,\n y0: y0,\n y1: y1,\n scaled: { x: scaledX, y0: yScale.d3Scale(y0) || 0, y1: yScale.d3Scale(y1) || 0 },\n index: { x: xIndex, s: sIndex, y: 0 },\n value: value,\n });\n\n stackY = y1;\n }\n });\n\n // Sort points by y and insert the missing y-index.\n points\n .sort((p1, p2) => p1.y1 - p2.y1)\n .forEach((point, index) => {\n point.index.y = index;\n\n // Insert the points to the respective two-dimensional lookup arrays.\n insertIntoMatrix(xy, point.index.x, point.index.y, point);\n insertIntoMatrix(xs, point.index.x, point.index.s, point);\n insertIntoMatrix(sx, point.index.s, point.index.x, point);\n });\n });\n\n return { xy, xs, sx };\n}\n\n// Finds the closest point in the sorted array.\nexport function findClosest<T>(sortedArray: readonly T[], target: number, getter: (item: T) => number): T {\n // The method guarantees to return a point hence empty arrays are not allowed.\n if (sortedArray.length === 0) {\n throw new Error('Invariant violation: array is empty.');\n }\n\n const isAscending = getter(sortedArray[0]) < getter(sortedArray[sortedArray.length - 1]);\n const compare = (x: T) => (isAscending ? getter(x) < target : getter(x) > target);\n const delta = (x: T) => Math.abs(getter(x) - target);\n\n // Use binary search to find the closest value in a sorted array.\n let lo = 0;\n let hi = sortedArray.length - 1;\n while (hi - lo > 1) {\n const mid = Math.floor((lo + hi) / 2);\n if (compare(sortedArray[mid])) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return delta(sortedArray[lo]) < delta(sortedArray[hi]) ? sortedArray[lo] : sortedArray[hi];\n}\n\n// Compares all x-values between series to ensure they are consistent.\nexport function isSeriesValid<T>(series: readonly AreaChartProps.Series<T>[]) {\n const sampleXValues = getXValues(series);\n\n for (const s of series) {\n if (s.type === 'area') {\n for (let i = 0; i < Math.max(s.data.length, sampleXValues.length); i++) {\n if (s.data[i]?.x !== sampleXValues[i]) {\n return false;\n }\n }\n }\n }\n\n return true;\n}\n\n// Takes first area series x-values as all data x-values are to match across series.\nfunction getXValues<T>(series: readonly AreaChartProps.Series<T>[]) {\n for (const s of series) {\n if (s.type === 'area') {\n return s.data.map(({ x }) => x);\n }\n }\n\n return [];\n}\n\n// Returns data that is visible in the given scale.\nfunction getVisibleData<T>(data: readonly T[], xScale: ChartScale) {\n const scaledOffsetX = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0;\n\n const visibleData = [];\n for (const x of data) {\n const scaledX = xScale.d3Scale(x as any);\n\n if (scaledX !== undefined) {\n visibleData.push({ x, scaledX: scaledX + scaledOffsetX });\n }\n }\n return visibleData;\n}\n\n// Inserts given value into a two-dimensional array.\nfunction insertIntoMatrix<T>(matrix: T[][], row: number, col: number, value: T) {\n if (!matrix[row]) {\n matrix[row] = [];\n }\n matrix[row][col] = value;\n}\n\n// Creates new array with only unique elements of the given array.\nfunction uniq<T>(arr: readonly T[]): readonly T[] {\n const set = new Set();\n const uniqArray: T[] = [];\n\n for (const value of arr) {\n if (!set.has(value)) {\n set.add(value);\n uniqArray.push(value);\n }\n }\n\n return uniqArray;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/area-chart/model/utils.ts"],"names":[],"mappings":"AAOA,8BAA8B;AAC9B,kEAAkE;AAClE,sGAAsG;AACtG,MAAM,OAAO,GAAG,eAAe,CAAC;AAEhC,8EAA8E;AAC9E,MAAM,UAAU,cAAc,CAA2B,MAA2C;IAClG,MAAM,OAAO,GAAG,UAAU,CAAC,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AC5E,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;QAChB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;KAClB;IACD,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAC3B,CAAC;AAED,kEAAkE;AAClE,SAAS,IAAI,CAAI,GAAiB;IAChC,MAAM,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;IACtB,MAAM,SAAS,GAAQ,EAAE,CAAC;IAE1B,KAAK,MAAM,KAAK,IAAI,GAAG,EAAE;QACvB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACnB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YACf,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACvB;KACF;IAED,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ChartDataTypes, XDomain, YDomain, YScaleType } from '../../internal/components/cartesian-chart/interfaces';\nimport { ChartScale, NumericChartScale } from '../../internal/components/cartesian-chart/scales';\nimport { AreaChartProps } from '../interfaces';\nimport { ChartModel } from './index';\n\n// A sufficiently small value.\n// The Number.EPSILON is not available in the target ECMA version.\n// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/EPSILON\nconst EPSILON = 0.0000000000001;\n\n// When x-domain is not set explicitly - guess it based on the available data.\nexport function computeDomainX<T extends ChartDataTypes>(series: readonly AreaChartProps.Series<T>[]): XDomain<T> {\n const xValues = getXValues(series);\n\n if (xValues.length === 0) {\n return [] as unknown as XDomain<T>;\n }\n\n // Assuming categorical domain.\n // In that case, all values are to be included.\n if (typeof xValues[0] === 'string') {\n return uniq(xValues) as unknown as XDomain<T>;\n }\n\n // For non-categorical domain find min and max bounds.\n return xValues.reduce(\n ([min, max], x) => [x < min ? x : min, max < x ? x : max],\n [xValues[0], xValues[0]]\n ) as unknown as XDomain<T>;\n}\n\n// When y-domain is not set explicitly - guess it based on the available data and series.\nexport function computeDomainY<T>(series: readonly AreaChartProps.Series<T>[], scaleType: YScaleType): YDomain {\n let min = Number.POSITIVE_INFINITY;\n let max = Number.NEGATIVE_INFINITY;\n\n // Find the min and max for threshold series.\n series.forEach(s => {\n if (s.type === 'threshold') {\n min = Math.min(min, s.y);\n max = Math.max(max, s.y);\n }\n });\n\n // Find the min and max for area series considering their stacking.\n getXValues(series).forEach((_, xIndex) => {\n // Maintains the prev stack level.\n let stackY = scaleType === 'linear' ? 0 : EPSILON;\n\n for (const s of series) {\n if (s.type === 'area') {\n stackY = stackY + (s.data[xIndex]?.y || 0);\n min = Math.min(min, stackY);\n max = Math.max(max, stackY);\n }\n }\n });\n\n // If min/max is not overridden than either series or series data is empty.\n if (min === Number.POSITIVE_INFINITY) {\n return [];\n }\n\n // Log scales can't start from 0, so, if possible, start from 1.\n if (scaleType === 'log' && min === 0 && max > 1) {\n return [1, max];\n }\n\n return [min, max];\n}\n\n// For given data, series and scales, compute all points and group them as\n// x:y, x:series and series:x to allow constant time access to the required point or subset.\nexport function computePlotPoints<T>(\n series: readonly AreaChartProps.Series<T>[],\n xScale: ChartScale,\n yScale: NumericChartScale\n): {\n xy: ChartModel.PlotPoint<T>[][];\n xs: ChartModel.PlotPoint<T>[][];\n sx: ChartModel.PlotPoint<T>[][];\n} {\n const xValues = getXValues(series);\n\n // Lookup for xy[xIndex][yIndex]\n const xy: ChartModel.PlotPoint<T>[][] = [];\n // Lookup for xs[xIndex][seriesIndex]\n const xs: ChartModel.PlotPoint<T>[][] = [];\n // Lookup for sx[seriesIndex][xIndex]\n const sx: ChartModel.PlotPoint<T>[][] = [];\n\n // Filter out the data which is beyond the plot for whatever reason.\n getVisibleData(xValues, xScale).forEach(({ x, scaledX }, xIndex) => {\n // Maintains the prev stack level. Starting from epsilon to not break log scales.\n let stackY = yScale.scaleType === 'linear' ? 0 : EPSILON;\n\n // A column of series points related to the same x.\n const points: ChartModel.PlotPoint<T>[] = [];\n\n // Collect the points, leaving y-index as 0 for now.\n series.forEach((s, sIndex) => {\n if (s.type === 'threshold') {\n const scaledY = yScale.d3Scale(s.y) || 0;\n points.push({\n x: x,\n y0: s.y,\n y1: s.y,\n scaled: { x: scaledX, y0: scaledY, y1: scaledY },\n index: { x: xIndex, s: sIndex, y: 0 },\n value: 0,\n });\n } else {\n const value = s.data[xIndex]?.y || 0;\n const y0 = stackY;\n const y1 = stackY + value;\n points.push({\n x: x,\n y0: y0,\n y1: y1,\n scaled: { x: scaledX, y0: yScale.d3Scale(y0) || 0, y1: yScale.d3Scale(y1) || 0 },\n index: { x: xIndex, s: sIndex, y: 0 },\n value: value,\n });\n\n stackY = y1;\n }\n });\n\n // Sort points by y and insert the missing y-index.\n points\n .sort((p1, p2) => p1.y1 - p2.y1)\n .forEach((point, index) => {\n point.index.y = index;\n\n // Insert the points to the respective two-dimensional lookup arrays.\n insertIntoMatrix(xy, point.index.x, point.index.y, point);\n insertIntoMatrix(xs, point.index.x, point.index.s, point);\n insertIntoMatrix(sx, point.index.s, point.index.x, point);\n });\n });\n\n return { xy, xs, sx };\n}\n\n// Finds the closest point in the sorted array.\nexport function findClosest<T>(sortedArray: readonly T[], target: number, getter: (item: T) => number): null | T {\n // The method guarantees to return a point hence empty arrays are not allowed.\n if (sortedArray.length === 0) {\n return null;\n }\n const isAscending = getter(sortedArray[0]) < getter(sortedArray[sortedArray.length - 1]);\n const compare = (x: T) => (isAscending ? getter(x) < target : getter(x) > target);\n const delta = (x: T) => Math.abs(getter(x) - target);\n\n // Use binary search to find the closest value in a sorted array.\n let lo = 0;\n let hi = sortedArray.length - 1;\n while (hi - lo > 1) {\n const mid = Math.floor((lo + hi) / 2);\n if (compare(sortedArray[mid])) {\n lo = mid;\n } else {\n hi = mid;\n }\n }\n return delta(sortedArray[lo]) < delta(sortedArray[hi]) ? sortedArray[lo] : sortedArray[hi];\n}\n\n// Compares all x-values between series to ensure they are consistent.\nexport function isSeriesValid<T>(series: readonly AreaChartProps.Series<T>[]) {\n const sampleXValues = getXValues(series);\n\n for (const s of series) {\n if (s.type === 'area') {\n for (let i = 0; i < Math.max(s.data.length, sampleXValues.length); i++) {\n if (s.data[i]?.x !== sampleXValues[i]) {\n return false;\n }\n }\n }\n }\n\n return true;\n}\n\n// Takes first area series x-values as all data x-values are to match across series.\nfunction getXValues<T>(series: readonly AreaChartProps.Series<T>[]) {\n for (const s of series) {\n if (s.type === 'area') {\n return s.data.map(({ x }) => x);\n }\n }\n\n return [];\n}\n\n// Returns data that is visible in the given scale.\nfunction getVisibleData<T>(data: readonly T[], xScale: ChartScale) {\n const scaledOffsetX = xScale.isCategorical() ? Math.max(0, xScale.d3Scale.bandwidth() - 1) / 2 : 0;\n\n const visibleData = [];\n for (const x of data) {\n const scaledX = xScale.d3Scale(x as any);\n\n if (scaledX !== undefined) {\n visibleData.push({ x, scaledX: scaledX + scaledOffsetX });\n }\n }\n return visibleData;\n}\n\n// Inserts given value into a two-dimensional array.\nfunction insertIntoMatrix<T>(matrix: T[][], row: number, col: number, value: T) {\n if (!matrix[row]) {\n matrix[row] = [];\n }\n matrix[row][col] = value;\n}\n\n// Creates new array with only unique elements of the given array.\nfunction uniq<T>(arr: readonly T[]): readonly T[] {\n const set = new Set();\n const uniqArray: T[] = [];\n\n for (const value of arr) {\n if (!set.has(value)) {\n set.add(value);\n uniqArray.push(value);\n }\n }\n\n return uniqArray;\n}\n"]}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"empty-appear": "awsui_empty-
|
|
5
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
6
|
-
"root": "
|
|
7
|
-
"empty": "
|
|
8
|
-
"row": "
|
|
9
|
-
"divider": "
|
|
10
|
-
"row-control": "awsui_row-
|
|
11
|
-
"field": "
|
|
12
|
-
"additional-info": "awsui_additional-
|
|
13
|
-
"add-row": "awsui_add-
|
|
14
|
-
"add-button": "awsui_add-
|
|
15
|
-
"remove-button-container": "awsui_remove-button-
|
|
16
|
-
"remove-button-field-padding": "awsui_remove-button-field-
|
|
17
|
-
"remove-button-own-row": "awsui_remove-button-own-
|
|
18
|
-
"remove-button": "awsui_remove-
|
|
4
|
+
"empty-appear": "awsui_empty-appear_n4qlp_1d9g0_153",
|
|
5
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_1d9g0_1",
|
|
6
|
+
"root": "awsui_root_n4qlp_1d9g0_175",
|
|
7
|
+
"empty": "awsui_empty_n4qlp_1d9g0_153",
|
|
8
|
+
"row": "awsui_row_n4qlp_1d9g0_218",
|
|
9
|
+
"divider": "awsui_divider_n4qlp_1d9g0_222",
|
|
10
|
+
"row-control": "awsui_row-control_n4qlp_1d9g0_227",
|
|
11
|
+
"field": "awsui_field_n4qlp_1d9g0_231",
|
|
12
|
+
"additional-info": "awsui_additional-info_n4qlp_1d9g0_235",
|
|
13
|
+
"add-row": "awsui_add-row_n4qlp_1d9g0_281",
|
|
14
|
+
"add-button": "awsui_add-button_n4qlp_1d9g0_285",
|
|
15
|
+
"remove-button-container": "awsui_remove-button-container_n4qlp_1d9g0_289",
|
|
16
|
+
"remove-button-field-padding": "awsui_remove-button-field-padding_n4qlp_1d9g0_293",
|
|
17
|
+
"remove-button-own-row": "awsui_remove-button-own-row_n4qlp_1d9g0_297",
|
|
18
|
+
"remove-button": "awsui_remove-button_n4qlp_1d9g0_289"
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -150,10 +150,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
150
150
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
151
151
|
SPDX-License-Identifier: Apache-2.0
|
|
152
152
|
*/
|
|
153
|
-
.awsui_empty-
|
|
154
|
-
animation: awsui_awsui-motion-fade-
|
|
153
|
+
.awsui_empty-appear_n4qlp_1d9g0_153:not(#\9) {
|
|
154
|
+
animation: awsui_awsui-motion-fade-in_n4qlp_1d9g0_1 var(--motion-duration-transition-show-paced-t8d1os, 180ms) var(--motion-easing-transition-show-paced-x2k7uh, ease-out);
|
|
155
155
|
}
|
|
156
|
-
@keyframes awsui_awsui-motion-fade-
|
|
156
|
+
@keyframes awsui_awsui-motion-fade-in_n4qlp_1d9g0_1 {
|
|
157
157
|
from {
|
|
158
158
|
opacity: 0.2;
|
|
159
159
|
}
|
|
@@ -162,17 +162,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
@media (prefers-reduced-motion: reduce) {
|
|
165
|
-
.awsui_empty-
|
|
165
|
+
.awsui_empty-appear_n4qlp_1d9g0_153:not(#\9) {
|
|
166
166
|
animation: none;
|
|
167
167
|
transition: none;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
.awsui-motion-disabled .awsui_empty-
|
|
170
|
+
.awsui-motion-disabled .awsui_empty-appear_n4qlp_1d9g0_153:not(#\9), .awsui-mode-entering .awsui_empty-appear_n4qlp_1d9g0_153:not(#\9) {
|
|
171
171
|
animation: none;
|
|
172
172
|
transition: none;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
.
|
|
175
|
+
.awsui_root_n4qlp_1d9g0_175:not(#\9) {
|
|
176
176
|
border-collapse: separate;
|
|
177
177
|
border-spacing: 0;
|
|
178
178
|
box-sizing: border-box;
|
|
@@ -208,31 +208,31 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
208
208
|
align-items: start;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
.
|
|
211
|
+
.awsui_empty_n4qlp_1d9g0_153:not(#\9) {
|
|
212
212
|
font-size: var(--font-size-body-m-a7nh2n, 14px);
|
|
213
213
|
line-height: var(--line-height-body-m-2mh3ke, 20px);
|
|
214
214
|
color: var(--color-text-empty-tlohug, #656871);
|
|
215
215
|
grid-column: 1/-1;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
.
|
|
218
|
+
.awsui_row_n4qlp_1d9g0_218:not(#\9) {
|
|
219
219
|
display: contents;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
.
|
|
222
|
+
.awsui_divider_n4qlp_1d9g0_222:not(#\9) {
|
|
223
223
|
grid-column: 1/-1;
|
|
224
224
|
border-block-start: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
.awsui_row-
|
|
227
|
+
.awsui_row-control_n4qlp_1d9g0_227:not(#\9) {
|
|
228
228
|
/* used in test-utils */
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
.
|
|
231
|
+
.awsui_field_n4qlp_1d9g0_231:not(#\9) {
|
|
232
232
|
/* used in test-utils */
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
.awsui_additional-
|
|
235
|
+
.awsui_additional-info_n4qlp_1d9g0_235:not(#\9) {
|
|
236
236
|
color: var(--color-text-form-secondary-1nm780, #656871);
|
|
237
237
|
font-size: var(--font-size-body-s-smc8cv, 12px);
|
|
238
238
|
line-height: var(--line-height-body-s-nu5hx1, 16px);
|
|
@@ -242,10 +242,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
242
242
|
margin-block-start: var(--space-xxs-hwfkai, 4px);
|
|
243
243
|
/* stylelint-disable-next-line selector-max-type */
|
|
244
244
|
}
|
|
245
|
-
.awsui_additional-
|
|
245
|
+
.awsui_additional-info_n4qlp_1d9g0_235 > a:not(#\9) {
|
|
246
246
|
text-underline-offset: 0.3em;
|
|
247
247
|
text-decoration-thickness: 1px;
|
|
248
|
-
color: var(--awsui-style-color-default-
|
|
248
|
+
color: var(--awsui-style-color-default-vl73au, var(--color-text-link-default-1dmm7z, #006ce0));
|
|
249
249
|
font-weight: inherit;
|
|
250
250
|
letter-spacing: normal;
|
|
251
251
|
text-decoration-line: underline;
|
|
@@ -256,50 +256,50 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
256
256
|
transition-duration: var(--motion-duration-refresh-only-medium-5rbn3k, 165ms);
|
|
257
257
|
}
|
|
258
258
|
@media (prefers-reduced-motion: reduce) {
|
|
259
|
-
.awsui_additional-
|
|
259
|
+
.awsui_additional-info_n4qlp_1d9g0_235 > a:not(#\9) {
|
|
260
260
|
animation: none;
|
|
261
261
|
transition: none;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
.awsui-motion-disabled .awsui_additional-
|
|
264
|
+
.awsui-motion-disabled .awsui_additional-info_n4qlp_1d9g0_235 > a:not(#\9), .awsui-mode-entering .awsui_additional-info_n4qlp_1d9g0_235 > a:not(#\9) {
|
|
265
265
|
animation: none;
|
|
266
266
|
transition: none;
|
|
267
267
|
}
|
|
268
|
-
.awsui_additional-
|
|
268
|
+
.awsui_additional-info_n4qlp_1d9g0_235 > a:not(#\9):hover {
|
|
269
269
|
cursor: pointer;
|
|
270
|
-
color: var(--awsui-style-color-hover-
|
|
270
|
+
color: var(--awsui-style-color-hover-vl73au, var(--color-text-link-hover-sq1gxg, #002b66));
|
|
271
271
|
}
|
|
272
|
-
.awsui_additional-
|
|
272
|
+
.awsui_additional-info_n4qlp_1d9g0_235 > a:not(#\9):focus {
|
|
273
273
|
outline: none;
|
|
274
274
|
}
|
|
275
|
-
.awsui_additional-
|
|
276
|
-
color: var(--awsui-style-color-active-
|
|
275
|
+
.awsui_additional-info_n4qlp_1d9g0_235 > a:not(#\9):active {
|
|
276
|
+
color: var(--awsui-style-color-active-vl73au, var(--color-text-link-hover-sq1gxg, #002b66));
|
|
277
277
|
}
|
|
278
|
-
.awsui_additional-
|
|
278
|
+
.awsui_additional-info_n4qlp_1d9g0_235 > a:not(#\9):active, .awsui_additional-info_n4qlp_1d9g0_235 > a:not(#\9):focus, .awsui_additional-info_n4qlp_1d9g0_235 > a:not(#\9):hover {
|
|
279
279
|
text-decoration-line: underline;
|
|
280
280
|
text-decoration-color: currentColor;
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
.awsui_add-
|
|
283
|
+
.awsui_add-row_n4qlp_1d9g0_281:not(#\9) {
|
|
284
284
|
grid-column: 1/-1;
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
.awsui_add-
|
|
287
|
+
.awsui_add-button_n4qlp_1d9g0_285:not(#\9) {
|
|
288
288
|
/* used in test-utils */
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
.awsui_remove-button-
|
|
291
|
+
.awsui_remove-button-container_n4qlp_1d9g0_289:not(#\9) {
|
|
292
292
|
display: inline-block;
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
.awsui_remove-button-field-
|
|
295
|
+
.awsui_remove-button-field-padding_n4qlp_1d9g0_293:not(#\9) {
|
|
296
296
|
padding-block-start: calc(var(--space-xxs-hwfkai, 4px) + var(--line-height-body-m-2mh3ke, 20px));
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
.awsui_remove-button-own-
|
|
299
|
+
.awsui_remove-button-own-row_n4qlp_1d9g0_297:not(#\9) {
|
|
300
300
|
justify-self: end;
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
-
.awsui_remove-
|
|
303
|
+
.awsui_remove-button_n4qlp_1d9g0_289:not(#\9) {
|
|
304
304
|
/* used in test-utils */
|
|
305
305
|
}
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"empty-appear": "awsui_empty-
|
|
6
|
-
"awsui-motion-fade-in": "awsui_awsui-motion-fade-
|
|
7
|
-
"root": "
|
|
8
|
-
"empty": "
|
|
9
|
-
"row": "
|
|
10
|
-
"divider": "
|
|
11
|
-
"row-control": "awsui_row-
|
|
12
|
-
"field": "
|
|
13
|
-
"additional-info": "awsui_additional-
|
|
14
|
-
"add-row": "awsui_add-
|
|
15
|
-
"add-button": "awsui_add-
|
|
16
|
-
"remove-button-container": "awsui_remove-button-
|
|
17
|
-
"remove-button-field-padding": "awsui_remove-button-field-
|
|
18
|
-
"remove-button-own-row": "awsui_remove-button-own-
|
|
19
|
-
"remove-button": "awsui_remove-
|
|
5
|
+
"empty-appear": "awsui_empty-appear_n4qlp_1d9g0_153",
|
|
6
|
+
"awsui-motion-fade-in": "awsui_awsui-motion-fade-in_n4qlp_1d9g0_1",
|
|
7
|
+
"root": "awsui_root_n4qlp_1d9g0_175",
|
|
8
|
+
"empty": "awsui_empty_n4qlp_1d9g0_153",
|
|
9
|
+
"row": "awsui_row_n4qlp_1d9g0_218",
|
|
10
|
+
"divider": "awsui_divider_n4qlp_1d9g0_222",
|
|
11
|
+
"row-control": "awsui_row-control_n4qlp_1d9g0_227",
|
|
12
|
+
"field": "awsui_field_n4qlp_1d9g0_231",
|
|
13
|
+
"additional-info": "awsui_additional-info_n4qlp_1d9g0_235",
|
|
14
|
+
"add-row": "awsui_add-row_n4qlp_1d9g0_281",
|
|
15
|
+
"add-button": "awsui_add-button_n4qlp_1d9g0_285",
|
|
16
|
+
"remove-button-container": "awsui_remove-button-container_n4qlp_1d9g0_289",
|
|
17
|
+
"remove-button-field-padding": "awsui_remove-button-field-padding_n4qlp_1d9g0_293",
|
|
18
|
+
"remove-button-own-row": "awsui_remove-button-own-row_n4qlp_1d9g0_297",
|
|
19
|
+
"remove-button": "awsui_remove-button_n4qlp_1d9g0_289"
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"link": "
|
|
5
|
-
"breadcrumb": "
|
|
6
|
-
"ghost-breadcrumb": "awsui_ghost-
|
|
7
|
-
"icon": "
|
|
8
|
-
"anchor": "
|
|
9
|
-
"text": "
|
|
10
|
-
"last": "
|
|
4
|
+
"link": "awsui_link_1kosq_mc874_145",
|
|
5
|
+
"breadcrumb": "awsui_breadcrumb_1kosq_mc874_149",
|
|
6
|
+
"ghost-breadcrumb": "awsui_ghost-breadcrumb_1kosq_mc874_150",
|
|
7
|
+
"icon": "awsui_icon_1kosq_mc874_153",
|
|
8
|
+
"anchor": "awsui_anchor_1kosq_mc874_159",
|
|
9
|
+
"text": "awsui_text_1kosq_mc874_206",
|
|
10
|
+
"last": "awsui_last_1kosq_mc874_225"
|
|
11
11
|
};
|
|
12
12
|
|
|
@@ -142,27 +142,27 @@
|
|
|
142
142
|
*/
|
|
143
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.
|
|
145
|
+
.awsui_link_1kosq_mc874_145:not(#\9):after {
|
|
146
146
|
display: none;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
.
|
|
150
|
-
.awsui_ghost-
|
|
149
|
+
.awsui_breadcrumb_1kosq_mc874_149:not(#\9),
|
|
150
|
+
.awsui_ghost-breadcrumb_1kosq_mc874_150:not(#\9) {
|
|
151
151
|
display: flex;
|
|
152
152
|
}
|
|
153
|
-
.
|
|
154
|
-
.awsui_ghost-
|
|
153
|
+
.awsui_breadcrumb_1kosq_mc874_149 > .awsui_icon_1kosq_mc874_153:not(#\9),
|
|
154
|
+
.awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_icon_1kosq_mc874_153:not(#\9) {
|
|
155
155
|
margin-block: 0;
|
|
156
156
|
margin-inline: var(--space-xs-ymlm0b, 8px);
|
|
157
157
|
color: var(--color-text-breadcrumb-icon-9j48ot, #8c8c94);
|
|
158
158
|
}
|
|
159
|
-
.
|
|
160
|
-
.awsui_ghost-
|
|
159
|
+
.awsui_breadcrumb_1kosq_mc874_149 > .awsui_anchor_1kosq_mc874_159:not(#\9),
|
|
160
|
+
.awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_anchor_1kosq_mc874_159:not(#\9) {
|
|
161
161
|
min-inline-size: 0;
|
|
162
162
|
overflow: hidden;
|
|
163
163
|
text-underline-offset: 0.25em;
|
|
164
164
|
text-decoration-thickness: 1px;
|
|
165
|
-
color: var(--awsui-style-color-default-
|
|
165
|
+
color: var(--awsui-style-color-default-vl73au, var(--color-text-link-default-1dmm7z, #006ce0));
|
|
166
166
|
font-weight: inherit;
|
|
167
167
|
letter-spacing: normal;
|
|
168
168
|
text-decoration-line: underline;
|
|
@@ -173,42 +173,42 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
173
173
|
transition-duration: var(--motion-duration-refresh-only-medium-5rbn3k, 165ms);
|
|
174
174
|
}
|
|
175
175
|
@media (prefers-reduced-motion: reduce) {
|
|
176
|
-
.
|
|
177
|
-
.awsui_ghost-
|
|
176
|
+
.awsui_breadcrumb_1kosq_mc874_149 > .awsui_anchor_1kosq_mc874_159:not(#\9),
|
|
177
|
+
.awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_anchor_1kosq_mc874_159:not(#\9) {
|
|
178
178
|
animation: none;
|
|
179
179
|
transition: none;
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
.awsui-motion-disabled .
|
|
182
|
+
.awsui-motion-disabled .awsui_breadcrumb_1kosq_mc874_149 > .awsui_anchor_1kosq_mc874_159:not(#\9), .awsui-mode-entering .awsui_breadcrumb_1kosq_mc874_149 > .awsui_anchor_1kosq_mc874_159:not(#\9), .awsui-motion-disabled .awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_anchor_1kosq_mc874_159:not(#\9), .awsui-mode-entering .awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_anchor_1kosq_mc874_159:not(#\9) {
|
|
183
183
|
animation: none;
|
|
184
184
|
transition: none;
|
|
185
185
|
}
|
|
186
|
-
.
|
|
187
|
-
.awsui_ghost-
|
|
186
|
+
.awsui_breadcrumb_1kosq_mc874_149 > .awsui_anchor_1kosq_mc874_159:not(#\9):hover,
|
|
187
|
+
.awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_anchor_1kosq_mc874_159:not(#\9):hover {
|
|
188
188
|
cursor: pointer;
|
|
189
|
-
color: var(--awsui-style-color-hover-
|
|
189
|
+
color: var(--awsui-style-color-hover-vl73au, var(--color-text-link-hover-sq1gxg, #002b66));
|
|
190
190
|
}
|
|
191
|
-
.
|
|
192
|
-
.awsui_ghost-
|
|
191
|
+
.awsui_breadcrumb_1kosq_mc874_149 > .awsui_anchor_1kosq_mc874_159:not(#\9):focus,
|
|
192
|
+
.awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_anchor_1kosq_mc874_159:not(#\9):focus {
|
|
193
193
|
outline: none;
|
|
194
194
|
}
|
|
195
|
-
.
|
|
196
|
-
.awsui_ghost-
|
|
197
|
-
color: var(--awsui-style-color-active-
|
|
195
|
+
.awsui_breadcrumb_1kosq_mc874_149 > .awsui_anchor_1kosq_mc874_159:not(#\9):active,
|
|
196
|
+
.awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_anchor_1kosq_mc874_159:not(#\9):active {
|
|
197
|
+
color: var(--awsui-style-color-active-vl73au, var(--color-text-link-hover-sq1gxg, #002b66));
|
|
198
198
|
}
|
|
199
|
-
.
|
|
199
|
+
.awsui_breadcrumb_1kosq_mc874_149 > .awsui_anchor_1kosq_mc874_159:not(#\9):active, .awsui_breadcrumb_1kosq_mc874_149 > .awsui_anchor_1kosq_mc874_159:not(#\9):focus, .awsui_breadcrumb_1kosq_mc874_149 > .awsui_anchor_1kosq_mc874_159:not(#\9):hover, .awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_anchor_1kosq_mc874_159:not(#\9):active, .awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_anchor_1kosq_mc874_159:not(#\9):focus, .awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_anchor_1kosq_mc874_159:not(#\9):hover {
|
|
200
200
|
text-decoration-line: underline;
|
|
201
201
|
text-decoration-color: currentColor;
|
|
202
202
|
}
|
|
203
|
-
.
|
|
204
|
-
.awsui_ghost-
|
|
203
|
+
.awsui_breadcrumb_1kosq_mc874_149 > .awsui_anchor_1kosq_mc874_159 > .awsui_text_1kosq_mc874_206:not(#\9),
|
|
204
|
+
.awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_anchor_1kosq_mc874_159 > .awsui_text_1kosq_mc874_206:not(#\9) {
|
|
205
205
|
overflow: hidden;
|
|
206
206
|
text-overflow: ellipsis;
|
|
207
207
|
white-space: nowrap;
|
|
208
208
|
display: block;
|
|
209
209
|
}
|
|
210
|
-
body[data-awsui-focus-visible=true] .
|
|
211
|
-
body[data-awsui-focus-visible=true] .awsui_ghost-
|
|
210
|
+
body[data-awsui-focus-visible=true] .awsui_breadcrumb_1kosq_mc874_149 > .awsui_anchor_1kosq_mc874_159:not(#\9):focus,
|
|
211
|
+
body[data-awsui-focus-visible=true] .awsui_ghost-breadcrumb_1kosq_mc874_150 > .awsui_anchor_1kosq_mc874_159:not(#\9):focus {
|
|
212
212
|
outline: thin dotted;
|
|
213
213
|
outline: var(--border-link-focus-ring-outline-1p0hnu, 0);
|
|
214
214
|
outline-offset: 2px;
|
|
@@ -219,12 +219,12 @@ body[data-awsui-focus-visible=true] .awsui_ghost-breadcrumb_1kosq_1uirt_150 > .a
|
|
|
219
219
|
border-end-end-radius: var(--border-radius-control-default-focus-ring-1uabki, 4px);
|
|
220
220
|
box-shadow: 0 0 0 var(--border-link-focus-ring-shadow-spread-39uvxr, 2px) var(--color-border-item-focused-uk47pl, #006ce0);
|
|
221
221
|
}
|
|
222
|
-
.
|
|
223
|
-
.awsui_ghost-
|
|
222
|
+
.awsui_breadcrumb_1kosq_mc874_149.awsui_last_1kosq_mc874_225 > .awsui_icon_1kosq_mc874_153:not(#\9),
|
|
223
|
+
.awsui_ghost-breadcrumb_1kosq_mc874_150.awsui_last_1kosq_mc874_225 > .awsui_icon_1kosq_mc874_153:not(#\9) {
|
|
224
224
|
display: none;
|
|
225
225
|
}
|
|
226
|
-
.
|
|
227
|
-
.awsui_ghost-
|
|
226
|
+
.awsui_breadcrumb_1kosq_mc874_149.awsui_last_1kosq_mc874_225 > .awsui_anchor_1kosq_mc874_159:not(#\9),
|
|
227
|
+
.awsui_ghost-breadcrumb_1kosq_mc874_150.awsui_last_1kosq_mc874_225 > .awsui_anchor_1kosq_mc874_159:not(#\9) {
|
|
228
228
|
color: var(--color-text-breadcrumb-current-2mqnkk, #656871);
|
|
229
229
|
font-weight: 700;
|
|
230
230
|
text-decoration: none;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"link": "
|
|
6
|
-
"breadcrumb": "
|
|
7
|
-
"ghost-breadcrumb": "awsui_ghost-
|
|
8
|
-
"icon": "
|
|
9
|
-
"anchor": "
|
|
10
|
-
"text": "
|
|
11
|
-
"last": "
|
|
5
|
+
"link": "awsui_link_1kosq_mc874_145",
|
|
6
|
+
"breadcrumb": "awsui_breadcrumb_1kosq_mc874_149",
|
|
7
|
+
"ghost-breadcrumb": "awsui_ghost-breadcrumb_1kosq_mc874_150",
|
|
8
|
+
"icon": "awsui_icon_1kosq_mc874_153",
|
|
9
|
+
"anchor": "awsui_anchor_1kosq_mc874_159",
|
|
10
|
+
"text": "awsui_text_1kosq_mc874_206",
|
|
11
|
+
"last": "awsui_last_1kosq_mc874_225"
|
|
12
12
|
};
|
|
13
13
|
|