best-unit 0.0.6 → 0.0.8
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/dist/best-unit.cjs +1 -1
- package/dist/best-unit.js +557 -199
- package/index.html +2 -2
- package/package.json +1 -1
- package/src/components/ModalForm/components/Button.tsx +26 -0
- package/src/components/ModalForm/components/ModalForm.tsx +189 -0
- package/src/components/ModalForm/index.tsx +32 -0
- package/src/demo/App.tsx +19 -0
- package/src/demo/index.tsx +4 -0
- package/src/main.ts +6 -2
- package/src/app.tsx +0 -9
package/dist/best-unit.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
function
|
|
1
|
+
function tt() {
|
|
2
2
|
console.log("npm package test!!!");
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function nt() {
|
|
5
5
|
console.log("Current time:", (/* @__PURE__ */ new Date()).toISOString());
|
|
6
6
|
}
|
|
7
|
-
var D,
|
|
8
|
-
function
|
|
7
|
+
var D, h, ve, w, oe, ge, ye, be, X, G, J, A = {}, ke = [], De = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, W = Array.isArray;
|
|
8
|
+
function E(t, e) {
|
|
9
9
|
for (var n in e) t[n] = e[n];
|
|
10
10
|
return t;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function Z(t) {
|
|
13
13
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
var o,
|
|
17
|
-
for (
|
|
18
|
-
if (arguments.length > 2 && (
|
|
19
|
-
return
|
|
15
|
+
function $(t, e, n) {
|
|
16
|
+
var o, _, r, l = {};
|
|
17
|
+
for (r in e) r == "key" ? o = e[r] : r == "ref" ? _ = e[r] : l[r] = e[r];
|
|
18
|
+
if (arguments.length > 2 && (l.children = arguments.length > 3 ? D.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (r in t.defaultProps) l[r] === void 0 && (l[r] = t.defaultProps[r]);
|
|
19
|
+
return F(t, l, o, _, null);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
var
|
|
23
|
-
return
|
|
21
|
+
function F(t, e, n, o, _) {
|
|
22
|
+
var r = { type: t, props: e, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: _ ?? ++ve, __i: -1, __u: 0 };
|
|
23
|
+
return _ == null && h.vnode != null && h.vnode(r), r;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function I(t) {
|
|
26
26
|
return t.children;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function L(t, e) {
|
|
29
29
|
this.props = t, this.context = e;
|
|
30
30
|
}
|
|
31
31
|
function P(t, e) {
|
|
@@ -33,38 +33,38 @@ function P(t, e) {
|
|
|
33
33
|
for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
|
|
34
34
|
return typeof t.type == "function" ? P(t) : null;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function Ce(t) {
|
|
37
37
|
var e, n;
|
|
38
38
|
if ((t = t.__) != null && t.__c != null) {
|
|
39
39
|
for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
|
|
40
40
|
t.__e = t.__c.base = n.__e;
|
|
41
41
|
break;
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return Ce(t);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
(!t.__d && (t.__d = !0) &&
|
|
46
|
+
function _e(t) {
|
|
47
|
+
(!t.__d && (t.__d = !0) && w.push(t) && !j.__r++ || oe != h.debounceRendering) && ((oe = h.debounceRendering) || ge)(j);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
for (var t, e, n, o,
|
|
51
|
-
|
|
49
|
+
function j() {
|
|
50
|
+
for (var t, e, n, o, _, r, l, a = 1; w.length; ) w.length > a && w.sort(ye), t = w.shift(), a = w.length, t.__d && (n = void 0, _ = (o = (e = t).__v).__e, r = [], l = [], e.__P && ((n = E({}, o)).__v = o.__v + 1, h.vnode && h.vnode(n), ee(e.__P, n, o, e.__n, e.__P.namespaceURI, 32 & o.__u ? [_] : null, r, _ ?? P(o), !!(32 & o.__u), l), n.__v = o.__v, n.__.__k[n.__i] = n, Se(r, n, l), n.__e != _ && Ce(n)));
|
|
51
|
+
j.__r = 0;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
var
|
|
55
|
-
for (
|
|
56
|
-
return n.__e =
|
|
53
|
+
function xe(t, e, n, o, _, r, l, a, u, c, s) {
|
|
54
|
+
var i, p, f, b, C, k, m = o && o.__k || ke, v = e.length;
|
|
55
|
+
for (u = Me(n, e, m, u, v), i = 0; i < v; i++) (f = n.__k[i]) != null && (p = f.__i == -1 ? A : m[f.__i] || A, f.__i = i, k = ee(t, f, p, _, r, l, a, u, c, s), b = f.__e, f.ref && p.ref != f.ref && (p.ref && te(p.ref, null, f), s.push(f.ref, f.__c || b, f)), C == null && b != null && (C = b), 4 & f.__u || p.__k === f.__k ? u = Ee(f, u, t) : typeof f.type == "function" && k !== void 0 ? u = k : b && (u = b.nextSibling), f.__u &= -7);
|
|
56
|
+
return n.__e = C, u;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
var
|
|
60
|
-
for (t.__k = new Array(
|
|
61
|
-
if (
|
|
58
|
+
function Me(t, e, n, o, _) {
|
|
59
|
+
var r, l, a, u, c, s = n.length, i = s, p = 0;
|
|
60
|
+
for (t.__k = new Array(_), r = 0; r < _; r++) (l = e[r]) != null && typeof l != "boolean" && typeof l != "function" ? (u = r + p, (l = t.__k[r] = typeof l == "string" || typeof l == "number" || typeof l == "bigint" || l.constructor == String ? F(null, l, null, null, null) : W(l) ? F(I, { children: l }, null, null, null) : l.constructor == null && l.__b > 0 ? F(l.type, l.props, l.key, l.ref ? l.ref : null, l.__v) : l).__ = t, l.__b = t.__b + 1, a = null, (c = l.__i = ze(l, n, u, i)) != -1 && (i--, (a = n[c]) && (a.__u |= 2)), a == null || a.__v == null ? (c == -1 && (_ > s ? p-- : _ < s && p++), typeof l.type != "function" && (l.__u |= 4)) : c != u && (c == u - 1 ? p-- : c == u + 1 ? p++ : (c > u ? p-- : p++, l.__u |= 4))) : t.__k[r] = null;
|
|
61
|
+
if (i) for (r = 0; r < s; r++) (a = n[r]) != null && (2 & a.__u) == 0 && (a.__e == o && (o = P(a)), $e(a, a));
|
|
62
62
|
return o;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
var o,
|
|
64
|
+
function Ee(t, e, n) {
|
|
65
|
+
var o, _;
|
|
66
66
|
if (typeof t.type == "function") {
|
|
67
|
-
for (o = t.__k,
|
|
67
|
+
for (o = t.__k, _ = 0; o && _ < o.length; _++) o[_] && (o[_].__ = t, e = Ee(o[_], e, n));
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
70
|
t.__e != e && (e && t.type && !n.contains(e) && (e = P(t)), n.insertBefore(t.__e, e || null), e = t.__e);
|
|
@@ -73,34 +73,34 @@ function se(t, e, n) {
|
|
|
73
73
|
while (e != null && e.nodeType == 8);
|
|
74
74
|
return e;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
var
|
|
78
|
-
if (
|
|
79
|
-
if (o > (
|
|
80
|
-
if (
|
|
81
|
-
if ((
|
|
82
|
-
|
|
76
|
+
function ze(t, e, n, o) {
|
|
77
|
+
var _, r, l = t.key, a = t.type, u = e[n];
|
|
78
|
+
if (u === null && t.key == null || u && l == u.key && a == u.type && (2 & u.__u) == 0) return n;
|
|
79
|
+
if (o > (u != null && (2 & u.__u) == 0 ? 1 : 0)) for (_ = n - 1, r = n + 1; _ >= 0 || r < e.length; ) {
|
|
80
|
+
if (_ >= 0) {
|
|
81
|
+
if ((u = e[_]) && (2 & u.__u) == 0 && l == u.key && a == u.type) return _;
|
|
82
|
+
_--;
|
|
83
83
|
}
|
|
84
|
-
if (
|
|
85
|
-
if ((
|
|
86
|
-
|
|
84
|
+
if (r < e.length) {
|
|
85
|
+
if ((u = e[r]) && (2 & u.__u) == 0 && l == u.key && a == u.type) return r;
|
|
86
|
+
r++;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
return -1;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" ||
|
|
91
|
+
function ie(t, e, n) {
|
|
92
|
+
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || De.test(e) ? n : n + "px";
|
|
93
93
|
}
|
|
94
|
-
function
|
|
95
|
-
var
|
|
94
|
+
function B(t, e, n, o, _) {
|
|
95
|
+
var r, l;
|
|
96
96
|
e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
|
|
97
97
|
else {
|
|
98
|
-
if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n ||
|
|
99
|
-
if (n) for (e in n) o && n[e] == o[e] ||
|
|
98
|
+
if (typeof o == "string" && (t.style.cssText = o = ""), o) for (e in o) n && e in n || ie(t.style, e, "");
|
|
99
|
+
if (n) for (e in n) o && n[e] == o[e] || ie(t.style, e, n[e]);
|
|
100
100
|
}
|
|
101
|
-
else if (e[0] == "o" && e[1] == "n")
|
|
101
|
+
else if (e[0] == "o" && e[1] == "n") r = e != (e = e.replace(be, "$1")), l = e.toLowerCase(), e = l in t || e == "onFocusOut" || e == "onFocusIn" ? l.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + r] = n, n ? o ? n.u = o.u : (n.u = X, t.addEventListener(e, r ? J : G, r)) : t.removeEventListener(e, r ? J : G, r);
|
|
102
102
|
else {
|
|
103
|
-
if (
|
|
103
|
+
if (_ == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
104
104
|
else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
|
|
105
105
|
t[e] = n ?? "";
|
|
106
106
|
break e;
|
|
@@ -109,159 +109,505 @@ function A(t, e, n, o, l) {
|
|
|
109
109
|
typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function le(t) {
|
|
113
113
|
return function(e) {
|
|
114
114
|
if (this.l) {
|
|
115
115
|
var n = this.l[e.type + t];
|
|
116
|
-
if (e.t == null) e.t =
|
|
116
|
+
if (e.t == null) e.t = X++;
|
|
117
117
|
else if (e.t < n.u) return;
|
|
118
|
-
return n(
|
|
118
|
+
return n(h.event ? h.event(e) : e);
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
var
|
|
122
|
+
function ee(t, e, n, o, _, r, l, a, u, c) {
|
|
123
|
+
var s, i, p, f, b, C, k, m, v, H, S, M, T, re, z, U, V, x = e.type;
|
|
124
124
|
if (e.constructor != null) return null;
|
|
125
|
-
128 & n.__u && (
|
|
126
|
-
e: if (typeof
|
|
127
|
-
if (
|
|
125
|
+
128 & n.__u && (u = !!(32 & n.__u), r = [a = e.__e = n.__e]), (s = h.__b) && s(e);
|
|
126
|
+
e: if (typeof x == "function") try {
|
|
127
|
+
if (m = e.props, v = "prototype" in x && x.prototype.render, H = (s = x.contextType) && o[s.__c], S = s ? H ? H.props.value : s.__ : o, n.__c ? k = (i = e.__c = n.__c).__ = i.__E : (v ? e.__c = i = new x(m, S) : (e.__c = i = new L(m, S), i.constructor = x, i.render = Le), H && H.sub(i), i.props = m, i.state || (i.state = {}), i.context = S, i.__n = o, p = i.__d = !0, i.__h = [], i._sb = []), v && i.__s == null && (i.__s = i.state), v && x.getDerivedStateFromProps != null && (i.__s == i.state && (i.__s = E({}, i.__s)), E(i.__s, x.getDerivedStateFromProps(m, i.__s))), f = i.props, b = i.state, i.__v = e, p) v && x.getDerivedStateFromProps == null && i.componentWillMount != null && i.componentWillMount(), v && i.componentDidMount != null && i.__h.push(i.componentDidMount);
|
|
128
128
|
else {
|
|
129
|
-
if (
|
|
130
|
-
for (e.__v != n.__v && (
|
|
131
|
-
|
|
132
|
-
}),
|
|
133
|
-
|
|
129
|
+
if (v && x.getDerivedStateFromProps == null && m !== f && i.componentWillReceiveProps != null && i.componentWillReceiveProps(m, S), !i.__e && i.shouldComponentUpdate != null && i.shouldComponentUpdate(m, i.__s, S) === !1 || e.__v == n.__v) {
|
|
130
|
+
for (e.__v != n.__v && (i.props = m, i.state = i.__s, i.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(N) {
|
|
131
|
+
N && (N.__ = e);
|
|
132
|
+
}), M = 0; M < i._sb.length; M++) i.__h.push(i._sb[M]);
|
|
133
|
+
i._sb = [], i.__h.length && l.push(i);
|
|
134
134
|
break e;
|
|
135
135
|
}
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
i.componentWillUpdate != null && i.componentWillUpdate(m, i.__s, S), v && i.componentDidUpdate != null && i.__h.push(function() {
|
|
137
|
+
i.componentDidUpdate(f, b, C);
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
|
-
if (
|
|
141
|
-
for (
|
|
142
|
-
|
|
140
|
+
if (i.context = S, i.props = m, i.__P = t, i.__e = !1, T = h.__r, re = 0, v) {
|
|
141
|
+
for (i.state = i.__s, i.__d = !1, T && T(e), s = i.render(i.props, i.state, i.context), z = 0; z < i._sb.length; z++) i.__h.push(i._sb[z]);
|
|
142
|
+
i._sb = [];
|
|
143
143
|
} else do
|
|
144
|
-
|
|
145
|
-
while (
|
|
146
|
-
|
|
147
|
-
} catch (
|
|
148
|
-
if (e.__v = null,
|
|
149
|
-
for (e.__u |=
|
|
150
|
-
|
|
151
|
-
} else for (
|
|
144
|
+
i.__d = !1, T && T(e), s = i.render(i.props, i.state, i.context), i.state = i.__s;
|
|
145
|
+
while (i.__d && ++re < 25);
|
|
146
|
+
i.state = i.__s, i.getChildContext != null && (o = E(E({}, o), i.getChildContext())), v && !p && i.getSnapshotBeforeUpdate != null && (C = i.getSnapshotBeforeUpdate(f, b)), U = s, s != null && s.type === I && s.key == null && (U = we(s.props.children)), a = xe(t, W(U) ? U : [U], e, n, o, _, r, l, a, u, c), i.base = e.__e, e.__u &= -161, i.__h.length && l.push(i), k && (i.__E = i.__ = null);
|
|
147
|
+
} catch (N) {
|
|
148
|
+
if (e.__v = null, u || r != null) if (N.then) {
|
|
149
|
+
for (e.__u |= u ? 160 : 128; a && a.nodeType == 8 && a.nextSibling; ) a = a.nextSibling;
|
|
150
|
+
r[r.indexOf(a)] = null, e.__e = a;
|
|
151
|
+
} else for (V = r.length; V--; ) Z(r[V]);
|
|
152
152
|
else e.__e = n.__e, e.__k = n.__k;
|
|
153
|
-
|
|
153
|
+
h.__e(N, e, n);
|
|
154
154
|
}
|
|
155
|
-
else
|
|
156
|
-
return (
|
|
155
|
+
else r == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : a = e.__e = Be(n.__e, e, n, o, _, r, l, u, c);
|
|
156
|
+
return (s = h.diffed) && s(e), 128 & e.__u ? void 0 : a;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
for (var o = 0; o < n.length; o++)
|
|
160
|
-
|
|
158
|
+
function Se(t, e, n) {
|
|
159
|
+
for (var o = 0; o < n.length; o++) te(n[o], n[++o], n[++o]);
|
|
160
|
+
h.__c && h.__c(e, t), t.some(function(_) {
|
|
161
161
|
try {
|
|
162
|
-
t =
|
|
163
|
-
|
|
162
|
+
t = _.__h, _.__h = [], t.some(function(r) {
|
|
163
|
+
r.call(_);
|
|
164
164
|
});
|
|
165
|
-
} catch (
|
|
166
|
-
|
|
165
|
+
} catch (r) {
|
|
166
|
+
h.__e(r, _.__v);
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t :
|
|
170
|
+
function we(t) {
|
|
171
|
+
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : W(t) ? t.map(we) : E({}, t);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
var
|
|
175
|
-
if (
|
|
176
|
-
for (
|
|
177
|
-
t =
|
|
173
|
+
function Be(t, e, n, o, _, r, l, a, u) {
|
|
174
|
+
var c, s, i, p, f, b, C, k = n.props, m = e.props, v = e.type;
|
|
175
|
+
if (v == "svg" ? _ = "http://www.w3.org/2000/svg" : v == "math" ? _ = "http://www.w3.org/1998/Math/MathML" : _ || (_ = "http://www.w3.org/1999/xhtml"), r != null) {
|
|
176
|
+
for (c = 0; c < r.length; c++) if ((f = r[c]) && "setAttribute" in f == !!v && (v ? f.localName == v : f.nodeType == 3)) {
|
|
177
|
+
t = f, r[c] = null;
|
|
178
178
|
break;
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
if (t == null) {
|
|
182
|
-
if (
|
|
183
|
-
t = document.createElementNS(
|
|
182
|
+
if (v == null) return document.createTextNode(m);
|
|
183
|
+
t = document.createElementNS(_, v, m.is && m), a && (h.__m && h.__m(e, r), a = !1), r = null;
|
|
184
184
|
}
|
|
185
|
-
if (
|
|
185
|
+
if (v == null) k === m || a && t.data == m || (t.data = m);
|
|
186
186
|
else {
|
|
187
|
-
if (
|
|
188
|
-
for (
|
|
189
|
-
if (
|
|
190
|
-
else if (!(
|
|
191
|
-
if (
|
|
192
|
-
|
|
187
|
+
if (r = r && D.call(t.childNodes), k = n.props || A, !a && r != null) for (k = {}, c = 0; c < t.attributes.length; c++) k[(f = t.attributes[c]).name] = f.value;
|
|
188
|
+
for (c in k) if (f = k[c], c != "children") {
|
|
189
|
+
if (c == "dangerouslySetInnerHTML") i = f;
|
|
190
|
+
else if (!(c in m)) {
|
|
191
|
+
if (c == "value" && "defaultValue" in m || c == "checked" && "defaultChecked" in m) continue;
|
|
192
|
+
B(t, c, null, f, _);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
for (
|
|
196
|
-
if (
|
|
197
|
-
else if (
|
|
198
|
-
|
|
195
|
+
for (c in m) f = m[c], c == "children" ? p = f : c == "dangerouslySetInnerHTML" ? s = f : c == "value" ? b = f : c == "checked" ? C = f : a && typeof f != "function" || k[c] === f || B(t, c, f, k[c], _);
|
|
196
|
+
if (s) a || i && (s.__html == i.__html || s.__html == t.innerHTML) || (t.innerHTML = s.__html), e.__k = [];
|
|
197
|
+
else if (i && (t.innerHTML = ""), xe(e.type == "template" ? t.content : t, W(p) ? p : [p], e, n, o, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : _, r, l, r ? r[0] : n.__k && P(n, 0), a, u), r != null) for (c = r.length; c--; ) Z(r[c]);
|
|
198
|
+
a || (c = "value", v == "progress" && b == null ? t.removeAttribute("value") : b != null && (b !== t[c] || v == "progress" && !b || v == "option" && b != k[c]) && B(t, c, b, k[c], _), c = "checked", C != null && C != t[c] && B(t, c, C, k[c], _));
|
|
199
199
|
}
|
|
200
200
|
return t;
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function te(t, e, n) {
|
|
203
203
|
try {
|
|
204
204
|
if (typeof t == "function") {
|
|
205
205
|
var o = typeof t.__u == "function";
|
|
206
206
|
o && t.__u(), o && e == null || (t.__u = t(e));
|
|
207
207
|
} else t.current = e;
|
|
208
|
-
} catch (
|
|
209
|
-
|
|
208
|
+
} catch (_) {
|
|
209
|
+
h.__e(_, n);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
var o,
|
|
214
|
-
if (
|
|
212
|
+
function $e(t, e, n) {
|
|
213
|
+
var o, _;
|
|
214
|
+
if (h.unmount && h.unmount(t), (o = t.ref) && (o.current && o.current != t.__e || te(o, null, e)), (o = t.__c) != null) {
|
|
215
215
|
if (o.componentWillUnmount) try {
|
|
216
216
|
o.componentWillUnmount();
|
|
217
|
-
} catch (
|
|
218
|
-
|
|
217
|
+
} catch (r) {
|
|
218
|
+
h.__e(r, e);
|
|
219
219
|
}
|
|
220
220
|
o.base = o.__P = null;
|
|
221
221
|
}
|
|
222
|
-
if (o = t.__k) for (
|
|
223
|
-
n ||
|
|
222
|
+
if (o = t.__k) for (_ = 0; _ < o.length; _++) o[_] && $e(o[_], e, n || typeof t.type != "function");
|
|
223
|
+
n || Z(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Le(t, e, n) {
|
|
226
226
|
return this.constructor(t, n);
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
var o,
|
|
230
|
-
e == document && (e = document.documentElement),
|
|
231
|
-
}
|
|
232
|
-
function
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
function
|
|
236
|
-
var o,
|
|
237
|
-
for (
|
|
238
|
-
return arguments.length > 2 && (
|
|
239
|
-
}
|
|
240
|
-
D =
|
|
241
|
-
for (var
|
|
242
|
-
if ((
|
|
243
|
-
} catch (
|
|
244
|
-
t =
|
|
228
|
+
function q(t, e, n) {
|
|
229
|
+
var o, _, r, l;
|
|
230
|
+
e == document && (e = document.documentElement), h.__ && h.__(t, e), _ = (o = typeof n == "function") ? null : n && n.__k || e.__k, r = [], l = [], ee(e, t = (!o && n || e).__k = $(I, null, [t]), _ || A, A, e.namespaceURI, !o && n ? [n] : _ ? null : e.firstChild ? D.call(e.childNodes) : null, r, !o && n ? n : _ ? _.__e : e.firstChild, o, l), Se(r, t, l);
|
|
231
|
+
}
|
|
232
|
+
function Pe(t, e) {
|
|
233
|
+
q(t, e, Pe);
|
|
234
|
+
}
|
|
235
|
+
function He(t, e, n) {
|
|
236
|
+
var o, _, r, l, a = E({}, t.props);
|
|
237
|
+
for (r in t.type && t.type.defaultProps && (l = t.type.defaultProps), e) r == "key" ? o = e[r] : r == "ref" ? _ = e[r] : a[r] = e[r] === void 0 && l != null ? l[r] : e[r];
|
|
238
|
+
return arguments.length > 2 && (a.children = arguments.length > 3 ? D.call(arguments, 2) : n), F(t.type, a, o || t.key, _ || t.ref, null);
|
|
239
|
+
}
|
|
240
|
+
D = ke.slice, h = { __e: function(t, e, n, o) {
|
|
241
|
+
for (var _, r, l; e = e.__; ) if ((_ = e.__c) && !_.__) try {
|
|
242
|
+
if ((r = _.constructor) && r.getDerivedStateFromError != null && (_.setState(r.getDerivedStateFromError(t)), l = _.__d), _.componentDidCatch != null && (_.componentDidCatch(t, o || {}), l = _.__d), l) return _.__E = _;
|
|
243
|
+
} catch (a) {
|
|
244
|
+
t = a;
|
|
245
245
|
}
|
|
246
246
|
throw t;
|
|
247
|
-
} },
|
|
247
|
+
} }, ve = 0, L.prototype.setState = function(t, e) {
|
|
248
248
|
var n;
|
|
249
|
-
n = this.__s != null && this.__s != this.state ? this.__s : this.__s =
|
|
250
|
-
},
|
|
251
|
-
this.__v && (this.__e = !0, t && this.__h.push(t),
|
|
252
|
-
},
|
|
249
|
+
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = E({}, this.state), typeof t == "function" && (t = t(E({}, n), this.props)), t && E(n, t), t != null && this.__v && (e && this._sb.push(e), _e(this));
|
|
250
|
+
}, L.prototype.forceUpdate = function(t) {
|
|
251
|
+
this.__v && (this.__e = !0, t && this.__h.push(t), _e(this));
|
|
252
|
+
}, L.prototype.render = I, w = [], ge = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, ye = function(t, e) {
|
|
253
253
|
return t.__v.__b - e.__v.__b;
|
|
254
|
-
},
|
|
255
|
-
var
|
|
256
|
-
function
|
|
254
|
+
}, j.__r = 0, be = /(PointerCapture)$|Capture$/i, X = 0, G = le(!1), J = le(!0);
|
|
255
|
+
var Re = 0;
|
|
256
|
+
function d(t, e, n, o, _, r) {
|
|
257
257
|
e || (e = {});
|
|
258
|
-
var
|
|
259
|
-
if ("ref" in
|
|
260
|
-
var
|
|
261
|
-
|
|
258
|
+
var l, a, u = e;
|
|
259
|
+
if ("ref" in u) for (a in u = {}, e) a == "ref" ? l = e[a] : u[a] = e[a];
|
|
260
|
+
var c = { type: t, props: u, key: n, ref: l, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Re, __i: -1, __u: 0, __source: _, __self: r };
|
|
261
|
+
if (typeof t == "function" && (l = t.defaultProps)) for (a in l) u[a] === void 0 && (u[a] = l[a]);
|
|
262
|
+
return h.vnode && h.vnode(c), c;
|
|
263
|
+
}
|
|
264
|
+
var O, g, Y, ae, K = 0, Te = [], y = h, ce = y.__b, ue = y.__r, se = y.diffed, fe = y.__c, pe = y.unmount, de = y.__;
|
|
265
|
+
function Ue(t, e) {
|
|
266
|
+
y.__h && y.__h(g, t, K || e), K = 0;
|
|
267
|
+
var n = g.__H || (g.__H = { __: [], __h: [] });
|
|
268
|
+
return t >= n.__.length && n.__.push({}), n.__[t];
|
|
269
|
+
}
|
|
270
|
+
function Ne(t) {
|
|
271
|
+
return K = 1, je(Fe, t);
|
|
272
|
+
}
|
|
273
|
+
function je(t, e, n) {
|
|
274
|
+
var o = Ue(O++, 2);
|
|
275
|
+
if (o.t = t, !o.__c && (o.__ = [Fe(void 0, e), function(a) {
|
|
276
|
+
var u = o.__N ? o.__N[0] : o.__[0], c = o.t(u, a);
|
|
277
|
+
u !== c && (o.__N = [c, o.__[1]], o.__c.setState({}));
|
|
278
|
+
}], o.__c = g, !g.__f)) {
|
|
279
|
+
var _ = function(a, u, c) {
|
|
280
|
+
if (!o.__c.__H) return !0;
|
|
281
|
+
var s = o.__c.__H.__.filter(function(p) {
|
|
282
|
+
return !!p.__c;
|
|
283
|
+
});
|
|
284
|
+
if (s.every(function(p) {
|
|
285
|
+
return !p.__N;
|
|
286
|
+
})) return !r || r.call(this, a, u, c);
|
|
287
|
+
var i = o.__c.props !== a;
|
|
288
|
+
return s.forEach(function(p) {
|
|
289
|
+
if (p.__N) {
|
|
290
|
+
var f = p.__[0];
|
|
291
|
+
p.__ = p.__N, p.__N = void 0, f !== p.__[0] && (i = !0);
|
|
292
|
+
}
|
|
293
|
+
}), r && r.call(this, a, u, c) || i;
|
|
294
|
+
};
|
|
295
|
+
g.__f = !0;
|
|
296
|
+
var r = g.shouldComponentUpdate, l = g.componentWillUpdate;
|
|
297
|
+
g.componentWillUpdate = function(a, u, c) {
|
|
298
|
+
if (this.__e) {
|
|
299
|
+
var s = r;
|
|
300
|
+
r = void 0, _(a, u, c), r = s;
|
|
301
|
+
}
|
|
302
|
+
l && l.call(this, a, u, c);
|
|
303
|
+
}, g.shouldComponentUpdate = _;
|
|
304
|
+
}
|
|
305
|
+
return o.__N || o.__;
|
|
306
|
+
}
|
|
307
|
+
function Oe(t, e) {
|
|
308
|
+
var n = Ue(O++, 3);
|
|
309
|
+
!y.__s && qe(n.__H, e) && (n.__ = t, n.u = e, g.__H.__h.push(n));
|
|
310
|
+
}
|
|
311
|
+
function We() {
|
|
312
|
+
for (var t; t = Te.shift(); ) if (t.__P && t.__H) try {
|
|
313
|
+
t.__H.__h.forEach(R), t.__H.__h.forEach(Q), t.__H.__h = [];
|
|
314
|
+
} catch (e) {
|
|
315
|
+
t.__H.__h = [], y.__e(e, t.__v);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
y.__b = function(t) {
|
|
319
|
+
g = null, ce && ce(t);
|
|
320
|
+
}, y.__ = function(t, e) {
|
|
321
|
+
t && e.__k && e.__k.__m && (t.__m = e.__k.__m), de && de(t, e);
|
|
322
|
+
}, y.__r = function(t) {
|
|
323
|
+
ue && ue(t), O = 0;
|
|
324
|
+
var e = (g = t.__c).__H;
|
|
325
|
+
e && (Y === g ? (e.__h = [], g.__h = [], e.__.forEach(function(n) {
|
|
326
|
+
n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
|
|
327
|
+
})) : (e.__h.forEach(R), e.__h.forEach(Q), e.__h = [], O = 0)), Y = g;
|
|
328
|
+
}, y.diffed = function(t) {
|
|
329
|
+
se && se(t);
|
|
330
|
+
var e = t.__c;
|
|
331
|
+
e && e.__H && (e.__H.__h.length && (Te.push(e) !== 1 && ae === y.requestAnimationFrame || ((ae = y.requestAnimationFrame) || Ie)(We)), e.__H.__.forEach(function(n) {
|
|
332
|
+
n.u && (n.__H = n.u), n.u = void 0;
|
|
333
|
+
})), Y = g = null;
|
|
334
|
+
}, y.__c = function(t, e) {
|
|
335
|
+
e.some(function(n) {
|
|
336
|
+
try {
|
|
337
|
+
n.__h.forEach(R), n.__h = n.__h.filter(function(o) {
|
|
338
|
+
return !o.__ || Q(o);
|
|
339
|
+
});
|
|
340
|
+
} catch (o) {
|
|
341
|
+
e.some(function(_) {
|
|
342
|
+
_.__h && (_.__h = []);
|
|
343
|
+
}), e = [], y.__e(o, n.__v);
|
|
344
|
+
}
|
|
345
|
+
}), fe && fe(t, e);
|
|
346
|
+
}, y.unmount = function(t) {
|
|
347
|
+
pe && pe(t);
|
|
348
|
+
var e, n = t.__c;
|
|
349
|
+
n && n.__H && (n.__H.__.forEach(function(o) {
|
|
350
|
+
try {
|
|
351
|
+
R(o);
|
|
352
|
+
} catch (_) {
|
|
353
|
+
e = _;
|
|
354
|
+
}
|
|
355
|
+
}), n.__H = void 0, e && y.__e(e, n.__v));
|
|
356
|
+
};
|
|
357
|
+
var he = typeof requestAnimationFrame == "function";
|
|
358
|
+
function Ie(t) {
|
|
359
|
+
var e, n = function() {
|
|
360
|
+
clearTimeout(o), he && cancelAnimationFrame(e), setTimeout(t);
|
|
361
|
+
}, o = setTimeout(n, 35);
|
|
362
|
+
he && (e = requestAnimationFrame(n));
|
|
363
|
+
}
|
|
364
|
+
function R(t) {
|
|
365
|
+
var e = g, n = t.__c;
|
|
366
|
+
typeof n == "function" && (t.__c = void 0, n()), g = e;
|
|
367
|
+
}
|
|
368
|
+
function Q(t) {
|
|
369
|
+
var e = g;
|
|
370
|
+
t.__c = t.__(), g = e;
|
|
371
|
+
}
|
|
372
|
+
function qe(t, e) {
|
|
373
|
+
return !t || t.length !== e.length || e.some(function(n, o) {
|
|
374
|
+
return n !== t[o];
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
function Fe(t, e) {
|
|
378
|
+
return typeof e == "function" ? e(t) : e;
|
|
379
|
+
}
|
|
380
|
+
function Ve({ onClick: t, color: e, children: n }) {
|
|
381
|
+
return /* @__PURE__ */ d(
|
|
382
|
+
"button",
|
|
383
|
+
{
|
|
384
|
+
style: {
|
|
385
|
+
background: e || "#1890ff",
|
|
386
|
+
color: "#fff",
|
|
387
|
+
border: "none",
|
|
388
|
+
borderRadius: 4,
|
|
389
|
+
padding: "8px 16px",
|
|
390
|
+
cursor: "pointer",
|
|
391
|
+
fontSize: 16
|
|
392
|
+
},
|
|
393
|
+
onClick: t,
|
|
394
|
+
children: n
|
|
395
|
+
}
|
|
396
|
+
);
|
|
397
|
+
}
|
|
398
|
+
function Ye({ visible: t, onClose: e, onSubmit: n, color: o }) {
|
|
399
|
+
const [_, r] = Ne({
|
|
400
|
+
amount: "",
|
|
401
|
+
rechargeChannel: "paypal",
|
|
402
|
+
currency: "USD",
|
|
403
|
+
loading: !1,
|
|
404
|
+
error: "",
|
|
405
|
+
amountError: "",
|
|
406
|
+
rechargeChannelError: "",
|
|
407
|
+
currencyError: ""
|
|
408
|
+
});
|
|
409
|
+
return Oe(() => {
|
|
410
|
+
t || r({
|
|
411
|
+
amount: "",
|
|
412
|
+
rechargeChannel: "paypal",
|
|
413
|
+
currency: "USD",
|
|
414
|
+
loading: !1,
|
|
415
|
+
error: "",
|
|
416
|
+
amountError: "",
|
|
417
|
+
rechargeChannelError: "",
|
|
418
|
+
currencyError: ""
|
|
419
|
+
});
|
|
420
|
+
}, [t]), t ? /* @__PURE__ */ d(
|
|
421
|
+
"div",
|
|
422
|
+
{
|
|
423
|
+
style: {
|
|
424
|
+
position: "fixed",
|
|
425
|
+
top: 0,
|
|
426
|
+
left: 0,
|
|
427
|
+
right: 0,
|
|
428
|
+
bottom: 0,
|
|
429
|
+
background: "rgba(0,0,0,0.7)",
|
|
430
|
+
display: "flex",
|
|
431
|
+
alignItems: "center",
|
|
432
|
+
justifyContent: "center",
|
|
433
|
+
zIndex: 9999
|
|
434
|
+
},
|
|
435
|
+
onClick: (u) => {
|
|
436
|
+
u.target === u.currentTarget && e();
|
|
437
|
+
},
|
|
438
|
+
children: /* @__PURE__ */ d(
|
|
439
|
+
"form",
|
|
440
|
+
{
|
|
441
|
+
onSubmit: async (u) => {
|
|
442
|
+
u.preventDefault();
|
|
443
|
+
let c = !0;
|
|
444
|
+
if (r((s) => ({ ...s, amountError: "", rechargeChannelError: "" })), _.amount.trim() || (r((s) => ({ ...s, amountError: "请输入充值金额" })), c = !1), _.rechargeChannel || (r((s) => ({ ...s, rechargeChannelError: "请选择支付平台" })), c = !1), !!c) {
|
|
445
|
+
r((s) => ({ ...s, loading: !0, error: "" }));
|
|
446
|
+
try {
|
|
447
|
+
await n({ amount: _.amount, rechargeChannel: _.rechargeChannel, currency: _.currency }), e();
|
|
448
|
+
} catch {
|
|
449
|
+
r((s) => ({ ...s, error: "提交失败,请重试" }));
|
|
450
|
+
} finally {
|
|
451
|
+
r((s) => ({ ...s, loading: !1 }));
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
style: {
|
|
456
|
+
background: "#181A20",
|
|
457
|
+
padding: 32,
|
|
458
|
+
borderRadius: 12,
|
|
459
|
+
minWidth: 360,
|
|
460
|
+
color: o || "#fff",
|
|
461
|
+
boxShadow: "0 4px 24px rgba(0,0,0,0.5)",
|
|
462
|
+
position: "relative"
|
|
463
|
+
},
|
|
464
|
+
onClick: (u) => u.stopPropagation(),
|
|
465
|
+
children: [
|
|
466
|
+
/* @__PURE__ */ d(
|
|
467
|
+
"button",
|
|
468
|
+
{
|
|
469
|
+
type: "button",
|
|
470
|
+
onClick: e,
|
|
471
|
+
style: {
|
|
472
|
+
position: "absolute",
|
|
473
|
+
right: 16,
|
|
474
|
+
top: 16,
|
|
475
|
+
background: "none",
|
|
476
|
+
border: "none",
|
|
477
|
+
color: "#fff",
|
|
478
|
+
fontSize: 22,
|
|
479
|
+
cursor: "pointer",
|
|
480
|
+
lineHeight: 1
|
|
481
|
+
},
|
|
482
|
+
"aria-label": "关闭",
|
|
483
|
+
children: "×"
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
/* @__PURE__ */ d("div", { style: { fontWeight: 600, fontSize: 18, marginBottom: 24, textAlign: "left" }, children: "在线充值" }),
|
|
487
|
+
/* @__PURE__ */ d("div", { style: { marginBottom: 18 }, children: [
|
|
488
|
+
/* @__PURE__ */ d("div", { style: { marginBottom: 8, fontSize: 14 }, children: [
|
|
489
|
+
/* @__PURE__ */ d("span", { style: { color: "#00E8C6" }, children: "*" }),
|
|
490
|
+
" 充值金额"
|
|
491
|
+
] }),
|
|
492
|
+
/* @__PURE__ */ d(
|
|
493
|
+
"input",
|
|
494
|
+
{
|
|
495
|
+
type: "text",
|
|
496
|
+
placeholder: "请输入充值金额",
|
|
497
|
+
value: _.amount,
|
|
498
|
+
onInput: (u) => {
|
|
499
|
+
const c = u.target.value;
|
|
500
|
+
r((s) => ({
|
|
501
|
+
...s,
|
|
502
|
+
amount: c,
|
|
503
|
+
amountError: c.trim() ? "" : s.amountError
|
|
504
|
+
}));
|
|
505
|
+
},
|
|
506
|
+
style: {
|
|
507
|
+
width: "100%",
|
|
508
|
+
padding: "10px 12px",
|
|
509
|
+
borderRadius: 6,
|
|
510
|
+
boxSizing: "border-box",
|
|
511
|
+
border: _.amountError ? "1px solid #ff4d4f" : "1px solid #23262F",
|
|
512
|
+
background: "#23262F",
|
|
513
|
+
color: "#fff",
|
|
514
|
+
fontSize: 15,
|
|
515
|
+
outline: "none",
|
|
516
|
+
marginBottom: 0
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
),
|
|
520
|
+
_.amountError && /* @__PURE__ */ d("div", { style: { color: "#ff4d4f", fontSize: 13, marginTop: 4 }, children: _.amountError })
|
|
521
|
+
] }),
|
|
522
|
+
/* @__PURE__ */ d("div", { style: { marginBottom: 18 }, children: [
|
|
523
|
+
/* @__PURE__ */ d("div", { style: { marginBottom: 8, fontSize: 14 }, children: [
|
|
524
|
+
/* @__PURE__ */ d("span", { style: { color: "#00E8C6" }, children: "*" }),
|
|
525
|
+
" 支付平台"
|
|
526
|
+
] }),
|
|
527
|
+
/* @__PURE__ */ d(
|
|
528
|
+
"select",
|
|
529
|
+
{
|
|
530
|
+
style: {
|
|
531
|
+
width: "100%",
|
|
532
|
+
padding: "10px 12px",
|
|
533
|
+
borderRadius: 6,
|
|
534
|
+
border: _.rechargeChannelError ? "1px solid #ff4d4f" : "1px solid #23262F",
|
|
535
|
+
background: "#23262F",
|
|
536
|
+
color: "#fff",
|
|
537
|
+
fontSize: 15,
|
|
538
|
+
outline: "none"
|
|
539
|
+
},
|
|
540
|
+
value: _.rechargeChannel,
|
|
541
|
+
onInput: (u) => {
|
|
542
|
+
const c = u.target.value;
|
|
543
|
+
r((s) => ({
|
|
544
|
+
...s,
|
|
545
|
+
rechargeChannel: c,
|
|
546
|
+
rechargeChannelError: c ? "" : s.rechargeChannelError
|
|
547
|
+
}));
|
|
548
|
+
},
|
|
549
|
+
children: [
|
|
550
|
+
/* @__PURE__ */ d("option", { value: "alipay", children: "支付宝" }),
|
|
551
|
+
/* @__PURE__ */ d("option", { value: "wechat", children: "微信" }),
|
|
552
|
+
/* @__PURE__ */ d("option", { value: "paypal", children: "PayPal" })
|
|
553
|
+
]
|
|
554
|
+
}
|
|
555
|
+
),
|
|
556
|
+
_.rechargeChannelError && /* @__PURE__ */ d("div", { style: { color: "#ff4d4f", fontSize: 13, marginTop: 4 }, children: _.rechargeChannelError })
|
|
557
|
+
] }),
|
|
558
|
+
/* @__PURE__ */ d("div", { style: { marginBottom: 24 }, children: [
|
|
559
|
+
/* @__PURE__ */ d("div", { style: { marginBottom: 8, fontSize: 14 }, children: "币种" }),
|
|
560
|
+
/* @__PURE__ */ d(
|
|
561
|
+
"select",
|
|
562
|
+
{
|
|
563
|
+
style: {
|
|
564
|
+
width: "100%",
|
|
565
|
+
padding: "10px 12px",
|
|
566
|
+
borderRadius: 6,
|
|
567
|
+
border: "1px solid #23262F",
|
|
568
|
+
background: "#23262F",
|
|
569
|
+
color: "#fff",
|
|
570
|
+
fontSize: 15,
|
|
571
|
+
outline: "none"
|
|
572
|
+
},
|
|
573
|
+
value: _.currency,
|
|
574
|
+
children: [
|
|
575
|
+
/* @__PURE__ */ d("option", { value: "USD", children: "USD" }),
|
|
576
|
+
/* @__PURE__ */ d("option", { value: "CNY", children: "CNY" }),
|
|
577
|
+
/* @__PURE__ */ d("option", { value: "EUR", children: "EUR" })
|
|
578
|
+
]
|
|
579
|
+
}
|
|
580
|
+
)
|
|
581
|
+
] }),
|
|
582
|
+
_.error && /* @__PURE__ */ d("div", { style: { color: "#ff4d4f", marginBottom: 12 }, children: _.error }),
|
|
583
|
+
/* @__PURE__ */ d("div", { style: { display: "flex", justifyContent: "flex-end", gap: 12 }, children: [
|
|
584
|
+
/* @__PURE__ */ d(
|
|
585
|
+
"button",
|
|
586
|
+
{
|
|
587
|
+
type: "button",
|
|
588
|
+
onClick: e,
|
|
589
|
+
style: { background: "#23262F", color: "#fff", border: "none", borderRadius: 6, padding: "8px 24px", fontSize: 15, cursor: "pointer" },
|
|
590
|
+
children: "取消"
|
|
591
|
+
}
|
|
592
|
+
),
|
|
593
|
+
/* @__PURE__ */ d(
|
|
594
|
+
"button",
|
|
595
|
+
{
|
|
596
|
+
type: "submit",
|
|
597
|
+
disabled: _.loading,
|
|
598
|
+
style: { background: "#00E8C6", color: "#fff", border: "none", borderRadius: 6, padding: "8px 24px", fontSize: 15, cursor: "pointer", fontWeight: 600 },
|
|
599
|
+
children: _.loading ? "提交中..." : "去支付"
|
|
600
|
+
}
|
|
601
|
+
)
|
|
602
|
+
] })
|
|
603
|
+
]
|
|
604
|
+
}
|
|
605
|
+
)
|
|
606
|
+
}
|
|
607
|
+
) : null;
|
|
262
608
|
}
|
|
263
|
-
function
|
|
264
|
-
return (
|
|
609
|
+
function ne() {
|
|
610
|
+
return (ne = Object.assign ? Object.assign.bind() : function(t) {
|
|
265
611
|
for (var e = 1; e < arguments.length; e++) {
|
|
266
612
|
var n = arguments[e];
|
|
267
613
|
for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (t[o] = n[o]);
|
|
@@ -269,80 +615,92 @@ function J() {
|
|
|
269
615
|
return t;
|
|
270
616
|
}).apply(this, arguments);
|
|
271
617
|
}
|
|
272
|
-
var
|
|
273
|
-
function
|
|
618
|
+
var Ge = ["context", "children"];
|
|
619
|
+
function Je(t) {
|
|
274
620
|
this.getChildContext = function() {
|
|
275
621
|
return t.context;
|
|
276
622
|
};
|
|
277
|
-
var e = t.children, n = function(o,
|
|
623
|
+
var e = t.children, n = function(o, _) {
|
|
278
624
|
if (o == null) return {};
|
|
279
|
-
var
|
|
280
|
-
for (
|
|
281
|
-
return
|
|
282
|
-
}(t,
|
|
283
|
-
return
|
|
625
|
+
var r, l, a = {}, u = Object.keys(o);
|
|
626
|
+
for (l = 0; l < u.length; l++) _.indexOf(r = u[l]) >= 0 || (a[r] = o[r]);
|
|
627
|
+
return a;
|
|
628
|
+
}(t, Ge);
|
|
629
|
+
return He(e, n);
|
|
284
630
|
}
|
|
285
|
-
function
|
|
631
|
+
function Ke() {
|
|
286
632
|
var t = new CustomEvent("_preact", { detail: {}, bubbles: !0, cancelable: !0 });
|
|
287
|
-
this.dispatchEvent(t), this._vdom =
|
|
633
|
+
this.dispatchEvent(t), this._vdom = $(Je, ne({}, this._props, { context: t.detail.context }), function e(n, o) {
|
|
288
634
|
if (n.nodeType === 3) return n.data;
|
|
289
635
|
if (n.nodeType !== 1) return null;
|
|
290
|
-
var
|
|
291
|
-
for (
|
|
292
|
-
for (
|
|
293
|
-
var
|
|
294
|
-
|
|
636
|
+
var _ = [], r = {}, l = 0, a = n.attributes, u = n.childNodes;
|
|
637
|
+
for (l = a.length; l--; ) a[l].name !== "slot" && (r[a[l].name] = a[l].value, r[Ae(a[l].name)] = a[l].value);
|
|
638
|
+
for (l = u.length; l--; ) {
|
|
639
|
+
var c = e(u[l], null), s = u[l].slot;
|
|
640
|
+
s ? r[s] = $(me, { name: s }, c) : _[l] = c;
|
|
295
641
|
}
|
|
296
|
-
var
|
|
297
|
-
return
|
|
298
|
-
}(this, this._vdomComponent)), (this.hasAttribute("hydrate") ?
|
|
642
|
+
var i = o ? $(me, null, _) : _;
|
|
643
|
+
return $(o || n.nodeName.toLowerCase(), r, i);
|
|
644
|
+
}(this, this._vdomComponent)), (this.hasAttribute("hydrate") ? Pe : q)(this._vdom, this._root);
|
|
299
645
|
}
|
|
300
|
-
function
|
|
646
|
+
function Ae(t) {
|
|
301
647
|
return t.replace(/-(\w)/g, function(e, n) {
|
|
302
648
|
return n ? n.toUpperCase() : "";
|
|
303
649
|
});
|
|
304
650
|
}
|
|
305
|
-
function
|
|
651
|
+
function Qe(t, e, n) {
|
|
306
652
|
if (this._vdom) {
|
|
307
653
|
var o = {};
|
|
308
|
-
o[t] = n = n ?? void 0, o[
|
|
654
|
+
o[t] = n = n ?? void 0, o[Ae(t)] = n, this._vdom = He(this._vdom, o), q(this._vdom, this._root);
|
|
309
655
|
}
|
|
310
656
|
}
|
|
311
|
-
function
|
|
312
|
-
|
|
657
|
+
function Xe() {
|
|
658
|
+
q(this._vdom = null, this._root);
|
|
313
659
|
}
|
|
314
|
-
function
|
|
660
|
+
function me(t, e) {
|
|
315
661
|
var n = this;
|
|
316
|
-
return
|
|
317
|
-
o ? (n.ref = o, n._listener || (n._listener = function(
|
|
318
|
-
|
|
662
|
+
return $("slot", ne({}, t, { ref: function(o) {
|
|
663
|
+
o ? (n.ref = o, n._listener || (n._listener = function(_) {
|
|
664
|
+
_.stopPropagation(), _.detail.context = e;
|
|
319
665
|
}, o.addEventListener("_preact", n._listener))) : n.ref.removeEventListener("_preact", n._listener);
|
|
320
666
|
} }));
|
|
321
667
|
}
|
|
322
|
-
function
|
|
323
|
-
function
|
|
324
|
-
var
|
|
325
|
-
return
|
|
668
|
+
function Ze(t, e, n, o) {
|
|
669
|
+
function _() {
|
|
670
|
+
var r = Reflect.construct(HTMLElement, [], _);
|
|
671
|
+
return r._vdomComponent = t, r._root = r, r;
|
|
326
672
|
}
|
|
327
|
-
return (
|
|
328
|
-
Object.defineProperty(
|
|
329
|
-
return this._vdom.props[
|
|
330
|
-
}, set: function(
|
|
331
|
-
this._vdom ? this.attributeChangedCallback(
|
|
332
|
-
var
|
|
333
|
-
|
|
673
|
+
return (_.prototype = Object.create(HTMLElement.prototype)).constructor = _, _.prototype.connectedCallback = Ke, _.prototype.attributeChangedCallback = Qe, _.prototype.disconnectedCallback = Xe, n = n || t.observedAttributes || Object.keys(t.propTypes || {}), _.observedAttributes = n, n.forEach(function(r) {
|
|
674
|
+
Object.defineProperty(_.prototype, r, { get: function() {
|
|
675
|
+
return this._vdom.props[r];
|
|
676
|
+
}, set: function(l) {
|
|
677
|
+
this._vdom ? this.attributeChangedCallback(r, null, l) : (this._props || (this._props = {}), this._props[r] = l, this.connectedCallback());
|
|
678
|
+
var a = typeof l;
|
|
679
|
+
l != null && a !== "string" && a !== "boolean" && a !== "number" || this.setAttribute(r, l);
|
|
334
680
|
} });
|
|
335
|
-
}), customElements.define(e,
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
681
|
+
}), customElements.define(e, _);
|
|
682
|
+
}
|
|
683
|
+
function et(t) {
|
|
684
|
+
const [e, n] = Ne(!1), o = t.theme?.primaryColor;
|
|
685
|
+
return /* @__PURE__ */ d("div", { children: [
|
|
686
|
+
/* @__PURE__ */ d(Ve, { color: o, onClick: () => n(!0), children: "打开表单" }),
|
|
687
|
+
/* @__PURE__ */ d(
|
|
688
|
+
Ye,
|
|
689
|
+
{
|
|
690
|
+
visible: e,
|
|
691
|
+
onClose: () => n(!1),
|
|
692
|
+
onSubmit: async (r) => {
|
|
693
|
+
console.log("submit", r);
|
|
694
|
+
},
|
|
695
|
+
color: o
|
|
696
|
+
}
|
|
697
|
+
)
|
|
698
|
+
] });
|
|
699
|
+
}
|
|
700
|
+
Ze(et, "x-best-modal-form", ["theme"]);
|
|
701
|
+
const rt = ["x-greeting", "x-best-modal-form"];
|
|
344
702
|
export {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
703
|
+
rt as components,
|
|
704
|
+
tt as npmTest,
|
|
705
|
+
nt as printCurrentTime
|
|
348
706
|
};
|