@faasjs/ant-design 0.0.3-beta.70 → 0.0.3-beta.72

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.
Files changed (3) hide show
  1. package/dist/index.js +714 -669
  2. package/dist/index.mjs +686 -640
  3. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,27 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
8
  var __export = (target, all) => {
26
9
  for (var name in all)
27
10
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -35,10 +18,6 @@ var __copyProps = (to, from, except, desc) => {
35
18
  return to;
36
19
  };
37
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
38
- // If the importer is in node compatibility mode or this is not an ESM
39
- // file that has been converted to a CommonJS file using a Babel-
40
- // compatible transform (i.e. "__esModule" has not been set), then set
41
- // "default" to the CommonJS "module.exports" for node compatibility.
42
21
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
43
22
  mod
44
23
  ));
@@ -85,17 +64,24 @@ var import_antd = require("antd");
85
64
  var import_react = require("react");
86
65
  var import_jsx_runtime = require("react/jsx-runtime");
87
66
  function useModal(init) {
88
- const [props, setProps] = (0, import_react.useState)(__spreadValues({
67
+ const [props, setProps] = (0, import_react.useState)({
89
68
  open: false,
90
- onCancel: () => setProps((prev) => __spreadProps(__spreadValues({}, prev), {
69
+ onCancel: () => setProps((prev) => ({
70
+ ...prev,
91
71
  open: false
92
- }))
93
- }, init));
72
+ })),
73
+ ...init
74
+ });
94
75
  return {
95
- modal: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Modal, __spreadValues({}, props)),
76
+ modal: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Modal, {
77
+ ...props
78
+ }),
96
79
  modalProps: props,
97
80
  setModalProps(changes) {
98
- setProps((prev) => __spreadValues(__spreadValues({}, prev), changes));
81
+ setProps((prev) => ({
82
+ ...prev,
83
+ ...changes
84
+ }));
99
85
  }
100
86
  };
101
87
  }
@@ -103,26 +89,33 @@ function useModal(init) {
103
89
  // src/Drawer.tsx
104
90
  var import_antd2 = require("antd");
105
91
  var import_react2 = require("react");
106
- var import_jsx_runtime2 = require("react/jsx-runtime");
92
+ var import_jsx_runtime = require("react/jsx-runtime");
107
93
  function useDrawer(init) {
108
- const [props, setProps] = (0, import_react2.useState)(__spreadValues({
94
+ const [props, setProps] = (0, import_react2.useState)({
109
95
  open: false,
110
- onClose: () => setProps((prev) => __spreadProps(__spreadValues({}, prev), {
96
+ onClose: () => setProps((prev) => ({
97
+ ...prev,
111
98
  open: false
112
- }))
113
- }, init));
99
+ })),
100
+ ...init
101
+ });
114
102
  return {
115
- drawer: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_antd2.Drawer, __spreadValues({}, props)),
103
+ drawer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Drawer, {
104
+ ...props
105
+ }),
116
106
  drawerProps: props,
117
107
  setDrawerProps(changes) {
118
- setProps((prev) => __spreadValues(__spreadValues({}, prev), changes));
108
+ setProps((prev) => ({
109
+ ...prev,
110
+ ...changes
111
+ }));
119
112
  }
120
113
  };
121
114
  }
122
115
 
123
116
  // src/App.tsx
124
117
  var import_react_router_dom = require("react-router-dom");
125
- var import_jsx_runtime3 = require("react/jsx-runtime");
118
+ var import_jsx_runtime = require("react/jsx-runtime");
126
119
  var AppContext = (0, import_react3.createContext)({
127
120
  message: {},
128
121
  notification: {},
@@ -137,7 +130,9 @@ function RoutesApp(props) {
137
130
  setDrawerProps({ open: false });
138
131
  setModalProps({ open: false });
139
132
  }, [location]);
140
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: props.children });
133
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
134
+ children: props.children
135
+ });
141
136
  }
142
137
  function App(props) {
143
138
  const [messageApi, messageContextHolder] = import_antd3.message.useMessage();
@@ -158,21 +153,30 @@ function App(props) {
158
153
  setDrawerProps
159
154
  ]
160
155
  );
161
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
162
- import_cssinjs.StyleProvider,
163
- __spreadProps(__spreadValues({}, Object.assign(props.styleProviderProps || {}, {
156
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_cssinjs.StyleProvider, {
157
+ ...Object.assign(props.styleProviderProps || {}, {
164
158
  hashPriority: "high",
165
159
  transformers: [import_cssinjs.legacyLogicalPropertiesTransformer]
166
- })), {
167
- children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_antd3.ConfigProvider, __spreadProps(__spreadValues({}, props.configProviderProps), { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(AppContext.Provider, { value: memoizedContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_router_dom.BrowserRouter, __spreadProps(__spreadValues({}, props.browserRouterProps), { children: [
168
- messageContextHolder,
169
- notificationContextHolder,
170
- modal,
171
- drawer,
172
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(RoutesApp, { children: props.children })
173
- ] })) }) }))
160
+ }),
161
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.ConfigProvider, {
162
+ ...props.configProviderProps,
163
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AppContext.Provider, {
164
+ value: memoizedContextValue,
165
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_router_dom.BrowserRouter, {
166
+ ...props.browserRouterProps,
167
+ children: [
168
+ messageContextHolder,
169
+ notificationContextHolder,
170
+ modal,
171
+ drawer,
172
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RoutesApp, {
173
+ children: props.children
174
+ })
175
+ ]
176
+ })
177
+ })
174
178
  })
175
- );
179
+ });
176
180
  }
177
181
  function useApp() {
178
182
  return (0, import_react3.useContext)(AppContext);
@@ -186,7 +190,7 @@ var import_lodash_es2 = require("lodash-es");
186
190
  // src/Config.tsx
187
191
  var import_react4 = require("react");
188
192
  var import_lodash_es = require("lodash-es");
189
- var import_jsx_runtime4 = require("react/jsx-runtime");
193
+ var import_jsx_runtime = require("react/jsx-runtime");
190
194
  var isZH = /^zh/i.test(navigator.language);
191
195
  var zh = {
192
196
  lang: "zh",
@@ -242,17 +246,23 @@ function ConfigProvider2({
242
246
  } else
243
247
  setValues((0, import_lodash_es.defaultsDeep)(config, values));
244
248
  }, []);
245
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ConfigContext.Provider, { value: values, children });
249
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfigContext.Provider, {
250
+ value: values,
251
+ children
252
+ });
246
253
  }
247
254
  function useConfigContext() {
248
255
  return (0, import_react4.useContext)(ConfigContext);
249
256
  }
250
257
 
251
258
  // src/Blank.tsx
252
- var import_jsx_runtime5 = require("react/jsx-runtime");
259
+ var import_jsx_runtime = require("react/jsx-runtime");
253
260
  function Blank(options) {
254
261
  const { Blank: Blank2 } = useConfigContext();
255
- return !options || (0, import_lodash_es2.isNil)(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd4.Typography.Text, { disabled: true, children: (options == null ? void 0 : options.text) || Blank2.text }) : options.value;
262
+ return !options || (0, import_lodash_es2.isNil)(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Typography.Text, {
263
+ disabled: true,
264
+ children: (options == null ? void 0 : options.text) || Blank2.text
265
+ }) : options.value;
256
266
  }
257
267
 
258
268
  // src/data.ts
@@ -293,35 +303,45 @@ var import_react5 = require("@faasjs/react");
293
303
 
294
304
  // src/Loading.tsx
295
305
  var import_antd5 = require("antd");
296
- var import_jsx_runtime6 = require("react/jsx-runtime");
306
+ var import_jsx_runtime = require("react/jsx-runtime");
297
307
  function Loading(props) {
298
308
  if (props.loading === false)
299
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: props.children });
300
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { style: __spreadValues(__spreadValues({}, props.style || {}), !props.size || props.size === "large" ? {
301
- margin: "20vh auto",
302
- textAlign: "center"
303
- } : {}), children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_antd5.Spin, { size: props.size || "large" }) });
309
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
310
+ children: props.children
311
+ });
312
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
313
+ style: {
314
+ ...props.style || {},
315
+ ...!props.size || props.size === "large" ? {
316
+ margin: "20vh auto",
317
+ textAlign: "center"
318
+ } : {}
319
+ },
320
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Spin, {
321
+ size: props.size || "large"
322
+ })
323
+ });
304
324
  }
