ezh 0.1.4 → 0.1.5
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/lib/RbTree.js +17 -17
- package/lib/bundle.min.js +1 -1
- package/lib/debugCheck.js +14 -14
- package/lib/elements.js +404 -459
- package/lib/router.js +5 -5
- package/lib/state.js +26 -26
- package/package.json +2 -1
package/lib/router.js
CHANGED
|
@@ -78,13 +78,13 @@ const Router = ({ routes, notFound, checkAuth }) => {
|
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
return $s($k(key), $c('_', route.com, param, undefined,
|
|
81
|
+
return $s($k(key), $c('_', route.com, param, undefined, -1));
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
return notFound ? $s($k('404'), $c('_', notFound, {})) : undefined;
|
|
85
85
|
};
|
|
86
|
-
const h = (
|
|
87
|
-
|
|
86
|
+
const h = (v, url, replace) => {
|
|
87
|
+
v.preventDefault();
|
|
88
88
|
const { pathname, search, hash } = window.location;
|
|
89
89
|
const a = `${pathname}${search}${hash}`;
|
|
90
90
|
if (url !== a) {
|
|
@@ -99,13 +99,13 @@ const h = (x, url, replace) => {
|
|
|
99
99
|
};
|
|
100
100
|
const Link = (props, children) => {
|
|
101
101
|
const { href, className, style, title, replace } = props;
|
|
102
|
-
const onclick = href ? (
|
|
102
|
+
const onclick = href ? (v) => h(v, href, replace) : undefined;
|
|
103
103
|
return $ezh.$('_', 'a', { className, style, title, href, onclick }, children, -1, 1);
|
|
104
104
|
};
|
|
105
105
|
const RouteLink = (props, children) => {
|
|
106
106
|
const { route, params, className, style, title, replace } = props;
|
|
107
107
|
const href = route.buildUrl(params);
|
|
108
|
-
const onclick = (
|
|
108
|
+
const onclick = (v) => h(v, href, replace);
|
|
109
109
|
return $ezh.$('_', 'a', { className, style, title, href, onclick }, children, -1, 1);
|
|
110
110
|
};
|
|
111
111
|
//# sourceMappingURL=router.js.map
|
package/lib/state.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addComReader,
|
|
1
|
+
import { addComReader, p, refreshComReaders } from './elements';
|
|
2
2
|
const f = Symbol();
|
|
3
3
|
const j = Array.prototype;
|
|
4
4
|
const x = addComReader;
|
|
@@ -8,7 +8,7 @@ let l = (readerRecord, key) => {
|
|
|
8
8
|
};
|
|
9
9
|
export let t = false;
|
|
10
10
|
export const y = new WeakMap();
|
|
11
|
-
const
|
|
11
|
+
const q = (_) => {
|
|
12
12
|
return function (...m) {
|
|
13
13
|
const i = this.length;
|
|
14
14
|
let begin, c, k;
|
|
@@ -71,16 +71,16 @@ const o = (_) => {
|
|
|
71
71
|
}
|
|
72
72
|
const h = _.bind(this)(...m);
|
|
73
73
|
const n = this[f];
|
|
74
|
-
let
|
|
74
|
+
let o;
|
|
75
75
|
for (let b = begin; b < c; b++) {
|
|
76
|
-
|
|
77
|
-
switch (typeof
|
|
76
|
+
o = this[b];
|
|
77
|
+
switch (typeof o) {
|
|
78
78
|
case 'object':
|
|
79
|
-
if (
|
|
79
|
+
if (o) {
|
|
80
80
|
while (b < c) {
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
this[b] = r(
|
|
81
|
+
o = this[b];
|
|
82
|
+
if (o && !o[f]) {
|
|
83
|
+
this[b] = r(o);
|
|
84
84
|
}
|
|
85
85
|
b++;
|
|
86
86
|
}
|
|
@@ -98,15 +98,15 @@ const o = (_) => {
|
|
|
98
98
|
return h;
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
|
-
const
|
|
102
|
-
'push':
|
|
103
|
-
'unshift':
|
|
104
|
-
'fill':
|
|
105
|
-
'sort':
|
|
106
|
-
'reverse':
|
|
107
|
-
'pop':
|
|
108
|
-
'shift':
|
|
109
|
-
'splice':
|
|
101
|
+
const D = {
|
|
102
|
+
'push': q(j.push),
|
|
103
|
+
'unshift': q(j.unshift),
|
|
104
|
+
'fill': q(j.fill),
|
|
105
|
+
'sort': q(j.sort),
|
|
106
|
+
'reverse': q(j.reverse),
|
|
107
|
+
'pop': q(j.pop),
|
|
108
|
+
'shift': q(j.shift),
|
|
109
|
+
'splice': q(j.splice),
|
|
110
110
|
};
|
|
111
111
|
const E = (target, d) => {
|
|
112
112
|
const v = d.length;
|
|
@@ -179,9 +179,9 @@ const G = {
|
|
|
179
179
|
if (key !== f) {
|
|
180
180
|
let h = target[key];
|
|
181
181
|
if (h && h === j[key]) {
|
|
182
|
-
const
|
|
183
|
-
if (
|
|
184
|
-
return
|
|
182
|
+
const C = D[key];
|
|
183
|
+
if (C) {
|
|
184
|
+
return C.bind(target);
|
|
185
185
|
}
|
|
186
186
|
h = h.bind(target);
|
|
187
187
|
}
|
|
@@ -295,19 +295,19 @@ const r = (e) => {
|
|
|
295
295
|
target[f] = {};
|
|
296
296
|
return e;
|
|
297
297
|
};
|
|
298
|
-
const $ = (
|
|
299
|
-
if (
|
|
300
|
-
|
|
298
|
+
const $ = (B, a2) => {
|
|
299
|
+
if (a2) {
|
|
300
|
+
B.w = true;
|
|
301
301
|
}
|
|
302
302
|
else {
|
|
303
|
-
|
|
303
|
+
B.com.watchMountChange('s', $, B);
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
306
|
export const bindData = (data, key) => {
|
|
307
307
|
return [data, key, data[key]];
|
|
308
308
|
};
|
|
309
309
|
export const useState = (initial, resetOnUnmount) => {
|
|
310
|
-
const com =
|
|
310
|
+
const com = p;
|
|
311
311
|
if (com.id) {
|
|
312
312
|
let s = y.get(com);
|
|
313
313
|
if (s) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ezh",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "webpack serve"
|
|
6
6
|
},
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"eslint-plugin-import": "^2.31.0",
|
|
37
37
|
"ezh-trans": "^0.2.0",
|
|
38
38
|
"globals": "^15.14.0",
|
|
39
|
+
"log-class": "^1.0.2",
|
|
39
40
|
"minify-ts": "^1.2.4",
|
|
40
41
|
"sass": "^1.86.0",
|
|
41
42
|
"sass-loader": "^16.0.5",
|