@salesforcedevs/docs-components 1.3.396 → 1.3.399
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforcedevs/docs-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.399",
|
|
4
4
|
"description": "Docs Lightning web components for DSC",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "index.js",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"@types/lodash.orderby": "4.6.9",
|
|
25
25
|
"@types/lodash.uniqby": "4.7.9"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "970b521a455eea0f683d2e6c37bdbd7b103fec5e"
|
|
28
28
|
}
|
|
@@ -28,8 +28,8 @@ export default class Breadcrumbs extends LightningElement {
|
|
|
28
28
|
set breadcrumbs(value) {
|
|
29
29
|
this.normalizeAndAssignBreadcrumbs(value);
|
|
30
30
|
this.calculateBreadcrumbsConfigs();
|
|
31
|
-
if (this.
|
|
32
|
-
this.
|
|
31
|
+
if (this.isRendered) {
|
|
32
|
+
this.onWidthOrContentChange();
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -45,9 +45,9 @@ export default class Breadcrumbs extends LightningElement {
|
|
|
45
45
|
private _breadcrumbs: Breadcrumb[] = [];
|
|
46
46
|
private _pixelPerCharacter = CONSTANTS.pixelPerCharacter;
|
|
47
47
|
private navWidth = 0;
|
|
48
|
-
private observer: ResizeObserver | null = null;
|
|
49
48
|
private breadcrumbConfigs: BreadcrumbConfig[] = [];
|
|
50
49
|
private dropdownOptionAmount? = 0;
|
|
50
|
+
private isRendered = false;
|
|
51
51
|
|
|
52
52
|
private get renderSmallVariant(): boolean {
|
|
53
53
|
return (
|
|
@@ -110,30 +110,21 @@ export default class Breadcrumbs extends LightningElement {
|
|
|
110
110
|
};
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
private onWidthOrContentChange = () => {
|
|
114
|
+
this.navWidth = this.template
|
|
115
|
+
.querySelector("nav")!
|
|
116
|
+
.getBoundingClientRect().width;
|
|
117
|
+
this.updateDropdownOptionAmount();
|
|
118
|
+
};
|
|
119
|
+
|
|
113
120
|
renderedCallback(): void {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const [nav] = entries;
|
|
118
|
-
if (this.navWidth === nav.contentRect.width) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
this.navWidth = nav.contentRect.width;
|
|
122
|
-
this.updateDropdownOptionAmount();
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
this.observer.observe(this.template.querySelector("nav")!);
|
|
126
|
-
} catch (error) {
|
|
127
|
-
console.error(
|
|
128
|
-
"Error occured while setting up ResizeObserver on breadcrumbs",
|
|
129
|
-
error
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
121
|
+
this.isRendered = true;
|
|
122
|
+
this.onWidthOrContentChange();
|
|
123
|
+
window.addEventListener("resize", this.onWidthOrContentChange);
|
|
133
124
|
}
|
|
134
125
|
|
|
135
126
|
disconnectedCallback(): void {
|
|
136
|
-
this.
|
|
127
|
+
window.removeEventListener("resize", this.onWidthOrContentChange);
|
|
137
128
|
}
|
|
138
129
|
|
|
139
130
|
private normalizeAndAssignBreadcrumbs(breadcrumbs?: Breadcrumb[] | string) {
|