305
325
 
306
326
  // src/FaasDataWrapper.tsx
307
- var import_jsx_runtime7 = require("react/jsx-runtime");
327
+ var import_jsx_runtime = require("react/jsx-runtime");
308
328
  function FaasDataWrapper(props) {
309
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
310
- import_react5.FaasDataWrapper,
311
- __spreadValues({
312
- fallback: props.loading || /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Loading, __spreadValues({}, props.loadingProps))
313
- }, props)
314
- );
329
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react5.FaasDataWrapper, {
330
+ fallback: props.loading || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {
331
+ ...props.loadingProps
332
+ }),
333
+ ...props
334
+ });
315
335
  }
316
336
 
317
337
  // src/Description.tsx
318
- var import_jsx_runtime8 = require("react/jsx-runtime");
338
+ var import_jsx_runtime = require("react/jsx-runtime");
319
339
  function DescriptionItemContent(props) {
320
340
  var _a;
321
341
  const [computedProps, setComputedProps] = (0, import_react6.useState)();
322
342
  (0, import_react6.useEffect)(() => {
323
343
  var _a2, _b;
324
- const propsCopy = __spreadValues({}, props);
344
+ const propsCopy = { ...props };
325
345
  if (!propsCopy.item.title)
326
346
  propsCopy.item.title = (0, import_lodash_es4.upperFirst)(propsCopy.item.id);
327
347
  if (!propsCopy.item.type)
@@ -358,7 +378,9 @@ function DescriptionItemContent(props) {
358
378
  }
359
379
  );
360
380
  else if (computedProps.extendTypes[computedProps.item.type].render)
361
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: computedProps.extendTypes[computedProps.item.type].render(computedProps.value, computedProps.values, 0, "description") });
381
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
382
+ children: computedProps.extendTypes[computedProps.item.type].render(computedProps.value, computedProps.values, 0, "description")
383
+ });
362
384
  else
363
385
  throw Error(computedProps.item.type + " requires children or render");
364
386
  if (computedProps.item.descriptionChildren === null)
@@ -378,120 +400,112 @@ function DescriptionItemContent(props) {
378
400
  values: computedProps.values
379
401
  });
380
402
  if (computedProps.item.descriptionRender)
381
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: computedProps.item.descriptionRender(computedProps.value, computedProps.values, 0, "description") });
403
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
404
+ children: computedProps.item.descriptionRender(computedProps.value, computedProps.values, 0, "description")
405
+ });
382
406
  if (computedProps.item.render)
383
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: computedProps.item.render(computedProps.value, computedProps.values, 0, "description") });
407
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
408
+ children: computedProps.item.render(computedProps.value, computedProps.values, 0, "description")
409
+ });
384
410
  if (computedProps.value === null || Array.isArray(computedProps.value) && !computedProps.value.length)
385
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Blank, {});
411
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {});
386
412
  switch (computedProps.item.type) {
387
413
  case "string[]":
388
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: computedProps.value.join(", ") });
414
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
415
+ children: computedProps.value.join(", ")
416
+ });
389
417
  case "number":
390
418
  return computedProps.value || null;
391
419
  case "number[]":
392
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: computedProps.value.join(", ") });
420
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
421
+ children: computedProps.value.join(", ")
422
+ });
393
423
  case "boolean":
394
- return computedProps.value ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons.CheckOutlined, { style: {
395
- marginTop: "4px",
396
- color: "#52c41a"
397
- } }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_icons.CloseOutlined, { style: {
398
- marginTop: "4px",
399
- color: "#ff4d4f"
400
- } });
424
+ return computedProps.value ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckOutlined, {
425
+ style: {
426
+ marginTop: "4px",
427
+ color: "#52c41a"
428
+ }
429
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseOutlined, {
430
+ style: {
431
+ marginTop: "4px",
432
+ color: "#ff4d4f"
433
+ }
434
+ });
401
435
  case "time":
402
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: computedProps.value.format("YYYY-MM-DD HH:mm:ss") });
436
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
437
+ children: computedProps.value.format("YYYY-MM-DD HH:mm:ss")
438
+ });
403
439
  case "date":
404
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: computedProps.value.format("YYYY-MM-DD") });
440
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
441
+ children: computedProps.value.format("YYYY-MM-DD")
442
+ });
405
443
  case "object":
406
444
  if (!computedProps.value)
407
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Blank, {});
408
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
409
- Description,
410
- {
411
- items: computedProps.item.object,
412
- dataSource: computedProps.value,
413
- column: 1
414
- }
415
- );
445
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {});
446
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
447
+ items: computedProps.item.object,
448
+ dataSource: computedProps.value,
449
+ column: 1
450
+ });
416
451
  case "object[]":
417
452
  if (!((_a = computedProps.value) == null ? void 0 : _a.length))
418
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Blank, {});
419
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_antd6.Space, { direction: "vertical", children: computedProps.value.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
420
- Description,
421
- {
453
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {});
454
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Space, {
455
+ direction: "vertical",
456
+ children: computedProps.value.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
422
457
  items: computedProps.item.object,
423
458
  dataSource: value,
424
459
  column: 1
425
- },
426
- index
427
- )) });
460
+ }, index))
461
+ });
428
462
  default:
429
463
  return computedProps.value || null;
430
464
  }
431
465
  }
432
466
  function Description(props) {
433
467
  if (props.dataSource)
434
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
435
- import_antd6.Descriptions,
436
- __spreadProps(__spreadValues({}, props), {
437
- title: (0, import_lodash_es4.isFunction)(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
468
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Descriptions, {
469
+ ...props,
470
+ title: (0, import_lodash_es4.isFunction)(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
471
+ children: props.items.map((item) => {
472
+ return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Descriptions.Item, {
473
+ label: item.title || (0, import_lodash_es4.upperFirst)(item.id),
474
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
475
+ item,
476
+ value: props.dataSource[item.id],
477
+ values: props.dataSource,
478
+ extendTypes: props.extendTypes
479
+ })
480
+ }, item.id) : null;
481
+ }).filter(Boolean)
482
+ });
483
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FaasDataWrapper, {
484
+ render: ({ data }) => {
485
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Descriptions, {
486
+ ...props,
487
+ title: (0, import_lodash_es4.isFunction)(props.renderTitle) ? props.renderTitle(data) : props.title,
438
488
  children: props.items.map((item) => {
439
- return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
440
- import_antd6.Descriptions.Item,
441
- {
442
- label: item.title || (0, import_lodash_es4.upperFirst)(item.id),
443
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
444
- DescriptionItemContent,
445
- {
446
- item,
447
- value: props.dataSource[item.id],
448
- values: props.dataSource,
449
- extendTypes: props.extendTypes
450
- }
451
- )
452
- },
453
- item.id
454
- ) : null;
489
+ return !item.if || item.if(data) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Descriptions.Item, {
490
+ label: item.title || (0, import_lodash_es4.upperFirst)(item.id),
491
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
492
+ item,
493
+ value: data[item.id],
494
+ values: data,
495
+ extendTypes: props.extendTypes
496
+ })
497
+ }, item.id) : null;
455
498
  }).filter(Boolean)
456
- })
457
- );
458
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
459
- FaasDataWrapper,
460
- __spreadValues({
461
- render: ({ data }) => {
462
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
463
- import_antd6.Descriptions,
464
- __spreadProps(__spreadValues({}, props), {
465
- title: (0, import_lodash_es4.isFunction)(props.renderTitle) ? props.renderTitle(data) : props.title,
466
- children: props.items.map((item) => {
467
- return !item.if || item.if(data) ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
468
- import_antd6.Descriptions.Item,
469
- {
470
- label: item.title || (0, import_lodash_es4.upperFirst)(item.id),
471
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
472
- DescriptionItemContent,
473
- {
474
- item,
475
- value: data[item.id],
476
- values: data,
477
- extendTypes: props.extendTypes
478
- }
479
- )
480
- },
481
- item.id
482
- ) : null;
483
- }).filter(Boolean)
484
- })
485
- );
486
- }
487
- }, props.faasData)
488
- );
499
+ });
500
+ },
501
+ ...props.faasData
502
+ });
489
503
  }
