@tachybase/client 1.5.1 → 1.6.1

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.
Files changed (94) hide show
  1. package/es/application/PluginManager.mjs +9 -1
  2. package/es/application/WebSocketClient.d.ts +19 -0
  3. package/es/application/WebSocketClient.mjs +26 -6
  4. package/es/application/utils/remotePlugins.mjs +8 -2
  5. package/es/built-in/attachment-preview/previewers/file-sheet.mjs +1 -1
  6. package/es/built-in/pm/PluginDetail.mjs +1 -1
  7. package/es/collection-manager/Configuration/components/index.mjs +3 -3
  8. package/es/collection-manager/interfaces/components/index.mjs +2 -2
  9. package/es/collection-manager/interfaces/properties/operators.mjs +3 -3
  10. package/es/hooks/index.d.ts +1 -0
  11. package/es/hooks/index.mjs +1 -0
  12. package/es/hooks/useOptimizedMemo.d.ts +25 -0
  13. package/es/hooks/useOptimizedMemo.mjs +30 -0
  14. package/es/locale/index.mjs +47 -47
  15. package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.mjs +4 -1
  16. package/es/schema-component/antd/AntdSchemaComponentProvider.mjs +3 -1
  17. package/es/schema-component/antd/__builtins__/hooks/usePrefixCls.mjs +1 -1
  18. package/es/schema-component/antd/action/Action.Area.style.mjs +1 -1
  19. package/es/schema-component/antd/action/Action.Designer.mjs +1 -1
  20. package/es/schema-component/antd/action/Action.mjs +3 -2
  21. package/es/schema-component/antd/action/hooks/useCompiledAction.d.ts +7 -0
  22. package/es/schema-component/antd/action/hooks/useCompiledAction.mjs +35 -0
  23. package/es/schema-component/antd/appends-tree-select/AppendsTreeSelectV2.mjs +14 -4
  24. package/es/schema-component/antd/association-field/AssociationSelect.mjs +1 -1
  25. package/es/schema-component/antd/association-field/InternalDrawerSubTable.mjs +1 -1
  26. package/es/schema-component/antd/association-field/SubTabs/styles.mjs +1 -1
  27. package/es/schema-component/antd/block-item/BlockToolbar.mjs +16 -16
  28. package/es/schema-component/antd/grid-card/options.mjs +3 -3
  29. package/es/schema-component/antd/input/ReadPretty.mjs +1 -3
  30. package/es/schema-component/antd/menu/Menu.styles.mjs +1 -1
  31. package/es/schema-component/antd/menu/MenuSearchAdd.style.mjs +1 -1
  32. package/es/schema-component/antd/page/Page.mjs +3 -0
  33. package/es/schema-component/antd/page/Page.style.mjs +1 -1
  34. package/es/schema-component/antd/table/Table.Array.mjs +1 -0
  35. package/es/schema-component/antd/table/Table.Column.Designer.mjs +5 -5
  36. package/es/schema-component/antd/table/Table.Void.Designer.mjs +4 -4
  37. package/es/schema-component/antd/table-v2/EnabledToggle.d.ts +9 -0
  38. package/es/schema-component/antd/table-v2/EnabledToggle.mjs +72 -0
  39. package/es/schema-component/antd/table-v2/Table.styles.mjs +1 -1
  40. package/es/schema-component/antd/table-v2/index.d.ts +1 -0
  41. package/es/schema-component/antd/table-v2/index.mjs +1 -0
  42. package/es/schema-component/antd/variable/CodeMirror.mjs +1 -1
  43. package/es/schema-component/common/sortable-item/DragHandleMenu.style.mjs +1 -1
  44. package/es/schema-component/common/sortable-item/DragHandlePageTab.style.mjs +1 -1
  45. package/es/schema-templates/BlockTemplateDetails.mjs +1 -1
  46. package/es/user/ChangePassword.mjs +1 -1
  47. package/lib/application/PluginManager.js +9 -1
  48. package/lib/application/WebSocketClient.js +26 -6
  49. package/lib/application/utils/remotePlugins.js +8 -2
  50. package/lib/built-in/attachment-preview/previewers/file-sheet.js +1 -1
  51. package/lib/built-in/pm/PluginDetail.js +1 -1
  52. package/lib/collection-manager/Configuration/components/index.js +3 -3
  53. package/lib/collection-manager/interfaces/components/index.js +2 -2
  54. package/lib/collection-manager/interfaces/properties/operators.js +3 -3
  55. package/lib/hooks/index.js +12 -3
  56. package/lib/hooks/useOptimizedMemo.js +74 -0
  57. package/lib/locale/en_US.js +1 -0
  58. package/lib/locale/es_ES.js +1 -0
  59. package/lib/locale/fr_FR.js +1 -0
  60. package/lib/locale/ko_KR.js +1 -0
  61. package/lib/locale/pt_BR.js +1 -0
  62. package/lib/locale/uk_UA.js +1 -0
  63. package/lib/locale/zh-CN.js +1 -0
  64. package/lib/locale/zh-TW.js +1 -0
  65. package/lib/modules/blocks/data-blocks/table/hooks/useTableBlockProps.js +4 -1
  66. package/lib/schema-component/antd/AntdSchemaComponentProvider.js +3 -1
  67. package/lib/schema-component/antd/__builtins__/hooks/usePrefixCls.js +1 -1
  68. package/lib/schema-component/antd/action/Action.Area.style.js +1 -1
  69. package/lib/schema-component/antd/action/Action.Designer.js +1 -1
  70. package/lib/schema-component/antd/action/Action.js +3 -2
  71. package/lib/schema-component/antd/action/hooks/useCompiledAction.js +69 -0
  72. package/lib/schema-component/antd/appends-tree-select/AppendsTreeSelectV2.js +14 -4
  73. package/lib/schema-component/antd/association-field/AssociationSelect.js +1 -1
  74. package/lib/schema-component/antd/association-field/InternalDrawerSubTable.js +1 -1
  75. package/lib/schema-component/antd/association-field/SubTabs/styles.js +1 -1
  76. package/lib/schema-component/antd/block-item/BlockToolbar.js +16 -16
  77. package/lib/schema-component/antd/grid-card/options.js +3 -3
  78. package/lib/schema-component/antd/input/ReadPretty.js +1 -3
  79. package/lib/schema-component/antd/menu/Menu.styles.js +1 -1
  80. package/lib/schema-component/antd/menu/MenuSearchAdd.style.js +1 -1
  81. package/lib/schema-component/antd/page/Page.js +3 -0
  82. package/lib/schema-component/antd/page/Page.style.js +1 -1
  83. package/lib/schema-component/antd/table/Table.Array.js +1 -0
  84. package/lib/schema-component/antd/table/Table.Column.Designer.js +5 -5
  85. package/lib/schema-component/antd/table/Table.Void.Designer.js +4 -4
  86. package/lib/schema-component/antd/table-v2/EnabledToggle.js +106 -0
  87. package/lib/schema-component/antd/table-v2/Table.styles.js +1 -1
  88. package/lib/schema-component/antd/table-v2/index.js +13 -0
  89. package/lib/schema-component/antd/variable/CodeMirror.js +1 -1
  90. package/lib/schema-component/common/sortable-item/DragHandleMenu.style.js +1 -1
  91. package/lib/schema-component/common/sortable-item/DragHandlePageTab.style.js +1 -1
  92. package/lib/schema-templates/BlockTemplateDetails.js +1 -1
  93. package/lib/user/ChangePassword.js +1 -1
  94. package/package.json +4 -4
