@cloudscape-design/components 3.0.68 → 3.0.70
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/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
|
@@ -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,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,eAAe,MAAM,oCAAoC,CAAC;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CAAE,KAAK,EAAE,CAAC;wBAC5B,iBAAiB,CAAC,KAAK,CAAC,CAAC;oBAC3B,CAAC,EACD,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,EAAE,sBAAsB,GAC9C;gBACF,6BAAK,EAAE,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC,eAAY,QAAQ,IACvF,kBAAkB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAC3C,CACF,CACI,CACb,CACQ,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,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\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;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAO,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAClE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,QAAQ,MAAM,iCAAiC,CAAC;AACvD,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,eAAe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AAO,0CAAE,KAAK,EAAE,CAAC;wBAC5B,iBAAiB,CAAC,KAAK,CAAC,CAAC;oBAC3B,CAAC,EACD,MAAM,EAAE,gBAAgB,EACxB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,EAC9B,kBAAkB,EAAE,kBAAkB,EACtC,sBAAsB,EAAE,sBAAsB,GAC9C;gBACF,6BAAK,EAAE,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC,eAAY,QAAQ,IACvF,kBAAkB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAC3C,CACF,CACI,CACb,CACQ,CACP,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,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\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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E,eAAe,CAAC,MAAM,CAAC,CAAC;QAChD,sBAAsB,EAAE,eAAe,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC;QACxE,uBAAuB,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;QAClD,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;QAC9C,YAAY,EAAE,MAAM,CAAC;QACrB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,gBAAgB,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';\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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,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,EAA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AAA,QAAQ,uBAAM,QAAQ,KAAE,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,KAAI,SAAS,CAAC,EAAlF,CAAkF,EACrG,OAAO,EAAE,KAAK,GACd,CACgB,CACrB;YACD;gBACE,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,EAChC,QAAQ,EAAE,CAAC,QAAQ,EACnB,IAAI,EAAE,QAAQ,EACd,MAAM,EAAC,QAAQ,EACf,QAAQ,EAAC,UAAU,EACnB,SAAS,EAAC,OAAO,EACjB,UAAU,EAAC,MAAM,EACjB,SAAS,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,4BAA4B,IAEnD,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,mBAAmB,CAClB,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,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"]}
|