@cloudscape-design/components 3.0.87 → 3.0.88
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/checkbox/internal.d.ts +0 -1
- package/checkbox/internal.d.ts.map +1 -1
- package/checkbox/internal.js +9 -11
- package/checkbox/internal.js.map +1 -1
- package/date-picker/index.js +1 -1
- package/date-picker/index.js.map +1 -1
- package/date-picker/styles.css.js +7 -6
- package/date-picker/styles.scoped.css +14 -7
- package/date-picker/styles.selectors.js +7 -6
- package/date-range-picker/dropdown.js +1 -1
- package/date-range-picker/dropdown.js.map +1 -1
- package/date-range-picker/styles.css.js +37 -36
- package/date-range-picker/styles.scoped.css +48 -44
- package/date-range-picker/styles.selectors.js +37 -36
- package/hotspot/index.d.ts.map +1 -1
- package/hotspot/index.js +2 -2
- package/hotspot/index.js.map +1 -1
- package/internal/components/abstract-switch/index.d.ts +2 -2
- package/internal/components/abstract-switch/index.d.ts.map +1 -1
- package/internal/components/abstract-switch/index.js +2 -9
- package/internal/components/abstract-switch/index.js.map +1 -1
- package/internal/components/abstract-switch/styles.css.js +12 -12
- package/internal/components/abstract-switch/styles.scoped.css +20 -19
- package/internal/components/abstract-switch/styles.selectors.js +12 -12
- package/internal/components/focus-lock/index.d.ts +2 -1
- package/internal/components/focus-lock/index.d.ts.map +1 -1
- package/internal/components/focus-lock/index.js +2 -2
- package/internal/components/focus-lock/index.js.map +1 -1
- package/internal/components/screenreader-only/index.js +1 -1
- package/internal/components/screenreader-only/index.js.map +1 -1
- package/internal/environment.js +1 -1
- package/package.json +1 -1
- package/property-filter/controller.d.ts +4 -7
- package/property-filter/controller.d.ts.map +1 -1
- package/property-filter/controller.js +3 -2
- package/property-filter/controller.js.map +1 -1
- package/property-filter/filter-options.d.ts +3 -0
- package/property-filter/filter-options.d.ts.map +1 -0
- package/property-filter/filter-options.js +31 -0
- package/property-filter/filter-options.js.map +1 -0
- package/property-filter/index.d.ts.map +1 -1
- package/property-filter/index.js +0 -5
- package/property-filter/index.js.map +1 -1
- package/property-filter/property-filter-autosuggest.d.ts.map +1 -1
- package/property-filter/property-filter-autosuggest.js +9 -7
- package/property-filter/property-filter-autosuggest.js.map +1 -1
- package/property-filter/styles.css.js +33 -32
- package/property-filter/styles.scoped.css +38 -34
- package/property-filter/styles.selectors.js +33 -32
- package/radio-group/radio-button.d.ts +3 -3
- package/radio-group/radio-button.d.ts.map +1 -1
- package/radio-group/radio-button.js +18 -6
- package/radio-group/radio-button.js.map +1 -1
- package/select/parts/trigger.d.ts.map +1 -1
- package/select/parts/trigger.js +8 -2
- package/select/parts/trigger.js.map +1 -1
- package/table/selection-control/index.js +1 -1
- package/table/selection-control/index.js.map +1 -1
- package/tiles/internal.d.ts.map +1 -1
- package/tiles/internal.js +2 -9
- package/tiles/internal.js.map +1 -1
- package/tiles/tile.d.ts +12 -0
- package/tiles/tile.d.ts.map +1 -0
- package/tiles/tile.js +27 -0
- package/tiles/tile.js.map +1 -0
- package/toggle/internal.d.ts.map +1 -1
- package/toggle/internal.js +7 -1
- package/toggle/internal.js.map +1 -1
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"root": "
|
|
5
|
-
"search-field": "awsui_search-
|
|
6
|
-
"input-wrapper": "awsui_input-
|
|
7
|
-
"add-token": "awsui_add-
|
|
8
|
-
"tokens": "
|
|
9
|
-
"token-operator": "awsui_token-
|
|
10
|
-
"property-editor": "awsui_property-
|
|
11
|
-
"token-editor": "awsui_token-
|
|
12
|
-
"property-editor-form": "awsui_property-editor-
|
|
13
|
-
"token-editor-form": "awsui_token-editor-
|
|
14
|
-
"property-editor-field-property": "awsui_property-editor-field-
|
|
15
|
-
"token-editor-field-property": "awsui_token-editor-field-
|
|
16
|
-
"property-editor-field-operator": "awsui_property-editor-field-
|
|
17
|
-
"token-editor-field-operator": "awsui_token-editor-field-
|
|
18
|
-
"property-editor-field-value": "awsui_property-editor-field-
|
|
19
|
-
"token-editor-field-value": "awsui_token-editor-field-
|
|
20
|
-
"property-editor-cancel": "awsui_property-editor-
|
|
21
|
-
"token-editor-cancel": "awsui_token-editor-
|
|
22
|
-
"property-editor-submit": "awsui_property-editor-
|
|
23
|
-
"token-editor-submit": "awsui_token-editor-
|
|
24
|
-
"property-editor-actions": "awsui_property-editor-
|
|
25
|
-
"token-editor-actions": "awsui_token-editor-
|
|
26
|
-
"custom-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"results
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
4
|
+
"root": "awsui_root_1wzqe_13cnv_93",
|
|
5
|
+
"search-field": "awsui_search-field_1wzqe_13cnv_104",
|
|
6
|
+
"input-wrapper": "awsui_input-wrapper_1wzqe_13cnv_110",
|
|
7
|
+
"add-token": "awsui_add-token_1wzqe_13cnv_114",
|
|
8
|
+
"tokens": "awsui_tokens_1wzqe_13cnv_121",
|
|
9
|
+
"token-operator": "awsui_token-operator_1wzqe_13cnv_125",
|
|
10
|
+
"property-editor": "awsui_property-editor_1wzqe_13cnv_129",
|
|
11
|
+
"token-editor": "awsui_token-editor_1wzqe_13cnv_130",
|
|
12
|
+
"property-editor-form": "awsui_property-editor-form_1wzqe_13cnv_134",
|
|
13
|
+
"token-editor-form": "awsui_token-editor-form_1wzqe_13cnv_135",
|
|
14
|
+
"property-editor-field-property": "awsui_property-editor-field-property_1wzqe_13cnv_138",
|
|
15
|
+
"token-editor-field-property": "awsui_token-editor-field-property_1wzqe_13cnv_139",
|
|
16
|
+
"property-editor-field-operator": "awsui_property-editor-field-operator_1wzqe_13cnv_142",
|
|
17
|
+
"token-editor-field-operator": "awsui_token-editor-field-operator_1wzqe_13cnv_143",
|
|
18
|
+
"property-editor-field-value": "awsui_property-editor-field-value_1wzqe_13cnv_146",
|
|
19
|
+
"token-editor-field-value": "awsui_token-editor-field-value_1wzqe_13cnv_147",
|
|
20
|
+
"property-editor-cancel": "awsui_property-editor-cancel_1wzqe_13cnv_150",
|
|
21
|
+
"token-editor-cancel": "awsui_token-editor-cancel_1wzqe_13cnv_151",
|
|
22
|
+
"property-editor-submit": "awsui_property-editor-submit_1wzqe_13cnv_154",
|
|
23
|
+
"token-editor-submit": "awsui_token-editor-submit_1wzqe_13cnv_155",
|
|
24
|
+
"property-editor-actions": "awsui_property-editor-actions_1wzqe_13cnv_158",
|
|
25
|
+
"token-editor-actions": "awsui_token-editor-actions_1wzqe_13cnv_159",
|
|
26
|
+
"custom-content-wrapper": "awsui_custom-content-wrapper_1wzqe_13cnv_177",
|
|
27
|
+
"custom-control": "awsui_custom-control_1wzqe_13cnv_181",
|
|
28
|
+
"input": "awsui_input_1wzqe_13cnv_110",
|
|
29
|
+
"results": "awsui_results_1wzqe_13cnv_189",
|
|
30
|
+
"results-visible": "awsui_results-visible_1wzqe_13cnv_195",
|
|
31
|
+
"separator": "awsui_separator_1wzqe_13cnv_199",
|
|
32
|
+
"toggle-collapsed": "awsui_toggle-collapsed_1wzqe_13cnv_206",
|
|
33
|
+
"token-trigger": "awsui_token-trigger_1wzqe_13cnv_211",
|
|
34
|
+
"remove-all": "awsui_remove-all_1wzqe_13cnv_217",
|
|
35
|
+
"token-label": "awsui_token-label_1wzqe_13cnv_218",
|
|
36
|
+
"join-operation": "awsui_join-operation_1wzqe_13cnv_219"
|
|
36
37
|
};
|
|
37
38
|
|
|
@@ -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
|
-
.
|
|
93
|
+
.awsui_root_1wzqe_13cnv_93:not(#\9) {
|
|
94
94
|
/* stylelint-disable-next-line plugin/no-unsupported-browser-features */
|
|
95
95
|
border-collapse: separate;
|
|
96
96
|
border-spacing: 0;
|
|
@@ -127,118 +127,122 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
127
127
|
font-family: var(--font-family-base-qnistn, "Open Sans", "Helvetica Neue", Roboto, Arial, sans-serif);
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
.awsui_search-
|
|
130
|
+
.awsui_search-field_1wzqe_13cnv_104:not(#\9) {
|
|
131
131
|
display: flex;
|
|
132
132
|
align-items: center;
|
|
133
133
|
max-width: calc(688px - 2 * var(--space-l-4vl6xu, 20px));
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
.awsui_input-
|
|
136
|
+
.awsui_input-wrapper_1wzqe_13cnv_110:not(#\9) {
|
|
137
137
|
flex-grow: 1;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
.awsui_add-
|
|
140
|
+
.awsui_add-token_1wzqe_13cnv_114:not(#\9) {
|
|
141
141
|
border-left: 1px solid var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
142
142
|
box-sizing: border-box;
|
|
143
143
|
margin-left: var(--space-m-17eucw, 16px);
|
|
144
144
|
padding-left: var(--space-m-17eucw, 16px);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
.
|
|
147
|
+
.awsui_tokens_1wzqe_13cnv_121:not(#\9) {
|
|
148
148
|
margin-top: var(--space-xs-rsr2qu, 8px);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
.awsui_token-
|
|
151
|
+
.awsui_token-operator_1wzqe_13cnv_125:not(#\9) {
|
|
152
152
|
font-weight: bold;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
.awsui_property-
|
|
156
|
-
.awsui_token-
|
|
155
|
+
.awsui_property-editor_1wzqe_13cnv_129:not(#\9),
|
|
156
|
+
.awsui_token-editor_1wzqe_13cnv_130:not(#\9) {
|
|
157
157
|
-webkit-user-select: text;
|
|
158
158
|
user-select: text;
|
|
159
159
|
margin: var(--space-xxs-ynfts5, 4px);
|
|
160
160
|
}
|
|
161
|
-
.awsui_property-editor-
|
|
162
|
-
.awsui_token-editor-
|
|
161
|
+
.awsui_property-editor-form_1wzqe_13cnv_134:not(#\9),
|
|
162
|
+
.awsui_token-editor-form_1wzqe_13cnv_135:not(#\9) {
|
|
163
163
|
margin-bottom: var(--space-scaled-l-t03y3z, 20px);
|
|
164
164
|
}
|
|
165
|
-
.awsui_property-editor-field-
|
|
166
|
-
.awsui_token-editor-field-
|
|
165
|
+
.awsui_property-editor-field-property_1wzqe_13cnv_138:not(#\9),
|
|
166
|
+
.awsui_token-editor-field-property_1wzqe_13cnv_139:not(#\9) {
|
|
167
167
|
/* used in test-utils */
|
|
168
168
|
}
|
|
169
|
-
.awsui_property-editor-field-
|
|
170
|
-
.awsui_token-editor-field-
|
|
169
|
+
.awsui_property-editor-field-operator_1wzqe_13cnv_142:not(#\9),
|
|
170
|
+
.awsui_token-editor-field-operator_1wzqe_13cnv_143:not(#\9) {
|
|
171
171
|
margin-top: var(--space-scaled-l-t03y3z, 20px);
|
|
172
172
|
}
|
|
173
|
-
.awsui_property-editor-field-
|
|
174
|
-
.awsui_token-editor-field-
|
|
173
|
+
.awsui_property-editor-field-value_1wzqe_13cnv_146:not(#\9),
|
|
174
|
+
.awsui_token-editor-field-value_1wzqe_13cnv_147:not(#\9) {
|
|
175
175
|
margin-top: var(--space-scaled-l-t03y3z, 20px);
|
|
176
176
|
}
|
|
177
|
-
.awsui_property-editor-
|
|
178
|
-
.awsui_token-editor-
|
|
177
|
+
.awsui_property-editor-cancel_1wzqe_13cnv_150:not(#\9),
|
|
178
|
+
.awsui_token-editor-cancel_1wzqe_13cnv_151:not(#\9) {
|
|
179
179
|
margin-right: var(--space-xs-rsr2qu, 8px);
|
|
180
180
|
}
|
|
181
|
-
.awsui_property-editor-
|
|
182
|
-
.awsui_token-editor-
|
|
181
|
+
.awsui_property-editor-submit_1wzqe_13cnv_154:not(#\9),
|
|
182
|
+
.awsui_token-editor-submit_1wzqe_13cnv_155:not(#\9) {
|
|
183
183
|
/* used in test-utils */
|
|
184
184
|
}
|
|
185
|
-
.awsui_property-editor-
|
|
186
|
-
.awsui_token-editor-
|
|
185
|
+
.awsui_property-editor-actions_1wzqe_13cnv_158:not(#\9),
|
|
186
|
+
.awsui_token-editor-actions_1wzqe_13cnv_159:not(#\9) {
|
|
187
187
|
display: flex;
|
|
188
188
|
justify-content: flex-end;
|
|
189
189
|
padding-top: var(--space-s-hv8c1d, 12px);
|
|
190
190
|
border-top: 1px solid var(--color-border-dropdown-item-default-faosd8, #e9ebed);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
.awsui_token-editor-
|
|
193
|
+
.awsui_token-editor-actions_1wzqe_13cnv_159:not(#\9) {
|
|
194
194
|
padding-right: calc(var(--space-m-17eucw, 16px) + var(--space-xxs-ynfts5, 4px));
|
|
195
195
|
margin-left: calc(-1 * var(--space-m-17eucw, 16px) + -1 * var(--space-xxs-ynfts5, 4px));
|
|
196
196
|
margin-right: calc(-1 * var(--space-m-17eucw, 16px) + -1 * var(--space-xxs-ynfts5, 4px));
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
.awsui_property-
|
|
199
|
+
.awsui_property-editor_1wzqe_13cnv_129:not(#\9) {
|
|
200
200
|
padding: var(--space-m-17eucw, 16px);
|
|
201
201
|
overflow-y: auto;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
.awsui_custom-
|
|
204
|
+
.awsui_custom-content-wrapper_1wzqe_13cnv_177:not(#\9) {
|
|
205
|
+
display: contents;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.awsui_custom-control_1wzqe_13cnv_181:not(#\9) {
|
|
205
209
|
margin-right: var(--space-s-hv8c1d, 12px);
|
|
206
210
|
}
|
|
207
211
|
|
|
208
|
-
.
|
|
212
|
+
.awsui_input_1wzqe_13cnv_110:not(#\9) {
|
|
209
213
|
flex: 1;
|
|
210
214
|
}
|
|
211
215
|
|
|
212
|
-
.
|
|
216
|
+
.awsui_results_1wzqe_13cnv_189:not(#\9) {
|
|
213
217
|
color: var(--color-text-form-label-k3j0b4, #000716);
|
|
214
218
|
display: inline-block;
|
|
215
219
|
box-sizing: border-box;
|
|
216
220
|
white-space: nowrap;
|
|
217
221
|
}
|
|
218
|
-
.awsui_results-
|
|
222
|
+
.awsui_results-visible_1wzqe_13cnv_195:not(#\9) {
|
|
219
223
|
padding-left: var(--space-s-hv8c1d, 12px);
|
|
220
224
|
}
|
|
221
225
|
|
|
222
|
-
.
|
|
226
|
+
.awsui_separator_1wzqe_13cnv_199:not(#\9) {
|
|
223
227
|
margin: 0px var(--space-scaled-m-pv0fmt, 16px);
|
|
224
228
|
height: 100%;
|
|
225
229
|
width: var(--border-divider-section-width-4wm2it, 2px);
|
|
226
230
|
background-color: var(--color-border-divider-default-7s2wjw, #e9ebed);
|
|
227
231
|
}
|
|
228
232
|
|
|
229
|
-
.awsui_toggle-
|
|
233
|
+
.awsui_toggle-collapsed_1wzqe_13cnv_206:not(#\9) {
|
|
230
234
|
margin-top: calc(-1 * var(--space-scaled-xxs-95dhkm, 4px));
|
|
231
235
|
margin-left: var(--space-xs-rsr2qu, 8px);
|
|
232
236
|
}
|
|
233
237
|
|
|
234
|
-
.awsui_token-
|
|
238
|
+
.awsui_token-trigger_1wzqe_13cnv_211:not(#\9) {
|
|
235
239
|
min-width: 0;
|
|
236
240
|
-ms-word-break: break-all;
|
|
237
241
|
word-break: break-word;
|
|
238
242
|
}
|
|
239
243
|
|
|
240
|
-
.awsui_remove-
|
|
241
|
-
.awsui_token-
|
|
242
|
-
.awsui_join-
|
|
244
|
+
.awsui_remove-all_1wzqe_13cnv_217:not(#\9),
|
|
245
|
+
.awsui_token-label_1wzqe_13cnv_218:not(#\9),
|
|
246
|
+
.awsui_join-operation_1wzqe_13cnv_219:not(#\9) {
|
|
243
247
|
/* used in test-utils */
|
|
244
248
|
}
|
|
@@ -2,37 +2,38 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"root": "
|
|
6
|
-
"search-field": "awsui_search-
|
|
7
|
-
"input-wrapper": "awsui_input-
|
|
8
|
-
"add-token": "awsui_add-
|
|
9
|
-
"tokens": "
|
|
10
|
-
"token-operator": "awsui_token-
|
|
11
|
-
"property-editor": "awsui_property-
|
|
12
|
-
"token-editor": "awsui_token-
|
|
13
|
-
"property-editor-form": "awsui_property-editor-
|
|
14
|
-
"token-editor-form": "awsui_token-editor-
|
|
15
|
-
"property-editor-field-property": "awsui_property-editor-field-
|
|
16
|
-
"token-editor-field-property": "awsui_token-editor-field-
|
|
17
|
-
"property-editor-field-operator": "awsui_property-editor-field-
|
|
18
|
-
"token-editor-field-operator": "awsui_token-editor-field-
|
|
19
|
-
"property-editor-field-value": "awsui_property-editor-field-
|
|
20
|
-
"token-editor-field-value": "awsui_token-editor-field-
|
|
21
|
-
"property-editor-cancel": "awsui_property-editor-
|
|
22
|
-
"token-editor-cancel": "awsui_token-editor-
|
|
23
|
-
"property-editor-submit": "awsui_property-editor-
|
|
24
|
-
"token-editor-submit": "awsui_token-editor-
|
|
25
|
-
"property-editor-actions": "awsui_property-editor-
|
|
26
|
-
"token-editor-actions": "awsui_token-editor-
|
|
27
|
-
"custom-
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"results
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
5
|
+
"root": "awsui_root_1wzqe_13cnv_93",
|
|
6
|
+
"search-field": "awsui_search-field_1wzqe_13cnv_104",
|
|
7
|
+
"input-wrapper": "awsui_input-wrapper_1wzqe_13cnv_110",
|
|
8
|
+
"add-token": "awsui_add-token_1wzqe_13cnv_114",
|
|
9
|
+
"tokens": "awsui_tokens_1wzqe_13cnv_121",
|
|
10
|
+
"token-operator": "awsui_token-operator_1wzqe_13cnv_125",
|
|
11
|
+
"property-editor": "awsui_property-editor_1wzqe_13cnv_129",
|
|
12
|
+
"token-editor": "awsui_token-editor_1wzqe_13cnv_130",
|
|
13
|
+
"property-editor-form": "awsui_property-editor-form_1wzqe_13cnv_134",
|
|
14
|
+
"token-editor-form": "awsui_token-editor-form_1wzqe_13cnv_135",
|
|
15
|
+
"property-editor-field-property": "awsui_property-editor-field-property_1wzqe_13cnv_138",
|
|
16
|
+
"token-editor-field-property": "awsui_token-editor-field-property_1wzqe_13cnv_139",
|
|
17
|
+
"property-editor-field-operator": "awsui_property-editor-field-operator_1wzqe_13cnv_142",
|
|
18
|
+
"token-editor-field-operator": "awsui_token-editor-field-operator_1wzqe_13cnv_143",
|
|
19
|
+
"property-editor-field-value": "awsui_property-editor-field-value_1wzqe_13cnv_146",
|
|
20
|
+
"token-editor-field-value": "awsui_token-editor-field-value_1wzqe_13cnv_147",
|
|
21
|
+
"property-editor-cancel": "awsui_property-editor-cancel_1wzqe_13cnv_150",
|
|
22
|
+
"token-editor-cancel": "awsui_token-editor-cancel_1wzqe_13cnv_151",
|
|
23
|
+
"property-editor-submit": "awsui_property-editor-submit_1wzqe_13cnv_154",
|
|
24
|
+
"token-editor-submit": "awsui_token-editor-submit_1wzqe_13cnv_155",
|
|
25
|
+
"property-editor-actions": "awsui_property-editor-actions_1wzqe_13cnv_158",
|
|
26
|
+
"token-editor-actions": "awsui_token-editor-actions_1wzqe_13cnv_159",
|
|
27
|
+
"custom-content-wrapper": "awsui_custom-content-wrapper_1wzqe_13cnv_177",
|
|
28
|
+
"custom-control": "awsui_custom-control_1wzqe_13cnv_181",
|
|
29
|
+
"input": "awsui_input_1wzqe_13cnv_110",
|
|
30
|
+
"results": "awsui_results_1wzqe_13cnv_189",
|
|
31
|
+
"results-visible": "awsui_results-visible_1wzqe_13cnv_195",
|
|
32
|
+
"separator": "awsui_separator_1wzqe_13cnv_199",
|
|
33
|
+
"toggle-collapsed": "awsui_toggle-collapsed_1wzqe_13cnv_206",
|
|
34
|
+
"token-trigger": "awsui_token-trigger_1wzqe_13cnv_211",
|
|
35
|
+
"remove-all": "awsui_remove-all_1wzqe_13cnv_217",
|
|
36
|
+
"token-label": "awsui_token-label_1wzqe_13cnv_218",
|
|
37
|
+
"join-operation": "awsui_join-operation_1wzqe_13cnv_219"
|
|
37
38
|
};
|
|
38
39
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { NonCancelableEventHandler } from '../internal/events';
|
|
2
3
|
import { RadioGroupProps } from './interfaces';
|
|
3
4
|
interface RadioButtonProps extends RadioGroupProps.RadioButtonDefinition {
|
|
4
5
|
name: string;
|
|
5
6
|
checked: boolean;
|
|
6
|
-
withoutLabel?: boolean;
|
|
7
7
|
onChange?: NonCancelableEventHandler<RadioGroupProps.ChangeDetail>;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
export
|
|
9
|
+
declare const _default: React.ForwardRefExoticComponent<RadioButtonProps & React.RefAttributes<HTMLInputElement>>;
|
|
10
|
+
export default _default;
|
|
11
11
|
//# sourceMappingURL=radio-button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button.d.ts","sourceRoot":"","sources":["../../../src/radio-group/radio-button.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radio-button.d.ts","sourceRoot":"","sources":["../../../src/radio-group/radio-button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAiB,MAAM,OAAO,CAAC;AAEtC,OAAO,EAA0B,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAGvF,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,UAAU,gBAAiB,SAAQ,eAAe,CAAC,qBAAqB;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,yBAAyB,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;CACpE;;AAED,wBA2DG"}
|
|
@@ -2,20 +2,32 @@ import { __assign } from "tslib";
|
|
|
2
2
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useRef } from 'react';
|
|
6
6
|
import AbstractSwitch from '../internal/components/abstract-switch';
|
|
7
7
|
import { fireNonCancelableEvent } from '../internal/events';
|
|
8
|
+
import { useMergeRefs } from '../internal/hooks/use-merge-refs';
|
|
8
9
|
import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
|
|
9
10
|
import styles from './styles.css.js';
|
|
10
|
-
export default function RadioButton(_a) {
|
|
11
|
+
export default React.forwardRef(function RadioButton(_a, ref) {
|
|
11
12
|
var _b, _c;
|
|
12
|
-
var name = _a.name, label = _a.label, value = _a.value, checked = _a.checked,
|
|
13
|
+
var name = _a.name, label = _a.label, value = _a.value, checked = _a.checked, description = _a.description, disabled = _a.disabled, controlId = _a.controlId, onChange = _a.onChange;
|
|
13
14
|
var isVisualRefresh = useVisualRefresh();
|
|
14
|
-
|
|
15
|
+
var radioButtonRef = useRef(null);
|
|
16
|
+
var mergedRefs = useMergeRefs(radioButtonRef, ref);
|
|
17
|
+
return (React.createElement(AbstractSwitch, { className: clsx(styles.radio, description && styles['radio--has-description']), controlClassName: styles['radio-control'], outlineClassName: styles.outline, label: label, description: description, disabled: disabled, controlId: controlId, nativeControl: function (nativeControlProps) { return (React.createElement("input", __assign({}, nativeControlProps, { type: "radio", ref: mergedRefs, name: name, value: value, checked: checked,
|
|
18
|
+
// empty handler to suppress React controllability warning
|
|
19
|
+
onChange: function () { } }))); }, onClick: function () {
|
|
20
|
+
var _a;
|
|
21
|
+
(_a = radioButtonRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
22
|
+
if (checked) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
fireNonCancelableEvent(onChange, { value: value });
|
|
26
|
+
}, styledControl: React.createElement("svg", { viewBox: "0 0 100 100", focusable: "false", "aria-hidden": "true" },
|
|
15
27
|
React.createElement("circle", { className: clsx(styles['styled-circle-border'], (_b = {}, _b[styles['styled-circle-disabled']] = disabled, _b)), strokeWidth: isVisualRefresh ? 12 : 8, cx: 50, cy: 50, r: isVisualRefresh ? 44 : 46 }),
|
|
16
28
|
React.createElement("circle", { className: clsx(styles['styled-circle-fill'], (_c = {},
|
|
17
29
|
_c[styles['styled-circle-disabled']] = disabled,
|
|
18
30
|
_c[styles['styled-circle-checked']] = checked,
|
|
19
|
-
_c)), strokeWidth: 30, cx: 50, cy: 50, r: 35 }))
|
|
20
|
-
}
|
|
31
|
+
_c)), strokeWidth: 30, cx: 50, cy: 50, r: 35 })) }));
|
|
32
|
+
});
|
|
21
33
|
//# sourceMappingURL=radio-button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-button.js","sourceRoot":"","sources":["../../../src/radio-group/radio-button.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"radio-button.js","sourceRoot":"","sources":["../../../src/radio-group/radio-button.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,cAAc,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAA6B,MAAM,oBAAoB,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAQrC,eAAe,KAAK,CAAC,UAAU,CAAC,SAAS,WAAW,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C,sBAAsB,CAAC,YAAI,GAAC,MAAM,CAAC,wBAAwB,CAAC,IAAG,QAAQ,MAAG,EACjG,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EACrC,EAAE,EAAE,EAAE,EACN,EAAE,EAAE,EAAE,EACN,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAC5B;YACF,gCACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC;oBAC1C,GAAC,MAAM,CAAC,wBAAwB,CAAC,IAAG,QAAQ;oBAC5C,GAAC,MAAM,CAAC,uBAAuB,CAAC,IAAG,OAAO;wBAC1C,EACF,WAAW,EAAE,EAAE,EACf,EAAE,EAAE,EAAE,EACN,EAAE,EAAE,EAAE,EACN,CAAC,EAAE,EAAE,GACL,CACE,GAER,CACH,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\nimport AbstractSwitch from '../internal/components/abstract-switch';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../internal/events';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { useVisualRefresh } from '../internal/hooks/use-visual-mode';\nimport { RadioGroupProps } from './interfaces';\nimport styles from './styles.css.js';\n\ninterface RadioButtonProps extends RadioGroupProps.RadioButtonDefinition {\n name: string;\n checked: boolean;\n onChange?: NonCancelableEventHandler<RadioGroupProps.ChangeDetail>;\n}\n\nexport default React.forwardRef(function RadioButton(\n { name, label, value, checked, description, disabled, controlId, onChange }: RadioButtonProps,\n ref: React.Ref<HTMLInputElement>\n) {\n const isVisualRefresh = useVisualRefresh();\n const radioButtonRef = useRef<HTMLInputElement>(null);\n const mergedRefs = useMergeRefs(radioButtonRef, ref);\n\n return (\n <AbstractSwitch\n className={clsx(styles.radio, description && styles['radio--has-description'])}\n controlClassName={styles['radio-control']}\n outlineClassName={styles.outline}\n label={label}\n description={description}\n disabled={disabled}\n controlId={controlId}\n nativeControl={nativeControlProps => (\n <input\n {...nativeControlProps}\n type=\"radio\"\n ref={mergedRefs}\n name={name}\n value={value}\n checked={checked}\n // empty handler to suppress React controllability warning\n onChange={() => {}}\n />\n )}\n onClick={() => {\n radioButtonRef.current?.focus();\n if (checked) {\n return;\n }\n fireNonCancelableEvent(onChange, { value });\n }}\n styledControl={\n <svg viewBox=\"0 0 100 100\" focusable=\"false\" aria-hidden=\"true\">\n <circle\n className={clsx(styles['styled-circle-border'], { [styles['styled-circle-disabled']]: disabled })}\n strokeWidth={isVisualRefresh ? 12 : 8}\n cx={50}\n cy={50}\n r={isVisualRefresh ? 44 : 46}\n />\n <circle\n className={clsx(styles['styled-circle-fill'], {\n [styles['styled-circle-disabled']]: disabled,\n [styles['styled-circle-checked']]: checked,\n })}\n strokeWidth={30}\n cx={50}\n cy={50}\n r={35}\n />\n </svg>\n }\n />\n );\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/trigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAG5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../../src/select/parts/trigger.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAG5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,WAAW,YAAa,SAAQ,+BAA+B;IACnE,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,YAAY,EAAE,kBAAkB,CAAC;IACjC,cAAc,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC;IAC5C,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,QAAA,MAAM,OAAO,wFAiEZ,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
package/select/parts/trigger.js
CHANGED
|
@@ -7,7 +7,8 @@ import clsx from 'clsx';
|
|
|
7
7
|
import ButtonTrigger from '../../internal/components/button-trigger';
|
|
8
8
|
import styles from './styles.css.js';
|
|
9
9
|
import Option from '../../internal/components/option';
|
|
10
|
-
import { generateUniqueId } from '../../internal/hooks/use-unique-id';
|
|
10
|
+
import { generateUniqueId, useUniqueId } from '../../internal/hooks/use-unique-id';
|
|
11
|
+
import ScreenreaderOnly from '../../internal/components/screenreader-only';
|
|
11
12
|
var Trigger = React.forwardRef(function (_a, ref) {
|
|
12
13
|
var ariaLabelledby = _a.ariaLabelledby, ariaDescribedby = _a.ariaDescribedby, controlId = _a.controlId, invalid = _a.invalid, triggerProps = _a.triggerProps, selectedOption = _a.selectedOption, triggerVariant = _a.triggerVariant, inFilteringToken = _a.inFilteringToken, isOpen = _a.isOpen, placeholder = _a.placeholder, disabled = _a.disabled, ariaLabel = _a.ariaLabel;
|
|
13
14
|
var id = useMemo(function () { return controlId !== null && controlId !== void 0 ? controlId : generateUniqueId(); }, [controlId]);
|
|
@@ -22,7 +23,12 @@ var Trigger = React.forwardRef(function (_a, ref) {
|
|
|
22
23
|
triggerContent = (React.createElement("span", { id: triggerProps.ariaLabelledby, className: styles.trigger }, selectedOption.label || selectedOption.value));
|
|
23
24
|
}
|
|
24
25
|
var mergedRef = useMergeRefs(triggerProps.ref, ref);
|
|
25
|
-
|
|
26
|
+
var calendarDescriptionId = useUniqueId('select-arialabel-');
|
|
27
|
+
return (React.createElement(ButtonTrigger, __assign({}, triggerProps, { id: id, ref: mergedRef, pressed: isOpen, disabled: disabled, invalid: invalid, inFilteringToken: inFilteringToken, ariaDescribedby: ariaDescribedby, ariaLabelledby: [ariaLabelledby, calendarDescriptionId, triggerProps.ariaLabelledby]
|
|
28
|
+
.filter(function (label) { return !!label; })
|
|
29
|
+
.join(' ') }),
|
|
30
|
+
triggerContent,
|
|
31
|
+
React.createElement(ScreenreaderOnly, { id: calendarDescriptionId }, ariaLabel)));
|
|
26
32
|
});
|
|
27
33
|
export default Trigger;
|
|
28
34
|
//# sourceMappingURL=trigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../../src/select/parts/trigger.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,aAAa,MAAM,0CAA0C,CAAC;AAErE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAGrC,OAAO,MAAM,MAAM,kCAAkC,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"trigger.js","sourceRoot":"","sources":["../../../../src/select/parts/trigger.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,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C3G,CAAC;KACH;SAAM;QACL,cAAc,GAAG,CACf,8BAAM,EAAE,EAAE,YAAY,CAAC,cAAc,EAAE,SAAS,EAAE,MAAM,CAAC,OAAO,IAC7D,cAAc,CAAC,KAAK,IAAI,cAAc,CAAC,KAAK,CACxC,CACR,CAAC;KACH;IAED,IAAM,SAAS,GAAG,YAAY,CAAC,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtD,IAAM,qBAAqB,GAAG,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAE/D,OAAO,CACL,oBAAC,aAAa,eACR,YAAY,IAChB,EAAE,EAAE,EAAE,EACN,GAAG,EAAE,SAAS,EACd,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,eAAe,EAChC,cAAc,EAAE,CAAC,cAAc,EAAE,qBAAqB,EAAE,YAAY,CAAC,cAAc,CAAC;aACjF,MAAM,CAAC,UAAA,KAAK,IAAI,OAAA,CAAC,CAAC,KAAK,EAAP,CAAO,CAAC;aACxB,IAAI,CAAC,GAAG,CAAC;QAEX,cAAc;QACf,oBAAC,gBAAgB,IAAC,EAAE,EAAE,qBAAqB,IAAG,SAAS,CAAoB,CAC7D,CACjB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useMemo } from 'react';\nimport { useMergeRefs } from '../../internal/hooks/use-merge-refs';\nimport clsx from 'clsx';\nimport ButtonTrigger from '../../internal/components/button-trigger';\nimport { SelectProps } from '../interfaces';\nimport styles from './styles.css.js';\nimport { OptionDefinition } from '../../internal/components/option/interfaces';\nimport { FormFieldValidationControlProps } from '../../internal/context/form-field-context';\nimport Option from '../../internal/components/option';\nimport { generateUniqueId, useUniqueId } from '../../internal/hooks/use-unique-id';\nimport { SelectTriggerProps } from '../utils/use-select';\nimport ScreenreaderOnly from '../../internal/components/screenreader-only';\n\nexport interface TriggerProps extends FormFieldValidationControlProps {\n placeholder: string | undefined;\n disabled: boolean | undefined;\n ariaLabel: string | undefined;\n triggerProps: SelectTriggerProps;\n selectedOption: OptionDefinition | null;\n isOpen?: boolean;\n triggerVariant?: SelectProps.TriggerVariant;\n inFilteringToken?: boolean;\n}\n\nconst Trigger = React.forwardRef(\n (\n {\n ariaLabelledby,\n ariaDescribedby,\n controlId,\n invalid,\n triggerProps,\n selectedOption,\n triggerVariant,\n inFilteringToken,\n isOpen,\n placeholder,\n disabled,\n ariaLabel,\n }: TriggerProps,\n ref: React.Ref<HTMLButtonElement>\n ) => {\n const id = useMemo(() => controlId ?? generateUniqueId(), [controlId]);\n\n let triggerContent = null;\n if (!selectedOption) {\n triggerContent = (\n <span\n aria-disabled=\"true\"\n className={clsx(styles.placeholder, styles.trigger)}\n id={triggerProps.ariaLabelledby}\n >\n {placeholder}\n </span>\n );\n } else if (triggerVariant === 'option') {\n triggerContent = (\n <Option id={triggerProps.ariaLabelledby} option={{ ...selectedOption, disabled }} triggerVariant={true} />\n );\n } else {\n triggerContent = (\n <span id={triggerProps.ariaLabelledby} className={styles.trigger}>\n {selectedOption.label || selectedOption.value}\n </span>\n );\n }\n\n const mergedRef = useMergeRefs(triggerProps.ref, ref);\n const calendarDescriptionId = useUniqueId('select-arialabel-');\n\n return (\n <ButtonTrigger\n {...triggerProps}\n id={id}\n ref={mergedRef}\n pressed={isOpen}\n disabled={disabled}\n invalid={invalid}\n inFilteringToken={inFilteringToken}\n ariaDescribedby={ariaDescribedby}\n ariaLabelledby={[ariaLabelledby, calendarDescriptionId, triggerProps.ariaLabelledby]\n .filter(label => !!label)\n .join(' ')}\n >\n {triggerContent}\n <ScreenreaderOnly id={calendarDescriptionId}>{ariaLabel}</ScreenreaderOnly>\n </ButtonTrigger>\n );\n }\n);\n\nexport default Trigger;\n"]}
|
|
@@ -46,7 +46,7 @@ export default function SelectionControl(_a) {
|
|
|
46
46
|
// Clicking on input, does not focus it on Firefox (AWSUI-11345)
|
|
47
47
|
nativeInput === null || nativeInput === void 0 ? void 0 : nativeInput.focus();
|
|
48
48
|
};
|
|
49
|
-
var selector = isMultiSelection ? (React.createElement(InternalCheckbox, __assign({}, sharedProps, { controlId: controlId,
|
|
49
|
+
var selector = isMultiSelection ? (React.createElement(InternalCheckbox, __assign({}, sharedProps, { controlId: controlId, indeterminate: indeterminate }))) : (React.createElement(RadioButton, __assign({}, sharedProps, { controlId: controlId, name: name, value: '', label: '' })));
|
|
50
50
|
return (React.createElement(React.Fragment, null,
|
|
51
51
|
React.createElement("label", { onKeyDown: handleKeyDown, onKeyUp: setShiftState, onMouseDown: onMouseDownHandler, onMouseUp: setShiftState, onClick: handleClick, htmlFor: controlId, className: clsx(styles.label, styles.root), "aria-label": ariaLabel }, selector),
|
|
52
52
|
React.createElement("span", { className: clsx(styles.stud), "aria-hidden": true }, "\u00A0")));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table/selection-control/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAA0D,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,WAAW,MAAM,gCAAgC,CAAC;AAGzD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAgBrC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EASjB;IARtB,IAAA,aAAa,mBAAA,EACb,qBAAqB,EAArB,aAAa,mBAAG,KAAK,KAAA,EACrB,aAAa,mBAAA,EACb,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,IAA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AW,CAAE,KAAK,EAAE,CAAC;IACvB,CAAC,CAAC;IAEF,IAAM,QAAQ,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAClC,oBAAC,gBAAgB,eAAK,WAAW,IAAE,SAAS,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/table/selection-control/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAA0D,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,gBAAgB,MAAM,yBAAyB,CAAC;AACvD,OAAO,WAAW,MAAM,gCAAgC,CAAC;AAGzD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAgBrC,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EASjB;IARtB,IAAA,aAAa,mBAAA,EACb,qBAAqB,EAArB,aAAa,mBAAG,KAAK,KAAA,EACrB,aAAa,mBAAA,EACb,SAAS,eAAA,EACT,WAAW,iBAAA,EACX,IAAI,UAAA,EACJ,SAAS,eAAA,EACN,WAAW,cARyB,oGASxC,CADe;IAEd,IAAM,SAAS,GAAG,WAAW,EAAE,CAAC;IAChC,IAAM,gBAAgB,GAAG,aAAa,KAAK,OAAO,CAAC;IAEnD,IAAM,aAAa,GAAG,UAAC,KAAiC;QACtD,IAAI,gBAAgB,EAAE;YACpB,aAAa,IAAI,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SAChD;IACH,CAAC,CAAC;IAEF,IAAM,kBAAkB,GAAG,UAAC,KAAiB;QAC3C,aAAa,CAAC,KAAK,CAAC,CAAC;QACrB,IAAI,gBAAgB,EAAE;YACpB,uBAAuB;YACvB,uFAAuF;YACvF,sDAAsD;YACtD,KAAK,CAAC,cAAc,EAAE,CAAC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xB,OAAO,EAAE,WAAW,EACpB,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,gBAC9B,SAAS,IAEpB,QAAQ,CACH;QAER,8BAAM,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAe,IAAI,aAE9C,CACN,CACJ,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { KeyboardEvent, KeyboardEventHandler, MouseEvent } from 'react';\nimport { KeyCode } from '../../internal/keycode';\nimport { useUniqueId } from '../../internal/hooks/use-unique-id';\nimport InternalCheckbox from '../../checkbox/internal';\nimport RadioButton from '../../radio-group/radio-button';\n\nimport { TableProps } from '../interfaces';\nimport styles from './styles.css.js';\n\nexport interface SelectionControlProps {\n selectionType: TableProps['selectionType'];\n checked: boolean;\n disabled: boolean;\n name: string;\n indeterminate?: boolean;\n onChange?: () => void;\n onShiftToggle?(shiftPressed: boolean): void;\n onFocusUp?: KeyboardEventHandler;\n onFocusDown?: KeyboardEventHandler;\n ariaLabel?: string;\n tabIndex?: -1;\n}\n\nexport default function SelectionControl({\n selectionType,\n indeterminate = false,\n onShiftToggle,\n onFocusUp,\n onFocusDown,\n name,\n ariaLabel,\n ...sharedProps\n}: SelectionControlProps) {\n const controlId = useUniqueId();\n const isMultiSelection = selectionType === 'multi';\n\n const setShiftState = (event: KeyboardEvent | MouseEvent) => {\n if (isMultiSelection) {\n onShiftToggle && onShiftToggle(event.shiftKey);\n }\n };\n\n const onMouseDownHandler = (event: MouseEvent) => {\n setShiftState(event);\n if (isMultiSelection) {\n // To overcome an issue\n // If you shift+click or ctrl+click on a label for a checkbox, checkbox is not checked.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=559506\n event.preventDefault();\n }\n };\n\n // native checkboxes do not have focus move via keyboard, we implement it here programmatically\n const handleKeyDown = (event: KeyboardEvent) => {\n setShiftState(event);\n if (isMultiSelection) {\n if (event.keyCode === KeyCode.up) {\n event.preventDefault();\n onFocusUp && onFocusUp(event);\n }\n if (event.keyCode === KeyCode.down) {\n event.preventDefault();\n onFocusDown && onFocusDown(event);\n }\n }\n };\n\n const handleClick = (event: MouseEvent) => {\n const target = event.currentTarget;\n const nativeInput = (target.tagName === 'INPUT' ? target : target.querySelector('input')) as HTMLInputElement;\n // Clicking on input, does not focus it on Firefox (AWSUI-11345)\n nativeInput?.focus();\n };\n\n const selector = isMultiSelection ? (\n <InternalCheckbox {...sharedProps} controlId={controlId} indeterminate={indeterminate} />\n ) : (\n <RadioButton {...sharedProps} controlId={controlId} name={name} value={''} label={''} />\n );\n\n return (\n <>\n <label\n onKeyDown={handleKeyDown}\n onKeyUp={setShiftState}\n onMouseDown={onMouseDownHandler}\n onMouseUp={setShiftState}\n onClick={handleClick}\n htmlFor={controlId}\n className={clsx(styles.label, styles.root)}\n aria-label={ariaLabel}\n >\n {selector}\n </label>\n {/* HACK: IE11 collapses td's height to 0, if it contains only an absouletely positioned label */}\n <span className={clsx(styles.stud)} aria-hidden={true}>\n \n </span>\n </>\n );\n}\n"]}
|
package/tiles/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/tiles/internal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/tiles/internal.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAMlF,aAAK,kBAAkB,GAAG,UAAU,GAAG,0BAA0B,CAAC;AAElE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,KAAK,EACL,KAAK,EACL,SAAS,EACT,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,iBAAwB,EACxB,GAAG,IAAI,EACR,EAAE,kBAAkB,eAiDpB"}
|
package/tiles/internal.js
CHANGED
|
@@ -4,12 +4,12 @@ import { __assign, __rest } from "tslib";
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { getBaseProps } from '../internal/base-component';
|
|
7
|
-
import RadioButton from '../radio-group/radio-button';
|
|
8
7
|
import styles from './styles.css.js';
|
|
9
8
|
import { useFormFieldContext } from '../internal/context/form-field-context';
|
|
10
9
|
import { useUniqueId } from '../internal/hooks/use-unique-id';
|
|
11
10
|
import { useContainerBreakpoints } from '../internal/hooks/container-queries';
|
|
12
11
|
import { useMergeRefs } from '../internal/hooks/use-merge-refs';
|
|
12
|
+
import { Tile } from './tile';
|
|
13
13
|
var COLUMN_TRIGGERS = ['default', 'xxs', 'xs'];
|
|
14
14
|
export default function InternalTiles(_a) {
|
|
15
15
|
var value = _a.value, items = _a.items, ariaLabel = _a.ariaLabel, ariaRequired = _a.ariaRequired, columns = _a.columns, onChange = _a.onChange, _b = _a.__internalRootRef, __internalRootRef = _b === void 0 ? null : _b, rest = __rest(_a, ["value", "items", "ariaLabel", "ariaRequired", "columns", "onChange", "__internalRootRef"]);
|
|
@@ -35,13 +35,6 @@ export default function InternalTiles(_a) {
|
|
|
35
35
|
var mergedRef = useMergeRefs(ref, __internalRootRef);
|
|
36
36
|
return (React.createElement("div", __assign({ role: "radiogroup", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby, "aria-required": ariaRequired }, baseProps, { className: clsx(baseProps.className, styles.root), ref: mergedRef }),
|
|
37
37
|
React.createElement("div", { className: clsx(styles.columns, styles["column-".concat(nColumns)]) }, items &&
|
|
38
|
-
items.map(function (item) {
|
|
39
|
-
var _a, _b, _c, _d, _e;
|
|
40
|
-
var controlId = item.controlId || "".concat(generatedName, "-value-").concat(item.value);
|
|
41
|
-
return (React.createElement("label", { className: clsx(styles['tile-container'], (_a = {}, _a[styles['has-metadata']] = item.description || item.image, _a), (_b = {}, _b[styles.selected] = item.value === value, _b), (_c = {}, _c[styles.disabled] = !!item.disabled, _c), styles["breakpoint-".concat(breakpoint)]), key: item.value, "data-value": item.value, htmlFor: controlId, id: "".concat(controlId, "-wrapper") },
|
|
42
|
-
React.createElement("div", { className: clsx(styles.control, (_d = {}, _d[styles['no-image']] = !item.image, _d)) },
|
|
43
|
-
React.createElement(RadioButton, { checked: item.value === value, name: generatedName, withoutLabel: true, value: item.value, label: item.label, description: item.description, disabled: item.disabled, onChange: onChange, controlId: controlId })),
|
|
44
|
-
item.image && (React.createElement("div", { className: clsx(styles.image, (_e = {}, _e[styles.disabled] = !!item.disabled, _e)) }, item.image))));
|
|
45
|
-
}))));
|
|
38
|
+
items.map(function (item) { return (React.createElement(Tile, { key: item.value, item: item, selected: item.value === value, name: generatedName, breakpoint: breakpoint, onChange: onChange })); }))));
|
|
46
39
|
}
|
|
47
40
|
//# sourceMappingURL=internal.js.map
|
package/tiles/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/tiles/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/tiles/internal.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,MAAM,MAAM,iB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IACxB,IAAA,KAAoB,uBAAuB,CAAC,eAAe,CAAC,EAA3D,UAAU,QAAA,EAAE,GAAG,QAA4C,CAAC;IACnE,IAAM,SAAS,GAAG,YAAY,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAEvD,OAAO,CACL,sCACE,IAAI,EAAC,YAAY,gBACL,SAAS,qBACJ,cAAc,sBACb,eAAe,mBAClB,YAAY,IACvB,SAAS,IACb,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,EACjD,GAAG,EAAE,SAAS;QAEd,6BAAK,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,iBAAU,QAAQ,CAAE,CAAC,CAAC,IAC/D,KAAK;YACJ,KAAK,CAAC,GAAG,CAAC,UAAA,IAAI,IAAI,OAAA,CAChB,oBAAC,IAAI,IACH,GAAG,EAAE,IAAI,CAAC,KAAK,EACf,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,IAAI,CAAC,KAAK,KAAK,KAAK,EAC9B,IAAI,EAAE,aAAa,EACnB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,QAAQ,GAClB,CACH,EATiB,CASjB,CAAC,CACA,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React from 'react';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { TilesProps } from './interfaces';\nimport styles from './styles.css.js';\n\nimport { useFormFieldContext } from '../internal/context/form-field-context';\nimport { useUniqueId } from '../internal/hooks/use-unique-id';\nimport { useContainerBreakpoints } from '../internal/hooks/container-queries';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useMergeRefs } from '../internal/hooks/use-merge-refs';\nimport { Tile } from './tile';\n\nconst COLUMN_TRIGGERS: TilesProps.Breakpoint[] = ['default', 'xxs', 'xs'];\n\ntype InternalTilesProps = TilesProps & InternalBaseComponentProps;\n\nexport default function InternalTiles({\n value,\n items,\n ariaLabel,\n ariaRequired,\n columns,\n onChange,\n __internalRootRef = null,\n ...rest\n}: InternalTilesProps) {\n const getColumns = () => {\n if (columns) {\n return columns;\n }\n\n const nItems = items ? items.length : 0;\n const columnsLookup: Record<number, number> = {\n 0: 1,\n 1: 1,\n 2: 2,\n 4: 2,\n 8: 2,\n };\n return columnsLookup[nItems] || 3;\n };\n const { ariaDescribedby, ariaLabelledby } = useFormFieldContext(rest);\n const baseProps = getBaseProps(rest);\n const generatedName = useUniqueId('awsui-tiles-');\n const nColumns = getColumns();\n const [breakpoint, ref] = useContainerBreakpoints(COLUMN_TRIGGERS);\n const mergedRef = useMergeRefs(ref, __internalRootRef);\n\n return (\n <div\n role=\"radiogroup\"\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n aria-required={ariaRequired}\n {...baseProps}\n className={clsx(baseProps.className, styles.root)}\n ref={mergedRef}\n >\n <div className={clsx(styles.columns, styles[`column-${nColumns}`])}>\n {items &&\n items.map(item => (\n <Tile\n key={item.value}\n item={item}\n selected={item.value === value}\n name={generatedName}\n breakpoint={breakpoint}\n onChange={onChange}\n />\n ))}\n </div>\n </div>\n );\n}\n"]}
|
package/tiles/tile.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TilesProps } from './interfaces';
|
|
2
|
+
import { useContainerBreakpoints } from '../internal/hooks/container-queries';
|
|
3
|
+
interface TileProps {
|
|
4
|
+
item: TilesProps.TilesDefinition;
|
|
5
|
+
selected: boolean;
|
|
6
|
+
name: string;
|
|
7
|
+
breakpoint: ReturnType<typeof useContainerBreakpoints>[0];
|
|
8
|
+
onChange: TilesProps['onChange'];
|
|
9
|
+
}
|
|
10
|
+
export declare function Tile({ item, selected, name, breakpoint, onChange }: TileProps): JSX.Element;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=tile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile.d.ts","sourceRoot":"","sources":["../../../src/tiles/tile.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAG9E,UAAU,SAAS;IACjB,IAAI,EAAE,UAAU,CAAC,eAAe,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CAClC;AAED,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,SAAS,eAuC7E"}
|