react-toolkits 0.4.5 → 0.6.0
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/CHANGELOG.md +12 -0
- package/README.md +2 -2
- package/lib/immer-BLf7GM7E.chunk.js +459 -0
- package/lib/index-2SHMEtr5.chunk.js +187 -0
- package/lib/index-Az2otllN.chunk.js +29 -0
- package/lib/index-JjvTRqXl.chunk.js +15899 -0
- package/lib/index-LBQxrJbq.chunk.js +179 -0
- package/lib/index-Vz7iekAl.chunk.js +55 -0
- package/lib/index-iOH0e1Qh.chunk.js +170 -0
- package/lib/index-pJtu-Y0P.chunk.js +39 -0
- package/lib/index-tPqUq6j8.chunk.js +380 -0
- package/lib/index-vnTljYqB.chunk.js +212 -0
- package/lib/{index.d.mts → index.d.ts} +410 -360
- package/lib/index.js +35 -27
- package/lib/style.css +1 -0
- package/locales/{index-Xn8Uwe6G.d.mts → en_GB.d.ts} +93 -87
- package/locales/en_GB.js +91 -5
- package/locales/ja_JP.d.ts +93 -0
- package/locales/ja_JP.js +91 -5
- package/locales/ko_KR.d.ts +93 -0
- package/locales/ko_KR.js +91 -5
- package/locales/zh_CN.d.ts +93 -0
- package/locales/zh_CN.js +91 -5
- package/package.json +27 -21
- package/lib/index.css +0 -2
- package/lib/index.css.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/logo-L6MFCL6M.png +0 -0
- package/locales/en_GB.d.mts +0 -5
- package/locales/en_GB.js.map +0 -1
- package/locales/ja_JP.d.mts +0 -5
- package/locales/ja_JP.js.map +0 -1
- package/locales/ko_KR.d.mts +0 -5
- package/locales/ko_KR.js.map +0 -1
- package/locales/zh_CN.d.mts +0 -5
- package/locales/zh_CN.js.map +0 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ const root = createRoot(container)
|
|
|
20
20
|
const items: NavMenuItem[] = []
|
|
21
21
|
|
|
22
22
|
root.render(
|
|
23
|
-
<
|
|
23
|
+
<ContextProvider title="React Web" menuItems={items}>
|
|
24
24
|
<RouterProvider
|
|
25
25
|
router={router}
|
|
26
26
|
fallbackElement={
|
|
@@ -35,7 +35,7 @@ root.render(
|
|
|
35
35
|
/>
|
|
36
36
|
}
|
|
37
37
|
/>
|
|
38
|
-
</
|
|
38
|
+
</ContextProvider>,
|
|
39
39
|
)
|
|
40
40
|
|
|
41
41
|
```
|
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
var K = Symbol.for("immer-nothing"), j = Symbol.for("immer-draftable"), u = Symbol.for("immer-state"), Q = process.env.NODE_ENV !== "production" ? [
|
|
2
|
+
// All error codes, starting by 0:
|
|
3
|
+
function(e) {
|
|
4
|
+
return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`;
|
|
5
|
+
},
|
|
6
|
+
function(e) {
|
|
7
|
+
return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`;
|
|
8
|
+
},
|
|
9
|
+
"This object has been frozen and should not be mutated",
|
|
10
|
+
function(e) {
|
|
11
|
+
return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + e;
|
|
12
|
+
},
|
|
13
|
+
"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",
|
|
14
|
+
"Immer forbids circular references",
|
|
15
|
+
"The first or second argument to `produce` must be a function",
|
|
16
|
+
"The third argument to `produce` must be a function or undefined",
|
|
17
|
+
"First argument to `createDraft` must be a plain object, an array, or an immerable object",
|
|
18
|
+
"First argument to `finishDraft` must be a draft returned by `createDraft`",
|
|
19
|
+
function(e) {
|
|
20
|
+
return `'current' expects a draft, got: ${e}`;
|
|
21
|
+
},
|
|
22
|
+
"Object.defineProperty() cannot be used on an Immer draft",
|
|
23
|
+
"Object.setPrototypeOf() cannot be used on an Immer draft",
|
|
24
|
+
"Immer only supports deleting array indices",
|
|
25
|
+
"Immer only supports setting array indices and the 'length' property",
|
|
26
|
+
function(e) {
|
|
27
|
+
return `'original' expects a draft, got: ${e}`;
|
|
28
|
+
}
|
|
29
|
+
// Note: if more errors are added, the errorOffset in Patches.ts should be increased
|
|
30
|
+
// See Patches.ts for additional errors
|
|
31
|
+
] : [];
|
|
32
|
+
function s(e, ...t) {
|
|
33
|
+
if (process.env.NODE_ENV !== "production") {
|
|
34
|
+
const r = Q[e], n = typeof r == "function" ? r.apply(null, t) : r;
|
|
35
|
+
throw new Error(`[Immer] ${n}`);
|
|
36
|
+
}
|
|
37
|
+
throw new Error(
|
|
38
|
+
`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
var p = Object.getPrototypeOf;
|
|
42
|
+
function h(e) {
|
|
43
|
+
return !!e && !!e[u];
|
|
44
|
+
}
|
|
45
|
+
function _(e) {
|
|
46
|
+
var t;
|
|
47
|
+
return e ? U(e) || Array.isArray(e) || !!e[j] || !!((t = e.constructor) != null && t[j]) || O(e) || D(e) : !1;
|
|
48
|
+
}
|
|
49
|
+
var Y = Object.prototype.constructor.toString();
|
|
50
|
+
function U(e) {
|
|
51
|
+
if (!e || typeof e != "object")
|
|
52
|
+
return !1;
|
|
53
|
+
const t = p(e);
|
|
54
|
+
if (t === null)
|
|
55
|
+
return !0;
|
|
56
|
+
const r = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
|
|
57
|
+
return r === Object ? !0 : typeof r == "function" && Function.toString.call(r) === Y;
|
|
58
|
+
}
|
|
59
|
+
function m(e, t) {
|
|
60
|
+
z(e) === 0 ? Object.entries(e).forEach(([r, n]) => {
|
|
61
|
+
t(r, n, e);
|
|
62
|
+
}) : e.forEach((r, n) => t(n, r, e));
|
|
63
|
+
}
|
|
64
|
+
function z(e) {
|
|
65
|
+
const t = e[u];
|
|
66
|
+
return t ? t.type_ : Array.isArray(e) ? 1 : O(e) ? 2 : D(e) ? 3 : 0;
|
|
67
|
+
}
|
|
68
|
+
function N(e, t) {
|
|
69
|
+
return z(e) === 2 ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t);
|
|
70
|
+
}
|
|
71
|
+
function B(e, t, r) {
|
|
72
|
+
const n = z(e);
|
|
73
|
+
n === 2 ? e.set(t, r) : n === 3 ? e.add(r) : e[t] = r;
|
|
74
|
+
}
|
|
75
|
+
function Z(e, t) {
|
|
76
|
+
return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
|
|
77
|
+
}
|
|
78
|
+
function O(e) {
|
|
79
|
+
return e instanceof Map;
|
|
80
|
+
}
|
|
81
|
+
function D(e) {
|
|
82
|
+
return e instanceof Set;
|
|
83
|
+
}
|
|
84
|
+
function d(e) {
|
|
85
|
+
return e.copy_ || e.base_;
|
|
86
|
+
}
|
|
87
|
+
function v(e, t) {
|
|
88
|
+
if (O(e))
|
|
89
|
+
return new Map(e);
|
|
90
|
+
if (D(e))
|
|
91
|
+
return new Set(e);
|
|
92
|
+
if (Array.isArray(e))
|
|
93
|
+
return Array.prototype.slice.call(e);
|
|
94
|
+
if (!t && U(e))
|
|
95
|
+
return p(e) ? { ...e } : Object.assign(/* @__PURE__ */ Object.create(null), e);
|
|
96
|
+
const r = Object.getOwnPropertyDescriptors(e);
|
|
97
|
+
delete r[u];
|
|
98
|
+
let n = Reflect.ownKeys(r);
|
|
99
|
+
for (let i = 0; i < n.length; i++) {
|
|
100
|
+
const o = n[i], c = r[o];
|
|
101
|
+
c.writable === !1 && (c.writable = !0, c.configurable = !0), (c.get || c.set) && (r[o] = {
|
|
102
|
+
configurable: !0,
|
|
103
|
+
writable: !0,
|
|
104
|
+
// could live with !!desc.set as well here...
|
|
105
|
+
enumerable: c.enumerable,
|
|
106
|
+
value: e[o]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return Object.create(p(e), r);
|
|
110
|
+
}
|
|
111
|
+
function T(e, t = !1) {
|
|
112
|
+
return S(e) || h(e) || !_(e) || (z(e) > 1 && (e.set = e.add = e.clear = e.delete = L), Object.freeze(e), t && m(e, (r, n) => T(n, !0))), e;
|
|
113
|
+
}
|
|
114
|
+
function L() {
|
|
115
|
+
s(2);
|
|
116
|
+
}
|
|
117
|
+
function S(e) {
|
|
118
|
+
return Object.isFrozen(e);
|
|
119
|
+
}
|
|
120
|
+
var V = {};
|
|
121
|
+
function y(e) {
|
|
122
|
+
const t = V[e];
|
|
123
|
+
return t || s(0, e), t;
|
|
124
|
+
}
|
|
125
|
+
var P;
|
|
126
|
+
function G() {
|
|
127
|
+
return P;
|
|
128
|
+
}
|
|
129
|
+
function ee(e, t) {
|
|
130
|
+
return {
|
|
131
|
+
drafts_: [],
|
|
132
|
+
parent_: e,
|
|
133
|
+
immer_: t,
|
|
134
|
+
// Whenever the modified draft contains a draft from another scope, we
|
|
135
|
+
// need to prevent auto-freezing so the unowned draft can be finalized.
|
|
136
|
+
canAutoFreeze_: !0,
|
|
137
|
+
unfinalizedDrafts_: 0
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function R(e, t) {
|
|
141
|
+
t && (y("Patches"), e.patches_ = [], e.inversePatches_ = [], e.patchListener_ = t);
|
|
142
|
+
}
|
|
143
|
+
function E(e) {
|
|
144
|
+
C(e), e.drafts_.forEach(te), e.drafts_ = null;
|
|
145
|
+
}
|
|
146
|
+
function C(e) {
|
|
147
|
+
e === P && (P = e.parent_);
|
|
148
|
+
}
|
|
149
|
+
function x(e) {
|
|
150
|
+
return P = ee(P, e);
|
|
151
|
+
}
|
|
152
|
+
function te(e) {
|
|
153
|
+
const t = e[u];
|
|
154
|
+
t.type_ === 0 || t.type_ === 1 ? t.revoke_() : t.revoked_ = !0;
|
|
155
|
+
}
|
|
156
|
+
function $(e, t) {
|
|
157
|
+
t.unfinalizedDrafts_ = t.drafts_.length;
|
|
158
|
+
const r = t.drafts_[0];
|
|
159
|
+
return e !== void 0 && e !== r ? (r[u].modified_ && (E(t), s(4)), _(e) && (e = g(t, e), t.parent_ || w(t, e)), t.patches_ && y("Patches").generateReplacementPatches_(
|
|
160
|
+
r[u].base_,
|
|
161
|
+
e,
|
|
162
|
+
t.patches_,
|
|
163
|
+
t.inversePatches_
|
|
164
|
+
)) : e = g(t, r, []), E(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), e !== K ? e : void 0;
|
|
165
|
+
}
|
|
166
|
+
function g(e, t, r) {
|
|
167
|
+
if (S(t))
|
|
168
|
+
return t;
|
|
169
|
+
const n = t[u];
|
|
170
|
+
if (!n)
|
|
171
|
+
return m(
|
|
172
|
+
t,
|
|
173
|
+
(i, o) => W(e, n, t, i, o, r)
|
|
174
|
+
), t;
|
|
175
|
+
if (n.scope_ !== e)
|
|
176
|
+
return t;
|
|
177
|
+
if (!n.modified_)
|
|
178
|
+
return w(e, n.base_, !0), n.base_;
|
|
179
|
+
if (!n.finalized_) {
|
|
180
|
+
n.finalized_ = !0, n.scope_.unfinalizedDrafts_--;
|
|
181
|
+
const i = n.copy_;
|
|
182
|
+
let o = i, c = !1;
|
|
183
|
+
n.type_ === 3 && (o = new Set(i), i.clear(), c = !0), m(
|
|
184
|
+
o,
|
|
185
|
+
(f, l) => W(e, n, i, f, l, r, c)
|
|
186
|
+
), w(e, i, !1), r && e.patches_ && y("Patches").generatePatches_(
|
|
187
|
+
n,
|
|
188
|
+
r,
|
|
189
|
+
e.patches_,
|
|
190
|
+
e.inversePatches_
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
return n.copy_;
|
|
194
|
+
}
|
|
195
|
+
function W(e, t, r, n, i, o, c) {
|
|
196
|
+
if (process.env.NODE_ENV !== "production" && i === r && s(5), h(i)) {
|
|
197
|
+
const f = o && t && t.type_ !== 3 && // Set objects are atomic since they have no keys.
|
|
198
|
+
!N(t.assigned_, n) ? o.concat(n) : void 0, l = g(e, i, f);
|
|
199
|
+
if (B(r, n, l), h(l))
|
|
200
|
+
e.canAutoFreeze_ = !1;
|
|
201
|
+
else
|
|
202
|
+
return;
|
|
203
|
+
} else
|
|
204
|
+
c && r.add(i);
|
|
205
|
+
if (_(i) && !S(i)) {
|
|
206
|
+
if (!e.immer_.autoFreeze_ && e.unfinalizedDrafts_ < 1)
|
|
207
|
+
return;
|
|
208
|
+
g(e, i), (!t || !t.scope_.parent_) && w(e, i);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function w(e, t, r = !1) {
|
|
212
|
+
!e.parent_ && e.immer_.autoFreeze_ && e.canAutoFreeze_ && T(t, r);
|
|
213
|
+
}
|
|
214
|
+
function re(e, t) {
|
|
215
|
+
const r = Array.isArray(e), n = {
|
|
216
|
+
type_: r ? 1 : 0,
|
|
217
|
+
// Track which produce call this is associated with.
|
|
218
|
+
scope_: t ? t.scope_ : G(),
|
|
219
|
+
// True for both shallow and deep changes.
|
|
220
|
+
modified_: !1,
|
|
221
|
+
// Used during finalization.
|
|
222
|
+
finalized_: !1,
|
|
223
|
+
// Track which properties have been assigned (true) or deleted (false).
|
|
224
|
+
assigned_: {},
|
|
225
|
+
// The parent draft state.
|
|
226
|
+
parent_: t,
|
|
227
|
+
// The base state.
|
|
228
|
+
base_: e,
|
|
229
|
+
// The base proxy.
|
|
230
|
+
draft_: null,
|
|
231
|
+
// set below
|
|
232
|
+
// The base copy with any updated values.
|
|
233
|
+
copy_: null,
|
|
234
|
+
// Called by the `produce` function.
|
|
235
|
+
revoke_: null,
|
|
236
|
+
isManual_: !1
|
|
237
|
+
};
|
|
238
|
+
let i = n, o = M;
|
|
239
|
+
r && (i = [n], o = b);
|
|
240
|
+
const { revoke: c, proxy: f } = Proxy.revocable(i, o);
|
|
241
|
+
return n.draft_ = f, n.revoke_ = c, f;
|
|
242
|
+
}
|
|
243
|
+
var M = {
|
|
244
|
+
get(e, t) {
|
|
245
|
+
if (t === u)
|
|
246
|
+
return e;
|
|
247
|
+
const r = d(e);
|
|
248
|
+
if (!N(r, t))
|
|
249
|
+
return ne(e, r, t);
|
|
250
|
+
const n = r[t];
|
|
251
|
+
return e.finalized_ || !_(n) ? n : n === F(e.base_, t) ? (A(e), e.copy_[t] = I(n, e)) : n;
|
|
252
|
+
},
|
|
253
|
+
has(e, t) {
|
|
254
|
+
return t in d(e);
|
|
255
|
+
},
|
|
256
|
+
ownKeys(e) {
|
|
257
|
+
return Reflect.ownKeys(d(e));
|
|
258
|
+
},
|
|
259
|
+
set(e, t, r) {
|
|
260
|
+
const n = H(d(e), t);
|
|
261
|
+
if (n != null && n.set)
|
|
262
|
+
return n.set.call(e.draft_, r), !0;
|
|
263
|
+
if (!e.modified_) {
|
|
264
|
+
const i = F(d(e), t), o = i == null ? void 0 : i[u];
|
|
265
|
+
if (o && o.base_ === r)
|
|
266
|
+
return e.copy_[t] = r, e.assigned_[t] = !1, !0;
|
|
267
|
+
if (Z(r, i) && (r !== void 0 || N(e.base_, t)))
|
|
268
|
+
return !0;
|
|
269
|
+
A(e), k(e);
|
|
270
|
+
}
|
|
271
|
+
return e.copy_[t] === r && // special case: handle new props with value 'undefined'
|
|
272
|
+
(r !== void 0 || t in e.copy_) || // special case: NaN
|
|
273
|
+
Number.isNaN(r) && Number.isNaN(e.copy_[t]) || (e.copy_[t] = r, e.assigned_[t] = !0), !0;
|
|
274
|
+
},
|
|
275
|
+
deleteProperty(e, t) {
|
|
276
|
+
return F(e.base_, t) !== void 0 || t in e.base_ ? (e.assigned_[t] = !1, A(e), k(e)) : delete e.assigned_[t], e.copy_ && delete e.copy_[t], !0;
|
|
277
|
+
},
|
|
278
|
+
// Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
279
|
+
// the same guarantee in ES5 mode.
|
|
280
|
+
getOwnPropertyDescriptor(e, t) {
|
|
281
|
+
const r = d(e), n = Reflect.getOwnPropertyDescriptor(r, t);
|
|
282
|
+
return n && {
|
|
283
|
+
writable: !0,
|
|
284
|
+
configurable: e.type_ !== 1 || t !== "length",
|
|
285
|
+
enumerable: n.enumerable,
|
|
286
|
+
value: r[t]
|
|
287
|
+
};
|
|
288
|
+
},
|
|
289
|
+
defineProperty() {
|
|
290
|
+
s(11);
|
|
291
|
+
},
|
|
292
|
+
getPrototypeOf(e) {
|
|
293
|
+
return p(e.base_);
|
|
294
|
+
},
|
|
295
|
+
setPrototypeOf() {
|
|
296
|
+
s(12);
|
|
297
|
+
}
|
|
298
|
+
}, b = {};
|
|
299
|
+
m(M, (e, t) => {
|
|
300
|
+
b[e] = function() {
|
|
301
|
+
return arguments[0] = arguments[0][0], t.apply(this, arguments);
|
|
302
|
+
};
|
|
303
|
+
});
|
|
304
|
+
b.deleteProperty = function(e, t) {
|
|
305
|
+
return process.env.NODE_ENV !== "production" && isNaN(parseInt(t)) && s(13), b.set.call(this, e, t, void 0);
|
|
306
|
+
};
|
|
307
|
+
b.set = function(e, t, r) {
|
|
308
|
+
return process.env.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && s(14), M.set.call(this, e[0], t, r, e[0]);
|
|
309
|
+
};
|
|
310
|
+
function F(e, t) {
|
|
311
|
+
const r = e[u];
|
|
312
|
+
return (r ? d(r) : e)[t];
|
|
313
|
+
}
|
|
314
|
+
function ne(e, t, r) {
|
|
315
|
+
var i;
|
|
316
|
+
const n = H(t, r);
|
|
317
|
+
return n ? "value" in n ? n.value : (
|
|
318
|
+
// This is a very special case, if the prop is a getter defined by the
|
|
319
|
+
// prototype, we should invoke it with the draft as context!
|
|
320
|
+
(i = n.get) == null ? void 0 : i.call(e.draft_)
|
|
321
|
+
) : void 0;
|
|
322
|
+
}
|
|
323
|
+
function H(e, t) {
|
|
324
|
+
if (!(t in e))
|
|
325
|
+
return;
|
|
326
|
+
let r = p(e);
|
|
327
|
+
for (; r; ) {
|
|
328
|
+
const n = Object.getOwnPropertyDescriptor(r, t);
|
|
329
|
+
if (n)
|
|
330
|
+
return n;
|
|
331
|
+
r = p(r);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function k(e) {
|
|
335
|
+
e.modified_ || (e.modified_ = !0, e.parent_ && k(e.parent_));
|
|
336
|
+
}
|
|
337
|
+
function A(e) {
|
|
338
|
+
e.copy_ || (e.copy_ = v(
|
|
339
|
+
e.base_,
|
|
340
|
+
e.scope_.immer_.useStrictShallowCopy_
|
|
341
|
+
));
|
|
342
|
+
}
|
|
343
|
+
var ie = class {
|
|
344
|
+
constructor(e) {
|
|
345
|
+
this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.produce = (t, r, n) => {
|
|
346
|
+
if (typeof t == "function" && typeof r != "function") {
|
|
347
|
+
const o = r;
|
|
348
|
+
r = t;
|
|
349
|
+
const c = this;
|
|
350
|
+
return function(l = o, ...q) {
|
|
351
|
+
return c.produce(l, (J) => r.call(this, J, ...q));
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
typeof r != "function" && s(6), n !== void 0 && typeof n != "function" && s(7);
|
|
355
|
+
let i;
|
|
356
|
+
if (_(t)) {
|
|
357
|
+
const o = x(this), c = I(t, void 0);
|
|
358
|
+
let f = !0;
|
|
359
|
+
try {
|
|
360
|
+
i = r(c), f = !1;
|
|
361
|
+
} finally {
|
|
362
|
+
f ? E(o) : C(o);
|
|
363
|
+
}
|
|
364
|
+
return R(o, n), $(i, o);
|
|
365
|
+
} else if (!t || typeof t != "object") {
|
|
366
|
+
if (i = r(t), i === void 0 && (i = t), i === K && (i = void 0), this.autoFreeze_ && T(i, !0), n) {
|
|
367
|
+
const o = [], c = [];
|
|
368
|
+
y("Patches").generateReplacementPatches_(t, i, o, c), n(o, c);
|
|
369
|
+
}
|
|
370
|
+
return i;
|
|
371
|
+
} else
|
|
372
|
+
s(1, t);
|
|
373
|
+
}, this.produceWithPatches = (t, r) => {
|
|
374
|
+
if (typeof t == "function")
|
|
375
|
+
return (c, ...f) => this.produceWithPatches(c, (l) => t(l, ...f));
|
|
376
|
+
let n, i;
|
|
377
|
+
return [this.produce(t, r, (c, f) => {
|
|
378
|
+
n = c, i = f;
|
|
379
|
+
}), n, i];
|
|
380
|
+
}, typeof (e == null ? void 0 : e.autoFreeze) == "boolean" && this.setAutoFreeze(e.autoFreeze), typeof (e == null ? void 0 : e.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(e.useStrictShallowCopy);
|
|
381
|
+
}
|
|
382
|
+
createDraft(e) {
|
|
383
|
+
_(e) || s(8), h(e) && (e = oe(e));
|
|
384
|
+
const t = x(this), r = I(e, void 0);
|
|
385
|
+
return r[u].isManual_ = !0, C(t), r;
|
|
386
|
+
}
|
|
387
|
+
finishDraft(e, t) {
|
|
388
|
+
const r = e && e[u];
|
|
389
|
+
(!r || !r.isManual_) && s(9);
|
|
390
|
+
const { scope_: n } = r;
|
|
391
|
+
return R(n, t), $(void 0, n);
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Pass true to automatically freeze all copies created by Immer.
|
|
395
|
+
*
|
|
396
|
+
* By default, auto-freezing is enabled.
|
|
397
|
+
*/
|
|
398
|
+
setAutoFreeze(e) {
|
|
399
|
+
this.autoFreeze_ = e;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Pass true to enable strict shallow copy.
|
|
403
|
+
*
|
|
404
|
+
* By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
|
|
405
|
+
*/
|
|
406
|
+
setUseStrictShallowCopy(e) {
|
|
407
|
+
this.useStrictShallowCopy_ = e;
|
|
408
|
+
}
|
|
409
|
+
applyPatches(e, t) {
|
|
410
|
+
let r;
|
|
411
|
+
for (r = t.length - 1; r >= 0; r--) {
|
|
412
|
+
const i = t[r];
|
|
413
|
+
if (i.path.length === 0 && i.op === "replace") {
|
|
414
|
+
e = i.value;
|
|
415
|
+
break;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
r > -1 && (t = t.slice(r + 1));
|
|
419
|
+
const n = y("Patches").applyPatches_;
|
|
420
|
+
return h(e) ? n(e, t) : this.produce(
|
|
421
|
+
e,
|
|
422
|
+
(i) => n(i, t)
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
function I(e, t) {
|
|
427
|
+
const r = O(e) ? y("MapSet").proxyMap_(e, t) : D(e) ? y("MapSet").proxySet_(e, t) : re(e, t);
|
|
428
|
+
return (t ? t.scope_ : G()).drafts_.push(r), r;
|
|
429
|
+
}
|
|
430
|
+
function oe(e) {
|
|
431
|
+
return h(e) || s(10, e), X(e);
|
|
432
|
+
}
|
|
433
|
+
function X(e) {
|
|
434
|
+
if (!_(e) || S(e))
|
|
435
|
+
return e;
|
|
436
|
+
const t = e[u];
|
|
437
|
+
let r;
|
|
438
|
+
if (t) {
|
|
439
|
+
if (!t.modified_)
|
|
440
|
+
return t.base_;
|
|
441
|
+
t.finalized_ = !0, r = v(e, t.scope_.immer_.useStrictShallowCopy_);
|
|
442
|
+
} else
|
|
443
|
+
r = v(e, !0);
|
|
444
|
+
return m(r, (n, i) => {
|
|
445
|
+
B(r, n, X(i));
|
|
446
|
+
}), t && (t.finalized_ = !1), r;
|
|
447
|
+
}
|
|
448
|
+
var a = new ie(), ce = a.produce;
|
|
449
|
+
a.produceWithPatches.bind(
|
|
450
|
+
a
|
|
451
|
+
);
|
|
452
|
+
a.setAutoFreeze.bind(a);
|
|
453
|
+
a.setUseStrictShallowCopy.bind(a);
|
|
454
|
+
a.applyPatches.bind(a);
|
|
455
|
+
a.createDraft.bind(a);
|
|
456
|
+
a.finishDraft.bind(a);
|
|
457
|
+
export {
|
|
458
|
+
ce as p
|
|
459
|
+
};
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { A as T, _ as N, f as b, u as U, j as e, P as g, H as R, Q as z, h as I } from "./index-JjvTRqXl.chunk.js";
|
|
2
|
+
import { App as f, Row as H, Col as E, Tag as L, Space as G, Card as Q, Form as d, Input as j, Select as y } from "antd";
|
|
3
|
+
import { p as S } from "./immer-BLf7GM7E.chunk.js";
|
|
4
|
+
import { Link as _ } from "react-router-dom";
|
|
5
|
+
import { f as $, g as q, h as k, i as B } from "./index-vnTljYqB.chunk.js";
|
|
6
|
+
import * as v from "react";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
var D = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M678.3 642.4c24.2-13 51.9-20.4 81.4-20.4h.1c3 0 4.4-3.6 2.2-5.6a371.67 371.67 0 00-103.7-65.8c-.4-.2-.8-.3-1.2-.5C719.2 505 759.6 431.7 759.6 349c0-137-110.8-248-247.5-248S264.7 212 264.7 349c0 82.7 40.4 156 102.6 201.1-.4.2-.8.3-1.2.5-44.7 18.9-84.8 46-119.3 80.6a373.42 373.42 0 00-80.4 119.5A373.6 373.6 0 00137 888.8a8 8 0 008 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C357 628.2 432.2 597 512.2 597c56.7 0 111.1 15.7 158 45.1a8.1 8.1 0 008.1.3zM512.2 521c-45.8 0-88.9-17.9-121.4-50.4A171.2 171.2 0 01340.5 349c0-45.9 17.9-89.1 50.3-121.6S466.3 177 512.2 177s88.9 17.9 121.4 50.4A171.2 171.2 0 01683.9 349c0 45.9-17.9 89.1-50.3 121.6C601.1 503.1 558 521 512.2 521zM880 759h-84v-84c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v84h-84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h84v84c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-84h84c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z" } }] }, name: "user-add", theme: "outlined" };
|
|
9
|
+
const F = D;
|
|
10
|
+
var O = function(c, r) {
|
|
11
|
+
return /* @__PURE__ */ v.createElement(T, N({}, c, {
|
|
12
|
+
ref: r,
|
|
13
|
+
icon: F
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
process.env.NODE_ENV !== "production" && (O.displayName = "UserAddOutlined");
|
|
17
|
+
const P = /* @__PURE__ */ v.forwardRef(O), { Option: V } = y, h = "/api/usystem/user/list";
|
|
18
|
+
function K() {
|
|
19
|
+
const { message: u } = f.useApp(), c = q(), { data: r, isLoading: m } = k(), { mutate: p } = b(), n = U();
|
|
20
|
+
return I({
|
|
21
|
+
title: n("UserList.createTitle"),
|
|
22
|
+
content: (l) => /* @__PURE__ */ e.jsxs(d, { form: l, labelCol: { flex: "80px" }, children: [
|
|
23
|
+
/* @__PURE__ */ e.jsx(d.Item, { label: n("global.name"), name: "name", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(j, {}) }),
|
|
24
|
+
/* @__PURE__ */ e.jsx(d.Item, { label: n("global.role"), name: "roles", children: /* @__PURE__ */ e.jsx(y, { allowClear: !0, mode: "multiple", loading: m, children: (r ?? []).map((i) => /* @__PURE__ */ e.jsx(V, { value: i.name, children: i.name }, i.id)) }) })
|
|
25
|
+
] }),
|
|
26
|
+
async onConfirm(l) {
|
|
27
|
+
await c.trigger(l), p(h, { page: 1 }), u.success(n("UserList.createSuccessfully"));
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function J() {
|
|
32
|
+
const { message: u } = f.useApp(), c = B(), { data: r, isLoading: m } = k(), { mutate: p } = b(), n = U();
|
|
33
|
+
return I({
|
|
34
|
+
title: n("UserList.updateTitle"),
|
|
35
|
+
content: (l) => /* @__PURE__ */ e.jsxs(d, { form: l, labelCol: { flex: "80px" }, children: [
|
|
36
|
+
/* @__PURE__ */ e.jsx(d.Item, { hidden: !0, name: "id", children: /* @__PURE__ */ e.jsx(j, {}) }),
|
|
37
|
+
/* @__PURE__ */ e.jsx(d.Item, { label: n("global.name"), name: "name", rules: [{ required: !0 }], children: /* @__PURE__ */ e.jsx(j, { readOnly: !0 }) }),
|
|
38
|
+
/* @__PURE__ */ e.jsx(d.Item, { label: n("global.role"), name: "roles", children: /* @__PURE__ */ e.jsx(
|
|
39
|
+
y,
|
|
40
|
+
{
|
|
41
|
+
allowClear: !0,
|
|
42
|
+
mode: "multiple",
|
|
43
|
+
loading: m,
|
|
44
|
+
options: r == null ? void 0 : r.map((i) => ({
|
|
45
|
+
label: i.name,
|
|
46
|
+
value: i.name
|
|
47
|
+
})),
|
|
48
|
+
dropdownStyle: { zIndex: 9999 }
|
|
49
|
+
}
|
|
50
|
+
) })
|
|
51
|
+
] }),
|
|
52
|
+
async onConfirm(l) {
|
|
53
|
+
await c.trigger(l), p(
|
|
54
|
+
h,
|
|
55
|
+
void 0,
|
|
56
|
+
(i) => S(i, (s) => {
|
|
57
|
+
var t;
|
|
58
|
+
const x = (t = s == null ? void 0 : s.list) == null ? void 0 : t.find((o) => o.id === l.id);
|
|
59
|
+
x && (x.roles = l.roles);
|
|
60
|
+
}),
|
|
61
|
+
{ revalidate: !1 }
|
|
62
|
+
), u.success(n("UserList.updateSuccessfully"));
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
const te = () => {
|
|
67
|
+
const { modal: u, message: c } = f.useApp(), r = $(), { mutate: m } = b(), { show: p, contextHolder: n } = K(), { show: l, contextHolder: i } = J(), s = U(), x = [
|
|
68
|
+
{
|
|
69
|
+
title: s("global.name"),
|
|
70
|
+
dataIndex: "name",
|
|
71
|
+
key: "name"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
title: "ID",
|
|
75
|
+
dataIndex: "id",
|
|
76
|
+
key: "id"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
title: s("global.role"),
|
|
80
|
+
dataIndex: "roles",
|
|
81
|
+
key: "roles",
|
|
82
|
+
width: "40%",
|
|
83
|
+
render(t) {
|
|
84
|
+
return /* @__PURE__ */ e.jsx(H, { gutter: [4, 4], children: (t || []).map((o) => /* @__PURE__ */ e.jsx(E, { children: o === "root" ? /* @__PURE__ */ e.jsx(L, { color: "#f50", children: o }) : /* @__PURE__ */ e.jsx(L, { color: "#ff5a00", children: /* @__PURE__ */ e.jsx(_, { to: `/permission/role/${o}`, children: o }) }) }, o)) });
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
title: s("global.creationTime"),
|
|
89
|
+
dataIndex: "Ctime",
|
|
90
|
+
key: "ctime"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
title: s("global.operation"),
|
|
94
|
+
width: 150,
|
|
95
|
+
align: "center",
|
|
96
|
+
render: (t) => /* @__PURE__ */ e.jsxs(G, { children: [
|
|
97
|
+
/* @__PURE__ */ e.jsx(
|
|
98
|
+
g,
|
|
99
|
+
{
|
|
100
|
+
isGlobalNS: !0,
|
|
101
|
+
size: "small",
|
|
102
|
+
type: "link",
|
|
103
|
+
code: "100003",
|
|
104
|
+
onClick: () => {
|
|
105
|
+
l({
|
|
106
|
+
initialValues: {
|
|
107
|
+
id: t.id,
|
|
108
|
+
name: t.name,
|
|
109
|
+
roles: t.roles
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
children: s("global.update")
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ e.jsx(
|
|
117
|
+
g,
|
|
118
|
+
{
|
|
119
|
+
isGlobalNS: !0,
|
|
120
|
+
danger: !0,
|
|
121
|
+
size: "small",
|
|
122
|
+
code: "100004",
|
|
123
|
+
type: "link",
|
|
124
|
+
onClick: () => {
|
|
125
|
+
u.confirm({
|
|
126
|
+
title: s("UserList.deleteTitle"),
|
|
127
|
+
content: /* @__PURE__ */ e.jsx(R, { texts: [t.name], children: s("UserList.deleteContent", { user: t.name }) }),
|
|
128
|
+
async onOk() {
|
|
129
|
+
await r.trigger({
|
|
130
|
+
id: t.id,
|
|
131
|
+
name: t.name
|
|
132
|
+
}), m(h, void 0, (o) => S(o, (a) => {
|
|
133
|
+
var w, A;
|
|
134
|
+
const C = (w = a == null ? void 0 : a.list) == null ? void 0 : w.findIndex((M) => M.id === t.id);
|
|
135
|
+
C && ((A = a == null ? void 0 : a.list) == null || A.splice(C, 1));
|
|
136
|
+
})), c.success(s("UserList.deleteSuccessfully"));
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
children: s("global.delete")
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
] })
|
|
144
|
+
}
|
|
145
|
+
];
|
|
146
|
+
return /* @__PURE__ */ e.jsxs(
|
|
147
|
+
Q,
|
|
148
|
+
{
|
|
149
|
+
title: s("global.user"),
|
|
150
|
+
extra: /* @__PURE__ */ e.jsx(
|
|
151
|
+
g,
|
|
152
|
+
{
|
|
153
|
+
isGlobalNS: !0,
|
|
154
|
+
type: "primary",
|
|
155
|
+
icon: /* @__PURE__ */ e.jsx(P, {}),
|
|
156
|
+
code: "100002",
|
|
157
|
+
onClick: () => {
|
|
158
|
+
p();
|
|
159
|
+
},
|
|
160
|
+
children: s("UserList.createTitle")
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ e.jsx(
|
|
165
|
+
z,
|
|
166
|
+
{
|
|
167
|
+
isGlobalNS: !0,
|
|
168
|
+
code: "100001",
|
|
169
|
+
url: h,
|
|
170
|
+
rowKey: "id",
|
|
171
|
+
columns: x,
|
|
172
|
+
transformResponse: (t) => {
|
|
173
|
+
const { List: o, Total: a } = t;
|
|
174
|
+
return { list: o, total: a };
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
n,
|
|
179
|
+
i
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
export {
|
|
185
|
+
te as default,
|
|
186
|
+
h as url
|
|
187
|
+
};
|