490
504
 
491
505
  // src/ErrorBoundary.tsx
492
506
  var import_react7 = require("react");
493
507
  var import_antd7 = require("antd");
494
- var import_jsx_runtime9 = require("react/jsx-runtime");
508
+ var import_jsx_runtime = require("react/jsx-runtime");
495
509
  var ErrorBoundary = class extends import_react7.Component {
496
510
  constructor(props) {
497
511
  super(props);
@@ -519,17 +533,17 @@ var ErrorBoundary = class extends import_react7.Component {
519
533
  if (error) {
520
534
  if (this.props.onError)
521
535
  return this.props.onError(error, info);
522
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
523
- import_antd7.Alert,
524
- {
525
- type: "error",
526
- message: errorMessage,
527
- description: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("pre", { style: {
536
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Alert, {
537
+ type: "error",
538
+ message: errorMessage,
539
+ description: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
540
+ style: {
528
541
  fontSize: "0.9em",
529
542
  overflowX: "auto"
530
- }, children: errorDescription })
531
- }
532
- );
543
+ },
544
+ children: errorDescription
545
+ })
546
+ });
533
547
  }
534
548
  return children;
535
549
  }
@@ -545,7 +559,7 @@ var import_antd8 = require("antd");
545
559
  var import_icons2 = require("@ant-design/icons");
546
560
  var import_react8 = require("react");
547
561
  var import_lodash_es5 = require("lodash-es");
548
- var import_jsx_runtime10 = require("react/jsx-runtime");
562
+ var import_jsx_runtime = require("react/jsx-runtime");
549
563
  function processProps(propsCopy, config) {
550
564
  if (!propsCopy.title)
551
565
  propsCopy.title = (0, import_lodash_es5.upperFirst)(propsCopy.id);
@@ -599,7 +613,7 @@ function FormItem(props) {
599
613
  const { common: common2 } = useConfigContext();
600
614
  const [hidden, setHidden] = (0, import_react8.useState)(props.hidden || false);
601
615
  (0, import_react8.useEffect)(() => {
602
- const propsCopy = __spreadValues({}, props);
616
+ const propsCopy = { ...props };
603
617
  if (propsCopy.extendTypes) {
604
618
  setExtendTypes(propsCopy.extendTypes);
605
619
  delete propsCopy.extendTypes;
@@ -622,248 +636,312 @@ function FormItem(props) {
622
636
  if (!computedProps)
623
637
  return null;
624
638
  if (hidden)
625
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
626
- import_antd8.Form.Item,
627
- __spreadProps(__spreadValues({}, computedProps), {
628
- noStyle: true,
629
- rules: [],
630
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Input, { hidden: true })
639
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
640
+ ...computedProps,
641
+ noStyle: true,
642
+ rules: [],
643
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Input, {
644
+ hidden: true
631
645
  })
632
- );
646
+ });
633
647
  if (extendTypes && extendTypes[computedProps.type])
634
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, __spreadProps(__spreadValues({}, computedProps), { children: extendTypes[computedProps.type].children }));
648
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
649
+ ...computedProps,
650
+ children: extendTypes[computedProps.type].children
651
+ });
635
652
  if (computedProps.formChildren === null)
636
653
  return null;
637
654
  if (computedProps.formChildren)
638
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, __spreadProps(__spreadValues({}, computedProps), { children: (0, import_react8.cloneElement)(computedProps.formChildren, { scene: "form" }) }));
655
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
656
+ ...computedProps,
657
+ children: (0, import_react8.cloneElement)(computedProps.formChildren, { scene: "form" })
658
+ });
639
659
  if (computedProps.children === null)
640
660
  return null;
641
661
  if (computedProps.children)
642
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, __spreadProps(__spreadValues({}, computedProps), { children: (0, import_react8.cloneElement)(computedProps.children, { scene: "form" }) }));
662
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
663
+ ...computedProps,
664
+ children: (0, import_react8.cloneElement)(computedProps.children, { scene: "form" })
665
+ });
643
666
  if (computedProps.formRender)
644
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, __spreadProps(__spreadValues({}, computedProps), { children: computedProps.formRender(null, null, 0, "form") }));
667
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
668
+ ...computedProps,
669
+ children: computedProps.formRender(null, null, 0, "form")
670
+ });
645
671
  if (computedProps.render)
646
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, __spreadProps(__spreadValues({}, computedProps), { children: computedProps.render(null, null, 0, "form") }));
672
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
673
+ ...computedProps,
674
+ children: computedProps.render(null, null, 0, "form")
675
+ });
647
676
  switch (computedProps.type) {
648
677
  case "string":
649
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, __spreadProps(__spreadValues({}, computedProps), { children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Select, __spreadValues({}, computedProps.input)) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Input, __spreadValues({}, computedProps.input)) }));
678
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
679
+ ...computedProps,
680
+ children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Select, {
681
+ ...computedProps.input
682
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Input, {
683
+ ...computedProps.input
684
+ })
685
+ });
650
686
  case "string[]":
651
687
  if (computedProps.options)
652
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, __spreadProps(__spreadValues({}, computedProps), { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
653
- import_antd8.Select,
654
- __spreadValues({
655
- mode: "multiple"
656
- }, computedProps.input)
657
- ) }));
658
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
659
- import_antd8.Form.List,
660
- {
661
- name: computedProps.name,
662
- rules: computedProps.rules,
663
- children: (fields, { add, remove }, { errors }) => {
664
- var _a2;
665
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
666
- computedProps.label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ant-form-item-label", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: computedProps.rules.find((r) => r.required) && "ant-form-item-required", children: computedProps.label }) }),
688
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
689
+ ...computedProps,
690
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Select, {
691
+ mode: "multiple",
692
+ ...computedProps.input
693
+ })
694
+ });
695
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.List, {
696
+ name: computedProps.name,
697
+ rules: computedProps.rules,
698
+ children: (fields, { add, remove }, { errors }) => {
699
+ var _a2;
700
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
701
+ children: [
702
+ computedProps.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
703
+ className: "ant-form-item-label",
704
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", {
705
+ className: computedProps.rules.find((r) => r.required) && "ant-form-item-required",
706
+ children: computedProps.label
707
+ })
708
+ }),
667
709
  fields.map((field) => {
668
710
  var _a3;
669
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
670
- import_antd8.Row,
671
- {
711
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
712
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd8.Row, {
672
713
  gutter: 24,
673
714
  style: { flexFlow: "row nowrap" },
674
715
  children: [
675
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Col, { span: 23, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
676
- import_antd8.Form.Item,
677
- __spreadProps(__spreadValues({}, field), {
716
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Col, {
717
+ span: 23,
718
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
719
+ ...field,
678
720
  noStyle: true,
679
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Input, __spreadValues({}, computedProps.input))
721
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Input, {
722
+ ...computedProps.input
723
+ })
680
724
  })
681
- ) }),
682
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Col, { span: 1, children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
683
- import_antd8.Button,
684
- {
725
+ }),
726
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Col, {
727
+ span: 1,
728
+ children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
685
729
  danger: true,
686
730
  type: "link",
687
731
  style: { float: "right" },
688
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons2.MinusCircleOutlined, {}),
732
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.MinusCircleOutlined, {}),
689
733
  onClick: () => remove(field.name)
690
- }
691
- ) })
734
+ })
735
+ })
692
736
  ]
693
- }
694
- ) }, field.key);
737
+ })
738
+ }, field.key);
695
739
  }),
