1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-07-01 04:12:14 +02:00

🐛 add missing cases for href, src, class, xlink:href, textContent, innerText

This commit is contained in:
2023-09-21 13:14:55 +02:00
parent 951f589ceb
commit 0794659104
5 changed files with 26 additions and 6 deletions

View File

@ -90,6 +90,7 @@
if (typeof a == "object" && a !== null && !Array.isArray(a))
switch (s) {
case "style":
case "dataset":
return N(r, a, T.bind(null, e[s]));
case "ariaset":
return N(r, a, (E, c) => i("aria-" + E, c));
@ -102,8 +103,12 @@
return s = s.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), i(s, a);
switch (s === "className" && (s = "class"), s) {
case "href":
case "src":
case "class":
case "xlink:href":
return i(s, a, "http://www.w3.org/1999/xlink");
case "textContent":
case "innerText":
return o ? e.appendChild(document.createTextNode(a)) : j(e, s, a);
}
return H(e, s) ? j(e, s, a) : i(s, a);

5
dist/dde.js vendored
View File

@ -86,6 +86,7 @@
if (typeof u == "object" && u !== null && !Array.isArray(u))
switch (f) {
case "style":
case "dataset":
return O(n, u, D.bind(null, e[f]));
case "ariaset":
return O(n, u, (E, o) => d("aria-" + E, o));
@ -98,8 +99,12 @@
return f = f.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), d(f, u);
switch (f === "className" && (f = "class"), f) {
case "href":
case "src":
case "class":
case "xlink:href":
return d(f, u, "http://www.w3.org/1999/xlink");
case "textContent":
case "innerText":
return c ? e.appendChild(document.createTextNode(u)) : R(e, f, u);
}
return _(e, f) ? R(e, f, u) : d(f, u);

View File

@ -88,6 +88,7 @@ function w(e, ...t) {
if (typeof a == "object" && a !== null && !Array.isArray(a))
switch (s) {
case "style":
case "dataset":
return N(r, a, T.bind(null, e[s]));
case "ariaset":
return N(r, a, (E, c) => i("aria-" + E, c));
@ -100,8 +101,12 @@ function w(e, ...t) {
return s = s.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), i(s, a);
switch (s === "className" && (s = "class"), s) {
case "href":
case "src":
case "class":
case "xlink:href":
return i(s, a, "http://www.w3.org/1999/xlink");
case "textContent":
case "innerText":
return o ? e.appendChild(document.createTextNode(a)) : j(e, s, a);
}
return H(e, s) ? j(e, s, a) : i(s, a);

5
dist/esm.js vendored
View File

@ -84,6 +84,7 @@ function x(e, ...t) {
if (typeof u == "object" && u !== null && !Array.isArray(u))
switch (f) {
case "style":
case "dataset":
return O(n, u, D.bind(null, e[f]));
case "ariaset":
return O(n, u, (E, o) => d("aria-" + E, o));
@ -96,8 +97,12 @@ function x(e, ...t) {
return f = f.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), d(f, u);
switch (f === "className" && (f = "class"), f) {
case "href":
case "src":
case "class":
case "xlink:href":
return d(f, u, "http://www.w3.org/1999/xlink");
case "textContent":
case "innerText":
return c ? e.appendChild(document.createTextNode(u)) : R(e, f, u);
}
return _(e, f) ? R(e, f, u) : d(f, u);