@epa-wg/custom-element-dist 0.0.31 → 0.0.33

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.
Files changed (249) hide show
  1. package/.idea/inspectionProfiles/Project_Default.xml +2 -1
  2. package/.storybook/main.ts +3 -7
  3. package/.storybook/preview.ts +4 -6
  4. package/README.md +4 -4
  5. package/coverage/coverage-final.json +7 -18
  6. package/coverage/index.html +30 -30
  7. package/coverage/src/custom-element/coverage.svg +1 -1
  8. package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
  9. package/coverage/src/custom-element/custom-element.js.html +719 -473
  10. package/coverage/src/custom-element/http-request.js/coverage.svg +1 -1
  11. package/coverage/src/custom-element/http-request.js.html +6 -6
  12. package/coverage/src/custom-element/index.html +29 -29
  13. package/coverage/src/custom-element/local-storage.js.html +1 -1
  14. package/coverage/src/custom-element/location-element.js.html +31 -31
  15. package/coverage/src/custom-element/module-url.js/coverage.svg +1 -1
  16. package/coverage/src/custom-element/module-url.js.html +20 -20
  17. package/coverage/src/index.html +1 -1
  18. package/coverage/src/mocks/handlers.ts.html +1 -1
  19. package/coverage/src/mocks/index.html +1 -1
  20. package/coverage/src/stories/coverage.svg +1 -1
  21. package/coverage/src/stories/{attributes.test.stories.ts → frame.canvas.ts}/coverage.svg +1 -1
  22. package/coverage/src/stories/frame.canvas.ts.html +175 -0
  23. package/coverage/src/stories/http-request.stories.ts.html +1 -1
  24. package/coverage/src/stories/index.html +14 -179
  25. package/coverage/src/stories/testStoryBook.ts.html +8 -8
  26. package/coverage/src/sum.ts.html +1 -1
  27. package/dist/custom-element-6slVaFEs.cjs +97 -0
  28. package/dist/custom-element-WnOqmEOe.js +609 -0
  29. package/dist/custom-element-bundle.cjs +1 -1
  30. package/dist/custom-element-bundle.js +30 -28
  31. package/dist/demo/a.html +51 -38
  32. package/dist/demo/attributes.html +153 -0
  33. package/dist/demo/data-slices.html +2 -2
  34. package/dist/demo/external-template.html +1 -0
  35. package/dist/demo/external-templates-sb-6.html +42 -0
  36. package/dist/demo/external-templates-sb-7.html +42 -0
  37. package/dist/demo/form.html +42 -0
  38. package/dist/demo/hex-grid-dce.html +1 -1
  39. package/dist/demo/hex-grid.html +1 -1
  40. package/dist/demo/html-template.html +1 -1
  41. package/dist/demo/module-url-sb-2.html +46 -0
  42. package/dist/demo/module-url-sb-4.html +48 -0
  43. package/dist/demo/module-url-sb-5.html +53 -0
  44. package/dist/demo/parameters.html +20 -1
  45. package/dist/demo/s.xml +66 -9
  46. package/dist/demo/s.xslt +89 -16
  47. package/dist/demo/ss.html +12 -22
  48. package/dist/mockServiceWorker.js +31 -8
  49. package/package.json +25 -26
  50. package/public/demo/a.html +51 -38
  51. package/public/demo/attributes.html +153 -0
  52. package/public/demo/data-slices.html +2 -2
  53. package/public/demo/external-template.html +1 -0
  54. package/public/demo/external-templates-sb-6.html +42 -0
  55. package/public/demo/external-templates-sb-7.html +42 -0
  56. package/public/demo/form.html +42 -0
  57. package/public/demo/hex-grid-dce.html +1 -1
  58. package/public/demo/hex-grid.html +1 -1
  59. package/public/demo/html-template.html +1 -1
  60. package/public/demo/module-url-sb-2.html +46 -0
  61. package/public/demo/module-url-sb-4.html +48 -0
  62. package/public/demo/module-url-sb-5.html +53 -0
  63. package/public/demo/parameters.html +20 -1
  64. package/public/demo/s.xml +66 -9
  65. package/public/demo/s.xslt +89 -16
  66. package/public/demo/ss.html +12 -22
  67. package/public/mockServiceWorker.js +31 -8
  68. package/src/custom-element/custom-element.d.ts +4 -0
  69. package/src/custom-element/custom-element.js +148 -66
  70. package/src/custom-element/demo/a.html +51 -38
  71. package/src/custom-element/demo/attributes.html +153 -0
  72. package/src/custom-element/demo/data-slices.html +2 -2
  73. package/src/custom-element/demo/external-template.html +1 -0
  74. package/src/custom-element/demo/form.html +42 -0
  75. package/src/custom-element/demo/hex-grid-dce.html +1 -1
  76. package/src/custom-element/demo/hex-grid.html +1 -1
  77. package/src/custom-element/demo/html-template.html +1 -1
  78. package/src/custom-element/demo/parameters.html +20 -1
  79. package/src/custom-element/demo/s.xml +66 -9
  80. package/src/custom-element/demo/s.xslt +89 -16
  81. package/src/custom-element/demo/ss.html +12 -22
  82. package/src/custom-element/ide/web-types-dce.json +1 -1
  83. package/src/custom-element/ide/web-types-xsl.json +1 -1
  84. package/src/custom-element/index.html +1 -1
  85. package/src/material/components/badge.html +240 -0
  86. package/src/material/components/dropdown.html +26 -14
  87. package/src/material/components/icon-link.html +1 -0
  88. package/src/material/components/icon.html +253 -0
  89. package/src/material/components/input.html +571 -0
  90. package/src/material/components/menu.html +7 -5
  91. package/src/material/components.html +48 -11
  92. package/src/material/theme/semantic.css +20 -1
  93. package/src/mocks/versions.mock.ts +1 -1
  94. package/src/stories/__screenshots__/attributes.test.stories.ts +1 -0
  95. package/src/stories/__screenshots__/external-template.test.stories.ts +1 -0
  96. package/src/stories/__screenshots__/module-url.test.stories.ts +1 -0
  97. package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-definition-1.png +0 -0
  98. package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-runtime-change-1.png +0 -0
  99. package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-1.png +0 -0
  100. package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-2.png +0 -0
  101. package/src/stories/__screenshots__/stories.test.ts/attributes-cloneAs-el-newTag--1.png +0 -0
  102. package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---1.png +0 -0
  103. package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---2.png +0 -0
  104. package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---3.png +0 -0
  105. package/src/stories/__screenshots__/stories.test.ts/attributes-mix-to-from--1.png +0 -0
  106. package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-definition-1.png +0 -0
  107. package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-runtime-change-1.png +0 -0
  108. package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-1.png +0 -0
  109. package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-2.png +0 -0
  110. package/src/stories/__screenshots__/stories.test.ts/http-request-cloneAs-el-newTag--1.png +0 -0
  111. package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-headers-and-response-status-and-headers-1.png +0 -0
  112. package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-delayed--5-seconds-response-1.png +0 -0
  113. package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-error-1.png +0 -0
  114. package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---1.png +0 -0
  115. package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---2.png +0 -0
  116. package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---3.png +0 -0
  117. package/src/stories/__screenshots__/stories.test.ts/http-request-mix-to-from--1.png +0 -0
  118. package/src/stories/__screenshots__/stories.test.ts/http-request-url-and-slice-1.png +0 -0
  119. package/src/stories/__screenshots__/stories.test.ts/http-request-url-change-1.png +0 -0
  120. package/src/stories/attributes.test.stories.ts +177 -11
  121. package/src/stories/external-template.test.stories.ts +17 -15
  122. package/src/stories/frame.canvas.ts +31 -0
  123. package/src/stories/module-url.test.stories.ts +29 -61
  124. package/storybook-static/assets/Color-F6OSRLHC-Cbp293x2.js +1 -0
  125. package/storybook-static/assets/Configure-BrFr4SLE.js +165 -0
  126. package/storybook-static/assets/DocsRenderer-CFRXHY34-DhHzJiIO.js +2 -0
  127. package/storybook-static/assets/attributes.test.stories-CzWkKw0e.js +1 -0
  128. package/storybook-static/assets/attributes.test.stories-Gg9LQTEK.js +349 -0
  129. package/storybook-static/assets/{css.test.stories-Cgn6ICr0.js → css.test.stories-B_3ltOrx.js} +1 -1
  130. package/storybook-static/assets/custom-element-CPnvJnn8.js +97 -0
  131. package/storybook-static/assets/{dom-merge.test.stories-CBObfPWg.js → dom-merge.test.stories-nQxcgLoM.js} +1 -1
  132. package/storybook-static/assets/entry-preview-docs-Dwczwtsc.js +2 -0
  133. package/storybook-static/assets/external-template.test.stories-BivZqBTp.js +1 -0
  134. package/storybook-static/assets/{external-template.test.stories-VfKUQ8eu.js → external-template.test.stories-DZ-rjnfd.js} +39 -41
  135. package/storybook-static/assets/{form.test.stories-CnuGN7Zw.js → form.test.stories-DQhPYtMj.js} +1 -1
  136. package/storybook-static/assets/frame.canvas-ClTqYyMN.js +1 -0
  137. package/storybook-static/assets/{handlers-V_T7WjNK.js → handlers-CLkps6Nz.js} +17 -14
  138. package/storybook-static/assets/{http-request.stories-8NN1Coqm.js → http-request.stories-jo0f73nw.js} +1 -1
  139. package/storybook-static/assets/iframe-CZwRpnn9.js +199 -0
  140. package/storybook-static/assets/index-B68YUdzy.js +621 -0
  141. package/storybook-static/assets/index-BwkS7JH_.js +8 -0
  142. package/storybook-static/assets/index-CJQtnF9V.js +1 -0
  143. package/storybook-static/assets/index-Dr4PwNfd.js +240 -0
  144. package/storybook-static/assets/{local-storage.test.stories-Dk5Yqc7m.js → local-storage.test.stories-uA5EKRPf.js} +1 -1
  145. package/storybook-static/assets/{location-element.test.stories-56um6s5L.js → location-element.test.stories-Cu-6Elcg.js} +1 -1
  146. package/storybook-static/assets/module-url.test.stories-CD_wusXQ.js +142 -0
  147. package/storybook-static/assets/module-url.test.stories-CTjUAk3J.js +1 -0
  148. package/storybook-static/assets/preview-1xJJ3sKE.js +1 -0
  149. package/storybook-static/assets/preview-BFlNN3Wj.js +1 -0
  150. package/storybook-static/assets/preview-CTOeX_lO.js +1 -0
  151. package/storybook-static/assets/preview-Cm4PPhHS.js +50 -0
  152. package/storybook-static/assets/preview-CuCH40jj.js +2 -0
  153. package/storybook-static/assets/preview-DfTudP20.js +1 -0
  154. package/storybook-static/assets/{set-url.test.stories-B4E6hIe-.js → set-url.test.stories-CY7B9BVZ.js} +1 -1
  155. package/storybook-static/assets/{slice-events.test.stories-BR0F-B6I.js → slice-events.test.stories-BVnPXm6e.js} +1 -1
  156. package/storybook-static/assets/{slots.test.stories-CgfJIyCr.js → slots.test.stories-Dxsa9KdA.js} +1 -1
  157. package/storybook-static/assets/{version-select.test.stories-nmxATIwv.js → version-select.test.stories-Buga1PAa.js} +1 -1
  158. package/storybook-static/demo/a.html +51 -38
  159. package/storybook-static/demo/attributes.html +153 -0
  160. package/storybook-static/demo/data-slices.html +2 -2
  161. package/storybook-static/demo/external-template.html +1 -0
  162. package/storybook-static/demo/external-templates-sb-6.html +42 -0
  163. package/storybook-static/demo/external-templates-sb-7.html +42 -0
  164. package/storybook-static/demo/form.html +42 -0
  165. package/storybook-static/demo/hex-grid-dce.html +1 -1
  166. package/storybook-static/demo/hex-grid.html +1 -1
  167. package/storybook-static/demo/html-template.html +1 -1
  168. package/storybook-static/demo/module-url-sb-2.html +46 -0
  169. package/storybook-static/demo/module-url-sb-4.html +48 -0
  170. package/storybook-static/demo/module-url-sb-5.html +53 -0
  171. package/storybook-static/demo/parameters.html +20 -1
  172. package/storybook-static/demo/s.xml +66 -9
  173. package/storybook-static/demo/s.xslt +89 -16
  174. package/storybook-static/demo/ss.html +12 -22
  175. package/storybook-static/iframe.html +1 -1
  176. package/storybook-static/index.html +6 -10
  177. package/storybook-static/index.json +1 -1
  178. package/storybook-static/mockServiceWorker.js +31 -8
  179. package/storybook-static/project.json +1 -1
  180. package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
  181. package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +8 -8
  182. package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +391 -0
  183. package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +230 -0
  184. package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +1 -1
  185. package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +1 -1
  186. package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +1 -1
  187. package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
  188. package/storybook-static/sb-addons/interactions-9/manager-bundle.js +58 -58
  189. package/storybook-static/sb-manager/globals-module-info.js +9 -0
  190. package/storybook-static/sb-manager/globals-runtime.js +10719 -10473
  191. package/storybook-static/sb-manager/runtime.js +4944 -6321
  192. package/coverage/src/stories/attributes.test.stories.ts.html +0 -514
  193. package/coverage/src/stories/css.test.stories.ts/coverage.svg +0 -10
  194. package/coverage/src/stories/css.test.stories.ts.html +0 -460
  195. package/coverage/src/stories/dom-merge.test.stories.ts/coverage.svg +0 -10
  196. package/coverage/src/stories/dom-merge.test.stories.ts.html +0 -706
  197. package/coverage/src/stories/external-template.test.stories.ts/coverage.svg +0 -10
  198. package/coverage/src/stories/external-template.test.stories.ts.html +0 -865
  199. package/coverage/src/stories/form.test.stories.ts/coverage.svg +0 -10
  200. package/coverage/src/stories/form.test.stories.ts.html +0 -661
  201. package/coverage/src/stories/local-storage.test.stories.ts/coverage.svg +0 -10
  202. package/coverage/src/stories/local-storage.test.stories.ts.html +0 -1315
  203. package/coverage/src/stories/location-element.test.stories.ts/coverage.svg +0 -10
  204. package/coverage/src/stories/location-element.test.stories.ts.html +0 -523
  205. package/coverage/src/stories/module-url.test.stories.ts/coverage.svg +0 -10
  206. package/coverage/src/stories/module-url.test.stories.ts.html +0 -640
  207. package/coverage/src/stories/set-url.test.stories.ts/coverage.svg +0 -10
  208. package/coverage/src/stories/set-url.test.stories.ts.html +0 -433
  209. package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +0 -10
  210. package/coverage/src/stories/slice-events.test.stories.ts.html +0 -952
  211. package/coverage/src/stories/slots.test.stories.ts/coverage.svg +0 -10
  212. package/coverage/src/stories/slots.test.stories.ts.html +0 -742
  213. package/coverage/src/stories/version-select.test.stories.ts/coverage.svg +0 -10
  214. package/coverage/src/stories/version-select.test.stories.ts.html +0 -397
  215. package/dist/custom-element-BbJMY20-.cjs +0 -97
  216. package/dist/custom-element-CoRNKeEP.js +0 -567
  217. package/storybook-static/assets/Color-F6OSRLHC-CFyd3TND.js +0 -1
  218. package/storybook-static/assets/Configure-UGTbPRKK.js +0 -165
  219. package/storybook-static/assets/DocsRenderer-CFRXHY34-Dpr5iB0o.js +0 -2
  220. package/storybook-static/assets/attributes.test.stories-DSOLHHOW.js +0 -152
  221. package/storybook-static/assets/custom-element-D59Fok1f.js +0 -97
  222. package/storybook-static/assets/entry-preview-docs-BbcIMweR.js +0 -2
  223. package/storybook-static/assets/iframe-DnhkgdtG.js +0 -2
  224. package/storybook-static/assets/index-3Sfy-t3H.js +0 -769
  225. package/storybook-static/assets/index-BcZLpTeD.js +0 -8
  226. package/storybook-static/assets/index-CIBI7sCB.js +0 -1
  227. package/storybook-static/assets/index-CxRwF5Or.js +0 -234
  228. package/storybook-static/assets/index-D-8MO0q_.js +0 -1
  229. package/storybook-static/assets/index-DN1RoK17.js +0 -1
  230. package/storybook-static/assets/index-DjJD7gkO.js +0 -1
  231. package/storybook-static/assets/module-url.test.stories-DEponQ7l.js +0 -208
  232. package/storybook-static/assets/preview-BhhEZcNS.js +0 -1
  233. package/storybook-static/assets/preview-CNKoaWES.js +0 -1
  234. package/storybook-static/assets/preview-Czc-sw5H.js +0 -2
  235. package/storybook-static/assets/preview-DAeyCMnM.js +0 -1
  236. package/storybook-static/assets/preview-DHPc-V4N.js +0 -1
  237. package/storybook-static/assets/preview-DYzi3Z2p.js +0 -1
  238. package/storybook-static/assets/preview-vbpHsp94.js +0 -52
  239. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +0 -333
  240. package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +0 -40
  241. package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +0 -3
  242. package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +0 -391
  243. package/storybook-static/sb-addons/links-1/manager-bundle.js +0 -3
  244. package/storybook-static/sb-preview/globals.js +0 -33
  245. package/storybook-static/sb-preview/runtime.js +0 -7174
  246. package/test-runner-jest.config.js +0 -15
  247. /package/storybook-static/sb-addons/{essentials-actions-3 → essentials-actions-2}/manager-bundle.js.LEGAL.txt +0 -0
  248. /package/storybook-static/sb-addons/{essentials-controls-2 → essentials-controls-1}/manager-bundle.js.LEGAL.txt +0 -0
  249. /package/storybook-static/sb-addons/{links-1 → essentials-docs-3}/manager-bundle.js.LEGAL.txt +0 -0
