@rjsf/antd 5.24.10 → 6.0.0-beta.1
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/antd.esm.js +112 -141
- package/dist/antd.esm.js.map +4 -4
- package/dist/antd.umd.js +29 -69
- package/dist/index.js +209 -244
- package/dist/index.js.map +4 -4
- package/lib/templates/ArrayFieldItemTemplate/index.d.ts +3 -3
- package/lib/templates/ArrayFieldItemTemplate/index.js +7 -5
- package/lib/templates/ArrayFieldItemTemplate/index.js.map +1 -1
- package/lib/templates/ArrayFieldTemplate/index.d.ts +1 -1
- package/lib/templates/ArrayFieldTemplate/index.js +4 -6
- package/lib/templates/ArrayFieldTemplate/index.js.map +1 -1
- package/lib/templates/DescriptionField/index.js.map +1 -1
- package/lib/templates/FieldErrorTemplate/index.js.map +1 -1
- package/lib/templates/FieldTemplate/index.js +1 -1
- package/lib/templates/FieldTemplate/index.js.map +1 -1
- package/lib/templates/GridTemplate/index.d.ts +7 -0
- package/lib/templates/GridTemplate/index.js +15 -0
- package/lib/templates/GridTemplate/index.js.map +1 -0
- package/lib/templates/ObjectFieldTemplate/index.js +3 -5
- package/lib/templates/ObjectFieldTemplate/index.js.map +1 -1
- package/lib/templates/SubmitButton/index.js.map +1 -1
- package/lib/templates/TitleField/index.js.map +1 -1
- package/lib/templates/WrapIfAdditionalTemplate/index.js +2 -2
- package/lib/templates/WrapIfAdditionalTemplate/index.js.map +1 -1
- package/lib/templates/index.js +2 -0
- package/lib/templates/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/widgets/AltDateWidget/index.js.map +1 -1
- package/lib/widgets/SelectWidget/index.js.map +1 -1
- package/package.json +45 -40
- package/src/index.ts +2 -2
- package/src/templates/ArrayFieldItemTemplate/index.tsx +22 -60
- package/src/templates/ArrayFieldTemplate/index.tsx +11 -9
- package/src/templates/BaseInputTemplate/index.tsx +1 -1
- package/src/templates/DescriptionField/index.tsx +1 -1
- package/src/templates/FieldErrorTemplate/index.tsx +1 -1
- package/src/templates/FieldTemplate/index.tsx +3 -3
- package/src/templates/GridTemplate/index.tsx +15 -0
- package/src/templates/IconButton/index.tsx +7 -7
- package/src/templates/ObjectFieldTemplate/index.tsx +6 -4
- package/src/templates/SubmitButton/index.tsx +1 -1
- package/src/templates/WrapIfAdditionalTemplate/index.tsx +4 -2
- package/src/templates/index.ts +3 -1
- package/src/tsconfig.json +1 -1
- package/src/widgets/AltDateTimeWidget/index.tsx +1 -1
- package/src/widgets/AltDateWidget/index.tsx +2 -2
- package/src/widgets/CheckboxWidget/index.tsx +1 -1
- package/src/widgets/CheckboxesWidget/index.tsx +1 -1
- package/src/widgets/DateTimeWidget/index.tsx +1 -1
- package/src/widgets/DateWidget/index.tsx +1 -1
- package/src/widgets/PasswordWidget/index.tsx +1 -1
- package/src/widgets/RangeWidget/index.tsx +1 -1
- package/src/widgets/SelectWidget/index.tsx +1 -1
- package/src/widgets/TextareaWidget/index.tsx +1 -1
- package/src/widgets/index.ts +1 -1
- package/LICENSE.md +0 -201
- package/src/index.less +0 -38
package/dist/antd.esm.js
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
import { withTheme } from "@rjsf/core";
|
|
3
3
|
|
|
4
4
|
// src/templates/ArrayFieldItemTemplate/index.tsx
|
|
5
|
-
import {
|
|
5
|
+
import { Col, Row, Space } from "antd";
|
|
6
|
+
import {
|
|
7
|
+
getUiOptions,
|
|
8
|
+
getTemplate
|
|
9
|
+
} from "@rjsf/utils";
|
|
6
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
11
|
var BTN_GRP_STYLE = {
|
|
8
12
|
width: "100%"
|
|
@@ -11,75 +15,25 @@ var BTN_STYLE = {
|
|
|
11
15
|
width: "calc(100% / 4)"
|
|
12
16
|
};
|
|
13
17
|
function ArrayFieldItemTemplate(props) {
|
|
14
|
-
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
hasMoveDown,
|
|
19
|
-
hasMoveUp,
|
|
20
|
-
hasRemove,
|
|
21
|
-
hasToolbar,
|
|
22
|
-
index,
|
|
23
|
-
onCopyIndexClick,
|
|
24
|
-
onDropIndexClick,
|
|
25
|
-
onReorderClick,
|
|
26
|
-
readonly,
|
|
18
|
+
const { children, buttonsProps, hasToolbar, index, registry, uiSchema } = props;
|
|
19
|
+
const uiOptions = getUiOptions(uiSchema);
|
|
20
|
+
const ArrayFieldItemButtonsTemplate = getTemplate(
|
|
21
|
+
"ArrayFieldItemButtonsTemplate",
|
|
27
22
|
registry,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
|
|
23
|
+
uiOptions
|
|
24
|
+
);
|
|
31
25
|
const { rowGutter = 24, toolbarAlign = "top" } = registry.formContext;
|
|
32
26
|
return /* @__PURE__ */ jsxs(Row, { align: toolbarAlign, gutter: rowGutter, children: [
|
|
33
27
|
/* @__PURE__ */ jsx(Col, { flex: "1", children }),
|
|
34
|
-
hasToolbar && /* @__PURE__ */ jsx(Col, { flex: "192px", children: /* @__PURE__ */
|
|
35
|
-
|
|
36
|
-
MoveUpButton2,
|
|
37
|
-
{
|
|
38
|
-
disabled: disabled || readonly || !hasMoveUp,
|
|
39
|
-
onClick: onReorderClick(index, index - 1),
|
|
40
|
-
style: BTN_STYLE,
|
|
41
|
-
uiSchema,
|
|
42
|
-
registry
|
|
43
|
-
}
|
|
44
|
-
),
|
|
45
|
-
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx(
|
|
46
|
-
MoveDownButton2,
|
|
47
|
-
{
|
|
48
|
-
disabled: disabled || readonly || !hasMoveDown,
|
|
49
|
-
onClick: onReorderClick(index, index + 1),
|
|
50
|
-
style: BTN_STYLE,
|
|
51
|
-
uiSchema,
|
|
52
|
-
registry
|
|
53
|
-
}
|
|
54
|
-
),
|
|
55
|
-
hasCopy && /* @__PURE__ */ jsx(
|
|
56
|
-
CopyButton2,
|
|
57
|
-
{
|
|
58
|
-
disabled: disabled || readonly,
|
|
59
|
-
onClick: onCopyIndexClick(index),
|
|
60
|
-
style: BTN_STYLE,
|
|
61
|
-
uiSchema,
|
|
62
|
-
registry
|
|
63
|
-
}
|
|
64
|
-
),
|
|
65
|
-
hasRemove && /* @__PURE__ */ jsx(
|
|
66
|
-
RemoveButton2,
|
|
67
|
-
{
|
|
68
|
-
disabled: disabled || readonly,
|
|
69
|
-
onClick: onDropIndexClick(index),
|
|
70
|
-
style: BTN_STYLE,
|
|
71
|
-
uiSchema,
|
|
72
|
-
registry
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
] }) })
|
|
76
|
-
] }, `array-item-${index}`);
|
|
28
|
+
hasToolbar && /* @__PURE__ */ jsx(Col, { flex: "192px", children: /* @__PURE__ */ jsx(Space.Compact, { style: BTN_GRP_STYLE, children: /* @__PURE__ */ jsx(ArrayFieldItemButtonsTemplate, { ...buttonsProps, style: BTN_STYLE }) }) })
|
|
29
|
+
] }, `rjsf-array-item-${index}`);
|
|
77
30
|
}
|
|
78
31
|
|
|
79
32
|
// src/templates/ArrayFieldTemplate/index.tsx
|
|
80
33
|
import {
|
|
81
|
-
getTemplate,
|
|
82
|
-
getUiOptions
|
|
34
|
+
getTemplate as getTemplate2,
|
|
35
|
+
getUiOptions as getUiOptions2,
|
|
36
|
+
buttonId
|
|
83
37
|
} from "@rjsf/utils";
|
|
84
38
|
import classNames from "classnames";
|
|
85
39
|
import { Col as Col2, Row as Row2, ConfigProvider } from "antd";
|
|
@@ -104,18 +58,18 @@ function ArrayFieldTemplate(props) {
|
|
|
104
58
|
title,
|
|
105
59
|
uiSchema
|
|
106
60
|
} = props;
|
|
107
|
-
const uiOptions =
|
|
108
|
-
const ArrayFieldDescriptionTemplate =
|
|
61
|
+
const uiOptions = getUiOptions2(uiSchema);
|
|
62
|
+
const ArrayFieldDescriptionTemplate = getTemplate2(
|
|
109
63
|
"ArrayFieldDescriptionTemplate",
|
|
110
64
|
registry,
|
|
111
65
|
uiOptions
|
|
112
66
|
);
|
|
113
|
-
const ArrayFieldItemTemplate2 =
|
|
67
|
+
const ArrayFieldItemTemplate2 = getTemplate2(
|
|
114
68
|
"ArrayFieldItemTemplate",
|
|
115
69
|
registry,
|
|
116
70
|
uiOptions
|
|
117
71
|
);
|
|
118
|
-
const ArrayFieldTitleTemplate =
|
|
72
|
+
const ArrayFieldTitleTemplate = getTemplate2(
|
|
119
73
|
"ArrayFieldTitleTemplate",
|
|
120
74
|
registry,
|
|
121
75
|
uiOptions
|
|
@@ -158,7 +112,8 @@ function ArrayFieldTemplate(props) {
|
|
|
158
112
|
canAdd && /* @__PURE__ */ jsx2(Col2, { span: 24, children: /* @__PURE__ */ jsx2(Row2, { gutter: rowGutter, justify: "end", children: /* @__PURE__ */ jsx2(Col2, { flex: "192px", children: /* @__PURE__ */ jsx2(
|
|
159
113
|
AddButton2,
|
|
160
114
|
{
|
|
161
|
-
|
|
115
|
+
id: buttonId(idSchema, "add"),
|
|
116
|
+
className: "rjsf-array-item-add",
|
|
162
117
|
disabled: disabled || readonly,
|
|
163
118
|
onClick: onAddClick,
|
|
164
119
|
uiSchema,
|
|
@@ -253,7 +208,7 @@ function DescriptionField(props) {
|
|
|
253
208
|
}
|
|
254
209
|
|
|
255
210
|
// src/templates/ErrorList/index.tsx
|
|
256
|
-
import { Alert, List, Space } from "antd";
|
|
211
|
+
import { Alert, List, Space as Space2 } from "antd";
|
|
257
212
|
import ExclamationCircleOutlined from "@ant-design/icons/ExclamationCircleOutlined";
|
|
258
213
|
import { TranslatableString } from "@rjsf/utils";
|
|
259
214
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
@@ -262,7 +217,7 @@ function ErrorList({
|
|
|
262
217
|
registry
|
|
263
218
|
}) {
|
|
264
219
|
const { translateString } = registry;
|
|
265
|
-
const renderErrors = () => /* @__PURE__ */ jsx5(List, { className: "list-group", size: "small", children: errors.map((error, index) => /* @__PURE__ */ jsx5(List.Item, { children: /* @__PURE__ */ jsxs4(
|
|
220
|
+
const renderErrors = () => /* @__PURE__ */ jsx5(List, { className: "list-group", size: "small", children: errors.map((error, index) => /* @__PURE__ */ jsx5(List.Item, { children: /* @__PURE__ */ jsxs4(Space2, { children: [
|
|
266
221
|
/* @__PURE__ */ jsx5(ExclamationCircleOutlined, {}),
|
|
267
222
|
error.stack
|
|
268
223
|
] }) }, index)) });
|
|
@@ -278,21 +233,21 @@ function ErrorList({
|
|
|
278
233
|
}
|
|
279
234
|
|
|
280
235
|
// src/templates/IconButton/index.tsx
|
|
281
|
-
import { Button
|
|
236
|
+
import { Button } from "antd";
|
|
282
237
|
import ArrowDownOutlined from "@ant-design/icons/ArrowDownOutlined";
|
|
283
238
|
import ArrowUpOutlined from "@ant-design/icons/ArrowUpOutlined";
|
|
284
239
|
import CopyOutlined from "@ant-design/icons/CopyOutlined";
|
|
285
240
|
import DeleteOutlined from "@ant-design/icons/DeleteOutlined";
|
|
286
241
|
import PlusCircleOutlined from "@ant-design/icons/PlusCircleOutlined";
|
|
287
242
|
import {
|
|
288
|
-
getUiOptions as
|
|
243
|
+
getUiOptions as getUiOptions3,
|
|
289
244
|
TranslatableString as TranslatableString2
|
|
290
245
|
} from "@rjsf/utils";
|
|
291
246
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
292
247
|
function IconButton(props) {
|
|
293
248
|
const { iconType = "default", icon, onClick, uiSchema, registry, ...otherProps } = props;
|
|
294
249
|
return /* @__PURE__ */ jsx6(
|
|
295
|
-
|
|
250
|
+
Button,
|
|
296
251
|
{
|
|
297
252
|
onClick,
|
|
298
253
|
type: iconType,
|
|
@@ -335,7 +290,7 @@ function MoveUpButton(props) {
|
|
|
335
290
|
return /* @__PURE__ */ jsx6(IconButton, { title: translateString(TranslatableString2.MoveUpButton), ...props, icon: /* @__PURE__ */ jsx6(ArrowUpOutlined, {}) });
|
|
336
291
|
}
|
|
337
292
|
function RemoveButton(props) {
|
|
338
|
-
const options =
|
|
293
|
+
const options = getUiOptions3(props.uiSchema);
|
|
339
294
|
const {
|
|
340
295
|
registry: { translateString }
|
|
341
296
|
} = props;
|
|
@@ -367,8 +322,8 @@ function FieldErrorTemplate(props) {
|
|
|
367
322
|
// src/templates/FieldTemplate/index.tsx
|
|
368
323
|
import { Form } from "antd";
|
|
369
324
|
import {
|
|
370
|
-
getTemplate as
|
|
371
|
-
getUiOptions as
|
|
325
|
+
getTemplate as getTemplate3,
|
|
326
|
+
getUiOptions as getUiOptions4
|
|
372
327
|
} from "@rjsf/utils";
|
|
373
328
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
374
329
|
var VERTICAL_LABEL_COL = { span: 24 };
|
|
@@ -405,14 +360,14 @@ function FieldTemplate(props) {
|
|
|
405
360
|
wrapperStyle,
|
|
406
361
|
descriptionLocation = "below"
|
|
407
362
|
} = formContext;
|
|
408
|
-
const uiOptions =
|
|
409
|
-
const WrapIfAdditionalTemplate2 =
|
|
363
|
+
const uiOptions = getUiOptions4(uiSchema);
|
|
364
|
+
const WrapIfAdditionalTemplate2 = getTemplate3(
|
|
410
365
|
"WrapIfAdditionalTemplate",
|
|
411
366
|
registry,
|
|
412
367
|
uiOptions
|
|
413
368
|
);
|
|
414
369
|
if (hidden) {
|
|
415
|
-
return /* @__PURE__ */ jsx8("div", { className: "field-hidden", children });
|
|
370
|
+
return /* @__PURE__ */ jsx8("div", { className: "rjsf-field-hidden", children });
|
|
416
371
|
}
|
|
417
372
|
const descriptionNode = rawDescription ? description : void 0;
|
|
418
373
|
const descriptionProps = {};
|
|
@@ -461,6 +416,17 @@ function FieldTemplate(props) {
|
|
|
461
416
|
);
|
|
462
417
|
}
|
|
463
418
|
|
|
419
|
+
// src/templates/GridTemplate/index.tsx
|
|
420
|
+
import { Col as Col3, Row as Row3 } from "antd";
|
|
421
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
422
|
+
function GridTemplate(props) {
|
|
423
|
+
const { children, column, ...rest } = props;
|
|
424
|
+
if (column) {
|
|
425
|
+
return /* @__PURE__ */ jsx9(Col3, { ...rest, children });
|
|
426
|
+
}
|
|
427
|
+
return /* @__PURE__ */ jsx9(Row3, { ...rest, children });
|
|
428
|
+
}
|
|
429
|
+
|
|
464
430
|
// src/templates/ObjectFieldTemplate/index.tsx
|
|
465
431
|
import classNames2 from "classnames";
|
|
466
432
|
import isObject from "lodash/isObject";
|
|
@@ -469,13 +435,14 @@ import isString from "lodash/isString";
|
|
|
469
435
|
import {
|
|
470
436
|
canExpand,
|
|
471
437
|
descriptionId,
|
|
472
|
-
getTemplate as
|
|
473
|
-
getUiOptions as
|
|
474
|
-
titleId
|
|
438
|
+
getTemplate as getTemplate4,
|
|
439
|
+
getUiOptions as getUiOptions5,
|
|
440
|
+
titleId,
|
|
441
|
+
buttonId as buttonId2
|
|
475
442
|
} from "@rjsf/utils";
|
|
476
|
-
import { Col as
|
|
443
|
+
import { Col as Col4, Row as Row4, ConfigProvider as ConfigProvider2 } from "antd";
|
|
477
444
|
import { useContext as useContext2 } from "react";
|
|
478
|
-
import { jsx as
|
|
445
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
479
446
|
var DESCRIPTION_COL_STYLE2 = {
|
|
480
447
|
paddingBottom: "8px"
|
|
481
448
|
};
|
|
@@ -495,9 +462,9 @@ function ObjectFieldTemplate(props) {
|
|
|
495
462
|
title,
|
|
496
463
|
uiSchema
|
|
497
464
|
} = props;
|
|
498
|
-
const uiOptions =
|
|
499
|
-
const TitleFieldTemplate =
|
|
500
|
-
const DescriptionFieldTemplate =
|
|
465
|
+
const uiOptions = getUiOptions5(uiSchema);
|
|
466
|
+
const TitleFieldTemplate = getTemplate4("TitleFieldTemplate", registry, uiOptions);
|
|
467
|
+
const DescriptionFieldTemplate = getTemplate4(
|
|
501
468
|
"DescriptionFieldTemplate",
|
|
502
469
|
registry,
|
|
503
470
|
uiOptions
|
|
@@ -509,8 +476,8 @@ function ObjectFieldTemplate(props) {
|
|
|
509
476
|
const findSchema = (element) => element.content.props.schema;
|
|
510
477
|
const findSchemaType = (element) => findSchema(element).type;
|
|
511
478
|
const findUiSchema = (element) => element.content.props.uiSchema;
|
|
512
|
-
const findUiSchemaField = (element) =>
|
|
513
|
-
const findUiSchemaWidget = (element) =>
|
|
479
|
+
const findUiSchemaField = (element) => getUiOptions5(findUiSchema(element)).field;
|
|
480
|
+
const findUiSchemaWidget = (element) => getUiOptions5(findUiSchema(element)).widget;
|
|
514
481
|
const calculateColSpan = (element) => {
|
|
515
482
|
const type = findSchemaType(element);
|
|
516
483
|
const field = findUiSchemaField(element);
|
|
@@ -543,8 +510,8 @@ function ObjectFieldTemplate(props) {
|
|
|
543
510
|
// labelCol.className,
|
|
544
511
|
);
|
|
545
512
|
return /* @__PURE__ */ jsxs5("fieldset", { id: idSchema.$id, children: [
|
|
546
|
-
/* @__PURE__ */ jsxs5(
|
|
547
|
-
title && /* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ jsxs5(Row4, { gutter: rowGutter, children: [
|
|
514
|
+
title && /* @__PURE__ */ jsx10(Col4, { className: labelColClassName, span: 24, children: /* @__PURE__ */ jsx10(
|
|
548
515
|
TitleFieldTemplate,
|
|
549
516
|
{
|
|
550
517
|
id: titleId(idSchema),
|
|
@@ -555,7 +522,7 @@ function ObjectFieldTemplate(props) {
|
|
|
555
522
|
registry
|
|
556
523
|
}
|
|
557
524
|
) }),
|
|
558
|
-
description && /* @__PURE__ */
|
|
525
|
+
description && /* @__PURE__ */ jsx10(Col4, { span: 24, style: DESCRIPTION_COL_STYLE2, children: /* @__PURE__ */ jsx10(
|
|
559
526
|
DescriptionFieldTemplate,
|
|
560
527
|
{
|
|
561
528
|
id: descriptionId(idSchema),
|
|
@@ -565,12 +532,13 @@ function ObjectFieldTemplate(props) {
|
|
|
565
532
|
registry
|
|
566
533
|
}
|
|
567
534
|
) }),
|
|
568
|
-
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */
|
|
535
|
+
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ jsx10(Col4, { span: calculateColSpan(element), children: element.content }, element.name))
|
|
569
536
|
] }),
|
|
570
|
-
canExpand(schema, uiSchema, formData) && /* @__PURE__ */
|
|
537
|
+
canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx10(Col4, { span: 24, children: /* @__PURE__ */ jsx10(Row4, { gutter: rowGutter, justify: "end", children: /* @__PURE__ */ jsx10(Col4, { flex: "192px", children: /* @__PURE__ */ jsx10(
|
|
571
538
|
AddButton2,
|
|
572
539
|
{
|
|
573
|
-
|
|
540
|
+
id: buttonId2(idSchema, "add"),
|
|
541
|
+
className: "rjsf-object-property-expand",
|
|
574
542
|
disabled: disabled || readonly,
|
|
575
543
|
onClick: onAddClick(schema),
|
|
576
544
|
uiSchema,
|
|
@@ -581,22 +549,22 @@ function ObjectFieldTemplate(props) {
|
|
|
581
549
|
}
|
|
582
550
|
|
|
583
551
|
// src/templates/SubmitButton/index.tsx
|
|
584
|
-
import { Button as
|
|
552
|
+
import { Button as Button2 } from "antd";
|
|
585
553
|
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
586
|
-
import { jsx as
|
|
554
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
587
555
|
function SubmitButton({ uiSchema }) {
|
|
588
556
|
const { submitText, norender, props: submitButtonProps } = getSubmitButtonOptions(uiSchema);
|
|
589
557
|
if (norender) {
|
|
590
558
|
return null;
|
|
591
559
|
}
|
|
592
|
-
return /* @__PURE__ */
|
|
560
|
+
return /* @__PURE__ */ jsx11(Button2, { type: "submit", ...submitButtonProps, htmlType: "submit", children: submitText });
|
|
593
561
|
}
|
|
594
562
|
|
|
595
563
|
// src/templates/TitleField/index.tsx
|
|
596
564
|
import classNames3 from "classnames";
|
|
597
565
|
import { ConfigProvider as ConfigProvider3 } from "antd";
|
|
598
566
|
import { useContext as useContext3 } from "react";
|
|
599
|
-
import { jsx as
|
|
567
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
600
568
|
function TitleField({
|
|
601
569
|
id,
|
|
602
570
|
required,
|
|
@@ -624,7 +592,7 @@ function TitleField({
|
|
|
624
592
|
[`${prefixCls}-item-required`]: required,
|
|
625
593
|
[`${prefixCls}-item-no-colon`]: !colon
|
|
626
594
|
});
|
|
627
|
-
return title ? /* @__PURE__ */
|
|
595
|
+
return title ? /* @__PURE__ */ jsx12(
|
|
628
596
|
"label",
|
|
629
597
|
{
|
|
630
598
|
className: labelClassName,
|
|
@@ -637,13 +605,14 @@ function TitleField({
|
|
|
637
605
|
}
|
|
638
606
|
|
|
639
607
|
// src/templates/WrapIfAdditionalTemplate/index.tsx
|
|
640
|
-
import { Col as
|
|
608
|
+
import { Col as Col5, Row as Row5, Form as Form2, Input as Input2 } from "antd";
|
|
641
609
|
import {
|
|
642
610
|
ADDITIONAL_PROPERTY_FLAG,
|
|
643
611
|
UI_OPTIONS_KEY,
|
|
644
|
-
TranslatableString as TranslatableString3
|
|
612
|
+
TranslatableString as TranslatableString3,
|
|
613
|
+
buttonId as buttonId3
|
|
645
614
|
} from "@rjsf/utils";
|
|
646
|
-
import { jsx as
|
|
615
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
647
616
|
var VERTICAL_LABEL_COL2 = { span: 24 };
|
|
648
617
|
var VERTICAL_WRAPPER_COL2 = { span: 24 };
|
|
649
618
|
var INPUT_STYLE2 = {
|
|
@@ -679,7 +648,7 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
679
648
|
const keyLabel = translateString(TranslatableString3.KeyLabel, [label]);
|
|
680
649
|
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
681
650
|
if (!additional) {
|
|
682
|
-
return /* @__PURE__ */
|
|
651
|
+
return /* @__PURE__ */ jsx13("div", { className: classNames4, style, children });
|
|
683
652
|
}
|
|
684
653
|
const handleBlur = ({ target }) => onKeyChange(target && target.value);
|
|
685
654
|
const uiOptions = uiSchema ? uiSchema[UI_OPTIONS_KEY] : {};
|
|
@@ -687,8 +656,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
687
656
|
...uiSchema,
|
|
688
657
|
[UI_OPTIONS_KEY]: { ...uiOptions, block: true }
|
|
689
658
|
};
|
|
690
|
-
return /* @__PURE__ */
|
|
691
|
-
/* @__PURE__ */
|
|
659
|
+
return /* @__PURE__ */ jsx13("div", { className: classNames4, style, children: /* @__PURE__ */ jsxs6(Row5, { align: toolbarAlign, gutter: rowGutter, children: [
|
|
660
|
+
/* @__PURE__ */ jsx13(Col5, { className: "form-additional", flex: "1", children: /* @__PURE__ */ jsx13("div", { className: "form-group", children: /* @__PURE__ */ jsx13(
|
|
692
661
|
Form2.Item,
|
|
693
662
|
{
|
|
694
663
|
colon,
|
|
@@ -700,7 +669,7 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
700
669
|
required,
|
|
701
670
|
style: wrapperStyle,
|
|
702
671
|
wrapperCol,
|
|
703
|
-
children: /* @__PURE__ */
|
|
672
|
+
children: /* @__PURE__ */ jsx13(
|
|
704
673
|
Input2,
|
|
705
674
|
{
|
|
706
675
|
className: "form-control",
|
|
@@ -715,11 +684,12 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
715
684
|
)
|
|
716
685
|
}
|
|
717
686
|
) }) }),
|
|
718
|
-
/* @__PURE__ */
|
|
719
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ jsx13(Col5, { className: "form-additional", flex: "1", children }),
|
|
688
|
+
/* @__PURE__ */ jsx13(Col5, { flex: "192px", children: /* @__PURE__ */ jsx13(
|
|
720
689
|
RemoveButton2,
|
|
721
690
|
{
|
|
722
|
-
|
|
691
|
+
id: buttonId3(id, "remove"),
|
|
692
|
+
className: "rjsf-object-property-remove",
|
|
723
693
|
disabled: disabled || readonly,
|
|
724
694
|
onClick: onDropPropertyClick(label),
|
|
725
695
|
uiSchema: buttonUiOptions,
|
|
@@ -747,6 +717,7 @@ function generateTemplates() {
|
|
|
747
717
|
ErrorListTemplate: ErrorList,
|
|
748
718
|
FieldErrorTemplate,
|
|
749
719
|
FieldTemplate,
|
|
720
|
+
GridTemplate,
|
|
750
721
|
ObjectFieldTemplate,
|
|
751
722
|
TitleFieldTemplate: TitleField,
|
|
752
723
|
WrapIfAdditionalTemplate
|
|
@@ -756,7 +727,7 @@ var templates_default = generateTemplates();
|
|
|
756
727
|
|
|
757
728
|
// src/widgets/AltDateWidget/index.tsx
|
|
758
729
|
import { useEffect, useState } from "react";
|
|
759
|
-
import { Row as
|
|
730
|
+
import { Row as Row6, Col as Col6, Button as Button3 } from "antd";
|
|
760
731
|
import {
|
|
761
732
|
ariaDescribedByIds as ariaDescribedByIds2,
|
|
762
733
|
dateRangeOptions,
|
|
@@ -765,7 +736,7 @@ import {
|
|
|
765
736
|
toDateString,
|
|
766
737
|
TranslatableString as TranslatableString4
|
|
767
738
|
} from "@rjsf/utils";
|
|
768
|
-
import { jsx as
|
|
739
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
769
740
|
var readyForChange = (state) => {
|
|
770
741
|
return Object.values(state).every((value) => value !== -1);
|
|
771
742
|
};
|
|
@@ -817,7 +788,7 @@ function AltDateWidget(props) {
|
|
|
817
788
|
}
|
|
818
789
|
onChange(void 0);
|
|
819
790
|
};
|
|
820
|
-
const renderDateElement = (elemProps) => /* @__PURE__ */
|
|
791
|
+
const renderDateElement = (elemProps) => /* @__PURE__ */ jsx14(
|
|
821
792
|
SelectWidget2,
|
|
822
793
|
{
|
|
823
794
|
autofocus: elemProps.autofocus,
|
|
@@ -840,7 +811,7 @@ function AltDateWidget(props) {
|
|
|
840
811
|
"aria-describedby": ariaDescribedByIds2(id)
|
|
841
812
|
}
|
|
842
813
|
);
|
|
843
|
-
return /* @__PURE__ */ jsxs7(
|
|
814
|
+
return /* @__PURE__ */ jsxs7(Row6, { gutter: [Math.floor(rowGutter / 2), Math.floor(rowGutter / 2)], children: [
|
|
844
815
|
getDateElementProps(
|
|
845
816
|
state,
|
|
846
817
|
showTime,
|
|
@@ -848,7 +819,7 @@ function AltDateWidget(props) {
|
|
|
848
819
|
options.format
|
|
849
820
|
).map((elemProps, i) => {
|
|
850
821
|
const elemId = id + "_" + elemProps.type;
|
|
851
|
-
return /* @__PURE__ */
|
|
822
|
+
return /* @__PURE__ */ jsx14(Col6, { flex: "88px", children: renderDateElement({
|
|
852
823
|
...elemProps,
|
|
853
824
|
autofocus: autofocus && i === 0,
|
|
854
825
|
disabled,
|
|
@@ -864,8 +835,8 @@ function AltDateWidget(props) {
|
|
|
864
835
|
value: elemProps.value || -1 < 0 ? void 0 : elemProps.value
|
|
865
836
|
}) }, elemId);
|
|
866
837
|
}),
|
|
867
|
-
!options.hideNowButton && /* @__PURE__ */
|
|
868
|
-
!options.hideClearButton && /* @__PURE__ */
|
|
838
|
+
!options.hideNowButton && /* @__PURE__ */ jsx14(Col6, { flex: "88px", children: /* @__PURE__ */ jsx14(Button3, { block: true, className: "btn-now", onClick: handleNow, type: "primary", children: translateString(TranslatableString4.NowLabel) }) }),
|
|
839
|
+
!options.hideClearButton && /* @__PURE__ */ jsx14(Col6, { flex: "88px", children: /* @__PURE__ */ jsx14(Button3, { block: true, className: "btn-clear", danger: true, onClick: handleClear, type: "primary", children: translateString(TranslatableString4.ClearLabel) }) })
|
|
869
840
|
] });
|
|
870
841
|
}
|
|
871
842
|
AltDateWidget.defaultProps = {
|
|
@@ -879,10 +850,10 @@ AltDateWidget.defaultProps = {
|
|
|
879
850
|
};
|
|
880
851
|
|
|
881
852
|
// src/widgets/AltDateTimeWidget/index.tsx
|
|
882
|
-
import { jsx as
|
|
853
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
883
854
|
function AltDateTimeWidget(props) {
|
|
884
855
|
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
885
|
-
return /* @__PURE__ */
|
|
856
|
+
return /* @__PURE__ */ jsx15(AltDateWidget2, { showTime: true, ...props });
|
|
886
857
|
}
|
|
887
858
|
AltDateTimeWidget.defaultProps = {
|
|
888
859
|
...AltDateWidget.defaultProps,
|
|
@@ -897,7 +868,7 @@ import {
|
|
|
897
868
|
enumOptionsValueForIndex,
|
|
898
869
|
optionId
|
|
899
870
|
} from "@rjsf/utils";
|
|
900
|
-
import { Fragment as Fragment2, jsx as
|
|
871
|
+
import { Fragment as Fragment2, jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
901
872
|
function CheckboxesWidget({ autofocus, disabled, formContext, id, onBlur, onChange, onFocus, options, readonly, value }) {
|
|
902
873
|
const { readonlyAsDisabled = true } = formContext;
|
|
903
874
|
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
@@ -910,7 +881,7 @@ function CheckboxesWidget({ autofocus, disabled, formContext, id, onBlur, onChan
|
|
|
910
881
|
onFocus: !readonly ? handleFocus : void 0
|
|
911
882
|
};
|
|
912
883
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
|
|
913
|
-
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */
|
|
884
|
+
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ jsx16(Fragment2, { children: /* @__PURE__ */ jsx16(
|
|
914
885
|
Checkbox.Group,
|
|
915
886
|
{
|
|
916
887
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
@@ -920,7 +891,7 @@ function CheckboxesWidget({ autofocus, disabled, formContext, id, onBlur, onChan
|
|
|
920
891
|
...extraProps,
|
|
921
892
|
"aria-describedby": ariaDescribedByIds3(id),
|
|
922
893
|
children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ jsxs8("span", { children: [
|
|
923
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ jsx16(
|
|
924
895
|
Checkbox,
|
|
925
896
|
{
|
|
926
897
|
id: optionId(id, i),
|
|
@@ -931,7 +902,7 @@ function CheckboxesWidget({ autofocus, disabled, formContext, id, onBlur, onChan
|
|
|
931
902
|
children: option.label
|
|
932
903
|
}
|
|
933
904
|
),
|
|
934
|
-
!inline && /* @__PURE__ */
|
|
905
|
+
!inline && /* @__PURE__ */ jsx16("br", {})
|
|
935
906
|
] }, i))
|
|
936
907
|
}
|
|
937
908
|
) }) : null;
|
|
@@ -943,7 +914,7 @@ import {
|
|
|
943
914
|
ariaDescribedByIds as ariaDescribedByIds4,
|
|
944
915
|
labelValue
|
|
945
916
|
} from "@rjsf/utils";
|
|
946
|
-
import { jsx as
|
|
917
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
947
918
|
function CheckboxWidget(props) {
|
|
948
919
|
const { autofocus, disabled, formContext, id, label, hideLabel, onBlur, onChange, onFocus, readonly, value } = props;
|
|
949
920
|
const { readonlyAsDisabled = true } = formContext;
|
|
@@ -954,7 +925,7 @@ function CheckboxWidget(props) {
|
|
|
954
925
|
onBlur: !readonly ? handleBlur : void 0,
|
|
955
926
|
onFocus: !readonly ? handleFocus : void 0
|
|
956
927
|
};
|
|
957
|
-
return /* @__PURE__ */
|
|
928
|
+
return /* @__PURE__ */ jsx17(
|
|
958
929
|
Checkbox2,
|
|
959
930
|
{
|
|
960
931
|
autoFocus: autofocus,
|
|
@@ -976,7 +947,7 @@ import {
|
|
|
976
947
|
ariaDescribedByIds as ariaDescribedByIds5
|
|
977
948
|
} from "@rjsf/utils";
|
|
978
949
|
import { DatePicker } from "antd";
|
|
979
|
-
import { jsx as
|
|
950
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
980
951
|
var DATE_PICKER_STYLE = {
|
|
981
952
|
width: "100%"
|
|
982
953
|
};
|
|
@@ -987,7 +958,7 @@ function DateTimeWidget(props) {
|
|
|
987
958
|
const handleBlur = () => onBlur(id, value);
|
|
988
959
|
const handleFocus = () => onFocus(id, value);
|
|
989
960
|
const getPopupContainer = (node) => node.parentNode;
|
|
990
|
-
return /* @__PURE__ */
|
|
961
|
+
return /* @__PURE__ */ jsx18(
|
|
991
962
|
DatePicker,
|
|
992
963
|
{
|
|
993
964
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
@@ -1012,7 +983,7 @@ import {
|
|
|
1012
983
|
ariaDescribedByIds as ariaDescribedByIds6
|
|
1013
984
|
} from "@rjsf/utils";
|
|
1014
985
|
import { DatePicker as DatePicker2 } from "antd";
|
|
1015
|
-
import { jsx as
|
|
986
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1016
987
|
var DATE_PICKER_STYLE2 = {
|
|
1017
988
|
width: "100%"
|
|
1018
989
|
};
|
|
@@ -1023,7 +994,7 @@ function DateWidget(props) {
|
|
|
1023
994
|
const handleBlur = () => onBlur(id, value);
|
|
1024
995
|
const handleFocus = () => onFocus(id, value);
|
|
1025
996
|
const getPopupContainer = (node) => node.parentNode;
|
|
1026
|
-
return /* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ jsx19(
|
|
1027
998
|
DatePicker2,
|
|
1028
999
|
{
|
|
1029
1000
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
@@ -1047,7 +1018,7 @@ import { Input as Input3 } from "antd";
|
|
|
1047
1018
|
import {
|
|
1048
1019
|
ariaDescribedByIds as ariaDescribedByIds7
|
|
1049
1020
|
} from "@rjsf/utils";
|
|
1050
|
-
import { jsx as
|
|
1021
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1051
1022
|
function PasswordWidget(props) {
|
|
1052
1023
|
const { disabled, formContext, id, onBlur, onChange, onFocus, options, placeholder, readonly, value } = props;
|
|
1053
1024
|
const { readonlyAsDisabled = true } = formContext;
|
|
@@ -1055,7 +1026,7 @@ function PasswordWidget(props) {
|
|
|
1055
1026
|
const handleChange = ({ target }) => onChange(target.value === "" ? emptyValue : target.value);
|
|
1056
1027
|
const handleBlur = ({ target }) => onBlur(id, target.value);
|
|
1057
1028
|
const handleFocus = ({ target }) => onFocus(id, target.value);
|
|
1058
|
-
return /* @__PURE__ */
|
|
1029
|
+
return /* @__PURE__ */ jsx20(
|
|
1059
1030
|
Input3.Password,
|
|
1060
1031
|
{
|
|
1061
1032
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
@@ -1079,7 +1050,7 @@ import {
|
|
|
1079
1050
|
enumOptionsValueForIndex as enumOptionsValueForIndex2,
|
|
1080
1051
|
optionId as optionId2
|
|
1081
1052
|
} from "@rjsf/utils";
|
|
1082
|
-
import { jsx as
|
|
1053
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1083
1054
|
function RadioWidget({
|
|
1084
1055
|
autofocus,
|
|
1085
1056
|
disabled,
|
|
@@ -1098,7 +1069,7 @@ function RadioWidget({
|
|
|
1098
1069
|
const handleBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
|
|
1099
1070
|
const handleFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex2(target && target.value, enumOptions, emptyValue));
|
|
1100
1071
|
const selectedIndexes = enumOptionsIndexForValue2(value, enumOptions);
|
|
1101
|
-
return /* @__PURE__ */
|
|
1072
|
+
return /* @__PURE__ */ jsx21(
|
|
1102
1073
|
Radio.Group,
|
|
1103
1074
|
{
|
|
1104
1075
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
@@ -1109,7 +1080,7 @@ function RadioWidget({
|
|
|
1109
1080
|
onFocus: !readonly ? handleFocus : void 0,
|
|
1110
1081
|
value: selectedIndexes,
|
|
1111
1082
|
"aria-describedby": ariaDescribedByIds8(id),
|
|
1112
|
-
children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */
|
|
1083
|
+
children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ jsx21(
|
|
1113
1084
|
Radio,
|
|
1114
1085
|
{
|
|
1115
1086
|
id: optionId2(id, i),
|
|
@@ -1131,7 +1102,7 @@ import {
|
|
|
1131
1102
|
ariaDescribedByIds as ariaDescribedByIds9,
|
|
1132
1103
|
rangeSpec
|
|
1133
1104
|
} from "@rjsf/utils";
|
|
1134
|
-
import { jsx as
|
|
1105
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1135
1106
|
function RangeWidget(props) {
|
|
1136
1107
|
const {
|
|
1137
1108
|
autofocus,
|
|
@@ -1158,7 +1129,7 @@ function RangeWidget(props) {
|
|
|
1158
1129
|
onBlur: !readonly ? handleBlur : void 0,
|
|
1159
1130
|
onFocus: !readonly ? handleFocus : void 0
|
|
1160
1131
|
};
|
|
1161
|
-
return /* @__PURE__ */
|
|
1132
|
+
return /* @__PURE__ */ jsx22(
|
|
1162
1133
|
Slider,
|
|
1163
1134
|
{
|
|
1164
1135
|
autoFocus: autofocus,
|
|
@@ -1185,7 +1156,7 @@ import {
|
|
|
1185
1156
|
} from "@rjsf/utils";
|
|
1186
1157
|
import isString2 from "lodash/isString";
|
|
1187
1158
|
import { useMemo } from "react";
|
|
1188
|
-
import { jsx as
|
|
1159
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1189
1160
|
var SELECT_STYLE = {
|
|
1190
1161
|
width: "100%"
|
|
1191
1162
|
};
|
|
@@ -1236,7 +1207,7 @@ function SelectWidget({
|
|
|
1236
1207
|
}
|
|
1237
1208
|
return void 0;
|
|
1238
1209
|
}, [enumDisabled, enumOptions, placeholder, showPlaceholderOption]);
|
|
1239
|
-
return /* @__PURE__ */
|
|
1210
|
+
return /* @__PURE__ */ jsx23(
|
|
1240
1211
|
Select,
|
|
1241
1212
|
{
|
|
1242
1213
|
autoFocus: autofocus,
|
|
@@ -1263,7 +1234,7 @@ import { Input as Input4 } from "antd";
|
|
|
1263
1234
|
import {
|
|
1264
1235
|
ariaDescribedByIds as ariaDescribedByIds11
|
|
1265
1236
|
} from "@rjsf/utils";
|
|
1266
|
-
import { jsx as
|
|
1237
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1267
1238
|
var INPUT_STYLE3 = {
|
|
1268
1239
|
width: "100%"
|
|
1269
1240
|
};
|
|
@@ -1286,7 +1257,7 @@ function TextareaWidget({
|
|
|
1286
1257
|
const extraProps = {
|
|
1287
1258
|
type: "textarea"
|
|
1288
1259
|
};
|
|
1289
|
-
return /* @__PURE__ */
|
|
1260
|
+
return /* @__PURE__ */ jsx24(
|
|
1290
1261
|
Input4.TextArea,
|
|
1291
1262
|
{
|
|
1292
1263
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
@@ -1335,13 +1306,13 @@ function generateForm() {
|
|
|
1335
1306
|
return withTheme(generateTheme());
|
|
1336
1307
|
}
|
|
1337
1308
|
var Form3 = generateForm();
|
|
1338
|
-
var
|
|
1309
|
+
var index_default = Form3;
|
|
1339
1310
|
export {
|
|
1340
1311
|
Form3 as Form,
|
|
1341
1312
|
templates_default as Templates,
|
|
1342
1313
|
Theme,
|
|
1343
1314
|
widgets_default as Widgets,
|
|
1344
|
-
|
|
1315
|
+
index_default as default,
|
|
1345
1316
|
generateForm,
|
|
1346
1317
|
generateTemplates,
|
|
1347
1318
|
generateTheme,
|