@zat-design/sisyphus-react 3.3.3-beta.6 → 3.3.3-beta.7
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.
|
@@ -20,7 +20,7 @@ interface ConfigContext {
|
|
|
20
20
|
export declare const ProConfigContext: React.Context<ConfigContext>;
|
|
21
21
|
export declare function useProConfig(): ConfigContext;
|
|
22
22
|
export declare function useProConfig(name: keyof ConfigContext['state']): ConfigContext['state'][keyof ConfigContext['state']];
|
|
23
|
-
export declare function
|
|
23
|
+
export declare function useContextForms(): Record<string, FormInstance<any>>;
|
|
24
24
|
type ActionsType = 'set' | 'setProEnum' | 'setProEnumDic';
|
|
25
25
|
interface Actions {
|
|
26
26
|
type: ActionsType;
|
|
@@ -24,7 +24,7 @@ export function useProConfig(name) {
|
|
|
24
24
|
var config = useContext(ProConfigContext);
|
|
25
25
|
return name ? config.state[name] : config;
|
|
26
26
|
}
|
|
27
|
-
export function
|
|
27
|
+
export function useContextForms() {
|
|
28
28
|
var _config$state;
|
|
29
29
|
var config = useContext(ProConfigContext);
|
|
30
30
|
return (_config$state = config.state) === null || _config$state === void 0 ? void 0 : _config$state.forms;
|
package/es/ProForm/index.js
CHANGED
|
@@ -20,7 +20,7 @@ import React, { forwardRef, useImperativeHandle, useMemo } from 'react';
|
|
|
20
20
|
import { isObject, isString, merge } from 'lodash';
|
|
21
21
|
import { FormFooter, InputRange, ProAddress, ProAddressBar, ProCertNo, ProCertValidity, ProCombination, ProModalSelect, ProNumberRange, ProRangeBox, ProTimeLimit, transferAddressInfoToRegion, ProUpload, ProTreeSelect, ProTreeModal, ProTree, EnumSelect } from './components';
|
|
22
22
|
import RenderFields from './components/render/RenderFields';
|
|
23
|
-
import { useProConfig,
|
|
23
|
+
import { useProConfig, useContextForms } from '../ProConfigProvider';
|
|
24
24
|
import { getLayout, splitNameStr, useControlled, initialValuesToNames } from './utils/index';
|
|
25
25
|
import { useForm } from './utils/useForm';
|
|
26
26
|
import { useFieldProps } from './utils/useFieldProps';
|
|
@@ -310,7 +310,7 @@ var ProFormProvider = function ProFormProvider(props) {
|
|
|
310
310
|
};
|
|
311
311
|
ProFormForward.Provider = ProFormProvider; // 包装Provider
|
|
312
312
|
ProFormForward.useFieldProps = useFieldProps; // 获取每个字段的其他参数 -otherProps
|
|
313
|
-
ProFormForward.
|
|
313
|
+
ProFormForward.useContextForms = useContextForms; // 获取 ProConfigProvider中的表单实例map
|
|
314
314
|
// 内置组合
|
|
315
315
|
ProFormForward.ProAddressBar = ProAddressBar;
|
|
316
316
|
ProFormForward.ProCombination = ProCombination;
|
|
@@ -20,7 +20,7 @@ interface ConfigContext {
|
|
|
20
20
|
export declare const ProConfigContext: React.Context<ConfigContext>;
|
|
21
21
|
export declare function useProConfig(): ConfigContext;
|
|
22
22
|
export declare function useProConfig(name: keyof ConfigContext['state']): ConfigContext['state'][keyof ConfigContext['state']];
|
|
23
|
-
export declare function
|
|
23
|
+
export declare function useContextForms(): Record<string, FormInstance<any>>;
|
|
24
24
|
type ActionsType = 'set' | 'setProEnum' | 'setProEnumDic';
|
|
25
25
|
interface Actions {
|
|
26
26
|
type: ActionsType;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.ProConfigProvider = exports.ProConfigContext = void 0;
|
|
9
|
-
exports.
|
|
9
|
+
exports.useContextForms = useContextForms;
|
|
10
10
|
exports.useProConfig = useProConfig;
|
|
11
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
12
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
@@ -33,7 +33,7 @@ function useProConfig(name) {
|
|
|
33
33
|
var config = (0, _react.useContext)(ProConfigContext);
|
|
34
34
|
return name ? config.state[name] : config;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function useContextForms() {
|
|
37
37
|
var _config$state;
|
|
38
38
|
var config = (0, _react.useContext)(ProConfigContext);
|
|
39
39
|
return (_config$state = config.state) === null || _config$state === void 0 ? void 0 : _config$state.forms;
|
package/lib/ProForm/index.js
CHANGED
|
@@ -311,7 +311,7 @@ var ProFormProvider = function ProFormProvider(props) {
|
|
|
311
311
|
};
|
|
312
312
|
ProFormForward.Provider = ProFormProvider; // 包装Provider
|
|
313
313
|
ProFormForward.useFieldProps = _useFieldProps.useFieldProps; // 获取每个字段的其他参数 -otherProps
|
|
314
|
-
ProFormForward.
|
|
314
|
+
ProFormForward.useContextForms = _ProConfigProvider.useContextForms; // 获取 ProConfigProvider中的表单实例map
|
|
315
315
|
// 内置组合
|
|
316
316
|
ProFormForward.ProAddressBar = _components.ProAddressBar;
|
|
317
317
|
ProFormForward.ProCombination = _components.ProCombination;
|