@epa-wg/custom-element-dist 0.0.24 → 0.0.26
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/.storybook/main.ts +19 -21
- package/.storybook/preview-head.html +8 -0
- package/.storybook/preview.ts +13 -5
- package/README.md +4 -4
- package/bin/postinstall.sh +3 -2
- package/bin/vitest/vitest-browser-importmaps.mjs +20 -0
- package/coverage/coverage-final.json +13 -8
- package/coverage/index.html +51 -36
- 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 +493 -406
- package/coverage/src/custom-element/demo/coverage.svg +10 -0
- package/coverage/src/custom-element/demo/index.html +116 -0
- package/coverage/src/custom-element/demo/z.js/coverage.svg +10 -0
- package/coverage/src/custom-element/demo/z.js.html +112 -0
- package/coverage/src/custom-element/http-request.js.html +12 -12
- package/coverage/src/custom-element/index.html +37 -22
- package/coverage/src/custom-element/local-storage.js.html +1 -1
- package/coverage/src/custom-element/location-element.js/coverage.svg +1 -1
- package/coverage/src/custom-element/location-element.js.html +116 -47
- package/coverage/src/custom-element/module-url.js/coverage.svg +10 -0
- package/coverage/src/custom-element/module-url.js.html +181 -0
- package/coverage/src/index.html +1 -1
- package/coverage/src/mocks/coverage.svg +1 -1
- package/coverage/src/mocks/handlers.ts/coverage.svg +1 -1
- package/coverage/src/mocks/handlers.ts.html +36 -12
- package/coverage/src/mocks/index.html +19 -19
- package/coverage/src/stories/attributes.test.stories.ts.html +6 -9
- package/coverage/src/stories/coverage.svg +1 -1
- package/coverage/src/stories/css.test.stories.ts.html +1 -1
- package/coverage/src/stories/dom-merge.test.stories.ts.html +1 -1
- package/coverage/src/stories/external-template.test.stories.ts.html +22 -10
- package/coverage/src/stories/form.test.stories.ts.html +1 -1
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +58 -13
- package/coverage/src/stories/local-storage.test.stories.ts.html +1 -1
- package/coverage/src/stories/location-element.test.stories.ts.html +1 -1
- package/coverage/src/stories/module-url.test.stories.ts/coverage.svg +10 -0
- package/coverage/src/stories/module-url.test.stories.ts.html +634 -0
- package/coverage/src/stories/set-url.test.stories.ts/coverage.svg +10 -0
- package/coverage/src/stories/set-url.test.stories.ts.html +427 -0
- package/coverage/src/stories/slice-events.test.stories.ts.html +1 -1
- package/coverage/src/stories/slots.test.stories.ts.html +1 -1
- package/coverage/src/stories/testStoryBook.ts.html +12 -12
- package/coverage/src/stories/version-select.test.stories.ts/coverage.svg +10 -0
- package/coverage/src/stories/version-select.test.stories.ts.html +391 -0
- package/coverage/src/sum.ts.html +1 -1
- package/dist/confused.svg +1 -0
- package/dist/custom-element-CckoVsvO.cjs +53 -0
- package/dist/custom-element-b7c_7Kz4.js +485 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +3 -3
- package/dist/demo/a.html +60 -0
- package/dist/demo/b.html +13 -0
- package/dist/demo/confused.svg +38 -0
- package/dist/demo/data-slices.html +216 -0
- package/dist/demo/dce-social-preview.png +0 -0
- package/dist/demo/demo.css +26 -0
- package/dist/demo/dom-merge.html +123 -0
- package/dist/demo/embed-1.html +2 -0
- package/dist/demo/external-template.html +239 -0
- package/dist/demo/form.html +239 -0
- package/dist/demo/hex-grid-dce.html +183 -0
- package/dist/demo/hex-grid-transform.png +0 -0
- package/dist/demo/hex-grid.html +66 -0
- package/dist/demo/html-template.html +126 -0
- package/dist/demo/html-template.xhtml +45 -0
- package/dist/demo/html-template.xml +45 -0
- package/dist/demo/http-request.html +143 -0
- package/dist/demo/lib-dir/Smiley.svg +24 -0
- package/dist/demo/lib-dir/embed-lib.html +34 -0
- package/dist/demo/local-storage.html +218 -0
- package/dist/demo/location-element.html +168 -0
- package/dist/demo/logo.png +0 -0
- package/dist/demo/module-url.html +215 -0
- package/dist/demo/npm-versions-demo.html +105 -0
- package/dist/demo/npm-versions.html +65 -0
- package/dist/demo/parameters.html +70 -0
- package/dist/demo/s.xml +28 -0
- package/dist/demo/s.xslt +97 -0
- package/dist/demo/s1.xslt +60 -0
- package/dist/demo/scoped-css.html +169 -0
- package/dist/demo/set-url.html +141 -0
- package/dist/demo/ss.html +57 -0
- package/dist/demo/table.xml +25 -0
- package/dist/demo/table.xsl +293 -0
- package/dist/demo/template.xsl +46 -0
- package/dist/demo/tree.xml +25 -0
- package/dist/demo/tree.xsl +33 -0
- package/dist/demo/wc-square.svg +1 -0
- package/dist/demo/xhtml-template.xhtml +45 -0
- package/dist/demo/z.html +62 -0
- package/dist/demo/z.js +9 -0
- package/dist/demo/z.xml +60 -0
- package/dist/embed-1.html +1 -2
- package/dist/location-element-DRB7hCwA.cjs +1 -0
- package/dist/location-element-FJlONi2n.js +65 -0
- package/dist/mockServiceWorker.js +1 -1
- package/package.json +93 -93
- package/public/confused.svg +1 -0
- package/public/demo/a.html +60 -0
- package/public/demo/b.html +13 -0
- package/public/demo/confused.svg +38 -0
- package/public/demo/data-slices.html +216 -0
- package/public/demo/dce-social-preview.png +0 -0
- package/public/demo/demo.css +26 -0
- package/public/demo/dom-merge.html +123 -0
- package/public/demo/embed-1.html +2 -0
- package/public/demo/external-template.html +239 -0
- package/public/demo/form.html +239 -0
- package/public/demo/hex-grid-dce.html +183 -0
- package/public/demo/hex-grid-transform.png +0 -0
- package/public/demo/hex-grid.html +66 -0
- package/public/demo/html-template.html +126 -0
- package/public/demo/html-template.xhtml +45 -0
- package/public/demo/html-template.xml +45 -0
- package/public/demo/http-request.html +143 -0
- package/public/demo/lib-dir/Smiley.svg +24 -0
- package/public/demo/lib-dir/embed-lib.html +34 -0
- package/public/demo/local-storage.html +218 -0
- package/public/demo/location-element.html +168 -0
- package/public/demo/logo.png +0 -0
- package/public/demo/module-url.html +215 -0
- package/public/demo/npm-versions-demo.html +105 -0
- package/public/demo/npm-versions.html +65 -0
- package/public/demo/parameters.html +70 -0
- package/public/demo/s.xml +28 -0
- package/public/demo/s.xslt +97 -0
- package/public/demo/s1.xslt +60 -0
- package/public/demo/scoped-css.html +169 -0
- package/public/demo/set-url.html +141 -0
- package/public/demo/ss.html +57 -0
- package/public/demo/table.xml +25 -0
- package/public/demo/table.xsl +293 -0
- package/public/demo/template.xsl +46 -0
- package/public/demo/tree.xml +25 -0
- package/public/demo/tree.xsl +33 -0
- package/public/demo/wc-square.svg +1 -0
- package/public/demo/xhtml-template.xhtml +45 -0
- package/public/demo/z.html +62 -0
- package/public/demo/z.js +9 -0
- package/public/demo/z.xml +60 -0
- package/public/embed-1.html +1 -2
- package/public/mockServiceWorker.js +1 -1
- package/src/custom-element/custom-element.js +52 -23
- package/src/custom-element/demo/confused.svg +1 -0
- package/src/custom-element/demo/demo.css +5 -1
- package/src/custom-element/demo/embed-1.html +1 -2
- package/src/custom-element/demo/external-template.html +122 -62
- package/src/custom-element/demo/lib-dir/Smiley.svg +24 -0
- package/src/custom-element/demo/lib-dir/embed-lib.html +34 -0
- package/src/custom-element/demo/location-element.html +17 -4
- package/src/custom-element/demo/module-url.html +215 -0
- package/src/custom-element/demo/npm-versions-demo.html +105 -0
- package/src/custom-element/demo/npm-versions.html +65 -0
- package/src/custom-element/demo/s.xml +27 -10
- package/src/custom-element/demo/s.xslt +96 -59
- package/src/custom-element/demo/set-url.html +141 -0
- package/src/custom-element/demo/z.js +9 -0
- package/src/custom-element/ide/customData-dce.json +215 -125
- package/src/custom-element/ide/web-types-dce.json +184 -116
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/custom-element/index.html +3 -1
- package/src/custom-element/location-element.js +25 -2
- package/src/custom-element/module-url.js +33 -0
- package/src/custom-element.test.ts +26 -26
- package/src/mocks/handlers.ts +10 -1
- package/src/mocks/versions.mock.ts +786 -0
- package/src/stories/attributes.test.stories.ts +0 -1
- package/src/stories/external-template.test.stories.ts +11 -7
- package/src/stories/module-url.test.stories.ts +183 -0
- package/src/stories/set-url.test.stories.ts +114 -0
- package/src/stories/version-select.test.stories.ts +102 -0
- package/storybook-static/assets/Color-KGDBMAHA-CH-YyWYq.js +1 -0
- package/storybook-static/assets/{Configure-CyLVkwlf.js → Configure-DFL_bm2M.js} +2 -2
- package/storybook-static/assets/DocsRenderer-PKQXORMH-Bz-_1hmS.js +2 -0
- package/storybook-static/assets/{attributes.test.stories-BckCcyrF.js → attributes.test.stories-DIQXccHc.js} +2 -3
- package/storybook-static/assets/{css.test.stories-B-QcObCF.js → css.test.stories-BV2hi4CY.js} +1 -1
- package/storybook-static/assets/custom-element-wn23PUwN.js +231 -0
- package/storybook-static/assets/{dom-merge.test.stories-CjXhjTQY.js → dom-merge.test.stories-Dws0C2-g.js} +1 -1
- package/storybook-static/assets/{entry-preview-DrgzXgwT.js → entry-preview-BKQ8UCxI.js} +1 -1
- package/storybook-static/assets/{entry-preview-docs-Bxv0qQWs.js → entry-preview-docs-BMKNVQXA.js} +2 -2
- package/storybook-static/assets/{external-template.test.stories-BBqyi0az.js → external-template.test.stories-BHO48b0j.js} +19 -16
- package/storybook-static/assets/{form.test.stories-DsIo1B4n.js → form.test.stories-dv9mwp24.js} +1 -1
- package/storybook-static/assets/handlers-CaCq2ZPF.js +467 -0
- package/storybook-static/assets/http-request-DNq59pnj.js +1 -0
- package/storybook-static/assets/http-request.stories-B2ke7LtS.js +281 -0
- package/storybook-static/assets/iframe-D4Sos1HO.js +2 -0
- package/storybook-static/assets/index-BnXBQqj9.js +605 -0
- package/storybook-static/assets/index-C8k3Z-3Y.js +28 -0
- package/storybook-static/assets/index-Cpxqn5iQ.js +1 -0
- package/storybook-static/assets/{index-DXimoRZY.js → index-D-8MO0q_.js} +1 -1
- package/storybook-static/assets/index-DGdNYaqV.js +8 -0
- package/storybook-static/assets/index-Dz4OaB2k.js +1 -0
- package/storybook-static/assets/index-sm7QlJZE.js +1 -0
- package/storybook-static/assets/lit-element-DzhCn-8W.js +19 -0
- package/storybook-static/assets/{local-storage.test.stories-Cs2v3QTS.js → local-storage.test.stories-BpogLNq-.js} +1 -1
- package/storybook-static/assets/location-element-hKpcXCdn.js +1 -0
- package/storybook-static/assets/{location-element.test.stories-WkrQDzJJ.js → location-element.test.stories-BiFvBop7.js} +9 -9
- package/storybook-static/assets/module-url.test.stories-BXoM34tX.js +208 -0
- package/storybook-static/assets/{preview-BKCN0mOr.js → preview-0Jj89qip.js} +1 -1
- package/storybook-static/assets/{preview-TCN6m6T-.js → preview-BJPLiuSt.js} +1 -1
- package/storybook-static/assets/{preview-BDY5ThwJ.js → preview-BMWqy4Bi.js} +1 -1
- package/storybook-static/assets/preview-BnWGZYux.js +1 -0
- package/storybook-static/assets/preview-Cg7hXPRq.js +2 -0
- package/storybook-static/assets/{preview-BAz7FMXc.js → preview-DB9FwMii.js} +1 -1
- package/storybook-static/assets/preview-Djh1_Tal.js +20 -0
- package/storybook-static/assets/{preview-DRnyIGXK.js → preview-oHxXRSIu.js} +15 -15
- package/storybook-static/assets/set-url.test.stories-Cg5Z0r7x.js +81 -0
- package/storybook-static/assets/{slice-events.test.stories-BRBBc0JT.js → slice-events.test.stories-D_ttGp3g.js} +1 -1
- package/storybook-static/assets/{slots.test.stories-r-i91k3y.js → slots.test.stories-DBNXOm0T.js} +1 -1
- package/storybook-static/assets/version-select.test.stories-CgV3UCim.js +109 -0
- package/storybook-static/confused.svg +1 -0
- package/storybook-static/demo/a.html +60 -0
- package/storybook-static/demo/b.html +13 -0
- package/storybook-static/demo/confused.svg +38 -0
- package/storybook-static/demo/data-slices.html +216 -0
- package/storybook-static/demo/dce-social-preview.png +0 -0
- package/storybook-static/demo/demo.css +26 -0
- package/storybook-static/demo/dom-merge.html +123 -0
- package/storybook-static/demo/embed-1.html +2 -0
- package/storybook-static/demo/external-template.html +239 -0
- package/storybook-static/demo/form.html +239 -0
- package/storybook-static/demo/hex-grid-dce.html +183 -0
- package/storybook-static/demo/hex-grid-transform.png +0 -0
- package/storybook-static/demo/hex-grid.html +66 -0
- package/storybook-static/demo/html-template.html +126 -0
- package/storybook-static/demo/html-template.xhtml +45 -0
- package/storybook-static/demo/html-template.xml +45 -0
- package/storybook-static/demo/http-request.html +143 -0
- package/storybook-static/demo/lib-dir/Smiley.svg +24 -0
- package/storybook-static/demo/lib-dir/embed-lib.html +34 -0
- package/storybook-static/demo/local-storage.html +218 -0
- package/storybook-static/demo/location-element.html +168 -0
- package/storybook-static/demo/logo.png +0 -0
- package/storybook-static/demo/module-url.html +215 -0
- package/storybook-static/demo/npm-versions-demo.html +105 -0
- package/storybook-static/demo/npm-versions.html +65 -0
- package/storybook-static/demo/parameters.html +70 -0
- package/storybook-static/demo/s.xml +28 -0
- package/storybook-static/demo/s.xslt +97 -0
- package/storybook-static/demo/s1.xslt +60 -0
- package/storybook-static/demo/scoped-css.html +169 -0
- package/storybook-static/demo/set-url.html +141 -0
- package/storybook-static/demo/ss.html +57 -0
- package/storybook-static/demo/table.xml +25 -0
- package/storybook-static/demo/table.xsl +293 -0
- package/storybook-static/demo/template.xsl +46 -0
- package/storybook-static/demo/tree.xml +25 -0
- package/storybook-static/demo/tree.xsl +33 -0
- package/storybook-static/demo/wc-square.svg +1 -0
- package/storybook-static/demo/xhtml-template.xhtml +45 -0
- package/storybook-static/demo/z.html +62 -0
- package/storybook-static/demo/z.js +9 -0
- package/storybook-static/demo/z.xml +60 -0
- package/storybook-static/embed-1.html +1 -2
- package/storybook-static/favicon.svg +1 -7
- package/storybook-static/iframe.html +42 -30
- package/storybook-static/index.html +36 -18
- package/storybook-static/index.json +1 -1
- package/storybook-static/mockServiceWorker.js +1 -1
- package/storybook-static/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-bold.woff2 +0 -0
- package/storybook-static/nunito-sans-italic.woff2 +0 -0
- package/storybook-static/nunito-sans-regular.woff2 +0 -0
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js +32 -32
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +1 -1
- package/storybook-static/sb-addons/essentials-actions-3/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js +395 -43
- package/storybook-static/sb-addons/essentials-controls-2/manager-bundle.js.LEGAL.txt +0 -18
- package/storybook-static/sb-addons/essentials-viewport-5/manager-bundle.js +1 -1
- package/storybook-static/sb-addons/interactions-10/manager-bundle.js +221 -22
- package/storybook-static/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +3 -0
- package/storybook-static/sb-common-assets/favicon.svg +1 -0
- package/storybook-static/sb-manager/globals-module-info.js +995 -1
- package/storybook-static/sb-manager/globals-runtime.js +53525 -1
- package/storybook-static/sb-manager/globals.js +48 -1
- package/storybook-static/sb-manager/runtime.js +11884 -1
- package/storybook-static/sb-preview/globals.js +33 -1
- package/storybook-static/sb-preview/runtime.js +9437 -108
- package/vite.config.js +2 -1
- package/dist/custom-element-BDK7dcJN.cjs +0 -53
- package/dist/custom-element-DqtzLkTG.js +0 -471
- package/dist/location-element-2m0gWq_d.cjs +0 -1
- package/dist/location-element-nA_wsqBt.js +0 -49
- package/storybook-static/assets/Color-PRSJMWNM-y4ZsI1hY.js +0 -1
- package/storybook-static/assets/DocsRenderer-K4EAMTCU-VRGUwRrq.js +0 -2
- package/storybook-static/assets/WithTooltip-KJL26V4Q-xdXH9Ztt.js +0 -1
- package/storybook-static/assets/custom-element-BIxkVg7K.js +0 -219
- package/storybook-static/assets/formatter-2WMMO6ZP-CThVcQxM.js +0 -58
- package/storybook-static/assets/http-request.stories-sXA_Y-VM.js +0 -300
- package/storybook-static/assets/iframe-DcDTQOmA.js +0 -2
- package/storybook-static/assets/index-CUFHd5VD.js +0 -1
- package/storybook-static/assets/index-CVRyq5ci.js +0 -27
- package/storybook-static/assets/index-Cc7K62zD.js +0 -3
- package/storybook-static/assets/index-DPPi9iZu.js +0 -548
- package/storybook-static/assets/index-DuIEV_9C.js +0 -13
- package/storybook-static/assets/index-VWixWKZ7.js +0 -1
- package/storybook-static/assets/lit-element-CenEXOuS.js +0 -19
- package/storybook-static/assets/preview-B4GcaC1c.js +0 -1
- package/storybook-static/assets/preview-B63p-W8V.js +0 -20
- package/storybook-static/assets/preview-p-Bwze-K.js +0 -2
- package/storybook-static/assets/syntaxhighlighter-BP7B2CQK-OnioRcs9.js +0 -1
- package/storybook-static/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -3
- package/storybook-static/sb-common-assets/fonts.css +0 -31
- package/storybook-static/sb-manager/WithTooltip-KJL26V4Q-5LS5AN27.js +0 -1
- package/storybook-static/sb-manager/chunk-B3YDJJJH.js +0 -347
- package/storybook-static/sb-manager/chunk-BLWCBWKL.js +0 -9
- package/storybook-static/sb-manager/chunk-GUVK2GTO.js +0 -6
- package/storybook-static/sb-manager/chunk-LFRML3ZV.js +0 -186
- package/storybook-static/sb-manager/chunk-MC7RAF2B.js +0 -274
- package/storybook-static/sb-manager/chunk-ZR5JZWHI.js +0 -1
- package/storybook-static/sb-manager/formatter-2WMMO6ZP-JI7RHVTW.js +0 -58
- package/storybook-static/sb-manager/index.js +0 -1
- package/storybook-static/sb-manager/syntaxhighlighter-BP7B2CQK-WOJYHKQR.js +0 -1
- /package/storybook-static/sb-addons/{storybook-core-server-presets-0 → storybook-core-core-server-presets-0}/common-manager-bundle.js.LEGAL.txt +0 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<xsl:stylesheet version="1.0"
|
|
3
|
+
xmlns="http://www.w3.org/1999/xhtml"
|
|
4
|
+
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
|
5
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
6
|
+
xmlns:func="http://exslt.org/functions"
|
|
7
|
+
xmlns:my="my://own.uri"
|
|
8
|
+
xmlns:xv="http://xmlaspect.org/XmlView"
|
|
9
|
+
xmlns:exslt="http://exslt.org/common"
|
|
10
|
+
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
|
|
11
|
+
exclude-result-prefixes="xhtml exslt msxsl"
|
|
12
|
+
extension-element-prefixes="func"
|
|
13
|
+
>
|
|
14
|
+
<xsl:output
|
|
15
|
+
method="html"
|
|
16
|
+
omit-xml-declaration="yes"
|
|
17
|
+
standalone="yes"
|
|
18
|
+
indent="yes"
|
|
19
|
+
/>
|
|
20
|
+
<!--
|
|
21
|
+
let processor = new XSLTProcessor(); // starts the XSL processor
|
|
22
|
+
processor.setParameter(null, "baseUrl", new URL('./', import.meta.url).pathname);
|
|
23
|
+
-->
|
|
24
|
+
<xsl:param name="url" />
|
|
25
|
+
<xsl:param name="baseUrl" select="substring-before(substring-after(/processing-instruction('xml-stylesheet'),'href="'),'table.xsl"')" />
|
|
26
|
+
<xsl:param name="sort" />
|
|
27
|
+
<!-- select = "exslt:node-set($x) IE compatibility -->
|
|
28
|
+
<msxsl:script language="JScript" implements-prefix="exslt">
|
|
29
|
+
<![CDATA[
|
|
30
|
+
var dd = eval("this['node-set'] = function (x) { return x; }");
|
|
31
|
+
]]>
|
|
32
|
+
</msxsl:script>
|
|
33
|
+
|
|
34
|
+
<xsl:variable name="sorts" select="//xsl:sort" />
|
|
35
|
+
|
|
36
|
+
<func:function name="my:count-elements">
|
|
37
|
+
<func:result select="count(//*)" />
|
|
38
|
+
</func:function>
|
|
39
|
+
|
|
40
|
+
<xsl:template match="/">
|
|
41
|
+
<style>
|
|
42
|
+
body{padding:0;margin:0;}
|
|
43
|
+
table {border-collapse:collapse; width:100%; font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;}
|
|
44
|
+
caption{ text-align:left; }
|
|
45
|
+
th {background-image: linear-gradient(to bottom, #0F1FFF 0%, #AAAACC 100%); font-size:large;}
|
|
46
|
+
tr:nth-child(even) {background-image: linear-gradient(to bottom, rgba(9, 16, 11, 0.2) 0%, rgba(90, 164, 110, 0.1) 100%);}
|
|
47
|
+
tr:nth-child(odd) {background: rgba(255,255,255,0.2);}
|
|
48
|
+
td{font-size:small;border-bottom: none;border-top: none;}
|
|
49
|
+
th a{ color: #FFFF80; text-decoration:none; display:block;}
|
|
50
|
+
th a span{float:left;}
|
|
51
|
+
div>label, div>var{ margin-right:0.5em;}
|
|
52
|
+
|
|
53
|
+
fieldset{border-radius: 1em;border-bottom: none;border-left: none;}
|
|
54
|
+
|
|
55
|
+
/* collapse and select UI */
|
|
56
|
+
fieldset legend label{ cursor:pointer;}
|
|
57
|
+
input[type='checkbox']{ display:none;}
|
|
58
|
+
|
|
59
|
+
input[type='checkbox']:checked+fieldset{ border:2px solid red; }
|
|
60
|
+
input[type='checkbox']:checked+input+fieldset div,
|
|
61
|
+
input[type='checkbox']:checked+input+fieldset legend label.collapse i,
|
|
62
|
+
input[type='checkbox']:checked+fieldset .select i,
|
|
63
|
+
input[type='checkbox']+fieldset .collapse b,
|
|
64
|
+
input[type='checkbox']+fieldset .select b
|
|
65
|
+
{display:none; }
|
|
66
|
+
|
|
67
|
+
input[type='checkbox']:checked+input+fieldset .collapse b,
|
|
68
|
+
input[type='checkbox']+input:checked+fieldset .select b
|
|
69
|
+
{ display:inline;}
|
|
70
|
+
|
|
71
|
+
legend label{ text-shadow: -1px -1px 1px #fff, -1px 0px 1px #fff, 0px -1px 1px #fff, 1px 1px 1px #999, 0px 1px 1px #999, 1px 0px 1px #999, 1px 1px 5px #113;}
|
|
72
|
+
legend label b, legend label i{ margin-right: 0.5em; }
|
|
73
|
+
</style>
|
|
74
|
+
<xsl:variable name="sortedData">
|
|
75
|
+
<xsl:call-template name="StartSort">
|
|
76
|
+
<xsl:with-param name="data" select="*" />
|
|
77
|
+
</xsl:call-template>
|
|
78
|
+
</xsl:variable>
|
|
79
|
+
<div class="XmlViewRendered">
|
|
80
|
+
<xsl:apply-templates select="exslt:node-set($sortedData)" mode="DisplayAs"/>
|
|
81
|
+
</div>
|
|
82
|
+
</xsl:template>
|
|
83
|
+
<xsl:template match="/" priority="-20" name="BodyOnly">
|
|
84
|
+
<xsl:variable name="sortedData">
|
|
85
|
+
<xsl:call-template name="StartSort">
|
|
86
|
+
<xsl:with-param name="data" select="*" />
|
|
87
|
+
</xsl:call-template>
|
|
88
|
+
</xsl:variable>
|
|
89
|
+
<xsl:apply-templates select="exslt:node-set($sortedData)" mode="DisplayAs"/>
|
|
90
|
+
</xsl:template>
|
|
91
|
+
|
|
92
|
+
<xsl:template name="StartSort">
|
|
93
|
+
<xsl:param name="data"/>
|
|
94
|
+
<xsl:param name="sortNode"/>
|
|
95
|
+
<xsl:apply-templates mode="SortData" select="$data">
|
|
96
|
+
<xsl:with-param name="sortNode" select="$sortNode" />
|
|
97
|
+
</xsl:apply-templates>
|
|
98
|
+
</xsl:template>
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
<xsl:template mode="SortData" match="*[*]" name="SortDataDefault">
|
|
103
|
+
<xsl:copy>
|
|
104
|
+
<xsl:copy-of select="@*"/>
|
|
105
|
+
<xsl:apply-templates mode="SortData" select="*">
|
|
106
|
+
<xsl:sort data-type="text" order="ascending" select="@stub-will-be-replaced"/>
|
|
107
|
+
</xsl:apply-templates>
|
|
108
|
+
</xsl:copy>
|
|
109
|
+
</xsl:template>
|
|
110
|
+
|
|
111
|
+
<xsl:template mode="SortData" match="*[not(*)]">
|
|
112
|
+
<xsl:copy><xsl:copy-of select="@*"/><xsl:value-of select="."/></xsl:copy>
|
|
113
|
+
</xsl:template>
|
|
114
|
+
|
|
115
|
+
<!-- skip XmlView injected data from sorting results -->
|
|
116
|
+
<xsl:template mode="SortData" match="*[@priority='100']" priority="300"></xsl:template>
|
|
117
|
+
<xsl:template mode="DisplayAsTable" match="*[@priority='100']" priority="300"></xsl:template>
|
|
118
|
+
|
|
119
|
+
<xsl:template mode="DisplayAs" match="*" ><!-- distinct tags, match to 1st -->
|
|
120
|
+
<xsl:variable name="tagName" select="name()" />
|
|
121
|
+
<xsl:choose>
|
|
122
|
+
<xsl:when test="count( ../*[name()=$tagName]) != 1">
|
|
123
|
+
<xsl:apply-templates select="." mode="DisplayAsTable" />
|
|
124
|
+
</xsl:when>
|
|
125
|
+
<xsl:otherwise>
|
|
126
|
+
<xsl:apply-templates select="." mode="DisplayAsTree" />
|
|
127
|
+
</xsl:otherwise>
|
|
128
|
+
</xsl:choose>
|
|
129
|
+
</xsl:template>
|
|
130
|
+
<xsl:template mode="DisplayAs" match="@*" >
|
|
131
|
+
<b><xsl:value-of select="name()"/></b>=<var><xsl:value-of select="."/></var>
|
|
132
|
+
</xsl:template>
|
|
133
|
+
<xsl:template mode="DisplayAsTree" match="*[not(*)]" priority="20">
|
|
134
|
+
<div><label><xsl:value-of select="name()"/></label>
|
|
135
|
+
<xsl:apply-templates select="@*" mode="DisplayAs"/>
|
|
136
|
+
<var><xsl:value-of select="."/></var>
|
|
137
|
+
</div>
|
|
138
|
+
</xsl:template>
|
|
139
|
+
|
|
140
|
+
<xsl:template mode="DisplayAsTree" match="*" >
|
|
141
|
+
<xsl:variable name="xPath"><xsl:apply-templates mode="xpath" select="."/></xsl:variable>
|
|
142
|
+
<input type="checkbox" id="collapse{$xPath}" class="collapseControl"/>
|
|
143
|
+
<input type="checkbox" id="select{$xPath}"/>
|
|
144
|
+
<fieldset>
|
|
145
|
+
<legend><label for="collapse{$xPath}" class="collapse"><b>▶</b><i>▼</i></label> <label for="select{$xPath}" class="select"><b>✔</b><i>✓</i></label> <xsl:value-of select="name()"/></legend>
|
|
146
|
+
<div>
|
|
147
|
+
<xsl:apply-templates select="." mode="DisplayContent"/>
|
|
148
|
+
</div>
|
|
149
|
+
</fieldset>
|
|
150
|
+
</xsl:template>
|
|
151
|
+
<xsl:template mode="DisplayContent" match="*">
|
|
152
|
+
<xsl:for-each select="@*|*">
|
|
153
|
+
<xsl:variable name="tagName" select="name()"/>
|
|
154
|
+
|
|
155
|
+
<xsl:if test="not(preceding-sibling::*[name()=$tagName])">
|
|
156
|
+
<xsl:apply-templates select="." mode="DisplayAs"/>
|
|
157
|
+
</xsl:if>
|
|
158
|
+
</xsl:for-each>
|
|
159
|
+
<xsl:if test="normalize-space(text()) != '' ">
|
|
160
|
+
<p><xsl:value-of select="text()"/></p>
|
|
161
|
+
</xsl:if>
|
|
162
|
+
</xsl:template>
|
|
163
|
+
|
|
164
|
+
<xsl:template match="*" mode="DisplayAsTable" >
|
|
165
|
+
<xsl:param name="childName" select="name()"/>
|
|
166
|
+
<xsl:variable name="ZZheaders" select="@*|*" /> <!-- first child attributes and its children -->
|
|
167
|
+
<!-- TODO union of unique child names as not all rows have same children set. When sorting the missing attributes changing number of columns -->
|
|
168
|
+
<xsl:variable name="collection" select=".."/>
|
|
169
|
+
<xsl:variable name="collectionPath"><xsl:apply-templates mode="xpath" select=".."></xsl:apply-templates></xsl:variable>
|
|
170
|
+
|
|
171
|
+
<xsl:variable name="hAll">
|
|
172
|
+
<xsl:for-each select="*|@*">
|
|
173
|
+
<xsl:variable name="p" select="name()"/>
|
|
174
|
+
<xsl:choose>
|
|
175
|
+
<xsl:when test="count(.|../@*)=count(../@*)"><xsl:element name="{$p}"><xsl:attribute name="xv" ><xsl:value-of select="$p" /></xsl:attribute></xsl:element></xsl:when>
|
|
176
|
+
<xsl:when test="count( preceding-sibling::*[name()=$p]) != 0"></xsl:when>
|
|
177
|
+
<xsl:otherwise><xsl:copy/></xsl:otherwise>
|
|
178
|
+
</xsl:choose>
|
|
179
|
+
</xsl:for-each>
|
|
180
|
+
</xsl:variable>
|
|
181
|
+
<xsl:variable name="headers" select="exslt:node-set($hAll)/*" />
|
|
182
|
+
<table border="1">
|
|
183
|
+
<caption><!-- todo collapsible -->
|
|
184
|
+
<var>
|
|
185
|
+
<xsl:attribute name="title"><xsl:value-of select="$collectionPath"/>/<xsl:value-of select="$childName"/></xsl:attribute>
|
|
186
|
+
<xsl:value-of select="$childName"/>
|
|
187
|
+
</var>
|
|
188
|
+
</caption>
|
|
189
|
+
<thead>
|
|
190
|
+
<tr>
|
|
191
|
+
<xsl:for-each select="$headers">
|
|
192
|
+
<xsl:variable name="p" ><xsl:if test="name(.)=@xv">@</xsl:if><xsl:value-of select="local-name()"/></xsl:variable>
|
|
193
|
+
<xsl:variable name="fullPath" ><xsl:value-of select="$collectionPath"/>/<xsl:value-of select="$p"/></xsl:variable>
|
|
194
|
+
<xsl:variable name ="direction" >
|
|
195
|
+
<xsl:for-each select="$sorts">
|
|
196
|
+
<xsl:if test="@select=$p">
|
|
197
|
+
<xsl:choose>
|
|
198
|
+
<xsl:when test="@order='ascending'">▲</xsl:when>
|
|
199
|
+
<xsl:when test="@order='descending'">▼</xsl:when>
|
|
200
|
+
<xsl:otherwise>◊</xsl:otherwise>
|
|
201
|
+
</xsl:choose>
|
|
202
|
+
</xsl:if>
|
|
203
|
+
</xsl:for-each>
|
|
204
|
+
</xsl:variable>
|
|
205
|
+
<xsl:variable name ="order" >
|
|
206
|
+
<xsl:for-each select="$sorts">
|
|
207
|
+
<xsl:if test="@select=$p">
|
|
208
|
+
<xsl:value-of select="count(preceding-sibling::xsl:sort) "/>
|
|
209
|
+
</xsl:if>
|
|
210
|
+
</xsl:for-each>
|
|
211
|
+
</xsl:variable>
|
|
212
|
+
|
|
213
|
+
<th><a href="#"
|
|
214
|
+
title="{$p}"
|
|
215
|
+
xv:sortpath="{$p}"
|
|
216
|
+
><span><xsl:value-of select="$direction"/> <sub><xsl:value-of select="$order"/> </sub></span>
|
|
217
|
+
|
|
218
|
+
<xsl:value-of select="local-name()"/>
|
|
219
|
+
</a>
|
|
220
|
+
</th>
|
|
221
|
+
</xsl:for-each>
|
|
222
|
+
</tr>
|
|
223
|
+
</thead>
|
|
224
|
+
<tbody>
|
|
225
|
+
<xsl:for-each select="../*[name()=$childName]">
|
|
226
|
+
<xsl:variable name="rowNode" select="." />
|
|
227
|
+
<tr>
|
|
228
|
+
<xsl:for-each select="$headers">
|
|
229
|
+
<xsl:variable name="key" select="name()" />
|
|
230
|
+
<td>
|
|
231
|
+
<!-- xsl:attribute name="title"><xsl:apply-templates mode="xpath" select="."></xsl:apply-templates></xsl:attribute -->
|
|
232
|
+
|
|
233
|
+
<xsl:choose>
|
|
234
|
+
<xsl:when test="count( $rowNode/*[name()=$key]) > 1">
|
|
235
|
+
<xsl:apply-templates select="$rowNode/*[name()=$key][1]" mode="DisplayAsTable" />
|
|
236
|
+
</xsl:when>
|
|
237
|
+
<xsl:otherwise>
|
|
238
|
+
<xsl:apply-templates mode="DisplayContent" select="$rowNode/*[name()=$key]|$rowNode/@*[name()=$key]" />
|
|
239
|
+
</xsl:otherwise>
|
|
240
|
+
</xsl:choose>
|
|
241
|
+
|
|
242
|
+
</td>
|
|
243
|
+
</xsl:for-each>
|
|
244
|
+
</tr>
|
|
245
|
+
</xsl:for-each>
|
|
246
|
+
</tbody>
|
|
247
|
+
</table>
|
|
248
|
+
</xsl:template>
|
|
249
|
+
|
|
250
|
+
<!-- XmlAspect/XOR/XPath/Dom2XPath.xsl -->
|
|
251
|
+
<!-- Root -->
|
|
252
|
+
<xsl:template match="/" mode="xpath">
|
|
253
|
+
<xsl:text>/</xsl:text>
|
|
254
|
+
</xsl:template>
|
|
255
|
+
|
|
256
|
+
<!-- Element -->
|
|
257
|
+
<xsl:template match="*" mode="xpath">
|
|
258
|
+
<!-- Process ancestors first -->
|
|
259
|
+
<xsl:apply-templates select=".." mode="xpath"/>
|
|
260
|
+
|
|
261
|
+
<!-- Output / if not already output by the root node -->
|
|
262
|
+
<xsl:if test="../..">/</xsl:if>
|
|
263
|
+
|
|
264
|
+
<!-- Output the name of the element -->
|
|
265
|
+
<xsl:value-of select="name()"/>
|
|
266
|
+
|
|
267
|
+
<!-- Add the element's position to pinpoint the element exactly -->
|
|
268
|
+
<xsl:if test="count(../*[name() = name(current())]) > 1">
|
|
269
|
+
<xsl:text>[</xsl:text>
|
|
270
|
+
<xsl:value-of
|
|
271
|
+
select="count(preceding-sibling::*[name() = name(current())]) +1"/>
|
|
272
|
+
<xsl:text>]</xsl:text>
|
|
273
|
+
</xsl:if>
|
|
274
|
+
|
|
275
|
+
<!-- Add 'name' predicate as a hint of which element -->
|
|
276
|
+
<xsl:if test="@name">
|
|
277
|
+
<xsl:text/>[@name="<xsl:value-of select="@name"/>"]<xsl:text/>
|
|
278
|
+
</xsl:if>
|
|
279
|
+
</xsl:template>
|
|
280
|
+
|
|
281
|
+
<!-- Attribute -->
|
|
282
|
+
<xsl:template match="@*" mode="xpath">
|
|
283
|
+
<!-- Process ancestors first -->
|
|
284
|
+
<xsl:apply-templates select=".." mode="xpath"/>
|
|
285
|
+
|
|
286
|
+
<!-- Output the name of the attribute -->
|
|
287
|
+
<xsl:text/>/@<xsl:value-of select="name()"/>
|
|
288
|
+
|
|
289
|
+
<!-- Output the attribute's value as a predicate -->
|
|
290
|
+
<xsl:text/>[.="<xsl:value-of select="."/>"]<xsl:text/>
|
|
291
|
+
</xsl:template>
|
|
292
|
+
|
|
293
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
|
3
|
+
<xsl:output method="html"/>
|
|
4
|
+
|
|
5
|
+
<xsl:template match="/">
|
|
6
|
+
<xsl:apply-templates select="//attributes"/>
|
|
7
|
+
</xsl:template>
|
|
8
|
+
<xsl:template match="attributes">
|
|
9
|
+
<h3 xmlns="http://www.w3.org/1999/xhtml">
|
|
10
|
+
<xsl:value-of select="title"></xsl:value-of>
|
|
11
|
+
</h3> <!-- title is an attribute in instance
|
|
12
|
+
mapped into /*/attributes/title -->
|
|
13
|
+
<xsl:if xmlns="http://www.w3.org/1999/xhtml" test="//smile"> <!-- data-smile DCE instance attribute,
|
|
14
|
+
mapped into /*/dataset/smile
|
|
15
|
+
used in condition -->
|
|
16
|
+
<!-- data-smile DCE instance attribute, used as HTML -->
|
|
17
|
+
<div>Smile as:
|
|
18
|
+
<xsl:value-of select="//smile"></xsl:value-of>
|
|
19
|
+
</div>
|
|
20
|
+
</xsl:if>
|
|
21
|
+
<!-- image would not be visible in sandbox, see live demo -->
|
|
22
|
+
<img xmlns="http://www.w3.org/1999/xhtml"
|
|
23
|
+
src="https://unpkg.com/pokeapi-sprites@2.0.2/sprites/pokemon/other/dream-world/{pokemon-id}.svg"
|
|
24
|
+
alt="{title} image"/>
|
|
25
|
+
<!-- image-src and title are DCE instance attributes,
|
|
26
|
+
mapped into /*/attributes/
|
|
27
|
+
used within output attribute via curly brackets -->
|
|
28
|
+
|
|
29
|
+
<!-- `slot name=xxx` replaced with elements with `slot=xxx` attribute -->
|
|
30
|
+
<p xmlns="http://www.w3.org/1999/xhtml">
|
|
31
|
+
<xsl:value-of select="//*[@slot="description"]"/>
|
|
32
|
+
</p>
|
|
33
|
+
<xsl:for-each xmlns="http://www.w3.org/1999/xhtml" select="//*[@pokemon-id]">
|
|
34
|
+
<!-- loop over payload elements with `pokemon-id` attribute -->
|
|
35
|
+
<button>
|
|
36
|
+
<img height="32"
|
|
37
|
+
src="https://unpkg.com/pokeapi-sprites@2.0.2/sprites/pokemon/other/dream-world/{@pokemon-id}.svg"
|
|
38
|
+
alt="{text()}"/>
|
|
39
|
+
<br/>
|
|
40
|
+
<xsl:value-of select="text()">
|
|
41
|
+
</xsl:value-of>
|
|
42
|
+
</button>
|
|
43
|
+
|
|
44
|
+
</xsl:for-each>
|
|
45
|
+
</xsl:template>
|
|
46
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<?xml-stylesheet type="text/xsl" href="tree.xsl"?>
|
|
3
|
+
<div xmlns="http://www.w3.org/1999/xhtml">
|
|
4
|
+
<payload>
|
|
5
|
+
<span slot=""></span>
|
|
6
|
+
<p slot="description">Bulbasaur is a cute Pokémon born with a large seed firmly affixed to its back;
|
|
7
|
+
the seed grows in size as the Pokémon does.
|
|
8
|
+
</p>
|
|
9
|
+
<span slot=""></span>
|
|
10
|
+
<ul slot="">
|
|
11
|
+
<li pokemon-id="2">ivysaur</li>
|
|
12
|
+
<li pokemon-id="3">venusaur</li>
|
|
13
|
+
</ul>
|
|
14
|
+
<span slot=""></span>
|
|
15
|
+
</payload>
|
|
16
|
+
<attributes>
|
|
17
|
+
<title>bulbasaur</title>
|
|
18
|
+
<data-smile>👼</data-smile>
|
|
19
|
+
<pokemon-id>1</pokemon-id>
|
|
20
|
+
</attributes>
|
|
21
|
+
<dataset>
|
|
22
|
+
<smile>👼</smile>
|
|
23
|
+
</dataset>
|
|
24
|
+
<slice></slice>
|
|
25
|
+
</div>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<xsl:stylesheet version="1.0"
|
|
2
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
3
|
+
<xsl:output
|
|
4
|
+
method="html"
|
|
5
|
+
omit-xml-declaration="yes"
|
|
6
|
+
standalone="yes"
|
|
7
|
+
indent="yes"
|
|
8
|
+
/>
|
|
9
|
+
|
|
10
|
+
<xsl:template match="/">
|
|
11
|
+
<xsl:apply-templates select="*"/>
|
|
12
|
+
</xsl:template>
|
|
13
|
+
<xsl:template match="*">
|
|
14
|
+
<details style="padding:0 1rem" open="open">
|
|
15
|
+
<summary>
|
|
16
|
+
<b style="color:green"><xsl:value-of select="name()"/></b>
|
|
17
|
+
<xsl:apply-templates select="@*"/>
|
|
18
|
+
</summary>
|
|
19
|
+
<xsl:value-of select="./text()"/>
|
|
20
|
+
<xsl:apply-templates select="*"/>
|
|
21
|
+
</details>
|
|
22
|
+
</xsl:template>
|
|
23
|
+
<xsl:template match="@*">
|
|
24
|
+
<code style="margin-left:1rem;color:brown"><xsl:value-of select="name()"/>="<xsl:value-of select="."/>"</code>
|
|
25
|
+
</xsl:template>
|
|
26
|
+
<xsl:template match="text()">
|
|
27
|
+
<p>
|
|
28
|
+
<xsl:value-of select="."/>
|
|
29
|
+
</p>
|
|
30
|
+
</xsl:template>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
</xsl:stylesheet>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 216 209.18"><defs><style>.cls-1{fill:#c2e6f1;}.cls-2{fill:#dcf1f7;}.cls-3{fill:#2d4554;}.cls-4{fill:#60cae5;}</style></defs><polygon class="cls-3" points="0 82.47 0 126.71 34.84 146.83 34.84 187.06 73.16 209.18 108 189.07 142.84 209.18 181.16 187.06 181.16 146.83 216 126.71 216 82.47 181.16 62.35 181.16 22.12 142.84 0 108 20.12 73.16 0 34.84 22.12 34.84 62.35 0 82.47"/><path class="cls-2" d="m114.33,56.69l20.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"/><path class="cls-2" d="m98.19,62.71h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97Z"/><path class="cls-1" d="m48.12,66.01l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97Z"/><path class="cls-2" d="m46.18,24.66l20.64,11.92c4.44,2.57,8.22,2.57,12.67,0h0s20.64-11.92,20.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.06Z"/><path class="cls-2" d="m115.87,24.66l20.64,11.92c4.44,2.57,8.22,2.57,12.67,0h0s20.64-11.92,20.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.06Z"/><path class="cls-2" d="m152.65,42.59c-4.44,2.56-6.33,5.84-6.33,10.97v23.84c0,.54.45.8.92.54l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0v-23.84c0-.54-.45-.8-.92-.53l-20.64,11.92h0Z"/><path class="cls-2" d="m77.55,158.4l20.65-11.92h0c4.44-2.57,6.33-5.84,6.33-10.97v-23.84c0-.54-.45-.8-.92-.53l-20.64,11.92c-4.44,2.57-6.33,5.84-6.33,10.97h0s0,23.84,0,23.84c0,.54.45.8.92.54Z"/><path class="cls-4" d="m146.31,134.03v23.84c0,.54.45.8.92.54l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0s0-23.84,0-23.84c0-.54-.45-.8-.92-.53l-20.64,11.92h0c-4.44,2.57-6.33,5.84-6.33,10.97Z"/><path class="cls-4" d="m63.35,123.06h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97Z"/><path class="cls-4" d="m103.61,151.37l-20.64,11.92c-4.44,2.57-6.33,5.84-6.33,10.97h0s0,23.84,0,23.84c0,.54.45.8.92.54l20.65-11.92h0c4.44-2.57,6.33-5.84,6.33-10.97v-23.84c0-.54-.45-.8-.92-.53Z"/><path class="cls-4" d="m63.35,163.29h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97Z"/><path class="cls-4" d="m28.51,102.94h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97Z"/><path class="cls-4" d="m133.04,163.29l-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84c0,5.13,1.89,8.4,6.33,10.97h0s20.65,11.92,20.65,11.92c.47.27.92,0,.92-.54v-23.84s0,0,0,0c0-5.13-1.89-8.4-6.33-10.97Z"/><path class="cls-4" d="m173.29,151.37l-20.64,11.92h0c-4.44,2.57-6.33,5.84-6.33,10.97v23.84c0,.54.45.8.92.54l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0s0-23.84,0-23.84c0-.54-.45-.8-.92-.53Z"/><path class="cls-4" d="m209.06,91.55c0-.54-.45-.8-.92-.53l-20.64,11.92h0c-4.44,2.57-6.33,5.84-6.33,10.97v23.84c0,.54.45.8.92.54l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0v-23.84Z"/><path class="cls-2" d="m149.18,117.04l20.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"/><path class="cls-1" d="m112.39,98.05l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0v-23.84c0-.54-.45-.8-.92-.53l-20.64,11.92h0c-4.44,2.57-6.33,5.84-6.33,10.97v23.84c0,.54.45.8.92.54Z"/><path class="cls-1" d="m100.13,105.12c.47-.27.47-.79,0-1.06l-20.65-11.92c-4.44-2.57-8.22-2.57-12.67,0h0s-20.65,11.92-20.65,11.92c-.47.27-.47.79,0,1.06l20.64,11.92h0c4.44,2.57,8.22,2.57,12.67,0l20.64-11.92Z"/><path class="cls-2" d="m65.29,85.01c.47-.27.47-.79,0-1.06l-20.65-11.92c-4.44-2.57-8.22-2.57-12.67,0h0s-20.65,11.92-20.65,11.92c-.47.27-.47.79,0,1.06l20.64,11.92h0c4.44,2.57,8.22,2.57,12.67,0l20.64-11.92Z"/><path class="cls-1" d="m133.04,123.06l-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84c0,5.13,1.89,8.4,6.33,10.97h0s20.65,11.92,20.65,11.92c.47.27.92,0,.92-.54v-23.84s0,0,0,0c0-5.13-1.89-8.4-6.33-10.97Z"/><path class="cls-1" 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"/></svg>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>template based on HTML file</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<b id="wave">👋</b>
|
|
9
|
+
<b id="ok">👌</b>
|
|
10
|
+
<svg id="dwc-logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 216 209.18"><defs><style>.cls-1{fill:#c2e6f1;}.cls-2{fill:#dcf1f7;}.cls-3{fill:#2d4554;}.cls-4{fill:#60cae5;}</style></defs><polygon class="cls-3" points="0 82.47 0 126.71 34.84 146.83 34.84 187.06 73.16 209.18 108 189.07 142.84 209.18 181.16 187.06 181.16 146.83 216 126.71 216 82.47 181.16 62.35 181.16 22.12 142.84 0 108 20.12 73.16 0 34.84 22.12 34.84 62.35 0 82.47"/><path class="cls-2" d="m114.33,56.69l20.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"/><path class="cls-2" d="m98.19,62.71h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97Z"/><path class="cls-1" d="m48.12,66.01l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97Z"/><path class="cls-2" d="m46.18,24.66l20.64,11.92c4.44,2.57,8.22,2.57,12.67,0h0s20.64-11.92,20.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.06Z"/><path class="cls-2" d="m115.87,24.66l20.64,11.92c4.44,2.57,8.22,2.57,12.67,0h0s20.64-11.92,20.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.06Z"/><path class="cls-2" d="m152.65,42.59c-4.44,2.56-6.33,5.84-6.33,10.97v23.84c0,.54.45.8.92.54l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0v-23.84c0-.54-.45-.8-.92-.53l-20.64,11.92h0Z"/><path class="cls-2" d="m77.55,158.4l20.65-11.92h0c4.44-2.57,6.33-5.84,6.33-10.97v-23.84c0-.54-.45-.8-.92-.53l-20.64,11.92c-4.44,2.57-6.33,5.84-6.33,10.97h0s0,23.84,0,23.84c0,.54.45.8.92.54Z"/><path class="cls-4" d="m146.31,134.03v23.84c0,.54.45.8.92.54l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0s0-23.84,0-23.84c0-.54-.45-.8-.92-.53l-20.64,11.92h0c-4.44,2.57-6.33,5.84-6.33,10.97Z"/><path class="cls-4" d="m63.35,123.06h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97Z"/><path class="cls-4" d="m103.61,151.37l-20.64,11.92c-4.44,2.57-6.33,5.84-6.33,10.97h0s0,23.84,0,23.84c0,.54.45.8.92.54l20.65-11.92h0c4.44-2.57,6.33-5.84,6.33-10.97v-23.84c0-.54-.45-.8-.92-.53Z"/><path class="cls-4" d="m63.35,163.29h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97Z"/><path class="cls-4" d="m28.51,102.94h0s-20.64-11.92-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84s0,0,0,0c0,5.13,1.89,8.4,6.33,10.97l20.65,11.92c.47.27.92,0,.92-.54v-23.84c0-5.13-1.89-8.4-6.33-10.97Z"/><path class="cls-4" d="m133.04,163.29l-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84c0,5.13,1.89,8.4,6.33,10.97h0s20.65,11.92,20.65,11.92c.47.27.92,0,.92-.54v-23.84s0,0,0,0c0-5.13-1.89-8.4-6.33-10.97Z"/><path class="cls-4" d="m173.29,151.37l-20.64,11.92h0c-4.44,2.57-6.33,5.84-6.33,10.97v23.84c0,.54.45.8.92.54l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0s0-23.84,0-23.84c0-.54-.45-.8-.92-.53Z"/><path class="cls-4" d="m209.06,91.55c0-.54-.45-.8-.92-.53l-20.64,11.92h0c-4.44,2.57-6.33,5.84-6.33,10.97v23.84c0,.54.45.8.92.54l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0v-23.84Z"/><path class="cls-2" d="m149.18,117.04l20.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"/><path class="cls-1" d="m112.39,98.05l20.65-11.92c4.44-2.57,6.33-5.84,6.33-10.97h0v-23.84c0-.54-.45-.8-.92-.53l-20.64,11.92h0c-4.44,2.57-6.33,5.84-6.33,10.97v23.84c0,.54.45.8.92.54Z"/><path class="cls-1" d="m100.13,105.12c.47-.27.47-.79,0-1.06l-20.65-11.92c-4.44-2.57-8.22-2.57-12.67,0h0s-20.65,11.92-20.65,11.92c-.47.27-.47.79,0,1.06l20.64,11.92h0c4.44,2.57,8.22,2.57,12.67,0l20.64-11.92Z"/><path class="cls-2" d="m65.29,85.01c.47-.27.47-.79,0-1.06l-20.65-11.92c-4.44-2.57-8.22-2.57-12.67,0h0s-20.65,11.92-20.65,11.92c-.47.27-.47.79,0,1.06l20.64,11.92h0c4.44,2.57,8.22,2.57,12.67,0l20.64-11.92Z"/><path class="cls-1" d="m133.04,123.06l-20.64-11.92c-.47-.27-.92-.01-.92.53v23.84c0,5.13,1.89,8.4,6.33,10.97h0s20.65,11.92,20.65,11.92c.47.27.92,0,.92-.54v-23.84s0,0,0,0c0-5.13-1.89-8.4-6.33-10.97Z"/><path class="cls-1" 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"/></svg>
|
|
11
|
+
<xsl:stylesheet
|
|
12
|
+
id="embedded-xsl"
|
|
13
|
+
version="1.0"
|
|
14
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
15
|
+
<xsl:output
|
|
16
|
+
method="html"
|
|
17
|
+
omit-xml-declaration="yes"
|
|
18
|
+
standalone="yes"
|
|
19
|
+
indent="yes"
|
|
20
|
+
/>
|
|
21
|
+
|
|
22
|
+
<xsl:template match="/">
|
|
23
|
+
<xsl:apply-templates select="*"/>
|
|
24
|
+
</xsl:template>
|
|
25
|
+
<xsl:template match="*">
|
|
26
|
+
<details style="padding:0 1rem" open="open">
|
|
27
|
+
<summary>
|
|
28
|
+
<b style="color:green"><xsl:value-of select="name()"/></b>
|
|
29
|
+
<xsl:apply-templates select="@*"/>
|
|
30
|
+
</summary>
|
|
31
|
+
<xsl:value-of select="./text()"/>
|
|
32
|
+
<xsl:apply-templates select="*"/>
|
|
33
|
+
</details>
|
|
34
|
+
</xsl:template>
|
|
35
|
+
<xsl:template match="@*">
|
|
36
|
+
<code style="margin-left:1rem;color:brown"><xsl:value-of select="name()"/>="<xsl:value-of select="."/>"</code>
|
|
37
|
+
</xsl:template>
|
|
38
|
+
<xsl:template match="text()">
|
|
39
|
+
<p>
|
|
40
|
+
<xsl:value-of select="."/>
|
|
41
|
+
</p>
|
|
42
|
+
</xsl:template>
|
|
43
|
+
</xsl:stylesheet>
|
|
44
|
+
</body>
|
|
45
|
+
</html>
|
package/dist/demo/z.html
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<dce-root xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
|
2
|
+
xmlns:dce="urn:schemas-epa-wg:dce" data-dce-id="1">
|
|
3
|
+
<location-element xmlns="" slice="window-url" live="" data-dce-id="2"></location-element>
|
|
4
|
+
<table xmlns="" data-dce-id="3">
|
|
5
|
+
<tbody data-dce-id="0-1">
|
|
6
|
+
<tr data-dce-id="4">
|
|
7
|
+
<th data-dce-id="5"><h3 data-dce-id="6"> URL properties </h3></th>
|
|
8
|
+
<td data-dce-id="7">9</td>
|
|
9
|
+
</tr>
|
|
10
|
+
<tr data-dce-id="10">
|
|
11
|
+
<th data-dce-id="11">href</th>
|
|
12
|
+
<td data-dce-id="12">http://localhost:63342/custom-element/demo/a.html?_ijt=dmv0p4go000q47lg48i5im92f7&_ij_reload=RELOAD_ON_SAVE</td>
|
|
13
|
+
</tr>
|
|
14
|
+
<tr data-dce-id="10-1">
|
|
15
|
+
<th data-dce-id="11">origin</th>
|
|
16
|
+
<td data-dce-id="12">http://localhost:63342</td>
|
|
17
|
+
</tr>
|
|
18
|
+
<tr data-dce-id="10-2">
|
|
19
|
+
<th data-dce-id="11">protocol</th>
|
|
20
|
+
<td data-dce-id="12">http:</td>
|
|
21
|
+
</tr>
|
|
22
|
+
<tr data-dce-id="10-3">
|
|
23
|
+
<th data-dce-id="11">host</th>
|
|
24
|
+
<td data-dce-id="12">localhost:63342</td>
|
|
25
|
+
</tr>
|
|
26
|
+
<tr data-dce-id="10-4">
|
|
27
|
+
<th data-dce-id="11">hostname</th>
|
|
28
|
+
<td data-dce-id="12">localhost</td>
|
|
29
|
+
</tr>
|
|
30
|
+
<tr data-dce-id="10-5">
|
|
31
|
+
<th data-dce-id="11">port</th>
|
|
32
|
+
<td data-dce-id="12">63342</td>
|
|
33
|
+
</tr>
|
|
34
|
+
<tr data-dce-id="10-6">
|
|
35
|
+
<th data-dce-id="11">pathname</th>
|
|
36
|
+
<td data-dce-id="12">/custom-element/demo/a.html</td>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr data-dce-id="10-7">
|
|
39
|
+
<th data-dce-id="11">search</th>
|
|
40
|
+
<td data-dce-id="12">?_ijt=dmv0p4go000q47lg48i5im92f7&_ij_reload=RELOAD_ON_SAVE</td>
|
|
41
|
+
</tr>
|
|
42
|
+
<tr data-dce-id="10-8">
|
|
43
|
+
<th data-dce-id="11">hash</th>
|
|
44
|
+
<td data-dce-id="12"></td>
|
|
45
|
+
</tr>
|
|
46
|
+
</tbody>
|
|
47
|
+
</table>
|
|
48
|
+
<h3 data-dce-id="9"> URL parameters </h3>
|
|
49
|
+
<table xmlns="" data-dce-id="8">
|
|
50
|
+
|
|
51
|
+
<tbody data-dce-id="0-1">
|
|
52
|
+
<tr data-dce-id="10">
|
|
53
|
+
<th data-dce-id="11">_ijt</th>
|
|
54
|
+
<td data-dce-id="12">dmv0p4go000q47lg48i5im92f7</td>
|
|
55
|
+
</tr>
|
|
56
|
+
<tr data-dce-id="10-1">
|
|
57
|
+
<th data-dce-id="11">_ij_reload</th>
|
|
58
|
+
<td data-dce-id="12">RELOAD_ON_SAVE</td>
|
|
59
|
+
</tr>
|
|
60
|
+
</tbody>
|
|
61
|
+
</table>
|
|
62
|
+
</dce-root>
|
package/dist/demo/z.js
ADDED
package/dist/demo/z.xml
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<dce-root data-dce-id="1" xmlns:dce="urn:schemas-epa-wg:dce" xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
|
3
|
+
<location-element slice="window-url" data-dce-id="2"/>
|
|
4
|
+
<table data-dce-id="3">
|
|
5
|
+
<tr data-dce-id="4">
|
|
6
|
+
<th data-dce-id="5">
|
|
7
|
+
<u data-dce-id="6">URL properties</u>
|
|
8
|
+
</th>
|
|
9
|
+
</tr>
|
|
10
|
+
<tr data-dce-id="7">
|
|
11
|
+
<th data-dce-id="8">href</th>
|
|
12
|
+
<td data-dce-id="9">http://localhost:63342/custom-element/demo/a.html?_ijt=qca6trk5kne6eo4s4tomq4egmm&_ij_reload=RELOAD_ON_SAVE</td>
|
|
13
|
+
</tr>
|
|
14
|
+
<tr data-dce-id="7">
|
|
15
|
+
<th data-dce-id="8">origin</th>
|
|
16
|
+
<td data-dce-id="9">http://localhost:63342</td>
|
|
17
|
+
</tr>
|
|
18
|
+
<tr data-dce-id="7">
|
|
19
|
+
<th data-dce-id="8">protocol</th>
|
|
20
|
+
<td data-dce-id="9">http:</td>
|
|
21
|
+
</tr>
|
|
22
|
+
<tr data-dce-id="7">
|
|
23
|
+
<th data-dce-id="8">host</th>
|
|
24
|
+
<td data-dce-id="9">localhost:63342</td>
|
|
25
|
+
</tr>
|
|
26
|
+
<tr data-dce-id="7">
|
|
27
|
+
<th data-dce-id="8">hostname</th>
|
|
28
|
+
<td data-dce-id="9">localhost</td>
|
|
29
|
+
</tr>
|
|
30
|
+
<tr data-dce-id="7">
|
|
31
|
+
<th data-dce-id="8">port</th>
|
|
32
|
+
<td data-dce-id="9">63342</td>
|
|
33
|
+
</tr>
|
|
34
|
+
<tr data-dce-id="7">
|
|
35
|
+
<th data-dce-id="8">pathname</th>
|
|
36
|
+
<td data-dce-id="9">/custom-element/demo/a.html</td>
|
|
37
|
+
</tr>
|
|
38
|
+
<tr data-dce-id="7">
|
|
39
|
+
<th data-dce-id="8">search</th>
|
|
40
|
+
<td data-dce-id="9">?_ijt=qca6trk5kne6eo4s4tomq4egmm&_ij_reload=RELOAD_ON_SAVE</td>
|
|
41
|
+
</tr>
|
|
42
|
+
<tr data-dce-id="7">
|
|
43
|
+
<th data-dce-id="8">hash</th>
|
|
44
|
+
<td data-dce-id="9"/>
|
|
45
|
+
</tr>
|
|
46
|
+
<tr data-dce-id="10">
|
|
47
|
+
<th data-dce-id="11">
|
|
48
|
+
<u data-dce-id="12">URL parameters</u>
|
|
49
|
+
</th>
|
|
50
|
+
</tr>
|
|
51
|
+
<tr data-dce-id="13">
|
|
52
|
+
<th data-dce-id="14">_ijt</th>
|
|
53
|
+
<td data-dce-id="15">qca6trk5kne6eo4s4tomq4egmm</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr data-dce-id="13">
|
|
56
|
+
<th data-dce-id="14">_ij_reload</th>
|
|
57
|
+
<td data-dce-id="15">RELOAD_ON_SAVE</td>
|
|
58
|
+
</tr>
|
|
59
|
+
</table>
|
|
60
|
+
</dce-root>
|
package/dist/embed-1.html
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=(t,e)=>t.getAttribute(e);let c;function f(){c||(c={},"back,forward,go,pushState,replaceState".split(",").forEach(t=>{c[t]=history[t],history[t]=function(...e){c[t].apply(history,e),window.dispatchEvent(new CustomEvent("dce-location",{detail:{k:t}}))}}))}const d={"location.href":t=>window.location.href=t,"location.hash":t=>window.location.hash=t,"location.assign":t=>window.location.assign(t),"location.replace":t=>window.location.replace(t),"history.pushState":t=>window.history.pushState({},"",t),"history.replaceState":t=>window.history.replaceState({},"",t)};class w extends HTMLElement{static observedAttributes=["value","slice","href","type","live","src","method"];constructor(){super();const e={},n=()=>setTimeout(r,1),r=()=>{const a=u(this,"href");a||f();const i=a?new URL(a,window.location):window.location,o={},l=new URLSearchParams(i.search);for(const s of l.keys())o[s]=l.getAll(s);const h={params:o};for(const s in i)typeof i[s]=="string"&&(h[s]=i[s]);this.value=h,this.dispatchEvent(new Event("change"))};this.sliceInit=a=>{if(this.hasAttribute("method")){const i=this.getAttribute("method"),o=this.getAttribute("src");i&&o&&(i==="location.hash"?o!==window.location.hash&&d[i]?.(o):window.location.href!==new URL(o,window.location).href&&d[i]?.(o))}return!e.listener&&this.hasAttribute("live")&&(e.listener=1,window.navigation?.addEventListener("navigate",n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),window.addEventListener("dce-location",n)),r(),a||{}},this._destroy=()=>{window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),window.removeEventListener("dce-location",n),delete e.listener}}attributeChangedCallback(e,n,r){e!=="href"&&e!=="method"&&!["method","src","href"].includes(e)||this.sliceInit&&this.sliceInit()}connectedCallback(){this.sliceInit()}disconnectedCallback(){this._destroy()}}window.customElements.define("location-element",w);exports.LocationElement=w;
|