@tachybase/client 1.5.0 → 1.6.0

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.
@@ -1,2 +1,3 @@
1
1
  export * from './useAdminSchemaUid';
2
+ export * from './useOptimizedMemo';
2
3
  export * from './useViewport';
@@ -1,2 +1,3 @@
1
1
  export * from "./useAdminSchemaUid.mjs";
2
+ export * from "./useOptimizedMemo.mjs";
2
3
  export * from "./useViewport.mjs";
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 优化的 useMemo,先进行引用比较,仅在引用不同时才使用 lodash 的 isEqual 进行深度比较
3
+ * 这样可以在大多数情况下(引用相同时)避免深度比较的开销
4
+ *
5
+ * 性能分析:
6
+ * - 引用比较:O(1),几乎无开销
7
+ * - 深度比较:O(n),n 为数据大小,使用 lodash.isEqual(比 JSON.stringify 更可靠)
8
+ * - 计算成本:map、compile、字段查找等操作
9
+ *
10
+ * 权衡:对于表单摘要数据(通常 < 10KB),深度比较的开销(< 1ms)
11
+ * 远小于重新计算的成本(map + compile + 字段查找),所以值得缓存
12
+ *
13
+ * 优势:
14
+ * - 使用 lodash.isEqual 替代 JSON.stringify,更可靠(可处理循环引用、特殊类型等)
15
+ * - 代码更简洁,无需手动处理序列化错误
16
+ * - 依赖成熟的库,减少维护成本
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * const results = useOptimizedMemo(() => {
21
+ * return expensiveComputation(data);
22
+ * }, [data]);
23
+ * ```
24
+ */
25
+ export declare function useOptimizedMemo<T>(factory: () => T, deps: any[]): T;
@@ -0,0 +1,30 @@
1
+ import { useRef } from "react";
2
+ import lodash from "lodash";
3
+ function useOptimizedMemo(factory, deps) {
4
+ const ref = useRef();
5
+ if (ref.current && deps.length === ref.current.deps.length && deps.every((dep, i)=>dep === ref.current.deps[i])) return ref.current.value;
6
+ if (!ref.current || deps.length !== ref.current.deps.length) {
7
+ const value = factory();
8
+ ref.current = {
9
+ deps,
10
+ value
11
+ };
12
+ return value;
13
+ }
14
+ const depsChanged = deps.some((dep, i)=>{
15
+ const prevDep = ref.current.deps[i];
16
+ if (dep === prevDep) return false;
17
+ return !lodash.isEqual(dep, prevDep);
18
+ });
19
+ if (depsChanged) {
20
+ const value = factory();
21
+ ref.current = {
22
+ deps,
23
+ value
24
+ };
25
+ return value;
26
+ }
27
+ ref.current.deps = deps;
28
+ return ref.current.value;
29
+ }
30
+ export { useOptimizedMemo };
@@ -294,7 +294,7 @@ function WorkflowSelectComponent(param) {
294
294
  return /*#__PURE__*/ jsx(DataSourceProvider, {
295
295
  dataSource: "main",
296
296
  children: /*#__PURE__*/ jsx(RemoteSelect, {
297
- manual: false,
297
+ manual: true,
298
298
  placeholder: t('Select workflow', {
299
299
  ns: 'workflow'
300
300
  }),
@@ -314,7 +314,7 @@ function WorkflowSelectComponent(param) {
314
314
  key: void 0 === props.filterKey ? void 0 : props.filterKey
315
315
  },
316
316
  sort: [
317
- '-updatedAt'
317
+ '-initAt'
318
318
  ]
319
319
  }
320
320
  },
@@ -29,6 +29,7 @@ import { ActionPage } from "./Action.Page.mjs";
29
29
  import Action_style from "./Action.style.mjs";
30
30
  import { ActionContextProvider } from "./context.mjs";
31
31
  import { useA } from "./hooks.mjs";
32
+ import { useCompiledAction } from "./hooks/useCompiledAction.mjs";
32
33
  import { useGetAriaLabelOfAction } from "./hooks/useGetAriaLabelOfAction.mjs";
33
34
  import { linkageAction } from "./utils.mjs";
34
35
  const Action = withDynamicSchemaProps(observer((props)=>{
@@ -44,9 +45,8 @@ const Action = withDynamicSchemaProps(observer((props)=>{
44
45
  const field = useField();
45
46
  const app = useApp();
46
47
  const pageMode = app.usePageMode();
47
- const { run, element } = useAction(actionCallback);
48
48
  const fieldSchema = useFieldSchema();
49
- const compile = useCompile();
49
+ const { run, element } = useCompiledAction(useAction, actionCallback);
50
50
  const form = useForm();
51
51
  const record = useCollectionRecordData();
52
52
  const collection = useCollection();
@@ -65,6 +65,7 @@ const Action = withDynamicSchemaProps(observer((props)=>{
65
65
  }
66
66
  });
67
67
  const { getAriaLabel } = useGetAriaLabelOfAction(title);
68
+ const compile = useCompile();
68
69
  let actionTitle = title || compile(fieldSchema.title);
69
70
  actionTitle = lodash.isString(actionTitle) ? t(actionTitle) : actionTitle;
70
71
  useEffect(()=>{
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 编译 useAction,支持函数和字符串引用两种形式
3
+ * @param useAction - 可以是函数或字符串引用(如 '{{ useRevisionAction }}')
4
+ * @param actionCallback - 传递给 useAction 的回调函数
5
+ * @returns 编译后的 useAction hook 的返回值 { run, element }
6
+ */
7
+ export declare const useCompiledAction: (useAction: any, actionCallback?: any) => any;
@@ -0,0 +1,35 @@
1
+ import { useMemo } from "react";
2
+ import { useExpressionScope } from "@tachybase/schema";
3
+ import { useCompile } from "../../../hooks/index.mjs";
4
+ import { useA } from "../hooks.mjs";
5
+ const useCompiledAction = (useAction, actionCallback)=>{
6
+ const compile = useCompile();
7
+ const scope = useExpressionScope();
8
+ const compiledUseAction = useMemo(()=>{
9
+ if ('function' == typeof useAction) return useAction;
10
+ if ('string' == typeof useAction && useAction.startsWith('{{')) {
11
+ const match = useAction.match(/\{\{\s*([^}]+)\s*\}\}/);
12
+ if (match && match[1]) {
13
+ const expression = match[1].trim();
14
+ const func = scope[expression];
15
+ if ('function' == typeof func) return func;
16
+ const compiled = compile(useAction);
17
+ if ('function' == typeof compiled) return compiled;
18
+ console.warn("useAction not found in scope or compilation failed: ".concat(expression), scope);
19
+ return useA;
20
+ }
21
+ const compiled = compile(useAction);
22
+ if ('function' == typeof compiled) return compiled;
23
+ console.warn("useAction compilation failed: ".concat(useAction), compiled);
24
+ return useA;
25
+ }
26
+ console.warn("useAction is not a function or string reference:", useAction);
27
+ return useA;
28
+ }, [
29
+ useAction,
30
+ compile,
31
+ scope
32
+ ]);
33
+ return compiledUseAction(actionCallback);
34
+ };
35
+ export { useCompiledAction };
@@ -9,7 +9,11 @@ function usePropsCollection(param) {
9
9
  return collection;
10
10
  }
11
11
  function loadChildren(option) {
12
- const result = getCollectionFieldOptions.call(this, option.field.target, option);
12
+ var _this_needLeaf;
13
+ const needLeaf = null != (_this_needLeaf = this.needLeaf) ? _this_needLeaf : false;
14
+ const result = getCollectionFieldOptions.call(this, option.field.target, option, {
15
+ needLeaf
16
+ });
13
17
  if (result.length) {
14
18
  if (!result.some((item)=>isAssociation(item.field))) option.isLeaf = true;
15
19
  } else option.isLeaf = true;
@@ -29,13 +33,18 @@ function getCollectionFieldOptions(collection, parentNode) {
29
33
  const [dataSourceName, collectionName] = parseCollectionName(collection);
30
34
  const rawFields = this.getCollectionFields(collectionName, dataSourceName);
31
35
  const fields = needLeaf ? rawFields : rawFields.filter(isAssociation);
32
- const boundLoadChildren = loadChildren.bind(this);
36
+ const boundLoadChildren = loadChildren.bind({
37
+ ...this,
38
+ needLeaf
39
+ });
33
40
  return fields.filter(this.filter).map((field)=>{
34
41
  var _field_uiSchema;
35
42
  const key = parentNode ? "".concat(parentNode.value ? "".concat(parentNode.value, ".") : '').concat(field.name) : field.name;
36
43
  var _this_compile;
37
44
  const fieldTitle = null != (_this_compile = this.compile(null == (_field_uiSchema = field.uiSchema) ? void 0 : _field_uiSchema.title)) ? _this_compile : field.name;
38
- const isLeaf = !this.getCollectionFields(field.target).filter(isAssociation).filter(this.filter).length;
45
+ const targetFields = field.target ? this.getCollectionFields(field.target) : [];
46
+ const availableFields = needLeaf ? targetFields : targetFields.filter(isAssociation);
47
+ const isLeaf = !availableFields.filter(this.filter).length;
39
48
  var _parentNode_key;
40
49
  return {
41
50
  pId: null != (_parentNode_key = null == parentNode ? void 0 : parentNode.key) ? _parentNode_key : null,
@@ -99,7 +108,8 @@ const AppendsTreeSelectV2 = (props)=>{
99
108
  const tData = null === propsLoadData ? [] : getCollectionFieldOptions.call({
100
109
  compile,
101
110
  getCollectionFields,
102
- filter
111
+ filter,
112
+ needLeaf
103
113
  }, collectionString, parentNode, {
104
114
  needLeaf
105
115
  });
@@ -119,6 +119,7 @@ const useTableColumns = ()=>{
119
119
  }),
120
120
  dataIndex: s.name,
121
121
  key: s.name,
122
+ ...s['x-component-props'],
122
123
  render: (v, record)=>{
123
124
  var _field_value;
124
125
  const index = null == (_field_value = field.value) ? void 0 : _field_value.indexOf(record);
@@ -3,6 +3,9 @@ var __webpack_modules__ = {
3
3
  "./useAdminSchemaUid": function(module) {
4
4
  module.exports = require("./useAdminSchemaUid.js");
5
5
  },
6
+ "./useOptimizedMemo": function(module) {
7
+ module.exports = require("./useOptimizedMemo.js");
8
+ },
6
9
  "./useViewport": function(module) {
7
10
  module.exports = require("./useViewport.js");
8
11
  }
@@ -56,10 +59,16 @@ var __webpack_exports__ = {};
56
59
  return _useAdminSchemaUid__WEBPACK_IMPORTED_MODULE_0__[key];
57
60
  }).bind(0, __WEBPACK_IMPORT_KEY__);
58
61
  __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
59
- var _useViewport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./useViewport");
62
+ var _useOptimizedMemo__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./useOptimizedMemo");
63
+ var __WEBPACK_REEXPORT_OBJECT__ = {};
64
+ for(var __WEBPACK_IMPORT_KEY__ in _useOptimizedMemo__WEBPACK_IMPORTED_MODULE_1__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
65
+ return _useOptimizedMemo__WEBPACK_IMPORTED_MODULE_1__[key];
66
+ }).bind(0, __WEBPACK_IMPORT_KEY__);
67
+ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
68
+ var _useViewport__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./useViewport");
60
69
  var __WEBPACK_REEXPORT_OBJECT__ = {};
61
- for(var __WEBPACK_IMPORT_KEY__ in _useViewport__WEBPACK_IMPORTED_MODULE_1__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
62
- return _useViewport__WEBPACK_IMPORTED_MODULE_1__[key];
70
+ for(var __WEBPACK_IMPORT_KEY__ in _useViewport__WEBPACK_IMPORTED_MODULE_2__)if ("default" !== __WEBPACK_IMPORT_KEY__) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = (function(key) {
71
+ return _useViewport__WEBPACK_IMPORTED_MODULE_2__[key];
63
72
  }).bind(0, __WEBPACK_IMPORT_KEY__);
64
73
  __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
65
74
  })();
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = (module)=>{
5
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
+ __webpack_require__.d(getter, {
7
+ a: getter
8
+ });
9
+ return getter;
10
+ };
11
+ })();
12
+ (()=>{
13
+ __webpack_require__.d = (exports1, definition)=>{
14
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ };
19
+ })();
20
+ (()=>{
21
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
22
+ })();
23
+ (()=>{
24
+ __webpack_require__.r = (exports1)=>{
25
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
26
+ value: 'Module'
27
+ });
28
+ Object.defineProperty(exports1, '__esModule', {
29
+ value: true
30
+ });
31
+ };
32
+ })();
33
+ var __webpack_exports__ = {};
34
+ __webpack_require__.r(__webpack_exports__);
35
+ __webpack_require__.d(__webpack_exports__, {
36
+ useOptimizedMemo: ()=>useOptimizedMemo
37
+ });
38
+ const external_react_namespaceObject = require("react");
39
+ const external_lodash_namespaceObject = require("lodash");
40
+ var external_lodash_default = /*#__PURE__*/ __webpack_require__.n(external_lodash_namespaceObject);
41
+ function useOptimizedMemo(factory, deps) {
42
+ const ref = (0, external_react_namespaceObject.useRef)();
43
+ if (ref.current && deps.length === ref.current.deps.length && deps.every((dep, i)=>dep === ref.current.deps[i])) return ref.current.value;
44
+ if (!ref.current || deps.length !== ref.current.deps.length) {
45
+ const value = factory();
46
+ ref.current = {
47
+ deps,
48
+ value
49
+ };
50
+ return value;
51
+ }
52
+ const depsChanged = deps.some((dep, i)=>{
53
+ const prevDep = ref.current.deps[i];
54
+ if (dep === prevDep) return false;
55
+ return !external_lodash_default().isEqual(dep, prevDep);
56
+ });
57
+ if (depsChanged) {
58
+ const value = factory();
59
+ ref.current = {
60
+ deps,
61
+ value
62
+ };
63
+ return value;
64
+ }
65
+ ref.current.deps = deps;
66
+ return ref.current.value;
67
+ }
68
+ exports.useOptimizedMemo = __webpack_exports__.useOptimizedMemo;
69
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
70
+ "useOptimizedMemo"
71
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
72
+ Object.defineProperty(exports, '__esModule', {
73
+ value: true
74
+ });
@@ -339,7 +339,7 @@ function WorkflowSelectComponent(param) {
339
339
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_data_source_index_js_namespaceObject.DataSourceProvider, {
340
340
  dataSource: "main",
341
341
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_index_js_namespaceObject.RemoteSelect, {
342
- manual: false,
342
+ manual: true,
343
343
  placeholder: t('Select workflow', {
344
344
  ns: 'workflow'
345
345
  }),
@@ -359,7 +359,7 @@ function WorkflowSelectComponent(param) {
359
359
  key: void 0 === props.filterKey ? void 0 : props.filterKey
360
360
  },
361
361
  sort: [
362
- '-updatedAt'
362
+ '-initAt'
363
363
  ]
364
364
  }
365
365
  },
@@ -71,6 +71,7 @@ const external_Action_style_js_namespaceObject = require("./Action.style.js");
71
71
  var external_Action_style_js_default = /*#__PURE__*/ __webpack_require__.n(external_Action_style_js_namespaceObject);
72
72
  const external_context_js_namespaceObject = require("./context.js");
73
73
  const external_hooks_js_namespaceObject = require("./hooks.js");
74
+ const useCompiledAction_js_namespaceObject = require("./hooks/useCompiledAction.js");
74
75
  const useGetAriaLabelOfAction_js_namespaceObject = require("./hooks/useGetAriaLabelOfAction.js");
75
76
  const external_utils_js_namespaceObject = require("./utils.js");
76
77
  const Action = (0, withDynamicSchemaProps_js_namespaceObject.withDynamicSchemaProps)((0, schema_namespaceObject.observer)((props)=>{
@@ -86,9 +87,8 @@ const Action = (0, withDynamicSchemaProps_js_namespaceObject.withDynamicSchemaPr
86
87
  const field = (0, schema_namespaceObject.useField)();
87
88
  const app = (0, index_js_namespaceObject.useApp)();
88
89
  const pageMode = app.usePageMode();
89
- const { run, element } = useAction(actionCallback);
90
90
  const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
91
- const compile = (0, external_hooks_index_js_namespaceObject.useCompile)();
91
+ const { run, element } = (0, useCompiledAction_js_namespaceObject.useCompiledAction)(useAction, actionCallback);
92
92
  const form = (0, schema_namespaceObject.useForm)();
93
93
  const record = (0, external_data_source_index_js_namespaceObject.useCollectionRecordData)();
94
94
  const collection = (0, external_data_source_index_js_namespaceObject.useCollection)();
@@ -107,6 +107,7 @@ const Action = (0, withDynamicSchemaProps_js_namespaceObject.withDynamicSchemaPr
107
107
  }
108
108
  });
109
109
  const { getAriaLabel } = (0, useGetAriaLabelOfAction_js_namespaceObject.useGetAriaLabelOfAction)(title);
110
+ const compile = (0, external_hooks_index_js_namespaceObject.useCompile)();
110
111
  let actionTitle = title || compile(fieldSchema.title);
111
112
  actionTitle = external_lodash_default().isString(actionTitle) ? t(actionTitle) : actionTitle;
112
113
  (0, external_react_namespaceObject.useEffect)(()=>{
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ useCompiledAction: ()=>useCompiledAction
28
+ });
29
+ const external_react_namespaceObject = require("react");
30
+ const schema_namespaceObject = require("@tachybase/schema");
31
+ const index_js_namespaceObject = require("../../../hooks/index.js");
32
+ const external_hooks_js_namespaceObject = require("../hooks.js");
33
+ const useCompiledAction = (useAction, actionCallback)=>{
34
+ const compile = (0, index_js_namespaceObject.useCompile)();
35
+ const scope = (0, schema_namespaceObject.useExpressionScope)();
36
+ const compiledUseAction = (0, external_react_namespaceObject.useMemo)(()=>{
37
+ if ('function' == typeof useAction) return useAction;
38
+ if ('string' == typeof useAction && useAction.startsWith('{{')) {
39
+ const match = useAction.match(/\{\{\s*([^}]+)\s*\}\}/);
40
+ if (match && match[1]) {
41
+ const expression = match[1].trim();
42
+ const func = scope[expression];
43
+ if ('function' == typeof func) return func;
44
+ const compiled = compile(useAction);
45
+ if ('function' == typeof compiled) return compiled;
46
+ console.warn("useAction not found in scope or compilation failed: ".concat(expression), scope);
47
+ return external_hooks_js_namespaceObject.useA;
48
+ }
49
+ const compiled = compile(useAction);
50
+ if ('function' == typeof compiled) return compiled;
51
+ console.warn("useAction compilation failed: ".concat(useAction), compiled);
52
+ return external_hooks_js_namespaceObject.useA;
53
+ }
54
+ console.warn("useAction is not a function or string reference:", useAction);
55
+ return external_hooks_js_namespaceObject.useA;
56
+ }, [
57
+ useAction,
58
+ compile,
59
+ scope
60
+ ]);
61
+ return compiledUseAction(actionCallback);
62
+ };
63
+ exports.useCompiledAction = __webpack_exports__.useCompiledAction;
64
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
65
+ "useCompiledAction"
66
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
67
+ Object.defineProperty(exports, '__esModule', {
68
+ value: true
69
+ });
@@ -37,7 +37,11 @@ function usePropsCollection(param) {
37
37
  return collection;
38
38
  }
39
39
  function loadChildren(option) {
40
- const result = getCollectionFieldOptions.call(this, option.field.target, option);
40
+ var _this_needLeaf;
41
+ const needLeaf = null != (_this_needLeaf = this.needLeaf) ? _this_needLeaf : false;
42
+ const result = getCollectionFieldOptions.call(this, option.field.target, option, {
43
+ needLeaf
44
+ });
41
45
  if (result.length) {
42
46
  if (!result.some((item)=>isAssociation(item.field))) option.isLeaf = true;
43
47
  } else option.isLeaf = true;
@@ -57,13 +61,18 @@ function getCollectionFieldOptions(collection, parentNode) {
57
61
  const [dataSourceName, collectionName] = (0, external_index_js_namespaceObject.parseCollectionName)(collection);
58
62
  const rawFields = this.getCollectionFields(collectionName, dataSourceName);
59
63
  const fields = needLeaf ? rawFields : rawFields.filter(isAssociation);
60
- const boundLoadChildren = loadChildren.bind(this);
64
+ const boundLoadChildren = loadChildren.bind({
65
+ ...this,
66
+ needLeaf
67
+ });
61
68
  return fields.filter(this.filter).map((field)=>{
62
69
  var _field_uiSchema;
63
70
  const key = parentNode ? "".concat(parentNode.value ? "".concat(parentNode.value, ".") : '').concat(field.name) : field.name;
64
71
  var _this_compile;
65
72
  const fieldTitle = null != (_this_compile = this.compile(null == (_field_uiSchema = field.uiSchema) ? void 0 : _field_uiSchema.title)) ? _this_compile : field.name;
66
- const isLeaf = !this.getCollectionFields(field.target).filter(isAssociation).filter(this.filter).length;
73
+ const targetFields = field.target ? this.getCollectionFields(field.target) : [];
74
+ const availableFields = needLeaf ? targetFields : targetFields.filter(isAssociation);
75
+ const isLeaf = !availableFields.filter(this.filter).length;
67
76
  var _parentNode_key;
68
77
  return {
69
78
  pId: null != (_parentNode_key = null == parentNode ? void 0 : parentNode.key) ? _parentNode_key : null,
@@ -127,7 +136,8 @@ const AppendsTreeSelectV2 = (props)=>{
127
136
  const tData = null === propsLoadData ? [] : getCollectionFieldOptions.call({
128
137
  compile,
129
138
  getCollectionFields,
130
- filter
139
+ filter,
140
+ needLeaf
131
141
  }, collectionString, parentNode, {
132
142
  needLeaf
133
143
  });
@@ -158,6 +158,7 @@ const useTableColumns = ()=>{
158
158
  }),
159
159
  dataIndex: s.name,
160
160
  key: s.name,
161
+ ...s['x-component-props'],
161
162
  render: (v, record)=>{
162
163
  var _field_value;
163
164
  const index = null == (_field_value = field.value) ? void 0 : _field_value.indexOf(record);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/client",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.mjs",
@@ -21,8 +21,8 @@
21
21
  "@floating-ui/react": "0.26.28",
22
22
  "@js-preview/excel": "^1.7.14",
23
23
  "@lottiefiles/dotlottie-react": "^0.9.3",
24
- "@tachybase/schema": "*",
25
- "@tego/client": "*",
24
+ "@tachybase/schema": "1.3.52",
25
+ "@tego/client": "1.3.52",
26
26
  "ahooks": "^3.9.0",
27
27
  "antd": "5.22.5",
28
28
  "antd-style": "3.7.1",