@cloudscape-design/components 3.0.277 → 3.0.279
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/checkbox/base-checkbox.d.ts +5 -0
- package/checkbox/base-checkbox.d.ts.map +1 -1
- package/checkbox/base-checkbox.js.map +1 -1
- package/checkbox/internal.d.ts.map +1 -1
- package/checkbox/internal.js +2 -2
- package/checkbox/internal.js.map +1 -1
- package/collection-preferences/content-display/styles.css.js +11 -11
- package/collection-preferences/content-display/styles.scoped.css +17 -18
- package/collection-preferences/content-display/styles.selectors.js +11 -11
- 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 +42 -12
- package/collection-preferences/interfaces.d.ts.map +1 -1
- package/collection-preferences/interfaces.js.map +1 -1
- package/collection-preferences/styles.css.js +37 -32
- package/collection-preferences/styles.scoped.css +44 -40
- package/collection-preferences/styles.selectors.js +37 -32
- package/collection-preferences/utils.d.ts +12 -1
- package/collection-preferences/utils.d.ts.map +1 -1
- package/collection-preferences/utils.js +15 -1
- package/collection-preferences/utils.js.map +1 -1
- package/internal/base-component/styles.scoped.css +8 -0
- package/internal/components/abstract-switch/index.d.ts +2 -1
- package/internal/components/abstract-switch/index.d.ts.map +1 -1
- package/internal/components/abstract-switch/index.js +6 -5
- package/internal/components/abstract-switch/index.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/progress-bar/internal.d.ts.map +1 -1
- package/progress-bar/internal.js +1 -1
- package/progress-bar/internal.js.map +1 -1
- package/table/body-cell/styles.css.js +28 -23
- package/table/body-cell/styles.scoped.css +111 -55
- package/table/body-cell/styles.selectors.js +28 -23
- package/table/body-cell/td-element.d.ts +3 -0
- package/table/body-cell/td-element.d.ts.map +1 -1
- package/table/body-cell/td-element.js +16 -2
- package/table/body-cell/td-element.js.map +1 -1
- package/table/header-cell/index.d.ts +4 -1
- package/table/header-cell/index.d.ts.map +1 -1
- package/table/header-cell/index.js +9 -2
- package/table/header-cell/index.js.map +1 -1
- package/table/header-cell/styles.css.js +24 -19
- package/table/header-cell/styles.scoped.css +67 -32
- package/table/header-cell/styles.selectors.js +24 -19
- package/table/interfaces.d.ts +14 -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 +19 -6
- package/table/internal.js.map +1 -1
- package/table/thead.d.ts +2 -0
- package/table/thead.d.ts.map +1 -1
- package/table/thead.js +12 -4
- package/table/thead.js.map +1 -1
- package/table/use-sticky-columns.d.ts.map +1 -1
- package/table/use-sticky-columns.js +5 -1
- package/table/use-sticky-columns.js.map +1 -1
- package/table/utils.d.ts +4 -0
- package/table/utils.d.ts.map +1 -1
- package/table/utils.js +8 -0
- package/table/utils.js.map +1 -1
- package/test-utils/dom/collection-preferences/index.d.ts +2 -0
- package/test-utils/dom/collection-preferences/index.js +6 -1
- package/test-utils/dom/collection-preferences/index.js.map +1 -1
- package/test-utils/dom/collection-preferences/sticky-columns-preference.d.ts +9 -0
- package/test-utils/dom/collection-preferences/sticky-columns-preference.js +23 -0
- package/test-utils/dom/collection-preferences/sticky-columns-preference.js.map +1 -0
- package/test-utils/selectors/collection-preferences/index.d.ts +2 -0
- package/test-utils/selectors/collection-preferences/index.js +6 -1
- package/test-utils/selectors/collection-preferences/index.js.map +1 -1
- package/test-utils/selectors/collection-preferences/sticky-columns-preference.d.ts +9 -0
- package/test-utils/selectors/collection-preferences/sticky-columns-preference.js +23 -0
- package/test-utils/selectors/collection-preferences/sticky-columns-preference.js.map +1 -0
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/tiles/interfaces.d.ts +5 -0
- package/tiles/interfaces.d.ts.map +1 -1
- package/tiles/interfaces.js.map +1 -1
- package/tiles/internal.d.ts.map +1 -1
- package/tiles/internal.js +2 -2
- package/tiles/internal.js.map +1 -1
- package/toggle/internal.d.ts.map +1 -1
- package/toggle/internal.js +2 -2
- package/toggle/internal.js.map +1 -1
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"visible-content": "awsui_visible-
|
|
5
|
-
"visible-content-toggle": "awsui_visible-content-
|
|
6
|
-
"visible-content-groups": "awsui_visible-content-
|
|
7
|
-
"visible-content-group": "awsui_visible-content-
|
|
8
|
-
"visible-content-title": "awsui_visible-content-
|
|
9
|
-
"visible-content-group-label": "awsui_visible-content-group-
|
|
10
|
-
"visible-content-option": "awsui_visible-content-
|
|
11
|
-
"visible-content-option-label": "awsui_visible-content-option-
|
|
12
|
-
"content-display-option-toggle": "awsui_content-display-option-
|
|
13
|
-
"content-display-option-content": "awsui_content-display-option-
|
|
14
|
-
"content-display-option": "awsui_content-display-
|
|
15
|
-
"placeholder": "
|
|
16
|
-
"sorting": "
|
|
17
|
-
"content-display-option-label": "awsui_content-display-option-
|
|
18
|
-
"drag-overlay": "awsui_drag-
|
|
19
|
-
"content-display": "awsui_content-
|
|
20
|
-
"content-display-title": "awsui_content-display-
|
|
21
|
-
"content-display-description": "awsui_content-display-
|
|
22
|
-
"content-display-option-list": "awsui_content-display-option-
|
|
23
|
-
"root": "
|
|
24
|
-
"modal-root": "awsui_modal-
|
|
25
|
-
"trigger-button": "awsui_trigger-
|
|
26
|
-
"cancel-button": "awsui_cancel-
|
|
27
|
-
"confirm-button": "awsui_confirm-
|
|
28
|
-
"custom": "
|
|
29
|
-
"second-column-small": "awsui_second-column-
|
|
30
|
-
"wrap-lines": "awsui_wrap-
|
|
31
|
-
"striped-rows": "awsui_striped-
|
|
32
|
-
"content-density": "awsui_content-
|
|
33
|
-
"page-size": "awsui_page-
|
|
34
|
-
"page-size-form-field": "awsui_page-size-form-
|
|
35
|
-
"page-size-radio-group": "awsui_page-size-radio-
|
|
4
|
+
"visible-content": "awsui_visible-content_tc96w_1rnmc_185",
|
|
5
|
+
"visible-content-toggle": "awsui_visible-content-toggle_tc96w_1rnmc_186",
|
|
6
|
+
"visible-content-groups": "awsui_visible-content-groups_tc96w_1rnmc_187",
|
|
7
|
+
"visible-content-group": "awsui_visible-content-group_tc96w_1rnmc_187",
|
|
8
|
+
"visible-content-title": "awsui_visible-content-title_tc96w_1rnmc_192",
|
|
9
|
+
"visible-content-group-label": "awsui_visible-content-group-label_tc96w_1rnmc_201",
|
|
10
|
+
"visible-content-option": "awsui_visible-content-option_tc96w_1rnmc_207",
|
|
11
|
+
"visible-content-option-label": "awsui_visible-content-option-label_tc96w_1rnmc_218",
|
|
12
|
+
"content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_1rnmc_409",
|
|
13
|
+
"content-display-option-content": "awsui_content-display-option-content_tc96w_1rnmc_413",
|
|
14
|
+
"content-display-option": "awsui_content-display-option_tc96w_1rnmc_409",
|
|
15
|
+
"placeholder": "awsui_placeholder_tc96w_1rnmc_436",
|
|
16
|
+
"sorting": "awsui_sorting_tc96w_1rnmc_436",
|
|
17
|
+
"content-display-option-label": "awsui_content-display-option-label_tc96w_1rnmc_463",
|
|
18
|
+
"drag-overlay": "awsui_drag-overlay_tc96w_1rnmc_471",
|
|
19
|
+
"content-display": "awsui_content-display_tc96w_1rnmc_409",
|
|
20
|
+
"content-display-title": "awsui_content-display-title_tc96w_1rnmc_498",
|
|
21
|
+
"content-display-description": "awsui_content-display-description_tc96w_1rnmc_506",
|
|
22
|
+
"content-display-option-list": "awsui_content-display-option-list_tc96w_1rnmc_514",
|
|
23
|
+
"root": "awsui_root_tc96w_1rnmc_520",
|
|
24
|
+
"modal-root": "awsui_modal-root_tc96w_1rnmc_521",
|
|
25
|
+
"trigger-button": "awsui_trigger-button_tc96w_1rnmc_522",
|
|
26
|
+
"cancel-button": "awsui_cancel-button_tc96w_1rnmc_523",
|
|
27
|
+
"confirm-button": "awsui_confirm-button_tc96w_1rnmc_524",
|
|
28
|
+
"custom": "awsui_custom_tc96w_1rnmc_525",
|
|
29
|
+
"second-column-small": "awsui_second-column-small_tc96w_1rnmc_529",
|
|
30
|
+
"wrap-lines": "awsui_wrap-lines_tc96w_1rnmc_533",
|
|
31
|
+
"striped-rows": "awsui_striped-rows_tc96w_1rnmc_534",
|
|
32
|
+
"content-density": "awsui_content-density_tc96w_1rnmc_535",
|
|
33
|
+
"page-size": "awsui_page-size_tc96w_1rnmc_536",
|
|
34
|
+
"page-size-form-field": "awsui_page-size-form-field_tc96w_1rnmc_537",
|
|
35
|
+
"page-size-radio-group": "awsui_page-size-radio-group_tc96w_1rnmc_538",
|
|
36
|
+
"sticky-columns": "awsui_sticky-columns_tc96w_1rnmc_539",
|
|
37
|
+
"sticky-columns-form-field": "awsui_sticky-columns-form-field_tc96w_1rnmc_540",
|
|
38
|
+
"sticky-columns-radio-group": "awsui_sticky-columns-radio-group_tc96w_1rnmc_541",
|
|
39
|
+
"sticky-columns-first": "awsui_sticky-columns-first_tc96w_1rnmc_542",
|
|
40
|
+
"sticky-columns-last": "awsui_sticky-columns-last_tc96w_1rnmc_543"
|
|
36
41
|
};
|
|
37
42
|
|
|
@@ -182,14 +182,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
182
182
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
183
183
|
SPDX-License-Identifier: Apache-2.0
|
|
184
184
|
*/
|
|
185
|
-
.awsui_visible-
|
|
186
|
-
.awsui_visible-content-
|
|
187
|
-
.awsui_visible-content-
|
|
188
|
-
.awsui_visible-content-
|
|
185
|
+
.awsui_visible-content_tc96w_1rnmc_185:not(#\9),
|
|
186
|
+
.awsui_visible-content-toggle_tc96w_1rnmc_186:not(#\9),
|
|
187
|
+
.awsui_visible-content-groups_tc96w_1rnmc_187:not(#\9),
|
|
188
|
+
.awsui_visible-content-group_tc96w_1rnmc_187:not(#\9) {
|
|
189
189
|
/* used in test-utils */
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
.awsui_visible-content-
|
|
192
|
+
.awsui_visible-content-title_tc96w_1rnmc_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,24 +198,24 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
198
198
|
margin-bottom: var(--space-scaled-l-t03y3z, 20px);
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
.awsui_visible-content-group-
|
|
201
|
+
.awsui_visible-content-group-label_tc96w_1rnmc_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_1rnmc_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_1rnmc_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_1rnmc_218:not(#\9) {
|
|
219
219
|
overflow: hidden;
|
|
220
220
|
text-overflow: ellipsis;
|
|
221
221
|
padding-right: var(--space-l-4vl6xu, 20px);
|
|
@@ -406,11 +406,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
406
406
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
407
407
|
SPDX-License-Identifier: Apache-2.0
|
|
408
408
|
*/
|
|
409
|
-
.awsui_content-display-option-
|
|
409
|
+
.awsui_content-display-option-toggle_tc96w_1rnmc_409:not(#\9) {
|
|
410
410
|
/* used in test-utils */
|
|
411
411
|
}
|
|
412
412
|
|
|
413
|
-
.awsui_content-display-option-
|
|
413
|
+
.awsui_content-display-option-content_tc96w_1rnmc_413:not(#\9) {
|
|
414
414
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
415
415
|
border-collapse: separate;
|
|
416
416
|
border-spacing: 0;
|
|
@@ -454,29 +454,28 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
454
454
|
border-radius: var(--border-radius-item-u2ibpi, 8px);
|
|
455
455
|
}
|
|
456
456
|
|
|
457
|
-
.awsui_content-display-
|
|
457
|
+
.awsui_content-display-option_tc96w_1rnmc_409:not(#\9) {
|
|
458
458
|
list-style: none;
|
|
459
459
|
position: relative;
|
|
460
460
|
border-top: var(--border-divider-list-width-hacikr, 1px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
461
461
|
}
|
|
462
|
-
.awsui_content-display-
|
|
462
|
+
.awsui_content-display-option_tc96w_1rnmc_409:not(#\9):not(.awsui_placeholder_tc96w_1rnmc_436).awsui_sorting_tc96w_1rnmc_436 {
|
|
463
463
|
transition: transform var(--motion-duration-transition-quick-x85tae, 90ms) var(--motion-easing-transition-quick-lukbd8, linear);
|
|
464
|
-
z-index: 1;
|
|
465
464
|
}
|
|
466
465
|
@media (prefers-reduced-motion: reduce) {
|
|
467
|
-
.awsui_content-display-
|
|
466
|
+
.awsui_content-display-option_tc96w_1rnmc_409:not(#\9):not(.awsui_placeholder_tc96w_1rnmc_436).awsui_sorting_tc96w_1rnmc_436 {
|
|
468
467
|
animation: none;
|
|
469
468
|
transition: none;
|
|
470
469
|
}
|
|
471
470
|
}
|
|
472
|
-
.awsui-motion-disabled .awsui_content-display-
|
|
471
|
+
.awsui-motion-disabled .awsui_content-display-option_tc96w_1rnmc_409:not(#\9):not(.awsui_placeholder_tc96w_1rnmc_436).awsui_sorting_tc96w_1rnmc_436, .awsui-mode-entering .awsui_content-display-option_tc96w_1rnmc_409:not(#\9):not(.awsui_placeholder_tc96w_1rnmc_436).awsui_sorting_tc96w_1rnmc_436 {
|
|
473
472
|
animation: none;
|
|
474
473
|
transition: none;
|
|
475
474
|
}
|
|
476
|
-
.awsui_content-display-
|
|
475
|
+
.awsui_content-display-option_tc96w_1rnmc_409.awsui_placeholder_tc96w_1rnmc_436 > .awsui_content-display-option-content_tc96w_1rnmc_413:not(#\9) {
|
|
477
476
|
position: relative;
|
|
478
477
|
}
|
|
479
|
-
.awsui_content-display-
|
|
478
|
+
.awsui_content-display-option_tc96w_1rnmc_409.awsui_placeholder_tc96w_1rnmc_436 > .awsui_content-display-option-content_tc96w_1rnmc_413:not(#\9):after {
|
|
480
479
|
content: " ";
|
|
481
480
|
position: absolute;
|
|
482
481
|
top: 0;
|
|
@@ -487,7 +486,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
487
486
|
border-radius: var(--border-radius-item-u2ibpi, 8px);
|
|
488
487
|
}
|
|
489
488
|
|
|
490
|
-
.awsui_content-display-option-
|
|
489
|
+
.awsui_content-display-option-label_tc96w_1rnmc_463:not(#\9) {
|
|
491
490
|
flex-grow: 1;
|
|
492
491
|
min-width: 0;
|
|
493
492
|
-ms-word-break: break-all;
|
|
@@ -495,18 +494,18 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
495
494
|
padding-right: var(--space-l-4vl6xu, 20px);
|
|
496
495
|
}
|
|
497
496
|
|
|
498
|
-
.awsui_drag-
|
|
497
|
+
.awsui_drag-overlay_tc96w_1rnmc_471:not(#\9) {
|
|
499
498
|
box-shadow: var(--shadow-container-active-l4kuxc, 0px 1px 1px 1px #e9ebed, 0px 6px 36px rgba(0, 7, 22, 0.1019607843));
|
|
500
499
|
border-radius: var(--border-radius-item-u2ibpi, 8px);
|
|
501
500
|
}
|
|
502
|
-
body[data-awsui-focus-visible=true] .awsui_drag-
|
|
501
|
+
body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1rnmc_471:not(#\9) {
|
|
503
502
|
position: relative;
|
|
504
503
|
}
|
|
505
|
-
body[data-awsui-focus-visible=true] .awsui_drag-
|
|
504
|
+
body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1rnmc_471:not(#\9) {
|
|
506
505
|
outline: 2px dotted transparent;
|
|
507
506
|
outline-offset: calc(0px - 1px);
|
|
508
507
|
}
|
|
509
|
-
body[data-awsui-focus-visible=true] .awsui_drag-
|
|
508
|
+
body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_1rnmc_471:not(#\9)::before {
|
|
510
509
|
content: " ";
|
|
511
510
|
display: block;
|
|
512
511
|
position: absolute;
|
|
@@ -518,11 +517,11 @@ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_rxrhz_472:not(#\9)
|
|
|
518
517
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
|
|
519
518
|
}
|
|
520
519
|
|
|
521
|
-
.awsui_content-
|
|
520
|
+
.awsui_content-display_tc96w_1rnmc_409:not(#\9) {
|
|
522
521
|
/* used in test-utils */
|
|
523
522
|
}
|
|
524
523
|
|
|
525
|
-
.awsui_content-display-
|
|
524
|
+
.awsui_content-display-title_tc96w_1rnmc_498:not(#\9) {
|
|
526
525
|
font-size: var(--font-body-m-size-sregvd, 14px);
|
|
527
526
|
line-height: var(--font-body-m-line-height-i7xxvv, 22px);
|
|
528
527
|
font-weight: var(--font-display-label-weight-m18hjh, 700);
|
|
@@ -530,7 +529,7 @@ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_rxrhz_472:not(#\9)
|
|
|
530
529
|
margin: 0;
|
|
531
530
|
}
|
|
532
531
|
|
|
533
|
-
.awsui_content-display-
|
|
532
|
+
.awsui_content-display-description_tc96w_1rnmc_506:not(#\9) {
|
|
534
533
|
color: var(--color-text-form-secondary-ih9x7l, #5f6b7a);
|
|
535
534
|
font-size: var(--font-body-s-size-ukw2p9, 12px);
|
|
536
535
|
line-height: var(--font-body-s-line-height-kdsbrl, 16px);
|
|
@@ -538,30 +537,35 @@ body[data-awsui-focus-visible=true] .awsui_drag-overlay_tc96w_rxrhz_472:not(#\9)
|
|
|
538
537
|
margin-top: var(--space-scaled-xxxs-lo883m, 2px);
|
|
539
538
|
}
|
|
540
539
|
|
|
541
|
-
.awsui_content-display-option-
|
|
540
|
+
.awsui_content-display-option-list_tc96w_1rnmc_514:not(#\9) {
|
|
542
541
|
position: relative;
|
|
543
542
|
list-style: none;
|
|
544
543
|
padding: 0;
|
|
545
544
|
}
|
|
546
545
|
|
|
547
|
-
.
|
|
548
|
-
.awsui_modal-
|
|
549
|
-
.awsui_trigger-
|
|
550
|
-
.awsui_cancel-
|
|
551
|
-
.awsui_confirm-
|
|
552
|
-
.
|
|
546
|
+
.awsui_root_tc96w_1rnmc_520:not(#\9),
|
|
547
|
+
.awsui_modal-root_tc96w_1rnmc_521:not(#\9),
|
|
548
|
+
.awsui_trigger-button_tc96w_1rnmc_522:not(#\9),
|
|
549
|
+
.awsui_cancel-button_tc96w_1rnmc_523:not(#\9),
|
|
550
|
+
.awsui_confirm-button_tc96w_1rnmc_524:not(#\9),
|
|
551
|
+
.awsui_custom_tc96w_1rnmc_525:not(#\9) {
|
|
553
552
|
/* used in test-utils */
|
|
554
553
|
}
|
|
555
554
|
|
|
556
|
-
.awsui_second-column-
|
|
555
|
+
.awsui_second-column-small_tc96w_1rnmc_529:not(#\9) {
|
|
557
556
|
padding-top: calc(2 * var(--space-scaled-l-t03y3z, 20px));
|
|
558
557
|
}
|
|
559
558
|
|
|
560
|
-
.awsui_wrap-
|
|
561
|
-
.awsui_striped-
|
|
562
|
-
.awsui_content-
|
|
563
|
-
.awsui_page-
|
|
564
|
-
.awsui_page-size-form-
|
|
565
|
-
.awsui_page-size-radio-
|
|
559
|
+
.awsui_wrap-lines_tc96w_1rnmc_533:not(#\9),
|
|
560
|
+
.awsui_striped-rows_tc96w_1rnmc_534:not(#\9),
|
|
561
|
+
.awsui_content-density_tc96w_1rnmc_535:not(#\9),
|
|
562
|
+
.awsui_page-size_tc96w_1rnmc_536:not(#\9),
|
|
563
|
+
.awsui_page-size-form-field_tc96w_1rnmc_537:not(#\9),
|
|
564
|
+
.awsui_page-size-radio-group_tc96w_1rnmc_538:not(#\9),
|
|
565
|
+
.awsui_sticky-columns_tc96w_1rnmc_539:not(#\9),
|
|
566
|
+
.awsui_sticky-columns-form-field_tc96w_1rnmc_540:not(#\9),
|
|
567
|
+
.awsui_sticky-columns-radio-group_tc96w_1rnmc_541:not(#\9),
|
|
568
|
+
.awsui_sticky-columns-first_tc96w_1rnmc_542:not(#\9),
|
|
569
|
+
.awsui_sticky-columns-last_tc96w_1rnmc_543:not(#\9) {
|
|
566
570
|
/* used in test-utils */
|
|
567
571
|
}
|
|
@@ -2,37 +2,42 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"visible-content": "awsui_visible-
|
|
6
|
-
"visible-content-toggle": "awsui_visible-content-
|
|
7
|
-
"visible-content-groups": "awsui_visible-content-
|
|
8
|
-
"visible-content-group": "awsui_visible-content-
|
|
9
|
-
"visible-content-title": "awsui_visible-content-
|
|
10
|
-
"visible-content-group-label": "awsui_visible-content-group-
|
|
11
|
-
"visible-content-option": "awsui_visible-content-
|
|
12
|
-
"visible-content-option-label": "awsui_visible-content-option-
|
|
13
|
-
"content-display-option-toggle": "awsui_content-display-option-
|
|
14
|
-
"content-display-option-content": "awsui_content-display-option-
|
|
15
|
-
"content-display-option": "awsui_content-display-
|
|
16
|
-
"placeholder": "
|
|
17
|
-
"sorting": "
|
|
18
|
-
"content-display-option-label": "awsui_content-display-option-
|
|
19
|
-
"drag-overlay": "awsui_drag-
|
|
20
|
-
"content-display": "awsui_content-
|
|
21
|
-
"content-display-title": "awsui_content-display-
|
|
22
|
-
"content-display-description": "awsui_content-display-
|
|
23
|
-
"content-display-option-list": "awsui_content-display-option-
|
|
24
|
-
"root": "
|
|
25
|
-
"modal-root": "awsui_modal-
|
|
26
|
-
"trigger-button": "awsui_trigger-
|
|
27
|
-
"cancel-button": "awsui_cancel-
|
|
28
|
-
"confirm-button": "awsui_confirm-
|
|
29
|
-
"custom": "
|
|
30
|
-
"second-column-small": "awsui_second-column-
|
|
31
|
-
"wrap-lines": "awsui_wrap-
|
|
32
|
-
"striped-rows": "awsui_striped-
|
|
33
|
-
"content-density": "awsui_content-
|
|
34
|
-
"page-size": "awsui_page-
|
|
35
|
-
"page-size-form-field": "awsui_page-size-form-
|
|
36
|
-
"page-size-radio-group": "awsui_page-size-radio-
|
|
5
|
+
"visible-content": "awsui_visible-content_tc96w_1rnmc_185",
|
|
6
|
+
"visible-content-toggle": "awsui_visible-content-toggle_tc96w_1rnmc_186",
|
|
7
|
+
"visible-content-groups": "awsui_visible-content-groups_tc96w_1rnmc_187",
|
|
8
|
+
"visible-content-group": "awsui_visible-content-group_tc96w_1rnmc_187",
|
|
9
|
+
"visible-content-title": "awsui_visible-content-title_tc96w_1rnmc_192",
|
|
10
|
+
"visible-content-group-label": "awsui_visible-content-group-label_tc96w_1rnmc_201",
|
|
11
|
+
"visible-content-option": "awsui_visible-content-option_tc96w_1rnmc_207",
|
|
12
|
+
"visible-content-option-label": "awsui_visible-content-option-label_tc96w_1rnmc_218",
|
|
13
|
+
"content-display-option-toggle": "awsui_content-display-option-toggle_tc96w_1rnmc_409",
|
|
14
|
+
"content-display-option-content": "awsui_content-display-option-content_tc96w_1rnmc_413",
|
|
15
|
+
"content-display-option": "awsui_content-display-option_tc96w_1rnmc_409",
|
|
16
|
+
"placeholder": "awsui_placeholder_tc96w_1rnmc_436",
|
|
17
|
+
"sorting": "awsui_sorting_tc96w_1rnmc_436",
|
|
18
|
+
"content-display-option-label": "awsui_content-display-option-label_tc96w_1rnmc_463",
|
|
19
|
+
"drag-overlay": "awsui_drag-overlay_tc96w_1rnmc_471",
|
|
20
|
+
"content-display": "awsui_content-display_tc96w_1rnmc_409",
|
|
21
|
+
"content-display-title": "awsui_content-display-title_tc96w_1rnmc_498",
|
|
22
|
+
"content-display-description": "awsui_content-display-description_tc96w_1rnmc_506",
|
|
23
|
+
"content-display-option-list": "awsui_content-display-option-list_tc96w_1rnmc_514",
|
|
24
|
+
"root": "awsui_root_tc96w_1rnmc_520",
|
|
25
|
+
"modal-root": "awsui_modal-root_tc96w_1rnmc_521",
|
|
26
|
+
"trigger-button": "awsui_trigger-button_tc96w_1rnmc_522",
|
|
27
|
+
"cancel-button": "awsui_cancel-button_tc96w_1rnmc_523",
|
|
28
|
+
"confirm-button": "awsui_confirm-button_tc96w_1rnmc_524",
|
|
29
|
+
"custom": "awsui_custom_tc96w_1rnmc_525",
|
|
30
|
+
"second-column-small": "awsui_second-column-small_tc96w_1rnmc_529",
|
|
31
|
+
"wrap-lines": "awsui_wrap-lines_tc96w_1rnmc_533",
|
|
32
|
+
"striped-rows": "awsui_striped-rows_tc96w_1rnmc_534",
|
|
33
|
+
"content-density": "awsui_content-density_tc96w_1rnmc_535",
|
|
34
|
+
"page-size": "awsui_page-size_tc96w_1rnmc_536",
|
|
35
|
+
"page-size-form-field": "awsui_page-size-form-field_tc96w_1rnmc_537",
|
|
36
|
+
"page-size-radio-group": "awsui_page-size-radio-group_tc96w_1rnmc_538",
|
|
37
|
+
"sticky-columns": "awsui_sticky-columns_tc96w_1rnmc_539",
|
|
38
|
+
"sticky-columns-form-field": "awsui_sticky-columns-form-field_tc96w_1rnmc_540",
|
|
39
|
+
"sticky-columns-radio-group": "awsui_sticky-columns-radio-group_tc96w_1rnmc_541",
|
|
40
|
+
"sticky-columns-first": "awsui_sticky-columns-first_tc96w_1rnmc_542",
|
|
41
|
+
"sticky-columns-last": "awsui_sticky-columns-last_tc96w_1rnmc_543"
|
|
37
42
|
};
|
|
38
43
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CollectionPreferencesProps } from './interfaces';
|
|
3
|
-
export declare const copyPreferences: ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, custom, }: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
|
|
3
|
+
export declare const copyPreferences: ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, stickyColumns, custom, }: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
|
|
4
4
|
export declare const mergePreferences: (newPref: CollectionPreferencesProps.Preferences, oldPref: CollectionPreferencesProps.Preferences) => CollectionPreferencesProps.Preferences;
|
|
5
5
|
interface ModalContentLayoutProps {
|
|
6
6
|
left: React.ReactNode;
|
|
@@ -27,6 +27,17 @@ interface ContentDensityPreferenceProps extends CollectionPreferencesProps.Conte
|
|
|
27
27
|
value?: 'comfortable' | 'compact';
|
|
28
28
|
}
|
|
29
29
|
export declare const ContentDensityPreference: ({ label, description, value, onChange }: ContentDensityPreferenceProps) => JSX.Element;
|
|
30
|
+
interface StickyColumnsPreferenceProps extends CollectionPreferencesProps.StickyColumnsPreference {
|
|
31
|
+
onChange: (value?: {
|
|
32
|
+
first?: number;
|
|
33
|
+
last?: number;
|
|
34
|
+
}) => void;
|
|
35
|
+
value?: {
|
|
36
|
+
first?: number;
|
|
37
|
+
last?: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export declare const StickyColumnsPreference: ({ firstColumns, lastColumns, onChange, value, }: StickyColumnsPreferenceProps) => JSX.Element;
|
|
30
41
|
interface CustomPreferenceProps<T = any> extends Pick<CollectionPreferencesProps<T>, 'customPreference'> {
|
|
31
42
|
onChange: (value: T) => void;
|
|
32
43
|
value: T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"lib/default/","sources":["collection-preferences/utils.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"lib/default/","sources":["collection-preferences/utils.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAQxC,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAG1D,eAAO,MAAM,eAAe,iHASzB,2BAA2B,WAAW,KAAG,2BAA2B,WASrE,CAAC;AAIH,eAAO,MAAM,gBAAgB,YAClB,2BAA2B,WAAW,WACtC,2BAA2B,WAAW,KAC9C,2BAA2B,WAkB7B,CAAC;AAEF,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,4BAA6B,SAAQ,0BAA0B,CAAC,uBAAuB;IAC/F,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC9D,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AA+BD,eAAO,MAAM,uBAAuB,oDAKjC,4BAA4B,gBAqB9B,CAAC;AAEF,UAAU,qBAAqB,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,IAAI,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC;IACtG,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC;CACV;AACD,eAAO,MAAM,gBAAgB,0CAA2C,qBAAqB,uBAc5F,CAAC"}
|
|
@@ -6,15 +6,17 @@ import InternalCheckbox from '../checkbox/internal';
|
|
|
6
6
|
import InternalColumnLayout from '../column-layout/internal';
|
|
7
7
|
import InternalFormField from '../form-field/internal';
|
|
8
8
|
import InternalRadioGroup from '../radio-group/internal';
|
|
9
|
+
import InternalSpaceBetween from '../space-between/internal';
|
|
9
10
|
import { useContainerBreakpoints } from '../internal/hooks/container-queries';
|
|
10
11
|
import styles from './styles.css.js';
|
|
11
|
-
export const copyPreferences = ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, custom, }) => ({
|
|
12
|
+
export const copyPreferences = ({ pageSize, wrapLines, stripedRows, contentDensity, visibleContent, contentDisplay, stickyColumns, custom, }) => ({
|
|
12
13
|
pageSize,
|
|
13
14
|
wrapLines,
|
|
14
15
|
stripedRows,
|
|
15
16
|
contentDensity,
|
|
16
17
|
visibleContent,
|
|
17
18
|
contentDisplay,
|
|
19
|
+
stickyColumns,
|
|
18
20
|
custom,
|
|
19
21
|
});
|
|
20
22
|
export const mergePreferences = (newPref, oldPref) => {
|
|
@@ -27,6 +29,7 @@ export const mergePreferences = (newPref, oldPref) => {
|
|
|
27
29
|
'visibleContent',
|
|
28
30
|
'custom',
|
|
29
31
|
'contentDisplay',
|
|
32
|
+
'stickyColumns',
|
|
30
33
|
];
|
|
31
34
|
for (const prefName of prefNames) {
|
|
32
35
|
if (newPref[prefName] !== undefined) {
|
|
@@ -55,6 +58,17 @@ export const PageSizePreference = ({ title, options, value, onChange }) => (Reac
|
|
|
55
58
|
export const WrapLinesPreference = ({ label, description, value, onChange }) => (React.createElement(InternalCheckbox, { checked: !!value, description: description, onChange: ({ detail }) => onChange(detail.checked), className: styles['wrap-lines'] }, label));
|
|
56
59
|
export const StripedRowsPreference = ({ label, description, value, onChange }) => (React.createElement(InternalCheckbox, { checked: !!value, description: description, onChange: ({ detail }) => onChange(detail.checked), className: styles['striped-rows'] }, label));
|
|
57
60
|
export const ContentDensityPreference = ({ label, description, value, onChange }) => (React.createElement(InternalCheckbox, { checked: value === 'compact', description: description, onChange: ({ detail }) => onChange(detail.checked ? 'compact' : 'comfortable'), className: styles['content-density'] }, label));
|
|
61
|
+
const StickyPreference = ({ firstOrLast, preference, value, onChange }) => {
|
|
62
|
+
const { title, description, options } = preference;
|
|
63
|
+
return (React.createElement("div", { className: styles[`sticky-columns-${firstOrLast}`] },
|
|
64
|
+
React.createElement(InternalFormField, { className: styles['sticky-columns-form-field'], label: title, description: description },
|
|
65
|
+
React.createElement(InternalRadioGroup, { className: styles['sticky-columns-radio-group'], value: typeof value !== 'undefined' ? `${value}` : null, items: options.map(({ label, value }) => ({ label, value: `${value}` })), onChange: ({ detail }) => onChange(Number(detail.value)) }))));
|
|
66
|
+
};
|
|
67
|
+
export const StickyColumnsPreference = ({ firstColumns, lastColumns, onChange, value, }) => {
|
|
68
|
+
return (React.createElement(InternalSpaceBetween, { className: styles['sticky-columns'], size: "l" },
|
|
69
|
+
firstColumns && (React.createElement(StickyPreference, { firstOrLast: "first", preference: firstColumns, value: value === null || value === void 0 ? void 0 : value.first, onChange: newValue => onChange(Object.assign(Object.assign({}, value), { first: newValue })) })),
|
|
70
|
+
lastColumns && (React.createElement(StickyPreference, { firstOrLast: "last", preference: lastColumns, value: value === null || value === void 0 ? void 0 : value.last, onChange: newValue => onChange(Object.assign(Object.assign({}, value), { last: newValue })) }))));
|
|
71
|
+
};
|
|
58
72
|
export const CustomPreference = ({ value, customPreference, onChange }) => {
|
|
59
73
|
const [customState, setCustomState] = useState(value);
|
|
60
74
|
if (customPreference) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"lib/default/","sources":["collection-preferences/utils.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD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ACL,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,IAC1B,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;YACrC,uDAAuD;YACvD,cAAc,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;YAC5B,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC,CACE,CACP,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport clsx from 'clsx';\nimport InternalCheckbox from '../checkbox/internal';\nimport InternalColumnLayout from '../column-layout/internal';\nimport InternalFormField from '../form-field/internal';\nimport InternalRadioGroup from '../radio-group/internal';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { CollectionPreferencesProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport const copyPreferences = ({\n pageSize,\n wrapLines,\n stripedRows,\n contentDensity,\n visibleContent,\n contentDisplay,\n custom,\n}: CollectionPreferencesProps.Preferences): CollectionPreferencesProps.Preferences => ({\n pageSize,\n wrapLines,\n stripedRows,\n contentDensity,\n visibleContent,\n contentDisplay,\n custom,\n});\n\ntype CopyPreferenceName = keyof CollectionPreferencesProps.Preferences;\n\nexport const mergePreferences = (\n newPref: CollectionPreferencesProps.Preferences,\n oldPref: CollectionPreferencesProps.Preferences\n): CollectionPreferencesProps.Preferences => {\n const newObj = { ...oldPref };\n const prefNames: CopyPreferenceName[] = [\n 'pageSize',\n 'wrapLines',\n 'stripedRows',\n 'contentDensity',\n 'visibleContent',\n 'custom',\n 'contentDisplay',\n ];\n for (const prefName of prefNames) {\n if (newPref[prefName] !== undefined) {\n newObj[prefName] = newPref[prefName];\n }\n }\n return newObj;\n};\n\ninterface ModalContentLayoutProps {\n left: React.ReactNode;\n right: React.ReactNode;\n}\n\nexport const ModalContentLayout = ({ left, right }: ModalContentLayoutProps) => {\n const [breakpoint, ref] = useContainerBreakpoints(['xs']);\n const smallContainer = breakpoint === 'default';\n\n if (smallContainer) {\n return (\n <div ref={ref}>\n {left && <div>{left}</div>}\n {right && <div className={clsx(left && styles['second-column-small'])}>{right}</div>}\n </div>\n );\n }\n\n const columns = left && right ? 2 : 1;\n return (\n <div ref={ref}>\n <InternalColumnLayout columns={columns} variant=\"text-grid\">\n {left && <div>{left}</div>}\n {right && <div>{right}</div>}\n </InternalColumnLayout>\n </div>\n );\n};\n\ninterface PageSizePreferenceProps extends CollectionPreferencesProps.PageSizePreference {\n onChange: (value: number) => void;\n value?: number;\n}\n\nexport const PageSizePreference = ({ title, options, value, onChange }: PageSizePreferenceProps) => (\n <div className={styles['page-size']}>\n <InternalFormField label={title} stretch={true} className={styles['page-size-form-field']}>\n <InternalRadioGroup\n className={styles['page-size-radio-group']}\n value={`${value}`}\n items={options.map(({ label, value }) => ({ label, value: `${value}` }))}\n onChange={({ detail }) => onChange(parseInt(detail.value, 10))}\n />\n </InternalFormField>\n </div>\n);\n\ninterface WrapLinesPreferenceProps extends CollectionPreferencesProps.WrapLinesPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport const WrapLinesPreference = ({ label, description, value, onChange }: WrapLinesPreferenceProps) => (\n <InternalCheckbox\n checked={!!value}\n description={description}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['wrap-lines']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface StripedRowsPreferenceProps extends CollectionPreferencesProps.StripedRowsPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport const StripedRowsPreference = ({ label, description, value, onChange }: StripedRowsPreferenceProps) => (\n <InternalCheckbox\n checked={!!value}\n description={description}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['striped-rows']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface ContentDensityPreferenceProps extends CollectionPreferencesProps.ContentDensityPreference {\n onChange: (value: 'comfortable' | 'compact') => void;\n value?: 'comfortable' | 'compact';\n}\n\nexport const ContentDensityPreference = ({ label, description, value, onChange }: ContentDensityPreferenceProps) => (\n <InternalCheckbox\n checked={value === 'compact'}\n description={description}\n onChange={({ detail }) => onChange(detail.checked ? 'compact' : 'comfortable')}\n className={styles['content-density']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface CustomPreferenceProps<T = any> extends Pick<CollectionPreferencesProps<T>, 'customPreference'> {\n onChange: (value: T) => void;\n value: T;\n}\nexport const CustomPreference = ({ value, customPreference, onChange }: CustomPreferenceProps) => {\n const [customState, setCustomState] = useState(value);\n if (customPreference) {\n return (\n <div className={styles.custom}>\n {customPreference(customState, value => {\n // prevent value to be treated as a functional callback\n setCustomState(() => value);\n onChange(value);\n })}\n </div>\n );\n }\n return null;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"lib/default/","sources":["collection-preferences/utils.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,iBAAiB,MAAM,wBAAwB,CAAC;AACvD,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AACzD,OAAO,oBAAoB,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,WAAW,EACX,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EACb,MAAM,GACiC,EAA0C,EAAE,CAAC,CAAC;IACrF,QAAQ;IACR,SAAS;IACT,WAAW;IACX,cAAc;IACd,cAAc;IACd,cAAc;IACd,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AAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,IAAI,gBAAgB,EAAE;QACpB,OAAO,CACL,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,IAC1B,gBAAgB,CAAC,WAAW,EAAE,KAAK,CAAC,EAAE;YACrC,uDAAuD;YACvD,cAAc,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC;YAC5B,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC,CAAC,CACE,CACP,CAAC;KACH;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useState } from 'react';\nimport clsx from 'clsx';\nimport InternalCheckbox from '../checkbox/internal';\nimport InternalColumnLayout from '../column-layout/internal';\nimport InternalFormField from '../form-field/internal';\nimport InternalRadioGroup from '../radio-group/internal';\nimport InternalSpaceBetween from '../space-between/internal';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { CollectionPreferencesProps } from './interfaces';\nimport styles from './styles.css.js';\n\nexport const copyPreferences = ({\n pageSize,\n wrapLines,\n stripedRows,\n contentDensity,\n visibleContent,\n contentDisplay,\n stickyColumns,\n custom,\n}: CollectionPreferencesProps.Preferences): CollectionPreferencesProps.Preferences => ({\n pageSize,\n wrapLines,\n stripedRows,\n contentDensity,\n visibleContent,\n contentDisplay,\n stickyColumns,\n custom,\n});\n\ntype CopyPreferenceName = keyof CollectionPreferencesProps.Preferences;\n\nexport const mergePreferences = (\n newPref: CollectionPreferencesProps.Preferences,\n oldPref: CollectionPreferencesProps.Preferences\n): CollectionPreferencesProps.Preferences => {\n const newObj = { ...oldPref };\n const prefNames: CopyPreferenceName[] = [\n 'pageSize',\n 'wrapLines',\n 'stripedRows',\n 'contentDensity',\n 'visibleContent',\n 'custom',\n 'contentDisplay',\n 'stickyColumns',\n ];\n for (const prefName of prefNames) {\n if (newPref[prefName] !== undefined) {\n newObj[prefName] = newPref[prefName];\n }\n }\n return newObj;\n};\n\ninterface ModalContentLayoutProps {\n left: React.ReactNode;\n right: React.ReactNode;\n}\n\nexport const ModalContentLayout = ({ left, right }: ModalContentLayoutProps) => {\n const [breakpoint, ref] = useContainerBreakpoints(['xs']);\n const smallContainer = breakpoint === 'default';\n\n if (smallContainer) {\n return (\n <div ref={ref}>\n {left && <div>{left}</div>}\n {right && <div className={clsx(left && styles['second-column-small'])}>{right}</div>}\n </div>\n );\n }\n\n const columns = left && right ? 2 : 1;\n return (\n <div ref={ref}>\n <InternalColumnLayout columns={columns} variant=\"text-grid\">\n {left && <div>{left}</div>}\n {right && <div>{right}</div>}\n </InternalColumnLayout>\n </div>\n );\n};\n\ninterface PageSizePreferenceProps extends CollectionPreferencesProps.PageSizePreference {\n onChange: (value: number) => void;\n value?: number;\n}\n\nexport const PageSizePreference = ({ title, options, value, onChange }: PageSizePreferenceProps) => (\n <div className={styles['page-size']}>\n <InternalFormField label={title} stretch={true} className={styles['page-size-form-field']}>\n <InternalRadioGroup\n className={styles['page-size-radio-group']}\n value={`${value}`}\n items={options.map(({ label, value }) => ({ label, value: `${value}` }))}\n onChange={({ detail }) => onChange(parseInt(detail.value, 10))}\n />\n </InternalFormField>\n </div>\n);\n\ninterface WrapLinesPreferenceProps extends CollectionPreferencesProps.WrapLinesPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport const WrapLinesPreference = ({ label, description, value, onChange }: WrapLinesPreferenceProps) => (\n <InternalCheckbox\n checked={!!value}\n description={description}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['wrap-lines']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface StripedRowsPreferenceProps extends CollectionPreferencesProps.StripedRowsPreference {\n onChange: (value: boolean) => void;\n value?: boolean;\n}\n\nexport const StripedRowsPreference = ({ label, description, value, onChange }: StripedRowsPreferenceProps) => (\n <InternalCheckbox\n checked={!!value}\n description={description}\n onChange={({ detail }) => onChange(detail.checked)}\n className={styles['striped-rows']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface ContentDensityPreferenceProps extends CollectionPreferencesProps.ContentDensityPreference {\n onChange: (value: 'comfortable' | 'compact') => void;\n value?: 'comfortable' | 'compact';\n}\n\nexport const ContentDensityPreference = ({ label, description, value, onChange }: ContentDensityPreferenceProps) => (\n <InternalCheckbox\n checked={value === 'compact'}\n description={description}\n onChange={({ detail }) => onChange(detail.checked ? 'compact' : 'comfortable')}\n className={styles['content-density']}\n >\n {label}\n </InternalCheckbox>\n);\n\ninterface StickyColumnsPreferenceProps extends CollectionPreferencesProps.StickyColumnsPreference {\n onChange: (value?: { first?: number; last?: number }) => void;\n value?: { first?: number; last?: number };\n}\ninterface StickyPreference extends CollectionPreferencesProps.StickyColumnsPreference {\n onChange: (value: number) => void;\n preference: {\n title: string;\n description: string;\n options: ReadonlyArray<{\n label: string;\n value: number;\n }>;\n };\n value?: number;\n firstOrLast: 'first' | 'last';\n}\n\nconst StickyPreference = ({ firstOrLast, preference, value, onChange }: StickyPreference) => {\n const { title, description, options } = preference;\n return (\n <div className={styles[`sticky-columns-${firstOrLast}`]}>\n <InternalFormField className={styles['sticky-columns-form-field']} label={title} description={description}>\n <InternalRadioGroup\n className={styles['sticky-columns-radio-group']}\n value={typeof value !== 'undefined' ? `${value}` : null}\n items={options.map(({ label, value }) => ({ label, value: `${value}` }))}\n onChange={({ detail }) => onChange(Number(detail.value))}\n />\n </InternalFormField>\n </div>\n );\n};\n\nexport const StickyColumnsPreference = ({\n firstColumns,\n lastColumns,\n onChange,\n value,\n}: StickyColumnsPreferenceProps) => {\n return (\n <InternalSpaceBetween className={styles['sticky-columns']} size=\"l\">\n {firstColumns && (\n <StickyPreference\n firstOrLast=\"first\"\n preference={firstColumns}\n value={value?.first}\n onChange={newValue => onChange({ ...value, first: newValue })}\n />\n )}\n {lastColumns && (\n <StickyPreference\n firstOrLast=\"last\"\n preference={lastColumns}\n value={value?.last}\n onChange={newValue => onChange({ ...value, last: newValue })}\n />\n )}\n </InternalSpaceBetween>\n );\n};\n\ninterface CustomPreferenceProps<T = any> extends Pick<CollectionPreferencesProps<T>, 'customPreference'> {\n onChange: (value: T) => void;\n value: T;\n}\nexport const CustomPreference = ({ value, customPreference, onChange }: CustomPreferenceProps) => {\n const [customState, setCustomState] = useState(value);\n if (customPreference) {\n return (\n <div className={styles.custom}>\n {customPreference(customState, value => {\n // prevent value to be treated as a functional callback\n setCustomState(() => value);\n onChange(value);\n })}\n </div>\n );\n }\n return null;\n};\n"]}
|
|
@@ -465,6 +465,7 @@
|
|
|
465
465
|
--motion-duration-slow-0273ow:180ms;
|
|
466
466
|
--motion-duration-transition-quick-x85tae:90ms;
|
|
467
467
|
--motion-duration-transition-show-paced-ai4wlf:180ms;
|
|
468
|
+
--motion-duration-transition-show-quick-w3nd9c:90ms;
|
|
468
469
|
--motion-easing-ease-out-quart-z687ml:cubic-bezier(0.165, 0.84, 0.44, 1);
|
|
469
470
|
--motion-easing-refresh-only-a-sy0g8m:cubic-bezier(0, 0, 0, 1);
|
|
470
471
|
--motion-easing-refresh-only-b-nspng9:cubic-bezier(1, 0, 0.83, 1);
|
|
@@ -591,6 +592,8 @@
|
|
|
591
592
|
--shadow-split-side-qv353u:-1px 0px 1px 0px #e9ebed, -36px 6px 36px -36px rgba(0, 7, 22, 0.10);
|
|
592
593
|
--shadow-sticky-aijlo6:0px 4px 20px 1px rgba(0, 7, 22, 0.10);
|
|
593
594
|
--shadow-sticky-embedded-qit8ba:0px 2px 0px 0px #e9ebed, 0px 16px 16px -12px rgba(0, 7, 22, 0.10);
|
|
595
|
+
--shadow-sticky-column-first-h2plme:4px 0px 20px 1px rgba(0, 7, 22, 0.1);
|
|
596
|
+
--shadow-sticky-column-last-s13kkz:-4px 0 20px 1px rgba(0, 28, 36, 0.1);
|
|
594
597
|
}
|
|
595
598
|
|
|
596
599
|
.awsui-dark-mode:not(#\9) {
|
|
@@ -942,6 +945,8 @@
|
|
|
942
945
|
--shadow-split-side-qv353u:-1px 0px 1px 0px #192534, -36px 6px 36px -36px rgba(0, 7, 22, 1);
|
|
943
946
|
--shadow-sticky-aijlo6:0px 4px 20px 1px rgba(0, 7, 22, 1);
|
|
944
947
|
--shadow-sticky-embedded-qit8ba:0px 2px 0px 0px #414d5c, 0px 16px 16px -12px rgba(0, 7, 22, 1);
|
|
948
|
+
--shadow-sticky-column-first-h2plme:0px 4px 20px 1px rgba(0, 7, 22, 1);
|
|
949
|
+
--shadow-sticky-column-last-s13kkz:0px 4px 20px 1px rgba(0, 7, 22, 1);
|
|
945
950
|
}
|
|
946
951
|
|
|
947
952
|
.awsui-compact-mode:not(#\9) {
|
|
@@ -992,6 +997,7 @@
|
|
|
992
997
|
--motion-duration-slow-0273ow:0ms;
|
|
993
998
|
--motion-duration-transition-quick-x85tae:0ms;
|
|
994
999
|
--motion-duration-transition-show-paced-ai4wlf:0ms;
|
|
1000
|
+
--motion-duration-transition-show-quick-w3nd9c:0ms;
|
|
995
1001
|
--motion-duration-responsive-dvittz:0ms;
|
|
996
1002
|
--motion-duration-expressive-96gzp7:0ms;
|
|
997
1003
|
--motion-duration-complex-8zbvzy:0ms;
|
|
@@ -1394,6 +1400,8 @@
|
|
|
1394
1400
|
--shadow-split-side-qv353u:-1px 0px 1px 0px #192534, -36px 6px 36px -36px rgba(0, 7, 22, 1);
|
|
1395
1401
|
--shadow-sticky-aijlo6:0px 4px 20px 1px rgba(0, 7, 22, 1);
|
|
1396
1402
|
--shadow-sticky-embedded-qit8ba:0px 2px 0px 0px #414d5c, 0px 16px 16px -12px rgba(0, 7, 22, 1);
|
|
1403
|
+
--shadow-sticky-column-first-h2plme:0px 4px 20px 1px rgba(0, 7, 22, 1);
|
|
1404
|
+
--shadow-sticky-column-last-s13kkz:0px 4px 20px 1px rgba(0, 7, 22, 1);
|
|
1397
1405
|
}
|
|
1398
1406
|
|
|
1399
1407
|
.awsui-context-flashbar:not(#\9) {
|
|
@@ -14,7 +14,8 @@ export interface AbstractSwitchProps extends React.HTMLAttributes<HTMLElement>,
|
|
|
14
14
|
ariaLabel?: string;
|
|
15
15
|
ariaLabelledby?: string;
|
|
16
16
|
ariaDescribedby?: string;
|
|
17
|
+
ariaControls?: string;
|
|
17
18
|
onClick: () => void;
|
|
18
19
|
}
|
|
19
|
-
export default function AbstractSwitch({ controlId, controlClassName, outlineClassName, showOutline, disabled, nativeControl, styledControl, label, description, descriptionBottomPadding, ariaLabel, ariaLabelledby, ariaDescribedby, onClick, __internalRootRef, ...rest }: AbstractSwitchProps): JSX.Element;
|
|
20
|
+
export default function AbstractSwitch({ controlId, controlClassName, outlineClassName, showOutline, disabled, nativeControl, styledControl, label, description, descriptionBottomPadding, ariaLabel, ariaLabelledby, ariaDescribedby, ariaControls, onClick, __internalRootRef, ...rest }: AbstractSwitchProps): JSX.Element;
|
|
20
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/abstract-switch/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAErF,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,0BAA0B;IACxG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,KAAK,KAAK,CAAC,YAAY,CAAC;IAC1F,aAAa,EAAE,KAAK,CAAC,YAAY,CAAC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAMD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,aAAa,EACb,aAAa,EACb,KAAK,EACL,WAAW,EACX,wBAAwB,EACxB,SAAS,EACT,cAAc,EACd,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,GAAG,IAAI,EACR,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["internal/components/abstract-switch/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAErF,MAAM,WAAW,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,0BAA0B;IACxG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,KAAK,KAAK,CAAC,YAAY,CAAC;IAC1F,aAAa,EAAE,KAAK,CAAC,YAAY,CAAC;IAClC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAMD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,QAAQ,EACR,aAAa,EACb,aAAa,EACb,KAAK,EACL,WAAW,EACX,wBAAwB,EACxB,SAAS,EACT,cAAc,EACd,eAAe,EACf,YAAY,EACZ,OAAO,EACP,iBAAiB,EACjB,GAAG,IAAI,EACR,EAAE,mBAAmB,eAgErB"}
|
|
@@ -9,7 +9,7 @@ function joinString(values) {
|
|
|
9
9
|
return values.filter((value) => !!value).join(' ');
|
|
10
10
|
}
|
|
11
11
|
export default function AbstractSwitch(_a) {
|
|
12
|
-
var { controlId, controlClassName, outlineClassName, showOutline, disabled, nativeControl, styledControl, label, description, descriptionBottomPadding, ariaLabel, ariaLabelledby, ariaDescribedby, onClick, __internalRootRef } = _a, rest = __rest(_a, ["controlId", "controlClassName", "outlineClassName", "showOutline", "disabled", "nativeControl", "styledControl", "label", "description", "descriptionBottomPadding", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "onClick", "__internalRootRef"]);
|
|
12
|
+
var { controlId, controlClassName, outlineClassName, showOutline, disabled, nativeControl, styledControl, label, description, descriptionBottomPadding, ariaLabel, ariaLabelledby, ariaDescribedby, ariaControls, onClick, __internalRootRef } = _a, rest = __rest(_a, ["controlId", "controlClassName", "outlineClassName", "showOutline", "disabled", "nativeControl", "styledControl", "label", "description", "descriptionBottomPadding", "ariaLabel", "ariaLabelledby", "ariaDescribedby", "ariaControls", "onClick", "__internalRootRef"]);
|
|
13
13
|
const uniqueId = useUniqueId();
|
|
14
14
|
const id = controlId || uniqueId;
|
|
15
15
|
const labelId = `${id}-label`;
|
|
@@ -21,12 +21,12 @@ export default function AbstractSwitch(_a) {
|
|
|
21
21
|
if (ariaLabelledby) {
|
|
22
22
|
ariaLabelledByIds.push(ariaLabelledby);
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const ariaDescriptions = [];
|
|
25
25
|
if (ariaDescribedby) {
|
|
26
|
-
|
|
26
|
+
ariaDescriptions.push(ariaDescribedby);
|
|
27
27
|
}
|
|
28
28
|
if (description) {
|
|
29
|
-
|
|
29
|
+
ariaDescriptions.push(descriptionId);
|
|
30
30
|
}
|
|
31
31
|
return (React.createElement("span", Object.assign({}, rest, { className: clsx(styles.wrapper, rest.className), ref: __internalRootRef }),
|
|
32
32
|
React.createElement("span", { className: styles['label-wrapper'], "aria-disabled": disabled ? 'true' : undefined, onClick: disabled ? undefined : onClick },
|
|
@@ -36,9 +36,10 @@ export default function AbstractSwitch(_a) {
|
|
|
36
36
|
id,
|
|
37
37
|
disabled,
|
|
38
38
|
className: styles['native-input'],
|
|
39
|
-
'aria-describedby':
|
|
39
|
+
'aria-describedby': ariaDescriptions.length ? joinString(ariaDescriptions) : undefined,
|
|
40
40
|
'aria-labelledby': ariaLabelledByIds.length ? joinString(ariaLabelledByIds) : undefined,
|
|
41
41
|
'aria-label': ariaLabel,
|
|
42
|
+
'aria-controls': ariaControls,
|
|
42
43
|
}),
|
|
43
44
|
React.createElement("span", { className: clsx(styles.outline, outlineClassName, showOutline && styles['show-outline']) })),
|
|
44
45
|
React.createElement("span", { className: clsx(styles.content, !label && !description && styles['empty-content']) },
|