@cloudscape-design/components 3.0.707 → 3.0.709
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.d.ts +2 -1
- package/area-chart/chart-container.d.ts.map +1 -1
- package/area-chart/chart-container.js +2 -2
- package/area-chart/chart-container.js.map +1 -1
- package/area-chart/internal.d.ts.map +1 -1
- package/area-chart/internal.js +1 -1
- package/area-chart/internal.js.map +1 -1
- package/container/interfaces.d.ts +9 -0
- package/container/interfaces.d.ts.map +1 -1
- package/container/interfaces.js.map +1 -1
- package/expandable-section/interfaces.d.ts +9 -0
- package/expandable-section/interfaces.d.ts.map +1 -1
- package/expandable-section/interfaces.js.map +1 -1
- package/form/interfaces.d.ts +14 -0
- package/form/interfaces.d.ts.map +1 -1
- package/form/interfaces.js.map +1 -1
- package/help-panel/implementation.d.ts.map +1 -1
- package/help-panel/implementation.js +2 -3
- package/help-panel/implementation.js.map +1 -1
- package/internal/analytics/hooks/use-funnel.d.ts +1 -1
- package/internal/analytics/interfaces.d.ts +16 -15
- package/internal/analytics/interfaces.d.ts.map +1 -1
- package/internal/analytics/interfaces.js.map +1 -1
- package/internal/base-component/index.d.ts +10 -1
- package/internal/base-component/index.d.ts.map +1 -1
- package/internal/base-component/index.js +5 -1
- package/internal/base-component/index.js.map +1 -1
- package/internal/components/cartesian-chart/block-end-labels.d.ts +2 -1
- package/internal/components/cartesian-chart/block-end-labels.d.ts.map +1 -1
- package/internal/components/cartesian-chart/block-end-labels.js +5 -3
- package/internal/components/cartesian-chart/block-end-labels.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/dom.d.ts +3 -0
- package/internal/utils/dom.d.ts.map +1 -1
- package/internal/utils/dom.js +30 -1
- package/internal/utils/dom.js.map +1 -1
- package/internal/utils/handle-key.d.ts.map +1 -1
- package/internal/utils/handle-key.js +2 -1
- package/internal/utils/handle-key.js.map +1 -1
- package/internal/utils/node-belongs.js +4 -4
- package/internal/utils/node-belongs.js.map +1 -1
- package/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
- package/mixed-line-bar-chart/chart-container.js +1 -1
- package/mixed-line-bar-chart/chart-container.js.map +1 -1
- package/package.json +1 -1
- package/table/interfaces.d.ts +9 -0
- package/table/interfaces.d.ts.map +1 -1
- package/table/interfaces.js.map +1 -1
- package/wizard/interfaces.d.ts +20 -0
- package/wizard/interfaces.d.ts.map +1 -1
- package/wizard/interfaces.js.map +1 -1
|
@@ -6,8 +6,9 @@ interface ChartContainerProps<T extends AreaChartProps.DataTypes> extends Pick<A
|
|
|
6
6
|
autoWidth: (value: number) => void;
|
|
7
7
|
fitHeight?: boolean;
|
|
8
8
|
minHeight: number;
|
|
9
|
+
isRTL?: boolean;
|
|
9
10
|
}
|
|
10
11
|
declare const _default: typeof ChartContainer;
|
|
11
12
|
export default _default;
|
|
12
|
-
declare function ChartContainer<T extends AreaChartProps.DataTypes>({ model, autoWidth, xTitle, yTitle, detailPopoverSize, detailPopoverFooter, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings: { xTickFormatter: deprecatedXTickFormatter, yTickFormatter: deprecatedYTickFormatter, detailTotalFormatter: deprecatedDetailTotalFormatter, detailTotalLabel, chartAriaRoleDescription, xAxisAriaRoleDescription, yAxisAriaRoleDescription, detailPopoverDismissAriaLabel, }, fitHeight, minHeight, xTickFormatter, yTickFormatter, detailTotalFormatter, }: ChartContainerProps<T>): JSX.Element;
|
|
13
|
+
declare function ChartContainer<T extends AreaChartProps.DataTypes>({ model, autoWidth, xTitle, yTitle, detailPopoverSize, detailPopoverFooter, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings: { xTickFormatter: deprecatedXTickFormatter, yTickFormatter: deprecatedYTickFormatter, detailTotalFormatter: deprecatedDetailTotalFormatter, detailTotalLabel, chartAriaRoleDescription, xAxisAriaRoleDescription, yAxisAriaRoleDescription, detailPopoverDismissAriaLabel, }, fitHeight, minHeight, xTickFormatter, yTickFormatter, detailTotalFormatter, isRTL, }: ChartContainerProps<T>): JSX.Element;
|
|
13
14
|
//# sourceMappingURL=chart-container.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-container.d.ts","sourceRoot":"","sources":["../../../src/area-chart/chart-container.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAQrC,UAAU,mBAAmB,CAAC,CAAC,SAAS,cAAc,CAAC,SAAS,CAC9D,SAAQ,IAAI,CACV,cAAc,CAAC,CAAC,CAAC,EACf,QAAQ,GACR,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,sBAAsB,GACtB,mBAAmB,GACnB,qBAAqB,GACrB,WAAW,GACX,gBAAgB,GAChB,iBAAiB,GACjB,aAAa,CAChB;IACD,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACrB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"chart-container.d.ts","sourceRoot":"","sources":["../../../src/area-chart/chart-container.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAQrC,UAAU,mBAAmB,CAAC,CAAC,SAAS,cAAc,CAAC,SAAS,CAC9D,SAAQ,IAAI,CACV,cAAc,CAAC,CAAC,CAAC,EACf,QAAQ,GACR,QAAQ,GACR,gBAAgB,GAChB,gBAAgB,GAChB,sBAAsB,GACtB,mBAAmB,GACnB,qBAAqB,GACrB,WAAW,GACX,gBAAgB,GAChB,iBAAiB,GACjB,aAAa,CAChB;IACD,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACrB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;;AAED,wBAA6D;AAE7D,iBAAS,cAAc,CAAC,CAAC,SAAS,cAAc,CAAC,SAAS,EAAE,EAC1D,KAAK,EACL,SAAS,EACT,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,mBAAmB,EACnB,SAAS,EACT,cAAc,EACd,eAAe,EACf,WAAW,EAAE,EACX,cAAc,EAAE,wBAAwB,EACxC,cAAc,EAAE,wBAAwB,EACxC,oBAAoB,EAAE,8BAA8B,EACpD,gBAAgB,EAChB,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,6BAA6B,GACzB,EACN,SAAS,EACT,SAAS,EACT,cAAyC,EACzC,cAAyC,EACzC,oBAAqD,EACrD,KAAK,GACN,EAAE,mBAAmB,CAAC,CAAC,CAAC,eAkIxB"}
|
|
@@ -20,7 +20,7 @@ const DEFAULT_CHART_WIDTH = 500;
|
|
|
20
20
|
const INLINE_START_LABELS_MARGIN = 16;
|
|
21
21
|
const BLOCK_END_LABELS_OFFSET = 12;
|
|
22
22
|
export default memo(ChartContainer);
|
|
23
|
-
function ChartContainer({ model, autoWidth, xTitle, yTitle, detailPopoverSize, detailPopoverFooter, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings: { xTickFormatter: deprecatedXTickFormatter, yTickFormatter: deprecatedYTickFormatter, detailTotalFormatter: deprecatedDetailTotalFormatter, detailTotalLabel, chartAriaRoleDescription, xAxisAriaRoleDescription, yAxisAriaRoleDescription, detailPopoverDismissAriaLabel, } = {}, fitHeight, minHeight, xTickFormatter = deprecatedXTickFormatter, yTickFormatter = deprecatedYTickFormatter, detailTotalFormatter = deprecatedDetailTotalFormatter, }) {
|
|
23
|
+
function ChartContainer({ model, autoWidth, xTitle, yTitle, detailPopoverSize, detailPopoverFooter, ariaLabel, ariaLabelledby, ariaDescription, i18nStrings: { xTickFormatter: deprecatedXTickFormatter, yTickFormatter: deprecatedYTickFormatter, detailTotalFormatter: deprecatedDetailTotalFormatter, detailTotalLabel, chartAriaRoleDescription, xAxisAriaRoleDescription, yAxisAriaRoleDescription, detailPopoverDismissAriaLabel, } = {}, fitHeight, minHeight, xTickFormatter = deprecatedXTickFormatter, yTickFormatter = deprecatedYTickFormatter, detailTotalFormatter = deprecatedDetailTotalFormatter, isRTL, }) {
|
|
24
24
|
const [inlineStartLabelsWidth, setInlineStartLabelsWidth] = useState(0);
|
|
25
25
|
const [containerWidth, containerWidthRef] = useContainerWidth(DEFAULT_CHART_WIDTH);
|
|
26
26
|
const maxInlineStartLabelsWidth = Math.round(containerWidth / 2);
|
|
@@ -50,7 +50,7 @@ function ChartContainer({ model, autoWidth, xTitle, yTitle, detailPopoverSize, d
|
|
|
50
50
|
React.createElement("line", { ref: model.refs.plotMeasure, x1: "0", x2: "0", y1: "0", y2: "100%", stroke: "transparent", strokeWidth: 1, style: { pointerEvents: 'none' } }),
|
|
51
51
|
React.createElement(InlineStartLabels, { plotWidth: model.width, plotHeight: model.height, scale: model.computed.yScale, ticks: model.computed.yTicks, tickFormatter: yTickFormatter, title: yTitle, ariaRoleDescription: yAxisAriaRoleDescription, maxLabelsWidth: maxInlineStartLabelsWidth }),
|
|
52
52
|
React.createElement(AreaDataSeries, { model: model }),
|
|
53
|
-
React.createElement(BlockEndLabels, Object.assign({}, blockEndLabelsProps, { width: model.width, height: model.height, scale: model.computed.xScale, title: xTitle, ariaRoleDescription: xAxisAriaRoleDescription, offsetLeft: inlineStartLabelsWidth + BLOCK_END_LABELS_OFFSET, offsetRight: BLOCK_END_LABELS_OFFSET })),
|
|
53
|
+
React.createElement(BlockEndLabels, Object.assign({}, blockEndLabelsProps, { width: model.width, height: model.height, scale: model.computed.xScale, title: xTitle, ariaRoleDescription: xAxisAriaRoleDescription, offsetLeft: inlineStartLabelsWidth + BLOCK_END_LABELS_OFFSET, offsetRight: BLOCK_END_LABELS_OFFSET, isRTL: isRTL })),
|
|
54
54
|
React.createElement(EmphasizedBaseline, { width: model.width, height: model.height, scale: model.computed.yScale }),
|
|
55
55
|
React.createElement(AreaVerticalMarker, { model: model }),
|
|
56
56
|
React.createElement(AreaHighlightedPoint, { ref: highlightedPointRef, model: model, ariaLabel: highlightDetails === null || highlightDetails === void 0 ? void 0 : highlightDetails.activeLabel })), popover: React.createElement(AreaChartPopover, { model: model, highlightDetails: highlightDetails, dismissAriaLabel: detailPopoverDismissAriaLabel, size: detailPopoverSize, footer: detailPopoverFooterContent, onBlur: model.handlers.onApplicationBlur }) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-container.js","sourceRoot":"","sources":["../../../src/area-chart/chart-container.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,SAAS,MAAM,mDAAmD,CAAC;AAC1E,OAAO,cAAc,EAAE,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC5G,OAAO,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CAAC;AACjG,OAAO,kBAAkB,MAAM,4DAA4D,CAAC;AAC5F,OAAO,iBAAiB,MAAM,4DAA4D,CAAC;AAC3F,OAAO,aAAa,MAAM,uDAAuD,CAAC;AAClF,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,iBAAiB,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AACxD,OAAO,cAAc,MAAM,wBAAwB,CA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E,KAAK,GAAI;YAEpC,oBAAC,oBAAoB,IAAC,GAAG,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,WAAW,GAAI,CAChG,EAEd,OAAO,EACL,oBAAC,gBAAgB,IACf,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,6BAA6B,EAC/C,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,0BAA0B,EAClC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,iBAAiB,GACxC,GAEJ,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { memo, useEffect, useMemo, useRef, useState } from 'react';\n\nimport AxisLabel from '../internal/components/cartesian-chart/axis-label';\nimport BlockEndLabels, { useBLockEndLabels } from '../internal/components/cartesian-chart/block-end-labels';\nimport { CartesianChartContainer } from '../internal/components/cartesian-chart/chart-container';\nimport EmphasizedBaseline from '../internal/components/cartesian-chart/emphasized-baseline';\nimport InlineStartLabels from '../internal/components/cartesian-chart/inline-start-labels';\nimport LabelsMeasure from '../internal/components/cartesian-chart/labels-measure';\nimport ChartPlot from '../internal/components/chart-plot';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport useContainerWidth from '../internal/utils/use-container-width';\nimport { useSelector } from './async-store';\nimport AreaChartPopover from './elements/chart-popover';\nimport AreaDataSeries from './elements/data-series';\nimport AreaHighlightedPoint from './elements/highlighted-point';\nimport useHighlightDetails from './elements/use-highlight-details';\nimport AreaVerticalMarker from './elements/vertical-marker';\nimport { AreaChartProps } from './interfaces';\nimport { ChartModel } from './model';\n\nconst DEFAULT_CHART_WIDTH = 500;\nconst INLINE_START_LABELS_MARGIN = 16;\nconst BLOCK_END_LABELS_OFFSET = 12;\n\ntype TickFormatter = undefined | ((value: AreaChartProps.DataTypes) => string);\n\ninterface ChartContainerProps<T extends AreaChartProps.DataTypes>\n extends Pick<\n AreaChartProps<T>,\n | 'xTitle'\n | 'yTitle'\n | 'xTickFormatter'\n | 'yTickFormatter'\n | 'detailTotalFormatter'\n | 'detailPopoverSize'\n | 'detailPopoverFooter'\n | 'ariaLabel'\n | 'ariaLabelledby'\n | 'ariaDescription'\n | 'i18nStrings'\n > {\n model: ChartModel<T>;\n autoWidth: (value: number) => void;\n fitHeight?: boolean;\n minHeight: number;\n}\n\nexport default memo(ChartContainer) as typeof ChartContainer;\n\nfunction ChartContainer<T extends AreaChartProps.DataTypes>({\n model,\n autoWidth,\n xTitle,\n yTitle,\n detailPopoverSize,\n detailPopoverFooter,\n ariaLabel,\n ariaLabelledby,\n ariaDescription,\n i18nStrings: {\n xTickFormatter: deprecatedXTickFormatter,\n yTickFormatter: deprecatedYTickFormatter,\n detailTotalFormatter: deprecatedDetailTotalFormatter,\n detailTotalLabel,\n chartAriaRoleDescription,\n xAxisAriaRoleDescription,\n yAxisAriaRoleDescription,\n detailPopoverDismissAriaLabel,\n } = {},\n fitHeight,\n minHeight,\n xTickFormatter = deprecatedXTickFormatter,\n yTickFormatter = deprecatedYTickFormatter,\n detailTotalFormatter = deprecatedDetailTotalFormatter,\n}: ChartContainerProps<T>) {\n const [inlineStartLabelsWidth, setInlineStartLabelsWidth] = useState(0);\n const [containerWidth, containerWidthRef] = useContainerWidth(DEFAULT_CHART_WIDTH);\n const maxInlineStartLabelsWidth = Math.round(containerWidth / 2);\n\n const blockEndLabelsProps = useBLockEndLabels({\n ticks: model.computed.xTicks,\n scale: model.computed.xScale,\n tickFormatter: xTickFormatter as TickFormatter,\n });\n\n // Calculate the width of the plot area and tell it to the parent.\n const plotWidth = Math.max(0, containerWidth - inlineStartLabelsWidth - INLINE_START_LABELS_MARGIN);\n useEffect(() => {\n autoWidth(plotWidth);\n }, [autoWidth, plotWidth]);\n\n const highlightDetails = useHighlightDetails({\n model,\n xTickFormatter,\n yTickFormatter,\n detailTotalFormatter,\n detailTotalLabel,\n });\n\n const highlightedPointRef = useRef<SVGGElement>(null);\n\n const mergedRef = useMergeRefs(containerWidthRef, model.refs.container);\n\n const isPointHighlighted = model.interactions.get().highlightedPoint !== null;\n\n const highlightedX = useSelector(model.interactions, state => state.highlightedX);\n\n const detailPopoverFooterContent = useMemo(\n () => (detailPopoverFooter && highlightedX ? detailPopoverFooter(highlightedX[0].x) : null),\n [detailPopoverFooter, highlightedX]\n );\n\n return (\n <CartesianChartContainer\n ref={mergedRef}\n minHeight={minHeight + blockEndLabelsProps.height}\n fitHeight={!!fitHeight}\n leftAxisLabel={<AxisLabel axis=\"y\" position=\"left\" title={yTitle} />}\n leftAxisLabelMeasure={\n <LabelsMeasure\n scale={model.computed.yScale}\n ticks={model.computed.yTicks}\n tickFormatter={yTickFormatter as TickFormatter}\n autoWidth={setInlineStartLabelsWidth}\n maxLabelsWidth={maxInlineStartLabelsWidth}\n />\n }\n bottomAxisLabel={<AxisLabel axis=\"x\" position=\"bottom\" title={xTitle} />}\n chartPlot={\n <ChartPlot\n ref={model.refs.plot}\n width=\"100%\"\n height={fitHeight ? `calc(100% - ${blockEndLabelsProps.height}px)` : model.height}\n offsetBottom={blockEndLabelsProps.height}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescription={ariaDescription}\n ariaRoleDescription={chartAriaRoleDescription}\n activeElementKey={!highlightDetails?.isPopoverPinned && highlightDetails?.activeLabel}\n activeElementRef={isPointHighlighted ? highlightedPointRef : model.refs.verticalMarker}\n activeElementFocusOffset={isPointHighlighted ? 3 : { x: 8, y: 0 }}\n isClickable={!highlightDetails?.isPopoverPinned}\n onMouseMove={model.handlers.onSVGMouseMove}\n onMouseOut={model.handlers.onSVGMouseOut}\n onClick={model.handlers.onSVGMouseDown}\n onKeyDown={model.handlers.onSVGKeyDown}\n onApplicationFocus={model.handlers.onApplicationFocus}\n onApplicationBlur={model.handlers.onApplicationBlur}\n >\n <line\n ref={model.refs.plotMeasure}\n x1=\"0\"\n x2=\"0\"\n y1=\"0\"\n y2=\"100%\"\n stroke=\"transparent\"\n strokeWidth={1}\n style={{ pointerEvents: 'none' }}\n />\n\n <InlineStartLabels\n plotWidth={model.width}\n plotHeight={model.height}\n scale={model.computed.yScale}\n ticks={model.computed.yTicks}\n tickFormatter={yTickFormatter}\n title={yTitle}\n ariaRoleDescription={yAxisAriaRoleDescription}\n maxLabelsWidth={maxInlineStartLabelsWidth}\n />\n\n <AreaDataSeries model={model} />\n\n <BlockEndLabels\n {...blockEndLabelsProps}\n width={model.width}\n height={model.height}\n scale={model.computed.xScale}\n title={xTitle}\n ariaRoleDescription={xAxisAriaRoleDescription}\n offsetLeft={inlineStartLabelsWidth + BLOCK_END_LABELS_OFFSET}\n offsetRight={BLOCK_END_LABELS_OFFSET}\n />\n\n <EmphasizedBaseline width={model.width} height={model.height} scale={model.computed.yScale} />\n\n <AreaVerticalMarker model={model} />\n\n <AreaHighlightedPoint ref={highlightedPointRef} model={model} ariaLabel={highlightDetails?.activeLabel} />\n </ChartPlot>\n }\n popover={\n <AreaChartPopover\n model={model}\n highlightDetails={highlightDetails}\n dismissAriaLabel={detailPopoverDismissAriaLabel}\n size={detailPopoverSize}\n footer={detailPopoverFooterContent}\n onBlur={model.handlers.onApplicationBlur}\n />\n }\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"chart-container.js","sourceRoot":"","sources":["../../../src/area-chart/chart-container.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,SAAS,MAAM,mDAAmD,CAAC;AAC1E,OAAO,cAAc,EAAE,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAC;AAC5G,OAAO,EAAE,uBAAuB,EAAE,MAAM,wDAAwD,CA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AM,EAAE,KAAK,CAAC,MAAM,EACpB,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,EAC5B,KAAK,EAAE,MAAM,EACb,mBAAmB,EAAE,wBAAwB,EAC7C,UAAU,EAAE,sBAAsB,GAAG,uBAAuB,EAC5D,WAAW,EAAE,uBAAuB,EACpC,KAAK,EAAE,KAAK,IACZ;YAEF,oBAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAI;YAE9F,oBAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,GAAI;YAEpC,oBAAC,oBAAoB,IAAC,GAAG,EAAE,mBAAmB,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,WAAW,GAAI,CAChG,EAEd,OAAO,EACL,oBAAC,gBAAgB,IACf,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,6BAA6B,EAC/C,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,0BAA0B,EAClC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,iBAAiB,GACxC,GAEJ,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { memo, useEffect, useMemo, useRef, useState } from 'react';\n\nimport AxisLabel from '../internal/components/cartesian-chart/axis-label';\nimport BlockEndLabels, { useBLockEndLabels } from '../internal/components/cartesian-chart/block-end-labels';\nimport { CartesianChartContainer } from '../internal/components/cartesian-chart/chart-container';\nimport EmphasizedBaseline from '../internal/components/cartesian-chart/emphasized-baseline';\nimport InlineStartLabels from '../internal/components/cartesian-chart/inline-start-labels';\nimport LabelsMeasure from '../internal/components/cartesian-chart/labels-measure';\nimport ChartPlot from '../internal/components/chart-plot';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport useContainerWidth from '../internal/utils/use-container-width';\nimport { useSelector } from './async-store';\nimport AreaChartPopover from './elements/chart-popover';\nimport AreaDataSeries from './elements/data-series';\nimport AreaHighlightedPoint from './elements/highlighted-point';\nimport useHighlightDetails from './elements/use-highlight-details';\nimport AreaVerticalMarker from './elements/vertical-marker';\nimport { AreaChartProps } from './interfaces';\nimport { ChartModel } from './model';\n\nconst DEFAULT_CHART_WIDTH = 500;\nconst INLINE_START_LABELS_MARGIN = 16;\nconst BLOCK_END_LABELS_OFFSET = 12;\n\ntype TickFormatter = undefined | ((value: AreaChartProps.DataTypes) => string);\n\ninterface ChartContainerProps<T extends AreaChartProps.DataTypes>\n extends Pick<\n AreaChartProps<T>,\n | 'xTitle'\n | 'yTitle'\n | 'xTickFormatter'\n | 'yTickFormatter'\n | 'detailTotalFormatter'\n | 'detailPopoverSize'\n | 'detailPopoverFooter'\n | 'ariaLabel'\n | 'ariaLabelledby'\n | 'ariaDescription'\n | 'i18nStrings'\n > {\n model: ChartModel<T>;\n autoWidth: (value: number) => void;\n fitHeight?: boolean;\n minHeight: number;\n isRTL?: boolean;\n}\n\nexport default memo(ChartContainer) as typeof ChartContainer;\n\nfunction ChartContainer<T extends AreaChartProps.DataTypes>({\n model,\n autoWidth,\n xTitle,\n yTitle,\n detailPopoverSize,\n detailPopoverFooter,\n ariaLabel,\n ariaLabelledby,\n ariaDescription,\n i18nStrings: {\n xTickFormatter: deprecatedXTickFormatter,\n yTickFormatter: deprecatedYTickFormatter,\n detailTotalFormatter: deprecatedDetailTotalFormatter,\n detailTotalLabel,\n chartAriaRoleDescription,\n xAxisAriaRoleDescription,\n yAxisAriaRoleDescription,\n detailPopoverDismissAriaLabel,\n } = {},\n fitHeight,\n minHeight,\n xTickFormatter = deprecatedXTickFormatter,\n yTickFormatter = deprecatedYTickFormatter,\n detailTotalFormatter = deprecatedDetailTotalFormatter,\n isRTL,\n}: ChartContainerProps<T>) {\n const [inlineStartLabelsWidth, setInlineStartLabelsWidth] = useState(0);\n const [containerWidth, containerWidthRef] = useContainerWidth(DEFAULT_CHART_WIDTH);\n const maxInlineStartLabelsWidth = Math.round(containerWidth / 2);\n\n const blockEndLabelsProps = useBLockEndLabels({\n ticks: model.computed.xTicks,\n scale: model.computed.xScale,\n tickFormatter: xTickFormatter as TickFormatter,\n });\n\n // Calculate the width of the plot area and tell it to the parent.\n const plotWidth = Math.max(0, containerWidth - inlineStartLabelsWidth - INLINE_START_LABELS_MARGIN);\n useEffect(() => {\n autoWidth(plotWidth);\n }, [autoWidth, plotWidth]);\n\n const highlightDetails = useHighlightDetails({\n model,\n xTickFormatter,\n yTickFormatter,\n detailTotalFormatter,\n detailTotalLabel,\n });\n\n const highlightedPointRef = useRef<SVGGElement>(null);\n\n const mergedRef = useMergeRefs(containerWidthRef, model.refs.container);\n\n const isPointHighlighted = model.interactions.get().highlightedPoint !== null;\n\n const highlightedX = useSelector(model.interactions, state => state.highlightedX);\n\n const detailPopoverFooterContent = useMemo(\n () => (detailPopoverFooter && highlightedX ? detailPopoverFooter(highlightedX[0].x) : null),\n [detailPopoverFooter, highlightedX]\n );\n\n return (\n <CartesianChartContainer\n ref={mergedRef}\n minHeight={minHeight + blockEndLabelsProps.height}\n fitHeight={!!fitHeight}\n leftAxisLabel={<AxisLabel axis=\"y\" position=\"left\" title={yTitle} />}\n leftAxisLabelMeasure={\n <LabelsMeasure\n scale={model.computed.yScale}\n ticks={model.computed.yTicks}\n tickFormatter={yTickFormatter as TickFormatter}\n autoWidth={setInlineStartLabelsWidth}\n maxLabelsWidth={maxInlineStartLabelsWidth}\n />\n }\n bottomAxisLabel={<AxisLabel axis=\"x\" position=\"bottom\" title={xTitle} />}\n chartPlot={\n <ChartPlot\n ref={model.refs.plot}\n width=\"100%\"\n height={fitHeight ? `calc(100% - ${blockEndLabelsProps.height}px)` : model.height}\n offsetBottom={blockEndLabelsProps.height}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescription={ariaDescription}\n ariaRoleDescription={chartAriaRoleDescription}\n activeElementKey={!highlightDetails?.isPopoverPinned && highlightDetails?.activeLabel}\n activeElementRef={isPointHighlighted ? highlightedPointRef : model.refs.verticalMarker}\n activeElementFocusOffset={isPointHighlighted ? 3 : { x: 8, y: 0 }}\n isClickable={!highlightDetails?.isPopoverPinned}\n onMouseMove={model.handlers.onSVGMouseMove}\n onMouseOut={model.handlers.onSVGMouseOut}\n onClick={model.handlers.onSVGMouseDown}\n onKeyDown={model.handlers.onSVGKeyDown}\n onApplicationFocus={model.handlers.onApplicationFocus}\n onApplicationBlur={model.handlers.onApplicationBlur}\n >\n <line\n ref={model.refs.plotMeasure}\n x1=\"0\"\n x2=\"0\"\n y1=\"0\"\n y2=\"100%\"\n stroke=\"transparent\"\n strokeWidth={1}\n style={{ pointerEvents: 'none' }}\n />\n\n <InlineStartLabels\n plotWidth={model.width}\n plotHeight={model.height}\n scale={model.computed.yScale}\n ticks={model.computed.yTicks}\n tickFormatter={yTickFormatter}\n title={yTitle}\n ariaRoleDescription={yAxisAriaRoleDescription}\n maxLabelsWidth={maxInlineStartLabelsWidth}\n />\n\n <AreaDataSeries model={model} />\n\n <BlockEndLabels\n {...blockEndLabelsProps}\n width={model.width}\n height={model.height}\n scale={model.computed.xScale}\n title={xTitle}\n ariaRoleDescription={xAxisAriaRoleDescription}\n offsetLeft={inlineStartLabelsWidth + BLOCK_END_LABELS_OFFSET}\n offsetRight={BLOCK_END_LABELS_OFFSET}\n isRTL={isRTL}\n />\n\n <EmphasizedBaseline width={model.width} height={model.height} scale={model.computed.yScale} />\n\n <AreaVerticalMarker model={model} />\n\n <AreaHighlightedPoint ref={highlightedPointRef} model={model} ariaLabel={highlightDetails?.activeLabel} />\n </ChartPlot>\n }\n popover={\n <AreaChartPopover\n model={model}\n highlightDetails={highlightDetails}\n dismissAriaLabel={detailPopoverDismissAriaLabel}\n size={detailPopoverSize}\n footer={detailPopoverFooterContent}\n onBlur={model.handlers.onApplicationBlur}\n />\n }\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/area-chart/internal.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQ9C,KAAK,sBAAsB,CAAC,CAAC,SAAS,cAAc,CAAC,SAAS,IAAI,YAAY,CAC5E,cAAc,CAAC,CAAC,CAAC,EACjB,QAAQ,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,aAAa,CAC5F,GACC,0BAA0B,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,CAAC,SAAS,cAAc,CAAC,SAAS,EAAE,EAC5E,SAAS,EACT,MAAM,EACN,UAAU,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EAAE,2BAA2B,EAC9C,aAAa,EAAE,uBAAuB,EACtC,MAAM,EAAE,cAAc,EACtB,cAAc,EAAE,yBAAyB,EACzC,iBAAiB,EAAE,2BAA2B,EAC9C,WAAW,EACX,SAAS,EACT,cAAc,EACd,eAAe,EACf,MAAM,EACN,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,EACL,OAAO,EACP,SAAS,EACT,WAAW,EACX,YAAY,EACZ,eAAe,EACf,iBAAwB,EACxB,GAAG,KAAK,EACT,EAAE,sBAAsB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/area-chart/internal.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKjD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAQ9C,KAAK,sBAAsB,CAAC,CAAC,SAAS,cAAc,CAAC,SAAS,IAAI,YAAY,CAC5E,cAAc,CAAC,CAAC,CAAC,EACjB,QAAQ,GAAG,YAAY,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,aAAa,CAC5F,GACC,0BAA0B,CAAC;AAE7B,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,CAAC,SAAS,cAAc,CAAC,SAAS,EAAE,EAC5E,SAAS,EACT,MAAM,EACN,UAAU,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EAAE,2BAA2B,EAC9C,aAAa,EAAE,uBAAuB,EACtC,MAAM,EAAE,cAAc,EACtB,cAAc,EAAE,yBAAyB,EACzC,iBAAiB,EAAE,2BAA2B,EAC9C,WAAW,EACX,SAAS,EACT,cAAc,EACd,eAAe,EACf,MAAM,EACN,MAAM,EACN,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,EACL,OAAO,EACP,SAAS,EACT,WAAW,EACX,YAAY,EACZ,eAAe,EACf,iBAAwB,EACxB,GAAG,KAAK,EACT,EAAE,sBAAsB,CAAC,CAAC,CAAC,eA4I3B"}
|
package/area-chart/internal.js
CHANGED
|
@@ -73,6 +73,6 @@ export default function InternalAreaChart(_a) {
|
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
const mergedRef = useMergeRefs(containerRef, __internalRootRef);
|
|
76
|
-
return (React.createElement(ChartWrapper, Object.assign({ ref: mergedRef }, baseProps, { className: clsx(baseProps.className, styles.root), fitHeight: !!fitHeight, contentMinHeight: height, defaultFilter: showFilters && !hideFilter ? (React.createElement(AreaChartFilter, { model: model, filterLabel: i18nStrings.filterLabel, filterPlaceholder: i18nStrings.filterPlaceholder, filterSelectedAriaLabel: i18nStrings.filterSelectedAriaLabel })) : null, additionalFilters: showFilters ? additionalFilters : null, reserveFilterSpace: !!reserveFilterSpace, reserveLegendSpace: !!reserveLegendSpace, chartStatus: React.createElement(ChartStatusContainer, { isEmpty: isEmpty, isNoMatch: isNoMatch, showChart: showChart, statusType: statusType, empty: empty, noMatch: noMatch, loadingText: loadingText, errorText: errorText, recoveryText: recoveryText, onRecoveryClick: onRecoveryClick }), chart: showChart ? (React.createElement(ChartContainer, { model: model, autoWidth: setWidth, detailPopoverSize: detailPopoverSize, detailPopoverFooter: detailPopoverFooter, xTitle: xTitle, yTitle: yTitle, xTickFormatter: xTickFormatter, yTickFormatter: yTickFormatter, detailTotalFormatter: detailTotalFormatter, ariaLabel: ariaLabel, ariaLabelledby: ariaLabelledby, ariaDescription: ariaDescription, i18nStrings: i18nStrings, fitHeight: fitHeight, minHeight: height })) : null, legend: showLegend ? (React.createElement(AreaChartLegend, { plotContainerRef: containerRef, model: model, legendTitle: legendTitle, ariaLabel: i18nStrings.legendAriaLabel })) : null, onBlur: onBlur })));
|
|
76
|
+
return (React.createElement(ChartWrapper, Object.assign({ ref: mergedRef }, baseProps, { className: clsx(baseProps.className, styles.root), fitHeight: !!fitHeight, contentMinHeight: height, defaultFilter: showFilters && !hideFilter ? (React.createElement(AreaChartFilter, { model: model, filterLabel: i18nStrings.filterLabel, filterPlaceholder: i18nStrings.filterPlaceholder, filterSelectedAriaLabel: i18nStrings.filterSelectedAriaLabel })) : null, additionalFilters: showFilters ? additionalFilters : null, reserveFilterSpace: !!reserveFilterSpace, reserveLegendSpace: !!reserveLegendSpace, chartStatus: React.createElement(ChartStatusContainer, { isEmpty: isEmpty, isNoMatch: isNoMatch, showChart: showChart, statusType: statusType, empty: empty, noMatch: noMatch, loadingText: loadingText, errorText: errorText, recoveryText: recoveryText, onRecoveryClick: onRecoveryClick }), chart: showChart ? (React.createElement(ChartContainer, { model: model, autoWidth: setWidth, detailPopoverSize: detailPopoverSize, detailPopoverFooter: detailPopoverFooter, xTitle: xTitle, yTitle: yTitle, xTickFormatter: xTickFormatter, yTickFormatter: yTickFormatter, detailTotalFormatter: detailTotalFormatter, ariaLabel: ariaLabel, ariaLabelledby: ariaLabelledby, ariaDescription: ariaDescription, i18nStrings: i18nStrings, fitHeight: fitHeight, minHeight: height, isRTL: isRtl })) : null, legend: showLegend ? (React.createElement(AreaChartLegend, { plotContainerRef: containerRef, model: model, legendTitle: legendTitle, ariaLabel: i18nStrings.legendAriaLabel })) : null, onBlur: onBlur })));
|
|
77
77
|
}
|
|
78
78
|
//# sourceMappingURL=internal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/area-chart/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,oBAAoB,EAAE,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AACrG,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,eAAe,MAAM,8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ACT,oBAAC,oBAAoB,IACnB,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,GAChC,EAEJ,KAAK,EACH,SAAS,CAAC,CAAC,CAAC,CACV,oBAAC,cAAc,IACb,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,QAAQ,EACnB,iBAAiB,EAAE,iBAAiB,EACpC,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,cAAc,EAAE,cAAc,EAC9B,oBAAoB,EAAE,oBAAoB,EAC1C,SAAS,EAAE,SAAS,EACpB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,MAAM,GACjB,CACH,CAAC,CAAC,CAAC,IAAI,EAEV,MAAM,EACJ,UAAU,CAAC,CAAC,CAAC,CACX,oBAAC,eAAe,IACd,gBAAgB,EAAE,YAAY,EAC9B,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,WAAW,CAAC,eAAe,GACtC,CACH,CAAC,CAAC,CAAC,IAAI,EAEV,MAAM,EAAE,MAAM,IACd,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { getIsRtl } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport ChartStatusContainer, { getChartStatus } from '../internal/components/chart-status-container';\nimport { ChartWrapper } from '../internal/components/chart-wrapper';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { isDevelopment } from '../internal/is-development';\nimport { SomeRequired } from '../internal/types';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport ChartContainer from './chart-container';\nimport AreaChartFilter from './elements/area-chart-filter';\nimport AreaChartLegend from './elements/area-chart-legend';\nimport { AreaChartProps } from './interfaces';\nimport useChartModel from './model/use-chart-model';\nimport useFilterProps from './model/use-filter-props';\nimport useHighlightProps from './model/use-highlight-props';\nimport { isSeriesValid } from './model/utils';\n\nimport styles from './styles.css.js';\n\ntype InternalAreaChartProps<T extends AreaChartProps.DataTypes> = SomeRequired<\n AreaChartProps<T>,\n 'height' | 'xScaleType' | 'yScaleType' | 'statusType' | 'detailPopoverSize' | 'i18nStrings'\n> &\n InternalBaseComponentProps;\n\nexport default function InternalAreaChart<T extends AreaChartProps.DataTypes>({\n fitHeight,\n height,\n xScaleType,\n yScaleType,\n xDomain,\n yDomain,\n xTickFormatter,\n yTickFormatter,\n detailTotalFormatter,\n highlightedSeries: controlledHighlightedSeries,\n visibleSeries: controlledVisibleSeries,\n series: externalSeries,\n onFilterChange: controlledOnVisibleChange,\n onHighlightChange: controlledOnHighlightChange,\n i18nStrings,\n ariaLabel,\n ariaLabelledby,\n ariaDescription,\n xTitle,\n yTitle,\n hideFilter,\n additionalFilters,\n hideLegend,\n legendTitle,\n statusType,\n detailPopoverSize,\n detailPopoverFooter,\n empty,\n noMatch,\n errorText,\n loadingText,\n recoveryText,\n onRecoveryClick,\n __internalRootRef = null,\n ...props\n}: InternalAreaChartProps<T>) {\n const baseProps = getBaseProps(props);\n const containerRef = useRef<HTMLDivElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n\n if (isDevelopment) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n if (!isSeriesValid(externalSeries)) {\n warnOnce(\n 'AreaChart',\n \"The `series` property violates the component's constraints: all `area` \" +\n 'series must have `data` arrays of the same length and with the same x-values.'\n );\n }\n }, [externalSeries]);\n }\n\n const [width, setWidth] = useState(0);\n const [visibleSeries, setVisibleSeries] = useFilterProps(\n externalSeries,\n controlledVisibleSeries,\n controlledOnVisibleChange\n );\n const [highlightedSeries, setHighlightedSeries] = useHighlightProps(\n externalSeries,\n controlledHighlightedSeries,\n controlledOnHighlightChange\n );\n const isRtl = containerRef.current ? getIsRtl(containerRef.current) : false;\n const model = useChartModel({\n isRtl,\n fitHeight,\n externalSeries,\n visibleSeries,\n setVisibleSeries,\n highlightedSeries,\n setHighlightedSeries,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n popoverRef,\n });\n\n const { isEmpty, isNoMatch, showChart } = getChartStatus({\n externalData: externalSeries,\n visibleData: visibleSeries,\n statusType,\n });\n const showFilters = statusType === 'finished' && (!isEmpty || isNoMatch) && (additionalFilters || !hideFilter);\n const showLegend = !hideLegend && !isEmpty && statusType === 'finished';\n const reserveLegendSpace = !showChart && !hideLegend;\n const reserveFilterSpace = !showChart && !isNoMatch && (!hideFilter || additionalFilters);\n\n useEffect(() => {\n const onKeyDown = model.handlers.onDocumentKeyDown;\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [model.handlers.onDocumentKeyDown]);\n\n const onBlur = (event: React.FocusEvent) => {\n if (event.relatedTarget && !nodeBelongs(containerRef.current, event.relatedTarget)) {\n model.handlers.onContainerBlur();\n }\n };\n\n const mergedRef = useMergeRefs(containerRef, __internalRootRef);\n\n return (\n <ChartWrapper\n ref={mergedRef}\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n fitHeight={!!fitHeight}\n contentMinHeight={height}\n defaultFilter={\n showFilters && !hideFilter ? (\n <AreaChartFilter\n model={model}\n filterLabel={i18nStrings.filterLabel}\n filterPlaceholder={i18nStrings.filterPlaceholder}\n filterSelectedAriaLabel={i18nStrings.filterSelectedAriaLabel}\n />\n ) : null\n }\n additionalFilters={showFilters ? additionalFilters : null}\n reserveFilterSpace={!!reserveFilterSpace}\n reserveLegendSpace={!!reserveLegendSpace}\n chartStatus={\n <ChartStatusContainer\n isEmpty={isEmpty}\n isNoMatch={isNoMatch}\n showChart={showChart}\n statusType={statusType}\n empty={empty}\n noMatch={noMatch}\n loadingText={loadingText}\n errorText={errorText}\n recoveryText={recoveryText}\n onRecoveryClick={onRecoveryClick}\n />\n }\n chart={\n showChart ? (\n <ChartContainer\n model={model}\n autoWidth={setWidth}\n detailPopoverSize={detailPopoverSize}\n detailPopoverFooter={detailPopoverFooter}\n xTitle={xTitle}\n yTitle={yTitle}\n xTickFormatter={xTickFormatter}\n yTickFormatter={yTickFormatter}\n detailTotalFormatter={detailTotalFormatter}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescription={ariaDescription}\n i18nStrings={i18nStrings}\n fitHeight={fitHeight}\n minHeight={height}\n />\n ) : null\n }\n legend={\n showLegend ? (\n <AreaChartLegend\n plotContainerRef={containerRef}\n model={model}\n legendTitle={legendTitle}\n ariaLabel={i18nStrings.legendAriaLabel}\n />\n ) : null\n }\n onBlur={onBlur}\n />\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/area-chart/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,oBAAoB,EAAE,EAAE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,eAAe,GACtC,CACH,CAAC,CAAC,CAAC,IAAI,EAEV,MAAM,EAAE,MAAM,IACd,CACH,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { getIsRtl } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getBaseProps } from '../internal/base-component';\nimport ChartStatusContainer, { getChartStatus } from '../internal/components/chart-status-container';\nimport { ChartWrapper } from '../internal/components/chart-wrapper';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { isDevelopment } from '../internal/is-development';\nimport { SomeRequired } from '../internal/types';\nimport { nodeBelongs } from '../internal/utils/node-belongs';\nimport ChartContainer from './chart-container';\nimport AreaChartFilter from './elements/area-chart-filter';\nimport AreaChartLegend from './elements/area-chart-legend';\nimport { AreaChartProps } from './interfaces';\nimport useChartModel from './model/use-chart-model';\nimport useFilterProps from './model/use-filter-props';\nimport useHighlightProps from './model/use-highlight-props';\nimport { isSeriesValid } from './model/utils';\n\nimport styles from './styles.css.js';\n\ntype InternalAreaChartProps<T extends AreaChartProps.DataTypes> = SomeRequired<\n AreaChartProps<T>,\n 'height' | 'xScaleType' | 'yScaleType' | 'statusType' | 'detailPopoverSize' | 'i18nStrings'\n> &\n InternalBaseComponentProps;\n\nexport default function InternalAreaChart<T extends AreaChartProps.DataTypes>({\n fitHeight,\n height,\n xScaleType,\n yScaleType,\n xDomain,\n yDomain,\n xTickFormatter,\n yTickFormatter,\n detailTotalFormatter,\n highlightedSeries: controlledHighlightedSeries,\n visibleSeries: controlledVisibleSeries,\n series: externalSeries,\n onFilterChange: controlledOnVisibleChange,\n onHighlightChange: controlledOnHighlightChange,\n i18nStrings,\n ariaLabel,\n ariaLabelledby,\n ariaDescription,\n xTitle,\n yTitle,\n hideFilter,\n additionalFilters,\n hideLegend,\n legendTitle,\n statusType,\n detailPopoverSize,\n detailPopoverFooter,\n empty,\n noMatch,\n errorText,\n loadingText,\n recoveryText,\n onRecoveryClick,\n __internalRootRef = null,\n ...props\n}: InternalAreaChartProps<T>) {\n const baseProps = getBaseProps(props);\n const containerRef = useRef<HTMLDivElement>(null);\n const popoverRef = useRef<HTMLDivElement>(null);\n\n if (isDevelopment) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n if (!isSeriesValid(externalSeries)) {\n warnOnce(\n 'AreaChart',\n \"The `series` property violates the component's constraints: all `area` \" +\n 'series must have `data` arrays of the same length and with the same x-values.'\n );\n }\n }, [externalSeries]);\n }\n\n const [width, setWidth] = useState(0);\n const [visibleSeries, setVisibleSeries] = useFilterProps(\n externalSeries,\n controlledVisibleSeries,\n controlledOnVisibleChange\n );\n const [highlightedSeries, setHighlightedSeries] = useHighlightProps(\n externalSeries,\n controlledHighlightedSeries,\n controlledOnHighlightChange\n );\n const isRtl = containerRef.current ? getIsRtl(containerRef.current) : false;\n const model = useChartModel({\n isRtl,\n fitHeight,\n externalSeries,\n visibleSeries,\n setVisibleSeries,\n highlightedSeries,\n setHighlightedSeries,\n xDomain,\n yDomain,\n xScaleType,\n yScaleType,\n height,\n width,\n popoverRef,\n });\n\n const { isEmpty, isNoMatch, showChart } = getChartStatus({\n externalData: externalSeries,\n visibleData: visibleSeries,\n statusType,\n });\n const showFilters = statusType === 'finished' && (!isEmpty || isNoMatch) && (additionalFilters || !hideFilter);\n const showLegend = !hideLegend && !isEmpty && statusType === 'finished';\n const reserveLegendSpace = !showChart && !hideLegend;\n const reserveFilterSpace = !showChart && !isNoMatch && (!hideFilter || additionalFilters);\n\n useEffect(() => {\n const onKeyDown = model.handlers.onDocumentKeyDown;\n document.addEventListener('keydown', onKeyDown);\n return () => document.removeEventListener('keydown', onKeyDown);\n }, [model.handlers.onDocumentKeyDown]);\n\n const onBlur = (event: React.FocusEvent) => {\n if (event.relatedTarget && !nodeBelongs(containerRef.current, event.relatedTarget)) {\n model.handlers.onContainerBlur();\n }\n };\n\n const mergedRef = useMergeRefs(containerRef, __internalRootRef);\n\n return (\n <ChartWrapper\n ref={mergedRef}\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n fitHeight={!!fitHeight}\n contentMinHeight={height}\n defaultFilter={\n showFilters && !hideFilter ? (\n <AreaChartFilter\n model={model}\n filterLabel={i18nStrings.filterLabel}\n filterPlaceholder={i18nStrings.filterPlaceholder}\n filterSelectedAriaLabel={i18nStrings.filterSelectedAriaLabel}\n />\n ) : null\n }\n additionalFilters={showFilters ? additionalFilters : null}\n reserveFilterSpace={!!reserveFilterSpace}\n reserveLegendSpace={!!reserveLegendSpace}\n chartStatus={\n <ChartStatusContainer\n isEmpty={isEmpty}\n isNoMatch={isNoMatch}\n showChart={showChart}\n statusType={statusType}\n empty={empty}\n noMatch={noMatch}\n loadingText={loadingText}\n errorText={errorText}\n recoveryText={recoveryText}\n onRecoveryClick={onRecoveryClick}\n />\n }\n chart={\n showChart ? (\n <ChartContainer\n model={model}\n autoWidth={setWidth}\n detailPopoverSize={detailPopoverSize}\n detailPopoverFooter={detailPopoverFooter}\n xTitle={xTitle}\n yTitle={yTitle}\n xTickFormatter={xTickFormatter}\n yTickFormatter={yTickFormatter}\n detailTotalFormatter={detailTotalFormatter}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescription={ariaDescription}\n i18nStrings={i18nStrings}\n fitHeight={fitHeight}\n minHeight={height}\n isRTL={isRtl}\n />\n ) : null\n }\n legend={\n showLegend ? (\n <AreaChartLegend\n plotContainerRef={containerRef}\n model={model}\n legendTitle={legendTitle}\n ariaLabel={i18nStrings.legendAriaLabel}\n />\n ) : null\n }\n onBlur={onBlur}\n />\n );\n}\n"]}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseComponentProps } from '../internal/base-component';
|
|
3
3
|
export interface ContainerProps extends BaseComponentProps {
|
|
4
|
+
/**
|
|
5
|
+
* Specifies additional analytics-related metadata.
|
|
6
|
+
* * `instanceIdentifier` - A unique string that identifies this component instance in your application.
|
|
7
|
+
* @analytics
|
|
8
|
+
*/
|
|
9
|
+
analyticsMetadata?: ContainerProps.AnalyticsMetadata;
|
|
4
10
|
/**
|
|
5
11
|
* Heading element of the container. Use the [header component](/components/header/).
|
|
6
12
|
*/
|
|
@@ -59,6 +65,9 @@ export interface ContainerProps extends BaseComponentProps {
|
|
|
59
65
|
variant?: 'default' | 'stacked';
|
|
60
66
|
}
|
|
61
67
|
export declare namespace ContainerProps {
|
|
68
|
+
interface AnalyticsMetadata {
|
|
69
|
+
instanceIdentifier?: string;
|
|
70
|
+
}
|
|
62
71
|
interface Media {
|
|
63
72
|
/**
|
|
64
73
|
* Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/container/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,cAAe,SAAQ,kBAAkB;IACxD;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,EAAE,cAAc,CAAC,KAAK,CAAC;IAE7B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC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B,CAAC,EAAE,MAAM,CAAC;KAC7B;IACD,UAAiB,KAAK;QACpB;;WAEG;QACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;QAEzB;;WAEG;QACH,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;QAE1B;;;;;;WAMG;QACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAExB;;;;;;WAMG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC1B;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/container/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface ContainerProps extends BaseComponentProps {\n /**\n * Heading element of the container. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Determines whether the container header has padding. If `true`, removes the default padding from the header.\n */\n disableHeaderPaddings?: boolean;\n\n /**\n *\n * Use this slot to render a media element. Supported element types are 'img', 'video', and 'picture'.\n * You can define different positions and sizes for the media element within the container.\n *\n * * `content` - Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.\n *\n * * `position` - Defines the media slot's position within the container. Defaults to `top`.\n *\n * * `width` - Defines the width of the media slot when positioned on the side. Corresponds to the `width` CSS-property.\n * When this value is set, media elements larger than the defined width may be cropped, with 'object-fit: cover' centering it.\n * Note: This value is considered only when `position` is set to `side`.\n * If no width is provided, the media slot will take a maximum of 66% of the container's width.\n *\n * * `height` - Defines the height of the media slot when position on the top. Corresponds to the `height` CSS-property.\n * When this value is set, media elements larger than the defined width may be cropped, with 'object-fit: cover' centering it. * Note: This value is only considered if `position` is set to `top`.\n * If no height is provided, the media slot will be displayed at its full height.\n *\n */\n media?: ContainerProps.Media;\n\n /**\n * Main content of the container.\n */\n children?: React.ReactNode;\n\n /**\n * Determines whether the container content has padding. If `true`, removes the default padding from the content area.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Enabling this property will make the container to fit into available height. If content is too short, the container\n * will stretch, if too long, the container will shrink and show vertical scrollbar.\n *\n * Use this property to align heights of multiple containers displayed in a single row. It is recommended to stretch\n * all containers to the height of the longest one, to avoid extra vertical scroll areas.\n */\n fitHeight?: boolean;\n\n /**\n * Footer of the container.\n */\n footer?: React.ReactNode;\n\n /**\n * Specify a container variant with one of the following:\n * * `default` - Use this variant in standalone context.\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * @visualrefresh `stacked` variant\n */\n variant?: 'default' | 'stacked';\n}\n\nexport namespace ContainerProps {\n export interface Media {\n /**\n * Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.\n */\n content: React.ReactNode;\n\n /**\n * Defines the media slot's position within the container. Defaults to `top`.\n */\n position?: 'top' | 'side';\n\n /**\n * Defines the width of the media slot when positioned on the side. Corresponds to the `width` CSS-property.\n * When this value is set, the media element may be cropped, with `object-fit: cover` centering it.\n *\n * Note: This value is considered only when `position` is set to `side`.\n * If no width is provided, the media slot will take a maximum of 66% of the container's width.\n */\n width?: string | number;\n\n /**\n * Defines the height of the media slot when position on the top. Corresponds to the `height` CSS-property.\n * When this value is set, the media element may be cropped, with `object-fit: cover` centering it.\n *\n * Note: This value is only considered if `position` is set to `top`.\n * If no height is provided, the media slot will be displayed at its full height.\n */\n height?: string | number;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/container/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface ContainerProps extends BaseComponentProps {\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * @analytics\n */\n analyticsMetadata?: ContainerProps.AnalyticsMetadata;\n\n /**\n * Heading element of the container. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Determines whether the container header has padding. If `true`, removes the default padding from the header.\n */\n disableHeaderPaddings?: boolean;\n\n /**\n *\n * Use this slot to render a media element. Supported element types are 'img', 'video', and 'picture'.\n * You can define different positions and sizes for the media element within the container.\n *\n * * `content` - Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.\n *\n * * `position` - Defines the media slot's position within the container. Defaults to `top`.\n *\n * * `width` - Defines the width of the media slot when positioned on the side. Corresponds to the `width` CSS-property.\n * When this value is set, media elements larger than the defined width may be cropped, with 'object-fit: cover' centering it.\n * Note: This value is considered only when `position` is set to `side`.\n * If no width is provided, the media slot will take a maximum of 66% of the container's width.\n *\n * * `height` - Defines the height of the media slot when position on the top. Corresponds to the `height` CSS-property.\n * When this value is set, media elements larger than the defined width may be cropped, with 'object-fit: cover' centering it. * Note: This value is only considered if `position` is set to `top`.\n * If no height is provided, the media slot will be displayed at its full height.\n *\n */\n media?: ContainerProps.Media;\n\n /**\n * Main content of the container.\n */\n children?: React.ReactNode;\n\n /**\n * Determines whether the container content has padding. If `true`, removes the default padding from the content area.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Enabling this property will make the container to fit into available height. If content is too short, the container\n * will stretch, if too long, the container will shrink and show vertical scrollbar.\n *\n * Use this property to align heights of multiple containers displayed in a single row. It is recommended to stretch\n * all containers to the height of the longest one, to avoid extra vertical scroll areas.\n */\n fitHeight?: boolean;\n\n /**\n * Footer of the container.\n */\n footer?: React.ReactNode;\n\n /**\n * Specify a container variant with one of the following:\n * * `default` - Use this variant in standalone context.\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * @visualrefresh `stacked` variant\n */\n variant?: 'default' | 'stacked';\n}\n\nexport namespace ContainerProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n }\n export interface Media {\n /**\n * Use this slot to render your media element. We support `img`, `video`, `picture`, and `iframe` elements.\n */\n content: React.ReactNode;\n\n /**\n * Defines the media slot's position within the container. Defaults to `top`.\n */\n position?: 'top' | 'side';\n\n /**\n * Defines the width of the media slot when positioned on the side. Corresponds to the `width` CSS-property.\n * When this value is set, the media element may be cropped, with `object-fit: cover` centering it.\n *\n * Note: This value is considered only when `position` is set to `side`.\n * If no width is provided, the media slot will take a maximum of 66% of the container's width.\n */\n width?: string | number;\n\n /**\n * Defines the height of the media slot when position on the top. Corresponds to the `height` CSS-property.\n * When this value is set, the media element may be cropped, with `object-fit: cover` centering it.\n *\n * Note: This value is only considered if `position` is set to `top`.\n * If no height is provided, the media slot will be displayed at its full height.\n */\n height?: string | number;\n }\n}\n"]}
|
|
@@ -2,6 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { BaseComponentProps } from '../internal/base-component';
|
|
3
3
|
import { NonCancelableEventHandler } from '../internal/events';
|
|
4
4
|
export declare namespace ExpandableSectionProps {
|
|
5
|
+
interface AnalyticsMetadata {
|
|
6
|
+
instanceIdentifier?: string;
|
|
7
|
+
}
|
|
5
8
|
type Variant = 'default' | 'footer' | 'container' | 'navigation' | 'stacked';
|
|
6
9
|
interface ChangeDetail {
|
|
7
10
|
expanded: boolean;
|
|
@@ -10,6 +13,12 @@ export declare namespace ExpandableSectionProps {
|
|
|
10
13
|
}
|
|
11
14
|
export type InternalVariant = ExpandableSectionProps.Variant | 'compact';
|
|
12
15
|
export interface ExpandableSectionProps extends BaseComponentProps {
|
|
16
|
+
/**
|
|
17
|
+
* Specifies additional analytics-related metadata.
|
|
18
|
+
* * `instanceIdentifier` - A unique string that identifies this component instance in your application.
|
|
19
|
+
* @analytics
|
|
20
|
+
*/
|
|
21
|
+
analyticsMetadata?: ExpandableSectionProps.AnalyticsMetadata;
|
|
13
22
|
/**
|
|
14
23
|
* Determines whether the component initially displays in expanded state (that is, with content visible). The component operates in an uncontrolled
|
|
15
24
|
* manner even if you provide a value for this property.
|
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AQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE7B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,sBAAsB,CAAC,UAAU,CAAC;IAEvD;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,yBAAyB,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAAC;IAE1E;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE7B;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/expandable-section/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport namespace ExpandableSectionProps {\n export type Variant = 'default' | 'footer' | 'container' | 'navigation' | 'stacked';\n export interface ChangeDetail {\n expanded: boolean;\n }\n export type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5';\n}\n\nexport type InternalVariant = ExpandableSectionProps.Variant | 'compact';\n\nexport interface ExpandableSectionProps extends BaseComponentProps {\n /**\n * Determines whether the component initially displays in expanded state (that is, with content visible). The component operates in an uncontrolled\n * manner even if you provide a value for this property.\n */\n defaultExpanded?: boolean;\n\n /**\n * Determines whether the component is in the expanded state (that is, with content visible). The component operates in a controlled\n * manner if you provide a value for this property.\n */\n expanded?: boolean;\n\n /**\n * The possible variants of an expandable section are as follows:\n * * `default` - Use this variant in any context.\n * * `footer` - Use this variant in container footers.\n * * `container` - Use this variant in a detail page alongside other containers.\n * * `navigation` - Use this variant in the navigation panel with anchors and custom styled content.\n * It doesn't have any default styles.\n * * `stacked` - Use this variant directly adjacent to other stacked containers (such as a container, table).\n * @visualrefresh `stacked` variant\n * */\n variant?: ExpandableSectionProps.Variant;\n\n /**\n * Determines whether the content section's default padding is removed. This default padding is only present for the `container` variant.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Primary content displayed in the expandable section element.\n */\n children?: React.ReactNode;\n\n /**\n * @deprecated Use `headerText` instead.\n */\n header?: React.ReactNode;\n\n /**\n * The heading text. Use plain text. When using the container variant, you can use additional header props like `headerDescription` and `headerCounter` to display other elements in the header.\n */\n headerText?: React.ReactNode;\n\n /**\n * Supplementary text below the heading. Use with the container, default or footer variants.\n */\n headerDescription?: string;\n\n /**\n * Specifies secondary text that's displayed to the right of the heading title. Use with the container variant.\n * Behaves similar to the Header component counter.\n */\n headerCounter?: string;\n\n /**\n * Overrides the default [HTML heading tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements).\n * Use with the container variant (which defaults to H2) or default/footer variants (which default to DIV). Using this\n * property does not change the visual appearance of the component. Note that this only works with the `headerText`\n * slot (not with the deprecated `header`), and not with the navigation variant.\n */\n headingTagOverride?: ExpandableSectionProps.HeadingTag;\n\n /**\n * Adds `aria-label` to the header element.\n * Use to assign unique labels when there are multiple expandable sections with the same header text on one page.\n */\n headerAriaLabel?: string;\n\n /**\n * Called when the state changes (that is, when the user expands or collapses the component).\n * The event `detail` contains the current value of the `expanded` property.\n */\n onChange?: NonCancelableEventHandler<ExpandableSectionProps.ChangeDetail>;\n\n /**\n * The area next to the heading, used to display an Info link. Use with the container variant.\n */\n headerInfo?: React.ReactNode;\n\n /**\n * Actions for the header. Use with the default or container variant.\n */\n headerActions?: React.ReactNode;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/expandable-section/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport namespace ExpandableSectionProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n }\n\n export type Variant = 'default' | 'footer' | 'container' | 'navigation' | 'stacked';\n export interface ChangeDetail {\n expanded: boolean;\n }\n export type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5';\n}\n\nexport type InternalVariant = ExpandableSectionProps.Variant | 'compact';\n\nexport interface ExpandableSectionProps extends BaseComponentProps {\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * @analytics\n */\n analyticsMetadata?: ExpandableSectionProps.AnalyticsMetadata;\n\n /**\n * Determines whether the component initially displays in expanded state (that is, with content visible). The component operates in an uncontrolled\n * manner even if you provide a value for this property.\n */\n defaultExpanded?: boolean;\n\n /**\n * Determines whether the component is in the expanded state (that is, with content visible). The component operates in a controlled\n * manner if you provide a value for this property.\n */\n expanded?: boolean;\n\n /**\n * The possible variants of an expandable section are as follows:\n * * `default` - Use this variant in any context.\n * * `footer` - Use this variant in container footers.\n * * `container` - Use this variant in a detail page alongside other containers.\n * * `navigation` - Use this variant in the navigation panel with anchors and custom styled content.\n * It doesn't have any default styles.\n * * `stacked` - Use this variant directly adjacent to other stacked containers (such as a container, table).\n * @visualrefresh `stacked` variant\n * */\n variant?: ExpandableSectionProps.Variant;\n\n /**\n * Determines whether the content section's default padding is removed. This default padding is only present for the `container` variant.\n */\n disableContentPaddings?: boolean;\n\n /**\n * Primary content displayed in the expandable section element.\n */\n children?: React.ReactNode;\n\n /**\n * @deprecated Use `headerText` instead.\n */\n header?: React.ReactNode;\n\n /**\n * The heading text. Use plain text. When using the container variant, you can use additional header props like `headerDescription` and `headerCounter` to display other elements in the header.\n */\n headerText?: React.ReactNode;\n\n /**\n * Supplementary text below the heading. Use with the container, default or footer variants.\n */\n headerDescription?: string;\n\n /**\n * Specifies secondary text that's displayed to the right of the heading title. Use with the container variant.\n * Behaves similar to the Header component counter.\n */\n headerCounter?: string;\n\n /**\n * Overrides the default [HTML heading tag](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements).\n * Use with the container variant (which defaults to H2) or default/footer variants (which default to DIV). Using this\n * property does not change the visual appearance of the component. Note that this only works with the `headerText`\n * slot (not with the deprecated `header`), and not with the navigation variant.\n */\n headingTagOverride?: ExpandableSectionProps.HeadingTag;\n\n /**\n * Adds `aria-label` to the header element.\n * Use to assign unique labels when there are multiple expandable sections with the same header text on one page.\n */\n headerAriaLabel?: string;\n\n /**\n * Called when the state changes (that is, when the user expands or collapses the component).\n * The event `detail` contains the current value of the `expanded` property.\n */\n onChange?: NonCancelableEventHandler<ExpandableSectionProps.ChangeDetail>;\n\n /**\n * The area next to the heading, used to display an Info link. Use with the container variant.\n */\n headerInfo?: React.ReactNode;\n\n /**\n * Actions for the header. Use with the default or container variant.\n */\n headerActions?: React.ReactNode;\n}\n"]}
|
package/form/interfaces.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { FlowType } from '../internal/analytics/interfaces';
|
|
2
3
|
import { BaseComponentProps } from '../internal/base-component';
|
|
4
|
+
export declare namespace FormProps {
|
|
5
|
+
interface AnalyticsMetadata {
|
|
6
|
+
instanceIdentifier?: string;
|
|
7
|
+
flowType?: FlowType;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
3
10
|
export interface FormProps extends BaseComponentProps {
|
|
4
11
|
/**
|
|
5
12
|
* Specifies the main form content.
|
|
@@ -33,5 +40,12 @@ export interface FormProps extends BaseComponentProps {
|
|
|
33
40
|
* @deprecated You can safely remove this property as there is no longer any visual difference between `full-page` and `embedded` variants.
|
|
34
41
|
*/
|
|
35
42
|
variant?: 'full-page' | 'embedded';
|
|
43
|
+
/**
|
|
44
|
+
* Specifies additional analytics-related metadata.
|
|
45
|
+
* * `instanceIdentifier` - A unique string that identifies this component instance in your application.
|
|
46
|
+
* * `flowType` - Identifies the type of flow represented by the component.
|
|
47
|
+
* @analytics
|
|
48
|
+
*/
|
|
49
|
+
analyticsMetadata?: FormProps.AnalyticsMetadata;
|
|
36
50
|
}
|
|
37
51
|
//# sourceMappingURL=interfaces.d.ts.map
|
package/form/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/form/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,SAAU,SAAQ,kBAAkB;IACnD;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEnC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/form/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,yBAAiB,SAAS,CAAC;IACzB,UAAiB,iBAAiB;QAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC;KACrB;CACF;AAED,MAAM,WAAW,SAAU,SAAQ,kBAAkB;IACnD;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE1B;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEnC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC;IAEnC;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,SAAS,CAAC,iBAAiB,CAAC;CACjD"}
|
package/form/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/form/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport interface FormProps extends BaseComponentProps {\n /**\n * Specifies the main form content.\n */\n children?: React.ReactNode;\n\n /**\n * Specifies the form title and optional description. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Specifies a form-level validation message.\n */\n errorText?: React.ReactNode;\n\n /**\n * Provides a text alternative for the error icon in the error alert.\n * @i18n\n */\n errorIconAriaLabel?: string;\n\n /**\n * Specifies actions for the form. You should wrap action buttons in a [space between component](/components/space-between) with `direction=\"horizontal\"` and `size=\"xs\"`.\n */\n actions?: React.ReactNode;\n\n /**\n * Specifies left-aligned secondary actions for the form. Use a button dropdown if multiple actions are required.\n */\n secondaryActions?: React.ReactNode;\n\n /**\n * Specify a form variant with one of the following:\n * * `full-page` - Use this variant when the form contains the entire content of the page.\n * * `embedded` - Use this variant when the form doesn't occupy the full page.\n * @deprecated You can safely remove this property as there is no longer any visual difference between `full-page` and `embedded` variants.\n */\n variant?: 'full-page' | 'embedded';\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/form/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { FlowType } from '../internal/analytics/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\n\nexport namespace FormProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n flowType?: FlowType;\n }\n}\n\nexport interface FormProps extends BaseComponentProps {\n /**\n * Specifies the main form content.\n */\n children?: React.ReactNode;\n\n /**\n * Specifies the form title and optional description. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Specifies a form-level validation message.\n */\n errorText?: React.ReactNode;\n\n /**\n * Provides a text alternative for the error icon in the error alert.\n * @i18n\n */\n errorIconAriaLabel?: string;\n\n /**\n * Specifies actions for the form. You should wrap action buttons in a [space between component](/components/space-between) with `direction=\"horizontal\"` and `size=\"xs\"`.\n */\n actions?: React.ReactNode;\n\n /**\n * Specifies left-aligned secondary actions for the form. Use a button dropdown if multiple actions are required.\n */\n secondaryActions?: React.ReactNode;\n\n /**\n * Specify a form variant with one of the following:\n * * `full-page` - Use this variant when the form contains the entire content of the page.\n * * `embedded` - Use this variant when the form doesn't occupy the full page.\n * @deprecated You can safely remove this property as there is no longer any visual difference between `full-page` and `embedded` variants.\n */\n variant?: 'full-page' | 'embedded';\n\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * * `flowType` - Identifies the type of flow represented by the component.\n * @analytics\n */\n analyticsMetadata?: FormProps.AnalyticsMetadata;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/help-panel/implementation.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../../../src/help-panel/implementation.tsx"],"names":[],"mappings":";AAUA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAGlF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAI9C,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG,0BAA0B,CAAC;AAEjF,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,MAAM,EACN,QAAQ,EACR,OAAO,EACP,WAAW,EACX,iBAAiB,EACjB,GAAG,SAAS,EACb,EAAE,sBAAsB,eAsBxB;AAED,eAAO,MAAM,yBAAyB,yFAAqD,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { __rest } from "tslib";
|
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
|
-
import {
|
|
6
|
+
import { isAppLayoutToolbarEnabled } from '../app-layout/utils/feature-flags';
|
|
7
7
|
import { useInternalI18n } from '../i18n/context';
|
|
8
8
|
import { getBaseProps } from '../internal/base-component';
|
|
9
9
|
import LiveRegion from '../internal/components/live-region';
|
|
@@ -15,8 +15,7 @@ export function HelpPanelImplementation(_a) {
|
|
|
15
15
|
var { header, footer, children, loading, loadingText, __internalRootRef } = _a, restProps = __rest(_a, ["header", "footer", "children", "loading", "loadingText", "__internalRootRef"]);
|
|
16
16
|
const baseProps = getBaseProps(restProps);
|
|
17
17
|
const i18n = useInternalI18n('help-panel');
|
|
18
|
-
const
|
|
19
|
-
const containerProps = Object.assign(Object.assign({}, baseProps), { className: clsx(baseProps.className, styles['help-panel'], hasToolbar && styles['with-toolbar']) });
|
|
18
|
+
const containerProps = Object.assign(Object.assign({}, baseProps), { className: clsx(baseProps.className, styles['help-panel'], isAppLayoutToolbarEnabled() && styles['with-toolbar']) });
|
|
20
19
|
return loading ? (React.createElement("div", Object.assign({}, containerProps, { ref: __internalRootRef }),
|
|
21
20
|
React.createElement(InternalStatusIndicator, { type: "loading" },
|
|
22
21
|
React.createElement(LiveRegion, { visible: true }, i18n('loadingText', loadingText))))) : (React.createElement("div", Object.assign({}, containerProps, { ref: __internalRootRef }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/help-panel/implementation.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"implementation.js","sourceRoot":"","sources":["../../../src/help-panel/implementation.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,UAAU,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kDAAkD,CAAC;AAE7F,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,uBAAuB,MAAM,8BAA8B,CAAC;AAGnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,UAAU,uBAAuB,CAAC,EAQf;QARe,EACtC,MAAM,EACN,MAAM,EACN,QAAQ,EACR,OAAO,EACP,WAAW,EACX,iBAAiB,OAEM,EADpB,SAAS,cAP0B,+EAQvC,CADa;IAEZ,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;IAC1C,MAAM,IAAI,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;IAC3C,MAAM,cAAc,mCACf,SAAS,KACZ,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE,yBAAyB,EAAE,IAAI,MAAM,CAAC,cAAc,CAAC,CAAC,GAClH,CAAC;IACF,OAAO,OAAO,CAAC,CAAC,CAAC,CACf,6CAAS,cAAc,IAAE,GAAG,EAAE,iBAAiB;QAC7C,oBAAC,uBAAuB,IAAC,IAAI,EAAC,SAAS;YACrC,oBAAC,UAAU,IAAC,OAAO,EAAE,IAAI,IAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAc,CAClD,CACtB,CACP,CAAC,CAAC,CAAC,CACF,6CAAS,cAAc,IAAE,GAAG,EAAE,iBAAiB;QAC5C,MAAM,IAAI,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAG,MAAM,CAAO;QAC9D,oBAAC,yBAAyB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE;YACtE,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO,IAAG,QAAQ,CAAO,CACb;QACpC,MAAM,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,IAAG,MAAM,CAAO,CACpD,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,yBAAyB,GAAG,yBAAyB,CAAC,uBAAuB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { isAppLayoutToolbarEnabled } from '../app-layout/utils/feature-flags';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport LiveRegion from '../internal/components/live-region';\nimport { LinkDefaultVariantContext } from '../internal/context/link-default-variant-context';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { createWidgetizedComponent } from '../internal/widgets';\nimport InternalStatusIndicator from '../status-indicator/internal';\nimport { HelpPanelProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\nexport type HelpPanelInternalProps = HelpPanelProps & InternalBaseComponentProps;\n\nexport function HelpPanelImplementation({\n header,\n footer,\n children,\n loading,\n loadingText,\n __internalRootRef,\n ...restProps\n}: HelpPanelInternalProps) {\n const baseProps = getBaseProps(restProps);\n const i18n = useInternalI18n('help-panel');\n const containerProps = {\n ...baseProps,\n className: clsx(baseProps.className, styles['help-panel'], isAppLayoutToolbarEnabled() && styles['with-toolbar']),\n };\n return loading ? (\n <div {...containerProps} ref={__internalRootRef}>\n <InternalStatusIndicator type=\"loading\">\n <LiveRegion visible={true}>{i18n('loadingText', loadingText)}</LiveRegion>\n </InternalStatusIndicator>\n </div>\n ) : (\n <div {...containerProps} ref={__internalRootRef}>\n {header && <div className={clsx(styles.header)}>{header}</div>}\n <LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>\n <div className={styles.content}>{children}</div>\n </LinkDefaultVariantContext.Provider>\n {footer && <div className={styles.footer}>{footer}</div>}\n </div>\n );\n}\n\nexport const createWidgetizedHelpPanel = createWidgetizedComponent(HelpPanelImplementation);\n"]}
|
|
@@ -42,7 +42,7 @@ export declare const useFunnel: () => {
|
|
|
42
42
|
funnelInteractionId: string | undefined;
|
|
43
43
|
funnelIdentifier?: string | undefined;
|
|
44
44
|
funnelErrorContext?: string | undefined;
|
|
45
|
-
funnelFlowType?: "create" |
|
|
45
|
+
funnelFlowType?: "create" | undefined;
|
|
46
46
|
funnelType: import("../interfaces").FunnelType;
|
|
47
47
|
funnelNameSelector: string;
|
|
48
48
|
optionalStepNumbers: number[];
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
export type FunnelType = 'single-page' | 'multi-page';
|
|
2
|
+
export type FlowType = 'create';
|
|
2
3
|
export interface AnalyticsMetadata {
|
|
3
4
|
instanceIdentifier?: string;
|
|
4
|
-
flowType?:
|
|
5
|
+
flowType?: FlowType;
|
|
5
6
|
errorContext?: string;
|
|
6
7
|
}
|
|
7
8
|
export interface BaseFunnelProps {
|
|
8
|
-
funnelIdentifier?:
|
|
9
|
+
funnelIdentifier?: string;
|
|
9
10
|
funnelInteractionId: string;
|
|
10
11
|
currentDocument?: Document;
|
|
11
12
|
}
|
|
12
13
|
export interface FunnelErrorProps extends BaseFunnelProps {
|
|
13
|
-
funnelErrorContext?:
|
|
14
|
+
funnelErrorContext?: string;
|
|
14
15
|
}
|
|
15
16
|
export interface FunnelStartProps extends Omit<BaseFunnelProps, 'funnelInteractionId'> {
|
|
16
|
-
flowType?:
|
|
17
|
+
flowType?: FlowType;
|
|
17
18
|
funnelNameSelector: string;
|
|
18
19
|
totalFunnelSteps: number;
|
|
19
20
|
optionalStepNumbers: number[];
|
|
@@ -36,7 +37,7 @@ export interface TableInteractionProps {
|
|
|
36
37
|
export type TableInteractionMethod = (props: TableInteractionProps) => void;
|
|
37
38
|
export type FunnelStartMethod = (props: FunnelStartProps) => string;
|
|
38
39
|
export interface FunnelStepProps extends BaseFunnelProps {
|
|
39
|
-
stepIdentifier?:
|
|
40
|
+
stepIdentifier?: string;
|
|
40
41
|
stepNumber: number;
|
|
41
42
|
stepName?: string | undefined;
|
|
42
43
|
stepNameSelector?: string;
|
|
@@ -50,27 +51,27 @@ export interface FunnelStepNavigationProps extends FunnelStepProps {
|
|
|
50
51
|
totalSubSteps?: number;
|
|
51
52
|
}
|
|
52
53
|
export interface FunnelStepErrorProps extends FunnelStepProps {
|
|
53
|
-
stepErrorContext?:
|
|
54
|
+
stepErrorContext?: string;
|
|
54
55
|
stepErrorSelector: string;
|
|
55
56
|
}
|
|
56
57
|
export interface FunnelSubStepProps extends FunnelStepProps {
|
|
57
|
-
subStepIdentifier?:
|
|
58
|
+
subStepIdentifier?: string;
|
|
58
59
|
subStepSelector: string;
|
|
59
60
|
subStepName?: string | undefined;
|
|
60
61
|
subStepNameSelector: string;
|
|
61
62
|
subStepNumber?: number;
|
|
62
63
|
}
|
|
63
64
|
export interface FunnelSubStepErrorProps extends FunnelSubStepProps {
|
|
64
|
-
subStepErrorContext?:
|
|
65
|
-
fieldIdentifier?:
|
|
66
|
-
fieldErrorContext?:
|
|
65
|
+
subStepErrorContext?: string;
|
|
66
|
+
fieldIdentifier?: string;
|
|
67
|
+
fieldErrorContext?: string;
|
|
67
68
|
fieldLabelSelector: string;
|
|
68
69
|
fieldErrorSelector: string;
|
|
69
70
|
}
|
|
70
71
|
export interface OptionalFunnelSubStepErrorProps extends FunnelSubStepProps {
|
|
71
|
-
subStepErrorContext?:
|
|
72
|
-
fieldIdentifier?:
|
|
73
|
-
fieldErrorContext?:
|
|
72
|
+
subStepErrorContext?: string;
|
|
73
|
+
fieldIdentifier?: string;
|
|
74
|
+
fieldErrorContext?: string;
|
|
74
75
|
fieldLabelSelector?: string;
|
|
75
76
|
fieldErrorSelector?: string;
|
|
76
77
|
}
|
|
@@ -84,12 +85,12 @@ export interface StepConfiguration {
|
|
|
84
85
|
number: number;
|
|
85
86
|
name: string;
|
|
86
87
|
isOptional: boolean;
|
|
87
|
-
stepIdentifier?:
|
|
88
|
+
stepIdentifier?: string;
|
|
88
89
|
}
|
|
89
90
|
export interface SubStepConfiguration {
|
|
90
91
|
number: number;
|
|
91
92
|
name: string;
|
|
92
|
-
subStepIdentifier?:
|
|
93
|
+
subStepIdentifier?: string;
|
|
93
94
|
}
|
|
94
95
|
export interface IFunnelMetrics {
|
|
95
96
|
funnelStart: FunnelStartMethod;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/internal/analytics/interfaces.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,YAAY,CAAC;AACtD,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/internal/analytics/interfaces.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,YAAY,CAAC;AACtD,MAAM,MAAM,QAAQ,GAAG,QAAQ,CAAC;AAChC,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAGD,MAAM,WAAW,eAAe;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,QAAQ,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,eAAe,EAAE,qBAAqB,CAAC;IACpF,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACxC,UAAU,EAAE,UAAU,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAGD,MAAM,MAAM,YAAY,CAAC,CAAC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AC/C,YAAY,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAE9C,eAAe,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;IAC/C,kBAAkB,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;IAClD,oBAAoB,EAAE,YAAY,CAAC,yBAAyB,CAAC,CAAC;IAC9D,eAAe,EAAE,YAAY,CAAC,oBAAoB,CAAC,CAAC;IACpD,gBAAgB,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;IAEhD,kBAAkB,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACrD,qBAAqB,EAAE,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACxD,kBAAkB,EAAE,YAAY,CAAC,+BAA+B,CAAC,CAAC;IAElE,mBAAmB,EAAE,YAAY,CAAC,0BAA0B,CAAC,CAAC;IAC9D,sBAAsB,EAAE,YAAY,CAAC,0BAA0B,CAAC,CAAC;CAClE;AAED,MAAM,WAAW,mBAAmB;IAClC,gBAAgB,EAAE,sBAAsB,CAAC;CAC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/internal/analytics/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 type FunnelType = 'single-page' | 'multi-page';\nexport interface AnalyticsMetadata {\n instanceIdentifier?: string;\n flowType?:
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/internal/analytics/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 type FunnelType = 'single-page' | 'multi-page';\nexport type FlowType = 'create';\nexport interface AnalyticsMetadata {\n instanceIdentifier?: string;\n flowType?: FlowType;\n errorContext?: string;\n}\n\n// Common properties for all funnels\nexport interface BaseFunnelProps {\n funnelIdentifier?: string;\n funnelInteractionId: string;\n currentDocument?: Document;\n}\n\nexport interface FunnelErrorProps extends BaseFunnelProps {\n funnelErrorContext?: string;\n}\n\nexport interface FunnelStartProps extends Omit<BaseFunnelProps, 'funnelInteractionId'> {\n flowType?: FlowType;\n funnelNameSelector: string;\n totalFunnelSteps: number;\n optionalStepNumbers: number[];\n stepConfiguration?: StepConfiguration[];\n funnelType: FunnelType;\n funnelVersion: string;\n componentVersion: string;\n componentTheme: string;\n funnelInteractionId?: string;\n}\n\n// A function type for a generic funnel method\nexport type FunnelMethod<T extends BaseFunnelProps> = (props: T) => void;\n\n// Interface for table interaction method props\nexport interface TableInteractionProps {\n // Time to render table in either no data state or with data after user actions like filtering, pagination.\n // in milliseconds\n interactionTime: number;\n // User action like sorting, filtering, pagination which triggered new data load in table.\n userAction: string;\n // Unique instance identifier for the component.\n // Default: ''\n instanceIdentifier?: string;\n // Component identifier like table header which can be used to identify the table\n // Default: ''\n componentIdentifier?: string;\n // Number of resources in table after user action\n // Default: 0\n noOfResourcesInTable?: number;\n // Additional metadata related to user interaction\n interactionMetadata?: string;\n}\n\nexport type TableInteractionMethod = (props: TableInteractionProps) => void;\n\n// A function type specifically for funnelStart\nexport type FunnelStartMethod = (props: FunnelStartProps) => string;\n\n// Define individual method props by extending the base\nexport interface FunnelStepProps extends BaseFunnelProps {\n stepIdentifier?: string;\n stepNumber: number;\n stepName?: string | undefined;\n stepNameSelector?: string;\n subStepAllSelector: string;\n totalSubSteps?: number;\n subStepConfiguration?: SubStepConfiguration[];\n}\n\nexport interface FunnelStepNavigationProps extends FunnelStepProps {\n destinationStepNumber: number;\n navigationType: string;\n totalSubSteps?: number;\n}\n\nexport interface FunnelStepErrorProps extends FunnelStepProps {\n stepErrorContext?: string;\n stepErrorSelector: string;\n}\n\nexport interface FunnelSubStepProps extends FunnelStepProps {\n subStepIdentifier?: string;\n subStepSelector: string;\n subStepName?: string | undefined;\n subStepNameSelector: string;\n subStepNumber?: number;\n}\n\nexport interface FunnelSubStepErrorProps extends FunnelSubStepProps {\n subStepErrorContext?: string;\n fieldIdentifier?: string;\n fieldErrorContext?: string;\n fieldLabelSelector: string;\n fieldErrorSelector: string;\n}\n\nexport interface OptionalFunnelSubStepErrorProps extends FunnelSubStepProps {\n subStepErrorContext?: string;\n fieldIdentifier?: string;\n fieldErrorContext?: string;\n fieldLabelSelector?: string;\n fieldErrorSelector?: string;\n}\n\nexport interface FunnelLinkInteractionProps extends FunnelSubStepProps {\n elementSelector: string;\n}\n\nexport interface FunnelChangeProps extends BaseFunnelProps {\n stepConfiguration: StepConfiguration[];\n}\n\nexport interface StepConfiguration {\n number: number;\n name: string;\n isOptional: boolean;\n stepIdentifier?: string;\n}\n\nexport interface SubStepConfiguration {\n number: number;\n name: string;\n subStepIdentifier?: string;\n}\n\n// Define the interface using the method type\nexport interface IFunnelMetrics {\n funnelStart: FunnelStartMethod;\n funnelError: FunnelMethod<FunnelErrorProps>;\n funnelComplete: FunnelMethod<BaseFunnelProps>;\n funnelSuccessful: FunnelMethod<BaseFunnelProps>;\n funnelCancelled: FunnelMethod<BaseFunnelProps>;\n funnelChange: FunnelMethod<FunnelChangeProps>;\n\n funnelStepStart: FunnelMethod<FunnelStepProps>;\n funnelStepComplete: FunnelMethod<FunnelStepProps>;\n funnelStepNavigation: FunnelMethod<FunnelStepNavigationProps>;\n funnelStepError: FunnelMethod<FunnelStepErrorProps>;\n funnelStepChange: FunnelMethod<FunnelStepProps>;\n\n funnelSubStepStart: FunnelMethod<FunnelSubStepProps>;\n funnelSubStepComplete: FunnelMethod<FunnelSubStepProps>;\n funnelSubStepError: FunnelMethod<OptionalFunnelSubStepErrorProps>;\n\n helpPanelInteracted: FunnelMethod<FunnelLinkInteractionProps>;\n externalLinkInteracted: FunnelMethod<FunnelLinkInteractionProps>;\n}\n\nexport interface IPerformanceMetrics {\n tableInteraction: TableInteractionMethod;\n}\n"]}
|
|
@@ -16,7 +16,16 @@ export interface BaseComponentProps {
|
|
|
16
16
|
}
|
|
17
17
|
export declare function getBaseProps(props: BaseComponentProps): BaseComponentProps;
|
|
18
18
|
export interface BasePropsWithAnalyticsMetadata {
|
|
19
|
+
analyticsMetadata?: AnalyticsMetadata;
|
|
19
20
|
__analyticsMetadata?: AnalyticsMetadata;
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Helper function to merge beta analytics metadata with the public analytics metadata api.
|
|
24
|
+
* Beta analytics metadata will override the public values to allow for safe migration.
|
|
25
|
+
*/
|
|
26
|
+
export declare function getAnalyticsMetadataProps(props?: BasePropsWithAnalyticsMetadata): {
|
|
27
|
+
instanceIdentifier?: string | undefined;
|
|
28
|
+
flowType?: "create" | undefined;
|
|
29
|
+
errorContext?: string | undefined;
|
|
30
|
+
};
|
|
22
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/internal/base-component/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,iBAAiB,CAAC;AAIzB,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CAIb;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,kBAAkB,sBAQrD;AAED,MAAM,WAAW,8BAA8B;IAC7C,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;CACzC;AAED,wBAAgB,yBAAyB,CAAC,KAAK,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/internal/base-component/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAI5D,OAAO,iBAAiB,CAAC;AAIzB,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CAIb;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,kBAAkB,sBAQrD;AAED,MAAM,WAAW,8BAA8B;IAC7C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,mBAAmB,CAAC,EAAE,iBAAiB,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,CAAC,EAAE,8BAA8B;;;;EAE/E"}
|
|
@@ -14,7 +14,11 @@ export function getBaseProps(props) {
|
|
|
14
14
|
});
|
|
15
15
|
return baseProps;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Helper function to merge beta analytics metadata with the public analytics metadata api.
|
|
19
|
+
* Beta analytics metadata will override the public values to allow for safe migration.
|
|
20
|
+
*/
|
|
17
21
|
export function getAnalyticsMetadataProps(props) {
|
|
18
|
-
return props === null || props === void 0 ? void 0 : props.__analyticsMetadata;
|
|
22
|
+
return Object.assign(Object.assign({}, props === null || props === void 0 ? void 0 : props.analyticsMetadata), props === null || props === void 0 ? void 0 : props.__analyticsMetadata);
|
|
19
23
|
}
|
|
20
24
|
//# sourceMappingURL=index.js.map
|