@salesforcedevs/dx-components 1.40.5-topic-alpha.1 → 1.40.5-topic-alpha.2
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/dropdown/dropdown.css +30 -22
- package/src/modules/dx/dropdown/dropdown.html +2 -0
- package/src/modules/dx/dropdown/dropdown.ts +3 -1
- package/src/modules/dx/dropdownOption/dropdownOption.css +23 -42
- package/src/modules/dx/dropdownOption/dropdownOption.html +4 -4
- package/src/modules/dx/dropdownOption/dropdownOption.ts +5 -4
- package/src/modules/dxHelpers/commonSidebar/commonSidebar.css +8 -2
package/package.json
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
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(--dx-g-spacing-sm) 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
3
9
|
.menu-nested:not(.menu-fit-content)::part(content) {
|
|
4
10
|
padding-top: var(--dx-g-spacing-sm);
|
|
5
11
|
width: 354px;
|
|
@@ -14,30 +20,31 @@
|
|
|
14
20
|
display: none;
|
|
15
21
|
}
|
|
16
22
|
|
|
17
|
-
/*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
/* fit-content and fit-end: the menu is as wide as its longest label. */
|
|
24
|
+
.menu-fit-content {
|
|
25
|
+
--dx-c-popover-width: max-content;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* fit-end also stops at --dx-c-dropdown-menu-max-width. Labels wrap only once
|
|
29
|
+
the menu reaches that width. */
|
|
30
|
+
.menu-fit-end::part(content) {
|
|
21
31
|
box-sizing: border-box;
|
|
22
|
-
width: max-content;
|
|
23
32
|
max-width: var(
|
|
24
33
|
--dx-c-dropdown-menu-max-width,
|
|
25
34
|
calc(100vw - var(--dx-g-spacing-lg))
|
|
26
35
|
);
|
|
27
36
|
}
|
|
28
37
|
|
|
29
|
-
.menu-fit-content {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
--dx-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
ellipsis
|
|
40
|
-
);
|
|
38
|
+
.menu-fit-content.menu-nested .menu_list {
|
|
39
|
+
width: 100%;
|
|
40
|
+
align-items: flex-start;
|
|
41
|
+
gap: var(--dx-g-spacing-sm);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.menu-fit-content.menu-nested .menu_option:not(:first-child) {
|
|
45
|
+
border-top: var(--border);
|
|
46
|
+
margin-top: 0;
|
|
47
|
+
padding-top: var(--dx-g-spacing-sm);
|
|
41
48
|
}
|
|
42
49
|
|
|
43
50
|
@media screen and (max-width: 1000px) {
|
|
@@ -91,12 +98,13 @@
|
|
|
91
98
|
|
|
92
99
|
.menu_heading {
|
|
93
100
|
display: block;
|
|
94
|
-
|
|
95
|
-
|
|
101
|
+
margin: 0;
|
|
102
|
+
padding: var(--dx-g-spacing-smd) var(--dx-g-spacing-lg);
|
|
103
|
+
color: var(--dx-g-gray-10);
|
|
104
|
+
font-family: var(--dx-g-font-sans);
|
|
96
105
|
font-size: var(--dx-g-text-sm);
|
|
97
106
|
font-weight: bold;
|
|
98
|
-
|
|
99
|
-
margin: var(--dx-g-spacing-sm);
|
|
107
|
+
line-height: var(--dx-g-spacing-mlg);
|
|
100
108
|
}
|
|
101
109
|
|
|
102
110
|
.callout_link {
|
|
@@ -105,7 +113,7 @@
|
|
|
105
113
|
display: block;
|
|
106
114
|
padding-top: var(--dx-g-spacing-xl);
|
|
107
115
|
margin-top: auto;
|
|
108
|
-
margin-left: var(--dx-g-spacing-
|
|
116
|
+
margin-left: var(--dx-g-spacing-lg);
|
|
109
117
|
}
|
|
110
118
|
|
|
111
119
|
.empty {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
nav-item-label={navItemLabel}
|
|
36
36
|
variant={variant}
|
|
37
37
|
width-mode={widthMode}
|
|
38
|
+
show-icon={showOptionIcons}
|
|
38
39
|
></dx-dropdown-option>
|
|
39
40
|
<div
|
|
40
41
|
key={option.id}
|
|
@@ -55,6 +56,7 @@
|
|
|
55
56
|
option={suboption}
|
|
56
57
|
nav-item-label={navItemLabel}
|
|
57
58
|
width-mode={widthMode}
|
|
59
|
+
show-icon={showOptionIcons}
|
|
58
60
|
></dx-dropdown-option>
|
|
59
61
|
</template>
|
|
60
62
|
<dx-button
|
|
@@ -39,6 +39,7 @@ export default class Dropdown extends LightningElement {
|
|
|
39
39
|
@api navItemLabel: string | null = null;
|
|
40
40
|
@api variant: DropdownVariant = "base";
|
|
41
41
|
@api widthMode: DropdownWidthMode = "fixed";
|
|
42
|
+
@api showOptionIcons?: boolean = false; // right-aligned option icons (opt-in)
|
|
42
43
|
|
|
43
44
|
// props forwarded to dropdown option
|
|
44
45
|
@api analyticsEvent?: string;
|
|
@@ -119,7 +120,8 @@ export default class Dropdown extends LightningElement {
|
|
|
119
120
|
"menu-nested-2-col",
|
|
120
121
|
this.offset && `menu-offset-${this.offset}`,
|
|
121
122
|
this.areOptionsEmpty && "menu-hidden",
|
|
122
|
-
fitContent && "menu-fit-content"
|
|
123
|
+
fitContent && "menu-fit-content",
|
|
124
|
+
this.widthMode === "fit-end" && "menu-fit-end"
|
|
123
125
|
);
|
|
124
126
|
}
|
|
125
127
|
|
|
@@ -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;
|
|
@@ -62,27 +60,33 @@
|
|
|
62
60
|
display: flex;
|
|
63
61
|
flex-direction: column;
|
|
64
62
|
justify-content: center;
|
|
63
|
+
align-items: flex-start;
|
|
64
|
+
gap: var(--dx-g-spacing-sm);
|
|
65
|
+
flex: 1;
|
|
66
|
+
min-width: 0;
|
|
65
67
|
font-family: var(--dx-g-font-sans);
|
|
66
68
|
font-size: var(--dx-g-text-sm);
|
|
67
69
|
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
70
|
}
|
|
72
71
|
|
|
73
72
|
.option-indented .option_details {
|
|
74
73
|
align-items: center;
|
|
75
74
|
flex-direction: row;
|
|
75
|
+
gap: 0;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
.option_label {
|
|
79
|
-
color: var(--dx-c-dropdown-option-label-color, var(--dx-g-
|
|
79
|
+
color: var(--dx-c-dropdown-option-label-color, var(--dx-g-gray-10));
|
|
80
80
|
|
|
81
81
|
/* Opt-in: set to block so text-overflow:ellipsis applies (ignored on flex). */
|
|
82
82
|
display: var(--dx-c-dropdown-option-label-display, flex);
|
|
83
83
|
align-items: center;
|
|
84
|
-
font-weight: var(
|
|
84
|
+
font-weight: var(
|
|
85
|
+
--dx-c-dropdown-option-font-weight,
|
|
86
|
+
var(--dx-g-font-normal)
|
|
87
|
+
);
|
|
85
88
|
font-size: var(--dx-c-dropdown-option-font-size, var(--dx-g-text-base));
|
|
89
|
+
line-height: var(--dx-g-spacing-lg);
|
|
86
90
|
|
|
87
91
|
/* Opt-in truncation: consumers set --dx-c-dropdown-option-white-space:
|
|
88
92
|
nowrap to truncate labels with an ellipsis instead of wrapping.
|
|
@@ -107,13 +111,17 @@
|
|
|
107
111
|
|
|
108
112
|
.option_description {
|
|
109
113
|
color: var(--dx-g-gray-30);
|
|
110
|
-
margin-top: var(--dx-g-spacing-xs);
|
|
111
114
|
line-height: 18px;
|
|
112
115
|
}
|
|
113
116
|
|
|
117
|
+
/* Only rendered when the dropdown sets show-option-icons. */
|
|
114
118
|
.option_icon {
|
|
115
|
-
|
|
119
|
+
--dx-c-icon-size: var(--dx-g-icon-size-md);
|
|
120
|
+
--dx-c-icon-color: var(--dx-g-gray-50);
|
|
121
|
+
|
|
122
|
+
order: 1;
|
|
116
123
|
flex-shrink: 0;
|
|
124
|
+
margin-left: var(--dx-g-spacing-2xl);
|
|
117
125
|
}
|
|
118
126
|
|
|
119
127
|
.option-indented {
|
|
@@ -121,46 +129,19 @@
|
|
|
121
129
|
padding-bottom: var(--dx-g-spacing-xs);
|
|
122
130
|
}
|
|
123
131
|
|
|
132
|
+
/* fit-content (toolbar): one line per label, truncated with an ellipsis. */
|
|
124
133
|
.option-fit-content {
|
|
125
134
|
min-width: 0;
|
|
126
|
-
padding: var(--dx-g-spacing-sm) var(--dx-g-spacing-lg);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.option-fit-content .option_details {
|
|
130
|
-
align-items: flex-start;
|
|
131
|
-
gap: var(--dx-g-spacing-sm);
|
|
132
|
-
min-width: 0;
|
|
133
|
-
flex: 1;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
.option-fit-content .option_description {
|
|
137
|
-
margin-top: 0;
|
|
138
135
|
}
|
|
139
136
|
|
|
140
137
|
.option-fit-content .option_label {
|
|
141
138
|
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
139
|
white-space: nowrap;
|
|
146
140
|
overflow: hidden;
|
|
147
141
|
text-overflow: ellipsis;
|
|
148
142
|
max-width: calc(100vw - var(--dx-g-spacing-lg) * 4);
|
|
149
143
|
}
|
|
150
144
|
|
|
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
145
|
.option-indented:not([data-index="0"]) {
|
|
165
146
|
--base-indentation: calc(var(--dx-g-spacing-md) + var(--shape-width));
|
|
166
147
|
--shape-width: 8px;
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
class="option_icon"
|
|
15
15
|
symbol={option.iconSymbol}
|
|
16
16
|
sprite={option.iconSprite}
|
|
17
|
-
if
|
|
18
|
-
size=
|
|
17
|
+
lwc:if={renderIcon}
|
|
18
|
+
size="override"
|
|
19
19
|
></dx-icon>
|
|
20
20
|
<div class="option_details">
|
|
21
21
|
<div if:true={renderIndentedShape} class="indented-shape"></div>
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
symbol={option.iconSymbol}
|
|
45
45
|
sprite={option.iconSprite}
|
|
46
46
|
color={option.iconColor}
|
|
47
|
-
if
|
|
48
|
-
size=
|
|
47
|
+
lwc:if={renderIcon}
|
|
48
|
+
size="override"
|
|
49
49
|
></dx-icon>
|
|
50
50
|
<div class="option_details">
|
|
51
51
|
<div if:true={renderIndentedShape} class="indented-shape"></div>
|
|
@@ -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
|
|
|
@@ -19,6 +18,7 @@ export default class DropdownOption extends LightningElement {
|
|
|
19
18
|
@api indexPosition: number = 0;
|
|
20
19
|
@api variant: DropdownVariant = "base";
|
|
21
20
|
@api widthMode: DropdownWidthMode = "fixed";
|
|
21
|
+
@api showIcon: boolean = false;
|
|
22
22
|
|
|
23
23
|
@api focus() {
|
|
24
24
|
const option = this.template.querySelector(".option");
|
|
@@ -41,8 +41,9 @@ export default class DropdownOption extends LightningElement {
|
|
|
41
41
|
return this.variant === "indented" && this.indexPosition >= 1;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
// Icons are opt-in (right-aligned); without show-icon there is no icon or spacing.
|
|
45
|
+
private get renderIcon() {
|
|
46
|
+
return this.showIcon && !!this.option.iconSymbol;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
private onClick(e: PointerEvent) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@import "dxHelpers/text";
|
|
3
3
|
|
|
4
4
|
:host {
|
|
5
|
-
--dx-c-sidebar-width:
|
|
5
|
+
--dx-c-sidebar-width: 336px;
|
|
6
6
|
--dx-c-sidebar-button-color: var(--dx-g-blue-vibrant-50);
|
|
7
7
|
--dx-c-sidebar-button-background: white;
|
|
8
8
|
--dx-c-sidebar-button-border: white;
|
|
@@ -11,7 +11,13 @@
|
|
|
11
11
|
--dx-c-sidebar-button-border-hover: var(--dx-g-blue-vibrant-50);
|
|
12
12
|
--dx-c-sidebar-left-padding: var(--dx-g-global-header-padding-horizontal);
|
|
13
13
|
--dx-c-sidebar-vertical-padding: var(--dx-g-spacing-md);
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
/* Width of the sidebar content (search field, version pickers): the
|
|
16
|
+
sidebar minus its 16px left and 24px right insets. 296px on desktop. */
|
|
17
|
+
--doc-version-picker-width: calc(
|
|
18
|
+
var(--dx-c-sidebar-width) - var(--dx-g-spacing-md) -
|
|
19
|
+
var(--dx-g-spacing-lg)
|
|
20
|
+
);
|
|
15
21
|
}
|
|
16
22
|
|
|
17
23
|
.header {
|