@@ -1,8 +1,8 @@
1
1
  <!DOCTYPE html>
2
- <html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml">
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
5
- <title>Data slices - Declarative Custom Element implementation demo</title>
5
+ <title>http-request Declarative Custom Element implementation demo</title>
6
6
  <link rel="icon" href="./wc-square.svg"/>
7
7
 
8
8
  <script type="module" src="../http-request.js"></script>
@@ -10,51 +10,64 @@
10
10
  <style>
11
11
  @import "./demo.css";
12
12
 
13
- label {
14
- display: flex;
13
+ button {
14
+ display: inline-flex;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ flex: auto;
18
+ box-shadow: inset silver 0 0 1rem;
19
+ min-width: 12rem;
20
+ padding: 1rem;
21
+ color: coral;
22
+ text-shadow: 1px 1px silver;
23
+ font-weight: bolder;
15
24
  }
16
25
 
17
- label:has(input[type="text"],input[type="password"],input:not([type]) ) {
18
- flex-direction: column;
26
+ button img {
27
+ max-height: 10vw;
28
+ min-height: 4rem;
19
29
  }
20
30
 
21
- nav {
22
- max-width: 32em;
31
+ table {
32
+ min-width: 16rem;
33
+ }
34
+
35
+ td {
36
+ border-bottom: 1px solid silver;
37
+ }
38
+
39
+ tfoot td {
40
+ border-bottom: none;
41
+ }
42
+
43
+ td, th {
44
+ text-align: right;
23
45
  }
24
- </style>
25
- <!-- https://github.com/mdn/learning-area/blob/main/html/forms/form-validation/custom-error-message.html
26
- todo: apply setCustomValidity( warningStr )
27
- -->
28
46
 
47
+ caption {
48
+ padding: 1rem;
49
+ font-weight: bolder;
50
+ font-family: sans-serif;
51
+ }
52
+
53
+ code {
54
+ text-align: right;
55
+ min-width: 3rem;
56
+ }
57
+
58
+ svg {
59
+ max-height: 3rem;
60
+ }
61
+ </style>
29
62
  </head>
30
63
  <body>
31
64
 
32
- <fieldset>
33
- <legend><b style="color:green">green</b> in instance style can be overridden in payload as <i
34
- style="color:red">red</i> in 1st instance
35
- </legend>
36
- <custom-element tag="dce-3">
37
- <template>
38
- <u>
39
- <slot>is green</slot>
40
- </u>
41
- </template>
42
- <style>dce-3 {
43
- color: green
44
- }</style>
45
- </custom-element>
46
- <u>should be</u> <i style="color:red">red</i>:
47
- <dce-3 id="dce32">
48
- <template>
49
- <style> color:red; </style>
50
- <u>red</u>
51
- </template>
52
- </dce-3> <br/>
53
- should be GREEN:
54
- <dce-3 id="dce31">green</dce-3>
55
- </fieldset>
56
-
57
- <script type="module" src="https://unpkg.com/html-demo-element@1/html-demo-element.js"></script>
65
+
66
+
67
+ <custom-element src="./html-template.html#dwc-logo">
68
+ <template><i>loading SVG from templates file ...</i></template>
69
+ </custom-element>
70
+
58
71
 
59
72
  </body>
60
73
  </html>
@@ -0,0 +1,153 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+ <title>parameters - custom-element Declarative Custom Element implementation demo</title>
7
+ <link rel="icon" href="./wc-square.svg" />
8
+ <script type="module" src="../location-element.js"></script>
9
+ <script type="module" src="../custom-element.js"></script>
10
+ <style>
11
+ @import "./demo.css";
12
+
13
+ button{ background: forestgreen; }
14
+ table{ min-width: 16rem; }
15
+ td{ border-bottom: 1px solid silver; }
16
+ tfoot td{ border-bottom: none; }
17
+ td,th{text-align: right; }
18
+ caption{ padding: 1rem; font-weight: bolder; font-family: sans-serif; }
19
+ </style>
20
+ </head>
21
+ <body>
22
+ <nav>
23
+ <a href="../index.html"><h3><code>custom-element</code> demo</h3></a>
24
+ </nav>
25
+ <main>
26
+ <p><code>attribute</code> is used for DCE attributes declaration and track the attributes changes. It also be used by IDE and validation.</p>
27
+ <p>The attribute can be changed by component itself and used as output to the container.
28
+ Usual case is when <code>value</code> attribute is updated from inside.</p>
29
+ <p>Initial value of attribute is available on the <code>attributes</code> node attribute as in <code>/datadom/attributes/@attr1</code></p>
30
+ <p>The current, i.e. including the changes by component itself, attribute value is a child node of <code>attributes</code> as in <code>/datadom/attributes/attr1</code>.</p>
31
+ <p>To define the attribute which is modified from within, the 3 parts are usually used as in <code>//s[//s/event] ?? //attributes/@v ?? 'def' </code>
32
+ <ol>
33
+ <li><code>//s[//s/event]</code> the slice <code>s</code> with event gives the slice value which was modified by user event like input</li>
34
+ <li><code>//attributes/@v</code> the attribute passed by container</li>
35
+ <li><code>'def' </code> the default value which used when no user input or attribute set by container</li>
36
+ </ol>
37
+ </p>
38
+ </main>
39
+ <html-demo-element legend="attributes definition" >
40
+ <p slot="description">
41
+ <code>attribute</code> is used for DCE attributes declaration and track the attributes changes. It also be used by IDE and validation.
42
+
43
+ </p>
44
+ <template>
45
+ <custom-element tag="dce-link" hidden>
46
+ <attribute name="p1" >default_P1 </attribute>
47
+ <attribute name="p2" select="'always_p2'" ></attribute>
48
+ <attribute name="p3" select="//attributes/@p3 ?? 'def_P3' " ></attribute>
49
+ p1:{$p1} <br/> p2: {$p2} <br/> p3: {$p3}
50
+ </custom-element>
51
+ <dce-link id="dce1" ></dce-link>
52
+ <section>
53
+ <dce-link id="dce2" p1="123" p2="override ignored as select is defined"></dce-link> <br/>
54
+ <div><input id="i1" value="p1" /> <button onclick="dce2.setAttribute('p1',i1.value)"> set p1</button> </div>
55
+ <div><input id="i2" value="p2" /> <button onclick="dce2.setAttribute('p2',i2.value)"> set p2</button> </div>
56
+ <div><input id="i3" value="p3" /> <button onclick="dce2.setAttribute('p3',i3.value)"> set p3</button> </div>
57
+ </section>
58
+ <dce-link id="dce3" p1="123" p3="qwe"></dce-link> |
59
+
60
+ </template>
61
+ </html-demo-element>
62
+
63
+ <html-demo-element legend="attribute from slice">
64
+ <p slot="description">
65
+ When slice value points to attribute, it would be populated on slice change.<br/>
66
+ Type in the input field to see the variable $title change. <br/>
67
+ Hover the mouse to see the title attribute text popup.<br/>
68
+ Inspect DCE node in dev tools to see `title` attribute updated while typing.
69
+
70
+ </p>
71
+
72
+ <template>
73
+ <custom-element>
74
+ <template>
75
+ <attribute name="title" select="//title ?? '😃'" ></attribute>
76
+ <input slice="/datadom/attributes/title" slice-event="keyup"/>
77
+ title attribute: {$title}
78
+ </template>
79
+ </custom-element>
80
+ </template>
81
+ </html-demo-element>
82
+
83
+
84
+ <html-demo-element legend="V attribute matches input value" description="
85
+ Type in the input field and observe in DevTools the V attribute changed.
86
+ ">
87
+ <template>
88
+ <custom-element tag="x-input" >
89
+ <template>
90
+ <attribute name="is-changed" select="count(//s/event) &gt; 0"></attribute>
91
+ <attribute name="v" select="//s[//s/event] ?? //attributes/@v ?? 'def' "></attribute>
92
+ /datadom/attributes/v='{/datadom/attributes/v}'<br/>
93
+ same as v='{v}'<br/>
94
+ same as $v='{$v}'<br/>
95
+ //attributes/@v='{//attributes/@v}'<br/>
96
+ //s='{//s}'<br/>
97
+ is-changed ={ is-changed }<br/>
98
+ <input slice="s" slice-event="input" value="{//attributes/v}"/>
99
+ </template>
100
+ </custom-element>
101
+ <x-input></x-input>
102
+ <x-input v="V1"></x-input>
103
+ </template>
104
+ </html-demo-element>
105
+
106
+ <html-demo-element legend="attribute defaults, from container, and from slice" description="
107
+ Type in the input field and observe in DevTools the V attribute changed.
108
+ ">
109
+ <template>
110
+ <custom-element tag="attr-demo">
111
+ <template>
112
+ <variable name="has-input" select="count(//s/*) &gt; 0"></variable>
113
+ <attribute name="v" select="//s[//s/event] ?? //attributes/@v ?? 'def' "></attribute>
114
+ //attributes/v='{//attributes/v}'<br/>
115
+ //attributes/@v='{//attributes/@v}'<br/>
116
+ $v='{$v}'<br/>
117
+ //s='{//s}'<br/>
118
+ A='{//s[//s/event] | //attributes/v[not(//s/event)]}'<br/>
119
+ has-input ={ $has-input }<br/>
120
+ <input slice="s" slice-event="input" />
121
+ </template>
122
+ </custom-element>
123
+
124
+ <attr-demo></attr-demo>
125
+ <attr-demo v="From Container"></attr-demo>
126
+ </template>
127
+ </html-demo-element>
128
+
129
+ <details>
130
+ <summary>Attributes processing</summary>
131
+ To be available in template, <code>custom-element</code> attributes should be
132
+ defined by <code>attribute</code> markup as shown above.
133
+ The value is taken from attribute text content or from <code>select</code> XPath expression<br/>
134
+
135
+ Declared in such way, attributes are exposed via <code><a
136
+ href="https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#responding_to_attribute_changes"
137
+ >observedAttributes</a></code>. <br/>
138
+ The template exposes those attributes as <code>xsl:param</code> which makes the attribute value available as
139
+ xsl variable (as attribute name prefixed with $). <br/>
140
+ After transformation the attributes values are read from CE root and copied into DCE component. <br/>
141
+ The DCE attribute change from outside invokes <code>attributeChangedCallback</code> which triggers DCE re-render.
142
+ <p>
143
+ The <code>value</code> attribute is usual case to be propagated from within of <code>custom-element</code>.
144
+ See the <a href="./form.html#sample-5">using custom-element as form input</a> example.
145
+ </p>
146
+ &bull; <a href="https://github.com/EPA-WG/custom-element/blob/main/docs/attributes.md">Design docs</a>
147
+ </details>
148
+
149
+
150
+ <script type="module" src="https://unpkg.com/html-demo-element@1/html-demo-element.js"></script>
151
+
152
+ </body>
153
+ </html>
@@ -233,8 +233,8 @@
233
233
  </template>
234
234
  </html-demo-element>
235
235
 
236
- <html-demo-element legend="13. Radio buttons use"
237
- description="The value is empty when unchecked. Otherwise taken either from slice-value or value attribute.">
236
+ <html-demo-element legend="13. Radio group"
237
+ description="The value propagated into slice from the last checked radiobutton.">
238
238
  <p>Check the radiobutton to see the value in slice</p>
239
239
  <template>
240
240
  <custom-element>
@@ -57,6 +57,7 @@
57
57
 
58
58
  svg {
59
59
  max-height: 3rem;
60
+ min-height: 2rem;
60
61
  }
61
62
  </style>
62
63
  </head>
@@ -233,6 +233,48 @@
233
233
  </template>
234
234
  </html-demo-element>
235
235
 
236
+ <html-demo-element legend="5. using custom-element as form input"
237
+ description="bypass value to container form "
238
+ id="sample-5"
239
+ >
240
+ <ol>
241
+ <li> select radio in top group</li>
242
+ <li> observe the fruit selected on the left</li>
243
+ <li> observe the warning message bellow button</li>
244
+ <li> next button does not submit the form</li>
245
+ <li> select radio in bottom group</li>
246
+ <li> observe the fruit selected on the right</li>
247
+ <li> same fruit selection would eliminate the warning and
248
+ allow the form submission</li>
249
+ <li> after submit, observe the URL parameters 'inp-1=🍏&inp-2=🍏' </li>
250
+ </ol>
251
+ <template>
252
+ <custom-element tag="sample-input">
253
+ <template>
254
+ <attribute name="name" ></attribute>
255
+ <attribute name="value" select="//val"></attribute>
256
+ {$name}
257
+ <label><input type="radio" name="{$name}" slice="val" value="🍏">Apple</label>
258
+ <label><input type="radio" name="{$name}" slice="val" value="🍌">Banana</label>
259
+ </template>
260
+ </custom-element>
261
+ <custom-element>
262
+ <template>
263
+ <form slice="cart-form" action="#sample-5"
264
+ custom-validity="(//inp1 = //inp2) ?? 'pick same fruit'"
265
+ >
266
+ <sample-input slice="inp1" name="inp-1"></sample-input>
267
+ <sample-input slice="inp2" name="inp-2"></sample-input>
268
+ <button>Next</button>
269
+ Picked :{//inp1} and {//inp2}
270
+
271
+ <p>{//cart-form/@validation-message}</p>
272
+ </form>
273
+ </template>
274
+ </custom-element>
275
+ </template>
276
+ </html-demo-element>
277
+
236
278
  <script type="module" src="https://unpkg.com/html-demo-element@1/html-demo-element.js"></script>
237
279
 
238
280
  </body>
@@ -107,7 +107,7 @@
107
107
  <img src="https://upload.wikimedia.org/wikipedia/commons/1/1b/Svelte_Logo.svg" alt="Svelte"/>
108
108
  <img src="https://www.solidjs.com/img/logo/without-wordmark/logo.svg" alt="SolidJS"/>
109
109
  <img src="https://www.svgrepo.com/show/354113/nextjs-icon.svg" alt="NextJS"/>
110
- <img src="https://global.discourse-cdn.com/standard17/uploads/threejs/original/2X/b/be2f75f72751c11cbe1593c69a99a52900bf12cb.svg" alt="ThreeJS" href="https://threejs.org/"/>
110
+ <img src="https://threejs.org/files/favicon.ico" alt="ThreeJS" href="https://threejs.org/"/>
111
111
  <img src="https://www.blazejs.org/logo/icon.png" alt="BlazeJS"/>
112
112
  <img src="https://dmtgy0px4zdqn.cloudfront.net/images/integrations/tailwindcss.webp" alt="Tailwind CSS"/>
113
113
  <img src="https://dmtgy0px4zdqn.cloudfront.net/images/integrations/flowbite.webp" alt="Flowbite"/>
@@ -52,7 +52,7 @@
52
52
  <img src="https://semantic-ui.com/images/logo.png" alt="Semantic UI" href="https://semantic-ui.com/"/>
53
53
  <img src="https://open-wc.org/35ded306.svg" alt="Open WC" href="https://open-wc.org/"/>
54
54
  <img src="https://storage.googleapis.com/cms-storage-bucket/4fd0db61df0567c0f352.png" alt="Flutter" href="https://flutter.dev/"/>
55
- <img src="https://refine.dev/img/refine_favicon.svg" alt="Refine" href="https://refine.dev/"/>
55
+ <img src="https://refine.dev/img/favicon.ico" alt="Refine" href="https://refine.dev/"/>
56
56
  <img src="https://getbootstrap.com/docs/5.3/assets/brand/bootstrap-logo-shadow.png" alt="Bootstrap" href="https://getbootstrap.com/"/>
57
57
  <img src="https://upload.wikimedia.org/wikipedia/commons/9/95/Vue.js_Logo_2.svg" alt="Vue.JS" href="https://vuejs.org/"/>
58
58
  <img src="https://lit.dev/images/logo.svg#flame" alt="Lit"/>
@@ -73,7 +73,7 @@
73
73
  <path class="cls-1"
74
74
  d="m184.02,96.93l20.64-11.92c.47-.27.47-.79,0-1.06l-20.65-11.92h0c-4.44-2.57-8.22-2.57-12.67,0l-20.65,11.92c-.47.27-.47.79,0,1.06l20.64,11.92c4.44,2.57,8.22,2.57,12.67,0h0Z"/>
75
75
  </svg>
76
- <math id="sophomores-dream" display="block">
76
+ <math id="sophomores-dream" data-testid="ml-test" display="block">
77
77
  <mrow>
78
78
  <msubsup>
79
79
  <mo>∫</mo>
@@ -44,7 +44,7 @@ params needed to declare DCE attributes and track the attributes changes. It als
44
44
  </template>
45
45
  </html-demo-element>
46
46
 
47
- <html-demo-element legend="slice propagates attribute" description="
47
+ <html-demo-element legend="attribute from slice" description="
48
48
  when slice value points to attribute, it would be populated on slice change
49
49
  ">
50
50
  Type in the input field to see the variable $title change. <br/>
@@ -62,6 +62,25 @@ when slice value points to attribute, it would be populated on slice change
62
62
  </template>
63
63
  </html-demo-element>
64
64
 
65
+ <details>
66
+ <summary>Attributes processing</summary>
67
+ To be available in template, <code>custom-element</code> attributes should be
68
+ defined by <code>attribute</code> markup as shown above.
69
+ The value is taken from attribute text content or from <code>select</code> XPath expression<br/>
70
+
71
+ Declared in such way, attributes are exposed via <code><a
72
+ href="https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#responding_to_attribute_changes"
73
+ >observedAttributes</a></code>. <br/>
74
+ The template exposes those attributes as <code>xsl:param</code> which makes the attribute value available as
75
+ xsl variable (as attribute name prefixed with $). <br/>
76
+ After transformation the attributes values are read from CE root and copied into DCE component. <br/>
77
+ The DCE attribute change from outside invokes <code>attributeChangedCallback</code> which triggers DCE re-render.
78
+ <p>
79
+ The <code>value</code> attribute is usual case to be propagated from within of <code>custom-element</code>.
80
+ See the <a href="./form.html#sample-5">using custom-element as form input</a> example.
81
+ </p>
82
+ &bull; <a href="https://github.com/EPA-WG/custom-element/blob/main/docs/attributes.md">Design docs</a>
83
+ </details>
65
84
 
66
85
 
67
86
  <script type="module" src="https://unpkg.com/html-demo-element@1/html-demo-element.js"></script>
@@ -1,18 +1,75 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <datadom>
3
3
  <payload xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml">
4
- <a xmlns="http://www.w3.org/1999/xhtml" href="#" data-dce-id="4" slot="">link 1</a>
5
- <a xmlns="http://www.w3.org/1999/xhtml" href="#" data-dce-id="5" slot="">link 2</a>
6
- <a xmlns="http://www.w3.org/1999/xhtml" href="#" data-dce-id="6" slot="">link 3</a>
4
+ <div xmlns="http://www.w3.org/1999/xhtml" slot="leading" data-dce-id="4">
5
+ <cem-icon image="history_edu" class="input-focused" data-dce-id="5">
6
+ <dce-root xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml"
7
+ xmlns:dce="urn:schemas-epa-wg:dce" data-dce-id="1">
8
+ <span xmlns="" class="icon material-icons" data-dce-id="5">history_edu</span>
9
+ </dce-root>
10
+ </cem-icon>
11
+ <cem-icon image="edit" class="input-unfocused" data-dce-id="6">
12
+ <dce-root xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml"
13
+ xmlns:dce="urn:schemas-epa-wg:dce" data-dce-id="1">
14
+ <span xmlns="" class="icon material-icons" data-dce-id="5">edit</span>
15
+ </dce-root>
16
+ </cem-icon>
17
+ </div>
18
+ <div xmlns="http://www.w3.org/1999/xhtml" slot="trailing" data-dce-id="7">
19
+ <label class="eye-contailer" for="visible-cb" data-dce-id="8">
20
+ <cem-icon image="visibility" class="visible-ico" tabindex="0" data-dce-id="9">
21
+ <dce-root xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml"
22
+ xmlns:dce="urn:schemas-epa-wg:dce" data-dce-id="1">
23
+ <span xmlns="" class="icon material-icons" data-dce-id="5">visibility</span>
24
+ </dce-root>
25
+ </cem-icon>
26
+ <cem-icon image="visibility_off" class="invisible-ico" tabindex="0" data-dce-id="10">
27
+ <dce-root xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml"
28
+ xmlns:dce="urn:schemas-epa-wg:dce" data-dce-id="1">
29
+ <span xmlns="" class="icon material-icons" data-dce-id="5">visibility_off</span>
30
+ </dce-root>
31
+ </cem-icon>
32
+ </label>
33
+ <cem-icon image="close" class="clear" tabindex="0" slice="password" slice-event="click" slice-value="''"
34
+ data-dce-id="11">
35
+ <dce-root xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml"
36
+ xmlns:dce="urn:schemas-epa-wg:dce" data-dce-id="1">
37
+ <span xmlns="" class="icon material-icons" data-dce-id="5">close</span>
38
+ </dce-root>
39
+ </cem-icon>
40
+ <dce-text data-dce-id="12">️
41
+ </dce-text>
42
+ </div>
7
43
  </payload>
8
- <attributes>
44
+ <attributes xmlns="" label="password sample" value="secret word" slice="password" data-dce-id="3" type="">
9
45
  <xmlns/>
10
- <justify>end</justify>
11
- <data-dce-id>2</data-dce-id>
12
- <direction>row</direction>
46
+ <label>password sample</label>
47
+ <value>secret word</value>
48
+ <slice>password</slice>
49
+ <data-dce-id>3</data-dce-id>
50
+ <type></type>
13
51
  </attributes>
14
52
  <dataset>
15
- <dceId>2</dceId>
53
+ <dceId>3</dceId>
16
54
  </dataset>
17
- <slice/>
55
+ <slice>
56
+ <selected/>
57
+ <password image="close" class="clear" tabindex="0" slice="password" slice-event="click" slice-value="''"
58
+ data-dce-id="11">
59
+ <event isTrusted="true" sliceProcessed="1" pointerId="1" width="1" height="1" pressure="0" tiltX="0"
60
+ tiltY="0" azimuthAngle="0" altitudeAngle="1.5707963267948966" tangentialPressure="0" twist="0"
61
+ pointerType="mouse" isPrimary="false" persistentDeviceId="0" screenX="345" screenY="682"
62
+ clientX="345" clientY="595" ctrlKey="false" shiftKey="false" altKey="false" metaKey="false"
63
+ button="0" buttons="0" pageX="345" pageY="4354" x="345" y="595" offsetX="14" offsetY="15"
64
+ movementX="0" movementY="0" layerX="248" layerY="27" detail="1" which="1" type="click" eventPhase="3"
65
+ bubbles="true" cancelable="true" defaultPrevented="false" composed="true"
66
+ timeStamp="1974517.2999999523" returnValue="true" cancelBubble="false" NONE="0" CAPTURING_PHASE="1"
67
+ AT_TARGET="2" BUBBLING_PHASE="3">
68
+ <relatedTarget/>
69
+ <fromElement/>
70
+ <toElement/>
71
+ <sourceCapabilities firesTouchEvents="false"/>
72
+ </event>
73
+ </password>
74
+ </slice>
18
75
  </datadom>
@@ -1,20 +1,93 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:dce="urn:schemas-epa-wg:dce" xmlns:exsl="http://exslt.org/common" version="1.0" exclude-result-prefixes="exsl">
1
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml"
2
+ xmlns:dce="urn:schemas-epa-wg:dce" xmlns:exsl="http://exslt.org/common" version="1.0"
3
+ exclude-result-prefixes="exsl">
3
4
  <xsl:template match="ignore">
4
5
  <xsl:choose>
5
- <xsl:when test="//attr"><xsl:value-of select="//attr"/></xsl:when>
6
- <xsl:otherwise><xsl:value-of select="def"/></xsl:otherwise>
7
- </xsl:choose><xsl:value-of select="."/></xsl:template>
8
- <xsl:template mode="payload" match="attributes"><xsl:param name="direction"><xsl:choose>
9
- <xsl:when test="//direction"><xsl:value-of select="//direction"/></xsl:when>
10
- <xsl:otherwise><xsl:value-of select="'row'"/></xsl:otherwise>
11
- </xsl:choose></xsl:param><dce-root xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" data-dce-id="1"><xsl:attribute name="direction"><xsl:choose>
12
- <xsl:when test="//direction"><xsl:value-of select="//direction"/></xsl:when>
13
- <xsl:otherwise><xsl:value-of select="'row'"/></xsl:otherwise>
14
- </xsl:choose></xsl:attribute><xsl:call-template name="slot">
15
- <xsl:with-param name="slotname" select="''"/>
16
- <xsl:with-param name="defaultvalue"/>
17
- </xsl:call-template></dce-root></xsl:template>
6
+ <xsl:when test="//attr">
7
+ <xsl:value-of select="//attr"/>
8
+ </xsl:when>
9
+ <xsl:otherwise>
10
+ <xsl:value-of select="def"/>
11
+ </xsl:otherwise>
12
+ </xsl:choose>
13
+ <xsl:value-of select="."/>
14
+ </xsl:template>
15
+ <xsl:template mode="payload" match="attributes">
16
+ <xsl:param name="v">
17
+ <xsl:choose>
18
+ <xsl:when test="//s[//s/event] ">
19
+ <xsl:value-of select="//s[//s/event] "/>
20
+ </xsl:when>
21
+ <xsl:when test=" //attributes/@v ">
22
+ <xsl:value-of select=" //attributes/@v "/>
23
+ </xsl:when>
24
+ <xsl:otherwise>
25
+ <xsl:value-of select=" 'def' "/>
26
+ </xsl:otherwise>
27
+ </xsl:choose>
28
+ </xsl:param>
29
+ <dce-root xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" data-dce-id="1">
30
+ <xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="has-input"
31
+ select="count(//s/*) &gt; 0"/>
32
+ <xsl:attribute name="v">
33
+ <xsl:choose>
34
+ <xsl:when test="//s[//s/event] ">
35
+ <xsl:value-of select="//s[//s/event] "/>
36
+ </xsl:when>
37
+ <xsl:when test=" //attributes/@v ">
38
+ <xsl:value-of select=" //attributes/@v "/>
39
+ </xsl:when>
40
+ <xsl:otherwise>
41
+ <xsl:value-of select=" 'def' "/>
42
+ </xsl:otherwise>
43
+ </xsl:choose>
44
+ </xsl:attribute>
45
+ <dce-text xmlns="" data-dce-id="2">
46
+
47
+ //attributes/v='<xsl:value-of select="//attributes/v"/>'
48
+ </dce-text>
49
+ <br xmlns="" data-dce-id="3"/>
50
+ <dce-text xmlns="" data-dce-id="4">
51
+ //attributes/@v='<xsl:value-of select="//attributes/@v"/>'
52
+ </dce-text>
53
+ <br xmlns="" data-dce-id="5"/>
54
+ <dce-text xmlns="" data-dce-id="6">
55
+ $v='<xsl:value-of select="$v"/>'
56
+ </dce-text>
57
+ <br xmlns="" data-dce-id="7"/>
58
+ <dce-text xmlns="" data-dce-id="8">
59
+ //s='<xsl:value-of select="//s"/>'
60
+ </dce-text>
61
+ <br xmlns="" data-dce-id="9"/>
62
+ <dce-text xmlns="" data-dce-id="10">
63
+ A='<xsl:value-of select="//s[//s/event] | //attributes/v[not(//s/event)]"/>'
64
+ </dce-text>
65
+ <br xmlns="" data-dce-id="11"/>
66
+ <dce-text xmlns="" data-dce-id="12">
67
+ has-input =<xsl:value-of select=" $has-input "/>
68
+ </dce-text>
69
+ <br xmlns="" data-dce-id="13"/>
70
+ <xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="in-value">
71
+ <xsl:choose>
72
+ <xsl:when test="//s/event">
73
+ <xsl:value-of select="//s">
74
+ </xsl:value-of>
75
+ </xsl:when>
76
+ <xsl:when test="//attributes/@v">
77
+ <xsl:value-of select="//attributes/@v">
78
+ </xsl:value-of>
79
+ </xsl:when>
80
+ <xsl:otherwise>def</xsl:otherwise>
81
+ </xsl:choose>
82
+ </xsl:variable>
83
+ <xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="xx"
84
+ select="//s[//s/event] ?? //attributes/@v ?? 'def' "/>
85
+ <input xmlns="" slice="s" slice-event="input" value="{$in-value}" data-dce-id="14"/>
86
+ <dce-text xmlns="" data-dce-id="15">$in-value:<xsl:value-of select="$in-value"/> | $xx:<xsl:value-of
87
+ select="$xx"/>
88
+ </dce-text>
89
+ </dce-root>
90
+ </xsl:template>
18
91
  <xsl:template match="/">
19
92
  <xsl:apply-templates mode="payload" select="/datadom/attributes"/>
20
93
  </xsl:template>
@@ -23,7 +96,7 @@
23
96
  <xsl:param name="defaultvalue"/>
24
97
  <xsl:choose>
25
98
  <xsl:when test="//payload/*[@slot=$slotname]">
26
- <xsl:copy-of select="//payload/*[@slot=$slotname]"/>
99
+ <xsl:copy-of select="//payload/*[@slot=$slotname]"/>
27
100
  </xsl:when>
28
101
  <xsl:otherwise>
29
102
  <xsl:copy-of select="$defaultvalue"/>