@salesforcedevs/docs-components 0.74.3-alpha.0 → 0.74.3-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "0.74.3-alpha.0",
3
+ "version": "0.74.3-alpha.1",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -152,6 +152,10 @@ export default class Breadcrumbs extends LightningElement {
152
152
  }
153
153
 
154
154
  private calculateBreadcrumbsConfigs(): void {
155
+ if (!this.breadcrumbs.length) {
156
+ return;
157
+ }
158
+
155
159
  this.breadcrumbConfigs = [
156
160
  ...Array(this._breadcrumbs.length - 1).keys()
157
161
  ].map((optionsAmount) => {
@@ -173,23 +177,15 @@ export default class Breadcrumbs extends LightningElement {
173
177
  breadcrumbs: Breadcrumb[],
174
178
  offset: number = 0
175
179
  ): number {
176
- return breadcrumbs.reduce((previousValue, element) => {
177
- if (!element.label) {
178
- console.error(
179
- "Breadcrumb label not found for element: ",
180
- element
181
- );
182
- return previousValue;
183
- }
184
-
185
- return (
180
+ return breadcrumbs.reduce(
181
+ (previousValue, element) =>
186
182
  previousValue +
187
183
  Math.min(
188
184
  element.label.length *
189
185
  (this.pixelPerCharacter || CONSTANTS.pixelPerCharacter),
190
186
  CONSTANTS.minWidthPerCrumb
191
- )
192
- );
193
- }, (breadcrumbs.length - 1) * CONSTANTS.pixelPerCrumbSpace + offset);
187
+ ),
188
+ (breadcrumbs.length - 1) * CONSTANTS.pixelPerCrumbSpace + offset
189
+ );
194
190
  }
195
191
  }