xmirror-components 1.0.25 → 1.0.26-alpha.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/build/dist/index.cjs +24 -20
- package/build/dist/index.mjs +1405 -1302
- package/build/es/components/AntdApp/index.d.ts +4 -1
- package/build/es/components/AntdApp/index.js +6 -4
- package/build/es/components/ConfigProvider/index.d.ts +9 -0
- package/build/es/components/ConfigProvider/index.js +53 -0
- package/build/es/components/ConfigProvider/types.d.ts +15 -0
- package/build/es/components/ConfigProvider/types.js +1 -0
- package/build/es/components/IconButton/index.d.ts +1 -1
- package/build/es/components/IconButton/index.js +9 -4
- package/build/es/components/IconFont/index.d.ts +8 -2
- package/build/es/components/IconFont/index.js +17 -4
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +1 -0
- package/build/lib/components/AntdApp/index.d.ts +4 -1
- package/build/lib/components/AntdApp/index.js +6 -4
- package/build/lib/components/ConfigProvider/index.d.ts +9 -0
- package/build/lib/components/ConfigProvider/index.js +60 -0
- package/build/lib/components/ConfigProvider/types.d.ts +15 -0
- package/build/lib/components/ConfigProvider/types.js +2 -0
- package/build/lib/components/IconButton/index.d.ts +1 -1
- package/build/lib/components/IconButton/index.js +42 -4
- package/build/lib/components/IconFont/index.d.ts +8 -2
- package/build/lib/components/IconFont/index.js +19 -3
- package/build/lib/index.d.ts +37 -4
- package/build/lib/index.js +4 -1
- package/build/package.json +3 -2
- package/build/types/components/AntdApp/index.d.ts +4 -1
- package/build/types/components/ConfigProvider/index.d.ts +9 -0
- package/build/types/components/ConfigProvider/types.d.ts +15 -0
- package/build/types/components/IconButton/index.d.ts +1 -1
- package/build/types/components/IconFont/index.d.ts +8 -2
- package/build/types/index.d.ts +1 -0
- package/package.json +3 -2
|
@@ -3,9 +3,12 @@ import { type AppProps } from 'antd';
|
|
|
3
3
|
import { type MessageInstance } from 'antd/es/message/interface';
|
|
4
4
|
import { type NotificationInstance } from 'antd/es/notification/interface';
|
|
5
5
|
import { type ModalStaticFunctions } from 'antd/es/modal/confirm';
|
|
6
|
+
import { type ConfigProviderConfigProps } from './../ConfigProvider';
|
|
6
7
|
declare let message: MessageInstance;
|
|
7
8
|
declare let notification: NotificationInstance;
|
|
8
9
|
declare let modal: Omit<ModalStaticFunctions, 'warn'>;
|
|
9
|
-
declare function Index({ children, ...props }: AppProps
|
|
10
|
+
declare function Index({ children, config, ...props }: AppProps & {
|
|
11
|
+
config?: ConfigProviderConfigProps;
|
|
12
|
+
}): React.JSX.Element;
|
|
10
13
|
export { message, notification, modal };
|
|
11
14
|
export default Index;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConfigContextProps, ConfigProviderConfigProps } from './types';
|
|
3
|
+
export type { ConfigProviderConfigProps, ConfigContextProps } from './types';
|
|
4
|
+
export declare const ConfigContext: React.Context<ConfigContextProps>;
|
|
5
|
+
interface ConfigProviderProps {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
config: ConfigProviderConfigProps;
|
|
8
|
+
}
|
|
9
|
+
export default function ConfigProvider({ children, config }: ConfigProviderProps): React.JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { IconButtonProps } from "../IconButton";
|
|
3
|
+
import { IconFontProps } from "../IconFont";
|
|
4
|
+
type IconButtonConfig = Pick<IconButtonProps, 'size' | 'className' | 'style'> & {
|
|
5
|
+
render: (props: IconButtonProps & {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}) => React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
type IconFontConfig = Pick<IconFontProps, 'className' | 'style'>;
|
|
10
|
+
export interface ConfigContextProps {
|
|
11
|
+
iconButton: IconButtonConfig;
|
|
12
|
+
iconFont: IconFontConfig;
|
|
13
|
+
}
|
|
14
|
+
export type ConfigProviderConfigProps = Partial<ConfigContextProps>;
|
|
15
|
+
export {};
|
|
@@ -22,7 +22,7 @@ interface ButtonTooltipProps {
|
|
|
22
22
|
disabled?: boolean;
|
|
23
23
|
children?: React.ReactNode;
|
|
24
24
|
}
|
|
25
|
-
interface IconButtonProps extends Omit<ButtonTooltipProps, 'children'> {
|
|
25
|
+
export interface IconButtonProps extends Omit<ButtonTooltipProps, 'children'> {
|
|
26
26
|
/**
|
|
27
27
|
* 图标
|
|
28
28
|
*/
|
|
@@ -12,10 +12,16 @@ interface IconFontCommonProps {
|
|
|
12
12
|
* 是否使用 symbol 模式
|
|
13
13
|
*/
|
|
14
14
|
symbol?: boolean;
|
|
15
|
+
[attrs: string]: any;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
export type IconFontProps = (IconFontCommonProps & React.SVGProps<SVGSVGElement> & {
|
|
18
|
+
symbol: true;
|
|
19
|
+
}) | (IconFontCommonProps & React.HTMLAttributes<HTMLElement> & {
|
|
17
20
|
symbol?: false;
|
|
18
|
-
})
|
|
21
|
+
});
|
|
22
|
+
declare const IconFont: React.ForwardRefExoticComponent<(Omit<IconFontCommonProps & React.SVGProps<SVGSVGElement> & {
|
|
19
23
|
symbol: true;
|
|
24
|
+
}, "ref"> | Omit<IconFontCommonProps & React.HTMLAttributes<HTMLElement> & {
|
|
25
|
+
symbol?: false;
|
|
20
26
|
}, "ref">) & React.RefAttributes<HTMLElement | SVGSVGElement>>;
|
|
21
27
|
export default IconFont;
|
package/build/types/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export { default as CheckboxValue } from './components/CheckboxValue';
|
|
|
4
4
|
export { default as SwitchValue } from './components/SwitchValue';
|
|
5
5
|
export { default as IconButton } from './components/IconButton';
|
|
6
6
|
export { default as GlobalLoading, setGlobalLoading } from './components/GlobalLoading';
|
|
7
|
+
export { default as ConfigProvider, ConfigContext } from './components/ConfigProvider';
|
|
7
8
|
export { default as useRequest } from './hooks/useRequest';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xmirror-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26-alpha.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "build/lib/index.js",
|
|
6
6
|
"module": "build/es/index.js",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"lint": "eslint .",
|
|
20
20
|
"preview": "vite preview",
|
|
21
21
|
"prepublishOnly": "npm run build",
|
|
22
|
-
"publish:npm": "npm publish --access public"
|
|
22
|
+
"publish:npm": "npm publish --access public",
|
|
23
|
+
"publish:dev": "npm publish --access public --tag dev"
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|
|
25
26
|
"antd": ">=5.0.0",
|