@rjsf/antd 5.17.0 → 5.18.0
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 +121 -138
- package/dist/antd.esm.js.map +3 -3
- package/dist/antd.umd.js +133 -139
- package/dist/index.js +155 -172
- package/dist/index.js.map +3 -3
- package/lib/templates/ArrayFieldItemTemplate/index.js +1 -3
- package/lib/templates/ArrayFieldItemTemplate/index.js.map +1 -1
- package/lib/templates/ArrayFieldTemplate/index.js +10 -13
- package/lib/templates/ArrayFieldTemplate/index.js.map +1 -1
- package/lib/templates/BaseInputTemplate/index.js +1 -2
- package/lib/templates/BaseInputTemplate/index.js.map +1 -1
- package/lib/templates/ErrorList/index.js +1 -3
- package/lib/templates/ErrorList/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/IconButton/index.d.ts +1 -1
- package/lib/templates/IconButton/index.js +1 -1
- package/lib/templates/IconButton/index.js.map +1 -1
- package/lib/templates/ObjectFieldTemplate/index.js +11 -14
- package/lib/templates/ObjectFieldTemplate/index.js.map +1 -1
- package/lib/templates/SubmitButton/index.js +1 -1
- package/lib/templates/SubmitButton/index.js.map +1 -1
- package/lib/templates/TitleField/index.js +9 -10
- package/lib/templates/TitleField/index.js.map +1 -1
- package/lib/templates/WrapIfAdditionalTemplate/index.js +1 -4
- package/lib/templates/WrapIfAdditionalTemplate/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/widgets/AltDateWidget/index.js +1 -3
- package/lib/widgets/AltDateWidget/index.js.map +1 -1
- package/lib/widgets/CheckboxWidget/index.js +1 -1
- package/lib/widgets/CheckboxWidget/index.js.map +1 -1
- package/lib/widgets/CheckboxesWidget/index.js +1 -1
- package/lib/widgets/CheckboxesWidget/index.js.map +1 -1
- package/lib/widgets/DateTimeWidget/index.js +1 -1
- package/lib/widgets/DateTimeWidget/index.js.map +1 -1
- package/lib/widgets/DateWidget/index.js +1 -1
- package/lib/widgets/DateWidget/index.js.map +1 -1
- package/lib/widgets/PasswordWidget/index.js +1 -1
- package/lib/widgets/PasswordWidget/index.js.map +1 -1
- package/lib/widgets/RadioWidget/index.js +1 -1
- package/lib/widgets/RadioWidget/index.js.map +1 -1
- package/lib/widgets/RangeWidget/index.js +1 -1
- package/lib/widgets/RangeWidget/index.js.map +1 -1
- package/lib/widgets/SelectWidget/index.js +1 -1
- package/lib/widgets/SelectWidget/index.js.map +1 -1
- package/lib/widgets/TextareaWidget/index.js +1 -1
- package/lib/widgets/TextareaWidget/index.js.map +1 -1
- package/package.json +6 -6
- package/src/templates/ArrayFieldItemTemplate/index.tsx +1 -3
- package/src/templates/ArrayFieldTemplate/index.tsx +57 -64
- package/src/templates/BaseInputTemplate/index.tsx +1 -2
- package/src/templates/ErrorList/index.tsx +1 -3
- package/src/templates/FieldTemplate/index.tsx +1 -1
- package/src/templates/IconButton/index.tsx +2 -2
- package/src/templates/ObjectFieldTemplate/index.tsx +60 -67
- package/src/templates/SubmitButton/index.tsx +3 -1
- package/src/templates/TitleField/index.tsx +17 -22
- package/src/templates/WrapIfAdditionalTemplate/index.tsx +1 -4
- package/src/widgets/AltDateWidget/index.tsx +1 -3
- package/src/widgets/CheckboxWidget/index.tsx +2 -2
- 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/RadioWidget/index.tsx +1 -1
- package/src/widgets/RangeWidget/index.tsx +1 -1
- package/src/widgets/SelectWidget/index.tsx +2 -2
- package/src/widgets/TextareaWidget/index.tsx +1 -1
package/dist/index.js
CHANGED
|
@@ -44,9 +44,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
44
44
|
var import_core = require("@rjsf/core");
|
|
45
45
|
|
|
46
46
|
// src/templates/ArrayFieldItemTemplate/index.tsx
|
|
47
|
-
var
|
|
48
|
-
var import_col = __toESM(require("antd/lib/col"));
|
|
49
|
-
var import_row = __toESM(require("antd/lib/row"));
|
|
47
|
+
var import_antd = require("antd");
|
|
50
48
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
51
49
|
var BTN_GRP_STYLE = {
|
|
52
50
|
width: "100%"
|
|
@@ -73,9 +71,9 @@ function ArrayFieldItemTemplate(props) {
|
|
|
73
71
|
} = props;
|
|
74
72
|
const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
|
|
75
73
|
const { rowGutter = 24, toolbarAlign = "top" } = registry.formContext;
|
|
76
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
77
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
78
|
-
hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Row, { align: toolbarAlign, gutter: rowGutter, children: [
|
|
75
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Col, { flex: "1", children }),
|
|
76
|
+
hasToolbar && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Col, { flex: "192px", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_antd.Button.Group, { style: BTN_GRP_STYLE, children: [
|
|
79
77
|
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
80
78
|
MoveUpButton2,
|
|
81
79
|
{
|
|
@@ -123,9 +121,8 @@ function ArrayFieldItemTemplate(props) {
|
|
|
123
121
|
// src/templates/ArrayFieldTemplate/index.tsx
|
|
124
122
|
var import_utils = require("@rjsf/utils");
|
|
125
123
|
var import_classnames = __toESM(require("classnames"));
|
|
126
|
-
var
|
|
127
|
-
var
|
|
128
|
-
var import_context = require("antd/lib/config-provider/context");
|
|
124
|
+
var import_antd2 = require("antd");
|
|
125
|
+
var import_react = require("react");
|
|
129
126
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
130
127
|
var DESCRIPTION_COL_STYLE = {
|
|
131
128
|
paddingBottom: "8px"
|
|
@@ -166,55 +163,52 @@ function ArrayFieldTemplate(props) {
|
|
|
166
163
|
ButtonTemplates: { AddButton: AddButton2 }
|
|
167
164
|
} = registry.templates;
|
|
168
165
|
const { labelAlign = "right", rowGutter = 24 } = formContext;
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
] }) });
|
|
212
|
-
} });
|
|
166
|
+
const { getPrefixCls } = (0, import_react.useContext)(import_antd2.ConfigProvider.ConfigContext);
|
|
167
|
+
const prefixCls = getPrefixCls("form");
|
|
168
|
+
const labelClsBasic = `${prefixCls}-item-label`;
|
|
169
|
+
const labelColClassName = (0, import_classnames.default)(
|
|
170
|
+
labelClsBasic,
|
|
171
|
+
labelAlign === "left" && `${labelClsBasic}-left`
|
|
172
|
+
// labelCol.className,
|
|
173
|
+
);
|
|
174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("fieldset", { className, id: idSchema.$id, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_antd2.Row, { gutter: rowGutter, children: [
|
|
175
|
+
(uiOptions.title || title) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_antd2.Col, { className: labelColClassName, span: 24, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
176
|
+
ArrayFieldTitleTemplate,
|
|
177
|
+
{
|
|
178
|
+
idSchema,
|
|
179
|
+
required,
|
|
180
|
+
title: uiOptions.title || title,
|
|
181
|
+
schema,
|
|
182
|
+
uiSchema,
|
|
183
|
+
registry
|
|
184
|
+
}
|
|
185
|
+
) }),
|
|
186
|
+
(uiOptions.description || schema.description) && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_antd2.Col, { span: 24, style: DESCRIPTION_COL_STYLE, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
187
|
+
ArrayFieldDescriptionTemplate,
|
|
188
|
+
{
|
|
189
|
+
description: uiOptions.description || schema.description,
|
|
190
|
+
idSchema,
|
|
191
|
+
schema,
|
|
192
|
+
uiSchema,
|
|
193
|
+
registry
|
|
194
|
+
}
|
|
195
|
+
) }),
|
|
196
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_antd2.Col, { className: "row array-item-list", span: 24, children: items && items.map(({ key, ...itemProps }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ArrayFieldItemTemplate2, { ...itemProps }, key)) }),
|
|
197
|
+
canAdd && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_antd2.Col, { span: 24, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_antd2.Row, { gutter: rowGutter, justify: "end", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_antd2.Col, { flex: "192px", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
198
|
+
AddButton2,
|
|
199
|
+
{
|
|
200
|
+
className: "array-item-add",
|
|
201
|
+
disabled: disabled || readonly,
|
|
202
|
+
onClick: onAddClick,
|
|
203
|
+
uiSchema,
|
|
204
|
+
registry
|
|
205
|
+
}
|
|
206
|
+
) }) }) })
|
|
207
|
+
] }) });
|
|
213
208
|
}
|
|
214
209
|
|
|
215
210
|
// src/templates/BaseInputTemplate/index.tsx
|
|
216
|
-
var
|
|
217
|
-
var import_input_number = __toESM(require("antd/lib/input-number"));
|
|
211
|
+
var import_antd3 = require("antd");
|
|
218
212
|
var import_utils2 = require("@rjsf/utils");
|
|
219
213
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
220
214
|
var INPUT_STYLE = {
|
|
@@ -243,7 +237,7 @@ function BaseInputTemplate(props) {
|
|
|
243
237
|
const handleBlur = ({ target }) => onBlur(id, target.value);
|
|
244
238
|
const handleFocus = ({ target }) => onFocus(id, target.value);
|
|
245
239
|
const input = inputProps.type === "number" || inputProps.type === "integer" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
246
|
-
|
|
240
|
+
import_antd3.InputNumber,
|
|
247
241
|
{
|
|
248
242
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
249
243
|
id,
|
|
@@ -259,7 +253,7 @@ function BaseInputTemplate(props) {
|
|
|
259
253
|
"aria-describedby": (0, import_utils2.ariaDescribedByIds)(id, !!schema.examples)
|
|
260
254
|
}
|
|
261
255
|
) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
262
|
-
|
|
256
|
+
import_antd3.Input,
|
|
263
257
|
{
|
|
264
258
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
265
259
|
id,
|
|
@@ -294,9 +288,7 @@ function DescriptionField(props) {
|
|
|
294
288
|
}
|
|
295
289
|
|
|
296
290
|
// src/templates/ErrorList/index.tsx
|
|
297
|
-
var
|
|
298
|
-
var import_list = __toESM(require("antd/lib/list"));
|
|
299
|
-
var import_space = __toESM(require("antd/lib/space"));
|
|
291
|
+
var import_antd4 = require("antd");
|
|
300
292
|
var import_ExclamationCircleOutlined = __toESM(require("@ant-design/icons/ExclamationCircleOutlined"));
|
|
301
293
|
var import_utils3 = require("@rjsf/utils");
|
|
302
294
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
@@ -305,12 +297,12 @@ function ErrorList({
|
|
|
305
297
|
registry
|
|
306
298
|
}) {
|
|
307
299
|
const { translateString } = registry;
|
|
308
|
-
const renderErrors = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
300
|
+
const renderErrors = () => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd4.List, { className: "list-group", size: "small", children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_antd4.List.Item, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_antd4.Space, { children: [
|
|
309
301
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_ExclamationCircleOutlined.default, {}),
|
|
310
302
|
error.stack
|
|
311
303
|
] }) }, index)) });
|
|
312
304
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
313
|
-
|
|
305
|
+
import_antd4.Alert,
|
|
314
306
|
{
|
|
315
307
|
className: "panel panel-danger errors",
|
|
316
308
|
description: renderErrors(),
|
|
@@ -321,7 +313,7 @@ function ErrorList({
|
|
|
321
313
|
}
|
|
322
314
|
|
|
323
315
|
// src/templates/IconButton/index.tsx
|
|
324
|
-
var
|
|
316
|
+
var import_antd5 = require("antd");
|
|
325
317
|
var import_ArrowDownOutlined = __toESM(require("@ant-design/icons/ArrowDownOutlined"));
|
|
326
318
|
var import_ArrowUpOutlined = __toESM(require("@ant-design/icons/ArrowUpOutlined"));
|
|
327
319
|
var import_CopyOutlined = __toESM(require("@ant-design/icons/CopyOutlined"));
|
|
@@ -332,7 +324,7 @@ var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
|
332
324
|
function IconButton(props) {
|
|
333
325
|
const { iconType = "default", icon, onClick, uiSchema, registry, ...otherProps } = props;
|
|
334
326
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
335
|
-
|
|
327
|
+
import_antd5.Button,
|
|
336
328
|
{
|
|
337
329
|
onClick,
|
|
338
330
|
type: iconType,
|
|
@@ -405,7 +397,7 @@ function FieldErrorTemplate(props) {
|
|
|
405
397
|
}
|
|
406
398
|
|
|
407
399
|
// src/templates/FieldTemplate/index.tsx
|
|
408
|
-
var
|
|
400
|
+
var import_antd6 = require("antd");
|
|
409
401
|
var import_utils6 = require("@rjsf/utils");
|
|
410
402
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
411
403
|
var VERTICAL_LABEL_COL = { span: 24 };
|
|
@@ -478,7 +470,7 @@ function FieldTemplate(props) {
|
|
|
478
470
|
uiSchema,
|
|
479
471
|
registry,
|
|
480
472
|
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
481
|
-
|
|
473
|
+
import_antd6.Form.Item,
|
|
482
474
|
{
|
|
483
475
|
colon,
|
|
484
476
|
hasFeedback: schema.type !== "array" && schema.type !== "object",
|
|
@@ -504,9 +496,8 @@ var import_isObject = __toESM(require("lodash/isObject"));
|
|
|
504
496
|
var import_isNumber = __toESM(require("lodash/isNumber"));
|
|
505
497
|
var import_isString = __toESM(require("lodash/isString"));
|
|
506
498
|
var import_utils7 = require("@rjsf/utils");
|
|
507
|
-
var
|
|
508
|
-
var
|
|
509
|
-
var import_context2 = require("antd/lib/config-provider/context");
|
|
499
|
+
var import_antd7 = require("antd");
|
|
500
|
+
var import_react2 = require("react");
|
|
510
501
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
511
502
|
var DESCRIPTION_COL_STYLE2 = {
|
|
512
503
|
paddingBottom: "8px"
|
|
@@ -566,56 +557,54 @@ function ObjectFieldTemplate(props) {
|
|
|
566
557
|
}
|
|
567
558
|
return defaultColSpan;
|
|
568
559
|
};
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.
|
|
580
|
-
|
|
581
|
-
TitleFieldTemplate,
|
|
582
|
-
{
|
|
583
|
-
id: (0, import_utils7.titleId)(idSchema),
|
|
584
|
-
title,
|
|
585
|
-
required,
|
|
586
|
-
schema,
|
|
587
|
-
uiSchema,
|
|
588
|
-
registry
|
|
589
|
-
}
|
|
590
|
-
) }),
|
|
591
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_col3.default, { span: 24, style: DESCRIPTION_COL_STYLE2, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
592
|
-
DescriptionFieldTemplate,
|
|
593
|
-
{
|
|
594
|
-
id: (0, import_utils7.descriptionId)(idSchema),
|
|
595
|
-
description,
|
|
596
|
-
schema,
|
|
597
|
-
uiSchema,
|
|
598
|
-
registry
|
|
599
|
-
}
|
|
600
|
-
) }),
|
|
601
|
-
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_col3.default, { span: calculateColSpan(element), children: element.content }, element.name))
|
|
602
|
-
] }),
|
|
603
|
-
(0, import_utils7.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_col3.default, { span: 24, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_row3.default, { gutter: rowGutter, justify: "end", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_col3.default, { flex: "192px", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
604
|
-
AddButton2,
|
|
560
|
+
const { getPrefixCls } = (0, import_react2.useContext)(import_antd7.ConfigProvider.ConfigContext);
|
|
561
|
+
const prefixCls = getPrefixCls("form");
|
|
562
|
+
const labelClsBasic = `${prefixCls}-item-label`;
|
|
563
|
+
const labelColClassName = (0, import_classnames2.default)(
|
|
564
|
+
labelClsBasic,
|
|
565
|
+
labelAlign === "left" && `${labelClsBasic}-left`
|
|
566
|
+
// labelCol.className,
|
|
567
|
+
);
|
|
568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("fieldset", { id: idSchema.$id, children: [
|
|
569
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_antd7.Row, { gutter: rowGutter, children: [
|
|
570
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_antd7.Col, { className: labelColClassName, span: 24, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
571
|
+
TitleFieldTemplate,
|
|
605
572
|
{
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
573
|
+
id: (0, import_utils7.titleId)(idSchema),
|
|
574
|
+
title,
|
|
575
|
+
required,
|
|
576
|
+
schema,
|
|
577
|
+
uiSchema,
|
|
578
|
+
registry
|
|
579
|
+
}
|
|
580
|
+
) }),
|
|
581
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_antd7.Col, { span: 24, style: DESCRIPTION_COL_STYLE2, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
582
|
+
DescriptionFieldTemplate,
|
|
583
|
+
{
|
|
584
|
+
id: (0, import_utils7.descriptionId)(idSchema),
|
|
585
|
+
description,
|
|
586
|
+
schema,
|
|
609
587
|
uiSchema,
|
|
610
588
|
registry
|
|
611
589
|
}
|
|
612
|
-
) })
|
|
613
|
-
|
|
614
|
-
|
|
590
|
+
) }),
|
|
591
|
+
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_antd7.Col, { span: calculateColSpan(element), children: element.content }, element.name))
|
|
592
|
+
] }),
|
|
593
|
+
(0, import_utils7.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_antd7.Col, { span: 24, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_antd7.Row, { gutter: rowGutter, justify: "end", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_antd7.Col, { flex: "192px", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
594
|
+
AddButton2,
|
|
595
|
+
{
|
|
596
|
+
className: "object-property-expand",
|
|
597
|
+
disabled: disabled || readonly,
|
|
598
|
+
onClick: onAddClick(schema),
|
|
599
|
+
uiSchema,
|
|
600
|
+
registry
|
|
601
|
+
}
|
|
602
|
+
) }) }) })
|
|
603
|
+
] });
|
|
615
604
|
}
|
|
616
605
|
|
|
617
606
|
// src/templates/SubmitButton/index.tsx
|
|
618
|
-
var
|
|
607
|
+
var import_antd8 = require("antd");
|
|
619
608
|
var import_utils8 = require("@rjsf/utils");
|
|
620
609
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
621
610
|
function SubmitButton({ uiSchema }) {
|
|
@@ -623,12 +612,13 @@ function SubmitButton({ uiSchema }) {
|
|
|
623
612
|
if (norender) {
|
|
624
613
|
return null;
|
|
625
614
|
}
|
|
626
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_antd8.Button, { type: "submit", ...submitButtonProps, htmlType: "submit", children: submitText });
|
|
627
616
|
}
|
|
628
617
|
|
|
629
618
|
// src/templates/TitleField/index.tsx
|
|
630
619
|
var import_classnames3 = __toESM(require("classnames"));
|
|
631
|
-
var
|
|
620
|
+
var import_antd9 = require("antd");
|
|
621
|
+
var import_react3 = require("react");
|
|
632
622
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
633
623
|
function TitleField({
|
|
634
624
|
id,
|
|
@@ -651,31 +641,26 @@ function TitleField({
|
|
|
651
641
|
control.focus();
|
|
652
642
|
}
|
|
653
643
|
};
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
);
|
|
671
|
-
} }) : null;
|
|
644
|
+
const { getPrefixCls } = (0, import_react3.useContext)(import_antd9.ConfigProvider.ConfigContext);
|
|
645
|
+
const prefixCls = getPrefixCls("form");
|
|
646
|
+
const labelClassName = (0, import_classnames3.default)({
|
|
647
|
+
[`${prefixCls}-item-required`]: required,
|
|
648
|
+
[`${prefixCls}-item-no-colon`]: !colon
|
|
649
|
+
});
|
|
650
|
+
return title ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
651
|
+
"label",
|
|
652
|
+
{
|
|
653
|
+
className: labelClassName,
|
|
654
|
+
htmlFor: id,
|
|
655
|
+
onClick: handleLabelClick,
|
|
656
|
+
title: typeof title === "string" ? title : "",
|
|
657
|
+
children: labelChildren
|
|
658
|
+
}
|
|
659
|
+
) : null;
|
|
672
660
|
}
|
|
673
661
|
|
|
674
662
|
// src/templates/WrapIfAdditionalTemplate/index.tsx
|
|
675
|
-
var
|
|
676
|
-
var import_form2 = __toESM(require("antd/lib/form"));
|
|
677
|
-
var import_input2 = __toESM(require("antd/lib/input"));
|
|
678
|
-
var import_row4 = __toESM(require("antd/lib/row"));
|
|
663
|
+
var import_antd10 = require("antd");
|
|
679
664
|
var import_utils9 = require("@rjsf/utils");
|
|
680
665
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
681
666
|
var VERTICAL_LABEL_COL2 = { span: 24 };
|
|
@@ -721,9 +706,9 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
721
706
|
...uiSchema,
|
|
722
707
|
[import_utils9.UI_OPTIONS_KEY]: { ...uiOptions, block: true }
|
|
723
708
|
};
|
|
724
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: classNames4, style, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
725
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
726
|
-
|
|
709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: classNames4, style, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_antd10.Row, { align: toolbarAlign, gutter: rowGutter, children: [
|
|
710
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd10.Col, { className: "form-additional", flex: "1", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "form-group", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
711
|
+
import_antd10.Form.Item,
|
|
727
712
|
{
|
|
728
713
|
colon,
|
|
729
714
|
className: "form-group",
|
|
@@ -735,7 +720,7 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
735
720
|
style: wrapperStyle,
|
|
736
721
|
wrapperCol,
|
|
737
722
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
738
|
-
|
|
723
|
+
import_antd10.Input,
|
|
739
724
|
{
|
|
740
725
|
className: "form-control",
|
|
741
726
|
defaultValue: label,
|
|
@@ -749,8 +734,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
749
734
|
)
|
|
750
735
|
}
|
|
751
736
|
) }) }),
|
|
752
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
753
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
737
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd10.Col, { className: "form-additional", flex: "1", children }),
|
|
738
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_antd10.Col, { flex: "192px", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
754
739
|
RemoveButton2,
|
|
755
740
|
{
|
|
756
741
|
className: "array-item-remove",
|
|
@@ -789,10 +774,8 @@ function generateTemplates() {
|
|
|
789
774
|
var templates_default = generateTemplates();
|
|
790
775
|
|
|
791
776
|
// src/widgets/AltDateWidget/index.tsx
|
|
792
|
-
var
|
|
793
|
-
var
|
|
794
|
-
var import_col5 = __toESM(require("antd/lib/col"));
|
|
795
|
-
var import_row5 = __toESM(require("antd/lib/row"));
|
|
777
|
+
var import_react4 = require("react");
|
|
778
|
+
var import_antd11 = require("antd");
|
|
796
779
|
var import_utils10 = require("@rjsf/utils");
|
|
797
780
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
798
781
|
var rangeOptions = (start, stop) => {
|
|
@@ -823,8 +806,8 @@ function AltDateWidget(props) {
|
|
|
823
806
|
const { translateString, widgets } = registry;
|
|
824
807
|
const { SelectWidget: SelectWidget2 } = widgets;
|
|
825
808
|
const { rowGutter = 24 } = formContext;
|
|
826
|
-
const [state, setState] = (0,
|
|
827
|
-
(0,
|
|
809
|
+
const [state, setState] = (0, import_react4.useState)((0, import_utils10.parseDateString)(value, showTime));
|
|
810
|
+
(0, import_react4.useEffect)(() => {
|
|
828
811
|
setState((0, import_utils10.parseDateString)(value, showTime));
|
|
829
812
|
}, [showTime, value]);
|
|
830
813
|
const handleChange = (property, nextValue) => {
|
|
@@ -876,7 +859,7 @@ function AltDateWidget(props) {
|
|
|
876
859
|
"aria-describedby": (0, import_utils10.ariaDescribedByIds)(id)
|
|
877
860
|
}
|
|
878
861
|
);
|
|
879
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_antd11.Row, { gutter: [Math.floor(rowGutter / 2), Math.floor(rowGutter / 2)], children: [
|
|
880
863
|
(0, import_utils10.getDateElementProps)(
|
|
881
864
|
state,
|
|
882
865
|
showTime,
|
|
@@ -884,7 +867,7 @@ function AltDateWidget(props) {
|
|
|
884
867
|
options.format
|
|
885
868
|
).map((elemProps, i) => {
|
|
886
869
|
const elemId = id + "_" + elemProps.type;
|
|
887
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd11.Col, { flex: "88px", children: renderDateElement({
|
|
888
871
|
...elemProps,
|
|
889
872
|
autofocus: autofocus && i === 0,
|
|
890
873
|
disabled,
|
|
@@ -900,8 +883,8 @@ function AltDateWidget(props) {
|
|
|
900
883
|
value: elemProps.value || -1 < 0 ? void 0 : elemProps.value
|
|
901
884
|
}) }, elemId);
|
|
902
885
|
}),
|
|
903
|
-
!options.hideNowButton && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
904
|
-
!options.hideClearButton && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
886
|
+
!options.hideNowButton && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd11.Col, { flex: "88px", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd11.Button, { block: true, className: "btn-now", onClick: handleNow, type: "primary", children: translateString(import_utils10.TranslatableString.NowLabel) }) }),
|
|
887
|
+
!options.hideClearButton && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd11.Col, { flex: "88px", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_antd11.Button, { block: true, className: "btn-clear", danger: true, onClick: handleClear, type: "primary", children: translateString(import_utils10.TranslatableString.ClearLabel) }) })
|
|
905
888
|
] });
|
|
906
889
|
}
|
|
907
890
|
AltDateWidget.defaultProps = {
|
|
@@ -926,7 +909,7 @@ AltDateTimeWidget.defaultProps = {
|
|
|
926
909
|
};
|
|
927
910
|
|
|
928
911
|
// src/widgets/CheckboxesWidget/index.tsx
|
|
929
|
-
var
|
|
912
|
+
var import_antd12 = require("antd");
|
|
930
913
|
var import_utils11 = require("@rjsf/utils");
|
|
931
914
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
932
915
|
function CheckboxesWidget({ autofocus, disabled, formContext, id, onBlur, onChange, onFocus, options, readonly, value }) {
|
|
@@ -942,7 +925,7 @@ function CheckboxesWidget({ autofocus, disabled, formContext, id, onBlur, onChan
|
|
|
942
925
|
};
|
|
943
926
|
const selectedIndexes = (0, import_utils11.enumOptionsIndexForValue)(value, enumOptions, true);
|
|
944
927
|
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
945
|
-
|
|
928
|
+
import_antd12.Checkbox.Group,
|
|
946
929
|
{
|
|
947
930
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
948
931
|
name: id,
|
|
@@ -952,7 +935,7 @@ function CheckboxesWidget({ autofocus, disabled, formContext, id, onBlur, onChan
|
|
|
952
935
|
"aria-describedby": (0, import_utils11.ariaDescribedByIds)(id),
|
|
953
936
|
children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("span", { children: [
|
|
954
937
|
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
955
|
-
|
|
938
|
+
import_antd12.Checkbox,
|
|
956
939
|
{
|
|
957
940
|
id: (0, import_utils11.optionId)(id, i),
|
|
958
941
|
name: id,
|
|
@@ -969,7 +952,7 @@ function CheckboxesWidget({ autofocus, disabled, formContext, id, onBlur, onChan
|
|
|
969
952
|
}
|
|
970
953
|
|
|
971
954
|
// src/widgets/CheckboxWidget/index.tsx
|
|
972
|
-
var
|
|
955
|
+
var import_antd13 = require("antd");
|
|
973
956
|
var import_utils12 = require("@rjsf/utils");
|
|
974
957
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
975
958
|
function CheckboxWidget(props) {
|
|
@@ -983,7 +966,7 @@ function CheckboxWidget(props) {
|
|
|
983
966
|
onFocus: !readonly ? handleFocus : void 0
|
|
984
967
|
};
|
|
985
968
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
986
|
-
|
|
969
|
+
import_antd13.Checkbox,
|
|
987
970
|
{
|
|
988
971
|
autoFocus: autofocus,
|
|
989
972
|
checked: typeof value === "undefined" ? false : value,
|
|
@@ -1001,7 +984,7 @@ function CheckboxWidget(props) {
|
|
|
1001
984
|
// src/widgets/DateTimeWidget/index.tsx
|
|
1002
985
|
var import_dayjs = __toESM(require("dayjs"));
|
|
1003
986
|
var import_utils13 = require("@rjsf/utils");
|
|
1004
|
-
var
|
|
987
|
+
var import_antd14 = require("antd");
|
|
1005
988
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1006
989
|
var DATE_PICKER_STYLE = {
|
|
1007
990
|
width: "100%"
|
|
@@ -1014,7 +997,7 @@ function DateTimeWidget(props) {
|
|
|
1014
997
|
const handleFocus = () => onFocus(id, value);
|
|
1015
998
|
const getPopupContainer = (node) => node.parentNode;
|
|
1016
999
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1017
|
-
|
|
1000
|
+
import_antd14.DatePicker,
|
|
1018
1001
|
{
|
|
1019
1002
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1020
1003
|
getPopupContainer,
|
|
@@ -1035,7 +1018,7 @@ function DateTimeWidget(props) {
|
|
|
1035
1018
|
// src/widgets/DateWidget/index.tsx
|
|
1036
1019
|
var import_dayjs2 = __toESM(require("dayjs"));
|
|
1037
1020
|
var import_utils14 = require("@rjsf/utils");
|
|
1038
|
-
var
|
|
1021
|
+
var import_antd15 = require("antd");
|
|
1039
1022
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1040
1023
|
var DATE_PICKER_STYLE2 = {
|
|
1041
1024
|
width: "100%"
|
|
@@ -1048,7 +1031,7 @@ function DateWidget(props) {
|
|
|
1048
1031
|
const handleFocus = () => onFocus(id, value);
|
|
1049
1032
|
const getPopupContainer = (node) => node.parentNode;
|
|
1050
1033
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1051
|
-
|
|
1034
|
+
import_antd15.DatePicker,
|
|
1052
1035
|
{
|
|
1053
1036
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1054
1037
|
getPopupContainer,
|
|
@@ -1067,7 +1050,7 @@ function DateWidget(props) {
|
|
|
1067
1050
|
}
|
|
1068
1051
|
|
|
1069
1052
|
// src/widgets/PasswordWidget/index.tsx
|
|
1070
|
-
var
|
|
1053
|
+
var import_antd16 = require("antd");
|
|
1071
1054
|
var import_utils15 = require("@rjsf/utils");
|
|
1072
1055
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1073
1056
|
function PasswordWidget(props) {
|
|
@@ -1078,7 +1061,7 @@ function PasswordWidget(props) {
|
|
|
1078
1061
|
const handleBlur = ({ target }) => onBlur(id, target.value);
|
|
1079
1062
|
const handleFocus = ({ target }) => onFocus(id, target.value);
|
|
1080
1063
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1081
|
-
|
|
1064
|
+
import_antd16.Input.Password,
|
|
1082
1065
|
{
|
|
1083
1066
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1084
1067
|
id,
|
|
@@ -1094,7 +1077,7 @@ function PasswordWidget(props) {
|
|
|
1094
1077
|
}
|
|
1095
1078
|
|
|
1096
1079
|
// src/widgets/RadioWidget/index.tsx
|
|
1097
|
-
var
|
|
1080
|
+
var import_antd17 = require("antd");
|
|
1098
1081
|
var import_utils16 = require("@rjsf/utils");
|
|
1099
1082
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1100
1083
|
function RadioWidget({
|
|
@@ -1116,7 +1099,7 @@ function RadioWidget({
|
|
|
1116
1099
|
const handleFocus = ({ target }) => onFocus(id, (0, import_utils16.enumOptionsValueForIndex)(target.value, enumOptions, emptyValue));
|
|
1117
1100
|
const selectedIndexes = (0, import_utils16.enumOptionsIndexForValue)(value, enumOptions);
|
|
1118
1101
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1119
|
-
|
|
1102
|
+
import_antd17.Radio.Group,
|
|
1120
1103
|
{
|
|
1121
1104
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1122
1105
|
id,
|
|
@@ -1127,7 +1110,7 @@ function RadioWidget({
|
|
|
1127
1110
|
value: selectedIndexes,
|
|
1128
1111
|
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id),
|
|
1129
1112
|
children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1130
|
-
|
|
1113
|
+
import_antd17.Radio,
|
|
1131
1114
|
{
|
|
1132
1115
|
id: (0, import_utils16.optionId)(id, i),
|
|
1133
1116
|
name: id,
|
|
@@ -1143,7 +1126,7 @@ function RadioWidget({
|
|
|
1143
1126
|
}
|
|
1144
1127
|
|
|
1145
1128
|
// src/widgets/RangeWidget/index.tsx
|
|
1146
|
-
var
|
|
1129
|
+
var import_antd18 = require("antd");
|
|
1147
1130
|
var import_utils17 = require("@rjsf/utils");
|
|
1148
1131
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1149
1132
|
function RangeWidget(props) {
|
|
@@ -1173,7 +1156,7 @@ function RangeWidget(props) {
|
|
|
1173
1156
|
onFocus: !readonly ? handleFocus : void 0
|
|
1174
1157
|
};
|
|
1175
1158
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1176
|
-
|
|
1159
|
+
import_antd18.Slider,
|
|
1177
1160
|
{
|
|
1178
1161
|
autoFocus: autofocus,
|
|
1179
1162
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
@@ -1191,7 +1174,7 @@ function RangeWidget(props) {
|
|
|
1191
1174
|
}
|
|
1192
1175
|
|
|
1193
1176
|
// src/widgets/SelectWidget/index.tsx
|
|
1194
|
-
var
|
|
1177
|
+
var import_antd19 = require("antd");
|
|
1195
1178
|
var import_utils18 = require("@rjsf/utils");
|
|
1196
1179
|
var import_isString2 = __toESM(require("lodash/isString"));
|
|
1197
1180
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
@@ -1229,7 +1212,7 @@ function SelectWidget({
|
|
|
1229
1212
|
name: id
|
|
1230
1213
|
};
|
|
1231
1214
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1232
|
-
|
|
1215
|
+
import_antd19.Select,
|
|
1233
1216
|
{
|
|
1234
1217
|
autoFocus: autofocus,
|
|
1235
1218
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
@@ -1256,7 +1239,7 @@ function SelectWidget({
|
|
|
1256
1239
|
}
|
|
1257
1240
|
|
|
1258
1241
|
// src/widgets/TextareaWidget/index.tsx
|
|
1259
|
-
var
|
|
1242
|
+
var import_antd20 = require("antd");
|
|
1260
1243
|
var import_utils19 = require("@rjsf/utils");
|
|
1261
1244
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1262
1245
|
var INPUT_STYLE3 = {
|
|
@@ -1282,7 +1265,7 @@ function TextareaWidget({
|
|
|
1282
1265
|
type: "textarea"
|
|
1283
1266
|
};
|
|
1284
1267
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1285
|
-
|
|
1268
|
+
import_antd20.Input.TextArea,
|
|
1286
1269
|
{
|
|
1287
1270
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1288
1271
|
id,
|