@cloudscape-design/components-themeable 3.0.836 → 3.0.838
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/internal/components/file-token-group/constants.scss +14 -0
- package/lib/internal/scss/internal/components/file-token-group/styles.scss +143 -0
- package/lib/internal/scss/internal/components/file-token-group/test-classes/styles.scss +12 -0
- package/lib/internal/scss/internal/components/token-list/styles.scss +13 -1
- package/lib/internal/scss/token-group/constants.scss +0 -1
- package/lib/internal/scss/token-group/mixins.scss +27 -0
- package/lib/internal/scss/token-group/styles.scss +2 -33
- package/lib/internal/template/file-upload/interfaces.d.ts +5 -0
- package/lib/internal/template/file-upload/interfaces.d.ts.map +1 -1
- package/lib/internal/template/file-upload/interfaces.js.map +1 -1
- package/lib/internal/template/file-upload/internal.d.ts.map +1 -1
- package/lib/internal/template/file-upload/internal.js +7 -13
- package/lib/internal/template/file-upload/internal.js.map +1 -1
- package/lib/internal/template/internal/components/file-token-group/default-formatters.d.ts.map +1 -0
- package/lib/internal/template/{file-upload → internal/components/file-token-group}/default-formatters.js +1 -1
- package/lib/internal/template/internal/components/file-token-group/default-formatters.js.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/file-token.d.ts +32 -0
- package/lib/internal/template/internal/components/file-token-group/file-token.d.ts.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/file-token.js +71 -0
- package/lib/internal/template/internal/components/file-token-group/file-token.js.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/index.d.ts +8 -0
- package/lib/internal/template/internal/components/file-token-group/index.d.ts.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/index.js +41 -0
- package/lib/internal/template/internal/components/file-token-group/index.js.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/interfaces.d.ts +85 -0
- package/lib/internal/template/internal/components/file-token-group/interfaces.d.ts.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/interfaces.js +2 -0
- package/lib/internal/template/internal/components/file-token-group/interfaces.js.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/styles.css.js +27 -0
- package/lib/internal/template/internal/components/file-token-group/styles.scoped.css +375 -0
- package/lib/internal/template/internal/components/file-token-group/styles.selectors.js +28 -0
- package/lib/internal/template/internal/components/file-token-group/test-classes/styles.css.js +11 -0
- package/lib/internal/template/internal/components/file-token-group/test-classes/styles.scoped.css +12 -0
- package/lib/internal/template/internal/components/file-token-group/test-classes/styles.selectors.js +12 -0
- package/lib/internal/template/internal/components/file-token-group/thumbnail.d.ts.map +1 -0
- package/lib/internal/template/internal/components/file-token-group/thumbnail.js.map +1 -0
- package/lib/internal/template/internal/components/token-list/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/token-list/index.js +5 -1
- package/lib/internal/template/internal/components/token-list/index.js.map +1 -1
- package/lib/internal/template/internal/components/token-list/interfaces.d.ts +1 -1
- package/lib/internal/template/internal/components/token-list/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/components/token-list/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/token-list/styles.css.js +10 -9
- package/lib/internal/template/internal/components/token-list/styles.scoped.css +41 -21
- package/lib/internal/template/internal/components/token-list/styles.selectors.js +10 -9
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/property-filter/token-editor-inputs.js +5 -5
- package/lib/internal/template/property-filter/token-editor-inputs.js.map +1 -1
- package/lib/internal/template/test-utils/dom/file-upload/index.d.ts +1 -10
- package/lib/internal/template/test-utils/dom/file-upload/index.js +13 -36
- package/lib/internal/template/test-utils/dom/file-upload/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/internal/file-token-group.d.ts +21 -0
- package/lib/internal/template/test-utils/dom/internal/file-token-group.js +51 -0
- package/lib/internal/template/test-utils/dom/internal/file-token-group.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/file-upload/index.d.ts +1 -10
- package/lib/internal/template/test-utils/selectors/file-upload/index.js +13 -36
- package/lib/internal/template/test-utils/selectors/file-upload/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/internal/file-token-group.d.ts +21 -0
- package/lib/internal/template/test-utils/selectors/internal/file-token-group.js +51 -0
- package/lib/internal/template/test-utils/selectors/internal/file-token-group.js.map +1 -0
- package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
- package/lib/internal/template/token-group/styles.css.js +8 -10
- package/lib/internal/template/token-group/styles.scoped.css +25 -38
- package/lib/internal/template/token-group/styles.selectors.js +8 -10
- package/lib/internal/template/token-group/token.d.ts +1 -5
- package/lib/internal/template/token-group/token.d.ts.map +1 -1
- package/lib/internal/template/token-group/token.js +4 -11
- package/lib/internal/template/token-group/token.js.map +1 -1
- package/package.json +1 -1
- package/lib/internal/scss/file-upload/file-option/styles.scss +0 -34
- package/lib/internal/template/file-upload/default-formatters.d.ts.map +0 -1
- package/lib/internal/template/file-upload/default-formatters.js.map +0 -1
- package/lib/internal/template/file-upload/file-option/index.d.ts +0 -10
- package/lib/internal/template/file-upload/file-option/index.d.ts.map +0 -1
- package/lib/internal/template/file-upload/file-option/index.js +0 -22
- package/lib/internal/template/file-upload/file-option/index.js.map +0 -1
- package/lib/internal/template/file-upload/file-option/styles.css.js +0 -12
- package/lib/internal/template/file-upload/file-option/styles.scoped.css +0 -35
- package/lib/internal/template/file-upload/file-option/styles.selectors.js +0 -13
- package/lib/internal/template/file-upload/file-option/thumbnail.d.ts.map +0 -1
- package/lib/internal/template/file-upload/file-option/thumbnail.js.map +0 -1
- /package/lib/internal/template/{file-upload → internal/components/file-token-group}/default-formatters.d.ts +0 -0
- /package/lib/internal/template/{file-upload/file-option → internal/components/file-token-group}/thumbnail.d.ts +0 -0
- /package/lib/internal/template/{file-upload/file-option → internal/components/file-token-group}/thumbnail.js +0 -0
package/lib/internal/template/internal/components/file-token-group/test-classes/styles.selectors.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
// es-module interop with Babel and Typescript
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
module.exports.default = {
|
|
5
|
+
"root": "awsui_root_9f1dn_6ggi7_5",
|
|
6
|
+
"file-option-thumbnail": "awsui_file-option-thumbnail_9f1dn_6ggi7_6",
|
|
7
|
+
"file-option-name": "awsui_file-option-name_9f1dn_6ggi7_7",
|
|
8
|
+
"file-option-size": "awsui_file-option-size_9f1dn_6ggi7_8",
|
|
9
|
+
"file-option-last-modified": "awsui_file-option-last-modified_9f1dn_6ggi7_9",
|
|
10
|
+
"ellipsis-active": "awsui_ellipsis-active_9f1dn_6ggi7_10"
|
|
11
|
+
};
|
|
12
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thumbnail.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/file-token-group/thumbnail.tsx"],"names":[],"mappings":";AAOA,UAAU,wBAAwB;IAChC,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,wBAAwB,eAoBrE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thumbnail.js","sourceRoot":"","sources":["../../../../../src/internal/components/file-token-group/thumbnail.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAMrC,MAAM,UAAU,mBAAmB,CAAC,EAAE,IAAI,EAA4B;IACpE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE7C,SAAS,CAAC,GAAG,EAAE;QACb,qDAAqD;QACrD,IAAI,GAAG,CAAC,eAAe,EAAE;YACvB,MAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;YACtC,WAAW,CAAC,GAAG,CAAC,CAAC;YAEjB,OAAO,GAAG,EAAE;gBACV,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;YAC3B,CAAC,CAAC;SACH;IACH,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,iBAAe,IAAI;QAChE,6BAAK,SAAS,EAAE,MAAM,CAAC,6BAA6B,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,GAAI,CACpF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useEffect, useState } from 'react';\n\nimport styles from './styles.css.js';\n\ninterface FileOptionThumbnailProps {\n file: File;\n}\n\nexport function FileOptionThumbnail({ file }: FileOptionThumbnailProps) {\n const [imageSrc, setImageSrc] = useState('');\n\n useEffect(() => {\n // The URL.createObjectURL is not available in jsdom.\n if (URL.createObjectURL) {\n const src = URL.createObjectURL(file);\n setImageSrc(src);\n\n return () => {\n URL.revokeObjectURL(src);\n };\n }\n }, [file]);\n\n return (\n <div className={styles['file-option-thumbnail']} aria-hidden={true}>\n <img className={styles['file-option-thumbnail-image']} alt={file.name} src={imageSrc} />\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAK9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,IAAI,EAAE,EACtC,KAAK,EACL,SAAS,EACT,UAAU,EACV,KAAK,EACL,KAAK,EACL,WAAW,EACX,uBAAuB,EACvB,sBAAsB,EACtB,eAAiC,GAClC,EAAE,cAAc,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAK9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,IAAI,EAAE,EACtC,KAAK,EACL,SAAS,EACT,UAAU,EACV,KAAK,EACL,KAAK,EACL,WAAW,EACX,uBAAuB,EACvB,sBAAsB,EACtB,eAAiC,GAClC,EAAE,cAAc,CAAC,IAAI,CAAC,eA+EtB"}
|
|
@@ -26,7 +26,11 @@ export default function TokenList({ items, alignment, renderItem, limit, after,
|
|
|
26
26
|
after));
|
|
27
27
|
}
|
|
28
28
|
return (React.createElement("div", { className: clsx(styles.root, styles.vertical) },
|
|
29
|
-
hasVisibleItems && (React.createElement("ul", { id: controlId, className: clsx(styles.list,
|
|
29
|
+
hasVisibleItems && (React.createElement("ul", { id: controlId, className: clsx(styles.list, {
|
|
30
|
+
[styles.vertical]: alignment === 'vertical',
|
|
31
|
+
[styles.horizontal]: alignment === 'horizontal',
|
|
32
|
+
[styles.grid]: alignment === 'horizontal-grid',
|
|
33
|
+
}) }, visibleItems.map((item, itemIndex) => (React.createElement("li", { key: itemIndex, className: styles['list-item'], "aria-setsize": items.length, "aria-posinset": itemIndex + 1 }, renderItem(item, itemIndex)))))),
|
|
30
34
|
toggle,
|
|
31
35
|
after));
|
|
32
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MA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UAAU,GAAG,CAAC,QAAQ,CAAC;gBAC7B,WAAW,CAAC,UAAU,CAAC,CAAC;gBACxB,eAAe,CAAC,UAAU,CAAC,CAAC;YAC9B,CAAC,GACD,CACE,CACP,CAAC,CAAC,CAAC,IAAI,CAAC;IAET,IAAI,SAAS,KAAK,QAAQ,EAAE;QAC1B,OAAO,CACL,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC;YACjD,QAAQ,IAAI,CACX,4BAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,IACtC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CACrC,4BACE,GAAG,EAAE,SAAS,EACd,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,kBAChB,KAAK,CAAC,MAAM,mBACX,SAAS,GAAG,CAAC,IAE3B,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CACzB,CACN,CAAC,CACC,CACN;YACA,MAAM;YACN,KAAK,IAAI,6BAAK,SAAS,EAAE,MAAM,CAAC,SAAS,GAAI;YAC7C,KAAK,CACF,CACP,CAAC;KACH;IAED,OAAO,CACL,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC;QAC/C,eAAe,IAAI,CAClB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AAEpD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,C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IAE3B,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CACzB,CACN,CAAC,CACC,CACN;QACA,MAAM;QACN,KAAK,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, { useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '../../hooks/use-unique-id';\nimport { TokenListProps } from './interfaces';\nimport TokenLimitToggle from './token-limit-toggle';\n\nimport styles from './styles.css.js';\n\nexport { TokenListProps };\n\nexport default function TokenList<Item>({\n items,\n alignment,\n renderItem,\n limit,\n after,\n i18nStrings,\n limitShowFewerAriaLabel,\n limitShowMoreAriaLabel,\n onExpandedClick = () => undefined,\n}: TokenListProps<Item>) {\n const controlId = useUniqueId();\n\n const [expanded, setExpanded] = useState(false);\n const hasItems = items.length > 0;\n const hasHiddenItems = hasItems && limit !== undefined && items.length > limit;\n const visibleItems = hasHiddenItems && !expanded ? items.slice(0, limit) : items;\n const hasVisibleItems = visibleItems.length > 0;\n\n const toggle = hasHiddenItems ? (\n <div className={styles[`toggle-container-${alignment}`]}>\n <TokenLimitToggle\n controlId={hasVisibleItems ? controlId : undefined}\n allHidden={limit === 0}\n expanded={expanded}\n numberOfHiddenOptions={items.length - visibleItems.length}\n i18nStrings={i18nStrings}\n limitShowFewerAriaLabel={limitShowFewerAriaLabel}\n limitShowMoreAriaLabel={limitShowMoreAriaLabel}\n onClick={() => {\n const isExpanded = !expanded;\n setExpanded(isExpanded);\n onExpandedClick(isExpanded);\n }}\n />\n </div>\n ) : null;\n\n if (alignment === 'inline') {\n return (\n <div className={clsx(styles.root, styles.horizontal)}>\n {hasItems && (\n <ul id={controlId} className={styles.list}>\n {visibleItems.map((item, itemIndex) => (\n <li\n key={itemIndex}\n className={styles['list-item']}\n aria-setsize={items.length}\n aria-posinset={itemIndex + 1}\n >\n {renderItem(item, itemIndex)}\n </li>\n ))}\n </ul>\n )}\n {toggle}\n {after && <div className={styles.separator} />}\n {after}\n </div>\n );\n }\n\n return (\n <div className={clsx(styles.root, styles.vertical)}>\n {hasVisibleItems && (\n <ul\n id={controlId}\n className={clsx(styles.list, {\n [styles.vertical]: alignment === 'vertical',\n [styles.horizontal]: alignment === 'horizontal',\n [styles.grid]: alignment === 'horizontal-grid',\n })}\n >\n {visibleItems.map((item, itemIndex) => (\n <li\n key={itemIndex}\n className={styles['list-item']}\n aria-setsize={items.length}\n aria-posinset={itemIndex + 1}\n >\n {renderItem(item, itemIndex)}\n </li>\n ))}\n </ul>\n )}\n {toggle}\n {after}\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,cAAc,CAAC,IAAI;IAClC,SAAS,EAAE,UAAU,GAAG,YAAY,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,WAAW,cAAc,CAAC,IAAI;IAClC,SAAS,EAAE,UAAU,GAAG,YAAY,GAAG,QAAQ,GAAG,iBAAiB,CAAC;IACpE,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/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 React from 'react';\n\nexport interface TokenListProps<Item> {\n alignment: 'vertical' | 'horizontal' | 'inline';\n items: readonly Item[];\n limit?: number;\n after?: React.ReactNode;\n renderItem: (item: Item, itemIndex: number) => React.ReactNode;\n i18nStrings?: I18nStrings;\n onExpandedClick?: (isExpanded: boolean) => void;\n limitShowFewerAriaLabel?: string;\n limitShowMoreAriaLabel?: string;\n}\n\nexport interface I18nStrings {\n limitShowFewer?: string;\n limitShowMore?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/components/token-list/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 React from 'react';\n\nexport interface TokenListProps<Item> {\n alignment: 'vertical' | 'horizontal' | 'inline' | 'horizontal-grid';\n items: readonly Item[];\n limit?: number;\n after?: React.ReactNode;\n renderItem: (item: Item, itemIndex: number) => React.ReactNode;\n i18nStrings?: I18nStrings;\n onExpandedClick?: (isExpanded: boolean) => void;\n limitShowFewerAriaLabel?: string;\n limitShowMoreAriaLabel?: string;\n}\n\nexport interface I18nStrings {\n limitShowFewer?: string;\n limitShowMore?: string;\n}\n"]}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"horizontal": "
|
|
6
|
-
"vertical": "
|
|
7
|
-
"list": "
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"toggle": "
|
|
11
|
-
"
|
|
12
|
-
"
|
|
4
|
+
"root": "awsui_root_gfwv3_8epgo_189",
|
|
5
|
+
"horizontal": "awsui_horizontal_gfwv3_8epgo_192",
|
|
6
|
+
"vertical": "awsui_vertical_gfwv3_8epgo_198",
|
|
7
|
+
"list": "awsui_list_gfwv3_8epgo_203",
|
|
8
|
+
"grid": "awsui_grid_gfwv3_8epgo_222",
|
|
9
|
+
"list-item": "awsui_list-item_gfwv3_8epgo_234",
|
|
10
|
+
"toggle-container-inline": "awsui_toggle-container-inline_gfwv3_8epgo_241",
|
|
11
|
+
"toggle": "awsui_toggle_gfwv3_8epgo_241",
|
|
12
|
+
"description": "awsui_description_gfwv3_8epgo_336",
|
|
13
|
+
"separator": "awsui_separator_gfwv3_8epgo_340"
|
|
13
14
|
};
|
|
14
15
|
|
|
@@ -178,20 +178,29 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
178
178
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
179
179
|
SPDX-License-Identifier: Apache-2.0
|
|
180
180
|
*/
|
|
181
|
-
|
|
182
|
-
|
|
181
|
+
/*
|
|
182
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
183
|
+
SPDX-License-Identifier: Apache-2.0
|
|
184
|
+
*/
|
|
185
|
+
/*
|
|
186
|
+
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
187
|
+
SPDX-License-Identifier: Apache-2.0
|
|
188
|
+
*/
|
|
189
|
+
.awsui_root_gfwv3_8epgo_189:not(#\9) {
|
|
183
190
|
gap: var(--space-scaled-xs-t3am3w, 8px);
|
|
184
191
|
}
|
|
185
|
-
.
|
|
192
|
+
.awsui_root_gfwv3_8epgo_189.awsui_horizontal_gfwv3_8epgo_192:not(#\9) {
|
|
193
|
+
display: flex;
|
|
186
194
|
gap: var(--space-xs-6dgkww, 8px);
|
|
187
195
|
flex-direction: row;
|
|
188
196
|
flex-wrap: wrap;
|
|
189
197
|
}
|
|
190
|
-
.
|
|
198
|
+
.awsui_root_gfwv3_8epgo_189.awsui_vertical_gfwv3_8epgo_198:not(#\9) {
|
|
199
|
+
display: flex;
|
|
191
200
|
flex-direction: column;
|
|
192
201
|
}
|
|
193
202
|
|
|
194
|
-
.
|
|
203
|
+
.awsui_list_gfwv3_8epgo_203:not(#\9) {
|
|
195
204
|
display: contents;
|
|
196
205
|
list-style: none;
|
|
197
206
|
padding-block: 0;
|
|
@@ -199,32 +208,43 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
199
208
|
margin-block: 0;
|
|
200
209
|
margin-inline: 0;
|
|
201
210
|
}
|
|
202
|
-
.
|
|
211
|
+
.awsui_list_gfwv3_8epgo_203.awsui_horizontal_gfwv3_8epgo_192:not(#\9), .awsui_list_gfwv3_8epgo_203.awsui_vertical_gfwv3_8epgo_198:not(#\9) {
|
|
203
212
|
display: flex;
|
|
204
213
|
gap: var(--space-xs-6dgkww, 8px);
|
|
205
214
|
}
|
|
206
|
-
.
|
|
215
|
+
.awsui_list_gfwv3_8epgo_203.awsui_horizontal_gfwv3_8epgo_192:not(#\9) {
|
|
207
216
|
flex-direction: row;
|
|
208
217
|
flex-wrap: wrap;
|
|
209
218
|
}
|
|
210
|
-
.
|
|
219
|
+
.awsui_list_gfwv3_8epgo_203.awsui_vertical_gfwv3_8epgo_198:not(#\9) {
|
|
211
220
|
flex-direction: column;
|
|
212
221
|
}
|
|
222
|
+
.awsui_list_gfwv3_8epgo_203.awsui_grid_gfwv3_8epgo_222:not(#\9) {
|
|
223
|
+
display: grid;
|
|
224
|
+
gap: var(--space-xs-6dgkww, 8px);
|
|
225
|
+
grid-template-columns: repeat(auto-fill, 230px);
|
|
226
|
+
}
|
|
227
|
+
@media (max-width: 688px) {
|
|
228
|
+
.awsui_list_gfwv3_8epgo_203.awsui_grid_gfwv3_8epgo_222:not(#\9) {
|
|
229
|
+
display: flex;
|
|
230
|
+
flex-direction: column;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
213
233
|
|
|
214
|
-
.awsui_list-
|
|
234
|
+
.awsui_list-item_gfwv3_8epgo_234:not(#\9) {
|
|
215
235
|
padding-block: 0;
|
|
216
236
|
padding-inline: 0;
|
|
217
237
|
margin-block: 0;
|
|
218
238
|
margin-inline: 0;
|
|
219
239
|
}
|
|
220
240
|
|
|
221
|
-
.awsui_toggle-container-
|
|
241
|
+
.awsui_toggle-container-inline_gfwv3_8epgo_241:not(#\9) {
|
|
222
242
|
padding-inline-start: var(--space-xs-6dgkww, 8px);
|
|
223
243
|
display: flex;
|
|
224
244
|
align-items: center;
|
|
225
245
|
}
|
|
226
246
|
|
|
227
|
-
.
|
|
247
|
+
.awsui_toggle_gfwv3_8epgo_241:not(#\9) {
|
|
228
248
|
border-collapse: separate;
|
|
229
249
|
border-spacing: 0;
|
|
230
250
|
box-sizing: border-box;
|
|
@@ -279,34 +299,34 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
279
299
|
transition-duration: var(--motion-duration-refresh-only-medium-kd6k1u, 0ms);
|
|
280
300
|
}
|
|
281
301
|
@media (prefers-reduced-motion: reduce) {
|
|
282
|
-
.
|
|
302
|
+
.awsui_toggle_gfwv3_8epgo_241:not(#\9) {
|
|
283
303
|
animation: none;
|
|
284
304
|
transition: none;
|
|
285
305
|
}
|
|
286
306
|
}
|
|
287
|
-
.awsui-motion-disabled .
|
|
307
|
+
.awsui-motion-disabled .awsui_toggle_gfwv3_8epgo_241:not(#\9), .awsui-mode-entering .awsui_toggle_gfwv3_8epgo_241:not(#\9) {
|
|
288
308
|
animation: none;
|
|
289
309
|
transition: none;
|
|
290
310
|
}
|
|
291
|
-
.
|
|
311
|
+
.awsui_toggle_gfwv3_8epgo_241:not(#\9):hover {
|
|
292
312
|
cursor: pointer;
|
|
293
313
|
color: var(--color-text-link-hover-jvu4dp, #0a4a74);
|
|
294
314
|
}
|
|
295
|
-
.
|
|
315
|
+
.awsui_toggle_gfwv3_8epgo_241:not(#\9):focus {
|
|
296
316
|
outline: none;
|
|
297
317
|
}
|
|
298
|
-
.
|
|
318
|
+
.awsui_toggle_gfwv3_8epgo_241:not(#\9):active {
|
|
299
319
|
color: var(--color-text-link-hover-jvu4dp, #0a4a74);
|
|
300
320
|
}
|
|
301
|
-
.
|
|
321
|
+
.awsui_toggle_gfwv3_8epgo_241:not(#\9):active, .awsui_toggle_gfwv3_8epgo_241:not(#\9):focus, .awsui_toggle_gfwv3_8epgo_241:not(#\9):hover {
|
|
302
322
|
text-decoration-line: underline;
|
|
303
323
|
text-decoration-color: currentColor;
|
|
304
324
|
}
|
|
305
|
-
.
|
|
325
|
+
.awsui_toggle_gfwv3_8epgo_241:not(#\9):active, .awsui_toggle_gfwv3_8epgo_241:not(#\9):focus, .awsui_toggle_gfwv3_8epgo_241:not(#\9):hover {
|
|
306
326
|
text-decoration: none;
|
|
307
327
|
text-decoration-color: transparent;
|
|
308
328
|
}
|
|
309
|
-
body[data-awsui-focus-visible=true] .
|
|
329
|
+
body[data-awsui-focus-visible=true] .awsui_toggle_gfwv3_8epgo_241:not(#\9):focus {
|
|
310
330
|
outline: 2px dotted transparent;
|
|
311
331
|
border-block: var(--border-field-width-fjuzc5, 1px) solid var(--color-border-item-focused-q68bgg, #0073bb);
|
|
312
332
|
border-inline: var(--border-field-width-fjuzc5, 1px) solid var(--color-border-item-focused-q68bgg, #0073bb);
|
|
@@ -316,11 +336,11 @@ body[data-awsui-focus-visible=true] .awsui_toggle_gfwv3_77roy_221:not(#\9):focus
|
|
|
316
336
|
border-end-end-radius: var(--border-radius-control-default-focus-ring-vy2hlh, 2px);
|
|
317
337
|
box-shadow: 0 0 0 var(--border-control-focus-ring-shadow-spread-kvz439, 1px) var(--color-border-item-focused-q68bgg, #0073bb);
|
|
318
338
|
}
|
|
319
|
-
.
|
|
339
|
+
.awsui_toggle_gfwv3_8epgo_241 > .awsui_description_gfwv3_8epgo_336:not(#\9) {
|
|
320
340
|
margin-inline-start: var(--space-xxs-y2432o, 4px);
|
|
321
341
|
}
|
|
322
342
|
|
|
323
|
-
.
|
|
343
|
+
.awsui_separator_gfwv3_8epgo_340:not(#\9) {
|
|
324
344
|
margin-block: 0;
|
|
325
345
|
margin-inline: var(--space-scaled-m-3uxq9h, 16px);
|
|
326
346
|
inline-size: var(--border-divider-section-width-iueskx, 1px);
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"horizontal": "
|
|
7
|
-
"vertical": "
|
|
8
|
-
"list": "
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"toggle": "
|
|
12
|
-
"
|
|
13
|
-
"
|
|
5
|
+
"root": "awsui_root_gfwv3_8epgo_189",
|
|
6
|
+
"horizontal": "awsui_horizontal_gfwv3_8epgo_192",
|
|
7
|
+
"vertical": "awsui_vertical_gfwv3_8epgo_198",
|
|
8
|
+
"list": "awsui_list_gfwv3_8epgo_203",
|
|
9
|
+
"grid": "awsui_grid_gfwv3_8epgo_222",
|
|
10
|
+
"list-item": "awsui_list-item_gfwv3_8epgo_234",
|
|
11
|
+
"toggle-container-inline": "awsui_toggle-container-inline_gfwv3_8epgo_241",
|
|
12
|
+
"toggle": "awsui_toggle_gfwv3_8epgo_241",
|
|
13
|
+
"description": "awsui_description_gfwv3_8epgo_336",
|
|
14
|
+
"separator": "awsui_separator_gfwv3_8epgo_340"
|
|
14
15
|
};
|
|
15
16
|
|
|
@@ -56,19 +56,19 @@ export function ValueInput(props) {
|
|
|
56
56
|
}
|
|
57
57
|
return React.createElement(ValueInputAuto, Object.assign({}, props));
|
|
58
58
|
}
|
|
59
|
-
function ValueInputAuto({ property, operator, value, onChangeValue, asyncProps, filteringOptions, onLoadItems, i18nStrings, }) {
|
|
60
|
-
var _a
|
|
59
|
+
function ValueInputAuto({ property, operator, value: unknownValue, onChangeValue, asyncProps, filteringOptions, onLoadItems, i18nStrings, }) {
|
|
60
|
+
var _a;
|
|
61
|
+
const value = (unknownValue !== null && unknownValue !== void 0 ? unknownValue : '') + '';
|
|
61
62
|
const valueOptions = property
|
|
62
63
|
? filteringOptions
|
|
63
64
|
.filter(option => { var _a; return ((_a = option.property) === null || _a === void 0 ? void 0 : _a.propertyKey) === property.propertyKey; })
|
|
64
65
|
.map(({ label, value }) => ({ label, value }))
|
|
65
66
|
: [];
|
|
66
|
-
const
|
|
67
|
-
const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property === null || property === void 0 ? void 0 : property.externalProperty, valueFilter, operator);
|
|
67
|
+
const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property === null || property === void 0 ? void 0 : property.externalProperty, value, operator);
|
|
68
68
|
const asyncValueAutosuggestProps = (property === null || property === void 0 ? void 0 : property.propertyKey)
|
|
69
69
|
? Object.assign(Object.assign({}, valueAutosuggestHandlers), asyncProps) : { empty: asyncProps.empty };
|
|
70
70
|
const [matchedOption] = valueOptions.filter(option => option.value === value);
|
|
71
|
-
return (React.createElement(InternalAutosuggest, Object.assign({ enteredTextLabel: i18nStrings.enteredTextLabel, value: (
|
|
71
|
+
return (React.createElement(InternalAutosuggest, Object.assign({ enteredTextLabel: i18nStrings.enteredTextLabel, value: (_a = matchedOption === null || matchedOption === void 0 ? void 0 : matchedOption.label) !== null && _a !== void 0 ? _a : value, clearAriaLabel: i18nStrings.clearAriaLabel, onChange: e => onChangeValue(e.detail.value), disabled: !operator, options: valueOptions }, asyncValueAutosuggestProps, { virtualScroll: true })));
|
|
72
72
|
}
|
|
73
73
|
function ValueInputEnum({ property, operator, value: unknownValue, onChangeValue, asyncProps, filteringOptions, onLoadItems, }) {
|
|
74
74
|
const valueOptions = filteringOptions
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-editor-inputs.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor-inputs.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAG7D,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAuB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAS7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAarC,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,iBAAiB,GACE;;IACnB,MAAM,sBAAsB,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,wBAAwB,GAAG,UAAU,CAAC,CAAC,iCAAM,UAAU,GAAK,sBAAsB,EAAG,CAAC,CAAC,EAAE,CAAC;IAChG,MAAM,eAAe,GAAqD,sBAAsB,CAC9F,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC;QACnC,KAAK,EAAE,WAAW;QAClB,KAAK,EAAE,aAAa;QACpB,iBAAiB,EAAE,IAAI;KACxB,CAAC,CACH,CAAC;IAEF,MAAM,mBAAmB,GAAG;QAC1B,KAAK,EAAE,WAAW,CAAC,kBAAkB;QACrC,KAAK,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AAC,CAAC,CAAC,CAAC,EAAE,IACjG,0BAA0B,IAC9B,YAAY,EAAE,IAAI,EAClB,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,IAAI,IACd,CACE,CACF,CACP,CAAC;AACJ,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 InternalAutosuggest from '../autosuggest/internal.js';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces.js';\nimport { NonCancelableEventHandler } from '../internal/events/index.js';\nimport InternalMultiselect from '../multiselect/internal.js';\nimport { SelectProps } from '../select/interfaces.js';\nimport InternalSelect from '../select/internal.js';\nimport { getAllowedOperators, getPropertySuggestions } from './controller.js';\nimport { I18nStringsInternal, operatorToDescription } from './i18n-utils.js';\nimport {\n ComparisonOperator,\n GroupText,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n LoadItemsDetail,\n} from './interfaces.js';\nimport { useLoadItems } from './use-load-items.js';\n\nimport styles from './styles.css.js';\n\ninterface PropertyInputProps {\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n i18nStrings: I18nStringsInternal;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n property: null | InternalFilteringProperty;\n}\n\nexport function PropertyInput({\n property,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n freeTextFiltering,\n}: PropertyInputProps) {\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyKey, propertyLabel }) => ({\n value: propertyKey,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!freeTextFiltering.disabled) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n <InternalSelect\n options={propertyOptions}\n selectedOption={\n property\n ? {\n value: property.propertyKey ?? undefined,\n label: property.propertyLabel,\n }\n : allPropertiesOption\n }\n onChange={e => onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n i18nStrings: I18nStringsInternal;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n freeTextFiltering: InternalFreeTextFiltering;\n triggerVariant: 'option' | 'label';\n}\n\nexport function OperatorInput({\n property,\n operator,\n onChangeOperator,\n i18nStrings,\n freeTextFiltering,\n triggerVariant,\n}: OperatorInputProps) {\n const operatorOptions = (property ? getAllowedOperators(property) : freeTextFiltering.operators).map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n <InternalSelect\n options={operatorOptions}\n triggerVariant={triggerVariant}\n selectedOption={\n operator\n ? {\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }\n : null\n }\n onChange={e => onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStringsInternal;\n onChangeValue: (value: unknown) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n value: unknown;\n}\n\nexport function ValueInput(props: ValueInputProps) {\n const { property, operator, value, onChangeValue } = props;\n const OperatorForm = property?.propertyKey && operator && property?.getValueFormRenderer(operator);\n\n if (OperatorForm) {\n return <OperatorForm value={value} onChange={onChangeValue} operator={operator} />;\n }\n if (property && operator && property.getTokenType(operator) === 'enum') {\n return <ValueInputEnum {...props} property={property} operator={operator} />;\n }\n return <ValueInputAuto {...props} />;\n}\n\nfunction ValueInputAuto({\n property,\n operator,\n value,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const valueOptions = property\n ? filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }))\n : [];\n\n const valueFilter = typeof value === 'string' ? value : '';\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property?.externalProperty, valueFilter, operator);\n const asyncValueAutosuggestProps = property?.propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n const [matchedOption] = valueOptions.filter(option => option.value === value);\n\n return (\n <InternalAutosuggest\n enteredTextLabel={i18nStrings.enteredTextLabel}\n value={matchedOption?.label ?? value ?? ''}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggestProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface ValueInputPropsEnum extends ValueInputProps {\n property: InternalFilteringProperty;\n operator: ComparisonOperator;\n}\n\nfunction ValueInputEnum({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n}: ValueInputPropsEnum) {\n const valueOptions = filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }));\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property.externalProperty, undefined, operator);\n const asyncValueAutosuggestProps = { statusType: 'finished' as const, ...valueAutosuggestHandlers, ...asyncProps };\n const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];\n const selectedOptions = valueOptions.filter(option => value.includes(option.value));\n return (\n <div className={styles['token-editor-multiselect-wrapper']}>\n <div className={styles['token-editor-multiselect-wrapper-inner']}>\n <InternalMultiselect\n filteringType=\"auto\"\n selectedOptions={selectedOptions}\n onChange={e => onChangeValue(e.detail.selectedOptions.map(o => o.value))}\n options={valueOptions.length > 0 ? [{ options: valueOptions, label: property.groupValuesLabel }] : []}\n {...asyncValueAutosuggestProps}\n inlineTokens={true}\n hideTokens={true}\n keepOpen={true}\n />\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"token-editor-inputs.js","sourceRoot":"","sources":["../../../src/property-filter/token-editor-inputs.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAG7D,OAAO,mBAAmB,MAAM,4BAA4B,CAAC;AAE7D,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAuB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAS7E,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAarC,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,iBAAiB,GACE;;IACnB,MAAM,sBAAsB,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,wBAAwB,GAAG,UAAU,CAAC,CAAC,iCAAM,UAAU,GAAK,sBAAsB,EAAG,CAAC,CAAC,EAAE,CAAC;IAChG,MAAM,eAAe,GAAqD,sBAAsB,CAC9F,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,CAAC,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC;QACnC,KAAK,EAAE,WAAW;QAClB,KAAK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AE,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IACjG,0BAA0B,IAC9B,YAAY,EAAE,IAAI,EAClB,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,IAAI,IACd,CACE,CACF,CACP,CAAC;AACJ,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 InternalAutosuggest from '../autosuggest/internal.js';\nimport { DropdownStatusProps } from '../internal/components/dropdown-status/interfaces.js';\nimport { NonCancelableEventHandler } from '../internal/events/index.js';\nimport InternalMultiselect from '../multiselect/internal.js';\nimport { SelectProps } from '../select/interfaces.js';\nimport InternalSelect from '../select/internal.js';\nimport { getAllowedOperators, getPropertySuggestions } from './controller.js';\nimport { I18nStringsInternal, operatorToDescription } from './i18n-utils.js';\nimport {\n ComparisonOperator,\n GroupText,\n InternalFilteringOption,\n InternalFilteringProperty,\n InternalFreeTextFiltering,\n LoadItemsDetail,\n} from './interfaces.js';\nimport { useLoadItems } from './use-load-items.js';\n\nimport styles from './styles.css.js';\n\ninterface PropertyInputProps {\n asyncProps: null | DropdownStatusProps;\n customGroupsText: readonly GroupText[];\n freeTextFiltering: InternalFreeTextFiltering;\n filteringProperties: readonly InternalFilteringProperty[];\n i18nStrings: I18nStringsInternal;\n onChangePropertyKey: (propertyKey: undefined | string) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n property: null | InternalFilteringProperty;\n}\n\nexport function PropertyInput({\n property,\n onChangePropertyKey,\n asyncProps,\n filteringProperties,\n onLoadItems,\n customGroupsText,\n i18nStrings,\n freeTextFiltering,\n}: PropertyInputProps) {\n const propertySelectHandlers = useLoadItems(onLoadItems);\n const asyncPropertySelectProps = asyncProps ? { ...asyncProps, ...propertySelectHandlers } : {};\n const propertyOptions: (SelectProps.Option | SelectProps.OptionGroup)[] = getPropertySuggestions(\n filteringProperties,\n customGroupsText,\n i18nStrings,\n ({ propertyKey, propertyLabel }) => ({\n value: propertyKey,\n label: propertyLabel,\n dontCloseOnSelect: true,\n })\n );\n\n const allPropertiesOption = {\n label: i18nStrings.allPropertiesLabel,\n value: undefined,\n };\n if (!freeTextFiltering.disabled) {\n propertyOptions.unshift(allPropertiesOption);\n }\n return (\n <InternalSelect\n options={propertyOptions}\n selectedOption={\n property\n ? {\n value: property.propertyKey ?? undefined,\n label: property.propertyLabel,\n }\n : allPropertiesOption\n }\n onChange={e => onChangePropertyKey(e.detail.selectedOption.value)}\n {...asyncPropertySelectProps}\n />\n );\n}\n\ninterface OperatorInputProps {\n i18nStrings: I18nStringsInternal;\n onChangeOperator: (operator: ComparisonOperator) => void;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n freeTextFiltering: InternalFreeTextFiltering;\n triggerVariant: 'option' | 'label';\n}\n\nexport function OperatorInput({\n property,\n operator,\n onChangeOperator,\n i18nStrings,\n freeTextFiltering,\n triggerVariant,\n}: OperatorInputProps) {\n const operatorOptions = (property ? getAllowedOperators(property) : freeTextFiltering.operators).map(operator => ({\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }));\n return (\n <InternalSelect\n options={operatorOptions}\n triggerVariant={triggerVariant}\n selectedOption={\n operator\n ? {\n value: operator,\n label: operator,\n description: operatorToDescription(operator, i18nStrings),\n }\n : null\n }\n onChange={e => onChangeOperator(e.detail.selectedOption.value as ComparisonOperator)}\n />\n );\n}\n\ninterface ValueInputProps {\n asyncProps: DropdownStatusProps;\n filteringOptions: readonly InternalFilteringOption[];\n i18nStrings: I18nStringsInternal;\n onChangeValue: (value: unknown) => void;\n onLoadItems?: NonCancelableEventHandler<LoadItemsDetail>;\n operator: undefined | ComparisonOperator;\n property: null | InternalFilteringProperty;\n value: unknown;\n}\n\nexport function ValueInput(props: ValueInputProps) {\n const { property, operator, value, onChangeValue } = props;\n const OperatorForm = property?.propertyKey && operator && property?.getValueFormRenderer(operator);\n\n if (OperatorForm) {\n return <OperatorForm value={value} onChange={onChangeValue} operator={operator} />;\n }\n if (property && operator && property.getTokenType(operator) === 'enum') {\n return <ValueInputEnum {...props} property={property} operator={operator} />;\n }\n return <ValueInputAuto {...props} />;\n}\n\nfunction ValueInputAuto({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n i18nStrings,\n}: ValueInputProps) {\n const value = (unknownValue ?? '') + '';\n const valueOptions = property\n ? filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }))\n : [];\n\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property?.externalProperty, value, operator);\n const asyncValueAutosuggestProps = property?.propertyKey\n ? { ...valueAutosuggestHandlers, ...asyncProps }\n : { empty: asyncProps.empty };\n const [matchedOption] = valueOptions.filter(option => option.value === value);\n\n return (\n <InternalAutosuggest\n enteredTextLabel={i18nStrings.enteredTextLabel}\n value={matchedOption?.label ?? value}\n clearAriaLabel={i18nStrings.clearAriaLabel}\n onChange={e => onChangeValue(e.detail.value)}\n disabled={!operator}\n options={valueOptions}\n {...asyncValueAutosuggestProps}\n virtualScroll={true}\n />\n );\n}\n\ninterface ValueInputPropsEnum extends ValueInputProps {\n property: InternalFilteringProperty;\n operator: ComparisonOperator;\n}\n\nfunction ValueInputEnum({\n property,\n operator,\n value: unknownValue,\n onChangeValue,\n asyncProps,\n filteringOptions,\n onLoadItems,\n}: ValueInputPropsEnum) {\n const valueOptions = filteringOptions\n .filter(option => option.property?.propertyKey === property.propertyKey)\n .map(({ label, value }) => ({ label, value }));\n const valueAutosuggestHandlers = useLoadItems(onLoadItems, '', property.externalProperty, undefined, operator);\n const asyncValueAutosuggestProps = { statusType: 'finished' as const, ...valueAutosuggestHandlers, ...asyncProps };\n const value = !unknownValue ? [] : Array.isArray(unknownValue) ? unknownValue : [unknownValue];\n const selectedOptions = valueOptions.filter(option => value.includes(option.value));\n return (\n <div className={styles['token-editor-multiselect-wrapper']}>\n <div className={styles['token-editor-multiselect-wrapper-inner']}>\n <InternalMultiselect\n filteringType=\"auto\"\n selectedOptions={selectedOptions}\n onChange={e => onChangeValue(e.detail.selectedOptions.map(o => o.value))}\n options={valueOptions.length > 0 ? [{ options: valueOptions, label: property.groupValuesLabel }] : []}\n {...asyncValueAutosuggestProps}\n inlineTokens={true}\n hideTokens={true}\n keepOpen={true}\n />\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentWrapper, ElementWrapper } from '@cloudscape-design/test-utils-core/dom';
|
|
2
2
|
import ButtonWrapper from '../button';
|
|
3
|
+
import { FileTokenWrapper } from '../internal/file-token-group';
|
|
3
4
|
export default class FileUploadWrapper extends ComponentWrapper<HTMLElement> {
|
|
4
5
|
static rootSelector: string;
|
|
5
6
|
findUploadButton(): ButtonWrapper;
|
|
@@ -19,13 +20,3 @@ export default class FileUploadWrapper extends ComponentWrapper<HTMLElement> {
|
|
|
19
20
|
findError(): null | ElementWrapper;
|
|
20
21
|
findWarning(): null | ElementWrapper;
|
|
21
22
|
}
|
|
22
|
-
declare class FileTokenWrapper extends ComponentWrapper {
|
|
23
|
-
findFileName(): ElementWrapper;
|
|
24
|
-
findFileSize(): null | ElementWrapper;
|
|
25
|
-
findFileLastModified(): null | ElementWrapper;
|
|
26
|
-
findFileThumbnail(): null | ElementWrapper;
|
|
27
|
-
findFileError(): null | ElementWrapper;
|
|
28
|
-
findFileWarning(): null | ElementWrapper;
|
|
29
|
-
findRemoveButton(): ElementWrapper;
|
|
30
|
-
}
|
|
31
|
-
export {};
|
|
@@ -4,21 +4,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
// SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
const dom_1 = require("@cloudscape-design/test-utils-core/dom");
|
|
6
6
|
const button_1 = require("../button");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
7
|
+
const file_token_group_1 = require("../internal/file-token-group");
|
|
8
|
+
const styles_selectors_js_1 = require("../../../file-upload/styles.selectors.js");
|
|
9
|
+
const styles_selectors_js_2 = require("../../../form-field/styles.selectors.js");
|
|
10
|
+
const styles_selectors_js_3 = require("../../../internal/components/file-input/styles.selectors.js");
|
|
11
|
+
const styles_selectors_js_4 = require("../../../internal/components/file-token-group/styles.selectors.js");
|
|
11
12
|
const styles_selectors_js_5 = require("../../../internal/components/token-list/styles.selectors.js");
|
|
12
|
-
const styles_selectors_js_6 = require("../../../token-group/styles.selectors.js");
|
|
13
13
|
class FileUploadWrapper extends dom_1.ComponentWrapper {
|
|
14
14
|
findUploadButton() {
|
|
15
|
-
return this.findComponent(`.${
|
|
15
|
+
return this.findComponent(`.${styles_selectors_js_3.default['file-input-button']}`, button_1.default);
|
|
16
16
|
}
|
|
17
17
|
findNativeInput() {
|
|
18
|
-
return this.findByClassName(
|
|
18
|
+
return this.findByClassName(styles_selectors_js_3.default['file-input']);
|
|
19
19
|
}
|
|
20
20
|
findFileTokens() {
|
|
21
|
-
return this.findAllByClassName(
|
|
21
|
+
return this.findAllByClassName(styles_selectors_js_4.default.token).map(tokenElement => new file_token_group_1.FileTokenWrapper(tokenElement.getElement()));
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Returns a file token from for a given index.
|
|
@@ -26,7 +26,7 @@ class FileUploadWrapper extends dom_1.ComponentWrapper {
|
|
|
26
26
|
* @param tokenIndex 1-based index of the file token to return.
|
|
27
27
|
*/
|
|
28
28
|
findFileToken(fileTokenIndex) {
|
|
29
|
-
return this.findComponent(`.${
|
|
29
|
+
return this.findComponent(`.${styles_selectors_js_4.default.token}[data-index="${fileTokenIndex - 1}"]`, file_token_group_1.FileTokenWrapper);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Returns the token toggle button.
|
|
@@ -35,38 +35,15 @@ class FileUploadWrapper extends dom_1.ComponentWrapper {
|
|
|
35
35
|
return this.findByClassName(styles_selectors_js_5.default.toggle);
|
|
36
36
|
}
|
|
37
37
|
findConstraint() {
|
|
38
|
-
return this.find(`.${
|
|
38
|
+
return this.find(`.${styles_selectors_js_1.default.hints} .${styles_selectors_js_2.default.constraint}`);
|
|
39
39
|
}
|
|
40
40
|
findError() {
|
|
41
|
-
return this.find(`.${
|
|
41
|
+
return this.find(`.${styles_selectors_js_1.default.hints} .${styles_selectors_js_2.default.error} .${styles_selectors_js_2.default.error__message}`);
|
|
42
42
|
}
|
|
43
43
|
findWarning() {
|
|
44
|
-
return this.find(`.${
|
|
44
|
+
return this.find(`.${styles_selectors_js_1.default.hints} .${styles_selectors_js_2.default.warning} .${styles_selectors_js_2.default.warning__message}`);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
exports.default = FileUploadWrapper;
|
|
48
|
-
FileUploadWrapper.rootSelector =
|
|
49
|
-
class FileTokenWrapper extends dom_1.ComponentWrapper {
|
|
50
|
-
findFileName() {
|
|
51
|
-
return this.findByClassName(styles_selectors_js_1.default['file-option-name']);
|
|
52
|
-
}
|
|
53
|
-
findFileSize() {
|
|
54
|
-
return this.findByClassName(styles_selectors_js_1.default['file-option-size']);
|
|
55
|
-
}
|
|
56
|
-
findFileLastModified() {
|
|
57
|
-
return this.findByClassName(styles_selectors_js_1.default['file-option-last-modified']);
|
|
58
|
-
}
|
|
59
|
-
findFileThumbnail() {
|
|
60
|
-
return this.findByClassName(styles_selectors_js_1.default['file-option-thumbnail-image']);
|
|
61
|
-
}
|
|
62
|
-
findFileError() {
|
|
63
|
-
return this.find(`.${styles_selectors_js_3.default.error} .${styles_selectors_js_3.default.error__message}`);
|
|
64
|
-
}
|
|
65
|
-
findFileWarning() {
|
|
66
|
-
return this.find(`.${styles_selectors_js_3.default.warning} .${styles_selectors_js_3.default.warning__message}`);
|
|
67
|
-
}
|
|
68
|
-
findRemoveButton() {
|
|
69
|
-
return this.findByClassName(styles_selectors_js_6.default['dismiss-button']);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
48
|
+
FileUploadWrapper.rootSelector = styles_selectors_js_1.default.root;
|
|
72
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/file-upload/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,sCAAsC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/file-upload/index.ts"],"names":[],"mappings":";;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,sCAAsC;AACtC,mEAAgE;AAEhE,kFAA2E;AAC3E,iFAAsE;AACtE,qGAAmG;AACnG,2GAAoG;AACpG,qGAA6F;AAE7F,MAAqB,iBAAkB,SAAQ,sBAA6B;IAG1E,gBAAgB;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAwB,CAAC,mBAAmB,CAAC,EAAE,EAAE,gBAAa,CAAE,CAAC;IACjG,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAwB,CAAC,YAAY,CAAC,CAAE,CAAC;IACvE,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,kBAAkB,CAAC,6BAAmB,CAAC,KAAK,CAAC,CAAC,GAAG,CAC3D,YAAY,CAAC,EAAE,CAAC,IAAI,mCAAgB,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC,CAChE,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,aAAa,CAAC,cAAsB;QAClC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAmB,CAAC,KAAK,gBAAgB,cAAc,GAAG,CAAC,IAAI,EAAE,mCAAgB,CAAC,CAAC;IACnH,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAkB,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,6BAAmB,CAAC,KAAK,KAAK,6BAAe,CAAC,UAAU,EAAE,CAAC,CAAC;IACnF,CAAC;IAED,SAAS;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,6BAAmB,CAAC,KAAK,KAAK,6BAAe,CAAC,KAAK,KAAK,6BAAe,CAAC,cAAc,EAAE,CAAC,CAAC;IACjH,CAAC;IAED,WAAW;QACT,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,6BAAmB,CAAC,KAAK,KAAK,6BAAe,CAAC,OAAO,KAAK,6BAAe,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACrH,CAAC;;AA3CH,oCA4CC;AA3CQ,8BAAY,GAAW,6BAAmB,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentWrapper, ElementWrapper } from '@cloudscape-design/test-utils-core/dom';
|
|
2
|
+
export default class FileTokenGroupWrapper extends ComponentWrapper {
|
|
3
|
+
static rootSelector: string;
|
|
4
|
+
findFileTokens(): Array<FileTokenWrapper>;
|
|
5
|
+
/**
|
|
6
|
+
* Returns a file token from for a given index.
|
|
7
|
+
*
|
|
8
|
+
* @param tokenIndex 1-based index of the file token to return.
|
|
9
|
+
*/
|
|
10
|
+
findFileToken(fileTokenIndex: number): null | FileTokenWrapper;
|
|
11
|
+
}
|
|
12
|
+
export declare class FileTokenWrapper extends ComponentWrapper {
|
|
13
|
+
static rootSelector: string;
|
|
14
|
+
findFileName(): ElementWrapper;
|
|
15
|
+
findFileSize(): ElementWrapper;
|
|
16
|
+
findFileLastModified(): ElementWrapper;
|
|
17
|
+
findFileThumbnail(): ElementWrapper;
|
|
18
|
+
findFileError(): ElementWrapper;
|
|
19
|
+
findFileWarning(): ElementWrapper;
|
|
20
|
+
findRemoveButton(): ElementWrapper;
|
|
21
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileTokenWrapper = void 0;
|
|
4
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
5
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
const dom_1 = require("@cloudscape-design/test-utils-core/dom");
|
|
7
|
+
const styles_selectors_js_1 = require("../../../form-field/styles.selectors.js");
|
|
8
|
+
const styles_selectors_js_2 = require("../../../internal/components/file-token-group/styles.selectors.js");
|
|
9
|
+
const styles_selectors_js_3 = require("../../../internal/components/file-token-group/test-classes/styles.selectors.js");
|
|
10
|
+
const styles_selectors_js_4 = require("../../../token-group/styles.selectors.js");
|
|
11
|
+
class FileTokenGroupWrapper extends dom_1.ComponentWrapper {
|
|
12
|
+
findFileTokens() {
|
|
13
|
+
return this.findAllByClassName(styles_selectors_js_2.default.token).map(tokenElement => new FileTokenWrapper(tokenElement.getElement()));
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns a file token from for a given index.
|
|
17
|
+
*
|
|
18
|
+
* @param tokenIndex 1-based index of the file token to return.
|
|
19
|
+
*/
|
|
20
|
+
findFileToken(fileTokenIndex) {
|
|
21
|
+
return this.findComponent(`.${styles_selectors_js_2.default.token}[data-index="${fileTokenIndex - 1}"]`, FileTokenWrapper);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = FileTokenGroupWrapper;
|
|
25
|
+
FileTokenGroupWrapper.rootSelector = styles_selectors_js_3.default.root;
|
|
26
|
+
class FileTokenWrapper extends dom_1.ComponentWrapper {
|
|
27
|
+
findFileName() {
|
|
28
|
+
return this.findByClassName(styles_selectors_js_2.default['file-option-name']);
|
|
29
|
+
}
|
|
30
|
+
findFileSize() {
|
|
31
|
+
return this.findByClassName(styles_selectors_js_2.default['file-option-size']);
|
|
32
|
+
}
|
|
33
|
+
findFileLastModified() {
|
|
34
|
+
return this.findByClassName(styles_selectors_js_2.default['file-option-last-modified']);
|
|
35
|
+
}
|
|
36
|
+
findFileThumbnail() {
|
|
37
|
+
return this.findByClassName(styles_selectors_js_2.default['file-option-thumbnail']);
|
|
38
|
+
}
|
|
39
|
+
findFileError() {
|
|
40
|
+
return this.find(`.${styles_selectors_js_1.default.error} .${styles_selectors_js_1.default.error__message}`);
|
|
41
|
+
}
|
|
42
|
+
findFileWarning() {
|
|
43
|
+
return this.find(`.${styles_selectors_js_1.default.warning} .${styles_selectors_js_1.default.warning__message}`);
|
|
44
|
+
}
|
|
45
|
+
findRemoveButton() {
|
|
46
|
+
return this.findByClassName(styles_selectors_js_4.default['dismiss-button']);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.FileTokenWrapper = FileTokenWrapper;
|
|
50
|
+
FileTokenWrapper.rootSelector = styles_selectors_js_2.default.token;
|
|
51
|
+
//# sourceMappingURL=file-token-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-token-group.js","sourceRoot":"","sources":["../../../../../src/test-utils/dom/internal/file-token-group.ts"],"names":[],"mappings":";;;AAAA,qEAAqE;AACrE,sCAAsC;AACtC,gEAA0F;AAE1F,iFAAsE;AACtE,2GAA0F;AAC1F,wHAA2G;AAC3G,kFAA2E;AAE3E,MAAqB,qBAAsB,SAAQ,sBAAgB;IAGjE,cAAc;QACZ,OAAO,IAAI,CAAC,kBAAkB,CAAC,6BAAS,CAAC,KAAK,CAAC,CAAC,GAAG,CACjD,YAAY,CAAC,EAAE,CAAC,IAAI,gBAAgB,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC,CAChE,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,aAAa,CAAC,cAAsB;QAClC,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,6BAAS,CAAC,KAAK,gBAAgB,cAAc,GAAG,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IACzG,CAAC;;AAhBH,wCAiBC;AAhBQ,kCAAY,GAAW,6BAAa,CAAC,IAAI,CAAC;AAkBnD,MAAa,gBAAiB,SAAQ,sBAAgB;IAGpD,YAAY;QACV,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAS,CAAC,kBAAkB,CAAC,CAAE,CAAC;IAC9D,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAS,CAAC,kBAAkB,CAAC,CAAE,CAAC;IAC9D,CAAC;IAED,oBAAoB;QAClB,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAS,CAAC,2BAA2B,CAAC,CAAE,CAAC;IACvE,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAS,CAAC,uBAAuB,CAAC,CAAE,CAAC;IACnE,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,6BAAe,CAAC,KAAK,KAAK,6BAAe,CAAC,cAAc,EAAE,CAAE,CAAC;IACpF,CAAC;IAED,eAAe;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,6BAAe,CAAC,OAAO,KAAK,6BAAe,CAAC,gBAAgB,EAAE,CAAE,CAAC;IACxF,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,eAAe,CAAC,6BAAmB,CAAC,gBAAgB,CAAC,CAAE,CAAC;IACtE,CAAC;;AA7BH,4CA8BC;AA7BQ,6BAAY,GAAW,6BAAS,CAAC,KAAK,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentWrapper, ElementWrapper } from "@cloudscape-design/test-utils-core/selectors";
|
|
2
2
|
import ButtonWrapper from '../button';
|
|
3
|
+
import { FileTokenWrapper } from '../internal/file-token-group';
|
|
3
4
|
export default class FileUploadWrapper extends ComponentWrapper {
|
|
4
5
|
static rootSelector: string;
|
|
5
6
|
findUploadButton(): ButtonWrapper;
|
|
@@ -19,13 +20,3 @@ export default class FileUploadWrapper extends ComponentWrapper {
|
|
|
19
20
|
findError(): ElementWrapper;
|
|
20
21
|
findWarning(): ElementWrapper;
|
|
21
22
|
}
|
|
22
|
-
declare class FileTokenWrapper extends ComponentWrapper {
|
|
23
|
-
findFileName(): ElementWrapper;
|
|
24
|
-
findFileSize(): ElementWrapper;
|
|
25
|
-
findFileLastModified(): ElementWrapper;
|
|
26
|
-
findFileThumbnail(): ElementWrapper;
|
|
27
|
-
findFileError(): ElementWrapper;
|
|
28
|
-
findFileWarning(): ElementWrapper;
|
|
29
|
-
findRemoveButton(): ElementWrapper;
|
|
30
|
-
}
|
|
31
|
-
export {};
|