696
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_antd8.Form.Item, { children: [
697
- !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
698
- import_antd8.Button,
699
- {
740
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd8.Form.Item, {
741
+ children: [
742
+ !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
700
743
  type: "dashed",
701
744
  block: true,
702
745
  onClick: () => add(),
703
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons2.PlusOutlined, {})
704
- }
705
- ),
706
- computedProps.extra && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ant-form-item-extra", children: computedProps.extra }),
707
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.ErrorList, { errors })
708
- ] })
709
- ] });
710
- }
746
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
747
+ }),
748
+ computedProps.extra && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
749
+ className: "ant-form-item-extra",
750
+ children: computedProps.extra
751
+ }),
752
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.ErrorList, {
753
+ errors
754
+ })
755
+ ]
756
+ })
757
+ ]
758
+ });
711
759
  }
712
- );
760
+ });
713
761
  case "number":
714
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, __spreadProps(__spreadValues({}, computedProps), { children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Select, __spreadValues({}, computedProps.input)) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
715
- import_antd8.InputNumber,
716
- __spreadValues({
717
- style: { width: "100%" }
718
- }, computedProps.input)
719
- ) }));
762
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
763
+ ...computedProps,
764
+ children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Select, {
765
+ ...computedProps.input
766
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.InputNumber, {
767
+ style: { width: "100%" },
768
+ ...computedProps.input
769
+ })
770
+ });
720
771
  case "number[]":
721
772
  if (computedProps.options)
722
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, __spreadProps(__spreadValues({}, computedProps), { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
723
- import_antd8.Select,
724
- __spreadValues({
725
- mode: "multiple"
726
- }, computedProps.input)
727
- ) }));
728
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
729
- import_antd8.Form.List,
730
- {
731
- name: computedProps.name,
732
- rules: computedProps.rules,
733
- children: (fields, { add, remove }, { errors }) => {
734
- var _a2, _b;
735
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
736
- computedProps.label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ant-form-item-label", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required", children: computedProps.label }) }),
773
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
774
+ ...computedProps,
775
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Select, {
776
+ mode: "multiple",
777
+ ...computedProps.input
778
+ })
779
+ });
780
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.List, {
781
+ name: computedProps.name,
782
+ rules: computedProps.rules,
783
+ children: (fields, { add, remove }, { errors }) => {
784
+ var _a2, _b;
785
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
786
+ children: [
787
+ computedProps.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
788
+ className: "ant-form-item-label",
789
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", {
790
+ className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required",
791
+ children: computedProps.label
792
+ })
793
+ }),
737
794
  fields.map((field) => {
738
795
  var _a3;
739
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
740
- import_antd8.Row,
741
- {
796
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
797
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd8.Row, {
742
798
  gutter: 24,
743
799
  style: { flexFlow: "row nowrap" },
744
800
  children: [
745
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Col, { span: 23, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
746
- import_antd8.Form.Item,
747
- __spreadProps(__spreadValues({}, field), {
801
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Col, {
802
+ span: 23,
803
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
804
+ ...field,
748
805
  noStyle: true,
749
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
750
- import_antd8.InputNumber,
751
- __spreadValues({
752
- style: { width: "100%" }
753
- }, computedProps.input)
754
- )
806
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.InputNumber, {
807
+ style: { width: "100%" },
808
+ ...computedProps.input
809
+ })
755
810
  })
756
- ) }),
757
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Col, { span: 1, children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
758
- import_antd8.Button,
759
- {
811
+ }),
812
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Col, {
813
+ span: 1,
814
+ children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
760
815
  danger: true,
761
816
  type: "link",
762
817
  style: { float: "right" },
763
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons2.MinusCircleOutlined, {}),
818
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.MinusCircleOutlined, {}),
764
819
  onClick: () => remove(field.name)
765
- }
766
- ) })
820
+ })
821
+ })
767
822
  ]
768
- }
769
- ) }, field.key);
823
+ })
824
+ }, field.key);
770
825
  }),
771
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_antd8.Form.Item, { children: [
772
- !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
773
- import_antd8.Button,
774
- {
826
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd8.Form.Item, {
827
+ children: [
828
+ !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
775
829
  type: "dashed",
776
830
  block: true,
777
831
  onClick: () => add(),
778
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons2.PlusOutlined, {})
779
- }
780
- ),
781
- computedProps.extra && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ant-form-item-extra", children: computedProps.extra }),
782
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.ErrorList, { errors })
783
- ] })
784
- ] });
785
- }
832
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
833
+ }),
834
+ computedProps.extra && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
835
+ className: "ant-form-item-extra",
836
+ children: computedProps.extra
837
+ }),
838
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.ErrorList, {
839
+ errors
840
+ })
841
+ ]
842
+ })
843
+ ]
844
+ });
786
845
  }
787
- );
846
+ });
788
847
  case "boolean":
789
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, __spreadProps(__spreadValues({}, computedProps), { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Switch, __spreadValues({}, computedProps.input)) }));
848
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
849
+ ...computedProps,
850
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Switch, {
851
+ ...computedProps.input
852
+ })
853
+ });
790
854
  case "date":
791
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, __spreadProps(__spreadValues({}, computedProps), { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.DatePicker, __spreadValues({}, computedProps.input)) }));
855
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
856
+ ...computedProps,
857
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.DatePicker, {
858
+ ...computedProps.input
859
+ })
860
+ });
792
861
  case "time":
793
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.Item, __spreadProps(__spreadValues({}, computedProps), { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.TimePicker, __spreadValues({}, computedProps.input)) }));
862
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.Item, {
863
+ ...computedProps,
864
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.TimePicker, {
865
+ ...computedProps.input
866
+ })
867
+ });
794
868
  case "object":
795
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
796
- computedProps.label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ant-form-item-label", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required", children: computedProps.label }) }),
797
- computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
798
- FormItem,
799
- __spreadValues({}, o),
800
- o.id
801
- ))
802
- ] });
869
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
870
+ children: [
871
+ computedProps.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
872
+ className: "ant-form-item-label",
873
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", {
874
+ className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required",
875
+ children: computedProps.label
876
+ })
877
+ }),
878
+ computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItem, {
879
+ ...o
880
+ }, o.id))
881
+ ]
882
+ });
803
883
  case "object[]":
804
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
805
- import_antd8.Form.List,
806
- {
807
- name: computedProps.name,
808
- rules: computedProps.rules,
809
- children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
810
- fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
811
- import_antd8.Form.Item,
812
- {
813
- style: { marginBottom: 0 },
814
- children: [
815
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ant-form-item-label", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
816
- computedProps.label,
817
- " ",
818
- field.name + 1,
819
- !computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
820
- import_antd8.Button,
821
- {
884
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.List, {
885
+ name: computedProps.name,
886
+ rules: computedProps.rules,
887
+ children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
888
+ children: [
889
+ fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd8.Form.Item, {
890
+ style: { marginBottom: 0 },
891
+ children: [
892
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
893
+ className: "ant-form-item-label",
894
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", {
895
+ children: [
896
+ computedProps.label,
897
+ " ",
898
+ field.name + 1,
899
+ !computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Button, {
822
900
  danger: true,
823
901
  type: "link",
824
902
  onClick: () => remove(field.name),
825
903
  children: common2.delete
826
- }
827
- )
828
- ] }) }),
829
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Row, { gutter: 24, children: computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
830
- import_antd8.Col,
831
- {
832
- span: o.col || 24,
833
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
834
- FormItem,
835
- __spreadProps(__spreadValues({}, o), {
836
- name: [field.name, o.id]
837
- })
838
- )
839
- },
840
- o.id
841
- )) })
842
- ]
843
- },
844
- field.key
845
- )),
846
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_antd8.Form.Item, { children: [
847
- !computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
848
- import_antd8.Button,
849
- {
904
+ })
905
+ ]
906
+ })
907
+ }),
908
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Row, {
909
+ gutter: 24,
910
+ children: computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Col, {
911
+ span: o.col || 24,
912
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItem, {
913
+ ...o,
914
+ name: [field.name, o.id]
915
+ })
916
+ }, o.id))
917
+ })
918
+ ]
919
+ }, field.key)),
920
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd8.Form.Item, {
921
+ children: [
922
+ !computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd8.Button, {
850
923
  type: "dashed",
851
924
  block: true,
852
925
  onClick: () => add(),
853
- icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_icons2.PlusOutlined, {}),
926
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {}),
854
927
  children: [
855
928
  common2.add,
856
929
  " ",
857
930
  computedProps.label
858
931
  ]
859
- }
860
- ),
861
- computedProps.extra && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ant-form-item-extra", children: computedProps.extra }),
862
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Form.ErrorList, { errors })
863
- ] })
864
- ] })
865
- }
866
- );
932
+ }),
933
+ computedProps.extra && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
934
+ className: "ant-form-item-extra",
935
+ children: computedProps.extra
936
+ }),
937
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Form.ErrorList, {
938
+ errors
939
+ })
940
+ ]
941
+ })
942
+ ]
943
+ })
944
+ });
867
945
  default:
