@cloudscape-design/components-themeable 3.0.1309 → 3.0.1311
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 +15 -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 +48 -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 +119 -102
- 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/skeleton-rows.d.ts +23 -0
- package/lib/internal/template/table/skeleton-rows.d.ts.map +1 -0
- package/lib/internal/template/table/skeleton-rows.js +33 -0
- package/lib/internal/template/table/skeleton-rows.js.map +1 -0
- 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 +36 -34
- package/lib/internal/template/table/styles.scoped.css +53 -41
- package/lib/internal/template/table/styles.selectors.js +36 -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
|
@@ -142,13 +142,13 @@
|
|
|
142
142
|
*/
|
|
143
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.awsui_resize-
|
|
145
|
+
.awsui_resize-active_x7peu_1jg4x_145:not(#\9):not(.awsui_resize-active-with-focus_x7peu_1jg4x_145) * {
|
|
146
146
|
cursor: col-resize;
|
|
147
147
|
-webkit-user-select: none;
|
|
148
148
|
user-select: none;
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
.awsui_resizer-
|
|
151
|
+
.awsui_resizer-wrapper_x7peu_1jg4x_150:not(#\9) {
|
|
152
152
|
inset-block: 0;
|
|
153
153
|
position: absolute;
|
|
154
154
|
inset-inline-end: calc(-1 * var(--space-xl-4dmkh1, 24px) / 2);
|
|
@@ -156,16 +156,16 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
156
156
|
overflow: hidden;
|
|
157
157
|
z-index: 10;
|
|
158
158
|
}
|
|
159
|
-
th:not(#\9):last-child > .awsui_resizer-
|
|
159
|
+
th:not(#\9):last-child > .awsui_resizer-wrapper_x7peu_1jg4x_150:has(.awsui_divider-interactive_x7peu_1jg4x_158).awsui_is-borderless_x7peu_1jg4x_158 {
|
|
160
160
|
inset-inline-end: 0;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
.awsui_resizer-button-
|
|
163
|
+
.awsui_resizer-button-wrapper_x7peu_1jg4x_162:not(#\9) {
|
|
164
164
|
block-size: 100%;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
th:not(#\9):not(
|
|
168
|
-
.awsui_divider-
|
|
167
|
+
th:not(#\9):not([data-rightmost]) > .awsui_divider_x7peu_1jg4x_158,
|
|
168
|
+
.awsui_divider-interactive_x7peu_1jg4x_158:not(#\9) {
|
|
169
169
|
position: absolute;
|
|
170
170
|
outline: none;
|
|
171
171
|
pointer-events: none;
|
|
@@ -176,27 +176,40 @@ th:not(#\9):not(:last-child) > .awsui_divider_x7peu_poa6s_158,
|
|
|
176
176
|
max-block-size: calc(100% - calc(2 * var(--space-xs-kw7k3v, 8px) + var(--space-xxxs-3w1kr2, 2px)));
|
|
177
177
|
margin-block: auto;
|
|
178
178
|
margin-inline: auto;
|
|
179
|
-
border-inline-start: var(--border-
|
|
179
|
+
border-inline-start: var(--border-divider-list-width-8ggz94, 1px) solid var(--color-border-divider-interactive-default-cyw7tx, #687078);
|
|
180
180
|
box-sizing: border-box;
|
|
181
181
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
th:not(#\9):not([data-rightmost]) > .awsui_divider_x7peu_1jg4x_158.awsui_divider-position-top_x7peu_1jg4x_181,
|
|
183
|
+
.awsui_divider-interactive_x7peu_1jg4x_158.awsui_divider-position-top_x7peu_1jg4x_181:not(#\9) {
|
|
184
|
+
margin-block-start: 0;
|
|
185
|
+
margin-block-end: auto;
|
|
186
|
+
max-block-size: calc(100% - calc(2 * var(--space-xs-kw7k3v, 8px) + var(--space-xxxs-3w1kr2, 2px)) / 2);
|
|
187
|
+
}
|
|
188
|
+
th:not(#\9):not([data-rightmost]) > .awsui_divider_x7peu_1jg4x_158.awsui_divider-position-bottom_x7peu_1jg4x_187,
|
|
189
|
+
.awsui_divider-interactive_x7peu_1jg4x_158.awsui_divider-position-bottom_x7peu_1jg4x_187:not(#\9) {
|
|
190
|
+
margin-block-start: auto;
|
|
191
|
+
margin-block-end: 0;
|
|
192
|
+
max-block-size: calc(100% - calc(2 * var(--space-xs-kw7k3v, 8px) + var(--space-xxxs-3w1kr2, 2px)) / 2);
|
|
193
|
+
}
|
|
194
|
+
th:not(#\9):not([data-rightmost]) > .awsui_divider_x7peu_1jg4x_158.awsui_divider-position-full_x7peu_1jg4x_193,
|
|
195
|
+
.awsui_divider-interactive_x7peu_1jg4x_158.awsui_divider-position-full_x7peu_1jg4x_193:not(#\9) {
|
|
196
|
+
margin-block: 0;
|
|
197
|
+
max-block-size: 100%;
|
|
185
198
|
}
|
|
186
199
|
|
|
187
|
-
.awsui_divider-
|
|
200
|
+
.awsui_divider-interactive_x7peu_1jg4x_158:not(#\9) {
|
|
188
201
|
inset-inline-end: calc(var(--space-xl-4dmkh1, 24px) / 2);
|
|
189
202
|
}
|
|
190
203
|
|
|
191
|
-
|
|
192
|
-
|
|
204
|
+
.awsui_divider-active_x7peu_1jg4x_203:not(#\9) {
|
|
205
|
+
/* used in test-utils */
|
|
193
206
|
}
|
|
194
207
|
|
|
195
|
-
.awsui_divider-
|
|
196
|
-
|
|
208
|
+
.awsui_resizer-wrapper_x7peu_1jg4x_150.awsui_visual-refresh_x7peu_1jg4x_207.awsui_is-borderless_x7peu_1jg4x_158.awsui_is-last_x7peu_1jg4x_207 > .awsui_divider-interactive_x7peu_1jg4x_158:not(#\9) {
|
|
209
|
+
inset-inline-end: 0;
|
|
197
210
|
}
|
|
198
211
|
|
|
199
|
-
.
|
|
212
|
+
.awsui_resizer_x7peu_1jg4x_150:not(#\9) {
|
|
200
213
|
border-collapse: separate;
|
|
201
214
|
border-spacing: 0;
|
|
202
215
|
box-sizing: border-box;
|
|
@@ -234,24 +247,21 @@ th:not(#\9):last-child > .awsui_resizer-wrapper_x7peu_poa6s_150.awsui_visual-ref
|
|
|
234
247
|
block-size: 100%;
|
|
235
248
|
inline-size: var(--space-xl-4dmkh1, 24px);
|
|
236
249
|
}
|
|
237
|
-
.
|
|
250
|
+
.awsui_resizer_x7peu_1jg4x_150:not(#\9):focus {
|
|
238
251
|
outline: none;
|
|
239
252
|
text-decoration: none;
|
|
240
253
|
}
|
|
241
|
-
.awsui_resize-
|
|
254
|
+
.awsui_resize-active_x7peu_1jg4x_145 .awsui_resizer_x7peu_1jg4x_150:not(#\9) {
|
|
242
255
|
pointer-events: none;
|
|
243
256
|
}
|
|
244
|
-
.
|
|
245
|
-
border-inline-start: 2px solid var(--color-border-divider-active-d5kcok, #687078);
|
|
246
|
-
}
|
|
247
|
-
body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_poa6s_150.awsui_has-focus_x7peu_poa6s_246:not(#\9) {
|
|
257
|
+
body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_1jg4x_150.awsui_has-focus_x7peu_1jg4x_256:not(#\9) {
|
|
248
258
|
position: relative;
|
|
249
259
|
}
|
|
250
|
-
body[data-awsui-focus-visible=true] .
|
|
260
|
+
body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_1jg4x_150.awsui_has-focus_x7peu_1jg4x_256:not(#\9) {
|
|
251
261
|
outline: 2px dotted transparent;
|
|
252
262
|
outline-offset: calc(calc(var(--space-table-header-focus-outline-gutter-0zj6up, 0px) - 2px) - 1px);
|
|
253
263
|
}
|
|
254
|
-
body[data-awsui-focus-visible=true] .
|
|
264
|
+
body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_1jg4x_150.awsui_has-focus_x7peu_1jg4x_256:not(#\9)::before {
|
|
255
265
|
content: " ";
|
|
256
266
|
display: block;
|
|
257
267
|
position: absolute;
|
|
@@ -266,13 +276,13 @@ body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_poa6s_150.awsui_has-foc
|
|
|
266
276
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-r5f6xl, #0073bb);
|
|
267
277
|
}
|
|
268
278
|
|
|
269
|
-
.
|
|
279
|
+
.awsui_tracker_x7peu_1jg4x_278:not(#\9) {
|
|
270
280
|
display: none;
|
|
271
281
|
position: absolute;
|
|
272
282
|
border-inline-start: var(--border-divider-list-width-8ggz94, 1px) dashed var(--color-border-divider-active-d5kcok, #687078);
|
|
273
283
|
inline-size: 0;
|
|
274
284
|
inset-block: 0;
|
|
275
285
|
}
|
|
276
|
-
.awsui_resize-
|
|
286
|
+
.awsui_resize-active_x7peu_1jg4x_145 .awsui_tracker_x7peu_1jg4x_278:not(#\9) {
|
|
277
287
|
display: block;
|
|
278
288
|
}
|
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"resize-active": "awsui_resize-
|
|
6
|
-
"resize-active-with-focus": "awsui_resize-active-with-
|
|
7
|
-
"resizer-wrapper": "awsui_resizer-
|
|
8
|
-
"divider-interactive": "awsui_divider-
|
|
9
|
-
"is-borderless": "awsui_is-
|
|
10
|
-
"resizer-button-wrapper": "awsui_resizer-button-
|
|
11
|
-
"divider": "
|
|
12
|
-
"divider-
|
|
13
|
-
"
|
|
14
|
-
"divider-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
5
|
+
"resize-active": "awsui_resize-active_x7peu_1jg4x_145",
|
|
6
|
+
"resize-active-with-focus": "awsui_resize-active-with-focus_x7peu_1jg4x_145",
|
|
7
|
+
"resizer-wrapper": "awsui_resizer-wrapper_x7peu_1jg4x_150",
|
|
8
|
+
"divider-interactive": "awsui_divider-interactive_x7peu_1jg4x_158",
|
|
9
|
+
"is-borderless": "awsui_is-borderless_x7peu_1jg4x_158",
|
|
10
|
+
"resizer-button-wrapper": "awsui_resizer-button-wrapper_x7peu_1jg4x_162",
|
|
11
|
+
"divider": "awsui_divider_x7peu_1jg4x_158",
|
|
12
|
+
"divider-position-top": "awsui_divider-position-top_x7peu_1jg4x_181",
|
|
13
|
+
"divider-position-bottom": "awsui_divider-position-bottom_x7peu_1jg4x_187",
|
|
14
|
+
"divider-position-full": "awsui_divider-position-full_x7peu_1jg4x_193",
|
|
15
|
+
"divider-active": "awsui_divider-active_x7peu_1jg4x_203",
|
|
16
|
+
"visual-refresh": "awsui_visual-refresh_x7peu_1jg4x_207",
|
|
17
|
+
"is-last": "awsui_is-last_x7peu_1jg4x_207",
|
|
18
|
+
"resizer": "awsui_resizer_x7peu_1jg4x_150",
|
|
19
|
+
"has-focus": "awsui_has-focus_x7peu_1jg4x_256",
|
|
20
|
+
"tracker": "awsui_tracker_x7peu_1jg4x_278"
|
|
18
21
|
};
|
|
19
22
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TableProps } from './interfaces';
|
|
2
|
+
import { StickyColumnsModel } from './sticky-columns';
|
|
3
|
+
import { TableRole } from './table-role';
|
|
4
|
+
interface SkeletonRowsProps {
|
|
5
|
+
count: number;
|
|
6
|
+
hasDataRows: boolean;
|
|
7
|
+
totalColumnsCount: number;
|
|
8
|
+
loadingText: string | undefined;
|
|
9
|
+
hasSelection: boolean;
|
|
10
|
+
hasFooter: boolean;
|
|
11
|
+
stickyState: StickyColumnsModel;
|
|
12
|
+
tableRole: TableRole;
|
|
13
|
+
ariaLabels: TableProps['ariaLabels'];
|
|
14
|
+
cellVerticalAlign: TableProps.VerticalAlign | undefined;
|
|
15
|
+
computedVariant: string;
|
|
16
|
+
visibleColumnDefinitions: readonly TableProps.ColumnDefinition<any>[];
|
|
17
|
+
wrapLines: boolean | undefined;
|
|
18
|
+
resizableColumns: boolean | undefined;
|
|
19
|
+
colIndexOffset: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function SkeletonRows({ count, hasDataRows, totalColumnsCount, loadingText, hasSelection, hasFooter, stickyState, tableRole, ariaLabels, cellVerticalAlign, computedVariant, visibleColumnDefinitions, wrapLines, resizableColumns, colIndexOffset, }: SkeletonRowsProps): JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=skeleton-rows.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton-rows.d.ts","sourceRoot":"","sources":["../../../src/table/skeleton-rows.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAOzC,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,kBAAkB,CAAC;IAChC,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,iBAAiB,EAAE,UAAU,CAAC,aAAa,GAAG,SAAS,CAAC;IACxD,eAAe,EAAE,MAAM,CAAC;IACxB,wBAAwB,EAAE,SAAS,UAAU,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC;IACtE,SAAS,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,gBAAgB,EAAE,OAAO,GAAG,SAAS,CAAC;IACtC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EAChB,cAAc,GACf,EAAE,iBAAiB,eAuDnB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import ScreenreaderOnly from '../internal/components/screenreader-only';
|
|
5
|
+
import InternalSkeleton from '../skeleton/internal';
|
|
6
|
+
import { TableBodyCell } from './body-cell';
|
|
7
|
+
import { getColumnKey } from './utils';
|
|
8
|
+
import styles from './styles.css.js';
|
|
9
|
+
const noop = () => { };
|
|
10
|
+
export function SkeletonRows({ count, hasDataRows, totalColumnsCount, loadingText, hasSelection, hasFooter, stickyState, tableRole, ariaLabels, cellVerticalAlign, computedVariant, visibleColumnDefinitions, wrapLines, resizableColumns, colIndexOffset, }) {
|
|
11
|
+
return (React.createElement(React.Fragment, null,
|
|
12
|
+
React.createElement("tr", { "aria-hidden": "false" },
|
|
13
|
+
React.createElement("td", { colSpan: totalColumnsCount, className: styles['skeleton-loading-cell'] },
|
|
14
|
+
React.createElement(ScreenreaderOnly, null, loadingText))),
|
|
15
|
+
Array.from({ length: count }, (_, i) => {
|
|
16
|
+
const isFirstRow = !hasDataRows && i === 0;
|
|
17
|
+
const isLastRow = i === count - 1;
|
|
18
|
+
return (React.createElement("tr", { key: `skeleton-row-${i}`, className: styles.row, "aria-hidden": "true" },
|
|
19
|
+
hasSelection && React.createElement("td", { className: styles['selection-control'] }),
|
|
20
|
+
visibleColumnDefinitions.map((column, colIndex) => {
|
|
21
|
+
var _a, _b;
|
|
22
|
+
return (React.createElement(TableBodyCell, { key: `skeleton-${getColumnKey(column, colIndex)}`, isFirstRow: isFirstRow, isLastRow: isLastRow, isSelected: false, isPrevSelected: false, isNextSelected: false, hasSelection: hasSelection, hasFooter: hasFooter, stickyState: stickyState, tableRole: tableRole, resizableStyle: {
|
|
23
|
+
width: column.width,
|
|
24
|
+
minWidth: column.minWidth,
|
|
25
|
+
maxWidth: column.maxWidth,
|
|
26
|
+
}, ariaLabels: ariaLabels, column: {
|
|
27
|
+
...column,
|
|
28
|
+
cell: () => React.createElement(InternalSkeleton, { variant: "dynamic", tagOverride: "span" }),
|
|
29
|
+
}, item: {}, wrapLines: wrapLines, isEditable: false, isEditing: false, isRowHeader: column.isRowHeader, resizableColumns: resizableColumns, onEditStart: noop, onEditEnd: noop, columnId: (_a = column.id) !== null && _a !== void 0 ? _a : colIndex, colIndex: colIndex + colIndexOffset, verticalAlign: (_b = column.verticalAlign) !== null && _b !== void 0 ? _b : cellVerticalAlign, tableVariant: computedVariant }));
|
|
30
|
+
})));
|
|
31
|
+
})));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=skeleton-rows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton-rows.js","sourceRoot":"","sources":["../../../src/table/skeleton-rows.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,gBAAgB,MAAM,0CAA0C,CAAC;AACxE,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAoBtB,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,SAAS,EACT,gBAAgB,EA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B,IAAC,OAAO,EAAC,SAAS,EAAC,WAAW,EAAC,MAAM,GAAG;yBACtE,EACD,IAAI,EAAE,EAAE,EACR,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,KAAK,EACjB,SAAS,EAAE,KAAK,EAChB,WAAW,EAAE,MAAM,CAAC,WAAW,EAC/B,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,IAAI,EACjB,SAAS,EAAE,IAAI,EACf,QAAQ,EAAE,MAAA,MAAM,CAAC,EAAE,mCAAI,QAAQ,EAC/B,QAAQ,EAAE,QAAQ,GAAG,cAAc,EACnC,aAAa,EAAE,MAAA,MAAM,CAAC,aAAa,mCAAI,iBAAiB,EACxD,YAAY,EAAE,eAAe,GAC7B,CACH,CAAA;iBAAA,CAAC,CACC,CACN,CAAC;QACJ,CAAC,CAAC,CACD,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport ScreenreaderOnly from '../internal/components/screenreader-only';\nimport InternalSkeleton from '../skeleton/internal';\nimport { TableBodyCell } from './body-cell';\nimport { TableProps } from './interfaces';\nimport { StickyColumnsModel } from './sticky-columns';\nimport { TableRole } from './table-role';\nimport { getColumnKey } from './utils';\n\nimport styles from './styles.css.js';\n\nconst noop = () => {};\n\ninterface SkeletonRowsProps {\n count: number;\n hasDataRows: boolean;\n totalColumnsCount: number;\n loadingText: string | undefined;\n hasSelection: boolean;\n hasFooter: boolean;\n stickyState: StickyColumnsModel;\n tableRole: TableRole;\n ariaLabels: TableProps['ariaLabels'];\n cellVerticalAlign: TableProps.VerticalAlign | undefined;\n computedVariant: string;\n visibleColumnDefinitions: readonly TableProps.ColumnDefinition<any>[];\n wrapLines: boolean | undefined;\n resizableColumns: boolean | undefined;\n colIndexOffset: number;\n}\n\nexport function SkeletonRows({\n count,\n hasDataRows,\n totalColumnsCount,\n loadingText,\n hasSelection,\n hasFooter,\n stickyState,\n tableRole,\n ariaLabels,\n cellVerticalAlign,\n computedVariant,\n visibleColumnDefinitions,\n wrapLines,\n resizableColumns,\n colIndexOffset,\n}: SkeletonRowsProps) {\n return (\n <>\n <tr aria-hidden=\"false\">\n <td colSpan={totalColumnsCount} className={styles['skeleton-loading-cell']}>\n <ScreenreaderOnly>{loadingText}</ScreenreaderOnly>\n </td>\n </tr>\n {Array.from({ length: count }, (_, i) => {\n const isFirstRow = !hasDataRows && i === 0;\n const isLastRow = i === count - 1;\n return (\n <tr key={`skeleton-row-${i}`} className={styles.row} aria-hidden=\"true\">\n {hasSelection && <td className={styles['selection-control']} />}\n {visibleColumnDefinitions.map((column: any, colIndex: number) => (\n <TableBodyCell\n key={`skeleton-${getColumnKey(column, colIndex)}`}\n isFirstRow={isFirstRow}\n isLastRow={isLastRow}\n isSelected={false}\n isPrevSelected={false}\n isNextSelected={false}\n hasSelection={hasSelection}\n hasFooter={hasFooter}\n stickyState={stickyState}\n tableRole={tableRole}\n resizableStyle={{\n width: column.width,\n minWidth: column.minWidth,\n maxWidth: column.maxWidth,\n }}\n ariaLabels={ariaLabels}\n column={{\n ...column,\n cell: () => <InternalSkeleton variant=\"dynamic\" tagOverride=\"span\" />,\n }}\n item={{}}\n wrapLines={wrapLines}\n isEditable={false}\n isEditing={false}\n isRowHeader={column.isRowHeader}\n resizableColumns={resizableColumns}\n onEditStart={noop}\n onEditEnd={noop}\n columnId={column.id ?? colIndex}\n colIndex={colIndex + colIndexOffset}\n verticalAlign={column.verticalAlign ?? cellVerticalAlign}\n tableVariant={computedVariant}\n />\n ))}\n </tr>\n );\n })}\n </>\n );\n}\n"]}
|
|
@@ -18,6 +18,9 @@ interface StickyHeaderProps {
|
|
|
18
18
|
contentDensity?: 'comfortable' | 'compact';
|
|
19
19
|
tableHasHeader?: boolean;
|
|
20
20
|
tableRole: TableRole;
|
|
21
|
+
hasGroupedColumns?: boolean;
|
|
22
|
+
columnDefinitions?: ReadonlyArray<TableProps.ColumnDefinition<any>>;
|
|
23
|
+
hasSelection?: boolean;
|
|
21
24
|
}
|
|
22
25
|
declare const _default: React.ForwardRefExoticComponent<StickyHeaderProps & React.RefAttributes<StickyHeaderRef>>;
|
|
23
26
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-header.d.ts","sourceRoot":"","sources":["../../../src/table/sticky-header.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"sticky-header.d.ts","sourceRoot":"","sources":["../../../src/table/sticky-header.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAM7F,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAqB,SAAS,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK5C,MAAM,WAAW,eAAe;IAC9B,WAAW,IAAI,IAAI,CAAC;IACpB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,WAAW,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;CACxC;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;IAC5B,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC5C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;IAC/C,mBAAmB,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACrD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IAChD,cAAc,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC3C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iBAAiB,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;IACpE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;;AAED,wBAAwC"}
|
|
@@ -4,12 +4,13 @@ import React, { forwardRef, useContext, useImperativeHandle, useRef, useState }
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import { StickyHeaderContext } from '../container/use-sticky-header';
|
|
6
6
|
import { getVisualContextClassname } from '../internal/components/visual-context';
|
|
7
|
+
import { TableColGroup } from './column-groups/col-group';
|
|
7
8
|
import { getTableRoleProps } from './table-role';
|
|
8
9
|
import Thead from './thead';
|
|
9
10
|
import { useStickyHeader } from './use-sticky-header';
|
|
10
11
|
import styles from './styles.css.js';
|
|
11
12
|
export default forwardRef(StickyHeader);
|
|
12
|
-
function StickyHeader({ variant, theadProps, wrapperRef, theadRef, secondaryWrapperRef,
|
|
13
|
+
function StickyHeader({ variant, theadProps, wrapperRef, theadRef, secondaryWrapperRef, tableRef, onScroll, tableHasHeader, contentDensity, tableRole, hasGroupedColumns, columnDefinitions, hasSelection, }, ref) {
|
|
13
14
|
const secondaryTheadRef = useRef(null);
|
|
14
15
|
const secondaryTableRef = useRef(null);
|
|
15
16
|
const { isStuck } = useContext(StickyHeaderContext);
|
|
@@ -20,13 +21,17 @@ function StickyHeader({ variant, theadProps, wrapperRef, theadRef, secondaryWrap
|
|
|
20
21
|
scrollToRow,
|
|
21
22
|
setFocus: setFocusedComponent,
|
|
22
23
|
}));
|
|
24
|
+
// For grouped columns, the secondary table needs a <colgroup> to define column
|
|
25
|
+
// widths. Without it, table-layout:fixed uses the first row (which has colspan group
|
|
26
|
+
// headers) to determine widths — giving wrong results.
|
|
23
27
|
return (React.createElement("div", { className: clsx(styles['header-secondary'], styles[`variant-${variant}`], {
|
|
24
28
|
[styles['table-has-header']]: tableHasHeader,
|
|
25
29
|
}), "aria-hidden": true,
|
|
26
30
|
// Prevents receiving focus in Firefox. Focus on the overflowing table is sufficient
|
|
27
31
|
// to scroll the table horizontally
|
|
28
32
|
tabIndex: -1, ref: secondaryWrapperRef, onScroll: onScroll },
|
|
29
|
-
React.createElement("table", { className: clsx(styles.table, styles['table-layout-fixed'], contentDensity === 'compact' && getVisualContextClassname('compact-table')), ref: secondaryTableRef, ...getTableRoleProps({ tableRole }) },
|
|
33
|
+
React.createElement("table", { className: clsx(styles.table, styles['table-layout-fixed'], hasGroupedColumns && styles['has-grouped-header'], contentDensity === 'compact' && getVisualContextClassname('compact-table')), ref: secondaryTableRef, ...getTableRoleProps({ tableRole }) },
|
|
34
|
+
hasGroupedColumns && columnDefinitions && (React.createElement(TableColGroup, { visibleColumnDefinitions: columnDefinitions, hasSelection: !!hasSelection, sticky: true, selectionColumnId: theadProps.selectionColumnId })),
|
|
30
35
|
React.createElement(Thead, { ref: secondaryTheadRef, sticky: true, stuck: isStuck, focusedComponent: focusedComponent, ...theadProps }))));
|
|
31
36
|
}
|
|
32
37
|
//# sourceMappingURL=sticky-header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-header.js","sourceRoot":"","sources":["../../../src/table/sticky-header.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7F,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"sticky-header.js","sourceRoot":"","sources":["../../../src/table/sticky-header.tsx"],"names":[],"mappings":"AAAA,q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AW;QACX,QAAQ,EAAE,mBAAmB;KAC9B,CAAC,CAAC,CAAC;IAEJ,+EAA+E;IAC/E,qFAAqF;IACrF,uDAAuD;IAEvD,OAAO,CACL,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC,WAAW,OAAO,EAAE,CAAC,EAAE;YACxE,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,EAAE,cAAc;SAC7C,CAAC,iBACW,IAAI;QACjB,oFAAoF;QACpF,mCAAmC;QACnC,QAAQ,EAAE,CAAC,CAAC,EACZ,GAAG,EAAE,mBAAmB,EACxB,QAAQ,EAAE,QAAQ;QAElB,+BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,KAAK,EACZ,MAAM,CAAC,oBAAoB,CAAC,EAC5B,iBAAiB,IAAI,MAAM,CAAC,oBAAoB,CAAC,EACjD,cAAc,KAAK,SAAS,IAAI,yBAAyB,CAAC,eAAe,CAAC,CAC3E,EACD,GAAG,EAAE,iBAAiB,KAClB,iBAAiB,CAAC,EAAE,SAAS,EAAE,CAAC;YAEnC,iBAAiB,IAAI,iBAAiB,IAAI,CACzC,oBAAC,aAAa,IACZ,wBAAwB,EAAE,iBAAiB,EAC3C,YAAY,EAAE,CAAC,CAAC,YAAY,EAC5B,MAAM,EAAE,IAAI,EACZ,iBAAiB,EAAE,UAAU,CAAC,iBAAiB,GAC/C,CACH;YACD,oBAAC,KAAK,IACJ,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,IAAI,EACZ,KAAK,EAAE,OAAO,EACd,gBAAgB,EAAE,gBAAgB,KAC9B,UAAU,GACd,CACI,CACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { forwardRef, useContext, useImperativeHandle, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { StickyHeaderContext } from '../container/use-sticky-header';\nimport { getVisualContextClassname } from '../internal/components/visual-context';\nimport { TableColGroup } from './column-groups/col-group';\nimport { TableProps } from './interfaces';\nimport { getTableRoleProps, TableRole } from './table-role';\nimport Thead, { TheadProps } from './thead';\nimport { useStickyHeader } from './use-sticky-header';\n\nimport styles from './styles.css.js';\n\nexport interface StickyHeaderRef {\n scrollToTop(): void;\n scrollToRow(node: null | HTMLElement): void;\n setFocus(focusId: null | string): void;\n}\n\ninterface StickyHeaderProps {\n variant: TableProps.Variant;\n theadProps: TheadProps;\n wrapperRef: React.RefObject<HTMLDivElement>;\n theadRef: React.RefObject<HTMLTableRowElement>;\n secondaryWrapperRef: React.RefObject<HTMLDivElement>;\n tableRef: React.RefObject<HTMLTableElement>;\n onScroll?: React.UIEventHandler<HTMLDivElement>;\n contentDensity?: 'comfortable' | 'compact';\n tableHasHeader?: boolean;\n tableRole: TableRole;\n hasGroupedColumns?: boolean;\n columnDefinitions?: ReadonlyArray<TableProps.ColumnDefinition<any>>;\n hasSelection?: boolean;\n}\n\nexport default forwardRef(StickyHeader);\n\nfunction StickyHeader(\n {\n variant,\n theadProps,\n wrapperRef,\n theadRef,\n secondaryWrapperRef,\n tableRef,\n onScroll,\n tableHasHeader,\n contentDensity,\n tableRole,\n hasGroupedColumns,\n columnDefinitions,\n hasSelection,\n }: StickyHeaderProps,\n ref: React.Ref<StickyHeaderRef>\n) {\n const secondaryTheadRef = useRef<HTMLTableRowElement>(null);\n const secondaryTableRef = useRef<HTMLTableElement>(null);\n const { isStuck } = useContext(StickyHeaderContext);\n\n const [focusedComponent, setFocusedComponent] = useState<null | string>(null);\n const { scrollToRow, scrollToTop } = useStickyHeader(\n tableRef,\n theadRef,\n secondaryTheadRef,\n secondaryTableRef,\n wrapperRef\n );\n\n useImperativeHandle(ref, () => ({\n scrollToTop,\n scrollToRow,\n setFocus: setFocusedComponent,\n }));\n\n // For grouped columns, the secondary table needs a <colgroup> to define column\n // widths. Without it, table-layout:fixed uses the first row (which has colspan group\n // headers) to determine widths — giving wrong results.\n\n return (\n <div\n className={clsx(styles['header-secondary'], styles[`variant-${variant}`], {\n [styles['table-has-header']]: tableHasHeader,\n })}\n aria-hidden={true}\n // Prevents receiving focus in Firefox. Focus on the overflowing table is sufficient\n // to scroll the table horizontally\n tabIndex={-1}\n ref={secondaryWrapperRef}\n onScroll={onScroll}\n >\n <table\n className={clsx(\n styles.table,\n styles['table-layout-fixed'],\n hasGroupedColumns && styles['has-grouped-header'],\n contentDensity === 'compact' && getVisualContextClassname('compact-table')\n )}\n ref={secondaryTableRef}\n {...getTableRoleProps({ tableRole })}\n >\n {hasGroupedColumns && columnDefinitions && (\n <TableColGroup\n visibleColumnDefinitions={columnDefinitions}\n hasSelection={!!hasSelection}\n sticky={true}\n selectionColumnId={theadProps.selectionColumnId}\n />\n )}\n <Thead\n ref={secondaryTheadRef}\n sticky={true}\n stuck={isStuck}\n focusedComponent={focusedComponent}\n {...theadProps}\n />\n </table>\n </div>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-scrolling.d.ts","sourceRoot":"","sources":["../../../src/table/sticky-scrolling.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,EACxD,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;;yBAWzB,WAAW,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"sticky-scrolling.d.ts","sourceRoot":"","sources":["../../../src/table/sticky-scrolling.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,EACxD,SAAS,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC;;yBAWzB,WAAW,GAAG,IAAI;EAkB/C;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,UAInF;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,QAQhE"}
|
|
@@ -19,10 +19,15 @@ export default function stickyScrolling(containerRef, stickyRef) {
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
const scrollToItem = (item) => {
|
|
22
|
+
var _a;
|
|
22
23
|
if (!item || !containerRef.current || !stickyRef.current) {
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
+
// For grouped headers with multiple <tr> rows, stickyRef points to the first <tr>.
|
|
27
|
+
// Use the full <thead> bottom so we account for all header rows.
|
|
28
|
+
/* istanbul ignore next: requires DOM scroll measurements */
|
|
29
|
+
const stickyEl = (_a = stickyRef.current.closest('thead')) !== null && _a !== void 0 ? _a : stickyRef.current;
|
|
30
|
+
const stickyBottom = getLogicalBoundingClientRect(stickyEl).insetBlockEnd;
|
|
26
31
|
const scrollingOffset = stickyBottom - getLogicalBoundingClientRect(item).insetBlockStart;
|
|
27
32
|
if (scrollingOffset > 0) {
|
|
28
33
|
scrollUpBy(scrollingOffset, containerRef.current);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-scrolling.js","sourceRoot":"","sources":["../../../src/table/sticky-scrolling.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAE7F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,YAAwD,EACxD,SAAqD;IAErD,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,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A,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,mCAAI,SAAS,CAAC,OAAO,CAAC;QACzE,MAAM,YAAY,GAAG,4BAA4B,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC;QAC1E,MAAM,eAAe,GAAG,YAAY,GAAG,4BAA4B,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC;QAC1F,IAAI,eAAe,GAAG,CAAC,EAAE,CAAC;YACxB,UAAU,CAAC,eAAe,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;IACH,CAAC,CAAC;IACF,OAAO;QACL,WAAW;QACX,YAAY;KACb,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAC,SAAsB,EAAE,MAAmB;IAClF,MAAM,UAAU,GAAG,4BAA4B,CAAC,MAAM,CAAC,CAAC;IACxD,MAAM,aAAa,GAAG,4BAA4B,CAAC,SAAS,CAAC,CAAC;IAC9D,OAAO,UAAU,CAAC,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;AACpE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAAc,EAAE,SAAsB;IAC/D,MAAM,MAAM,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC7C,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAClB,qCAAqC;QACrC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,MAAM,CAAC;IAChC,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,WAAW,GAAG,MAAM,EAAE,CAAC,CAAC;IACxD,CAAC;AACH,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getLogicalBoundingClientRect } from '@cloudscape-design/component-toolkit/internal';\n\nimport { getOverflowParents } from '../internal/utils/scrollable-containers';\n\n/**\n * @param containerRef ref to surrounding container with sticky element\n * @param stickyRef ref to sticky element scrolled inside of containerRef\n * @param containerOffset offset between header and container\n * originating borders or paddings\n */\nexport default function stickyScrolling(\n containerRef: React.MutableRefObject<HTMLElement | null>,\n stickyRef: React.MutableRefObject<HTMLElement | null>\n) {\n const scrollToTop = () => {\n if (!containerRef.current || !stickyRef.current) {\n return;\n }\n const scrollingOffset = calculateScrollingOffset(containerRef.current, stickyRef.current);\n if (scrollingOffset > 0) {\n scrollUpBy(scrollingOffset, containerRef.current);\n }\n };\n const scrollToItem = (item: HTMLElement | null) => {\n if (!item || !containerRef.current || !stickyRef.current) {\n return;\n }\n // For grouped headers with multiple <tr> rows, stickyRef points to the first <tr>.\n // Use the full <thead> bottom so we account for all header rows.\n /* istanbul ignore next: requires DOM scroll measurements */\n const stickyEl = stickyRef.current.closest('thead') ?? stickyRef.current;\n const stickyBottom = getLogicalBoundingClientRect(stickyEl).insetBlockEnd;\n const scrollingOffset = stickyBottom - getLogicalBoundingClientRect(item).insetBlockStart;\n if (scrollingOffset > 0) {\n scrollUpBy(scrollingOffset, containerRef.current);\n }\n };\n return {\n scrollToTop,\n scrollToItem,\n };\n}\n\n/**\n * Calculates the scrolling offset between container and\n * sticky element with container offset caused by border\n * or padding\n * @param container\n * @param sticky element inside of container\n * @param containerOffset caused by borders or paddings\n */\nexport function calculateScrollingOffset(container: HTMLElement, sticky: HTMLElement) {\n const stickyRect = getLogicalBoundingClientRect(sticky);\n const containerRect = getLogicalBoundingClientRect(container);\n return stickyRect.insetBlockStart - containerRect.insetBlockStart;\n}\n\n/**\n * Scrolls suitable parent of container up by amount of pixels\n * @param amount pixels to be scrolled up\n * @param container used to determine next parent element for scrolling\n */\nexport function scrollUpBy(amount: number, container: HTMLElement) {\n const parent = getOverflowParents(container);\n if (parent.length) {\n // Take next overflow parent in stack\n parent[0].scrollTop -= amount;\n } else {\n window.scrollTo({ top: window.pageYOffset - amount });\n }\n}\n"]}
|
|
@@ -1,39 +1,41 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"tools": "
|
|
6
|
-
"tools-filtering": "awsui_tools-
|
|
7
|
-
"tools-align-right": "awsui_tools-align-
|
|
8
|
-
"tools-pagination": "awsui_tools-
|
|
9
|
-
"tools-preferences": "awsui_tools-
|
|
10
|
-
"tools-small": "awsui_tools-
|
|
11
|
-
"table": "
|
|
12
|
-
"table-layout-fixed": "awsui_table-layout-
|
|
13
|
-
"wrapper": "
|
|
14
|
-
"variant-stacked": "awsui_variant-
|
|
15
|
-
"wrapper-content-measure": "awsui_wrapper-content-
|
|
16
|
-
"variant-container": "awsui_variant-
|
|
17
|
-
"has-footer": "awsui_has-
|
|
18
|
-
"has-header": "awsui_has-
|
|
19
|
-
"cell-merged": "awsui_cell-
|
|
20
|
-
"cell-merged-content": "awsui_cell-merged-
|
|
21
|
-
"empty": "
|
|
22
|
-
"loading": "
|
|
23
|
-
"selection-control": "awsui_selection-
|
|
24
|
-
"selection-control-header": "awsui_selection-control-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"header
|
|
29
|
-
"
|
|
30
|
-
"variant-
|
|
31
|
-
"
|
|
32
|
-
"footer": "
|
|
33
|
-
"footer
|
|
34
|
-
"footer-pagination": "awsui_footer-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"row
|
|
4
|
+
"root": "awsui_root_wih1l_1usgh_153",
|
|
5
|
+
"tools": "awsui_tools_wih1l_1usgh_164",
|
|
6
|
+
"tools-filtering": "awsui_tools-filtering_wih1l_1usgh_173",
|
|
7
|
+
"tools-align-right": "awsui_tools-align-right_wih1l_1usgh_186",
|
|
8
|
+
"tools-pagination": "awsui_tools-pagination_wih1l_1usgh_190",
|
|
9
|
+
"tools-preferences": "awsui_tools-preferences_wih1l_1usgh_190",
|
|
10
|
+
"tools-small": "awsui_tools-small_wih1l_1usgh_196",
|
|
11
|
+
"table": "awsui_table_wih1l_1usgh_200",
|
|
12
|
+
"table-layout-fixed": "awsui_table-layout-fixed_wih1l_1usgh_206",
|
|
13
|
+
"wrapper": "awsui_wrapper_wih1l_1usgh_210",
|
|
14
|
+
"variant-stacked": "awsui_variant-stacked_wih1l_1usgh_217",
|
|
15
|
+
"wrapper-content-measure": "awsui_wrapper-content-measure_wih1l_1usgh_217",
|
|
16
|
+
"variant-container": "awsui_variant-container_wih1l_1usgh_217",
|
|
17
|
+
"has-footer": "awsui_has-footer_wih1l_1usgh_220",
|
|
18
|
+
"has-header": "awsui_has-header_wih1l_1usgh_223",
|
|
19
|
+
"cell-merged": "awsui_cell-merged_wih1l_1usgh_240",
|
|
20
|
+
"cell-merged-content": "awsui_cell-merged-content_wih1l_1usgh_252",
|
|
21
|
+
"empty": "awsui_empty_wih1l_1usgh_268",
|
|
22
|
+
"loading": "awsui_loading_wih1l_1usgh_272",
|
|
23
|
+
"selection-control": "awsui_selection-control_wih1l_1usgh_281",
|
|
24
|
+
"selection-control-header": "awsui_selection-control-header_wih1l_1usgh_288",
|
|
25
|
+
"selection-control-content-spans-rows": "awsui_selection-control-content-spans-rows_wih1l_1usgh_293",
|
|
26
|
+
"header-secondary": "awsui_header-secondary_wih1l_1usgh_300",
|
|
27
|
+
"variant-full-page": "awsui_variant-full-page_wih1l_1usgh_311",
|
|
28
|
+
"table-has-header": "awsui_table-has-header_wih1l_1usgh_317",
|
|
29
|
+
"header-controls": "awsui_header-controls_wih1l_1usgh_328",
|
|
30
|
+
"variant-embedded": "awsui_variant-embedded_wih1l_1usgh_337",
|
|
31
|
+
"variant-borderless": "awsui_variant-borderless_wih1l_1usgh_337",
|
|
32
|
+
"footer-wrapper": "awsui_footer-wrapper_wih1l_1usgh_342",
|
|
33
|
+
"footer": "awsui_footer_wih1l_1usgh_342",
|
|
34
|
+
"footer-with-pagination": "awsui_footer-with-pagination_wih1l_1usgh_350",
|
|
35
|
+
"footer-pagination": "awsui_footer-pagination_wih1l_1usgh_358",
|
|
36
|
+
"thead-active": "awsui_thead-active_wih1l_1usgh_362",
|
|
37
|
+
"row": "awsui_row_wih1l_1usgh_363",
|
|
38
|
+
"row-selected": "awsui_row-selected_wih1l_1usgh_364",
|
|
39
|
+
"skeleton-loading-cell": "awsui_skeleton-loading-cell_wih1l_1usgh_368"
|
|
38
40
|
};
|
|
39
41
|
|