@openli1115/lowcode-edit-pro-table 1.0.48 → 1.0.49

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.
@@ -150,6 +150,10 @@ var EditProTable = function EditProTable(_ref) {
150
150
  }, "\u5220\u9664"))];
151
151
  }
152
152
  }];
153
+ var formatMap = {
154
+ date: 'YYYY-MM-DD',
155
+ time: 'HH:mm:ss'
156
+ };
153
157
  useEffect(function () {
154
158
  console.log('columns', columns);
155
159
  setOriginalColumns(columns);
@@ -257,20 +261,21 @@ var EditProTable = function EditProTable(_ref) {
257
261
  if (toType === void 0) {
258
262
  toType = 'moment';
259
263
  }
264
+ console.log('editProTable convertTimeData', data);
260
265
  return data.map(function (row) {
261
266
  var newRow = _extends({}, row);
262
267
  Object.keys(newRow).forEach(function (key) {
263
268
  var col = columns.find(function (c) {
264
269
  return c.dataIndex === key;
265
270
  });
266
- if (!col || !['time', 'date'].includes(col.valueType)) return;
271
+ if (!col || !['date', 'time'].includes(col.valueType)) return;
267
272
  var value = newRow[key];
268
273
  if (toType === 'moment') {
269
274
  if (!value || value === '') {
270
275
  newRow[key] = null;
271
276
  }
272
- if (typeof value === 'string' && value.length && col.valueType === 'time') {
273
- var m = moment(value, 'HH:mm:ss', true);
277
+ if (typeof value === 'string' && value.length && ['date', 'time'].includes(col.valueType)) {
278
+ var m = moment(value, formatMap[col.valueType], true);
274
279
  newRow[key] = m.isValid() ? m : null;
275
280
  }
276
281
  }
@@ -47,6 +47,10 @@ var ProTable = function ProTable(_ref) {
47
47
  fixed: 'left',
48
48
  hideInTable: true
49
49
  }];
50
+ var formatMap = {
51
+ date: 'YYYY-MM-DD',
52
+ time: 'HH:mm:ss'
53
+ };
50
54
  useEffect(function () {
51
55
  setOriginalColumns(columns);
52
56
  if (dataSource.length) {
@@ -60,20 +64,21 @@ var ProTable = function ProTable(_ref) {
60
64
  if (toType === void 0) {
61
65
  toType = 'moment';
62
66
  }
67
+ console.log('proTable convertTimeData', data);
63
68
  return data.map(function (row) {
64
69
  var newRow = _extends({}, row);
65
70
  Object.keys(newRow).forEach(function (key) {
66
71
  var col = columns.find(function (c) {
67
72
  return c.dataIndex === key;
68
73
  });
69
- if (!col || !['time', 'date'].includes(col.valueType)) return;
74
+ if (!col || !['date', 'time'].includes(col.valueType)) return;
70
75
  var value = newRow[key];
71
76
  if (toType === 'moment') {
72
77
  if (!value || value === '') {
73
78
  newRow[key] = null;
74
79
  }
75
- if (typeof value === 'string' && value.length && col.valueType === 'time') {
76
- var m = moment(value, 'HH:mm:ss', true);
80
+ if (typeof value === 'string' && value.length && ['date', 'time'].includes(col.valueType)) {
81
+ var m = moment(value, formatMap[col.valueType], true);
77
82
  newRow[key] = m.isValid() ? m : null;
78
83
  }
79
84
  }
@@ -155,6 +155,10 @@ var EditProTable = function EditProTable(_ref) {
155
155
  }, "\u5220\u9664"))];
156
156
  }
157
157
  }];
158
+ var formatMap = {
159
+ date: 'YYYY-MM-DD',
160
+ time: 'HH:mm:ss'
161
+ };
158
162
  (0, _react.useEffect)(function () {
159
163
  console.log('columns', columns);
160
164
  setOriginalColumns(columns);
@@ -262,20 +266,21 @@ var EditProTable = function EditProTable(_ref) {
262
266
  if (toType === void 0) {
263
267
  toType = 'moment';
264
268
  }
269
+ console.log('editProTable convertTimeData', data);
265
270
  return data.map(function (row) {
266
271
  var newRow = (0, _extends2["default"])({}, row);
267
272
  Object.keys(newRow).forEach(function (key) {
268
273
  var col = columns.find(function (c) {
269
274
  return c.dataIndex === key;
270
275
  });
271
- if (!col || !['time', 'date'].includes(col.valueType)) return;
276
+ if (!col || !['date', 'time'].includes(col.valueType)) return;
272
277
  var value = newRow[key];
273
278
  if (toType === 'moment') {
274
279
  if (!value || value === '') {
275
280
  newRow[key] = null;
276
281
  }
277
- if (typeof value === 'string' && value.length && col.valueType === 'time') {
278
- var m = (0, _moment["default"])(value, 'HH:mm:ss', true);
282
+ if (typeof value === 'string' && value.length && ['date', 'time'].includes(col.valueType)) {
283
+ var m = (0, _moment["default"])(value, formatMap[col.valueType], true);
279
284
  newRow[key] = m.isValid() ? m : null;
280
285
  }
281
286
  }
@@ -53,6 +53,10 @@ var ProTable = function ProTable(_ref) {
53
53
  fixed: 'left',
54
54
  hideInTable: true
55
55
  }];
56
+ var formatMap = {
57
+ date: 'YYYY-MM-DD',
58
+ time: 'HH:mm:ss'
59
+ };
56
60
  (0, _react.useEffect)(function () {
57
61
  setOriginalColumns(columns);
58
62
  if (dataSource.length) {
@@ -66,20 +70,21 @@ var ProTable = function ProTable(_ref) {
66
70
  if (toType === void 0) {
67
71
  toType = 'moment';
68
72
  }
73
+ console.log('proTable convertTimeData', data);
69
74
  return data.map(function (row) {
70
75
  var newRow = (0, _extends2["default"])({}, row);
71
76
  Object.keys(newRow).forEach(function (key) {
72
77
  var col = columns.find(function (c) {
73
78
  return c.dataIndex === key;
74
79
  });
75
- if (!col || !['time', 'date'].includes(col.valueType)) return;
80
+ if (!col || !['date', 'time'].includes(col.valueType)) return;
76
81
  var value = newRow[key];
77
82
  if (toType === 'moment') {
78
83
  if (!value || value === '') {
79
84
  newRow[key] = null;
80
85
  }
81
- if (typeof value === 'string' && value.length && col.valueType === 'time') {
82
- var m = (0, _moment["default"])(value, 'HH:mm:ss', true);
86
+ if (typeof value === 'string' && value.length && ['date', 'time'].includes(col.valueType)) {
87
+ var m = (0, _moment["default"])(value, formatMap[col.valueType], true);
83
88
  newRow[key] = m.isValid() ? m : null;
84
89
  }
85
90
  }
@@ -101,7 +101,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
101
101
  packageName = '@openli1115/lowcode-edit-pro-table';
102
102
  }
103
103
  if (version === void 0) {
104
- version = '1.0.48';
104
+ version = '1.0.49';
105
105
  }
106
106
  if (basicLibraryVersion === void 0) {
107
107
  basicLibraryVersion = {
@@ -106,7 +106,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
106
106
  packageName = '@openli1115/lowcode-edit-pro-table';
107
107
  }
108
108
  if (version === void 0) {
109
- version = '1.0.48';
109
+ version = '1.0.49';
110
110
  }
111
111
  if (basicLibraryVersion === void 0) {
112
112
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openli1115/lowcode-edit-pro-table",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
4
4
  "description": "@openli1115/lowcode-edit-pro-table",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -100,10 +100,10 @@
100
100
  },
101
101
  "componentConfig": {
102
102
  "isComponentLibrary": true,
103
- "materialSchema": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.48/build/lowcode/assets-prod.json"
103
+ "materialSchema": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.49/build/lowcode/assets-prod.json"
104
104
  },
105
105
  "lcMeta": {
106
106
  "type": "component"
107
107
  },
108
- "homepage": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.48/build/index.html"
108
+ "homepage": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.49/build/index.html"
109
109
  }