dom-render 1.0.48 → 1.0.49
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 +9 -1
- package/dist/bundle.js +21 -19
- package/dist/bundle.js.map +1 -1
- package/events/EventManager.js +21 -19
- package/package.json +2 -2
- package/assets/banner.png +0 -0
package/README.MD
CHANGED
@@ -34,7 +34,7 @@ data.name = 'modify name';
|
|
34
34
|
## dr-if
|
35
35
|
```html
|
36
36
|
<div dr-if="true">true</div>
|
37
|
-
<div dr-if="this.gender==='M'">
|
37
|
+
<div dr-if="this.gender==='M'">gender: M</div>
|
38
38
|
```
|
39
39
|
## dr-for, dr-for-of
|
40
40
|
```html
|
@@ -85,6 +85,11 @@ dr-event
|
|
85
85
|
```
|
86
86
|
|
87
87
|
## dr-value, value-link
|
88
|
+
dr-value
|
89
|
+
- The value is assigned the first time.
|
90
|
+
|
91
|
+
dr-value-link
|
92
|
+
- Value and variable values are referencing each other. It affects each other when changing. (Immediate reflection event: input)
|
88
93
|
```html
|
89
94
|
dr-value: <input type="text" dr-value="this.office.name"> <br>
|
90
95
|
dr-value-link: <input type="text" dr-value-link="this.office.addr.street"> <br>
|
@@ -93,6 +98,9 @@ dr-value-link: <input type="text" dr-value-link="this.office.addr.street"> <br>
|
|
93
98
|
## dr-attr
|
94
99
|
```html
|
95
100
|
<textarea dr-attr="{rows: this.age/2, cols: this.age}"></textarea>
|
101
|
+
<div dr-attr="{wow: '123', good: 123444}"></div>
|
102
|
+
<div dr-attr="['wow=123', 'good=123444']"></div>
|
103
|
+
<div dr-attr="'wow=123, good=123444'"></div>
|
96
104
|
```
|
97
105
|
|
98
106
|
## dr-class
|
package/dist/bundle.js
CHANGED
@@ -370,9 +370,23 @@ var eventManager = new (function () {
|
|
370
370
|
target: it
|
371
371
|
})
|
372
372
|
}));
|
373
|
-
|
374
|
-
|
375
|
-
|
373
|
+
if (typeof data === 'string') {
|
374
|
+
data.split(',').forEach(function (sit) {
|
375
|
+
var _a = sit.split('='), key = _a[0], value = _a[1];
|
376
|
+
it.setAttribute(key.trim(), value.trim());
|
377
|
+
});
|
378
|
+
}
|
379
|
+
else if (Array.isArray(data)) {
|
380
|
+
data.forEach(function (sit) {
|
381
|
+
var _a = sit.split('='), key = _a[0], value = _a[1];
|
382
|
+
it.setAttribute(key.trim(), value.trim());
|
383
|
+
});
|
384
|
+
}
|
385
|
+
else {
|
386
|
+
for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
|
387
|
+
var _b = _a[_i], key = _b[0], value = _b[1];
|
388
|
+
it.setAttribute(key, String(value));
|
389
|
+
}
|
376
390
|
}
|
377
391
|
}
|
378
392
|
});
|
@@ -388,16 +402,10 @@ var eventManager = new (function () {
|
|
388
402
|
})
|
389
403
|
}));
|
390
404
|
if (typeof data === 'string') {
|
391
|
-
|
392
|
-
it.removeAttribute('style');
|
393
|
-
it.setAttribute('style', data);
|
394
|
-
}
|
405
|
+
it.setAttribute('style', data);
|
395
406
|
}
|
396
407
|
else if (Array.isArray(data)) {
|
397
|
-
|
398
|
-
it.removeAttribute('style');
|
399
|
-
it.setAttribute('style', data.join(';'));
|
400
|
-
}
|
408
|
+
it.setAttribute('style', data.join(';'));
|
401
409
|
}
|
402
410
|
else {
|
403
411
|
for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
|
@@ -421,16 +429,10 @@ var eventManager = new (function () {
|
|
421
429
|
})
|
422
430
|
}));
|
423
431
|
if (typeof data === 'string') {
|
424
|
-
|
425
|
-
it.removeAttribute('class');
|
426
|
-
it.setAttribute('class', data);
|
427
|
-
}
|
432
|
+
it.setAttribute('class', data);
|
428
433
|
}
|
429
434
|
else if (Array.isArray(data)) {
|
430
|
-
|
431
|
-
it.removeAttribute('class');
|
432
|
-
it.setAttribute('class', data.join(' '));
|
433
|
-
}
|
435
|
+
it.setAttribute('class', data.join(' '));
|
434
436
|
}
|
435
437
|
else {
|
436
438
|
for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
|
package/dist/bundle.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"bundle.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"bundle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/events/EventManager.js
CHANGED
@@ -127,9 +127,23 @@ export var eventManager = new (function () {
|
|
127
127
|
target: it
|
128
128
|
})
|
129
129
|
}));
|
130
|
-
|
131
|
-
|
132
|
-
|
130
|
+
if (typeof data === 'string') {
|
131
|
+
data.split(',').forEach(function (sit) {
|
132
|
+
var _a = sit.split('='), key = _a[0], value = _a[1];
|
133
|
+
it.setAttribute(key.trim(), value.trim());
|
134
|
+
});
|
135
|
+
}
|
136
|
+
else if (Array.isArray(data)) {
|
137
|
+
data.forEach(function (sit) {
|
138
|
+
var _a = sit.split('='), key = _a[0], value = _a[1];
|
139
|
+
it.setAttribute(key.trim(), value.trim());
|
140
|
+
});
|
141
|
+
}
|
142
|
+
else {
|
143
|
+
for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
|
144
|
+
var _b = _a[_i], key = _b[0], value = _b[1];
|
145
|
+
it.setAttribute(key, String(value));
|
146
|
+
}
|
133
147
|
}
|
134
148
|
}
|
135
149
|
});
|
@@ -145,16 +159,10 @@ export var eventManager = new (function () {
|
|
145
159
|
})
|
146
160
|
}));
|
147
161
|
if (typeof data === 'string') {
|
148
|
-
|
149
|
-
it.removeAttribute('style');
|
150
|
-
it.setAttribute('style', data);
|
151
|
-
}
|
162
|
+
it.setAttribute('style', data);
|
152
163
|
}
|
153
164
|
else if (Array.isArray(data)) {
|
154
|
-
|
155
|
-
it.removeAttribute('style');
|
156
|
-
it.setAttribute('style', data.join(';'));
|
157
|
-
}
|
165
|
+
it.setAttribute('style', data.join(';'));
|
158
166
|
}
|
159
167
|
else {
|
160
168
|
for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
|
@@ -178,16 +186,10 @@ export var eventManager = new (function () {
|
|
178
186
|
})
|
179
187
|
}));
|
180
188
|
if (typeof data === 'string') {
|
181
|
-
|
182
|
-
it.removeAttribute('class');
|
183
|
-
it.setAttribute('class', data);
|
184
|
-
}
|
189
|
+
it.setAttribute('class', data);
|
185
190
|
}
|
186
191
|
else if (Array.isArray(data)) {
|
187
|
-
|
188
|
-
it.removeAttribute('class');
|
189
|
-
it.setAttribute('class', data.join(' '));
|
190
|
-
}
|
192
|
+
it.setAttribute('class', data.join(' '));
|
191
193
|
}
|
192
194
|
else {
|
193
195
|
for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "dom-render",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.49",
|
4
4
|
"main": "DomRender.js",
|
5
5
|
"license": "MIT",
|
6
6
|
"description": "dom-render",
|
@@ -55,7 +55,7 @@
|
|
55
55
|
"bundle:watch": "rollup -c -w",
|
56
56
|
"dev:start": "npm run start --workspace=dev",
|
57
57
|
"dev:serve": "npm run serve --workspace=dev",
|
58
|
-
"npm-build": "npm run build && cp package.json dist && cp README.MD dist",
|
58
|
+
"npm-build": "npm run build && cp package.json dist && cp .npmignore dist && cp README.MD dist",
|
59
59
|
"npm-publish": "npm run npm-build && npm publish ./dist",
|
60
60
|
"tsc": "tsc",
|
61
61
|
"tsc:watch": "rm -rf ./dist && mkdir dist && cp package.json dist && tsc --watch --sourceMap true",
|
package/assets/banner.png
DELETED
Binary file
|