@cloudscape-design/components 3.0.295 → 3.0.296
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/breadcrumb-group/index.d.ts +1 -1
- package/breadcrumb-group/index.d.ts.map +1 -1
- package/breadcrumb-group/index.js +2 -2
- package/breadcrumb-group/index.js.map +1 -1
- package/breadcrumb-group/internal.d.ts +1 -2
- package/breadcrumb-group/internal.d.ts.map +1 -1
- package/breadcrumb-group/internal.js +8 -1
- package/breadcrumb-group/internal.js.map +1 -1
- package/cards/index.d.ts.map +1 -1
- package/cards/index.js +6 -1
- package/cards/index.js.map +1 -1
- package/code-editor/index.d.ts.map +1 -1
- package/code-editor/index.js +18 -16
- package/code-editor/index.js.map +1 -1
- package/code-editor/interfaces.d.ts +1 -1
- package/code-editor/interfaces.d.ts.map +1 -1
- package/code-editor/interfaces.js.map +1 -1
- package/code-editor/pane.d.ts +2 -2
- package/code-editor/pane.d.ts.map +1 -1
- package/code-editor/pane.js +8 -5
- package/code-editor/pane.js.map +1 -1
- package/code-editor/preferences-modal.d.ts +7 -7
- package/code-editor/preferences-modal.d.ts.map +1 -1
- package/code-editor/preferences-modal.js.map +1 -1
- package/code-editor/status-bar.d.ts +2 -2
- package/code-editor/status-bar.d.ts.map +1 -1
- package/code-editor/status-bar.js +5 -3
- package/code-editor/status-bar.js.map +1 -1
- package/help-panel/index.d.ts.map +1 -1
- package/help-panel/index.js +3 -1
- package/help-panel/index.js.map +1 -1
- package/internal/components/token-list/token-limit-toggle.d.ts.map +1 -1
- package/internal/components/token-list/token-limit-toggle.js +4 -2
- package/internal/components/token-list/token-limit-toggle.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/manifest.json +1 -1
- package/link/internal.d.ts.map +1 -1
- package/link/internal.js +4 -1
- package/link/internal.js.map +1 -1
- package/multiselect/internal.d.ts.map +1 -1
- package/multiselect/internal.js +3 -1
- package/multiselect/internal.js.map +1 -1
- package/package.json +1 -1
- package/table/styles.css.js +35 -34
- package/table/styles.scoped.css +49 -43
- package/table/styles.selectors.js +35 -34
- package/table/use-sticky-scrollbar.d.ts +1 -0
- package/table/use-sticky-scrollbar.d.ts.map +1 -1
- package/table/use-sticky-scrollbar.js +10 -36
- package/table/use-sticky-scrollbar.js.map +1 -1
- package/tabs/interfaces.d.ts +2 -2
- package/tabs/interfaces.d.ts.map +1 -1
- package/tabs/interfaces.js.map +1 -1
- package/tabs/tab-header-bar.d.ts.map +1 -1
- package/tabs/tab-header-bar.js +4 -2
- package/tabs/tab-header-bar.js.map +1 -1
package/table/styles.css.js
CHANGED
|
@@ -1,39 +1,40 @@
|
|
|
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
|
-
"variant-container": "awsui_variant-
|
|
16
|
-
"variant-embedded": "awsui_variant-
|
|
17
|
-
"variant-borderless": "awsui_variant-
|
|
18
|
-
"has-header": "awsui_has-
|
|
19
|
-
"has-footer": "awsui_has-
|
|
20
|
-
"cell-merged": "awsui_cell-
|
|
21
|
-
"cell-merged-content": "awsui_cell-merged-
|
|
22
|
-
"empty": "
|
|
23
|
-
"loading": "
|
|
24
|
-
"selection-control": "awsui_selection-
|
|
25
|
-
"selection-control-header": "awsui_selection-control-
|
|
26
|
-
"sticky-scrollbar": "awsui_sticky-
|
|
27
|
-
"sticky-scrollbar-content": "awsui_sticky-scrollbar-
|
|
28
|
-
"sticky-scrollbar-visible": "awsui_sticky-scrollbar-
|
|
29
|
-
"
|
|
30
|
-
"header
|
|
31
|
-
"
|
|
32
|
-
"header
|
|
33
|
-
"
|
|
34
|
-
"footer": "
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"row
|
|
4
|
+
"root": "awsui_root_wih1l_16d38_97",
|
|
5
|
+
"tools": "awsui_tools_wih1l_16d38_108",
|
|
6
|
+
"tools-filtering": "awsui_tools-filtering_wih1l_16d38_114",
|
|
7
|
+
"tools-align-right": "awsui_tools-align-right_wih1l_16d38_128",
|
|
8
|
+
"tools-pagination": "awsui_tools-pagination_wih1l_16d38_132",
|
|
9
|
+
"tools-preferences": "awsui_tools-preferences_wih1l_16d38_132",
|
|
10
|
+
"tools-small": "awsui_tools-small_wih1l_16d38_138",
|
|
11
|
+
"table": "awsui_table_wih1l_16d38_144",
|
|
12
|
+
"table-layout-fixed": "awsui_table-layout-fixed_wih1l_16d38_150",
|
|
13
|
+
"wrapper": "awsui_wrapper_wih1l_16d38_154",
|
|
14
|
+
"variant-stacked": "awsui_variant-stacked_wih1l_16d38_163",
|
|
15
|
+
"variant-container": "awsui_variant-container_wih1l_16d38_163",
|
|
16
|
+
"variant-embedded": "awsui_variant-embedded_wih1l_16d38_167",
|
|
17
|
+
"variant-borderless": "awsui_variant-borderless_wih1l_16d38_167",
|
|
18
|
+
"has-header": "awsui_has-header_wih1l_16d38_170",
|
|
19
|
+
"has-footer": "awsui_has-footer_wih1l_16d38_173",
|
|
20
|
+
"cell-merged": "awsui_cell-merged_wih1l_16d38_190",
|
|
21
|
+
"cell-merged-content": "awsui_cell-merged-content_wih1l_16d38_201",
|
|
22
|
+
"empty": "awsui_empty_wih1l_16d38_216",
|
|
23
|
+
"loading": "awsui_loading_wih1l_16d38_220",
|
|
24
|
+
"selection-control": "awsui_selection-control_wih1l_16d38_229",
|
|
25
|
+
"selection-control-header": "awsui_selection-control-header_wih1l_16d38_236",
|
|
26
|
+
"sticky-scrollbar": "awsui_sticky-scrollbar_wih1l_16d38_241",
|
|
27
|
+
"sticky-scrollbar-content": "awsui_sticky-scrollbar-content_wih1l_16d38_250",
|
|
28
|
+
"sticky-scrollbar-visible": "awsui_sticky-scrollbar-visible_wih1l_16d38_253",
|
|
29
|
+
"sticky-scrollbar-native-invisible": "awsui_sticky-scrollbar-native-invisible_wih1l_16d38_256",
|
|
30
|
+
"dark-header": "awsui_dark-header_wih1l_16d38_264",
|
|
31
|
+
"header-secondary": "awsui_header-secondary_wih1l_16d38_269",
|
|
32
|
+
"table-has-header": "awsui_table-has-header_wih1l_16d38_285",
|
|
33
|
+
"header-controls": "awsui_header-controls_wih1l_16d38_289",
|
|
34
|
+
"footer-wrapper": "awsui_footer-wrapper_wih1l_16d38_303",
|
|
35
|
+
"footer": "awsui_footer_wih1l_16d38_303",
|
|
36
|
+
"thead-active": "awsui_thead-active_wih1l_16d38_312",
|
|
37
|
+
"row": "awsui_row_wih1l_16d38_313",
|
|
38
|
+
"row-selected": "awsui_row-selected_wih1l_16d38_314"
|
|
38
39
|
};
|
|
39
40
|
|
package/table/styles.scoped.css
CHANGED
|
@@ -94,7 +94,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
94
94
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
95
95
|
SPDX-License-Identifier: Apache-2.0
|
|
96
96
|
*/
|
|
97
|
-
.
|
|
97
|
+
.awsui_root_wih1l_16d38_97:not(#\9) {
|
|
98
98
|
font-size: var(--font-body-m-size-cqtcam, 14px);
|
|
99
99
|
line-height: var(--font-body-m-line-height-83azrc, 22px);
|
|
100
100
|
color: var(--color-text-body-default-01bwmw, #000716);
|
|
@@ -105,96 +105,100 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
105
105
|
width: 100%;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
.
|
|
108
|
+
.awsui_tools_wih1l_16d38_108:not(#\9) {
|
|
109
109
|
display: flex;
|
|
110
110
|
align-items: flex-end;
|
|
111
111
|
flex-wrap: wrap;
|
|
112
112
|
padding: var(--space-scaled-xs-u0e7ft, 8px) 0 var(--space-scaled-xxs-ugy2pw, 4px);
|
|
113
113
|
}
|
|
114
|
-
.awsui_tools-
|
|
114
|
+
.awsui_tools-filtering_wih1l_16d38_114:not(#\9) {
|
|
115
115
|
max-width: 100%;
|
|
116
116
|
margin-right: var(--space-l-ds615y, 20px);
|
|
117
117
|
}
|
|
118
118
|
@supports (flex-basis: fit-content) {
|
|
119
|
-
.awsui_tools-
|
|
119
|
+
.awsui_tools-filtering_wih1l_16d38_114:not(#\9) {
|
|
120
120
|
flex: 1 1 fit-content;
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
@supports not (flex-basis: fit-content) {
|
|
124
|
-
.awsui_tools-
|
|
124
|
+
.awsui_tools-filtering_wih1l_16d38_114:not(#\9) {
|
|
125
125
|
flex: 1 1 auto;
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
.awsui_tools-align-
|
|
128
|
+
.awsui_tools-align-right_wih1l_16d38_128:not(#\9) {
|
|
129
129
|
display: flex;
|
|
130
130
|
margin-left: auto;
|
|
131
131
|
}
|
|
132
|
-
.awsui_tools-
|
|
132
|
+
.awsui_tools-pagination_wih1l_16d38_132 + .awsui_tools-preferences_wih1l_16d38_132:not(#\9) {
|
|
133
133
|
border-left: var(--border-divider-section-width-g0ay3c, 2px) solid var(--color-border-divider-default-4spq70, #e9ebed);
|
|
134
134
|
box-sizing: border-box;
|
|
135
135
|
margin-left: var(--space-xs-inub5w, 8px);
|
|
136
136
|
padding-left: var(--space-xs-inub5w, 8px);
|
|
137
137
|
}
|
|
138
|
-
.awsui_tools-
|
|
138
|
+
.awsui_tools-small_wih1l_16d38_138 > .awsui_tools-filtering_wih1l_16d38_114:not(#\9) {
|
|
139
139
|
margin-right: 0;
|
|
140
140
|
margin-bottom: var(--space-scaled-xs-u0e7ft, 8px);
|
|
141
141
|
flex-basis: 100%;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
.
|
|
144
|
+
.awsui_table_wih1l_16d38_144:not(#\9) {
|
|
145
145
|
width: 100%;
|
|
146
146
|
border-spacing: 0;
|
|
147
147
|
position: relative;
|
|
148
148
|
box-sizing: border-box;
|
|
149
149
|
}
|
|
150
|
-
.awsui_table-layout-
|
|
150
|
+
.awsui_table-layout-fixed_wih1l_16d38_150:not(#\9) {
|
|
151
151
|
table-layout: fixed;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
.
|
|
154
|
+
.awsui_wrapper_wih1l_16d38_154:not(#\9) {
|
|
155
155
|
position: relative;
|
|
156
156
|
box-sizing: border-box;
|
|
157
157
|
width: 100%;
|
|
158
158
|
padding-top: var(--space-table-content-top-byyxhv, 12px);
|
|
159
159
|
padding-bottom: var(--space-table-content-bottom-5ikgmo, 4px);
|
|
160
160
|
overflow-x: auto;
|
|
161
|
+
scrollbar-width: none; /* Hide scrollbar in Firefox */
|
|
161
162
|
}
|
|
162
|
-
.
|
|
163
|
+
.awsui_wrapper_wih1l_16d38_154.awsui_variant-stacked_wih1l_16d38_163 > .awsui_table_wih1l_16d38_144:not(#\9), .awsui_wrapper_wih1l_16d38_154.awsui_variant-container_wih1l_16d38_163 > .awsui_table_wih1l_16d38_144:not(#\9) {
|
|
163
164
|
padding-left: var(--space-table-horizontal-nhrpfz, 20px);
|
|
164
165
|
padding-right: var(--space-table-horizontal-nhrpfz, 20px);
|
|
165
166
|
}
|
|
166
|
-
.
|
|
167
|
+
.awsui_wrapper_wih1l_16d38_154.awsui_variant-embedded_wih1l_16d38_167:not(#\9), .awsui_wrapper_wih1l_16d38_154.awsui_variant-borderless_wih1l_16d38_167:not(#\9) {
|
|
167
168
|
padding-bottom: var(--space-table-embedded-content-bottom-cw037k, 0px);
|
|
168
169
|
}
|
|
169
|
-
.
|
|
170
|
+
.awsui_wrapper_wih1l_16d38_154.awsui_has-header_wih1l_16d38_170:not(#\9) {
|
|
170
171
|
padding-top: 0px;
|
|
171
172
|
}
|
|
172
|
-
.
|
|
173
|
+
.awsui_wrapper_wih1l_16d38_154.awsui_has-footer_wih1l_16d38_173:not(#\9) {
|
|
173
174
|
padding-bottom: 0px;
|
|
174
175
|
}
|
|
175
|
-
.
|
|
176
|
+
.awsui_wrapper_wih1l_16d38_154:not(#\9):not(.awsui_has-header_wih1l_16d38_170) {
|
|
176
177
|
border-top-right-radius: var(--border-radius-container-b3z48i, 16px);
|
|
177
178
|
border-top-left-radius: var(--border-radius-container-b3z48i, 16px);
|
|
178
179
|
}
|
|
179
|
-
|
|
180
|
+
.awsui_wrapper_wih1l_16d38_154:not(#\9)::-webkit-scrollbar {
|
|
181
|
+
display: none; /* Hide scrollbar in Safari and Chrome */
|
|
182
|
+
}
|
|
183
|
+
body[data-awsui-focus-visible=true] .awsui_wrapper_wih1l_16d38_154:not(#\9):focus {
|
|
180
184
|
outline: 2px dotted transparent;
|
|
181
185
|
outline-offset: 2px;
|
|
182
186
|
border-radius: var(--border-radius-container-b3z48i, 16px);
|
|
183
187
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-nwfxo7, #0972d3);
|
|
184
188
|
}
|
|
185
189
|
|
|
186
|
-
.awsui_cell-
|
|
190
|
+
.awsui_cell-merged_wih1l_16d38_190:not(#\9) {
|
|
187
191
|
text-align: center;
|
|
188
192
|
padding: 0;
|
|
189
193
|
}
|
|
190
|
-
.awsui_cell-
|
|
194
|
+
.awsui_cell-merged_wih1l_16d38_190.awsui_has-footer_wih1l_16d38_173:not(#\9) {
|
|
191
195
|
/*
|
|
192
196
|
Add a bottom border to the body cell of an empty table as a separator between the
|
|
193
197
|
table and the footer
|
|
194
198
|
*/
|
|
195
199
|
border-bottom: var(--border-divider-section-width-g0ay3c, 2px) solid var(--color-border-divider-default-4spq70, #e9ebed);
|
|
196
200
|
}
|
|
197
|
-
.awsui_cell-merged-
|
|
201
|
+
.awsui_cell-merged-content_wih1l_16d38_201:not(#\9) {
|
|
198
202
|
box-sizing: border-box;
|
|
199
203
|
width: 100%;
|
|
200
204
|
padding: var(--space-scaled-m-9q5ipc, 16px) var(--space-l-ds615y, 20px) var(--space-scaled-l-x5pubp, 20px);
|
|
@@ -202,18 +206,18 @@ body[data-awsui-focus-visible=true] .awsui_wrapper_wih1l_6njvm_154:not(#\9):focu
|
|
|
202
206
|
/* stylelint-enable plugin/no-unsupported-browser-features */
|
|
203
207
|
}
|
|
204
208
|
@supports (position: sticky) {
|
|
205
|
-
.awsui_cell-merged-
|
|
209
|
+
.awsui_cell-merged-content_wih1l_16d38_201:not(#\9) {
|
|
206
210
|
position: sticky;
|
|
207
211
|
left: 0;
|
|
208
212
|
margin: 0 calc(-2 * var(--space-table-horizontal-nhrpfz, 20px));
|
|
209
213
|
}
|
|
210
214
|
}
|
|
211
215
|
|
|
212
|
-
.
|
|
216
|
+
.awsui_empty_wih1l_16d38_216:not(#\9) {
|
|
213
217
|
color: var(--color-text-empty-qnnj2s, #5f6b7a);
|
|
214
218
|
}
|
|
215
219
|
|
|
216
|
-
.
|
|
220
|
+
.awsui_loading_wih1l_16d38_220:not(#\9) {
|
|
217
221
|
/* used in test-utils */
|
|
218
222
|
}
|
|
219
223
|
|
|
@@ -222,45 +226,47 @@ The min/max/width token values in Visual Refresh should align
|
|
|
222
226
|
the table header and body cells selection control with the table
|
|
223
227
|
filter search icon.
|
|
224
228
|
*/
|
|
225
|
-
.awsui_selection-
|
|
229
|
+
.awsui_selection-control_wih1l_16d38_229:not(#\9) {
|
|
226
230
|
box-sizing: border-box;
|
|
227
231
|
max-width: var(--size-table-selection-horizontal-dshi7g, 40px);
|
|
228
232
|
min-width: var(--size-table-selection-horizontal-dshi7g, 40px);
|
|
229
233
|
position: relative;
|
|
230
234
|
width: var(--size-table-selection-horizontal-dshi7g, 40px);
|
|
231
235
|
}
|
|
232
|
-
.awsui_selection-
|
|
236
|
+
.awsui_selection-control_wih1l_16d38_229.awsui_selection-control-header_wih1l_16d38_236:not(#\9) {
|
|
233
237
|
padding: var(--space-scaled-xs-u0e7ft, 8px) var(--space-scaled-l-x5pubp, 20px);
|
|
234
238
|
border-left: var(--border-item-width-4pi0dw, 2px) solid transparent;
|
|
235
239
|
}
|
|
236
240
|
|
|
237
|
-
.awsui_sticky-
|
|
241
|
+
.awsui_sticky-scrollbar_wih1l_16d38_241:not(#\9) {
|
|
238
242
|
height: 15px;
|
|
239
|
-
position:
|
|
243
|
+
position: sticky;
|
|
240
244
|
display: none;
|
|
241
245
|
overflow-x: auto;
|
|
242
246
|
overflow-y: hidden;
|
|
243
|
-
margin-top: -15px;
|
|
244
247
|
bottom: 0;
|
|
245
248
|
width: 100%;
|
|
246
249
|
}
|
|
247
|
-
.awsui_sticky-scrollbar-
|
|
250
|
+
.awsui_sticky-scrollbar-content_wih1l_16d38_250:not(#\9) {
|
|
248
251
|
height: 15px;
|
|
249
252
|
}
|
|
250
|
-
.awsui_sticky-scrollbar-
|
|
253
|
+
.awsui_sticky-scrollbar-visible_wih1l_16d38_253:not(#\9) {
|
|
251
254
|
display: block;
|
|
252
255
|
}
|
|
256
|
+
.awsui_sticky-scrollbar-native-invisible_wih1l_16d38_256:not(#\9) {
|
|
257
|
+
margin-top: -15px;
|
|
258
|
+
}
|
|
253
259
|
|
|
254
260
|
/*
|
|
255
261
|
The dynamic height dark header needs a background that will cover
|
|
256
262
|
the default white background of the container component.
|
|
257
263
|
*/
|
|
258
|
-
.awsui_dark-
|
|
264
|
+
.awsui_dark-header_wih1l_16d38_264:not(#\9) {
|
|
259
265
|
background-color: var(--color-background-layout-main-iz43sl, #ffffff);
|
|
260
266
|
color: var(--color-text-body-default-01bwmw, #000716);
|
|
261
267
|
}
|
|
262
268
|
|
|
263
|
-
.awsui_header-
|
|
269
|
+
.awsui_header-secondary_wih1l_16d38_269:not(#\9) {
|
|
264
270
|
overflow: auto;
|
|
265
271
|
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
|
266
272
|
scrollbar-width: none; /* Firefox */
|
|
@@ -269,42 +275,42 @@ the default white background of the container component.
|
|
|
269
275
|
border-radius: 0;
|
|
270
276
|
background: var(--color-background-table-header-shne10, #ffffff);
|
|
271
277
|
}
|
|
272
|
-
.awsui_header-
|
|
278
|
+
.awsui_header-secondary_wih1l_16d38_269.awsui_variant-stacked_wih1l_16d38_163 > .awsui_table_wih1l_16d38_144:not(#\9), .awsui_header-secondary_wih1l_16d38_269.awsui_variant-container_wih1l_16d38_163 > .awsui_table_wih1l_16d38_144:not(#\9) {
|
|
273
279
|
padding-left: var(--space-table-horizontal-nhrpfz, 20px);
|
|
274
280
|
padding-right: var(--space-table-horizontal-nhrpfz, 20px);
|
|
275
281
|
}
|
|
276
|
-
.awsui_header-
|
|
282
|
+
.awsui_header-secondary_wih1l_16d38_269:not(#\9)::-webkit-scrollbar {
|
|
277
283
|
display: none; /* Safari and Chrome */
|
|
278
284
|
}
|
|
279
|
-
.awsui_header-
|
|
285
|
+
.awsui_header-secondary_wih1l_16d38_269.awsui_table-has-header_wih1l_16d38_285:not(#\9) {
|
|
280
286
|
border-top: var(--border-divider-list-width-fsy9j8, 1px) solid var(--color-border-container-divider-qsuvq6, transparent);
|
|
281
287
|
}
|
|
282
288
|
|
|
283
|
-
.awsui_header-
|
|
289
|
+
.awsui_header-controls_wih1l_16d38_289:not(#\9) {
|
|
284
290
|
padding-top: var(--space-container-header-vertical-gho8eg, 12px);
|
|
285
291
|
padding-bottom: var(--space-container-header-vertical-gho8eg, 12px);
|
|
286
292
|
}
|
|
287
|
-
.awsui_header-
|
|
293
|
+
.awsui_header-controls_wih1l_16d38_289.awsui_variant-stacked_wih1l_16d38_163:not(#\9), .awsui_header-controls_wih1l_16d38_289.awsui_variant-container_wih1l_16d38_163:not(#\9) {
|
|
288
294
|
padding-left: calc(var(--space-table-horizontal-nhrpfz, 20px) + var(--space-table-header-horizontal-jj2vbh, 0px));
|
|
289
295
|
padding-right: calc(var(--space-table-horizontal-nhrpfz, 20px) + var(--space-table-header-horizontal-jj2vbh, 0px));
|
|
290
296
|
}
|
|
291
|
-
.awsui_header-
|
|
297
|
+
.awsui_header-controls_wih1l_16d38_289.awsui_variant-embedded_wih1l_16d38_167:not(#\9), .awsui_header-controls_wih1l_16d38_289.awsui_variant-borderless_wih1l_16d38_167:not(#\9) {
|
|
292
298
|
padding-left: var(--space-table-header-horizontal-jj2vbh, 0px);
|
|
293
299
|
padding-right: var(--space-table-header-horizontal-jj2vbh, 0px);
|
|
294
300
|
padding-top: var(--space-table-embedded-header-top-8tml9f, 0px);
|
|
295
301
|
}
|
|
296
302
|
|
|
297
|
-
.awsui_footer-
|
|
303
|
+
.awsui_footer-wrapper_wih1l_16d38_303.awsui_variant-stacked_wih1l_16d38_163:not(#\9), .awsui_footer-wrapper_wih1l_16d38_303.awsui_variant-container_wih1l_16d38_163:not(#\9) {
|
|
298
304
|
padding-left: var(--space-table-horizontal-nhrpfz, 20px);
|
|
299
305
|
padding-right: var(--space-table-horizontal-nhrpfz, 20px);
|
|
300
306
|
}
|
|
301
307
|
|
|
302
|
-
.
|
|
308
|
+
.awsui_footer_wih1l_16d38_303:not(#\9) {
|
|
303
309
|
padding: var(--space-scaled-s-gczsk7, 12px) var(--space-table-footer-horizontal-ezw6u7, 0px);
|
|
304
310
|
}
|
|
305
311
|
|
|
306
|
-
.awsui_thead-
|
|
307
|
-
.
|
|
308
|
-
.awsui_row-
|
|
312
|
+
.awsui_thead-active_wih1l_16d38_312:not(#\9),
|
|
313
|
+
.awsui_row_wih1l_16d38_313:not(#\9),
|
|
314
|
+
.awsui_row-selected_wih1l_16d38_314:not(#\9) {
|
|
309
315
|
/* used in test-utils */
|
|
310
316
|
}
|
|
@@ -2,39 +2,40 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"tools": "
|
|
7
|
-
"tools-filtering": "awsui_tools-
|
|
8
|
-
"tools-align-right": "awsui_tools-align-
|
|
9
|
-
"tools-pagination": "awsui_tools-
|
|
10
|
-
"tools-preferences": "awsui_tools-
|
|
11
|
-
"tools-small": "awsui_tools-
|
|
12
|
-
"table": "
|
|
13
|
-
"table-layout-fixed": "awsui_table-layout-
|
|
14
|
-
"wrapper": "
|
|
15
|
-
"variant-stacked": "awsui_variant-
|
|
16
|
-
"variant-container": "awsui_variant-
|
|
17
|
-
"variant-embedded": "awsui_variant-
|
|
18
|
-
"variant-borderless": "awsui_variant-
|
|
19
|
-
"has-header": "awsui_has-
|
|
20
|
-
"has-footer": "awsui_has-
|
|
21
|
-
"cell-merged": "awsui_cell-
|
|
22
|
-
"cell-merged-content": "awsui_cell-merged-
|
|
23
|
-
"empty": "
|
|
24
|
-
"loading": "
|
|
25
|
-
"selection-control": "awsui_selection-
|
|
26
|
-
"selection-control-header": "awsui_selection-control-
|
|
27
|
-
"sticky-scrollbar": "awsui_sticky-
|
|
28
|
-
"sticky-scrollbar-content": "awsui_sticky-scrollbar-
|
|
29
|
-
"sticky-scrollbar-visible": "awsui_sticky-scrollbar-
|
|
30
|
-
"
|
|
31
|
-
"header
|
|
32
|
-
"
|
|
33
|
-
"header
|
|
34
|
-
"
|
|
35
|
-
"footer": "
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"row
|
|
5
|
+
"root": "awsui_root_wih1l_16d38_97",
|
|
6
|
+
"tools": "awsui_tools_wih1l_16d38_108",
|
|
7
|
+
"tools-filtering": "awsui_tools-filtering_wih1l_16d38_114",
|
|
8
|
+
"tools-align-right": "awsui_tools-align-right_wih1l_16d38_128",
|
|
9
|
+
"tools-pagination": "awsui_tools-pagination_wih1l_16d38_132",
|
|
10
|
+
"tools-preferences": "awsui_tools-preferences_wih1l_16d38_132",
|
|
11
|
+
"tools-small": "awsui_tools-small_wih1l_16d38_138",
|
|
12
|
+
"table": "awsui_table_wih1l_16d38_144",
|
|
13
|
+
"table-layout-fixed": "awsui_table-layout-fixed_wih1l_16d38_150",
|
|
14
|
+
"wrapper": "awsui_wrapper_wih1l_16d38_154",
|
|
15
|
+
"variant-stacked": "awsui_variant-stacked_wih1l_16d38_163",
|
|
16
|
+
"variant-container": "awsui_variant-container_wih1l_16d38_163",
|
|
17
|
+
"variant-embedded": "awsui_variant-embedded_wih1l_16d38_167",
|
|
18
|
+
"variant-borderless": "awsui_variant-borderless_wih1l_16d38_167",
|
|
19
|
+
"has-header": "awsui_has-header_wih1l_16d38_170",
|
|
20
|
+
"has-footer": "awsui_has-footer_wih1l_16d38_173",
|
|
21
|
+
"cell-merged": "awsui_cell-merged_wih1l_16d38_190",
|
|
22
|
+
"cell-merged-content": "awsui_cell-merged-content_wih1l_16d38_201",
|
|
23
|
+
"empty": "awsui_empty_wih1l_16d38_216",
|
|
24
|
+
"loading": "awsui_loading_wih1l_16d38_220",
|
|
25
|
+
"selection-control": "awsui_selection-control_wih1l_16d38_229",
|
|
26
|
+
"selection-control-header": "awsui_selection-control-header_wih1l_16d38_236",
|
|
27
|
+
"sticky-scrollbar": "awsui_sticky-scrollbar_wih1l_16d38_241",
|
|
28
|
+
"sticky-scrollbar-content": "awsui_sticky-scrollbar-content_wih1l_16d38_250",
|
|
29
|
+
"sticky-scrollbar-visible": "awsui_sticky-scrollbar-visible_wih1l_16d38_253",
|
|
30
|
+
"sticky-scrollbar-native-invisible": "awsui_sticky-scrollbar-native-invisible_wih1l_16d38_256",
|
|
31
|
+
"dark-header": "awsui_dark-header_wih1l_16d38_264",
|
|
32
|
+
"header-secondary": "awsui_header-secondary_wih1l_16d38_269",
|
|
33
|
+
"table-has-header": "awsui_table-has-header_wih1l_16d38_285",
|
|
34
|
+
"header-controls": "awsui_header-controls_wih1l_16d38_289",
|
|
35
|
+
"footer-wrapper": "awsui_footer-wrapper_wih1l_16d38_303",
|
|
36
|
+
"footer": "awsui_footer_wih1l_16d38_303",
|
|
37
|
+
"thead-active": "awsui_thead-active_wih1l_16d38_312",
|
|
38
|
+
"row": "awsui_row_wih1l_16d38_313",
|
|
39
|
+
"row-selected": "awsui_row-selected_wih1l_16d38_314"
|
|
39
40
|
};
|
|
40
41
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
+
export declare const updatePosition: (tableEl: HTMLElement | null, wrapperEl: HTMLElement | null, scrollbarEl: HTMLElement | null, scrollbarContentEl: HTMLElement | null, hasContainingBlock: boolean, consideredFooterHeight: number) => void;
|
|
2
3
|
export declare function useStickyScrollbar(scrollbarRef: RefObject<HTMLDivElement>, scrollbarContentRef: RefObject<HTMLDivElement>, tableRef: RefObject<HTMLTableElement>, wrapperRef: RefObject<HTMLDivElement>, footerHeight: number): void;
|
|
3
4
|
//# sourceMappingURL=use-sticky-scrollbar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-sticky-scrollbar.d.ts","sourceRoot":"lib/default/","sources":["table/use-sticky-scrollbar.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"use-sticky-scrollbar.d.ts","sourceRoot":"lib/default/","sources":["table/use-sticky-scrollbar.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAC;AAOvD,eAAO,MAAM,cAAc,YAChB,WAAW,GAAG,IAAI,aAChB,WAAW,GAAG,IAAI,eAChB,WAAW,GAAG,IAAI,sBACX,WAAW,GAAG,IAAI,sBAClB,OAAO,0BACH,MAAM,SA8C/B,CAAC;AAEF,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,EACvC,mBAAmB,EAAE,SAAS,CAAC,cAAc,CAAC,EAC9C,QAAQ,EAAE,SAAS,CAAC,gBAAgB,CAAC,EACrC,UAAU,EAAE,SAAS,CAAC,cAAc,CAAC,EACrC,YAAY,EAAE,MAAM,QAiErB"}
|
|
@@ -3,33 +3,19 @@
|
|
|
3
3
|
import { ResizeObserver } from '@juggle/resize-observer';
|
|
4
4
|
import { useEffect, useState } from 'react';
|
|
5
5
|
import styles from './styles.css.js';
|
|
6
|
-
import {
|
|
6
|
+
import { getOverflowParents } from '../internal/utils/scrollable-containers';
|
|
7
7
|
import { browserScrollbarSize } from '../internal/utils/browser-scrollbar-size';
|
|
8
8
|
import { supportsStickyPosition, getContainingBlock } from '../internal/utils/dom';
|
|
9
|
-
const updatePosition = (tableEl, wrapperEl, scrollbarEl, scrollbarContentEl, hasContainingBlock, consideredFooterHeight) => {
|
|
9
|
+
export const updatePosition = (tableEl, wrapperEl, scrollbarEl, scrollbarContentEl, hasContainingBlock, consideredFooterHeight) => {
|
|
10
10
|
if (!tableEl || !scrollbarEl || !wrapperEl) {
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
const parent = getOverflowParentDimensions(wrapperEl)[0];
|
|
15
|
-
const parentBottom = parent.top + parent.height;
|
|
16
|
-
// table bottom is visible when
|
|
17
|
-
// 1. table bottom reached end of the window
|
|
18
|
-
// 2. table bottom is not overlapped by footer
|
|
19
|
-
const { top: tableTop, bottom: tableBottom, width: tableWidth } = tableEl.getBoundingClientRect();
|
|
13
|
+
const { width: tableWidth } = tableEl.getBoundingClientRect();
|
|
20
14
|
const { width: wrapperWidth } = wrapperEl.getBoundingClientRect();
|
|
21
|
-
//scrollbar correction is needed for
|
|
22
|
-
// #1 when scrollbars are constantly visible,
|
|
23
|
-
// we want no visible break when switching between fake and real scrollbars
|
|
24
|
-
// #2 when scrollbars are visible only on scrolling and half transparent (on mac)
|
|
25
|
-
// we want to avoid any overlap between fake and real scrollbar
|
|
26
15
|
// using 15 px as a height of transparent scrollbar on mac
|
|
27
16
|
const scrollbarHeight = browserScrollbarSize().height;
|
|
28
|
-
const scrollBarCorrection = scrollbarHeight > 0 ? scrollbarHeight : -15 / 2;
|
|
29
|
-
const tableBottomIsVisible = parentBottom - consideredFooterHeight >= tableBottom + scrollBarCorrection;
|
|
30
|
-
const tableTopIsHidden = tableTop >= parentBottom - consideredFooterHeight - scrollBarCorrection;
|
|
31
17
|
const areaIsScrollable = tableWidth > wrapperWidth;
|
|
32
|
-
if (
|
|
18
|
+
if (!areaIsScrollable) {
|
|
33
19
|
scrollbarEl.classList.remove(styles['sticky-scrollbar-visible']);
|
|
34
20
|
}
|
|
35
21
|
else {
|
|
@@ -41,23 +27,23 @@ const updatePosition = (tableEl, wrapperEl, scrollbarEl, scrollbarContentEl, has
|
|
|
41
27
|
});
|
|
42
28
|
}
|
|
43
29
|
scrollbarEl.classList.add(styles['sticky-scrollbar-visible']);
|
|
30
|
+
if (!scrollbarHeight) {
|
|
31
|
+
/* istanbul ignore next: covered by screenshot tests */
|
|
32
|
+
scrollbarEl.classList.add(styles['sticky-scrollbar-native-invisible']);
|
|
33
|
+
}
|
|
44
34
|
}
|
|
45
35
|
if (scrollbarHeight && scrollbarEl && scrollbarContentEl) {
|
|
46
36
|
scrollbarEl.style.height = `${scrollbarHeight}px`;
|
|
47
37
|
scrollbarContentEl.style.height = `${scrollbarHeight}px`;
|
|
48
38
|
}
|
|
49
39
|
if (tableEl && wrapperEl && scrollbarContentEl && scrollbarEl) {
|
|
50
|
-
const parent = getOverflowParentDimensions(wrapperEl)[0];
|
|
51
40
|
const wrapperElRect = wrapperEl.getBoundingClientRect();
|
|
52
41
|
const tableElRect = tableEl.getBoundingClientRect();
|
|
53
42
|
scrollbarEl.style.width = `${wrapperElRect.width}px`;
|
|
54
43
|
scrollbarContentEl.style.width = `${tableElRect.width}px`;
|
|
55
44
|
// when using sticky scrollbars in containers
|
|
56
45
|
// we agreed to ignore dynamic bottom calculations for footer overlap
|
|
57
|
-
scrollbarEl.style.
|
|
58
|
-
scrollbarEl.style.top = hasContainingBlock
|
|
59
|
-
? '0px'
|
|
60
|
-
: `${Math.min(parent.top + parent.height, window.innerHeight - consideredFooterHeight)}px`;
|
|
46
|
+
scrollbarEl.style.bottom = hasContainingBlock ? '0px' : `${consideredFooterHeight}px`;
|
|
61
47
|
}
|
|
62
48
|
};
|
|
63
49
|
export function useStickyScrollbar(scrollbarRef, scrollbarContentRef, tableRef, wrapperRef, footerHeight) {
|
|
@@ -70,19 +56,6 @@ export function useStickyScrollbar(scrollbarRef, scrollbarContentRef, tableRef,
|
|
|
70
56
|
// Because in this case, we think the footer is outside the overflow parent.
|
|
71
57
|
const [hasOverflowParent, setHasOverflowParent] = useState(false);
|
|
72
58
|
const consideredFooterHeight = hasContainingBlock || hasOverflowParent ? 0 : footerHeight;
|
|
73
|
-
// Update scrollbar position on window scroll.
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
if (supportsStickyPosition()) {
|
|
76
|
-
const scrollHandler = () => {
|
|
77
|
-
updatePosition(tableRef.current, wrapperRef.current, scrollbarRef.current, scrollbarContentRef.current, hasContainingBlock, consideredFooterHeight);
|
|
78
|
-
};
|
|
79
|
-
scrollHandler();
|
|
80
|
-
window.addEventListener('scroll', scrollHandler, true);
|
|
81
|
-
return () => {
|
|
82
|
-
window.removeEventListener('scroll', scrollHandler, true);
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
}, [scrollbarRef, tableRef, wrapperRef, consideredFooterHeight, scrollbarContentRef, hasContainingBlock]);
|
|
86
59
|
const wrapperEl = wrapperRef.current;
|
|
87
60
|
useEffect(() => {
|
|
88
61
|
if (wrapperEl && supportsStickyPosition()) {
|
|
@@ -113,6 +86,7 @@ export function useStickyScrollbar(scrollbarRef, scrollbarContentRef, tableRef,
|
|
|
113
86
|
const resizeHandler = () => {
|
|
114
87
|
updatePosition(tableRef.current, wrapperRef.current, scrollbarRef.current, scrollbarContentRef.current, hasContainingBlock, consideredFooterHeight);
|
|
115
88
|
};
|
|
89
|
+
resizeHandler();
|
|
116
90
|
window.addEventListener('resize', resizeHandler);
|
|
117
91
|
return () => {
|
|
118
92
|
window.removeEventListener('resize', resizeHandler);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-sticky-scrollbar.js","sourceRoot":"lib/default/","sources":["table/use-sticky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,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;YACnC,OAAO,GAAG,EAAE;gBACV,QAAQ,CAAC,UAAU,EAAE,CAAC;YACxB,CAAC,CAAC;SACH;IACH,CAAC,EAAE,CAAC,mBAAmB,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,sBAAsB,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAE1G,8DAA8D;IAC9D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,sBAAsB,EAAE,EAAE;YAC5B,MAAM,aAAa,GAAG,GAAG,EAAE;gBACzB,cAAc,CACZ,QAAQ,CAAC,OAAO,EAChB,UAAU,CAAC,OAAO,EAClB,YAAY,CAAC,OAAO,EACpB,mBAAmB,CAAC,OAAO,EAC3B,kBAAkB,EAClB,sBAAsB,CACvB,CAAC;YACJ,CAAC,CAAC;YACF,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;YACjD,OAAO,GAAG,EAAE;gBACV,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;YACtD,CAAC,CAAC;SACH;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,sBAAsB,CAAC,CAAC,CAAC;AAC5G,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ResizeObserver } from '@juggle/resize-observer';\nimport { RefObject, useEffect, useState } from 'react';\nimport styles from './styles.css.js';\n\nimport { getOverflowParentDimensions, getOverflowParents } from '../internal/utils/scrollable-containers';\nimport { browserScrollbarSize } from '../internal/utils/browser-scrollbar-size';\nimport { supportsStickyPosition, getContainingBlock } from '../internal/utils/dom';\n\nconst updatePosition = (\n tableEl: HTMLElement | null,\n wrapperEl: HTMLElement | null,\n scrollbarEl: HTMLElement | null,\n scrollbarContentEl: HTMLElement | null,\n hasContainingBlock: boolean,\n consideredFooterHeight: number\n) => {\n if (!tableEl || !scrollbarEl || !wrapperEl) {\n return;\n }\n\n // parent is either some container or document itself\n const parent = getOverflowParentDimensions(wrapperEl)[0];\n const parentBottom = parent.top + parent.height;\n\n // table bottom is visible when\n // 1. table bottom reached end of the window\n // 2. table bottom is not overlapped by footer\n const { top: tableTop, bottom: tableBottom, width: tableWidth } = tableEl.getBoundingClientRect();\n const { width: wrapperWidth } = wrapperEl.getBoundingClientRect();\n\n //scrollbar correction is needed for\n // #1 when scrollbars are constantly visible,\n // we want no visible break when switching between fake and real scrollbars\n // #2 when scrollbars are visible only on scrolling and half transparent (on mac)\n // we want to avoid any overlap between fake and real scrollbar\n // using 15 px as a height of transparent scrollbar on mac\n const scrollbarHeight = browserScrollbarSize().height;\n const scrollBarCorrection = scrollbarHeight > 0 ? scrollbarHeight : -15 / 2;\n const tableBottomIsVisible = parentBottom - consideredFooterHeight >= tableBottom + scrollBarCorrection;\n const tableTopIsHidden = tableTop >= parentBottom - consideredFooterHeight - scrollBarCorrection;\n const areaIsScrollable = tableWidth > wrapperWidth;\n\n if (tableBottomIsVisible || tableTopIsHidden || !areaIsScrollable) {\n scrollbarEl.classList.remove(styles['sticky-scrollbar-visible']);\n } else {\n // when scrollbar is not displayed scrollLeft property cannot be set by useScrollSync\n // that's why syncing it separately\n if (!scrollbarEl.classList.contains(styles['sticky-scrollbar-visible'])) {\n requestAnimationFrame(() => {\n scrollbarEl.scrollLeft = wrapperEl.scrollLeft;\n });\n }\n\n scrollbarEl.classList.add(styles['sticky-scrollbar-visible']);\n }\n\n if (scrollbarHeight && scrollbarEl && scrollbarContentEl) {\n scrollbarEl.style.height = `${scrollbarHeight}px`;\n scrollbarContentEl.style.height = `${scrollbarHeight}px`;\n }\n\n if (tableEl && wrapperEl && scrollbarContentEl && scrollbarEl) {\n const parent = getOverflowParentDimensions(wrapperEl)[0];\n\n const wrapperElRect = wrapperEl.getBoundingClientRect();\n const tableElRect = tableEl.getBoundingClientRect();\n scrollbarEl.style.width = `${wrapperElRect.width}px`;\n scrollbarContentEl.style.width = `${tableElRect.width}px`;\n\n // when using sticky scrollbars in containers\n // we agreed to ignore dynamic bottom calculations for footer overlap\n scrollbarEl.style.left = hasContainingBlock ? '0px' : `${wrapperElRect.left}px`;\n scrollbarEl.style.top = hasContainingBlock\n ? '0px'\n : `${Math.min(parent.top + parent.height, window.innerHeight - consideredFooterHeight)}px`;\n }\n};\n\nexport function useStickyScrollbar(\n scrollbarRef: RefObject<HTMLDivElement>,\n scrollbarContentRef: RefObject<HTMLDivElement>,\n tableRef: RefObject<HTMLTableElement>,\n wrapperRef: RefObject<HTMLDivElement>,\n footerHeight: number\n) {\n // We don't take into account containing-block calculations because that would\n // unnecessarily overcomplicate the position logic. For now, we assume that a\n // containing block, if present, is below the app layout and above the overflow\n // parent, which is a pretty safe assumption.\n const [hasContainingBlock, setHasContainingBlock] = useState(false);\n // We don't take into account footer height when the overflow parent is child of document body.\n // Because in this case, we think the footer is outside the overflow parent.\n const [hasOverflowParent, setHasOverflowParent] = useState(false);\n const consideredFooterHeight = hasContainingBlock || hasOverflowParent ? 0 : footerHeight;\n\n // Update scrollbar position on window scroll.\n useEffect(() => {\n if (supportsStickyPosition()) {\n const scrollHandler = () => {\n updatePosition(\n tableRef.current,\n wrapperRef.current,\n scrollbarRef.current,\n scrollbarContentRef.current,\n hasContainingBlock,\n consideredFooterHeight\n );\n };\n scrollHandler();\n window.addEventListener('scroll', scrollHandler, true);\n return () => {\n window.removeEventListener('scroll', scrollHandler, true);\n };\n }\n }, [scrollbarRef, tableRef, wrapperRef, consideredFooterHeight, scrollbarContentRef, hasContainingBlock]);\n\n const wrapperEl = wrapperRef.current;\n useEffect(() => {\n if (wrapperEl && supportsStickyPosition()) {\n setHasContainingBlock(!!getContainingBlock(wrapperEl));\n setHasOverflowParent(!!getOverflowParents(wrapperEl)[0]);\n }\n }, [wrapperEl]);\n\n // Update scrollbar position wrapper or table size change.\n useEffect(() => {\n if (supportsStickyPosition() && wrapperRef.current && tableRef.current) {\n const observer = new ResizeObserver(() => {\n if (scrollbarContentRef.current) {\n updatePosition(\n tableRef.current,\n wrapperRef.current,\n scrollbarRef.current,\n scrollbarContentRef.current,\n hasContainingBlock,\n consideredFooterHeight\n );\n }\n });\n // Scrollbar width must be in sync with wrapper width.\n observer.observe(wrapperRef.current);\n // Scrollbar content width must be in sync with table width.\n observer.observe(tableRef.current);\n return () => {\n observer.disconnect();\n };\n }\n }, [scrollbarContentRef, scrollbarRef, tableRef, wrapperRef, consideredFooterHeight, hasContainingBlock]);\n\n // Update scrollbar position when window resizes (vertically).\n useEffect(() => {\n if (supportsStickyPosition()) {\n const resizeHandler = () => {\n updatePosition(\n tableRef.current,\n wrapperRef.current,\n scrollbarRef.current,\n scrollbarContentRef.current,\n hasContainingBlock,\n consideredFooterHeight\n );\n };\n window.addEventListener('resize', resizeHandler);\n return () => {\n window.removeEventListener('resize', resizeHandler);\n };\n }\n }, [tableRef, wrapperRef, scrollbarRef, scrollbarContentRef, hasContainingBlock, consideredFooterHeight]);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"use-sticky-scrollbar.js","sourceRoot":"lib/default/","sources":["table/use-sticky-scrollbar.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAa,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAChF,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEnF,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,OAA2B,EAC3B,SAA6B,EAC7B,WAA+B,EAC/B,kBAAsC,EACtC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,CAAC,CAAC;YACtD,CAAC,CAAC;SACH;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,sBAAsB,CAAC,CAAC,CAAC;AAC5G,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ResizeObserver } from '@juggle/resize-observer';\nimport { RefObject, useEffect, useState } from 'react';\nimport styles from './styles.css.js';\n\nimport { getOverflowParents } from '../internal/utils/scrollable-containers';\nimport { browserScrollbarSize } from '../internal/utils/browser-scrollbar-size';\nimport { supportsStickyPosition, getContainingBlock } from '../internal/utils/dom';\n\nexport const updatePosition = (\n tableEl: HTMLElement | null,\n wrapperEl: HTMLElement | null,\n scrollbarEl: HTMLElement | null,\n scrollbarContentEl: HTMLElement | null,\n hasContainingBlock: boolean,\n consideredFooterHeight: number\n) => {\n if (!tableEl || !scrollbarEl || !wrapperEl) {\n return;\n }\n\n const { width: tableWidth } = tableEl.getBoundingClientRect();\n const { width: wrapperWidth } = wrapperEl.getBoundingClientRect();\n\n // using 15 px as a height of transparent scrollbar on mac\n const scrollbarHeight = browserScrollbarSize().height;\n const areaIsScrollable = tableWidth > wrapperWidth;\n\n if (!areaIsScrollable) {\n scrollbarEl.classList.remove(styles['sticky-scrollbar-visible']);\n } else {\n // when scrollbar is not displayed scrollLeft property cannot be set by useScrollSync\n // that's why syncing it separately\n if (!scrollbarEl.classList.contains(styles['sticky-scrollbar-visible'])) {\n requestAnimationFrame(() => {\n scrollbarEl.scrollLeft = wrapperEl.scrollLeft;\n });\n }\n\n scrollbarEl.classList.add(styles['sticky-scrollbar-visible']);\n if (!scrollbarHeight) {\n /* istanbul ignore next: covered by screenshot tests */\n scrollbarEl.classList.add(styles['sticky-scrollbar-native-invisible']);\n }\n }\n\n if (scrollbarHeight && scrollbarEl && scrollbarContentEl) {\n scrollbarEl.style.height = `${scrollbarHeight}px`;\n scrollbarContentEl.style.height = `${scrollbarHeight}px`;\n }\n\n if (tableEl && wrapperEl && scrollbarContentEl && scrollbarEl) {\n const wrapperElRect = wrapperEl.getBoundingClientRect();\n const tableElRect = tableEl.getBoundingClientRect();\n scrollbarEl.style.width = `${wrapperElRect.width}px`;\n scrollbarContentEl.style.width = `${tableElRect.width}px`;\n\n // when using sticky scrollbars in containers\n // we agreed to ignore dynamic bottom calculations for footer overlap\n scrollbarEl.style.bottom = hasContainingBlock ? '0px' : `${consideredFooterHeight}px`;\n }\n};\n\nexport function useStickyScrollbar(\n scrollbarRef: RefObject<HTMLDivElement>,\n scrollbarContentRef: RefObject<HTMLDivElement>,\n tableRef: RefObject<HTMLTableElement>,\n wrapperRef: RefObject<HTMLDivElement>,\n footerHeight: number\n) {\n // We don't take into account containing-block calculations because that would\n // unnecessarily overcomplicate the position logic. For now, we assume that a\n // containing block, if present, is below the app layout and above the overflow\n // parent, which is a pretty safe assumption.\n const [hasContainingBlock, setHasContainingBlock] = useState(false);\n // We don't take into account footer height when the overflow parent is child of document body.\n // Because in this case, we think the footer is outside the overflow parent.\n const [hasOverflowParent, setHasOverflowParent] = useState(false);\n const consideredFooterHeight = hasContainingBlock || hasOverflowParent ? 0 : footerHeight;\n\n const wrapperEl = wrapperRef.current;\n useEffect(() => {\n if (wrapperEl && supportsStickyPosition()) {\n setHasContainingBlock(!!getContainingBlock(wrapperEl));\n setHasOverflowParent(!!getOverflowParents(wrapperEl)[0]);\n }\n }, [wrapperEl]);\n\n // Update scrollbar position wrapper or table size change.\n useEffect(() => {\n if (supportsStickyPosition() && wrapperRef.current && tableRef.current) {\n const observer = new ResizeObserver(() => {\n if (scrollbarContentRef.current) {\n updatePosition(\n tableRef.current,\n wrapperRef.current,\n scrollbarRef.current,\n scrollbarContentRef.current,\n hasContainingBlock,\n consideredFooterHeight\n );\n }\n });\n // Scrollbar width must be in sync with wrapper width.\n observer.observe(wrapperRef.current);\n // Scrollbar content width must be in sync with table width.\n observer.observe(tableRef.current);\n return () => {\n observer.disconnect();\n };\n }\n }, [scrollbarContentRef, scrollbarRef, tableRef, wrapperRef, consideredFooterHeight, hasContainingBlock]);\n\n // Update scrollbar position when window resizes (vertically).\n useEffect(() => {\n if (supportsStickyPosition()) {\n const resizeHandler = () => {\n updatePosition(\n tableRef.current,\n wrapperRef.current,\n scrollbarRef.current,\n scrollbarContentRef.current,\n hasContainingBlock,\n consideredFooterHeight\n );\n };\n resizeHandler();\n window.addEventListener('resize', resizeHandler);\n return () => {\n window.removeEventListener('resize', resizeHandler);\n };\n }\n }, [tableRef, wrapperRef, scrollbarRef, scrollbarContentRef, hasContainingBlock, consideredFooterHeight]);\n}\n"]}
|
package/tabs/interfaces.d.ts
CHANGED
|
@@ -97,11 +97,11 @@ export declare namespace TabsProps {
|
|
|
97
97
|
/**
|
|
98
98
|
* ARIA label for the scroll left button that appears when the tab header is wider than the container.
|
|
99
99
|
*/
|
|
100
|
-
scrollLeftAriaLabel
|
|
100
|
+
scrollLeftAriaLabel?: string;
|
|
101
101
|
/**
|
|
102
102
|
* ARIA label for the scroll right button that appears when the tab header is wider than the container.
|
|
103
103
|
*/
|
|
104
|
-
scrollRightAriaLabel
|
|
104
|
+
scrollRightAriaLabel?: string;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
//# sourceMappingURL=interfaces.d.ts.map
|
package/tabs/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["tabs/interfaces.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,SAAU,SAAQ,kBAAkB;IACnD;;;;;;;;;;;;OAYG;IACH,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAEnC;;;;;;OAMG;IACH,OAA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