@cloudscape-design/components 3.0.1175 → 3.0.1177
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/internal/base-component/styles.scoped.css +1 -1
- package/internal/do-not-use/feature-prompt/index.d.ts +5 -0
- package/internal/do-not-use/feature-prompt/index.d.ts.map +1 -0
- package/internal/do-not-use/feature-prompt/index.js +15 -0
- package/internal/do-not-use/feature-prompt/index.js.map +1 -0
- package/internal/do-not-use/feature-prompt/interfaces.d.ts +68 -0
- package/internal/do-not-use/feature-prompt/interfaces.d.ts.map +1 -0
- package/internal/do-not-use/feature-prompt/interfaces.js +4 -0
- package/internal/do-not-use/feature-prompt/interfaces.js.map +1 -0
- package/internal/do-not-use/feature-prompt/internal.d.ts +7 -0
- package/internal/do-not-use/feature-prompt/internal.d.ts.map +1 -0
- package/internal/do-not-use/feature-prompt/internal.js +43 -0
- package/internal/do-not-use/feature-prompt/internal.js.map +1 -0
- package/internal/do-not-use/feature-prompt/styles.css.js +4 -0
- package/internal/do-not-use/feature-prompt/styles.scoped.css +4 -0
- package/internal/do-not-use/feature-prompt/styles.selectors.js +5 -0
- package/internal/environment.js +2 -2
- package/internal/environment.json +2 -2
- package/internal/manifest.json +1 -1
- package/multiselect/analytics-metadata/interfaces.d.ts +1 -0
- package/multiselect/analytics-metadata/interfaces.d.ts.map +1 -1
- package/multiselect/analytics-metadata/interfaces.js.map +1 -1
- package/multiselect/index.d.ts.map +1 -1
- package/multiselect/index.js +5 -0
- package/multiselect/index.js.map +1 -1
- package/package.json +1 -1
- package/popover/body.d.ts +3 -12
- package/popover/body.d.ts.map +1 -1
- package/popover/body.js +4 -3
- package/popover/body.js.map +1 -1
- package/select/analytics-metadata/interfaces.d.ts +1 -0
- package/select/analytics-metadata/interfaces.d.ts.map +1 -1
- package/select/analytics-metadata/interfaces.js.map +1 -1
- package/select/index.d.ts.map +1 -1
- package/select/index.js +3 -0
- package/select/index.js.map +1 -1
- package/test-utils/dom/internal/feature-prompt.d.ts +7 -0
- package/test-utils/dom/internal/feature-prompt.js +20 -0
- package/test-utils/dom/internal/feature-prompt.js.map +1 -0
- package/test-utils/selectors/internal/feature-prompt.d.ts +7 -0
- package/test-utils/selectors/internal/feature-prompt.js +26 -0
- package/test-utils/selectors/internal/feature-prompt.js.map +1 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FeaturePromptProps } from './interfaces';
|
|
3
|
+
export { FeaturePromptProps };
|
|
4
|
+
declare const FeaturePrompt: React.ForwardRefExoticComponent<FeaturePromptProps & React.RefAttributes<FeaturePromptProps.Ref>>;
|
|
5
|
+
export default FeaturePrompt;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/do-not-use/feature-prompt/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B,QAAA,MAAM,aAAa,mGAYlB,CAAC;AAGF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import useBaseComponent from '../../hooks/use-base-component';
|
|
5
|
+
import { applyDisplayName } from '../../utils/apply-display-name';
|
|
6
|
+
import { getExternalProps } from '../../utils/external-props';
|
|
7
|
+
import InternalFeaturePrompt from './internal';
|
|
8
|
+
const FeaturePrompt = React.forwardRef(({ size = 'medium', position = 'top', ...rest }, ref) => {
|
|
9
|
+
const baseComponentProps = useBaseComponent('FeaturePrompt', { props: { size, position } });
|
|
10
|
+
const externalProps = getExternalProps(rest);
|
|
11
|
+
return (React.createElement(InternalFeaturePrompt, { ref: ref, size: size, position: position, ...externalProps, ...baseComponentProps }));
|
|
12
|
+
});
|
|
13
|
+
applyDisplayName(FeaturePrompt, 'FeaturePrompt');
|
|
14
|
+
export default FeaturePrompt;
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/do-not-use/feature-prompt/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,qBAAqB,MAAM,YAAY,CAAC;AAI/C,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CACpC,CACE,EAAE,IAAI,GAAG,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAE,GAAG,IAAI,EAAsB,EAClE,GAAsC,EACzB,EAAE;IACf,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;IAE5F,MAAM,aAAa,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,CACL,oBAAC,qBAAqB,IAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,KAAM,aAAa,KAAM,kBAAkB,GAAI,CAC/G,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;AACjD,eAAe,aAAa,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\n\nimport useBaseComponent from '../../hooks/use-base-component';\nimport { applyDisplayName } from '../../utils/apply-display-name';\nimport { getExternalProps } from '../../utils/external-props';\nimport { FeaturePromptProps } from './interfaces';\nimport InternalFeaturePrompt from './internal';\n\nexport { FeaturePromptProps };\n\nconst FeaturePrompt = React.forwardRef(\n (\n { size = 'medium', position = 'top', ...rest }: FeaturePromptProps,\n ref: React.Ref<FeaturePromptProps.Ref>\n ): JSX.Element => {\n const baseComponentProps = useBaseComponent('FeaturePrompt', { props: { size, position } });\n\n const externalProps = getExternalProps(rest);\n return (\n <InternalFeaturePrompt ref={ref} size={size} position={position} {...externalProps} {...baseComponentProps} />\n );\n }\n);\n\napplyDisplayName(FeaturePrompt, 'FeaturePrompt');\nexport default FeaturePrompt;\n"]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { PopoverProps } from '../../../popover/interfaces';
|
|
2
|
+
import { NonCancelableEventHandler } from '../../events';
|
|
3
|
+
export interface FeaturePromptProps {
|
|
4
|
+
/**
|
|
5
|
+
* Called when the feature prompt shows.
|
|
6
|
+
*/
|
|
7
|
+
onShow?: NonCancelableEventHandler<null>;
|
|
8
|
+
/**
|
|
9
|
+
* Called when a user closes the prompt by using the close icon button,
|
|
10
|
+
* clicking outside the prompt, shifting focus out of the prompt or pressing ESC.
|
|
11
|
+
*/
|
|
12
|
+
onDismiss?: NonCancelableEventHandler<null>;
|
|
13
|
+
/**
|
|
14
|
+
* Determines where the feature prompt is displayed when opened, relative to the trigger.
|
|
15
|
+
* If the feature prompt doesn't have enough space to open in this direction, it
|
|
16
|
+
* automatically chooses a better direction based on available space.
|
|
17
|
+
*/
|
|
18
|
+
position?: FeaturePromptProps.Position;
|
|
19
|
+
/**
|
|
20
|
+
* Determines the maximum width for the feature prompt.
|
|
21
|
+
*/
|
|
22
|
+
size?: FeaturePromptProps.Size;
|
|
23
|
+
/**
|
|
24
|
+
* Specifies header content for the feature prompt.
|
|
25
|
+
*/
|
|
26
|
+
header: React.ReactNode;
|
|
27
|
+
/**
|
|
28
|
+
* Content of the feature prompt.
|
|
29
|
+
*/
|
|
30
|
+
content: React.ReactNode;
|
|
31
|
+
/**
|
|
32
|
+
* An object containing all the necessary localized strings required by the component.
|
|
33
|
+
* @i18n
|
|
34
|
+
*/
|
|
35
|
+
i18nStrings?: FeaturePromptProps.I18nStrings;
|
|
36
|
+
/**
|
|
37
|
+
* Function that returns the element to track for positioning the prompt.
|
|
38
|
+
* Use this when you want to position the prompt relative to an external element.
|
|
39
|
+
* Cannot be used together with the children prop.
|
|
40
|
+
*/
|
|
41
|
+
getTrack: () => null | HTMLElement | SVGElement;
|
|
42
|
+
/**
|
|
43
|
+
* Unique identifier for the tracked element. Used for tracking position changes
|
|
44
|
+
* when using getTrack.
|
|
45
|
+
*/
|
|
46
|
+
trackKey?: string | number;
|
|
47
|
+
}
|
|
48
|
+
export declare namespace FeaturePromptProps {
|
|
49
|
+
type Position = PopoverProps.Position;
|
|
50
|
+
type Size = PopoverProps.Size;
|
|
51
|
+
interface I18nStrings {
|
|
52
|
+
/**
|
|
53
|
+
* Adds an `aria-label` to the dismiss button for accessibility.
|
|
54
|
+
* @i18n
|
|
55
|
+
*/
|
|
56
|
+
dismissAriaLabel?: string;
|
|
57
|
+
}
|
|
58
|
+
interface Ref {
|
|
59
|
+
/**
|
|
60
|
+
* Use only if an element other than the trigger needs to be focused after dismissing the prompt.
|
|
61
|
+
*/
|
|
62
|
+
dismiss(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Shows the prompt and focuses its close button.
|
|
65
|
+
*/
|
|
66
|
+
show(): void;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/do-not-use/feature-prompt/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAEzC;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC,IAAI,CAAC,CAAC;IAE5C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC;IAEvC;;OAEG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC;IAE/B;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;;OAGG;IACH,WAAW,CAAC,EAAE,kBAAkB,CAAC,WAAW,CAAC;IAE7C;;;;OAIG;IACH,QAAQ,EAAE,MAAM,IAAI,GAAG,WAAW,GAAG,UAAU,CAAC;IAEhD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAED,yBAAiB,kBAAkB,CAAC;IAClC,KAAY,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC;IAC7C,KAAY,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;IACrC,UAAiB,WAAW;QAC1B;;;WAGG;QACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B;IACD,UAAiB,GAAG;QAClB;;WAEG;QACH,OAAO,IAAI,IAAI,CAAC;QAEhB;;WAEG;QACH,IAAI,IAAI,IAAI,CAAC;KACd;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/do-not-use/feature-prompt/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\nimport { PopoverProps } from '../../../popover/interfaces';\nimport { NonCancelableEventHandler } from '../../events';\n\nexport interface FeaturePromptProps {\n /**\n * Called when the feature prompt shows.\n */\n onShow?: NonCancelableEventHandler<null>;\n\n /**\n * Called when a user closes the prompt by using the close icon button,\n * clicking outside the prompt, shifting focus out of the prompt or pressing ESC.\n */\n onDismiss?: NonCancelableEventHandler<null>;\n\n /**\n * Determines where the feature prompt is displayed when opened, relative to the trigger.\n * If the feature prompt doesn't have enough space to open in this direction, it\n * automatically chooses a better direction based on available space.\n */\n position?: FeaturePromptProps.Position;\n\n /**\n * Determines the maximum width for the feature prompt.\n */\n size?: FeaturePromptProps.Size;\n\n /**\n * Specifies header content for the feature prompt.\n */\n header: React.ReactNode;\n\n /**\n * Content of the feature prompt.\n */\n content: React.ReactNode;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: FeaturePromptProps.I18nStrings;\n\n /**\n * Function that returns the element to track for positioning the prompt.\n * Use this when you want to position the prompt relative to an external element.\n * Cannot be used together with the children prop.\n */\n getTrack: () => null | HTMLElement | SVGElement;\n\n /**\n * Unique identifier for the tracked element. Used for tracking position changes\n * when using getTrack.\n */\n trackKey?: string | number;\n}\n\nexport namespace FeaturePromptProps {\n export type Position = PopoverProps.Position;\n export type Size = PopoverProps.Size;\n export interface I18nStrings {\n /**\n * Adds an `aria-label` to the dismiss button for accessibility.\n * @i18n\n */\n dismissAriaLabel?: string;\n }\n export interface Ref {\n /**\n * Use only if an element other than the trigger needs to be focused after dismissing the prompt.\n */\n dismiss(): void;\n\n /**\n * Shows the prompt and focuses its close button.\n */\n show(): void;\n }\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InternalBaseComponentProps } from '../../hooks/use-base-component';
|
|
3
|
+
import { SomeRequired } from '../../types';
|
|
4
|
+
import { FeaturePromptProps } from './interfaces';
|
|
5
|
+
interface InternalFeaturePromptProps extends SomeRequired<FeaturePromptProps, 'size' | 'position'>, InternalBaseComponentProps {}
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<InternalFeaturePromptProps & React.RefAttributes<FeaturePromptProps.Ref>>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../../src/internal/do-not-use/feature-prompt/internal.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAgD,MAAM,OAAO,CAAC;AAUrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAIlD,UAAU,0BACR,SAAQ,YAAY,CAAC,kBAAkB,EAAE,MAAM,GAAG,UAAU,CAAC,EAC3D,0BAA0B;CAAG;;AAgFjC,wBAAuD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React, { useImperativeHandle, useRef, useState } from 'react';
|
|
4
|
+
import { Portal } from '@cloudscape-design/component-toolkit/internal';
|
|
5
|
+
import Arrow from '../../../popover/arrow';
|
|
6
|
+
import PopoverBody from '../../../popover/body';
|
|
7
|
+
import PopoverContainer from '../../../popover/container';
|
|
8
|
+
import { getBaseProps } from '../../base-component';
|
|
9
|
+
import ResetContextsForModal from '../../context/reset-contexts-for-modal';
|
|
10
|
+
import { fireNonCancelableEvent } from '../../events';
|
|
11
|
+
import styles from './styles.css.js';
|
|
12
|
+
function InternalFeaturePrompt({ onShow, onDismiss, header, content, i18nStrings, size, position, getTrack, trackKey, __internalRootRef, ...restProps }, ref) {
|
|
13
|
+
const baseProps = getBaseProps(restProps);
|
|
14
|
+
const [show, setShow] = useState(false);
|
|
15
|
+
const popoverBodyRef = useRef(null);
|
|
16
|
+
useImperativeHandle(ref, () => ({
|
|
17
|
+
dismiss: () => {
|
|
18
|
+
setShow(false);
|
|
19
|
+
fireNonCancelableEvent(onDismiss);
|
|
20
|
+
},
|
|
21
|
+
show: () => {
|
|
22
|
+
setShow(true);
|
|
23
|
+
fireNonCancelableEvent(onShow);
|
|
24
|
+
},
|
|
25
|
+
}));
|
|
26
|
+
return (React.createElement("span", { ...baseProps, className: styles.root, ref: __internalRootRef }, show && (React.createElement(Portal, null,
|
|
27
|
+
React.createElement(ResetContextsForModal, null,
|
|
28
|
+
React.createElement(PopoverContainer, { size: size, fixedWidth: false, position: position, getTrack: getTrack, trackKey: trackKey, variant: "annotation", arrow: position => React.createElement(Arrow, { position: position, variant: "info" }), zIndex: 7000, renderWithPortal: true },
|
|
29
|
+
React.createElement(PopoverBody, { ref: popoverBodyRef, dismissButton: true, dismissAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.dismissAriaLabel, header: header, onDismiss: () => {
|
|
30
|
+
setShow(false);
|
|
31
|
+
fireNonCancelableEvent(onDismiss);
|
|
32
|
+
}, variant: "annotation", overflowVisible: "content", onBlur: event => {
|
|
33
|
+
var _a;
|
|
34
|
+
const relatedTarget = event.relatedTarget;
|
|
35
|
+
if (relatedTarget && ((_a = popoverBodyRef.current) === null || _a === void 0 ? void 0 : _a.contains(relatedTarget))) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
setShow(false);
|
|
39
|
+
fireNonCancelableEvent(onDismiss);
|
|
40
|
+
} }, content)))))));
|
|
41
|
+
}
|
|
42
|
+
export default React.forwardRef(InternalFeaturePrompt);
|
|
43
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../../../src/internal/do-not-use/feature-prompt/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErE,OAAO,EAAE,MAAM,EAA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B,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAC,YAAY,EACpB,KAAK,EAAE,QAAQ,CAAC,EAAE,CAAC,oBAAC,KAAK,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAC,MAAM,GAAG,EAC/D,MAAM,EAAE,IAAI,EACZ,gBAAgB,EAAE,IAAI;gBAEtB,oBAAC,WAAW,IACV,GAAG,EAAE,cAAc,EACnB,aAAa,EAAE,IAAI,EACnB,gBAAgB,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,gBAAgB,EAC/C,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,GAAG,EAAE;wBACd,OAAO,CAAC,KAAK,CAAC,CAAC;wBACf,sBAAsB,CAAC,SAAS,CAAC,CAAC;oBACpC,CAAC,EACD,OAAO,EAAC,YAAY,EACpB,eAAe,EAAC,SAAS,EACzB,MAAM,EAAE,KAAK,CAAC,EAAE;;wBACd,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;wBAC1C,IAAI,aAAa,KAAI,MAAA,cAAc,CAAC,OAAO,0CAAE,QAAQ,CAAC,aAAa,CAAC,CAAA,EAAE,CAAC;4BACrE,OAAO;wBACT,CAAC;wBACD,OAAO,CAAC,KAAK,CAAC,CAAC;wBACf,sBAAsB,CAAC,SAAS,CAAC,CAAC;oBACpC,CAAC,IAEA,OAAO,CACI,CACG,CACG,CACjB,CACV,CACI,CACR,CAAC;AACJ,CAAC;AAED,eAAe,KAAK,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useImperativeHandle, useRef, useState } from 'react';\n\nimport { Portal } from '@cloudscape-design/component-toolkit/internal';\n\nimport Arrow from '../../../popover/arrow';\nimport PopoverBody from '../../../popover/body';\nimport PopoverContainer from '../../../popover/container';\nimport { getBaseProps } from '../../base-component';\nimport ResetContextsForModal from '../../context/reset-contexts-for-modal';\nimport { fireNonCancelableEvent } from '../../events';\nimport { InternalBaseComponentProps } from '../../hooks/use-base-component';\nimport { SomeRequired } from '../../types';\nimport { FeaturePromptProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ninterface InternalFeaturePromptProps\n extends SomeRequired<FeaturePromptProps, 'size' | 'position'>,\n InternalBaseComponentProps {}\n\nfunction InternalFeaturePrompt(\n {\n onShow,\n onDismiss,\n header,\n content,\n i18nStrings,\n size,\n position,\n getTrack,\n trackKey,\n __internalRootRef,\n ...restProps\n }: InternalFeaturePromptProps,\n ref: React.Ref<FeaturePromptProps.Ref>\n) {\n const baseProps = getBaseProps(restProps);\n const [show, setShow] = useState(false);\n\n const popoverBodyRef = useRef<HTMLDivElement | null>(null);\n\n useImperativeHandle(ref, () => ({\n dismiss: () => {\n setShow(false);\n fireNonCancelableEvent(onDismiss);\n },\n show: () => {\n setShow(true);\n fireNonCancelableEvent(onShow);\n },\n }));\n\n return (\n <span {...baseProps} className={styles.root} ref={__internalRootRef}>\n {show && (\n <Portal>\n <ResetContextsForModal>\n <PopoverContainer\n size={size}\n fixedWidth={false}\n position={position}\n getTrack={getTrack}\n trackKey={trackKey}\n variant=\"annotation\"\n arrow={position => <Arrow position={position} variant=\"info\" />}\n zIndex={7000}\n renderWithPortal={true}\n >\n <PopoverBody\n ref={popoverBodyRef}\n dismissButton={true}\n dismissAriaLabel={i18nStrings?.dismissAriaLabel}\n header={header}\n onDismiss={() => {\n setShow(false);\n fireNonCancelableEvent(onDismiss);\n }}\n variant=\"annotation\"\n overflowVisible=\"content\"\n onBlur={event => {\n const relatedTarget = event.relatedTarget;\n if (relatedTarget && popoverBodyRef.current?.contains(relatedTarget)) {\n return;\n }\n setShow(false);\n fireNonCancelableEvent(onDismiss);\n }}\n >\n {content}\n </PopoverBody>\n </PopoverContainer>\n </ResetContextsForModal>\n </Portal>\n )}\n </span>\n );\n}\n\nexport default React.forwardRef(InternalFeaturePrompt);\n"]}
|
package/internal/environment.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (3b033674)";
|
|
3
|
+
export var GIT_SHA = "3b033674";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "core";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
package/internal/manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/multiselect/analytics-metadata/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,+CAA+C,EAC/C,6CAA6C,EAC9C,MAAM,wEAAwE,CAAC;AAChF,OAAO,EAAE,8CAA8C,EAAE,MAAM,yEAAyE,CAAC;AACzI,OAAO,EACL,2CAA2C,EAC3C,2CAA2C,EAC5C,MAAM,oEAAoE,CAAC;AAE5E,MAAM,MAAM,2CAA2C,GAAG,8CAA8C,CAAC;AAEzG,MAAM,MAAM,2CAA2C,GAAG,6CAA6C,CAAC;AACxG,MAAM,MAAM,6CAA6C,GAAG,+CAA+C,CAAC;AAE5G,MAAM,MAAM,6CAA6C,GAAG,2CAA2C,CAAC;AACxG,MAAM,MAAM,6CAA6C,GAAG,2CAA2C,CAAC;AAExG,MAAM,WAAW,8CAA8C;IAC7D,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,qBAAqB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/multiselect/analytics-metadata/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,+CAA+C,EAC/C,6CAA6C,EAC9C,MAAM,wEAAwE,CAAC;AAChF,OAAO,EAAE,8CAA8C,EAAE,MAAM,yEAAyE,CAAC;AACzI,OAAO,EACL,2CAA2C,EAC3C,2CAA2C,EAC5C,MAAM,oEAAoE,CAAC;AAE5E,MAAM,MAAM,2CAA2C,GAAG,8CAA8C,CAAC;AAEzG,MAAM,MAAM,2CAA2C,GAAG,6CAA6C,CAAC;AACxG,MAAM,MAAM,6CAA6C,GAAG,+CAA+C,CAAC;AAE5G,MAAM,MAAM,6CAA6C,GAAG,2CAA2C,CAAC;AACxG,MAAM,MAAM,6CAA6C,GAAG,2CAA2C,CAAC;AAExG,MAAM,WAAW,8CAA8C;IAC7D,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,qBAAqB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACrC,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;KAChC,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/multiselect/analytics-metadata/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\nimport {\n GeneratedAnalyticsMetadataButtonTriggerCollapse,\n GeneratedAnalyticsMetadataButtonTriggerExpand,\n} from '../../internal/components/button-trigger/analytics-metadata/interfaces';\nimport { GeneratedAnalyticsMetadataSelectableItemSelect } from '../../internal/components/selectable-item/analytics-metadata/interfaces';\nimport {\n GeneratedAnalyticsMetadataTokenListShowLess,\n GeneratedAnalyticsMetadataTokenListShowMore,\n} from '../../internal/components/token-list/analytics-metadata/interfaces';\n\nexport type GeneratedAnalyticsMetadataMultiselectSelect = GeneratedAnalyticsMetadataSelectableItemSelect;\n\nexport type GeneratedAnalyticsMetadataMultiselectExpand = GeneratedAnalyticsMetadataButtonTriggerExpand;\nexport type GeneratedAnalyticsMetadataMultiselectCollapse = GeneratedAnalyticsMetadataButtonTriggerCollapse;\n\nexport type GeneratedAnalyticsMetadataMultiselectShowMore = GeneratedAnalyticsMetadataTokenListShowMore;\nexport type GeneratedAnalyticsMetadataMultiselectShowLess = GeneratedAnalyticsMetadataTokenListShowLess;\n\nexport interface GeneratedAnalyticsMetadataMultiselectComponent {\n name: 'awsui.Multiselect';\n label: string;\n properties: {\n disabled: string;\n selectedOptionsCount: string;\n selectedOptionsValues: Array<string>;\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/multiselect/analytics-metadata/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\nimport {\n GeneratedAnalyticsMetadataButtonTriggerCollapse,\n GeneratedAnalyticsMetadataButtonTriggerExpand,\n} from '../../internal/components/button-trigger/analytics-metadata/interfaces';\nimport { GeneratedAnalyticsMetadataSelectableItemSelect } from '../../internal/components/selectable-item/analytics-metadata/interfaces';\nimport {\n GeneratedAnalyticsMetadataTokenListShowLess,\n GeneratedAnalyticsMetadataTokenListShowMore,\n} from '../../internal/components/token-list/analytics-metadata/interfaces';\n\nexport type GeneratedAnalyticsMetadataMultiselectSelect = GeneratedAnalyticsMetadataSelectableItemSelect;\n\nexport type GeneratedAnalyticsMetadataMultiselectExpand = GeneratedAnalyticsMetadataButtonTriggerExpand;\nexport type GeneratedAnalyticsMetadataMultiselectCollapse = GeneratedAnalyticsMetadataButtonTriggerCollapse;\n\nexport type GeneratedAnalyticsMetadataMultiselectShowMore = GeneratedAnalyticsMetadataTokenListShowMore;\nexport type GeneratedAnalyticsMetadataMultiselectShowLess = GeneratedAnalyticsMetadataTokenListShowLess;\n\nexport interface GeneratedAnalyticsMetadataMultiselectComponent {\n name: 'awsui.Multiselect';\n label: string;\n properties: {\n disabled: string;\n selectedOptionsCount: string;\n selectedOptionsValues: Array<string>;\n selectedOptions: Array<string>;\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAKhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,QAAA,MAAM,WAAW,+FAkEhB,CAAC;AAGF,eAAe,WAAW,CAAC"}
|
package/multiselect/index.js
CHANGED
|
@@ -35,6 +35,11 @@ const Multiselect = React.forwardRef(({ options = [], filteringType = 'none', st
|
|
|
35
35
|
selectedOptionsValues: selectedOptions
|
|
36
36
|
.filter(option => option.value !== undefined)
|
|
37
37
|
.map(option => `${option.value}`),
|
|
38
|
+
selectedOptions: selectedOptions
|
|
39
|
+
.filter(option => option.value !== undefined)
|
|
40
|
+
// fallback on value when label's undefined because in the dropdown if there's no label
|
|
41
|
+
// the value will be shown.
|
|
42
|
+
.map(option => { var _a; return `${(_a = option.label) !== null && _a !== void 0 ? _a : option.value}`; }),
|
|
38
43
|
},
|
|
39
44
|
};
|
|
40
45
|
return (React.createElement(InternalMultiselect, { renderOption: renderOption, options: options, filteringType: filteringType, statusType: statusType, selectedOptions: selectedOptions, keepOpen: keepOpen, hideTokens: hideTokens, ...restProps, ...baseComponentProps, ref: ref, ...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata }) }));
|
package/multiselect/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/multiselect/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAGxE,OAAO,mBAAmB,MAAM,YAAY,CAAC;AAE7C,OAAO,+BAA+B,MAAM,wEAAwE,CAAC;AAIrH,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAClC,CACE,EACE,OAAO,GAAG,EAAE,EACZ,aAAa,GAAG,MAAM,EACtB,UAAU,GAAG,UAAU,EACvB,eAAe,GAAG,EAAE,EACpB,QAAQ,GAAG,IAAI,EACf,UAAU,GAAG,KAAK,EAClB,YAAY,EACZ,GAAG,SAAS,EACK,EACnB,GAAoC,EACpC,EAAE;IACF,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,aAAa,EAAE;QACzD,KAAK,EAAE;YACL,YAAY,EAAE,SAAS,CAAC,YAAY;YACpC,SAAS,EAAE,SAAS,CAAC,SAAS;YAC9B,gBAAgB,EAAE,SAAS,CAAC,gBAAgB;YAC5C,aAAa;YACb,UAAU;YACV,QAAQ;YACR,UAAU,EAAE,SAAS,CAAC,UAAU;YAChC,aAAa,EAAE,SAAS,CAAC,aAAa;YACtC,QAAQ,EAAE,SAAS,CAAC,QAAQ;YAC5B,eAAe,EAAE,SAAS,CAAC,eAAe;SAC3C;QACD,QAAQ,EAAE;YACR,cAAc,EAAE,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M,CAAC,KAAK,mCAAI,MAAM,CAAC,KAAK,EAAE,CAAA,EAAA,CAAC;SACpD;KACF,CAAC;IAEF,OAAO,CACL,oBAAC,mBAAmB,IAClB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,UAAU,KAClB,SAAS,KACT,kBAAkB,EACtB,GAAG,EAAE,GAAG,KACJ,6BAA6B,CAAC,EAAE,SAAS,EAAE,0BAA0B,EAAE,CAAC,GAC5E,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;AAC7C,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { GeneratedAnalyticsMetadataMultiselectComponent } from './analytics-metadata/interfaces';\nimport { MultiselectProps } from './interfaces';\nimport InternalMultiselect from './internal';\n\nimport buttonTriggerAnalyticsSelectors from '../internal/components/button-trigger/analytics-metadata/styles.css.js';\n\nexport { MultiselectProps };\n\nconst Multiselect = React.forwardRef(\n (\n {\n options = [],\n filteringType = 'none',\n statusType = 'finished',\n selectedOptions = [],\n keepOpen = true,\n hideTokens = false,\n renderOption,\n ...restProps\n }: MultiselectProps,\n ref: React.Ref<MultiselectProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('Multiselect', {\n props: {\n inlineTokens: restProps.inlineTokens,\n autoFocus: restProps.autoFocus,\n expandToViewport: restProps.expandToViewport,\n filteringType,\n hideTokens,\n keepOpen,\n tokenLimit: restProps.tokenLimit,\n virtualScroll: restProps.virtualScroll,\n readOnly: restProps.readOnly,\n enableSelectAll: restProps.enableSelectAll,\n },\n metadata: {\n hasInlineLabel: Boolean(restProps.inlineLabelText),\n hasDisabledReasons: options.some(option => Boolean(option.disabledReason)),\n },\n });\n\n const componentAnalyticsMetadata: GeneratedAnalyticsMetadataMultiselectComponent = {\n name: 'awsui.Multiselect',\n label: `.${buttonTriggerAnalyticsSelectors['button-trigger']}`,\n properties: {\n disabled: `${!!restProps.disabled}`,\n selectedOptionsCount: `${selectedOptions.length}`,\n selectedOptionsValues: selectedOptions\n .filter(option => option.value !== undefined)\n .map(option => `${option.value}`),\n selectedOptions: selectedOptions\n .filter(option => option.value !== undefined)\n // fallback on value when label's undefined because in the dropdown if there's no label\n // the value will be shown.\n .map(option => `${option.label ?? option.value}`),\n },\n };\n\n return (\n <InternalMultiselect\n renderOption={renderOption}\n options={options}\n filteringType={filteringType}\n statusType={statusType}\n selectedOptions={selectedOptions}\n keepOpen={keepOpen}\n hideTokens={hideTokens}\n {...restProps}\n {...baseComponentProps}\n ref={ref}\n {...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })}\n />\n );\n }\n);\n\napplyDisplayName(Multiselect, 'Multiselect');\nexport default Multiselect;\n"]}
|
package/package.json
CHANGED
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"./internal/base-component/index.js",
|
|
159
159
|
"./internal/base-component/styles.css.js"
|
|
160
160
|
],
|
|
161
|
-
"version": "3.0.
|
|
161
|
+
"version": "3.0.1177",
|
|
162
162
|
"repository": {
|
|
163
163
|
"type": "git",
|
|
164
164
|
"url": "https://github.com/cloudscape-design/components.git"
|
package/popover/body.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export interface PopoverBodyProps {
|
|
|
3
3
|
dismissButton: boolean;
|
|
4
4
|
dismissAriaLabel: string | undefined;
|
|
5
5
|
onDismiss: (() => void) | undefined;
|
|
6
|
+
onBlur?: (event: React.FocusEvent) => void;
|
|
6
7
|
header: React.ReactNode | undefined;
|
|
7
8
|
children: React.ReactNode;
|
|
8
9
|
variant?: 'annotation' | 'chart';
|
|
@@ -11,15 +12,5 @@ export interface PopoverBodyProps {
|
|
|
11
12
|
ariaLabelledby?: string;
|
|
12
13
|
closeAnalyticsAction?: string;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
dismissAriaLabel,
|
|
17
|
-
header,
|
|
18
|
-
children,
|
|
19
|
-
onDismiss,
|
|
20
|
-
variant,
|
|
21
|
-
overflowVisible,
|
|
22
|
-
className,
|
|
23
|
-
ariaLabelledby,
|
|
24
|
-
closeAnalyticsAction
|
|
25
|
-
}: PopoverBodyProps): JSX.Element;
|
|
15
|
+
declare const PopoverBody: React.ForwardRefExoticComponent<PopoverBodyProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export default PopoverBody;
|
package/popover/body.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAe9D,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAyC,MAAM,OAAO,CAAC;AAe9D,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,SAAS,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IACpC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAE3C,MAAM,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC;IACjC,eAAe,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAErC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,QAAA,MAAM,WAAW,yFAoGhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
package/popover/body.js
CHANGED
|
@@ -10,7 +10,7 @@ import { useInternalI18n } from '../i18n/context';
|
|
|
10
10
|
import FocusLock from '../internal/components/focus-lock';
|
|
11
11
|
import { KeyCode } from '../internal/keycode';
|
|
12
12
|
import styles from './styles.css.js';
|
|
13
|
-
|
|
13
|
+
const PopoverBody = React.forwardRef(({ dismissButton: showDismissButton, dismissAriaLabel, header, children, onDismiss, onBlur, variant, overflowVisible, className, ariaLabelledby, closeAnalyticsAction, }, ref) => {
|
|
14
14
|
const i18n = useInternalI18n('popover');
|
|
15
15
|
const labelledById = useUniqueId('awsui-popover-');
|
|
16
16
|
const dismissButtonFocused = useRef(false);
|
|
@@ -43,7 +43,7 @@ export default function PopoverBody({ dismissButton: showDismissButton, dismissA
|
|
|
43
43
|
: {};
|
|
44
44
|
return (React.createElement("div", { className: clsx(styles.body, styles[`body-variant-${variant}`], className, {
|
|
45
45
|
[styles['body-overflow-visible']]: overflowVisible === 'both',
|
|
46
|
-
}), onKeyDown: onKeyDown, ...dialogProps },
|
|
46
|
+
}), onKeyDown: onKeyDown, ref: ref, onBlur: onBlur, ...dialogProps },
|
|
47
47
|
React.createElement(BuiltInErrorBoundary, null,
|
|
48
48
|
React.createElement(FocusLock, { disabled: !shouldTrapFocus, autoFocus: false },
|
|
49
49
|
header && (React.createElement("div", { className: clsx(styles['header-row'], showDismissButton && styles['has-dismiss']) },
|
|
@@ -53,5 +53,6 @@ export default function PopoverBody({ dismissButton: showDismissButton, dismissA
|
|
|
53
53
|
React.createElement("div", { className: !header && showDismissButton ? styles['has-dismiss'] : undefined },
|
|
54
54
|
!header && dismissButton,
|
|
55
55
|
React.createElement("div", { className: clsx(styles.content, { [styles['content-overflow-visible']]: !!overflowVisible }) }, children))))));
|
|
56
|
-
}
|
|
56
|
+
});
|
|
57
|
+
export default PopoverBody;
|
|
57
58
|
//# sourceMappingURL=body.js.map
|
package/popover/body.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAGjH,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,SAAS,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,OAAO,MAAM,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/popover/body.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+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zE,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,EAAE,eAAe,KAAK,MAAM;SAC9D,CAAC,EACF,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,MAAM,KACV,WAAW;QAEf,oBAAC,oBAAoB;YACnB,oBAAC,SAAS,IAAC,QAAQ,EAAE,CAAC,eAAe,EAAE,SAAS,EAAE,KAAK;gBACpD,MAAM,IAAI,CACT,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,iBAAiB,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;oBACnF,aAAa;oBACd,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE,YAAY;wBAC7C,gCAAK,MAAM,CAAM,CACb,CACF,CACP;gBACD,6BAAK,SAAS,EAAE,CAAC,MAAM,IAAI,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS;oBAC7E,CAAC,MAAM,IAAI,aAAa;oBACzB,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAC,CAAC,eAAe,EAAE,CAAC,IAC9F,QAAQ,CACL,CACF,CACI,CACS,CACnB,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useCallback, useEffect, useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport { BuiltInErrorBoundary } from '../error-boundary/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport FocusLock from '../internal/components/focus-lock';\nimport { KeyCode } from '../internal/keycode';\n\nimport styles from './styles.css.js';\n\nexport interface PopoverBodyProps {\n dismissButton: boolean;\n dismissAriaLabel: string | undefined;\n onDismiss: (() => void) | undefined;\n onBlur?: (event: React.FocusEvent) => void;\n\n header: React.ReactNode | undefined;\n children: React.ReactNode;\n variant?: 'annotation' | 'chart';\n overflowVisible?: 'content' | 'both';\n\n className?: string;\n ariaLabelledby?: string;\n\n closeAnalyticsAction?: string;\n}\n\nconst PopoverBody = React.forwardRef(\n (\n {\n dismissButton: showDismissButton,\n dismissAriaLabel,\n header,\n children,\n onDismiss,\n onBlur,\n variant,\n overflowVisible,\n className,\n ariaLabelledby,\n closeAnalyticsAction,\n }: PopoverBodyProps,\n ref: React.Ref<HTMLDivElement>\n ) => {\n const i18n = useInternalI18n('popover');\n const labelledById = useUniqueId('awsui-popover-');\n const dismissButtonFocused = useRef(false);\n const dismissButtonRef = useRef<ButtonProps.Ref>(null);\n\n const onKeyDown = useCallback(\n (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCode.escape) {\n event.stopPropagation();\n onDismiss?.();\n }\n },\n [onDismiss]\n );\n\n // Implement our own auto-focus rather than using FocusLock's,\n // because we also want to focus the dismiss button when it\n // is added dynamically (e.g. in chart popovers)\n useEffect(() => {\n if (showDismissButton && !dismissButtonFocused.current) {\n dismissButtonRef.current?.focus({ preventScroll: true });\n }\n dismissButtonFocused.current = showDismissButton;\n }, [showDismissButton]);\n\n const dismissButton = (showDismissButton ?? null) && (\n <div\n className={styles.dismiss}\n {...(closeAnalyticsAction ? getAnalyticsMetadataAttribute({ action: closeAnalyticsAction }) : {})}\n >\n <InternalButton\n variant=\"icon\"\n formAction=\"none\"\n iconName=\"close\"\n className={styles['dismiss-control']}\n ariaLabel={i18n('dismissAriaLabel', dismissAriaLabel)}\n onClick={() => onDismiss?.()}\n ref={dismissButtonRef}\n />\n </div>\n );\n\n const isDialog = showDismissButton;\n const shouldTrapFocus = showDismissButton && variant !== 'annotation';\n\n const dialogProps = isDialog\n ? {\n role: 'dialog',\n 'aria-labelledby': ariaLabelledby ?? (header ? labelledById : undefined),\n }\n : {};\n\n return (\n <div\n className={clsx(styles.body, styles[`body-variant-${variant}`], className, {\n [styles['body-overflow-visible']]: overflowVisible === 'both',\n })}\n onKeyDown={onKeyDown}\n ref={ref}\n onBlur={onBlur}\n {...dialogProps}\n >\n <BuiltInErrorBoundary>\n <FocusLock disabled={!shouldTrapFocus} autoFocus={false}>\n {header && (\n <div className={clsx(styles['header-row'], showDismissButton && styles['has-dismiss'])}>\n {dismissButton}\n <div className={styles.header} id={labelledById}>\n <h2>{header}</h2>\n </div>\n </div>\n )}\n <div className={!header && showDismissButton ? styles['has-dismiss'] : undefined}>\n {!header && dismissButton}\n <div className={clsx(styles.content, { [styles['content-overflow-visible']]: !!overflowVisible })}>\n {children}\n </div>\n </div>\n </FocusLock>\n </BuiltInErrorBoundary>\n </div>\n );\n }\n);\n\nexport default PopoverBody;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/select/analytics-metadata/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,+CAA+C,EAC/C,6CAA6C,EAC9C,MAAM,wEAAwE,CAAC;AAChF,OAAO,EAAE,8CAA8C,EAAE,MAAM,yEAAyE,CAAC;AAEzI,MAAM,MAAM,sCAAsC,GAAG,8CAA8C,CAAC;AAEpG,MAAM,MAAM,sCAAsC,GAAG,6CAA6C,CAAC;AACnG,MAAM,MAAM,wCAAwC,GAAG,+CAA+C,CAAC;AAEvG,MAAM,WAAW,yCAAyC;IACxD,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,mBAAmB,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/select/analytics-metadata/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,+CAA+C,EAC/C,6CAA6C,EAC9C,MAAM,wEAAwE,CAAC;AAChF,OAAO,EAAE,8CAA8C,EAAE,MAAM,yEAAyE,CAAC;AAEzI,MAAM,MAAM,sCAAsC,GAAG,8CAA8C,CAAC;AAEpG,MAAM,MAAM,sCAAsC,GAAG,6CAA6C,CAAC;AACnG,MAAM,MAAM,wCAAwC,GAAG,+CAA+C,CAAC;AAEvG,MAAM,WAAW,yCAAyC;IACxD,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/select/analytics-metadata/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\nimport {\n GeneratedAnalyticsMetadataButtonTriggerCollapse,\n GeneratedAnalyticsMetadataButtonTriggerExpand,\n} from '../../internal/components/button-trigger/analytics-metadata/interfaces';\nimport { GeneratedAnalyticsMetadataSelectableItemSelect } from '../../internal/components/selectable-item/analytics-metadata/interfaces';\n\nexport type GeneratedAnalyticsMetadataSelectSelect = GeneratedAnalyticsMetadataSelectableItemSelect;\n\nexport type GeneratedAnalyticsMetadataSelectExpand = GeneratedAnalyticsMetadataButtonTriggerExpand;\nexport type GeneratedAnalyticsMetadataSelectCollapse = GeneratedAnalyticsMetadataButtonTriggerCollapse;\n\nexport interface GeneratedAnalyticsMetadataSelectComponent {\n name: 'awsui.Select';\n label: string;\n properties: {\n disabled: string;\n selectedOptionValue: string;\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/select/analytics-metadata/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\nimport {\n GeneratedAnalyticsMetadataButtonTriggerCollapse,\n GeneratedAnalyticsMetadataButtonTriggerExpand,\n} from '../../internal/components/button-trigger/analytics-metadata/interfaces';\nimport { GeneratedAnalyticsMetadataSelectableItemSelect } from '../../internal/components/selectable-item/analytics-metadata/interfaces';\n\nexport type GeneratedAnalyticsMetadataSelectSelect = GeneratedAnalyticsMetadataSelectableItemSelect;\n\nexport type GeneratedAnalyticsMetadataSelectExpand = GeneratedAnalyticsMetadataButtonTriggerExpand;\nexport type GeneratedAnalyticsMetadataSelectCollapse = GeneratedAnalyticsMetadataButtonTriggerCollapse;\n\nexport interface GeneratedAnalyticsMetadataSelectComponent {\n name: 'awsui.Select';\n label: string;\n properties: {\n disabled: string;\n selectedOptionValue: string;\n selectedOption: string;\n };\n}\n"]}
|
package/select/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/select/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAE,WAAW,EAAE,CAAC;AAIvB,QAAA,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/select/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAE,WAAW,EAAE,CAAC;AAIvB,QAAA,MAAM,MAAM,qFAqDX,CAAC;AAGF,eAAe,MAAM,CAAC"}
|
package/select/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { getExternalProps } from '../internal/utils/external-props';
|
|
|
9
9
|
import InternalSelect from './internal';
|
|
10
10
|
import analyticsSelectors from '../internal/components/button-trigger/analytics-metadata/styles.css.js';
|
|
11
11
|
const Select = React.forwardRef(({ options = [], filteringType = 'none', statusType = 'finished', triggerVariant = 'label', renderOption, ...restProps }, ref) => {
|
|
12
|
+
var _a, _b, _c, _d;
|
|
12
13
|
const baseComponentProps = useBaseComponent('Select', {
|
|
13
14
|
props: {
|
|
14
15
|
autoFocus: restProps.autoFocus,
|
|
@@ -30,6 +31,8 @@ const Select = React.forwardRef(({ options = [], filteringType = 'none', statusT
|
|
|
30
31
|
properties: {
|
|
31
32
|
disabled: `${!!externalProps.disabled}`,
|
|
32
33
|
selectedOptionValue: `${externalProps.selectedOption && externalProps.selectedOption.value ? externalProps.selectedOption.value : null}`,
|
|
34
|
+
// Use label for display if available, fallback to value because that's what gets shown in dropdown when label is not provided
|
|
35
|
+
selectedOption: `${(_d = (_b = (_a = externalProps.selectedOption) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : (_c = externalProps.selectedOption) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : null}`,
|
|
33
36
|
},
|
|
34
37
|
};
|
|
35
38
|
return (React.createElement(InternalSelect, { renderOption: renderOption, options: options, filteringType: filteringType, statusType: statusType, triggerVariant: triggerVariant, ...externalProps, ...baseComponentProps, ref: ref, ...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata }) }));
|
package/select/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/select/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAE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AAC;AACnC,eAAe,MAAM,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { GeneratedAnalyticsMetadataSelectComponent } from './analytics-metadata/interfaces';\nimport { SelectProps } from './interfaces';\nimport InternalSelect from './internal';\n\nexport { SelectProps };\n\nimport analyticsSelectors from '../internal/components/button-trigger/analytics-metadata/styles.css.js';\n\nconst Select = React.forwardRef(\n (\n {\n options = [],\n filteringType = 'none',\n statusType = 'finished',\n triggerVariant = 'label',\n renderOption,\n ...restProps\n }: SelectProps,\n ref: React.Ref<SelectProps.Ref>\n ) => {\n const baseComponentProps = useBaseComponent('Select', {\n props: {\n autoFocus: restProps.autoFocus,\n expandToViewport: restProps.expandToViewport,\n filteringType,\n triggerVariant,\n virtualScroll: restProps.virtualScroll,\n readOnly: restProps.readOnly,\n },\n metadata: {\n hasInlineLabel: Boolean(restProps.inlineLabelText),\n hasDisabledReasons: options.some(option => Boolean(option.disabledReason)),\n },\n });\n const externalProps = getExternalProps(restProps);\n\n const componentAnalyticsMetadata: GeneratedAnalyticsMetadataSelectComponent = {\n name: 'awsui.Select',\n label: `.${analyticsSelectors['button-trigger']}`,\n properties: {\n disabled: `${!!externalProps.disabled}`,\n selectedOptionValue: `${externalProps.selectedOption && externalProps.selectedOption.value ? externalProps.selectedOption.value : null}`,\n // Use label for display if available, fallback to value because that's what gets shown in dropdown when label is not provided\n selectedOption: `${externalProps.selectedOption?.label ?? externalProps.selectedOption?.value ?? null}`,\n },\n };\n\n return (\n <InternalSelect\n renderOption={renderOption}\n options={options}\n filteringType={filteringType}\n statusType={statusType}\n triggerVariant={triggerVariant}\n {...externalProps}\n {...baseComponentProps}\n ref={ref}\n {...getAnalyticsMetadataAttribute({ component: componentAnalyticsMetadata })}\n />\n );\n }\n);\n\napplyDisplayName(Select, 'Select');\nexport default Select;\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import PopoverWrapper from '../popover';
|
|
2
|
+
export default class FeaturePromptWrapper extends PopoverWrapper {
|
|
3
|
+
static rootSelector: string;
|
|
4
|
+
findHeader(): import("@cloudscape-design/test-utils-core/dom").ElementWrapper<HTMLElement> | null;
|
|
5
|
+
findContent(): import("@cloudscape-design/test-utils-core/dom").ElementWrapper<HTMLElement> | null;
|
|
6
|
+
findDismissButton(): import("..").ButtonWrapper | null;
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
const popover_1 = require("../popover");
|
|
6
|
+
const styles_selectors_js_1 = require("../../../internal/do-not-use/feature-prompt/styles.selectors.js");
|
|
7
|
+
class FeaturePromptWrapper extends popover_1.default {
|
|
8
|
+
findHeader() {
|
|
9
|
+
return super.findHeader({ renderWithPortal: true });
|
|
10
|
+
}
|
|
11
|
+
findContent() {
|
|
12
|
+
return super.findContent({ renderWithPortal: true });
|
|
13
|
+
}
|
|
14
|
+
findDismissButton() {
|
|
15
|
+
return super.findDismissButton({ renderWithPortal: true });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
FeaturePromptWrapper.rootSelector = styles_selectors_js_1.default.root;
|
|
19
|
+
exports.default = FeaturePromptWrapper;
|
|
20
|
+
//# sourceMappingURL=feature-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-prompt.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/internal/feature-prompt.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,wCAAwC;AAExC,yGAAqF;AAErF,MAAqB,oBAAqB,SAAQ,iBAAc;IAG9D,UAAU;QACR,OAAO,KAAK,CAAC,UAAU,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,WAAW;QACT,OAAO,KAAK,CAAC,WAAW,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,iBAAiB;QACf,OAAO,KAAK,CAAC,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC;;AAZM,iCAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,oBAAoB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import PopoverWrapper from '../popover';
|
|
2
|
+
export default class FeaturePromptWrapper extends PopoverWrapper {
|
|
3
|
+
static rootSelector: string;
|
|
4
|
+
findHeader(): import("@cloudscape-design/test-utils-core/selectors").ElementWrapper;
|
|
5
|
+
findContent(): import("@cloudscape-design/test-utils-core/selectors").ElementWrapper;
|
|
6
|
+
findDismissButton(): import("..").ButtonWrapper;
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
const popover_1 = require("../popover");
|
|
6
|
+
const styles_selectors_js_1 = require("../../../internal/do-not-use/feature-prompt/styles.selectors.js");
|
|
7
|
+
class FeaturePromptWrapper extends popover_1.default {
|
|
8
|
+
findHeader() {
|
|
9
|
+
return super.findHeader({
|
|
10
|
+
renderWithPortal: true
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
findContent() {
|
|
14
|
+
return super.findContent({
|
|
15
|
+
renderWithPortal: true
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
findDismissButton() {
|
|
19
|
+
return super.findDismissButton({
|
|
20
|
+
renderWithPortal: true
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
FeaturePromptWrapper.rootSelector = styles_selectors_js_1.default.root;
|
|
25
|
+
exports.default = FeaturePromptWrapper;
|
|
26
|
+
//# sourceMappingURL=feature-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-prompt.js","sourceRoot":"","sources":["../../../../../src/test-utils/selectors/internal/feature-prompt.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,wCAAwC;AACxC,yGAAqF;AACrF,MAAqB,oBAAqB,SAAQ,iBAAc;IAE9D,UAAU;QACR,OAAO,KAAK,CAAC,UAAU,CAAC;YACtB,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IACD,WAAW;QACT,OAAO,KAAK,CAAC,WAAW,CAAC;YACvB,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;IACD,iBAAiB;QACf,OAAO,KAAK,CAAC,iBAAiB,CAAC;YAC7B,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;;AAfM,iCAAY,GAAW,6BAAM,CAAC,IAAI,CAAC;kBADvB,oBAAoB"}
|