@faasjs/ant-design 0.0.3-beta.68 → 0.0.3-beta.69

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/dist/index.mjs CHANGED
@@ -1,3 +1,23 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+
1
21
  // react-shim.js
2
22
  import React from "react";
3
23
 
@@ -20,24 +40,17 @@ import { Modal } from "antd";
20
40
  import { useState } from "react";
21
41
  import { jsx } from "react/jsx-runtime";
22
42
  function useModal(init) {
23
- const [props, setProps] = useState({
43
+ const [props, setProps] = useState(__spreadValues({
24
44
  open: false,
25
- onCancel: () => setProps((prev) => ({
26
- ...prev,
45
+ onCancel: () => setProps((prev) => __spreadProps(__spreadValues({}, prev), {
27
46
  open: false
28
- })),
29
- ...init
30
- });
47
+ }))
48
+ }, init));
31
49
  return {
32
- modal: /* @__PURE__ */ jsx(Modal, {
33
- ...props
34
- }),
50
+ modal: /* @__PURE__ */ jsx(Modal, __spreadValues({}, props)),
35
51
  modalProps: props,
36
52
  setModalProps(changes) {
37
- setProps((prev) => ({
38
- ...prev,
39
- ...changes
40
- }));
53
+ setProps((prev) => __spreadValues(__spreadValues({}, prev), changes));
41
54
  }
42
55
  };
43
56
  }
@@ -47,24 +60,17 @@ import { Drawer } from "antd";
47
60
  import { useState as useState2 } from "react";
48
61
  import { jsx as jsx2 } from "react/jsx-runtime";
49
62
  function useDrawer(init) {
50
- const [props, setProps] = useState2({
63
+ const [props, setProps] = useState2(__spreadValues({
51
64
  open: false,
52
- onClose: () => setProps((prev) => ({
53
- ...prev,
65
+ onClose: () => setProps((prev) => __spreadProps(__spreadValues({}, prev), {
54
66
  open: false
55
- })),
56
- ...init
57
- });
67
+ }))
68
+ }, init));
58
69
  return {
59
- drawer: /* @__PURE__ */ jsx2(Drawer, {
60
- ...props
61
- }),
70
+ drawer: /* @__PURE__ */ jsx2(Drawer, __spreadValues({}, props)),
62
71
  drawerProps: props,
63
72
  setDrawerProps(changes) {
64
- setProps((prev) => ({
65
- ...prev,
66
- ...changes
67
- }));
73
+ setProps((prev) => __spreadValues(__spreadValues({}, prev), changes));
68
74
  }
69
75
  };
70
76
  }
@@ -86,9 +92,7 @@ function RoutesApp(props) {
86
92
  setDrawerProps({ open: false });
87
93
  setModalProps({ open: false });
88
94
  }, [location]);
89
- return /* @__PURE__ */ jsx3(Fragment, {
90
- children: props.children
91
- });
95
+ return /* @__PURE__ */ jsx3(Fragment, { children: props.children });
92
96
  }
93
97
  function App(props) {
94
98
  const [messageApi, messageContextHolder] = message.useMessage();
@@ -109,30 +113,21 @@ function App(props) {
109
113
  setDrawerProps
110
114
  ]
111
115
  );
112
- return /* @__PURE__ */ jsx3(StyleProvider, {
113
- ...Object.assign(props.styleProviderProps || {}, {
116
+ return /* @__PURE__ */ jsx3(
117
+ StyleProvider,
118
+ __spreadProps(__spreadValues({}, Object.assign(props.styleProviderProps || {}, {
114
119
  hashPriority: "high",
115
120
  transformers: [legacyLogicalPropertiesTransformer]
116
- }),
117
- children: /* @__PURE__ */ jsx3(ConfigProvider, {
118
- ...props.configProviderProps,
119
- children: /* @__PURE__ */ jsx3(AppContext.Provider, {
120
- value: memoizedContextValue,
121
- children: /* @__PURE__ */ jsxs(BrowserRouter, {
122
- ...props.browserRouterProps,
123
- children: [
124
- messageContextHolder,
125
- notificationContextHolder,
126
- modal,
127
- drawer,
128
- /* @__PURE__ */ jsx3(RoutesApp, {
129
- children: props.children
130
- })
131
- ]
132
- })
133
- })
121
+ })), {
122
+ children: /* @__PURE__ */ jsx3(ConfigProvider, __spreadProps(__spreadValues({}, props.configProviderProps), { children: /* @__PURE__ */ jsx3(AppContext.Provider, { value: memoizedContextValue, children: /* @__PURE__ */ jsxs(BrowserRouter, __spreadProps(__spreadValues({}, props.browserRouterProps), { children: [
123
+ messageContextHolder,
124
+ notificationContextHolder,
125
+ modal,
126
+ drawer,
127
+ /* @__PURE__ */ jsx3(RoutesApp, { children: props.children })
128
+ ] })) }) }))
134
129
  })
135
- });
130
+ );
136
131
  }
137
132
  function useApp() {
138
133
  return useContext(AppContext);
@@ -207,10 +202,7 @@ function ConfigProvider2({
207
202
  } else
208
203
  setValues(defaultsDeep(config, values));
209
204
  }, []);
210
- return /* @__PURE__ */ jsx4(ConfigContext.Provider, {
211
- value: values,
212
- children
213
- });
205
+ return /* @__PURE__ */ jsx4(ConfigContext.Provider, { value: values, children });
214
206
  }
