@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.
- package/.idea/inspectionProfiles/Project_Default.xml +2 -1
- package/.storybook/main.ts +3 -7
- package/.storybook/preview.ts +4 -6
- package/README.md +4 -4
- package/coverage/coverage-final.json +7 -18
- package/coverage/index.html +30 -30
- package/coverage/src/custom-element/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js.html +719 -473
- package/coverage/src/custom-element/http-request.js/coverage.svg +1 -1
- package/coverage/src/custom-element/http-request.js.html +6 -6
- package/coverage/src/custom-element/index.html +29 -29
- package/coverage/src/custom-element/local-storage.js.html +1 -1
- package/coverage/src/custom-element/location-element.js.html +31 -31
- package/coverage/src/custom-element/module-url.js/coverage.svg +1 -1
- package/coverage/src/custom-element/module-url.js.html +20 -20
- package/coverage/src/index.html +1 -1
- package/coverage/src/mocks/handlers.ts.html +1 -1
- package/coverage/src/mocks/index.html +1 -1
- package/coverage/src/stories/coverage.svg +1 -1
- package/coverage/src/stories/{attributes.test.stories.ts → frame.canvas.ts}/coverage.svg +1 -1
- package/coverage/src/stories/frame.canvas.ts.html +175 -0
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +14 -179
- package/coverage/src/stories/testStoryBook.ts.html +8 -8
- package/coverage/src/sum.ts.html +1 -1
- package/dist/custom-element-6slVaFEs.cjs +97 -0
- package/dist/custom-element-WnOqmEOe.js +609 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +30 -28
- package/dist/demo/a.html +51 -38
- package/dist/demo/attributes.html +153 -0
- package/dist/demo/data-slices.html +2 -2
- package/dist/demo/external-template.html +1 -0
- package/dist/demo/external-templates-sb-6.html +42 -0
- package/dist/demo/external-templates-sb-7.html +42 -0
- package/dist/demo/form.html +42 -0
- package/dist/demo/hex-grid-dce.html +1 -1
- package/dist/demo/hex-grid.html +1 -1
- package/dist/demo/html-template.html +1 -1
- package/dist/demo/module-url-sb-2.html +46 -0
- package/dist/demo/module-url-sb-4.html +48 -0
- package/dist/demo/module-url-sb-5.html +53 -0
- package/dist/demo/parameters.html +20 -1
- package/dist/demo/s.xml +66 -9
- package/dist/demo/s.xslt +89 -16
- package/dist/demo/ss.html +12 -22
- package/dist/mockServiceWorker.js +31 -8
- package/package.json +25 -26
- package/public/demo/a.html +51 -38
- package/public/demo/attributes.html +153 -0
- package/public/demo/data-slices.html +2 -2
- package/public/demo/external-template.html +1 -0
- package/public/demo/external-templates-sb-6.html +42 -0
- package/public/demo/external-templates-sb-7.html +42 -0
- package/public/demo/form.html +42 -0
- package/public/demo/hex-grid-dce.html +1 -1
- package/public/demo/hex-grid.html +1 -1
- package/public/demo/html-template.html +1 -1
- package/public/demo/module-url-sb-2.html +46 -0
- package/public/demo/module-url-sb-4.html +48 -0
- package/public/demo/module-url-sb-5.html +53 -0
- package/public/demo/parameters.html +20 -1
- package/public/demo/s.xml +66 -9
- package/public/demo/s.xslt +89 -16
- package/public/demo/ss.html +12 -22
- package/public/mockServiceWorker.js +31 -8
- package/src/custom-element/custom-element.d.ts +4 -0
- package/src/custom-element/custom-element.js +148 -66
- package/src/custom-element/demo/a.html +51 -38
- package/src/custom-element/demo/attributes.html +153 -0
- package/src/custom-element/demo/data-slices.html +2 -2
- package/src/custom-element/demo/external-template.html +1 -0
- package/src/custom-element/demo/form.html +42 -0
- package/src/custom-element/demo/hex-grid-dce.html +1 -1
- package/src/custom-element/demo/hex-grid.html +1 -1
- package/src/custom-element/demo/html-template.html +1 -1
- package/src/custom-element/demo/parameters.html +20 -1
- package/src/custom-element/demo/s.xml +66 -9
- package/src/custom-element/demo/s.xslt +89 -16
- package/src/custom-element/demo/ss.html +12 -22
- package/src/custom-element/ide/web-types-dce.json +1 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/custom-element/index.html +1 -1
- package/src/material/components/badge.html +240 -0
- package/src/material/components/dropdown.html +26 -14
- package/src/material/components/icon-link.html +1 -0
- package/src/material/components/icon.html +253 -0
- package/src/material/components/input.html +571 -0
- package/src/material/components/menu.html +7 -5
- package/src/material/components.html +48 -11
- package/src/material/theme/semantic.css +20 -1
- package/src/mocks/versions.mock.ts +1 -1
- package/src/stories/__screenshots__/attributes.test.stories.ts +1 -0
- package/src/stories/__screenshots__/external-template.test.stories.ts +1 -0
- package/src/stories/__screenshots__/module-url.test.stories.ts +1 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-definition-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Attributes-runtime-change-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-Instance-Attributes-2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-cloneAs-el-newTag--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mergeAttr--from--to---3.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/attributes-mix-to-from--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-definition-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Attributes-runtime-change-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-Instance-Attributes-2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-cloneAs-el-newTag--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-headers-and-response-status-and-headers-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-delayed--5-seconds-response-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-http-request-with-error-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---2.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mergeAttr--from--to---3.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-mix-to-from--1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-url-and-slice-1.png +0 -0
- package/src/stories/__screenshots__/stories.test.ts/http-request-url-change-1.png +0 -0
- package/src/stories/attributes.test.stories.ts +177 -11
- package/src/stories/external-template.test.stories.ts +17 -15
- package/src/stories/frame.canvas.ts +31 -0
- package/src/stories/module-url.test.stories.ts +29 -61
- package/storybook-static/assets/Color-F6OSRLHC-Cbp293x2.js +1 -0
- package/storybook-static/assets/Configure-BrFr4SLE.js +165 -0
- package/storybook-static/assets/DocsRenderer-CFRXHY34-DhHzJiIO.js +2 -0
- package/storybook-static/assets/attributes.test.stories-CzWkKw0e.js +1 -0
- package/storybook-static/assets/attributes.test.stories-Gg9LQTEK.js +349 -0
- package/storybook-static/assets/{css.test.stories-Cgn6ICr0.js → css.test.stories-B_3ltOrx.js} +1 -1
- package/storybook-static/assets/custom-element-CPnvJnn8.js +97 -0
- package/storybook-static/assets/{dom-merge.test.stories-CBObfPWg.js → dom-merge.test.stories-nQxcgLoM.js} +1 -1
- package/storybook-static/assets/entry-preview-docs-Dwczwtsc.js +2 -0
- package/storybook-static/assets/external-template.test.stories-BivZqBTp.js +1 -0
- package/storybook-static/assets/{external-template.test.stories-VfKUQ8eu.js → external-template.test.stories-DZ-rjnfd.js} +39 -41
- package/storybook-static/assets/{form.test.stories-CnuGN7Zw.js → form.test.stories-DQhPYtMj.js} +1 -1
- package/storybook-static/assets/frame.canvas-ClTqYyMN.js +1 -0
- package/storybook-static/assets/{handlers-V_T7WjNK.js → handlers-CLkps6Nz.js} +17 -14
- package/storybook-static/assets/{http-request.stories-8NN1Coqm.js → http-request.stories-jo0f73nw.js} +1 -1
- package/storybook-static/assets/iframe-CZwRpnn9.js +199 -0
- package/storybook-static/assets/index-B68YUdzy.js +621 -0
- package/storybook-static/assets/index-BwkS7JH_.js +8 -0
- package/storybook-static/assets/index-CJQtnF9V.js +1 -0
- package/storybook-static/assets/index-Dr4PwNfd.js +240 -0
- package/storybook-static/assets/{local-storage.test.stories-Dk5Yqc7m.js → local-storage.test.stories-uA5EKRPf.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-56um6s5L.js → location-element.test.stories-Cu-6Elcg.js} +1 -1
- package/storybook-static/assets/module-url.test.stories-CD_wusXQ.js +142 -0
- package/storybook-static/assets/module-url.test.stories-CTjUAk3J.js +1 -0
- package/storybook-static/assets/preview-1xJJ3sKE.js +1 -0
- package/storybook-static/assets/preview-BFlNN3Wj.js +1 -0
- package/storybook-static/assets/preview-CTOeX_lO.js +1 -0
- package/storybook-static/assets/preview-Cm4PPhHS.js +50 -0
- package/storybook-static/assets/preview-CuCH40jj.js +2 -0
- package/storybook-static/assets/preview-DfTudP20.js +1 -0
- package/storybook-static/assets/{set-url.test.stories-B4E6hIe-.js → set-url.test.stories-CY7B9BVZ.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-BR0F-B6I.js → slice-events.test.stories-BVnPXm6e.js} +1 -1
- package/storybook-static/assets/{slots.test.stories-CgfJIyCr.js → slots.test.stories-Dxsa9KdA.js} +1 -1
- package/storybook-static/assets/{version-select.test.stories-nmxATIwv.js → version-select.test.stories-Buga1PAa.js} +1 -1
- package/storybook-static/demo/a.html +51 -38
- package/storybook-static/demo/attributes.html +153 -0
- package/storybook-static/demo/data-slices.html +2 -2
- package/storybook-static/demo/external-template.html +1 -0
- package/storybook-static/demo/external-templates-sb-6.html +42 -0
- package/storybook-static/demo/external-templates-sb-7.html +42 -0
- package/storybook-static/demo/form.html +42 -0
- package/storybook-static/demo/hex-grid-dce.html +1 -1
- package/storybook-static/demo/hex-grid.html +1 -1
- package/storybook-static/demo/html-template.html +1 -1
- package/storybook-static/demo/module-url-sb-2.html +46 -0
- package/storybook-static/demo/module-url-sb-4.html +48 -0
- package/storybook-static/demo/module-url-sb-5.html +53 -0
- package/storybook-static/demo/parameters.html +20 -1
- package/storybook-static/demo/s.xml +66 -9
- package/storybook-static/demo/s.xslt +89 -16
- package/storybook-static/demo/ss.html +12 -22
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.html +6 -10
- package/storybook-static/index.json +1 -1
- package/storybook-static/mockServiceWorker.js +31 -8
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/essentials-actions-2/manager-bundle.js +3 -0
- package/storybook-static/sb-addons/essentials-backgrounds-4/manager-bundle.js +8 -8
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +391 -0
- package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +230 -0
- package/storybook-static/sb-addons/essentials-measure-7/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-outline-8/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-toolbars-6/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/interactions-9/manager-bundle.js +58 -58
- package/storybook-static/sb-manager/globals-module-info.js +9 -0
- package/storybook-static/sb-manager/globals-runtime.js +10719 -10473
- package/storybook-static/sb-manager/runtime.js +4944 -6321
- package/coverage/src/stories/attributes.test.stories.ts.html +0 -514
- package/coverage/src/stories/css.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/css.test.stories.ts.html +0 -460
- package/coverage/src/stories/dom-merge.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/dom-merge.test.stories.ts.html +0 -706
- package/coverage/src/stories/external-template.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/external-template.test.stories.ts.html +0 -865
- package/coverage/src/stories/form.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/form.test.stories.ts.html +0 -661
- package/coverage/src/stories/local-storage.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/local-storage.test.stories.ts.html +0 -1315
- package/coverage/src/stories/location-element.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/location-element.test.stories.ts.html +0 -523
- package/coverage/src/stories/module-url.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/module-url.test.stories.ts.html +0 -640
- package/coverage/src/stories/set-url.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/set-url.test.stories.ts.html +0 -433
- package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/slice-events.test.stories.ts.html +0 -952
- package/coverage/src/stories/slots.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/slots.test.stories.ts.html +0 -742
- package/coverage/src/stories/version-select.test.stories.ts/coverage.svg +0 -10
- package/coverage/src/stories/version-select.test.stories.ts.html +0 -397
- package/dist/custom-element-BbJMY20-.cjs +0 -97
- package/dist/custom-element-CoRNKeEP.js +0 -567
- package/storybook-static/assets/Color-F6OSRLHC-CFyd3TND.js +0 -1
- package/storybook-static/assets/Configure-UGTbPRKK.js +0 -165
- package/storybook-static/assets/DocsRenderer-CFRXHY34-Dpr5iB0o.js +0 -2
- package/storybook-static/assets/attributes.test.stories-DSOLHHOW.js +0 -152
- package/storybook-static/assets/custom-element-D59Fok1f.js +0 -97
- package/storybook-static/assets/entry-preview-docs-BbcIMweR.js +0 -2
- package/storybook-static/assets/iframe-DnhkgdtG.js +0 -2
- package/storybook-static/assets/index-3Sfy-t3H.js +0 -769
- package/storybook-static/assets/index-BcZLpTeD.js +0 -8
- package/storybook-static/assets/index-CIBI7sCB.js +0 -1
- package/storybook-static/assets/index-CxRwF5Or.js +0 -234
- package/storybook-static/assets/index-D-8MO0q_.js +0 -1
- package/storybook-static/assets/index-DN1RoK17.js +0 -1
- package/storybook-static/assets/index-DjJD7gkO.js +0 -1
- package/storybook-static/assets/module-url.test.stories-DEponQ7l.js +0 -208
- package/storybook-static/assets/preview-BhhEZcNS.js +0 -1
- package/storybook-static/assets/preview-CNKoaWES.js +0 -1
- package/storybook-static/assets/preview-Czc-sw5H.js +0 -2
- package/storybook-static/assets/preview-DAeyCMnM.js +0 -1
- package/storybook-static/assets/preview-DHPc-V4N.js +0 -1
- package/storybook-static/assets/preview-DYzi3Z2p.js +0 -1
- package/storybook-static/assets/preview-vbpHsp94.js +0 -52
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js +0 -333
- package/storybook-static/sb-addons/chromatic-com-storybook-10/manager-bundle.js.LEGAL.txt +0 -40
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +0 -3
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +0 -391
- package/storybook-static/sb-addons/links-1/manager-bundle.js +0 -3
- package/storybook-static/sb-preview/globals.js +0 -33
- package/storybook-static/sb-preview/runtime.js +0 -7174
- package/test-runner-jest.config.js +0 -15
- /package/storybook-static/sb-addons/{essentials-actions-3 → essentials-actions-2}/manager-bundle.js.LEGAL.txt +0 -0
- /package/storybook-static/sb-addons/{essentials-controls-2 → essentials-controls-1}/manager-bundle.js.LEGAL.txt +0 -0
- /package/storybook-static/sb-addons/{links-1 → essentials-docs-3}/manager-bundle.js.LEGAL.txt +0 -0
|
@@ -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) > 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/*) > 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
|
+
• <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
|
|
237
|
-
description="The value
|
|
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>
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
<!--
|
|
6
|
+
|
|
7
|
+
This page is part of src/stories/module-url.test.stories.ts, test #2
|
|
8
|
+
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
14
|
+
<title>importmap custom-element Declarative Custom Element implementation demo</title>
|
|
15
|
+
<link rel="icon" href="./wc-square.svg"/>
|
|
16
|
+
<style>
|
|
17
|
+
dce-root {
|
|
18
|
+
box-shadow: 0 0 0.5rem lime;
|
|
19
|
+
padding: 1rem;
|
|
20
|
+
display: inline-block;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
<script type="importmap">
|
|
24
|
+
{
|
|
25
|
+
"imports": {
|
|
26
|
+
"lib-root/": "./lib-dir/",
|
|
27
|
+
"embed-lib": "./lib-dir/embed-lib.html"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
<script type="module" src="../src/custom-element/location-element.js"></script>
|
|
32
|
+
<script type="module" src="../src/custom-element/module-url.js"></script>
|
|
33
|
+
<script type="module" src="../src/custom-element/custom-element.js"></script>
|
|
34
|
+
</head>
|
|
35
|
+
<body>
|
|
36
|
+
<p>Should render formula</p>
|
|
37
|
+
<custom-element src="./html-template.html#sophomores-dream">
|
|
38
|
+
<template><i>loading MathML from HTML file ...</i></template>
|
|
39
|
+
</custom-element>
|
|
40
|
+
|
|
41
|
+
</body>
|
|
42
|
+
</html>
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
<!--
|
|
6
|
+
|
|
7
|
+
This page is part of src/stories/module-url.test.stories.ts, test #2
|
|
8
|
+
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
14
|
+
<title>importmap custom-element Declarative Custom Element implementation demo</title>
|
|
15
|
+
<link rel="icon" href="./wc-square.svg"/>
|
|
16
|
+
<style>
|
|
17
|
+
dce-root {
|
|
18
|
+
box-shadow: 0 0 0.5rem lime;
|
|
19
|
+
padding: 1rem;
|
|
20
|
+
display: inline-block;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
<script type="importmap">
|
|
24
|
+
{
|
|
25
|
+
"imports": {
|
|
26
|
+
"lib-root/": "./lib-dir/",
|
|
27
|
+
"embed-lib": "./lib-dir/embed-lib.html"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
<script type="module" src="../src/custom-element/location-element.js"></script>
|
|
32
|
+
<script type="module" src="../src/custom-element/module-url.js"></script>
|
|
33
|
+
<script type="module" src="../src/custom-element/custom-element.js"></script>
|
|
34
|
+
</head>
|
|
35
|
+
<body>
|
|
36
|
+
<p>Should render tree</p>
|
|
37
|
+
<custom-element src="./html-template.xhtml#embedded-xsl">
|
|
38
|
+
<template>whole XSLT is embedded into HTML body</template>
|
|
39
|
+
</custom-element>
|
|
40
|
+
|
|
41
|
+
</body>
|
|
42
|
+
</html>
|
|
@@ -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://
|
|
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/
|
|
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>
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
<!--
|
|
6
|
+
|
|
7
|
+
This page is part of src/stories/module-url.test.stories.ts, test #2
|
|
8
|
+
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
14
|
+
<title>importmap custom-element Declarative Custom Element implementation demo</title>
|
|
15
|
+
<link rel="icon" href="./wc-square.svg"/>
|
|
16
|
+
<script type="importmap">
|
|
17
|
+
{
|
|
18
|
+
"imports": {
|
|
19
|
+
"lib-root/": "./lib-dir/",
|
|
20
|
+
"embed-lib": "./lib-dir/embed-lib.html"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
<script type="module" src="../src/custom-element/location-element.js"></script>
|
|
25
|
+
<script type="module" src="../src/custom-element/module-url.js"></script>
|
|
26
|
+
<script type="module" src="../src/custom-element/custom-element.js"></script>
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<p><code>embed-lib</code> resolved to <code>./lib-dir/embed-lib.html</code> by page <i>importmap</i></p>
|
|
30
|
+
<custom-element>
|
|
31
|
+
<template>
|
|
32
|
+
<module-url slice="lib-url" src="embed-lib"></module-url>
|
|
33
|
+
<if test="//lib-url/@error">
|
|
34
|
+
<p>error: <b>{//lib-url/@error}</b></p>
|
|
35
|
+
</if>
|
|
36
|
+
<span data-testid="check">check the link:</span>
|
|
37
|
+
<a href="{//lib-url}">
|
|
38
|
+
<custom-element src="embed-lib#embed-lib-component">
|
|
39
|
+
failed to load
|
|
40
|
+
</custom-element>
|
|
41
|
+
</a>
|
|
42
|
+
</template>
|
|
43
|
+
</custom-element>
|
|
44
|
+
|
|
45
|
+
</body>
|
|
46
|
+
</html>
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
<!--
|
|
6
|
+
|
|
7
|
+
This page is part of src/stories/module-url.test.stories.ts, test #2
|
|
8
|
+
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
14
|
+
<title>importmap custom-element Declarative Custom Element implementation demo</title>
|
|
15
|
+
<link rel="icon" href="./wc-square.svg"/>
|
|
16
|
+
<script type="importmap">
|
|
17
|
+
{
|
|
18
|
+
"imports": {
|
|
19
|
+
"lib-root/": "./lib-dir/",
|
|
20
|
+
"embed-lib": "./lib-dir/embed-lib.html"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
<script type="module" src="../src/custom-element/location-element.js"></script>
|
|
25
|
+
<script type="module" src="../src/custom-element/module-url.js"></script>
|
|
26
|
+
<script type="module" src="../src/custom-element/custom-element.js"></script>
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<p><code>lib-root</code> resolved to <code>lib-dir</code> by page <i>importmap</i></p>
|
|
30
|
+
|
|
31
|
+
<custom-element>
|
|
32
|
+
<template>
|
|
33
|
+
<module-url slice="lib-url" src="lib-root/embed-lib.html#embed-relative-hash"></module-url>
|
|
34
|
+
<module-url slice="img-url" src="lib-root/Smiley.svg"></module-url>
|
|
35
|
+
<if test="//lib-url/@error">
|
|
36
|
+
<p>error: <b>{//lib-url/@error}</b></p>
|
|
37
|
+
</if>
|
|
38
|
+
check the link:
|
|
39
|
+
<a href="{//lib-url}"> lib-root/embed-lib.html#embed-relative-hash <img src="{//img-url}" alt=""/></a>
|
|
40
|
+
<custom-element src="lib-root/embed-lib.html#embed-relative-hash">
|
|
41
|
+
failed to load
|
|
42
|
+
</custom-element>
|
|
43
|
+
|
|
44
|
+
</template>
|
|
45
|
+
</custom-element>
|
|
46
|
+
|
|
47
|
+
</body>
|
|
48
|
+
</html>
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
<!--
|
|
6
|
+
|
|
7
|
+
This page is part of src/stories/module-url.test.stories.ts, test #2
|
|
8
|
+
|
|
9
|
+
-->
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
14
|
+
<title>importmap custom-element Declarative Custom Element implementation demo</title>
|
|
15
|
+
<link rel="icon" href="./wc-square.svg"/>
|
|
16
|
+
<style>
|
|
17
|
+
dce-root {
|
|
18
|
+
box-shadow: 0 0 0.5rem lime;
|
|
19
|
+
padding: 1rem;
|
|
20
|
+
display: inline-block;
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
23
|
+
<script type="importmap">
|
|
24
|
+
{
|
|
25
|
+
"imports": {
|
|
26
|
+
"lib-root/": "./lib-dir/",
|
|
27
|
+
"embed-lib": "./lib-dir/embed-lib.html"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
<script type="module" src="../src/custom-element/location-element.js"></script>
|
|
32
|
+
<script type="module" src="../src/custom-element/module-url.js"></script>
|
|
33
|
+
<script type="module" src="../src/custom-element/custom-element.js"></script>
|
|
34
|
+
</head>
|
|
35
|
+
<body>
|
|
36
|
+
<p>should render '👍 from embed-relative-file' and Vulcan Salute 🖖. Links should open matching page
|
|
37
|
+
</p>
|
|
38
|
+
<custom-element>
|
|
39
|
+
<template>
|
|
40
|
+
<module-url slice="lib-url" src="lib-root/embed-lib.html#embed-relative-file"></module-url>
|
|
41
|
+
<if test="//lib-url/@error">
|
|
42
|
+
<p>error: <b>{//lib-url/@error}</b></p>
|
|
43
|
+
</if>
|
|
44
|
+
check the link:
|
|
45
|
+
<a href="{//lib-url}"> lib-root/embed-lib.html#embed-relative-file </a>
|
|
46
|
+
<custom-element src="lib-root/embed-lib.html#embed-relative-file">
|
|
47
|
+
failed to load
|
|
48
|
+
</custom-element>
|
|
49
|
+
</template>
|
|
50
|
+
</custom-element>
|
|
51
|
+
|
|
52
|
+
</body>
|
|
53
|
+
</html>
|
|
@@ -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="
|
|
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
|
+
• <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
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
<
|
|
11
|
-
<
|
|
12
|
-
<
|
|
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>
|
|
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>
|