@cloudscape-design/components-themeable 3.0.286 → 3.0.287
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/collection-preferences/content-display/content-display-option.scss +0 -1
- package/lib/internal/scss/collection-preferences/styles.scss +6 -1
- package/lib/internal/scss/table/body-cell/styles.scss +52 -0
- package/lib/internal/scss/table/header-cell/styles.scss +28 -0
- package/lib/internal/template/collection-preferences/content-display/styles.css.js +11 -11
- package/lib/internal/template/collection-preferences/content-display/styles.scoped.css +17 -18
- package/lib/internal/template/collection-preferences/content-display/styles.selectors.js +11 -11
- package/lib/internal/template/collection-preferences/index.d.ts +1 -1
- package/lib/internal/template/collection-preferences/index.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/index.js +6 -4
- package/lib/internal/template/collection-preferences/index.js.map +1 -1
- package/lib/internal/template/collection-preferences/interfaces.d.ts +42 -12
- package/lib/internal/template/collection-preferences/interfaces.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/interfaces.js.map +1 -1
- package/lib/internal/template/collection-preferences/styles.css.js +37 -32
- package/lib/internal/template/collection-preferences/styles.scoped.css +44 -40
- package/lib/internal/template/collection-preferences/styles.selectors.js +37 -32
- package/lib/internal/template/collection-preferences/utils.d.ts +12 -1
- package/lib/internal/template/collection-preferences/utils.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/utils.js +15 -1
- package/lib/internal/template/collection-preferences/utils.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +14 -0
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/table/body-cell/styles.css.js +28 -23
- package/lib/internal/template/table/body-cell/styles.scoped.css +111 -55
- package/lib/internal/template/table/body-cell/styles.selectors.js +28 -23
- package/lib/internal/template/table/body-cell/td-element.d.ts +3 -0
- package/lib/internal/template/table/body-cell/td-element.d.ts.map +1 -1
- package/lib/internal/template/table/body-cell/td-element.js +16 -2
- package/lib/internal/template/table/body-cell/td-element.js.map +1 -1
- package/lib/internal/template/table/header-cell/index.d.ts +4 -1
- package/lib/internal/template/table/header-cell/index.d.ts.map +1 -1
- package/lib/internal/template/table/header-cell/index.js +9 -2
- package/lib/internal/template/table/header-cell/index.js.map +1 -1
- package/lib/internal/template/table/header-cell/styles.css.js +24 -19
- package/lib/internal/template/table/header-cell/styles.scoped.css +67 -32
- package/lib/internal/template/table/header-cell/styles.selectors.js +24 -19
- package/lib/internal/template/table/interfaces.d.ts +14 -0
- package/lib/internal/template/table/interfaces.d.ts.map +1 -1
- package/lib/internal/template/table/interfaces.js.map +1 -1
- package/lib/internal/template/table/internal.d.ts.map +1 -1
- package/lib/internal/template/table/internal.js +19 -6
- package/lib/internal/template/table/internal.js.map +1 -1
- package/lib/internal/template/table/thead.d.ts +2 -0
- package/lib/internal/template/table/thead.d.ts.map +1 -1
- package/lib/internal/template/table/thead.js +12 -4
- package/lib/internal/template/table/thead.js.map +1 -1
- package/lib/internal/template/table/use-sticky-columns.d.ts.map +1 -1
- package/lib/internal/template/table/use-sticky-columns.js +5 -1
- package/lib/internal/template/table/use-sticky-columns.js.map +1 -1
- package/lib/internal/template/table/utils.d.ts +4 -0
- package/lib/internal/template/table/utils.d.ts.map +1 -1
- package/lib/internal/template/table/utils.js +8 -0
- package/lib/internal/template/table/utils.js.map +1 -1
- package/lib/internal/template/test-utils/dom/collection-preferences/index.d.ts +2 -0
- package/lib/internal/template/test-utils/dom/collection-preferences/index.js +6 -1
- package/lib/internal/template/test-utils/dom/collection-preferences/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/collection-preferences/sticky-columns-preference.d.ts +9 -0
- package/lib/internal/template/test-utils/dom/collection-preferences/sticky-columns-preference.js +23 -0
- package/lib/internal/template/test-utils/dom/collection-preferences/sticky-columns-preference.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/collection-preferences/index.d.ts +2 -0
- package/lib/internal/template/test-utils/selectors/collection-preferences/index.js +6 -1
- package/lib/internal/template/test-utils/selectors/collection-preferences/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/collection-preferences/sticky-columns-preference.d.ts +9 -0
- package/lib/internal/template/test-utils/selectors/collection-preferences/sticky-columns-preference.js +23 -0
- package/lib/internal/template/test-utils/selectors/collection-preferences/sticky-columns-preference.js.map +1 -0
- package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -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 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
|
+
{"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,37 +1,42 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"visible-content": "awsui_visible-
|
|
5
|
-
"visible-content-toggle": "awsui_visible-content-
|
|
6
|
-
"visible-content-groups": "awsui_visible-content-
|
|
7
|
-
"visible-content-group": "awsui_visible-content-
|
|
8
|
-
"visible-content-title": "awsui_visible-content-
|
|
9
|
-
"visible-content-group-label": "awsui_visible-content-group-
|
|
10
|
-
"visible-content-option": "awsui_visible-content-
|
|
11
|
-
"visible-content-option-label": "awsui_visible-content-option-
|
|
12
|
-
"content-display-option-toggle": "awsui_content-display-option-
|
|
13
|
-
"content-display-option-content": "awsui_content-display-option-
|
|
14
|
-
"content-display-option": "awsui_content-display-
|
|
15
|
-
"placeholder": "
|
|
16
|
-
"sorting": "
|
|
17
|
-
"content-display-option-label": "awsui_content-display-option-
|
|
18
|
-
"drag-overlay": "awsui_drag-
|
|
19
|
-
"content-display": "awsui_content-
|
|
20
|
-
"content-display-title": "awsui_content-display-
|
|
21
|
-
"content-display-description": "awsui_content-display-
|
|
22
|
-
"content-display-option-list": "awsui_content-display-option-
|
|
23
|
-
"root": "
|
|
24
|
-
"modal-root": "awsui_modal-
|
|
25
|
-
"trigger-button": "awsui_trigger-
|
|
26
|
-
"cancel-button": "awsui_cancel-
|
|
27
|
-
"confirm-button": "awsui_confirm-
|
|
28
|
-
"custom": "
|
|
29
|
-
"second-column-small": "awsui_second-column-
|
|
30
|
-
"wrap-lines": "awsui_wrap-
|
|
31
|
-
"striped-rows": "awsui_striped-
|
|
32
|
-
"content-density": "awsui_content-
|
|
33
|
-
"page-size": "awsui_page-
|
|
34
|
-
"page-size-form-field": "awsui_page-size-form-
|
|
35
|
-
"page-size-radio-group": "awsui_page-size-radio-
|
|
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"
|
|
36
41
|
};
|
|
37
42
|
|
|
@@ -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-
|
|
186
|
-
.awsui_visible-content-
|
|
187
|
-
.awsui_visible-content-
|
|
188
|
-
.awsui_visible-content-
|
|
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) {
|
|
189
189
|
/* used in test-utils */
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
.awsui_visible-content-
|
|
192
|
+
.awsui_visible-content-title_tc96w_1mfx0_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-
|
|
201
|
+
.awsui_visible-content-group-label_tc96w_1mfx0_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-
|
|
207
|
+
.awsui_visible-content-option_tc96w_1mfx0_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-
|
|
214
|
+
.awsui_visible-content-option_tc96w_1mfx0_207:not(#\9):last-child {
|
|
215
215
|
border-bottom: none;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
.awsui_visible-content-option-
|
|
218
|
+
.awsui_visible-content-option-label_tc96w_1mfx0_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-
|
|
409
|
+
.awsui_content-display-option-toggle_tc96w_1mfx0_409:not(#\9) {
|
|
410
410
|
/* used in test-utils */
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
.awsui_content-display-option-
|
|
413
|
+
.awsui_content-display-option-content_tc96w_1mfx0_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,29 +454,28 @@ 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-
|
|
457
|
+
.awsui_content-display-option_tc96w_1mfx0_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-
|
|
462
|
+
.awsui_content-display-option_tc96w_1mfx0_409:not(#\9):not(.awsui_placeholder_tc96w_1mfx0_436).awsui_sorting_tc96w_1mfx0_436 {
|
|
463
463
|
transition: transform var(--motion-duration-transition-quick-x85tae, 90ms) var(--motion-easing-transition-quick-lukbd8, linear);
|
|
464
|
-
z-index: 1;
|
|
465
464
|
}
|
|
466
465
|
@media (prefers-reduced-motion: reduce) {
|
|
467
|
-
.awsui_content-display-
|
|
466
|
+
.awsui_content-display-option_tc96w_1mfx0_409:not(#\9):not(.awsui_placeholder_tc96w_1mfx0_436).awsui_sorting_tc96w_1mfx0_436 {
|
|
468
467
|
animation: none;
|
|
469
468
|
transition: none;
|
|
470
469
|
}
|
|
471
470
|
}
|
|
472
|
-
.awsui-motion-disabled .awsui_content-display-
|
|
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 {
|
|
473
472
|
animation: none;
|
|
474
473
|
transition: none;
|
|
475
474
|
}
|
|
476
|
-
.awsui_content-display-
|
|
475
|
+
.awsui_content-display-option_tc96w_1mfx0_409.awsui_placeholder_tc96w_1mfx0_436 > .awsui_content-display-option-content_tc96w_1mfx0_413:not(#\9) {
|
|
477
476
|
position: relative;
|
|
478
477
|
}
|
|
479
|
-
.awsui_content-display-
|
|
478
|
+
.awsui_content-display-option_tc96w_1mfx0_409.awsui_placeholder_tc96w_1mfx0_436 > .awsui_content-display-option-content_tc96w_1mfx0_413:not(#\9):after {
|
|
480
479
|
content: " ";
|
|
481
480
|
position: absolute;
|
|
482
481
|
top: 0;
|
|
@@ -487,7 +486,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
487
486
|
border-radius: var(--border-radius-item-wjpc1f, 0px);
|
|
488
487
|
}
|
|
489
488
|
|
|
490
|
-
.awsui_content-display-option-
|
|
489
|
+
.awsui_content-display-option-label_tc96w_1mfx0_463:not(#\9) {
|
|
491
490
|
flex-grow: 1;
|
|
492
491
|
min-width: 0;
|
|
493
492
|
-ms-word-break: break-all;
|
|
@@ -495,18 +494,18 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
495
494
|
padding-right: var(--space-l-4vl6xu, 20px);
|
|
496
495
|
}
|
|
497
496
|
|
|
498
|
-
.awsui_drag-
|
|
497
|
+
.awsui_drag-overlay_tc96w_1mfx0_471:not(#\9) {
|
|
499
498
|
box-shadow: var(--shadow-container-active-h4jsj2, 0px 4px 8px rgba(0, 28, 36, 0.45));
|
|
500
499
|
border-radius: var(--border-radius-item-wjpc1f, 0px);
|
|
501
500
|
}
|
|
502
|
-
body[data-awsui-focus-visible=true] .awsui_drag-
|
|
501
|
+
body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1mfx0_471:not(#\9) {
|
|
503
502
|
position: relative;
|
|
504
503
|
}
|
|
505
|
-
body[data-awsui-focus-visible=true] .awsui_drag-
|
|
504
|
+
body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1mfx0_471:not(#\9) {
|
|
506
505
|
outline: 2px dotted transparent;
|
|
507
506
|
outline-offset: calc(0px - 1px);
|
|
508
507
|
}
|
|
509
|
-
body[data-awsui-focus-visible=true] .awsui_drag-
|
|
508
|
+
body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1mfx0_471:not(#\9)::before {
|
|
510
509
|
content: " ";
|
|
511
510
|
display: block;
|
|
512
511
|
position: absolute;
|
|
@@ -518,11 +517,11 @@ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_p0ipj_472:not(#\9)
|
|
|
518
517
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-n5kd8g, #0073bb);
|
|
519
518
|
}
|
|
520
519
|
|
|
521
|
-
.awsui_content-
|
|
520
|
+
.awsui_content-display_tc96w_1mfx0_409:not(#\9) {
|
|
522
521
|
/* used in test-utils */
|
|
523
522
|
}
|
|
524
523
|
|
|
525
|
-
.awsui_content-display-
|
|
524
|
+
.awsui_content-display-title_tc96w_1mfx0_498:not(#\9) {
|
|
526
525
|
font-size: var(--font-body-m-size-sregvd, 14px);
|
|
527
526
|
line-height: var(--font-body-m-line-height-i7xxvv, 22px);
|
|
528
527
|
font-weight: var(--font-display-label-weight-tjy9e4, 400);
|
|
@@ -530,7 +529,7 @@ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_p0ipj_472:not(#\9)
|
|
|
530
529
|
margin: 0;
|
|
531
530
|
}
|
|
532
531
|
|
|
533
|
-
.awsui_content-display-
|
|
532
|
+
.awsui_content-display-description_tc96w_1mfx0_506:not(#\9) {
|
|
534
533
|
color: var(--color-text-form-secondary-1c3szk, #687078);
|
|
535
534
|
font-size: var(--font-body-s-size-ukw2p9, 12px);
|
|
536
535
|
line-height: var(--font-body-s-line-height-kdsbrl, 16px);
|
|
@@ -538,30 +537,35 @@ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_p0ipj_472:not(#\9)
|
|
|
538
537
|
margin-top: var(--space-scaled-xxxs-lo883m, 2px);
|
|
539
538
|
}
|
|
540
539
|
|
|
541
|
-
.awsui_content-display-option-
|
|
540
|
+
.awsui_content-display-option-list_tc96w_1mfx0_514:not(#\9) {
|
|
542
541
|
position: relative;
|
|
543
542
|
list-style: none;
|
|
544
543
|
padding: 0;
|
|
545
544
|
}
|
|
546
545
|
|
|
547
|
-
.
|
|
548
|
-
.awsui_modal-
|
|
549
|
-
.awsui_trigger-
|
|
550
|
-
.awsui_cancel-
|
|
551
|
-
.awsui_confirm-
|
|
552
|
-
.
|
|
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) {
|
|
553
552
|
/* used in test-utils */
|
|
554
553
|
}
|
|
555
554
|
|
|
556
|
-
.awsui_second-column-
|
|
555
|
+
.awsui_second-column-small_tc96w_1mfx0_529:not(#\9) {
|
|
557
556
|
padding-top: calc(2 * var(--space-scaled-l-t03y3z, 20px));
|
|
558
557
|
}
|
|
559
558
|
|
|
560
|
-
.awsui_wrap-
|
|
561
|
-
.awsui_striped-
|
|
562
|
-
.awsui_content-
|
|
563
|
-
.awsui_page-
|
|
564
|
-
.awsui_page-size-form-
|
|
565
|
-
.awsui_page-size-radio-
|
|
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) {
|
|
566
570
|
/* used in test-utils */
|
|
567
571
|
}
|
|
@@ -2,37 +2,42 @@
|
|
|
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-
|
|
6
|
-
"visible-content-toggle": "awsui_visible-content-
|
|
7
|
-
"visible-content-groups": "awsui_visible-content-
|
|
8
|
-
"visible-content-group": "awsui_visible-content-
|
|
9
|
-
"visible-content-title": "awsui_visible-content-
|
|
10
|
-
"visible-content-group-label": "awsui_visible-content-group-
|
|
11
|
-
"visible-content-option": "awsui_visible-content-
|
|
12
|
-
"visible-content-option-label": "awsui_visible-content-option-
|
|
13
|
-
"content-display-option-toggle": "awsui_content-display-option-
|
|
14
|
-
"content-display-option-content": "awsui_content-display-option-
|
|
15
|
-
"content-display-option": "awsui_content-display-
|
|
16
|
-
"placeholder": "
|
|
17
|
-
"sorting": "
|
|
18
|
-
"content-display-option-label": "awsui_content-display-option-
|
|
19
|
-
"drag-overlay": "awsui_drag-
|
|
20
|
-
"content-display": "awsui_content-
|
|
21
|
-
"content-display-title": "awsui_content-display-
|
|
22
|
-
"content-display-description": "awsui_content-display-
|
|
23
|
-
"content-display-option-list": "awsui_content-display-option-
|
|
24
|
-
"root": "
|
|
25
|
-
"modal-root": "awsui_modal-
|
|
26
|
-
"trigger-button": "awsui_trigger-
|
|
27
|
-
"cancel-button": "awsui_cancel-
|
|
28
|
-
"confirm-button": "awsui_confirm-
|
|
29
|
-
"custom": "
|
|
30
|
-
"second-column-small": "awsui_second-column-
|
|
31
|
-
"wrap-lines": "awsui_wrap-
|
|
32
|
-
"striped-rows": "awsui_striped-
|
|
33
|
-
"content-density": "awsui_content-
|
|
34
|
-
"page-size": "awsui_page-
|
|
35
|
-
"page-size-form-field": "awsui_page-size-form-
|
|
36
|
-
"page-size-radio-group": "awsui_page-size-radio-
|
|
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"
|
|
37
42
|
};
|
|
38
43
|
|
|
@@ -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, custom, }: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
|
|
3
|
+
export declare const copyPreferences: ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, stickyColumns, 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,6 +27,17 @@ 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;
|
|
30
41
|
interface CustomPreferenceProps<T = any> extends Pick<CollectionPreferencesProps<T>, 'customPreference'> {
|
|
31
42
|
onChange: (value: T) => void;
|
|
32
43
|
value: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"lib/default/","sources":["collection-preferences/utils.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"lib/default/","sources":["collection-preferences/utils.tsx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AG,SAAS,CAAC;CACnC;AAED,eAAO,MAAM,wBAAwB,4CAA6C,6BAA6B,gBAS9G,CAAC;AAEF,UAAU,4BAA6B,SAAQ,0BAA0B,CAAC,uBAAuB;IAC/F,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC9D,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AA+BD,eAAO,MAAM,uBAAuB,oDAKjC,4BAA4B,gBAqB9B,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,15 +6,17 @@ 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';
|
|
9
10
|
import { useContainerBreakpoints } from '../internal/hooks/container-queries';
|
|
10
11
|
import styles from './styles.css.js';
|
|
11
|
-
export const copyPreferences = ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, custom, }) => ({
|
|
12
|
+
export const copyPreferences = ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, stickyColumns, custom, }) => ({
|
|
12
13
|
pageSize,
|
|
13
14
|
wrapLines,
|
|
14
15
|
stripedRows,
|
|
15
16
|
contentDensity,
|
|
16
17
|
visibleContent,
|
|
17
18
|
contentDisplay,
|
|
19
|
+
stickyColumns,
|
|
18
20
|
custom,
|
|
19
21
|
});
|
|
20
22
|
export const mergePreferences = (newPref, oldPref) => {
|
|
@@ -27,6 +29,7 @@ export const mergePreferences = (newPref, oldPref) => {
|
|
|
27
29
|
'visibleContent',
|
|
28
30
|
'custom',
|
|
29
31
|
'contentDisplay',
|
|
32
|
+
'stickyColumns',
|
|
30
33
|
];
|
|
31
34
|
for (const prefName of prefNames) {
|
|
32
35
|
if (newPref[prefName] !== undefined) {
|
|
@@ -55,6 +58,17 @@ export const PageSizePreference = ({ title, options, value, onChange }) => (Reac
|
|
|
55
58
|
export const WrapLinesPreference = ({ label, description, value, onChange }) => (React.createElement(InternalCheckbox, { checked: !!value, description: description, onChange: ({ detail }) => onChange(detail.checked), className: styles['wrap-lines'] }, label));
|
|
56
59
|
export const StripedRowsPreference = ({ label, description, value, onChange }) => (React.createElement(InternalCheckbox, { checked: !!value, description: description, onChange: ({ detail }) => onChange(detail.checked), className: styles['striped-rows'] }, label));
|
|
57
60
|
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
|
+
};
|
|
58
72
|
export const CustomPreference = ({ value, customPreference, onChange }) => {
|
|
59
73
|
const [customState, setCustomState] = useState(value);
|
|
60
74
|
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,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,CAC9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AAC,KAAK,EAChB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,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"]}
|
|
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;IACT,WAAW;IACX,cAAc;IACd,cAAc;IACd,cAAc;IACd,aAAa;IACb,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;IAC9B,MAAM,SAAS,GAAyB;QACtC,UAAU;QACV,WAAW;QACX,aAAa;QACb,gBAAgB;QAChB,gBAAgB;QAChB,QAAQ;QACR,gBAAgB;QAChB,eAAe;KAChB,CAAC;IACF,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE;QAChC,IAAI,OAAO,CAAC,QAAQ,CAAC,KAA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ourcesContent":["// 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"]}
|