@salesforcedevs/dx-components 0.50.0 → 0.53.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/lwc.config.json +0 -1
- package/package.json +2 -3
- package/src/assets/svg/sidebar-item-loading.svg +9 -0
- package/src/modules/dx/codeBlock/codeBlock.ts +3 -1
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.css +3 -3
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.html +1 -1
- package/src/modules/dx/sidebarOld/sidebarOld.ts +3 -2
- package/src/modules/dx/tree/treeHandler.ts +1 -0
- package/src/modules/dx/treeItem/treeItem.css +6 -0
- package/src/modules/dx/treeItem/treeItem.html +7 -0
- package/src/modules/dx/treeItem/treeItem.ts +12 -2
- package/src/modules/dx/treeTile/treeTile.html +1 -1
- package/src/modules/dx/treeTile/treeTile.ts +1 -0
- package/src/modules/utils/prismjs/prismjs.ts +1197 -919
- package/LICENSE +0 -12
package/lwc.config.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/dx-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
4
4
|
"description": "DX Lightning web components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"engines": {
|
|
@@ -27,6 +27,5 @@
|
|
|
27
27
|
"@types/debounce": "^1.2.0",
|
|
28
28
|
"@types/lodash.get": "^4.4.6",
|
|
29
29
|
"@types/vimeo__player": "^2.16.2"
|
|
30
|
-
}
|
|
31
|
-
"gitHead": "5a96beba6d612129769dc371af08b2489bee1933"
|
|
30
|
+
}
|
|
32
31
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg width="100%" height="128" fill="none"
|
|
2
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<mask id="mask0_581_15739" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="16" y="8" width="267" height="112">
|
|
4
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M24 8C19.5817 8 16 11.5817 16 16C16 20.4183 19.5817 24 24 24H252C256.418 24 260 20.4183 260 16C260 11.5817 256.418 8 252 8H24ZM24 40C19.5817 40 16 43.5817 16 48C16 52.4183 19.5817 56 24 56H213C217.418 56 221 52.4183 221 48C221 43.5817 217.418 40 213 40H24ZM16 80C16 75.5817 19.5817 72 24 72H275C279.418 72 283 75.5817 283 80C283 84.4183 279.418 88 275 88H24C19.5817 88 16 84.4183 16 80ZM24 104C19.5817 104 16 107.582 16 112C16 116.418 19.5817 120 24 120H175C179.418 120 183 116.418 183 112C183 107.582 179.418 104 175 104H24Z" fill="#E5E5E5"/>
|
|
5
|
+
</mask>
|
|
6
|
+
<g mask="url(#mask0_581_15739)">
|
|
7
|
+
<rect width="100%" height="128" fill="#E5E5E5"/>
|
|
8
|
+
</g>
|
|
9
|
+
</svg>
|
|
@@ -43,7 +43,9 @@ export default class CodeBlock extends LightningElement {
|
|
|
43
43
|
{ label: "xml", id: "xml" },
|
|
44
44
|
{ label: "TypeScript", id: "typescript" },
|
|
45
45
|
{ label: "PHP", id: "php" },
|
|
46
|
-
{ label: "JSON", id: "json" }
|
|
46
|
+
{ label: "JSON", id: "json" },
|
|
47
|
+
{ label: "Swift", id: "swift" },
|
|
48
|
+
{ label: "Kotlin", id: "kotlin" }
|
|
47
49
|
];
|
|
48
50
|
|
|
49
51
|
connectedCallback() {
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
/* Z INDEX STUFF */
|
|
232
232
|
|
|
233
233
|
.label,
|
|
234
|
-
.main-content,
|
|
234
|
+
.featured-content-main-content,
|
|
235
235
|
.image-container {
|
|
236
236
|
position: relative;
|
|
237
237
|
z-index: var(--swoop-z-index);
|
|
@@ -269,12 +269,12 @@ a.image-container > img {
|
|
|
269
269
|
|
|
270
270
|
/* MAIN CONTENT AREA */
|
|
271
271
|
|
|
272
|
-
.main-content {
|
|
272
|
+
.featured-content-main-content {
|
|
273
273
|
grid-area: main;
|
|
274
274
|
max-width: var(--dx-c-featured-content-main-content-max-width);
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
-
.main-content > * {
|
|
277
|
+
.featured-content-main-content > * {
|
|
278
278
|
z-index: 10;
|
|
279
279
|
}
|
|
280
280
|
|
|
@@ -160,8 +160,9 @@ export default class Sidebar extends SidebarBase {
|
|
|
160
160
|
valuePattern: RegExp,
|
|
161
161
|
node: TreeNode
|
|
162
162
|
): TreeNode | undefined {
|
|
163
|
+
const isExpanded = node.isChildrenLoading ? false : true;
|
|
163
164
|
if (valuePattern.test(node.label.toLowerCase())) {
|
|
164
|
-
return { ...node, isExpanded
|
|
165
|
+
return { ...node, isExpanded };
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
const filteredChildren = this.filterChildren(
|
|
@@ -169,7 +170,7 @@ export default class Sidebar extends SidebarBase {
|
|
|
169
170
|
node.children
|
|
170
171
|
);
|
|
171
172
|
return filteredChildren.length > 0
|
|
172
|
-
? { ...node, children: filteredChildren, isExpanded
|
|
173
|
+
? { ...node, children: filteredChildren, isExpanded }
|
|
173
174
|
: undefined;
|
|
174
175
|
}
|
|
175
176
|
|
|
@@ -8,8 +8,15 @@
|
|
|
8
8
|
has-children={hasChildren}
|
|
9
9
|
is-selected={isSelected}
|
|
10
10
|
oniconclick={onIconClick}
|
|
11
|
+
show-arrow={isParent}
|
|
11
12
|
></dx-tree-tile>
|
|
12
13
|
</a>
|
|
14
|
+
<img
|
|
15
|
+
if:true={showChildrenLoading}
|
|
16
|
+
class="tree-children-loading"
|
|
17
|
+
src="/assets/svg/sidebar-item-loading.svg"
|
|
18
|
+
alt="childrenLoading"
|
|
19
|
+
/>
|
|
13
20
|
<template if:true={showChildren}>
|
|
14
21
|
<template for:each={treeNode.children} for:item="child">
|
|
15
22
|
<dx-tree-item
|
|
@@ -18,10 +18,12 @@ export default class TreeItem extends LightningElement {
|
|
|
18
18
|
public set treeNode(node) {
|
|
19
19
|
this._treeNode = node;
|
|
20
20
|
this.isExpanded = (node && node.isExpanded) || false;
|
|
21
|
+
this.isChildrenLoading = (node && node.isChildrenLoading) || false;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
private _treeNode!: InternalTreeNode;
|
|
24
25
|
private isExpanded: boolean = false;
|
|
26
|
+
private isChildrenLoading: boolean = false;
|
|
25
27
|
|
|
26
28
|
private get isSelected(): boolean {
|
|
27
29
|
return this._treeNode.key === this.selectedKey;
|
|
@@ -35,6 +37,14 @@ export default class TreeItem extends LightningElement {
|
|
|
35
37
|
);
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
private get showChildrenLoading(): boolean {
|
|
41
|
+
return this.isExpanded && !this.hasChildren && this.isChildrenLoading;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
private get isParent(): boolean {
|
|
45
|
+
return this.hasChildren || this.isChildrenLoading;
|
|
46
|
+
}
|
|
47
|
+
|
|
38
48
|
private get showChildren(): boolean {
|
|
39
49
|
return this.isExpanded && this.hasChildren;
|
|
40
50
|
}
|
|
@@ -55,7 +65,7 @@ export default class TreeItem extends LightningElement {
|
|
|
55
65
|
}
|
|
56
66
|
|
|
57
67
|
connectedCallback(): void {
|
|
58
|
-
if (this.
|
|
68
|
+
if (this.isParent) {
|
|
59
69
|
this.fireEvent("register", {
|
|
60
70
|
setExpanded: this.setExpanded.bind(this)
|
|
61
71
|
});
|
|
@@ -92,7 +102,7 @@ export default class TreeItem extends LightningElement {
|
|
|
92
102
|
event.preventDefault();
|
|
93
103
|
}
|
|
94
104
|
|
|
95
|
-
if (this.
|
|
105
|
+
if (this.isParent) {
|
|
96
106
|
const isSelectAction = true;
|
|
97
107
|
this.doExpand(isSelectAction);
|
|
98
108
|
}
|