@salesforcedevs/dx-components 1.3.54-alpha.0 → 1.3.56-alpha.1
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/lwc.config.json +1 -0
- package/package.json +4 -3
- package/src/modules/dx/banner/banner.css +46 -0
- package/src/modules/dx/banner/banner.html +13 -0
- package/src/modules/dx/banner/banner.ts +12 -0
- package/src/modules/dx/footer/links.ts +6 -0
- package/src/modules/dx/formattedDateTime/formattedDateTime.ts +10 -4
- package/src/modules/dx/header/header.html +5 -1
- package/src/modules/dx/header/header.ts +4 -0
- package/src/modules/dx/hr/hr.css +0 -1
- package/src/modules/dx/searchResults/searchResults.css +2 -2
- package/src/modules/dx/sidebar/sidebar.html +0 -1
- package/src/modules/dx/sidebar/sidebar.ts +2 -6
- package/src/modules/dx/sidebarOld/sidebarOld.ts +2 -0
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +0 -5
- package/src/modules/dx/tbidAvatarButton/tbidAvatarButton.css +2 -2
- package/src/modules/dx/toc/toc.ts +13 -0
- package/src/modules/dx/treeItem/treeItem.html +1 -0
- package/src/modules/dx/treeItem/treeItem.ts +8 -6
- package/src/modules/dxBaseElements/headerBase/headerBase.ts +13 -1
package/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.56-alpha.1",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
"lodash.kebabcase": "^4.1.1",
|
|
24
24
|
"microtip": "0.2.2",
|
|
25
25
|
"salesforce-oauth2": "^0.2.0",
|
|
26
|
-
"user": "0.0.0",
|
|
27
26
|
"uuid": "^9.0.0"
|
|
28
27
|
},
|
|
29
28
|
"devDependencies": {
|
|
@@ -33,8 +32,10 @@
|
|
|
33
32
|
"@types/lodash.defaults": "^4.2.7",
|
|
34
33
|
"@types/lodash.get": "^4.4.6",
|
|
35
34
|
"@types/lodash.kebabcase": "^4.1.7",
|
|
35
|
+
"@types/luxon": "^3.1.0",
|
|
36
36
|
"@types/uuid": "^8.3.4",
|
|
37
37
|
"@types/vimeo__player": "^2.16.2",
|
|
38
|
-
"eventsourcemock": "^2.0.0"
|
|
38
|
+
"eventsourcemock": "^2.0.0",
|
|
39
|
+
"luxon": "^3.1.0"
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
@import "dxHelpers/reset";
|
|
2
|
+
@import "dxHelpers/text";
|
|
3
|
+
|
|
4
|
+
.container {
|
|
5
|
+
--primary-color: var(--dx-g-cloud-blue-vibrant-50);
|
|
6
|
+
--secondary-color: var(--dx-g-cloud-blue-vibrant-40);
|
|
7
|
+
|
|
8
|
+
width: 100%;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
min-height: 24px;
|
|
14
|
+
padding: 0 var(--dx-g-page-padding-horizontal);
|
|
15
|
+
background: repeating-linear-gradient(
|
|
16
|
+
45deg,
|
|
17
|
+
var(--primary-color),
|
|
18
|
+
var(--primary-color) 20px,
|
|
19
|
+
var(--secondary-color) 20px,
|
|
20
|
+
var(--secondary-color) 40px
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.container_inner {
|
|
25
|
+
height: 100%;
|
|
26
|
+
display: flex;
|
|
27
|
+
background: var(--primary-color);
|
|
28
|
+
padding: var(--dx-g-spacing-xs) var(--dx-g-spacing-sm);
|
|
29
|
+
color: white;
|
|
30
|
+
font-weight: bold;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.container a {
|
|
34
|
+
text-decoration: underline;
|
|
35
|
+
transition: var(--dx-g-transition-hue-1x);
|
|
36
|
+
margin-right: 4px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.container a:hover {
|
|
40
|
+
opacity: 0.8;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.container dx-icon {
|
|
44
|
+
margin-right: var(--dx-g-spacing-sm);
|
|
45
|
+
margin-top: var(--dx-g-spacing-2xs);
|
|
46
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container">
|
|
3
|
+
<div class="container_inner dx-text-body-4">
|
|
4
|
+
<dx-icon symbol="announcement"></dx-icon>
|
|
5
|
+
<!--
|
|
6
|
+
NOTE: Here we are rendering mark up using lwc:dom & innerHTML
|
|
7
|
+
option instead of slots because the html markup will come as a
|
|
8
|
+
property to the component from a configuration
|
|
9
|
+
-->
|
|
10
|
+
<div lwc:dom="manual" class="info-container"></div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import { setContainerInnerHtml } from "dxUtils/lwc";
|
|
3
|
+
|
|
4
|
+
export default class Banner extends LightningElement {
|
|
5
|
+
@api bannerMarkup =
|
|
6
|
+
'<span><a href="https://forms.gle/TdSyKFPHXoBx7seM9" target="blank">Share your feedback</a>about our new site.</span>';
|
|
7
|
+
|
|
8
|
+
renderedCallback() {
|
|
9
|
+
const container = this.template.querySelector(".info-container");
|
|
10
|
+
setContainerInnerHtml(container, this.bannerMarkup);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -206,5 +206,11 @@ export const socialLinks = [
|
|
|
206
206
|
iconSymbol: "rss",
|
|
207
207
|
iconSprite: "general",
|
|
208
208
|
label: "RSS"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
href: "https://www.instagram.com/salesforcedevs",
|
|
212
|
+
iconSymbol: "instagram",
|
|
213
|
+
iconSprite: "brand",
|
|
214
|
+
label: "Instagram"
|
|
209
215
|
}
|
|
210
216
|
];
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
formattedDateYear
|
|
12
12
|
} from "typings/custom";
|
|
13
13
|
|
|
14
|
+
import { DateTime } from "luxon";
|
|
15
|
+
|
|
14
16
|
export default class FormattedDateTime extends LightningElement {
|
|
15
17
|
@api weekday: formattedDateWeekday;
|
|
16
18
|
@api year: formattedDateYear;
|
|
@@ -27,7 +29,11 @@ export default class FormattedDateTime extends LightningElement {
|
|
|
27
29
|
return;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
this._unformattedDate =
|
|
32
|
+
this._unformattedDate = DateTime.fromISO(value)
|
|
33
|
+
.plus({
|
|
34
|
+
hour: 1
|
|
35
|
+
})
|
|
36
|
+
.toJSDate();
|
|
31
37
|
|
|
32
38
|
if (this._unformattedDate.toString() === "Invalid Date") {
|
|
33
39
|
// this is a fix for Safari since it doesn't support date strings with 'yyyy/mm/dd' patterns
|
|
@@ -62,7 +68,7 @@ export default class FormattedDateTime extends LightningElement {
|
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
getOptions() {
|
|
65
|
-
|
|
71
|
+
return {
|
|
66
72
|
weekday: this.weekday || undefined,
|
|
67
73
|
year: this.year || undefined,
|
|
68
74
|
month: this.month || undefined,
|
|
@@ -70,8 +76,8 @@ export default class FormattedDateTime extends LightningElement {
|
|
|
70
76
|
hour: this.hour || undefined,
|
|
71
77
|
minute: this.minute || undefined,
|
|
72
78
|
second: this.second,
|
|
73
|
-
timeZoneName: this.timeZoneName || undefined
|
|
79
|
+
timeZoneName: this.timeZoneName || undefined,
|
|
80
|
+
timeZone: "America/Los_Angeles"
|
|
74
81
|
};
|
|
75
|
-
return options;
|
|
76
82
|
}
|
|
77
83
|
}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
<dx-brand-theme-provider brand={brand}>
|
|
3
3
|
<header class={className}>
|
|
4
4
|
<dx-skip-nav-link></dx-skip-nav-link>
|
|
5
|
+
<dx-banner
|
|
6
|
+
if:true={showBanner}
|
|
7
|
+
banner-markup={bannerMarkup}
|
|
8
|
+
></dx-banner>
|
|
5
9
|
<div class="header_l1">
|
|
6
10
|
<dx-logo label={title}></dx-logo>
|
|
7
11
|
<div class="header-cta-container">
|
|
@@ -35,7 +39,7 @@
|
|
|
35
39
|
</div>
|
|
36
40
|
<div class="header_l2">
|
|
37
41
|
<div class="header_l2_group header_l2_group-title">
|
|
38
|
-
<a href="/" class="home-link">
|
|
42
|
+
<a href="/" class="home-link" if:true={isValidSubtitle}>
|
|
39
43
|
<dx-icon
|
|
40
44
|
class="brand-icon"
|
|
41
45
|
if:true={isValidBrand}
|
package/src/modules/dx/hr/hr.css
CHANGED
|
@@ -197,8 +197,8 @@ li.coveo-dynamic-facet-breadcrumb-value-list-item {
|
|
|
197
197
|
|
|
198
198
|
.CoveoSort.coveo-selected,
|
|
199
199
|
.CoveoSort.coveo-selected:hover {
|
|
200
|
-
color: var(--dx-g-blue-vibrant-
|
|
201
|
-
border-bottom-color: var(--dx-g-blue-vibrant-
|
|
200
|
+
color: var(--dx-g-blue-vibrant-40);
|
|
201
|
+
border-bottom-color: var(--dx-g-blue-vibrant-40);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
.CoveoBreadcrumb {
|
|
@@ -169,6 +169,8 @@ export default class Sidebar extends SidebarBase {
|
|
|
169
169
|
|
|
170
170
|
private onSelect(event: CustomEvent) {
|
|
171
171
|
this._value = event.detail.name;
|
|
172
|
+
|
|
173
|
+
this.dispatchEvent(new CustomEvent("sidebarclick"));
|
|
172
174
|
}
|
|
173
175
|
|
|
174
176
|
private onToggleClick(event: Event) {
|
|
@@ -255,10 +257,4 @@ export default class Sidebar extends SidebarBase {
|
|
|
255
257
|
node.children.forEach((child) => this.assignValueToLabel(child));
|
|
256
258
|
}
|
|
257
259
|
}
|
|
258
|
-
|
|
259
|
-
private onItemsFocused(): void {
|
|
260
|
-
this.template
|
|
261
|
-
.querySelector("dx-sidebar-search")
|
|
262
|
-
?.requestOpenDropdown(false);
|
|
263
|
-
}
|
|
264
260
|
}
|
|
@@ -78,11 +78,6 @@ export default class SidebarSearch extends LightningElement {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
@api
|
|
82
|
-
requestOpenDropdown(value: boolean) {
|
|
83
|
-
this.dropdownRequestedOpen = value;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
81
|
private _coveoAdvancedQueryConfig!: { [key: string]: any };
|
|
87
82
|
private dropdownRequestedOpen: boolean = false;
|
|
88
83
|
private recentSearches: Option[] = [];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
@import "dxHelpers/reset";
|
|
2
2
|
|
|
3
3
|
:host {
|
|
4
|
-
--dx-c-button-custom-color: var(--dx-g-blue-vibrant-
|
|
4
|
+
--dx-c-button-custom-color: var(--dx-g-blue-vibrant-40);
|
|
5
5
|
--dx-c-button-custom-background: transparent;
|
|
6
6
|
--dx-c-button-custom-border: 1px solid transparent;
|
|
7
|
-
--dx-c-button-custom-color-hover: var(--dx-g-blue-vibrant-
|
|
7
|
+
--dx-c-button-custom-color-hover: var(--dx-g-blue-vibrant-40);
|
|
8
8
|
--dx-c-button-custom-background-hover: var(--dx-g-cloud-blue-vibrant-90);
|
|
9
9
|
--dx-c-button-custom-border-hover: var(--dx-g-cloud-blue-vibrant-90);
|
|
10
10
|
--dx-c-slot-empty-width: max-content;
|
|
@@ -2,6 +2,7 @@ import { LightningElement, api, track } from "lwc";
|
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { ContentElement } from "typings/custom";
|
|
4
4
|
import { toJson } from "dxUtils/normalizers";
|
|
5
|
+
import { track as sendGtm } from "dxUtils/analytics";
|
|
5
6
|
|
|
6
7
|
export default class Toc extends LightningElement {
|
|
7
8
|
@api title!: string;
|
|
@@ -65,10 +66,22 @@ export default class Toc extends LightningElement {
|
|
|
65
66
|
private onClick(e: Event) {
|
|
66
67
|
const target = e.currentTarget as HTMLElement;
|
|
67
68
|
const id = target.getAttribute("contentid");
|
|
69
|
+
const text = target.getAttribute("data-text");
|
|
70
|
+
const href = target.getAttribute("href");
|
|
71
|
+
|
|
68
72
|
this.dispatchEvent(
|
|
69
73
|
new CustomEvent("selectedcontent", { detail: { name: id } })
|
|
70
74
|
);
|
|
75
|
+
|
|
71
76
|
this._value = id!;
|
|
77
|
+
|
|
78
|
+
sendGtm(e.currentTarget!, "custEv_tableOfContentsClick", {
|
|
79
|
+
clickText: text,
|
|
80
|
+
clickUrl: href,
|
|
81
|
+
elementType: "link",
|
|
82
|
+
locationOnPage: "table of contents",
|
|
83
|
+
itemTitle: this.title
|
|
84
|
+
});
|
|
72
85
|
}
|
|
73
86
|
|
|
74
87
|
private toggleShowContent() {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import { InternalTreeNode } from "typings/custom";
|
|
3
3
|
import { track } from "dxUtils/analytics";
|
|
4
|
-
import { SidebarGtmAction } from "typings/custom";
|
|
5
4
|
import { isInViewport } from "dxUtils/browser";
|
|
6
5
|
|
|
7
6
|
const DEFAULT_TARGET = "_self";
|
|
@@ -9,6 +8,7 @@ const DEFAULT_TARGET = "_self";
|
|
|
9
8
|
export default class TreeItem extends LightningElement {
|
|
10
9
|
@api selectedKey?: string;
|
|
11
10
|
@api isRoot: boolean = false;
|
|
11
|
+
@api parentName?: string = "";
|
|
12
12
|
|
|
13
13
|
@api
|
|
14
14
|
public get treeNode() {
|
|
@@ -94,7 +94,7 @@ export default class TreeItem extends LightningElement {
|
|
|
94
94
|
private onIconClick(event: CustomEvent): void {
|
|
95
95
|
const isSelectAction = false;
|
|
96
96
|
this.doExpand(isSelectAction);
|
|
97
|
-
this.sendGtm(event
|
|
97
|
+
this.sendGtm(event);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
private onLinkClick(event: Event): void {
|
|
@@ -107,7 +107,7 @@ export default class TreeItem extends LightningElement {
|
|
|
107
107
|
this.doExpand(isSelectAction);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
this.sendGtm(event
|
|
110
|
+
this.sendGtm(event);
|
|
111
111
|
this.fireEvent("tileselected", { name: this._treeNode.name });
|
|
112
112
|
}
|
|
113
113
|
|
|
@@ -137,10 +137,12 @@ export default class TreeItem extends LightningElement {
|
|
|
137
137
|
this.isExpanded = value;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
private sendGtm(event: Event
|
|
141
|
-
track(event.currentTarget!, "
|
|
140
|
+
private sendGtm(event: Event) {
|
|
141
|
+
track(event.currentTarget!, "custEv_leftNavClick", {
|
|
142
|
+
navType: "left nav bar",
|
|
142
143
|
clickText: this._treeNode.label,
|
|
143
|
-
|
|
144
|
+
clickUrl: this.href,
|
|
145
|
+
navItem: this.parentName
|
|
144
146
|
});
|
|
145
147
|
}
|
|
146
148
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api } from "lwc";
|
|
2
2
|
import cx from "classnames";
|
|
3
3
|
import { Brand, OptionWithLink, OptionWithNested } from "typings/custom";
|
|
4
|
-
import { toJson } from "dxUtils/normalizers";
|
|
4
|
+
import { toJson, normalizeBoolean } from "dxUtils/normalizers";
|
|
5
5
|
import { track } from "dxUtils/analytics";
|
|
6
6
|
|
|
7
7
|
const VALID_BRANDS = [
|
|
@@ -41,6 +41,8 @@ export abstract class HeaderBase extends LightningElement {
|
|
|
41
41
|
@api subtitle!: string;
|
|
42
42
|
@api title: string = "Salesforce";
|
|
43
43
|
@api version?: string | null = null;
|
|
44
|
+
@api bannerMarkup =
|
|
45
|
+
'<span><a href="https://forms.gle/oWYTbH9RvGyt9uxx7" target="blank">Share your feedback</a>about our new site.</span>';
|
|
44
46
|
|
|
45
47
|
@api
|
|
46
48
|
get navItems() {
|
|
@@ -59,6 +61,15 @@ export abstract class HeaderBase extends LightningElement {
|
|
|
59
61
|
this._versions = toJson(value);
|
|
60
62
|
}
|
|
61
63
|
|
|
64
|
+
@api
|
|
65
|
+
get showBanner() {
|
|
66
|
+
return this._showBanner && this.bannerMarkup;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
set showBanner(value) {
|
|
70
|
+
this._showBanner = normalizeBoolean(value);
|
|
71
|
+
}
|
|
72
|
+
|
|
62
73
|
private _navItems!: OptionWithNested[];
|
|
63
74
|
private _versions!: OptionWithLink[];
|
|
64
75
|
private matchMedia!: MediaQueryList;
|
|
@@ -67,6 +78,7 @@ export abstract class HeaderBase extends LightningElement {
|
|
|
67
78
|
private showMobileNavMenu: boolean = false;
|
|
68
79
|
private showNavScrollShadow: boolean = false;
|
|
69
80
|
protected isSearchOpen: boolean = false;
|
|
81
|
+
private _showBanner?: boolean = false;
|
|
70
82
|
|
|
71
83
|
get url() {
|
|
72
84
|
return this.href ? new URL(this.href!) : window.location;
|