@rjsf/antd 5.11.2 → 5.12.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 +891 -1117
- package/dist/antd.esm.js.map +7 -1
- package/dist/antd.umd.js +1184 -0
- package/dist/index.js +1347 -5
- package/dist/index.js.map +7 -0
- package/lib/components/DatePicker/index.d.ts +48 -0
- package/lib/components/DatePicker/index.js +5 -0
- package/lib/components/DatePicker/index.js.map +1 -0
- package/lib/index.d.ts +11 -0
- package/lib/index.js +17 -0
- package/lib/index.js.map +1 -0
- package/lib/templates/ArrayFieldItemTemplate/index.d.ts +7 -0
- package/lib/templates/ArrayFieldItemTemplate/index.js +21 -0
- package/lib/templates/ArrayFieldItemTemplate/index.js.map +1 -0
- package/lib/templates/ArrayFieldTemplate/index.d.ts +7 -0
- package/lib/templates/ArrayFieldTemplate/index.js +38 -0
- package/lib/templates/ArrayFieldTemplate/index.js.map +1 -0
- package/lib/templates/BaseInputTemplate/index.d.ts +9 -0
- package/lib/templates/BaseInputTemplate/index.js +31 -0
- package/lib/templates/BaseInputTemplate/index.js.map +1 -0
- package/lib/templates/DescriptionField/index.d.ts +7 -0
- package/lib/templates/DescriptionField/index.js +13 -0
- package/lib/templates/DescriptionField/index.js.map +1 -0
- package/lib/templates/ErrorList/index.d.ts +7 -0
- package/lib/templates/ErrorList/index.js +16 -0
- package/lib/templates/ErrorList/index.js.map +1 -0
- package/lib/templates/FieldErrorTemplate/index.d.ts +7 -0
- package/lib/templates/FieldErrorTemplate/index.js +15 -0
- package/lib/templates/FieldErrorTemplate/index.js.map +1 -0
- package/lib/templates/FieldTemplate/index.d.ts +8 -0
- package/lib/templates/FieldTemplate/index.js +34 -0
- package/lib/templates/FieldTemplate/index.js.map +1 -0
- package/lib/templates/IconButton/index.d.ts +10 -0
- package/lib/templates/IconButton/index.js +36 -0
- package/lib/templates/IconButton/index.js.map +1 -0
- package/lib/templates/ObjectFieldTemplate/index.d.ts +9 -0
- package/lib/templates/ObjectFieldTemplate/index.js +71 -0
- package/lib/templates/ObjectFieldTemplate/index.js.map +1 -0
- package/lib/templates/SubmitButton/index.d.ts +5 -0
- package/lib/templates/SubmitButton/index.js +13 -0
- package/lib/templates/SubmitButton/index.js.map +1 -0
- package/lib/templates/TitleField/index.d.ts +7 -0
- package/lib/templates/TitleField/index.js +34 -0
- package/lib/templates/TitleField/index.js.map +1 -0
- package/lib/templates/WrapIfAdditionalTemplate/index.d.ts +8 -0
- package/lib/templates/WrapIfAdditionalTemplate/index.js +34 -0
- package/lib/templates/WrapIfAdditionalTemplate/index.js.map +1 -0
- package/lib/templates/index.d.ts +4 -0
- package/lib/templates/index.js +36 -0
- package/lib/templates/index.js.map +1 -0
- package/lib/widgets/AltDateTimeWidget/index.d.ts +15 -0
- package/lib/widgets/AltDateTimeWidget/index.js +8 -0
- package/lib/widgets/AltDateTimeWidget/index.js.map +1 -0
- package/lib/widgets/AltDateWidget/index.d.ts +15 -0
- package/lib/widgets/AltDateWidget/index.js +89 -0
- package/lib/widgets/AltDateWidget/index.js.map +1 -0
- package/lib/widgets/CheckboxWidget/index.d.ts +8 -0
- package/lib/widgets/CheckboxWidget/index.js +23 -0
- package/lib/widgets/CheckboxWidget/index.js.map +1 -0
- package/lib/widgets/CheckboxesWidget/index.d.ts +8 -0
- package/lib/widgets/CheckboxesWidget/index.js +26 -0
- package/lib/widgets/CheckboxesWidget/index.js.map +1 -0
- package/lib/widgets/DateTimeWidget/index.d.ts +8 -0
- package/lib/widgets/DateTimeWidget/index.js +22 -0
- package/lib/widgets/DateTimeWidget/index.js.map +1 -0
- package/lib/widgets/DateWidget/index.d.ts +8 -0
- package/lib/widgets/DateWidget/index.js +22 -0
- package/lib/widgets/DateWidget/index.js.map +1 -0
- package/lib/widgets/PasswordWidget/index.d.ts +7 -0
- package/lib/widgets/PasswordWidget/index.js +17 -0
- package/lib/widgets/PasswordWidget/index.js.map +1 -0
- package/lib/widgets/RadioWidget/index.d.ts +8 -0
- package/lib/widgets/RadioWidget/index.js +19 -0
- package/lib/widgets/RadioWidget/index.js.map +1 -0
- package/lib/widgets/RangeWidget/index.d.ts +8 -0
- package/lib/widgets/RangeWidget/index.js +26 -0
- package/lib/widgets/RangeWidget/index.js.map +1 -0
- package/lib/widgets/SelectWidget/index.d.ts +8 -0
- package/lib/widgets/SelectWidget/index.js +36 -0
- package/lib/widgets/SelectWidget/index.js.map +1 -0
- package/lib/widgets/TextareaWidget/index.d.ts +7 -0
- package/lib/widgets/TextareaWidget/index.js +23 -0
- package/lib/widgets/TextareaWidget/index.js.map +1 -0
- package/lib/widgets/index.d.ts +4 -0
- package/lib/widgets/index.js +28 -0
- package/lib/widgets/index.js.map +1 -0
- package/package.json +24 -16
- package/src/components/DatePicker/index.ts +6 -0
- package/src/index.less +38 -0
- package/src/index.ts +33 -0
- package/src/templates/ArrayFieldItemTemplate/index.tsx +90 -0
- package/src/templates/ArrayFieldTemplate/index.tsx +132 -0
- package/src/templates/BaseInputTemplate/index.tsx +105 -0
- package/src/templates/DescriptionField/index.tsx +17 -0
- package/src/templates/ErrorList/index.tsx +37 -0
- package/src/templates/FieldErrorTemplate/index.tsx +25 -0
- package/src/templates/FieldTemplate/index.tsx +114 -0
- package/src/templates/IconButton/index.tsx +94 -0
- package/src/templates/ObjectFieldTemplate/index.tsx +175 -0
- package/src/templates/SubmitButton/index.tsx +20 -0
- package/src/templates/TitleField/index.tsx +57 -0
- package/src/templates/WrapIfAdditionalTemplate/index.tsx +124 -0
- package/src/templates/index.ts +43 -0
- package/src/widgets/AltDateTimeWidget/index.tsx +17 -0
- package/src/widgets/AltDateWidget/index.tsx +197 -0
- package/src/widgets/CheckboxWidget/index.tsx +52 -0
- package/src/widgets/CheckboxesWidget/index.tsx +75 -0
- package/src/widgets/DateTimeWidget/index.tsx +54 -0
- package/src/widgets/DateWidget/index.tsx +52 -0
- package/src/widgets/PasswordWidget/index.tsx +46 -0
- package/src/widgets/RadioWidget/index.tsx +73 -0
- package/src/widgets/RangeWidget/index.tsx +69 -0
- package/src/widgets/SelectWidget/index.tsx +97 -0
- package/src/widgets/TextareaWidget/index.tsx +67 -0
- package/src/widgets/index.ts +35 -0
- package/dist/antd.cjs.development.js +0 -1643
- package/dist/antd.cjs.development.js.map +0 -1
- package/dist/antd.cjs.production.min.js +0 -2
- package/dist/antd.cjs.production.min.js.map +0 -1
- package/dist/antd.umd.development.js +0 -1617
- package/dist/antd.umd.development.js.map +0 -1
- package/dist/antd.umd.production.min.js +0 -2
- package/dist/antd.umd.production.min.js.map +0 -1
- package/dist/index.d.ts +0 -16
package/dist/antd.esm.js
CHANGED
|
@@ -1,45 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import Button from 'antd/es/button';
|
|
4
|
-
import Col from 'antd/es/col';
|
|
5
|
-
import Row from 'antd/es/row';
|
|
6
|
-
import { getUiOptions, getTemplate, getInputProps, examplesId, ariaDescribedByIds, TranslatableString, errorId, titleId, descriptionId, canExpand, getSubmitButtonOptions, ADDITIONAL_PROPERTY_FLAG, UI_OPTIONS_KEY, parseDateString, toDateString, pad, enumOptionsIndexForValue, optionId, enumOptionsValueForIndex, labelValue, rangeSpec } from '@rjsf/utils';
|
|
7
|
-
import classNames from 'classnames';
|
|
8
|
-
import { ConfigConsumer } from 'antd/es/config-provider/context';
|
|
9
|
-
import Input from 'antd/es/input';
|
|
10
|
-
import InputNumber from 'antd/es/input-number';
|
|
11
|
-
import Alert from 'antd/es/alert';
|
|
12
|
-
import List from 'antd/es/list';
|
|
13
|
-
import Space from 'antd/es/space';
|
|
14
|
-
import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined';
|
|
15
|
-
import ArrowDownOutlined from '@ant-design/icons/ArrowDownOutlined';
|
|
16
|
-
import ArrowUpOutlined from '@ant-design/icons/ArrowUpOutlined';
|
|
17
|
-
import CopyOutlined from '@ant-design/icons/CopyOutlined';
|
|
18
|
-
import DeleteOutlined from '@ant-design/icons/DeleteOutlined';
|
|
19
|
-
import PlusCircleOutlined from '@ant-design/icons/PlusCircleOutlined';
|
|
20
|
-
import Form$1 from 'antd/es/form';
|
|
21
|
-
import isObject from 'lodash-es/isObject';
|
|
22
|
-
import isNumber from 'lodash-es/isNumber';
|
|
23
|
-
import isString from 'lodash-es/isString';
|
|
24
|
-
import { useState, useEffect } from 'react';
|
|
25
|
-
import Checkbox from 'antd/es/checkbox';
|
|
26
|
-
import dayjs from 'dayjs';
|
|
27
|
-
import dayjsGenerateConfig from 'rc-picker/es/generate/dayjs';
|
|
28
|
-
import generatePicker from 'antd/es/date-picker/generatePicker';
|
|
29
|
-
import Radio from 'antd/es/radio';
|
|
30
|
-
import Slider from 'antd/es/slider';
|
|
31
|
-
import Select from 'antd/es/select';
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { withTheme } from "@rjsf/core";
|
|
32
3
|
|
|
33
|
-
|
|
34
|
-
|
|
4
|
+
// src/templates/ArrayFieldItemTemplate/index.tsx
|
|
5
|
+
import Button from "antd/lib/button";
|
|
6
|
+
import Col from "antd/lib/col";
|
|
7
|
+
import Row from "antd/lib/row";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var BTN_GRP_STYLE = {
|
|
10
|
+
width: "100%"
|
|
35
11
|
};
|
|
36
|
-
|
|
37
|
-
width:
|
|
12
|
+
var BTN_STYLE = {
|
|
13
|
+
width: "calc(100% / 4)"
|
|
38
14
|
};
|
|
39
|
-
/** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
|
|
40
|
-
*
|
|
41
|
-
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
42
|
-
*/
|
|
43
15
|
function ArrayFieldItemTemplate(props) {
|
|
44
16
|
const {
|
|
45
17
|
children,
|
|
@@ -57,63 +29,68 @@ function ArrayFieldItemTemplate(props) {
|
|
|
57
29
|
registry,
|
|
58
30
|
uiSchema
|
|
59
31
|
} = props;
|
|
60
|
-
const {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
toolbarAlign = 'top'
|
|
69
|
-
} = registry.formContext;
|
|
70
|
-
return jsxs(Row, {
|
|
71
|
-
align: toolbarAlign,
|
|
72
|
-
gutter: rowGutter,
|
|
73
|
-
children: [jsx(Col, {
|
|
74
|
-
flex: '1',
|
|
75
|
-
children: children
|
|
76
|
-
}), hasToolbar && jsx(Col, {
|
|
77
|
-
flex: '192px',
|
|
78
|
-
children: jsxs(Button.Group, {
|
|
79
|
-
style: BTN_GRP_STYLE,
|
|
80
|
-
children: [(hasMoveUp || hasMoveDown) && jsx(MoveUpButton, {
|
|
32
|
+
const { CopyButton: CopyButton2, MoveDownButton: MoveDownButton2, MoveUpButton: MoveUpButton2, RemoveButton: RemoveButton2 } = registry.templates.ButtonTemplates;
|
|
33
|
+
const { rowGutter = 24, toolbarAlign = "top" } = registry.formContext;
|
|
34
|
+
return /* @__PURE__ */ jsxs(Row, { align: toolbarAlign, gutter: rowGutter, children: [
|
|
35
|
+
/* @__PURE__ */ jsx(Col, { flex: "1", children }),
|
|
36
|
+
hasToolbar && /* @__PURE__ */ jsx(Col, { flex: "192px", children: /* @__PURE__ */ jsxs(Button.Group, { style: BTN_GRP_STYLE, children: [
|
|
37
|
+
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx(
|
|
38
|
+
MoveUpButton2,
|
|
39
|
+
{
|
|
81
40
|
disabled: disabled || readonly || !hasMoveUp,
|
|
82
41
|
onClick: onReorderClick(index, index - 1),
|
|
83
42
|
style: BTN_STYLE,
|
|
84
|
-
uiSchema
|
|
85
|
-
registry
|
|
86
|
-
}
|
|
43
|
+
uiSchema,
|
|
44
|
+
registry
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
(hasMoveUp || hasMoveDown) && /* @__PURE__ */ jsx(
|
|
48
|
+
MoveDownButton2,
|
|
49
|
+
{
|
|
87
50
|
disabled: disabled || readonly || !hasMoveDown,
|
|
88
51
|
onClick: onReorderClick(index, index + 1),
|
|
89
52
|
style: BTN_STYLE,
|
|
90
|
-
uiSchema
|
|
91
|
-
registry
|
|
92
|
-
}
|
|
53
|
+
uiSchema,
|
|
54
|
+
registry
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
hasCopy && /* @__PURE__ */ jsx(
|
|
58
|
+
CopyButton2,
|
|
59
|
+
{
|
|
93
60
|
disabled: disabled || readonly,
|
|
94
61
|
onClick: onCopyIndexClick(index),
|
|
95
62
|
style: BTN_STYLE,
|
|
96
|
-
uiSchema
|
|
97
|
-
registry
|
|
98
|
-
}
|
|
63
|
+
uiSchema,
|
|
64
|
+
registry
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
hasRemove && /* @__PURE__ */ jsx(
|
|
68
|
+
RemoveButton2,
|
|
69
|
+
{
|
|
99
70
|
disabled: disabled || readonly,
|
|
100
71
|
onClick: onDropIndexClick(index),
|
|
101
72
|
style: BTN_STYLE,
|
|
102
|
-
uiSchema
|
|
103
|
-
registry
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
})
|
|
107
|
-
}, `array-item-${index}`);
|
|
73
|
+
uiSchema,
|
|
74
|
+
registry
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] }) })
|
|
78
|
+
] }, `array-item-${index}`);
|
|
108
79
|
}
|
|
109
80
|
|
|
110
|
-
|
|
111
|
-
|
|
81
|
+
// src/templates/ArrayFieldTemplate/index.tsx
|
|
82
|
+
import {
|
|
83
|
+
getTemplate,
|
|
84
|
+
getUiOptions
|
|
85
|
+
} from "@rjsf/utils";
|
|
86
|
+
import classNames from "classnames";
|
|
87
|
+
import Col2 from "antd/lib/col";
|
|
88
|
+
import Row2 from "antd/lib/row";
|
|
89
|
+
import { ConfigConsumer } from "antd/lib/config-provider/context";
|
|
90
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
91
|
+
var DESCRIPTION_COL_STYLE = {
|
|
92
|
+
paddingBottom: "8px"
|
|
112
93
|
};
|
|
113
|
-
/** The `ArrayFieldTemplate` component is the template used to render all items in an array.
|
|
114
|
-
*
|
|
115
|
-
* @param props - The `ArrayFieldTemplateItemType` props for the component
|
|
116
|
-
*/
|
|
117
94
|
function ArrayFieldTemplate(props) {
|
|
118
95
|
const {
|
|
119
96
|
canAdd,
|
|
@@ -131,97 +108,83 @@ function ArrayFieldTemplate(props) {
|
|
|
131
108
|
uiSchema
|
|
132
109
|
} = props;
|
|
133
110
|
const uiOptions = getUiOptions(uiSchema);
|
|
134
|
-
const ArrayFieldDescriptionTemplate = getTemplate(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
111
|
+
const ArrayFieldDescriptionTemplate = getTemplate(
|
|
112
|
+
"ArrayFieldDescriptionTemplate",
|
|
113
|
+
registry,
|
|
114
|
+
uiOptions
|
|
115
|
+
);
|
|
116
|
+
const ArrayFieldItemTemplate2 = getTemplate(
|
|
117
|
+
"ArrayFieldItemTemplate",
|
|
118
|
+
registry,
|
|
119
|
+
uiOptions
|
|
120
|
+
);
|
|
121
|
+
const ArrayFieldTitleTemplate = getTemplate(
|
|
122
|
+
"ArrayFieldTitleTemplate",
|
|
123
|
+
registry,
|
|
124
|
+
uiOptions
|
|
125
|
+
);
|
|
138
126
|
const {
|
|
139
|
-
ButtonTemplates: {
|
|
140
|
-
AddButton
|
|
141
|
-
}
|
|
127
|
+
ButtonTemplates: { AddButton: AddButton2 }
|
|
142
128
|
} = registry.templates;
|
|
143
|
-
const {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
} = configProps;
|
|
152
|
-
const prefixCls = getPrefixCls('form');
|
|
153
|
-
const labelClsBasic = `${prefixCls}-item-label`;
|
|
154
|
-
const labelColClassName = classNames(labelClsBasic, labelAlign === 'left' && `${labelClsBasic}-left`
|
|
129
|
+
const { labelAlign = "right", rowGutter = 24 } = formContext;
|
|
130
|
+
return /* @__PURE__ */ jsx2(ConfigConsumer, { children: (configProps) => {
|
|
131
|
+
const { getPrefixCls } = configProps;
|
|
132
|
+
const prefixCls = getPrefixCls("form");
|
|
133
|
+
const labelClsBasic = `${prefixCls}-item-label`;
|
|
134
|
+
const labelColClassName = classNames(
|
|
135
|
+
labelClsBasic,
|
|
136
|
+
labelAlign === "left" && `${labelClsBasic}-left`
|
|
155
137
|
// labelCol.className,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}, key))
|
|
193
|
-
}), canAdd && jsx(Col, {
|
|
194
|
-
span: 24,
|
|
195
|
-
children: jsx(Row, {
|
|
196
|
-
gutter: rowGutter,
|
|
197
|
-
justify: 'end',
|
|
198
|
-
children: jsx(Col, {
|
|
199
|
-
flex: '192px',
|
|
200
|
-
children: jsx(AddButton, {
|
|
201
|
-
className: 'array-item-add',
|
|
202
|
-
disabled: disabled || readonly,
|
|
203
|
-
onClick: onAddClick,
|
|
204
|
-
uiSchema: uiSchema,
|
|
205
|
-
registry: registry
|
|
206
|
-
})
|
|
207
|
-
})
|
|
208
|
-
})
|
|
209
|
-
})]
|
|
210
|
-
})
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
});
|
|
138
|
+
);
|
|
139
|
+
return /* @__PURE__ */ jsx2("fieldset", { className, id: idSchema.$id, children: /* @__PURE__ */ jsxs2(Row2, { gutter: rowGutter, children: [
|
|
140
|
+
(uiOptions.title || title) && /* @__PURE__ */ jsx2(Col2, { className: labelColClassName, span: 24, children: /* @__PURE__ */ jsx2(
|
|
141
|
+
ArrayFieldTitleTemplate,
|
|
142
|
+
{
|
|
143
|
+
idSchema,
|
|
144
|
+
required,
|
|
145
|
+
title: uiOptions.title || title,
|
|
146
|
+
schema,
|
|
147
|
+
uiSchema,
|
|
148
|
+
registry
|
|
149
|
+
}
|
|
150
|
+
) }),
|
|
151
|
+
(uiOptions.description || schema.description) && /* @__PURE__ */ jsx2(Col2, { span: 24, style: DESCRIPTION_COL_STYLE, children: /* @__PURE__ */ jsx2(
|
|
152
|
+
ArrayFieldDescriptionTemplate,
|
|
153
|
+
{
|
|
154
|
+
description: uiOptions.description || schema.description,
|
|
155
|
+
idSchema,
|
|
156
|
+
schema,
|
|
157
|
+
uiSchema,
|
|
158
|
+
registry
|
|
159
|
+
}
|
|
160
|
+
) }),
|
|
161
|
+
/* @__PURE__ */ jsx2(Col2, { className: "row array-item-list", span: 24, children: items && items.map(({ key, ...itemProps }) => /* @__PURE__ */ jsx2(ArrayFieldItemTemplate2, { ...itemProps }, key)) }),
|
|
162
|
+
canAdd && /* @__PURE__ */ jsx2(Col2, { span: 24, children: /* @__PURE__ */ jsx2(Row2, { gutter: rowGutter, justify: "end", children: /* @__PURE__ */ jsx2(Col2, { flex: "192px", children: /* @__PURE__ */ jsx2(
|
|
163
|
+
AddButton2,
|
|
164
|
+
{
|
|
165
|
+
className: "array-item-add",
|
|
166
|
+
disabled: disabled || readonly,
|
|
167
|
+
onClick: onAddClick,
|
|
168
|
+
uiSchema,
|
|
169
|
+
registry
|
|
170
|
+
}
|
|
171
|
+
) }) }) })
|
|
172
|
+
] }) });
|
|
173
|
+
} });
|
|
214
174
|
}
|
|
215
175
|
|
|
216
|
-
|
|
217
|
-
|
|
176
|
+
// src/templates/BaseInputTemplate/index.tsx
|
|
177
|
+
import Input from "antd/lib/input";
|
|
178
|
+
import InputNumber from "antd/lib/input-number";
|
|
179
|
+
import {
|
|
180
|
+
ariaDescribedByIds,
|
|
181
|
+
examplesId,
|
|
182
|
+
getInputProps
|
|
183
|
+
} from "@rjsf/utils";
|
|
184
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
185
|
+
var INPUT_STYLE = {
|
|
186
|
+
width: "100%"
|
|
218
187
|
};
|
|
219
|
-
/** The `BaseInputTemplate` is the template to use to render the basic `<input>` component for the `core` theme.
|
|
220
|
-
* It is used as the template for rendering many of the <input> based widgets that differ by `type` and callbacks only.
|
|
221
|
-
* It can be customized/overridden for other themes or individual implementations as needed.
|
|
222
|
-
*
|
|
223
|
-
* @param props - The `WidgetProps` for this template
|
|
224
|
-
*/
|
|
225
188
|
function BaseInputTemplate(props) {
|
|
226
189
|
const {
|
|
227
190
|
disabled,
|
|
@@ -239,222 +202,181 @@ function BaseInputTemplate(props) {
|
|
|
239
202
|
type
|
|
240
203
|
} = props;
|
|
241
204
|
const inputProps = getInputProps(schema, type, options, false);
|
|
242
|
-
const {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
const
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
return jsx("option", {
|
|
287
|
-
value: example
|
|
288
|
-
}, example);
|
|
289
|
-
})
|
|
290
|
-
})]
|
|
291
|
-
});
|
|
205
|
+
const { readonlyAsDisabled = true } = formContext;
|
|
206
|
+
const handleNumberChange = (nextValue) => onChange(nextValue);
|
|
207
|
+
const handleTextChange = onChangeOverride ? onChangeOverride : ({ target }) => onChange(target.value === "" ? options.emptyValue : target.value);
|
|
208
|
+
const handleBlur = ({ target }) => onBlur(id, target.value);
|
|
209
|
+
const handleFocus = ({ target }) => onFocus(id, target.value);
|
|
210
|
+
const input = inputProps.type === "number" || inputProps.type === "integer" ? /* @__PURE__ */ jsx3(
|
|
211
|
+
InputNumber,
|
|
212
|
+
{
|
|
213
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
214
|
+
id,
|
|
215
|
+
name: id,
|
|
216
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
217
|
+
onChange: !readonly ? handleNumberChange : void 0,
|
|
218
|
+
onFocus: !readonly ? handleFocus : void 0,
|
|
219
|
+
placeholder,
|
|
220
|
+
style: INPUT_STYLE,
|
|
221
|
+
list: schema.examples ? examplesId(id) : void 0,
|
|
222
|
+
...inputProps,
|
|
223
|
+
value,
|
|
224
|
+
"aria-describedby": ariaDescribedByIds(id, !!schema.examples)
|
|
225
|
+
}
|
|
226
|
+
) : /* @__PURE__ */ jsx3(
|
|
227
|
+
Input,
|
|
228
|
+
{
|
|
229
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
230
|
+
id,
|
|
231
|
+
name: id,
|
|
232
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
233
|
+
onChange: !readonly ? handleTextChange : void 0,
|
|
234
|
+
onFocus: !readonly ? handleFocus : void 0,
|
|
235
|
+
placeholder,
|
|
236
|
+
style: INPUT_STYLE,
|
|
237
|
+
list: schema.examples ? examplesId(id) : void 0,
|
|
238
|
+
...inputProps,
|
|
239
|
+
value,
|
|
240
|
+
"aria-describedby": ariaDescribedByIds(id, !!schema.examples)
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
244
|
+
input,
|
|
245
|
+
Array.isArray(schema.examples) && /* @__PURE__ */ jsx3("datalist", { id: examplesId(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
|
|
246
|
+
return /* @__PURE__ */ jsx3("option", { value: example }, example);
|
|
247
|
+
}) })
|
|
248
|
+
] });
|
|
292
249
|
}
|
|
293
250
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
* @param props - The `DescriptionFieldProps` for this component
|
|
297
|
-
*/
|
|
251
|
+
// src/templates/DescriptionField/index.tsx
|
|
252
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
298
253
|
function DescriptionField(props) {
|
|
299
|
-
const {
|
|
300
|
-
id,
|
|
301
|
-
description
|
|
302
|
-
} = props;
|
|
254
|
+
const { id, description } = props;
|
|
303
255
|
if (!description) {
|
|
304
256
|
return null;
|
|
305
257
|
}
|
|
306
|
-
return
|
|
307
|
-
id: id,
|
|
308
|
-
children: description
|
|
309
|
-
});
|
|
258
|
+
return /* @__PURE__ */ jsx4("span", { id, children: description });
|
|
310
259
|
}
|
|
311
260
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
261
|
+
// src/templates/ErrorList/index.tsx
|
|
262
|
+
import Alert from "antd/lib/alert";
|
|
263
|
+
import List from "antd/lib/list";
|
|
264
|
+
import Space from "antd/lib/space";
|
|
265
|
+
import ExclamationCircleOutlined from "@ant-design/icons/ExclamationCircleOutlined";
|
|
266
|
+
import { TranslatableString } from "@rjsf/utils";
|
|
267
|
+
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
316
268
|
function ErrorList({
|
|
317
269
|
errors,
|
|
318
270
|
registry
|
|
319
271
|
}) {
|
|
320
|
-
const {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
description: renderErrors(),
|
|
335
|
-
message: translateString(TranslatableString.ErrorsLabel),
|
|
336
|
-
type: 'error'
|
|
337
|
-
});
|
|
272
|
+
const { translateString } = registry;
|
|
273
|
+
const renderErrors = () => /* @__PURE__ */ jsx5(List, { className: "list-group", size: "small", children: errors.map((error, index) => /* @__PURE__ */ jsx5(List.Item, { children: /* @__PURE__ */ jsxs4(Space, { children: [
|
|
274
|
+
/* @__PURE__ */ jsx5(ExclamationCircleOutlined, {}),
|
|
275
|
+
error.stack
|
|
276
|
+
] }) }, index)) });
|
|
277
|
+
return /* @__PURE__ */ jsx5(
|
|
278
|
+
Alert,
|
|
279
|
+
{
|
|
280
|
+
className: "panel panel-danger errors",
|
|
281
|
+
description: renderErrors(),
|
|
282
|
+
message: translateString(TranslatableString.ErrorsLabel),
|
|
283
|
+
type: "error"
|
|
284
|
+
}
|
|
285
|
+
);
|
|
338
286
|
}
|
|
339
287
|
|
|
288
|
+
// src/templates/IconButton/index.tsx
|
|
289
|
+
import Button2 from "antd/lib/button";
|
|
290
|
+
import ArrowDownOutlined from "@ant-design/icons/ArrowDownOutlined";
|
|
291
|
+
import ArrowUpOutlined from "@ant-design/icons/ArrowUpOutlined";
|
|
292
|
+
import CopyOutlined from "@ant-design/icons/CopyOutlined";
|
|
293
|
+
import DeleteOutlined from "@ant-design/icons/DeleteOutlined";
|
|
294
|
+
import PlusCircleOutlined from "@ant-design/icons/PlusCircleOutlined";
|
|
295
|
+
import {
|
|
296
|
+
getUiOptions as getUiOptions2,
|
|
297
|
+
TranslatableString as TranslatableString2
|
|
298
|
+
} from "@rjsf/utils";
|
|
299
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
340
300
|
function IconButton(props) {
|
|
341
|
-
const {
|
|
342
|
-
|
|
343
|
-
icon,
|
|
344
|
-
uiSchema,
|
|
345
|
-
registry,
|
|
346
|
-
...otherProps
|
|
347
|
-
} = props;
|
|
348
|
-
return jsx(Button, {
|
|
349
|
-
type: iconType,
|
|
350
|
-
icon: icon,
|
|
351
|
-
...otherProps
|
|
352
|
-
});
|
|
301
|
+
const { iconType = "default", icon, uiSchema, registry, ...otherProps } = props;
|
|
302
|
+
return /* @__PURE__ */ jsx6(Button2, { type: iconType, icon, ...otherProps });
|
|
353
303
|
}
|
|
354
304
|
function AddButton(props) {
|
|
355
305
|
const {
|
|
356
|
-
registry: {
|
|
357
|
-
translateString
|
|
358
|
-
}
|
|
306
|
+
registry: { translateString }
|
|
359
307
|
} = props;
|
|
360
|
-
return
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
308
|
+
return /* @__PURE__ */ jsx6(
|
|
309
|
+
IconButton,
|
|
310
|
+
{
|
|
311
|
+
title: translateString(TranslatableString2.AddItemButton),
|
|
312
|
+
...props,
|
|
313
|
+
block: true,
|
|
314
|
+
iconType: "primary",
|
|
315
|
+
icon: /* @__PURE__ */ jsx6(PlusCircleOutlined, {})
|
|
316
|
+
}
|
|
317
|
+
);
|
|
367
318
|
}
|
|
368
319
|
function CopyButton(props) {
|
|
369
320
|
const {
|
|
370
|
-
registry: {
|
|
371
|
-
translateString
|
|
372
|
-
}
|
|
321
|
+
registry: { translateString }
|
|
373
322
|
} = props;
|
|
374
|
-
return
|
|
375
|
-
title: translateString(TranslatableString.CopyButton),
|
|
376
|
-
...props,
|
|
377
|
-
icon: jsx(CopyOutlined, {})
|
|
378
|
-
});
|
|
323
|
+
return /* @__PURE__ */ jsx6(IconButton, { title: translateString(TranslatableString2.CopyButton), ...props, icon: /* @__PURE__ */ jsx6(CopyOutlined, {}) });
|
|
379
324
|
}
|
|
380
325
|
function MoveDownButton(props) {
|
|
381
326
|
const {
|
|
382
|
-
registry: {
|
|
383
|
-
translateString
|
|
384
|
-
}
|
|
327
|
+
registry: { translateString }
|
|
385
328
|
} = props;
|
|
386
|
-
return
|
|
387
|
-
title: translateString(TranslatableString.MoveDownButton),
|
|
388
|
-
...props,
|
|
389
|
-
icon: jsx(ArrowDownOutlined, {})
|
|
390
|
-
});
|
|
329
|
+
return /* @__PURE__ */ jsx6(IconButton, { title: translateString(TranslatableString2.MoveDownButton), ...props, icon: /* @__PURE__ */ jsx6(ArrowDownOutlined, {}) });
|
|
391
330
|
}
|
|
392
331
|
function MoveUpButton(props) {
|
|
393
332
|
const {
|
|
394
|
-
registry: {
|
|
395
|
-
translateString
|
|
396
|
-
}
|
|
333
|
+
registry: { translateString }
|
|
397
334
|
} = props;
|
|
398
|
-
return
|
|
399
|
-
title: translateString(TranslatableString.MoveUpButton),
|
|
400
|
-
...props,
|
|
401
|
-
icon: jsx(ArrowUpOutlined, {})
|
|
402
|
-
});
|
|
335
|
+
return /* @__PURE__ */ jsx6(IconButton, { title: translateString(TranslatableString2.MoveUpButton), ...props, icon: /* @__PURE__ */ jsx6(ArrowUpOutlined, {}) });
|
|
403
336
|
}
|
|
404
337
|
function RemoveButton(props) {
|
|
405
|
-
|
|
406
|
-
const options = getUiOptions(props.uiSchema);
|
|
338
|
+
const options = getUiOptions2(props.uiSchema);
|
|
407
339
|
const {
|
|
408
|
-
registry: {
|
|
409
|
-
translateString
|
|
410
|
-
}
|
|
340
|
+
registry: { translateString }
|
|
411
341
|
} = props;
|
|
412
|
-
return
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
342
|
+
return /* @__PURE__ */ jsx6(
|
|
343
|
+
IconButton,
|
|
344
|
+
{
|
|
345
|
+
title: translateString(TranslatableString2.RemoveButton),
|
|
346
|
+
...props,
|
|
347
|
+
danger: true,
|
|
348
|
+
block: !!options.block,
|
|
349
|
+
iconType: "primary",
|
|
350
|
+
icon: /* @__PURE__ */ jsx6(DeleteOutlined, {})
|
|
351
|
+
}
|
|
352
|
+
);
|
|
420
353
|
}
|
|
421
354
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
*/
|
|
355
|
+
// src/templates/FieldErrorTemplate/index.tsx
|
|
356
|
+
import { errorId } from "@rjsf/utils";
|
|
357
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
426
358
|
function FieldErrorTemplate(props) {
|
|
427
|
-
const {
|
|
428
|
-
errors = [],
|
|
429
|
-
idSchema
|
|
430
|
-
} = props;
|
|
359
|
+
const { errors = [], idSchema } = props;
|
|
431
360
|
if (errors.length === 0) {
|
|
432
361
|
return null;
|
|
433
362
|
}
|
|
434
363
|
const id = errorId(idSchema);
|
|
435
|
-
return
|
|
436
|
-
id: id,
|
|
437
|
-
children: errors.map(error => jsx("div", {
|
|
438
|
-
children: error
|
|
439
|
-
}, `field-${id}-error-${error}`))
|
|
440
|
-
});
|
|
364
|
+
return /* @__PURE__ */ jsx7("div", { id, children: errors.map((error) => /* @__PURE__ */ jsx7("div", { children: error }, `field-${id}-error-${error}`)) });
|
|
441
365
|
}
|
|
442
366
|
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
* @param props - The `FieldTemplateProps` for this component
|
|
453
|
-
*/
|
|
367
|
+
// src/templates/FieldTemplate/index.tsx
|
|
368
|
+
import Form from "antd/lib/form";
|
|
369
|
+
import {
|
|
370
|
+
getTemplate as getTemplate2,
|
|
371
|
+
getUiOptions as getUiOptions3
|
|
372
|
+
} from "@rjsf/utils";
|
|
373
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
374
|
+
var VERTICAL_LABEL_COL = { span: 24 };
|
|
375
|
+
var VERTICAL_WRAPPER_COL = { span: 24 };
|
|
454
376
|
function FieldTemplate(props) {
|
|
455
377
|
const {
|
|
456
378
|
children,
|
|
457
|
-
classNames,
|
|
379
|
+
classNames: classNames4,
|
|
458
380
|
style,
|
|
459
381
|
description,
|
|
460
382
|
disabled,
|
|
@@ -478,71 +400,86 @@ function FieldTemplate(props) {
|
|
|
478
400
|
} = props;
|
|
479
401
|
const {
|
|
480
402
|
colon,
|
|
481
|
-
labelCol = VERTICAL_LABEL_COL
|
|
482
|
-
wrapperCol = VERTICAL_WRAPPER_COL
|
|
403
|
+
labelCol = VERTICAL_LABEL_COL,
|
|
404
|
+
wrapperCol = VERTICAL_WRAPPER_COL,
|
|
483
405
|
wrapperStyle,
|
|
484
|
-
descriptionLocation =
|
|
406
|
+
descriptionLocation = "below"
|
|
485
407
|
} = formContext;
|
|
486
|
-
const uiOptions =
|
|
487
|
-
const
|
|
408
|
+
const uiOptions = getUiOptions3(uiSchema);
|
|
409
|
+
const WrapIfAdditionalTemplate2 = getTemplate2(
|
|
410
|
+
"WrapIfAdditionalTemplate",
|
|
411
|
+
registry,
|
|
412
|
+
uiOptions
|
|
413
|
+
);
|
|
488
414
|
if (hidden) {
|
|
489
|
-
return
|
|
490
|
-
className: 'field-hidden',
|
|
491
|
-
children: children
|
|
492
|
-
});
|
|
415
|
+
return /* @__PURE__ */ jsx8("div", { className: "field-hidden", children });
|
|
493
416
|
}
|
|
494
|
-
|
|
495
|
-
// to prevent showing a blank description area
|
|
496
|
-
const descriptionNode = rawDescription ? description : undefined;
|
|
417
|
+
const descriptionNode = rawDescription ? description : void 0;
|
|
497
418
|
const descriptionProps = {};
|
|
498
419
|
switch (descriptionLocation) {
|
|
499
|
-
case
|
|
420
|
+
case "tooltip":
|
|
500
421
|
descriptionProps.tooltip = descriptionNode;
|
|
501
422
|
break;
|
|
502
|
-
case
|
|
423
|
+
case "below":
|
|
503
424
|
default:
|
|
504
425
|
descriptionProps.extra = descriptionNode;
|
|
505
426
|
break;
|
|
506
427
|
}
|
|
507
|
-
return
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
428
|
+
return /* @__PURE__ */ jsx8(
|
|
429
|
+
WrapIfAdditionalTemplate2,
|
|
430
|
+
{
|
|
431
|
+
classNames: classNames4,
|
|
432
|
+
style,
|
|
433
|
+
disabled,
|
|
434
|
+
id,
|
|
435
|
+
label,
|
|
436
|
+
onDropPropertyClick,
|
|
437
|
+
onKeyChange,
|
|
438
|
+
readonly,
|
|
439
|
+
required,
|
|
440
|
+
schema,
|
|
441
|
+
uiSchema,
|
|
442
|
+
registry,
|
|
443
|
+
children: /* @__PURE__ */ jsx8(
|
|
444
|
+
Form.Item,
|
|
445
|
+
{
|
|
446
|
+
colon,
|
|
447
|
+
hasFeedback: schema.type !== "array" && schema.type !== "object",
|
|
448
|
+
help: !!rawHelp && help || (rawErrors?.length ? errors : void 0),
|
|
449
|
+
htmlFor: id,
|
|
450
|
+
label: displayLabel && label,
|
|
451
|
+
labelCol,
|
|
452
|
+
required,
|
|
453
|
+
style: wrapperStyle,
|
|
454
|
+
validateStatus: rawErrors?.length ? "error" : void 0,
|
|
455
|
+
wrapperCol,
|
|
456
|
+
...descriptionProps,
|
|
457
|
+
children
|
|
458
|
+
}
|
|
459
|
+
)
|
|
460
|
+
}
|
|
461
|
+
);
|
|
535
462
|
}
|
|
536
463
|
|
|
537
|
-
|
|
538
|
-
|
|
464
|
+
// src/templates/ObjectFieldTemplate/index.tsx
|
|
465
|
+
import classNames2 from "classnames";
|
|
466
|
+
import isObject from "lodash/isObject";
|
|
467
|
+
import isNumber from "lodash/isNumber";
|
|
468
|
+
import isString from "lodash/isString";
|
|
469
|
+
import {
|
|
470
|
+
canExpand,
|
|
471
|
+
descriptionId,
|
|
472
|
+
getTemplate as getTemplate3,
|
|
473
|
+
getUiOptions as getUiOptions4,
|
|
474
|
+
titleId
|
|
475
|
+
} from "@rjsf/utils";
|
|
476
|
+
import Col3 from "antd/lib/col";
|
|
477
|
+
import Row3 from "antd/lib/row";
|
|
478
|
+
import { ConfigConsumer as ConfigConsumer2 } from "antd/lib/config-provider/context";
|
|
479
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
480
|
+
var DESCRIPTION_COL_STYLE2 = {
|
|
481
|
+
paddingBottom: "8px"
|
|
539
482
|
};
|
|
540
|
-
/** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
|
|
541
|
-
* title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
|
|
542
|
-
* the properties.
|
|
543
|
-
*
|
|
544
|
-
* @param props - The `ObjectFieldTemplateProps` for this component
|
|
545
|
-
*/
|
|
546
483
|
function ObjectFieldTemplate(props) {
|
|
547
484
|
const {
|
|
548
485
|
description,
|
|
@@ -559,32 +496,28 @@ function ObjectFieldTemplate(props) {
|
|
|
559
496
|
title,
|
|
560
497
|
uiSchema
|
|
561
498
|
} = props;
|
|
562
|
-
const uiOptions =
|
|
563
|
-
const TitleFieldTemplate =
|
|
564
|
-
const DescriptionFieldTemplate =
|
|
565
|
-
|
|
499
|
+
const uiOptions = getUiOptions4(uiSchema);
|
|
500
|
+
const TitleFieldTemplate = getTemplate3("TitleFieldTemplate", registry, uiOptions);
|
|
501
|
+
const DescriptionFieldTemplate = getTemplate3(
|
|
502
|
+
"DescriptionFieldTemplate",
|
|
503
|
+
registry,
|
|
504
|
+
uiOptions
|
|
505
|
+
);
|
|
566
506
|
const {
|
|
567
|
-
ButtonTemplates: {
|
|
568
|
-
AddButton
|
|
569
|
-
}
|
|
507
|
+
ButtonTemplates: { AddButton: AddButton2 }
|
|
570
508
|
} = registry.templates;
|
|
571
|
-
const {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
const
|
|
577
|
-
const
|
|
578
|
-
const findUiSchema = element => element.content.props.uiSchema;
|
|
579
|
-
const findUiSchemaField = element => getUiOptions(findUiSchema(element)).field;
|
|
580
|
-
const findUiSchemaWidget = element => getUiOptions(findUiSchema(element)).widget;
|
|
581
|
-
const calculateColSpan = element => {
|
|
509
|
+
const { colSpan = 24, labelAlign = "right", rowGutter = 24 } = formContext;
|
|
510
|
+
const findSchema = (element) => element.content.props.schema;
|
|
511
|
+
const findSchemaType = (element) => findSchema(element).type;
|
|
512
|
+
const findUiSchema = (element) => element.content.props.uiSchema;
|
|
513
|
+
const findUiSchemaField = (element) => getUiOptions4(findUiSchema(element)).field;
|
|
514
|
+
const findUiSchemaWidget = (element) => getUiOptions4(findUiSchema(element)).widget;
|
|
515
|
+
const calculateColSpan = (element) => {
|
|
582
516
|
const type = findSchemaType(element);
|
|
583
517
|
const field = findUiSchemaField(element);
|
|
584
518
|
const widget = findUiSchemaWidget(element);
|
|
585
|
-
const defaultColSpan = properties.length < 2 ||
|
|
586
|
-
|
|
587
|
-
type === 'object' || type === 'array' || widget === 'textarea' ? 24 : 12;
|
|
519
|
+
const defaultColSpan = properties.length < 2 || // Single or no field in object.
|
|
520
|
+
type === "object" || type === "array" || widget === "textarea" ? 24 : 12;
|
|
588
521
|
if (isObject(colSpan)) {
|
|
589
522
|
const colSpanObj = colSpan;
|
|
590
523
|
if (isString(widget)) {
|
|
@@ -602,108 +535,81 @@ function ObjectFieldTemplate(props) {
|
|
|
602
535
|
}
|
|
603
536
|
return defaultColSpan;
|
|
604
537
|
};
|
|
605
|
-
return
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
const labelColClassName = classNames(labelClsBasic, labelAlign === 'left' && `${labelClsBasic}-left`
|
|
538
|
+
return /* @__PURE__ */ jsx9(ConfigConsumer2, { children: (configProps) => {
|
|
539
|
+
const { getPrefixCls } = configProps;
|
|
540
|
+
const prefixCls = getPrefixCls("form");
|
|
541
|
+
const labelClsBasic = `${prefixCls}-item-label`;
|
|
542
|
+
const labelColClassName = classNames2(
|
|
543
|
+
labelClsBasic,
|
|
544
|
+
labelAlign === "left" && `${labelClsBasic}-left`
|
|
613
545
|
// labelCol.className,
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
children: jsx(AddButton, {
|
|
653
|
-
className: 'object-property-expand',
|
|
654
|
-
disabled: disabled || readonly,
|
|
655
|
-
onClick: onAddClick(schema),
|
|
656
|
-
uiSchema: uiSchema,
|
|
657
|
-
registry: registry
|
|
658
|
-
})
|
|
659
|
-
})
|
|
660
|
-
})
|
|
661
|
-
})]
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
});
|
|
546
|
+
);
|
|
547
|
+
return /* @__PURE__ */ jsxs5("fieldset", { id: idSchema.$id, children: [
|
|
548
|
+
/* @__PURE__ */ jsxs5(Row3, { gutter: rowGutter, children: [
|
|
549
|
+
title && /* @__PURE__ */ jsx9(Col3, { className: labelColClassName, span: 24, children: /* @__PURE__ */ jsx9(
|
|
550
|
+
TitleFieldTemplate,
|
|
551
|
+
{
|
|
552
|
+
id: titleId(idSchema),
|
|
553
|
+
title,
|
|
554
|
+
required,
|
|
555
|
+
schema,
|
|
556
|
+
uiSchema,
|
|
557
|
+
registry
|
|
558
|
+
}
|
|
559
|
+
) }),
|
|
560
|
+
description && /* @__PURE__ */ jsx9(Col3, { span: 24, style: DESCRIPTION_COL_STYLE2, children: /* @__PURE__ */ jsx9(
|
|
561
|
+
DescriptionFieldTemplate,
|
|
562
|
+
{
|
|
563
|
+
id: descriptionId(idSchema),
|
|
564
|
+
description,
|
|
565
|
+
schema,
|
|
566
|
+
uiSchema,
|
|
567
|
+
registry
|
|
568
|
+
}
|
|
569
|
+
) }),
|
|
570
|
+
properties.filter((e) => !e.hidden).map((element) => /* @__PURE__ */ jsx9(Col3, { span: calculateColSpan(element), children: element.content }, element.name))
|
|
571
|
+
] }),
|
|
572
|
+
canExpand(schema, uiSchema, formData) && /* @__PURE__ */ jsx9(Col3, { span: 24, children: /* @__PURE__ */ jsx9(Row3, { gutter: rowGutter, justify: "end", children: /* @__PURE__ */ jsx9(Col3, { flex: "192px", children: /* @__PURE__ */ jsx9(
|
|
573
|
+
AddButton2,
|
|
574
|
+
{
|
|
575
|
+
className: "object-property-expand",
|
|
576
|
+
disabled: disabled || readonly,
|
|
577
|
+
onClick: onAddClick(schema),
|
|
578
|
+
uiSchema,
|
|
579
|
+
registry
|
|
580
|
+
}
|
|
581
|
+
) }) }) })
|
|
582
|
+
] });
|
|
583
|
+
} });
|
|
665
584
|
}
|
|
666
585
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
}) {
|
|
672
|
-
const {
|
|
673
|
-
submitText,
|
|
674
|
-
norender,
|
|
675
|
-
props: submitButtonProps
|
|
676
|
-
} = getSubmitButtonOptions(uiSchema);
|
|
586
|
+
// src/templates/SubmitButton/index.tsx
|
|
587
|
+
import Button3 from "antd/lib/button";
|
|
588
|
+
import { getSubmitButtonOptions } from "@rjsf/utils";
|
|
589
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
590
|
+
function SubmitButton({ uiSchema }) {
|
|
591
|
+
const { submitText, norender, props: submitButtonProps } = getSubmitButtonOptions(uiSchema);
|
|
677
592
|
if (norender) {
|
|
678
593
|
return null;
|
|
679
594
|
}
|
|
680
|
-
return
|
|
681
|
-
type: 'submit',
|
|
682
|
-
...submitButtonProps,
|
|
683
|
-
htmlType: 'submit',
|
|
684
|
-
children: submitText
|
|
685
|
-
});
|
|
595
|
+
return /* @__PURE__ */ jsx10(Button3, { type: "submit", ...submitButtonProps, htmlType: "submit", children: submitText });
|
|
686
596
|
}
|
|
687
597
|
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
598
|
+
// src/templates/TitleField/index.tsx
|
|
599
|
+
import classNames3 from "classnames";
|
|
600
|
+
import { ConfigConsumer as ConfigConsumer3 } from "antd/lib/config-provider/context";
|
|
601
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
692
602
|
function TitleField({
|
|
693
603
|
id,
|
|
694
604
|
required,
|
|
695
605
|
registry,
|
|
696
606
|
title
|
|
697
607
|
}) {
|
|
698
|
-
const {
|
|
699
|
-
|
|
700
|
-
} = registry;
|
|
701
|
-
const {
|
|
702
|
-
colon = true
|
|
703
|
-
} = formContext;
|
|
608
|
+
const { formContext } = registry;
|
|
609
|
+
const { colon = true } = formContext;
|
|
704
610
|
let labelChildren = title;
|
|
705
|
-
if (colon && typeof title ===
|
|
706
|
-
labelChildren = title.replace(/[::]\s*$/,
|
|
611
|
+
if (colon && typeof title === "string" && title.trim() !== "") {
|
|
612
|
+
labelChildren = title.replace(/[::]\s*$/, "");
|
|
707
613
|
}
|
|
708
614
|
const handleLabelClick = () => {
|
|
709
615
|
if (!id) {
|
|
@@ -714,45 +620,46 @@ function TitleField({
|
|
|
714
620
|
control.focus();
|
|
715
621
|
}
|
|
716
622
|
};
|
|
717
|
-
return title ?
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
return jsx("label", {
|
|
623
|
+
return title ? /* @__PURE__ */ jsx11(ConfigConsumer3, { children: (configProps) => {
|
|
624
|
+
const { getPrefixCls } = configProps;
|
|
625
|
+
const prefixCls = getPrefixCls("form");
|
|
626
|
+
const labelClassName = classNames3({
|
|
627
|
+
[`${prefixCls}-item-required`]: required,
|
|
628
|
+
[`${prefixCls}-item-no-colon`]: !colon
|
|
629
|
+
});
|
|
630
|
+
return /* @__PURE__ */ jsx11(
|
|
631
|
+
"label",
|
|
632
|
+
{
|
|
728
633
|
className: labelClassName,
|
|
729
634
|
htmlFor: id,
|
|
730
635
|
onClick: handleLabelClick,
|
|
731
|
-
title: typeof title ===
|
|
636
|
+
title: typeof title === "string" ? title : "",
|
|
732
637
|
children: labelChildren
|
|
733
|
-
}
|
|
734
|
-
|
|
735
|
-
}) : null;
|
|
638
|
+
}
|
|
639
|
+
);
|
|
640
|
+
} }) : null;
|
|
736
641
|
}
|
|
737
642
|
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
643
|
+
// src/templates/WrapIfAdditionalTemplate/index.tsx
|
|
644
|
+
import Col4 from "antd/lib/col";
|
|
645
|
+
import Form2 from "antd/lib/form";
|
|
646
|
+
import Input2 from "antd/lib/input";
|
|
647
|
+
import Row4 from "antd/lib/row";
|
|
648
|
+
import {
|
|
649
|
+
ADDITIONAL_PROPERTY_FLAG,
|
|
650
|
+
UI_OPTIONS_KEY,
|
|
651
|
+
TranslatableString as TranslatableString3
|
|
652
|
+
} from "@rjsf/utils";
|
|
653
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
654
|
+
var VERTICAL_LABEL_COL2 = { span: 24 };
|
|
655
|
+
var VERTICAL_WRAPPER_COL2 = { span: 24 };
|
|
656
|
+
var INPUT_STYLE2 = {
|
|
657
|
+
width: "100%"
|
|
746
658
|
};
|
|
747
|
-
/** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
|
|
748
|
-
* part of an `additionalProperties` part of a schema.
|
|
749
|
-
*
|
|
750
|
-
* @param props - The `WrapIfAdditionalProps` for this component
|
|
751
|
-
*/
|
|
752
659
|
function WrapIfAdditionalTemplate(props) {
|
|
753
660
|
const {
|
|
754
661
|
children,
|
|
755
|
-
classNames,
|
|
662
|
+
classNames: classNames4,
|
|
756
663
|
style,
|
|
757
664
|
disabled,
|
|
758
665
|
id,
|
|
@@ -767,93 +674,69 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
767
674
|
} = props;
|
|
768
675
|
const {
|
|
769
676
|
colon,
|
|
770
|
-
labelCol =
|
|
677
|
+
labelCol = VERTICAL_LABEL_COL2,
|
|
771
678
|
readonlyAsDisabled = true,
|
|
772
679
|
rowGutter = 24,
|
|
773
|
-
toolbarAlign =
|
|
774
|
-
wrapperCol =
|
|
680
|
+
toolbarAlign = "top",
|
|
681
|
+
wrapperCol = VERTICAL_WRAPPER_COL2,
|
|
775
682
|
wrapperStyle
|
|
776
683
|
} = registry.formContext;
|
|
777
|
-
const {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
// Button templates are not overridden in the uiSchema
|
|
782
|
-
const {
|
|
783
|
-
RemoveButton
|
|
784
|
-
} = templates.ButtonTemplates;
|
|
785
|
-
const keyLabel = translateString(TranslatableString.KeyLabel, [label]);
|
|
786
|
-
const additional = (ADDITIONAL_PROPERTY_FLAG in schema);
|
|
684
|
+
const { templates, translateString } = registry;
|
|
685
|
+
const { RemoveButton: RemoveButton2 } = templates.ButtonTemplates;
|
|
686
|
+
const keyLabel = translateString(TranslatableString3.KeyLabel, [label]);
|
|
687
|
+
const additional = ADDITIONAL_PROPERTY_FLAG in schema;
|
|
787
688
|
if (!additional) {
|
|
788
|
-
return
|
|
789
|
-
className: classNames,
|
|
790
|
-
style: style,
|
|
791
|
-
children: children
|
|
792
|
-
});
|
|
689
|
+
return /* @__PURE__ */ jsx12("div", { className: classNames4, style, children });
|
|
793
690
|
}
|
|
794
|
-
const handleBlur = ({
|
|
795
|
-
target
|
|
796
|
-
}) => onKeyChange(target.value);
|
|
797
|
-
// The `block` prop is not part of the `IconButtonProps` defined in the template, so put it into the uiSchema instead
|
|
691
|
+
const handleBlur = ({ target }) => onKeyChange(target.value);
|
|
798
692
|
const uiOptions = uiSchema ? uiSchema[UI_OPTIONS_KEY] : {};
|
|
799
693
|
const buttonUiOptions = {
|
|
800
694
|
...uiSchema,
|
|
801
|
-
[UI_OPTIONS_KEY]: {
|
|
802
|
-
...uiOptions,
|
|
803
|
-
block: true
|
|
804
|
-
}
|
|
695
|
+
[UI_OPTIONS_KEY]: { ...uiOptions, block: true }
|
|
805
696
|
};
|
|
806
|
-
return
|
|
807
|
-
className:
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
className: 'array-item-remove',
|
|
847
|
-
disabled: disabled || readonly,
|
|
848
|
-
onClick: onDropPropertyClick(label),
|
|
849
|
-
uiSchema: buttonUiOptions,
|
|
850
|
-
registry: registry
|
|
851
|
-
})
|
|
852
|
-
})]
|
|
853
|
-
})
|
|
854
|
-
});
|
|
697
|
+
return /* @__PURE__ */ jsx12("div", { className: classNames4, style, children: /* @__PURE__ */ jsxs6(Row4, { align: toolbarAlign, gutter: rowGutter, children: [
|
|
698
|
+
/* @__PURE__ */ jsx12(Col4, { className: "form-additional", flex: "1", children: /* @__PURE__ */ jsx12("div", { className: "form-group", children: /* @__PURE__ */ jsx12(
|
|
699
|
+
Form2.Item,
|
|
700
|
+
{
|
|
701
|
+
colon,
|
|
702
|
+
className: "form-group",
|
|
703
|
+
hasFeedback: true,
|
|
704
|
+
htmlFor: `${id}-key`,
|
|
705
|
+
label: keyLabel,
|
|
706
|
+
labelCol,
|
|
707
|
+
required,
|
|
708
|
+
style: wrapperStyle,
|
|
709
|
+
wrapperCol,
|
|
710
|
+
children: /* @__PURE__ */ jsx12(
|
|
711
|
+
Input2,
|
|
712
|
+
{
|
|
713
|
+
className: "form-control",
|
|
714
|
+
defaultValue: label,
|
|
715
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
716
|
+
id: `${id}-key`,
|
|
717
|
+
name: `${id}-key`,
|
|
718
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
719
|
+
style: INPUT_STYLE2,
|
|
720
|
+
type: "text"
|
|
721
|
+
}
|
|
722
|
+
)
|
|
723
|
+
}
|
|
724
|
+
) }) }),
|
|
725
|
+
/* @__PURE__ */ jsx12(Col4, { className: "form-additional", flex: "1", children }),
|
|
726
|
+
/* @__PURE__ */ jsx12(Col4, { flex: "192px", children: /* @__PURE__ */ jsx12(
|
|
727
|
+
RemoveButton2,
|
|
728
|
+
{
|
|
729
|
+
className: "array-item-remove",
|
|
730
|
+
disabled: disabled || readonly,
|
|
731
|
+
onClick: onDropPropertyClick(label),
|
|
732
|
+
uiSchema: buttonUiOptions,
|
|
733
|
+
registry
|
|
734
|
+
}
|
|
735
|
+
) })
|
|
736
|
+
] }) });
|
|
855
737
|
}
|
|
856
738
|
|
|
739
|
+
// src/templates/index.ts
|
|
857
740
|
function generateTemplates() {
|
|
858
741
|
return {
|
|
859
742
|
ArrayFieldItemTemplate,
|
|
@@ -876,57 +759,48 @@ function generateTemplates() {
|
|
|
876
759
|
WrapIfAdditionalTemplate
|
|
877
760
|
};
|
|
878
761
|
}
|
|
879
|
-
var
|
|
762
|
+
var templates_default = generateTemplates();
|
|
880
763
|
|
|
881
|
-
|
|
764
|
+
// src/widgets/AltDateWidget/index.tsx
|
|
765
|
+
import { useEffect, useState } from "react";
|
|
766
|
+
import Button4 from "antd/lib/button";
|
|
767
|
+
import Col5 from "antd/lib/col";
|
|
768
|
+
import Row5 from "antd/lib/row";
|
|
769
|
+
import {
|
|
770
|
+
ariaDescribedByIds as ariaDescribedByIds2,
|
|
771
|
+
pad,
|
|
772
|
+
parseDateString,
|
|
773
|
+
toDateString,
|
|
774
|
+
TranslatableString as TranslatableString4
|
|
775
|
+
} from "@rjsf/utils";
|
|
776
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
777
|
+
var rangeOptions = (start, stop) => {
|
|
882
778
|
const options = [];
|
|
883
779
|
for (let i = start; i <= stop; i++) {
|
|
884
|
-
options.push({
|
|
885
|
-
value: i,
|
|
886
|
-
label: pad(i, 2)
|
|
887
|
-
});
|
|
780
|
+
options.push({ value: i, label: pad(i, 2) });
|
|
888
781
|
}
|
|
889
782
|
return options;
|
|
890
783
|
};
|
|
891
|
-
|
|
892
|
-
return Object.values(state).every(value => value !== -1);
|
|
784
|
+
var readyForChange = (state) => {
|
|
785
|
+
return Object.values(state).every((value) => value !== -1);
|
|
893
786
|
};
|
|
894
|
-
function dateElementProps(state, time, yearsRange = [1900, new Date().getFullYear() + 2]) {
|
|
895
|
-
const {
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
range: yearsRange,
|
|
906
|
-
value: year
|
|
907
|
-
}, {
|
|
908
|
-
type: 'month',
|
|
909
|
-
range: [1, 12],
|
|
910
|
-
value: month
|
|
911
|
-
}, {
|
|
912
|
-
type: 'day',
|
|
913
|
-
range: [1, 31],
|
|
914
|
-
value: day
|
|
915
|
-
}];
|
|
787
|
+
function dateElementProps(state, time, yearsRange = [1900, (/* @__PURE__ */ new Date()).getFullYear() + 2]) {
|
|
788
|
+
const { year, month, day, hour, minute, second } = state;
|
|
789
|
+
const data = [
|
|
790
|
+
{
|
|
791
|
+
type: "year",
|
|
792
|
+
range: yearsRange,
|
|
793
|
+
value: year
|
|
794
|
+
},
|
|
795
|
+
{ type: "month", range: [1, 12], value: month },
|
|
796
|
+
{ type: "day", range: [1, 31], value: day }
|
|
797
|
+
];
|
|
916
798
|
if (time) {
|
|
917
|
-
data.push(
|
|
918
|
-
type:
|
|
919
|
-
range: [0,
|
|
920
|
-
value:
|
|
921
|
-
|
|
922
|
-
type: 'minute',
|
|
923
|
-
range: [0, 59],
|
|
924
|
-
value: minute || -1
|
|
925
|
-
}, {
|
|
926
|
-
type: 'second',
|
|
927
|
-
range: [0, 59],
|
|
928
|
-
value: second || -1
|
|
929
|
-
});
|
|
799
|
+
data.push(
|
|
800
|
+
{ type: "hour", range: [0, 23], value: hour || -1 },
|
|
801
|
+
{ type: "minute", range: [0, 59], value: minute || -1 },
|
|
802
|
+
{ type: "second", range: [0, 59], value: second || -1 }
|
|
803
|
+
);
|
|
930
804
|
}
|
|
931
805
|
return data;
|
|
932
806
|
}
|
|
@@ -945,16 +819,9 @@ function AltDateWidget(props) {
|
|
|
945
819
|
showTime,
|
|
946
820
|
value
|
|
947
821
|
} = props;
|
|
948
|
-
const {
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
} = registry;
|
|
952
|
-
const {
|
|
953
|
-
SelectWidget
|
|
954
|
-
} = widgets;
|
|
955
|
-
const {
|
|
956
|
-
rowGutter = 24
|
|
957
|
-
} = formContext;
|
|
822
|
+
const { translateString, widgets } = registry;
|
|
823
|
+
const { SelectWidget: SelectWidget2 } = widgets;
|
|
824
|
+
const { rowGutter = 24 } = formContext;
|
|
958
825
|
const [state, setState] = useState(parseDateString(value, showTime));
|
|
959
826
|
useEffect(() => {
|
|
960
827
|
setState(parseDateString(value, showTime));
|
|
@@ -962,7 +829,7 @@ function AltDateWidget(props) {
|
|
|
962
829
|
const handleChange = (property, nextValue) => {
|
|
963
830
|
const nextState = {
|
|
964
831
|
...state,
|
|
965
|
-
[property]: typeof nextValue ===
|
|
832
|
+
[property]: typeof nextValue === "undefined" ? -1 : nextValue
|
|
966
833
|
};
|
|
967
834
|
if (readyForChange(nextState)) {
|
|
968
835
|
onChange(toDateString(nextState, showTime));
|
|
@@ -970,374 +837,285 @@ function AltDateWidget(props) {
|
|
|
970
837
|
setState(nextState);
|
|
971
838
|
}
|
|
972
839
|
};
|
|
973
|
-
const handleNow = event => {
|
|
840
|
+
const handleNow = (event) => {
|
|
974
841
|
event.preventDefault();
|
|
975
842
|
if (disabled || readonly) {
|
|
976
843
|
return;
|
|
977
844
|
}
|
|
978
|
-
const nextState = parseDateString(new Date().toJSON(), showTime);
|
|
845
|
+
const nextState = parseDateString((/* @__PURE__ */ new Date()).toJSON(), showTime);
|
|
979
846
|
onChange(toDateString(nextState, showTime));
|
|
980
847
|
};
|
|
981
|
-
const handleClear = event => {
|
|
848
|
+
const handleClear = (event) => {
|
|
982
849
|
event.preventDefault();
|
|
983
850
|
if (disabled || readonly) {
|
|
984
851
|
return;
|
|
985
852
|
}
|
|
986
|
-
onChange(
|
|
853
|
+
onChange(void 0);
|
|
987
854
|
};
|
|
988
|
-
const renderDateElement = elemProps =>
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
const elemId = id +
|
|
1014
|
-
return
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
flex: '88px',
|
|
1034
|
-
children: jsx(Button, {
|
|
1035
|
-
block: true,
|
|
1036
|
-
className: 'btn-now',
|
|
1037
|
-
onClick: handleNow,
|
|
1038
|
-
type: 'primary',
|
|
1039
|
-
children: translateString(TranslatableString.NowLabel)
|
|
1040
|
-
})
|
|
1041
|
-
}), !options.hideClearButton && jsx(Col, {
|
|
1042
|
-
flex: '88px',
|
|
1043
|
-
children: jsx(Button, {
|
|
1044
|
-
block: true,
|
|
1045
|
-
className: 'btn-clear',
|
|
1046
|
-
danger: true,
|
|
1047
|
-
onClick: handleClear,
|
|
1048
|
-
type: 'primary',
|
|
1049
|
-
children: translateString(TranslatableString.ClearLabel)
|
|
1050
|
-
})
|
|
1051
|
-
})]
|
|
1052
|
-
});
|
|
855
|
+
const renderDateElement = (elemProps) => /* @__PURE__ */ jsx13(
|
|
856
|
+
SelectWidget2,
|
|
857
|
+
{
|
|
858
|
+
autofocus: elemProps.autofocus,
|
|
859
|
+
className: "form-control",
|
|
860
|
+
disabled: elemProps.disabled,
|
|
861
|
+
id: elemProps.id,
|
|
862
|
+
name: elemProps.name,
|
|
863
|
+
onBlur: elemProps.onBlur,
|
|
864
|
+
onChange: (elemValue) => elemProps.select(elemProps.type, elemValue),
|
|
865
|
+
onFocus: elemProps.onFocus,
|
|
866
|
+
options: {
|
|
867
|
+
enumOptions: rangeOptions(elemProps.range[0], elemProps.range[1])
|
|
868
|
+
},
|
|
869
|
+
placeholder: elemProps.type,
|
|
870
|
+
readonly: elemProps.readonly,
|
|
871
|
+
schema: { type: "integer" },
|
|
872
|
+
value: elemProps.value,
|
|
873
|
+
registry,
|
|
874
|
+
label: "",
|
|
875
|
+
"aria-describedby": ariaDescribedByIds2(id)
|
|
876
|
+
}
|
|
877
|
+
);
|
|
878
|
+
return /* @__PURE__ */ jsxs7(Row5, { gutter: [Math.floor(rowGutter / 2), Math.floor(rowGutter / 2)], children: [
|
|
879
|
+
dateElementProps(state, showTime, options.yearsRange).map((elemProps, i) => {
|
|
880
|
+
const elemId = id + "_" + elemProps.type;
|
|
881
|
+
return /* @__PURE__ */ jsx13(Col5, { flex: "88px", children: renderDateElement({
|
|
882
|
+
...elemProps,
|
|
883
|
+
autofocus: autofocus && i === 0,
|
|
884
|
+
disabled,
|
|
885
|
+
id: elemId,
|
|
886
|
+
name: id,
|
|
887
|
+
onBlur,
|
|
888
|
+
onFocus,
|
|
889
|
+
readonly,
|
|
890
|
+
registry,
|
|
891
|
+
select: handleChange,
|
|
892
|
+
// NOTE: antd components accept -1 rather than issue a warning
|
|
893
|
+
// like material-ui, so we need to convert -1 to undefined here.
|
|
894
|
+
value: elemProps.value < 0 ? void 0 : elemProps.value
|
|
895
|
+
}) }, elemId);
|
|
896
|
+
}),
|
|
897
|
+
!options.hideNowButton && /* @__PURE__ */ jsx13(Col5, { flex: "88px", children: /* @__PURE__ */ jsx13(Button4, { block: true, className: "btn-now", onClick: handleNow, type: "primary", children: translateString(TranslatableString4.NowLabel) }) }),
|
|
898
|
+
!options.hideClearButton && /* @__PURE__ */ jsx13(Col5, { flex: "88px", children: /* @__PURE__ */ jsx13(Button4, { block: true, className: "btn-clear", danger: true, onClick: handleClear, type: "primary", children: translateString(TranslatableString4.ClearLabel) }) })
|
|
899
|
+
] });
|
|
1053
900
|
}
|
|
1054
901
|
AltDateWidget.defaultProps = {
|
|
1055
902
|
autofocus: false,
|
|
1056
903
|
disabled: false,
|
|
1057
904
|
options: {
|
|
1058
|
-
yearsRange: [1900,
|
|
905
|
+
yearsRange: [1900, (/* @__PURE__ */ new Date()).getFullYear() + 2]
|
|
1059
906
|
},
|
|
1060
907
|
readonly: false,
|
|
1061
908
|
showTime: false
|
|
1062
909
|
};
|
|
1063
910
|
|
|
911
|
+
// src/widgets/AltDateTimeWidget/index.tsx
|
|
912
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1064
913
|
function AltDateTimeWidget(props) {
|
|
1065
|
-
const {
|
|
1066
|
-
|
|
1067
|
-
} = props.registry.widgets;
|
|
1068
|
-
return jsx(AltDateWidget, {
|
|
1069
|
-
showTime: true,
|
|
1070
|
-
...props
|
|
1071
|
-
});
|
|
914
|
+
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
915
|
+
return /* @__PURE__ */ jsx14(AltDateWidget2, { showTime: true, ...props });
|
|
1072
916
|
}
|
|
1073
917
|
AltDateTimeWidget.defaultProps = {
|
|
1074
918
|
...AltDateWidget.defaultProps,
|
|
1075
919
|
showTime: true
|
|
1076
920
|
};
|
|
1077
921
|
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
onFocus,
|
|
1093
|
-
options,
|
|
1094
|
-
readonly,
|
|
1095
|
-
registry,
|
|
1096
|
-
schema,
|
|
1097
|
-
uiSchema,
|
|
1098
|
-
value
|
|
1099
|
-
}) {
|
|
1100
|
-
const {
|
|
1101
|
-
readonlyAsDisabled = true
|
|
1102
|
-
} = formContext;
|
|
1103
|
-
const TitleFieldTemplate = getTemplate('TitleFieldTemplate', registry, options);
|
|
1104
|
-
const {
|
|
1105
|
-
enumOptions,
|
|
1106
|
-
enumDisabled,
|
|
1107
|
-
inline,
|
|
1108
|
-
emptyValue
|
|
1109
|
-
} = options;
|
|
1110
|
-
const handleChange = nextValue => onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
|
|
1111
|
-
const handleBlur = ({
|
|
1112
|
-
target
|
|
1113
|
-
}) => onBlur(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
|
|
1114
|
-
const handleFocus = ({
|
|
1115
|
-
target
|
|
1116
|
-
}) => onFocus(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
|
|
1117
|
-
// Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
|
|
1118
|
-
// they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
|
|
922
|
+
// src/widgets/CheckboxesWidget/index.tsx
|
|
923
|
+
import Checkbox from "antd/lib/checkbox";
|
|
924
|
+
import {
|
|
925
|
+
ariaDescribedByIds as ariaDescribedByIds3,
|
|
926
|
+
enumOptionsIndexForValue,
|
|
927
|
+
enumOptionsValueForIndex,
|
|
928
|
+
optionId
|
|
929
|
+
} from "@rjsf/utils";
|
|
930
|
+
import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
931
|
+
function CheckboxesWidget({ autofocus, disabled, formContext, id, onBlur, onChange, onFocus, options, readonly, value }) {
|
|
932
|
+
const { readonlyAsDisabled = true } = formContext;
|
|
933
|
+
const { enumOptions, enumDisabled, inline, emptyValue } = options;
|
|
934
|
+
const handleChange = (nextValue) => onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
|
|
935
|
+
const handleBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
|
|
936
|
+
const handleFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
|
|
1119
937
|
const extraProps = {
|
|
1120
938
|
id,
|
|
1121
|
-
onBlur: !readonly ? handleBlur :
|
|
1122
|
-
onFocus: !readonly ? handleFocus :
|
|
939
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
940
|
+
onFocus: !readonly ? handleFocus : void 0
|
|
1123
941
|
};
|
|
1124
942
|
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions, true);
|
|
1125
|
-
return Array.isArray(enumOptions) && enumOptions.length > 0 ?
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
id: titleId(id),
|
|
1129
|
-
title: label,
|
|
1130
|
-
schema: schema,
|
|
1131
|
-
uiSchema: uiSchema,
|
|
1132
|
-
registry: registry
|
|
1133
|
-
})
|
|
1134
|
-
}), jsx(Checkbox.Group, {
|
|
943
|
+
return Array.isArray(enumOptions) && enumOptions.length > 0 ? /* @__PURE__ */ jsx15(Fragment2, { children: /* @__PURE__ */ jsx15(
|
|
944
|
+
Checkbox.Group,
|
|
945
|
+
{
|
|
1135
946
|
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1136
947
|
name: id,
|
|
1137
|
-
onChange: !readonly ? handleChange :
|
|
948
|
+
onChange: !readonly ? handleChange : void 0,
|
|
1138
949
|
value: selectedIndexes,
|
|
1139
950
|
...extraProps,
|
|
1140
|
-
"aria-describedby":
|
|
1141
|
-
children: Array.isArray(enumOptions) && enumOptions.map((option, i) =>
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
951
|
+
"aria-describedby": ariaDescribedByIds3(id),
|
|
952
|
+
children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ jsxs8("span", { children: [
|
|
953
|
+
/* @__PURE__ */ jsx15(
|
|
954
|
+
Checkbox,
|
|
955
|
+
{
|
|
956
|
+
id: optionId(id, i),
|
|
957
|
+
name: id,
|
|
958
|
+
autoFocus: i === 0 ? autofocus : false,
|
|
959
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
|
|
960
|
+
value: String(i),
|
|
961
|
+
children: option.label
|
|
962
|
+
}
|
|
963
|
+
),
|
|
964
|
+
!inline && /* @__PURE__ */ jsx15("br", {})
|
|
965
|
+
] }, i))
|
|
966
|
+
}
|
|
967
|
+
) }) : null;
|
|
1153
968
|
}
|
|
1154
969
|
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
970
|
+
// src/widgets/CheckboxWidget/index.tsx
|
|
971
|
+
import Checkbox2 from "antd/lib/checkbox";
|
|
972
|
+
import {
|
|
973
|
+
ariaDescribedByIds as ariaDescribedByIds4,
|
|
974
|
+
labelValue
|
|
975
|
+
} from "@rjsf/utils";
|
|
976
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1160
977
|
function CheckboxWidget(props) {
|
|
1161
|
-
const {
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
label,
|
|
1167
|
-
hideLabel,
|
|
1168
|
-
onBlur,
|
|
1169
|
-
onChange,
|
|
1170
|
-
onFocus,
|
|
1171
|
-
readonly,
|
|
1172
|
-
value
|
|
1173
|
-
} = props;
|
|
1174
|
-
const {
|
|
1175
|
-
readonlyAsDisabled = true
|
|
1176
|
-
} = formContext;
|
|
1177
|
-
const handleChange = ({
|
|
1178
|
-
target
|
|
1179
|
-
}) => onChange(target.checked);
|
|
1180
|
-
const handleBlur = ({
|
|
1181
|
-
target
|
|
1182
|
-
}) => onBlur(id, target.checked);
|
|
1183
|
-
const handleFocus = ({
|
|
1184
|
-
target
|
|
1185
|
-
}) => onFocus(id, target.checked);
|
|
1186
|
-
// Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
|
|
1187
|
-
// they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
|
|
978
|
+
const { autofocus, disabled, formContext, id, label, hideLabel, onBlur, onChange, onFocus, readonly, value } = props;
|
|
979
|
+
const { readonlyAsDisabled = true } = formContext;
|
|
980
|
+
const handleChange = ({ target }) => onChange(target.checked);
|
|
981
|
+
const handleBlur = ({ target }) => onBlur(id, target.checked);
|
|
982
|
+
const handleFocus = ({ target }) => onFocus(id, target.checked);
|
|
1188
983
|
const extraProps = {
|
|
1189
|
-
onBlur: !readonly ? handleBlur :
|
|
1190
|
-
onFocus: !readonly ? handleFocus :
|
|
984
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
985
|
+
onFocus: !readonly ? handleFocus : void 0
|
|
1191
986
|
};
|
|
1192
|
-
return
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
987
|
+
return /* @__PURE__ */ jsx16(
|
|
988
|
+
Checkbox2,
|
|
989
|
+
{
|
|
990
|
+
autoFocus: autofocus,
|
|
991
|
+
checked: typeof value === "undefined" ? false : value,
|
|
992
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
993
|
+
id,
|
|
994
|
+
name: id,
|
|
995
|
+
onChange: !readonly ? handleChange : void 0,
|
|
996
|
+
...extraProps,
|
|
997
|
+
"aria-describedby": ariaDescribedByIds4(id),
|
|
998
|
+
children: labelValue(label, hideLabel, "")
|
|
999
|
+
}
|
|
1000
|
+
);
|
|
1203
1001
|
}
|
|
1204
1002
|
|
|
1205
|
-
|
|
1003
|
+
// src/widgets/DateTimeWidget/index.tsx
|
|
1004
|
+
import dayjs from "dayjs";
|
|
1005
|
+
import {
|
|
1006
|
+
ariaDescribedByIds as ariaDescribedByIds5
|
|
1007
|
+
} from "@rjsf/utils";
|
|
1008
|
+
|
|
1009
|
+
// src/components/DatePicker/index.ts
|
|
1010
|
+
import dayjsGenerateConfig from "rc-picker/lib/generate/dayjs";
|
|
1011
|
+
import generatePicker from "antd/lib/date-picker/generatePicker";
|
|
1012
|
+
var DatePicker = generatePicker(dayjsGenerateConfig);
|
|
1013
|
+
var DatePicker_default = DatePicker;
|
|
1206
1014
|
|
|
1207
|
-
|
|
1208
|
-
|
|
1015
|
+
// src/widgets/DateTimeWidget/index.tsx
|
|
1016
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1017
|
+
var DATE_PICKER_STYLE = {
|
|
1018
|
+
width: "100%"
|
|
1209
1019
|
};
|
|
1210
|
-
/** The `DateTimeWidget` component uses the `BaseInputTemplate` changing the type to `datetime-local` and transforms
|
|
1211
|
-
* the value to/from utc using the appropriate utility functions.
|
|
1212
|
-
*
|
|
1213
|
-
* @param props - The `WidgetProps` for this component
|
|
1214
|
-
*/
|
|
1215
1020
|
function DateTimeWidget(props) {
|
|
1216
|
-
const {
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
id,
|
|
1220
|
-
onBlur,
|
|
1221
|
-
onChange,
|
|
1222
|
-
onFocus,
|
|
1223
|
-
placeholder,
|
|
1224
|
-
readonly,
|
|
1225
|
-
value
|
|
1226
|
-
} = props;
|
|
1227
|
-
const {
|
|
1228
|
-
readonlyAsDisabled = true
|
|
1229
|
-
} = formContext;
|
|
1230
|
-
const handleChange = nextValue => onChange(nextValue && nextValue.toISOString());
|
|
1021
|
+
const { disabled, formContext, id, onBlur, onChange, onFocus, placeholder, readonly, value } = props;
|
|
1022
|
+
const { readonlyAsDisabled = true } = formContext;
|
|
1023
|
+
const handleChange = (nextValue) => onChange(nextValue && nextValue.toISOString());
|
|
1231
1024
|
const handleBlur = () => onBlur(id, value);
|
|
1232
1025
|
const handleFocus = () => onFocus(id, value);
|
|
1233
|
-
const getPopupContainer = node => node.parentNode;
|
|
1234
|
-
return
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1026
|
+
const getPopupContainer = (node) => node.parentNode;
|
|
1027
|
+
return /* @__PURE__ */ jsx17(
|
|
1028
|
+
DatePicker_default,
|
|
1029
|
+
{
|
|
1030
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1031
|
+
getPopupContainer,
|
|
1032
|
+
id,
|
|
1033
|
+
name: id,
|
|
1034
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
1035
|
+
onChange: !readonly ? handleChange : void 0,
|
|
1036
|
+
onFocus: !readonly ? handleFocus : void 0,
|
|
1037
|
+
placeholder,
|
|
1038
|
+
showTime: true,
|
|
1039
|
+
style: DATE_PICKER_STYLE,
|
|
1040
|
+
value: value && dayjs(value),
|
|
1041
|
+
"aria-describedby": ariaDescribedByIds5(id)
|
|
1042
|
+
}
|
|
1043
|
+
);
|
|
1248
1044
|
}
|
|
1249
1045
|
|
|
1250
|
-
|
|
1251
|
-
|
|
1046
|
+
// src/widgets/DateWidget/index.tsx
|
|
1047
|
+
import dayjs2 from "dayjs";
|
|
1048
|
+
import {
|
|
1049
|
+
ariaDescribedByIds as ariaDescribedByIds6
|
|
1050
|
+
} from "@rjsf/utils";
|
|
1051
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1052
|
+
var DATE_PICKER_STYLE2 = {
|
|
1053
|
+
width: "100%"
|
|
1252
1054
|
};
|
|
1253
|
-
/** The `DateWidget` component uses the `BaseInputTemplate` changing the type to `date` and transforms
|
|
1254
|
-
* the value to undefined when it is falsy during the `onChange` handling.
|
|
1255
|
-
*
|
|
1256
|
-
* @param props - The `WidgetProps` for this component
|
|
1257
|
-
*/
|
|
1258
1055
|
function DateWidget(props) {
|
|
1259
|
-
const {
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
id,
|
|
1263
|
-
onBlur,
|
|
1264
|
-
onChange,
|
|
1265
|
-
onFocus,
|
|
1266
|
-
placeholder,
|
|
1267
|
-
readonly,
|
|
1268
|
-
value
|
|
1269
|
-
} = props;
|
|
1270
|
-
const {
|
|
1271
|
-
readonlyAsDisabled = true
|
|
1272
|
-
} = formContext;
|
|
1273
|
-
const handleChange = nextValue => onChange(nextValue && nextValue.format('YYYY-MM-DD'));
|
|
1056
|
+
const { disabled, formContext, id, onBlur, onChange, onFocus, placeholder, readonly, value } = props;
|
|
1057
|
+
const { readonlyAsDisabled = true } = formContext;
|
|
1058
|
+
const handleChange = (nextValue) => onChange(nextValue && nextValue.format("YYYY-MM-DD"));
|
|
1274
1059
|
const handleBlur = () => onBlur(id, value);
|
|
1275
1060
|
const handleFocus = () => onFocus(id, value);
|
|
1276
|
-
const getPopupContainer = node => node.parentNode;
|
|
1277
|
-
return
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1061
|
+
const getPopupContainer = (node) => node.parentNode;
|
|
1062
|
+
return /* @__PURE__ */ jsx18(
|
|
1063
|
+
DatePicker_default,
|
|
1064
|
+
{
|
|
1065
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1066
|
+
getPopupContainer,
|
|
1067
|
+
id,
|
|
1068
|
+
name: id,
|
|
1069
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
1070
|
+
onChange: !readonly ? handleChange : void 0,
|
|
1071
|
+
onFocus: !readonly ? handleFocus : void 0,
|
|
1072
|
+
placeholder,
|
|
1073
|
+
showTime: false,
|
|
1074
|
+
style: DATE_PICKER_STYLE2,
|
|
1075
|
+
value: value && dayjs2(value),
|
|
1076
|
+
"aria-describedby": ariaDescribedByIds6(id)
|
|
1077
|
+
}
|
|
1078
|
+
);
|
|
1291
1079
|
}
|
|
1292
1080
|
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1081
|
+
// src/widgets/PasswordWidget/index.tsx
|
|
1082
|
+
import Input3 from "antd/lib/input";
|
|
1083
|
+
import {
|
|
1084
|
+
ariaDescribedByIds as ariaDescribedByIds7
|
|
1085
|
+
} from "@rjsf/utils";
|
|
1086
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1297
1087
|
function PasswordWidget(props) {
|
|
1298
|
-
const {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
target
|
|
1319
|
-
}) => onBlur(id, target.value);
|
|
1320
|
-
const handleFocus = ({
|
|
1321
|
-
target
|
|
1322
|
-
}) => onFocus(id, target.value);
|
|
1323
|
-
return jsx(Input.Password, {
|
|
1324
|
-
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1325
|
-
id: id,
|
|
1326
|
-
name: id,
|
|
1327
|
-
onBlur: !readonly ? handleBlur : undefined,
|
|
1328
|
-
onChange: !readonly ? handleChange : undefined,
|
|
1329
|
-
onFocus: !readonly ? handleFocus : undefined,
|
|
1330
|
-
placeholder: placeholder,
|
|
1331
|
-
value: value || '',
|
|
1332
|
-
"aria-describedby": ariaDescribedByIds(id)
|
|
1333
|
-
});
|
|
1088
|
+
const { disabled, formContext, id, onBlur, onChange, onFocus, options, placeholder, readonly, value } = props;
|
|
1089
|
+
const { readonlyAsDisabled = true } = formContext;
|
|
1090
|
+
const emptyValue = options.emptyValue || "";
|
|
1091
|
+
const handleChange = ({ target }) => onChange(target.value === "" ? emptyValue : target.value);
|
|
1092
|
+
const handleBlur = ({ target }) => onBlur(id, target.value);
|
|
1093
|
+
const handleFocus = ({ target }) => onFocus(id, target.value);
|
|
1094
|
+
return /* @__PURE__ */ jsx19(
|
|
1095
|
+
Input3.Password,
|
|
1096
|
+
{
|
|
1097
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1098
|
+
id,
|
|
1099
|
+
name: id,
|
|
1100
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
1101
|
+
onChange: !readonly ? handleChange : void 0,
|
|
1102
|
+
onFocus: !readonly ? handleFocus : void 0,
|
|
1103
|
+
placeholder,
|
|
1104
|
+
value: value || "",
|
|
1105
|
+
"aria-describedby": ariaDescribedByIds7(id)
|
|
1106
|
+
}
|
|
1107
|
+
);
|
|
1334
1108
|
}
|
|
1335
1109
|
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1110
|
+
// src/widgets/RadioWidget/index.tsx
|
|
1111
|
+
import Radio from "antd/lib/radio";
|
|
1112
|
+
import {
|
|
1113
|
+
ariaDescribedByIds as ariaDescribedByIds8,
|
|
1114
|
+
enumOptionsIndexForValue as enumOptionsIndexForValue2,
|
|
1115
|
+
enumOptionsValueForIndex as enumOptionsValueForIndex2,
|
|
1116
|
+
optionId as optionId2
|
|
1117
|
+
} from "@rjsf/utils";
|
|
1118
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
1341
1119
|
function RadioWidget({
|
|
1342
1120
|
autofocus,
|
|
1343
1121
|
disabled,
|
|
@@ -1350,51 +1128,46 @@ function RadioWidget({
|
|
|
1350
1128
|
readonly,
|
|
1351
1129
|
value
|
|
1352
1130
|
}) {
|
|
1353
|
-
const {
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
const {
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
}
|
|
1365
|
-
}) => onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
|
|
1366
|
-
const handleBlur = ({
|
|
1367
|
-
target
|
|
1368
|
-
}) => onBlur(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
|
|
1369
|
-
const handleFocus = ({
|
|
1370
|
-
target
|
|
1371
|
-
}) => onFocus(id, enumOptionsValueForIndex(target.value, enumOptions, emptyValue));
|
|
1372
|
-
const selectedIndexes = enumOptionsIndexForValue(value, enumOptions);
|
|
1373
|
-
return jsx(Radio.Group, {
|
|
1374
|
-
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1375
|
-
id: id,
|
|
1376
|
-
name: id,
|
|
1377
|
-
onChange: !readonly ? handleChange : undefined,
|
|
1378
|
-
onBlur: !readonly ? handleBlur : undefined,
|
|
1379
|
-
onFocus: !readonly ? handleFocus : undefined,
|
|
1380
|
-
value: selectedIndexes,
|
|
1381
|
-
"aria-describedby": ariaDescribedByIds(id),
|
|
1382
|
-
children: Array.isArray(enumOptions) && enumOptions.map((option, i) => jsx(Radio, {
|
|
1383
|
-
id: optionId(id, i),
|
|
1131
|
+
const { readonlyAsDisabled = true } = formContext;
|
|
1132
|
+
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
1133
|
+
const handleChange = ({ target: { value: nextValue } }) => onChange(enumOptionsValueForIndex2(nextValue, enumOptions, emptyValue));
|
|
1134
|
+
const handleBlur = ({ target }) => onBlur(id, enumOptionsValueForIndex2(target.value, enumOptions, emptyValue));
|
|
1135
|
+
const handleFocus = ({ target }) => onFocus(id, enumOptionsValueForIndex2(target.value, enumOptions, emptyValue));
|
|
1136
|
+
const selectedIndexes = enumOptionsIndexForValue2(value, enumOptions);
|
|
1137
|
+
return /* @__PURE__ */ jsx20(
|
|
1138
|
+
Radio.Group,
|
|
1139
|
+
{
|
|
1140
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1141
|
+
id,
|
|
1384
1142
|
name: id,
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1143
|
+
onChange: !readonly ? handleChange : void 0,
|
|
1144
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
1145
|
+
onFocus: !readonly ? handleFocus : void 0,
|
|
1146
|
+
value: selectedIndexes,
|
|
1147
|
+
"aria-describedby": ariaDescribedByIds8(id),
|
|
1148
|
+
children: Array.isArray(enumOptions) && enumOptions.map((option, i) => /* @__PURE__ */ jsx20(
|
|
1149
|
+
Radio,
|
|
1150
|
+
{
|
|
1151
|
+
id: optionId2(id, i),
|
|
1152
|
+
name: id,
|
|
1153
|
+
autoFocus: i === 0 ? autofocus : false,
|
|
1154
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value) !== -1,
|
|
1155
|
+
value: String(i),
|
|
1156
|
+
children: option.label
|
|
1157
|
+
},
|
|
1158
|
+
i
|
|
1159
|
+
))
|
|
1160
|
+
}
|
|
1161
|
+
);
|
|
1391
1162
|
}
|
|
1392
1163
|
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1164
|
+
// src/widgets/RangeWidget/index.tsx
|
|
1165
|
+
import Slider from "antd/lib/slider";
|
|
1166
|
+
import {
|
|
1167
|
+
ariaDescribedByIds as ariaDescribedByIds9,
|
|
1168
|
+
rangeSpec
|
|
1169
|
+
} from "@rjsf/utils";
|
|
1170
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1398
1171
|
function RangeWidget(props) {
|
|
1399
1172
|
const {
|
|
1400
1173
|
autofocus,
|
|
@@ -1410,48 +1183,47 @@ function RangeWidget(props) {
|
|
|
1410
1183
|
schema,
|
|
1411
1184
|
value
|
|
1412
1185
|
} = props;
|
|
1413
|
-
const {
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
const
|
|
1417
|
-
min,
|
|
1418
|
-
max,
|
|
1419
|
-
step
|
|
1420
|
-
} = rangeSpec(schema);
|
|
1421
|
-
const emptyValue = options.emptyValue || '';
|
|
1422
|
-
const handleChange = nextValue => onChange(nextValue === '' ? emptyValue : nextValue);
|
|
1186
|
+
const { readonlyAsDisabled = true } = formContext;
|
|
1187
|
+
const { min, max, step } = rangeSpec(schema);
|
|
1188
|
+
const emptyValue = options.emptyValue || "";
|
|
1189
|
+
const handleChange = (nextValue) => onChange(nextValue === "" ? emptyValue : nextValue);
|
|
1423
1190
|
const handleBlur = () => onBlur(id, value);
|
|
1424
1191
|
const handleFocus = () => onFocus(id, value);
|
|
1425
|
-
// Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
|
|
1426
|
-
// they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
|
|
1427
1192
|
const extraProps = {
|
|
1428
1193
|
placeholder,
|
|
1429
|
-
onBlur: !readonly ? handleBlur :
|
|
1430
|
-
onFocus: !readonly ? handleFocus :
|
|
1194
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
1195
|
+
onFocus: !readonly ? handleFocus : void 0
|
|
1431
1196
|
};
|
|
1432
|
-
return
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1197
|
+
return /* @__PURE__ */ jsx21(
|
|
1198
|
+
Slider,
|
|
1199
|
+
{
|
|
1200
|
+
autoFocus: autofocus,
|
|
1201
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1202
|
+
id,
|
|
1203
|
+
max,
|
|
1204
|
+
min,
|
|
1205
|
+
onChange: !readonly ? handleChange : void 0,
|
|
1206
|
+
range: false,
|
|
1207
|
+
step,
|
|
1208
|
+
value,
|
|
1209
|
+
...extraProps,
|
|
1210
|
+
"aria-describedby": ariaDescribedByIds9(id)
|
|
1211
|
+
}
|
|
1212
|
+
);
|
|
1445
1213
|
}
|
|
1446
1214
|
|
|
1447
|
-
|
|
1448
|
-
|
|
1215
|
+
// src/widgets/SelectWidget/index.tsx
|
|
1216
|
+
import Select from "antd/lib/select";
|
|
1217
|
+
import {
|
|
1218
|
+
ariaDescribedByIds as ariaDescribedByIds10,
|
|
1219
|
+
enumOptionsIndexForValue as enumOptionsIndexForValue3,
|
|
1220
|
+
enumOptionsValueForIndex as enumOptionsValueForIndex3
|
|
1221
|
+
} from "@rjsf/utils";
|
|
1222
|
+
import isString2 from "lodash/isString";
|
|
1223
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
1224
|
+
var SELECT_STYLE = {
|
|
1225
|
+
width: "100%"
|
|
1449
1226
|
};
|
|
1450
|
-
/** The `SelectWidget` is a widget for rendering dropdowns.
|
|
1451
|
-
* It is typically used with string properties constrained with enum options.
|
|
1452
|
-
*
|
|
1453
|
-
* @param props - The `WidgetProps` for this component
|
|
1454
|
-
*/
|
|
1455
1227
|
function SelectWidget({
|
|
1456
1228
|
autofocus,
|
|
1457
1229
|
disabled,
|
|
@@ -1466,64 +1238,61 @@ function SelectWidget({
|
|
|
1466
1238
|
readonly,
|
|
1467
1239
|
value
|
|
1468
1240
|
}) {
|
|
1469
|
-
const {
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
const
|
|
1473
|
-
|
|
1474
|
-
enumDisabled,
|
|
1475
|
-
emptyValue
|
|
1476
|
-
} = options;
|
|
1477
|
-
const handleChange = nextValue => onChange(enumOptionsValueForIndex(nextValue, enumOptions, emptyValue));
|
|
1478
|
-
const handleBlur = () => onBlur(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
1479
|
-
const handleFocus = () => onFocus(id, enumOptionsValueForIndex(value, enumOptions, emptyValue));
|
|
1241
|
+
const { readonlyAsDisabled = true } = formContext;
|
|
1242
|
+
const { enumOptions, enumDisabled, emptyValue } = options;
|
|
1243
|
+
const handleChange = (nextValue) => onChange(enumOptionsValueForIndex3(nextValue, enumOptions, emptyValue));
|
|
1244
|
+
const handleBlur = () => onBlur(id, enumOptionsValueForIndex3(value, enumOptions, emptyValue));
|
|
1245
|
+
const handleFocus = () => onFocus(id, enumOptionsValueForIndex3(value, enumOptions, emptyValue));
|
|
1480
1246
|
const filterOption = (input, option) => {
|
|
1481
|
-
if (option &&
|
|
1482
|
-
// labels are strings in this context
|
|
1247
|
+
if (option && isString2(option.label)) {
|
|
1483
1248
|
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
|
|
1484
1249
|
}
|
|
1485
1250
|
return false;
|
|
1486
1251
|
};
|
|
1487
|
-
const getPopupContainer = node => node.parentNode;
|
|
1488
|
-
const selectedIndexes =
|
|
1489
|
-
// Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
|
|
1490
|
-
// they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
|
|
1252
|
+
const getPopupContainer = (node) => node.parentNode;
|
|
1253
|
+
const selectedIndexes = enumOptionsIndexForValue3(value, enumOptions, multiple);
|
|
1491
1254
|
const extraProps = {
|
|
1492
1255
|
name: id
|
|
1493
1256
|
};
|
|
1494
|
-
return
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
label: optionLabel
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1257
|
+
return /* @__PURE__ */ jsx22(
|
|
1258
|
+
Select,
|
|
1259
|
+
{
|
|
1260
|
+
autoFocus: autofocus,
|
|
1261
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1262
|
+
getPopupContainer,
|
|
1263
|
+
id,
|
|
1264
|
+
mode: multiple ? "multiple" : void 0,
|
|
1265
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
1266
|
+
onChange: !readonly ? handleChange : void 0,
|
|
1267
|
+
onFocus: !readonly ? handleFocus : void 0,
|
|
1268
|
+
placeholder,
|
|
1269
|
+
style: SELECT_STYLE,
|
|
1270
|
+
value: selectedIndexes,
|
|
1271
|
+
...extraProps,
|
|
1272
|
+
filterOption,
|
|
1273
|
+
"aria-describedby": ariaDescribedByIds10(id),
|
|
1274
|
+
children: Array.isArray(enumOptions) && enumOptions.map(({ value: optionValue, label: optionLabel }, index) => /* @__PURE__ */ jsx22(
|
|
1275
|
+
Select.Option,
|
|
1276
|
+
{
|
|
1277
|
+
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(optionValue) !== -1,
|
|
1278
|
+
value: String(index),
|
|
1279
|
+
children: optionLabel
|
|
1280
|
+
},
|
|
1281
|
+
String(index)
|
|
1282
|
+
))
|
|
1283
|
+
}
|
|
1284
|
+
);
|
|
1518
1285
|
}
|
|
1519
1286
|
|
|
1520
|
-
|
|
1521
|
-
|
|
1287
|
+
// src/widgets/TextareaWidget/index.tsx
|
|
1288
|
+
import Input4 from "antd/lib/input";
|
|
1289
|
+
import {
|
|
1290
|
+
ariaDescribedByIds as ariaDescribedByIds11
|
|
1291
|
+
} from "@rjsf/utils";
|
|
1292
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
1293
|
+
var INPUT_STYLE3 = {
|
|
1294
|
+
width: "100%"
|
|
1522
1295
|
};
|
|
1523
|
-
/** The `TextareaWidget` is a widget for rendering input fields as textarea.
|
|
1524
|
-
*
|
|
1525
|
-
* @param props - The `WidgetProps` for this component
|
|
1526
|
-
*/
|
|
1527
1296
|
function TextareaWidget({
|
|
1528
1297
|
disabled,
|
|
1529
1298
|
formContext,
|
|
@@ -1536,39 +1305,33 @@ function TextareaWidget({
|
|
|
1536
1305
|
readonly,
|
|
1537
1306
|
value
|
|
1538
1307
|
}) {
|
|
1539
|
-
const {
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
const
|
|
1543
|
-
target
|
|
1544
|
-
}) => onChange(target.value === '' ? options.emptyValue : target.value);
|
|
1545
|
-
const handleBlur = ({
|
|
1546
|
-
target
|
|
1547
|
-
}) => onBlur(id, target.value);
|
|
1548
|
-
const handleFocus = ({
|
|
1549
|
-
target
|
|
1550
|
-
}) => onFocus(id, target.value);
|
|
1551
|
-
// Antd's typescript definitions do not contain the following props that are actually necessary and, if provided,
|
|
1552
|
-
// they are used, so hacking them in via by spreading `extraProps` on the component to avoid typescript errors
|
|
1308
|
+
const { readonlyAsDisabled = true } = formContext;
|
|
1309
|
+
const handleChange = ({ target }) => onChange(target.value === "" ? options.emptyValue : target.value);
|
|
1310
|
+
const handleBlur = ({ target }) => onBlur(id, target.value);
|
|
1311
|
+
const handleFocus = ({ target }) => onFocus(id, target.value);
|
|
1553
1312
|
const extraProps = {
|
|
1554
|
-
type:
|
|
1313
|
+
type: "textarea"
|
|
1555
1314
|
};
|
|
1556
|
-
return
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1315
|
+
return /* @__PURE__ */ jsx23(
|
|
1316
|
+
Input4.TextArea,
|
|
1317
|
+
{
|
|
1318
|
+
disabled: disabled || readonlyAsDisabled && readonly,
|
|
1319
|
+
id,
|
|
1320
|
+
name: id,
|
|
1321
|
+
onBlur: !readonly ? handleBlur : void 0,
|
|
1322
|
+
onChange: !readonly ? handleChange : void 0,
|
|
1323
|
+
onFocus: !readonly ? handleFocus : void 0,
|
|
1324
|
+
placeholder,
|
|
1325
|
+
rows: options.rows || 4,
|
|
1326
|
+
style: INPUT_STYLE3,
|
|
1327
|
+
value,
|
|
1328
|
+
...extraProps,
|
|
1329
|
+
"aria-describedby": ariaDescribedByIds11(id)
|
|
1330
|
+
}
|
|
1331
|
+
);
|
|
1570
1332
|
}
|
|
1571
1333
|
|
|
1334
|
+
// src/widgets/index.ts
|
|
1572
1335
|
function generateWidgets() {
|
|
1573
1336
|
return {
|
|
1574
1337
|
AltDateTimeWidget,
|
|
@@ -1584,19 +1347,30 @@ function generateWidgets() {
|
|
|
1584
1347
|
TextareaWidget
|
|
1585
1348
|
};
|
|
1586
1349
|
}
|
|
1587
|
-
var
|
|
1350
|
+
var widgets_default = generateWidgets();
|
|
1588
1351
|
|
|
1352
|
+
// src/index.ts
|
|
1589
1353
|
function generateTheme() {
|
|
1590
1354
|
return {
|
|
1591
1355
|
templates: generateTemplates(),
|
|
1592
1356
|
widgets: generateWidgets()
|
|
1593
1357
|
};
|
|
1594
1358
|
}
|
|
1595
|
-
|
|
1359
|
+
var Theme = generateTheme();
|
|
1596
1360
|
function generateForm() {
|
|
1597
1361
|
return withTheme(generateTheme());
|
|
1598
1362
|
}
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
export {
|
|
1363
|
+
var Form3 = generateForm();
|
|
1364
|
+
var src_default = Form3;
|
|
1365
|
+
export {
|
|
1366
|
+
Form3 as Form,
|
|
1367
|
+
templates_default as Templates,
|
|
1368
|
+
Theme,
|
|
1369
|
+
widgets_default as Widgets,
|
|
1370
|
+
src_default as default,
|
|
1371
|
+
generateForm,
|
|
1372
|
+
generateTemplates,
|
|
1373
|
+
generateTheme,
|
|
1374
|
+
generateWidgets
|
|
1375
|
+
};
|
|
1602
1376
|
//# sourceMappingURL=antd.esm.js.map
|