@cloudscape-design/components-themeable 3.0.287 → 3.0.288

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 (69) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/collection-preferences/content-display/content-display-option.scss +1 -0
  3. package/lib/internal/scss/collection-preferences/styles.scss +1 -6
  4. package/lib/internal/scss/table/body-cell/styles.scss +0 -52
  5. package/lib/internal/scss/table/header-cell/styles.scss +0 -28
  6. package/lib/internal/template/collection-preferences/content-display/styles.css.js +11 -11
  7. package/lib/internal/template/collection-preferences/content-display/styles.scoped.css +18 -17
  8. package/lib/internal/template/collection-preferences/content-display/styles.selectors.js +11 -11
  9. package/lib/internal/template/collection-preferences/index.d.ts +1 -1
  10. package/lib/internal/template/collection-preferences/index.d.ts.map +1 -1
  11. package/lib/internal/template/collection-preferences/index.js +4 -6
  12. package/lib/internal/template/collection-preferences/index.js.map +1 -1
  13. package/lib/internal/template/collection-preferences/interfaces.d.ts +12 -42
  14. package/lib/internal/template/collection-preferences/interfaces.d.ts.map +1 -1
  15. package/lib/internal/template/collection-preferences/interfaces.js.map +1 -1
  16. package/lib/internal/template/collection-preferences/styles.css.js +32 -37
  17. package/lib/internal/template/collection-preferences/styles.scoped.css +40 -44
  18. package/lib/internal/template/collection-preferences/styles.selectors.js +32 -37
  19. package/lib/internal/template/collection-preferences/utils.d.ts +1 -12
  20. package/lib/internal/template/collection-preferences/utils.d.ts.map +1 -1
  21. package/lib/internal/template/collection-preferences/utils.js +1 -15
  22. package/lib/internal/template/collection-preferences/utils.js.map +1 -1
  23. package/lib/internal/template/internal/base-component/styles.scoped.css +0 -14
  24. package/lib/internal/template/internal/environment.js +1 -1
  25. package/lib/internal/template/table/body-cell/styles.css.js +23 -28
  26. package/lib/internal/template/table/body-cell/styles.scoped.css +55 -111
  27. package/lib/internal/template/table/body-cell/styles.selectors.js +23 -28
  28. package/lib/internal/template/table/body-cell/td-element.d.ts +0 -3
  29. package/lib/internal/template/table/body-cell/td-element.d.ts.map +1 -1
  30. package/lib/internal/template/table/body-cell/td-element.js +2 -16
  31. package/lib/internal/template/table/body-cell/td-element.js.map +1 -1
  32. package/lib/internal/template/table/header-cell/index.d.ts +1 -4
  33. package/lib/internal/template/table/header-cell/index.d.ts.map +1 -1
  34. package/lib/internal/template/table/header-cell/index.js +2 -9
  35. package/lib/internal/template/table/header-cell/index.js.map +1 -1
  36. package/lib/internal/template/table/header-cell/styles.css.js +19 -24
  37. package/lib/internal/template/table/header-cell/styles.scoped.css +32 -67
  38. package/lib/internal/template/table/header-cell/styles.selectors.js +19 -24
  39. package/lib/internal/template/table/interfaces.d.ts +0 -14
  40. package/lib/internal/template/table/interfaces.d.ts.map +1 -1
  41. package/lib/internal/template/table/interfaces.js.map +1 -1
  42. package/lib/internal/template/table/internal.d.ts.map +1 -1
  43. package/lib/internal/template/table/internal.js +6 -19
  44. package/lib/internal/template/table/internal.js.map +1 -1
  45. package/lib/internal/template/table/thead.d.ts +0 -2
  46. package/lib/internal/template/table/thead.d.ts.map +1 -1
  47. package/lib/internal/template/table/thead.js +4 -12
  48. package/lib/internal/template/table/thead.js.map +1 -1
  49. package/lib/internal/template/table/use-sticky-columns.d.ts.map +1 -1
  50. package/lib/internal/template/table/use-sticky-columns.js +1 -5
  51. package/lib/internal/template/table/use-sticky-columns.js.map +1 -1
  52. package/lib/internal/template/table/utils.d.ts +0 -4
  53. package/lib/internal/template/table/utils.d.ts.map +1 -1
  54. package/lib/internal/template/table/utils.js +0 -8
  55. package/lib/internal/template/table/utils.js.map +1 -1
  56. package/lib/internal/template/test-utils/dom/collection-preferences/index.d.ts +0 -2
  57. package/lib/internal/template/test-utils/dom/collection-preferences/index.js +1 -6
  58. package/lib/internal/template/test-utils/dom/collection-preferences/index.js.map +1 -1
  59. package/lib/internal/template/test-utils/selectors/collection-preferences/index.d.ts +0 -2
  60. package/lib/internal/template/test-utils/selectors/collection-preferences/index.js +1 -6
  61. package/lib/internal/template/test-utils/selectors/collection-preferences/index.js.map +1 -1
  62. package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
  63. package/package.json +1 -1
  64. package/lib/internal/template/test-utils/dom/collection-preferences/sticky-columns-preference.d.ts +0 -9
  65. package/lib/internal/template/test-utils/dom/collection-preferences/sticky-columns-preference.js +0 -23
  66. package/lib/internal/template/test-utils/dom/collection-preferences/sticky-columns-preference.js.map +0 -1
  67. package/lib/internal/template/test-utils/selectors/collection-preferences/sticky-columns-preference.d.ts +0 -9
  68. package/lib/internal/template/test-utils/selectors/collection-preferences/sticky-columns-preference.js +0 -23
  69. package/lib/internal/template/test-utils/selectors/collection-preferences/sticky-columns-preference.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["collection-preferences/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface CollectionPreferencesProps<CustomPreferenceType = any> extends BaseComponentProps {\n /**\n * Specifies the title of the preferences modal dialog. It is also used as an `aria-label` for the trigger button.\n */\n title: string;\n /**\n * Label of the confirm button in the modal footer.\n */\n confirmLabel: string;\n /**\n * Label of the cancel button in the modal footer.\n */\n cancelLabel: string;\n /**\n * Determines whether the preferences trigger button is disabled.\n */\n disabled?: boolean;\n /**\n * Configures the built-in \"page size selection\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `options` - Specifies an array of options for page size selection. Each entry contains:\n * - `value` (number) - The value for the radio button (that is, the number of items per page).\n * - `label` (string) - A label for the radio button (for example, \"10 resources\").\n *\n * You must set the current value in the `preferences.pageSize` property.\n */\n pageSizePreference?: CollectionPreferencesProps.PageSizePreference;\n /**\n * Configures the built-in \"wrap lines\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.wrapLines` property.\n */\n wrapLinesPreference?: CollectionPreferencesProps.WrapLinesPreference;\n /**\n * Configures the built-in \"striped rows\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.stripedRows` property.\n */\n stripedRowsPreference?: CollectionPreferencesProps.StripedRowsPreference;\n /**\n * Configures the content density preference (Comfortable / Compact).\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.contentDensity` property.\n */\n contentDensityPreference?: CollectionPreferencesProps.ContentDensityPreference;\n /**\n * Configures the sticky columns preference.\n *\n * You can set it for both left and right columns.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for each radio group.\n * - `description` (string) - Specifies the text displayed below each radio group label.\n *\n * You must set the current value in the `preferences.stickyColumns` property.\n */\n stickyColumnsPreference?: CollectionPreferencesProps.StickyColumnsPreference;\n /**\n * Configures the built-in content display preference for order and visibility of columns in a table.\n *\n * Once set, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `description` (string) - Specifies the description displayed below the title.\n * - `liveAnnouncementDndStarted` ((position: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when an option is picked.\n * - `liveAnnouncementDndDiscarded` (string) - (Optional) Adds a message to be announced by screen readers when a reordering action is canceled.\n * - `liveAnnouncementDndItemReordered` ((initialPosition: number, currentPosition: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when an item is being moved.\n * - `liveAnnouncementDndItemCommitted` ((initialPosition: number, finalPosition: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when a reordering action is committed.\n * - `dragHandleAriaDescription` (string) - (Optional) Adds an ARIA description for the drag handle.\n * - `dragHandleAriaLabel` (string) - (Optional) Adds an ARIA label for the drag handle.\n * - `options` - Specifies an array of options for reordering and visible content selection.\n *\n * Each option contains the following:\n * - `id` (string) - Corresponds to a table column `id`.\n * - `label` (string) - Specifies a short description of the content.\n * - `alwaysVisible` (boolean) - (Optional) Determines whether the visibility is always on and therefore cannot be toggled. This is set to `false` by default.\n *\n * You must provide an ordered list of the items to display in the `preferences.contentDisplay` property.\n */\n contentDisplayPreference?: CollectionPreferencesProps.ContentDisplayPreference;\n /**\n * Configures the built-in \"visible content selection\" preference (for example, visible columns in a table).\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `options` - Specifies an array of groups of options for visible content selection.\n *\n * Each group of options contains the following:\n * - `label` (string) - The text to display as a title for the options group.\n * - `options` - Specifies an aray of options in the group. Each option contains the following:\n * - `id` (string) - Corresponds to a column `id` for tables or to a section `id` for cards.\n * - `label` (string) - Specifies a short description of the content.\n * - `editable` (boolean) - (Optional) Determines whether the user is able to toggle its visibility. This is `true` by default.\n *\n * You must set the current list of visible content `id`s in the `preferences.visibleContent` property.\n */\n visibleContentPreference?: CollectionPreferencesProps.VisibleContentPreference;\n /**\n * Specifies the current preference values. This includes both built-in and custom preferences.\n *\n * It contains the following:\n * - `pageSize` (number) - (Optional)\n * - `wrapLines` (boolean) - (Optional)\n * - `contentDisplay` (ReadonlyArray<ContentDisplayItem>) - (Optional) Specifies the list of content and their visibility. The order of the elements influences the display.\n * - `visibleContent` (ReadonlyArray<string>) - Specifies the list of visible content `id`s. The order of the `id`s does not influence the display. If the `contentDisplay` property is set, this property is ignored.\n * - `custom` (CustomPreferenceType) - Specifies the value for your custom preference.\n */\n preferences?: CollectionPreferencesProps.Preferences<CustomPreferenceType>;\n /**\n * Configures custom preferences. The function receives two parameters:\n *\n * - `customValue` (CustomPreferenceType) - Current value for your custom preference. It is initialized using the value you provide in `preferences.custom`.\n * - `setCustomValue` - A function that is called to notify a state update.\n *\n * It should return the content of your custom preference, for example:\n * ```\n * (customValue, setCustomValue) => (\n * <Checkbox checked={customValue} onChange={({ detail }) => setCustomValue(detail.checked)} />\n * )\n * ```\n *\n * When the user confirms the changes, the new value is passed in the `detail.custom` property of the `onConfirm` listener.\n * When the user cancels the changes, the `customValue` is reset to the one present in `preferences.custom` property.\n *\n * **Display**\n * - If any of the built-in preferences (`pageSizePreference`, `wrapLinesPreference`, or `visibleContentPreference`) are displayed,\n * the custom content is displayed at the bottom of the left column within the modal.\n * - If no built-in preference is displayed, the custom content occupies the whole modal.\n */\n customPreference?: (\n customValue: CustomPreferenceType,\n setCustomValue: React.Dispatch<CustomPreferenceType>\n ) => React.ReactNode;\n /**\n * Called when the user cancels a preference change using the cancel button in the modal footer or by dismissing the modal.\n */\n onCancel?: NonCancelableEventHandler;\n /**\n * Called when the user confirms a preference change using the confirm button in the modal footer.\n *\n * The event `detail` contains the following:\n * - `pageSize` (number) - (Optional) The selected page size value. Available only if you specify the `pageSizePreference` property.\n * - `wrapLines` (boolean) - (Optional) The current line wrapping preference value. Available only if you specify the `wrapLinesPreference` property.\n * - `visibleContent` (ReadonlyArray<string>) - (Optional) The list of selected content `id`s. Available only if you specify the `visibleContentPreference` property.\n * - `custom` (CustomPreferenceType) - (Optional) The selected value for your custom preference.\n *\n * The values for all configured preferences are present even if the user didn't change their values.\n */\n onConfirm?: NonCancelableEventHandler<CollectionPreferencesProps.Preferences<CustomPreferenceType>>;\n}\n\nexport namespace CollectionPreferencesProps {\n export interface Preferences<CustomPreferenceType = any> {\n pageSize?: number;\n wrapLines?: boolean;\n stripedRows?: boolean;\n contentDensity?: 'comfortable' | 'compact';\n visibleContent?: ReadonlyArray<string>;\n stickyColumns?: StickyColumns;\n contentDisplay?: ReadonlyArray<ContentDisplayItem>;\n custom?: CustomPreferenceType;\n }\n\n export interface ContentDisplayPreference {\n title: string;\n description?: string;\n options: ReadonlyArray<CollectionPreferencesProps.ContentDisplayOption>;\n liveAnnouncementDndStarted?: (position: number, total: number) => string;\n liveAnnouncementDndItemReordered?: (initialPosition: number, currentPosition: number, total: number) => string;\n liveAnnouncementDndItemCommitted?: (initialPosition: number, finalPosition: number, total: number) => string;\n liveAnnouncementDndDiscarded?: string;\n dragHandleAriaLabel?: string;\n dragHandleAriaDescription?: string;\n }\n\n export interface ContentDisplayOption {\n id: string;\n label: string;\n alwaysVisible?: boolean;\n }\n\n export interface ContentDisplayItem {\n id: string;\n visible: boolean;\n }\n\n export interface VisibleContentPreference {\n title: string;\n options: ReadonlyArray<CollectionPreferencesProps.VisibleContentOptionsGroup>;\n }\n\n export interface VisibleContentOptionsGroup {\n label: string;\n options: ReadonlyArray<CollectionPreferencesProps.VisibleContentOption>;\n }\n\n export interface VisibleContentOption {\n id: string;\n label: string;\n editable?: boolean;\n }\n\n export interface PageSizePreference {\n title: string;\n options: ReadonlyArray<PageSizeOption>;\n }\n\n export interface PageSizeOption {\n value: number;\n label: string;\n }\n\n export interface WrapLinesPreference {\n label: string;\n description: string;\n }\n\n export interface StripedRowsPreference {\n label: string;\n description: string;\n }\n\n export interface ContentDensityPreference {\n label: string;\n description: string;\n }\n\n interface StickyColumns {\n first?: number;\n last?: number;\n }\n\n interface StickyColumnPreference {\n title: string;\n description: string;\n options: ReadonlyArray<{\n label: string;\n value: number;\n }>;\n }\n export interface StickyColumnsPreference {\n firstColumns?: StickyColumnPreference;\n lastColumns?: StickyColumnPreference;\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["collection-preferences/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface CollectionPreferencesProps<CustomPreferenceType = any> extends BaseComponentProps {\n /**\n * Specifies the title of the preferences modal dialog. It is also used as an `aria-label` for the trigger button.\n */\n title: string;\n /**\n * Label of the confirm button in the modal footer.\n */\n confirmLabel: string;\n /**\n * Label of the cancel button in the modal footer.\n */\n cancelLabel: string;\n /**\n * Determines whether the preferences trigger button is disabled.\n */\n disabled?: boolean;\n /**\n * Configures the built-in \"page size selection\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `options` - Specifies an array of options for page size selection. Each entry contains:\n * - `value` (number) - The value for the radio button (that is, the number of items per page).\n * - `label` (string) - A label for the radio button (for example, \"10 resources\").\n *\n * You must set the current value in the `preferences.pageSize` property.\n */\n pageSizePreference?: CollectionPreferencesProps.PageSizePreference;\n /**\n * Configures the built-in \"wrap lines\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.wrapLines` property.\n */\n wrapLinesPreference?: CollectionPreferencesProps.WrapLinesPreference;\n /**\n * Configures the built-in \"striped rows\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.stripedRows` property.\n */\n stripedRowsPreference?: CollectionPreferencesProps.StripedRowsPreference;\n /**\n * Configures the content density preference (Comfortable / Compact).\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.contentDensity` property.\n */\n contentDensityPreference?: CollectionPreferencesProps.ContentDensityPreference;\n /**\n * Configures the built-in content display preference for order and visibility of columns in a table.\n *\n * Once set, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `description` (string) - Specifies the description displayed below the title.\n * - `liveAnnouncementDndStarted` ((position: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when an option is picked.\n * - `liveAnnouncementDndDiscarded` (string) - (Optional) Adds a message to be announced by screen readers when a reordering action is canceled.\n * - `liveAnnouncementDndItemReordered` ((initialPosition: number, currentPosition: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when an item is being moved.\n * - `liveAnnouncementDndItemCommitted` ((initialPosition: number, finalPosition: number, total: number) => string) - (Optional) Adds a message to be announced by screen readers when a reordering action is committed.\n * - `dragHandleAriaDescription` (string) - (Optional) Adds an ARIA description for the drag handle.\n * - `dragHandleAriaLabel` (string) - (Optional) Adds an ARIA label for the drag handle.\n * - `options` - Specifies an array of options for reordering and visible content selection.\n *\n * Each option contains the following:\n * - `id` (string) - Corresponds to a table column `id`.\n * - `label` (string) - Specifies a short description of the content.\n * - `alwaysVisible` (boolean) - (Optional) Determines whether the visibility is always on and therefore cannot be toggled. This is set to `false` by default.\n *\n * You must provide an ordered list of the items to display in the `preferences.contentDisplay` property.\n */\n contentDisplayPreference?: CollectionPreferencesProps.ContentDisplayPreference;\n /**\n * Configures the built-in \"visible content selection\" preference (for example, visible columns in a table).\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `options` - Specifies an array of groups of options for visible content selection.\n *\n * Each group of options contains the following:\n * - `label` (string) - The text to display as a title for the options group.\n * - `options` - Specifies an aray of options in the group. Each option contains the following:\n * - `id` (string) - Corresponds to a column `id` for tables or to a section `id` for cards.\n * - `label` (string) - Specifies a short description of the content.\n * - `editable` (boolean) - (Optional) Determines whether the user is able to toggle its visibility. This is `true` by default.\n *\n * You must set the current list of visible content `id`s in the `preferences.visibleContent` property.\n */\n visibleContentPreference?: CollectionPreferencesProps.VisibleContentPreference;\n /**\n * Specifies the current preference values. This includes both built-in and custom preferences.\n *\n * It contains the following:\n * - `pageSize` (number) - (Optional)\n * - `wrapLines` (boolean) - (Optional)\n * - `contentDisplay` (ReadonlyArray<ContentDisplayItem>) - (Optional) Specifies the list of content and their visibility. The order of the elements influences the display.\n * - `visibleContent` (ReadonlyArray<string>) - Specifies the list of visible content `id`s. The order of the `id`s does not influence the display. If the `contentDisplay` property is set, this property is ignored.\n * - `custom` (CustomPreferenceType) - Specifies the value for your custom preference.\n */\n preferences?: CollectionPreferencesProps.Preferences<CustomPreferenceType>;\n /**\n * Configures custom preferences. The function receives two parameters:\n *\n * - `customValue` (CustomPreferenceType) - Current value for your custom preference. It is initialized using the value you provide in `preferences.custom`.\n * - `setCustomValue` - A function that is called to notify a state update.\n *\n * It should return the content of your custom preference, for example:\n * ```\n * (customValue, setCustomValue) => (\n * <Checkbox checked={customValue} onChange={({ detail }) => setCustomValue(detail.checked)} />\n * )\n * ```\n *\n * When the user confirms the changes, the new value is passed in the `detail.custom` property of the `onConfirm` listener.\n * When the user cancels the changes, the `customValue` is reset to the one present in `preferences.custom` property.\n *\n * **Display**\n * - If any of the built-in preferences (`pageSizePreference`, `wrapLinesPreference`, or `visibleContentPreference`) are displayed,\n * the custom content is displayed at the bottom of the left column within the modal.\n * - If no built-in preference is displayed, the custom content occupies the whole modal.\n */\n customPreference?: (\n customValue: CustomPreferenceType,\n setCustomValue: React.Dispatch<CustomPreferenceType>\n ) => React.ReactNode;\n /**\n * Called when the user cancels a preference change using the cancel button in the modal footer or by dismissing the modal.\n */\n onCancel?: NonCancelableEventHandler;\n /**\n * Called when the user confirms a preference change using the confirm button in the modal footer.\n *\n * The event `detail` contains the following:\n * - `pageSize` (number) - (Optional) The selected page size value. Available only if you specify the `pageSizePreference` property.\n * - `wrapLines` (boolean) - (Optional) The current line wrapping preference value. Available only if you specify the `wrapLinesPreference` property.\n * - `visibleContent` (ReadonlyArray<string>) - (Optional) The list of selected content `id`s. Available only if you specify the `visibleContentPreference` property.\n * - `custom` (CustomPreferenceType) - (Optional) The selected value for your custom preference.\n *\n * The values for all configured preferences are present even if the user didn't change their values.\n */\n onConfirm?: NonCancelableEventHandler<CollectionPreferencesProps.Preferences<CustomPreferenceType>>;\n}\n\nexport namespace CollectionPreferencesProps {\n export interface Preferences<CustomPreferenceType = any> {\n pageSize?: number;\n wrapLines?: boolean;\n stripedRows?: boolean;\n contentDensity?: 'comfortable' | 'compact';\n visibleContent?: ReadonlyArray<string>;\n contentDisplay?: ReadonlyArray<ContentDisplayItem>;\n custom?: CustomPreferenceType;\n }\n\n export interface ContentDisplayPreference {\n title: string;\n description?: string;\n options: ReadonlyArray<CollectionPreferencesProps.ContentDisplayOption>;\n liveAnnouncementDndStarted?: (position: number, total: number) => string;\n liveAnnouncementDndItemReordered?: (initialPosition: number, currentPosition: number, total: number) => string;\n liveAnnouncementDndItemCommitted?: (initialPosition: number, finalPosition: number, total: number) => string;\n liveAnnouncementDndDiscarded?: string;\n dragHandleAriaLabel?: string;\n dragHandleAriaDescription?: string;\n }\n\n export interface ContentDisplayOption {\n id: string;\n label: string;\n alwaysVisible?: boolean;\n }\n\n export interface ContentDisplayItem {\n id: string;\n visible: boolean;\n }\n\n export interface VisibleContentPreference {\n title: string;\n options: ReadonlyArray<CollectionPreferencesProps.VisibleContentOptionsGroup>;\n }\n\n export interface VisibleContentOptionsGroup {\n label: string;\n options: ReadonlyArray<CollectionPreferencesProps.VisibleContentOption>;\n }\n\n export interface VisibleContentOption {\n id: string;\n label: string;\n editable?: boolean;\n }\n\n export interface PageSizePreference {\n title: string;\n options: ReadonlyArray<PageSizeOption>;\n }\n\n export interface PageSizeOption {\n value: number;\n label: string;\n }\n\n export interface WrapLinesPreference {\n label: string;\n description: string;\n }\n\n export interface StripedRowsPreference {\n label: string;\n description: string;\n }\n\n export interface ContentDensityPreference {\n label: string;\n description: string;\n }\n}\n"]}
@@ -1,42 +1,37 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "visible-content": "awsui_visible-content_tc96w_1mfx0_185",
5
- "visible-content-toggle": "awsui_visible-content-toggle_tc96w_1mfx0_186",
6
- "visible-content-groups": "awsui_visible-content-groups_tc96w_1mfx0_187",
7
- "visible-content-group": "awsui_visible-content-group_tc96w_1mfx0_187",
8
- "visible-content-title": "awsui_visible-content-title_tc96w_1mfx0_192",
9
- "visible-content-group-label": "awsui_visible-content-group-label_tc96w_1mfx0_201",
10
- "visible-content-option": "awsui_visible-content-option_tc96w_1mfx0_207",
11
- "visible-content-option-label": "awsui_visible-content-option-label_tc96w_1mfx0_218",
12
- "content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_1mfx0_409",
13
- "content-display-option-content": "awsui_content-display-option-content_tc96w_1mfx0_413",
14
- "content-display-option": "awsui_content-display-option_tc96w_1mfx0_409",
15
- "placeholder": "awsui_placeholder_tc96w_1mfx0_436",
16
- "sorting": "awsui_sorting_tc96w_1mfx0_436",
17
- "content-display-option-label": "awsui_content-display-option-label_tc96w_1mfx0_463",
18
- "drag-overlay": "awsui_drag-overlay_tc96w_1mfx0_471",
19
- "content-display": "awsui_content-display_tc96w_1mfx0_409",
20
- "content-display-title": "awsui_content-display-title_tc96w_1mfx0_498",
21
- "content-display-description": "awsui_content-display-description_tc96w_1mfx0_506",
22
- "content-display-option-list": "awsui_content-display-option-list_tc96w_1mfx0_514",
23
- "root": "awsui_root_tc96w_1mfx0_520",
24
- "modal-root": "awsui_modal-root_tc96w_1mfx0_521",
25
- "trigger-button": "awsui_trigger-button_tc96w_1mfx0_522",
26
- "cancel-button": "awsui_cancel-button_tc96w_1mfx0_523",
27
- "confirm-button": "awsui_confirm-button_tc96w_1mfx0_524",
28
- "custom": "awsui_custom_tc96w_1mfx0_525",
29
- "second-column-small": "awsui_second-column-small_tc96w_1mfx0_529",
30
- "wrap-lines": "awsui_wrap-lines_tc96w_1mfx0_533",
31
- "striped-rows": "awsui_striped-rows_tc96w_1mfx0_534",
32
- "content-density": "awsui_content-density_tc96w_1mfx0_535",
33
- "page-size": "awsui_page-size_tc96w_1mfx0_536",
34
- "page-size-form-field": "awsui_page-size-form-field_tc96w_1mfx0_537",
35
- "page-size-radio-group": "awsui_page-size-radio-group_tc96w_1mfx0_538",
36
- "sticky-columns": "awsui_sticky-columns_tc96w_1mfx0_539",
37
- "sticky-columns-form-field": "awsui_sticky-columns-form-field_tc96w_1mfx0_540",
38
- "sticky-columns-radio-group": "awsui_sticky-columns-radio-group_tc96w_1mfx0_541",
39
- "sticky-columns-first": "awsui_sticky-columns-first_tc96w_1mfx0_542",
40
- "sticky-columns-last": "awsui_sticky-columns-last_tc96w_1mfx0_543"
4
+ "visible-content": "awsui_visible-content_tc96w_p0ipj_185",
5
+ "visible-content-toggle": "awsui_visible-content-toggle_tc96w_p0ipj_186",
6
+ "visible-content-groups": "awsui_visible-content-groups_tc96w_p0ipj_187",
7
+ "visible-content-group": "awsui_visible-content-group_tc96w_p0ipj_187",
8
+ "visible-content-title": "awsui_visible-content-title_tc96w_p0ipj_192",
9
+ "visible-content-group-label": "awsui_visible-content-group-label_tc96w_p0ipj_201",
10
+ "visible-content-option": "awsui_visible-content-option_tc96w_p0ipj_207",
11
+ "visible-content-option-label": "awsui_visible-content-option-label_tc96w_p0ipj_218",
12
+ "content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_p0ipj_409",
13
+ "content-display-option-content": "awsui_content-display-option-content_tc96w_p0ipj_413",
14
+ "content-display-option": "awsui_content-display-option_tc96w_p0ipj_409",
15
+ "placeholder": "awsui_placeholder_tc96w_p0ipj_436",
16
+ "sorting": "awsui_sorting_tc96w_p0ipj_436",
17
+ "content-display-option-label": "awsui_content-display-option-label_tc96w_p0ipj_464",
18
+ "drag-overlay": "awsui_drag-overlay_tc96w_p0ipj_472",
19
+ "content-display": "awsui_content-display_tc96w_p0ipj_409",
20
+ "content-display-title": "awsui_content-display-title_tc96w_p0ipj_499",
21
+ "content-display-description": "awsui_content-display-description_tc96w_p0ipj_507",
22
+ "content-display-option-list": "awsui_content-display-option-list_tc96w_p0ipj_515",
23
+ "root": "awsui_root_tc96w_p0ipj_521",
24
+ "modal-root": "awsui_modal-root_tc96w_p0ipj_522",
25
+ "trigger-button": "awsui_trigger-button_tc96w_p0ipj_523",
26
+ "cancel-button": "awsui_cancel-button_tc96w_p0ipj_524",
27
+ "confirm-button": "awsui_confirm-button_tc96w_p0ipj_525",
28
+ "custom": "awsui_custom_tc96w_p0ipj_526",
29
+ "second-column-small": "awsui_second-column-small_tc96w_p0ipj_530",
30
+ "wrap-lines": "awsui_wrap-lines_tc96w_p0ipj_534",
31
+ "striped-rows": "awsui_striped-rows_tc96w_p0ipj_535",
32
+ "content-density": "awsui_content-density_tc96w_p0ipj_536",
33
+ "page-size": "awsui_page-size_tc96w_p0ipj_537",
34
+ "page-size-form-field": "awsui_page-size-form-field_tc96w_p0ipj_538",
35
+ "page-size-radio-group": "awsui_page-size-radio-group_tc96w_p0ipj_539"
41
36
  };
