@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
@@ -0,0 +1,349 @@
1
+ import{w as c,e as t,u as E}from"./index-Dr4PwNfd.js";import{m as g,a as y,c as H}from"./custom-element-CPnvJnn8.js";function x(o){return new Promise(e=>setTimeout(e,o))}function T(o){const{title:e,body:a}=o;return`
2
+ <fieldset>
3
+ <legend>${e}</legend>
4
+ ${a}
5
+ </fieldset>
6
+ `}const I={title:"attributes",render:T};function n(o){const e=document.createElement("div");return e.innerHTML=o,e.firstElementChild}const u={args:{title:"cloneAs(el,newTag)",body:`
7
+ <p><code>cloneAs()</code> used for conversion of <code>attribute</code> to <code>xsl:param</code></p>
8
+ <attribute data-testid="t1" >default_P1 </attribute>
9
+ <attribute data-testid="t2" select="'always_p2'" ></attribute>
10
+ <attribute data-testid="t3" ></attribute>
11
+ `},play:async({canvasElement:o})=>{const e=c(o),a=async i=>{const r=await e.findByTestId(i),d=H(r,"xsl:param");for(let p of r.attributes)await t(p.value).toEqual(d.getAttribute(p.name));await t(d.textContent).toEqual(r.textContent)};await a("t1"),await a("t2"),await a("t3")}},l={args:{title:"mix(to,from)",body:`
12
+ <p><code>mix(to,from)</code> used for <code>attribute</code> collections</p>
13
+ `},play:async()=>{await t(g({},{a:1,b:"2"})).toEqual({a:1,b:"2"})}},b={args:{title:"mergeAttr( from, to )",body:`
14
+ <p><code>mergeAttr( from, to )</code> used for <code>attribute</code> collections</p>
15
+ `},play:async()=>{const o=n('<br title="a" id="b" readonly />'),e=n("<br removed/>");await t(e).toHaveAttribute("removed"),y(o,e),await t(e).toHaveAttribute("title","a"),await t(e).toHaveAttribute("id","b"),await t(e).toHaveAttribute("readonly"),await t(e.getAttributeNames().length).toEqual(3),await t(e).not.toHaveAttribute("removed")}},m={args:{title:"mergeAttr( from, to )",body:`
16
+ <p><code>mergeAttr( from, to )</code> used for <code>attribute</code> collections</p>
17
+ <p><code>dceExportedAttributes</code> property on target element defines the set of attributes which
18
+ would not be removed from target element</p>
19
+ `},play:async()=>{const o=n('<br id="b" readonly />'),e=n("<br removed/>");e.dceExportedAttributes=new Set(["enforced"]),e.setAttribute("enforced","defined by inner component"),await t(e).toHaveAttribute("enforced"),y(o,e),await t(e).toHaveAttribute("id","b"),await t(e).toHaveAttribute("readonly"),await t(e).not.toHaveAttribute("removed"),await t(e).toHaveAttribute("enforced","defined by inner component")}},w={args:{title:"mergeAttr( from, to )",body:`
20
+ <p><code>mergeAttr( from, to )</code> used for <code>attribute</code> collections</p>
21
+ <p><code>dce-exported-attributes</code> attribute on target element defines the space separated list of attributes which
22
+ would not be removed from target element</p>
23
+ `},play:async()=>{const o=n('<br id="b" readonly />'),e=n('<br removed dce-exported-attributes="enforced"/>');e.setAttribute("enforced","defined by inner component"),await t(e).toHaveAttribute("enforced"),y(o,e),await t(e).toHaveAttribute("id","b"),await t(e).toHaveAttribute("readonly"),await t(e).not.toHaveAttribute("removed"),await t(e).toHaveAttribute("enforced","defined by inner component")}},s={args:{title:"Attributes definition",body:`
24
+ <p>Params needed to declare DCE attributes and track the attributes changes. It also is used by IDE and validation.</p>
25
+ <custom-element tag="dce-link" >
26
+ <template>
27
+ <attribute name="p1">default_P1</attribute>
28
+ <attribute name="p2" select="'always_p2'" ></attribute>
29
+ <attribute name="p3" select="//attributes/@p3 ?? 'def_P3' "></attribute>
30
+ p1: <code data-testid="p1">{$p1}</code> <br/>
31
+ p2: <code data-testid="p2">{$p2}</code> <br/>
32
+ p3: <code data-testid="p3">{$p3}</code>
33
+ </template>
34
+ </custom-element>
35
+ <dce-link id="dce1"></dce-link>
36
+ `},play:async({canvasElement:o})=>{const e=c(o);t(await await e.findByTestId("p1")).toHaveTextContent("default_P1"),t(await await e.findByTestId("p2")).toHaveTextContent("always_p2"),t(await await e.findByTestId("p3")).toHaveTextContent("def_P3")}},v={args:{title:"Attributes runtime change",body:`
37
+ <p>Params needed to declare DCE attributes and track the attributes changes. It also be used by IDE and validation.</p>
38
+ <custom-element tag="dce-link2" >
39
+ <template>
40
+ <attribute name="p1">default_P1 </attribute>
41
+ <attribute name="p2" select="'always_p2'" ></attribute>
42
+ <attribute name="p3" select="//attributes/@p3 ?? 'def_P3' "></attribute>
43
+ p1: <code data-testid="t1">{$p1}</code> <br/>
44
+ p2: <code data-testid="t2">{$p2}</code> <br/>
45
+ p3: <code data-testid="t3">{$p3}</code>
46
+ </template>
47
+ </custom-element>
48
+ <section>
49
+ <dce-link2 id="dce2" p1="123" p2="override ignored as select is defined"></dce-link2> <br/>
50
+ <div><input id="i1" value="P1"> <button onclick="dce2.setAttribute('p1',i1.value)"> set p1</button> </div>
51
+ <div><input id="i2" value="P2"> <button onclick="dce2.setAttribute('p2',i2.value)"> set p2</button> </div>
52
+ <div><input id="i3" value="P3"> <button onclick="dce2.setAttribute('p3',i3.value)"> set p3</button> </div>
53
+ </section>
54
+ `},play:async({canvasElement:o})=>{const e=c(o),a=async r=>await e.findByTestId(r);await x(20),t(await a("t1")).toHaveTextContent("123"),t(await a("t2")).toHaveTextContent("always_p2"),t(await a("t3")).toHaveTextContent("def_P3");const i=window.dce2;i.setAttribute("P1",i1.value),await t(await e.findByText("P1")).toBeInTheDocument(),t(await a("t1")).toHaveTextContent("P1"),i.setAttribute("p2",i2.value),t(e.getByTestId("t2")).toHaveTextContent("always_p2"),i.setAttribute("p3",i3.value),await t(await e.findByText("P3")).toBeInTheDocument(),t(e.getByTestId("t3")).toHaveTextContent("P3")}},f={args:{title:"Instance Attributes",body:`
55
+ <p>Params needed to declare DCE attributes and track the attributes changes. It also is used by IDE and validation.</p>
56
+ <custom-element tag="dce-link3" >
57
+ <template>
58
+ <attribute name="p1">default_P1 </attribute>
59
+ <attribute name="p2" select="'always_p2'" ></attribute>
60
+ <attribute name="p3" select="//attributes/p3 ?? 'def_P3' "></attribute>
61
+ p1: <code data-testid="p1">{$p1}</code> <br/>
62
+ p2: <code data-testid="p2">{$p2}</code> <br/>
63
+ p3: <code data-testid="p3">{$p3}</code>
64
+ </template>
65
+ </custom-element>
66
+ <dce-link3 id="dce3" p1="123" p3="qwe"></dce-link3> |
67
+ `},play:async({canvasElement:o})=>{s.args.title;const e=c(o),a=async i=>(await e.findByTestId(i)).textContent.trim();await x(200),t(await a("p1")).toEqual("123"),t(await a("p2")).toEqual("always_p2"),t(await a("p3")).toEqual("qwe")}},A={args:{title:"Instance Attributes",body:`
68
+ <p>Attributes with value(p2) or <code>select</code>(p3) should be propagated to DCE</p>
69
+ <p>p1 attribute is not propagated as does not have the value.</p>
70
+ <custom-element tag="sample-el">
71
+ <template>
72
+ <attribute name="data-testid"></attribute>
73
+ <attribute name="p1"></attribute>
74
+ <attribute name="p2">DEFAULT VALUE</attribute>
75
+ <attribute name="p3" select=" //from-input "></attribute>
76
+ <input slice="from-input" slice-event="input"/><br/>
77
+ p1:<code data-testid="{$data-testid}-p1" >{ $p1 }</code><br/>
78
+ p2:<code data-testid="{$data-testid}-p2" >{ $p2 }</code><br/>
79
+ p3:<code data-testid="{$data-testid}-p3" >{ $p3 }</code><br/>
80
+ //from-input: {//from-input} <hr/>
81
+ </template>
82
+ </custom-element>
83
+
84
+ <sample-el data-testid="t1" value="123" ></sample-el>
85
+ <sample-el data-testid="t2" p1="P1" p2="123" p3="P3" ></sample-el>
86
+ <sample-el data-testid="t3" ></sample-el>
87
+ `},play:async({canvasElement:o})=>{const e=c(o),a=async p=>(await e.findByTestId(p)).textContent?.trim();await x(20),await t(await a("t1-p1")).toEqual(""),await t(await a("t1-p2")).toEqual("DEFAULT VALUE"),await t(await a("t1-p3")).toEqual("");const i=await e.findByTestId("t1");await t(i).toHaveAttribute("value","123"),await t(i).toHaveAttribute("p2","DEFAULT VALUE"),await t(i).toHaveAttribute("p3",""),await t(i).not.toHaveAttribute("p1"),await t(await a("t2-p1")).toEqual("P1"),await t(await a("t2-p2")).toEqual("123"),await t(await a("t2-p3")).toEqual("");const r=await e.findByTestId("t2");await t(r).toHaveAttribute("p1","P1"),await t(r).toHaveAttribute("p2","123"),await t(r).toHaveAttribute("p3",""),await t(await a("t3-p1")).toEqual(""),await t(await a("t3-p2")).toEqual("DEFAULT VALUE"),await t(await a("t3-p3")).toEqual("");const d=await e.findByTestId("t3");await t(i).not.toHaveAttribute("p1"),await t(d).toHaveAttribute("p2","DEFAULT VALUE"),await t(d).toHaveAttribute("p3",""),d.querySelector("input")?.focus(),await E.keyboard("DCE"),await t(d).toHaveAttribute("p3","DCE")}};u.parameters={...u.parameters,docs:{...u.parameters?.docs,source:{originalSource:`{
88
+ args: {
89
+ title: 'cloneAs(el,newTag)',
90
+ body: \`
91
+ <p><code>cloneAs()</code> used for conversion of <code>attribute</code> to <code>xsl:param</code></p>
92
+ <attribute data-testid="t1" >default_P1 </attribute>
93
+ <attribute data-testid="t2" select="'always_p2'" ></attribute>
94
+ <attribute data-testid="t3" ></attribute>
95
+ \`
96
+ },
97
+ play: async ({
98
+ canvasElement
99
+ }) => {
100
+ const canvas = within(canvasElement);
101
+ const cmp = async (tid: string) => {
102
+ const t1 = await canvas.findByTestId(tid);
103
+ const c1 = cloneAs(t1, 'xsl:param');
104
+ for (let a of t1.attributes) {
105
+ await expect(a.value).toEqual(c1.getAttribute(a.name));
106
+ }
107
+ await expect(c1.textContent).toEqual(t1.textContent);
108
+ };
109
+ await cmp('t1');
110
+ await cmp('t2');
111
+ await cmp('t3');
112
+ }
113
+ }`,...u.parameters?.docs?.source}}};l.parameters={...l.parameters,docs:{...l.parameters?.docs,source:{originalSource:`{
114
+ args: {
115
+ title: 'mix(to,from)',
116
+ body: \`
117
+ <p><code>mix(to,from)</code> used for <code>attribute</code> collections</p>
118
+ \`
119
+ },
120
+ play: async () => {
121
+ await expect(mix({}, {
122
+ a: 1,
123
+ b: '2'
124
+ })).toEqual({
125
+ a: 1,
126
+ b: '2'
127
+ });
128
+ }
129
+ }`,...l.parameters?.docs?.source}}};b.parameters={...b.parameters,docs:{...b.parameters?.docs,source:{originalSource:`{
130
+ args: {
131
+ title: 'mergeAttr( from, to )',
132
+ body: \`
133
+ <p><code>mergeAttr( from, to )</code> used for <code>attribute</code> collections</p>
134
+ \`
135
+ },
136
+ play: async () => {
137
+ const from = html2Element('<br title="a" id="b" readonly />');
138
+ const to = html2Element('<br removed/>');
139
+ await expect(to).toHaveAttribute('removed');
140
+ mergeAttr(from!, to);
141
+ await expect(to).toHaveAttribute('title', 'a');
142
+ await expect(to).toHaveAttribute('id', 'b');
143
+ await expect(to).toHaveAttribute('readonly');
144
+ await expect(to.getAttributeNames().length).toEqual(3);
145
+ await expect(to).not.toHaveAttribute('removed');
146
+ }
147
+ }`,...b.parameters?.docs?.source}}};m.parameters={...m.parameters,docs:{...m.parameters?.docs,source:{originalSource:`{
148
+ args: {
149
+ title: 'mergeAttr( from, to )',
150
+ body: \`
151
+ <p><code>mergeAttr( from, to )</code> used for <code>attribute</code> collections</p>
152
+ <p><code>dceExportedAttributes</code> property on target element defines the set of attributes which
153
+ would not be removed from target element</p>
154
+ \`
155
+ },
156
+ play: async () => {
157
+ const from = html2Element('<br id="b" readonly />');
158
+ const to = html2Element('<br removed/>') as (HTMLElement & {
159
+ dceExportedAttributes: Set<string>;
160
+ });
161
+ to.dceExportedAttributes = new Set(['enforced']);
162
+ to.setAttribute('enforced', "defined by inner component");
163
+ await expect(to).toHaveAttribute('enforced');
164
+ mergeAttr(from, to);
165
+ await expect(to).toHaveAttribute('id', 'b');
166
+ await expect(to).toHaveAttribute('readonly');
167
+ await expect(to).not.toHaveAttribute('removed');
168
+ await expect(to).toHaveAttribute('enforced', "defined by inner component");
169
+ }
170
+ }`,...m.parameters?.docs?.source}}};w.parameters={...w.parameters,docs:{...w.parameters?.docs,source:{originalSource:`{
171
+ args: {
172
+ title: 'mergeAttr( from, to )',
173
+ body: \`
174
+ <p><code>mergeAttr( from, to )</code> used for <code>attribute</code> collections</p>
175
+ <p><code>dce-exported-attributes</code> attribute on target element defines the space separated list of attributes which
176
+ would not be removed from target element</p>
177
+ \`
178
+ },
179
+ play: async () => {
180
+ const from = html2Element('<br id="b" readonly />');
181
+ const to = html2Element('<br removed dce-exported-attributes="enforced"/>') as (HTMLElement & {
182
+ dceExportedAttributes: Set<string>;
183
+ });
184
+ to.setAttribute('enforced', "defined by inner component");
185
+ await expect(to).toHaveAttribute('enforced');
186
+ mergeAttr(from, to);
187
+ await expect(to).toHaveAttribute('id', 'b');
188
+ await expect(to).toHaveAttribute('readonly');
189
+ await expect(to).not.toHaveAttribute('removed');
190
+ await expect(to).toHaveAttribute('enforced', "defined by inner component");
191
+ }
192
+ }`,...w.parameters?.docs?.source}}};s.parameters={...s.parameters,docs:{...s.parameters?.docs,source:{originalSource:`{
193
+ args: {
194
+ title: 'Attributes definition',
195
+ body: \`
196
+ <p>Params needed to declare DCE attributes and track the attributes changes. It also is used by IDE and validation.</p>
197
+ <custom-element tag="dce-link" >
198
+ <template>
199
+ <attribute name="p1">default_P1</attribute>
200
+ <attribute name="p2" select="'always_p2'" ></attribute>
201
+ <attribute name="p3" select="//attributes/@p3 ?? 'def_P3' "></attribute>
202
+ p1: <code data-testid="p1">{$p1}</code> <br/>
203
+ p2: <code data-testid="p2">{$p2}</code> <br/>
204
+ p3: <code data-testid="p3">{$p3}</code>
205
+ </template>
206
+ </custom-element>
207
+ <dce-link id="dce1"></dce-link>
208
+ \`
209
+ },
210
+ play: async ({
211
+ canvasElement
212
+ }) => {
213
+ const canvas = within(canvasElement);
214
+ expect(await await canvas.findByTestId('p1')).toHaveTextContent('default_P1');
215
+ expect(await await canvas.findByTestId('p2')).toHaveTextContent('always_p2');
216
+ expect(await await canvas.findByTestId('p3')).toHaveTextContent('def_P3');
217
+ }
218
+ }`,...s.parameters?.docs?.source}}};v.parameters={...v.parameters,docs:{...v.parameters?.docs,source:{originalSource:`{
219
+ args: {
220
+ title: 'Attributes runtime change',
221
+ body: \`
222
+ <p>Params needed to declare DCE attributes and track the attributes changes. It also be used by IDE and validation.</p>
223
+ <custom-element tag="dce-link2" >
224
+ <template>
225
+ <attribute name="p1">default_P1 </attribute>
226
+ <attribute name="p2" select="'always_p2'" ></attribute>
227
+ <attribute name="p3" select="//attributes/@p3 ?? 'def_P3' "></attribute>
228
+ p1: <code data-testid="t1">{$p1}</code> <br/>
229
+ p2: <code data-testid="t2">{$p2}</code> <br/>
230
+ p3: <code data-testid="t3">{$p3}</code>
231
+ </template>
232
+ </custom-element>
233
+ <section>
234
+ <dce-link2 id="dce2" p1="123" p2="override ignored as select is defined"></dce-link2> <br/>
235
+ <div><input id="i1" value="P1"> <button onclick="dce2.setAttribute('p1',i1.value)"> set p1</button> </div>
236
+ <div><input id="i2" value="P2"> <button onclick="dce2.setAttribute('p2',i2.value)"> set p2</button> </div>
237
+ <div><input id="i3" value="P3"> <button onclick="dce2.setAttribute('p3',i3.value)"> set p3</button> </div>
238
+ </section>
239
+ \`
240
+ },
241
+ play: async ({
242
+ canvasElement
243
+ }) => {
244
+ const canvas = within(canvasElement),
245
+ code = async (id: string) => await canvas.findByTestId(id);
246
+ await sleep(20);
247
+ expect(await code('t1')).toHaveTextContent('123');
248
+ expect(await code('t2')).toHaveTextContent('always_p2'); // no overrides due to value is hardcoded
249
+ expect(await code('t3')).toHaveTextContent('def_P3');
250
+ const dce2 = window.dce2;
251
+ dce2.setAttribute('P1', i1.value);
252
+ await expect(await canvas.findByText('P1')).toBeInTheDocument();
253
+ expect(await code('t1')).toHaveTextContent('P1'); // 4. set p1 in runtime'
254
+
255
+ dce2.setAttribute('p2', i2.value);
256
+ // await expect(await canvas.findByText('P2')).toBeInTheDocument();
257
+ expect(canvas.getByTestId('t2')).toHaveTextContent('always_p2'); // can not set p2 in runtime
258
+
259
+ dce2.setAttribute('p3', i3.value);
260
+ await expect(await canvas.findByText('P3')).toBeInTheDocument();
261
+ expect(canvas.getByTestId('t3')).toHaveTextContent('P3'); // set p3 in runtime
262
+ }
263
+ }`,...v.parameters?.docs?.source}}};f.parameters={...f.parameters,docs:{...f.parameters?.docs,source:{originalSource:`{
264
+ args: {
265
+ title: 'Instance Attributes',
266
+ body: \`
267
+ <p>Params needed to declare DCE attributes and track the attributes changes. It also is used by IDE and validation.</p>
268
+ <custom-element tag="dce-link3" >
269
+ <template>
270
+ <attribute name="p1">default_P1 </attribute>
271
+ <attribute name="p2" select="'always_p2'" ></attribute>
272
+ <attribute name="p3" select="//attributes/p3 ?? 'def_P3' "></attribute>
273
+ p1: <code data-testid="p1">{$p1}</code> <br/>
274
+ p2: <code data-testid="p2">{$p2}</code> <br/>
275
+ p3: <code data-testid="p3">{$p3}</code>
276
+ </template>
277
+ </custom-element>
278
+ <dce-link3 id="dce3" p1="123" p3="qwe"></dce-link3> |
279
+ \`
280
+ },
281
+ play: async ({
282
+ canvasElement
283
+ }) => {
284
+ const titleText = AttributeDefaults.args!.title as string;
285
+ const canvas = within(canvasElement),
286
+ code = async id => (await canvas.findByTestId(id)).textContent.trim();
287
+ await sleep(200);
288
+ expect(await code('p1')).toEqual('123');
289
+ expect(await code('p2')).toEqual('always_p2');
290
+ expect(await code('p3')).toEqual('qwe');
291
+ }
292
+ }`,...f.parameters?.docs?.source}}};A.parameters={...A.parameters,docs:{...A.parameters?.docs,source:{originalSource:`{
293
+ args: {
294
+ title: 'Instance Attributes',
295
+ body: \`
296
+ <p>Attributes with value(p2) or <code>select</code>(p3) should be propagated to DCE</p>
297
+ <p>p1 attribute is not propagated as does not have the value.</p>
298
+ <custom-element tag="sample-el">
299
+ <template>
300
+ <attribute name="data-testid"></attribute>
301
+ <attribute name="p1"></attribute>
302
+ <attribute name="p2">DEFAULT VALUE</attribute>
303
+ <attribute name="p3" select=" //from-input "></attribute>
304
+ <input slice="from-input" slice-event="input"/><br/>
305
+ p1:<code data-testid="{$data-testid}-p1" >{ $p1 }</code><br/>
306
+ p2:<code data-testid="{$data-testid}-p2" >{ $p2 }</code><br/>
307
+ p3:<code data-testid="{$data-testid}-p3" >{ $p3 }</code><br/>
308
+ //from-input: {//from-input} <hr/>
309
+ </template>
310
+ </custom-element>
311
+
312
+ <sample-el data-testid="t1" value="123" ></sample-el>
313
+ <sample-el data-testid="t2" p1="P1" p2="123" p3="P3" ></sample-el>
314
+ <sample-el data-testid="t3" ></sample-el>
315
+ \`
316
+ },
317
+ play: async ({
318
+ canvasElement
319
+ }) => {
320
+ const canvas = within(canvasElement),
321
+ code = async (id: string) => (await canvas.findByTestId(id)).textContent?.trim();
322
+ await sleep(20);
323
+ await expect(await code('t1-p1')).toEqual('');
324
+ await expect(await code('t1-p2')).toEqual('DEFAULT VALUE');
325
+ await expect(await code('t1-p3')).toEqual('');
326
+ const t1 = await canvas.findByTestId('t1');
327
+ await expect(t1).toHaveAttribute('value', '123');
328
+ await expect(t1).toHaveAttribute('p2', 'DEFAULT VALUE');
329
+ await expect(t1).toHaveAttribute('p3', '');
330
+ await expect(t1).not.toHaveAttribute('p1');
331
+ await expect(await code('t2-p1')).toEqual('P1');
332
+ await expect(await code('t2-p2')).toEqual('123');
333
+ await expect(await code('t2-p3')).toEqual('');
334
+ const t2 = await canvas.findByTestId('t2');
335
+ await expect(t2).toHaveAttribute('p1', 'P1');
336
+ await expect(t2).toHaveAttribute('p2', '123');
337
+ await expect(t2).toHaveAttribute('p3', '');
338
+ await expect(await code('t3-p1')).toEqual('');
339
+ await expect(await code('t3-p2')).toEqual('DEFAULT VALUE');
340
+ await expect(await code('t3-p3')).toEqual('');
341
+ const t3 = await canvas.findByTestId('t3');
342
+ await expect(t1).not.toHaveAttribute('p1');
343
+ await expect(t3).toHaveAttribute('p2', 'DEFAULT VALUE');
344
+ await expect(t3).toHaveAttribute('p3', '');
345
+ t3.querySelector('input')?.focus();
346
+ await userEvent.keyboard('DCE');
347
+ await expect(t3).toHaveAttribute('p3', 'DCE');
348
+ }
349
+ }`,...A.parameters?.docs?.source}}};const C=["CloneAs","Mix","MergeAttr","dceExportedAttributes","dceExportedAttributes_attr","AttributeDefaults","AttributesRuntimeChange","InstanceAttributes","AttributesPropagationUp"];export{s as AttributeDefaults,A as AttributesPropagationUp,v as AttributesRuntimeChange,u as CloneAs,f as InstanceAttributes,b as MergeAttr,l as Mix,C as __namedExportsOrder,m as dceExportedAttributes,w as dceExportedAttributes_attr,I as default};
@@ -1,4 +1,4 @@
1
- import{w as i,e as t}from"./index-CxRwF5Or.js";import"./custom-element-D59Fok1f.js";const g={title:"",tag:"",style:"",slot:"",payload:""};function p(n){const{title:e,tag:o,style:s,slot:a,payload:l}={...g,...n};return`
1
+ import{w as i,e as t}from"./index-Dr4PwNfd.js";import"./custom-element-CPnvJnn8.js";const g={title:"",tag:"",style:"",slot:"",payload:""};function p(n){const{title:e,tag:o,style:s,slot:a,payload:l}={...g,...n};return`
2
2
  <fieldset>
3
3
  <legend>${e}</legend>
4
4
  <custom-element ${o?`tag="${o}"`:""} >
@@ -0,0 +1,97 @@
1
+ const K="http://www.w3.org/1999/XSL/Transform",R="http://www.w3.org/1999/xhtml",be="http://exslt.org/common",d=(e,l)=>e?.getAttribute?.(l),se=e=>e.nodeType===3,ye=e=>typeof e=="string",ge=e=>e&&typeof e.nodeType=="number",L=(e,l)=>(e.ownerDocument||e).createTextNode(l),oe=e=>{for(;e.firstChild;)e.firstChild.remove();return e},F=e=>(e.getAttributeNames().map(l=>e.removeAttribute(l)),oe(e)),ce=e=>(e?.setAttribute("xmlns:xsl",K),e),me=e=>(e?.setAttribute("xmlns:xhtml",R),ce(e)),ue=e=>/^[_a-zA-Z][-_:a-zA-Z0-9]*$/.test(e),le=(e,l)=>(Object.keys(l).map(t=>e[t]=l[t]),e),$=(e,l="",t=document)=>{const s=n=>(o=>(l&&o.append(L(t.ownerDocument||t,l)),o))((t.ownerDocument||t).createElement(n));if(ue(e))return s(e);const a=s("dce-object");return a.setAttribute("dce-object-name",e),a},ne=(e,l)=>{const t=e.ownerDocument.createElementNS(e.namespaceURI,l);for(let s of e.attributes)t.setAttribute(s.name,s.value);for(let s of e.childNodes)t.append(s.cloneNode(!0));return t};function O(e){return new DOMParser().parseFromString(e,"application/xml")}function q(e){return new XMLSerializer().serializeToString(e)}function B(e,l,t,s){const a=g=>e.ownerDocument.createElement(g),o=((g,x,v)=>(x.append(v=a(g)),v))(l,e);return[...t].forEach(g=>o.append(s(g))),o}function Ae(e){return e.slot||(e.setAttribute||(e=$("span",e.textContent.replaceAll(`
2
+ `,""))),e.setAttribute("slot","")),e}function J(e,l){e.getAttributeNames().forEach(t=>l.includes(t)||e.removeAttribute(t))}const ae=e=>[...e].filter(l=>!(l.nodeType===3&&l.data.trim()===""));function I(e,l,t){const s=typeof e;if(s==="string")return $(l,e,t);if(s==="number")return $(l,""+e,t);if(e instanceof Array){const n=$("array","",t);return e.map(o=>n.append(I(o,l,t))),n}if(e instanceof FormData){const n=$("form-data","",t);for(const o of e)n.append(I(o[1],o[0],t));return n}const a=$(l,"",t);for(let n in e)ge(e[n])||typeof e[n]=="function"||e[n]instanceof Window||(typeof e[n]!="object"&&ue(n)?a.setAttribute(n,e[n]):a.append(I(e[n],n,t)));return a}function ie(e){if(j(e,"*",l=>[...l.childNodes].filter(t=>t.nodeType===3&&t.parentNode.localName!=="style"&&t.data).forEach(t=>{const s=t.data,a=s.matchAll(/{([^}]*)}/g);if(a){let n=0,o=x=>L(t,x),g=[];if([...a].forEach(x=>{x.index>n&&g.push(o(x.input.substring(n,x.index)));const v=e.querySelector("value-of").cloneNode();v.setAttribute("select",x[1]),g.push(v),n=x.index+x[0].length}),n<s.length&&g.push(o(s.substring(n,s.length))),g.length){for(let x of g)l.insertBefore(x,t);l.removeChild(t)}}})),"all"in e){let l=1;for(let t of e.all)t.setAttribute&&!t.tagName.startsWith("xsl:")&&t.setAttribute("data-dce-id",""+l++)}return e}function ve(e,l="xsl:stylesheet"){const t=[],s={},a={};if(e.tagName===l||e.documentElement?.tagName===l)return ie(le(e,{declaredAttributes:t,hardcodedAttributes:s,exposedAttributes:a}));const n=O(`<xsl:stylesheet version="1.0" xmlns:xsl="${K}" xmlns:xhtml="${R}" xmlns:exsl="${be}" exclude-result-prefixes="exsl" >
3
+ <xsl:output method="xml"/>
4
+ <xsl:template match="/"><dce-root xmlns="${R}"><xsl:apply-templates select="*" /></dce-root></xsl:template>
5
+ <xsl:template match="*[name()='template']">
6
+ <xsl:apply-templates mode="sanitize" select="*|text()"/>
7
+ </xsl:template>
8
+ <xsl:template match="*">
9
+ <xsl:apply-templates mode="sanitize" select="*|text()"/>
10
+ </xsl:template>
11
+ <xsl:template match="*[name()='svg']|*[name()='math']">
12
+ <xsl:apply-templates mode="sanitize" select="."/>
13
+ </xsl:template>
14
+ <xsl:template mode="sanitize" match="*[count(text())=1 and count(*)=0]">
15
+ <xsl:copy>
16
+ <xsl:apply-templates mode="sanitize" select="@*"/>
17
+ <xsl:value-of select="text()"></xsl:value-of>
18
+ </xsl:copy>
19
+ </xsl:template>
20
+ <xsl:template mode="sanitize" match="xhtml:*[count(text())=1 and count(*)=0]">
21
+ <xsl:element name="{local-name()}">
22
+ <xsl:apply-templates mode="sanitize" select="@*"/>
23
+ <xsl:value-of select="text()"></xsl:value-of>
24
+ </xsl:element>
25
+ </xsl:template>
26
+ <xsl:template mode="sanitize" match="*|@*">
27
+ <xsl:copy>
28
+ <xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
29
+ </xsl:copy>
30
+ </xsl:template>
31
+ <xsl:template mode="sanitize" match="text()[normalize-space(.) = '']"/>
32
+ <xsl:template mode="sanitize" match="text()">
33
+ <dce-text>
34
+ <xsl:copy/>
35
+ </dce-text>
36
+ </xsl:template>
37
+ <xsl:template mode="sanitize" match="xsl:value-of|*[name()='slot']">
38
+ <xsl:copy>
39
+ <xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
40
+ </xsl:copy>
41
+ </xsl:template>
42
+ <xsl:template mode="sanitize" match="xhtml:*">
43
+ <xsl:element name="{local-name()}">
44
+ <xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
45
+ </xsl:element>
46
+ </xsl:template>
47
+ <xsl:template mode="sanitize" match="xhtml:input">
48
+ <xsl:element name="{local-name()}">
49
+ <xsl:apply-templates mode="sanitize" select="*[not(name()='slice')]|@*|text()"/>
50
+ </xsl:element>
51
+ <xsl:for-each select="slice">
52
+ <xsl:copy>
53
+ <xsl:attribute name="for" >^</xsl:attribute>
54
+ <xsl:apply-templates mode="sanitize" select="*|@*|text()"/>
55
+ </xsl:copy>
56
+ </xsl:for-each>
57
+ </xsl:template>
58
+ </xsl:stylesheet>`),o=new XSLTProcessor,g=(i=>{j(i,"custom-element",f=>{f.firstElementChild.localName==="template"&&([...f.firstElementChild.content.childNodes].forEach(b=>f.append(b)),f.firstElementChild.remove())}),j(i,"script",f=>f.remove());const r=i.content??i.firstElementChild?.content??i.body??i;$e.forEach(f=>j(r,f,b=>Le(b,r)));const h=i.firstElementChild?.content||i.content,y=f=>{const b=O("<xhtml/>"),T=b.importNode(f,!0);return b.replaceChild(T,b.documentElement),T.namespaceURI===R&&!d(T,"xmlns")&&T.setAttribute("xmlns",R),me(T)};if(h){const f=$("div");return[...h.childNodes].map(b=>f.append(b.cloneNode(!0))),y(f)}return y(i.documentElement||i.body||i)})(e),x=O(`<xsl:stylesheet version="1.0"
59
+ xmlns:xsl="${K}"
60
+ xmlns:xhtml="${R}"
61
+ xmlns:dce="urn:schemas-epa-wg:dce"
62
+ xmlns:exsl="http://exslt.org/common"
63
+ exclude-result-prefixes="exsl"
64
+ >
65
+ <xsl:template match="ignore">
66
+ <xsl:choose>
67
+ <xsl:when test="//attr">{//attr}</xsl:when>
68
+ <xsl:otherwise>{def}</xsl:otherwise>
69
+ </xsl:choose><xsl:value-of select="."></xsl:value-of></xsl:template>
70
+ <xsl:template mode="payload" match="attributes"></xsl:template>
71
+ <xsl:template match="/">
72
+ <xsl:apply-templates mode="payload" select="/datadom/attributes"/>
73
+ </xsl:template>
74
+ <xsl:template name="slot" >
75
+ <xsl:param name="slotname" />
76
+ <xsl:param name="defaultvalue" />
77
+ <xsl:choose>
78
+ <xsl:when test="//payload/*[@slot=$slotname]">
79
+ <xsl:copy-of select="//payload/*[@slot=$slotname]"/>
80
+ </xsl:when>
81
+ <xsl:otherwise>
82
+ <xsl:copy-of select="$defaultvalue"/>
83
+ </xsl:otherwise>
84
+ </xsl:choose>
85
+ </xsl:template>
86
+ <xsl:variable name="js-injected-body">
87
+ <xsl:call-template name="slot" >
88
+ <xsl:with-param name="slotname" select="''"/>
89
+ <xsl:with-param name="defaultvalue"/>
90
+ </xsl:call-template>
91
+ </xsl:variable>
92
+ </xsl:stylesheet>`);o.importStylesheet(n);const v=o.transformToFragment(g,document),u=(i,r)=>i.querySelector(r),w=u(x,'template[mode="payload"]');if(!v)return console.error("transformation error",{xml:g.outerHTML,xsl:q(n)});if(v.firstElementChild.localName!=="dce-root"){const i=v.ownerDocument.createElement("dce-root");[...v.childNodes].forEach(r=>i.append(r)),v.append(i)}[...v.querySelectorAll("[test]")].forEach(i=>{const r=d(i,"test"),h=r.replace(/hasBoolAttribute\((.*?)\)/g,(y,f,b,T,M)=>{const D=f.substring(1);return`(not($${D} = 'false') and ($${D} = '' or $${D} = '${D}' or $${D} = 'true' ))`});r!==h&&i.setAttribute("test",h)}),[...v.querySelectorAll("dce-root>attribute")].forEach(i=>{J(i,"namespace,name,select");const r=ne(i,"xsl:param"),h=d(i,"name");if(t.push(h),i.childNodes.length&&(s[h]=i.textContent),w.append(r),i.hasAttribute("select")){a[h]=d(i,"select"),J(r,"select,name");let y=d(i,"select").split("??"),f;if(y?.length>1){r.removeAttribute("select");const b=u(x,'template[match="ignore"]>choose').cloneNode(!0);F(b.firstElementChild).append(L(b,"{"+y[0]+"}")),b.firstElementChild.setAttribute("test",y[0]);for(let T=1;T<y.length-1;T++){const M=b.firstElementChild.cloneNode(!0);F(M).append(L(b,"{"+y[T]+"}")),M.setAttribute("test",y[T]),b.insertBefore(M,b.lastElementChild)}F(b.lastElementChild).append(L(b,"{"+y[y.length-1]+"}")),r.append(b),f=b.cloneNode(!0)}else f=ne(i,"xsl:value-of");f.removeAttribute("name"),i.append(f),i.removeAttribute("select")}else J(r,"name"),r.setAttribute("select","/datadom/attributes/"+h),s[h]||i.remove()}),[...v.querySelectorAll("[value]")].filter(i=>i.getAttribute("value").match(/\{(.*)\?\?(.*)\}/g)).forEach(i=>{const r=d(i,"value");r&&i.setAttribute("value",Ce(r))});for(const i of v.childNodes)w.append(x.importNode(i,!0));[...w.getElementsByTagName("xsl:template")].forEach(i=>w.ownerDocument.documentElement.append(i));const k=u(x,'call-template[name="slot"]'),H=i=>{const r=k.cloneNode(!0),h=d(i,"name");h&&r.firstElementChild.setAttribute("select",`'${h}'`);for(let y of i.childNodes)r.lastElementChild.append(y);return r};j(w,"slot",i=>i.parentNode.replaceChild(H(i),i));const p=ie(x);return le(p,{declaredAttributes:t,hardcodedAttributes:s,exposedAttributes:a}),p}async function Ee(e){return await new Promise((t,s)=>{const a=new XMLHttpRequest;a.open("GET",e),a.responseType="document",a.onload=()=>{a.readyState===a.DONE&&a.status===200?t(a.responseXML?.body||a.responseXML||$("div",a.responseText)):s(`${a.statusText} - ${e}`)},a.addEventListener("error",n=>s(n)),a.send()})}const de=e=>e.split("|").map(l=>l.trim()).filter(l=>l),Ne=(e,l)=>de(l).map(t=>{let s=e.ownerDocument,a=n=>(e.append(n),n);if(t.includes("/")){const n=[],o=s.evaluate(t,e);for(let g;g=o.iterateNext();)n.push(g);return n}return[...e.childNodes].find(n=>n.localName===t)||a($(t,"",s))}).flat();function re(e,l,t,s){if(!t.sliceProcessed)return t.sliceProcessed=1,Ne(e,l??"").map(a=>{const n=e.ownerDocument,o=t.sliceEventSource,g=t.sliceElement,x=()=>[...a.childNodes].filter(u=>u.nodeType===3||u.localName==="value"||u.localName==="form-data").map(u=>u.remove());o.getAttributeNames().map(u=>a.setAttribute(u,d(o,u))),[...a.childNodes].filter(u=>u.localName==="event").map(u=>u.remove()),"validationMessage"in o&&a.setAttribute("validation-message",o.validationMessage),t.type==="init"&&x(),a.append(I(t,"event",n));const v=(o.type==="checkbox"||o.type==="radio")&&!o.checked;if(g.hasAttribute("slice-value")){o.value===void 0?a.removeAttribute("value"):a.setAttribute("value",o.value);const u=v?"":P(d(g,"slice-value"),a);x(),a.append(L(n,u))}else{if("elements"in o)return x(),a.append(I(new FormData(o),"value",a.ownerDocument)),a;const u=v?"":o.value??d(o,"value");if(x(),u==null)[...a.childNodes].filter(w=>w.localName!=="event").map(w=>w.remove()),a.removeAttribute("value");else{const w=ye(u)?L(n,u):I(u,"value",a.ownerDocument);a.append(w),a.setAttribute("value",u)}}return a})}function j(e,l,t){e.querySelectorAll&&[...e.querySelectorAll(l)].forEach(t)}const we=async(e,l)=>{if(!e||!e.trim())return[l];if(e.startsWith("#"))return(t=>{const s=t.querySelectorAll(e);return[...s.length?s:t.getRootNode().querySelectorAll(e)]})(l.parentElement);try{const[t,s]=e.split("#");if(e.charAt(0)===".")e=new URL(t,l.closest("[base]")?.getAttribute("base")||location).href;else try{e=import.meta.resolve(t),s&&(e+="#"+s)}catch(n){console.error(n.message)}const a=await Ee(e);if(l.setAttributeNS("xml","base",e),s){const n=a.querySelectorAll("#"+s);return n.length?[...n]:(console.error("template not found",e+"#"+s),[l])}return[a]}catch{return[l]}};function pe(e,l){for(let n of e.attributes)try{const o=n.name;n.namespaceURI?(!l.hasAttributeNS(n.namespaceURI,o)||l.getAttributeNS(n.namespaceURI,o)!==n.value)&&l.setAttributeNS(n.namespaceURI,o,n.value):(!l.hasAttribute(o)||l.getAttribute(o)!==n.value)&&l.setAttribute(n.name,n.value),n.name==="value"&&(l.value=n.value)}catch(o){console.warn("attribute assignment error",o?.message||o)}const t=l.dceExportedAttributes,s=l.getAttribute("dce-exported-attributes"),a=s?new Set(s.split(" ")):null;for(let n of l.getAttributeNames())!e.hasAttribute(n)&&!t?.has(n)&&!a?.has(n)&&l.removeAttribute(n)}function he(e,l=0){const t={};for(const s of e.childNodes){const a=d(s,"data-dce-id")||s.dceId||0;if(!t[a])a?t[a]=1:(t[a]=s.dceId=++l,s.setAttribute&&s.setAttribute("data-dce-id",s.dceId));else{const n=s.dceId=a+"-"+t[a]++;s.setAttribute&&s.setAttribute("data-dce-id",n)}s.childNodes.length&&he(s)}}function Te(e,l,t){t=1*t;for(let s of e.childNodes)if((s.dceId??s.getAttribute("data-dce-id")*1)>t)return e.insertBefore(l,s);e.append(l)}function fe(e,l){if(e.firstElementChild?.localName==="dce-root"&&l[0]?.localName!=="dce-root")return;if(!l.length)return e.firstElementChild?.localName!=="dce-root"&&oe(e);const t={};for(let s of e.childNodes)t[s.dceId],se(s)?(s.data.trim(),t[s.dceId||0]=s):t[d(s,"data-dce-id")||0]=s;for(let s of[...l]){const a=d(s,"data-dce-id")||s.dceId,n=t[a];n?(se(s)?n.nodeValue!==s.nodeValue&&(n.nodeValue=s.nodeValue):(pe(s,n),(n.childNodes.length||s.childNodes.length)&&fe(n,s.childNodes)),delete t[a]):Te(e,s,a)}for(let s of Object.values(t))s.localName!=="dce-root"&&s.remove()}function Se(e,l){return e.hasAttribute(l)||e.setAttribute(l,crypto.randomUUID()),e.getAttribute(l)}const Ce=e=>[...e?.matchAll(/([^{}]*)(\{)([^}]+)}([^{}]*)/g)].map(t=>`${t[1]}{${Q(t[3])}}${t[4]}`).join(""),Q=e=>{if(!e.trim())return e;const l=e.split("??"),t=l.shift(),s=Q(l.join("??"));return l.length?`concat( ${t} , substring( ${s} , (1+string-length( ${s} )) * string-length( ${t} ) ) )`:e},P=(e,l)=>{const t=e.split("??");if(t.length>1)return P(t[0],l)||P(t[1],l);e=Q(e);const s=l.ownerDocument.evaluate(e,l);switch(s.resultType){case XPathResult.NUMBER_TYPE:return s.numberValue;case XPathResult.STRING_TYPE:return s.stringValue;case XPathResult.BOOLEAN_TYPE:return s.booleanValue}let a="";for(let n;n=s.iterateNext();)a+=n.textContent;return a},$e="stylesheet,transform,import,include,strip-space,preserve-space,output,key,decimal-format,namespace-alias,value-of,copy-of,number,apply-templates,apply-imports,for-each,sort,if,choose,when,otherwise,attribute-set,call-template,with-param,variable,param,text,processing-instruction,element,attribute,comment,copy,message,fallback".split(","),Le=(e,l)=>{const t=$("xsl:"+e.localName);for(let s of e.attributes)t.setAttribute(s.name,s.value);for(;e.firstChild;)t.append(e.firstChild);if(e.parentElement)e.parentElement.replaceChild(t,e);else{const s=e.parentElement||l,a=[...s.childNodes];a.forEach((n,o)=>{n===e&&(a[o]=t)}),s.replaceChildren(...a)}};class De extends HTMLElement{static observedAttributes=["src","tag","hidden"];async connectedCallback(){this.firstElementChild&&this.firstElementChild.localName!=="template"&&console.log(`custom-element used without template wrapping content
93
+ `,this.outerHTML);const l=await we(d(this,"src"),this),t=d(this,"tag"),s=t||"dce-"+crypto.randomUUID();for(const p of l)j(p.templateNode||p.content||p,"style",i=>{const r=i.closest("slot"),h=r?`slot[name="${r.name}"]`:"";i.innerHTML=`${s} ${h}{${i.innerHTML}}`,this.append(i)});const a=l.map(p=>ve(p)),n=a.map((p,i)=>{i=new XSLTProcessor;try{i.importStylesheet(p)}catch(r){console.error(r,q(p))}return i});Object.defineProperty(this,"xsltString",{get:()=>a.map(p=>q(p)).join(`
94
+ `)});const o=this,g=[...this.templateNode.querySelectorAll("[slice]")],x=g.map(p=>d(p,"slice")).filter(p=>!p.includes("/")).filter((p,i,r)=>r.indexOf(p)===i).map(de).flat(),{declaredAttributes:v,hardcodedAttributes:u,exposedAttributes:w}=a[0],ee=new Set([...Object.keys(u),...Object.keys(w)]);class k extends HTMLElement{static get observedAttributes(){return v}#e=0;get dceExportedAttributes(){return ee}connectedCallback(){let i=ae(this.childNodes);if(this.firstElementChild?.tagName==="TEMPLATE"){this.firstElementChild!==this.lastElementChild&&console.error("payload should have TEMPLATE as only child",this.outerHTML);const c=this.firstElementChild;c.remove(),i=ae(c.content.childNodes);for(const E of i)if(E.localName==="style"){const m=Se(this,"data-dce-style");E.innerHTML=`${s}[data-dce-style="${m}"]{${E.innerHTML}}`,c.insertAdjacentElement("beforebegin",E)}else E.nodeType===1?c.insertAdjacentElement("beforebegin",E):E.nodeType===3&&c.insertAdjacentText("beforebegin",E.data)}const r=O("<datadom/>").documentElement,h=(c,E="")=>(m=>(E&&m.append(L(r,E)),m))(r.ownerDocument.createElement(c)),y=B(r,"payload",i,Ae);ce(y),me(y),this.innerHTML="";const f=B(r,"attributes",this.attributes,c=>h(c.nodeName,c.value)),b=c=>this.hasAttribute(c)||[...f.children].find(E=>E.localName===c);pe(this,f),Object.keys(u).map(c=>b(c)||f.append(h(c,u[c]))),Object.keys(w).map(c=>b(c)||f.append(h(c))),B(r,"dataset",Object.keys(this.dataset),c=>h(c,this.dataset[c]));const T=B(r,"slice",x,c=>h(c,"")),M=c=>P(c,T);this.xml=r;const D=[],te=()=>{const c={};for(let E;E=D.pop();){const m=d(E.sliceElement,"slice");c[m]||(re(T,m,E),c[m]=E)}Object.keys(c).length!==0&&V()};let W;this.onSlice=c=>{D.push(c),W||(W=setTimeout(()=>{te(),W=0},1))};const V=this.transform=()=>{if(this.#e)debugger;this.#e=1;const c=()=>{n.map((A,S)=>{const _=A.transformToFragment(r.ownerDocument,document);return _||console.error(`XSLT transformation error. xsl:
95
+ `,q(a[S]),`
96
+ xml:
97
+ `,q(r)),_}).map(A=>{A&&(he(A),fe(this,A.childNodes))});let N=0;return Object.entries(u).map(([A,S])=>{!this.hasAttribute(A)&&S!==d(this,A)&&(this.setAttribute(A,S),this.#t(A,S),N++)}),Object.keys(w).map(A=>{let S=d(this.firstElementChild,A);S!==d(this,A)&&(this.setAttribute(A,S),this.#t(A,S),N++)}),N};c()&&c()&&console.warn("model update should not be the result of transform more than once");function E(m){let N=m;if(m.localName==="slice"){const A=d(m,"for");if(A||(N=m.parentElement),A==="^")do N=N.previousElementSibling;while(N.localName==="slice");else N=this.querySelector(A);if(!N)return console.warn(`can not find selector in "slice for=${A}" `,m.outerHTML);d(m,"slice")||m.setAttribute("slice",d(m,"name"))}return N}j(this,"[slice],[slice-event]",m=>{let N=d(m,"slice-event");const A=m.hasAttribute("slice-value")||m.hasAttribute("value")||m.value,S=E(m);m.dceInitialized||(m.dceInitialized=1,S.hasAttribute("custom-validity")&&(N+=" change submit"),[...new Set((N||"change").split(" "))].forEach(_=>S.addEventListener(_,C=>{C.sliceElement=m,C.sliceEventSource=C.currentTarget||C.target,C.sliceProcessed=0;const xe=re(T,d(C.sliceElement,"slice"),C);j(this,"[custom-validity]",X=>{if(!X.setCustomValidity)return;const Z=d(X,"custom-validity");try{const U=Z&&P(Z,f);X.setCustomValidity(U===!0?"":U===!1?"invalid":U)}catch(U){console.error(U,"xPath",Z)}});const Y=d(S,"custom-validity"),z=Y&&P(Y,f),G=z===!0?"":z;if(Y){if(m.setCustomValidity?m.setCustomValidity(G):m.validationMessage=G,xe.map(X=>X.setAttribute("validation-message",G)),C.type==="submit")return z===!0?void 0:(setTimeout(V,1),!!z===z?(z||C.preventDefault(),z):z?(C.preventDefault(),!1):void 0);setTimeout(V,1)}this.onSlice(C)})),(!N||N.includes("init"))&&(A?this.onSlice({type:"init",target:S,sliceElement:m,sliceEventSource:S}):m.value=M(d(m,"slice"))))}),this.#e=0};V(),te()}#t(i,r){i==="value"&&(this.value=r);const h=this.xml.querySelector("attributes");let y=this.xml.querySelector(`attributes>${i}`);y?F(y).append(L(y,r)):(y=$(i,r,this.xml),h.append(y)),this.#e||h.setAttribute(i,r),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,detail:{[i]:r}}))}attributeChangedCallback(i,r,h){!this.xml||this.#e||(this.#t(i,h),this.transform())}get dce(){return o}}const H=p=>{window.customElements.get(p)!==k&&window.customElements.define(p,k)};if(t)H(t);else{const p=s;this.setAttribute("tag",p),H(p);const i=document.createElement(p);this.getAttributeNames().forEach(r=>i.setAttribute(r,this.getAttribute(r))),i.append(...[...this.childNodes].filter(r=>r.localName!=="style")),this.append(i)}}get templateNode(){return this.firstElementChild?.tagName==="TEMPLATE"?this.firstElementChild.content:this}get dce(){return this}get xslt(){return O(this.xsltString)}}window.customElements.define("custom-element",De);export{pe as a,ne as c,le as m};
@@ -1,4 +1,4 @@
1
- import{w as d,e as a,u as c,f as u}from"./index-CxRwF5Or.js";import"./custom-element-D59Fok1f.js";function p(n){return new Promise(e=>setTimeout(e,n))}function m(n){const{title:e,body:t}=n;return`
1
+ import{w as d,e as a,u as c,f as u}from"./index-Dr4PwNfd.js";import"./custom-element-CPnvJnn8.js";function p(n){return new Promise(e=>setTimeout(e,n))}function m(n){const{title:e,body:t}=n;return`
2
2
  <fieldset>
3
3
  <legend>${e}</legend>
4
4
  ${t}
@@ -0,0 +1,2 @@
1
+ import{B as l}from"./entry-preview-DHVXbf3x.js";import{c as E,g as u,y}from"./index-BwkS7JH_.js";import{i as g}from"./tiny-invariant-CopsF_GD.js";import"./index-DrFu-skq.js";const{global:i}=__STORYBOOK_MODULE_GLOBAL__,{setDefaultProjectAnnotations:V,setProjectAnnotations:K}=__STORYBOOK_MODULE_PREVIEW_API__;var{window:w}=i;w.STORYBOOK_ENV="web-components";function p(e){if(!e)return!1;if(typeof e=="string")return!0;throw new Error('Provided component needs to be a string. e.g. component: "my-element"')}function c(e){if(!e)return!1;if(e.tags&&Array.isArray(e.tags)||e.modules&&Array.isArray(e.modules))return!0;throw new Error(`You need to setup valid meta data in your config.js via setCustomElements().
2
+ See the readme of addon-docs for web components for more details.`)}function d(){return i.__STORYBOOK_CUSTOM_ELEMENTS__||i.__STORYBOOK_CUSTOM_ELEMENTS_MANIFEST__}var{window:S,EventSource:b}=i;typeof module<"u"&&module?.hot?.decline&&(module.hot.decline(),new b("__webpack_hmr").addEventListener("message",function(e){try{let{action:r}=JSON.parse(e.data);r==="built"&&S.location.reload()}catch{}}));const{logger:m}=__STORYBOOK_MODULE_CLIENT_LOGGER__,{useEffect:v,addons:A}=__STORYBOOK_MODULE_PREVIEW_API__;function _(e,r){let t;switch(r){case"attributes":case"properties":t={name:e.type?.text||e.type};break;case"slots":t={name:"string"};break;default:t={name:"void"};break}return{name:e.name,required:!1,description:e.description,type:t,table:{category:r,type:{summary:e.type?.text||e.type},defaultValue:{summary:e.default!==void 0?e.default:e.defaultValue}}}}function D(e){let r=e.name.replace(/(-|_|:|\.|\s)+(.)?/g,(t,n,a)=>a?a.toUpperCase():"").replace(/^([A-Z])/,t=>t.toLowerCase());return r=`on${r.charAt(0).toUpperCase()+r.substr(1)}`,[{name:r,action:{name:e.name},table:{disable:!0}},_(e,"events")]}function o(e,r){return e&&e.filter(t=>t&&t.name).reduce((t,n)=>{if(n.kind==="method")return t;switch(r){case"events":D(n).forEach(a=>{g(a.name),t[a.name]=a});break;default:t[n.name]=_(n,r);break}return t},{})}var C=(e,r)=>{if(!p(e)||!c(r))return null;let t=r.tags.find(n=>n.name.toUpperCase()===e.toUpperCase());return t||m.warn(`Component not found in custom-elements.json: ${e}`),t},h=(e,r)=>{if(!p(e)||!c(r))return null;let t;return r?.modules?.forEach(n=>{n?.declarations?.forEach(a=>{a.tagName===e&&(t=a)})}),t||m.warn(`Component not found in custom-elements.json: ${e}`),t},f=(e,r)=>r?.version==="experimental"?C(e,r):h(e,r),M=(e,r)=>{let t=f(e,r);return t&&{...o(t.members??[],"properties"),...o(t.properties??[],"properties"),...o(t.attributes??[],"attributes"),...o(t.events??[],"events"),...o(t.slots??[],"slots"),...o(t.cssProperties??[],"css custom properties"),...o(t.cssParts??[],"css shadow parts")}},T=e=>{let r=d();return M(e,r)},L=e=>{let r=f(e,d());return r&&r.description},P=/<!--\?lit\$[0-9]+\$-->|<!--\??-->/g;function R(e){let r=e?.parameters.docs?.source,t=e?.parameters.__isArgsStory;return r?.type===u.DYNAMIC?!1:!t||r?.code||r?.type===u.CODE}function I(e,r){let t=e(),n=r?.parameters.docs?.source?.excludeDecorators?r.originalStoryFn(r.args,r):t,a;if(v(()=>{let{id:s,unmappedArgs:O}=r;a&&A.getChannel().emit(y,{id:s,source:a,args:O})}),!R(r)){let s=window.document.createElement("div");n instanceof DocumentFragment?l(n.cloneNode(!0),s):l(n,s),a=s.innerHTML.replace(P,"")}return t}var $=[I],j={docs:{extractArgTypes:T,extractComponentDescription:L,story:{inline:!0},source:{type:u.DYNAMIC,language:"html"}}},N=[E];export{N as argTypesEnhancers,$ as decorators,j as parameters};
@@ -0,0 +1 @@
1
+ const e={},t=[];export{t as __namedExportsOrder,e as default};