@cloudscape-design/components-themeable 3.0.878 → 3.0.880
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/collection-preferences/content-display/content-display-option.scss +4 -0
- package/lib/internal/scss/internal/components/drag-handle/styles.scss +51 -18
- package/lib/internal/scss/internal/components/panel-resize-handle/styles.scss +3 -42
- package/lib/internal/scss/tabs/tab-header-bar.scss +1 -0
- package/lib/internal/template/app-layout/drawer/resizable-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/drawer/resizable-drawer.js +3 -2
- package/lib/internal/template/app-layout/drawer/resizable-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/utils/use-focus-control.d.ts +2 -1
- 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 +2 -0
- package/lib/internal/template/app-layout/utils/use-focus-control.js.map +1 -1
- package/lib/internal/template/app-layout/utils/use-resize.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-resize.js +3 -2
- package/lib/internal/template/app-layout/utils/use-resize.js.map +1 -1
- package/lib/internal/template/app-layout/utils/use-split-panel-focus-control.d.ts +2 -1
- package/lib/internal/template/app-layout/utils/use-split-panel-focus-control.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-split-panel-focus-control.js +1 -0
- package/lib/internal/template/app-layout/utils/use-split-panel-focus-control.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +3 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.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 +3 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
- package/lib/internal/template/attribute-editor/interfaces.d.ts +7 -0
- package/lib/internal/template/attribute-editor/interfaces.d.ts.map +1 -1
- package/lib/internal/template/attribute-editor/interfaces.js.map +1 -1
- package/lib/internal/template/attribute-editor/internal.d.ts.map +1 -1
- package/lib/internal/template/attribute-editor/internal.js +2 -2
- package/lib/internal/template/attribute-editor/internal.js.map +1 -1
- 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 -1
- package/lib/internal/template/collection-preferences/content-display/content-display-option.js.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/styles.css.js +11 -10
- package/lib/internal/template/collection-preferences/content-display/styles.scoped.css +14 -10
- package/lib/internal/template/collection-preferences/content-display/styles.selectors.js +11 -10
- package/lib/internal/template/collection-preferences/index.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/index.js +1 -1
- package/lib/internal/template/collection-preferences/index.js.map +1 -1
- package/lib/internal/template/collection-preferences/styles.css.js +38 -37
- package/lib/internal/template/collection-preferences/styles.scoped.css +42 -38
- package/lib/internal/template/collection-preferences/styles.selectors.js +38 -37
- package/lib/internal/template/internal/components/drag-handle/index.d.ts +4 -8
- package/lib/internal/template/internal/components/drag-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/index.js +23 -5
- package/lib/internal/template/internal/components/drag-handle/index.js.map +1 -1
- package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts +25 -0
- package/lib/internal/template/internal/components/drag-handle/interfaces.d.ts.map +1 -0
- package/lib/internal/template/internal/components/drag-handle/interfaces.js +4 -0
- package/lib/internal/template/internal/components/drag-handle/interfaces.js.map +1 -0
- package/lib/internal/template/internal/components/drag-handle/resize-icon.d.ts +7 -0
- package/lib/internal/template/internal/components/drag-handle/resize-icon.d.ts.map +1 -0
- package/lib/internal/template/internal/components/{panel-resize-handle/icon.js → drag-handle/resize-icon.js} +5 -3
- package/lib/internal/template/internal/components/drag-handle/resize-icon.js.map +1 -0
- package/lib/internal/template/internal/components/drag-handle/styles.css.js +12 -3
- package/lib/internal/template/internal/components/drag-handle/styles.scoped.css +50 -20
- package/lib/internal/template/internal/components/drag-handle/styles.selectors.js +12 -3
- package/lib/internal/template/internal/components/options-list/index.js +1 -1
- package/lib/internal/template/internal/components/options-list/index.js.map +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.d.ts +4 -2
- package/lib/internal/template/internal/components/panel-resize-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.js +8 -5
- package/lib/internal/template/internal/components/panel-resize-handle/index.js.map +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/styles.css.js +2 -5
- package/lib/internal/template/internal/components/panel-resize-handle/styles.scoped.css +3 -191
- package/lib/internal/template/internal/components/panel-resize-handle/styles.selectors.js +2 -5
- package/lib/internal/template/internal/components/portal/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/portal/index.js.map +1 -1
- package/lib/internal/template/internal/environment.js +1 -1
- package/lib/internal/template/internal/environment.json +1 -1
- package/lib/internal/template/internal/events/index.d.ts +1 -1
- package/lib/internal/template/internal/events/index.d.ts.map +1 -1
- package/lib/internal/template/internal/events/index.js.map +1 -1
- package/lib/internal/template/popover/internal.js +5 -4
- package/lib/internal/template/popover/internal.js.map +1 -1
- package/lib/internal/template/prompt-input/internal.d.ts.map +1 -1
- package/lib/internal/template/prompt-input/internal.js +1 -3
- package/lib/internal/template/prompt-input/internal.js.map +1 -1
- package/lib/internal/template/split-panel/implementation.d.ts.map +1 -1
- package/lib/internal/template/split-panel/implementation.js +7 -6
- package/lib/internal/template/split-panel/implementation.js.map +1 -1
- package/lib/internal/template/tabs/styles.css.js +28 -28
- package/lib/internal/template/tabs/styles.scoped.css +50 -49
- package/lib/internal/template/tabs/styles.selectors.js +28 -28
- package/package.json +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/icon.d.ts +0 -5
- package/lib/internal/template/internal/components/panel-resize-handle/icon.d.ts.map +0 -1
- package/lib/internal/template/internal/components/panel-resize-handle/icon.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface AttributeEditorForwardRefType {\n <T>(props: AttributeEditorProps<T> & { ref?: React.Ref<AttributeEditorProps.Ref> }): JSX.Element;\n}\n\nexport namespace AttributeEditorProps {\n export interface IsItemRemovableFunction<T> {\n (item: T): boolean;\n }\n\n export type FieldRenderable<T> = (item: T, itemIndex: number) => React.ReactNode;\n export interface FieldDefinition<T> {\n label?: React.ReactNode;\n info?: React.ReactNode;\n control?: FieldRenderable<T> | React.ReactNode;\n errorText?: FieldRenderable<T> | React.ReactNode;\n warningText?: FieldRenderable<T> | React.ReactNode;\n constraintText?: FieldRenderable<T> | React.ReactNode;\n }\n\n export interface RemoveButtonClickDetail {\n itemIndex: number;\n }\n\n export interface Ref {\n /**\n * Focuses the 'remove' button for the given row index.\n */\n focusRemoveButton(itemIndex: number): void;\n /**\n * Focuses the 'add' button. Use this, for example, after a user removes the last row.\n */\n focusAddButton(): void;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export interface I18nStrings<T = any> {\n errorIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n itemRemovedAriaLive?: string;\n\n /**\n * @deprecated Use `removeButtonAriaLabel` on the component instead.\n */\n removeButtonAriaLabel?: (item: T) => string;\n }\n}\n\nexport interface AttributeEditorProps<T> extends BaseComponentProps {\n /**\n * Displayed when there are no items to display.\n */\n empty?: React.ReactNode;\n\n /**\n * Displayed below the add button. Use it for additional information related to the attribute editor.\n */\n additionalInfo?: React.ReactNode;\n\n /**\n * Specifies the text that's displayed in the add button.\n */\n addButtonText: string;\n\n /**\n * Specifies the text that's displayed in the remove button.\n * @i18n\n */\n removeButtonText?: string;\n\n /**\n * Adds an `aria-label` to the remove button.\n */\n removeButtonAriaLabel?: (item: T) => string;\n\n /**\n * Specifies the items that serve as the data source for all rows.\n * The display of a row is handled by the `definition` property.\n */\n items?: ReadonlyArray<T>;\n\n /**\n * Function that determines whether an item is removable. When this function returns `false`, the remove\n * button is not rendered and the user can't remove the item.\n * By default, all items are removable.\n */\n isItemRemovable?: AttributeEditorProps.IsItemRemovableFunction<T>;\n\n /**\n * Determines whether the add button is disabled.\n */\n disableAddButton?: boolean;\n\n /**\n * Defines the editor configuration. Each object in the array represents one form field in the row.\n *\n * * `label` (ReactNode) - Text label for the form field.\n * * `info` (ReactNode) - Info link for the form field.\n * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.\n * It renders the form field as invalid if the returned value is not `null` or `undefined`.\n * * `warningText` ((item, itemIndex) => ReactNode) - Warning message text to display as a control validation message.\n * It renders the form field in a warning state if the returned value is not `null` or `undefined`.\n * * `constraintText` ((item, itemIndex) => ReactNode) - Text to display as a constraint message below the field.\n * * `control` ((item, itemIndex) => ReactNode) - A control to use as the input for the field.\n *\n * A maximum of four fields are supported.\n */\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n\n /**\n * Called when add button is clicked.\n */\n onAddButtonClick?: NonCancelableEventHandler;\n\n /**\n * Called when remove button is clicked.\n * The event `detail` contains the index of the corresponding item.\n */\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings?: AttributeEditorProps.I18nStrings<T>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/attribute-editor/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface AttributeEditorForwardRefType {\n <T>(props: AttributeEditorProps<T> & { ref?: React.Ref<AttributeEditorProps.Ref> }): JSX.Element;\n}\n\nexport namespace AttributeEditorProps {\n export interface IsItemRemovableFunction<T> {\n (item: T): boolean;\n }\n\n export type FieldRenderable<T> = (item: T, itemIndex: number) => React.ReactNode;\n export interface FieldDefinition<T> {\n label?: React.ReactNode;\n info?: React.ReactNode;\n control?: FieldRenderable<T> | React.ReactNode;\n errorText?: FieldRenderable<T> | React.ReactNode;\n warningText?: FieldRenderable<T> | React.ReactNode;\n constraintText?: FieldRenderable<T> | React.ReactNode;\n }\n\n export type AddButtonVariant = 'normal' | 'inline-link';\n\n export interface RemoveButtonClickDetail {\n itemIndex: number;\n }\n\n export interface Ref {\n /**\n * Focuses the 'remove' button for the given row index.\n */\n focusRemoveButton(itemIndex: number): void;\n /**\n * Focuses the 'add' button. Use this, for example, after a user removes the last row.\n */\n focusAddButton(): void;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n export interface I18nStrings<T = any> {\n errorIconAriaLabel?: string;\n warningIconAriaLabel?: string;\n itemRemovedAriaLive?: string;\n\n /**\n * @deprecated Use `removeButtonAriaLabel` on the component instead.\n */\n removeButtonAriaLabel?: (item: T) => string;\n }\n}\n\nexport interface AttributeEditorProps<T> extends BaseComponentProps {\n /**\n * Displayed when there are no items to display.\n */\n empty?: React.ReactNode;\n\n /**\n * Displayed below the add button. Use it for additional information related to the attribute editor.\n */\n additionalInfo?: React.ReactNode;\n\n /**\n * Specifies the text that's displayed in the add button.\n */\n addButtonText: string;\n\n /**\n * Specifies the text that's displayed in the remove button.\n * @i18n\n */\n removeButtonText?: string;\n\n /**\n * Adds an `aria-label` to the remove button.\n */\n removeButtonAriaLabel?: (item: T) => string;\n\n /**\n * Specifies the items that serve as the data source for all rows.\n * The display of a row is handled by the `definition` property.\n */\n items?: ReadonlyArray<T>;\n\n /**\n * Function that determines whether an item is removable. When this function returns `false`, the remove\n * button is not rendered and the user can't remove the item.\n * By default, all items are removable.\n */\n isItemRemovable?: AttributeEditorProps.IsItemRemovableFunction<T>;\n\n /**\n * Determines whether the add button is disabled.\n */\n disableAddButton?: boolean;\n\n /**\n * Specifies the variant to use for the add button. By default a normal button is used.\n * Use `inline-link` when using an attribute editor nested inside complex attribute editing\n * with expandable sections.\n */\n addButtonVariant?: AttributeEditorProps.AddButtonVariant;\n\n /**\n * Defines the editor configuration. Each object in the array represents one form field in the row.\n *\n * * `label` (ReactNode) - Text label for the form field.\n * * `info` (ReactNode) - Info link for the form field.\n * * `errorText` ((item, itemIndex) => ReactNode) - Error message text to display as a control validation message.\n * It renders the form field as invalid if the returned value is not `null` or `undefined`.\n * * `warningText` ((item, itemIndex) => ReactNode) - Warning message text to display as a control validation message.\n * It renders the form field in a warning state if the returned value is not `null` or `undefined`.\n * * `constraintText` ((item, itemIndex) => ReactNode) - Text to display as a constraint message below the field.\n * * `control` ((item, itemIndex) => ReactNode) - A control to use as the input for the field.\n *\n * A maximum of four fields are supported.\n */\n definition: ReadonlyArray<AttributeEditorProps.FieldDefinition<T>>;\n\n /**\n * Called when add button is clicked.\n */\n onAddButtonClick?: NonCancelableEventHandler;\n\n /**\n * Called when remove button is clicked.\n * The event `detail` contains the index of the corresponding item.\n */\n onRemoveButtonClick?: NonCancelableEventHandler<AttributeEditorProps.RemoveButtonClickDetail>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n */\n i18nStrings?: AttributeEditorProps.I18nStrings<T>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/internal.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,6BAA6B,EAAwB,MAAM,cAAc,CAAC;AAOnF,QAAA,MAAM,uBAAuB,+
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/attribute-editor/internal.tsx"],"names":[],"mappings":"AAiBA,OAAO,EAAE,6BAA6B,EAAwB,MAAM,cAAc,CAAC;AAOnF,QAAA,MAAM,uBAAuB,+BA6GK,CAAC;AAEnC,eAAe,uBAAuB,CAAC"}
|
|
@@ -15,7 +15,7 @@ import { AdditionalInfo } from './additional-info';
|
|
|
15
15
|
import { Row } from './row';
|
|
16
16
|
import styles from './styles.css.js';
|
|
17
17
|
const InternalAttributeEditor = React.forwardRef((_a, ref) => {
|
|
18
|
-
var { additionalInfo, disableAddButton, definition, items, isItemRemovable = () => true, empty, addButtonText, removeButtonText, removeButtonAriaLabel, i18nStrings, onAddButtonClick, onRemoveButtonClick, __internalRootRef = null } = _a, props = __rest(_a, ["additionalInfo", "disableAddButton", "definition", "items", "isItemRemovable", "empty", "addButtonText", "removeButtonText", "removeButtonAriaLabel", "i18nStrings", "onAddButtonClick", "onRemoveButtonClick", "__internalRootRef"]);
|
|
18
|
+
var { additionalInfo, disableAddButton, definition, items, isItemRemovable = () => true, empty, addButtonText, addButtonVariant = 'normal', removeButtonText, removeButtonAriaLabel, i18nStrings, onAddButtonClick, onRemoveButtonClick, __internalRootRef = null } = _a, props = __rest(_a, ["additionalInfo", "disableAddButton", "definition", "items", "isItemRemovable", "empty", "addButtonText", "addButtonVariant", "removeButtonText", "removeButtonAriaLabel", "i18nStrings", "onAddButtonClick", "onRemoveButtonClick", "__internalRootRef"]);
|
|
19
19
|
const [breakpoint, breakpointRef] = useContainerBreakpoints(['default', 'xxs', 'xs']);
|
|
20
20
|
const removeButtonRefs = useRef([]);
|
|
21
21
|
const addButtonRef = useRef(null);
|
|
@@ -56,7 +56,7 @@ const InternalAttributeEditor = React.forwardRef((_a, ref) => {
|
|
|
56
56
|
// Using aria-disabled="true" and tabindex="-1" instead of "disabled"
|
|
57
57
|
// because focus can be dynamically moved to this button by calling
|
|
58
58
|
// `focusAddButton()` on the ref.
|
|
59
|
-
__nativeAttributes: disableAddButton ? { tabIndex: -1 } : {}, __focusable: true, onClick: onAddButtonClick, formAction: "none", ref: addButtonRef, ariaDescribedby: infoAriaDescribedBy }, addButtonText),
|
|
59
|
+
__nativeAttributes: disableAddButton ? { tabIndex: -1 } : {}, __focusable: true, onClick: onAddButtonClick, formAction: "none", ref: addButtonRef, ariaDescribedby: infoAriaDescribedBy, variant: addButtonVariant, iconName: addButtonVariant === 'inline-link' ? 'add-plus' : undefined }, addButtonText),
|
|
60
60
|
React.createElement(InternalLiveRegion, { "data-testid": "removal-announcement", tagName: "span", hidden: true, delay: 5, key: items.length }, removalAnnouncement),
|
|
61
61
|
!!additionalInfo && React.createElement(AdditionalInfo, { id: infoAriaDescribedBy }, additionalInfo)));
|
|
62
62
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/attribute-editor/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE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AS,EAAE,eAAe,CAAC,IAAI,CAAC,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,gBAAgB,CAAC,OAAO,EAC1C,mBAAmB,EAAE,mBAAmB,EACxC,qBAAqB,EAAE,qBAAqB,GAC5C,CACH,CAAC,CACU;QAEd,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,EAC/B,QAAQ,EAAE,gBAAgB;YAC1B,qEAAqE;YACrE,mEAAmE;YACnE,iCAAiC;YACjC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAC5D,WAAW,EAAE,IAAI,EACjB,OAAO,EAAE,gBAAgB,EACzB,UAAU,EAAC,MAAM,EACjB,GAAG,EAAE,YAAY,EACjB,eAAe,EAAE,mBAAmB,EACpC,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,gBAAgB,KAAK,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,IAEpE,aAAa,CACC;QACjB,oBAAC,kBAAkB,mBACL,sBAAsB,EAClC,OAAO,EAAC,MAAM,EACd,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,CAAC,EACR,GAAG,EAAE,KAAK,CAAC,MAAM,IAEhB,mBAAmB,CACD;QACpB,CAAC,CAAC,cAAc,IAAI,oBAAC,cAAc,IAAC,EAAE,EAAE,mBAAmB,IAAG,cAAc,CAAkB,CAC3F,CACP,CAAC;AACJ,CAAC,CAC+B,CAAC;AAEnC,eAAe,uBAAuB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport InternalBox from '../box/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport { getBaseProps } from '../internal/base-component';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { usePrevious } from '../internal/hooks/use-previous';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { SomeRequired } from '../internal/types';\nimport InternalLiveRegion from '../live-region/internal';\nimport { AdditionalInfo } from './additional-info';\nimport { AttributeEditorForwardRefType, AttributeEditorProps } from './interfaces';\nimport { Row } from './row';\n\nimport styles from './styles.css.js';\n\ntype InternalAttributeEditorProps<T> = SomeRequired<AttributeEditorProps<T>, 'items'> & InternalBaseComponentProps;\n\nconst InternalAttributeEditor = React.forwardRef(\n <T,>(\n {\n additionalInfo,\n disableAddButton,\n definition,\n items,\n isItemRemovable = () => true,\n empty,\n addButtonText,\n addButtonVariant = 'normal',\n removeButtonText,\n removeButtonAriaLabel,\n i18nStrings,\n onAddButtonClick,\n onRemoveButtonClick,\n __internalRootRef = null,\n ...props\n }: InternalAttributeEditorProps<T>,\n ref: React.Ref<AttributeEditorProps.Ref>\n ) => {\n const [breakpoint, breakpointRef] = useContainerBreakpoints(['default', 'xxs', 'xs']);\n const removeButtonRefs = useRef<Array<ButtonProps.Ref | undefined>>([]);\n const addButtonRef = useRef<ButtonProps.Ref>(null);\n const wasNonEmpty = useRef<boolean>(false);\n const [removalAnnouncement, setRemovalAnnouncement] = useState<string>('');\n\n const baseProps = getBaseProps(props);\n const isEmpty = items && items.length === 0;\n\n wasNonEmpty.current = wasNonEmpty.current || !isEmpty;\n\n useImperativeHandle(ref, () => ({\n focusRemoveButton(rowIndex: number) {\n removeButtonRefs.current[rowIndex]?.focus();\n },\n focusAddButton() {\n addButtonRef.current?.focus();\n },\n }));\n\n const mergedRef = useMergeRefs(breakpointRef, __internalRootRef);\n\n const additionalInfoId = useUniqueId('attribute-editor-info');\n const infoAriaDescribedBy = additionalInfo ? additionalInfoId : undefined;\n\n const prevItemsLength = usePrevious(items.length);\n\n React.useEffect(() => {\n if (prevItemsLength && prevItemsLength > items.length && i18nStrings?.itemRemovedAriaLive) {\n setRemovalAnnouncement(i18nStrings.itemRemovedAriaLive);\n } else {\n setRemovalAnnouncement('');\n }\n // we only want to announce when the number of items decreases (i.e. when an item is removed)\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [items, i18nStrings?.itemRemovedAriaLive]);\n\n return (\n <div {...baseProps} ref={mergedRef} className={clsx(baseProps.className, styles.root)}>\n <InternalBox margin={{ bottom: 'l' }}>\n {isEmpty && <div className={clsx(styles.empty, wasNonEmpty.current && styles['empty-appear'])}>{empty}</div>}\n {items.map((item, index) => (\n <Row<T>\n key={index}\n index={index}\n breakpoint={breakpoint}\n item={item}\n definition={definition}\n i18nStrings={i18nStrings}\n removable={isItemRemovable(item)}\n removeButtonText={removeButtonText}\n removeButtonRefs={removeButtonRefs.current}\n onRemoveButtonClick={onRemoveButtonClick}\n removeButtonAriaLabel={removeButtonAriaLabel}\n />\n ))}\n </InternalBox>\n\n <InternalButton\n className={styles['add-button']}\n disabled={disableAddButton}\n // Using aria-disabled=\"true\" and tabindex=\"-1\" instead of \"disabled\"\n // because focus can be dynamically moved to this button by calling\n // `focusAddButton()` on the ref.\n __nativeAttributes={disableAddButton ? { tabIndex: -1 } : {}}\n __focusable={true}\n onClick={onAddButtonClick}\n formAction=\"none\"\n ref={addButtonRef}\n ariaDescribedby={infoAriaDescribedBy}\n variant={addButtonVariant}\n iconName={addButtonVariant === 'inline-link' ? 'add-plus' : undefined}\n >\n {addButtonText}\n </InternalButton>\n <InternalLiveRegion\n data-testid=\"removal-announcement\"\n tagName=\"span\"\n hidden={true}\n delay={5}\n key={items.length}\n >\n {removalAnnouncement}\n </InternalLiveRegion>\n {!!additionalInfo && <AdditionalInfo id={infoAriaDescribedBy}>{additionalInfo}</AdditionalInfo>}\n </div>\n );\n }\n) as AttributeEditorForwardRefType;\n\nexport default InternalAttributeEditor;\n"]}
|
package/lib/internal/template/collection-preferences/content-display/content-display-option.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-display-option.d.ts","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/content-display-option.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAExD,OAAmB,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAK/C,eAAO,MAAM,YAAY,YAAa,MAAM,WAAgE,CAAC;AAE7G,UAAU,yBAAyB;IACjC,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAClD,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,QAAA,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"content-display-option.d.ts","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/content-display-option.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAExD,OAAmB,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAK/C,eAAO,MAAM,YAAY,YAAa,MAAM,WAAgE,CAAC;AAE7G,UAAU,yBAAyB;IACjC,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAClD,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,QAAA,MAAM,oBAAoB,kGAwBzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
package/lib/internal/template/collection-preferences/content-display/content-display-option.js
CHANGED
|
@@ -11,7 +11,8 @@ const ContentDisplayOption = forwardRef(({ dragHandleProps, onToggle, option },
|
|
|
11
11
|
const idPrefix = useUniqueId(componentPrefix);
|
|
12
12
|
const controlId = `${idPrefix}-control-${option.id}`;
|
|
13
13
|
return (React.createElement("div", { ref: ref, className: getClassName('content') },
|
|
14
|
-
React.createElement(
|
|
14
|
+
React.createElement("div", { className: styles['drag-handle-wrapper'] },
|
|
15
|
+
React.createElement(DragHandle, Object.assign({}, dragHandleProps))),
|
|
15
16
|
React.createElement("label", { className: getClassName('label'), htmlFor: controlId }, option.label),
|
|
16
17
|
React.createElement("div", { className: getClassName('toggle') },
|
|
17
18
|
React.createElement(InternalToggle, { checked: !!option.visible, onChange: () => onToggle && onToggle(option), disabled: option.alwaysVisible === true, controlId: controlId }))));
|
package/lib/internal/template/collection-preferences/content-display/content-display-option.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-display-option.js","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/content-display-option.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,UAA+B,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAGnD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,eAAe,GAAG,wBAAwB,CAAC;AACjD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAe,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAQ7G,MAAM,oBAAoB,GAAG,UAAU,CACrC,CAAC,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAA6B,EAAE,GAAiC,EAAE,EAAE;IACtG,MAAM,QAAQ,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,GAAG,QAAQ,YAAY,MAAM,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC;QAC/C,oBAAC,UAAU,oBAAK,eAAe,EAAI;
|
|
1
|
+
{"version":3,"file":"content-display-option.js","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/content-display-option.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,UAA+B,MAAM,uCAAuC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAGnD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,eAAe,GAAG,wBAAwB,CAAC;AACjD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAe,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAQ7G,MAAM,oBAAoB,GAAG,UAAU,CACrC,CAAC,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,EAA6B,EAAE,GAAiC,EAAE,EAAE;IACtG,MAAM,QAAQ,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,GAAG,QAAQ,YAAY,MAAM,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC;QAC/C,6BAAK,SAAS,EAAE,MAAM,CAAC,qBAAqB,CAAC;YAC3C,oBAAC,UAAU,oBAAK,eAAe,EAAI,CAC/B;QAEN,+BAAO,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,SAAS,IACxD,MAAM,CAAC,KAAK,CACP;QACR,6BAAK,SAAS,EAAE,YAAY,CAAC,QAAQ,CAAC;YACpC,oBAAC,cAAc,IACb,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EACzB,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,EAC5C,QAAQ,EAAE,MAAM,CAAC,aAAa,KAAK,IAAI,EACvC,SAAS,EAAE,SAAS,GACpB,CACE,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { ForwardedRef, forwardRef } from 'react';\n\nimport DragHandle, { DragHandleProps } from '../../internal/components/drag-handle';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport InternalToggle from '../../toggle/internal';\nimport { OptionWithVisibility } from './utils';\n\nimport styles from '../styles.css.js';\n\nconst componentPrefix = 'content-display-option';\nexport const getClassName = (suffix?: string) => styles[[componentPrefix, suffix].filter(Boolean).join('-')];\n\ninterface ContentDisplayOptionProps {\n dragHandleProps: DragHandleProps;\n onToggle?: (option: OptionWithVisibility) => void;\n option: OptionWithVisibility;\n}\n\nconst ContentDisplayOption = forwardRef(\n ({ dragHandleProps, onToggle, option }: ContentDisplayOptionProps, ref: ForwardedRef<HTMLDivElement>) => {\n const idPrefix = useUniqueId(componentPrefix);\n const controlId = `${idPrefix}-control-${option.id}`;\n return (\n <div ref={ref} className={getClassName('content')}>\n <div className={styles['drag-handle-wrapper']}>\n <DragHandle {...dragHandleProps} />\n </div>\n\n <label className={getClassName('label')} htmlFor={controlId}>\n {option.label}\n </label>\n <div className={getClassName('toggle')}>\n <InternalToggle\n checked={!!option.visible}\n onChange={() => onToggle && onToggle(option)}\n disabled={option.alwaysVisible === true}\n controlId={controlId}\n />\n </div>\n </div>\n );\n }\n);\n\nexport default ContentDisplayOption;\n"]}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"content-display-option-toggle": "awsui_content-display-option-
|
|
5
|
-
"content-display-option-content": "awsui_content-display-option-
|
|
6
|
-
"content-display-option": "awsui_content-display-
|
|
7
|
-
"content-display-option-label": "awsui_content-display-option-
|
|
8
|
-
"
|
|
9
|
-
"content-display
|
|
10
|
-
"content-display-
|
|
11
|
-
"content-display-
|
|
12
|
-
"content-display-
|
|
13
|
-
"content-display-
|
|
4
|
+
"content-display-option-toggle": "awsui_content-display-option-toggle_1f3h0_1xy46_289",
|
|
5
|
+
"content-display-option-content": "awsui_content-display-option-content_1f3h0_1xy46_293",
|
|
6
|
+
"content-display-option": "awsui_content-display-option_1f3h0_1xy46_289",
|
|
7
|
+
"content-display-option-label": "awsui_content-display-option-label_1f3h0_1xy46_341",
|
|
8
|
+
"drag-handle-wrapper": "awsui_drag-handle-wrapper_1f3h0_1xy46_348",
|
|
9
|
+
"content-display": "awsui_content-display_1f3h0_1xy46_289",
|
|
10
|
+
"content-display-text-filter": "awsui_content-display-text-filter_1f3h0_1xy46_353",
|
|
11
|
+
"content-display-no-match": "awsui_content-display-no-match_1f3h0_1xy46_354",
|
|
12
|
+
"content-display-title": "awsui_content-display-title_1f3h0_1xy46_358",
|
|
13
|
+
"content-display-description": "awsui_content-display-description_1f3h0_1xy46_367",
|
|
14
|
+
"content-display-option-list": "awsui_content-display-option-list_1f3h0_1xy46_375"
|
|
14
15
|
};
|
|
15
16
|
|
|
@@ -286,11 +286,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
286
286
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
287
287
|
SPDX-License-Identifier: Apache-2.0
|
|
288
288
|
*/
|
|
289
|
-
.awsui_content-display-option-
|
|
289
|
+
.awsui_content-display-option-toggle_1f3h0_1xy46_289:not(#\9) {
|
|
290
290
|
/* used in test-utils */
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
.awsui_content-display-option-
|
|
293
|
+
.awsui_content-display-option-content_1f3h0_1xy46_293:not(#\9) {
|
|
294
294
|
border-collapse: separate;
|
|
295
295
|
border-spacing: 0;
|
|
296
296
|
box-sizing: border-box;
|
|
@@ -333,26 +333,30 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
333
333
|
border-end-end-radius: var(--border-radius-item-q4wr0w, 0px);
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
.awsui_content-display-
|
|
336
|
+
.awsui_content-display-option_1f3h0_1xy46_289:not(#\9) {
|
|
337
337
|
list-style: none;
|
|
338
338
|
position: relative;
|
|
339
339
|
border-block-start: var(--border-divider-list-width-x6rz7e, 1px) solid var(--color-border-divider-secondary-1xu6lb, #eaeded);
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
.awsui_content-display-option-
|
|
342
|
+
.awsui_content-display-option-label_1f3h0_1xy46_341:not(#\9) {
|
|
343
343
|
flex-grow: 1;
|
|
344
344
|
min-inline-size: 0;
|
|
345
345
|
word-break: break-word;
|
|
346
346
|
padding-inline-end: var(--space-l-eenfqd, 20px);
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
-
.
|
|
350
|
-
|
|
351
|
-
|
|
349
|
+
.awsui_drag-handle-wrapper_1f3h0_1xy46_348:not(#\9) {
|
|
350
|
+
margin-inline: var(--space-scaled-xxs-krq5fq, 4px);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.awsui_content-display_1f3h0_1xy46_289:not(#\9),
|
|
354
|
+
.awsui_content-display-text-filter_1f3h0_1xy46_353:not(#\9),
|
|
355
|
+
.awsui_content-display-no-match_1f3h0_1xy46_354:not(#\9) {
|
|
352
356
|
/* used in test-utils */
|
|
353
357
|
}
|
|
354
358
|
|
|
355
|
-
.awsui_content-display-
|
|
359
|
+
.awsui_content-display-title_1f3h0_1xy46_358:not(#\9) {
|
|
356
360
|
font-size: var(--font-size-body-m-6wxxs5, 14px);
|
|
357
361
|
line-height: var(--line-height-body-m-gw0130, 22px);
|
|
358
362
|
font-weight: var(--font-display-label-weight-5p8eav, 400);
|
|
@@ -361,7 +365,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
361
365
|
margin-inline: 0;
|
|
362
366
|
}
|
|
363
367
|
|
|
364
|
-
.awsui_content-display-
|
|
368
|
+
.awsui_content-display-description_1f3h0_1xy46_367:not(#\9) {
|
|
365
369
|
color: var(--color-text-form-secondary-5q4khe, #687078);
|
|
366
370
|
font-size: var(--font-size-body-s-4dzx5q, 12px);
|
|
367
371
|
line-height: var(--line-height-body-s-egzl4q, 16px);
|
|
@@ -369,7 +373,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
369
373
|
margin-block-start: var(--space-scaled-xxxs-6vyqo7, 2px);
|
|
370
374
|
}
|
|
371
375
|
|
|
372
|
-
.awsui_content-display-option-
|
|
376
|
+
.awsui_content-display-option-list_1f3h0_1xy46_375:not(#\9) {
|
|
373
377
|
position: relative;
|
|
374
378
|
list-style: none;
|
|
375
379
|
padding-block: 0;
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"content-display-option-toggle": "awsui_content-display-option-
|
|
6
|
-
"content-display-option-content": "awsui_content-display-option-
|
|
7
|
-
"content-display-option": "awsui_content-display-
|
|
8
|
-
"content-display-option-label": "awsui_content-display-option-
|
|
9
|
-
"
|
|
10
|
-
"content-display
|
|
11
|
-
"content-display-
|
|
12
|
-
"content-display-
|
|
13
|
-
"content-display-
|
|
14
|
-
"content-display-
|
|
5
|
+
"content-display-option-toggle": "awsui_content-display-option-toggle_1f3h0_1xy46_289",
|
|
6
|
+
"content-display-option-content": "awsui_content-display-option-content_1f3h0_1xy46_293",
|
|
7
|
+
"content-display-option": "awsui_content-display-option_1f3h0_1xy46_289",
|
|
8
|
+
"content-display-option-label": "awsui_content-display-option-label_1f3h0_1xy46_341",
|
|
9
|
+
"drag-handle-wrapper": "awsui_drag-handle-wrapper_1f3h0_1xy46_348",
|
|
10
|
+
"content-display": "awsui_content-display_1f3h0_1xy46_289",
|
|
11
|
+
"content-display-text-filter": "awsui_content-display-text-filter_1f3h0_1xy46_353",
|
|
12
|
+
"content-display-no-match": "awsui_content-display-no-match_1f3h0_1xy46_354",
|
|
13
|
+
"content-display-title": "awsui_content-display-title_1f3h0_1xy46_358",
|
|
14
|
+
"content-display-description": "awsui_content-display-description_1f3h0_1xy46_367",
|
|
15
|
+
"content-display-option-list": "awsui_content-display-option-list_1f3h0_1xy46_375"
|
|
15
16
|
};
|
|
16
17
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/collection-preferences/index.tsx"],"names":[],"mappings":";AAuBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAiB1D,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAItC,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAC5C,KAAK,EACL,YAAY,EACZ,WAAW,EACX,QAAgB,EAChB,SAAS,EACT,QAAQ,EACR,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,GAAG,IAAI,EACR,EAAE,0BAA0B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/collection-preferences/index.tsx"],"names":[],"mappings":";AAuBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAiB1D,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAItC,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAC5C,KAAK,EACL,YAAY,EACZ,WAAW,EACX,QAAgB,EAChB,SAAS,EACT,QAAQ,EACR,wBAAwB,EACxB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,EACvB,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,GAAG,IAAI,EACR,EAAE,0BAA0B,eAqM5B"}
|
|
@@ -30,7 +30,7 @@ export default function CollectionPreferences(_a) {
|
|
|
30
30
|
const parentMetadata = useContext(CollectionPreferencesMetadata);
|
|
31
31
|
const { __internalRootRef } = useBaseComponent('CollectionPreferences', {
|
|
32
32
|
props: {},
|
|
33
|
-
metadata: Object.assign(Object.assign({}, parentMetadata), { hasStripedRowsPreference: !!stripedRowsPreference, hasVisibleContentPreference: !!visibleContentPreference, hasContentDisplayPreference: !!contentDisplayPreference, hasContentDensityPreference: !!contentDensityPreference, hasStickyColumnsPreference: !!stickyColumnsPreference, visibleContentOptionsCount: (_b = visibleContentPreference === null || visibleContentPreference === void 0 ? void 0 : visibleContentPreference.options) === null || _b === void 0 ? void 0 : _b.length }),
|
|
33
|
+
metadata: Object.assign(Object.assign({}, parentMetadata), { hasStripedRowsPreference: !!stripedRowsPreference, hasVisibleContentPreference: !!visibleContentPreference, hasContentDisplayPreference: !!contentDisplayPreference, hasContentDensityPreference: !!contentDensityPreference, hasStickyColumnsPreference: !!stickyColumnsPreference, hasContentDisplayColumnFiltering: !!(contentDisplayPreference === null || contentDisplayPreference === void 0 ? void 0 : contentDisplayPreference.enableColumnFiltering), visibleContentOptionsCount: (_b = visibleContentPreference === null || visibleContentPreference === void 0 ? void 0 : visibleContentPreference.options) === null || _b === void 0 ? void 0 : _b.length }),
|
|
34
34
|
});
|
|
35
35
|
checkControlled('CollectionPreferences', 'preferences', preferences, 'onConfirm', onConfirm);
|
|
36
36
|
const i18n = useInternalI18n('collection-preferences');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/collection-preferences/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,6BAA6B,EAAE,MAAM,6DAA6D,CAAC;AAC5G,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,eAAe,MAAM,oCAAoC,CAAC;AACjE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,wBAAwB,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EACL,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,wBAAwB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ourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalBox from '../box/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { CollectionPreferencesMetadata } from '../internal/context/collection-preferences-metadata-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport InternalModal from '../modal/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { getComponentAnalyticsMetadata } from './analytics-metadata/utils';\nimport ContentDisplayPreference from './content-display';\nimport { CollectionPreferencesProps } from './interfaces';\nimport {\n ContentDensityPreference,\n copyPreferences,\n CustomPreference,\n mergePreferences,\n ModalContentLayout,\n PageSizePreference,\n StickyColumnsPreference,\n StripedRowsPreference,\n WrapLinesPreference,\n} from './utils';\nimport VisibleContentPreference from './visible-content';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport { CollectionPreferencesProps };\n\nconst componentName = 'CollectionPreferences';\n\nexport default function CollectionPreferences({\n title,\n confirmLabel,\n cancelLabel,\n disabled = false,\n onConfirm,\n onCancel,\n visibleContentPreference,\n contentDisplayPreference,\n pageSizePreference,\n wrapLinesPreference,\n stripedRowsPreference,\n contentDensityPreference,\n stickyColumnsPreference,\n preferences,\n customPreference,\n getModalRoot,\n removeModalRoot,\n contentBefore,\n ...rest\n}: CollectionPreferencesProps) {\n const parentMetadata = useContext(CollectionPreferencesMetadata);\n const { __internalRootRef } = useBaseComponent('CollectionPreferences', {\n props: {},\n metadata: {\n ...parentMetadata,\n hasStripedRowsPreference: !!stripedRowsPreference,\n hasVisibleContentPreference: !!visibleContentPreference,\n hasContentDisplayPreference: !!contentDisplayPreference,\n hasContentDensityPreference: !!contentDensityPreference,\n hasStickyColumnsPreference: !!stickyColumnsPreference,\n visibleContentOptionsCount: visibleContentPreference?.options?.length,\n },\n });\n checkControlled('CollectionPreferences', 'preferences', preferences, 'onConfirm', onConfirm);\n\n const i18n = useInternalI18n('collection-preferences');\n const baseProps = getBaseProps(rest);\n const [modalVisible, setModalVisible] = useState(false);\n const [temporaryPreferences, setTemporaryPreferences] = useState(copyPreferences(preferences || {}));\n const triggerRef = useRef<ButtonProps.Ref>(null);\n const dialogPreviouslyOpen = useRef(false);\n\n useEffect(() => {\n if (!modalVisible) {\n dialogPreviouslyOpen.current && triggerRef.current && triggerRef.current.focus();\n } else {\n dialogPreviouslyOpen.current = true;\n }\n }, [modalVisible]);\n\n const onConfirmListener = () => {\n setModalVisible(false);\n fireNonCancelableEvent(onConfirm, temporaryPreferences);\n };\n\n const onCancelListener = () => {\n fireNonCancelableEvent(onCancel, {});\n setModalVisible(false);\n setTemporaryPreferences(copyPreferences(preferences || {}));\n };\n\n const hasContentOnTheLeft = !!(\n pageSizePreference ||\n wrapLinesPreference ||\n stripedRowsPreference ||\n contentDensityPreference ||\n stickyColumnsPreference ||\n customPreference\n );\n const hasContentOnTheRight = !!(visibleContentPreference || contentDisplayPreference);\n\n const onChange = (changedPreferences: CollectionPreferencesProps.Preferences) =>\n setTemporaryPreferences(mergePreferences(changedPreferences, temporaryPreferences));\n\n if (visibleContentPreference && contentDisplayPreference) {\n warnOnce(\n componentName,\n 'You provided both `visibleContentPreference` and `contentDisplayPreference` props. `visibleContentPreference` will be ignored and only `contentDisplayPreference` will be rendered.'\n );\n }\n\n const referrerId = useUniqueId();\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n <div\n id={referrerId}\n {...getAnalyticsMetadataAttribute({ component: getComponentAnalyticsMetadata(disabled, preferences) })}\n >\n <InternalButton\n ref={triggerRef}\n className={clsx(styles['trigger-button'], analyticsSelectors['trigger-button'])}\n disabled={disabled}\n ariaLabel={i18n('title', title)}\n onClick={() => {\n setTemporaryPreferences(copyPreferences(preferences || {}));\n setModalVisible(true);\n }}\n variant=\"icon\"\n iconName=\"settings\"\n formAction=\"none\"\n analyticsAction=\"open\"\n />\n {!disabled && modalVisible && (\n <InternalModal\n className={styles['modal-root']}\n visible={true}\n getModalRoot={getModalRoot}\n removeModalRoot={removeModalRoot}\n header={i18n('title', title)}\n referrerId={referrerId}\n footer={\n <InternalBox float=\"right\">\n <InternalSpaceBetween direction=\"horizontal\" size=\"xs\">\n <InternalButton\n className={styles['cancel-button']}\n variant=\"link\"\n formAction=\"none\"\n onClick={onCancelListener}\n analyticsAction=\"cancel\"\n >\n {i18n('cancelLabel', cancelLabel)}\n </InternalButton>\n <InternalButton\n className={styles['confirm-button']}\n variant=\"primary\"\n formAction=\"none\"\n onClick={onConfirmListener}\n analyticsAction=\"confirm\"\n >\n {i18n('confirmLabel', confirmLabel)}\n </InternalButton>\n </InternalSpaceBetween>\n </InternalBox>\n }\n closeAriaLabel={cancelLabel}\n size={hasContentOnTheLeft && hasContentOnTheRight ? 'large' : 'medium'}\n onDismiss={onCancelListener}\n >\n {/* Content before */}\n <div className={styles['content-before']}>{contentBefore}</div>\n\n {/* Preferences content */}\n <ModalContentLayout\n left={\n hasContentOnTheLeft && (\n <InternalSpaceBetween size=\"l\">\n {pageSizePreference && (\n <PageSizePreference\n value={temporaryPreferences.pageSize}\n {...pageSizePreference}\n onChange={pageSize => onChange({ pageSize })}\n />\n )}\n {wrapLinesPreference && (\n <WrapLinesPreference\n value={temporaryPreferences.wrapLines}\n {...wrapLinesPreference}\n onChange={wrapLines => onChange({ wrapLines })}\n />\n )}\n {stripedRowsPreference && (\n <StripedRowsPreference\n value={temporaryPreferences.stripedRows}\n {...stripedRowsPreference}\n onChange={stripedRows => onChange({ stripedRows })}\n />\n )}\n {contentDensityPreference && (\n <ContentDensityPreference\n value={temporaryPreferences.contentDensity}\n {...contentDensityPreference}\n onChange={contentDensity => onChange({ contentDensity })}\n />\n )}\n {stickyColumnsPreference && (\n <StickyColumnsPreference\n value={temporaryPreferences.stickyColumns}\n {...stickyColumnsPreference}\n onChange={stickyColumns => onChange({ stickyColumns })}\n />\n )}\n {customPreference && (\n <CustomPreference\n value={temporaryPreferences.custom}\n customPreference={customPreference}\n onChange={custom => onChange({ custom })}\n />\n )}\n </InternalSpaceBetween>\n )\n }\n right={\n contentDisplayPreference ? (\n <ContentDisplayPreference\n {...contentDisplayPreference}\n value={temporaryPreferences.contentDisplay}\n onChange={contentDisplay => onChange({ contentDisplay })}\n />\n ) : (\n visibleContentPreference && (\n <VisibleContentPreference\n value={temporaryPreferences.visibleContent}\n {...visibleContentPreference}\n onChange={visibleItems => onChange({ visibleContent: visibleItems })}\n />\n )\n )\n }\n />\n </InternalModal>\n )}\n </div>\n </div>\n );\n}\n\napplyDisplayName(CollectionPreferences, componentName);\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/collection-preferences/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AAEjH,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EA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C,EAAE,aAAa,EAAE,CAAC,IACtD,CACH;wBACA,gBAAgB,IAAI,CACnB,oBAAC,gBAAgB,IACf,KAAK,EAAE,oBAAoB,CAAC,MAAM,EAClC,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC,GACxC,CACH,CACoB,CACxB,EAEH,KAAK,EACH,wBAAwB,CAAC,CAAC,CAAC,CACzB,oBAAC,wBAAwB,oBACnB,wBAAwB,IAC5B,KAAK,EAAE,oBAAoB,CAAC,cAAc,EAC1C,QAAQ,EAAE,cAAc,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC,IACxD,CACH,CAAC,CAAC,CAAC,CACF,wBAAwB,IAAI,CAC1B,oBAAC,wBAAwB,kBACvB,KAAK,EAAE,oBAAoB,CAAC,cAAc,IACtC,wBAAwB,IAC5B,QAAQ,EAAE,YAAY,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,IACpE,CACH,CACF,GAEH,CACY,CACjB,CACG,CACF,CACP,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,qBAAqB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { getAnalyticsMetadataAttribute } from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport InternalBox from '../box/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport { useInternalI18n } from '../i18n/context';\nimport { getBaseProps } from '../internal/base-component';\nimport { CollectionPreferencesMetadata } from '../internal/context/collection-preferences-metadata-context';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport InternalModal from '../modal/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { getComponentAnalyticsMetadata } from './analytics-metadata/utils';\nimport ContentDisplayPreference from './content-display';\nimport { CollectionPreferencesProps } from './interfaces';\nimport {\n ContentDensityPreference,\n copyPreferences,\n CustomPreference,\n mergePreferences,\n ModalContentLayout,\n PageSizePreference,\n StickyColumnsPreference,\n StripedRowsPreference,\n WrapLinesPreference,\n} from './utils';\nimport VisibleContentPreference from './visible-content';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\n\nexport { CollectionPreferencesProps };\n\nconst componentName = 'CollectionPreferences';\n\nexport default function CollectionPreferences({\n title,\n confirmLabel,\n cancelLabel,\n disabled = false,\n onConfirm,\n onCancel,\n visibleContentPreference,\n contentDisplayPreference,\n pageSizePreference,\n wrapLinesPreference,\n stripedRowsPreference,\n contentDensityPreference,\n stickyColumnsPreference,\n preferences,\n customPreference,\n getModalRoot,\n removeModalRoot,\n contentBefore,\n ...rest\n}: CollectionPreferencesProps) {\n const parentMetadata = useContext(CollectionPreferencesMetadata);\n const { __internalRootRef } = useBaseComponent('CollectionPreferences', {\n props: {},\n metadata: {\n ...parentMetadata,\n hasStripedRowsPreference: !!stripedRowsPreference,\n hasVisibleContentPreference: !!visibleContentPreference,\n hasContentDisplayPreference: !!contentDisplayPreference,\n hasContentDensityPreference: !!contentDensityPreference,\n hasStickyColumnsPreference: !!stickyColumnsPreference,\n hasContentDisplayColumnFiltering: !!contentDisplayPreference?.enableColumnFiltering,\n visibleContentOptionsCount: visibleContentPreference?.options?.length,\n },\n });\n checkControlled('CollectionPreferences', 'preferences', preferences, 'onConfirm', onConfirm);\n\n const i18n = useInternalI18n('collection-preferences');\n const baseProps = getBaseProps(rest);\n const [modalVisible, setModalVisible] = useState(false);\n const [temporaryPreferences, setTemporaryPreferences] = useState(copyPreferences(preferences || {}));\n const triggerRef = useRef<ButtonProps.Ref>(null);\n const dialogPreviouslyOpen = useRef(false);\n\n useEffect(() => {\n if (!modalVisible) {\n dialogPreviouslyOpen.current && triggerRef.current && triggerRef.current.focus();\n } else {\n dialogPreviouslyOpen.current = true;\n }\n }, [modalVisible]);\n\n const onConfirmListener = () => {\n setModalVisible(false);\n fireNonCancelableEvent(onConfirm, temporaryPreferences);\n };\n\n const onCancelListener = () => {\n fireNonCancelableEvent(onCancel, {});\n setModalVisible(false);\n setTemporaryPreferences(copyPreferences(preferences || {}));\n };\n\n const hasContentOnTheLeft = !!(\n pageSizePreference ||\n wrapLinesPreference ||\n stripedRowsPreference ||\n contentDensityPreference ||\n stickyColumnsPreference ||\n customPreference\n );\n const hasContentOnTheRight = !!(visibleContentPreference || contentDisplayPreference);\n\n const onChange = (changedPreferences: CollectionPreferencesProps.Preferences) =>\n setTemporaryPreferences(mergePreferences(changedPreferences, temporaryPreferences));\n\n if (visibleContentPreference && contentDisplayPreference) {\n warnOnce(\n componentName,\n 'You provided both `visibleContentPreference` and `contentDisplayPreference` props. `visibleContentPreference` will be ignored and only `contentDisplayPreference` will be rendered.'\n );\n }\n\n const referrerId = useUniqueId();\n\n return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n <div\n id={referrerId}\n {...getAnalyticsMetadataAttribute({ component: getComponentAnalyticsMetadata(disabled, preferences) })}\n >\n <InternalButton\n ref={triggerRef}\n className={clsx(styles['trigger-button'], analyticsSelectors['trigger-button'])}\n disabled={disabled}\n ariaLabel={i18n('title', title)}\n onClick={() => {\n setTemporaryPreferences(copyPreferences(preferences || {}));\n setModalVisible(true);\n }}\n variant=\"icon\"\n iconName=\"settings\"\n formAction=\"none\"\n analyticsAction=\"open\"\n />\n {!disabled && modalVisible && (\n <InternalModal\n className={styles['modal-root']}\n visible={true}\n getModalRoot={getModalRoot}\n removeModalRoot={removeModalRoot}\n header={i18n('title', title)}\n referrerId={referrerId}\n footer={\n <InternalBox float=\"right\">\n <InternalSpaceBetween direction=\"horizontal\" size=\"xs\">\n <InternalButton\n className={styles['cancel-button']}\n variant=\"link\"\n formAction=\"none\"\n onClick={onCancelListener}\n analyticsAction=\"cancel\"\n >\n {i18n('cancelLabel', cancelLabel)}\n </InternalButton>\n <InternalButton\n className={styles['confirm-button']}\n variant=\"primary\"\n formAction=\"none\"\n onClick={onConfirmListener}\n analyticsAction=\"confirm\"\n >\n {i18n('confirmLabel', confirmLabel)}\n </InternalButton>\n </InternalSpaceBetween>\n </InternalBox>\n }\n closeAriaLabel={cancelLabel}\n size={hasContentOnTheLeft && hasContentOnTheRight ? 'large' : 'medium'}\n onDismiss={onCancelListener}\n >\n {/* Content before */}\n <div className={styles['content-before']}>{contentBefore}</div>\n\n {/* Preferences content */}\n <ModalContentLayout\n left={\n hasContentOnTheLeft && (\n <InternalSpaceBetween size=\"l\">\n {pageSizePreference && (\n <PageSizePreference\n value={temporaryPreferences.pageSize}\n {...pageSizePreference}\n onChange={pageSize => onChange({ pageSize })}\n />\n )}\n {wrapLinesPreference && (\n <WrapLinesPreference\n value={temporaryPreferences.wrapLines}\n {...wrapLinesPreference}\n onChange={wrapLines => onChange({ wrapLines })}\n />\n )}\n {stripedRowsPreference && (\n <StripedRowsPreference\n value={temporaryPreferences.stripedRows}\n {...stripedRowsPreference}\n onChange={stripedRows => onChange({ stripedRows })}\n />\n )}\n {contentDensityPreference && (\n <ContentDensityPreference\n value={temporaryPreferences.contentDensity}\n {...contentDensityPreference}\n onChange={contentDensity => onChange({ contentDensity })}\n />\n )}\n {stickyColumnsPreference && (\n <StickyColumnsPreference\n value={temporaryPreferences.stickyColumns}\n {...stickyColumnsPreference}\n onChange={stickyColumns => onChange({ stickyColumns })}\n />\n )}\n {customPreference && (\n <CustomPreference\n value={temporaryPreferences.custom}\n customPreference={customPreference}\n onChange={custom => onChange({ custom })}\n />\n )}\n </InternalSpaceBetween>\n )\n }\n right={\n contentDisplayPreference ? (\n <ContentDisplayPreference\n {...contentDisplayPreference}\n value={temporaryPreferences.contentDisplay}\n onChange={contentDisplay => onChange({ contentDisplay })}\n />\n ) : (\n visibleContentPreference && (\n <VisibleContentPreference\n value={temporaryPreferences.visibleContent}\n {...visibleContentPreference}\n onChange={visibleItems => onChange({ visibleContent: visibleItems })}\n />\n )\n )\n }\n />\n </InternalModal>\n )}\n </div>\n </div>\n );\n}\n\napplyDisplayName(CollectionPreferences, componentName);\n"]}
|
|
@@ -1,42 +1,43 @@
|
|
|
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
|
-
"content-display-option-label": "awsui_content-display-option-
|
|
16
|
-
"
|
|
17
|
-
"content-display
|
|
18
|
-
"content-display-
|
|
19
|
-
"content-display-
|
|
20
|
-
"content-display-
|
|
21
|
-
"content-display-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"page-size
|
|
35
|
-
"page-size-
|
|
36
|
-
"
|
|
37
|
-
"sticky-columns
|
|
38
|
-
"sticky-columns-
|
|
39
|
-
"sticky-columns-
|
|
40
|
-
"sticky-columns-
|
|
4
|
+
"visible-content": "awsui_visible-content_tc96w_bosuj_289",
|
|
5
|
+
"visible-content-toggle": "awsui_visible-content-toggle_tc96w_bosuj_290",
|
|
6
|
+
"visible-content-groups": "awsui_visible-content-groups_tc96w_bosuj_291",
|
|
7
|
+
"visible-content-group": "awsui_visible-content-group_tc96w_bosuj_291",
|
|
8
|
+
"visible-content-title": "awsui_visible-content-title_tc96w_bosuj_296",
|
|
9
|
+
"visible-content-group-label": "awsui_visible-content-group-label_tc96w_bosuj_306",
|
|
10
|
+
"visible-content-option": "awsui_visible-content-option_tc96w_bosuj_312",
|
|
11
|
+
"visible-content-option-label": "awsui_visible-content-option-label_tc96w_bosuj_325",
|
|
12
|
+
"content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_bosuj_620",
|
|
13
|
+
"content-display-option-content": "awsui_content-display-option-content_tc96w_bosuj_624",
|
|
14
|
+
"content-display-option": "awsui_content-display-option_tc96w_bosuj_620",
|
|
15
|
+
"content-display-option-label": "awsui_content-display-option-label_tc96w_bosuj_672",
|
|
16
|
+
"drag-handle-wrapper": "awsui_drag-handle-wrapper_tc96w_bosuj_679",
|
|
17
|
+
"content-display": "awsui_content-display_tc96w_bosuj_620",
|
|
18
|
+
"content-display-text-filter": "awsui_content-display-text-filter_tc96w_bosuj_684",
|
|
19
|
+
"content-display-no-match": "awsui_content-display-no-match_tc96w_bosuj_685",
|
|
20
|
+
"content-display-title": "awsui_content-display-title_tc96w_bosuj_689",
|
|
21
|
+
"content-display-description": "awsui_content-display-description_tc96w_bosuj_698",
|
|
22
|
+
"content-display-option-list": "awsui_content-display-option-list_tc96w_bosuj_706",
|
|
23
|
+
"root": "awsui_root_tc96w_bosuj_713",
|
|
24
|
+
"modal-root": "awsui_modal-root_tc96w_bosuj_714",
|
|
25
|
+
"trigger-button": "awsui_trigger-button_tc96w_bosuj_715",
|
|
26
|
+
"cancel-button": "awsui_cancel-button_tc96w_bosuj_716",
|
|
27
|
+
"confirm-button": "awsui_confirm-button_tc96w_bosuj_717",
|
|
28
|
+
"custom": "awsui_custom_tc96w_bosuj_718",
|
|
29
|
+
"content-before": "awsui_content-before_tc96w_bosuj_719",
|
|
30
|
+
"second-column-small": "awsui_second-column-small_tc96w_bosuj_723",
|
|
31
|
+
"wrap-lines": "awsui_wrap-lines_tc96w_bosuj_727",
|
|
32
|
+
"striped-rows": "awsui_striped-rows_tc96w_bosuj_728",
|
|
33
|
+
"content-density": "awsui_content-density_tc96w_bosuj_729",
|
|
34
|
+
"page-size": "awsui_page-size_tc96w_bosuj_730",
|
|
35
|
+
"page-size-form-field": "awsui_page-size-form-field_tc96w_bosuj_731",
|
|
36
|
+
"page-size-radio-group": "awsui_page-size-radio-group_tc96w_bosuj_732",
|
|
37
|
+
"sticky-columns": "awsui_sticky-columns_tc96w_bosuj_733",
|
|
38
|
+
"sticky-columns-form-field": "awsui_sticky-columns-form-field_tc96w_bosuj_734",
|
|
39
|
+
"sticky-columns-radio-group": "awsui_sticky-columns-radio-group_tc96w_bosuj_735",
|
|
40
|
+
"sticky-columns-first": "awsui_sticky-columns-first_tc96w_bosuj_736",
|
|
41
|
+
"sticky-columns-last": "awsui_sticky-columns-last_tc96w_bosuj_737"
|
|
41
42
|
};
|
|
42
43
|
|