@salesforcedevs/dx-components 1.40.5-topic-alpha.1 → 1.40.5-topic-alpha.3
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/package.json +1 -1
- package/src/modules/dx/button/button.css +43 -1
- package/src/modules/dx/checkboxGroup/checkboxGroup.css +5 -0
- package/src/modules/dx/dropdown/dropdown.css +33 -22
- package/src/modules/dx/dropdown/dropdown.ts +2 -1
- package/src/modules/dx/dropdownOption/dropdownOption.css +36 -46
- package/src/modules/dx/dropdownOption/dropdownOption.html +23 -6
- package/src/modules/dx/dropdownOption/dropdownOption.ts +1 -6
- package/src/modules/dx/sidebarFooterNav/sidebarFooterNav.css +0 -2
- package/src/modules/dx/tabPanelList/tabPanelList.css +0 -14
- package/src/modules/dx/tabPanelList/tabPanelList.html +10 -19
- package/src/modules/dx/tabPanelList/tabPanelList.ts +24 -4
- package/src/modules/dxHelpers/commonSidebar/commonSidebar.css +18 -16
package/package.json
CHANGED
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
--dx-c-button-line-height: inherit;
|
|
21
21
|
--dx-c-button-letter-spacing: inherit;
|
|
22
22
|
--dx-c-button-display: flex;
|
|
23
|
+
|
|
24
|
+
/* Keyboard focus ring (WES): a 2px white band, then a 2px blue outline. */
|
|
25
|
+
--dx-c-button-focus-outline: 2px solid var(--dx-g-blue-vibrant-60);
|
|
26
|
+
--dx-c-button-focus-offset: 2px;
|
|
27
|
+
--dx-c-button-focus-shadow: 0 0 0 2px white;
|
|
23
28
|
}
|
|
24
29
|
|
|
25
30
|
.button {
|
|
@@ -32,7 +37,8 @@
|
|
|
32
37
|
user-select: none;
|
|
33
38
|
white-space: nowrap;
|
|
34
39
|
font-size: var(--dx-c-button-font-size);
|
|
35
|
-
transition: var(--dx-g-transition-hue-1x)
|
|
40
|
+
transition: var(--dx-g-transition-hue-1x),
|
|
41
|
+
var(--dx-g-transition-box-shadow-1x);
|
|
36
42
|
padding: var(--dx-c-button-vertical-spacing, 0)
|
|
37
43
|
var(--dx-c-button-horizontal-spacing, var(--dx-g-spacing-md));
|
|
38
44
|
border-radius: var(--dx-g-spacing-xs);
|
|
@@ -191,6 +197,7 @@
|
|
|
191
197
|
}
|
|
192
198
|
|
|
193
199
|
.button.variant_primary:hover,
|
|
200
|
+
.button.variant_primary:focus-visible,
|
|
194
201
|
:host([aria-expanded="true"]) .button.variant_primary {
|
|
195
202
|
background: var(--dx-c-button-primary-color-hover);
|
|
196
203
|
border-color: var(--dx-c-button-primary-color-hover);
|
|
@@ -215,6 +222,8 @@
|
|
|
215
222
|
|
|
216
223
|
.button.variant_secondary:hover,
|
|
217
224
|
.button.variant_quaternary:hover,
|
|
225
|
+
.button.variant_secondary:focus-visible,
|
|
226
|
+
.button.variant_quaternary:focus-visible,
|
|
218
227
|
:host([aria-expanded="true"]) .button.variant_secondary,
|
|
219
228
|
:host([aria-expanded="true"]) .button.variant_quaternary {
|
|
220
229
|
background: var(--dx-c-button-secondary-color-hover);
|
|
@@ -234,6 +243,7 @@
|
|
|
234
243
|
}
|
|
235
244
|
|
|
236
245
|
.button.variant_tertiary:hover,
|
|
246
|
+
.button.variant_tertiary:focus-visible,
|
|
237
247
|
:host([aria-expanded="true"]) .button.variant_tertiary {
|
|
238
248
|
background: var(--dx-c-button-secondary-color-hover);
|
|
239
249
|
border-color: var(--dx-c-button-secondary-color-hover);
|
|
@@ -250,6 +260,8 @@
|
|
|
250
260
|
|
|
251
261
|
.button.variant_inline:hover,
|
|
252
262
|
.button.variant_inline-inherit:hover,
|
|
263
|
+
.button.variant_inline:focus-visible,
|
|
264
|
+
.button.variant_inline-inherit:focus-visible,
|
|
253
265
|
:host([aria-expanded="true"])
|
|
254
266
|
:is(.button.variant_inline, .button.variant_inline-inherit) {
|
|
255
267
|
color: var(--dx-c-button-inline-color-hover);
|
|
@@ -277,10 +289,40 @@
|
|
|
277
289
|
}
|
|
278
290
|
|
|
279
291
|
.button.variant_custom:hover,
|
|
292
|
+
.button.variant_custom:focus-visible,
|
|
280
293
|
.button.variant_icon-only:hover,
|
|
294
|
+
.button.variant_icon-only:focus-visible,
|
|
281
295
|
:host([aria-expanded="true"]) .button.variant_custom,
|
|
282
296
|
:host([aria-expanded="true"]) .button.variant_icon-only {
|
|
283
297
|
color: var(--dx-c-button-custom-color-hover);
|
|
284
298
|
background: var(--dx-c-button-custom-background-hover);
|
|
285
299
|
border-color: var(--dx-c-button-custom-border-hover);
|
|
300
|
+
|
|
301
|
+
/* An inset shadow can thicken the edge without resizing the button. */
|
|
302
|
+
box-shadow: var(--dx-c-button-custom-border-shadow-hover, none);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/* While its menu is open, a custom button can show the focus ring. Off unless
|
|
306
|
+
the active hooks are set (a select-style trigger, such as the version picker). */
|
|
307
|
+
:host([aria-expanded="true"]) .button.variant_custom {
|
|
308
|
+
outline: var(--dx-c-button-custom-focus-outline-active, none);
|
|
309
|
+
outline-offset: var(--dx-c-button-custom-focus-offset-active, 0);
|
|
310
|
+
box-shadow: var(
|
|
311
|
+
--dx-c-button-custom-focus-shadow-active,
|
|
312
|
+
var(--dx-c-button-custom-border-shadow-hover, none)
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/* Keyboard focus. Keep last so it wins over hover and the open state (:host
|
|
317
|
+
lifts it above the custom and icon-only hover rules). The
|
|
318
|
+
outline survives Windows high-contrast mode; the white band does not. */
|
|
319
|
+
:host .button:focus-visible,
|
|
320
|
+
:host .button:focus-visible:hover,
|
|
321
|
+
:host([aria-expanded="true"]) .button:focus-visible {
|
|
322
|
+
outline: var(--dx-c-button-focus-outline);
|
|
323
|
+
outline-offset: var(--dx-c-button-focus-offset);
|
|
324
|
+
box-shadow: var(--dx-c-button-focus-shadow);
|
|
325
|
+
|
|
326
|
+
/* The ring appears at once instead of fading in. */
|
|
327
|
+
transition: var(--dx-g-transition-hue-1x);
|
|
286
328
|
}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
@import "dxHelpers/reset";
|
|
2
2
|
|
|
3
|
+
/* Options run edge to edge; the menu adds space above the first and below
|
|
4
|
+
the last. */
|
|
5
|
+
dx-popover {
|
|
6
|
+
--dx-c-popover-padding: var(
|
|
7
|
+
--dx-c-dropdown-padding,
|
|
8
|
+
var(--dx-g-spacing-sm) 0
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
|
|
3
12
|
.menu-nested:not(.menu-fit-content)::part(content) {
|
|
4
13
|
padding-top: var(--dx-g-spacing-sm);
|
|
5
14
|
width: 354px;
|
|
@@ -14,30 +23,31 @@
|
|
|
14
23
|
display: none;
|
|
15
24
|
}
|
|
16
25
|
|
|
17
|
-
/*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
/* fit-content and fit-end: the menu is as wide as its longest label. */
|
|
27
|
+
.menu-fit-content {
|
|
28
|
+
--dx-c-popover-width: max-content;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* fit-end also stops at --dx-c-dropdown-menu-max-width. Labels wrap only once
|
|
32
|
+
the menu reaches that width. */
|
|
33
|
+
.menu-fit-end::part(content) {
|
|
21
34
|
box-sizing: border-box;
|
|
22
|
-
width: max-content;
|
|
23
35
|
max-width: var(
|
|
24
36
|
--dx-c-dropdown-menu-max-width,
|
|
25
37
|
calc(100vw - var(--dx-g-spacing-lg))
|
|
26
38
|
);
|
|
27
39
|
}
|
|
28
40
|
|
|
29
|
-
.menu-fit-content {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
--dx-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
ellipsis
|
|
40
|
-
);
|
|
41
|
+
.menu-fit-content.menu-nested .menu_list {
|
|
42
|
+
width: 100%;
|
|
43
|
+
align-items: flex-start;
|
|
44
|
+
gap: var(--dx-g-spacing-sm);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.menu-fit-content.menu-nested .menu_option:not(:first-child) {
|
|
48
|
+
border-top: var(--border);
|
|
49
|
+
margin-top: 0;
|
|
50
|
+
padding-top: var(--dx-g-spacing-sm);
|
|
41
51
|
}
|
|
42
52
|
|
|
43
53
|
@media screen and (max-width: 1000px) {
|
|
@@ -91,12 +101,13 @@
|
|
|
91
101
|
|
|
92
102
|
.menu_heading {
|
|
93
103
|
display: block;
|
|
94
|
-
|
|
95
|
-
|
|
104
|
+
margin: 0;
|
|
105
|
+
padding: var(--dx-g-spacing-smd) var(--dx-g-spacing-lg);
|
|
106
|
+
color: var(--dx-g-gray-10);
|
|
107
|
+
font-family: var(--dx-g-font-sans);
|
|
96
108
|
font-size: var(--dx-g-text-sm);
|
|
97
109
|
font-weight: bold;
|
|
98
|
-
|
|
99
|
-
margin: var(--dx-g-spacing-sm);
|
|
110
|
+
line-height: var(--dx-g-spacing-mlg);
|
|
100
111
|
}
|
|
101
112
|
|
|
102
113
|
.callout_link {
|
|
@@ -105,7 +116,7 @@
|
|
|
105
116
|
display: block;
|
|
106
117
|
padding-top: var(--dx-g-spacing-xl);
|
|
107
118
|
margin-top: auto;
|
|
108
|
-
margin-left: var(--dx-g-spacing-
|
|
119
|
+
margin-left: var(--dx-g-spacing-lg);
|
|
109
120
|
}
|
|
110
121
|
|
|
111
122
|
.empty {
|
|
@@ -119,7 +119,8 @@ export default class Dropdown extends LightningElement {
|
|
|
119
119
|
"menu-nested-2-col",
|
|
120
120
|
this.offset && `menu-offset-${this.offset}`,
|
|
121
121
|
this.areOptionsEmpty && "menu-hidden",
|
|
122
|
-
fitContent && "menu-fit-content"
|
|
122
|
+
fitContent && "menu-fit-content",
|
|
123
|
+
this.widthMode === "fit-end" && "menu-fit-end"
|
|
123
124
|
);
|
|
124
125
|
}
|
|
125
126
|
|
|
@@ -25,14 +25,12 @@
|
|
|
25
25
|
display: flex;
|
|
26
26
|
font-family: var(--dx-g-font-sans);
|
|
27
27
|
width: 100%;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
font-size: var(--dx-g-text-sm);
|
|
32
|
-
border-radius: var(
|
|
33
|
-
--dx-c-dropdown-option-border-radius,
|
|
34
|
-
var(--dx-g-spacing-xs)
|
|
28
|
+
padding: var(
|
|
29
|
+
--dx-c-dropdown-option-padding,
|
|
30
|
+
var(--dx-g-spacing-sm) var(--dx-g-spacing-lg)
|
|
35
31
|
);
|
|
32
|
+
font-size: var(--dx-g-text-sm);
|
|
33
|
+
border-radius: var(--dx-c-dropdown-option-border-radius, 0);
|
|
36
34
|
transition: var(--dx-g-transition-hue-1x);
|
|
37
35
|
align-items: center;
|
|
38
36
|
outline: none !important;
|
|
@@ -53,8 +51,6 @@
|
|
|
53
51
|
}
|
|
54
52
|
|
|
55
53
|
.option-active {
|
|
56
|
-
--dx-c-dropdown-option-label-color: var(--dx-g-blue-vibrant-50);
|
|
57
|
-
|
|
58
54
|
background: var(--dx-g-cloud-blue-vibrant-95);
|
|
59
55
|
}
|
|
60
56
|
|
|
@@ -62,27 +58,33 @@
|
|
|
62
58
|
display: flex;
|
|
63
59
|
flex-direction: column;
|
|
64
60
|
justify-content: center;
|
|
61
|
+
align-items: flex-start;
|
|
62
|
+
gap: var(--dx-g-spacing-sm);
|
|
63
|
+
flex: 1;
|
|
64
|
+
min-width: 0;
|
|
65
65
|
font-family: var(--dx-g-font-sans);
|
|
66
66
|
font-size: var(--dx-g-text-sm);
|
|
67
67
|
text-align: left;
|
|
68
|
-
|
|
69
|
-
/* Opt-in: set to 0 to let a long label truncate instead of overflow. */
|
|
70
|
-
min-width: var(--dx-c-dropdown-option-min-width, auto);
|
|
71
68
|
}
|
|
72
69
|
|
|
73
70
|
.option-indented .option_details {
|
|
74
71
|
align-items: center;
|
|
75
72
|
flex-direction: row;
|
|
73
|
+
gap: 0;
|
|
76
74
|
}
|
|
77
75
|
|
|
78
76
|
.option_label {
|
|
79
|
-
color: var(--dx-c-dropdown-option-label-color, var(--dx-g-
|
|
77
|
+
color: var(--dx-c-dropdown-option-label-color, var(--dx-g-text-body-color));
|
|
80
78
|
|
|
81
79
|
/* Opt-in: set to block so text-overflow:ellipsis applies (ignored on flex). */
|
|
82
80
|
display: var(--dx-c-dropdown-option-label-display, flex);
|
|
83
81
|
align-items: center;
|
|
84
|
-
font-weight: var(
|
|
82
|
+
font-weight: var(
|
|
83
|
+
--dx-c-dropdown-option-font-weight,
|
|
84
|
+
var(--dx-g-font-normal)
|
|
85
|
+
);
|
|
85
86
|
font-size: var(--dx-c-dropdown-option-font-size, var(--dx-g-text-base));
|
|
87
|
+
line-height: var(--dx-g-spacing-lg);
|
|
86
88
|
|
|
87
89
|
/* Opt-in truncation: consumers set --dx-c-dropdown-option-white-space:
|
|
88
90
|
nowrap to truncate labels with an ellipsis instead of wrapping.
|
|
@@ -107,65 +109,53 @@
|
|
|
107
109
|
|
|
108
110
|
.option_description {
|
|
109
111
|
color: var(--dx-g-gray-30);
|
|
110
|
-
margin-top: var(--dx-g-spacing-xs);
|
|
111
112
|
line-height: 18px;
|
|
112
113
|
}
|
|
113
114
|
|
|
115
|
+
/* An option can have a start icon (iconSymbol), an end icon (endIconSymbol),
|
|
116
|
+
or both. */
|
|
114
117
|
.option_icon {
|
|
115
|
-
|
|
118
|
+
--dx-c-icon-size: var(--dx-g-icon-size-md);
|
|
119
|
+
--dx-c-icon-color: var(--dx-g-gray-50);
|
|
120
|
+
|
|
116
121
|
flex-shrink: 0;
|
|
117
122
|
}
|
|
118
123
|
|
|
119
|
-
.
|
|
120
|
-
|
|
121
|
-
padding-bottom: var(--dx-g-spacing-xs);
|
|
124
|
+
.option_icon-start {
|
|
125
|
+
margin-right: var(--dx-g-spacing-md);
|
|
122
126
|
}
|
|
123
127
|
|
|
124
|
-
.
|
|
125
|
-
|
|
126
|
-
padding: var(--dx-g-spacing-sm) var(--dx-g-spacing-lg);
|
|
128
|
+
.option_icon-end {
|
|
129
|
+
margin-left: var(--dx-g-spacing-2xl);
|
|
127
130
|
}
|
|
128
131
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
min-width: 0;
|
|
133
|
-
flex: 1;
|
|
132
|
+
/* Indented (breadcrumb hierarchy) menus keep their own selected label color. */
|
|
133
|
+
.option-indented.option-active {
|
|
134
|
+
--dx-c-dropdown-option-label-color: var(--dx-g-blue-vibrant-50);
|
|
134
135
|
}
|
|
135
136
|
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
/* fit-content (toolbar): one line per label, truncated with an ellipsis. */
|
|
138
|
+
.option-fit-content {
|
|
139
|
+
min-width: 0;
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
.option-fit-content .option_label {
|
|
141
143
|
display: block;
|
|
142
|
-
color: var(--dx-g-gray-10);
|
|
143
|
-
font-weight: var(--dx-g-font-normal);
|
|
144
|
-
line-height: var(--dx-g-spacing-lg);
|
|
145
144
|
white-space: nowrap;
|
|
146
145
|
overflow: hidden;
|
|
147
146
|
text-overflow: ellipsis;
|
|
148
147
|
max-width: calc(100vw - var(--dx-g-spacing-lg) * 4);
|
|
149
148
|
}
|
|
150
149
|
|
|
151
|
-
.option-fit-content.option-active .option_label {
|
|
152
|
-
color: var(--dx-g-blue-vibrant-50);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.option-fit-content .option_icon {
|
|
156
|
-
--dx-c-icon-size: var(--dx-g-icon-size-md);
|
|
157
|
-
--dx-c-icon-color: var(--dx-g-gray-50);
|
|
158
|
-
|
|
159
|
-
order: 1;
|
|
160
|
-
margin-right: 0;
|
|
161
|
-
margin-left: var(--dx-g-spacing-2xl);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
150
|
.option-indented:not([data-index="0"]) {
|
|
165
151
|
--base-indentation: calc(var(--dx-g-spacing-md) + var(--shape-width));
|
|
166
152
|
--shape-width: 8px;
|
|
167
153
|
|
|
168
|
-
|
|
154
|
+
/* One sm step past the first option's lg left padding. */
|
|
155
|
+
padding-left: calc(
|
|
156
|
+
var(--indentation, 0px) + var(--dx-g-spacing-lg) +
|
|
157
|
+
var(--dx-g-spacing-sm)
|
|
158
|
+
);
|
|
169
159
|
}
|
|
170
160
|
|
|
171
161
|
[data-index="2"] {
|
|
@@ -11,11 +11,12 @@
|
|
|
11
11
|
onclick={onClick}
|
|
12
12
|
>
|
|
13
13
|
<dx-icon
|
|
14
|
-
class="option_icon"
|
|
14
|
+
class="option_icon option_icon-start"
|
|
15
15
|
symbol={option.iconSymbol}
|
|
16
16
|
sprite={option.iconSprite}
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
color={option.iconColor}
|
|
18
|
+
lwc:if={option.iconSymbol}
|
|
19
|
+
size="override"
|
|
19
20
|
></dx-icon>
|
|
20
21
|
<div class="option_details">
|
|
21
22
|
<div if:true={renderIndentedShape} class="indented-shape"></div>
|
|
@@ -30,6 +31,14 @@
|
|
|
30
31
|
{option.description}
|
|
31
32
|
</div>
|
|
32
33
|
</div>
|
|
34
|
+
<dx-icon
|
|
35
|
+
class="option_icon option_icon-end"
|
|
36
|
+
symbol={option.endIconSymbol}
|
|
37
|
+
sprite={option.endIconSprite}
|
|
38
|
+
color={option.endIconColor}
|
|
39
|
+
lwc:if={option.endIconSymbol}
|
|
40
|
+
size="override"
|
|
41
|
+
></dx-icon>
|
|
33
42
|
</a>
|
|
34
43
|
<button
|
|
35
44
|
if:false={option.link}
|
|
@@ -40,12 +49,12 @@
|
|
|
40
49
|
onclick={onClick}
|
|
41
50
|
>
|
|
42
51
|
<dx-icon
|
|
43
|
-
class="option_icon"
|
|
52
|
+
class="option_icon option_icon-start"
|
|
44
53
|
symbol={option.iconSymbol}
|
|
45
54
|
sprite={option.iconSprite}
|
|
46
55
|
color={option.iconColor}
|
|
47
|
-
if
|
|
48
|
-
size=
|
|
56
|
+
lwc:if={option.iconSymbol}
|
|
57
|
+
size="override"
|
|
49
58
|
></dx-icon>
|
|
50
59
|
<div class="option_details">
|
|
51
60
|
<div if:true={renderIndentedShape} class="indented-shape"></div>
|
|
@@ -54,5 +63,13 @@
|
|
|
54
63
|
{option.description}
|
|
55
64
|
</div>
|
|
56
65
|
</div>
|
|
66
|
+
<dx-icon
|
|
67
|
+
class="option_icon option_icon-end"
|
|
68
|
+
symbol={option.endIconSymbol}
|
|
69
|
+
sprite={option.endIconSprite}
|
|
70
|
+
color={option.endIconColor}
|
|
71
|
+
lwc:if={option.endIconSymbol}
|
|
72
|
+
size="override"
|
|
73
|
+
></dx-icon>
|
|
57
74
|
</button>
|
|
58
75
|
</template>
|
|
@@ -4,8 +4,7 @@ import {
|
|
|
4
4
|
OptionWithNested,
|
|
5
5
|
AnalyticsPayload,
|
|
6
6
|
DropdownVariant,
|
|
7
|
-
DropdownWidthMode
|
|
8
|
-
IconSize
|
|
7
|
+
DropdownWidthMode
|
|
9
8
|
} from "typings/custom";
|
|
10
9
|
import { track } from "dxUtils/analytics";
|
|
11
10
|
|
|
@@ -41,10 +40,6 @@ export default class DropdownOption extends LightningElement {
|
|
|
41
40
|
return this.variant === "indented" && this.indexPosition >= 1;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
private get optionIconSize(): IconSize {
|
|
45
|
-
return this.widthMode === "fit-content" ? "override" : "large";
|
|
46
|
-
}
|
|
47
|
-
|
|
48
43
|
private onClick(e: PointerEvent) {
|
|
49
44
|
this.dispatchEvent(
|
|
50
45
|
new CustomEvent("select", { detail: this.keyValue })
|
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
--button-primary-color-hover: var(--dx-g-cloud-blue-vibrant-95);
|
|
6
6
|
--popover-container-open-transform: translateX(-4px) translateY(-8px);
|
|
7
7
|
--popover-transition: none;
|
|
8
|
-
--dx-c-dropdown-option-font-weight: normal;
|
|
9
|
-
--dx-c-dropdown-option-label-color: var(--dx-g-gray-10);
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
.footer-item {
|
|
@@ -12,20 +12,6 @@
|
|
|
12
12
|
border-bottom: 1px solid var(--dx-g-gray-80);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
dx-popover {
|
|
16
|
-
--popover-padding: none;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.dropdown-item {
|
|
20
|
-
padding: var(--dx-g-spacing-sm);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.dropdown-item:hover {
|
|
24
|
-
cursor: pointer;
|
|
25
|
-
font-weight: var(--dx-g-font-bold);
|
|
26
|
-
background-color: var(--dx-g-blue-vibrant-95);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
15
|
.more-btn {
|
|
30
16
|
display: flex;
|
|
31
17
|
align-items: center;
|
|
@@ -15,11 +15,18 @@
|
|
|
15
15
|
</dx-tab-panel-item>
|
|
16
16
|
</template>
|
|
17
17
|
</div>
|
|
18
|
-
<dx-
|
|
18
|
+
<dx-dropdown
|
|
19
|
+
class="more-dropdown"
|
|
20
|
+
offset="medium"
|
|
21
|
+
placement="bottom-end"
|
|
22
|
+
width-mode="fit-content"
|
|
23
|
+
options={dropdownOptions}
|
|
24
|
+
value={activeOptionId}
|
|
25
|
+
onchange={onDropdownChange}
|
|
26
|
+
>
|
|
19
27
|
<dx-tab-panel-item
|
|
20
28
|
role="button"
|
|
21
29
|
class="more-btn-container"
|
|
22
|
-
slot="control"
|
|
23
30
|
tab-label="More"
|
|
24
31
|
>
|
|
25
32
|
<div class="more-btn">
|
|
@@ -31,23 +38,7 @@
|
|
|
31
38
|
></dx-icon>
|
|
32
39
|
</div>
|
|
33
40
|
</dx-tab-panel-item>
|
|
34
|
-
|
|
35
|
-
<template for:each={dropdownItems} for:item="dropdownItem">
|
|
36
|
-
<div
|
|
37
|
-
role="button"
|
|
38
|
-
onclick={onDropdownItemClick}
|
|
39
|
-
onkeydown={onDropdownItemClick}
|
|
40
|
-
data-value={dropdownItem.index}
|
|
41
|
-
key={dropdownItem.label}
|
|
42
|
-
class="dropdown-item"
|
|
43
|
-
tabindex="0"
|
|
44
|
-
tab-label={dropdownItem.label}
|
|
45
|
-
>
|
|
46
|
-
{dropdownItem.label}
|
|
47
|
-
</div>
|
|
48
|
-
</template>
|
|
49
|
-
</div>
|
|
50
|
-
</dx-popover>
|
|
41
|
+
</dx-dropdown>
|
|
51
42
|
</div>
|
|
52
43
|
<div part="tabpanels">
|
|
53
44
|
<slot onslotchange={onSlotChange}></slot>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
|
-
import { LightningSlotElement, Tab } from "typings/custom";
|
|
2
|
+
import { LightningSlotElement, Option, Tab } from "typings/custom";
|
|
3
3
|
import { toJson } from "dxUtils/normalizers";
|
|
4
4
|
import { uniqueId } from "./uniqueId";
|
|
5
5
|
export default class TabPanelList extends LightningElement {
|
|
@@ -33,7 +33,6 @@ export default class TabPanelList extends LightningElement {
|
|
|
33
33
|
private _activeIndex?: number;
|
|
34
34
|
private groupId: string = uniqueId();
|
|
35
35
|
private tabSlotPanels?: LightningSlotElement;
|
|
36
|
-
private showPopover: boolean = true;
|
|
37
36
|
private dropdownItems: Tab[] = [];
|
|
38
37
|
private hasRendered: boolean = false;
|
|
39
38
|
|
|
@@ -74,8 +73,25 @@ export default class TabPanelList extends LightningElement {
|
|
|
74
73
|
this.activeIndex = e.detail;
|
|
75
74
|
}
|
|
76
75
|
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
// Tabs that don't fit are listed in the "More" dropdown. Option ids are the
|
|
77
|
+
// tab index as a string.
|
|
78
|
+
private get dropdownOptions(): Option[] {
|
|
79
|
+
return this.dropdownItems.map((item) => ({
|
|
80
|
+
id: String(item.index),
|
|
81
|
+
label: item.label || ""
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
private get activeOptionId(): string {
|
|
86
|
+
return String(this.activeIndex);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
private onDropdownChange(e: CustomEvent<string>) {
|
|
90
|
+
this.onTabClick({ detail: +e.detail });
|
|
91
|
+
// The menu closes after a pick; keep keyboard focus on its trigger.
|
|
92
|
+
(
|
|
93
|
+
this.template.querySelector(".more-btn-container") as HTMLElement
|
|
94
|
+
)?.focus();
|
|
79
95
|
}
|
|
80
96
|
|
|
81
97
|
private onSlotChange(e: Event) {
|
|
@@ -111,6 +127,10 @@ export default class TabPanelList extends LightningElement {
|
|
|
111
127
|
}
|
|
112
128
|
|
|
113
129
|
private onKeydown = (e: KeyboardEvent) => {
|
|
130
|
+
// Arrow keys inside the open "More" menu belong to the dropdown.
|
|
131
|
+
if ((e.target as HTMLElement).tagName === "DX-DROPDOWN") {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
114
134
|
switch (e.key) {
|
|
115
135
|
case "ArrowLeft": {
|
|
116
136
|
e.preventDefault();
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
@import "dxHelpers/text";
|
|
3
3
|
|
|
4
4
|
:host {
|
|
5
|
-
|
|
5
|
+
/* Width of the sidebar content (search field, version pickers) on tablet
|
|
6
|
+
and desktop. The sidebar adds its left padding and a 24px right inset. */
|
|
7
|
+
--dx-c-sidebar-content-width: 296px;
|
|
6
8
|
--dx-c-sidebar-button-color: var(--dx-g-blue-vibrant-50);
|
|
7
9
|
--dx-c-sidebar-button-background: white;
|
|
8
10
|
--dx-c-sidebar-button-border: white;
|
|
@@ -11,7 +13,9 @@
|
|
|
11
13
|
--dx-c-sidebar-button-border-hover: var(--dx-g-blue-vibrant-50);
|
|
12
14
|
--dx-c-sidebar-left-padding: var(--dx-g-global-header-padding-horizontal);
|
|
13
15
|
--dx-c-sidebar-vertical-padding: var(--dx-g-spacing-md);
|
|
14
|
-
|
|
16
|
+
|
|
17
|
+
/* Widest a small version picker menu can grow. */
|
|
18
|
+
--doc-version-picker-width: var(--dx-c-sidebar-content-width);
|
|
15
19
|
}
|
|
16
20
|
|
|
17
21
|
.header {
|
|
@@ -47,7 +51,7 @@
|
|
|
47
51
|
color: var(--dx-g-blue-vibrant-30);
|
|
48
52
|
}
|
|
49
53
|
|
|
50
|
-
.container.collapsed {
|
|
54
|
+
.container.collapsed:not(.container-mobile) {
|
|
51
55
|
width: var(--dx-g-spacing-xl);
|
|
52
56
|
}
|
|
53
57
|
|
|
@@ -82,15 +86,19 @@
|
|
|
82
86
|
display: flex;
|
|
83
87
|
flex-direction: column;
|
|
84
88
|
height: var(--dx-c-sidebar-height);
|
|
85
|
-
|
|
89
|
+
|
|
90
|
+
/* Mobile (container-mobile, set at 768px and below) fills the viewport. */
|
|
91
|
+
width: 100%;
|
|
86
92
|
}
|
|
87
93
|
|
|
94
|
+
/* Tablet and desktop: left padding + content + right inset. */
|
|
88
95
|
.container:not(.container-mobile) {
|
|
89
96
|
--border-color: transparent;
|
|
90
|
-
--left-spacing: calc(
|
|
91
|
-
var(--dx-c-sidebar-left-padding) - var(--dx-g-spacing-md)
|
|
92
|
-
);
|
|
93
97
|
|
|
98
|
+
width: calc(
|
|
99
|
+
var(--dx-c-sidebar-left-padding) + var(--dx-c-sidebar-content-width) +
|
|
100
|
+
var(--dx-g-spacing-lg)
|
|
101
|
+
);
|
|
94
102
|
box-shadow: 2px 0 0 0 var(--border-color);
|
|
95
103
|
min-height: var(--dx-c-sidebar-min-height);
|
|
96
104
|
padding: var(--dx-c-sidebar-vertical-padding) 0 var(--dx-g-spacing-2xs) 0;
|
|
@@ -106,7 +114,9 @@
|
|
|
106
114
|
}
|
|
107
115
|
|
|
108
116
|
.container.container-mobile {
|
|
109
|
-
width:
|
|
117
|
+
--doc-version-picker-width: calc(
|
|
118
|
+
100vw - var(--dx-c-sidebar-left-padding) - var(--dx-g-spacing-lg)
|
|
119
|
+
);
|
|
110
120
|
}
|
|
111
121
|
|
|
112
122
|
.container.container-mobile .header {
|
|
@@ -169,11 +179,3 @@
|
|
|
169
179
|
.sidebar-content-hasfooter {
|
|
170
180
|
margin-bottom: var(--dx-g-spacing-2xl);
|
|
171
181
|
}
|
|
172
|
-
|
|
173
|
-
@media screen and (max-width: 767px) {
|
|
174
|
-
:host {
|
|
175
|
-
--doc-version-picker-width: calc(
|
|
176
|
-
100vw - var(--dx-c-sidebar-left-padding) - var(--dx-g-spacing-lg)
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
}
|