@salesforcedevs/dx-components 1.40.1 → 1.40.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 +2 -2
- package/src/modules/dx/button/button.css +56 -4
- package/src/modules/dx/button/button.ts +2 -0
- package/src/modules/dx/dropdown/dropdown.css +28 -3
- package/src/modules/dx/dropdown/dropdown.html +5 -2
- package/src/modules/dx/dropdown/dropdown.ts +27 -3
- package/src/modules/dx/dropdownOption/dropdownOption.css +50 -9
- package/src/modules/dx/dropdownOption/dropdownOption.html +2 -2
- package/src/modules/dx/dropdownOption/dropdownOption.ts +10 -2
- package/src/modules/dx/popover/popover.css +9 -1
- package/src/modules/dx/popover/popover.ts +11 -1
- package/src/modules/dx/section/section.css +9 -3
- package/src/modules/dx/select/select.css +3 -1
- package/src/modules/dx/tooltip/tooltip.css +6 -0
- package/src/modules/dx/tooltip/tooltip.html +6 -1
- package/src/modules/dx/tooltip/tooltip.ts +15 -0
- package/src/modules/dxBaseElements/headerBase/headerBase.ts +1 -2
- package/src/modules/dxConstants/brands/brands.ts +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "1.40.
|
|
3
|
+
"version": "1.40.3",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"luxon": "3.4.4",
|
|
45
45
|
"msw": "^2.12.4"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "c8c3bb1003d40a55fdd5733c7891dcca3931fb24"
|
|
48
48
|
}
|
|
@@ -132,12 +132,62 @@
|
|
|
132
132
|
width: var(--dx-c-slot-empty-width, 52px);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
/*
|
|
136
|
+
* Renders a primary/secondary/tertiary button as an icon-only square while
|
|
137
|
+
* keeping a slotted label in the DOM for screen readers. The square width
|
|
138
|
+
* reuses --dx-c-slot-empty-width so callers can tune it the same way as the
|
|
139
|
+
* slot-empty path. position: relative anchors the visually-hidden label.
|
|
140
|
+
*/
|
|
141
|
+
.button.variant_primary.icon-only,
|
|
142
|
+
.button.variant_secondary.icon-only,
|
|
143
|
+
.button.variant_tertiary.icon-only {
|
|
144
|
+
position: relative;
|
|
145
|
+
padding: 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.button.size-large.icon-only {
|
|
149
|
+
width: var(--dx-c-slot-empty-width, var(--dx-g-spacing-3xl));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.button.size-small.icon-only {
|
|
153
|
+
width: var(--dx-c-slot-empty-width, var(--dx-g-spacing-xl));
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.button.size-hero.icon-only {
|
|
157
|
+
width: var(--dx-c-slot-empty-width, 52px);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/*
|
|
161
|
+
* Visually hide the slotted label but keep it accessible. Scoped to the
|
|
162
|
+
* content span (not the loading-message span) so the loading state still
|
|
163
|
+
* reads out.
|
|
164
|
+
*/
|
|
165
|
+
.button.icon-only > span[part="content"] {
|
|
166
|
+
position: absolute;
|
|
167
|
+
width: 1px;
|
|
168
|
+
height: 1px;
|
|
169
|
+
margin: -1px;
|
|
170
|
+
padding: 0;
|
|
171
|
+
overflow: hidden;
|
|
172
|
+
clip: rect(0 0 0 0);
|
|
173
|
+
white-space: nowrap;
|
|
174
|
+
border: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* The hidden label leaves no visible text, so drop the icon gap. */
|
|
178
|
+
.button.icon-only.icon-right > *:nth-child(2),
|
|
179
|
+
.button.icon-only.icon-left > *:nth-child(2) {
|
|
180
|
+
margin-left: 0;
|
|
181
|
+
margin-right: 0;
|
|
182
|
+
}
|
|
183
|
+
|
|
135
184
|
/* primary */
|
|
136
185
|
|
|
137
186
|
.button.variant_primary {
|
|
138
187
|
color: white;
|
|
139
188
|
background: var(--dx-c-button-primary-color);
|
|
140
|
-
border:
|
|
189
|
+
border: var(--dx-c-button-border-width, 1px) solid
|
|
190
|
+
var(--dx-c-button-primary-color);
|
|
141
191
|
}
|
|
142
192
|
|
|
143
193
|
.button.variant_primary:hover,
|
|
@@ -159,7 +209,8 @@
|
|
|
159
209
|
.button.variant_secondary,
|
|
160
210
|
.button.variant_quaternary {
|
|
161
211
|
color: var(--dx-c-button-secondary-color);
|
|
162
|
-
border:
|
|
212
|
+
border: var(--dx-c-button-border-width, var(--dx-g-spacing-2xs)) solid
|
|
213
|
+
var(--dx-c-button-secondary-color);
|
|
163
214
|
}
|
|
164
215
|
|
|
165
216
|
.button.variant_secondary:hover,
|
|
@@ -175,7 +226,7 @@
|
|
|
175
226
|
.button.variant_inline,
|
|
176
227
|
.button.variant_inline-inherit {
|
|
177
228
|
color: var(--dx-c-button-inline-color);
|
|
178
|
-
border: 1px solid transparent;
|
|
229
|
+
border: var(--dx-c-button-border-width, 1px) solid transparent;
|
|
179
230
|
}
|
|
180
231
|
|
|
181
232
|
.button.variant_inline.light-text {
|
|
@@ -221,7 +272,8 @@
|
|
|
221
272
|
.button.variant_icon-only:hover.state-disabled {
|
|
222
273
|
color: var(--dx-c-button-custom-color);
|
|
223
274
|
background: var(--dx-c-button-custom-background);
|
|
224
|
-
border:
|
|
275
|
+
border: var(--dx-c-button-border-width, 1px) solid
|
|
276
|
+
var(--dx-c-button-custom-border);
|
|
225
277
|
}
|
|
226
278
|
|
|
227
279
|
.button.variant_custom:hover,
|
|
@@ -22,6 +22,7 @@ export default class Button extends LightningElement {
|
|
|
22
22
|
@api loading: boolean = false;
|
|
23
23
|
@api size: ButtonSize = "small";
|
|
24
24
|
@api variant: ButtonVariant = "primary";
|
|
25
|
+
@api iconOnly: boolean = false;
|
|
25
26
|
@api inlineTextColor: ButtonTextColor = "dark";
|
|
26
27
|
@api font: "display" | "sans" = "display";
|
|
27
28
|
@api form: string | undefined;
|
|
@@ -61,6 +62,7 @@ export default class Button extends LightningElement {
|
|
|
61
62
|
`variant_${this.variant}`,
|
|
62
63
|
{
|
|
63
64
|
"slot-empty": !isIconOnly && !this.loading && this.isSlotEmpty,
|
|
65
|
+
"icon-only": this.iconOnly,
|
|
64
66
|
"state-disabled": this.disabled,
|
|
65
67
|
"state-loading": this.loading,
|
|
66
68
|
"style-icon": !!this.iconSymbol,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@import "dxHelpers/reset";
|
|
2
2
|
|
|
3
|
-
.menu-nested::part(content) {
|
|
3
|
+
.menu-nested:not(.menu-fit-content)::part(content) {
|
|
4
4
|
padding-top: var(--dx-g-spacing-sm);
|
|
5
5
|
width: 354px;
|
|
6
6
|
}
|
|
@@ -14,6 +14,32 @@
|
|
|
14
14
|
display: none;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
.menu-fit-content {
|
|
18
|
+
--dx-c-popover-width: max-content;
|
|
19
|
+
--dx-c-popover-padding: var(--dx-g-spacing-sm) 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.menu-fit-content .menu_list {
|
|
23
|
+
width: 100%;
|
|
24
|
+
align-items: flex-start;
|
|
25
|
+
gap: var(--dx-g-spacing-sm);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.menu-fit-content.menu-nested .menu_option:not(:first-child) {
|
|
29
|
+
border-top: var(--border);
|
|
30
|
+
margin-top: 0;
|
|
31
|
+
padding-top: var(--dx-g-spacing-sm);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.menu-fit-content .menu_heading {
|
|
35
|
+
margin: 0;
|
|
36
|
+
padding: var(--dx-g-spacing-smd) var(--dx-g-spacing-lg);
|
|
37
|
+
font-family: var(--dx-g-font-sans);
|
|
38
|
+
line-height: var(--dx-g-spacing-mlg);
|
|
39
|
+
text-transform: none;
|
|
40
|
+
color: var(--dx-g-gray-10);
|
|
41
|
+
}
|
|
42
|
+
|
|
17
43
|
@media screen and (max-width: 1000px) {
|
|
18
44
|
.menu-nested .menu_option:not(:first-child) {
|
|
19
45
|
border-top: var(--border);
|
|
@@ -52,7 +78,7 @@
|
|
|
52
78
|
}
|
|
53
79
|
|
|
54
80
|
.menu_option {
|
|
55
|
-
--border: 1px solid var(--dx-g-
|
|
81
|
+
--border: 1px solid var(--dx-g-gray-80);
|
|
56
82
|
|
|
57
83
|
display: flex;
|
|
58
84
|
flex-direction: column;
|
|
@@ -70,7 +96,6 @@
|
|
|
70
96
|
font-size: var(--dx-g-text-sm);
|
|
71
97
|
font-weight: bold;
|
|
72
98
|
text-transform: uppercase;
|
|
73
|
-
letter-spacing: 1px;
|
|
74
99
|
margin: var(--dx-g-spacing-sm);
|
|
75
100
|
}
|
|
76
101
|
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
<dx-popover
|
|
3
3
|
aria-label={ariaLabel}
|
|
4
4
|
class={className}
|
|
5
|
-
full-width={
|
|
5
|
+
full-width={effectiveFullWidth}
|
|
6
6
|
offset={offset}
|
|
7
7
|
onclose={onClose}
|
|
8
|
+
onopen={onOpen}
|
|
8
9
|
open-on-hover={openOnHover}
|
|
9
10
|
open={open}
|
|
10
11
|
page-padding={pagePadding}
|
|
11
12
|
placement={placement}
|
|
12
13
|
small={small}
|
|
13
|
-
width={
|
|
14
|
+
width={effectiveWidth}
|
|
14
15
|
>
|
|
15
16
|
<slot slot="control"></slot>
|
|
16
17
|
<div
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
option={option}
|
|
34
35
|
nav-item-label={navItemLabel}
|
|
35
36
|
variant={variant}
|
|
37
|
+
width-mode={widthMode}
|
|
36
38
|
></dx-dropdown-option>
|
|
37
39
|
<div
|
|
38
40
|
key={option.id}
|
|
@@ -52,6 +54,7 @@
|
|
|
52
54
|
onselect={onOptionClick}
|
|
53
55
|
option={suboption}
|
|
54
56
|
nav-item-label={navItemLabel}
|
|
57
|
+
width-mode={widthMode}
|
|
55
58
|
></dx-dropdown-option>
|
|
56
59
|
</template>
|
|
57
60
|
<dx-button
|
|
@@ -2,7 +2,8 @@ import {
|
|
|
2
2
|
AnalyticsPayload,
|
|
3
3
|
OptionWithNested,
|
|
4
4
|
PopperPlacement,
|
|
5
|
-
DropdownVariant
|
|
5
|
+
DropdownVariant,
|
|
6
|
+
DropdownWidthMode
|
|
6
7
|
} from "typings/custom";
|
|
7
8
|
import { LightningElement, api, track } from "lwc";
|
|
8
9
|
import cx from "classnames";
|
|
@@ -37,6 +38,7 @@ export default class Dropdown extends LightningElement {
|
|
|
37
38
|
@api fullWidth?: boolean | null;
|
|
38
39
|
@api navItemLabel: string | null = null;
|
|
39
40
|
@api variant: DropdownVariant = "base";
|
|
41
|
+
@api widthMode: DropdownWidthMode = "fixed";
|
|
40
42
|
|
|
41
43
|
// props forwarded to dropdown option
|
|
42
44
|
@api analyticsEvent?: string;
|
|
@@ -80,12 +82,29 @@ export default class Dropdown extends LightningElement {
|
|
|
80
82
|
return this.areOptionsEmpty ? null : "menu";
|
|
81
83
|
}
|
|
82
84
|
|
|
85
|
+
private get isFitContent() {
|
|
86
|
+
return this.widthMode === "fit-content";
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
private get effectiveWidth() {
|
|
90
|
+
return this.isFitContent ? null : this.width;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
private get effectiveFullWidth() {
|
|
94
|
+
return this.isFitContent ? false : this.fullWidth;
|
|
95
|
+
}
|
|
96
|
+
|
|
83
97
|
private get className() {
|
|
98
|
+
const fitContent = this.isFitContent;
|
|
84
99
|
return cx(
|
|
85
100
|
this.isNested && "menu-nested",
|
|
86
|
-
this.isNested &&
|
|
101
|
+
this.isNested &&
|
|
102
|
+
this.options.length >= 2 &&
|
|
103
|
+
!fitContent &&
|
|
104
|
+
"menu-nested-2-col",
|
|
87
105
|
this.offset && `menu-offset-${this.offset}`,
|
|
88
|
-
this.areOptionsEmpty && "menu-hidden"
|
|
106
|
+
this.areOptionsEmpty && "menu-hidden",
|
|
107
|
+
fitContent && "menu-fit-content"
|
|
89
108
|
);
|
|
90
109
|
}
|
|
91
110
|
|
|
@@ -166,6 +185,11 @@ export default class Dropdown extends LightningElement {
|
|
|
166
185
|
|
|
167
186
|
private onClose(): void {
|
|
168
187
|
this._focusedValue = null;
|
|
188
|
+
this.dispatchEvent(new CustomEvent("close"));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
private onOpen(): void {
|
|
192
|
+
this.dispatchEvent(new CustomEvent("open"));
|
|
169
193
|
}
|
|
170
194
|
|
|
171
195
|
private focusDefaultOption() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
@import "dxHelpers/reset";
|
|
2
2
|
|
|
3
3
|
.indented-shape {
|
|
4
|
-
--background:
|
|
5
|
-
--wide:
|
|
4
|
+
--background: var(--dx-g-cloud-blue-vibrant-80);
|
|
5
|
+
--wide: var(--dx-g-spacing-2xs);
|
|
6
6
|
|
|
7
7
|
background-color: var(--background);
|
|
8
8
|
height: var(--wide);
|
|
@@ -27,22 +27,23 @@
|
|
|
27
27
|
width: 100%;
|
|
28
28
|
padding: var(--dx-g-spacing-sm);
|
|
29
29
|
font-size: var(--dx-g-text-sm);
|
|
30
|
-
border-radius: var(--dx-g-spacing-xs);
|
|
31
30
|
transition: var(--dx-g-transition-hue-1x);
|
|
32
31
|
align-items: center;
|
|
33
32
|
outline: none !important;
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
.option:focus {
|
|
37
|
-
box-shadow: inset 0 0 0 1px var(--dx-g-blue-vibrant-50);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
35
|
.option:active {
|
|
41
36
|
background: var(--dx-g-cloud-blue-vibrant-95) !important;
|
|
42
37
|
}
|
|
43
38
|
|
|
44
|
-
.option:not(.option-active):hover
|
|
45
|
-
|
|
39
|
+
.option:not(.option-active):hover,
|
|
40
|
+
.option:not(.option-active):focus-visible {
|
|
41
|
+
background: var(--dx-g-cloud-blue-vibrant-95);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.option:focus-visible {
|
|
45
|
+
box-shadow: inset 0 0 0 2px var(--dx-g-blue-vibrant-60),
|
|
46
|
+
inset 0 0 0 4px white;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
.option-active {
|
|
@@ -101,6 +102,46 @@
|
|
|
101
102
|
padding-bottom: var(--dx-g-spacing-xs);
|
|
102
103
|
}
|
|
103
104
|
|
|
105
|
+
.option-fit-content {
|
|
106
|
+
min-width: 0;
|
|
107
|
+
padding: var(--dx-g-spacing-sm) var(--dx-g-spacing-lg);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.option-fit-content .option_details {
|
|
111
|
+
align-items: flex-start;
|
|
112
|
+
gap: var(--dx-g-spacing-sm);
|
|
113
|
+
min-width: 0;
|
|
114
|
+
flex: 1;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.option-fit-content .option_description {
|
|
118
|
+
margin-top: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.option-fit-content .option_label {
|
|
122
|
+
display: block;
|
|
123
|
+
color: var(--dx-g-gray-10);
|
|
124
|
+
font-weight: var(--dx-g-font-normal);
|
|
125
|
+
line-height: var(--dx-g-spacing-lg);
|
|
126
|
+
white-space: nowrap;
|
|
127
|
+
overflow: hidden;
|
|
128
|
+
text-overflow: ellipsis;
|
|
129
|
+
max-width: calc(100vw - var(--dx-g-spacing-lg) * 4);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.option-fit-content.option-active .option_label {
|
|
133
|
+
color: var(--dx-g-blue-vibrant-50);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.option-fit-content .option_icon {
|
|
137
|
+
--dx-c-icon-size: var(--dx-g-icon-size-md);
|
|
138
|
+
--dx-c-icon-color: var(--dx-g-gray-50);
|
|
139
|
+
|
|
140
|
+
order: 1;
|
|
141
|
+
margin-right: 0;
|
|
142
|
+
margin-left: var(--dx-g-spacing-2xl);
|
|
143
|
+
}
|
|
144
|
+
|
|
104
145
|
.option-indented:not([data-index="0"]) {
|
|
105
146
|
--base-indentation: calc(var(--dx-g-spacing-md) + var(--shape-width));
|
|
106
147
|
--shape-width: 8px;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
symbol={option.iconSymbol}
|
|
16
16
|
sprite={option.iconSprite}
|
|
17
17
|
if:true={option.iconSymbol}
|
|
18
|
-
size=
|
|
18
|
+
size={optionIconSize}
|
|
19
19
|
></dx-icon>
|
|
20
20
|
<div class="option_details">
|
|
21
21
|
<div if:true={renderIndentedShape} class="indented-shape"></div>
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
sprite={option.iconSprite}
|
|
46
46
|
color={option.iconColor}
|
|
47
47
|
if:true={option.iconSymbol}
|
|
48
|
-
size=
|
|
48
|
+
size={optionIconSize}
|
|
49
49
|
></dx-icon>
|
|
50
50
|
<div class="option_details">
|
|
51
51
|
<div if:true={renderIndentedShape} class="indented-shape"></div>
|
|
@@ -3,7 +3,9 @@ import cx from "classnames";
|
|
|
3
3
|
import {
|
|
4
4
|
OptionWithNested,
|
|
5
5
|
AnalyticsPayload,
|
|
6
|
-
DropdownVariant
|
|
6
|
+
DropdownVariant,
|
|
7
|
+
DropdownWidthMode,
|
|
8
|
+
IconSize
|
|
7
9
|
} from "typings/custom";
|
|
8
10
|
import { track } from "dxUtils/analytics";
|
|
9
11
|
|
|
@@ -16,6 +18,7 @@ export default class DropdownOption extends LightningElement {
|
|
|
16
18
|
@api analyticsPayload?: AnalyticsPayload | undefined;
|
|
17
19
|
@api indexPosition: number = 0;
|
|
18
20
|
@api variant: DropdownVariant = "base";
|
|
21
|
+
@api widthMode: DropdownWidthMode = "fixed";
|
|
19
22
|
|
|
20
23
|
@api focus() {
|
|
21
24
|
const option = this.template.querySelector(".option");
|
|
@@ -29,7 +32,8 @@ export default class DropdownOption extends LightningElement {
|
|
|
29
32
|
return cx(
|
|
30
33
|
"option",
|
|
31
34
|
this.active && "option-active",
|
|
32
|
-
this.variant && `option-${this.variant}
|
|
35
|
+
this.variant && `option-${this.variant}`,
|
|
36
|
+
this.widthMode === "fit-content" && "option-fit-content"
|
|
33
37
|
);
|
|
34
38
|
}
|
|
35
39
|
|
|
@@ -37,6 +41,10 @@ export default class DropdownOption extends LightningElement {
|
|
|
37
41
|
return this.variant === "indented" && this.indexPosition >= 1;
|
|
38
42
|
}
|
|
39
43
|
|
|
44
|
+
private get optionIconSize(): IconSize {
|
|
45
|
+
return this.widthMode === "fit-content" ? "override" : "large";
|
|
46
|
+
}
|
|
47
|
+
|
|
40
48
|
private onClick(e: PointerEvent) {
|
|
41
49
|
this.dispatchEvent(
|
|
42
50
|
new CustomEvent("select", { detail: this.keyValue })
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
border: var(--popover-border);
|
|
24
24
|
box-shadow: var(--dx-g-box-shadow-lg);
|
|
25
25
|
border-radius: var(--popover-border-radius);
|
|
26
|
-
width: 168px;
|
|
26
|
+
width: var(--dx-c-popover-width, 168px);
|
|
27
27
|
max-width: calc(100vw - var(--dx-g-spacing-lg));
|
|
28
28
|
max-height: 65vh;
|
|
29
29
|
padding: var(--popover-padding);
|
|
@@ -44,6 +44,14 @@
|
|
|
44
44
|
transform: var(--popover-container-open-transform);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
/* Adjust transform for top placement */
|
|
48
|
+
.popover-container[data-placement-side="top"].popover-container_open .popover {
|
|
49
|
+
transform: var(
|
|
50
|
+
--popover-container-open-transform-up,
|
|
51
|
+
var(--popover-container-open-transform)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
47
55
|
.popover-overridewidth {
|
|
48
56
|
max-width: unset;
|
|
49
57
|
}
|
|
@@ -80,7 +80,11 @@ export default class Popover extends LightningElement {
|
|
|
80
80
|
this.control.setAttribute("aria-expanded", "true");
|
|
81
81
|
|
|
82
82
|
if (this.popover) {
|
|
83
|
-
this.autoUpdateCleanup = autoUpdate(
|
|
83
|
+
this.autoUpdateCleanup = autoUpdate(
|
|
84
|
+
this.control,
|
|
85
|
+
this.popover,
|
|
86
|
+
this.setPosition
|
|
87
|
+
);
|
|
84
88
|
}
|
|
85
89
|
|
|
86
90
|
this.dispatchEvent(new CustomEvent("open"));
|
|
@@ -337,6 +341,12 @@ export default class Popover extends LightningElement {
|
|
|
337
341
|
top: `${y}px`
|
|
338
342
|
});
|
|
339
343
|
|
|
344
|
+
// Expose the final placement side after any flip
|
|
345
|
+
popoverEl.setAttribute(
|
|
346
|
+
"data-placement-side",
|
|
347
|
+
placement.split("-")[0]
|
|
348
|
+
);
|
|
349
|
+
|
|
340
350
|
if (this.arrow && middlewareData.arrow) {
|
|
341
351
|
const { x: arrowX, y: arrowY } = middlewareData.arrow;
|
|
342
352
|
const popoverPlacementSide = placement.split("-")[0] as
|
|
@@ -65,9 +65,15 @@
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
.dx-text-display-custom {
|
|
68
|
-
color: var(
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
color: var(
|
|
69
|
+
--dx-c-section-heading-font-color,
|
|
70
|
+
var(--dx-g-text-heading-color)
|
|
71
|
+
);
|
|
72
|
+
font-family: var(
|
|
73
|
+
--dx-c-section-heading-font-family,
|
|
74
|
+
var(--dx-g-font-display)
|
|
75
|
+
);
|
|
76
|
+
font-size: var(--dx-c-section-heading-font-size, var(--dx-g-text-3xl));
|
|
71
77
|
letter-spacing: var(--dx-c-section-heading-letter-spacing, -0.4px);
|
|
72
78
|
line-height: var(--dx-c-section-heading-line-height, 40px);
|
|
73
79
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
:host {
|
|
2
2
|
display: block;
|
|
3
|
+
|
|
4
|
+
--dx-c-select-border: 1px solid var(--dx-g-gray-50);
|
|
3
5
|
}
|
|
4
6
|
|
|
5
7
|
:host(:focus-visible) {
|
|
@@ -122,7 +124,7 @@ select {
|
|
|
122
124
|
.select-element {
|
|
123
125
|
height: calc(1.875rem + (1px * 2));
|
|
124
126
|
width: 100%;
|
|
125
|
-
border:
|
|
127
|
+
border: var(--dx-c-select-border);
|
|
126
128
|
border-radius: 0.25rem;
|
|
127
129
|
background-color: transparent;
|
|
128
130
|
transition: border 0.1s linear, background-color 0.1s linear;
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
display: inherit;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
[aria-label][role~="tooltip"].is-suppressed:is(:hover, :focus)::before,
|
|
12
|
+
[aria-label][role~="tooltip"].is-suppressed:is(:hover, :focus)::after {
|
|
13
|
+
opacity: 0;
|
|
14
|
+
pointer-events: none;
|
|
15
|
+
}
|
|
16
|
+
|
|
11
17
|
[role~="tooltip"][data-microtip-position|="bottom"]::before {
|
|
12
18
|
background: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%28116,%20116,%20116,%201%29%22%20transform%3D%22rotate%28180%2018%206%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E")
|
|
13
19
|
no-repeat;
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
|
+
import cx from "classnames";
|
|
2
3
|
|
|
3
4
|
export default class Tooltip extends LightningElement {
|
|
4
5
|
@api placement?: String = "top";
|
|
5
6
|
@api label: string = "";
|
|
7
|
+
|
|
8
|
+
// When true, the tooltip is shown regardless of hover/focus. Lets a
|
|
9
|
+
// consumer flash it programmatically
|
|
10
|
+
@api visible: boolean = false;
|
|
11
|
+
|
|
12
|
+
// Suppresses the tooltip while the trigger is hovered or focused e.g when a menu is open
|
|
13
|
+
@api suppressed: boolean = false;
|
|
14
|
+
|
|
15
|
+
get tooltipClass(): string {
|
|
16
|
+
return cx({
|
|
17
|
+
"is-visible": this.visible,
|
|
18
|
+
"is-suppressed": this.suppressed && !this.visible
|
|
19
|
+
});
|
|
20
|
+
}
|
|
6
21
|
}
|