@faasjs/ant-design 0.0.4-beta.16 → 0.0.4-beta.17
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/README.md +18 -4
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +7 -8
- package/dist/index.mjs +8 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -447,7 +447,7 @@ ___
|
|
|
447
447
|
|
|
448
448
|
### ConfigProvider
|
|
449
449
|
|
|
450
|
-
▸ **ConfigProvider**(
|
|
450
|
+
▸ **ConfigProvider**(`props`): `Element`
|
|
451
451
|
|
|
452
452
|
Config for @faasjs/ant-design components.
|
|
453
453
|
|
|
@@ -465,9 +465,10 @@ Config for @faasjs/ant-design components.
|
|
|
465
465
|
|
|
466
466
|
| Name | Type |
|
|
467
467
|
| :------ | :------ |
|
|
468
|
-
|
|
|
469
|
-
|
|
|
470
|
-
|
|
|
468
|
+
| `props` | `Object` |
|
|
469
|
+
| `props.children` | `ReactNode` |
|
|
470
|
+
| `props.config` | [`ConfigProviderProps`](interfaces/ConfigProviderProps.md) |
|
|
471
|
+
| `props.faasClientOptions?` | `FaasReactClientOptions` |
|
|
471
472
|
|
|
472
473
|
#### Returns
|
|
473
474
|
|
|
@@ -715,6 +716,11 @@ ___
|
|
|
715
716
|
|
|
716
717
|
Table component with Ant Design & FaasJS
|
|
717
718
|
|
|
719
|
+
- Support all Ant Design Table props.
|
|
720
|
+
- Support FaasJS injection.
|
|
721
|
+
- Auto generate filter dropdown (disable with `filterDropdown: false`).
|
|
722
|
+
- Auto generate sorter (disable with `sorter: false`).
|
|
723
|
+
|
|
718
724
|
#### Type parameters
|
|
719
725
|
|
|
720
726
|
| Name | Type |
|
|
@@ -862,6 +868,14 @@ ___
|
|
|
862
868
|
|
|
863
869
|
▸ **useApp**(): [`useAppProps`](interfaces/useAppProps.md)
|
|
864
870
|
|
|
871
|
+
Get app context.
|
|
872
|
+
|
|
873
|
+
```ts
|
|
874
|
+
import { useApp } from '@faasjs/ant-design'
|
|
875
|
+
|
|
876
|
+
const { message, notification, setModalProps, setDrawerProps } = useApp()
|
|
877
|
+
```
|
|
878
|
+
|
|
865
879
|
#### Returns
|
|
866
880
|
|
|
867
881
|
[`useAppProps`](interfaces/useAppProps.md)
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorBoundaryProps, FaasDataInjection as FaasDataInjection$1, FaasDataWrapperProps as FaasDataWrapperProps$1 } from '@faasjs/react';
|
|
1
|
+
import { ErrorBoundaryProps, FaasReactClientOptions, FaasDataInjection as FaasDataInjection$1, FaasDataWrapperProps as FaasDataWrapperProps$1 } from '@faasjs/react';
|
|
2
2
|
export { ErrorBoundaryProps, faas, useFaas } from '@faasjs/react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ConfigProviderProps as ConfigProviderProps$1 } from 'antd/es/config-provider';
|
|
@@ -121,8 +121,9 @@ declare const ConfigContext: react.Context<ConfigProviderProps>;
|
|
|
121
121
|
* </ConfigProvider>
|
|
122
122
|
* ```
|
|
123
123
|
*/
|
|
124
|
-
declare function ConfigProvider(
|
|
124
|
+
declare function ConfigProvider(props: {
|
|
125
125
|
config: ConfigProviderProps;
|
|
126
|
+
faasClientOptions?: FaasReactClientOptions;
|
|
126
127
|
children: React.ReactNode;
|
|
127
128
|
}): react_jsx_runtime.JSX.Element;
|
|
128
129
|
declare function useConfigContext(): ConfigProviderProps;
|
|
@@ -558,4 +559,4 @@ interface TitleProps {
|
|
|
558
559
|
*/
|
|
559
560
|
declare function Title(props: TitleProps): JSX.Element;
|
|
560
561
|
|
|
561
|
-
export { App, AppProps, BaseItemProps, BaseOption, Blank, BlankProps, ConfigContext, ConfigProvider, ConfigProviderProps, Description, DescriptionItemContentProps, DescriptionItemProps, DescriptionProps, DrawerProps, ErrorBoundary, ExtendDescriptionItemProps, ExtendDescriptionTypeProps, ExtendFormItemProps, ExtendFormTypeProps, ExtendTableItemProps, ExtendTableTypeProps, ExtendTypes, FaasDataInjection, FaasDataWrapper, FaasDataWrapperProps, FaasItemProps, FaasItemType, FaasItemTypeValue, Form, FormItem, FormItemProps, FormProps, FormSubmitProps, Link, LinkProps, Loading, LoadingProps, ModalProps, PageNotFound, Routes, RoutesProps, TabProps, Table, TableItemProps, TableProps, Tabs, TabsProps, Title, TitleProps, UnionFaasItemElement, UnionFaasItemInjection, UnionFaasItemProps, UnionFaasItemRender, UnionScene, setDrawerProps, setModalProps, transferOptions, transferValue, useApp, useAppProps, useConfigContext, useDrawer, useModal };
|
|
562
|
+
export { App, type AppProps, type BaseItemProps, type BaseOption, Blank, type BlankProps, ConfigContext, ConfigProvider, type ConfigProviderProps, Description, type DescriptionItemContentProps, type DescriptionItemProps, type DescriptionProps, type DrawerProps, ErrorBoundary, type ExtendDescriptionItemProps, type ExtendDescriptionTypeProps, type ExtendFormItemProps, type ExtendFormTypeProps, type ExtendTableItemProps, type ExtendTableTypeProps, type ExtendTypes, type FaasDataInjection, FaasDataWrapper, type FaasDataWrapperProps, type FaasItemProps, type FaasItemType, type FaasItemTypeValue, Form, FormItem, type FormItemProps, type FormProps, type FormSubmitProps, Link, type LinkProps, Loading, type LoadingProps, type ModalProps, PageNotFound, Routes, type RoutesProps, type TabProps, Table, type TableItemProps, type TableProps, Tabs, type TabsProps, Title, type TitleProps, type UnionFaasItemElement, type UnionFaasItemInjection, type UnionFaasItemProps, type UnionFaasItemRender, type UnionScene, type setDrawerProps, type setModalProps, transferOptions, transferValue, useApp, type useAppProps, useConfigContext, useDrawer, useModal };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorBoundaryProps, FaasDataInjection as FaasDataInjection$1, FaasDataWrapperProps as FaasDataWrapperProps$1 } from '@faasjs/react';
|
|
1
|
+
import { ErrorBoundaryProps, FaasReactClientOptions, FaasDataInjection as FaasDataInjection$1, FaasDataWrapperProps as FaasDataWrapperProps$1 } from '@faasjs/react';
|
|
2
2
|
export { ErrorBoundaryProps, faas, useFaas } from '@faasjs/react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import { ConfigProviderProps as ConfigProviderProps$1 } from 'antd/es/config-provider';
|
|
@@ -121,8 +121,9 @@ declare const ConfigContext: react.Context<ConfigProviderProps>;
|
|
|
121
121
|
* </ConfigProvider>
|
|
122
122
|
* ```
|
|
123
123
|
*/
|
|
124
|
-
declare function ConfigProvider(
|
|
124
|
+
declare function ConfigProvider(props: {
|
|
125
125
|
config: ConfigProviderProps;
|
|
126
|
+
faasClientOptions?: FaasReactClientOptions;
|
|
126
127
|
children: React.ReactNode;
|
|
127
128
|
}): react_jsx_runtime.JSX.Element;
|
|
128
129
|
declare function useConfigContext(): ConfigProviderProps;
|
|
@@ -558,4 +559,4 @@ interface TitleProps {
|
|
|
558
559
|
*/
|
|
559
560
|
declare function Title(props: TitleProps): JSX.Element;
|
|
560
561
|
|
|
561
|
-
export { App, AppProps, BaseItemProps, BaseOption, Blank, BlankProps, ConfigContext, ConfigProvider, ConfigProviderProps, Description, DescriptionItemContentProps, DescriptionItemProps, DescriptionProps, DrawerProps, ErrorBoundary, ExtendDescriptionItemProps, ExtendDescriptionTypeProps, ExtendFormItemProps, ExtendFormTypeProps, ExtendTableItemProps, ExtendTableTypeProps, ExtendTypes, FaasDataInjection, FaasDataWrapper, FaasDataWrapperProps, FaasItemProps, FaasItemType, FaasItemTypeValue, Form, FormItem, FormItemProps, FormProps, FormSubmitProps, Link, LinkProps, Loading, LoadingProps, ModalProps, PageNotFound, Routes, RoutesProps, TabProps, Table, TableItemProps, TableProps, Tabs, TabsProps, Title, TitleProps, UnionFaasItemElement, UnionFaasItemInjection, UnionFaasItemProps, UnionFaasItemRender, UnionScene, setDrawerProps, setModalProps, transferOptions, transferValue, useApp, useAppProps, useConfigContext, useDrawer, useModal };
|
|
562
|
+
export { App, type AppProps, type BaseItemProps, type BaseOption, Blank, type BlankProps, ConfigContext, ConfigProvider, type ConfigProviderProps, Description, type DescriptionItemContentProps, type DescriptionItemProps, type DescriptionProps, type DrawerProps, ErrorBoundary, type ExtendDescriptionItemProps, type ExtendDescriptionTypeProps, type ExtendFormItemProps, type ExtendFormTypeProps, type ExtendTableItemProps, type ExtendTableTypeProps, type ExtendTypes, type FaasDataInjection, FaasDataWrapper, type FaasDataWrapperProps, type FaasItemProps, type FaasItemType, type FaasItemTypeValue, Form, FormItem, type FormItemProps, type FormProps, type FormSubmitProps, Link, type LinkProps, Loading, type LoadingProps, type ModalProps, PageNotFound, Routes, type RoutesProps, type TabProps, Table, type TableItemProps, type TableProps, Tabs, type TabsProps, Title, type TitleProps, type UnionFaasItemElement, type UnionFaasItemInjection, type UnionFaasItemProps, type UnionFaasItemRender, type UnionScene, type setDrawerProps, type setModalProps, transferOptions, transferValue, useApp, type useAppProps, useConfigContext, useDrawer, useModal };
|
package/dist/index.js
CHANGED
|
@@ -116,16 +116,13 @@ var baseConfig = {
|
|
|
116
116
|
Link: { style: {} }
|
|
117
117
|
};
|
|
118
118
|
var ConfigContext = react$1.createContext(baseConfig);
|
|
119
|
-
function ConfigProvider({
|
|
120
|
-
config,
|
|
121
|
-
children
|
|
122
|
-
}) {
|
|
119
|
+
function ConfigProvider(props) {
|
|
123
120
|
const [values, setValues] = react$1.useState(baseConfig);
|
|
124
121
|
react$1.useEffect(() => {
|
|
125
|
-
if (config.lang === "zh") {
|
|
122
|
+
if (props.config.lang === "zh") {
|
|
126
123
|
setValues(
|
|
127
124
|
lodashEs.defaultsDeep(
|
|
128
|
-
config,
|
|
125
|
+
props.config,
|
|
129
126
|
{
|
|
130
127
|
lang: "zh",
|
|
131
128
|
common: zh,
|
|
@@ -136,9 +133,11 @@ function ConfigProvider({
|
|
|
136
133
|
)
|
|
137
134
|
);
|
|
138
135
|
} else
|
|
139
|
-
setValues(lodashEs.defaultsDeep(config, values));
|
|
136
|
+
setValues(lodashEs.defaultsDeep(props.config, values));
|
|
137
|
+
if (props.faasClientOptions)
|
|
138
|
+
react.FaasReactClient(props.faasClientOptions);
|
|
140
139
|
}, []);
|
|
141
|
-
return /* @__PURE__ */ jsxRuntime.jsx(ConfigContext.Provider, { value: values, children });
|
|
140
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ConfigContext.Provider, { value: values, children: props.children });
|
|
142
141
|
}
|
|
143
142
|
function useConfigContext() {
|
|
144
143
|
return react$1.useContext(ConfigContext);
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorBoundary as ErrorBoundary$1, FaasDataWrapper as FaasDataWrapper$1, faas } from '@faasjs/react';
|
|
1
|
+
import { ErrorBoundary as ErrorBoundary$1, FaasReactClient, FaasDataWrapper as FaasDataWrapper$1, faas } from '@faasjs/react';
|
|
2
2
|
export { faas, useFaas } from '@faasjs/react';
|
|
3
3
|
import { Form as Form$1, Modal, Drawer, message, notification, ConfigProvider as ConfigProvider$1, Typography, Spin, Descriptions, Input, Button, Row, Col, TimePicker, DatePicker, Switch, Select, InputNumber, Radio, Result, Skeleton, Table as Table$1, Tabs as Tabs$1, Alert, Space } from 'antd';
|
|
4
4
|
export { Drawer, Modal } from 'antd';
|
|
@@ -113,16 +113,13 @@ var baseConfig = {
|
|
|
113
113
|
Link: { style: {} }
|
|
114
114
|
};
|
|
115
115
|
var ConfigContext = createContext(baseConfig);
|
|
116
|
-
function ConfigProvider({
|
|
117
|
-
config,
|
|
118
|
-
children
|
|
119
|
-
}) {
|
|
116
|
+
function ConfigProvider(props) {
|
|
120
117
|
const [values, setValues] = useState(baseConfig);
|
|
121
118
|
useEffect(() => {
|
|
122
|
-
if (config.lang === "zh") {
|
|
119
|
+
if (props.config.lang === "zh") {
|
|
123
120
|
setValues(
|
|
124
121
|
defaultsDeep(
|
|
125
|
-
config,
|
|
122
|
+
props.config,
|
|
126
123
|
{
|
|
127
124
|
lang: "zh",
|
|
128
125
|
common: zh,
|
|
@@ -133,9 +130,11 @@ function ConfigProvider({
|
|
|
133
130
|
)
|
|
134
131
|
);
|
|
135
132
|
} else
|
|
136
|
-
setValues(defaultsDeep(config, values));
|
|
133
|
+
setValues(defaultsDeep(props.config, values));
|
|
134
|
+
if (props.faasClientOptions)
|
|
135
|
+
FaasReactClient(props.faasClientOptions);
|
|
137
136
|
}, []);
|
|
138
|
-
return /* @__PURE__ */ jsx(ConfigContext.Provider, { value: values, children });
|
|
137
|
+
return /* @__PURE__ */ jsx(ConfigContext.Provider, { value: values, children: props.children });
|
|
139
138
|
}
|
|
140
139
|
function useConfigContext() {
|
|
141
140
|
return useContext(ConfigContext);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "0.0.4-beta.
|
|
3
|
+
"version": "0.0.4-beta.17",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"lodash-es": "*"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@faasjs/react": "0.0.4-beta.
|
|
29
|
+
"@faasjs/react": "0.0.4-beta.17",
|
|
30
30
|
"antd": "*",
|
|
31
31
|
"react": "*",
|
|
32
32
|
"react-dom": "*",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@testing-library/jest-dom": "*",
|
|
38
38
|
"@testing-library/react": "*",
|
|
39
39
|
"@testing-library/user-event": "*",
|
|
40
|
-
"@faasjs/react": "0.0.4-beta.
|
|
40
|
+
"@faasjs/react": "0.0.4-beta.17",
|
|
41
41
|
"antd": "*",
|
|
42
42
|
"react": "*",
|
|
43
43
|
"react-dom": "*",
|