@cloudscape-design/chart-components 1.0.21 → 1.0.23
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/core/chart-api/chart-extra-legend.js +2 -2
- package/core/chart-api/chart-extra-legend.js.map +1 -1
- package/core/chart-container.d.ts +3 -2
- package/core/chart-container.js +3 -4
- package/core/chart-container.js.map +1 -1
- package/core/chart-core.js +51 -36
- package/core/chart-core.js.map +1 -1
- package/core/components/core-legend.d.ts +7 -5
- package/core/components/core-legend.js +34 -4
- package/core/components/core-legend.js.map +1 -1
- package/core/components/core-tooltip.d.ts +1 -1
- package/core/components/core-tooltip.js +10 -7
- package/core/components/core-tooltip.js.map +1 -1
- package/core/interfaces.d.ts +22 -2
- package/core/interfaces.js.map +1 -1
- package/core/styles.css.js +21 -20
- package/core/styles.scoped.css +31 -21
- package/core/styles.selectors.js +21 -20
- package/core/test-classes/styles.css.js +30 -28
- package/core/test-classes/styles.scoped.css +30 -28
- package/core/test-classes/styles.selectors.js +30 -28
- package/core/utils.d.ts +24 -2
- package/core/utils.js +75 -12
- package/core/utils.js.map +1 -1
- package/internal/components/chart-legend/index.d.ts +9 -5
- package/internal/components/chart-legend/index.js +52 -77
- package/internal/components/chart-legend/index.js.map +1 -1
- package/internal/components/chart-legend/styles.css.js +17 -23
- package/internal/components/chart-legend/styles.scoped.css +40 -61
- package/internal/components/chart-legend/styles.selectors.js +17 -23
- package/internal/components/interfaces.d.ts +1 -0
- package/internal/components/interfaces.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/internal/utils/use-debounced-value.d.ts +1 -0
- package/internal/utils/use-debounced-value.js +26 -0
- package/internal/utils/use-debounced-value.js.map +1 -0
- package/internal-do-not-use/core-legend/index.d.ts +1 -1
- package/internal-do-not-use/core-legend/index.js +29 -3
- package/internal-do-not-use/core-legend/index.js.map +1 -1
- package/package.json +1 -1
- package/test-utils/dom/internal/core.d.ts +1 -0
- package/test-utils/dom/internal/core.js +4 -1
- package/test-utils/dom/internal/core.js.map +1 -1
- package/test-utils/selectors/internal/core.d.ts +1 -0
- package/test-utils/selectors/internal/core.js +4 -1
- package/test-utils/selectors/internal/core.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/chart-legend/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,UAAU,EAAO,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EAEP,+BAA+B,EAC/B,YAAY,EACZ,0BAA0B,GAC3B,MAAM,+CAA+C,CAAC;AACvD,OAAO,GAAG,MAAM,mCAAmC,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iEAAiE,CAAC;AAGvG,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,WAAW,MAAM,8BAA8B,CAAC;AAEvD,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,YAAY,GAAG,GAAG,CAAC;AAezB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,KAAK,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,QAAQ,EACR,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACF,EAAE,EAAE;;IACrB,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,kBAAkB,GAAG,MAAM,CAA8B,EAAE,CAAC,CAAC;IACnE,MAAM,eAAe,GAAG,MAAM,CAA8B,EAAE,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ACtC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,aAAa;YAC3D,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,aAAa;SAChE,CAAC,EACF,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,aAEnB,MAAM,EACP,eAAM,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,YAAG,KAAK,GAAQ,IAC9C,CACV,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { forwardRef, Ref, useEffect, useMemo, useRef, useState } from \"react\";\nimport clsx from \"clsx\";\n\nimport {\n circleIndex,\n handleKey,\n KeyCode,\n SingleTabStopNavigationAPI,\n SingleTabStopNavigationProvider,\n useMergeRefs,\n useSingleTabStopNavigation,\n} from \"@cloudscape-design/component-toolkit/internal\";\nimport Box from \"@cloudscape-design/components/box\";\nimport { InternalChartTooltip } from \"@cloudscape-design/components/internal/do-not-use/chart-tooltip\";\n\nimport { CoreChartProps } from \"../../../core/interfaces\";\nimport { DebouncedCall } from \"../../utils/utils\";\nimport { GetLegendTooltipContentProps, LegendItem, LegendTooltipContent } from \"../interfaces\";\n\nimport styles from \"./styles.css.js\";\nimport testClasses from \"./test-classes/styles.css.js\";\n\nconst TOOLTIP_BLUR_DELAY = 50;\nconst HIGHLIGHT_LOST_DELAY = 50;\nconst SCROLL_DELAY = 100;\n\nexport interface ChartLegendProps {\n items: readonly LegendItem[];\n legendTitle?: string;\n ariaLabel?: string;\n actions?: React.ReactNode;\n position: \"bottom\" | \"side\";\n horizontalAlignment: CoreChartProps.LegendOptionsHorizontalAlignment;\n onItemHighlightEnter: (item: LegendItem) => void;\n onItemHighlightExit: () => void;\n onItemVisibilityChange: (hiddenItems: string[]) => void;\n getTooltipContent: (props: GetLegendTooltipContentProps) => null | LegendTooltipContent;\n}\n\nexport const ChartLegend = ({\n items,\n legendTitle,\n ariaLabel,\n actions,\n position,\n onItemVisibilityChange,\n onItemHighlightEnter,\n onItemHighlightExit,\n getTooltipContent,\n horizontalAlignment,\n}: ChartLegendProps) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const elementsByIndexRef = useRef<Record<number, HTMLElement>>([]);\n const elementsByIdRef = useRef<Record<string, HTMLElement>>({});\n const tooltipRef = useRef<HTMLElement>(null);\n const highlightControl = useMemo(() => new DebouncedCall(), []);\n const scrollIntoViewControl = useMemo(() => new DebouncedCall(), []);\n const [selectedIndex, setSelectedIndex] = useState<number>(0);\n const [tooltipItemId, setTooltipItemId] = useState<string | null>(null);\n const { showTooltip, hideTooltip } = useMemo(() => {\n const control = new DebouncedCall();\n return {\n showTooltip(itemId: string) {\n control.call(() => setTooltipItemId(itemId));\n },\n hideTooltip(lock = false) {\n control.call(() => setTooltipItemId(null), TOOLTIP_BLUR_DELAY);\n if (lock) {\n control.lock(TOOLTIP_BLUR_DELAY);\n }\n },\n };\n }, []);\n\n useEffect(() => {\n if (!tooltipItemId) {\n return;\n }\n const onDocumentKeyDown = (event: KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n hideTooltip(true);\n elementsByIdRef.current[tooltipItemId]?.focus();\n }\n };\n document.addEventListener(\"keydown\", onDocumentKeyDown, true);\n return () => {\n document.removeEventListener(\"keydown\", onDocumentKeyDown, true);\n };\n }, [items, tooltipItemId, hideTooltip]);\n const isMouseInContainer = useRef<boolean>(false);\n\n // Scrolling to the highlighted legend item.\n useEffect(() => {\n const highlightedIndex = items.findIndex((item) => item.highlighted);\n if (highlightedIndex === -1) {\n return;\n }\n scrollIntoViewControl.call(() => {\n if (isMouseInContainer.current) {\n return;\n }\n const container = containerRef.current;\n const element = elementsByIndexRef.current?.[highlightedIndex];\n if (!container || !element) {\n return;\n }\n const elementRect = element.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n const isVisible = elementRect.top >= containerRect.top && elementRect.bottom <= containerRect.bottom;\n if (!isVisible) {\n const elementCenter = elementRect.top + elementRect.height / 2;\n const containerCenter = containerRect.top + containerRect.height / 2;\n const top = container.scrollTop + (elementCenter - containerCenter);\n container.scrollTo({ top, behavior: \"smooth\" });\n }\n }, SCROLL_DELAY);\n }, [items, scrollIntoViewControl]);\n\n const showHighlight = (itemId: string) => {\n const item = items.find((item) => item.id === itemId);\n if (item?.visible) {\n highlightControl.cancelPrevious();\n onItemHighlightEnter(item);\n }\n };\n const clearHighlight = () => {\n highlightControl.call(onItemHighlightExit, HIGHLIGHT_LOST_DELAY);\n };\n\n const navigationAPI = useRef<SingleTabStopNavigationAPI>(null);\n\n function onFocus(index: number, itemId: string) {\n setSelectedIndex(index);\n navigationAPI.current!.updateFocusTarget();\n showHighlight(itemId);\n showTooltip(itemId);\n }\n\n function onBlur(event: React.FocusEvent) {\n navigationAPI.current!.updateFocusTarget();\n\n // Hide tooltip and clear highlight unless focus moves inside tooltip;\n if (tooltipRef.current && event.relatedTarget && !tooltipRef.current.contains(event.relatedTarget)) {\n clearHighlight();\n hideTooltip();\n }\n }\n\n function focusElement(index: number) {\n elementsByIndexRef.current[index]?.focus();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLElement>) {\n if (\n event.keyCode === KeyCode.right ||\n event.keyCode === KeyCode.left ||\n event.keyCode === KeyCode.up ||\n event.keyCode === KeyCode.down ||\n event.keyCode === KeyCode.home ||\n event.keyCode === KeyCode.end ||\n event.keyCode === KeyCode.escape\n ) {\n // Preventing default fixes an issue in Safari+VO when VO additionally interprets arrow keys as its commands.\n event.preventDefault();\n\n const range = [0, items.length - 1] as [number, number];\n\n handleKey(event, {\n onInlineStart: () => focusElement(circleIndex(selectedIndex - 1, range)),\n onInlineEnd: () => focusElement(circleIndex(selectedIndex + 1, range)),\n onBlockStart: () => focusElement(circleIndex(selectedIndex - 1, range)),\n onBlockEnd: () => focusElement(circleIndex(selectedIndex + 1, range)),\n onHome: () => focusElement(0),\n onEnd: () => focusElement(items.length - 1),\n onEscape: () => onItemHighlightExit(),\n });\n }\n }\n\n function getNextFocusTarget(): null | HTMLElement {\n if (containerRef.current) {\n const buttons: HTMLButtonElement[] = Array.from(containerRef.current.querySelectorAll(`.${styles.item}`));\n return buttons[selectedIndex] ?? null;\n }\n return null;\n }\n\n function onUnregisterActive(\n focusableElement: HTMLElement,\n navigationAPI: React.RefObject<{ getFocusTarget: () => HTMLElement | null }>,\n ) {\n const target = navigationAPI.current?.getFocusTarget();\n\n if (target && target.dataset.itemid !== focusableElement.dataset.itemid) {\n target.focus();\n }\n }\n\n useEffect(() => {\n navigationAPI.current!.updateFocusTarget();\n });\n\n const toggleItem = (itemId: string) => {\n const visibleItems = items.filter((i) => i.visible).map((i) => i.id);\n if (visibleItems.includes(itemId)) {\n onItemVisibilityChange(visibleItems.filter((visibleItemId) => visibleItemId !== itemId));\n } else {\n onItemVisibilityChange([...visibleItems, itemId]);\n }\n // Needed for touch devices.\n onItemHighlightExit();\n };\n\n const selectItem = (itemId: string) => {\n const visibleItems = items.filter((i) => i.visible).map((i) => i.id);\n if (visibleItems.length === 1 && visibleItems[0] === itemId) {\n onItemVisibilityChange(items.map((i) => i.id));\n } else {\n onItemVisibilityChange([itemId]);\n }\n // Needed for touch devices.\n onItemHighlightExit();\n };\n\n const tooltipTrack = useRef<null | HTMLElement>(null);\n const tooltipTarget = items.find((item) => item.id === tooltipItemId) ?? null;\n tooltipTrack.current = tooltipItemId ? elementsByIdRef.current[tooltipItemId] : null;\n const tooltipContent = tooltipTarget && getTooltipContent({ legendItem: tooltipTarget });\n const tooltipPosition = position === \"bottom\" ? \"bottom\" : \"left\";\n\n return (\n <SingleTabStopNavigationProvider\n ref={navigationAPI}\n navigationActive={true}\n getNextFocusTarget={() => getNextFocusTarget()}\n onUnregisterActive={(element: HTMLElement) => onUnregisterActive(element, navigationAPI)}\n >\n <div\n ref={containerRef}\n role=\"toolbar\"\n aria-label={legendTitle || ariaLabel}\n className={clsx(testClasses.root, styles.root, {\n [styles[\"root-side\"]]: position === \"side\",\n })}\n onMouseEnter={() => (isMouseInContainer.current = true)}\n onMouseLeave={() => (isMouseInContainer.current = false)}\n >\n {legendTitle && (\n <Box\n fontWeight=\"bold\"\n className={clsx(testClasses.title, {\n [styles[`legend-title-${horizontalAlignment}`]]: position === \"bottom\",\n })}\n >\n {legendTitle}\n </Box>\n )}\n\n <div\n // The list element is not focusable. However, the focus lands on it regardless, when testing in Firefox.\n // Setting the tab index to -1 does fix the problem.\n tabIndex={-1}\n className={clsx(styles.list, {\n [styles[`list-bottom-${horizontalAlignment}`]]: position === \"bottom\",\n [styles[\"list-bottom\"]]: position === \"bottom\",\n [styles[\"list-side\"]]: position === \"side\",\n })}\n >\n {actions && (\n <>\n <div\n className={clsx(testClasses.actions, styles.actions, {\n [styles[\"actions-bottom\"]]: position === \"bottom\",\n [styles[\"actions-side\"]]: position === \"side\",\n })}\n >\n {actions}\n <div\n className={clsx(styles[\"actions-divider\"], {\n [styles[\"actions-divider-bottom\"]]: position === \"bottom\",\n [styles[\"actions-divider-side\"]]: position === \"side\",\n })}\n />\n </div>\n </>\n )}\n <div\n className={clsx({\n [styles[`legend-bottom-${horizontalAlignment}`]]: position === \"bottom\",\n [styles[\"legend-bottom\"]]: position === \"bottom\",\n [styles[\"legend-side\"]]: position === \"side\",\n })}\n >\n {items.map((item, index) => {\n const handlers = {\n onMouseEnter: () => {\n showHighlight(item.id);\n showTooltip(item.id);\n },\n onMouseLeave: () => {\n clearHighlight();\n hideTooltip();\n },\n onFocus: () => {\n onFocus(index, item.id);\n },\n onBlur: (event: React.FocusEvent) => {\n onBlur(event);\n },\n onKeyDown,\n };\n const thisTriggerRef = (elem: null | HTMLElement) => {\n if (elem) {\n elementsByIndexRef.current[index] = elem;\n elementsByIdRef.current[item.id] = elem;\n } else {\n delete elementsByIndexRef.current[index];\n delete elementsByIdRef.current[index];\n }\n };\n return (\n <LegendItemTrigger\n key={index}\n {...handlers}\n ref={thisTriggerRef}\n onClick={(event) => {\n if (event.metaKey || event.ctrlKey) {\n toggleItem(item.id);\n } else {\n selectItem(item.id);\n }\n }}\n isHighlighted={item.highlighted}\n someHighlighted={items.some((item) => item.highlighted)}\n itemId={item.id}\n label={item.name}\n visible={item.visible}\n marker={item.marker}\n />\n );\n })}\n </div>\n </div>\n {tooltipContent && (\n <InternalChartTooltip\n trackRef={tooltipTrack}\n trackKey={tooltipTarget.id}\n container={null}\n dismissButton={false}\n onDismiss={() => {}}\n position={tooltipPosition}\n title={tooltipContent.header}\n onMouseEnter={() => showTooltip(tooltipTarget.id)}\n onMouseLeave={() => hideTooltip()}\n onBlur={() => hideTooltip()}\n footer={\n tooltipContent.footer && (\n <>\n <hr aria-hidden={true} />\n {tooltipContent.footer}\n </>\n )\n }\n >\n {tooltipContent.body}\n </InternalChartTooltip>\n )}\n </div>\n </SingleTabStopNavigationProvider>\n );\n};\n\nconst LegendItemTrigger = forwardRef(\n (\n {\n isHighlighted,\n someHighlighted,\n itemId,\n label,\n marker,\n visible,\n onClick,\n triggerRef,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n onKeyDown,\n }: {\n isHighlighted?: boolean;\n someHighlighted?: boolean;\n itemId: string;\n label: string;\n marker?: React.ReactNode;\n visible: boolean;\n onClick: (event: React.MouseEvent) => void;\n onMarkerClick?: () => void;\n triggerRef?: Ref<HTMLElement>;\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n onFocus?: () => void;\n onBlur?: (event: React.FocusEvent) => void;\n onKeyDown?: (event: React.KeyboardEvent<HTMLElement>) => void;\n },\n ref: Ref<HTMLButtonElement>,\n ) => {\n const refObject = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs(ref, triggerRef, refObject);\n const { tabIndex } = useSingleTabStopNavigation(refObject);\n return (\n <button\n data-itemid={itemId}\n aria-pressed={visible}\n aria-current={isHighlighted}\n className={clsx(testClasses.item, styles.item, {\n [styles[\"item--inactive\"]]: !visible,\n [testClasses[\"hidden-item\"]]: !visible,\n [styles[\"item--dimmed\"]]: someHighlighted && !isHighlighted,\n [testClasses[\"dimmed-item\"]]: someHighlighted && !isHighlighted,\n })}\n ref={mergedRef}\n tabIndex={tabIndex}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n >\n {marker}\n <span className={styles[\"item-label\"]}>{label}</span>\n </button>\n );\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/chart-legend/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,UAAU,EAAO,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9E,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EAEP,+BAA+B,EAC/B,YAAY,EACZ,0BAA0B,GAC3B,MAAM,+CAA+C,CAAC;AACvD,OAAO,GAAiB,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iEAAiE,CAAC;AAEvG,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,WAAW,MAAM,8BAA8B,CAAC;AAEvD,MAAM,kBAAkB,GAAG,EAAE,CAAC;AAC9B,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,YAAY,GAAG,GAAG,CAAC;AAqBzB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,KAAK,EACL,WAAW,EACX,SAAS,EACT,OAA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,eAAe,IAAI,CAAC,aAAa;YAC3D,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,EAAE,eAAe,IAAI,CAAC,aAAa;SAChE,CAAC,EACF,GAAG,EAAE,SAAS,EACd,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,aAEnB,MAAM,EACP,eAAM,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,YAAG,KAAK,GAAQ,IAC9C,CACV,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { forwardRef, Ref, useEffect, useMemo, useRef, useState } from \"react\";\nimport clsx from \"clsx\";\n\nimport {\n circleIndex,\n handleKey,\n KeyCode,\n SingleTabStopNavigationAPI,\n SingleTabStopNavigationProvider,\n useMergeRefs,\n useSingleTabStopNavigation,\n} from \"@cloudscape-design/component-toolkit/internal\";\nimport Box, { BoxProps } from \"@cloudscape-design/components/box\";\nimport { InternalChartTooltip } from \"@cloudscape-design/components/internal/do-not-use/chart-tooltip\";\n\nimport { DebouncedCall } from \"../../utils/utils\";\nimport { GetLegendTooltipContentProps, LegendItem, LegendTooltipContent } from \"../interfaces\";\n\nimport styles from \"./styles.css.js\";\nimport testClasses from \"./test-classes/styles.css.js\";\n\nconst TOOLTIP_BLUR_DELAY = 50;\nconst HIGHLIGHT_LOST_DELAY = 50;\nconst SCROLL_DELAY = 100;\n\nexport type LegendAlignment = \"horizontal\" | \"vertical\";\nexport type LegendHorizontalAlignment = \"start\" | \"center\" | \"end\";\n\nexport interface ChartLegendProps {\n items: readonly LegendItem[];\n legendTitle?: string;\n ariaLabel?: string;\n className?: string;\n actions?: React.ReactNode;\n someHighlighted: boolean;\n alignment: LegendAlignment;\n horizontalAlignment: LegendHorizontalAlignment;\n onToggleItem: (itemId: string) => void;\n onSelectItem: (itemId: string) => void;\n onItemHighlightEnter: (item: LegendItem) => void;\n onItemHighlightExit: () => void;\n getTooltipContent: (props: GetLegendTooltipContentProps) => null | LegendTooltipContent;\n}\n\nexport const ChartLegend = ({\n items,\n legendTitle,\n ariaLabel,\n actions,\n alignment,\n className,\n someHighlighted,\n onToggleItem,\n onSelectItem,\n onItemHighlightEnter,\n onItemHighlightExit,\n getTooltipContent,\n horizontalAlignment,\n}: ChartLegendProps) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const elementsByIndexRef = useRef<Record<number, HTMLElement>>([]);\n const elementsByIdRef = useRef<Record<string, HTMLElement>>({});\n const tooltipRef = useRef<HTMLElement>(null);\n const highlightControl = useMemo(() => new DebouncedCall(), []);\n const scrollIntoViewControl = useMemo(() => new DebouncedCall(), []);\n const [selectedIndex, setSelectedIndex] = useState<number>(0);\n const [tooltipItemId, setTooltipItemId] = useState<string | null>(null);\n const { showTooltip, hideTooltip } = useMemo(() => {\n const control = new DebouncedCall();\n return {\n showTooltip(itemId: string) {\n control.call(() => setTooltipItemId(itemId));\n },\n hideTooltip(lock = false) {\n control.call(() => setTooltipItemId(null), TOOLTIP_BLUR_DELAY);\n if (lock) {\n control.lock(TOOLTIP_BLUR_DELAY);\n }\n },\n };\n }, []);\n\n useEffect(() => {\n if (!tooltipItemId) {\n return;\n }\n const onDocumentKeyDown = (event: KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n hideTooltip(true);\n elementsByIdRef.current[tooltipItemId]?.focus();\n }\n };\n document.addEventListener(\"keydown\", onDocumentKeyDown, true);\n return () => {\n document.removeEventListener(\"keydown\", onDocumentKeyDown, true);\n };\n }, [items, tooltipItemId, hideTooltip]);\n const isMouseInContainer = useRef<boolean>(false);\n\n // Scrolling to the highlighted legend item.\n useEffect(() => {\n const highlightedIndex = items.findIndex((item) => item.highlighted);\n if (highlightedIndex === -1) {\n return;\n }\n scrollIntoViewControl.call(() => {\n if (isMouseInContainer.current) {\n return;\n }\n const container = containerRef.current;\n const element = elementsByIndexRef.current?.[highlightedIndex];\n if (!container || !element) {\n return;\n }\n const elementRect = element.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n const isVisible = elementRect.top >= containerRect.top && elementRect.bottom <= containerRect.bottom;\n if (!isVisible) {\n const elementCenter = elementRect.top + elementRect.height / 2;\n const containerCenter = containerRect.top + containerRect.height / 2;\n const top = container.scrollTop + (elementCenter - containerCenter);\n container.scrollTo({ top, behavior: \"smooth\" });\n }\n }, SCROLL_DELAY);\n }, [items, scrollIntoViewControl]);\n\n const showHighlight = (itemId: string) => {\n const item = items.find((item) => item.id === itemId);\n if (item?.visible) {\n highlightControl.cancelPrevious();\n onItemHighlightEnter(item);\n }\n };\n const clearHighlight = () => {\n highlightControl.call(onItemHighlightExit, HIGHLIGHT_LOST_DELAY);\n };\n\n const navigationAPI = useRef<SingleTabStopNavigationAPI>(null);\n\n function onFocus(index: number, itemId: string) {\n setSelectedIndex(index);\n navigationAPI.current!.updateFocusTarget();\n showHighlight(itemId);\n showTooltip(itemId);\n }\n\n function onBlur(event: React.FocusEvent) {\n navigationAPI.current!.updateFocusTarget();\n\n // Hide tooltip and clear highlight unless focus moves inside tooltip;\n if (tooltipRef.current && event.relatedTarget && !tooltipRef.current.contains(event.relatedTarget)) {\n clearHighlight();\n hideTooltip();\n }\n }\n\n function focusElement(index: number) {\n elementsByIndexRef.current[index]?.focus();\n }\n\n function onKeyDown(event: React.KeyboardEvent<HTMLElement>) {\n if (\n event.keyCode === KeyCode.right ||\n event.keyCode === KeyCode.left ||\n event.keyCode === KeyCode.up ||\n event.keyCode === KeyCode.down ||\n event.keyCode === KeyCode.home ||\n event.keyCode === KeyCode.end ||\n event.keyCode === KeyCode.escape\n ) {\n // Preventing default fixes an issue in Safari+VO when VO additionally interprets arrow keys as its commands.\n event.preventDefault();\n\n const range = [0, items.length - 1] as [number, number];\n\n handleKey(event, {\n onInlineStart: () => focusElement(circleIndex(selectedIndex - 1, range)),\n onInlineEnd: () => focusElement(circleIndex(selectedIndex + 1, range)),\n onBlockStart: () => focusElement(circleIndex(selectedIndex - 1, range)),\n onBlockEnd: () => focusElement(circleIndex(selectedIndex + 1, range)),\n onHome: () => focusElement(0),\n onEnd: () => focusElement(items.length - 1),\n onEscape: () => onItemHighlightExit(),\n });\n }\n }\n\n function getNextFocusTarget(): null | HTMLElement {\n if (containerRef.current) {\n const buttons: HTMLButtonElement[] = Array.from(containerRef.current.querySelectorAll(`.${styles.item}`));\n return buttons[selectedIndex] ?? null;\n }\n return null;\n }\n\n function onUnregisterActive(\n focusableElement: HTMLElement,\n navigationAPI: React.RefObject<{ getFocusTarget: () => HTMLElement | null }>,\n ) {\n const target = navigationAPI.current?.getFocusTarget();\n\n if (target && target.dataset.itemid !== focusableElement.dataset.itemid) {\n target.focus();\n }\n }\n\n useEffect(() => {\n navigationAPI.current!.updateFocusTarget();\n });\n\n const isVertical = alignment === \"vertical\";\n\n const tooltipTrack = useRef<null | HTMLElement>(null);\n const tooltipTarget = items.find((item) => item.id === tooltipItemId) ?? null;\n tooltipTrack.current = tooltipItemId ? elementsByIdRef.current[tooltipItemId] : null;\n const tooltipContent = tooltipTarget && getTooltipContent({ legendItem: tooltipTarget });\n const tooltipPosition = isVertical ? \"left\" : \"bottom\";\n\n return (\n <SingleTabStopNavigationProvider\n ref={navigationAPI}\n navigationActive={true}\n getNextFocusTarget={() => getNextFocusTarget()}\n onUnregisterActive={(element: HTMLElement) => onUnregisterActive(element, navigationAPI)}\n >\n <div\n role=\"toolbar\"\n aria-label={legendTitle || ariaLabel}\n className={clsx(testClasses.root, styles.root, className)}\n onMouseEnter={() => (isMouseInContainer.current = true)}\n onMouseLeave={() => (isMouseInContainer.current = false)}\n >\n {legendTitle && (\n <Box fontWeight=\"bold\" className={testClasses.title} textAlign={getBoxTextAlignment(horizontalAlignment)}>\n {legendTitle}\n </Box>\n )}\n <div\n // The list element is not focusable. However, the focus lands on it regardless, when testing in Firefox.\n // Setting the tab index to -1 does fix the problem.\n tabIndex={-1}\n ref={containerRef}\n className={clsx(styles.list, {\n [styles[`list-bottom-${horizontalAlignment}`]]: !isVertical,\n [styles[\"list-bottom\"]]: !isVertical,\n [styles[\"list-side\"]]: isVertical,\n })}\n >\n {actions && (\n <>\n <div className={clsx(testClasses.actions, styles.actions, styles[\"actions-bottom\"])}>\n {actions}\n {!isVertical && <div className={styles[\"actions-divider-bottom\"]} />}\n </div>\n {isVertical && <div className={styles[\"actions-divider-side\"]} />}\n </>\n )}\n {items.map((item, index) => {\n const handlers = {\n onMouseEnter: () => {\n showHighlight(item.id);\n showTooltip(item.id);\n },\n onMouseLeave: () => {\n clearHighlight();\n hideTooltip();\n },\n onFocus: () => {\n onFocus(index, item.id);\n },\n onBlur: (event: React.FocusEvent) => {\n onBlur(event);\n },\n onKeyDown,\n };\n const thisTriggerRef = (elem: null | HTMLElement) => {\n if (elem) {\n elementsByIndexRef.current[index] = elem;\n elementsByIdRef.current[item.id] = elem;\n } else {\n delete elementsByIndexRef.current[index];\n delete elementsByIdRef.current[item.id];\n }\n };\n return (\n <LegendItemTrigger\n key={index}\n {...handlers}\n ref={thisTriggerRef}\n onClick={(event) => {\n if (event.metaKey || event.ctrlKey) {\n onToggleItem(item.id);\n } else {\n onSelectItem(item.id);\n }\n }}\n isHighlighted={item.highlighted}\n someHighlighted={someHighlighted}\n itemId={item.id}\n label={item.name}\n visible={item.visible}\n marker={item.marker}\n />\n );\n })}\n </div>\n {tooltipContent && (\n <InternalChartTooltip\n trackRef={tooltipTrack}\n trackKey={tooltipTarget.id}\n container={null}\n dismissButton={false}\n onDismiss={() => {}}\n position={tooltipPosition}\n title={tooltipContent.header}\n onMouseEnter={() => showTooltip(tooltipTarget.id)}\n onMouseLeave={() => hideTooltip()}\n onBlur={() => hideTooltip()}\n footer={\n tooltipContent.footer && (\n <>\n <hr aria-hidden={true} />\n {tooltipContent.footer}\n </>\n )\n }\n >\n {tooltipContent.body}\n </InternalChartTooltip>\n )}\n </div>\n </SingleTabStopNavigationProvider>\n );\n};\n\nfunction getBoxTextAlignment(horizontalAlignment: LegendHorizontalAlignment): BoxProps.TextAlign {\n switch (horizontalAlignment) {\n case \"start\":\n return \"left\";\n case \"center\":\n return \"center\";\n case \"end\":\n return \"right\";\n }\n}\n\nconst LegendItemTrigger = forwardRef(\n (\n {\n isHighlighted,\n someHighlighted,\n itemId,\n label,\n marker,\n visible,\n onClick,\n triggerRef,\n onMouseEnter,\n onMouseLeave,\n onFocus,\n onBlur,\n onKeyDown,\n }: {\n isHighlighted?: boolean;\n someHighlighted?: boolean;\n itemId: string;\n label: string;\n marker?: React.ReactNode;\n visible: boolean;\n onClick: (event: React.MouseEvent) => void;\n onMarkerClick?: () => void;\n triggerRef?: Ref<HTMLElement>;\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n onFocus?: () => void;\n onBlur?: (event: React.FocusEvent) => void;\n onKeyDown?: (event: React.KeyboardEvent<HTMLElement>) => void;\n },\n ref: Ref<HTMLButtonElement>,\n ) => {\n const refObject = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs(ref, triggerRef, refObject);\n const { tabIndex } = useSingleTabStopNavigation(refObject);\n return (\n <button\n data-itemid={itemId}\n aria-pressed={visible}\n aria-current={isHighlighted}\n className={clsx(testClasses.item, styles.item, {\n [styles[\"item--inactive\"]]: !visible,\n [testClasses[\"hidden-item\"]]: !visible,\n [styles[\"item--dimmed\"]]: someHighlighted && !isHighlighted,\n [testClasses[\"dimmed-item\"]]: someHighlighted && !isHighlighted,\n })}\n ref={mergedRef}\n tabIndex={tabIndex}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n >\n {marker}\n <span className={styles[\"item-label\"]}>{label}</span>\n </button>\n );\n },\n);\n"]}
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"focus-outline": "awsui_focus-
|
|
5
|
-
"item": "
|
|
6
|
-
"root": "
|
|
7
|
-
"
|
|
8
|
-
"list": "
|
|
9
|
-
"list-bottom": "awsui_list-
|
|
10
|
-
"list-bottom-
|
|
11
|
-
"list-bottom-
|
|
12
|
-
"list-side": "awsui_list-
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"item-label": "awsui_item-label_1kjc7_oede3_214",
|
|
22
|
-
"actions": "awsui_actions_1kjc7_oede3_224",
|
|
23
|
-
"actions-bottom": "awsui_actions-bottom_1kjc7_oede3_229",
|
|
24
|
-
"actions-side": "awsui_actions-side_1kjc7_oede3_233",
|
|
25
|
-
"actions-divider-bottom": "awsui_actions-divider-bottom_1kjc7_oede3_238",
|
|
26
|
-
"actions-divider-side": "awsui_actions-divider-side_1kjc7_oede3_245"
|
|
4
|
+
"focus-outline": "awsui_focus-outline_1kjc7_1mq3w_15",
|
|
5
|
+
"item": "awsui_item_1kjc7_1mq3w_27",
|
|
6
|
+
"root": "awsui_root_1kjc7_1mq3w_41",
|
|
7
|
+
"list": "awsui_list_1kjc7_1mq3w_85",
|
|
8
|
+
"list-bottom": "awsui_list-bottom_1kjc7_1mq3w_96",
|
|
9
|
+
"list-bottom-start": "awsui_list-bottom-start_1kjc7_1mq3w_100",
|
|
10
|
+
"list-bottom-center": "awsui_list-bottom-center_1kjc7_1mq3w_103",
|
|
11
|
+
"list-bottom-end": "awsui_list-bottom-end_1kjc7_1mq3w_106",
|
|
12
|
+
"list-side": "awsui_list-side_1kjc7_1mq3w_110",
|
|
13
|
+
"item--inactive": "awsui_item--inactive_1kjc7_1mq3w_180",
|
|
14
|
+
"item--dimmed": "awsui_item--dimmed_1kjc7_1mq3w_186",
|
|
15
|
+
"item-label": "awsui_item-label_1kjc7_1mq3w_190",
|
|
16
|
+
"actions": "awsui_actions_1kjc7_1mq3w_200",
|
|
17
|
+
"actions-bottom": "awsui_actions-bottom_1kjc7_1mq3w_205",
|
|
18
|
+
"actions-side": "awsui_actions-side_1kjc7_1mq3w_209",
|
|
19
|
+
"actions-divider-bottom": "awsui_actions-divider-bottom_1kjc7_1mq3w_214",
|
|
20
|
+
"actions-divider-side": "awsui_actions-divider-side_1kjc7_1mq3w_221"
|
|
27
21
|
};
|
|
28
22
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
/* stylelint-disable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
14
14
|
/* stylelint-enable @cloudscape-design/no-motion-outside-of-mixin, selector-combinator-disallowed-list, selector-pseudo-class-no-unknown, selector-class-pattern */
|
|
15
|
-
body[data-awsui-focus-visible=true] .awsui_focus-
|
|
15
|
+
body[data-awsui-focus-visible=true] .awsui_focus-outline_1kjc7_1mq3w_15:not(#\9) {
|
|
16
16
|
stroke: var(--color-border-item-focused-uk47pl, #006ce0);
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -24,21 +24,21 @@ body[data-awsui-focus-visible=true] .awsui_focus-outline_1kjc7_oede3_15:not(#\9)
|
|
|
24
24
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
25
25
|
SPDX-License-Identifier: Apache-2.0
|
|
26
26
|
*/
|
|
27
|
-
.
|
|
27
|
+
.awsui_item_1kjc7_1mq3w_27:not(#\9) {
|
|
28
28
|
transition: opacity 90ms linear;
|
|
29
29
|
}
|
|
30
30
|
@media (prefers-reduced-motion: reduce) {
|
|
31
|
-
.
|
|
31
|
+
.awsui_item_1kjc7_1mq3w_27:not(#\9) {
|
|
32
32
|
animation: none;
|
|
33
33
|
transition: none;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
.awsui-motion-disabled .
|
|
36
|
+
.awsui-motion-disabled .awsui_item_1kjc7_1mq3w_27:not(#\9), .awsui-mode-entering .awsui_item_1kjc7_1mq3w_27:not(#\9) {
|
|
37
37
|
animation: none;
|
|
38
38
|
transition: none;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
.
|
|
41
|
+
.awsui_root_1kjc7_1mq3w_41:not(#\9) {
|
|
42
42
|
border-collapse: separate;
|
|
43
43
|
border-spacing: 0;
|
|
44
44
|
box-sizing: border-box;
|
|
@@ -71,73 +71,49 @@ body[data-awsui-focus-visible=true] .awsui_focus-outline_1kjc7_oede3_15:not(#\9)
|
|
|
71
71
|
font-family: var(--font-family-base-gmnpzl, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
72
72
|
-webkit-font-smoothing: auto;
|
|
73
73
|
-moz-osx-font-smoothing: auto;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
.awsui_root_1kjc7_oede3_41:not(#\9):focus {
|
|
78
|
-
outline: none;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.awsui_root-side_1kjc7_oede3_81:not(#\9) {
|
|
74
|
+
flex: 1;
|
|
75
|
+
min-height: 0;
|
|
82
76
|
display: flex;
|
|
83
77
|
flex-direction: column;
|
|
78
|
+
inline-size: 100%;
|
|
79
|
+
max-block-size: inherit;
|
|
80
|
+
}
|
|
81
|
+
.awsui_root_1kjc7_1mq3w_41:not(#\9):focus {
|
|
82
|
+
outline: none;
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
.
|
|
85
|
+
.awsui_list_1kjc7_1mq3w_85:not(#\9) {
|
|
87
86
|
display: flex;
|
|
87
|
+
overflow-y: auto;
|
|
88
88
|
list-style: none;
|
|
89
89
|
margin-block: 0;
|
|
90
90
|
margin-inline: 0;
|
|
91
91
|
padding-block: var(--space-static-xxxs-yidks1, 2px);
|
|
92
92
|
padding-inline: var(--space-static-xxxs-yidks1, 2px);
|
|
93
|
-
|
|
93
|
+
margin-block-start: var(--space-scaled-xs-xwoogq, 8px);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
.awsui_list-
|
|
96
|
+
.awsui_list-bottom_1kjc7_1mq3w_96:not(#\9) {
|
|
97
97
|
flex-wrap: wrap;
|
|
98
|
-
}
|
|
99
|
-
.awsui_list-bottom_1kjc7_oede3_96.awsui_list-bottom-start_1kjc7_oede3_99:not(#\9) {
|
|
100
|
-
justify-content: start;
|
|
101
|
-
}
|
|
102
|
-
.awsui_list-bottom_1kjc7_oede3_96.awsui_list-bottom-center_1kjc7_oede3_102:not(#\9) {
|
|
103
|
-
justify-content: center;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.awsui_list-side_1kjc7_oede3_106:not(#\9) {
|
|
107
|
-
flex-wrap: nowrap;
|
|
108
|
-
flex-direction: column;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.awsui_legend-bottom_1kjc7_oede3_111:not(#\9) {
|
|
112
|
-
display: flex;
|
|
113
|
-
flex-wrap: wrap;
|
|
114
|
-
flex-direction: row;
|
|
115
|
-
max-inline-size: 100%;
|
|
116
98
|
gap: var(--space-scaled-xxs-pfm1nx, 4px) var(--space-static-m-m6qboo, 16px);
|
|
117
99
|
}
|
|
118
|
-
.
|
|
100
|
+
.awsui_list-bottom_1kjc7_1mq3w_96.awsui_list-bottom-start_1kjc7_1mq3w_100:not(#\9) {
|
|
119
101
|
justify-content: start;
|
|
120
102
|
}
|
|
121
|
-
.
|
|
103
|
+
.awsui_list-bottom_1kjc7_1mq3w_96.awsui_list-bottom-center_1kjc7_1mq3w_103:not(#\9) {
|
|
122
104
|
justify-content: center;
|
|
123
105
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
text-align: start;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.awsui_legend-title-center_1kjc7_oede3_129:not(#\9) {
|
|
130
|
-
text-align: center;
|
|
106
|
+
.awsui_list-bottom_1kjc7_1mq3w_96.awsui_list-bottom-end_1kjc7_1mq3w_106:not(#\9) {
|
|
107
|
+
justify-content: end;
|
|
131
108
|
}
|
|
132
109
|
|
|
133
|
-
.
|
|
134
|
-
|
|
135
|
-
flex-wrap: wrap;
|
|
110
|
+
.awsui_list-side_1kjc7_1mq3w_110:not(#\9) {
|
|
111
|
+
flex-wrap: nowrap;
|
|
136
112
|
flex-direction: column;
|
|
137
113
|
gap: var(--space-scaled-xxs-pfm1nx, 4px) var(--space-static-m-m6qboo, 16px);
|
|
138
114
|
}
|
|
139
115
|
|
|
140
|
-
.
|
|
116
|
+
.awsui_item_1kjc7_1mq3w_27:not(#\9) {
|
|
141
117
|
border-collapse: separate;
|
|
142
118
|
border-spacing: 0;
|
|
143
119
|
box-sizing: border-box;
|
|
@@ -180,16 +156,16 @@ body[data-awsui-focus-visible=true] .awsui_focus-outline_1kjc7_oede3_15:not(#\9)
|
|
|
180
156
|
opacity: 1;
|
|
181
157
|
max-inline-size: 100%;
|
|
182
158
|
}
|
|
183
|
-
.
|
|
159
|
+
.awsui_item_1kjc7_1mq3w_27:not(#\9):focus {
|
|
184
160
|
outline: none;
|
|
185
161
|
}
|
|
186
|
-
body[data-awsui-focus-visible=true] .
|
|
162
|
+
body[data-awsui-focus-visible=true] .awsui_item_1kjc7_1mq3w_27:not(#\9):focus {
|
|
187
163
|
position: relative;
|
|
188
164
|
box-sizing: border-box;
|
|
189
165
|
outline: 2px dotted transparent;
|
|
190
166
|
outline-offset: 1px;
|
|
191
167
|
}
|
|
192
|
-
body[data-awsui-focus-visible=true] .
|
|
168
|
+
body[data-awsui-focus-visible=true] .awsui_item_1kjc7_1mq3w_27:not(#\9):focus::before {
|
|
193
169
|
content: " ";
|
|
194
170
|
display: block;
|
|
195
171
|
position: absolute;
|
|
@@ -201,17 +177,17 @@ body[data-awsui-focus-visible=true] .awsui_item_1kjc7_oede3_27:not(#\9):focus::b
|
|
|
201
177
|
border-radius: var(--border-radius-control-default-focus-ring-1uabki, 4px);
|
|
202
178
|
border: 2px solid var(--color-border-item-focused-uk47pl, #006ce0);
|
|
203
179
|
}
|
|
204
|
-
.
|
|
180
|
+
.awsui_item_1kjc7_1mq3w_27.awsui_item--inactive_1kjc7_1mq3w_180:not(#\9) {
|
|
205
181
|
color: var(--color-text-interactive-default-ugh9wp, #424650);
|
|
206
182
|
text-decoration: line-through;
|
|
207
183
|
text-decoration-thickness: 2px;
|
|
208
184
|
text-decoration-color: var(--color-text-interactive-default-ugh9wp, #424650);
|
|
209
185
|
}
|
|
210
|
-
.
|
|
186
|
+
.awsui_item_1kjc7_1mq3w_27.awsui_item--dimmed_1kjc7_1mq3w_186:not(#\9) {
|
|
211
187
|
opacity: 0.35;
|
|
212
188
|
}
|
|
213
189
|
|
|
214
|
-
.awsui_item-
|
|
190
|
+
.awsui_item-label_1kjc7_1mq3w_190:not(#\9) {
|
|
215
191
|
overflow: hidden;
|
|
216
192
|
white-space: nowrap;
|
|
217
193
|
text-overflow: ellipsis;
|
|
@@ -221,30 +197,33 @@ body[data-awsui-focus-visible=true] .awsui_item_1kjc7_oede3_27:not(#\9):focus::b
|
|
|
221
197
|
-webkit-box-orient: vertical;
|
|
222
198
|
}
|
|
223
199
|
|
|
224
|
-
.
|
|
200
|
+
.awsui_actions_1kjc7_1mq3w_200:not(#\9) {
|
|
225
201
|
display: flex;
|
|
226
202
|
align-items: center;
|
|
227
203
|
}
|
|
228
204
|
|
|
229
|
-
.awsui_actions-
|
|
205
|
+
.awsui_actions-bottom_1kjc7_1mq3w_205:not(#\9) {
|
|
230
206
|
flex-direction: row;
|
|
231
207
|
}
|
|
232
208
|
|
|
233
|
-
.awsui_actions-
|
|
209
|
+
.awsui_actions-side_1kjc7_1mq3w_209:not(#\9) {
|
|
234
210
|
flex-direction: column;
|
|
235
211
|
align-items: flex-start;
|
|
236
212
|
}
|
|
237
213
|
|
|
238
|
-
.awsui_actions-divider-
|
|
214
|
+
.awsui_actions-divider-bottom_1kjc7_1mq3w_214:not(#\9) {
|
|
239
215
|
inline-size: 1px;
|
|
240
216
|
block-size: 80%;
|
|
241
217
|
margin-inline: var(--space-scaled-xs-xwoogq, 8px);
|
|
242
218
|
background: var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
243
219
|
}
|
|
244
220
|
|
|
245
|
-
.awsui_actions-divider-
|
|
246
|
-
|
|
247
|
-
|
|
221
|
+
.awsui_actions-divider-side_1kjc7_1mq3w_221:not(#\9) {
|
|
222
|
+
display: block;
|
|
223
|
+
border: 0;
|
|
224
|
+
padding: 0;
|
|
225
|
+
inline-size: 100%;
|
|
248
226
|
margin-block-end: var(--space-scaled-xs-xwoogq, 8px);
|
|
249
|
-
|
|
227
|
+
margin-top: 7px;
|
|
228
|
+
border-top: 1px solid var(--color-border-divider-default-nr68jt, #c6c6cd);
|
|
250
229
|
}
|
|
@@ -2,28 +2,22 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"focus-outline": "awsui_focus-
|
|
6
|
-
"item": "
|
|
7
|
-
"root": "
|
|
8
|
-
"
|
|
9
|
-
"list": "
|
|
10
|
-
"list-bottom": "awsui_list-
|
|
11
|
-
"list-bottom-
|
|
12
|
-
"list-bottom-
|
|
13
|
-
"list-side": "awsui_list-
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"item-label": "awsui_item-label_1kjc7_oede3_214",
|
|
23
|
-
"actions": "awsui_actions_1kjc7_oede3_224",
|
|
24
|
-
"actions-bottom": "awsui_actions-bottom_1kjc7_oede3_229",
|
|
25
|
-
"actions-side": "awsui_actions-side_1kjc7_oede3_233",
|
|
26
|
-
"actions-divider-bottom": "awsui_actions-divider-bottom_1kjc7_oede3_238",
|
|
27
|
-
"actions-divider-side": "awsui_actions-divider-side_1kjc7_oede3_245"
|
|
5
|
+
"focus-outline": "awsui_focus-outline_1kjc7_1mq3w_15",
|
|
6
|
+
"item": "awsui_item_1kjc7_1mq3w_27",
|
|
7
|
+
"root": "awsui_root_1kjc7_1mq3w_41",
|
|
8
|
+
"list": "awsui_list_1kjc7_1mq3w_85",
|
|
9
|
+
"list-bottom": "awsui_list-bottom_1kjc7_1mq3w_96",
|
|
10
|
+
"list-bottom-start": "awsui_list-bottom-start_1kjc7_1mq3w_100",
|
|
11
|
+
"list-bottom-center": "awsui_list-bottom-center_1kjc7_1mq3w_103",
|
|
12
|
+
"list-bottom-end": "awsui_list-bottom-end_1kjc7_1mq3w_106",
|
|
13
|
+
"list-side": "awsui_list-side_1kjc7_1mq3w_110",
|
|
14
|
+
"item--inactive": "awsui_item--inactive_1kjc7_1mq3w_180",
|
|
15
|
+
"item--dimmed": "awsui_item--dimmed_1kjc7_1mq3w_186",
|
|
16
|
+
"item-label": "awsui_item-label_1kjc7_1mq3w_190",
|
|
17
|
+
"actions": "awsui_actions_1kjc7_1mq3w_200",
|
|
18
|
+
"actions-bottom": "awsui_actions-bottom_1kjc7_1mq3w_205",
|
|
19
|
+
"actions-side": "awsui_actions-side_1kjc7_1mq3w_209",
|
|
20
|
+
"actions-divider-bottom": "awsui_actions-divider-bottom_1kjc7_1mq3w_214",
|
|
21
|
+
"actions-divider-side": "awsui_actions-divider-side_1kjc7_1mq3w_221"
|
|
28
22
|
};
|
|
29
23
|
|
|
@@ -5,6 +5,7 @@ export interface LegendItem {
|
|
|
5
5
|
marker: React.ReactNode;
|
|
6
6
|
visible: boolean;
|
|
7
7
|
highlighted: boolean;
|
|
8
|
+
isSecondary?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export type GetLegendTooltipContent = (props: GetLegendTooltipContentProps) => LegendTooltipContent;
|
|
10
11
|
export interface GetLegendTooltipContentProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/internal/components/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport interface LegendItem {\n id: string;\n name: string;\n marker: React.ReactNode;\n visible: boolean;\n highlighted: boolean;\n}\n\nexport type GetLegendTooltipContent = (props: GetLegendTooltipContentProps) => LegendTooltipContent;\n\nexport interface GetLegendTooltipContentProps {\n legendItem: LegendItem;\n}\n\nexport interface LegendTooltipContent {\n header: React.ReactNode;\n body: React.ReactNode;\n footer?: React.ReactNode;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/internal/components/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nexport interface LegendItem {\n id: string;\n name: string;\n marker: React.ReactNode;\n visible: boolean;\n highlighted: boolean;\n isSecondary?: boolean;\n}\n\nexport type GetLegendTooltipContent = (props: GetLegendTooltipContentProps) => LegendTooltipContent;\n\nexport interface GetLegendTooltipContentProps {\n legendItem: LegendItem;\n}\n\nexport interface LegendTooltipContent {\n header: React.ReactNode;\n body: React.ReactNode;\n footer?: React.ReactNode;\n}\n"]}
|
package/internal/environment.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "chart-components";
|
|
2
|
-
export var PACKAGE_VERSION = "1.0.0 (
|
|
2
|
+
export var PACKAGE_VERSION = "1.0.0 (80443d98)";
|
|
3
3
|
export var THEME = "open-source-visual-refresh";
|
|
4
4
|
export var ALWAYS_VISUAL_REFRESH = true;
|
|
5
5
|
export var SYSTEM = "console";
|
package/internal/manifest.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useDebouncedValue<T>(value: T, duration: number): T | null;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { DebouncedCall } from "./utils";
|
|
5
|
+
export function useDebouncedValue(value, duration) {
|
|
6
|
+
const [debouncedValue, setDebouncedValue] = useState(null);
|
|
7
|
+
const [shouldRender, setShouldRender] = useState(false);
|
|
8
|
+
const debouncedCall = useRef(new DebouncedCall());
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (duration <= 0) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
setShouldRender(false);
|
|
14
|
+
const current = debouncedCall.current;
|
|
15
|
+
current.call(() => {
|
|
16
|
+
setDebouncedValue(value);
|
|
17
|
+
setShouldRender(true);
|
|
18
|
+
}, duration);
|
|
19
|
+
return () => current.cancelPrevious();
|
|
20
|
+
}, [value, duration]);
|
|
21
|
+
if (duration <= 0) {
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
24
|
+
return shouldRender ? debouncedValue : null;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=use-debounced-value.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-debounced-value.js","sourceRoot":"","sources":["../../../../src/internal/utils/use-debounced-value.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,UAAU,iBAAiB,CAAI,KAAQ,EAAE,QAAgB;IAC7D,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAAW,IAAI,CAAC,CAAC;IACrE,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;IAElD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,QAAQ,IAAI,CAAC,EAAE;YACjB,OAAO;SACR;QAED,eAAe,CAAC,KAAK,CAAC,CAAC;QACvB,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC;QACtC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE;YAChB,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,eAAe,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC,EAAE,QAAQ,CAAC,CAAC;QAEb,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;IACxC,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEtB,IAAI,QAAQ,IAAI,CAAC,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IAED,OAAO,YAAY,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useEffect, useRef, useState } from \"react\";\n\nimport { DebouncedCall } from \"./utils\";\n\nexport function useDebouncedValue<T>(value: T, duration: number) {\n const [debouncedValue, setDebouncedValue] = useState<T | null>(null);\n const [shouldRender, setShouldRender] = useState(false);\n const debouncedCall = useRef(new DebouncedCall());\n\n useEffect(() => {\n if (duration <= 0) {\n return;\n }\n\n setShouldRender(false);\n const current = debouncedCall.current;\n current.call(() => {\n setDebouncedValue(value);\n setShouldRender(true);\n }, duration);\n\n return () => current.cancelPrevious();\n }, [value, duration]);\n\n if (duration <= 0) {\n return value;\n }\n\n return shouldRender ? debouncedValue : null;\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { CoreLegendProps } from "../../core/interfaces";
|
|
2
|
-
export declare const CoreLegend: ({ items, title, actions, ariaLabel, alignment, onItemHighlight, onClearHighlight, onVisibleItemsChange, getLegendTooltipContent, horizontalAlignment, }: CoreLegendProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
2
|
+
export declare const CoreLegend: ({ items, title, actions, ariaLabel: legendAriaLabel, alignment, onItemHighlight, onClearHighlight, onVisibleItemsChange, getLegendTooltipContent, horizontalAlignment, }: CoreLegendProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,11 +1,37 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import { useInternalI18n } from "@cloudscape-design/components/internal/do-not-use/i18n";
|
|
2
5
|
import { ChartLegend as ChartLegendComponent } from "../../internal/components/chart-legend";
|
|
3
6
|
import { fireNonCancelableEvent } from "../../internal/events";
|
|
4
|
-
export const CoreLegend = ({ items, title, actions, ariaLabel, alignment = "horizontal", onItemHighlight, onClearHighlight, onVisibleItemsChange, getLegendTooltipContent, horizontalAlignment = "start", }) => {
|
|
5
|
-
const
|
|
7
|
+
export const CoreLegend = ({ items, title, actions, ariaLabel: legendAriaLabel, alignment = "horizontal", onItemHighlight, onClearHighlight, onVisibleItemsChange, getLegendTooltipContent, horizontalAlignment = "start", }) => {
|
|
8
|
+
const i18n = useInternalI18n("[charts]");
|
|
9
|
+
const ariaLabel = i18n("i18nStrings.legendAriaLabel", legendAriaLabel);
|
|
10
|
+
const onToggleItem = (itemId) => {
|
|
11
|
+
const visibleItems = items.filter((i) => i.visible).map((i) => i.id);
|
|
12
|
+
if (visibleItems.includes(itemId)) {
|
|
13
|
+
fireNonCancelableEvent(onVisibleItemsChange, {
|
|
14
|
+
items: visibleItems.filter((visibleItemId) => visibleItemId !== itemId),
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
fireNonCancelableEvent(onVisibleItemsChange, {
|
|
19
|
+
items: [...visibleItems, itemId],
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const onSelectItem = (itemId) => {
|
|
24
|
+
const visibleItems = items.filter((i) => i.visible).map((i) => i.id);
|
|
25
|
+
if (visibleItems.length === 1 && visibleItems[0] === itemId) {
|
|
26
|
+
fireNonCancelableEvent(onVisibleItemsChange, { items: items.map((i) => i.id) });
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
fireNonCancelableEvent(onVisibleItemsChange, { items: [itemId] });
|
|
30
|
+
}
|
|
31
|
+
};
|
|
6
32
|
if (items.length === 0) {
|
|
7
33
|
return null;
|
|
8
34
|
}
|
|
9
|
-
return (_jsx(ChartLegendComponent, { items: items, actions: actions, legendTitle: title,
|
|
35
|
+
return (_jsx(ChartLegendComponent, { items: items, actions: actions, legendTitle: title, alignment: alignment, horizontalAlignment: horizontalAlignment, ariaLabel: ariaLabel, someHighlighted: items.some((item) => item.highlighted), onToggleItem: onToggleItem, onSelectItem: onSelectItem, getTooltipContent: (props) => { var _a; return (_a = getLegendTooltipContent === null || getLegendTooltipContent === void 0 ? void 0 : getLegendTooltipContent(props)) !== null && _a !== void 0 ? _a : null; }, onItemHighlightExit: () => fireNonCancelableEvent(onClearHighlight), onItemHighlightEnter: (item) => fireNonCancelableEvent(onItemHighlight, { item }) }));
|
|
10
36
|
};
|
|
11
37
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal-do-not-use/core-legend/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/internal-do-not-use/core-legend/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AAGzF,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC7F,OAAO,EAAE,s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AI,YAAY,CAAC,CAAC,CAAC,KAAK,MAAM,EAAE;YAC3D,sBAAsB,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;SACjF;aAAM;YACL,sBAAsB,CAAC,oBAAoB,EAAE,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SACnE;IACH,CAAC,CAAC;IAEF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACtB,OAAO,IAAI,CAAC;KACb;IAED,OAAO,CACL,KAAC,oBAAoB,IACnB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,KAAK,EAClB,SAAS,EAAE,SAAS,EACpB,mBAAmB,EAAE,mBAAmB,EACxC,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,EACvD,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,CAAC,KAAK,EAAE,EAAE,WAAC,OAAA,MAAA,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAG,KAAK,CAAC,mCAAI,IAAI,CAAA,EAAA,EACtE,mBAAmB,EAAE,GAAG,EAAE,CAAC,sBAAsB,CAAC,gBAAgB,CAAC,EACnE,oBAAoB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,sBAAsB,CAAC,eAAe,EAAE,EAAE,IAAI,EAAE,CAAC,GACjF,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { useInternalI18n } from \"@cloudscape-design/components/internal/do-not-use/i18n\";\n\nimport { CoreLegendProps } from \"../../core/interfaces\";\nimport { ChartLegend as ChartLegendComponent } from \"../../internal/components/chart-legend\";\nimport { fireNonCancelableEvent } from \"../../internal/events\";\n\nexport const CoreLegend = ({\n items,\n title,\n actions,\n ariaLabel: legendAriaLabel,\n alignment = \"horizontal\",\n onItemHighlight,\n onClearHighlight,\n onVisibleItemsChange,\n getLegendTooltipContent,\n horizontalAlignment = \"start\",\n}: CoreLegendProps) => {\n const i18n = useInternalI18n(\"[charts]\");\n const ariaLabel = i18n(\"i18nStrings.legendAriaLabel\", legendAriaLabel);\n\n const onToggleItem = (itemId: string) => {\n const visibleItems = items.filter((i) => i.visible).map((i) => i.id);\n if (visibleItems.includes(itemId)) {\n fireNonCancelableEvent(onVisibleItemsChange, {\n items: visibleItems.filter((visibleItemId) => visibleItemId !== itemId),\n });\n } else {\n fireNonCancelableEvent(onVisibleItemsChange, {\n items: [...visibleItems, itemId],\n });\n }\n };\n\n const onSelectItem = (itemId: string) => {\n const visibleItems = items.filter((i) => i.visible).map((i) => i.id);\n if (visibleItems.length === 1 && visibleItems[0] === itemId) {\n fireNonCancelableEvent(onVisibleItemsChange, { items: items.map((i) => i.id) });\n } else {\n fireNonCancelableEvent(onVisibleItemsChange, { items: [itemId] });\n }\n };\n\n if (items.length === 0) {\n return null;\n }\n\n return (\n <ChartLegendComponent\n items={items}\n actions={actions}\n legendTitle={title}\n alignment={alignment}\n horizontalAlignment={horizontalAlignment}\n ariaLabel={ariaLabel}\n someHighlighted={items.some((item) => item.highlighted)}\n onToggleItem={onToggleItem}\n onSelectItem={onSelectItem}\n getTooltipContent={(props) => getLegendTooltipContent?.(props) ?? null}\n onItemHighlightExit={() => fireNonCancelableEvent(onClearHighlight)}\n onItemHighlightEnter={(item) => fireNonCancelableEvent(onItemHighlight, { item })}\n />\n );\n};\n"]}
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ export default class CoreChartWrapper extends BaseChartWrapper {
|
|
|
6
6
|
findFooter(): null | ElementWrapper;
|
|
7
7
|
findNavigator(): null | ElementWrapper;
|
|
8
8
|
findLegend(): null | CoreChartLegendWrapper;
|
|
9
|
+
findSecondaryLegend(): null | CoreChartLegendWrapper;
|
|
9
10
|
findVerticalAxisTitle(): null | ElementWrapper;
|
|
10
11
|
findHorizontalAxisTitle(): null | ElementWrapper;
|
|
11
12
|
}
|
|
@@ -17,7 +17,10 @@ class CoreChartWrapper extends base_1.default {
|
|
|
17
17
|
return this.findByClassName(styles_selectors_js_1.default["chart-navigator"]);
|
|
18
18
|
}
|
|
19
19
|
findLegend() {
|
|
20
|
-
return this.findComponent(`.${CoreChartLegendWrapper.rootSelector}`, CoreChartLegendWrapper);
|
|
20
|
+
return this.findComponent(`.${CoreChartLegendWrapper.rootSelector}.${styles_selectors_js_1.default["legend-primary"]}`, CoreChartLegendWrapper);
|
|
21
|
+
}
|
|
22
|
+
findSecondaryLegend() {
|
|
23
|
+
return this.findComponent(`.${CoreChartLegendWrapper.rootSelector}.${styles_selectors_js_1.default["legend-secondary"]}`, CoreChartLegendWrapper);
|
|
21
24
|
}
|
|
22
25
|
findVerticalAxisTitle() {
|
|
23
26
|
var _a;
|