@salesforcedevs/docs-components 1.3.345-spPage-alpha1 → 1.3.345-spec-ux-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-spPage-alpha1",
3
+ "version": "1.3.345-spec-ux-alpha",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -11,6 +11,9 @@
11
11
  <thead>
12
12
  <tr>
13
13
  <th>Name</th>
14
+ <th>Type</th>
15
+ <th>Required</th>
16
+ <th>Default</th>
14
17
  <th>Description</th>
15
18
  </tr>
16
19
  </thead>
@@ -18,6 +21,9 @@
18
21
  <template for:each={attributes} for:item="attribute">
19
22
  <tr key={attribute.name}>
20
23
  <td>{attribute.nameInKebabCase}</td>
24
+ <td>{attribute.type}</td>
25
+ <td>{attribute.required}</td>
26
+ <td>{attribute.default}</td>
21
27
  <td>{attribute.description}</td>
22
28
  </tr>
23
29
  </template>
@@ -36,6 +42,7 @@
36
42
  <thead>
37
43
  <tr>
38
44
  <th>Name</th>
45
+ <th>Arguments</th>
39
46
  <th>Description</th>
40
47
  </tr>
41
48
  </thead>
@@ -43,6 +50,33 @@
43
50
  <template for:each={methods} for:item="method">
44
51
  <tr key={method.name}>
45
52
  <td>{method.nameInKebabCase}</td>
53
+ <td>
54
+ <template if:true={method.arguments.length}>
55
+ <table>
56
+ <thead>
57
+ <tr>
58
+ <th>Name</th>
59
+ <th>Type</th>
60
+ <th>Description</th>
61
+ </tr>
62
+ </thead>
63
+ <tbody>
64
+ <template
65
+ for:each={method.arguments}
66
+ for:item="argument"
67
+ >
68
+ <tr key={argument.name}>
69
+ <td>{argument.name}</td>
70
+ <td>{argument.type}</td>
71
+ <td>
72
+ {argument.description}
73
+ </td>
74
+ </tr>
75
+ </template>
76
+ </tbody>
77
+ </table>
78
+ </template>
79
+ </td>
46
80
  <td>{method.description}</td>
47
81
  </tr>
48
82
  </template>
@@ -2,11 +2,12 @@ import { LightningElement, track, api } from "lwc";
2
2
 
3
3
  export default class SpecificationContent extends LightningElement {
4
4
  @track data: any;
5
+ // TODO: added these default values for testing, will drop this once the backend is ready.
5
6
  @api component: string = "button";
6
- @api type: string = "lwc";
7
- @api subType: string = "lightning";
7
+ @api model: string = "lwc";
8
+ @api namespace: string = "lightning";
8
9
 
9
- /* The actual URL is as follows:
10
+ /* TODO: The actual URL is as follows:
10
11
  * http://api.salesforce.com/doc-platform/developer/v1/{type}/{sub-type}/{component-name}
11
12
  * Until the API integration is ready, we will go ahead with mocked-router-url.
12
13
  */
@@ -23,12 +24,13 @@ export default class SpecificationContent extends LightningElement {
23
24
  }
24
25
 
25
26
  async fetchComponentMetadata() {
26
- const url = `${this.routerUrl}/${this.type}/${this.subType}/${this.component}`;
27
+ const url = `${this.routerUrl}/${this.model}/${this.namespace}/${this.component}`;
27
28
 
28
29
  try {
29
30
  const response = await fetch(url);
30
31
 
31
32
  if (!response.ok) {
33
+ // TODO: Will add loader and show error as follow-up
32
34
  throw new Error(`Failed to fetch: ${response.statusText}`);
33
35
  }
34
36