@tendaui/components 1.0.0
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/LICENSE +21 -0
- package/README.md +176 -0
- package/alert/Alert.tsx +147 -0
- package/alert/defaultProps.ts +3 -0
- package/alert/index.ts +9 -0
- package/alert/style/css.js +1 -0
- package/alert/style/index.js +1 -0
- package/alert/type.ts +44 -0
- package/badge/Badge.tsx +85 -0
- package/badge/defaultProps.ts +10 -0
- package/badge/index.ts +9 -0
- package/badge/style/css.js +1 -0
- package/badge/style/index.js +1 -0
- package/badge/type.ts +51 -0
- package/button/Button.tsx +95 -0
- package/button/defaultProps.ts +13 -0
- package/button/index.ts +7 -0
- package/button/style/css.js +1 -0
- package/button/style/index.js +1 -0
- package/button/type.ts +82 -0
- package/checkbox/Checkbox.tsx +19 -0
- package/checkbox/CheckboxGroup.tsx +207 -0
- package/checkbox/defaultProps.ts +14 -0
- package/checkbox/index.ts +10 -0
- package/checkbox/style/css.js +1 -0
- package/checkbox/style/index.js +1 -0
- package/checkbox/type.ts +117 -0
- package/common/Check.tsx +131 -0
- package/common/FakeArrow.tsx +36 -0
- package/common/PluginContainer.tsx +21 -0
- package/common/Portal.tsx +67 -0
- package/common.ts +76 -0
- package/config-provider/ConfigContext.tsx +21 -0
- package/config-provider/ConfigProvider.tsx +53 -0
- package/config-provider/index.ts +9 -0
- package/config-provider/type.ts +1062 -0
- package/dialog/Dialog.tsx +254 -0
- package/dialog/DialogCard.tsx +152 -0
- package/dialog/defaultProps.ts +25 -0
- package/dialog/hooks/useDialogDrag.ts +50 -0
- package/dialog/hooks/useDialogEsc.ts +31 -0
- package/dialog/hooks/useDialogPosition.ts +36 -0
- package/dialog/hooks/useLockStyle.ts +54 -0
- package/dialog/index.ts +13 -0
- package/dialog/plugin.tsx +78 -0
- package/dialog/style/css.js +1 -0
- package/dialog/style/index.js +1 -0
- package/dialog/type.ts +241 -0
- package/dialog/utils.ts +4 -0
- package/form/Form.tsx +136 -0
- package/form/FormContext.tsx +64 -0
- package/form/FormItem.tsx +554 -0
- package/form/FormList.tsx +303 -0
- package/form/const.ts +6 -0
- package/form/defaultProps.ts +26 -0
- package/form/formModel.ts +117 -0
- package/form/hooks/interface.ts +20 -0
- package/form/hooks/useForm.ts +122 -0
- package/form/hooks/useFormItemInitialData.ts +95 -0
- package/form/hooks/useFormItemStyle.tsx +122 -0
- package/form/hooks/useInstance.tsx +275 -0
- package/form/hooks/useWatch.ts +42 -0
- package/form/index.ts +11 -0
- package/form/style/css.js +1 -0
- package/form/style/index.js +1 -0
- package/form/type.ts +519 -0
- package/form/utils/index.ts +69 -0
- package/hooks/useAttach.ts +24 -0
- package/hooks/useCommonClassName.ts +45 -0
- package/hooks/useConfig.ts +3 -0
- package/hooks/useControlled.ts +39 -0
- package/hooks/useDefaultProps.ts +16 -0
- package/hooks/useDomCallback.ts +13 -0
- package/hooks/useDomRefCallback.ts +12 -0
- package/hooks/useDragSorter.tsx +151 -0
- package/hooks/useEventCallback.ts +47 -0
- package/hooks/useGlobalConfig.ts +14 -0
- package/hooks/useGlobalIcon.ts +14 -0
- package/hooks/useLastest.ts +13 -0
- package/hooks/useLayoutEffect.ts +7 -0
- package/hooks/useMouseEvent.ts +142 -0
- package/hooks/useMutationObserver.ts +56 -0
- package/hooks/usePopper.ts +189 -0
- package/hooks/useRipple.ts +0 -0
- package/hooks/useSetState.ts +25 -0
- package/hooks/useVirtualScroll.ts +246 -0
- package/hooks/useWindowSize.ts +31 -0
- package/index.ts +70 -0
- package/input/Input.tsx +383 -0
- package/input/InputGroup.tsx +29 -0
- package/input/defaultProps.ts +22 -0
- package/input/index.ts +11 -0
- package/input/style/css.js +1 -0
- package/input/style/index.js +1 -0
- package/input/type.ts +219 -0
- package/loading/Gradient.tsx +36 -0
- package/loading/Loading.tsx +169 -0
- package/loading/circleAdapter.ts +44 -0
- package/loading/defaultProps.ts +12 -0
- package/loading/index.ts +13 -0
- package/loading/style/css.js +1 -0
- package/loading/style/index.js +1 -0
- package/loading/type.ts +71 -0
- package/loading/utils/setStyle.ts +13 -0
- package/myform/index.ts +0 -0
- package/notification/Notify.ts +24 -0
- package/notification/NotifyContainer.tsx +90 -0
- package/notification/NotifyContext.tsx +173 -0
- package/notification/NotifyItem.tsx +121 -0
- package/notification/index.ts +3 -0
- package/notification/style/css.js +1 -0
- package/notification/style/index.js +1 -0
- package/notification/type.ts +23 -0
- package/package.json +52 -0
- package/popup/Popup.tsx +264 -0
- package/popup/defaultProps.ts +13 -0
- package/popup/hooks/useTrigger.ts +276 -0
- package/popup/index.ts +6 -0
- package/popup/style/css.js +1 -0
- package/popup/style/index.js +1 -0
- package/popup/type.ts +130 -0
- package/portal/Portal.tsx +63 -0
- package/portal/index.ts +1 -0
- package/select/Option.tsx +162 -0
- package/select/OptionGroup.tsx +30 -0
- package/select/PopupContent.tsx +271 -0
- package/select/Select.tsx +586 -0
- package/select/defaultProps.ts +27 -0
- package/select/hooks/useOptions.ts +120 -0
- package/select/hooks/usePanelVirtualScroll.ts +111 -0
- package/select/index.ts +9 -0
- package/select/style/css.js +1 -0
- package/select/style/index.js +2 -0
- package/select/type.ts +382 -0
- package/select/utils/helper.ts +256 -0
- package/select-input/SelectInput.tsx +98 -0
- package/select-input/defaultProps.ts +15 -0
- package/select-input/hook/useMultiple.tsx +100 -0
- package/select-input/hook/useOverlayInnerStyle.ts +84 -0
- package/select-input/hook/useSingle.tsx +112 -0
- package/select-input/index.ts +6 -0
- package/select-input/interface.ts +18 -0
- package/select-input/style/css.js +1 -0
- package/select-input/style/index.js +1 -0
- package/select-input/type.ts +280 -0
- package/space/defaultProps.ts +0 -0
- package/space/index.ts +0 -0
- package/space/type.ts +0 -0
- package/style/index.js +2 -0
- package/styles/_global.scss +39 -0
- package/styles/_vars.scss +386 -0
- package/styles/components/alert/_index.scss +175 -0
- package/styles/components/alert/_vars.scss +39 -0
- package/styles/components/badge/_index.scss +70 -0
- package/styles/components/badge/_vars.scss +25 -0
- package/styles/components/button/_index.scss +511 -0
- package/styles/components/button/_mixins.scss +39 -0
- package/styles/components/button/_vars.scss +122 -0
- package/styles/components/checkbox/_index.scss +158 -0
- package/styles/components/checkbox/_mixin.scss +0 -0
- package/styles/components/checkbox/_var.scss +60 -0
- package/styles/components/dialog/_animate.scss +135 -0
- package/styles/components/dialog/_index.scss +311 -0
- package/styles/components/dialog/_mixins.scss +0 -0
- package/styles/components/dialog/_vars.scss +59 -0
- package/styles/components/form/_index.scss +174 -0
- package/styles/components/form/_mixins.scss +76 -0
- package/styles/components/form/_vars.scss +100 -0
- package/styles/components/input/_index.scss +349 -0
- package/styles/components/input/_map.scss +0 -0
- package/styles/components/input/_mixins.scss +116 -0
- package/styles/components/input/_vars.scss +134 -0
- package/styles/components/loading/_index.scss +112 -0
- package/styles/components/loading/_vars.scss +39 -0
- package/styles/components/notification/_index.scss +160 -0
- package/styles/components/notification/_mixins.scss +12 -0
- package/styles/components/notification/_vars.scss +59 -0
- package/styles/components/popup/_index.scss +82 -0
- package/styles/components/popup/_mixin.scss +149 -0
- package/styles/components/popup/_var.scss +31 -0
- package/styles/components/select/_index.scss +290 -0
- package/styles/components/select/_var.scss +65 -0
- package/styles/components/select-input/_index.scss +5 -0
- package/styles/components/select-input/_var.scss +3 -0
- package/styles/components/switch/_index.scss +279 -0
- package/styles/components/switch/_mixins.scss +0 -0
- package/styles/components/switch/_vars.scss +61 -0
- package/styles/components/tag/_index.scss +316 -0
- package/styles/components/tag/_var.scss +85 -0
- package/styles/components/tag-input/_index.scss +163 -0
- package/styles/components/tag-input/_vars.scss +16 -0
- package/styles/globals.css +250 -0
- package/styles/mixins/_focus.scss +7 -0
- package/styles/mixins/_layout.scss +32 -0
- package/styles/mixins/_reset.scss +10 -0
- package/styles/mixins/_scrollbar.scss +31 -0
- package/styles/mixins/_text.scss +48 -0
- package/styles/rillple.css +16 -0
- package/styles/scrollbar.css +42 -0
- package/styles/themes/_dark.scss +191 -0
- package/styles/themes/_font.scss +79 -0
- package/styles/themes/_index.scss +5 -0
- package/styles/themes/_light.scss +190 -0
- package/styles/themes/_radius.scss +9 -0
- package/styles/themes/_size.scss +68 -0
- package/styles/themes.css +66 -0
- package/styles/utilities/_animation.scss +57 -0
- package/styles/utilities/_tips.scss +9 -0
- package/switch/Switch.tsx +120 -0
- package/switch/defaultProps.ts +3 -0
- package/switch/index.ts +7 -0
- package/switch/style/css.js +1 -0
- package/switch/style/index.js +1 -0
- package/switch/type.ts +46 -0
- package/tag/Tag.tsx +149 -0
- package/tag/defaultProps.ts +19 -0
- package/tag/index.ts +8 -0
- package/tag/style/css.js +1 -0
- package/tag/style/index.js +1 -0
- package/tag/type.ts +170 -0
- package/tag-input/TagInput.tsx +215 -0
- package/tag-input/defaultProps.ts +15 -0
- package/tag-input/hooks/useHover.ts +28 -0
- package/tag-input/hooks/useTagList.tsx +131 -0
- package/tag-input/hooks/useTagScroll.ts +105 -0
- package/tag-input/index.ts +9 -0
- package/tag-input/style/css.js +1 -0
- package/tag-input/style/index.js +1 -0
- package/tag-input/type.ts +224 -0
- package/tag-input/useTagList.tsx +131 -0
- package/utils/composeRefs.ts +14 -0
- package/utils/dom.ts +29 -0
- package/utils/forwardRefWithStatics.ts +12 -0
- package/utils/getScrollbarWidth.ts +11 -0
- package/utils/helper.ts +161 -0
- package/utils/isFragment.ts +22 -0
- package/utils/listener.ts +37 -0
- package/utils/noop.ts +3 -0
- package/utils/parentTNode.ts +38 -0
- package/utils/parseTNode.ts +38 -0
- package/utils/react-render.ts +108 -0
- package/utils/ref.ts +6 -0
- package/utils/refs.ts +81 -0
- package/utils/style.ts +60 -0
- package/utils/transition.ts +28 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { forwardRef, useMemo, useImperativeHandle } from "react";
|
|
2
|
+
import { createPortal } from "react-dom";
|
|
3
|
+
import { AttachNode, AttachNodeReturnValue } from "../common";
|
|
4
|
+
import { canUseDocument } from "../utils/dom";
|
|
5
|
+
import useConfig from "../hooks/useConfig";
|
|
6
|
+
import useIsomorphicLayoutEffect from "../hooks/useLayoutEffect";
|
|
7
|
+
|
|
8
|
+
export interface PortalProps {
|
|
9
|
+
/**
|
|
10
|
+
* 指定挂载的 HTML 节点, false 为挂载在 body
|
|
11
|
+
*/
|
|
12
|
+
attach?: React.ReactElement | AttachNode | boolean;
|
|
13
|
+
/**
|
|
14
|
+
* 触发元素
|
|
15
|
+
*/
|
|
16
|
+
triggerNode?: HTMLElement;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function getAttach(attach: PortalProps["attach"], triggerNode?: HTMLElement): AttachNodeReturnValue {
|
|
21
|
+
if (!canUseDocument) return null;
|
|
22
|
+
|
|
23
|
+
let el: AttachNodeReturnValue;
|
|
24
|
+
if (typeof attach === "string") {
|
|
25
|
+
el = document.querySelector(attach);
|
|
26
|
+
}
|
|
27
|
+
if (typeof attach === "function") {
|
|
28
|
+
el = attach(triggerNode);
|
|
29
|
+
}
|
|
30
|
+
if (typeof attach === "object" && attach instanceof window.HTMLElement) {
|
|
31
|
+
el = attach;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// fix el in iframe
|
|
35
|
+
if (el && el.nodeType === 1) return el;
|
|
36
|
+
|
|
37
|
+
return document.body;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const Portal = forwardRef((props: PortalProps, ref) => {
|
|
41
|
+
const { attach, children, triggerNode } = props;
|
|
42
|
+
const { classPrefix } = useConfig();
|
|
43
|
+
|
|
44
|
+
const container = useMemo(() => {
|
|
45
|
+
if (!canUseDocument) return null;
|
|
46
|
+
const el = document.createElement("div");
|
|
47
|
+
el.className = `${classPrefix}-portal-wrapper`;
|
|
48
|
+
return el;
|
|
49
|
+
}, [classPrefix]);
|
|
50
|
+
|
|
51
|
+
useIsomorphicLayoutEffect(() => {
|
|
52
|
+
const parentElement = getAttach(attach, triggerNode);
|
|
53
|
+
parentElement?.appendChild?.(container);
|
|
54
|
+
|
|
55
|
+
return () => {
|
|
56
|
+
parentElement?.removeChild?.(container);
|
|
57
|
+
};
|
|
58
|
+
}, [container, attach, triggerNode]);
|
|
59
|
+
|
|
60
|
+
useImperativeHandle(ref, () => container);
|
|
61
|
+
|
|
62
|
+
return canUseDocument ? createPortal(children, container) : null;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
Portal.displayName = "Portal";
|
|
66
|
+
|
|
67
|
+
export default Portal;
|
package/common.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, { CSSProperties, ReactElement, FormEvent } from "react";
|
|
2
|
+
export interface StyledProps {
|
|
3
|
+
style?: React.CSSProperties;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export type FormResetEvent = FormEvent<HTMLFormElement>;
|
|
7
|
+
export type FormSubmitEvent = FormEvent<HTMLFormElement>;
|
|
8
|
+
export type AttachNodeReturnValue = HTMLElement | Element | Document | null;
|
|
9
|
+
export type AttachNode = CSSSelector | ((triggerNode?: HTMLElement) => AttachNodeReturnValue);
|
|
10
|
+
|
|
11
|
+
export type CSSSelector = string;
|
|
12
|
+
|
|
13
|
+
export type Styles = CSSProperties;
|
|
14
|
+
|
|
15
|
+
export type TNode<T = undefined> = T extends undefined
|
|
16
|
+
? React.ReactNode
|
|
17
|
+
: React.ReactNode | ((props: T) => React.ReactNode);
|
|
18
|
+
|
|
19
|
+
export type ClassName = string | string[] | { [key: string]: boolean };
|
|
20
|
+
|
|
21
|
+
export type SizeEnum = "small" | "medium" | "large";
|
|
22
|
+
|
|
23
|
+
export type ShapeEnum = "circle" | "round";
|
|
24
|
+
|
|
25
|
+
export type HorizontalAlignEnum = "left" | "center" | "right";
|
|
26
|
+
|
|
27
|
+
export type VerticalAlignEnum = "top" | "middle" | "bottom";
|
|
28
|
+
|
|
29
|
+
export type LayoutEnum = "vertical" | "horizontal";
|
|
30
|
+
// TElement 表示 API 只接受传入组件
|
|
31
|
+
export type TElement<T = undefined> = T extends undefined ? ReactElement : (props: T) => ReactElement;
|
|
32
|
+
|
|
33
|
+
export interface TScroll {
|
|
34
|
+
/**
|
|
35
|
+
* 表示除可视区域外,额外渲染的行数,避免快速滚动过程中,新出现的内容来不及渲染从而出现空白
|
|
36
|
+
* @default 20
|
|
37
|
+
*/
|
|
38
|
+
bufferSize?: number;
|
|
39
|
+
/**
|
|
40
|
+
* 表示每行内容是否同一个固定高度,仅在 `scroll.type` 为 `virtual` 时有效,该属性设置为 `true` 时,可用于简化虚拟滚动内部计算逻辑,提升性能,此时则需要明确指定 `scroll.rowHeight` 属性的值
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
isFixedRowHeight?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* 行高,不会给元素添加样式高度,仅作为滚动时的行高参考。一般情况不需要设置该属性。如果设置,可尽量将该属性设置为每行平均高度,从而使得滚动过程更加平滑
|
|
46
|
+
*/
|
|
47
|
+
rowHeight?: number;
|
|
48
|
+
/**
|
|
49
|
+
* 启动虚拟滚动的阈值。为保证组件收益最大化,当数据量小于阈值 `scroll.threshold` 时,无论虚拟滚动的配置是否存在,组件内部都不会开启虚拟滚动
|
|
50
|
+
* @default 100
|
|
51
|
+
*/
|
|
52
|
+
threshold?: number;
|
|
53
|
+
/**
|
|
54
|
+
* 滚动加载类型,有两种:懒加载和虚拟滚动。<br />值为 `lazy` ,表示滚动时会进行懒加载,非可视区域内的内容将不会默认渲染,直到该内容可见时,才会进行渲染,并且已渲染的内容滚动到不可见时,不会被销毁;<br />值为`virtual`时,表示会进行虚拟滚动,无论滚动条滚动到哪个位置,同一时刻,仅渲染该可视区域内的内容,当需要展示的数据量较大时,建议开启该特性
|
|
55
|
+
*/
|
|
56
|
+
type: "lazy" | "virtual";
|
|
57
|
+
}
|
|
58
|
+
export interface ScrollToElementParams {
|
|
59
|
+
/** 跳转元素下标 */
|
|
60
|
+
index?: number;
|
|
61
|
+
/** 跳转元素距离顶部的距离 */
|
|
62
|
+
top?: number;
|
|
63
|
+
/** 单个元素高度非固定场景下,即 isFixedRowHeight = false。延迟设置元素位置,一般用于依赖不同高度异步渲染等场景,单位:毫秒 */
|
|
64
|
+
time?: number;
|
|
65
|
+
behavior?: "auto" | "smooth";
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 通用全局类型
|
|
70
|
+
* */
|
|
71
|
+
export type PlainObject = { [key: string]: unknown };
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated use TScroll instead
|
|
75
|
+
*/
|
|
76
|
+
export type InfinityScroll = TScroll;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
import { GlobalConfigProvider } from "./type";
|
|
3
|
+
import Icon from "@tendaui/icons";
|
|
4
|
+
export const defaultClassPrefix = "t";
|
|
5
|
+
|
|
6
|
+
export const defaultGlobalConfig: GlobalConfigProvider = {
|
|
7
|
+
classPrefix: defaultClassPrefix,
|
|
8
|
+
attach: null,
|
|
9
|
+
form: {},
|
|
10
|
+
icon: {} as Record<string, typeof Icon>,
|
|
11
|
+
isContextEffectPlugin: false
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const defaultContext = {
|
|
15
|
+
globalConfig: defaultGlobalConfig
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type Config = typeof defaultContext;
|
|
19
|
+
|
|
20
|
+
const ConfigContext = createContext(defaultContext);
|
|
21
|
+
export default ConfigContext;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
import { mergeWith as _mergeWith, cloneDeep } from "lodash-es";
|
|
3
|
+
import ConfigContext, { defaultGlobalConfig, Config } from "./ConfigContext";
|
|
4
|
+
import { GlobalConfigProvider } from "./type";
|
|
5
|
+
|
|
6
|
+
export interface ConfigProviderProps extends Config {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* 不需要设置全局上下文信息
|
|
10
|
+
* 不传或者false:表示全局上下文变动,需要更新全局上下文的信息放入到变量中
|
|
11
|
+
* true:表示全局上下文信息不需要重新设置,
|
|
12
|
+
* 解决问题:当plugin调用的时候,单独包裹的Provider 也会传全局变量,仅自身可用,多次调用时相互之间不会冲突。
|
|
13
|
+
* 插件单独的config方法依然可用。自身属性通过props传递
|
|
14
|
+
* 例如:多处调用message.config 如果每次都更新全局上下文,插件调用时配置会相互影响,导致行为结果跟预期不一致。
|
|
15
|
+
*/
|
|
16
|
+
notSet?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const merge = (src: GlobalConfigProvider, config: GlobalConfigProvider) =>
|
|
20
|
+
_mergeWith(src, config, (objValue, srcValue) => {
|
|
21
|
+
if (Array.isArray(objValue)) {
|
|
22
|
+
return srcValue;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// 存放全局的上下文配置
|
|
27
|
+
let globalConfig = defaultGlobalConfig;
|
|
28
|
+
|
|
29
|
+
export const getGlobalConfig = (configInfo?: GlobalConfigProvider): GlobalConfigProvider =>
|
|
30
|
+
merge({ ...globalConfig }, configInfo);
|
|
31
|
+
|
|
32
|
+
export const setGlobalConfig = (configInfo?: GlobalConfigProvider) => {
|
|
33
|
+
globalConfig = configInfo;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export default function ConfigProvider({ children, globalConfig, notSet }: ConfigProviderProps) {
|
|
37
|
+
const defaultData = cloneDeep(defaultGlobalConfig);
|
|
38
|
+
const mergedGlobalConfig = merge(defaultData, globalConfig);
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!notSet) {
|
|
42
|
+
// 需要设置的情况下,当配置信息变化时更新变量中的配置信息,方便plugin调用时获取
|
|
43
|
+
setGlobalConfig(mergedGlobalConfig);
|
|
44
|
+
}
|
|
45
|
+
}, [mergedGlobalConfig, notSet]);
|
|
46
|
+
|
|
47
|
+
return <ConfigContext.Provider value={{ globalConfig: mergedGlobalConfig }}>{children}</ConfigContext.Provider>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
ConfigProvider.getGlobalConfig = getGlobalConfig;
|
|
51
|
+
ConfigProvider.setGlobalConfig = setGlobalConfig;
|
|
52
|
+
|
|
53
|
+
ConfigProvider.displayName = "ConfigProvider";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import ConfigProvider, { merge } from "./ConfigProvider";
|
|
2
|
+
import ConfigContext from "./ConfigContext";
|
|
3
|
+
|
|
4
|
+
export type { Config } from "./ConfigContext";
|
|
5
|
+
export type { ConfigProviderProps } from "./ConfigProvider";
|
|
6
|
+
export * from "./type";
|
|
7
|
+
|
|
8
|
+
export { ConfigContext, ConfigProvider, merge };
|
|
9
|
+
export default ConfigProvider;
|