@salesforcedevs/docs-components 1.3.344 → 1.3.345-spage

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 CHANGED
@@ -18,6 +18,7 @@
18
18
  "doc/headingAnchor",
19
19
  "doc/overview",
20
20
  "doc/phase",
21
+ "doc/specificationContent",
21
22
  "doc/versionPicker",
22
23
  "doc/xmlContent",
23
24
  "docUtils/utils"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.344",
3
+ "version": "1.3.345-spage",
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": "189d356c6cb2b3cca66b7728a288036c6850421a"
27
+ "gitHead": "4629fdd9ca18a13480044ad43515b91945d16aad"
28
28
  }
@@ -456,8 +456,6 @@ export default class ContentLayout extends LightningElement {
456
456
  this.observer.observe(headingElement);
457
457
  }
458
458
 
459
- this.contentLoaded = true;
460
-
461
459
  if (!this.didScrollToSelectedHash) {
462
460
  this.didScrollToSelectedHash = true;
463
461
  this.scrollToHash(headingElements);
@@ -466,6 +464,7 @@ export default class ContentLayout extends LightningElement {
466
464
 
467
465
  onSlotChange(): void {
468
466
  this.updateRNB();
467
+ this.contentLoaded = true;
469
468
  }
470
469
 
471
470
  // eslint-disable-next-line no-undef
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <lightning-card title="Fetched Data">
3
+ <!-- Display Attributes if they exist -->
4
+ <template if:true={hasAttributes}>
5
+ <h3>Attributes</h3>
6
+ <ul>
7
+ <template for:each={data.attribute} for:item="attr">
8
+ <li key={attr.name}>
9
+ <strong>{attr.name}:</strong>
10
+ {attr.desc}
11
+ </li>
12
+ </template>
13
+ </ul>
14
+ </template>
15
+
16
+ <!-- Display Methods if they exist -->
17
+ <template if:true={hasMethods}>
18
+ <h3>Methods</h3>
19
+ <ul>
20
+ <template for:each={data.method} for:item="method">
21
+ <li key={method.name}>
22
+ <strong>{method.name}:</strong>
23
+ {method.desc}
24
+ </li>
25
+ </template>
26
+ </ul>
27
+ </template>
28
+
29
+ <!-- Display Slots if they exist -->
30
+ <template if:true={hasSlots}>
31
+ <h3>Slots</h3>
32
+ <ul>
33
+ <template for:each={data.slots} for:item="slot">
34
+ <li key={slot.name}>
35
+ <strong>{slot.name}:</strong>
36
+ {slot.desc}
37
+ </li>
38
+ </template>
39
+ </ul>
40
+ </template>
41
+
42
+ <template if:true={error}>
43
+ <p>Error fetching data: {error}</p>
44
+ </template>
45
+ </lightning-card>
46
+ </template>
@@ -0,0 +1,41 @@
1
+ import { LightningElement, track } from "lwc";
2
+ import { toJson } from "dxUtils/normalizers";
3
+
4
+ export default class specificationContent extends LightningElement {
5
+ @track data: any; // Reactive property to store fetched data
6
+ @track error: any; // To track any errors
7
+
8
+ // Lifecycle method to fetch data when the component is inserted into the DOM
9
+ connectedCallback() {
10
+ this.loadData();
11
+ }
12
+
13
+ // Method to make the API call
14
+ loadData() {
15
+ fetch("http://localhost:3002/card") // Sample API URL
16
+ .then((response) => response.json()) // Convert response to JSON
17
+ .then((result) => {
18
+ this.data = toJson(result); // Store data to update UI
19
+ this.error = undefined; // Clear any previous errors
20
+ })
21
+ .catch((error) => {
22
+ this.error = error; // Capture any errors
23
+ this.data = {}; // Clear data on error
24
+ });
25
+ }
26
+
27
+ // Helper to check if attributes exist
28
+ get hasAttributes() {
29
+ return this.data?.attribute;
30
+ }
31
+
32
+ // Helper to check if methods exist
33
+ get hasMethods() {
34
+ return this.data?.method;
35
+ }
36
+
37
+ // Helper to check if slots exist
38
+ get hasSlots() {
39
+ return this.data?.slots;
40
+ }
41
+ }
package/LICENSE DELETED
@@ -1,12 +0,0 @@
1
- Copyright (c) 2020, Salesforce.com, Inc.
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5
-
6
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7
-
8
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
9
-
10
- * Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11
-
12
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.