szld-libs 0.2.34 → 0.2.35

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.
@@ -31,8 +31,9 @@ function SearchTable(props) {
31
31
  const getWidth = (v) => {
32
32
  var _a, _b;
33
33
  let width = v.width || minColumnWidth;
34
- if (typeof v.dataIndex === "string" && tableId) {
35
- const _width = (_b = (_a = getLocalStorage(storageKey)) == null ? void 0 : _a[tableId]) == null ? void 0 : _b[v.dataIndex];
34
+ if (v.dataIndex && tableId) {
35
+ const key = Array.isArray(v.dataIndex) ? v.dataIndex.join("-") : String(v.dataIndex);
36
+ const _width = (_b = (_a = getLocalStorage(storageKey)) == null ? void 0 : _a[tableId]) == null ? void 0 : _b[key];
36
37
  if (_width) {
37
38
  width = _width;
38
39
  }
@@ -78,8 +79,9 @@ function SearchTable(props) {
78
79
  const obj = getLocalStorage(storageKey) || {};
79
80
  obj[tableId] = obj[tableId] || {};
80
81
  list == null ? void 0 : list.forEach((v) => {
81
- if (typeof v.dataIndex === "string") {
82
- obj[tableId][v.dataIndex] = v.width;
82
+ if (v.dataIndex) {
83
+ const key = Array.isArray(v.dataIndex) ? v.dataIndex.join("-") : String(v.dataIndex);
84
+ obj[tableId][key] = v.width;
83
85
  }
84
86
  });
85
87
  localStorage.setItem(storageKey, JSON.stringify(obj));
package/es/index.js CHANGED
@@ -12,7 +12,7 @@ const Demo = () => {
12
12
  }, []);
13
13
  const columns = [
14
14
  {
15
- dataIndex: "a",
15
+ dataIndex: ["a", 2],
16
16
  title: "a"
17
17
  },
18
18
  Table.EXPAND_COLUMN,
@@ -32,8 +32,9 @@ function SearchTable(props) {
32
32
  const getWidth = (v) => {
33
33
  var _a, _b;
34
34
  let width = v.width || minColumnWidth;
35
- if (typeof v.dataIndex === "string" && tableId) {
36
- const _width = (_b = (_a = utils.getLocalStorage(storageKey)) == null ? void 0 : _a[tableId]) == null ? void 0 : _b[v.dataIndex];
35
+ if (v.dataIndex && tableId) {
36
+ const key = Array.isArray(v.dataIndex) ? v.dataIndex.join("-") : String(v.dataIndex);
37
+ const _width = (_b = (_a = utils.getLocalStorage(storageKey)) == null ? void 0 : _a[tableId]) == null ? void 0 : _b[key];
37
38
  if (_width) {
38
39
  width = _width;
39
40
  }
@@ -79,8 +80,9 @@ function SearchTable(props) {
79
80
  const obj = utils.getLocalStorage(storageKey) || {};
80
81
  obj[tableId] = obj[tableId] || {};
81
82
  list == null ? void 0 : list.forEach((v) => {
82
- if (typeof v.dataIndex === "string") {
83
- obj[tableId][v.dataIndex] = v.width;
83
+ if (v.dataIndex) {
84
+ const key = Array.isArray(v.dataIndex) ? v.dataIndex.join("-") : String(v.dataIndex);
85
+ obj[tableId][key] = v.width;
84
86
  }
85
87
  });
86
88
  localStorage.setItem(storageKey, JSON.stringify(obj));
package/lib/index.js CHANGED
@@ -13,7 +13,7 @@ const Demo = () => {
13
13
  }, []);
14
14
  const columns = [
15
15
  {
16
- dataIndex: "a",
16
+ dataIndex: ["a", 2],
17
17
  title: "a"
18
18
  },
19
19
  antd.Table.EXPAND_COLUMN,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "szld-libs",
3
3
  "private": false,
4
- "version": "0.2.34",
4
+ "version": "0.2.35",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",