@tachybase/client 0.23.22 → 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.
- package/es/application/schema-initializer/components/SchemaInitializerChildren.mjs +1 -1
- package/es/built-in/admin-layout/InternalAdminLayout.mjs +4 -2
- package/es/built-in/admin-layout/MenuEditor.mjs +2 -2
- package/es/built-in/admin-layout/style.d.ts +1 -1
- package/es/built-in/admin-layout/style.mjs +4 -4
- package/es/built-in/assistant/Assistant.provider.d.ts +0 -6
- package/es/built-in/assistant/Assistant.provider.mjs +15 -112
- package/es/built-in/assistant/index.d.ts +0 -1
- package/es/built-in/assistant/index.mjs +0 -7
- package/es/built-in/attachment-preview/previewers/file-pdf.mjs +4 -2
- package/es/built-in/context-menu/ContextMenu.provider.d.ts +1 -0
- package/es/built-in/context-menu/ContextMenu.provider.mjs +29 -1
- package/es/built-in/context-menu/index.mjs +1 -0
- package/es/built-in/index.mjs +44 -5
- package/es/built-in/page-style/TabHeader.d.ts +1 -1
- package/es/built-in/page-style/TabHeader.mjs +26 -33
- package/es/built-in/page-style/TabHeader.style.d.ts +4 -0
- package/es/built-in/page-style/TabHeader.style.mjs +35 -0
- package/es/built-in/pinned-list/PinnedPluginListProvider.d.ts +3 -1
- package/es/built-in/pinned-list/PinnedPluginListProvider.mjs +5 -4
- package/es/built-in/scroll-assistant/useJoystick.mjs +3 -1
- package/es/built-in/setting-layout/SettingLayout.mjs +10 -1
- package/es/built-in/{assistant/calculator → setting-layout}/style.d.ts +1 -1
- package/es/built-in/setting-layout/style.mjs +25 -0
- package/es/collection-manager/action-hooks.d.ts +1 -4
- package/es/collection-manager/action-hooks.mjs +39 -11
- package/es/icon/preloaded.mjs +4 -4
- package/es/modules/actions/associate/AssociateActionInitializer.d.ts +1 -0
- package/es/modules/actions/associate/AssociateActionInitializer.mjs +71 -0
- package/es/modules/actions/associate/AssociateActionProvider.d.ts +7 -0
- package/es/modules/actions/associate/AssociateActionProvider.mjs +82 -0
- package/es/modules/actions/associate/AssociateActionSettings.d.ts +2 -0
- package/es/modules/actions/associate/AssociateActionSettings.mjs +57 -0
- package/es/modules/blocks/data-blocks/details-multi/detailsWithPaginationSettings.mjs +2 -1
- package/es/modules/blocks/data-blocks/form/RecordFormBlockInitializer.mjs +21 -14
- package/es/modules/blocks/data-blocks/form/createEditFormBlockUISchema.d.ts +1 -2
- package/es/modules/blocks/data-blocks/grid-card/gridCardBlockSettings.mjs +2 -1
- package/es/modules/blocks/data-blocks/list/listBlockSettings.mjs +2 -1
- package/es/modules/blocks/data-blocks/table/TableActionInitializers.mjs +15 -0
- package/es/modules/blocks/data-blocks/table/tableBlockSettings.mjs +2 -1
- package/es/modules/blocks/data-blocks/table/tableColumnSettings.mjs +2 -2
- package/es/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.mjs +2 -1
- package/es/modules/fields/component/Cascader/cascaderComponentFieldSettings.mjs +2 -1
- package/es/modules/fields/component/Radio/radioComponentFieldSettings.mjs +4 -0
- package/es/modules/fields/component/Select/selectComponentFieldSettings.mjs +16 -2
- package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.mjs +2 -1
- package/es/modules/menu/GroupItem.mjs +5 -1
- package/es/modules/menu/LinkMenuItem.mjs +7 -3
- package/es/modules/menu/PageMenuItem.mjs +5 -1
- package/es/modules/menu/UploadMenuItem.d.ts +1 -0
- package/es/modules/menu/UploadMenuItem.mjs +81 -0
- package/es/modules/menu/menuItemInitializer.d.ts +0 -4
- package/es/modules/menu/menuItemInitializer.mjs +3 -23
- package/es/schema-component/antd/action/Action.Designer.mjs +4 -1
- package/es/schema-component/antd/association-select/AssociationSelect.mjs +4 -2
- package/es/schema-component/antd/checkbox/Checkbox.mjs +11 -6
- package/es/schema-component/antd/date-picker/DatePicker.mjs +4 -0
- package/es/schema-component/antd/form-item/FormItem.Settings.d.ts +2 -0
- package/es/schema-component/antd/form-item/FormItem.Settings.mjs +14 -1
- package/es/schema-component/antd/form-v2/Form.Settings.mjs +2 -1
- package/es/schema-component/antd/grid-card/GridCard.Designer.mjs +2 -1
- package/es/schema-component/antd/list/List.Designer.mjs +2 -1
- package/es/schema-component/antd/menu/AdminMenu.d.ts +1 -0
- package/es/schema-component/antd/menu/AdminMenu.mjs +71 -0
- package/es/schema-component/antd/menu/AdminMenu.style.d.ts +4 -0
- package/es/schema-component/antd/menu/AdminMenu.style.mjs +36 -0
- package/es/schema-component/antd/menu/Menu.Designer.d.ts +1 -1
- package/es/schema-component/antd/menu/Menu.Designer.mjs +59 -40
- package/es/schema-component/antd/menu/Menu.mjs +108 -141
- package/es/schema-component/antd/menu/Menu.styles.d.ts +1 -2
- package/es/schema-component/antd/menu/Menu.styles.mjs +8 -20
- package/es/schema-component/antd/menu/MenuSearch.d.ts +5 -0
- package/es/schema-component/antd/menu/MenuSearch.mjs +32 -0
- package/es/schema-component/antd/menu/tools.d.ts +9 -0
- package/es/schema-component/antd/menu/tools.mjs +36 -0
- package/es/schema-component/antd/scroll-area/ScrollArea.mjs +0 -17
- package/es/schema-component/antd/select/Select.d.ts +3 -13
- package/es/schema-component/antd/select/Select.mjs +33 -2
- package/es/schema-component/antd/table/Table.Void.Designer.mjs +2 -1
- package/es/schema-component/antd/table-v2/TableBlockDesigner.mjs +2 -1
- package/es/schema-component/antd/table-v2/TableSelectorDesigner.mjs +2 -1
- package/es/schema-component/common/dnd-context/index.d.ts +1 -2
- package/es/schema-component/common/sortable-item/DragHandleMenu.d.ts +1 -0
- package/es/schema-component/common/sortable-item/DragHandleMenu.mjs +78 -0
- package/es/schema-component/common/sortable-item/DragHandleMenu.style.d.ts +3 -0
- package/es/schema-component/common/sortable-item/DragHandleMenu.style.mjs +25 -0
- package/es/schema-initializer/SchemaInitializerPlugin.mjs +5 -2
- package/es/schema-initializer/utils.mjs +9 -7
- package/es/schema-settings/GeneralSchemaDesigner.d.ts +2 -1
- package/es/schema-settings/GeneralSchemaDesigner.mjs +9 -1
- package/es/schema-settings/SchemaSettings.d.ts +3 -1
- package/es/schema-settings/SchemaSettings.mjs +16 -4
- package/es/schema-settings/SchemaSettingsPlugin.mjs +2 -0
- package/es/schema-settings/SchemaSettingsSortingRule.mjs +2 -1
- package/es/schema-settings/styles.mjs +2 -2
- package/lib/application/schema-initializer/components/SchemaInitializerChildren.js +1 -1
- package/lib/built-in/admin-layout/InternalAdminLayout.js +4 -2
- package/lib/built-in/admin-layout/MenuEditor.js +2 -2
- package/lib/built-in/admin-layout/style.js +4 -4
- package/lib/built-in/assistant/Assistant.provider.js +16 -115
- package/lib/built-in/assistant/index.js +3 -16
- package/lib/built-in/attachment-preview/previewers/file-pdf.js +4 -2
- package/lib/built-in/context-menu/ContextMenu.provider.js +29 -0
- package/lib/built-in/context-menu/index.js +1 -0
- package/lib/built-in/index.js +44 -5
- package/lib/built-in/page-style/TabHeader.js +26 -33
- package/lib/built-in/page-style/TabHeader.style.js +69 -0
- package/lib/built-in/pinned-list/PinnedPluginListProvider.js +5 -4
- package/lib/built-in/scroll-assistant/useJoystick.js +17 -1
- package/lib/built-in/setting-layout/SettingLayout.js +10 -1
- package/lib/built-in/{assistant/calculator/CalculatorKey.js → setting-layout/style.js} +25 -11
- package/lib/collection-manager/action-hooks.js +39 -11
- package/lib/icon/preloaded.js +4 -4
- package/lib/locale/en_US.js +8 -0
- package/lib/locale/zh-CN.js +8 -0
- package/lib/modules/actions/associate/AssociateActionInitializer.js +105 -0
- package/lib/modules/actions/associate/AssociateActionProvider.js +116 -0
- package/lib/modules/actions/associate/AssociateActionSettings.js +91 -0
- package/lib/modules/blocks/data-blocks/details-multi/detailsWithPaginationSettings.js +2 -1
- package/lib/modules/blocks/data-blocks/form/RecordFormBlockInitializer.js +21 -14
- package/lib/modules/blocks/data-blocks/grid-card/gridCardBlockSettings.js +2 -1
- package/lib/modules/blocks/data-blocks/list/listBlockSettings.js +2 -1
- package/lib/modules/blocks/data-blocks/table/TableActionInitializers.js +15 -0
- package/lib/modules/blocks/data-blocks/table/tableBlockSettings.js +2 -1
- package/lib/modules/blocks/data-blocks/table/tableColumnSettings.js +2 -2
- package/lib/modules/blocks/data-blocks/table-selector/tableSelectorBlockSettings.js +2 -1
- package/lib/modules/fields/component/Cascader/cascaderComponentFieldSettings.js +2 -1
- package/lib/modules/fields/component/Radio/radioComponentFieldSettings.js +4 -0
- package/lib/modules/fields/component/Select/selectComponentFieldSettings.js +16 -2
- package/lib/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.js +2 -1
- package/lib/modules/menu/GroupItem.js +5 -1
- package/lib/modules/menu/LinkMenuItem.js +7 -3
- package/lib/modules/menu/PageMenuItem.js +5 -1
- package/lib/modules/menu/UploadMenuItem.js +115 -0
- package/lib/modules/menu/menuItemInitializer.js +2 -23
- package/lib/schema-component/antd/action/Action.Designer.js +4 -1
- package/lib/schema-component/antd/association-select/AssociationSelect.js +4 -2
- package/lib/schema-component/antd/checkbox/Checkbox.js +11 -6
- package/lib/schema-component/antd/date-picker/DatePicker.js +4 -0
- package/lib/schema-component/antd/form-item/FormItem.Settings.js +16 -1
- package/lib/schema-component/antd/form-v2/Form.Settings.js +2 -1
- package/lib/schema-component/antd/grid-card/GridCard.Designer.js +2 -1
- package/lib/schema-component/antd/list/List.Designer.js +2 -1
- package/lib/schema-component/antd/menu/AdminMenu.js +105 -0
- package/lib/schema-component/antd/menu/AdminMenu.style.js +70 -0
- package/lib/schema-component/antd/menu/Menu.Designer.js +59 -40
- package/lib/schema-component/antd/menu/Menu.js +108 -141
- package/lib/schema-component/antd/menu/Menu.styles.js +8 -20
- package/lib/schema-component/antd/menu/MenuSearch.js +80 -0
- package/lib/schema-component/antd/menu/tools.js +72 -0
- package/lib/schema-component/antd/scroll-area/ScrollArea.js +0 -17
- package/lib/schema-component/antd/select/Select.js +33 -2
- package/lib/schema-component/antd/table/Table.Void.Designer.js +2 -1
- package/lib/schema-component/antd/table-v2/TableBlockDesigner.js +2 -1
- package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +2 -1
- package/lib/schema-component/common/sortable-item/DragHandleMenu.js +112 -0
- package/lib/schema-component/common/sortable-item/DragHandleMenu.style.js +59 -0
- package/lib/schema-initializer/SchemaInitializerPlugin.js +5 -2
- package/lib/schema-initializer/utils.js +9 -7
- package/lib/schema-settings/GeneralSchemaDesigner.js +9 -1
- package/lib/schema-settings/SchemaSettings.js +16 -4
- package/lib/schema-settings/SchemaSettingsPlugin.js +2 -0
- package/lib/schema-settings/SchemaSettingsSortingRule.js +2 -1
- package/lib/schema-settings/styles.js +2 -2
- package/package.json +8 -7
- package/es/built-in/assistant/calculator/AutoScalingText.d.ts +0 -3
- package/es/built-in/assistant/calculator/AutoScalingText.mjs +0 -33
- package/es/built-in/assistant/calculator/Calculator.d.ts +0 -2
- package/es/built-in/assistant/calculator/Calculator.mjs +0 -235
- package/es/built-in/assistant/calculator/CalculatorDisplay.d.ts +0 -4
- package/es/built-in/assistant/calculator/CalculatorDisplay.mjs +0 -21
- package/es/built-in/assistant/calculator/CalculatorKey.d.ts +0 -5
- package/es/built-in/assistant/calculator/CalculatorKey.mjs +0 -11
- package/es/built-in/assistant/calculator/CalculatorProvider.d.ts +0 -10
- package/es/built-in/assistant/calculator/CalculatorProvider.mjs +0 -29
- package/es/built-in/assistant/calculator/Draggable.d.ts +0 -8
- package/es/built-in/assistant/calculator/Draggable.mjs +0 -54
- package/es/built-in/assistant/calculator/style.mjs +0 -25
- package/es/built-in/assistant/search-and-jump/index.d.ts +0 -16
- package/es/built-in/assistant/search-and-jump/index.mjs +0 -59
- package/lib/built-in/assistant/calculator/AutoScalingText.js +0 -67
- package/lib/built-in/assistant/calculator/Calculator.js +0 -283
- package/lib/built-in/assistant/calculator/CalculatorDisplay.js +0 -55
- package/lib/built-in/assistant/calculator/CalculatorProvider.js +0 -65
- package/lib/built-in/assistant/calculator/Draggable.js +0 -102
- package/lib/built-in/assistant/calculator/style.js +0 -59
- package/lib/built-in/assistant/search-and-jump/index.js +0 -96
|
@@ -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
|
+
});
|
|
@@ -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
|
|
72
|
-
|
|
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
|
-
|
|
84
|
-
|
|
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
|
|
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
|
|
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
|
}
|
|
@@ -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')}}",
|
|
@@ -142,12 +142,12 @@ const tableColumnSettings = new SchemaSettings_js_namespaceObject.SchemaSettings
|
|
|
142
142
|
name: 'sortable',
|
|
143
143
|
type: 'switch',
|
|
144
144
|
useVisible () {
|
|
145
|
-
|
|
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
|
|
150
|
+
return (null == interfaceCfg ? void 0 : interfaceCfg.sortable) === true && !currentMode;
|
|
151
151
|
},
|
|
152
152
|
useComponentProps () {
|
|
153
153
|
const field = (0, schema_namespaceObject.useField)();
|
|
@@ -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.
|
|
378
|
+
useVisible: FormItem_Settings_js_namespaceObject.useIsMuiltipleAble
|
|
365
379
|
},
|
|
366
380
|
{
|
|
367
381
|
...setTheDataScope,
|
|
@@ -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
|
-
|
|
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
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
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
|
+
});
|
|
@@ -26,15 +26,14 @@ var __webpack_require__ = {};
|
|
|
26
26
|
var __webpack_exports__ = {};
|
|
27
27
|
__webpack_require__.r(__webpack_exports__);
|
|
28
28
|
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
-
menuItemInitializer_deprecated: ()=>menuItemInitializer_deprecated,
|
|
30
29
|
menuItemInitializer: ()=>menuItemInitializer
|
|
31
30
|
});
|
|
32
31
|
const SchemaInitializer_js_namespaceObject = require("../../application/schema-initializer/SchemaInitializer.js");
|
|
33
32
|
const external_GroupItem_js_namespaceObject = require("./GroupItem.js");
|
|
34
33
|
const external_LinkMenuItem_js_namespaceObject = require("./LinkMenuItem.js");
|
|
35
34
|
const external_PageMenuItem_js_namespaceObject = require("./PageMenuItem.js");
|
|
36
|
-
const
|
|
37
|
-
name: '
|
|
35
|
+
const menuItemInitializer = new SchemaInitializer_js_namespaceObject.SchemaInitializer({
|
|
36
|
+
name: 'menuInitializers:menuItem',
|
|
38
37
|
insertPosition: 'beforeEnd',
|
|
39
38
|
icon: 'PlusOutlined',
|
|
40
39
|
title: '{{t("Add menu item")}}',
|
|
@@ -56,26 +55,6 @@ const menuItemInitializer_deprecated = new SchemaInitializer_js_namespaceObject.
|
|
|
56
55
|
}
|
|
57
56
|
]
|
|
58
57
|
});
|
|
59
|
-
const menuItemInitializer = new SchemaInitializer_js_namespaceObject.SchemaInitializer({
|
|
60
|
-
name: 'menuInitializers:menuItem',
|
|
61
|
-
insertPosition: 'beforeEnd',
|
|
62
|
-
icon: 'PlusOutlined',
|
|
63
|
-
title: '{{t("Add menu item")}}',
|
|
64
|
-
items: [
|
|
65
|
-
{
|
|
66
|
-
name: 'submenu',
|
|
67
|
-
Component: external_GroupItem_js_namespaceObject.GroupItem
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'page',
|
|
71
|
-
Component: external_PageMenuItem_js_namespaceObject.PageMenuItem
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: 'link',
|
|
75
|
-
Component: external_LinkMenuItem_js_namespaceObject.LinkMenuItem
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
});
|
|
79
58
|
var __webpack_export_target__ = exports;
|
|
80
59
|
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
81
60
|
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
@@ -236,7 +236,10 @@ function SkipValidation() {
|
|
|
236
236
|
}
|
|
237
237
|
const findSchema = (schema)=>{
|
|
238
238
|
if (!schema) return;
|
|
239
|
-
if ('ACLActionProvider' === schema['x-decorator'])
|
|
239
|
+
if ('ACLActionProvider' === schema['x-decorator']) {
|
|
240
|
+
var _schema_xcomponentprops;
|
|
241
|
+
return null === (_schema_xcomponentprops = schema['x-component-props']) || void 0 === _schema_xcomponentprops ? void 0 : _schema_xcomponentprops.openMode;
|
|
242
|
+
}
|
|
240
243
|
return findSchema(null == schema ? void 0 : schema.parent);
|
|
241
244
|
};
|
|
242
245
|
function AfterSuccess() {
|
|
@@ -431,7 +431,8 @@ AssociationSelect.Designer = function() {
|
|
|
431
431
|
'x-component-props': {
|
|
432
432
|
style: {
|
|
433
433
|
width: 260
|
|
434
|
-
}
|
|
434
|
+
},
|
|
435
|
+
optionLabelProp: 'fullLabel'
|
|
435
436
|
}
|
|
436
437
|
},
|
|
437
438
|
direction: {
|
|
@@ -814,7 +815,8 @@ AssociationSelect.FilterDesigner = function() {
|
|
|
814
815
|
'x-component-props': {
|
|
815
816
|
style: {
|
|
816
817
|
width: 260
|
|
817
|
-
}
|
|
818
|
+
},
|
|
819
|
+
optionLabelProp: 'fullLabel'
|
|
818
820
|
}
|
|
819
821
|
},
|
|
820
822
|
direction: {
|
|
@@ -100,12 +100,17 @@ const InternalRadioGroup = (0, schema_namespaceObject.connect)((props)=>{
|
|
|
100
100
|
});
|
|
101
101
|
}, (0, schema_namespaceObject.mapReadPretty)(ReadPretty));
|
|
102
102
|
const Checkbox = (props)=>{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
switch(props.mode){
|
|
104
|
+
case 'Radio group':
|
|
105
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InternalRadioGroup, {
|
|
106
|
+
...props
|
|
107
|
+
});
|
|
108
|
+
case 'Checkbox':
|
|
109
|
+
default:
|
|
110
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(InternalCheckbox, {
|
|
111
|
+
...props
|
|
112
|
+
});
|
|
113
|
+
}
|
|
109
114
|
};
|
|
110
115
|
Checkbox.ReadPretty = ReadPretty;
|
|
111
116
|
Checkbox.__ANT_CHECKBOX = true;
|
|
@@ -88,6 +88,10 @@ DatePicker.RangePicker = function(props) {
|
|
|
88
88
|
external_dayjs_default()(originValue[1].value).add(-1, 'd').toISOString()
|
|
89
89
|
];
|
|
90
90
|
props.onChange = (value)=>{
|
|
91
|
+
if (!value || !value.length) {
|
|
92
|
+
originOnChange(null);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
91
95
|
originOnChange([
|
|
92
96
|
{
|
|
93
97
|
value: external_dayjs_default()(value[0]).toISOString(),
|