@cloudscape-design/components 3.0.67 → 3.0.69
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/breadcrumb-group/internal.js +1 -1
- package/breadcrumb-group/internal.js.map +1 -1
- package/container/styles.css.js +16 -16
- package/container/styles.scoped.css +33 -25
- package/container/styles.selectors.js +16 -16
- package/date-picker/index.d.ts.map +1 -1
- package/date-picker/index.js +1 -1
- package/date-picker/index.js.map +1 -1
- package/internal/environment.js +1 -1
- package/package.json +1 -1
- package/s3-resource-selector/interfaces.d.ts +1 -0
- package/s3-resource-selector/interfaces.d.ts.map +1 -1
- package/s3-resource-selector/interfaces.js.map +1 -1
- package/s3-resource-selector/s3-in-context/index.d.ts.map +1 -1
- package/s3-resource-selector/s3-in-context/index.js +1 -1
- package/s3-resource-selector/s3-in-context/index.js.map +1 -1
|
@@ -16,7 +16,7 @@ var DropdownTrigger = function (clickHandler, ref, isDisabled, isExpanded, ariaL
|
|
|
16
16
|
return (React.createElement(InternalButton, { disabled: isDisabled, onClick: function (event) {
|
|
17
17
|
event.preventDefault();
|
|
18
18
|
clickHandler();
|
|
19
|
-
}, ref: ref,
|
|
19
|
+
}, ref: ref, ariaExpanded: isExpanded, "aria-haspopup": true, ariaLabel: ariaLabel, variant: "breadcrumb-group", formAction: "none" }, "..."));
|
|
20
20
|
};
|
|
21
21
|
var EllipsisDropdown = function (_a) {
|
|
22
22
|
var ariaLabel = _a.ariaLabel, dropdownItems = _a.dropdownItems, onDropdownItemClick = _a.onDropdownItemClick, onDropdownItemFollow = _a.onDropdownItemFollow;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/breadcrumb-group/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,IAAI,MAA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AAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,GAAG;SACvB,CAAC,EAJuD,CAIvD,CAAC,CAAC;QAEN,eAAe;YACb,eAAe,CAAC,CAAC,CAAC;YAClB,oBAAC,gBAAgB,IACf,GAAG,EAAE,UAAU,EACf,SAAS,EAAE,eAAe,EAC1B,aAAa,EAAE,aAAa,EAC5B,mBAAmB,EAAE,UAAA,CAAC,IAAI,OAAA,mBAAmB,CAAC,OAAO,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAhE,CAAgE,EAC1F,oBAAoB,EAAE,UAAA,CAAC,IAAI,OAAA,mBAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAjE,CAAiE,GAC5F;WACC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,OAC5B,CAAC;KACH;IAED,OAAO,CACL,wCACM,SAAS,IACb,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,CAAC,gBAC/E,SAAS,IAAI,SAAS,EAClC,GAAG,EAAE,iBAAiB;QAEtB,4BAAI,SAAS,EAAE,MAAM,CAAC,uBAAuB,CAAC,IAAG,eAAe,CAAM,CAClE,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport styles from './styles.css.js';\nimport clsx from 'clsx';\nimport InternalIcon from '../icon/internal';\nimport InternalButtonDropdown from '../button-dropdown/internal';\nimport { LinkItem } from '../button-dropdown/interfaces';\nimport { InternalButton } from '../button/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { BreadcrumbItem } from './item/item';\nimport { BreadcrumbGroupProps, EllipsisDropdownProps } from './interfaces';\nimport { fireCancelableEvent } from '../internal/events';\nimport { getBaseProps } from '../internal/base-component';\nimport { useMobile } from '../internal/hooks/use-mobile';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport { SomeRequired } from '../internal/types.js';\n\nconst DropdownTrigger = (\n clickHandler: () => void,\n ref: React.Ref<ButtonProps.Ref>,\n isDisabled: boolean,\n isExpanded: boolean,\n ariaLabel?: string\n) => {\n return (\n <InternalButton\n disabled={isDisabled}\n onClick={event => {\n event.preventDefault();\n clickHandler();\n }}\n ref={ref}\n ariaExpanded={isExpanded}\n aria-haspopup={true}\n ariaLabel={ariaLabel}\n variant=\"breadcrumb-group\"\n formAction=\"none\"\n >\n ...\n </InternalButton>\n );\n};\n\nconst EllipsisDropdown = ({\n ariaLabel,\n dropdownItems,\n onDropdownItemClick,\n onDropdownItemFollow,\n}: EllipsisDropdownProps) => {\n return (\n <li className={styles.ellipsis}>\n <InternalButtonDropdown\n ariaLabel={ariaLabel}\n items={dropdownItems}\n onItemClick={onDropdownItemClick}\n onItemFollow={onDropdownItemFollow}\n customTriggerBuilder={DropdownTrigger}\n />\n <span className={styles.icon}>\n <InternalIcon name=\"angle-right\" />\n </span>\n </li>\n );\n};\n\nexport const getEventDetail = <T extends BreadcrumbGroupProps.Item>(item: T) => ({\n item,\n text: item.text,\n href: item.href,\n});\n\ntype InternalBreadcrumbGroupProps<T extends BreadcrumbGroupProps.Item = BreadcrumbGroupProps.Item> = SomeRequired<\n BreadcrumbGroupProps<T>,\n 'expandAriaLabel'\n> &\n InternalBaseComponentProps;\n\nexport default function InternalBreadcrumbGroup<T extends BreadcrumbGroupProps.Item = BreadcrumbGroupProps.Item>({\n items = [],\n ariaLabel,\n expandAriaLabel,\n onClick,\n onFollow,\n __internalRootRef,\n ...props\n}: InternalBreadcrumbGroupProps<T>) {\n for (const item of items) {\n checkSafeUrl('BreadcrumbGroup', item.href);\n }\n const baseProps = getBaseProps(props);\n const isMobile = useMobile();\n\n let breadcrumbItems = items.map((item, index) => {\n return (\n <li className={styles.item} key={index}>\n <BreadcrumbItem\n item={item}\n onClick={onClick}\n onFollow={onFollow}\n isCompressed={isMobile}\n isLast={index === items.length - 1}\n />\n </li>\n );\n });\n\n const getEventItem = (e: CustomEvent<{ id: string }>) => {\n const { id } = e.detail;\n return items[parseInt(id)];\n };\n\n // Add ellipsis\n if (breadcrumbItems.length >= 3) {\n const dropdownItems: Array<LinkItem> = items\n .slice(1, items.length - 1)\n .map((item: BreadcrumbGroupProps.Item, index: number) => ({\n id: (index + 1).toString(), // the first item doesn't get inside dropdown\n text: item.text,\n href: item.href || '#',\n }));\n\n breadcrumbItems = [\n breadcrumbItems[0],\n <EllipsisDropdown\n key={'ellipsis'}\n ariaLabel={expandAriaLabel}\n dropdownItems={dropdownItems}\n onDropdownItemClick={e => fireCancelableEvent(onClick, getEventDetail(getEventItem(e)), e)}\n onDropdownItemFollow={e => fireCancelableEvent(onFollow, getEventDetail(getEventItem(e)), e)}\n />,\n ...breadcrumbItems.slice(1),\n ];\n }\n\n return (\n <nav\n {...baseProps}\n className={clsx(styles['breadcrumb-group'], isMobile && styles.mobile, baseProps.className)}\n aria-label={ariaLabel || undefined}\n ref={__internalRootRef}\n >\n <ol className={styles['breadcrumb-group-list']}>{breadcrumbItems}</ol>\n </nav>\n );\n}\n"]}
|
package/container/styles.css.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"variant-default": "awsui_variant-
|
|
6
|
-
"variant-stacked": "awsui_variant-
|
|
7
|
-
"header": "
|
|
8
|
-
"header-sticky-disabled": "awsui_header-sticky-
|
|
9
|
-
"header-sticky-enabled": "awsui_header-sticky-
|
|
10
|
-
"header-stuck": "awsui_header-
|
|
11
|
-
"header-dynamic-height": "awsui_header-dynamic-
|
|
12
|
-
"with-paddings": "awsui_with-
|
|
13
|
-
"with-hidden-content": "awsui_with-hidden-
|
|
14
|
-
"header-variant-cards": "awsui_header-variant-
|
|
15
|
-
"header-variant-full-page": "awsui_header-variant-full-
|
|
16
|
-
"dark-header": "awsui_dark-
|
|
17
|
-
"content": "
|
|
18
|
-
"footer": "
|
|
19
|
-
"with-divider": "awsui_with-
|
|
4
|
+
"root": "awsui_root_14iqq_xfc54_97",
|
|
5
|
+
"variant-default": "awsui_variant-default_14iqq_xfc54_110",
|
|
6
|
+
"variant-stacked": "awsui_variant-stacked_14iqq_xfc54_110",
|
|
7
|
+
"header": "awsui_header_14iqq_xfc54_133",
|
|
8
|
+
"header-sticky-disabled": "awsui_header-sticky-disabled_14iqq_xfc54_139",
|
|
9
|
+
"header-sticky-enabled": "awsui_header-sticky-enabled_14iqq_xfc54_143",
|
|
10
|
+
"header-stuck": "awsui_header-stuck_14iqq_xfc54_149",
|
|
11
|
+
"header-dynamic-height": "awsui_header-dynamic-height_14iqq_xfc54_154",
|
|
12
|
+
"with-paddings": "awsui_with-paddings_14iqq_xfc54_160",
|
|
13
|
+
"with-hidden-content": "awsui_with-hidden-content_14iqq_xfc54_163",
|
|
14
|
+
"header-variant-cards": "awsui_header-variant-cards_14iqq_xfc54_167",
|
|
15
|
+
"header-variant-full-page": "awsui_header-variant-full-page_14iqq_xfc54_191",
|
|
16
|
+
"dark-header": "awsui_dark-header_14iqq_xfc54_199",
|
|
17
|
+
"content": "awsui_content_14iqq_xfc54_203",
|
|
18
|
+
"footer": "awsui_footer_14iqq_xfc54_213",
|
|
19
|
+
"with-divider": "awsui_with-divider_14iqq_xfc54_219"
|
|
20
20
|
};
|
|
21
21
|
|
|
@@ -94,7 +94,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
94
94
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
95
95
|
SPDX-License-Identifier: Apache-2.0
|
|
96
96
|
*/
|
|
97
|
-
.
|
|
97
|
+
.awsui_root_14iqq_xfc54_97:not(#\9) {
|
|
98
98
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
99
99
|
border-collapse: separate;
|
|
100
100
|
border-spacing: 0;
|
|
@@ -129,10 +129,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
129
129
|
color: var(--color-text-body-default-ajf1h5, #000716);
|
|
130
130
|
font-weight: 400;
|
|
131
131
|
font-family: var(--font-family-base-qnistn, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
132
|
-
display:
|
|
132
|
+
display: flex;
|
|
133
|
+
flex-flow: column nowrap;
|
|
133
134
|
word-wrap: break-word;
|
|
134
135
|
}
|
|
135
|
-
.
|
|
136
|
+
.awsui_root_14iqq_xfc54_97.awsui_variant-default_14iqq_xfc54_110:not(#\9), .awsui_root_14iqq_xfc54_97.awsui_variant-stacked_14iqq_xfc54_110:not(#\9) {
|
|
136
137
|
box-shadow: var(--shadow-container-7nblnj, 0px 0px 1px 1px #e9ebed, 0px 1px 8px 2px rgba(0, 7, 22, 0.12));
|
|
137
138
|
border-top: var(--border-container-top-width-jk6fhm, 0px) solid var(--color-border-container-top-srcvx4, transparent);
|
|
138
139
|
border-radius: var(--border-radius-container-gh9ysk, 16px);
|
|
@@ -140,79 +141,80 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
140
141
|
background-color: var(--color-background-container-content-i8i4a0, #ffffff);
|
|
141
142
|
}
|
|
142
143
|
@media screen and (-ms-high-contrast: active) {
|
|
143
|
-
.
|
|
144
|
+
.awsui_root_14iqq_xfc54_97.awsui_variant-default_14iqq_xfc54_110:not(#\9), .awsui_root_14iqq_xfc54_97.awsui_variant-stacked_14iqq_xfc54_110:not(#\9) {
|
|
144
145
|
border: var(--border-field-width-idlekx, 2px) solid var(--color-border-container-top-srcvx4, transparent);
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
|
-
.
|
|
148
|
+
.awsui_root_14iqq_xfc54_97.awsui_variant-stacked_14iqq_xfc54_110:not(#\9):not(:last-child) {
|
|
148
149
|
border-bottom-right-radius: 0;
|
|
149
150
|
border-bottom-left-radius: 0;
|
|
150
151
|
}
|
|
151
|
-
.
|
|
152
|
+
.awsui_root_14iqq_xfc54_97.awsui_variant-stacked_14iqq_xfc54_110 + .awsui_root_14iqq_xfc54_97.awsui_variant-stacked_14iqq_xfc54_110:not(#\9) {
|
|
152
153
|
border-top: var(--border-divider-section-width-4wm2it, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
153
154
|
border-top-left-radius: 0;
|
|
154
155
|
border-top-right-radius: 0;
|
|
155
156
|
box-shadow: var(--shadow-container-stacked-lumzae, -1px 1px 1px 0px #e9ebed, 1px 1px 1px 0px #e9ebed, 0px 9px 8px -7px rgba(0, 7, 22, 0.12), 8px 0px 8px -7px rgba(0, 7, 22, 0.12), -8px 0px 8px -7px rgba(0, 7, 22, 0.12));
|
|
156
157
|
}
|
|
157
158
|
|
|
158
|
-
.
|
|
159
|
+
.awsui_header_14iqq_xfc54_133:not(#\9) {
|
|
160
|
+
flex: 0 0 auto;
|
|
159
161
|
background-color: var(--color-background-container-header-4flbq5, #ffffff);
|
|
160
162
|
border-top-left-radius: var(--border-radius-container-gh9ysk, 16px);
|
|
161
163
|
border-top-right-radius: var(--border-radius-container-gh9ysk, 16px);
|
|
162
164
|
}
|
|
163
|
-
.awsui_header-sticky-
|
|
165
|
+
.awsui_header-sticky-disabled_14iqq_xfc54_139:not(#\9) {
|
|
164
166
|
position: relative;
|
|
165
167
|
z-index: 1;
|
|
166
168
|
}
|
|
167
|
-
.awsui_header-sticky-
|
|
169
|
+
.awsui_header-sticky-enabled_14iqq_xfc54_143:not(#\9) {
|
|
168
170
|
top: 0;
|
|
169
171
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
170
172
|
position: sticky;
|
|
171
173
|
z-index: 800;
|
|
172
174
|
}
|
|
173
|
-
.awsui_header-
|
|
175
|
+
.awsui_header-stuck_14iqq_xfc54_149:not(#\9) {
|
|
174
176
|
box-shadow: var(--shadow-sticky-embedded-qit8ba, 0px 2px 0px 0px #e9ebed, 0px 16px 16px -12px rgba(0, 7, 22, 0.1));
|
|
175
177
|
border: 0;
|
|
176
178
|
border-radius: 0;
|
|
177
179
|
}
|
|
178
|
-
.awsui_header-dynamic-
|
|
180
|
+
.awsui_header-dynamic-height_14iqq_xfc54_154.awsui_header-stuck_14iqq_xfc54_149:not(#\9) {
|
|
179
181
|
margin-bottom: calc(var(--font-heading-xl-line-height-doxfdj, 40px) - var(--font-heading-l-line-height-gev4n1, 30px));
|
|
180
182
|
}
|
|
181
|
-
.
|
|
183
|
+
.awsui_header_14iqq_xfc54_133:not(#\9):not(:empty) {
|
|
182
184
|
border-bottom: var(--border-container-sticky-width-i7t7xe, 0px) solid var(--color-border-container-divider-4ade7z, transparent);
|
|
183
185
|
}
|
|
184
|
-
.
|
|
186
|
+
.awsui_header_14iqq_xfc54_133.awsui_with-paddings_14iqq_xfc54_160:not(#\9) {
|
|
185
187
|
padding: var(--space-container-header-vertical-zsjhel, 12px) var(--space-container-horizontal-ddrezg, 24px);
|
|
186
188
|
}
|
|
187
|
-
.
|
|
189
|
+
.awsui_header_14iqq_xfc54_133.awsui_with-hidden-content_14iqq_xfc54_163:not(#\9) {
|
|
188
190
|
border-bottom-left-radius: var(--border-radius-container-gh9ysk, 16px);
|
|
189
191
|
border-bottom-right-radius: var(--border-radius-container-gh9ysk, 16px);
|
|
190
192
|
}
|
|
191
|
-
.awsui_header-variant-
|
|
193
|
+
.awsui_header-variant-cards_14iqq_xfc54_167:not(#\9) {
|
|
192
194
|
box-shadow: var(--shadow-container-7nblnj, 0px 0px 1px 1px #e9ebed, 0px 1px 8px 2px rgba(0, 7, 22, 0.12));
|
|
193
195
|
border-top: var(--border-container-top-width-jk6fhm, 0px) solid var(--color-border-container-top-srcvx4, transparent);
|
|
194
196
|
border-radius: var(--border-radius-container-gh9ysk, 16px);
|
|
195
197
|
box-sizing: border-box;
|
|
196
198
|
}
|
|
197
199
|
@media screen and (-ms-high-contrast: active) {
|
|
198
|
-
.awsui_header-variant-
|
|
200
|
+
.awsui_header-variant-cards_14iqq_xfc54_167:not(#\9) {
|
|
199
201
|
border: var(--border-field-width-idlekx, 2px) solid var(--color-border-container-top-srcvx4, transparent);
|
|
200
202
|
}
|
|
201
203
|
}
|
|
202
|
-
.awsui_header-variant-
|
|
204
|
+
.awsui_header-variant-cards_14iqq_xfc54_167:not(#\9):not(:empty) {
|
|
203
205
|
border-bottom: 1px solid #d5dbdb;
|
|
204
206
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
205
207
|
}
|
|
206
208
|
@supports (--css-variable-support-check: #000) {
|
|
207
|
-
.awsui_header-variant-
|
|
209
|
+
.awsui_header-variant-cards_14iqq_xfc54_167:not(#\9):not(:empty) {
|
|
208
210
|
border-bottom: 0;
|
|
209
211
|
}
|
|
210
212
|
}
|
|
211
|
-
.awsui_header-variant-
|
|
213
|
+
.awsui_header-variant-cards_14iqq_xfc54_167.awsui_header-stuck_14iqq_xfc54_149:not(#\9) {
|
|
212
214
|
border-top-left-radius: 0;
|
|
213
215
|
border-top-right-radius: 0;
|
|
214
216
|
}
|
|
215
|
-
.awsui_header-variant-full-
|
|
217
|
+
.awsui_header-variant-full-page_14iqq_xfc54_191.awsui_header-stuck_14iqq_xfc54_149:not(#\9) {
|
|
216
218
|
box-shadow: var(--shadow-sticky-aijlo6, 0px 4px 20px 1px rgba(0, 7, 22, 0.1));
|
|
217
219
|
}
|
|
218
220
|
|
|
@@ -220,20 +222,26 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
220
222
|
The dynamic height dark header needs a background that will cover
|
|
221
223
|
the default white background of the container component.
|
|
222
224
|
*/
|
|
223
|
-
.awsui_dark-
|
|
225
|
+
.awsui_dark-header_14iqq_xfc54_199:not(#\9) {
|
|
224
226
|
background-color: var(--color-background-layout-main-sfhm4y, #ffffff);
|
|
225
227
|
}
|
|
226
228
|
|
|
227
|
-
.
|
|
229
|
+
.awsui_content_14iqq_xfc54_203:not(#\9) {
|
|
230
|
+
flex: 1 0 auto;
|
|
231
|
+
}
|
|
232
|
+
.awsui_content_14iqq_xfc54_203.awsui_with-paddings_14iqq_xfc54_160:not(#\9) {
|
|
228
233
|
padding: var(--space-scaled-l-t03y3z, 20px) var(--space-container-horizontal-ddrezg, 24px);
|
|
229
234
|
}
|
|
230
|
-
.
|
|
235
|
+
.awsui_header_14iqq_xfc54_133 + .awsui_content_14iqq_xfc54_203.awsui_with-paddings_14iqq_xfc54_160:not(#\9) {
|
|
231
236
|
padding-top: var(--space-container-content-top-fsd8nr, 0px);
|
|
232
237
|
}
|
|
233
238
|
|
|
234
|
-
.
|
|
239
|
+
.awsui_footer_14iqq_xfc54_213:not(#\9) {
|
|
240
|
+
flex: 0 0 auto;
|
|
241
|
+
}
|
|
242
|
+
.awsui_footer_14iqq_xfc54_213.awsui_with-paddings_14iqq_xfc54_160:not(#\9) {
|
|
235
243
|
padding: var(--space-scaled-s-cu1hzn, 12px) var(--space-container-horizontal-ddrezg, 24px);
|
|
236
244
|
}
|
|
237
|
-
.
|
|
245
|
+
.awsui_footer_14iqq_xfc54_213.awsui_with-divider_14iqq_xfc54_219:not(#\9) {
|
|
238
246
|
border-top: var(--border-divider-section-width-4wm2it, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
239
247
|
}
|
|
@@ -2,21 +2,21 @@
|
|
|
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
|
-
"variant-default": "awsui_variant-
|
|
7
|
-
"variant-stacked": "awsui_variant-
|
|
8
|
-
"header": "
|
|
9
|
-
"header-sticky-disabled": "awsui_header-sticky-
|
|
10
|
-
"header-sticky-enabled": "awsui_header-sticky-
|
|
11
|
-
"header-stuck": "awsui_header-
|
|
12
|
-
"header-dynamic-height": "awsui_header-dynamic-
|
|
13
|
-
"with-paddings": "awsui_with-
|
|
14
|
-
"with-hidden-content": "awsui_with-hidden-
|
|
15
|
-
"header-variant-cards": "awsui_header-variant-
|
|
16
|
-
"header-variant-full-page": "awsui_header-variant-full-
|
|
17
|
-
"dark-header": "awsui_dark-
|
|
18
|
-
"content": "
|
|
19
|
-
"footer": "
|
|
20
|
-
"with-divider": "awsui_with-
|
|
5
|
+
"root": "awsui_root_14iqq_xfc54_97",
|
|
6
|
+
"variant-default": "awsui_variant-default_14iqq_xfc54_110",
|
|
7
|
+
"variant-stacked": "awsui_variant-stacked_14iqq_xfc54_110",
|
|
8
|
+
"header": "awsui_header_14iqq_xfc54_133",
|
|
9
|
+
"header-sticky-disabled": "awsui_header-sticky-disabled_14iqq_xfc54_139",
|
|
10
|
+
"header-sticky-enabled": "awsui_header-sticky-enabled_14iqq_xfc54_143",
|
|
11
|
+
"header-stuck": "awsui_header-stuck_14iqq_xfc54_149",
|
|
12
|
+
"header-dynamic-height": "awsui_header-dynamic-height_14iqq_xfc54_154",
|
|
13
|
+
"with-paddings": "awsui_with-paddings_14iqq_xfc54_160",
|
|
14
|
+
"with-hidden-content": "awsui_with-hidden-content_14iqq_xfc54_163",
|
|
15
|
+
"header-variant-cards": "awsui_header-variant-cards_14iqq_xfc54_167",
|
|
16
|
+
"header-variant-full-page": "awsui_header-variant-full-page_14iqq_xfc54_191",
|
|
17
|
+
"dark-header": "awsui_dark-header_14iqq_xfc54_199",
|
|
18
|
+
"content": "awsui_content_14iqq_xfc54_203",
|
|
19
|
+
"footer": "awsui_footer_14iqq_xfc54_213",
|
|
20
|
+
"with-divider": "awsui_with-divider_14iqq_xfc54_219"
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAuB/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAuB/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,QAAA,MAAM,UAAU,6FA8Kf,CAAC;AAGF,eAAe,UAAU,CAAC"}
|
package/date-picker/index.js
CHANGED
|
@@ -78,7 +78,7 @@ var DatePicker = React.forwardRef(function (_a, ref) {
|
|
|
78
78
|
};
|
|
79
79
|
return (React.createElement("div", __assign({}, baseProps, { ref: mergedRef, onKeyDown: onWrapperKeyDownHandler }),
|
|
80
80
|
React.createElement(Dropdown, { stretchWidth: true, stretchHeight: true, open: isDropDownOpen, onDropdownClose: onDropdownCloseHandler, onMouseDown: handleMouseDown, trigger: DateInputElement, expandToViewport: expandToViewport, scrollable: false, dropdownId: dropdownId }, isDropDownOpen && (React.createElement(FocusLock, { autoFocus: true },
|
|
81
|
-
React.createElement("div", __assign({}, focusVisible, { tabIndex: 0, className: styles.calendar, role: "
|
|
81
|
+
React.createElement("div", __assign({}, focusVisible, { tabIndex: 0, className: styles.calendar, role: "dialog", "aria-describedby": calendarDescriptionId, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby }),
|
|
82
82
|
React.createElement(InternalCalendar, { value: value, onChange: function (e) {
|
|
83
83
|
var _a;
|
|
84
84
|
fireNonCancelableEvent(onChange, e.detail);
|
package/date-picker/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":";AAAA,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eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { Ref, useCallback, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { DatePickerProps } from './interfaces';\nimport InternalCalendar from '../calendar/internal';\nimport { normalizeLocale } from '../calendar/utils/locales';\nimport { getDateLabel, renderMonthAndYear } from '../calendar/utils/intl';\nimport { memoizedDate } from '../calendar/utils/memoized-date';\nimport { InputProps } from '../input/interfaces';\nimport { KeyCode } from '../internal/keycode';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport Dropdown from '../internal/components/dropdown';\nimport InternalDateInput from '../date-input/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name.js';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker.js';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport FocusLock from '../internal/components/focus-lock';\nimport useFocusVisible from '../internal/hooks/focus-visible/index.js';\n\nexport { DatePickerProps };\n\nconst DatePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled,\n nextMonthAriaLabel,\n previousMonthAriaLabel,\n todayAriaLabel,\n placeholder = '',\n value = '',\n readOnly = false,\n disabled = false,\n onBlur,\n autoFocus = false,\n onChange,\n onFocus,\n name,\n ariaLabel,\n ariaRequired,\n ariaLabelledby,\n ariaDescribedby,\n controlId,\n invalid,\n openCalendarAriaLabel,\n expandToViewport,\n ...rest\n }: DatePickerProps,\n ref: Ref<DatePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DatePicker');\n checkControlled('DatePicker', 'value', value, 'onChange', onChange);\n\n const baseProps = getBaseProps(rest);\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n const normalizedLocale = normalizeLocale('DatePicker', locale);\n const focusVisible = useFocusVisible();\n\n const internalInputRef = useRef<HTMLInputElement>(null);\n const buttonRef = useRef<ButtonProps.Ref>(null);\n useForwardFocus(ref, internalInputRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('calender');\n const calendarDescriptionId = useUniqueId('calendar-description-');\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n useFocusTracker({ rootRef, onBlur, onFocus, viewportId: expandToViewport ? dropdownId : '' });\n\n const onDropdownCloseHandler = useCallback(() => setIsDropDownOpen(false), [setIsDropDownOpen]);\n\n const onButtonClickHandler = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(true);\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape && isDropDownOpen) {\n buttonRef.current?.focus();\n setIsDropDownOpen(false);\n }\n };\n\n const onInputChangeHandler: InputProps['onChange'] = event => {\n fireNonCancelableEvent(onChange, { value: event.detail.value });\n };\n\n const onInputBlurHandler: InputProps['onBlur'] = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(false);\n }\n };\n\n const memoizedValue = memoizedDate('value', value);\n const baseDate = memoizedValue || new Date();\n\n const DateInputElement = (\n <div className={styles['date-picker-trigger']}>\n <div className={styles['date-picker-input']}>\n <InternalDateInput\n name={name}\n invalid={invalid}\n controlId={controlId}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n onChange={onInputChangeHandler}\n onBlur={onInputBlurHandler}\n placeholder={placeholder}\n ref={internalInputRef}\n autoFocus={autoFocus}\n />\n </div>\n <div>\n <InternalButton\n iconName=\"calendar\"\n className={styles['open-calendar-button']}\n onClick={onButtonClickHandler}\n ref={buttonRef}\n ariaLabel={\n openCalendarAriaLabel &&\n openCalendarAriaLabel(value.length === 10 ? getDateLabel(normalizedLocale, memoizedValue!) : null)\n }\n disabled={disabled || readOnly}\n formAction=\"none\"\n />\n </div>\n </div>\n );\n\n baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);\n\n if (readOnly || disabled) {\n return <div {...baseProps}>{DateInputElement}</div>;\n }\n\n const handleMouseDown = (event: React.MouseEvent) => {\n // prevent currently focused element from losing it\n event.preventDefault();\n };\n\n return (\n <div {...baseProps} ref={mergedRef} onKeyDown={onWrapperKeyDownHandler}>\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={onDropdownCloseHandler}\n onMouseDown={handleMouseDown}\n trigger={DateInputElement}\n expandToViewport={expandToViewport}\n scrollable={false}\n dropdownId={dropdownId}\n >\n {isDropDownOpen && (\n <FocusLock autoFocus={true}>\n <div\n {...focusVisible}\n tabIndex={0}\n className={styles.calendar}\n role=\"application\"\n aria-describedby={calendarDescriptionId}\n >\n <InternalCalendar\n value={value}\n onChange={e => {\n fireNonCancelableEvent(onChange, e.detail);\n buttonRef?.current?.focus();\n setIsDropDownOpen(false);\n }}\n locale={normalizedLocale}\n startOfWeek={startOfWeek}\n isDateEnabled={isDateEnabled}\n todayAriaLabel={todayAriaLabel}\n nextMonthAriaLabel={nextMonthAriaLabel}\n previousMonthAriaLabel={previousMonthAriaLabel}\n />\n <div id={calendarDescriptionId} className={styles['screenreader-only']} aria-live=\"polite\">\n {renderMonthAndYear(normalizedLocale, baseDate)}\n </div>\n </div>\n </FocusLock>\n )}\n </Dropdown>\n </div>\n );\n }\n);\n\napplyDisplayName(DatePicker, 'DatePicker');\nexport default DatePicker;\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/date-picker/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;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AC3C,eAAe,UAAU,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { Ref, useCallback, useRef, useState } from 'react';\nimport styles from './styles.css.js';\nimport { DatePickerProps } from './interfaces';\nimport InternalCalendar from '../calendar/internal';\nimport { normalizeLocale } from '../calendar/utils/locales';\nimport { getDateLabel, renderMonthAndYear } from '../calendar/utils/intl';\nimport { memoizedDate } from '../calendar/utils/memoized-date';\nimport { InputProps } from '../input/interfaces';\nimport { KeyCode } from '../internal/keycode';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport Dropdown from '../internal/components/dropdown';\nimport InternalDateInput from '../date-input/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name.js';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { useFocusTracker } from '../internal/hooks/use-focus-tracker.js';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport FocusLock from '../internal/components/focus-lock';\nimport useFocusVisible from '../internal/hooks/focus-visible/index.js';\n\nexport { DatePickerProps };\n\nconst DatePicker = React.forwardRef(\n (\n {\n locale = '',\n startOfWeek,\n isDateEnabled,\n nextMonthAriaLabel,\n previousMonthAriaLabel,\n todayAriaLabel,\n placeholder = '',\n value = '',\n readOnly = false,\n disabled = false,\n onBlur,\n autoFocus = false,\n onChange,\n onFocus,\n name,\n ariaLabel,\n ariaRequired,\n ariaLabelledby,\n ariaDescribedby,\n controlId,\n invalid,\n openCalendarAriaLabel,\n expandToViewport,\n ...rest\n }: DatePickerProps,\n ref: Ref<DatePickerProps.Ref>\n ) => {\n const { __internalRootRef } = useBaseComponent('DatePicker');\n checkControlled('DatePicker', 'value', value, 'onChange', onChange);\n\n const baseProps = getBaseProps(rest);\n const [isDropDownOpen, setIsDropDownOpen] = useState<boolean>(false);\n const normalizedLocale = normalizeLocale('DatePicker', locale);\n const focusVisible = useFocusVisible();\n\n const internalInputRef = useRef<HTMLInputElement>(null);\n const buttonRef = useRef<ButtonProps.Ref>(null);\n useForwardFocus(ref, internalInputRef);\n\n const rootRef = useRef<HTMLDivElement>(null);\n const dropdownId = useUniqueId('calender');\n const calendarDescriptionId = useUniqueId('calendar-description-');\n const mergedRef = useMergeRefs(rootRef, __internalRootRef);\n\n useFocusTracker({ rootRef, onBlur, onFocus, viewportId: expandToViewport ? dropdownId : '' });\n\n const onDropdownCloseHandler = useCallback(() => setIsDropDownOpen(false), [setIsDropDownOpen]);\n\n const onButtonClickHandler = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(true);\n }\n };\n\n const onWrapperKeyDownHandler = (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.keyCode === KeyCode.escape && isDropDownOpen) {\n buttonRef.current?.focus();\n setIsDropDownOpen(false);\n }\n };\n\n const onInputChangeHandler: InputProps['onChange'] = event => {\n fireNonCancelableEvent(onChange, { value: event.detail.value });\n };\n\n const onInputBlurHandler: InputProps['onBlur'] = () => {\n if (!isDropDownOpen) {\n setIsDropDownOpen(false);\n }\n };\n\n const memoizedValue = memoizedDate('value', value);\n const baseDate = memoizedValue || new Date();\n\n const DateInputElement = (\n <div className={styles['date-picker-trigger']}>\n <div className={styles['date-picker-input']}>\n <InternalDateInput\n name={name}\n invalid={invalid}\n controlId={controlId}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n ariaLabel={ariaLabel}\n ariaRequired={ariaRequired}\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n onChange={onInputChangeHandler}\n onBlur={onInputBlurHandler}\n placeholder={placeholder}\n ref={internalInputRef}\n autoFocus={autoFocus}\n />\n </div>\n <div>\n <InternalButton\n iconName=\"calendar\"\n className={styles['open-calendar-button']}\n onClick={onButtonClickHandler}\n ref={buttonRef}\n ariaLabel={\n openCalendarAriaLabel &&\n openCalendarAriaLabel(value.length === 10 ? getDateLabel(normalizedLocale, memoizedValue!) : null)\n }\n disabled={disabled || readOnly}\n formAction=\"none\"\n />\n </div>\n </div>\n );\n\n baseProps.className = clsx(baseProps.className, styles.root, styles['date-picker-container']);\n\n if (readOnly || disabled) {\n return <div {...baseProps}>{DateInputElement}</div>;\n }\n\n const handleMouseDown = (event: React.MouseEvent) => {\n // prevent currently focused element from losing it\n event.preventDefault();\n };\n\n return (\n <div {...baseProps} ref={mergedRef} onKeyDown={onWrapperKeyDownHandler}>\n <Dropdown\n stretchWidth={true}\n stretchHeight={true}\n open={isDropDownOpen}\n onDropdownClose={onDropdownCloseHandler}\n onMouseDown={handleMouseDown}\n trigger={DateInputElement}\n expandToViewport={expandToViewport}\n scrollable={false}\n dropdownId={dropdownId}\n >\n {isDropDownOpen && (\n <FocusLock autoFocus={true}>\n <div\n {...focusVisible}\n tabIndex={0}\n className={styles.calendar}\n role=\"dialog\"\n aria-describedby={calendarDescriptionId}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n >\n <InternalCalendar\n value={value}\n onChange={e => {\n fireNonCancelableEvent(onChange, e.detail);\n buttonRef?.current?.focus();\n setIsDropDownOpen(false);\n }}\n locale={normalizedLocale}\n startOfWeek={startOfWeek}\n isDateEnabled={isDateEnabled}\n todayAriaLabel={todayAriaLabel}\n nextMonthAriaLabel={nextMonthAriaLabel}\n previousMonthAriaLabel={previousMonthAriaLabel}\n />\n <div id={calendarDescriptionId} className={styles['screenreader-only']} aria-live=\"polite\">\n {renderMonthAndYear(normalizedLocale, baseDate)}\n </div>\n </div>\n </FocusLock>\n )}\n </Dropdown>\n </div>\n );\n }\n);\n\napplyDisplayName(DatePicker, 'DatePicker');\nexport default DatePicker;\n"]}
|
package/internal/environment.js
CHANGED
package/package.json
CHANGED
|
@@ -140,6 +140,7 @@ export declare namespace S3ResourceSelectorProps {
|
|
|
140
140
|
inContextSelectPlaceholder: string;
|
|
141
141
|
inContextBrowseButton: string;
|
|
142
142
|
inContextViewButton: string;
|
|
143
|
+
inContextViewButtonAriaLabel?: string;
|
|
143
144
|
inContextLoadingText: string;
|
|
144
145
|
inContextUriLabel: string;
|
|
145
146
|
inContextVersionSelectLabel: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/s3-resource-selector/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,uBAAwB,SAAQ,kBAAkB;IACjE;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,aAAa,CAAC,uBAAuB,CAAC,eAAe,CAAC,CAAC;IAE9E;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAE9C;;;OAGG;IACH,qBAAqB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAE9C;;;OAGG;IACH,sBAAsB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAE/C;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,CAAC,IAAI,EAAE,uBAAuB,CAAC,MAAM,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|
-
{"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';\nimport { TableProps } from '../table/interfaces';\nimport { PaginationProps } from '../pagination/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface S3ResourceSelectorProps extends BaseComponentProps {\n /**\n * Specifies additional information about component status.\n */\n alert?: React.ReactNode;\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 * 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 */\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 inContextInputPlaceholder: string;\n inContextSelectPlaceholder: string;\n inContextBrowseButton: string;\n inContextViewButton: string;\n inContextLoadingText: string;\n inContextUriLabel: string;\n inContextVersionSelectLabel: string;\n\n modalTitle: string;\n modalCancelButton: string;\n modalSubmitButton: string;\n modalBreadcrumbRootItem: 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 }\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';\nimport { TableProps } from '../table/interfaces';\nimport { PaginationProps } from '../pagination/interfaces';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface S3ResourceSelectorProps extends BaseComponentProps {\n /**\n * Specifies additional information about component status.\n */\n alert?: React.ReactNode;\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 * 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 */\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 inContextInputPlaceholder: 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\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 }\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 +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;AAU3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAKxD,UAAU,gBAAgB;IACxB,WAAW,EAAE,uBAAuB,CAAC,WAAW,GAAG,SAAS,CAAC;IAC7D,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,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,
|
|
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;AAU3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAKxD,UAAU,gBAAgB;IACxB,WAAW,EAAE,uBAAuB,CAAC,WAAW,GAAG,SAAS,CAAC;IAC7D,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,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,yFAkHvB,CAAC"}
|
|
@@ -52,7 +52,7 @@ export var S3InContext = React.forwardRef(function (_a, ref) {
|
|
|
52
52
|
supportsVersions && (React.createElement(InternalFormField, { className: styles['layout-version'], label: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextVersionSelectLabel, stretch: true },
|
|
53
53
|
React.createElement(InternalSelect, { selectedOption: selectedVersion, placeholder: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextSelectPlaceholder, disabled: versions.length === 0, options: versions, onChange: function (event) { return onChange(__assign(__assign({}, resource), { versionId: event.detail.selectedOption.value }), undefined); }, invalid: false }))),
|
|
54
54
|
React.createElement("div", null,
|
|
55
|
-
React.createElement(InternalButton, { className: styles['view-button'], disabled: !viewHref, href: viewHref, target: "_blank", iconName: "external", iconAlign: "right", formAction: "none" }, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextViewButton)),
|
|
55
|
+
React.createElement(InternalButton, { className: styles['view-button'], disabled: !viewHref, href: viewHref, target: "_blank", iconName: "external", iconAlign: "right", formAction: "none", ariaLabel: i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextViewButtonAriaLabel }, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextViewButton)),
|
|
56
56
|
React.createElement("div", { className: styles['layout-divider'] }),
|
|
57
57
|
React.createElement("div", null,
|
|
58
58
|
React.createElement(InternalButton, { className: styles['browse-button'], disabled: loading, formAction: "none", onClick: onBrowse }, i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.inContextBrowseButton))),
|
|
@@ -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,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,WAAW,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAE1D,OAAO,cAAc,MAAM,uBAAuB,CAAC;AACnD,OAAO,uBAAuB,MAAM,iCAAiC,CAAC;AAEtE,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,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ACN,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,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,qBAAqB,CACpB,CACb,CACF;QAEN,6BAAK,IAAI,EAAC,OAAO,eAAW,WAAW,iBAAa,MAAM,IACvD,OAAO,IAAI,CACV,oBAAC,WAAW,IAAC,MAAM,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;YAC/B,oBAAC,uBAAuB,IAAC,IAAI,EAAC,SAAS,IAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,oBAAoB,CAA2B,CACzF,CACf,CACG,CACF,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, { useState, useEffect, useRef } from 'react';\nimport InternalBox from '../../box/internal';\nimport { InternalButton } from '../../button/internal';\nimport InternalFormField from '../../form-field/internal';\nimport { InputProps } from '../../input/interfaces';\nimport InternalSelect from '../../select/internal';\nimport InternalStatusIndicator from '../../status-indicator/internal';\nimport { NonCancelableCustomEvent } from '../../internal/events';\nimport useForwardFocus from '../../internal/hooks/forward-focus';\nimport { useVersionsFetch } from './use-versions-fetch';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { validate, getErrorText } from './validation';\nimport styles from './styles.css.js';\nimport { SearchInput } from './search-input';\n\ninterface S3InContextProps {\n i18nStrings: S3ResourceSelectorProps.I18nStrings | 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 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 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(i18nStrings, errorCode));\n }\n\n function handleUriBlur() {\n isInputBlurredRef.current = true;\n setInputTouched(true);\n const errorCode = validate(resource.uri);\n onChange(resource, getErrorText(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 className={styles['layout-uri']} label={i18nStrings?.inContextUriLabel} stretch={true}>\n <SearchInput\n ref={inputRef}\n value={uri}\n ariaDescribedby={inputAriaDescribedby}\n placeholder={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={i18nStrings?.inContextVersionSelectLabel}\n stretch={true}\n >\n <InternalSelect\n selectedOption={selectedVersion}\n placeholder={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={i18nStrings?.inContextViewButtonAriaLabel}\n >\n {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 {i18nStrings?.inContextBrowseButton}\n </InternalButton>\n </div>\n </div>\n\n <div role=\"alert\" aria-live=\"assertive\" aria-atomic=\"true\">\n {loading && (\n <InternalBox margin={{ top: 's' }}>\n <InternalStatusIndicator type=\"loading\">{i18nStrings?.inContextLoadingText}</InternalStatusIndicator>\n </InternalBox>\n )}\n </div>\n </div>\n );\n }\n);\n"]}
|