@thi.ng/hdom 9.4.93 → 9.4.95
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/README.md +1 -1
- package/dom.d.ts +1 -1
- package/dom.js +11 -2
- package/package.json +12 -12
package/README.md
CHANGED
package/dom.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ export declare const setAttrib: (el: Element, id: string, val: any, attribs?: an
|
|
|
70
70
|
*/
|
|
71
71
|
export declare const updateValueAttrib: (el: HTMLInputElement, value: any) => void;
|
|
72
72
|
export declare const removeAttribs: (el: Element, attribs: string[], prev: any) => void;
|
|
73
|
-
export declare const setStyle: (el: Element,
|
|
73
|
+
export declare const setStyle: (el: Element, rules: any) => Element;
|
|
74
74
|
/**
|
|
75
75
|
* Adds event listener (possibly with options).
|
|
76
76
|
*
|
package/dom.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { deref } from "@thi.ng/api/deref";
|
|
1
2
|
import { implementsFunction } from "@thi.ng/checks/implements-function";
|
|
2
3
|
import { isArray } from "@thi.ng/checks/is-array";
|
|
4
|
+
import { isFunction } from "@thi.ng/checks/is-function";
|
|
3
5
|
import { isNotStringAndIterable } from "@thi.ng/checks/is-not-string-iterable";
|
|
4
6
|
import { isString } from "@thi.ng/checks/is-string";
|
|
5
7
|
import { ATTRIB_JOIN_DELIMS, SVG_TAGS } from "@thi.ng/hiccup/api";
|
|
6
|
-
import { css } from "@thi.ng/hiccup/css";
|
|
7
8
|
import { formatPrefixes } from "@thi.ng/hiccup/prefix";
|
|
8
9
|
import { XML_SVG } from "@thi.ng/prefixes/xml";
|
|
9
10
|
const __maybeInitElement = (el, tree) => tree.__init?.apply(tree.__this, [el, ...tree.__args]);
|
|
@@ -205,7 +206,15 @@ const removeAttribs = (el, attribs, prev) => {
|
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
208
|
};
|
|
208
|
-
const setStyle = (el,
|
|
209
|
+
const setStyle = (el, rules) => {
|
|
210
|
+
let v;
|
|
211
|
+
for (let r in rules) {
|
|
212
|
+
v = deref(rules[r]);
|
|
213
|
+
if (isFunction(v)) v = v(rules);
|
|
214
|
+
if (v != null) el.style.setProperty(r, v);
|
|
215
|
+
}
|
|
216
|
+
return el;
|
|
217
|
+
};
|
|
209
218
|
const setListener = (el, id, listener) => isString(listener) ? el.setAttribute("on" + id, listener) : isArray(listener) ? el.addEventListener(id, ...listener) : el.addEventListener(id, listener);
|
|
210
219
|
const removeListener = (el, id, listener) => isArray(listener) ? el.removeEventListener(id, ...listener) : el.removeEventListener(id, listener);
|
|
211
220
|
const clearDOM = (el) => el.innerHTML = "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/hdom",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.95",
|
|
4
4
|
"description": "Lightweight vanilla ES6 UI component trees with customizable branch-local behaviors",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -42,18 +42,18 @@
|
|
|
42
42
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@thi.ng/api": "^8.12.
|
|
46
|
-
"@thi.ng/checks": "^3.7.
|
|
47
|
-
"@thi.ng/diff": "^5.1.
|
|
48
|
-
"@thi.ng/equiv": "^2.1.
|
|
49
|
-
"@thi.ng/errors": "^2.5.
|
|
50
|
-
"@thi.ng/hiccup": "^5.3.
|
|
51
|
-
"@thi.ng/logger": "^3.2.
|
|
52
|
-
"@thi.ng/prefixes": "^2.3.
|
|
45
|
+
"@thi.ng/api": "^8.12.8",
|
|
46
|
+
"@thi.ng/checks": "^3.7.24",
|
|
47
|
+
"@thi.ng/diff": "^5.1.109",
|
|
48
|
+
"@thi.ng/equiv": "^2.1.98",
|
|
49
|
+
"@thi.ng/errors": "^2.5.48",
|
|
50
|
+
"@thi.ng/hiccup": "^5.3.31",
|
|
51
|
+
"@thi.ng/logger": "^3.2.7",
|
|
52
|
+
"@thi.ng/prefixes": "^2.3.59"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@thi.ng/atom": "^5.3.
|
|
56
|
-
"esbuild": "^0.
|
|
55
|
+
"@thi.ng/atom": "^5.3.49",
|
|
56
|
+
"esbuild": "^0.27.0",
|
|
57
57
|
"typedoc": "^0.28.14",
|
|
58
58
|
"typescript": "^5.9.3"
|
|
59
59
|
},
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
"status": "completed",
|
|
134
134
|
"year": 2015
|
|
135
135
|
},
|
|
136
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "be6e7657b1e5c54d7d648d1b52888a7297e95a17\n"
|
|
137
137
|
}
|