@openli1115/lowcode-edit-pro-table 1.0.93 → 1.0.95
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.c4bcb926.js → umi.2ed5321e.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 +2 -2
- 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 +26 -23
- package/lib/components/ProCascaderSelect/index.js +25 -22
- package/lowcode_es/meta.js +1 -1
- package/lowcode_lib/meta.js +1 -1
- package/package.json +3 -3
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
function _createForOfIteratorHelperLoose(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (t) return (t = t.call(r)).next.bind(t); if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var o = 0; return function () { return o >= r.length ? { done: !0 } : { done: !1, value: r[o++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
4
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
5
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
|
-
import { get
|
|
6
|
+
import { get } from 'lodash';
|
|
7
7
|
import { resolveProScreenBinding } from "../utils";
|
|
8
8
|
import { getFormContext } from "../../context/FormProvider";
|
|
9
9
|
import { FORM_EMPTY_ARRAY } from "../../context/useComponentContext";
|
|
@@ -14,6 +14,16 @@ var _window$React = window.React,
|
|
|
14
14
|
useMemo = _window$React.useMemo,
|
|
15
15
|
useContext = _window$React.useContext,
|
|
16
16
|
useState = _window$React.useState;
|
|
17
|
+
|
|
18
|
+
/** 与预览 previewFlowDebug 一致:window.__PREVIEW_FLOW_LOG__ === false 时静音 */
|
|
19
|
+
function previewFlowCascader(tag, detail) {
|
|
20
|
+
if (typeof window !== 'undefined' && window.__PREVIEW_FLOW_LOG__ === false) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
console.log('[PreviewFlow][Cascader]', tag, detail);
|
|
24
|
+
/** 避免控制台开「正则」筛选时,[] 被当成字符类导致搜不到;用纯文本筛「PreviewFlow Cascader」即可 */
|
|
25
|
+
console.log('PreviewFlow Cascader ·', tag, detail);
|
|
26
|
+
}
|
|
17
27
|
function toStr(v) {
|
|
18
28
|
if (v == null) return '';
|
|
19
29
|
return String(v);
|
|
@@ -255,8 +265,10 @@ function useCascaderBoundValue(fieldPath, structureName, structureField, unbound
|
|
|
255
265
|
var ctxValue = useMemo(function () {
|
|
256
266
|
if (!bound || !(formContext !== null && formContext !== void 0 && formContext.initialized)) return FORM_EMPTY_ARRAY;
|
|
257
267
|
var values = formContext.values;
|
|
268
|
+
|
|
269
|
+
/** 不用 has:部分路径 lodash has 与 get 不一致时会导致明明有值却读不到 */
|
|
258
270
|
var tryRead = function tryRead(p) {
|
|
259
|
-
if (!p
|
|
271
|
+
if (!p) return FORM_EMPTY_ARRAY;
|
|
260
272
|
var v = get(values, p);
|
|
261
273
|
if (v !== undefined && v !== null) return v;
|
|
262
274
|
return FORM_EMPTY_ARRAY;
|
|
@@ -269,7 +281,7 @@ function useCascaderBoundValue(fieldPath, structureName, structureField, unbound
|
|
|
269
281
|
if (fromFlat !== FORM_EMPTY_ARRAY) return fromFlat;
|
|
270
282
|
var fromNested = nestedFieldPath ? tryRead(nestedFieldPath) : FORM_EMPTY_ARRAY;
|
|
271
283
|
if (fromNested !== FORM_EMPTY_ARRAY) return fromNested;
|
|
272
|
-
if (structureField && dataBagPath
|
|
284
|
+
if (structureField && dataBagPath) {
|
|
273
285
|
var bag = get(values, dataBagPath);
|
|
274
286
|
if (bag && typeof bag === 'object' && !Array.isArray(bag) && structureField in bag) {
|
|
275
287
|
var v = bag[structureField];
|
|
@@ -329,11 +341,11 @@ var ProCascaderSelect = function ProCascaderSelect(props) {
|
|
|
329
341
|
}, [dataSource, options]);
|
|
330
342
|
var handleChange = function handleChange(newValue, _data, extra) {
|
|
331
343
|
var next = cascaderChangeToPath(newValue, extra);
|
|
332
|
-
|
|
344
|
+
previewFlowCascader('onChange', {
|
|
333
345
|
fieldPath: fieldPath,
|
|
334
346
|
rawValue: newValue,
|
|
335
|
-
|
|
336
|
-
|
|
347
|
+
normalizedPath: next,
|
|
348
|
+
selectedPathLen: Array.isArray(extra === null || extra === void 0 ? void 0 : extra.selectedPath) ? extra.selectedPath.length : 0
|
|
337
349
|
});
|
|
338
350
|
commit(next);
|
|
339
351
|
schemaOnChange === null || schemaOnChange === void 0 ? void 0 : schemaOnChange(next, structureName, structureField);
|
|
@@ -385,30 +397,21 @@ var ProCascaderSelect = function ProCascaderSelect(props) {
|
|
|
385
397
|
useEffect(function () {
|
|
386
398
|
var leaf = displayValue.length > 0 ? displayValue[displayValue.length - 1] : '';
|
|
387
399
|
var resolvedPathFromLeaf = leaf ? findPathByNodeValue(cascaderOptions, toStr(leaf)) : [];
|
|
388
|
-
|
|
389
|
-
fieldPath: fieldPath,
|
|
390
|
-
incomingLeafId: incomingLeafId,
|
|
391
|
-
packedPathFromLeaf: packedPathFromLeaf
|
|
392
|
-
});
|
|
393
|
-
console.log('[ProCascaderSelect] render-debug', {
|
|
400
|
+
previewFlowCascader('echo', {
|
|
394
401
|
fieldPath: fieldPath,
|
|
395
402
|
structureName: structureName,
|
|
396
403
|
structureField: structureField,
|
|
397
|
-
|
|
404
|
+
rangeInnerTable: rangeInnerTable,
|
|
405
|
+
incomingLeafId: incomingLeafId,
|
|
406
|
+
packedPathFromLeafLen: packedPathFromLeaf.length,
|
|
407
|
+
rawBoundValuePreview: typeof value === 'object' ? JSON.stringify(value).slice(0, 120) : String(value).slice(0, 80),
|
|
398
408
|
normalizedDisplayPath: displayValue,
|
|
399
|
-
|
|
409
|
+
fusionValuePreview: typeof valueForFusion === 'object' ? JSON.stringify(valueForFusion).slice(0, 80) : String(valueForFusion).slice(0, 80),
|
|
400
410
|
isMultiple: isMultiple,
|
|
401
411
|
optionsCount: cascaderOptions.length,
|
|
402
|
-
|
|
403
|
-
optionsPreview: cascaderOptions.slice(0, 3).map(function (n) {
|
|
404
|
-
return {
|
|
405
|
-
value: getNodeValue(n),
|
|
406
|
-
label: getNodeLabel(n),
|
|
407
|
-
childrenCount: getNodeChildren(n).length
|
|
408
|
-
};
|
|
409
|
-
})
|
|
412
|
+
resolvedPathFromLeafLen: resolvedPathFromLeaf.length
|
|
410
413
|
});
|
|
411
|
-
}, [fieldPath, structureName, structureField, value, displayValue, valueForFusion, isMultiple, cascaderOptions]);
|
|
414
|
+
}, [fieldPath, structureName, structureField, rangeInnerTable, incomingLeafId, packedPathFromLeaf, value, displayValue, valueForFusion, isMultiple, cascaderOptions]);
|
|
412
415
|
|
|
413
416
|
/** dataSource 未就绪或异步时,仍用自定义文案兜底 */
|
|
414
417
|
var schemaDisplayRender = props.displayRender;
|
|
@@ -19,6 +19,16 @@ var _window$React = window.React,
|
|
|
19
19
|
useMemo = _window$React.useMemo,
|
|
20
20
|
useContext = _window$React.useContext,
|
|
21
21
|
useState = _window$React.useState;
|
|
22
|
+
|
|
23
|
+
/** 与预览 previewFlowDebug 一致:window.__PREVIEW_FLOW_LOG__ === false 时静音 */
|
|
24
|
+
function previewFlowCascader(tag, detail) {
|
|
25
|
+
if (typeof window !== 'undefined' && window.__PREVIEW_FLOW_LOG__ === false) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
console.log('[PreviewFlow][Cascader]', tag, detail);
|
|
29
|
+
/** 避免控制台开「正则」筛选时,[] 被当成字符类导致搜不到;用纯文本筛「PreviewFlow Cascader」即可 */
|
|
30
|
+
console.log('PreviewFlow Cascader ·', tag, detail);
|
|
31
|
+
}
|
|
22
32
|
function toStr(v) {
|
|
23
33
|
if (v == null) return '';
|
|
24
34
|
return String(v);
|
|
@@ -260,8 +270,10 @@ function useCascaderBoundValue(fieldPath, structureName, structureField, unbound
|
|
|
260
270
|
var ctxValue = useMemo(function () {
|
|
261
271
|
if (!bound || !(formContext !== null && formContext !== void 0 && formContext.initialized)) return _useComponentContext.FORM_EMPTY_ARRAY;
|
|
262
272
|
var values = formContext.values;
|
|
273
|
+
|
|
274
|
+
/** 不用 has:部分路径 lodash has 与 get 不一致时会导致明明有值却读不到 */
|
|
263
275
|
var tryRead = function tryRead(p) {
|
|
264
|
-
if (!p
|
|
276
|
+
if (!p) return _useComponentContext.FORM_EMPTY_ARRAY;
|
|
265
277
|
var v = (0, _lodash.get)(values, p);
|
|
266
278
|
if (v !== undefined && v !== null) return v;
|
|
267
279
|
return _useComponentContext.FORM_EMPTY_ARRAY;
|
|
@@ -274,7 +286,7 @@ function useCascaderBoundValue(fieldPath, structureName, structureField, unbound
|
|
|
274
286
|
if (fromFlat !== _useComponentContext.FORM_EMPTY_ARRAY) return fromFlat;
|
|
275
287
|
var fromNested = nestedFieldPath ? tryRead(nestedFieldPath) : _useComponentContext.FORM_EMPTY_ARRAY;
|
|
276
288
|
if (fromNested !== _useComponentContext.FORM_EMPTY_ARRAY) return fromNested;
|
|
277
|
-
if (structureField && dataBagPath
|
|
289
|
+
if (structureField && dataBagPath) {
|
|
278
290
|
var bag = (0, _lodash.get)(values, dataBagPath);
|
|
279
291
|
if (bag && typeof bag === 'object' && !Array.isArray(bag) && structureField in bag) {
|
|
280
292
|
var v = bag[structureField];
|
|
@@ -334,11 +346,11 @@ var ProCascaderSelect = function ProCascaderSelect(props) {
|
|
|
334
346
|
}, [dataSource, options]);
|
|
335
347
|
var handleChange = function handleChange(newValue, _data, extra) {
|
|
336
348
|
var next = cascaderChangeToPath(newValue, extra);
|
|
337
|
-
|
|
349
|
+
previewFlowCascader('onChange', {
|
|
338
350
|
fieldPath: fieldPath,
|
|
339
351
|
rawValue: newValue,
|
|
340
|
-
|
|
341
|
-
|
|
352
|
+
normalizedPath: next,
|
|
353
|
+
selectedPathLen: Array.isArray(extra === null || extra === void 0 ? void 0 : extra.selectedPath) ? extra.selectedPath.length : 0
|
|
342
354
|
});
|
|
343
355
|
commit(next);
|
|
344
356
|
schemaOnChange === null || schemaOnChange === void 0 ? void 0 : schemaOnChange(next, structureName, structureField);
|
|
@@ -390,30 +402,21 @@ var ProCascaderSelect = function ProCascaderSelect(props) {
|
|
|
390
402
|
useEffect(function () {
|
|
391
403
|
var leaf = displayValue.length > 0 ? displayValue[displayValue.length - 1] : '';
|
|
392
404
|
var resolvedPathFromLeaf = leaf ? findPathByNodeValue(cascaderOptions, toStr(leaf)) : [];
|
|
393
|
-
|
|
394
|
-
fieldPath: fieldPath,
|
|
395
|
-
incomingLeafId: incomingLeafId,
|
|
396
|
-
packedPathFromLeaf: packedPathFromLeaf
|
|
397
|
-
});
|
|
398
|
-
console.log('[ProCascaderSelect] render-debug', {
|
|
405
|
+
previewFlowCascader('echo', {
|
|
399
406
|
fieldPath: fieldPath,
|
|
400
407
|
structureName: structureName,
|
|
401
408
|
structureField: structureField,
|
|
402
|
-
|
|
409
|
+
rangeInnerTable: rangeInnerTable,
|
|
410
|
+
incomingLeafId: incomingLeafId,
|
|
411
|
+
packedPathFromLeafLen: packedPathFromLeaf.length,
|
|
412
|
+
rawBoundValuePreview: typeof value === 'object' ? JSON.stringify(value).slice(0, 120) : String(value).slice(0, 80),
|
|
403
413
|
normalizedDisplayPath: displayValue,
|
|
404
|
-
|
|
414
|
+
fusionValuePreview: typeof valueForFusion === 'object' ? JSON.stringify(valueForFusion).slice(0, 80) : String(valueForFusion).slice(0, 80),
|
|
405
415
|
isMultiple: isMultiple,
|
|
406
416
|
optionsCount: cascaderOptions.length,
|
|
407
|
-
|
|
408
|
-
optionsPreview: cascaderOptions.slice(0, 3).map(function (n) {
|
|
409
|
-
return {
|
|
410
|
-
value: getNodeValue(n),
|
|
411
|
-
label: getNodeLabel(n),
|
|
412
|
-
childrenCount: getNodeChildren(n).length
|
|
413
|
-
};
|
|
414
|
-
})
|
|
417
|
+
resolvedPathFromLeafLen: resolvedPathFromLeaf.length
|
|
415
418
|
});
|
|
416
|
-
}, [fieldPath, structureName, structureField, value, displayValue, valueForFusion, isMultiple, cascaderOptions]);
|
|
419
|
+
}, [fieldPath, structureName, structureField, rangeInnerTable, incomingLeafId, packedPathFromLeaf, value, displayValue, valueForFusion, isMultiple, cascaderOptions]);
|
|
417
420
|
|
|
418
421
|
/** dataSource 未就绪或异步时,仍用自定义文案兜底 */
|
|
419
422
|
var schemaDisplayRender = props.displayRender;
|
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.95';
|
|
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.95';
|
|
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.95",
|
|
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.95/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.95/build/index.html"
|
|
110
110
|
}
|