@tachybase/client 0.23.20 → 0.23.35

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 (187) hide show
  1. package/es/application/schema-initializer/components/SchemaInitializerChildren.mjs +1 -1
  2. package/es/built-in/admin-layout/InternalAdminLayout.mjs +4 -2
  3. package/es/built-in/admin-layout/MenuEditor.mjs +2 -2
  4. package/es/built-in/admin-layout/style.d.ts +1 -1
  5. package/es/built-in/admin-layout/style.mjs +4 -4
  6. package/es/built-in/assistant/Assistant.provider.d.ts +0 -6
  7. package/es/built-in/assistant/Assistant.provider.mjs +15 -112
  8. package/es/built-in/assistant/index.d.ts +0 -1
  9. package/es/built-in/assistant/index.mjs +0 -7
  10. package/es/built-in/attachment-preview/previewers/file-pdf.mjs +4 -2
  11. package/es/built-in/context-menu/ContextMenu.provider.d.ts +1 -0
  12. package/es/built-in/context-menu/ContextMenu.provider.mjs +29 -1
  13. package/es/built-in/context-menu/index.mjs +1 -0
  14. package/es/built-in/index.mjs +44 -5
  15. package/es/built-in/page-style/TabHeader.d.ts +1 -1
  16. package/es/built-in/page-style/TabHeader.mjs +26 -33
  17. package/es/built-in/page-style/TabHeader.style.d.ts +4 -0
  18. package/es/built-in/page-style/TabHeader.style.mjs +35 -0
  19. package/es/built-in/pinned-list/PinnedPluginListProvider.d.ts +3 -1
  20. package/es/built-in/pinned-list/PinnedPluginListProvider.mjs +5 -4
  21. package/es/built-in/scroll-assistant/useJoystick.mjs +3 -1
  22. package/es/built-in/setting-layout/SettingLayout.mjs +10 -1
  23. package/es/built-in/{assistant/calculator → setting-layout}/style.d.ts +1 -1
  24. package/es/built-in/setting-layout/style.mjs +25 -0
  25. package/es/collection-manager/action-hooks.d.ts +1 -4
  26. package/es/collection-manager/action-hooks.mjs +39 -11
  27. package/es/icon/preloaded.mjs +4 -4
  28. package/es/modules/actions/associate/AssociateActionInitializer.d.ts +1 -0
  29. package/es/modules/actions/associate/AssociateActionInitializer.mjs +71 -0
  30. package/es/modules/actions/associate/AssociateActionProvider.d.ts +7 -0
  31. package/es/modules/actions/associate/AssociateActionProvider.mjs +82 -0
  32. package/es/modules/actions/associate/AssociateActionSettings.d.ts +2 -0
  33. package/es/modules/actions/associate/AssociateActionSettings.mjs +57 -0
  34. package/es/modules/blocks/data-blocks/details-multi/detailsWithPaginationSettings.mjs +2 -1
  35. package/es/modules/blocks/data-blocks/form/RecordFormBlockInitializer.mjs +21 -14
  36. package/es/modules/blocks/data-blocks/form/createEditFormBlockUISchema.d.ts +1 -2
  37. package/es/modules/blocks/data-blocks/grid-card/gridCardBlockSettings.mjs +2 -1
  38. package/es/modules/blocks/data-blocks/list/listBlockSettings.mjs +2 -1
  39. package/es/modules/blocks/data-blocks/table/TableActionInitializers.mjs +15 -0
  40. package/es/modules/blocks/data-blocks/table/tableBlockSettings.mjs +2 -1
  41. package/es/modules/blocks/data-blocks/table/tableColumnSettings.mjs +2 -2
  42. package/es/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.mjs +2 -1
  43. package/es/modules/fields/component/Cascader/cascaderComponentFieldSettings.mjs +2 -1
  44. package/es/modules/fields/component/Radio/radioComponentFieldSettings.mjs +4 -0
  45. package/es/modules/fields/component/Select/selectComponentFieldSettings.mjs +16 -2
  46. package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.mjs +2 -1
  47. package/es/modules/menu/GroupItem.mjs +5 -1
  48. package/es/modules/menu/LinkMenuItem.mjs +7 -3
  49. package/es/modules/menu/PageMenuItem.mjs +5 -1
  50. package/es/modules/menu/UploadMenuItem.d.ts +1 -0
  51. package/es/modules/menu/UploadMenuItem.mjs +81 -0
  52. package/es/modules/menu/menuItemInitializer.d.ts +0 -4
  53. package/es/modules/menu/menuItemInitializer.mjs +3 -23
  54. package/es/schema-component/antd/action/Action.Designer.mjs +4 -1
  55. package/es/schema-component/antd/association-select/AssociationSelect.mjs +4 -2
  56. package/es/schema-component/antd/checkbox/Checkbox.mjs +11 -6
  57. package/es/schema-component/antd/date-picker/DatePicker.mjs +4 -0
  58. package/es/schema-component/antd/form-item/FormItem.Settings.d.ts +2 -0
  59. package/es/schema-component/antd/form-item/FormItem.Settings.mjs +14 -1
  60. package/es/schema-component/antd/form-v2/Form.Settings.mjs +2 -1
  61. package/es/schema-component/antd/grid-card/GridCard.Designer.mjs +2 -1
  62. package/es/schema-component/antd/list/List.Designer.mjs +2 -1
  63. package/es/schema-component/antd/menu/AdminMenu.d.ts +1 -0
  64. package/es/schema-component/antd/menu/AdminMenu.mjs +71 -0
  65. package/es/schema-component/antd/menu/AdminMenu.style.d.ts +4 -0
  66. package/es/schema-component/antd/menu/AdminMenu.style.mjs +36 -0
  67. package/es/schema-component/antd/menu/Menu.Designer.d.ts +1 -1
  68. package/es/schema-component/antd/menu/Menu.Designer.mjs +59 -40
  69. package/es/schema-component/antd/menu/Menu.mjs +108 -141
  70. package/es/schema-component/antd/menu/Menu.styles.d.ts +1 -2
  71. package/es/schema-component/antd/menu/Menu.styles.mjs +8 -20
  72. package/es/schema-component/antd/menu/MenuSearch.d.ts +5 -0
  73. package/es/schema-component/antd/menu/MenuSearch.mjs +32 -0
  74. package/es/schema-component/antd/menu/tools.d.ts +9 -0
  75. package/es/schema-component/antd/menu/tools.mjs +36 -0
  76. package/es/schema-component/antd/scroll-area/ScrollArea.mjs +0 -17
  77. package/es/schema-component/antd/select/Select.d.ts +3 -13
  78. package/es/schema-component/antd/select/Select.mjs +33 -2
  79. package/es/schema-component/antd/table/Table.Void.Designer.mjs +2 -1
  80. package/es/schema-component/antd/table-v2/TableBlockDesigner.mjs +2 -1
  81. package/es/schema-component/antd/table-v2/TableSelectorDesigner.mjs +2 -1
  82. package/es/schema-component/common/dnd-context/index.d.ts +1 -2
  83. package/es/schema-component/common/sortable-item/DragHandleMenu.d.ts +1 -0
  84. package/es/schema-component/common/sortable-item/DragHandleMenu.mjs +78 -0
  85. package/es/schema-component/common/sortable-item/DragHandleMenu.style.d.ts +3 -0
  86. package/es/schema-component/common/sortable-item/DragHandleMenu.style.mjs +25 -0
  87. package/es/schema-initializer/SchemaInitializerPlugin.mjs +5 -2
  88. package/es/schema-initializer/utils.mjs +24 -12
  89. package/es/schema-settings/GeneralSchemaDesigner.d.ts +2 -1
  90. package/es/schema-settings/GeneralSchemaDesigner.mjs +9 -1
  91. package/es/schema-settings/SchemaSettings.d.ts +3 -1
  92. package/es/schema-settings/SchemaSettings.mjs +16 -4
  93. package/es/schema-settings/SchemaSettingsPlugin.mjs +2 -0
  94. package/es/schema-settings/SchemaSettingsSortingRule.mjs +2 -1
  95. package/es/schema-settings/styles.mjs +2 -2
  96. package/lib/application/schema-initializer/components/SchemaInitializerChildren.js +1 -1
  97. package/lib/built-in/admin-layout/InternalAdminLayout.js +4 -2
  98. package/lib/built-in/admin-layout/MenuEditor.js +2 -2
  99. package/lib/built-in/admin-layout/style.js +4 -4
  100. package/lib/built-in/assistant/Assistant.provider.js +16 -115
  101. package/lib/built-in/assistant/index.js +3 -16
  102. package/lib/built-in/attachment-preview/previewers/file-pdf.js +4 -2
  103. package/lib/built-in/context-menu/ContextMenu.provider.js +29 -0
  104. package/lib/built-in/context-menu/index.js +1 -0
  105. package/lib/built-in/index.js +44 -5
  106. package/lib/built-in/page-style/TabHeader.js +26 -33
  107. package/lib/built-in/page-style/TabHeader.style.js +69 -0
  108. package/lib/built-in/pinned-list/PinnedPluginListProvider.js +5 -4
  109. package/lib/built-in/scroll-assistant/useJoystick.js +17 -1
  110. package/lib/built-in/setting-layout/SettingLayout.js +10 -1
  111. package/lib/built-in/{assistant/calculator/CalculatorKey.js → setting-layout/style.js} +25 -11
  112. package/lib/collection-manager/action-hooks.js +39 -11
  113. package/lib/icon/preloaded.js +4 -4
  114. package/lib/locale/en_US.js +8 -0
  115. package/lib/locale/zh-CN.js +8 -0
  116. package/lib/modules/actions/associate/AssociateActionInitializer.js +105 -0
  117. package/lib/modules/actions/associate/AssociateActionProvider.js +116 -0
  118. package/lib/modules/actions/associate/AssociateActionSettings.js +91 -0
  119. package/lib/modules/blocks/data-blocks/details-multi/detailsWithPaginationSettings.js +2 -1
  120. package/lib/modules/blocks/data-blocks/form/RecordFormBlockInitializer.js +21 -14
  121. package/lib/modules/blocks/data-blocks/grid-card/gridCardBlockSettings.js +2 -1
  122. package/lib/modules/blocks/data-blocks/list/listBlockSettings.js +2 -1
  123. package/lib/modules/blocks/data-blocks/table/TableActionInitializers.js +15 -0
  124. package/lib/modules/blocks/data-blocks/table/tableBlockSettings.js +2 -1
  125. package/lib/modules/blocks/data-blocks/table/tableColumnSettings.js +2 -2
  126. package/lib/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.js +2 -1
  127. package/lib/modules/fields/component/Cascader/cascaderComponentFieldSettings.js +2 -1
  128. package/lib/modules/fields/component/Radio/radioComponentFieldSettings.js +4 -0
  129. package/lib/modules/fields/component/Select/selectComponentFieldSettings.js +16 -2
  130. package/lib/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.js +2 -1
  131. package/lib/modules/menu/GroupItem.js +5 -1
  132. package/lib/modules/menu/LinkMenuItem.js +7 -3
  133. package/lib/modules/menu/PageMenuItem.js +5 -1
  134. package/lib/modules/menu/UploadMenuItem.js +115 -0
  135. package/lib/modules/menu/menuItemInitializer.js +2 -23
  136. package/lib/schema-component/antd/action/Action.Designer.js +4 -1
  137. package/lib/schema-component/antd/association-select/AssociationSelect.js +4 -2
  138. package/lib/schema-component/antd/checkbox/Checkbox.js +11 -6
  139. package/lib/schema-component/antd/date-picker/DatePicker.js +4 -0
  140. package/lib/schema-component/antd/form-item/FormItem.Settings.js +16 -1
  141. package/lib/schema-component/antd/form-v2/Form.Settings.js +2 -1
  142. package/lib/schema-component/antd/grid-card/GridCard.Designer.js +2 -1
  143. package/lib/schema-component/antd/list/List.Designer.js +2 -1
  144. package/lib/schema-component/antd/menu/AdminMenu.js +105 -0
  145. package/lib/schema-component/antd/menu/AdminMenu.style.js +70 -0
  146. package/lib/schema-component/antd/menu/Menu.Designer.js +59 -40
  147. package/lib/schema-component/antd/menu/Menu.js +108 -141
  148. package/lib/schema-component/antd/menu/Menu.styles.js +8 -20
  149. package/lib/schema-component/antd/menu/MenuSearch.js +80 -0
  150. package/lib/schema-component/antd/menu/tools.js +72 -0
  151. package/lib/schema-component/antd/scroll-area/ScrollArea.js +0 -17
  152. package/lib/schema-component/antd/select/Select.js +33 -2
  153. package/lib/schema-component/antd/table/Table.Void.Designer.js +2 -1
  154. package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
  155. package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +2 -1
  156. package/lib/schema-component/common/sortable-item/DragHandleMenu.js +112 -0
  157. package/lib/schema-component/common/sortable-item/DragHandleMenu.style.js +59 -0
  158. package/lib/schema-initializer/SchemaInitializerPlugin.js +5 -2
  159. package/lib/schema-initializer/utils.js +24 -12
  160. package/lib/schema-settings/GeneralSchemaDesigner.js +9 -1
  161. package/lib/schema-settings/SchemaSettings.js +16 -4
  162. package/lib/schema-settings/SchemaSettingsPlugin.js +2 -0
  163. package/lib/schema-settings/SchemaSettingsSortingRule.js +2 -1
  164. package/lib/schema-settings/styles.js +2 -2
  165. package/package.json +8 -7
  166. package/es/built-in/assistant/calculator/AutoScalingText.d.ts +0 -3
  167. package/es/built-in/assistant/calculator/AutoScalingText.mjs +0 -33
  168. package/es/built-in/assistant/calculator/Calculator.d.ts +0 -2
  169. package/es/built-in/assistant/calculator/Calculator.mjs +0 -235
  170. package/es/built-in/assistant/calculator/CalculatorDisplay.d.ts +0 -4
  171. package/es/built-in/assistant/calculator/CalculatorDisplay.mjs +0 -21
  172. package/es/built-in/assistant/calculator/CalculatorKey.d.ts +0 -5
  173. package/es/built-in/assistant/calculator/CalculatorKey.mjs +0 -11
  174. package/es/built-in/assistant/calculator/CalculatorProvider.d.ts +0 -10
  175. package/es/built-in/assistant/calculator/CalculatorProvider.mjs +0 -29
  176. package/es/built-in/assistant/calculator/Draggable.d.ts +0 -8
  177. package/es/built-in/assistant/calculator/Draggable.mjs +0 -54
  178. package/es/built-in/assistant/calculator/style.mjs +0 -25
  179. package/es/built-in/assistant/search-and-jump/index.d.ts +0 -16
  180. package/es/built-in/assistant/search-and-jump/index.mjs +0 -59
  181. package/lib/built-in/assistant/calculator/AutoScalingText.js +0 -67
  182. package/lib/built-in/assistant/calculator/Calculator.js +0 -283
  183. package/lib/built-in/assistant/calculator/CalculatorDisplay.js +0 -55
  184. package/lib/built-in/assistant/calculator/CalculatorProvider.js +0 -65
  185. package/lib/built-in/assistant/calculator/Draggable.js +0 -102
  186. package/lib/built-in/assistant/calculator/style.js +0 -59
  187. package/lib/built-in/assistant/search-and-jump/index.js +0 -96
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = function(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 = function(obj, prop) {
13
+ return Object.prototype.hasOwnProperty.call(obj, prop);
14
+ };
15
+ })();
16
+ (()=>{
17
+ __webpack_require__.r = function(exports1) {
18
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
19
+ value: 'Module'
20
+ });
21
+ Object.defineProperty(exports1, '__esModule', {
22
+ value: true
23
+ });
24
+ };
25
+ })();
26
+ var __webpack_exports__ = {};
27
+ __webpack_require__.r(__webpack_exports__);
28
+ __webpack_require__.d(__webpack_exports__, {
29
+ AssociateActionProvider: ()=>AssociateActionProvider
30
+ });
31
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
32
+ const external_react_namespaceObject = require("react");
33
+ const external_index_js_namespaceObject = require("../../../index.js");
34
+ const TableSelectorProvider_js_namespaceObject = require("../../../block-provider/TableSelectorProvider.js");
35
+ const index_js_namespaceObject = require("../../../schema-component/antd/record-picker/index.js");
36
+ const useTableSelectorProps = ()=>{
37
+ const { setSelectedRows } = (0, external_react_namespaceObject.useContext)(index_js_namespaceObject.RecordPickerContext);
38
+ const { onRowSelectionChange, rowKey = 'id', ...others } = (0, TableSelectorProvider_js_namespaceObject.useTableSelectorProps)();
39
+ return {
40
+ ...others,
41
+ rowKey,
42
+ rowSelection: {
43
+ type: 'checkbox'
44
+ },
45
+ onRowSelectionChange (selectedRowKeys, selectedRows) {
46
+ null == setSelectedRows || setSelectedRows(selectedRowKeys);
47
+ null == onRowSelectionChange || onRowSelectionChange(selectedRowKeys, selectedRows);
48
+ }
49
+ };
50
+ };
51
+ const AssociateActionProvider = (props)=>{
52
+ const [selectedRows, setSelectedRows] = (0, external_react_namespaceObject.useState)([]);
53
+ const collection = (0, external_index_js_namespaceObject.useCollection)();
54
+ const { resource, service, block, __parent } = (0, external_index_js_namespaceObject.useBlockRequestContext)();
55
+ const pickerProps = {
56
+ size: 'small',
57
+ onChange: null == props ? void 0 : props.onChange,
58
+ selectedRows,
59
+ setSelectedRows
60
+ };
61
+ const usePickActionProps = ()=>{
62
+ const { selectedRows } = (0, external_react_namespaceObject.useContext)(index_js_namespaceObject.RecordPickerContext);
63
+ const { setVisible, setFormValueChanged } = (0, external_index_js_namespaceObject.useActionContext)();
64
+ return {
65
+ async onClick (e, callBack) {
66
+ await resource.add({
67
+ values: selectedRows
68
+ });
69
+ null == callBack || callBack();
70
+ null == setVisible || setVisible(false);
71
+ if (block && 'TableField' !== block) {
72
+ var __parent_service_refresh, __parent_service;
73
+ null == __parent || null === (__parent_service = __parent.service) || void 0 === __parent_service || null === (__parent_service_refresh = __parent_service.refresh) || void 0 === __parent_service_refresh || __parent_service_refresh.call(__parent_service);
74
+ null == setFormValueChanged || setFormValueChanged(false);
75
+ }
76
+ }
77
+ };
78
+ };
79
+ const getFilter = ()=>{
80
+ var _service_data;
81
+ const targetKey = (null == collection ? void 0 : collection.filterTargetKey) || 'id';
82
+ if (null === (_service_data = service.data) || void 0 === _service_data ? void 0 : _service_data.data) {
83
+ var _service_data1;
84
+ const list = null === (_service_data1 = service.data) || void 0 === _service_data1 ? void 0 : _service_data1.data.map((option)=>option[targetKey]).filter(Boolean);
85
+ const filter = list.length ? {
86
+ $and: [
87
+ {
88
+ ["".concat(targetKey, ".$ne")]: list
89
+ }
90
+ ]
91
+ } : {};
92
+ return filter;
93
+ }
94
+ return {};
95
+ };
96
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.RecordPickerProvider, {
97
+ ...pickerProps,
98
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_index_js_namespaceObject.SchemaComponentOptions, {
99
+ scope: {
100
+ useTableSelectorProps,
101
+ usePickActionProps
102
+ },
103
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TableSelectorProvider_js_namespaceObject.TableSelectorParamsProvider, {
104
+ params: {
105
+ filter: getFilter()
106
+ },
107
+ children: props.children
108
+ })
109
+ })
110
+ });
111
+ };
112
+ var __webpack_export_target__ = exports;
113
+ for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
114
+ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
115
+ value: true
116
+ });
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = function(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 = function(obj, prop) {
13
+ return Object.prototype.hasOwnProperty.call(obj, prop);
14
+ };
15
+ })();
16
+ (()=>{
17
+ __webpack_require__.r = function(exports1) {
18
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
19
+ value: 'Module'
20
+ });
21
+ Object.defineProperty(exports1, '__esModule', {
22
+ value: true
23
+ });
24
+ };
25
+ })();
26
+ var __webpack_exports__ = {};
27
+ __webpack_require__.r(__webpack_exports__);
28
+ __webpack_require__.d(__webpack_exports__, {
29
+ associateActionSettings: ()=>associateActionSettings
30
+ });
31
+ const external_react_namespaceObject = require("react");
32
+ const index_js_namespaceObject = require("../../../application/index.js");
33
+ const SchemaSettings_js_namespaceObject = require("../../../application/schema-settings/SchemaSettings.js");
34
+ const external_collection_manager_index_js_namespaceObject = require("../../../collection-manager/index.js");
35
+ const Action_Designer_js_namespaceObject = require("../../../schema-component/antd/action/Action.Designer.js");
36
+ const external_schema_items_index_js_namespaceObject = require("../../../schema-items/index.js");
37
+ const external_schema_settings_SchemaSettings_js_namespaceObject = require("../../../schema-settings/SchemaSettings.js");
38
+ const associateActionSettings = new SchemaSettings_js_namespaceObject.SchemaSettings({
39
+ name: 'actionSettings:associate',
40
+ items: [
41
+ {
42
+ name: 'editButton',
43
+ Component: Action_Designer_js_namespaceObject.ButtonEditor,
44
+ useComponentProps () {
45
+ const { buttonEditorProps } = (0, index_js_namespaceObject.useSchemaToolbar)();
46
+ return buttonEditorProps;
47
+ }
48
+ },
49
+ {
50
+ name: 'openMode',
51
+ Component: external_schema_items_index_js_namespaceObject.SchemaSettingOpenModeSchemaItems,
52
+ componentProps: {
53
+ openMode: true,
54
+ openSize: true
55
+ }
56
+ },
57
+ {
58
+ name: 'enableChildCollections',
59
+ Component: external_schema_settings_SchemaSettings_js_namespaceObject.SchemaSettingsEnableChildCollections,
60
+ useComponentProps () {
61
+ const { name } = (0, external_collection_manager_index_js_namespaceObject.useCollection_deprecated)();
62
+ return {
63
+ collectionName: name
64
+ };
65
+ },
66
+ useVisible () {
67
+ const { name } = (0, external_collection_manager_index_js_namespaceObject.useCollection_deprecated)();
68
+ const { getChildrenCollections } = (0, external_collection_manager_index_js_namespaceObject.useCollectionManager_deprecated)();
69
+ const isChildCollectionAction = (0, external_react_namespaceObject.useMemo)(()=>getChildrenCollections(name).length > 0, [
70
+ getChildrenCollections,
71
+ name
72
+ ]);
73
+ return isChildCollectionAction;
74
+ }
75
+ },
76
+ {
77
+ name: 'delete',
78
+ sort: 100,
79
+ Component: Action_Designer_js_namespaceObject.RemoveButton,
80
+ useComponentProps () {
81
+ const { removeButtonProps } = (0, index_js_namespaceObject.useSchemaToolbar)();
82
+ return removeButtonProps;
83
+ }
84
+ }
85
+ ]
86
+ });
87
+ var __webpack_export_target__ = exports;
88
+ for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
89
+ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
90
+ value: true
91
+ });
@@ -140,7 +140,8 @@ const commonItems = [
140
140
  'x-component-props': {
141
141
  style: {
142
142
  width: 260
143
- }
143
+ },
144
+ optionLabelProp: 'fullLabel'
144
145
  }
