@faasjs/ant-design 0.0.2-beta.394 → 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/dist/index.mjs CHANGED
@@ -1,23 +1,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
-
21
1
  // react-shim.js
22
2
  import React from "react";
23
3
 
@@ -27,6 +7,7 @@ import { isNil } from "lodash";
27
7
 
28
8
  // src/Config.tsx
29
9
  import { createContext, useContext } from "react";
10
+ import { jsx } from "react/jsx-runtime";
30
11
  var isZH = /^zh/i.test(navigator.language);
31
12
  var common = isZH ? {
32
13
  lang: "zh",
@@ -62,20 +43,26 @@ function ConfigProvider({
62
43
  config,
63
44
  children
64
45
  }) {
65
- return /* @__PURE__ */ React.createElement(ConfigContext.Provider, {
66
- value: __spreadValues(__spreadValues({}, baseConfig), config)
67
- }, children);
46
+ return /* @__PURE__ */ jsx(ConfigContext.Provider, {
47
+ value: {
48
+ ...baseConfig,
49
+ ...config
50
+ },
51
+ children
52
+ });
68
53
  }
69
54
  function useConfigContext() {
70
55
  return useContext(ConfigContext);
71
56
  }
72
57
 
73
58
  // src/Blank.tsx
59
+ import { jsx as jsx2 } from "react/jsx-runtime";
74
60
  function Blank(options) {
75
61
  const config = useConfigContext();
76
- return !options || isNil(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ React.createElement(Typography.Text, {
77
- disabled: true
78
- }, (options == null ? void 0 : options.text) || config.Blank.text) : options.value;
62
+ return !options || isNil(options.value) || Array.isArray(options.value) && !options.value.length || options.value === "" ? /* @__PURE__ */ jsx2(Typography.Text, {
63
+ disabled: true,
64
+ children: (options == null ? void 0 : options.text) || config.Blank.text
65
+ }) : options.value;
79
66
  }
80
67
 
81
68
  // src/Calendar.tsx
@@ -115,11 +102,12 @@ import {
115
102
  } from "react";
116
103
  import dayjs from "dayjs";
117
104
  import { FaasDataWrapper } from "@faasjs/react";
105
+ import { Fragment, jsx as jsx3 } from "react/jsx-runtime";
118
106
  function DescriptionItemContent(props) {
119
107
  const [computedProps, setComputedProps] = useState();
120
108
  useEffect(() => {
121
109
  var _a, _b;
122
- const propsCopy = __spreadValues({}, props);
110
+ const propsCopy = { ...props };
123
111
  if (!propsCopy.item.title)
124
112
  propsCopy.item.title = upperFirst2(propsCopy.item.id);
125
113
  if (!propsCopy.item.type)
@@ -146,89 +134,119 @@ function DescriptionItemContent(props) {
146
134
  return null;
147
135
  if (computedProps.extendTypes && computedProps.extendTypes[computedProps.item.type])
148
136
  if (computedProps.extendTypes[computedProps.item.type].children)
149
- return cloneElement(computedProps.extendTypes[computedProps.item.type].children, {
150
- value: computedProps.value,
151
- values: computedProps.values
152
- });
137
+ return cloneElement(
138
+ computedProps.extendTypes[computedProps.item.type].children,
139
+ {
140
+ value: computedProps.value,
141
+ values: computedProps.values
142
+ }
143
+ );
153
144
  else if (computedProps.extendTypes[computedProps.item.type].render)
154
- return /* @__PURE__ */ React.createElement(React.Fragment, null, computedProps.extendTypes[computedProps.item.type].render(computedProps.value, computedProps.values));
145
+ return /* @__PURE__ */ jsx3(Fragment, {
146
+ children: computedProps.extendTypes[computedProps.item.type].render(computedProps.value, computedProps.values)
147
+ });
155
148
  else
156
149
  throw Error(computedProps.item.type + " requires children or render");
157
150
  if (computedProps.item.children)
158
151
  return cloneElement(computedProps.item.children, { value: computedProps.value });
159
152
  if (computedProps.item.render)
160
- return /* @__PURE__ */ React.createElement(React.Fragment, null, computedProps.item.render(computedProps.value, computedProps.values));
153
+ return /* @__PURE__ */ jsx3(Fragment, {
154
+ children: computedProps.item.render(computedProps.value, computedProps.values)
155
+ });
161
156
  if (typeof computedProps.value === "undefined" || computedProps.value === null)
162
157
  return null;
163
158
  switch (computedProps.item.type) {
164
159
  case "string[]":
165
- return /* @__PURE__ */ React.createElement(React.Fragment, null, computedProps.value.join(", "));
160
+ return /* @__PURE__ */ jsx3(Fragment, {
161
+ children: computedProps.value.join(", ")
162
+ });
166
163
  case "number":
167
164
  return computedProps.value || null;
168
165
  case "number[]":
169
- return /* @__PURE__ */ React.createElement(React.Fragment, null, computedProps.value.join(", "));
166
+ return /* @__PURE__ */ jsx3(Fragment, {
167
+ children: computedProps.value.join(", ")
168
+ });
170
169
  case "boolean":
171
- return computedProps.value ? /* @__PURE__ */ React.createElement(CheckOutlined, {
170
+ return computedProps.value ? /* @__PURE__ */ jsx3(CheckOutlined, {
172
171
  style: {
173
172
  marginTop: "4px",
174
173
  color: "#52c41a"
175
174
  }
176
- }) : /* @__PURE__ */ React.createElement(CloseOutlined, {
175
+ }) : /* @__PURE__ */ jsx3(CloseOutlined, {
177
176
  style: {
178
177
  marginTop: "4px",
179
178
  color: "#ff4d4f"
180
179
  }
181
180
  });
182
181
  case "time":
183
- return /* @__PURE__ */ React.createElement(React.Fragment, null, typeof computedProps.value === "number" && computedProps.value.toString().length === 10 ? dayjs.unix(computedProps.value).format("YYYY-MM-DD HH:mm:ss") : dayjs(computedProps.value).format("YYYY-MM-DD HH:mm:ss"));
182
+ return /* @__PURE__ */ jsx3(Fragment, {
183
+ children: typeof computedProps.value === "number" && computedProps.value.toString().length === 10 ? dayjs.unix(computedProps.value).format("YYYY-MM-DD HH:mm:ss") : dayjs(computedProps.value).format("YYYY-MM-DD HH:mm:ss")
184
+ });
184
185
  case "date":
185
- return /* @__PURE__ */ React.createElement(React.Fragment, null, typeof computedProps.value === "number" && computedProps.value.toString().length === 10 ? dayjs.unix(computedProps.value).format("YYYY-MM-DD") : dayjs(computedProps.value).format("YYYY-MM-DD"));
186
+ return /* @__PURE__ */ jsx3(Fragment, {
187
+ children: typeof computedProps.value === "number" && computedProps.value.toString().length === 10 ? dayjs.unix(computedProps.value).format("YYYY-MM-DD") : dayjs(computedProps.value).format("YYYY-MM-DD")
188
+ });
186
189
  default:
187
190
  return computedProps.value || null;
188
191
  }
189
192
  }
190
193
  function Description(props) {
191
194
  if (!props.faasData)
192
- return /* @__PURE__ */ React.createElement(Descriptions, __spreadValues({}, props), props.items.map((item) => /* @__PURE__ */ React.createElement(Descriptions.Item, {
193
- key: item.id,
194
- label: item.title || upperFirst2(item.id)
195
- }, /* @__PURE__ */ React.createElement(DescriptionItemContent, {
196
- item,
197
- value: props.dataSource[item.id],
198
- values: props.dataSource,
199
- extendTypes: props.extendTypes
200
- }))));
201
- return /* @__PURE__ */ React.createElement(FaasDataWrapper, __spreadValues({
202
- fallback: props.faasData.fallback || /* @__PURE__ */ React.createElement(Skeleton, {
195
+ return /* @__PURE__ */ jsx3(Descriptions, {
196
+ ...props,
197
+ children: props.items.map((item) => /* @__PURE__ */ jsx3(Descriptions.Item, {
198
+ label: item.title || upperFirst2(item.id),
199
+ children: /* @__PURE__ */ jsx3(DescriptionItemContent, {
200
+ item,
201
+ value: props.dataSource[item.id],
202
+ values: props.dataSource,
203
+ extendTypes: props.extendTypes
204
+ })
205
+ }, item.id))
206
+ });
207
+ return /* @__PURE__ */ jsx3(FaasDataWrapper, {
208
+ fallback: props.faasData.fallback || /* @__PURE__ */ jsx3(Skeleton, {
203
209
  active: true
204
210
  }),
205
- render: ({ data }) => /* @__PURE__ */ React.createElement(Descriptions, __spreadValues({}, props), props.items.map((item) => /* @__PURE__ */ React.createElement(Descriptions.Item, {
206
- key: item.id,
207
- label: item.title || upperFirst2(item.id)
208
- }, /* @__PURE__ */ React.createElement(DescriptionItemContent, {
209
- item,
210
- value: data[item.id],
211
- values: data,
212
- extendTypes: props.extendTypes
213
- }))))
214
- }, props.faasData));
211
+ render: ({ data }) => /* @__PURE__ */ jsx3(Descriptions, {
212
+ ...props,
213
+ children: props.items.map((item) => /* @__PURE__ */ jsx3(Descriptions.Item, {
214
+ label: item.title || upperFirst2(item.id),
215
+ children: /* @__PURE__ */ jsx3(DescriptionItemContent, {
216
+ item,
217
+ value: data[item.id],
218
+ values: data,
219
+ extendTypes: props.extendTypes
220
+ })
221
+ }, item.id))
222
+ }),
223
+ ...props.faasData
224
+ });
215
225
  }
216
226
 
217
227
  // src/Drawer.tsx
218
228
  import { Drawer } from "antd";
219
229
  import { useState as useState2 } from "react";
230
+ import { jsx as jsx4 } from "react/jsx-runtime";
220
231
  function useDrawer(init) {
221
- const [props, setProps] = useState2(__spreadValues({
232
+ const [props, setProps] = useState2({
222
233
  visible: false,
223
- onClose: () => setProps((prev) => __spreadProps(__spreadValues({}, prev), {
234
+ onClose: () => setProps((prev) => ({
235
+ ...prev,
224
236
  visible: false
225
- }))
226
- }, init));
237
+ })),
238
+ ...init
239
+ });
227
240
  return {
228
- drawer: /* @__PURE__ */ React.createElement(Drawer, __spreadValues({}, props)),
241
+ drawer: /* @__PURE__ */ jsx4(Drawer, {
242
+ ...props
243
+ }),
229
244
  drawerProps: props,
230
245
  setDrawerProps(changes) {
231
- setProps((prev) => __spreadValues(__spreadValues({}, prev), changes));
246
+ setProps((prev) => ({
247
+ ...prev,
248
+ ...changes
249
+ }));
232
250
  }
233
251
  };
234
252
  }
@@ -261,16 +279,19 @@ import { upperFirst as upperFirst3 } from "lodash";
261
279
 
262
280
  // src/TimePicker.tsx
263
281
  import { forwardRef } from "react";
282
+ import { jsx as jsx5 } from "react/jsx-runtime";
264
283
  var TimePicker = forwardRef((props, ref) => {
265
- return /* @__PURE__ */ React.createElement(DatePicker, __spreadProps(__spreadValues({}, props), {
284
+ return /* @__PURE__ */ jsx5(DatePicker, {
285
+ ...props,
266
286
  picker: "time",
267
287
  mode: void 0,
268
288
  ref
269
- }));
289
+ });
270
290
  });
271
291
  TimePicker.displayName = "TimePicker";
272
292
 
273
293
  // src/FormItem.tsx
294
+ import { Fragment as Fragment2, jsx as jsx6, jsxs } from "react/jsx-runtime";
274
295
  function processProps(propsCopy, config) {
275
296
  if (!propsCopy.title)
276
297
  propsCopy.title = upperFirst3(propsCopy.id);
@@ -322,159 +343,289 @@ function FormItem(props) {
322
343
  const [computedProps, setComputedProps] = useState3();
323
344
  const config = useConfigContext();
324
345
  useEffect2(() => {
325
- setComputedProps(processProps(__spreadValues({}, props), config));
346
+ setComputedProps(processProps({ ...props }, config));
326
347
  }, [props]);
327
348
  if (!computedProps)
328
349
  return null;
329
350
  if (computedProps.extendTypes && computedProps.extendTypes[computedProps.type])
330
- return /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadValues({}, computedProps), computedProps.extendTypes[computedProps.type].children);
351
+ return /* @__PURE__ */ jsx6(AntdForm.Item, {
352
+ ...computedProps,
353
+ children: computedProps.extendTypes[computedProps.type].children
354
+ });
331
355
  if (computedProps.children)
332
- return /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadValues({}, computedProps), computedProps.children);
356
+ return /* @__PURE__ */ jsx6(AntdForm.Item, {
357
+ ...computedProps,
358
+ children: computedProps.children
359
+ });
333
360
  if (computedProps.render)
334
- return /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadValues({}, computedProps), computedProps.render());
361
+ return /* @__PURE__ */ jsx6(AntdForm.Item, {
362
+ ...computedProps,
363
+ children: computedProps.render()
364
+ });
335
365
  switch (computedProps.type) {
336
366
  case "string":
337
- return /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadValues({}, computedProps), computedProps.options ? /* @__PURE__ */ React.createElement(Select, __spreadValues({}, computedProps.input)) : /* @__PURE__ */ React.createElement(Input, __spreadValues({}, computedProps.input)));
367
+ return /* @__PURE__ */ jsx6(AntdForm.Item, {
368
+ ...computedProps,
369
+ children: computedProps.options ? /* @__PURE__ */ jsx6(Select, {
370
+ ...computedProps.input
371
+ }) : /* @__PURE__ */ jsx6(Input, {
372
+ ...computedProps.input
373
+ })
374
+ });
338
375
  case "string[]":
339
376
  if (computedProps.options)
340
- return /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadValues({}, computedProps), /* @__PURE__ */ React.createElement(Select, __spreadValues({
341
- mode: "multiple"
342
- }, computedProps.input)));
343
- return /* @__PURE__ */ React.createElement(AntdForm.List, {
377
+ return /* @__PURE__ */ jsx6(AntdForm.Item, {
378
+ ...computedProps,
379
+ children: /* @__PURE__ */ jsx6(Select, {
380
+ mode: "multiple",
381
+ ...computedProps.input
382
+ })
383
+ });
384
+ return /* @__PURE__ */ jsx6(AntdForm.List, {
344
385
  name: computedProps.name,
345
- rules: computedProps.rules
346
- }, (fields, { add, remove }, { errors }) => {
347
- var _a2;
348
- return /* @__PURE__ */ React.createElement(React.Fragment, null, computedProps.label && /* @__PURE__ */ React.createElement("div", {
349
- className: "ant-form-item-label"
350
- }, /* @__PURE__ */ React.createElement("label", {
351
- className: computedProps.rules.find((r) => r.required) && "ant-form-item-required"
352
- }, computedProps.label)), fields.map((field) => {
353
- var _a3;
354
- return /* @__PURE__ */ React.createElement(AntdForm.Item, {
355
- key: field.key
356
- }, /* @__PURE__ */ React.createElement(Row, {
357
- gutter: 24,
358
- style: { flexFlow: "row nowrap" }
359
- }, /* @__PURE__ */ React.createElement(Col, {
360
- span: 23
361
- }, /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadProps(__spreadValues({}, field), {
362
- noStyle: true
363
- }), /* @__PURE__ */ React.createElement(Input, __spreadValues({}, computedProps.input)))), /* @__PURE__ */ React.createElement(Col, {
364
- span: 1
365
- }, !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ React.createElement(Button, {
366
- danger: true,
367
- type: "link",
368
- style: { float: "right" },
369
- icon: /* @__PURE__ */ React.createElement(MinusCircleOutlined, null),
370
- onClick: () => remove(field.name)
371
- }))));
372
- }), /* @__PURE__ */ React.createElement(AntdForm.Item, null, !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ React.createElement(Button, {
373
- type: "dashed",
374
- block: true,
375
- onClick: () => add(),
376
- icon: /* @__PURE__ */ React.createElement(PlusOutlined, null)
377
- }), /* @__PURE__ */ React.createElement(AntdForm.ErrorList, {
378
- errors
379
- })));
386
+ rules: computedProps.rules,
387
+ children: (fields, { add, remove }, { errors }) => {
388
+ var _a2;
389
+ return /* @__PURE__ */ jsxs(Fragment2, {
390
+ children: [
391
+ computedProps.label && /* @__PURE__ */ jsx6("div", {
392
+ className: "ant-form-item-label",
393
+ children: /* @__PURE__ */ jsx6("label", {
394
+ className: computedProps.rules.find((r) => r.required) && "ant-form-item-required",
395
+ children: computedProps.label
396
+ })
397
+ }),
398
+ fields.map((field) => {
399
+ var _a3;
400
+ return /* @__PURE__ */ jsx6(AntdForm.Item, {
401
+ children: /* @__PURE__ */ jsxs(Row, {
402
+ gutter: 24,
403
+ style: { flexFlow: "row nowrap" },
404
+ children: [
405
+ /* @__PURE__ */ jsx6(Col, {
406
+ span: 23,
407
+ children: /* @__PURE__ */ jsx6(AntdForm.Item, {
408
+ ...field,
409
+ noStyle: true,
410
+ children: /* @__PURE__ */ jsx6(Input, {
411
+ ...computedProps.input
412
+ })
413
+ })
414
+ }),
415
+ /* @__PURE__ */ jsx6(Col, {
416
+ span: 1,
417
+ children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx6(Button, {
418
+ danger: true,
419
+ type: "link",
420
+ style: { float: "right" },
421
+ icon: /* @__PURE__ */ jsx6(MinusCircleOutlined, {}),
422
+ onClick: () => remove(field.name)
423
+ })
424
+ })
425
+ ]
426
+ })
427
+ }, field.key);
428
+ }),
429
+ /* @__PURE__ */ jsxs(AntdForm.Item, {
430
+ children: [
431
+ !((_a2 = computedProps.input) == null ? void 0 : _a2.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx6(Button, {
432
+ type: "dashed",
433
+ block: true,
434
+ onClick: () => add(),
435
+ icon: /* @__PURE__ */ jsx6(PlusOutlined, {})
436
+ }),
437
+ /* @__PURE__ */ jsx6(AntdForm.ErrorList, {
438
+ errors
439
+ })
440
+ ]
441
+ })
442
+ ]
443
+ });
444
+ }
380
445
  });
381
446
  case "number":
382
- return /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadValues({}, computedProps), computedProps.options ? /* @__PURE__ */ React.createElement(Select, __spreadValues({}, computedProps.input)) : /* @__PURE__ */ React.createElement(InputNumber, __spreadValues({
383
- style: { width: "100%" }
384
- }, computedProps.input)));
447
+ return /* @__PURE__ */ jsx6(AntdForm.Item, {
448
+ ...computedProps,
449
+ children: computedProps.options ? /* @__PURE__ */ jsx6(Select, {
450
+ ...computedProps.input
451
+ }) : /* @__PURE__ */ jsx6(InputNumber, {
452
+ style: { width: "100%" },
453
+ ...computedProps.input
454
+ })
455
+ });
385
456
  case "number[]":
386
457
  if (computedProps.options)
387
- return /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadValues({}, computedProps), /* @__PURE__ */ React.createElement(Select, __spreadValues({
388
- mode: "multiple"
389
- }, computedProps.input)));
390
- return /* @__PURE__ */ React.createElement(AntdForm.List, {
458
+ return /* @__PURE__ */ jsx6(AntdForm.Item, {
459
+ ...computedProps,
460
+ children: /* @__PURE__ */ jsx6(Select, {
461
+ mode: "multiple",
462
+ ...computedProps.input
463
+ })
464
+ });
465
+ return /* @__PURE__ */ jsx6(AntdForm.List, {
391
466
  name: computedProps.name,
392
- rules: computedProps.rules
393
- }, (fields, { add, remove }, { errors }) => {
394
- var _a2, _b;
395
- return /* @__PURE__ */ React.createElement(React.Fragment, null, computedProps.label && /* @__PURE__ */ React.createElement("div", {
396
- className: "ant-form-item-label"
397
- }, /* @__PURE__ */ React.createElement("label", {
398
- className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required"
399
- }, computedProps.label)), fields.map((field) => {
400
- var _a3;
401
- return /* @__PURE__ */ React.createElement(AntdForm.Item, {
402
- key: field.key
403
- }, /* @__PURE__ */ React.createElement(Row, {
404
- gutter: 24,
405
- style: { flexFlow: "row nowrap" }
406
- }, /* @__PURE__ */ React.createElement(Col, {
407
- span: 23
408
- }, /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadProps(__spreadValues({}, field), {
409
- noStyle: true
410
- }), /* @__PURE__ */ React.createElement(InputNumber, __spreadValues({
411
- style: { width: "100%" }
412
- }, computedProps.input)))), /* @__PURE__ */ React.createElement(Col, {
413
- span: 1
414
- }, !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ React.createElement(Button, {
415
- danger: true,
416
- type: "link",
417
- style: { float: "right" },
418
- icon: /* @__PURE__ */ React.createElement(MinusCircleOutlined, null),
419
- onClick: () => remove(field.name)
420
- }))));
421
- }), /* @__PURE__ */ React.createElement(AntdForm.Item, null, !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ React.createElement(Button, {
422
- type: "dashed",
423
- block: true,
424
- onClick: () => add(),
425
- icon: /* @__PURE__ */ React.createElement(PlusOutlined, null)
426
- }), /* @__PURE__ */ React.createElement(AntdForm.ErrorList, {
427
- errors
428
- })));
467
+ rules: computedProps.rules,
468
+ children: (fields, { add, remove }, { errors }) => {
469
+ var _a2, _b;
470
+ return /* @__PURE__ */ jsxs(Fragment2, {
471
+ children: [
472
+ computedProps.label && /* @__PURE__ */ jsx6("div", {
473
+ className: "ant-form-item-label",
474
+ children: /* @__PURE__ */ jsx6("label", {
475
+ className: ((_a2 = computedProps.rules) == null ? void 0 : _a2.find((r) => r.required)) && "ant-form-item-required",
476
+ children: computedProps.label
477
+ })
478
+ }),
479
+ fields.map((field) => {
480
+ var _a3;
481
+ return /* @__PURE__ */ jsx6(AntdForm.Item, {
482
+ children: /* @__PURE__ */ jsxs(Row, {
483
+ gutter: 24,
484
+ style: { flexFlow: "row nowrap" },
485
+ children: [
486
+ /* @__PURE__ */ jsx6(Col, {
487
+ span: 23,
488
+ children: /* @__PURE__ */ jsx6(AntdForm.Item, {
489
+ ...field,
490
+ noStyle: true,
491
+ children: /* @__PURE__ */ jsx6(InputNumber, {
492
+ style: { width: "100%" },
493
+ ...computedProps.input
494
+ })
495
+ })
496
+ }),
497
+ /* @__PURE__ */ jsx6(Col, {
498
+ span: 1,
499
+ children: !((_a3 = computedProps.input) == null ? void 0 : _a3.disabled) && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx6(Button, {
500
+ danger: true,
501
+ type: "link",
502
+ style: { float: "right" },
503
+ icon: /* @__PURE__ */ jsx6(MinusCircleOutlined, {}),
504
+ onClick: () => remove(field.name)
505
+ })
506
+ })
507
+ ]
508
+ })
509
+ }, field.key);
510
+ }),
511
+ /* @__PURE__ */ jsxs(AntdForm.Item, {
512
+ children: [
513
+ !((_b = computedProps.input) == null ? void 0 : _b.disabled) && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsx6(Button, {
514
+ type: "dashed",
515
+ block: true,
516
+ onClick: () => add(),
517
+ icon: /* @__PURE__ */ jsx6(PlusOutlined, {})
518
+ }),
519
+ /* @__PURE__ */ jsx6(AntdForm.ErrorList, {
520
+ errors
521
+ })
522
+ ]
523
+ })
524
+ ]
525
+ });
526
+ }
429
527
  });
430
528
  case "boolean":
431
- return /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadValues({}, computedProps), /* @__PURE__ */ React.createElement(Switch, __spreadValues({}, computedProps.input)));
529
+ return /* @__PURE__ */ jsx6(AntdForm.Item, {
530
+ ...computedProps,
531
+ children: /* @__PURE__ */ jsx6(Switch, {
532
+ ...computedProps.input
533
+ })
534
+ });
432
535
  case "date":
433
- return /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadValues({}, computedProps), /* @__PURE__ */ React.createElement(DatePicker, __spreadValues({}, computedProps.input)));
536
+ return /* @__PURE__ */ jsx6(AntdForm.Item, {
537
+ ...computedProps,
538
+ children: /* @__PURE__ */ jsx6(DatePicker, {
539
+ ...computedProps.input
540
+ })
541
+ });
434
542
  case "time":
435
- return /* @__PURE__ */ React.createElement(AntdForm.Item, __spreadValues({}, computedProps), /* @__PURE__ */ React.createElement(TimePicker, __spreadValues({}, computedProps.input)));
543
+ return /* @__PURE__ */ jsx6(AntdForm.Item, {
544
+ ...computedProps,
545
+ children: /* @__PURE__ */ jsx6(TimePicker, {
546
+ ...computedProps.input
547
+ })
548
+ });
436
549
  case "object":
437
- return /* @__PURE__ */ React.createElement(React.Fragment, null, computedProps.label && /* @__PURE__ */ React.createElement("div", {
438
- className: "ant-form-item-label"
439
- }, /* @__PURE__ */ React.createElement("label", {
440
- className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required"
441
- }, computedProps.label)), computedProps.object.map((o) => /* @__PURE__ */ React.createElement(FormItem, __spreadValues({
442
- key: o.id
443
- }, o))));
550
+ return /* @__PURE__ */ jsxs(Fragment2, {
551
+ children: [
552
+ computedProps.label && /* @__PURE__ */ jsx6("div", {
553
+ className: "ant-form-item-label",
554
+ children: /* @__PURE__ */ jsx6("label", {
555
+ className: ((_a = computedProps.rules) == null ? void 0 : _a.find((r) => r.required)) && "ant-form-item-required",
556
+ children: computedProps.label
557
+ })
558
+ }),
559
+ computedProps.object.map((o) => /* @__PURE__ */ jsx6(FormItem, {
560
+ ...o
561
+ }, o.id))
562
+ ]
563
+ });
444
564
  case "object[]":
445
- return /* @__PURE__ */ React.createElement(AntdForm.List, {
565
+ return /* @__PURE__ */ jsx6(AntdForm.List, {
446
566
  name: computedProps.name,
447
- rules: computedProps.rules
448
- }, (fields, { add, remove }, { errors }) => /* @__PURE__ */ React.createElement(React.Fragment, null, fields.map((field) => /* @__PURE__ */ React.createElement(AntdForm.Item, {
449
- key: field.key,
450
- style: { marginBottom: 0 }
451
- }, /* @__PURE__ */ React.createElement("div", {
452
- className: "ant-form-item-label"
453
- }, /* @__PURE__ */ React.createElement("label", null, computedProps.label, " ", field.name + 1, !computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ React.createElement(Button, {
454
- danger: true,
455
- type: "link",
456
- onClick: () => remove(field.name)
457
- }, config.common.delete))), /* @__PURE__ */ React.createElement(Row, {
458
- gutter: 24
459
- }, computedProps.object.map((o) => /* @__PURE__ */ React.createElement(Col, {
460
- key: o.id,
461
- span: o.col || 6
462
- }, /* @__PURE__ */ React.createElement(FormItem, __spreadProps(__spreadValues({}, o), {
463
- name: [field.name, o.id]
464
- }))))))), /* @__PURE__ */ React.createElement(AntdForm.Item, null, !computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ React.createElement(Button, {
465
- type: "dashed",
466
- block: true,
467
- onClick: () => add(),
468
- icon: /* @__PURE__ */ React.createElement(PlusOutlined, null)
469
- }, config.common.add, " ", computedProps.label), /* @__PURE__ */ React.createElement(AntdForm.ErrorList, {
470
- errors
471
- }))));
567
+ rules: computedProps.rules,
568
+ children: (fields, { add, remove }, { errors }) => /* @__PURE__ */ jsxs(Fragment2, {
569
+ children: [
570
+ fields.map((field) => /* @__PURE__ */ jsxs(AntdForm.Item, {
571
+ style: { marginBottom: 0 },
572
+ children: [
573
+ /* @__PURE__ */ jsx6("div", {
574
+ className: "ant-form-item-label",
575
+ children: /* @__PURE__ */ jsxs("label", {
576
+ children: [
577
+ computedProps.label,
578
+ " ",
579
+ field.name + 1,
580
+ !computedProps.disabled && (!computedProps.rules.find((r) => r.required) || field.key > 0) && /* @__PURE__ */ jsx6(Button, {
581
+ danger: true,
582
+ type: "link",
583
+ onClick: () => remove(field.name),
584
+ children: config.common.delete
585
+ })
586
+ ]
587
+ })
588
+ }),
589
+ /* @__PURE__ */ jsx6(Row, {
590
+ gutter: 24,
591
+ children: computedProps.object.map((o) => /* @__PURE__ */ jsx6(Col, {
592
+ span: o.col || 6,
593
+ children: /* @__PURE__ */ jsx6(FormItem, {
594
+ ...o,
595
+ name: [field.name, o.id]
596
+ })
597
+ }, o.id))
598
+ })
599
+ ]
600
+ }, field.key)),
601
+ /* @__PURE__ */ jsxs(AntdForm.Item, {
602
+ children: [
603
+ !computedProps.disabled && (!computedProps.maxCount || computedProps.maxCount > fields.length) && /* @__PURE__ */ jsxs(Button, {
604
+ type: "dashed",
605
+ block: true,
606
+ onClick: () => add(),
607
+ icon: /* @__PURE__ */ jsx6(PlusOutlined, {}),
608
+ children: [
609
+ config.common.add,
610
+ " ",
611
+ computedProps.label
612
+ ]
613
+ }),
614
+ /* @__PURE__ */ jsx6(AntdForm.ErrorList, {
615
+ errors
616
+ })
617
+ ]
618
+ })
619
+ ]
620
+ })
621
+ });
472
622
  default:
473
623
  return null;
474
624
  }
475
625
  }
476
626
 
477
627
  // src/Form.tsx
628
+ import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
478
629
  function Form(props) {
479
630
  var _a, _b;
480
631
  const [loading, setLoading] = useState4(false);
@@ -482,14 +633,17 @@ function Form(props) {
482
633
  const config = useConfigContext();
483
634
  useEffect3(() => {
484
635
  var _a2;
485
- const propsCopy = __spreadValues({}, props);
636
+ const propsCopy = { ...props };
486
637
  if (propsCopy.onFinish) {
487
638
  propsCopy.onFinish = async (values) => {
488
639
  var _a3;
489
640
  setLoading(true);
490
641
  try {
491
642
  if (propsCopy.submit && ((_a3 = propsCopy.submit.to) == null ? void 0 : _a3.action)) {
492
- await props.onFinish(values, async (values2) => faas(propsCopy.submit.to.action, propsCopy.submit.to.params ? __spreadValues(__spreadValues({}, values2), propsCopy.submit.to.params) : values2));
643
+ await props.onFinish(values, async (values2) => faas(propsCopy.submit.to.action, propsCopy.submit.to.params ? {
644
+ ...values2,
645
+ ...propsCopy.submit.to.params
646
+ } : values2));
493
647
  } else
494
648
  await props.onFinish(values);
495
649
  } catch (error) {
@@ -499,22 +653,34 @@ function Form(props) {
499
653
  };
500
654
  } else if (propsCopy.submit && ((_a2 = propsCopy.submit.to) == null ? void 0 : _a2.action)) {
501
655
  propsCopy.onFinish = async (values) => {
502
- return await faas(propsCopy.submit.to.action, propsCopy.submit.to.params ? __spreadValues(__spreadValues({}, values), propsCopy.submit.to.params) : values);
656
+ return await faas(propsCopy.submit.to.action, propsCopy.submit.to.params ? {
657
+ ...values,
658
+ ...propsCopy.submit.to.params
659
+ } : values);
503
660
  };
504
661
  }
505
662
  setComputedProps(propsCopy);
506
663
  }, []);
507
664
  if (!computedProps)
508
665
  return null;
509
- return /* @__PURE__ */ React.createElement(AntdForm2, __spreadValues({}, computedProps), computedProps.beforeItems, (_a = computedProps.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ React.createElement(FormItem, __spreadProps(__spreadValues({
510
- key: item.id
511
- }, item), {
512
- extendTypes: computedProps.extendTypes
513
- }))), computedProps.children, computedProps.submit !== false && /* @__PURE__ */ React.createElement(Button2, {
514
- htmlType: "submit",
515
- type: "primary",
516
- loading
517
- }, ((_b = computedProps.submit) == null ? void 0 : _b.text) || config.Form.submit.text), computedProps.footer);
666
+ return /* @__PURE__ */ jsxs2(AntdForm2, {
667
+ ...computedProps,
668
+ children: [
669
+ computedProps.beforeItems,
670
+ (_a = computedProps.items) == null ? void 0 : _a.map((item) => /* @__PURE__ */ jsx7(FormItem, {
671
+ ...item,
672
+ extendTypes: computedProps.extendTypes
673
+ }, item.id)),
674
+ computedProps.children,
675
+ computedProps.submit !== false && /* @__PURE__ */ jsx7(Button2, {
676
+ htmlType: "submit",
677
+ type: "primary",
678
+ loading,
679
+ children: ((_b = computedProps.submit) == null ? void 0 : _b.text) || config.Form.submit.text
680
+ }),
681
+ computedProps.footer
682
+ ]
683
+ });
518
684
  }
519
685
  Form.useForm = AntdForm2.useForm;
520
686
  Form.Item = FormItem;
@@ -522,18 +688,26 @@ Form.Item = FormItem;
522
688
  // src/Modal.tsx
523
689
  import { Modal } from "antd";
524
690
  import { useState as useState5 } from "react";
691
+ import { jsx as jsx8 } from "react/jsx-runtime";
525
692
  function useModal(init) {
526
- const [props, setProps] = useState5(__spreadValues({
693
+ const [props, setProps] = useState5({
527
694
  visible: false,
528
- onCancel: () => setProps((prev) => __spreadProps(__spreadValues({}, prev), {
695
+ onCancel: () => setProps((prev) => ({
696
+ ...prev,
529
697
  visible: false
530
- }))
531
- }, init));
698
+ })),
699
+ ...init
700
+ });
532
701
  return {
533
- modal: /* @__PURE__ */ React.createElement(Modal, __spreadValues({}, props)),
702
+ modal: /* @__PURE__ */ jsx8(Modal, {
703
+ ...props
704
+ }),
534
705
  modalProps: props,
535
706
  setModalProps(changes) {
536
- setProps((prev) => __spreadValues(__spreadValues({}, prev), changes));
707
+ setProps((prev) => ({
708
+ ...prev,
709
+ ...changes
710
+ }));
537
711
  }
538
712
  };
539
713
  }
@@ -547,29 +721,35 @@ import {
547
721
  Routes as OriginRoutes,
548
722
  Route
549
723
  } from "react-router-dom";
724
+ import { jsx as jsx9, jsxs as jsxs3 } from "react/jsx-runtime";
550
725
  function NotFound() {
551
726
  const config = useConfigContext();
552
- return /* @__PURE__ */ React.createElement(Result, {
727
+ return /* @__PURE__ */ jsx9(Result, {
553
728
  status: "404",
554
729
  title: config.common.pageNotFound
555
730
  });
556
731
  }
557
732
  function Routes(props) {
558
- return /* @__PURE__ */ React.createElement(OriginRoutes, null, props.routes.map((r) => /* @__PURE__ */ React.createElement(Route, __spreadProps(__spreadValues({
559
- key: r.path
560
- }, r), {
561
- element: r.element || /* @__PURE__ */ React.createElement(Suspense, {
562
- fallback: props.fallback || /* @__PURE__ */ React.createElement("div", {
563
- style: { padding: "24px" }
564
- }, /* @__PURE__ */ React.createElement(Skeleton2, {
565
- active: true
566
- }))
567
- }, /* @__PURE__ */ React.createElement(r.page, null))
568
- }))), /* @__PURE__ */ React.createElement(Route, {
569
- key: "*",
570
- path: "*",
571
- element: props.notFound || /* @__PURE__ */ React.createElement(NotFound, null)
572
- }));
733
+ return /* @__PURE__ */ jsxs3(OriginRoutes, {
734
+ children: [
735
+ props.routes.map((r) => /* @__PURE__ */ jsx9(Route, {
736
+ ...r,
737
+ element: r.element || /* @__PURE__ */ jsx9(Suspense, {
738
+ fallback: props.fallback || /* @__PURE__ */ jsx9("div", {
739
+ style: { padding: "24px" },
740
+ children: /* @__PURE__ */ jsx9(Skeleton2, {
741
+ active: true
742
+ })
743
+ }),
744
+ children: /* @__PURE__ */ jsx9(r.page, {})
745
+ })
746
+ }, r.path)),
747
+ /* @__PURE__ */ jsx9(Route, {
748
+ path: "*",
749
+ element: props.notFound || /* @__PURE__ */ jsx9(NotFound, {})
750
+ }, "*")
751
+ ]
752
+ });
573
753
  }
574
754
 
575
755
  // src/Table.tsx
@@ -587,6 +767,7 @@ import dayjs2 from "dayjs";
587
767
  import { CheckOutlined as CheckOutlined2, CloseOutlined as CloseOutlined2 } from "@ant-design/icons";
588
768
  import { isNil as isNil2, upperFirst as upperFirst4 } from "lodash";
589
769
  import { FaasDataWrapper as FaasDataWrapper2 } from "@faasjs/react";
770
+ import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
590
771
  function processValue(item, value) {
591
772
  var _a;
592
773
  if (typeof value !== "undefined" && value !== null) {
@@ -643,10 +824,13 @@ function Table(props) {
643
824
  delete item.children;
644
825
  if (props.extendTypes && props.extendTypes[item.type]) {
645
826
  if (props.extendTypes[item.type].children) {
646
- item.render = (value, values) => cloneElement2(props.extendTypes[item.type].children, {
647
- value,
648
- values
649
- });
827
+ item.render = (value, values) => cloneElement2(
828
+ props.extendTypes[item.type].children,
829
+ {
830
+ value,
831
+ values
832
+ }
833
+ );
650
834
  } else if (props.extendTypes[item.type].render)
651
835
  item.render = props.extendTypes[item.type].render;
652
836
  else
@@ -672,12 +856,12 @@ function Table(props) {
672
856
  item.onFilter = (value, row) => row[item.id].includes(value);
673
857
  break;
674
858
  case "boolean":
675
- item.render = (value) => typeof value === "undefined" ? /* @__PURE__ */ React.createElement(Blank, null) : value ? /* @__PURE__ */ React.createElement(CheckOutlined2, {
859
+ item.render = (value) => typeof value === "undefined" ? /* @__PURE__ */ jsx10(Blank, {}) : value ? /* @__PURE__ */ jsx10(CheckOutlined2, {
676
860
  style: {
677
861
  marginTop: "4px",
678
862
  color: "#52c41a"
679
863
  }
680
- }) : /* @__PURE__ */ React.createElement(CloseOutlined2, {
864
+ }) : /* @__PURE__ */ jsx10(CloseOutlined2, {
681
865
  style: {
682
866
  marginTop: "4px",
683
867
  color: "#ff4d4f"
@@ -688,31 +872,42 @@ function Table(props) {
688
872
  setSelectedKeys,
689
873
  selectedKeys,
690
874
  confirm
691
- }) => /* @__PURE__ */ React.createElement(Radio.Group, {
875
+ }) => /* @__PURE__ */ jsxs4(Radio.Group, {
692
876
  style: { padding: 8 },
693
877
  buttonStyle: "solid",
694
878
  value: selectedKeys[0],
695
879
  onChange: (e) => {
696
880
  setSelectedKeys(e.target.value ? [e.target.value] : []);
697
881
  confirm();
698
- }
699
- }, /* @__PURE__ */ React.createElement(Radio.Button, null, config.common.all), /* @__PURE__ */ React.createElement(Radio.Button, {
700
- value: "true"
701
- }, /* @__PURE__ */ React.createElement(CheckOutlined2, {
702
- style: {
703
- color: "#52c41a",
704
- verticalAlign: "middle"
705
- }
706
- })), /* @__PURE__ */ React.createElement(Radio.Button, {
707
- value: "false"
708
- }, /* @__PURE__ */ React.createElement(CloseOutlined2, {
709
- style: {
710
- verticalAlign: "middle",
711
- color: "#ff4d4f"
712
- }
713
- })), /* @__PURE__ */ React.createElement(Radio.Button, {
714
- value: "empty"
715
- }, config.common.blank));
882
+ },
883
+ children: [
884
+ /* @__PURE__ */ jsx10(Radio.Button, {
885
+ children: config.common.all
886
+ }),
887
+ /* @__PURE__ */ jsx10(Radio.Button, {
888
+ value: "true",
889
+ children: /* @__PURE__ */ jsx10(CheckOutlined2, {
890
+ style: {
891
+ color: "#52c41a",
892
+ verticalAlign: "middle"
893
+ }
894
+ })
895
+ }),
896
+ /* @__PURE__ */ jsx10(Radio.Button, {
897
+ value: "false",
898
+ children: /* @__PURE__ */ jsx10(CloseOutlined2, {
899
+ style: {
900
+ verticalAlign: "middle",
901
+ color: "#ff4d4f"
902
+ }
903
+ })
904
+ }),
905
+ /* @__PURE__ */ jsx10(Radio.Button, {
906
+ value: "empty",
907
+ children: config.common.blank
908
+ })
909
+ ]
910
+ });
716
911
  if (!item.onFilter)
717
912
  item.onFilter = (value, row) => {
718
913
  switch (value) {
@@ -749,13 +944,14 @@ function Table(props) {
749
944
  if (!columns)
750
945
  return null;
751
946
  if (!props.faasData)
752
- return /* @__PURE__ */ React.createElement(AntdTable, __spreadProps(__spreadValues({}, props), {
947
+ return /* @__PURE__ */ jsx10(AntdTable, {
948
+ ...props,
753
949
  rowKey: props.rowKey || "id",
754
950
  columns,
755
951
  dataSource: props.dataSource
756
- }));
757
- return /* @__PURE__ */ React.createElement(FaasDataWrapper2, __spreadValues({
758
- fallback: props.faasData.fallback || /* @__PURE__ */ React.createElement(Skeleton3, {
952
+ });
953
+ return /* @__PURE__ */ jsx10(FaasDataWrapper2, {
954
+ fallback: props.faasData.fallback || /* @__PURE__ */ jsx10(Skeleton3, {
759
955
  active: true
760
956
  }),
761
957
  render: ({
@@ -764,45 +960,55 @@ function Table(props) {
764
960
  reload
765
961
  }) => {
766
962
  if (!data)
767
- return /* @__PURE__ */ React.createElement(AntdTable, __spreadProps(__spreadValues({}, props), {
963
+ return /* @__PURE__ */ jsx10(AntdTable, {
964
+ ...props,
768
965
  rowKey: props.rowKey || "id",
769
966
  columns,
770
967
  dataSource: []
771
- }));
968
+ });
772
969
  if (Array.isArray(data))
773
- return /* @__PURE__ */ React.createElement(AntdTable, __spreadProps(__spreadValues({}, props), {
970
+ return /* @__PURE__ */ jsx10(AntdTable, {
971
+ ...props,
774
972
  rowKey: props.rowKey || "id",
775
973
  columns,
776
974
  dataSource: data
777
- }));
778
- return /* @__PURE__ */ React.createElement(AntdTable, __spreadProps(__spreadValues({}, props), {
975
+ });
976
+ return /* @__PURE__ */ jsx10(AntdTable, {
977
+ ...props,
779
978
  rowKey: props.rowKey || "id",
780
979
  columns,
781
980
  dataSource: data.rows,
782
- pagination: __spreadValues(__spreadValues({}, props.pagination), data.pagination),
981
+ pagination: {
982
+ ...props.pagination,
983
+ ...data.pagination
984
+ },
783
985
  onChange: (pagination, filters, sorter, extra) => {
784
986
  if (props.onChange) {
785
987
  const processed = props.onChange(pagination, filters, sorter, extra);
786
- reload(__spreadProps(__spreadValues({}, params), {
988
+ reload({
989
+ ...params,
787
990
  pagination: processed.pagination,
788
991
  filters: processed.filters,
789
992
  sorter: processed.sorter
790
- }));
993
+ });
791
994
  return;
792
995
  }
793
- reload(__spreadProps(__spreadValues({}, params), {
996
+ reload({
997
+ ...params,
794
998
  pagination,
795
999
  filters,
796
1000
  sorter
797
- }));
1001
+ });
798
1002
  }
799
- }));
800
- }
801
- }, props.faasData));
1003
+ });
1004
+ },
1005
+ ...props.faasData
1006
+ });
802
1007
  }
803
1008
 
804
1009
  // src/Title.tsx
805
1010
  import { useEffect as useEffect5, cloneElement as cloneElement3 } from "react";
1011
+ import { jsx as jsx11 } from "react/jsx-runtime";
806
1012
  function Title(props) {
807
1013
  const config = useConfigContext();
808
1014
  useEffect5(() => {
@@ -811,11 +1017,14 @@ function Title(props) {
811
1017
  }, []);
812
1018
  if (props.h1) {
813
1019
  if (typeof props.h1 === "boolean")
814
- return /* @__PURE__ */ React.createElement("h1", null, Array.isArray(props.title) ? props.title[0] : props.title);
815
- return /* @__PURE__ */ React.createElement("h1", {
1020
+ return /* @__PURE__ */ jsx11("h1", {
1021
+ children: Array.isArray(props.title) ? props.title[0] : props.title
1022
+ });
1023
+ return /* @__PURE__ */ jsx11("h1", {
816
1024
  className: props.h1.className,
817
- style: props.h1.style
818
- }, Array.isArray(props.title) ? props.title[0] : props.title);
1025
+ style: props.h1.style,
1026
+ children: Array.isArray(props.title) ? props.title[0] : props.title
1027
+ });
819
1028
  }
820
1029
  if (props.children)
821
1030
  return cloneElement3(props.children, { title: props.title });