@cloudscape-design/components 3.0.622 → 3.0.623
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/area-chart/chart-container.js +11 -11
- package/area-chart/chart-container.js.map +1 -1
- package/area-chart/internal.d.ts.map +1 -1
- package/area-chart/internal.js +3 -0
- package/area-chart/internal.js.map +1 -1
- package/area-chart/model/compute-chart-props.d.ts +4 -3
- package/area-chart/model/compute-chart-props.d.ts.map +1 -1
- package/area-chart/model/compute-chart-props.js +5 -2
- package/area-chart/model/compute-chart-props.js.map +1 -1
- package/area-chart/model/index.d.ts +1 -1
- package/area-chart/model/index.d.ts.map +1 -1
- package/area-chart/model/index.js.map +1 -1
- package/area-chart/model/use-chart-model.d.ts +2 -1
- package/area-chart/model/use-chart-model.d.ts.map +1 -1
- package/area-chart/model/use-chart-model.js +23 -14
- package/area-chart/model/use-chart-model.js.map +1 -1
- package/container/use-sticky-header.js +1 -1
- package/container/use-sticky-header.js.map +1 -1
- package/internal/components/cartesian-chart/{bottom-labels.d.ts → block-end-labels.d.ts} +5 -5
- package/internal/components/cartesian-chart/block-end-labels.d.ts.map +1 -0
- package/internal/components/cartesian-chart/{bottom-labels.js → block-end-labels.js} +5 -5
- package/internal/components/cartesian-chart/block-end-labels.js.map +1 -0
- package/internal/components/cartesian-chart/{left-labels.d.ts → inline-start-labels.d.ts} +4 -4
- package/internal/components/cartesian-chart/inline-start-labels.d.ts.map +1 -0
- package/internal/components/cartesian-chart/{left-labels.js → inline-start-labels.js} +9 -6
- package/internal/components/cartesian-chart/inline-start-labels.js.map +1 -0
- package/internal/components/cartesian-chart/labels-measure.js +2 -2
- package/internal/components/cartesian-chart/labels-measure.js.map +1 -1
- package/internal/components/cartesian-chart/styles.css.js +27 -27
- package/internal/components/cartesian-chart/styles.scoped.css +31 -31
- package/internal/components/cartesian-chart/styles.selectors.js +27 -27
- package/internal/components/chart-legend/index.d.ts.map +1 -1
- package/internal/components/chart-legend/index.js +7 -10
- package/internal/components/chart-legend/index.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/generated/theming/index.cjs +4 -0
- package/internal/generated/theming/index.cjs.d.ts +16 -0
- package/internal/generated/theming/index.d.ts +16 -0
- package/internal/generated/theming/index.js +4 -0
- package/internal/manifest.json +1 -1
- package/internal/utils/handle-key.d.ts +1 -1
- package/internal/utils/handle-key.d.ts.map +1 -1
- package/internal/utils/handle-key.js +1 -1
- package/internal/utils/handle-key.js.map +1 -1
- package/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
- package/mixed-line-bar-chart/chart-container.js +12 -12
- package/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/package.json +1 -1
- package/internal/components/cartesian-chart/bottom-labels.d.ts.map +0 -1
- package/internal/components/cartesian-chart/bottom-labels.js.map +0 -1
- package/internal/components/cartesian-chart/left-labels.d.ts.map +0 -1
- package/internal/components/cartesian-chart/left-labels.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/chart-legend/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,YAAuC,MAAM,wBAAwB,CAAC;AAC7E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/chart-legend/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,K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BACnC;6BAAM;4BACL,OAAO,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;yBACnC;oBACH,CAAC,EACD,QAAQ,EACN,KAAK,KAAK,sBAAsB,IAAI,CAAC,sBAAsB,KAAK,SAAS,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAEpG,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,EACrC,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,EACrC,WAAW,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC,EAC3C,YAAY,EAAE,gBAAgB;oBAE9B,oBAAC,YAAY,IAAC,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,GAAI;;oBAAE,CAAC,CAAC,KAAK,CACnD,CACP,CAAC;YACJ,CAAC,CAAC,CACE,CACF,CACL,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAI,MAAyC,EAAE,YAAsB;IAC3F,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QAClD,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,KAAK,YAAY,EAAE;YACxC,OAAO,KAAK,CAAC;SACd;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef, memo } from 'react';\n\nimport InternalBox from '../../../box/internal';\nimport { KeyCode } from '../../keycode';\nimport SeriesMarker, { ChartSeriesMarkerType } from '../chart-series-marker';\nimport styles from './styles.css.js';\nimport { useInternalI18n } from '../../../i18n/context';\nimport handleKey from '../../utils/handle-key';\n\nexport interface ChartLegendItem<T> {\n label: string;\n color: string;\n type: ChartSeriesMarkerType;\n datum: T;\n}\n\nexport interface ChartLegendProps<T> {\n series: ReadonlyArray<ChartLegendItem<T>>;\n highlightedSeries: T | null;\n legendTitle?: string;\n ariaLabel?: string;\n plotContainerRef?: React.RefObject<HTMLDivElement>;\n onHighlightChange: (series: T | null) => void;\n}\n\nexport default memo(ChartLegend) as typeof ChartLegend;\n\nfunction ChartLegend<T>({\n series,\n onHighlightChange,\n highlightedSeries,\n legendTitle,\n ariaLabel,\n plotContainerRef,\n}: ChartLegendProps<T>) {\n const i18n = useInternalI18n('[charts]');\n const containerRef = useRef<HTMLDivElement>(null);\n const segmentsRef = useRef<Record<number, HTMLElement>>([]);\n\n const highlightedSeriesIndex = findSeriesIndex(series, highlightedSeries);\n\n const highlightInlineStart = () => {\n const currentIndex = highlightedSeriesIndex ?? 0;\n const nextIndex = currentIndex - 1 >= 0 ? currentIndex - 1 : series.length - 1;\n segmentsRef.current[nextIndex]?.focus();\n };\n\n const highlightInlineEnd = () => {\n const currentIndex = highlightedSeriesIndex ?? 0;\n const nextIndex = currentIndex + 1 < series.length ? currentIndex + 1 : 0;\n segmentsRef.current[nextIndex]?.focus();\n };\n\n const handleKeyPress = (event: React.KeyboardEvent<HTMLElement>) => {\n if (event.keyCode === KeyCode.right || event.keyCode === KeyCode.left) {\n // Preventing default fixes an issue in Safari+VO when VO additionally interprets arrow keys as its commands.\n event.preventDefault();\n\n handleKey(event, {\n onInlineStart: () => highlightInlineStart(),\n onInlineEnd: () => highlightInlineEnd(),\n });\n }\n };\n\n const handleSelection = (index: number) => {\n if (series[index].datum !== highlightedSeries) {\n onHighlightChange(series[index].datum);\n }\n };\n\n const handleBlur = (event: React.FocusEvent<Element>) => {\n // We need to check if the next element to be focused inside the plot container or not\n // so we don't clear the selected legend in case we are still focusing elements ( legend elements )\n // inside the plot container\n if (\n event.relatedTarget === null ||\n (containerRef.current &&\n !containerRef.current.contains(event.relatedTarget) &&\n !plotContainerRef?.current?.contains(event.relatedTarget))\n ) {\n onHighlightChange(null);\n }\n };\n\n const handleMouseOver = (s: T) => {\n if (s !== highlightedSeries) {\n onHighlightChange(s);\n }\n };\n\n const handleMouseLeave = () => {\n onHighlightChange(null);\n };\n\n return (\n <>\n <div\n ref={containerRef}\n role=\"toolbar\"\n aria-label={legendTitle || i18n('i18nStrings.legendAriaLabel', ariaLabel)}\n className={styles.root}\n onKeyDown={handleKeyPress}\n onBlur={handleBlur}\n >\n {legendTitle && (\n <InternalBox fontWeight=\"bold\" className={styles.title}>\n {legendTitle}\n </InternalBox>\n )}\n\n <div className={styles.list}>\n {series.map((s, index) => {\n const someHighlighted = highlightedSeries !== null;\n const isHighlighted = highlightedSeries === s.datum;\n const isDimmed = someHighlighted && !isHighlighted;\n return (\n <div\n role=\"button\"\n key={index}\n aria-pressed={isHighlighted}\n className={clsx(styles.marker, {\n [styles['marker--dimmed']]: isDimmed,\n [styles['marker--highlighted']]: isHighlighted,\n })}\n ref={elem => {\n if (elem) {\n segmentsRef.current[index] = elem;\n } else {\n delete segmentsRef.current[index];\n }\n }}\n tabIndex={\n index === highlightedSeriesIndex || (highlightedSeriesIndex === undefined && index === 0) ? 0 : -1\n }\n onFocus={() => handleSelection(index)}\n onClick={() => handleSelection(index)}\n onMouseOver={() => handleMouseOver(s.datum)}\n onMouseLeave={handleMouseLeave}\n >\n <SeriesMarker color={s.color} type={s.type} /> {s.label}\n </div>\n );\n })}\n </div>\n </div>\n </>\n );\n}\n\nfunction findSeriesIndex<T>(series: ReadonlyArray<ChartLegendItem<T>>, targetSeries: null | T): undefined | number {\n for (let index = 0; index < series.length; index++) {\n if (series[index].datum === targetSeries) {\n return index;\n }\n }\n return undefined;\n}\n"]}
|
package/internal/environment.js
CHANGED
|
@@ -9391,6 +9391,8 @@ module.exports.preset = {
|
|
|
9391
9391
|
"colorTextButtonPrimaryDefault",
|
|
9392
9392
|
"colorTextButtonPrimaryHover",
|
|
9393
9393
|
"colorTextCounter",
|
|
9394
|
+
"colorTextDropdownItemDefault",
|
|
9395
|
+
"colorTextDropdownItemDisabled",
|
|
9394
9396
|
"colorTextDropdownItemFilterMatch",
|
|
9395
9397
|
"colorTextDropdownItemHighlighted",
|
|
9396
9398
|
"colorTextEmpty",
|
|
@@ -9700,6 +9702,8 @@ module.exports.preset = {
|
|
|
9700
9702
|
"colorTextButtonPrimaryDefault",
|
|
9701
9703
|
"colorTextButtonPrimaryHover",
|
|
9702
9704
|
"colorTextCounter",
|
|
9705
|
+
"colorTextDropdownItemDefault",
|
|
9706
|
+
"colorTextDropdownItemDisabled",
|
|
9703
9707
|
"colorTextDropdownItemFilterMatch",
|
|
9704
9708
|
"colorTextDropdownItemHighlighted",
|
|
9705
9709
|
"colorTextEmpty",
|
|
@@ -145,6 +145,8 @@ export declare interface TypedOverride {
|
|
|
145
145
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
146
146
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
147
147
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
148
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
149
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
148
150
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
149
151
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
150
152
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -366,6 +368,8 @@ export declare interface TypedOverride {
|
|
|
366
368
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
367
369
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
368
370
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
371
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
372
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
369
373
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
370
374
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
371
375
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -587,6 +591,8 @@ export declare interface TypedOverride {
|
|
|
587
591
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
588
592
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
589
593
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
594
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
595
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
590
596
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
591
597
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
592
598
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -808,6 +814,8 @@ export declare interface TypedOverride {
|
|
|
808
814
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
809
815
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
810
816
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
817
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
818
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
811
819
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
812
820
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
813
821
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -1029,6 +1037,8 @@ export declare interface TypedOverride {
|
|
|
1029
1037
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1030
1038
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1031
1039
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1040
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1041
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1032
1042
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1033
1043
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1034
1044
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -1250,6 +1260,8 @@ export declare interface TypedOverride {
|
|
|
1250
1260
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1251
1261
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1252
1262
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1263
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1264
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1253
1265
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1254
1266
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1255
1267
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -1471,6 +1483,8 @@ export declare interface TypedOverride {
|
|
|
1471
1483
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1472
1484
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1473
1485
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1486
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1487
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1474
1488
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1475
1489
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1476
1490
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -1692,6 +1706,8 @@ export declare interface TypedOverride {
|
|
|
1692
1706
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1693
1707
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1694
1708
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1709
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1710
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1695
1711
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1696
1712
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1697
1713
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -145,6 +145,8 @@ export declare interface TypedOverride {
|
|
|
145
145
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
146
146
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
147
147
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
148
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
149
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
148
150
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
149
151
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
150
152
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -366,6 +368,8 @@ export declare interface TypedOverride {
|
|
|
366
368
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
367
369
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
368
370
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
371
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
372
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
369
373
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
370
374
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
371
375
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -587,6 +591,8 @@ export declare interface TypedOverride {
|
|
|
587
591
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
588
592
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
589
593
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
594
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
595
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
590
596
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
591
597
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
592
598
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -808,6 +814,8 @@ export declare interface TypedOverride {
|
|
|
808
814
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
809
815
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
810
816
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
817
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
818
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
811
819
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
812
820
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
813
821
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -1029,6 +1037,8 @@ export declare interface TypedOverride {
|
|
|
1029
1037
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1030
1038
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1031
1039
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1040
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1041
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1032
1042
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1033
1043
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1034
1044
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -1250,6 +1260,8 @@ export declare interface TypedOverride {
|
|
|
1250
1260
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1251
1261
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1252
1262
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1263
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1264
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1253
1265
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1254
1266
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1255
1267
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -1471,6 +1483,8 @@ export declare interface TypedOverride {
|
|
|
1471
1483
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1472
1484
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1473
1485
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1486
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1487
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1474
1488
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1475
1489
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1476
1490
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -1692,6 +1706,8 @@ export declare interface TypedOverride {
|
|
|
1692
1706
|
colorTextButtonPrimaryDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1693
1707
|
colorTextButtonPrimaryHover?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1694
1708
|
colorTextCounter?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1709
|
+
colorTextDropdownItemDefault?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1710
|
+
colorTextDropdownItemDisabled?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1695
1711
|
colorTextDropdownItemFilterMatch?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1696
1712
|
colorTextDropdownItemHighlighted?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
1697
1713
|
colorTextEmpty?: GlobalValue | TypedModeValueOverride<'light' | 'dark'>;
|
|
@@ -9391,6 +9391,8 @@ export var preset = {
|
|
|
9391
9391
|
"colorTextButtonPrimaryDefault",
|
|
9392
9392
|
"colorTextButtonPrimaryHover",
|
|
9393
9393
|
"colorTextCounter",
|
|
9394
|
+
"colorTextDropdownItemDefault",
|
|
9395
|
+
"colorTextDropdownItemDisabled",
|
|
9394
9396
|
"colorTextDropdownItemFilterMatch",
|
|
9395
9397
|
"colorTextDropdownItemHighlighted",
|
|
9396
9398
|
"colorTextEmpty",
|
|
@@ -9700,6 +9702,8 @@ export var preset = {
|
|
|
9700
9702
|
"colorTextButtonPrimaryDefault",
|
|
9701
9703
|
"colorTextButtonPrimaryHover",
|
|
9702
9704
|
"colorTextCounter",
|
|
9705
|
+
"colorTextDropdownItemDefault",
|
|
9706
|
+
"colorTextDropdownItemDisabled",
|
|
9703
9707
|
"colorTextDropdownItemFilterMatch",
|
|
9704
9708
|
"colorTextDropdownItemHighlighted",
|
|
9705
9709
|
"colorTextEmpty",
|
package/internal/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare function isEventLike(event: any): event is EventLike;
|
|
2
2
|
export interface EventLike {
|
|
3
3
|
keyCode: number;
|
|
4
|
-
currentTarget: HTMLElement;
|
|
4
|
+
currentTarget: HTMLElement | SVGElement;
|
|
5
5
|
}
|
|
6
6
|
export default function handleKey(event: EventLike, { onActivate, onBlockEnd, onBlockStart, onDefault, onEnd, onEscape, onHome, onInlineEnd, onInlineStart, onPageDown, onPageUp, }: {
|
|
7
7
|
onActivate?: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-key.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/handle-key.ts"],"names":[],"mappings":"AAKA,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAE1D;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"handle-key.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/handle-key.ts"],"names":[],"mappings":"AAKA,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,SAAS,CAE1D;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,WAAW,GAAG,UAAU,CAAC;CACzC;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,KAAK,EAAE,SAAS,EAChB,EACE,UAAU,EACV,UAAU,EACV,YAAY,EACZ,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,aAAa,EACb,UAAU,EACV,QAAQ,GACT,EAAE;IACD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,QAsCF"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { KeyCode } from '../keycode';
|
|
4
4
|
import { getIsRtl } from '../direction';
|
|
5
5
|
export function isEventLike(event) {
|
|
6
|
-
return event.currentTarget instanceof HTMLElement;
|
|
6
|
+
return event.currentTarget instanceof HTMLElement || event.currentTarget instanceof SVGElement;
|
|
7
7
|
}
|
|
8
8
|
export default function handleKey(event, { onActivate, onBlockEnd, onBlockStart, onDefault, onEnd, onEscape, onHome, onInlineEnd, onInlineStart, onPageDown, onPageUp, }) {
|
|
9
9
|
switch (event.keyCode) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handle-key.js","sourceRoot":"","sources":["../../../../src/internal/utils/handle-key.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,UAAU,WAAW,CAAC,KAAU;IACpC,OAAO,KAAK,CAAC,aAAa,YAAY,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"handle-key.js","sourceRoot":"","sources":["../../../../src/internal/utils/handle-key.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,UAAU,WAAW,CAAC,KAAU;IACpC,OAAO,KAAK,CAAC,aAAa,YAAY,WAAW,IAAI,KAAK,CAAC,aAAa,YAAY,UAAU,CAAC;AACjG,CAAC;AAOD,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,KAAgB,EAChB,EACE,UAAU,EACV,UAAU,EACV,YAAY,EACZ,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,WAAW,EACX,aAAa,EACb,UAAU,EACV,QAAQ,GAaT;IAED,QAAQ,KAAK,CAAC,OAAO,EAAE;QACrB,KAAK,OAAO,CAAC,IAAI;YACf,UAAU,aAAV,UAAU,uBAAV,UAAU,EAAI,CAAC;YACf,MAAM;QACR,KAAK,OAAO,CAAC,GAAG;YACd,KAAK,aAAL,KAAK,uBAAL,KAAK,EAAI,CAAC;YACV,MAAM;QACR,KAAK,OAAO,CAAC,KAAK,CAAC;QACnB,KAAK,OAAO,CAAC,KAAK;YAChB,UAAU,aAAV,UAAU,uBAAV,UAAU,EAAI,CAAC;YACf,MAAM;QACR,KAAK,OAAO,CAAC,MAAM;YACjB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,EAAI,CAAC;YACb,MAAM;QACR,KAAK,OAAO,CAAC,IAAI;YACf,MAAM,aAAN,MAAM,uBAAN,MAAM,EAAI,CAAC;YACX,MAAM;QACR,KAAK,OAAO,CAAC,IAAI;YACf,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,EAAI,CAAC,CAAC,CAAC,aAAa,aAAb,aAAa,uBAAb,aAAa,EAAI,CAAC;YACpE,MAAM;QACR,KAAK,OAAO,CAAC,QAAQ;YACnB,UAAU,aAAV,UAAU,uBAAV,UAAU,EAAI,CAAC;YACf,MAAM;QACR,KAAK,OAAO,CAAC,MAAM;YACjB,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,EAAI,CAAC;YACb,MAAM;QACR,KAAK,OAAO,CAAC,KAAK;YAChB,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,aAAb,aAAa,uBAAb,aAAa,EAAI,CAAC,CAAC,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,EAAI,CAAC;YACpE,MAAM;QACR,KAAK,OAAO,CAAC,EAAE;YACb,YAAY,aAAZ,YAAY,uBAAZ,YAAY,EAAI,CAAC;YACjB,MAAM;QACR;YACE,SAAS,aAAT,SAAS,uBAAT,SAAS,EAAI,CAAC;YACd,MAAM;KACT;AACH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { KeyCode } from '../keycode';\nimport { getIsRtl } from '../direction';\n\nexport function isEventLike(event: any): event is EventLike {\n return event.currentTarget instanceof HTMLElement || event.currentTarget instanceof SVGElement;\n}\n\nexport interface EventLike {\n keyCode: number;\n currentTarget: HTMLElement | SVGElement;\n}\n\nexport default function handleKey(\n event: EventLike,\n {\n onActivate,\n onBlockEnd,\n onBlockStart,\n onDefault,\n onEnd,\n onEscape,\n onHome,\n onInlineEnd,\n onInlineStart,\n onPageDown,\n onPageUp,\n }: {\n onActivate?: () => void;\n onBlockEnd?: () => void;\n onBlockStart?: () => void;\n onDefault?: () => void;\n onEnd?: () => void;\n onEscape?: () => void;\n onHome?: () => void;\n onInlineEnd?: () => void;\n onInlineStart?: () => void;\n onPageDown?: () => void;\n onPageUp?: () => void;\n }\n) {\n switch (event.keyCode) {\n case KeyCode.down:\n onBlockEnd?.();\n break;\n case KeyCode.end:\n onEnd?.();\n break;\n case KeyCode.enter:\n case KeyCode.space:\n onActivate?.();\n break;\n case KeyCode.escape:\n onEscape?.();\n break;\n case KeyCode.home:\n onHome?.();\n break;\n case KeyCode.left:\n getIsRtl(event.currentTarget) ? onInlineEnd?.() : onInlineStart?.();\n break;\n case KeyCode.pageDown:\n onPageDown?.();\n break;\n case KeyCode.pageUp:\n onPageUp?.();\n break;\n case KeyCode.right:\n getIsRtl(event.currentTarget) ? onInlineStart?.() : onInlineEnd?.();\n break;\n case KeyCode.up:\n onBlockStart?.();\n break;\n default:\n onDefault?.();\n break;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-container.d.ts","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/chart-container.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,SAAS,EAAmB,MAAM,cAAc,CAAC;AAGvH,OAAyB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AASrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAYxF,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,cAAc;IAC3D,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IAErD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,sBAAsB,CAAC,CAAC,CAAC,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,CAAC,CAAC;IAC5D,eAAe,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;IAC9D,WAAW,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;IAEtD,0BAA0B,CAAC,EAAE,sBAAsB,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;CACnF;AAuBD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,SAAS,cAAc,EAAE,EAC/D,SAAS,EACT,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,iBAA4B,EAC5B,WAAmB,EACnB,cAAsB,EACtB,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,MAAM,EACN,MAAM,EACN,SAAS,EACT,cAAc,EACd,eAAe,EACf,WAAgB,EAChB,0BAA0B,EAC1B,GAAG,KAAK,EACT,EAAE,mBAAmB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"chart-container.d.ts","sourceRoot":"","sources":["../../../src/mixed-line-bar-chart/chart-container.tsx"],"names":[],"mappings":";AAkBA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,SAAS,EAAmB,MAAM,cAAc,CAAC;AAGvH,OAAyB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AASrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAYxF,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,cAAc;IAC3D,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;IAErD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB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,CAAC,CAAC;IAClD,cAAc,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC5D,eAAe,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC;IAC9D,WAAW,EAAE,sBAAsB,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;IAEtD,0BAA0B,CAAC,EAAE,sBAAsB,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC;CACnF;AAuBD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,CAAC,SAAS,cAAc,EAAE,EAC/D,SAAS,EACT,MAAM,EAAE,kBAAkB,EAC1B,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,iBAA4B,EAC5B,WAAmB,EACnB,cAAsB,EACtB,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,MAAM,EACN,MAAM,EACN,SAAS,EACT,cAAc,EACd,eAAe,EACf,WAAgB,EAChB,0BAA0B,EAC1B,GAAG,KAAK,EACT,EAAE,mBAAmB,CAAC,CAAC,CAAC,eAygBxB"}
|
|
@@ -7,8 +7,8 @@ import { getXTickCount, getYTickCount, createXTicks, createYTicks } from '../int
|
|
|
7
7
|
import ChartPlot from '../internal/components/chart-plot';
|
|
8
8
|
import AxisLabel from '../internal/components/cartesian-chart/axis-label';
|
|
9
9
|
import LabelsMeasure from '../internal/components/cartesian-chart/labels-measure';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import InlineStartLabels from '../internal/components/cartesian-chart/inline-start-labels';
|
|
11
|
+
import BlockEndLabels, { useBLockEndLabels } from '../internal/components/cartesian-chart/block-end-labels';
|
|
12
12
|
import VerticalGridLines from '../internal/components/cartesian-chart/vertical-grid-lines';
|
|
13
13
|
import EmphasizedBaseline from '../internal/components/cartesian-chart/emphasized-baseline';
|
|
14
14
|
import HighlightedPoint from '../internal/components/cartesian-chart/highlighted-point';
|
|
@@ -30,22 +30,22 @@ import { useMergeRefs } from '../internal/hooks/use-merge-refs';
|
|
|
30
30
|
import { nodeBelongs } from '../internal/utils/node-belongs';
|
|
31
31
|
import { CartesianChartContainer } from '../internal/components/cartesian-chart/chart-container';
|
|
32
32
|
import { useHeightMeasure } from '../internal/hooks/container-queries/use-height-measure';
|
|
33
|
-
const
|
|
34
|
-
const
|
|
33
|
+
const INLINE_START_LABELS_MARGIN = 16;
|
|
34
|
+
const BLOCK_END_LABELS_OFFSET = 12;
|
|
35
35
|
const fallbackContainerWidth = 500;
|
|
36
36
|
export default function ChartContainer(_a) {
|
|
37
37
|
var _b, _c;
|
|
38
38
|
var { fitHeight, height: explicitPlotHeight, series, visibleSeries, highlightedSeries, onHighlightChange, highlightedPoint, setHighlightedPoint, highlightedGroupIndex, setHighlightedGroupIndex, detailPopoverFooter, detailPopoverSize = 'medium', stackedBars = false, horizontalBars = false, xScaleType, yScaleType, xTickFormatter, yTickFormatter, emphasizeBaselineAxis, xTitle, yTitle, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings = {}, detailPopoverSeriesContent } = _a, props = __rest(_a, ["fitHeight", "height", "series", "visibleSeries", "highlightedSeries", "onHighlightChange", "highlightedPoint", "setHighlightedPoint", "highlightedGroupIndex", "setHighlightedGroupIndex", "detailPopoverFooter", "detailPopoverSize", "stackedBars", "horizontalBars", "xScaleType", "yScaleType", "xTickFormatter", "yTickFormatter", "emphasizeBaselineAxis", "xTitle", "yTitle", "ariaLabel", "ariaLabelledby", "ariaDescription", "i18nStrings", "detailPopoverSeriesContent"]);
|
|
39
39
|
const plotRef = useRef(null);
|
|
40
40
|
const verticalMarkerRef = useRef(null);
|
|
41
|
-
const [
|
|
41
|
+
const [inlineStartLabelsWidth, setInlineStartLabelsWidth] = useState(0);
|
|
42
42
|
const [verticalMarkerX, setVerticalMarkerX] = useState(null);
|
|
43
43
|
const [detailsPopoverText, setDetailsPopoverText] = useState('');
|
|
44
44
|
const [containerWidth, containerMeasureRef] = useContainerWidth(fallbackContainerWidth);
|
|
45
|
-
const
|
|
45
|
+
const maxInlineStartLabelsWidth = Math.round(containerWidth / 2);
|
|
46
46
|
const plotWidth = containerWidth
|
|
47
|
-
? // Calculate the minimum between
|
|
48
|
-
Math.max(0, containerWidth - Math.min(
|
|
47
|
+
? // Calculate the minimum between inlineStartLabelsWidth and maxInlineStartLabelsWidth for extra safety because inlineStarteLabelsWidth could be out of date
|
|
48
|
+
Math.max(0, containerWidth - Math.min(inlineStartLabelsWidth, maxInlineStartLabelsWidth) - INLINE_START_LABELS_MARGIN)
|
|
49
49
|
: fallbackContainerWidth;
|
|
50
50
|
const containerRefObject = useRef(null);
|
|
51
51
|
const containerRef = useMergeRefs(containerMeasureRef, containerRefObject);
|
|
@@ -84,7 +84,7 @@ export default function ChartContainer(_a) {
|
|
|
84
84
|
const bottomAxisProps = !horizontalBars
|
|
85
85
|
? getXAxisProps(plotWidth, [0, plotWidth])
|
|
86
86
|
: getYAxisProps(plotWidth, [0, plotWidth]);
|
|
87
|
-
const
|
|
87
|
+
const blockEndLabelsProps = useBLockEndLabels(Object.assign({}, bottomAxisProps));
|
|
88
88
|
const plotMeasureRef = useRef(null);
|
|
89
89
|
const measuredHeight = useHeightMeasure(() => plotMeasureRef.current, !fitHeight);
|
|
90
90
|
const plotHeight = fitHeight ? measuredHeight !== null && measuredHeight !== void 0 ? measuredHeight : 0 : explicitPlotHeight;
|
|
@@ -332,9 +332,9 @@ export default function ChartContainer(_a) {
|
|
|
332
332
|
const activeLiveRegion = activeAriaLabel && !highlightedPoint && highlightedGroupIndex === null ? activeAriaLabel : '';
|
|
333
333
|
const isLineXKeyboardFocused = !highlightedPoint && verticalMarkerX;
|
|
334
334
|
const isRefresh = useVisualRefresh();
|
|
335
|
-
return (React.createElement(CartesianChartContainer, { ref: containerRef, minHeight: explicitPlotHeight +
|
|
335
|
+
return (React.createElement(CartesianChartContainer, { ref: containerRef, minHeight: explicitPlotHeight + blockEndLabelsProps.height, fitHeight: !!fitHeight, leftAxisLabel: React.createElement(AxisLabel, { axis: y, position: "left", title: leftAxisProps.title }), leftAxisLabelMeasure: React.createElement(LabelsMeasure, { ticks: leftAxisProps.ticks, scale: leftAxisProps.scale, tickFormatter: leftAxisProps.tickFormatter, autoWidth: setInlineStartLabelsWidth, maxLabelsWidth: maxInlineStartLabelsWidth }), bottomAxisLabel: React.createElement(AxisLabel, { axis: x, position: "bottom", title: bottomAxisProps.title }), chartPlot: React.createElement(ChartPlot, { ref: plotRef, width: "100%", height: fitHeight ? `calc(100% - ${blockEndLabelsProps.height}px)` : plotHeight, offsetBottom: blockEndLabelsProps.height, isClickable: isPopoverOpen && !isPopoverPinned, ariaLabel: ariaLabel, ariaLabelledby: ariaLabelledby, ariaDescription: ariaDescription, ariaRoleDescription: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.chartAriaRoleDescription, ariaLiveRegion: activeLiveRegion, activeElementRef: highlightedElementRef, activeElementKey: (_c = highlightedGroupIndex === null || highlightedGroupIndex === void 0 ? void 0 : highlightedGroupIndex.toString()) !== null && _c !== void 0 ? _c : (isLineXKeyboardFocused ? `point-index-${handlers.xIndex}` : point === null || point === void 0 ? void 0 : point.key), activeElementFocusOffset: isGroupNavigation ? 0 : isLineXKeyboardFocused ? { x: 8, y: 0 } : 3, onMouseMove: onSVGMouseMove, onMouseOut: onSVGMouseOut, onClick: onSVGClick, onApplicationFocus: onApplicationFocus, onApplicationBlur: onApplicationBlur, onKeyDown: onSVGKeyDown },
|
|
336
336
|
React.createElement("line", { ref: plotMeasureRef, x1: "0", x2: "0", y1: "0", y2: "100%", stroke: "transparent", strokeWidth: 1, style: { pointerEvents: 'none' } }),
|
|
337
|
-
React.createElement(
|
|
337
|
+
React.createElement(InlineStartLabels, { axis: y, ticks: leftAxisProps.ticks, scale: leftAxisProps.scale, tickFormatter: leftAxisProps.tickFormatter, title: leftAxisProps.title, ariaRoleDescription: leftAxisProps.ariaRoleDescription, maxLabelsWidth: maxInlineStartLabelsWidth, plotWidth: plotWidth, plotHeight: plotHeight }),
|
|
338
338
|
horizontalBars && (React.createElement(VerticalGridLines, { scale: yAxisProps.scale, ticks: yAxisProps.ticks, height: plotHeight })),
|
|
339
339
|
emphasizeBaselineAxis && linesOnly && (React.createElement(EmphasizedBaseline, { axis: x, scale: yAxisProps.scale, width: plotWidth, height: plotHeight })),
|
|
340
340
|
React.createElement(DataSeries, { axis: x, plotWidth: plotWidth, plotHeight: plotHeight, highlightedSeries: highlightedSeries !== null && highlightedSeries !== void 0 ? highlightedSeries : null, highlightedGroupIndex: highlightedGroupIndex, stackedBars: stackedBars, isGroupNavigation: isGroupNavigation, visibleSeries: visibleSeries, xScale: xAxisProps.scale, yScale: yAxisProps.scale }),
|
|
@@ -342,6 +342,6 @@ export default function ChartContainer(_a) {
|
|
|
342
342
|
React.createElement(VerticalMarker, { key: verticalLineX || '', height: plotHeight, showPoints: highlightedPoint === null, showLine: !isGroupNavigation, points: verticalMarkers, ref: verticalMarkerRef }),
|
|
343
343
|
highlightedPoint && (React.createElement(HighlightedPoint, { ref: highlightedPointRef, point: point, role: "button", ariaLabel: activeAriaLabel, ariaHasPopup: true, ariaExpanded: isPopoverPinned })),
|
|
344
344
|
isGroupNavigation && xAxisProps.scale.isCategorical() && (React.createElement(BarGroups, { ariaLabel: activeAriaLabel, isRefresh: isRefresh, isPopoverPinned: isPopoverPinned, barGroups: barGroups, highlightedGroupIndex: highlightedGroupIndex, highlightedGroupRef: highlightedGroupRef })),
|
|
345
|
-
React.createElement(
|
|
345
|
+
React.createElement(BlockEndLabels, Object.assign({}, blockEndLabelsProps, { axis: x, scale: bottomAxisProps.scale, title: bottomAxisProps.title, ariaRoleDescription: bottomAxisProps.ariaRoleDescription, height: plotHeight, width: plotWidth, offsetLeft: inlineStartLabelsWidth + BLOCK_END_LABELS_OFFSET, offsetRight: BLOCK_END_LABELS_OFFSET }))), popover: React.createElement(MixedChartPopover, { ref: popoverRef, containerRef: containerRefObject, trackRef: highlightedElementRef, isOpen: isPopoverOpen, isPinned: isPopoverPinned, highlightDetails: highlightDetails, onDismiss: onPopoverDismiss, size: detailPopoverSize, footer: detailPopoverFooterContent, dismissAriaLabel: i18nStrings.detailPopoverDismissAriaLabel, onMouseLeave: onPopoverLeave, onBlur: onApplicationBlur, setPopoverText: setDetailsPopoverText }) }));
|
|
346
346
|
}
|
|
347
347
|
//# sourceMappingURL=chart-container.js.map
|