868
946
  return null;
869
947
  }
@@ -871,7 +949,7 @@ function FormItem(props) {
871
949
  FormItem.useStatus = import_antd8.Form.Item.useStatus;
872
950
 
873
951
  // src/Form.tsx
874
- var import_jsx_runtime11 = require("react/jsx-runtime");
952
+ var import_jsx_runtime = require("react/jsx-runtime");
875
953
  function Form(props) {
876
954
  var _a, _b;
877
955
  const [loading, setLoading] = (0, import_react10.useState)(false);
@@ -882,9 +960,10 @@ function Form(props) {
882
960
  const [initialValues, setInitialValues] = (0, import_react10.useState)(props.initialValues);
883
961
  (0, import_react10.useEffect)(() => {
884
962
  var _a2, _b2, _c;
885
- const propsCopy = __spreadProps(__spreadValues({}, props), {
963
+ const propsCopy = {
964
+ ...props,
886
965
  form
887
- });
966
+ };
888
967
  if (propsCopy.initialValues && ((_a2 = propsCopy.items) == null ? void 0 : _a2.length)) {
889
968
  for (const key in propsCopy.initialValues) {
890
969
  propsCopy.initialValues[key] = transferValue(
@@ -908,7 +987,10 @@ function Form(props) {
908
987
  setLoading(true);
909
988
  try {
910
989
  if (propsCopy.submit && ((_a3 = propsCopy.submit.to) == null ? void 0 : _a3.action)) {
911
- await props.onFinish(values, async (values2) => (0, import_react9.faas)(propsCopy.submit.to.action, propsCopy.submit.to.params ? __spreadValues(__spreadValues({}, values2), propsCopy.submit.to.params) : values2));
990
+ await props.onFinish(values, async (values2) => (0, import_react9.faas)(propsCopy.submit.to.action, propsCopy.submit.to.params ? {
991
+ ...values2,
992
+ ...propsCopy.submit.to.params
993
+ } : values2));
912
994
  } else
913
995
  await props.onFinish(values);
914
996
  } catch (error) {
@@ -919,7 +1001,10 @@ function Form(props) {
919
1001
  } else if (propsCopy.submit && ((_c = propsCopy.submit.to) == null ? void 0 : _c.action)) {
920
1002
  propsCopy.onFinish = async (values) => {
921
1003
  setLoading(true);
922
- return (0, import_react9.faas)(propsCopy.submit.to.action, propsCopy.submit.to.params ? __spreadValues(__spreadValues({}, values), propsCopy.submit.to.params) : values).then((result) => {
1004
+ return (0, import_react9.faas)(propsCopy.submit.to.action, propsCopy.submit.to.params ? {
1005
+ ...values,
1006
+ ...propsCopy.submit.to.params
1007
+ } : values).then((result) => {
923
1008
  if (propsCopy.submit.to.then)
924
1009
  propsCopy.submit.to.then(result);
925
1010
  return result;
@@ -962,33 +1047,25 @@ function Form(props) {
962
1047
  }, [computedProps]);
963
1048
  if (!computedProps)
964
1049
  return null;
965
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
966
- import_antd9.Form,
967
- __spreadProps(__spreadValues({}, computedProps), {
968
- onValuesChange,
969
- children: [
970
- computedProps.beforeItems,
971
- (_a = computedProps.items) == null ? void 0 : _a.map((item) => (0, import_react10.isValidElement)(item) ? item : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
972
- FormItem,
973
- __spreadProps(__spreadValues({}, item), {
974
- extendTypes
975
- }),
976
- item.id
977
- )),
978
- computedProps.children,
979
- computedProps.submit !== false && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
980
- import_antd9.Button,
981
- {
982
- htmlType: "submit",
983
- type: "primary",
984
- loading,
985
- children: ((_b = computedProps.submit) == null ? void 0 : _b.text) || config.Form.submit.text
986
- }
987
- ),
988
- computedProps.footer
989
- ]
990
- })
991
- );
1050
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd9.Form, {
1051
+ ...computedProps,
1052
+ onValuesChange,
1053
+ children: [
1054
+ computedProps.beforeItems,
1055
+ (_a = computedProps.items) == null ? void 0 : _a.map((item) => (0, import_react10.isValidElement)(item) ? item : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItem, {
1056
+ ...item,
1057
+ extendTypes
1058
+ }, item.id)),
1059
+ computedProps.children,
1060
+ computedProps.submit !== false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Button, {
1061
+ htmlType: "submit",
1062
+ type: "primary",
1063
+ loading,
1064
+ children: ((_b = computedProps.submit) == null ? void 0 : _b.text) || config.Form.submit.text
1065
+ }),
1066
+ computedProps.footer
1067
+ ]
1068
+ });
992
1069
  }
993
1070
  Form.useForm = import_antd9.Form.useForm;
994
1071
  Form.useFormInstance = import_antd9.Form.useFormInstance;
@@ -1001,13 +1078,15 @@ Form.Provider = import_antd9.Form.Provider;
1001
1078
  // src/Link.tsx
1002
1079
  var import_react_router_dom2 = require("react-router-dom");
1003
1080
  var import_antd10 = require("antd");
1004
- var import_jsx_runtime12 = require("react/jsx-runtime");
1081
+ var import_jsx_runtime = require("react/jsx-runtime");
1005
1082
  function Link(props) {
1006
1083
  var _a, _b, _c, _d;
1007
1084
  const { Link: Link2 } = useConfigContext();
1008
- let style = __spreadValues(__spreadProps(__spreadValues({}, Link2.style || {}), {
1009
- cursor: "pointer"
1010
- }), props.style);
1085
+ let style = {
1086
+ ...Link2.style || {},
1087
+ cursor: "pointer",
1088
+ ...props.style
1089
+ };
1011
1090
  if (props.block)
1012
1091
  style = Object.assign({
1013
1092
  display: "block",
@@ -1015,49 +1094,36 @@ function Link(props) {
1015
1094
  }, style);
1016
1095
  if (props.href.startsWith("http")) {
1017
1096
  if (props.button)
1018
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1019
- import_antd10.Button,
1020
- __spreadProps(__spreadValues({}, props.button), {
1021
- target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
1022
- style,
1023
- href: props.href,
1024
- children: (_a = props.text) != null ? _a : props.children
1025
- })
1026
- );
1027
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1028
- "a",
1029
- {
1030
- href: props.href,
1097
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Button, {
1098
+ ...props.button,
1031
1099
  target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
1032
1100
  style,
1033
- children: (_b = props.text) != null ? _b : props.children
1034
- }
1035
- );
1101
+ href: props.href,
1102
+ children: (_a = props.text) != null ? _a : props.children
1103
+ });
1104
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
1105
+ href: props.href,
1106
+ target: props.target || (Link2 == null ? void 0 : Link2.target) || "_blank",
1107
+ style,
1108
+ children: (_b = props.text) != null ? _b : props.children
1109
+ });
1036
1110
  }
1037
1111
  if (props.button)
1038
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1039
- import_react_router_dom2.Link,
1040
- {
1041
- to: props.href,
1042
- target: props.target || (Link2 == null ? void 0 : Link2.target),
1043
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1044
- import_antd10.Button,
1045
- __spreadProps(__spreadValues({}, props.button), {
1046
- style,
1047
- children: (_c = props.text) != null ? _c : props.children
1048
- })
1049
- )
1050
- }
1051
- );
1052
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1053
- import_react_router_dom2.Link,
1054
- {
1112
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom2.Link, {
1055
1113
  to: props.href,
1056
1114
  target: props.target || (Link2 == null ? void 0 : Link2.target),
1057
- style,
1058
- children: (_d = props.text) != null ? _d : props.children
1059
- }
1060
- );
1115
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Button, {
1116
+ ...props.button,
1117
+ style,
1118
+ children: (_c = props.text) != null ? _c : props.children
1119
+ })
1120
+ });
1121
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom2.Link, {
1122
+ to: props.href,
1123
+ target: props.target || (Link2 == null ? void 0 : Link2.target),
1124
+ style,
1125
+ children: (_d = props.text) != null ? _d : props.children
1126
+ });
1061
1127
  }
