@cloudscape-design/components 3.0.313 → 3.0.315
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/app-layout/index.js +1 -1
- package/app-layout/index.js.map +1 -1
- package/app-layout/visual-refresh/context.js +1 -1
- package/app-layout/visual-refresh/context.js.map +1 -1
- package/area-chart/internal.js +1 -1
- package/area-chart/internal.js.map +1 -1
- package/autosuggest/internal.js +1 -1
- package/autosuggest/internal.js.map +1 -1
- package/collection-preferences/index.js +1 -1
- package/collection-preferences/index.js.map +1 -1
- package/date-range-picker/index.js +1 -1
- package/date-range-picker/index.js.map +1 -1
- package/date-range-picker/time-offset.js +1 -1
- package/date-range-picker/time-offset.js.map +1 -1
- package/expandable-section/expandable-section-header.js +1 -1
- package/expandable-section/expandable-section-header.js.map +1 -1
- package/file-upload/internal.js +1 -1
- package/file-upload/internal.js.map +1 -1
- package/flashbar/common.js +1 -1
- package/flashbar/common.js.map +1 -1
- package/flashbar/flash.js +1 -1
- package/flashbar/flash.js.map +1 -1
- package/grid/internal.js +2 -2
- package/grid/internal.js.map +1 -1
- package/i18n/provider.js +1 -1
- package/i18n/provider.js.map +1 -1
- package/icon/internal.js +1 -1
- package/icon/internal.js.map +1 -1
- package/internal/base-component/styles.scoped.css +6 -0
- package/internal/components/masked-input/use-mask.js +2 -2
- package/internal/components/masked-input/use-mask.js.map +1 -1
- package/internal/components/option/index.js +1 -1
- package/internal/components/option/index.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/generated/theming/index.cjs +54 -0
- package/internal/generated/theming/index.js +54 -0
- package/internal/hooks/check-controlled/index.js +1 -1
- package/internal/hooks/check-controlled/index.js.map +1 -1
- package/internal/hooks/use-controllable/index.js +1 -1
- package/internal/hooks/use-controllable/index.js.map +1 -1
- package/internal/hooks/use-visual-mode/index.js +1 -1
- package/internal/hooks/use-visual-mode/index.js.map +1 -1
- package/internal/manifest.json +1 -1
- package/internal/utils/check-safe-url.js +1 -1
- package/internal/utils/check-safe-url.js.map +1 -1
- package/internal/utils/locale/normalize-locale.js +1 -1
- package/internal/utils/locale/normalize-locale.js.map +1 -1
- package/mixed-line-bar-chart/internal.js +1 -1
- package/mixed-line-bar-chart/internal.js.map +1 -1
- package/package.json +1 -1
- package/pie-chart/styles.css.js +27 -27
- package/pie-chart/styles.scoped.css +44 -44
- package/pie-chart/styles.selectors.js +27 -27
- package/popover/index.js +1 -1
- package/popover/index.js.map +1 -1
- package/progress-bar/index.js +1 -1
- package/progress-bar/index.js.map +1 -1
- package/select/utils/check-option-value-field.js +1 -1
- package/select/utils/check-option-value-field.js.map +1 -1
- package/side-navigation/util.js +1 -1
- package/side-navigation/util.js.map +1 -1
- package/table/body-cell/styles.css.js +28 -28
- package/table/body-cell/styles.scoped.css +70 -70
- package/table/body-cell/styles.selectors.js +28 -28
- package/table/use-column-widths.js +1 -1
- package/table/use-column-widths.js.map +1 -1
- package/table/utils.js +1 -1
- package/table/utils.js.map +1 -1
- package/wizard/internal.js +1 -1
- package/wizard/internal.js.map +1 -1
- package/internal/logging.d.ts +0 -2
- package/internal/logging.d.ts.map +0 -1
- package/internal/logging.js +0 -14
- package/internal/logging.js.map +0 -1
|
@@ -90,7 +90,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.awsui_body-
|
|
93
|
+
.awsui_body-cell_c6tup_11rnr_93:not(#\9) {
|
|
94
94
|
box-sizing: border-box;
|
|
95
95
|
padding: var(--space-scaled-xs-wbfgrv, 8px) var(--space-scaled-l-2rs0gk, 20px) calc(
|
|
96
96
|
var(--space-scaled-xs-wbfgrv, 8px) + (var(--border-item-width-y36svo, 2px) - var(--border-divider-list-width-um3zli, 1px))
|
|
@@ -100,19 +100,19 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
100
100
|
border-bottom: var(--border-divider-list-width-um3zli, 1px) solid var(--color-border-divider-default-9o8zql, #e9ebed);
|
|
101
101
|
font-weight: inherit;
|
|
102
102
|
}
|
|
103
|
-
.awsui_body-
|
|
103
|
+
.awsui_body-cell_c6tup_11rnr_93:not(#\9):not(.awsui_body-cell-wrap_c6tup_11rnr_103) {
|
|
104
104
|
white-space: nowrap;
|
|
105
105
|
overflow: hidden;
|
|
106
106
|
text-overflow: ellipsis;
|
|
107
107
|
}
|
|
108
|
-
.awsui_body-
|
|
108
|
+
.awsui_body-cell_c6tup_11rnr_93:not(#\9):first-child {
|
|
109
109
|
border-left: var(--border-item-width-y36svo, 2px) solid transparent;
|
|
110
110
|
}
|
|
111
|
-
.awsui_body-
|
|
111
|
+
.awsui_body-cell_c6tup_11rnr_93:not(#\9):last-child {
|
|
112
112
|
border-right: var(--border-item-width-y36svo, 2px) solid transparent;
|
|
113
113
|
padding-right: calc(var(--space-l-f4l5gr, 20px) - var(--border-item-width-y36svo, 2px));
|
|
114
114
|
}
|
|
115
|
-
.awsui_body-
|
|
115
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_is-visual-refresh_c6tup_11rnr_115:not(#\9):first-child {
|
|
116
116
|
/*
|
|
117
117
|
Striped rows requires additional left padding because the
|
|
118
118
|
shaded background makes the child content appear too close
|
|
@@ -124,55 +124,55 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
124
124
|
that the placeholder border would consume.
|
|
125
125
|
*/
|
|
126
126
|
}
|
|
127
|
-
.awsui_body-
|
|
127
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_is-visual-refresh_c6tup_11rnr_115:not(#\9):first-child:not(.awsui_has-striped-rows_c6tup_11rnr_127) {
|
|
128
128
|
padding-left: var(--space-xxxs-j6dpcy, 2px);
|
|
129
129
|
}
|
|
130
|
-
.awsui_body-
|
|
130
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_is-visual-refresh_c6tup_11rnr_115:not(#\9):first-child:not(.awsui_has-striped-rows_c6tup_11rnr_127):not(.awsui_body-cell-edit-active_c6tup_11rnr_130).awsui_body-cell-editable_c6tup_11rnr_130:hover {
|
|
131
131
|
padding-left: calc(var(--space-xxxs-j6dpcy, 2px) + var(--border-divider-list-width-um3zli, 1px));
|
|
132
132
|
}
|
|
133
|
-
.awsui_body-
|
|
133
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_is-visual-refresh_c6tup_11rnr_115:not(#\9):first-child:first-child.awsui_has-striped-rows_c6tup_11rnr_127 {
|
|
134
134
|
padding-left: var(--space-xxs-ja5cp8, 4px);
|
|
135
135
|
}
|
|
136
|
-
.awsui_body-
|
|
136
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_is-visual-refresh_c6tup_11rnr_115:not(#\9):first-child:first-child.awsui_has-striped-rows-sticky-cell-pad-left_c6tup_11rnr_136 {
|
|
137
137
|
padding-left: var(--space-table-horizontal-8ca8r3, 20px);
|
|
138
138
|
}
|
|
139
|
-
.awsui_body-
|
|
139
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_is-visual-refresh_c6tup_11rnr_115:not(#\9):first-child:not(.awsui_has-selection_c6tup_11rnr_139):not(.awsui_body-cell-editable_c6tup_11rnr_130) {
|
|
140
140
|
border-left: none;
|
|
141
141
|
}
|
|
142
|
-
.awsui_body-
|
|
142
|
+
.awsui_body-cell_c6tup_11rnr_93:not(#\9):first-child:not(.awsui_is-visual-refresh_c6tup_11rnr_115) {
|
|
143
143
|
padding-left: calc(var(--space-l-f4l5gr, 20px) - var(--border-item-width-y36svo, 2px));
|
|
144
144
|
}
|
|
145
|
-
.awsui_body-cell-first-
|
|
145
|
+
.awsui_body-cell-first-row_c6tup_11rnr_145:not(#\9) {
|
|
146
146
|
border-top: var(--border-item-width-y36svo, 2px) solid transparent;
|
|
147
147
|
}
|
|
148
|
-
.awsui_body-cell-last-
|
|
148
|
+
.awsui_body-cell-last-row_c6tup_11rnr_148:not(#\9):not(.awsui_body-cell-selected_c6tup_11rnr_148):not(.awsui_has-footer_c6tup_11rnr_148) {
|
|
149
149
|
border-bottom: var(--border-item-width-y36svo, 2px) solid transparent;
|
|
150
150
|
}
|
|
151
|
-
.awsui_body-cell-last-
|
|
151
|
+
.awsui_body-cell-last-row_c6tup_11rnr_148:not(#\9):not(.awsui_body-cell-selected_c6tup_11rnr_148).awsui_has-footer_c6tup_11rnr_148 {
|
|
152
152
|
/*
|
|
153
153
|
Add a bottom border to the body cells of the last row as a separator between the
|
|
154
154
|
table and the footer
|
|
155
155
|
*/
|
|
156
156
|
border-bottom: var(--border-divider-section-width-orq175, 2px) solid var(--color-border-divider-default-9o8zql, #e9ebed);
|
|
157
157
|
}
|
|
158
|
-
.awsui_body-cell-
|
|
158
|
+
.awsui_body-cell-shaded_c6tup_11rnr_158:not(#\9) {
|
|
159
159
|
background: var(--color-background-cell-shaded-oyxkf4, #f8f8f8);
|
|
160
160
|
}
|
|
161
|
-
.awsui_body-cell-
|
|
161
|
+
.awsui_body-cell-selected_c6tup_11rnr_148:not(#\9) {
|
|
162
162
|
background-color: var(--color-background-item-selected-ndi5zy, #f2f8fd);
|
|
163
163
|
border-top: var(--border-item-width-y36svo, 2px) solid var(--color-border-item-selected-xoo46x, #0972d3);
|
|
164
164
|
border-bottom: var(--border-item-width-y36svo, 2px) solid var(--color-border-item-selected-xoo46x, #0972d3);
|
|
165
165
|
padding-bottom: var(--space-scaled-xs-wbfgrv, 8px);
|
|
166
166
|
}
|
|
167
|
-
.awsui_body-cell-
|
|
167
|
+
.awsui_body-cell-selected_c6tup_11rnr_148:not(#\9):first-child {
|
|
168
168
|
border-left: var(--border-item-width-y36svo, 2px) solid var(--color-border-item-selected-xoo46x, #0972d3);
|
|
169
169
|
border-radius: var(--border-radius-item-gyl0qr, 8px) 0 0 var(--border-radius-item-gyl0qr, 8px);
|
|
170
170
|
}
|
|
171
|
-
.awsui_body-cell-
|
|
171
|
+
.awsui_body-cell-selected_c6tup_11rnr_148:not(#\9):last-child {
|
|
172
172
|
border-right: var(--border-item-width-y36svo, 2px) solid var(--color-border-item-selected-xoo46x, #0972d3);
|
|
173
173
|
border-radius: 0 var(--border-radius-item-gyl0qr, 8px) var(--border-radius-item-gyl0qr, 8px) 0;
|
|
174
174
|
}
|
|
175
|
-
.awsui_body-
|
|
175
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_sticky-cell_c6tup_11rnr_175:not(#\9) {
|
|
176
176
|
position: sticky;
|
|
177
177
|
background: var(--color-background-container-content-og3y0v, #ffffff);
|
|
178
178
|
z-index: 798;
|
|
@@ -180,79 +180,79 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
180
180
|
transition-duration: var(--motion-duration-transition-show-quick-tx10w8, 90ms);
|
|
181
181
|
transition-timing-function: var(--motion-easing-sticky-c9pq0x, cubic-bezier(1, 0, 0.83, 1));
|
|
182
182
|
}
|
|
183
|
-
.awsui_body-
|
|
183
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_sticky-cell-pad-left_c6tup_11rnr_183:not(#\9):not(.awsui_has-selection_c6tup_11rnr_139):not(.awsui_is-visual-refresh_c6tup_11rnr_115.awsui_body-cell_c6tup_11rnr_93:first-child.awsui_has-striped-rows_c6tup_11rnr_127) {
|
|
184
184
|
padding-left: var(--space-table-horizontal-8ca8r3, 20px);
|
|
185
185
|
}
|
|
186
|
-
.awsui_body-
|
|
186
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_sticky-cell_c6tup_11rnr_175.awsui_body-cell-shaded_c6tup_11rnr_158:not(#\9) {
|
|
187
187
|
background: var(--color-background-cell-shaded-oyxkf4, #f8f8f8);
|
|
188
188
|
}
|
|
189
|
-
.awsui_body-
|
|
189
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_sticky-cell_c6tup_11rnr_175.awsui_body-cell-selected_c6tup_11rnr_148:not(#\9) {
|
|
190
190
|
background-color: var(--color-background-item-selected-ndi5zy, #f2f8fd);
|
|
191
191
|
}
|
|
192
|
-
.awsui_body-
|
|
192
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_sticky-cell_c6tup_11rnr_175.awsui_body-cell-selected_c6tup_11rnr_148:not(#\9):first-child {
|
|
193
193
|
box-shadow: 0 0 0 4px var(--color-background-container-content-og3y0v, #ffffff);
|
|
194
194
|
clip-path: inset(0 0 0 0);
|
|
195
195
|
}
|
|
196
|
-
.awsui_body-
|
|
196
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_sticky-cell_c6tup_11rnr_175.awsui_body-cell-selected_c6tup_11rnr_148:not(#\9):last-child {
|
|
197
197
|
box-shadow: 4px 0 0 0 var(--color-background-container-content-og3y0v, #ffffff);
|
|
198
198
|
clip-path: inset(0 0 0 0);
|
|
199
199
|
}
|
|
200
|
-
.awsui_body-
|
|
200
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_sticky-cell_c6tup_11rnr_175.awsui_body-cell-selected_c6tup_11rnr_148:not(#\9):last-child.awsui_sticky-cell-last-right_c6tup_11rnr_200 {
|
|
201
201
|
box-shadow: var(--shadow-sticky-column-last-gplke4, -4px 0 20px 1px rgba(0, 28, 36, 0.1)), 8px 0 0 0 var(--color-background-container-content-og3y0v, #ffffff);
|
|
202
202
|
clip-path: inset(0 0 0 -24px);
|
|
203
203
|
}
|
|
204
|
-
.awsui_body-
|
|
204
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_sticky-cell-last-left_c6tup_11rnr_204:not(#\9) {
|
|
205
205
|
box-shadow: var(--shadow-sticky-column-first-n8r2og, 4px 0px 20px 1px rgba(0, 7, 22, 0.1));
|
|
206
206
|
clip-path: inset(0px -24px 0px 0px);
|
|
207
207
|
}
|
|
208
|
-
.awsui_body-
|
|
208
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_sticky-cell-last-right_c6tup_11rnr_200:not(#\9) {
|
|
209
209
|
box-shadow: var(--shadow-sticky-column-last-gplke4, -4px 0 20px 1px rgba(0, 28, 36, 0.1));
|
|
210
210
|
clip-path: inset(0 0 0 -24px);
|
|
211
211
|
}
|
|
212
212
|
@media (prefers-reduced-motion: reduce) {
|
|
213
|
-
.awsui_body-
|
|
213
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_sticky-cell_c6tup_11rnr_175:not(#\9) {
|
|
214
214
|
animation: none;
|
|
215
215
|
transition: none;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
.awsui-motion-disabled .awsui_body-
|
|
218
|
+
.awsui-motion-disabled .awsui_body-cell_c6tup_11rnr_93.awsui_sticky-cell_c6tup_11rnr_175:not(#\9), .awsui-mode-entering .awsui_body-cell_c6tup_11rnr_93.awsui_sticky-cell_c6tup_11rnr_175:not(#\9) {
|
|
219
219
|
animation: none;
|
|
220
220
|
transition: none;
|
|
221
221
|
}
|
|
222
|
-
.awsui_body-cell-
|
|
222
|
+
.awsui_body-cell-selected_c6tup_11rnr_148:not(#\9):not(:first-child) {
|
|
223
223
|
padding-top: calc(
|
|
224
224
|
var(--space-scaled-xs-wbfgrv, 8px) + (var(--border-item-width-y36svo, 2px) - var(--border-divider-list-width-um3zli, 1px))
|
|
225
225
|
);
|
|
226
226
|
}
|
|
227
|
-
.awsui_body-
|
|
227
|
+
.awsui_body-cell_c6tup_11rnr_93:not(#\9):not(.awsui_body-cell-selected_c6tup_11rnr_148).awsui_body-cell-next-selected_c6tup_11rnr_227 {
|
|
228
228
|
border-bottom: 0;
|
|
229
229
|
padding-bottom: calc(var(--space-scaled-xs-wbfgrv, 8px) + var(--border-divider-list-width-um3zli, 1px));
|
|
230
230
|
}
|
|
231
|
-
.awsui_body-cell-
|
|
231
|
+
.awsui_body-cell-selected_c6tup_11rnr_148.awsui_body-cell-prev-selected_c6tup_11rnr_231:not(#\9) {
|
|
232
232
|
padding-top: calc(
|
|
233
233
|
var(--space-scaled-xs-wbfgrv, 8px) + (var(--border-item-width-y36svo, 2px) - var(--border-divider-list-width-um3zli, 1px))
|
|
234
234
|
);
|
|
235
235
|
border-top: var(--border-divider-list-width-um3zli, 1px) solid var(--color-border-item-placeholder-yrwdru, #0972d3);
|
|
236
236
|
}
|
|
237
|
-
.awsui_body-cell-
|
|
237
|
+
.awsui_body-cell-selected_c6tup_11rnr_148.awsui_body-cell-next-selected_c6tup_11rnr_227:not(#\9) {
|
|
238
238
|
border-bottom-width: var(--border-divider-list-width-um3zli, 1px);
|
|
239
239
|
}
|
|
240
|
-
.awsui_body-cell-
|
|
240
|
+
.awsui_body-cell-selected_c6tup_11rnr_148.awsui_body-cell-next-selected_c6tup_11rnr_227:not(#\9):first-child {
|
|
241
241
|
border-bottom-left-radius: 0;
|
|
242
242
|
}
|
|
243
|
-
.awsui_body-cell-
|
|
243
|
+
.awsui_body-cell-selected_c6tup_11rnr_148.awsui_body-cell-next-selected_c6tup_11rnr_227:not(#\9):last-child {
|
|
244
244
|
border-bottom-right-radius: 0;
|
|
245
245
|
}
|
|
246
|
-
.awsui_body-cell-
|
|
246
|
+
.awsui_body-cell-selected_c6tup_11rnr_148.awsui_body-cell-prev-selected_c6tup_11rnr_231:not(#\9):first-child {
|
|
247
247
|
border-top-left-radius: 0;
|
|
248
248
|
}
|
|
249
|
-
.awsui_body-cell-
|
|
249
|
+
.awsui_body-cell-selected_c6tup_11rnr_148.awsui_body-cell-prev-selected_c6tup_11rnr_231:not(#\9):last-child {
|
|
250
250
|
border-top-right-radius: 0;
|
|
251
251
|
}
|
|
252
|
-
.awsui_body-cell-
|
|
252
|
+
.awsui_body-cell-selected_c6tup_11rnr_148:not(#\9):not(.awsui_body-cell-prev-selected_c6tup_11rnr_231) {
|
|
253
253
|
padding-top: var(--space-scaled-xs-wbfgrv, 8px);
|
|
254
254
|
}
|
|
255
|
-
.awsui_body-cell-
|
|
255
|
+
.awsui_body-cell-success_c6tup_11rnr_255:not(#\9), .awsui_body-cell-editor_c6tup_11rnr_255:not(#\9) {
|
|
256
256
|
top: 0;
|
|
257
257
|
right: 0;
|
|
258
258
|
bottom: 0;
|
|
@@ -268,68 +268,68 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
268
268
|
padding-right: calc(var(--space-xs-edba2s, 8px) + var(--space-xxs-ja5cp8, 4px));
|
|
269
269
|
color: var(--color-text-button-normal-default-x2bilf, #0972d3);
|
|
270
270
|
}
|
|
271
|
-
.awsui_body-cell-
|
|
271
|
+
.awsui_body-cell-success_c6tup_11rnr_255:not(#\9):hover, .awsui_body-cell-editor_c6tup_11rnr_255:not(#\9):hover {
|
|
272
272
|
color: var(--color-text-button-normal-hover-deauoa, #033160);
|
|
273
273
|
}
|
|
274
|
-
.awsui_body-cell-
|
|
274
|
+
.awsui_body-cell-success_c6tup_11rnr_255:not(#\9):active, .awsui_body-cell-editor_c6tup_11rnr_255:not(#\9):active {
|
|
275
275
|
color: var(--color-text-button-normal-active-avnl7f, #033160);
|
|
276
276
|
}
|
|
277
|
-
.awsui_body-cell-success-
|
|
277
|
+
.awsui_body-cell-success-form_c6tup_11rnr_277:not(#\9), .awsui_body-cell-editor-form_c6tup_11rnr_277:not(#\9) {
|
|
278
278
|
margin: calc(-1 * var(--space-xs-edba2s, 8px)) calc(-1.5 * var(--space-xs-edba2s, 8px));
|
|
279
279
|
}
|
|
280
|
-
.awsui_is-visual-
|
|
280
|
+
.awsui_is-visual-refresh_c6tup_11rnr_115.awsui_body-cell_c6tup_11rnr_93:not(#\9):first-child.awsui_has-striped-rows_c6tup_11rnr_127 > .awsui_body-cell-success-form_c6tup_11rnr_277, .awsui_is-visual-refresh_c6tup_11rnr_115.awsui_body-cell_c6tup_11rnr_93:not(#\9):first-child.awsui_has-striped-rows_c6tup_11rnr_127 > .awsui_body-cell-editor-form_c6tup_11rnr_277 {
|
|
281
281
|
margin-left: calc(-1 * var(--space-xxs-ja5cp8, 4px));
|
|
282
282
|
}
|
|
283
|
-
.awsui_is-visual-
|
|
283
|
+
.awsui_is-visual-refresh_c6tup_11rnr_115.awsui_body-cell_c6tup_11rnr_93:not(#\9):first-child:not(.awsui_has-striped-rows_c6tup_11rnr_127) > .awsui_body-cell-success-form_c6tup_11rnr_277, .awsui_is-visual-refresh_c6tup_11rnr_115.awsui_body-cell_c6tup_11rnr_93:not(#\9):first-child:not(.awsui_has-striped-rows_c6tup_11rnr_127) > .awsui_body-cell-editor-form_c6tup_11rnr_277 {
|
|
284
284
|
margin-left: calc(-1 * var(--space-xxxs-j6dpcy, 2px));
|
|
285
285
|
}
|
|
286
|
-
.awsui_body-cell-success-
|
|
286
|
+
.awsui_body-cell-success-row_c6tup_11rnr_286:not(#\9), .awsui_body-cell-editor-row_c6tup_11rnr_286:not(#\9) {
|
|
287
287
|
display: flex;
|
|
288
288
|
flex-flow: row nowrap;
|
|
289
289
|
align-items: center;
|
|
290
290
|
justify-content: space-between;
|
|
291
291
|
column-gap: var(--space-xxs-ja5cp8, 4px);
|
|
292
292
|
}
|
|
293
|
-
.awsui_body-cell-success-
|
|
293
|
+
.awsui_body-cell-success-row_c6tup_11rnr_286 > :not(#\9):not(:last-child), .awsui_body-cell-editor-row_c6tup_11rnr_286 > :not(#\9):not(:last-child) {
|
|
294
294
|
flex-grow: 1;
|
|
295
295
|
}
|
|
296
|
-
.awsui_body-cell-success-
|
|
296
|
+
.awsui_body-cell-success-controls_c6tup_11rnr_296:not(#\9), .awsui_body-cell-editor-controls_c6tup_11rnr_296:not(#\9) {
|
|
297
297
|
flex-shrink: 0;
|
|
298
298
|
}
|
|
299
|
-
.awsui_body-
|
|
299
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9) {
|
|
300
300
|
position: relative;
|
|
301
301
|
cursor: pointer;
|
|
302
302
|
}
|
|
303
|
-
.awsui_body-
|
|
303
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130.awsui_sticky-cell_c6tup_11rnr_175:not(#\9) {
|
|
304
304
|
position: sticky;
|
|
305
305
|
}
|
|
306
|
-
.awsui_body-
|
|
306
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130.awsui_body-cell-edit-active_c6tup_11rnr_130:not(#\9) {
|
|
307
307
|
overflow: visible;
|
|
308
308
|
}
|
|
309
|
-
.awsui_body-
|
|
309
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130.awsui_body-cell-edit-active_c6tup_11rnr_130.awsui_sticky-cell_c6tup_11rnr_175:not(#\9) {
|
|
310
310
|
position: sticky;
|
|
311
311
|
}
|
|
312
|
-
.awsui_body-
|
|
312
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130) > .awsui_body-cell-editor_c6tup_11rnr_255 {
|
|
313
313
|
opacity: 0;
|
|
314
314
|
}
|
|
315
|
-
.awsui_body-
|
|
315
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130).awsui_body-cell-has-success_c6tup_11rnr_315 {
|
|
316
316
|
padding-right: calc(var(--space-scaled-l-2rs0gk, 20px) + var(--space-l-f4l5gr, 20px));
|
|
317
317
|
}
|
|
318
|
-
.awsui_body-
|
|
318
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):focus-within {
|
|
319
319
|
padding-right: calc(var(--space-scaled-l-2rs0gk, 20px) + var(--space-l-f4l5gr, 20px));
|
|
320
320
|
position: relative;
|
|
321
321
|
}
|
|
322
|
-
.awsui_body-
|
|
322
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):focus-within > .awsui_body-cell-editor_c6tup_11rnr_255 {
|
|
323
323
|
opacity: 1;
|
|
324
324
|
}
|
|
325
|
-
.awsui_body-
|
|
325
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):focus-within > .awsui_body-cell-success_c6tup_11rnr_255 {
|
|
326
326
|
opacity: 0;
|
|
327
327
|
}
|
|
328
|
-
.awsui_body-
|
|
328
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):focus-within {
|
|
329
329
|
outline: 2px dotted transparent;
|
|
330
330
|
outline-offset: calc(calc(-1 * var(--space-scaled-xxs-t2t62i, 4px)) - 1px);
|
|
331
331
|
}
|
|
332
|
-
.awsui_body-
|
|
332
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):focus-within::before {
|
|
333
333
|
content: " ";
|
|
334
334
|
display: block;
|
|
335
335
|
position: absolute;
|
|
@@ -340,46 +340,46 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
340
340
|
border-radius: var(--border-radius-control-default-focus-ring-muizvi, 4px);
|
|
341
341
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-4t19h5, #0972d3);
|
|
342
342
|
}
|
|
343
|
-
.awsui_body-
|
|
343
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):hover {
|
|
344
344
|
position: relative;
|
|
345
345
|
background-color: var(--color-background-dropdown-item-hover-gvdk4u, #f4f4f4);
|
|
346
|
-
border: var(--border-divider-list-width-um3zli, 1px) solid var(--color-border-
|
|
346
|
+
border: var(--border-divider-list-width-um3zli, 1px) solid var(--color-border-editable-cell-hover-zeuchn, #7d8998);
|
|
347
347
|
left: calc(-1 * var(--border-divider-list-width-um3zli, 1px));
|
|
348
348
|
right: calc(-1 * var(--border-divider-list-width-um3zli, 1px));
|
|
349
349
|
padding-right: calc(var(--space-scaled-l-2rs0gk, 20px) + var(--space-l-f4l5gr, 20px));
|
|
350
350
|
}
|
|
351
|
-
.awsui_body-
|
|
351
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):hover > .awsui_body-cell-editor_c6tup_11rnr_255 {
|
|
352
352
|
opacity: 1;
|
|
353
353
|
}
|
|
354
|
-
.awsui_body-
|
|
354
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):hover > .awsui_body-cell-success_c6tup_11rnr_255 {
|
|
355
355
|
opacity: 0;
|
|
356
356
|
}
|
|
357
|
-
.awsui_body-
|
|
357
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):hover:first-child {
|
|
358
358
|
left: 0;
|
|
359
359
|
right: 0;
|
|
360
360
|
}
|
|
361
|
-
.awsui_body-
|
|
361
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):hover > .awsui_body-cell-editor_c6tup_11rnr_255 {
|
|
362
362
|
padding-right: calc(var(--space-xs-edba2s, 8px) + var(--space-xxs-ja5cp8, 4px) - (2 * var(--border-divider-list-width-um3zli, 1px)));
|
|
363
363
|
}
|
|
364
|
-
.awsui_body-
|
|
364
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):hover.awsui_body-cell-last-row_c6tup_11rnr_148.awsui_body-cell-selected_c6tup_11rnr_148, .awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):hover.awsui_body-cell-next-selected_c6tup_11rnr_227 {
|
|
365
365
|
padding-top: calc(var(--space-scaled-xs-wbfgrv, 8px) - calc(var(--border-divider-list-width-um3zli, 1px) / 2));
|
|
366
366
|
padding-bottom: calc(var(--space-scaled-xs-wbfgrv, 8px) - calc(var(--border-divider-list-width-um3zli, 1px) / 2));
|
|
367
367
|
}
|
|
368
|
-
.awsui_body-
|
|
368
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):hover.awsui_body-cell-last-row_c6tup_11rnr_148:not(.awsui_body-cell-selected_c6tup_11rnr_148) {
|
|
369
369
|
padding-top: calc(var(--space-scaled-xs-wbfgrv, 8px) - calc(var(--border-divider-list-width-um3zli, 1px)));
|
|
370
370
|
}
|
|
371
|
-
.awsui_body-
|
|
371
|
+
.awsui_body-cell_c6tup_11rnr_93.awsui_body-cell-editable_c6tup_11rnr_130:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):hover.awsui_body-cell-first-row_c6tup_11rnr_145:not(.awsui_body-cell-selected_c6tup_11rnr_148) {
|
|
372
372
|
padding-top: calc(var(--space-scaled-xs-wbfgrv, 8px) - calc(var(--border-divider-list-width-um3zli, 1px)));
|
|
373
373
|
padding-bottom: calc(var(--space-scaled-xs-wbfgrv, 8px) - calc(var(--border-divider-list-width-um3zli, 1px)));
|
|
374
374
|
}
|
|
375
|
-
.awsui_body-cell-
|
|
375
|
+
.awsui_body-cell-editable_c6tup_11rnr_130.awsui_is-visual-refresh_c6tup_11rnr_115:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):hover:first-child {
|
|
376
376
|
border-top-left-radius: var(--border-radius-item-gyl0qr, 8px);
|
|
377
377
|
border-bottom-left-radius: var(--border-radius-item-gyl0qr, 8px);
|
|
378
378
|
}
|
|
379
|
-
.awsui_body-cell-
|
|
379
|
+
.awsui_body-cell-editable_c6tup_11rnr_130.awsui_is-visual-refresh_c6tup_11rnr_115:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):hover:last-child {
|
|
380
380
|
border-top-right-radius: var(--border-radius-item-gyl0qr, 8px);
|
|
381
381
|
border-bottom-right-radius: var(--border-radius-item-gyl0qr, 8px);
|
|
382
382
|
}
|
|
383
|
-
.awsui_body-cell-
|
|
383
|
+
.awsui_body-cell-editable_c6tup_11rnr_130.awsui_is-visual-refresh_c6tup_11rnr_115:not(#\9):not(.awsui_body-cell-edit-active_c6tup_11rnr_130):hover.awsui_body-cell-first-row_c6tup_11rnr_145 > .awsui_body-cell-editor_c6tup_11rnr_255 {
|
|
384
384
|
padding-top: var(--border-divider-list-width-um3zli, 1px);
|
|
385
385
|
}
|
|
@@ -2,33 +2,33 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"body-cell": "awsui_body-
|
|
6
|
-
"body-cell-wrap": "awsui_body-cell-
|
|
7
|
-
"is-visual-refresh": "awsui_is-visual-
|
|
8
|
-
"has-striped-rows": "awsui_has-striped-
|
|
9
|
-
"body-cell-edit-active": "awsui_body-cell-edit-
|
|
10
|
-
"body-cell-editable": "awsui_body-cell-
|
|
11
|
-
"has-striped-rows-sticky-cell-pad-left": "awsui_has-striped-rows-sticky-cell-pad-
|
|
12
|
-
"has-selection": "awsui_has-
|
|
13
|
-
"body-cell-first-row": "awsui_body-cell-first-
|
|
14
|
-
"body-cell-last-row": "awsui_body-cell-last-
|
|
15
|
-
"body-cell-selected": "awsui_body-cell-
|
|
16
|
-
"has-footer": "awsui_has-
|
|
17
|
-
"body-cell-shaded": "awsui_body-cell-
|
|
18
|
-
"sticky-cell": "awsui_sticky-
|
|
19
|
-
"sticky-cell-pad-left": "awsui_sticky-cell-pad-
|
|
20
|
-
"sticky-cell-last-right": "awsui_sticky-cell-last-
|
|
21
|
-
"sticky-cell-last-left": "awsui_sticky-cell-last-
|
|
22
|
-
"body-cell-next-selected": "awsui_body-cell-next-
|
|
23
|
-
"body-cell-prev-selected": "awsui_body-cell-prev-
|
|
24
|
-
"body-cell-success": "awsui_body-cell-
|
|
25
|
-
"body-cell-editor": "awsui_body-cell-
|
|
26
|
-
"body-cell-success-form": "awsui_body-cell-success-
|
|
27
|
-
"body-cell-editor-form": "awsui_body-cell-editor-
|
|
28
|
-
"body-cell-success-row": "awsui_body-cell-success-
|
|
29
|
-
"body-cell-editor-row": "awsui_body-cell-editor-
|
|
30
|
-
"body-cell-success-controls": "awsui_body-cell-success-
|
|
31
|
-
"body-cell-editor-controls": "awsui_body-cell-editor-
|
|
32
|
-
"body-cell-has-success": "awsui_body-cell-has-
|
|
5
|
+
"body-cell": "awsui_body-cell_c6tup_11rnr_93",
|
|
6
|
+
"body-cell-wrap": "awsui_body-cell-wrap_c6tup_11rnr_103",
|
|
7
|
+
"is-visual-refresh": "awsui_is-visual-refresh_c6tup_11rnr_115",
|
|
8
|
+
"has-striped-rows": "awsui_has-striped-rows_c6tup_11rnr_127",
|
|
9
|
+
"body-cell-edit-active": "awsui_body-cell-edit-active_c6tup_11rnr_130",
|
|
10
|
+
"body-cell-editable": "awsui_body-cell-editable_c6tup_11rnr_130",
|
|
11
|
+
"has-striped-rows-sticky-cell-pad-left": "awsui_has-striped-rows-sticky-cell-pad-left_c6tup_11rnr_136",
|
|
12
|
+
"has-selection": "awsui_has-selection_c6tup_11rnr_139",
|
|
13
|
+
"body-cell-first-row": "awsui_body-cell-first-row_c6tup_11rnr_145",
|
|
14
|
+
"body-cell-last-row": "awsui_body-cell-last-row_c6tup_11rnr_148",
|
|
15
|
+
"body-cell-selected": "awsui_body-cell-selected_c6tup_11rnr_148",
|
|
16
|
+
"has-footer": "awsui_has-footer_c6tup_11rnr_148",
|
|
17
|
+
"body-cell-shaded": "awsui_body-cell-shaded_c6tup_11rnr_158",
|
|
18
|
+
"sticky-cell": "awsui_sticky-cell_c6tup_11rnr_175",
|
|
19
|
+
"sticky-cell-pad-left": "awsui_sticky-cell-pad-left_c6tup_11rnr_183",
|
|
20
|
+
"sticky-cell-last-right": "awsui_sticky-cell-last-right_c6tup_11rnr_200",
|
|
21
|
+
"sticky-cell-last-left": "awsui_sticky-cell-last-left_c6tup_11rnr_204",
|
|
22
|
+
"body-cell-next-selected": "awsui_body-cell-next-selected_c6tup_11rnr_227",
|
|
23
|
+
"body-cell-prev-selected": "awsui_body-cell-prev-selected_c6tup_11rnr_231",
|
|
24
|
+
"body-cell-success": "awsui_body-cell-success_c6tup_11rnr_255",
|
|
25
|
+
"body-cell-editor": "awsui_body-cell-editor_c6tup_11rnr_255",
|
|
26
|
+
"body-cell-success-form": "awsui_body-cell-success-form_c6tup_11rnr_277",
|
|
27
|
+
"body-cell-editor-form": "awsui_body-cell-editor-form_c6tup_11rnr_277",
|
|
28
|
+
"body-cell-success-row": "awsui_body-cell-success-row_c6tup_11rnr_286",
|
|
29
|
+
"body-cell-editor-row": "awsui_body-cell-editor-row_c6tup_11rnr_286",
|
|
30
|
+
"body-cell-success-controls": "awsui_body-cell-success-controls_c6tup_11rnr_296",
|
|
31
|
+
"body-cell-editor-controls": "awsui_body-cell-editor-controls_c6tup_11rnr_296",
|
|
32
|
+
"body-cell-has-success": "awsui_body-cell-has-success_c6tup_11rnr_315"
|
|
33
33
|
};
|
|
34
34
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import React, { useEffect, useRef, useState, createContext, useContext } from 'react';
|
|
4
4
|
import { getColumnKey } from './utils';
|
|
5
5
|
import headerCellStyles from './header-cell/styles.css.js';
|
|
6
|
-
import { warnOnce } from '
|
|
6
|
+
import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
7
7
|
export const DEFAULT_WIDTH = 120;
|
|
8
8
|
const SELECTION_CELL_WIDTH = 54;
|
|
9
9
|
function checkProperty(column, name) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-column-widths.js","sourceRoot":"lib/default/","sources":["table/use-column-widths.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEtF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"use-column-widths.js","sourceRoot":"lib/default/","sources":["table/use-column-widths.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEtF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAEzE,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,CAAC;AACjC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,SAAS,aAAa,CAAC,MAAwC,EAAE,IAA0B;IACzF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;QAC7D,QAAQ,CACN,OAAO,EACP,qCAAqC,IAAI,iCAAiC,KAAK,uCAAuC,CACvH,CAAC;KACH;AACH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,iBAAkE;IAClG,KAAK,MAAM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,KAAK,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,IAAG,QAAQ,CAA0B,CAAC;AACxH,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,UAAU,CAAC,aAAa,CAAC,CAAC;AACnC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState, createContext, useContext } from 'react';\nimport { TableProps } from './interfaces';\nimport { getColumnKey } from './utils';\nimport headerCellStyles from './header-cell/styles.css.js';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nexport const DEFAULT_WIDTH = 120;\nconst SELECTION_CELL_WIDTH = 54;\n\nfunction checkProperty(column: TableProps.ColumnDefinition<any>, name: 'width' | 'minWidth') {\n const value = column[name];\n if (typeof value !== 'number' && typeof value !== 'undefined') {\n warnOnce(\n 'Table',\n `resizableColumns feature requires ${name} property to be a number, got ${value}. The component may work incorrectly.`\n );\n }\n}\n\nexport function checkColumnWidths(columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<any>>) {\n for (const column of columnDefinitions) {\n checkProperty(column, 'minWidth');\n checkProperty(column, 'width');\n }\n}\n\nfunction readWidths(\n headerEl: HTMLElement,\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<any>>,\n hasSelection: boolean\n) {\n const result: Record<string, number> = {};\n for (let index = 0; index < columnDefinitions.length; index++) {\n const column = columnDefinitions[index];\n const id = getColumnKey(columnDefinitions[index], index);\n let width = (column.width as number) || 0;\n const minWidth = (column.minWidth as number) || width || DEFAULT_WIDTH;\n if (\n !width && // read width from the DOM if it is missing in the config\n index !== columnDefinitions.length - 1 // skip reading for the last column, because it expands to fully fit the container\n ) {\n const colIndex = hasSelection ? index + 2 : index + 1;\n const colEl = headerEl.querySelector<HTMLElement>(`.${headerCellStyles['header-cell']}:nth-child(${colIndex})`)!;\n width = colEl.getBoundingClientRect().width;\n }\n result[id] = Math.max(width, minWidth);\n }\n return result;\n}\n\nfunction updateWidths(\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<any>>,\n oldWidths: Record<string, number>,\n newWidth: number,\n colIndex: number\n) {\n const definition = columnDefinitions[colIndex];\n const id = getColumnKey(definition, colIndex);\n const minWidth = typeof definition.minWidth === 'number' ? definition.minWidth : DEFAULT_WIDTH;\n newWidth = Math.max(newWidth, minWidth);\n if (oldWidths[id] === newWidth) {\n return oldWidths;\n }\n return { ...oldWidths, [id]: newWidth };\n}\n\ninterface WidthsContext {\n totalWidth: number;\n columnWidths: Record<string, number>;\n updateColumn: (colIndex: number, newWidth: number) => void;\n}\n\nconst WidthsContext = createContext<WidthsContext>({\n totalWidth: 0,\n columnWidths: {},\n updateColumn: () => {},\n});\n\ninterface WidthProviderProps {\n tableRef: React.MutableRefObject<HTMLElement | null>;\n visibleColumnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<any>>;\n resizableColumns: boolean | undefined;\n hasSelection: boolean;\n children: React.ReactNode;\n}\n\nexport function ColumnWidthsProvider({\n tableRef,\n visibleColumnDefinitions,\n resizableColumns,\n hasSelection,\n children,\n}: WidthProviderProps) {\n const visibleColumns = useRef<(string | undefined)[] | null>(null);\n const [columnWidths, setColumnWidths] = useState<Record<string, number>>({});\n\n useEffect(() => {\n if (!resizableColumns) {\n return;\n }\n const lastVisible = visibleColumns.current;\n if (lastVisible) {\n for (let index = 0; index < visibleColumnDefinitions.length; index++) {\n const column = visibleColumnDefinitions[index];\n const id = getColumnKey(column, index);\n if (!columnWidths[id] && lastVisible.indexOf(column.id) === -1) {\n setColumnWidths(columnWidths => ({ ...columnWidths, [id]: (column.width as number) || DEFAULT_WIDTH }));\n }\n }\n }\n visibleColumns.current = visibleColumnDefinitions.map(column => column.id);\n }, [columnWidths, resizableColumns, visibleColumnDefinitions]);\n\n useEffect(() => {\n if (!resizableColumns) {\n return;\n }\n setColumnWidths(() => readWidths(tableRef.current!, visibleColumnDefinitions, hasSelection));\n // This code is intended to run only at the first render and should not re-run when table props change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n function updateColumn(colIndex: number, newWidth: number) {\n setColumnWidths(columnWidths => updateWidths(visibleColumnDefinitions, columnWidths, newWidth, colIndex));\n }\n\n let totalWidth = visibleColumnDefinitions.reduce(\n (total, column, index) => total + (columnWidths[getColumnKey(column, index)] || DEFAULT_WIDTH),\n 0\n );\n if (hasSelection) {\n totalWidth += SELECTION_CELL_WIDTH;\n }\n\n return <WidthsContext.Provider value={{ columnWidths, totalWidth, updateColumn }}>{children}</WidthsContext.Provider>;\n}\n\nexport function useColumnWidths() {\n return useContext(WidthsContext);\n}\n"]}
|
package/table/utils.js
CHANGED
package/table/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"lib/default/","sources":["table/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"lib/default/","sources":["table/utils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAGzE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAI,OAA8B,EAAE,IAAO,EAAE,EAAE;IACzE,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE;QACjC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;KACtB;IACD,OAAQ,IAAY,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAI,OAA0C,EAAE,IAAO,EAAE,KAAa,EAAE,EAAE;IAClG,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,KAAK,CAAC;KACd;IACD,OAAO,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAI,OAA0C,EAAE,IAAO,EAAE,EA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K,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,CAAA;KACvD,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { InternalContainerProps } from '../container/internal';\nimport { TableProps } from './interfaces';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport { StickyColumnsCellState } from './use-sticky-columns';\n\nexport const applyTrackBy = <T>(trackBy: TableProps.TrackBy<T>, item: T) => {\n if (typeof trackBy === 'function') {\n return trackBy(item);\n }\n return (item as any)[trackBy];\n};\n\nexport const getItemKey = <T>(trackBy: TableProps.TrackBy<T> | undefined, item: T, index: number) => {\n if (!trackBy) {\n return index;\n }\n return applyTrackBy(trackBy, item);\n};\n\nexport const getTrackableValue = <T>(trackBy: TableProps.TrackBy<T> | undefined, item: T) => {\n if (!trackBy) {\n return item;\n }\n return applyTrackBy(trackBy, item);\n};\n\nexport const getColumnKey = <T>(column: TableProps.ColumnDefinition<T>, index: number) => {\n return column.id || index;\n};\n\nexport const toContainerVariant = (variant: TableProps.Variant | undefined): InternalContainerProps['variant'] => {\n const isDefaultVariant = !variant || variant === 'container';\n return isDefaultVariant ? 'default' : variant === 'borderless' ? 'embedded' : variant;\n};\n\nexport function checkSortingState<T>(\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>,\n sortingComparator: TableProps.SortingColumn<T>['sortingComparator']\n) {\n const matchedColumn = columnDefinitions.filter(column => column.sortingComparator === sortingComparator)[0];\n if (!matchedColumn) {\n warnOnce(\n 'Table',\n 'Currently active sorting comparator was not found in any columns. Make sure to provide the same comparator function instance on each render.'\n );\n }\n}\n\nexport function getVisibleColumnDefinitions<T>({\n columnDisplay,\n visibleColumns,\n columnDefinitions,\n}: {\n columnDisplay?: ReadonlyArray<TableProps.ColumnDisplayProperties>;\n visibleColumns?: ReadonlyArray<string>;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;\n}) {\n // columnsDisplay has a precedence over visibleColumns.\n if (columnDisplay) {\n return getVisibleColumnDefinitionsFromColumnDisplay({ columnDisplay, columnDefinitions });\n } else if (visibleColumns) {\n return getVisibleColumnDefinitionsFromVisibleColumns({ visibleColumns, columnDefinitions });\n } else {\n return columnDefinitions;\n }\n}\n\nfunction getVisibleColumnDefinitionsFromColumnDisplay<T>({\n columnDisplay,\n columnDefinitions,\n}: {\n columnDisplay: ReadonlyArray<TableProps.ColumnDisplayProperties>;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;\n}) {\n const columnDefinitionsById: Record<string, TableProps.ColumnDefinition<T>> = columnDefinitions.reduce(\n (accumulator, item) => (item.id === undefined ? accumulator : { ...accumulator, [item.id]: item }),\n {}\n );\n return columnDisplay\n .filter(item => item.visible)\n .map(item => columnDefinitionsById[item.id])\n .filter(Boolean);\n}\n\nfunction getVisibleColumnDefinitionsFromVisibleColumns<T>({\n visibleColumns,\n columnDefinitions,\n}: {\n visibleColumns: ReadonlyArray<string>;\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;\n}) {\n const ids = new Set(visibleColumns);\n return columnDefinitions.filter(({ id }) => id !== undefined && ids.has(id));\n}\n\nexport function getStickyClassNames(styles: Record<string, string>, props: StickyColumnsCellState | null) {\n return {\n [styles['sticky-cell']]: !!props,\n [styles['sticky-cell-pad-left']]: !!props?.padLeft,\n [styles['sticky-cell-last-left']]: !!props?.lastLeft,\n [styles['sticky-cell-last-right']]: !!props?.lastRight,\n };\n}\n"]}
|
package/wizard/internal.js
CHANGED
|
@@ -5,7 +5,7 @@ import React, { useRef } from 'react';
|
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import { getBaseProps } from '../internal/base-component';
|
|
7
7
|
import { fireNonCancelableEvent } from '../internal/events';
|
|
8
|
-
import { warnOnce } from '
|
|
8
|
+
import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
|
|
9
9
|
import { useContainerBreakpoints } from '../internal/hooks/container-queries';
|
|
10
10
|
import { useControllable } from '../internal/hooks/use-controllable';
|
|
11
11
|
import { useMergeRefs } from '../internal/hooks/use-merge-refs';
|
package/wizard/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["wizard/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAGrE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AAInD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAWjB;;QAXiB,EACrC,KAAK,EACL,eAAe,EAAE,yBAAyB,EAC1C,iBAAiB,GAAG,KAAK,EACzB,WAAW,GAAG,KAAK,EACnB,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,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AC,MAAM,CAAC,MAAM,EAAE,eAAe,IAAI,MAAM,CAAC,OAAO,EAAE,cAAc,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;YAE9G,oBAAC,gBAAgB,IACf,eAAe,EAAE,qBAAqB,EACtC,iBAAiB,EAAE,iBAAiB,CAAC,OAAO,EAC5C,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,cAAc,EACtB,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,KAAK,GACZ;YACF,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,eAAe,IAAI,MAAM,CAAC,OAAO,EAAE,cAAc,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;gBAE3G,eAAe,IAAI,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,8BAA8B,CAAC,GAAI;gBAC/F,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,EAChC,kBAAkB,EAAE,cAAc,EAClC,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,qBAAqB,EACtC,gBAAgB,EAAE,iBAAiB,EACnC,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,GAC9B,CACE,CACF,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { warnOnce } from '../internal/logging';\n\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nimport { useInternalI18n } from '../internal/i18n/context';\n\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel } from '../internal/analytics/hooks/use-funnel';\nimport { getSubStepAllSelector } from '../internal/analytics/selectors';\n\nimport WizardForm from './wizard-form';\nimport WizardNavigation from './wizard-navigation';\n\nimport { WizardProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ntype InternalWizardProps = WizardProps & InternalBaseComponentProps;\n\nexport default function InternalWizard({\n steps,\n activeStepIndex: controlledActiveStepIndex,\n isLoadingNextStep = false,\n allowSkipTo = false,\n secondaryActions,\n onCancel,\n onSubmit,\n onNavigate,\n __internalRootRef,\n ...rest\n}: InternalWizardProps) {\n const baseProps = getBaseProps(rest);\n\n const [breakpoint, breakpointsRef] = useContainerBreakpoints(['xs']);\n const ref = useMergeRefs(breakpointsRef, __internalRootRef);\n\n const smallContainer = breakpoint === 'default';\n\n const [activeStepIndex, setActiveStepIndex] = useControllable(controlledActiveStepIndex, onNavigate, 0, {\n componentName: 'Wizard',\n controlledProp: 'activeStepIndex',\n changeHandler: 'onNavigate',\n });\n const { funnelInteractionId, funnelSubmit, funnelCancel, funnelProps } = useFunnel();\n const actualActiveStepIndex = activeStepIndex ? Math.min(activeStepIndex, steps.length - 1) : 0;\n\n const farthestStepIndex = useRef<number>(actualActiveStepIndex);\n farthestStepIndex.current = Math.max(farthestStepIndex.current, actualActiveStepIndex);\n\n const isVisualRefresh = useVisualRefresh();\n const isLastStep = actualActiveStepIndex >= steps.length - 1;\n\n const navigationEvent = (requestedStepIndex: number, reason: WizardProps.NavigationReason) => {\n if (funnelInteractionId) {\n FunnelMetrics.funnelStepNavigation({\n navigationType: reason,\n funnelInteractionId,\n stepNumber: actualActiveStepIndex + 1,\n stepNameSelector: `.${styles['form-header-component-wrapper']}`,\n destinationStepNumber: requestedStepIndex + 1,\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n\n setActiveStepIndex(requestedStepIndex);\n fireNonCancelableEvent(onNavigate, { requestedStepIndex, reason });\n };\n const onStepClick = (stepIndex: number) => navigationEvent(stepIndex, 'step');\n const onSkipToClick = (stepIndex: number) => navigationEvent(stepIndex, 'skip');\n const onCancelClick = () => {\n funnelCancel();\n fireNonCancelableEvent(onCancel);\n };\n const onPreviousClick = () => navigationEvent(actualActiveStepIndex - 1, 'previous');\n const onPrimaryClick = () => {\n if (isLastStep) {\n funnelSubmit();\n fireNonCancelableEvent(onSubmit);\n } else {\n navigationEvent(actualActiveStepIndex + 1, 'next');\n }\n };\n\n const i18n = useInternalI18n('wizard');\n const skipToButtonLabel = i18n(\n 'i18nStrings.skipToButtonLabel',\n rest.i18nStrings.skipToButtonLabel,\n format => task => format({ task__title: task.title })\n );\n\n const i18nStrings: WizardProps.I18nStrings = {\n ...rest.i18nStrings,\n skipToButtonLabel,\n stepNumberLabel: i18n(\n 'i18nStrings.stepNumberLabel',\n rest.i18nStrings?.stepNumberLabel,\n format => stepNumber => format({ stepNumber })\n ),\n collapsedStepsLabel: i18n(\n 'i18nStrings.collapsedStepsLabel',\n rest.i18nStrings?.collapsedStepsLabel,\n format => (stepNumber, stepsCount) => format({ stepNumber, stepsCount })\n ),\n cancelButton: i18n('i18nStrings.cancelButton', rest.i18nStrings.cancelButton),\n previousButton: i18n('i18nStrings.previousButton', rest.i18nStrings.previousButton),\n nextButton: i18n('i18nStrings.nextButton', rest.i18nStrings.nextButton),\n optional: i18n('i18nStrings.optional', rest.i18nStrings.optional),\n };\n\n if (activeStepIndex && activeStepIndex >= steps.length) {\n warnOnce(\n 'Wizard',\n `You have set \\`activeStepIndex\\` to ${activeStepIndex} but you have provided only ${\n steps.length\n } steps. Its value is ignored and the component uses ${steps.length - 1} instead.`\n );\n }\n\n if (allowSkipTo && !skipToButtonLabel) {\n warnOnce(\n 'Wizard',\n `You have set \\`allowSkipTo\\` but you have not provided \\`i18nStrings.skipToButtonLabel\\`. The skip-to button will not be rendered.`\n );\n }\n\n return (\n <div {...baseProps} {...funnelProps} ref={ref} className={clsx(styles.root, baseProps.className)}>\n <div\n className={clsx(styles.wizard, isVisualRefresh && styles.refresh, smallContainer && styles['small-container'])}\n >\n <WizardNavigation\n activeStepIndex={actualActiveStepIndex}\n farthestStepIndex={farthestStepIndex.current}\n allowSkipTo={allowSkipTo}\n hidden={smallContainer}\n i18nStrings={i18nStrings}\n isVisualRefresh={isVisualRefresh}\n isLoadingNextStep={isLoadingNextStep}\n onStepClick={onStepClick}\n onSkipToClick={onSkipToClick}\n steps={steps}\n />\n <div\n className={clsx(styles.form, isVisualRefresh && styles.refresh, smallContainer && styles['small-container'])}\n >\n {isVisualRefresh && <div className={clsx(styles.background, 'awsui-context-content-header')} />}\n <WizardForm\n steps={steps}\n isVisualRefresh={isVisualRefresh}\n showCollapsedSteps={smallContainer}\n i18nStrings={i18nStrings}\n activeStepIndex={actualActiveStepIndex}\n isPrimaryLoading={isLoadingNextStep}\n allowSkipTo={allowSkipTo}\n secondaryActions={secondaryActions}\n onCancelClick={onCancelClick}\n onPreviousClick={onPreviousClick}\n onSkipToClick={onSkipToClick}\n onPrimaryClick={onPrimaryClick}\n />\n </div>\n </div>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"lib/default/","sources":["wizard/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;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,cAAc,IAAI,MAAM,CAAC,iBAAiB,CAAC,CAAC;gBAE3G,eAAe,IAAI,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,8BAA8B,CAAC,GAAI;gBAC/F,oBAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,eAAe,EAChC,kBAAkB,EAAE,cAAc,EAClC,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,qBAAqB,EACtC,gBAAgB,EAAE,iBAAiB,EACnC,WAAW,EAAE,WAAW,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,cAAc,EAAE,cAAc,GAC9B,CACE,CACF,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\n\nimport { useInternalI18n } from '../internal/i18n/context';\n\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel } from '../internal/analytics/hooks/use-funnel';\nimport { getSubStepAllSelector } from '../internal/analytics/selectors';\n\nimport WizardForm from './wizard-form';\nimport WizardNavigation from './wizard-navigation';\n\nimport { WizardProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ntype InternalWizardProps = WizardProps & InternalBaseComponentProps;\n\nexport default function InternalWizard({\n steps,\n activeStepIndex: controlledActiveStepIndex,\n isLoadingNextStep = false,\n allowSkipTo = false,\n secondaryActions,\n onCancel,\n onSubmit,\n onNavigate,\n __internalRootRef,\n ...rest\n}: InternalWizardProps) {\n const baseProps = getBaseProps(rest);\n\n const [breakpoint, breakpointsRef] = useContainerBreakpoints(['xs']);\n const ref = useMergeRefs(breakpointsRef, __internalRootRef);\n\n const smallContainer = breakpoint === 'default';\n\n const [activeStepIndex, setActiveStepIndex] = useControllable(controlledActiveStepIndex, onNavigate, 0, {\n componentName: 'Wizard',\n controlledProp: 'activeStepIndex',\n changeHandler: 'onNavigate',\n });\n const { funnelInteractionId, funnelSubmit, funnelCancel, funnelProps } = useFunnel();\n const actualActiveStepIndex = activeStepIndex ? Math.min(activeStepIndex, steps.length - 1) : 0;\n\n const farthestStepIndex = useRef<number>(actualActiveStepIndex);\n farthestStepIndex.current = Math.max(farthestStepIndex.current, actualActiveStepIndex);\n\n const isVisualRefresh = useVisualRefresh();\n const isLastStep = actualActiveStepIndex >= steps.length - 1;\n\n const navigationEvent = (requestedStepIndex: number, reason: WizardProps.NavigationReason) => {\n if (funnelInteractionId) {\n FunnelMetrics.funnelStepNavigation({\n navigationType: reason,\n funnelInteractionId,\n stepNumber: actualActiveStepIndex + 1,\n stepNameSelector: `.${styles['form-header-component-wrapper']}`,\n destinationStepNumber: requestedStepIndex + 1,\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n\n setActiveStepIndex(requestedStepIndex);\n fireNonCancelableEvent(onNavigate, { requestedStepIndex, reason });\n };\n const onStepClick = (stepIndex: number) => navigationEvent(stepIndex, 'step');\n const onSkipToClick = (stepIndex: number) => navigationEvent(stepIndex, 'skip');\n const onCancelClick = () => {\n funnelCancel();\n fireNonCancelableEvent(onCancel);\n };\n const onPreviousClick = () => navigationEvent(actualActiveStepIndex - 1, 'previous');\n const onPrimaryClick = () => {\n if (isLastStep) {\n funnelSubmit();\n fireNonCancelableEvent(onSubmit);\n } else {\n navigationEvent(actualActiveStepIndex + 1, 'next');\n }\n };\n\n const i18n = useInternalI18n('wizard');\n const skipToButtonLabel = i18n(\n 'i18nStrings.skipToButtonLabel',\n rest.i18nStrings.skipToButtonLabel,\n format => task => format({ task__title: task.title })\n );\n\n const i18nStrings: WizardProps.I18nStrings = {\n ...rest.i18nStrings,\n skipToButtonLabel,\n stepNumberLabel: i18n(\n 'i18nStrings.stepNumberLabel',\n rest.i18nStrings?.stepNumberLabel,\n format => stepNumber => format({ stepNumber })\n ),\n collapsedStepsLabel: i18n(\n 'i18nStrings.collapsedStepsLabel',\n rest.i18nStrings?.collapsedStepsLabel,\n format => (stepNumber, stepsCount) => format({ stepNumber, stepsCount })\n ),\n cancelButton: i18n('i18nStrings.cancelButton', rest.i18nStrings.cancelButton),\n previousButton: i18n('i18nStrings.previousButton', rest.i18nStrings.previousButton),\n nextButton: i18n('i18nStrings.nextButton', rest.i18nStrings.nextButton),\n optional: i18n('i18nStrings.optional', rest.i18nStrings.optional),\n };\n\n if (activeStepIndex && activeStepIndex >= steps.length) {\n warnOnce(\n 'Wizard',\n `You have set \\`activeStepIndex\\` to ${activeStepIndex} but you have provided only ${\n steps.length\n } steps. Its value is ignored and the component uses ${steps.length - 1} instead.`\n );\n }\n\n if (allowSkipTo && !skipToButtonLabel) {\n warnOnce(\n 'Wizard',\n `You have set \\`allowSkipTo\\` but you have not provided \\`i18nStrings.skipToButtonLabel\\`. The skip-to button will not be rendered.`\n );\n }\n\n return (\n <div {...baseProps} {...funnelProps} ref={ref} className={clsx(styles.root, baseProps.className)}>\n <div\n className={clsx(styles.wizard, isVisualRefresh && styles.refresh, smallContainer && styles['small-container'])}\n >\n <WizardNavigation\n activeStepIndex={actualActiveStepIndex}\n farthestStepIndex={farthestStepIndex.current}\n allowSkipTo={allowSkipTo}\n hidden={smallContainer}\n i18nStrings={i18nStrings}\n isVisualRefresh={isVisualRefresh}\n isLoadingNextStep={isLoadingNextStep}\n onStepClick={onStepClick}\n onSkipToClick={onSkipToClick}\n steps={steps}\n />\n <div\n className={clsx(styles.form, isVisualRefresh && styles.refresh, smallContainer && styles['small-container'])}\n >\n {isVisualRefresh && <div className={clsx(styles.background, 'awsui-context-content-header')} />}\n <WizardForm\n steps={steps}\n isVisualRefresh={isVisualRefresh}\n showCollapsedSteps={smallContainer}\n i18nStrings={i18nStrings}\n activeStepIndex={actualActiveStepIndex}\n isPrimaryLoading={isLoadingNextStep}\n allowSkipTo={allowSkipTo}\n secondaryActions={secondaryActions}\n onCancelClick={onCancelClick}\n onPreviousClick={onPreviousClick}\n onSkipToClick={onSkipToClick}\n onPrimaryClick={onPrimaryClick}\n />\n </div>\n </div>\n </div>\n );\n}\n"]}
|
package/internal/logging.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","sourceRoot":"lib/default/","sources":["internal/logging.ts"],"names":[],"mappings":"AAMA,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAQjE"}
|