@faasjs/ant-design 0.0.3-beta.3 → 0.0.3-beta.4
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.js +49 -37
- package/dist/index.mjs +51 -38
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -972,7 +972,7 @@ function processValue(item, value) {
|
|
|
972
972
|
}
|
|
973
973
|
function Table(props) {
|
|
974
974
|
const [columns, setColumns] = (0, import_react11.useState)();
|
|
975
|
-
const { common: common2 } = useConfigContext();
|
|
975
|
+
const { common: common2, antd } = useConfigContext();
|
|
976
976
|
(0, import_react11.useEffect)(() => {
|
|
977
977
|
var _a;
|
|
978
978
|
for (const item of props.items) {
|
|
@@ -1266,11 +1266,14 @@ function Table(props) {
|
|
|
1266
1266
|
if (!columns)
|
|
1267
1267
|
return null;
|
|
1268
1268
|
if (!props.faasData)
|
|
1269
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.
|
|
1270
|
-
...
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.ConfigProvider, {
|
|
1270
|
+
...antd,
|
|
1271
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
|
|
1272
|
+
...props,
|
|
1273
|
+
rowKey: props.rowKey || "id",
|
|
1274
|
+
columns,
|
|
1275
|
+
dataSource: props.dataSource
|
|
1276
|
+
})
|
|
1274
1277
|
});
|
|
1275
1278
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react12.FaasDataWrapper, {
|
|
1276
1279
|
fallback: props.faasData.fallback || /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Skeleton, {
|
|
@@ -1282,46 +1285,55 @@ function Table(props) {
|
|
|
1282
1285
|
reload
|
|
1283
1286
|
}) => {
|
|
1284
1287
|
if (!data)
|
|
1285
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.
|
|
1286
|
-
...
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.ConfigProvider, {
|
|
1289
|
+
...antd,
|
|
1290
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
|
|
1291
|
+
...props,
|
|
1292
|
+
rowKey: props.rowKey || "id",
|
|
1293
|
+
columns,
|
|
1294
|
+
dataSource: []
|
|
1295
|
+
})
|
|
1290
1296
|
});
|
|
1291
1297
|
if (Array.isArray(data))
|
|
1292
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.
|
|
1298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.ConfigProvider, {
|
|
1299
|
+
...antd,
|
|
1300
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
|
|
1301
|
+
...props,
|
|
1302
|
+
rowKey: props.rowKey || "id",
|
|
1303
|
+
columns,
|
|
1304
|
+
dataSource: data
|
|
1305
|
+
})
|
|
1306
|
+
});
|
|
1307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.ConfigProvider, {
|
|
1308
|
+
...antd,
|
|
1309
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
|
|
1293
1310
|
...props,
|
|
1294
1311
|
rowKey: props.rowKey || "id",
|
|
1295
1312
|
columns,
|
|
1296
|
-
dataSource: data
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1313
|
+
dataSource: data.rows,
|
|
1314
|
+
pagination: {
|
|
1315
|
+
...props.pagination,
|
|
1316
|
+
...data.pagination
|
|
1317
|
+
},
|
|
1318
|
+
onChange: (pagination, filters, sorter, extra) => {
|
|
1319
|
+
if (props.onChange) {
|
|
1320
|
+
const processed = props.onChange(pagination, filters, sorter, extra);
|
|
1321
|
+
reload({
|
|
1322
|
+
...params,
|
|
1323
|
+
pagination: processed.pagination,
|
|
1324
|
+
filters: processed.filters,
|
|
1325
|
+
sorter: processed.sorter
|
|
1326
|
+
});
|
|
1327
|
+
return;
|
|
1328
|
+
}
|
|
1310
1329
|
reload({
|
|
1311
1330
|
...params,
|
|
1312
|
-
pagination
|
|
1313
|
-
filters
|
|
1314
|
-
sorter
|
|
1331
|
+
pagination,
|
|
1332
|
+
filters,
|
|
1333
|
+
sorter
|
|
1315
1334
|
});
|
|
1316
|
-
return;
|
|
1317
1335
|
}
|
|
1318
|
-
|
|
1319
|
-
...params,
|
|
1320
|
-
pagination,
|
|
1321
|
-
filters,
|
|
1322
|
-
sorter
|
|
1323
|
-
});
|
|
1324
|
-
}
|
|
1336
|
+
})
|
|
1325
1337
|
});
|
|
1326
1338
|
},
|
|
1327
1339
|
...props.faasData
|
package/dist/index.mjs
CHANGED
|
@@ -938,7 +938,8 @@ import {
|
|
|
938
938
|
Table as AntdTable,
|
|
939
939
|
Radio,
|
|
940
940
|
Skeleton as Skeleton3,
|
|
941
|
-
Input as Input2
|
|
941
|
+
Input as Input2,
|
|
942
|
+
ConfigProvider as ConfigProvider2
|
|
942
943
|
} from "antd";
|
|
943
944
|
import dayjs2 from "dayjs";
|
|
944
945
|
import { CheckOutlined as CheckOutlined2, CloseOutlined as CloseOutlined2 } from "@ant-design/icons";
|
|
@@ -975,7 +976,7 @@ function processValue(item, value) {
|
|
|
975
976
|
}
|
|
976
977
|
function Table(props) {
|
|
977
978
|
const [columns, setColumns] = useState7();
|
|
978
|
-
const { common: common2 } = useConfigContext();
|
|
979
|
+
const { common: common2, antd } = useConfigContext();
|
|
979
980
|
useEffect5(() => {
|
|
980
981
|
var _a;
|
|
981
982
|
for (const item of props.items) {
|
|
@@ -1269,11 +1270,14 @@ function Table(props) {
|
|
|
1269
1270
|
if (!columns)
|
|
1270
1271
|
return null;
|
|
1271
1272
|
if (!props.faasData)
|
|
1272
|
-
return /* @__PURE__ */ jsx10(
|
|
1273
|
-
...
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1273
|
+
return /* @__PURE__ */ jsx10(ConfigProvider2, {
|
|
1274
|
+
...antd,
|
|
1275
|
+
children: /* @__PURE__ */ jsx10(AntdTable, {
|
|
1276
|
+
...props,
|
|
1277
|
+
rowKey: props.rowKey || "id",
|
|
1278
|
+
columns,
|
|
1279
|
+
dataSource: props.dataSource
|
|
1280
|
+
})
|
|
1277
1281
|
});
|
|
1278
1282
|
return /* @__PURE__ */ jsx10(FaasDataWrapper2, {
|
|
1279
1283
|
fallback: props.faasData.fallback || /* @__PURE__ */ jsx10(Skeleton3, {
|
|
@@ -1285,46 +1289,55 @@ function Table(props) {
|
|
|
1285
1289
|
reload
|
|
1286
1290
|
}) => {
|
|
1287
1291
|
if (!data)
|
|
1288
|
-
return /* @__PURE__ */ jsx10(
|
|
1289
|
-
...
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1292
|
+
return /* @__PURE__ */ jsx10(ConfigProvider2, {
|
|
1293
|
+
...antd,
|
|
1294
|
+
children: /* @__PURE__ */ jsx10(AntdTable, {
|
|
1295
|
+
...props,
|
|
1296
|
+
rowKey: props.rowKey || "id",
|
|
1297
|
+
columns,
|
|
1298
|
+
dataSource: []
|
|
1299
|
+
})
|
|
1293
1300
|
});
|
|
1294
1301
|
if (Array.isArray(data))
|
|
1295
|
-
return /* @__PURE__ */ jsx10(
|
|
1302
|
+
return /* @__PURE__ */ jsx10(ConfigProvider2, {
|
|
1303
|
+
...antd,
|
|
1304
|
+
children: /* @__PURE__ */ jsx10(AntdTable, {
|
|
1305
|
+
...props,
|
|
1306
|
+
rowKey: props.rowKey || "id",
|
|
1307
|
+
columns,
|
|
1308
|
+
dataSource: data
|
|
1309
|
+
})
|
|
1310
|
+
});
|
|
1311
|
+
return /* @__PURE__ */ jsx10(ConfigProvider2, {
|
|
1312
|
+
...antd,
|
|
1313
|
+
children: /* @__PURE__ */ jsx10(AntdTable, {
|
|
1296
1314
|
...props,
|
|
1297
1315
|
rowKey: props.rowKey || "id",
|
|
1298
1316
|
columns,
|
|
1299
|
-
dataSource: data
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1317
|
+
dataSource: data.rows,
|
|
1318
|
+
pagination: {
|
|
1319
|
+
...props.pagination,
|
|
1320
|
+
...data.pagination
|
|
1321
|
+
},
|
|
1322
|
+
onChange: (pagination, filters, sorter, extra) => {
|
|
1323
|
+
if (props.onChange) {
|
|
1324
|
+
const processed = props.onChange(pagination, filters, sorter, extra);
|
|
1325
|
+
reload({
|
|
1326
|
+
...params,
|
|
1327
|
+
pagination: processed.pagination,
|
|
1328
|
+
filters: processed.filters,
|
|
1329
|
+
sorter: processed.sorter
|
|
1330
|
+
});
|
|
1331
|
+
return;
|
|
1332
|
+
}
|
|
1313
1333
|
reload({
|
|
1314
1334
|
...params,
|
|
1315
|
-
pagination
|
|
1316
|
-
filters
|
|
1317
|
-
sorter
|
|
1335
|
+
pagination,
|
|
1336
|
+
filters,
|
|
1337
|
+
sorter
|
|
1318
1338
|
});
|
|
1319
|
-
return;
|
|
1320
1339
|
}
|
|
1321
|
-
|
|
1322
|
-
...params,
|
|
1323
|
-
pagination,
|
|
1324
|
-
filters,
|
|
1325
|
-
sorter
|
|
1326
|
-
});
|
|
1327
|
-
}
|
|
1340
|
+
})
|
|
1328
1341
|
});
|
|
1329
1342
|
},
|
|
1330
1343
|
...props.faasData
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/ant-design",
|
|
3
|
-
"version": "0.0.3-beta.
|
|
3
|
+
"version": "0.0.3-beta.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"lodash-es": "*",
|
|
29
29
|
"react": "*",
|
|
30
30
|
"react-dom": "*",
|
|
31
|
-
"@faasjs/react": "^0.0.3-beta.
|
|
31
|
+
"@faasjs/react": "^0.0.3-beta.4",
|
|
32
32
|
"react-router-dom": "*",
|
|
33
33
|
"dayjs": "*"
|
|
34
34
|
},
|