@epa-wg/custom-element-dist 0.0.33 → 0.0.34
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/.claude/settings.local.json +18 -0
- package/.github/workflows/deploy.yml +59 -0
- package/.idea/copilot.data.migration.agent.xml +6 -0
- package/.idea/copilot.data.migration.ask.xml +6 -0
- package/.idea/copilot.data.migration.edit.xml +6 -0
- package/.idea/custom-element-dist.iml +2 -0
- package/.storybook/main.ts +20 -17
- package/.storybook/preview.ts +23 -23
- package/README.md +6 -4
- package/coverage/block-navigation.js +1 -1
- package/coverage/coverage-final.json +4 -3
- package/coverage/index.html +34 -19
- package/coverage/sorter.js +21 -7
- 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 +435 -378
- package/coverage/src/custom-element/http-request.js/coverage.svg +1 -1
- package/coverage/src/custom-element/http-request.js.html +38 -17
- package/coverage/src/custom-element/index.html +26 -26
- package/coverage/src/custom-element/local-storage.js.html +1 -1
- package/coverage/src/custom-element/location-element.js.html +1 -1
- package/coverage/src/custom-element/module-url.js.html +1 -1
- package/coverage/src/index.html +1 -1
- package/coverage/src/material/theme/colors.js/coverage.svg +10 -0
- package/coverage/src/material/theme/colors.js.html +217 -0
- package/coverage/src/material/theme/coverage.svg +10 -0
- package/coverage/src/material/theme/index.html +116 -0
- package/coverage/src/mocks/handlers.ts.html +1 -1
- package/coverage/src/mocks/index.html +1 -1
- package/coverage/src/stories/frame.canvas.ts.html +1 -1
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +1 -1
- package/coverage/src/stories/testStoryBook.ts.html +12 -12
- package/coverage/src/sum.ts.html +1 -1
- package/dist/{custom-element-WnOqmEOe.js → custom-element-BoYMoUtP.js} +193 -183
- package/dist/custom-element-BqtjrCRF.cjs +97 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +3 -3
- package/dist/demo/a.html +10 -3
- package/dist/demo/a.svg +26 -26
- package/dist/demo/html-template.html +4 -3
- package/dist/demo/s.xml +3856 -67
- package/dist/demo/s.xslt +13 -72
- package/dist/demo/s1.xml +3706 -0
- package/dist/http-request-DSaowcG1.cjs +1 -0
- package/dist/{http-request-BOvP4KTl.js → http-request-DTCzZ1gc.js} +15 -9
- package/package.json +2 -2
- package/public/demo/a.html +10 -3
- package/public/demo/a.svg +26 -26
- package/public/demo/html-template.html +4 -3
- package/public/demo/s.xml +3856 -67
- package/public/demo/s.xslt +13 -72
- package/public/demo/s1.xml +3706 -0
- package/src/custom-element/custom-element.js +28 -9
- package/src/custom-element/demo/a.html +10 -3
- package/src/custom-element/demo/a.svg +26 -26
- package/src/custom-element/demo/html-template.html +4 -3
- package/src/custom-element/demo/s.xml +3856 -67
- package/src/custom-element/demo/s.xslt +13 -72
- package/src/custom-element/demo/s1.xml +3706 -0
- package/src/custom-element/http-request.js +7 -0
- package/src/custom-element/ide/web-types-dce.json +1 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/material/angular.css +987 -987
- package/src/material/components/action.html +262 -0
- package/src/material/components/autocomplete.html +167 -239
- package/src/material/components/badge.html +238 -239
- package/src/material/components/dropdown.html +0 -1
- package/src/material/components/icon-link.html +160 -161
- package/src/material/components/icon.html +251 -252
- package/src/material/components/input.html +569 -570
- package/src/material/components/menu.html +235 -236
- package/src/material/components.html +157 -158
- package/src/material/demo.css +36 -36
- package/src/material/index.html +109 -110
- package/src/material/material.css +356 -356
- package/src/material/theme/Base-Principles.md +339 -0
- package/src/material/theme/README.md +298 -18
- package/src/material/theme/UI Domain Model in web applications.svg +1 -0
- package/src/material/theme/User Semantic Theme tokens.svg +1 -0
- package/src/material/theme/action-pending-poc.html +62 -0
- package/src/material/theme/actions-color.html +141 -0
- package/src/material/theme/colors-light.html +631 -0
- package/src/material/theme/colors-native.html +51 -0
- package/src/material/theme/colors-poc.html +66 -0
- package/src/material/theme/colors.html +297 -0
- package/src/material/theme/colors.js +44 -0
- package/src/material/theme/consumer-theme.css +745 -0
- package/src/material/theme/semantic.css +132 -132
- package/src/material/theme/style-bug.html +123 -0
- package/src/material/theme/theme-data.css +43 -0
- package/src/material/theme/theme-data.xhtml +2926 -0
- package/src/material/theme/todo.md +274 -0
- package/src/material/theme/tokens/action-colors.png +0 -0
- package/src/material/theme/tokens/cem-article-illustration-4x1-letterbox-2000x500.png +0 -0
- package/src/material/theme/tokens/cem-breakpoints.md +519 -0
- package/src/material/theme/tokens/cem-colors.md +715 -0
- package/src/material/theme/tokens/cem-consumerflow-typography-matrix.svg +198 -0
- package/src/material/theme/tokens/cem-coupling.md +372 -0
- package/src/material/theme/tokens/cem-data-vs-reading-numerals.svg +164 -0
- package/src/material/theme/tokens/cem-dimension.md +625 -0
- package/src/material/theme/tokens/cem-layering.md +562 -0
- package/src/material/theme/tokens/cem-m3-parity.md +343 -0
- package/src/material/theme/tokens/cem-responsive.md +238 -0
- package/src/material/theme/tokens/cem-shape.md +691 -0
- package/src/material/theme/tokens/cem-stroke-density-illustration-4to1-v3.svg +102 -0
- package/src/material/theme/tokens/cem-stroke.md +480 -0
- package/src/material/theme/tokens/cem-timing.md +198 -0
- package/src/material/theme/tokens/cem-typography-model-stack.svg +64 -0
- package/src/material/theme/tokens/cem-voice-fonts-typography.md +718 -0
- package/src/material/theme/tokens/cem-voice-ladder.svg +91 -0
- package/src/material/theme/tokens/chips.png +0 -0
- package/src/material/theme/tokens/columns-page.png +0 -0
- package/src/material/theme/tokens/initials.png +0 -0
- package/src/material/theme/tokens/nav-buttons.png +0 -0
- package/src/material/theme/tokens/script.png +0 -0
- package/src/material/theme/tokens/sufler.png +0 -0
- package/src/material/theme/tokens/typography-icons.png +0 -0
- package/src/mocks/versions.mock.ts +1 -1
- package/src/stories/__screenshots__/dom-merge.test.stories.ts/dom-merge-dom-merge-OrderPreservingOn2ndTransform-1.png +0 -0
- package/src/stories/__screenshots__/xslt-conditionals.test.stories.ts/xslt-conditionals-xslt-conditionals-MultipleIfOrderingWorkaround-1.png +0 -0
- package/src/stories/dom-merge.test.stories.ts +25 -1
- package/src/stories/xslt-conditionals.test.stories.ts +492 -0
- package/src/stories/xslt-if.test.stories.ts +89 -0
- package/storybook-static/assets/{Color-F6OSRLHC-Cbp293x2.js → Color-F6OSRLHC-CzTOSlqB.js} +1 -1
- package/storybook-static/assets/{Configure-BrFr4SLE.js → Configure-7GqRsAoJ.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-CFRXHY34-DhHzJiIO.js → DocsRenderer-CFRXHY34-Duc5rSIm.js} +2 -2
- package/storybook-static/assets/{attributes.test.stories-Gg9LQTEK.js → attributes.test.stories-DYuxF8h1.js} +1 -1
- package/storybook-static/assets/{css.test.stories-B_3ltOrx.js → css.test.stories-LOmvINyb.js} +1 -1
- package/storybook-static/assets/{custom-element-CPnvJnn8.js → custom-element-Bwx7otrT.js} +6 -6
- package/storybook-static/assets/{dom-merge.test.stories-nQxcgLoM.js → dom-merge.test.stories-CEKhWjaS.js} +47 -6
- package/storybook-static/assets/entry-preview-BNCt9WBs.js +26 -0
- package/storybook-static/assets/{entry-preview-docs-Dwczwtsc.js → entry-preview-docs-CbF8-81D.js} +2 -2
- package/storybook-static/assets/{external-template.test.stories-DZ-rjnfd.js → external-template.test.stories-jHu0wsJ-.js} +1 -1
- package/storybook-static/assets/{form.test.stories-DQhPYtMj.js → form.test.stories-CUyUnmwP.js} +1 -1
- package/storybook-static/assets/{frame.canvas-ClTqYyMN.js → frame.canvas-E5n9h6j1.js} +1 -1
- package/storybook-static/assets/{handlers-CLkps6Nz.js → handlers-F7GUfMqr.js} +1 -1
- package/storybook-static/assets/http-request-BWeEEBkP.js +1 -0
- package/storybook-static/assets/{http-request.stories-jo0f73nw.js → http-request.stories-wyX5-QOv.js} +1 -1
- package/storybook-static/assets/{iframe-CZwRpnn9.js → iframe-BS_DPWl0.js} +11 -11
- package/storybook-static/assets/{index-Dr4PwNfd.js → index-CGuyH0k-.js} +87 -87
- package/storybook-static/assets/{index-CJQtnF9V.js → index-DB7LLObI.js} +1 -1
- package/storybook-static/assets/index-DO1nmyvI.js +11 -0
- package/storybook-static/assets/{index-B68YUdzy.js → index-V1EGs-wm.js} +3 -3
- package/storybook-static/assets/{local-storage.test.stories-uA5EKRPf.js → local-storage.test.stories-BxOhsf1k.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-Cu-6Elcg.js → location-element.test.stories-DqhvvUoa.js} +1 -1
- package/storybook-static/assets/{module-url.test.stories-CD_wusXQ.js → module-url.test.stories-C1gG9G7Y.js} +1 -1
- package/storybook-static/assets/{preview-BFlNN3Wj.js → preview-Bn8igYMp.js} +1 -1
- package/storybook-static/assets/{preview-CuCH40jj.js → preview-Cwy1XFu2.js} +2 -2
- package/storybook-static/assets/{preview-Cm4PPhHS.js → preview-D6sehqkw.js} +1 -1
- package/storybook-static/assets/{set-url.test.stories-CY7B9BVZ.js → set-url.test.stories-BKQNdknJ.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-BVnPXm6e.js → slice-events.test.stories-ChqULCeA.js} +1 -1
- package/storybook-static/assets/{slots.test.stories-Dxsa9KdA.js → slots.test.stories-BlyLoCRe.js} +1 -1
- package/storybook-static/assets/{version-select.test.stories-Buga1PAa.js → version-select.test.stories-CPGSh1tR.js} +1 -1
- package/storybook-static/assets/xslt-conditionals.test.stories-YC6QPqWZ.js +633 -0
- package/storybook-static/assets/xslt-if.test.stories-BRSWy2-x.js +71 -0
- package/storybook-static/demo/a.html +10 -3
- package/storybook-static/demo/a.svg +26 -26
- package/storybook-static/demo/html-template.html +4 -3
- package/storybook-static/demo/s.xml +3856 -67
- package/storybook-static/demo/s.xslt +13 -72
- package/storybook-static/demo/s1.xml +3706 -0
- package/storybook-static/iframe.html +2 -2
- package/storybook-static/index.json +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/essentials-controls-1/manager-bundle.js +69 -66
- package/storybook-static/sb-addons/essentials-docs-3/manager-bundle.js +62 -59
- package/dist/custom-element-6slVaFEs.cjs +0 -97
- package/dist/http-request-DPrY7mGh.cjs +0 -1
- package/storybook-static/assets/attributes.test.stories-CzWkKw0e.js +0 -1
- package/storybook-static/assets/entry-preview-DHVXbf3x.js +0 -26
- package/storybook-static/assets/external-template.test.stories-BivZqBTp.js +0 -1
- package/storybook-static/assets/http-request-DNq59pnj.js +0 -1
- package/storybook-static/assets/index-BwkS7JH_.js +0 -8
- package/storybook-static/assets/module-url.test.stories-CTjUAk3J.js +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const K = "http://www.w3.org/1999/XSL/Transform", R = "http://www.w3.org/1999/xhtml",
|
|
1
|
+
const K = "http://www.w3.org/1999/XSL/Transform", R = "http://www.w3.org/1999/xhtml", ye = "http://exslt.org/common", d = (e, s) => e?.getAttribute?.(s), se = (e) => e.nodeType === 3, ge = (e) => typeof e == "string", le = (e) => e && typeof e.nodeType == "number", L = (e, s) => (e.ownerDocument || e).createTextNode(s), ce = (e) => {
|
|
2
2
|
for (; e.firstChild; ) e.firstChild.remove();
|
|
3
3
|
return e;
|
|
4
|
-
}, F = (e) => (e.getAttributeNames().map((
|
|
5
|
-
const
|
|
6
|
-
if (
|
|
7
|
-
return
|
|
8
|
-
const a =
|
|
4
|
+
}, F = (e) => (e.getAttributeNames().map((s) => e.removeAttribute(s)), ce(e)), me = (e) => (e?.setAttribute("xmlns:xsl", K), e), ue = (e) => (e?.setAttribute("xmlns:xhtml", R), me(e)), de = (e) => /^[_a-zA-Z][-_:a-zA-Z0-9]*$/.test(e), ne = (e, s) => (Object.keys(s).map((t) => e[t] = s[t]), e), C = (e, s = "", t = document) => {
|
|
5
|
+
const l = (n) => ((o) => (s && o.append(L(t.ownerDocument || t, s)), o))((t.ownerDocument || t).createElement(n));
|
|
6
|
+
if (de(e))
|
|
7
|
+
return l(e);
|
|
8
|
+
const a = l("dce-object");
|
|
9
9
|
return a.setAttribute("dce-object-name", e), a;
|
|
10
|
-
},
|
|
11
|
-
const t = e.ownerDocument.createElementNS(e.namespaceURI,
|
|
12
|
-
for (let
|
|
13
|
-
t.setAttribute(
|
|
14
|
-
for (let
|
|
15
|
-
t.append(
|
|
10
|
+
}, ae = (e, s) => {
|
|
11
|
+
const t = e.ownerDocument.createElementNS(e.namespaceURI, s);
|
|
12
|
+
for (let l of e.attributes)
|
|
13
|
+
t.setAttribute(l.name, l.value);
|
|
14
|
+
for (let l of e.childNodes)
|
|
15
|
+
t.append(l.cloneNode(!0));
|
|
16
16
|
return t;
|
|
17
17
|
};
|
|
18
18
|
function U(e) {
|
|
@@ -21,66 +21,70 @@ function U(e) {
|
|
|
21
21
|
function q(e) {
|
|
22
22
|
return new XMLSerializer().serializeToString(e);
|
|
23
23
|
}
|
|
24
|
-
function B(e,
|
|
25
|
-
const a = (
|
|
26
|
-
return [...t].forEach((
|
|
24
|
+
function B(e, s, t, l) {
|
|
25
|
+
const a = (y) => e.ownerDocument.createElement(y), o = ((y, x, v) => (x.append(v = a(y)), v))(s, e);
|
|
26
|
+
return [...t].forEach((y) => o.append(l(y))), o;
|
|
27
27
|
}
|
|
28
28
|
function Ae(e) {
|
|
29
|
-
return e.slot || (e.setAttribute || (e =
|
|
29
|
+
return e.slot || (e.setAttribute || (e = C("span", e.textContent.replaceAll(`
|
|
30
30
|
`, ""))), e.setAttribute("slot", "")), e;
|
|
31
31
|
}
|
|
32
|
-
function J(e,
|
|
33
|
-
e.getAttributeNames().forEach((t) =>
|
|
32
|
+
function J(e, s) {
|
|
33
|
+
e.getAttributeNames().forEach((t) => s.includes(t) || e.removeAttribute(t));
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
function I(e,
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
40
|
-
if (
|
|
41
|
-
return
|
|
35
|
+
const ie = (e) => [...e].filter((s) => !(s.nodeType === 3 && s.data.trim() === ""));
|
|
36
|
+
function I(e, s, t) {
|
|
37
|
+
const l = typeof e;
|
|
38
|
+
if (l === "string")
|
|
39
|
+
return C(s, e, t);
|
|
40
|
+
if (l === "number")
|
|
41
|
+
return C(s, "" + e, t);
|
|
42
|
+
if (le(e)) {
|
|
43
|
+
const n = C(s);
|
|
44
|
+
return n.append(e), n;
|
|
45
|
+
}
|
|
42
46
|
if (e instanceof Array) {
|
|
43
|
-
const n =
|
|
44
|
-
return e.map((o) => n.append(I(o,
|
|
47
|
+
const n = C("array", "", t);
|
|
48
|
+
return e.map((o) => n.append(I(o, s, t))), n;
|
|
45
49
|
}
|
|
46
50
|
if (e instanceof FormData) {
|
|
47
|
-
const n =
|
|
51
|
+
const n = C("form-data", "", t);
|
|
48
52
|
for (const o of e)
|
|
49
53
|
n.append(I(o[1], o[0], t));
|
|
50
54
|
return n;
|
|
51
55
|
}
|
|
52
|
-
const a =
|
|
56
|
+
const a = C(s, "", t);
|
|
53
57
|
for (let n in e)
|
|
54
|
-
|
|
58
|
+
typeof e[n] == "function" || e[n] instanceof Window || le(e[n]) && !(n === "data" || n === "value") || (typeof e[n] != "object" && de(n) ? a.setAttribute(n, e[n]) : a.append(I(e[n], n, t)));
|
|
55
59
|
return a;
|
|
56
60
|
}
|
|
57
|
-
function
|
|
58
|
-
if (z(e, "*", (
|
|
59
|
-
const
|
|
61
|
+
function re(e) {
|
|
62
|
+
if (z(e, "*", (s) => [...s.childNodes].filter((t) => t.nodeType === 3 && t.parentNode.localName !== "style" && t.data).forEach((t) => {
|
|
63
|
+
const l = t.data, a = l.matchAll(/{([^}]*)}/g);
|
|
60
64
|
if (a) {
|
|
61
|
-
let n = 0, o = (x) => L(t, x),
|
|
65
|
+
let n = 0, o = (x) => L(t, x), y = [];
|
|
62
66
|
if ([...a].forEach((x) => {
|
|
63
|
-
x.index > n &&
|
|
67
|
+
x.index > n && y.push(o(x.input.substring(n, x.index)));
|
|
64
68
|
const v = e.querySelector("value-of").cloneNode();
|
|
65
|
-
v.setAttribute("select", x[1]),
|
|
66
|
-
}), n <
|
|
67
|
-
for (let x of
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
v.setAttribute("select", x[1]), y.push(v), n = x.index + x[0].length;
|
|
70
|
+
}), n < l.length && y.push(o(l.substring(n, l.length))), y.length) {
|
|
71
|
+
for (let x of y)
|
|
72
|
+
s.insertBefore(x, t);
|
|
73
|
+
s.removeChild(t);
|
|
70
74
|
}
|
|
71
75
|
}
|
|
72
76
|
})), "all" in e) {
|
|
73
|
-
let
|
|
77
|
+
let s = 1;
|
|
74
78
|
for (let t of e.all)
|
|
75
|
-
t.setAttribute && !t.tagName.startsWith("xsl:") && t.setAttribute("data-dce-id", "" +
|
|
79
|
+
t.setAttribute && !t.tagName.startsWith("xsl:") && t.setAttribute("data-dce-id", "" + s++);
|
|
76
80
|
}
|
|
77
81
|
return e;
|
|
78
82
|
}
|
|
79
|
-
function ve(e,
|
|
80
|
-
const t = [],
|
|
81
|
-
if (e.tagName ===
|
|
82
|
-
return
|
|
83
|
-
const n = U(`<xsl:stylesheet version="1.0" xmlns:xsl="${K}" xmlns:xhtml="${R}" xmlns:exsl="${
|
|
83
|
+
function ve(e, s = "xsl:stylesheet") {
|
|
84
|
+
const t = [], l = {}, a = {};
|
|
85
|
+
if (e.tagName === s || e.documentElement?.tagName === s)
|
|
86
|
+
return re(ne(e, { declaredAttributes: t, hardcodedAttributes: l, exposedAttributes: a }));
|
|
87
|
+
const n = U(`<xsl:stylesheet version="1.0" xmlns:xsl="${K}" xmlns:xhtml="${R}" xmlns:exsl="${ye}" exclude-result-prefixes="exsl" >
|
|
84
88
|
<xsl:output method="xml"/>
|
|
85
89
|
<xsl:template match="/"><dce-root xmlns="${R}"><xsl:apply-templates select="*" /></dce-root></xsl:template>
|
|
86
90
|
<xsl:template match="*[name()='template']">
|
|
@@ -136,21 +140,21 @@ function ve(e, l = "xsl:stylesheet") {
|
|
|
136
140
|
</xsl:copy>
|
|
137
141
|
</xsl:for-each>
|
|
138
142
|
</xsl:template>
|
|
139
|
-
</xsl:stylesheet>`), o = new XSLTProcessor(),
|
|
143
|
+
</xsl:stylesheet>`), o = new XSLTProcessor(), y = ((i) => {
|
|
140
144
|
z(i, "custom-element", (h) => {
|
|
141
145
|
h.firstElementChild.localName === "template" && ([...h.firstElementChild.content.childNodes].forEach((b) => h.append(b)), h.firstElementChild.remove());
|
|
142
146
|
}), z(i, "script", (h) => h.remove());
|
|
143
147
|
const r = i.content ?? i.firstElementChild?.content ?? i.body ?? i;
|
|
144
148
|
Le.forEach((h) => z(r, h, (b) => De(b, r)));
|
|
145
|
-
const f = i.firstElementChild?.content || i.content,
|
|
149
|
+
const f = i.firstElementChild?.content || i.content, g = (h) => {
|
|
146
150
|
const b = U("<xhtml/>"), T = b.importNode(h, !0);
|
|
147
|
-
return b.replaceChild(T, b.documentElement), T.namespaceURI === R && !d(T, "xmlns") && T.setAttribute("xmlns", R),
|
|
151
|
+
return b.replaceChild(T, b.documentElement), T.namespaceURI === R && !d(T, "xmlns") && T.setAttribute("xmlns", R), ue(T);
|
|
148
152
|
};
|
|
149
153
|
if (f) {
|
|
150
|
-
const h =
|
|
151
|
-
return [...f.childNodes].map((b) => h.append(b.cloneNode(!0))),
|
|
154
|
+
const h = C("div");
|
|
155
|
+
return [...f.childNodes].map((b) => h.append(b.cloneNode(!0))), g(h);
|
|
152
156
|
}
|
|
153
|
-
return
|
|
157
|
+
return g(i.documentElement || i.body || i);
|
|
154
158
|
})(e), x = U(
|
|
155
159
|
`<xsl:stylesheet version="1.0"
|
|
156
160
|
xmlns:xsl="${K}"
|
|
@@ -189,9 +193,9 @@ function ve(e, l = "xsl:stylesheet") {
|
|
|
189
193
|
</xsl:stylesheet>`
|
|
190
194
|
);
|
|
191
195
|
o.importStylesheet(n);
|
|
192
|
-
const v = o.transformToFragment(
|
|
196
|
+
const v = o.transformToFragment(y, document), u = (i, r) => i.querySelector(r), w = u(x, 'template[mode="payload"]');
|
|
193
197
|
if (!v)
|
|
194
|
-
return console.error("transformation error", { xml:
|
|
198
|
+
return console.error("transformation error", { xml: y.outerHTML, xsl: q(n) });
|
|
195
199
|
if (v.firstElementChild.localName !== "dce-root") {
|
|
196
200
|
const i = v.ownerDocument.createElement("dce-root");
|
|
197
201
|
[...v.childNodes].forEach((r) => i.append(r)), v.append(i);
|
|
@@ -199,7 +203,7 @@ function ve(e, l = "xsl:stylesheet") {
|
|
|
199
203
|
[...v.querySelectorAll("[test]")].forEach((i) => {
|
|
200
204
|
const r = d(i, "test"), f = r.replace(
|
|
201
205
|
/hasBoolAttribute\((.*?)\)/g,
|
|
202
|
-
(
|
|
206
|
+
(g, h, b, T, M) => {
|
|
203
207
|
const D = h.substring(1);
|
|
204
208
|
return `(not($${D} = 'false') and ($${D} = '' or $${D} = '${D}' or $${D} = 'true' ))`;
|
|
205
209
|
}
|
|
@@ -207,24 +211,24 @@ function ve(e, l = "xsl:stylesheet") {
|
|
|
207
211
|
r !== f && i.setAttribute("test", f);
|
|
208
212
|
}), [...v.querySelectorAll("dce-root>attribute")].forEach((i) => {
|
|
209
213
|
J(i, "namespace,name,select");
|
|
210
|
-
const r =
|
|
211
|
-
if (t.push(f), i.childNodes.length && (
|
|
214
|
+
const r = ae(i, "xsl:param"), f = d(i, "name");
|
|
215
|
+
if (t.push(f), i.childNodes.length && (l[f] = i.textContent), w.append(r), i.hasAttribute("select")) {
|
|
212
216
|
a[f] = d(i, "select"), J(r, "select,name");
|
|
213
|
-
let
|
|
214
|
-
if (
|
|
217
|
+
let g = d(i, "select").split("??"), h;
|
|
218
|
+
if (g?.length > 1) {
|
|
215
219
|
r.removeAttribute("select");
|
|
216
220
|
const b = u(x, 'template[match="ignore"]>choose').cloneNode(!0);
|
|
217
|
-
F(b.firstElementChild).append(L(b, "{" +
|
|
218
|
-
for (let T = 1; T <
|
|
221
|
+
F(b.firstElementChild).append(L(b, "{" + g[0] + "}")), b.firstElementChild.setAttribute("test", g[0]);
|
|
222
|
+
for (let T = 1; T < g.length - 1; T++) {
|
|
219
223
|
const M = b.firstElementChild.cloneNode(!0);
|
|
220
|
-
F(M).append(L(b, "{" +
|
|
224
|
+
F(M).append(L(b, "{" + g[T] + "}")), M.setAttribute("test", g[T]), b.insertBefore(M, b.lastElementChild);
|
|
221
225
|
}
|
|
222
|
-
F(b.lastElementChild).append(L(b, "{" +
|
|
226
|
+
F(b.lastElementChild).append(L(b, "{" + g[g.length - 1] + "}")), r.append(b), h = b.cloneNode(!0);
|
|
223
227
|
} else
|
|
224
|
-
h =
|
|
228
|
+
h = ae(i, "xsl:value-of");
|
|
225
229
|
h.removeAttribute("name"), i.append(h), i.removeAttribute("select");
|
|
226
230
|
} else
|
|
227
|
-
J(r, "name"), r.setAttribute("select", "/datadom/attributes/" + f),
|
|
231
|
+
J(r, "name"), r.setAttribute("select", "/datadom/attributes/" + f), l[f] || i.remove();
|
|
228
232
|
}), [...v.querySelectorAll("[value]")].filter((i) => i.getAttribute("value").match(/\{(.*)\?\?(.*)\}/g)).forEach((i) => {
|
|
229
233
|
const r = d(i, "value");
|
|
230
234
|
r && i.setAttribute("value", $e(r));
|
|
@@ -235,51 +239,51 @@ function ve(e, l = "xsl:stylesheet") {
|
|
|
235
239
|
const O = u(x, 'call-template[name="slot"]'), H = (i) => {
|
|
236
240
|
const r = O.cloneNode(!0), f = d(i, "name");
|
|
237
241
|
f && r.firstElementChild.setAttribute("select", `'${f}'`);
|
|
238
|
-
for (let
|
|
239
|
-
r.lastElementChild.append(
|
|
242
|
+
for (let g of i.childNodes)
|
|
243
|
+
r.lastElementChild.append(g);
|
|
240
244
|
return r;
|
|
241
245
|
};
|
|
242
246
|
z(w, "slot", (i) => i.parentNode.replaceChild(H(i), i));
|
|
243
|
-
const p =
|
|
244
|
-
return
|
|
247
|
+
const p = re(x);
|
|
248
|
+
return ne(p, { declaredAttributes: t, hardcodedAttributes: l, exposedAttributes: a }), p;
|
|
245
249
|
}
|
|
246
250
|
async function Ee(e) {
|
|
247
|
-
return await new Promise((t,
|
|
251
|
+
return await new Promise((t, l) => {
|
|
248
252
|
const a = new XMLHttpRequest();
|
|
249
253
|
a.open("GET", e), a.responseType = "document", a.onload = () => {
|
|
250
|
-
a.readyState === a.DONE && a.status === 200 ? t(a.responseXML?.body || a.responseXML ||
|
|
251
|
-
}, a.addEventListener("error", (n) =>
|
|
254
|
+
a.readyState === a.DONE && a.status === 200 ? t(a.responseXML?.body || a.responseXML || C("div", a.responseText)) : l(`${a.statusText} - ${e}`);
|
|
255
|
+
}, a.addEventListener("error", (n) => l(n)), a.send();
|
|
252
256
|
});
|
|
253
257
|
}
|
|
254
|
-
function Ne(e,
|
|
255
|
-
if (e ===
|
|
258
|
+
function Ne(e, s, t = !1) {
|
|
259
|
+
if (e === s)
|
|
256
260
|
return !0;
|
|
257
|
-
if (typeof e != "object" || e === null || typeof
|
|
261
|
+
if (typeof e != "object" || e === null || typeof s != "object" || s === null || Object.keys(e).length !== Object.keys(s).length)
|
|
258
262
|
return t;
|
|
259
|
-
for (let
|
|
260
|
-
if (!(
|
|
263
|
+
for (let l in e)
|
|
264
|
+
if (!(l in s) || !Ne(e[l], s[l]))
|
|
261
265
|
return t;
|
|
262
266
|
return !0;
|
|
263
267
|
}
|
|
264
|
-
const
|
|
265
|
-
let
|
|
268
|
+
const pe = (e) => e.split("|").map((s) => s.trim()).filter((s) => s), we = (e, s) => pe(s).map((t) => {
|
|
269
|
+
let l = e.ownerDocument, a = (n) => (e.append(n), n);
|
|
266
270
|
if (t.includes("/")) {
|
|
267
|
-
const n = [], o =
|
|
268
|
-
for (let
|
|
269
|
-
n.push(
|
|
271
|
+
const n = [], o = l.evaluate(t, e);
|
|
272
|
+
for (let y; y = o.iterateNext(); )
|
|
273
|
+
n.push(y);
|
|
270
274
|
return n;
|
|
271
275
|
}
|
|
272
|
-
return [...e.childNodes].find((n) => n.localName === t) || a(
|
|
276
|
+
return [...e.childNodes].find((n) => n.localName === t) || a(C(t, "", l));
|
|
273
277
|
}).flat();
|
|
274
|
-
function
|
|
278
|
+
function oe(e, s, t, l) {
|
|
275
279
|
if (!t.sliceProcessed)
|
|
276
|
-
return t.sliceProcessed = 1, we(e,
|
|
277
|
-
const n = e.ownerDocument, o = t.sliceEventSource,
|
|
280
|
+
return t.sliceProcessed = 1, we(e, s ?? "").map((a) => {
|
|
281
|
+
const n = e.ownerDocument, o = t.sliceEventSource, y = t.sliceElement, x = () => [...a.childNodes].filter((u) => u.nodeType === 3 || u.localName === "value" || u.localName === "form-data").map((u) => u.remove());
|
|
278
282
|
o.getAttributeNames().map((u) => a.setAttribute(u, d(o, u))), [...a.childNodes].filter((u) => u.localName === "event").map((u) => u.remove()), "validationMessage" in o && a.setAttribute("validation-message", o.validationMessage), t.type === "init" && x(), a.append(I(t, "event", n));
|
|
279
283
|
const v = (o.type === "checkbox" || o.type === "radio") && !o.checked;
|
|
280
|
-
if (
|
|
284
|
+
if (y.hasAttribute("slice-value")) {
|
|
281
285
|
o.value === void 0 ? a.removeAttribute("value") : a.setAttribute("value", o.value);
|
|
282
|
-
const u = v ? "" : P(d(
|
|
286
|
+
const u = v ? "" : P(d(y, "slice-value"), a);
|
|
283
287
|
x(), a.append(L(n, u));
|
|
284
288
|
} else {
|
|
285
289
|
if ("elements" in o)
|
|
@@ -288,130 +292,136 @@ function re(e, l, t, s) {
|
|
|
288
292
|
if (x(), u == null)
|
|
289
293
|
[...a.childNodes].filter((w) => w.localName !== "event").map((w) => w.remove()), a.removeAttribute("value");
|
|
290
294
|
else {
|
|
291
|
-
const w =
|
|
295
|
+
const w = ge(u) ? L(n, u) : I(u, "value", a.ownerDocument);
|
|
292
296
|
a.append(w), a.setAttribute("value", u);
|
|
293
297
|
}
|
|
294
298
|
}
|
|
295
299
|
return a;
|
|
296
300
|
});
|
|
297
301
|
}
|
|
298
|
-
function z(e,
|
|
299
|
-
e.querySelectorAll && [...e.querySelectorAll(
|
|
302
|
+
function z(e, s, t) {
|
|
303
|
+
e.querySelectorAll && [...e.querySelectorAll(s)].forEach(t);
|
|
300
304
|
}
|
|
301
|
-
const Te = async (e,
|
|
305
|
+
const Te = async (e, s) => {
|
|
302
306
|
if (!e || !e.trim())
|
|
303
|
-
return [
|
|
307
|
+
return [s];
|
|
304
308
|
if (e.startsWith("#"))
|
|
305
309
|
return ((t) => {
|
|
306
|
-
const
|
|
307
|
-
return [...
|
|
308
|
-
})(
|
|
310
|
+
const l = t.querySelectorAll(e);
|
|
311
|
+
return [...l.length ? l : t.getRootNode().querySelectorAll(e)];
|
|
312
|
+
})(s.parentElement);
|
|
309
313
|
try {
|
|
310
|
-
const [t,
|
|
314
|
+
const [t, l] = e.split("#");
|
|
311
315
|
if (e.charAt(0) === ".")
|
|
312
|
-
e = new URL(t,
|
|
316
|
+
e = new URL(t, s.closest("[base]")?.getAttribute("base") || location).href;
|
|
313
317
|
else
|
|
314
318
|
try {
|
|
315
|
-
e = import.meta.resolve(t),
|
|
319
|
+
e = import.meta.resolve(t), l && (e += "#" + l);
|
|
316
320
|
} catch (n) {
|
|
317
321
|
console.error(n.message);
|
|
318
322
|
}
|
|
319
323
|
const a = await Ee(e);
|
|
320
|
-
if (
|
|
321
|
-
const n = a.querySelectorAll("#" +
|
|
322
|
-
return n.length ? [...n] : (console.error("template not found", e + "#" +
|
|
324
|
+
if (s.setAttributeNS("xml", "base", e), l) {
|
|
325
|
+
const n = a.querySelectorAll("#" + l);
|
|
326
|
+
return n.length ? [...n] : (console.error("template not found", e + "#" + l), [s]);
|
|
323
327
|
}
|
|
324
328
|
return [a];
|
|
325
329
|
} catch {
|
|
326
|
-
return [
|
|
330
|
+
return [s];
|
|
327
331
|
}
|
|
328
332
|
};
|
|
329
|
-
function
|
|
333
|
+
function fe(e, s) {
|
|
330
334
|
for (let n of e.attributes)
|
|
331
335
|
try {
|
|
332
336
|
const o = n.name;
|
|
333
|
-
|
|
337
|
+
if (o.startsWith("xmlns"))
|
|
338
|
+
continue;
|
|
339
|
+
n.namespaceURI ? (!s.hasAttributeNS(n.namespaceURI, o) || s.getAttributeNS(n.namespaceURI, o) !== n.value) && s.setAttributeNS(n.namespaceURI, o, n.value) : (!s.hasAttribute(o) || s.getAttribute(o) !== n.value) && s.setAttribute(n.name, n.value), n.name === "value" && (s.value = n.value);
|
|
334
340
|
} catch (o) {
|
|
335
341
|
console.warn("attribute assignment error", o?.message || o);
|
|
336
342
|
}
|
|
337
|
-
const t =
|
|
338
|
-
for (let n of
|
|
339
|
-
!e.hasAttribute(n) && !t?.has(n) && !a?.has(n) &&
|
|
343
|
+
const t = s.dceExportedAttributes, l = s.getAttribute("dce-exported-attributes"), a = l ? new Set(l.split(" ")) : null;
|
|
344
|
+
for (let n of s.getAttributeNames())
|
|
345
|
+
!e.hasAttribute(n) && !t?.has(n) && !a?.has(n) && s.removeAttribute(n);
|
|
340
346
|
}
|
|
341
|
-
function
|
|
347
|
+
function he(e, s = 0) {
|
|
342
348
|
const t = {};
|
|
343
|
-
for (const
|
|
344
|
-
const a = d(
|
|
349
|
+
for (const l of e.childNodes) {
|
|
350
|
+
const a = d(l, "data-dce-id") || l.dceId || 0;
|
|
345
351
|
if (!t[a])
|
|
346
|
-
a ? t[a] = 1 : (t[a] =
|
|
352
|
+
a ? t[a] = 1 : (t[a] = l.dceId = ++s, l.setAttribute && l.setAttribute("data-dce-id", l.dceId));
|
|
347
353
|
else {
|
|
348
|
-
const n =
|
|
349
|
-
|
|
354
|
+
const n = l.dceId = a + "-" + t[a]++;
|
|
355
|
+
l.setAttribute && l.setAttribute("data-dce-id", n);
|
|
350
356
|
}
|
|
351
|
-
|
|
357
|
+
l.childNodes.length && he(l);
|
|
352
358
|
}
|
|
353
359
|
}
|
|
354
|
-
function Se(e,
|
|
360
|
+
function Se(e, s, t) {
|
|
355
361
|
t = 1 * t;
|
|
356
|
-
for (let
|
|
357
|
-
if ((
|
|
358
|
-
return e.insertBefore(
|
|
359
|
-
e.append(
|
|
362
|
+
for (let l of e.childNodes)
|
|
363
|
+
if ((l.dceId ?? l.getAttribute("data-dce-id") * 1) > t)
|
|
364
|
+
return e.insertBefore(s, l);
|
|
365
|
+
e.append(s);
|
|
360
366
|
}
|
|
361
|
-
function
|
|
362
|
-
if (e.firstElementChild?.localName === "dce-root" &&
|
|
367
|
+
function xe(e, s) {
|
|
368
|
+
if (e.firstElementChild?.localName === "dce-root" && s[0]?.localName !== "dce-root")
|
|
363
369
|
return;
|
|
364
|
-
if (!
|
|
365
|
-
return e.firstElementChild?.localName !== "dce-root" &&
|
|
370
|
+
if (!s.length)
|
|
371
|
+
return e.firstElementChild?.localName !== "dce-root" && ce(e);
|
|
366
372
|
const t = {};
|
|
367
|
-
for (let
|
|
368
|
-
t[
|
|
369
|
-
for (let
|
|
370
|
-
const a = d(
|
|
371
|
-
n ? (se(
|
|
373
|
+
for (let l of e.childNodes)
|
|
374
|
+
t[l.dceId], se(l) ? (l.data.trim(), t[l.dceId || 0] = l) : t[d(l, "data-dce-id") || 0] = l;
|
|
375
|
+
for (let l of [...s]) {
|
|
376
|
+
const a = d(l, "data-dce-id") || l.dceId, n = t[a];
|
|
377
|
+
n ? (se(l) ? n.nodeValue !== l.nodeValue && (n.nodeValue = l.nodeValue) : (fe(l, n), (n.childNodes.length || l.childNodes.length) && xe(n, l.childNodes)), delete t[a]) : Se(e, l, a);
|
|
372
378
|
}
|
|
373
|
-
for (let
|
|
374
|
-
|
|
379
|
+
for (let l of Object.values(t))
|
|
380
|
+
l.localName !== "dce-root" && l.remove();
|
|
375
381
|
}
|
|
376
|
-
function Ce(e,
|
|
377
|
-
return e.hasAttribute(
|
|
382
|
+
function Ce(e, s) {
|
|
383
|
+
return e.hasAttribute(s) || e.setAttribute(s, crypto.randomUUID()), e.getAttribute(s);
|
|
378
384
|
}
|
|
379
385
|
const $e = (e) => [...e?.matchAll(/([^{}]*)(\{)([^}]+)}([^{}]*)/g)].map((t) => `${t[1]}{${Q(t[3])}}${t[4]}`).join(""), Q = (e) => {
|
|
380
386
|
if (!e.trim())
|
|
381
387
|
return e;
|
|
382
|
-
const
|
|
383
|
-
return
|
|
384
|
-
}, P = (e,
|
|
388
|
+
const s = e.split("??"), t = s.shift(), l = Q(s.join("??"));
|
|
389
|
+
return s.length ? `concat( ${t} , substring( ${l} , (1+string-length( ${l} )) * string-length( ${t} ) ) )` : e;
|
|
390
|
+
}, P = (e, s) => {
|
|
385
391
|
const t = e.split("??");
|
|
386
392
|
if (t.length > 1)
|
|
387
|
-
return P(t[0],
|
|
393
|
+
return P(t[0], s) || P(t[1], s);
|
|
388
394
|
e = Q(e);
|
|
389
|
-
const
|
|
390
|
-
switch (
|
|
395
|
+
const l = s.ownerDocument.evaluate(e, s);
|
|
396
|
+
switch (l.resultType) {
|
|
391
397
|
case XPathResult.NUMBER_TYPE:
|
|
392
|
-
return
|
|
398
|
+
return l.numberValue;
|
|
393
399
|
case XPathResult.STRING_TYPE:
|
|
394
|
-
return
|
|
400
|
+
return l.stringValue;
|
|
395
401
|
case XPathResult.BOOLEAN_TYPE:
|
|
396
|
-
return
|
|
402
|
+
return l.booleanValue;
|
|
397
403
|
}
|
|
398
404
|
let a = "";
|
|
399
|
-
for (let n; n =
|
|
405
|
+
for (let n; n = l.iterateNext(); )
|
|
400
406
|
a += n.textContent;
|
|
401
407
|
return a;
|
|
402
|
-
}, Le = "stylesheet,transform,import,include,strip-space,preserve-space,output,key,decimal-format,namespace-alias,value-of,copy-of,number,apply-templates,apply-imports,for-each,sort,if,choose,when,otherwise,attribute-set,call-template,with-param,variable,param,text,processing-instruction,element,attribute,comment,copy,message,fallback".split(","), De = (e,
|
|
403
|
-
const t =
|
|
404
|
-
for (let
|
|
405
|
-
t.setAttribute(
|
|
408
|
+
}, Le = "stylesheet,transform,import,include,strip-space,preserve-space,output,key,decimal-format,namespace-alias,value-of,copy-of,number,apply-templates,apply-imports,for-each,sort,if,choose,when,otherwise,attribute-set,call-template,with-param,variable,param,text,processing-instruction,element,attribute,comment,copy,message,fallback".split(","), De = (e, s) => {
|
|
409
|
+
const t = C("xsl:" + e.localName);
|
|
410
|
+
for (let a of e.attributes)
|
|
411
|
+
t.setAttribute(a.name, a.value);
|
|
406
412
|
for (; e.firstChild; )
|
|
407
413
|
t.append(e.firstChild);
|
|
414
|
+
const l = e.localName === "if" || e.localName === "choose" ? (() => {
|
|
415
|
+
const a = C("span");
|
|
416
|
+
return a.append(t), a;
|
|
417
|
+
})() : t;
|
|
408
418
|
if (e.parentElement)
|
|
409
|
-
e.parentElement.replaceChild(
|
|
419
|
+
e.parentElement.replaceChild(l, e);
|
|
410
420
|
else {
|
|
411
|
-
const
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
}),
|
|
421
|
+
const a = e.parentElement || s, n = [...a.childNodes];
|
|
422
|
+
n.forEach((o, y) => {
|
|
423
|
+
o === e && (n[y] = l);
|
|
424
|
+
}), a.replaceChildren(...n);
|
|
415
425
|
}
|
|
416
426
|
};
|
|
417
427
|
class je extends HTMLElement {
|
|
@@ -419,13 +429,13 @@ class je extends HTMLElement {
|
|
|
419
429
|
async connectedCallback() {
|
|
420
430
|
this.firstElementChild && this.firstElementChild.localName !== "template" && console.log(`custom-element used without template wrapping content
|
|
421
431
|
`, this.outerHTML);
|
|
422
|
-
const
|
|
423
|
-
for (const p of
|
|
432
|
+
const s = await Te(d(this, "src"), this), t = d(this, "tag"), l = t || "dce-" + crypto.randomUUID();
|
|
433
|
+
for (const p of s)
|
|
424
434
|
z(p.templateNode || p.content || p, "style", (i) => {
|
|
425
435
|
const r = i.closest("slot"), f = r ? `slot[name="${r.name}"]` : "";
|
|
426
|
-
i.innerHTML = `${
|
|
436
|
+
i.innerHTML = `${l} ${f}{${i.innerHTML}}`, this.append(i);
|
|
427
437
|
});
|
|
428
|
-
const a =
|
|
438
|
+
const a = s.map((p) => ve(p)), n = a.map((p, i) => {
|
|
429
439
|
i = new XSLTProcessor();
|
|
430
440
|
try {
|
|
431
441
|
i.importStylesheet(p);
|
|
@@ -436,7 +446,7 @@ class je extends HTMLElement {
|
|
|
436
446
|
});
|
|
437
447
|
Object.defineProperty(this, "xsltString", { get: () => a.map((p) => q(p)).join(`
|
|
438
448
|
`) });
|
|
439
|
-
const o = this,
|
|
449
|
+
const o = this, y = [...this.templateNode.querySelectorAll("[slice]")], x = y.map((p) => d(p, "slice")).filter((p) => !p.includes("/")).filter((p, i, r) => r.indexOf(p) === i).map(pe).flat(), { declaredAttributes: v, hardcodedAttributes: u, exposedAttributes: w } = a[0], ee = /* @__PURE__ */ new Set([...Object.keys(u), ...Object.keys(w)]);
|
|
440
450
|
class O extends HTMLElement {
|
|
441
451
|
static get observedAttributes() {
|
|
442
452
|
return v;
|
|
@@ -446,29 +456,29 @@ class je extends HTMLElement {
|
|
|
446
456
|
return ee;
|
|
447
457
|
}
|
|
448
458
|
connectedCallback() {
|
|
449
|
-
let i =
|
|
459
|
+
let i = ie(this.childNodes);
|
|
450
460
|
if (this.firstElementChild?.tagName === "TEMPLATE") {
|
|
451
461
|
this.firstElementChild !== this.lastElementChild && console.error("payload should have TEMPLATE as only child", this.outerHTML);
|
|
452
462
|
const c = this.firstElementChild;
|
|
453
|
-
c.remove(), i =
|
|
463
|
+
c.remove(), i = ie(c.content.childNodes);
|
|
454
464
|
for (const E of i)
|
|
455
465
|
if (E.localName === "style") {
|
|
456
466
|
const m = Ce(this, "data-dce-style");
|
|
457
|
-
E.innerHTML = `${
|
|
467
|
+
E.innerHTML = `${l}[data-dce-style="${m}"]{${E.innerHTML}}`, c.insertAdjacentElement("beforebegin", E);
|
|
458
468
|
} else
|
|
459
469
|
E.nodeType === 1 ? c.insertAdjacentElement("beforebegin", E) : E.nodeType === 3 && c.insertAdjacentText("beforebegin", E.data);
|
|
460
470
|
}
|
|
461
|
-
const r = U("<datadom/>").documentElement, f = (c, E = "") => ((m) => (E && m.append(L(r, E)), m))(r.ownerDocument.createElement(c)),
|
|
462
|
-
|
|
471
|
+
const r = U("<datadom/>").documentElement, f = (c, E = "") => ((m) => (E && m.append(L(r, E)), m))(r.ownerDocument.createElement(c)), g = B(r, "payload", i, Ae);
|
|
472
|
+
me(g), ue(g), this.innerHTML = "";
|
|
463
473
|
const h = B(r, "attributes", this.attributes, (c) => f(c.nodeName, c.value)), b = (c) => this.hasAttribute(c) || [...h.children].find((E) => E.localName === c);
|
|
464
|
-
|
|
474
|
+
fe(this, h), Object.keys(u).map((c) => b(c) || h.append(f(c, u[c]))), Object.keys(w).map((c) => b(c) || h.append(f(c))), B(r, "dataset", Object.keys(this.dataset), (c) => f(c, this.dataset[c]));
|
|
465
475
|
const T = B(r, "slice", x, (c) => f(c, "")), M = (c) => P(c, T);
|
|
466
476
|
this.xml = r;
|
|
467
477
|
const D = [], te = () => {
|
|
468
478
|
const c = {};
|
|
469
479
|
for (let E; E = D.pop(); ) {
|
|
470
480
|
const m = d(E.sliceElement, "slice");
|
|
471
|
-
c[m] || (
|
|
481
|
+
c[m] || (oe(T, m, E), c[m] = E);
|
|
472
482
|
}
|
|
473
483
|
Object.keys(c).length !== 0 && V();
|
|
474
484
|
};
|
|
@@ -490,7 +500,7 @@ class je extends HTMLElement {
|
|
|
490
500
|
xml:
|
|
491
501
|
`, q(r)), _;
|
|
492
502
|
}).map((A) => {
|
|
493
|
-
A && (
|
|
503
|
+
A && (he(A), xe(this, A.childNodes));
|
|
494
504
|
});
|
|
495
505
|
let N = 0;
|
|
496
506
|
return Object.entries(u).map(([A, S]) => {
|
|
@@ -520,9 +530,9 @@ xml:
|
|
|
520
530
|
z(this, "[slice],[slice-event]", (m) => {
|
|
521
531
|
let N = d(m, "slice-event");
|
|
522
532
|
const A = m.hasAttribute("slice-value") || m.hasAttribute("value") || m.value, S = E(m);
|
|
523
|
-
m.dceInitialized || (m.dceInitialized = 1, S.hasAttribute("custom-validity") && (N += " change submit"), [...new Set((N || "change").split(" "))].forEach((_) => S.addEventListener(_, (
|
|
524
|
-
|
|
525
|
-
const
|
|
533
|
+
m.dceInitialized || (m.dceInitialized = 1, S.hasAttribute("custom-validity") && (N += " change submit"), [...new Set((N || "change").split(" "))].forEach((_) => S.addEventListener(_, ($) => {
|
|
534
|
+
$.sliceElement = m, $.sliceEventSource = $.currentTarget || $.target, $.sliceProcessed = 0;
|
|
535
|
+
const be = oe(T, d($.sliceElement, "slice"), $);
|
|
526
536
|
z(this, "[custom-validity]", (k) => {
|
|
527
537
|
if (!k.setCustomValidity)
|
|
528
538
|
return;
|
|
@@ -536,11 +546,11 @@ xml:
|
|
|
536
546
|
});
|
|
537
547
|
const Y = d(S, "custom-validity"), j = Y && P(Y, h), G = j === !0 ? "" : j;
|
|
538
548
|
if (Y) {
|
|
539
|
-
if (m.setCustomValidity ? m.setCustomValidity(G) : m.validationMessage = G,
|
|
540
|
-
return j === !0 ? void 0 : (setTimeout(V, 1), !!j === j ? (j ||
|
|
549
|
+
if (m.setCustomValidity ? m.setCustomValidity(G) : m.validationMessage = G, be.map((k) => k.setAttribute("validation-message", G)), $.type === "submit")
|
|
550
|
+
return j === !0 ? void 0 : (setTimeout(V, 1), !!j === j ? (j || $.preventDefault(), j) : j ? ($.preventDefault(), !1) : void 0);
|
|
541
551
|
setTimeout(V, 1);
|
|
542
552
|
}
|
|
543
|
-
this.onSlice(
|
|
553
|
+
this.onSlice($);
|
|
544
554
|
})), (!N || N.includes("init")) && (A ? this.onSlice({ type: "init", target: S, sliceElement: m, sliceEventSource: S }) : m.value = M(d(m, "slice"))));
|
|
545
555
|
}), this.#e = 0;
|
|
546
556
|
};
|
|
@@ -549,8 +559,8 @@ xml:
|
|
|
549
559
|
#t(i, r) {
|
|
550
560
|
i === "value" && (this.value = r);
|
|
551
561
|
const f = this.xml.querySelector("attributes");
|
|
552
|
-
let
|
|
553
|
-
|
|
562
|
+
let g = this.xml.querySelector(`attributes>${i}`);
|
|
563
|
+
g ? F(g).append(L(g, r)) : (g = C(i, r, this.xml), f.append(g)), this.#e || f.setAttribute(i, r), this.dispatchEvent(new CustomEvent("change", { bubbles: !0, detail: { [i]: r } }));
|
|
554
564
|
}
|
|
555
565
|
attributeChangedCallback(i, r, f) {
|
|
556
566
|
!this.xml || this.#e || (this.#t(i, f), this.transform());
|
|
@@ -565,7 +575,7 @@ xml:
|
|
|
565
575
|
if (t)
|
|
566
576
|
H(t);
|
|
567
577
|
else {
|
|
568
|
-
const p =
|
|
578
|
+
const p = l;
|
|
569
579
|
this.setAttribute("tag", p), H(p);
|
|
570
580
|
const i = document.createElement(p);
|
|
571
581
|
this.getAttributeNames().forEach((r) => i.setAttribute(r, this.getAttribute(r))), i.append(...[...this.childNodes].filter((r) => r.localName !== "style")), this.append(i);
|
|
@@ -586,24 +596,24 @@ export {
|
|
|
586
596
|
je as C,
|
|
587
597
|
q as a,
|
|
588
598
|
ve as b,
|
|
589
|
-
|
|
599
|
+
ae as c,
|
|
590
600
|
Ee as d,
|
|
591
601
|
Ne as e,
|
|
592
602
|
we as f,
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
603
|
+
oe as g,
|
|
604
|
+
fe as h,
|
|
605
|
+
he as i,
|
|
596
606
|
Se as j,
|
|
597
|
-
|
|
607
|
+
xe as k,
|
|
598
608
|
Ce as l,
|
|
599
|
-
|
|
609
|
+
ne as m,
|
|
600
610
|
$e as n,
|
|
601
611
|
I as o,
|
|
602
612
|
Q as p,
|
|
603
613
|
P as q,
|
|
604
614
|
Le as r,
|
|
605
|
-
|
|
606
|
-
|
|
615
|
+
ie as s,
|
|
616
|
+
re as t,
|
|
607
617
|
De as u,
|
|
608
618
|
U as x
|
|
609
619
|
};
|