@cloudscape-design/components-themeable 3.0.1309 → 3.0.1310
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/collection-preferences/content-display/content-display-list.scss +10 -0
- package/lib/internal/scss/collection-preferences/content-display/content-display-option.scss +12 -0
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/table/header-cell/styles.scss +42 -5
- package/lib/internal/scss/table/resizer/styles.scss +26 -13
- package/lib/internal/scss/table/styles.scss +9 -0
- package/lib/internal/template/collection-preferences/content-display/content-display-option.js +1 -1
- package/lib/internal/template/collection-preferences/content-display/content-display-option.js.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/index.d.ts +1 -1
- package/lib/internal/template/collection-preferences/content-display/index.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/index.js +63 -27
- package/lib/internal/template/collection-preferences/content-display/index.js.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/utils.d.ts +40 -1
- package/lib/internal/template/collection-preferences/content-display/utils.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/content-display/utils.js +107 -13
- package/lib/internal/template/collection-preferences/content-display/utils.js.map +1 -1
- package/lib/internal/template/collection-preferences/index.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/index.js +2 -2
- package/lib/internal/template/collection-preferences/index.js.map +1 -1
- package/lib/internal/template/collection-preferences/interfaces.d.ts +30 -2
- package/lib/internal/template/collection-preferences/interfaces.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/interfaces.js.map +1 -1
- package/lib/internal/template/collection-preferences/styles.css.js +38 -36
- package/lib/internal/template/collection-preferences/styles.scoped.css +81 -37
- package/lib/internal/template/collection-preferences/styles.selectors.js +38 -36
- package/lib/internal/template/collection-preferences/utils.d.ts +1 -0
- package/lib/internal/template/collection-preferences/utils.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/utils.js +14 -0
- package/lib/internal/template/collection-preferences/utils.js.map +1 -1
- package/lib/internal/template/i18n/messages/all.all.js +1 -1
- package/lib/internal/template/i18n/messages/all.all.json +1 -1
- package/lib/internal/template/i18n/messages/all.en.js +1 -1
- package/lib/internal/template/i18n/messages/all.en.json +1 -1
- package/lib/internal/template/i18n/messages-types.d.ts +4 -0
- package/lib/internal/template/i18n/messages-types.d.ts.map +1 -1
- package/lib/internal/template/i18n/messages-types.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/pagination/internal.d.ts.map +1 -1
- package/lib/internal/template/pagination/internal.js +4 -1
- package/lib/internal/template/pagination/internal.js.map +1 -1
- package/lib/internal/template/table/column-groups/col-group.d.ts +8 -0
- package/lib/internal/template/table/column-groups/col-group.d.ts.map +1 -0
- package/lib/internal/template/table/column-groups/col-group.js +24 -0
- package/lib/internal/template/table/column-groups/col-group.js.map +1 -0
- package/lib/internal/template/table/column-groups/split-utils.d.ts +27 -0
- package/lib/internal/template/table/column-groups/split-utils.d.ts.map +1 -0
- package/lib/internal/template/table/column-groups/split-utils.js +43 -0
- package/lib/internal/template/table/column-groups/split-utils.js.map +1 -0
- package/lib/internal/template/table/column-groups/use-column-groups.d.ts +8 -0
- package/lib/internal/template/table/column-groups/use-column-groups.d.ts.map +1 -0
- package/lib/internal/template/table/column-groups/use-column-groups.js +23 -0
- package/lib/internal/template/table/column-groups/use-column-groups.js.map +1 -0
- package/lib/internal/template/table/column-groups/utils.d.ts +55 -0
- package/lib/internal/template/table/column-groups/utils.d.ts.map +1 -0
- package/lib/internal/template/table/column-groups/utils.js +204 -0
- package/lib/internal/template/table/column-groups/utils.js.map +1 -0
- package/lib/internal/template/table/header-cell/common-props.d.ts +24 -0
- package/lib/internal/template/table/header-cell/common-props.d.ts.map +1 -0
- package/lib/internal/template/table/header-cell/common-props.js +4 -0
- package/lib/internal/template/table/header-cell/common-props.js.map +1 -0
- package/lib/internal/template/table/header-cell/group-header-cell.d.ts +18 -0
- package/lib/internal/template/table/header-cell/group-header-cell.d.ts.map +1 -0
- package/lib/internal/template/table/header-cell/group-header-cell.js +44 -0
- package/lib/internal/template/table/header-cell/group-header-cell.js.map +1 -0
- package/lib/internal/template/table/header-cell/index.d.ts +8 -23
- package/lib/internal/template/table/header-cell/index.d.ts.map +1 -1
- package/lib/internal/template/table/header-cell/index.js +3 -3
- package/lib/internal/template/table/header-cell/index.js.map +1 -1
- package/lib/internal/template/table/header-cell/styles.css.js +33 -30
- package/lib/internal/template/table/header-cell/styles.scoped.css +92 -68
- package/lib/internal/template/table/header-cell/styles.selectors.js +33 -30
- package/lib/internal/template/table/header-cell/th-element.d.ts +10 -1
- package/lib/internal/template/table/header-cell/th-element.d.ts.map +1 -1
- package/lib/internal/template/table/header-cell/th-element.js +6 -4
- package/lib/internal/template/table/header-cell/th-element.js.map +1 -1
- package/lib/internal/template/table/index.d.ts.map +1 -1
- package/lib/internal/template/table/index.js +5 -2
- package/lib/internal/template/table/index.js.map +1 -1
- package/lib/internal/template/table/interfaces.d.ts +37 -1
- package/lib/internal/template/table/interfaces.d.ts.map +1 -1
- package/lib/internal/template/table/interfaces.js.map +1 -1
- package/lib/internal/template/table/internal.d.ts.map +1 -1
- package/lib/internal/template/table/internal.js +17 -5
- package/lib/internal/template/table/internal.js.map +1 -1
- package/lib/internal/template/table/resizer/index.d.ts +6 -2
- package/lib/internal/template/table/resizer/index.d.ts.map +1 -1
- package/lib/internal/template/table/resizer/index.js +5 -5
- package/lib/internal/template/table/resizer/index.js.map +1 -1
- package/lib/internal/template/table/resizer/styles.css.js +16 -13
- package/lib/internal/template/table/resizer/styles.scoped.css +36 -26
- package/lib/internal/template/table/resizer/styles.selectors.js +16 -13
- package/lib/internal/template/table/sticky-header.d.ts +3 -0
- package/lib/internal/template/table/sticky-header.d.ts.map +1 -1
- package/lib/internal/template/table/sticky-header.js +7 -2
- package/lib/internal/template/table/sticky-header.js.map +1 -1
- package/lib/internal/template/table/sticky-scrolling.d.ts.map +1 -1
- package/lib/internal/template/table/sticky-scrolling.js +6 -1
- package/lib/internal/template/table/sticky-scrolling.js.map +1 -1
- package/lib/internal/template/table/styles.css.js +35 -34
- package/lib/internal/template/table/styles.scoped.css +47 -41
- package/lib/internal/template/table/styles.selectors.js +35 -34
- package/lib/internal/template/table/table-role/grid-navigation.d.ts.map +1 -1
- package/lib/internal/template/table/table-role/grid-navigation.js +5 -7
- package/lib/internal/template/table/table-role/grid-navigation.js.map +1 -1
- package/lib/internal/template/table/table-role/table-role-helper.d.ts +3 -0
- package/lib/internal/template/table/table-role/table-role-helper.d.ts.map +1 -1
- package/lib/internal/template/table/table-role/table-role-helper.js +9 -4
- package/lib/internal/template/table/table-role/table-role-helper.js.map +1 -1
- package/lib/internal/template/table/table-role/utils.d.ts +19 -0
- package/lib/internal/template/table/table-role/utils.d.ts.map +1 -1
- package/lib/internal/template/table/table-role/utils.js +86 -7
- package/lib/internal/template/table/table-role/utils.js.map +1 -1
- package/lib/internal/template/table/thead.d.ts +5 -0
- package/lib/internal/template/table/thead.d.ts.map +1 -1
- package/lib/internal/template/table/thead.js +145 -18
- package/lib/internal/template/table/thead.js.map +1 -1
- package/lib/internal/template/table/use-column-widths.d.ts +4 -1
- package/lib/internal/template/table/use-column-widths.d.ts.map +1 -1
- package/lib/internal/template/table/use-column-widths.js +68 -18
- package/lib/internal/template/table/use-column-widths.js.map +1 -1
- package/lib/internal/template/table/use-sticky-header.d.ts.map +1 -1
- package/lib/internal/template/table/use-sticky-header.js +4 -1
- package/lib/internal/template/table/use-sticky-header.js.map +1 -1
- package/lib/internal/template/table/utils.d.ts.map +1 -1
- package/lib/internal/template/table/utils.js +14 -4
- package/lib/internal/template/table/utils.js.map +1 -1
- package/lib/internal/template/test-utils/dom/collection-preferences/content-display-preference.d.ts +28 -2
- package/lib/internal/template/test-utils/dom/collection-preferences/content-display-preference.js +60 -2
- package/lib/internal/template/test-utils/dom/collection-preferences/content-display-preference.js.map +1 -1
- package/lib/internal/template/test-utils/dom/table/index.d.ts +18 -1
- package/lib/internal/template/test-utils/dom/table/index.js +22 -3
- package/lib/internal/template/test-utils/dom/table/index.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/collection-preferences/content-display-preference.d.ts +28 -2
- package/lib/internal/template/test-utils/selectors/collection-preferences/content-display-preference.js +52 -2
- package/lib/internal/template/test-utils/selectors/collection-preferences/content-display-preference.js.map +1 -1
- package/lib/internal/template/test-utils/selectors/table/index.d.ts +18 -1
- package/lib/internal/template/test-utils/selectors/table/index.js +22 -3
- package/lib/internal/template/test-utils/selectors/table/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -32,3 +32,13 @@
|
|
|
32
32
|
padding-block: 0;
|
|
33
33
|
padding-inline: 0;
|
|
34
34
|
}
|
|
35
|
+
|
|
36
|
+
$group-children-indentation: 28px;
|
|
37
|
+
|
|
38
|
+
// Text-to-text indentation between group header and child items.
|
|
39
|
+
// The drag handle (~20px) is rendered before the content, so we subtract it.
|
|
40
|
+
.content-display-group-children {
|
|
41
|
+
padding-inline-start: calc(
|
|
42
|
+
#{$group-children-indentation} - #{awsui.$size-icon-normal} - 2 * #{awsui.$space-scaled-xxxs}
|
|
43
|
+
);
|
|
44
|
+
}
|
package/lib/internal/scss/collection-preferences/content-display/content-display-option.scss
CHANGED
|
@@ -27,3 +27,15 @@
|
|
|
27
27
|
@include styles.text-wrapping;
|
|
28
28
|
padding-inline-end: awsui.$space-l;
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
.content-display-group-header {
|
|
32
|
+
@include styles.styles-reset;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: flex-start;
|
|
35
|
+
padding-block: awsui.$space-scaled-xs;
|
|
36
|
+
padding-inline-end: awsui.$space-xs;
|
|
37
|
+
border-start-start-radius: awsui.$border-radius-item;
|
|
38
|
+
border-start-end-radius: awsui.$border-radius-item;
|
|
39
|
+
border-end-start-radius: awsui.$border-radius-item;
|
|
40
|
+
border-end-end-radius: awsui.$border-radius-item;
|
|
41
|
+
}
|
|
@@ -53,7 +53,7 @@ $cell-horizontal-padding: awsui.$space-scaled-l;
|
|
|
53
53
|
position: relative;
|
|
54
54
|
text-align: start;
|
|
55
55
|
box-sizing: border-box;
|
|
56
|
-
border-block-end: awsui.$border-divider-
|
|
56
|
+
border-block-end: awsui.$border-divider-list-width solid awsui.$color-border-divider-interactive-default;
|
|
57
57
|
background: awsui.$color-background-table-header;
|
|
58
58
|
color: awsui.$color-text-column-header;
|
|
59
59
|
font-weight: awsui.$font-weight-heading-s;
|
|
@@ -63,6 +63,13 @@ $cell-horizontal-padding: awsui.$space-scaled-l;
|
|
|
63
63
|
|
|
64
64
|
@include header-cell-focus-outline(awsui.$space-scaled-xxs);
|
|
65
65
|
|
|
66
|
+
&.header-cell-group,
|
|
67
|
+
&.header-cell-grouped,
|
|
68
|
+
&.header-cell-spans-rows {
|
|
69
|
+
padding-block: awsui.$space-xxxs;
|
|
70
|
+
padding-inline: awsui.$space-scaled-xs;
|
|
71
|
+
}
|
|
72
|
+
|
|
66
73
|
&-sticky {
|
|
67
74
|
border-block-end: awsui.$border-table-sticky-width solid awsui.$color-border-divider-default;
|
|
68
75
|
}
|
|
@@ -80,6 +87,7 @@ $cell-horizontal-padding: awsui.$space-scaled-l;
|
|
|
80
87
|
background: none;
|
|
81
88
|
}
|
|
82
89
|
&:last-child,
|
|
90
|
+
&[data-rightmost],
|
|
83
91
|
&.header-cell-sortable {
|
|
84
92
|
padding-inline-end: awsui.$space-xs;
|
|
85
93
|
}
|
|
@@ -143,6 +151,12 @@ $cell-horizontal-padding: awsui.$space-scaled-l;
|
|
|
143
151
|
padding-inline-end: awsui.$space-s;
|
|
144
152
|
@include cell-offset(awsui.$space-s);
|
|
145
153
|
|
|
154
|
+
.header-cell-group > &,
|
|
155
|
+
.header-cell-grouped > &,
|
|
156
|
+
.header-cell-spans-rows > & {
|
|
157
|
+
padding-block: awsui.$space-xxxs;
|
|
158
|
+
}
|
|
159
|
+
|
|
146
160
|
.header-cell-sortable > & {
|
|
147
161
|
padding-inline-end: calc(#{awsui.$space-xl} + #{awsui.$space-xxs});
|
|
148
162
|
}
|
|
@@ -160,6 +174,26 @@ $cell-horizontal-padding: awsui.$space-scaled-l;
|
|
|
160
174
|
}
|
|
161
175
|
}
|
|
162
176
|
|
|
177
|
+
.header-cell-spans-rows {
|
|
178
|
+
block-size: 100%;
|
|
179
|
+
vertical-align: bottom;
|
|
180
|
+
|
|
181
|
+
> .header-cell-content {
|
|
182
|
+
block-size: 100%;
|
|
183
|
+
box-sizing: border-box;
|
|
184
|
+
display: flex;
|
|
185
|
+
flex-direction: column;
|
|
186
|
+
justify-content: flex-end;
|
|
187
|
+
|
|
188
|
+
// stylelint-disable-next-line no-descending-specificity
|
|
189
|
+
> .sorting-icon {
|
|
190
|
+
inset-block-start: auto;
|
|
191
|
+
inset-block-end: awsui.$space-scaled-xxs;
|
|
192
|
+
transform: none;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
163
197
|
.header-cell-sortable:not(.header-cell-disabled) {
|
|
164
198
|
& > .header-cell-content {
|
|
165
199
|
cursor: pointer;
|
|
@@ -206,12 +240,14 @@ settings icon in the pagination slot.
|
|
|
206
240
|
&:first-child {
|
|
207
241
|
@include header-cell-focus-outline-first(awsui.$space-scaled-xxs);
|
|
208
242
|
}
|
|
209
|
-
&:first-child > .header-cell-content {
|
|
243
|
+
&:first-child:not(.header-cell-grouped):not(.header-cell-group) > .header-cell-content {
|
|
210
244
|
@include cell-offset(0px);
|
|
211
245
|
@include header-cell-focus-outline-first(awsui.$space-table-header-focus-outline-gutter);
|
|
212
246
|
}
|
|
213
247
|
|
|
214
|
-
&:first-child:not(.has-striped-rows):not(.sticky-cell-pad-inline-start)
|
|
248
|
+
&:first-child:not(.has-striped-rows):not(.sticky-cell-pad-inline-start):not(.header-cell-group):not(
|
|
249
|
+
.header-cell-grouped
|
|
250
|
+
) {
|
|
215
251
|
@include cell-offset(awsui.$space-xxxs);
|
|
216
252
|
}
|
|
217
253
|
|
|
@@ -220,11 +256,12 @@ settings icon in the pagination slot.
|
|
|
220
256
|
shaded background makes the child content appear too close
|
|
221
257
|
to the table edge.
|
|
222
258
|
*/
|
|
223
|
-
&:first-child.has-striped-rows:not(.sticky-cell-pad-inline-start) {
|
|
259
|
+
&:first-child.has-striped-rows:not(.sticky-cell-pad-inline-start):not(.header-cell-group):not(.header-cell-grouped) {
|
|
224
260
|
@include cell-offset(awsui.$space-xxs);
|
|
225
261
|
}
|
|
226
262
|
|
|
227
|
-
&:last-child.header-cell-sortable:not(.header-cell-resizable)
|
|
263
|
+
&:last-child.header-cell-sortable:not(.header-cell-resizable),
|
|
264
|
+
&[data-rightmost].header-cell-sortable:not(.header-cell-resizable) {
|
|
228
265
|
padding-inline-end: awsui.$space-xxxs;
|
|
229
266
|
}
|
|
230
267
|
|
|
@@ -34,7 +34,7 @@ $block-gap: calc(2 * #{awsui.$space-xs} + #{awsui.$space-xxxs});
|
|
|
34
34
|
block-size: 100%;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
th:not(
|
|
37
|
+
th:not([data-rightmost]) > .divider,
|
|
38
38
|
.divider-interactive {
|
|
39
39
|
position: absolute;
|
|
40
40
|
outline: none;
|
|
@@ -46,25 +46,41 @@ th:not(:last-child) > .divider,
|
|
|
46
46
|
max-block-size: calc(100% - #{$block-gap});
|
|
47
47
|
margin-block: auto;
|
|
48
48
|
margin-inline: auto;
|
|
49
|
-
border-inline-start: awsui.$border-
|
|
49
|
+
border-inline-start: awsui.$border-divider-list-width solid awsui.$color-border-divider-interactive-default;
|
|
50
50
|
box-sizing: border-box;
|
|
51
|
-
}
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
// Position variants for grouped column headers.
|
|
53
|
+
// All Column dividers maintain the same bottom gap ($block-gap / 2) as the default.
|
|
54
|
+
&.divider-position-top {
|
|
55
|
+
// Leaf column under a group: extends upward, same bottom gap as default.
|
|
56
|
+
margin-block-start: 0;
|
|
57
|
+
margin-block-end: auto;
|
|
58
|
+
max-block-size: calc(100% - #{$block-gap} / 2);
|
|
59
|
+
}
|
|
60
|
+
&.divider-position-bottom {
|
|
61
|
+
// Group header: extends downward to meet the horizontal border below.
|
|
62
|
+
margin-block-start: auto;
|
|
63
|
+
margin-block-end: 0;
|
|
64
|
+
max-block-size: calc(100% - #{$block-gap} / 2);
|
|
65
|
+
}
|
|
66
|
+
&.divider-position-full {
|
|
67
|
+
margin-block: 0;
|
|
68
|
+
max-block-size: 100%;
|
|
69
|
+
}
|
|
55
70
|
}
|
|
56
71
|
|
|
57
72
|
.divider-interactive {
|
|
58
73
|
inset-inline-end: calc(#{$handle-width} / 2);
|
|
59
74
|
}
|
|
60
75
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
inset-inline-end: 0;
|
|
76
|
+
.divider-active {
|
|
77
|
+
/* used in test-utils */
|
|
64
78
|
}
|
|
65
79
|
|
|
66
|
-
.
|
|
67
|
-
|
|
80
|
+
.resizer-wrapper.visual-refresh.is-borderless.is-last {
|
|
81
|
+
> .divider-interactive {
|
|
82
|
+
inset-inline-end: 0;
|
|
83
|
+
}
|
|
68
84
|
}
|
|
69
85
|
|
|
70
86
|
.resizer {
|
|
@@ -84,9 +100,6 @@ th:last-child > .resizer-wrapper.visual-refresh.is-borderless .divider-interacti
|
|
|
84
100
|
.resize-active & {
|
|
85
101
|
pointer-events: none;
|
|
86
102
|
}
|
|
87
|
-
&:hover + .divider {
|
|
88
|
-
border-inline-start: $active-separator-width solid awsui.$color-border-divider-active;
|
|
89
|
-
}
|
|
90
103
|
&.has-focus {
|
|
91
104
|
@include focus-visible.when-visible-unfocused {
|
|
92
105
|
@include styles.focus-highlight(calc(#{awsui.$space-table-header-focus-outline-gutter} - 2px));
|
|
@@ -142,6 +142,15 @@ filter search icon.
|
|
|
142
142
|
padding-inline: awsui.$space-scaled-l;
|
|
143
143
|
border-inline-start: awsui.$border-width-item-selected solid transparent;
|
|
144
144
|
}
|
|
145
|
+
|
|
146
|
+
// When the selection cell spans multiple header rows, use flex to push the
|
|
147
|
+
// checkbox to the bottom of the cell, matching bottom-aligned column headers.
|
|
148
|
+
&-content-spans-rows {
|
|
149
|
+
display: flex;
|
|
150
|
+
flex-direction: column;
|
|
151
|
+
justify-content: flex-end;
|
|
152
|
+
block-size: 100%;
|
|
153
|
+
}
|
|
145
154
|
}
|
|
146
155
|
|
|
147
156
|
.header-secondary {
|
package/lib/internal/template/collection-preferences/content-display/content-display-option.js
CHANGED
|
@@ -9,7 +9,7 @@ export const getClassName = (suffix) => styles[[componentPrefix, suffix].filter(
|
|
|
9
9
|
const ContentDisplayOption = forwardRef(({ onToggle, option }, ref) => {
|
|
10
10
|
const idPrefix = useUniqueId(componentPrefix);
|
|
11
11
|
const controlId = `${idPrefix}-control-${option.id}`;
|
|
12
|
-
return (React.createElement("div", { ref: ref, className: getClassName('content') },
|
|
12
|
+
return (React.createElement("div", { ref: ref, className: getClassName('content'), "data-item-type": "column" },
|
|
13
13
|
React.createElement("label", { className: getClassName('label'), htmlFor: controlId }, option.label),
|
|
14
14
|
React.createElement("div", { className: getClassName('toggle') },
|
|
15
15
|
React.createElement(InternalToggle, { checked: !!option.visible, onChange: () => onToggle && onToggle(option), disabled: option.alwaysVisible === true, controlId: controlId }))));
|
package/lib/internal/template/collection-preferences/content-display/content-display-option.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-display-option.js","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/content-display-option.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAGnD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,eAAe,GAAG,wBAAwB,CAAC;AACjD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAe,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAO7G,MAAM,oBAAoB,GAAG,UAAU,CACrC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAA6B,EAAE,GAAiC,EAAE,EAAE;IACrF,MAAM,QAAQ,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,GAAG,QAAQ,YAAY,MAAM,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"content-display-option.js","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/content-display-option.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAgB,UAAU,EAAE,MAAM,OAAO,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE5E,OAAO,cAAc,MAAM,uBAAuB,CAAC;AAGnD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AAEtC,MAAM,eAAe,GAAG,wBAAwB,CAAC;AACjD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,MAAe,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAO7G,MAAM,oBAAoB,GAAG,UAAU,CACrC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAA6B,EAAE,GAAiC,EAAE,EAAE;IACrF,MAAM,QAAQ,GAAG,WAAW,CAAC,eAAe,CAAC,CAAC;IAC9C,MAAM,SAAS,GAAG,GAAG,QAAQ,YAAY,MAAM,CAAC,EAAE,EAAE,CAAC;IACrD,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,oBAAiB,QAAQ;QACxE,+BAAO,SAAS,EAAE,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,SAAS,IACxD,MAAM,CAAC,KAAK,CACP;QACR,6BAAK,SAAS,EAAE,YAAY,CAAC,QAAQ,CAAC;YACpC,oBAAC,cAAc,IACb,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,EACzB,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,CAAC,EAC5C,QAAQ,EAAE,MAAM,CAAC,aAAa,KAAK,IAAI,EACvC,SAAS,EAAE,SAAS,GACpB,CACE,CACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { ForwardedRef, forwardRef } from 'react';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalToggle from '../../toggle/internal';\nimport { OptionWithVisibility } from './utils';\n\nimport styles from '../styles.css.js';\n\nconst componentPrefix = 'content-display-option';\nexport const getClassName = (suffix?: string) => styles[[componentPrefix, suffix].filter(Boolean).join('-')];\n\ninterface ContentDisplayOptionProps {\n onToggle?: (option: OptionWithVisibility) => void;\n option: OptionWithVisibility;\n}\n\nconst ContentDisplayOption = forwardRef(\n ({ onToggle, option }: ContentDisplayOptionProps, ref: ForwardedRef<HTMLDivElement>) => {\n const idPrefix = useUniqueId(componentPrefix);\n const controlId = `${idPrefix}-control-${option.id}`;\n return (\n <div ref={ref} className={getClassName('content')} data-item-type=\"column\">\n <label className={getClassName('label')} htmlFor={controlId}>\n {option.label}\n </label>\n <div className={getClassName('toggle')}>\n <InternalToggle\n checked={!!option.visible}\n onChange={() => onToggle && onToggle(option)}\n disabled={option.alwaysVisible === true}\n controlId={controlId}\n />\n </div>\n </div>\n );\n }\n);\n\nexport default ContentDisplayOption;\n"]}
|
|
@@ -3,6 +3,6 @@ interface ContentDisplayPreferenceProps extends CollectionPreferencesProps.Conte
|
|
|
3
3
|
onChange: (value: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>) => void;
|
|
4
4
|
value?: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>;
|
|
5
5
|
}
|
|
6
|
-
export default function ContentDisplayPreference({ title, description, options, value,
|
|
6
|
+
export default function ContentDisplayPreference({ title, description, options, value, groups, onChange, enableColumnFiltering, i18nStrings, ...dndProps }: ContentDisplayPreferenceProps): JSX.Element;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/index.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAkB3D,UAAU,6BAA8B,SAAQ,0BAA0B,CAAC,wBAAwB;IACjG,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,CAAC,0BAA0B,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACxF,KAAK,CAAC,EAAE,aAAa,CAAC,0BAA0B,CAAC,kBAAkB,CAAC,CAAC;CACtE;AAqJD,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,KAAK,EACL,WAAW,EACX,OAAO,EACP,KAGG,EACH,MAAM,EACN,QAAQ,EACR,qBAA6B,EAC7B,WAAW,EACX,GAAG,QAAQ,EACZ,EAAE,6BAA6B,eAgJ/B"}
|
|
@@ -11,53 +11,89 @@ import InternalSpaceBetween from '../../space-between/internal';
|
|
|
11
11
|
import InternalTextFilter from '../../text-filter/internal';
|
|
12
12
|
import { getAnalyticsInnerContextAttribute } from '../analytics-metadata/utils';
|
|
13
13
|
import ContentDisplayOption from './content-display-option';
|
|
14
|
-
import { getFilteredOptions, getSortedOptions } from './utils';
|
|
14
|
+
import { buildOptionTree, getFilteredOptions, getFilteredTree, getSortedOptions, toContentDisplayItems, } from './utils';
|
|
15
15
|
import styles from '../styles.css.js';
|
|
16
16
|
const componentPrefix = 'content-display';
|
|
17
17
|
const getClassName = (suffix) => styles[`${componentPrefix}-${suffix}`];
|
|
18
|
+
function getDndI18nStrings(i18n, props) {
|
|
19
|
+
return {
|
|
20
|
+
liveAnnouncementDndStarted: i18n('contentDisplayPreference.liveAnnouncementDndStarted', props.liveAnnouncementDndStarted, formatDndStarted),
|
|
21
|
+
liveAnnouncementDndItemReordered: i18n('contentDisplayPreference.liveAnnouncementDndItemReordered', props.liveAnnouncementDndItemReordered, formatDndItemReordered),
|
|
22
|
+
liveAnnouncementDndItemCommitted: i18n('contentDisplayPreference.liveAnnouncementDndItemCommitted', props.liveAnnouncementDndItemCommitted, formatDndItemCommitted),
|
|
23
|
+
liveAnnouncementDndDiscarded: i18n('contentDisplayPreference.liveAnnouncementDndDiscarded', props.liveAnnouncementDndDiscarded),
|
|
24
|
+
dragHandleAriaLabel: i18n('contentDisplayPreference.dragHandleAriaLabel', props.dragHandleAriaLabel),
|
|
25
|
+
dragHandleAriaDescription: i18n('contentDisplayPreference.dragHandleAriaDescription', props.dragHandleAriaDescription),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function GroupItem({ node, onToggle, onChildrenChange, i18nStrings, sortDisabled, groupLabelFormatter, }) {
|
|
29
|
+
return (React.createElement("div", { "data-item-type": "group" },
|
|
30
|
+
React.createElement(InternalSpaceBetween, { size: "xxs" },
|
|
31
|
+
React.createElement("div", { className: styles['content-display-group-header'] },
|
|
32
|
+
React.createElement(InternalBox, { fontWeight: "bold", display: "inline" }, node.label)),
|
|
33
|
+
node.children.length > 0 && (React.createElement("div", { className: styles['content-display-group-children'] },
|
|
34
|
+
React.createElement(HierarchicalContentDisplay, { tree: node.children, onToggle: onToggle, onTreeChange: onChildrenChange, i18nStrings: i18nStrings, sortDisabled: sortDisabled, ariaLabel: node.label, parentGroupLabel: node.label, groupLabelFormatter: groupLabelFormatter }))))));
|
|
35
|
+
}
|
|
36
|
+
function HierarchicalContentDisplay({ tree, onToggle, onTreeChange, ariaLabel, ariaLabelledby, ariaDescribedby, i18nStrings, sortDisabled, parentGroupLabel, groupLabelFormatter, }) {
|
|
37
|
+
return (React.createElement(InternalList, { items: tree, sortDisabled: sortDisabled, sortable: true, disableItemPaddings: true, ariaLabel: ariaLabel, ariaLabelledby: ariaLabelledby, ariaDescribedby: ariaDescribedby, i18nStrings: i18nStrings, onSortingChange: ({ detail: { items } }) => onTreeChange([...items]), renderItem: node => ({
|
|
38
|
+
id: node.id,
|
|
39
|
+
announcementLabel: node.type === 'group'
|
|
40
|
+
? groupLabelFormatter(node.label, node.children.length)
|
|
41
|
+
: parentGroupLabel
|
|
42
|
+
? `${node.label}, ${parentGroupLabel}`
|
|
43
|
+
: node.label,
|
|
44
|
+
content: node.type === 'group' ? (React.createElement(GroupItem, { node: node, onToggle: onToggle, onChildrenChange: newChildren => onTreeChange(tree.map(n => (n.id === node.id && n.type === 'group' ? { ...n, children: newChildren } : n))), i18nStrings: i18nStrings, sortDisabled: sortDisabled, groupLabelFormatter: groupLabelFormatter })) : (React.createElement(ContentDisplayOption, { option: node, onToggle: () => onToggle(node.id) })),
|
|
45
|
+
}) }));
|
|
46
|
+
}
|
|
18
47
|
export default function ContentDisplayPreference({ title, description, options, value = options.map(({ id }) => ({
|
|
19
48
|
id,
|
|
20
49
|
visible: true,
|
|
21
|
-
})),
|
|
50
|
+
})), groups, onChange, enableColumnFiltering = false, i18nStrings, ...dndProps }) {
|
|
51
|
+
var _a;
|
|
22
52
|
const idPrefix = useUniqueId(componentPrefix);
|
|
23
53
|
const i18n = useInternalI18n('collection-preferences');
|
|
24
54
|
const [columnFilteringText, setColumnFilteringText] = useState('');
|
|
25
55
|
const titleId = `${idPrefix}-title`;
|
|
26
56
|
const descriptionId = `${idPrefix}-description`;
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return
|
|
31
|
-
}
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
57
|
+
const listI18nStrings = getDndI18nStrings(i18n, dndProps);
|
|
58
|
+
const groupLabelFormatter = (label, count) => {
|
|
59
|
+
var _a, _b;
|
|
60
|
+
return i18n('contentDisplayPreference.liveAnnouncementDndGroupLabel', (_b = (_a = dndProps.liveAnnouncementDndGroupLabel) === null || _a === void 0 ? void 0 : _a.call(dndProps, label, count)) !== null && _b !== void 0 ? _b : `${label}, ${count} ${count === 1 ? 'item' : 'items'}`, format => format({ label, count }));
|
|
61
|
+
};
|
|
62
|
+
const hasGroups = !!groups && groups.length > 0;
|
|
63
|
+
const isFiltering = columnFilteringText.trim().length > 0;
|
|
64
|
+
const sortedOptions = useMemo(() => getSortedOptions({ options, contentDisplay: value }), [options, value]);
|
|
65
|
+
const filteredOptions = useMemo(() => getFilteredOptions(sortedOptions, columnFilteringText), [sortedOptions, columnFilteringText]);
|
|
66
|
+
const optionTree = useMemo(() => (hasGroups ? buildOptionTree(options, groups, value) : null), [hasGroups, groups, options, value]);
|
|
67
|
+
const filteredTree = useMemo(() => (optionTree ? getFilteredTree(optionTree, columnFilteringText) : null), [optionTree, columnFilteringText]);
|
|
68
|
+
const handleToggle = (id) => {
|
|
69
|
+
// For flat (non-grouped) mode, rebuild from sortedOptions to handle items not in value
|
|
70
|
+
if (!hasGroups) {
|
|
71
|
+
onChange(sortedOptions.map(opt => ({ id: opt.id, visible: opt.id === id ? !opt.visible : opt.visible })));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
// For grouped mode, walk the tree and flip the matching item
|
|
75
|
+
const toggle = (items) => items.map(item => {
|
|
76
|
+
if (item.type === 'group') {
|
|
77
|
+
return { ...item, children: toggle(item.children) };
|
|
78
|
+
}
|
|
79
|
+
return item.id === id ? { ...item, visible: !item.visible } : item;
|
|
80
|
+
});
|
|
81
|
+
onChange(toggle(value));
|
|
36
82
|
};
|
|
83
|
+
const noResults = filteredTree ? filteredTree.length === 0 : filteredOptions.length === 0;
|
|
37
84
|
return (React.createElement("div", { role: "group", "aria-labelledby": titleId, "aria-describedby": descriptionId, className: styles[componentPrefix], ...getAnalyticsInnerContextAttribute('contentDisplay') },
|
|
38
85
|
React.createElement("h3", { className: getClassName('title'), id: titleId }, i18n('contentDisplayPreference.title', title)),
|
|
39
86
|
React.createElement("p", { className: getClassName('description'), id: descriptionId }, i18n('contentDisplayPreference.description', description)),
|
|
40
87
|
enableColumnFiltering && (React.createElement("div", { className: getClassName('text-filter') },
|
|
41
|
-
React.createElement(InternalTextFilter, { filteringText: columnFilteringText, filteringPlaceholder: i18n('contentDisplayPreference.i18nStrings.columnFilteringPlaceholder', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnFilteringPlaceholder), filteringAriaLabel: i18n('contentDisplayPreference.i18nStrings.columnFilteringAriaLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnFilteringAriaLabel), filteringClearAriaLabel: i18n('contentDisplayPreference.i18nStrings.columnFilteringClearFilterText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnFilteringClearFilterText), onChange: ({ detail }) => setColumnFilteringText(detail.filteringText), countText: i18n('contentDisplayPreference.i18nStrings.columnFilteringCountText', (i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnFilteringCountText)
|
|
42
|
-
|
|
43
|
-
: undefined, format => format({ count: sortedAndFilteredOptions.length })) }))),
|
|
44
|
-
sortedAndFilteredOptions.length === 0 && (React.createElement("div", { className: getClassName('no-match') },
|
|
88
|
+
React.createElement(InternalTextFilter, { filteringText: columnFilteringText, filteringPlaceholder: i18n('contentDisplayPreference.i18nStrings.columnFilteringPlaceholder', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnFilteringPlaceholder), filteringAriaLabel: i18n('contentDisplayPreference.i18nStrings.columnFilteringAriaLabel', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnFilteringAriaLabel), filteringClearAriaLabel: i18n('contentDisplayPreference.i18nStrings.columnFilteringClearFilterText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnFilteringClearFilterText), onChange: ({ detail }) => setColumnFilteringText(detail.filteringText), countText: i18n('contentDisplayPreference.i18nStrings.columnFilteringCountText', (_a = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnFilteringCountText) === null || _a === void 0 ? void 0 : _a.call(i18nStrings, filteredOptions.length), format => format({ count: filteredOptions.length })) }))),
|
|
89
|
+
noResults && (React.createElement("div", { className: getClassName('no-match') },
|
|
45
90
|
React.createElement(InternalSpaceBetween, { size: "s", alignItems: "center" },
|
|
46
91
|
React.createElement(InternalBox, { margin: { top: 'm' } }, i18n('contentDisplayPreference.i18nStrings.columnFilteringNoMatchText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnFilteringNoMatchText)),
|
|
47
92
|
React.createElement(InternalButton, { onClick: () => setColumnFilteringText('') }, i18n('contentDisplayPreference.i18nStrings.columnFilteringClearFilterText', i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.columnFilteringClearFilterText))))),
|
|
48
|
-
React.createElement(InternalList, { items:
|
|
93
|
+
React.createElement("div", { role: "application", "aria-labelledby": titleId }, optionTree && filteredTree ? (React.createElement(HierarchicalContentDisplay, { tree: isFiltering ? filteredTree : optionTree, onToggle: handleToggle, onTreeChange: newTree => onChange(toContentDisplayItems(newTree)), ariaLabelledby: titleId, ariaDescribedby: descriptionId, i18nStrings: listI18nStrings, sortDisabled: isFiltering, groupLabelFormatter: groupLabelFormatter })) : (React.createElement(InternalList, { items: filteredOptions, sortable: true, sortDisabled: isFiltering, disableItemPaddings: true, ariaLabelledby: titleId, ariaDescribedby: descriptionId, i18nStrings: listI18nStrings, onSortingChange: ({ detail: { items } }) => onChange(items.map(({ id, visible }) => ({ id, visible }))), renderItem: item => ({
|
|
49
94
|
id: item.id,
|
|
50
|
-
content: React.createElement(ContentDisplayOption, { option: item, onToggle: onToggle }),
|
|
51
95
|
announcementLabel: item.label,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}, ariaDescribedby: descriptionId, ariaLabelledby: titleId, i18nStrings: {
|
|
55
|
-
liveAnnouncementDndStarted: i18n('contentDisplayPreference.liveAnnouncementDndStarted', liveAnnouncementDndStarted, formatDndStarted),
|
|
56
|
-
liveAnnouncementDndItemReordered: i18n('contentDisplayPreference.liveAnnouncementDndItemReordered', liveAnnouncementDndItemReordered, formatDndItemReordered),
|
|
57
|
-
liveAnnouncementDndItemCommitted: i18n('contentDisplayPreference.liveAnnouncementDndItemCommitted', liveAnnouncementDndItemCommitted, formatDndItemCommitted),
|
|
58
|
-
liveAnnouncementDndDiscarded: i18n('contentDisplayPreference.liveAnnouncementDndDiscarded', liveAnnouncementDndDiscarded),
|
|
59
|
-
dragHandleAriaLabel: i18n('contentDisplayPreference.dragHandleAriaLabel', dragHandleAriaLabel),
|
|
60
|
-
dragHandleAriaDescription: i18n('contentDisplayPreference.dragHandleAriaDescription', dragHandleAriaDescription),
|
|
61
|
-
} })));
|
|
96
|
+
content: React.createElement(ContentDisplayOption, { option: item, onToggle: () => handleToggle(item.id) }),
|
|
97
|
+
}) })))));
|
|
62
98
|
}
|
|
63
99
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC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B,oDAAoD,EACpD,yBAAyB,CAC1B;aACF,GACD,CACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo, useState } from 'react';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalBox from '../../box/internal';\nimport InternalButton from '../../button/internal';\nimport { useInternalI18n } from '../../i18n/context';\nimport {\n formatDndItemCommitted,\n formatDndItemReordered,\n formatDndStarted,\n} from '../../internal/components/sortable-area/use-live-announcements';\nimport InternalList from '../../list/internal';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport InternalTextFilter from '../../text-filter/internal';\nimport { getAnalyticsInnerContextAttribute } from '../analytics-metadata/utils';\nimport { CollectionPreferencesProps } from '../interfaces';\nimport ContentDisplayOption from './content-display-option';\nimport { getFilteredOptions, getSortedOptions, OptionWithVisibility } from './utils';\n\nimport styles from '../styles.css.js';\n\nconst componentPrefix = 'content-display';\n\nconst getClassName = (suffix: string) => styles[`${componentPrefix}-${suffix}`];\n\ninterface ContentDisplayPreferenceProps extends CollectionPreferencesProps.ContentDisplayPreference {\n onChange: (value: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>) => void;\n value?: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>;\n}\n\nexport default function ContentDisplayPreference({\n title,\n description,\n options,\n value = options.map(({ id }) => ({\n id,\n visible: true,\n })),\n onChange,\n liveAnnouncementDndStarted,\n liveAnnouncementDndItemReordered,\n liveAnnouncementDndItemCommitted,\n liveAnnouncementDndDiscarded,\n dragHandleAriaDescription,\n dragHandleAriaLabel,\n enableColumnFiltering = false,\n i18nStrings,\n}: ContentDisplayPreferenceProps) {\n const idPrefix = useUniqueId(componentPrefix);\n const i18n = useInternalI18n('collection-preferences');\n const [columnFilteringText, setColumnFilteringText] = useState('');\n\n const titleId = `${idPrefix}-title`;\n const descriptionId = `${idPrefix}-description`;\n\n const [sortedOptions, sortedAndFilteredOptions] = useMemo(() => {\n const sorted = getSortedOptions({ options, contentDisplay: value });\n const filtered = getFilteredOptions(sorted, columnFilteringText);\n return [sorted, filtered];\n }, [columnFilteringText, options, value]);\n\n const onToggle = (option: OptionWithVisibility) => {\n // We use sortedOptions as base and not value because there might be options that\n // are not in the value yet, so they're added as non-visible after the known ones.\n onChange(sortedOptions.map(({ id, visible }) => ({ id, visible: id === option.id ? !option.visible : visible })));\n };\n\n return (\n <div\n role=\"group\"\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n className={styles[componentPrefix]}\n {...getAnalyticsInnerContextAttribute('contentDisplay')}\n >\n <h3 className={getClassName('title')} id={titleId}>\n {i18n('contentDisplayPreference.title', title)}\n </h3>\n <p className={getClassName('description')} id={descriptionId}>\n {i18n('contentDisplayPreference.description', description)}\n </p>\n\n {/* Filter input */}\n {enableColumnFiltering && (\n <div className={getClassName('text-filter')}>\n <InternalTextFilter\n filteringText={columnFilteringText}\n filteringPlaceholder={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringPlaceholder',\n i18nStrings?.columnFilteringPlaceholder\n )}\n filteringAriaLabel={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringAriaLabel',\n i18nStrings?.columnFilteringAriaLabel\n )}\n filteringClearAriaLabel={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringClearFilterText',\n i18nStrings?.columnFilteringClearFilterText\n )}\n onChange={({ detail }) => setColumnFilteringText(detail.filteringText)}\n countText={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringCountText',\n i18nStrings?.columnFilteringCountText\n ? i18nStrings?.columnFilteringCountText(sortedAndFilteredOptions.length)\n : undefined,\n format => format({ count: sortedAndFilteredOptions.length })\n )}\n />\n </div>\n )}\n\n {/* No match */}\n {sortedAndFilteredOptions.length === 0 && (\n <div className={getClassName('no-match')}>\n <InternalSpaceBetween size=\"s\" alignItems=\"center\">\n <InternalBox margin={{ top: 'm' }}>\n {i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringNoMatchText',\n i18nStrings?.columnFilteringNoMatchText\n )}\n </InternalBox>\n <InternalButton onClick={() => setColumnFilteringText('')}>\n {i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringClearFilterText',\n i18nStrings?.columnFilteringClearFilterText\n )}\n </InternalButton>\n </InternalSpaceBetween>\n </div>\n )}\n\n <InternalList\n items={sortedAndFilteredOptions}\n renderItem={item => ({\n id: item.id,\n content: <ContentDisplayOption option={item} onToggle={onToggle} />,\n announcementLabel: item.label,\n })}\n disableItemPaddings={true}\n sortable={true}\n sortDisabled={columnFilteringText.trim().length > 0}\n onSortingChange={({ detail: { items } }) => {\n onChange(items);\n }}\n ariaDescribedby={descriptionId}\n ariaLabelledby={titleId}\n i18nStrings={{\n liveAnnouncementDndStarted: i18n(\n 'contentDisplayPreference.liveAnnouncementDndStarted',\n liveAnnouncementDndStarted,\n formatDndStarted\n ),\n liveAnnouncementDndItemReordered: i18n(\n 'contentDisplayPreference.liveAnnouncementDndItemReordered',\n liveAnnouncementDndItemReordered,\n formatDndItemReordered\n ),\n liveAnnouncementDndItemCommitted: i18n(\n 'contentDisplayPreference.liveAnnouncementDndItemCommitted',\n liveAnnouncementDndItemCommitted,\n formatDndItemCommitted\n ),\n liveAnnouncementDndDiscarded: i18n(\n 'contentDisplayPreference.liveAnnouncementDndDiscarded',\n liveAnnouncementDndDiscarded\n ),\n dragHandleAriaLabel: i18n('contentDisplayPreference.dragHandleAriaLabel', dragHandleAriaLabel),\n dragHandleAriaDescription: i18n(\n 'contentDisplayPreference.dragHandleAriaDescription',\n dragHandleAriaDescription\n ),\n }}\n />\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AA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,cAAc,EAAE,OAAO,EACvB,eAAe,EAAE,aAAa,EAC9B,WAAW,EAAE,eAAe,EAC5B,YAAY,EAAE,WAAW,EACzB,mBAAmB,EAAE,mBAAmB,GACxC,CACH,CAAC,CAAC,CAAC,CACF,oBAAC,YAAY,IACX,KAAK,EAAE,eAAe,EACtB,QAAQ,EAAE,IAAI,EACd,YAAY,EAAE,WAAW,EACzB,mBAAmB,EAAE,IAAI,EACzB,cAAc,EAAE,OAAO,EACvB,eAAe,EAAE,aAAa,EAC9B,WAAW,EAAE,eAAe,EAC5B,eAAe,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EACvG,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;gBACnB,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,iBAAiB,EAAE,IAAI,CAAC,KAAK;gBAC7B,OAAO,EAAE,oBAAC,oBAAoB,IAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,GAAI;aACvF,CAAC,GACF,CACH,CACG,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo, useState } from 'react';\n\nimport { useUniqueId } from '@cloudscape-design/component-toolkit/internal';\n\nimport InternalBox from '../../box/internal';\nimport InternalButton from '../../button/internal';\nimport { useInternalI18n } from '../../i18n/context';\nimport { SortableAreaProps } from '../../internal/components/sortable-area/interfaces';\nimport {\n formatDndItemCommitted,\n formatDndItemReordered,\n formatDndStarted,\n} from '../../internal/components/sortable-area/use-live-announcements';\nimport InternalList from '../../list/internal';\nimport InternalSpaceBetween from '../../space-between/internal';\nimport InternalTextFilter from '../../text-filter/internal';\nimport { getAnalyticsInnerContextAttribute } from '../analytics-metadata/utils';\nimport { CollectionPreferencesProps } from '../interfaces';\nimport ContentDisplayOption from './content-display-option';\nimport {\n buildOptionTree,\n getFilteredOptions,\n getFilteredTree,\n getSortedOptions,\n OptionGroupNode,\n OptionTreeNode,\n toContentDisplayItems,\n} from './utils';\n\nimport styles from '../styles.css.js';\n\nconst componentPrefix = 'content-display';\n\nconst getClassName = (suffix: string) => styles[`${componentPrefix}-${suffix}`];\n\ninterface ContentDisplayPreferenceProps extends CollectionPreferencesProps.ContentDisplayPreference {\n onChange: (value: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>) => void;\n value?: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>;\n}\nfunction getDndI18nStrings(\n i18n: ReturnType<typeof useInternalI18n<'collection-preferences'>>,\n props: Pick<\n ContentDisplayPreferenceProps,\n | 'liveAnnouncementDndStarted'\n | 'liveAnnouncementDndItemReordered'\n | 'liveAnnouncementDndItemCommitted'\n | 'liveAnnouncementDndDiscarded'\n | 'dragHandleAriaLabel'\n | 'dragHandleAriaDescription'\n >\n) {\n return {\n liveAnnouncementDndStarted: i18n(\n 'contentDisplayPreference.liveAnnouncementDndStarted',\n props.liveAnnouncementDndStarted,\n formatDndStarted\n ),\n liveAnnouncementDndItemReordered: i18n(\n 'contentDisplayPreference.liveAnnouncementDndItemReordered',\n props.liveAnnouncementDndItemReordered,\n formatDndItemReordered\n ),\n liveAnnouncementDndItemCommitted: i18n(\n 'contentDisplayPreference.liveAnnouncementDndItemCommitted',\n props.liveAnnouncementDndItemCommitted,\n formatDndItemCommitted\n ),\n liveAnnouncementDndDiscarded: i18n(\n 'contentDisplayPreference.liveAnnouncementDndDiscarded',\n props.liveAnnouncementDndDiscarded\n ),\n dragHandleAriaLabel: i18n('contentDisplayPreference.dragHandleAriaLabel', props.dragHandleAriaLabel),\n dragHandleAriaDescription: i18n(\n 'contentDisplayPreference.dragHandleAriaDescription',\n props.dragHandleAriaDescription\n ),\n };\n}\n\ninterface HierarchicalContentDisplayProps {\n tree: OptionTreeNode[];\n onToggle: (id: string) => void;\n onTreeChange: (newTree: OptionTreeNode[]) => void;\n ariaLabel?: string;\n ariaLabelledby?: string;\n ariaDescribedby?: string;\n i18nStrings: SortableAreaProps.DndAreaI18nStrings;\n sortDisabled: boolean;\n parentGroupLabel?: string;\n groupLabelFormatter: (label: string, count: number) => string;\n}\n\nfunction GroupItem({\n node,\n onToggle,\n onChildrenChange,\n i18nStrings,\n sortDisabled,\n groupLabelFormatter,\n}: {\n node: OptionGroupNode;\n onToggle: (id: string) => void;\n onChildrenChange: (children: OptionTreeNode[]) => void;\n i18nStrings: SortableAreaProps.DndAreaI18nStrings;\n sortDisabled: boolean;\n groupLabelFormatter: (label: string, count: number) => string;\n}) {\n return (\n <div data-item-type=\"group\">\n <InternalSpaceBetween size=\"xxs\">\n <div className={styles['content-display-group-header']}>\n <InternalBox fontWeight=\"bold\" display=\"inline\">\n {node.label}\n </InternalBox>\n </div>\n {node.children.length > 0 && (\n <div className={styles['content-display-group-children']}>\n <HierarchicalContentDisplay\n tree={node.children}\n onToggle={onToggle}\n onTreeChange={onChildrenChange}\n i18nStrings={i18nStrings}\n sortDisabled={sortDisabled}\n ariaLabel={node.label}\n parentGroupLabel={node.label}\n groupLabelFormatter={groupLabelFormatter}\n />\n </div>\n )}\n </InternalSpaceBetween>\n </div>\n );\n}\n\nfunction HierarchicalContentDisplay({\n tree,\n onToggle,\n onTreeChange,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n i18nStrings,\n sortDisabled,\n parentGroupLabel,\n groupLabelFormatter,\n}: HierarchicalContentDisplayProps) {\n return (\n <InternalList\n items={tree}\n sortDisabled={sortDisabled}\n sortable={true}\n disableItemPaddings={true}\n ariaLabel={ariaLabel}\n ariaLabelledby={ariaLabelledby}\n ariaDescribedby={ariaDescribedby}\n i18nStrings={i18nStrings}\n onSortingChange={({ detail: { items } }) => onTreeChange([...items])}\n renderItem={node => ({\n id: node.id,\n announcementLabel:\n node.type === 'group'\n ? groupLabelFormatter(node.label, node.children.length)\n : parentGroupLabel\n ? `${node.label}, ${parentGroupLabel}`\n : node.label,\n content:\n node.type === 'group' ? (\n <GroupItem\n node={node}\n onToggle={onToggle}\n onChildrenChange={newChildren =>\n onTreeChange(\n tree.map(n => (n.id === node.id && n.type === 'group' ? { ...n, children: newChildren } : n))\n )\n }\n i18nStrings={i18nStrings}\n sortDisabled={sortDisabled}\n groupLabelFormatter={groupLabelFormatter}\n />\n ) : (\n <ContentDisplayOption option={node} onToggle={() => onToggle(node.id)} />\n ),\n })}\n />\n );\n}\n\nexport default function ContentDisplayPreference({\n title,\n description,\n options,\n value = options.map(({ id }) => ({\n id,\n visible: true,\n })),\n groups,\n onChange,\n enableColumnFiltering = false,\n i18nStrings,\n ...dndProps\n}: ContentDisplayPreferenceProps) {\n const idPrefix = useUniqueId(componentPrefix);\n const i18n = useInternalI18n('collection-preferences');\n const [columnFilteringText, setColumnFilteringText] = useState('');\n\n const titleId = `${idPrefix}-title`;\n const descriptionId = `${idPrefix}-description`;\n\n const listI18nStrings = getDndI18nStrings(i18n, dndProps);\n const groupLabelFormatter = (label: string, count: number) =>\n i18n(\n 'contentDisplayPreference.liveAnnouncementDndGroupLabel',\n dndProps.liveAnnouncementDndGroupLabel?.(label, count) ?? `${label}, ${count} ${count === 1 ? 'item' : 'items'}`,\n format => format({ label, count })\n );\n const hasGroups = !!groups && groups.length > 0;\n const isFiltering = columnFilteringText.trim().length > 0;\n\n const sortedOptions = useMemo(() => getSortedOptions({ options, contentDisplay: value }), [options, value]);\n const filteredOptions = useMemo(\n () => getFilteredOptions(sortedOptions, columnFilteringText),\n [sortedOptions, columnFilteringText]\n );\n const optionTree = useMemo(\n () => (hasGroups ? buildOptionTree(options, groups, value) : null),\n [hasGroups, groups, options, value]\n );\n const filteredTree = useMemo(\n () => (optionTree ? getFilteredTree(optionTree, columnFilteringText) : null),\n [optionTree, columnFilteringText]\n );\n\n const handleToggle = (id: string) => {\n // For flat (non-grouped) mode, rebuild from sortedOptions to handle items not in value\n if (!hasGroups) {\n onChange(sortedOptions.map(opt => ({ id: opt.id, visible: opt.id === id ? !opt.visible : opt.visible })));\n return;\n }\n // For grouped mode, walk the tree and flip the matching item\n const toggle = (\n items: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>\n ): CollectionPreferencesProps.ContentDisplayItem[] =>\n items.map(item => {\n if (item.type === 'group') {\n return { ...item, children: toggle(item.children) };\n }\n return item.id === id ? { ...item, visible: !item.visible } : item;\n });\n onChange(toggle(value));\n };\n const noResults = filteredTree ? filteredTree.length === 0 : filteredOptions.length === 0;\n return (\n <div\n role=\"group\"\n aria-labelledby={titleId}\n aria-describedby={descriptionId}\n className={styles[componentPrefix]}\n {...getAnalyticsInnerContextAttribute('contentDisplay')}\n >\n <h3 className={getClassName('title')} id={titleId}>\n {i18n('contentDisplayPreference.title', title)}\n </h3>\n <p className={getClassName('description')} id={descriptionId}>\n {i18n('contentDisplayPreference.description', description)}\n </p>\n\n {/* Filter input */}\n {enableColumnFiltering && (\n <div className={getClassName('text-filter')}>\n <InternalTextFilter\n filteringText={columnFilteringText}\n filteringPlaceholder={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringPlaceholder',\n i18nStrings?.columnFilteringPlaceholder\n )}\n filteringAriaLabel={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringAriaLabel',\n i18nStrings?.columnFilteringAriaLabel\n )}\n filteringClearAriaLabel={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringClearFilterText',\n i18nStrings?.columnFilteringClearFilterText\n )}\n onChange={({ detail }) => setColumnFilteringText(detail.filteringText)}\n countText={i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringCountText',\n i18nStrings?.columnFilteringCountText?.(filteredOptions.length),\n format => format({ count: filteredOptions.length })\n )}\n />\n </div>\n )}\n\n {noResults && (\n <div className={getClassName('no-match')}>\n <InternalSpaceBetween size=\"s\" alignItems=\"center\">\n <InternalBox margin={{ top: 'm' }}>\n {i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringNoMatchText',\n i18nStrings?.columnFilteringNoMatchText\n )}\n </InternalBox>\n <InternalButton onClick={() => setColumnFilteringText('')}>\n {i18n(\n 'contentDisplayPreference.i18nStrings.columnFilteringClearFilterText',\n i18nStrings?.columnFilteringClearFilterText\n )}\n </InternalButton>\n </InternalSpaceBetween>\n </div>\n )}\n\n <div role=\"application\" aria-labelledby={titleId}>\n {optionTree && filteredTree ? (\n <HierarchicalContentDisplay\n tree={isFiltering ? filteredTree : optionTree}\n onToggle={handleToggle}\n onTreeChange={newTree => onChange(toContentDisplayItems(newTree))}\n ariaLabelledby={titleId}\n ariaDescribedby={descriptionId}\n i18nStrings={listI18nStrings}\n sortDisabled={isFiltering}\n groupLabelFormatter={groupLabelFormatter}\n />\n ) : (\n <InternalList\n items={filteredOptions}\n sortable={true}\n sortDisabled={isFiltering}\n disableItemPaddings={true}\n ariaLabelledby={titleId}\n ariaDescribedby={descriptionId}\n i18nStrings={listI18nStrings}\n onSortingChange={({ detail: { items } }) => onChange(items.map(({ id, visible }) => ({ id, visible })))}\n renderItem={item => ({\n id: item.id,\n announcementLabel: item.label,\n content: <ContentDisplayOption option={item} onToggle={() => handleToggle(item.id)} />,\n })}\n />\n )}\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,10 +1,49 @@
|
|
|
1
1
|
import { CollectionPreferencesProps } from '../interfaces';
|
|
2
|
-
|
|
2
|
+
type ContentDisplayItem = CollectionPreferencesProps.ContentDisplayItem;
|
|
3
|
+
type ContentDisplayOption = CollectionPreferencesProps.ContentDisplayOption;
|
|
4
|
+
type ContentDisplayOptionGroup = CollectionPreferencesProps.ContentDisplayOptionGroup;
|
|
5
|
+
export interface OptionWithVisibility extends ContentDisplayOption {
|
|
3
6
|
visible: boolean;
|
|
4
7
|
}
|
|
8
|
+
export interface OptionGroupNode {
|
|
9
|
+
type: 'group';
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
visible: boolean;
|
|
13
|
+
children: OptionTreeNode[];
|
|
14
|
+
}
|
|
15
|
+
export interface OptionLeafNode extends OptionWithVisibility {
|
|
16
|
+
type: 'leaf';
|
|
17
|
+
}
|
|
18
|
+
export type OptionTreeNode = OptionGroupNode | OptionLeafNode;
|
|
19
|
+
/**
|
|
20
|
+
* Extracts a flat ordered list of leaf items from the contentDisplay tree (depth-first).
|
|
21
|
+
*/
|
|
22
|
+
export declare function walkLeaves(items: ReadonlyArray<ContentDisplayItem>): {
|
|
23
|
+
id: string;
|
|
24
|
+
visible: boolean;
|
|
25
|
+
}[];
|
|
26
|
+
/**
|
|
27
|
+
* Returns options ordered by contentDisplay, with visibility applied.
|
|
28
|
+
* Options not in contentDisplay are appended as non-visible.
|
|
29
|
+
*/
|
|
5
30
|
export declare function getSortedOptions({ options, contentDisplay, }: {
|
|
6
31
|
options: ReadonlyArray<CollectionPreferencesProps.ContentDisplayOption>;
|
|
7
32
|
contentDisplay: ReadonlyArray<CollectionPreferencesProps.ContentDisplayItem>;
|
|
8
33
|
}): ReadonlyArray<OptionWithVisibility>;
|
|
34
|
+
/**
|
|
35
|
+
* Converts contentDisplay tree into an internal OptionTreeNode tree,
|
|
36
|
+
* resolving labels from options/groups definitions.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildOptionTree(options: ReadonlyArray<ContentDisplayOption>, groups: ReadonlyArray<ContentDisplayOptionGroup>, contentDisplay: ReadonlyArray<ContentDisplayItem>): OptionTreeNode[];
|
|
39
|
+
/**
|
|
40
|
+
* Converts OptionTreeNode[] back to ContentDisplayItem[].
|
|
41
|
+
*/
|
|
42
|
+
export declare function toContentDisplayItems(tree: OptionTreeNode[]): ContentDisplayItem[];
|
|
43
|
+
/**
|
|
44
|
+
* Filters tree, keeping leaves matching filterText and groups with matching descendants.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getFilteredTree(tree: OptionTreeNode[], filterText: string): OptionTreeNode[];
|
|
9
47
|
export declare function getFilteredOptions(options: ReadonlyArray<OptionWithVisibility>, filterText: string): readonly OptionWithVisibility[];
|
|
48
|
+
export {};
|
|
10
49
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAE3D,MAAM,WAAW,oBAAqB,SAAQ,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/collection-preferences/content-display/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAE3D,KAAK,kBAAkB,GAAG,0BAA0B,CAAC,kBAAkB,CAAC;AACxE,KAAK,oBAAoB,GAAG,0BAA0B,CAAC,oBAAoB,CAAC;AAC5E,KAAK,yBAAyB,GAAG,0BAA0B,CAAC,yBAAyB,CAAC;AAEtF,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,cAAe,SAAQ,oBAAoB;IAC1D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,cAAc,GAAG,eAAe,GAAG,cAAc,CAAC;AAE9D;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,CAAC,kBAAkB,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,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