@nutui/nutui-react-taro 2.3.4 → 2.3.6-beta.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.
Files changed (76) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/esm/Address/style/style.css +1 -1
  3. package/dist/esm/Audio/style/style.css +1 -1
  4. package/dist/esm/Audio.js +2 -2
  5. package/dist/esm/AvatarCropper/style/style.css +1 -1
  6. package/dist/esm/AvatarCropper.js +1 -1
  7. package/dist/esm/Cascader/style/style.css +1 -1
  8. package/dist/esm/DatePicker/style/style.css +1 -1
  9. package/dist/esm/DatePicker.js +2 -2
  10. package/dist/esm/Dialog/style/style.css +1 -1
  11. package/dist/esm/Empty.js +4 -1
  12. package/dist/esm/ImagePreview.js +1 -1
  13. package/dist/esm/Picker/style/style.css +1 -1
  14. package/dist/esm/Picker.js +1 -1
  15. package/dist/esm/PullToRefresh.js +2 -1
  16. package/dist/esm/Range/style/style.css +1 -1
  17. package/dist/esm/Range.js +1 -1
  18. package/dist/esm/Tabs/style/style.css +1 -1
  19. package/dist/esm/{audio.taro-Z23xRUZF.js → audio.taro-ixcoTq7M.js} +1 -1
  20. package/dist/esm/{avatarcropper.taro-H77gHZmo.js → avatarcropper.taro-OjudqSeT.js} +6 -4
  21. package/dist/esm/{datepicker.taro-9VuzlCew.js → datepicker.taro-OrqtwJFM.js} +1 -1
  22. package/dist/esm/empty.taro-vxcxYcB5.js +70 -0
  23. package/dist/esm/{imagepreview.taro-DKFWoFNy.js → imagepreview.taro-_dileEvw.js} +3 -1
  24. package/dist/esm/nutui-react.es.js +8 -8
  25. package/dist/esm/{picker.taro-pRzPNgyZ.js → picker.taro-_bT5c-BS.js} +3 -3
  26. package/dist/esm/{pulltorefresh.taro-h0P58sPG.js → pulltorefresh.taro-VbzsD_HC.js} +3 -1
  27. package/dist/esm/{range.taro-S6WTiP1X.js → range.taro-mDYY3SXA.js} +16 -7
  28. package/dist/esm/types/src/packages/avatarcropper/avatarcropper.d.ts +2 -0
  29. package/dist/esm/types/src/packages/avatarcropper/avatarcropper.taro.d.ts +2 -0
  30. package/dist/esm/types/src/packages/avatarcropper/index.d.ts +1 -1
  31. package/dist/esm/types/src/packages/avatarcropper/index.taro.d.ts +1 -1
  32. package/dist/esm/types/src/packages/configprovider/types.d.ts +1 -1
  33. package/dist/esm/types/src/packages/empty/empty.taro.d.ts +1 -1
  34. package/dist/esm/types/src/packages/range/index.d.ts +2 -1
  35. package/dist/esm/types/src/packages/range/index.taro.d.ts +2 -1
  36. package/dist/esm/types/src/packages/range/range.d.ts +2 -2
  37. package/dist/esm/types/src/packages/range/range.taro.d.ts +2 -2
  38. package/dist/esm/types/src/packages/range/types.d.ts +6 -0
  39. package/dist/locales/base.js +1 -1
  40. package/dist/locales/en-US.js +1 -1
  41. package/dist/locales/id-ID.js +1 -1
  42. package/dist/locales/tr-TR.js +1 -1
  43. package/dist/locales/zh-CN.js +1 -1
  44. package/dist/locales/zh-TW.js +1 -1
  45. package/dist/locales/zh-UG.js +1 -1
  46. package/dist/nutui.react.es.js +646 -2021
  47. package/dist/nutui.react.umd.js +653 -2028
  48. package/dist/packages/avatarcropper/avatarcropper.scss +5 -0
  49. package/dist/packages/dialog/dialog.scss +1 -1
  50. package/dist/packages/picker/picker.scss +1 -0
  51. package/dist/packages/range/range.scss +2 -2
  52. package/dist/packages/tabs/tabs.scss +2 -2
  53. package/dist/style.css +1 -1
  54. package/dist/style.mjs +1 -1
  55. package/dist/styles/variables-jmapp.scss +9 -0
  56. package/dist/styles/variables.scss +9 -0
  57. package/dist/types/packages/avatarcropper/avatarcropper.d.ts +2 -0
  58. package/dist/types/packages/avatarcropper/avatarcropper.taro.d.ts +6 -0
  59. package/dist/types/packages/avatarcropper/index.d.ts +1 -1
  60. package/dist/types/packages/avatarcropper/index.taro.d.ts +1 -1
  61. package/dist/types/packages/configprovider/types.d.ts +1 -1
  62. package/dist/types/packages/empty/empty.taro.d.ts +1 -1
  63. package/dist/types/packages/imagepreview/imagepreview.taro.d.ts +5 -1
  64. package/dist/types/packages/infiniteloading/infiniteloading.taro.d.ts +1 -1
  65. package/dist/types/packages/range/index.d.ts +2 -1
  66. package/dist/types/packages/range/index.taro.d.ts +2 -1
  67. package/dist/types/packages/range/range.d.ts +2 -2
  68. package/dist/types/packages/range/range.taro.d.ts +2 -2
  69. package/dist/types/packages/range/types.d.ts +6 -0
  70. package/dist/types/packages/space/space.taro.d.ts +1 -1
  71. package/dist/types/packages/swipe/swipe.taro.d.ts +3 -3
  72. package/dist/types/packages/tabs/tabs.taro.d.ts +1 -1
  73. package/package.json +2 -2
  74. package/dist/esm/css.js +0 -1
  75. package/dist/esm/empty.taro-CE-H96el.js +0 -805
  76. package/dist/esm/style.css +0 -1
