@openli1115/lowcode-edit-pro-table 1.0.92 → 1.0.93
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.9be103d1.js → umi.c4bcb926.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 +5 -5
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.js +4 -4
- package/dist/BizComps.js +4 -4
- package/dist/BizComps.js.map +1 -1
- package/es/components/ProCascaderSelect/index.js +51 -15
- package/lib/components/ProCascaderSelect/index.js +51 -15
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/meta.js +1 -1
- package/package.json +3 -3
|
@@ -198,6 +198,45 @@ function cascaderChangeToPath(newValue, extra) {
|
|
|
198
198
|
return [String(newValue)];
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
/**
|
|
202
|
+
* 范围内表回填形状:
|
|
203
|
+
* - customType 4:`structure.data` 为 `[{ low, high, sign, option, ... }]` → 取 `data[0].field`
|
|
204
|
+
* - 对象型:`structure.data` 为 `{ low: ... }` → 取 `data.field`
|
|
205
|
+
* - 扁平:`structure.field`(与 previewUtils expandInnerTableRangeEcho 一致)
|
|
206
|
+
*/
|
|
207
|
+
function readRangeInnerEchoValue(values, structureName, structureField, flatPath) {
|
|
208
|
+
var dataBagPath = structureName ? structureName + ".data" : '';
|
|
209
|
+
var pathsTryFirst = [structureName && structureField ? structureName + ".data[0]." + structureField : '', structureName && structureField ? structureName + ".data." + structureField : '', flatPath].filter(Boolean);
|
|
210
|
+
for (var _iterator4 = _createForOfIteratorHelperLoose(pathsTryFirst), _step4; !(_step4 = _iterator4()).done;) {
|
|
211
|
+
var p = _step4.value;
|
|
212
|
+
var _v2 = get(values, p);
|
|
213
|
+
if (_v2 !== undefined && _v2 !== null) return _v2;
|
|
214
|
+
}
|
|
215
|
+
if (structureField && dataBagPath) {
|
|
216
|
+
var bag = get(values, dataBagPath);
|
|
217
|
+
if (Array.isArray(bag) && bag[0] && typeof bag[0] === 'object' && structureField in bag[0]) {
|
|
218
|
+
var v = bag[0][structureField];
|
|
219
|
+
if (v !== undefined && v !== null) return v;
|
|
220
|
+
}
|
|
221
|
+
if (bag && typeof bag === 'object' && !Array.isArray(bag) && structureField in bag) {
|
|
222
|
+
var _v = bag[structureField];
|
|
223
|
+
if (_v !== undefined && _v !== null) return _v;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return FORM_EMPTY_ARRAY;
|
|
227
|
+
}
|
|
228
|
+
function resolveRangeInnerWritePath(values, structureName, structureField, flatPath) {
|
|
229
|
+
if (!structureName || !structureField) return flatPath;
|
|
230
|
+
var dataBag = get(values, structureName + ".data");
|
|
231
|
+
if (Array.isArray(dataBag)) {
|
|
232
|
+
return structureName + ".data[0]." + structureField;
|
|
233
|
+
}
|
|
234
|
+
if (dataBag && typeof dataBag === 'object' && !Array.isArray(dataBag)) {
|
|
235
|
+
return structureName + ".data." + structureField;
|
|
236
|
+
}
|
|
237
|
+
return flatPath;
|
|
238
|
+
}
|
|
239
|
+
|
|
201
240
|
/**
|
|
202
241
|
* 与 ProInput 一致写入扁平路径 `structure.field`;读取时兼容接口把字段挂在 `structure.data.field`
|
|
203
242
|
* 或多包一层对象的情况(与 previewUtils normalizeType3 一致)。
|
|
@@ -213,8 +252,6 @@ function useCascaderBoundValue(fieldPath, structureName, structureField, unbound
|
|
|
213
252
|
var bound = Boolean(fieldPath);
|
|
214
253
|
var nestedFieldPath = structureName && structureField ? structureName + ".data." + structureField : '';
|
|
215
254
|
var dataBagPath = structureName ? structureName + ".data" : '';
|
|
216
|
-
/** 范围内表:接口与预览回填多在 structure.data.field(如 ts_city.data.low),须优先对该路径读写 */
|
|
217
|
-
var primaryStoragePath = rangeInnerTable && nestedFieldPath ? nestedFieldPath : fieldPath;
|
|
218
255
|
var ctxValue = useMemo(function () {
|
|
219
256
|
if (!bound || !(formContext !== null && formContext !== void 0 && formContext.initialized)) return FORM_EMPTY_ARRAY;
|
|
220
257
|
var values = formContext.values;
|
|
@@ -224,17 +261,14 @@ function useCascaderBoundValue(fieldPath, structureName, structureField, unbound
|
|
|
224
261
|
if (v !== undefined && v !== null) return v;
|
|
225
262
|
return FORM_EMPTY_ARRAY;
|
|
226
263
|
};
|
|
227
|
-
if (rangeInnerTable) {
|
|
228
|
-
var
|
|
229
|
-
if (
|
|
230
|
-
var fromFlat = fieldPath ? tryRead(fieldPath) : FORM_EMPTY_ARRAY;
|
|
231
|
-
if (fromFlat !== FORM_EMPTY_ARRAY) return fromFlat;
|
|
232
|
-
} else {
|
|
233
|
-
var _fromFlat = fieldPath ? tryRead(fieldPath) : FORM_EMPTY_ARRAY;
|
|
234
|
-
if (_fromFlat !== FORM_EMPTY_ARRAY) return _fromFlat;
|
|
235
|
-
var _fromNested = nestedFieldPath ? tryRead(nestedFieldPath) : FORM_EMPTY_ARRAY;
|
|
236
|
-
if (_fromNested !== FORM_EMPTY_ARRAY) return _fromNested;
|
|
264
|
+
if (rangeInnerTable && structureName && structureField) {
|
|
265
|
+
var fromRange = readRangeInnerEchoValue(values, structureName, structureField, fieldPath);
|
|
266
|
+
if (fromRange !== FORM_EMPTY_ARRAY) return fromRange;
|
|
237
267
|
}
|
|
268
|
+
var fromFlat = fieldPath ? tryRead(fieldPath) : FORM_EMPTY_ARRAY;
|
|
269
|
+
if (fromFlat !== FORM_EMPTY_ARRAY) return fromFlat;
|
|
270
|
+
var fromNested = nestedFieldPath ? tryRead(nestedFieldPath) : FORM_EMPTY_ARRAY;
|
|
271
|
+
if (fromNested !== FORM_EMPTY_ARRAY) return fromNested;
|
|
238
272
|
if (structureField && dataBagPath && has(values, dataBagPath)) {
|
|
239
273
|
var bag = get(values, dataBagPath);
|
|
240
274
|
if (bag && typeof bag === 'object' && !Array.isArray(bag) && structureField in bag) {
|
|
@@ -243,16 +277,18 @@ function useCascaderBoundValue(fieldPath, structureName, structureField, unbound
|
|
|
243
277
|
}
|
|
244
278
|
}
|
|
245
279
|
return FORM_EMPTY_ARRAY;
|
|
246
|
-
}, [bound, fieldPath, nestedFieldPath, dataBagPath, structureField, rangeInnerTable, formContext]);
|
|
280
|
+
}, [bound, fieldPath, nestedFieldPath, dataBagPath, structureField, rangeInnerTable, structureName, formContext]);
|
|
247
281
|
var value = bound ? ctxValue : localValue;
|
|
248
282
|
var commit = useCallback(function (next) {
|
|
249
283
|
if (bound) {
|
|
250
284
|
if (!(formContext !== null && formContext !== void 0 && formContext.setFieldValue)) return;
|
|
251
|
-
formContext.
|
|
285
|
+
var vals = formContext.values || {};
|
|
286
|
+
var path = rangeInnerTable && structureName && structureField ? resolveRangeInnerWritePath(vals, structureName, structureField, fieldPath) : fieldPath;
|
|
287
|
+
formContext.setFieldValue(path, next);
|
|
252
288
|
} else {
|
|
253
289
|
setLocalValue(next);
|
|
254
290
|
}
|
|
255
|
-
}, [bound, fieldPath,
|
|
291
|
+
}, [bound, fieldPath, formContext, rangeInnerTable, structureName, structureField]);
|
|
256
292
|
return {
|
|
257
293
|
value: value,
|
|
258
294
|
commit: commit
|
|
@@ -203,6 +203,45 @@ function cascaderChangeToPath(newValue, extra) {
|
|
|
203
203
|
return [String(newValue)];
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
/**
|
|
207
|
+
* 范围内表回填形状:
|
|
208
|
+
* - customType 4:`structure.data` 为 `[{ low, high, sign, option, ... }]` → 取 `data[0].field`
|
|
209
|
+
* - 对象型:`structure.data` 为 `{ low: ... }` → 取 `data.field`
|
|
210
|
+
* - 扁平:`structure.field`(与 previewUtils expandInnerTableRangeEcho 一致)
|
|
211
|
+
*/
|
|
212
|
+
function readRangeInnerEchoValue(values, structureName, structureField, flatPath) {
|
|
213
|
+
var dataBagPath = structureName ? structureName + ".data" : '';
|
|
214
|
+
var pathsTryFirst = [structureName && structureField ? structureName + ".data[0]." + structureField : '', structureName && structureField ? structureName + ".data." + structureField : '', flatPath].filter(Boolean);
|
|
215
|
+
for (var _iterator4 = _createForOfIteratorHelperLoose(pathsTryFirst), _step4; !(_step4 = _iterator4()).done;) {
|
|
216
|
+
var p = _step4.value;
|
|
217
|
+
var _v2 = (0, _lodash.get)(values, p);
|
|
218
|
+
if (_v2 !== undefined && _v2 !== null) return _v2;
|
|
219
|
+
}
|
|
220
|
+
if (structureField && dataBagPath) {
|
|
221
|
+
var bag = (0, _lodash.get)(values, dataBagPath);
|
|
222
|
+
if (Array.isArray(bag) && bag[0] && typeof bag[0] === 'object' && structureField in bag[0]) {
|
|
223
|
+
var v = bag[0][structureField];
|
|
224
|
+
if (v !== undefined && v !== null) return v;
|
|
225
|
+
}
|
|
226
|
+
if (bag && typeof bag === 'object' && !Array.isArray(bag) && structureField in bag) {
|
|
227
|
+
var _v = bag[structureField];
|
|
228
|
+
if (_v !== undefined && _v !== null) return _v;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return _useComponentContext.FORM_EMPTY_ARRAY;
|
|
232
|
+
}
|
|
233
|
+
function resolveRangeInnerWritePath(values, structureName, structureField, flatPath) {
|
|
234
|
+
if (!structureName || !structureField) return flatPath;
|
|
235
|
+
var dataBag = (0, _lodash.get)(values, structureName + ".data");
|
|
236
|
+
if (Array.isArray(dataBag)) {
|
|
237
|
+
return structureName + ".data[0]." + structureField;
|
|
238
|
+
}
|
|
239
|
+
if (dataBag && typeof dataBag === 'object' && !Array.isArray(dataBag)) {
|
|
240
|
+
return structureName + ".data." + structureField;
|
|
241
|
+
}
|
|
242
|
+
return flatPath;
|
|
243
|
+
}
|
|
244
|
+
|
|
206
245
|
/**
|
|
207
246
|
* 与 ProInput 一致写入扁平路径 `structure.field`;读取时兼容接口把字段挂在 `structure.data.field`
|
|
208
247
|
* 或多包一层对象的情况(与 previewUtils normalizeType3 一致)。
|
|
@@ -218,8 +257,6 @@ function useCascaderBoundValue(fieldPath, structureName, structureField, unbound
|
|
|
218
257
|
var bound = Boolean(fieldPath);
|
|
219
258
|
var nestedFieldPath = structureName && structureField ? structureName + ".data." + structureField : '';
|
|
220
259
|
var dataBagPath = structureName ? structureName + ".data" : '';
|
|
221
|
-
/** 范围内表:接口与预览回填多在 structure.data.field(如 ts_city.data.low),须优先对该路径读写 */
|
|
222
|
-
var primaryStoragePath = rangeInnerTable && nestedFieldPath ? nestedFieldPath : fieldPath;
|
|
223
260
|
var ctxValue = useMemo(function () {
|
|
224
261
|
if (!bound || !(formContext !== null && formContext !== void 0 && formContext.initialized)) return _useComponentContext.FORM_EMPTY_ARRAY;
|
|
225
262
|
var values = formContext.values;
|
|
@@ -229,17 +266,14 @@ function useCascaderBoundValue(fieldPath, structureName, structureField, unbound
|
|
|
229
266
|
if (v !== undefined && v !== null) return v;
|
|
230
267
|
return _useComponentContext.FORM_EMPTY_ARRAY;
|
|
231
268
|
};
|
|
232
|
-
if (rangeInnerTable) {
|
|
233
|
-
var
|
|
234
|
-
if (
|
|
235
|
-
var fromFlat = fieldPath ? tryRead(fieldPath) : _useComponentContext.FORM_EMPTY_ARRAY;
|
|
236
|
-
if (fromFlat !== _useComponentContext.FORM_EMPTY_ARRAY) return fromFlat;
|
|
237
|
-
} else {
|
|
238
|
-
var _fromFlat = fieldPath ? tryRead(fieldPath) : _useComponentContext.FORM_EMPTY_ARRAY;
|
|
239
|
-
if (_fromFlat !== _useComponentContext.FORM_EMPTY_ARRAY) return _fromFlat;
|
|
240
|
-
var _fromNested = nestedFieldPath ? tryRead(nestedFieldPath) : _useComponentContext.FORM_EMPTY_ARRAY;
|
|
241
|
-
if (_fromNested !== _useComponentContext.FORM_EMPTY_ARRAY) return _fromNested;
|
|
269
|
+
if (rangeInnerTable && structureName && structureField) {
|
|
270
|
+
var fromRange = readRangeInnerEchoValue(values, structureName, structureField, fieldPath);
|
|
271
|
+
if (fromRange !== _useComponentContext.FORM_EMPTY_ARRAY) return fromRange;
|
|
242
272
|
}
|
|
273
|
+
var fromFlat = fieldPath ? tryRead(fieldPath) : _useComponentContext.FORM_EMPTY_ARRAY;
|
|
274
|
+
if (fromFlat !== _useComponentContext.FORM_EMPTY_ARRAY) return fromFlat;
|
|
275
|
+
var fromNested = nestedFieldPath ? tryRead(nestedFieldPath) : _useComponentContext.FORM_EMPTY_ARRAY;
|
|
276
|
+
if (fromNested !== _useComponentContext.FORM_EMPTY_ARRAY) return fromNested;
|
|
243
277
|
if (structureField && dataBagPath && (0, _lodash.has)(values, dataBagPath)) {
|
|
244
278
|
var bag = (0, _lodash.get)(values, dataBagPath);
|
|
245
279
|
if (bag && typeof bag === 'object' && !Array.isArray(bag) && structureField in bag) {
|
|
@@ -248,16 +282,18 @@ function useCascaderBoundValue(fieldPath, structureName, structureField, unbound
|
|
|
248
282
|
}
|
|
249
283
|
}
|
|
250
284
|
return _useComponentContext.FORM_EMPTY_ARRAY;
|
|
251
|
-
}, [bound, fieldPath, nestedFieldPath, dataBagPath, structureField, rangeInnerTable, formContext]);
|
|
285
|
+
}, [bound, fieldPath, nestedFieldPath, dataBagPath, structureField, rangeInnerTable, structureName, formContext]);
|
|
252
286
|
var value = bound ? ctxValue : localValue;
|
|
253
287
|
var commit = useCallback(function (next) {
|
|
254
288
|
if (bound) {
|
|
255
289
|
if (!(formContext !== null && formContext !== void 0 && formContext.setFieldValue)) return;
|
|
256
|
-
formContext.
|
|
290
|
+
var vals = formContext.values || {};
|
|
291
|
+
var path = rangeInnerTable && structureName && structureField ? resolveRangeInnerWritePath(vals, structureName, structureField, fieldPath) : fieldPath;
|
|
292
|
+
formContext.setFieldValue(path, next);
|
|
257
293
|
} else {
|
|
258
294
|
setLocalValue(next);
|
|
259
295
|
}
|
|
260
|
-
}, [bound, fieldPath,
|
|
296
|
+
}, [bound, fieldPath, formContext, rangeInnerTable, structureName, structureField]);
|
|
261
297
|
return {
|
|
262
298
|
value: value,
|
|
263
299
|
commit: commit
|
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.93';
|
|
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.93';
|
|
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.93",
|
|
4
4
|
"description": "@openli1115/lowcode-edit-pro-table",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
},
|
|
102
102
|
"componentConfig": {
|
|
103
103
|
"isComponentLibrary": true,
|
|
104
|
-
"materialSchema": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.
|
|
104
|
+
"materialSchema": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.93/build/lowcode/assets-prod.json"
|
|
105
105
|
},
|
|
106
106
|
"lcMeta": {
|
|
107
107
|
"type": "component"
|
|
108
108
|
},
|
|
109
|
-
"homepage": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.
|
|
109
|
+
"homepage": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.93/build/index.html"
|
|
110
110
|
}
|