@cloudscape-design/components 3.0.891 → 3.0.892

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.
Files changed (43) hide show
  1. package/i18n/messages/all.all.js +1 -1
  2. package/i18n/messages/all.all.json +1 -1
  3. package/i18n/messages/all.ar.js +1 -1
  4. package/i18n/messages/all.ar.json +1 -1
  5. package/i18n/messages/all.de.js +1 -1
  6. package/i18n/messages/all.de.json +1 -1
  7. package/i18n/messages/all.en-GB.js +1 -1
  8. package/i18n/messages/all.en-GB.json +1 -1
  9. package/i18n/messages/all.en.js +1 -1
  10. package/i18n/messages/all.en.json +1 -1
  11. package/i18n/messages/all.es.js +1 -1
  12. package/i18n/messages/all.es.json +1 -1
  13. package/i18n/messages/all.fr.js +1 -1
  14. package/i18n/messages/all.fr.json +1 -1
  15. package/i18n/messages/all.id.js +1 -1
  16. package/i18n/messages/all.id.json +1 -1
  17. package/i18n/messages/all.it.js +1 -1
  18. package/i18n/messages/all.it.json +1 -1
  19. package/i18n/messages/all.ja.js +1 -1
  20. package/i18n/messages/all.ja.json +1 -1
  21. package/i18n/messages/all.ko.js +1 -1
  22. package/i18n/messages/all.ko.json +1 -1
  23. package/i18n/messages/all.pt-BR.js +1 -1
  24. package/i18n/messages/all.pt-BR.json +1 -1
  25. package/i18n/messages/all.tr.js +1 -1
  26. package/i18n/messages/all.tr.json +1 -1
  27. package/i18n/messages/all.zh-CN.js +1 -1
  28. package/i18n/messages/all.zh-CN.json +1 -1
  29. package/i18n/messages/all.zh-TW.js +1 -1
  30. package/i18n/messages/all.zh-TW.json +1 -1
  31. package/i18n/messages-types.d.ts +2 -0
  32. package/i18n/messages-types.d.ts.map +1 -1
  33. package/i18n/messages-types.js.map +1 -1
  34. package/internal/environment.js +1 -1
  35. package/internal/environment.json +1 -1
  36. package/internal/manifest.json +1 -1
  37. package/package.json +1 -1
  38. package/s3-resource-selector/interfaces.d.ts +2 -0
  39. package/s3-resource-selector/interfaces.d.ts.map +1 -1
  40. package/s3-resource-selector/interfaces.js.map +1 -1
  41. package/s3-resource-selector/s3-modal/objects-table.d.ts.map +1 -1
  42. package/s3-resource-selector/s3-modal/objects-table.js +4 -1
  43. package/s3-resource-selector/s3-modal/objects-table.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/s3-resource-selector/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { BaseModalProps } from '../modal/interfaces';\nimport { PaginationProps } from '../pagination/interfaces';\nimport { TableProps } from '../table/interfaces';\n\nexport interface S3ResourceSelectorProps extends BaseComponentProps, BaseModalProps {\n /**\n * Specifies additional information about component status.\n */\n alert?: React.ReactNode;\n\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for each element that you want to use as a description\n * and set the property to a string of each ID separated by spaces (for example, `\"id1 id2 id3\"`).\n */\n ariaDescribedby?: string;\n\n /**\n * Adds `aria-label` to the component.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the S3 URI input. If you're using this component within a form field,\n * you do not need to set this property, as the form field component will set it automatically.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n inputAriaDescribedby?: string;\n\n /**\n * Adds a placeholder to the S3 URI input.\n */\n inputPlaceholder?: string;\n\n /**\n * An array of the item types that are selectable in the table view. The array may contain the following items:\n * 'buckets', 'objects', or 'versions'. Example: ['buckets', 'objects']. By default, no items are selectable.\n * This property determines whether the component operates in Read mode or Write mode:\n * * Read mode - When 'objects' and 'versions' values are provided (folder selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n * * Write mode - When 'buckets' and 'objects' values are provided (file selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n */\n selectableItemsTypes?: ReadonlyArray<S3ResourceSelectorProps.SelectableItems>;\n\n /**\n * Href of the selected object that is applied to the View button.\n */\n viewHref?: string;\n\n /**\n * Whether the S3 URI input field is in invalid state.\n */\n invalid?: boolean;\n\n /**\n * Optionally overrides the set of visible columns in the Buckets view. Available columns: 'Name', 'CreationDate',\n * and 'Region'.\n */\n bucketsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Objects view. Available columns: 'Key', 'LastModified',\n * and 'Size'.\n */\n objectsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Versions view. Available columns: 'ID', 'CreationDate',\n * and 'Size'.\n */\n versionsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides whether a bucket should be disabled for selection in the Buckets view or not.\n * It has higher priority than `selectableItemsTypes`. Example: if `selectableItemsTypes` has `['buckets']` value and\n * `bucketsIsItemDisabled` returns false for a bucket, then the bucket is disabled for selection.\n */\n bucketsIsItemDisabled?: (item: S3ResourceSelectorProps.Bucket) => boolean;\n\n /**\n * Optionally overrides whether an object should be disabled for selection in the Objects view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n objectsIsItemDisabled?: (item: S3ResourceSelectorProps.Object) => boolean;\n\n /**\n * Optionally overrides whether a version should be disabled for selection in the Versions view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n versionsIsItemDisabled?: (item: S3ResourceSelectorProps.Version) => boolean;\n\n /**\n * The current selected resource. Resource has the following properties:\n * - `uri` (string) - URI of the resource.\n * - `versionId` (string) - (Optional) Version ID of the selected resource.\n */\n resource: S3ResourceSelectorProps.Resource;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: S3ResourceSelectorProps.I18nStrings;\n\n /**\n * Specifies a function that returns all available buckets. The return type of the function should be a promise\n * that resolves to a list of objects with the following properties:\n * - `Name` (string) - Name of the bucket.\n * - `CreationDate` (string) - (Optional) Creation date of the bucket.\n * - `Region` (string) - (Optional) Region of the bucket.\n */\n fetchBuckets: () => Promise<ReadonlyArray<S3ResourceSelectorProps.Bucket>>;\n\n /**\n * Specifies a function that returns available objects and object prefixes for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of objects with the following properties:\n * - `Key` (string) - Name of the object or object prefix.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object.\n * - `IsFolder` (boolean) - (Optional) Determines whether the entry is an object prefix (folder).\n */\n fetchObjects: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Object>>;\n\n /**\n * Specifies a function that returns available versions for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of versions with the following properties:\n * - `VersionId` (string) - Version ID of an object.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object version.\n */\n fetchVersions: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Version>>;\n\n /**\n * Fired when the resource selection is changed. The event detail object contains resource that represents the full\n * path of the selected resource and `errorText` that may contain a validation error.\n */\n onChange?: NonCancelableEventHandler<S3ResourceSelectorProps.ChangeDetail>;\n}\n\n// Does not use TableProps.AriaLabels, because here we do not need \"allItemsSelectionLabel\"\n// it is not applicable to single selection mode\ninterface SelectionLabels<T> {\n itemSelectionLabel: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel: string;\n}\n\ntype SortingColumnContainingString = (columnName: string) => string;\n\nexport namespace S3ResourceSelectorProps {\n export interface Bucket {\n Name?: string;\n CreationDate?: string;\n // artificial field, does not exist on the real s3 response\n Region?: string;\n }\n export interface Object {\n Key?: string;\n LastModified?: string;\n Size?: number;\n // artificial field, does not exist on the real s3 response\n IsFolder?: boolean;\n }\n export interface Version {\n VersionId?: string;\n LastModified?: string;\n Size?: number;\n }\n\n export interface Resource {\n uri: string;\n versionId?: string;\n }\n\n export type SelectableItems = 'buckets' | 'objects' | 'versions';\n\n export interface I18nStrings {\n /**\n * @deprecated Use `inputPlaceholder` on the component instead.\n */\n inContextInputPlaceholder?: string;\n inContextInputClearAriaLabel?: string;\n inContextSelectPlaceholder?: string;\n inContextBrowseButton?: string;\n inContextViewButton?: string;\n inContextViewButtonAriaLabel?: string;\n inContextLoadingText?: string;\n inContextUriLabel?: string;\n inContextVersionSelectLabel?: string;\n\n modalTitle?: string;\n modalCancelButton?: string;\n modalSubmitButton?: string;\n modalBreadcrumbRootItem?: string;\n modalLastUpdatedText?: string;\n\n selectionBuckets?: string;\n selectionObjects?: string;\n selectionVersions?: string;\n selectionBucketsSearchPlaceholder?: string;\n selectionObjectsSearchPlaceholder?: string;\n selectionVersionsSearchPlaceholder?: string;\n selectionBucketsLoading?: string;\n selectionBucketsNoItems?: string;\n selectionObjectsLoading?: string;\n selectionObjectsNoItems?: string;\n selectionVersionsLoading?: string;\n selectionVersionsNoItems?: string;\n\n filteringCounterText?: (count: number) => string;\n filteringNoMatches?: string;\n filteringCantFindMatch?: string;\n clearFilterButtonText?: string;\n\n columnBucketName?: string;\n columnBucketCreationDate?: string;\n columnBucketRegion?: string;\n columnObjectKey?: string;\n columnObjectLastModified?: string;\n columnObjectSize?: string;\n columnVersionID?: string;\n columnVersionLastModified?: string;\n columnVersionSize?: string;\n\n validationPathMustBegin?: string;\n validationBucketLowerCase?: string;\n validationBucketMustNotContain?: string;\n validationBucketLength?: string;\n validationBucketMustComplyDns?: string;\n\n labelSortedDescending?: SortingColumnContainingString;\n labelSortedAscending?: SortingColumnContainingString;\n labelNotSorted?: SortingColumnContainingString;\n labelsPagination?: PaginationProps.Labels;\n labelsBucketsSelection?: SelectionLabels<Bucket>;\n labelsObjectsSelection?: SelectionLabels<S3ResourceSelectorProps.Object>;\n labelsVersionsSelection?: SelectionLabels<Version>;\n labelFiltering?: (itemsType: string) => string;\n labelRefresh?: string;\n labelModalDismiss?: string;\n labelBreadcrumbs?: string;\n labelExpandBreadcrumbs?: string;\n labelClearFilter?: string;\n }\n\n export interface ChangeDetail {\n resource: Resource;\n errorText?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the S3 URI input field\n */\n focus(): void;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/s3-resource-selector/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\nimport { BaseModalProps } from '../modal/interfaces';\nimport { PaginationProps } from '../pagination/interfaces';\nimport { TableProps } from '../table/interfaces';\n\nexport interface S3ResourceSelectorProps extends BaseComponentProps, BaseModalProps {\n /**\n * Specifies additional information about component status.\n */\n alert?: React.ReactNode;\n\n /**\n * Adds `aria-labelledby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n ariaLabelledby?: string;\n\n /**\n * Adds `aria-describedby` to the component. If you're using this component within a form field,\n * don't set this property because the form field component automatically sets it.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for each element that you want to use as a description\n * and set the property to a string of each ID separated by spaces (for example, `\"id1 id2 id3\"`).\n */\n ariaDescribedby?: string;\n\n /**\n * Adds `aria-label` to the component.\n */\n ariaLabel?: string;\n\n /**\n * Adds `aria-labelledby` to the S3 URI input. If you're using this component within a form field,\n * you do not need to set this property, as the form field component will set it automatically.\n *\n * Use this property if the component isn't surrounded by a form field, or you want to override the value\n * automatically set by the form field (for example, if you have two components within a single form field).\n *\n * To use it correctly, define an ID for the element you want to use as label and set the property to that ID.\n */\n inputAriaDescribedby?: string;\n\n /**\n * Adds a placeholder to the S3 URI input.\n */\n inputPlaceholder?: string;\n\n /**\n * An array of the item types that are selectable in the table view. The array may contain the following items:\n * 'buckets', 'objects', or 'versions'. Example: ['buckets', 'objects']. By default, no items are selectable.\n * This property determines whether the component operates in Read mode or Write mode:\n * * Read mode - When 'objects' and 'versions' values are provided (folder selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n * * Write mode - When 'buckets' and 'objects' values are provided (file selection should be disabled by\n * customizing `objectsIsItemDisabled` function).\n */\n selectableItemsTypes?: ReadonlyArray<S3ResourceSelectorProps.SelectableItems>;\n\n /**\n * Href of the selected object that is applied to the View button.\n */\n viewHref?: string;\n\n /**\n * Whether the S3 URI input field is in invalid state.\n */\n invalid?: boolean;\n\n /**\n * Optionally overrides the set of visible columns in the Buckets view. Available columns: 'Name', 'CreationDate',\n * and 'Region'.\n */\n bucketsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Objects view. Available columns: 'Key', 'LastModified',\n * and 'Size'.\n */\n objectsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides the set of visible columns in the Versions view. Available columns: 'ID', 'CreationDate',\n * and 'Size'.\n */\n versionsVisibleColumns?: ReadonlyArray<string>;\n\n /**\n * Optionally overrides whether a bucket should be disabled for selection in the Buckets view or not.\n * It has higher priority than `selectableItemsTypes`. Example: if `selectableItemsTypes` has `['buckets']` value and\n * `bucketsIsItemDisabled` returns false for a bucket, then the bucket is disabled for selection.\n */\n bucketsIsItemDisabled?: (item: S3ResourceSelectorProps.Bucket) => boolean;\n\n /**\n * Optionally overrides whether an object should be disabled for selection in the Objects view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n objectsIsItemDisabled?: (item: S3ResourceSelectorProps.Object) => boolean;\n\n /**\n * Optionally overrides whether a version should be disabled for selection in the Versions view or not. Similar to\n * `bucketsIsItemDisabled` this property takes precedence over the `selectableItemsTypes` property.\n */\n versionsIsItemDisabled?: (item: S3ResourceSelectorProps.Version) => boolean;\n\n /**\n * The current selected resource. Resource has the following properties:\n * - `uri` (string) - URI of the resource.\n * - `versionId` (string) - (Optional) Version ID of the selected resource.\n */\n resource: S3ResourceSelectorProps.Resource;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: S3ResourceSelectorProps.I18nStrings;\n\n /**\n * Specifies a function that returns all available buckets. The return type of the function should be a promise\n * that resolves to a list of objects with the following properties:\n * - `Name` (string) - Name of the bucket.\n * - `CreationDate` (string) - (Optional) Creation date of the bucket.\n * - `Region` (string) - (Optional) Region of the bucket.\n */\n fetchBuckets: () => Promise<ReadonlyArray<S3ResourceSelectorProps.Bucket>>;\n\n /**\n * Specifies a function that returns available objects and object prefixes for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of objects with the following properties:\n * - `Key` (string) - Name of the object or object prefix.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object.\n * - `IsFolder` (boolean) - (Optional) Determines whether the entry is an object prefix (folder).\n */\n fetchObjects: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Object>>;\n\n /**\n * Specifies a function that returns available versions for the given `bucketName` and `pathPrefix`.\n * The return type of the function should be a promise that resolves to a list of versions with the following properties:\n * - `VersionId` (string) - Version ID of an object.\n * - `LastModified` (string) - (Optional) Date when this object was last modified.\n * - `Size` (number) - (Optional) Size of the object version.\n */\n fetchVersions: (bucketName: string, pathPrefix: string) => Promise<ReadonlyArray<S3ResourceSelectorProps.Version>>;\n\n /**\n * Fired when the resource selection is changed. The event detail object contains resource that represents the full\n * path of the selected resource and `errorText` that may contain a validation error.\n */\n onChange?: NonCancelableEventHandler<S3ResourceSelectorProps.ChangeDetail>;\n}\n\n// Does not use TableProps.AriaLabels, because here we do not need \"allItemsSelectionLabel\"\n// it is not applicable to single selection mode\ninterface SelectionLabels<T> {\n itemSelectionLabel: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel: string;\n}\n\ntype SortingColumnContainingString = (columnName: string) => string;\n\nexport namespace S3ResourceSelectorProps {\n export interface Bucket {\n Name?: string;\n CreationDate?: string;\n // artificial field, does not exist on the real s3 response\n Region?: string;\n }\n export interface Object {\n Key?: string;\n LastModified?: string;\n Size?: number;\n // artificial field, does not exist on the real s3 response\n IsFolder?: boolean;\n }\n export interface Version {\n VersionId?: string;\n LastModified?: string;\n Size?: number;\n }\n\n export interface Resource {\n uri: string;\n versionId?: string;\n }\n\n export type SelectableItems = 'buckets' | 'objects' | 'versions';\n\n export interface I18nStrings {\n /**\n * @deprecated Use `inputPlaceholder` on the component instead.\n */\n inContextInputPlaceholder?: string;\n inContextInputClearAriaLabel?: string;\n inContextSelectPlaceholder?: string;\n inContextBrowseButton?: string;\n inContextViewButton?: string;\n inContextViewButtonAriaLabel?: string;\n inContextLoadingText?: string;\n inContextUriLabel?: string;\n inContextVersionSelectLabel?: string;\n\n modalTitle?: string;\n modalCancelButton?: string;\n modalSubmitButton?: string;\n modalBreadcrumbRootItem?: string;\n modalLastUpdatedText?: string;\n\n selectionBuckets?: string;\n selectionObjects?: string;\n selectionVersions?: string;\n selectionBucketsSearchPlaceholder?: string;\n selectionObjectsSearchPlaceholder?: string;\n selectionVersionsSearchPlaceholder?: string;\n selectionBucketsLoading?: string;\n selectionBucketsNoItems?: string;\n selectionObjectsLoading?: string;\n selectionObjectsNoItems?: string;\n selectionVersionsLoading?: string;\n selectionVersionsNoItems?: string;\n\n filteringCounterText?: (count: number) => string;\n filteringNoMatches?: string;\n filteringCantFindMatch?: string;\n clearFilterButtonText?: string;\n\n columnBucketName?: string;\n columnBucketCreationDate?: string;\n columnBucketRegion?: string;\n columnObjectKey?: string;\n columnObjectLastModified?: string;\n columnObjectSize?: string;\n columnVersionID?: string;\n columnVersionLastModified?: string;\n columnVersionSize?: string;\n\n validationPathMustBegin?: string;\n validationBucketLowerCase?: string;\n validationBucketMustNotContain?: string;\n validationBucketLength?: string;\n validationBucketMustComplyDns?: string;\n\n labelSortedDescending?: SortingColumnContainingString;\n labelSortedAscending?: SortingColumnContainingString;\n labelNotSorted?: SortingColumnContainingString;\n labelsPagination?: PaginationProps.Labels;\n labelsBucketsSelection?: SelectionLabels<Bucket>;\n labelsObjectsSelection?: SelectionLabels<S3ResourceSelectorProps.Object>;\n labelsVersionsSelection?: SelectionLabels<Version>;\n labelFiltering?: (itemsType: string) => string;\n labelRefresh?: string;\n labelModalDismiss?: string;\n labelBreadcrumbs?: string;\n labelExpandBreadcrumbs?: string;\n labelClearFilter?: string;\n labelIconObject?: string;\n labelIconFolder?: string;\n }\n\n export interface ChangeDetail {\n resource: Resource;\n errorText?: string;\n }\n\n export interface Ref {\n /**\n * Focuses the S3 URI input field\n */\n focus(): void;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"objects-table.d.ts","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-modal/objects-table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,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,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,cAAc,EAAE,UAAU,CAAC,cAAc,CAAC,uBAAuB,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACtF,oBAAoB,EAAE,uBAAuB,CAAC,sBAAsB,CAAC,CAAC;IACtE,SAAS,EAAE,uBAAuB,CAAC,cAAc,CAAC,CAAC;IACnD,WAAW,EAAE,uBAAuB,CAAC,WAAW,GAAG,SAAS,CAAC;IAC7D,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,CAAC,IAAI,EAAE,uBAAuB,CAAC,MAAM,KAAK,IAAI,CAAC;IAC5D,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,wBAAgB,YAAY,CAAC,EAC3B,eAAe,EACf,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,WAAW,EACX,QAAQ,GACT,EAAE,iBAAiB,eAmGnB"}
