@faasjs/ant-design 2.0.0 → 2.1.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/dist/index.d.mts +10 -4
- package/dist/index.d.ts +10 -4
- package/dist/index.js +29 -39
- package/dist/index.mjs +30 -40
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -159,9 +159,9 @@ interface useAppProps {
|
|
|
159
159
|
message: MessageInstance;
|
|
160
160
|
notification: NotificationInstance;
|
|
161
161
|
modalProps: ModalProps;
|
|
162
|
-
setModalProps:
|
|
162
|
+
setModalProps: setModalProps;
|
|
163
163
|
drawerProps: DrawerProps;
|
|
164
|
-
setDrawerProps:
|
|
164
|
+
setDrawerProps: setDrawerProps;
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
167
167
|
* App component with Ant Design & FaasJS
|
|
@@ -192,7 +192,10 @@ interface useAppProps {
|
|
|
192
192
|
*/
|
|
193
193
|
declare function App(props: AppProps): react_jsx_runtime.JSX.Element;
|
|
194
194
|
declare namespace App {
|
|
195
|
-
var useApp:
|
|
195
|
+
var useApp: {
|
|
196
|
+
(): Readonly<useAppProps>;
|
|
197
|
+
whyDidYouRender: boolean;
|
|
198
|
+
};
|
|
196
199
|
var whyDidYouRender: boolean;
|
|
197
200
|
}
|
|
198
201
|
/**
|
|
@@ -204,7 +207,10 @@ declare namespace App {
|
|
|
204
207
|
* const { message, notification, setModalProps, setDrawerProps } = useApp()
|
|
205
208
|
* ```
|
|
206
209
|
*/
|
|
207
|
-
declare
|
|
210
|
+
declare const useApp: {
|
|
211
|
+
(): Readonly<useAppProps>;
|
|
212
|
+
whyDidYouRender: boolean;
|
|
213
|
+
};
|
|
208
214
|
|
|
209
215
|
interface BlankProps {
|
|
210
216
|
value?: any;
|
package/dist/index.d.ts
CHANGED
|
@@ -159,9 +159,9 @@ interface useAppProps {
|
|
|
159
159
|
message: MessageInstance;
|
|
160
160
|
notification: NotificationInstance;
|
|
161
161
|
modalProps: ModalProps;
|
|
162
|
-
setModalProps:
|
|
162
|
+
setModalProps: setModalProps;
|
|
163
163
|
drawerProps: DrawerProps;
|
|
164
|
-
setDrawerProps:
|
|
164
|
+
setDrawerProps: setDrawerProps;
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
167
167
|
* App component with Ant Design & FaasJS
|
|
@@ -192,7 +192,10 @@ interface useAppProps {
|
|
|
192
192
|
*/
|
|
193
193
|
declare function App(props: AppProps): react_jsx_runtime.JSX.Element;
|
|
194
194
|
declare namespace App {
|
|
195
|
-
var useApp:
|
|
195
|
+
var useApp: {
|
|
196
|
+
(): Readonly<useAppProps>;
|
|
197
|
+
whyDidYouRender: boolean;
|
|
198
|
+
};
|
|
196
199
|
var whyDidYouRender: boolean;
|
|
197
200
|
}
|
|
198
201
|
/**
|
|
@@ -204,7 +207,10 @@ declare namespace App {
|
|
|
204
207
|
* const { message, notification, setModalProps, setDrawerProps } = useApp()
|
|
205
208
|
* ```
|
|
206
209
|
*/
|
|
207
|
-
declare
|
|
210
|
+
declare const useApp: {
|
|
211
|
+
(): Readonly<useAppProps>;
|
|
212
|
+
whyDidYouRender: boolean;
|
|
213
|
+
};
|
|
208
214
|
|
|
209
215
|
interface BlankProps {
|
|
210
216
|
value?: any;
|
package/dist/index.js
CHANGED
|
@@ -162,14 +162,14 @@ function ConfigProvider(props) {
|
|
|
162
162
|
function useConfigContext() {
|
|
163
163
|
return react$1.useContext(ConfigContext);
|
|
164
164
|
}
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
{}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
165
|
+
var AppContext = react.createSplitedContext({
|
|
166
|
+
message: {},
|
|
167
|
+
notification: {},
|
|
168
|
+
modalProps: {},
|
|
169
|
+
setModalProps: () => void 0,
|
|
170
|
+
drawerProps: {},
|
|
171
|
+
setDrawerProps: () => void 0
|
|
172
|
+
});
|
|
173
173
|
function RoutesApp(props) {
|
|
174
174
|
const location = reactRouterDom.useLocation();
|
|
175
175
|
const { drawerProps, setDrawerProps: setDrawerProps2, modalProps, setModalProps: setModalProps2 } = useApp();
|
|
@@ -195,38 +195,28 @@ function App(props) {
|
|
|
195
195
|
}),
|
|
196
196
|
[props.styleProviderProps]
|
|
197
197
|
);
|
|
198
|
-
return /* @__PURE__ */ jsxRuntime.jsx(cssinjs.StyleProvider, { ...styleProviderProps, children: /* @__PURE__ */ jsxRuntime.jsx(antd.ConfigProvider, { ...props.configProviderProps, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
Object.defineProperty(obj, "setModalProps", {
|
|
219
|
-
get: () => react$1.useContext(SetModalPropsContext)
|
|
220
|
-
});
|
|
221
|
-
Object.defineProperty(obj, "drawerProps", {
|
|
222
|
-
get: () => react$1.useContext(DrawerPropsContext)
|
|
223
|
-
});
|
|
224
|
-
Object.defineProperty(obj, "setDrawerProps", {
|
|
225
|
-
get: () => react$1.useContext(SetDrawerPropsContext)
|
|
226
|
-
});
|
|
227
|
-
return Object.freeze(obj);
|
|
228
|
-
});
|
|
198
|
+
return /* @__PURE__ */ jsxRuntime.jsx(cssinjs.StyleProvider, { ...styleProviderProps, children: /* @__PURE__ */ jsxRuntime.jsx(antd.ConfigProvider, { ...props.configProviderProps, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
199
|
+
AppContext.Provider,
|
|
200
|
+
{
|
|
201
|
+
value: {
|
|
202
|
+
message: messageApi,
|
|
203
|
+
notification: notificationApi,
|
|
204
|
+
drawerProps,
|
|
205
|
+
setDrawerProps: setDrawerProps2,
|
|
206
|
+
modalProps,
|
|
207
|
+
setModalProps: setModalProps2
|
|
208
|
+
},
|
|
209
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ConfigProvider, { ...props.faasConfigProviderProps, children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { ...props.errorBoundaryProps, children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.BrowserRouter, { ...props.browserRouterProps, children: [
|
|
210
|
+
messageContextHolder,
|
|
211
|
+
notificationContextHolder,
|
|
212
|
+
modal,
|
|
213
|
+
drawer,
|
|
214
|
+
/* @__PURE__ */ jsxRuntime.jsx(RoutesApp, { children: props.children })
|
|
215
|
+
] }) }) })
|
|
216
|
+
}
|
|
217
|
+
) }) });
|
|
229
218
|
}
|
|
219
|
+
var useApp = AppContext.use;
|
|
230
220
|
App.useApp = useApp;
|
|
231
221
|
App.whyDidYouRender = true;
|
|
232
222
|
function Blank(options) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorBoundary as ErrorBoundary$1, FaasReactClient,
|
|
1
|
+
import { createSplitedContext, 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 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';
|
|
@@ -158,14 +158,14 @@ function ConfigProvider(props) {
|
|
|
158
158
|
function useConfigContext() {
|
|
159
159
|
return useContext(ConfigContext);
|
|
160
160
|
}
|
|
161
|
-
var
|
|
162
|
-
|
|
163
|
-
{}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
161
|
+
var AppContext = createSplitedContext({
|
|
162
|
+
message: {},
|
|
163
|
+
notification: {},
|
|
164
|
+
modalProps: {},
|
|
165
|
+
setModalProps: () => void 0,
|
|
166
|
+
drawerProps: {},
|
|
167
|
+
setDrawerProps: () => void 0
|
|
168
|
+
});
|
|
169
169
|
function RoutesApp(props) {
|
|
170
170
|
const location = useLocation();
|
|
171
171
|
const { drawerProps, setDrawerProps: setDrawerProps2, modalProps, setModalProps: setModalProps2 } = useApp();
|
|
@@ -191,38 +191,28 @@ function App(props) {
|
|
|
191
191
|
}),
|
|
192
192
|
[props.styleProviderProps]
|
|
193
193
|
);
|
|
194
|
-
return /* @__PURE__ */ jsx(StyleProvider, { ...styleProviderProps, children: /* @__PURE__ */ jsx(ConfigProvider$1, { ...props.configProviderProps, children: /* @__PURE__ */ jsx(
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
Object.defineProperty(obj, "setModalProps", {
|
|
215
|
-
get: () => useContext(SetModalPropsContext)
|
|
216
|
-
});
|
|
217
|
-
Object.defineProperty(obj, "drawerProps", {
|
|
218
|
-
get: () => useContext(DrawerPropsContext)
|
|
219
|
-
});
|
|
220
|
-
Object.defineProperty(obj, "setDrawerProps", {
|
|
221
|
-
get: () => useContext(SetDrawerPropsContext)
|
|
222
|
-
});
|
|
223
|
-
return Object.freeze(obj);
|
|
224
|
-
});
|
|
194
|
+
return /* @__PURE__ */ jsx(StyleProvider, { ...styleProviderProps, children: /* @__PURE__ */ jsx(ConfigProvider$1, { ...props.configProviderProps, children: /* @__PURE__ */ jsx(
|
|
195
|
+
AppContext.Provider,
|
|
196
|
+
{
|
|
197
|
+
value: {
|
|
198
|
+
message: messageApi,
|
|
199
|
+
notification: notificationApi,
|
|
200
|
+
drawerProps,
|
|
201
|
+
setDrawerProps: setDrawerProps2,
|
|
202
|
+
modalProps,
|
|
203
|
+
setModalProps: setModalProps2
|
|
204
|
+
},
|
|
205
|
+
children: /* @__PURE__ */ jsx(ConfigProvider, { ...props.faasConfigProviderProps, children: /* @__PURE__ */ jsx(ErrorBoundary, { ...props.errorBoundaryProps, children: /* @__PURE__ */ jsxs(BrowserRouter, { ...props.browserRouterProps, children: [
|
|
206
|
+
messageContextHolder,
|
|
207
|
+
notificationContextHolder,
|
|
208
|
+
modal,
|
|
209
|
+
drawer,
|
|
210
|
+
/* @__PURE__ */ jsx(RoutesApp, { children: props.children })
|
|
211
|
+
] }) }) })
|
|
212
|
+
}
|
|
213
|
+
) }) });
|
|
225
214
|
}
|
|
215
|
+
var useApp = AppContext.use;
|
|
226
216
|
App.useApp = useApp;
|
|
227
217
|
App.whyDidYouRender = true;
|
|
228
218
|
function Blank(options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
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": "2.
|
|
29
|
+
"@faasjs/react": "2.1.0",
|
|
30
30
|
"antd": "*",
|
|
31
31
|
"react": "*",
|
|
32
32
|
"react-dom": "*",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@testing-library/react": "*",
|
|
39
39
|
"@testing-library/user-event": "*",
|
|
40
40
|
"@welldone-software/why-did-you-render": "*",
|
|
41
|
-
"@faasjs/react": "2.
|
|
41
|
+
"@faasjs/react": "2.1.0",
|
|
42
42
|
"antd": "*",
|
|
43
43
|
"react": "*",
|
|
44
44
|
"react-dom": "*",
|