1062
1128
 
1063
1129
  // src/Routers.tsx
@@ -1065,35 +1131,35 @@ var import_antd11 = require("antd");
1065
1131
  var import_react11 = require("react");
1066
1132
  var import_react_router_dom3 = require("react-router-dom");
1067
1133
  var import_react12 = require("react");
1068
- var import_jsx_runtime13 = require("react/jsx-runtime");
1134
+ var import_jsx_runtime = require("react/jsx-runtime");
1069
1135
  function PageNotFound() {
1070
1136
  const config = useConfigContext();
1071
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1072
- import_antd11.Result,
1073
- {
1074
- status: "404",
1075
- title: config.common.pageNotFound
1076
- }
1077
- );
1137
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Result, {
1138
+ status: "404",
1139
+ title: config.common.pageNotFound
1140
+ });
1078
1141
  }
1079
1142
  function Routes(props) {
1080
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_react_router_dom3.Routes, { children: [
1081
- props.routes.map((r) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1082
- import_react_router_dom3.Route,
1083
- __spreadProps(__spreadValues({}, r), {
1084
- element: r.element || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react11.Suspense, { fallback: props.fallback || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { style: { padding: "24px" }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd11.Skeleton, { active: true }) }), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(r.page, {}) })
1085
- }),
1086
- r.path
1087
- )),
1088
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
1089
- import_react_router_dom3.Route,
1090
- {
1143
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_router_dom3.Routes, {
1144
+ children: [
1145
+ props.routes.map((r) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom3.Route, {
1146
+ ...r,
1147
+ element: r.element || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react11.Suspense, {
1148
+ fallback: props.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1149
+ style: { padding: "24px" },
1150
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.Skeleton, {
1151
+ active: true
1152
+ })
1153
+ }),
1154
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(r.page, {})
1155
+ })
1156
+ }, r.path)),
1157
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom3.Route, {
1091
1158
  path: "*",
1092
- element: props.notFound || /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(PageNotFound, {})
1093
- },
1094
- "*"
1095
- )
1096
- ] });
1159
+ element: props.notFound || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageNotFound, {})
1160
+ }, "*")
1161
+ ]
1162
+ });
1097
1163
  }
1098
1164
 
1099
1165
  // src/Table.tsx
@@ -1102,12 +1168,12 @@ var import_antd12 = require("antd");
1102
1168
  var import_dayjs2 = __toESM(require("dayjs"));
1103
1169
  var import_icons3 = require("@ant-design/icons");
1104
1170
  var import_lodash_es6 = require("lodash-es");
1105
- var import_jsx_runtime14 = require("react/jsx-runtime");
1171
+ var import_jsx_runtime = require("react/jsx-runtime");
1106
1172
  function processValue(item, value) {
1107
1173
  var _a;
1108
1174
  const transferred = transferValue(item.type, value);
1109
1175
  if (transferred === null || Array.isArray(transferred) && transferred.length === 0)
1110
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Blank, {});
1176
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {});
1111
1177
  if (item.options) {
1112
1178
  if (item.type.endsWith("[]"))
1113
1179
  return transferred.map((v) => {
@@ -1145,38 +1211,32 @@ function Table(props) {
1145
1211
  setSelectedKeys,
1146
1212
  selectedKeys,
1147
1213
  confirm
1148
- }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1149
- "div",
1150
- {
1151
- style: {
1152
- padding: 8,
1153
- width: "200px"
1214
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1215
+ style: {
1216
+ padding: 8,
1217
+ width: "200px"
1218
+ },
1219
+ onKeyDown: (e) => e.stopPropagation(),
1220
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Select, {
1221
+ options: item.options,
1222
+ allowClear: true,
1223
+ showSearch: true,
1224
+ style: { width: "100%" },
1225
+ placeholder: `${common2.search} ${item.title}`,
1226
+ value: selectedKeys,
1227
+ onChange: (v) => {
1228
+ setSelectedKeys((v == null ? void 0 : v.length) ? v : []);
1229
+ confirm();
1154
1230
  },
1155
- onKeyDown: (e) => e.stopPropagation(),
1156
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1157
- import_antd12.Select,
1158
- {
1159
- options: item.options,
1160
- allowClear: true,
1161
- showSearch: true,
1162
- style: { width: "100%" },
1163
- placeholder: `${common2.search} ${item.title}`,
1164
- value: selectedKeys,
1165
- onChange: (v) => {
1166
- setSelectedKeys((v == null ? void 0 : v.length) ? v : []);
1167
- confirm();
1168
- },
1169
- mode: "multiple",
1170
- filterOption: (input, option) => {
1171
- if (!input || !option || !option.label)
1172
- return true;
1173
- input = input.trim();
1174
- return option.value === input || option.label.toString().toLowerCase().includes(input.toLowerCase());
1175
- }
1176
- }
1177
- )
1178
- }
1179
- );
1231
+ mode: "multiple",
1232
+ filterOption: (input, option) => {
1233
+ if (!input || !option || !option.label)
1234
+ return true;
1235
+ input = input.trim();
1236
+ return option.value === input || option.label.toString().toLowerCase().includes(input.toLowerCase());
1237
+ }
1238
+ })
1239
+ });
1180
1240
  return item;
1181
1241
  };
1182
1242
  (0, import_react13.useEffect)(() => {
@@ -1196,7 +1256,7 @@ function Table(props) {
1196
1256
  text: o.label,
1197
1257
  value: o.value
1198
1258
  })).concat({
1199
- text: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Blank, {}),
1259
+ text: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {}),
1200
1260
  value: null
1201
1261
  });
1202
1262
  generateFilterDropdown(item);
@@ -1258,22 +1318,19 @@ function Table(props) {
1258
1318
  setSelectedKeys,
1259
1319
  confirm,
1260
1320
  clearFilters
1261
- }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1262
- import_antd12.Input.Search,
1263
- {
1264
- placeholder: `${common2.search} ${item.title}`,
1265
- allowClear: true,
1266
- onSearch: (v) => {
1267
- if (v) {
1268
- setSelectedKeys([v]);
1269
- } else {
1270
- setSelectedKeys([]);
1271
- clearFilters();
1272
- }
1273
- confirm();
1321
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Input.Search, {
1322
+ placeholder: `${common2.search} ${item.title}`,
1323
+ allowClear: true,
1324
+ onSearch: (v) => {
1325
+ if (v) {
1326
+ setSelectedKeys([v]);
1327
+ } else {
1328
+ setSelectedKeys([]);
1329
+ clearFilters();
1274
1330
  }
1331
+ confirm();
1275
1332
  }
1276
- );
1333
+ });
1277
1334
  break;
1278
1335
  case "string[]":
1279
1336
  if (!item.render)
@@ -1293,22 +1350,19 @@ function Table(props) {
1293
1350
  setSelectedKeys,
1294
1351
  confirm,
1295
1352
  clearFilters
1296
- }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1297
- import_antd12.Input.Search,
1298
- {
1299
- placeholder: `${common2.search} ${item.title}`,
1300
- allowClear: true,
1301
- onSearch: (v) => {
1302
- if (v) {
1303
- setSelectedKeys([v]);
1304
- } else {
1305
- setSelectedKeys([]);
1306
- clearFilters();
1307
- }
1308
- confirm();
1353
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Input.Search, {
1354
+ placeholder: `${common2.search} ${item.title}`,
1355
+ allowClear: true,
1356
+ onSearch: (v) => {
1357
+ if (v) {
1358
+ setSelectedKeys([v]);
1359
+ } else {
1360
+ setSelectedKeys([]);
1361
+ clearFilters();
1309
1362
  }
1363
+ confirm();
1310
1364
  }
1311
- );
1365
+ });
1312
1366
  break;
