@faasjs/ant-design 2.8.0 → 2.9.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/README.md CHANGED
@@ -50,8 +50,8 @@ type FaasItemProps = {
50
50
  - [LinkProps](interfaces/LinkProps.md)
51
51
  - [ModalProps](interfaces/ModalProps.md)
52
52
  - [RoutesProps](interfaces/RoutesProps.md)
53
- - [TabProps](interfaces/TabProps.md)
54
53
  - [TableItemProps](interfaces/TableItemProps.md)
54
+ - [TabProps](interfaces/TabProps.md)
55
55
  - [TabsProps](interfaces/TabsProps.md)
56
56
  - [TitleProps](interfaces/TitleProps.md)
57
57
  - [UnionFaasItemProps](interfaces/UnionFaasItemProps.md)
@@ -70,13 +70,13 @@ type FaasItemProps = {
70
70
  - [FaasItemTypeValue](type-aliases/FaasItemTypeValue.md)
71
71
  - [FormSubmitProps](type-aliases/FormSubmitProps.md)
72
72
  - [LoadingProps](type-aliases/LoadingProps.md)
73
+ - [setDrawerProps](type-aliases/setDrawerProps.md)
74
+ - [setModalProps](type-aliases/setModalProps.md)
73
75
  - [TableProps](type-aliases/TableProps.md)
74
76
  - [UnionFaasItemElement](type-aliases/UnionFaasItemElement.md)
75
77
  - [UnionFaasItemInjection](type-aliases/UnionFaasItemInjection.md)
76
78
  - [UnionFaasItemRender](type-aliases/UnionFaasItemRender.md)
77
79
  - [UnionScene](type-aliases/UnionScene.md)
78
- - [setDrawerProps](type-aliases/setDrawerProps.md)
79
- - [setModalProps](type-aliases/setModalProps.md)
80
80
 
81
81
  ## Variables
82
82
 
@@ -90,6 +90,7 @@ type FaasItemProps = {
90
90
  - [Description](functions/Description.md)
91
91
  - [Drawer](functions/Drawer.md)
92
92
  - [ErrorBoundary](functions/ErrorBoundary.md)
93
+ - [faas](functions/faas.md)
93
94
  - [FaasDataWrapper](functions/FaasDataWrapper.md)
94
95
  - [Form](functions/Form.md)
95
96
  - [FormItem](functions/FormItem.md)
@@ -101,7 +102,6 @@ type FaasItemProps = {
101
102
  - [Table](functions/Table.md)
102
103
  - [Tabs](functions/Tabs.md)
103
104
  - [Title](functions/Title.md)
104
- - [faas](functions/faas.md)
105
105
  - [transferOptions](functions/transferOptions.md)
106
106
  - [transferValue](functions/transferValue.md)
107
107
  - [useApp](functions/useApp.md)
package/dist/index.d.mts CHANGED
@@ -9,7 +9,7 @@ import * as antd_es_modal_PurePanel from 'antd/es/modal/PurePanel';
9
9
  import * as antd_es_modal_useModal from 'antd/es/modal/useModal';
10
10
  import * as antd_es_modal_confirm from 'antd/es/modal/confirm';
11
11
  import * as react from 'react';
12
- import { Dispatch, SetStateAction, CSSProperties, ComponentProps, ReactNode, ReactElement, LazyExoticComponent, ComponentType } from 'react';
12
+ import { Dispatch, SetStateAction, CSSProperties, ReactNode, ReactElement, LazyExoticComponent, ComponentType } from 'react';
13
13
  export { lazy } from 'react';
14
14
  import { ModalProps as ModalProps$1, DrawerProps as DrawerProps$1, FormItemProps as FormItemProps$1, FormInstance, InputProps, SelectProps, RadioProps, InputNumberProps, SwitchProps, DatePickerProps, DescriptionsProps, TableColumnProps, TablePaginationConfig, TableProps as TableProps$1, FormProps as FormProps$1, ButtonProps, TabsProps as TabsProps$1 } from 'antd';
15
15
  import { BrowserRouterProps, RouteProps } from 'react-router-dom';
@@ -29,7 +29,7 @@ declare const Modal: react.FC<ModalProps$1> & antd_es_modal_confirm.ModalStaticF
29
29
  useModal: typeof antd_es_modal_useModal.default;
30
30
  destroyAll: () => void;
31
31
  config: typeof antd_es_modal_confirm.modalGlobalConfig;
32
- _InternalPanelDoNotUseOrYouWillBeFired: (props: antd_es_modal_PurePanel.PurePanelProps) => react.JSX.Element;
32
+ _InternalPanelDoNotUseOrYouWillBeFired: (props: antd_es_modal_PurePanel.PurePanelProps) => React.JSX.Element;
33
33
  };
34
34
  interface ModalProps extends ModalProps$1 {
35
35
  children?: JSX.Element | JSX.Element[] | string;
@@ -390,10 +390,10 @@ declare namespace FaasDataWrapper {
390
390
  *
391
391
  * @example
392
392
  * ```tsx
393
- * const MyComponent = withFaasData(MyComponent, { action: 'test', params: { a: 1 } })
393
+ * const MyComponent = withFaasData(({ data }) => <div>{data.name}</div>, { action: 'test', params: { a: 1 } })
394
394
  * ```
395
395
  */
396
- declare function withFaasData<TComponent extends React.FC<any>, PathOrData extends FaasAction>(Component: TComponent, faasProps: FaasDataWrapperProps<PathOrData>): (props: ComponentProps<TComponent> & {}) => react_jsx_runtime.JSX.Element;
396
+ declare function withFaasData<TComponent extends React.FC<any>, PathOrData extends FaasAction>(Component: TComponent, faasProps: FaasDataWrapperProps<PathOrData>): react.FC<Omit<any, keyof FaasDataInjection$1<any>> & Record<string, any>>;
397
397
 
398
398
  interface ExtendDescriptionTypeProps<T = any> {
399
399
  children?: UnionFaasItemElement<T>;
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import * as antd_es_modal_PurePanel from 'antd/es/modal/PurePanel';
9
9
  import * as antd_es_modal_useModal from 'antd/es/modal/useModal';
10
10
  import * as antd_es_modal_confirm from 'antd/es/modal/confirm';
11
11
  import * as react from 'react';
12
- import { Dispatch, SetStateAction, CSSProperties, ComponentProps, ReactNode, ReactElement, LazyExoticComponent, ComponentType } from 'react';
12
+ import { Dispatch, SetStateAction, CSSProperties, ReactNode, ReactElement, LazyExoticComponent, ComponentType } from 'react';
13
13
  export { lazy } from 'react';
14
14
  import { ModalProps as ModalProps$1, DrawerProps as DrawerProps$1, FormItemProps as FormItemProps$1, FormInstance, InputProps, SelectProps, RadioProps, InputNumberProps, SwitchProps, DatePickerProps, DescriptionsProps, TableColumnProps, TablePaginationConfig, TableProps as TableProps$1, FormProps as FormProps$1, ButtonProps, TabsProps as TabsProps$1 } from 'antd';
15
15
  import { BrowserRouterProps, RouteProps } from 'react-router-dom';
@@ -29,7 +29,7 @@ declare const Modal: react.FC<ModalProps$1> & antd_es_modal_confirm.ModalStaticF
29
29
  useModal: typeof antd_es_modal_useModal.default;
30
30
  destroyAll: () => void;
31
31
  config: typeof antd_es_modal_confirm.modalGlobalConfig;
32
- _InternalPanelDoNotUseOrYouWillBeFired: (props: antd_es_modal_PurePanel.PurePanelProps) => react.JSX.Element;
32
+ _InternalPanelDoNotUseOrYouWillBeFired: (props: antd_es_modal_PurePanel.PurePanelProps) => React.JSX.Element;
33
33
  };
34
34
  interface ModalProps extends ModalProps$1 {
35
35
  children?: JSX.Element | JSX.Element[] | string;
@@ -390,10 +390,10 @@ declare namespace FaasDataWrapper {
390
390
  *
391
391
  * @example
392
392
  * ```tsx
393
- * const MyComponent = withFaasData(MyComponent, { action: 'test', params: { a: 1 } })
393
+ * const MyComponent = withFaasData(({ data }) => <div>{data.name}</div>, { action: 'test', params: { a: 1 } })
394
394
  * ```
395
395
  */
396
- declare function withFaasData<TComponent extends React.FC<any>, PathOrData extends FaasAction>(Component: TComponent, faasProps: FaasDataWrapperProps<PathOrData>): (props: ComponentProps<TComponent> & {}) => react_jsx_runtime.JSX.Element;
396
+ declare function withFaasData<TComponent extends React.FC<any>, PathOrData extends FaasAction>(Component: TComponent, faasProps: FaasDataWrapperProps<PathOrData>): react.FC<Omit<any, keyof FaasDataInjection$1<any>> & Record<string, any>>;
397
397
 
398
398
  interface ExtendDescriptionTypeProps<T = any> {
399
399
  children?: UnionFaasItemElement<T>;
package/dist/index.js CHANGED
@@ -308,7 +308,10 @@ function FaasDataWrapper(props) {
308
308
  }
309
309
  FaasDataWrapper.whyDidYouRender = true;
310
310
  function withFaasData(Component, faasProps) {
311
- return (props) => /* @__PURE__ */ jsxRuntime.jsx(FaasDataWrapper, { ...faasProps, children: /* @__PURE__ */ jsxRuntime.jsx(Component, { ...props }) });
311
+ return react.withFaasData(Component, {
312
+ fallback: faasProps.loading || /* @__PURE__ */ jsxRuntime.jsx(Loading, { ...faasProps.loadingProps }),
313
+ ...faasProps
314
+ });
312
315
  }
313
316
  function DescriptionItemContent(props) {
314
317
  var _a, _b;
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { createSplittingContext, ErrorBoundary as ErrorBoundary$1, FaasReactClient, OptionalWrapper, FaasDataWrapper as FaasDataWrapper$1, faas } from '@faasjs/react';
1
+ import { createSplittingContext, ErrorBoundary as ErrorBoundary$1, FaasReactClient, OptionalWrapper, FaasDataWrapper as FaasDataWrapper$1, withFaasData as withFaasData$1, faas } from '@faasjs/react';
2
2
  export { faas, useFaas } from '@faasjs/react';
3
3
  import { Form as Form$1, Modal as Modal$1, Drawer as Drawer$1, message, notification, ConfigProvider as ConfigProvider$1, Typography, Spin, Descriptions, Input, Button, Row, Col, DatePicker, Switch, Select, InputNumber, Radio, Result, Skeleton, Table as Table$1, Tabs as Tabs$1, Alert, Space } from 'antd';
4
4
  import { legacyLogicalPropertiesTransformer, StyleProvider } from '@ant-design/cssinjs';
@@ -304,7 +304,10 @@ function FaasDataWrapper(props) {
304
304
  }
305
305
  FaasDataWrapper.whyDidYouRender = true;
306
306
  function withFaasData(Component, faasProps) {
307
- return (props) => /* @__PURE__ */ jsx(FaasDataWrapper, { ...faasProps, children: /* @__PURE__ */ jsx(Component, { ...props }) });
307
+ return withFaasData$1(Component, {
308
+ fallback: faasProps.loading || /* @__PURE__ */ jsx(Loading, { ...faasProps.loadingProps }),
309
+ ...faasProps
310
+ });
308
311
  }
309
312
  function DescriptionItemContent(props) {
310
313
  var _a, _b;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -38,7 +38,7 @@
38
38
  "lodash-es": "*"
39
39
  },
40
40
  "peerDependencies": {
41
- "@faasjs/react": "2.8.0",
41
+ "@faasjs/react": "2.9.0",
42
42
  "antd": "*",
43
43
  "react": "*",
44
44
  "react-dom": "*",
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/lodash-es": "*",
49
- "@faasjs/react": "2.8.0",
49
+ "@faasjs/react": "2.9.0",
50
50
  "antd": "*",
51
51
  "react": "*",
52
52
  "react-dom": "*",