@faasjs/ant-design 0.0.5-beta.3 → 0.0.5-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
@@ -1046,8 +1046,9 @@ function Table(props) {
1046
1046
  return item;
1047
1047
  };
1048
1048
  react$1.useEffect(() => {
1049
- var _a, _b;
1050
- for (const item of props.items) {
1049
+ var _a, _b, _c;
1050
+ const items = lodashEs.cloneDeep(props.items);
1051
+ for (const item of items) {
1051
1052
  if (!item.key)
1052
1053
  item.key = item.id;
1053
1054
  if (!item.dataIndex)
@@ -1360,6 +1361,7 @@ function Table(props) {
1360
1361
  }
1361
1362
  break;
1362
1363
  case "time":
1364
+ item.width = (_c = item.width) != null ? _c : 200;
1363
1365
  if (!item.render)
1364
1366
  item.render = (value) => processValue(item, value);
1365
1367
  if (typeof item.sorter === "undefined")
@@ -1433,8 +1435,8 @@ function Table(props) {
1433
1435
  break;
1434
1436
  }
1435
1437
  }
1436
- setColumns(props.items);
1437
- }, [JSON.stringify(props.items)]);
1438
+ setColumns(items);
1439
+ }, [props.items]);
1438
1440
  react$1.useEffect(() => {
1439
1441
  if (!props.dataSource || !columns)
1440
1442
  return;
package/dist/index.mjs CHANGED
@@ -7,7 +7,7 @@ import { createContext, useState, useEffect, useContext, useMemo, cloneElement,
7
7
  export { lazy } from 'react';
8
8
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
9
9
  import { BrowserRouter, useNavigate, Link as Link$1, Routes as Routes$1, Route, useLocation } from 'react-router-dom';
10
- import { defaultsDeep, isNil, upperFirst, isFunction, uniqBy } from 'lodash-es';
10
+ import { defaultsDeep, isNil, upperFirst, isFunction, cloneDeep, uniqBy } from 'lodash-es';
11
11
  import dayjs2 from 'dayjs';
12
12
  import { PlusOutlined, MinusCircleOutlined, CheckOutlined, CloseOutlined } from '@ant-design/icons';
13
13
 
@@ -1043,8 +1043,9 @@ function Table(props) {
1043
1043
  return item;
1044
1044
  };
1045
1045
  useEffect(() => {
1046
- var _a, _b;
1047
- for (const item of props.items) {
1046
+ var _a, _b, _c;
1047
+ const items = cloneDeep(props.items);
1048
+ for (const item of items) {
1048
1049
  if (!item.key)
1049
1050
  item.key = item.id;
1050
1051
  if (!item.dataIndex)
@@ -1357,6 +1358,7 @@ function Table(props) {
1357
1358
  }
1358
1359
  break;
1359
1360
  case "time":
1361
+ item.width = (_c = item.width) != null ? _c : 200;
1360
1362
  if (!item.render)
1361
1363
  item.render = (value) => processValue(item, value);
1362
1364
  if (typeof item.sorter === "undefined")
@@ -1430,8 +1432,8 @@ function Table(props) {
1430
1432
  break;
1431
1433
  }
1432
1434
  }
1433
- setColumns(props.items);
1434
- }, [JSON.stringify(props.items)]);
1435
+ setColumns(items);
1436
+ }, [props.items]);
1435
1437
  useEffect(() => {
1436
1438
  if (!props.dataSource || !columns)
1437
1439
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/ant-design",
3
- "version": "0.0.5-beta.3",
3
+ "version": "0.0.5-beta.4",
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": "0.0.5-beta.3",
29
+ "@faasjs/react": "0.0.5-beta.4",
30
30
  "antd": "*",
31
31
  "react": "*",
32
32
  "react-dom": "*",
@@ -37,7 +37,7 @@
37
37
  "@testing-library/jest-dom": "*",
38
38
  "@testing-library/react": "*",
39
39
  "@testing-library/user-event": "*",
40
- "@faasjs/react": "0.0.5-beta.3",
40
+ "@faasjs/react": "0.0.5-beta.4",
41
41
  "antd": "*",
42
42
  "react": "*",
43
43
  "react-dom": "*",