1313
1367
  case "number":
1314
1368
  if (!item.render)
@@ -1330,22 +1384,19 @@ function Table(props) {
1330
1384
  setSelectedKeys,
1331
1385
  confirm,
1332
1386
  clearFilters
1333
- }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1334
- import_antd12.Input.Search,
1335
- {
1336
- placeholder: `${common2.search} ${item.title}`,
1337
- allowClear: true,
1338
- onSearch: (v) => {
1339
- if (v) {
1340
- setSelectedKeys([Number(v)]);
1341
- } else {
1342
- setSelectedKeys([]);
1343
- clearFilters();
1344
- }
1345
- confirm();
1387
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Input.Search, {
1388
+ placeholder: `${common2.search} ${item.title}`,
1389
+ allowClear: true,
1390
+ onSearch: (v) => {
1391
+ if (v) {
1392
+ setSelectedKeys([Number(v)]);
1393
+ } else {
1394
+ setSelectedKeys([]);
1395
+ clearFilters();
1346
1396
  }
1397
+ confirm();
1347
1398
  }
1348
- );
1399
+ });
1349
1400
  break;
1350
1401
  case "number[]":
1351
1402
  if (!item.render)
@@ -1365,66 +1416,79 @@ function Table(props) {
1365
1416
  setSelectedKeys,
1366
1417
  confirm,
1367
1418
  clearFilters
1368
- }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1369
- import_antd12.Input.Search,
1370
- {
1371
- placeholder: `${common2.search} ${item.title}`,
1372
- allowClear: true,
1373
- onSearch: (v) => {
1374
- if (v) {
1375
- setSelectedKeys([Number(v)]);
1376
- } else {
1377
- setSelectedKeys([]);
1378
- clearFilters();
1379
- }
1380
- confirm();
1419
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Input.Search, {
1420
+ placeholder: `${common2.search} ${item.title}`,
1421
+ allowClear: true,
1422
+ onSearch: (v) => {
1423
+ if (v) {
1424
+ setSelectedKeys([Number(v)]);
1425
+ } else {
1426
+ setSelectedKeys([]);
1427
+ clearFilters();
1381
1428
  }
1429
+ confirm();
1382
1430
  }
1383
- );
1431
+ });
1384
1432
  break;
1385
1433
  case "boolean":
1386
1434
  if (!item.render)
1387
- item.render = (value) => (0, import_lodash_es6.isNil)(value) ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Blank, {}) : value ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons3.CheckOutlined, { style: {
1388
- marginTop: "4px",
1389
- color: "#52c41a"
1390
- } }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons3.CloseOutlined, { style: {
1391
- marginTop: "4px",
1392
- color: "#ff4d4f"
1393
- } });
1435
+ item.render = (value) => (0, import_lodash_es6.isNil)(value) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {}) : value ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CheckOutlined, {
1436
+ style: {
1437
+ marginTop: "4px",
1438
+ color: "#52c41a"
1439
+ }
1440
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CloseOutlined, {
1441
+ style: {
1442
+ marginTop: "4px",
1443
+ color: "#ff4d4f"
1444
+ }
1445
+ });
1394
1446
  if (item.filterDropdown !== false)
1395
1447
  item.filterDropdown = ({
1396
1448
  setSelectedKeys,
1397
1449
  selectedKeys,
1398
1450
  confirm
1399
- }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
1400
- import_antd12.Radio.Group,
1401
- {
1402
- style: { padding: 8 },
1403
- buttonStyle: "solid",
1404
- value: JSON.stringify(selectedKeys[0]),
1405
- onChange: (e) => {
1406
- const Values = {
1407
- true: true,
1408
- false: false,
1409
- null: null
1410
- };
1411
- setSelectedKeys(e.target.value ? [Values[e.target.value]] : []);
1412
- confirm();
1413
- },
1414
- children: [
1415
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd12.Radio.Button, { children: common2.all }),
1416
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd12.Radio.Button, { value: "true", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons3.CheckOutlined, { style: {
1417
- color: "#52c41a",
1418
- verticalAlign: "middle"
1419
- } }) }),
1420
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd12.Radio.Button, { value: "false", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons3.CloseOutlined, { style: {
1421
- verticalAlign: "middle",
1422
- color: "#ff4d4f"
1423
- } }) }),
1424
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_antd12.Radio.Button, { value: "null", children: common2.blank })
1425
- ]
1426
- }
1427
- );
1451
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd12.Radio.Group, {
1452
+ style: { padding: 8 },
1453
+ buttonStyle: "solid",
1454
+ value: JSON.stringify(selectedKeys[0]),
1455
+ onChange: (e) => {
1456
+ const Values = {
1457
+ true: true,
1458
+ false: false,
1459
+ null: null
1460
+ };
1461
+ setSelectedKeys(e.target.value ? [Values[e.target.value]] : []);
1462
+ confirm();
1463
+ },
1464
+ children: [
1465
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Radio.Button, {
1466
+ children: common2.all
1467
+ }),
1468
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Radio.Button, {
1469
+ value: "true",
1470
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CheckOutlined, {
1471
+ style: {
1472
+ color: "#52c41a",
1473
+ verticalAlign: "middle"
1474
+ }
1475
+ })
1476
+ }),
1477
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Radio.Button, {
1478
+ value: "false",
1479
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CloseOutlined, {
1480
+ style: {
1481
+ verticalAlign: "middle",
1482
+ color: "#ff4d4f"
1483
+ }
1484
+ })
1485
+ }),
1486
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Radio.Button, {
1487
+ value: "null",
1488
+ children: common2.blank
1489
+ })
1490
+ ]
1491
+ });
1428
1492
  if (!item.onFilter)
1429
1493
  item.onFilter = (value, row) => {
1430
1494
  switch (value) {
@@ -1452,15 +1516,12 @@ function Table(props) {
1452
1516
  item.filterDropdown = ({
1453
1517
  setSelectedKeys,
1454
1518
  confirm
1455
- }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1456
- import_antd12.DatePicker.RangePicker,
1457
- {
1458
- onChange: (dates) => {
1459
- setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
1460
- confirm();
1461
- }
1519
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.DatePicker.RangePicker, {
1520
+ onChange: (dates) => {
1521
+ setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
1522
+ confirm();
1462
1523
  }
1463
- );
1524
+ });
1464
1525
  if (!item.onFilter)
1465
1526
  item.onFilter = (value, row) => {
1466
1527
  if ((0, import_lodash_es6.isNil)(value[0]))
@@ -1485,15 +1546,12 @@ function Table(props) {
1485
1546
  item.filterDropdown = ({
1486
1547
  setSelectedKeys,
1487
1548
  confirm
1488
- }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1489
- import_antd12.DatePicker.RangePicker,
1490
- {
1491
- onChange: (dates) => {
1492
- setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
1493
- confirm();
1494
- }
1549
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.DatePicker.RangePicker, {
1550
+ onChange: (dates) => {
1551
+ setSelectedKeys(dates && dates[0] && dates[1] ? [[dates[0].startOf("day").toISOString(), dates[1].endOf("day").toISOString()]] : []);
1552
+ confirm();
1495
1553
  }
1496
- );
1554
+ });
1497
1555
  if (!item.onFilter)
1498
1556
  item.onFilter = (value, row) => {
1499
1557
  if ((0, import_lodash_es6.isNil)(value[0]))
@@ -1505,26 +1563,21 @@ function Table(props) {
1505
1563
  break;
1506
1564
  case "object":
1507
1565
  if (!item.render)
1508
- item.render = (value) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1509
- Description,
1510
- {
1511
- items: item.object,
1512
- dataSource: value || {},
1513
- column: 1
1514
- }
1515
- );
1566
+ item.render = (value) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
1567
+ items: item.object,
1568
+ dataSource: value || {},
1569
+ column: 1
1570
+ });
1516
1571
  break;
1517
1572
  case "object[]":
1518
1573
  if (!item.render)
1519
- item.render = (value) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children: value.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1520
- Description,
1521
- {
1574
+ item.render = (value) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
1575
+ children: value.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
1522
1576
  items: item.object,
1523
1577
  dataSource: v || [],
1524
1578
  column: 1
1525
- },
1526
- i
1527
- )) });
1579
+ }, i))
1580
+ });
1528
1581
  break;
