@openli1115/lowcode-edit-pro-table 1.0.76 → 1.0.78

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.
@@ -9,6 +9,7 @@ import { FORM_EMPTY_ARRAY } from "../../context/useComponentContext";
9
9
  var _window$React = window.React,
10
10
  createElement = _window$React.createElement,
11
11
  useCallback = _window$React.useCallback,
12
+ useEffect = _window$React.useEffect,
12
13
  useMemo = _window$React.useMemo;
13
14
  function toStr(v) {
14
15
  if (v == null) return '';
@@ -204,6 +205,12 @@ var ProCascaderSelect = function ProCascaderSelect(props) {
204
205
  }, [dataSource, options]);
205
206
  var handleChange = function handleChange(newValue, _data, extra) {
206
207
  var next = cascaderChangeToPath(newValue, extra);
208
+ console.log('[ProCascaderSelect] onChange', {
209
+ fieldPath: fieldPath,
210
+ rawValue: newValue,
211
+ selectedPath: extra === null || extra === void 0 ? void 0 : extra.selectedPath,
212
+ normalizedPath: next
213
+ });
207
214
  commit(next);
208
215
  schemaOnChange === null || schemaOnChange === void 0 ? void 0 : schemaOnChange(next, structureName, structureField);
209
216
  };
@@ -212,6 +219,31 @@ var ProCascaderSelect = function ProCascaderSelect(props) {
212
219
  var displayValue = useMemo(function () {
213
220
  return normalizeCascaderPath(value, cascaderOptions);
214
221
  }, [value, cascaderOptions]);
222
+ var incomingLeafId = useMemo(function () {
223
+ if (Array.isArray(value)) {
224
+ var cleaned = value.filter(function (x) {
225
+ return x != null && x !== '';
226
+ });
227
+ return cleaned.length > 0 ? toStr(cleaned[cleaned.length - 1]) : '';
228
+ }
229
+ if (typeof value === 'number' && !Number.isNaN(value)) return toStr(value);
230
+ if (typeof value === 'string' && value.trim()) {
231
+ try {
232
+ var parsed = JSON.parse(value);
233
+ if (Array.isArray(parsed) && parsed.length > 0) {
234
+ return toStr(parsed[parsed.length - 1]);
235
+ }
236
+ } catch (_unused2) {
237
+ return value;
238
+ }
239
+ return value;
240
+ }
241
+ return '';
242
+ }, [value]);
243
+ var packedPathFromLeaf = useMemo(function () {
244
+ if (!incomingLeafId) return [];
245
+ return findPathByNodeValue(cascaderOptions, incomingLeafId);
246
+ }, [cascaderOptions, incomingLeafId]);
215
247
 
216
248
  /**
217
249
  * 回显兼容:
@@ -226,6 +258,33 @@ var ProCascaderSelect = function ProCascaderSelect(props) {
226
258
  if (path.length === 0) return '';
227
259
  return path[path.length - 1];
228
260
  }, [displayValue, isMultiple]);
261
+ useEffect(function () {
262
+ var leaf = displayValue.length > 0 ? displayValue[displayValue.length - 1] : '';
263
+ var resolvedPathFromLeaf = leaf ? findPathByNodeValue(cascaderOptions, toStr(leaf)) : [];
264
+ console.log('[ProCascaderSelect] echo-id-and-path', {
265
+ fieldPath: fieldPath,
266
+ incomingLeafId: incomingLeafId,
267
+ packedPathFromLeaf: packedPathFromLeaf
268
+ });
269
+ console.log('[ProCascaderSelect] render-debug', {
270
+ fieldPath: fieldPath,
271
+ structureName: structureName,
272
+ structureField: structureField,
273
+ rawBoundValue: value,
274
+ normalizedDisplayPath: displayValue,
275
+ fusionValue: valueForFusion,
276
+ isMultiple: isMultiple,
277
+ optionsCount: cascaderOptions.length,
278
+ resolvedPathFromLeaf: resolvedPathFromLeaf,
279
+ optionsPreview: cascaderOptions.slice(0, 3).map(function (n) {
280
+ return {
281
+ value: getNodeValue(n),
282
+ label: getNodeLabel(n),
283
+ childrenCount: getNodeChildren(n).length
284
+ };
285
+ })
286
+ });
287
+ }, [fieldPath, structureName, structureField, value, displayValue, valueForFusion, isMultiple, cascaderOptions]);
229
288
 
230
289
  /** dataSource 未就绪或异步时,仍用自定义文案兜底 */
231
290
  var schemaDisplayRender = props.displayRender;
@@ -14,6 +14,7 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
14
14
  var _window$React = window.React,
15
15
  createElement = _window$React.createElement,
16
16
  useCallback = _window$React.useCallback,
17
+ useEffect = _window$React.useEffect,
17
18
  useMemo = _window$React.useMemo;
18
19
  function toStr(v) {
19
20
  if (v == null) return '';
@@ -209,6 +210,12 @@ var ProCascaderSelect = function ProCascaderSelect(props) {
209
210
  }, [dataSource, options]);
210
211
  var handleChange = function handleChange(newValue, _data, extra) {
211
212
  var next = cascaderChangeToPath(newValue, extra);
213
+ console.log('[ProCascaderSelect] onChange', {
214
+ fieldPath: fieldPath,
215
+ rawValue: newValue,
216
+ selectedPath: extra === null || extra === void 0 ? void 0 : extra.selectedPath,
217
+ normalizedPath: next
218
+ });
212
219
  commit(next);
213
220
  schemaOnChange === null || schemaOnChange === void 0 ? void 0 : schemaOnChange(next, structureName, structureField);
214
221
  };
@@ -217,6 +224,31 @@ var ProCascaderSelect = function ProCascaderSelect(props) {
217
224
  var displayValue = useMemo(function () {
218
225
  return normalizeCascaderPath(value, cascaderOptions);
219
226
  }, [value, cascaderOptions]);
227
+ var incomingLeafId = useMemo(function () {
228
+ if (Array.isArray(value)) {
229
+ var cleaned = value.filter(function (x) {
230
+ return x != null && x !== '';
231
+ });
232
+ return cleaned.length > 0 ? toStr(cleaned[cleaned.length - 1]) : '';
233
+ }
234
+ if (typeof value === 'number' && !Number.isNaN(value)) return toStr(value);
235
+ if (typeof value === 'string' && value.trim()) {
236
+ try {
237
+ var parsed = JSON.parse(value);
238
+ if (Array.isArray(parsed) && parsed.length > 0) {
239
+ return toStr(parsed[parsed.length - 1]);
240
+ }
241
+ } catch (_unused2) {
242
+ return value;
243
+ }
244
+ return value;
245
+ }
246
+ return '';
247
+ }, [value]);
248
+ var packedPathFromLeaf = useMemo(function () {
249
+ if (!incomingLeafId) return [];
250
+ return findPathByNodeValue(cascaderOptions, incomingLeafId);
251
+ }, [cascaderOptions, incomingLeafId]);
220
252
 
221
253
  /**
222
254
  * 回显兼容:
@@ -231,6 +263,33 @@ var ProCascaderSelect = function ProCascaderSelect(props) {
231
263
  if (path.length === 0) return '';
232
264
  return path[path.length - 1];
233
265
  }, [displayValue, isMultiple]);
266
+ useEffect(function () {
267
+ var leaf = displayValue.length > 0 ? displayValue[displayValue.length - 1] : '';
268
+ var resolvedPathFromLeaf = leaf ? findPathByNodeValue(cascaderOptions, toStr(leaf)) : [];
269
+ console.log('[ProCascaderSelect] echo-id-and-path', {
270
+ fieldPath: fieldPath,
271
+ incomingLeafId: incomingLeafId,
272
+ packedPathFromLeaf: packedPathFromLeaf
273
+ });
274
+ console.log('[ProCascaderSelect] render-debug', {
275
+ fieldPath: fieldPath,
276
+ structureName: structureName,
277
+ structureField: structureField,
278
+ rawBoundValue: value,
279
+ normalizedDisplayPath: displayValue,
280
+ fusionValue: valueForFusion,
281
+ isMultiple: isMultiple,
282
+ optionsCount: cascaderOptions.length,
283
+ resolvedPathFromLeaf: resolvedPathFromLeaf,
284
+ optionsPreview: cascaderOptions.slice(0, 3).map(function (n) {
285
+ return {
286
+ value: getNodeValue(n),
287
+ label: getNodeLabel(n),
288
+ childrenCount: getNodeChildren(n).length
289
+ };
290
+ })
291
+ });
292
+ }, [fieldPath, structureName, structureField, value, displayValue, valueForFusion, isMultiple, cascaderOptions]);
234
293
 
235
294
  /** dataSource 未就绪或异步时,仍用自定义文案兜底 */
236
295
  var schemaDisplayRender = props.displayRender;
@@ -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.76';
104
+ version = '1.0.78';
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.76';
109
+ version = '1.0.78';
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.76",
3
+ "version": "1.0.78",
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.76/build/lowcode/assets-prod.json"
104
+ "materialSchema": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.78/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.76/build/index.html"
109
+ "homepage": "https://unpkg.com/@openli1115/lowcode-edit-pro-table@1.0.78/build/index.html"
110
110
  }