@openli1115/lowcode-edit-pro-table 1.0.48 → 1.0.50
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/build/docs/404.html +3 -3
- package/build/docs/_demos/:uuid +3 -3
- package/build/docs/colorful-button.html +3 -3
- package/build/docs/colorful-input.html +3 -3
- package/build/docs/index.html +3 -3
- package/build/docs/{umi.f1fb0e63.js → umi.1e11ad71.js} +1 -1
- package/build/docs/~demos/:uuid.html +3 -3
- package/build/docs/~demos/colorful-button-demo.html +3 -3
- package/build/docs/~demos/colorful-input-demo.html +3 -3
- package/build/lowcode/assets-daily.json +13 -13
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +13 -13
- package/build/lowcode/meta.design.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +3 -3
- package/build/lowcode/render/default/view.js +5 -5
- package/build/lowcode/view.js +3 -3
- package/dist/BizComps.js +4 -4
- package/dist/BizComps.js.map +1 -1
- package/es/components/edit-pro-table/edit-pro-table.js +8 -3
- package/es/components/pro-table/pro-table.js +8 -3
- package/es/context/FormProvider.js +2 -2
- package/lib/components/edit-pro-table/edit-pro-table.js +8 -3
- package/lib/components/pro-table/pro-table.js +8 -3
- package/lib/context/FormProvider.js +1 -1
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/meta.js +1 -1
- package/package.json +3 -3
|
@@ -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 || !['
|
|
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 &&
|
|
273
|
-
var m = moment(value,
|
|
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 || !['
|
|
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 &&
|
|
76
|
-
var m = moment(value,
|
|
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
|
}
|
|
@@ -6,7 +6,7 @@ var createContext = React.createContext,
|
|
|
6
6
|
useMemo = React.useMemo,
|
|
7
7
|
useRef = React.useRef,
|
|
8
8
|
useState = React.useState;
|
|
9
|
-
import { get, set } from 'lodash';
|
|
9
|
+
import { get, set, isEqual } from 'lodash';
|
|
10
10
|
|
|
11
11
|
// formContext.ts
|
|
12
12
|
var FormContext;
|
|
@@ -44,7 +44,7 @@ export var FormProvider = function FormProvider(_ref) {
|
|
|
44
44
|
|
|
45
45
|
// 仅当 initialValues 引用变化时更新状态
|
|
46
46
|
useEffect(function () {
|
|
47
|
-
if (initialValues
|
|
47
|
+
if (!isEqual(initialValues, initialValuesRef.current)) {
|
|
48
48
|
console.log('[FormProvider] 🔄 useEffect triggered - initialValues:', initialValues);
|
|
49
49
|
initialValuesRef.current = initialValues;
|
|
50
50
|
setValues(function (prev) {
|
|
@@ -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 || !['
|
|
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 &&
|
|
278
|
-
var m = (0, _moment["default"])(value,
|
|
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 || !['
|
|
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 &&
|
|
82
|
-
var m = (0, _moment["default"])(value,
|
|
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
|
}
|
|
@@ -50,7 +50,7 @@ var FormProvider = exports.FormProvider = function FormProvider(_ref) {
|
|
|
50
50
|
|
|
51
51
|
// 仅当 initialValues 引用变化时更新状态
|
|
52
52
|
useEffect(function () {
|
|
53
|
-
if (initialValues
|
|
53
|
+
if (!(0, _lodash.isEqual)(initialValues, initialValuesRef.current)) {
|
|
54
54
|
console.log('[FormProvider] 🔄 useEffect triggered - initialValues:', initialValues);
|
|
55
55
|
initialValuesRef.current = initialValues;
|
|
56
56
|
setValues(function (prev) {
|
package/lowcode_es/meta.js
CHANGED
|
@@ -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.
|
|
104
|
+
version = '1.0.50';
|
|
105
105
|
}
|
|
106
106
|
if (basicLibraryVersion === void 0) {
|
|
107
107
|
basicLibraryVersion = {
|
package/lowcode_lib/meta.js
CHANGED
|
@@ -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.
|
|
109
|
+
version = '1.0.50';
|
|
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.
|
|
3
|
+
"version": "1.0.50",
|
|
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.
|
|
103
|
+
"materialSchema": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.50/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.
|
|
108
|
+
"homepage": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.50/build/index.html"
|
|
109
109
|
}
|