@cloudscape-design/components-themeable 3.0.785 → 3.0.787
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/app-layout/test-classes/styles.scss +3 -0
- package/lib/internal/scss/app-layout/visual-refresh-toolbar/drawer/styles.scss +40 -0
- package/lib/internal/scss/app-layout/visual-refresh-toolbar/skeleton/styles.scss +27 -9
- package/lib/internal/scss/collection-preferences/analytics-metadata/styles.scss +8 -0
- package/lib/internal/scss/collection-preferences/content-display/styles.scss +3 -1
- package/lib/internal/scss/date-range-picker/styles.scss +0 -4
- package/lib/internal/scss/flashbar/styles.scss +8 -0
- package/lib/internal/scss/internal/components/drag-handle/styles.scss +4 -0
- package/lib/internal/scss/internal/styles/forms/mixins.scss +0 -7
- package/lib/internal/scss/prompt-input/styles.scss +34 -127
- package/lib/internal/scss/prompt-input/test-classes/styles.scss +0 -8
- package/lib/internal/scss/steps/styles.scss +53 -0
- package/lib/internal/scss/wizard/analytics-metadata/styles.scss +8 -0
- package/lib/internal/template/app-layout/drawer/index.js.map +1 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts +6 -2
- package/lib/internal/template/app-layout/drawer/overflow-menu.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer/overflow-menu.js +22 -8
- package/lib/internal/template/app-layout/drawer/overflow-menu.js.map +1 -1
- package/lib/internal/template/app-layout/interfaces.d.ts +2 -1
- package/lib/internal/template/app-layout/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/mobile-toolbar/index.js.map +1 -1
- package/lib/internal/template/app-layout/runtime-api.d.ts +4 -3
- package/lib/internal/template/app-layout/runtime-api.d.ts.map +1 -1
- package/lib/internal/template/app-layout/runtime-api.js +15 -11
- package/lib/internal/template/app-layout/runtime-api.js.map +1 -1
- package/lib/internal/template/app-layout/test-classes/styles.css.js +20 -19
- package/lib/internal/template/app-layout/test-classes/styles.scoped.css +23 -19
- package/lib/internal/template/app-layout/test-classes/styles.selectors.js +20 -19
- package/lib/internal/template/app-layout/utils/use-drawers.d.ts +12 -1
- package/lib/internal/template/app-layout/utils/use-drawers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-drawers.js +125 -20
- package/lib/internal/template/app-layout/utils/use-drawers.js.map +1 -1
- package/lib/internal/template/app-layout/utils/use-focus-control.d.ts +10 -0
- package/lib/internal/template/app-layout/utils/use-focus-control.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-focus-control.js +60 -1
- package/lib/internal/template/app-layout/utils/use-focus-control.js.map +1 -1
- package/lib/internal/template/app-layout/utils/visibility-context.d.ts +3 -0
- package/lib/internal/template/app-layout/utils/visibility-context.d.ts.map +1 -0
- package/lib/internal/template/app-layout/utils/visibility-context.js +5 -0
- package/lib/internal/template/app-layout/utils/visibility-context.js.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh/drawers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.d.ts +5 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.js +15 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts +15 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +71 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawers.d.ts +6 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawers.js +15 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +35 -23
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +10 -6
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +28 -6
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +10 -6
- package/lib/internal/template/app-layout/visual-refresh-toolbar/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js +60 -6
- package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts +10 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts +3 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js +3 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +17 -16
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +50 -32
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +17 -16
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts +6 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +34 -10
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts +5 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +17 -13
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
- package/lib/internal/template/collection-preferences/analytics-metadata/interfaces.d.ts +43 -0
- package/lib/internal/template/collection-preferences/analytics-metadata/interfaces.d.ts.map +1 -0
- package/lib/internal/template/collection-preferences/analytics-metadata/interfaces.js +4 -0
- package/lib/internal/template/collection-preferences/analytics-metadata/interfaces.js.map +1 -0
- package/lib/internal/template/collection-preferences/analytics-metadata/styles.css.js +6 -0
- package/lib/internal/template/collection-preferences/analytics-metadata/styles.scoped.css +7 -0
- package/lib/internal/template/collection-preferences/analytics-metadata/styles.selectors.js +7 -0
- package/lib/internal/template/collection-preferences/analytics-metadata/utils.d.ts +9 -0
- package/lib/internal/template/collection-preferences/analytics-metadata/utils.d.ts.map +1 -0
- package/lib/internal/template/collection-preferences/analytics-metadata/utils.js +48 -0
- package/lib/internal/template/collection-preferences/analytics-metadata/utils.js.map +1 -0
- package/lib/internal/template/collection-preferences/content-display/content-display-option.d.ts +1 -0
- package/lib/internal/template/collection-preferences/content-display/content-display-option.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/content-display-option.js +2 -2
- package/lib/internal/template/collection-preferences/content-display/content-display-option.js.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/draggable-option.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/draggable-option.js +2 -2
- package/lib/internal/template/collection-preferences/content-display/draggable-option.js.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/index.d.ts +1 -1
- package/lib/internal/template/collection-preferences/content-display/index.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/index.js +21 -7
- package/lib/internal/template/collection-preferences/content-display/index.js.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/styles.css.js +13 -11
- package/lib/internal/template/collection-preferences/content-display/styles.scoped.css +19 -17
- package/lib/internal/template/collection-preferences/content-display/styles.selectors.js +13 -11
- package/lib/internal/template/collection-preferences/index.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/index.js +21 -15
- package/lib/internal/template/collection-preferences/index.js.map +1 -1
- package/lib/internal/template/collection-preferences/interfaces.d.ts +29 -0
- 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 +39 -37
- package/lib/internal/template/collection-preferences/styles.scoped.css +46 -44
- package/lib/internal/template/collection-preferences/styles.selectors.js +39 -37
- package/lib/internal/template/collection-preferences/utils.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/utils.js +12 -13
- package/lib/internal/template/collection-preferences/utils.js.map +1 -1
- package/lib/internal/template/collection-preferences/visible-content.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/visible-content.js +2 -1
- package/lib/internal/template/collection-preferences/visible-content.js.map +1 -1
- package/lib/internal/template/date-range-picker/index.d.ts.map +1 -1
- package/lib/internal/template/date-range-picker/index.js +9 -10
- package/lib/internal/template/date-range-picker/index.js.map +1 -1
- package/lib/internal/template/date-range-picker/styles.css.js +38 -39
- package/lib/internal/template/date-range-picker/styles.scoped.css +47 -51
- package/lib/internal/template/date-range-picker/styles.selectors.js +38 -39
- package/lib/internal/template/flashbar/styles.css.js +50 -50
- package/lib/internal/template/flashbar/styles.scoped.css +156 -149
- package/lib/internal/template/flashbar/styles.selectors.js +50 -50
- package/lib/internal/template/i18n/messages/all.all.js +1 -1
- package/lib/internal/template/i18n/messages/all.all.json +1 -1
- package/lib/internal/template/i18n/messages/all.ar.js +1 -1
- package/lib/internal/template/i18n/messages/all.ar.json +1 -1
- package/lib/internal/template/i18n/messages/all.de.js +1 -1
- package/lib/internal/template/i18n/messages/all.de.json +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.js +1 -1
- package/lib/internal/template/i18n/messages/all.en-GB.json +1 -1
- package/lib/internal/template/i18n/messages/all.en.js +1 -1
- package/lib/internal/template/i18n/messages/all.en.json +1 -1
- package/lib/internal/template/i18n/messages/all.es.js +1 -1
- package/lib/internal/template/i18n/messages/all.es.json +1 -1
- package/lib/internal/template/i18n/messages/all.fr.js +1 -1
- package/lib/internal/template/i18n/messages/all.fr.json +1 -1
- package/lib/internal/template/i18n/messages/all.id.js +1 -1
- package/lib/internal/template/i18n/messages/all.id.json +1 -1
- package/lib/internal/template/i18n/messages/all.it.js +1 -1
- package/lib/internal/template/i18n/messages/all.it.json +1 -1
- package/lib/internal/template/i18n/messages/all.ja.js +1 -1
- package/lib/internal/template/i18n/messages/all.ja.json +1 -1
- package/lib/internal/template/i18n/messages/all.ko.js +1 -1
- package/lib/internal/template/i18n/messages/all.ko.json +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.js +1 -1
- package/lib/internal/template/i18n/messages/all.pt-BR.json +1 -1
- package/lib/internal/template/i18n/messages/all.tr.js +1 -1
- package/lib/internal/template/i18n/messages/all.tr.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-CN.json +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.js +1 -1
- package/lib/internal/template/i18n/messages/all.zh-TW.json +1 -1
- package/lib/internal/template/i18n/messages-types.d.ts +7 -0
- package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
- package/lib/internal/template/i18n/messages-types.js.map +1 -1
- package/lib/internal/template/index.d.ts +1 -0
- package/lib/internal/template/index.d.ts.map +1 -1
- package/lib/internal/template/index.js +1 -0
- package/lib/internal/template/index.js.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.d.ts +1 -0
- package/lib/internal/template/internal/analytics/interfaces.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/interfaces.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.d.ts +2 -1
- package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.js +3 -3
- package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/styles.css.js +2 -1
- package/lib/internal/template/internal/components/drag-handle/styles.scoped.css +6 -2
- package/lib/internal/template/internal/components/drag-handle/styles.selectors.js +2 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/internal/hooks/use-component-analytics/index.d.ts +7 -1
- package/lib/internal/template/internal/hooks/use-component-analytics/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-component-analytics/index.js +21 -4
- package/lib/internal/template/internal/hooks/use-component-analytics/index.js.map +1 -1
- package/lib/internal/template/internal/plugins/controllers/drawers.d.ts +19 -2
- package/lib/internal/template/internal/plugins/controllers/drawers.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/controllers/drawers.js +34 -2
- package/lib/internal/template/internal/plugins/controllers/drawers.js.map +1 -1
- package/lib/internal/template/internal/plugins/helpers/runtime-content-wrapper.d.ts +4 -2
- package/lib/internal/template/internal/plugins/helpers/runtime-content-wrapper.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/helpers/runtime-content-wrapper.js +19 -4
- package/lib/internal/template/internal/plugins/helpers/runtime-content-wrapper.js.map +1 -1
- package/lib/internal/template/modal/internal.d.ts +1 -0
- package/lib/internal/template/modal/internal.d.ts.map +1 -1
- package/lib/internal/template/modal/internal.js +2 -2
- package/lib/internal/template/modal/internal.js.map +1 -1
- package/lib/internal/template/package.json +1 -0
- package/lib/internal/template/prompt-input/interfaces.d.ts +0 -16
- package/lib/internal/template/prompt-input/interfaces.d.ts.map +1 -1
- package/lib/internal/template/prompt-input/interfaces.js.map +1 -1
- package/lib/internal/template/prompt-input/internal.d.ts.map +1 -1
- package/lib/internal/template/prompt-input/internal.js +11 -28
- package/lib/internal/template/prompt-input/internal.js.map +1 -1
- package/lib/internal/template/prompt-input/styles.css.js +8 -14
- package/lib/internal/template/prompt-input/styles.scoped.css +68 -264
- package/lib/internal/template/prompt-input/styles.selectors.js +8 -14
- package/lib/internal/template/prompt-input/test-classes/styles.css.js +3 -5
- package/lib/internal/template/prompt-input/test-classes/styles.scoped.css +3 -11
- package/lib/internal/template/prompt-input/test-classes/styles.selectors.js +3 -5
- package/lib/internal/template/steps/index.d.ts +6 -0
- package/lib/internal/template/steps/index.d.ts.map +1 -0
- package/lib/internal/template/steps/index.js +19 -0
- package/lib/internal/template/steps/index.js.map +1 -0
- package/lib/internal/template/steps/interfaces.d.ts +40 -0
- package/lib/internal/template/steps/interfaces.d.ts.map +1 -0
- package/lib/internal/template/steps/interfaces.js +2 -0
- package/lib/internal/template/steps/interfaces.js.map +1 -0
- package/lib/internal/template/steps/internal.d.ts +8 -0
- package/lib/internal/template/steps/internal.d.ts.map +1 -0
- package/lib/internal/template/steps/internal.js +21 -0
- package/lib/internal/template/steps/internal.js.map +1 -0
- package/lib/internal/template/steps/styles.css.js +11 -0
- package/lib/internal/template/steps/styles.scoped.css +247 -0
- package/lib/internal/template/steps/styles.selectors.js +12 -0
- package/lib/internal/template/table/internal.d.ts.map +1 -1
- package/lib/internal/template/table/internal.js +2 -2
- package/lib/internal/template/table/internal.js.map +1 -1
- package/lib/internal/template/test-utils/dom/collection-preferences/content-display-preference.d.ts +9 -0
- package/lib/internal/template/test-utils/dom/collection-preferences/content-display-preference.js +13 -0
- package/lib/internal/template/test-utils/dom/collection-preferences/content-display-preference.js.map +1 -1
- package/lib/internal/template/test-utils/dom/index.d.ts +3 -0
- package/lib/internal/template/test-utils/dom/index.js +9 -1
- package/lib/internal/template/test-utils/dom/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/prompt-input/index.d.ts +0 -2
- package/lib/internal/template/test-utils/dom/prompt-input/index.js +0 -6
- package/lib/internal/template/test-utils/dom/prompt-input/index.js.map +1 -1
- package/lib/internal/template/test-utils/dom/steps/index.d.ts +18 -0
- package/lib/internal/template/test-utils/dom/steps/index.js +33 -0
- package/lib/internal/template/test-utils/dom/steps/index.js.map +1 -0
- package/lib/internal/template/test-utils/selectors/collection-preferences/content-display-preference.d.ts +9 -0
- package/lib/internal/template/test-utils/selectors/collection-preferences/content-display-preference.js +13 -0
- package/lib/internal/template/test-utils/selectors/collection-preferences/content-display-preference.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/index.d.ts +3 -0
- package/lib/internal/template/test-utils/selectors/index.js +9 -1
- package/lib/internal/template/test-utils/selectors/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/prompt-input/index.d.ts +0 -2
- package/lib/internal/template/test-utils/selectors/prompt-input/index.js +0 -6
- package/lib/internal/template/test-utils/selectors/prompt-input/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/steps/index.d.ts +18 -0
- package/lib/internal/template/test-utils/selectors/steps/index.js +33 -0
- package/lib/internal/template/test-utils/selectors/steps/index.js.map +1 -0
- package/lib/internal/template/test-utils/tsconfig.tsbuildinfo +1 -1
- package/lib/internal/template/wizard/analytics-metadata/interfaces.d.ts +35 -0
- package/lib/internal/template/wizard/analytics-metadata/interfaces.d.ts.map +1 -0
- package/lib/internal/template/wizard/analytics-metadata/interfaces.js +4 -0
- package/lib/internal/template/wizard/analytics-metadata/interfaces.js.map +1 -0
- package/lib/internal/template/wizard/analytics-metadata/styles.css.js +6 -0
- package/lib/internal/template/wizard/analytics-metadata/styles.scoped.css +7 -0
- package/lib/internal/template/wizard/analytics-metadata/styles.selectors.js +7 -0
- package/lib/internal/template/wizard/analytics-metadata/utils.d.ts +7 -0
- package/lib/internal/template/wizard/analytics-metadata/utils.d.ts.map +1 -0
- package/lib/internal/template/wizard/analytics-metadata/utils.js +14 -0
- package/lib/internal/template/wizard/analytics-metadata/utils.js.map +1 -0
- package/lib/internal/template/wizard/index.d.ts.map +1 -1
- package/lib/internal/template/wizard/index.js +1 -1
- package/lib/internal/template/wizard/index.js.map +1 -1
- package/lib/internal/template/wizard/internal.d.ts +4 -2
- package/lib/internal/template/wizard/internal.d.ts.map +1 -1
- package/lib/internal/template/wizard/internal.js +14 -3
- package/lib/internal/template/wizard/internal.js.map +1 -1
- package/lib/internal/template/wizard/wizard-actions.d.ts +4 -1
- package/lib/internal/template/wizard/wizard-actions.d.ts.map +1 -1
- package/lib/internal/template/wizard/wizard-actions.js +9 -5
- package/lib/internal/template/wizard/wizard-actions.js.map +1 -1
- package/lib/internal/template/wizard/wizard-form.d.ts.map +1 -1
- package/lib/internal/template/wizard/wizard-form.js +1 -1
- package/lib/internal/template/wizard/wizard-form.js.map +1 -1
- package/lib/internal/template/wizard/wizard-navigation.d.ts.map +1 -1
- package/lib/internal/template/wizard/wizard-navigation.js +12 -6
- package/lib/internal/template/wizard/wizard-navigation.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/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';\nimport { BaseModalProps } from '../modal/interfaces';\n\nexport interface CollectionPreferencesProps<CustomPreferenceType = any> extends BaseComponentProps, BaseModalProps {\n /**\n * Specifies the title of the preferences modal dialog. It is also used as an `aria-label` for the trigger button.\n * @i18n\n */\n title?: string;\n /**\n * Label of the confirm button in the modal footer.\n * @i18n\n */\n confirmLabel?: string;\n /**\n * Label of the cancel button in the modal footer.\n * @i18n\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 * @i18n\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 * @i18n\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 * @i18n\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 * @i18n\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 * Cannot be used together with `visibleContentPreference`.\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 * @i18n\n */\n contentDisplayPreference?: CollectionPreferencesProps.ContentDisplayPreference;\n /**\n * Configures the built-in \"visible content selection\" preference (for example, visible sections in cards).\n *\n * If you set it, the component displays this preference in the modal.\n * Cannot be used together with `contentDisplayPreference`.\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 * **Deprecated** in table, replaced by `contentDisplayPreference`.\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 * - `contentDensity` (boolean) - (Optional) The current content density preference value. Available only if you specify the `contentDensityPreference` property.\n * - `contentDisplay` (ReadonlyArray<ContentDisplayItem>) - (Optional) The ordered list of table columns and their visibility. Available only if you specify the `contentDisplayPreference` property.\n * - `custom` (CustomPreferenceType) - (Optional) The selected value for your custom preference.\n * - `pageSize` (number) - (Optional) The selected page size value. Available only if you specify the `pageSizePreference` property.\n * - `stickyColumns` (CollectionPreferencesProps.StickyColumns) - (Optional) The current sticky columns preference value. Available only if you specify the `stickyColumnsPreference` property.\n * - `stripedRows` (boolean) - (Optional) The current striped rows preference value. Available only if you specify the `stripedRowsPreference` property.\n * - `visibleContent` (ReadonlyArray<string>) - (Optional) The list of selected content `id`s. Available only if you specify the `visibleContentPreference` property.\n * - `wrapLines` (boolean) - (Optional) The current line wrapping preference value. Available only if you specify the `wrapLinesPreference` property.\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":"","sources":["../../../src/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';\nimport { BaseModalProps } from '../modal/interfaces';\n\nexport interface CollectionPreferencesProps<CustomPreferenceType = any> extends BaseComponentProps, BaseModalProps {\n /**\n * Specifies the title of the preferences modal dialog. It is also used as an `aria-label` for the trigger button.\n * @i18n\n */\n title?: string;\n /**\n * Label of the confirm button in the modal footer.\n * @i18n\n */\n confirmLabel?: string;\n /**\n * Label of the cancel button in the modal footer.\n * @i18n\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 * @i18n\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 * @i18n\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 * @i18n\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 * @i18n\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 * Cannot be used together with `visibleContentPreference`.\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 * @i18n\n */\n contentDisplayPreference?: CollectionPreferencesProps.ContentDisplayPreference;\n /**\n * Configures the built-in \"visible content selection\" preference (for example, visible sections in cards).\n *\n * If you set it, the component displays this preference in the modal.\n * Cannot be used together with `contentDisplayPreference`.\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 * **Deprecated** in table, replaced by `contentDisplayPreference`.\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 * - `contentDensity` (boolean) - (Optional) The current content density preference value. Available only if you specify the `contentDensityPreference` property.\n * - `contentDisplay` (ReadonlyArray<ContentDisplayItem>) - (Optional) The ordered list of table columns and their visibility. Available only if you specify the `contentDisplayPreference` property.\n * - `custom` (CustomPreferenceType) - (Optional) The selected value for your custom preference.\n * - `pageSize` (number) - (Optional) The selected page size value. Available only if you specify the `pageSizePreference` property.\n * - `stickyColumns` (CollectionPreferencesProps.StickyColumns) - (Optional) The current sticky columns preference value. Available only if you specify the `stickyColumnsPreference` property.\n * - `stripedRows` (boolean) - (Optional) The current striped rows preference value. Available only if you specify the `stripedRowsPreference` property.\n * - `visibleContent` (ReadonlyArray<string>) - (Optional) The list of selected content `id`s. Available only if you specify the `visibleContentPreference` property.\n * - `wrapLines` (boolean) - (Optional) The current line wrapping preference value. Available only if you specify the `wrapLinesPreference` property.\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 enableColumnFiltering?: boolean;\n i18nStrings?: ContentDisplayPreferenceI18nStrings;\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 export interface ContentDisplayPreferenceI18nStrings {\n /**\n * Specifies a `placeholder` for the filtering input.\n * @i18n\n */\n columnFilteringPlaceholder?: string;\n\n /**\n * Specifies an `aria-label` for the filtering input.\n * @i18n\n */\n columnFilteringAriaLabel?: string;\n\n /**\n * Specifies the `count text` for the filtering input to reflect matches found.\n * @i18n\n */\n columnFilteringCountText?: (count: number) => string;\n\n /**\n * Specifies the `no match` text for when there are no matching options in the filtering.\n * @i18n\n */\n columnFilteringNoMatchText?: string;\n\n /**\n * Specifies both an `aria-label` for the clear filtering input action and the `clear filter button` text for the no match button.\n * @i18n\n */\n columnFilteringClearFilterText?: string;\n }\n}\n"]}
|
|
@@ -1,42 +1,44 @@
|
|
|
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-
|
|
21
|
-
"content-display-
|
|
22
|
-
"content-display-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"page-size
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"sticky-columns
|
|
39
|
-
"sticky-columns-
|
|
40
|
-
"sticky-columns-
|
|
4
|
+
"visible-content": "awsui_visible-content_tc96w_zaew1_281",
|
|
5
|
+
"visible-content-toggle": "awsui_visible-content-toggle_tc96w_zaew1_282",
|
|
6
|
+
"visible-content-groups": "awsui_visible-content-groups_tc96w_zaew1_283",
|
|
7
|
+
"visible-content-group": "awsui_visible-content-group_tc96w_zaew1_283",
|
|
8
|
+
"visible-content-title": "awsui_visible-content-title_tc96w_zaew1_288",
|
|
9
|
+
"visible-content-group-label": "awsui_visible-content-group-label_tc96w_zaew1_298",
|
|
10
|
+
"visible-content-option": "awsui_visible-content-option_tc96w_zaew1_304",
|
|
11
|
+
"visible-content-option-label": "awsui_visible-content-option-label_tc96w_zaew1_317",
|
|
12
|
+
"content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_zaew1_604",
|
|
13
|
+
"content-display-option-content": "awsui_content-display-option-content_tc96w_zaew1_608",
|
|
14
|
+
"content-display-option": "awsui_content-display-option_tc96w_zaew1_604",
|
|
15
|
+
"placeholder": "awsui_placeholder_tc96w_zaew1_658",
|
|
16
|
+
"sorting": "awsui_sorting_tc96w_zaew1_658",
|
|
17
|
+
"content-display-option-label": "awsui_content-display-option-label_tc96w_zaew1_685",
|
|
18
|
+
"drag-overlay": "awsui_drag-overlay_tc96w_zaew1_692",
|
|
19
|
+
"content-display": "awsui_content-display_tc96w_zaew1_604",
|
|
20
|
+
"content-display-text-filter": "awsui_content-display-text-filter_tc96w_zaew1_722",
|
|
21
|
+
"content-display-no-match": "awsui_content-display-no-match_tc96w_zaew1_723",
|
|
22
|
+
"content-display-title": "awsui_content-display-title_tc96w_zaew1_727",
|
|
23
|
+
"content-display-description": "awsui_content-display-description_tc96w_zaew1_736",
|
|
24
|
+
"content-display-option-list": "awsui_content-display-option-list_tc96w_zaew1_744",
|
|
25
|
+
"root": "awsui_root_tc96w_zaew1_751",
|
|
26
|
+
"modal-root": "awsui_modal-root_tc96w_zaew1_752",
|
|
27
|
+
"trigger-button": "awsui_trigger-button_tc96w_zaew1_753",
|
|
28
|
+
"cancel-button": "awsui_cancel-button_tc96w_zaew1_754",
|
|
29
|
+
"confirm-button": "awsui_confirm-button_tc96w_zaew1_755",
|
|
30
|
+
"custom": "awsui_custom_tc96w_zaew1_756",
|
|
31
|
+
"second-column-small": "awsui_second-column-small_tc96w_zaew1_760",
|
|
32
|
+
"wrap-lines": "awsui_wrap-lines_tc96w_zaew1_764",
|
|
33
|
+
"striped-rows": "awsui_striped-rows_tc96w_zaew1_765",
|
|
34
|
+
"content-density": "awsui_content-density_tc96w_zaew1_766",
|
|
35
|
+
"page-size": "awsui_page-size_tc96w_zaew1_767",
|
|
36
|
+
"page-size-form-field": "awsui_page-size-form-field_tc96w_zaew1_768",
|
|
37
|
+
"page-size-radio-group": "awsui_page-size-radio-group_tc96w_zaew1_769",
|
|
38
|
+
"sticky-columns": "awsui_sticky-columns_tc96w_zaew1_770",
|
|
39
|
+
"sticky-columns-form-field": "awsui_sticky-columns-form-field_tc96w_zaew1_771",
|
|
40
|
+
"sticky-columns-radio-group": "awsui_sticky-columns-radio-group_tc96w_zaew1_772",
|
|
41
|
+
"sticky-columns-first": "awsui_sticky-columns-first_tc96w_zaew1_773",
|
|
42
|
+
"sticky-columns-last": "awsui_sticky-columns-last_tc96w_zaew1_774"
|
|
41
43
|
};
|
|
42
44
|
|
|
@@ -278,14 +278,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
278
278
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
279
279
|
SPDX-License-Identifier: Apache-2.0
|
|
280
280
|
*/
|
|
281
|
-
.awsui_visible-
|
|
282
|
-
.awsui_visible-content-
|
|
283
|
-
.awsui_visible-content-
|
|
284
|
-
.awsui_visible-content-
|
|
281
|
+
.awsui_visible-content_tc96w_zaew1_281:not(#\9),
|
|
282
|
+
.awsui_visible-content-toggle_tc96w_zaew1_282:not(#\9),
|
|
283
|
+
.awsui_visible-content-groups_tc96w_zaew1_283:not(#\9),
|
|
284
|
+
.awsui_visible-content-group_tc96w_zaew1_283:not(#\9) {
|
|
285
285
|
/* used in test-utils */
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
.awsui_visible-content-
|
|
288
|
+
.awsui_visible-content-title_tc96w_zaew1_288:not(#\9) {
|
|
289
289
|
font-size: var(--font-size-body-m-6wxxs5, 14px);
|
|
290
290
|
line-height: var(--line-height-body-m-gw0130, 22px);
|
|
291
291
|
font-weight: var(--font-display-label-weight-5p8eav, 400);
|
|
@@ -295,13 +295,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
295
295
|
margin-inline: 0;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
.awsui_visible-content-group-
|
|
298
|
+
.awsui_visible-content-group-label_tc96w_zaew1_298:not(#\9) {
|
|
299
299
|
color: var(--color-text-group-label-eorpbe, #545b64);
|
|
300
300
|
padding-block-end: var(--space-xs-6dgkww, 8px);
|
|
301
301
|
border-block-end: var(--border-divider-list-width-x6rz7e, 1px) solid var(--color-border-divider-secondary-1xu6lb, #eaeded);
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
.awsui_visible-content-
|
|
304
|
+
.awsui_visible-content-option_tc96w_zaew1_304:not(#\9) {
|
|
305
305
|
display: flex;
|
|
306
306
|
flex-wrap: nowrap;
|
|
307
307
|
justify-content: space-between;
|
|
@@ -310,11 +310,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
310
310
|
padding-inline-end: 0px;
|
|
311
311
|
border-block-end: var(--border-divider-list-width-x6rz7e, 1px) solid var(--color-border-divider-secondary-1xu6lb, #eaeded);
|
|
312
312
|
}
|
|
313
|
-
.awsui_visible-content-
|
|
313
|
+
.awsui_visible-content-option_tc96w_zaew1_304:not(#\9):last-child {
|
|
314
314
|
border-block-end: none;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
.awsui_visible-content-option-
|
|
317
|
+
.awsui_visible-content-option-label_tc96w_zaew1_317:not(#\9) {
|
|
318
318
|
overflow: hidden;
|
|
319
319
|
text-overflow: ellipsis;
|
|
320
320
|
padding-inline-end: var(--space-l-eenfqd, 20px);
|
|
@@ -601,11 +601,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
601
601
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
602
602
|
SPDX-License-Identifier: Apache-2.0
|
|
603
603
|
*/
|
|
604
|
-
.awsui_content-display-option-
|
|
604
|
+
.awsui_content-display-option-toggle_tc96w_zaew1_604:not(#\9) {
|
|
605
605
|
/* used in test-utils */
|
|
606
606
|
}
|
|
607
607
|
|
|
608
|
-
.awsui_content-display-option-
|
|
608
|
+
.awsui_content-display-option-content_tc96w_zaew1_608:not(#\9) {
|
|
609
609
|
border-collapse: separate;
|
|
610
610
|
border-spacing: 0;
|
|
611
611
|
box-sizing: border-box;
|
|
@@ -651,28 +651,28 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
651
651
|
border-end-end-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
652
652
|
}
|
|
653
653
|
|
|
654
|
-
.awsui_content-display-
|
|
654
|
+
.awsui_content-display-option_tc96w_zaew1_604:not(#\9) {
|
|
655
655
|
list-style: none;
|
|
656
656
|
position: relative;
|
|
657
657
|
border-block-start: var(--border-divider-list-width-x6rz7e, 1px) solid var(--color-border-divider-secondary-1xu6lb, #eaeded);
|
|
658
658
|
}
|
|
659
|
-
.awsui_content-display-
|
|
659
|
+
.awsui_content-display-option_tc96w_zaew1_604:not(#\9):not(.awsui_placeholder_tc96w_zaew1_658).awsui_sorting_tc96w_zaew1_658 {
|
|
660
660
|
transition: transform var(--motion-duration-transition-quick-1ym1ir, 90ms) var(--motion-easing-transition-quick-c2tqbv, linear);
|
|
661
661
|
}
|
|
662
662
|
@media (prefers-reduced-motion: reduce) {
|
|
663
|
-
.awsui_content-display-
|
|
663
|
+
.awsui_content-display-option_tc96w_zaew1_604:not(#\9):not(.awsui_placeholder_tc96w_zaew1_658).awsui_sorting_tc96w_zaew1_658 {
|
|
664
664
|
animation: none;
|
|
665
665
|
transition: none;
|
|
666
666
|
}
|
|
667
667
|
}
|
|
668
|
-
.awsui-motion-disabled .awsui_content-display-
|
|
668
|
+
.awsui-motion-disabled .awsui_content-display-option_tc96w_zaew1_604:not(#\9):not(.awsui_placeholder_tc96w_zaew1_658).awsui_sorting_tc96w_zaew1_658, .awsui-mode-entering .awsui_content-display-option_tc96w_zaew1_604:not(#\9):not(.awsui_placeholder_tc96w_zaew1_658).awsui_sorting_tc96w_zaew1_658 {
|
|
669
669
|
animation: none;
|
|
670
670
|
transition: none;
|
|
671
671
|
}
|
|
672
|
-
.awsui_content-display-
|
|
672
|
+
.awsui_content-display-option_tc96w_zaew1_604.awsui_placeholder_tc96w_zaew1_658 > .awsui_content-display-option-content_tc96w_zaew1_608:not(#\9) {
|
|
673
673
|
position: relative;
|
|
674
674
|
}
|
|
675
|
-
.awsui_content-display-
|
|
675
|
+
.awsui_content-display-option_tc96w_zaew1_604.awsui_placeholder_tc96w_zaew1_658 > .awsui_content-display-option-content_tc96w_zaew1_608:not(#\9):after {
|
|
676
676
|
content: " ";
|
|
677
677
|
position: absolute;
|
|
678
678
|
inset: 0;
|
|
@@ -683,28 +683,28 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
683
683
|
border-end-end-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
684
684
|
}
|
|
685
685
|
|
|
686
|
-
.awsui_content-display-option-
|
|
686
|
+
.awsui_content-display-option-label_tc96w_zaew1_685:not(#\9) {
|
|
687
687
|
flex-grow: 1;
|
|
688
688
|
min-inline-size: 0;
|
|
689
689
|
word-break: break-word;
|
|
690
690
|
padding-inline-end: var(--space-l-eenfqd, 20px);
|
|
691
691
|
}
|
|
692
692
|
|
|
693
|
-
.awsui_drag-
|
|
693
|
+
.awsui_drag-overlay_tc96w_zaew1_692:not(#\9) {
|
|
694
694
|
box-shadow: var(--shadow-container-active-b0dn3h, 0px 4px 8px rgba(0, 28, 36, 0.45));
|
|
695
695
|
border-start-start-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
696
696
|
border-start-end-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
697
697
|
border-end-start-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
698
698
|
border-end-end-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
699
699
|
}
|
|
700
|
-
body[data-awsui-focus-visible=true] .awsui_drag-
|
|
700
|
+
body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_zaew1_692:not(#\9) {
|
|
701
701
|
position: relative;
|
|
702
702
|
}
|
|
703
|
-
body[data-awsui-focus-visible=true] .awsui_drag-
|
|
703
|
+
body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_zaew1_692:not(#\9) {
|
|
704
704
|
outline: 2px dotted transparent;
|
|
705
705
|
outline-offset: calc(0px - 1px);
|
|
706
706
|
}
|
|
707
|
-
body[data-awsui-focus-visible=true] .awsui_drag-
|
|
707
|
+
body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_zaew1_692:not(#\9)::before {
|
|
708
708
|
content: " ";
|
|
709
709
|
display: block;
|
|
710
710
|
position: absolute;
|
|
@@ -719,11 +719,13 @@ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1dvoj_692:not(#\9)
|
|
|
719
719
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-q68bgg, #0073bb);
|
|
720
720
|
}
|
|
721
721
|
|
|
722
|
-
.awsui_content-
|
|
722
|
+
.awsui_content-display_tc96w_zaew1_604:not(#\9),
|
|
723
|
+
.awsui_content-display-text-filter_tc96w_zaew1_722:not(#\9),
|
|
724
|
+
.awsui_content-display-no-match_tc96w_zaew1_723:not(#\9) {
|
|
723
725
|
/* used in test-utils */
|
|
724
726
|
}
|
|
725
727
|
|
|
726
|
-
.awsui_content-display-
|
|
728
|
+
.awsui_content-display-title_tc96w_zaew1_727:not(#\9) {
|
|
727
729
|
font-size: var(--font-size-body-m-6wxxs5, 14px);
|
|
728
730
|
line-height: var(--line-height-body-m-gw0130, 22px);
|
|
729
731
|
font-weight: var(--font-display-label-weight-5p8eav, 400);
|
|
@@ -732,7 +734,7 @@ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1dvoj_692:not(#\9)
|
|
|
732
734
|
margin-inline: 0;
|
|
733
735
|
}
|
|
734
736
|
|
|
735
|
-
.awsui_content-display-
|
|
737
|
+
.awsui_content-display-description_tc96w_zaew1_736:not(#\9) {
|
|
736
738
|
color: var(--color-text-form-secondary-5q4khe, #687078);
|
|
737
739
|
font-size: var(--font-size-body-s-4dzx5q, 12px);
|
|
738
740
|
line-height: var(--line-height-body-s-egzl4q, 16px);
|
|
@@ -740,36 +742,36 @@ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1dvoj_692:not(#\9)
|
|
|
740
742
|
margin-block-start: var(--space-scaled-xxxs-6vyqo7, 2px);
|
|
741
743
|
}
|
|
742
744
|
|
|
743
|
-
.awsui_content-display-option-
|
|
745
|
+
.awsui_content-display-option-list_tc96w_zaew1_744:not(#\9) {
|
|
744
746
|
position: relative;
|
|
745
747
|
list-style: none;
|
|
746
748
|
padding-block: 0;
|
|
747
749
|
padding-inline: 0;
|
|
748
750
|
}
|
|
749
751
|
|
|
750
|
-
.
|
|
751
|
-
.awsui_modal-
|
|
752
|
-
.awsui_trigger-
|
|
753
|
-
.awsui_cancel-
|
|
754
|
-
.awsui_confirm-
|
|
755
|
-
.
|
|
752
|
+
.awsui_root_tc96w_zaew1_751:not(#\9),
|
|
753
|
+
.awsui_modal-root_tc96w_zaew1_752:not(#\9),
|
|
754
|
+
.awsui_trigger-button_tc96w_zaew1_753:not(#\9),
|
|
755
|
+
.awsui_cancel-button_tc96w_zaew1_754:not(#\9),
|
|
756
|
+
.awsui_confirm-button_tc96w_zaew1_755:not(#\9),
|
|
757
|
+
.awsui_custom_tc96w_zaew1_756:not(#\9) {
|
|
756
758
|
/* used in test-utils */
|
|
757
759
|
}
|
|
758
760
|
|
|
759
|
-
.awsui_second-column-
|
|
761
|
+
.awsui_second-column-small_tc96w_zaew1_760:not(#\9) {
|
|
760
762
|
padding-block-start: calc(2 * var(--space-scaled-l-7e51pg, 20px));
|
|
761
763
|
}
|
|
762
764
|
|
|
763
|
-
.awsui_wrap-
|
|
764
|
-
.awsui_striped-
|
|
765
|
-
.awsui_content-
|
|
766
|
-
.awsui_page-
|
|
767
|
-
.awsui_page-size-form-
|
|
768
|
-
.awsui_page-size-radio-
|
|
769
|
-
.awsui_sticky-
|
|
770
|
-
.awsui_sticky-columns-form-
|
|
771
|
-
.awsui_sticky-columns-radio-
|
|
772
|
-
.awsui_sticky-columns-
|
|
773
|
-
.awsui_sticky-columns-
|
|
765
|
+
.awsui_wrap-lines_tc96w_zaew1_764:not(#\9),
|
|
766
|
+
.awsui_striped-rows_tc96w_zaew1_765:not(#\9),
|
|
767
|
+
.awsui_content-density_tc96w_zaew1_766:not(#\9),
|
|
768
|
+
.awsui_page-size_tc96w_zaew1_767:not(#\9),
|
|
769
|
+
.awsui_page-size-form-field_tc96w_zaew1_768:not(#\9),
|
|
770
|
+
.awsui_page-size-radio-group_tc96w_zaew1_769:not(#\9),
|
|
771
|
+
.awsui_sticky-columns_tc96w_zaew1_770:not(#\9),
|
|
772
|
+
.awsui_sticky-columns-form-field_tc96w_zaew1_771:not(#\9),
|
|
773
|
+
.awsui_sticky-columns-radio-group_tc96w_zaew1_772:not(#\9),
|
|
774
|
+
.awsui_sticky-columns-first_tc96w_zaew1_773:not(#\9),
|
|
775
|
+
.awsui_sticky-columns-last_tc96w_zaew1_774:not(#\9) {
|
|
774
776
|
/* used in test-utils */
|
|
775
777
|
}
|
|
@@ -2,42 +2,44 @@
|
|
|
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-
|
|
22
|
-
"content-display-
|
|
23
|
-
"content-display-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"page-size
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"sticky-columns
|
|
40
|
-
"sticky-columns-
|
|
41
|
-
"sticky-columns-
|
|
5
|
+
"visible-content": "awsui_visible-content_tc96w_zaew1_281",
|
|
6
|
+
"visible-content-toggle": "awsui_visible-content-toggle_tc96w_zaew1_282",
|
|
7
|
+
"visible-content-groups": "awsui_visible-content-groups_tc96w_zaew1_283",
|
|
8
|
+
"visible-content-group": "awsui_visible-content-group_tc96w_zaew1_283",
|
|
9
|
+
"visible-content-title": "awsui_visible-content-title_tc96w_zaew1_288",
|
|
10
|
+
"visible-content-group-label": "awsui_visible-content-group-label_tc96w_zaew1_298",
|
|
11
|
+
"visible-content-option": "awsui_visible-content-option_tc96w_zaew1_304",
|
|
12
|
+
"visible-content-option-label": "awsui_visible-content-option-label_tc96w_zaew1_317",
|
|
13
|
+
"content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_zaew1_604",
|
|
14
|
+
"content-display-option-content": "awsui_content-display-option-content_tc96w_zaew1_608",
|
|
15
|
+
"content-display-option": "awsui_content-display-option_tc96w_zaew1_604",
|
|
16
|
+
"placeholder": "awsui_placeholder_tc96w_zaew1_658",
|
|
17
|
+
"sorting": "awsui_sorting_tc96w_zaew1_658",
|
|
18
|
+
"content-display-option-label": "awsui_content-display-option-label_tc96w_zaew1_685",
|
|
19
|
+
"drag-overlay": "awsui_drag-overlay_tc96w_zaew1_692",
|
|
20
|
+
"content-display": "awsui_content-display_tc96w_zaew1_604",
|
|
21
|
+
"content-display-text-filter": "awsui_content-display-text-filter_tc96w_zaew1_722",
|
|
22
|
+
"content-display-no-match": "awsui_content-display-no-match_tc96w_zaew1_723",
|
|
23
|
+
"content-display-title": "awsui_content-display-title_tc96w_zaew1_727",
|
|
24
|
+
"content-display-description": "awsui_content-display-description_tc96w_zaew1_736",
|
|
25
|
+
"content-display-option-list": "awsui_content-display-option-list_tc96w_zaew1_744",
|
|
26
|
+
"root": "awsui_root_tc96w_zaew1_751",
|
|
27
|
+
"modal-root": "awsui_modal-root_tc96w_zaew1_752",
|
|
28
|
+
"trigger-button": "awsui_trigger-button_tc96w_zaew1_753",
|
|
29
|
+
"cancel-button": "awsui_cancel-button_tc96w_zaew1_754",
|
|
30
|
+
"confirm-button": "awsui_confirm-button_tc96w_zaew1_755",
|
|
31
|
+
"custom": "awsui_custom_tc96w_zaew1_756",
|
|
32
|
+
"second-column-small": "awsui_second-column-small_tc96w_zaew1_760",
|
|
33
|
+
"wrap-lines": "awsui_wrap-lines_tc96w_zaew1_764",
|
|
34
|
+
"striped-rows": "awsui_striped-rows_tc96w_zaew1_765",
|
|
35
|
+
"content-density": "awsui_content-density_tc96w_zaew1_766",
|
|
36
|
+
"page-size": "awsui_page-size_tc96w_zaew1_767",
|
|
37
|
+
"page-size-form-field": "awsui_page-size-form-field_tc96w_zaew1_768",
|
|
38
|
+
"page-size-radio-group": "awsui_page-size-radio-group_tc96w_zaew1_769",
|
|
39
|
+
"sticky-columns": "awsui_sticky-columns_tc96w_zaew1_770",
|
|
40
|
+
"sticky-columns-form-field": "awsui_sticky-columns-form-field_tc96w_zaew1_771",
|
|
41
|
+
"sticky-columns-radio-group": "awsui_sticky-columns-radio-group_tc96w_zaew1_772",
|
|
42
|
+
"sticky-columns-first": "awsui_sticky-columns-first_tc96w_zaew1_773",
|
|
43
|
+
"sticky-columns-last": "awsui_sticky-columns-last_tc96w_zaew1_774"
|
|
42
44
|
};
|
|
43
45
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/collection-preferences/utils.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/collection-preferences/utils.tsx"],"names":[],"mappings":"AA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ACrD,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CACnC;AAED,eAAO,MAAM,wBAAwB,4CAA6C,6BAA6B,gBAc9G,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"}
|
|
@@ -9,6 +9,7 @@ import { useInternalI18n } from '../i18n/context';
|
|
|
9
9
|
import { useContainerBreakpoints } from '../internal/hooks/container-queries';
|
|
10
10
|
import InternalRadioGroup from '../radio-group/internal';
|
|
11
11
|
import InternalSpaceBetween from '../space-between/internal';
|
|
12
|
+
import { getAnalyticsInnerContextAttribute } from './analytics-metadata/utils';
|
|
12
13
|
import styles from './styles.css.js';
|
|
13
14
|
export const copyPreferences = ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, stickyColumns, custom, }) => ({
|
|
14
15
|
pageSize,
|
|
@@ -42,38 +43,36 @@ export const mergePreferences = (newPref, oldPref) => {
|
|
|
42
43
|
export const ModalContentLayout = ({ left, right }) => {
|
|
43
44
|
const [breakpoint, ref] = useContainerBreakpoints(['xs']);
|
|
44
45
|
const smallContainer = breakpoint === 'default';
|
|
45
|
-
if (smallContainer) {
|
|
46
|
-
return (React.createElement("div", { ref: ref },
|
|
47
|
-
left && React.createElement("div", null, left),
|
|
48
|
-
right && React.createElement("div", { className: clsx(left && styles['second-column-small']) }, right)));
|
|
49
|
-
}
|
|
50
46
|
const columns = left && right ? 2 : 1;
|
|
51
47
|
return (React.createElement("div", { ref: ref },
|
|
52
|
-
React.createElement(InternalColumnLayout, { columns: columns, variant: "text-grid" },
|
|
48
|
+
React.createElement(InternalColumnLayout, { columns: smallContainer ? 1 : columns, variant: "text-grid" },
|
|
53
49
|
left && React.createElement("div", null, left),
|
|
54
|
-
right && React.createElement("div",
|
|
50
|
+
right && React.createElement("div", { className: clsx(left && smallContainer && styles['second-column-small']) }, right))));
|
|
55
51
|
};
|
|
56
52
|
export const PageSizePreference = ({ title, options, value, onChange }) => {
|
|
57
53
|
const i18n = useInternalI18n('collection-preferences');
|
|
58
|
-
return (React.createElement("div", { className: styles['page-size'] },
|
|
54
|
+
return (React.createElement("div", Object.assign({ className: styles['page-size'] }, getAnalyticsInnerContextAttribute('pageSize')),
|
|
59
55
|
React.createElement(InternalFormField, { label: i18n('pageSizePreference.title', title), stretch: true, className: styles['page-size-form-field'] },
|
|
60
56
|
React.createElement(InternalRadioGroup, { className: styles['page-size-radio-group'], value: `${value}`, items: options.map(({ label, value }) => ({ label, value: `${value}` })), onChange: ({ detail }) => onChange(parseInt(detail.value, 10)) }))));
|
|
61
57
|
};
|
|
62
58
|
export const WrapLinesPreference = ({ label, description, value, onChange }) => {
|
|
63
59
|
const i18n = useInternalI18n('collection-preferences');
|
|
64
|
-
return (React.createElement(
|
|
60
|
+
return (React.createElement("div", Object.assign({}, getAnalyticsInnerContextAttribute('wrapLines')),
|
|
61
|
+
React.createElement(InternalCheckbox, { checked: !!value, description: i18n('wrapLinesPreference.description', description), onChange: ({ detail }) => onChange(detail.checked), className: styles['wrap-lines'] }, i18n('wrapLinesPreference.label', label))));
|
|
65
62
|
};
|
|
66
63
|
export function StripedRowsPreference({ label, description, value, onChange }) {
|
|
67
64
|
const i18n = useInternalI18n('collection-preferences');
|
|
68
|
-
return (React.createElement(
|
|
65
|
+
return (React.createElement("div", Object.assign({}, getAnalyticsInnerContextAttribute('stripedRows')),
|
|
66
|
+
React.createElement(InternalCheckbox, { checked: !!value, description: i18n('stripedRowsPreference.description', description), onChange: ({ detail }) => onChange(detail.checked), className: styles['striped-rows'] }, i18n('stripedRowsPreference.label', label))));
|
|
69
67
|
}
|
|
70
68
|
export const ContentDensityPreference = ({ label, description, value, onChange }) => {
|
|
71
69
|
const i18n = useInternalI18n('collection-preferences');
|
|
72
|
-
return (React.createElement(
|
|
70
|
+
return (React.createElement("div", Object.assign({}, getAnalyticsInnerContextAttribute('contentDensity')),
|
|
71
|
+
React.createElement(InternalCheckbox, { checked: value === 'compact', description: i18n('contentDensityPreference.description', description), onChange: ({ detail }) => onChange(detail.checked ? 'compact' : 'comfortable'), className: styles['content-density'] }, i18n('contentDensityPreference.label', label))));
|
|
73
72
|
};
|
|
74
73
|
const StickyPreference = ({ firstOrLast, preference, value, onChange }) => {
|
|
75
74
|
const { title, description, options } = preference;
|
|
76
|
-
return (React.createElement("div", { className: styles[`sticky-columns-${firstOrLast}`] },
|
|
75
|
+
return (React.createElement("div", Object.assign({ className: styles[`sticky-columns-${firstOrLast}`] }, getAnalyticsInnerContextAttribute('stickyColumns')),
|
|
77
76
|
React.createElement(InternalFormField, { className: styles['sticky-columns-form-field'], label: title, description: description },
|
|
78
77
|
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)) }))));
|
|
79
78
|
};
|
|
@@ -85,7 +84,7 @@ export const StickyColumnsPreference = ({ firstColumns, lastColumns, onChange, v
|
|
|
85
84
|
export const CustomPreference = ({ value, customPreference, onChange }) => {
|
|
86
85
|
const [customState, setCustomState] = useState(value);
|
|
87
86
|
if (customPreference) {
|
|
88
|
-
return (React.createElement("div", { className: styles.custom }, customPreference(customState, value => {
|
|
87
|
+
return (React.createElement("div", Object.assign({ className: styles.custom }, getAnalyticsInnerContextAttribute('custom')), customPreference(customState, value => {
|
|
89
88
|
// prevent value to be treated as a functional callback
|
|
90
89
|
setCustomState(() => value);
|
|
91
90
|
onChange(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/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;AAExB,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAG7D,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,qBA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,gBAAgB,IACf,WAAW,EAAC,MAAM,EAClB,UAAU,EAAE,WAAW,EACvB,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,EAClB,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,iCAAM,KAAK,KAAE,IAAI,EAAE,QAAQ,IAAG,GAC5D,CACH,CACoB,CACxB,CAAC;AACJ,CAAC,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';\n\nimport InternalCheckbox from '../checkbox/internal';\nimport InternalColumnLayout from '../column-layout/internal';\nimport InternalFormField from '../form-field/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport InternalRadioGroup from '../radio-group/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { CollectionPreferencesProps } from './interfaces';\n\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 const i18n = useInternalI18n('collection-preferences');\n return (\n <div className={styles['page-size']}>\n <InternalFormField\n label={i18n('pageSizePreference.title', title)}\n stretch={true}\n className={styles['page-size-form-field']}\n >\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};\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 const i18n = useInternalI18n('collection-preferences');\n return (\n <InternalCheckbox\n checked={!!value}\n description={i18n('wrapLinesPreference.description', description)}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['wrap-lines']}\n >\n {i18n('wrapLinesPreference.label', label)}\n </InternalCheckbox>\n );\n};\n\ninterface StripedRowsPreferenceProps extends CollectionPreferencesProps.StripedRowsPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport function StripedRowsPreference({ label, description, value, onChange }: StripedRowsPreferenceProps) {\n const i18n = useInternalI18n('collection-preferences');\n return (\n <InternalCheckbox\n checked={!!value}\n description={i18n('stripedRowsPreference.description', description)}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['striped-rows']}\n >\n {i18n('stripedRowsPreference.label', label)}\n </InternalCheckbox>\n );\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 const i18n = useInternalI18n('collection-preferences');\n return (\n <InternalCheckbox\n checked={value === 'compact'}\n description={i18n('contentDensityPreference.description', description)}\n onChange={({ detail }) => onChange(detail.checked ? 'compact' : 'comfortable')}\n className={styles['content-density']}\n >\n {i18n('contentDensityPreference.label', label)}\n </InternalCheckbox>\n );\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":"","sources":["../../../src/collection-preferences/utils.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;A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AAE,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,2CAAK,SAAS,EAAE,MAAM,CAAC,MAAM,IAAM,iCAAiC,CAAC,QAAQ,CAAC,GAC3E,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';\n\nimport InternalCheckbox from '../checkbox/internal';\nimport InternalColumnLayout from '../column-layout/internal';\nimport InternalFormField from '../form-field/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport InternalRadioGroup from '../radio-group/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { getAnalyticsInnerContextAttribute } from './analytics-metadata/utils';\nimport { CollectionPreferencesProps } from './interfaces';\n\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 const columns = left && right ? 2 : 1;\n return (\n <div ref={ref}>\n <InternalColumnLayout columns={smallContainer ? 1 : columns} variant=\"text-grid\">\n {left && <div>{left}</div>}\n {right && <div className={clsx(left && smallContainer && styles['second-column-small'])}>{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 const i18n = useInternalI18n('collection-preferences');\n return (\n <div className={styles['page-size']} {...getAnalyticsInnerContextAttribute('pageSize')}>\n <InternalFormField\n label={i18n('pageSizePreference.title', title)}\n stretch={true}\n className={styles['page-size-form-field']}\n >\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};\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 const i18n = useInternalI18n('collection-preferences');\n return (\n <div {...getAnalyticsInnerContextAttribute('wrapLines')}>\n <InternalCheckbox\n checked={!!value}\n description={i18n('wrapLinesPreference.description', description)}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['wrap-lines']}\n >\n {i18n('wrapLinesPreference.label', label)}\n </InternalCheckbox>\n </div>\n );\n};\n\ninterface StripedRowsPreferenceProps extends CollectionPreferencesProps.StripedRowsPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport function StripedRowsPreference({ label, description, value, onChange }: StripedRowsPreferenceProps) {\n const i18n = useInternalI18n('collection-preferences');\n return (\n <div {...getAnalyticsInnerContextAttribute('stripedRows')}>\n <InternalCheckbox\n checked={!!value}\n description={i18n('stripedRowsPreference.description', description)}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['striped-rows']}\n >\n {i18n('stripedRowsPreference.label', label)}\n </InternalCheckbox>\n </div>\n );\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 const i18n = useInternalI18n('collection-preferences');\n return (\n <div {...getAnalyticsInnerContextAttribute('contentDensity')}>\n <InternalCheckbox\n checked={value === 'compact'}\n description={i18n('contentDensityPreference.description', description)}\n onChange={({ detail }) => onChange(detail.checked ? 'compact' : 'comfortable')}\n className={styles['content-density']}\n >\n {i18n('contentDensityPreference.label', label)}\n </InternalCheckbox>\n </div>\n );\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}`]} {...getAnalyticsInnerContextAttribute('stickyColumns')}>\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} {...getAnalyticsInnerContextAttribute('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"]}
|