xmirror-components 1.0.14 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +264 -52
- package/build/dist/index.cjs +16 -11
- package/build/dist/index.mjs +1000 -775
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +1 -0
- package/build/lib/index.d.ts +41 -0
- package/build/lib/index.js +3 -1
- package/build/package.json +1 -1
- package/build/types/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,54 +1,266 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
# XMirror Components
|
|
2
|
+
|
|
3
|
+
一个基于 React 和 Ant Design 的高质量组件库,提供了一系列实用的 UI 组件和 Hooks,帮助开发者快速构建现代化的 Web 应用。
|
|
4
|
+
|
|
5
|
+
## ✨ 特性
|
|
6
|
+
|
|
7
|
+
- 🚀 **基于 Ant Design 5.x** - 继承 Ant Design 的设计语言和交互体验
|
|
8
|
+
- 📦 **开箱即用** - 提供常用的业务组件和工具函数
|
|
9
|
+
- 🎯 **TypeScript 支持** - 完整的 TypeScript 类型定义
|
|
10
|
+
- 🔧 **高度可定制** - 支持主题定制和样式覆盖
|
|
11
|
+
- 📱 **响应式设计** - 适配各种屏幕尺寸
|
|
12
|
+
- 🎨 **现代化 UI** - 符合当前设计趋势的组件样式
|
|
13
|
+
|
|
14
|
+
## 📦 安装
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install xmirror-components
|
|
18
|
+
# 或
|
|
19
|
+
yarn add xmirror-components
|
|
20
|
+
# 或
|
|
21
|
+
pnpm add xmirror-components
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 🔧 依赖要求
|
|
25
|
+
|
|
26
|
+
- React >= 16.9.0
|
|
27
|
+
- React DOM >= 16.9.0
|
|
28
|
+
- Ant Design >= 5.0.0
|
|
29
|
+
|
|
30
|
+
## 🚀 快速开始
|
|
31
|
+
|
|
32
|
+
### 1. 引入组件
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { App, CheckboxValue, SwitchValue, IconFont, IconButton, useRequest } from 'xmirror-components';
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 2. 使用 App 组件包装应用
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import React from 'react';
|
|
42
|
+
import { App } from 'xmirror-components';
|
|
43
|
+
|
|
44
|
+
function MyApp() {
|
|
45
|
+
return (
|
|
46
|
+
<App>
|
|
47
|
+
<YourAppContent />
|
|
48
|
+
</App>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 📚 组件文档
|
|
54
|
+
|
|
55
|
+
### App 组件
|
|
56
|
+
|
|
57
|
+
Ant Design 5.x 的 App 组件封装,提供全局的 message、notification、modal 等静态方法。
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { App, message, notification, modal } from 'xmirror-components';
|
|
61
|
+
|
|
62
|
+
function MyComponent() {
|
|
63
|
+
const handleClick = () => {
|
|
64
|
+
message.success('操作成功!');
|
|
65
|
+
notification.info('这是一条通知');
|
|
66
|
+
modal.confirm({
|
|
67
|
+
title: '确认删除',
|
|
68
|
+
content: '确定要删除这条记录吗?',
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<App>
|
|
74
|
+
<button onClick={handleClick}>显示消息</button>
|
|
75
|
+
</App>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### CheckboxValue 组件
|
|
81
|
+
|
|
82
|
+
支持自定义选中/未选中值的复选框组件。
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
import { CheckboxValue } from 'xmirror-components';
|
|
86
|
+
|
|
87
|
+
function MyForm() {
|
|
88
|
+
const [status, setStatus] = useState('Y');
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<CheckboxValue
|
|
92
|
+
checked={status}
|
|
93
|
+
trueValue="Y"
|
|
94
|
+
falseValue="N"
|
|
95
|
+
trueLabel="已启用"
|
|
96
|
+
falseLabel="未启用"
|
|
97
|
+
onChange={(value) => setStatus(value)}
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Props:**
|
|
104
|
+
|
|
105
|
+
| 参数 | 说明 | 类型 | 默认值 |
|
|
106
|
+
|------|------|------|--------|
|
|
107
|
+
| checked | 当前选中值 | any | - |
|
|
108
|
+
| onChange | 变化时回调 | (value, event) => void | - |
|
|
109
|
+
| trueValue | 选中时的值 | any | true |
|
|
110
|
+
| falseValue | 未选中时的值 | any | false |
|
|
111
|
+
| trueLabel | 选中时显示的文本 | string | '' |
|
|
112
|
+
| falseLabel | 未选中时显示的文本 | string | '' |
|
|
113
|
+
|
|
114
|
+
### SwitchValue 组件
|
|
115
|
+
|
|
116
|
+
支持自定义开关值的开关组件。
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import { SwitchValue } from 'xmirror-components';
|
|
120
|
+
|
|
121
|
+
function MyComponent() {
|
|
122
|
+
const [enabled, setEnabled] = useState(1);
|
|
123
|
+
|
|
124
|
+
return (
|
|
125
|
+
<SwitchValue
|
|
126
|
+
checked={enabled}
|
|
127
|
+
trueValue={1}
|
|
128
|
+
falseValue={0}
|
|
129
|
+
onChange={(value) => setEnabled(value)}
|
|
130
|
+
/>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### IconFont 组件
|
|
136
|
+
|
|
137
|
+
图标字体组件,支持 symbol 模式和普通模式。
|
|
138
|
+
|
|
139
|
+
```tsx
|
|
140
|
+
import { IconFont } from 'xmirror-components';
|
|
141
|
+
|
|
142
|
+
function MyComponent() {
|
|
143
|
+
return (
|
|
144
|
+
<div>
|
|
145
|
+
{/* 普通模式 */}
|
|
146
|
+
<IconFont type="icon-user" />
|
|
147
|
+
|
|
148
|
+
{/* Symbol 模式 */}
|
|
149
|
+
<IconFont type="icon-home" symbol />
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### IconButton 组件
|
|
156
|
+
|
|
157
|
+
图标按钮组件,提供更好的交互体验。
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
import { IconButton } from 'xmirror-components';
|
|
161
|
+
|
|
162
|
+
function MyComponent() {
|
|
163
|
+
return (
|
|
164
|
+
<IconButton
|
|
165
|
+
icon="icon-edit"
|
|
166
|
+
onClick={() => console.log('编辑')}
|
|
167
|
+
tooltip="编辑"
|
|
168
|
+
/>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### GlobalLoading 组件
|
|
174
|
+
|
|
175
|
+
全局加载组件,用于页面级别的加载状态。
|
|
176
|
+
|
|
177
|
+
```tsx
|
|
178
|
+
import { GlobalLoading } from 'xmirror-components';
|
|
179
|
+
|
|
180
|
+
function MyComponent() {
|
|
181
|
+
const [loading, setLoading] = useState(false);
|
|
182
|
+
|
|
183
|
+
return (
|
|
184
|
+
<GlobalLoading loading={loading}>
|
|
185
|
+
<YourContent />
|
|
186
|
+
</GlobalLoading>
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## 🎣 Hooks
|
|
192
|
+
|
|
193
|
+
### useRequest
|
|
194
|
+
|
|
195
|
+
基于 ahooks 的 useRequest 封装,提供统一的错误处理和数据处理。
|
|
196
|
+
|
|
197
|
+
```tsx
|
|
198
|
+
import { useRequest } from 'xmirror-components';
|
|
199
|
+
|
|
200
|
+
function MyComponent() {
|
|
201
|
+
const { data, loading, run } = useRequest(
|
|
202
|
+
async (params) => {
|
|
203
|
+
const response = await fetch('/api/data', { params });
|
|
204
|
+
return response.json();
|
|
29
205
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
206
|
+
{
|
|
207
|
+
manual: true,
|
|
208
|
+
errorMessage: true, // 自动显示错误信息
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
<div>
|
|
214
|
+
<button onClick={() => run({ page: 1 })} disabled={loading}>
|
|
215
|
+
{loading ? '加载中...' : '获取数据'}
|
|
216
|
+
</button>
|
|
217
|
+
{data && <pre>{JSON.stringify(data, null, 2)}</pre>}
|
|
218
|
+
</div>
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## 🎨 主题定制
|
|
224
|
+
|
|
225
|
+
组件库支持通过 CSS 变量进行主题定制:
|
|
226
|
+
|
|
227
|
+
```css
|
|
228
|
+
:root {
|
|
229
|
+
--primary-color: #1890ff;
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### 项目结构
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
src/
|
|
237
|
+
├── components/ # 组件目录
|
|
238
|
+
│ ├── AntdApp/ # App 组件
|
|
239
|
+
│ ├── CheckboxValue/ # 复选框组件
|
|
240
|
+
│ ├── SwitchValue/ # 开关组件
|
|
241
|
+
│ ├── IconFont/ # 图标组件
|
|
242
|
+
│ ├── IconButton/ # 图标按钮组件
|
|
243
|
+
│ └── GlobalLoading/ # 全局加载组件
|
|
244
|
+
├── hooks/ # Hooks 目录
|
|
245
|
+
│ └── useRequest/ # 请求 Hook
|
|
246
|
+
└── index.ts # 入口文件
|
|
54
247
|
```
|
|
248
|
+
|
|
249
|
+
## 🤝 贡献指南
|
|
250
|
+
|
|
251
|
+
我们欢迎所有形式的贡献,包括但不限于:
|
|
252
|
+
|
|
253
|
+
- 🐛 Bug 报告
|
|
254
|
+
- 💡 新功能建议
|
|
255
|
+
- 📝 文档改进
|
|
256
|
+
- 🔧 代码贡献
|
|
257
|
+
|
|
258
|
+
## 📄 许可证
|
|
259
|
+
|
|
260
|
+
本项目基于 [MIT](LICENSE) 许可证开源。
|
|
261
|
+
|
|
262
|
+
## 🙏 致谢
|
|
263
|
+
|
|
264
|
+
- [Ant Design](https://ant.design/) - 优秀的 React UI 组件库
|
|
265
|
+
- [ahooks](https://ahooks.js.org/) - 实用的 React Hooks 库
|
|
266
|
+
- [React](https://reactjs.org/) - 用于构建用户界面的 JavaScript 库
|
package/build/dist/index.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
(function(){"use strict"})();
|
|
2
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react"),B=require("antd");var de=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ge(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ve={exports:{}},te={};/**
|
|
2
3
|
* @license React
|
|
3
4
|
* react-jsx-runtime.production.js
|
|
4
5
|
*
|
|
@@ -6,7 +7,7 @@
|
|
|
6
7
|
*
|
|
7
8
|
* This source code is licensed under the MIT license found in the
|
|
8
9
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
10
|
+
*/var ir;function Ir(){if(ir)return te;ir=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(a,i,o){var c=null;if(o!==void 0&&(c=""+o),i.key!==void 0&&(c=""+i.key),"key"in i){o={};for(var s in i)s!=="key"&&(o[s]=i[s])}else o=i;return i=o.ref,{$$typeof:e,type:a,key:c,ref:i!==void 0?i:null,props:o}}return te.Fragment=t,te.jsx=r,te.jsxs=r,te}var ne={};/**
|
|
10
11
|
* @license React
|
|
11
12
|
* react-jsx-runtime.development.js
|
|
12
13
|
*
|
|
@@ -14,18 +15,22 @@
|
|
|
14
15
|
*
|
|
15
16
|
* This source code is licensed under the MIT license found in the
|
|
16
17
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
at`)?" (<anonymous>)":-1<
|
|
19
|
-
`+
|
|
20
|
-
`),
|
|
21
|
-
`);for(
|
|
22
|
-
`+
|
|
18
|
+
*/var ur;function Br(){return ur||(ur=1,process.env.NODE_ENV!=="production"&&function(){function e(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===$r?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case G:return"Fragment";case H:return"Portal";case P:return"Profiler";case $:return"StrictMode";case U:return"Suspense";case w:return"SuspenseList"}if(typeof n=="object")switch(typeof n.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),n.$$typeof){case se:return(n.displayName||"Context")+".Provider";case Q:return(n._context.displayName||"Context")+".Consumer";case K:var v=n.render;return n=n.displayName,n||(n=v.displayName||v.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case A:return v=n.displayName||null,v!==null?v:e(n.type)||"Memo";case L:v=n._payload,n=n._init;try{return e(n(v))}catch{}}return null}function t(n){return""+n}function r(n){try{t(n);var v=!1}catch{v=!0}if(v){v=console;var g=v.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&n[Symbol.toStringTag]||n.constructor.name||"Object";return g.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),t(n)}}function a(){}function i(){if(ee===0){Ve=console.log,Je=console.info,Xe=console.warn,Ze=console.error,Qe=console.group,Ke=console.groupCollapsed,er=console.groupEnd;var n={configurable:!0,enumerable:!0,value:a,writable:!0};Object.defineProperties(console,{info:n,log:n,warn:n,error:n,group:n,groupCollapsed:n,groupEnd:n})}ee++}function o(){if(ee--,ee===0){var n={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},n,{value:Ve}),info:D({},n,{value:Je}),warn:D({},n,{value:Xe}),error:D({},n,{value:Ze}),group:D({},n,{value:Qe}),groupCollapsed:D({},n,{value:Ke}),groupEnd:D({},n,{value:er})})}0>ee&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function c(n){if(Ee===void 0)try{throw Error()}catch(g){var v=g.stack.trim().match(/\n( *(at )?)/);Ee=v&&v[1]||"",rr=-1<g.stack.indexOf(`
|
|
19
|
+
at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
20
|
+
`+Ee+n+rr}function s(n,v){if(!n||Te)return"";var g=we.get(n);if(g!==void 0)return g;Te=!0,g=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var E=null;E=z.H,z.H=null,i();try{var S={DetermineComponentFrameRoot:function(){try{if(v){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(I){var le=I}Reflect.construct(n,[],Y)}else{try{Y.call()}catch(I){le=I}n.call(Y.prototype)}}else{try{throw Error()}catch(I){le=I}(Y=n())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(I){if(I&&le&&typeof I.stack=="string")return[I.stack,le.stack]}return[null,null]}};S.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var R=Object.getOwnPropertyDescriptor(S.DetermineComponentFrameRoot,"name");R&&R.configurable&&Object.defineProperty(S.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=S.DetermineComponentFrameRoot(),F=y[0],X=y[1];if(F&&X){var _=F.split(`
|
|
21
|
+
`),V=X.split(`
|
|
22
|
+
`);for(y=R=0;R<_.length&&!_[R].includes("DetermineComponentFrameRoot");)R++;for(;y<V.length&&!V[y].includes("DetermineComponentFrameRoot");)y++;if(R===_.length||y===V.length)for(R=_.length-1,y=V.length-1;1<=R&&0<=y&&_[R]!==V[y];)y--;for(;1<=R&&0<=y;R--,y--)if(_[R]!==V[y]){if(R!==1||y!==1)do if(R--,y--,0>y||_[R]!==V[y]){var re=`
|
|
23
|
+
`+_[R].replace(" at new "," at ");return n.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",n.displayName)),typeof n=="function"&&we.set(n,re),re}while(1<=R&&0<=y);break}}}finally{Te=!1,z.H=E,o(),Error.prepareStackTrace=g}return _=(_=n?n.displayName||n.name:"")?c(_):"",typeof n=="function"&&we.set(n,_),_}function f(n){if(n==null)return"";if(typeof n=="function"){var v=n.prototype;return s(n,!(!v||!v.isReactComponent))}if(typeof n=="string")return c(n);switch(n){case U:return c("Suspense");case w:return c("SuspenseList")}if(typeof n=="object")switch(n.$$typeof){case K:return n=s(n.render,!1),n;case A:return f(n.type);case L:v=n._payload,n=n._init;try{return f(n(v))}catch{}}return""}function u(){var n=z.A;return n===null?null:n.getOwner()}function d(n){if(De.call(n,"key")){var v=Object.getOwnPropertyDescriptor(n,"key").get;if(v&&v.isReactWarning)return!1}return n.key!==void 0}function l(n,v){function g(){tr||(tr=!0,console.error("%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://react.dev/link/special-props)",v))}g.isReactWarning=!0,Object.defineProperty(n,"key",{get:g,configurable:!0})}function p(){var n=e(this.type);return nr[n]||(nr[n]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),n=this.props.ref,n!==void 0?n:null}function m(n,v,g,E,S,R){return g=R.ref,n={$$typeof:q,type:n,key:v,props:R,_owner:S},(g!==void 0?g:null)!==null?Object.defineProperty(n,"ref",{enumerable:!1,get:p}):Object.defineProperty(n,"ref",{enumerable:!1,value:null}),n._store={},Object.defineProperty(n._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(n,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(n.props),Object.freeze(n)),n}function b(n,v,g,E,S,R){if(typeof n=="string"||typeof n=="function"||n===G||n===P||n===$||n===U||n===w||n===fe||typeof n=="object"&&n!==null&&(n.$$typeof===L||n.$$typeof===A||n.$$typeof===se||n.$$typeof===Q||n.$$typeof===K||n.$$typeof===Lr||n.getModuleId!==void 0)){var y=v.children;if(y!==void 0)if(E)if(pe(y)){for(E=0;E<y.length;E++)T(y[E],n);Object.freeze&&Object.freeze(y)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else T(y,n)}else y="",(n===void 0||typeof n=="object"&&n!==null&&Object.keys(n).length===0)&&(y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),n===null?E="null":pe(n)?E="array":n!==void 0&&n.$$typeof===q?(E="<"+(e(n.type)||"Unknown")+" />",y=" Did you accidentally export a JSX literal instead of a component?"):E=typeof n,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,y);if(De.call(v,"key")){y=e(n);var F=Object.keys(v).filter(function(_){return _!=="key"});E=0<F.length?"{key: someKey, "+F.join(": ..., ")+": ...}":"{key: someKey}",ar[y+E]||(F=0<F.length?"{"+F.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
24
|
let props = %s;
|
|
24
25
|
<%s {...props} />
|
|
25
26
|
React keys must be passed directly to JSX without using spread:
|
|
26
27
|
let props = %s;
|
|
27
|
-
<%s key={someKey} {...props} />`,y,
|
|
28
|
+
<%s key={someKey} {...props} />`,E,y,F,y),ar[y+E]=!0)}if(y=null,g!==void 0&&(r(g),y=""+g),d(v)&&(r(v.key),y=""+v.key),"key"in v){g={};for(var X in v)X!=="key"&&(g[X]=v[X])}else g=v;return y&&l(g,typeof n=="function"?n.displayName||n.name||"Unknown":n),m(n,y,R,S,u(),g)}function T(n,v){if(typeof n=="object"&&n&&n.$$typeof!==Fr){if(pe(n))for(var g=0;g<n.length;g++){var E=n[g];x(E)&&M(E,v)}else if(x(n))n._store&&(n._store.validated=1);else if(n===null||typeof n!="object"?g=null:(g=ze&&n[ze]||n["@@iterator"],g=typeof g=="function"?g:null),typeof g=="function"&&g!==n.entries&&(g=g.call(n),g!==n))for(;!(n=g.next()).done;)x(n.value)&&M(n.value,v)}}function x(n){return typeof n=="object"&&n!==null&&n.$$typeof===q}function M(n,v){if(n._store&&!n._store.validated&&n.key==null&&(n._store.validated=1,v=k(v),!or[v])){or[v]=!0;var g="";n&&n._owner!=null&&n._owner!==u()&&(g=null,typeof n._owner.tag=="number"?g=e(n._owner.type):typeof n._owner.name=="string"&&(g=n._owner.name),g=" It was passed a child from "+g+".");var E=z.getCurrentStack;z.getCurrentStack=function(){var S=f(n.type);return E&&(S+=E()||""),S},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',v,g),z.getCurrentStack=E}}function k(n){var v="",g=u();return g&&(g=e(g.type))&&(v=`
|
|
28
29
|
|
|
29
|
-
Check the render method of \``+
|
|
30
|
+
Check the render method of \``+g+"`."),v||(n=e(n))&&(v=`
|
|
30
31
|
|
|
31
|
-
Check the top-level render call using <`+t+">."),l}var M=p,k=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),oe=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),C=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),ue=Symbol.for("react.offscreen"),Le=Symbol.iterator,Or=Symbol.for("react.client.reference"),B=M.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ye=Object.prototype.hasOwnProperty,H=Object.assign,xr=Symbol.for("react.client.reference"),ge=Array.isArray,ee=0,Ge,Ue,Be,He,ze,De,Ve;a.__reactDisabledLog=!0;var he,Je,ye=!1,pe=new(typeof WeakMap=="function"?WeakMap:Map),Pr=Symbol.for("react.client.reference"),Xe,Ze={},Qe={},Ke={};ne.Fragment=L,ne.jsx=function(t,l,d,y,j){return b(t,l,d,!1,y,j)},ne.jsxs=function(t,l,d,y,j){return b(t,l,d,!0,y,j)}}()),ne}var tr;function Nr(){return tr||(tr=1,process.env.NODE_ENV==="production"?se.exports=Cr():se.exports=Ar()),se.exports}var V=Nr();exports.message=J.message;exports.notification=J.notification;exports.modal=J.Modal;function kr({children:r}){const e=J.App.useApp();return exports.message=e.message,exports.modal=e.modal,exports.notification=e.notification,r||""}function qr({children:r,...e}){return V.jsx(J.App,{...e,children:V.jsx(kr,{children:r})})}const Mr=p.forwardRef(({type:r="",className:e="",symbol:n=!1,...a},i)=>n?V.jsx("svg",{className:`iconfont-symbol ${r} ${e}`,"aria-hidden":"true",ref:i,...a,children:V.jsx("use",{xlinkHref:`#${r}`})}):V.jsx("i",{className:`iconfont ${r} ${e}`,ref:i,...a})),Wr=({checked:r,onChange:e,trueValue:n=!0,falseValue:a=!1,trueLabel:i="",falseLabel:o="",children:c,...f})=>{const s=r===n,u=m=>{e==null||e(m.target.checked?n:a,m)};return V.jsx(J.Checkbox,{checked:s,onChange:u,...f,children:c||(s?i:o)})},$r=({checked:r,onChange:e,trueValue:n=!0,falseValue:a=!1,...i})=>{const o=r===n,c=(f,s)=>{e==null||e(f?n:a,s)};return V.jsx(J.Switch,{checked:o,onChange:c,...i})};var Fr=function(r){return function(e,n){var a=p.useRef(!1);r(function(){return function(){a.current=!1}},[]),r(function(){if(!a.current)a.current=!0;else return e()},n)}},A=function(){return A=Object.assign||function(e){for(var n,a=1,i=arguments.length;a<i;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},A.apply(this,arguments)};function Er(r,e){var n={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&e.indexOf(a)<0&&(n[a]=r[a]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(r);i<a.length;i++)e.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(r,a[i])&&(n[a[i]]=r[a[i]]);return n}function Ir(r,e,n,a){function i(o){return o instanceof n?o:new n(function(c){c(o)})}return new(n||(n=Promise))(function(o,c){function f(m){try{u(a.next(m))}catch(v){c(v)}}function s(m){try{u(a.throw(m))}catch(v){c(v)}}function u(m){m.done?o(m.value):i(m.value).then(f,s)}u((a=a.apply(r,e||[])).next())})}function Lr(r,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a,i,o,c=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return c.next=f(0),c.throw=f(1),c.return=f(2),typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function f(u){return function(m){return s([u,m])}}function s(u){if(a)throw new TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(n=0)),n;)try{if(a=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(r,n)}catch(m){u=[6,m],i=0}finally{a=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function _(r,e){var n=typeof Symbol=="function"&&r[Symbol.iterator];if(!n)return r;var a=n.call(r),i,o=[],c;try{for(;(e===void 0||e-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(f){c={error:f}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(c)throw c.error}}return o}function S(r,e,n){if(n||arguments.length===2)for(var a=0,i=e.length,o;a<i;a++)(o||!(a in e))&&(o||(o=Array.prototype.slice.call(e,0,a)),o[a]=e[a]);return r.concat(o||Array.prototype.slice.call(e))}var ve=function(r){return typeof r=="function"},me=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";function Z(r){me&&(ve(r)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof r)));var e=p.useRef(r);e.current=p.useMemo(function(){return r},[r]);var n=p.useRef();return n.current||(n.current=function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];return e.current.apply(this,a)}),n.current}const We=Fr(p.useEffect);var Tr=function(r,e){var n=e.manual,a=e.ready,i=a===void 0?!0:a,o=e.defaultParams,c=o===void 0?[]:o,f=e.refreshDeps,s=f===void 0?[]:f,u=e.refreshDepsAction,m=p.useRef(!1);return m.current=!1,We(function(){!n&&i&&(m.current=!0,r.run.apply(r,S([],_(c),!1)))},[i]),We(function(){m.current||n||(m.current=!0,u?u():r.refresh())},S([],_(s),!1)),{onBefore:function(){if(!i)return{stopNow:!0}}}};Tr.onInit=function(r){var e=r.ready,n=e===void 0?!0:e,a=r.manual;return{loading:!a&&n}};function Yr(r,e){if(r===e)return!0;for(var n=0;n<r.length;n++)if(!Object.is(r[n],e[n]))return!1;return!0}function wr(r,e){var n=p.useRef({deps:e,obj:void 0,initialized:!1}).current;return(n.initialized===!1||!Yr(n.deps,e))&&(n.deps=e,n.obj=r(),n.initialized=!0),n.obj}function Rr(r){var e=p.useRef(r);return e.current=r,e}var $e=function(r){me&&(ve(r)||console.error("useUnmount expected parameter is a function, got ".concat(typeof r)));var e=Rr(r);p.useEffect(function(){return function(){e.current()}},[])},le=new Map,Gr=function(r,e,n){var a=le.get(r);a!=null&&a.timer&&clearTimeout(a.timer);var i=void 0;e>-1&&(i=setTimeout(function(){le.delete(r)},e)),le.set(r,A(A({},n),{timer:i}))},Ur=function(r){return le.get(r)},de=new Map,Br=function(r){return de.get(r)},Hr=function(r,e){de.set(r,e),e.then(function(n){return de.delete(r),n}).catch(function(){de.delete(r)})},D={},zr=function(r,e){D[r]&&D[r].forEach(function(n){return n(e)})},Ee=function(r,e){return D[r]||(D[r]=[]),D[r].push(e),function(){var a=D[r].indexOf(e);D[r].splice(a,1)}},Dr=function(r,e){var n=e.cacheKey,a=e.cacheTime,i=a===void 0?5*60*1e3:a,o=e.staleTime,c=o===void 0?0:o,f=e.setCache,s=e.getCache,u=p.useRef(),m=p.useRef(),v=function(g,b){f?f(b):Gr(g,i,b),zr(g,b.data)},E=function(g,b){return b===void 0&&(b=[]),s?s(b):Ur(g)};return wr(function(){if(n){var g=E(n);g&&Object.hasOwnProperty.call(g,"data")&&(r.state.data=g.data,r.state.params=g.params,(c===-1||new Date().getTime()-g.time<=c)&&(r.state.loading=!1)),u.current=Ee(n,function(b){r.setState({data:b})})}},[]),$e(function(){var g;(g=u.current)===null||g===void 0||g.call(u)}),n?{onBefore:function(g){var b=E(n,g);return!b||!Object.hasOwnProperty.call(b,"data")?{}:c===-1||new Date().getTime()-b.time<=c?{loading:!1,data:b==null?void 0:b.data,error:void 0,returnNow:!0}:{data:b==null?void 0:b.data,error:void 0}},onRequest:function(g,b){var T=Br(n);return T&&T!==m.current?{servicePromise:T}:(T=g.apply(void 0,S([],_(b),!1)),m.current=T,Hr(n,T),{servicePromise:T})},onSuccess:function(g,b){var T;n&&((T=u.current)===null||T===void 0||T.call(u),v(n,{data:g,params:b,time:new Date().getTime()}),u.current=Ee(n,function(x){r.setState({data:x})}))},onMutate:function(g){var b;n&&((b=u.current)===null||b===void 0||b.call(u),v(n,{data:g,params:r.state.params,time:new Date().getTime()}),u.current=Ee(n,function(T){r.setState({data:T})}))}}:{}},Te,nr;function Fe(){if(nr)return Te;nr=1;function r(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}return Te=r,Te}var we,ar;function Vr(){if(ar)return we;ar=1;var r=typeof fe=="object"&&fe&&fe.Object===Object&&fe;return we=r,we}var Re,ir;function jr(){if(ir)return Re;ir=1;var r=Vr(),e=typeof self=="object"&&self&&self.Object===Object&&self,n=r||e||Function("return this")();return Re=n,Re}var je,or;function Jr(){if(or)return je;or=1;var r=jr(),e=function(){return r.Date.now()};return je=e,je}var _e,ur;function Xr(){if(ur)return _e;ur=1;var r=/\s/;function e(n){for(var a=n.length;a--&&r.test(n.charAt(a)););return a}return _e=e,_e}var Se,cr;function Zr(){if(cr)return Se;cr=1;var r=Xr(),e=/^\s+/;function n(a){return a&&a.slice(0,r(a)+1).replace(e,"")}return Se=n,Se}var Oe,fr;function _r(){if(fr)return Oe;fr=1;var r=jr(),e=r.Symbol;return Oe=e,Oe}var xe,sr;function Qr(){if(sr)return xe;sr=1;var r=_r(),e=Object.prototype,n=e.hasOwnProperty,a=e.toString,i=r?r.toStringTag:void 0;function o(c){var f=n.call(c,i),s=c[i];try{c[i]=void 0;var u=!0}catch{}var m=a.call(c);return u&&(f?c[i]=s:delete c[i]),m}return xe=o,xe}var Pe,lr;function Kr(){if(lr)return Pe;lr=1;var r=Object.prototype,e=r.toString;function n(a){return e.call(a)}return Pe=n,Pe}var Ce,dr;function et(){if(dr)return Ce;dr=1;var r=_r(),e=Qr(),n=Kr(),a="[object Null]",i="[object Undefined]",o=r?r.toStringTag:void 0;function c(f){return f==null?f===void 0?i:a:o&&o in Object(f)?e(f):n(f)}return Ce=c,Ce}var Ae,vr;function rt(){if(vr)return Ae;vr=1;function r(e){return e!=null&&typeof e=="object"}return Ae=r,Ae}var Ne,mr;function tt(){if(mr)return Ne;mr=1;var r=et(),e=rt(),n="[object Symbol]";function a(i){return typeof i=="symbol"||e(i)&&r(i)==n}return Ne=a,Ne}var ke,br;function nt(){if(br)return ke;br=1;var r=Zr(),e=Fe(),n=tt(),a=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,c=/^0o[0-7]+$/i,f=parseInt;function s(u){if(typeof u=="number")return u;if(n(u))return a;if(e(u)){var m=typeof u.valueOf=="function"?u.valueOf():u;u=e(m)?m+"":m}if(typeof u!="string")return u===0?u:+u;u=r(u);var v=o.test(u);return v||c.test(u)?f(u.slice(2),v?2:8):i.test(u)?a:+u}return ke=s,ke}var qe,gr;function Sr(){if(gr)return qe;gr=1;var r=Fe(),e=Jr(),n=nt(),a="Expected a function",i=Math.max,o=Math.min;function c(f,s,u){var m,v,E,g,b,T,x=0,q=!1,N=!1,M=!0;if(typeof f!="function")throw new TypeError(a);s=n(s)||0,r(u)&&(q=!!u.leading,N="maxWait"in u,E=N?i(n(u.maxWait)||0,s):E,M="trailing"in u?!!u.trailing:M);function k(w){var C=m,$=v;return m=v=void 0,x=w,g=f.apply($,C),g}function G(w){return x=w,b=setTimeout(P,s),q?k(w):g}function L(w){var C=w-T,$=w-x,ue=s-C;return N?o(ue,E-$):ue}function W(w){var C=w-T,$=w-x;return T===void 0||C>=s||C<0||N&&$>=E}function P(){var w=e();if(W(w))return Q(w);b=setTimeout(P,L(w))}function Q(w){return b=void 0,M&&m?k(w):(m=v=void 0,g)}function oe(){b!==void 0&&clearTimeout(b),x=0,m=T=v=b=void 0}function K(){return b===void 0?g:Q(e())}function U(){var w=e(),C=W(w);if(m=arguments,v=this,T=w,C){if(b===void 0)return G(T);if(N)return clearTimeout(b),b=setTimeout(P,s),k(T)}return b===void 0&&(b=setTimeout(P,s)),g}return U.cancel=oe,U.flush=K,U}return qe=c,qe}var at=Sr();const it=pr(at);var ot=function(r,e){var n=e.debounceWait,a=e.debounceLeading,i=e.debounceTrailing,o=e.debounceMaxWait,c=p.useRef(),f=p.useMemo(function(){var s={};return a!==void 0&&(s.leading=a),i!==void 0&&(s.trailing=i),o!==void 0&&(s.maxWait=o),s},[a,i,o]);return p.useEffect(function(){if(n){var s=r.runAsync.bind(r);return c.current=it(function(u){u()},n,f),r.runAsync=function(){for(var u=[],m=0;m<arguments.length;m++)u[m]=arguments[m];return new Promise(function(v,E){var g;(g=c.current)===null||g===void 0||g.call(c,function(){s.apply(void 0,S([],_(u),!1)).then(v).catch(E)})})},function(){var u;(u=c.current)===null||u===void 0||u.cancel(),r.runAsync=s}}},[n,f]),n?{onCancel:function(){var s;(s=c.current)===null||s===void 0||s.cancel()}}:{}},ut=function(r,e){var n=e.loadingDelay,a=e.ready,i=p.useRef();if(!n)return{};var o=function(){i.current&&clearTimeout(i.current)};return{onBefore:function(){return o(),a!==!1&&(i.current=setTimeout(function(){r.setState({loading:!0})},n)),{loading:!1}},onFinally:function(){o()},onCancel:function(){o()}}},be=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ie(){return be?document.visibilityState!=="hidden":!0}var ae=[];function ct(r){return ae.push(r),function(){var n=ae.indexOf(r);ae.splice(n,1)}}if(be){var ft=function(){if(Ie())for(var r=0;r<ae.length;r++){var e=ae[r];e()}};window.addEventListener("visibilitychange",ft,!1)}var st=function(r,e){var n=e.pollingInterval,a=e.pollingWhenHidden,i=a===void 0?!0:a,o=e.pollingErrorRetryCount,c=o===void 0?-1:o,f=p.useRef(),s=p.useRef(),u=p.useRef(0),m=function(){var v;f.current&&clearTimeout(f.current),(v=s.current)===null||v===void 0||v.call(s)};return We(function(){n||m()},[n]),n?{onBefore:function(){m()},onError:function(){u.current+=1},onSuccess:function(){u.current=0},onFinally:function(){c===-1||c!==-1&&u.current<=c?f.current=setTimeout(function(){!i&&!Ie()?s.current=ct(function(){r.refresh()}):r.refresh()},n):u.current=0},onCancel:function(){m()}}:{}};function lt(r,e){var n=!1;return function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];n||(n=!0,r.apply(void 0,S([],_(a),!1)),setTimeout(function(){n=!1},e))}}function dt(){return be&&typeof navigator.onLine<"u"?navigator.onLine:!0}var ie=[];function vt(r){return ie.push(r),function(){var n=ie.indexOf(r);n>-1&&ie.splice(n,1)}}if(be){var hr=function(){if(!(!Ie()||!dt()))for(var r=0;r<ie.length;r++){var e=ie[r];e()}};window.addEventListener("visibilitychange",hr,!1),window.addEventListener("focus",hr,!1)}var mt=function(r,e){var n=e.refreshOnWindowFocus,a=e.focusTimespan,i=a===void 0?5e3:a,o=p.useRef(),c=function(){var f;(f=o.current)===null||f===void 0||f.call(o)};return p.useEffect(function(){if(n){var f=lt(r.refresh.bind(r),i);o.current=vt(function(){f()})}return function(){c()}},[n,i]),$e(function(){c()}),{}},bt=function(r,e){var n=e.retryInterval,a=e.retryCount,i=p.useRef(),o=p.useRef(0),c=p.useRef(!1);return a?{onBefore:function(){c.current||(o.current=0),c.current=!1,i.current&&clearTimeout(i.current)},onSuccess:function(){o.current=0},onError:function(){if(o.current+=1,a===-1||o.current<=a){var f=n??Math.min(1e3*Math.pow(2,o.current),3e4);i.current=setTimeout(function(){c.current=!0,r.refresh()},f)}else o.current=0},onCancel:function(){o.current=0,i.current&&clearTimeout(i.current)}}:{}},Me,yr;function gt(){if(yr)return Me;yr=1;var r=Sr(),e=Fe(),n="Expected a function";function a(i,o,c){var f=!0,s=!0;if(typeof i!="function")throw new TypeError(n);return e(c)&&(f="leading"in c?!!c.leading:f,s="trailing"in c?!!c.trailing:s),r(i,o,{leading:f,maxWait:o,trailing:s})}return Me=a,Me}var ht=gt();const yt=pr(ht);var pt=function(r,e){var n=e.throttleWait,a=e.throttleLeading,i=e.throttleTrailing,o=p.useRef(),c={};return a!==void 0&&(c.leading=a),i!==void 0&&(c.trailing=i),p.useEffect(function(){if(n){var f=r.runAsync.bind(r);return o.current=yt(function(s){s()},n,c),r.runAsync=function(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return new Promise(function(m,v){var E;(E=o.current)===null||E===void 0||E.call(o,function(){f.apply(void 0,S([],_(s),!1)).then(m).catch(v)})})},function(){var s;r.runAsync=f,(s=o.current)===null||s===void 0||s.cancel()}}},[n,a,i]),n?{onCancel:function(){var f;(f=o.current)===null||f===void 0||f.cancel()}}:{}},Et=function(r){me&&(ve(r)||console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof r,'".'))),p.useEffect(function(){r==null||r()},[])},Tt=function(){var r=_(p.useState({}),2),e=r[1];return p.useCallback(function(){return e({})},[])},wt=function(){function r(e,n,a,i){i===void 0&&(i={}),this.serviceRef=e,this.options=n,this.subscribe=a,this.initState=i,this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=A(A(A({},this.state),{loading:!n.manual}),i)}return r.prototype.setState=function(e){e===void 0&&(e={}),this.state=A(A({},this.state),e),this.subscribe()},r.prototype.runPluginHandler=function(e){for(var n=[],a=1;a<arguments.length;a++)n[a-1]=arguments[a];var i=this.pluginImpls.map(function(o){var c;return(c=o[e])===null||c===void 0?void 0:c.call.apply(c,S([o],_(n),!1))}).filter(Boolean);return Object.assign.apply(Object,S([{}],_(i),!1))},r.prototype.runAsync=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Ir(this,void 0,void 0,function(){var a,i,o,c,f,s,u,m,v,E,g,b,T,x,q,N,M,k,G,L,W;return Lr(this,function(P){switch(P.label){case 0:if(this.count+=1,a=this.count,i=this.runPluginHandler("onBefore",e),o=i.stopNow,c=o===void 0?!1:o,f=i.returnNow,s=f===void 0?!1:f,u=Er(i,["stopNow","returnNow"]),c)return[2,new Promise(function(){})];if(this.setState(A({loading:!0,params:e},u)),s)return[2,Promise.resolve(u.data)];(T=(b=this.options).onBefore)===null||T===void 0||T.call(b,e),P.label=1;case 1:return P.trys.push([1,3,,4]),m=this.runPluginHandler("onRequest",this.serviceRef.current,e).servicePromise,m||(m=(g=this.serviceRef).current.apply(g,S([],_(e),!1))),[4,m];case 2:return v=P.sent(),a!==this.count?[2,new Promise(function(){})]:(this.setState({data:v,error:void 0,loading:!1}),(q=(x=this.options).onSuccess)===null||q===void 0||q.call(x,v,e),this.runPluginHandler("onSuccess",v,e),(M=(N=this.options).onFinally)===null||M===void 0||M.call(N,e,v,void 0),a===this.count&&this.runPluginHandler("onFinally",e,v,void 0),[2,v]);case 3:if(E=P.sent(),a!==this.count)return[2,new Promise(function(){})];throw this.setState({error:E,loading:!1}),(G=(k=this.options).onError)===null||G===void 0||G.call(k,E,e),this.runPluginHandler("onError",E,e),(W=(L=this.options).onFinally)===null||W===void 0||W.call(L,e,void 0,E),a===this.count&&this.runPluginHandler("onFinally",e,void 0,E),E;case 4:return[2]}})})},r.prototype.run=function(){for(var e=this,n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];this.runAsync.apply(this,S([],_(n),!1)).catch(function(i){e.options.onError||console.error(i)})},r.prototype.cancel=function(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")},r.prototype.refresh=function(){this.run.apply(this,S([],_(this.state.params||[]),!1))},r.prototype.refreshAsync=function(){return this.runAsync.apply(this,S([],_(this.state.params||[]),!1))},r.prototype.mutate=function(e){var n=ve(e)?e(this.state.data):e;this.runPluginHandler("onMutate",n),this.setState({data:n})},r}();function Rt(r,e,n){e===void 0&&(e={}),n===void 0&&(n=[]);var a=e.manual,i=a===void 0?!1:a,o=e.ready,c=o===void 0?!0:o,f=Er(e,["manual","ready"]);me&&e.defaultParams&&!Array.isArray(e.defaultParams)&&console.warn("expected defaultParams is array, got ".concat(typeof e.defaultParams));var s=A({manual:i,ready:c},f),u=Rr(r),m=Tt(),v=wr(function(){var E=n.map(function(g){var b;return(b=g==null?void 0:g.onInit)===null||b===void 0?void 0:b.call(g,s)}).filter(Boolean);return new wt(u,s,m,Object.assign.apply(Object,S([{}],_(E),!1)))},[]);return v.options=s,v.pluginImpls=n.map(function(E){return E(v,s)}),Et(function(){if(!i&&c){var E=v.state.params||e.defaultParams||[];v.run.apply(v,S([],_(E),!1))}}),$e(function(){v.cancel()}),{loading:v.state.loading,data:v.state.data,error:v.state.error,params:v.state.params||[],cancel:Z(v.cancel.bind(v)),refresh:Z(v.refresh.bind(v)),refreshAsync:Z(v.refreshAsync.bind(v)),run:Z(v.run.bind(v)),runAsync:Z(v.runAsync.bind(v)),mutate:Z(v.mutate.bind(v))}}function jt(r,e,n){return Rt(r,e,S(S([],_(n||[]),!1),[ot,ut,st,mt,pt,Tr,Dr,bt],!1))}function _t(r,e,n){const a=jt(r,{...e,onError(o,c){var f;((e==null?void 0:e.errorMessage)??!0)&&exports.message.error(o.message),(f=e==null?void 0:e.onError)==null||f.call(e,o,c)}},n),i=a.data&&typeof a.data=="object"&&"data"in a.data?a.data.data:a.data;return{...a,data:i}}exports.App=qr;exports.CheckboxValue=Wr;exports.IconFont=Mr;exports.SwitchValue=$r;exports.useRequest=_t;
|
|
32
|
+
Check the top-level render call using <`+n+">."),v}var W=h,q=Symbol.for("react.transitional.element"),H=Symbol.for("react.portal"),G=Symbol.for("react.fragment"),$=Symbol.for("react.strict_mode"),P=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),se=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),fe=Symbol.for("react.offscreen"),ze=Symbol.iterator,$r=Symbol.for("react.client.reference"),z=W.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,De=Object.prototype.hasOwnProperty,D=Object.assign,Lr=Symbol.for("react.client.reference"),pe=Array.isArray,ee=0,Ve,Je,Xe,Ze,Qe,Ke,er;a.__reactDisabledLog=!0;var Ee,rr,Te=!1,we=new(typeof WeakMap=="function"?WeakMap:Map),Fr=Symbol.for("react.client.reference"),tr,nr={},ar={},or={};ne.Fragment=G,ne.jsx=function(n,v,g,E,S){return b(n,v,g,!1,E,S)},ne.jsxs=function(n,v,g,E,S){return b(n,v,g,!0,E,S)}}()),ne}var cr;function Gr(){return cr||(cr=1,process.env.NODE_ENV==="production"?ve.exports=Ir():ve.exports=Br()),ve.exports}var C=Gr();exports.message=B.message;exports.notification=B.notification;exports.modal=B.Modal;function Yr({children:e}){const t=B.App.useApp();return exports.message=t.message,exports.modal=t.modal,exports.notification=t.notification,e||""}function Hr({children:e,...t}){return C.jsx(B.App,{...t,children:C.jsx(Yr,{children:e})})}const xr=h.forwardRef(({type:e="",className:t="",symbol:r=!1,...a},i)=>r?C.jsx("svg",{className:`iconfont-symbol ${e} ${t}`,"aria-hidden":"true",ref:i,...a,children:C.jsx("use",{xlinkHref:`#${e}`})}):C.jsx("i",{className:`iconfont ${e} ${t}`,ref:i,...a})),Ur=({checked:e,onChange:t,trueValue:r=!0,falseValue:a=!1,trueLabel:i="",falseLabel:o="",children:c,...s})=>{const f=e===r,u=d=>{t==null||t(d.target.checked?r:a,d)};return C.jsx(B.Checkbox,{checked:f,onChange:u,...s,children:c||(f?i:o)})},zr=({checked:e,onChange:t,trueValue:r=!0,falseValue:a=!1,...i})=>{const o=e===r,c=(s,f)=>{t==null||t(s?r:a,f)};return C.jsx(B.Switch,{checked:o,onChange:c,...i})};var Dr=typeof global=="object"&&global&&global.Object===Object&&global,Vr=typeof self=="object"&&self&&self.Object===Object&&self,Jr=Dr||Vr||Function("return this")(),me=Jr.Symbol,Pr=Object.prototype,Xr=Pr.hasOwnProperty,Zr=Pr.toString,ae=me?me.toStringTag:void 0;function Qr(e){var t=Xr.call(e,ae),r=e[ae];try{e[ae]=void 0;var a=!0}catch{}var i=Zr.call(e);return a&&(t?e[ae]=r:delete e[ae]),i}var Kr=Object.prototype,et=Kr.toString;function rt(e){return et.call(e)}var tt="[object Null]",nt="[object Undefined]",sr=me?me.toStringTag:void 0;function at(e){return e==null?e===void 0?nt:tt:sr&&sr in Object(e)?Qr(e):rt(e)}function ot(e){return e!=null&&typeof e=="object"}var it=Array.isArray;function ut(){}var ct="[object String]";function st(e){return typeof e=="string"||!it(e)&&ot(e)&&at(e)==ct}var Re={exports:{}};/*!
|
|
33
|
+
Copyright (c) 2018 Jed Watson.
|
|
34
|
+
Licensed under the MIT License (MIT), see
|
|
35
|
+
http://jedwatson.github.io/classnames
|
|
36
|
+
*/var fr;function ft(){return fr||(fr=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var o="",c=0;c<arguments.length;c++){var s=arguments[c];s&&(o=i(o,a(s)))}return o}function a(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return r.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var c="";for(var s in o)t.call(o,s)&&o[s]&&(c=i(c,s));return c}function i(o,c){return c?o?o+" "+c:o+c:o}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(Re)),Re.exports}var lt=ft();const dt=Ge(lt);var vt=function(e){return function(t,r){var a=h.useRef(!1);e(function(){return function(){a.current=!1}},[]),e(function(){if(!a.current)a.current=!0;else return t()},r)}},N=function(){return N=Object.assign||function(t){for(var r,a=1,i=arguments.length;a<i;a++){r=arguments[a];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},N.apply(this,arguments)};function Ar(e,t){var r={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(r[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(r[a[i]]=e[a[i]]);return r}function gt(e,t,r,a){function i(o){return o instanceof r?o:new r(function(c){c(o)})}return new(r||(r=Promise))(function(o,c){function s(d){try{u(a.next(d))}catch(l){c(l)}}function f(d){try{u(a.throw(d))}catch(l){c(l)}}function u(d){d.done?o(d.value):i(d.value).then(s,f)}u((a=a.apply(e,t||[])).next())})}function bt(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a,i,o,c=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return c.next=s(0),c.throw=s(1),c.return=s(2),typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function s(u){return function(d){return f([u,d])}}function f(u){if(a)throw new TypeError("Generator is already executing.");for(;c&&(c=0,u[0]&&(r=0)),r;)try{if(a=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,i=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){r.label=u[1];break}if(u[0]===6&&r.label<o[1]){r.label=o[1],o=u;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(u);break}o[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(d){u=[6,d],i=0}finally{a=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function j(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var a=r.call(e),i,o=[],c;try{for(;(t===void 0||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(s){c={error:s}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(c)throw c.error}}return o}function O(e,t,r){if(r||arguments.length===2)for(var a=0,i=t.length,o;a<i;a++)(o||!(a in t))&&(o||(o=Array.prototype.slice.call(t,0,a)),o[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var ue=function(e){return typeof e=="function"},he=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test";function Z(e){he&&(ue(e)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));var t=h.useRef(e);t.current=h.useMemo(function(){return e},[e]);var r=h.useRef();return r.current||(r.current=function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];return t.current.apply(this,a)}),r.current}const Ie=vt(h.useEffect);var Cr=function(e,t){var r=t.manual,a=t.ready,i=a===void 0?!0:a,o=t.defaultParams,c=o===void 0?[]:o,s=t.refreshDeps,f=s===void 0?[]:s,u=t.refreshDepsAction,d=h.useRef(!1);return d.current=!1,Ie(function(){!r&&i&&(d.current=!0,e.run.apply(e,O([],j(c),!1)))},[i]),Ie(function(){d.current||r||(d.current=!0,u?u():e.refresh())},O([],j(f),!1)),{onBefore:function(){if(!i)return{stopNow:!0}}}};Cr.onInit=function(e){var t=e.ready,r=t===void 0?!0:t,a=e.manual;return{loading:!a&&r}};function Be(e,t){if(e===t)return!0;for(var r=0;r<e.length;r++)if(!Object.is(e[r],t[r]))return!1;return!0}function Nr(e,t){var r=h.useRef({deps:t,obj:void 0,initialized:!1}).current;return(r.initialized===!1||!Be(r.deps,t))&&(r.deps=t,r.obj=e(),r.initialized=!0),r.obj}function Ye(e){var t=h.useRef(e);return t.current=e,t}var ye=function(e){he&&(ue(e)||console.error("useUnmount expected parameter is a function, got ".concat(typeof e)));var t=Ye(e);h.useEffect(function(){return function(){t.current()}},[])},ge=new Map,mt=function(e,t,r){var a=ge.get(e);a!=null&&a.timer&&clearTimeout(a.timer);var i=void 0;t>-1&&(i=setTimeout(function(){ge.delete(e)},t)),ge.set(e,N(N({},r),{timer:i}))},ht=function(e){return ge.get(e)},be=new Map,yt=function(e){return be.get(e)},pt=function(e,t){be.set(e,t),t.then(function(r){return be.delete(e),r}).catch(function(){be.delete(e)})},J={},Et=function(e,t){J[e]&&J[e].forEach(function(r){return r(t)})},je=function(e,t){return J[e]||(J[e]=[]),J[e].push(t),function(){var a=J[e].indexOf(t);J[e].splice(a,1)}},Tt=function(e,t){var r=t.cacheKey,a=t.cacheTime,i=a===void 0?5*60*1e3:a,o=t.staleTime,c=o===void 0?0:o,s=t.setCache,f=t.getCache,u=h.useRef(),d=h.useRef(),l=function(m,b){s?s(b):mt(m,i,b),Et(m,b.data)},p=function(m,b){return b===void 0&&(b=[]),f?f(b):ht(m)};return Nr(function(){if(r){var m=p(r);m&&Object.hasOwnProperty.call(m,"data")&&(e.state.data=m.data,e.state.params=m.params,(c===-1||new Date().getTime()-m.time<=c)&&(e.state.loading=!1)),u.current=je(r,function(b){e.setState({data:b})})}},[]),ye(function(){var m;(m=u.current)===null||m===void 0||m.call(u)}),r?{onBefore:function(m){var b=p(r,m);return!b||!Object.hasOwnProperty.call(b,"data")?{}:c===-1||new Date().getTime()-b.time<=c?{loading:!1,data:b==null?void 0:b.data,error:void 0,returnNow:!0}:{data:b==null?void 0:b.data,error:void 0}},onRequest:function(m,b){var T=yt(r);return T&&T!==d.current?{servicePromise:T}:(T=m.apply(void 0,O([],j(b),!1)),d.current=T,pt(r,T),{servicePromise:T})},onSuccess:function(m,b){var T;r&&((T=u.current)===null||T===void 0||T.call(u),l(r,{data:m,params:b,time:new Date().getTime()}),u.current=je(r,function(x){e.setState({data:x})}))},onMutate:function(m){var b;r&&((b=u.current)===null||b===void 0||b.call(u),l(r,{data:m,params:e.state.params,time:new Date().getTime()}),u.current=je(r,function(T){e.setState({data:T})}))}}:{}},Se,lr;function He(){if(lr)return Se;lr=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Se=e,Se}var Oe,dr;function wt(){if(dr)return Oe;dr=1;var e=typeof de=="object"&&de&&de.Object===Object&&de;return Oe=e,Oe}var _e,vr;function kr(){if(vr)return _e;vr=1;var e=wt(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return _e=r,_e}var xe,gr;function Rt(){if(gr)return xe;gr=1;var e=kr(),t=function(){return e.Date.now()};return xe=t,xe}var Pe,br;function jt(){if(br)return Pe;br=1;var e=/\s/;function t(r){for(var a=r.length;a--&&e.test(r.charAt(a)););return a}return Pe=t,Pe}var Ae,mr;function St(){if(mr)return Ae;mr=1;var e=jt(),t=/^\s+/;function r(a){return a&&a.slice(0,e(a)+1).replace(t,"")}return Ae=r,Ae}var Ce,hr;function qr(){if(hr)return Ce;hr=1;var e=kr(),t=e.Symbol;return Ce=t,Ce}var Ne,yr;function Ot(){if(yr)return Ne;yr=1;var e=qr(),t=Object.prototype,r=t.hasOwnProperty,a=t.toString,i=e?e.toStringTag:void 0;function o(c){var s=r.call(c,i),f=c[i];try{c[i]=void 0;var u=!0}catch{}var d=a.call(c);return u&&(s?c[i]=f:delete c[i]),d}return Ne=o,Ne}var ke,pr;function _t(){if(pr)return ke;pr=1;var e=Object.prototype,t=e.toString;function r(a){return t.call(a)}return ke=r,ke}var qe,Er;function xt(){if(Er)return qe;Er=1;var e=qr(),t=Ot(),r=_t(),a="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function c(s){return s==null?s===void 0?i:a:o&&o in Object(s)?t(s):r(s)}return qe=c,qe}var Me,Tr;function Pt(){if(Tr)return Me;Tr=1;function e(t){return t!=null&&typeof t=="object"}return Me=e,Me}var We,wr;function At(){if(wr)return We;wr=1;var e=xt(),t=Pt(),r="[object Symbol]";function a(i){return typeof i=="symbol"||t(i)&&e(i)==r}return We=a,We}var $e,Rr;function Ct(){if(Rr)return $e;Rr=1;var e=St(),t=He(),r=At(),a=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;function f(u){if(typeof u=="number")return u;if(r(u))return a;if(t(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=t(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=e(u);var l=o.test(u);return l||c.test(u)?s(u.slice(2),l?2:8):i.test(u)?a:+u}return $e=f,$e}var Le,jr;function Mr(){if(jr)return Le;jr=1;var e=He(),t=Rt(),r=Ct(),a="Expected a function",i=Math.max,o=Math.min;function c(s,f,u){var d,l,p,m,b,T,x=0,M=!1,k=!1,W=!0;if(typeof s!="function")throw new TypeError(a);f=r(f)||0,e(u)&&(M=!!u.leading,k="maxWait"in u,p=k?i(r(u.maxWait)||0,f):p,W="trailing"in u?!!u.trailing:W);function q(w){var A=d,L=l;return d=l=void 0,x=w,m=s.apply(L,A),m}function H(w){return x=w,b=setTimeout(P,f),M?q(w):m}function G(w){var A=w-T,L=w-x,fe=f-A;return k?o(fe,p-L):fe}function $(w){var A=w-T,L=w-x;return T===void 0||A>=f||A<0||k&&L>=p}function P(){var w=t();if($(w))return Q(w);b=setTimeout(P,G(w))}function Q(w){return b=void 0,W&&d?q(w):(d=l=void 0,m)}function se(){b!==void 0&&clearTimeout(b),x=0,d=T=l=b=void 0}function K(){return b===void 0?m:Q(t())}function U(){var w=t(),A=$(w);if(d=arguments,l=this,T=w,A){if(b===void 0)return H(T);if(k)return clearTimeout(b),b=setTimeout(P,f),q(T)}return b===void 0&&(b=setTimeout(P,f)),m}return U.cancel=se,U.flush=K,U}return Le=c,Le}var Nt=Mr();const kt=Ge(Nt);var qt=function(e,t){var r=t.debounceWait,a=t.debounceLeading,i=t.debounceTrailing,o=t.debounceMaxWait,c=h.useRef(),s=h.useMemo(function(){var f={};return a!==void 0&&(f.leading=a),i!==void 0&&(f.trailing=i),o!==void 0&&(f.maxWait=o),f},[a,i,o]);return h.useEffect(function(){if(r){var f=e.runAsync.bind(e);return c.current=kt(function(u){u()},r,s),e.runAsync=function(){for(var u=[],d=0;d<arguments.length;d++)u[d]=arguments[d];return new Promise(function(l,p){var m;(m=c.current)===null||m===void 0||m.call(c,function(){f.apply(void 0,O([],j(u),!1)).then(l).catch(p)})})},function(){var u;(u=c.current)===null||u===void 0||u.cancel(),e.runAsync=f}}},[r,s]),r?{onCancel:function(){var f;(f=c.current)===null||f===void 0||f.cancel()}}:{}},Mt=function(e,t){var r=t.loadingDelay,a=t.ready,i=h.useRef();if(!r)return{};var o=function(){i.current&&clearTimeout(i.current)};return{onBefore:function(){return o(),a!==!1&&(i.current=setTimeout(function(){e.setState({loading:!0})},r)),{loading:!1}},onFinally:function(){o()},onCancel:function(){o()}}},ce=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ue(){return ce?document.visibilityState!=="hidden":!0}var oe=[];function Wt(e){return oe.push(e),function(){var r=oe.indexOf(e);oe.splice(r,1)}}if(ce){var $t=function(){if(Ue())for(var e=0;e<oe.length;e++){var t=oe[e];t()}};window.addEventListener("visibilitychange",$t,!1)}var Lt=function(e,t){var r=t.pollingInterval,a=t.pollingWhenHidden,i=a===void 0?!0:a,o=t.pollingErrorRetryCount,c=o===void 0?-1:o,s=h.useRef(),f=h.useRef(),u=h.useRef(0),d=function(){var l;s.current&&clearTimeout(s.current),(l=f.current)===null||l===void 0||l.call(f)};return Ie(function(){r||d()},[r]),r?{onBefore:function(){d()},onError:function(){u.current+=1},onSuccess:function(){u.current=0},onFinally:function(){c===-1||c!==-1&&u.current<=c?s.current=setTimeout(function(){!i&&!Ue()?f.current=Wt(function(){e.refresh()}):e.refresh()},r):u.current=0},onCancel:function(){d()}}:{}};function Ft(e,t){var r=!1;return function(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];r||(r=!0,e.apply(void 0,O([],j(a),!1)),setTimeout(function(){r=!1},t))}}function It(){return ce&&typeof navigator.onLine<"u"?navigator.onLine:!0}var ie=[];function Bt(e){return ie.push(e),function(){var r=ie.indexOf(e);r>-1&&ie.splice(r,1)}}if(ce){var Sr=function(){if(!(!Ue()||!It()))for(var e=0;e<ie.length;e++){var t=ie[e];t()}};window.addEventListener("visibilitychange",Sr,!1),window.addEventListener("focus",Sr,!1)}var Gt=function(e,t){var r=t.refreshOnWindowFocus,a=t.focusTimespan,i=a===void 0?5e3:a,o=h.useRef(),c=function(){var s;(s=o.current)===null||s===void 0||s.call(o)};return h.useEffect(function(){if(r){var s=Ft(e.refresh.bind(e),i);o.current=Bt(function(){s()})}return function(){c()}},[r,i]),ye(function(){c()}),{}},Yt=function(e,t){var r=t.retryInterval,a=t.retryCount,i=h.useRef(),o=h.useRef(0),c=h.useRef(!1);return a?{onBefore:function(){c.current||(o.current=0),c.current=!1,i.current&&clearTimeout(i.current)},onSuccess:function(){o.current=0},onError:function(){if(o.current+=1,a===-1||o.current<=a){var s=r??Math.min(1e3*Math.pow(2,o.current),3e4);i.current=setTimeout(function(){c.current=!0,e.refresh()},s)}else o.current=0},onCancel:function(){o.current=0,i.current&&clearTimeout(i.current)}}:{}},Fe,Or;function Ht(){if(Or)return Fe;Or=1;var e=Mr(),t=He(),r="Expected a function";function a(i,o,c){var s=!0,f=!0;if(typeof i!="function")throw new TypeError(r);return t(c)&&(s="leading"in c?!!c.leading:s,f="trailing"in c?!!c.trailing:f),e(i,o,{leading:s,maxWait:o,trailing:f})}return Fe=a,Fe}var Ut=Ht();const zt=Ge(Ut);var Dt=function(e,t){var r=t.throttleWait,a=t.throttleLeading,i=t.throttleTrailing,o=h.useRef(),c={};return a!==void 0&&(c.leading=a),i!==void 0&&(c.trailing=i),h.useEffect(function(){if(r){var s=e.runAsync.bind(e);return o.current=zt(function(f){f()},r,c),e.runAsync=function(){for(var f=[],u=0;u<arguments.length;u++)f[u]=arguments[u];return new Promise(function(d,l){var p;(p=o.current)===null||p===void 0||p.call(o,function(){s.apply(void 0,O([],j(f),!1)).then(d).catch(l)})})},function(){var f;e.runAsync=s,(f=o.current)===null||f===void 0||f.cancel()}}},[r,a,i]),r?{onCancel:function(){var s;(s=o.current)===null||s===void 0||s.cancel()}}:{}},Vt=function(e){he&&(ue(e)||console.error('useMount: parameter `fn` expected to be a function, but got "'.concat(typeof e,'".'))),h.useEffect(function(){e==null||e()},[])},Jt=function(){var e=j(h.useState({}),2),t=e[1];return h.useCallback(function(){return t({})},[])},Xt=function(){function e(t,r,a,i){i===void 0&&(i={}),this.serviceRef=t,this.options=r,this.subscribe=a,this.initState=i,this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=N(N(N({},this.state),{loading:!r.manual}),i)}return e.prototype.setState=function(t){t===void 0&&(t={}),this.state=N(N({},this.state),t),this.subscribe()},e.prototype.runPluginHandler=function(t){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];var i=this.pluginImpls.map(function(o){var c;return(c=o[t])===null||c===void 0?void 0:c.call.apply(c,O([o],j(r),!1))}).filter(Boolean);return Object.assign.apply(Object,O([{}],j(i),!1))},e.prototype.runAsync=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return gt(this,void 0,void 0,function(){var a,i,o,c,s,f,u,d,l,p,m,b,T,x,M,k,W,q,H,G,$;return bt(this,function(P){switch(P.label){case 0:if(this.count+=1,a=this.count,i=this.runPluginHandler("onBefore",t),o=i.stopNow,c=o===void 0?!1:o,s=i.returnNow,f=s===void 0?!1:s,u=Ar(i,["stopNow","returnNow"]),c)return[2,new Promise(function(){})];if(this.setState(N({loading:!0,params:t},u)),f)return[2,Promise.resolve(u.data)];(T=(b=this.options).onBefore)===null||T===void 0||T.call(b,t),P.label=1;case 1:return P.trys.push([1,3,,4]),d=this.runPluginHandler("onRequest",this.serviceRef.current,t).servicePromise,d||(d=(m=this.serviceRef).current.apply(m,O([],j(t),!1))),[4,d];case 2:return l=P.sent(),a!==this.count?[2,new Promise(function(){})]:(this.setState({data:l,error:void 0,loading:!1}),(M=(x=this.options).onSuccess)===null||M===void 0||M.call(x,l,t),this.runPluginHandler("onSuccess",l,t),(W=(k=this.options).onFinally)===null||W===void 0||W.call(k,t,l,void 0),a===this.count&&this.runPluginHandler("onFinally",t,l,void 0),[2,l]);case 3:if(p=P.sent(),a!==this.count)return[2,new Promise(function(){})];throw this.setState({error:p,loading:!1}),(H=(q=this.options).onError)===null||H===void 0||H.call(q,p,t),this.runPluginHandler("onError",p,t),($=(G=this.options).onFinally)===null||$===void 0||$.call(G,t,void 0,p),a===this.count&&this.runPluginHandler("onFinally",t,void 0,p),p;case 4:return[2]}})})},e.prototype.run=function(){for(var t=this,r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];this.runAsync.apply(this,O([],j(r),!1)).catch(function(i){t.options.onError||console.error(i)})},e.prototype.cancel=function(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")},e.prototype.refresh=function(){this.run.apply(this,O([],j(this.state.params||[]),!1))},e.prototype.refreshAsync=function(){return this.runAsync.apply(this,O([],j(this.state.params||[]),!1))},e.prototype.mutate=function(t){var r=ue(t)?t(this.state.data):t;this.runPluginHandler("onMutate",r),this.setState({data:r})},e}();function Zt(e,t,r){t===void 0&&(t={}),r===void 0&&(r=[]);var a=t.manual,i=a===void 0?!1:a,o=t.ready,c=o===void 0?!0:o,s=Ar(t,["manual","ready"]);he&&t.defaultParams&&!Array.isArray(t.defaultParams)&&console.warn("expected defaultParams is array, got ".concat(typeof t.defaultParams));var f=N({manual:i,ready:c},s),u=Ye(e),d=Jt(),l=Nr(function(){var p=r.map(function(m){var b;return(b=m==null?void 0:m.onInit)===null||b===void 0?void 0:b.call(m,f)}).filter(Boolean);return new Xt(u,f,d,Object.assign.apply(Object,O([{}],j(p),!1)))},[]);return l.options=f,l.pluginImpls=r.map(function(p){return p(l,f)}),Vt(function(){if(!i&&c){var p=l.state.params||t.defaultParams||[];l.run.apply(l,O([],j(p),!1))}}),ye(function(){l.cancel()}),{loading:l.state.loading,data:l.state.data,error:l.state.error,params:l.state.params||[],cancel:Z(l.cancel.bind(l)),refresh:Z(l.refresh.bind(l)),refreshAsync:Z(l.refreshAsync.bind(l)),run:Z(l.run.bind(l)),runAsync:Z(l.runAsync.bind(l)),mutate:Z(l.mutate.bind(l))}}function Qt(e,t,r){return Zt(e,t,O(O([],j(r||[]),!1),[qt,Mt,Lt,Gt,Dt,Cr,Tt,Yt],!1))}function Kt(e,t){var r=j(h.useState(e),2),a=r[0],i=r[1],o=h.useMemo(function(){var c=!0,s=function(){return i(function(l){return l===e?c:e})},f=function(l){return i(l)},u=function(){return i(e)},d=function(){return i(c)};return{toggle:s,set:f,setLeft:u,setRight:d}},[]);return[a,o]}function en(e){var t=j(Kt(!1),2),r=t[0],a=t[1],i=a.toggle,o=a.set,c=h.useMemo(function(){var s=function(){return o(!0)},f=function(){return o(!1)};return{toggle:i,set:function(u){return o(!!u)},setTrue:s,setFalse:f}},[]);return[r,c]}function Wr(e,t){if(ce){if(!e)return t;var r;return ue(e)?r=e():"current"in e?r=e.current:r=e,r}}var rn=function(e){var t=function(r,a,i){var o=h.useRef(!1),c=h.useRef([]),s=h.useRef([]),f=h.useRef();e(function(){var u,d=Array.isArray(i)?i:[i],l=d.map(function(p){return Wr(p)});if(!o.current){o.current=!0,c.current=l,s.current=a,f.current=r();return}(l.length!==c.current.length||!Be(c.current,l)||!Be(s.current,a))&&((u=f.current)===null||u===void 0||u.call(f),c.current=l,s.current=a,f.current=r())}),ye(function(){var u;(u=f.current)===null||u===void 0||u.call(f),o.current=!1})};return t},tn=rn(h.useEffect);function _r(e,t,r){r===void 0&&(r={});var a=r.enable,i=a===void 0?!0:a,o=Ye(t);tn(function(){if(i){var c=Wr(r.target,window);if(c!=null&&c.addEventListener){var s=function(u){return o.current(u)},f=Array.isArray(e)?e:[e];return f.forEach(function(u){c.addEventListener(u,s,{capture:r.capture,once:r.once,passive:r.passive})}),function(){f.forEach(function(u){c.removeEventListener(u,s,{capture:r.capture})})}}}},[e,r.capture,r.once,r.passive,i],r.target)}const nn=function(e,t){var r={},a=r.onEnter,i=r.onLeave,o=r.onChange,c=j(en(),2),s=c[0],f=c[1],u=f.setTrue,d=f.setFalse;return _r("mouseenter",function(){a==null||a(),u(),o==null||o(!0)},{target:e}),_r("mouseleave",function(){i==null||i(),d(),o==null||o(!1)},{target:e}),s},an={},on=(e,t)=>{const r=h.useRef(null),{icon:a,tooltipDisabled:i=!1,onClick:o=ut,disabled:c,size:s="middle",style:f={},className:u,loading:d=!1,...l}=e,p=nn(r),m=()=>st(a)&&a.includes("icon-")?C.jsx(xr,{type:a}):a,b=C.jsx(B.Button,{onClick:o,size:s,disabled:c,style:f,ref:t,loading:d,className:dt([u,an.btn_icon__warp]),icon:m()});if(!a)throw new Error("IconButton 组件必须传入 icon 属性");return C.jsxs(h.Fragment,{children:[i&&b,!i&&C.jsx(B.Tooltip,{open:p,trigger:"contextMenu",destroyTooltipOnHide:!0,...l,children:C.jsx("span",{ref:r,style:{display:"inline-block"},className:"icon-button-box",children:b})})]})},un=h.forwardRef(on);function cn(e,t,r){const a=Qt(e,{...t,onError(o,c){var s;((t==null?void 0:t.errorMessage)??!0)&&exports.message.error(o.message),(s=t==null?void 0:t.onError)==null||s.call(t,o,c)}},r),i=a.data&&typeof a.data=="object"&&"data"in a.data?a.data.data:a.data;return{...a,data:i}}exports.App=Hr;exports.CheckboxValue=Ur;exports.IconButton=un;exports.IconFont=xr;exports.SwitchValue=zr;exports.useRequest=cn;
|