42
37
 
@@ -182,14 +182,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
182
182
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
183
183
  SPDX-License-Identifier: Apache-2.0
184
184
  */
185
- .awsui_visible-content_tc96w_1mfx0_185:not(#\9),
186
- .awsui_visible-content-toggle_tc96w_1mfx0_186:not(#\9),
187
- .awsui_visible-content-groups_tc96w_1mfx0_187:not(#\9),
188
- .awsui_visible-content-group_tc96w_1mfx0_187:not(#\9) {
185
+ .awsui_visible-content_tc96w_p0ipj_185:not(#\9),
186
+ .awsui_visible-content-toggle_tc96w_p0ipj_186:not(#\9),
187
+ .awsui_visible-content-groups_tc96w_p0ipj_187:not(#\9),
188
+ .awsui_visible-content-group_tc96w_p0ipj_187:not(#\9) {
189
189
  /* used in test-utils */
190
190
  }
191
191
 
192
- .awsui_visible-content-title_tc96w_1mfx0_192:not(#\9) {
192
+ .awsui_visible-content-title_tc96w_p0ipj_192:not(#\9) {
193
193
  font-size: var(--font-body-m-size-sregvd, 14px);
194
194
  line-height: var(--font-body-m-line-height-i7xxvv, 22px);
195
195
  font-weight: var(--font-display-label-weight-tjy9e4, 400);
@@ -198,24 +198,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
198
198
  margin-bottom: var(--space-scaled-l-t03y3z, 20px);
199
199
  }
200
200
 
201
- .awsui_visible-content-group-label_tc96w_1mfx0_201:not(#\9) {
201
+ .awsui_visible-content-group-label_tc96w_p0ipj_201:not(#\9) {
202
202
  color: var(--color-text-group-label-5rxtyp, #545b64);
203
203
  padding-bottom: var(--space-xs-rsr2qu, 8px);
204
204
  border-bottom: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-divider-default-k96bks, #eaeded);
205
205
  }
206
206
 
207
- .awsui_visible-content-option_tc96w_1mfx0_207:not(#\9) {
207
+ .awsui_visible-content-option_tc96w_p0ipj_207:not(#\9) {
208
208
  display: flex;
209
209
  flex-wrap: nowrap;
210
210
  justify-content: space-between;
211
211
  padding: var(--space-xs-rsr2qu, 8px) 0px var(--space-xs-rsr2qu, 8px) var(--space-scaled-l-t03y3z, 20px);
212
212
  border-bottom: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-divider-default-k96bks, #eaeded);
213
213
  }
214
- .awsui_visible-content-option_tc96w_1mfx0_207:not(#\9):last-child {
214
+ .awsui_visible-content-option_tc96w_p0ipj_207:not(#\9):last-child {
215
215
  border-bottom: none;
216
216
  }
217
217
 
218
- .awsui_visible-content-option-label_tc96w_1mfx0_218:not(#\9) {
218
+ .awsui_visible-content-option-label_tc96w_p0ipj_218:not(#\9) {
219
219
  overflow: hidden;
220
220
  text-overflow: ellipsis;
221
221
  padding-right: var(--space-l-4vl6xu, 20px);
@@ -406,11 +406,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
406
406
  Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
407
407
  SPDX-License-Identifier: Apache-2.0
408
408
  */
409
- .awsui_content-display-option-toggle_tc96w_1mfx0_409:not(#\9) {
409
+ .awsui_content-display-option-toggle_tc96w_p0ipj_409:not(#\9) {
410
410
  /* used in test-utils */
411
411
  }
412
412
 
413
- .awsui_content-display-option-content_tc96w_1mfx0_413:not(#\9) {
413
+ .awsui_content-display-option-content_tc96w_p0ipj_413:not(#\9) {
414
414
  /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
415
415
  border-collapse: separate;
416
416
  border-spacing: 0;
@@ -454,28 +454,29 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
454
454
  border-radius: var(--border-radius-item-wjpc1f, 0px);
455
455
  }
456
456
 
457
- .awsui_content-display-option_tc96w_1mfx0_409:not(#\9) {
457
+ .awsui_content-display-option_tc96w_p0ipj_409:not(#\9) {
458
458
  list-style: none;
459
459
  position: relative;
460
460
  border-top: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-divider-default-k96bks, #eaeded);
461
461
  }
462
- .awsui_content-display-option_tc96w_1mfx0_409:not(#\9):not(.awsui_placeholder_tc96w_1mfx0_436).awsui_sorting_tc96w_1mfx0_436 {
462
+ .awsui_content-display-option_tc96w_p0ipj_409:not(#\9):not(.awsui_placeholder_tc96w_p0ipj_436).awsui_sorting_tc96w_p0ipj_436 {
463
463
  transition: transform var(--motion-duration-transition-quick-x85tae, 90ms) var(--motion-easing-transition-quick-lukbd8, linear);
464
+ z-index: 1;
464
465
  }
465
466
  @media (prefers-reduced-motion: reduce) {
466
- .awsui_content-display-option_tc96w_1mfx0_409:not(#\9):not(.awsui_placeholder_tc96w_1mfx0_436).awsui_sorting_tc96w_1mfx0_436 {
467
+ .awsui_content-display-option_tc96w_p0ipj_409:not(#\9):not(.awsui_placeholder_tc96w_p0ipj_436).awsui_sorting_tc96w_p0ipj_436 {
467
468
  animation: none;
468
469
  transition: none;
469
470
  }
470
471
  }
471
- .awsui-motion-disabled .awsui_content-display-option_tc96w_1mfx0_409:not(#\9):not(.awsui_placeholder_tc96w_1mfx0_436).awsui_sorting_tc96w_1mfx0_436, .awsui-mode-entering .awsui_content-display-option_tc96w_1mfx0_409:not(#\9):not(.awsui_placeholder_tc96w_1mfx0_436).awsui_sorting_tc96w_1mfx0_436 {
472
+ .awsui-motion-disabled .awsui_content-display-option_tc96w_p0ipj_409:not(#\9):not(.awsui_placeholder_tc96w_p0ipj_436).awsui_sorting_tc96w_p0ipj_436, .awsui-mode-entering .awsui_content-display-option_tc96w_p0ipj_409:not(#\9):not(.awsui_placeholder_tc96w_p0ipj_436).awsui_sorting_tc96w_p0ipj_436 {
472
473
  animation: none;
473
474
  transition: none;
474
475
  }
475
- .awsui_content-display-option_tc96w_1mfx0_409.awsui_placeholder_tc96w_1mfx0_436 > .awsui_content-display-option-content_tc96w_1mfx0_413:not(#\9) {
476
+ .awsui_content-display-option_tc96w_p0ipj_409.awsui_placeholder_tc96w_p0ipj_436 > .awsui_content-display-option-content_tc96w_p0ipj_413:not(#\9) {
476
477
  position: relative;
477
478
  }
478
- .awsui_content-display-option_tc96w_1mfx0_409.awsui_placeholder_tc96w_1mfx0_436 > .awsui_content-display-option-content_tc96w_1mfx0_413:not(#\9):after {
479
+ .awsui_content-display-option_tc96w_p0ipj_409.awsui_placeholder_tc96w_p0ipj_436 > .awsui_content-display-option-content_tc96w_p0ipj_413:not(#\9):after {
479
480
  content: " ";
480
481
  position: absolute;
481
482
  top: 0;
@@ -486,7 +487,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
486
487
  border-radius: var(--border-radius-item-wjpc1f, 0px);
487
488
  }
488
489
 
489
- .awsui_content-display-option-label_tc96w_1mfx0_463:not(#\9) {
490
+ .awsui_content-display-option-label_tc96w_p0ipj_464:not(#\9) {
490
491
  flex-grow: 1;
491
492
  min-width: 0;
492
493
  -ms-word-break: break-all;
@@ -494,18 +495,18 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
494
495
  padding-right: var(--space-l-4vl6xu, 20px);
495
496
  }
496
497
 
497
- .awsui_drag-overlay_tc96w_1mfx0_471:not(#\9) {
498
+ .awsui_drag-overlay_tc96w_p0ipj_472:not(#\9) {
498
499
  box-shadow: var(--shadow-container-active-h4jsj2, 0px 4px 8px rgba(0, 28, 36, 0.45));
499
500
  border-radius: var(--border-radius-item-wjpc1f, 0px);
500
501
  }
501
- body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1mfx0_471:not(#\9) {
502
+ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_p0ipj_472:not(#\9) {
502
503
  position: relative;
503
504
  }
504
- body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1mfx0_471:not(#\9) {
505
+ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_p0ipj_472:not(#\9) {
505
506
  outline: 2px dotted transparent;
506
507
  outline-offset: calc(0px - 1px);
507
508
  }
508
- body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1mfx0_471:not(#\9)::before {
509
+ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_p0ipj_472:not(#\9)::before {
509
510
  content: " ";
510
511
  display: block;
511
512
  position: absolute;
@@ -517,11 +518,11 @@ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1mfx0_471:not(#\9)
517
518
  box-shadow: 0 0 0 2px var(--color-border-item-focused-n5kd8g, #0073bb);
518
519
  }
519
520
 
520
- .awsui_content-display_tc96w_1mfx0_409:not(#\9) {
521
+ .awsui_content-display_tc96w_p0ipj_409:not(#\9) {
521
522
  /* used in test-utils */
522
523
  }
523
524
 
524
- .awsui_content-display-title_tc96w_1mfx0_498:not(#\9) {
525
+ .awsui_content-display-title_tc96w_p0ipj_499:not(#\9) {
525
526
  font-size: var(--font-body-m-size-sregvd, 14px);
526
527
  line-height: var(--font-body-m-line-height-i7xxvv, 22px);
527
528
  font-weight: var(--font-display-label-weight-tjy9e4, 400);
@@ -529,7 +530,7 @@ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1mfx0_471:not(#\9)
529
530
  margin: 0;
530
531
  }
531
532
 
532
- .awsui_content-display-description_tc96w_1mfx0_506:not(#\9) {
533
+ .awsui_content-display-description_tc96w_p0ipj_507:not(#\9) {
533
534
  color: var(--color-text-form-secondary-1c3szk, #687078);
534
535
  font-size: var(--font-body-s-size-ukw2p9, 12px);
535
536
  line-height: var(--font-body-s-line-height-kdsbrl, 16px);
@@ -537,35 +538,30 @@ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1mfx0_471:not(#\9)
537
538
  margin-top: var(--space-scaled-xxxs-lo883m, 2px);
538
539
  }
539
540
 
540
- .awsui_content-display-option-list_tc96w_1mfx0_514:not(#\9) {
541
+ .awsui_content-display-option-list_tc96w_p0ipj_515:not(#\9) {
541
542
  position: relative;
542
543
  list-style: none;
543
544
  padding: 0;
544
545
  }
545
546
 
546
- .awsui_root_tc96w_1mfx0_520:not(#\9),
547
- .awsui_modal-root_tc96w_1mfx0_521:not(#\9),
548
- .awsui_trigger-button_tc96w_1mfx0_522:not(#\9),
549
- .awsui_cancel-button_tc96w_1mfx0_523:not(#\9),
550
- .awsui_confirm-button_tc96w_1mfx0_524:not(#\9),
551
- .awsui_custom_tc96w_1mfx0_525:not(#\9) {
547
+ .awsui_root_tc96w_p0ipj_521:not(#\9),
548
+ .awsui_modal-root_tc96w_p0ipj_522:not(#\9),
549
+ .awsui_trigger-button_tc96w_p0ipj_523:not(#\9),
550
+ .awsui_cancel-button_tc96w_p0ipj_524:not(#\9),
551
+ .awsui_confirm-button_tc96w_p0ipj_525:not(#\9),
552
+ .awsui_custom_tc96w_p0ipj_526:not(#\9) {
552
553
  /* used in test-utils */
553
554
  }
554
555
 
555
- .awsui_second-column-small_tc96w_1mfx0_529:not(#\9) {
556
+ .awsui_second-column-small_tc96w_p0ipj_530:not(#\9) {
556
557
  padding-top: calc(2 * var(--space-scaled-l-t03y3z, 20px));
557
558
  }
558
559
 
559
- .awsui_wrap-lines_tc96w_1mfx0_533:not(#\9),
560
- .awsui_striped-rows_tc96w_1mfx0_534:not(#\9),
561
- .awsui_content-density_tc96w_1mfx0_535:not(#\9),
562
- .awsui_page-size_tc96w_1mfx0_536:not(#\9),
563
- .awsui_page-size-form-field_tc96w_1mfx0_537:not(#\9),
564
- .awsui_page-size-radio-group_tc96w_1mfx0_538:not(#\9),
565
- .awsui_sticky-columns_tc96w_1mfx0_539:not(#\9),
566
- .awsui_sticky-columns-form-field_tc96w_1mfx0_540:not(#\9),
567
- .awsui_sticky-columns-radio-group_tc96w_1mfx0_541:not(#\9),
568
- .awsui_sticky-columns-first_tc96w_1mfx0_542:not(#\9),
569
- .awsui_sticky-columns-last_tc96w_1mfx0_543:not(#\9) {
560
+ .awsui_wrap-lines_tc96w_p0ipj_534:not(#\9),
561
+ .awsui_striped-rows_tc96w_p0ipj_535:not(#\9),
562
+ .awsui_content-density_tc96w_p0ipj_536:not(#\9),
563
+ .awsui_page-size_tc96w_p0ipj_537:not(#\9),
564
+ .awsui_page-size-form-field_tc96w_p0ipj_538:not(#\9),
565
+ .awsui_page-size-radio-group_tc96w_p0ipj_539:not(#\9) {
570
566
  /* used in test-utils */
571
567
  }
@@ -2,42 +2,37 @@
2
2
  // es-module interop with Babel and Typescript
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  module.exports.default = {
5
- "visible-content": "awsui_visible-content_tc96w_1mfx0_185",
6
- "visible-content-toggle": "awsui_visible-content-toggle_tc96w_1mfx0_186",
7
- "visible-content-groups": "awsui_visible-content-groups_tc96w_1mfx0_187",
8
- "visible-content-group": "awsui_visible-content-group_tc96w_1mfx0_187",
9
- "visible-content-title": "awsui_visible-content-title_tc96w_1mfx0_192",
10
- "visible-content-group-label": "awsui_visible-content-group-label_tc96w_1mfx0_201",
11
- "visible-content-option": "awsui_visible-content-option_tc96w_1mfx0_207",
12
- "visible-content-option-label": "awsui_visible-content-option-label_tc96w_1mfx0_218",
13
- "content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_1mfx0_409",
14
- "content-display-option-content": "awsui_content-display-option-content_tc96w_1mfx0_413",
15
- "content-display-option": "awsui_content-display-option_tc96w_1mfx0_409",
16
- "placeholder": "awsui_placeholder_tc96w_1mfx0_436",
17
- "sorting": "awsui_sorting_tc96w_1mfx0_436",
18
- "content-display-option-label": "awsui_content-display-option-label_tc96w_1mfx0_463",
19
- "drag-overlay": "awsui_drag-overlay_tc96w_1mfx0_471",
20
- "content-display": "awsui_content-display_tc96w_1mfx0_409",
21
- "content-display-title": "awsui_content-display-title_tc96w_1mfx0_498",
22
- "content-display-description": "awsui_content-display-description_tc96w_1mfx0_506",
23
- "content-display-option-list": "awsui_content-display-option-list_tc96w_1mfx0_514",
24
- "root": "awsui_root_tc96w_1mfx0_520",
25
- "modal-root": "awsui_modal-root_tc96w_1mfx0_521",
26
- "trigger-button": "awsui_trigger-button_tc96w_1mfx0_522",
27
- "cancel-button": "awsui_cancel-button_tc96w_1mfx0_523",
28
- "confirm-button": "awsui_confirm-button_tc96w_1mfx0_524",
29
- "custom": "awsui_custom_tc96w_1mfx0_525",
30
- "second-column-small": "awsui_second-column-small_tc96w_1mfx0_529",
31
- "wrap-lines": "awsui_wrap-lines_tc96w_1mfx0_533",
32
- "striped-rows": "awsui_striped-rows_tc96w_1mfx0_534",
33
- "content-density": "awsui_content-density_tc96w_1mfx0_535",
34
- "page-size": "awsui_page-size_tc96w_1mfx0_536",
35
- "page-size-form-field": "awsui_page-size-form-field_tc96w_1mfx0_537",
36
- "page-size-radio-group": "awsui_page-size-radio-group_tc96w_1mfx0_538",
37
- "sticky-columns": "awsui_sticky-columns_tc96w_1mfx0_539",
38
- "sticky-columns-form-field": "awsui_sticky-columns-form-field_tc96w_1mfx0_540",
39
- "sticky-columns-radio-group": "awsui_sticky-columns-radio-group_tc96w_1mfx0_541",
40
- "sticky-columns-first": "awsui_sticky-columns-first_tc96w_1mfx0_542",
41
- "sticky-columns-last": "awsui_sticky-columns-last_tc96w_1mfx0_543"
5
+ "visible-content": "awsui_visible-content_tc96w_p0ipj_185",
6
+ "visible-content-toggle": "awsui_visible-content-toggle_tc96w_p0ipj_186",
7
+ "visible-content-groups": "awsui_visible-content-groups_tc96w_p0ipj_187",
8
+ "visible-content-group": "awsui_visible-content-group_tc96w_p0ipj_187",
9
+ "visible-content-title": "awsui_visible-content-title_tc96w_p0ipj_192",
10
+ "visible-content-group-label": "awsui_visible-content-group-label_tc96w_p0ipj_201",
11
+ "visible-content-option": "awsui_visible-content-option_tc96w_p0ipj_207",
12
+ "visible-content-option-label": "awsui_visible-content-option-label_tc96w_p0ipj_218",
13
+ "content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_p0ipj_409",
14
+ "content-display-option-content": "awsui_content-display-option-content_tc96w_p0ipj_413",
15
+ "content-display-option": "awsui_content-display-option_tc96w_p0ipj_409",
16
+ "placeholder": "awsui_placeholder_tc96w_p0ipj_436",
17
+ "sorting": "awsui_sorting_tc96w_p0ipj_436",
18
+ "content-display-option-label": "awsui_content-display-option-label_tc96w_p0ipj_464",
19
+ "drag-overlay": "awsui_drag-overlay_tc96w_p0ipj_472",
20
+ "content-display": "awsui_content-display_tc96w_p0ipj_409",
21
+ "content-display-title": "awsui_content-display-title_tc96w_p0ipj_499",
22
+ "content-display-description": "awsui_content-display-description_tc96w_p0ipj_507",
23
+ "content-display-option-list": "awsui_content-display-option-list_tc96w_p0ipj_515",
24
+ "root": "awsui_root_tc96w_p0ipj_521",
25
+ "modal-root": "awsui_modal-root_tc96w_p0ipj_522",
26
+ "trigger-button": "awsui_trigger-button_tc96w_p0ipj_523",
27
+ "cancel-button": "awsui_cancel-button_tc96w_p0ipj_524",
28
+ "confirm-button": "awsui_confirm-button_tc96w_p0ipj_525",
29
+ "custom": "awsui_custom_tc96w_p0ipj_526",
30
+ "second-column-small": "awsui_second-column-small_tc96w_p0ipj_530",
31
+ "wrap-lines": "awsui_wrap-lines_tc96w_p0ipj_534",
32
+ "striped-rows": "awsui_striped-rows_tc96w_p0ipj_535",
33
+ "content-density": "awsui_content-density_tc96w_p0ipj_536",
34
+ "page-size": "awsui_page-size_tc96w_p0ipj_537",
35
+ "page-size-form-field": "awsui_page-size-form-field_tc96w_p0ipj_538",
36
+ "page-size-radio-group": "awsui_page-size-radio-group_tc96w_p0ipj_539"
42
37
  };
43
38
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { CollectionPreferencesProps } from './interfaces';
3
- export declare const copyPreferences: ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, stickyColumns, custom, }: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
3
+ export declare const copyPreferences: ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, custom, }: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
4
4
  export declare const mergePreferences: (newPref: CollectionPreferencesProps.Preferences, oldPref: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
5
5
  interface ModalContentLayoutProps {
6
6
  left: React.ReactNode;
@@ -27,17 +27,6 @@ interface ContentDensityPreferenceProps extends CollectionPreferencesProps.Conte
27
27
  value?: 'comfortable' | 'compact';
28
28
  }
29
29
  export declare const ContentDensityPreference: ({ label, description, value, onChange }: ContentDensityPreferenceProps) => JSX.Element;
30
- interface StickyColumnsPreferenceProps extends CollectionPreferencesProps.StickyColumnsPreference {
31
- onChange: (value?: {
32
- first?: number;
33
- last?: number;
34
- }) => void;
35
- value?: {
36
- first?: number;
37
- last?: number;
38
- };
39
- }
40
- export declare const StickyColumnsPreference: ({ firstColumns, lastColumns, onChange, value, }: StickyColumnsPreferenceProps) => JSX.Element;
41
30
  interface CustomPreferenceProps<T = any> extends Pick<CollectionPreferencesProps<T>, 'customPreference'> {
42
31
  onChange: (value: T) => void;
43
32
  value: T;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"lib/default/","sources":["collection-preferences/utils.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB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,CAAC,kBAAkB;IACrF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,wCAAyC,uBAAuB,gBAW9F,CAAC;AAEF,UAAU,wBAAyB,SAAQ,0BAA0B,CAAC,mBAAmB;IACvF,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,mBAAmB,4CAA6C,wBAAwB,gBASpG,CAAC;AAEF,UAAU,0BAA2B,SAAQ,0BAA0B,CAAC,qBAAqB;IAC3F,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,qBAAqB,4CAA6C,0BAA0B,gBASxG,CAAC;AAEF,UAAU,6BAA8B,SAAQ,0BAA0B,CAAC,wBAAwB;IACjG,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,KAAK,IAAI,CAAC;IACrD,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CACnC;AAED,eAAO,MAAM,wBAAwB,4CAA6C,6BAA6B,gBAS9G,CAAC;AAEF,UAAU,qBAAqB,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC;IACtG,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC;CACV;AACD,eAAO,MAAM,gBAAgB,0CAA2C,qBAAqB,uBAc5F,CAAC"}
@@ -6,17 +6,15 @@ import InternalCheckbox from '../checkbox/internal';
6
6
  import InternalColumnLayout from '../column-layout/internal';
7
7
  import InternalFormField from '../form-field/internal';
8
8
  import InternalRadioGroup from '../radio-group/internal';
9
- import InternalSpaceBetween from '../space-between/internal';
10
9
  import { useContainerBreakpoints } from '../internal/hooks/container-queries';
11
10
  import styles from './styles.css.js';
12
- export const copyPreferences = ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, stickyColumns, custom, }) => ({
11
+ export const copyPreferences = ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, custom, }) => ({
13
12
  pageSize,
14
13
  wrapLines,
15
14
  stripedRows,
16
15
  contentDensity,
17
16
  visibleContent,
18
17
  contentDisplay,
19
- stickyColumns,
20
18
  custom,
21
19
  });
22
20
  export const mergePreferences = (newPref, oldPref) => {
@@ -29,7 +27,6 @@ export const mergePreferences = (newPref, oldPref) => {
29
27
  'visibleContent',
30
28
  'custom',
31
29
  'contentDisplay',
32
- 'stickyColumns',
33
30
  ];
34
31
  for (const prefName of prefNames) {
35
32
  if (newPref[prefName] !== undefined) {
@@ -58,17 +55,6 @@ export const PageSizePreference = ({ title, options, value, onChange }) => (Reac
58
55
  export const WrapLinesPreference = ({ label, description, value, onChange }) => (React.createElement(InternalCheckbox, { checked: !!value, description: description, onChange: ({ detail }) => onChange(detail.checked), className: styles['wrap-lines'] }, label));
59
56
  export const StripedRowsPreference = ({ label, description, value, onChange }) => (React.createElement(InternalCheckbox, { checked: !!value, description: description, onChange: ({ detail }) => onChange(detail.checked), className: styles['striped-rows'] }, label));
60
57
  export const ContentDensityPreference = ({ label, description, value, onChange }) => (React.createElement(InternalCheckbox, { checked: value === 'compact', description: description, onChange: ({ detail }) => onChange(detail.checked ? 'compact' : 'comfortable'), className: styles['content-density'] }, label));
61
- const StickyPreference = ({ firstOrLast, preference, value, onChange }) => {
62
- const { title, description, options } = preference;
63
- return (React.createElement("div", { className: styles[`sticky-columns-${firstOrLast}`] },
64
- React.createElement(InternalFormField, { className: styles['sticky-columns-form-field'], label: title, description: description },
65
- React.createElement(InternalRadioGroup, { className: styles['sticky-columns-radio-group'], value: typeof value !== 'undefined' ? `${value}` : null, items: options.map(({ label, value }) => ({ label, value: `${value}` })), onChange: ({ detail }) => onChange(Number(detail.value)) }))));
66
- };
67
- export const StickyColumnsPreference = ({ firstColumns, lastColumns, onChange, value, }) => {
68
- return (React.createElement(InternalSpaceBetween, { className: styles['sticky-columns'], size: "l" },
69
- firstColumns && (React.createElement(StickyPreference, { firstOrLast: "first", preference: firstColumns, value: value === null || value === void 0 ? void 0 : value.first, onChange: newValue => onChange(Object.assign(Object.assign({}, value), { first: newValue })) })),
70
- lastColumns && (React.createElement(StickyPreference, { firstOrLast: "last", preference: lastColumns, value: value === null || value === void 0 ? void 0 : value.last, onChange: newValue => onChange(Object.assign(Object.assign({}, value), { last: newValue })) }))));
71
- };
72
58
  export const CustomPreference = ({ value, customPreference, onChange }) => {
73
59
  const [customState, setCustomState] = useState(value);
74
60
  if (customPreference) {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"lib/default/","sources":["collection-preferences/utils.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,WAAW,EACX,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EACb,MAAM,GACiC,EAA0C,EAAE,CAAC,CAAC;IACrF,QAAQ;IACR,SAAS;IAC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AAQ,EAAyB,EAAE,EAAE;IAC/F,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,IAAI,gBAAgB,EAAE;QACpB,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,IAC1B,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;YACrC,uDAAuD;YACvD,cAAc,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;YAC5B,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC,CACE,CACP,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport clsx from 'clsx';\nimport InternalCheckbox from '../checkbox/internal';\nimport InternalColumnLayout from '../column-layout/internal';\nimport InternalFormField from '../form-field/internal';\nimport InternalRadioGroup from '../radio-group/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { CollectionPreferencesProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport const copyPreferences = ({\n pageSize,\n wrapLines,\n stripedRows,\n contentDensity,\n visibleContent,\n contentDisplay,\n stickyColumns,\n custom,\n}: CollectionPreferencesProps.Preferences): CollectionPreferencesProps.Preferences => ({\n pageSize,\n wrapLines,\n stripedRows,\n contentDensity,\n visibleContent,\n contentDisplay,\n stickyColumns,\n custom,\n});\n\ntype CopyPreferenceName = keyof CollectionPreferencesProps.Preferences;\n\nexport const mergePreferences = (\n newPref: CollectionPreferencesProps.Preferences,\n oldPref: CollectionPreferencesProps.Preferences\n): CollectionPreferencesProps.Preferences => {\n const newObj = { ...oldPref };\n const prefNames: CopyPreferenceName[] = [\n 'pageSize',\n 'wrapLines',\n 'stripedRows',\n 'contentDensity',\n 'visibleContent',\n 'custom',\n 'contentDisplay',\n 'stickyColumns',\n ];\n for (const prefName of prefNames) {\n if (newPref[prefName] !== undefined) {\n newObj[prefName] = newPref[prefName];\n }\n }\n return newObj;\n};\n\ninterface ModalContentLayoutProps {\n left: React.ReactNode;\n right: React.ReactNode;\n}\n\nexport const ModalContentLayout = ({ left, right }: ModalContentLayoutProps) => {\n const [breakpoint, ref] = useContainerBreakpoints(['xs']);\n const smallContainer = breakpoint === 'default';\n\n if (smallContainer) {\n return (\n <div ref={ref}>\n {left && <div>{left}</div>}\n {right && <div className={clsx(left && styles['second-column-small'])}>{right}</div>}\n </div>\n );\n }\n\n const columns = left && right ? 2 : 1;\n return (\n <div ref={ref}>\n <InternalColumnLayout columns={columns} variant=\"text-grid\">\n {left && <div>{left}</div>}\n {right && <div>{right}</div>}\n </InternalColumnLayout>\n </div>\n );\n};\n\ninterface PageSizePreferenceProps extends CollectionPreferencesProps.PageSizePreference {\n onChange: (value: number) => void;\n value?: number;\n}\n\nexport const PageSizePreference = ({ title, options, value, onChange }: PageSizePreferenceProps) => (\n <div className={styles['page-size']}>\n <InternalFormField label={title} stretch={true} className={styles['page-size-form-field']}>\n <InternalRadioGroup\n className={styles['page-size-radio-group']}\n value={`${value}`}\n items={options.map(({ label, value }) => ({ label, value: `${value}` }))}\n onChange={({ detail }) => onChange(parseInt(detail.value, 10))}\n />\n </InternalFormField>\n </div>\n);\n\ninterface WrapLinesPreferenceProps extends CollectionPreferencesProps.WrapLinesPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport const WrapLinesPreference = ({ label, description, value, onChange }: WrapLinesPreferenceProps) => (\n <InternalCheckbox\n checked={!!value}\n description={description}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['wrap-lines']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface StripedRowsPreferenceProps extends CollectionPreferencesProps.StripedRowsPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport const StripedRowsPreference = ({ label, description, value, onChange }: StripedRowsPreferenceProps) => (\n <InternalCheckbox\n checked={!!value}\n description={description}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['striped-rows']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface ContentDensityPreferenceProps extends CollectionPreferencesProps.ContentDensityPreference {\n onChange: (value: 'comfortable' | 'compact') => void;\n value?: 'comfortable' | 'compact';\n}\n\nexport const ContentDensityPreference = ({ label, description, value, onChange }: ContentDensityPreferenceProps) => (\n <InternalCheckbox\n checked={value === 'compact'}\n description={description}\n onChange={({ detail }) => onChange(detail.checked ? 'compact' : 'comfortable')}\n className={styles['content-density']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface StickyColumnsPreferenceProps extends CollectionPreferencesProps.StickyColumnsPreference {\n onChange: (value?: { first?: number; last?: number }) => void;\n value?: { first?: number; last?: number };\n}\ninterface StickyPreference extends CollectionPreferencesProps.StickyColumnsPreference {\n onChange: (value: number) => void;\n preference: {\n title: string;\n description: string;\n options: ReadonlyArray<{\n label: string;\n value: number;\n }>;\n };\n value?: number;\n firstOrLast: 'first' | 'last';\n}\n\nconst StickyPreference = ({ firstOrLast, preference, value, onChange }: StickyPreference) => {\n const { title, description, options } = preference;\n return (\n <div className={styles[`sticky-columns-${firstOrLast}`]}>\n <InternalFormField className={styles['sticky-columns-form-field']} label={title} description={description}>\n <InternalRadioGroup\n className={styles['sticky-columns-radio-group']}\n value={typeof value !== 'undefined' ? `${value}` : null}\n items={options.map(({ label, value }) => ({ label, value: `${value}` }))}\n onChange={({ detail }) => onChange(Number(detail.value))}\n />\n </InternalFormField>\n </div>\n );\n};\n\nexport const StickyColumnsPreference = ({\n firstColumns,\n lastColumns,\n onChange,\n value,\n}: StickyColumnsPreferenceProps) => {\n return (\n <InternalSpaceBetween className={styles['sticky-columns']} size=\"l\">\n {firstColumns && (\n <StickyPreference\n firstOrLast=\"first\"\n preference={firstColumns}\n value={value?.first}\n onChange={newValue => onChange({ ...value, first: newValue })}\n />\n )}\n {lastColumns && (\n <StickyPreference\n firstOrLast=\"last\"\n preference={lastColumns}\n value={value?.last}\n onChange={newValue => onChange({ ...value, last: newValue })}\n />\n )}\n </InternalSpaceBetween>\n );\n};\n\ninterface CustomPreferenceProps<T = any> extends Pick<CollectionPreferencesProps<T>, 'customPreference'> {\n onChange: (value: T) => void;\n value: T;\n}\nexport const CustomPreference = ({ value, customPreference, onChange }: CustomPreferenceProps) => {\n const [customState, setCustomState] = useState(value);\n if (customPreference) {\n return (\n <div className={styles.custom}>\n {customPreference(customState, value => {\n // prevent value to be treated as a functional callback\n setCustomState(() => value);\n onChange(value);\n })}\n </div>\n );\n }\n return null;\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"lib/default/","sources":["collection-preferences/utils.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,WAAW,EACX,cAAc,EACd,cAAc,EACd,cAAc,EACd,MAAM,GACiC,EAA0C,EAAE,CAAC,CAAC;IACrF,QAAQ;IACR,SAAS;IACT,WAAW;IACX,cAAc;IACd,cAAc;IACd,cAAc;IACd,MAAM;CACP,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,OAA+C,EAC/C,OAA+C,EACP,EAAE;IAC1C,MAAM,MAAM,qBAAQ,OAAO,CAAE,CAAC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AAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAClD,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,IAEhC,KAAK,CACW,CACpB,CAAC;AAOF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAiC,EAAE,EAAE,CAAC,CAClH,oBAAC,gBAAgB,IACf,OAAO,EAAE,KAAK,KAAK,SAAS,EAC5B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,EAC9E,SAAS,EAAE,MAAM,CAAC,iBAAiB,CAAC,IAEnC,KAAK,CACW,CACpB,CAAC;AAMF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAyB,EAAE,EAAE;IAC/F,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,IAAI,gBAAgB,EAAE;QACpB,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,IAC1B,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;YACrC,uDAAuD;YACvD,cAAc,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;YAC5B,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC,CACE,CACP,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport clsx from 'clsx';\nimport InternalCheckbox from '../checkbox/internal';\nimport InternalColumnLayout from '../column-layout/internal';\nimport InternalFormField from '../form-field/internal';\nimport InternalRadioGroup from '../radio-group/internal';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { CollectionPreferencesProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport const copyPreferences = ({\n pageSize,\n wrapLines,\n stripedRows,\n contentDensity,\n visibleContent,\n contentDisplay,\n custom,\n}: CollectionPreferencesProps.Preferences): CollectionPreferencesProps.Preferences => ({\n pageSize,\n wrapLines,\n stripedRows,\n contentDensity,\n visibleContent,\n contentDisplay,\n custom,\n});\n\ntype CopyPreferenceName = keyof CollectionPreferencesProps.Preferences;\n\nexport const mergePreferences = (\n newPref: CollectionPreferencesProps.Preferences,\n oldPref: CollectionPreferencesProps.Preferences\n): CollectionPreferencesProps.Preferences => {\n const newObj = { ...oldPref };\n const prefNames: CopyPreferenceName[] = [\n 'pageSize',\n 'wrapLines',\n 'stripedRows',\n 'contentDensity',\n 'visibleContent',\n 'custom',\n 'contentDisplay',\n ];\n for (const prefName of prefNames) {\n if (newPref[prefName] !== undefined) {\n newObj[prefName] = newPref[prefName];\n }\n }\n return newObj;\n};\n\ninterface ModalContentLayoutProps {\n left: React.ReactNode;\n right: React.ReactNode;\n}\n\nexport const ModalContentLayout = ({ left, right }: ModalContentLayoutProps) => {\n const [breakpoint, ref] = useContainerBreakpoints(['xs']);\n const smallContainer = breakpoint === 'default';\n\n if (smallContainer) {\n return (\n <div ref={ref}>\n {left && <div>{left}</div>}\n {right && <div className={clsx(left && styles['second-column-small'])}>{right}</div>}\n </div>\n );\n }\n\n const columns = left && right ? 2 : 1;\n return (\n <div ref={ref}>\n <InternalColumnLayout columns={columns} variant=\"text-grid\">\n {left && <div>{left}</div>}\n {right && <div>{right}</div>}\n </InternalColumnLayout>\n </div>\n );\n};\n\ninterface PageSizePreferenceProps extends CollectionPreferencesProps.PageSizePreference {\n onChange: (value: number) => void;\n value?: number;\n}\n\nexport const PageSizePreference = ({ title, options, value, onChange }: PageSizePreferenceProps) => (\n <div className={styles['page-size']}>\n <InternalFormField label={title} stretch={true} className={styles['page-size-form-field']}>\n <InternalRadioGroup\n className={styles['page-size-radio-group']}\n value={`${value}`}\n items={options.map(({ label, value }) => ({ label, value: `${value}` }))}\n onChange={({ detail }) => onChange(parseInt(detail.value, 10))}\n />\n </InternalFormField>\n </div>\n);\n\ninterface WrapLinesPreferenceProps extends CollectionPreferencesProps.WrapLinesPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport const WrapLinesPreference = ({ label, description, value, onChange }: WrapLinesPreferenceProps) => (\n <InternalCheckbox\n checked={!!value}\n description={description}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['wrap-lines']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface StripedRowsPreferenceProps extends CollectionPreferencesProps.StripedRowsPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport const StripedRowsPreference = ({ label, description, value, onChange }: StripedRowsPreferenceProps) => (\n <InternalCheckbox\n checked={!!value}\n description={description}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['striped-rows']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface ContentDensityPreferenceProps extends CollectionPreferencesProps.ContentDensityPreference {\n onChange: (value: 'comfortable' | 'compact') => void;\n value?: 'comfortable' | 'compact';\n}\n\nexport const ContentDensityPreference = ({ label, description, value, onChange }: ContentDensityPreferenceProps) => (\n <InternalCheckbox\n checked={value === 'compact'}\n description={description}\n onChange={({ detail }) => onChange(detail.checked ? 'compact' : 'comfortable')}\n className={styles['content-density']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface CustomPreferenceProps<T = any> extends Pick<CollectionPreferencesProps<T>, 'customPreference'> {\n onChange: (value: T) => void;\n value: T;\n}\nexport const CustomPreference = ({ value, customPreference, onChange }: CustomPreferenceProps) => {\n const [customState, setCustomState] = useState(value);\n if (customPreference) {\n return (\n <div className={styles.custom}>\n {customPreference(customState, value => {\n // prevent value to be treated as a functional callback\n setCustomState(() => value);\n onChange(value);\n })}\n </div>\n );\n }\n return null;\n};\n"]}