1529
1582
  default:
1530
1583
  if (!item.render)
@@ -1563,26 +1616,19 @@ function Table(props) {
1563
1616
  if (!columns)
1564
1617
  return null;
1565
1618
  if (props.dataSource)
1566
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1567
- import_antd12.Table,
1568
- __spreadProps(__spreadValues({}, props), {
1569
- rowKey: props.rowKey || "id",
1570
- columns,
1571
- dataSource: props.dataSource
1572
- })
1573
- );
1574
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1575
- FaasDataWrapper,
1576
- __spreadProps(__spreadValues({}, props.faasData), {
1577
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1578
- FaasDataTable,
1579
- {
1580
- props,
1581
- columns
1582
- }
1583
- )
1619
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Table, {
1620
+ ...props,
1621
+ rowKey: props.rowKey || "id",
1622
+ columns,
1623
+ dataSource: props.dataSource
1624
+ });
1625
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FaasDataWrapper, {
1626
+ ...props.faasData,
1627
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FaasDataTable, {
1628
+ props,
1629
+ columns
1584
1630
  })
1585
- );
1631
+ });
1586
1632
  }
1587
1633
  function FaasDataTable({
1588
1634
  props,
@@ -1604,7 +1650,7 @@ function FaasDataTable({
1604
1650
  text: v.label,
1605
1651
  value: v.value
1606
1652
  })).concat({
1607
- text: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Blank, {}),
1653
+ text: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {}),
1608
1654
  value: null
1609
1655
  });
1610
1656
  column.render = (value) => processValue(column, value);
@@ -1619,7 +1665,7 @@ function FaasDataTable({
1619
1665
  }));
1620
1666
  if (filters.length)
1621
1667
  column.filters = filters.concat({
1622
- text: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Blank, {}),
1668
+ text: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {}),
1623
1669
  value: null
1624
1670
  });
1625
1671
  }
@@ -1628,76 +1674,74 @@ function FaasDataTable({
1628
1674
  });
1629
1675
  }, [columns, data]);
1630
1676
  if (!data)
1631
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1632
- import_antd12.Table,
1633
- __spreadProps(__spreadValues({}, props), {
1634
- loading: props.loading,
1635
- rowKey: props.rowKey || "id",
1636
- columns: currentColumns,
1637
- dataSource: []
1638
- })
1639
- );
1677
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Table, {
1678
+ ...props,
1679
+ loading: props.loading,
1680
+ rowKey: props.rowKey || "id",
1681
+ columns: currentColumns,
1682
+ dataSource: []
1683
+ });
1640
1684
  if (Array.isArray(data))
1641
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1642
- import_antd12.Table,
1643
- __spreadProps(__spreadValues({}, props), {
1644
- loading: props.loading,
1645
- rowKey: props.rowKey || "id",
1646
- columns: currentColumns,
1647
- dataSource: data
1648
- })
1649
- );
1650
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
1651
- import_antd12.Table,
1652
- __spreadProps(__spreadValues({}, props), {
1685
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Table, {
1686
+ ...props,
1653
1687
  loading: props.loading,
1654
1688
  rowKey: props.rowKey || "id",
1655
1689
  columns: currentColumns,
1656
- dataSource: data.rows,
1657
- pagination: __spreadValues(__spreadValues({}, props.pagination), data.pagination),
1658
- onChange: (pagination, filters, sorter, extra) => {
1659
- if (props.onChange) {
1660
- const processed = props.onChange(pagination, filters, sorter, extra);
1661
- reload(__spreadProps(__spreadValues({}, params), {
1662
- pagination: processed.pagination,
1663
- filters: processed.filters,
1664
- sorter: processed.sorter
1665
- }));
1666
- return;
1667
- }
1668
- reload(__spreadProps(__spreadValues({}, params), {
1669
- pagination,
1670
- filters,
1671
- sorter
1672
- }));
1690
+ dataSource: data
1691
+ });
1692
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd12.Table, {
1693
+ ...props,
1694
+ loading: props.loading,
1695
+ rowKey: props.rowKey || "id",
1696
+ columns: currentColumns,
1697
+ dataSource: data.rows,
1698
+ pagination: {
1699
+ ...props.pagination,
1700
+ ...data.pagination
1701
+ },
1702
+ onChange: (pagination, filters, sorter, extra) => {
1703
+ if (props.onChange) {
1704
+ const processed = props.onChange(pagination, filters, sorter, extra);
1705
+ reload({
1706
+ ...params,
1707
+ pagination: processed.pagination,
1708
+ filters: processed.filters,
1709
+ sorter: processed.sorter
1710
+ });
1711
+ return;
1673
1712
  }
1674
- })
1675
- );
1713
+ reload({
1714
+ ...params,
1715
+ pagination,
1716
+ filters,
1717
+ sorter
1718
+ });
1719
+ }
1720
+ });
1676
1721
  }
1677
1722
 
1678
1723
  // src/Tabs.tsx
1679
1724
  var import_antd13 = require("antd");
1680
1725
  var import_react14 = require("react");
1681
- var import_jsx_runtime15 = require("react/jsx-runtime");
1726
+ var import_jsx_runtime = require("react/jsx-runtime");
1682
1727
  function Tabs(props) {
1683
1728
  const [items, setItems] = (0, import_react14.useState)([]);
1684
1729
  (0, import_react14.useEffect)(() => {
1685
- setItems(props.items.filter(Boolean).map((item) => __spreadProps(__spreadValues({}, item), {
1730
+ setItems(props.items.filter(Boolean).map((item) => ({
1731
+ ...item,
1686
1732
  key: item.id,
1687
1733
  label: item.title || item.id
1688
1734
  })));
1689
1735
  }, [props.items.filter(Boolean).map((i) => i.id).join("")]);
1690
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
1691
- import_antd13.Tabs,
1692
- __spreadProps(__spreadValues({}, props), {
1693
- items
1694
- })
1695
- );
1736
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd13.Tabs, {
1737
+ ...props,
1738
+ items
1739
+ });
1696
1740
  }
1697
1741
 
1698
1742
  // src/Title.tsx
1699
1743
  var import_react15 = require("react");
1700
- var import_jsx_runtime16 = require("react/jsx-runtime");
1744
+ var import_jsx_runtime = require("react/jsx-runtime");
1701
1745
  function Title(props) {
1702
1746
  const { Title: Title2 } = useConfigContext();
1703
1747
  (0, import_react15.useEffect)(() => {
@@ -1706,18 +1750,19 @@ function Title(props) {
1706
1750
  }, [props]);
1707
1751
  if (props.h1) {
1708
1752
  if (typeof props.h1 === "boolean")
1709
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h1", { children: Array.isArray(props.title) ? props.title[0] : props.title });
1710
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1711
- "h1",
1712
- {
1713
- className: props.h1.className,
1714
- style: props.h1.style,
1753
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
1715
1754
  children: Array.isArray(props.title) ? props.title[0] : props.title
1716
- }
1717
- );
1755
+ });
1756
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
1757
+ className: props.h1.className,
1758
+ style: props.h1.style,
1759
+ children: Array.isArray(props.title) ? props.title[0] : props.title
1760
+ });
1718
1761
  }
1719
1762
  if (props.plain)
1720
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: Array.isArray(props.title) ? props.title[0] : props.title });
1763
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
1764
+ children: Array.isArray(props.title) ? props.title[0] : props.title
1765
+ });
1721
1766
  if (props.children)
1722
1767
  return (0, import_react15.cloneElement)(props.children, { title: props.title });
1723
1768
  return null;