@faasjs/ant-design 0.0.2-beta.453 → 0.0.2-beta.455
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.js +337 -288
- package/dist/index.mjs +226 -184
- package/package.json +3 -5
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 });
|
|
@@ -136,9 +119,10 @@ function ConfigProvider({
|
|
|
136
119
|
}, []);
|
|
137
120
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfigContext.Provider, {
|
|
138
121
|
value: values,
|
|
139
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider,
|
|
122
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.ConfigProvider, {
|
|
123
|
+
...config.antd,
|
|
140
124
|
children
|
|
141
|
-
})
|
|
125
|
+
})
|
|
142
126
|
});
|
|
143
127
|
}
|
|
144
128
|
function useConfigContext() {
|
|
@@ -146,10 +130,10 @@ function useConfigContext() {
|
|
|
146
130
|
}
|
|
147
131
|
|
|
148
132
|
// src/Blank.tsx
|
|
149
|
-
var
|
|
133
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
150
134
|
function Blank(options) {
|
|
151
135
|
const { Blank: Blank2 } = useConfigContext();
|
|
152
|
-
return !options || (0, import_lodash2.isNil)(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ (0,
|
|
136
|
+
return !options || (0, import_lodash2.isNil)(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Typography.Text, {
|
|
153
137
|
disabled: true,
|
|
154
138
|
children: (options == null ? void 0 : options.text) || Blank2.text
|
|
155
139
|
}) : options.value;
|
|
@@ -198,40 +182,15 @@ var DatePicker = (0, import_generatePicker.default)(import_dayjs3.default);
|
|
|
198
182
|
var import_icons = require("@ant-design/icons");
|
|
199
183
|
var import_antd3 = require("antd");
|
|
200
184
|
var import_lodash4 = require("lodash");
|
|
201
|
-
var import_react4 = require("react");
|
|
202
|
-
|
|
203
|
-
// ../react/src/index.tsx
|
|
204
185
|
var import_react3 = require("react");
|
|
205
|
-
var
|
|
206
|
-
|
|
207
|
-
const client = clients[domain || Object.keys(clients)[0]];
|
|
208
|
-
if (!client)
|
|
209
|
-
throw Error("FaasReactClient is not initialized");
|
|
210
|
-
return client;
|
|
211
|
-
}
|
|
212
|
-
async function faas(action, params) {
|
|
213
|
-
return getClient().faas(action, params);
|
|
214
|
-
}
|
|
215
|
-
function FaasDataWrapper(props) {
|
|
216
|
-
const [client, setClient] = (0, import_react3.useState)();
|
|
217
|
-
(0, import_react3.useEffect)(() => {
|
|
218
|
-
if (client)
|
|
219
|
-
return;
|
|
220
|
-
setClient(getClient());
|
|
221
|
-
}, []);
|
|
222
|
-
if (!client)
|
|
223
|
-
return props.fallback || null;
|
|
224
|
-
return (0, import_react3.createElement)(client.FaasDataWrapper, props);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
// src/Description.tsx
|
|
228
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
186
|
+
var import_react4 = require("@faasjs/react");
|
|
187
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
229
188
|
function DescriptionItemContent(props) {
|
|
230
189
|
var _a;
|
|
231
|
-
const [computedProps, setComputedProps] = (0,
|
|
232
|
-
(0,
|
|
190
|
+
const [computedProps, setComputedProps] = (0, import_react3.useState)();
|
|
191
|
+
(0, import_react3.useEffect)(() => {
|
|
233
192
|
var _a2, _b;
|
|
234
|
-
const propsCopy =
|
|
193
|
+
const propsCopy = { ...props };
|
|
235
194
|
if (!propsCopy.item.title)
|
|
236
195
|
propsCopy.item.title = (0, import_lodash4.upperFirst)(propsCopy.item.id);
|
|
237
196
|
if (!propsCopy.item.type)
|
|
@@ -259,7 +218,7 @@ function DescriptionItemContent(props) {
|
|
|
259
218
|
return null;
|
|
260
219
|
if (computedProps.extendTypes && computedProps.extendTypes[computedProps.item.type])
|
|
261
220
|
if (computedProps.extendTypes[computedProps.item.type].children)
|
|
262
|
-
return (0,
|
|
221
|
+
return (0, import_react3.cloneElement)(
|
|
263
222
|
computedProps.extendTypes[computedProps.item.type].children,
|
|
264
223
|
{
|
|
265
224
|
value: computedProps.value,
|
|
@@ -267,62 +226,62 @@ function DescriptionItemContent(props) {
|
|
|
267
226
|
}
|
|
268
227
|
);
|
|
269
228
|
else if (computedProps.extendTypes[computedProps.item.type].render)
|
|
270
|
-
return /* @__PURE__ */ (0,
|
|
229
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
271
230
|
children: computedProps.extendTypes[computedProps.item.type].render(computedProps.value, computedProps.values)
|
|
272
231
|
});
|
|
273
232
|
else
|
|
274
233
|
throw Error(computedProps.item.type + " requires children or render");
|
|
275
234
|
if (computedProps.item.children)
|
|
276
|
-
return (0,
|
|
235
|
+
return (0, import_react3.cloneElement)(computedProps.item.children, { value: computedProps.value });
|
|
277
236
|
if (computedProps.item.render)
|
|
278
|
-
return /* @__PURE__ */ (0,
|
|
237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
279
238
|
children: computedProps.item.render(computedProps.value, computedProps.values)
|
|
280
239
|
});
|
|
281
240
|
if (computedProps.value === null || Array.isArray(computedProps.value) && !computedProps.value.length)
|
|
282
|
-
return /* @__PURE__ */ (0,
|
|
241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {});
|
|
283
242
|
switch (computedProps.item.type) {
|
|
284
243
|
case "string[]":
|
|
285
|
-
return /* @__PURE__ */ (0,
|
|
244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
286
245
|
children: computedProps.value.join(", ")
|
|
287
246
|
});
|
|
288
247
|
case "number":
|
|
289
248
|
return computedProps.value || null;
|
|
290
249
|
case "number[]":
|
|
291
|
-
return /* @__PURE__ */ (0,
|
|
250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
292
251
|
children: computedProps.value.join(", ")
|
|
293
252
|
});
|
|
294
253
|
case "boolean":
|
|
295
|
-
return computedProps.value ? /* @__PURE__ */ (0,
|
|
254
|
+
return computedProps.value ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckOutlined, {
|
|
296
255
|
style: {
|
|
297
256
|
marginTop: "4px",
|
|
298
257
|
color: "#52c41a"
|
|
299
258
|
}
|
|
300
|
-
}) : /* @__PURE__ */ (0,
|
|
259
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseOutlined, {
|
|
301
260
|
style: {
|
|
302
261
|
marginTop: "4px",
|
|
303
262
|
color: "#ff4d4f"
|
|
304
263
|
}
|
|
305
264
|
});
|
|
306
265
|
case "time":
|
|
307
|
-
return /* @__PURE__ */ (0,
|
|
266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
308
267
|
children: computedProps.value.format("YYYY-MM-DD HH:mm:ss")
|
|
309
268
|
});
|
|
310
269
|
case "date":
|
|
311
|
-
return /* @__PURE__ */ (0,
|
|
270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
312
271
|
children: computedProps.value.format("YYYY-MM-DD")
|
|
313
272
|
});
|
|
314
273
|
case "object":
|
|
315
|
-
return /* @__PURE__ */ (0,
|
|
274
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
|
|
316
275
|
items: computedProps.item.object,
|
|
317
276
|
dataSource: computedProps.value,
|
|
318
277
|
column: 1
|
|
319
278
|
});
|
|
320
279
|
case "object[]":
|
|
321
280
|
if (!((_a = computedProps.value) == null ? void 0 : _a.length))
|
|
322
|
-
return /* @__PURE__ */ (0,
|
|
323
|
-
return /* @__PURE__ */ (0,
|
|
281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {});
|
|
282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Space, {
|
|
324
283
|
direction: "vertical",
|
|
325
|
-
children: computedProps.value.map((value, index) => /* @__PURE__ */ (0,
|
|
284
|
+
children: computedProps.value.map((value, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
|
|
326
285
|
items: computedProps.item.object,
|
|
327
286
|
dataSource: value,
|
|
328
287
|
column: 1
|
|
@@ -334,12 +293,13 @@ function DescriptionItemContent(props) {
|
|
|
334
293
|
}
|
|
335
294
|
function Description(props) {
|
|
336
295
|
if (!props.faasData)
|
|
337
|
-
return /* @__PURE__ */ (0,
|
|
296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Descriptions, {
|
|
297
|
+
...props,
|
|
338
298
|
title: (0, import_lodash4.isFunction)(props.renderTitle) ? props.renderTitle(props.dataSource) : props.title,
|
|
339
299
|
children: props.items.map((item) => {
|
|
340
|
-
return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ (0,
|
|
300
|
+
return !item.if || item.if(props.dataSource) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Descriptions.Item, {
|
|
341
301
|
label: item.title || (0, import_lodash4.upperFirst)(item.id),
|
|
342
|
-
children: /* @__PURE__ */ (0,
|
|
302
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
|
|
343
303
|
item,
|
|
344
304
|
value: props.dataSource[item.id],
|
|
345
305
|
values: props.dataSource,
|
|
@@ -347,18 +307,19 @@ function Description(props) {
|
|
|
347
307
|
})
|
|
348
308
|
}, item.id) : null;
|
|
349
309
|
}).filter(Boolean)
|
|
350
|
-
})
|
|
351
|
-
return /* @__PURE__ */ (0,
|
|
352
|
-
fallback: props.faasData.fallback || /* @__PURE__ */ (0,
|
|
310
|
+
});
|
|
311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.FaasDataWrapper, {
|
|
312
|
+
fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Skeleton, {
|
|
353
313
|
active: true
|
|
354
314
|
}),
|
|
355
315
|
render: ({ data }) => {
|
|
356
|
-
return /* @__PURE__ */ (0,
|
|
316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Descriptions, {
|
|
317
|
+
...props,
|
|
357
318
|
title: (0, import_lodash4.isFunction)(props.renderTitle) ? props.renderTitle(data) : props.title,
|
|
358
319
|
children: props.items.map((item) => {
|
|
359
|
-
return !item.if || item.if(data) ? /* @__PURE__ */ (0,
|
|
320
|
+
return !item.if || item.if(data) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Descriptions.Item, {
|
|
360
321
|
label: item.title || (0, import_lodash4.upperFirst)(item.id),
|
|
361
|
-
children: /* @__PURE__ */ (0,
|
|
322
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
|
|
362
323
|
item,
|
|
363
324
|
value: data[item.id],
|
|
364
325
|
values: data,
|
|
@@ -366,55 +327,65 @@ function Description(props) {
|
|
|
366
327
|
})
|
|
367
328
|
}, item.id) : null;
|
|
368
329
|
}).filter(Boolean)
|
|
369
|
-
})
|
|
370
|
-
}
|
|
371
|
-
|
|
330
|
+
});
|
|
331
|
+
},
|
|
332
|
+
...props.faasData
|
|
333
|
+
});
|
|
372
334
|
}
|
|
373
335
|
|
|
374
336
|
// src/Drawer.tsx
|
|
375
337
|
var import_antd4 = require("antd");
|
|
376
|
-
var
|
|
377
|
-
var
|
|
338
|
+
var import_react5 = require("react");
|
|
339
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
378
340
|
function useDrawer(init) {
|
|
379
|
-
const [props, setProps] = (0,
|
|
341
|
+
const [props, setProps] = (0, import_react5.useState)({
|
|
380
342
|
open: false,
|
|
381
|
-
onClose: () => setProps((prev) =>
|
|
343
|
+
onClose: () => setProps((prev) => ({
|
|
344
|
+
...prev,
|
|
382
345
|
open: false
|
|
383
|
-
}))
|
|
384
|
-
|
|
346
|
+
})),
|
|
347
|
+
...init
|
|
348
|
+
});
|
|
385
349
|
return {
|
|
386
|
-
drawer: /* @__PURE__ */ (0,
|
|
350
|
+
drawer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Drawer, {
|
|
351
|
+
...props
|
|
352
|
+
}),
|
|
387
353
|
drawerProps: props,
|
|
388
354
|
setDrawerProps(changes) {
|
|
389
|
-
setProps((prev) =>
|
|
355
|
+
setProps((prev) => ({
|
|
356
|
+
...prev,
|
|
357
|
+
...changes
|
|
358
|
+
}));
|
|
390
359
|
}
|
|
391
360
|
};
|
|
392
361
|
}
|
|
393
362
|
|
|
394
363
|
// src/Form.tsx
|
|
364
|
+
var import_react8 = require("@faasjs/react");
|
|
395
365
|
var import_antd6 = require("antd");
|
|
396
|
-
var
|
|
366
|
+
var import_react9 = require("react");
|
|
397
367
|
|
|
398
368
|
// src/FormItem.tsx
|
|
399
369
|
var import_antd5 = require("antd");
|
|
400
370
|
var import_icons2 = require("@ant-design/icons");
|
|
401
|
-
var
|
|
371
|
+
var import_react7 = require("react");
|
|
402
372
|
var import_lodash5 = require("lodash");
|
|
403
373
|
|
|
404
374
|
// src/TimePicker.tsx
|
|
405
|
-
var
|
|
406
|
-
var
|
|
407
|
-
var TimePicker = (0,
|
|
408
|
-
return /* @__PURE__ */ (0,
|
|
375
|
+
var import_react6 = require("react");
|
|
376
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
377
|
+
var TimePicker = (0, import_react6.forwardRef)((props, ref) => {
|
|
378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DatePicker, {
|
|
379
|
+
...props,
|
|
409
380
|
picker: "time",
|
|
410
381
|
mode: void 0,
|
|
411
382
|
ref
|
|
412
|
-
})
|
|
383
|
+
});
|
|
413
384
|
});
|
|
414
385
|
TimePicker.displayName = "TimePicker";
|
|
415
386
|
|
|
416
387
|
// src/FormItem.tsx
|
|
417
|
-
var
|
|
388
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
418
389
|
function processProps(propsCopy, config) {
|
|
419
390
|
if (!propsCopy.title)
|
|
420
391
|
propsCopy.title = (0, import_lodash5.upperFirst)(propsCopy.id);
|
|
@@ -463,12 +434,12 @@ function processProps(propsCopy, config) {
|
|
|
463
434
|
}
|
|
464
435
|
function FormItem(props) {
|
|
465
436
|
var _a;
|
|
466
|
-
const [computedProps, setComputedProps] = (0,
|
|
467
|
-
const [extendTypes, setExtendTypes] = (0,
|
|
437
|
+
const [computedProps, setComputedProps] = (0, import_react7.useState)();
|
|
438
|
+
const [extendTypes, setExtendTypes] = (0, import_react7.useState)();
|
|
468
439
|
const config = useConfigContext();
|
|
469
|
-
const [hidden, setHidden] = (0,
|
|
470
|
-
(0,
|
|
471
|
-
const propsCopy =
|
|
440
|
+
const [hidden, setHidden] = (0, import_react7.useState)(false);
|
|
441
|
+
(0, import_react7.useEffect)(() => {
|
|
442
|
+
const propsCopy = { ...props };
|
|
472
443
|
if (propsCopy.extendTypes) {
|
|
473
444
|
setExtendTypes(propsCopy.extendTypes);
|
|
474
445
|
delete propsCopy.extendTypes;
|
|
@@ -487,71 +458,86 @@ function FormItem(props) {
|
|
|
487
458
|
if (!computedProps)
|
|
488
459
|
return null;
|
|
489
460
|
if (hidden)
|
|
490
|
-
return /* @__PURE__ */ (0,
|
|
461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
462
|
+
...computedProps,
|
|
491
463
|
noStyle: true,
|
|
492
|
-
|
|
464
|
+
rules: [],
|
|
465
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Input, {
|
|
493
466
|
hidden: true
|
|
494
467
|
})
|
|
495
|
-
})
|
|
468
|
+
});
|
|
496
469
|
if (extendTypes && extendTypes[computedProps.type])
|
|
497
|
-
return /* @__PURE__ */ (0,
|
|
470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
471
|
+
...computedProps,
|
|
498
472
|
children: extendTypes[computedProps.type].children
|
|
499
|
-
})
|
|
473
|
+
});
|
|
500
474
|
if (computedProps.children)
|
|
501
|
-
return /* @__PURE__ */ (0,
|
|
475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
476
|
+
...computedProps,
|
|
502
477
|
children: computedProps.children
|
|
503
|
-
})
|
|
478
|
+
});
|
|
504
479
|
if (computedProps.render)
|
|
505
|
-
return /* @__PURE__ */ (0,
|
|
480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
481
|
+
...computedProps,
|
|
506
482
|
children: computedProps.render()
|
|
507
|
-
})
|
|
483
|
+
});
|
|
508
484
|
switch (computedProps.type) {
|
|
509
485
|
case "string":
|
|
510
|
-
return /* @__PURE__ */ (0,
|
|
511
|
-
|
|
512
|
-
|
|
486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
487
|
+
...computedProps,
|
|
488
|
+
children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Select, {
|
|
489
|
+
...computedProps.input
|
|
490
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Input, {
|
|
491
|
+
...computedProps.input
|
|
492
|
+
})
|
|
493
|
+
});
|
|
513
494
|
case "string[]":
|
|
514
495
|
if (computedProps.options)
|
|
515
|
-
return /* @__PURE__ */ (0,
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
497
|
+
...computedProps,
|
|
498
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Select, {
|
|
499
|
+
mode: "multiple",
|
|
500
|
+
...computedProps.input
|
|
501
|
+
})
|
|
502
|
+
});
|
|
503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.List, {
|
|
521
504
|
name: computedProps.name,
|
|
522
505
|
rules: computedProps.rules,
|
|
523
506
|
children: (fields, { add, remove }, { errors }) => {
|
|
524
507
|
var _a2;
|
|
525
|
-
return /* @__PURE__ */ (0,
|
|
508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
526
509
|
children: [
|
|
527
|
-
computedProps.label && /* @__PURE__ */ (0,
|
|
510
|
+
computedProps.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
528
511
|
className: "ant-form-item-label",
|
|
529
|
-
children: /* @__PURE__ */ (0,
|
|
512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", {
|
|
530
513
|
className: computedProps.rules.find((r) => r.required) && "ant-form-item-required",
|
|
531
514
|
children: computedProps.label
|
|
532
515
|
})
|
|
533
516
|
}),
|
|
534
517
|
fields.map((field) => {
|
|
535
518
|
var _a3;
|
|
536
|
-
return /* @__PURE__ */ (0,
|
|
537
|
-
children: /* @__PURE__ */ (0,
|
|
519
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
520
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Row, {
|
|
538
521
|
gutter: 24,
|
|
539
522
|
style: { flexFlow: "row nowrap" },
|
|
540
523
|
children: [
|
|
541
|
-
/* @__PURE__ */ (0,
|
|
524
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Col, {
|
|
542
525
|
span: 23,
|
|
543
|
-
children: /* @__PURE__ */ (0,
|
|
526
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
527
|
+
...field,
|
|
544
528
|
noStyle: true,
|
|
545
|
-
children: /* @__PURE__ */ (0,
|
|
546
|
-
|
|
529
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Input, {
|
|
530
|
+
...computedProps.input
|
|
531
|
+
})
|
|
532
|
+
})
|
|
547
533
|
}),
|
|
548
|
-
/* @__PURE__ */ (0,
|
|
534
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Col, {
|
|
549
535
|
span: 1,
|
|
550
|
-
children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0,
|
|
536
|
+
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_antd5.Button, {
|
|
551
537
|
danger: true,
|
|
552
538
|
type: "link",
|
|
553
539
|
style: { float: "right" },
|
|
554
|
-
icon: /* @__PURE__ */ (0,
|
|
540
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.MinusCircleOutlined, {}),
|
|
555
541
|
onClick: () => remove(field.name)
|
|
556
542
|
})
|
|
557
543
|
})
|
|
@@ -559,15 +545,15 @@ function FormItem(props) {
|
|
|
559
545
|
})
|
|
560
546
|
}, field.key);
|
|
561
547
|
}),
|
|
562
|
-
/* @__PURE__ */ (0,
|
|
548
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Form.Item, {
|
|
563
549
|
children: [
|
|
564
|
-
!((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0,
|
|
550
|
+
!((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Button, {
|
|
565
551
|
type: "dashed",
|
|
566
552
|
block: true,
|
|
567
553
|
onClick: () => add(),
|
|
568
|
-
icon: /* @__PURE__ */ (0,
|
|
554
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
|
|
569
555
|
}),
|
|
570
|
-
/* @__PURE__ */ (0,
|
|
556
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.ErrorList, {
|
|
571
557
|
errors
|
|
572
558
|
})
|
|
573
559
|
]
|
|
@@ -577,55 +563,63 @@ function FormItem(props) {
|
|
|
577
563
|
}
|
|
578
564
|
});
|
|
579
565
|
case "number":
|
|
580
|
-
return /* @__PURE__ */ (0,
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
567
|
+
...computedProps,
|
|
568
|
+
children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Select, {
|
|
569
|
+
...computedProps.input
|
|
570
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.InputNumber, {
|
|
571
|
+
style: { width: "100%" },
|
|
572
|
+
...computedProps.input
|
|
573
|
+
})
|
|
574
|
+
});
|
|
585
575
|
case "number[]":
|
|
586
576
|
if (computedProps.options)
|
|
587
|
-
return /* @__PURE__ */ (0,
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
578
|
+
...computedProps,
|
|
579
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Select, {
|
|
580
|
+
mode: "multiple",
|
|
581
|
+
...computedProps.input
|
|
582
|
+
})
|
|
583
|
+
});
|
|
584
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.List, {
|
|
593
585
|
name: computedProps.name,
|
|
594
586
|
rules: computedProps.rules,
|
|
595
587
|
children: (fields, { add, remove }, { errors }) => {
|
|
596
588
|
var _a2, _b;
|
|
597
|
-
return /* @__PURE__ */ (0,
|
|
589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
598
590
|
children: [
|
|
599
|
-
computedProps.label && /* @__PURE__ */ (0,
|
|
591
|
+
computedProps.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
600
592
|
className: "ant-form-item-label",
|
|
601
|
-
children: /* @__PURE__ */ (0,
|
|
593
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", {
|
|
602
594
|
className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required",
|
|
603
595
|
children: computedProps.label
|
|
604
596
|
})
|
|
605
597
|
}),
|
|
606
598
|
fields.map((field) => {
|
|
607
599
|
var _a3;
|
|
608
|
-
return /* @__PURE__ */ (0,
|
|
609
|
-
children: /* @__PURE__ */ (0,
|
|
600
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
601
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Row, {
|
|
610
602
|
gutter: 24,
|
|
611
603
|
style: { flexFlow: "row nowrap" },
|
|
612
604
|
children: [
|
|
613
|
-
/* @__PURE__ */ (0,
|
|
605
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Col, {
|
|
614
606
|
span: 23,
|
|
615
|
-
children: /* @__PURE__ */ (0,
|
|
607
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
608
|
+
...field,
|
|
616
609
|
noStyle: true,
|
|
617
|
-
children: /* @__PURE__ */ (0,
|
|
618
|
-
style: { width: "100%" }
|
|
619
|
-
|
|
620
|
-
|
|
610
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.InputNumber, {
|
|
611
|
+
style: { width: "100%" },
|
|
612
|
+
...computedProps.input
|
|
613
|
+
})
|
|
614
|
+
})
|
|
621
615
|
}),
|
|
622
|
-
/* @__PURE__ */ (0,
|
|
616
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Col, {
|
|
623
617
|
span: 1,
|
|
624
|
-
children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0,
|
|
618
|
+
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_antd5.Button, {
|
|
625
619
|
danger: true,
|
|
626
620
|
type: "link",
|
|
627
621
|
style: { float: "right" },
|
|
628
|
-
icon: /* @__PURE__ */ (0,
|
|
622
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.MinusCircleOutlined, {}),
|
|
629
623
|
onClick: () => remove(field.name)
|
|
630
624
|
})
|
|
631
625
|
})
|
|
@@ -633,15 +627,15 @@ function FormItem(props) {
|
|
|
633
627
|
})
|
|
634
628
|
}, field.key);
|
|
635
629
|
}),
|
|
636
|
-
/* @__PURE__ */ (0,
|
|
630
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Form.Item, {
|
|
637
631
|
children: [
|
|
638
|
-
!((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0,
|
|
632
|
+
!((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Button, {
|
|
639
633
|
type: "dashed",
|
|
640
634
|
block: true,
|
|
641
635
|
onClick: () => add(),
|
|
642
|
-
icon: /* @__PURE__ */ (0,
|
|
636
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
|
|
643
637
|
}),
|
|
644
|
-
/* @__PURE__ */ (0,
|
|
638
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.ErrorList, {
|
|
645
639
|
errors
|
|
646
640
|
})
|
|
647
641
|
]
|
|
@@ -651,47 +645,58 @@ function FormItem(props) {
|
|
|
651
645
|
}
|
|
652
646
|
});
|
|
653
647
|
case "boolean":
|
|
654
|
-
return /* @__PURE__ */ (0,
|
|
655
|
-
|
|
656
|
-
|
|
648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
649
|
+
...computedProps,
|
|
650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Switch, {
|
|
651
|
+
...computedProps.input
|
|
652
|
+
})
|
|
653
|
+
});
|
|
657
654
|
case "date":
|
|
658
|
-
return /* @__PURE__ */ (0,
|
|
659
|
-
|
|
660
|
-
|
|
655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
656
|
+
...computedProps,
|
|
657
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DatePicker, {
|
|
658
|
+
...computedProps.input
|
|
659
|
+
})
|
|
660
|
+
});
|
|
661
661
|
case "time":
|
|
662
|
-
return /* @__PURE__ */ (0,
|
|
663
|
-
|
|
664
|
-
|
|
662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.Item, {
|
|
663
|
+
...computedProps,
|
|
664
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TimePicker, {
|
|
665
|
+
...computedProps.input
|
|
666
|
+
})
|
|
667
|
+
});
|
|
665
668
|
case "object":
|
|
666
|
-
return /* @__PURE__ */ (0,
|
|
669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
667
670
|
children: [
|
|
668
|
-
computedProps.label && /* @__PURE__ */ (0,
|
|
671
|
+
computedProps.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
669
672
|
className: "ant-form-item-label",
|
|
670
|
-
children: /* @__PURE__ */ (0,
|
|
673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", {
|
|
671
674
|
className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required",
|
|
672
675
|
children: computedProps.label
|
|
673
676
|
})
|
|
674
677
|
}),
|
|
675
|
-
computedProps.object.map((o) => /* @__PURE__ */ (0,
|
|
678
|
+
computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItem, {
|
|
679
|
+
...o
|
|
680
|
+
}, o.id))
|
|
676
681
|
]
|
|
677
682
|
});
|
|
678
683
|
case "object[]":
|
|
679
|
-
return /* @__PURE__ */ (0,
|
|
684
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.List, {
|
|
680
685
|
name: computedProps.name,
|
|
681
686
|
rules: computedProps.rules,
|
|
682
|
-
children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ (0,
|
|
687
|
+
children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
683
688
|
children: [
|
|
684
|
-
fields.map((field) => /* @__PURE__ */ (0,
|
|
689
|
+
fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Form.Item, {
|
|
685
690
|
style: { marginBottom: 0 },
|
|
686
691
|
children: [
|
|
687
|
-
/* @__PURE__ */ (0,
|
|
692
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
688
693
|
className: "ant-form-item-label",
|
|
689
|
-
children: /* @__PURE__ */ (0,
|
|
694
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", {
|
|
690
695
|
children: [
|
|
691
696
|
computedProps.label,
|
|
692
697
|
" ",
|
|
693
698
|
field.name + 1,
|
|
694
|
-
!computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0,
|
|
699
|
+
!computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Button, {
|
|
695
700
|
danger: true,
|
|
696
701
|
type: "link",
|
|
697
702
|
onClick: () => remove(field.name),
|
|
@@ -700,31 +705,32 @@ function FormItem(props) {
|
|
|
700
705
|
]
|
|
701
706
|
})
|
|
702
707
|
}),
|
|
703
|
-
/* @__PURE__ */ (0,
|
|
708
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Row, {
|
|
704
709
|
gutter: 24,
|
|
705
|
-
children: computedProps.object.map((o) => /* @__PURE__ */ (0,
|
|
710
|
+
children: computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Col, {
|
|
706
711
|
span: o.col || 24,
|
|
707
|
-
children: /* @__PURE__ */ (0,
|
|
712
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItem, {
|
|
713
|
+
...o,
|
|
708
714
|
name: [field.name, o.id]
|
|
709
|
-
})
|
|
715
|
+
})
|
|
710
716
|
}, o.id))
|
|
711
717
|
})
|
|
712
718
|
]
|
|
713
719
|
}, field.key)),
|
|
714
|
-
/* @__PURE__ */ (0,
|
|
720
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Form.Item, {
|
|
715
721
|
children: [
|
|
716
|
-
!computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0,
|
|
722
|
+
!computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Button, {
|
|
717
723
|
type: "dashed",
|
|
718
724
|
block: true,
|
|
719
725
|
onClick: () => add(),
|
|
720
|
-
icon: /* @__PURE__ */ (0,
|
|
726
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {}),
|
|
721
727
|
children: [
|
|
722
728
|
config.common.add,
|
|
723
729
|
" ",
|
|
724
730
|
computedProps.label
|
|
725
731
|
]
|
|
726
732
|
}),
|
|
727
|
-
/* @__PURE__ */ (0,
|
|
733
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Form.ErrorList, {
|
|
728
734
|
errors
|
|
729
735
|
})
|
|
730
736
|
]
|
|
@@ -738,20 +744,21 @@ function FormItem(props) {
|
|
|
738
744
|
}
|
|
739
745
|
|
|
740
746
|
// src/Form.tsx
|
|
741
|
-
var
|
|
747
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
742
748
|
function Form(props) {
|
|
743
749
|
var _a, _b;
|
|
744
|
-
const [loading, setLoading] = (0,
|
|
745
|
-
const [computedProps, setComputedProps] = (0,
|
|
750
|
+
const [loading, setLoading] = (0, import_react9.useState)(false);
|
|
751
|
+
const [computedProps, setComputedProps] = (0, import_react9.useState)();
|
|
746
752
|
const config = useConfigContext();
|
|
747
|
-
const [extendTypes, setExtendTypes] = (0,
|
|
753
|
+
const [extendTypes, setExtendTypes] = (0, import_react9.useState)();
|
|
748
754
|
const [form] = import_antd6.Form.useForm(props.form);
|
|
749
|
-
const [initialValues, setInitialValues] = (0,
|
|
750
|
-
(0,
|
|
755
|
+
const [initialValues, setInitialValues] = (0, import_react9.useState)(props.initialValues);
|
|
756
|
+
(0, import_react9.useEffect)(() => {
|
|
751
757
|
var _a2, _b2;
|
|
752
|
-
const propsCopy =
|
|
758
|
+
const propsCopy = {
|
|
759
|
+
...props,
|
|
753
760
|
form
|
|
754
|
-
}
|
|
761
|
+
};
|
|
755
762
|
if (propsCopy.initialValues) {
|
|
756
763
|
for (const key in propsCopy.initialValues)
|
|
757
764
|
propsCopy.initialValues[key] = transferValue(
|
|
@@ -767,7 +774,10 @@ function Form(props) {
|
|
|
767
774
|
setLoading(true);
|
|
768
775
|
try {
|
|
769
776
|
if (propsCopy.submit && ((_a3 = propsCopy.submit.to) == null ? void 0 : _a3.action)) {
|
|
770
|
-
await props.onFinish(values, async (values2) => faas(propsCopy.submit.to.action, propsCopy.submit.to.params ?
|
|
777
|
+
await props.onFinish(values, async (values2) => (0, import_react8.faas)(propsCopy.submit.to.action, propsCopy.submit.to.params ? {
|
|
778
|
+
...values2,
|
|
779
|
+
...propsCopy.submit.to.params
|
|
780
|
+
} : values2));
|
|
771
781
|
} else
|
|
772
782
|
await props.onFinish(values);
|
|
773
783
|
} catch (error) {
|
|
@@ -778,7 +788,10 @@ function Form(props) {
|
|
|
778
788
|
} else if (propsCopy.submit && ((_b2 = propsCopy.submit.to) == null ? void 0 : _b2.action)) {
|
|
779
789
|
propsCopy.onFinish = async (values) => {
|
|
780
790
|
setLoading(true);
|
|
781
|
-
return faas(propsCopy.submit.to.action, propsCopy.submit.to.params ?
|
|
791
|
+
return (0, import_react8.faas)(propsCopy.submit.to.action, propsCopy.submit.to.params ? {
|
|
792
|
+
...values,
|
|
793
|
+
...propsCopy.submit.to.params
|
|
794
|
+
} : values).finally(() => setLoading(false));
|
|
782
795
|
};
|
|
783
796
|
}
|
|
784
797
|
if (propsCopy.extendTypes) {
|
|
@@ -787,7 +800,7 @@ function Form(props) {
|
|
|
787
800
|
}
|
|
788
801
|
setComputedProps(propsCopy);
|
|
789
802
|
}, [props]);
|
|
790
|
-
const onValuesChange = (0,
|
|
803
|
+
const onValuesChange = (0, import_react9.useCallback)((changedValues, allValues) => {
|
|
791
804
|
if (props.onValuesChange) {
|
|
792
805
|
props.onValuesChange(changedValues, allValues);
|
|
793
806
|
}
|
|
@@ -799,7 +812,7 @@ function Form(props) {
|
|
|
799
812
|
item.onValueChange(changedValues[key], allValues, form);
|
|
800
813
|
}
|
|
801
814
|
}, [computedProps]);
|
|
802
|
-
(0,
|
|
815
|
+
(0, import_react9.useEffect)(() => {
|
|
803
816
|
if (!initialValues)
|
|
804
817
|
return;
|
|
805
818
|
form.setFieldsValue(initialValues);
|
|
@@ -807,15 +820,17 @@ function Form(props) {
|
|
|
807
820
|
}, [computedProps]);
|
|
808
821
|
if (!computedProps)
|
|
809
822
|
return null;
|
|
810
|
-
return /* @__PURE__ */ (0,
|
|
823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd6.Form, {
|
|
824
|
+
...computedProps,
|
|
811
825
|
onValuesChange,
|
|
812
826
|
children: [
|
|
813
827
|
computedProps.beforeItems,
|
|
814
|
-
(_a = computedProps.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ (0,
|
|
828
|
+
(_a = computedProps.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItem, {
|
|
829
|
+
...item,
|
|
815
830
|
extendTypes
|
|
816
|
-
}
|
|
831
|
+
}, item.id)),
|
|
817
832
|
computedProps.children,
|
|
818
|
-
computedProps.submit !== false && /* @__PURE__ */ (0,
|
|
833
|
+
computedProps.submit !== false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Button, {
|
|
819
834
|
htmlType: "submit",
|
|
820
835
|
type: "primary",
|
|
821
836
|
loading,
|
|
@@ -823,14 +838,14 @@ function Form(props) {
|
|
|
823
838
|
}),
|
|
824
839
|
computedProps.footer
|
|
825
840
|
]
|
|
826
|
-
})
|
|
841
|
+
});
|
|
827
842
|
}
|
|
828
843
|
Form.useForm = import_antd6.Form.useForm;
|
|
829
844
|
|
|
830
845
|
// src/Link.tsx
|
|
831
846
|
var import_react_router_dom = require("react-router-dom");
|
|
832
847
|
var import_antd7 = require("antd");
|
|
833
|
-
var
|
|
848
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
834
849
|
function Link({
|
|
835
850
|
href,
|
|
836
851
|
target,
|
|
@@ -843,104 +858,127 @@ function Link({
|
|
|
843
858
|
style = Object.assign({ cursor: "pointer" }, style);
|
|
844
859
|
if (href.startsWith("http")) {
|
|
845
860
|
if (button)
|
|
846
|
-
return /* @__PURE__ */ (0,
|
|
847
|
-
|
|
861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Button, {
|
|
862
|
+
...button,
|
|
863
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
848
864
|
href,
|
|
849
865
|
target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
|
|
850
|
-
style:
|
|
866
|
+
style: {
|
|
867
|
+
...Link2.style,
|
|
868
|
+
...style || {}
|
|
869
|
+
},
|
|
851
870
|
children: text || children
|
|
852
871
|
})
|
|
853
|
-
})
|
|
854
|
-
return /* @__PURE__ */ (0,
|
|
872
|
+
});
|
|
873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", {
|
|
855
874
|
href,
|
|
856
875
|
target: target || (Link2 == null ? void 0 : Link2.target) || "_blank",
|
|
857
|
-
style:
|
|
876
|
+
style: {
|
|
877
|
+
...Link2.style,
|
|
878
|
+
...style || {}
|
|
879
|
+
},
|
|
858
880
|
children: text || children
|
|
859
881
|
});
|
|
860
882
|
}
|
|
861
883
|
if (button)
|
|
862
|
-
return /* @__PURE__ */ (0,
|
|
863
|
-
|
|
884
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Button, {
|
|
885
|
+
...button,
|
|
886
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Link, {
|
|
864
887
|
to: href,
|
|
865
888
|
target: target || (Link2 == null ? void 0 : Link2.target),
|
|
866
|
-
style:
|
|
889
|
+
style: {
|
|
890
|
+
...Link2.style,
|
|
891
|
+
...style || {}
|
|
892
|
+
},
|
|
867
893
|
children: text || children
|
|
868
894
|
})
|
|
869
|
-
})
|
|
870
|
-
return /* @__PURE__ */ (0,
|
|
895
|
+
});
|
|
896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Link, {
|
|
871
897
|
to: href,
|
|
872
898
|
target: target || (Link2 == null ? void 0 : Link2.target),
|
|
873
|
-
style:
|
|
899
|
+
style: {
|
|
900
|
+
...Link2.style,
|
|
901
|
+
...style || {}
|
|
902
|
+
},
|
|
874
903
|
children: text || children
|
|
875
904
|
});
|
|
876
905
|
}
|
|
877
906
|
|
|
878
907
|
// src/Modal.tsx
|
|
879
908
|
var import_antd8 = require("antd");
|
|
880
|
-
var
|
|
881
|
-
var
|
|
909
|
+
var import_react10 = require("react");
|
|
910
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
882
911
|
function useModal(init) {
|
|
883
|
-
const [props, setProps] = (0,
|
|
912
|
+
const [props, setProps] = (0, import_react10.useState)({
|
|
884
913
|
open: false,
|
|
885
|
-
onCancel: () => setProps((prev) =>
|
|
914
|
+
onCancel: () => setProps((prev) => ({
|
|
915
|
+
...prev,
|
|
886
916
|
open: false
|
|
887
|
-
}))
|
|
888
|
-
|
|
917
|
+
})),
|
|
918
|
+
...init
|
|
919
|
+
});
|
|
889
920
|
return {
|
|
890
|
-
modal: /* @__PURE__ */ (0,
|
|
921
|
+
modal: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Modal, {
|
|
922
|
+
...props
|
|
923
|
+
}),
|
|
891
924
|
modalProps: props,
|
|
892
925
|
setModalProps(changes) {
|
|
893
|
-
setProps((prev) =>
|
|
926
|
+
setProps((prev) => ({
|
|
927
|
+
...prev,
|
|
928
|
+
...changes
|
|
929
|
+
}));
|
|
894
930
|
}
|
|
895
931
|
};
|
|
896
932
|
}
|
|
897
933
|
|
|
898
934
|
// src/Routers.tsx
|
|
899
935
|
var import_antd9 = require("antd");
|
|
900
|
-
var
|
|
936
|
+
var import_react11 = require("react");
|
|
901
937
|
var import_react_router_dom2 = require("react-router-dom");
|
|
902
|
-
var
|
|
938
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
903
939
|
function PageNotFound() {
|
|
904
940
|
const config = useConfigContext();
|
|
905
|
-
return /* @__PURE__ */ (0,
|
|
941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Result, {
|
|
906
942
|
status: "404",
|
|
907
943
|
title: config.common.pageNotFound
|
|
908
944
|
});
|
|
909
945
|
}
|
|
910
946
|
function Routes(props) {
|
|
911
|
-
return /* @__PURE__ */ (0,
|
|
947
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_router_dom2.Routes, {
|
|
912
948
|
children: [
|
|
913
|
-
props.routes.map((r) => /* @__PURE__ */ (0,
|
|
914
|
-
|
|
915
|
-
|
|
949
|
+
props.routes.map((r) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom2.Route, {
|
|
950
|
+
...r,
|
|
951
|
+
element: r.element || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react11.Suspense, {
|
|
952
|
+
fallback: props.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
916
953
|
style: { padding: "24px" },
|
|
917
|
-
children: /* @__PURE__ */ (0,
|
|
954
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd9.Skeleton, {
|
|
918
955
|
active: true
|
|
919
956
|
})
|
|
920
957
|
}),
|
|
921
|
-
children: /* @__PURE__ */ (0,
|
|
958
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(r.page, {})
|
|
922
959
|
})
|
|
923
|
-
}
|
|
924
|
-
/* @__PURE__ */ (0,
|
|
960
|
+
}, r.path)),
|
|
961
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom2.Route, {
|
|
925
962
|
path: "*",
|
|
926
|
-
element: props.notFound || /* @__PURE__ */ (0,
|
|
963
|
+
element: props.notFound || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PageNotFound, {})
|
|
927
964
|
}, "*")
|
|
928
965
|
]
|
|
929
966
|
});
|
|
930
967
|
}
|
|
931
968
|
|
|
932
969
|
// src/Table.tsx
|
|
933
|
-
var
|
|
970
|
+
var import_react12 = require("react");
|
|
934
971
|
var import_antd10 = require("antd");
|
|
935
972
|
var import_dayjs4 = __toESM(require("dayjs"));
|
|
936
973
|
var import_icons3 = require("@ant-design/icons");
|
|
937
974
|
var import_lodash6 = require("lodash");
|
|
938
|
-
var
|
|
975
|
+
var import_react13 = require("@faasjs/react");
|
|
976
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
939
977
|
function processValue(item, value) {
|
|
940
978
|
var _a;
|
|
941
979
|
const transferred = transferValue(item.type, value);
|
|
942
980
|
if (transferred === null || Array.isArray(transferred) && transferred.length === 0)
|
|
943
|
-
return /* @__PURE__ */ (0,
|
|
981
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {});
|
|
944
982
|
if (item.options) {
|
|
945
983
|
if (item.type.endsWith("[]"))
|
|
946
984
|
return transferred.map((v) => {
|
|
@@ -961,9 +999,9 @@ function processValue(item, value) {
|
|
|
961
999
|
return value;
|
|
962
1000
|
}
|
|
963
1001
|
function Table(props) {
|
|
964
|
-
const [columns, setColumns] = (0,
|
|
1002
|
+
const [columns, setColumns] = (0, import_react12.useState)();
|
|
965
1003
|
const { common: common2 } = useConfigContext();
|
|
966
|
-
(0,
|
|
1004
|
+
(0, import_react12.useEffect)(() => {
|
|
967
1005
|
var _a;
|
|
968
1006
|
for (const item of props.items) {
|
|
969
1007
|
if (!item.key)
|
|
@@ -985,7 +1023,7 @@ function Table(props) {
|
|
|
985
1023
|
delete item.children;
|
|
986
1024
|
if (props.extendTypes && props.extendTypes[item.type]) {
|
|
987
1025
|
if (props.extendTypes[item.type].children)
|
|
988
|
-
item.render = (value, values) => (0,
|
|
1026
|
+
item.render = (value, values) => (0, import_react12.cloneElement)(
|
|
989
1027
|
props.extendTypes[item.type].children,
|
|
990
1028
|
{
|
|
991
1029
|
value,
|
|
@@ -1013,7 +1051,7 @@ function Table(props) {
|
|
|
1013
1051
|
setSelectedKeys,
|
|
1014
1052
|
confirm,
|
|
1015
1053
|
clearFilters
|
|
1016
|
-
}) => /* @__PURE__ */ (0,
|
|
1054
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Input.Search, {
|
|
1017
1055
|
placeholder: `${common2.search} ${item.title}`,
|
|
1018
1056
|
allowClear: true,
|
|
1019
1057
|
onSearch: (v) => {
|
|
@@ -1041,7 +1079,7 @@ function Table(props) {
|
|
|
1041
1079
|
setSelectedKeys,
|
|
1042
1080
|
confirm,
|
|
1043
1081
|
clearFilters
|
|
1044
|
-
}) => /* @__PURE__ */ (0,
|
|
1082
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Input.Search, {
|
|
1045
1083
|
placeholder: `${common2.search} ${item.title}`,
|
|
1046
1084
|
allowClear: true,
|
|
1047
1085
|
onSearch: (v) => {
|
|
@@ -1067,7 +1105,7 @@ function Table(props) {
|
|
|
1067
1105
|
setSelectedKeys,
|
|
1068
1106
|
confirm,
|
|
1069
1107
|
clearFilters
|
|
1070
|
-
}) => /* @__PURE__ */ (0,
|
|
1108
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Input.Search, {
|
|
1071
1109
|
placeholder: `${common2.search} ${item.title}`,
|
|
1072
1110
|
allowClear: true,
|
|
1073
1111
|
onSearch: (v) => {
|
|
@@ -1091,7 +1129,7 @@ function Table(props) {
|
|
|
1091
1129
|
setSelectedKeys,
|
|
1092
1130
|
confirm,
|
|
1093
1131
|
clearFilters
|
|
1094
|
-
}) => /* @__PURE__ */ (0,
|
|
1132
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Input.Search, {
|
|
1095
1133
|
placeholder: `${common2.search} ${item.title}`,
|
|
1096
1134
|
allowClear: true,
|
|
1097
1135
|
onSearch: (v) => {
|
|
@@ -1107,12 +1145,12 @@ function Table(props) {
|
|
|
1107
1145
|
break;
|
|
1108
1146
|
case "boolean":
|
|
1109
1147
|
if (!item.render)
|
|
1110
|
-
item.render = (value) => typeof value === "undefined" ? /* @__PURE__ */ (0,
|
|
1148
|
+
item.render = (value) => typeof value === "undefined" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {}) : value ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CheckOutlined, {
|
|
1111
1149
|
style: {
|
|
1112
1150
|
marginTop: "4px",
|
|
1113
1151
|
color: "#52c41a"
|
|
1114
1152
|
}
|
|
1115
|
-
}) : /* @__PURE__ */ (0,
|
|
1153
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CloseOutlined, {
|
|
1116
1154
|
style: {
|
|
1117
1155
|
marginTop: "4px",
|
|
1118
1156
|
color: "#ff4d4f"
|
|
@@ -1123,7 +1161,7 @@ function Table(props) {
|
|
|
1123
1161
|
setSelectedKeys,
|
|
1124
1162
|
selectedKeys,
|
|
1125
1163
|
confirm
|
|
1126
|
-
}) => /* @__PURE__ */ (0,
|
|
1164
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd10.Radio.Group, {
|
|
1127
1165
|
style: { padding: 8 },
|
|
1128
1166
|
buttonStyle: "solid",
|
|
1129
1167
|
value: selectedKeys[0],
|
|
@@ -1132,28 +1170,28 @@ function Table(props) {
|
|
|
1132
1170
|
confirm();
|
|
1133
1171
|
},
|
|
1134
1172
|
children: [
|
|
1135
|
-
/* @__PURE__ */ (0,
|
|
1173
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Radio.Button, {
|
|
1136
1174
|
children: common2.all
|
|
1137
1175
|
}),
|
|
1138
|
-
/* @__PURE__ */ (0,
|
|
1176
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Radio.Button, {
|
|
1139
1177
|
value: "true",
|
|
1140
|
-
children: /* @__PURE__ */ (0,
|
|
1178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CheckOutlined, {
|
|
1141
1179
|
style: {
|
|
1142
1180
|
color: "#52c41a",
|
|
1143
1181
|
verticalAlign: "middle"
|
|
1144
1182
|
}
|
|
1145
1183
|
})
|
|
1146
1184
|
}),
|
|
1147
|
-
/* @__PURE__ */ (0,
|
|
1185
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Radio.Button, {
|
|
1148
1186
|
value: "false",
|
|
1149
|
-
children: /* @__PURE__ */ (0,
|
|
1187
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CloseOutlined, {
|
|
1150
1188
|
style: {
|
|
1151
1189
|
verticalAlign: "middle",
|
|
1152
1190
|
color: "#ff4d4f"
|
|
1153
1191
|
}
|
|
1154
1192
|
})
|
|
1155
1193
|
}),
|
|
1156
|
-
/* @__PURE__ */ (0,
|
|
1194
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Radio.Button, {
|
|
1157
1195
|
value: "empty",
|
|
1158
1196
|
children: common2.blank
|
|
1159
1197
|
})
|
|
@@ -1191,7 +1229,7 @@ function Table(props) {
|
|
|
1191
1229
|
break;
|
|
1192
1230
|
case "object":
|
|
1193
1231
|
if (!item.render)
|
|
1194
|
-
item.render = (value) => /* @__PURE__ */ (0,
|
|
1232
|
+
item.render = (value) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
|
|
1195
1233
|
items: item.object,
|
|
1196
1234
|
dataSource: value,
|
|
1197
1235
|
column: 1
|
|
@@ -1199,7 +1237,7 @@ function Table(props) {
|
|
|
1199
1237
|
break;
|
|
1200
1238
|
case "object[]":
|
|
1201
1239
|
if (!item.render)
|
|
1202
|
-
item.render = (value) => value.map((v, i) => /* @__PURE__ */ (0,
|
|
1240
|
+
item.render = (value) => value.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Description, {
|
|
1203
1241
|
items: item.object,
|
|
1204
1242
|
dataSource: v,
|
|
1205
1243
|
column: 1
|
|
@@ -1215,7 +1253,7 @@ function Table(props) {
|
|
|
1215
1253
|
}
|
|
1216
1254
|
setColumns(props.items);
|
|
1217
1255
|
}, [props.items]);
|
|
1218
|
-
(0,
|
|
1256
|
+
(0, import_react12.useEffect)(() => {
|
|
1219
1257
|
if (!props.dataSource || !columns)
|
|
1220
1258
|
return;
|
|
1221
1259
|
for (const column of columns) {
|
|
@@ -1235,13 +1273,14 @@ function Table(props) {
|
|
|
1235
1273
|
if (!columns)
|
|
1236
1274
|
return null;
|
|
1237
1275
|
if (!props.faasData)
|
|
1238
|
-
return /* @__PURE__ */ (0,
|
|
1276
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
|
|
1277
|
+
...props,
|
|
1239
1278
|
rowKey: props.rowKey || "id",
|
|
1240
1279
|
columns,
|
|
1241
1280
|
dataSource: props.dataSource
|
|
1242
|
-
})
|
|
1243
|
-
return /* @__PURE__ */ (0,
|
|
1244
|
-
fallback: props.faasData.fallback || /* @__PURE__ */ (0,
|
|
1281
|
+
});
|
|
1282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react13.FaasDataWrapper, {
|
|
1283
|
+
fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Skeleton, {
|
|
1245
1284
|
active: true
|
|
1246
1285
|
}),
|
|
1247
1286
|
render: ({
|
|
@@ -1250,74 +1289,84 @@ function Table(props) {
|
|
|
1250
1289
|
reload
|
|
1251
1290
|
}) => {
|
|
1252
1291
|
if (!data)
|
|
1253
|
-
return /* @__PURE__ */ (0,
|
|
1292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
|
|
1293
|
+
...props,
|
|
1254
1294
|
rowKey: props.rowKey || "id",
|
|
1255
1295
|
columns,
|
|
1256
1296
|
dataSource: []
|
|
1257
|
-
})
|
|
1297
|
+
});
|
|
1258
1298
|
if (Array.isArray(data))
|
|
1259
|
-
return /* @__PURE__ */ (0,
|
|
1299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
|
|
1300
|
+
...props,
|
|
1260
1301
|
rowKey: props.rowKey || "id",
|
|
1261
1302
|
columns,
|
|
1262
1303
|
dataSource: data
|
|
1263
|
-
})
|
|
1264
|
-
return /* @__PURE__ */ (0,
|
|
1304
|
+
});
|
|
1305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
|
|
1306
|
+
...props,
|
|
1265
1307
|
rowKey: props.rowKey || "id",
|
|
1266
1308
|
columns,
|
|
1267
1309
|
dataSource: data.rows,
|
|
1268
|
-
pagination:
|
|
1310
|
+
pagination: {
|
|
1311
|
+
...props.pagination,
|
|
1312
|
+
...data.pagination
|
|
1313
|
+
},
|
|
1269
1314
|
onChange: (pagination, filters, sorter, extra) => {
|
|
1270
1315
|
if (props.onChange) {
|
|
1271
1316
|
const processed = props.onChange(pagination, filters, sorter, extra);
|
|
1272
|
-
reload(
|
|
1317
|
+
reload({
|
|
1318
|
+
...params,
|
|
1273
1319
|
pagination: processed.pagination,
|
|
1274
1320
|
filters: processed.filters,
|
|
1275
1321
|
sorter: processed.sorter
|
|
1276
|
-
})
|
|
1322
|
+
});
|
|
1277
1323
|
return;
|
|
1278
1324
|
}
|
|
1279
|
-
reload(
|
|
1325
|
+
reload({
|
|
1326
|
+
...params,
|
|
1280
1327
|
pagination,
|
|
1281
1328
|
filters,
|
|
1282
1329
|
sorter
|
|
1283
|
-
})
|
|
1330
|
+
});
|
|
1284
1331
|
}
|
|
1285
|
-
})
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1332
|
+
});
|
|
1333
|
+
},
|
|
1334
|
+
...props.faasData
|
|
1335
|
+
});
|
|
1288
1336
|
}
|
|
1289
1337
|
|
|
1290
1338
|
// src/Title.tsx
|
|
1291
|
-
var
|
|
1339
|
+
var import_react14 = require("react");
|
|
1292
1340
|
var import_antd11 = require("antd");
|
|
1293
|
-
var
|
|
1341
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
1294
1342
|
function Title(props) {
|
|
1295
1343
|
const { Title: Title2 } = useConfigContext();
|
|
1296
|
-
(0,
|
|
1344
|
+
(0, import_react14.useEffect)(() => {
|
|
1297
1345
|
const title = Array.isArray(props.title) ? props.title : [props.title];
|
|
1298
1346
|
document.title = title.concat(props.suffix || Title2.suffix).filter((t) => !!t).join(props.separator || Title2.separator);
|
|
1299
1347
|
}, [props]);
|
|
1300
1348
|
if (props.h1) {
|
|
1301
1349
|
if (typeof props.h1 === "boolean")
|
|
1302
|
-
return /* @__PURE__ */ (0,
|
|
1350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
|
|
1303
1351
|
children: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1304
1352
|
});
|
|
1305
|
-
return /* @__PURE__ */ (0,
|
|
1353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
|
|
1306
1354
|
className: props.h1.className,
|
|
1307
1355
|
style: props.h1.style,
|
|
1308
1356
|
children: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1309
1357
|
});
|
|
1310
1358
|
}
|
|
1311
1359
|
if (props.plain)
|
|
1312
|
-
return /* @__PURE__ */ (0,
|
|
1360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
1313
1361
|
children: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1314
1362
|
});
|
|
1315
1363
|
if (props.header)
|
|
1316
|
-
return /* @__PURE__ */ (0,
|
|
1317
|
-
title: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1318
|
-
|
|
1364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd11.PageHeader, {
|
|
1365
|
+
title: Array.isArray(props.title) ? props.title[0] : props.title,
|
|
1366
|
+
...props.header
|
|
1367
|
+
});
|
|
1319
1368
|
if (props.children)
|
|
1320
|
-
return (0,
|
|
1369
|
+
return (0, import_react14.cloneElement)(props.children, { title: props.title });
|
|
1321
1370
|
return null;
|
|
1322
1371
|
}
|
|
1323
1372
|
// Annotate the CommonJS export names for ESM import in node:
|