@faasjs/ant-design 0.0.3-beta.23 → 0.0.3-beta.25
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 +111 -2
- package/dist/index.d.ts +23 -1
- package/dist/index.js +184 -137
- package/dist/index.mjs +215 -166
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -30,11 +30,15 @@ __export(src_exports, {
|
|
|
30
30
|
ConfigContext: () => ConfigContext,
|
|
31
31
|
ConfigProvider: () => ConfigProvider,
|
|
32
32
|
Description: () => Description,
|
|
33
|
-
Drawer: () =>
|
|
33
|
+
Drawer: () => import_antd5.Drawer,
|
|
34
|
+
FaasDataInjection: () => import_react3.FaasDataInjection,
|
|
35
|
+
FaasDataWrapper: () => FaasDataWrapper,
|
|
36
|
+
FaasDataWrapperProps: () => import_react3.FaasDataWrapperProps,
|
|
34
37
|
Form: () => Form,
|
|
35
38
|
FormItem: () => FormItem,
|
|
36
39
|
Link: () => Link,
|
|
37
|
-
|
|
40
|
+
Loading: () => Loading,
|
|
41
|
+
Modal: () => import_antd9.Modal,
|
|
38
42
|
PageNotFound: () => PageNotFound,
|
|
39
43
|
Routes: () => Routes,
|
|
40
44
|
Table: () => Table,
|
|
@@ -161,15 +165,49 @@ function transferValue(type, value) {
|
|
|
161
165
|
|
|
162
166
|
// src/Description.tsx
|
|
163
167
|
var import_icons = require("@ant-design/icons");
|
|
164
|
-
var
|
|
168
|
+
var import_antd4 = require("antd");
|
|
165
169
|
var import_lodash_es4 = require("lodash-es");
|
|
166
|
-
var
|
|
167
|
-
|
|
170
|
+
var import_react4 = require("react");
|
|
171
|
+
|
|
172
|
+
// src/FaasDataWrapper.tsx
|
|
173
|
+
var import_react3 = require("@faasjs/react");
|
|
174
|
+
|
|
175
|
+
// src/Loading.tsx
|
|
176
|
+
var import_antd2 = require("antd");
|
|
177
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
178
|
+
function Loading(props) {
|
|
179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
180
|
+
style: {
|
|
181
|
+
...props.style || {},
|
|
182
|
+
...!props.size || props.size === "large" ? {
|
|
183
|
+
margin: "20vh auto",
|
|
184
|
+
textAlign: "center"
|
|
185
|
+
} : {}
|
|
186
|
+
},
|
|
187
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Spin, {
|
|
188
|
+
size: props.size || "large"
|
|
189
|
+
})
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// src/FaasDataWrapper.tsx
|
|
194
|
+
var import_antd3 = require("antd");
|
|
195
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
196
|
+
function FaasDataWrapper(props) {
|
|
197
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Alert.ErrorBoundary, {
|
|
198
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react3.FaasDataWrapper, {
|
|
199
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {}),
|
|
200
|
+
...props
|
|
201
|
+
})
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// src/Description.tsx
|
|
168
206
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
169
207
|
function DescriptionItemContent(props) {
|
|
170
208
|
var _a;
|
|
171
|
-
const [computedProps, setComputedProps] = (0,
|
|
172
|
-
(0,
|
|
209
|
+
const [computedProps, setComputedProps] = (0, import_react4.useState)();
|
|
210
|
+
(0, import_react4.useEffect)(() => {
|
|
173
211
|
var _a2, _b;
|
|
174
212
|
const propsCopy = { ...props };
|
|
175
213
|
if (!propsCopy.item.title)
|
|
@@ -199,7 +237,7 @@ function DescriptionItemContent(props) {
|
|
|
199
237
|
return null;
|
|
200
238
|
if (computedProps.extendTypes && computedProps.extendTypes[computedProps.item.type])
|
|
201
239
|
if (computedProps.extendTypes[computedProps.item.type].children)
|
|
202
|
-
return (0,
|
|
240
|
+
return (0, import_react4.cloneElement)(
|
|
203
241
|
computedProps.extendTypes[computedProps.item.type].children,
|
|
204
242
|
{
|
|
205
243
|
value: computedProps.value,
|
|
@@ -213,7 +251,7 @@ function DescriptionItemContent(props) {
|
|
|
213
251
|
else
|
|
214
252
|
throw Error(computedProps.item.type + " requires children or render");
|
|
215
253
|
if (computedProps.item.children)
|
|
216
|
-
return (0,
|
|
254
|
+
return (0, import_react4.cloneElement)(computedProps.item.children, {
|
|
217
255
|
value: computedProps.value,
|
|
218
256
|
values: computedProps.values
|
|
219
257
|
});
|
|
@@ -265,7 +303,7 @@ function DescriptionItemContent(props) {
|
|
|
265
303
|
case "object[]":
|
|
266
304
|
if (!((_a = computedProps.value) == null ? void 0 : _a.length))
|
|
267
305
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {});
|
|
268
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Space, {
|
|
269
307
|
direction: "vertical",
|
|
270
308
|
children: computedProps.value.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
|
|
271
309
|
items: computedProps.item.object,
|
|
@@ -279,11 +317,11 @@ function DescriptionItemContent(props) {
|
|
|
279
317
|
}
|
|
280
318
|
function Description(props) {
|
|
281
319
|
if (!props.faasData)
|
|
282
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Descriptions, {
|
|
283
321
|
...props,
|
|
284
322
|
title: (0, import_lodash_es4.isFunction)(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
|
|
285
323
|
children: props.items.map((item) => {
|
|
286
|
-
return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
324
|
+
return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Descriptions.Item, {
|
|
287
325
|
label: item.title || (0, import_lodash_es4.upperFirst)(item.id),
|
|
288
326
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
|
|
289
327
|
item,
|
|
@@ -294,16 +332,16 @@ function Description(props) {
|
|
|
294
332
|
}, item.id) : null;
|
|
295
333
|
}).filter(Boolean)
|
|
296
334
|
});
|
|
297
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
298
|
-
fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FaasDataWrapper, {
|
|
336
|
+
fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Skeleton, {
|
|
299
337
|
active: true
|
|
300
338
|
}),
|
|
301
339
|
render: ({ data }) => {
|
|
302
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Descriptions, {
|
|
303
341
|
...props,
|
|
304
342
|
title: (0, import_lodash_es4.isFunction)(props.renderTitle) ? props.renderTitle(data) : props.title,
|
|
305
343
|
children: props.items.map((item) => {
|
|
306
|
-
return !item.if || item.if(data) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
344
|
+
return !item.if || item.if(data) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Descriptions.Item, {
|
|
307
345
|
label: item.title || (0, import_lodash_es4.upperFirst)(item.id),
|
|
308
346
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
|
|
309
347
|
item,
|
|
@@ -320,7 +358,7 @@ function Description(props) {
|
|
|
320
358
|
}
|
|
321
359
|
|
|
322
360
|
// src/Drawer.tsx
|
|
323
|
-
var
|
|
361
|
+
var import_antd5 = require("antd");
|
|
324
362
|
var import_react5 = require("react");
|
|
325
363
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
326
364
|
function useDrawer(init) {
|
|
@@ -333,7 +371,7 @@ function useDrawer(init) {
|
|
|
333
371
|
...init
|
|
334
372
|
});
|
|
335
373
|
return {
|
|
336
|
-
drawer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
374
|
+
drawer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Drawer, {
|
|
337
375
|
...props
|
|
338
376
|
}),
|
|
339
377
|
drawerProps: props,
|
|
@@ -348,11 +386,11 @@ function useDrawer(init) {
|
|
|
348
386
|
|
|
349
387
|
// src/Form.tsx
|
|
350
388
|
var import_react7 = require("@faasjs/react");
|
|
351
|
-
var
|
|
389
|
+
var import_antd7 = require("antd");
|
|
352
390
|
var import_react8 = require("react");
|
|
353
391
|
|
|
354
392
|
// src/FormItem.tsx
|
|
355
|
-
var
|
|
393
|
+
var import_antd6 = require("antd");
|
|
356
394
|
var import_icons2 = require("@ant-design/icons");
|
|
357
395
|
var import_react6 = require("react");
|
|
358
396
|
var import_lodash_es5 = require("lodash-es");
|
|
@@ -433,49 +471,49 @@ function FormItem(props) {
|
|
|
433
471
|
if (!computedProps)
|
|
434
472
|
return null;
|
|
435
473
|
if (hidden)
|
|
436
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
437
475
|
...computedProps,
|
|
438
476
|
noStyle: true,
|
|
439
477
|
rules: [],
|
|
440
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
478
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Input, {
|
|
441
479
|
hidden: true
|
|
442
480
|
})
|
|
443
481
|
});
|
|
444
482
|
if (extendTypes && extendTypes[computedProps.type])
|
|
445
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
446
484
|
...computedProps,
|
|
447
485
|
children: extendTypes[computedProps.type].children
|
|
448
486
|
});
|
|
449
487
|
if (computedProps.children)
|
|
450
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
451
489
|
...computedProps,
|
|
452
490
|
children: computedProps.children
|
|
453
491
|
});
|
|
454
492
|
if (computedProps.render)
|
|
455
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
456
494
|
...computedProps,
|
|
457
495
|
children: computedProps.render()
|
|
458
496
|
});
|
|
459
497
|
switch (computedProps.type) {
|
|
460
498
|
case "string":
|
|
461
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
462
500
|
...computedProps,
|
|
463
|
-
children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
501
|
+
children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Select, {
|
|
464
502
|
...computedProps.input
|
|
465
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
503
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Input, {
|
|
466
504
|
...computedProps.input
|
|
467
505
|
})
|
|
468
506
|
});
|
|
469
507
|
case "string[]":
|
|
470
508
|
if (computedProps.options)
|
|
471
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
509
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
472
510
|
...computedProps,
|
|
473
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
511
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Select, {
|
|
474
512
|
mode: "multiple",
|
|
475
513
|
...computedProps.input
|
|
476
514
|
})
|
|
477
515
|
});
|
|
478
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
516
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.List, {
|
|
479
517
|
name: computedProps.name,
|
|
480
518
|
rules: computedProps.rules,
|
|
481
519
|
children: (fields, { add, remove }, { errors }) => {
|
|
@@ -491,24 +529,24 @@ function FormItem(props) {
|
|
|
491
529
|
}),
|
|
492
530
|
fields.map((field) => {
|
|
493
531
|
var _a3;
|
|
494
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
495
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
532
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
533
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Row, {
|
|
496
534
|
gutter: 24,
|
|
497
535
|
style: { flexFlow: "row nowrap" },
|
|
498
536
|
children: [
|
|
499
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
537
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Col, {
|
|
500
538
|
span: 23,
|
|
501
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
539
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
502
540
|
...field,
|
|
503
541
|
noStyle: true,
|
|
504
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
542
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Input, {
|
|
505
543
|
...computedProps.input
|
|
506
544
|
})
|
|
507
545
|
})
|
|
508
546
|
}),
|
|
509
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
547
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Col, {
|
|
510
548
|
span: 1,
|
|
511
|
-
children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
549
|
+
children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
|
|
512
550
|
danger: true,
|
|
513
551
|
type: "link",
|
|
514
552
|
style: { float: "right" },
|
|
@@ -520,15 +558,15 @@ function FormItem(props) {
|
|
|
520
558
|
})
|
|
521
559
|
}, field.key);
|
|
522
560
|
}),
|
|
523
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
561
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Form.Item, {
|
|
524
562
|
children: [
|
|
525
|
-
!((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
563
|
+
!((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
|
|
526
564
|
type: "dashed",
|
|
527
565
|
block: true,
|
|
528
566
|
onClick: () => add(),
|
|
529
567
|
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
|
|
530
568
|
}),
|
|
531
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
569
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.ErrorList, {
|
|
532
570
|
errors
|
|
533
571
|
})
|
|
534
572
|
]
|
|
@@ -538,25 +576,25 @@ function FormItem(props) {
|
|
|
538
576
|
}
|
|
539
577
|
});
|
|
540
578
|
case "number":
|
|
541
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
542
580
|
...computedProps,
|
|
543
|
-
children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
581
|
+
children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Select, {
|
|
544
582
|
...computedProps.input
|
|
545
|
-
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
583
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.InputNumber, {
|
|
546
584
|
style: { width: "100%" },
|
|
547
585
|
...computedProps.input
|
|
548
586
|
})
|
|
549
587
|
});
|
|
550
588
|
case "number[]":
|
|
551
589
|
if (computedProps.options)
|
|
552
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
553
591
|
...computedProps,
|
|
554
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
592
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Select, {
|
|
555
593
|
mode: "multiple",
|
|
556
594
|
...computedProps.input
|
|
557
595
|
})
|
|
558
596
|
});
|
|
559
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
597
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.List, {
|
|
560
598
|
name: computedProps.name,
|
|
561
599
|
rules: computedProps.rules,
|
|
562
600
|
children: (fields, { add, remove }, { errors }) => {
|
|
@@ -572,25 +610,25 @@ function FormItem(props) {
|
|
|
572
610
|
}),
|
|
573
611
|
fields.map((field) => {
|
|
574
612
|
var _a3;
|
|
575
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
576
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
614
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Row, {
|
|
577
615
|
gutter: 24,
|
|
578
616
|
style: { flexFlow: "row nowrap" },
|
|
579
617
|
children: [
|
|
580
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
618
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Col, {
|
|
581
619
|
span: 23,
|
|
582
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
620
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
583
621
|
...field,
|
|
584
622
|
noStyle: true,
|
|
585
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
623
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.InputNumber, {
|
|
586
624
|
style: { width: "100%" },
|
|
587
625
|
...computedProps.input
|
|
588
626
|
})
|
|
589
627
|
})
|
|
590
628
|
}),
|
|
591
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
629
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Col, {
|
|
592
630
|
span: 1,
|
|
593
|
-
children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
631
|
+
children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
|
|
594
632
|
danger: true,
|
|
595
633
|
type: "link",
|
|
596
634
|
style: { float: "right" },
|
|
@@ -602,15 +640,15 @@ function FormItem(props) {
|
|
|
602
640
|
})
|
|
603
641
|
}, field.key);
|
|
604
642
|
}),
|
|
605
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
643
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Form.Item, {
|
|
606
644
|
children: [
|
|
607
|
-
!((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
645
|
+
!((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
|
|
608
646
|
type: "dashed",
|
|
609
647
|
block: true,
|
|
610
648
|
onClick: () => add(),
|
|
611
649
|
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
|
|
612
650
|
}),
|
|
613
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
651
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.ErrorList, {
|
|
614
652
|
errors
|
|
615
653
|
})
|
|
616
654
|
]
|
|
@@ -620,23 +658,23 @@ function FormItem(props) {
|
|
|
620
658
|
}
|
|
621
659
|
});
|
|
622
660
|
case "boolean":
|
|
623
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
661
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
624
662
|
...computedProps,
|
|
625
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
663
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Switch, {
|
|
626
664
|
...computedProps.input
|
|
627
665
|
})
|
|
628
666
|
});
|
|
629
667
|
case "date":
|
|
630
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
668
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
631
669
|
...computedProps,
|
|
632
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
670
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.DatePicker, {
|
|
633
671
|
...computedProps.input
|
|
634
672
|
})
|
|
635
673
|
});
|
|
636
674
|
case "time":
|
|
637
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
675
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.Item, {
|
|
638
676
|
...computedProps,
|
|
639
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
677
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.TimePicker, {
|
|
640
678
|
...computedProps.input
|
|
641
679
|
})
|
|
642
680
|
});
|
|
@@ -656,12 +694,12 @@ function FormItem(props) {
|
|
|
656
694
|
]
|
|
657
695
|
});
|
|
658
696
|
case "object[]":
|
|
659
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.List, {
|
|
660
698
|
name: computedProps.name,
|
|
661
699
|
rules: computedProps.rules,
|
|
662
700
|
children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
663
701
|
children: [
|
|
664
|
-
fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
702
|
+
fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Form.Item, {
|
|
665
703
|
style: { marginBottom: 0 },
|
|
666
704
|
children: [
|
|
667
705
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
@@ -671,7 +709,7 @@ function FormItem(props) {
|
|
|
671
709
|
computedProps.label,
|
|
672
710
|
" ",
|
|
673
711
|
field.name + 1,
|
|
674
|
-
!computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
712
|
+
!computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
|
|
675
713
|
danger: true,
|
|
676
714
|
type: "link",
|
|
677
715
|
onClick: () => remove(field.name),
|
|
@@ -680,9 +718,9 @@ function FormItem(props) {
|
|
|
680
718
|
]
|
|
681
719
|
})
|
|
682
720
|
}),
|
|
683
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
721
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Row, {
|
|
684
722
|
gutter: 24,
|
|
685
|
-
children: computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
723
|
+
children: computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Col, {
|
|
686
724
|
span: o.col || 24,
|
|
687
725
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItem, {
|
|
688
726
|
...o,
|
|
@@ -692,9 +730,9 @@ function FormItem(props) {
|
|
|
692
730
|
})
|
|
693
731
|
]
|
|
694
732
|
}, field.key)),
|
|
695
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
733
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Form.Item, {
|
|
696
734
|
children: [
|
|
697
|
-
!computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
735
|
+
!computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Button, {
|
|
698
736
|
type: "dashed",
|
|
699
737
|
block: true,
|
|
700
738
|
onClick: () => add(),
|
|
@@ -705,7 +743,7 @@ function FormItem(props) {
|
|
|
705
743
|
computedProps.label
|
|
706
744
|
]
|
|
707
745
|
}),
|
|
708
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
746
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Form.ErrorList, {
|
|
709
747
|
errors
|
|
710
748
|
})
|
|
711
749
|
]
|
|
@@ -726,7 +764,7 @@ function Form(props) {
|
|
|
726
764
|
const [computedProps, setComputedProps] = (0, import_react8.useState)();
|
|
727
765
|
const config = useConfigContext();
|
|
728
766
|
const [extendTypes, setExtendTypes] = (0, import_react8.useState)();
|
|
729
|
-
const [form] =
|
|
767
|
+
const [form] = import_antd7.Form.useForm(props.form);
|
|
730
768
|
const [initialValues, setInitialValues] = (0, import_react8.useState)(props.initialValues);
|
|
731
769
|
(0, import_react8.useEffect)(() => {
|
|
732
770
|
var _a2, _b2;
|
|
@@ -805,7 +843,7 @@ function Form(props) {
|
|
|
805
843
|
}, [computedProps]);
|
|
806
844
|
if (!computedProps)
|
|
807
845
|
return null;
|
|
808
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd7.Form, {
|
|
809
847
|
...computedProps,
|
|
810
848
|
onValuesChange,
|
|
811
849
|
children: [
|
|
@@ -815,7 +853,7 @@ function Form(props) {
|
|
|
815
853
|
extendTypes
|
|
816
854
|
}, item.id)),
|
|
817
855
|
computedProps.children,
|
|
818
|
-
computedProps.submit !== false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
856
|
+
computedProps.submit !== false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Button, {
|
|
819
857
|
htmlType: "submit",
|
|
820
858
|
type: "primary",
|
|
821
859
|
loading,
|
|
@@ -825,11 +863,11 @@ function Form(props) {
|
|
|
825
863
|
]
|
|
826
864
|
});
|
|
827
865
|
}
|
|
828
|
-
Form.useForm =
|
|
866
|
+
Form.useForm = import_antd7.Form.useForm;
|
|
829
867
|
|
|
830
868
|
// src/Link.tsx
|
|
831
869
|
var import_react_router_dom = require("react-router-dom");
|
|
832
|
-
var
|
|
870
|
+
var import_antd8 = require("antd");
|
|
833
871
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
834
872
|
function Link({
|
|
835
873
|
href,
|
|
@@ -843,7 +881,7 @@ function Link({
|
|
|
843
881
|
style = Object.assign({ cursor: "pointer" }, style);
|
|
844
882
|
if (href.startsWith("http")) {
|
|
845
883
|
if (button)
|
|
846
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
|
|
847
885
|
...button,
|
|
848
886
|
target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
|
|
849
887
|
style: {
|
|
@@ -867,7 +905,7 @@ function Link({
|
|
|
867
905
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Link, {
|
|
868
906
|
to: href,
|
|
869
907
|
target: target || (Link2 == null ? void 0 : Link2.target),
|
|
870
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
908
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
|
|
871
909
|
...button,
|
|
872
910
|
style: {
|
|
873
911
|
...Link2.style,
|
|
@@ -888,7 +926,7 @@ function Link({
|
|
|
888
926
|
}
|
|
889
927
|
|
|
890
928
|
// src/Modal.tsx
|
|
891
|
-
var
|
|
929
|
+
var import_antd9 = require("antd");
|
|
892
930
|
var import_react9 = require("react");
|
|
893
931
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
894
932
|
function useModal(init) {
|
|
@@ -901,7 +939,7 @@ function useModal(init) {
|
|
|
901
939
|
...init
|
|
902
940
|
});
|
|
903
941
|
return {
|
|
904
|
-
modal: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
942
|
+
modal: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Modal, {
|
|
905
943
|
...props
|
|
906
944
|
}),
|
|
907
945
|
modalProps: props,
|
|
@@ -915,47 +953,48 @@ function useModal(init) {
|
|
|
915
953
|
}
|
|
916
954
|
|
|
917
955
|
// src/Routers.tsx
|
|
918
|
-
var
|
|
956
|
+
var import_antd10 = require("antd");
|
|
919
957
|
var import_react10 = require("react");
|
|
920
958
|
var import_react_router_dom2 = require("react-router-dom");
|
|
921
959
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
922
960
|
function PageNotFound() {
|
|
923
961
|
const config = useConfigContext();
|
|
924
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
962
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Result, {
|
|
925
963
|
status: "404",
|
|
926
964
|
title: config.common.pageNotFound
|
|
927
965
|
});
|
|
928
966
|
}
|
|
929
967
|
function Routes(props) {
|
|
930
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
931
|
-
children:
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Alert.ErrorBoundary, {
|
|
969
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_router_dom2.Routes, {
|
|
970
|
+
children: [
|
|
971
|
+
props.routes.map((r) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom2.Route, {
|
|
972
|
+
...r,
|
|
973
|
+
element: r.element || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react10.Suspense, {
|
|
974
|
+
fallback: props.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
975
|
+
style: { padding: "24px" },
|
|
976
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Skeleton, {
|
|
977
|
+
active: true
|
|
978
|
+
})
|
|
979
|
+
}),
|
|
980
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(r.page, {})
|
|
981
|
+
})
|
|
982
|
+
}, r.path)),
|
|
983
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom2.Route, {
|
|
984
|
+
path: "*",
|
|
985
|
+
element: props.notFound || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageNotFound, {})
|
|
986
|
+
}, "*")
|
|
987
|
+
]
|
|
988
|
+
})
|
|
949
989
|
});
|
|
950
990
|
}
|
|
951
991
|
|
|
952
992
|
// src/Table.tsx
|
|
953
993
|
var import_react11 = require("react");
|
|
954
|
-
var
|
|
994
|
+
var import_antd11 = require("antd");
|
|
955
995
|
var import_dayjs2 = __toESM(require("dayjs"));
|
|
956
996
|
var import_icons3 = require("@ant-design/icons");
|
|
957
997
|
var import_lodash_es6 = require("lodash-es");
|
|
958
|
-
var import_react12 = require("@faasjs/react");
|
|
959
998
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
960
999
|
function processValue(item, value) {
|
|
961
1000
|
var _a;
|
|
@@ -1045,7 +1084,7 @@ function Table(props) {
|
|
|
1045
1084
|
setSelectedKeys,
|
|
1046
1085
|
confirm,
|
|
1047
1086
|
clearFilters
|
|
1048
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1087
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Input.Search, {
|
|
1049
1088
|
placeholder: `${common2.search} ${item.title}`,
|
|
1050
1089
|
allowClear: true,
|
|
1051
1090
|
onSearch: (v) => {
|
|
@@ -1075,7 +1114,7 @@ function Table(props) {
|
|
|
1075
1114
|
setSelectedKeys,
|
|
1076
1115
|
confirm,
|
|
1077
1116
|
clearFilters
|
|
1078
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1117
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Input.Search, {
|
|
1079
1118
|
placeholder: `${common2.search} ${item.title}`,
|
|
1080
1119
|
allowClear: true,
|
|
1081
1120
|
onSearch: (v) => {
|
|
@@ -1105,7 +1144,7 @@ function Table(props) {
|
|
|
1105
1144
|
setSelectedKeys,
|
|
1106
1145
|
confirm,
|
|
1107
1146
|
clearFilters
|
|
1108
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1147
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Input.Search, {
|
|
1109
1148
|
placeholder: `${common2.search} ${item.title}`,
|
|
1110
1149
|
allowClear: true,
|
|
1111
1150
|
onSearch: (v) => {
|
|
@@ -1135,7 +1174,7 @@ function Table(props) {
|
|
|
1135
1174
|
setSelectedKeys,
|
|
1136
1175
|
confirm,
|
|
1137
1176
|
clearFilters
|
|
1138
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1177
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Input.Search, {
|
|
1139
1178
|
placeholder: `${common2.search} ${item.title}`,
|
|
1140
1179
|
allowClear: true,
|
|
1141
1180
|
onSearch: (v) => {
|
|
@@ -1167,7 +1206,7 @@ function Table(props) {
|
|
|
1167
1206
|
setSelectedKeys,
|
|
1168
1207
|
selectedKeys,
|
|
1169
1208
|
confirm
|
|
1170
|
-
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
1209
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd11.Radio.Group, {
|
|
1171
1210
|
style: { padding: 8 },
|
|
1172
1211
|
buttonStyle: "solid",
|
|
1173
1212
|
value: selectedKeys[0],
|
|
@@ -1176,10 +1215,10 @@ function Table(props) {
|
|
|
1176
1215
|
confirm();
|
|
1177
1216
|
},
|
|
1178
1217
|
children: [
|
|
1179
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1218
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Radio.Button, {
|
|
1180
1219
|
children: common2.all
|
|
1181
1220
|
}),
|
|
1182
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1221
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Radio.Button, {
|
|
1183
1222
|
value: "true",
|
|
1184
1223
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CheckOutlined, {
|
|
1185
1224
|
style: {
|
|
@@ -1188,7 +1227,7 @@ function Table(props) {
|
|
|
1188
1227
|
}
|
|
1189
1228
|
})
|
|
1190
1229
|
}),
|
|
1191
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1230
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Radio.Button, {
|
|
1192
1231
|
value: "false",
|
|
1193
1232
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CloseOutlined, {
|
|
1194
1233
|
style: {
|
|
@@ -1197,7 +1236,7 @@ function Table(props) {
|
|
|
1197
1236
|
}
|
|
1198
1237
|
})
|
|
1199
1238
|
}),
|
|
1200
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1239
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Radio.Button, {
|
|
1201
1240
|
value: "empty",
|
|
1202
1241
|
children: common2.blank
|
|
1203
1242
|
})
|
|
@@ -1268,32 +1307,34 @@ function Table(props) {
|
|
|
1268
1307
|
return;
|
|
1269
1308
|
for (const column of columns) {
|
|
1270
1309
|
if (column.optionsType === "auto" && !column.options && !column.filters) {
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1310
|
+
const filters = (0, import_lodash_es6.uniqBy)(props.dataSource, column.id).map((v) => ({
|
|
1311
|
+
text: v[column.id],
|
|
1312
|
+
value: v[column.id]
|
|
1313
|
+
}));
|
|
1314
|
+
if (filters.length)
|
|
1315
|
+
setColumns((prev) => {
|
|
1316
|
+
const newColumns = [...prev];
|
|
1317
|
+
const index = newColumns.findIndex((item) => item.id === column.id);
|
|
1318
|
+
newColumns[index].filters = filters.concat({
|
|
1319
|
+
text: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {}),
|
|
1320
|
+
value: null
|
|
1321
|
+
});
|
|
1322
|
+
return newColumns;
|
|
1280
1323
|
});
|
|
1281
|
-
return newColumns;
|
|
1282
|
-
});
|
|
1283
1324
|
}
|
|
1284
1325
|
}
|
|
1285
1326
|
}, [props.dataSource, columns]);
|
|
1286
1327
|
if (!columns)
|
|
1287
1328
|
return null;
|
|
1288
1329
|
if (!props.faasData)
|
|
1289
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1330
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
|
|
1290
1331
|
...props,
|
|
1291
1332
|
rowKey: props.rowKey || "id",
|
|
1292
1333
|
columns,
|
|
1293
1334
|
dataSource: props.dataSource
|
|
1294
1335
|
});
|
|
1295
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1296
|
-
fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FaasDataWrapper, {
|
|
1337
|
+
fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Skeleton, {
|
|
1297
1338
|
active: true
|
|
1298
1339
|
}),
|
|
1299
1340
|
...props.faasData,
|
|
@@ -1332,33 +1373,35 @@ function FaasDataTable({
|
|
|
1332
1373
|
continue;
|
|
1333
1374
|
}
|
|
1334
1375
|
if (column.optionsType === "auto" && !column.options && !column.filters) {
|
|
1335
|
-
|
|
1376
|
+
const filters = (0, import_lodash_es6.uniqBy)(props.dataSource, column.id).map((v) => ({
|
|
1336
1377
|
text: v[column.id],
|
|
1337
1378
|
value: v[column.id]
|
|
1338
|
-
}))
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1379
|
+
}));
|
|
1380
|
+
if (filters.length)
|
|
1381
|
+
column.filters = filters.concat({
|
|
1382
|
+
text: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {}),
|
|
1383
|
+
value: null
|
|
1384
|
+
});
|
|
1342
1385
|
}
|
|
1343
1386
|
}
|
|
1344
1387
|
return newColumns;
|
|
1345
1388
|
});
|
|
1346
1389
|
}, [columns, data]);
|
|
1347
1390
|
if (!data)
|
|
1348
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
|
|
1349
1392
|
...props,
|
|
1350
1393
|
rowKey: props.rowKey || "id",
|
|
1351
1394
|
columns: currentColumns,
|
|
1352
1395
|
dataSource: []
|
|
1353
1396
|
});
|
|
1354
1397
|
if (Array.isArray(data))
|
|
1355
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1398
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
|
|
1356
1399
|
...props,
|
|
1357
1400
|
rowKey: props.rowKey || "id",
|
|
1358
1401
|
columns: currentColumns,
|
|
1359
1402
|
dataSource: data
|
|
1360
1403
|
});
|
|
1361
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
1404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Table, {
|
|
1362
1405
|
...props,
|
|
1363
1406
|
rowKey: props.rowKey || "id",
|
|
1364
1407
|
columns: currentColumns,
|
|
@@ -1389,11 +1432,11 @@ function FaasDataTable({
|
|
|
1389
1432
|
}
|
|
1390
1433
|
|
|
1391
1434
|
// src/Title.tsx
|
|
1392
|
-
var
|
|
1435
|
+
var import_react12 = require("react");
|
|
1393
1436
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
1394
1437
|
function Title(props) {
|
|
1395
1438
|
const { Title: Title2 } = useConfigContext();
|
|
1396
|
-
(0,
|
|
1439
|
+
(0, import_react12.useEffect)(() => {
|
|
1397
1440
|
const title = Array.isArray(props.title) ? props.title : [props.title];
|
|
1398
1441
|
document.title = title.concat(props.suffix || Title2.suffix).filter((t) => !!t).join(props.separator || Title2.separator);
|
|
1399
1442
|
}, [props]);
|
|
@@ -1413,7 +1456,7 @@ function Title(props) {
|
|
|
1413
1456
|
children: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1414
1457
|
});
|
|
1415
1458
|
if (props.children)
|
|
1416
|
-
return (0,
|
|
1459
|
+
return (0, import_react12.cloneElement)(props.children, { title: props.title });
|
|
1417
1460
|
return null;
|
|
1418
1461
|
}
|
|
1419
1462
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1423,9 +1466,13 @@ function Title(props) {
|
|
|
1423
1466
|
ConfigProvider,
|
|
1424
1467
|
Description,
|
|
1425
1468
|
Drawer,
|
|
1469
|
+
FaasDataInjection,
|
|
1470
|
+
FaasDataWrapper,
|
|
1471
|
+
FaasDataWrapperProps,
|
|
1426
1472
|
Form,
|
|
1427
1473
|
FormItem,
|
|
1428
1474
|
Link,
|
|
1475
|
+
Loading,
|
|
1429
1476
|
Modal,
|
|
1430
1477
|
PageNotFound,
|
|
1431
1478
|
Routes,
|