@salesforcedevs/dx-components 1.31.0 → 1.31.1-alpha-gh
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
CHANGED
|
@@ -4,20 +4,28 @@ import { LightningElement, api } from "lwc";
|
|
|
4
4
|
const defaultDomain = "https://developer.salesforce.com";
|
|
5
5
|
const defaultLocale = "en-us";
|
|
6
6
|
const defaultHeaderSettingsBasePath = "/c/public/header-settings";
|
|
7
|
-
const headerSettingsJsonKeys = [
|
|
7
|
+
const headerSettingsJsonKeys = [
|
|
8
|
+
"regionSelectorOverride",
|
|
9
|
+
"contactLinksOverride"
|
|
10
|
+
];
|
|
8
11
|
|
|
9
12
|
export default class DevExNavigation extends LightningElement {
|
|
13
|
+
static renderMode = "light";
|
|
14
|
+
|
|
10
15
|
@api locale: string = defaultLocale;
|
|
11
16
|
@api path: string = defaultHeaderSettingsBasePath;
|
|
12
17
|
@api domain: string = defaultDomain;
|
|
13
18
|
|
|
14
19
|
async connectedCallback(): Promise<void> {
|
|
15
20
|
try {
|
|
16
|
-
const headerSettingsResponse = await fetch(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
const headerSettingsResponse = await fetch(
|
|
22
|
+
`${this.domain}${this.path}/${this.locale}.json`,
|
|
23
|
+
{
|
|
24
|
+
headers: {
|
|
25
|
+
"Content-Type": "application/json"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
);
|
|
21
29
|
if (headerSettingsResponse.ok) {
|
|
22
30
|
this.createFullNav(await headerSettingsResponse.json());
|
|
23
31
|
} else {
|
|
@@ -59,15 +67,15 @@ export default class DevExNavigation extends LightningElement {
|
|
|
59
67
|
private createBarebonesNav(): void {
|
|
60
68
|
const hgfNav = this.createGlobalNav({
|
|
61
69
|
origin: "",
|
|
62
|
-
contextNavEnabled: "true"
|
|
70
|
+
contextNavEnabled: "true"
|
|
63
71
|
});
|
|
64
72
|
const hgfNavContext = this.createContextNav({
|
|
65
73
|
variation: "static",
|
|
66
74
|
propertyTitle: {
|
|
67
75
|
label: "Developers",
|
|
68
|
-
url: "/"
|
|
76
|
+
url: "/"
|
|
69
77
|
},
|
|
70
|
-
menuGroup: {}
|
|
78
|
+
menuGroup: {}
|
|
71
79
|
});
|
|
72
80
|
const containerEl = this.refs.globalNavContainer as Element;
|
|
73
81
|
containerEl.appendChild(hgfNav);
|