@cloudscape-design/components-themeable 3.0.1142 → 3.0.1144
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/status-indicator/styles.scss +1 -0
- package/lib/internal/scss/tree-view/tree-item/styles.scss +2 -3
- package/lib/internal/scss/tree-view/vertical-connector/styles.scss +29 -0
- package/lib/internal/template/collection-preferences/visible-content.d.ts.map +1 -1
- package/lib/internal/template/collection-preferences/visible-content.js +1 -1
- package/lib/internal/template/collection-preferences/visible-content.js.map +1 -1
- package/lib/internal/template/icon/generated/icons.d.ts +1 -0
- package/lib/internal/template/icon/generated/icons.d.ts.map +1 -1
- package/lib/internal/template/icon/generated/icons.js +2 -0
- package/lib/internal/template/icon/generated/icons.js.map +1 -1
- package/lib/internal/template/icon/interfaces.d.ts +1 -1
- package/lib/internal/template/icon/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon/interfaces.js.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.d.ts +1 -0
- package/lib/internal/template/icon-provider/interfaces.d.ts.map +1 -1
- package/lib/internal/template/icon-provider/interfaces.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +13 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +2 -0
- package/lib/internal/template/internal/generated/styles/tokens.js +2 -0
- package/lib/internal/template/internal/generated/theming/index.cjs +45 -0
- package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +9 -0
- package/lib/internal/template/internal/generated/theming/index.d.ts +9 -0
- package/lib/internal/template/internal/generated/theming/index.js +45 -0
- package/lib/internal/template/internal/hooks/use-mobile/index.d.ts.map +1 -1
- package/lib/internal/template/internal/hooks/use-mobile/index.js +3 -1
- package/lib/internal/template/internal/hooks/use-mobile/index.js.map +1 -1
- package/lib/internal/template/internal/plugins/api.d.ts.map +1 -1
- package/lib/internal/template/internal/plugins/api.js +1 -3
- package/lib/internal/template/internal/plugins/api.js.map +1 -1
- package/lib/internal/template/internal/utils/check-safe-url.d.ts.map +1 -1
- package/lib/internal/template/internal/utils/check-safe-url.js +1 -3
- package/lib/internal/template/internal/utils/check-safe-url.js.map +1 -1
- package/lib/internal/template/mixed-line-bar-chart/make-scaled-series.js +2 -10
- package/lib/internal/template/mixed-line-bar-chart/make-scaled-series.js.map +1 -1
- package/lib/internal/template/status-indicator/interfaces.d.ts +1 -1
- package/lib/internal/template/status-indicator/interfaces.d.ts.map +1 -1
- package/lib/internal/template/status-indicator/interfaces.js.map +1 -1
- package/lib/internal/template/status-indicator/internal.d.ts.map +1 -1
- package/lib/internal/template/status-indicator/internal.js +1 -0
- package/lib/internal/template/status-indicator/internal.js.map +1 -1
- package/lib/internal/template/status-indicator/styles.css.js +24 -23
- package/lib/internal/template/status-indicator/styles.scoped.css +32 -29
- package/lib/internal/template/status-indicator/styles.selectors.js +24 -23
- package/lib/internal/template/steps/internal.d.ts.map +1 -1
- package/lib/internal/template/steps/internal.js +1 -0
- package/lib/internal/template/steps/internal.js.map +1 -1
- package/lib/internal/template/table/body-cell/inline-editor.d.ts.map +1 -1
- package/lib/internal/template/table/body-cell/inline-editor.js +1 -3
- package/lib/internal/template/table/body-cell/inline-editor.js.map +1 -1
- package/lib/internal/template/tree-view/index.d.ts +1 -1
- package/lib/internal/template/tree-view/index.d.ts.map +1 -1
- package/lib/internal/template/tree-view/index.js +5 -3
- package/lib/internal/template/tree-view/index.js.map +1 -1
- package/lib/internal/template/tree-view/interfaces.d.ts +5 -0
- package/lib/internal/template/tree-view/interfaces.d.ts.map +1 -1
- package/lib/internal/template/tree-view/interfaces.js.map +1 -1
- package/lib/internal/template/tree-view/internal.d.ts +1 -1
- package/lib/internal/template/tree-view/internal.d.ts.map +1 -1
- package/lib/internal/template/tree-view/internal.js +2 -2
- package/lib/internal/template/tree-view/internal.js.map +1 -1
- package/lib/internal/template/tree-view/tree-item/index.d.ts +2 -2
- package/lib/internal/template/tree-view/tree-item/index.d.ts.map +1 -1
- package/lib/internal/template/tree-view/tree-item/index.js +10 -5
- package/lib/internal/template/tree-view/tree-item/index.js.map +1 -1
- package/lib/internal/template/tree-view/tree-item/styles.css.js +9 -9
- package/lib/internal/template/tree-view/tree-item/styles.scoped.css +14 -15
- package/lib/internal/template/tree-view/tree-item/styles.selectors.js +9 -9
- package/lib/internal/template/tree-view/vertical-connector/index.d.ts +6 -0
- package/lib/internal/template/tree-view/vertical-connector/index.d.ts.map +1 -0
- package/lib/internal/template/tree-view/vertical-connector/index.js +11 -0
- package/lib/internal/template/tree-view/vertical-connector/index.js.map +1 -0
- package/lib/internal/template/tree-view/vertical-connector/styles.css.js +8 -0
- package/lib/internal/template/tree-view/vertical-connector/styles.scoped.css +25 -0
- package/lib/internal/template/tree-view/vertical-connector/styles.selectors.js +9 -0
- package/package.json +1 -1
|
@@ -150,11 +150,11 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
150
150
|
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
151
151
|
SPDX-License-Identifier: Apache-2.0
|
|
152
152
|
*/
|
|
153
|
-
.awsui_icon-
|
|
153
|
+
.awsui_icon-shake_1cbgc_zrca7_153:not(#\9) {
|
|
154
154
|
display: inline-block;
|
|
155
|
-
animation: awsui_awsui-motion-shake-
|
|
155
|
+
animation: awsui_awsui-motion-shake-horizontally_1cbgc_zrca7_1 var(--motion-duration-refresh-only-medium-h3wrr6, 0ms);
|
|
156
156
|
}
|
|
157
|
-
@keyframes awsui_awsui-motion-shake-
|
|
157
|
+
@keyframes awsui_awsui-motion-shake-horizontally_1cbgc_zrca7_1 {
|
|
158
158
|
0% {
|
|
159
159
|
transform: translateX(-5px);
|
|
160
160
|
animation-timing-function: linear;
|
|
@@ -168,20 +168,20 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
@media (prefers-reduced-motion: reduce) {
|
|
171
|
-
.awsui_icon-
|
|
171
|
+
.awsui_icon-shake_1cbgc_zrca7_153:not(#\9) {
|
|
172
172
|
animation: none;
|
|
173
173
|
transition: none;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
.awsui-motion-disabled .awsui_icon-
|
|
176
|
+
.awsui-motion-disabled .awsui_icon-shake_1cbgc_zrca7_153:not(#\9), .awsui-mode-entering .awsui_icon-shake_1cbgc_zrca7_153:not(#\9) {
|
|
177
177
|
animation: none;
|
|
178
178
|
transition: none;
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.awsui_container-fade-
|
|
182
|
-
animation: awsui_awsui-motion-fade-in-
|
|
181
|
+
.awsui_container-fade-in_1cbgc_zrca7_181:not(#\9) {
|
|
182
|
+
animation: awsui_awsui-motion-fade-in-0_1cbgc_zrca7_1 var(--motion-duration-refresh-only-medium-h3wrr6, 0ms) var(--motion-easing-refresh-only-a-8gio5w, cubic-bezier(0, 0, 0, 1));
|
|
183
183
|
}
|
|
184
|
-
@keyframes awsui_awsui-motion-fade-in-
|
|
184
|
+
@keyframes awsui_awsui-motion-fade-in-0_1cbgc_zrca7_1 {
|
|
185
185
|
from {
|
|
186
186
|
opacity: 0;
|
|
187
187
|
}
|
|
@@ -190,17 +190,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
192
|
@media (prefers-reduced-motion: reduce) {
|
|
193
|
-
.awsui_container-fade-
|
|
193
|
+
.awsui_container-fade-in_1cbgc_zrca7_181:not(#\9) {
|
|
194
194
|
animation: none;
|
|
195
195
|
transition: none;
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
.awsui-motion-disabled .awsui_container-fade-
|
|
198
|
+
.awsui-motion-disabled .awsui_container-fade-in_1cbgc_zrca7_181:not(#\9), .awsui-mode-entering .awsui_container-fade-in_1cbgc_zrca7_181:not(#\9) {
|
|
199
199
|
animation: none;
|
|
200
200
|
transition: none;
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
.
|
|
203
|
+
.awsui_root_1cbgc_zrca7_203:not(#\9) {
|
|
204
204
|
font-size: var(--font-size-body-m-vv54cm, 14px);
|
|
205
205
|
line-height: var(--line-height-body-m-bedeoh, 22px);
|
|
206
206
|
color: var(--color-text-body-default-5qid0u, #16191f);
|
|
@@ -209,64 +209,67 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
209
209
|
-webkit-font-smoothing: auto;
|
|
210
210
|
-moz-osx-font-smoothing: auto;
|
|
211
211
|
}
|
|
212
|
-
.
|
|
212
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-error_1cbgc_zrca7_212:not(#\9) {
|
|
213
213
|
color: var(--color-text-status-error-aknuvu, #d13212);
|
|
214
214
|
}
|
|
215
|
-
.
|
|
215
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-warning_1cbgc_zrca7_215:not(#\9) {
|
|
216
216
|
color: var(--color-text-status-warning-9b45qh, #906806);
|
|
217
217
|
}
|
|
218
|
-
.
|
|
218
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-success_1cbgc_zrca7_218:not(#\9) {
|
|
219
219
|
color: var(--color-text-status-success-yodf3z, #1d8102);
|
|
220
220
|
}
|
|
221
|
-
.
|
|
221
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-info_1cbgc_zrca7_221:not(#\9) {
|
|
222
222
|
color: var(--color-text-status-info-xt2ka7, #0073bb);
|
|
223
223
|
}
|
|
224
|
-
.
|
|
224
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-stopped_1cbgc_zrca7_224:not(#\9) {
|
|
225
225
|
color: var(--color-text-status-inactive-n7p1uq, #687078);
|
|
226
226
|
}
|
|
227
|
-
.
|
|
227
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-pending_1cbgc_zrca7_227:not(#\9) {
|
|
228
228
|
color: var(--color-text-status-inactive-n7p1uq, #687078);
|
|
229
229
|
}
|
|
230
|
-
.
|
|
230
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-in-progress_1cbgc_zrca7_230:not(#\9) {
|
|
231
231
|
color: var(--color-text-status-inactive-n7p1uq, #687078);
|
|
232
232
|
}
|
|
233
|
-
.
|
|
233
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-loading_1cbgc_zrca7_233:not(#\9) {
|
|
234
234
|
color: var(--color-text-status-inactive-n7p1uq, #687078);
|
|
235
235
|
}
|
|
236
|
-
.
|
|
236
|
+
.awsui_root_1cbgc_zrca7_203.awsui_status-not-started_1cbgc_zrca7_236:not(#\9) {
|
|
237
|
+
color: var(--color-text-status-inactive-n7p1uq, #687078);
|
|
238
|
+
}
|
|
239
|
+
.awsui_root_1cbgc_zrca7_203.awsui_color-override-red_1cbgc_zrca7_239:not(#\9) {
|
|
237
240
|
color: var(--color-text-status-error-aknuvu, #d13212);
|
|
238
241
|
}
|
|
239
|
-
.
|
|
242
|
+
.awsui_root_1cbgc_zrca7_203.awsui_color-override-grey_1cbgc_zrca7_242:not(#\9) {
|
|
240
243
|
color: var(--color-text-status-inactive-n7p1uq, #687078);
|
|
241
244
|
}
|
|
242
|
-
.
|
|
245
|
+
.awsui_root_1cbgc_zrca7_203.awsui_color-override-blue_1cbgc_zrca7_245:not(#\9) {
|
|
243
246
|
color: var(--color-text-status-info-xt2ka7, #0073bb);
|
|
244
247
|
}
|
|
245
|
-
.
|
|
248
|
+
.awsui_root_1cbgc_zrca7_203.awsui_color-override-green_1cbgc_zrca7_248:not(#\9) {
|
|
246
249
|
color: var(--color-text-status-success-yodf3z, #1d8102);
|
|
247
250
|
}
|
|
248
|
-
.
|
|
251
|
+
.awsui_root_1cbgc_zrca7_203.awsui_color-override-yellow_1cbgc_zrca7_251:not(#\9) {
|
|
249
252
|
color: var(--color-text-status-warning-9b45qh, #906806);
|
|
250
253
|
}
|
|
251
254
|
|
|
252
|
-
.
|
|
255
|
+
.awsui_container_1cbgc_zrca7_181.awsui_display-inline_1cbgc_zrca7_255:not(#\9) {
|
|
253
256
|
min-inline-size: 0;
|
|
254
257
|
word-break: break-word;
|
|
255
258
|
display: inline;
|
|
256
259
|
}
|
|
257
|
-
.
|
|
260
|
+
.awsui_container_1cbgc_zrca7_181.awsui_display-inline_1cbgc_zrca7_255 > .awsui_icon_1cbgc_zrca7_153:not(#\9) {
|
|
258
261
|
white-space: nowrap;
|
|
259
262
|
}
|
|
260
|
-
.
|
|
263
|
+
.awsui_container_1cbgc_zrca7_181.awsui_display-inline-block_1cbgc_zrca7_263:not(#\9) {
|
|
261
264
|
display: inline-block;
|
|
262
265
|
word-wrap: break-word;
|
|
263
266
|
word-break: break-all;
|
|
264
267
|
}
|
|
265
|
-
.
|
|
268
|
+
.awsui_container_1cbgc_zrca7_181.awsui_display-inline-block_1cbgc_zrca7_263 > .awsui_icon_1cbgc_zrca7_153:not(#\9) {
|
|
266
269
|
padding-inline-end: var(--space-xxs-jnczic, 4px);
|
|
267
270
|
}
|
|
268
271
|
|
|
269
|
-
.awsui_overflow-
|
|
272
|
+
.awsui_overflow-ellipsis_1cbgc_zrca7_272:not(#\9) {
|
|
270
273
|
max-inline-size: 100%;
|
|
271
274
|
overflow: hidden;
|
|
272
275
|
text-overflow: ellipsis;
|
|
@@ -2,28 +2,29 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"icon-shake": "awsui_icon-
|
|
6
|
-
"awsui-motion-shake-horizontally": "awsui_awsui-motion-shake-
|
|
7
|
-
"container-fade-in": "awsui_container-fade-
|
|
8
|
-
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-
|
|
9
|
-
"root": "
|
|
10
|
-
"status-error": "awsui_status-
|
|
11
|
-
"status-warning": "awsui_status-
|
|
12
|
-
"status-success": "awsui_status-
|
|
13
|
-
"status-info": "awsui_status-
|
|
14
|
-
"status-stopped": "awsui_status-
|
|
15
|
-
"status-pending": "awsui_status-
|
|
16
|
-
"status-in-progress": "awsui_status-in-
|
|
17
|
-
"status-loading": "awsui_status-
|
|
18
|
-
"
|
|
19
|
-
"color-override-
|
|
20
|
-
"color-override-
|
|
21
|
-
"color-override-
|
|
22
|
-
"color-override-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
5
|
+
"icon-shake": "awsui_icon-shake_1cbgc_zrca7_153",
|
|
6
|
+
"awsui-motion-shake-horizontally": "awsui_awsui-motion-shake-horizontally_1cbgc_zrca7_1",
|
|
7
|
+
"container-fade-in": "awsui_container-fade-in_1cbgc_zrca7_181",
|
|
8
|
+
"awsui-motion-fade-in-0": "awsui_awsui-motion-fade-in-0_1cbgc_zrca7_1",
|
|
9
|
+
"root": "awsui_root_1cbgc_zrca7_203",
|
|
10
|
+
"status-error": "awsui_status-error_1cbgc_zrca7_212",
|
|
11
|
+
"status-warning": "awsui_status-warning_1cbgc_zrca7_215",
|
|
12
|
+
"status-success": "awsui_status-success_1cbgc_zrca7_218",
|
|
13
|
+
"status-info": "awsui_status-info_1cbgc_zrca7_221",
|
|
14
|
+
"status-stopped": "awsui_status-stopped_1cbgc_zrca7_224",
|
|
15
|
+
"status-pending": "awsui_status-pending_1cbgc_zrca7_227",
|
|
16
|
+
"status-in-progress": "awsui_status-in-progress_1cbgc_zrca7_230",
|
|
17
|
+
"status-loading": "awsui_status-loading_1cbgc_zrca7_233",
|
|
18
|
+
"status-not-started": "awsui_status-not-started_1cbgc_zrca7_236",
|
|
19
|
+
"color-override-red": "awsui_color-override-red_1cbgc_zrca7_239",
|
|
20
|
+
"color-override-grey": "awsui_color-override-grey_1cbgc_zrca7_242",
|
|
21
|
+
"color-override-blue": "awsui_color-override-blue_1cbgc_zrca7_245",
|
|
22
|
+
"color-override-green": "awsui_color-override-green_1cbgc_zrca7_248",
|
|
23
|
+
"color-override-yellow": "awsui_color-override-yellow_1cbgc_zrca7_251",
|
|
24
|
+
"container": "awsui_container_1cbgc_zrca7_181",
|
|
25
|
+
"display-inline": "awsui_display-inline_1cbgc_zrca7_255",
|
|
26
|
+
"icon": "awsui_icon_1cbgc_zrca7_153",
|
|
27
|
+
"display-inline-block": "awsui_display-inline-block_1cbgc_zrca7_263",
|
|
28
|
+
"overflow-ellipsis": "awsui_overflow-ellipsis_1cbgc_zrca7_272"
|
|
28
29
|
};
|
|
29
30
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/steps/internal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,KAAK,kBAAkB,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/steps/internal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,KAAK,kBAAkB,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,GAAG,0BAA0B,CAAC;AA4EzF,QAAA,MAAM,aAAa,GAAI,6GASpB,kBAAkB,gBA8BpB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -14,6 +14,7 @@ const statusToColor = {
|
|
|
14
14
|
pending: 'text-status-inactive',
|
|
15
15
|
'in-progress': 'text-status-inactive',
|
|
16
16
|
loading: 'text-status-inactive',
|
|
17
|
+
'not-started': 'text-status-inactive',
|
|
17
18
|
};
|
|
18
19
|
const CustomStep = ({ step, orientation, renderStep, }) => {
|
|
19
20
|
const { status, statusIconAriaLabel } = step;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/steps/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAG1C,OAAO,uBAAuB,EAAE,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAG3F,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,aAAa,GAA8C;IAC/D,KAAK,EAAE,mBAAmB;IAC1B,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,qBAAqB;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,sBAAsB;IAC/B,OAAO,EAAE,sBAAsB;IAC/B,aAAa,EAAE,sBAAsB;IACrC,OAAO,EAAE,sBAAsB;
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/steps/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAG1C,OAAO,uBAAuB,EAAE,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAG3F,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAIrC,MAAM,aAAa,GAA8C;IAC/D,KAAK,EAAE,mBAAmB;IAC1B,OAAO,EAAE,qBAAqB;IAC9B,OAAO,EAAE,qBAAqB;IAC9B,IAAI,EAAE,kBAA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EtB,4BACE,SAAS,EAAE,MAAM,CAAC,IAAI,gBACV,SAAS,qBACJ,cAAc,sBACb,eAAe,IAEhC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACzB,UAAU,CAAC,CAAC,CAAC,CACX,oBAAC,UAAU,IAAC,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,GAAI,CACzF,CAAC,CAAC,CAAC,CACF,oBAAC,YAAY,IACX,GAAG,EAAE,KAAK,EACV,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAC7C,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,WAAW,EAAE,WAAW,GACxB,CACH,CACF,CACE,CACD,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { BoxProps } from '../box/interfaces';\nimport InternalBox from '../box/internal';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { SomeRequired } from '../internal/types';\nimport InternalStatusIndicator, { InternalStatusIcon } from '../status-indicator/internal';\nimport { StepsProps } from './interfaces';\n\nimport styles from './styles.css.js';\n\ntype InternalStepsProps = SomeRequired<StepsProps, 'steps'> & InternalBaseComponentProps;\n\nconst statusToColor: Record<StepsProps.Status, BoxProps.Color> = {\n error: 'text-status-error',\n warning: 'text-status-warning',\n success: 'text-status-success',\n info: 'text-status-info',\n stopped: 'text-status-inactive',\n pending: 'text-status-inactive',\n 'in-progress': 'text-status-inactive',\n loading: 'text-status-inactive',\n 'not-started': 'text-status-inactive',\n};\n\nconst CustomStep = ({\n step,\n orientation,\n renderStep,\n}: {\n step: StepsProps.Step;\n orientation: StepsProps.Orientation;\n renderStep: Required<StepsProps>['renderStep'];\n}) => {\n const { status, statusIconAriaLabel } = step;\n const { header, details, icon } = renderStep(step);\n return (\n <li className={styles.container}>\n <div className={styles.header}>\n {icon ? icon : <InternalStatusIcon type={status} iconAriaLabel={statusIconAriaLabel} />}\n {orientation === 'vertical' ? header : <hr className={styles.connector} role=\"none\" />}\n </div>\n {orientation === 'vertical' ? (\n <hr className={styles.connector} role=\"none\" />\n ) : (\n <div className={styles['horizontal-header']}>{header}</div>\n )}\n {details && <div className={styles.details}>{details}</div>}\n </li>\n );\n};\n\nconst InternalStep = ({\n status,\n statusIconAriaLabel,\n header,\n details,\n orientation,\n}: StepsProps.Step & { orientation: StepsProps.Orientation }) => {\n return (\n <li className={styles.container}>\n <div className={styles.header}>\n {orientation === 'vertical' ? (\n <InternalStatusIndicator type={status} iconAriaLabel={statusIconAriaLabel}>\n {header}\n </InternalStatusIndicator>\n ) : (\n <>\n <InternalBox color={statusToColor[status]}>\n <InternalStatusIcon type={status} iconAriaLabel={statusIconAriaLabel} />\n </InternalBox>\n <hr className={styles.connector} role=\"none\" />\n </>\n )}\n </div>\n {orientation === 'vertical' ? (\n <hr className={styles.connector} role=\"none\" />\n ) : (\n <div className={styles['horizontal-header']}>\n <InternalBox color={statusToColor[status]}>{header}</InternalBox>\n </div>\n )}\n {details && <div className={styles.details}>{details}</div>}\n </li>\n );\n};\n\nconst InternalSteps = ({\n steps,\n orientation = 'vertical',\n renderStep,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n __internalRootRef,\n ...props\n}: InternalStepsProps) => {\n return (\n <div\n {...props}\n className={clsx(styles.root, props.className, orientation === 'horizontal' ? styles.horizontal : styles.vertical)}\n ref={__internalRootRef}\n >\n <ol\n className={styles.list}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n >\n {steps.map((step, index) =>\n renderStep ? (\n <CustomStep key={index} orientation={orientation} step={step} renderStep={renderStep} />\n ) : (\n <InternalStep\n key={index}\n status={step.status}\n statusIconAriaLabel={step.statusIconAriaLabel}\n header={step.header}\n details={step.details}\n orientation={orientation}\n />\n )\n )}\n </ol>\n </div>\n );\n};\n\nexport default InternalSteps;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-editor.d.ts","sourceRoot":"","sources":["../../../../src/table/body-cell/inline-editor.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,UAAU,gBAAgB;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,iBAAiB,CAAC,QAAQ;IAClC,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/C,UAAU,EAAE,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,EACrC,UAAU,EACV,IAAI,EACJ,MAAM,EACN,SAAS,EACT,UAAU,EACV,UAAU,GACX,EAAE,iBAAiB,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"inline-editor.d.ts","sourceRoot":"","sources":["../../../../src/table/body-cell/inline-editor.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C,UAAU,gBAAgB;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,UAAU,iBAAiB,CAAC,QAAQ;IAClC,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM,EAAE,UAAU,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC/C,UAAU,EAAE,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,EACrC,UAAU,EACV,IAAI,EACJ,MAAM,EACN,SAAS,EACT,UAAU,EACV,UAAU,GACX,EAAE,iBAAiB,CAAC,QAAQ,CAAC,eAiI7B"}
|
|
@@ -34,10 +34,8 @@ export function InlineEditor({ ariaLabels, item, column, onEditEnd, submitEdit,
|
|
|
34
34
|
await submitEdit(item, column, currentEditValue);
|
|
35
35
|
setCurrentEditLoading(false);
|
|
36
36
|
finishEdit();
|
|
37
|
-
// Consumers in the past have not always been able to support not specifiying the value so we keep and ignore
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
37
|
}
|
|
40
|
-
catch
|
|
38
|
+
catch {
|
|
41
39
|
setCurrentEditLoading(false);
|
|
42
40
|
(_a = focusLockRef.current) === null || _a === void 0 ? void 0 : _a.focusFirst();
|
|
43
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-editor.js","sourceRoot":"","sources":["../../../../src/table/body-cell/inline-editor.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,SAAS,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,SAA2B,MAAM,sCAAsC,CAAC;AAE/E,OAAO,kBA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SAAS,EAAC,YAAY,EAAC,IAAI,EAAC,KAAK;gCAC5C,CAAC,kBAAkB,CAAC,CAAC,CAAC,CACrB,oBAAC,MAAM,IACL,SAAS,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,2DAAG,MAAM,CAAC,EAChD,UAAU,EAAC,MAAM,EACjB,QAAQ,EAAC,OAAO,EAChB,OAAO,EAAC,aAAa,EACrB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,GACzB,CACH,CAAC,CAAC,CAAC,IAAI;gCACR,oBAAC,MAAM,IACL,SAAS,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,eAAe,2DAAG,MAAM,CAAC,EAChD,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EACjD,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,EACrD,QAAQ,EAAC,OAAO,EAChB,OAAO,EAAC,aAAa,EACrB,OAAO,EAAE,kBAAkB,GAC3B,CACW;4BACf,oBAAC,kBAAkB,IAAC,OAAO,EAAC,MAAM,EAAC,MAAM,EAAE,IAAI,IAC5C,kBAAkB;gCACjB,CAAC,CAAC,IAAI,CAAC,+BAA+B,EAAE,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,kBAAkB,2DAAG,MAAM,CAAC,CAAC;gCACjF,CAAC,CAAC,EAAE,CACa,CAChB,CACH,CACI,CACA,CACV,CACI,CACb,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport Button from '../../button/internal';\nimport FormField from '../../form-field/internal';\nimport { useInternalI18n } from '../../i18n/context';\nimport FocusLock, { FocusLockRef } from '../../internal/components/focus-lock';\nimport { Optional } from '../../internal/types';\nimport InternalLiveRegion from '../../live-region/internal';\nimport SpaceBetween from '../../space-between/internal';\nimport { TableProps } from '../interfaces';\nimport { useClickAway } from './click-away';\n\nimport styles from './styles.css.js';\n\n// A function that does nothing\nconst noop = () => undefined;\n\ninterface OnEditEndOptions {\n cancelled: boolean;\n refocusCell: boolean;\n}\n\ninterface InlineEditorProps<ItemType> {\n ariaLabels: TableProps['ariaLabels'];\n column: TableProps.ColumnDefinition<ItemType>;\n item: ItemType;\n onEditEnd: (options: OnEditEndOptions) => void;\n submitEdit: TableProps.SubmitEditFunction<ItemType>;\n __onRender?: () => void;\n}\n\nexport function InlineEditor<ItemType>({\n ariaLabels,\n item,\n column,\n onEditEnd,\n submitEdit,\n __onRender,\n}: InlineEditorProps<ItemType>) {\n const [currentEditLoading, setCurrentEditLoading] = useState(false);\n const [currentEditValue, setCurrentEditValue] = useState<Optional<any>>();\n const i18n = useInternalI18n('table');\n\n const focusLockRef = useRef<FocusLockRef>(null);\n\n function finishEdit({ cancelled = false, refocusCell = true }: Partial<OnEditEndOptions> = {}) {\n if (!cancelled) {\n setCurrentEditValue(undefined);\n }\n onEditEnd({ cancelled, refocusCell: refocusCell });\n }\n\n async function handleSubmit() {\n if (currentEditValue === undefined) {\n finishEdit();\n return;\n }\n\n setCurrentEditLoading(true);\n try {\n await submitEdit(item, column, currentEditValue);\n setCurrentEditLoading(false);\n finishEdit();\n } catch {\n setCurrentEditLoading(false);\n focusLockRef.current?.focusFirst();\n }\n }\n\n function onFormSubmit(evt: React.FormEvent) {\n evt.preventDefault(); // Prevents the form from navigating away\n evt.stopPropagation(); // Prevents any outer form elements from submitting\n handleSubmit();\n }\n\n function onCancel({ reFocusEditedCell = true } = {}) {\n if (currentEditLoading) {\n return;\n }\n finishEdit({ cancelled: true, refocusCell: reFocusEditedCell });\n }\n\n function handleEscape(event: React.KeyboardEvent): void {\n if (event.key === 'Escape') {\n onCancel();\n }\n }\n\n const clickAwayRef = useClickAway(() => onCancel({ reFocusEditedCell: false }));\n\n useEffect(() => {\n if (__onRender) {\n const timer = setTimeout(__onRender, 1);\n return () => clearTimeout(timer);\n }\n }, [__onRender]);\n\n // asserting non-undefined editConfig here because this component is unreachable otherwise\n const {\n ariaLabel = undefined,\n validation = noop,\n errorIconAriaLabel,\n constraintText,\n editingCell,\n disableNativeForm,\n } = column.editConfig!;\n\n const cellContext = {\n currentValue: currentEditValue,\n setValue: setCurrentEditValue,\n submitValue: handleSubmit,\n };\n\n const FormElement = disableNativeForm ? 'div' : 'form';\n\n return (\n <FocusLock restoreFocus={true} ref={focusLockRef}>\n <div\n role=\"dialog\"\n ref={clickAwayRef}\n aria-label={ariaLabels?.activateEditLabel?.(column, item)}\n onKeyDown={handleEscape}\n >\n <FormElement onSubmit={disableNativeForm ? undefined : onFormSubmit}>\n <FormField\n stretch={true}\n label={ariaLabel}\n constraintText={constraintText}\n __hideLabel={true}\n __disableGutters={true}\n i18nStrings={{ errorIconAriaLabel }}\n errorText={validation(item, currentEditValue)}\n >\n <div className={styles['body-cell-editor-row']}>\n <div className={styles['body-cell-editor-row-editor']}>{editingCell(item, cellContext)}</div>\n <span className={styles['body-cell-editor-controls']}>\n <SpaceBetween direction=\"horizontal\" size=\"xxs\">\n {!currentEditLoading ? (\n <Button\n ariaLabel={ariaLabels?.cancelEditLabel?.(column)}\n formAction=\"none\"\n iconName=\"close\"\n variant=\"inline-icon\"\n onClick={() => onCancel()}\n />\n ) : null}\n <Button\n ariaLabel={ariaLabels?.submitEditLabel?.(column)}\n formAction={disableNativeForm ? 'none' : 'submit'}\n onClick={disableNativeForm ? handleSubmit : undefined}\n iconName=\"check\"\n variant=\"inline-icon\"\n loading={currentEditLoading}\n />\n </SpaceBetween>\n <InternalLiveRegion tagName=\"span\" hidden={true}>\n {currentEditLoading\n ? i18n('ariaLabels.submittingEditText', ariaLabels?.submittingEditText?.(column))\n : ''}\n </InternalLiveRegion>\n </span>\n </div>\n </FormField>\n </FormElement>\n </div>\n </FocusLock>\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TreeViewProps } from './interfaces';
|
|
2
2
|
export { TreeViewProps };
|
|
3
|
-
declare const TreeView: <T>(props: TreeViewProps<T>) => JSX.Element;
|
|
3
|
+
declare const TreeView: <T>({ connectorLines, ...props }: TreeViewProps<T>) => JSX.Element;
|
|
4
4
|
export default TreeView;
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tree-view/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,QAAA,MAAM,QAAQ,GAAI,CAAC,EAAG,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tree-view/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,QAAA,MAAM,QAAQ,GAAI,CAAC,EAAG,8BAAuC,aAAa,CAAC,CAAC,CAAC,gBAgB5E,CAAC;AAGF,eAAe,QAAQ,CAAC"}
|
|
@@ -7,11 +7,13 @@ import useBaseComponent from '../internal/hooks/use-base-component';
|
|
|
7
7
|
import { applyDisplayName } from '../internal/utils/apply-display-name';
|
|
8
8
|
import { getExternalProps } from '../internal/utils/external-props';
|
|
9
9
|
import InternalTreeView from './internal';
|
|
10
|
-
const TreeView = (props) => {
|
|
11
|
-
const baseComponentProps = useBaseComponent('TreeView'
|
|
10
|
+
const TreeView = ({ connectorLines = 'none', ...props }) => {
|
|
11
|
+
const baseComponentProps = useBaseComponent('TreeView', {
|
|
12
|
+
props: { connectorLines },
|
|
13
|
+
});
|
|
12
14
|
const baseProps = getBaseProps(props);
|
|
13
15
|
const externalProps = getExternalProps(props);
|
|
14
|
-
return React.createElement(InternalTreeView, { ...baseProps, ...baseComponentProps, ...externalProps, ...props });
|
|
16
|
+
return (React.createElement(InternalTreeView, { ...baseProps, ...baseComponentProps, ...externalProps, ...props, connectorLines: connectorLines }));
|
|
15
17
|
};
|
|
16
18
|
applyDisplayName(TreeView, 'TreeView');
|
|
17
19
|
export default TreeView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tree-view/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,gBAAgB,MAAM,YAAY,CAAC;AAI1C,MAAM,QAAQ,GAAG,CAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tree-view/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,sCAAsC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,gBAAgB,MAAM,YAAY,CAAC;AAI1C,MAAM,QAAQ,GAAG,CAAK,EAAE,cAAc,GAAG,MAAM,EAAE,GAAG,KAAK,EAAoB,EAAE,EAAE;IAC/E,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,UAAU,EAAE;QACtD,KAAK,EAAE,EAAE,cAAc,EAAE;KAC1B,CAAC,CAAC;IACH,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,aAAa,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAE9C,OAAO,CACL,oBAAC,gBAAgB,OACX,SAAS,KACT,kBAAkB,KAClB,aAAa,KACb,KAAK,EACT,cAAc,EAAE,cAAc,GAC9B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,gBAAgB,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AACvC,eAAe,QAAQ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n'use client';\nimport React from 'react';\n\nimport { getBaseProps } from '../internal/base-component';\nimport useBaseComponent from '../internal/hooks/use-base-component';\nimport { applyDisplayName } from '../internal/utils/apply-display-name';\nimport { getExternalProps } from '../internal/utils/external-props';\nimport { TreeViewProps } from './interfaces';\nimport InternalTreeView from './internal';\n\nexport { TreeViewProps };\n\nconst TreeView = <T,>({ connectorLines = 'none', ...props }: TreeViewProps<T>) => {\n const baseComponentProps = useBaseComponent('TreeView', {\n props: { connectorLines },\n });\n const baseProps = getBaseProps(props);\n const externalProps = getExternalProps(props);\n\n return (\n <InternalTreeView\n {...baseProps}\n {...baseComponentProps}\n {...externalProps}\n {...props}\n connectorLines={connectorLines}\n />\n );\n};\n\napplyDisplayName(TreeView, 'TreeView');\nexport default TreeView;\n"]}
|
|
@@ -42,6 +42,10 @@ export interface TreeViewProps<T = any> extends BaseComponentProps {
|
|
|
42
42
|
* Sets the `aria-describedby` property on the tree view.
|
|
43
43
|
*/
|
|
44
44
|
ariaDescribedby?: string;
|
|
45
|
+
/**
|
|
46
|
+
* Shows connector lines highlighting hierarchy between parent and child items.
|
|
47
|
+
*/
|
|
48
|
+
connectorLines?: TreeViewProps.ConnectorLinesVariant;
|
|
45
49
|
/**
|
|
46
50
|
* Called when an item expands or collapses.
|
|
47
51
|
*/
|
|
@@ -72,6 +76,7 @@ export declare namespace TreeViewProps {
|
|
|
72
76
|
interface ItemToggleRenderIconData {
|
|
73
77
|
expanded: boolean;
|
|
74
78
|
}
|
|
79
|
+
type ConnectorLinesVariant = 'vertical' | 'none';
|
|
75
80
|
interface I18nStrings<T> {
|
|
76
81
|
collapseButtonLabel?: (item: T) => string;
|
|
77
82
|
expandButtonLabel?: (item: T) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/tree-view/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,GAAG,CAAE,SAAQ,kBAAkB;IAChE;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IAExB;;;;;;;OAOG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,aAAa,CAAC,QAAQ,CAAC;IAE/D;;OAEG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAE9C;;OAEG;IACH,eAAe,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;IAE1E;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAEtC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;OAEG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC,aAAa,C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B,gBAAgB,CAAC,CAAC;QACjC,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,CAAC,CAAC;QACR,QAAQ,EAAE,OAAO,CAAC;KACnB;IAED,UAAiB,wBAAwB;QACvC,QAAQ,EAAE,OAAO,CAAC;KACnB;IAED,KAAY,qBAAqB,GAAG,UAAU,GAAG,MAAM,CAAC;IAExD,UAAiB,WAAW,CAAC,CAAC;QAC5B,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;QAC1C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;KACzC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/tree-view/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface TreeViewProps<T = any> extends BaseComponentProps {\n /**\n * Specifies the top-level items to display in the tree view. Use `getItemChildren` to provide nested items.\n */\n items: ReadonlyArray<T>;\n\n /**\n * Use this property to map your data to tree view items. This property must return an object with the following properties:\n * * `content` (ReactNode) - The content of the item.\n * * `icon` (ReactNode) - (Optional) The icon of the item.\n * * `secondaryContent` (ReactNode) - (Optional) Secondary content of the item, such as a description of the item.\n * * `actions` (ReactNode) - (Optional) Actions related to the item. Use [button](/components/button/?tabId=playground&example=inline-icon-button) with inline-icon or inline-link variants. For items with multiple actions, use [button dropdown](/components/button-dropdown/?tabId=playground&example=inline-icon-button-dropdown) with the inline-icon variant.\n * * `announcementLabel` (string) - (Optional) An announcement label for the item, used for labeling the toggle button. By default, the `content` is used. Make sure to provide the `announcementLabel` if `content` is not a string.\n */\n renderItem: (item: T, index: number) => TreeViewProps.TreeItem;\n\n /**\n * Provides a unique identifier for each tree view item.\n */\n getItemId: (item: T, index: number) => string;\n\n /**\n * Specifies the nested items that are displayed when a tree view item gets expanded.\n */\n getItemChildren: (item: T, index: number) => ReadonlyArray<T> | undefined;\n\n /**\n * Provides the IDs of the expanded tree view items. It controls whether an item is expanded or collapsed.\n */\n expandedItems?: ReadonlyArray<string>;\n\n /**\n * Provides an `aria-label` to the tree view that screen readers can read (for accessibility).\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabel?: string;\n\n /**\n * Sets the `aria-labelledby` property on the tree view.\n * If there's a visible label element that you can reference, use this instead of `ariaLabel`.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabelledby?: string;\n\n /**\n * Sets the `aria-describedby` property on the tree view.\n */\n ariaDescribedby?: string;\n\n /**\n * Called when an item expands or collapses.\n */\n onItemToggle?: NonCancelableEventHandler<TreeViewProps.ItemToggleDetail<T>>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: TreeViewProps.I18nStrings<T>;\n\n /**\n * Use this property to display a custom icon in the toggle button.\n */\n renderItemToggleIcon?: (data: TreeViewProps.ItemToggleRenderIconData) => React.ReactNode;\n}\n\nexport namespace TreeViewProps {\n export interface TreeItem {\n content: React.ReactNode;\n icon?: React.ReactNode;\n secondaryContent?: React.ReactNode;\n actions?: React.ReactNode;\n announcementLabel?: string;\n }\n\n export interface ItemToggleDetail<T> {\n id: string;\n item: T;\n expanded: boolean;\n }\n\n export interface ItemToggleRenderIconData {\n expanded: boolean;\n }\n\n export interface I18nStrings<T> {\n collapseButtonLabel?: (item: T) => string;\n expandButtonLabel?: (item: T) => string;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/tree-view/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\n\nimport { BaseComponentProps } from '../internal/base-component';\nimport { NonCancelableEventHandler } from '../internal/events';\n\nexport interface TreeViewProps<T = any> extends BaseComponentProps {\n /**\n * Specifies the top-level items to display in the tree view. Use `getItemChildren` to provide nested items.\n */\n items: ReadonlyArray<T>;\n\n /**\n * Use this property to map your data to tree view items. This property must return an object with the following properties:\n * * `content` (ReactNode) - The content of the item.\n * * `icon` (ReactNode) - (Optional) The icon of the item.\n * * `secondaryContent` (ReactNode) - (Optional) Secondary content of the item, such as a description of the item.\n * * `actions` (ReactNode) - (Optional) Actions related to the item. Use [button](/components/button/?tabId=playground&example=inline-icon-button) with inline-icon or inline-link variants. For items with multiple actions, use [button dropdown](/components/button-dropdown/?tabId=playground&example=inline-icon-button-dropdown) with the inline-icon variant.\n * * `announcementLabel` (string) - (Optional) An announcement label for the item, used for labeling the toggle button. By default, the `content` is used. Make sure to provide the `announcementLabel` if `content` is not a string.\n */\n renderItem: (item: T, index: number) => TreeViewProps.TreeItem;\n\n /**\n * Provides a unique identifier for each tree view item.\n */\n getItemId: (item: T, index: number) => string;\n\n /**\n * Specifies the nested items that are displayed when a tree view item gets expanded.\n */\n getItemChildren: (item: T, index: number) => ReadonlyArray<T> | undefined;\n\n /**\n * Provides the IDs of the expanded tree view items. It controls whether an item is expanded or collapsed.\n */\n expandedItems?: ReadonlyArray<string>;\n\n /**\n * Provides an `aria-label` to the tree view that screen readers can read (for accessibility).\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabel?: string;\n\n /**\n * Sets the `aria-labelledby` property on the tree view.\n * If there's a visible label element that you can reference, use this instead of `ariaLabel`.\n * Don't use `ariaLabel` and `ariaLabelledby` at the same time.\n */\n ariaLabelledby?: string;\n\n /**\n * Sets the `aria-describedby` property on the tree view.\n */\n ariaDescribedby?: string;\n\n /**\n * Shows connector lines highlighting hierarchy between parent and child items.\n */\n connectorLines?: TreeViewProps.ConnectorLinesVariant;\n\n /**\n * Called when an item expands or collapses.\n */\n onItemToggle?: NonCancelableEventHandler<TreeViewProps.ItemToggleDetail<T>>;\n\n /**\n * An object containing all the necessary localized strings required by the component.\n * @i18n\n */\n i18nStrings?: TreeViewProps.I18nStrings<T>;\n\n /**\n * Use this property to display a custom icon in the toggle button.\n */\n renderItemToggleIcon?: (data: TreeViewProps.ItemToggleRenderIconData) => React.ReactNode;\n}\n\nexport namespace TreeViewProps {\n export interface TreeItem {\n content: React.ReactNode;\n icon?: React.ReactNode;\n secondaryContent?: React.ReactNode;\n actions?: React.ReactNode;\n announcementLabel?: string;\n }\n\n export interface ItemToggleDetail<T> {\n id: string;\n item: T;\n expanded: boolean;\n }\n\n export interface ItemToggleRenderIconData {\n expanded: boolean;\n }\n\n export type ConnectorLinesVariant = 'vertical' | 'none';\n\n export interface I18nStrings<T> {\n collapseButtonLabel?: (item: T) => string;\n expandButtonLabel?: (item: T) => string;\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { InternalBaseComponentProps } from '../internal/hooks/use-base-component';
|
|
2
2
|
import { TreeViewProps } from './interfaces';
|
|
3
3
|
type InternalTreeViewProps<T> = TreeViewProps<T> & InternalBaseComponentProps;
|
|
4
|
-
declare const InternalTreeView: <T>({ expandedItems: controlledExpandedItems, items, renderItem, getItemId, getItemChildren, onItemToggle, renderItemToggleIcon, ariaLabel, ariaLabelledby, ariaDescribedby, i18nStrings, __internalRootRef, ...rest }: InternalTreeViewProps<T>) => JSX.Element;
|
|
4
|
+
declare const InternalTreeView: <T>({ expandedItems: controlledExpandedItems, items, renderItem, getItemId, getItemChildren, onItemToggle, renderItemToggleIcon, ariaLabel, ariaLabelledby, ariaDescribedby, connectorLines, i18nStrings, __internalRootRef, ...rest }: InternalTreeViewProps<T>) => JSX.Element;
|
|
5
5
|
export default InternalTreeView;
|
|
6
6
|
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/tree-view/internal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQ7C,KAAK,qBAAqB,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,0BAA0B,CAAC;AAE9E,QAAA,MAAM,gBAAgB,GAAI,CAAC,EAAG,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../src/tree-view/internal.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQ7C,KAAK,qBAAqB,CAAC,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,GAAG,0BAA0B,CAAC;AAE9E,QAAA,MAAM,gBAAgB,GAAI,CAAC,EAAG,oOAe3B,qBAAqB,CAAC,CAAC,CAAC,gBAwD1B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -10,7 +10,7 @@ import InternalTreeItem from './tree-item';
|
|
|
10
10
|
import { getAllVisibleItemsIndices } from './utils';
|
|
11
11
|
import styles from './styles.css.js';
|
|
12
12
|
import testUtilStyles from './test-classes/styles.css.js';
|
|
13
|
-
const InternalTreeView = ({ expandedItems: controlledExpandedItems, items, renderItem, getItemId, getItemChildren, onItemToggle, renderItemToggleIcon, ariaLabel, ariaLabelledby, ariaDescribedby, i18nStrings, __internalRootRef, ...rest }) => {
|
|
13
|
+
const InternalTreeView = ({ expandedItems: controlledExpandedItems, items, renderItem, getItemId, getItemChildren, onItemToggle, renderItemToggleIcon, ariaLabel, ariaLabelledby, ariaDescribedby, connectorLines, i18nStrings, __internalRootRef, ...rest }) => {
|
|
14
14
|
const baseProps = getBaseProps(rest);
|
|
15
15
|
const [expandedItems, setExpandedItems] = useControllable(controlledExpandedItems, onItemToggle, [], {
|
|
16
16
|
componentName: 'TreeView',
|
|
@@ -32,7 +32,7 @@ const InternalTreeView = ({ expandedItems: controlledExpandedItems, items, rende
|
|
|
32
32
|
React.createElement(KeyboardNavigationProvider, { getTreeView: () => treeViewRefObject.current },
|
|
33
33
|
React.createElement("ul", { role: "tree", ref: treeViewRefObject, className: clsx(styles.tree, testUtilStyles.tree), "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-describedby": ariaDescribedby }, items.map((item, index) => {
|
|
34
34
|
const itemId = getItemId(item, index);
|
|
35
|
-
return (React.createElement(InternalTreeItem, { key: itemId, item: item, level: 1, index: index, expandedItems: expandedItems, i18nStrings: i18nStrings, onItemToggle: onToggle, renderItem: renderItem, getItemId: getItemId, getItemChildren: getItemChildren, renderItemToggleIcon: renderItemToggleIcon, allVisibleItemsIndices: allVisibleItemsIndices }));
|
|
35
|
+
return (React.createElement(InternalTreeItem, { key: itemId, item: item, level: 1, index: index, expandedItems: expandedItems, i18nStrings: i18nStrings, onItemToggle: onToggle, renderItem: renderItem, getItemId: getItemId, getItemChildren: getItemChildren, renderItemToggleIcon: renderItemToggleIcon, allVisibleItemsIndices: allVisibleItemsIndices, connectorLines: connectorLines }));
|
|
36
36
|
})))));
|
|
37
37
|
};
|
|
38
38
|
export default InternalTreeView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../src/tree-view/internal.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,gBAAgB,MAAM,aA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-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { getBaseProps } from '../internal/base-component';\nimport { fireNonCancelableEvent } from '../internal/events';\nimport { InternalBaseComponentProps } from '../internal/hooks/use-base-component';\nimport { useControllable } from '../internal/hooks/use-controllable';\nimport { TreeViewProps } from './interfaces';\nimport { KeyboardNavigationProvider } from './keyboard-navigation';\nimport InternalTreeItem from './tree-item';\nimport { getAllVisibleItemsIndices } from './utils';\n\nimport styles from './styles.css.js';\nimport testUtilStyles from './test-classes/styles.css.js';\n\ntype InternalTreeViewProps<T> = TreeViewProps<T> & InternalBaseComponentProps;\n\nconst InternalTreeView = <T,>({\n expandedItems: controlledExpandedItems,\n items,\n renderItem,\n getItemId,\n getItemChildren,\n onItemToggle,\n renderItemToggleIcon,\n ariaLabel,\n ariaLabelledby,\n ariaDescribedby,\n connectorLines,\n i18nStrings,\n __internalRootRef,\n ...rest\n}: InternalTreeViewProps<T>) => {\n const baseProps = getBaseProps(rest);\n\n const [expandedItems, setExpandedItems] = useControllable(controlledExpandedItems, onItemToggle, [], {\n componentName: 'TreeView',\n controlledProp: 'expandedItems',\n changeHandler: 'onItemToggle',\n });\n const treeViewRefObject = useRef(null);\n\n const allVisibleItemsIndices = getAllVisibleItemsIndices({ items, expandedItems, getItemId, getItemChildren });\n\n const onToggle = ({ id, item, expanded }: TreeViewProps.ItemToggleDetail<T>) => {\n if (expanded) {\n setExpandedItems([...(expandedItems || []), id]);\n } else {\n setExpandedItems((expandedItems || []).filter(expandedId => expandedId !== id));\n }\n fireNonCancelableEvent(onItemToggle, { id, item, expanded });\n };\n\n return (\n <div {...baseProps} ref={__internalRootRef} className={clsx(baseProps.className, styles.root, testUtilStyles.root)}>\n <KeyboardNavigationProvider getTreeView={() => treeViewRefObject.current}>\n <ul\n role=\"tree\"\n ref={treeViewRefObject}\n className={clsx(styles.tree, testUtilStyles.tree)}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n >\n {items.map((item, index) => {\n const itemId = getItemId(item, index);\n return (\n <InternalTreeItem<T>\n key={itemId}\n item={item}\n level={1}\n index={index}\n expandedItems={expandedItems}\n i18nStrings={i18nStrings}\n onItemToggle={onToggle}\n renderItem={renderItem}\n getItemId={getItemId}\n getItemChildren={getItemChildren}\n renderItemToggleIcon={renderItemToggleIcon}\n allVisibleItemsIndices={allVisibleItemsIndices}\n connectorLines={connectorLines}\n />\n );\n })}\n </ul>\n </KeyboardNavigationProvider>\n </div>\n );\n};\n\nexport default InternalTreeView;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TreeViewProps } from '../interfaces';
|
|
2
|
-
interface InternalTreeItemProps<T> extends Pick<TreeViewProps, 'expandedItems' | 'renderItem' | 'getItemId' | 'getItemChildren' | 'renderItemToggleIcon' | 'i18nStrings'> {
|
|
2
|
+
interface InternalTreeItemProps<T> extends Pick<TreeViewProps, 'expandedItems' | 'renderItem' | 'getItemId' | 'getItemChildren' | 'renderItemToggleIcon' | 'i18nStrings' | 'connectorLines'> {
|
|
3
3
|
item: T;
|
|
4
4
|
index: number;
|
|
5
5
|
level: number;
|
|
@@ -8,6 +8,6 @@ interface InternalTreeItemProps<T> extends Pick<TreeViewProps, 'expandedItems' |
|
|
|
8
8
|
[key: string]: number;
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
|
-
declare const InternalTreeItem: <T>({ item, index, level, i18nStrings, expandedItems, renderItemToggleIcon, renderItem, getItemId, getItemChildren, onItemToggle, allVisibleItemsIndices, }: InternalTreeItemProps<T>) => JSX.Element;
|
|
11
|
+
declare const InternalTreeItem: <T>({ item, index, level, i18nStrings, expandedItems, connectorLines, renderItemToggleIcon, renderItem, getItemId, getItemChildren, onItemToggle, allVisibleItemsIndices, }: InternalTreeItemProps<T>) => JSX.Element;
|
|
12
12
|
export default InternalTreeItem;
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tree-view/tree-item/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tree-view/tree-item/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAO9C,UAAU,qBAAqB,CAAC,CAAC,CAC/B,SAAQ,IAAI,CACV,aAAa,EACX,eAAe,GACf,YAAY,GACZ,WAAW,GACX,iBAAiB,GACjB,sBAAsB,GACtB,aAAa,GACb,gBAAgB,CACnB;IACD,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IAClE,sBAAsB,EAAE;QACtB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACvB,CAAC;CACH;AAED,QAAA,MAAM,gBAAgB,GAAI,CAAC,EAAG,yKAa3B,qBAAqB,CAAC,CAAC,CAAC,gBA0G1B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -6,10 +6,11 @@ import { useInternalI18n } from '../../i18n/context';
|
|
|
6
6
|
import { ExpandToggleButton } from '../../internal/components/expand-toggle-button';
|
|
7
7
|
import InternalStructuredItem from '../../internal/components/structured-item';
|
|
8
8
|
import { joinStrings } from '../../internal/utils/strings';
|
|
9
|
+
import VerticalConnector from '../vertical-connector';
|
|
9
10
|
import FocusTarget from './focus-target';
|
|
10
11
|
import testUtilStyles from '../test-classes/styles.css.js';
|
|
11
12
|
import styles from './styles.css.js';
|
|
12
|
-
const InternalTreeItem = ({ item, index, level, i18nStrings, expandedItems = [], renderItemToggleIcon, renderItem, getItemId, getItemChildren, onItemToggle, allVisibleItemsIndices, }) => {
|
|
13
|
+
const InternalTreeItem = ({ item, index, level, i18nStrings, expandedItems = [], connectorLines, renderItemToggleIcon, renderItem, getItemId, getItemChildren, onItemToggle, allVisibleItemsIndices, }) => {
|
|
13
14
|
var _a, _b;
|
|
14
15
|
const i18n = useInternalI18n('tree-view');
|
|
15
16
|
const { icon, content, secondaryContent, actions, announcementLabel } = renderItem(item, index);
|
|
@@ -18,6 +19,7 @@ const InternalTreeItem = ({ item, index, level, i18nStrings, expandedItems = [],
|
|
|
18
19
|
const isExpandable = children.length > 0;
|
|
19
20
|
const isExpanded = isExpandable && expandedItems.includes(id);
|
|
20
21
|
const nextLevel = level + 1;
|
|
22
|
+
const showVerticalConnectorLines = connectorLines === 'vertical' && isExpanded;
|
|
21
23
|
let customIcon = undefined;
|
|
22
24
|
if (isExpandable && renderItemToggleIcon) {
|
|
23
25
|
customIcon = renderItemToggleIcon({ expanded: isExpanded });
|
|
@@ -31,12 +33,15 @@ const InternalTreeItem = ({ item, index, level, i18nStrings, expandedItems = [],
|
|
|
31
33
|
React.createElement("div", { className: styles['treeitem-content-wrapper'] },
|
|
32
34
|
React.createElement("div", { className: styles['expand-toggle-wrapper'] },
|
|
33
35
|
React.createElement("div", { className: styles.toggle }, isExpandable ? (React.createElement(ExpandToggleButton, { isExpanded: isExpanded, customIcon: customIcon, expandButtonLabel: joinStrings(i18n('i18nStrings.expandButtonLabel', (_a = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.expandButtonLabel) === null || _a === void 0 ? void 0 : _a.call(i18nStrings, item)), itemLabelToAnnounce), collapseButtonLabel: joinStrings(i18n('i18nStrings.collapseButtonLabel', (_b = i18nStrings === null || i18nStrings === void 0 ? void 0 : i18nStrings.collapseButtonLabel) === null || _b === void 0 ? void 0 : _b.call(i18nStrings, item)), itemLabelToAnnounce), onExpandableItemToggle: () => onItemToggle({ id, item, expanded: !isExpanded }), className: styles['tree-item-focus-target'], disableFocusHighlight: true })) : (React.createElement(FocusTarget, { ariaLabel: itemLabelToAnnounce })))),
|
|
36
|
+
showVerticalConnectorLines && React.createElement(VerticalConnector, { variant: "grid" }),
|
|
34
37
|
React.createElement("div", { className: styles['structured-item-wrapper'] },
|
|
35
38
|
React.createElement(InternalStructuredItem, { icon: icon, content: content, secondaryContent: secondaryContent, actions: actions, wrapActions: false, className: styles['tree-item-structured-item'] }))),
|
|
36
|
-
isExpanded && children.length && (React.createElement("ul", { role: "group", className: styles['treeitem-group'] },
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
isExpanded && children.length && (React.createElement("ul", { role: "group", className: styles['treeitem-group'] },
|
|
40
|
+
children.map((child, index) => {
|
|
41
|
+
const itemId = getItemId(child, index);
|
|
42
|
+
return (React.createElement(InternalTreeItem, { item: child, index: index, key: itemId, level: nextLevel, expandedItems: expandedItems, i18nStrings: i18nStrings, onItemToggle: onItemToggle, renderItem: renderItem, getItemId: getItemId, getItemChildren: getItemChildren, renderItemToggleIcon: renderItemToggleIcon, allVisibleItemsIndices: allVisibleItemsIndices, connectorLines: connectorLines }));
|
|
43
|
+
}),
|
|
44
|
+
showVerticalConnectorLines && React.createElement(VerticalConnector, { variant: "absolute" })))));
|
|
40
45
|
};
|
|
41
46
|
export default InternalTreeItem;
|
|
42
47
|
//# sourceMappingURL=index.js.map
|