@salesforcedevs/dx-components 1.3.72 → 1.3.73-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 +6 -3
- package/package.json +3 -3
- package/src/assets/shiki/languages/amp.tmLanguage.json +205 -0
- package/src/assets/shiki/themes/codey-highnoon.json +650 -0
- package/src/assets/shiki/themes/codey-midnight.json +622 -0
- package/src/modules/dx/breadcrumbs/breadcrumbs.ts +8 -10
- package/src/modules/dx/cardContent/cardContent.html +4 -1
- package/src/modules/dx/cardDocs/cardDocs.html +4 -1
- package/src/modules/dx/codeBlock/codeBlock.css +23 -7
- package/src/modules/dx/codeBlock/codeBlock.html +0 -19
- package/src/modules/dx/codeBlock/codeBlock.ts +61 -110
- package/src/modules/dx/dropdown/dropdown.ts +2 -3
- package/src/modules/dx/filterMenu/filterMenu.html +7 -2
- package/src/modules/dx/filterMenu/filterMenu.ts +4 -3
- package/src/modules/dx/footer/links.ts +2 -4
- package/src/modules/dx/grid/grid.ts +3 -1
- package/src/modules/dx/header/header.html +4 -1
- package/src/modules/dx/popover/popover.ts +3 -3
- package/src/modules/dx/searchResults/searchResults.ts +1 -3
- package/src/modules/dx/select/select.ts +2 -3
- package/src/modules/dx/sidebar/sidebar.ts +7 -5
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +2 -5
- package/src/modules/dx/tabPanelList/tabPanelList.ts +2 -2
- package/src/modules/dxBaseElements/headerBase/headerBase.ts +2 -0
- package/src/modules/dxBaseElements/matchMediaElement/matchMediaElement.ts +2 -4
- package/src/modules/dxUtils/prismjs/prismjs.ts +287 -167
- package/src/modules/dxUtils/shiki/languages.ts +18 -0
- package/src/modules/dxUtils/shiki/shiki.ts +74 -0
- package/LICENSE +0 -12
- package/src/modules/dxHelpers/code/code.css +0 -296
- package/src/modules/dxUtils/prismjs/prismjs.html +0 -3
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
@import "dxHelpers/code";
|
|
2
1
|
@import "dxHelpers/text";
|
|
3
2
|
@import "./darkTheme.css";
|
|
4
3
|
@import "./lightTheme.css";
|
|
@@ -102,7 +101,7 @@ div.code-block-content {
|
|
|
102
101
|
background: var(--dx-g-gray-95);
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
code[class*="
|
|
104
|
+
code[class*="shiki"] {
|
|
106
105
|
margin-left: -11px;
|
|
107
106
|
}
|
|
108
107
|
|
|
@@ -110,19 +109,36 @@ code[class*="language-"] {
|
|
|
110
109
|
margin-right: var(--dx-g-spacing-xs);
|
|
111
110
|
}
|
|
112
111
|
|
|
113
|
-
|
|
112
|
+
.italic {
|
|
113
|
+
font-style: italic;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
pre[class*="shiki"] {
|
|
117
|
+
font-size: 14px;
|
|
114
118
|
border-radius: 0 0 0.3em 0.3em;
|
|
115
119
|
padding-bottom: var(--dx-g-spacing-smd);
|
|
116
120
|
background-color: unset;
|
|
117
121
|
padding-top: var(--dx-g-spacing-sm);
|
|
118
122
|
}
|
|
119
123
|
|
|
120
|
-
pre[class*="language-"].line-numbers {
|
|
121
|
-
padding-left: 56px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
124
|
@media screen and (max-width: 640px) {
|
|
125
125
|
.dx-code-block-heading {
|
|
126
126
|
display: none;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
+
|
|
130
|
+
/* Adding line numbers via CSS counters */
|
|
131
|
+
code {
|
|
132
|
+
counter-reset: step;
|
|
133
|
+
counter-increment: step 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
code .line::before {
|
|
137
|
+
content: counter(step);
|
|
138
|
+
counter-increment: step;
|
|
139
|
+
width: 1rem;
|
|
140
|
+
margin-right: 1.5rem;
|
|
141
|
+
display: inline-block;
|
|
142
|
+
text-align: right;
|
|
143
|
+
color: rgba(115, 138, 148, 0.4);
|
|
144
|
+
}
|
|
@@ -7,25 +7,6 @@
|
|
|
7
7
|
{ title }
|
|
8
8
|
</div>
|
|
9
9
|
</div>
|
|
10
|
-
<template if:true={showLanguageDropdown}>
|
|
11
|
-
<div class="toolbar-item">
|
|
12
|
-
<dx-dropdown
|
|
13
|
-
small="true"
|
|
14
|
-
options={allLanguages}
|
|
15
|
-
value={selectedLanguageId}
|
|
16
|
-
onchange={onLanguageChange}
|
|
17
|
-
>
|
|
18
|
-
<dx-button
|
|
19
|
-
icon-symbol="chevrondown"
|
|
20
|
-
class="btn language-btn"
|
|
21
|
-
variant="custom"
|
|
22
|
-
>
|
|
23
|
-
{ selectedLanguageLabel }
|
|
24
|
-
</dx-button>
|
|
25
|
-
</dx-dropdown>
|
|
26
|
-
</div>
|
|
27
|
-
<div class="divider"></div>
|
|
28
|
-
</template>
|
|
29
10
|
<template if:true={showCodeSourceBtn}>
|
|
30
11
|
<div class="toolbar-item">
|
|
31
12
|
<dx-tooltip
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LightningElement, api, wire, track } from "lwc";
|
|
2
|
-
import { CodeBlockTheme
|
|
2
|
+
import { CodeBlockTheme } from "typings/custom";
|
|
3
3
|
import cx from "classnames";
|
|
4
|
-
import
|
|
4
|
+
import { Shiki } from "dxUtils/shiki";
|
|
5
5
|
import {
|
|
6
6
|
getLocalStorageData,
|
|
7
7
|
setLocalStorageData
|
|
@@ -24,39 +24,6 @@ export default class CodeBlock extends LightningElement {
|
|
|
24
24
|
// if it is true, it renders code as is coming instead of wrapping it into html/xml comments tags.
|
|
25
25
|
@api isEncoded = false;
|
|
26
26
|
|
|
27
|
-
private markupLangs = ["visualforce", "html", "xml"];
|
|
28
|
-
private _codeBlockRendered: boolean = false;
|
|
29
|
-
private componentLoaded: boolean = false;
|
|
30
|
-
private showLanguageDropdown: boolean = false;
|
|
31
|
-
private copyBtnText: string = "Click to copy";
|
|
32
|
-
private selectedLanguageLabel: string = "";
|
|
33
|
-
private selectedLanguageId: string = "";
|
|
34
|
-
private selectedLanguage: CodeBlockLanguage = { label: "Language", id: "" };
|
|
35
|
-
private allLanguages: CodeBlockLanguage[] = [
|
|
36
|
-
{ label: "Language", id: "" },
|
|
37
|
-
{ label: "Apex", id: "apex" },
|
|
38
|
-
{ label: "Java", id: "java" },
|
|
39
|
-
{ label: "Javascript", id: "javascript" },
|
|
40
|
-
{ label: "CSS", id: "css" },
|
|
41
|
-
{ label: "Visualforce", id: "visualforce" },
|
|
42
|
-
{ label: "Html", id: "html" },
|
|
43
|
-
{ label: "xml", id: "xml" },
|
|
44
|
-
{ label: "TypeScript", id: "typescript" },
|
|
45
|
-
{ label: "PHP", id: "php" },
|
|
46
|
-
{ label: "JSON", id: "json" },
|
|
47
|
-
{ label: "Swift", id: "swift" },
|
|
48
|
-
{ label: "Kotlin", id: "kotlin" },
|
|
49
|
-
{ label: "Python", id: "python" },
|
|
50
|
-
{ label: "Bash", id: "bash" },
|
|
51
|
-
{ label: "Shell", id: "shell" },
|
|
52
|
-
{ label: "Shell", id: "sh" },
|
|
53
|
-
{ label: "SQL", id: "sql" },
|
|
54
|
-
{ label: "YAML", id: "yaml" },
|
|
55
|
-
{ label: "Markdown", id: "markdown" },
|
|
56
|
-
{ label: "Markdown", id: "md" },
|
|
57
|
-
{ label: "JSX", id: "jsx" }
|
|
58
|
-
];
|
|
59
|
-
|
|
60
27
|
connectedCallback() {
|
|
61
28
|
if (!this.theme) {
|
|
62
29
|
this.theme = this.defaultTheme;
|
|
@@ -66,11 +33,11 @@ export default class CodeBlock extends LightningElement {
|
|
|
66
33
|
_codeBlock: string = "";
|
|
67
34
|
@api
|
|
68
35
|
set codeBlock(value: string) {
|
|
69
|
-
this._codeBlockRendered = false;
|
|
70
36
|
let match;
|
|
71
|
-
this._codeBlock = (
|
|
72
|
-
|
|
73
|
-
|
|
37
|
+
this._codeBlock = (
|
|
38
|
+
(match = preTagRegexp.exec(value.trim())) === null
|
|
39
|
+
? value.trim()
|
|
40
|
+
: match[1]
|
|
74
41
|
).trim();
|
|
75
42
|
}
|
|
76
43
|
|
|
@@ -78,12 +45,16 @@ export default class CodeBlock extends LightningElement {
|
|
|
78
45
|
return this._codeBlock;
|
|
79
46
|
}
|
|
80
47
|
|
|
48
|
+
private copyBtnText = "Click to copy";
|
|
81
49
|
@track private theme: CodeBlockTheme | null = null;
|
|
82
50
|
|
|
83
51
|
@wire(getLocalStorageData, { key: "dx-codeblock-theme" })
|
|
84
52
|
updateThemeForCodeblock(value: any) {
|
|
85
53
|
if (themes.includes(value)) {
|
|
86
54
|
this.theme = value;
|
|
55
|
+
// As styles computation is static the code needs to be reformatted after a theme change
|
|
56
|
+
Shiki.setTheme(this.theme!);
|
|
57
|
+
this.formatCodeBlock();
|
|
87
58
|
} else {
|
|
88
59
|
setLocalStorageData(
|
|
89
60
|
LOCAL_STORAGE_KEY,
|
|
@@ -104,7 +75,7 @@ export default class CodeBlock extends LightningElement {
|
|
|
104
75
|
return cx(`dx-theme-${this.theme}`);
|
|
105
76
|
}
|
|
106
77
|
|
|
107
|
-
formatCodeBlock() {
|
|
78
|
+
async formatCodeBlock() {
|
|
108
79
|
const divEl = this.template.querySelector("div.code-block-content");
|
|
109
80
|
const templateEl = document.createElement("template");
|
|
110
81
|
|
|
@@ -117,17 +88,13 @@ export default class CodeBlock extends LightningElement {
|
|
|
117
88
|
"vvvvv$1vvvvv"
|
|
118
89
|
);
|
|
119
90
|
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
this.markupLangs.includes(this.selectedLanguage.id || "")
|
|
123
|
-
) {
|
|
124
|
-
// Temporarily replace HTML comment characters, which Prism would also strip
|
|
125
|
-
cleanCodeBlock = `<!--${cleanCodeBlock.replace(
|
|
91
|
+
if (!this.isEncoded && Shiki.isMarkupLanguage(this.language)) {
|
|
92
|
+
cleanCodeBlock = `${cleanCodeBlock.replace(
|
|
126
93
|
/<!--(.*?)-->/gs,
|
|
127
94
|
"@@$1##"
|
|
128
|
-
)}
|
|
95
|
+
)}`;
|
|
129
96
|
} else {
|
|
130
|
-
// If this is a non-encoded markup language, encode angle brackets
|
|
97
|
+
// If this is a non-encoded markup language, encode angle brackets
|
|
131
98
|
cleanCodeBlock = this.isEncoded
|
|
132
99
|
? cleanCodeBlock
|
|
133
100
|
: cleanCodeBlock.replace(/</g, "<").replace(/>/g, ">");
|
|
@@ -136,42 +103,53 @@ export default class CodeBlock extends LightningElement {
|
|
|
136
103
|
// eslint-disable-next-line
|
|
137
104
|
templateEl.innerHTML = `<pre class='codeblock'>${cleanCodeBlock}</pre>`;
|
|
138
105
|
|
|
139
|
-
const codeBlockEls =
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const codeEl = document.createElement("code");
|
|
145
|
-
codeEl.classList.add(
|
|
146
|
-
`language-${
|
|
147
|
-
this.markupLangs.includes(this.selectedLanguage.id || "")
|
|
148
|
-
? "markup"
|
|
149
|
-
: this.selectedLanguage.id
|
|
150
|
-
}`
|
|
151
|
-
);
|
|
152
|
-
// for custom markup content, it is a workaround to be refactored later.
|
|
153
|
-
// eslint-disable-next-line
|
|
154
|
-
this.language !== "text"
|
|
155
|
-
? // eslint-disable-next-line
|
|
156
|
-
(codeEl.innerHTML = codeHTML)
|
|
157
|
-
: (codeEl.textContent = this._codeBlock.trim());
|
|
158
|
-
// eslint-disable-next-line
|
|
159
|
-
codeBlockEl.innerHTML = "";
|
|
160
|
-
codeBlockEl.appendChild(codeEl);
|
|
161
|
-
Prism.highlightAllUnder(codeBlockEl);
|
|
162
|
-
// Italicize anything marked as a "variable" by the docs team
|
|
106
|
+
const codeBlockEls = Array.from(
|
|
107
|
+
templateEl.content.querySelectorAll("pre")
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
const promisesForHighlighted = codeBlockEls.map((codeBlockEl) =>
|
|
163
111
|
// eslint-disable-next-line
|
|
164
|
-
codeBlockEl.innerHTML
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
112
|
+
Shiki.codeToHtml(codeBlockEl.innerHTML, {
|
|
113
|
+
lang: this.language
|
|
114
|
+
})
|
|
115
|
+
.then((highlightedCode) => {
|
|
116
|
+
// for custom markup content, it is a workaround to be refactored later.
|
|
117
|
+
const codeTemplate = document.createElement("template");
|
|
118
|
+
// eslint-disable-next-line
|
|
119
|
+
this.language !== "text"
|
|
120
|
+
? // eslint-disable-next-line
|
|
121
|
+
(codeTemplate.innerHTML = highlightedCode)
|
|
122
|
+
: (codeTemplate.textContent = this._codeBlock.trim());
|
|
123
|
+
// eslint-disable-next-line
|
|
124
|
+
codeBlockEl.innerHTML = "";
|
|
125
|
+
codeBlockEl.appendChild(codeTemplate.content);
|
|
126
|
+
|
|
127
|
+
// Italicize anything marked as a "variable" by the docs team
|
|
128
|
+
// eslint-disable-next-line
|
|
129
|
+
codeBlockEl.innerHTML = codeBlockEl.innerHTML.replace(
|
|
130
|
+
/vvvvv(.+?)vvvvv/g,
|
|
131
|
+
"<span class='token italic'>$1</span>"
|
|
132
|
+
);
|
|
133
|
+
})
|
|
134
|
+
.catch((error) => {
|
|
135
|
+
console.error(error);
|
|
136
|
+
// Italicize anything marked as a "variable" by the docs team
|
|
137
|
+
// eslint-disable-next-line
|
|
138
|
+
codeBlockEl.innerHTML = codeBlockEl.innerHTML.replace(
|
|
139
|
+
/vvvvv(.+?)vvvvv/g,
|
|
140
|
+
"<span class='token italic'>$1</span>"
|
|
141
|
+
);
|
|
142
|
+
})
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
await Promise.all(promisesForHighlighted);
|
|
169
146
|
|
|
170
147
|
if (divEl) {
|
|
171
148
|
// eslint-disable-next-line
|
|
172
149
|
divEl.innerHTML = "";
|
|
173
150
|
divEl.append(templateEl.content);
|
|
174
|
-
|
|
151
|
+
|
|
152
|
+
if (Shiki.isMarkupLanguage(this.language)) {
|
|
175
153
|
const res = this.template.querySelector(`code.language-markup`);
|
|
176
154
|
if (res) {
|
|
177
155
|
// Restore any temporarily replaced HTML comment characters
|
|
@@ -185,25 +163,6 @@ export default class CodeBlock extends LightningElement {
|
|
|
185
163
|
}
|
|
186
164
|
}
|
|
187
165
|
|
|
188
|
-
onLanguageChange(newLang: any) {
|
|
189
|
-
this.selectedLanguage =
|
|
190
|
-
this.allLanguages.find(
|
|
191
|
-
(lang: CodeBlockLanguage) => lang.id === newLang.detail
|
|
192
|
-
) || this.allLanguages[0];
|
|
193
|
-
this.selectedLanguageLabel = this.selectedLanguage.label;
|
|
194
|
-
this.selectedLanguageId = this.selectedLanguage.id;
|
|
195
|
-
this.formatCodeBlock();
|
|
196
|
-
|
|
197
|
-
gtmTrack(newLang, "custEv_ctaLinkClick", {
|
|
198
|
-
event: "custEv_ctaLinkClick",
|
|
199
|
-
click_text: newLang.detail,
|
|
200
|
-
element_title: "dx-dropdown",
|
|
201
|
-
click_url: this.selectedLanguageId,
|
|
202
|
-
element_type: "link",
|
|
203
|
-
content_category: "code block"
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
|
|
207
166
|
/**
|
|
208
167
|
* Note: There is a known issue in storybook@6.1.13 where some apis are not available if you access Storybook through IP address.
|
|
209
168
|
* https://github.com/storybookjs/storybook/issues/13529
|
|
@@ -217,9 +176,8 @@ export default class CodeBlock extends LightningElement {
|
|
|
217
176
|
});
|
|
218
177
|
|
|
219
178
|
try {
|
|
220
|
-
const snippetContainer: HTMLElement | null =
|
|
221
|
-
".code-block-content"
|
|
222
|
-
);
|
|
179
|
+
const snippetContainer: HTMLElement | null =
|
|
180
|
+
this.template.querySelector(".code-block-content");
|
|
223
181
|
if (snippetContainer && snippetContainer.textContent) {
|
|
224
182
|
await navigator.clipboard.writeText(
|
|
225
183
|
snippetContainer.textContent
|
|
@@ -236,6 +194,9 @@ export default class CodeBlock extends LightningElement {
|
|
|
236
194
|
|
|
237
195
|
updateTheme(event: any) {
|
|
238
196
|
this.theme = this.theme === DARK ? LIGHT : DARK;
|
|
197
|
+
// As styles computation is static the code needs to be reformatted after a theme change
|
|
198
|
+
Shiki.setTheme(this.theme);
|
|
199
|
+
this.formatCodeBlock();
|
|
239
200
|
setLocalStorageData(LOCAL_STORAGE_KEY, this.theme);
|
|
240
201
|
|
|
241
202
|
gtmTrack(event.target, "custEv_iconClick", {
|
|
@@ -247,16 +208,6 @@ export default class CodeBlock extends LightningElement {
|
|
|
247
208
|
}
|
|
248
209
|
|
|
249
210
|
renderedCallback() {
|
|
250
|
-
if (this._codeBlockRendered) {
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
this.selectedLanguage =
|
|
254
|
-
this.allLanguages.find(
|
|
255
|
-
(l: CodeBlockLanguage) => l.id === this.language
|
|
256
|
-
) || this.allLanguages[0];
|
|
257
|
-
this.selectedLanguageLabel = this.selectedLanguage.label;
|
|
258
|
-
this.selectedLanguageId = this.selectedLanguage.id;
|
|
259
211
|
this.formatCodeBlock();
|
|
260
|
-
this._codeBlockRendered = true;
|
|
261
212
|
}
|
|
262
213
|
}
|
|
@@ -172,9 +172,8 @@ export default class Dropdown extends LightningElement {
|
|
|
172
172
|
? this.findOptionElementIndex(this.value)
|
|
173
173
|
: 0;
|
|
174
174
|
|
|
175
|
-
const optionToFocus: any =
|
|
176
|
-
defaultIndex < 0 ? 0 : defaultIndex
|
|
177
|
-
];
|
|
175
|
+
const optionToFocus: any =
|
|
176
|
+
this.optionsElements[defaultIndex < 0 ? 0 : defaultIndex];
|
|
178
177
|
if (optionToFocus) {
|
|
179
178
|
optionToFocus.focus();
|
|
180
179
|
this._focusedValue = optionToFocus.option.id;
|
|
@@ -62,7 +62,10 @@
|
|
|
62
62
|
stroke-width="2"
|
|
63
63
|
stroke-linecap="round"
|
|
64
64
|
stroke-linejoin="round"
|
|
65
|
-
class="
|
|
65
|
+
class="
|
|
66
|
+
feather feather-chevron-down
|
|
67
|
+
year-caret
|
|
68
|
+
"
|
|
66
69
|
>
|
|
67
70
|
<polyline
|
|
68
71
|
points="6 9 12 15 18 9"
|
|
@@ -85,7 +88,9 @@
|
|
|
85
88
|
{month.id}
|
|
86
89
|
<span
|
|
87
90
|
if:true={filtersDatesLoading}
|
|
88
|
-
class="
|
|
91
|
+
class="
|
|
92
|
+
filters-dates-loading
|
|
93
|
+
"
|
|
89
94
|
></span>
|
|
90
95
|
<span
|
|
91
96
|
if:false={filtersDatesLoading}
|
|
@@ -80,9 +80,10 @@ export default class FilterMenu extends LightningElement {
|
|
|
80
80
|
|
|
81
81
|
private setIntedeterminateStatus(checkbox: any, value: boolean) {
|
|
82
82
|
if ("isYear" in checkbox.value && !checkbox.value.isYear) {
|
|
83
|
-
const yearCheckBox: any =
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
const yearCheckBox: any =
|
|
84
|
+
checkbox.parentElement.parentElement.parentElement.querySelector(
|
|
85
|
+
".checkbox-year"
|
|
86
|
+
);
|
|
86
87
|
yearCheckBox.indeterminate = value;
|
|
87
88
|
}
|
|
88
89
|
}
|
|
@@ -81,8 +81,7 @@ export const generalLinksRaw: OptionWithRequiredNested[] = [
|
|
|
81
81
|
options: [
|
|
82
82
|
{
|
|
83
83
|
link: {
|
|
84
|
-
href:
|
|
85
|
-
"https://trailhead.salesforce.com/trailblazer-community/feed"
|
|
84
|
+
href: "https://trailhead.salesforce.com/trailblazer-community/feed"
|
|
86
85
|
},
|
|
87
86
|
label: "Trailblazer Community",
|
|
88
87
|
id: "Trailblazer Community"
|
|
@@ -159,8 +158,7 @@ export const termsLinks = [
|
|
|
159
158
|
label: "Legal"
|
|
160
159
|
},
|
|
161
160
|
{
|
|
162
|
-
href:
|
|
163
|
-
"https://www.salesforce.com/company/privacy/full_privacy/#nav_info",
|
|
161
|
+
href: "https://www.salesforce.com/company/privacy/full_privacy/#nav_info",
|
|
164
162
|
label: "Use of Cookies"
|
|
165
163
|
},
|
|
166
164
|
{ href: "https://trust.salesforce.com/en/", label: "Trust" },
|
|
@@ -67,6 +67,8 @@ export default class Grid extends LightningElement {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
onSlotChange(e: Event) {
|
|
70
|
-
this._itemCount = (
|
|
70
|
+
this._itemCount = (
|
|
71
|
+
e.target as LightningSlotElement
|
|
72
|
+
).assignedElements().length;
|
|
71
73
|
}
|
|
72
74
|
}
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
class="header-tbid-login"
|
|
25
25
|
onclick={closeMobileNavMenu}
|
|
26
26
|
>
|
|
27
|
-
<dw-tbid-login-menu
|
|
27
|
+
<dw-tbid-login-menu
|
|
28
|
+
tbid-api-base-url={tbidApiBaseUrl}
|
|
29
|
+
tbid-base-url={tbidBaseUrl}
|
|
30
|
+
></dw-tbid-login-menu>
|
|
28
31
|
</div>
|
|
29
32
|
<div if:true={showSignup} class="header-login-signup">
|
|
30
33
|
<dx-button
|
|
@@ -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));
|
|
@@ -17,9 +17,7 @@ interface CoveoSearch {
|
|
|
17
17
|
|
|
18
18
|
declare const Coveo: CoveoSearch;
|
|
19
19
|
|
|
20
|
-
function getPaginationState(
|
|
21
|
-
event: CoveoSDK.IQuerySuccessEventArgs
|
|
22
|
-
): {
|
|
20
|
+
function getPaginationState(event: CoveoSDK.IQuerySuccessEventArgs): {
|
|
23
21
|
numberOfPages: number;
|
|
24
22
|
currentPage: number;
|
|
25
23
|
} {
|
|
@@ -79,9 +79,8 @@ export default class Select extends LightningElement {
|
|
|
79
79
|
|
|
80
80
|
get selectElement() {
|
|
81
81
|
if (!this._selectElement) {
|
|
82
|
-
this._selectElement =
|
|
83
|
-
"select"
|
|
84
|
-
);
|
|
82
|
+
this._selectElement =
|
|
83
|
+
this.template.querySelector<HTMLSelectElement>("select");
|
|
85
84
|
}
|
|
86
85
|
return this._selectElement;
|
|
87
86
|
}
|
|
@@ -51,9 +51,11 @@ export default class Sidebar extends SidebarBase {
|
|
|
51
51
|
|
|
52
52
|
@api
|
|
53
53
|
setInputValue(searchTerm: string) {
|
|
54
|
-
(
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
(
|
|
55
|
+
this.template.querySelector(
|
|
56
|
+
"dx-sidebar-search"
|
|
57
|
+
) as unknown as SidebarSearch
|
|
58
|
+
)?.setInputValue(searchTerm);
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
private expanded: boolean = true;
|
|
@@ -213,9 +215,9 @@ export default class Sidebar extends SidebarBase {
|
|
|
213
215
|
return;
|
|
214
216
|
}
|
|
215
217
|
|
|
216
|
-
const search =
|
|
218
|
+
const search = this.template.querySelector(
|
|
217
219
|
"dx-sidebar-search"
|
|
218
|
-
) as unknown
|
|
220
|
+
) as unknown as SidebarSearch;
|
|
219
221
|
|
|
220
222
|
if (
|
|
221
223
|
this.isNearBottomOfSearchResults &&
|
|
@@ -247,11 +247,8 @@ export default class SidebarSearch extends LightningElement {
|
|
|
247
247
|
return;
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
const {
|
|
251
|
-
|
|
252
|
-
firstSearchExecuted,
|
|
253
|
-
results
|
|
254
|
-
} = this.resultList.state;
|
|
250
|
+
const { isLoading, firstSearchExecuted, results } =
|
|
251
|
+
this.resultList.state;
|
|
255
252
|
|
|
256
253
|
if ((!firstSearchExecuted && !isLoading) || !this.value) {
|
|
257
254
|
// coveo search is firing off some unwanted payloads on startup
|
|
@@ -123,8 +123,8 @@ export default class TabPanelList extends LightningElement {
|
|
|
123
123
|
"dx-tab-panel-item:not(.more-btn-container)"
|
|
124
124
|
);
|
|
125
125
|
const moreBtn = this.template.querySelector(".more-btn-container")!;
|
|
126
|
-
const containerWidth =
|
|
127
|
-
.offsetWidth;
|
|
126
|
+
const containerWidth =
|
|
127
|
+
this.template.querySelector(".tablist")!.offsetWidth;
|
|
128
128
|
let stopWidth = this.template.querySelector(
|
|
129
129
|
"dx-tab-panel-item.more-btn-container"
|
|
130
130
|
)!.offsetWidth;
|
|
@@ -38,6 +38,8 @@ export abstract class HeaderBase extends LightningElement {
|
|
|
38
38
|
@api signupLink?: string | null = null;
|
|
39
39
|
@api href = null;
|
|
40
40
|
@api subtitle!: string;
|
|
41
|
+
@api tbidApiBaseUrl: string | null = null;
|
|
42
|
+
@api tbidBaseUrl: string | null = null;
|
|
41
43
|
@api title: string = "Salesforce";
|
|
42
44
|
@api version?: string | null = null;
|
|
43
45
|
@api bannerMarkup =
|
|
@@ -19,10 +19,8 @@ const breakpointConfigs = [
|
|
|
19
19
|
];
|
|
20
20
|
|
|
21
21
|
export abstract class MatchMediaElement extends LightningElement {
|
|
22
|
-
private deviceType:
|
|
23
|
-
|
|
24
|
-
| DEVICE_TABLET
|
|
25
|
-
| DEVICE_DESKTOP = DEVICE_DESKTOP;
|
|
22
|
+
private deviceType: DEVICE_MOBILE | DEVICE_TABLET | DEVICE_DESKTOP =
|
|
23
|
+
DEVICE_DESKTOP;
|
|
26
24
|
private matches: {
|
|
27
25
|
match: MediaQueryList;
|
|
28
26
|
callback: (e: MediaQueryListEvent | MediaQueryList) => void;
|