@epa-wg/custom-element 0.0.17 → 0.0.19

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/http-request.js CHANGED
@@ -18,7 +18,8 @@ export class HttpRequestElement extends HTMLElement
18
18
  }
19
19
  get requestProps()
20
20
  { const ret = {};
21
- [...this.attributes].filter(a=>!a.name.startsWith('header-')).map( a => ret[a.name] = a.value );
21
+ [...this.attributes].filter(a=>!a.name.startsWith('header-'))
22
+ .filter(a=>!a.name.startsWith('slice')).map( a => ret[a.name] = a.value );
22
23
  return ret
23
24
  }
24
25
 
package/ide/IDE.md ADDED
@@ -0,0 +1,31 @@
1
+ # Ide setup for DCE
2
+ <details>
3
+ <summary> VS Code </summary>
4
+ Copy into `.vscode/settings.json`
5
+
6
+ {
7
+ "html.customData": [
8
+ "./node_modules/@epa-wg/custom-element/ide/customData-dce.json",
9
+ "./node_modules/@epa-wg/custom-element/ide/customData-xsl.json",
10
+ "./customData.json"
11
+ ],
12
+ }
13
+ After editing the DCE in the HTML sources, update `./customData.json` with project' custom tags and attributes.
14
+ </details>
15
+
16
+ <details>
17
+ <summary> IntelliJ </summary>
18
+ Append into `package.json`
19
+
20
+ {
21
+ "web-types":[ "./node_modules/@epa-wg/custom-element/ide/web-types-dce.json",
22
+ "./node_modules/@epa-wg/custom-element/ide/web-types-xsl.json",
23
+ "./web_types.json"
24
+ ],
25
+ }
26
+ After editing the DCE in the HTML, update `./web-types.json` with project' custom tags and attributes.
27
+ </details>
28
+
29
+ # Publishing your components
30
+ When preparing your package for publishing, make sure the instructions on IDE support with your package and DCE package
31
+ tags covered in IntelliJ and VS Code format.
@@ -0,0 +1,112 @@
1
+ {
2
+ "version": 1.1,
3
+ "globalAttributes": [
4
+ {
5
+ "name": "slice",
6
+ "description": {
7
+ "kind": "markdown",
8
+ "value": "Defines the name of data slice in DCE where the data from `value` will be propagated on `change` or by `slice-event` event\n\nOn: any component with `value` and associated change event"
9
+ },
10
+ "references": [
11
+ {
12
+ "name": "Demo",
13
+ "url": "https://unpkg.com/@epa-wg/custom-element/demo/dom-merge.html"
14
+ }
15
+ ]
16
+ },
17
+ {
18
+ "name": "slice-event",
19
+ "description": {
20
+ "kind": "markdown",
21
+ "value": "Defines the event name on which `value` would be synchronized with DCE slice\n\nOn: any component with `value` and associated change event"
22
+ },
23
+ "references": [
24
+ {
25
+ "name": "Demo",
26
+ "url": "https://unpkg.com/@epa-wg/custom-element/demo/dom-merge.html"
27
+ }
28
+ ]
29
+ },
30
+ {
31
+ "name": "slice-value",
32
+ "description": {
33
+ "kind": "markdown",
34
+ "value": "XPath expression to populate into the slice"
35
+ },
36
+ "references": [
37
+ {
38
+ "name": "Demo",
39
+ "url": "https://unpkg.com/@epa-wg/custom-element/demo/data-slices.html"
40
+ }
41
+ ]
42
+ }
43
+ ],
44
+ "tags": [
45
+ {
46
+ "name": "custom-element",
47
+ "description": "Declarative Cuestom ELement(DCE). `<custom-element tag='my-element'></custom-element>`.",
48
+ "attributes": [
49
+ {
50
+ "name": "hidden",
51
+ "description": "hides DCE definition to prevent visual appearance of content. Wrap the payload into template tag to prevent applying the inline CSS in global scope.",
52
+ "type": "boolean"
53
+ },
54
+ {
55
+ "name": "tag",
56
+ "description": "HTML tag for Custom Element. Used for window.customElements.define(). If not set, would be generated and DCE instance rendered inline.",
57
+ "type": "string"
58
+ },
59
+ {
60
+ "name": "src",
61
+ "description": "full, relative, or hash URL to DCE template",
62
+ "type": "string",
63
+ "references": [
64
+ {
65
+ "name": "example",
66
+ "url": "https://unpkg.com/@epa-wg/custom-element/demo/external-template.html"
67
+ }
68
+ ]
69
+ }
70
+ ],
71
+ "references": [
72
+ {
73
+ "name": "custom-element",
74
+ "url": "https://github.com/EPA-WG/custom-element"
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "name": "for-each",
80
+ "description": "The <xsl:for-each> element selects a set of nodes and processes each of them in the same way. It is often used to iterate through a set of nodes or to change the current node. If one or more <xsl:sort> elements appear as the children of this element, sorting occurs before processing. Otherwise, nodes are processed in document order.",
81
+ "attributes": [
82
+ {
83
+ "name": "select",
84
+ "description": "Uses an XPath expression to select nodes to be processed.",
85
+ "type": "string",
86
+ "references": [
87
+ {
88
+ "name": "MDN docs",
89
+ "url": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/for-each#select"
90
+ }
91
+ ]
92
+ }
93
+ ],
94
+ "references": [
95
+ {
96
+ "name": "for-each",
97
+ "url": "https://developer.mozilla.org/en-US/docs/Web/XSLT/Element/for-each"
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "name": "slice",
103
+ "description": "Synthetic element for defining the slice-attributed when more then one slice/event/value associated with parent element",
104
+ "references": [
105
+ {
106
+ "name": "README",
107
+ "url": "https://github.com/EPA-WG/custom-element/tree/develop?tab=readme-ov-file#interactivity-via-data-slice-triggered-by-events"
108
+ }
109
+ ]
110
+ }
111
+ ]
112
+ }