@@ -24,8 +24,11 @@ export function ObjectsTable({ forwardFocusRef, pathSegments, i18nStrings, isVis
24
24
  sortingField: 'Key',
25
25
  cell: item => {
26
26
  const isClickable = item.IsFolder || includes(selectableItemsTypes, 'versions');
27
+ const iconProps = item.IsFolder
28
+ ? { name: 'folder', ariaLabel: i18n('i18nStrings.labelIconFolder', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelIconFolder) }
29
+ : { name: 'file', ariaLabel: i18n('i18nStrings.labelIconObject', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.labelIconObject) };
27
30
  return (React.createElement(React.Fragment, null,
28
- React.createElement(InternalIcon, { name: item.IsFolder ? 'folder' : 'file' }),
31
+ React.createElement(InternalIcon, Object.assign({}, iconProps)),
29
32
  ' ',
30
33
  isClickable ? (React.createElement(InternalLink, { onFollow: () => item.Key && onDrilldown(item), variant: "link" }, item.Key)) : (item.Key)));
31
34
  },
@@ -1 +1 @@
1
- {"version":3,"file":"objects-table.js","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-modal/objects-table.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAE/C,OAAO,YAAY,MAAM,qBAAqB,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAe3E,MAAM,UAAU,YAAY,CAAC,EAC3B,eAAe,EACf,YAAY,EACZ,WAAW,EACX,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,WAAW,EACX,QAAQ,GACU;;IAClB,MAAM,IAAI,GAAG,eAAe,CAAC,sBAAsB,CAAC,CAAC;IAErD,OAAO,CACL,oBAAC,YAAY;QACX,uGAAuG;QACvG,GAAG,EAAE,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAC3B,eAAe,EAAE,eAAe,EAChC,OAAO,EAAC,KAAK,EACb,SAAS,EAAE,GAAG,EAAE;YACd,MAAM,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,GAAG,YAAY,CAAC;YAC3C,OAAO,SAAS,CAAC,UAAU,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;QACrD,CAAC,EACD,WAAW,kCACN,mBAAmB,CAAC,IAAI,EAAE,WAAW,CAAC,KACzC,MAAM,EAAE,IAAI,CAAC,8BAA8B,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,gBAAgB,CAAC,EAC3E,W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,YAAY,EAAE,CAAC,CAAC,YAAY,CAAC;gBACzE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC;aAC/C;YACD;gBACE,EAAE,EAAE,MAAM;gBACV,MAAM,EAAE,IAAI,CAAC,8BAA8B,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,gBAAgB,CAAC;gBAC3E,SAAS,EAAE,kBAAkB,CAC3B,IAAI,EACJ,WAAW,EACX,IAAI,CAAC,8BAA8B,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,gBAAgB,CAAC,CACpE;gBACD,YAAY,EAAE,MAAM;gBACpB,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;aACpC;SACF,EACD,QAAQ,EAAE,IAAI,CAAC,EAAE,WAAC,OAAA,QAAQ,CAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,mCAAI,EAAE,CAAC,CAAA,EAAA,GAC3C,CACH,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';\n\nimport { useInternalI18n } from '../../i18n/context';\nimport InternalIcon from '../../icon/internal';\nimport { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport InternalLink from '../../link/internal';\nimport { TableProps } from '../../table/interfaces';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { joinObjectPath } from '../utils';\nimport { BasicS3Table, getSharedI18Strings } from './basic-table';\nimport { formatDefault, formatSize } from './column-formats';\nimport { compareDates, getColumnAriaLabel, includes } from './table-utils';\n\ninterface ObjectsTableProps {\n forwardFocusRef: React.Ref<ForwardFocusRef>;\n pathSegments: ReadonlyArray<string>;\n visibleColumns: ReadonlyArray<string>;\n isItemDisabled: TableProps.IsItemDisabled<S3ResourceSelectorProps.Object> | undefined;\n selectableItemsTypes: S3ResourceSelectorProps['selectableItemsTypes'];\n fetchData: S3ResourceSelectorProps['fetchObjects'];\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined;\n isVisualRefresh?: boolean;\n onDrilldown: (path: S3ResourceSelectorProps.Object) => void;\n onSelect: (uri: string) => void;\n}\n\nexport function ObjectsTable({\n forwardFocusRef,\n pathSegments,\n i18nStrings,\n isVisualRefresh,\n isItemDisabled,\n selectableItemsTypes,\n fetchData,\n visibleColumns,\n onDrilldown,\n onSelect,\n}: ObjectsTableProps) {\n const i18n = useInternalI18n('s3-resource-selector');\n\n return (\n <BasicS3Table<S3ResourceSelectorProps.Object>\n // remount fresh component every we change the path to reset the inner state (e.g. selection/filtering)\n key={pathSegments.join('/')}\n forwardFocusRef={forwardFocusRef}\n trackBy=\"Key\"\n fetchData={() => {\n const [bucketName, ...rest] = pathSegments;\n return fetchData(bucketName, joinObjectPath(rest));\n }}\n i18nStrings={{\n ...getSharedI18Strings(i18n, i18nStrings),\n header: i18n('i18nStrings.selectionObjects', i18nStrings?.selectionObjects),\n loadingText: i18n('i18nStrings.selectionObjectsLoading', i18nStrings?.selectionObjectsLoading),\n filteringAriaLabel: i18n(\n 'i18nStrings.labelFiltering',\n i18nStrings?.labelFiltering,\n format => itemsType => format({ itemsType })\n )?.(i18n('i18nStrings.selectionObjects', i18nStrings?.selectionObjects) ?? ''),\n filteringPlaceholder: i18n(\n 'i18nStrings.selectionObjectsSearchPlaceholder',\n i18nStrings?.selectionObjectsSearchPlaceholder\n ),\n emptyText: i18n('i18nStrings.selectionObjectsNoItems', i18nStrings?.selectionObjectsNoItems),\n selectionLabels: {\n ...i18nStrings?.labelsObjectsSelection,\n selectionGroupLabel: i18n(\n 'i18nStrings.labelsObjectsSelection.selectionGroupLabel',\n i18nStrings?.labelsObjectsSelection?.selectionGroupLabel\n ),\n itemSelectionLabel: i18n(\n 'i18nStrings.labelsObjectsSelection.itemSelectionLabel',\n i18nStrings?.labelsObjectsSelection?.itemSelectionLabel,\n format => (data, item) => format({ item__Key: item.Key ?? '' })\n ),\n },\n }}\n isVisualRefresh={isVisualRefresh}\n visibleColumns={visibleColumns}\n isItemDisabled={isItemDisabled || (() => !includes(selectableItemsTypes, 'objects'))}\n columnDefinitions={[\n {\n id: 'Key',\n header: i18n('i18nStrings.columnObjectKey', i18nStrings?.columnObjectKey),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnObjectKey', i18nStrings?.columnObjectKey)\n ),\n sortingField: 'Key',\n cell: item => {\n const isClickable = item.IsFolder || includes(selectableItemsTypes, 'versions');\n return (\n <>\n <InternalIcon name={item.IsFolder ? 'folder' : 'file'} />{' '}\n {isClickable ? (\n <InternalLink onFollow={() => item.Key && onDrilldown(item)} variant=\"link\">\n {item.Key}\n </InternalLink>\n ) : (\n item.Key\n )}\n </>\n );\n },\n minWidth: '250px',\n },\n {\n id: 'LastModified',\n header: i18n('i18nStrings.columnObjectLastModified', i18nStrings?.columnObjectLastModified),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnObjectLastModified', i18nStrings?.columnObjectLastModified)\n ),\n sortingComparator: (a, b) => compareDates(a.LastModified, b.LastModified),\n cell: item => formatDefault(item.LastModified),\n },\n {\n id: 'Size',\n header: i18n('i18nStrings.columnObjectSize', i18nStrings?.columnObjectSize),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnObjectSize', i18nStrings?.columnObjectSize)\n ),\n sortingField: 'Size',\n cell: item => formatSize(item.Size),\n },\n ]}\n onSelect={item => onSelect(item?.Key ?? '')}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"objects-table.js","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-modal/objects-table.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAo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E,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,YAAY,CAAC;gBACzE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC;aAC/C;YACD;gBACE,EAAE,EAAE,MAAM;gBACV,MAAM,EAAE,IAAI,CAAC,8BAA8B,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,gBAAgB,CAAC;gBAC3E,SAAS,EAAE,kBAAkB,CAC3B,IAAI,EACJ,WAAW,EACX,IAAI,CAAC,8BAA8B,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,gBAAgB,CAAC,CACpE;gBACD,YAAY,EAAE,MAAM;gBACpB,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;aACpC;SACF,EACD,QAAQ,EAAE,IAAI,CAAC,EAAE,WAAC,OAAA,QAAQ,CAAC,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,GAAG,mCAAI,EAAE,CAAC,CAAA,EAAA,GAC3C,CACH,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';\n\nimport { useInternalI18n } from '../../i18n/context';\nimport { IconProps } from '../../icon/interfaces';\nimport InternalIcon from '../../icon/internal';\nimport { ForwardFocusRef } from '../../internal/hooks/forward-focus';\nimport InternalLink from '../../link/internal';\nimport { TableProps } from '../../table/interfaces';\nimport { S3ResourceSelectorProps } from '../interfaces';\nimport { joinObjectPath } from '../utils';\nimport { BasicS3Table, getSharedI18Strings } from './basic-table';\nimport { formatDefault, formatSize } from './column-formats';\nimport { compareDates, getColumnAriaLabel, includes } from './table-utils';\n\ninterface ObjectsTableProps {\n forwardFocusRef: React.Ref<ForwardFocusRef>;\n pathSegments: ReadonlyArray<string>;\n visibleColumns: ReadonlyArray<string>;\n isItemDisabled: TableProps.IsItemDisabled<S3ResourceSelectorProps.Object> | undefined;\n selectableItemsTypes: S3ResourceSelectorProps['selectableItemsTypes'];\n fetchData: S3ResourceSelectorProps['fetchObjects'];\n i18nStrings: S3ResourceSelectorProps.I18nStrings | undefined;\n isVisualRefresh?: boolean;\n onDrilldown: (path: S3ResourceSelectorProps.Object) => void;\n onSelect: (uri: string) => void;\n}\n\nexport function ObjectsTable({\n forwardFocusRef,\n pathSegments,\n i18nStrings,\n isVisualRefresh,\n isItemDisabled,\n selectableItemsTypes,\n fetchData,\n visibleColumns,\n onDrilldown,\n onSelect,\n}: ObjectsTableProps) {\n const i18n = useInternalI18n('s3-resource-selector');\n\n return (\n <BasicS3Table<S3ResourceSelectorProps.Object>\n // remount fresh component every we change the path to reset the inner state (e.g. selection/filtering)\n key={pathSegments.join('/')}\n forwardFocusRef={forwardFocusRef}\n trackBy=\"Key\"\n fetchData={() => {\n const [bucketName, ...rest] = pathSegments;\n return fetchData(bucketName, joinObjectPath(rest));\n }}\n i18nStrings={{\n ...getSharedI18Strings(i18n, i18nStrings),\n header: i18n('i18nStrings.selectionObjects', i18nStrings?.selectionObjects),\n loadingText: i18n('i18nStrings.selectionObjectsLoading', i18nStrings?.selectionObjectsLoading),\n filteringAriaLabel: i18n(\n 'i18nStrings.labelFiltering',\n i18nStrings?.labelFiltering,\n format => itemsType => format({ itemsType })\n )?.(i18n('i18nStrings.selectionObjects', i18nStrings?.selectionObjects) ?? ''),\n filteringPlaceholder: i18n(\n 'i18nStrings.selectionObjectsSearchPlaceholder',\n i18nStrings?.selectionObjectsSearchPlaceholder\n ),\n emptyText: i18n('i18nStrings.selectionObjectsNoItems', i18nStrings?.selectionObjectsNoItems),\n selectionLabels: {\n ...i18nStrings?.labelsObjectsSelection,\n selectionGroupLabel: i18n(\n 'i18nStrings.labelsObjectsSelection.selectionGroupLabel',\n i18nStrings?.labelsObjectsSelection?.selectionGroupLabel\n ),\n itemSelectionLabel: i18n(\n 'i18nStrings.labelsObjectsSelection.itemSelectionLabel',\n i18nStrings?.labelsObjectsSelection?.itemSelectionLabel,\n format => (data, item) => format({ item__Key: item.Key ?? '' })\n ),\n },\n }}\n isVisualRefresh={isVisualRefresh}\n visibleColumns={visibleColumns}\n isItemDisabled={isItemDisabled || (() => !includes(selectableItemsTypes, 'objects'))}\n columnDefinitions={[\n {\n id: 'Key',\n header: i18n('i18nStrings.columnObjectKey', i18nStrings?.columnObjectKey),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnObjectKey', i18nStrings?.columnObjectKey)\n ),\n sortingField: 'Key',\n cell: item => {\n const isClickable = item.IsFolder || includes(selectableItemsTypes, 'versions');\n const iconProps: IconProps = item.IsFolder\n ? { name: 'folder', ariaLabel: i18n('i18nStrings.labelIconFolder', i18nStrings?.labelIconFolder) }\n : { name: 'file', ariaLabel: i18n('i18nStrings.labelIconObject', i18nStrings?.labelIconObject) };\n return (\n <>\n <InternalIcon {...iconProps} />{' '}\n {isClickable ? (\n <InternalLink onFollow={() => item.Key && onDrilldown(item)} variant=\"link\">\n {item.Key}\n </InternalLink>\n ) : (\n item.Key\n )}\n </>\n );\n },\n minWidth: '250px',\n },\n {\n id: 'LastModified',\n header: i18n('i18nStrings.columnObjectLastModified', i18nStrings?.columnObjectLastModified),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnObjectLastModified', i18nStrings?.columnObjectLastModified)\n ),\n sortingComparator: (a, b) => compareDates(a.LastModified, b.LastModified),\n cell: item => formatDefault(item.LastModified),\n },\n {\n id: 'Size',\n header: i18n('i18nStrings.columnObjectSize', i18nStrings?.columnObjectSize),\n ariaLabel: getColumnAriaLabel(\n i18n,\n i18nStrings,\n i18n('i18nStrings.columnObjectSize', i18nStrings?.columnObjectSize)\n ),\n sortingField: 'Size',\n cell: item => formatSize(item.Size),\n },\n ]}\n onSelect={item => onSelect(item?.Key ?? '')}\n />\n );\n}\n"]}