@faasjs/ant-design 0.0.2-beta.396 → 0.0.2-beta.397
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -16
- package/dist/index.d.ts +4 -7
- package/dist/index.js +422 -273
- package/dist/index.mjs +418 -274
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -17,7 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
|
+
mod
|
|
23
|
+
));
|
|
21
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
25
|
|
|
23
26
|
// src/index.ts
|
|
@@ -53,6 +56,7 @@ var import_lodash = require("lodash");
|
|
|
53
56
|
|
|
54
57
|
// src/Config.tsx
|
|
55
58
|
var import_react2 = require("react");
|
|
59
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
56
60
|
var isZH = /^zh/i.test(navigator.language);
|
|
57
61
|
var common = isZH ? {
|
|
58
62
|
lang: "zh",
|
|
@@ -88,23 +92,26 @@ function ConfigProvider({
|
|
|
88
92
|
config,
|
|
89
93
|
children
|
|
90
94
|
}) {
|
|
91
|
-
return /* @__PURE__ */
|
|
95
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConfigContext.Provider, {
|
|
92
96
|
value: {
|
|
93
97
|
...baseConfig,
|
|
94
98
|
...config
|
|
95
|
-
}
|
|
96
|
-
|
|
99
|
+
},
|
|
100
|
+
children
|
|
101
|
+
});
|
|
97
102
|
}
|
|
98
103
|
function useConfigContext() {
|
|
99
104
|
return (0, import_react2.useContext)(ConfigContext);
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
// src/Blank.tsx
|
|
108
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
103
109
|
function Blank(options) {
|
|
104
110
|
const config = useConfigContext();
|
|
105
|
-
return !options || (0, import_lodash.isNil)(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */
|
|
106
|
-
disabled: true
|
|
107
|
-
|
|
111
|
+
return !options || (0, import_lodash.isNil)(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Typography.Text, {
|
|
112
|
+
disabled: true,
|
|
113
|
+
children: (options == null ? void 0 : options.text) || config.Blank.text
|
|
114
|
+
}) : options.value;
|
|
108
115
|
}
|
|
109
116
|
|
|
110
117
|
// src/Calendar.tsx
|
|
@@ -137,6 +144,7 @@ var import_lodash3 = require("lodash");
|
|
|
137
144
|
var import_react3 = require("react");
|
|
138
145
|
var import_dayjs3 = __toESM(require("dayjs"));
|
|
139
146
|
var import_react4 = require("@faasjs/react");
|
|
147
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
140
148
|
function DescriptionItemContent(props) {
|
|
141
149
|
const [computedProps, setComputedProps] = (0, import_react3.useState)();
|
|
142
150
|
(0, import_react3.useEffect)(() => {
|
|
@@ -168,75 +176,92 @@ function DescriptionItemContent(props) {
|
|
|
168
176
|
return null;
|
|
169
177
|
if (computedProps.extendTypes && computedProps.extendTypes[computedProps.item.type])
|
|
170
178
|
if (computedProps.extendTypes[computedProps.item.type].children)
|
|
171
|
-
return (0, import_react3.cloneElement)(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
179
|
+
return (0, import_react3.cloneElement)(
|
|
180
|
+
computedProps.extendTypes[computedProps.item.type].children,
|
|
181
|
+
{
|
|
182
|
+
value: computedProps.value,
|
|
183
|
+
values: computedProps.values
|
|
184
|
+
}
|
|
185
|
+
);
|
|
175
186
|
else if (computedProps.extendTypes[computedProps.item.type].render)
|
|
176
|
-
return /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
188
|
+
children: computedProps.extendTypes[computedProps.item.type].render(computedProps.value, computedProps.values)
|
|
189
|
+
});
|
|
177
190
|
else
|
|
178
191
|
throw Error(computedProps.item.type + " requires children or render");
|
|
179
192
|
if (computedProps.item.children)
|
|
180
193
|
return (0, import_react3.cloneElement)(computedProps.item.children, { value: computedProps.value });
|
|
181
194
|
if (computedProps.item.render)
|
|
182
|
-
return /* @__PURE__ */
|
|
195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
196
|
+
children: computedProps.item.render(computedProps.value, computedProps.values)
|
|
197
|
+
});
|
|
183
198
|
if (typeof computedProps.value === "undefined" || computedProps.value === null)
|
|
184
199
|
return null;
|
|
185
200
|
switch (computedProps.item.type) {
|
|
186
201
|
case "string[]":
|
|
187
|
-
return /* @__PURE__ */
|
|
202
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
203
|
+
children: computedProps.value.join(", ")
|
|
204
|
+
});
|
|
188
205
|
case "number":
|
|
189
206
|
return computedProps.value || null;
|
|
190
207
|
case "number[]":
|
|
191
|
-
return /* @__PURE__ */
|
|
208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
209
|
+
children: computedProps.value.join(", ")
|
|
210
|
+
});
|
|
192
211
|
case "boolean":
|
|
193
|
-
return computedProps.value ? /* @__PURE__ */
|
|
212
|
+
return computedProps.value ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckOutlined, {
|
|
194
213
|
style: {
|
|
195
214
|
marginTop: "4px",
|
|
196
215
|
color: "#52c41a"
|
|
197
216
|
}
|
|
198
|
-
}) : /* @__PURE__ */
|
|
217
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseOutlined, {
|
|
199
218
|
style: {
|
|
200
219
|
marginTop: "4px",
|
|
201
220
|
color: "#ff4d4f"
|
|
202
221
|
}
|
|
203
222
|
});
|
|
204
223
|
case "time":
|
|
205
|
-
return /* @__PURE__ */
|
|
224
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
225
|
+
children: typeof computedProps.value === "number" && computedProps.value.toString().length === 10 ? import_dayjs3.default.unix(computedProps.value).format("YYYY-MM-DD HH:mm:ss") : (0, import_dayjs3.default)(computedProps.value).format("YYYY-MM-DD HH:mm:ss")
|
|
226
|
+
});
|
|
206
227
|
case "date":
|
|
207
|
-
return /* @__PURE__ */
|
|
228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {
|
|
229
|
+
children: typeof computedProps.value === "number" && computedProps.value.toString().length === 10 ? import_dayjs3.default.unix(computedProps.value).format("YYYY-MM-DD") : (0, import_dayjs3.default)(computedProps.value).format("YYYY-MM-DD")
|
|
230
|
+
});
|
|
208
231
|
default:
|
|
209
232
|
return computedProps.value || null;
|
|
210
233
|
}
|
|
211
234
|
}
|
|
212
235
|
function Description(props) {
|
|
213
236
|
if (!props.faasData)
|
|
214
|
-
return /* @__PURE__ */
|
|
215
|
-
...props
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Descriptions, {
|
|
238
|
+
...props,
|
|
239
|
+
children: props.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Descriptions.Item, {
|
|
240
|
+
label: item.title || (0, import_lodash3.upperFirst)(item.id),
|
|
241
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
|
|
242
|
+
item,
|
|
243
|
+
value: props.dataSource[item.id],
|
|
244
|
+
values: props.dataSource,
|
|
245
|
+
extendTypes: props.extendTypes
|
|
246
|
+
})
|
|
247
|
+
}, item.id))
|
|
248
|
+
});
|
|
249
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react4.FaasDataWrapper, {
|
|
250
|
+
fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Skeleton, {
|
|
227
251
|
active: true
|
|
228
252
|
}),
|
|
229
|
-
render: ({ data }) => /* @__PURE__ */
|
|
230
|
-
...props
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
253
|
+
render: ({ data }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Descriptions, {
|
|
254
|
+
...props,
|
|
255
|
+
children: props.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd2.Descriptions.Item, {
|
|
256
|
+
label: item.title || (0, import_lodash3.upperFirst)(item.id),
|
|
257
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DescriptionItemContent, {
|
|
258
|
+
item,
|
|
259
|
+
value: data[item.id],
|
|
260
|
+
values: data,
|
|
261
|
+
extendTypes: props.extendTypes
|
|
262
|
+
})
|
|
263
|
+
}, item.id))
|
|
264
|
+
}),
|
|
240
265
|
...props.faasData
|
|
241
266
|
});
|
|
242
267
|
}
|
|
@@ -244,6 +269,7 @@ function Description(props) {
|
|
|
244
269
|
// src/Drawer.tsx
|
|
245
270
|
var import_antd3 = require("antd");
|
|
246
271
|
var import_react5 = require("react");
|
|
272
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
247
273
|
function useDrawer(init) {
|
|
248
274
|
const [props, setProps] = (0, import_react5.useState)({
|
|
249
275
|
visible: false,
|
|
@@ -254,7 +280,7 @@ function useDrawer(init) {
|
|
|
254
280
|
...init
|
|
255
281
|
});
|
|
256
282
|
return {
|
|
257
|
-
drawer: /* @__PURE__ */
|
|
283
|
+
drawer: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd3.Drawer, {
|
|
258
284
|
...props
|
|
259
285
|
}),
|
|
260
286
|
drawerProps: props,
|
|
@@ -280,8 +306,9 @@ var import_lodash4 = require("lodash");
|
|
|
280
306
|
|
|
281
307
|
// src/TimePicker.tsx
|
|
282
308
|
var import_react6 = require("react");
|
|
309
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
283
310
|
var TimePicker = (0, import_react6.forwardRef)((props, ref) => {
|
|
284
|
-
return /* @__PURE__ */
|
|
311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DatePicker, {
|
|
285
312
|
...props,
|
|
286
313
|
picker: "time",
|
|
287
314
|
mode: void 0,
|
|
@@ -291,6 +318,7 @@ var TimePicker = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
291
318
|
TimePicker.displayName = "TimePicker";
|
|
292
319
|
|
|
293
320
|
// src/FormItem.tsx
|
|
321
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
294
322
|
function processProps(propsCopy, config) {
|
|
295
323
|
if (!propsCopy.title)
|
|
296
324
|
propsCopy.title = (0, import_lodash4.upperFirst)(propsCopy.id);
|
|
@@ -347,196 +375,284 @@ function FormItem(props) {
|
|
|
347
375
|
if (!computedProps)
|
|
348
376
|
return null;
|
|
349
377
|
if (computedProps.extendTypes && computedProps.extendTypes[computedProps.type])
|
|
350
|
-
return /* @__PURE__ */
|
|
351
|
-
...computedProps
|
|
352
|
-
|
|
378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
379
|
+
...computedProps,
|
|
380
|
+
children: computedProps.extendTypes[computedProps.type].children
|
|
381
|
+
});
|
|
353
382
|
if (computedProps.children)
|
|
354
|
-
return /* @__PURE__ */
|
|
355
|
-
...computedProps
|
|
356
|
-
|
|
383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
384
|
+
...computedProps,
|
|
385
|
+
children: computedProps.children
|
|
386
|
+
});
|
|
357
387
|
if (computedProps.render)
|
|
358
|
-
return /* @__PURE__ */
|
|
359
|
-
...computedProps
|
|
360
|
-
|
|
388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
389
|
+
...computedProps,
|
|
390
|
+
children: computedProps.render()
|
|
391
|
+
});
|
|
361
392
|
switch (computedProps.type) {
|
|
362
393
|
case "string":
|
|
363
|
-
return /* @__PURE__ */
|
|
364
|
-
...computedProps
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
395
|
+
...computedProps,
|
|
396
|
+
children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Select, {
|
|
397
|
+
...computedProps.input
|
|
398
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Input, {
|
|
399
|
+
...computedProps.input
|
|
400
|
+
})
|
|
401
|
+
});
|
|
370
402
|
case "string[]":
|
|
371
403
|
if (computedProps.options)
|
|
372
|
-
return /* @__PURE__ */
|
|
373
|
-
...computedProps
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
...computedProps.input
|
|
377
|
-
}));
|
|
378
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.List, {
|
|
379
|
-
name: computedProps.name,
|
|
380
|
-
rules: computedProps.rules
|
|
381
|
-
}, (fields, { add, remove }, { errors }) => {
|
|
382
|
-
var _a2;
|
|
383
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, computedProps.label && /* @__PURE__ */ import_react.default.createElement("div", {
|
|
384
|
-
className: "ant-form-item-label"
|
|
385
|
-
}, /* @__PURE__ */ import_react.default.createElement("label", {
|
|
386
|
-
className: computedProps.rules.find((r) => r.required) && "ant-form-item-required"
|
|
387
|
-
}, computedProps.label)), fields.map((field) => {
|
|
388
|
-
var _a3;
|
|
389
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, {
|
|
390
|
-
key: field.key
|
|
391
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Row, {
|
|
392
|
-
gutter: 24,
|
|
393
|
-
style: { flexFlow: "row nowrap" }
|
|
394
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Col, {
|
|
395
|
-
span: 23
|
|
396
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, {
|
|
397
|
-
...field,
|
|
398
|
-
noStyle: true
|
|
399
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Input, {
|
|
404
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
405
|
+
...computedProps,
|
|
406
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Select, {
|
|
407
|
+
mode: "multiple",
|
|
400
408
|
...computedProps.input
|
|
401
|
-
})
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
409
|
+
})
|
|
410
|
+
});
|
|
411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.List, {
|
|
412
|
+
name: computedProps.name,
|
|
413
|
+
rules: computedProps.rules,
|
|
414
|
+
children: (fields, { add, remove }, { errors }) => {
|
|
415
|
+
var _a2;
|
|
416
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
417
|
+
children: [
|
|
418
|
+
computedProps.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
419
|
+
className: "ant-form-item-label",
|
|
420
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", {
|
|
421
|
+
className: computedProps.rules.find((r) => r.required) && "ant-form-item-required",
|
|
422
|
+
children: computedProps.label
|
|
423
|
+
})
|
|
424
|
+
}),
|
|
425
|
+
fields.map((field) => {
|
|
426
|
+
var _a3;
|
|
427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
428
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Row, {
|
|
429
|
+
gutter: 24,
|
|
430
|
+
style: { flexFlow: "row nowrap" },
|
|
431
|
+
children: [
|
|
432
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
|
|
433
|
+
span: 23,
|
|
434
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
435
|
+
...field,
|
|
436
|
+
noStyle: true,
|
|
437
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Input, {
|
|
438
|
+
...computedProps.input
|
|
439
|
+
})
|
|
440
|
+
})
|
|
441
|
+
}),
|
|
442
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
|
|
443
|
+
span: 1,
|
|
444
|
+
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_antd4.Button, {
|
|
445
|
+
danger: true,
|
|
446
|
+
type: "link",
|
|
447
|
+
style: { float: "right" },
|
|
448
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.MinusCircleOutlined, {}),
|
|
449
|
+
onClick: () => remove(field.name)
|
|
450
|
+
})
|
|
451
|
+
})
|
|
452
|
+
]
|
|
453
|
+
})
|
|
454
|
+
}, field.key);
|
|
455
|
+
}),
|
|
456
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Form.Item, {
|
|
457
|
+
children: [
|
|
458
|
+
!((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Button, {
|
|
459
|
+
type: "dashed",
|
|
460
|
+
block: true,
|
|
461
|
+
onClick: () => add(),
|
|
462
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
|
|
463
|
+
}),
|
|
464
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.ErrorList, {
|
|
465
|
+
errors
|
|
466
|
+
})
|
|
467
|
+
]
|
|
468
|
+
})
|
|
469
|
+
]
|
|
470
|
+
});
|
|
471
|
+
}
|
|
418
472
|
});
|
|
419
473
|
case "number":
|
|
420
|
-
return /* @__PURE__ */
|
|
421
|
-
...computedProps
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
475
|
+
...computedProps,
|
|
476
|
+
children: computedProps.options ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Select, {
|
|
477
|
+
...computedProps.input
|
|
478
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.InputNumber, {
|
|
479
|
+
style: { width: "100%" },
|
|
480
|
+
...computedProps.input
|
|
481
|
+
})
|
|
482
|
+
});
|
|
428
483
|
case "number[]":
|
|
429
484
|
if (computedProps.options)
|
|
430
|
-
return /* @__PURE__ */
|
|
431
|
-
...computedProps
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
...computedProps.input
|
|
435
|
-
}));
|
|
436
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.List, {
|
|
437
|
-
name: computedProps.name,
|
|
438
|
-
rules: computedProps.rules
|
|
439
|
-
}, (fields, { add, remove }, { errors }) => {
|
|
440
|
-
var _a2, _b;
|
|
441
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, computedProps.label && /* @__PURE__ */ import_react.default.createElement("div", {
|
|
442
|
-
className: "ant-form-item-label"
|
|
443
|
-
}, /* @__PURE__ */ import_react.default.createElement("label", {
|
|
444
|
-
className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required"
|
|
445
|
-
}, computedProps.label)), fields.map((field) => {
|
|
446
|
-
var _a3;
|
|
447
|
-
return /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, {
|
|
448
|
-
key: field.key
|
|
449
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Row, {
|
|
450
|
-
gutter: 24,
|
|
451
|
-
style: { flexFlow: "row nowrap" }
|
|
452
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Col, {
|
|
453
|
-
span: 23
|
|
454
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.Form.Item, {
|
|
455
|
-
...field,
|
|
456
|
-
noStyle: true
|
|
457
|
-
}, /* @__PURE__ */ import_react.default.createElement(import_antd4.InputNumber, {
|
|
458
|
-
style: { width: "100%" },
|
|
485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
486
|
+
...computedProps,
|
|
487
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Select, {
|
|
488
|
+
mode: "multiple",
|
|
459
489
|
...computedProps.input
|
|
460
|
-
})
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
490
|
+
})
|
|
491
|
+
});
|
|
492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.List, {
|
|
493
|
+
name: computedProps.name,
|
|
494
|
+
rules: computedProps.rules,
|
|
495
|
+
children: (fields, { add, remove }, { errors }) => {
|
|
496
|
+
var _a2, _b;
|
|
497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
498
|
+
children: [
|
|
499
|
+
computedProps.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
500
|
+
className: "ant-form-item-label",
|
|
501
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", {
|
|
502
|
+
className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required",
|
|
503
|
+
children: computedProps.label
|
|
504
|
+
})
|
|
505
|
+
}),
|
|
506
|
+
fields.map((field) => {
|
|
507
|
+
var _a3;
|
|
508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
509
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Row, {
|
|
510
|
+
gutter: 24,
|
|
511
|
+
style: { flexFlow: "row nowrap" },
|
|
512
|
+
children: [
|
|
513
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
|
|
514
|
+
span: 23,
|
|
515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
516
|
+
...field,
|
|
517
|
+
noStyle: true,
|
|
518
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.InputNumber, {
|
|
519
|
+
style: { width: "100%" },
|
|
520
|
+
...computedProps.input
|
|
521
|
+
})
|
|
522
|
+
})
|
|
523
|
+
}),
|
|
524
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
|
|
525
|
+
span: 1,
|
|
526
|
+
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_antd4.Button, {
|
|
527
|
+
danger: true,
|
|
528
|
+
type: "link",
|
|
529
|
+
style: { float: "right" },
|
|
530
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.MinusCircleOutlined, {}),
|
|
531
|
+
onClick: () => remove(field.name)
|
|
532
|
+
})
|
|
533
|
+
})
|
|
534
|
+
]
|
|
535
|
+
})
|
|
536
|
+
}, field.key);
|
|
537
|
+
}),
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Form.Item, {
|
|
539
|
+
children: [
|
|
540
|
+
!((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Button, {
|
|
541
|
+
type: "dashed",
|
|
542
|
+
block: true,
|
|
543
|
+
onClick: () => add(),
|
|
544
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {})
|
|
545
|
+
}),
|
|
546
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.ErrorList, {
|
|
547
|
+
errors
|
|
548
|
+
})
|
|
549
|
+
]
|
|
550
|
+
})
|
|
551
|
+
]
|
|
552
|
+
});
|
|
553
|
+
}
|
|
477
554
|
});
|
|
478
555
|
case "boolean":
|
|
479
|
-
return /* @__PURE__ */
|
|
480
|
-
...computedProps
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
557
|
+
...computedProps,
|
|
558
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Switch, {
|
|
559
|
+
...computedProps.input
|
|
560
|
+
})
|
|
561
|
+
});
|
|
484
562
|
case "date":
|
|
485
|
-
return /* @__PURE__ */
|
|
486
|
-
...computedProps
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
564
|
+
...computedProps,
|
|
565
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DatePicker, {
|
|
566
|
+
...computedProps.input
|
|
567
|
+
})
|
|
568
|
+
});
|
|
490
569
|
case "time":
|
|
491
|
-
return /* @__PURE__ */
|
|
492
|
-
...computedProps
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.Item, {
|
|
571
|
+
...computedProps,
|
|
572
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TimePicker, {
|
|
573
|
+
...computedProps.input
|
|
574
|
+
})
|
|
575
|
+
});
|
|
496
576
|
case "object":
|
|
497
|
-
return /* @__PURE__ */
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
578
|
+
children: [
|
|
579
|
+
computedProps.label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
580
|
+
className: "ant-form-item-label",
|
|
581
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", {
|
|
582
|
+
className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required",
|
|
583
|
+
children: computedProps.label
|
|
584
|
+
})
|
|
585
|
+
}),
|
|
586
|
+
computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItem, {
|
|
587
|
+
...o
|
|
588
|
+
}, o.id))
|
|
589
|
+
]
|
|
590
|
+
});
|
|
505
591
|
case "object[]":
|
|
506
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.List, {
|
|
507
593
|
name: computedProps.name,
|
|
508
|
-
rules: computedProps.rules
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
594
|
+
rules: computedProps.rules,
|
|
595
|
+
children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
596
|
+
children: [
|
|
597
|
+
fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Form.Item, {
|
|
598
|
+
style: { marginBottom: 0 },
|
|
599
|
+
children: [
|
|
600
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
601
|
+
className: "ant-form-item-label",
|
|
602
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", {
|
|
603
|
+
children: [
|
|
604
|
+
computedProps.label,
|
|
605
|
+
" ",
|
|
606
|
+
field.name + 1,
|
|
607
|
+
!computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Button, {
|
|
608
|
+
danger: true,
|
|
609
|
+
type: "link",
|
|
610
|
+
onClick: () => remove(field.name),
|
|
611
|
+
children: config.common.delete
|
|
612
|
+
})
|
|
613
|
+
]
|
|
614
|
+
})
|
|
615
|
+
}),
|
|
616
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Row, {
|
|
617
|
+
gutter: 24,
|
|
618
|
+
children: computedProps.object.map((o) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Col, {
|
|
619
|
+
span: o.col || 6,
|
|
620
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItem, {
|
|
621
|
+
...o,
|
|
622
|
+
name: [field.name, o.id]
|
|
623
|
+
})
|
|
624
|
+
}, o.id))
|
|
625
|
+
})
|
|
626
|
+
]
|
|
627
|
+
}, field.key)),
|
|
628
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Form.Item, {
|
|
629
|
+
children: [
|
|
630
|
+
!computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd4.Button, {
|
|
631
|
+
type: "dashed",
|
|
632
|
+
block: true,
|
|
633
|
+
onClick: () => add(),
|
|
634
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons2.PlusOutlined, {}),
|
|
635
|
+
children: [
|
|
636
|
+
config.common.add,
|
|
637
|
+
" ",
|
|
638
|
+
computedProps.label
|
|
639
|
+
]
|
|
640
|
+
}),
|
|
641
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd4.Form.ErrorList, {
|
|
642
|
+
errors
|
|
643
|
+
})
|
|
644
|
+
]
|
|
645
|
+
})
|
|
646
|
+
]
|
|
647
|
+
})
|
|
648
|
+
});
|
|
534
649
|
default:
|
|
535
650
|
return null;
|
|
536
651
|
}
|
|
537
652
|
}
|
|
538
653
|
|
|
539
654
|
// src/Form.tsx
|
|
655
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
540
656
|
function Form(props) {
|
|
541
657
|
var _a, _b;
|
|
542
658
|
const [loading, setLoading] = (0, import_react9.useState)(false);
|
|
@@ -574,17 +690,24 @@ function Form(props) {
|
|
|
574
690
|
}, []);
|
|
575
691
|
if (!computedProps)
|
|
576
692
|
return null;
|
|
577
|
-
return /* @__PURE__ */
|
|
578
|
-
...computedProps
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd5.Form, {
|
|
694
|
+
...computedProps,
|
|
695
|
+
children: [
|
|
696
|
+
computedProps.beforeItems,
|
|
697
|
+
(_a = computedProps.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormItem, {
|
|
698
|
+
...item,
|
|
699
|
+
extendTypes: computedProps.extendTypes
|
|
700
|
+
}, item.id)),
|
|
701
|
+
computedProps.children,
|
|
702
|
+
computedProps.submit !== false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd5.Button, {
|
|
703
|
+
htmlType: "submit",
|
|
704
|
+
type: "primary",
|
|
705
|
+
loading,
|
|
706
|
+
children: ((_b = computedProps.submit) == null ? void 0 : _b.text) || config.Form.submit.text
|
|
707
|
+
}),
|
|
708
|
+
computedProps.footer
|
|
709
|
+
]
|
|
710
|
+
});
|
|
588
711
|
}
|
|
589
712
|
Form.useForm = import_antd5.Form.useForm;
|
|
590
713
|
Form.Item = FormItem;
|
|
@@ -592,6 +715,7 @@ Form.Item = FormItem;
|
|
|
592
715
|
// src/Modal.tsx
|
|
593
716
|
var import_antd6 = require("antd");
|
|
594
717
|
var import_react10 = require("react");
|
|
718
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
595
719
|
function useModal(init) {
|
|
596
720
|
const [props, setProps] = (0, import_react10.useState)({
|
|
597
721
|
visible: false,
|
|
@@ -602,7 +726,7 @@ function useModal(init) {
|
|
|
602
726
|
...init
|
|
603
727
|
});
|
|
604
728
|
return {
|
|
605
|
-
modal: /* @__PURE__ */
|
|
729
|
+
modal: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd6.Modal, {
|
|
606
730
|
...props
|
|
607
731
|
}),
|
|
608
732
|
modalProps: props,
|
|
@@ -619,29 +743,35 @@ function useModal(init) {
|
|
|
619
743
|
var import_antd7 = require("antd");
|
|
620
744
|
var import_react11 = require("react");
|
|
621
745
|
var import_react_router_dom = require("react-router-dom");
|
|
746
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
622
747
|
function NotFound() {
|
|
623
748
|
const config = useConfigContext();
|
|
624
|
-
return /* @__PURE__ */
|
|
749
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Result, {
|
|
625
750
|
status: "404",
|
|
626
751
|
title: config.common.pageNotFound
|
|
627
752
|
});
|
|
628
753
|
}
|
|
629
754
|
function Routes(props) {
|
|
630
|
-
return /* @__PURE__ */
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_router_dom.Routes, {
|
|
756
|
+
children: [
|
|
757
|
+
props.routes.map((r) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Route, {
|
|
758
|
+
...r,
|
|
759
|
+
element: r.element || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react11.Suspense, {
|
|
760
|
+
fallback: props.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
761
|
+
style: { padding: "24px" },
|
|
762
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd7.Skeleton, {
|
|
763
|
+
active: true
|
|
764
|
+
})
|
|
765
|
+
}),
|
|
766
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(r.page, {})
|
|
767
|
+
})
|
|
768
|
+
}, r.path)),
|
|
769
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_router_dom.Route, {
|
|
770
|
+
path: "*",
|
|
771
|
+
element: props.notFound || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NotFound, {})
|
|
772
|
+
}, "*")
|
|
773
|
+
]
|
|
774
|
+
});
|
|
645
775
|
}
|
|
646
776
|
|
|
647
777
|
// src/Table.tsx
|
|
@@ -651,6 +781,7 @@ var import_dayjs4 = __toESM(require("dayjs"));
|
|
|
651
781
|
var import_icons3 = require("@ant-design/icons");
|
|
652
782
|
var import_lodash5 = require("lodash");
|
|
653
783
|
var import_react13 = require("@faasjs/react");
|
|
784
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
654
785
|
function processValue(item, value) {
|
|
655
786
|
var _a;
|
|
656
787
|
if (typeof value !== "undefined" && value !== null) {
|
|
@@ -707,10 +838,13 @@ function Table(props) {
|
|
|
707
838
|
delete item.children;
|
|
708
839
|
if (props.extendTypes && props.extendTypes[item.type]) {
|
|
709
840
|
if (props.extendTypes[item.type].children) {
|
|
710
|
-
item.render = (value, values) => (0, import_react12.cloneElement)(
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
841
|
+
item.render = (value, values) => (0, import_react12.cloneElement)(
|
|
842
|
+
props.extendTypes[item.type].children,
|
|
843
|
+
{
|
|
844
|
+
value,
|
|
845
|
+
values
|
|
846
|
+
}
|
|
847
|
+
);
|
|
714
848
|
} else if (props.extendTypes[item.type].render)
|
|
715
849
|
item.render = props.extendTypes[item.type].render;
|
|
716
850
|
else
|
|
@@ -736,12 +870,12 @@ function Table(props) {
|
|
|
736
870
|
item.onFilter = (value, row) => row[item.id].includes(value);
|
|
737
871
|
break;
|
|
738
872
|
case "boolean":
|
|
739
|
-
item.render = (value) => typeof value === "undefined" ? /* @__PURE__ */
|
|
873
|
+
item.render = (value) => typeof value === "undefined" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {}) : value ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CheckOutlined, {
|
|
740
874
|
style: {
|
|
741
875
|
marginTop: "4px",
|
|
742
876
|
color: "#52c41a"
|
|
743
877
|
}
|
|
744
|
-
}) : /* @__PURE__ */
|
|
878
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CloseOutlined, {
|
|
745
879
|
style: {
|
|
746
880
|
marginTop: "4px",
|
|
747
881
|
color: "#ff4d4f"
|
|
@@ -752,31 +886,42 @@ function Table(props) {
|
|
|
752
886
|
setSelectedKeys,
|
|
753
887
|
selectedKeys,
|
|
754
888
|
confirm
|
|
755
|
-
}) => /* @__PURE__ */
|
|
889
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd8.Radio.Group, {
|
|
756
890
|
style: { padding: 8 },
|
|
757
891
|
buttonStyle: "solid",
|
|
758
892
|
value: selectedKeys[0],
|
|
759
893
|
onChange: (e) => {
|
|
760
894
|
setSelectedKeys(e.target.value ? [e.target.value] : []);
|
|
761
895
|
confirm();
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
896
|
+
},
|
|
897
|
+
children: [
|
|
898
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Radio.Button, {
|
|
899
|
+
children: config.common.all
|
|
900
|
+
}),
|
|
901
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Radio.Button, {
|
|
902
|
+
value: "true",
|
|
903
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CheckOutlined, {
|
|
904
|
+
style: {
|
|
905
|
+
color: "#52c41a",
|
|
906
|
+
verticalAlign: "middle"
|
|
907
|
+
}
|
|
908
|
+
})
|
|
909
|
+
}),
|
|
910
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Radio.Button, {
|
|
911
|
+
value: "false",
|
|
912
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons3.CloseOutlined, {
|
|
913
|
+
style: {
|
|
914
|
+
verticalAlign: "middle",
|
|
915
|
+
color: "#ff4d4f"
|
|
916
|
+
}
|
|
917
|
+
})
|
|
918
|
+
}),
|
|
919
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Radio.Button, {
|
|
920
|
+
value: "empty",
|
|
921
|
+
children: config.common.blank
|
|
922
|
+
})
|
|
923
|
+
]
|
|
924
|
+
});
|
|
780
925
|
if (!item.onFilter)
|
|
781
926
|
item.onFilter = (value, row) => {
|
|
782
927
|
switch (value) {
|
|
@@ -813,14 +958,14 @@ function Table(props) {
|
|
|
813
958
|
if (!columns)
|
|
814
959
|
return null;
|
|
815
960
|
if (!props.faasData)
|
|
816
|
-
return /* @__PURE__ */
|
|
961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Table, {
|
|
817
962
|
...props,
|
|
818
963
|
rowKey: props.rowKey || "id",
|
|
819
964
|
columns,
|
|
820
965
|
dataSource: props.dataSource
|
|
821
966
|
});
|
|
822
|
-
return /* @__PURE__ */
|
|
823
|
-
fallback: props.faasData.fallback || /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react13.FaasDataWrapper, {
|
|
968
|
+
fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Skeleton, {
|
|
824
969
|
active: true
|
|
825
970
|
}),
|
|
826
971
|
render: ({
|
|
@@ -829,20 +974,20 @@ function Table(props) {
|
|
|
829
974
|
reload
|
|
830
975
|
}) => {
|
|
831
976
|
if (!data)
|
|
832
|
-
return /* @__PURE__ */
|
|
977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Table, {
|
|
833
978
|
...props,
|
|
834
979
|
rowKey: props.rowKey || "id",
|
|
835
980
|
columns,
|
|
836
981
|
dataSource: []
|
|
837
982
|
});
|
|
838
983
|
if (Array.isArray(data))
|
|
839
|
-
return /* @__PURE__ */
|
|
984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Table, {
|
|
840
985
|
...props,
|
|
841
986
|
rowKey: props.rowKey || "id",
|
|
842
987
|
columns,
|
|
843
988
|
dataSource: data
|
|
844
989
|
});
|
|
845
|
-
return /* @__PURE__ */
|
|
990
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd8.Table, {
|
|
846
991
|
...props,
|
|
847
992
|
rowKey: props.rowKey || "id",
|
|
848
993
|
columns,
|
|
@@ -877,6 +1022,7 @@ function Table(props) {
|
|
|
877
1022
|
|
|
878
1023
|
// src/Title.tsx
|
|
879
1024
|
var import_react14 = require("react");
|
|
1025
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
880
1026
|
function Title(props) {
|
|
881
1027
|
const config = useConfigContext();
|
|
882
1028
|
(0, import_react14.useEffect)(() => {
|
|
@@ -885,11 +1031,14 @@ function Title(props) {
|
|
|
885
1031
|
}, []);
|
|
886
1032
|
if (props.h1) {
|
|
887
1033
|
if (typeof props.h1 === "boolean")
|
|
888
|
-
return /* @__PURE__ */
|
|
889
|
-
|
|
1034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
|
|
1035
|
+
children: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1036
|
+
});
|
|
1037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
|
|
890
1038
|
className: props.h1.className,
|
|
891
|
-
style: props.h1.style
|
|
892
|
-
|
|
1039
|
+
style: props.h1.style,
|
|
1040
|
+
children: Array.isArray(props.title) ? props.title[0] : props.title
|
|
1041
|
+
});
|
|
893
1042
|
}
|
|
894
1043
|
if (props.children)
|
|
895
1044
|
return (0, import_react14.cloneElement)(props.children, { title: props.title });
|