@salesforcedevs/dx-components 1.3.104 → 1.3.106-alpha.0
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 -3
- package/src/modules/dx/footer/footer.css +2 -1
- package/src/modules/dx/popover/popover.css +1 -1
- package/src/modules/dx/popover/popover.ts +11 -4
- package/src/modules/dx/scrollManager/scrollManager.ts +17 -5
- package/src/modules/dx/searchResults/searchResults.ts +11 -0
- package/src/modules/dx/toc/toc.css +2 -43
- package/src/modules/dx/toc/toc.html +4 -11
- package/src/modules/dx/toc/toc.ts +0 -45
- package/src/modules/dxHelpers/commonHeader/commonHeader.css +3 -4
- package/src/modules/dxHelpers/commonSidebar/commonSidebar.css +6 -1
- package/LICENSE +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.106-alpha.0",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -39,6 +39,5 @@
|
|
|
39
39
|
"@types/vimeo__player": "^2.16.2",
|
|
40
40
|
"eventsourcemock": "^2.0.0",
|
|
41
41
|
"luxon": "^3.1.0"
|
|
42
|
-
}
|
|
43
|
-
"gitHead": "5c5892f9f85207284a94a39243f47e948e5e3fdf"
|
|
42
|
+
}
|
|
44
43
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@import "dxHelpers/text";
|
|
3
3
|
|
|
4
4
|
.content-container {
|
|
5
|
-
padding: 0 var(--dx-g-
|
|
5
|
+
padding: 0 var(--dx-g-global-header-padding-horizontal);
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
a {
|
|
@@ -70,6 +70,7 @@ footer.signup-variant-no-signup {
|
|
|
70
70
|
|
|
71
71
|
.content-container_top_large {
|
|
72
72
|
position: relative;
|
|
73
|
+
padding: 0 var(--dx-g-page-padding-horizontal);
|
|
73
74
|
height: 504px;
|
|
74
75
|
}
|
|
75
76
|
|
|
@@ -246,9 +246,9 @@ export default class Popover extends LightningElement {
|
|
|
246
246
|
const elements = slot.assignedElements();
|
|
247
247
|
const slotted = elements.length === 0 ? null : elements[0];
|
|
248
248
|
// allows dropdown/select to compose popover
|
|
249
|
-
const slotElement = (
|
|
250
|
-
? slotted.firstChild
|
|
251
|
-
|
|
249
|
+
const slotElement = (
|
|
250
|
+
slotted?.tagName === "SLOT" ? slotted.firstChild : slotted
|
|
251
|
+
) as HTMLElement | null;
|
|
252
252
|
const isWorkToDo =
|
|
253
253
|
slotElement &&
|
|
254
254
|
(!this.control || !slotElement.isSameNode(this.control));
|
|
@@ -286,7 +286,7 @@ export default class Popover extends LightningElement {
|
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
-
private
|
|
289
|
+
private _setPosition = async () => {
|
|
290
290
|
if (this.popover && this.control) {
|
|
291
291
|
await Promise.resolve();
|
|
292
292
|
const popoverEl = this.popover;
|
|
@@ -310,6 +310,7 @@ export default class Popover extends LightningElement {
|
|
|
310
310
|
|
|
311
311
|
computePosition(this.control, popoverEl, {
|
|
312
312
|
placement: this.placement,
|
|
313
|
+
strategy: "fixed",
|
|
313
314
|
middleware
|
|
314
315
|
}).then(({ x, y, placement, middlewareData }) => {
|
|
315
316
|
Object.assign(popoverEl.style, {
|
|
@@ -349,4 +350,10 @@ export default class Popover extends LightningElement {
|
|
|
349
350
|
});
|
|
350
351
|
}
|
|
351
352
|
};
|
|
353
|
+
public get setPosition() {
|
|
354
|
+
return this._setPosition;
|
|
355
|
+
}
|
|
356
|
+
public set setPosition(value) {
|
|
357
|
+
this._setPosition = value;
|
|
358
|
+
}
|
|
352
359
|
}
|
|
@@ -4,6 +4,8 @@ import { track } from "dxUtils/analytics";
|
|
|
4
4
|
|
|
5
5
|
const RESTORE_SCROLL_EVENT_NAME = "restore-scroll";
|
|
6
6
|
const LOAD_TIME_SCROLL_RESTORE_DELAY = 750;
|
|
7
|
+
const REDUNDANT_INSTANCE_ERROR_MESSAGE =
|
|
8
|
+
"Multiple <dx-scroll-manager>s detected, this should never be the case.";
|
|
7
9
|
|
|
8
10
|
declare module globalThis {
|
|
9
11
|
let singletonScrollManagerRendered: boolean;
|
|
@@ -81,9 +83,7 @@ export default class ScrollManager extends LightningElement {
|
|
|
81
83
|
}, LOAD_TIME_SCROLL_RESTORE_DELAY);
|
|
82
84
|
}
|
|
83
85
|
} else {
|
|
84
|
-
console.error(
|
|
85
|
-
"Multiple <dx-scroll-manager>s detected, this should never be the case."
|
|
86
|
-
);
|
|
86
|
+
console.error(REDUNDANT_INSTANCE_ERROR_MESSAGE);
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -93,9 +93,20 @@ export default class ScrollManager extends LightningElement {
|
|
|
93
93
|
window.addEventListener(RESTORE_SCROLL_EVENT_NAME, restoreScroll);
|
|
94
94
|
|
|
95
95
|
document.body.addEventListener("scroll", this.manualScrollListener);
|
|
96
|
+
window.addEventListener("scroll", this.onWindowScroll);
|
|
96
97
|
} else {
|
|
97
|
-
console.error(
|
|
98
|
-
|
|
98
|
+
console.error(REDUNDANT_INSTANCE_ERROR_MESSAGE);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
onWindowScroll() {
|
|
103
|
+
const html = document.querySelector("html");
|
|
104
|
+
if (html) {
|
|
105
|
+
html.setAttribute(
|
|
106
|
+
"style",
|
|
107
|
+
`--dx-g-global-header-nav-row-count: ${
|
|
108
|
+
html.scrollTop >= 72 ? 1 : 2
|
|
109
|
+
}`
|
|
99
110
|
);
|
|
100
111
|
}
|
|
101
112
|
}
|
|
@@ -177,5 +188,6 @@ export default class ScrollManager extends LightningElement {
|
|
|
177
188
|
|
|
178
189
|
disconnectedCallback(): void {
|
|
179
190
|
window.removeEventListener(RESTORE_SCROLL_EVENT_NAME, restoreScroll);
|
|
191
|
+
window.removeEventListener("scroll", this.onWindowScroll);
|
|
180
192
|
}
|
|
181
193
|
}
|
|
@@ -155,6 +155,17 @@ export default class SearchResults extends LightningElement {
|
|
|
155
155
|
Coveo.$$(root).on(
|
|
156
156
|
Coveo.InitializationEvents.afterInitialization,
|
|
157
157
|
() => {
|
|
158
|
+
const url = new URL(window.location.href);
|
|
159
|
+
const searchParams = url.searchParams;
|
|
160
|
+
const keywordsParam = searchParams.get("keywords");
|
|
161
|
+
|
|
162
|
+
// Accomodate for the global nav using 'keywords' param instead of 'q'
|
|
163
|
+
if (keywordsParam) {
|
|
164
|
+
this._query = searchParams.get("keywords")!;
|
|
165
|
+
searchParams.delete("keywords");
|
|
166
|
+
window.history.replaceState(null, "", url.href);
|
|
167
|
+
}
|
|
168
|
+
|
|
158
169
|
if (this._query !== "") {
|
|
159
170
|
Coveo.state(this.root!, "q", this.searchQuery);
|
|
160
171
|
}
|
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
@import "dxHelpers/reset";
|
|
2
2
|
@import "dxHelpers/text";
|
|
3
3
|
|
|
4
|
-
:host {
|
|
5
|
-
--dx-c-toc-width: 284px;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
4
|
.toc {
|
|
9
5
|
display: flex;
|
|
10
6
|
flex-direction: row-reverse;
|
|
11
|
-
width:
|
|
12
|
-
|
|
7
|
+
max-width: 240px;
|
|
8
|
+
min-width: 80px;
|
|
13
9
|
word-break: break-word;
|
|
14
10
|
}
|
|
15
11
|
|
|
16
|
-
.toc_collapsed {
|
|
17
|
-
width: var(--dx-g-spacing-xl);
|
|
18
|
-
margin-left: var(--dx-g-spacing-xl);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
12
|
.toc_content {
|
|
22
13
|
display: flex;
|
|
23
14
|
flex-direction: column;
|
|
@@ -26,11 +17,6 @@
|
|
|
26
17
|
padding-bottom: var(--dx-g-spacing-smd);
|
|
27
18
|
}
|
|
28
19
|
|
|
29
|
-
.state-hide-content {
|
|
30
|
-
opacity: 0;
|
|
31
|
-
pointer-events: none;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
20
|
.toc_title {
|
|
35
21
|
display: flex;
|
|
36
22
|
flex-direction: row;
|
|
@@ -44,29 +30,6 @@
|
|
|
44
30
|
transition: var(--dx-g-transition-hue-1x);
|
|
45
31
|
}
|
|
46
32
|
|
|
47
|
-
.toggle-button.collapsed {
|
|
48
|
-
--dx-c-button-opacity: 1;
|
|
49
|
-
|
|
50
|
-
transform: rotate(180deg);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.toggle-button {
|
|
54
|
-
width: var(--dx-g-icon-size-xl);
|
|
55
|
-
height: var(--dx-g-icon-size-xl);
|
|
56
|
-
|
|
57
|
-
--dx-c-button-opacity: 0;
|
|
58
|
-
--dx-c-button-custom-color: var(--dx-g-blue-vibrant-50);
|
|
59
|
-
--dx-c-button-custom-background: white;
|
|
60
|
-
--dx-c-button-custom-border: white;
|
|
61
|
-
--dx-c-button-custom-color-hover: white;
|
|
62
|
-
--dx-c-button-custom-background-hover: var(--dx-g-blue-vibrant-50);
|
|
63
|
-
--dx-c-button-custom-border-hover: var(--dx-g-blue-vibrant-50);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.toggle-button:hover {
|
|
67
|
-
--dx-c-button-opacity: 1;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
33
|
.content-button {
|
|
71
34
|
line-height: var(--dx-g-text-lg);
|
|
72
35
|
color: var(--dx-g-blue-vibrant-20);
|
|
@@ -100,7 +63,3 @@
|
|
|
100
63
|
color: var(--dx-g-blue-vibrant-40);
|
|
101
64
|
border-color: var(--dx-g-blue-vibrant-40);
|
|
102
65
|
}
|
|
103
|
-
|
|
104
|
-
.toc:hover .toggle-button {
|
|
105
|
-
--dx-c-button-opacity: 1;
|
|
106
|
-
}
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class=
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
class={toggleButtonClass}
|
|
6
|
-
onclick={toggleShowContent}
|
|
7
|
-
icon-symbol="open_panel"
|
|
8
|
-
variant="custom"
|
|
9
|
-
></dx-button>
|
|
10
|
-
<div if:true={showContent} class="toc toc_content">
|
|
11
|
-
<h2 class={titleClassName}>{title}</h2>
|
|
2
|
+
<div class="toc" role="directory">
|
|
3
|
+
<div class="toc toc_content">
|
|
4
|
+
<h2 class="dx-text-display-8 toc_title">{title}</h2>
|
|
12
5
|
<template for:each={options} for:item="option">
|
|
13
6
|
<a
|
|
14
7
|
href={option.anchor}
|
|
@@ -23,7 +16,7 @@
|
|
|
23
16
|
</template>
|
|
24
17
|
</div>
|
|
25
18
|
</div>
|
|
26
|
-
<div
|
|
19
|
+
<div>
|
|
27
20
|
<slot name="view-pdf"></slot>
|
|
28
21
|
</div>
|
|
29
22
|
</template>
|
|
@@ -35,34 +35,9 @@ export default class Toc extends LightningElement {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
private _value?: string = undefined;
|
|
38
|
-
private showContent: boolean = true;
|
|
39
38
|
|
|
40
39
|
@track _options!: Array<ContentElement>;
|
|
41
40
|
|
|
42
|
-
private get toggleButtonIconSymbol() {
|
|
43
|
-
return this.showContent ? "forward" : "back";
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
private get toggleButtonAriaLabel() {
|
|
47
|
-
return this.showContent
|
|
48
|
-
? "Hide table of contents"
|
|
49
|
-
: "Show table of contents";
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
private get contentClassName() {
|
|
53
|
-
return cx("toc", !this.showContent && "toc_collapsed");
|
|
54
|
-
}
|
|
55
|
-
private get toggleButtonClass() {
|
|
56
|
-
return cx("toggle-button", !this.showContent && "collapsed");
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
private get titleClassName() {
|
|
60
|
-
return cx(
|
|
61
|
-
"dx-text-display-8 toc_title",
|
|
62
|
-
!this.showContent && "state-hide-content"
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
41
|
private onClick(e: Event) {
|
|
67
42
|
const target = e.currentTarget as HTMLElement;
|
|
68
43
|
const id = target.getAttribute("contentid");
|
|
@@ -84,24 +59,4 @@ export default class Toc extends LightningElement {
|
|
|
84
59
|
content_category: "cta"
|
|
85
60
|
});
|
|
86
61
|
}
|
|
87
|
-
|
|
88
|
-
private toggleShowContent(e: Event) {
|
|
89
|
-
this.showContent = !this.showContent;
|
|
90
|
-
this.trackShowContent(e);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
private trackShowContent(event: Event) {
|
|
94
|
-
let action = "collapse";
|
|
95
|
-
if (this.showContent) {
|
|
96
|
-
action = "expand";
|
|
97
|
-
}
|
|
98
|
-
sendGtm(event.target!, "custEv_tableOfContents", {
|
|
99
|
-
click_text: this.toggleButtonAriaLabel,
|
|
100
|
-
clickAction: action,
|
|
101
|
-
click_url: "",
|
|
102
|
-
element_title: this.title,
|
|
103
|
-
element_type: "button",
|
|
104
|
-
content_category: "cta"
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
62
|
}
|
|
@@ -43,7 +43,7 @@ header.state-show-mobile-nav .header_l2_group-nav_overflow {
|
|
|
43
43
|
.header_l1 {
|
|
44
44
|
height: var(--dx-g-spacing-3xl);
|
|
45
45
|
background: var(--dx-g-brand-current-color-background-2);
|
|
46
|
-
padding: 0 var(--dx-g-
|
|
46
|
+
padding: 0 var(--dx-g-global-header-padding-horizontal);
|
|
47
47
|
position: relative;
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -58,9 +58,8 @@ header.state-show-mobile-nav .header_l2_group-nav_overflow {
|
|
|
58
58
|
/* Second row */
|
|
59
59
|
|
|
60
60
|
.header_l2 {
|
|
61
|
-
height: var(--dx-g-spacing-4xl);
|
|
62
61
|
background: var(--dx-g-brand-current-color-background);
|
|
63
|
-
padding: var(--dx-g-spacing-lg) var(--dx-g-
|
|
62
|
+
padding: var(--dx-g-spacing-lg) var(--dx-g-global-header-padding-horizontal);
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
.header_l2_group {
|
|
@@ -121,7 +120,7 @@ header.state-show-mobile-nav .header_l2_group-nav_overflow {
|
|
|
121
120
|
|
|
122
121
|
@media (max-width: 768px) {
|
|
123
122
|
.header_l2_group-nav {
|
|
124
|
-
padding-left: calc(var(--dx-g-
|
|
123
|
+
padding-left: calc(var(--dx-g-global-header-padding-horizontal) - 4px);
|
|
125
124
|
}
|
|
126
125
|
|
|
127
126
|
.header_l2_group-nav_overflow {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
--dx-c-sidebar-button-color-hover: white;
|
|
10
10
|
--dx-c-sidebar-button-background-hover: var(--dx-g-blue-vibrant-50);
|
|
11
11
|
--dx-c-sidebar-button-border-hover: var(--dx-g-blue-vibrant-50);
|
|
12
|
-
--dx-c-sidebar-left-padding: var(--dx-g-
|
|
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
15
|
|
|
@@ -52,6 +52,11 @@ dx-tree:not(:last-child) {
|
|
|
52
52
|
width: var(--dx-g-spacing-xl);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
.container.collapsed .header {
|
|
56
|
+
padding-left: var(--dx-g-global-header-padding-horizontal);
|
|
57
|
+
padding-right: var(--dx-g-global-header-padding-horizontal);
|
|
58
|
+
}
|
|
59
|
+
|
|
55
60
|
.container {
|
|
56
61
|
background-color: var(--dx-g-gray-95);
|
|
57
62
|
display: flex;
|
package/LICENSE
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2020, Salesforce.com, Inc.
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
-
|
|
6
|
-
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
-
|
|
8
|
-
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
-
|
|
10
|
-
* Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
-
|
|
12
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|