@esportsplus/template 0.16.8 → 0.16.9
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/build/attributes.js +4 -2
- package/package.json +1 -1
- package/src/attributes.ts +5 -2
package/build/attributes.js
CHANGED
|
@@ -41,7 +41,7 @@ function list(ctx, element, id, name, state, value) {
|
|
|
41
41
|
let hot = {};
|
|
42
42
|
if (value && typeof value === 'string') {
|
|
43
43
|
let part, parts = value.split(delimiter);
|
|
44
|
-
while (part = parts.pop()) {
|
|
44
|
+
while ((part = parts.pop()) !== undefined) {
|
|
45
45
|
part = part.trim();
|
|
46
46
|
if (part === '') {
|
|
47
47
|
continue;
|
|
@@ -152,7 +152,9 @@ const setList = (element, name, value, attributes = {}) => {
|
|
|
152
152
|
let ctx = context(element), store = ctx.store ??= {};
|
|
153
153
|
store[name] ??= new Set();
|
|
154
154
|
store[name + '.static'] ??= '';
|
|
155
|
-
|
|
155
|
+
if (attributes[name]) {
|
|
156
|
+
store[name + '.static'] += (store[name + '.static'] ? ATTRIBUTE_DELIMITERS[name] : '') + attributes[name];
|
|
157
|
+
}
|
|
156
158
|
if (typeof value === 'function') {
|
|
157
159
|
reactive(element, name, STATE_HYDRATING, value);
|
|
158
160
|
}
|
package/package.json
CHANGED
package/src/attributes.ts
CHANGED
|
@@ -77,7 +77,7 @@ function list(
|
|
|
77
77
|
let part: string | undefined,
|
|
78
78
|
parts = (value as string).split(delimiter);
|
|
79
79
|
|
|
80
|
-
while (part = parts.pop()) {
|
|
80
|
+
while ((part = parts.pop()) !== undefined) {
|
|
81
81
|
part = part.trim();
|
|
82
82
|
|
|
83
83
|
if (part === '') {
|
|
@@ -240,7 +240,10 @@ const setList = (element: Element, name: 'class' | 'style', value: unknown, attr
|
|
|
240
240
|
|
|
241
241
|
store[name] ??= new Set<string>();
|
|
242
242
|
store[name + '.static'] ??= '';
|
|
243
|
-
|
|
243
|
+
|
|
244
|
+
if (attributes[name]) {
|
|
245
|
+
store[name + '.static'] += (store[name + '.static'] ? ATTRIBUTE_DELIMITERS[name] : '') + attributes[name];
|
|
246
|
+
}
|
|
244
247
|
|
|
245
248
|
if (typeof value === 'function') {
|
|
246
249
|
reactive(element, name, STATE_HYDRATING, value);
|