@cloudscape-design/components 3.0.205 → 3.0.207
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/annotation-context/annotation/styles.css.js +24 -24
- package/annotation-context/annotation/styles.scoped.css +30 -30
- package/annotation-context/annotation/styles.selectors.js +24 -24
- package/app-layout/index.d.ts.map +1 -1
- package/app-layout/index.js +1 -1
- package/app-layout/index.js.map +1 -1
- package/app-layout/notifications/index.d.ts +1 -0
- package/app-layout/notifications/index.d.ts.map +1 -1
- package/app-layout/notifications/index.js +2 -2
- package/app-layout/notifications/index.js.map +1 -1
- package/app-layout/notifications/styles.css.js +3 -2
- package/app-layout/notifications/styles.scoped.css +14 -6
- package/app-layout/notifications/styles.selectors.js +3 -2
- package/app-layout/styles.css.js +26 -26
- package/app-layout/styles.scoped.css +35 -35
- package/app-layout/styles.selectors.js +26 -26
- package/app-layout/visual-refresh/notifications.d.ts.map +1 -1
- package/app-layout/visual-refresh/notifications.js +6 -1
- package/app-layout/visual-refresh/notifications.js.map +1 -1
- package/app-layout/visual-refresh/styles.css.js +60 -60
- package/app-layout/visual-refresh/styles.scoped.css +260 -260
- package/app-layout/visual-refresh/styles.selectors.js +60 -60
- package/collection-preferences/index.d.ts +1 -1
- package/collection-preferences/index.d.ts.map +1 -1
- package/collection-preferences/index.js +6 -4
- package/collection-preferences/index.js.map +1 -1
- package/collection-preferences/interfaces.d.ts +17 -0
- package/collection-preferences/interfaces.d.ts.map +1 -1
- package/collection-preferences/interfaces.js.map +1 -1
- package/collection-preferences/styles.css.js +21 -20
- package/collection-preferences/styles.scoped.css +22 -21
- package/collection-preferences/styles.selectors.js +21 -20
- package/collection-preferences/utils.d.ts +6 -1
- package/collection-preferences/utils.d.ts.map +1 -1
- package/collection-preferences/utils.js +10 -1
- package/collection-preferences/utils.js.map +1 -1
- package/flashbar/collapsible-flashbar.d.ts.map +1 -1
- package/flashbar/collapsible-flashbar.js +4 -4
- package/flashbar/collapsible-flashbar.js.map +1 -1
- package/flashbar/styles.css.js +45 -43
- package/flashbar/styles.scoped.css +289 -176
- package/flashbar/styles.selectors.js +45 -43
- package/internal/base-component/styles.scoped.css +20 -0
- package/internal/components/dropdown/index.d.ts.map +1 -1
- package/internal/components/dropdown/index.js +2 -1
- package/internal/components/dropdown/index.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/generated/custom-css-properties/index.d.ts.map +1 -1
- package/internal/generated/custom-css-properties/index.js +29 -28
- package/internal/generated/custom-css-properties/index.js.map +1 -1
- package/internal/generated/theming/index.cjs +358 -0
- package/internal/generated/theming/index.cjs.d.ts +165 -0
- package/internal/generated/theming/index.d.ts +165 -0
- package/internal/generated/theming/index.js +358 -0
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/split-panel/styles.css.js +59 -59
- package/split-panel/styles.scoped.css +83 -83
- package/split-panel/styles.selectors.js +59 -59
- package/table/index.d.ts.map +1 -1
- package/table/index.js +2 -2
- package/table/index.js.map +1 -1
- package/table/interfaces.d.ts +4 -0
- package/table/interfaces.d.ts.map +1 -1
- package/table/interfaces.js.map +1 -1
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +4 -3
- package/table/internal.js.map +1 -1
- package/table/sticky-header.d.ts +1 -0
- package/table/sticky-header.d.ts.map +1 -1
- package/table/sticky-header.js +3 -2
- package/table/sticky-header.js.map +1 -1
- package/test-utils/dom/collection-preferences/index.d.ts +1 -0
- package/test-utils/dom/collection-preferences/index.js +3 -0
- package/test-utils/dom/collection-preferences/index.js.map +1 -1
- package/test-utils/selectors/collection-preferences/index.d.ts +1 -0
- package/test-utils/selectors/collection-preferences/index.js +3 -0
- package/test-utils/selectors/collection-preferences/index.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
|
@@ -2,65 +2,65 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"appbar": "
|
|
6
|
-
"appbar-nav": "awsui_appbar-
|
|
7
|
-
"breadcrumbs": "
|
|
8
|
-
"appbar-tools": "awsui_appbar-
|
|
9
|
-
"has-breadcrumbs": "awsui_has-
|
|
10
|
-
"has-notifications-content": "awsui_has-notifications-
|
|
11
|
-
"has-header": "awsui_has-
|
|
12
|
-
"has-dynamic-overlap-height": "awsui_has-dynamic-overlap-
|
|
13
|
-
"content-type-wizard": "awsui_content-type-
|
|
14
|
-
"content-type-cards": "awsui_content-type-
|
|
15
|
-
"content-type-table": "awsui_content-type-
|
|
16
|
-
"has-sticky-background": "awsui_has-sticky-
|
|
17
|
-
"background": "
|
|
18
|
-
"notifications-appbar-header": "awsui_notifications-appbar-
|
|
19
|
-
"sticky-notifications": "awsui_sticky-
|
|
20
|
-
"overlap": "
|
|
21
|
-
"content": "
|
|
22
|
-
"layout": "
|
|
23
|
-
"has-max-content-width": "awsui_has-max-content-
|
|
24
|
-
"is-overlap-disabled": "awsui_is-overlap-
|
|
25
|
-
"disable-body-scroll": "awsui_disable-body-
|
|
26
|
-
"has-sticky-notifications": "awsui_has-sticky-
|
|
27
|
-
"has-split-panel": "awsui_has-split-
|
|
28
|
-
"split-panel-position-bottom": "awsui_split-panel-position-
|
|
29
|
-
"has-content-gap-left": "awsui_has-content-gap-
|
|
30
|
-
"has-content-gap-right": "awsui_has-content-gap-
|
|
31
|
-
"block-body-scroll": "awsui_block-body-
|
|
32
|
-
"container": "
|
|
33
|
-
"disable-content-paddings": "awsui_disable-content-
|
|
34
|
-
"is-navigation-open": "awsui_is-navigation-
|
|
35
|
-
"is-tools-open": "awsui_is-tools-
|
|
36
|
-
"is-split-panel-open": "awsui_is-split-panel-
|
|
37
|
-
"split-panel-position-side": "awsui_split-panel-position-
|
|
38
|
-
"content-type-default": "awsui_content-type-
|
|
39
|
-
"content-type-form": "awsui_content-type-
|
|
40
|
-
"unfocusable": "
|
|
41
|
-
"navigation-container": "awsui_navigation-
|
|
42
|
-
"show-navigation": "awsui_show-
|
|
43
|
-
"animating": "
|
|
44
|
-
"showButtons": "
|
|
45
|
-
"navigation": "
|
|
46
|
-
"openNavigation": "
|
|
47
|
-
"animated-content": "awsui_animated-
|
|
48
|
-
"hide-navigation": "awsui_hide-
|
|
49
|
-
"notifications": "
|
|
50
|
-
"split-panel-bottom": "awsui_split-panel-
|
|
51
|
-
"position-bottom": "awsui_position-
|
|
52
|
-
"openSplitPanelBottom": "
|
|
53
|
-
"split-panel-side": "awsui_split-panel-
|
|
54
|
-
"position-side": "awsui_position-
|
|
55
|
-
"openSplitPanelSide": "
|
|
56
|
-
"tools-container": "awsui_tools-
|
|
57
|
-
"tools": "
|
|
58
|
-
"openTools": "
|
|
59
|
-
"has-tools-form-persistence": "awsui_has-tools-form-
|
|
60
|
-
"hide-tools": "awsui_hide-
|
|
61
|
-
"show-tools": "awsui_show-
|
|
62
|
-
"has-tools-form": "awsui_has-tools-
|
|
63
|
-
"trigger": "
|
|
64
|
-
"selected": "
|
|
5
|
+
"appbar": "awsui_appbar_hyvsj_vwhok_93",
|
|
6
|
+
"appbar-nav": "awsui_appbar-nav_hyvsj_vwhok_117",
|
|
7
|
+
"breadcrumbs": "awsui_breadcrumbs_hyvsj_vwhok_121",
|
|
8
|
+
"appbar-tools": "awsui_appbar-tools_hyvsj_vwhok_125",
|
|
9
|
+
"has-breadcrumbs": "awsui_has-breadcrumbs_hyvsj_vwhok_166",
|
|
10
|
+
"has-notifications-content": "awsui_has-notifications-content_hyvsj_vwhok_173",
|
|
11
|
+
"has-header": "awsui_has-header_hyvsj_vwhok_179",
|
|
12
|
+
"has-dynamic-overlap-height": "awsui_has-dynamic-overlap-height_hyvsj_vwhok_179",
|
|
13
|
+
"content-type-wizard": "awsui_content-type-wizard_hyvsj_vwhok_180",
|
|
14
|
+
"content-type-cards": "awsui_content-type-cards_hyvsj_vwhok_183",
|
|
15
|
+
"content-type-table": "awsui_content-type-table_hyvsj_vwhok_184",
|
|
16
|
+
"has-sticky-background": "awsui_has-sticky-background_hyvsj_vwhok_187",
|
|
17
|
+
"background": "awsui_background_hyvsj_vwhok_221",
|
|
18
|
+
"notifications-appbar-header": "awsui_notifications-appbar-header_hyvsj_vwhok_224",
|
|
19
|
+
"sticky-notifications": "awsui_sticky-notifications_hyvsj_vwhok_236",
|
|
20
|
+
"overlap": "awsui_overlap_hyvsj_vwhok_242",
|
|
21
|
+
"content": "awsui_content_hyvsj_vwhok_180",
|
|
22
|
+
"layout": "awsui_layout_hyvsj_vwhok_333",
|
|
23
|
+
"has-max-content-width": "awsui_has-max-content-width_hyvsj_vwhok_415",
|
|
24
|
+
"is-overlap-disabled": "awsui_is-overlap-disabled_hyvsj_vwhok_442",
|
|
25
|
+
"disable-body-scroll": "awsui_disable-body-scroll_hyvsj_vwhok_445",
|
|
26
|
+
"has-sticky-notifications": "awsui_has-sticky-notifications_hyvsj_vwhok_449",
|
|
27
|
+
"has-split-panel": "awsui_has-split-panel_hyvsj_vwhok_463",
|
|
28
|
+
"split-panel-position-bottom": "awsui_split-panel-position-bottom_hyvsj_vwhok_463",
|
|
29
|
+
"has-content-gap-left": "awsui_has-content-gap-left_hyvsj_vwhok_475",
|
|
30
|
+
"has-content-gap-right": "awsui_has-content-gap-right_hyvsj_vwhok_478",
|
|
31
|
+
"block-body-scroll": "awsui_block-body-scroll_hyvsj_vwhok_493",
|
|
32
|
+
"container": "awsui_container_hyvsj_vwhok_501",
|
|
33
|
+
"disable-content-paddings": "awsui_disable-content-paddings_hyvsj_vwhok_527",
|
|
34
|
+
"is-navigation-open": "awsui_is-navigation-open_hyvsj_vwhok_532",
|
|
35
|
+
"is-tools-open": "awsui_is-tools-open_hyvsj_vwhok_535",
|
|
36
|
+
"is-split-panel-open": "awsui_is-split-panel-open_hyvsj_vwhok_535",
|
|
37
|
+
"split-panel-position-side": "awsui_split-panel-position-side_hyvsj_vwhok_535",
|
|
38
|
+
"content-type-default": "awsui_content-type-default_hyvsj_vwhok_555",
|
|
39
|
+
"content-type-form": "awsui_content-type-form_hyvsj_vwhok_555",
|
|
40
|
+
"unfocusable": "awsui_unfocusable_hyvsj_vwhok_596",
|
|
41
|
+
"navigation-container": "awsui_navigation-container_hyvsj_vwhok_606",
|
|
42
|
+
"show-navigation": "awsui_show-navigation_hyvsj_vwhok_641",
|
|
43
|
+
"animating": "awsui_animating_hyvsj_vwhok_663",
|
|
44
|
+
"showButtons": "awsui_showButtons_hyvsj_vwhok_1",
|
|
45
|
+
"navigation": "awsui_navigation_hyvsj_vwhok_606",
|
|
46
|
+
"openNavigation": "awsui_openNavigation_hyvsj_vwhok_1",
|
|
47
|
+
"animated-content": "awsui_animated-content_hyvsj_vwhok_724",
|
|
48
|
+
"hide-navigation": "awsui_hide-navigation_hyvsj_vwhok_733",
|
|
49
|
+
"notifications": "awsui_notifications_hyvsj_vwhok_224",
|
|
50
|
+
"split-panel-bottom": "awsui_split-panel-bottom_hyvsj_vwhok_799",
|
|
51
|
+
"position-bottom": "awsui_position-bottom_hyvsj_vwhok_845",
|
|
52
|
+
"openSplitPanelBottom": "awsui_openSplitPanelBottom_hyvsj_vwhok_1",
|
|
53
|
+
"split-panel-side": "awsui_split-panel-side_hyvsj_vwhok_874",
|
|
54
|
+
"position-side": "awsui_position-side_hyvsj_vwhok_902",
|
|
55
|
+
"openSplitPanelSide": "awsui_openSplitPanelSide_hyvsj_vwhok_1",
|
|
56
|
+
"tools-container": "awsui_tools-container_hyvsj_vwhok_939",
|
|
57
|
+
"tools": "awsui_tools_hyvsj_vwhok_939",
|
|
58
|
+
"openTools": "awsui_openTools_hyvsj_vwhok_1",
|
|
59
|
+
"has-tools-form-persistence": "awsui_has-tools-form-persistence_hyvsj_vwhok_1024",
|
|
60
|
+
"hide-tools": "awsui_hide-tools_hyvsj_vwhok_1034",
|
|
61
|
+
"show-tools": "awsui_show-tools_hyvsj_vwhok_1046",
|
|
62
|
+
"has-tools-form": "awsui_has-tools-form_hyvsj_vwhok_1024",
|
|
63
|
+
"trigger": "awsui_trigger_hyvsj_vwhok_1103",
|
|
64
|
+
"selected": "awsui_selected_hyvsj_vwhok_1142"
|
|
65
65
|
};
|
|
66
66
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CollectionPreferencesProps } from './interfaces';
|
|
2
2
|
export { CollectionPreferencesProps };
|
|
3
|
-
export default function CollectionPreferences({ title, confirmLabel, cancelLabel, disabled, onConfirm, onCancel, visibleContentPreference, pageSizePreference, wrapLinesPreference, stripedRowsPreference, preferences, customPreference, ...rest }: CollectionPreferencesProps): JSX.Element;
|
|
3
|
+
export default function CollectionPreferences({ title, confirmLabel, cancelLabel, disabled, onConfirm, onCancel, visibleContentPreference, pageSizePreference, wrapLinesPreference, stripedRowsPreference, contentDensityPreference, preferences, customPreference, ...rest }: CollectionPreferencesProps): JSX.Element;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/collection-preferences/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/collection-preferences/index.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAK1D,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAiGtC,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,EAC5C,KAAK,EACL,YAAY,EACZ,WAAW,EACX,QAAgB,EAChB,SAAS,EACT,QAAQ,EACR,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,WAAW,EACX,gBAAgB,EAChB,GAAG,IAAI,EACR,EAAE,0BAA0B,eAyF5B"}
|
|
@@ -9,18 +9,19 @@ import InternalBox from '../box/internal';
|
|
|
9
9
|
import { InternalButton } from '../button/internal';
|
|
10
10
|
import InternalModal from '../modal/internal';
|
|
11
11
|
import InternalSpaceBetween from '../space-between/internal';
|
|
12
|
-
import { copyPreferences, mergePreferences, ModalContentLayout, PageSizePreference, WrapLinesPreference, StripedRowsPreference, CustomPreference, } from './utils';
|
|
12
|
+
import { copyPreferences, mergePreferences, ModalContentLayout, PageSizePreference, WrapLinesPreference, StripedRowsPreference, ContentDensityPreference, CustomPreference, } from './utils';
|
|
13
13
|
import VisibleContentPreference from './visible-content';
|
|
14
14
|
import checkControlled from '../internal/hooks/check-controlled';
|
|
15
15
|
import styles from './styles.css.js';
|
|
16
16
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
17
17
|
import useBaseComponent from '../internal/hooks/use-base-component';
|
|
18
18
|
var ModalContent = function (_a) {
|
|
19
|
-
var _b = _a.preferences, preferences = _b === void 0 ? {} : _b, pageSizePreference = _a.pageSizePreference, wrapLinesPreference = _a.wrapLinesPreference, stripedRowsPreference = _a.stripedRowsPreference, customPreference = _a.customPreference, visibleContentPreference = _a.visibleContentPreference, onChange = _a.onChange;
|
|
19
|
+
var _b = _a.preferences, preferences = _b === void 0 ? {} : _b, pageSizePreference = _a.pageSizePreference, wrapLinesPreference = _a.wrapLinesPreference, stripedRowsPreference = _a.stripedRowsPreference, contentDensityPreference = _a.contentDensityPreference, customPreference = _a.customPreference, visibleContentPreference = _a.visibleContentPreference, onChange = _a.onChange;
|
|
20
20
|
if (!visibleContentPreference &&
|
|
21
21
|
!pageSizePreference &&
|
|
22
22
|
!wrapLinesPreference &&
|
|
23
23
|
!stripedRowsPreference &&
|
|
24
|
+
!contentDensityPreference &&
|
|
24
25
|
customPreference) {
|
|
25
26
|
return (React.createElement(CustomPreference, { value: preferences.custom, customPreference: customPreference, onChange: function (custom) { return onChange({ custom: custom }); } }));
|
|
26
27
|
}
|
|
@@ -28,10 +29,11 @@ var ModalContent = function (_a) {
|
|
|
28
29
|
pageSizePreference && (React.createElement(PageSizePreference, __assign({ value: preferences.pageSize }, pageSizePreference, { onChange: function (pageSize) { return onChange({ pageSize: pageSize }); } }))),
|
|
29
30
|
wrapLinesPreference && (React.createElement(WrapLinesPreference, __assign({ value: preferences.wrapLines }, wrapLinesPreference, { onChange: function (wrapLines) { return onChange({ wrapLines: wrapLines }); } }))),
|
|
30
31
|
stripedRowsPreference && (React.createElement(StripedRowsPreference, __assign({ value: preferences.stripedRows }, stripedRowsPreference, { onChange: function (stripedRows) { return onChange({ stripedRows: stripedRows }); } }))),
|
|
32
|
+
contentDensityPreference && (React.createElement(ContentDensityPreference, __assign({ value: preferences.contentDensity }, contentDensityPreference, { onChange: function (contentDensity) { return onChange({ contentDensity: contentDensity }); } }))),
|
|
31
33
|
customPreference && (React.createElement(CustomPreference, { value: preferences.custom, customPreference: customPreference, onChange: function (custom) { return onChange({ custom: custom }); } }))), right: visibleContentPreference && (React.createElement(VisibleContentPreference, __assign({ value: preferences.visibleContent }, visibleContentPreference, { onChange: function (visibleContent) { return onChange({ visibleContent: visibleContent }); } }))) }));
|
|
32
34
|
};
|
|
33
35
|
export default function CollectionPreferences(_a) {
|
|
34
|
-
var title = _a.title, confirmLabel = _a.confirmLabel, cancelLabel = _a.cancelLabel, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onConfirm = _a.onConfirm, onCancel = _a.onCancel, visibleContentPreference = _a.visibleContentPreference, pageSizePreference = _a.pageSizePreference, wrapLinesPreference = _a.wrapLinesPreference, stripedRowsPreference = _a.stripedRowsPreference, preferences = _a.preferences, customPreference = _a.customPreference, rest = __rest(_a, ["title", "confirmLabel", "cancelLabel", "disabled", "onConfirm", "onCancel", "visibleContentPreference", "pageSizePreference", "wrapLinesPreference", "stripedRowsPreference", "preferences", "customPreference"]);
|
|
36
|
+
var title = _a.title, confirmLabel = _a.confirmLabel, cancelLabel = _a.cancelLabel, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onConfirm = _a.onConfirm, onCancel = _a.onCancel, visibleContentPreference = _a.visibleContentPreference, pageSizePreference = _a.pageSizePreference, wrapLinesPreference = _a.wrapLinesPreference, stripedRowsPreference = _a.stripedRowsPreference, contentDensityPreference = _a.contentDensityPreference, preferences = _a.preferences, customPreference = _a.customPreference, rest = __rest(_a, ["title", "confirmLabel", "cancelLabel", "disabled", "onConfirm", "onCancel", "visibleContentPreference", "pageSizePreference", "wrapLinesPreference", "stripedRowsPreference", "contentDensityPreference", "preferences", "customPreference"]);
|
|
35
37
|
var __internalRootRef = useBaseComponent('CollectionPreferences').__internalRootRef;
|
|
36
38
|
checkControlled('CollectioPreferences', 'preferences', preferences, 'onConfirm', onConfirm);
|
|
37
39
|
var baseProps = getBaseProps(rest);
|
|
@@ -65,7 +67,7 @@ export default function CollectionPreferences(_a) {
|
|
|
65
67
|
React.createElement(InternalSpaceBetween, { direction: "horizontal", size: "xs" },
|
|
66
68
|
React.createElement(InternalButton, { className: styles['cancel-button'], variant: "link", formAction: "none", onClick: onCancelListener }, cancelLabel),
|
|
67
69
|
React.createElement(InternalButton, { className: styles['confirm-button'], variant: "primary", formAction: "none", onClick: onConfirmListener }, confirmLabel))), closeAriaLabel: cancelLabel, size: "large", onDismiss: onCancelListener },
|
|
68
|
-
React.createElement(ModalContent, { preferences: temporaryPreferences, visibleContentPreference: visibleContentPreference, pageSizePreference: pageSizePreference, wrapLinesPreference: wrapLinesPreference, stripedRowsPreference: stripedRowsPreference, customPreference: customPreference, onChange: function (changedPreferences) {
|
|
70
|
+
React.createElement(ModalContent, { preferences: temporaryPreferences, visibleContentPreference: visibleContentPreference, pageSizePreference: pageSizePreference, wrapLinesPreference: wrapLinesPreference, stripedRowsPreference: stripedRowsPreference, contentDensityPreference: contentDensityPreference, customPreference: customPreference, onChange: function (changedPreferences) {
|
|
69
71
|
return setTemporaryPreferences(mergePreferences(changedPreferences, temporaryPreferences));
|
|
70
72
|
} })))));
|
|
71
73
|
}
|
|
@@ -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,SAAS,EAA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C,MAAM,EACjB,OAAO,EAAE,iBAAiB,IAEzB,YAAY,CACE,CACI,CACX,EAEhB,cAAc,EAAE,WAAW,EAC3B,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,gBAAgB;YAE3B,oBAAC,YAAY,IACX,WAAW,EAAE,oBAAoB,EACjC,wBAAwB,EAAE,wBAAwB,EAClD,kBAAkB,EAAE,kBAAkB,EACtC,mBAAmB,EAAE,mBAAmB,EACxC,qBAAqB,EAAE,qBAAqB,EAC5C,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,UAAA,kBAAkB;oBAC1B,OAAA,uBAAuB,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;gBAAnF,CAAmF,GAErF,CACY,CACjB,CACG,CACP,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalBox from '../box/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalModal from '../modal/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport {\n copyPreferences,\n mergePreferences,\n ModalContentLayout,\n PageSizePreference,\n WrapLinesPreference,\n StripedRowsPreference,\n CustomPreference,\n} from './utils';\nimport VisibleContentPreference from './visible-content';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { CollectionPreferencesProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { CollectionPreferencesProps };\n\ninterface ModalContentProps\n extends Pick<\n CollectionPreferencesProps,\n | 'preferences'\n | 'visibleContentPreference'\n | 'pageSizePreference'\n | 'wrapLinesPreference'\n | 'stripedRowsPreference'\n | 'customPreference'\n > {\n onChange: (preferences: CollectionPreferencesProps.Preferences) => void;\n}\n\nconst ModalContent = ({\n preferences = {},\n pageSizePreference,\n wrapLinesPreference,\n stripedRowsPreference,\n customPreference,\n visibleContentPreference,\n onChange,\n}: ModalContentProps) => {\n if (\n !visibleContentPreference &&\n !pageSizePreference &&\n !wrapLinesPreference &&\n !stripedRowsPreference &&\n customPreference\n ) {\n return (\n <CustomPreference\n value={preferences.custom}\n customPreference={customPreference}\n onChange={custom => onChange({ custom })}\n />\n );\n }\n\n return (\n <ModalContentLayout\n left={\n <InternalSpaceBetween size=\"l\">\n {pageSizePreference && (\n <PageSizePreference\n value={preferences.pageSize}\n {...pageSizePreference}\n onChange={pageSize => onChange({ pageSize })}\n />\n )}\n {wrapLinesPreference && (\n <WrapLinesPreference\n value={preferences.wrapLines}\n {...wrapLinesPreference}\n onChange={wrapLines => onChange({ wrapLines })}\n />\n )}\n {stripedRowsPreference && (\n <StripedRowsPreference\n value={preferences.stripedRows}\n {...stripedRowsPreference}\n onChange={stripedRows => onChange({ stripedRows })}\n />\n )}\n {customPreference && (\n <CustomPreference\n value={preferences.custom}\n customPreference={customPreference}\n onChange={custom => onChange({ custom })}\n />\n )}\n </InternalSpaceBetween>\n }\n right={\n visibleContentPreference && (\n <VisibleContentPreference\n value={preferences.visibleContent}\n {...visibleContentPreference}\n onChange={visibleContent => onChange({ visibleContent })}\n />\n )\n }\n />\n );\n};\n\nexport default function CollectionPreferences({\n title,\n confirmLabel,\n cancelLabel,\n disabled = false,\n onConfirm,\n onCancel,\n visibleContentPreference,\n pageSizePreference,\n wrapLinesPreference,\n stripedRowsPreference,\n preferences,\n customPreference,\n ...rest\n}: CollectionPreferencesProps) {\n const { __internalRootRef } = useBaseComponent('CollectionPreferences');\n checkControlled('CollectioPreferences', 'preferences', preferences, 'onConfirm', onConfirm);\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 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 return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n <InternalButton\n ref={triggerRef}\n className={styles['trigger-button']}\n disabled={disabled}\n ariaLabel={title}\n onClick={() => {\n setTemporaryPreferences(copyPreferences(preferences || {}));\n setModalVisible(true);\n }}\n variant=\"icon\"\n iconName=\"settings\"\n formAction=\"none\"\n />\n {!disabled && modalVisible && (\n <InternalModal\n className={styles['modal-root']}\n visible={true}\n header={title}\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 >\n {cancelLabel}\n </InternalButton>\n <InternalButton\n className={styles['confirm-button']}\n variant=\"primary\"\n formAction=\"none\"\n onClick={onConfirmListener}\n >\n {confirmLabel}\n </InternalButton>\n </InternalSpaceBetween>\n </InternalBox>\n }\n closeAriaLabel={cancelLabel}\n size=\"large\"\n onDismiss={onCancelListener}\n >\n <ModalContent\n preferences={temporaryPreferences}\n visibleContentPreference={visibleContentPreference}\n pageSizePreference={pageSizePreference}\n wrapLinesPreference={wrapLinesPreference}\n stripedRowsPreference={stripedRowsPreference}\n customPreference={customPreference}\n onChange={changedPreferences =>\n setTemporaryPreferences(mergePreferences(changedPreferences, temporaryPreferences))\n }\n />\n </InternalModal>\n )}\n </div>\n );\n}\n\napplyDisplayName(CollectionPreferences, 'CollectionPreferences');\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,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,aAAa,MAAM,mBAAmB,CAAC;AAC9C,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,SAAS,CAAC;AACjB,OAAO,wBAAwB,MAAM,mBAAmB,CAAC;AACzD,OAAO,eAAe,MAAM,oCAAoC,CAAC;AAEjE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AAkBpE,IAAM,YAAY,GAAG,UAAC,EASF;QARlB,mBAAgB,EAAhB,WAAW,mBAAG,EAAE,KAAA,EAChB,kBAAkB,wBAAA,EAClB,mBAAmB,yBAAA,EACnB,qBAAqB,2BAAA,EACrB,wBAAwB,8BAAA,EACxB,gBAAgB,sBAAA,EAChB,wBAAwB,8BAAA,EACxB,QAAQ,cAAA;IAER,IACE,CAAC,wBAAwB;QACzB,CAAC,kBAAkB;QACnB,CAAC,mB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AAY,IAAI,CAC5B,oBAAC,aAAa,IACZ,SAAS,EAAE,MAAM,CAAC,YAAY,CAAC,EAC/B,OAAO,EAAE,IAAI,EACb,MAAM,EAAE,KAAK,EACb,MAAM,EACJ,oBAAC,WAAW,IAAC,KAAK,EAAC,OAAO;gBACxB,oBAAC,oBAAoB,IAAC,SAAS,EAAC,YAAY,EAAC,IAAI,EAAC,IAAI;oBACpD,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,eAAe,CAAC,EAClC,OAAO,EAAC,MAAM,EACd,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,gBAAgB,IAExB,WAAW,CACG;oBACjB,oBAAC,cAAc,IACb,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EACnC,OAAO,EAAC,SAAS,EACjB,UAAU,EAAC,MAAM,EACjB,OAAO,EAAE,iBAAiB,IAEzB,YAAY,CACE,CACI,CACX,EAEhB,cAAc,EAAE,WAAW,EAC3B,IAAI,EAAC,OAAO,EACZ,SAAS,EAAE,gBAAgB;YAE3B,oBAAC,YAAY,IACX,WAAW,EAAE,oBAAoB,EACjC,wBAAwB,EAAE,wBAAwB,EAClD,kBAAkB,EAAE,kBAAkB,EACtC,mBAAmB,EAAE,mBAAmB,EACxC,qBAAqB,EAAE,qBAAqB,EAC5C,wBAAwB,EAAE,wBAAwB,EAClD,gBAAgB,EAAE,gBAAgB,EAClC,QAAQ,EAAE,UAAA,kBAAkB;oBAC1B,OAAA,uBAAuB,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;gBAAnF,CAAmF,GAErF,CACY,CACjB,CACG,CACP,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { getBaseProps } from '../internal/base-component';\nimport InternalBox from '../box/internal';\nimport { ButtonProps } from '../button/interfaces';\nimport { InternalButton } from '../button/internal';\nimport InternalModal from '../modal/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport {\n copyPreferences,\n mergePreferences,\n ModalContentLayout,\n PageSizePreference,\n WrapLinesPreference,\n StripedRowsPreference,\n ContentDensityPreference,\n CustomPreference,\n} from './utils';\nimport VisibleContentPreference from './visible-content';\nimport checkControlled from '../internal/hooks/check-controlled';\nimport { CollectionPreferencesProps } from './interfaces';\nimport styles from './styles.css.js';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport useBaseComponent from '../internal/hooks/use-base-component';\n\nexport { CollectionPreferencesProps };\n\ninterface ModalContentProps\n extends Pick<\n CollectionPreferencesProps,\n | 'preferences'\n | 'visibleContentPreference'\n | 'pageSizePreference'\n | 'wrapLinesPreference'\n | 'stripedRowsPreference'\n | 'contentDensityPreference'\n | 'customPreference'\n > {\n onChange: (preferences: CollectionPreferencesProps.Preferences) => void;\n}\n\nconst ModalContent = ({\n preferences = {},\n pageSizePreference,\n wrapLinesPreference,\n stripedRowsPreference,\n contentDensityPreference,\n customPreference,\n visibleContentPreference,\n onChange,\n}: ModalContentProps) => {\n if (\n !visibleContentPreference &&\n !pageSizePreference &&\n !wrapLinesPreference &&\n !stripedRowsPreference &&\n !contentDensityPreference &&\n customPreference\n ) {\n return (\n <CustomPreference\n value={preferences.custom}\n customPreference={customPreference}\n onChange={custom => onChange({ custom })}\n />\n );\n }\n\n return (\n <ModalContentLayout\n left={\n <InternalSpaceBetween size=\"l\">\n {pageSizePreference && (\n <PageSizePreference\n value={preferences.pageSize}\n {...pageSizePreference}\n onChange={pageSize => onChange({ pageSize })}\n />\n )}\n {wrapLinesPreference && (\n <WrapLinesPreference\n value={preferences.wrapLines}\n {...wrapLinesPreference}\n onChange={wrapLines => onChange({ wrapLines })}\n />\n )}\n {stripedRowsPreference && (\n <StripedRowsPreference\n value={preferences.stripedRows}\n {...stripedRowsPreference}\n onChange={stripedRows => onChange({ stripedRows })}\n />\n )}\n {contentDensityPreference && (\n <ContentDensityPreference\n value={preferences.contentDensity}\n {...contentDensityPreference}\n onChange={contentDensity => onChange({ contentDensity })}\n />\n )}\n {customPreference && (\n <CustomPreference\n value={preferences.custom}\n customPreference={customPreference}\n onChange={custom => onChange({ custom })}\n />\n )}\n </InternalSpaceBetween>\n }\n right={\n visibleContentPreference && (\n <VisibleContentPreference\n value={preferences.visibleContent}\n {...visibleContentPreference}\n onChange={visibleContent => onChange({ visibleContent })}\n />\n )\n }\n />\n );\n};\n\nexport default function CollectionPreferences({\n title,\n confirmLabel,\n cancelLabel,\n disabled = false,\n onConfirm,\n onCancel,\n visibleContentPreference,\n pageSizePreference,\n wrapLinesPreference,\n stripedRowsPreference,\n contentDensityPreference,\n preferences,\n customPreference,\n ...rest\n}: CollectionPreferencesProps) {\n const { __internalRootRef } = useBaseComponent('CollectionPreferences');\n checkControlled('CollectioPreferences', 'preferences', preferences, 'onConfirm', onConfirm);\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 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 return (\n <div {...baseProps} className={clsx(baseProps.className, styles.root)} ref={__internalRootRef}>\n <InternalButton\n ref={triggerRef}\n className={styles['trigger-button']}\n disabled={disabled}\n ariaLabel={title}\n onClick={() => {\n setTemporaryPreferences(copyPreferences(preferences || {}));\n setModalVisible(true);\n }}\n variant=\"icon\"\n iconName=\"settings\"\n formAction=\"none\"\n />\n {!disabled && modalVisible && (\n <InternalModal\n className={styles['modal-root']}\n visible={true}\n header={title}\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 >\n {cancelLabel}\n </InternalButton>\n <InternalButton\n className={styles['confirm-button']}\n variant=\"primary\"\n formAction=\"none\"\n onClick={onConfirmListener}\n >\n {confirmLabel}\n </InternalButton>\n </InternalSpaceBetween>\n </InternalBox>\n }\n closeAriaLabel={cancelLabel}\n size=\"large\"\n onDismiss={onCancelListener}\n >\n <ModalContent\n preferences={temporaryPreferences}\n visibleContentPreference={visibleContentPreference}\n pageSizePreference={pageSizePreference}\n wrapLinesPreference={wrapLinesPreference}\n stripedRowsPreference={stripedRowsPreference}\n contentDensityPreference={contentDensityPreference}\n customPreference={customPreference}\n onChange={changedPreferences =>\n setTemporaryPreferences(mergePreferences(changedPreferences, temporaryPreferences))\n }\n />\n </InternalModal>\n )}\n </div>\n );\n}\n\napplyDisplayName(CollectionPreferences, 'CollectionPreferences');\n"]}
|
|
@@ -55,6 +55,18 @@ export interface CollectionPreferencesProps<CustomPreferenceType = any> extends
|
|
|
55
55
|
* You must set the current value in the `preferences.stripedRows` property.
|
|
56
56
|
*/
|
|
57
57
|
stripedRowsPreference?: CollectionPreferencesProps.StripedRowsPreference;
|
|
58
|
+
/**
|
|
59
|
+
* Configures the content density preference (Comfortable / Compact).
|
|
60
|
+
*
|
|
61
|
+
* If you set it, the component displays this preference in the modal.
|
|
62
|
+
*
|
|
63
|
+
* It contains the following:
|
|
64
|
+
* - `label` (string) - Specifies the label for the option checkbox.
|
|
65
|
+
* - `description` (string) - Specifies the text displayed below the checkbox label.
|
|
66
|
+
*
|
|
67
|
+
* You must set the current value in the `preferences.contentDensity` property.
|
|
68
|
+
*/
|
|
69
|
+
contentDensityPreference?: CollectionPreferencesProps.ContentDensityPreference;
|
|
58
70
|
/**
|
|
59
71
|
* Configures the built-in "visible content selection" preference (for example, visible columns in a table).
|
|
60
72
|
*
|
|
@@ -128,6 +140,7 @@ export declare namespace CollectionPreferencesProps {
|
|
|
128
140
|
pageSize?: number;
|
|
129
141
|
wrapLines?: boolean;
|
|
130
142
|
stripedRows?: boolean;
|
|
143
|
+
contentDensity?: 'comfortable' | 'compact';
|
|
131
144
|
visibleContent?: ReadonlyArray<string>;
|
|
132
145
|
custom?: CustomPreferenceType;
|
|
133
146
|
}
|
|
@@ -160,5 +173,9 @@ export declare namespace CollectionPreferencesProps {
|
|
|
160
173
|
label: string;
|
|
161
174
|
description: string;
|
|
162
175
|
}
|
|
176
|
+
interface ContentDensityPreference {
|
|
177
|
+
label: string;
|
|
178
|
+
description: string;
|
|
179
|
+
}
|
|
163
180
|
}
|
|
164
181
|
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/collection-preferences/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,0BAA0B,CAAC,oBAAoB,GAAG,GAAG,CAAE,SAAQ,kBAAkB;IAChG;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,EAAE,0BAA0B,CAAC,kBAAkB,CAAC;IACnE;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,EAAE,0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AC;QACd,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;IAED,UAAiB,kBAAkB;QACjC,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;KACxC;IAED,UAAiB,cAAc;QAC7B,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf;IAED,UAAiB,mBAAmB;QAClC,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB;IAED,UAAiB,qBAAqB;QACpC,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB;CACF"}
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/collection-preferences/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,0BAA0B,CAAC,oBAAoB,GAAG,GAAG,CAAE,SAAQ,kBAAkB;IAChG;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,EAAE,0BAA0B,CAAC,kBAAkB,CAAC;IACnE;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,EAAE,0BAA0B,CAAC,mBAAmB,CAAC;IACrE;;;;;;;;;;OAUG;IACH,qBAAqB,CAAC,EAAE,0BAA0B,CAAC,qBAAqB,CAAC;IACzE;;;;;;;;;;OAUG;IACH,wBAAwB,CAAC,EAAE,0BAA0B,CAAC,wBAAwB,CAAC;IAC/E;;;;;;;;;;;;;;;;;OAiBG;IACH,wBAAwB,CAAC,EAAE,0BAA0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CAAC,cAAc,CAAC,CAAC;KACxC;IAED,UAAiB,cAAc;QAC7B,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf;IAED,UAAiB,mBAAmB;QAClC,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB;IAED,UAAiB,qBAAqB;QACpC,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB;IAED,UAAiB,wBAAwB;QACvC,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;KACrB;CACF"}
|
|
@@ -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';\n\nexport interface CollectionPreferencesProps<CustomPreferenceType = any> extends BaseComponentProps {\n /**\n * Specifies the title of the preferences modal dialog. It is also used as an `aria-label` for the trigger button.\n */\n title: string;\n /**\n * Label of the confirm button in the modal footer.\n */\n confirmLabel: string;\n /**\n * Label of the cancel button in the modal footer.\n */\n cancelLabel: string;\n /**\n * Determines whether the preferences trigger button is disabled.\n */\n disabled?: boolean;\n /**\n * Configures the built-in \"page size selection\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `options` - Specifies an array of options for page size selection. Each entry contains:\n * - `value` (number) - The value for the radio button (that is, the number of items per page).\n * - `label` (string) - A label for the radio button (for example, \"10 resources\").\n *\n * You must set the current value in the `preferences.pageSize` property.\n */\n pageSizePreference?: CollectionPreferencesProps.PageSizePreference;\n /**\n * Configures the built-in \"wrap lines\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.wrapLines` property.\n */\n wrapLinesPreference?: CollectionPreferencesProps.WrapLinesPreference;\n /**\n * Configures the built-in \"striped rows\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.stripedRows` property.\n */\n stripedRowsPreference?: CollectionPreferencesProps.StripedRowsPreference;\n /**\n * Configures the built-in \"visible content selection\" preference (for example, visible columns in a table).\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `options` - Specifies an array of groups of options for visible content selection.\n *\n * Each group of options contains the following:\n * - `label` (string) - The text to display as a title for the options group.\n * - `options` - Specifies an aray of options in the group. Each option contains the following:\n * - `id` (string) - Corresponds to a column `id` for tables or to a section `id` for cards.\n * - `label` (string) - Specifies a short description of the content.\n * - `editable` (boolean) - (Optional) Determines whether the user is able to toggle its visibility. This is `true` by default.\n *\n * You must set the current list of visible content `id`s in the `preferences.visibleContent` property.\n */\n visibleContentPreference?: CollectionPreferencesProps.VisibleContentPreference;\n /**\n * Specifies the current preference values. This includes both built-in and custom preferences.\n *\n * It contains the following:\n * - `pageSize` (number) - (Optional)\n * - `wrapLines` (boolean) - (Optional)\n * - `visibleContent` (ReadonlyArray<string>) - Specifies the list of visible content `id`s. The order of the `id`s does not influence the display.\n * - `custom` (CustomPreferenceType) - Specifies the value for your custom preference.\n */\n preferences?: CollectionPreferencesProps.Preferences<CustomPreferenceType>;\n /**\n * Configures custom preferences. The function receives two parameters:\n *\n * - `customValue` (CustomPreferenceType) - Current value for your custom preference. It is initialized using the value you provide in `preferences.custom`.\n * - `setCustomValue` - A function that is called to notify a state update.\n *\n * It should return the content of your custom preference, for example:\n * ```\n * (customValue, setCustomValue) => (\n * <Checkbox checked={customValue} onChange={({ detail }) => setCustomValue(detail.checked)} />\n * )\n * ```\n *\n * When the user confirms the changes, the new value is passed in the `detail.custom` property of the `onConfirm` listener.\n * When the user cancels the changes, the `customValue` is reset to the one present in `preferences.custom` property.\n *\n * **Display**\n * - If any of the built-in preferences (`pageSizePreference`, `wrapLinesPreference`, or `visibleContentPreference`) are displayed,\n * the custom content is displayed at the bottom of the left column within the modal.\n * - If no built-in preference is displayed, the custom content occupies the whole modal.\n */\n customPreference?: (\n customValue: CustomPreferenceType,\n setCustomValue: React.Dispatch<CustomPreferenceType>\n ) => React.ReactNode;\n /**\n * Called when the user cancels a preference change using the cancel button in the modal footer or by dismissing the modal.\n */\n onCancel?: NonCancelableEventHandler;\n /**\n * Called when the user confirms a preference change using the confirm button in the modal footer.\n *\n * The event `detail` contains the following:\n * - `pageSize` (number) - (Optional) The selected page size value. Available only if you specify the `pageSizePreference` property.\n * - `wrapLines` (boolean) - (Optional) The current line wrapping preference value. Available only if you specify the `wrapLinesPreference` property.\n * - `visibleContent` (ReadonlyArray<string>) - (Optional) The list of selected content `id`s. Available only if you specify the `visibleContentPreference` property.\n * - `custom` (CustomPreferenceType) - (Optional) The selected value for your custom preference.\n *\n * The values for all configured preferences are present even if the user didn't change their values.\n */\n onConfirm?: NonCancelableEventHandler<CollectionPreferencesProps.Preferences<CustomPreferenceType>>;\n}\n\nexport namespace CollectionPreferencesProps {\n export interface Preferences<CustomPreferenceType = any> {\n pageSize?: number;\n wrapLines?: boolean;\n stripedRows?: boolean;\n visibleContent?: ReadonlyArray<string>;\n custom?: CustomPreferenceType;\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"]}
|
|
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';\n\nexport interface CollectionPreferencesProps<CustomPreferenceType = any> extends BaseComponentProps {\n /**\n * Specifies the title of the preferences modal dialog. It is also used as an `aria-label` for the trigger button.\n */\n title: string;\n /**\n * Label of the confirm button in the modal footer.\n */\n confirmLabel: string;\n /**\n * Label of the cancel button in the modal footer.\n */\n cancelLabel: string;\n /**\n * Determines whether the preferences trigger button is disabled.\n */\n disabled?: boolean;\n /**\n * Configures the built-in \"page size selection\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `options` - Specifies an array of options for page size selection. Each entry contains:\n * - `value` (number) - The value for the radio button (that is, the number of items per page).\n * - `label` (string) - A label for the radio button (for example, \"10 resources\").\n *\n * You must set the current value in the `preferences.pageSize` property.\n */\n pageSizePreference?: CollectionPreferencesProps.PageSizePreference;\n /**\n * Configures the built-in \"wrap lines\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.wrapLines` property.\n */\n wrapLinesPreference?: CollectionPreferencesProps.WrapLinesPreference;\n /**\n * Configures the built-in \"striped rows\" preference.\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.stripedRows` property.\n */\n stripedRowsPreference?: CollectionPreferencesProps.StripedRowsPreference;\n /**\n * Configures the content density preference (Comfortable / Compact).\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `label` (string) - Specifies the label for the option checkbox.\n * - `description` (string) - Specifies the text displayed below the checkbox label.\n *\n * You must set the current value in the `preferences.contentDensity` property.\n */\n contentDensityPreference?: CollectionPreferencesProps.ContentDensityPreference;\n /**\n * Configures the built-in \"visible content selection\" preference (for example, visible columns in a table).\n *\n * If you set it, the component displays this preference in the modal.\n *\n * It contains the following:\n * - `title` (string) - Specifies the text displayed at the top of the preference.\n * - `options` - Specifies an array of groups of options for visible content selection.\n *\n * Each group of options contains the following:\n * - `label` (string) - The text to display as a title for the options group.\n * - `options` - Specifies an aray of options in the group. Each option contains the following:\n * - `id` (string) - Corresponds to a column `id` for tables or to a section `id` for cards.\n * - `label` (string) - Specifies a short description of the content.\n * - `editable` (boolean) - (Optional) Determines whether the user is able to toggle its visibility. This is `true` by default.\n *\n * You must set the current list of visible content `id`s in the `preferences.visibleContent` property.\n */\n visibleContentPreference?: CollectionPreferencesProps.VisibleContentPreference;\n /**\n * Specifies the current preference values. This includes both built-in and custom preferences.\n *\n * It contains the following:\n * - `pageSize` (number) - (Optional)\n * - `wrapLines` (boolean) - (Optional)\n * - `visibleContent` (ReadonlyArray<string>) - Specifies the list of visible content `id`s. The order of the `id`s does not influence the display.\n * - `custom` (CustomPreferenceType) - Specifies the value for your custom preference.\n */\n preferences?: CollectionPreferencesProps.Preferences<CustomPreferenceType>;\n /**\n * Configures custom preferences. The function receives two parameters:\n *\n * - `customValue` (CustomPreferenceType) - Current value for your custom preference. It is initialized using the value you provide in `preferences.custom`.\n * - `setCustomValue` - A function that is called to notify a state update.\n *\n * It should return the content of your custom preference, for example:\n * ```\n * (customValue, setCustomValue) => (\n * <Checkbox checked={customValue} onChange={({ detail }) => setCustomValue(detail.checked)} />\n * )\n * ```\n *\n * When the user confirms the changes, the new value is passed in the `detail.custom` property of the `onConfirm` listener.\n * When the user cancels the changes, the `customValue` is reset to the one present in `preferences.custom` property.\n *\n * **Display**\n * - If any of the built-in preferences (`pageSizePreference`, `wrapLinesPreference`, or `visibleContentPreference`) are displayed,\n * the custom content is displayed at the bottom of the left column within the modal.\n * - If no built-in preference is displayed, the custom content occupies the whole modal.\n */\n customPreference?: (\n customValue: CustomPreferenceType,\n setCustomValue: React.Dispatch<CustomPreferenceType>\n ) => React.ReactNode;\n /**\n * Called when the user cancels a preference change using the cancel button in the modal footer or by dismissing the modal.\n */\n onCancel?: NonCancelableEventHandler;\n /**\n * Called when the user confirms a preference change using the confirm button in the modal footer.\n *\n * The event `detail` contains the following:\n * - `pageSize` (number) - (Optional) The selected page size value. Available only if you specify the `pageSizePreference` property.\n * - `wrapLines` (boolean) - (Optional) The current line wrapping preference value. Available only if you specify the `wrapLinesPreference` property.\n * - `visibleContent` (ReadonlyArray<string>) - (Optional) The list of selected content `id`s. Available only if you specify the `visibleContentPreference` property.\n * - `custom` (CustomPreferenceType) - (Optional) The selected value for your custom preference.\n *\n * The values for all configured preferences are present even if the user didn't change their values.\n */\n onConfirm?: NonCancelableEventHandler<CollectionPreferencesProps.Preferences<CustomPreferenceType>>;\n}\n\nexport namespace CollectionPreferencesProps {\n export interface Preferences<CustomPreferenceType = any> {\n pageSize?: number;\n wrapLines?: boolean;\n stripedRows?: boolean;\n contentDensity?: 'comfortable' | 'compact';\n visibleContent?: ReadonlyArray<string>;\n custom?: CustomPreferenceType;\n }\n\n export interface VisibleContentPreference {\n title: string;\n options: ReadonlyArray<CollectionPreferencesProps.VisibleContentOptionsGroup>;\n }\n\n export interface VisibleContentOptionsGroup {\n label: string;\n options: ReadonlyArray<CollectionPreferencesProps.VisibleContentOption>;\n }\n\n export interface VisibleContentOption {\n id: string;\n label: string;\n editable?: boolean;\n }\n\n export interface PageSizePreference {\n title: string;\n options: ReadonlyArray<PageSizeOption>;\n }\n\n export interface PageSizeOption {\n value: number;\n label: string;\n }\n\n export interface WrapLinesPreference {\n label: string;\n description: string;\n }\n\n export interface StripedRowsPreference {\n label: string;\n description: string;\n }\n\n export interface ContentDensityPreference {\n label: string;\n description: string;\n }\n}\n"]}
|
|
@@ -1,25 +1,26 @@
|
|
|
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
|
-
"root": "
|
|
13
|
-
"modal-root": "awsui_modal-
|
|
14
|
-
"trigger-button": "awsui_trigger-
|
|
15
|
-
"cancel-button": "awsui_cancel-
|
|
16
|
-
"confirm-button": "awsui_confirm-
|
|
17
|
-
"custom": "
|
|
18
|
-
"second-column-small": "awsui_second-column-
|
|
19
|
-
"wrap-lines": "awsui_wrap-
|
|
20
|
-
"striped-rows": "awsui_striped-
|
|
21
|
-
"
|
|
22
|
-
"page-size
|
|
23
|
-
"page-size-
|
|
4
|
+
"visible-content": "awsui_visible-content_tc96w_10hwa_185",
|
|
5
|
+
"visible-content-toggle": "awsui_visible-content-toggle_tc96w_10hwa_186",
|
|
6
|
+
"visible-content-groups": "awsui_visible-content-groups_tc96w_10hwa_187",
|
|
7
|
+
"visible-content-group": "awsui_visible-content-group_tc96w_10hwa_187",
|
|
8
|
+
"visible-content-title": "awsui_visible-content-title_tc96w_10hwa_192",
|
|
9
|
+
"visible-content-group-label": "awsui_visible-content-group-label_tc96w_10hwa_201",
|
|
10
|
+
"visible-content-option": "awsui_visible-content-option_tc96w_10hwa_207",
|
|
11
|
+
"visible-content-option-label": "awsui_visible-content-option-label_tc96w_10hwa_218",
|
|
12
|
+
"root": "awsui_root_tc96w_10hwa_225",
|
|
13
|
+
"modal-root": "awsui_modal-root_tc96w_10hwa_226",
|
|
14
|
+
"trigger-button": "awsui_trigger-button_tc96w_10hwa_227",
|
|
15
|
+
"cancel-button": "awsui_cancel-button_tc96w_10hwa_228",
|
|
16
|
+
"confirm-button": "awsui_confirm-button_tc96w_10hwa_229",
|
|
17
|
+
"custom": "awsui_custom_tc96w_10hwa_230",
|
|
18
|
+
"second-column-small": "awsui_second-column-small_tc96w_10hwa_234",
|
|
19
|
+
"wrap-lines": "awsui_wrap-lines_tc96w_10hwa_238",
|
|
20
|
+
"striped-rows": "awsui_striped-rows_tc96w_10hwa_239",
|
|
21
|
+
"content-density": "awsui_content-density_tc96w_10hwa_240",
|
|
22
|
+
"page-size": "awsui_page-size_tc96w_10hwa_241",
|
|
23
|
+
"page-size-form-field": "awsui_page-size-form-field_tc96w_10hwa_242",
|
|
24
|
+
"page-size-radio-group": "awsui_page-size-radio-group_tc96w_10hwa_243"
|
|
24
25
|
};
|
|
25
26
|
|
|
@@ -182,14 +182,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
182
182
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
183
183
|
SPDX-License-Identifier: Apache-2.0
|
|
184
184
|
*/
|
|
185
|
-
.awsui_visible-
|
|
186
|
-
.awsui_visible-content-
|
|
187
|
-
.awsui_visible-content-
|
|
188
|
-
.awsui_visible-content-
|
|
185
|
+
.awsui_visible-content_tc96w_10hwa_185:not(#\9),
|
|
186
|
+
.awsui_visible-content-toggle_tc96w_10hwa_186:not(#\9),
|
|
187
|
+
.awsui_visible-content-groups_tc96w_10hwa_187:not(#\9),
|
|
188
|
+
.awsui_visible-content-group_tc96w_10hwa_187:not(#\9) {
|
|
189
189
|
/* used in test-utils */
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
.awsui_visible-content-
|
|
192
|
+
.awsui_visible-content-title_tc96w_10hwa_192:not(#\9) {
|
|
193
193
|
font-size: var(--font-body-m-size-sregvd, 14px);
|
|
194
194
|
line-height: var(--font-body-m-line-height-i7xxvv, 22px);
|
|
195
195
|
font-weight: var(--font-display-label-weight-m18hjh, 700);
|
|
@@ -198,47 +198,48 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
198
198
|
margin-bottom: var(--space-scaled-l-t03y3z, 20px);
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
.awsui_visible-content-group-
|
|
201
|
+
.awsui_visible-content-group-label_tc96w_10hwa_201:not(#\9) {
|
|
202
202
|
color: var(--color-text-group-label-w9to2i, #414d5c);
|
|
203
203
|
padding-bottom: var(--space-xs-rsr2qu, 8px);
|
|
204
204
|
border-bottom: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
-
.awsui_visible-content-
|
|
207
|
+
.awsui_visible-content-option_tc96w_10hwa_207:not(#\9) {
|
|
208
208
|
display: flex;
|
|
209
209
|
flex-wrap: nowrap;
|
|
210
210
|
justify-content: space-between;
|
|
211
211
|
padding: var(--space-xs-rsr2qu, 8px) 0px var(--space-xs-rsr2qu, 8px) var(--space-scaled-l-t03y3z, 20px);
|
|
212
212
|
border-bottom: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
213
213
|
}
|
|
214
|
-
.awsui_visible-content-
|
|
214
|
+
.awsui_visible-content-option_tc96w_10hwa_207:not(#\9):last-child {
|
|
215
215
|
border-bottom: none;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
.awsui_visible-content-option-
|
|
218
|
+
.awsui_visible-content-option-label_tc96w_10hwa_218:not(#\9) {
|
|
219
219
|
overflow: hidden;
|
|
220
220
|
text-overflow: ellipsis;
|
|
221
221
|
padding-right: var(--space-l-4vl6xu, 20px);
|
|
222
222
|
flex-grow: 1;
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
.
|
|
226
|
-
.awsui_modal-
|
|
227
|
-
.awsui_trigger-
|
|
228
|
-
.awsui_cancel-
|
|
229
|
-
.awsui_confirm-
|
|
230
|
-
.
|
|
225
|
+
.awsui_root_tc96w_10hwa_225:not(#\9),
|
|
226
|
+
.awsui_modal-root_tc96w_10hwa_226:not(#\9),
|
|
227
|
+
.awsui_trigger-button_tc96w_10hwa_227:not(#\9),
|
|
228
|
+
.awsui_cancel-button_tc96w_10hwa_228:not(#\9),
|
|
229
|
+
.awsui_confirm-button_tc96w_10hwa_229:not(#\9),
|
|
230
|
+
.awsui_custom_tc96w_10hwa_230:not(#\9) {
|
|
231
231
|
/* used in test-utils */
|
|
232
232
|
}
|
|
233
233
|
|
|
234
|
-
.awsui_second-column-
|
|
234
|
+
.awsui_second-column-small_tc96w_10hwa_234:not(#\9) {
|
|
235
235
|
padding-top: calc(2 * var(--space-scaled-l-t03y3z, 20px));
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
.awsui_wrap-
|
|
239
|
-
.awsui_striped-
|
|
240
|
-
.
|
|
241
|
-
.awsui_page-
|
|
242
|
-
.awsui_page-size-
|
|
238
|
+
.awsui_wrap-lines_tc96w_10hwa_238:not(#\9),
|
|
239
|
+
.awsui_striped-rows_tc96w_10hwa_239:not(#\9),
|
|
240
|
+
.awsui_content-density_tc96w_10hwa_240:not(#\9),
|
|
241
|
+
.awsui_page-size_tc96w_10hwa_241:not(#\9),
|
|
242
|
+
.awsui_page-size-form-field_tc96w_10hwa_242:not(#\9),
|
|
243
|
+
.awsui_page-size-radio-group_tc96w_10hwa_243:not(#\9) {
|
|
243
244
|
/* used in test-utils */
|
|
244
245
|
}
|
|
@@ -2,25 +2,26 @@
|
|
|
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
|
-
"root": "
|
|
14
|
-
"modal-root": "awsui_modal-
|
|
15
|
-
"trigger-button": "awsui_trigger-
|
|
16
|
-
"cancel-button": "awsui_cancel-
|
|
17
|
-
"confirm-button": "awsui_confirm-
|
|
18
|
-
"custom": "
|
|
19
|
-
"second-column-small": "awsui_second-column-
|
|
20
|
-
"wrap-lines": "awsui_wrap-
|
|
21
|
-
"striped-rows": "awsui_striped-
|
|
22
|
-
"
|
|
23
|
-
"page-size
|
|
24
|
-
"page-size-
|
|
5
|
+
"visible-content": "awsui_visible-content_tc96w_10hwa_185",
|
|
6
|
+
"visible-content-toggle": "awsui_visible-content-toggle_tc96w_10hwa_186",
|
|
7
|
+
"visible-content-groups": "awsui_visible-content-groups_tc96w_10hwa_187",
|
|
8
|
+
"visible-content-group": "awsui_visible-content-group_tc96w_10hwa_187",
|
|
9
|
+
"visible-content-title": "awsui_visible-content-title_tc96w_10hwa_192",
|
|
10
|
+
"visible-content-group-label": "awsui_visible-content-group-label_tc96w_10hwa_201",
|
|
11
|
+
"visible-content-option": "awsui_visible-content-option_tc96w_10hwa_207",
|
|
12
|
+
"visible-content-option-label": "awsui_visible-content-option-label_tc96w_10hwa_218",
|
|
13
|
+
"root": "awsui_root_tc96w_10hwa_225",
|
|
14
|
+
"modal-root": "awsui_modal-root_tc96w_10hwa_226",
|
|
15
|
+
"trigger-button": "awsui_trigger-button_tc96w_10hwa_227",
|
|
16
|
+
"cancel-button": "awsui_cancel-button_tc96w_10hwa_228",
|
|
17
|
+
"confirm-button": "awsui_confirm-button_tc96w_10hwa_229",
|
|
18
|
+
"custom": "awsui_custom_tc96w_10hwa_230",
|
|
19
|
+
"second-column-small": "awsui_second-column-small_tc96w_10hwa_234",
|
|
20
|
+
"wrap-lines": "awsui_wrap-lines_tc96w_10hwa_238",
|
|
21
|
+
"striped-rows": "awsui_striped-rows_tc96w_10hwa_239",
|
|
22
|
+
"content-density": "awsui_content-density_tc96w_10hwa_240",
|
|
23
|
+
"page-size": "awsui_page-size_tc96w_10hwa_241",
|
|
24
|
+
"page-size-form-field": "awsui_page-size-form-field_tc96w_10hwa_242",
|
|
25
|
+
"page-size-radio-group": "awsui_page-size-radio-group_tc96w_10hwa_243"
|
|
25
26
|
};
|
|
26
27
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CollectionPreferencesProps } from './interfaces';
|
|
3
|
-
export declare const copyPreferences: ({ pageSize, wrapLines, stripedRows, visibleContent, custom, }: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
|
|
3
|
+
export declare const copyPreferences: ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, custom, }: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
|
|
4
4
|
export declare const mergePreferences: (newPref: CollectionPreferencesProps.Preferences, oldPref: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
|
|
5
5
|
interface ModalContentLayoutProps {
|
|
6
6
|
left: React.ReactNode;
|
|
@@ -22,6 +22,11 @@ interface StripedRowsPreferenceProps extends CollectionPreferencesProps.StripedR
|
|
|
22
22
|
value?: boolean;
|
|
23
23
|
}
|
|
24
24
|
export declare const StripedRowsPreference: ({ label, description, value, onChange }: StripedRowsPreferenceProps) => JSX.Element;
|
|
25
|
+
interface ContentDensityPreferenceProps extends CollectionPreferencesProps.ContentDensityPreference {
|
|
26
|
+
onChange: (value: 'comfortable' | 'compact') => void;
|
|
27
|
+
value?: 'comfortable' | 'compact';
|
|
28
|
+
}
|
|
29
|
+
export declare const ContentDensityPreference: ({ label, description, value, onChange }: ContentDensityPreferenceProps) => JSX.Element;
|
|
25
30
|
interface CustomPreferenceProps<T = any> extends Pick<CollectionPreferencesProps<T>, 'customPreference'> {
|
|
26
31
|
onChange: (value: T) => void;
|
|
27
32
|
value: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/collection-preferences/utils.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAG1D,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/collection-preferences/utils.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAMxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAG1D,eAAO,MAAM,eAAe,kFAOzB,2BAA2B,WAAW,KAAG,2BAA2B,WAOrE,CAAC;AAEH,eAAO,MAAM,gBAAgB,YAClB,2BAA2B,WAAW,WACtC,2BAA2B,WAAW,KAC9C,2BAA2B,WAO5B,CAAC;AAEH,UAAU,uBAAuB;IAC/B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB;AAED,eAAO,MAAM,kBAAkB,oBAAqB,uBAAuB,gBAsB1E,CAAC;AAEF,UAAU,uBAAwB,SAAQ,0BAA0B,CAAC,kBAAkB;IACrF,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,kBAAkB,wCAAyC,uBAAuB,gBAW9F,CAAC;AAEF,UAAU,wBAAyB,SAAQ,0BAA0B,CAAC,mBAAmB;IACvF,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,mBAAmB,4CAA6C,wBAAwB,gBASpG,CAAC;AAEF,UAAU,0BAA2B,SAAQ,0BAA0B,CAAC,qBAAqB;IAC3F,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACnC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,qBAAqB,4CAA6C,0BAA0B,gBASxG,CAAC;AAEF,UAAU,6BAA8B,SAAQ,0BAA0B,CAAC,wBAAwB;IACjG,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,SAAS,KAAK,IAAI,CAAC;IACrD,KAAK,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CACnC;AAED,eAAO,MAAM,wBAAwB,4CAA6C,6BAA6B,gBAS9G,CAAC;AAEF,UAAU,qBAAqB,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC;IACtG,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC;CACV;AACD,eAAO,MAAM,gBAAgB,0CAA2C,qBAAqB,uBAc5F,CAAC"}
|
|
@@ -8,11 +8,12 @@ import InternalRadioGroup from '../radio-group/internal';
|
|
|
8
8
|
import { useContainerBreakpoints } from '../internal/hooks/container-queries';
|
|
9
9
|
import styles from './styles.css.js';
|
|
10
10
|
export var copyPreferences = function (_a) {
|
|
11
|
-
var pageSize = _a.pageSize, wrapLines = _a.wrapLines, stripedRows = _a.stripedRows, visibleContent = _a.visibleContent, custom = _a.custom;
|
|
11
|
+
var pageSize = _a.pageSize, wrapLines = _a.wrapLines, stripedRows = _a.stripedRows, contentDensity = _a.contentDensity, visibleContent = _a.visibleContent, custom = _a.custom;
|
|
12
12
|
return ({
|
|
13
13
|
pageSize: pageSize,
|
|
14
14
|
wrapLines: wrapLines,
|
|
15
15
|
stripedRows: stripedRows,
|
|
16
|
+
contentDensity: contentDensity,
|
|
16
17
|
visibleContent: visibleContent,
|
|
17
18
|
custom: custom
|
|
18
19
|
});
|
|
@@ -21,6 +22,7 @@ export var mergePreferences = function (newPref, oldPref) { return ({
|
|
|
21
22
|
pageSize: newPref.pageSize !== undefined ? newPref.pageSize : oldPref.pageSize,
|
|
22
23
|
wrapLines: newPref.wrapLines !== undefined ? newPref.wrapLines : oldPref.wrapLines,
|
|
23
24
|
stripedRows: newPref.stripedRows !== undefined ? newPref.stripedRows : oldPref.stripedRows,
|
|
25
|
+
contentDensity: newPref.contentDensity !== undefined ? newPref.contentDensity : oldPref.contentDensity,
|
|
24
26
|
visibleContent: newPref.visibleContent !== undefined ? newPref.visibleContent : oldPref.visibleContent,
|
|
25
27
|
custom: newPref.custom !== undefined ? newPref.custom : oldPref.custom
|
|
26
28
|
}); };
|
|
@@ -65,6 +67,13 @@ export var StripedRowsPreference = function (_a) {
|
|
|
65
67
|
return onChange(detail.checked);
|
|
66
68
|
}, className: styles['striped-rows'] }, label));
|
|
67
69
|
};
|
|
70
|
+
export var ContentDensityPreference = function (_a) {
|
|
71
|
+
var label = _a.label, description = _a.description, value = _a.value, onChange = _a.onChange;
|
|
72
|
+
return (React.createElement(InternalCheckbox, { checked: value === 'compact', description: description, onChange: function (_a) {
|
|
73
|
+
var detail = _a.detail;
|
|
74
|
+
return onChange(detail.checked ? 'compact' : 'comfortable');
|
|
75
|
+
}, className: styles['content-density'] }, label));
|
|
76
|
+
};
|
|
68
77
|
export var CustomPreference = function (_a) {
|
|
69
78
|
var value = _a.value, customPreference = _a.customPreference, onChange = _a.onChange;
|
|
70
79
|
var _b = useState(value), customState = _b[0], setCustomState = _b[1];
|