@salesforcedevs/docs-components 1.3.345-spage → 1.3.345-sppage-alpha

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.345-spage",
3
+ "version": "1.3.345-sppage-alpha",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -1,9 +1,10 @@
1
- import { LightningElement, track } from "lwc";
1
+ import { LightningElement, track, api } from "lwc";
2
2
  import { toJson } from "dxUtils/normalizers";
3
3
 
4
4
  export default class specificationContent extends LightningElement {
5
5
  @track data: any; // Reactive property to store fetched data
6
6
  @track error: any; // To track any errors
7
+ @api component: string = "button";
7
8
 
8
9
  // Lifecycle method to fetch data when the component is inserted into the DOM
9
10
  connectedCallback() {
@@ -12,7 +13,8 @@ export default class specificationContent extends LightningElement {
12
13
 
13
14
  // Method to make the API call
14
15
  loadData() {
15
- fetch("http://localhost:3002/card") // Sample API URL
16
+ const url = `http://localhost:3002/get-properties?component=${this.component}`;
17
+ fetch(url) // Sample API URL
16
18
  .then((response) => response.json()) // Convert response to JSON
17
19
  .then((result) => {
18
20
  this.data = toJson(result); // Store data to update UI
@@ -26,12 +28,12 @@ export default class specificationContent extends LightningElement {
26
28
 
27
29
  // Helper to check if attributes exist
28
30
  get hasAttributes() {
29
- return this.data?.attribute;
31
+ return this.data?.attributes;
30
32
  }
31
33
 
32
34
  // Helper to check if methods exist
33
35
  get hasMethods() {
34
- return this.data?.method;
36
+ return this.data?.methods;
35
37
  }
36
38
 
37
39
  // Helper to check if slots exist