context.js
1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.FormItemPrefixContext = exports.FormProvider = exports.FormItemContext = exports.FormContext = void 0;
var React = _interopRequireWildcard(require("react"));
var _omit = _interopRequireDefault(require("omit.js"));
var _rcFieldForm = require("rc-field-form");
var FormContext = /*#__PURE__*/React.createContext({
labelAlign: 'right',
vertical: false,
itemRef: function itemRef() {}
});
exports.FormContext = FormContext;
var FormItemContext = /*#__PURE__*/React.createContext({
updateItemErrors: function updateItemErrors() {}
});
exports.FormItemContext = FormItemContext;
var FormProvider = function FormProvider(props) {
var providerProps = (0, _omit["default"])(props, ['prefixCls']);
return /*#__PURE__*/React.createElement(_rcFieldForm.FormProvider, providerProps);
};
exports.FormProvider = FormProvider;
var FormItemPrefixContext = /*#__PURE__*/React.createContext({
prefixCls: ''
});
exports.FormItemPrefixContext = FormItemPrefixContext;