@@ -67,7 +67,7 @@ const ForeignKey1 = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div
67
67
  children: [
68
68
  "Foreign key 1 ",
69
69
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("a", {
70
- children: "\u65B0\u5EFA"
70
+ children: "新建"
71
71
  })
72
72
  ]
73
73
  });
@@ -75,7 +75,7 @@ const ForeignKey2 = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div
75
75
  children: [
76
76
  "Foreign key 2 ",
77
77
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("a", {
78
- children: "\u65B0\u5EFA"
78
+ children: "新建"
79
79
  })
80
80
  ]
81
81
  });
@@ -181,7 +181,7 @@ const number = [
181
181
  selected: true
182
182
  },
183
183
  {
184
- label: '{{t("\u2260")}}',
184
+ label: '{{t("")}}',
185
185
  value: '$ne'
186
186
  },
187
187
  {
@@ -189,7 +189,7 @@ const number = [
189
189
  value: '$gt'
190
190
  },
191
191
  {
192
- label: '{{t("\u2265")}}',
192
+ label: '{{t("")}}',
193
193
  value: '$gte'
194
194
  },
195
195
  {
@@ -197,7 +197,7 @@ const number = [
197
197
  value: '$lt'
198
198
  },
199
199
  {
200
- label: '{{t("\u2264")}}',
200
+ label: '{{t("")}}',
201
201
  value: '$lte'
202
202
  },
203
203
  {
@@ -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
+ });
@@ -69,6 +69,7 @@ module.exports = {
69
69
  "All events": "All events",
70
70
  "All plugin settings": "All plugin settings",
71
71
  "All records": "All records",
72
+ "All statuses": "All",
72
73
  AllProducts: "AllProducts",
73
74
  Allow: "Allow",
74
75
  "Allow access": "Allow access",
@@ -67,6 +67,7 @@ module.exports = {
67
67
  "All events": "Todos los eventos",
68
68
  "All plugin settings": "Configuraci\xF3n de todos los plugins",
69
69
  "All records": "Todos los registros",
70
+ "All statuses": "Todos",
70
71
  Allow: "Permitir",
71
72
  "Allow access": "Permitir acceso",
72
73
  "Allow action": "Permitir acci\xF3n",
@@ -65,6 +65,7 @@ module.exports = {
65
65
  "All events": "Tous les \xE9v\xE9nements",
66
66
  "All plugin settings": "Tous les param\xE8tres de plugin",
67
67
  "All records": "Tous les enregistrements",
68
+ "All statuses": "Tous",
68
69
  Allow: "Autoriser",
69
70
  "Allow access": "Autoriser l'acc\xE8s",
70
71
  "Allow action": "Autoriser l'action",
@@ -67,6 +67,7 @@ module.exports = {
67
67
  "All events": "\uBAA8\uB4E0 \uC774\uBCA4\uD2B8",
68
68
  "All plugin settings": "\uBAA8\uB4E0 \uD50C\uB7EC\uADF8\uC778 \uC124\uC815",
69
69
  "All records": "\uBAA8\uB4E0 \uB370\uC774\uD130",
70
+ "All statuses": "\uC804\uCCB4",
70
71
  Allow: "\uD5C8\uC6A9",
71
72
  "Allow access": "\uC811\uADFC \uD5C8\uC6A9",
72
73
  "Allow action": "\uC870\uC791 \uD5C8\uC6A9",
@@ -63,6 +63,7 @@ module.exports = {
63
63
  "All events": "Todos os eventos",
64
64
  "All plugin settings": "Configura\xE7\xF5es de todos os plugins",
65
65
  "All records": "Todos os registros",
66
+ "All statuses": "Todos",
66
67
  Allow: "Permitir",
67
68
  "Allow access": "Permitir acesso",
68
69
  "Allow action": "Permitir a\xE7\xE3o",
@@ -66,6 +66,7 @@ module.exports = {
66
66
  "All events": "\u0423\u0441\u0456 \u043F\u043E\u0434\u0456\u0457",
67
67
  "All plugin settings": "\u0412\u0441\u0456 \u043D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F \u043F\u043B\u0430\u0433\u0456\u043D\u0456\u0432",
68
68
  "All records": "\u0412\u0441\u0456 \u0437\u0430\u043F\u0438\u0441\u0438",
69
+ "All statuses": "\u0412\u0441\u0456",
69
70
  Allow: "\u0414\u043E\u0437\u0432\u043E\u043B\u0438\u0442\u0438",
70
71
  "Allow access": "\u0414\u043E\u0437\u0432\u043E\u043B\u0438\u0442\u0438 \u0434\u043E\u0441\u0442\u0443\u043F",
71
72
  "Allow action": "\u0414\u043E\u0437\u0432\u043E\u043B\u0438\u0442\u0438 \u0434\u0456\u044E",
@@ -76,6 +76,7 @@ module.exports = {
76
76
  "All events": "\u6240\u6709\u65E5\u7A0B",
77
77
  "All plugin settings": "\u6240\u6709\u63D2\u4EF6\u914D\u7F6E",
78
78
  "All records": "\u6240\u6709\u6570\u636E",
79
+ "All statuses": "\u5168\u90E8",
79
80
  AllProducts: "\u5168\u90E8\u5546\u54C1",
80
81
  Allow: "\u5141\u8BB8",
81
82
  "Allow access": "\u5141\u8BB8\u8BBF\u95EE",
@@ -67,6 +67,7 @@ module.exports = {
67
67
  "All events": "\u6240\u6709\u4E8B\u4EF6",
68
68
  "All plugin settings": "\u6240\u6709\u63D2\u4EF6\u8A2D\u5B9A",
69
69
  "All records": "\u6240\u6709\u8CC7\u6599",
70
+ "All statuses": "\u5168\u90E8",
70
71
  Allow: "\u5141\u8A31",
71
72
  "Allow access": "\u5141\u8A31\u8A2A\u554F",
72
73
  "Allow action": "\u5141\u8A31\u52D5\u4F5C",
@@ -168,7 +168,10 @@ const useTableBlockProps = ()=>{
168
168
  prevMergedFilter = currFilter;
169
169
  dataBlocks.forEach((item)=>{
170
170
  const targetsUidList = targets.map((targetItem)=>targetItem.uid);
171
- if (targetsUidList.includes(item.uid) && !item.associatedFields.find((assItem)=>assItem.name === target.field || target.field.includes(assItem.name))) {
171
+ if (targetsUidList.includes(item.uid) && !item.associatedFields.find((assItem)=>{
172
+ var _target_field;
173
+ return assItem.name === target.field || (null == (_target_field = target.field) ? void 0 : _target_field.includes(assItem.name));
174
+ })) {
172
175
  const prevFlatItems = external_flat_default()(prevMergedFilter);
173
176
  Object.entries(prevFlatItems).forEach((param)=>{
174
177
  let [key, prevItem] = param;
@@ -26,6 +26,7 @@ __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
27
  AntdSchemaComponentPlugin: ()=>AntdSchemaComponentPlugin
28
28
  });
29
+ const client_namespaceObject = require("@tego/client");
29
30
  const external_index_js_namespaceObject = require("./index.js");
30
31
  const Plugin_js_namespaceObject = require("../../application/Plugin.js");
31
32
  const index_js_namespaceObject = require("../common/index.js");
@@ -44,7 +45,8 @@ class AntdSchemaComponentPlugin extends Plugin_js_namespaceObject.Plugin {
44
45
  addComponents() {
45
46
  this.app.addComponents({
46
47
  ...external_index_js_namespaceObject,
47
- ...index_js_namespaceObject
48
+ ...index_js_namespaceObject,
49
+ CodeMirror: client_namespaceObject.CodeMirror
48
50
  });
49
51
  }
50
52
  addScopes() {
@@ -30,7 +30,7 @@ const external_react_namespaceObject = require("react");
30
30
  const external_antd_namespaceObject = require("antd");
31
31
  const usePrefixCls = (tag, props)=>{
32
32
  const { getPrefixCls } = (0, external_react_namespaceObject.useContext)(external_antd_namespaceObject.ConfigProvider.ConfigContext) || {};
33
- if ('ConfigContext' in external_antd_namespaceObject.ConfigProvider) return (null == getPrefixCls ? void 0 : getPrefixCls(tag, null == props ? void 0 : props.prefixCls)) || '';
33
+ if ("ConfigContext" in external_antd_namespaceObject.ConfigProvider) return (null == getPrefixCls ? void 0 : getPrefixCls(tag, null == props ? void 0 : props.prefixCls)) || '';
34
34
  {
35
35
  var _props_prefixCls;
36
36
  const prefix = null != (_props_prefixCls = null == props ? void 0 : props.prefixCls) ? _props_prefixCls : 'ant-';
@@ -61,7 +61,7 @@ function _templateObject1() {
61
61
  function _templateObject2() {
62
62
  const data = _tagged_template_literal([
63
63
  "\n position: sticky !important;\n top: 0 !important;\n z-index: 100 !important;\n background: #fff !important;\n background-color: #fff !important;\n padding: ",
64
- "px 0;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n border-bottom: 1px solid rgba(5, 5, 5, 0.06);\n margin: 0 -16px;\n padding-left: 16px;\n padding-right: 16px;\n\n /* \u786E\u4FDD\u5B8C\u5168\u906E\u6321 */\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: -100vw;\n right: -100vw;\n bottom: 0;\n background: #fff;\n z-index: -1;\n }\n "
64
+ "px 0;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n border-bottom: 1px solid rgba(5, 5, 5, 0.06);\n margin: 0 -16px;\n padding-left: 16px;\n padding-right: 16px;\n\n /* 确保完全遮挡 */\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: -100vw;\n right: -100vw;\n bottom: 0;\n background: #fff;\n z-index: -1;\n }\n "
65
65
  ]);
66
66
  _templateObject2 = function() {
67
67
  return data;
@@ -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
  });
@@ -145,7 +145,7 @@ const InternalAssociationSelect = (0, schema_namespaceObject.observer)((props)=>
145
145
  style: {
146
146
  paddingLeft: 5
147
147
  },
148
- children: t('Add') + " \u201C".concat(props.search, "\u201D ")
148
+ children: t('Add') + " ".concat(props.search, " ")
149
149
  })
150
150
  ]
151
151
  });
@@ -103,7 +103,7 @@ const InternaDrawerSubTable = (0, schema_namespaceObject.observer)((props)=>{
103
103
  extra: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Button, {
104
104
  type: "primary",
105
105
  onClick: ()=>setVisible(false),
106
- children: "\u786E\u8BA4"
106
+ children: "确认"
107
107
  }),
108
108
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_flag_provider_index_js_namespaceObject.FlagProvider, {
109
109
  isInSubForm: true,
@@ -37,7 +37,7 @@ function _tagged_template_literal(strings, raw) {
37
37
  }
38
38
  function _templateObject() {
39
39
  const data = _tagged_template_literal([
40
- "\n display: flex;\n flex-direction: row;\n max-height: 30vh;\n .left-pane {\n padding: 2px;\n display: flex;\n font-weight: 500;\n flex-direction: column;\n width: 100px;\n overflow-y: auto;\n /* \u9690\u85CF\u6EDA\u52A8\u6761 \u5FAE\u8F6F/\u706B\u72D0 */\n -ms-overflow-style: none;\n scrollbar-width: none;\n border-right: 2px solid #d4d4d4;\n padding: 2px;\n margin-right: 5px;\n div {\n background-color: #ffffff;\n white-space: normal;\n cursor: pointer;\n margin: 5px 0 5px;\n }\n div:last-of-type {\n margin-bottom: 0;\n }\n }\n /* \u9690\u85CF\u6EDA\u52A8\u6761 \u8C37\u6B4C\u6D4F\u89C8\u5668 */\n .left-pane::-webkit-scrollbar {\n display: none;\n }\n\n .right-pane {\n padding: 2px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n flex: 1;\n div {\n margin-bottom: 1em;\n .ant-btn {\n margin-right: 2px;\n }\n }\n div:last-of-type {\n margin-bottom: 0;\n }\n }\n "
40
+ "\n display: flex;\n flex-direction: row;\n max-height: 30vh;\n .left-pane {\n padding: 2px;\n display: flex;\n font-weight: 500;\n flex-direction: column;\n width: 100px;\n overflow-y: auto;\n /* 隐藏滚动条 微软/火狐 */\n -ms-overflow-style: none;\n scrollbar-width: none;\n border-right: 2px solid #d4d4d4;\n padding: 2px;\n margin-right: 5px;\n div {\n background-color: #ffffff;\n white-space: normal;\n cursor: pointer;\n margin: 5px 0 5px;\n }\n div:last-of-type {\n margin-bottom: 0;\n }\n }\n /* 隐藏滚动条 谷歌浏览器 */\n .left-pane::-webkit-scrollbar {\n display: none;\n }\n\n .right-pane {\n padding: 2px;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n flex: 1;\n div {\n margin-bottom: 1em;\n .ant-btn {\n margin-right: 2px;\n }\n }\n div:last-of-type {\n margin-bottom: 0;\n }\n }\n "
41
41
  ]);
42
42
  _templateObject = function() {
43
43
  return data;
@@ -36,60 +36,60 @@ const external_antd_namespaceObject = require("antd");
36
36
  const defaultItems = [
37
37
  {
38
38
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.FullscreenOutlined, {}),
39
- title: "\u5168\u5C4F"
39
+ title: '全屏'
40
40
  },
41
41
  {
42
42
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.UndoOutlined, {}),
43
- title: "\u64A4\u9500"
43
+ title: '撤销'
44
44
  },
45
45
  {
46
46
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.RedoOutlined, {}),
47
- title: "\u91CD\u505A"
47
+ title: '重做'
48
48
  },
49
49
  {
50
50
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.DeleteOutlined, {}),
51
- title: "\u5220\u9664"
51
+ title: '删除'
52
52
  }
53
53
  ];
54
54
  const customItems = [
55
55
  {
56
56
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.CopyOutlined, {}),
57
57
  placement: 'bottom',
58
- title: "\u590D\u5236"
58
+ title: '复制'
59
59
  },
60
60
  {
61
61
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ZoomInOutlined, {}),
62
- title: "\u653E\u5927\uFF01"
62
+ title: '放大!'
63
63
  },
64
64
  {
65
65
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ZoomOutOutlined, {}),
66
66
  style: {
67
67
  color: '#1890ff'
68
68
  },
69
- title: "\u7F29\u5C0F\uFF01"
69
+ title: '缩小!'
70
70
  },
71
71
  {
72
72
  type: 'divider'
73
73
  },
74
74
  {
75
75
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.DragOutlined, {}),
76
- title: "\u5FEB\u901F\u5B9A\u4F4D"
76
+ title: '快速定位'
77
77
  }
78
78
  ];
79
79
  const dropdownMenuItems = [
80
80
  {
81
81
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.CopyOutlined, {}),
82
82
  onClick: ()=>{
83
- external_antd_namespaceObject.message.info("\u590D\u5236\uFF01");
83
+ external_antd_namespaceObject.message.info('复制!');
84
84
  },
85
- label: "\u590D\u5236"
85
+ label: '复制'
86
86
  },
87
87
  {
88
88
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ZoomInOutlined, {}),
89
89
  onClick: ()=>{
90
- external_antd_namespaceObject.message.success("\u653E\u5927\uFF01");
90
+ external_antd_namespaceObject.message.success('放大!');
91
91
  },
92
- label: "\u653E\u5927\uFF01"
92
+ label: '放大!'
93
93
  },
94
94
  {
95
95
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.ZoomOutOutlined, {}),
@@ -97,9 +97,9 @@ const dropdownMenuItems = [
97
97
  color: '#1890ff'
98
98
  },
99
99
  onClick: ()=>{
100
- external_antd_namespaceObject.message.success("\u7F29\u5C0F\uFF01");
100
+ external_antd_namespaceObject.message.success('缩小!');
101
101
  },
102
- label: "\u7F29\u5C0F\uFF01"
102
+ label: '缩小!'
103
103
  },
104
104
  {
105
105
  type: 'divider'
@@ -107,9 +107,9 @@ const dropdownMenuItems = [
107
107
  {
108
108
  icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.DragOutlined, {}),
109
109
  onClick: ()=>{
110
- external_antd_namespaceObject.message.loading("\u5FEB\u901F\u5B9A\u4F4Ding");
110
+ external_antd_namespaceObject.message.loading('快速定位ing');
111
111
  },
112
- label: "\u5FEB\u901F\u5B9A\u4F4D"
112
+ label: '快速定位'
113
113
  }
114
114
  ];
115
115
  const BlockToolbar = /*#__PURE__*/ (0, external_react_namespaceObject.forwardRef)((props, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
@@ -54,9 +54,9 @@ const screenSizeTitleMaps = {
54
54
  };
55
55
  const screenSizeMaps = {
56
56
  xs: '< 768',
57
- md: "\u2265 768",
58
- lg: "\u2265 992",
59
- xxl: "\u2265 1600"
57
+ md: '≥ 768',
58
+ lg: '≥ 992',
59
+ xxl: '≥ 1600'
60
60
  };
61
61
  const defaultColumnCount = {
62
62
  xs: 1,
@@ -38,8 +38,8 @@ __webpack_require__.d(__webpack_exports__, {
38
38
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
39
39
  require("react");
40
40
  const schema_namespaceObject = require("@tachybase/schema");
41
- const css_namespaceObject = require("@emotion/css");
42
41
  const client_namespaceObject = require("@tego/client");
42
+ const css_namespaceObject = require("@emotion/css");
43
43
  const external_antd_namespaceObject = require("antd");
44
44
  const external_classnames_namespaceObject = require("classnames");
45
45
  var external_classnames_default = /*#__PURE__*/ __webpack_require__.n(external_classnames_namespaceObject);
@@ -70,8 +70,6 @@ const _Input = (props)=>{
70
70
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
71
71
  className: external_classnames_default()(prefixCls, props.className),
72
72
  style: {
73
- display: 'flex',
74
- alignItems: 'center',
75
73
  overflowWrap: 'break-word',
76
74
  whiteSpace: 'normal',
77
75
  ...props.style
@@ -56,7 +56,7 @@ function _templateObject1() {
56
56
  function _templateObject2() {
57
57
  const data = _tagged_template_literal([
58
58
  "\n height: 100%;\n overflow-y: auto;\n overflow-x: hidden;\n\n .ant-menu-submenu.ant-menu-submenu-inline .ant-menu-submenu-title {\n position: relative;\n ::before {\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n width: 3px;\n height: 50%;\n background-color: ",
59
- ";\n\n /* \u4F7F\u7528 clip-path \u88C1\u526A\u4E3A\u68AF\u5F62 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\n }\n }\n\n .ant-menu-submenu.ant-menu-submenu-inline.ant-menu-submenu-open > .ant-menu-submenu-title {\n ::before {\n background-color: ",
59
+ ";\n\n /* 使用 clip-path 裁剪为梯形 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\n }\n }\n\n .ant-menu-submenu.ant-menu-submenu-inline.ant-menu-submenu-open > .ant-menu-submenu-title {\n ::before {\n background-color: ",
60
60
  ";\n }\n }\n\n .ant-menu-item,\n .ant-menu-submenu-title {\n padding-inline-end: 10px;\n }\n\n .ant-menu-submenu-title {\n .ant-menu-title-content {\n > div {\n > .general-schema-designer {\n right: 6px !important;\n }\n > span.anticon {\n margin-right: 10px;\n }\n }\n }\n }\n "
61
61
  ]);
62
62
  _templateObject2 = function() {
@@ -37,7 +37,7 @@ function _tagged_template_literal(strings, raw) {
37
37
  }
38
38
  function _templateObject() {
39
39
  const data = _tagged_template_literal([
40
- "\n /* NOTE: \u8FD9\u91CC\u7684\u6837\u5F0F\u662F\u4E3A\u4E86\u8BA9\u641C\u7D22\u6846\u7684\u6837\u5F0F, \u907F\u514D\u4E0A\u5C42 antd \u5199\u6B7B\u7684 padding-left: 24px \u7684\u5F71\u54CD */\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n\n /* NOTE: \u653E\u8FD9\u4E09\u4E2A\u6837\u5F0F\u662F\u4E3A\u4E86\u63D0\u5347\u9009\u62E9\u5668\u4F18\u5148\u7EA7, \u8986\u76D6\u6389 antd \u7684\u9ED8\u8BA4\u6837\u5F0F */\n .ant-input-outlined.ant-input-outlined.ant-input-outlined {\n background-color: #f9f9f9;\n border-radius: 5px;\n border: none;\n box-shadow: none;\n }\n\n /* \u79FB\u9664 antd \u9ED8\u8BA4\u7684\u540E\u7F6E\u641C\u7D22\u56FE\u6807 */\n .ant-input-group-addon {\n display: none;\n }\n\n .menu-add-wrapper {\n .ant-dropdown-trigger {\n display: grid;\n place-items: center;\n\n width: 30px;\n /* \u8FD9\u91CC\u662F\u4E3A\u4E86\u548C\u524D\u8FB9\u5143\u7D20\u4FDD\u6301\u5BF9\u9F50, antd \u7EC4\u4EF6\u5199\u6B7B\u4E86\u9AD8\u5EA6 */\n height: 28px;\n\n cursor: pointer;\n\n :hover,\n :active {\n border-radius: 5px;\n color: #ffffff;\n background-color: #f4f4f4;\n }\n }\n }\n "
40
+ "\n /* NOTE: 这里的样式是为了让搜索框的样式, 避免上层 antd 写死的 padding-left: 24px 的影响 */\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n\n /* NOTE: 放这三个样式是为了提升选择器优先级, 覆盖掉 antd 的默认样式 */\n .ant-input-outlined.ant-input-outlined.ant-input-outlined {\n background-color: #f9f9f9;\n border-radius: 5px;\n border: none;\n box-shadow: none;\n }\n\n /* 移除 antd 默认的后置搜索图标 */\n .ant-input-group-addon {\n display: none;\n }\n\n .menu-add-wrapper {\n .ant-dropdown-trigger {\n display: grid;\n place-items: center;\n\n width: 30px;\n /* 这里是为了和前边元素保持对齐, antd 组件写死了高度 */\n height: 28px;\n\n cursor: pointer;\n\n :hover,\n :active {\n border-radius: 5px;\n color: #ffffff;\n background-color: #f4f4f4;\n }\n }\n }\n "
41
41
  ]);
42
42
  _templateObject = function() {
43
43
  return data;
@@ -269,6 +269,9 @@ const TabItem = (props)=>{
269
269
  type: schema['x-icon']
270
270
  }),
271
271
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
272
+ style: {
273
+ padding: '6px 16px'
274
+ },
272
275
  children: schema.title || t('Unnamed')
273
276
  }),
274
277
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {