@faasjs/ant-design 0.0.3-beta.86 → 0.0.3-beta.87

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,24 +1,17 @@
1
- // src/index.ts
2
- import { faas as faas2, useFaas } from "@faasjs/react";
3
-
4
- // src/App.tsx
5
- import {
6
- ConfigProvider,
7
- message,
8
- notification
9
- } from "antd";
10
- import { StyleProvider, legacyLogicalPropertiesTransformer } from "@ant-design/cssinjs";
11
- import {
12
- createContext,
13
- useContext,
14
- useEffect,
15
- useMemo
16
- } from "react";
1
+ import { FaasDataWrapper as FaasDataWrapper$1, faas } from '@faasjs/react';
2
+ export { faas, useFaas } from '@faasjs/react';
3
+ import { Form as Form$1, Modal, Drawer, message, notification, ConfigProvider, Typography, Spin, Descriptions, Alert, Input, Button, Row, Col, TimePicker, DatePicker, Switch, Select, InputNumber, Radio, Result, Skeleton, Table as Table$1, Tabs as Tabs$1, Space } from 'antd';
4
+ export { Drawer, Modal } from 'antd';
5
+ import { StyleProvider, legacyLogicalPropertiesTransformer } from '@ant-design/cssinjs';
6
+ import { createContext, useState, useMemo, useContext, useEffect, Component, cloneElement, useCallback, isValidElement, Suspense } from 'react';
7
+ export { lazy } from 'react';
8
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
+ import { BrowserRouter, Link as Link$1, Routes as Routes$1, Route, useLocation } from 'react-router-dom';
10
+ import { defaultsDeep, isNil, upperFirst, isFunction, uniqBy } from 'lodash-es';
11
+ import dayjs2 from 'dayjs';
12
+ import { PlusOutlined, MinusCircleOutlined, CheckOutlined, CloseOutlined } from '@ant-design/icons';
17
13
 
18
- // src/Modal.tsx
19
- import { Modal } from "antd";
20
- import { useState } from "react";
21
- import { jsx } from "react/jsx-runtime";
14
+ // src/index.ts
22
15
  function useModal(init) {
23
16
  const [props, setProps] = useState({
24
17
  open: false,
@@ -29,9 +22,7 @@ function useModal(init) {
29
22
  ...init
30
23
  });
31
24
  return {
32
- modal: /* @__PURE__ */ jsx(Modal, {
33
- ...props
34
- }),
25
+ modal: /* @__PURE__ */ jsx(Modal, { ...props }),
35
26
  modalProps: props,
36
27
  setModalProps(changes) {
37
28
  setProps((prev) => ({
@@ -41,13 +32,8 @@ function useModal(init) {
41
32
  }
42
33
  };
43
34
  }
44
-
45
- // src/Drawer.tsx
46
- import { Drawer } from "antd";
47
- import { useState as useState2 } from "react";
48
- import { jsx as jsx2 } from "react/jsx-runtime";
49
35
  function useDrawer(init) {
50
- const [props, setProps] = useState2({
36
+ const [props, setProps] = useState({
51
37
  open: false,
52
38
  onClose: () => setProps((prev) => ({
53
39
  ...prev,
@@ -56,9 +42,7 @@ function useDrawer(init) {
56
42
  ...init
57
43
  });
58
44
  return {
59
- drawer: /* @__PURE__ */ jsx2(Drawer, {
60
- ...props
61
- }),
45
+ drawer: /* @__PURE__ */ jsx(Drawer, { ...props }),
62
46
  drawerProps: props,
63
47
  setDrawerProps(changes) {
64
48
  setProps((prev) => ({
@@ -68,10 +52,6 @@ function useDrawer(init) {
68
52
  }
69
53
  };
70
54
  }
71
-
72
- // src/App.tsx
73
- import { BrowserRouter, useLocation } from "react-router-dom";
74
- import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
75
55
  var AppContext = createContext({
76
56
  message: {},
77
57
  notification: {},
@@ -86,9 +66,7 @@ function RoutesApp(props) {
86
66
  setDrawerProps({ open: false });
87
67
  setModalProps({ open: false });
88
68
  }, [location]);
89
- return /* @__PURE__ */ jsx3(Fragment, {
90
- children: props.children
91
- });
69
+ return /* @__PURE__ */ jsx(Fragment, { children: props.children });
92
70
  }
93
71
  function App(props) {
94
72
  const [messageApi, messageContextHolder] = message.useMessage();
@@ -109,49 +87,27 @@ function App(props) {
109
87
  setDrawerProps
110
88
  ]
111
89
  );
112
- return /* @__PURE__ */ jsx3(StyleProvider, {
113
- ...Object.assign(props.styleProviderProps || {}, {
114
- hashPriority: "high",
115
- 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
- })
134
- })
135
- });
90
+ return /* @__PURE__ */ jsx(
91
+ StyleProvider,
92
+ {
93
+ ...Object.assign(props.styleProviderProps || {}, {
94
+ hashPriority: "high",
95
+ transformers: [legacyLogicalPropertiesTransformer]
96
+ }),
97
+ children: /* @__PURE__ */ jsx(ConfigProvider, { ...props.configProviderProps, children: /* @__PURE__ */ jsx(AppContext.Provider, { value: memoizedContextValue, children: /* @__PURE__ */ jsxs(BrowserRouter, { ...props.browserRouterProps, children: [
98
+ messageContextHolder,
99
+ notificationContextHolder,
100
+ modal,
101
+ drawer,
102
+ /* @__PURE__ */ jsx(RoutesApp, { children: props.children })
103
+ ] }) }) })
104
+ }
105
+ );
136
106
  }
137
107
  function useApp() {
138
108
  return useContext(AppContext);
139
109
  }
140
110
  App.useApp = useApp;
141
-
142
- // src/Blank.tsx
143
- import { Typography } from "antd";
144
- import { isNil } from "lodash-es";
145
-
146
- // src/Config.tsx
147
- import {
148
- createContext as createContext2,
149
- useContext as useContext2,
150
- useEffect as useEffect2,
151
- useState as useState3
152
- } from "react";
153
- import { defaultsDeep } from "lodash-es";
154
- import { jsx as jsx4 } from "react/jsx-runtime";
155
111
  var isZH = /^zh/i.test(navigator.language);
156
112
  var zh = {
157
113
  lang: "zh",
@@ -190,13 +146,13 @@ var baseConfig = {
190
146
  },
191
147
  Link: { style: {} }
192
148
  };
193
- var ConfigContext = createContext2(baseConfig);
149
+ var ConfigContext = createContext(baseConfig);
194
150
  function ConfigProvider2({
195
151
  config,
196
152
  children
197
153
  }) {
198
- const [values, setValues] = useState3(baseConfig);
199
- useEffect2(() => {
154
+ const [values, setValues] = useState(baseConfig);
155
+ useEffect(() => {
200
156
  if (config.lang === "zh") {
201
157
  setValues(defaultsDeep(config, {
202
158
  lang: "zh",
@@ -207,28 +163,15 @@ function ConfigProvider2({
207
163
  } else
208
164
  setValues(defaultsDeep(config, values));
209
165
  }, []);
210
- return /* @__PURE__ */ jsx4(ConfigContext.Provider, {
211
- value: values,
212
- children
213
- });
166
+ return /* @__PURE__ */ jsx(ConfigContext.Provider, { value: values, children });
214
167
  }
215
168
  function useConfigContext() {
216
- return useContext2(ConfigContext);
169
+ return useContext(ConfigContext);
217
170
  }
218
-
219
- // src/Blank.tsx
220
- import { jsx as jsx5 } from "react/jsx-runtime";
221
171
  function Blank(options) {
222
172
  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;
173
+ return !options || isNil(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ jsx(Typography.Text, { disabled: true, children: (options == null ? void 0 : options.text) || Blank2.text }) : options.value;
227
174
  }
228
-
229
- // src/data.ts
230
- import { upperFirst } from "lodash-es";
231
- import dayjs from "dayjs";
232
175
  function transferOptions(options) {
233
176
  if (!options)
234
177
  return [];
@@ -247,71 +190,39 @@ function transferValue(type, value) {
247
190
  if (["date", "time"].includes(type)) {
248
191
  if (typeof value === "number" && value.toString().length === 10)
249
192
  value = value * 1e3;
250
- if (!dayjs.isDayjs(value))
251
- value = dayjs(value);
193
+ if (!dayjs2.isDayjs(value))
194
+ value = dayjs2(value);
252
195
  }
253
196
  return value;
254
197
  }
255
-
256
- // src/Description.tsx
257
- import { CheckOutlined, CloseOutlined } from "@ant-design/icons";
258
- import {
259
- Descriptions,
260
- Space
261
- } from "antd";
262
- import { isFunction, upperFirst as upperFirst2 } from "lodash-es";
263
- import {
264
- cloneElement,
265
- useEffect as useEffect3,
266
- useState as useState4
267
- } from "react";
268
-
269
- // src/FaasDataWrapper.tsx
270
- import { FaasDataWrapper as Origin } from "@faasjs/react";
271
-
272
- // src/Loading.tsx
273
- import { Spin } from "antd";
274
- import { Fragment as Fragment2, jsx as jsx6 } from "react/jsx-runtime";
275
198
  function Loading(props) {
276
199
  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
- });
200
+ return /* @__PURE__ */ jsx(Fragment, { children: props.children });
201
+ return /* @__PURE__ */ jsx("div", { style: {
202
+ ...props.style || {},
203
+ ...!props.size || props.size === "large" ? {
204
+ margin: "20vh auto",
205
+ textAlign: "center"
206
+ } : {}
207
+ }, children: /* @__PURE__ */ jsx(Spin, { size: props.size || "large" }) });
292
208
  }
293
-
294
- // src/FaasDataWrapper.tsx
295
- import { jsx as jsx7 } from "react/jsx-runtime";
296
209
  function FaasDataWrapper(props) {
297
- return /* @__PURE__ */ jsx7(Origin, {
298
- fallback: props.loading || /* @__PURE__ */ jsx7(Loading, {
299
- ...props.loadingProps
300
- }),
301
- ...props
302
- });
210
+ return /* @__PURE__ */ jsx(
211
+ FaasDataWrapper$1,
212
+ {
213
+ fallback: props.loading || /* @__PURE__ */ jsx(Loading, { ...props.loadingProps }),
214
+ ...props
215
+ }
216
+ );
303
217
  }
304
-
305
- // src/Description.tsx
306
- import { Fragment as Fragment3, jsx as jsx8 } from "react/jsx-runtime";
307
218
  function DescriptionItemContent(props) {
308
219
  var _a;
309
- const [computedProps, setComputedProps] = useState4();
310
- useEffect3(() => {
220
+ const [computedProps, setComputedProps] = useState();
221
+ useEffect(() => {
311
222
  var _a2, _b;
312
223
  const propsCopy = { ...props };
313
224
  if (!propsCopy.item.title)
314
- propsCopy.item.title = upperFirst2(propsCopy.item.id);
225
+ propsCopy.item.title = upperFirst(propsCopy.item.id);
315
226
  if (!propsCopy.item.type)
316
227
  propsCopy.item.type = "string";
317
228
  if ((_a2 = propsCopy.item.options) == null ? void 0 : _a2.length) {
@@ -346,9 +257,7 @@ function DescriptionItemContent(props) {
346
257
  }
347
258
  );
348
259
  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
- });
260
+ return /* @__PURE__ */ jsx(Fragment, { children: computedProps.extendTypes[computedProps.item.type].render(computedProps.value, computedProps.values, 0, "description") });
352
261
  else
353
262
  throw Error(computedProps.item.type + " requires children or render");
354
263
  if (computedProps.item.descriptionChildren === null)
@@ -368,110 +277,116 @@ function DescriptionItemContent(props) {
368
277
  values: computedProps.values
369
278
  });
370
279
  if (computedProps.item.descriptionRender)
371
- return /* @__PURE__ */ jsx8(Fragment3, {
372
- children: computedProps.item.descriptionRender(computedProps.value, computedProps.values, 0, "description")
373
- });
280
+ return /* @__PURE__ */ jsx(Fragment, { children: computedProps.item.descriptionRender(computedProps.value, computedProps.values, 0, "description") });
374
281
  if (computedProps.item.render)
375
- return /* @__PURE__ */ jsx8(Fragment3, {
376
- children: computedProps.item.render(computedProps.value, computedProps.values, 0, "description")
377
- });
282
+ return /* @__PURE__ */ jsx(Fragment, { children: computedProps.item.render(computedProps.value, computedProps.values, 0, "description") });
378
283
  if (computedProps.value === null || Array.isArray(computedProps.value) && !computedProps.value.length)
379
- return /* @__PURE__ */ jsx8(Blank, {});
284
+ return /* @__PURE__ */ jsx(Blank, {});
380
285
  switch (computedProps.item.type) {
381
286
  case "string[]":
382
- return /* @__PURE__ */ jsx8(Fragment3, {
383
- children: computedProps.value.join(", ")
384
- });
287
+ return /* @__PURE__ */ jsx(Fragment, { children: computedProps.value.join(", ") });
385
288
  case "number":
386
289
  return computedProps.value || null;
387
290
  case "number[]":
388
- return /* @__PURE__ */ jsx8(Fragment3, {
389
- children: computedProps.value.join(", ")
390
- });
291
+ return /* @__PURE__ */ jsx(Fragment, { children: computedProps.value.join(", ") });
391
292
  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
- });
293
+ return computedProps.value ? /* @__PURE__ */ jsx(CheckOutlined, { style: {
294
+ marginTop: "4px",
295
+ color: "#52c41a"
296
+ } }) : /* @__PURE__ */ jsx(CloseOutlined, { style: {
297
+ marginTop: "4px",
298
+ color: "#ff4d4f"
299
+ } });
403
300
  case "time":
404
- return /* @__PURE__ */ jsx8(Fragment3, {
405
- children: computedProps.value.format("YYYY-MM-DD HH:mm:ss")
406
- });
301
+ return /* @__PURE__ */ jsx(Fragment, { children: computedProps.value.format("YYYY-MM-DD HH:mm:ss") });
407
302
  case "date":
408
- return /* @__PURE__ */ jsx8(Fragment3, {
409
- children: computedProps.value.format("YYYY-MM-DD")
410
- });
303
+ return /* @__PURE__ */ jsx(Fragment, { children: computedProps.value.format("YYYY-MM-DD") });
411
304
  case "object":
412
305
  if (!computedProps.value)
413
- return /* @__PURE__ */ jsx8(Blank, {});
414
- return /* @__PURE__ */ jsx8(Description, {
415
- items: computedProps.item.object,
416
- dataSource: computedProps.value,
417
- column: 1
418
- });
306
+ return /* @__PURE__ */ jsx(Blank, {});
307
+ return /* @__PURE__ */ jsx(
308
+ Description,
309
+ {
310
+ items: computedProps.item.object,
311
+ dataSource: computedProps.value,
312
+ column: 1
313
+ }
314
+ );
419
315
  case "object[]":
420
316
  if (!((_a = computedProps.value) == null ? void 0 : _a.length))
421
- return /* @__PURE__ */ jsx8(Blank, {});
422
- return /* @__PURE__ */ jsx8(Space, {
423
- direction: "vertical",
424
- children: computedProps.value.map((value, index) => /* @__PURE__ */ jsx8(Description, {
317
+ return /* @__PURE__ */ jsx(Blank, {});
318
+ return /* @__PURE__ */ jsx(Space, { direction: "vertical", children: computedProps.value.map((value, index) => /* @__PURE__ */ jsx(
319
+ Description,
320
+ {
425
321
  items: computedProps.item.object,
426
322
  dataSource: value,
427
323
  column: 1
428
- }, index))
429
- });
324
+ },
325
+ index
326
+ )) });
430
327
  default:
431
328
  return computedProps.value || null;
432
329
  }
433
330
  }
434
331
  function Description(props) {
435
332
  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) => item && (!item.if || item.if(props.dataSource)) ? /* @__PURE__ */ jsx8(Descriptions.Item, {
440
- label: item.title || upperFirst2(item.id),
441
- children: /* @__PURE__ */ jsx8(DescriptionItemContent, {
442
- item,
443
- value: props.dataSource[item.id],
444
- values: props.dataSource,
445
- extendTypes: props.extendTypes
446
- })
447
- }, item.id) : null).filter(Boolean)
448
- });
449
- return /* @__PURE__ */ jsx8(FaasDataWrapper, {
450
- render: ({ data }) => {
451
- return /* @__PURE__ */ jsx8(Descriptions, {
333
+ return /* @__PURE__ */ jsx(
334
+ Descriptions,
335
+ {
452
336
  ...props,
453
- title: isFunction(props.renderTitle) ? props.renderTitle(data) : props.title,
454
- children: props.items.map((item) => {
455
- return !item.if || item.if(data) ? /* @__PURE__ */ jsx8(Descriptions.Item, {
456
- label: item.title || upperFirst2(item.id),
457
- children: /* @__PURE__ */ jsx8(DescriptionItemContent, {
458
- item,
459
- value: data[item.id],
460
- values: data,
461
- extendTypes: props.extendTypes
462
- })
463
- }, item.id) : null;
464
- }).filter(Boolean)
465
- });
466
- },
467
- ...props.faasData
468
- });
337
+ title: isFunction(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
338
+ children: props.items.map((item) => item && (!item.if || item.if(props.dataSource)) ? /* @__PURE__ */ jsx(
339
+ Descriptions.Item,
340
+ {
341
+ label: item.title || upperFirst(item.id),
342
+ children: /* @__PURE__ */ jsx(
343
+ DescriptionItemContent,
344
+ {
345
+ item,
346
+ value: props.dataSource[item.id],
347
+ values: props.dataSource,
348
+ extendTypes: props.extendTypes
349
+ }
350
+ )
351
+ },
352
+ item.id
353
+ ) : null).filter(Boolean)
354
+ }
355
+ );
356
+ return /* @__PURE__ */ jsx(
357
+ FaasDataWrapper,
358
+ {
359
+ render: ({ data }) => {
360
+ return /* @__PURE__ */ jsx(
361
+ Descriptions,
362
+ {
363
+ ...props,
364
+ title: isFunction(props.renderTitle) ? props.renderTitle(data) : props.title,
365
+ children: props.items.map((item) => {
366
+ return !item.if || item.if(data) ? /* @__PURE__ */ jsx(
367
+ Descriptions.Item,
368
+ {
369
+ label: item.title || upperFirst(item.id),
370
+ children: /* @__PURE__ */ jsx(
371
+ DescriptionItemContent,
372
+ {
373
+ item,
374
+ value: data[item.id],
375
+ values: data,
376
+ extendTypes: props.extendTypes
377
+ }
378
+ )
379
+ },
380
+ item.id
381
+ ) : null;
382
+ }).filter(Boolean)
383
+ }
384
+ );
385
+ },
386
+ ...props.faasData
387
+ }
388
+ );
469
389
  }
470
-
471
- // src/ErrorBoundary.tsx
472
- import { Component } from "react";
473
- import { Alert } from "antd";
474
- import { jsx as jsx9 } from "react/jsx-runtime";
475
390
  var ErrorBoundary = class extends Component {
476
391
  constructor(props) {
477
392
  super(props);
@@ -499,60 +414,24 @@ var ErrorBoundary = class extends Component {
499
414
  if (error) {
500
415
  if (this.props.onError)
501
416
  return this.props.onError(error, info);
502
- return /* @__PURE__ */ jsx9(Alert, {
503
- type: "error",
504
- message: errorMessage,
505
- description: /* @__PURE__ */ jsx9("pre", {
506
- style: {
417
+ return /* @__PURE__ */ jsx(
418
+ Alert,
419
+ {
420
+ type: "error",
421
+ message: errorMessage,
422
+ description: /* @__PURE__ */ jsx("pre", { style: {
507
423
  fontSize: "0.9em",
508
424
  overflowX: "auto"
509
- },
510
- children: errorDescription
511
- })
512
- });
425
+ }, children: errorDescription })
426
+ }
427
+ );
513
428
  }
514
429
  return children;
515
430
  }
516
431
  };
517
-
518
- // src/Form.tsx
519
- import { faas } from "@faasjs/react";
520
- import {
521
- Button as Button2,
522
- Form as AntdForm2
523
- } from "antd";
524
- import {
525
- useEffect as useEffect5,
526
- useState as useState6,
527
- useCallback,
528
- isValidElement
529
- } from "react";
530
-
531
- // src/FormItem.tsx
532
- import {
533
- Button,
534
- Row,
535
- Col,
536
- Form as AntdForm,
537
- Input,
538
- InputNumber,
539
- Switch,
540
- Select,
541
- DatePicker,
542
- TimePicker,
543
- Radio
544
- } from "antd";
545
- import { MinusCircleOutlined, PlusOutlined } from "@ant-design/icons";
546
- import {
547
- cloneElement as cloneElement2,
548
- useEffect as useEffect4,
549
- useState as useState5
550
- } from "react";
551
- import { upperFirst as upperFirst3 } from "lodash-es";
552
- import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs2 } from "react/jsx-runtime";
553
432
  function processProps(propsCopy, config) {
554
433
  if (!propsCopy.title)
555
- propsCopy.title = upperFirst3(propsCopy.id);
434
+ propsCopy.title = upperFirst(propsCopy.id);
556
435
  if (!propsCopy.label && propsCopy.label !== false)
557
436
  propsCopy.label = propsCopy.title;
558
437
  if (!propsCopy.name)
@@ -598,11 +477,11 @@ function processProps(propsCopy, config) {
598
477
  }
599
478
  function FormItem(props) {
600
479
  var _a;
601
- const [computedProps, setComputedProps] = useState5();
602
- const [extendTypes, setExtendTypes] = useState5();
480
+ const [computedProps, setComputedProps] = useState();
481
+ const [extendTypes, setExtendTypes] = useState();
603
482
  const { common: common2 } = useConfigContext();
604
- const [hidden, setHidden] = useState5(props.hidden || false);
605
- useEffect4(() => {
483
+ const [hidden, setHidden] = useState(props.hidden || false);
484
+ useEffect(() => {
606
485
  const propsCopy = { ...props };
607
486
  if (propsCopy.extendTypes) {
608
487
  setExtendTypes(propsCopy.extendTypes);
@@ -626,343 +505,276 @@ function FormItem(props) {
626
505
  if (!computedProps)
627
506
  return null;
628
507
  if (hidden)
629
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
630
- ...computedProps,
631
- noStyle: true,
632
- rules: [],
633
- children: /* @__PURE__ */ jsx10(Input, {
634
- hidden: true
635
- })
636
- });
508
+ return /* @__PURE__ */ jsx(
509
+ Form$1.Item,
510
+ {
511
+ ...computedProps,
512
+ noStyle: true,
513
+ rules: [],
514
+ children: /* @__PURE__ */ jsx(Input, { hidden: true })
515
+ }
516
+ );
637
517
  if (extendTypes && extendTypes[computedProps.type])
638
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
639
- ...computedProps,
640
- children: extendTypes[computedProps.type].children
641
- });
518
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: extendTypes[computedProps.type].children });
642
519
  if (computedProps.formChildren === null)
643
520
  return null;
644
521
  if (computedProps.formChildren)
645
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
646
- ...computedProps,
647
- children: cloneElement2(computedProps.formChildren, { scene: "form" })
648
- });
522
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: cloneElement(computedProps.formChildren, { scene: "form" }) });
649
523
  if (computedProps.children === null)
650
524
  return null;
651
525
  if (computedProps.children)
652
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
653
- ...computedProps,
654
- children: cloneElement2(computedProps.children, { scene: "form" })
655
- });
526
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: cloneElement(computedProps.children, { scene: "form" }) });
656
527
  if (computedProps.formRender)
657
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
658
- ...computedProps,
659
- children: computedProps.formRender(null, null, 0, "form")
660
- });
528
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: computedProps.formRender(null, null, 0, "form") });
661
529
  if (computedProps.render)
662
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
663
- ...computedProps,
664
- children: computedProps.render(null, null, 0, "form")
665
- });
530
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: computedProps.render(null, null, 0, "form") });
666
531
  switch (computedProps.type) {
667
532
  case "string":
668
533
  if (computedProps.options)
669
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
670
- ...computedProps,
671
- children: computedProps.options.length > 10 ? /* @__PURE__ */ jsx10(Select, {
672
- ...computedProps.input
673
- }) : /* @__PURE__ */ jsx10(Radio.Group, {
674
- ...computedProps.input
675
- })
676
- });
677
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
678
- ...computedProps,
679
- children: /* @__PURE__ */ jsx10(Input, {
680
- ...computedProps.input
681
- })
682
- });
534
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: computedProps.options.length > 10 ? /* @__PURE__ */ jsx(Select, { ...computedProps.input }) : /* @__PURE__ */ jsx(Radio.Group, { ...computedProps.input }) });
535
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: /* @__PURE__ */ jsx(Input, { ...computedProps.input }) });
683
536
  case "string[]":
