@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 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.Table, {
1270
- ...props,
1271
- rowKey: props.rowKey || "id",
1272
- columns,
1273
- dataSource: props.dataSource
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.Table, {
1286
- ...props,
1287
- rowKey: props.rowKey || "id",
1288
- columns,
1289
- dataSource: []
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.Table, {
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
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd10.Table, {
1299
- ...props,
1300
- rowKey: props.rowKey || "id",
1301
- columns,
1302
- dataSource: data.rows,
1303
- pagination: {
1304
- ...props.pagination,
1305
- ...data.pagination
1306
- },
1307
- onChange: (pagination, filters, sorter, extra) => {
1308
- if (props.onChange) {
1309
- const processed = props.onChange(pagination, filters, sorter, extra);
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: processed.pagination,
1313
- filters: processed.filters,
1314
- sorter: processed.sorter
1331
+ pagination,
1332
+ filters,
1333
+ sorter
1315
1334
  });
1316
- return;
1317
1335
  }
1318
- reload({
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(AntdTable, {
1273
- ...props,
1274
- rowKey: props.rowKey || "id",
1275
- columns,
1276
- dataSource: props.dataSource
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(AntdTable, {
1289
- ...props,
1290
- rowKey: props.rowKey || "id",
1291
- columns,
1292
- dataSource: []
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(AntdTable, {
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
- return /* @__PURE__ */ jsx10(AntdTable, {
1302
- ...props,
1303
- rowKey: props.rowKey || "id",
1304
- columns,
1305
- dataSource: data.rows,
1306
- pagination: {
1307
- ...props.pagination,
1308
- ...data.pagination
1309
- },
1310
- onChange: (pagination, filters, sorter, extra) => {
1311
- if (props.onChange) {
1312
- const processed = props.onChange(pagination, filters, sorter, extra);
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: processed.pagination,
1316
- filters: processed.filters,
1317
- sorter: processed.sorter
1335
+ pagination,
1336
+ filters,
1337
+ sorter
1318
1338
  });
1319
- return;
1320
1339
  }
1321
- reload({
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",
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.3",
31
+ "@faasjs/react": "^0.0.3-beta.4",
32
32
  "react-router-dom": "*",
33
33
  "dayjs": "*"
34
34
  },