@cloudscape-design/components 3.0.986 → 3.0.987
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/visual-refresh-toolbar/drawer/styles.css.js +17 -17
- package/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +37 -37
- package/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +17 -17
- package/button/internal.js +1 -1
- package/button/internal.js.map +1 -1
- package/internal/environment.js +1 -1
- package/internal/environment.json +1 -1
- package/internal/manifest.json +1 -1
- package/package.json +1 -1
- package/table/interfaces.d.ts +2 -5
- package/table/interfaces.d.ts.map +1 -1
- package/table/interfaces.js.map +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"drawer": "
|
|
5
|
-
"with-expanded-motion": "awsui_with-expanded-
|
|
6
|
-
"legacy": "
|
|
7
|
-
"last-opened": "awsui_last-
|
|
8
|
-
"drawer-global": "awsui_drawer-
|
|
9
|
-
"drawer-expanded": "awsui_drawer-
|
|
10
|
-
"drawer-hidden": "awsui_drawer-
|
|
11
|
-
"has-next-siblings": "awsui_has-next-
|
|
12
|
-
"global-drawer-wrapper": "awsui_global-drawer-
|
|
13
|
-
"drawer-content-container": "awsui_drawer-content-
|
|
14
|
-
"drawer-gap": "awsui_drawer-
|
|
15
|
-
"drawer-close-button": "awsui_drawer-close-
|
|
16
|
-
"drawer-expanded-mode-button": "awsui_drawer-expanded-mode-
|
|
17
|
-
"drawer-content": "awsui_drawer-
|
|
18
|
-
"drawer-content-hidden": "awsui_drawer-content-
|
|
19
|
-
"drawer-slider": "awsui_drawer-
|
|
20
|
-
"drawer-actions": "awsui_drawer-
|
|
4
|
+
"drawer": "awsui_drawer_12i0j_w2bd3_189",
|
|
5
|
+
"with-expanded-motion": "awsui_with-expanded-motion_12i0j_w2bd3_203",
|
|
6
|
+
"legacy": "awsui_legacy_12i0j_w2bd3_217",
|
|
7
|
+
"last-opened": "awsui_last-opened_12i0j_w2bd3_225",
|
|
8
|
+
"drawer-global": "awsui_drawer-global_12i0j_w2bd3_229",
|
|
9
|
+
"drawer-expanded": "awsui_drawer-expanded_12i0j_w2bd3_238",
|
|
10
|
+
"drawer-hidden": "awsui_drawer-hidden_12i0j_w2bd3_242",
|
|
11
|
+
"has-next-siblings": "awsui_has-next-siblings_12i0j_w2bd3_252",
|
|
12
|
+
"global-drawer-wrapper": "awsui_global-drawer-wrapper_12i0j_w2bd3_252",
|
|
13
|
+
"drawer-content-container": "awsui_drawer-content-container_12i0j_w2bd3_266",
|
|
14
|
+
"drawer-gap": "awsui_drawer-gap_12i0j_w2bd3_269",
|
|
15
|
+
"drawer-close-button": "awsui_drawer-close-button_12i0j_w2bd3_287",
|
|
16
|
+
"drawer-expanded-mode-button": "awsui_drawer-expanded-mode-button_12i0j_w2bd3_293",
|
|
17
|
+
"drawer-content": "awsui_drawer-content_12i0j_w2bd3_266",
|
|
18
|
+
"drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_w2bd3_305",
|
|
19
|
+
"drawer-slider": "awsui_drawer-slider_12i0j_w2bd3_308",
|
|
20
|
+
"drawer-actions": "awsui_drawer-actions_12i0j_w2bd3_359"
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -186,7 +186,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
186
186
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
187
187
|
SPDX-License-Identifier: Apache-2.0
|
|
188
188
|
*/
|
|
189
|
-
.
|
|
189
|
+
.awsui_drawer_12i0j_w2bd3_189:not(#\9) {
|
|
190
190
|
position: sticky;
|
|
191
191
|
z-index: 830;
|
|
192
192
|
background-color: var(--color-background-container-content-78ljyf, #ffffff);
|
|
@@ -200,56 +200,56 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
200
200
|
pointer-events: auto;
|
|
201
201
|
word-wrap: break-word;
|
|
202
202
|
}
|
|
203
|
-
.
|
|
203
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_with-expanded-motion_12i0j_w2bd3_203:not(#\9) {
|
|
204
204
|
transition: inline-size var(--motion-duration-refresh-only-slow-ugjy90, 250ms) var(--motion-easing-refresh-only-a-ccyqaz, cubic-bezier(0, 0, 0, 1)), min-inline-size var(--motion-duration-refresh-only-slow-ugjy90, 250ms) var(--motion-easing-refresh-only-a-ccyqaz, cubic-bezier(0, 0, 0, 1));
|
|
205
205
|
}
|
|
206
206
|
@media (prefers-reduced-motion: reduce) {
|
|
207
|
-
.
|
|
207
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_with-expanded-motion_12i0j_w2bd3_203:not(#\9) {
|
|
208
208
|
animation: none;
|
|
209
209
|
transition: none;
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
.awsui-motion-disabled .
|
|
212
|
+
.awsui-motion-disabled .awsui_drawer_12i0j_w2bd3_189.awsui_with-expanded-motion_12i0j_w2bd3_203:not(#\9), .awsui-mode-entering .awsui_drawer_12i0j_w2bd3_189.awsui_with-expanded-motion_12i0j_w2bd3_203:not(#\9) {
|
|
213
213
|
animation: none;
|
|
214
214
|
transition: none;
|
|
215
215
|
}
|
|
216
216
|
@media (min-width: 689px) {
|
|
217
|
-
.
|
|
217
|
+
.awsui_drawer_12i0j_w2bd3_189:not(#\9):not(.awsui_legacy_12i0j_w2bd3_217) {
|
|
218
218
|
border-inline-start: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-layout-px1i24, #c6c6cd);
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
@media (max-width: 688px) {
|
|
222
|
-
.
|
|
222
|
+
.awsui_drawer_12i0j_w2bd3_189:not(#\9) {
|
|
223
223
|
inline-size: 100%;
|
|
224
224
|
}
|
|
225
|
-
.
|
|
225
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_last-opened_12i0j_w2bd3_225:not(#\9) {
|
|
226
226
|
z-index: 1001;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
.
|
|
229
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_drawer-global_12i0j_w2bd3_229:not(#\9) {
|
|
230
230
|
display: block;
|
|
231
231
|
}
|
|
232
232
|
@media (min-width: 689px) {
|
|
233
|
-
.
|
|
233
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_drawer-global_12i0j_w2bd3_229:not(#\9) {
|
|
234
234
|
inline-size: var(--awsui-drawer-size-xgujsu);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
@media (max-width: 688px) {
|
|
238
|
-
.
|
|
238
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_drawer-global_12i0j_w2bd3_229:not(#\9):not(.awsui_last-opened_12i0j_w2bd3_225):not(.awsui_drawer-expanded_12i0j_w2bd3_238) {
|
|
239
239
|
display: none;
|
|
240
240
|
}
|
|
241
241
|
}
|
|
242
|
-
.
|
|
242
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_drawer-hidden_12i0j_w2bd3_242:not(#\9) {
|
|
243
243
|
display: none;
|
|
244
244
|
}
|
|
245
|
-
.
|
|
245
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_drawer-expanded_12i0j_w2bd3_238:not(#\9) {
|
|
246
246
|
inline-size: 100%;
|
|
247
247
|
}
|
|
248
248
|
@media (min-width: 689px) {
|
|
249
|
-
.
|
|
249
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_drawer-expanded_12i0j_w2bd3_238:not(#\9) {
|
|
250
250
|
border-inline-start: none;
|
|
251
251
|
}
|
|
252
|
-
.
|
|
252
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_drawer-expanded_12i0j_w2bd3_238.awsui_has-next-siblings_12i0j_w2bd3_252 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252:not(#\9):after {
|
|
253
253
|
content: "";
|
|
254
254
|
position: absolute;
|
|
255
255
|
block-size: 100%;
|
|
@@ -259,14 +259,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
259
259
|
border-inline-start: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-layout-px1i24, #c6c6cd);
|
|
260
260
|
box-sizing: border-box;
|
|
261
261
|
}
|
|
262
|
-
.
|
|
262
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_drawer-expanded_12i0j_w2bd3_238 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252:not(#\9) {
|
|
263
263
|
inline-size: 100%;
|
|
264
264
|
grid-template-columns: 8px 1fr;
|
|
265
265
|
}
|
|
266
|
-
.
|
|
266
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_drawer-expanded_12i0j_w2bd3_238 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252 > .awsui_drawer-content-container_12i0j_w2bd3_266:not(#\9) {
|
|
267
267
|
grid-column: 2;
|
|
268
268
|
}
|
|
269
|
-
.
|
|
269
|
+
.awsui_drawer_12i0j_w2bd3_189.awsui_drawer-expanded_12i0j_w2bd3_238 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252 > .awsui_drawer-gap_12i0j_w2bd3_269:not(#\9) {
|
|
270
270
|
grid-column: 1;
|
|
271
271
|
grid-row: 1;
|
|
272
272
|
block-size: 100%;
|
|
@@ -275,7 +275,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
275
275
|
border-inline-end: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-layout-px1i24, #c6c6cd);
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
|
-
.
|
|
278
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_drawer-content-container_12i0j_w2bd3_266:not(#\9) {
|
|
279
279
|
grid-column: 1/span 2;
|
|
280
280
|
grid-row: 1;
|
|
281
281
|
display: grid;
|
|
@@ -284,13 +284,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
284
284
|
overflow-y: auto;
|
|
285
285
|
min-inline-size: var(--awsui-drawer-size-xgujsu);
|
|
286
286
|
}
|
|
287
|
-
.
|
|
287
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_drawer-content-container_12i0j_w2bd3_266 > .awsui_drawer-close-button_12i0j_w2bd3_287:not(#\9) {
|
|
288
288
|
grid-column: 3;
|
|
289
289
|
grid-row: 2;
|
|
290
290
|
z-index: 1;
|
|
291
291
|
align-self: start;
|
|
292
292
|
}
|
|
293
|
-
.
|
|
293
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_drawer-content-container_12i0j_w2bd3_266 > .awsui_drawer-expanded-mode-button_12i0j_w2bd3_293:not(#\9) {
|
|
294
294
|
grid-column: 2;
|
|
295
295
|
grid-row: 2;
|
|
296
296
|
z-index: 1;
|
|
@@ -298,33 +298,33 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
298
298
|
display: flex;
|
|
299
299
|
justify-content: flex-end;
|
|
300
300
|
}
|
|
301
|
-
.
|
|
301
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_drawer-content-container_12i0j_w2bd3_266 > .awsui_drawer-content_12i0j_w2bd3_266:not(#\9) {
|
|
302
302
|
grid-column: 1/span 4;
|
|
303
303
|
grid-row: 1/span 2;
|
|
304
304
|
}
|
|
305
|
-
.
|
|
305
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_drawer-content-container_12i0j_w2bd3_266 > .awsui_drawer-content_12i0j_w2bd3_266.awsui_drawer-content-hidden_12i0j_w2bd3_305:not(#\9) {
|
|
306
306
|
display: none;
|
|
307
307
|
}
|
|
308
|
-
.
|
|
308
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_drawer-slider_12i0j_w2bd3_308:not(#\9) {
|
|
309
309
|
grid-column: 1;
|
|
310
310
|
grid-row: 1;
|
|
311
311
|
block-size: 100%;
|
|
312
312
|
display: flex;
|
|
313
313
|
align-items: center;
|
|
314
314
|
}
|
|
315
|
-
.
|
|
315
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252:not(#\9) {
|
|
316
316
|
display: grid;
|
|
317
317
|
min-inline-size: var(--awsui-drawer-size-xgujsu);
|
|
318
318
|
grid-template-columns: 8px var(--space-m-dsumyt, 16px) 1fr;
|
|
319
319
|
overflow: hidden;
|
|
320
320
|
}
|
|
321
321
|
@media (max-width: 688px) {
|
|
322
|
-
.
|
|
322
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252:not(#\9) {
|
|
323
323
|
grid-template-columns: 1fr;
|
|
324
324
|
grid-column: 1/span 2;
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
.
|
|
327
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252 > .awsui_drawer-gap_12i0j_w2bd3_269:not(#\9) {
|
|
328
328
|
grid-column: 1;
|
|
329
329
|
grid-row: 1;
|
|
330
330
|
block-size: 100%;
|
|
@@ -333,13 +333,13 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
333
333
|
border-inline-end: var(--border-divider-section-width-uwo8my, 1px) solid var(--color-border-layout-px1i24, #c6c6cd);
|
|
334
334
|
box-sizing: border-box;
|
|
335
335
|
}
|
|
336
|
-
.
|
|
336
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252 > .awsui_drawer-slider_12i0j_w2bd3_308:not(#\9) {
|
|
337
337
|
grid-column: 2;
|
|
338
338
|
grid-row: 1;
|
|
339
339
|
display: flex;
|
|
340
340
|
align-items: center;
|
|
341
341
|
}
|
|
342
|
-
.
|
|
342
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252 > .awsui_drawer-content-container_12i0j_w2bd3_266:not(#\9) {
|
|
343
343
|
grid-row: 1;
|
|
344
344
|
display: grid;
|
|
345
345
|
grid-template-columns: var(--space-m-dsumyt, 16px) 1fr auto var(--space-m-dsumyt, 16px);
|
|
@@ -347,30 +347,30 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
347
347
|
overflow-y: auto;
|
|
348
348
|
}
|
|
349
349
|
@media (min-width: 689px) {
|
|
350
|
-
.
|
|
350
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252 > .awsui_drawer-content-container_12i0j_w2bd3_266:not(#\9) {
|
|
351
351
|
grid-column: 2/span 2;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
@media (max-width: 688px) {
|
|
355
|
-
.
|
|
355
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252 > .awsui_drawer-content-container_12i0j_w2bd3_266:not(#\9) {
|
|
356
356
|
grid-column: 1/span 2;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
.
|
|
359
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252 > .awsui_drawer-content-container_12i0j_w2bd3_266 > .awsui_drawer-actions_12i0j_w2bd3_359:not(#\9) {
|
|
360
360
|
position: absolute;
|
|
361
361
|
display: flex;
|
|
362
|
-
|
|
363
|
-
|
|
362
|
+
inset-block-start: 0;
|
|
363
|
+
inset-inline-end: 0;
|
|
364
364
|
padding-inline-end: var(--space-m-dsumyt, 16px);
|
|
365
365
|
padding-block-start: 14px;
|
|
366
366
|
}
|
|
367
|
-
.
|
|
367
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252 > .awsui_drawer-content-container_12i0j_w2bd3_266 > .awsui_drawer-close-button_12i0j_w2bd3_287:not(#\9) {
|
|
368
368
|
grid-column: 3;
|
|
369
369
|
grid-row: 2;
|
|
370
370
|
z-index: 1;
|
|
371
371
|
align-self: start;
|
|
372
372
|
}
|
|
373
|
-
.
|
|
373
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252 > .awsui_drawer-content-container_12i0j_w2bd3_266 > .awsui_drawer-expanded-mode-button_12i0j_w2bd3_293:not(#\9) {
|
|
374
374
|
grid-column: 2;
|
|
375
375
|
grid-row: 2;
|
|
376
376
|
z-index: 1;
|
|
@@ -378,10 +378,10 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
378
378
|
display: flex;
|
|
379
379
|
justify-content: flex-end;
|
|
380
380
|
}
|
|
381
|
-
.
|
|
381
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252 > .awsui_drawer-content-container_12i0j_w2bd3_266 > .awsui_drawer-content_12i0j_w2bd3_266:not(#\9) {
|
|
382
382
|
grid-column: 1/span 4;
|
|
383
383
|
grid-row: 1/span 2;
|
|
384
384
|
}
|
|
385
|
-
.
|
|
385
|
+
.awsui_drawer_12i0j_w2bd3_189 > .awsui_global-drawer-wrapper_12i0j_w2bd3_252 > .awsui_drawer-content-container_12i0j_w2bd3_266 > .awsui_drawer-content_12i0j_w2bd3_266.awsui_drawer-content-hidden_12i0j_w2bd3_305:not(#\9) {
|
|
386
386
|
display: none;
|
|
387
387
|
}
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"drawer": "
|
|
6
|
-
"with-expanded-motion": "awsui_with-expanded-
|
|
7
|
-
"legacy": "
|
|
8
|
-
"last-opened": "awsui_last-
|
|
9
|
-
"drawer-global": "awsui_drawer-
|
|
10
|
-
"drawer-expanded": "awsui_drawer-
|
|
11
|
-
"drawer-hidden": "awsui_drawer-
|
|
12
|
-
"has-next-siblings": "awsui_has-next-
|
|
13
|
-
"global-drawer-wrapper": "awsui_global-drawer-
|
|
14
|
-
"drawer-content-container": "awsui_drawer-content-
|
|
15
|
-
"drawer-gap": "awsui_drawer-
|
|
16
|
-
"drawer-close-button": "awsui_drawer-close-
|
|
17
|
-
"drawer-expanded-mode-button": "awsui_drawer-expanded-mode-
|
|
18
|
-
"drawer-content": "awsui_drawer-
|
|
19
|
-
"drawer-content-hidden": "awsui_drawer-content-
|
|
20
|
-
"drawer-slider": "awsui_drawer-
|
|
21
|
-
"drawer-actions": "awsui_drawer-
|
|
5
|
+
"drawer": "awsui_drawer_12i0j_w2bd3_189",
|
|
6
|
+
"with-expanded-motion": "awsui_with-expanded-motion_12i0j_w2bd3_203",
|
|
7
|
+
"legacy": "awsui_legacy_12i0j_w2bd3_217",
|
|
8
|
+
"last-opened": "awsui_last-opened_12i0j_w2bd3_225",
|
|
9
|
+
"drawer-global": "awsui_drawer-global_12i0j_w2bd3_229",
|
|
10
|
+
"drawer-expanded": "awsui_drawer-expanded_12i0j_w2bd3_238",
|
|
11
|
+
"drawer-hidden": "awsui_drawer-hidden_12i0j_w2bd3_242",
|
|
12
|
+
"has-next-siblings": "awsui_has-next-siblings_12i0j_w2bd3_252",
|
|
13
|
+
"global-drawer-wrapper": "awsui_global-drawer-wrapper_12i0j_w2bd3_252",
|
|
14
|
+
"drawer-content-container": "awsui_drawer-content-container_12i0j_w2bd3_266",
|
|
15
|
+
"drawer-gap": "awsui_drawer-gap_12i0j_w2bd3_269",
|
|
16
|
+
"drawer-close-button": "awsui_drawer-close-button_12i0j_w2bd3_287",
|
|
17
|
+
"drawer-expanded-mode-button": "awsui_drawer-expanded-mode-button_12i0j_w2bd3_293",
|
|
18
|
+
"drawer-content": "awsui_drawer-content_12i0j_w2bd3_266",
|
|
19
|
+
"drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_w2bd3_305",
|
|
20
|
+
"drawer-slider": "awsui_drawer-slider_12i0j_w2bd3_308",
|
|
21
|
+
"drawer-actions": "awsui_drawer-actions_12i0j_w2bd3_359"
|
|
22
22
|
};
|
|
23
23
|
|
package/button/internal.js
CHANGED
|
@@ -112,7 +112,7 @@ export const InternalButton = React.forwardRef((_a, ref) => {
|
|
|
112
112
|
// https://github.com/microsoft/TypeScript/issues/36659
|
|
113
113
|
ref: useMergeRefs(buttonRef, __internalRootRef), 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedby, 'aria-expanded': ariaExpanded, 'aria-controls': ariaControls,
|
|
114
114
|
// add ariaLabel as `title` as visible hint text
|
|
115
|
-
title: __title !== null && __title !== void 0 ? __title : ariaLabel, className: buttonClass, onClick: handleClick, [DATA_ATTR_FUNNEL_VALUE]: uniqueId }), getAnalyticsMetadataAttribute(analyticsMetadata)), getAnalyticsLabelAttribute(
|
|
115
|
+
title: __title !== null && __title !== void 0 ? __title : ariaLabel, className: buttonClass, onClick: handleClick, [DATA_ATTR_FUNNEL_VALUE]: uniqueId }), getAnalyticsMetadataAttribute(analyticsMetadata)), getAnalyticsLabelAttribute(shouldHaveContent ? `.${analyticsSelectors.label}` : ''));
|
|
116
116
|
const iconProps = {
|
|
117
117
|
loading,
|
|
118
118
|
iconName,
|
package/button/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/button/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,kEAAkE,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,M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CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAClD,QAAQ,EAAE,QAAQ,IACd,mBAAmB;gBAEtB,aAAa;gBACb,oBAAoB,IAAI,qBAAqB,CAC5C;YACH,OAAO,IAAI,WAAW,IAAI,CACzB,oBAAC,kBAAkB,IAAC,OAAO,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,IAC5C,WAAW,CACO,CACtB,CACA,CACJ,CAAC;KACH;IAED,OAAO,CACL;QACE,gDACM,WAAW,IACf,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EACjD,QAAQ,EAAE,QAAQ,IAAI,CAAC,WAAW,IAAI,CAAC,oBAAoB,mBAC5C,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,IAC7C,mBAAmB;YAEtB,aAAa;YACb,oBAAoB,IAAI,qBAAqB,CACvC;QACR,OAAO,IAAI,WAAW,IAAI,CACzB,oBAAC,kBAAkB,IAAC,OAAO,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,IAC5C,WAAW,CACO,CACtB,CACA,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport {\n getAnalyticsLabelAttribute,\n getAnalyticsMetadataAttribute,\n} from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { useInternalI18n } from '../i18n/context';\nimport Icon from '../icon/internal';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FUNNEL_VALUE,\n getFunnelValueSelector,\n getSubStepAllSelector,\n getTextFromSelector,\n} from '../internal/analytics/selectors';\nimport Tooltip from '../internal/components/tooltip/index.js';\nimport { useButtonContext } from '../internal/context/button-context';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\nimport { fireCancelableEvent, isPlainLeftClick } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport useHiddenDescription from '../internal/hooks/use-hidden-description';\nimport { useModalContextLoadingButtonComponent } from '../internal/hooks/use-modal-component-analytics';\nimport { usePerformanceMarks } from '../internal/hooks/use-performance-marks';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport InternalLiveRegion from '../live-region/internal';\nimport { GeneratedAnalyticsMetadataButtonFragment } from './analytics-metadata/interfaces';\nimport { ButtonIconProps, LeftIcon, RightIcon } from './icon-helper';\nimport { ButtonProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport type InternalButtonProps = Omit<ButtonProps, 'variant'> & {\n variant?:\n | ButtonProps['variant']\n | 'flashbar-icon'\n | 'breadcrumb-group'\n | 'menu-trigger'\n | 'modal-dismiss'\n | 'inline-icon-pointer-target';\n badge?: boolean;\n analyticsAction?: string;\n __nativeAttributes?:\n | (React.HTMLAttributes<HTMLAnchorElement> & React.HTMLAttributes<HTMLButtonElement>)\n | Record<`data-${string}`, string>;\n __iconClass?: string;\n __focusable?: boolean;\n __injectAnalyticsComponentMetadata?: boolean;\n __title?: string;\n __emitPerformanceMarks?: boolean;\n} & InternalBaseComponentProps<HTMLAnchorElement | HTMLButtonElement>;\n\nexport const InternalButton = React.forwardRef(\n (\n {\n children,\n iconName,\n __iconClass,\n onClick,\n onFollow,\n iconAlign = 'left',\n iconUrl,\n iconSvg,\n iconAlt,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n disabledReason,\n wrapText = true,\n href,\n external,\n target: targetOverride,\n rel,\n download,\n formAction = 'submit',\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n ariaControls,\n fullWidth,\n badge,\n i18nStrings,\n __nativeAttributes,\n __internalRootRef = null,\n __focusable = false,\n __injectAnalyticsComponentMetadata = false,\n __title,\n __emitPerformanceMarks = true,\n analyticsAction = 'click',\n ...props\n }: InternalButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n checkSafeUrl('Button', href);\n const isAnchor = Boolean(href);\n const target = targetOverride ?? (external ? '_blank' : undefined);\n const isNotInteractive = loading || disabled;\n const isDisabledWithReason =\n (variant === 'normal' || variant === 'primary' || variant === 'icon') && !!disabledReason && disabled;\n\n const hasAriaDisabled = (loading && !disabled) || (disabled && __focusable) || isDisabledWithReason;\n const shouldHaveContent =\n children &&\n ['icon', 'inline-icon', 'flashbar-icon', 'modal-dismiss', 'inline-icon-pointer-target'].indexOf(variant) === -1;\n\n if ((iconName || iconUrl || iconSvg) && iconAlign === 'right' && external) {\n warnOnce('Button', 'A right-aligned icon should not be combined with an external icon.');\n }\n\n const buttonRef = useRef<HTMLElement>(null);\n useForwardFocus(ref, buttonRef);\n\n const buttonContext = useButtonContext();\n const i18n = useInternalI18n('button');\n\n const uniqueId = useUniqueId('button');\n const { funnelInteractionId } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const performanceMarkAttributes = usePerformanceMarks(\n 'primaryButton',\n () => variant === 'primary' && __emitPerformanceMarks && !loading && !disabled,\n buttonRef,\n () => ({\n loading,\n disabled,\n text: buttonRef.current?.innerText,\n }),\n [loading, disabled]\n );\n useModalContextLoadingButtonComponent(variant === 'primary', loading);\n\n const { targetProps, descriptionEl } = useHiddenDescription(disabledReason);\n\n const handleClick = (event: React.MouseEvent) => {\n if (isNotInteractive) {\n return event.preventDefault();\n }\n\n if (isAnchor && isPlainLeftClick(event)) {\n fireCancelableEvent(onFollow, { href, target }, event);\n\n if ((iconName === 'external' || target === '_blank') && funnelInteractionId) {\n const stepName = getTextFromSelector(stepNameSelector);\n const subStepName = getTextFromSelector(subStepNameSelector);\n\n FunnelMetrics.externalLinkInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n }\n\n const { altKey, button, ctrlKey, metaKey, shiftKey } = event;\n fireCancelableEvent(onClick, { altKey, button, ctrlKey, metaKey, shiftKey }, event);\n buttonContext.onClick({ variant });\n };\n\n const buttonClass = clsx(props.className, styles.button, styles[`variant-${variant}`], {\n [styles.disabled]: isNotInteractive,\n [styles['disabled-with-reason']]: isDisabledWithReason,\n [styles['button-no-wrap']]: !wrapText,\n [styles['button-no-text']]: !shouldHaveContent,\n [styles['full-width']]: shouldHaveContent && fullWidth,\n [styles.link]: isAnchor,\n });\n\n const explicitTabIndex =\n __nativeAttributes && 'tabIndex' in __nativeAttributes ? __nativeAttributes.tabIndex : undefined;\n const { tabIndex } = useSingleTabStopNavigation(buttonRef, {\n tabIndex: isAnchor && isNotInteractive && !isDisabledWithReason ? -1 : explicitTabIndex,\n });\n\n const analyticsMetadata: GeneratedAnalyticsMetadataButtonFragment = disabled\n ? {}\n : {\n action: analyticsAction,\n detail: { label: { root: 'self' } },\n };\n if (__injectAnalyticsComponentMetadata) {\n analyticsMetadata.component = {\n name: 'awsui.Button',\n label: { root: 'self' },\n properties: { variant, disabled: `${disabled}` },\n };\n }\n\n const buttonProps = {\n ...props,\n ...__nativeAttributes,\n ...performanceMarkAttributes,\n tabIndex,\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: useMergeRefs(buttonRef, __internalRootRef),\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedby,\n 'aria-expanded': ariaExpanded,\n 'aria-controls': ariaControls,\n // add ariaLabel as `title` as visible hint text\n title: __title ?? ariaLabel,\n className: buttonClass,\n onClick: handleClick,\n [DATA_ATTR_FUNNEL_VALUE]: uniqueId,\n ...getAnalyticsMetadataAttribute(analyticsMetadata),\n ...getAnalyticsLabelAttribute(children ? `.${analyticsSelectors.label}` : ''),\n } as const;\n\n const iconProps: ButtonIconProps = {\n loading,\n iconName,\n iconAlign,\n iconUrl,\n iconSvg,\n iconAlt,\n variant,\n badge,\n iconClass: __iconClass,\n iconSize: variant === 'modal-dismiss' ? 'medium' : 'normal',\n };\n const buttonContent = (\n <>\n <LeftIcon {...iconProps} />\n {shouldHaveContent && (\n <>\n <span className={clsx(styles.content, analyticsSelectors.label)}>{children}</span>\n {external && (\n <>\n \n <Icon\n name=\"external\"\n className={testUtilStyles['external-icon']}\n ariaLabel={i18n('i18nStrings.externalIconAriaLabel', i18nStrings?.externalIconAriaLabel)}\n />\n </>\n )}\n </>\n )}\n <RightIcon {...iconProps} />\n </>\n );\n\n const { loadingButtonCount } = useFunnel();\n useEffect(() => {\n if (loading) {\n loadingButtonCount.current++;\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n loadingButtonCount.current--;\n };\n }\n }, [loading, loadingButtonCount]);\n\n const disabledReasonProps = {\n onFocus: isDisabledWithReason ? () => setShowTooltip(true) : undefined,\n onBlur: isDisabledWithReason ? () => setShowTooltip(false) : undefined,\n onMouseEnter: isDisabledWithReason ? () => setShowTooltip(true) : undefined,\n onMouseLeave: isDisabledWithReason ? () => setShowTooltip(false) : undefined,\n ...(isDisabledWithReason ? targetProps : {}),\n };\n const disabledReasonContent = (\n <>\n {descriptionEl}\n {showTooltip && (\n <Tooltip\n className={testUtilStyles['disabled-reason-tooltip']}\n trackRef={buttonRef}\n value={disabledReason!}\n onDismiss={() => setShowTooltip(false)}\n />\n )}\n </>\n );\n\n if (isAnchor) {\n return (\n // https://github.com/yannickcr/eslint-plugin-react/issues/2962\n // eslint-disable-next-line react/jsx-no-target-blank\n <>\n <a\n {...buttonProps}\n href={href}\n target={target}\n // security recommendation: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target\n rel={rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined)}\n aria-disabled={isNotInteractive ? true : undefined}\n download={download}\n {...disabledReasonProps}\n >\n {buttonContent}\n {isDisabledWithReason && disabledReasonContent}\n </a>\n {loading && loadingText && (\n <InternalLiveRegion tagName=\"span\" hidden={true}>\n {loadingText}\n </InternalLiveRegion>\n )}\n </>\n );\n }\n\n return (\n <>\n <button\n {...buttonProps}\n type={formAction === 'none' ? 'button' : 'submit'}\n disabled={disabled && !__focusable && !isDisabledWithReason}\n aria-disabled={hasAriaDisabled ? true : undefined}\n {...disabledReasonProps}\n >\n {buttonContent}\n {isDisabledWithReason && disabledReasonContent}\n </button>\n {loading && loadingText && (\n <InternalLiveRegion tagName=\"span\" hidden={true}>\n {loadingText}\n </InternalLiveRegion>\n )}\n </>\n );\n }\n);\n\nexport default InternalButton;\n"]}
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/button/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,kEAAkE,CAAC;AAE1E,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EAC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AO,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,IAC5C,WAAW,CACO,CACtB,CACA,CACJ,CAAC;KACH;IAED,OAAO,CACL;QACE,gDACM,WAAW,IACf,IAAI,EAAE,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EACjD,QAAQ,EAAE,QAAQ,IAAI,CAAC,WAAW,IAAI,CAAC,oBAAoB,mBAC5C,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,IAC7C,mBAAmB;YAEtB,aAAa;YACb,oBAAoB,IAAI,qBAAqB,CACvC;QACR,OAAO,IAAI,WAAW,IAAI,CACzB,oBAAC,kBAAkB,IAAC,OAAO,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,IAC5C,WAAW,CACO,CACtB,CACA,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\n\nimport { useMergeRefs, warnOnce } from '@cloudscape-design/component-toolkit/internal';\nimport {\n getAnalyticsLabelAttribute,\n getAnalyticsMetadataAttribute,\n} from '@cloudscape-design/component-toolkit/internal/analytics-metadata';\n\nimport { useInternalI18n } from '../i18n/context';\nimport Icon from '../icon/internal';\nimport { FunnelMetrics } from '../internal/analytics';\nimport { useFunnel, useFunnelStep, useFunnelSubStep } from '../internal/analytics/hooks/use-funnel';\nimport {\n DATA_ATTR_FUNNEL_VALUE,\n getFunnelValueSelector,\n getSubStepAllSelector,\n getTextFromSelector,\n} from '../internal/analytics/selectors';\nimport Tooltip from '../internal/components/tooltip/index.js';\nimport { useButtonContext } from '../internal/context/button-context';\nimport { useSingleTabStopNavigation } from '../internal/context/single-tab-stop-navigation-context';\nimport { fireCancelableEvent, isPlainLeftClick } from '../internal/events';\nimport useForwardFocus from '../internal/hooks/forward-focus';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport useHiddenDescription from '../internal/hooks/use-hidden-description';\nimport { useModalContextLoadingButtonComponent } from '../internal/hooks/use-modal-component-analytics';\nimport { usePerformanceMarks } from '../internal/hooks/use-performance-marks';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { checkSafeUrl } from '../internal/utils/check-safe-url';\nimport InternalLiveRegion from '../live-region/internal';\nimport { GeneratedAnalyticsMetadataButtonFragment } from './analytics-metadata/interfaces';\nimport { ButtonIconProps, LeftIcon, RightIcon } from './icon-helper';\nimport { ButtonProps } from './interfaces';\n\nimport analyticsSelectors from './analytics-metadata/styles.css.js';\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\nexport type InternalButtonProps = Omit<ButtonProps, 'variant'> & {\n variant?:\n | ButtonProps['variant']\n | 'flashbar-icon'\n | 'breadcrumb-group'\n | 'menu-trigger'\n | 'modal-dismiss'\n | 'inline-icon-pointer-target';\n badge?: boolean;\n analyticsAction?: string;\n __nativeAttributes?:\n | (React.HTMLAttributes<HTMLAnchorElement> & React.HTMLAttributes<HTMLButtonElement>)\n | Record<`data-${string}`, string>;\n __iconClass?: string;\n __focusable?: boolean;\n __injectAnalyticsComponentMetadata?: boolean;\n __title?: string;\n __emitPerformanceMarks?: boolean;\n} & InternalBaseComponentProps<HTMLAnchorElement | HTMLButtonElement>;\n\nexport const InternalButton = React.forwardRef(\n (\n {\n children,\n iconName,\n __iconClass,\n onClick,\n onFollow,\n iconAlign = 'left',\n iconUrl,\n iconSvg,\n iconAlt,\n variant = 'normal',\n loading = false,\n loadingText,\n disabled = false,\n disabledReason,\n wrapText = true,\n href,\n external,\n target: targetOverride,\n rel,\n download,\n formAction = 'submit',\n ariaLabel,\n ariaDescribedby,\n ariaExpanded,\n ariaControls,\n fullWidth,\n badge,\n i18nStrings,\n __nativeAttributes,\n __internalRootRef = null,\n __focusable = false,\n __injectAnalyticsComponentMetadata = false,\n __title,\n __emitPerformanceMarks = true,\n analyticsAction = 'click',\n ...props\n }: InternalButtonProps,\n ref: React.Ref<ButtonProps.Ref>\n ) => {\n const [showTooltip, setShowTooltip] = useState(false);\n\n checkSafeUrl('Button', href);\n const isAnchor = Boolean(href);\n const target = targetOverride ?? (external ? '_blank' : undefined);\n const isNotInteractive = loading || disabled;\n const isDisabledWithReason =\n (variant === 'normal' || variant === 'primary' || variant === 'icon') && !!disabledReason && disabled;\n\n const hasAriaDisabled = (loading && !disabled) || (disabled && __focusable) || isDisabledWithReason;\n const shouldHaveContent =\n children &&\n ['icon', 'inline-icon', 'flashbar-icon', 'modal-dismiss', 'inline-icon-pointer-target'].indexOf(variant) === -1;\n\n if ((iconName || iconUrl || iconSvg) && iconAlign === 'right' && external) {\n warnOnce('Button', 'A right-aligned icon should not be combined with an external icon.');\n }\n\n const buttonRef = useRef<HTMLElement>(null);\n useForwardFocus(ref, buttonRef);\n\n const buttonContext = useButtonContext();\n const i18n = useInternalI18n('button');\n\n const uniqueId = useUniqueId('button');\n const { funnelInteractionId } = useFunnel();\n const { stepNumber, stepNameSelector } = useFunnelStep();\n const { subStepSelector, subStepNameSelector } = useFunnelSubStep();\n\n const performanceMarkAttributes = usePerformanceMarks(\n 'primaryButton',\n () => variant === 'primary' && __emitPerformanceMarks && !loading && !disabled,\n buttonRef,\n () => ({\n loading,\n disabled,\n text: buttonRef.current?.innerText,\n }),\n [loading, disabled]\n );\n useModalContextLoadingButtonComponent(variant === 'primary', loading);\n\n const { targetProps, descriptionEl } = useHiddenDescription(disabledReason);\n\n const handleClick = (event: React.MouseEvent) => {\n if (isNotInteractive) {\n return event.preventDefault();\n }\n\n if (isAnchor && isPlainLeftClick(event)) {\n fireCancelableEvent(onFollow, { href, target }, event);\n\n if ((iconName === 'external' || target === '_blank') && funnelInteractionId) {\n const stepName = getTextFromSelector(stepNameSelector);\n const subStepName = getTextFromSelector(subStepNameSelector);\n\n FunnelMetrics.externalLinkInteracted({\n funnelInteractionId,\n stepNumber,\n stepName,\n stepNameSelector,\n subStepSelector,\n subStepName,\n subStepNameSelector,\n elementSelector: getFunnelValueSelector(uniqueId),\n subStepAllSelector: getSubStepAllSelector(),\n });\n }\n }\n\n const { altKey, button, ctrlKey, metaKey, shiftKey } = event;\n fireCancelableEvent(onClick, { altKey, button, ctrlKey, metaKey, shiftKey }, event);\n buttonContext.onClick({ variant });\n };\n\n const buttonClass = clsx(props.className, styles.button, styles[`variant-${variant}`], {\n [styles.disabled]: isNotInteractive,\n [styles['disabled-with-reason']]: isDisabledWithReason,\n [styles['button-no-wrap']]: !wrapText,\n [styles['button-no-text']]: !shouldHaveContent,\n [styles['full-width']]: shouldHaveContent && fullWidth,\n [styles.link]: isAnchor,\n });\n\n const explicitTabIndex =\n __nativeAttributes && 'tabIndex' in __nativeAttributes ? __nativeAttributes.tabIndex : undefined;\n const { tabIndex } = useSingleTabStopNavigation(buttonRef, {\n tabIndex: isAnchor && isNotInteractive && !isDisabledWithReason ? -1 : explicitTabIndex,\n });\n\n const analyticsMetadata: GeneratedAnalyticsMetadataButtonFragment = disabled\n ? {}\n : {\n action: analyticsAction,\n detail: { label: { root: 'self' } },\n };\n if (__injectAnalyticsComponentMetadata) {\n analyticsMetadata.component = {\n name: 'awsui.Button',\n label: { root: 'self' },\n properties: { variant, disabled: `${disabled}` },\n };\n }\n\n const buttonProps = {\n ...props,\n ...__nativeAttributes,\n ...performanceMarkAttributes,\n tabIndex,\n // https://github.com/microsoft/TypeScript/issues/36659\n ref: useMergeRefs(buttonRef, __internalRootRef),\n 'aria-label': ariaLabel,\n 'aria-describedby': ariaDescribedby,\n 'aria-expanded': ariaExpanded,\n 'aria-controls': ariaControls,\n // add ariaLabel as `title` as visible hint text\n title: __title ?? ariaLabel,\n className: buttonClass,\n onClick: handleClick,\n [DATA_ATTR_FUNNEL_VALUE]: uniqueId,\n ...getAnalyticsMetadataAttribute(analyticsMetadata),\n ...getAnalyticsLabelAttribute(shouldHaveContent ? `.${analyticsSelectors.label}` : ''),\n } as const;\n\n const iconProps: ButtonIconProps = {\n loading,\n iconName,\n iconAlign,\n iconUrl,\n iconSvg,\n iconAlt,\n variant,\n badge,\n iconClass: __iconClass,\n iconSize: variant === 'modal-dismiss' ? 'medium' : 'normal',\n };\n const buttonContent = (\n <>\n <LeftIcon {...iconProps} />\n {shouldHaveContent && (\n <>\n <span className={clsx(styles.content, analyticsSelectors.label)}>{children}</span>\n {external && (\n <>\n \n <Icon\n name=\"external\"\n className={testUtilStyles['external-icon']}\n ariaLabel={i18n('i18nStrings.externalIconAriaLabel', i18nStrings?.externalIconAriaLabel)}\n />\n </>\n )}\n </>\n )}\n <RightIcon {...iconProps} />\n </>\n );\n\n const { loadingButtonCount } = useFunnel();\n useEffect(() => {\n if (loading) {\n loadingButtonCount.current++;\n return () => {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n loadingButtonCount.current--;\n };\n }\n }, [loading, loadingButtonCount]);\n\n const disabledReasonProps = {\n onFocus: isDisabledWithReason ? () => setShowTooltip(true) : undefined,\n onBlur: isDisabledWithReason ? () => setShowTooltip(false) : undefined,\n onMouseEnter: isDisabledWithReason ? () => setShowTooltip(true) : undefined,\n onMouseLeave: isDisabledWithReason ? () => setShowTooltip(false) : undefined,\n ...(isDisabledWithReason ? targetProps : {}),\n };\n const disabledReasonContent = (\n <>\n {descriptionEl}\n {showTooltip && (\n <Tooltip\n className={testUtilStyles['disabled-reason-tooltip']}\n trackRef={buttonRef}\n value={disabledReason!}\n onDismiss={() => setShowTooltip(false)}\n />\n )}\n </>\n );\n\n if (isAnchor) {\n return (\n // https://github.com/yannickcr/eslint-plugin-react/issues/2962\n // eslint-disable-next-line react/jsx-no-target-blank\n <>\n <a\n {...buttonProps}\n href={href}\n target={target}\n // security recommendation: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target\n rel={rel ?? (target === '_blank' ? 'noopener noreferrer' : undefined)}\n aria-disabled={isNotInteractive ? true : undefined}\n download={download}\n {...disabledReasonProps}\n >\n {buttonContent}\n {isDisabledWithReason && disabledReasonContent}\n </a>\n {loading && loadingText && (\n <InternalLiveRegion tagName=\"span\" hidden={true}>\n {loadingText}\n </InternalLiveRegion>\n )}\n </>\n );\n }\n\n return (\n <>\n <button\n {...buttonProps}\n type={formAction === 'none' ? 'button' : 'submit'}\n disabled={disabled && !__focusable && !isDisabledWithReason}\n aria-disabled={hasAriaDisabled ? true : undefined}\n {...disabledReasonProps}\n >\n {buttonContent}\n {isDisabledWithReason && disabledReasonContent}\n </button>\n {loading && loadingText && (\n <InternalLiveRegion tagName=\"span\" hidden={true}>\n {loadingText}\n </InternalLiveRegion>\n )}\n </>\n );\n }\n);\n\nexport default InternalButton;\n"]}
|
package/internal/environment.js
CHANGED
package/internal/manifest.json
CHANGED
package/package.json
CHANGED
package/table/interfaces.d.ts
CHANGED
|
@@ -152,13 +152,10 @@ export interface TableProps<T = any> extends BaseComponentProps {
|
|
|
152
152
|
/**
|
|
153
153
|
* Specifies alternative text for the selection components (checkboxes and radio buttons) as follows:
|
|
154
154
|
* * `itemSelectionLabel` ((SelectionState, Item) => string) - Specifies the alternative text for an item.
|
|
155
|
+
* You can use the first argument of type `SelectionState` to access the current selection state of the component
|
|
156
|
+
* (for example, the `selectedItems` list). The second argument is the corresponding `Item` object.
|
|
155
157
|
* * `allItemsSelectionLabel` ((SelectionState) => string) - Specifies the alternative text for multi-selection column header.
|
|
156
158
|
* * `selectionGroupLabel` (string) - Specifies the alternative text for the whole selection and single-selection column header.
|
|
157
|
-
* It is prefixed to `itemSelectionLabel` and `allItemsSelectionLabel` when they are set.
|
|
158
|
-
* You can use the first argument of type `SelectionState` to access the current selection
|
|
159
|
-
* state of the component (for example, the `selectedItems` list). The `itemSelectionLabel` for individual
|
|
160
|
-
* items also receives the corresponding `Item` object. You can use the `selectionGroupLabel` to
|
|
161
|
-
* add a meaningful description to the whole selection.
|
|
162
159
|
* * `tableLabel` (string) - Provides an alternative text for the table. If you use a header for this table, you may reuse the string
|
|
163
160
|
* to provide a caption-like description. For example, tableLabel=Instances will be announced as 'Instances table'.
|
|
164
161
|
* * `resizerRoleDescription` (string) - Provides role description for table column resizer buttons.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/table/interfaces.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,uBAAuB,GAAG,UAAU,CAAC,uBAAuB,CAAC;AAYpE,MAAM,WAAW,mBAAmB;IAClC,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;KAAE,GAAG,GAAG,CAAC,OAAO,CAAC;CAC9E;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,kBAAkB;IAC7D;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC;IACjD;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAEzB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAExB;;;OAGG;IACH,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAExB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,UAAU,CAA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IAED,KAAY,sBAAsB,CAAC,CAAC,IAAI,yBAAyB,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5G,UAAiB,0BAA0B,CAAC,CAAC;QAC3C,IAAI,EAAE,CAAC,CAAC;QACR,QAAQ,EAAE,OAAO,CAAC;KACnB;IAED,KAAY,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC,KAAK,UAAU,CAAC,aAAa,CAAC;IAE/E,KAAY,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;IAEzE,UAAiB,kBAAkB,CAAC,CAAC;QACnC,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC;KAChB;IAED,UAAiB,uBAAuB,CAAC,CAAC;QACxC,IAAI,EAAE,CAAC,CAAC;KACT;CACF;AAED,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;AAE9D,UAAU,YAAY,CAAC,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,CAAC;CACT;AAED,UAAU,cAAc,CAAC,CAAC;IACxB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,IAAI,GAAG,CAAC,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,CAAC,aAAa,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd"}
|
package/table/interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/table/interfaces.tsx"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { CancelableEventHandler, NonCancelableEventHandler } from '../internal/events';\nimport { Optional } from '../internal/types';\nimport ColumnDisplayProperties = TableProps.ColumnDisplayProperties;\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface TableForwardRefType {\n <T>(props: TableProps<T> & { ref?: React.Ref<TableProps.Ref> }): JSX.Element;\n}\n\nexport interface TableProps<T = any> extends BaseComponentProps {\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * * `flowType` - Identifies the type of flow represented by the component.\n * * `resourceType` - Identifies the type of resource represented by the flow. **Note:** This API is currently experimental.\n * @analytics\n */\n analyticsMetadata?: TableProps.AnalyticsMetadata;\n /**\n * Heading element of the table container. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Footer of the table container.\n */\n footer?: React.ReactNode;\n\n /**\n * Displayed when the `items` property is an empty array. Use it to render an empty or no-match state.\n */\n empty?: React.ReactNode;\n\n /**\n * Specifies the data that's displayed in the table rows. Each item contains the data for one row. The display of a row is handled\n * by the `cell` property of each column definition in the `columnDefinitions` property.\n */\n items: ReadonlyArray<T>;\n\n /**\n * Renders the table in a loading state. We recommend that you also set a `loadingText`.\n */\n loading?: boolean;\n\n /**\n * Specifies the text that's displayed when the table is in a loading state.\n */\n loadingText?: string;\n\n /**\n * Specifies a property that uniquely identifies an individual item.\n * When it's set, it's used to provide [keys for React](https://reactjs.org/docs/lists-and-keys.html#keys)\n * for performance optimizations.\n *\n * It is also used in the following situations:\n * - to connect `items` and `selectedItems` values when they reference different objects.\n * - to connect `items` and `expandableRows.expandedItems` values when they reference different objects.\n * - to attach successful edit state to the correct item if its row index changes after editing.\n */\n trackBy?: TableProps.TrackBy<T>;\n\n /**\n * The columns configuration object\n * * `id` (string) - Specifies a unique column identifier. The property is used 1) as a [keys](https://reactjs.org/docs/lists-and-keys.html#keys) source for React rendering,\n * and 2) to match entries in the `columnDisplay` property, if defined.\n * * `header` (ReactNode) - Determines the display of the column header.\n * * `cell` ((item) => ReactNode) - Determines the display of a cell's content. You receive the current table row\n * item as an argument.\n * * `width` (string | number) - Specifies the column width. Corresponds to the `width` css-property. If the width is not set,\n * the browser automatically adjusts the column width based on the content. When `resizableColumns` property is\n * set to `true`, additional constraints apply: 1) string values are not allowed, and 2) the last visible column always\n * fills the remaining space of the table so the specified width is ignored.\n * * `minWidth` (string | number) - Specifies the minimum column width. Corresponds to the `min-width` css-property. When\n * `resizableColumns` property is set to `true`, additional constraints apply: 1) string values are not allowed,\n * and 2) the column can't resize below than the specified width (defaults to \"120px\"). We recommend that you set a minimum width\n * of at least 176px for columns that are editable.\n * * `maxWidth` (string | number) - Specifies the maximum column width. Corresponds to the `max-width` css-property.\n * Note that when the `resizableColumns` property is set to `true` this property is ignored.\n * * `ariaLabel` (LabelData => string) - An optional function that's called to provide an `aria-label` for the cell header.\n * It receives the current sorting state of this column, the direction it's sorted in, and an indication of\n * whether the sorting is disabled, as three Boolean values: `sorted`, `descending` and `disabled`.\n * We recommend that you use this for sortable columns to provide more meaningful labels based on the\n * current sorting direction.\n * * `sortingField` (string) - Enables default column sorting. The value is used in [collection hooks](/get-started/dev-guides/collection-hooks/)\n * to reorder the items. Provide the name of the property within each item that should be used for sorting by this column.\n * For more complex sorting use `sortingComparator` instead.\n * * `sortingComparator` ((T, T) => number) - Enables custom column sorting. The value is used in [collection hooks](/get-started/dev-guides/collection-hooks/)\n * to reorder the items. This property accepts a custom comparator that is used to compare two items.\n * The comparator must implement ascending ordering, and the output is inverted automatically in case of descending order.\n * If present, the `sortingField` property is ignored.\n * * `editConfig` (EditConfig) - Enables inline editing in column when present. The value is used to configure the editing behavior.\n * * `editConfig.ariaLabel` (string) - Specifies a label for the edit control. Visually hidden but read by screen readers.\n * * `editConfig.errorIconAriaLabel` (string) - Specifies an ariaLabel for the error icon that is displayed when the validation fails.\n * * `editConfig.editIconAriaLabel` (string) - Specifies an alternate text for the edit icon used in column header.\n * * `editConfig.constraintText` (string) - Constraint text that is displayed below the edit control.\n * * `editConfig.disabledReason` ((item) => string | undefined) - A function that determines whether inline edit for certain items is disabled, and provides a reason why.\n * Return a string from the function to disable inline edit with a reason. Return `undefined` (or no return) from the function allow inline edit.\n * * `editConfig.validation` ((item, value) => string) - A function that allows you to validate the value of the edit control.\n * Return a string from the function to display an error message. Return `undefined` (or no return) from the function to indicate that the value is valid.\n * * `editConfig.editingCell` ((item, cellContext) => ReactNode) - Determines the display of a cell's content when inline editing is active on a cell;\n * You receive the current table row `item` and a `cellContext` object as arguments.\n * The `cellContext` object contains the following properties:\n * * `cellContext.currentValue` - State to keep track of a value in input fields while editing.\n * * `cellContext.setValue` - Function to update `currentValue`. This should be called when the value in input field changes.\n * * `isRowHeader` (boolean) - Specifies that cells in this column should be used as row headers.\n * * `hasDynamicContent` (boolean) - Specifies that cells in this column may have dynamic content. The contents will then be observed to update calculated column widths.\n * This may have a negative performance impact, so should be used only if necessary. It has no effect if `resizableColumns` is set to `true`.\n * * `verticalAlign` ('middle' | 'top') - Determines the alignment of the content in the table cell.\n */\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;\n\n /**\n * Determines the alignment of the content inside table cells.\n * This property affects all cells, including the ones in the selection column.\n * To target individual cells use `columnDefinitions.verticalAlign`, that takes precedence over `cellVerticalAlign`.\n */\n cellVerticalAlign?: 'middle' | 'top';\n\n /**\n * Specifies the selection type (`'single' | 'multi'`).\n */\n selectionType?: TableProps.SelectionType;\n /**\n * List of selected items.\n */\n selectedItems?: ReadonlyArray<T>;\n\n /**\n * Use this slot to add filtering controls to the table.\n */\n filter?: React.ReactNode;\n\n /**\n * Use this slot to add the [pagination component](/components/pagination/) to the table.\n */\n pagination?: React.ReactNode;\n\n /**\n * Use this slot to add [collection preferences](/components/collection-preferences/) to the table.\n */\n preferences?: React.ReactNode;\n\n /**\n * Determines whether a given item is disabled. If an item is disabled, the user can't select it.\n */\n isItemDisabled?: TableProps.IsItemDisabled<T>;\n\n /**\n * Specifies if text wraps within table cells. If set to `true`, long text within cells may wrap onto\n * multiple lines instead of being truncated with an ellipsis.\n */\n wrapLines?: boolean;\n\n /**\n * Specifies if table rows alternate being shaded and unshaded. If set to `true`, every other row will be shaded.\n */\n stripedRows?: boolean;\n\n /**\n * Toggles the content density of the table. Defaults to `'comfortable'`.\n */\n contentDensity?: 'comfortable' | 'compact';\n\n /**\n * Specifies if columns can be resized. If set to `true`, users can resize the columns in the table.\n */\n resizableColumns?: boolean;\n\n /**\n * Specifies alternative text for the selection components (checkboxes and radio buttons) as follows:\n * * `itemSelectionLabel` ((SelectionState, Item) => string) - Specifies the alternative text for an item.\n * * `allItemsSelectionLabel` ((SelectionState) => string) - Specifies the alternative text for multi-selection column header.\n * * `selectionGroupLabel` (string) - Specifies the alternative text for the whole selection and single-selection column header.\n * It is prefixed to `itemSelectionLabel` and `allItemsSelectionLabel` when they are set.\n * You can use the first argument of type `SelectionState` to access the current selection\n * state of the component (for example, the `selectedItems` list). The `itemSelectionLabel` for individual\n * items also receives the corresponding `Item` object. You can use the `selectionGroupLabel` to\n * add a meaningful description to the whole selection.\n * * `tableLabel` (string) - Provides an alternative text for the table. If you use a header for this table, you may reuse the string\n * to provide a caption-like description. For example, tableLabel=Instances will be announced as 'Instances table'.\n * * `resizerRoleDescription` (string) - Provides role description for table column resizer buttons.\n * * `activateEditLabel` (EditableColumnDefinition, Item) => string -\n * Specifies an alternative text for the edit button in editable cells.\n * * `cancelEditLabel` (EditableColumnDefinition) => string -\n * Specifies an alternative text for the cancel button in editable cells.\n * * `submitEditLabel` (EditableColumnDefinition) => string -\n * Specifies an alternative text for the submit button in editable cells.\n * * `successfulEditLabel` (EditableColumnDefinition) => string -\n * Specifies an alternative text for the success icon in editable cells. This text is also announced to screen readers.\n * * `submittingEditText` (EditableColumnDefinition) => string -\n * Specifies a text that is announced to screen readers when a cell edit operation is submitted.\n * * `expandButtonLabel` (Item) => string - Specifies an alternative text for row expand button.\n * * `collapseButtonLabel` (Item) => string - Specifies an alternative text for row collapse button.\n * @i18n\n */\n ariaLabels?: TableProps.AriaLabels<T>;\n\n /**\n * Specifies the definition object of the currently sorted column. Make sure you pass an object that's\n * present in the `columnDefinitions` array.\n */\n sortingColumn?: TableProps.SortingColumn<T>;\n /**\n * Specifies whether to use a descending sort order.\n */\n sortingDescending?: boolean;\n /**\n * Specifies if sorting buttons are disabled. For example, use this property\n * to prevent the user from sorting before items are fully loaded.\n */\n sortingDisabled?: boolean;\n\n /**\n * Specifies the number of first and/or last columns that should be sticky.\n *\n * If the available scrollable space is less than a certain threshold, the feature is deactivated.\n *\n * Use it in conjunction with the sticky columns preference of the\n * [collection preferences](/components/collection-preferences/) component.\n *\n */\n stickyColumns?: TableProps.StickyColumns;\n\n /**\n * Specifies an array that represents the table columns in the order in which they will be displayed, together with their visibility.\n *\n * If not set, all columns are displayed and the order is dictated by the `columnDefinitions` property.\n *\n * Use it in conjunction with the content display preference of the [collection preferences](/components/collection-preferences/) component.\n */\n columnDisplay?: ReadonlyArray<ColumnDisplayProperties>;\n\n /**\n * Specifies an array containing the `id`s of visible columns. If not set, all columns are displayed.\n *\n * Use it in conjunction with the visible content preference of the [collection preferences](/components/collection-preferences/) component.\n *\n * The order of ids doesn't influence the order in which columns are displayed - this is dictated by the `columnDefinitions` property.\n *\n * @deprecated Replaced by `columnDisplay`.\n */\n visibleColumns?: ReadonlyArray<string>;\n\n /**\n * Fired when the user resizes a table column. The event detail contains an array of column widths in pixels,\n * including the hidden via preferences columns. Use this event to persist the column widths.\n */\n onColumnWidthsChange?: NonCancelableEventHandler<TableProps.ColumnWidthsChangeDetail>;\n\n /**\n * Called when either the column to sort by or the direction of sorting changes upon user interaction.\n * The event detail contains the current sortingColumn and isDescending.\n */\n onSortingChange?: NonCancelableEventHandler<TableProps.SortingState<T>>;\n\n /**\n * Fired when a user interaction triggers a change in the list of selected items.\n * The event `detail` contains the current list of `selectedItems`.\n */\n onSelectionChange?: NonCancelableEventHandler<TableProps.SelectionChangeDetail<T>>;\n\n /**\n * Note: This feature is provided for backwards compatibility. Its use is not recommended,\n * and it may be deprecated in the future.\n *\n * Called when the user clicked at a table row. The event detail contains the index of the\n * clicked row and the row object itself. Use this event to define a row click behavior.\n */\n onRowClick?: NonCancelableEventHandler<TableProps.OnRowClickDetail<T>>;\n\n /**\n * Note: This feature is provided for backwards compatibility. Its use is not recommended,\n * and it may be deprecated in the future.\n *\n * Called when the user clicked at a table row with the right mouse click. The event detail\n * contains the index of the clicked row and the row object itself. Use this event to override\n * the default browser context menu behavior.\n */\n onRowContextMenu?: CancelableEventHandler<TableProps.OnRowContextMenuDetail<T>>;\n\n /**\n * If set to `true`, the table header remains visible when the user scrolls down.\n *\n * Do not use `stickyHeader` conditionally. Instead, keep its value constant during the component lifecycle.\n */\n stickyHeader?: boolean;\n\n /**\n * Specifies a vertical offset (in pixels) for the sticky header. For example, use this if you\n * need to position the sticky header below other fixed position elements on the page.\n */\n stickyHeaderVerticalOffset?: number;\n\n /**\n * Specify a table variant with one of the following:\n * * `container` - Use this variant to have the table displayed within a container.\n * * `borderless` - Use this variant when the table should have no outer borders or shadow\n * (such as in a dashboard item container).\n * * `embedded` - Use this variant within a parent container (such as a modal, expandable\n * section, container or split panel).\n * **Deprecated**, replaced by `borderless` and `container`.\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * * `full-page` – Use this variant when the table is the entire content of a page.\n * @visualrefresh `embedded`, `stacked`, and `full-page` variants\n */\n variant?: TableProps.Variant;\n\n /**\n * Use this property to inform screen readers how many items there are in a table.\n * It specifies the total count of all items in a table.\n * If there is an unknown total of items in a table, leave this property undefined.\n */\n totalItemsCount?: number;\n /**\n * Use this property to inform screen readers which range of items is currently displayed in the table.\n * It specifies the index (1-based) of the first item in the table.\n */\n firstIndex?: number;\n /**\n * Use this function to announce page changes to screen reader users.\n * The function argument takes the following properties:\n * * `firstIndex` (number) - The provided `firstIndex` property which defaults to 1 when not defined.\n * * `lastIndex` (number) - The index of the last visible item of the table.\n * * `visibleItemsCount` (number) - The number of rendered table items.\n * * `totalItemsCount` (optional, number) - The provided `totalItemsCount` property.\n * Important: in tables with expandable rows the `firstIndex`, `lastIndex`, and `totalItemsCount` reflect the top-level items only.\n */\n renderAriaLive?: (data: TableProps.LiveAnnouncement) => string;\n /**\n * Specifies a function that will be called after user submits an inline edit.\n * Return a promise to keep loading state while the submit request is in progress.\n */\n submitEdit?: TableProps.SubmitEditFunction<T>;\n\n /**\n * Called whenever user cancels an inline edit. Use this function to reset any\n * validation states, or show warning for unsaved changes.\n */\n onEditCancel?: CancelableEventHandler;\n\n /**\n * Use this property to activate advanced keyboard navigation and focusing behaviors.\n * When set to `true`, table cells become navigable with arrow keys, and the entire table has a single tab stop.\n *\n * By default, the keyboard navigation is active for tables with expandable rows.\n */\n enableKeyboardNavigation?: boolean;\n\n /**\n * Use this property to define expandable table rows. The expandableRows configuration object consists of:\n * * `getItemChildren` ((Item) => Item[]) - Use it to define nested data that are shown when an item gets expanded.\n * * `isItemExpandable` ((Item) => boolean) - Use it for items that can be expanded to show nested data.\n * * `expandedItems` (Item[]) - Use it to represent the expanded state of items.\n * * `onExpandableItemToggle` (TableProps.OnExpandableItemToggle<T>) - Called when an item's expand toggle is clicked.\n */\n expandableRows?: TableProps.ExpandableRows<T>;\n\n /**\n * A function that specifies the current status of loading more items. It is called once for the entire\n * table with `item=null` and then for each expanded item. The function result is one of the four possible states:\n * * `pending` - Indicates that no request in progress, but more options may be loaded.\n * * `loading` - Indicates that data fetching is in progress.\n * * `finished` - Indicates that loading has finished and no more requests are expected.\n * * `error` - Indicates that an error occurred during fetch.\n **/\n getLoadingStatus?: TableProps.GetLoadingStatus<T>;\n /**\n * Renders loader row content for pending state.\n */\n renderLoaderPending?: (detail: TableProps.RenderLoaderDetail<T>) => React.ReactNode;\n /**\n * Renders loader row content for loading state.\n */\n renderLoaderLoading?: (detail: TableProps.RenderLoaderDetail<T>) => React.ReactNode;\n /**\n * Renders loader row content for error state.\n */\n renderLoaderError?: (detail: TableProps.RenderLoaderDetail<T>) => React.ReactNode;\n /**\n * Renders loader row content for empty row state: the loading status is \"finished\",\n * and the row is expanded but has empty children array.\n *\n * The empty loader state is only supported for expandable rows. Use `empty` slot if\n * the table items array is empty.\n */\n renderLoaderEmpty?: (detail: TableProps.RenderLoaderEmptyDetail<T>) => React.ReactNode;\n}\n\nexport namespace TableProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n flowType?: 'view-resource';\n resourceType?: string;\n }\n\n export type TrackBy<T> = string | ((item: T) => string);\n\n export interface CellContext<V> {\n currentValue: Optional<V>;\n setValue: (value: V | undefined) => void;\n }\n\n export interface EditConfig<T, V = any> {\n /**\n * Specifies a label for the edit control. Visually hidden but read\n * by screen readers.\n */\n ariaLabel?: string;\n /**\n * Specifies an ariaLabel for the error icon that is displayed when\n * the validation fails.\n */\n errorIconAriaLabel?: string;\n /**\n * Specifies an alternate text for the edit icon used in column header.\n */\n editIconAriaLabel?: string;\n /**\n * Constraint text that is displayed below the edit control.\n */\n constraintText?: string;\n /**\n * A function that allows you to validate the value of the edit control. Return\n * a string from the function to display an error message. Return\n * `undefined` (or no return) from the function to indicate that the value is valid.\n * @param item - The item that is being edited.\n * @param value - The current value of the edit control.\n */\n validation?: (item: T, value: Optional<V>) => Optional<string>;\n\n /**\n * Determines the display of a cell's content when inline edit is active.\n */\n editingCell(item: T, ctx: TableProps.CellContext<any>): React.ReactNode;\n\n /**\n * Determines whether inline edit for certain items is disabled, and provides a reason why.\n */\n disabledReason?: (item: T) => string | undefined;\n }\n\n export type ColumnDefinition<ItemType> = {\n id?: string;\n header: React.ReactNode;\n ariaLabel?(data: LabelData): string;\n width?: number | string;\n minWidth?: number | string;\n maxWidth?: number | string;\n editConfig?: EditConfig<ItemType>;\n isRowHeader?: boolean;\n verticalAlign?: VerticalAlign;\n hasDynamicContent?: boolean;\n cell(item: ItemType): React.ReactNode;\n } & SortingColumn<ItemType>;\n\n export interface StickyColumns {\n first?: number;\n last?: number;\n }\n\n export type VerticalAlign = 'middle' | 'top';\n export type SelectionType = 'single' | 'multi';\n export type Variant = 'container' | 'embedded' | 'borderless' | 'stacked' | 'full-page';\n export interface SelectionState<T> {\n selectedItems: ReadonlyArray<T>;\n }\n export interface SelectionChangeDetail<T> {\n selectedItems: T[];\n }\n export type IsItemDisabled<T> = (item: T) => boolean;\n export interface AriaLabels<T> {\n allItemsSelectionLabel?: (data: TableProps.SelectionState<T>) => string;\n itemSelectionLabel?: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel?: string;\n tableLabel?: string;\n resizerRoleDescription?: string;\n // do not use <T> to prevent overly strict validation on consumer end\n // it works, practically, we are only interested in `id` and `header` properties only\n activateEditLabel?: (column: ColumnDefinition<any>, item: T) => string;\n cancelEditLabel?: (column: ColumnDefinition<any>) => string;\n submitEditLabel?: (column: ColumnDefinition<any>) => string;\n submittingEditText?: (column: ColumnDefinition<any>) => string;\n successfulEditLabel?: (column: ColumnDefinition<any>) => string;\n expandButtonLabel?: (item: T) => string;\n collapseButtonLabel?: (item: T) => string;\n }\n export interface SortingState<T> {\n isDescending?: boolean;\n sortingColumn: SortingColumn<T>;\n }\n export interface SortingColumn<T> {\n sortingField?: string;\n sortingComparator?: (a: T, b: T) => number;\n }\n export interface LabelData {\n sorted: boolean;\n descending: boolean;\n disabled: boolean;\n }\n export interface OnRowClickDetail<T> {\n rowIndex: number;\n item: T;\n }\n export interface OnRowContextMenuDetail<T> {\n rowIndex: number;\n item: T;\n clientX: number;\n clientY: number;\n }\n\n export interface ColumnWidthsChangeDetail {\n widths: ReadonlyArray<number>;\n }\n\n export interface LiveAnnouncement {\n firstIndex: number;\n lastIndex: number;\n visibleItemsCount: number;\n totalItemsCount?: number;\n }\n\n export interface Ref {\n /**\n * When the sticky header is enabled and you call this function, the table\n * scroll parent scrolls to reveal the first row of the table.\n */\n scrollToTop(): void;\n\n /**\n * Dismiss an inline edit if currently active.\n */\n cancelEdit?(): void;\n }\n\n export type SubmitEditFunction<ItemType, ValueType = unknown> = (\n item: ItemType,\n column: ColumnDefinition<ItemType>,\n newValue: ValueType\n ) => Promise<void> | void;\n\n export interface ColumnDisplayProperties {\n id: string;\n visible: boolean;\n }\n\n export interface ExpandableRows<T> {\n getItemChildren: (item: T) => readonly T[];\n isItemExpandable: (item: T) => boolean;\n expandedItems: ReadonlyArray<T>;\n onExpandableItemToggle: TableProps.OnExpandableItemToggle<T>;\n }\n\n export type OnExpandableItemToggle<T> = NonCancelableEventHandler<TableProps.ExpandableItemToggleDetail<T>>;\n\n export interface ExpandableItemToggleDetail<T> {\n item: T;\n expanded: boolean;\n }\n\n export type GetLoadingStatus<T> = (item: null | T) => TableProps.LoadingStatus;\n\n export type LoadingStatus = 'pending' | 'loading' | 'error' | 'finished';\n\n export interface RenderLoaderDetail<T> {\n item: null | T;\n }\n\n export interface RenderLoaderEmptyDetail<T> {\n item: T;\n }\n}\n\nexport type TableRow<T> = TableDataRow<T> | TableLoaderRow<T>;\n\ninterface TableDataRow<T> {\n type: 'data';\n item: T;\n}\n\ninterface TableLoaderRow<T> {\n type: 'loader';\n item: null | T;\n level: number;\n status: TableProps.LoadingStatus;\n from: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/table/interfaces.tsx"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { CancelableEventHandler, NonCancelableEventHandler } from '../internal/events';\nimport { Optional } from '../internal/types';\nimport ColumnDisplayProperties = TableProps.ColumnDisplayProperties;\n\n/*\n * HACK: Cast the component to a named parametrized interface.\n *\n * This lets us use React.forwardRef and still let the component have type\n * parameters, and the naming convention lets the documenter know that this is\n * a forwardRef-wrapped component.\n *\n * We don't need to expose this type to customers because it's just a simple\n * function type.\n */\nexport interface TableForwardRefType {\n <T>(props: TableProps<T> & { ref?: React.Ref<TableProps.Ref> }): JSX.Element;\n}\n\nexport interface TableProps<T = any> extends BaseComponentProps {\n /**\n * Specifies additional analytics-related metadata.\n * * `instanceIdentifier` - A unique string that identifies this component instance in your application.\n * * `flowType` - Identifies the type of flow represented by the component.\n * * `resourceType` - Identifies the type of resource represented by the flow. **Note:** This API is currently experimental.\n * @analytics\n */\n analyticsMetadata?: TableProps.AnalyticsMetadata;\n /**\n * Heading element of the table container. Use the [header component](/components/header/).\n */\n header?: React.ReactNode;\n\n /**\n * Footer of the table container.\n */\n footer?: React.ReactNode;\n\n /**\n * Displayed when the `items` property is an empty array. Use it to render an empty or no-match state.\n */\n empty?: React.ReactNode;\n\n /**\n * Specifies the data that's displayed in the table rows. Each item contains the data for one row. The display of a row is handled\n * by the `cell` property of each column definition in the `columnDefinitions` property.\n */\n items: ReadonlyArray<T>;\n\n /**\n * Renders the table in a loading state. We recommend that you also set a `loadingText`.\n */\n loading?: boolean;\n\n /**\n * Specifies the text that's displayed when the table is in a loading state.\n */\n loadingText?: string;\n\n /**\n * Specifies a property that uniquely identifies an individual item.\n * When it's set, it's used to provide [keys for React](https://reactjs.org/docs/lists-and-keys.html#keys)\n * for performance optimizations.\n *\n * It is also used in the following situations:\n * - to connect `items` and `selectedItems` values when they reference different objects.\n * - to connect `items` and `expandableRows.expandedItems` values when they reference different objects.\n * - to attach successful edit state to the correct item if its row index changes after editing.\n */\n trackBy?: TableProps.TrackBy<T>;\n\n /**\n * The columns configuration object\n * * `id` (string) - Specifies a unique column identifier. The property is used 1) as a [keys](https://reactjs.org/docs/lists-and-keys.html#keys) source for React rendering,\n * and 2) to match entries in the `columnDisplay` property, if defined.\n * * `header` (ReactNode) - Determines the display of the column header.\n * * `cell` ((item) => ReactNode) - Determines the display of a cell's content. You receive the current table row\n * item as an argument.\n * * `width` (string | number) - Specifies the column width. Corresponds to the `width` css-property. If the width is not set,\n * the browser automatically adjusts the column width based on the content. When `resizableColumns` property is\n * set to `true`, additional constraints apply: 1) string values are not allowed, and 2) the last visible column always\n * fills the remaining space of the table so the specified width is ignored.\n * * `minWidth` (string | number) - Specifies the minimum column width. Corresponds to the `min-width` css-property. When\n * `resizableColumns` property is set to `true`, additional constraints apply: 1) string values are not allowed,\n * and 2) the column can't resize below than the specified width (defaults to \"120px\"). We recommend that you set a minimum width\n * of at least 176px for columns that are editable.\n * * `maxWidth` (string | number) - Specifies the maximum column width. Corresponds to the `max-width` css-property.\n * Note that when the `resizableColumns` property is set to `true` this property is ignored.\n * * `ariaLabel` (LabelData => string) - An optional function that's called to provide an `aria-label` for the cell header.\n * It receives the current sorting state of this column, the direction it's sorted in, and an indication of\n * whether the sorting is disabled, as three Boolean values: `sorted`, `descending` and `disabled`.\n * We recommend that you use this for sortable columns to provide more meaningful labels based on the\n * current sorting direction.\n * * `sortingField` (string) - Enables default column sorting. The value is used in [collection hooks](/get-started/dev-guides/collection-hooks/)\n * to reorder the items. Provide the name of the property within each item that should be used for sorting by this column.\n * For more complex sorting use `sortingComparator` instead.\n * * `sortingComparator` ((T, T) => number) - Enables custom column sorting. The value is used in [collection hooks](/get-started/dev-guides/collection-hooks/)\n * to reorder the items. This property accepts a custom comparator that is used to compare two items.\n * The comparator must implement ascending ordering, and the output is inverted automatically in case of descending order.\n * If present, the `sortingField` property is ignored.\n * * `editConfig` (EditConfig) - Enables inline editing in column when present. The value is used to configure the editing behavior.\n * * `editConfig.ariaLabel` (string) - Specifies a label for the edit control. Visually hidden but read by screen readers.\n * * `editConfig.errorIconAriaLabel` (string) - Specifies an ariaLabel for the error icon that is displayed when the validation fails.\n * * `editConfig.editIconAriaLabel` (string) - Specifies an alternate text for the edit icon used in column header.\n * * `editConfig.constraintText` (string) - Constraint text that is displayed below the edit control.\n * * `editConfig.disabledReason` ((item) => string | undefined) - A function that determines whether inline edit for certain items is disabled, and provides a reason why.\n * Return a string from the function to disable inline edit with a reason. Return `undefined` (or no return) from the function allow inline edit.\n * * `editConfig.validation` ((item, value) => string) - A function that allows you to validate the value of the edit control.\n * Return a string from the function to display an error message. Return `undefined` (or no return) from the function to indicate that the value is valid.\n * * `editConfig.editingCell` ((item, cellContext) => ReactNode) - Determines the display of a cell's content when inline editing is active on a cell;\n * You receive the current table row `item` and a `cellContext` object as arguments.\n * The `cellContext` object contains the following properties:\n * * `cellContext.currentValue` - State to keep track of a value in input fields while editing.\n * * `cellContext.setValue` - Function to update `currentValue`. This should be called when the value in input field changes.\n * * `isRowHeader` (boolean) - Specifies that cells in this column should be used as row headers.\n * * `hasDynamicContent` (boolean) - Specifies that cells in this column may have dynamic content. The contents will then be observed to update calculated column widths.\n * This may have a negative performance impact, so should be used only if necessary. It has no effect if `resizableColumns` is set to `true`.\n * * `verticalAlign` ('middle' | 'top') - Determines the alignment of the content in the table cell.\n */\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;\n\n /**\n * Determines the alignment of the content inside table cells.\n * This property affects all cells, including the ones in the selection column.\n * To target individual cells use `columnDefinitions.verticalAlign`, that takes precedence over `cellVerticalAlign`.\n */\n cellVerticalAlign?: 'middle' | 'top';\n\n /**\n * Specifies the selection type (`'single' | 'multi'`).\n */\n selectionType?: TableProps.SelectionType;\n /**\n * List of selected items.\n */\n selectedItems?: ReadonlyArray<T>;\n\n /**\n * Use this slot to add filtering controls to the table.\n */\n filter?: React.ReactNode;\n\n /**\n * Use this slot to add the [pagination component](/components/pagination/) to the table.\n */\n pagination?: React.ReactNode;\n\n /**\n * Use this slot to add [collection preferences](/components/collection-preferences/) to the table.\n */\n preferences?: React.ReactNode;\n\n /**\n * Determines whether a given item is disabled. If an item is disabled, the user can't select it.\n */\n isItemDisabled?: TableProps.IsItemDisabled<T>;\n\n /**\n * Specifies if text wraps within table cells. If set to `true`, long text within cells may wrap onto\n * multiple lines instead of being truncated with an ellipsis.\n */\n wrapLines?: boolean;\n\n /**\n * Specifies if table rows alternate being shaded and unshaded. If set to `true`, every other row will be shaded.\n */\n stripedRows?: boolean;\n\n /**\n * Toggles the content density of the table. Defaults to `'comfortable'`.\n */\n contentDensity?: 'comfortable' | 'compact';\n\n /**\n * Specifies if columns can be resized. If set to `true`, users can resize the columns in the table.\n */\n resizableColumns?: boolean;\n\n /**\n * Specifies alternative text for the selection components (checkboxes and radio buttons) as follows:\n * * `itemSelectionLabel` ((SelectionState, Item) => string) - Specifies the alternative text for an item.\n * You can use the first argument of type `SelectionState` to access the current selection state of the component\n * (for example, the `selectedItems` list). The second argument is the corresponding `Item` object.\n * * `allItemsSelectionLabel` ((SelectionState) => string) - Specifies the alternative text for multi-selection column header.\n * * `selectionGroupLabel` (string) - Specifies the alternative text for the whole selection and single-selection column header.\n * * `tableLabel` (string) - Provides an alternative text for the table. If you use a header for this table, you may reuse the string\n * to provide a caption-like description. For example, tableLabel=Instances will be announced as 'Instances table'.\n * * `resizerRoleDescription` (string) - Provides role description for table column resizer buttons.\n * * `activateEditLabel` (EditableColumnDefinition, Item) => string -\n * Specifies an alternative text for the edit button in editable cells.\n * * `cancelEditLabel` (EditableColumnDefinition) => string -\n * Specifies an alternative text for the cancel button in editable cells.\n * * `submitEditLabel` (EditableColumnDefinition) => string -\n * Specifies an alternative text for the submit button in editable cells.\n * * `successfulEditLabel` (EditableColumnDefinition) => string -\n * Specifies an alternative text for the success icon in editable cells. This text is also announced to screen readers.\n * * `submittingEditText` (EditableColumnDefinition) => string -\n * Specifies a text that is announced to screen readers when a cell edit operation is submitted.\n * * `expandButtonLabel` (Item) => string - Specifies an alternative text for row expand button.\n * * `collapseButtonLabel` (Item) => string - Specifies an alternative text for row collapse button.\n * @i18n\n */\n ariaLabels?: TableProps.AriaLabels<T>;\n\n /**\n * Specifies the definition object of the currently sorted column. Make sure you pass an object that's\n * present in the `columnDefinitions` array.\n */\n sortingColumn?: TableProps.SortingColumn<T>;\n /**\n * Specifies whether to use a descending sort order.\n */\n sortingDescending?: boolean;\n /**\n * Specifies if sorting buttons are disabled. For example, use this property\n * to prevent the user from sorting before items are fully loaded.\n */\n sortingDisabled?: boolean;\n\n /**\n * Specifies the number of first and/or last columns that should be sticky.\n *\n * If the available scrollable space is less than a certain threshold, the feature is deactivated.\n *\n * Use it in conjunction with the sticky columns preference of the\n * [collection preferences](/components/collection-preferences/) component.\n *\n */\n stickyColumns?: TableProps.StickyColumns;\n\n /**\n * Specifies an array that represents the table columns in the order in which they will be displayed, together with their visibility.\n *\n * If not set, all columns are displayed and the order is dictated by the `columnDefinitions` property.\n *\n * Use it in conjunction with the content display preference of the [collection preferences](/components/collection-preferences/) component.\n */\n columnDisplay?: ReadonlyArray<ColumnDisplayProperties>;\n\n /**\n * Specifies an array containing the `id`s of visible columns. If not set, all columns are displayed.\n *\n * Use it in conjunction with the visible content preference of the [collection preferences](/components/collection-preferences/) component.\n *\n * The order of ids doesn't influence the order in which columns are displayed - this is dictated by the `columnDefinitions` property.\n *\n * @deprecated Replaced by `columnDisplay`.\n */\n visibleColumns?: ReadonlyArray<string>;\n\n /**\n * Fired when the user resizes a table column. The event detail contains an array of column widths in pixels,\n * including the hidden via preferences columns. Use this event to persist the column widths.\n */\n onColumnWidthsChange?: NonCancelableEventHandler<TableProps.ColumnWidthsChangeDetail>;\n\n /**\n * Called when either the column to sort by or the direction of sorting changes upon user interaction.\n * The event detail contains the current sortingColumn and isDescending.\n */\n onSortingChange?: NonCancelableEventHandler<TableProps.SortingState<T>>;\n\n /**\n * Fired when a user interaction triggers a change in the list of selected items.\n * The event `detail` contains the current list of `selectedItems`.\n */\n onSelectionChange?: NonCancelableEventHandler<TableProps.SelectionChangeDetail<T>>;\n\n /**\n * Note: This feature is provided for backwards compatibility. Its use is not recommended,\n * and it may be deprecated in the future.\n *\n * Called when the user clicked at a table row. The event detail contains the index of the\n * clicked row and the row object itself. Use this event to define a row click behavior.\n */\n onRowClick?: NonCancelableEventHandler<TableProps.OnRowClickDetail<T>>;\n\n /**\n * Note: This feature is provided for backwards compatibility. Its use is not recommended,\n * and it may be deprecated in the future.\n *\n * Called when the user clicked at a table row with the right mouse click. The event detail\n * contains the index of the clicked row and the row object itself. Use this event to override\n * the default browser context menu behavior.\n */\n onRowContextMenu?: CancelableEventHandler<TableProps.OnRowContextMenuDetail<T>>;\n\n /**\n * If set to `true`, the table header remains visible when the user scrolls down.\n *\n * Do not use `stickyHeader` conditionally. Instead, keep its value constant during the component lifecycle.\n */\n stickyHeader?: boolean;\n\n /**\n * Specifies a vertical offset (in pixels) for the sticky header. For example, use this if you\n * need to position the sticky header below other fixed position elements on the page.\n */\n stickyHeaderVerticalOffset?: number;\n\n /**\n * Specify a table variant with one of the following:\n * * `container` - Use this variant to have the table displayed within a container.\n * * `borderless` - Use this variant when the table should have no outer borders or shadow\n * (such as in a dashboard item container).\n * * `embedded` - Use this variant within a parent container (such as a modal, expandable\n * section, container or split panel).\n * **Deprecated**, replaced by `borderless` and `container`.\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * * `full-page` – Use this variant when the table is the entire content of a page.\n * @visualrefresh `embedded`, `stacked`, and `full-page` variants\n */\n variant?: TableProps.Variant;\n\n /**\n * Use this property to inform screen readers how many items there are in a table.\n * It specifies the total count of all items in a table.\n * If there is an unknown total of items in a table, leave this property undefined.\n */\n totalItemsCount?: number;\n /**\n * Use this property to inform screen readers which range of items is currently displayed in the table.\n * It specifies the index (1-based) of the first item in the table.\n */\n firstIndex?: number;\n /**\n * Use this function to announce page changes to screen reader users.\n * The function argument takes the following properties:\n * * `firstIndex` (number) - The provided `firstIndex` property which defaults to 1 when not defined.\n * * `lastIndex` (number) - The index of the last visible item of the table.\n * * `visibleItemsCount` (number) - The number of rendered table items.\n * * `totalItemsCount` (optional, number) - The provided `totalItemsCount` property.\n * Important: in tables with expandable rows the `firstIndex`, `lastIndex`, and `totalItemsCount` reflect the top-level items only.\n */\n renderAriaLive?: (data: TableProps.LiveAnnouncement) => string;\n /**\n * Specifies a function that will be called after user submits an inline edit.\n * Return a promise to keep loading state while the submit request is in progress.\n */\n submitEdit?: TableProps.SubmitEditFunction<T>;\n\n /**\n * Called whenever user cancels an inline edit. Use this function to reset any\n * validation states, or show warning for unsaved changes.\n */\n onEditCancel?: CancelableEventHandler;\n\n /**\n * Use this property to activate advanced keyboard navigation and focusing behaviors.\n * When set to `true`, table cells become navigable with arrow keys, and the entire table has a single tab stop.\n *\n * By default, the keyboard navigation is active for tables with expandable rows.\n */\n enableKeyboardNavigation?: boolean;\n\n /**\n * Use this property to define expandable table rows. The expandableRows configuration object consists of:\n * * `getItemChildren` ((Item) => Item[]) - Use it to define nested data that are shown when an item gets expanded.\n * * `isItemExpandable` ((Item) => boolean) - Use it for items that can be expanded to show nested data.\n * * `expandedItems` (Item[]) - Use it to represent the expanded state of items.\n * * `onExpandableItemToggle` (TableProps.OnExpandableItemToggle<T>) - Called when an item's expand toggle is clicked.\n */\n expandableRows?: TableProps.ExpandableRows<T>;\n\n /**\n * A function that specifies the current status of loading more items. It is called once for the entire\n * table with `item=null` and then for each expanded item. The function result is one of the four possible states:\n * * `pending` - Indicates that no request in progress, but more options may be loaded.\n * * `loading` - Indicates that data fetching is in progress.\n * * `finished` - Indicates that loading has finished and no more requests are expected.\n * * `error` - Indicates that an error occurred during fetch.\n **/\n getLoadingStatus?: TableProps.GetLoadingStatus<T>;\n /**\n * Renders loader row content for pending state.\n */\n renderLoaderPending?: (detail: TableProps.RenderLoaderDetail<T>) => React.ReactNode;\n /**\n * Renders loader row content for loading state.\n */\n renderLoaderLoading?: (detail: TableProps.RenderLoaderDetail<T>) => React.ReactNode;\n /**\n * Renders loader row content for error state.\n */\n renderLoaderError?: (detail: TableProps.RenderLoaderDetail<T>) => React.ReactNode;\n /**\n * Renders loader row content for empty row state: the loading status is \"finished\",\n * and the row is expanded but has empty children array.\n *\n * The empty loader state is only supported for expandable rows. Use `empty` slot if\n * the table items array is empty.\n */\n renderLoaderEmpty?: (detail: TableProps.RenderLoaderEmptyDetail<T>) => React.ReactNode;\n}\n\nexport namespace TableProps {\n export interface AnalyticsMetadata {\n instanceIdentifier?: string;\n flowType?: 'view-resource';\n resourceType?: string;\n }\n\n export type TrackBy<T> = string | ((item: T) => string);\n\n export interface CellContext<V> {\n currentValue: Optional<V>;\n setValue: (value: V | undefined) => void;\n }\n\n export interface EditConfig<T, V = any> {\n /**\n * Specifies a label for the edit control. Visually hidden but read\n * by screen readers.\n */\n ariaLabel?: string;\n /**\n * Specifies an ariaLabel for the error icon that is displayed when\n * the validation fails.\n */\n errorIconAriaLabel?: string;\n /**\n * Specifies an alternate text for the edit icon used in column header.\n */\n editIconAriaLabel?: string;\n /**\n * Constraint text that is displayed below the edit control.\n */\n constraintText?: string;\n /**\n * A function that allows you to validate the value of the edit control. Return\n * a string from the function to display an error message. Return\n * `undefined` (or no return) from the function to indicate that the value is valid.\n * @param item - The item that is being edited.\n * @param value - The current value of the edit control.\n */\n validation?: (item: T, value: Optional<V>) => Optional<string>;\n\n /**\n * Determines the display of a cell's content when inline edit is active.\n */\n editingCell(item: T, ctx: TableProps.CellContext<any>): React.ReactNode;\n\n /**\n * Determines whether inline edit for certain items is disabled, and provides a reason why.\n */\n disabledReason?: (item: T) => string | undefined;\n }\n\n export type ColumnDefinition<ItemType> = {\n id?: string;\n header: React.ReactNode;\n ariaLabel?(data: LabelData): string;\n width?: number | string;\n minWidth?: number | string;\n maxWidth?: number | string;\n editConfig?: EditConfig<ItemType>;\n isRowHeader?: boolean;\n verticalAlign?: VerticalAlign;\n hasDynamicContent?: boolean;\n cell(item: ItemType): React.ReactNode;\n } & SortingColumn<ItemType>;\n\n export interface StickyColumns {\n first?: number;\n last?: number;\n }\n\n export type VerticalAlign = 'middle' | 'top';\n export type SelectionType = 'single' | 'multi';\n export type Variant = 'container' | 'embedded' | 'borderless' | 'stacked' | 'full-page';\n export interface SelectionState<T> {\n selectedItems: ReadonlyArray<T>;\n }\n export interface SelectionChangeDetail<T> {\n selectedItems: T[];\n }\n export type IsItemDisabled<T> = (item: T) => boolean;\n export interface AriaLabels<T> {\n allItemsSelectionLabel?: (data: TableProps.SelectionState<T>) => string;\n itemSelectionLabel?: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel?: string;\n tableLabel?: string;\n resizerRoleDescription?: string;\n // do not use <T> to prevent overly strict validation on consumer end\n // it works, practically, we are only interested in `id` and `header` properties only\n activateEditLabel?: (column: ColumnDefinition<any>, item: T) => string;\n cancelEditLabel?: (column: ColumnDefinition<any>) => string;\n submitEditLabel?: (column: ColumnDefinition<any>) => string;\n submittingEditText?: (column: ColumnDefinition<any>) => string;\n successfulEditLabel?: (column: ColumnDefinition<any>) => string;\n expandButtonLabel?: (item: T) => string;\n collapseButtonLabel?: (item: T) => string;\n }\n export interface SortingState<T> {\n isDescending?: boolean;\n sortingColumn: SortingColumn<T>;\n }\n export interface SortingColumn<T> {\n sortingField?: string;\n sortingComparator?: (a: T, b: T) => number;\n }\n export interface LabelData {\n sorted: boolean;\n descending: boolean;\n disabled: boolean;\n }\n export interface OnRowClickDetail<T> {\n rowIndex: number;\n item: T;\n }\n export interface OnRowContextMenuDetail<T> {\n rowIndex: number;\n item: T;\n clientX: number;\n clientY: number;\n }\n\n export interface ColumnWidthsChangeDetail {\n widths: ReadonlyArray<number>;\n }\n\n export interface LiveAnnouncement {\n firstIndex: number;\n lastIndex: number;\n visibleItemsCount: number;\n totalItemsCount?: number;\n }\n\n export interface Ref {\n /**\n * When the sticky header is enabled and you call this function, the table\n * scroll parent scrolls to reveal the first row of the table.\n */\n scrollToTop(): void;\n\n /**\n * Dismiss an inline edit if currently active.\n */\n cancelEdit?(): void;\n }\n\n export type SubmitEditFunction<ItemType, ValueType = unknown> = (\n item: ItemType,\n column: ColumnDefinition<ItemType>,\n newValue: ValueType\n ) => Promise<void> | void;\n\n export interface ColumnDisplayProperties {\n id: string;\n visible: boolean;\n }\n\n export interface ExpandableRows<T> {\n getItemChildren: (item: T) => readonly T[];\n isItemExpandable: (item: T) => boolean;\n expandedItems: ReadonlyArray<T>;\n onExpandableItemToggle: TableProps.OnExpandableItemToggle<T>;\n }\n\n export type OnExpandableItemToggle<T> = NonCancelableEventHandler<TableProps.ExpandableItemToggleDetail<T>>;\n\n export interface ExpandableItemToggleDetail<T> {\n item: T;\n expanded: boolean;\n }\n\n export type GetLoadingStatus<T> = (item: null | T) => TableProps.LoadingStatus;\n\n export type LoadingStatus = 'pending' | 'loading' | 'error' | 'finished';\n\n export interface RenderLoaderDetail<T> {\n item: null | T;\n }\n\n export interface RenderLoaderEmptyDetail<T> {\n item: T;\n }\n}\n\nexport type TableRow<T> = TableDataRow<T> | TableLoaderRow<T>;\n\ninterface TableDataRow<T> {\n type: 'data';\n item: T;\n}\n\ninterface TableLoaderRow<T> {\n type: 'loader';\n item: null | T;\n level: number;\n status: TableProps.LoadingStatus;\n from: number;\n}\n"]}
|