@faasjs/ant-design 7.1.0 → 8.0.0-beta.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.cjs +35 -54
- package/dist/index.d.ts +2 -9
- package/dist/index.mjs +36 -55
- package/package.json +12 -10
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var cssinjs = require('@ant-design/cssinjs');
|
|
4
3
|
var react = require('@faasjs/react');
|
|
5
4
|
var antd = require('antd');
|
|
6
5
|
var reactRouterDom = require('react-router-dom');
|
|
@@ -213,69 +212,51 @@ function App(props) {
|
|
|
213
212
|
const [notificationApi, notificationContextHolder] = antd.notification.useNotification();
|
|
214
213
|
const { modal, modalProps, setModalProps } = useModal();
|
|
215
214
|
const { drawer, drawerProps, setDrawerProps } = useDrawer();
|
|
216
|
-
const styleProviderProps = react.useEqualMemo(
|
|
217
|
-
() => ({
|
|
218
|
-
hashPriority: "high",
|
|
219
|
-
transformers: [cssinjs.legacyLogicalPropertiesTransformer],
|
|
220
|
-
...props.styleProviderProps
|
|
221
|
-
}),
|
|
222
|
-
[props.styleProviderProps]
|
|
223
|
-
);
|
|
224
215
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
225
216
|
react.OptionalWrapper,
|
|
226
217
|
{
|
|
227
|
-
condition: props.
|
|
228
|
-
Wrapper:
|
|
229
|
-
wrapperProps:
|
|
218
|
+
condition: !!props.configProviderProps,
|
|
219
|
+
Wrapper: antd.ConfigProvider,
|
|
220
|
+
wrapperProps: props.configProviderProps,
|
|
230
221
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
231
|
-
|
|
222
|
+
AppContext.Provider,
|
|
232
223
|
{
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
224
|
+
value: {
|
|
225
|
+
message: messageApi,
|
|
226
|
+
notification: notificationApi,
|
|
227
|
+
drawerProps,
|
|
228
|
+
setDrawerProps,
|
|
229
|
+
modalProps,
|
|
230
|
+
setModalProps
|
|
231
|
+
},
|
|
236
232
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
237
|
-
|
|
233
|
+
ConfigProvider,
|
|
238
234
|
{
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
235
|
+
...props.faasConfigProviderProps,
|
|
236
|
+
faasClientOptions: {
|
|
237
|
+
onError: (action) => async (res) => {
|
|
238
|
+
if ("message" in res && res.toString().includes("AbortError"))
|
|
239
|
+
return;
|
|
240
|
+
console.error(`[FaasJS][${action}]`, res);
|
|
241
|
+
messageApi.error("message" in res ? res.message : "Unknown error");
|
|
242
|
+
},
|
|
243
|
+
...props.faasConfigProviderProps ? props.faasConfigProviderProps.faasClientOptions : {}
|
|
246
244
|
},
|
|
247
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
248
|
-
|
|
245
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { ...props.errorBoundaryProps, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
246
|
+
react.OptionalWrapper,
|
|
249
247
|
{
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
...props.faasConfigProviderProps ? props.faasConfigProviderProps.faasClientOptions : {}
|
|
261
|
-
},
|
|
262
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(ErrorBoundary, { ...props.errorBoundaryProps, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
263
|
-
react.OptionalWrapper,
|
|
264
|
-
{
|
|
265
|
-
condition: typeof document !== "undefined" && props.browserRouterProps !== false,
|
|
266
|
-
Wrapper: reactRouterDom.BrowserRouter,
|
|
267
|
-
wrapperProps: props.browserRouterProps,
|
|
268
|
-
children: [
|
|
269
|
-
messageContextHolder,
|
|
270
|
-
notificationContextHolder,
|
|
271
|
-
modal,
|
|
272
|
-
drawer,
|
|
273
|
-
props.browserRouterProps !== false ? /* @__PURE__ */ jsxRuntime.jsx(RoutesApp, { children: props.children }) : props.children
|
|
274
|
-
]
|
|
275
|
-
}
|
|
276
|
-
) })
|
|
248
|
+
condition: typeof document !== "undefined" && props.browserRouterProps !== false,
|
|
249
|
+
Wrapper: reactRouterDom.BrowserRouter,
|
|
250
|
+
wrapperProps: props.browserRouterProps,
|
|
251
|
+
children: [
|
|
252
|
+
messageContextHolder,
|
|
253
|
+
notificationContextHolder,
|
|
254
|
+
modal,
|
|
255
|
+
drawer,
|
|
256
|
+
props.browserRouterProps !== false ? /* @__PURE__ */ jsxRuntime.jsx(RoutesApp, { children: props.children }) : props.children
|
|
257
|
+
]
|
|
277
258
|
}
|
|
278
|
-
)
|
|
259
|
+
) })
|
|
279
260
|
}
|
|
280
261
|
)
|
|
281
262
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { StyleProviderProps } from '@ant-design/cssinjs';
|
|
3
2
|
import { DrawerProps as DrawerProps$1, ModalProps as ModalProps$1, ConfigProviderProps as ConfigProviderProps$1, FormItemProps as FormItemProps$1, InputProps, SelectProps, RadioProps, InputNumberProps, SwitchProps, DatePickerProps, FormInstance, TableColumnProps, TablePaginationConfig, TableProps as TableProps$1, DescriptionsProps, FormProps as FormProps$1, ButtonProps, TabsProps as TabsProps$1, GlobalToken } from 'antd';
|
|
4
3
|
import { MessageInstance } from 'antd/es/message/interface';
|
|
5
4
|
import { NotificationInstance } from 'antd/es/notification/interface';
|
|
@@ -204,12 +203,6 @@ declare function useModal(init?: ModalProps): {
|
|
|
204
203
|
|
|
205
204
|
interface AppProps {
|
|
206
205
|
children: React.ReactNode;
|
|
207
|
-
/**
|
|
208
|
-
* `false` to disable StyleProvider.
|
|
209
|
-
*
|
|
210
|
-
* @see https://github.com/ant-design/cssinjs?tab=readme-ov-file#styleprovider
|
|
211
|
-
*/
|
|
212
|
-
styleProviderProps?: StyleProviderProps | false;
|
|
213
206
|
/** @see https://ant.design/components/config-provider/#API */
|
|
214
207
|
configProviderProps?: ConfigProviderProps$1;
|
|
215
208
|
/**
|
|
@@ -236,7 +229,7 @@ interface useAppProps {
|
|
|
236
229
|
/**
|
|
237
230
|
* App component with Ant Design & FaasJS
|
|
238
231
|
*
|
|
239
|
-
* - Based on Ant Design's [ConfigProvider](https://ant.design/components/config-provider/)
|
|
232
|
+
* - Based on Ant Design's [ConfigProvider](https://ant.design/components/config-provider/).
|
|
240
233
|
* - Integrated Ant Design's [Message](https://ant.design/components/message/) and [Notification](https://ant.design/components/notification/).
|
|
241
234
|
* - Based on FaasJS's [ConfigProvider](https://faasjs.com/doc/ant-design/#configprovider).
|
|
242
235
|
* - Integrated FaasJS's [Modal](https://faasjs.com/doc/ant-design/#usemodal), [Drawer](https://faasjs.com/doc/ant-design/#usedrawer) and [ErrorBoundary](https://faasjs.com/doc/ant-design/#errorboundary).
|
|
@@ -249,7 +242,6 @@ interface useAppProps {
|
|
|
249
242
|
* export default function () {
|
|
250
243
|
* return (
|
|
251
244
|
* <App
|
|
252
|
-
* styleProviderProps={{}} // https://ant.design/docs/react/compatible-style#styleprovider
|
|
253
245
|
* configProviderProps={{}} // https://ant.design/components/config-provider/#API
|
|
254
246
|
* browserRouterProps={{}} // https://api.reactrouter.com/v7/interfaces/react_router.BrowserRouterProps.html
|
|
255
247
|
* errorBoundaryProps={{}} // https://faasjs.com/doc/ant-design/#errorboundary
|
|
@@ -258,6 +250,7 @@ interface useAppProps {
|
|
|
258
250
|
* <div>content</div>
|
|
259
251
|
* </App>
|
|
260
252
|
* )
|
|
253
|
+
* }
|
|
261
254
|
* ```
|
|
262
255
|
*/
|
|
263
256
|
declare function App(props: AppProps): react_jsx_runtime.JSX.Element;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createSplittingContext, FaasDataWrapper as FaasDataWrapper$1, withFaasData as withFaasData$1, useEqualEffect, FaasReactClient, useEqualCallback, ErrorBoundary as ErrorBoundary$1, useEqualMemo, OptionalWrapper, faas } from '@faasjs/react';
|
|
1
|
+
import { createSplittingContext, FaasDataWrapper as FaasDataWrapper$1, withFaasData as withFaasData$1, useEqualEffect, FaasReactClient, useEqualCallback, ErrorBoundary as ErrorBoundary$1, OptionalWrapper, faas } from '@faasjs/react';
|
|
3
2
|
export { FaasReactClient, faas, useFaas } from '@faasjs/react';
|
|
4
3
|
import { Drawer as Drawer$1, Modal as Modal$1, Form as Form$1, Spin, message, notification, ConfigProvider as ConfigProvider$1, Typography, Descriptions, Input, Button, Row, Col, DatePicker, Switch, Select, InputNumber, Radio, Result, Skeleton, Table as Table$1, Tabs as Tabs$1, theme, Alert, Space } from 'antd';
|
|
5
4
|
import { BrowserRouter, useNavigate, Routes as Routes$1, Route, useLocation } from 'react-router-dom';
|
|
@@ -209,69 +208,51 @@ function App(props) {
|
|
|
209
208
|
const [notificationApi, notificationContextHolder] = notification.useNotification();
|
|
210
209
|
const { modal, modalProps, setModalProps } = useModal();
|
|
211
210
|
const { drawer, drawerProps, setDrawerProps } = useDrawer();
|
|
212
|
-
const styleProviderProps = useEqualMemo(
|
|
213
|
-
() => ({
|
|
214
|
-
hashPriority: "high",
|
|
215
|
-
transformers: [legacyLogicalPropertiesTransformer],
|
|
216
|
-
...props.styleProviderProps
|
|
217
|
-
}),
|
|
218
|
-
[props.styleProviderProps]
|
|
219
|
-
);
|
|
220
211
|
return /* @__PURE__ */ jsx(
|
|
221
212
|
OptionalWrapper,
|
|
222
213
|
{
|
|
223
|
-
condition: props.
|
|
224
|
-
Wrapper:
|
|
225
|
-
wrapperProps:
|
|
214
|
+
condition: !!props.configProviderProps,
|
|
215
|
+
Wrapper: ConfigProvider$1,
|
|
216
|
+
wrapperProps: props.configProviderProps,
|
|
226
217
|
children: /* @__PURE__ */ jsx(
|
|
227
|
-
|
|
218
|
+
AppContext.Provider,
|
|
228
219
|
{
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
220
|
+
value: {
|
|
221
|
+
message: messageApi,
|
|
222
|
+
notification: notificationApi,
|
|
223
|
+
drawerProps,
|
|
224
|
+
setDrawerProps,
|
|
225
|
+
modalProps,
|
|
226
|
+
setModalProps
|
|
227
|
+
},
|
|
232
228
|
children: /* @__PURE__ */ jsx(
|
|
233
|
-
|
|
229
|
+
ConfigProvider,
|
|
234
230
|
{
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
231
|
+
...props.faasConfigProviderProps,
|
|
232
|
+
faasClientOptions: {
|
|
233
|
+
onError: (action) => async (res) => {
|
|
234
|
+
if ("message" in res && res.toString().includes("AbortError"))
|
|
235
|
+
return;
|
|
236
|
+
console.error(`[FaasJS][${action}]`, res);
|
|
237
|
+
messageApi.error("message" in res ? res.message : "Unknown error");
|
|
238
|
+
},
|
|
239
|
+
...props.faasConfigProviderProps ? props.faasConfigProviderProps.faasClientOptions : {}
|
|
242
240
|
},
|
|
243
|
-
children: /* @__PURE__ */ jsx(
|
|
244
|
-
|
|
241
|
+
children: /* @__PURE__ */ jsx(ErrorBoundary, { ...props.errorBoundaryProps, children: /* @__PURE__ */ jsxs(
|
|
242
|
+
OptionalWrapper,
|
|
245
243
|
{
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
...props.faasConfigProviderProps ? props.faasConfigProviderProps.faasClientOptions : {}
|
|
257
|
-
},
|
|
258
|
-
children: /* @__PURE__ */ jsx(ErrorBoundary, { ...props.errorBoundaryProps, children: /* @__PURE__ */ jsxs(
|
|
259
|
-
OptionalWrapper,
|
|
260
|
-
{
|
|
261
|
-
condition: typeof document !== "undefined" && props.browserRouterProps !== false,
|
|
262
|
-
Wrapper: BrowserRouter,
|
|
263
|
-
wrapperProps: props.browserRouterProps,
|
|
264
|
-
children: [
|
|
265
|
-
messageContextHolder,
|
|
266
|
-
notificationContextHolder,
|
|
267
|
-
modal,
|
|
268
|
-
drawer,
|
|
269
|
-
props.browserRouterProps !== false ? /* @__PURE__ */ jsx(RoutesApp, { children: props.children }) : props.children
|
|
270
|
-
]
|
|
271
|
-
}
|
|
272
|
-
) })
|
|
244
|
+
condition: typeof document !== "undefined" && props.browserRouterProps !== false,
|
|
245
|
+
Wrapper: BrowserRouter,
|
|
246
|
+
wrapperProps: props.browserRouterProps,
|
|
247
|
+
children: [
|
|
248
|
+
messageContextHolder,
|
|
249
|
+
notificationContextHolder,
|
|
250
|
+
modal,
|
|
251
|
+
drawer,
|
|
252
|
+
props.browserRouterProps !== false ? /* @__PURE__ */ jsx(RoutesApp, { children: props.children }) : props.children
|
|
253
|
+
]
|
|
273
254
|
}
|
|
274
|
-
)
|
|
255
|
+
) })
|
|
275
256
|
}
|
|
276
257
|
)
|
|
277
258
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "v8.0.0-beta.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -30,23 +30,25 @@
|
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@faasjs/react": ">=
|
|
34
|
-
"antd": "
|
|
33
|
+
"@faasjs/react": ">=v8.0.0-beta.0",
|
|
34
|
+
"antd": "^6.0.0",
|
|
35
35
|
"@ant-design/icons": "*",
|
|
36
36
|
"lodash-es": "*",
|
|
37
|
-
"react": "
|
|
38
|
-
"react-dom": "
|
|
37
|
+
"react": "^19.0.0",
|
|
38
|
+
"react-dom": "^19.0.0",
|
|
39
39
|
"react-router-dom": "*"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/lodash-es": "*",
|
|
43
|
-
"@faasjs/react": ">=
|
|
44
|
-
"antd": "
|
|
43
|
+
"@faasjs/react": ">=v8.0.0-beta.0",
|
|
44
|
+
"antd": "^6.0.0",
|
|
45
45
|
"@ant-design/icons": "*",
|
|
46
46
|
"lodash-es": "*",
|
|
47
|
-
"react": "
|
|
48
|
-
"react-dom": "
|
|
49
|
-
"react-router-dom": "*"
|
|
47
|
+
"react": "^19.0.0",
|
|
48
|
+
"react-dom": "^19.0.0",
|
|
49
|
+
"react-router-dom": "*",
|
|
50
|
+
"@types/react": "^19.0.0",
|
|
51
|
+
"@types/react-dom": "^19.0.0"
|
|
50
52
|
},
|
|
51
53
|
"engines": {
|
|
52
54
|
"node": ">=24.0.0",
|