@faasjs/ant-design 0.0.3-beta.23 → 0.0.3-beta.24

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
@@ -1268,18 +1268,20 @@ function Table(props) {
1268
1268
  return;
1269
1269
  for (const column of columns) {
1270
1270
  if (column.optionsType === "auto" && !column.options && !column.filters) {
1271
- setColumns((prev) => {
1272
- const newColumns = [...prev];
1273
- const index = newColumns.findIndex((item) => item.id === column.id);
1274
- newColumns[index].filters = (0, import_lodash_es6.uniqBy)(props.dataSource, column.id).map((v) => ({
1275
- text: v[column.id],
1276
- value: v[column.id]
1277
- })).concat({
1278
- text: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {}),
1279
- value: null
1271
+ const filters = (0, import_lodash_es6.uniqBy)(props.dataSource, column.id).map((v) => ({
1272
+ text: v[column.id],
1273
+ value: v[column.id]
1274
+ }));
1275
+ if (filters.length)
1276
+ setColumns((prev) => {
1277
+ const newColumns = [...prev];
1278
+ const index = newColumns.findIndex((item) => item.id === column.id);
1279
+ newColumns[index].filters = filters.concat({
1280
+ text: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {}),
1281
+ value: null
1282
+ });
1283
+ return newColumns;
1280
1284
  });
1281
- return newColumns;
1282
- });
1283
1285
  }
1284
1286
  }
1285
1287
  }, [props.dataSource, columns]);
@@ -1332,13 +1334,15 @@ function FaasDataTable({
1332
1334
  continue;
1333
1335
  }
1334
1336
  if (column.optionsType === "auto" && !column.options && !column.filters) {
1335
- column.filters = (0, import_lodash_es6.uniqBy)(props.dataSource, column.id).map((v) => ({
1337
+ const filters = (0, import_lodash_es6.uniqBy)(props.dataSource, column.id).map((v) => ({
1336
1338
  text: v[column.id],
1337
1339
  value: v[column.id]
1338
- })).concat({
1339
- text: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {}),
1340
- value: null
1341
- });
1340
+ }));
1341
+ if (filters.length)
1342
+ column.filters = filters.concat({
1343
+ text: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Blank, {}),
1344
+ value: null
1345
+ });
1342
1346
  }
1343
1347
  }
1344
1348
  return newColumns;
package/dist/index.mjs CHANGED
@@ -1274,18 +1274,20 @@ function Table(props) {
1274
1274
  return;
1275
1275
  for (const column of columns) {
1276
1276
  if (column.optionsType === "auto" && !column.options && !column.filters) {
1277
- setColumns((prev) => {
1278
- const newColumns = [...prev];
1279
- const index = newColumns.findIndex((item) => item.id === column.id);
1280
- newColumns[index].filters = uniqBy(props.dataSource, column.id).map((v) => ({
1281
- text: v[column.id],
1282
- value: v[column.id]
1283
- })).concat({
1284
- text: /* @__PURE__ */ jsx10(Blank, {}),
1285
- value: null
1277
+ const filters = uniqBy(props.dataSource, column.id).map((v) => ({
1278
+ text: v[column.id],
1279
+ value: v[column.id]
1280
+ }));
1281
+ if (filters.length)
1282
+ setColumns((prev) => {
1283
+ const newColumns = [...prev];
1284
+ const index = newColumns.findIndex((item) => item.id === column.id);
1285
+ newColumns[index].filters = filters.concat({
1286
+ text: /* @__PURE__ */ jsx10(Blank, {}),
1287
+ value: null
1288
+ });
1289
+ return newColumns;
1286
1290
  });
1287
- return newColumns;
1288
- });
1289
1291
  }
1290
1292
  }
1291
1293
  }, [props.dataSource, columns]);
@@ -1338,13 +1340,15 @@ function FaasDataTable({
1338
1340
  continue;
1339
1341
  }
1340
1342
  if (column.optionsType === "auto" && !column.options && !column.filters) {
1341
- column.filters = uniqBy(props.dataSource, column.id).map((v) => ({
1343
+ const filters = uniqBy(props.dataSource, column.id).map((v) => ({
1342
1344
  text: v[column.id],
1343
1345
  value: v[column.id]
1344
- })).concat({
1345
- text: /* @__PURE__ */ jsx10(Blank, {}),
1346
- value: null
1347
- });
1346
+ }));
1347
+ if (filters.length)
1348
+ column.filters = filters.concat({
1349
+ text: /* @__PURE__ */ jsx10(Blank, {}),
1350
+ value: null
1351
+ });
1348
1352
  }
1349
1353
  }
1350
1354
  return newColumns;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.3-beta.23",
3
+ "version": "0.0.3-beta.24",
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.23",
31
+ "@faasjs/react": "^0.0.3-beta.24",
32
32
  "react-router-dom": "*",
33
33
  "dayjs": "*"
34
34
  },