684
537
  if (computedProps.options)
685
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
686
- ...computedProps,
687
- children: /* @__PURE__ */ jsx10(Select, {
538
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: /* @__PURE__ */ jsx(
539
+ Select,
540
+ {
688
541
  mode: "multiple",
689
542
  ...computedProps.input
690
- })
691
- });
692
- return /* @__PURE__ */ jsx10(AntdForm.List, {
693
- name: computedProps.name,
694
- rules: computedProps.rules,
695
- children: (fields, { add, remove }, { errors }) => {
696
- var _a2;
697
- return /* @__PURE__ */ jsxs2(Fragment4, {
698
- children: [
699
- computedProps.label && /* @__PURE__ */ jsx10("div", {
700
- className: "ant-form-item-label",
701
- children: /* @__PURE__ */ jsx10("label", {
702
- className: computedProps.rules.find((r) => r.required) && "ant-form-item-required",
703
- children: computedProps.label
704
- })
705
- }),
543
+ }
544
+ ) });
545
+ return /* @__PURE__ */ jsx(
546
+ Form$1.List,
547
+ {
548
+ name: computedProps.name,
549
+ rules: computedProps.rules,
550
+ children: (fields, { add, remove }, { errors }) => {
551
+ var _a2;
552
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
553
+ computedProps.label && /* @__PURE__ */ jsx("div", { className: "ant-form-item-label", children: /* @__PURE__ */ jsx("label", { className: computedProps.rules.find((r) => r.required) && "ant-form-item-required", children: computedProps.label }) }),
706
554
  fields.map((field) => {
707
555
  var _a3;
708
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
709
- children: /* @__PURE__ */ jsxs2(Row, {
556
+ return /* @__PURE__ */ jsx(Form$1.Item, { children: /* @__PURE__ */ jsxs(
557
+ Row,
558
+ {
710
559
  gutter: 24,
711
560
  style: { flexFlow: "row nowrap" },
712
561
  children: [
713
- /* @__PURE__ */ jsx10(Col, {
714
- span: 23,
715
- children: /* @__PURE__ */ jsx10(AntdForm.Item, {
562
+ /* @__PURE__ */ jsx(Col, { span: 23, children: /* @__PURE__ */ jsx(
563
+ Form$1.Item,
564
+ {
716
565
  ...field,
717
566
  noStyle: true,
718
- children: /* @__PURE__ */ jsx10(Input, {
719
- ...computedProps.input
720
- })
721
- })
722
- }),
723
- /* @__PURE__ */ jsx10(Col, {
724
- span: 1,
725
- children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx10(Button, {
567
+ children: /* @__PURE__ */ jsx(Input, { ...computedProps.input })
568
+ }
569
+ ) }),
570
+ /* @__PURE__ */ jsx(Col, { span: 1, children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx(
571
+ Button,
572
+ {
726
573
  danger: true,
727
574
  type: "link",
728
575
  style: { float: "right" },
729
- icon: /* @__PURE__ */ jsx10(MinusCircleOutlined, {}),
576
+ icon: /* @__PURE__ */ jsx(MinusCircleOutlined, {}),
730
577
  onClick: () => remove(field.name)
731
- })
732
- })
578
+ }
579
+ ) })
733
580
  ]
734
- })
735
- }, field.key);
581
+ }
582
+ ) }, field.key);
736
583
  }),
737
- /* @__PURE__ */ jsxs2(AntdForm.Item, {
738
- children: [
739
- !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx10(Button, {
584
+ /* @__PURE__ */ jsxs(Form$1.Item, { children: [
585
+ !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx(
586
+ Button,
587
+ {
740
588
  type: "dashed",
741
589
  block: true,
742
590
  onClick: () => add(),
743
- icon: /* @__PURE__ */ jsx10(PlusOutlined, {})
744
- }),
745
- computedProps.extra && /* @__PURE__ */ jsx10("div", {
746
- className: "ant-form-item-extra",
747
- children: computedProps.extra
748
- }),
749
- /* @__PURE__ */ jsx10(AntdForm.ErrorList, {
750
- errors
751
- })
752
- ]
753
- })
754
- ]
755
- });
591
+ icon: /* @__PURE__ */ jsx(PlusOutlined, {})
592
+ }
593
+ ),
594
+ computedProps.extra && /* @__PURE__ */ jsx("div", { className: "ant-form-item-extra", children: computedProps.extra }),
595
+ /* @__PURE__ */ jsx(Form$1.ErrorList, { errors })
596
+ ] })
597
+ ] });
598
+ }
756
599
  }
757
- });
600
+ );
758
601
  case "number":
759
602
  if (computedProps.options)
760
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
761
- ...computedProps,
762
- children: computedProps.options.length > 10 ? /* @__PURE__ */ jsx10(Select, {
763
- ...computedProps.input
764
- }) : /* @__PURE__ */ jsx10(Radio.Group, {
765
- ...computedProps.input
766
- })
767
- });
768
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
769
- ...computedProps,
770
- children: /* @__PURE__ */ jsx10(InputNumber, {
603
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: computedProps.options.length > 10 ? /* @__PURE__ */ jsx(Select, { ...computedProps.input }) : /* @__PURE__ */ jsx(Radio.Group, { ...computedProps.input }) });
604
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: /* @__PURE__ */ jsx(
605
+ InputNumber,
606
+ {
771
607
  style: { width: "100%" },
772
608
  ...computedProps.input
773
- })
774
- });
609
+ }
610
+ ) });
775
611
  case "number[]":
776
612
  if (computedProps.options)
