x-star-design 0.0.87 → 0.0.88
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.
|
@@ -6,6 +6,7 @@ export interface AcConfigProps extends Omit<FormProps, 'children'> {
|
|
|
6
6
|
contestType?: ContestExamType;
|
|
7
7
|
initialValues?: Configuration;
|
|
8
8
|
onFinish?: (values: Configuration) => void;
|
|
9
|
+
form?: FormInstance<any>;
|
|
9
10
|
}
|
|
10
11
|
export interface AcConfigHandle {
|
|
11
12
|
form: FormInstance<any>;
|
package/dist/ac-config/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
4
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
5
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
6
|
-
var _excluded = ["type", "contestType", "initialValues"];
|
|
6
|
+
var _excluded = ["type", "contestType", "initialValues", "form"];
|
|
7
7
|
import { Divider, Form, Space } from 'antd';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import dayjs from 'dayjs';
|
|
@@ -92,10 +92,12 @@ var AcConfig = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
92
92
|
_ref3$contestType = _ref3.contestType,
|
|
93
93
|
contestType = _ref3$contestType === void 0 ? ContestExamType.Homework : _ref3$contestType,
|
|
94
94
|
initialValues = _ref3.initialValues,
|
|
95
|
+
externalForm = _ref3.form,
|
|
95
96
|
props = _objectWithoutProperties(_ref3, _excluded);
|
|
96
97
|
var _Form$useForm = Form.useForm(),
|
|
97
98
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
98
|
-
|
|
99
|
+
internalForm = _Form$useForm2[0];
|
|
100
|
+
var form = externalForm || internalForm; // 使用外部传入的 form,如果没有则使用内部创建的 form
|
|
99
101
|
var _useLocale = useLocale('AcConfig'),
|
|
100
102
|
t = _useLocale.format,
|
|
101
103
|
locale = _useLocale.locale;
|