@teamias/rex-design 0.1.20 → 0.1.21
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.
|
@@ -24,6 +24,11 @@ export interface RexProConfigContextType {
|
|
|
24
24
|
push: (to: string, state?: unknown) => void;
|
|
25
25
|
replace: (to: string, state?: unknown) => void;
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* 默认注入根组件
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
defaultInjectRootComponent?: boolean;
|
|
27
32
|
/** 支持一些自定义属性 */
|
|
28
33
|
[key: string]: unknown | undefined;
|
|
29
34
|
}
|
|
@@ -8,12 +8,14 @@ import { FileViewerRoot, SimpleModalRoot } from "../..";
|
|
|
8
8
|
import { RawIntlProvider } from 'react-intl';
|
|
9
9
|
import { RexProConfigContext, defaultApiClient, defaultIntl } from "./rex-pro-config-context";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
11
12
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
export var RexProConfigProvider = function RexProConfigProvider(_ref) {
|
|
13
|
-
var _value$intl, _value$apiClient;
|
|
14
|
+
var _value$intl, _value$defaultInjectR, _value$apiClient;
|
|
14
15
|
var value = _ref.value,
|
|
15
16
|
children = _ref.children;
|
|
16
17
|
var intl = (_value$intl = value.intl) !== null && _value$intl !== void 0 ? _value$intl : defaultIntl;
|
|
18
|
+
var defaultInjectRootComponent = (_value$defaultInjectR = value.defaultInjectRootComponent) !== null && _value$defaultInjectR !== void 0 ? _value$defaultInjectR : true;
|
|
17
19
|
var apiClient = (_value$apiClient = value.apiClient) !== null && _value$apiClient !== void 0 ? _value$apiClient : defaultApiClient;
|
|
18
20
|
return /*#__PURE__*/_jsx(RexProConfigContext.Provider, {
|
|
19
21
|
value: _objectSpread(_objectSpread({}, value), {}, {
|
|
@@ -22,7 +24,9 @@ export var RexProConfigProvider = function RexProConfigProvider(_ref) {
|
|
|
22
24
|
}),
|
|
23
25
|
children: /*#__PURE__*/_jsxs(RawIntlProvider, {
|
|
24
26
|
value: intl,
|
|
25
|
-
children: [children,
|
|
27
|
+
children: [children, defaultInjectRootComponent ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
28
|
+
children: [/*#__PURE__*/_jsx(FileViewerRoot, {}), /*#__PURE__*/_jsx(SimpleModalRoot, {})]
|
|
29
|
+
}) : /*#__PURE__*/_jsx(_Fragment, {})]
|
|
26
30
|
})
|
|
27
31
|
});
|
|
28
32
|
};
|