@cloudscape-design/components 3.0.1307 → 3.0.1309

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.
Files changed (187) hide show
  1. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.d.ts.map +1 -1
  2. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js +4 -2
  3. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map +1 -1
  4. package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.d.ts.map +1 -1
  5. package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js +4 -2
  6. package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map +1 -1
  7. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
  8. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +3 -2
  9. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
  10. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.d.ts.map +1 -1
  11. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js +2 -2
  12. package/app-layout/visual-refresh-toolbar/drawer/local-drawer.js.map +1 -1
  13. package/app-layout/visual-refresh-toolbar/interfaces.d.ts +1 -0
  14. package/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
  15. package/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
  16. package/app-layout/visual-refresh-toolbar/state/use-app-layout.d.ts.map +1 -1
  17. package/app-layout/visual-refresh-toolbar/state/use-app-layout.js +12 -1
  18. package/app-layout/visual-refresh-toolbar/state/use-app-layout.js.map +1 -1
  19. package/badge/styles.css.js +10 -10
  20. package/badge/styles.scoped.css +29 -16
  21. package/badge/styles.selectors.js +10 -10
  22. package/collection-preferences/content-display/content-display-option.js +1 -1
  23. package/collection-preferences/content-display/content-display-option.js.map +1 -1
  24. package/collection-preferences/content-display/index.d.ts +3 -7
  25. package/collection-preferences/content-display/index.d.ts.map +1 -1
  26. package/collection-preferences/content-display/index.js +63 -27
  27. package/collection-preferences/content-display/index.js.map +1 -1
  28. package/collection-preferences/content-display/utils.d.ts +41 -2
  29. package/collection-preferences/content-display/utils.d.ts.map +1 -1
  30. package/collection-preferences/content-display/utils.js +107 -13
  31. package/collection-preferences/content-display/utils.js.map +1 -1
  32. package/collection-preferences/index.d.ts.map +1 -1
  33. package/collection-preferences/index.js +2 -2
  34. package/collection-preferences/index.js.map +1 -1
  35. package/collection-preferences/interfaces.d.ts +30 -2
  36. package/collection-preferences/interfaces.d.ts.map +1 -1
  37. package/collection-preferences/interfaces.js.map +1 -1
  38. package/collection-preferences/styles.css.js +38 -36
  39. package/collection-preferences/styles.scoped.css +81 -37
  40. package/collection-preferences/styles.selectors.js +38 -36
  41. package/collection-preferences/utils.d.ts +1 -0
  42. package/collection-preferences/utils.d.ts.map +1 -1
  43. package/collection-preferences/utils.js +14 -0
  44. package/collection-preferences/utils.js.map +1 -1
  45. package/expandable-section/styles.css.js +35 -35
  46. package/expandable-section/styles.scoped.css +68 -68
  47. package/expandable-section/styles.selectors.js +35 -35
  48. package/i18n/messages/all.all.js +1 -1
  49. package/i18n/messages/all.all.json +1 -1
  50. package/i18n/messages/all.en.js +1 -1
  51. package/i18n/messages/all.en.json +1 -1
  52. package/i18n/messages-types.d.ts +4 -0
  53. package/i18n/messages-types.d.ts.map +1 -1
  54. package/i18n/messages-types.js.map +1 -1
  55. package/icon/interfaces.d.ts +1 -1
  56. package/icon/interfaces.d.ts.map +1 -1
  57. package/icon/interfaces.js.map +1 -1
  58. package/icon/internal.js +2 -2
  59. package/icon/internal.js.map +1 -1
  60. package/icon/styles.css.js +41 -39
  61. package/icon/styles.scoped.css +104 -85
  62. package/icon/styles.selectors.js +41 -39
  63. package/internal/base-component/styles.scoped.css +35 -3
  64. package/internal/environment.js +2 -2
  65. package/internal/environment.json +2 -2
  66. package/internal/generated/styles/tokens.d.ts +23 -1
  67. package/internal/generated/styles/tokens.js +23 -1
  68. package/internal/generated/theming/index.cjs +476 -4
  69. package/internal/generated/theming/index.cjs.d.ts +216 -0
  70. package/internal/generated/theming/index.d.ts +216 -0
  71. package/internal/generated/theming/index.js +476 -4
  72. package/internal/hooks/use-width-change/index.d.ts +12 -0
  73. package/internal/hooks/use-width-change/index.d.ts.map +1 -0
  74. package/internal/hooks/use-width-change/index.js +33 -0
  75. package/internal/hooks/use-width-change/index.js.map +1 -0
  76. package/internal/manifest.json +1 -1
  77. package/manifest.json +2 -2
  78. package/package.json +1 -1
  79. package/pagination/internal.d.ts.map +1 -1
  80. package/pagination/internal.js +4 -1
  81. package/pagination/internal.js.map +1 -1
  82. package/prompt-input/internal.d.ts.map +1 -1
  83. package/prompt-input/internal.js +9 -2
  84. package/prompt-input/internal.js.map +1 -1
  85. package/prompt-input/tokens/use-token-mode.d.ts.map +1 -1
  86. package/prompt-input/tokens/use-token-mode.js +0 -9
  87. package/prompt-input/tokens/use-token-mode.js.map +1 -1
  88. package/table/column-groups/col-group.d.ts +12 -0
  89. package/table/column-groups/col-group.d.ts.map +1 -0
  90. package/table/column-groups/col-group.js +24 -0
  91. package/table/column-groups/col-group.js.map +1 -0
  92. package/table/column-groups/split-utils.d.ts +31 -0
  93. package/table/column-groups/split-utils.d.ts.map +1 -0
  94. package/table/column-groups/split-utils.js +43 -0
  95. package/table/column-groups/split-utils.js.map +1 -0
  96. package/table/column-groups/use-column-groups.d.ts +7 -0
  97. package/table/column-groups/use-column-groups.d.ts.map +1 -0
  98. package/table/column-groups/use-column-groups.js +23 -0
  99. package/table/column-groups/use-column-groups.js.map +1 -0
  100. package/table/column-groups/utils.d.ts +54 -0
  101. package/table/column-groups/utils.d.ts.map +1 -0
  102. package/table/column-groups/utils.js +204 -0
  103. package/table/column-groups/utils.js.map +1 -0
  104. package/table/header-cell/common-props.d.ts +23 -0
  105. package/table/header-cell/common-props.d.ts.map +1 -0
  106. package/table/header-cell/common-props.js +4 -0
  107. package/table/header-cell/common-props.js.map +1 -0
  108. package/table/header-cell/group-header-cell.d.ts +45 -0
  109. package/table/header-cell/group-header-cell.d.ts.map +1 -0
  110. package/table/header-cell/group-header-cell.js +44 -0
  111. package/table/header-cell/group-header-cell.js.map +1 -0
  112. package/table/header-cell/index.d.ts +12 -22
  113. package/table/header-cell/index.d.ts.map +1 -1
  114. package/table/header-cell/index.js +3 -3
  115. package/table/header-cell/index.js.map +1 -1
  116. package/table/header-cell/styles.css.js +33 -30
  117. package/table/header-cell/styles.scoped.css +92 -68
  118. package/table/header-cell/styles.selectors.js +33 -30
  119. package/table/header-cell/th-element.d.ts +16 -0
  120. package/table/header-cell/th-element.d.ts.map +1 -1
  121. package/table/header-cell/th-element.js +6 -4
  122. package/table/header-cell/th-element.js.map +1 -1
  123. package/table/index.d.ts.map +1 -1
  124. package/table/index.js +5 -2
  125. package/table/index.js.map +1 -1
  126. package/table/interfaces.d.ts +37 -1
  127. package/table/interfaces.d.ts.map +1 -1
  128. package/table/interfaces.js.map +1 -1
  129. package/table/internal.d.ts.map +1 -1
  130. package/table/internal.js +17 -5
  131. package/table/internal.js.map +1 -1
  132. package/table/resizer/index.d.ts +9 -2
  133. package/table/resizer/index.d.ts.map +1 -1
  134. package/table/resizer/index.js +5 -5
  135. package/table/resizer/index.js.map +1 -1
  136. package/table/resizer/styles.css.js +16 -13
  137. package/table/resizer/styles.scoped.css +36 -26
  138. package/table/resizer/styles.selectors.js +16 -13
  139. package/table/sticky-header.d.ts +3 -0
  140. package/table/sticky-header.d.ts.map +1 -1
  141. package/table/sticky-header.js +7 -2
  142. package/table/sticky-header.js.map +1 -1
  143. package/table/sticky-scrolling.d.ts.map +1 -1
  144. package/table/sticky-scrolling.js +6 -1
  145. package/table/sticky-scrolling.js.map +1 -1
  146. package/table/styles.css.js +35 -34
  147. package/table/styles.scoped.css +47 -41
  148. package/table/styles.selectors.js +35 -34
  149. package/table/table-role/grid-navigation.d.ts.map +1 -1
  150. package/table/table-role/grid-navigation.js +5 -7
  151. package/table/table-role/grid-navigation.js.map +1 -1
  152. package/table/table-role/table-role-helper.d.ts +3 -0
  153. package/table/table-role/table-role-helper.d.ts.map +1 -1
  154. package/table/table-role/table-role-helper.js +9 -4
  155. package/table/table-role/table-role-helper.js.map +1 -1
  156. package/table/table-role/utils.d.ts +19 -0
  157. package/table/table-role/utils.d.ts.map +1 -1
  158. package/table/table-role/utils.js +86 -7
  159. package/table/table-role/utils.js.map +1 -1
  160. package/table/thead.d.ts +5 -0
  161. package/table/thead.d.ts.map +1 -1
  162. package/table/thead.js +145 -18
  163. package/table/thead.js.map +1 -1
  164. package/table/use-column-widths.d.ts +4 -0
  165. package/table/use-column-widths.d.ts.map +1 -1
  166. package/table/use-column-widths.js +68 -18
  167. package/table/use-column-widths.js.map +1 -1
  168. package/table/use-sticky-header.d.ts.map +1 -1
  169. package/table/use-sticky-header.js +4 -1
  170. package/table/use-sticky-header.js.map +1 -1
  171. package/table/utils.d.ts.map +1 -1
  172. package/table/utils.js +14 -4
  173. package/table/utils.js.map +1 -1
  174. package/test-utils/dom/collection-preferences/content-display-preference.d.ts +28 -2
  175. package/test-utils/dom/collection-preferences/content-display-preference.js +60 -2
  176. package/test-utils/dom/collection-preferences/content-display-preference.js.map +1 -1
  177. package/test-utils/dom/table/index.d.ts +18 -1
  178. package/test-utils/dom/table/index.js +22 -3
  179. package/test-utils/dom/table/index.js.map +1 -1
  180. package/test-utils/selectors/collection-preferences/content-display-preference.d.ts +28 -2
  181. package/test-utils/selectors/collection-preferences/content-display-preference.js +52 -2
  182. package/test-utils/selectors/collection-preferences/content-display-preference.js.map +1 -1
  183. package/test-utils/selectors/table/index.d.ts +18 -1
  184. package/test-utils/selectors/table/index.js +22 -3
  185. package/test-utils/selectors/table/index.js.map +1 -1
  186. package/wizard/wizard-step-list.js +4 -4
  187. package/wizard/wizard-step-list.js.map +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-active_x7peu_yrjo3_145:not(#\9):not(.awsui_resize-active-with-focus_x7peu_yrjo3_145) * {
145
+ .awsui_resize-active_x7peu_kyt6h_145:not(#\9):not(.awsui_resize-active-with-focus_x7peu_kyt6h_145) * {
146
146
  cursor: col-resize;
147
147
  -webkit-user-select: none;
148
148
  user-select: none;
149
149
  }
150
150
 
151
- .awsui_resizer-wrapper_x7peu_yrjo3_150:not(#\9) {
151
+ .awsui_resizer-wrapper_x7peu_kyt6h_150:not(#\9) {
152
152
  inset-block: 0;
153
153
  position: absolute;
154
154
  inset-inline-end: calc(-1 * var(--space-xl-jfy3x4, 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-wrapper_x7peu_yrjo3_150:has(.awsui_divider-interactive_x7peu_yrjo3_158).awsui_is-borderless_x7peu_yrjo3_158 {
159
+ th:not(#\9):last-child > .awsui_resizer-wrapper_x7peu_kyt6h_150:has(.awsui_divider-interactive_x7peu_kyt6h_158).awsui_is-borderless_x7peu_kyt6h_158 {
160
160
  inset-inline-end: 0;
161
161
  }
162
162
 
163
- .awsui_resizer-button-wrapper_x7peu_yrjo3_162:not(#\9) {
163
+ .awsui_resizer-button-wrapper_x7peu_kyt6h_162:not(#\9) {
164
164
  block-size: 100%;
165
165
  }
166
166
 
167
- th:not(#\9):not(:last-child) > .awsui_divider_x7peu_yrjo3_158,
168
- .awsui_divider-interactive_x7peu_yrjo3_158:not(#\9) {
167
+ th:not(#\9):not([data-rightmost]) > .awsui_divider_x7peu_kyt6h_158,
168
+ .awsui_divider-interactive_x7peu_kyt6h_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_yrjo3_158,
176
176
  max-block-size: calc(100% - calc(2 * var(--space-xs-ymlm0b, 8px) + var(--space-xxxs-pajhad, 2px)));
177
177
  margin-block: auto;
178
178
  margin-inline: auto;
179
- border-inline-start: var(--border-item-width-miijiw, 2px) solid var(--color-border-divider-interactive-default-r928dz, #8c8c94);
179
+ border-inline-start: var(--border-divider-list-width-tdfx1x, 1px) solid var(--color-border-divider-interactive-default-r928dz, #8c8c94);
180
180
  box-sizing: border-box;
181
181
  }
182
-
183
- th:not(#\9):not(:last-child) > .awsui_divider-disabled_x7peu_yrjo3_182 {
184
- border-inline-start-color: var(--color-border-divider-default-nr68jt, #c6c6cd);
182
+ th:not(#\9):not([data-rightmost]) > .awsui_divider_x7peu_kyt6h_158.awsui_divider-position-top_x7peu_kyt6h_181,
183
+ .awsui_divider-interactive_x7peu_kyt6h_158.awsui_divider-position-top_x7peu_kyt6h_181:not(#\9) {
184
+ margin-block-start: 0;
185
+ margin-block-end: auto;
186
+ max-block-size: calc(100% - calc(2 * var(--space-xs-ymlm0b, 8px) + var(--space-xxxs-pajhad, 2px)) / 2);
187
+ }
188
+ th:not(#\9):not([data-rightmost]) > .awsui_divider_x7peu_kyt6h_158.awsui_divider-position-bottom_x7peu_kyt6h_187,
189
+ .awsui_divider-interactive_x7peu_kyt6h_158.awsui_divider-position-bottom_x7peu_kyt6h_187:not(#\9) {
190
+ margin-block-start: auto;
191
+ margin-block-end: 0;
192
+ max-block-size: calc(100% - calc(2 * var(--space-xs-ymlm0b, 8px) + var(--space-xxxs-pajhad, 2px)) / 2);
193
+ }
194
+ th:not(#\9):not([data-rightmost]) > .awsui_divider_x7peu_kyt6h_158.awsui_divider-position-full_x7peu_kyt6h_193,
195
+ .awsui_divider-interactive_x7peu_kyt6h_158.awsui_divider-position-full_x7peu_kyt6h_193:not(#\9) {
196
+ margin-block: 0;
197
+ max-block-size: 100%;
185
198
  }
186
199
 
187
- .awsui_divider-interactive_x7peu_yrjo3_158:not(#\9) {
200
+ .awsui_divider-interactive_x7peu_kyt6h_158:not(#\9) {
188
201
  inset-inline-end: calc(var(--space-xl-jfy3x4, 24px) / 2);
189
202
  }
190
203
 
191
- th:not(#\9):last-child > .awsui_resizer-wrapper_x7peu_yrjo3_150.awsui_visual-refresh_x7peu_yrjo3_190.awsui_is-borderless_x7peu_yrjo3_158 .awsui_divider-interactive_x7peu_yrjo3_158 {
192
- inset-inline-end: 0;
204
+ .awsui_divider-active_x7peu_kyt6h_203:not(#\9) {
205
+ /* used in test-utils */
193
206
  }
194
207
 
195
- .awsui_divider-active_x7peu_yrjo3_194:not(#\9) {
196
- border-inline-start: 2px solid var(--color-border-divider-active-biq3j4, #0f141a);
208
+ .awsui_resizer-wrapper_x7peu_kyt6h_150.awsui_visual-refresh_x7peu_kyt6h_207.awsui_is-borderless_x7peu_kyt6h_158.awsui_is-last_x7peu_kyt6h_207 > .awsui_divider-interactive_x7peu_kyt6h_158:not(#\9) {
209
+ inset-inline-end: 0;
197
210
  }
198
211
 
199
- .awsui_resizer_x7peu_yrjo3_150:not(#\9) {
212
+ .awsui_resizer_x7peu_kyt6h_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_yrjo3_150.awsui_visual-ref
234
247
  block-size: 100%;
235
248
  inline-size: var(--space-xl-jfy3x4, 24px);
236
249
  }
237
- .awsui_resizer_x7peu_yrjo3_150:not(#\9):focus {
250
+ .awsui_resizer_x7peu_kyt6h_150:not(#\9):focus {
238
251
  outline: none;
239
252
  text-decoration: none;
240
253
  }
241
- .awsui_resize-active_x7peu_yrjo3_145 .awsui_resizer_x7peu_yrjo3_150:not(#\9) {
254
+ .awsui_resize-active_x7peu_kyt6h_145 .awsui_resizer_x7peu_kyt6h_150:not(#\9) {
242
255
  pointer-events: none;
243
256
  }
244
- .awsui_resizer_x7peu_yrjo3_150:not(#\9):hover + .awsui_divider_x7peu_yrjo3_158 {
245
- border-inline-start: 2px solid var(--color-border-divider-active-biq3j4, #0f141a);
246
- }
247
- body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_yrjo3_150.awsui_has-focus_x7peu_yrjo3_246:not(#\9) {
257
+ body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_kyt6h_150.awsui_has-focus_x7peu_kyt6h_256:not(#\9) {
248
258
  position: relative;
249
259
  }
250
- body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_yrjo3_150.awsui_has-focus_x7peu_yrjo3_246:not(#\9) {
260
+ body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_kyt6h_150.awsui_has-focus_x7peu_kyt6h_256:not(#\9) {
251
261
  outline: 2px dotted transparent;
252
262
  outline-offset: calc(calc(var(--space-table-header-focus-outline-gutter-ymwujm, 0px) - 2px) - 1px);
253
263
  }
254
- body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_yrjo3_150.awsui_has-focus_x7peu_yrjo3_246:not(#\9)::before {
264
+ body[data-awsui-focus-visible=true] .awsui_resizer_x7peu_kyt6h_150.awsui_has-focus_x7peu_kyt6h_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_yrjo3_150.awsui_has-foc
266
276
  box-shadow: 0 0 0 2px var(--color-border-item-focused-uk47pl, #006ce0);
267
277
  }
268
278
 
269
- .awsui_tracker_x7peu_yrjo3_268:not(#\9) {
279
+ .awsui_tracker_x7peu_kyt6h_278:not(#\9) {
270
280
  display: none;
271
281
  position: absolute;
272
282
  border-inline-start: var(--border-divider-list-width-tdfx1x, 1px) dashed var(--color-border-divider-active-biq3j4, #0f141a);
273
283
  inline-size: 0;
274
284
  inset-block: 0;
275
285
  }
276
- .awsui_resize-active_x7peu_yrjo3_145 .awsui_tracker_x7peu_yrjo3_268:not(#\9) {
286
+ .awsui_resize-active_x7peu_kyt6h_145 .awsui_tracker_x7peu_kyt6h_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-active_x7peu_yrjo3_145",
6
- "resize-active-with-focus": "awsui_resize-active-with-focus_x7peu_yrjo3_145",
7
- "resizer-wrapper": "awsui_resizer-wrapper_x7peu_yrjo3_150",
8
- "divider-interactive": "awsui_divider-interactive_x7peu_yrjo3_158",
9
- "is-borderless": "awsui_is-borderless_x7peu_yrjo3_158",
10
- "resizer-button-wrapper": "awsui_resizer-button-wrapper_x7peu_yrjo3_162",
11
- "divider": "awsui_divider_x7peu_yrjo3_158",
12
- "divider-disabled": "awsui_divider-disabled_x7peu_yrjo3_182",
13
- "visual-refresh": "awsui_visual-refresh_x7peu_yrjo3_190",
14
- "divider-active": "awsui_divider-active_x7peu_yrjo3_194",
15
- "resizer": "awsui_resizer_x7peu_yrjo3_150",
16
- "has-focus": "awsui_has-focus_x7peu_yrjo3_246",
17
- "tracker": "awsui_tracker_x7peu_yrjo3_268"
5
+ "resize-active": "awsui_resize-active_x7peu_kyt6h_145",
6
+ "resize-active-with-focus": "awsui_resize-active-with-focus_x7peu_kyt6h_145",
7
+ "resizer-wrapper": "awsui_resizer-wrapper_x7peu_kyt6h_150",
8
+ "divider-interactive": "awsui_divider-interactive_x7peu_kyt6h_158",
9
+ "is-borderless": "awsui_is-borderless_x7peu_kyt6h_158",
10
+ "resizer-button-wrapper": "awsui_resizer-button-wrapper_x7peu_kyt6h_162",
11
+ "divider": "awsui_divider_x7peu_kyt6h_158",
12
+ "divider-position-top": "awsui_divider-position-top_x7peu_kyt6h_181",
13
+ "divider-position-bottom": "awsui_divider-position-bottom_x7peu_kyt6h_187",
14
+ "divider-position-full": "awsui_divider-position-full_x7peu_kyt6h_193",
15
+ "divider-active": "awsui_divider-active_x7peu_kyt6h_203",
16
+ "visual-refresh": "awsui_visual-refresh_x7peu_kyt6h_207",
17
+ "is-last": "awsui_is-last_x7peu_kyt6h_207",
18
+ "resizer": "awsui_resizer_x7peu_kyt6h_150",
19
+ "has-focus": "awsui_has-focus_x7peu_kyt6h_256",
20
+ "tracker": "awsui_tracker_x7peu_kyt6h_278"
18
21
  };
19
22
 
@@ -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;AAK7F,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,c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,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, onScroll, tableRef, tableHasHeader, contentDensity, tableRole, }, ref) {
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;AAElF,OAAO,EAAE,iBAAiB,EAAa,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAqB,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAqBrC,eAAe,UAAU,CAAC,YAAY,CAAC,CAAC;AAExC,SAAS,YAAY,CACnB,EACE,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,EACR,mBA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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 { 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}\n\nexport default forwardRef(StickyHeader);\n\nfunction StickyHeader(\n {\n variant,\n theadProps,\n wrapperRef,\n theadRef,\n secondaryWrapperRef,\n onScroll,\n tableRef,\n tableHasHeader,\n contentDensity,\n tableRole,\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 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 contentDensity === 'compact' && getVisualContextClassname('compact-table')\n )}\n ref={secondaryTableRef}\n {...getTableRoleProps({ tableRole })}\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
+ {"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;AAClF,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAa,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAqB,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAwBrC,eAAe,UAAU,CAAC,YAAY,CAAC,CAAC;AAExC,SAAS,YAAY,CACnB,EACE,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,EACR,mBAAmB,EACnB,QAAQ,EACR,QAAQ,EACR,cA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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;EAc/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"}
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
- const stickyBottom = getLogicalBoundingClientRect(stickyRef.current).insetBlockEnd;
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,SAAS,CAAC,OAAO,EAAE,CAAC;YAChD,OAAO;QACT,CAAC;QACD,MAAM,eAAe,GAAG,wBAAwB,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;QAC1F,IAAI,eAAe,GAAG,CAAC,EAAE,CAAC;YACxB,UAAU,CAAC,eAAe,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QACpD,CAAC;IACH,CAAC,CAAC;IACF,MAAM,YAAY,GAAG,CAAC,IAAwB,EAAE,EAAE;QAChD,IAAI,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;YACzD,OAAO;QACT,CAAC;QACD,MAAM,YAAY,GAAG,4BAA4B,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC;QACnF,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 const stickyBottom = getLogicalBoundingClientRect(stickyRef.current).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
+ {"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,I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AAU,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,40 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "root": "awsui_root_wih1l_1y83p_153",
5
- "tools": "awsui_tools_wih1l_1y83p_164",
6
- "tools-filtering": "awsui_tools-filtering_wih1l_1y83p_173",
7
- "tools-align-right": "awsui_tools-align-right_wih1l_1y83p_186",
8
- "tools-pagination": "awsui_tools-pagination_wih1l_1y83p_190",
9
- "tools-preferences": "awsui_tools-preferences_wih1l_1y83p_190",
10
- "tools-small": "awsui_tools-small_wih1l_1y83p_196",
11
- "table": "awsui_table_wih1l_1y83p_200",
12
- "table-layout-fixed": "awsui_table-layout-fixed_wih1l_1y83p_206",
13
- "wrapper": "awsui_wrapper_wih1l_1y83p_210",
14
- "variant-stacked": "awsui_variant-stacked_wih1l_1y83p_217",
15
- "wrapper-content-measure": "awsui_wrapper-content-measure_wih1l_1y83p_217",
16
- "variant-container": "awsui_variant-container_wih1l_1y83p_217",
17
- "has-footer": "awsui_has-footer_wih1l_1y83p_220",
18
- "has-header": "awsui_has-header_wih1l_1y83p_223",
19
- "cell-merged": "awsui_cell-merged_wih1l_1y83p_240",
20
- "cell-merged-content": "awsui_cell-merged-content_wih1l_1y83p_252",
21
- "empty": "awsui_empty_wih1l_1y83p_268",
22
- "loading": "awsui_loading_wih1l_1y83p_272",
23
- "selection-control": "awsui_selection-control_wih1l_1y83p_281",
24
- "selection-control-header": "awsui_selection-control-header_wih1l_1y83p_288",
25
- "header-secondary": "awsui_header-secondary_wih1l_1y83p_294",
26
- "variant-full-page": "awsui_variant-full-page_wih1l_1y83p_305",
27
- "table-has-header": "awsui_table-has-header_wih1l_1y83p_311",
28
- "header-controls": "awsui_header-controls_wih1l_1y83p_322",
29
- "variant-embedded": "awsui_variant-embedded_wih1l_1y83p_331",
30
- "variant-borderless": "awsui_variant-borderless_wih1l_1y83p_331",
31
- "footer-wrapper": "awsui_footer-wrapper_wih1l_1y83p_336",
32
- "footer": "awsui_footer_wih1l_1y83p_336",
33
- "footer-with-pagination": "awsui_footer-with-pagination_wih1l_1y83p_344",
34
- "footer-pagination": "awsui_footer-pagination_wih1l_1y83p_352",
35
- "thead-active": "awsui_thead-active_wih1l_1y83p_356",
36
- "row": "awsui_row_wih1l_1y83p_357",
37
- "row-selected": "awsui_row-selected_wih1l_1y83p_358"
4
+ "root": "awsui_root_wih1l_1ru4o_153",
5
+ "tools": "awsui_tools_wih1l_1ru4o_164",
6
+ "tools-filtering": "awsui_tools-filtering_wih1l_1ru4o_173",
7
+ "tools-align-right": "awsui_tools-align-right_wih1l_1ru4o_186",
8
+ "tools-pagination": "awsui_tools-pagination_wih1l_1ru4o_190",
9
+ "tools-preferences": "awsui_tools-preferences_wih1l_1ru4o_190",
10
+ "tools-small": "awsui_tools-small_wih1l_1ru4o_196",
11
+ "table": "awsui_table_wih1l_1ru4o_200",
12
+ "table-layout-fixed": "awsui_table-layout-fixed_wih1l_1ru4o_206",
13
+ "wrapper": "awsui_wrapper_wih1l_1ru4o_210",
14
+ "variant-stacked": "awsui_variant-stacked_wih1l_1ru4o_217",
15
+ "wrapper-content-measure": "awsui_wrapper-content-measure_wih1l_1ru4o_217",
16
+ "variant-container": "awsui_variant-container_wih1l_1ru4o_217",
17
+ "has-footer": "awsui_has-footer_wih1l_1ru4o_220",
18
+ "has-header": "awsui_has-header_wih1l_1ru4o_223",
19
+ "cell-merged": "awsui_cell-merged_wih1l_1ru4o_240",
20
+ "cell-merged-content": "awsui_cell-merged-content_wih1l_1ru4o_252",
21
+ "empty": "awsui_empty_wih1l_1ru4o_268",
22
+ "loading": "awsui_loading_wih1l_1ru4o_272",
23
+ "selection-control": "awsui_selection-control_wih1l_1ru4o_281",
24
+ "selection-control-header": "awsui_selection-control-header_wih1l_1ru4o_288",
25
+ "selection-control-content-spans-rows": "awsui_selection-control-content-spans-rows_wih1l_1ru4o_293",
26
+ "header-secondary": "awsui_header-secondary_wih1l_1ru4o_300",
27
+ "variant-full-page": "awsui_variant-full-page_wih1l_1ru4o_311",
28
+ "table-has-header": "awsui_table-has-header_wih1l_1ru4o_317",
29
+ "header-controls": "awsui_header-controls_wih1l_1ru4o_328",
30
+ "variant-embedded": "awsui_variant-embedded_wih1l_1ru4o_337",
31
+ "variant-borderless": "awsui_variant-borderless_wih1l_1ru4o_337",
32
+ "footer-wrapper": "awsui_footer-wrapper_wih1l_1ru4o_342",
33
+ "footer": "awsui_footer_wih1l_1ru4o_342",
34
+ "footer-with-pagination": "awsui_footer-with-pagination_wih1l_1ru4o_350",
35
+ "footer-pagination": "awsui_footer-pagination_wih1l_1ru4o_358",
36
+ "thead-active": "awsui_thead-active_wih1l_1ru4o_362",
37
+ "row": "awsui_row_wih1l_1ru4o_363",
38
+ "row-selected": "awsui_row-selected_wih1l_1ru4o_364"
38
39
  };
39
40