@faasjs/ant-design 1.7.2 → 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 +37 -47
- package/dist/index.mjs +38 -48
- 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) {
|
|
@@ -1163,7 +1153,7 @@ function Table(props) {
|
|
|
1163
1153
|
if (!item.render)
|
|
1164
1154
|
item.render = (value) => processValue(item, value);
|
|
1165
1155
|
if (item.filterDropdown !== false) {
|
|
1166
|
-
if (!item.onFilter)
|
|
1156
|
+
if (!item.onFilter && !props.faasData)
|
|
1167
1157
|
item.onFilter = (value, row) => {
|
|
1168
1158
|
if (!value || lodashEs.isNil(value))
|
|
1169
1159
|
return true;
|
|
@@ -1198,7 +1188,7 @@ function Table(props) {
|
|
|
1198
1188
|
if (!item.render)
|
|
1199
1189
|
item.render = (value) => processValue(item, value);
|
|
1200
1190
|
if (item.filterDropdown !== false) {
|
|
1201
|
-
if (!item.onFilter)
|
|
1191
|
+
if (!item.onFilter && !props.faasData)
|
|
1202
1192
|
item.onFilter = (value, row) => {
|
|
1203
1193
|
if (value === null && (!row[item.id] || !row[item.id].length))
|
|
1204
1194
|
return true;
|
|
@@ -1237,7 +1227,7 @@ function Table(props) {
|
|
|
1237
1227
|
if (typeof item.sorter === "undefined")
|
|
1238
1228
|
item.sorter = (a, b) => a[item.id] - b[item.id];
|
|
1239
1229
|
if (item.filterDropdown !== false) {
|
|
1240
|
-
if (!item.onFilter)
|
|
1230
|
+
if (!item.onFilter && !props.faasData)
|
|
1241
1231
|
item.onFilter = (value, row) => {
|
|
1242
1232
|
if (value === null)
|
|
1243
1233
|
return true;
|
|
@@ -1272,7 +1262,7 @@ function Table(props) {
|
|
|
1272
1262
|
if (!item.render)
|
|
1273
1263
|
item.render = (value) => processValue(item, value).join(", ");
|
|
1274
1264
|
if (item.filterDropdown !== false) {
|
|
1275
|
-
if (!item.onFilter)
|
|
1265
|
+
if (!item.onFilter && !props.faasData)
|
|
1276
1266
|
item.onFilter = (value, row) => {
|
|
1277
1267
|
if (value === null && (!row[item.id] || !row[item.id].length))
|
|
1278
1268
|
return true;
|
|
@@ -1369,7 +1359,7 @@ function Table(props) {
|
|
|
1369
1359
|
]
|
|
1370
1360
|
}
|
|
1371
1361
|
);
|
|
1372
|
-
if (!item.onFilter)
|
|
1362
|
+
if (!item.onFilter && !props.faasData)
|
|
1373
1363
|
item.onFilter = (value, row) => {
|
|
1374
1364
|
switch (value) {
|
|
1375
1365
|
case true:
|
|
@@ -1411,7 +1401,7 @@ function Table(props) {
|
|
|
1411
1401
|
}
|
|
1412
1402
|
}
|
|
1413
1403
|
);
|
|
1414
|
-
if (!item.onFilter)
|
|
1404
|
+
if (!item.onFilter && !props.faasData)
|
|
1415
1405
|
item.onFilter = (value, row) => {
|
|
1416
1406
|
if (lodashEs.isNil(value[0]))
|
|
1417
1407
|
return true;
|
|
@@ -1451,7 +1441,7 @@ function Table(props) {
|
|
|
1451
1441
|
}
|
|
1452
1442
|
}
|
|
1453
1443
|
);
|
|
1454
|
-
if (!item.onFilter)
|
|
1444
|
+
if (!item.onFilter && !props.faasData)
|
|
1455
1445
|
item.onFilter = (value, row) => {
|
|
1456
1446
|
if (lodashEs.isNil(value[0]))
|
|
1457
1447
|
return true;
|
|
@@ -1487,7 +1477,7 @@ function Table(props) {
|
|
|
1487
1477
|
default:
|
|
1488
1478
|
if (!item.render)
|
|
1489
1479
|
item.render = (value) => processValue(item, value);
|
|
1490
|
-
if (item.filterDropdown !== false && !item.onFilter)
|
|
1480
|
+
if (item.filterDropdown !== false && !item.onFilter && !props.faasData)
|
|
1491
1481
|
item.onFilter = (value, row) => {
|
|
1492
1482
|
if (value === null && lodashEs.isNil(row[item.id]))
|
|
1493
1483
|
return true;
|
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) {
|
|
@@ -1159,7 +1149,7 @@ function Table(props) {
|
|
|
1159
1149
|
if (!item.render)
|
|
1160
1150
|
item.render = (value) => processValue(item, value);
|
|
1161
1151
|
if (item.filterDropdown !== false) {
|
|
1162
|
-
if (!item.onFilter)
|
|
1152
|
+
if (!item.onFilter && !props.faasData)
|
|
1163
1153
|
item.onFilter = (value, row) => {
|
|
1164
1154
|
if (!value || isNil(value))
|
|
1165
1155
|
return true;
|
|
@@ -1194,7 +1184,7 @@ function Table(props) {
|
|
|
1194
1184
|
if (!item.render)
|
|
1195
1185
|
item.render = (value) => processValue(item, value);
|
|
1196
1186
|
if (item.filterDropdown !== false) {
|
|
1197
|
-
if (!item.onFilter)
|
|
1187
|
+
if (!item.onFilter && !props.faasData)
|
|
1198
1188
|
item.onFilter = (value, row) => {
|
|
1199
1189
|
if (value === null && (!row[item.id] || !row[item.id].length))
|
|
1200
1190
|
return true;
|
|
@@ -1233,7 +1223,7 @@ function Table(props) {
|
|
|
1233
1223
|
if (typeof item.sorter === "undefined")
|
|
1234
1224
|
item.sorter = (a, b) => a[item.id] - b[item.id];
|
|
1235
1225
|
if (item.filterDropdown !== false) {
|
|
1236
|
-
if (!item.onFilter)
|
|
1226
|
+
if (!item.onFilter && !props.faasData)
|
|
1237
1227
|
item.onFilter = (value, row) => {
|
|
1238
1228
|
if (value === null)
|
|
1239
1229
|
return true;
|
|
@@ -1268,7 +1258,7 @@ function Table(props) {
|
|
|
1268
1258
|
if (!item.render)
|
|
1269
1259
|
item.render = (value) => processValue(item, value).join(", ");
|
|
1270
1260
|
if (item.filterDropdown !== false) {
|
|
1271
|
-
if (!item.onFilter)
|
|
1261
|
+
if (!item.onFilter && !props.faasData)
|
|
1272
1262
|
item.onFilter = (value, row) => {
|
|
1273
1263
|
if (value === null && (!row[item.id] || !row[item.id].length))
|
|
1274
1264
|
return true;
|
|
@@ -1365,7 +1355,7 @@ function Table(props) {
|
|
|
1365
1355
|
]
|
|
1366
1356
|
}
|
|
1367
1357
|
);
|
|
1368
|
-
if (!item.onFilter)
|
|
1358
|
+
if (!item.onFilter && !props.faasData)
|
|
1369
1359
|
item.onFilter = (value, row) => {
|
|
1370
1360
|
switch (value) {
|
|
1371
1361
|
case true:
|
|
@@ -1407,7 +1397,7 @@ function Table(props) {
|
|
|
1407
1397
|
}
|
|
1408
1398
|
}
|
|
1409
1399
|
);
|
|
1410
|
-
if (!item.onFilter)
|
|
1400
|
+
if (!item.onFilter && !props.faasData)
|
|
1411
1401
|
item.onFilter = (value, row) => {
|
|
1412
1402
|
if (isNil(value[0]))
|
|
1413
1403
|
return true;
|
|
@@ -1447,7 +1437,7 @@ function Table(props) {
|
|
|
1447
1437
|
}
|
|
1448
1438
|
}
|
|
1449
1439
|
);
|
|
1450
|
-
if (!item.onFilter)
|
|
1440
|
+
if (!item.onFilter && !props.faasData)
|
|
1451
1441
|
item.onFilter = (value, row) => {
|
|
1452
1442
|
if (isNil(value[0]))
|
|
1453
1443
|
return true;
|
|
@@ -1483,7 +1473,7 @@ function Table(props) {
|
|
|
1483
1473
|
default:
|
|
1484
1474
|
if (!item.render)
|
|
1485
1475
|
item.render = (value) => processValue(item, value);
|
|
1486
|
-
if (item.filterDropdown !== false && !item.onFilter)
|
|
1476
|
+
if (item.filterDropdown !== false && !item.onFilter && !props.faasData)
|
|
1487
1477
|
item.onFilter = (value, row) => {
|
|
1488
1478
|
if (value === null && isNil(row[item.id]))
|
|
1489
1479
|
return true;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "1.
|
|
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": "1.
|
|
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": "1.
|
|
41
|
+
"@faasjs/react": "2.1.0",
|
|
42
42
|
"antd": "*",
|
|
43
43
|
"react": "*",
|
|
44
44
|
"react-dom": "*",
|