@cloudscape-design/components-themeable 3.0.1136 → 3.0.1138
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/generated/custom-css-properties/index.scss +103 -99
- package/lib/internal/scss/progress-bar/styles.scss +39 -25
- package/lib/internal/scss/radio-group/analytics-metadata/styles.scss +8 -0
- package/lib/internal/template/alert/styles.css.js +27 -27
- package/lib/internal/template/alert/styles.scoped.css +50 -50
- package/lib/internal/template/alert/styles.selectors.js +27 -27
- package/lib/internal/template/annotation-context/annotation/styles.css.js +24 -24
- package/lib/internal/template/annotation-context/annotation/styles.scoped.css +32 -32
- package/lib/internal/template/annotation-context/annotation/styles.selectors.js +24 -24
- package/lib/internal/template/app-layout/notifications/styles.css.js +3 -3
- package/lib/internal/template/app-layout/notifications/styles.scoped.css +7 -7
- package/lib/internal/template/app-layout/notifications/styles.selectors.js +3 -3
- package/lib/internal/template/app-layout/visual-refresh/styles.css.js +86 -86
- package/lib/internal/template/app-layout/visual-refresh/styles.scoped.css +258 -258
- package/lib/internal/template/app-layout/visual-refresh/styles.selectors.js +86 -86
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +30 -30
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +87 -87
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +30 -30
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.css.js +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.scoped.css +7 -7
- package/lib/internal/template/app-layout/visual-refresh-toolbar/navigation/styles.selectors.js +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +27 -27
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +54 -54
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +27 -27
- package/lib/internal/template/attribute-editor/index.d.ts.map +1 -1
- package/lib/internal/template/attribute-editor/index.js +2 -2
- package/lib/internal/template/attribute-editor/index.js.map +1 -1
- package/lib/internal/template/attribute-editor/interfaces.d.ts +8 -0
- package/lib/internal/template/attribute-editor/interfaces.d.ts.map +1 -1
- package/lib/internal/template/attribute-editor/interfaces.js.map +1 -1
- package/lib/internal/template/attribute-editor/internal.d.ts.map +1 -1
- package/lib/internal/template/attribute-editor/internal.js +9 -6
- package/lib/internal/template/attribute-editor/internal.js.map +1 -1
- package/lib/internal/template/attribute-editor/styles.css.js +15 -15
- package/lib/internal/template/attribute-editor/styles.scoped.css +28 -28
- package/lib/internal/template/attribute-editor/styles.selectors.js +15 -15
- package/lib/internal/template/breadcrumb-group/item/styles.css.js +7 -7
- package/lib/internal/template/breadcrumb-group/item/styles.scoped.css +28 -28
- package/lib/internal/template/breadcrumb-group/item/styles.selectors.js +7 -7
- package/lib/internal/template/button/styles.css.js +22 -22
- package/lib/internal/template/button/styles.scoped.css +256 -256
- package/lib/internal/template/button/styles.selectors.js +22 -22
- package/lib/internal/template/button-dropdown/item-element/styles.css.js +16 -16
- package/lib/internal/template/button-dropdown/item-element/styles.scoped.css +27 -27
- package/lib/internal/template/button-dropdown/item-element/styles.selectors.js +16 -16
- package/lib/internal/template/checkbox/styles.css.js +3 -3
- package/lib/internal/template/checkbox/styles.scoped.css +11 -11
- package/lib/internal/template/checkbox/styles.selectors.js +3 -3
- package/lib/internal/template/content-layout/styles.css.js +14 -14
- package/lib/internal/template/content-layout/styles.scoped.css +27 -27
- package/lib/internal/template/content-layout/styles.selectors.js +14 -14
- package/lib/internal/template/flashbar/styles.css.js +50 -50
- package/lib/internal/template/flashbar/styles.scoped.css +187 -187
- package/lib/internal/template/flashbar/styles.selectors.js +50 -50
- package/lib/internal/template/header/analytics/use-table-integration.d.ts +2 -1
- package/lib/internal/template/header/analytics/use-table-integration.d.ts.map +1 -1
- package/lib/internal/template/header/analytics/use-table-integration.js +8 -1
- package/lib/internal/template/header/analytics/use-table-integration.js.map +1 -1
- package/lib/internal/template/header/interfaces.d.ts +2 -2
- package/lib/internal/template/header/interfaces.d.ts.map +1 -1
- package/lib/internal/template/header/interfaces.js.map +1 -1
- package/lib/internal/template/help-panel/styles.css.js +6 -6
- package/lib/internal/template/help-panel/styles.scoped.css +73 -73
- package/lib/internal/template/help-panel/styles.selectors.js +6 -6
- package/lib/internal/template/icon/generated/icons.d.ts +1 -0
- package/lib/internal/template/icon/generated/icons.d.ts.map +1 -1
- package/lib/internal/template/icon/generated/icons.js +3 -0
- package/lib/internal/template/icon/generated/icons.js.map +1 -1
- package/lib/internal/template/icon/interfaces.d.ts +1 -1
- package/lib/internal/template/icon/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon/interfaces.js.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.d.ts +1 -0
- package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
- package/lib/internal/template/input/styles.css.js +13 -13
- package/lib/internal/template/input/styles.scoped.css +65 -65
- package/lib/internal/template/input/styles.selectors.js +13 -13
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.css.js +20 -20
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.scoped.css +48 -48
- package/lib/internal/template/internal/components/drag-handle-wrapper/styles.selectors.js +20 -20
- package/lib/internal/template/internal/components/dropdown/styles.css.js +20 -20
- package/lib/internal/template/internal/components/dropdown/styles.scoped.css +38 -38
- package/lib/internal/template/internal/components/dropdown/styles.selectors.js +20 -20
- package/lib/internal/template/internal/components/token-list/styles.css.js +10 -10
- package/lib/internal/template/internal/components/token-list/styles.scoped.css +25 -25
- package/lib/internal/template/internal/components/token-list/styles.selectors.js +10 -10
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts +4 -0
- package/lib/internal/template/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/lib/internal/template/internal/generated/custom-css-properties/index.js +102 -98
- package/lib/internal/template/internal/generated/custom-css-properties/index.js.map +1 -1
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +50 -75
- package/lib/internal/template/internal/generated/styles/tokens.js +50 -75
- package/lib/internal/template/internal/generated/theming/index.cjs +305 -461
- package/lib/internal/template/internal/generated/theming/index.js +305 -461
- package/lib/internal/template/link/styles.css.js +20 -20
- package/lib/internal/template/link/styles.scoped.css +103 -103
- package/lib/internal/template/link/styles.selectors.js +20 -20
- package/lib/internal/template/progress-bar/index.d.ts +1 -1
- package/lib/internal/template/progress-bar/index.d.ts.map +1 -1
- package/lib/internal/template/progress-bar/index.js +2 -2
- package/lib/internal/template/progress-bar/index.js.map +1 -1
- package/lib/internal/template/progress-bar/interfaces.d.ts +19 -0
- package/lib/internal/template/progress-bar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/progress-bar/interfaces.js.map +1 -1
- package/lib/internal/template/progress-bar/internal.d.ts +2 -1
- package/lib/internal/template/progress-bar/internal.d.ts.map +1 -1
- package/lib/internal/template/progress-bar/internal.js +7 -3
- package/lib/internal/template/progress-bar/internal.js.map +1 -1
- package/lib/internal/template/progress-bar/styles.css.js +19 -19
- package/lib/internal/template/progress-bar/styles.d.ts +16 -0
- package/lib/internal/template/progress-bar/styles.d.ts.map +1 -0
- package/lib/internal/template/progress-bar/styles.js +33 -0
- package/lib/internal/template/progress-bar/styles.js.map +1 -0
- package/lib/internal/template/progress-bar/styles.scoped.css +56 -56
- package/lib/internal/template/progress-bar/styles.selectors.js +19 -19
- package/lib/internal/template/radio-group/analytics-metadata/interfaces.d.ts +1 -0
- package/lib/internal/template/radio-group/analytics-metadata/interfaces.d.ts.map +1 -1
- package/lib/internal/template/radio-group/analytics-metadata/interfaces.js.map +1 -1
- package/lib/internal/template/radio-group/analytics-metadata/styles.css.js +6 -0
- package/lib/internal/template/radio-group/analytics-metadata/styles.scoped.css +7 -0
- package/lib/internal/template/radio-group/analytics-metadata/styles.selectors.js +7 -0
- package/lib/internal/template/radio-group/index.d.ts.map +1 -1
- package/lib/internal/template/radio-group/index.js +2 -0
- package/lib/internal/template/radio-group/index.js.map +1 -1
- package/lib/internal/template/radio-group/internal.d.ts.map +1 -1
- package/lib/internal/template/radio-group/internal.js +2 -1
- package/lib/internal/template/radio-group/internal.js.map +1 -1
- package/lib/internal/template/radio-group/styles.css.js +10 -10
- package/lib/internal/template/radio-group/styles.scoped.css +22 -22
- package/lib/internal/template/radio-group/styles.selectors.js +10 -10
- package/lib/internal/template/s3-resource-selector/index.d.ts.map +1 -1
- package/lib/internal/template/s3-resource-selector/index.js +2 -2
- package/lib/internal/template/s3-resource-selector/index.js.map +1 -1
- package/lib/internal/template/s3-resource-selector/interfaces.d.ts +8 -0
- package/lib/internal/template/s3-resource-selector/interfaces.d.ts.map +1 -1
- package/lib/internal/template/s3-resource-selector/interfaces.js.map +1 -1
- package/lib/internal/template/s3-resource-selector/s3-in-context/index.d.ts +3 -0
- package/lib/internal/template/s3-resource-selector/s3-in-context/index.d.ts.map +1 -1
- package/lib/internal/template/s3-resource-selector/s3-in-context/index.js +8 -2
- package/lib/internal/template/s3-resource-selector/s3-in-context/index.js.map +1 -1
- package/lib/internal/template/slider/styles.css.js +26 -26
- package/lib/internal/template/slider/styles.scoped.css +86 -86
- package/lib/internal/template/slider/styles.selectors.js +26 -26
- package/lib/internal/template/spinner/styles.css.js +13 -13
- package/lib/internal/template/spinner/styles.scoped.css +39 -39
- package/lib/internal/template/spinner/styles.selectors.js +13 -13
- package/lib/internal/template/tag-editor/styles.css.js +3 -3
- package/lib/internal/template/tag-editor/styles.scoped.css +13 -13
- package/lib/internal/template/tag-editor/styles.selectors.js +3 -3
- package/lib/internal/template/text-content/styles.css.js +1 -1
- package/lib/internal/template/text-content/styles.scoped.css +66 -66
- package/lib/internal/template/text-content/styles.selectors.js +1 -1
- package/lib/internal/template/textarea/styles.css.js +5 -5
- package/lib/internal/template/textarea/styles.scoped.css +41 -41
- package/lib/internal/template/textarea/styles.selectors.js +5 -5
- package/lib/internal/template/toggle/styles.css.js +10 -10
- package/lib/internal/template/toggle/styles.scoped.css +23 -23
- package/lib/internal/template/toggle/styles.selectors.js +10 -10
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/radio-group/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/radio-group/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FAmBd,CAAC;AAGH,eAAe,UAAU,CAAC"}
|
|
@@ -6,6 +6,7 @@ import { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-tool
|
|
|
6
6
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
7
7
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
8
8
|
import InternalRadioGroup from './internal';
|
|
9
|
+
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
9
10
|
const RadioGroup = React.forwardRef((props, ref) => {
|
|
10
11
|
const baseComponentProps = useBaseComponent('RadioGroup', { props: { readOnly: props.readOnly } });
|
|
11
12
|
return (React.createElement(InternalRadioGroup, Object.assign({ ref: ref }, props, baseComponentProps, getAnalyticsMetadataAttribute({
|
|
@@ -14,6 +15,7 @@ const RadioGroup = React.forwardRef((props, ref) => {
|
|
|
14
15
|
label: { root: 'self' },
|
|
15
16
|
properties: {
|
|
16
17
|
value: `${props.value}`,
|
|
18
|
+
valueLabel: `.${analyticsSelectors.selected}`,
|
|
17
19
|
},
|
|
18
20
|
},
|
|
19
21
|
}))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/radio-group/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,kBAAkB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/radio-group/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,kBAAkB,MAAM,YAAY,CAAC;AAE5C,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAIpE,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,KAAsB,EAAE,GAAmC,EAAE,EAAE;IAClG,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACnG,OAAO,CACL,oBAAC,kBAAkB,kBACjB,GAAG,EAAE,GAAG,IACJ,KAAK,EACL,kBAAkB,EAClB,6BAA6B,CAAC;QAChC,SAAS,EAAE;YACT,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;YACvB,UAAU,EAAE;gBACV,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE;gBACvB,UAAU,EAAE,IAAI,kBAAkB,CAAC,QAAQ,EAAE;aAC9C;SAC+C;KACnD,CAAC,EACF,CACH,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAC3C,eAAe,UAAU,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 { GeneratedAnalyticsMetadataRadioGroupComponent } from './analytics-metadata/interfaces';\nimport { RadioGroupProps } from './interfaces';\nimport InternalRadioGroup from './internal';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\n\nexport { RadioGroupProps };\n\nconst RadioGroup = React.forwardRef((props: RadioGroupProps, ref: React.Ref<RadioGroupProps.Ref>) => {\n const baseComponentProps = useBaseComponent('RadioGroup', { props: { readOnly: props.readOnly } });\n return (\n <InternalRadioGroup\n ref={ref}\n {...props}\n {...baseComponentProps}\n {...getAnalyticsMetadataAttribute({\n component: {\n name: 'awsui.RadioGroup',\n label: { root: 'self' },\n properties: {\n value: `${props.value}`,\n valueLabel: `.${analyticsSelectors.selected}`,\n },\n } as GeneratedAnalyticsMetadataRadioGroupComponent,\n })}\n />\n );\n});\n\napplyDisplayName(RadioGroup, 'RadioGroup');\nexport default RadioGroup;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAQ/C,QAAA,MAAM,kBAAkB,0HAmEvB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -9,6 +9,7 @@ import { getBaseProps } from '../internal/base-component';
|
|
|
9
9
|
import { useFormFieldContext } from '../internal/context/form-field-context';
|
|
10
10
|
import useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';
|
|
11
11
|
import RadioButton from './radio-button';
|
|
12
|
+
import analyticsSelectors from './analytics-metadata/styles.css.js';
|
|
12
13
|
import styles from './styles.css.js';
|
|
13
14
|
const InternalRadioGroup = React.forwardRef((_a, ref) => {
|
|
14
15
|
var { name, value, items, ariaLabel, ariaRequired, ariaControls, onChange, readOnly, __internalRootRef, style } = _a, props = __rest(_a, ["name", "value", "items", "ariaLabel", "ariaRequired", "ariaControls", "onChange", "readOnly", "__internalRootRef", "style"]);
|
|
@@ -17,7 +18,7 @@ const InternalRadioGroup = React.forwardRef((_a, ref) => {
|
|
|
17
18
|
const generatedName = useUniqueId('awsui-radio-');
|
|
18
19
|
const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);
|
|
19
20
|
return (React.createElement("div", Object.assign({ role: "radiogroup", "aria-labelledby": ariaLabelledby, "aria-label": ariaLabel, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired, "aria-controls": ariaControls, "aria-readonly": readOnly ? 'true' : undefined }, baseProps, { className: clsx(baseProps.className, styles.root), ref: __internalRootRef }), items &&
|
|
20
|
-
items.map((item, index) => (React.createElement(RadioButton, Object.assign({ key: item.value, ref: index === radioButtonRefIndex ? radioButtonRef : undefined, checked: item.value === value, name: name || generatedName, value: item.value, label: item.label, description: item.description, disabled: item.disabled, onChange: onChange, controlId: item.controlId, readOnly: readOnly, style: style }, getAnalyticsMetadataAttribute(!item.disabled && !readOnly
|
|
21
|
+
items.map((item, index) => (React.createElement(RadioButton, Object.assign({ key: item.value, ref: index === radioButtonRefIndex ? radioButtonRef : undefined, className: clsx(item.value === value && analyticsSelectors.selected), checked: item.value === value, name: name || generatedName, value: item.value, label: item.label, description: item.description, disabled: item.disabled, onChange: onChange, controlId: item.controlId, readOnly: readOnly, style: style }, getAnalyticsMetadataAttribute(!item.disabled && !readOnly
|
|
21
22
|
? {
|
|
22
23
|
detail: {
|
|
23
24
|
position: `${index + 1}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,yBAAyB,MAAM,6CAA6C,CAAC;AAIpF,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CACzC,CACE,EAY0B,EAC1B,GAAmC,EACnC,EAAE;QAdF,EACE,IAAI,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,iBAAiB,EACjB,K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C,QAAQ,IAAI,CAAC,QAAQ;YACzB,CAAC,CAAC;gBACE,MAAM,EAAE;oBACN,QAAQ,EAAE,GAAG,KAAK,GAAG,CAAC,EAAE;oBACxB,KAAK,EAAE,IAAI,CAAC,KAAK;iBAC+C;aACnE;YACH,CAAC,CAAC,EAAE,CACP,EACD,CACH,CAAC,CACA,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { GeneratedAnalyticsMetadataRadioGroupSelect } from './analytics-metadata/interfaces';\nimport { RadioGroupProps } from './interfaces';\nimport RadioButton from './radio-button';\n\nimport styles from './styles.css.js';\n\ntype InternalRadioGroupProps = RadioGroupProps & InternalBaseComponentProps;\n\nconst InternalRadioGroup = React.forwardRef(\n (\n {\n name,\n value,\n items,\n ariaLabel,\n ariaRequired,\n ariaControls,\n onChange,\n readOnly,\n __internalRootRef,\n style,\n ...props\n }: InternalRadioGroupProps,\n ref: React.Ref<RadioGroupProps.Ref>\n ) => {\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);\n const baseProps = getBaseProps(props);\n const generatedName = useUniqueId('awsui-radio-');\n\n const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);\n\n return (\n <div\n role=\"radiogroup\"\n aria-labelledby={ariaLabelledby}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-required={ariaRequired}\n aria-controls={ariaControls}\n aria-readonly={readOnly ? 'true' : undefined}\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n ref={__internalRootRef}\n >\n {items &&\n items.map((item, index) => (\n <RadioButton\n key={item.value}\n ref={index === radioButtonRefIndex ? radioButtonRef : undefined}\n checked={item.value === value}\n name={name || generatedName}\n value={item.value}\n label={item.label}\n description={item.description}\n disabled={item.disabled}\n onChange={onChange}\n controlId={item.controlId}\n readOnly={readOnly}\n style={style}\n {...getAnalyticsMetadataAttribute(\n !item.disabled && !readOnly\n ? {\n detail: {\n position: `${index + 1}`,\n value: item.value,\n } as Partial<GeneratedAnalyticsMetadataRadioGroupSelect['detail']>,\n }\n : {}\n )}\n />\n ))}\n </div>\n );\n }\n);\n\nexport default InternalRadioGroup;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/radio-group/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,yBAAyB,MAAM,6CAA6C,CAAC;AAIpF,OAAO,WAAW,MAAM,gBAAgB,CAAC;AAEzC,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AACpE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CACzC,CACE,EAY0B,EAC1B,GAAmC,EACnC,EAAE;QAdF,EACE,IAAI,EACJ,KAAK,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,iB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E,IAAI,CAAC,SAAS,EACzB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,IACR,6BAA6B,CAC/B,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ;YACzB,CAAC,CAAC;gBACE,MAAM,EAAE;oBACN,QAAQ,EAAE,GAAG,KAAK,GAAG,CAAC,EAAE;oBACxB,KAAK,EAAE,IAAI,CAAC,KAAK;iBAC+C;aACnE;YACH,CAAC,CAAC,EAAE,CACP,EACD,CACH,CAAC,CACA,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport useRadioGroupForwardFocus from '../internal/hooks/forward-focus/radio-group';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { GeneratedAnalyticsMetadataRadioGroupSelect } from './analytics-metadata/interfaces';\nimport { RadioGroupProps } from './interfaces';\nimport RadioButton from './radio-button';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\ntype InternalRadioGroupProps = RadioGroupProps & InternalBaseComponentProps;\n\nconst InternalRadioGroup = React.forwardRef(\n (\n {\n name,\n value,\n items,\n ariaLabel,\n ariaRequired,\n ariaControls,\n onChange,\n readOnly,\n __internalRootRef,\n style,\n ...props\n }: InternalRadioGroupProps,\n ref: React.Ref<RadioGroupProps.Ref>\n ) => {\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(props);\n const baseProps = getBaseProps(props);\n const generatedName = useUniqueId('awsui-radio-');\n\n const [radioButtonRef, radioButtonRefIndex] = useRadioGroupForwardFocus(ref, items, value);\n\n return (\n <div\n role=\"radiogroup\"\n aria-labelledby={ariaLabelledby}\n aria-label={ariaLabel}\n aria-describedby={ariaDescribedby}\n aria-required={ariaRequired}\n aria-controls={ariaControls}\n aria-readonly={readOnly ? 'true' : undefined}\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n ref={__internalRootRef}\n >\n {items &&\n items.map((item, index) => (\n <RadioButton\n key={item.value}\n ref={index === radioButtonRefIndex ? radioButtonRef : undefined}\n className={clsx(item.value === value && analyticsSelectors.selected)}\n checked={item.value === value}\n name={name || generatedName}\n value={item.value}\n label={item.label}\n description={item.description}\n disabled={item.disabled}\n onChange={onChange}\n controlId={item.controlId}\n readOnly={readOnly}\n style={style}\n {...getAnalyticsMetadataAttribute(\n !item.disabled && !readOnly\n ? {\n detail: {\n position: `${index + 1}`,\n value: item.value,\n } as Partial<GeneratedAnalyticsMetadataRadioGroupSelect['detail']>,\n }\n : {}\n )}\n />\n ))}\n </div>\n );\n }\n);\n\nexport default InternalRadioGroup;\n"]}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"radio": "
|
|
6
|
-
"radio--has-description": "awsui_radio--has-
|
|
7
|
-
"radio-control": "awsui_radio-
|
|
8
|
-
"outline": "
|
|
9
|
-
"styled-circle-border": "awsui_styled-circle-
|
|
10
|
-
"styled-circle-disabled": "awsui_styled-circle-
|
|
11
|
-
"styled-circle-readonly": "awsui_styled-circle-
|
|
12
|
-
"styled-circle-fill": "awsui_styled-circle-
|
|
13
|
-
"styled-circle-checked": "awsui_styled-circle-
|
|
4
|
+
"root": "awsui_root_1mabk_3yc3x_145",
|
|
5
|
+
"radio": "awsui_radio_1mabk_3yc3x_178",
|
|
6
|
+
"radio--has-description": "awsui_radio--has-description_1mabk_3yc3x_186",
|
|
7
|
+
"radio-control": "awsui_radio-control_1mabk_3yc3x_190",
|
|
8
|
+
"outline": "awsui_outline_1mabk_3yc3x_198",
|
|
9
|
+
"styled-circle-border": "awsui_styled-circle-border_1mabk_3yc3x_221",
|
|
10
|
+
"styled-circle-disabled": "awsui_styled-circle-disabled_1mabk_3yc3x_225",
|
|
11
|
+
"styled-circle-readonly": "awsui_styled-circle-readonly_1mabk_3yc3x_225",
|
|
12
|
+
"styled-circle-fill": "awsui_styled-circle-fill_1mabk_3yc3x_230",
|
|
13
|
+
"styled-circle-checked": "awsui_styled-circle-checked_1mabk_3yc3x_246"
|
|
14
14
|
};
|
|
15
15
|
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
*/
|
|
143
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.
|
|
145
|
+
.awsui_root_1mabk_3yc3x_145:not(#\9) {
|
|
146
146
|
border-collapse: separate;
|
|
147
147
|
border-spacing: 0;
|
|
148
148
|
box-sizing: border-box;
|
|
@@ -175,19 +175,19 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
175
175
|
display: block;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
.
|
|
178
|
+
.awsui_radio_1mabk_3yc3x_178:not(#\9) {
|
|
179
179
|
/*used in test-utils*/
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
.
|
|
182
|
+
.awsui_radio_1mabk_3yc3x_178 + .awsui_radio_1mabk_3yc3x_178:not(#\9) {
|
|
183
183
|
margin-block-start: var(--space-scaled-xxs-jatbiv, 4px);
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
.awsui_radio--has-
|
|
186
|
+
.awsui_radio--has-description_1mabk_3yc3x_186 + .awsui_radio_1mabk_3yc3x_178:not(#\9) {
|
|
187
187
|
margin-block-start: var(--space-scaled-xs-sppte9, 8px);
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
.awsui_radio-
|
|
190
|
+
.awsui_radio-control_1mabk_3yc3x_190:not(#\9) {
|
|
191
191
|
margin-block-start: calc((var(--line-height-body-m-bedeoh, 22px) - var(--size-control-lkpwjy, 14px)) / 2);
|
|
192
192
|
min-block-size: var(--size-control-lkpwjy, 14px);
|
|
193
193
|
min-inline-size: var(--size-control-lkpwjy, 14px);
|
|
@@ -195,15 +195,15 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
195
195
|
inline-size: var(--size-control-lkpwjy, 14px);
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
.
|
|
199
|
-
--awsui-style-focus-ring-box-shadow-
|
|
198
|
+
.awsui_outline_1mabk_3yc3x_198:not(#\9) {
|
|
199
|
+
--awsui-style-focus-ring-box-shadow-9t5olz: 0 0 0 var(--awsui-style-focus-ring-border-width-9t5olz, 2px) var(--awsui-style-focus-ring-border-color-9t5olz, var(--color-border-item-focused-r5f6xl, #0073bb));
|
|
200
200
|
position: relative;
|
|
201
201
|
}
|
|
202
|
-
.
|
|
202
|
+
.awsui_outline_1mabk_3yc3x_198:not(#\9) {
|
|
203
203
|
outline: 2px dotted transparent;
|
|
204
204
|
outline-offset: calc(2px - 1px);
|
|
205
205
|
}
|
|
206
|
-
.
|
|
206
|
+
.awsui_outline_1mabk_3yc3x_198:not(#\9)::before {
|
|
207
207
|
content: " ";
|
|
208
208
|
display: block;
|
|
209
209
|
position: absolute;
|
|
@@ -211,46 +211,46 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
211
211
|
inset-block-start: calc(-1 * 2px);
|
|
212
212
|
inline-size: calc(100% + 2px + 2px);
|
|
213
213
|
block-size: calc(100% + 2px + 2px);
|
|
214
|
-
border-start-start-radius: var(--awsui-style-focus-ring-border-radius-
|
|
215
|
-
border-start-end-radius: var(--awsui-style-focus-ring-border-radius-
|
|
216
|
-
border-end-start-radius: var(--awsui-style-focus-ring-border-radius-
|
|
217
|
-
border-end-end-radius: var(--awsui-style-focus-ring-border-radius-
|
|
218
|
-
box-shadow: var(--awsui-style-focus-ring-box-shadow-
|
|
214
|
+
border-start-start-radius: var(--awsui-style-focus-ring-border-radius-9t5olz, var(--border-radius-control-circular-focus-ring-0v2apg, 50%));
|
|
215
|
+
border-start-end-radius: var(--awsui-style-focus-ring-border-radius-9t5olz, var(--border-radius-control-circular-focus-ring-0v2apg, 50%));
|
|
216
|
+
border-end-start-radius: var(--awsui-style-focus-ring-border-radius-9t5olz, var(--border-radius-control-circular-focus-ring-0v2apg, 50%));
|
|
217
|
+
border-end-end-radius: var(--awsui-style-focus-ring-border-radius-9t5olz, var(--border-radius-control-circular-focus-ring-0v2apg, 50%));
|
|
218
|
+
box-shadow: var(--awsui-style-focus-ring-box-shadow-9t5olz);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
.awsui_styled-circle-
|
|
221
|
+
.awsui_styled-circle-border_1mabk_3yc3x_221:not(#\9) {
|
|
222
222
|
stroke: var(--color-border-control-default-e686ow, #687078);
|
|
223
223
|
fill: var(--color-background-control-default-wjdczs, #ffffff);
|
|
224
224
|
}
|
|
225
|
-
.awsui_styled-circle-
|
|
225
|
+
.awsui_styled-circle-border_1mabk_3yc3x_221.awsui_styled-circle-disabled_1mabk_3yc3x_225:not(#\9), .awsui_styled-circle-border_1mabk_3yc3x_221.awsui_styled-circle-readonly_1mabk_3yc3x_225:not(#\9) {
|
|
226
226
|
fill: var(--color-background-control-disabled-2ixett, #d5dbdb);
|
|
227
227
|
stroke: var(--color-background-control-disabled-2ixett, #d5dbdb);
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
.awsui_styled-circle-
|
|
230
|
+
.awsui_styled-circle-fill_1mabk_3yc3x_230:not(#\9) {
|
|
231
231
|
stroke: var(--color-background-control-checked-se0x0e, #0073bb);
|
|
232
232
|
fill: var(--color-foreground-control-default-rf7v4a, #ffffff);
|
|
233
233
|
opacity: 0;
|
|
234
234
|
transition: opacity var(--motion-duration-transition-quick-ucajl5, 90ms) var(--motion-easing-transition-quick-034duw, linear);
|
|
235
235
|
}
|
|
236
236
|
@media (prefers-reduced-motion: reduce) {
|
|
237
|
-
.awsui_styled-circle-
|
|
237
|
+
.awsui_styled-circle-fill_1mabk_3yc3x_230:not(#\9) {
|
|
238
238
|
animation: none;
|
|
239
239
|
transition: none;
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
.awsui-motion-disabled .awsui_styled-circle-
|
|
242
|
+
.awsui-motion-disabled .awsui_styled-circle-fill_1mabk_3yc3x_230:not(#\9), .awsui-mode-entering .awsui_styled-circle-fill_1mabk_3yc3x_230:not(#\9) {
|
|
243
243
|
animation: none;
|
|
244
244
|
transition: none;
|
|
245
245
|
}
|
|
246
|
-
.awsui_styled-circle-
|
|
246
|
+
.awsui_styled-circle-fill_1mabk_3yc3x_230.awsui_styled-circle-checked_1mabk_3yc3x_246:not(#\9) {
|
|
247
247
|
opacity: 1;
|
|
248
248
|
}
|
|
249
|
-
.awsui_styled-circle-
|
|
249
|
+
.awsui_styled-circle-fill_1mabk_3yc3x_230.awsui_styled-circle-disabled_1mabk_3yc3x_225:not(#\9) {
|
|
250
250
|
fill: var(--color-foreground-control-disabled-kj751b, #ffffff);
|
|
251
251
|
stroke: var(--color-background-control-disabled-2ixett, #d5dbdb);
|
|
252
252
|
}
|
|
253
|
-
.awsui_styled-circle-
|
|
253
|
+
.awsui_styled-circle-fill_1mabk_3yc3x_230.awsui_styled-circle-readonly_1mabk_3yc3x_225:not(#\9) {
|
|
254
254
|
fill: var(--color-foreground-control-read-only-cgy3yn, #687078);
|
|
255
255
|
stroke: var(--color-background-control-disabled-2ixett, #d5dbdb);
|
|
256
256
|
}
|
|
@@ -2,15 +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
|
-
"radio": "
|
|
7
|
-
"radio--has-description": "awsui_radio--has-
|
|
8
|
-
"radio-control": "awsui_radio-
|
|
9
|
-
"outline": "
|
|
10
|
-
"styled-circle-border": "awsui_styled-circle-
|
|
11
|
-
"styled-circle-disabled": "awsui_styled-circle-
|
|
12
|
-
"styled-circle-readonly": "awsui_styled-circle-
|
|
13
|
-
"styled-circle-fill": "awsui_styled-circle-
|
|
14
|
-
"styled-circle-checked": "awsui_styled-circle-
|
|
5
|
+
"root": "awsui_root_1mabk_3yc3x_145",
|
|
6
|
+
"radio": "awsui_radio_1mabk_3yc3x_178",
|
|
7
|
+
"radio--has-description": "awsui_radio--has-description_1mabk_3yc3x_186",
|
|
8
|
+
"radio-control": "awsui_radio-control_1mabk_3yc3x_190",
|
|
9
|
+
"outline": "awsui_outline_1mabk_3yc3x_198",
|
|
10
|
+
"styled-circle-border": "awsui_styled-circle-border_1mabk_3yc3x_221",
|
|
11
|
+
"styled-circle-disabled": "awsui_styled-circle-disabled_1mabk_3yc3x_225",
|
|
12
|
+
"styled-circle-readonly": "awsui_styled-circle-readonly_1mabk_3yc3x_225",
|
|
13
|
+
"styled-circle-fill": "awsui_styled-circle-fill_1mabk_3yc3x_230",
|
|
14
|
+
"styled-circle-checked": "awsui_styled-circle-checked_1mabk_3yc3x_246"
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/s3-resource-selector/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAW3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAMvD,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,QAAA,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/s3-resource-selector/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAW3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAMvD,OAAO,EAAE,uBAAuB,EAAE,CAAC;AAEnC,QAAA,MAAM,kBAAkB,6GAwGvB,CAAC;AAGF,eAAe,kBAAkB,CAAC"}
|
|
@@ -16,7 +16,7 @@ import { S3InContext } from './s3-in-context';
|
|
|
16
16
|
import { S3Modal } from './s3-modal';
|
|
17
17
|
import styles from './styles.css.js';
|
|
18
18
|
const S3ResourceSelector = React.forwardRef((_a, ref) => {
|
|
19
|
-
var { i18nStrings, inputPlaceholder, alert, resource, viewHref, invalid, selectableItemsTypes = [], inputAriaDescribedby, bucketsVisibleColumns = ['Name', 'CreationDate'], bucketsIsItemDisabled, fetchBuckets, fetchObjects, objectsVisibleColumns = ['Key', 'LastModified', 'Size'], objectsIsItemDisabled, fetchVersions, versionsVisibleColumns = ['ID', 'LastModified', 'Size'], versionsIsItemDisabled, onChange, ariaLabel, getModalRoot, removeModalRoot } = _a, rest = __rest(_a, ["i18nStrings", "inputPlaceholder", "alert", "resource", "viewHref", "invalid", "selectableItemsTypes", "inputAriaDescribedby", "bucketsVisibleColumns", "bucketsIsItemDisabled", "fetchBuckets", "fetchObjects", "objectsVisibleColumns", "objectsIsItemDisabled", "fetchVersions", "versionsVisibleColumns", "versionsIsItemDisabled", "onChange", "ariaLabel", "getModalRoot", "removeModalRoot"]);
|
|
19
|
+
var { i18nStrings, inputPlaceholder, alert, resource, viewHref, invalid, selectableItemsTypes = [], inputAriaDescribedby, bucketsVisibleColumns = ['Name', 'CreationDate'], bucketsIsItemDisabled, fetchBuckets, fetchObjects, objectsVisibleColumns = ['Key', 'LastModified', 'Size'], objectsIsItemDisabled, fetchVersions, versionsVisibleColumns = ['ID', 'LastModified', 'Size'], versionsIsItemDisabled, onChange, ariaLabel, getModalRoot, removeModalRoot, onInputFocus, onInputBlur } = _a, rest = __rest(_a, ["i18nStrings", "inputPlaceholder", "alert", "resource", "viewHref", "invalid", "selectableItemsTypes", "inputAriaDescribedby", "bucketsVisibleColumns", "bucketsIsItemDisabled", "fetchBuckets", "fetchObjects", "objectsVisibleColumns", "objectsIsItemDisabled", "fetchVersions", "versionsVisibleColumns", "versionsIsItemDisabled", "onChange", "ariaLabel", "getModalRoot", "removeModalRoot", "onInputFocus", "onInputBlur"]);
|
|
20
20
|
checkSafeUrl('S3ResourceSelector', viewHref);
|
|
21
21
|
const { __internalRootRef } = useBaseComponent('S3ResourceSelector');
|
|
22
22
|
const [modalOpen, setModalOpen] = useState(false);
|
|
@@ -57,7 +57,7 @@ const S3ResourceSelector = React.forwardRef((_a, ref) => {
|
|
|
57
57
|
onDismiss: () => setModalOpen(false),
|
|
58
58
|
};
|
|
59
59
|
return (React.createElement("div", Object.assign({}, baseProps, { className: clsx(styles.root, baseProps.className), ref: __internalRootRef, role: "group", "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-label": ariaLabel }),
|
|
60
|
-
React.createElement(S3InContext, { ref: inContextRef, selectableItemsTypes: selectableItemsTypes, i18nStrings: i18nStrings, inputPlaceholder: inputPlaceholder, resource: resource, viewHref: viewHref, invalid: invalid, inputAriaDescribedby: inputAriaDescribedby, fetchVersions: fetchVersions, onBrowse: () => setModalOpen(true), onChange: (resource, errorText) => fireNonCancelableEvent(onChange, { resource, errorText }) }),
|
|
60
|
+
React.createElement(S3InContext, { ref: inContextRef, selectableItemsTypes: selectableItemsTypes, i18nStrings: i18nStrings, inputPlaceholder: inputPlaceholder, resource: resource, viewHref: viewHref, invalid: invalid, inputAriaDescribedby: inputAriaDescribedby, fetchVersions: fetchVersions, onBrowse: () => setModalOpen(true), onChange: (resource, errorText) => fireNonCancelableEvent(onChange, { resource, errorText }), onInputFocus: onInputFocus, onInputBlur: onInputBlur }),
|
|
61
61
|
!modalOpen && alert && (React.createElement(InternalBox, { className: styles.alert, margin: { top: 's' } }, alert)),
|
|
62
62
|
modalOpen && React.createElement(S3Modal, Object.assign({}, modalProps))));
|
|
63
63
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/s3-resource-selector/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAkB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAgB,MAAM,YAAY,CAAC;AAEnD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,kBAAkB,GAAG,KAAK,CAAC,UAAU,CACzC,CACE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/s3-resource-selector/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;;AACb,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM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,EACjB,oBAAoB,EAAE,oBAAoB,EAC1C,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,oBAAoB,EAAE,oBAAoB,EAC1C,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAClC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,CAAC,sBAAsB,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAC5F,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,WAAW,GACxB;QACD,CAAC,SAAS,IAAI,KAAK,IAAI,CACtB,oBAAC,WAAW,IAAC,SAAS,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,IACvD,KAAK,CACM,CACf;QACA,SAAS,IAAI,oBAAC,OAAO,oBAAK,UAAU,EAAI,CACrC,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;AAC3D,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport InternalBox from '../box/internal';\nimport { useFormFieldContext } from '../contexts/form-field';\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { S3ResourceSelectorProps } from './interfaces';\nimport { S3InContext, S3InContextRef } from './s3-in-context';\nimport { S3Modal, S3ModalProps } from './s3-modal';\n\nimport styles from './styles.css.js';\n\nexport { S3ResourceSelectorProps };\n\nconst S3ResourceSelector = React.forwardRef(\n (\n {\n i18nStrings,\n inputPlaceholder,\n alert,\n resource,\n viewHref,\n invalid,\n selectableItemsTypes = [],\n inputAriaDescribedby,\n bucketsVisibleColumns = ['Name', 'CreationDate'],\n bucketsIsItemDisabled,\n fetchBuckets,\n fetchObjects,\n objectsVisibleColumns = ['Key', 'LastModified', 'Size'],\n objectsIsItemDisabled,\n fetchVersions,\n versionsVisibleColumns = ['ID', 'LastModified', 'Size'],\n versionsIsItemDisabled,\n onChange,\n ariaLabel,\n getModalRoot,\n removeModalRoot,\n onInputFocus,\n onInputBlur,\n ...rest\n }: S3ResourceSelectorProps,\n ref: React.Ref<S3ResourceSelectorProps.Ref>\n ) => {\n checkSafeUrl('S3ResourceSelector', viewHref);\n const { __internalRootRef } = useBaseComponent('S3ResourceSelector');\n const [modalOpen, setModalOpen] = useState(false);\n const inContextRef = useRef<S3InContextRef>(null);\n const modalWasSubmitted = useRef<boolean>(false);\n useForwardFocus(ref, inContextRef);\n const { ariaLabelledby, ariaDescribedby } = useFormFieldContext(rest);\n\n useEffect(() => {\n // Focus uriInput only when modal was submitted.\n // When it was dismissed, the focus naturally goes to previously focused element (browse button)\n if (!modalOpen && modalWasSubmitted.current) {\n modalWasSubmitted.current = false;\n inContextRef.current?.focus();\n }\n }, [modalOpen]);\n\n const baseProps = getBaseProps(rest);\n const modalProps: S3ModalProps = {\n alert,\n i18nStrings,\n fetchBuckets,\n selectableItemsTypes,\n bucketsVisibleColumns,\n bucketsIsItemDisabled,\n fetchObjects,\n objectsVisibleColumns,\n objectsIsItemDisabled,\n fetchVersions,\n versionsVisibleColumns,\n versionsIsItemDisabled,\n getModalRoot,\n removeModalRoot,\n onSubmit: resource => {\n fireNonCancelableEvent(onChange, { resource });\n setModalOpen(false);\n modalWasSubmitted.current = true;\n },\n onDismiss: () => setModalOpen(false),\n };\n return (\n <div\n {...baseProps}\n className={clsx(styles.root, baseProps.className)}\n ref={__internalRootRef}\n role=\"group\"\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n aria-label={ariaLabel}\n >\n <S3InContext\n ref={inContextRef}\n selectableItemsTypes={selectableItemsTypes}\n i18nStrings={i18nStrings}\n inputPlaceholder={inputPlaceholder}\n resource={resource}\n viewHref={viewHref}\n invalid={invalid}\n inputAriaDescribedby={inputAriaDescribedby}\n fetchVersions={fetchVersions}\n onBrowse={() => setModalOpen(true)}\n onChange={(resource, errorText) => fireNonCancelableEvent(onChange, { resource, errorText })}\n onInputFocus={onInputFocus}\n onInputBlur={onInputBlur}\n />\n {!modalOpen && alert && (\n <InternalBox className={styles.alert} margin={{ top: 's' }}>\n {alert}\n </InternalBox>\n )}\n {modalOpen && <S3Modal {...modalProps} />}\n </div>\n );\n }\n);\n\napplyDisplayName(S3ResourceSelector, 'S3ResourceSelector');\nexport default S3ResourceSelector;\n"]}
|
|
@@ -133,6 +133,14 @@ export interface S3ResourceSelectorProps extends BaseComponentProps, BaseModalPr
|
|
|
133
133
|
* - `Size` (number) - (Optional) Size of the object version.
|
|
134
134
|
*/
|
|
135
135
|
fetchVersions: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Version>>;
|
|
136
|
+
/**
|
|
137
|
+
* Called when input focus is removed from the S3 URI input.
|
|
138
|
+
*/
|
|
139
|
+
onInputBlur?: NonCancelableEventHandler<null>;
|
|
140
|
+
/**
|
|
141
|
+
* Called when input focus is moved to the S3 URI input.
|
|
142
|
+
*/
|
|
143
|
+
onInputFocus?: NonCancelableEventHandler<null>;
|
|
136
144
|
/**
|
|
137
145
|
* Fired when the resource selection is changed. The event detail object contains resource that represents the full
|
|
138
146
|
* path of the selected resource and `errorText` that may contain a validation error.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/s3-resource-selector/interfa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CAAC,EAAE,MAAM,CAAC;KAC1B;IAED,UAAiB,YAAY;QAC3B,QAAQ,EAAE,QAAQ,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;IAED,UAAiB,GAAG;QAClB;;WAEG;QACH,KAAK,IAAI,IAAI,CAAC;KACf;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/s3-resource-selector/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { BaseModalProps } from '../modal/interfaces';\nimport { PaginationProps } from '../pagination/interfaces';\nimport { TableProps } from '../table/interfaces';\n\nexport interface S3ResourceSelectorProps extends BaseComponentProps, BaseModalProps {\n /**\n * Specifies additional information about component status.\n */\n alert?: React.ReactNode;\n\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for each element that you want to use as a description\n * and set the property to a string of each ID separated by spaces (for example, `\"id1 id2 id3\"`).\n */\n ariaDescribedby?: string;\n\n /**\n * Adds `aria-label` to the component.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the S3 URI input. If you're using this component within a form field,\n * you do not need to set this property, as the form field component will set it automatically.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n inputAriaDescribedby?: string;\n\n /**\n * Adds a placeholder to the S3 URI input.\n */\n inputPlaceholder?: string;\n\n /**\n * An array of the item types that are selectable in the table view. The array may contain the following items:\n * 'buckets', 'objects', or 'versions'. Example: ['buckets', 'objects']. By default, no items are selectable.\n * This property determines whether the component operates in Read mode or Write mode:\n * * Read mode - When 'objects' and 'versions' values are provided (folder selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n * * Write mode - When 'buckets' and 'objects' values are provided (file selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n */\n selectableItemsTypes?: ReadonlyArray<S3ResourceSelectorProps.SelectableItems>;\n\n /**\n * Href of the selected object that is applied to the View button.\n */\n viewHref?: string;\n\n /**\n * Whether the S3 URI input field is in invalid state.\n */\n invalid?: boolean;\n\n /**\n * Optionally overrides the set of visible columns in the Buckets view. Available columns: 'Name', 'CreationDate',\n * and 'Region'.\n */\n bucketsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Objects view. Available columns: 'Key', 'LastModified',\n * and 'Size'.\n */\n objectsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Versions view. Available columns: 'ID', 'CreationDate',\n * and 'Size'.\n */\n versionsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides whether a bucket should be disabled for selection in the Buckets view or not.\n * It has higher priority than `selectableItemsTypes`. Example: if `selectableItemsTypes` has `['buckets']` value and\n * `bucketsIsItemDisabled` returns false for a bucket, then the bucket is disabled for selection.\n */\n bucketsIsItemDisabled?: (item: S3ResourceSelectorProps.Bucket) => boolean;\n\n /**\n * Optionally overrides whether an object should be disabled for selection in the Objects view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n objectsIsItemDisabled?: (item: S3ResourceSelectorProps.Object) => boolean;\n\n /**\n * Optionally overrides whether a version should be disabled for selection in the Versions view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n versionsIsItemDisabled?: (item: S3ResourceSelectorProps.Version) => boolean;\n\n /**\n * The current selected resource. Resource has the following properties:\n * - `uri` (string) - URI of the resource.\n * - `versionId` (string) - (Optional) Version ID of the selected resource.\n */\n resource: S3ResourceSelectorProps.Resource;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: S3ResourceSelectorProps.I18nStrings;\n\n /**\n * Specifies a function that returns all available buckets. The return type of the function should be a promise\n * that resolves to a list of objects with the following properties:\n * - `Name` (string) - Name of the bucket.\n * - `CreationDate` (string) - (Optional) Creation date of the bucket.\n * - `Region` (string) - (Optional) Region of the bucket.\n */\n fetchBuckets: () => Promise<ReadonlyArray<S3ResourceSelectorProps.Bucket>>;\n\n /**\n * Specifies a function that returns available objects and object prefixes for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of objects with the following properties:\n * - `Key` (string) - Name of the object or object prefix.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object.\n * - `IsFolder` (boolean) - (Optional) Determines whether the entry is an object prefix (folder).\n */\n fetchObjects: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Object>>;\n\n /**\n * Specifies a function that returns available versions for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of versions with the following properties:\n * - `VersionId` (string) - Version ID of an object.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object version.\n */\n fetchVersions: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Version>>;\n\n /**\n * Fired when the resource selection is changed. The event detail object contains resource that represents the full\n * path of the selected resource and `errorText` that may contain a validation error.\n */\n onChange?: NonCancelableEventHandler<S3ResourceSelectorProps.ChangeDetail>;\n}\n\n// Does not use TableProps.AriaLabels, because here we do not need \"allItemsSelectionLabel\"\n// it is not applicable to single selection mode\ninterface SelectionLabels<T> {\n itemSelectionLabel: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel: string;\n}\n\ntype SortingColumnContainingString = (columnName: string) => string;\n\nexport namespace S3ResourceSelectorProps {\n export interface Bucket {\n Name?: string;\n CreationDate?: string;\n // artificial field, does not exist on the real s3 response\n Region?: string;\n }\n export interface Object {\n Key?: string;\n LastModified?: string;\n Size?: number;\n // artificial field, does not exist on the real s3 response\n IsFolder?: boolean;\n }\n export interface Version {\n VersionId?: string;\n LastModified?: string;\n Size?: number;\n }\n\n export interface Resource {\n uri: string;\n versionId?: string;\n }\n\n export type SelectableItems = 'buckets' | 'objects' | 'versions';\n\n export interface I18nStrings {\n /**\n * @deprecated Use `inputPlaceholder` on the component instead.\n */\n inContextInputPlaceholder?: string;\n inContextInputClearAriaLabel?: string;\n inContextSelectPlaceholder?: string;\n inContextBrowseButton?: string;\n inContextViewButton?: string;\n inContextViewButtonAriaLabel?: string;\n inContextLoadingText?: string;\n inContextUriLabel?: string;\n inContextVersionSelectLabel?: string;\n\n modalTitle?: string;\n modalCancelButton?: string;\n modalSubmitButton?: string;\n modalBreadcrumbRootItem?: string;\n modalLastUpdatedText?: string;\n\n selectionBuckets?: string;\n selectionObjects?: string;\n selectionVersions?: string;\n selectionBucketsSearchPlaceholder?: string;\n selectionObjectsSearchPlaceholder?: string;\n selectionVersionsSearchPlaceholder?: string;\n selectionBucketsLoading?: string;\n selectionBucketsNoItems?: string;\n selectionObjectsLoading?: string;\n selectionObjectsNoItems?: string;\n selectionVersionsLoading?: string;\n selectionVersionsNoItems?: string;\n\n filteringCounterText?: (count: number) => string;\n filteringNoMatches?: string;\n filteringCantFindMatch?: string;\n clearFilterButtonText?: string;\n\n columnBucketName?: string;\n columnBucketCreationDate?: string;\n columnBucketRegion?: string;\n columnObjectKey?: string;\n columnObjectLastModified?: string;\n columnObjectSize?: string;\n columnVersionID?: string;\n columnVersionLastModified?: string;\n columnVersionSize?: string;\n\n validationPathMustBegin?: string;\n validationBucketLowerCase?: string;\n validationBucketMustNotContain?: string;\n validationBucketLength?: string;\n validationBucketMustComplyDns?: string;\n\n labelSortedDescending?: SortingColumnContainingString;\n labelSortedAscending?: SortingColumnContainingString;\n labelNotSorted?: SortingColumnContainingString;\n labelsPagination?: PaginationProps.Labels;\n labelsBucketsSelection?: SelectionLabels<Bucket>;\n labelsObjectsSelection?: SelectionLabels<S3ResourceSelectorProps.Object>;\n labelsVersionsSelection?: SelectionLabels<Version>;\n labelFiltering?: (itemsType: string) => string;\n labelRefresh?: string;\n labelModalDismiss?: string;\n labelBreadcrumbs?: string;\n labelExpandBreadcrumbs?: string;\n labelClearFilter?: string;\n labelIconObject?: string;\n labelIconFolder?: string;\n }\n\n export interface ChangeDetail {\n resource: Resource;\n errorText?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the S3 URI input field\n */\n focus(): void;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/s3-resource-selector/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { BaseModalProps } from '../modal/interfaces';\nimport { PaginationProps } from '../pagination/interfaces';\nimport { TableProps } from '../table/interfaces';\n\nexport interface S3ResourceSelectorProps extends BaseComponentProps, BaseModalProps {\n /**\n * Specifies additional information about component status.\n */\n alert?: React.ReactNode;\n\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for each element that you want to use as a description\n * and set the property to a string of each ID separated by spaces (for example, `\"id1 id2 id3\"`).\n */\n ariaDescribedby?: string;\n\n /**\n * Adds `aria-label` to the component.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the S3 URI input. If you're using this component within a form field,\n * you do not need to set this property, as the form field component will set it automatically.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n inputAriaDescribedby?: string;\n\n /**\n * Adds a placeholder to the S3 URI input.\n */\n inputPlaceholder?: string;\n\n /**\n * An array of the item types that are selectable in the table view. The array may contain the following items:\n * 'buckets', 'objects', or 'versions'. Example: ['buckets', 'objects']. By default, no items are selectable.\n * This property determines whether the component operates in Read mode or Write mode:\n * * Read mode - When 'objects' and 'versions' values are provided (folder selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n * * Write mode - When 'buckets' and 'objects' values are provided (file selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n */\n selectableItemsTypes?: ReadonlyArray<S3ResourceSelectorProps.SelectableItems>;\n\n /**\n * Href of the selected object that is applied to the View button.\n */\n viewHref?: string;\n\n /**\n * Whether the S3 URI input field is in invalid state.\n */\n invalid?: boolean;\n\n /**\n * Optionally overrides the set of visible columns in the Buckets view. Available columns: 'Name', 'CreationDate',\n * and 'Region'.\n */\n bucketsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Objects view. Available columns: 'Key', 'LastModified',\n * and 'Size'.\n */\n objectsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Versions view. Available columns: 'ID', 'CreationDate',\n * and 'Size'.\n */\n versionsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides whether a bucket should be disabled for selection in the Buckets view or not.\n * It has higher priority than `selectableItemsTypes`. Example: if `selectableItemsTypes` has `['buckets']` value and\n * `bucketsIsItemDisabled` returns false for a bucket, then the bucket is disabled for selection.\n */\n bucketsIsItemDisabled?: (item: S3ResourceSelectorProps.Bucket) => boolean;\n\n /**\n * Optionally overrides whether an object should be disabled for selection in the Objects view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n objectsIsItemDisabled?: (item: S3ResourceSelectorProps.Object) => boolean;\n\n /**\n * Optionally overrides whether a version should be disabled for selection in the Versions view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n versionsIsItemDisabled?: (item: S3ResourceSelectorProps.Version) => boolean;\n\n /**\n * The current selected resource. Resource has the following properties:\n * - `uri` (string) - URI of the resource.\n * - `versionId` (string) - (Optional) Version ID of the selected resource.\n */\n resource: S3ResourceSelectorProps.Resource;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: S3ResourceSelectorProps.I18nStrings;\n\n /**\n * Specifies a function that returns all available buckets. The return type of the function should be a promise\n * that resolves to a list of objects with the following properties:\n * - `Name` (string) - Name of the bucket.\n * - `CreationDate` (string) - (Optional) Creation date of the bucket.\n * - `Region` (string) - (Optional) Region of the bucket.\n */\n fetchBuckets: () => Promise<ReadonlyArray<S3ResourceSelectorProps.Bucket>>;\n\n /**\n * Specifies a function that returns available objects and object prefixes for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of objects with the following properties:\n * - `Key` (string) - Name of the object or object prefix.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object.\n * - `IsFolder` (boolean) - (Optional) Determines whether the entry is an object prefix (folder).\n */\n fetchObjects: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Object>>;\n\n /**\n * Specifies a function that returns available versions for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of versions with the following properties:\n * - `VersionId` (string) - Version ID of an object.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object version.\n */\n fetchVersions: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Version>>;\n\n /**\n * Called when input focus is removed from the S3 URI input.\n */\n onInputBlur?: NonCancelableEventHandler<null>;\n\n /**\n * Called when input focus is moved to the S3 URI input.\n */\n onInputFocus?: NonCancelableEventHandler<null>;\n\n /**\n * Fired when the resource selection is changed. The event detail object contains resource that represents the full\n * path of the selected resource and `errorText` that may contain a validation error.\n */\n onChange?: NonCancelableEventHandler<S3ResourceSelectorProps.ChangeDetail>;\n}\n\n// Does not use TableProps.AriaLabels, because here we do not need \"allItemsSelectionLabel\"\n// it is not applicable to single selection mode\ninterface SelectionLabels<T> {\n itemSelectionLabel: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel: string;\n}\n\ntype SortingColumnContainingString = (columnName: string) => string;\n\nexport namespace S3ResourceSelectorProps {\n export interface Bucket {\n Name?: string;\n CreationDate?: string;\n // artificial field, does not exist on the real s3 response\n Region?: string;\n }\n export interface Object {\n Key?: string;\n LastModified?: string;\n Size?: number;\n // artificial field, does not exist on the real s3 response\n IsFolder?: boolean;\n }\n export interface Version {\n VersionId?: string;\n LastModified?: string;\n Size?: number;\n }\n\n export interface Resource {\n uri: string;\n versionId?: string;\n }\n\n export type SelectableItems = 'buckets' | 'objects' | 'versions';\n\n export interface I18nStrings {\n /**\n * @deprecated Use `inputPlaceholder` on the component instead.\n */\n inContextInputPlaceholder?: string;\n inContextInputClearAriaLabel?: string;\n inContextSelectPlaceholder?: string;\n inContextBrowseButton?: string;\n inContextViewButton?: string;\n inContextViewButtonAriaLabel?: string;\n inContextLoadingText?: string;\n inContextUriLabel?: string;\n inContextVersionSelectLabel?: string;\n\n modalTitle?: string;\n modalCancelButton?: string;\n modalSubmitButton?: string;\n modalBreadcrumbRootItem?: string;\n modalLastUpdatedText?: string;\n\n selectionBuckets?: string;\n selectionObjects?: string;\n selectionVersions?: string;\n selectionBucketsSearchPlaceholder?: string;\n selectionObjectsSearchPlaceholder?: string;\n selectionVersionsSearchPlaceholder?: string;\n selectionBucketsLoading?: string;\n selectionBucketsNoItems?: string;\n selectionObjectsLoading?: string;\n selectionObjectsNoItems?: string;\n selectionVersionsLoading?: string;\n selectionVersionsNoItems?: string;\n\n filteringCounterText?: (count: number) => string;\n filteringNoMatches?: string;\n filteringCantFindMatch?: string;\n clearFilterButtonText?: string;\n\n columnBucketName?: string;\n columnBucketCreationDate?: string;\n columnBucketRegion?: string;\n columnObjectKey?: string;\n columnObjectLastModified?: string;\n columnObjectSize?: string;\n columnVersionID?: string;\n columnVersionLastModified?: string;\n columnVersionSize?: string;\n\n validationPathMustBegin?: string;\n validationBucketLowerCase?: string;\n validationBucketMustNotContain?: string;\n validationBucketLength?: string;\n validationBucketMustComplyDns?: string;\n\n labelSortedDescending?: SortingColumnContainingString;\n labelSortedAscending?: SortingColumnContainingString;\n labelNotSorted?: SortingColumnContainingString;\n labelsPagination?: PaginationProps.Labels;\n labelsBucketsSelection?: SelectionLabels<Bucket>;\n labelsObjectsSelection?: SelectionLabels<S3ResourceSelectorProps.Object>;\n labelsVersionsSelection?: SelectionLabels<Version>;\n labelFiltering?: (itemsType: string) => string;\n labelRefresh?: string;\n labelModalDismiss?: string;\n labelBreadcrumbs?: string;\n labelExpandBreadcrumbs?: string;\n labelClearFilter?: string;\n labelIconObject?: string;\n labelIconFolder?: string;\n }\n\n export interface ChangeDetail {\n resource: Resource;\n errorText?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the S3 URI input field\n */\n focus(): void;\n }\n}\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { NonCancelableEventHandler } from '../../internal/events';
|
|
2
3
|
import { S3ResourceSelectorProps } from '../interfaces';
|
|
3
4
|
interface S3InContextProps {
|
|
4
5
|
i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined;
|
|
@@ -9,6 +10,8 @@ interface S3InContextProps {
|
|
|
9
10
|
inputAriaDescribedby: string | undefined;
|
|
10
11
|
selectableItemsTypes: S3ResourceSelectorProps['selectableItemsTypes'];
|
|
11
12
|
fetchVersions: S3ResourceSelectorProps['fetchVersions'];
|
|
13
|
+
onInputBlur: NonCancelableEventHandler<null> | undefined;
|
|
14
|
+
onInputFocus: NonCancelableEventHandler<null> | undefined;
|
|
12
15
|
onBrowse: () => void;
|
|
13
16
|
onChange: (newResource: S3ResourceSelectorProps.Resource, errorText: string | undefined) => void;
|
|
14
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-in-context/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-in-context/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAO3D,OAAO,EAAoD,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAKpH,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAOxD,UAAU,gBAAgB;IACxB,WAAW,EAAE,uBAAuB,CAAC,WAAW,GAAG,SAAS,CAAC;IAC7D,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,uBAAuB,CAAC,QAAQ,CAAC;IAC3C,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;IAC7B,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,oBAAoB,EAAE,uBAAuB,CAAC,sBAAsB,CAAC,CAAC;IACtE,aAAa,EAAE,uBAAuB,CAAC,eAAe,CAAC,CAAC;IACxD,WAAW,EAAE,yBAAyB,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IACzD,YAAY,EAAE,yBAAyB,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;IAC1D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,EAAE,CAAC,WAAW,EAAE,uBAAuB,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CAClG;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,IAAI,IAAI,CAAC;CACf;AAED,eAAO,MAAM,WAAW,yFAmIvB,CAAC"}
|
|
@@ -5,6 +5,7 @@ import InternalBox from '../../box/internal';
|
|
|
5
5
|
import { InternalButton } from '../../button/internal';
|
|
6
6
|
import InternalFormField from '../../form-field/internal';
|
|
7
7
|
import { useInternalI18n } from '../../i18n/context';
|
|
8
|
+
import { fireNonCancelableEvent } from '../../internal/events';
|
|
8
9
|
import useForwardFocus from '../../internal/hooks/forward-focus';
|
|
9
10
|
import InternalLiveRegion from '../../live-region/internal';
|
|
10
11
|
import InternalSelect from '../../select/internal';
|
|
@@ -13,7 +14,7 @@ import { SearchInput } from './search-input';
|
|
|
13
14
|
import { useVersionsFetch } from './use-versions-fetch';
|
|
14
15
|
import { getErrorText, validate } from './validation';
|
|
15
16
|
import styles from './styles.css.js';
|
|
16
|
-
export const S3InContext = React.forwardRef(({ i18nStrings, inputPlaceholder, resource, viewHref, invalid, inputAriaDescribedby, selectableItemsTypes, fetchVersions, onChange, onBrowse, }, ref) => {
|
|
17
|
+
export const S3InContext = React.forwardRef(({ i18nStrings, inputPlaceholder, resource, viewHref, invalid, inputAriaDescribedby, selectableItemsTypes, fetchVersions, onInputBlur, onInputFocus, onChange, onBrowse, }, ref) => {
|
|
17
18
|
const i18n = useInternalI18n('s3-resource-selector');
|
|
18
19
|
const isInputBlurredRef = useRef(true);
|
|
19
20
|
const [isInputTouched, setInputTouched] = useState(false);
|
|
@@ -34,10 +35,15 @@ export const S3InContext = React.forwardRef(({ i18nStrings, inputPlaceholder, re
|
|
|
34
35
|
setInputTouched(true);
|
|
35
36
|
const errorCode = validate(resource.uri);
|
|
36
37
|
onChange(resource, getErrorText(i18n, i18nStrings, errorCode));
|
|
38
|
+
fireNonCancelableEvent(onInputBlur);
|
|
37
39
|
if (supportsVersions) {
|
|
38
40
|
loadVersions(resource.uri);
|
|
39
41
|
}
|
|
40
42
|
}
|
|
43
|
+
function handleUriFocus() {
|
|
44
|
+
isInputBlurredRef.current = false;
|
|
45
|
+
fireNonCancelableEvent(onInputFocus);
|
|
46
|
+
}
|
|
41
47
|
useEffect(() => {
|
|
42
48
|
var _a;
|
|
43
49
|
if (!isInputBlurredRef.current || !supportsVersions) {
|
|
@@ -49,7 +55,7 @@ export const S3InContext = React.forwardRef(({ i18nStrings, inputPlaceholder, re
|
|
|
49
55
|
return (React.createElement("div", { className: styles.root },
|
|
50
56
|
React.createElement("div", { className: styles.layout },
|
|
51
57
|
React.createElement(InternalFormField, { className: styles['layout-uri'], label: i18n('i18nStrings.inContextUriLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextUriLabel), stretch: true },
|
|
52
|
-
React.createElement(SearchInput, { ref: inputRef, value: uri, ariaDescribedby: inputAriaDescribedby, clearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextInputClearAriaLabel, placeholder: inputPlaceholder !== null && inputPlaceholder !== void 0 ? inputPlaceholder : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextInputPlaceholder, onChange: handleUriChange, invalid: invalid, onFocus:
|
|
58
|
+
React.createElement(SearchInput, { ref: inputRef, value: uri, ariaDescribedby: inputAriaDescribedby, clearAriaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextInputClearAriaLabel, placeholder: inputPlaceholder !== null && inputPlaceholder !== void 0 ? inputPlaceholder : i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextInputPlaceholder, onChange: handleUriChange, invalid: invalid, onFocus: handleUriFocus, onBlur: handleUriBlur })),
|
|
53
59
|
supportsVersions && (React.createElement(InternalFormField, { className: styles['layout-version'], label: i18n('i18nStrings.inContextVersionSelectLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextVersionSelectLabel), stretch: true },
|
|
54
60
|
React.createElement(InternalSelect, { selectedOption: selectedVersion, placeholder: i18n('i18nStrings.inContextSelectPlaceholder', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextSelectPlaceholder), disabled: versions.length === 0, options: versions, onChange: event => onChange(Object.assign(Object.assign({}, resource), { versionId: event.detail.selectedOption.value }), undefined), invalid: false }))),
|
|
55
61
|
React.createElement("div", null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-in-context/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,uBAAuB,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,E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,CAAC,iCAAiC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,mBAAmB,CAAC,CAC3D,CACb;YACN,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,GAAI;YAC5C;gBACE,oBAAC,cAAc,IAAC,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAC,MAAM,EAAC,OAAO,EAAE,QAAQ,IACvG,IAAI,CAAC,mCAAmC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,qBAAqB,CAAC,CAC/D,CACb,CACF;QAEN,oBAAC,kBAAkB,IAAC,SAAS,EAAE,IAAI,IAChC,OAAO,IAAI,CACV,oBAAC,WAAW,IAAC,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;YAC/B,oBAAC,uBAAuB,IAAC,IAAI,EAAC,SAAS,IACpC,IAAI,CAAC,kCAAkC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,oBAAoB,CAAC,CACpD,CACd,CACf,CACkB,CACjB,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport InternalBox from '../../box/internal';\nimport { InternalButton } from '../../button/internal';\nimport InternalFormField from '../../form-field/internal';\nimport { useInternalI18n } from '../../i18n/context';\nimport { InputProps } from '../../input/interfaces';\nimport { NonCancelableCustomEvent } from '../../internal/events';\nimport useForwardFocus from '../../internal/hooks/forward-focus';\nimport InternalLiveRegion from '../../live-region/internal';\nimport InternalSelect from '../../select/internal';\nimport InternalStatusIndicator from '../../status-indicator/internal';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { SearchInput } from './search-input';\nimport { useVersionsFetch } from './use-versions-fetch';\nimport { getErrorText, validate } from './validation';\n\nimport styles from './styles.css.js';\n\ninterface S3InContextProps {\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined;\n inputPlaceholder: string | undefined;\n resource: S3ResourceSelectorProps.Resource;\n viewHref: string | undefined;\n invalid: boolean | undefined;\n inputAriaDescribedby: string | undefined;\n selectableItemsTypes: S3ResourceSelectorProps['selectableItemsTypes'];\n fetchVersions: S3ResourceSelectorProps['fetchVersions'];\n onBrowse: () => void;\n onChange: (newResource: S3ResourceSelectorProps.Resource, errorText: string | undefined) => void;\n}\n\nexport interface S3InContextRef {\n focus(): void;\n}\n\nexport const S3InContext = React.forwardRef(\n (\n {\n i18nStrings,\n inputPlaceholder,\n resource,\n viewHref,\n invalid,\n inputAriaDescribedby,\n selectableItemsTypes,\n fetchVersions,\n onChange,\n onBrowse,\n }: S3InContextProps,\n ref: React.Ref<S3InContextRef>\n ) => {\n const i18n = useInternalI18n('s3-resource-selector');\n const isInputBlurredRef = useRef(true);\n const [isInputTouched, setInputTouched] = useState(false);\n const { versions, loading, loadVersions, resetVersions } = useVersionsFetch(fetchVersions);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useForwardFocus(ref, inputRef);\n\n const uri = resource.uri;\n const supportsVersions = selectableItemsTypes && selectableItemsTypes.indexOf('versions') > -1;\n const selectedVersion = versions.filter(version => version.value === resource.versionId)[0] || null;\n\n function handleUriChange(event: NonCancelableCustomEvent<InputProps.ChangeDetail>) {\n const uri = event.detail.value;\n const errorCode = isInputTouched ? validate(uri) : undefined;\n resetVersions();\n onChange({ uri }, getErrorText(i18n, i18nStrings, errorCode));\n }\n\n function handleUriBlur() {\n isInputBlurredRef.current = true;\n setInputTouched(true);\n const errorCode = validate(resource.uri);\n onChange(resource, getErrorText(i18n, i18nStrings, errorCode));\n if (supportsVersions) {\n loadVersions(resource.uri);\n }\n }\n\n useEffect(() => {\n if (!isInputBlurredRef.current || !supportsVersions) {\n return;\n }\n const { cancel } = loadVersions(uri) ?? {};\n return cancel;\n }, [uri, supportsVersions, loadVersions]);\n\n return (\n <div className={styles.root}>\n <div className={styles.layout}>\n <InternalFormField\n className={styles['layout-uri']}\n label={i18n('i18nStrings.inContextUriLabel', i18nStrings?.inContextUriLabel)}\n stretch={true}\n >\n <SearchInput\n ref={inputRef}\n value={uri}\n ariaDescribedby={inputAriaDescribedby}\n clearAriaLabel={i18nStrings?.inContextInputClearAriaLabel}\n placeholder={inputPlaceholder ?? i18nStrings?.inContextInputPlaceholder}\n onChange={handleUriChange}\n invalid={invalid}\n onFocus={() => (isInputBlurredRef.current = false)}\n onBlur={handleUriBlur}\n />\n </InternalFormField>\n {supportsVersions && (\n <InternalFormField\n className={styles['layout-version']}\n label={i18n('i18nStrings.inContextVersionSelectLabel', i18nStrings?.inContextVersionSelectLabel)}\n stretch={true}\n >\n <InternalSelect\n selectedOption={selectedVersion}\n placeholder={i18n('i18nStrings.inContextSelectPlaceholder', i18nStrings?.inContextSelectPlaceholder)}\n disabled={versions.length === 0}\n options={versions}\n onChange={event => onChange({ ...resource, versionId: event.detail.selectedOption.value }, undefined)}\n invalid={false} // invalid state should not highlight the select, only the text input\n />\n </InternalFormField>\n )}\n <div>\n <InternalButton\n className={styles['view-button']}\n disabled={!viewHref}\n href={viewHref}\n target=\"_blank\"\n iconName=\"external\"\n iconAlign=\"right\"\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.inContextViewButtonAriaLabel', i18nStrings?.inContextViewButtonAriaLabel)}\n >\n {i18n('i18nStrings.inContextViewButton', i18nStrings?.inContextViewButton)}\n </InternalButton>\n </div>\n <div className={styles['layout-divider']} />\n <div>\n <InternalButton className={styles['browse-button']} disabled={loading} formAction=\"none\" onClick={onBrowse}>\n {i18n('i18nStrings.inContextBrowseButton', i18nStrings?.inContextBrowseButton)}\n </InternalButton>\n </div>\n </div>\n\n <InternalLiveRegion assertive={true}>\n {loading && (\n <InternalBox margin={{ top: 's' }}>\n <InternalStatusIndicator type=\"loading\">\n {i18n('i18nStrings.inContextLoadingText', i18nStrings?.inContextLoadingText)}\n </InternalStatusIndicator>\n </InternalBox>\n )}\n </InternalLiveRegion>\n </div>\n );\n }\n);\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-in-context/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,sBAAsB,EAAuD,MAAM,uBAAuB,CAAC;AACpH,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,kBAAkB,MAAM,4BAA4B,CAAC;AAC5D,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,uBAAuB,MAAM,iCAAiC,CAAC;AAEtE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAqBrC,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CACzC,CACE,EACE,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,QAAQ,GACS,EACnB,GAA8B,EAC9B,EAAE;IACF,MAAM,IAAI,GAAG,eAAe,CAAC,sBAAsB,CAAC,CAAC;IACrD,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,CAAC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AW,CAAE,qBAAqB,CAAC,CAC/D,CACb,CACF;QAEN,oBAAC,kBAAkB,IAAC,SAAS,EAAE,IAAI,IAChC,OAAO,IAAI,CACV,oBAAC,WAAW,IAAC,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;YAC/B,oBAAC,uBAAuB,IAAC,IAAI,EAAC,SAAS,IACpC,IAAI,CAAC,kCAAkC,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,oBAAoB,CAAC,CACpD,CACd,CACf,CACkB,CACjB,CACP,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport InternalBox from '../../box/internal';\nimport { InternalButton } from '../../button/internal';\nimport InternalFormField from '../../form-field/internal';\nimport { useInternalI18n } from '../../i18n/context';\nimport { InputProps } from '../../input/interfaces';\nimport { fireNonCancelableEvent, NonCancelableCustomEvent, NonCancelableEventHandler } from '../../internal/events';\nimport useForwardFocus from '../../internal/hooks/forward-focus';\nimport InternalLiveRegion from '../../live-region/internal';\nimport InternalSelect from '../../select/internal';\nimport InternalStatusIndicator from '../../status-indicator/internal';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { SearchInput } from './search-input';\nimport { useVersionsFetch } from './use-versions-fetch';\nimport { getErrorText, validate } from './validation';\n\nimport styles from './styles.css.js';\n\ninterface S3InContextProps {\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined;\n inputPlaceholder: string | undefined;\n resource: S3ResourceSelectorProps.Resource;\n viewHref: string | undefined;\n invalid: boolean | undefined;\n inputAriaDescribedby: string | undefined;\n selectableItemsTypes: S3ResourceSelectorProps['selectableItemsTypes'];\n fetchVersions: S3ResourceSelectorProps['fetchVersions'];\n onInputBlur: NonCancelableEventHandler<null> | undefined;\n onInputFocus: NonCancelableEventHandler<null> | undefined;\n onBrowse: () => void;\n onChange: (newResource: S3ResourceSelectorProps.Resource, errorText: string | undefined) => void;\n}\n\nexport interface S3InContextRef {\n focus(): void;\n}\n\nexport const S3InContext = React.forwardRef(\n (\n {\n i18nStrings,\n inputPlaceholder,\n resource,\n viewHref,\n invalid,\n inputAriaDescribedby,\n selectableItemsTypes,\n fetchVersions,\n onInputBlur,\n onInputFocus,\n onChange,\n onBrowse,\n }: S3InContextProps,\n ref: React.Ref<S3InContextRef>\n ) => {\n const i18n = useInternalI18n('s3-resource-selector');\n const isInputBlurredRef = useRef(true);\n const [isInputTouched, setInputTouched] = useState(false);\n const { versions, loading, loadVersions, resetVersions } = useVersionsFetch(fetchVersions);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useForwardFocus(ref, inputRef);\n\n const uri = resource.uri;\n const supportsVersions = selectableItemsTypes && selectableItemsTypes.indexOf('versions') > -1;\n const selectedVersion = versions.filter(version => version.value === resource.versionId)[0] || null;\n\n function handleUriChange(event: NonCancelableCustomEvent<InputProps.ChangeDetail>) {\n const uri = event.detail.value;\n const errorCode = isInputTouched ? validate(uri) : undefined;\n resetVersions();\n onChange({ uri }, getErrorText(i18n, i18nStrings, errorCode));\n }\n\n function handleUriBlur() {\n isInputBlurredRef.current = true;\n setInputTouched(true);\n const errorCode = validate(resource.uri);\n onChange(resource, getErrorText(i18n, i18nStrings, errorCode));\n fireNonCancelableEvent(onInputBlur);\n if (supportsVersions) {\n loadVersions(resource.uri);\n }\n }\n\n function handleUriFocus() {\n isInputBlurredRef.current = false;\n fireNonCancelableEvent(onInputFocus);\n }\n\n useEffect(() => {\n if (!isInputBlurredRef.current || !supportsVersions) {\n return;\n }\n const { cancel } = loadVersions(uri) ?? {};\n return cancel;\n }, [uri, supportsVersions, loadVersions]);\n\n return (\n <div className={styles.root}>\n <div className={styles.layout}>\n <InternalFormField\n className={styles['layout-uri']}\n label={i18n('i18nStrings.inContextUriLabel', i18nStrings?.inContextUriLabel)}\n stretch={true}\n >\n <SearchInput\n ref={inputRef}\n value={uri}\n ariaDescribedby={inputAriaDescribedby}\n clearAriaLabel={i18nStrings?.inContextInputClearAriaLabel}\n placeholder={inputPlaceholder ?? i18nStrings?.inContextInputPlaceholder}\n onChange={handleUriChange}\n invalid={invalid}\n onFocus={handleUriFocus}\n onBlur={handleUriBlur}\n />\n </InternalFormField>\n {supportsVersions && (\n <InternalFormField\n className={styles['layout-version']}\n label={i18n('i18nStrings.inContextVersionSelectLabel', i18nStrings?.inContextVersionSelectLabel)}\n stretch={true}\n >\n <InternalSelect\n selectedOption={selectedVersion}\n placeholder={i18n('i18nStrings.inContextSelectPlaceholder', i18nStrings?.inContextSelectPlaceholder)}\n disabled={versions.length === 0}\n options={versions}\n onChange={event => onChange({ ...resource, versionId: event.detail.selectedOption.value }, undefined)}\n invalid={false} // invalid state should not highlight the select, only the text input\n />\n </InternalFormField>\n )}\n <div>\n <InternalButton\n className={styles['view-button']}\n disabled={!viewHref}\n href={viewHref}\n target=\"_blank\"\n iconName=\"external\"\n iconAlign=\"right\"\n formAction=\"none\"\n ariaLabel={i18n('i18nStrings.inContextViewButtonAriaLabel', i18nStrings?.inContextViewButtonAriaLabel)}\n >\n {i18n('i18nStrings.inContextViewButton', i18nStrings?.inContextViewButton)}\n </InternalButton>\n </div>\n <div className={styles['layout-divider']} />\n <div>\n <InternalButton className={styles['browse-button']} disabled={loading} formAction=\"none\" onClick={onBrowse}>\n {i18n('i18nStrings.inContextBrowseButton', i18nStrings?.inContextBrowseButton)}\n </InternalButton>\n </div>\n </div>\n\n <InternalLiveRegion assertive={true}>\n {loading && (\n <InternalBox margin={{ top: 's' }}>\n <InternalStatusIndicator type=\"loading\">\n {i18n('i18nStrings.inContextLoadingText', i18nStrings?.inContextLoadingText)}\n </InternalStatusIndicator>\n </InternalBox>\n )}\n </InternalLiveRegion>\n </div>\n );\n }\n);\n"]}
|