777
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
778
- ...computedProps,
779
- children: /* @__PURE__ */ jsx10(Select, {
613
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: /* @__PURE__ */ jsx(
614
+ Select,
615
+ {
780
616
  mode: "multiple",
781
617
  ...computedProps.input
782
- })
783
- });
784
- return /* @__PURE__ */ jsx10(AntdForm.List, {
785
- name: computedProps.name,
786
- rules: computedProps.rules,
787
- children: (fields, { add, remove }, { errors }) => {
788
- var _a2, _b;
789
- return /* @__PURE__ */ jsxs2(Fragment4, {
790
- children: [
791
- computedProps.label && /* @__PURE__ */ jsx10("div", {
792
- className: "ant-form-item-label",
793
- children: /* @__PURE__ */ jsx10("label", {
794
- className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required",
795
- children: computedProps.label
796
- })
797
- }),
618
+ }
619
+ ) });
620
+ return /* @__PURE__ */ jsx(
621
+ Form$1.List,
622
+ {
623
+ name: computedProps.name,
624
+ rules: computedProps.rules,
625
+ children: (fields, { add, remove }, { errors }) => {
626
+ var _a2, _b;
627
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
628
+ computedProps.label && /* @__PURE__ */ jsx("div", { className: "ant-form-item-label", children: /* @__PURE__ */ jsx("label", { className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required", children: computedProps.label }) }),
798
629
  fields.map((field) => {
799
630
  var _a3;
800
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
801
- children: /* @__PURE__ */ jsxs2(Row, {
631
+ return /* @__PURE__ */ jsx(Form$1.Item, { children: /* @__PURE__ */ jsxs(
632
+ Row,
633
+ {
802
634
  gutter: 24,
803
635
  style: { flexFlow: "row nowrap" },
804
636
  children: [
805
- /* @__PURE__ */ jsx10(Col, {
806
- span: 23,
807
- children: /* @__PURE__ */ jsx10(AntdForm.Item, {
637
+ /* @__PURE__ */ jsx(Col, { span: 23, children: /* @__PURE__ */ jsx(
638
+ Form$1.Item,
639
+ {
808
640
  ...field,
809
641
  noStyle: true,
810
- children: /* @__PURE__ */ jsx10(InputNumber, {
811
- style: { width: "100%" },
812
- ...computedProps.input
813
- })
814
- })
815
- }),
816
- /* @__PURE__ */ jsx10(Col, {
817
- span: 1,
818
- children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx10(Button, {
642
+ children: /* @__PURE__ */ jsx(
643
+ InputNumber,
644
+ {
645
+ style: { width: "100%" },
646
+ ...computedProps.input
647
+ }
648
+ )
649
+ }
650
+ ) }),
651
+ /* @__PURE__ */ jsx(Col, { span: 1, children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx(
652
+ Button,
653
+ {
819
654
  danger: true,
820
655
  type: "link",
821
656
  style: { float: "right" },
822
- icon: /* @__PURE__ */ jsx10(MinusCircleOutlined, {}),
657
+ icon: /* @__PURE__ */ jsx(MinusCircleOutlined, {}),
823
658
  onClick: () => remove(field.name)
824
- })
825
- })
659
+ }
660
+ ) })
826
661
  ]
827
- })
828
- }, field.key);
662
+ }
663
+ ) }, field.key);
829
664
  }),
830
- /* @__PURE__ */ jsxs2(AntdForm.Item, {
831
- children: [
832
- !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx10(Button, {
665
+ /* @__PURE__ */ jsxs(Form$1.Item, { children: [
666
+ !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx(
667
+ Button,
668
+ {
833
669
  type: "dashed",
834
670
  block: true,
835
671
  onClick: () => add(),
836
- icon: /* @__PURE__ */ jsx10(PlusOutlined, {})
837
- }),
838
- computedProps.extra && /* @__PURE__ */ jsx10("div", {
839
- className: "ant-form-item-extra",
840
- children: computedProps.extra
841
- }),
842
- /* @__PURE__ */ jsx10(AntdForm.ErrorList, {
843
- errors
844
- })
845
- ]
846
- })
847
- ]
848
- });
672
+ icon: /* @__PURE__ */ jsx(PlusOutlined, {})
673
+ }
674
+ ),
675
+ computedProps.extra && /* @__PURE__ */ jsx("div", { className: "ant-form-item-extra", children: computedProps.extra }),
676
+ /* @__PURE__ */ jsx(Form$1.ErrorList, { errors })
677
+ ] })
678
+ ] });
679
+ }
849
680
  }
850
- });
681
+ );
851
682
  case "boolean":
852
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
853
- ...computedProps,
854
- children: /* @__PURE__ */ jsx10(Switch, {
855
- ...computedProps.input
856
- })
857
- });
683
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: /* @__PURE__ */ jsx(Switch, { ...computedProps.input }) });
858
684
  case "date":
859
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
860
- ...computedProps,
861
- children: /* @__PURE__ */ jsx10(DatePicker, {
862
- ...computedProps.input
863
- })
864
- });
685
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: /* @__PURE__ */ jsx(DatePicker, { ...computedProps.input }) });
865
686
  case "time":
866
- return /* @__PURE__ */ jsx10(AntdForm.Item, {
867
- ...computedProps,
868
- children: /* @__PURE__ */ jsx10(TimePicker, {
869
- ...computedProps.input
870
- })
871
- });
687
+ return /* @__PURE__ */ jsx(Form$1.Item, { ...computedProps, children: /* @__PURE__ */ jsx(TimePicker, { ...computedProps.input }) });
872
688
  case "object":
873
- return /* @__PURE__ */ jsxs2(Fragment4, {
874
- children: [
875
- computedProps.label && /* @__PURE__ */ jsx10("div", {
876
- className: "ant-form-item-label",
877
- children: /* @__PURE__ */ jsx10("label", {
878
- className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required",
879
- children: computedProps.label
880
- })
881
- }),
882
- computedProps.object.map((o) => /* @__PURE__ */ jsx10(FormItem, {
689
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
690
+ computedProps.label && /* @__PURE__ */ jsx("div", { className: "ant-form-item-label", children: /* @__PURE__ */ jsx("label", { className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required", children: computedProps.label }) }),
691
+ computedProps.object.map((o) => /* @__PURE__ */ jsx(
692
+ FormItem,
693
+ {
883
694
  ...o
884
- }, o.id))
885
- ]
886
- });
695
+ },
696
+ o.id
697
+ ))
698
+ ] });
887
699
  case "object[]":
888
- return /* @__PURE__ */ jsx10(AntdForm.List, {
889
- name: computedProps.name,
890
- rules: computedProps.rules,
891
- children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ jsxs2(Fragment4, {
892
- children: [
893
- fields.map((field) => /* @__PURE__ */ jsxs2(AntdForm.Item, {
894
- style: { marginBottom: 0 },
895
- children: [
896
- /* @__PURE__ */ jsx10("div", {
897
- className: "ant-form-item-label",
898
- children: /* @__PURE__ */ jsxs2("label", {
899
- children: [
900
- computedProps.label,
901
- " ",
902
- field.name + 1,
903
- !computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx10(Button, {
700
+ return /* @__PURE__ */ jsx(
701
+ Form$1.List,
702
+ {
703
+ name: computedProps.name,
704
+ rules: computedProps.rules,
705
+ children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ jsxs(Fragment, { children: [
706
+ fields.map((field) => /* @__PURE__ */ jsxs(
707
+ Form$1.Item,
708
+ {
709
+ style: { marginBottom: 0 },
710
+ children: [
711
+ /* @__PURE__ */ jsx("div", { className: "ant-form-item-label", children: /* @__PURE__ */ jsxs("label", { children: [
712
+ computedProps.label,
713
+ " ",
714
+ field.name + 1,
715
+ !computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx(
716
+ Button,
717
+ {
904
718
  danger: true,
905
719
  type: "link",
906
720
  onClick: () => remove(field.name),
907
721
  children: common2.delete
908
- })
909
- ]
910
- })
911
- }),
912
- /* @__PURE__ */ jsx10(Row, {
913
- gutter: 24,
914
- children: computedProps.object.map((o) => /* @__PURE__ */ jsx10(Col, {
915
- span: o.col || 24,
916
- children: /* @__PURE__ */ jsx10(FormItem, {
917
- ...o,
918
- name: [field.name, o.id]
919
- })
920
- }, o.id))
921
- })
922
- ]
923
- }, field.key)),
924
- /* @__PURE__ */ jsxs2(AntdForm.Item, {
925
- children: [
926
- !computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsxs2(Button, {
722
+ }
723
+ )
724
+ ] }) }),
725
+ /* @__PURE__ */ jsx(Row, { gutter: 24, children: computedProps.object.map((o) => /* @__PURE__ */ jsx(
726
+ Col,
727
+ {
728
+ span: o.col || 24,
729
+ children: /* @__PURE__ */ jsx(
730
+ FormItem,
731
+ {
732
+ ...o,
733
+ name: [field.name, o.id]
734
+ }
735
+ )
736
+ },
737
+ o.id
738
+ )) })
739
+ ]
740
+ },
741
+ field.key
742
+ )),
743
+ /* @__PURE__ */ jsxs(Form$1.Item, { children: [
744
+ !computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsxs(
745
+ Button,
746
+ {
927
747
  type: "dashed",
928
748
  block: true,
929
749
  onClick: () => add(),
930
- icon: /* @__PURE__ */ jsx10(PlusOutlined, {}),
750
+ icon: /* @__PURE__ */ jsx(PlusOutlined, {}),
931
751
  children: [
932
752
  common2.add,
933
753
  " ",
934
754
  computedProps.label
935
755
  ]
936
- }),
937
- computedProps.extra && /* @__PURE__ */ jsx10("div", {
938
- className: "ant-form-item-extra",
939
- children: computedProps.extra
940
- }),
941
- /* @__PURE__ */ jsx10(AntdForm.ErrorList, {
942
- errors
943
- })
944
- ]
945
- })
946
- ]
947
- })
948
- });
756
+ }
757
+ ),
758
+ computedProps.extra && /* @__PURE__ */ jsx("div", { className: "ant-form-item-extra", children: computedProps.extra }),
759
+ /* @__PURE__ */ jsx(Form$1.ErrorList, { errors })
760
+ ] })
761
+ ] })
762
+ }
763
+ );
949
764
  default:
950
765
  return null;
951
766
  }
952
767
  }