215
207
  function useConfigContext() {
216
208
  return useContext2(ConfigContext);
@@ -220,10 +212,7 @@ function useConfigContext() {
220
212
  import { jsx as jsx5 } from "react/jsx-runtime";
221
213
  function Blank(options) {
222
214
  const { Blank: Blank2 } = useConfigContext();
223
- return !options || isNil(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ jsx5(Typography.Text, {
224
- disabled: true,
225
- children: (options == null ? void 0 : options.text) || Blank2.text
226
- }) : options.value;
215
+ return !options || isNil(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ jsx5(Typography.Text, { disabled: true, children: (options == null ? void 0 : options.text) || Blank2.text }) : options.value;
227
216
  }
228
217
 
229
218
  // src/data.ts
@@ -261,55 +250,71 @@ import {
261
250
  } from "antd";
262
251
  import { isFunction, upperFirst as upperFirst2 } from "lodash-es";
263
252
  import {
264
- cloneElement,
265
- useEffect as useEffect3,
266
- useState as useState4
253
+ cloneElement as cloneElement2,
254
+ useEffect as useEffect4,
255
+ useState as useState5
267
256
  } from "react";
268
257
 
269
- // src/FaasDataWrapper.tsx
270
- import { FaasDataWrapper as Origin } from "@faasjs/react";
258
+ // ../react/dist/index.mjs
259
+ import {
260
+ useState as useState4,
261
+ useEffect as useEffect3,
262
+ createElement,
263
+ cloneElement
264
+ } from "react";
265
+ var clients = {};
266
+ function getClient(domain) {
267
+ const client = clients[domain || Object.keys(clients)[0]];
268
+ if (!client)
269
+ throw Error("FaasReactClient is not initialized");
270
+ return client;
271
+ }
272
+ async function faas(action, params) {
273
+ return getClient().faas(action, params);
274
+ }
275
+ function FaasDataWrapper(props) {
276
+ const [client, setClient] = useState4();
277
+ useEffect3(() => {
278
+ if (client)
279
+ return;
280
+ setClient(getClient());
281
+ }, []);
282
+ if (!client)
283
+ return props.fallback || null;
284
+ return createElement(client.FaasDataWrapper, props);
285
+ }
271
286
 
272
287
  // src/Loading.tsx
273
288
  import { Spin } from "antd";
274
289
  import { Fragment as Fragment2, jsx as jsx6 } from "react/jsx-runtime";
275
290
  function Loading(props) {
276
291
  if (props.loading === false)
277
- return /* @__PURE__ */ jsx6(Fragment2, {
278
- children: props.children
279
- });
280
- return /* @__PURE__ */ jsx6("div", {
281
- style: {
282
- ...props.style || {},
283
- ...!props.size || props.size === "large" ? {
284
- margin: "20vh auto",
285
- textAlign: "center"
286
- } : {}
287
- },
288
- children: /* @__PURE__ */ jsx6(Spin, {
289
- size: props.size || "large"
290
- })
291
- });
292
+ return /* @__PURE__ */ jsx6(Fragment2, { children: props.children });
293
+ return /* @__PURE__ */ jsx6("div", { style: __spreadValues(__spreadValues({}, props.style || {}), !props.size || props.size === "large" ? {
294
+ margin: "20vh auto",
295
+ textAlign: "center"
296
+ } : {}), children: /* @__PURE__ */ jsx6(Spin, { size: props.size || "large" }) });
292
297
  }
293
298
 
294
299
  // src/FaasDataWrapper.tsx
295
300
  import { jsx as jsx7 } from "react/jsx-runtime";
296
- function FaasDataWrapper(props) {
297
- return /* @__PURE__ */ jsx7(Origin, {
298
- fallback: props.loading || /* @__PURE__ */ jsx7(Loading, {
299
- ...props.loadingProps
300
- }),
301
- ...props
302
- });
301
+ function FaasDataWrapper2(props) {
302
+ return /* @__PURE__ */ jsx7(
303
+ FaasDataWrapper,
304
+ __spreadValues({
305
+ fallback: props.loading || /* @__PURE__ */ jsx7(Loading, __spreadValues({}, props.loadingProps))
306
+ }, props)
307
+ );
303
308
  }
304
309
 
305
310
  // src/Description.tsx
306
311
  import { Fragment as Fragment3, jsx as jsx8 } from "react/jsx-runtime";
307
312
  function DescriptionItemContent(props) {
308
313
  var _a;
309
- const [computedProps, setComputedProps] = useState4();
310
- useEffect3(() => {
314
+ const [computedProps, setComputedProps] = useState5();
315
+ useEffect4(() => {
311
316
  var _a2, _b;
312
- const propsCopy = { ...props };
317
+ const propsCopy = __spreadValues({}, props);
313
318
  if (!propsCopy.item.title)
314
319
  propsCopy.item.title = upperFirst2(propsCopy.item.id);
315
320
  if (!propsCopy.item.type)
@@ -337,7 +342,7 @@ function DescriptionItemContent(props) {
337
342
  return null;
338
343
  if (computedProps.extendTypes && computedProps.extendTypes[computedProps.item.type])
339
344
  if (computedProps.extendTypes[computedProps.item.type].children)
340
- return cloneElement(
345
+ return cloneElement2(
341
346
  computedProps.extendTypes[computedProps.item.type].children,
342
347
  {
343
348
  scene: "description",
@@ -346,15 +351,13 @@ function DescriptionItemContent(props) {
346
351
  }
347
352
  );
348
353
  else if (computedProps.extendTypes[computedProps.item.type].render)
349
- return /* @__PURE__ */ jsx8(Fragment3, {
350
- children: computedProps.extendTypes[computedProps.item.type].render(computedProps.value, computedProps.values, 0, "description")
351
- });
354
+ return /* @__PURE__ */ jsx8(Fragment3, { children: computedProps.extendTypes[computedProps.item.type].render(computedProps.value, computedProps.values, 0, "description") });
352
355
  else
353
356
  throw Error(computedProps.item.type + " requires children or render");
354
357
  if (computedProps.item.descriptionChildren === null)
355
358
  return null;
356
359
  if (computedProps.item.descriptionChildren)
357
- return cloneElement(computedProps.item.descriptionChildren, {
360
+ return cloneElement2(computedProps.item.descriptionChildren, {
358
361
  scene: "description",
359
362
  value: computedProps.value,
360
363
  values: computedProps.values
@@ -362,112 +365,120 @@ function DescriptionItemContent(props) {
362
365
  if (computedProps.item.children === null)
363
366
  return null;
364
367
  if (computedProps.item.children)
365
- return cloneElement(computedProps.item.children, {
368
+ return cloneElement2(computedProps.item.children, {
366
369
  scene: "description",
367
370
  value: computedProps.value,
368
371
  values: computedProps.values
369
372
  });
370
373
  if (computedProps.item.descriptionRender)
371
- return /* @__PURE__ */ jsx8(Fragment3, {
372
- children: computedProps.item.descriptionRender(computedProps.value, computedProps.values, 0, "description")
373
- });
374
+ return /* @__PURE__ */ jsx8(Fragment3, { children: computedProps.item.descriptionRender(computedProps.value, computedProps.values, 0, "description") });
374
375
  if (computedProps.item.render)
375
- return /* @__PURE__ */ jsx8(Fragment3, {
376
- children: computedProps.item.render(computedProps.value, computedProps.values, 0, "description")
377
- });
376
+ return /* @__PURE__ */ jsx8(Fragment3, { children: computedProps.item.render(computedProps.value, computedProps.values, 0, "description") });
378
377
  if (computedProps.value === null || Array.isArray(computedProps.value) && !computedProps.value.length)
379
378
  return /* @__PURE__ */ jsx8(Blank, {});
380
379
  switch (computedProps.item.type) {
381
380
  case "string[]":
382
- return /* @__PURE__ */ jsx8(Fragment3, {
383
- children: computedProps.value.join(", ")
384
- });
381
+ return /* @__PURE__ */ jsx8(Fragment3, { children: computedProps.value.join(", ") });
385
382
  case "number":
386
383
  return computedProps.value || null;
387
384
  case "number[]":
388
- return /* @__PURE__ */ jsx8(Fragment3, {
389
- children: computedProps.value.join(", ")
390
- });
385
+ return /* @__PURE__ */ jsx8(Fragment3, { children: computedProps.value.join(", ") });
391
386
  case "boolean":
392
- return computedProps.value ? /* @__PURE__ */ jsx8(CheckOutlined, {
393
- style: {
394
- marginTop: "4px",
395
- color: "#52c41a"
396
- }
397
- }) : /* @__PURE__ */ jsx8(CloseOutlined, {
398
- style: {
399
- marginTop: "4px",
400
- color: "#ff4d4f"
401
- }
402
- });
387
+ return computedProps.value ? /* @__PURE__ */ jsx8(CheckOutlined, { style: {
388
+ marginTop: "4px",
389
+ color: "#52c41a"
390
+ } }) : /* @__PURE__ */ jsx8(CloseOutlined, { style: {
391
+ marginTop: "4px",
392
+ color: "#ff4d4f"
393
+ } });
403
394
  case "time":
404
- return /* @__PURE__ */ jsx8(Fragment3, {
405
- children: computedProps.value.format("YYYY-MM-DD HH:mm:ss")
406
- });
395
+ return /* @__PURE__ */ jsx8(Fragment3, { children: computedProps.value.format("YYYY-MM-DD HH:mm:ss") });
407
396
  case "date":
408
- return /* @__PURE__ */ jsx8(Fragment3, {
409
- children: computedProps.value.format("YYYY-MM-DD")
410
- });
397
+ return /* @__PURE__ */ jsx8(Fragment3, { children: computedProps.value.format("YYYY-MM-DD") });
411
398
  case "object":
412
399
  if (!computedProps.value)
413
400
  return /* @__PURE__ */ jsx8(Blank, {});
414
- return /* @__PURE__ */ jsx8(Description, {
415
- items: computedProps.item.object,
416
- dataSource: computedProps.value,
417
- column: 1
418
- });
401
+ return /* @__PURE__ */ jsx8(
402
+ Description,
403
+ {
404
+ items: computedProps.item.object,
405
+ dataSource: computedProps.value,
406
+ column: 1
407
+ }
408
+ );
419
409
  case "object[]":
420
410
  if (!((_a = computedProps.value) == null ? void 0 : _a.length))
421
411
  return /* @__PURE__ */ jsx8(Blank, {});
422
- return /* @__PURE__ */ jsx8(Space, {
423
- direction: "vertical",
424
- children: computedProps.value.map((value, index) => /* @__PURE__ */ jsx8(Description, {
412
+ return /* @__PURE__ */ jsx8(Space, { direction: "vertical", children: computedProps.value.map((value, index) => /* @__PURE__ */ jsx8(
413
+ Description,
414
+ {
425
415
  items: computedProps.item.object,
426
416
  dataSource: value,
427
417
  column: 1
428
- }, index))
429
- });
418
+ },
419
+ index
420
+ )) });
430
421
  default:
431
422
  return computedProps.value || null;
432
423
  }
433
424
  }
434
425
  function Description(props) {
435
426
  if (props.dataSource)
436
- return /* @__PURE__ */ jsx8(Descriptions, {
437
- ...props,
438
- title: isFunction(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
439
- children: props.items.map((item) => {
440
- return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ jsx8(Descriptions.Item, {
441
- label: item.title || upperFirst2(item.id),
442
- children: /* @__PURE__ */ jsx8(DescriptionItemContent, {
443
- item,
444
- value: props.dataSource[item.id],
445
- values: props.dataSource,
446
- extendTypes: props.extendTypes
447
- })
448
- }, item.id) : null;
449
- }).filter(Boolean)
450
- });
451
- return /* @__PURE__ */ jsx8(FaasDataWrapper, {
452
- render: ({ data }) => {
453
- return /* @__PURE__ */ jsx8(Descriptions, {
454
- ...props,
455
- title: isFunction(props.renderTitle) ? props.renderTitle(data) : props.title,
427
+ return /* @__PURE__ */ jsx8(
428
+ Descriptions,
429
+ __spreadProps(__spreadValues({}, props), {
430
+ title: isFunction(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
456
431
  children: props.items.map((item) => {
457
- return !item.if || item.if(data) ? /* @__PURE__ */ jsx8(Descriptions.Item, {
458
- label: item.title || upperFirst2(item.id),
459
- children: /* @__PURE__ */ jsx8(DescriptionItemContent, {
460
- item,
461
- value: data[item.id],
462
- values: data,
463
- extendTypes: props.extendTypes
464
- })
465
- }, item.id) : null;
432
+ return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ jsx8(
433
+ Descriptions.Item,
434
+ {
435
+ label: item.title || upperFirst2(item.id),
436
+ children: /* @__PURE__ */ jsx8(
437
+ DescriptionItemContent,
438
+ {
439
+ item,
440
+ value: props.dataSource[item.id],
441
+ values: props.dataSource,
442
+ extendTypes: props.extendTypes
443
+ }
444
+ )
445
+ },
446
+ item.id
447
+ ) : null;
466
448
  }).filter(Boolean)
467
- });
468
- },
469
- ...props.faasData
470
- });
449
+ })
450
+ );
451
+ return /* @__PURE__ */ jsx8(
452
+ FaasDataWrapper2,
453
+ __spreadValues({
454
+ render: ({ data }) => {
455
+ return /* @__PURE__ */ jsx8(
456
+ Descriptions,
457
+ __spreadProps(__spreadValues({}, props), {
458
+ title: isFunction(props.renderTitle) ? props.renderTitle(data) : props.title,
459
+ children: props.items.map((item) => {
460
+ return !item.if || item.if(data) ? /* @__PURE__ */ jsx8(
461
+ Descriptions.Item,
462
+ {
463
+ label: item.title || upperFirst2(item.id),
464
+ children: /* @__PURE__ */ jsx8(
465
+ DescriptionItemContent,
466
+ {
467
+ item,
468
+ value: data[item.id],
469
+ values: data,
470
+ extendTypes: props.extendTypes
471
+ }
472
+ )
473
+ },
474
+ item.id
475
+ ) : null;
476
+ }).filter(Boolean)
477
+ })
478
+ );
479
+ }
480
+ }, props.faasData)
481
+ );
471
482
  }
472
483
 
473
484
  // src/ErrorBoundary.tsx
@@ -501,31 +512,30 @@ var ErrorBoundary = class extends Component {
501
512
  if (error) {
502
513
  if (this.props.onError)
503
514
  return this.props.onError(error, info);
504
- return /* @__PURE__ */ jsx9(Alert, {
505
- type: "error",
506
- message: errorMessage,
507
- description: /* @__PURE__ */ jsx9("pre", {
508
- style: {
515
+ return /* @__PURE__ */ jsx9(
516
+ Alert,
517
+ {
518
+ type: "error",
519
+ message: errorMessage,
520
+ description: /* @__PURE__ */ jsx9("pre", { style: {
509
521
  fontSize: "0.9em",
510
522
  overflowX: "auto"
511
- },
512
- children: errorDescription
513
- })
514
- });
523
+ }, children: errorDescription })
524
+ }
525
+ );
515
526
  }
516
527
  return children;
517
528
  }
518
529
  };
519
530
 
520
531
  // src/Form.tsx
521
- import { faas } from "@faasjs/react";
522
532
  import {
523
533
  Button as Button2,
524
534
  Form as AntdForm2
525
535
  } from "antd";
526
536
  import {
527
- useEffect as useEffect5,
528
- useState as useState6,
537
+ useEffect as useEffect6,
538
+ useState as useState7,
529
539
  useCallback,
530
540
  isValidElement
531
541
  } from "react";
@@ -545,9 +555,9 @@ import {
545
555
  } from "antd";
546
556
  import { MinusCircleOutlined, PlusOutlined } from "@ant-design/icons";
547
557
  import {
548
- cloneElement as cloneElement2,
549
- useEffect as useEffect4,
550
- useState as useState5
558
+ cloneElement as cloneElement3,
559
+ useEffect as useEffect5,
560
+ useState as useState6
551
561
  } from "react";
552
562
  import { upperFirst as upperFirst3 } from "lodash-es";
553
563
  import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
@@ -599,12 +609,12 @@ function processProps(propsCopy, config) {
599
609
  }
600
610
  function FormItem(props) {
601
611
  var _a;
602
- const [computedProps, setComputedProps] = useState5();
603
- const [extendTypes, setExtendTypes] = useState5();
612
+ const [computedProps, setComputedProps] = useState6();
613
+ const [extendTypes, setExtendTypes] = useState6();
604
614
  const { common: common2 } = useConfigContext();
605
- const [hidden, setHidden] = useState5(props.hidden || false);
606
- useEffect4(() => {
607
- const propsCopy = { ...props };
615
+ const [hidden, setHidden] = useState6(props.hidden || false);
616
+ useEffect5(() => {
617
+ const propsCopy = __spreadValues({}, props);
608
618
  if (propsCopy.extendTypes) {
609
619
  setExtendTypes(propsCopy.extendTypes);
610
620
  delete propsCopy.extendTypes;
@@ -627,290 +637,231 @@ function FormItem(props) {
627
637
  if (!computedProps)
628
638
  return null;
629
639
  if (hidden)
630
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
631
- ...computedProps,
632
- noStyle: true,
633
- rules: [],
634
- children: /* @__PURE__ */ jsx10(Input, {
635
- hidden: true
640
+ return /* @__PURE__ */ jsx10(
641
+ AntdForm.Item,
642
+ __spreadProps(__spreadValues({}, computedProps), {
643
+ noStyle: true,
644
+ rules: [],
645
+ children: /* @__PURE__ */ jsx10(Input, { hidden: true })
636
646
  })
637
- });
647
+ );
638
648
  if (extendTypes && extendTypes[computedProps.type])
639
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
640
- ...computedProps,
641
- children: extendTypes[computedProps.type].children
642
- });
649
+ return /* @__PURE__ */ jsx10(AntdForm.Item, __spreadProps(__spreadValues({}, computedProps), { children: extendTypes[computedProps.type].children }));
643
650
  if (computedProps.formChildren === null)
644
651
  return null;
645
652
  if (computedProps.formChildren)
646
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
647
- ...computedProps,
648
- children: cloneElement2(computedProps.formChildren, { scene: "form" })
649
- });
653
+ return /* @__PURE__ */ jsx10(AntdForm.Item, __spreadProps(__spreadValues({}, computedProps), { children: cloneElement3(computedProps.formChildren, { scene: "form" }) }));
650
654
  if (computedProps.children === null)
651
655
  return null;
652
656
  if (computedProps.children)
653
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
654
- ...computedProps,
655
- children: cloneElement2(computedProps.children, { scene: "form" })
656
- });
657
+ return /* @__PURE__ */ jsx10(AntdForm.Item, __spreadProps(__spreadValues({}, computedProps), { children: cloneElement3(computedProps.children, { scene: "form" }) }));
657
658
  if (computedProps.formRender)
658
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
659
- ...computedProps,
660
- children: computedProps.formRender(null, null, 0, "form")
661
- });
659
+ return /* @__PURE__ */ jsx10(AntdForm.Item, __spreadProps(__spreadValues({}, computedProps), { children: computedProps.formRender(null, null, 0, "form") }));
662
660
  if (computedProps.render)
663
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
664
- ...computedProps,
665
- children: computedProps.render(null, null, 0, "form")
666
- });
661
+ return /* @__PURE__ */ jsx10(AntdForm.Item, __spreadProps(__spreadValues({}, computedProps), { children: computedProps.render(null, null, 0, "form") }));
667
662
  switch (computedProps.type) {
668
663
  case "string":
669
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
670
- ...computedProps,
671
- children: computedProps.options ? /* @__PURE__ */ jsx10(Select, {
672
- ...computedProps.input
673
- }) : /* @__PURE__ */ jsx10(Input, {
674
- ...computedProps.input
675
- })
676
- });
664
+ return /* @__PURE__ */ jsx10(AntdForm.Item, __spreadProps(__spreadValues({}, computedProps), { children: computedProps.options ? /* @__PURE__ */ jsx10(Select, __spreadValues({}, computedProps.input)) : /* @__PURE__ */ jsx10(Input, __spreadValues({}, computedProps.input)) }));
677
665
  case "string[]":
678
666
  if (computedProps.options)
679
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
680
- ...computedProps,
681
- children: /* @__PURE__ */ jsx10(Select, {
682
- mode: "multiple",
683
- ...computedProps.input
684
- })
685
- });
686
- return /* @__PURE__ */ jsx10(AntdForm.List, {
687
- name: computedProps.name,
688
- rules: computedProps.rules,
689
- children: (fields, { add, remove }, { errors }) => {
690
- var _a2;
691
- return /* @__PURE__ */ jsxs2(Fragment4, {
692
- children: [
693
- computedProps.label && /* @__PURE__ */ jsx10("div", {
694
- className: "ant-form-item-label",
695
- children: /* @__PURE__ */ jsx10("label", {
696
- className: computedProps.rules.find((r) => r.required) && "ant-form-item-required",
697
- children: computedProps.label
698
- })
699
- }),
667
+ return /* @__PURE__ */ jsx10(AntdForm.Item, __spreadProps(__spreadValues({}, computedProps), { children: /* @__PURE__ */ jsx10(
668
+ Select,
669
+ __spreadValues({
670
+ mode: "multiple"
671
+ }, computedProps.input)
672
+ ) }));
673
+ return /* @__PURE__ */ jsx10(
674
+ AntdForm.List,
675
+ {
676
+ name: computedProps.name,
677
+ rules: computedProps.rules,
678
+ children: (fields, { add, remove }, { errors }) => {
679
+ var _a2;
680
+ return /* @__PURE__ */ jsxs2(Fragment4, { children: [
681
+ computedProps.label && /* @__PURE__ */ jsx10("div", { className: "ant-form-item-label", children: /* @__PURE__ */ jsx10("label", { className: computedProps.rules.find((r) => r.required) && "ant-form-item-required", children: computedProps.label }) }),
700
682
  fields.map((field) => {
701
683
  var _a3;
702
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
703
- children: /* @__PURE__ */ jsxs2(Row, {
684
+ return /* @__PURE__ */ jsx10(AntdForm.Item, { children: /* @__PURE__ */ jsxs2(
685
+ Row,
686
+ {
704
687
  gutter: 24,
705
688
  style: { flexFlow: "row nowrap" },
706
689
  children: [
707
- /* @__PURE__ */ jsx10(Col, {
708
- span: 23,
709
- children: /* @__PURE__ */ jsx10(AntdForm.Item, {
710
- ...field,
690
+ /* @__PURE__ */ jsx10(Col, { span: 23, children: /* @__PURE__ */ jsx10(
691
+ AntdForm.Item,
692
+ __spreadProps(__spreadValues({}, field), {
711
693
  noStyle: true,
712
- children: /* @__PURE__ */ jsx10(Input, {
713
- ...computedProps.input
714
- })
694
+ children: /* @__PURE__ */ jsx10(Input, __spreadValues({}, computedProps.input))
715
695
  })
716
- }),
717
- /* @__PURE__ */ jsx10(Col, {
718
- span: 1,
719
- children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx10(Button, {
696
+ ) }),
697
+ /* @__PURE__ */ jsx10(Col, { span: 1, children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx10(
698
+ Button,
699
+ {
720
700
  danger: true,
721
701
  type: "link",
722
702
  style: { float: "right" },
723
703
  icon: /* @__PURE__ */ jsx10(MinusCircleOutlined, {}),
724
704
  onClick: () => remove(field.name)
725
- })
726
- })
705
+ }
706
+ ) })
727
707
  ]
728
- })
729
- }, field.key);
708
+ }
709
+ ) }, field.key);
730
710
  }),
731
- /* @__PURE__ */ jsxs2(AntdForm.Item, {
732
- children: [
733
- !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx10(Button, {
711
+ /* @__PURE__ */ jsxs2(AntdForm.Item, { children: [
712
+ !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx10(
713
+ Button,
714
+ {
734
715
  type: "dashed",
735
716
  block: true,
736
717
  onClick: () => add(),
737
718
  icon: /* @__PURE__ */ jsx10(PlusOutlined, {})
738
- }),
739
- computedProps.extra && /* @__PURE__ */ jsx10("div", {
740
- className: "ant-form-item-extra",
741
- children: computedProps.extra
742
- }),
743
- /* @__PURE__ */ jsx10(AntdForm.ErrorList, {
744
- errors
745
- })
746
- ]
747
- })
748
- ]
749
- });
719
+ }
720
+ ),
721
+ computedProps.extra && /* @__PURE__ */ jsx10("div", { className: "ant-form-item-extra", children: computedProps.extra }),
722
+ /* @__PURE__ */ jsx10(AntdForm.ErrorList, { errors })
723
+ ] })
724
+ ] });
725
+ }
750
726
  }
751
- });
727
+ );
752
728
  case "number":
753
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
754
- ...computedProps,
755
- children: computedProps.options ? /* @__PURE__ */ jsx10(Select, {
756
- ...computedProps.input
757
- }) : /* @__PURE__ */ jsx10(InputNumber, {
758
- style: { width: "100%" },
759
- ...computedProps.input
760
- })
761
- });
729
+ return /* @__PURE__ */ jsx10(AntdForm.Item, __spreadProps(__spreadValues({}, computedProps), { children: computedProps.options ? /* @__PURE__ */ jsx10(Select, __spreadValues({}, computedProps.input)) : /* @__PURE__ */ jsx10(
730
+ InputNumber,
731
+ __spreadValues({
732
+ style: { width: "100%" }
733
+ }, computedProps.input)
734
+ ) }));
762
735
  case "number[]":
763
736
  if (computedProps.options)
764
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
765
- ...computedProps,
766
- children: /* @__PURE__ */ jsx10(Select, {
767
- mode: "multiple",
768
- ...computedProps.input
769
- })
770
- });
771
- return /* @__PURE__ */ jsx10(AntdForm.List, {
772
- name: computedProps.name,
773
- rules: computedProps.rules,
774
- children: (fields, { add, remove }, { errors }) => {
775
- var _a2, _b;
776
- return /* @__PURE__ */ jsxs2(Fragment4, {
777
- children: [
778
- computedProps.label && /* @__PURE__ */ jsx10("div", {
779
- className: "ant-form-item-label",
780
- children: /* @__PURE__ */ jsx10("label", {
781
- className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required",
782
- children: computedProps.label
783
- })
784
- }),
737
+ return /* @__PURE__ */ jsx10(AntdForm.Item, __spreadProps(__spreadValues({}, computedProps), { children: /* @__PURE__ */ jsx10(
738
+ Select,
739
+ __spreadValues({
740
+ mode: "multiple"
741
+ }, computedProps.input)
742
+ ) }));
743
+ return /* @__PURE__ */ jsx10(
744
+ AntdForm.List,
745
+ {
746
+ name: computedProps.name,
747
+ rules: computedProps.rules,
748
+ children: (fields, { add, remove }, { errors }) => {
749
+ var _a2, _b;
750
+ return /* @__PURE__ */ jsxs2(Fragment4, { children: [
751
+ computedProps.label && /* @__PURE__ */ jsx10("div", { className: "ant-form-item-label", children: /* @__PURE__ */ jsx10("label", { className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required", children: computedProps.label }) }),
785
752
  fields.map((field) => {
786
753
  var _a3;
787
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
788
- children: /* @__PURE__ */ jsxs2(Row, {
754
+ return /* @__PURE__ */ jsx10(AntdForm.Item, { children: /* @__PURE__ */ jsxs2(
755
+ Row,
756
+ {
789
757
  gutter: 24,
790
758
  style: { flexFlow: "row nowrap" },
791
759
  children: [
792
- /* @__PURE__ */ jsx10(Col, {
793
- span: 23,
794
- children: /* @__PURE__ */ jsx10(AntdForm.Item, {
795
- ...field,
760
+ /* @__PURE__ */ jsx10(Col, { span: 23, children: /* @__PURE__ */ jsx10(
761
+ AntdForm.Item,
762
+ __spreadProps(__spreadValues({}, field), {
796
763
  noStyle: true,
797
- children: /* @__PURE__ */ jsx10(InputNumber, {
798
- style: { width: "100%" },
799
- ...computedProps.input
800
- })
764
+ children: /* @__PURE__ */ jsx10(
765
+ InputNumber,
766
+ __spreadValues({
767
+ style: { width: "100%" }
768
+ }, computedProps.input)
769
+ )
801
770
  })
802
- }),
803
- /* @__PURE__ */ jsx10(Col, {
804
- span: 1,
805
- children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx10(Button, {
771
+ ) }),
772
+ /* @__PURE__ */ jsx10(Col, { span: 1, children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx10(
773
+ Button,
774
+ {
806
775
  danger: true,
807
776
  type: "link",
808
777
  style: { float: "right" },
809
778
  icon: /* @__PURE__ */ jsx10(MinusCircleOutlined, {}),
810
779
  onClick: () => remove(field.name)
811
- })
812
- })
780
+ }
781
+ ) })
813
782
  ]
814
- })
815
- }, field.key);
783
+ }
784
+ ) }, field.key);
816
785
  }),
817
- /* @__PURE__ */ jsxs2(AntdForm.Item, {
818
- children: [
819
- !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx10(Button, {
786
+ /* @__PURE__ */ jsxs2(AntdForm.Item, { children: [
787
+ !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx10(
788
+ Button,
789
+ {
820
790
  type: "dashed",
821
791
  block: true,
822
792
  onClick: () => add(),
823
793
  icon: /* @__PURE__ */ jsx10(PlusOutlined, {})
824
- }),
825
- computedProps.extra && /* @__PURE__ */ jsx10("div", {
826
- className: "ant-form-item-extra",
827
- children: computedProps.extra
828
- }),
829
- /* @__PURE__ */ jsx10(AntdForm.ErrorList, {
830
- errors
831
- })
832
- ]
833
- })
834
- ]
835
- });
794
+ }
795
+ ),
796
+ computedProps.extra && /* @__PURE__ */ jsx10("div", { className: "ant-form-item-extra", children: computedProps.extra }),
797
+ /* @__PURE__ */ jsx10(AntdForm.ErrorList, { errors })
798
+ ] })
799
+ ] });
800
+ }
836
801
  }
837
- });
802
+ );
838
803
  case "boolean":
839
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
840
- ...computedProps,
841
- children: /* @__PURE__ */ jsx10(Switch, {
842
- ...computedProps.input
843
- })
844
- });
804
+ return /* @__PURE__ */ jsx10(AntdForm.Item, __spreadProps(__spreadValues({}, computedProps), { children: /* @__PURE__ */ jsx10(Switch, __spreadValues({}, computedProps.input)) }));
845
805
  case "date":
846
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
847
- ...computedProps,
848
- children: /* @__PURE__ */ jsx10(DatePicker, {
849
- ...computedProps.input
850
- })
851
- });
806
+ return /* @__PURE__ */ jsx10(AntdForm.Item, __spreadProps(__spreadValues({}, computedProps), { children: /* @__PURE__ */ jsx10(DatePicker, __spreadValues({}, computedProps.input)) }));
852
807
  case "time":
853
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
854
- ...computedProps,
855
- children: /* @__PURE__ */ jsx10(TimePicker, {
856
- ...computedProps.input
857
- })
858
- });
808
+ return /* @__PURE__ */ jsx10(AntdForm.Item, __spreadProps(__spreadValues({}, computedProps), { children: /* @__PURE__ */ jsx10(TimePicker, __spreadValues({}, computedProps.input)) }));
859
809
  case "object":
860
- return /* @__PURE__ */ jsxs2(Fragment4, {
861
- children: [
862
- computedProps.label && /* @__PURE__ */ jsx10("div", {
863
- className: "ant-form-item-label",
864
- children: /* @__PURE__ */ jsx10("label", {
865
- className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required",
866
- children: computedProps.label
867
- })
868
- }),
869
- computedProps.object.map((o) => /* @__PURE__ */ jsx10(FormItem, {
870
- ...o
871
- }, o.id))
872
- ]
873
- });
810
+ return /* @__PURE__ */ jsxs2(Fragment4, { children: [
811
+ computedProps.label && /* @__PURE__ */ jsx10("div", { className: "ant-form-item-label", children: /* @__PURE__ */ jsx10("label", { className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required", children: computedProps.label }) }),
812
+ computedProps.object.map((o) => /* @__PURE__ */ jsx10(
813
+ FormItem,
814
+ __spreadValues({}, o),
815
+ o.id
816
+ ))
817
+ ] });
874
818
  case "object[]":
875
- return /* @__PURE__ */ jsx10(AntdForm.List, {
876
- name: computedProps.name,
877
- rules: computedProps.rules,
878
- children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ jsxs2(Fragment4, {
879
- children: [
880
- fields.map((field) => /* @__PURE__ */ jsxs2(AntdForm.Item, {
881
- style: { marginBottom: 0 },
882
- children: [
883
- /* @__PURE__ */ jsx10("div", {
884
- className: "ant-form-item-label",
885
- children: /* @__PURE__ */ jsxs2("label", {
886
- children: [
887
- computedProps.label,
888
- " ",
889
- field.name + 1,
890
- !computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx10(Button, {
819
+ return /* @__PURE__ */ jsx10(
820
+ AntdForm.List,
821
+ {
822
+ name: computedProps.name,
823
+ rules: computedProps.rules,
824
+ children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ jsxs2(Fragment4, { children: [
825
+ fields.map((field) => /* @__PURE__ */ jsxs2(
826
+ AntdForm.Item,
827
+ {
828
+ style: { marginBottom: 0 },
829
+ children: [
830
+ /* @__PURE__ */ jsx10("div", { className: "ant-form-item-label", children: /* @__PURE__ */ jsxs2("label", { children: [
831
+ computedProps.label,
832
+ " ",
833
+ field.name + 1,
834
+ !computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx10(
835
+ Button,
836
+ {
891
837
  danger: true,
892
838
  type: "link",
893
839
  onClick: () => remove(field.name),
894
840
  children: common2.delete
895
- })
896
- ]
897
- })
898
- }),
899
- /* @__PURE__ */ jsx10(Row, {
900
- gutter: 24,
901
- children: computedProps.object.map((o) => /* @__PURE__ */ jsx10(Col, {
902
- span: o.col || 24,
903
- children: /* @__PURE__ */ jsx10(FormItem, {
904
- ...o,
905
- name: [field.name, o.id]
906
- })
907
- }, o.id))
908
- })
909
- ]
910
- }, field.key)),
911
- /* @__PURE__ */ jsxs2(AntdForm.Item, {
912
- children: [
913
- !computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsxs2(Button, {
841
+ }
842
+ )
843
+ ] }) }),
844
+ /* @__PURE__ */ jsx10(Row, { gutter: 24, children: computedProps.object.map((o) => /* @__PURE__ */ jsx10(
845
+ Col,
846
+ {
847
+ span: o.col || 24,
848
+ children: /* @__PURE__ */ jsx10(
849
+ FormItem,
850
+ __spreadProps(__spreadValues({}, o), {
851
+ name: [field.name, o.id]
852
+ })
853
+ )
854
+ },
855
+ o.id
856
+ )) })
857
+ ]
858
+ },
859
+ field.key
860
+ )),
861
+ /* @__PURE__ */ jsxs2(AntdForm.Item, { children: [
862
+ !computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsxs2(
863
+ Button,
864
+ {
914
865
  type: "dashed",
915
866
  block: true,
916
867
  onClick: () => add(),
@@ -920,19 +871,14 @@ function FormItem(props) {
920
871
  " ",
921
872
  computedProps.label
922
873
  ]
923
- }),
924
- computedProps.extra && /* @__PURE__ */ jsx10("div", {
925
- className: "ant-form-item-extra",
926
- children: computedProps.extra
927
- }),
928
- /* @__PURE__ */ jsx10(AntdForm.ErrorList, {
929
- errors
930
- })
931
- ]
932
- })
933
- ]
934
- })
935
- });
874
+ }
875
+ ),
876
+ computedProps.extra && /* @__PURE__ */ jsx10("div", { className: "ant-form-item-extra", children: computedProps.extra }),
877
+ /* @__PURE__ */ jsx10(AntdForm.ErrorList, { errors })
878
+ ] })
879
+ ] })
880
+ }
881
+ );
936
882
  default:
937
883
  return null;
938
884
  }
@@ -943,18 +889,17 @@ FormItem.useStatus = AntdForm.Item.useStatus;
943
889
  import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
944
890
  function Form(props) {
945
891
  var _a, _b;
946
- const [loading, setLoading] = useState6(false);
947
- const [computedProps, setComputedProps] = useState6();
892
+ const [loading, setLoading] = useState7(false);
893
+ const [computedProps, setComputedProps] = useState7();
948
894
  const config = useConfigContext();
949
- const [extendTypes, setExtendTypes] = useState6();
895
+ const [extendTypes, setExtendTypes] = useState7();
950
896
  const [form] = AntdForm2.useForm(props.form);
951
- const [initialValues, setInitialValues] = useState6(props.initialValues);
952
- useEffect5(() => {
897
+ const [initialValues, setInitialValues] = useState7(props.initialValues);
898
+ useEffect6(() => {
953
899
  var _a2, _b2, _c;
954
- const propsCopy = {
955
- ...props,
900
+ const propsCopy = __spreadProps(__spreadValues({}, props), {
956
901
  form
957
- };
902
+ });
958
903
  if (propsCopy.initialValues && ((_a2 = propsCopy.items) == null ? void 0 : _a2.length)) {
959
904
  for (const key in propsCopy.initialValues) {
960
905
  propsCopy.initialValues[key] = transferValue(
@@ -978,10 +923,7 @@ function Form(props) {
978
923
  setLoading(true);
979
924
  try {
980
925
  if (propsCopy.submit && ((_a3 = propsCopy.submit.to) == null ? void 0 : _a3.action)) {
981
- await props.onFinish(values, async (values2) => faas(propsCopy.submit.to.action, propsCopy.submit.to.params ? {
982
- ...values2,
983
- ...propsCopy.submit.to.params
984
- } : values2));
926
+ await props.onFinish(values, async (values2) => faas(propsCopy.submit.to.action, propsCopy.submit.to.params ? __spreadValues(__spreadValues({}, values2), propsCopy.submit.to.params) : values2));
985
927
  } else
986
928
  await props.onFinish(values);
987
929
  } catch (error) {
@@ -992,10 +934,7 @@ function Form(props) {
992
934
  } else if (propsCopy.submit && ((_c = propsCopy.submit.to) == null ? void 0 : _c.action)) {
993
935
  propsCopy.onFinish = async (values) => {
994
936
  setLoading(true);
995
- return faas(propsCopy.submit.to.action, propsCopy.submit.to.params ? {
996
- ...values,
997
- ...propsCopy.submit.to.params
998
- } : values).then((result) => {
937
+ return faas(propsCopy.submit.to.action, propsCopy.submit.to.params ? __spreadValues(__spreadValues({}, values), propsCopy.submit.to.params) : values).then((result) => {
999
938
  if (propsCopy.submit.to.then)
1000
939
  propsCopy.submit.to.then(result);
1001
940
  return result;
@@ -1029,7 +968,7 @@ function Form(props) {
1029
968
  item.onValueChange(changedValues[key], allValues, form);
1030
969
  }
1031
970
  }, [computedProps]);
1032
- useEffect5(() => {
971
+ useEffect6(() => {
1033
972
  if (!initialValues)
1034
973
  return;
1035
974
  console.debug("Form:initialValues", initialValues);
@@ -1038,25 +977,33 @@ function Form(props) {
1038
977
  }, [computedProps]);
1039
978
  if (!computedProps)
1040
979
  return null;
1041
- return /* @__PURE__ */ jsxs3(AntdForm2, {
1042
- ...computedProps,
1043
- onValuesChange,
1044
- children: [
1045
- computedProps.beforeItems,
1046
- (_a = computedProps.items) == null ? void 0 : _a.map((item) => isValidElement(item) ? item : /* @__PURE__ */ jsx11(FormItem, {
1047
- ...item,
1048
- extendTypes
1049
- }, item.id)),
1050
- computedProps.children,
1051
- computedProps.submit !== false && /* @__PURE__ */ jsx11(Button2, {
1052
- htmlType: "submit",
1053
- type: "primary",
1054
- loading,
1055
- children: ((_b = computedProps.submit) == null ? void 0 : _b.text) || config.Form.submit.text
1056
- }),
1057
- computedProps.footer
1058
- ]
1059
- });
980
+ return /* @__PURE__ */ jsxs3(
981
+ AntdForm2,
982
+ __spreadProps(__spreadValues({}, computedProps), {
983
+ onValuesChange,
984
+ children: [
985
+ computedProps.beforeItems,
986
+ (_a = computedProps.items) == null ? void 0 : _a.map((item) => isValidElement(item) ? item : /* @__PURE__ */ jsx11(
987
+ FormItem,
988
+ __spreadProps(__spreadValues({}, item), {
989
+ extendTypes
990
+ }),
991
+ item.id
992
+ )),
993
+ computedProps.children,
994
+ computedProps.submit !== false && /* @__PURE__ */ jsx11(
995
+ Button2,
996
+ {
997
+ htmlType: "submit",
998
+ type: "primary",
999
+ loading,
1000
+ children: ((_b = computedProps.submit) == null ? void 0 : _b.text) || config.Form.submit.text
1001
+ }
1002
+ ),
1003
+ computedProps.footer
1004
+ ]
1005
+ })
1006
+ );
1060
1007
  }
1061
1008
  Form.useForm = AntdForm2.useForm;
1062
1009
  Form.useFormInstance = AntdForm2.useFormInstance;
@@ -1073,11 +1020,9 @@ import { jsx as jsx12 } from "react/jsx-runtime";
1073
1020
  function Link(props) {
1074
1021
  var _a, _b, _c, _d;
1075
1022
  const { Link: Link2 } = useConfigContext();
1076
- let style = {
1077
- ...Link2.style || {},
1078
- cursor: "pointer",
1079
- ...props.style
1080
- };
1023
+ let style = __spreadValues(__spreadProps(__spreadValues({}, Link2.style || {}), {
1024
+ cursor: "pointer"
1025
+ }), props.style);
1081
1026
  if (props.block)
1082
1027
  style = Object.assign({
1083
1028
  display: "block",
@@ -1085,36 +1030,49 @@ function Link(props) {
1085
1030
  }, style);
1086
1031
  if (props.href.startsWith("http")) {
1087
1032
  if (props.button)
1088
- return /* @__PURE__ */ jsx12(Button3, {
1089
- ...props.button,
1033
+ return /* @__PURE__ */ jsx12(
1034
+ Button3,
1035
+ __spreadProps(__spreadValues({}, props.button), {
1036
+ target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
1037
+ style,
1038
+ href: props.href,
1039
+ children: (_a = props.text) != null ? _a : props.children
1040
+ })
1041
+ );
1042
+ return /* @__PURE__ */ jsx12(
1043
+ "a",
1044
+ {
1045
+ href: props.href,
1090
1046
  target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
1091
1047
  style,
1092
- href: props.href,
1093
- children: (_a = props.text) != null ? _a : props.children
1094
- });
1095
- return /* @__PURE__ */ jsx12("a", {
1096
- href: props.href,
1097
- target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
1098
- style,
1099
- children: (_b = props.text) != null ? _b : props.children
1100
- });
1048
+ children: (_b = props.text) != null ? _b : props.children
1049
+ }
1050
+ );
1101
1051
  }
1102
1052
  if (props.button)
1103
- return /* @__PURE__ */ jsx12(RouterLink, {
1053
+ return /* @__PURE__ */ jsx12(
1054
+ RouterLink,
1055
+ {
1056
+ to: props.href,
1057
+ target: props.target || (Link2 == null ? void 0 : Link2.target),
1058
+ children: /* @__PURE__ */ jsx12(
1059
+ Button3,
1060
+ __spreadProps(__spreadValues({}, props.button), {
1061
+ style,
1062
+ children: (_c = props.text) != null ? _c : props.children
1063
+ })
1064
+ )
1065
+ }
1066
+ );
1067
+ return /* @__PURE__ */ jsx12(
1068
+ RouterLink,
1069
+ {
1104
1070
  to: props.href,
1105
1071
  target: props.target || (Link2 == null ? void 0 : Link2.target),
1106
- children: /* @__PURE__ */ jsx12(Button3, {
1107
- ...props.button,
1108
- style,
1109
- children: (_c = props.text) != null ? _c : props.children
1110
- })
1111
- });
1112
- return /* @__PURE__ */ jsx12(RouterLink, {
1113
- to: props.href,
1114
- target: props.target || (Link2 == null ? void 0 : Link2.target),
1115
- style,
1116
- children: (_d = props.text) != null ? _d : props.children
1117
- });
1072
+ style,
1073
+ children: (_d = props.text) != null ? _d : props.children
1074
+ }
1075
+ );
1118
1076
  }
1119
1077
 
1120
1078
  // src/Routers.tsx
@@ -1130,39 +1088,39 @@ import { lazy } from "react";
1130
1088
  import { jsx as jsx13, jsxs as jsxs4 } from "react/jsx-runtime";
1131
1089
  function PageNotFound() {
1132
1090
  const config = useConfigContext();
1133
- return /* @__PURE__ */ jsx13(Result, {
1134
- status: "404",
1135
- title: config.common.pageNotFound
1136
- });
1091
+ return /* @__PURE__ */ jsx13(
1092
+ Result,
1093
+ {
1094
+ status: "404",
1095
+ title: config.common.pageNotFound
1096
+ }
1097
+ );
1137
1098
  }
1138
1099
  function Routes(props) {
1139
- return /* @__PURE__ */ jsxs4(OriginRoutes, {
1140
- children: [
1141
- props.routes.map((r) => /* @__PURE__ */ jsx13(Route, {
1142
- ...r,
1143
- element: r.element || /* @__PURE__ */ jsx13(Suspense, {
1144
- fallback: props.fallback || /* @__PURE__ */ jsx13("div", {
1145
- style: { padding: "24px" },
1146
- children: /* @__PURE__ */ jsx13(Skeleton, {
1147
- active: true
1148
- })
1149
- }),
1150
- children: /* @__PURE__ */ jsx13(r.page, {})
1151
- })
1152
- }, r.path)),
1153
- /* @__PURE__ */ jsx13(Route, {
1100
+ return /* @__PURE__ */ jsxs4(OriginRoutes, { children: [
1101
+ props.routes.map((r) => /* @__PURE__ */ jsx13(
1102
+ Route,
1103
+ __spreadProps(__spreadValues({}, r), {
1104
+ element: r.element || /* @__PURE__ */ jsx13(Suspense, { fallback: props.fallback || /* @__PURE__ */ jsx13("div", { style: { padding: "24px" }, children: /* @__PURE__ */ jsx13(Skeleton, { active: true }) }), children: /* @__PURE__ */ jsx13(r.page, {}) })
1105
+ }),
1106
+ r.path
1107
+ )),
1108
+ /* @__PURE__ */ jsx13(
1109
+ Route,
1110
+ {
1154
1111
  path: "*",
1155
1112
  element: props.notFound || /* @__PURE__ */ jsx13(PageNotFound, {})
1156
- }, "*")
1157
- ]
1158
- });
1113
+ },
1114
+ "*"
1115
+ )
1116
+ ] });
1159
1117
  }
1160
1118
 
1161
1119
  // src/Table.tsx
1162
1120
  import {
1163
- useState as useState7,
1164
- useEffect as useEffect6,
1165
- cloneElement as cloneElement3
1121
+ useState as useState8,
1122
+ useEffect as useEffect7,
1123
+ cloneElement as cloneElement4
1166
1124
  } from "react";
1167
1125
  import {
1168
1126
  Table as AntdTable,
@@ -1204,7 +1162,7 @@ function processValue(item, value) {
1204
1162
  return value;
1205
1163
  }
1206
1164
  function Table(props) {
1207
- const [columns, setColumns] = useState7();
1165
+ const [columns, setColumns] = useState8();
1208
1166
  const { common: common2 } = useConfigContext();
1209
1167
  const generateFilterDropdown = (item) => {
1210
1168
  if (typeof item.filterDropdown !== "undefined")
@@ -1221,35 +1179,41 @@ function Table(props) {
1221
1179
  setSelectedKeys,
1222
1180
  selectedKeys,
1223
1181
  confirm
1224
- }) => /* @__PURE__ */ jsx14("div", {
1225
- style: {
1226
- padding: 8,
1227
- width: "200px"
1228
- },
1229
- onKeyDown: (e) => e.stopPropagation(),
1230
- children: /* @__PURE__ */ jsx14(Select2, {
1231
- options: item.options,
1232
- allowClear: true,
1233
- showSearch: true,
1234
- style: { width: "100%" },
1235
- placeholder: `${common2.search} ${item.title}`,
1236
- value: selectedKeys,
1237
- onChange: (v) => {
1238
- setSelectedKeys((v == null ? void 0 : v.length) ? v : []);
1239
- confirm();
1182
+ }) => /* @__PURE__ */ jsx14(
1183
+ "div",
1184
+ {
1185
+ style: {
1186
+ padding: 8,
1187
+ width: "200px"
1240
1188
  },
1241
- mode: "multiple",
1242
- filterOption: (input, option) => {
1243
- if (!input || !option || !option.label)
1244
- return true;
1245
- input = input.trim();
1246
- return option.value === input || option.label.toString().toLowerCase().includes(input.toLowerCase());
1247
- }
1248
- })
1249
- });
1189
+ onKeyDown: (e) => e.stopPropagation(),
1190
+ children: /* @__PURE__ */ jsx14(
1191
+ Select2,
1192
+ {
1193
+ options: item.options,
1194
+ allowClear: true,
1195
+ showSearch: true,
1196
+ style: { width: "100%" },
1197
+ placeholder: `${common2.search} ${item.title}`,
1198
+ value: selectedKeys,
1199
+ onChange: (v) => {
1200
+ setSelectedKeys((v == null ? void 0 : v.length) ? v : []);
1201
+ confirm();
1202
+ },
1203
+ mode: "multiple",
1204
+ filterOption: (input, option) => {
1205
+ if (!input || !option || !option.label)
1206
+ return true;
1207
+ input = input.trim();
1208
+ return option.value === input || option.label.toString().toLowerCase().includes(input.toLowerCase());
1209
+ }
1210
+ }
1211
+ )
1212
+ }
1213
+ );
1250
1214
  return item;
1251
1215
  };
1252
- useEffect6(() => {
1216
+ useEffect7(() => {
1253
1217
  var _a;
1254
1218
  for (const item of props.items) {
1255
1219
  if (!item.key)
@@ -1274,7 +1238,7 @@ function Table(props) {
1274
1238
  if (item.tableChildren === null)
1275
1239
  item.render = () => null;
1276
1240
  else if (item.tableChildren)
1277
- item.render = (value, values) => cloneElement3(
1241
+ item.render = (value, values) => cloneElement4(
1278
1242
  item.tableChildren,
1279
1243
  {
1280
1244
  scene: "table",
@@ -1285,7 +1249,7 @@ function Table(props) {
1285
1249
  else if (item.children === null)
1286
1250
  item.render = () => null;
1287
1251
  else if (item.children)
1288
- item.render = (value, values) => cloneElement3(
1252
+ item.render = (value, values) => cloneElement4(
1289
1253
  item.children,
1290
1254
  {
1291
1255
  scene: "table",
@@ -1295,7 +1259,7 @@ function Table(props) {
1295
1259
  );
1296
1260
  if (props.extendTypes && props.extendTypes[item.type]) {
1297
1261
  if (props.extendTypes[item.type].children)
1298
- item.render = (value, values) => cloneElement3(
1262
+ item.render = (value, values) => cloneElement4(
1299
1263
  props.extendTypes[item.type].children,
1300
1264
  {
1301
1265
  scene: "table",
@@ -1328,19 +1292,22 @@ function Table(props) {
1328
1292
  setSelectedKeys,
1329
1293
  confirm,
1330
1294
  clearFilters
1331
- }) => /* @__PURE__ */ jsx14(Input2.Search, {
1332
- placeholder: `${common2.search} ${item.title}`,
1333
- allowClear: true,
1334
- onSearch: (v) => {
1335
- if (v) {
1336
- setSelectedKeys([v]);
1337
- } else {
1338
- setSelectedKeys([]);
1339
- clearFilters();
1295
+ }) => /* @__PURE__ */ jsx14(
1296
+ Input2.Search,
1297
+ {
1298
+ placeholder: `${common2.search} ${item.title}`,
1299
+ allowClear: true,
1300
+ onSearch: (v) => {
1301
+ if (v) {
1302
+ setSelectedKeys([v]);
1303
+ } else {
1304
+ setSelectedKeys([]);
1305
+ clearFilters();
1306
+ }
1307
+ confirm();
1340
1308
  }
1341
- confirm();
1342
1309
  }
1343
- });
1310
+ );
1344
1311
  break;
1345
1312
  case "string[]":
1346
1313
  if (!item.render)
@@ -1360,19 +1327,22 @@ function Table(props) {
1360
1327
  setSelectedKeys,
1361
1328
  confirm,
1362
1329
  clearFilters
1363
- }) => /* @__PURE__ */ jsx14(Input2.Search, {
1364
- placeholder: `${common2.search} ${item.title}`,
1365
- allowClear: true,
1366
- onSearch: (v) => {
1367
- if (v) {
1368
- setSelectedKeys([v]);
1369
- } else {
1370
- setSelectedKeys([]);
1371
- clearFilters();
1330
+ }) => /* @__PURE__ */ jsx14(
1331
+ Input2.Search,
1332
+ {
1333
+ placeholder: `${common2.search} ${item.title}`,
1334
+ allowClear: true,
1335
+ onSearch: (v) => {
1336
+ if (v) {
1337
+ setSelectedKeys([v]);
1338
+ } else {
1339
+ setSelectedKeys([]);
1340
+ clearFilters();
1341
+ }
1342
+ confirm();
1372
1343
  }
1373
- confirm();
1374
1344
  }
1375
- });
1345
+ );
1376
1346
  break;
1377
1347
  case "number":
1378
1348
  if (!item.render)
@@ -1394,19 +1364,22 @@ function Table(props) {
1394
1364
  setSelectedKeys,
1395
1365
  confirm,
1396
1366
  clearFilters
1397
- }) => /* @__PURE__ */ jsx14(Input2.Search, {
1398
- placeholder: `${common2.search} ${item.title}`,
1399
- allowClear: true,
1400
- onSearch: (v) => {
1401
- if (v) {
1402
- setSelectedKeys([Number(v)]);
1403
- } else {
1404
- setSelectedKeys([]);
1405
- clearFilters();
1367
+ }) => /* @__PURE__ */ jsx14(
1368
+ Input2.Search,
1369
+ {
1370
+ placeholder: `${common2.search} ${item.title}`,
1371
+ allowClear: true,
1372
+ onSearch: (v) => {
1373
+ if (v) {
1374
+ setSelectedKeys([Number(v)]);
1375
+ } else {
1376
+ setSelectedKeys([]);
1377
+ clearFilters();
1378
+ }
1379
+ confirm();
1406
1380
  }
1407
- confirm();
1408
1381
  }
1409
- });
1382
+ );
1410
1383
  break;
1411
1384
  case "number[]":
1412
1385
  if (!item.render)
@@ -1426,79 +1399,66 @@ function Table(props) {
1426
1399
  setSelectedKeys,
1427
1400
  confirm,
1428
1401
  clearFilters
1429
- }) => /* @__PURE__ */ jsx14(Input2.Search, {
1430
- placeholder: `${common2.search} ${item.title}`,
1431
- allowClear: true,
1432
- onSearch: (v) => {
1433
- if (v) {
1434
- setSelectedKeys([Number(v)]);
1435
- } else {
1436
- setSelectedKeys([]);
1437
- clearFilters();
1402
+ }) => /* @__PURE__ */ jsx14(
1403
+ Input2.Search,
1404
+ {
1405
+ placeholder: `${common2.search} ${item.title}`,
1406
+ allowClear: true,
1407
+ onSearch: (v) => {
1408
+ if (v) {
1409
+ setSelectedKeys([Number(v)]);
1410
+ } else {
1411
+ setSelectedKeys([]);
1412
+ clearFilters();
1413
+ }
1414
+ confirm();
1438
1415
  }
1439
- confirm();
1440
1416
  }
1441
- });
1417
+ );
1442
1418
  break;
1443
1419
  case "boolean":
1444
1420
  if (!item.render)
1445
- item.render = (value) => isNil2(value) ? /* @__PURE__ */ jsx14(Blank, {}) : value ? /* @__PURE__ */ jsx14(CheckOutlined2, {
1446
- style: {
1447
- marginTop: "4px",
1448
- color: "#52c41a"
1449
- }
1450
- }) : /* @__PURE__ */ jsx14(CloseOutlined2, {
1451
- style: {
1452
- marginTop: "4px",
1453
- color: "#ff4d4f"
1454
- }
1455
- });
1421
+ item.render = (value) => isNil2(value) ? /* @__PURE__ */ jsx14(Blank, {}) : value ? /* @__PURE__ */ jsx14(CheckOutlined2, { style: {
1422
+ marginTop: "4px",
1423
+ color: "#52c41a"
1424
+ } }) : /* @__PURE__ */ jsx14(CloseOutlined2, { style: {
1425
+ marginTop: "4px",
1426
+ color: "#ff4d4f"
1427
+ } });
1456
1428
  if (item.filterDropdown !== false)
1457
1429
  item.filterDropdown = ({
1458
1430
  setSelectedKeys,
1459
1431
  selectedKeys,
1460
1432
  confirm
1461
- }) => /* @__PURE__ */ jsxs5(Radio.Group, {
1462
- style: { padding: 8 },
1463
- buttonStyle: "solid",
1464
- value: JSON.stringify(selectedKeys[0]),
1465
- onChange: (e) => {
1466
- const Values = {
1467
- true: true,
1468
- false: false,
1469
- null: null
1470
- };
1471
- setSelectedKeys(e.target.value ? [Values[e.target.value]] : []);
1472
- confirm();
1473
- },
1474
- children: [
1475
- /* @__PURE__ */ jsx14(Radio.Button, {
1476
- children: common2.all
1477
- }),
1478
- /* @__PURE__ */ jsx14(Radio.Button, {
1479
- value: "true",
1480
- children: /* @__PURE__ */ jsx14(CheckOutlined2, {
1481
- style: {
1482
- color: "#52c41a",
1483
- verticalAlign: "middle"
1484
- }
1485
- })
1486
- }),
1487
- /* @__PURE__ */ jsx14(Radio.Button, {
1488
- value: "false",
1489
- children: /* @__PURE__ */ jsx14(CloseOutlined2, {
1490
- style: {
1491
- verticalAlign: "middle",
1492
- color: "#ff4d4f"
1493
- }
1494
- })
1495
- }),
1496
- /* @__PURE__ */ jsx14(Radio.Button, {
1497
- value: "null",
1498
- children: common2.blank
1499
- })
1500
- ]
1501
- });
1433
+ }) => /* @__PURE__ */ jsxs5(
1434
+ Radio.Group,
1435
+ {
1436
+ style: { padding: 8 },
1437
+ buttonStyle: "solid",
1438
+ value: JSON.stringify(selectedKeys[0]),
1439
+ onChange: (e) => {
1440
+ const Values = {
1441
+ true: true,
1442
+ false: false,
1443
+ null: null
1444
+ };
1445
+ setSelectedKeys(e.target.value ? [Values[e.target.value]] : []);
1446
+ confirm();
1447
+ },
1448
+ children: [
1449
+ /* @__PURE__ */ jsx14(Radio.Button, { children: common2.all }),
1450
+ /* @__PURE__ */ jsx14(Radio.Button, { value: "true", children: /* @__PURE__ */ jsx14(CheckOutlined2, { style: {
1451
+ color: "#52c41a",
1452
+ verticalAlign: "middle"
1453
+ } }) }),
1454
+ /* @__PURE__ */ jsx14(Radio.Button, { value: "false", children: /* @__PURE__ */ jsx14(CloseOutlined2, { style: {
1455
+ verticalAlign: "middle",
1456
+ color: "#ff4d4f"
1457
+ } }) }),
1458
+ /* @__PURE__ */ jsx14(Radio.Button, { value: "null", children: common2.blank })
1459
+ ]
1460
+ }
1461
+ );
1502
1462
  if (!item.onFilter)
1503
1463
  item.onFilter = (value, row) => {
1504
1464
  switch (value) {
@@ -1526,12 +1486,15 @@ function Table(props) {
1526
1486
  item.filterDropdown = ({
1527
1487
  setSelectedKeys,
1528
1488
  confirm
1529
- }) => /* @__PURE__ */ jsx14(DatePicker2.RangePicker, {
1530
- onChange: (dates) => {
1531
- setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
1532
- confirm();
1489
+ }) => /* @__PURE__ */ jsx14(
1490
+ DatePicker2.RangePicker,
1491
+ {
1492
+ onChange: (dates) => {
1493
+ setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
1494
+ confirm();
1495
+ }
1533
1496
  }
1534
- });
1497
+ );
1535
1498
  if (!item.onFilter)
1536
1499
  item.onFilter = (value, row) => {
1537
1500
  if (isNil2(value[0]))
@@ -1556,12 +1519,15 @@ function Table(props) {
1556
1519
  item.filterDropdown = ({
1557
1520
  setSelectedKeys,
1558
1521
  confirm
1559
- }) => /* @__PURE__ */ jsx14(DatePicker2.RangePicker, {
1560
- onChange: (dates) => {
1561
- setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
1562
- confirm();
1522
+ }) => /* @__PURE__ */ jsx14(
1523
+ DatePicker2.RangePicker,
1524
+ {
1525
+ onChange: (dates) => {
1526
+ setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
1527
+ confirm();
1528
+ }
1563
1529
  }
1564
- });
1530
+ );
1565
1531
  if (!item.onFilter)
1566
1532
  item.onFilter = (value, row) => {
1567
1533
  if (isNil2(value[0]))
@@ -1573,21 +1539,26 @@ function Table(props) {
1573
1539
  break;
1574
1540
  case "object":
1575
1541
  if (!item.render)
1576
- item.render = (value) => /* @__PURE__ */ jsx14(Description, {
1577
- items: item.object,
1578
- dataSource: value || {},
1579
- column: 1
1580
- });
1542
+ item.render = (value) => /* @__PURE__ */ jsx14(
1543
+ Description,
1544
+ {
1545
+ items: item.object,
1546
+ dataSource: value || {},
1547
+ column: 1
1548
+ }
1549
+ );
1581
1550
  break;
1582
1551
  case "object[]":
1583
1552
  if (!item.render)
1584
- item.render = (value) => /* @__PURE__ */ jsx14(Fragment5, {
1585
- children: value.map((v, i) => /* @__PURE__ */ jsx14(Description, {
1553
+ item.render = (value) => /* @__PURE__ */ jsx14(Fragment5, { children: value.map((v, i) => /* @__PURE__ */ jsx14(
1554
+ Description,
1555
+ {
1586
1556
  items: item.object,
1587
1557
  dataSource: v || [],
1588
1558
  column: 1
1589
- }, i))
1590
- });
1559
+ },
1560
+ i
1561
+ )) });
1591
1562
  break;
1592
1563
  default:
1593
1564
  if (!item.render)
@@ -1603,7 +1574,7 @@ function Table(props) {
1603
1574
  }
1604
1575
  setColumns(props.items);
1605
1576
  }, [JSON.stringify(props.items)]);
1606
- useEffect6(() => {
1577
+ useEffect7(() => {
1607
1578
  if (!props.dataSource || !columns)
1608
1579
  return;
1609
1580
  for (const column of columns) {
@@ -1626,19 +1597,26 @@ function Table(props) {
1626
1597
  if (!columns)
1627
1598
  return null;
1628
1599
  if (props.dataSource)
1629
- return /* @__PURE__ */ jsx14(AntdTable, {
1630
- ...props,
1631
- rowKey: props.rowKey || "id",
1632
- columns,
1633
- dataSource: props.dataSource
1634
- });
1635
- return /* @__PURE__ */ jsx14(FaasDataWrapper, {
1636
- ...props.faasData,
1637
- children: /* @__PURE__ */ jsx14(FaasDataTable, {
1638
- props,
1639
- columns
1600
+ return /* @__PURE__ */ jsx14(
1601
+ AntdTable,
1602
+ __spreadProps(__spreadValues({}, props), {
1603
+ rowKey: props.rowKey || "id",
1604
+ columns,
1605
+ dataSource: props.dataSource
1606
+ })
1607
+ );
1608
+ return /* @__PURE__ */ jsx14(
1609
+ FaasDataWrapper2,
1610
+ __spreadProps(__spreadValues({}, props.faasData), {
1611
+ children: /* @__PURE__ */ jsx14(
1612
+ FaasDataTable,
1613
+ {
1614
+ props,
1615
+ columns
1616
+ }
1617
+ )
1640
1618
  })
1641
- });
1619
+ );
1642
1620
  }
1643
1621
  function FaasDataTable({
1644
1622
  props,
@@ -1647,8 +1625,8 @@ function FaasDataTable({
1647
1625
  params,
1648
1626
  reload
1649
1627
  }) {
1650
- const [currentColumns, setCurrentColumns] = useState7(columns);
1651
- useEffect6(() => {
1628
+ const [currentColumns, setCurrentColumns] = useState8(columns);
1629
+ useEffect7(() => {
1652
1630
  if (!data || Array.isArray(data))
1653
1631
  return;
1654
1632
  setCurrentColumns((prev) => {
@@ -1684,78 +1662,98 @@ function FaasDataTable({
1684
1662
  });
1685
1663
  }, [columns, data]);
1686
1664
  if (!data)
1687
- return /* @__PURE__ */ jsx14(AntdTable, {
1688
- ...props,
1689
- loading: props.loading,
1690
- rowKey: props.rowKey || "id",
1691
- columns: currentColumns,
1692
- dataSource: []
1693
- });
1665
+ return /* @__PURE__ */ jsx14(
1666
+ AntdTable,
1667
+ __spreadProps(__spreadValues({}, props), {
1668
+ loading: props.loading,
1669
+ rowKey: props.rowKey || "id",
1670
+ columns: currentColumns,
1671
+ dataSource: []
1672
+ })
1673
+ );
1694
1674
  if (Array.isArray(data))
1695
- return /* @__PURE__ */ jsx14(AntdTable, {
1696
- ...props,
1675
+ return /* @__PURE__ */ jsx14(
1676
+ AntdTable,
1677
+ __spreadProps(__spreadValues({}, props), {
1678
+ loading: props.loading,
1679
+ rowKey: props.rowKey || "id",
1680
+ columns: currentColumns,
1681
+ dataSource: data
1682
+ })
1683
+ );
1684
+ return /* @__PURE__ */ jsx14(
1685
+ AntdTable,
1686
+ __spreadProps(__spreadValues({}, props), {
1697
1687
  loading: props.loading,
1698
1688
  rowKey: props.rowKey || "id",
1699
1689
  columns: currentColumns,
1700
- dataSource: data
1701
- });
1702
- return /* @__PURE__ */ jsx14(AntdTable, {
1703
- ...props,
1704
- loading: props.loading,
1705
- rowKey: props.rowKey || "id",
1706
- columns: currentColumns,
1707
- dataSource: data.rows,
1708
- pagination: {
1709
- ...props.pagination,
1710
- ...data.pagination
1711
- },
1712
- onChange: (pagination, filters, sorter, extra) => {
1713
- if (props.onChange) {
1714
- const processed = props.onChange(pagination, filters, sorter, extra);
1715
- reload({
1716
- ...params,
1717
- pagination: processed.pagination,
1718
- filters: processed.filters,
1719
- sorter: processed.sorter
1720
- });
1721
- return;
1690
+ dataSource: data.rows,
1691
+ pagination: __spreadValues(__spreadValues({}, props.pagination), data.pagination),
1692
+ onChange: (pagination, filters, sorter, extra) => {
1693
+ if (props.onChange) {
1694
+ const processed = props.onChange(pagination, filters, sorter, extra);
1695
+ reload(__spreadProps(__spreadValues({}, params), {
1696
+ pagination: processed.pagination,
1697
+ filters: processed.filters,
1698
+ sorter: processed.sorter
1699
+ }));
1700
+ return;
1701
+ }
1702
+ reload(__spreadProps(__spreadValues({}, params), {
1703
+ pagination,
1704
+ filters,
1705
+ sorter
1706
+ }));
1722
1707
  }
1723
- reload({
1724
- ...params,
1725
- pagination,
1726
- filters,
1727
- sorter
1728
- });
1729
- }
1730
- });
1708
+ })
1709
+ );
1710
+ }
1711
+
1712
+ // src/Tabs.tsx
1713
+ import { Tabs as Origin } from "antd";
1714
+ import { useEffect as useEffect8, useState as useState9 } from "react";
1715
+ import { jsx as jsx15 } from "react/jsx-runtime";
1716
+ function Tabs(props) {
1717
+ const [items, setItems] = useState9([]);
1718
+ useEffect8(() => {
1719
+ setItems(props.items.filter(Boolean).map((item) => __spreadProps(__spreadValues({}, item), {
1720
+ key: item.id,
1721
+ label: item.title || item.id
1722
+ })));
1723
+ }, [props.items.filter(Boolean).map((i) => i.id).join("")]);
1724
+ return /* @__PURE__ */ jsx15(
1725
+ Origin,
1726
+ __spreadProps(__spreadValues({}, props), {
1727
+ items
1728
+ })
1729
+ );
1731
1730
  }
1732
1731
 
1733
1732
  // src/Title.tsx
1734
- import { useEffect as useEffect7, cloneElement as cloneElement4 } from "react";
1735
- import { Fragment as Fragment6, jsx as jsx15 } from "react/jsx-runtime";
1733
+ import { useEffect as useEffect9, cloneElement as cloneElement5 } from "react";
1734
+ import { Fragment as Fragment6, jsx as jsx16 } from "react/jsx-runtime";
1736
1735
  function Title(props) {
1737
1736
  const { Title: Title2 } = useConfigContext();
1738
- useEffect7(() => {
1737
+ useEffect9(() => {
1739
1738
  const title = Array.isArray(props.title) ? props.title : [props.title];
1740
1739
  document.title = title.concat(props.suffix || Title2.suffix).filter((t) => !!t).join(props.separator || Title2.separator);
1741
1740
  }, [props]);
1742
1741
  if (props.h1) {
1743
1742
  if (typeof props.h1 === "boolean")
1744
- return /* @__PURE__ */ jsx15("h1", {
1743
+ return /* @__PURE__ */ jsx16("h1", { children: Array.isArray(props.title) ? props.title[0] : props.title });
1744
+ return /* @__PURE__ */ jsx16(
1745
+ "h1",
1746
+ {
1747
+ className: props.h1.className,
1748
+ style: props.h1.style,
1745
1749
  children: Array.isArray(props.title) ? props.title[0] : props.title
1746
- });
1747
- return /* @__PURE__ */ jsx15("h1", {
1748
- className: props.h1.className,
1749
- style: props.h1.style,
1750
- children: Array.isArray(props.title) ? props.title[0] : props.title
1751
- });
1750
+ }
1751
+ );
1752
1752
  }
1753
1753
  if (props.plain)
1754
- return /* @__PURE__ */ jsx15(Fragment6, {
1755
- children: Array.isArray(props.title) ? props.title[0] : props.title
1756
- });
1754
+ return /* @__PURE__ */ jsx16(Fragment6, { children: Array.isArray(props.title) ? props.title[0] : props.title });
1757
1755
  if (props.children)
1758
- return cloneElement4(props.children, { title: props.title });
1756
+ return cloneElement5(props.children, { title: props.title });
1759
1757
  return null;
1760
1758
  }
1761
1759
  export {
@@ -1766,7 +1764,7 @@ export {
1766
1764
  Description,
1767
1765
  Drawer,
1768
1766
  ErrorBoundary,
1769
- FaasDataWrapper,
1767
+ FaasDataWrapper2 as FaasDataWrapper,
1770
1768
  Form,
1771
1769
  FormItem,
1772
1770
  Link,
@@ -1775,6 +1773,7 @@ export {
1775
1773
  PageNotFound,
1776
1774
  Routes,
1777
1775
  Table,
1776
+ Tabs,
1778
1777
  Title,
1779
1778
  lazy,
1780
1779
  transferOptions,