145
146
  },
146
147
  direction: {
@@ -31,6 +31,7 @@ __webpack_require__.d(__webpack_exports__, {
31
31
  });
32
32
  const jsx_runtime_namespaceObject = require("react/jsx-runtime");
33
33
  const external_react_namespaceObject = require("react");
34
+ const schema_namespaceObject = require("@tachybase/schema");
34
35
  const icons_namespaceObject = require("@ant-design/icons");
35
36
  const index_js_namespaceObject = require("../../../../application/index.js");
36
37
  const external_collection_manager_index_js_namespaceObject = require("../../../../collection-manager/index.js");
@@ -65,23 +66,27 @@ const RecordFormBlockInitializer = ()=>{
65
66
  };
66
67
  function useCreateEditFormBlock() {
67
68
  const { insert } = (0, index_js_namespaceObject.useSchemaInitializer)();
69
+ const cm = (0, external_data_source_index_js_namespaceObject.useCollectionManager)();
70
+ const fieldSchema = (0, schema_namespaceObject.useFieldSchema)();
71
+ const actionType = null == fieldSchema ? void 0 : fieldSchema['actionType'];
68
72
  const association = (0, external_data_source_index_js_namespaceObject.useAssociationName)();
69
73
  const createEditFormBlock = (0, external_react_namespaceObject.useCallback)((param)=>{
70
74
  let { item } = param;
71
- const collectionName = item.collectionName || item.name;
72
- if (!association && item.associationField) {
75
+ const field = item.associationField;
76
+ const collectionName = (null == field ? void 0 : field.target) ? cm.getCollection(field.target).name : item.collectionName || item.name;
77
+ if (item.associationField) {
73
78
  const field = item.associationField;
74
79
  insert((0, external_createEditFormBlockUISchema_js_namespaceObject.createEditFormBlockUISchema)({
75
80
  dataSource: item.dataSource,
76
81
  association: "".concat(field.collectionName, ".").concat(field.name)
77
82
  }));
78
- } else insert((0, external_createEditFormBlockUISchema_js_namespaceObject.createEditFormBlockUISchema)(association ? {
83
+ } else insert((0, external_createEditFormBlockUISchema_js_namespaceObject.createEditFormBlockUISchema)(association && !actionType ? {
79
84
  association,
80
85
  dataSource: item.dataSource,
81
86
  isCurrent: true
82
87
  } : {
83
- collectionName,
84
- dataSource: item.dataSource
88
+ dataSource: item.dataSource,
89
+ collectionName
85
90
  }));
86
91
  }, [
87
92
  association,
@@ -91,16 +96,18 @@ function useCreateEditFormBlock() {
91
96
  let { item } = param;
92
97
  if ('FormItem' !== item.template.componentName) return templateSchema;
93
98
  {
94
- const blockSchema = (0, external_createEditFormBlockUISchema_js_namespaceObject.createEditFormBlockUISchema)(association ? {
95
- association,
96
- dataSource: item.dataSource,
97
- templateSchema: templateSchema,
98
- isCurrent: true
99
- } : {
100
- collectionName: item.collectionName || item.name,
99
+ const options = {
101
100
  dataSource: item.dataSource,
102
- templateSchema: templateSchema
103
- });
101
+ templateSchema
102
+ };
103
+ if (item.associationField) {
104
+ const field = item.associationField;
105
+ options.association = "".concat(field.collectionName, ".").concat(field.name);
106
+ } else if (association) {
107
+ options.association = association;
108
+ options.isCurrent = true;
109
+ } else options.collectionName = item.collectionName || item.name;
110
+ const blockSchema = (0, external_createEditFormBlockUISchema_js_namespaceObject.createEditFormBlockUISchema)(options);
104
111
  if ('reference' === item.mode) blockSchema['x-template-key'] = item.template.key;
105
112
  return blockSchema;
106
113
  }
@@ -201,7 +201,8 @@ const gridCardBlockSettings = new SchemaSettings_js_namespaceObject.SchemaSettin
201
201
  'x-component-props': {
202
202
  style: {
203
203
  width: 260
204
- }
204
+ },
205
+ optionLabelProp: 'fullLabel'
205
206
  }
206
207
  },
207
208
  direction: {
@@ -145,7 +145,8 @@ const listBlockSettings = new SchemaSettings_js_namespaceObject.SchemaSettings({
145
145
  'x-component-props': {
146
146
  style: {
147
147
  width: 260
148
- }
148
+ },
149
+ optionLabelProp: 'fullLabel'
149
150
  }
150
151
  },
151
152
  direction: {
@@ -74,6 +74,21 @@ const tableActionInitializers = new SchemaInitializer_js_namespaceObject.SchemaI
74
74
  ].includes(collection.template) || (null == collection ? void 0 : collection.writableView);
75
75
  }
76
76
  },
77
+ {
78
+ type: 'item',
79
+ title: "{{t('Associate')}}",
80
+ name: 'associate',
81
+ Component: 'AssociateActionInitializer',
82
+ useVisible () {
83
+ const collection = (0, index_js_namespaceObject.useCollection)();
84
+ const props = (0, index_js_namespaceObject.useDataBlockProps)();
85
+ return props.association && (![
86
+ 'view',
87
+ 'file',
88
+ 'sql'
89
+ ].includes(collection.template) || (null == collection ? void 0 : collection.writableView));
90
+ }
91
+ },
77
92
  {
78
93
  type: 'item',
79
94
  title: "{{t('Delete')}}",
@@ -258,7 +258,8 @@ const tableBlockSettings = new SchemaSettings_js_namespaceObject.SchemaSettings(
258
258
  'x-component-props': {
259
259
  style: {
260
260
  width: 260
261
- }
261
+ },
262
+ optionLabelProp: 'fullLabel'
262
263
  }
263
264
  },
264
265
  direction: {
@@ -142,12 +142,12 @@ const tableColumnSettings = new SchemaSettings_js_namespaceObject.SchemaSettings
142
142
  name: 'sortable',
143
143
  type: 'switch',
144
144
  useVisible () {
145
- const collection = (0, CollectionProvider_js_namespaceObject.useCollection)();
145
+ (0, CollectionProvider_js_namespaceObject.useCollection)();
146
146
  const { collectionField } = (0, Table_Column_Decorator_js_namespaceObject.useColumnSchema)();
147
147
  const { getInterface } = (0, external_collection_manager_index_js_namespaceObject.useCollectionManager_deprecated)();
148
148
  const interfaceCfg = getInterface(null == collectionField ? void 0 : collectionField.interface);
149
149
  const { currentMode } = (0, hooks_js_namespaceObject.useAssociationFieldContext)();
150
- return (null == interfaceCfg ? void 0 : interfaceCfg.sortable) === true && !currentMode && (null == collection ? void 0 : collection.name) === (null == collectionField ? void 0 : collectionField.collectionName);
150
+ return (null == interfaceCfg ? void 0 : interfaceCfg.sortable) === true && !currentMode;
151
151
  },
152
152
  useComponentProps () {
153
153
  const field = (0, schema_namespaceObject.useField)();
@@ -192,7 +192,8 @@ const tableSelectorBlockSettings = new SchemaSettings_js_namespaceObject.SchemaS
192
192
  'x-component-props': {
193
193
  style: {
194
194
  width: 260
195
- }
195
+ },
196
+ optionLabelProp: 'fullLabel'
196
197
  }
197
198
  },
198
199
  direction: {
@@ -118,7 +118,8 @@ const SchemaSettingsSortingRule = function(props) {
118
118
  'x-component-props': {
119
119
  style: {
120
120
  width: 260
121
- }
121
+ },
122
+ optionLabelProp: 'fullLabel'
122
123
  }
123
124
  },
124
125
  direction: {
@@ -54,6 +54,10 @@ const radioComponentFieldSettings = new SchemaSettings_js_namespaceObject.Schema
54
54
  {
55
55
  label: t('Radio group'),
56
56
  value: 'Radio group'
57
+ },
58
+ {
59
+ label: t('Select'),
60
+ value: 'Select'
57
61
  }
58
62
  ];
59
63
  const { dn } = (0, index_js_namespaceObject.useDesignable)();
@@ -318,6 +318,7 @@ const fieldComponent = {
318
318
  useComponentProps () {
319
319
  const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
320
320
  const field = (0, schema_namespaceObject.useField)();
321
+ const collectionFieldCurrent = (0, external_data_source_index_js_namespaceObject.useCollectionField)();
321
322
  const { fieldSchema: tableColumnSchema, collectionField } = (0, Table_Column_Decorator_js_namespaceObject.useColumnSchema)();
322
323
  const schema = (0, schema_namespaceObject.useFieldSchema)();
323
324
  const fieldSchema = tableColumnSchema || schema;
@@ -328,9 +329,22 @@ const fieldComponent = {
328
329
  const isAddNewForm = (0, external_schema_component_index_js_namespaceObject.useIsAddNewForm)();
329
330
  const fieldMode = (0, useFieldComponentName_js_namespaceObject.useFieldComponentName)();
330
331
  const { dn } = (0, external_schema_component_index_js_namespaceObject.useDesignable)();
332
+ const isMuiltipleSelect = [
333
+ 'select'
334
+ ].includes(null == collectionFieldCurrent ? void 0 : collectionFieldCurrent.interface);
335
+ const optionsMuiltipleSelect = [
336
+ {
337
+ label: t('Select'),
338
+ value: 'Select'
339
+ },
340
+ {
341
+ label: t('Radio group'),
342
+ value: 'Radio group'
343
+ }
344
+ ];
331
345
  return {
332
346
  title: t('Field component'),
333
- options: fieldModeOptions,
347
+ options: isMuiltipleSelect ? optionsMuiltipleSelect : fieldModeOptions,
334
348
  value: fieldMode,
335
349
  onChange (mode) {
336
350
  const schema = {
@@ -361,7 +375,7 @@ const selectComponentFieldSettings = new SchemaSettings_js_namespaceObject.Schem
361
375
  items: [
362
376
  {
363
377
  ...fieldComponent,
364
- useVisible: FormItem_Settings_js_namespaceObject.useIsAssociationField
378
+ useVisible: FormItem_Settings_js_namespaceObject.useIsMuiltipleAble
365
379
  },
366
380
  {
367
381
  ...setTheDataScope,
@@ -168,7 +168,8 @@ const setDefaultSortingRules = {
168
168
  'x-component-props': {
169
169
  style: {
170
170
  width: 260
171
- }
171
+ },
172
+ optionLabelProp: 'fullLabel'
172
173
  }
173
174
  },
174
175
  direction: {
@@ -34,6 +34,7 @@ const components_namespaceObject = require("@tachybase/components");
34
34
  const schema_namespaceObject = require("@tachybase/schema");
35
35
  const external_react_i18next_namespaceObject = require("react-i18next");
36
36
  const index_js_namespaceObject = require("../../application/index.js");
37
+ const external_icon_index_js_namespaceObject = require("../../icon/index.js");
37
38
  const external_schema_component_index_js_namespaceObject = require("../../schema-component/index.js");
38
39
  const MenuItemInitializers_index_js_namespaceObject = require("../../schema-component/antd/menu/MenuItemInitializers/index.js");
39
40
  const theme_index_js_namespaceObject = require("../../style/theme/index.js");
@@ -100,7 +101,10 @@ const GroupItem = ()=>{
100
101
  theme
101
102
  ]);
102
103
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.SchemaInitializerItem, {
103
- title: t('Submenu'),
104
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icon_index_js_namespaceObject.Icon, {
105
+ type: 'FolderAddOutlined'
106
+ }),
107
+ title: t('Create group'),
104
108
  onClick: handleClick,
105
109
  className: styles.menuItem
106
110
  });
@@ -34,6 +34,7 @@ const components_namespaceObject = require("@tachybase/components");
34
34
  const schema_namespaceObject = require("@tachybase/schema");
35
35
  const external_react_i18next_namespaceObject = require("react-i18next");
36
36
  const index_js_namespaceObject = require("../../application/index.js");
37
+ const external_icon_index_js_namespaceObject = require("../../icon/index.js");
37
38
  const external_schema_component_index_js_namespaceObject = require("../../schema-component/index.js");
38
39
  const MenuItemInitializers_index_js_namespaceObject = require("../../schema-component/antd/menu/MenuItemInitializers/index.js");
39
40
  const theme_index_js_namespaceObject = require("../../style/theme/index.js");
@@ -106,9 +107,12 @@ const LinkMenuItem = ()=>{
106
107
  theme
107
108
  ]);
108
109
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.SchemaInitializerItem, {
109
- title: t('Link'),
110
- onClick: handleClick,
111
- className: styles.menuItem
110
+ className: styles.menuItem,
111
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icon_index_js_namespaceObject.Icon, {
112
+ type: 'GlobalOutlined'
113
+ }),
114
+ title: t('Create link'),
115
+ onClick: handleClick
112
116
  });
113
117
  };
114
118
  var __webpack_export_target__ = exports;
@@ -34,6 +34,7 @@ const components_namespaceObject = require("@tachybase/components");
34
34
  const schema_namespaceObject = require("@tachybase/schema");
35
35
  const external_react_i18next_namespaceObject = require("react-i18next");
36
36
  const index_js_namespaceObject = require("../../application/index.js");
37
+ const external_icon_index_js_namespaceObject = require("../../icon/index.js");
37
38
  const external_schema_component_index_js_namespaceObject = require("../../schema-component/index.js");
38
39
  const MenuItemInitializers_index_js_namespaceObject = require("../../schema-component/antd/menu/MenuItemInitializers/index.js");
39
40
  const theme_index_js_namespaceObject = require("../../style/theme/index.js");
@@ -115,7 +116,10 @@ const PageMenuItem = ()=>{
115
116
  theme
116
117
  ]);
117
118
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.SchemaInitializerItem, {
118
- title: t('Page'),
119
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icon_index_js_namespaceObject.Icon, {
120
+ type: 'FileOutlined'
121
+ }),
122
+ title: t('Create page'),
119
123
  onClick: handleClick,
120
124
  className: styles.menuItem
121
125
  });
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = function(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 = function(obj, prop) {
13
+ return Object.prototype.hasOwnProperty.call(obj, prop);
14
+ };
15
+ })();
16
+ (()=>{
17
+ __webpack_require__.r = function(exports1) {
18
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
19
+ value: 'Module'
20
+ });
21
+ Object.defineProperty(exports1, '__esModule', {
22
+ value: true
23
+ });
24
+ };
25
+ })();
26
+ var __webpack_exports__ = {};
27
+ __webpack_require__.r(__webpack_exports__);
28
+ __webpack_require__.d(__webpack_exports__, {
29
+ UploadMenuItem: ()=>UploadMenuItem
30
+ });
31
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
32
+ const external_react_namespaceObject = require("react");
33
+ const components_namespaceObject = require("@tachybase/components");
34
+ const schema_namespaceObject = require("@tachybase/schema");
35
+ const external_react_i18next_namespaceObject = require("react-i18next");
36
+ const useAPIClient_js_namespaceObject = require("../../api-client/hooks/useAPIClient.js");
37
+ const index_js_namespaceObject = require("../../application/index.js");
38
+ const external_icon_index_js_namespaceObject = require("../../icon/index.js");
39
+ const external_schema_component_index_js_namespaceObject = require("../../schema-component/index.js");
40
+ const MenuItemInitializers_index_js_namespaceObject = require("../../schema-component/antd/menu/MenuItemInitializers/index.js");
41
+ const theme_index_js_namespaceObject = require("../../style/theme/index.js");
42
+ const UploadMenuItem = ()=>{
43
+ const { insert } = (0, index_js_namespaceObject.useSchemaInitializer)();
44
+ const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
45
+ const options = (0, external_react_namespaceObject.useContext)(schema_namespaceObject.SchemaOptionsContext);
46
+ const { theme } = (0, theme_index_js_namespaceObject.useGlobalTheme)();
47
+ const { styles } = (0, MenuItemInitializers_index_js_namespaceObject.useStyles)();
48
+ (0, useAPIClient_js_namespaceObject.useAPIClient)();
49
+ const handleClick = (0, external_react_namespaceObject.useCallback)(async ()=>{
50
+ const values = await (0, external_schema_component_index_js_namespaceObject.FormDialog)(t('Load menu config'), ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_component_index_js_namespaceObject.SchemaComponentOptions, {
51
+ scope: options.scope,
52
+ components: {
53
+ ...options.components
54
+ },
55
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(components_namespaceObject.FormLayout, {
56
+ layout: 'vertical',
57
+ children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_schema_component_index_js_namespaceObject.SchemaComponent, {
58
+ schema: {
59
+ type: 'object',
60
+ title: t('Load menu config'),
61
+ properties: {
62
+ title: {
63
+ 'x-decorator': 'FormItem',
64
+ 'x-component': 'Input',
65
+ title: t('Menu item title'),
66
+ required: true,
67
+ 'x-component-props': {}
68
+ },
69
+ bindMenuToRole: {
70
+ type: 'boolean',
71
+ title: '{{ t("Automatically assign permissions to all matching roles") }}',
72
+ 'x-decorator': 'FormItem',
73
+ 'x-component': 'Checkbox',
74
+ default: true
75
+ },
76
+ file: {
77
+ type: 'object',
78
+ title: '{{ t("File") }}',
79
+ required: true,
80
+ 'x-decorator': 'FormItem',
81
+ 'x-component': 'Upload.Attachment',
82
+ 'x-component-props': {
83
+ action: 'attachments:create',
84
+ multiple: false
85
+ }
86
+ }
87
+ }
88
+ }
89
+ })
90
+ })
91
+ }), theme).open({
92
+ initialValues: {}
93
+ });
94
+ const { title, icon } = values;
95
+ }, [
96
+ insert,
97
+ options.components,
98
+ options.scope,
99
+ t,
100
+ theme
101
+ ]);
102
+ return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_js_namespaceObject.SchemaInitializerItem, {
103
+ className: styles.menuItem,
104
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icon_index_js_namespaceObject.Icon, {
105
+ type: 'UploadOutlined'
106
+ }),
107
+ title: t('Load menu config'),
108
+ onClick: handleClick
109
+ });
110
+ };
111
+ var __webpack_export_target__ = exports;
112
+ for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
113
+ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
114
+ value: true
115
+ });