@@ -1,805 +0,0 @@
1
- import React__default, { useCallback, useState, useEffect } from "react";
2
- import classNames from "classnames";
3
- import { u as useConfig } from "./configprovider.taro-_wngOo0k.js";
4
- import { C as ComponentDefaults } from "./typings-buMpDfSR.js";
5
- var Q = { exports: {} }, W = {};
6
- /**
7
- * @license React
8
- * react-jsx-runtime.production.min.js
9
- *
10
- * Copyright (c) Facebook, Inc. and its affiliates.
11
- *
12
- * This source code is licensed under the MIT license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- */
15
- var Ce;
16
- function cr() {
17
- if (Ce)
18
- return W;
19
- Ce = 1;
20
- var P = React__default, T = Symbol.for("react.element"), D = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, w = P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, x = { key: true, ref: true, __self: true, __source: true };
21
- function C(m, c, _) {
22
- var f, h = {}, g = null, O = null;
23
- _ !== void 0 && (g = "" + _), c.key !== void 0 && (g = "" + c.key), c.ref !== void 0 && (O = c.ref);
24
- for (f in c)
25
- E.call(c, f) && !x.hasOwnProperty(f) && (h[f] = c[f]);
26
- if (m && m.defaultProps)
27
- for (f in c = m.defaultProps, c)
28
- h[f] === void 0 && (h[f] = c[f]);
29
- return { $$typeof: T, type: m, key: g, ref: O, props: h, _owner: w.current };
30
- }
31
- return W.Fragment = D, W.jsx = C, W.jsxs = C, W;
32
- }
33
- var N = {};
34
- /**
35
- * @license React
36
- * react-jsx-runtime.development.js
37
- *
38
- * Copyright (c) Facebook, Inc. and its affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */
43
- var Oe;
44
- function fr() {
45
- return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && function() {
46
- var P = React__default, T = Symbol.for("react.element"), D = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), C = Symbol.for("react.provider"), m = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), O = Symbol.for("react.offscreen"), A = Symbol.iterator, B = "@@iterator";
47
- function R(e) {
48
- if (e === null || typeof e != "object")
49
- return null;
50
- var r = A && e[A] || e[B];
51
- return typeof r == "function" ? r : null;
52
- }
53
- var j = P.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
54
- function d(e) {
55
- {
56
- for (var r = arguments.length, t2 = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
57
- t2[n - 1] = arguments[n];
58
- ke("error", e, t2);
59
- }
60
- }
61
- function ke(e, r, t2) {
62
- {
63
- var n = j.ReactDebugCurrentFrame, i = n.getStackAddendum();
64
- i !== "" && (r += "%s", t2 = t2.concat([i]));
65
- var u = t2.map(function(o) {
66
- return String(o);
67
- });
68
- u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
69
- }
70
- }
71
- var Fe = false, De = false, Ae = false, Ie = false, $e = false, re;
72
- re = Symbol.for("react.module.reference");
73
- function We(e) {
74
- return !!(typeof e == "string" || typeof e == "function" || e === E || e === x || $e || e === w || e === _ || e === f || Ie || e === O || Fe || De || Ae || typeof e == "object" && e !== null && (e.$$typeof === g || e.$$typeof === h || e.$$typeof === C || e.$$typeof === m || e.$$typeof === c || // This needs to include all possible module reference object
75
- // types supported by any Flight configuration anywhere since
76
- // we don't know which Flight build this will end up being used
77
- // with.
78
- e.$$typeof === re || e.getModuleId !== void 0));
79
- }
80
- function Ne(e, r, t2) {
81
- var n = e.displayName;
82
- if (n)
83
- return n;
84
- var i = r.displayName || r.name || "";
85
- return i !== "" ? t2 + "(" + i + ")" : t2;
86
- }
87
- function te(e) {
88
- return e.displayName || "Context";
89
- }
90
- function b(e) {
91
- if (e == null)
92
- return null;
93
- if (typeof e.tag == "number" && d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
94
- return e.displayName || e.name || null;
95
- if (typeof e == "string")
96
- return e;
97
- switch (e) {
98
- case E:
99
- return "Fragment";
100
- case D:
101
- return "Portal";
102
- case x:
103
- return "Profiler";
104
- case w:
105
- return "StrictMode";
106
- case _:
107
- return "Suspense";
108
- case f:
109
- return "SuspenseList";
110
- }
111
- if (typeof e == "object")
112
- switch (e.$$typeof) {
113
- case m:
114
- var r = e;
115
- return te(r) + ".Consumer";
116
- case C:
117
- var t2 = e;
118
- return te(t2._context) + ".Provider";
119
- case c:
120
- return Ne(e, e.render, "ForwardRef");
121
- case h:
122
- var n = e.displayName || null;
123
- return n !== null ? n : b(e.type) || "Memo";
124
- case g: {
125
- var i = e, u = i._payload, o = i._init;
126
- try {
127
- return b(o(u));
128
- } catch {
129
- return null;
130
- }
131
- }
132
- }
133
- return null;
134
- }
135
- var S = Object.assign, I = 0, ne, ae, oe, ie, ue, se, le;
136
- function ce() {
137
- }
138
- ce.__reactDisabledLog = true;
139
- function Ye() {
140
- {
141
- if (I === 0) {
142
- ne = console.log, ae = console.info, oe = console.warn, ie = console.error, ue = console.group, se = console.groupCollapsed, le = console.groupEnd;
143
- var e = {
144
- configurable: true,
145
- enumerable: true,
146
- value: ce,
147
- writable: true
148
- };
149
- Object.defineProperties(console, {
150
- info: e,
151
- log: e,
152
- warn: e,
153
- error: e,
154
- group: e,
155
- groupCollapsed: e,
156
- groupEnd: e
157
- });
158
- }
159
- I++;
160
- }
161
- }
162
- function Le() {
163
- {
164
- if (I--, I === 0) {
165
- var e = {
166
- configurable: true,
167
- enumerable: true,
168
- writable: true
169
- };
170
- Object.defineProperties(console, {
171
- log: S({}, e, {
172
- value: ne
173
- }),
174
- info: S({}, e, {
175
- value: ae
176
- }),
177
- warn: S({}, e, {
178
- value: oe
179
- }),
180
- error: S({}, e, {
181
- value: ie
182
- }),
183
- group: S({}, e, {
184
- value: ue
185
- }),
186
- groupCollapsed: S({}, e, {
187
- value: se
188
- }),
189
- groupEnd: S({}, e, {
190
- value: le
191
- })
192
- });
193
- }
194
- I < 0 && d("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
195
- }
196
- }
197
- var q = j.ReactCurrentDispatcher, J;
198
- function Y(e, r, t2) {
199
- {
200
- if (J === void 0)
201
- try {
202
- throw Error();
203
- } catch (i) {
204
- var n = i.stack.trim().match(/\n( *(at )?)/);
205
- J = n && n[1] || "";
206
- }
207
- return `
208
- ` + J + e;
209
- }
210
- }
211
- var G = false, L;
212
- {
213
- var Ve = typeof WeakMap == "function" ? WeakMap : Map;
214
- L = new Ve();
215
- }
216
- function fe(e, r) {
217
- if (!e || G)
218
- return "";
219
- {
220
- var t2 = L.get(e);
221
- if (t2 !== void 0)
222
- return t2;
223
- }
224
- var n;
225
- G = true;
226
- var i = Error.prepareStackTrace;
227
- Error.prepareStackTrace = void 0;
228
- var u;
229
- u = q.current, q.current = null, Ye();
230
- try {
231
- if (r) {
232
- var o = function() {
233
- throw Error();
234
- };
235
- if (Object.defineProperty(o.prototype, "props", {
236
- set: function() {
237
- throw Error();
238
- }
239
- }), typeof Reflect == "object" && Reflect.construct) {
240
- try {
241
- Reflect.construct(o, []);
242
- } catch (y) {
243
- n = y;
244
- }
245
- Reflect.construct(e, [], o);
246
- } else {
247
- try {
248
- o.call();
249
- } catch (y) {
250
- n = y;
251
- }
252
- e.call(o.prototype);
253
- }
254
- } else {
255
- try {
256
- throw Error();
257
- } catch (y) {
258
- n = y;
259
- }
260
- e();
261
- }
262
- } catch (y) {
263
- if (y && n && typeof y.stack == "string") {
264
- for (var a = y.stack.split(`
265
- `), v = n.stack.split(`
266
- `), s = a.length - 1, l = v.length - 1; s >= 1 && l >= 0 && a[s] !== v[l]; )
267
- l--;
268
- for (; s >= 1 && l >= 0; s--, l--)
269
- if (a[s] !== v[l]) {
270
- if (s !== 1 || l !== 1)
271
- do
272
- if (s--, l--, l < 0 || a[s] !== v[l]) {
273
- var p = `
274
- ` + a[s].replace(" at new ", " at ");
275
- return e.displayName && p.includes("<anonymous>") && (p = p.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, p), p;
276
- }
277
- while (s >= 1 && l >= 0);
278
- break;
279
- }
280
- }
281
- } finally {
282
- G = false, q.current = u, Le(), Error.prepareStackTrace = i;
283
- }
284
- var F = e ? e.displayName || e.name : "", we = F ? Y(F) : "";
285
- return typeof e == "function" && L.set(e, we), we;
286
- }
287
- function Me(e, r, t2) {
288
- return fe(e, false);
289
- }
290
- function Ue(e) {
291
- var r = e.prototype;
292
- return !!(r && r.isReactComponent);
293
- }
294
- function V(e, r, t2) {
295
- if (e == null)
296
- return "";
297
- if (typeof e == "function")
298
- return fe(e, Ue(e));
299
- if (typeof e == "string")
300
- return Y(e);
301
- switch (e) {
302
- case _:
303
- return Y("Suspense");
304
- case f:
305
- return Y("SuspenseList");
306
- }
307
- if (typeof e == "object")
308
- switch (e.$$typeof) {
309
- case c:
310
- return Me(e.render);
311
- case h:
312
- return V(e.type, r, t2);
313
- case g: {
314
- var n = e, i = n._payload, u = n._init;
315
- try {
316
- return V(u(i), r, t2);
317
- } catch {
318
- }
319
- }
320
- }
321
- return "";
322
- }
323
- var M = Object.prototype.hasOwnProperty, de = {}, ve = j.ReactDebugCurrentFrame;
324
- function U(e) {
325
- if (e) {
326
- var r = e._owner, t2 = V(e.type, e._source, r ? r.type : null);
327
- ve.setExtraStackFrame(t2);
328
- } else
329
- ve.setExtraStackFrame(null);
330
- }
331
- function Be(e, r, t2, n, i) {
332
- {
333
- var u = Function.call.bind(M);
334
- for (var o in e)
335
- if (u(e, o)) {
336
- var a = void 0;
337
- try {
338
- if (typeof e[o] != "function") {
339
- var v = Error((n || "React class") + ": " + t2 + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
340
- throw v.name = "Invariant Violation", v;
341
- }
342
- a = e[o](r, o, n, t2, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
343
- } catch (s) {
344
- a = s;
345
- }
346
- a && !(a instanceof Error) && (U(i), d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t2, o, typeof a), U(null)), a instanceof Error && !(a.message in de) && (de[a.message] = true, U(i), d("Failed %s type: %s", t2, a.message), U(null));
347
- }
348
- }
349
- }
350
- var qe = Array.isArray;
351
- function z(e) {
352
- return qe(e);
353
- }
354
- function Je(e) {
355
- {
356
- var r = typeof Symbol == "function" && Symbol.toStringTag, t2 = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
357
- return t2;
358
- }
359
- }
360
- function Ge(e) {
361
- try {
362
- return pe(e), false;
363
- } catch {
364
- return true;
365
- }
366
- }
367
- function pe(e) {
368
- return "" + e;
369
- }
370
- function he(e) {
371
- if (Ge(e))
372
- return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), pe(e);
373
- }
374
- var $ = j.ReactCurrentOwner, ze = {
375
- key: true,
376
- ref: true,
377
- __self: true,
378
- __source: true
379
- }, ge, me, H;
380
- H = {};
381
- function He(e) {
382
- if (M.call(e, "ref")) {
383
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
384
- if (r && r.isReactWarning)
385
- return false;
386
- }
387
- return e.ref !== void 0;
388
- }
389
- function Ke(e) {
390
- if (M.call(e, "key")) {
391
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
392
- if (r && r.isReactWarning)
393
- return false;
394
- }
395
- return e.key !== void 0;
396
- }
397
- function Xe(e, r) {
398
- if (typeof e.ref == "string" && $.current && r && $.current.stateNode !== r) {
399
- var t2 = b($.current.type);
400
- H[t2] || (d('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', b($.current.type), e.ref), H[t2] = true);
401
- }
402
- }
403
- function Ze(e, r) {
404
- {
405
- var t2 = function() {
406
- ge || (ge = true, d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
407
- };
408
- t2.isReactWarning = true, Object.defineProperty(e, "key", {
409
- get: t2,
410
- configurable: true
411
- });
412
- }
413
- }
414
- function Qe(e, r) {
415
- {
416
- var t2 = function() {
417
- me || (me = true, d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
418
- };
419
- t2.isReactWarning = true, Object.defineProperty(e, "ref", {
420
- get: t2,
421
- configurable: true
422
- });
423
- }
424
- }
425
- var er = function(e, r, t2, n, i, u, o) {
426
- var a = {
427
- // This tag allows us to uniquely identify this as a React Element
428
- $$typeof: T,
429
- // Built-in properties that belong on the element
430
- type: e,
431
- key: r,
432
- ref: t2,
433
- props: o,
434
- // Record the component responsible for creating this element.
435
- _owner: u
436
- };
437
- return a._store = {}, Object.defineProperty(a._store, "validated", {
438
- configurable: false,
439
- enumerable: false,
440
- writable: true,
441
- value: false
442
- }), Object.defineProperty(a, "_self", {
443
- configurable: false,
444
- enumerable: false,
445
- writable: false,
446
- value: n
447
- }), Object.defineProperty(a, "_source", {
448
- configurable: false,
449
- enumerable: false,
450
- writable: false,
451
- value: i
452
- }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
453
- };
454
- function rr(e, r, t2, n, i) {
455
- {
456
- var u, o = {}, a = null, v = null;
457
- t2 !== void 0 && (he(t2), a = "" + t2), Ke(r) && (he(r.key), a = "" + r.key), He(r) && (v = r.ref, Xe(r, i));
458
- for (u in r)
459
- M.call(r, u) && !ze.hasOwnProperty(u) && (o[u] = r[u]);
460
- if (e && e.defaultProps) {
461
- var s = e.defaultProps;
462
- for (u in s)
463
- o[u] === void 0 && (o[u] = s[u]);
464
- }
465
- if (a || v) {
466
- var l = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
467
- a && Ze(o, l), v && Qe(o, l);
468
- }
469
- return er(e, a, v, i, n, $.current, o);
470
- }
471
- }
472
- var K = j.ReactCurrentOwner, be = j.ReactDebugCurrentFrame;
473
- function k(e) {
474
- if (e) {
475
- var r = e._owner, t2 = V(e.type, e._source, r ? r.type : null);
476
- be.setExtraStackFrame(t2);
477
- } else
478
- be.setExtraStackFrame(null);
479
- }
480
- var X;
481
- X = false;
482
- function Z(e) {
483
- return typeof e == "object" && e !== null && e.$$typeof === T;
484
- }
485
- function ye() {
486
- {
487
- if (K.current) {
488
- var e = b(K.current.type);
489
- if (e)
490
- return `
491
-
492
- Check the render method of \`` + e + "`.";
493
- }
494
- return "";
495
- }
496
- }
497
- function tr(e) {
498
- {
499
- if (e !== void 0) {
500
- var r = e.fileName.replace(/^.*[\\\/]/, ""), t2 = e.lineNumber;
501
- return `
502
-
503
- Check your code at ` + r + ":" + t2 + ".";
504
- }
505
- return "";
506
- }
507
- }
508
- var Ee = {};
509
- function nr(e) {
510
- {
511
- var r = ye();
512
- if (!r) {
513
- var t2 = typeof e == "string" ? e : e.displayName || e.name;
514
- t2 && (r = `
515
-
516
- Check the top-level render call using <` + t2 + ">.");
517
- }
518
- return r;
519
- }
520
- }
521
- function _e(e, r) {
522
- {
523
- if (!e._store || e._store.validated || e.key != null)
524
- return;
525
- e._store.validated = true;
526
- var t2 = nr(r);
527
- if (Ee[t2])
528
- return;
529
- Ee[t2] = true;
530
- var n = "";
531
- e && e._owner && e._owner !== K.current && (n = " It was passed a child from " + b(e._owner.type) + "."), k(e), d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t2, n), k(null);
532
- }
533
- }
534
- function Re(e, r) {
535
- {
536
- if (typeof e != "object")
537
- return;
538
- if (z(e))
539
- for (var t2 = 0; t2 < e.length; t2++) {
540
- var n = e[t2];
541
- Z(n) && _e(n, r);
542
- }
543
- else if (Z(e))
544
- e._store && (e._store.validated = true);
545
- else if (e) {
546
- var i = R(e);
547
- if (typeof i == "function" && i !== e.entries)
548
- for (var u = i.call(e), o; !(o = u.next()).done; )
549
- Z(o.value) && _e(o.value, r);
550
- }
551
- }
552
- }
553
- function ar(e) {
554
- {
555
- var r = e.type;
556
- if (r == null || typeof r == "string")
557
- return;
558
- var t2;
559
- if (typeof r == "function")
560
- t2 = r.propTypes;
561
- else if (typeof r == "object" && (r.$$typeof === c || // Note: Memo only checks outer props here.
562
- // Inner props are checked in the reconciler.
563
- r.$$typeof === h))
564
- t2 = r.propTypes;
565
- else
566
- return;
567
- if (t2) {
568
- var n = b(r);
569
- Be(t2, e.props, "prop", n, e);
570
- } else if (r.PropTypes !== void 0 && !X) {
571
- X = true;
572
- var i = b(r);
573
- d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
574
- }
575
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
576
- }
577
- }
578
- function or(e) {
579
- {
580
- for (var r = Object.keys(e.props), t2 = 0; t2 < r.length; t2++) {
581
- var n = r[t2];
582
- if (n !== "children" && n !== "key") {
583
- k(e), d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), k(null);
584
- break;
585
- }
586
- }
587
- e.ref !== null && (k(e), d("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
588
- }
589
- }
590
- function Te(e, r, t2, n, i, u) {
591
- {
592
- var o = We(e);
593
- if (!o) {
594
- var a = "";
595
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
596
- var v = tr(i);
597
- v ? a += v : a += ye();
598
- var s;
599
- e === null ? s = "null" : z(e) ? s = "array" : e !== void 0 && e.$$typeof === T ? (s = "<" + (b(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : s = typeof e, d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", s, a);
600
- }
601
- var l = rr(e, r, t2, i, u);
602
- if (l == null)
603
- return l;
604
- if (o) {
605
- var p = r.children;
606
- if (p !== void 0)
607
- if (n)
608
- if (z(p)) {
609
- for (var F = 0; F < p.length; F++)
610
- Re(p[F], e);
611
- Object.freeze && Object.freeze(p);
612
- } else
613
- d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
614
- else
615
- Re(p, e);
616
- }
617
- return e === E ? or(l) : ar(l), l;
618
- }
619
- }
620
- function ir(e, r, t2) {
621
- return Te(e, r, t2, true);
622
- }
623
- function ur(e, r, t2) {
624
- return Te(e, r, t2, false);
625
- }
626
- var sr = ur, lr = ir;
627
- N.Fragment = E, N.jsx = sr, N.jsxs = lr;
628
- }()), N;
629
- }
630
- process.env.NODE_ENV === "production" ? Q.exports = cr() : Q.exports = fr();
631
- var ee = Q.exports;
632
- const dr = ee.Fragment, Se = ee.jsx;
633
- ee.jsxs;
634
- const xe = {
635
- className: "",
636
- style: void 0,
637
- viewBox: " 0 0 1024 1024",
638
- name: "",
639
- width: "",
640
- height: "",
641
- onClick: () => {
642
- }
643
- }, je = (P) => {
644
- const { viewBox: T, className: D, style: E, name: w, color: x, width: C, height: m, onClick: c } = { ...xe, ...P }, _ = (R) => {
645
- c && c(R);
646
- }, f = (R) => R === "" ? "" : isNaN(Number(R)) ? String(R) : R + "px", h = () => `nut-icon nut-icon-${w} ${D}`, g = {}, O = f(C || ""), A = f(m || "");
647
- O && (g.width = O), A && (g.height = A);
648
- const B = () => ({
649
- ...E,
650
- ...g
651
- });
652
- return /* @__PURE__ */ Se(dr, { children: /* @__PURE__ */ Se(
653
- "svg",
654
- {
655
- className: h(),
656
- style: B(),
657
- onClick: _,
658
- xmlns: "http://www.w3.org/2000/svg",
659
- color: x,
660
- viewBox: T,
661
- "aria-labelledby": w,
662
- role: "presentation",
663
- children: P.children
664
- }
665
- ) });
666
- };
667
- je.defaultProps = xe;
668
- const hr = je;
669
- const t = (a) => /* @__PURE__ */ Se(hr, { ...a, name: a.name || "Loading", viewBox: "0 0 1024 1024", children: /* @__PURE__ */ Se(
670
- "path",
671
- {
672
- d: "M512 73.14a43.89 43.89 0 0 1 43.89 43.89v118.49a43.89 43.89 0 0 1-87.78 0V117.03A43.89 43.89 0 0 1 512 73.14M201.65 201.65a43.89 43.89 0 0 1 62.1 0l83.68 83.83a43.89 43.89 0 1 1-62.03 62.02l-83.75-83.75a43.89 43.89 0 0 1 0-62.1m620.7 0a43.89 43.89 0 0 1 0 62.1l-83.83 83.68a43.89 43.89 0 1 1-62.02-62.03l83.75-83.82a43.89 43.89 0 0 1 62.1 0zM73.14 512a43.89 43.89 0 0 1 43.89-43.89h118.49a43.89 43.89 0 0 1 0 87.78H117.03A43.89 43.89 0 0 1 73.14 512m671.45 0a43.89 43.89 0 0 1 43.89-43.89h118.49a43.89 43.89 0 1 1 0 87.78H788.48A43.89 43.89 0 0 1 744.59 512M347.5 676.5a43.89 43.89 0 0 1 0 62.02l-83.75 83.83a43.89 43.89 0 1 1-62.1-62.1l83.83-83.68a43.89 43.89 0 0 1 62.02 0zm329 0a43.89 43.89 0 0 1 62.02 0l83.83 83.75a43.89 43.89 0 1 1-62.1 62.1l-83.68-83.83a43.89 43.89 0 0 1 0-62.02zM512 744.59a43.89 43.89 0 0 1 43.89 43.89v118.49a43.89 43.89 0 1 1-87.78 0V788.48A43.89 43.89 0 0 1 512 744.59",
673
- fill: "currentColor",
674
- fillOpacity: "0.9"
675
- }
676
- ) });
677
- t.defaultProps = xe;
678
- const prefixCls = "nut-button";
679
- const defaultProps$1 = {
680
- ...ComponentDefaults,
681
- color: "",
682
- type: "default",
683
- size: "normal",
684
- shape: "round",
685
- fill: "outline",
686
- loading: false,
687
- disabled: false,
688
- block: false,
689
- icon: null,
690
- rightIcon: null,
691
- nativeType: "button",
692
- onClick: (e) => {
693
- }
694
- };
695
- const Button = React__default.forwardRef((props, ref) => {
696
- const { color, shape, fill, loading, disabled, type, size, block, icon, rightIcon, children, className, style, nativeType, onClick, ...rest } = {
697
- ...defaultProps$1,
698
- ...props
699
- };
700
- const getStyle = useCallback(() => {
701
- const style2 = {};
702
- if (props.color) {
703
- if (props.fill && (props.fill === "outline" || props.fill === "dashed")) {
704
- style2.color = color;
705
- style2.background = "#fff";
706
- if (!(color == null ? void 0 : color.includes("gradient"))) {
707
- style2.borderColor = color;
708
- }
709
- } else {
710
- style2.color = "#fff";
711
- style2.background = color;
712
- }
713
- }
714
- return style2;
715
- }, [color]);
716
- const handleClick = (e) => {
717
- if (!loading && !disabled && onClick) {
718
- onClick(e);
719
- }
720
- };
721
- return React__default.createElement(
722
- "button",
723
- { ...rest, ref, type: nativeType, className: classNames(prefixCls, `${prefixCls}-${type}`, props.fill ? `${prefixCls}-${fill}` : null, children ? "" : `${prefixCls}-icononly`, {
724
- [`${prefixCls}-${size}`]: size,
725
- [`${prefixCls}-${shape}`]: shape,
726
- [`${prefixCls}-block`]: block,
727
- [`${prefixCls}-disabled`]: disabled,
728
- [`${prefixCls}-loading`]: loading
729
- }, className), style: { ...getStyle(), ...style }, onClick: (e) => handleClick(e) },
730
- React__default.createElement(
731
- "div",
732
- { className: "nut-button-wrap" },
733
- loading && React__default.createElement(t, { className: "nut-icon-loading" }),
734
- !loading && icon ? icon : null,
735
- children && React__default.createElement("div", { className: `${icon || loading ? "nut-button-text" : ""}${rightIcon ? " nut-button-text right" : ""}` }, children),
736
- rightIcon || null
737
- )
738
- );
739
- });
740
- Button.displayName = "NutButton";
741
- const defaultStatus = {
742
- empty: "https://static-ftcms.jd.com/p/files/61a9e3183985005b3958672b.png",
743
- error: "https://ftcms.jd.com/p/files/61a9e33ee7dcdbcc0ce62736.png",
744
- network: "https://static-ftcms.jd.com/p/files/61a9e31de7dcdbcc0ce62734.png"
745
- };
746
- const defaultProps = {
747
- ...ComponentDefaults,
748
- title: "",
749
- description: "",
750
- imageSize: "",
751
- size: "base",
752
- status: "empty",
753
- actions: []
754
- };
755
- const classPrefix = `nut-empty`;
756
- const Empty = (props) => {
757
- useConfig();
758
- const { image, imageSize, title, description, children, className, size, status, actions, ...rest } = {
759
- ...defaultProps,
760
- ...props
761
- };
762
- const [imgStyle, setImgStyle] = useState({});
763
- const imageUrl = image || defaultStatus[status];
764
- const imageNode = typeof imageUrl === "string" ? React__default.createElement("img", { className: "img", src: imageUrl, alt: "empty" }) : imageUrl;
765
- useEffect(() => {
766
- setImgStyle(() => {
767
- if (!imageSize) {
768
- return {};
769
- }
770
- if (typeof imageSize === "number") {
771
- return {
772
- width: `${imageSize}px`,
773
- height: `${imageSize}px`
774
- };
775
- }
776
- return {
777
- width: imageSize,
778
- height: imageSize
779
- };
780
- });
781
- }, [imageSize]);
782
- const classes = classNames({
783
- [`${classPrefix}-${size}`]: size !== "base"
784
- });
785
- const cls = classNames(classPrefix, classes, className);
786
- return React__default.createElement(
787
- "div",
788
- { className: cls, ...rest },
789
- React__default.createElement("div", { className: `${classPrefix}-image`, style: imgStyle }, imageNode),
790
- typeof title === "string" && title ? React__default.createElement("div", { className: `${classPrefix}-title` }, title) : title,
791
- typeof description === "string" ? React__default.createElement("div", { className: `${classPrefix}-description` }, description) : description,
792
- actions.length > 0 && React__default.createElement("div", { className: `${classPrefix}-actions` }, actions.map((item, index) => {
793
- return React__default.createElement(Button, { className: classNames({
794
- [`${classPrefix}-actions-right`]: actions.length === 1,
795
- [`${classPrefix}-actions-left`]: actions.length > 1 && index === 0
796
- }), type: `${actions.length > 1 && index === 0 ? "default" : "primary"}`, size: "small", fill: "outline", key: `action-${index}` }, item == null ? void 0 : item.text);
797
- })),
798
- children
799
- );
800
- };
801
- Empty.defaultProps = defaultProps;
802
- Empty.displayName = "NutEmpty";
803
- export {
804
- Empty as E
805
- };