@cloudscape-design/components 3.0.154 → 3.0.156
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/button/internal.d.ts +0 -1
- package/button/internal.d.ts.map +1 -1
- package/button/internal.js +2 -2
- package/button/internal.js.map +1 -1
- package/cards/index.d.ts.map +1 -1
- package/cards/index.js +6 -1
- package/cards/index.js.map +1 -1
- package/form-field/interfaces.d.ts +0 -10
- package/form-field/interfaces.d.ts.map +1 -1
- package/form-field/interfaces.js.map +1 -1
- package/form-field/internal.d.ts +1 -1
- package/form-field/internal.d.ts.map +1 -1
- package/form-field/internal.js +4 -5
- package/form-field/internal.js.map +1 -1
- package/input/internal.d.ts.map +1 -1
- package/input/internal.js +4 -16
- package/input/internal.js.map +1 -1
- package/internal/context/form-field-context.d.ts +2 -6
- package/internal/context/form-field-context.d.ts.map +1 -1
- package/internal/context/form-field-context.js +1 -7
- package/internal/context/form-field-context.js.map +1 -1
- package/internal/environment.js +1 -1
- package/{table → internal/hooks}/use-mouse-down-target.d.ts +0 -0
- package/internal/hooks/use-mouse-down-target.d.ts.map +1 -0
- package/{table → internal/hooks}/use-mouse-down-target.js +1 -1
- package/internal/hooks/use-mouse-down-target.js.map +1 -0
- package/internal/manifest.json +1 -1
- package/internal/types.d.ts +0 -9
- package/internal/types.d.ts.map +1 -1
- package/internal/types.js +2 -0
- package/internal/types.js.map +1 -1
- package/package.json +1 -1
- package/select/parts/styles.css.js +9 -9
- package/select/parts/styles.scoped.css +9 -27
- package/select/parts/styles.selectors.js +9 -9
- package/table/body-cell/index.d.ts +20 -11
- package/table/body-cell/index.d.ts.map +1 -1
- package/table/body-cell/index.js +9 -48
- package/table/body-cell/index.js.map +1 -1
- package/table/body-cell/styles.css.js +12 -18
- package/table/body-cell/styles.scoped.css +46 -229
- package/table/body-cell/styles.selectors.js +12 -18
- package/table/header-cell/index.d.ts +7 -8
- package/table/header-cell/index.d.ts.map +1 -1
- package/table/header-cell/index.js +2 -6
- package/table/header-cell/index.js.map +1 -1
- package/table/header-cell/styles.css.js +18 -19
- package/table/header-cell/styles.scoped.css +35 -40
- package/table/header-cell/styles.selectors.js +18 -19
- package/table/header-cell/utils.d.ts +1 -1
- package/table/header-cell/utils.d.ts.map +1 -1
- package/table/interfaces.d.ts +10 -85
- package/table/interfaces.d.ts.map +1 -1
- package/table/interfaces.js.map +1 -1
- package/table/internal.d.ts.map +1 -1
- package/table/internal.js +19 -69
- package/table/internal.js.map +1 -1
- package/table/thead.d.ts.map +1 -1
- package/table/thead.js +1 -1
- package/table/thead.js.map +1 -1
- package/table/utils.d.ts +1 -1
- package/table/utils.d.ts.map +1 -1
- package/test-utils/dom/table/index.d.ts +0 -4
- package/test-utils/dom/table/index.js +5 -21
- package/test-utils/dom/table/index.js.map +1 -1
- package/test-utils/selectors/table/index.d.ts +0 -4
- package/test-utils/selectors/table/index.js +5 -21
- package/test-utils/selectors/table/index.js.map +1 -1
- package/test-utils/tsconfig.tsbuildinfo +1 -1
- package/table/body-cell/click-away.d.ts +0 -9
- package/table/body-cell/click-away.d.ts.map +0 -1
- package/table/body-cell/click-away.js +0 -38
- package/table/body-cell/click-away.js.map +0 -1
- package/table/body-cell/inline-editor.d.ts +0 -12
- package/table/body-cell/inline-editor.d.ts.map +0 -1
- package/table/body-cell/inline-editor.js +0 -88
- package/table/body-cell/inline-editor.js.map +0 -1
- package/table/body-cell/td-element.d.ts +0 -21
- package/table/body-cell/td-element.d.ts.map +0 -1
- package/table/body-cell/td-element.js +0 -11
- package/table/body-cell/td-element.js.map +0 -1
- package/table/body-cell/use-stable-scroll-position.d.ts +0 -17
- package/table/body-cell/use-stable-scroll-position.d.ts.map +0 -1
- package/table/body-cell/use-stable-scroll-position.js +0 -48
- package/table/body-cell/use-stable-scroll-position.js.map +0 -1
- package/table/use-mouse-down-target.d.ts.map +0 -1
- package/table/use-mouse-down-target.js.map +0 -1
- package/table/use-table-focus-navigation.d.ts +0 -16
- package/table/use-table-focus-navigation.d.ts.map +0 -1
- package/table/use-table-focus-navigation.js +0 -131
- package/table/use-table-focus-navigation.js.map +0 -1
|
@@ -90,7 +90,7 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
90
90
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
91
91
|
SPDX-License-Identifier: Apache-2.0
|
|
92
92
|
*/
|
|
93
|
-
.awsui_header-
|
|
93
|
+
.awsui_header-cell_1spae_1d6sg_93:not(#\9) {
|
|
94
94
|
position: relative;
|
|
95
95
|
text-align: left;
|
|
96
96
|
box-sizing: border-box;
|
|
@@ -102,19 +102,19 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
102
102
|
-moz-osx-font-smoothing: var(--font-smoothing-moz-osx-nkh1jb, grayscale);
|
|
103
103
|
padding: var(--space-scaled-xxs-95dhkm, 4px) var(--space-scaled-xs-6859qs, 8px);
|
|
104
104
|
}
|
|
105
|
-
.awsui_header-cell-
|
|
105
|
+
.awsui_header-cell-sticky_1spae_1d6sg_105:not(#\9) {
|
|
106
106
|
border-bottom: var(--border-table-sticky-width-h1tlxy, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
107
107
|
}
|
|
108
|
-
.awsui_header-cell-
|
|
108
|
+
.awsui_header-cell-stuck_1spae_1d6sg_108:not(#\9):not(.awsui_header-cell-variant-full-page_1spae_1d6sg_108) {
|
|
109
109
|
border-bottom-color: transparent;
|
|
110
110
|
}
|
|
111
|
-
.awsui_header-cell-variant-full-
|
|
111
|
+
.awsui_header-cell-variant-full-page_1spae_1d6sg_108.awsui_header-cell-hidden_1spae_1d6sg_111:not(#\9) {
|
|
112
112
|
border-bottom-color: transparent;
|
|
113
113
|
}
|
|
114
|
-
.awsui_header-
|
|
114
|
+
.awsui_header-cell_1spae_1d6sg_93:not(#\9):last-child, .awsui_header-cell_1spae_1d6sg_93.awsui_header-cell-sortable_1spae_1d6sg_114:not(#\9) {
|
|
115
115
|
padding-right: var(--space-xs-rsr2qu, 8px);
|
|
116
116
|
}
|
|
117
|
-
.awsui_header-
|
|
117
|
+
.awsui_header-cell_1spae_1d6sg_93:not(#\9):not(:last-child):before {
|
|
118
118
|
content: "";
|
|
119
119
|
position: absolute;
|
|
120
120
|
right: 0;
|
|
@@ -123,42 +123,40 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
123
123
|
border-left: var(--border-divider-section-width-4wm2it, 2px) solid var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
124
124
|
box-sizing: border-box;
|
|
125
125
|
}
|
|
126
|
-
.awsui_header-cell-
|
|
126
|
+
.awsui_header-cell-resizable_1spae_1d6sg_126:not(#\9):not(:last-child):before {
|
|
127
127
|
border-left-color: var(--color-border-divider-interactive-default-rcasvw, #e9ebed);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
.awsui_sorting-
|
|
130
|
+
.awsui_sorting-icon_1spae_1d6sg_130:not(#\9) {
|
|
131
131
|
position: absolute;
|
|
132
132
|
top: var(--space-scaled-xxs-95dhkm, 4px);
|
|
133
133
|
right: var(--space-xxs-ynfts5, 4px);
|
|
134
134
|
color: var(--color-text-column-sorting-icon-q5sr09, #414d5c);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
.
|
|
138
|
-
|
|
139
|
-
margin-top: var(--space-scaled-xxs-95dhkm, 4px);
|
|
140
|
-
color: inherit;
|
|
137
|
+
.awsui_header-cell-disabled_1spae_1d6sg_137.awsui_header-cell-sorted_1spae_1d6sg_137 > .awsui_header-cell-content_1spae_1d6sg_137 > .awsui_sorting-icon_1spae_1d6sg_130:not(#\9) {
|
|
138
|
+
color: var(--color-text-interactive-disabled-3pbb07, #9ba7b6);
|
|
141
139
|
}
|
|
142
140
|
|
|
143
|
-
.awsui_header-cell-
|
|
141
|
+
.awsui_header-cell-content_1spae_1d6sg_137:not(#\9) {
|
|
144
142
|
position: relative;
|
|
145
143
|
padding: var(--space-scaled-xxs-95dhkm, 4px) var(--space-s-hv8c1d, 12px);
|
|
146
144
|
}
|
|
147
|
-
.awsui_header-cell-
|
|
145
|
+
.awsui_header-cell-sortable_1spae_1d6sg_114 > .awsui_header-cell-content_1spae_1d6sg_137:not(#\9) {
|
|
148
146
|
padding-right: calc(var(--space-xl-a39hup, 24px) + var(--space-xxs-ynfts5, 4px));
|
|
149
147
|
}
|
|
150
|
-
.awsui_header-cell-
|
|
148
|
+
.awsui_header-cell-content_1spae_1d6sg_137:not(#\9):focus {
|
|
151
149
|
outline: none;
|
|
152
150
|
text-decoration: none;
|
|
153
151
|
}
|
|
154
|
-
.awsui_header-cell-
|
|
152
|
+
.awsui_header-cell-content_1spae_1d6sg_137[data-awsui-focus-visible=true]:not(#\9):focus {
|
|
155
153
|
position: relative;
|
|
156
154
|
}
|
|
157
|
-
.awsui_header-cell-
|
|
155
|
+
.awsui_header-cell-content_1spae_1d6sg_137[data-awsui-focus-visible=true]:not(#\9):focus {
|
|
158
156
|
outline: 2px dotted transparent;
|
|
159
157
|
outline-offset: calc(var(--space-table-header-focus-outline-gutter-rbx7m7, 0px) - 1px);
|
|
160
158
|
}
|
|
161
|
-
.awsui_header-cell-
|
|
159
|
+
.awsui_header-cell-content_1spae_1d6sg_137[data-awsui-focus-visible=true]:not(#\9):focus::before {
|
|
162
160
|
content: " ";
|
|
163
161
|
display: block;
|
|
164
162
|
position: absolute;
|
|
@@ -169,14 +167,14 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
169
167
|
border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
|
|
170
168
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
|
|
171
169
|
}
|
|
172
|
-
.awsui_header-cell-
|
|
170
|
+
.awsui_header-cell-content_1spae_1d6sg_137.awsui_header-cell-fake-focus_1spae_1d6sg_170:not(#\9) {
|
|
173
171
|
position: relative;
|
|
174
172
|
}
|
|
175
|
-
.awsui_header-cell-
|
|
173
|
+
.awsui_header-cell-content_1spae_1d6sg_137.awsui_header-cell-fake-focus_1spae_1d6sg_170:not(#\9) {
|
|
176
174
|
outline: 2px dotted transparent;
|
|
177
175
|
outline-offset: calc(var(--space-table-header-focus-outline-gutter-rbx7m7, 0px) - 1px);
|
|
178
176
|
}
|
|
179
|
-
.awsui_header-cell-
|
|
177
|
+
.awsui_header-cell-content_1spae_1d6sg_137.awsui_header-cell-fake-focus_1spae_1d6sg_170:not(#\9)::before {
|
|
180
178
|
content: " ";
|
|
181
179
|
display: block;
|
|
182
180
|
position: absolute;
|
|
@@ -187,57 +185,54 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
187
185
|
border-radius: var(--border-radius-control-default-focus-ring-7661kz, 4px);
|
|
188
186
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-ap3b6s, #0972d3);
|
|
189
187
|
}
|
|
190
|
-
.awsui_header-cell-disabled_1spae_lzlsa_190.awsui_header-cell-sorted_1spae_lzlsa_190 > .awsui_header-cell-content_1spae_lzlsa_143 > .awsui_sorting-icon_1spae_lzlsa_130:not(#\9) {
|
|
191
|
-
color: var(--color-text-interactive-disabled-3pbb07, #9ba7b6);
|
|
192
|
-
}
|
|
193
188
|
|
|
194
|
-
.awsui_header-cell-
|
|
189
|
+
.awsui_header-cell-sortable_1spae_1d6sg_114:not(#\9):not(.awsui_header-cell-disabled_1spae_1d6sg_137) > .awsui_header-cell-content_1spae_1d6sg_137 {
|
|
195
190
|
cursor: pointer;
|
|
196
191
|
}
|
|
197
|
-
.awsui_header-cell-
|
|
192
|
+
.awsui_header-cell-sortable_1spae_1d6sg_114:not(#\9):not(.awsui_header-cell-disabled_1spae_1d6sg_137) > .awsui_header-cell-content_1spae_1d6sg_137:hover, .awsui_header-cell-sortable_1spae_1d6sg_114:not(#\9):not(.awsui_header-cell-disabled_1spae_1d6sg_137).awsui_header-cell-sorted_1spae_1d6sg_137 > .awsui_header-cell-content_1spae_1d6sg_137 {
|
|
198
193
|
color: var(--color-text-interactive-active-vol84d, #000716);
|
|
199
194
|
}
|
|
200
|
-
.awsui_header-cell-
|
|
195
|
+
.awsui_header-cell-sortable_1spae_1d6sg_114:not(#\9):not(.awsui_header-cell-disabled_1spae_1d6sg_137) > .awsui_header-cell-content_1spae_1d6sg_137:hover > .awsui_sorting-icon_1spae_1d6sg_130, .awsui_header-cell-sortable_1spae_1d6sg_114:not(#\9):not(.awsui_header-cell-disabled_1spae_1d6sg_137).awsui_header-cell-sorted_1spae_1d6sg_137 > .awsui_header-cell-content_1spae_1d6sg_137 > .awsui_sorting-icon_1spae_1d6sg_130 {
|
|
201
196
|
color: var(--color-text-interactive-active-vol84d, #000716);
|
|
202
197
|
}
|
|
203
198
|
|
|
204
|
-
.awsui_header-cell-
|
|
199
|
+
.awsui_header-cell-text_1spae_1d6sg_199:not(#\9):not(.awsui_header-cell-text-wrap_1spae_1d6sg_199) {
|
|
205
200
|
white-space: nowrap;
|
|
206
201
|
overflow: hidden;
|
|
207
202
|
text-overflow: ellipsis;
|
|
208
203
|
}
|
|
209
204
|
|
|
210
|
-
.awsui_header-cell-
|
|
211
|
-
.awsui_header-cell-
|
|
205
|
+
.awsui_header-cell-ascending_1spae_1d6sg_205:not(#\9),
|
|
206
|
+
.awsui_header-cell-descending_1spae_1d6sg_206:not(#\9) {
|
|
212
207
|
/* used in test-utils */
|
|
213
208
|
}
|
|
214
209
|
|
|
215
210
|
/*
|
|
216
211
|
In Visual Refresh the first cell in the header should align
|
|
217
|
-
with the left edge of the table as closely as possible. If the
|
|
218
|
-
last header cell is sortable the sort icon should align with the
|
|
212
|
+
with the left edge of the table as closely as possible. If the
|
|
213
|
+
last header cell is sortable the sort icon should align with the
|
|
219
214
|
settings icon in the pagination slot.
|
|
220
215
|
*/
|
|
221
|
-
.awsui_header-
|
|
216
|
+
.awsui_header-cell_1spae_1d6sg_93:not(#\9):not(.awsui_is-visual-refresh_1spae_1d6sg_216):first-child {
|
|
222
217
|
padding-left: var(--space-xs-rsr2qu, 8px);
|
|
223
218
|
}
|
|
224
219
|
|
|
225
|
-
.awsui_header-
|
|
220
|
+
.awsui_header-cell_1spae_1d6sg_93.awsui_is-visual-refresh_1spae_1d6sg_216:not(#\9) {
|
|
226
221
|
/*
|
|
227
|
-
Striped rows requires additional left padding because the
|
|
228
|
-
shaded background makes the child content appear too close
|
|
222
|
+
Striped rows requires additional left padding because the
|
|
223
|
+
shaded background makes the child content appear too close
|
|
229
224
|
to the table edge.
|
|
230
225
|
*/
|
|
231
226
|
}
|
|
232
|
-
.awsui_header-
|
|
227
|
+
.awsui_header-cell_1spae_1d6sg_93.awsui_is-visual-refresh_1spae_1d6sg_216:not(#\9):first-child:not(.awsui_has-striped-rows_1spae_1d6sg_227) {
|
|
233
228
|
padding-left: var(--space-xxxs-k2w98v, 2px);
|
|
234
229
|
}
|
|
235
|
-
.awsui_header-
|
|
230
|
+
.awsui_header-cell_1spae_1d6sg_93.awsui_is-visual-refresh_1spae_1d6sg_216:not(#\9):first-child.awsui_has-striped-rows_1spae_1d6sg_227 {
|
|
236
231
|
padding-left: var(--space-xxs-ynfts5, 4px);
|
|
237
232
|
}
|
|
238
|
-
.awsui_header-
|
|
233
|
+
.awsui_header-cell_1spae_1d6sg_93.awsui_is-visual-refresh_1spae_1d6sg_216:not(#\9):first-child > .awsui_header-cell-content_1spae_1d6sg_137 {
|
|
239
234
|
padding-left: 0;
|
|
240
235
|
}
|
|
241
|
-
.awsui_header-
|
|
236
|
+
.awsui_header-cell_1spae_1d6sg_93.awsui_is-visual-refresh_1spae_1d6sg_216:not(#\9):last-child.awsui_header-cell-sortable_1spae_1d6sg_114 {
|
|
242
237
|
padding-right: var(--space-xxxs-k2w98v, 2px);
|
|
243
238
|
}
|
|
@@ -2,24 +2,23 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"header-cell": "awsui_header-
|
|
6
|
-
"header-cell-sticky": "awsui_header-cell-
|
|
7
|
-
"header-cell-stuck": "awsui_header-cell-
|
|
8
|
-
"header-cell-variant-full-page": "awsui_header-cell-variant-full-
|
|
9
|
-
"header-cell-hidden": "awsui_header-cell-
|
|
10
|
-
"header-cell-sortable": "awsui_header-cell-
|
|
11
|
-
"header-cell-resizable": "awsui_header-cell-
|
|
12
|
-
"sorting-icon": "awsui_sorting-
|
|
13
|
-
"
|
|
14
|
-
"header-cell-
|
|
15
|
-
"header-cell-
|
|
16
|
-
"header-cell-
|
|
17
|
-
"header-cell-
|
|
18
|
-
"header-cell-text": "awsui_header-cell-
|
|
19
|
-
"header-cell-
|
|
20
|
-
"header-cell-
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"has-striped-rows": "awsui_has-striped-rows_1spae_lzlsa_232"
|
|
5
|
+
"header-cell": "awsui_header-cell_1spae_1d6sg_93",
|
|
6
|
+
"header-cell-sticky": "awsui_header-cell-sticky_1spae_1d6sg_105",
|
|
7
|
+
"header-cell-stuck": "awsui_header-cell-stuck_1spae_1d6sg_108",
|
|
8
|
+
"header-cell-variant-full-page": "awsui_header-cell-variant-full-page_1spae_1d6sg_108",
|
|
9
|
+
"header-cell-hidden": "awsui_header-cell-hidden_1spae_1d6sg_111",
|
|
10
|
+
"header-cell-sortable": "awsui_header-cell-sortable_1spae_1d6sg_114",
|
|
11
|
+
"header-cell-resizable": "awsui_header-cell-resizable_1spae_1d6sg_126",
|
|
12
|
+
"sorting-icon": "awsui_sorting-icon_1spae_1d6sg_130",
|
|
13
|
+
"header-cell-disabled": "awsui_header-cell-disabled_1spae_1d6sg_137",
|
|
14
|
+
"header-cell-sorted": "awsui_header-cell-sorted_1spae_1d6sg_137",
|
|
15
|
+
"header-cell-content": "awsui_header-cell-content_1spae_1d6sg_137",
|
|
16
|
+
"header-cell-fake-focus": "awsui_header-cell-fake-focus_1spae_1d6sg_170",
|
|
17
|
+
"header-cell-text": "awsui_header-cell-text_1spae_1d6sg_199",
|
|
18
|
+
"header-cell-text-wrap": "awsui_header-cell-text-wrap_1spae_1d6sg_199",
|
|
19
|
+
"header-cell-ascending": "awsui_header-cell-ascending_1spae_1d6sg_205",
|
|
20
|
+
"header-cell-descending": "awsui_header-cell-descending_1spae_1d6sg_206",
|
|
21
|
+
"is-visual-refresh": "awsui_is-visual-refresh_1spae_1d6sg_216",
|
|
22
|
+
"has-striped-rows": "awsui_has-striped-rows_1spae_1d6sg_227"
|
|
24
23
|
};
|
|
25
24
|
|
|
@@ -3,6 +3,6 @@ type SortingStatus = 'sortable' | 'ascending' | 'descending';
|
|
|
3
3
|
export declare const getSortingStatus: (sortable: boolean, sorted: boolean, descending: boolean, disabled: boolean) => SortingStatus | undefined;
|
|
4
4
|
export declare const getSortingIconName: (sortingState: SortingStatus) => "caret-down-filled" | "caret-down" | "caret-up-filled";
|
|
5
5
|
export declare const getAriaSort: (sortingState: SortingStatus) => "none" | "ascending" | "descending";
|
|
6
|
-
export declare const isSorted: <T>(column: TableProps.ColumnDefinition<T
|
|
6
|
+
export declare const isSorted: <T>(column: TableProps.ColumnDefinition<T>, sortingColumn: TableProps.SortingColumn<T>) => boolean;
|
|
7
7
|
export {};
|
|
8
8
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/table/header-cell/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,KAAK,aAAa,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC;AAY7D,eAAO,MAAM,gBAAgB,aACjB,OAAO,UACT,OAAO,cACH,OAAO,YACT,OAAO,KAChB,aAAa,GAAG,SAWlB,CAAC;AAEF,eAAO,MAAM,kBAAkB,iBAAkB,aAAa,2DAA8B,CAAC;AAC7F,eAAO,MAAM,WAAW,iBAAkB,aAAa,wCAAkC,CAAC;AAC1F,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/table/header-cell/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,KAAK,aAAa,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CAAC;AAY7D,eAAO,MAAM,gBAAgB,aACjB,OAAO,UACT,OAAO,cACH,OAAO,YACT,OAAO,KAChB,aAAa,GAAG,SAWlB,CAAC;AAEF,eAAO,MAAM,kBAAkB,iBAAkB,aAAa,2DAA8B,CAAC;AAC7F,eAAO,MAAM,WAAW,iBAAkB,aAAa,wCAAkC,CAAC;AAC1F,eAAO,MAAM,QAAQ,oGAGqF,CAAC"}
|
package/table/interfaces.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BaseComponentProps } from '../internal/base-component';
|
|
3
3
|
import { NonCancelableEventHandler, CancelableEventHandler } from '../internal/events';
|
|
4
|
-
import { Optional } from '../internal/types';
|
|
5
4
|
export interface TableForwardRefType {
|
|
6
5
|
<T>(props: TableProps<T> & {
|
|
7
6
|
ref?: React.Ref<TableProps.Ref>;
|
|
8
7
|
}): JSX.Element;
|
|
9
8
|
}
|
|
10
|
-
export interface TableProps<T = any
|
|
9
|
+
export interface TableProps<T = any> extends BaseComponentProps {
|
|
11
10
|
/**
|
|
12
11
|
* Heading element of the table container. Use the [header component](/components/header/).
|
|
13
12
|
*/
|
|
@@ -54,8 +53,7 @@ export interface TableProps<T = any, V = any> extends BaseComponentProps {
|
|
|
54
53
|
* fills the remaining space of the table so the specified width is ignored.
|
|
55
54
|
* * `minWidth` (string | number) - Specifies the minimum column width. Corresponds to the `min-width` css-property. When
|
|
56
55
|
* `resizableColumns` property is set to `true`, additional constraints apply: 1) string values are not allowed,
|
|
57
|
-
* and 2) the column can't resize below than the specified width (defaults to "120px").
|
|
58
|
-
* of at least 176px for columns that are editable.
|
|
56
|
+
* and 2) the column can't resize below than the specified width (defaults to "120px").
|
|
59
57
|
* * `maxWidth` (string | number) - Specifies the maximum column width. Corresponds to the `max-width` css-property.
|
|
60
58
|
* Note that when the `resizableColumns` property is set to `true` this property is ignored.
|
|
61
59
|
* * `ariaLabel` (LabelData => string) - An optional function that's called to provide an `aria-label` for the cell header.
|
|
@@ -70,16 +68,9 @@ export interface TableProps<T = any, V = any> extends BaseComponentProps {
|
|
|
70
68
|
* to reorder the items. This property accepts a custom comparator that is used to compare two items.
|
|
71
69
|
* The comparator must implement ascending ordering, and the output is inverted automatically in case of descending order.
|
|
72
70
|
* If present, the `sortingField` property is ignored.
|
|
73
|
-
* * `editConfig` (EditConfig) - Enables inline editing in column when present. The value is used to configure the editing behavior.
|
|
74
|
-
* * * `editConfig.ariaLabel` (string) - Specifies a label for the edit control. Visually hidden but read by screen readers.
|
|
75
|
-
* * * `editConfig.errorIconAriaLabel` (string) - Specifies an ariaLabel for the error icon that is displayed when the validation fails.
|
|
76
|
-
* * * `editConfig.editIconAriaLabel` (string) - Specifies an alternate text for the edit icon used in column header.
|
|
77
|
-
* * * `editConfig.constraintText` (string) - Constraint text that is displayed below the edit control.
|
|
78
|
-
* * * `editConfig.validation` ((item, value) => string) - A function that allows you to validate the value of the edit control.
|
|
79
|
-
* 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.
|
|
80
71
|
*
|
|
81
72
|
*/
|
|
82
|
-
columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T
|
|
73
|
+
columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;
|
|
83
74
|
/**
|
|
84
75
|
* Specifies the selection type (`'single' | 'multi'`).
|
|
85
76
|
*/
|
|
@@ -123,21 +114,15 @@ export interface TableProps<T = any, V = any> extends BaseComponentProps {
|
|
|
123
114
|
* * `allItemsSelectionLabel` ((SelectionState) => string) - Specifies the alternative text for multi-selection column header.
|
|
124
115
|
* * `selectionGroupLabel` (string) - Specifies the alternative text for the whole selection and single-selection column header.
|
|
125
116
|
* It is prefixed to `itemSelectionLabel` and `allItemsSelectionLabel` when they are set.
|
|
126
|
-
* * `tableLabel` (string) - Provides
|
|
117
|
+
* * `tableLabel` (string) - Provides a alternative text for the table. If you use a header for this table, you may reuse the string
|
|
127
118
|
* to provide a caption-like description. For example, tableLabel=Instances will be announced as 'Instances table'.
|
|
119
|
+
*
|
|
128
120
|
* You can use the first argument of type `SelectionState` to access the current selection
|
|
129
121
|
* state of the component (for example, the `selectedItems` list). The `itemSelectionLabel` for individual
|
|
130
122
|
* items also receives the corresponding `Item` object. You can use the `selectionGroupLabel` to
|
|
131
123
|
* add a meaningful description to the whole selection.
|
|
132
|
-
*
|
|
133
|
-
* * `activateEditLabel` (EditableColumnDefinition) => string -
|
|
134
|
-
* Specifies an alternative text for the edit button in editable cells.
|
|
135
|
-
* * `cancelEditLabel` (EditableColumnDefinition) => string -
|
|
136
|
-
* Specifies an alternative text for the cancel button in editable cells.
|
|
137
|
-
* * `submitEditLabel` (EditableColumnDefinition) => string -
|
|
138
|
-
* Specifies an alternative text for the submit button in editable cells.
|
|
139
124
|
*/
|
|
140
|
-
ariaLabels?: TableProps.AriaLabels<T
|
|
125
|
+
ariaLabels?: TableProps.AriaLabels<T>;
|
|
141
126
|
/**
|
|
142
127
|
* Specifies the definition object of the currently sorted column. Make sure you pass an object that's
|
|
143
128
|
* present in the `columnDefinitions` array.
|
|
@@ -227,70 +212,18 @@ export interface TableProps<T = any, V = any> extends BaseComponentProps {
|
|
|
227
212
|
* Requires the properties firstIndex and totalItemsCount to be set correctly.
|
|
228
213
|
*/
|
|
229
214
|
renderAriaLive?: (data: TableProps.LiveAnnouncement) => string;
|
|
230
|
-
/**
|
|
231
|
-
* Specifies a function that will be called after user submits an inline edit.
|
|
232
|
-
* Return a promise to keep loading state while the submit request is in progress.
|
|
233
|
-
*/
|
|
234
|
-
submitEdit?: TableProps.SubmitEditFunction<T, V>;
|
|
235
|
-
/**
|
|
236
|
-
* Called whenever user cancels an inline edit. Use this function to reset any
|
|
237
|
-
* validation states, or show warning for unsaved changes.
|
|
238
|
-
*/
|
|
239
|
-
onEditCancel?: CancelableEventHandler;
|
|
240
215
|
}
|
|
241
216
|
export declare namespace TableProps {
|
|
242
217
|
type TrackBy<T> = string | ((item: T) => string);
|
|
243
|
-
type
|
|
244
|
-
interface CellContext<V> {
|
|
245
|
-
isEditing?: boolean;
|
|
246
|
-
currentValue: Optional<V>;
|
|
247
|
-
setValue: (value: V | undefined) => void;
|
|
248
|
-
}
|
|
249
|
-
type CellRenderer<T> = (item: T) => React.ReactNode;
|
|
250
|
-
type EditableCellRenderer<T, V = any> = (item: T, context: CellContext<V>) => React.ReactNode;
|
|
251
|
-
interface EditConfig<T, V = any> {
|
|
252
|
-
/**
|
|
253
|
-
* Specifies a label for the edit control. Visually hidden but read
|
|
254
|
-
* by screen readers.
|
|
255
|
-
*/
|
|
256
|
-
ariaLabel?: string;
|
|
257
|
-
/**
|
|
258
|
-
* Specifies an ariaLabel for the error icon that is displayed when
|
|
259
|
-
* the validation fails.
|
|
260
|
-
*/
|
|
261
|
-
errorIconAriaLabel?: string;
|
|
262
|
-
/**
|
|
263
|
-
* Specifies an alternate text for the edit icon used in column header.
|
|
264
|
-
*/
|
|
265
|
-
editIconAriaLabel?: string;
|
|
266
|
-
/**
|
|
267
|
-
* Constraint text that is displayed below the edit control.
|
|
268
|
-
*/
|
|
269
|
-
constraintText?: string;
|
|
270
|
-
/**
|
|
271
|
-
* A function that allows you to validate the value of the edit control. Return
|
|
272
|
-
* a string from the function to display an error message. Return
|
|
273
|
-
* `undefined` (or no return) from the function to indicate that the value is valid.
|
|
274
|
-
* @param item - The item that is being edited.
|
|
275
|
-
* @param value - The current value of the edit control.
|
|
276
|
-
*/
|
|
277
|
-
validation?: (item: T, value: Optional<V>) => Optional<string>;
|
|
278
|
-
}
|
|
279
|
-
type ColumnEditConfig<ItemType, ValueType> = {
|
|
280
|
-
editConfig?: undefined;
|
|
281
|
-
cell: CellRenderer<ItemType>;
|
|
282
|
-
} | {
|
|
283
|
-
editConfig: EditConfig<ItemType, ValueType>;
|
|
284
|
-
cell: EditableCellRenderer<ItemType, ValueType>;
|
|
285
|
-
};
|
|
286
|
-
type ColumnDefinition<ItemType, ValueType = any> = {
|
|
218
|
+
type ColumnDefinition<T> = {
|
|
287
219
|
id?: string;
|
|
288
220
|
header: React.ReactNode;
|
|
221
|
+
cell(item: T): React.ReactNode;
|
|
289
222
|
ariaLabel?(data: LabelData): string;
|
|
290
223
|
width?: number | string;
|
|
291
224
|
minWidth?: number | string;
|
|
292
225
|
maxWidth?: number | string;
|
|
293
|
-
} & SortingColumn<
|
|
226
|
+
} & SortingColumn<T>;
|
|
294
227
|
type SelectionType = 'single' | 'multi';
|
|
295
228
|
type Variant = 'container' | 'embedded' | 'stacked' | 'full-page';
|
|
296
229
|
interface SelectionState<T> {
|
|
@@ -300,14 +233,11 @@ export declare namespace TableProps {
|
|
|
300
233
|
selectedItems: T[];
|
|
301
234
|
}
|
|
302
235
|
type IsItemDisabled<T> = (item: T) => boolean;
|
|
303
|
-
interface AriaLabels<T
|
|
236
|
+
interface AriaLabels<T> {
|
|
304
237
|
allItemsSelectionLabel?: (data: TableProps.SelectionState<T>) => string;
|
|
305
238
|
itemSelectionLabel?: (data: TableProps.SelectionState<T>, row: T) => string;
|
|
306
239
|
selectionGroupLabel?: string;
|
|
307
240
|
tableLabel?: string;
|
|
308
|
-
activateEditLabel?: (column: EditableColumnDefinition<T, V>) => string;
|
|
309
|
-
cancelEditLabel?: (column: EditableColumnDefinition<T, V>) => string;
|
|
310
|
-
submitEditLabel?: (column: EditableColumnDefinition<T, V>) => string;
|
|
311
241
|
}
|
|
312
242
|
interface SortingState<T> {
|
|
313
243
|
isDescending?: boolean;
|
|
@@ -346,11 +276,6 @@ export declare namespace TableProps {
|
|
|
346
276
|
* scroll parent scrolls to reveal the first row of the table.
|
|
347
277
|
*/
|
|
348
278
|
scrollToTop(): void;
|
|
349
|
-
/**
|
|
350
|
-
* Dismiss an inline edit if currently active.
|
|
351
|
-
*/
|
|
352
|
-
cancelEdit?(): void;
|
|
353
279
|
}
|
|
354
|
-
type SubmitEditFunction<ItemType, ValueType = any> = (item: ItemType, column: ColumnDefinition<ItemType, ValueType>, newValue: ValueType) => Promise<void> | void;
|
|
355
280
|
}
|
|
356
281
|
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/table/interfaces.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/table/interfaces.tsx"],"names":[],"mappings":"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"}
|
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';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler, CancelableEventHandler } from '../internal/events';\nimport { Optional } from '../internal/types';\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, V = any> extends BaseComponentProps {\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's also used to connect `items` and `selectedItems` values when they reference different objects.\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 `visibleColumns` 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.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 *\n */\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T, V>>;\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 * 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 * * `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 * 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 *\n * * `activateEditLabel` (EditableColumnDefinition) => 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 */\n ariaLabels?: TableProps.AriaLabels<T, V>;\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 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 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 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 * * `embedded` - Use this variant within a parent container (such as a modal, expandable\n * section, container or split panel).\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * * `full-page` – Use this variant when table is the primary element on the 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 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 * If the table has no pagination, leave this property undefined. */\n firstIndex?: number;\n /**\n * Use this function to announce page changes to screen reader users.\n * Requires the properties firstIndex and totalItemsCount to be set correctly.\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, V>;\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\nexport namespace TableProps {\n export type TrackBy<T> = string | ((item: T) => string);\n\n export type EditableColumnDefinition<T, V = any> = Extract<ColumnDefinition<T, V>, ColumnEditConfig<T, V>>;\n\n export interface CellContext<V> {\n isEditing?: boolean;\n currentValue: Optional<V>;\n setValue: (value: V | undefined) => void;\n }\n\n export type CellRenderer<T> = (item: T) => React.ReactNode;\n export type EditableCellRenderer<T, V = any> = (item: T, context: CellContext<V>) => React.ReactNode;\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 export type ColumnEditConfig<ItemType, ValueType> =\n | {\n editConfig?: undefined;\n cell: CellRenderer<ItemType>;\n }\n | {\n editConfig: EditConfig<ItemType, ValueType>;\n cell: EditableCellRenderer<ItemType, ValueType>;\n };\n\n export type ColumnDefinition<ItemType, ValueType = any> = {\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 } & SortingColumn<ItemType> &\n ColumnEditConfig<ItemType, ValueType>;\n\n export type SelectionType = 'single' | 'multi';\n export type Variant = 'container' | 'embedded' | '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, V = any> {\n allItemsSelectionLabel?: (data: TableProps.SelectionState<T>) => string;\n itemSelectionLabel?: (data: TableProps.SelectionState<T>, row: T) => string;\n selectionGroupLabel?: string;\n tableLabel?: string;\n activateEditLabel?: (column: EditableColumnDefinition<T, V>) => string;\n cancelEditLabel?: (column: EditableColumnDefinition<T, V>) => string;\n submitEditLabel?: (column: EditableColumnDefinition<T, V>) => 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 totalItemsCount?: number;\n firstIndex: number;\n lastIndex: 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 = any> = (\n item: ItemType,\n column: ColumnDefinition<ItemType, ValueType>,\n newValue: ValueType\n ) => Promise<void> | void;\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';\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler, CancelableEventHandler } from '../internal/events';\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}\nexport interface TableProps<T = any> extends BaseComponentProps {\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's also used to connect `items` and `selectedItems` values when they reference different objects.\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 `visibleColumns` 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\").\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 *\n */\n columnDefinitions: ReadonlyArray<TableProps.ColumnDefinition<T>>;\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 * 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 * * `tableLabel` (string) - Provides a 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 *\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 */\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 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 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 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 * * `embedded` - Use this variant within a parent container (such as a modal, expandable\n * section, container or split panel).\n * * `stacked` - Use this variant adjacent to other stacked containers (such as a container,\n * table).\n * * `full-page` – Use this variant when table is the primary element on the 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 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 * If the table has no pagination, leave this property undefined. */\n firstIndex?: number;\n /**\n * Use this function to announce page changes to screen reader users.\n * Requires the properties firstIndex and totalItemsCount to be set correctly.\n */\n renderAriaLive?: (data: TableProps.LiveAnnouncement) => string;\n}\n\nexport namespace TableProps {\n export type TrackBy<T> = string | ((item: T) => string);\n\n export type ColumnDefinition<T> = {\n id?: string;\n header: React.ReactNode;\n cell(item: T): React.ReactNode;\n ariaLabel?(data: LabelData): string;\n width?: number | string;\n minWidth?: number | string;\n maxWidth?: number | string;\n } & SortingColumn<T>;\n\n export type SelectionType = 'single' | 'multi';\n export type Variant = 'container' | 'embedded' | '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 }\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 totalItemsCount?: number;\n firstIndex: number;\n lastIndex: 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"]}
|
package/table/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/table/internal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/table/internal.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAc,MAAM,cAAc,CAAC;AAiC/D,QAAA,MAAM,aAAa,qBAsVK,CAAC;AAEzB,eAAe,aAAa,CAAC"}
|