953
- FormItem.useStatus = AntdForm.Item.useStatus;
954
-
955
- // src/Form.tsx
956
- import { jsx as jsx11, jsxs as jsxs3 } from "react/jsx-runtime";
768
+ FormItem.useStatus = Form$1.Item.useStatus;
957
769
  function Form(props) {
958
770
  var _a, _b;
959
- const [loading, setLoading] = useState6(false);
960
- const [computedProps, setComputedProps] = useState6();
771
+ const [loading, setLoading] = useState(false);
772
+ const [computedProps, setComputedProps] = useState();
961
773
  const config = useConfigContext();
962
- const [extendTypes, setExtendTypes] = useState6();
963
- const [form] = AntdForm2.useForm(props.form);
964
- const [initialValues, setInitialValues] = useState6(props.initialValues);
965
- useEffect5(() => {
774
+ const [extendTypes, setExtendTypes] = useState();
775
+ const [form] = Form$1.useForm(props.form);
776
+ const [initialValues, setInitialValues] = useState(props.initialValues);
777
+ useEffect(() => {
966
778
  var _a2, _b2, _c;
967
779
  const propsCopy = {
968
780
  ...props,
@@ -1042,7 +854,7 @@ function Form(props) {
1042
854
  item.onValueChange(changedValues[key], allValues, form);
1043
855
  }
1044
856
  }, [computedProps]);
1045
- useEffect5(() => {
857
+ useEffect(() => {
1046
858
  if (!initialValues)
1047
859
  return;
1048
860
  console.debug("Form:initialValues", initialValues);
@@ -1051,38 +863,43 @@ function Form(props) {
1051
863
  }, [computedProps]);
1052
864
  if (!computedProps)
1053
865
  return null;
1054
- return /* @__PURE__ */ jsxs3(AntdForm2, {
1055
- ...computedProps,
1056
- onValuesChange,
1057
- children: [
1058
- computedProps.beforeItems,
1059
- (_a = computedProps.items) == null ? void 0 : _a.map((item) => isValidElement(item) ? item : /* @__PURE__ */ jsx11(FormItem, {
1060
- ...item,
1061
- extendTypes
1062
- }, item.id)),
1063
- computedProps.children,
1064
- computedProps.submit !== false && /* @__PURE__ */ jsx11(Button2, {
1065
- htmlType: "submit",
1066
- type: "primary",
1067
- loading,
1068
- children: ((_b = computedProps.submit) == null ? void 0 : _b.text) || config.Form.submit.text
1069
- }),
1070
- computedProps.footer
1071
- ]
1072
- });
866
+ return /* @__PURE__ */ jsxs(
867
+ Form$1,
868
+ {
869
+ ...computedProps,
870
+ onValuesChange,
871
+ children: [
872
+ computedProps.beforeItems,
873
+ (_a = computedProps.items) == null ? void 0 : _a.map((item) => isValidElement(item) ? item : /* @__PURE__ */ jsx(
874
+ FormItem,
875
+ {
876
+ ...item,
877
+ extendTypes
878
+ },
879
+ item.id
880
+ )),
881
+ computedProps.children,
882
+ computedProps.submit !== false && /* @__PURE__ */ jsx(
883
+ Button,
884
+ {
885
+ htmlType: "submit",
886
+ type: "primary",
887
+ loading,
888
+ children: ((_b = computedProps.submit) == null ? void 0 : _b.text) || config.Form.submit.text
889
+ }
890
+ ),
891
+ computedProps.footer
892
+ ]
893
+ }
894
+ );
1073
895
  }
1074
- Form.useForm = AntdForm2.useForm;
1075
- Form.useFormInstance = AntdForm2.useFormInstance;
1076
- Form.useWatch = AntdForm2.useWatch;
896
+ Form.useForm = Form$1.useForm;
897
+ Form.useFormInstance = Form$1.useFormInstance;
898
+ Form.useWatch = Form$1.useWatch;
1077
899
  Form.Item = FormItem;
1078
- Form.List = AntdForm2.List;
1079
- Form.ErrorList = AntdForm2.ErrorList;
1080
- Form.Provider = AntdForm2.Provider;
1081
-
1082
- // src/Link.tsx
1083
- import { Link as RouterLink } from "react-router-dom";
1084
- import { Button as Button3 } from "antd";
1085
- import { jsx as jsx12 } from "react/jsx-runtime";
900
+ Form.List = Form$1.List;
901
+ Form.ErrorList = Form$1.ErrorList;
902
+ Form.Provider = Form$1.Provider;
1086
903
  function Link(props) {
1087
904
  var _a, _b, _c, _d;
1088
905
  const { Link: Link2 } = useConfigContext();
@@ -1098,105 +915,87 @@ function Link(props) {
1098
915
  }, style);
1099
916
  if (props.href.startsWith("http")) {
1100
917
  if (props.button)
1101
- return /* @__PURE__ */ jsx12(Button3, {
1102
- ...props.button,
918
+ return /* @__PURE__ */ jsx(
919
+ Button,
920
+ {
921
+ ...props.button,
922
+ target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
923
+ style,
924
+ href: props.href,
925
+ children: (_a = props.text) != null ? _a : props.children
926
+ }
927
+ );
928
+ return /* @__PURE__ */ jsx(
929
+ "a",
930
+ {
931
+ href: props.href,
1103
932
  target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
1104
933
  style,
1105
- href: props.href,
1106
- children: (_a = props.text) != null ? _a : props.children
1107
- });
1108
- return /* @__PURE__ */ jsx12("a", {
1109
- href: props.href,
1110
- target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
1111
- style,
1112
- children: (_b = props.text) != null ? _b : props.children
1113
- });
934
+ children: (_b = props.text) != null ? _b : props.children
935
+ }
936
+ );
1114
937
  }
1115
938
  if (props.button)
1116
- return /* @__PURE__ */ jsx12(RouterLink, {
939
+ return /* @__PURE__ */ jsx(
940
+ Link$1,
941
+ {
942
+ to: props.href,
943
+ target: props.target || (Link2 == null ? void 0 : Link2.target),
944
+ children: /* @__PURE__ */ jsx(
945
+ Button,
946
+ {
947
+ ...props.button,
948
+ style,
949
+ children: (_c = props.text) != null ? _c : props.children
950
+ }
951
+ )
952
+ }
953
+ );
954
+ return /* @__PURE__ */ jsx(
955
+ Link$1,
956
+ {
1117
957
  to: props.href,
1118
958
  target: props.target || (Link2 == null ? void 0 : Link2.target),
1119
- children: /* @__PURE__ */ jsx12(Button3, {
1120
- ...props.button,
1121
- style,
1122
- children: (_c = props.text) != null ? _c : props.children
1123
- })
1124
- });
1125
- return /* @__PURE__ */ jsx12(RouterLink, {
1126
- to: props.href,
1127
- target: props.target || (Link2 == null ? void 0 : Link2.target),
1128
- style,
1129
- children: (_d = props.text) != null ? _d : props.children
1130
- });
959
+ style,
960
+ children: (_d = props.text) != null ? _d : props.children
961
+ }
962
+ );
1131
963
  }
1132
-
1133
- // src/Routers.tsx
1134
- import { Result, Skeleton } from "antd";
1135
- import {
1136
- Suspense
1137
- } from "react";
1138
- import {
1139
- Routes as OriginRoutes,
1140
- Route
1141
- } from "react-router-dom";
1142
- import { lazy } from "react";
1143
- import { jsx as jsx13, jsxs as jsxs4 } from "react/jsx-runtime";
1144
964
  function PageNotFound() {
1145
965
  const config = useConfigContext();
1146
- return /* @__PURE__ */ jsx13(Result, {
1147
- status: "404",
1148
- title: config.common.pageNotFound
1149
- });
966
+ return /* @__PURE__ */ jsx(
967
+ Result,
968
+ {
969
+ status: "404",
970
+ title: config.common.pageNotFound
971
+ }
972
+ );
1150
973
  }
1151
974
  function Routes(props) {
1152
- return /* @__PURE__ */ jsxs4(OriginRoutes, {
1153
- children: [
1154
- props.routes.map((r) => /* @__PURE__ */ jsx13(Route, {
975
+ return /* @__PURE__ */ jsxs(Routes$1, { children: [
976
+ props.routes.map((r) => /* @__PURE__ */ jsx(
977
+ Route,
978
+ {
1155
979
  ...r,
1156
- element: r.element || /* @__PURE__ */ jsx13(Suspense, {
1157
- fallback: props.fallback || /* @__PURE__ */ jsx13("div", {
1158
- style: { padding: "24px" },
1159
- children: /* @__PURE__ */ jsx13(Skeleton, {
1160
- active: true
1161
- })
1162
- }),
1163
- children: /* @__PURE__ */ jsx13(r.page, {})
1164
- })
1165
- }, r.path)),
1166
- /* @__PURE__ */ jsx13(Route, {
980
+ element: r.element || /* @__PURE__ */ jsx(Suspense, { fallback: props.fallback || /* @__PURE__ */ jsx("div", { style: { padding: "24px" }, children: /* @__PURE__ */ jsx(Skeleton, { active: true }) }), children: /* @__PURE__ */ jsx(r.page, {}) })
981
+ },
982
+ r.path
983
+ )),
984
+ /* @__PURE__ */ jsx(
985
+ Route,
986
+ {
1167
987
  path: "*",
1168
- element: props.notFound || /* @__PURE__ */ jsx13(PageNotFound, {})
1169
- }, "*")
1170
- ]
1171
- });
988
+ element: props.notFound || /* @__PURE__ */ jsx(PageNotFound, {})
989
+ },
990
+ "*"
991
+ )
992
+ ] });
1172
993
  }
1173
-
1174
- // src/Table.tsx
1175
- import {
1176
- useState as useState7,
1177
- useEffect as useEffect6,
1178
- cloneElement as cloneElement3
1179
- } from "react";
1180
- import {
1181
- Table as AntdTable,
1182
- Radio as Radio2,
1183
- Input as Input2,
1184
- Select as Select2,
1185
- DatePicker as DatePicker2
1186
- } from "antd";
1187
- import dayjs2 from "dayjs";
1188
- import { CheckOutlined as CheckOutlined2, CloseOutlined as CloseOutlined2 } from "@ant-design/icons";
1189
- import {
1190
- isNil as isNil2,
1191
- uniqBy,
1192
- upperFirst as upperFirst4
1193
- } from "lodash-es";
1194
- import { Fragment as Fragment5, jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
1195
994
  function processValue(item, value) {
1196
995
  var _a;
1197
996
  const transferred = transferValue(item.type, value);
1198
997
  if (transferred === null || Array.isArray(transferred) && transferred.length === 0)
1199
- return /* @__PURE__ */ jsx14(Blank, {});
998
+ return /* @__PURE__ */ jsx(Blank, {});
1200
999
  if (item.options) {
1201
1000
  if (item.type.endsWith("[]"))
1202
1001
  return transferred.map((v) => {
@@ -1217,7 +1016,7 @@ function processValue(item, value) {
1217
1016
  return value;
1218
1017
  }
1219
1018
  function Table(props) {
1220
- const [columns, setColumns] = useState7();
1019
+ const [columns, setColumns] = useState();
1221
1020
  const { common: common2 } = useConfigContext();
1222
1021
  const generateFilterDropdown = (item) => {
1223
1022
  if (typeof item.filterDropdown !== "undefined")
@@ -1234,35 +1033,41 @@ function Table(props) {
1234
1033
  setSelectedKeys,
1235
1034
  selectedKeys,
1236
1035
  confirm
1237
- }) => /* @__PURE__ */ jsx14("div", {
1238
- style: {
1239
- padding: 8,
1240
- width: "200px"
1241
- },
1242
- onKeyDown: (e) => e.stopPropagation(),
1243
- children: /* @__PURE__ */ jsx14(Select2, {
1244
- options: item.options,
1245
- allowClear: true,
1246
- showSearch: true,
1247
- style: { width: "100%" },
1248
- placeholder: `${common2.search} ${item.title}`,
1249
- value: selectedKeys,
1250
- onChange: (v) => {
1251
- setSelectedKeys((v == null ? void 0 : v.length) ? v : []);
1252
- confirm();
1036
+ }) => /* @__PURE__ */ jsx(
1037
+ "div",
1038
+ {
1039
+ style: {
1040
+ padding: 8,
1041
+ width: "200px"
1253
1042
  },
1254
- mode: "multiple",
1255
- filterOption: (input, option) => {
1256
- if (!input || !option || !option.label)
1257
- return true;
1258
- input = input.trim();
1259
- return option.value === input || option.label.toString().toLowerCase().includes(input.toLowerCase());
1260
- }
1261
- })
1262
- });
1043
+ onKeyDown: (e) => e.stopPropagation(),
1044
+ children: /* @__PURE__ */ jsx(
1045
+ Select,
1046
+ {
1047
+ options: item.options,
1048
+ allowClear: true,
1049
+ showSearch: true,
1050
+ style: { width: "100%" },
1051
+ placeholder: `${common2.search} ${item.title}`,
1052
+ value: selectedKeys,
1053
+ onChange: (v) => {
1054
+ setSelectedKeys((v == null ? void 0 : v.length) ? v : []);
1055
+ confirm();
1056
+ },
1057
+ mode: "multiple",
1058
+ filterOption: (input, option) => {
1059
+ if (!input || !option || !option.label)
1060
+ return true;
1061
+ input = input.trim();
1062
+ return option.value === input || option.label.toString().toLowerCase().includes(input.toLowerCase());
1063
+ }
1064
+ }
1065
+ )
1066
+ }
1067
+ );
1263
1068
  return item;
1264
1069
  };
1265
- useEffect6(() => {
1070
+ useEffect(() => {
1266
1071
  var _a;
1267
1072
  for (const item of props.items) {
1268
1073
  if (!item.key)
@@ -1270,7 +1075,7 @@ function Table(props) {
1270
1075
  if (!item.dataIndex)
1271
1076
  item.dataIndex = item.id;
1272
1077
  if (!item.title)
1273
- item.title = upperFirst4(item.id);
1078
+ item.title = upperFirst(item.id);
1274
1079
  if (!item.type)
1275
1080
  item.type = "string";
1276
1081
  if ((_a = item.options) == null ? void 0 : _a.length) {
@@ -1279,7 +1084,7 @@ function Table(props) {
1279
1084
  text: o.label,
1280
1085
  value: o.value
1281
1086
  })).concat({
1282
- text: /* @__PURE__ */ jsx14(Blank, {}),
1087
+ text: /* @__PURE__ */ jsx(Blank, {}),
1283
1088
  value: null
1284
1089
  });
1285
1090
  generateFilterDropdown(item);
@@ -1287,7 +1092,7 @@ function Table(props) {
1287
1092
  if (item.tableChildren === null)
1288
1093
  item.render = () => null;
1289
1094
  else if (item.tableChildren)
1290
- item.render = (value, values) => cloneElement3(
1095
+ item.render = (value, values) => cloneElement(
1291
1096
  item.tableChildren,
1292
1097
  {
1293
1098
  scene: "table",
@@ -1298,7 +1103,7 @@ function Table(props) {
1298
1103
  else if (item.children === null)
1299
1104
  item.render = () => null;
1300
1105
  else if (item.children)
1301
- item.render = (value, values) => cloneElement3(
1106
+ item.render = (value, values) => cloneElement(
1302
1107
  item.children,
1303
1108
  {
1304
1109
  scene: "table",
@@ -1308,7 +1113,7 @@ function Table(props) {
1308
1113
  );
1309
1114
  if (props.extendTypes && props.extendTypes[item.type]) {
1310
1115
  if (props.extendTypes[item.type].children)
1311
- item.render = (value, values) => cloneElement3(
1116
+ item.render = (value, values) => cloneElement(
1312
1117
  props.extendTypes[item.type].children,
1313
1118
  {
1314
1119
  scene: "table",
@@ -1328,9 +1133,9 @@ function Table(props) {
1328
1133
  item.render = (value) => processValue(item, value);
1329
1134
  if (!item.onFilter)
1330
1135
  item.onFilter = (value, row) => {
1331
- if (!value || isNil2(value))
1136
+ if (!value || isNil(value))
1332
1137
  return true;
1333
- if (isNil2(row[item.id]))
1138
+ if (isNil(row[item.id]))
1334
1139
  return false;
1335
1140
  return row[item.id].trim().toLowerCase().includes(value.trim().toLowerCase());
1336
1141
  };
@@ -1341,19 +1146,22 @@ function Table(props) {
1341
1146
  setSelectedKeys,
1342
1147
  confirm,
1343
1148
  clearFilters
1344
- }) => /* @__PURE__ */ jsx14(Input2.Search, {
1345
- placeholder: `${common2.search} ${item.title}`,
1346
- allowClear: true,
1347
- onSearch: (v) => {
1348
- if (v) {
1349
- setSelectedKeys([v]);
1350
- } else {
1351
- setSelectedKeys([]);
1352
- clearFilters();
1149
+ }) => /* @__PURE__ */ jsx(
1150
+ Input.Search,
1151
+ {
1152
+ placeholder: `${common2.search} ${item.title}`,
1153
+ allowClear: true,
1154
+ onSearch: (v) => {
1155
+ if (v) {
1156
+ setSelectedKeys([v]);
1157
+ } else {
1158
+ setSelectedKeys([]);
1159
+ clearFilters();
1160
+ }
1161
+ confirm();
1353
1162
  }
1354
- confirm();
1355
1163
  }
1356
- });
1164
+ );
1357
1165
  break;
1358
1166
  case "string[]":
1359
1167
  if (!item.render)
@@ -1373,19 +1181,22 @@ function Table(props) {
1373
1181
  setSelectedKeys,
1374
1182
  confirm,
1375
1183
  clearFilters
1376
- }) => /* @__PURE__ */ jsx14(Input2.Search, {
1377
- placeholder: `${common2.search} ${item.title}`,
1378
- allowClear: true,
1379
- onSearch: (v) => {
1380
- if (v) {
1381
- setSelectedKeys([v]);
1382
- } else {
1383
- setSelectedKeys([]);
1384
- clearFilters();
1184
+ }) => /* @__PURE__ */ jsx(
1185
+ Input.Search,
1186
+ {
1187
+ placeholder: `${common2.search} ${item.title}`,
1188
+ allowClear: true,
1189
+ onSearch: (v) => {
1190
+ if (v) {
1191
+ setSelectedKeys([v]);
1192
+ } else {
1193
+ setSelectedKeys([]);
1194
+ clearFilters();
1195
+ }
1196
+ confirm();
1385
1197
  }
1386
- confirm();
1387
1198
  }
1388
- });
1199
+ );
1389
1200
  break;
1390
1201
  case "number":
1391
1202
  if (!item.render)
@@ -1396,7 +1207,7 @@ function Table(props) {
1396
1207
  item.onFilter = (value, row) => {
1397
1208
  if (value === null)
1398
1209
  return true;
1399
- if (isNil2(row[item.id]))
1210
+ if (isNil(row[item.id]))
1400
1211
  return false;
1401
1212
  return value == row[item.id];
1402
1213
  };
@@ -1407,19 +1218,22 @@ function Table(props) {
1407
1218
  setSelectedKeys,
1408
1219
  confirm,
1409
1220
  clearFilters
1410
- }) => /* @__PURE__ */ jsx14(Input2.Search, {
1411
- placeholder: `${common2.search} ${item.title}`,
1412
- allowClear: true,
1413
- onSearch: (v) => {
1414
- if (v) {
1415
- setSelectedKeys([Number(v)]);
1416
- } else {
1417
- setSelectedKeys([]);
1418
- clearFilters();
1221
+ }) => /* @__PURE__ */ jsx(
1222
+ Input.Search,
1223
+ {
1224
+ placeholder: `${common2.search} ${item.title}`,
1225
+ allowClear: true,
1226
+ onSearch: (v) => {
1227
+ if (v) {
1228
+ setSelectedKeys([Number(v)]);
1229
+ } else {
1230
+ setSelectedKeys([]);
1231
+ clearFilters();
1232
+ }
1233
+ confirm();
1419
1234
  }
1420
- confirm();
1421
1235
  }
1422
- });
1236
+ );
1423
1237
  break;
1424
1238
  case "number[]":
1425
1239
  if (!item.render)
@@ -1439,88 +1253,75 @@ function Table(props) {
1439
1253
  setSelectedKeys,
1440
1254
  confirm,
1441
1255
  clearFilters
1442
- }) => /* @__PURE__ */ jsx14(Input2.Search, {
1443
- placeholder: `${common2.search} ${item.title}`,
1444
- allowClear: true,
1445
- onSearch: (v) => {
1446
- if (v) {
1447
- setSelectedKeys([Number(v)]);
1448
- } else {
1449
- setSelectedKeys([]);
1450
- clearFilters();
1256
+ }) => /* @__PURE__ */ jsx(
1257
+ Input.Search,
1258
+ {
1259
+ placeholder: `${common2.search} ${item.title}`,
1260
+ allowClear: true,
1261
+ onSearch: (v) => {
1262
+ if (v) {
1263
+ setSelectedKeys([Number(v)]);
1264
+ } else {
1265
+ setSelectedKeys([]);
1266
+ clearFilters();
1267
+ }
1268
+ confirm();
1451
1269
  }
1452
- confirm();
1453
1270
  }
1454
- });
1271
+ );
1455
1272
  break;
1456
1273
  case "boolean":
1457
1274
  if (!item.render)
1458
- item.render = (value) => isNil2(value) ? /* @__PURE__ */ jsx14(Blank, {}) : value ? /* @__PURE__ */ jsx14(CheckOutlined2, {
1459
- style: {
1460
- marginTop: "4px",
1461
- color: "#52c41a"
1462
- }
1463
- }) : /* @__PURE__ */ jsx14(CloseOutlined2, {
1464
- style: {
1465
- marginTop: "4px",
1466
- color: "#ff4d4f"
1467
- }
1468
- });
1275
+ item.render = (value) => isNil(value) ? /* @__PURE__ */ jsx(Blank, {}) : value ? /* @__PURE__ */ jsx(CheckOutlined, { style: {
1276
+ marginTop: "4px",
1277
+ color: "#52c41a"
1278
+ } }) : /* @__PURE__ */ jsx(CloseOutlined, { style: {
1279
+ marginTop: "4px",
1280
+ color: "#ff4d4f"
1281
+ } });
1469
1282
  if (item.filterDropdown !== false)
1470
1283
  item.filterDropdown = ({
1471
1284
  setSelectedKeys,
1472
1285
  selectedKeys,
1473
1286
  confirm
1474
- }) => /* @__PURE__ */ jsxs5(Radio2.Group, {
1475
- style: { padding: 8 },
1476
- buttonStyle: "solid",
1477
- value: JSON.stringify(selectedKeys[0]),
1478
- onChange: (e) => {
1479
- const Values = {
1480
- true: true,
1481
- false: false,
1482
- null: null
1483
- };
1484
- setSelectedKeys(e.target.value ? [Values[e.target.value]] : []);
1485
- confirm();
1486
- },
1487
- children: [
1488
- /* @__PURE__ */ jsx14(Radio2.Button, {
1489
- children: common2.all
1490
- }),
1491
- /* @__PURE__ */ jsx14(Radio2.Button, {
1492
- value: "true",
1493
- children: /* @__PURE__ */ jsx14(CheckOutlined2, {
1494
- style: {
1495
- color: "#52c41a",
1496
- verticalAlign: "middle"
1497
- }
1498
- })
1499
- }),
1500
- /* @__PURE__ */ jsx14(Radio2.Button, {
1501
- value: "false",
1502
- children: /* @__PURE__ */ jsx14(CloseOutlined2, {
1503
- style: {
1504
- verticalAlign: "middle",
1505
- color: "#ff4d4f"
1506
- }
1507
- })
1508
- }),
1509
- /* @__PURE__ */ jsx14(Radio2.Button, {
1510
- value: "null",
1511
- children: common2.blank
1512
- })
1513
- ]
1514
- });
1287
+ }) => /* @__PURE__ */ jsxs(
1288
+ Radio.Group,
1289
+ {
1290
+ style: { padding: 8 },
1291
+ buttonStyle: "solid",
1292
+ value: JSON.stringify(selectedKeys[0]),
1293
+ onChange: (e) => {
1294
+ const Values = {
1295
+ true: true,
1296
+ false: false,
1297
+ null: null
1298
+ };
1299
+ setSelectedKeys(e.target.value ? [Values[e.target.value]] : []);
1300
+ confirm();
1301
+ },
1302
+ children: [
1303
+ /* @__PURE__ */ jsx(Radio.Button, { children: common2.all }),
1304
+ /* @__PURE__ */ jsx(Radio.Button, { value: "true", children: /* @__PURE__ */ jsx(CheckOutlined, { style: {
1305
+ color: "#52c41a",
1306
+ verticalAlign: "middle"
1307
+ } }) }),
1308
+ /* @__PURE__ */ jsx(Radio.Button, { value: "false", children: /* @__PURE__ */ jsx(CloseOutlined, { style: {
1309
+ verticalAlign: "middle",
1310
+ color: "#ff4d4f"
1311
+ } }) }),
1312
+ /* @__PURE__ */ jsx(Radio.Button, { value: "null", children: common2.blank })
1313
+ ]
1314
+ }
1315
+ );
1515
1316
  if (!item.onFilter)
1516
1317
  item.onFilter = (value, row) => {
1517
1318
  switch (value) {
1518
1319
  case true:
1519
- return !isNil2(row[item.id]) && row[item.id] !== false;
1320
+ return !isNil(row[item.id]) && row[item.id] !== false;
1520
1321
  case false:
1521
- return !isNil2(row[item.id]) && !row[item.id];
1322
+ return !isNil(row[item.id]) && !row[item.id];
1522
1323
  default:
1523
- return isNil2(row[item.id]);
1324
+ return isNil(row[item.id]);
1524
1325
  }
1525
1326
  };
1526
1327
  break;
@@ -1529,9 +1330,9 @@ function Table(props) {
1529
1330
  item.render = (value) => processValue(item, value);
1530
1331
  if (!item.sorter)
1531
1332
  item.sorter = (a, b, order) => {
1532
- if (isNil2(a[item.id]))
1333
+ if (isNil(a[item.id]))
1533
1334
  return order === "ascend" ? 1 : -1;
1534
- if (isNil2(b[item.id]))
1335
+ if (isNil(b[item.id]))
1535
1336
  return order === "ascend" ? -1 : 1;
1536
1337
  return new Date(a[item.id]).getTime() < new Date(b[item.id]).getTime() ? -1 : 1;
1537
1338
  };
@@ -1539,17 +1340,20 @@ function Table(props) {
1539
1340
  item.filterDropdown = ({
1540
1341
  setSelectedKeys,
1541
1342
  confirm
1542
- }) => /* @__PURE__ */ jsx14(DatePicker2.RangePicker, {
1543
- onChange: (dates) => {
1544
- setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
1545
- confirm();
1343
+ }) => /* @__PURE__ */ jsx(
1344
+ DatePicker.RangePicker,
1345
+ {
1346
+ onChange: (dates) => {
1347
+ setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
1348
+ confirm();
1349
+ }
1546
1350
  }
1547
- });
1351
+ );
1548
1352
  if (!item.onFilter)
1549
1353
  item.onFilter = (value, row) => {
1550
- if (isNil2(value[0]))
1354
+ if (isNil(value[0]))
1551
1355
  return true;
1552
- if (isNil2(row[item.id]))
1356
+ if (isNil(row[item.id]))
1553
1357
  return false;
1554
1358
  return dayjs2(row[item.id]) >= dayjs2(value[0]) && dayjs2(row[item.id]) <= dayjs2(value[1]);
1555
1359
  };
@@ -1559,9 +1363,9 @@ function Table(props) {
1559
1363
  item.render = (value) => processValue(item, value);
1560
1364
  if (!item.sorter)
1561
1365
  item.sorter = (a, b, order) => {
1562
- if (isNil2(a[item.id]))
1366
+ if (isNil(a[item.id]))
1563
1367
  return order === "ascend" ? 1 : -1;
1564
- if (isNil2(b[item.id]))
1368
+ if (isNil(b[item.id]))
1565
1369
  return order === "ascend" ? -1 : 1;
1566
1370
  return new Date(a[item.id]).getTime() < new Date(b[item.id]).getTime() ? -1 : 1;
1567
1371
  };
@@ -1569,45 +1373,53 @@ function Table(props) {
1569
1373
  item.filterDropdown = ({
1570
1374
  setSelectedKeys,
1571
1375
  confirm
1572
- }) => /* @__PURE__ */ jsx14(DatePicker2.RangePicker, {
1573
- onChange: (dates) => {
1574
- setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
1575
- confirm();
1376
+ }) => /* @__PURE__ */ jsx(
1377
+ DatePicker.RangePicker,
1378
+ {
1379
+ onChange: (dates) => {
1380
+ setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
1381
+ confirm();
1382
+ }
1576
1383
  }
1577
- });
1384
+ );
1578
1385
  if (!item.onFilter)
1579
1386
  item.onFilter = (value, row) => {
1580
- if (isNil2(value[0]))
1387
+ if (isNil(value[0]))
1581
1388
  return true;
1582
- if (isNil2(row[item.id]))
1389
+ if (isNil(row[item.id]))
1583
1390
  return false;
1584
1391
  return dayjs2(row[item.id]) >= dayjs2(value[0]) && dayjs2(row[item.id]) <= dayjs2(value[1]);
1585
1392
  };
1586
1393
  break;
1587
1394
  case "object":
1588
1395
  if (!item.render)
1589
- item.render = (value) => /* @__PURE__ */ jsx14(Description, {
1590
- items: item.object,
1591
- dataSource: value || {},
1592
- column: 1
1593
- });
1396
+ item.render = (value) => /* @__PURE__ */ jsx(
1397
+ Description,
1398
+ {
1399
+ items: item.object,
1400
+ dataSource: value || {},
1401
+ column: 1
1402
+ }
1403
+ );
1594
1404
  break;
1595
1405
  case "object[]":
1596
1406
  if (!item.render)
1597
- item.render = (value) => /* @__PURE__ */ jsx14(Fragment5, {
1598
- children: value.map((v, i) => /* @__PURE__ */ jsx14(Description, {
1407
+ item.render = (value) => /* @__PURE__ */ jsx(Fragment, { children: value.map((v, i) => /* @__PURE__ */ jsx(
1408
+ Description,
1409
+ {
1599
1410
  items: item.object,
1600
1411
  dataSource: v || [],
1601
1412
  column: 1
1602
- }, i))
1603
- });
1413
+ },
1414
+ i
1415
+ )) });
1604
1416
  break;
1605
1417
  default:
1606
1418
  if (!item.render)
1607
1419
  item.render = (value) => processValue(item, value);
1608
1420
  if (!item.onFilter)
1609
1421
  item.onFilter = (value, row) => {
1610
- if (value === null && isNil2(row[item.id]))
1422
+ if (value === null && isNil(row[item.id]))
1611
1423
  return true;
1612
1424
  return value === row[item.id];
1613
1425
  };
@@ -1616,7 +1428,7 @@ function Table(props) {
1616
1428
  }
1617
1429
  setColumns(props.items);
1618
1430
  }, [JSON.stringify(props.items)]);
1619
- useEffect6(() => {
1431
+ useEffect(() => {
1620
1432
  if (!props.dataSource || !columns)
1621
1433
  return;
1622
1434
  for (const column of columns) {
@@ -1639,19 +1451,28 @@ function Table(props) {
1639
1451
  if (!columns)
1640
1452
  return null;
1641
1453
  if (props.dataSource)
1642
- return /* @__PURE__ */ jsx14(AntdTable, {
1643
- ...props,
1644
- rowKey: props.rowKey || "id",
1645
- columns,
1646
- dataSource: props.dataSource
1647
- });
1648
- return /* @__PURE__ */ jsx14(FaasDataWrapper, {
1649
- ...props.faasData,
1650
- children: /* @__PURE__ */ jsx14(FaasDataTable, {
1651
- props,
1652
- columns
1653
- })
1654
- });
1454
+ return /* @__PURE__ */ jsx(
1455
+ Table$1,
1456
+ {
1457
+ ...props,
1458
+ rowKey: props.rowKey || "id",
1459
+ columns,
1460
+ dataSource: props.dataSource
1461
+ }
1462
+ );
1463
+ return /* @__PURE__ */ jsx(
1464
+ FaasDataWrapper,
1465
+ {
1466
+ ...props.faasData,
1467
+ children: /* @__PURE__ */ jsx(
1468
+ FaasDataTable,
1469
+ {
1470
+ props,
1471
+ columns
1472
+ }
1473
+ )
1474
+ }
1475
+ );
1655
1476
  }
1656
1477
  function FaasDataTable({
1657
1478
  props,
@@ -1660,8 +1481,8 @@ function FaasDataTable({
1660
1481
  params,
1661
1482
  reload
1662
1483
  }) {
1663
- const [currentColumns, setCurrentColumns] = useState7(columns);
1664
- useEffect6(() => {
1484
+ const [currentColumns, setCurrentColumns] = useState(columns);
1485
+ useEffect(() => {
1665
1486
  if (!data || Array.isArray(data))
1666
1487
  return;
1667
1488
  setCurrentColumns((prev) => {
@@ -1673,7 +1494,7 @@ function FaasDataTable({
1673
1494
  text: v.label,
1674
1495
  value: v.value
1675
1496
  })).concat({
1676
- text: /* @__PURE__ */ jsx14(Blank, {}),
1497
+ text: /* @__PURE__ */ jsx(Blank, {}),
1677
1498
  value: null
1678
1499
  });
1679
1500
  column.render = (value) => processValue(column, value);
@@ -1688,7 +1509,7 @@ function FaasDataTable({
1688
1509
  }));
1689
1510
  if (filters.length)
1690
1511
  column.filters = filters.concat({
1691
- text: /* @__PURE__ */ jsx14(Blank, {}),
1512
+ text: /* @__PURE__ */ jsx(Blank, {}),
1692
1513
  value: null
1693
1514
  });
1694
1515
  }
@@ -1697,121 +1518,97 @@ function FaasDataTable({
1697
1518
  });
1698
1519
  }, [columns, data]);
1699
1520
  if (!data)
1700
- return /* @__PURE__ */ jsx14(AntdTable, {
1701
- ...props,
1702
- loading: props.loading,
1703
- rowKey: props.rowKey || "id",
1704
- columns: currentColumns,
1705
- dataSource: []
1706
- });
1521
+ return /* @__PURE__ */ jsx(
1522
+ Table$1,
1523
+ {
1524
+ ...props,
1525
+ loading: props.loading,
1526
+ rowKey: props.rowKey || "id",
1527
+ columns: currentColumns,
1528
+ dataSource: []
1529
+ }
1530
+ );
1707
1531
  if (Array.isArray(data))
1708
- return /* @__PURE__ */ jsx14(AntdTable, {
1532
+ return /* @__PURE__ */ jsx(
1533
+ Table$1,
1534
+ {
1535
+ ...props,
1536
+ loading: props.loading,
1537
+ rowKey: props.rowKey || "id",
1538
+ columns: currentColumns,
1539
+ dataSource: data
1540
+ }
1541
+ );
1542
+ return /* @__PURE__ */ jsx(
1543
+ Table$1,
1544
+ {
1709
1545
  ...props,
1710
1546
  loading: props.loading,
1711
1547
  rowKey: props.rowKey || "id",
1712
1548
  columns: currentColumns,
1713
- dataSource: data
1714
- });
1715
- return /* @__PURE__ */ jsx14(AntdTable, {
1716
- ...props,
1717
- loading: props.loading,
1718
- rowKey: props.rowKey || "id",
1719
- columns: currentColumns,
1720
- dataSource: data.rows,
1721
- pagination: {
1722
- ...props.pagination,
1723
- ...data.pagination
1724
- },
1725
- onChange: (pagination, filters, sorter, extra) => {
1726
- if (props.onChange) {
1727
- const processed = props.onChange(pagination, filters, sorter, extra);
1549
+ dataSource: data.rows,
1550
+ pagination: {
1551
+ ...props.pagination,
1552
+ ...data.pagination
1553
+ },
1554
+ onChange: (pagination, filters, sorter, extra) => {
1555
+ if (props.onChange) {
1556
+ const processed = props.onChange(pagination, filters, sorter, extra);
1557
+ reload({
1558
+ ...params,
1559
+ pagination: processed.pagination,
1560
+ filters: processed.filters,
1561
+ sorter: processed.sorter,
1562
+ extra: processed.extra
1563
+ });
1564
+ return;
1565
+ }
1728
1566
  reload({
1729
1567
  ...params,
1730
- pagination: processed.pagination,
1731
- filters: processed.filters,
1732
- sorter: processed.sorter,
1733
- extra: processed.extra
1568
+ pagination,
1569
+ filters,
1570
+ sorter
1734
1571
  });
1735
- return;
1736
1572
  }
1737
- reload({
1738
- ...params,
1739
- pagination,
1740
- filters,
1741
- sorter
1742
- });
1743
1573
  }
1744
- });
1574
+ );
1745
1575
  }
1746
-
1747
- // src/Tabs.tsx
1748
- import { Tabs as Origin2 } from "antd";
1749
- import { jsx as jsx15 } from "react/jsx-runtime";
1750
1576
  function Tabs(props) {
1751
- return /* @__PURE__ */ jsx15(Origin2, {
1752
- ...props,
1753
- items: props.items.filter(Boolean).map((i) => ({
1754
- ...i,
1755
- key: i.key || i.id,
1756
- label: i.label || i.title || i.id
1757
- }))
1758
- });
1577
+ return /* @__PURE__ */ jsx(
1578
+ Tabs$1,
1579
+ {
1580
+ ...props,
1581
+ items: props.items.filter(Boolean).map((i) => ({
1582
+ ...i,
1583
+ key: i.key || i.id,
1584
+ label: i.label || i.title || i.id
1585
+ }))
1586
+ }
1587
+ );
1759
1588
  }
1760
-
1761
- // src/Title.tsx
1762
- import { useEffect as useEffect7, cloneElement as cloneElement4 } from "react";
1763
- import { Fragment as Fragment6, jsx as jsx16 } from "react/jsx-runtime";
1764
1589
  function Title(props) {
1765
1590
  const { Title: Title2 } = useConfigContext();
1766
- useEffect7(() => {
1591
+ useEffect(() => {
1767
1592
  const title = Array.isArray(props.title) ? props.title : [props.title];
1768
1593
  document.title = title.concat(props.suffix || Title2.suffix).filter((t) => !!t).join(props.separator || Title2.separator);
1769
1594
  }, [props]);
1770
1595
  if (props.h1) {
1771
1596
  if (typeof props.h1 === "boolean")
1772
- return /* @__PURE__ */ jsx16("h1", {
1597
+ return /* @__PURE__ */ jsx("h1", { children: Array.isArray(props.title) ? props.title[0] : props.title });
1598
+ return /* @__PURE__ */ jsx(
1599
+ "h1",
1600
+ {
1601
+ className: props.h1.className,
1602
+ style: props.h1.style,
1773
1603
  children: Array.isArray(props.title) ? props.title[0] : props.title
1774
- });
1775
- return /* @__PURE__ */ jsx16("h1", {
1776
- className: props.h1.className,
1777
- style: props.h1.style,
1778
- children: Array.isArray(props.title) ? props.title[0] : props.title
1779
- });
1604
+ }
1605
+ );
1780
1606
  }
1781
1607
  if (props.plain)
1782
- return /* @__PURE__ */ jsx16(Fragment6, {
1783
- children: Array.isArray(props.title) ? props.title[0] : props.title
1784
- });
1608
+ return /* @__PURE__ */ jsx(Fragment, { children: Array.isArray(props.title) ? props.title[0] : props.title });
1785
1609
  if (props.children)
1786
- return cloneElement4(props.children, { title: props.title });
1610
+ return cloneElement(props.children, { title: props.title });
1787
1611
  return null;
1788
1612
  }
1789
- export {
1790
- App,
1791
- Blank,
1792
- ConfigContext,
1793
- ConfigProvider2 as ConfigProvider,
1794
- Description,
1795
- Drawer,
1796
- ErrorBoundary,
1797
- FaasDataWrapper,
1798
- Form,
1799
- FormItem,
1800
- Link,
1801
- Loading,
1802
- Modal,
1803
- PageNotFound,
1804
- Routes,
1805
- Table,
1806
- Tabs,
1807
- Title,
1808
- faas2 as faas,
1809
- lazy,
1810
- transferOptions,
1811
- transferValue,
1812
- useApp,
1813
- useConfigContext,
1814
- useDrawer,
1815
- useFaas,
1816
- useModal
1817
- };
1613
+
1614
+ export { App, Blank, ConfigContext, ConfigProvider2 as ConfigProvider, Description, ErrorBoundary, FaasDataWrapper, Form, FormItem, Link, Loading, PageNotFound, Routes, Table, Tabs, Title, transferOptions, transferValue, useApp, useConfigContext, useDrawer, useModal };