@topthink/components 1.0.57 → 1.0.59
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/es/editor-widget-CQ3zv-Xu.js +355 -0
- package/es/{image-zoom-912e2b3b.js → image-zoom-OrIPGqh0.js} +0 -1
- package/es/index-PGfJO0Bp.js +39 -0
- package/es/index-PvFKqXZL.js +1 -0
- package/es/{index-6ae8237d.js → index-XkUorbN_.js} +13 -14
- package/es/index.js +1 -2
- package/es/{steps-afba29a7.js → steps-b_BcYIwk.js} +1 -2
- package/package.json +20 -18
- package/types/components/button.d.ts +9 -9
- package/types/components/card.d.ts +7 -7
- package/types/components/dimmer.d.ts +7 -7
- package/types/components/error.d.ts +5 -5
- package/types/components/form.d.ts +4 -4
- package/types/components/image-zoom.d.ts +4 -4
- package/types/components/lazy/{form.d.ts → form/index.d.ts} +19 -19
- package/types/components/lazy/form/widgets/editor-widget.d.ts +6 -0
- package/types/components/lazy/image-zoom.d.ts +3 -3
- package/types/components/lazy/steps.d.ts +9 -9
- package/types/components/lazy/table/context.d.ts +2 -2
- package/types/components/lazy/table/index.d.ts +45 -45
- package/types/components/lazy/table/search.d.ts +23 -23
- package/types/components/lazy/table/use-selection.d.ts +3 -3
- package/types/components/loader.d.ts +9 -9
- package/types/components/loading-button.d.ts +7 -7
- package/types/components/modal/confirm.d.ts +8 -8
- package/types/components/modal/index.d.ts +32 -32
- package/types/components/modal/message.d.ts +26 -26
- package/types/components/modal/show.d.ts +3 -3
- package/types/components/modal-button.d.ts +17 -17
- package/types/components/modal-form.d.ts +10 -10
- package/types/components/number-format.d.ts +10 -10
- package/types/components/pagination.d.ts +11 -11
- package/types/components/request-button.d.ts +13 -13
- package/types/components/result.d.ts +15 -15
- package/types/components/space.d.ts +9 -9
- package/types/components/statistic.d.ts +7 -7
- package/types/components/steps.d.ts +10 -10
- package/types/components/table.d.ts +4 -4
- package/types/components/tooltip.d.ts +9 -9
- package/types/hooks/use-callback-ref.d.ts +2 -2
- package/types/hooks/use-controllable-state.d.ts +8 -8
- package/types/hooks/use-debounce.d.ts +2 -2
- package/types/hooks/use-overlay-state.d.ts +16 -16
- package/types/hooks/use-request.d.ts +21 -21
- package/types/hooks/use-safe-state.d.ts +4 -4
- package/types/hooks/use-state-with-callback.d.ts +2 -2
- package/types/hooks/use-unmounted-ref.d.ts +3 -3
- package/types/index.d.ts +33 -33
- package/types/request.d.ts +32 -32
- package/types/utils/is-record.d.ts +1 -1
- package/types/utils/message.d.ts +11 -11
- package/types/utils/toast.d.ts +11 -11
- package/types/utils/types.d.ts +7 -7
- package/types/utils/wait-pay-complete.d.ts +11 -11
- package/es/form-01bf45e9.js +0 -233
- package/es/form-01bf45e9.js.map +0 -1
- package/es/form-0a372a24.js +0 -2
- package/es/form-0a372a24.js.map +0 -1
- package/es/form-1791ea39.js +0 -236
- package/es/form-1791ea39.js.map +0 -1
- package/es/form-74ef0417.js +0 -2
- package/es/form-74ef0417.js.map +0 -1
- package/es/form-8925a750.js +0 -231
- package/es/form-8925a750.js.map +0 -1
- package/es/form-95db7eac.js +0 -2
- package/es/form-95db7eac.js.map +0 -1
- package/es/form-9c0e638a.js +0 -231
- package/es/form-9c0e638a.js.map +0 -1
- package/es/image-zoom-912e2b3b.js.map +0 -1
- package/es/index-1930b692.js +0 -67
- package/es/index-1930b692.js.map +0 -1
- package/es/index-1d379f3a.js +0 -562
- package/es/index-1d379f3a.js.map +0 -1
- package/es/index-303e1845.js +0 -560
- package/es/index-303e1845.js.map +0 -1
- package/es/index-4f51cece.js +0 -1352
- package/es/index-4f51cece.js.map +0 -1
- package/es/index-5142110c.js +0 -67
- package/es/index-5142110c.js.map +0 -1
- package/es/index-6ae8237d.js.map +0 -1
- package/es/index-7a7c06a9.js +0 -40
- package/es/index-7a7c06a9.js.map +0 -1
- package/es/index-9869b1c6.js +0 -1350
- package/es/index-9869b1c6.js.map +0 -1
- package/es/index-a48179db.js +0 -1382
- package/es/index-a48179db.js.map +0 -1
- package/es/index-b34ecf90.js +0 -40
- package/es/index-b34ecf90.js.map +0 -1
- package/es/index-d964165a.js +0 -560
- package/es/index-d964165a.js.map +0 -1
- package/es/index-e17dc6f0.js +0 -40
- package/es/index-e17dc6f0.js.map +0 -1
- package/es/index.js.map +0 -1
- package/es/steps-afba29a7.js.map +0 -1
- package/es/steps-c27a3885.js +0 -34
- package/es/steps-c27a3885.js.map +0 -1
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import"@toast-ui/editor/dist/toastui-editor-only.css";import"@toast-ui/editor/dist/i18n/zh-cn";import{Editor as t}from"@toast-ui/react-editor";import{useRef as i}from"react";import o from"styled-components";function r(o){const{value:r,onChange:a,placeholder:g,autofocus:d,options:l}=o,{editType:s="wysiwyg",outputType:p="markdown",onUpload:c}=l,I=i(null),m={};return c&&(m.addImageBlobHook=async(e,t)=>{t(await c(e))}),e(n,{children:e(t,{ref:I,placeholder:g,usageStatistics:!1,hooks:m,autofocus:d,linkAttributes:{target:"_blank"},onChange:()=>{const e=I.current?.getInstance();e&&a("markdown"===p?e.getMarkdown():e.getHTML())},language:"zh-CN",initialValue:r,previewStyle:"vertical",height:"600px",initialEditType:s})})}const n=o.div`
|
|
2
|
+
.ProseMirror {
|
|
3
|
+
position: relative;
|
|
4
|
+
word-wrap: break-word;
|
|
5
|
+
white-space: break-spaces;
|
|
6
|
+
-webkit-font-variant-ligatures: none;
|
|
7
|
+
font-variant-ligatures: none;
|
|
8
|
+
font-feature-settings: "liga" 0;
|
|
9
|
+
font-size: 15px;
|
|
10
|
+
overflow-y: auto;
|
|
11
|
+
overflow-X: hidden;
|
|
12
|
+
height: 100%;
|
|
13
|
+
|
|
14
|
+
&:focus {
|
|
15
|
+
outline: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
pre {
|
|
19
|
+
white-space: pre-wrap;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
li {
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.placeholder {
|
|
27
|
+
color: #999;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.ProseMirror-hideselection *::selection {
|
|
32
|
+
background: transparent;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ProseMirror-hideselection *::-moz-selection {
|
|
36
|
+
background: transparent;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.ProseMirror-hideselection {
|
|
40
|
+
caret-color: transparent;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ProseMirror-selectednode {
|
|
44
|
+
outline: 2px solid #8cf;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* Make sure li selections wrap around markers */
|
|
48
|
+
|
|
49
|
+
li.ProseMirror-selectednode {
|
|
50
|
+
outline: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
li.ProseMirror-selectednode:after {
|
|
54
|
+
content: "";
|
|
55
|
+
position: absolute;
|
|
56
|
+
left: -32px;
|
|
57
|
+
right: -2px;
|
|
58
|
+
top: -2px;
|
|
59
|
+
bottom: -2px;
|
|
60
|
+
border: 2px solid #8cf;
|
|
61
|
+
pointer-events: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Protect against generic img rules */
|
|
65
|
+
|
|
66
|
+
img.ProseMirror-separator {
|
|
67
|
+
display: inline !important;
|
|
68
|
+
border: none !important;
|
|
69
|
+
margin: 0 !important;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
.ProseMirror-selectednode {
|
|
74
|
+
outline: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
table.ProseMirror-selectednode {
|
|
78
|
+
border-radius: 2px;
|
|
79
|
+
outline: 2px solid #00a9ff;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.html-block.ProseMirror-selectednode {
|
|
83
|
+
border-radius: 2px;
|
|
84
|
+
outline: 2px solid #00a9ff;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.toastui-editor-pseudo-clipboard {
|
|
88
|
+
position: fixed;
|
|
89
|
+
opacity: 0;
|
|
90
|
+
width: 0;
|
|
91
|
+
height: 0;
|
|
92
|
+
left: -1000px;
|
|
93
|
+
top: -1000px;
|
|
94
|
+
z-index: -1;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.toastui-editor-defaultUI {
|
|
98
|
+
font-family: inherit;
|
|
99
|
+
|
|
100
|
+
.ProseMirror {
|
|
101
|
+
height: 100%;
|
|
102
|
+
padding: 14px !important;
|
|
103
|
+
font-size: 1rem;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.toastui-editor-defaultUI-toolbar {
|
|
107
|
+
padding: 0 5px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.toastui-editor-md-container {
|
|
111
|
+
.toastui-editor-md-preview {
|
|
112
|
+
padding: 5px 10px;
|
|
113
|
+
|
|
114
|
+
.toastui-editor-contents {
|
|
115
|
+
padding-top: 0;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.toastui-editor-contents {
|
|
122
|
+
-ms-text-size-adjust: 100%;
|
|
123
|
+
-webkit-text-size-adjust: 100%;
|
|
124
|
+
line-height: 1.2;
|
|
125
|
+
word-wrap: break-word;
|
|
126
|
+
|
|
127
|
+
& > *:first-child {
|
|
128
|
+
margin-top: 0 !important;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
& > *:last-child {
|
|
132
|
+
margin-bottom: 0 !important;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
h1, h2, h3, h4, h5, h6, p, ul, ol, blockquote, pre, table, audio, video {
|
|
136
|
+
margin: 1em 0;
|
|
137
|
+
line-height: 1.2;
|
|
138
|
+
padding: 0;
|
|
139
|
+
|
|
140
|
+
&:last-child {
|
|
141
|
+
margin-bottom: 0 !important;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&:first-child {
|
|
145
|
+
margin-top: 0 !important;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
p {
|
|
150
|
+
margin-bottom: 1em;
|
|
151
|
+
line-height: 2;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
h1, h2, h3, h4, h5, h6 {
|
|
155
|
+
font-weight: normal;
|
|
156
|
+
|
|
157
|
+
&.align-right {
|
|
158
|
+
text-align: right;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&.align-center {
|
|
162
|
+
text-align: center;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
h1 {
|
|
167
|
+
font-size: 2em;
|
|
168
|
+
line-height: 1.2;
|
|
169
|
+
border-bottom: 1px solid #eeeeee;
|
|
170
|
+
padding-bottom: .5em;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
h2 {
|
|
174
|
+
padding-bottom: .4em;
|
|
175
|
+
font-size: 1.3em;
|
|
176
|
+
line-height: 1.2;
|
|
177
|
+
border-bottom: 1px solid #eeeeee
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
h3 {
|
|
181
|
+
font-size: 1.2em;
|
|
182
|
+
line-height: 1.2;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
h4 {
|
|
186
|
+
font-size: 1.1em;
|
|
187
|
+
line-height: 1.2;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
h5 {
|
|
191
|
+
font-size: 1em;
|
|
192
|
+
line-height: 1.2;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
hr {
|
|
196
|
+
border: 0;
|
|
197
|
+
border-bottom: 1px solid #eeeeee;
|
|
198
|
+
margin-bottom: 0.5em;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
ul {
|
|
202
|
+
padding-left: 2em;
|
|
203
|
+
|
|
204
|
+
ul {
|
|
205
|
+
margin: 0;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
ol {
|
|
210
|
+
padding-left: 2em;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
li {
|
|
214
|
+
line-height: 2;
|
|
215
|
+
|
|
216
|
+
&.task-list-item {
|
|
217
|
+
list-style: none;
|
|
218
|
+
position: relative;
|
|
219
|
+
|
|
220
|
+
input[type=checkbox] {
|
|
221
|
+
position: absolute;
|
|
222
|
+
left: -1.5em;
|
|
223
|
+
top: 0.5em;
|
|
224
|
+
width: 1em;
|
|
225
|
+
height: 1em;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
code {
|
|
231
|
+
display: inline-block;
|
|
232
|
+
border-radius: 4px;
|
|
233
|
+
padding: .2em .4em;
|
|
234
|
+
background-color: #f7f7f7;
|
|
235
|
+
word-break: break-all;
|
|
236
|
+
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
237
|
+
white-space: pre;
|
|
238
|
+
line-height: 1.3;
|
|
239
|
+
margin: -.2em .4em;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
pre {
|
|
243
|
+
padding: 1.05em;
|
|
244
|
+
overflow: auto;
|
|
245
|
+
line-height: 1.45;
|
|
246
|
+
background-color: #f7f7f7;
|
|
247
|
+
border: 0;
|
|
248
|
+
border-radius: 3px;
|
|
249
|
+
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
pre > code {
|
|
254
|
+
display: inline;
|
|
255
|
+
max-width: 100%;
|
|
256
|
+
padding: 0;
|
|
257
|
+
margin: 0;
|
|
258
|
+
overflow: initial;
|
|
259
|
+
line-height: inherit;
|
|
260
|
+
background-color: rgba(0, 0, 0, 0);
|
|
261
|
+
border: 0;
|
|
262
|
+
tab-size: 4;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
table {
|
|
266
|
+
border-collapse: collapse;
|
|
267
|
+
table-layout: fixed;
|
|
268
|
+
width: 100%;
|
|
269
|
+
line-height: 1.8;
|
|
270
|
+
border-spacing: 0;
|
|
271
|
+
|
|
272
|
+
th {
|
|
273
|
+
text-align: left;
|
|
274
|
+
|
|
275
|
+
&[align='center'] {
|
|
276
|
+
text-align: center;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
&[align='right'] {
|
|
280
|
+
text-align: right;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
th, td {
|
|
285
|
+
border: 1px solid #e0e0e0;
|
|
286
|
+
padding: 3px 12px;
|
|
287
|
+
height: 34px;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
tr:hover td {
|
|
291
|
+
background-color: #f1f1f1;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
img {
|
|
296
|
+
max-width: 100%;
|
|
297
|
+
display: inline-block;
|
|
298
|
+
padding: 3px;
|
|
299
|
+
vertical-align: middle;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
a {
|
|
303
|
+
text-decoration: none;
|
|
304
|
+
color: var(--bs-primary);
|
|
305
|
+
|
|
306
|
+
&:hover {
|
|
307
|
+
text-decoration: underline;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
blockquote {
|
|
312
|
+
padding: 5px 5px 5px 15px;
|
|
313
|
+
color: #777777;
|
|
314
|
+
border-left: 4px solid #dddddd;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
video {
|
|
318
|
+
display: block;
|
|
319
|
+
width: 100%;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
audio {
|
|
323
|
+
display: block;
|
|
324
|
+
width: 100%;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.task-list-item {
|
|
328
|
+
border: 0;
|
|
329
|
+
list-style: none;
|
|
330
|
+
padding-left: 24px;
|
|
331
|
+
margin-left: -24px;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.task-list-item::before {
|
|
335
|
+
background-repeat: no-repeat;
|
|
336
|
+
background-size: 18px 18px;
|
|
337
|
+
background-position: center;
|
|
338
|
+
content: '';
|
|
339
|
+
margin-left: 0;
|
|
340
|
+
margin-top: 0;
|
|
341
|
+
border-radius: 2px;
|
|
342
|
+
height: 18px;
|
|
343
|
+
width: 18px;
|
|
344
|
+
position: absolute;
|
|
345
|
+
left: 0;
|
|
346
|
+
top: 7px;
|
|
347
|
+
cursor: pointer;
|
|
348
|
+
background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij4KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgZmlsbD0iI0ZGRiIgc3Ryb2tlPSIjQ0NDIj4KICAgICAgICAgICAgPGc+CiAgICAgICAgICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTAzMCAtMjk2KSB0cmFuc2xhdGUoNzg4IDE5MikgdHJhbnNsYXRlKDI0MiAxMDQpIj4KICAgICAgICAgICAgICAgICAgICA8cmVjdCB3aWR0aD0iMTciIGhlaWdodD0iMTciIHg9Ii41IiB5PSIuNSIgcng9IjIiLz4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+Cg==);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.task-list-item.checked::before {
|
|
352
|
+
background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij4KICAgIDxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgZmlsbD0iIzRCOTZFNiI+CiAgICAgICAgICAgIDxnPgogICAgICAgICAgICAgICAgPGc+CiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTE2IDBjMS4xMDUgMCAyIC44OTUgMiAydjE0YzAgMS4xMDUtLjg5NSAyLTIgMkgyYy0xLjEwNSAwLTItLjg5NS0yLTJWMkMwIC44OTUuODk1IDAgMiAwaDE0em0tMS43OTMgNS4yOTNjLS4zOS0uMzktMS4wMjQtLjM5LTEuNDE0IDBMNy41IDEwLjU4NSA1LjIwNyA4LjI5M2wtLjA5NC0uMDgzYy0uMzkyLS4zMDUtLjk2LS4yNzgtMS4zMi4wODMtLjM5LjM5LS4zOSAxLjAyNCAwIDEuNDE0bDMgMyAuMDk0LjA4M2MuMzkyLjMwNS45Ni4yNzggMS4zMi0uMDgzbDYtNiAuMDgzLS4wOTRjLjMwNS0uMzkyLjI3OC0uOTYtLjA4My0xLjMyeiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEwNTAgLTI5NikgdHJhbnNsYXRlKDc4OCAxOTIpIHRyYW5zbGF0ZSgyNjIgMTA0KSIvPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4K);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
`;export{r as default};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import n from"rc-table";import{unstable_batchedUpdates as o}from"react-dom";import{FormControl as a,Table as i}from"react-bootstrap";import{useUrlSearchParams as c}from"use-url-search-params";import*as l from"react";import{useState as s,useCallback as d,useRef as u,useEffect as p,useMemo as m,memo as h,forwardRef as f,useImperativeHandle as g}from"react";import{B as v,u as y,P as b,a as x,r as w,N as j,L as C,T as k,C as S,S as E}from"./index-XkUorbN_.js";import O from"styled-components";import V from"./index-PvFKqXZL.js";import"sweetalert2/dist/sweetalert2.js";import"sweetalert2-react-content";import"lodash";import"axios";import"query-string";import"retry-axios";import"rc-notification";import"classnames";import"react-async-hook";import"@topthink/json-form";const z=function(t){let{indeterminate:r=!1,...n}=t;const o=u(null);return p((()=>{o.current&&(o.current.indeterminate=r)}),[r]),e("input",{ref:o,...n,className:"form-check-input",type:"checkbox"})};var N;function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},H.apply(this,arguments)}const K=e=>l.createElement("svg",H({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",viewBox:"0 0 1024 1024"},e),N||(N=l.createElement("path",{d:"M252.069 906.496h520.283c89.582 0 134.144-44.562 134.144-132.846V250.331c0-88.283-44.562-132.845-134.144-132.845H252.069c-89.143 0-134.583 44.141-134.583 132.845V773.67c0 88.704 45.44 132.845 134.583 132.845zm1.28-68.992c-42.844 0-66.853-22.71-66.853-67.291V253.806c0-44.58 24.01-67.292 66.853-67.292h517.723c42.423 0 66.432 22.711 66.432 67.292v516.388c0 44.58-24.01 67.292-66.432 67.292zM511.78 714.496c22.71 0 36.425-15.854 36.425-40.704V547.365H682.35c24.009 0 40.722-12.874 40.722-35.584 0-23.132-15.854-36.426-40.722-36.426H548.206V340.773c0-24.85-13.715-40.704-36.425-40.704s-35.566 16.713-35.566 40.722v134.583H342.49c-24.85 0-41.142 13.275-41.142 36.407 0 22.71 17.152 35.584 41.142 35.584h133.724v126.427c0 23.99 12.855 40.704 35.566 40.704"})));var M;function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},q.apply(this,arguments)}const B=e=>l.createElement("svg",q({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",viewBox:"0 0 1024 1024"},e),M||(M=l.createElement("path",{d:"M252.069 906.496h520.283c89.582 0 134.144-44.562 134.144-132.846V250.331c0-88.283-44.562-132.845-134.144-132.845H252.069c-89.143 0-134.583 44.141-134.583 132.845V773.67c0 88.704 45.44 132.845 134.583 132.845zm1.28-68.992c-42.844 0-66.853-22.71-66.853-67.291V253.806c0-44.58 24.01-67.292 66.853-67.292h517.723c42.423 0 66.432 22.711 66.432 67.292v516.388c0 44.58-24.01 67.292-66.432 67.292zm86.582-289.719h344.576c23.991 0 40.704-12.855 40.704-35.566 0-23.15-15.433-36.425-40.704-36.425H339.931c-24.868 0-40.722 13.276-40.722 36.425 0 22.711 16.713 35.566 40.722 35.566"})));function P(r){let{data:n,options:o,columns:a,onSearch:i}=r;const[c,l]=s(0),u={"ui:col":10,"ui:order":o.order},[p,h]=m((()=>{const e={},t={};o.fields.forEach((r=>{const n=a.find((e=>e.dataIndex===r));if(n){const a=n.title;if("string"==typeof a){if(u[r]={"ui:col":4,"ui:labelCol":3,"ui:placeholder":"请输入",...o.ui?.[r]},n.valueEnum){const e=n.valueEnum;return u[r]["ui:placeholder"]="请选择",t[r]={title:a,type:"string",enum:Object.keys(e).flatMap((t=>"string"==typeof e[t].text?[t]:[])),enumNames:Object.keys(e).flatMap((t=>{const r=e[t].text;return"string"==typeof r?[r]:[]}))}}e[r]=void 0,t[r]={title:a,type:"string"}}}})),o.extraFields&&Object.entries(o.extraFields).forEach((r=>{let[n,a]=r;u[n]={"ui:col":4,"ui:labelCol":3,"ui:placeholder":"请输入",...o.ui?.[n]},e[n]=void 0,t[n]={title:a,type:"string"}}));return[{type:"object",properties:t},e]}),[o.fields,o.extraFields]),f=d((e=>{let{formData:t}=e;i({...h,...t})}),[i,h]),g=d((()=>{l((e=>e+1)),i(h)}),[i,h]);return e(F,{children:e(V,{formContext:{layout:"horizontal"},schema:p,uiSchema:u,onSubmit:f,formData:n,children:e("div",{className:"col-2 ms-auto mt-auto",children:t("div",{className:"justify-content-end d-flex gap-2 ",children:[e(v,{className:"px-4",onClick:g,variant:"secondary",children:"重置"}),e(v,{className:"px-4",type:"submit",variant:"primary",children:"查询"})]})})})},c)}const F=O.div`
|
|
2
|
+
margin-bottom: 1rem;
|
|
3
|
+
`;function T(t){let{keyword:r,onKeywordChange:n}=t;const[o,i]=s(r),c=y(n,500);p((()=>{i(r)}),[r]);const l=d((e=>{i(e.target.value),c(e.target.value)}),[c,i]);return e(a,{value:o,onChange:l,type:"search",placeholder:"Search..."})}const _=O.thead`
|
|
4
|
+
th {
|
|
5
|
+
padding: 0.5rem 0.5rem;
|
|
6
|
+
border-bottom-width: 1px;
|
|
7
|
+
border-color: var(--bs-border-color);
|
|
8
|
+
}
|
|
9
|
+
`,D={table:t=>e(i,{...t,className:"mb-0 align-middle table-hover"}),header:{wrapper:t=>e(_,{...t})}},I=O.a`
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
width: 28px;
|
|
12
|
+
height: 28px;
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
vertical-align: middle;
|
|
17
|
+
`,R=function(t){let{record:r,expanded:n,expandable:o,onExpand:a}=t;return e(I,o?{onClick:e=>a(r,e),children:e(n?B:K,{})}:{})},A=O(b)`
|
|
18
|
+
margin-bottom: 0;
|
|
19
|
+
justify-content: flex-end;
|
|
20
|
+
margin-top: 1rem;
|
|
21
|
+
`;const L=f(((a,i)=>{let{source:l,rowKey:h="id",paginate:f=!0,toolBarRender:v,columns:y=[],search:b,rowSelection:E,card:O=!0,expandable:V={},sync:N=!1,...H}=a;const[K,M]=s([]),[q,B]=s(f?{total:0,current:1,pageSize:10}:null),[F,_]=s(!0),[I,L]=c({}),[$,W]=function(t,r,n){const[o,a]=s((()=>new Set(t?.selectedRowKeys||[]))),i=e=>"string"==typeof r?e[r]:r(e),c=e=>n.find((t=>i(t)===e)),l=d((e=>{e instanceof Set||(e=new Set(e)),a(e);const r=Array.from(e),n=r.map((function(e){return c(e)}));t?.onChange&&t?.onChange(r,n)}),[c]);return[d((r=>{if(!t)return r;const a=n.map(i),c=a.every((function(e){return o.has(e)})),s=a.some((function(e){return o.has(e)}));return[{key:"selection",title:e(z,{checked:c&&n.length>0,indeterminate:!c&&s,onChange:()=>{c?a.forEach((function(e){o.delete(e)})):a.forEach((function(e){o.add(e)})),l(new Set(o))}}),width:30,align:"center",render(t){let{record:r}=t;const n=i(r),a=o.has(n);return e(z,{checked:a,onChange:()=>{a?o.delete(n):o.add(n),l(new Set(o))}})}},...r]}),[n,t,o]),l]}(E,h,K),[X,Y]=x({value:N?I||{}:void 0,defaultValue:{},onChange:e=>{N&&L(e)}}),[Z,ee]=x({value:N?I.q||"":void 0,defaultValue:"",onChange:e=>{N&&L({q:e||void 0})}}),[te,re]=x({value:N?I.page||1:void 0,defaultValue:1,onChange:e=>{N&&L({page:e||void 0})}}),ne=d((async()=>{_(!0),W([]);try{let e;const t={...X,q:Z,page:te>1?te:void 0};e="string"==typeof l?await w({url:l,params:t}):await l(t),f&&function(e){return"current_page"in e}(e)&&(B({total:e.total,current:e.current_page,pageSize:e.per_page}),e=e.data),M(e)}catch(e){}finally{_(!1)}}),[l,M,Z,te,X]);p((()=>{ne()}),[Z,te,X]);const oe=u({reload:ne});p((()=>{oe.current={reload:ne}}),[ne]),g(i,(()=>oe.current));const ae=m((()=>$(y).map((t=>{let{render:r,valueType:n,valueEnum:o,...a}=t;const i={...a};return r?i.render=(e,t,n)=>r({value:e,record:t,index:n,action:oe.current}):"currency"===n?i.render=t=>e(j,{value:t}):o&&(i.render=t=>o[t]?o[t].status?e("span",{className:`text-${o[t].status}`,children:o[t].text}):o[t].text:t),i}))),[y,$,oe]),ie=t(r,{children:[e(C,{loading:F}),"object"==typeof b&&e(P,{data:X,columns:y,options:b,onSearch:e=>{o((()=>{re(1),Y(e)}))}}),!1!==v&&t(G,{children:[e(Q,{size:12,children:v&&v(oe.current)}),t(J,{size:12,children:[!0===b&&e(T,{keyword:Z,onKeywordChange:e=>{o((()=>{re(1),ee(e)}))}}),e(U,{onClick:oe.current.reload,children:e("i",{className:"bi bi-arrow-repeat"})})]})]}),e(k.Provider,{value:!0,children:e(n,{...H,expandable:{expandIcon:R,...V},rowKey:h,columns:ae,components:D,data:K})}),q&&e(A,{...q,onChange:re})]});return O?e(S,{children:ie}):ie}));var $=h(L);const G=O.div`
|
|
22
|
+
display: flex;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
padding-bottom: 1rem;
|
|
25
|
+
height: 48px;
|
|
26
|
+
border-bottom: 2px solid #212529;
|
|
27
|
+
`,J=O(E)`
|
|
28
|
+
|
|
29
|
+
`,Q=O(E)`
|
|
30
|
+
|
|
31
|
+
`,U=O.span`
|
|
32
|
+
cursor: pointer;
|
|
33
|
+
font-size: 20px;
|
|
34
|
+
line-height: 1;
|
|
35
|
+
|
|
36
|
+
&:hover {
|
|
37
|
+
color: var(--bs-primary);
|
|
38
|
+
}
|
|
39
|
+
`;export{$ as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import o,{getRegistry as r}from"@topthink/json-form";import*as a from"react";import{forwardRef as e,useState as n,useCallback as i}from"react";import s from"axios";import{b as l,r as m,B as p}from"./index-XkUorbN_.js";import{mapValues as c}from"lodash";import"sweetalert2/dist/sweetalert2.js";import"sweetalert2-react-content";import"react-bootstrap";import"query-string";import"retry-axios";import"rc-notification";import"styled-components";import"classnames";import"react-async-hook";const d=require("ajv-i18n/localize/zh"),u=a.lazy((()=>import("./editor-widget-CQ3zv-Xu.js"))),f=o=>t(a.Suspense,{fallback:null,children:t(u,{...o})}),y={upload:function(o){let{options:a,...e}=o;const{widgets:n}=r();return a.endpoint&&(a.onUpload=async t=>{const o=new FormData;o.set("file",t);const{url:r,value:e}=await m({url:a.endpoint,method:"post",data:o});return{url:r,value:e}}),t(n.upload,{...e,options:a})},editor:function(o){let{options:r,...a}=o;return r.endpoint&&(r.onUpload=async t=>{const o=new FormData;o.set("file",t);const{url:a}=await m({url:r.endpoint,method:"post",data:o});return a}),t(f,{...a,options:r})},typeahead:function(o){let{options:a,...e}=o;const{widgets:n}=r();return a.endpoint&&(a.onSearch=async t=>{let{value:o,query:r}=t;return await m({url:a.endpoint,params:{value:o,query:r}})}),t(n.typeahead,{...e,options:a})}},h=e(((r,a)=>{let{action:e,method:u="post",onSuccess:f,formData:h,onSubmitting:w,onSubmit:g,onChange:b,submitText:x="提交",transformData:v,children:D,...j}=r;const[S,k]=n(),[q,_]=l(!1),[z,E]=n(h),C=i((async(t,o)=>{if(!q)try{if(_(!0),w&&w(!0),e){let{formData:o}=t;v&&(o=v(o));try{const t=await m({url:e,method:u,data:o});return k(void 0),f&&await f(t),t}catch(t){if(!s.isAxiosError(t))throw t;k((t=>{const o=t.errors;return"string"==typeof o?{__errors:[o]}:c(o,(t=>({__errors:[t]})))})(t))}}else if(g)return await g(t,o)}finally{_(!1),w&&w(!1)}}),[e,u,g]),F=i((t=>{const{formData:o}=t;E(o),b&&b(t)}),[E,b]),N=i((t=>(t=t.map((t=>({keyword:t.name,dataPath:t.property,...t}))),d(t),t)),[]),U=t(p,{className:"px-4",loading:q,type:"submit",variant:"primary",children:x});return"function"==typeof D&&(D=D({submit:U,loading:q})),t(o,{ref:a,extraErrors:S,onSubmit:C,transformErrors:N,noHtml5Validate:!0,noValidate:!0,...j,formData:z,onChange:F,widgets:y,children:D||t("div",{className:"col-12",children:U})})}));export{h as default};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import e from"sweetalert2/dist/sweetalert2.js";import t from"sweetalert2-react-content";import{jsx as n,jsxs as r,Fragment as o}from"react/jsx-runtime";import{useRef as i,useState as a,useEffect as s,createContext as c,Fragment as l,useContext as d,useCallback as u,useMemo as f,forwardRef as h,Children as m,lazy as p,Suspense as g,createElement as y,useImperativeHandle as
|
|
1
|
+
import e from"sweetalert2/dist/sweetalert2.js";import t from"sweetalert2-react-content";import{jsx as n,jsxs as r,Fragment as o}from"react/jsx-runtime";import{useRef as i,useState as a,useEffect as s,createContext as c,Fragment as l,useContext as d,useCallback as u,useMemo as f,forwardRef as h,Children as m,lazy as p,Suspense as g,createElement as y,useImperativeHandle as x}from"react";import{OverlayTrigger as b,Tooltip as v,Spinner as w,Button as k,Modal as C,Alert as N,Card as z,Pagination as S}from"react-bootstrap";import{uniqueId as P,values as j,debounce as B}from"lodash";import T from"axios";import $ from"query-string";import*as E from"retry-axios";import L from"rc-notification";import F,{css as H}from"styled-components";import A from"classnames";import{useAsyncCallback as D}from"react-async-hook";const M=t(e),O={confirmButtonText:"确定",cancelButtonText:"取消"},I={confirm:async e=>{const{isConfirmed:t}=await M.fire({...O,icon:"warning",showCancelButton:!0,...e,async preConfirm(t){if(e.preConfirm)try{return await e.preConfirm(t)}catch(e){return e instanceof Error&&M.showValidationMessage(e.message),!1}return!0}});return t},success:e=>{M.fire({...O,toast:!0,position:"top",icon:"success",timer:2e3,showConfirmButton:!1,...e})},error:e=>{M.fire({...O,toast:!0,position:"top",icon:"error",timer:5e3,showConfirmButton:!1,...e})},close:e=>{M.close(e)},defaults:O};const U=c({});function R(e){return t=>{let{resolve:r,destroy:o,message:c}=t;const[l,h]=function(e){const t=i(null),[n,r]=a(e);return s((()=>{t.current&&(t.current(),t.current=null)}),[n]),[n,(e,n)=>{t.current="function"==typeof n?n:null,r(e)}]}(!0),m=d(U),p=u((e=>{h(!1,(()=>{r(e)}))}),[h,r]),g=f((()=>({show:l,onHide:()=>p(),onExited:()=>o(),container:m.container})),[l,p,o]);return n(e,{resolve:p,state:g,message:c})}}function _(e){return t=>new Promise((r=>{const o=n(e,{resolve:r,destroy:()=>{Y(o)},message:t});G(o)}))}let q=()=>{},V=new Set;const G=e=>{V=new Set(V),V.add(e),q(V)},Y=e=>{V=new Set(V),V.delete(e),q(V)};function J(e,t){return _(R(e))(t)}function K(e){let{tooltip:t,children:r,placement:o="bottom"}=e;return n(b,{placement:o,overlay:n(v,{id:P(),children:t}),children:r})}const Q=c(!1),W=h(((e,t)=>{let{loading:i,percent:a,disabled:s,children:c,tooltip:l,variant:u,...f}=e;d(Q)&&!u&&(u="link"),i&&(s=!0,c=r(o,{children:[n(w,{ref:t,as:"span",size:"sm",role:"status","aria-hidden":"true",animation:"border"}),a?r("span",{className:"ms-2",children:[a,"%"]}):null]}));const h=n(k,{ref:t,...f,variant:u,disabled:s,children:c});return l?n(K,{tooltip:l,children:n("span",{className:"d-inline-block",children:h})}):h})),X=function(e){let{state:t,message:{title:o,message:i,okText:a,cancelText:s},resolve:c}=e;return r(C,{centered:!0,...t,children:[n(C.Header,{children:n(C.Title,{as:"h5",children:o||"确认"})}),n(C.Body,{children:i}),r(C.Footer,{children:[n(W,{variant:"secondary",onClick:()=>c(),children:s||"取消"}),n(W,{onClick:()=>c(!0),children:a||"确定"})]})]})};const Z=e=>{let{header:t,children:i,footer:s,closable:c=!0,show:l,cancelText:d="取消",okText:u="确定",onOk:h,onCancel:m,onHide:p,okButtonProps:g,bodyAs:y,headerAs:x="h5",confirmLoading:b=!1,...v}=e;const[w,k]=a(!1),N=f((()=>n(W,{loading:w||b,variant:"primary",onClick:async e=>{k(!0);try{await(h?.(e)),e.defaultPrevented||p?.()}finally{k(!1)}},...g,children:u})),[g,u,h,p,w,b]),z=f((()=>n(W,{variant:"secondary",onClick:e=>{m?.(e),e.defaultPrevented||p?.()},children:d})),[m,p,d]);switch(typeof s){case"undefined":s=r(o,{children:[z,N]});break;case"function":s=s({okButton:N,cancelButton:z})}return r(C,{...v,onHide:p,show:l,children:[t&&n(C.Header,{closeButton:c,children:n(C.Title,{as:x,children:t})}),n(C.Body,{as:y,children:i}),s&&n(C.Footer,{children:s})]})};let ee;Z.Message=function(e){const[t,r]=a(V);return s((()=>{q=r}),[]),n(U.Provider,{value:e,children:Array.from(t).map(((e,t)=>n(l,{children:e},`message-${t}`)))})},Z.confirm=function(e){return _(R(X))(e)},Z.show=J;const te={};const ne=e=>{let{type:t,...r}=e;!function(e){if(ee)return e(ee);L.newInstance({...te,prefixCls:"notification",maxCount:5,style:{top:20,right:20}},(t=>{ee?e(ee):(ee=t,e(t))}))}((e=>{r.duration=3;let o=t;if("error"===t)o="danger",r.duration=r.closable?0:5;r.content=n(N,{variant:o,children:r.content}),e.notice(r)}))},re=["error","success","info"].reduce(((e,t)=>(e[t]=(e,n)=>{ne({...n,type:t,content:e})},e)),{});function oe(e){return e&&"object"==typeof e}re.defaults=te,E.attach(),T.defaults.raxConfig={retryDelay:2e3,backoffType:"static",shouldRetry:e=>{let{config:t,response:n}=e;return!(t.raxConfig?.retryDecider&&!t.raxConfig.retryDecider())&&("GET"===t.method?.toUpperCase()&&449===n?.status)}},T.defaults.maxContentLength=1/0,T.defaults.maxBodyLength=1/0,T.defaults.baseURL="/api",T.defaults.authTokenName="authorization",T.interceptors.request.use((e=>{const t=e.authTokenName;if(t){const n=localStorage.getItem(t);n&&(e.headers={Authorization:`Bearer ${n}`,...e.headers})}return e}),(e=>Promise.reject(e))),T.interceptors.response.use((e=>(201===e.status&&e.data.location&&(window.location.href=e.data.location,e.data=void 0),e)),(e=>{if(T.isAxiosError(e)&&e.response){const{data:t,status:n}=e.response;401===n?(e.errors="Unauthorized",re.error("Unauthorized")):oe(t)?422===n?e.errors=t:"message"in t&&(e.errors=t.message):e.errors=t}return Promise.reject(e)}));const ie=T.isAxiosError,ae=e=>{if(!T.isAxiosError(e))throw e;{let t=e.errors;"string"!=typeof e.errors&&(t=Object.values(e.errors).join("<br />")),re.error(t)}},se=async function(e){e="string"==typeof e?{url:e}:e;const{data:t}=await T.request({paramsSerializer:function(e){return $.stringify(e,{sort:!1,skipNull:!0,skipEmptyString:!0,arrayFormat:"bracket"})},...e});return t};se.defaults=T.defaults,se.interceptors=T.interceptors;const ce=()=>{const e=i(!1);return s((()=>(e.current=!1,()=>{e.current=!0})),[]),e};function le(e){const t=ce(),[n,r]=a(e);return[n,u((e=>{t.current||r(e)}),[])]}const de=function(e){let{state:t,message:r,resolve:o}=e;const a=i(!0),{result:c,checkUrl:l,onComplete:d}=r,[u,f]=le(!1);return s((()=>{se({url:l,method:"post",data:{order_no:c.order_no},raxConfig:{shouldRetry:e=>a.current&&449===e.response?.status}}).then((()=>{d?.(),o()})).catch((()=>null))}),[]),n(Z,{...t,centered:!0,onHide:()=>{a.current=!1,t.onHide()},backdrop:"static",header:"支付结果",okText:"已完成支付",okButtonProps:{loading:u},onOk:async e=>{e.preventDefault();try{f(!0),await se({url:l,method:"post",data:{order_no:c.order_no},raxConfig:{shouldRetry:()=>!1}}),d?.(),o()}catch{}finally{f(!1)}},cancelText:"取消",children:"请在新打开的页面上进行支付,支付完成后再关闭此窗口"})};function ue(e){const{result:t}=e;window.open(t.pay_url),J(de,e)}const fe=F.div`
|
|
2
2
|
padding: 48px 32px;
|
|
3
|
-
`,
|
|
3
|
+
`,he=F.div`
|
|
4
4
|
margin-bottom: 24px;
|
|
5
5
|
text-align: center;
|
|
6
6
|
font-size: 72px;
|
|
7
|
-
`,
|
|
7
|
+
`,me=F.div`
|
|
8
8
|
color: rgba(0, 0, 0, .85);
|
|
9
9
|
font-size: 24px;
|
|
10
10
|
line-height: 1.8;
|
|
11
11
|
text-align: center;
|
|
12
|
-
`,
|
|
12
|
+
`,pe=F.div`
|
|
13
13
|
margin-top: 32px;
|
|
14
14
|
text-align: center;
|
|
15
|
-
`,
|
|
15
|
+
`,ge={success:n("i",{className:"bi bi-check-circle-fill text-success"}),error:n("i",{className:"bi bi-exclamation-circle-fill text-danger"}),info:n("i",{className:"bi bi-info-circle-fill text-info"}),warning:n("i",{className:"bi bi-exclamation-triangle-fill text-warning"})};function ye(e){let{status:t,title:o,icon:i,extra:a}=e;return!i&&t&&(i=ge[t]),r(fe,{children:[i&&n(he,{children:i}),o&&n(me,{children:o}),a&&n(pe,{children:a})]})}F.div`
|
|
16
16
|
position: relative;
|
|
17
|
-
`;const
|
|
17
|
+
`;const xe=F.div`
|
|
18
18
|
display: ${e=>e.active?"flex":"none"};
|
|
19
19
|
position: absolute;
|
|
20
20
|
top: 0 !important;
|
|
@@ -36,10 +36,10 @@ import e from"sweetalert2/dist/sweetalert2.js";import t from"sweetalert2-react-c
|
|
|
36
36
|
user-select: none;
|
|
37
37
|
will-change: opacity;
|
|
38
38
|
z-index: 990;
|
|
39
|
-
`;function be(e){let{loading:t=!0,children:o,variant:i="primary",animation:a="border",wrap:s,...c}=e;return t?(o&&(o=n("p",{className:"mt-3 text-secondary",children:o})),o=r(
|
|
39
|
+
`;function be(e){let{loading:t=!0,children:o,variant:i="primary",animation:a="border",wrap:s,...c}=e;return t?(o&&(o=n("p",{className:"mt-3 text-secondary",children:o})),o=r(xe,{inverted:!0,active:!0,children:[n(w,{animation:a,variant:i,...c}),o]}),s?n(ve,{$height:"number"==typeof s?s:150,children:o}):o):null}const ve=F.div`
|
|
40
40
|
position: relative;
|
|
41
41
|
height: ${e=>`${e.$height}px`};
|
|
42
|
-
`;function
|
|
42
|
+
`;function we(e){let{children:t,title:i,className:a,...s}=e;return n(z,{className:A("border-0 shadow-sm mb-3",a),...s,children:r("div",{className:"card-body",children:[i&&r(o,{children:[n("h5",{children:i}),n("hr",{})]}),t]})})}function ke(e){let{errors:t}=e;return t?n(N,{variant:"danger",children:n("ul",{className:"mb-0",children:"string"==typeof t?n("li",{children:t}):Object.entries(t).map((e=>{let[t,r]=e;return n("li",{children:r},t)}))})}):null}function Ce(e){let{children:t,className:r,size:o="small",direction:i="horizontal"}=e;"string"==typeof o&&(o={small:8,middle:16,large:24}[o]);const a=m.map(t,(e=>{if(e)return n(ze,{children:e})}));return n(Ne,{className:r,$direction:i,$size:o,children:a})}const Ne=F.div`
|
|
43
43
|
display: inline-flex;
|
|
44
44
|
align-items: center;
|
|
45
45
|
gap: ${e=>e.$size}px;
|
|
@@ -49,19 +49,18 @@ import e from"sweetalert2/dist/sweetalert2.js";import t from"sweetalert2-react-c
|
|
|
49
49
|
flex-direction: column;
|
|
50
50
|
align-items: inherit;
|
|
51
51
|
`}
|
|
52
|
-
`,
|
|
52
|
+
`,ze=F.div`
|
|
53
53
|
|
|
54
|
-
`,
|
|
54
|
+
`,Se=p((()=>import("./steps-b_BcYIwk.js"))),Pe=p((()=>import("./steps-b_BcYIwk.js").then((e=>{let{Step:t}=e;return{default:t}}))));function je(e){return n(g,{fallback:null,children:n(Se,{...e})})}const Be=function(e){return n(g,{fallback:null,children:n(Pe,{...e})})};function Te(e){let{title:t,content:o,footer:i}=e;return r(we,{children:[n(Le,{children:t}),n(Ee,{children:o}),i&&n($e,{children:i})]})}je.Step=Be;const $e=F.div`
|
|
55
55
|
margin-top: 9px;
|
|
56
56
|
padding-top: 10px;
|
|
57
57
|
border-top: 1px solid #f0f0f0;
|
|
58
58
|
color: rgba(0, 0, 0, .65);
|
|
59
|
-
|
|
59
|
+
`,Ee=F.div`
|
|
60
60
|
color: rgba(0, 0, 0, .85);
|
|
61
61
|
font-size: 24px;
|
|
62
|
-
`,
|
|
62
|
+
`,Le=F.div`
|
|
63
63
|
margin-bottom: 4px;
|
|
64
64
|
color: rgba(0, 0, 0, .45);
|
|
65
65
|
font-size: 1.1rem;
|
|
66
|
-
`;function
|
|
67
|
-
//# sourceMappingURL=index-6ae8237d.js.map
|
|
66
|
+
`;function Fe(){}function He(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}function Ae(e){let{total:t=0,onChange:r=Fe,defaultCurrent:o=1,defaultPageSize:i=10,className:c,...l}=e;const[d,h]=a(o),[m,p]=a(i);s((()=>{He(l.current)&&h(l.current)}),[l.current]),s((()=>{He(l.pageSize)&&p(l.pageSize)}),[l.pageSize]);const g=f((()=>Math.floor((t-1)/m)+1),[t,m]),y=u((e=>()=>{e!==d&&(h(e),r(e,m))}),[r,d,m]),x=d-1>0?d-1:0,b=d+1<g?d+1:g,v=[];let w=null,k=null,C=null,N=null;if(g<=7)for(let e=1;e<=g;e+=1){const t=d===e;v.push(n(S.Item,{active:t,onClick:y(e),children:e},e))}else{N=n(S.Last,{onClick:y(g)},"last"),C=n(S.First,{onClick:y(1)},"first"),w=n(S.Prev,{onClick:y(x)},"prev"),k=n(S.Next,{onClick:y(b)},"next");let e=Math.max(1,d-2),t=Math.min(d+2,g);d-1<=2&&(t=5),g-d<=2&&(e=g-4);for(let r=e;r<=t;r+=1){const e=d===r;v.push(n(S.Item,{active:e,onClick:y(r),children:r},r))}d-1>=4&&3!==d&&v.unshift(w),g-d>=4&&d!==g-2&&v.push(k),1!==e&&v.unshift(C),t!==g&&v.push(N)}return n(S,{className:c,children:v})}function De(e){let{className:t,value:r,locale:i="zh-CN",currency:a=!0,options:s={}}=e;const c=f((()=>{let e;return e=a?{style:"currency",currency:"CNY"}:{minimumFractionDigits:2},new Intl.NumberFormat(i,{...e,...s})}),[a,i,s]);return t?n("span",{className:t,children:c.format(r)}):n(o,{children:c.format(r)})}function Me(e){let{loading:t,disabled:r,children:o,...i}=e;return n(k,{...i,disabled:t||r,children:t?"Loading…":o})}const Oe=p((()=>import("./image-zoom-OrIPGqh0.js")));function Ie(e){return n(g,{fallback:null,children:n(Oe,{...e})})}function Ue(e){let{url:t,method:n,confirm:r,onSuccess:o,children:i,disabled:a,as:s=W,...c}=e;const[l,d]=le(!1),f=u((async e=>{e.preventDefault();try{if(d(!0),r&&!await Z.confirm({message:r}))return;const e="string"==typeof t?{url:t,method:n}:{method:n,...t},i=await se(e);o&&o(i)}catch(e){ae(e)}finally{d(!1)}}),[t,n,d]);return y(s,{...c,disabled:a||l,onClick:f},i)}const Re=p((()=>import("./index-PvFKqXZL.js"))),_e=h(((e,t)=>n(g,{fallback:null,children:n(Re,{...e,ref:t})}))),qe=p((()=>import("./index-PGfJO0Bp.js"))),Ve=h(((e,t)=>n(g,{fallback:null,children:n(qe,{...e,ref:t})})));let Ge=0;function Ye(){let{onHide:e,onShow:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[n,r]=a(!1),[o,i]=a(`visible-${Ge}`),s=u((()=>{r(!1),e&&e()}),[r,e]),c=u((()=>{i("visible-"+ ++Ge)}),[i,Ge]);return{visible:n,show:u((()=>{r(!0),t&&t()}),[r,t]),hide:s,state:{show:n,onHide:s,onExited:c,key:o}}}const Je=h(((e,t)=>{let{text:i,onOk:a,modalProps:s,children:c,onShow:l,confirmLoading:d,as:u=W,...f}=e;const{state:h,show:m,hide:p}=Ye({onShow:l});x(t,(()=>({close:p})));const g=y(u,{...f,onClick:m},i);return r(o,{children:[g,n(Z,{header:i,...s,...h,confirmLoading:d,onOk:async e=>{if(a){!1===await a()&&e.preventDefault()}},children:c})]})}));function Ke(e){let{text:t,onSuccess:o,buttonProps:s,modalProps:c,children:l,...d}=e;const[f,h]=a(!1),m=i(null),p=i(null),g=u((()=>(p.current?.submit(),!1)),[]),y=u((e=>{o&&o(e),m.current?.close()}),[o]);return n(Je,{ref:m,text:t,...s,modalProps:c,onOk:g,confirmLoading:f,children:r(_e,{...d,onSubmitting:h,ref:p,onSuccess:y,children:[l,n("input",{type:"submit",hidden:!0})]})})}function Qe(e){let{manual:t,refreshDeps:n,...r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{execute:o,currentParams:i,error:a,...c}=D((async t=>(e="string"==typeof e?{url:e}:e,await se({...e,...t}))),r);s((()=>{if(!t&&!n)try{o()}catch{}}),[]),s((()=>{n&&l()}),n);const l=u((async()=>{try{i?await o(...i):await o()}catch{}}),[o,i]);if(a&&ie(a)){const e=a.errors;a=new Error("string"==typeof e?e:j(e).join(""))}return{refresh:l,execute:o,error:a,...c}}function We(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=i(e);return s((()=>{n.current=e})),u((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.current?.(...t)}),t)}function Xe(e){const{value:t,defaultValue:n,onChange:r,shouldUpdate:o=((e,t)=>e!==t)}=e,i=We(r),s=We(o),[c,l]=a(n),d=void 0!==t,u=d?t:c,f=We((e=>{const t="function"==typeof e?e(u):e;s(u,t)&&(d||l(t),i(t))}),[d,i,u,s]);return[u,f]}function Ze(e,t,n){const r=i(e),o=i(B(e,t,n));return s((()=>{r.current=e})),s((()=>{o.current=B((function(){r.current(...arguments)}),t,n)}),[t,n]),o.current}export{W as B,we as C,ke as E,_e as F,Ie as I,be as L,I as M,De as N,Ae as P,ye as R,Ce as S,Q as T,Xe as a,le as b,re as c,je as d,Be as e,Te as f,Me as g,Ue as h,oe as i,Ve as j,Ke as k,Je as l,Z as m,K as n,Qe as o,Ye as p,ie as q,se as r,ae as s,Ze as u,ue as w};
|
package/es/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export{B as Button,C as Card,E as Error,F as Form,I as ImageZoom,L as Loader,g as LoadingButton,M as Message,m as Modal,l as ModalButton,k as ModalForm,N as NumberFormat,P as Pagination,h as RequestButton,R as Result,S as Space,f as Statistic,e as Step,d as Steps,j as Table,c as Toast,n as Tooltip,i as isRecord,q as isRequestError,r as request,s as showRequestError,
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export{B as Button,C as Card,E as Error,F as Form,I as ImageZoom,L as Loader,g as LoadingButton,M as Message,m as Modal,l as ModalButton,k as ModalForm,N as NumberFormat,P as Pagination,h as RequestButton,R as Result,S as Space,f as Statistic,e as Step,d as Steps,j as Table,c as Toast,n as Tooltip,i as isRecord,q as isRequestError,r as request,s as showRequestError,a as useControllableState,u as useDebounce,p as useOverlayState,o as useRequest,b as useSafeState,w as waitPayComplete}from"./index-XkUorbN_.js";export{StyleSheetManager,ThemeProvider,createGlobalStyle,css,keyframes,default as styled}from"styled-components";export{useAsync,useAsyncCallback}from"react-async-hook";import"sweetalert2/dist/sweetalert2.js";import"sweetalert2-react-content";import"react/jsx-runtime";import"react";import"react-bootstrap";import"lodash";import"axios";import"query-string";import"retry-axios";import"rc-notification";import"classnames";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as r,Fragment as t}from"react/jsx-runtime";import e,{Step as s}from"rc-steps";export{Step}from"rc-steps";import"rc-steps/assets/index.css";import o from"styled-components";import*as c from"react";var i;function n(){return n=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},n.apply(this,arguments)}const p=r=>c.createElement("svg",n({
|
|
1
|
+
import{jsx as r,Fragment as t}from"react/jsx-runtime";import e,{Step as s}from"rc-steps";export{Step}from"rc-steps";import"rc-steps/assets/index.css";import o from"styled-components";import*as c from"react";var i;function n(){return n=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},n.apply(this,arguments)}const p=r=>c.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"currentColor",viewBox:"0 0 1024 1024"},r),i||(i=c.createElement("path",{d:"M887.904 298.208c-12.864-12.064-33.152-11.488-45.216 1.408L415.936 753.984l-233.12-229.696c-12.608-12.416-32.864-12.288-45.28.32-12.416 12.576-12.256 32.864.352 45.248l256.48 252.672c.096.096.224.128.32.224s.128.224.224.32c2.016 1.92 4.448 3.008 6.784 4.288 1.152.672 2.144 1.664 3.36 2.144 3.776 1.472 7.776 2.24 11.744 2.24 4.192 0 8.384-.832 12.288-2.496 1.312-.544 2.336-1.664 3.552-2.368 2.4-1.408 4.896-2.592 6.944-4.672.096-.096.128-.256.224-.352.064-.096.192-.128.288-.224L889.28 343.424c12.16-12.832 11.488-33.088-1.376-45.216"})));function a(e){return r(m,{icons:{finish:r(p,{}),error:r(t,{})},...e})}a.Step=s;const m=o(e)`
|
|
2
2
|
.rc-steps-item-icon {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
align-items: center;
|
|
@@ -31,4 +31,3 @@ import{jsx as r,Fragment as t}from"react/jsx-runtime";import e,{Step as s}from"r
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
`;export{a as default};
|
|
34
|
-
//# sourceMappingURL=steps-afba29a7.js.map
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topthink/components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.59",
|
|
4
4
|
"scripts": {
|
|
5
|
-
"prebuild": "rimraf
|
|
5
|
+
"prebuild": "rimraf es types",
|
|
6
6
|
"build": "rollup -c --environment NODE_ENV:production",
|
|
7
7
|
"build:dev": "rollup -c",
|
|
8
8
|
"watch": "rollup -c -w",
|
|
@@ -17,8 +17,10 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@babel/runtime": "^7.11.2",
|
|
20
|
+
"@toast-ui/editor": "^3.2.2",
|
|
21
|
+
"@toast-ui/react-editor": "^3.2.3",
|
|
20
22
|
"@topthink/bootstrap": "^1.0.23",
|
|
21
|
-
"@topthink/json-form": "^1.0.
|
|
23
|
+
"@topthink/json-form": "^1.0.47",
|
|
22
24
|
"@types/styled-components": "^5.1.11",
|
|
23
25
|
"ajv-i18n": "^4.0.0",
|
|
24
26
|
"axios": "^0.27.2",
|
|
@@ -37,30 +39,30 @@
|
|
|
37
39
|
},
|
|
38
40
|
"peerDependencies": {
|
|
39
41
|
"lodash": "*",
|
|
40
|
-
"react": "^17",
|
|
42
|
+
"react": "^17||^18",
|
|
41
43
|
"react-bootstrap": "^2.1.2",
|
|
42
|
-
"react-dom": "^17"
|
|
44
|
+
"react-dom": "^17||^18"
|
|
43
45
|
},
|
|
44
46
|
"devDependencies": {
|
|
45
|
-
"@babel/core": "^7.
|
|
46
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
47
|
-
"@babel/preset-env": "^7.
|
|
48
|
-
"@rollup/plugin-babel": "^
|
|
49
|
-
"@rollup/plugin-commonjs": "^
|
|
50
|
-
"@rollup/plugin-image": "^
|
|
51
|
-
"@rollup/plugin-node-resolve": "^
|
|
52
|
-
"@
|
|
47
|
+
"@babel/core": "^7.23.6",
|
|
48
|
+
"@babel/plugin-transform-runtime": "^7.23.6",
|
|
49
|
+
"@babel/preset-env": "^7.23.6",
|
|
50
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
51
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
52
|
+
"@rollup/plugin-image": "^3.0.3",
|
|
53
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
54
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
55
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
56
|
+
"@svgr/rollup": "^8.1.0",
|
|
53
57
|
"@types/lodash": "^4.14.161",
|
|
54
58
|
"@types/node": "^18.11.18",
|
|
55
59
|
"@types/react": "^17.0.0",
|
|
56
60
|
"@types/react-dom": "^17.0.0",
|
|
57
61
|
"react-bootstrap": "^2.1.2",
|
|
58
|
-
"rollup": "^
|
|
59
|
-
"
|
|
60
|
-
"rollup-plugin-typescript2": "^0.34.1",
|
|
61
|
-
"typescript": "^4.0.2"
|
|
62
|
+
"rollup": "^4.8.0",
|
|
63
|
+
"typescript": "^5.3.3"
|
|
62
64
|
},
|
|
63
65
|
"author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
|
|
64
66
|
"license": "MIT",
|
|
65
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "f0d2f7e478460ba5e311185077fc76daede085fd"
|
|
66
68
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { ButtonProps as BsButtonProps } from 'react-bootstrap';
|
|
3
|
-
export interface ButtonProps extends BsButtonProps {
|
|
4
|
-
loading?: boolean;
|
|
5
|
-
percent?: number;
|
|
6
|
-
tooltip?: string;
|
|
7
|
-
}
|
|
8
|
-
declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<any>>;
|
|
9
|
-
export default Button;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ButtonProps as BsButtonProps } from 'react-bootstrap';
|
|
3
|
+
export interface ButtonProps extends BsButtonProps {
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
percent?: number;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<any>>;
|
|
9
|
+
export default Button;
|