@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
|
@@ -9,7 +9,7 @@ function _tagged_template_literal(strings, raw) {
|
|
|
9
9
|
}
|
|
10
10
|
function _templateObject() {
|
|
11
11
|
const data = _tagged_template_literal([
|
|
12
|
-
"\n position: relative;\n display:
|
|
12
|
+
"\n position: relative;\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-items: center;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &:hover {\n .general-schema-designer {\n display: flex;\n }\n .ant-space-item:hover {\n border-radius: 5px;\n background-color: var(--colorSettings);\n color: #fff;\n }\n }\n &.tb-action-link {\n > .general-schema-designer {\n top: -10px;\n bottom: -10px;\n left: -10px;\n right: -10px;\n }\n }\n .submenu-title {\n display: flex;\n flex-direction: row;\n\n width: 100%;\n vertical-align: middle;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .general-schema-designer {\n flex: 1;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n pointer-events: none;\n display: none;\n .general-schema-designer-icons {\n pointer-events: all;\n .ant-space-item {\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n "
|
|
13
13
|
]);
|
|
14
14
|
_templateObject = function() {
|
|
15
15
|
return data;
|
|
@@ -18,7 +18,7 @@ function _templateObject() {
|
|
|
18
18
|
}
|
|
19
19
|
function _templateObject1() {
|
|
20
20
|
const data = _tagged_template_literal([
|
|
21
|
-
"\n position: relative;\n display: flex;\n justify-content:
|
|
21
|
+
"\n position: relative;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n width: 100%;\n\n &:hover {\n .general-schema-designer {\n display: flex;\n }\n .ant-space-item:hover {\n border-radius: 5px;\n background-color: var(--colorSettings);\n color: #fff;\n }\n }\n &.tb-action-link {\n > .general-schema-designer {\n top: -10px;\n bottom: -10px;\n left: -10px;\n right: -10px;\n }\n }\n\n .menuitem-title-wrapper {\n display: flex;\n flex-direction: row;\n width: 100%;\n overflow: hidden;\n }\n .menuitem-title {\n vertical-align: middle;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n .general-schema-designer {\n flex: 1;\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n display: none;\n pointer-events: none;\n > .general-schema-designer-icons {\n pointer-events: all;\n .ant-space-item {\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n "
|
|
22
22
|
]);
|
|
23
23
|
_templateObject1 = function() {
|
|
24
24
|
return data;
|
|
@@ -27,7 +27,7 @@ function _templateObject1() {
|
|
|
27
27
|
}
|
|
28
28
|
function _templateObject2() {
|
|
29
29
|
const data = _tagged_template_literal([
|
|
30
|
-
"\n .ant-menu-
|
|
30
|
+
"\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: var(--colorPrimaryText);\n\n /* 使用 clip-path 裁剪为梯形 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\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 "
|
|
31
31
|
]);
|
|
32
32
|
_templateObject2 = function() {
|
|
33
33
|
return data;
|
|
@@ -36,7 +36,7 @@ function _templateObject2() {
|
|
|
36
36
|
}
|
|
37
37
|
function _templateObject3() {
|
|
38
38
|
const data = _tagged_template_literal([
|
|
39
|
-
"\n
|
|
39
|
+
"\n :active {\n background: inherit;\n }\n "
|
|
40
40
|
]);
|
|
41
41
|
_templateObject3 = function() {
|
|
42
42
|
return data;
|
|
@@ -45,33 +45,21 @@ function _templateObject3() {
|
|
|
45
45
|
}
|
|
46
46
|
function _templateObject4() {
|
|
47
47
|
const data = _tagged_template_literal([
|
|
48
|
-
"\n :
|
|
48
|
+
"\n display: flex;\n "
|
|
49
49
|
]);
|
|
50
50
|
_templateObject4 = function() {
|
|
51
51
|
return data;
|
|
52
52
|
};
|
|
53
53
|
return data;
|
|
54
54
|
}
|
|
55
|
-
function _templateObject5() {
|
|
56
|
-
const data = _tagged_template_literal([
|
|
57
|
-
"\n &:hover {\n border-radius: ",
|
|
58
|
-
"px;\n background: rgba(0, 0, 0, 0.045);\n overflow: hidden;\n }\n .ant-btn {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n border: none;\n box-shadow: none;\n padding-left: 0;\n padding-right: 0;\n width: 100%;\n span {\n display: block;\n text-align: center;\n font-size: ",
|
|
59
|
-
"px;\n }\n .anticon {\n font-size: 1.2rem;\n margin-bottom: 0.3rem;\n text-align: center;\n }\n }\n .ant-btn-default {\n box-shadow: none;\n }\n .general-schema-designer {\n background: none;\n }\n "
|
|
60
|
-
]);
|
|
61
|
-
_templateObject5 = function() {
|
|
62
|
-
return data;
|
|
63
|
-
};
|
|
64
|
-
return data;
|
|
65
|
-
}
|
|
66
55
|
const useStyles = (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.createStyles)((param)=>{
|
|
67
56
|
let { css, token } = param;
|
|
68
57
|
return {
|
|
69
58
|
subMenuDesignerCss: css(_templateObject()),
|
|
70
59
|
designerCss: css(_templateObject1()),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
menuItem: css(_templateObject5(), token.borderRadius, token.fontSizeSM)
|
|
60
|
+
sideMenuClass: css(_templateObject2()),
|
|
61
|
+
menuItemClass: css(_templateObject3()),
|
|
62
|
+
headerMenuClass: css(_templateObject4())
|
|
75
63
|
};
|
|
76
64
|
});
|
|
77
65
|
export { useStyles };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../../../index.mjs";
|
|
5
|
+
const MenuSearch = (props)=>{
|
|
6
|
+
const { setSearchMenuTitle } = props;
|
|
7
|
+
const { t } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useTranslation)();
|
|
8
|
+
const debounceChangeValue = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].debounce((value)=>{
|
|
9
|
+
setSearchMenuTitle(value);
|
|
10
|
+
}, 500);
|
|
11
|
+
const handleSearch = (value, event)=>{
|
|
12
|
+
event.stopPropagation();
|
|
13
|
+
debounceChangeValue(value.trim());
|
|
14
|
+
};
|
|
15
|
+
const handleClear = (event)=>{
|
|
16
|
+
if ('' === event.target.value) {
|
|
17
|
+
event.stopPropagation();
|
|
18
|
+
debounceChangeValue('');
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Input.Search, {
|
|
22
|
+
style: {
|
|
23
|
+
width: '100%'
|
|
24
|
+
},
|
|
25
|
+
allowClear: true,
|
|
26
|
+
placeholder: t('search Menu'),
|
|
27
|
+
prefix: null,
|
|
28
|
+
onSearch: handleSearch,
|
|
29
|
+
onChange: handleClear
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export { MenuSearch };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Schema } from '@tachybase/schema';
|
|
2
|
+
/**
|
|
3
|
+
* 从原始 schema JSON 数据出, 构造平铺的 json
|
|
4
|
+
* Creates a new flattened menu schema filtered by the search title
|
|
5
|
+
* @param sideMenuSchema - The original menu schema to process
|
|
6
|
+
* @param searchMenuTitle - The title to filter menu items by
|
|
7
|
+
* @returns A new Schema with filtered menu items
|
|
8
|
+
*/
|
|
9
|
+
export declare function getNewSideMenuSchema(sideMenuSchema: Schema, searchMenuTitle: string): Schema;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
function getNewSideMenuSchema(sideMenuSchema, searchMenuTitle) {
|
|
2
|
+
const newSchema = flattenAndFilterJson(sideMenuSchema, searchMenuTitle);
|
|
3
|
+
return newSchema;
|
|
4
|
+
}
|
|
5
|
+
function flattenAndFilterJson(data, targetTitle) {
|
|
6
|
+
const { title, properties, ...rest } = data;
|
|
7
|
+
const result = {
|
|
8
|
+
title,
|
|
9
|
+
...rest,
|
|
10
|
+
properties: {}
|
|
11
|
+
};
|
|
12
|
+
const traverse = (node)=>{
|
|
13
|
+
if (!node) return;
|
|
14
|
+
const isSubMenu = 'Menu.SubMenu' === node['x-component'];
|
|
15
|
+
if (!isSubMenu) {
|
|
16
|
+
if ('string' == typeof (null == node ? void 0 : node.title) && node.title.includes(targetTitle)) result.properties[node.name] = {
|
|
17
|
+
...node
|
|
18
|
+
};
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (!node.properties) return;
|
|
22
|
+
Object.values(node.properties).forEach((child)=>{
|
|
23
|
+
const isSubMenu = 'Menu.SubMenu' === child['x-component'];
|
|
24
|
+
if (isSubMenu) traverse(child);
|
|
25
|
+
else {
|
|
26
|
+
var _child_title;
|
|
27
|
+
if (null == child ? void 0 : null === (_child_title = child.title) || void 0 === _child_title ? void 0 : _child_title.includes(targetTitle)) result.properties[child.name] = {
|
|
28
|
+
...child
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
traverse(data);
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
export { getNewSideMenuSchema };
|
|
@@ -6,23 +6,6 @@ const ScrollArea = ()=>{
|
|
|
6
6
|
const ref = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
|
|
7
7
|
const { t } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useTranslation)();
|
|
8
8
|
(0, __WEBPACK_EXTERNAL_MODULE__built_in_scroll_assistant_useJoystick_mjs__.useJoystick)(ref);
|
|
9
|
-
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
10
|
-
const child = ref.current;
|
|
11
|
-
const handlerScroll = (e)=>{
|
|
12
|
-
if (e.target === child) {
|
|
13
|
-
e.preventDefault();
|
|
14
|
-
e.stopPropagation();
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
if (child) child.addEventListener('mousewheel', handlerScroll, {
|
|
18
|
-
passive: false
|
|
19
|
-
});
|
|
20
|
-
return ()=>{
|
|
21
|
-
if (child) child.removeEventListener('mousewheel', handlerScroll);
|
|
22
|
-
};
|
|
23
|
-
}, [
|
|
24
|
-
ref
|
|
25
|
-
]);
|
|
26
9
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
27
10
|
ref: ref,
|
|
28
11
|
style: {
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { FieldNames } from './utils';
|
|
5
|
-
declare const InternalSelect: React.ForwardRefExoticComponent<Partial<SelectProps<any, any> & {
|
|
6
|
-
objectValue?: boolean;
|
|
7
|
-
onChange?: (v: any) => void;
|
|
8
|
-
multiple: boolean;
|
|
9
|
-
rawOptions: any[];
|
|
10
|
-
fieldNames: FieldNames;
|
|
11
|
-
}> & React.RefAttributes<unknown>>;
|
|
12
|
-
export declare const Select: typeof InternalSelect & {
|
|
13
|
-
ReadPretty: typeof ReadPretty;
|
|
1
|
+
export declare const Select: {
|
|
2
|
+
(props: any): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
ReadPretty: import("react").MemoExoticComponent<import("@tachybase/schema").ReactFC<Omit<any, "ref">>>;
|
|
14
4
|
};
|
|
15
5
|
export default Select;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
2
|
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
|
|
4
3
|
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_utils_client__ from "@tachybase/utils/client";
|
|
5
4
|
import * as __WEBPACK_EXTERNAL_MODULE__ant_design_icons__ from "@ant-design/icons";
|
|
@@ -149,7 +148,39 @@ const InternalSelect = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.connect
|
|
|
149
148
|
},
|
|
150
149
|
suffixIcon: (null == field ? void 0 : field['loading']) || (null == field ? void 0 : field['validating']) ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.LoadingOutlined, {}) : props.suffixIcon
|
|
151
150
|
})), (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.mapReadPretty)(__WEBPACK_EXTERNAL_MODULE__ReadPretty_mjs__.ReadPretty));
|
|
152
|
-
const
|
|
151
|
+
const InternalRadioGroup = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.connect)((props)=>{
|
|
152
|
+
const { options, value, onChange } = props;
|
|
153
|
+
const handleCancel = (e)=>{
|
|
154
|
+
e.stopPropagation();
|
|
155
|
+
const currentValue = e.target.value;
|
|
156
|
+
if ('radio' === e.target.type && currentValue === value) null == onChange || onChange('');
|
|
157
|
+
};
|
|
158
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
159
|
+
onClick: handleCancel,
|
|
160
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Radio.Group, {
|
|
161
|
+
...props,
|
|
162
|
+
value: value,
|
|
163
|
+
options: options
|
|
164
|
+
})
|
|
165
|
+
});
|
|
166
|
+
}, (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.mapProps)({
|
|
167
|
+
dataSource: 'options',
|
|
168
|
+
onInput: 'onChange',
|
|
169
|
+
value: 'value'
|
|
170
|
+
}), (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.mapReadPretty)(__WEBPACK_EXTERNAL_MODULE__ReadPretty_mjs__.ReadPretty));
|
|
171
|
+
const Select = (props)=>{
|
|
172
|
+
switch(props.mode){
|
|
173
|
+
case 'Radio group':
|
|
174
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(InternalRadioGroup, {
|
|
175
|
+
...props
|
|
176
|
+
});
|
|
177
|
+
case 'Select':
|
|
178
|
+
default:
|
|
179
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(InternalSelect, {
|
|
180
|
+
...props
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
};
|
|
153
184
|
Select.ReadPretty = __WEBPACK_EXTERNAL_MODULE__ReadPretty_mjs__.ReadPretty;
|
|
154
185
|
const Select_rslib_entry_ = Select;
|
|
155
186
|
export { Select, Select_rslib_entry_ as default };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Props } from '@dnd-kit/core/dist/components/DndContext/DndContext';
|
|
3
|
-
export declare const DndContext:
|
|
2
|
+
export declare const DndContext: import("react").MemoExoticComponent<import("@tachybase/schema").ReactFC<Props>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DragHandleMenu: (props: any) => any;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_rc_menu_es_context_MenuContext__ from "rc-menu/es/context/MenuContext";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__ from "../../hooks/index.mjs";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__DragHandleMenu_style_mjs__ from "./DragHandleMenu.style.mjs";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__SortableItem_mjs__ from "./SortableItem.mjs";
|
|
8
|
+
const DragHandleMenu = (props)=>{
|
|
9
|
+
const { isSubMenu, name, children, className: overStyle, isAdminMenu } = props;
|
|
10
|
+
const { draggable } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__SortableItem_mjs__.SortableContext);
|
|
11
|
+
const { onOpenChange } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE_rc_menu_es_context_MenuContext__.MenuContext) || {};
|
|
12
|
+
const { designable } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useDesignable)();
|
|
13
|
+
const { attributes, listeners, setNodeRef, transform, isDragging } = draggable;
|
|
14
|
+
const { styles } = (0, __WEBPACK_EXTERNAL_MODULE__DragHandleMenu_style_mjs__.useStyles)();
|
|
15
|
+
const ref = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
|
|
16
|
+
const [dimensions, setDimensions] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)({
|
|
17
|
+
width: 0,
|
|
18
|
+
height: 0
|
|
19
|
+
});
|
|
20
|
+
const [initialPosition, setInitialPosition] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)({
|
|
21
|
+
x: 0,
|
|
22
|
+
y: 0
|
|
23
|
+
});
|
|
24
|
+
const centerOffset = {
|
|
25
|
+
x: dimensions.width / 4,
|
|
26
|
+
y: dimensions.height / 4
|
|
27
|
+
};
|
|
28
|
+
const style = {
|
|
29
|
+
position: isDragging ? 'fixed' : 'static',
|
|
30
|
+
top: isDragging ? initialPosition.y - centerOffset.y : 0,
|
|
31
|
+
left: isDragging ? initialPosition.x - centerOffset.x : 0,
|
|
32
|
+
width: isDragging ? dimensions.width : '100%',
|
|
33
|
+
height: isDragging ? dimensions.height : '100%',
|
|
34
|
+
zIndex: isDragging ? 999 : 'auto',
|
|
35
|
+
pointerEvents: isDragging ? 'none' : 'auto',
|
|
36
|
+
transform: transform ? "translate3d(".concat(transform.x, "px, ").concat(transform.y, "px, 0) scale(").concat(isDragging ? 1.05 : 1, ")") : void 0,
|
|
37
|
+
boxShadow: isDragging ? '0 4px 8px rgba(0, 0, 0, 0.1)' : 'none'
|
|
38
|
+
};
|
|
39
|
+
const handleMouseDown = (event)=>{
|
|
40
|
+
if (ref.current) {
|
|
41
|
+
const { width, height } = ref.current.getBoundingClientRect();
|
|
42
|
+
const { clientX, clientY } = event;
|
|
43
|
+
setDimensions({
|
|
44
|
+
width,
|
|
45
|
+
height
|
|
46
|
+
});
|
|
47
|
+
setInitialPosition({
|
|
48
|
+
x: clientX,
|
|
49
|
+
y: clientY
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
54
|
+
if (isSubMenu && isDragging) null == onOpenChange || onOpenChange(name, false);
|
|
55
|
+
}, [
|
|
56
|
+
isDragging
|
|
57
|
+
]);
|
|
58
|
+
if (!designable) return children;
|
|
59
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
60
|
+
ref: setNodeRef,
|
|
61
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.cx)(styles.dragHandleMenu, {
|
|
62
|
+
draggable: isDragging,
|
|
63
|
+
leftBorder: isSubMenu && isDragging,
|
|
64
|
+
adminMenu: isAdminMenu && isDragging
|
|
65
|
+
}, overStyle),
|
|
66
|
+
style: style,
|
|
67
|
+
...listeners,
|
|
68
|
+
...attributes,
|
|
69
|
+
role: "none",
|
|
70
|
+
onMouseDown: handleMouseDown,
|
|
71
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
72
|
+
ref: ref,
|
|
73
|
+
className: 'wrapper',
|
|
74
|
+
children: children
|
|
75
|
+
})
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
export { DragHandleMenu };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
|
|
2
|
+
function _tagged_template_literal(strings, raw) {
|
|
3
|
+
if (!raw) raw = strings.slice(0);
|
|
4
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
5
|
+
raw: {
|
|
6
|
+
value: Object.freeze(raw)
|
|
7
|
+
}
|
|
8
|
+
}));
|
|
9
|
+
}
|
|
10
|
+
function _templateObject() {
|
|
11
|
+
const data = _tagged_template_literal([
|
|
12
|
+
"\n position: relative;\n width: 100%;\n height: 100%;\n\n &.draggable {\n cursor: move;\n padding: 0 10px;\n border-radius: 5px;\n background: #f0f0f0;\n }\n &.leftBorder {\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: var(--colorPrimaryText);\n\n /* 使用 clip-path 裁剪为梯形 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\n }\n }\n\n &.adminMenu {\n .general-schema-designer {\n display: none;\n }\n }\n\n .wrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-around;\n }\n "
|
|
13
|
+
]);
|
|
14
|
+
_templateObject = function() {
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
const useStyles = (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.createStyles)((param)=>{
|
|
20
|
+
let { css, token } = param;
|
|
21
|
+
return {
|
|
22
|
+
dragHandleMenu: css(_templateObject())
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
export { useStyles };
|
|
@@ -4,6 +4,8 @@ import * as __WEBPACK_EXTERNAL_MODULE__modules_actions_add_new_CreateActionIniti
|
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE__modules_actions_add_new_createFormBlockInitializers_mjs__ from "../modules/actions/add-new/createFormBlockInitializers.mjs";
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE__modules_actions_add_record_CustomizeAddRecordActionInitializer_mjs__ from "../modules/actions/add-record/CustomizeAddRecordActionInitializer.mjs";
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE__modules_actions_add_record_customizeCreateFormBlockInitializers_mjs__ from "../modules/actions/add-record/customizeCreateFormBlockInitializers.mjs";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__modules_actions_associate_AssociateActionInitializer_mjs__ from "../modules/actions/associate/AssociateActionInitializer.mjs";
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE__modules_actions_associate_AssociateActionProvider_mjs__ from "../modules/actions/associate/AssociateActionProvider.mjs";
|
|
7
9
|
import * as __WEBPACK_EXTERNAL_MODULE__modules_actions_bulk_destroy_BulkDestroyActionInitializer_mjs__ from "../modules/actions/bulk-destroy/BulkDestroyActionInitializer.mjs";
|
|
8
10
|
import * as __WEBPACK_EXTERNAL_MODULE__modules_actions_delete_DestroyActionInitializer_mjs__ from "../modules/actions/delete/DestroyActionInitializer.mjs";
|
|
9
11
|
import * as __WEBPACK_EXTERNAL_MODULE__modules_actions_disassociate_DisassociateActionInitializer_mjs__ from "../modules/actions/disassociate/DisassociateActionInitializer.mjs";
|
|
@@ -89,7 +91,9 @@ class SchemaInitializerPlugin extends __WEBPACK_EXTERNAL_MODULE__application_Plu
|
|
|
89
91
|
DisassociateActionInitializer: __WEBPACK_EXTERNAL_MODULE__modules_actions_disassociate_DisassociateActionInitializer_mjs__.DisassociateActionInitializer,
|
|
90
92
|
FilterActionInitializer: __WEBPACK_EXTERNAL_MODULE__modules_actions_filter_FilterActionInitializer_mjs__.FilterActionInitializer,
|
|
91
93
|
RefreshActionInitializer: __WEBPACK_EXTERNAL_MODULE__modules_actions_refresh_RefreshActionInitializer_mjs__.RefreshActionInitializer,
|
|
92
|
-
FilterFormItemCustom: __WEBPACK_EXTERNAL_MODULE__items_index_mjs__.FilterFormItemCustom
|
|
94
|
+
FilterFormItemCustom: __WEBPACK_EXTERNAL_MODULE__items_index_mjs__.FilterFormItemCustom,
|
|
95
|
+
AssociateActionInitializer: __WEBPACK_EXTERNAL_MODULE__modules_actions_associate_AssociateActionInitializer_mjs__.AssociateActionInitializer,
|
|
96
|
+
AssociateActionProvider: __WEBPACK_EXTERNAL_MODULE__modules_actions_associate_AssociateActionProvider_mjs__.AssociateActionProvider
|
|
93
97
|
});
|
|
94
98
|
this.app.schemaInitializerManager.add(__WEBPACK_EXTERNAL_MODULE__modules_page_BlockInitializers_mjs__.blockInitializers);
|
|
95
99
|
this.app.schemaInitializerManager.add(__WEBPACK_EXTERNAL_MODULE__modules_blocks_data_blocks_table_index_mjs__.tableActionInitializers);
|
|
@@ -119,7 +123,6 @@ class SchemaInitializerPlugin extends __WEBPACK_EXTERNAL_MODULE__application_Plu
|
|
|
119
123
|
this.app.schemaInitializerManager.add(__WEBPACK_EXTERNAL_MODULE__buttons_index_mjs__.tabPaneInitializers_deprecated);
|
|
120
124
|
this.app.schemaInitializerManager.add(__WEBPACK_EXTERNAL_MODULE__buttons_index_mjs__.tabPaneInitializersForRecordBlock);
|
|
121
125
|
this.app.schemaInitializerManager.add(__WEBPACK_EXTERNAL_MODULE__buttons_index_mjs__.tabPaneInitializersForBulkEditFormBlock);
|
|
122
|
-
this.app.schemaInitializerManager.add(__WEBPACK_EXTERNAL_MODULE__modules_menu_menuItemInitializer_mjs__.menuItemInitializer_deprecated);
|
|
123
126
|
this.app.schemaInitializerManager.add(__WEBPACK_EXTERNAL_MODULE__modules_menu_menuItemInitializer_mjs__.menuItemInitializer);
|
|
124
127
|
}
|
|
125
128
|
}
|
|
@@ -418,7 +418,7 @@ const useAssociatedFormItemInitializerFields = (options)=>{
|
|
|
418
418
|
});
|
|
419
419
|
return groups;
|
|
420
420
|
};
|
|
421
|
-
const getItem = (field, schemaName, collectionName, getCollectionFields, processedCollections, level)=>{
|
|
421
|
+
const getItem = (field, schemaName, collectionName, getCollectionFields, processedCollections, level, fieldPath)=>{
|
|
422
422
|
if (level >= 3) return null;
|
|
423
423
|
if ([
|
|
424
424
|
'm2o',
|
|
@@ -438,24 +438,25 @@ const getItem = (field, schemaName, collectionName, getCollectionFields, process
|
|
|
438
438
|
'oho',
|
|
439
439
|
'o2m',
|
|
440
440
|
'm2m'
|
|
441
|
-
].includes(subField.interface)) options.push(getResultSchema("".concat(schemaName, ".").concat(subField.name), subField, collectionName));
|
|
441
|
+
].includes(subField.interface)) options.push(getResultSchema("".concat(schemaName, ".").concat(subField.name), subField, collectionName, (fieldPath || '') + field.key));
|
|
442
442
|
options.push(getItem(subField, "".concat(schemaName, ".").concat(subField.name), collectionName, getCollectionFields, [
|
|
443
443
|
...processedCollections,
|
|
444
444
|
field.target
|
|
445
|
-
], level + 1));
|
|
445
|
+
], level + 1, (fieldPath || '') + field.key));
|
|
446
446
|
});
|
|
447
447
|
return {
|
|
448
448
|
type: 'subMenu',
|
|
449
449
|
name: null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : _field_uiSchema.title,
|
|
450
450
|
title: null === (_field_uiSchema1 = field.uiSchema) || void 0 === _field_uiSchema1 ? void 0 : _field_uiSchema1.title,
|
|
451
|
+
key: (fieldPath || '') + field.key + 'menu',
|
|
451
452
|
children: options.filter(Boolean)
|
|
452
453
|
};
|
|
453
454
|
}
|
|
454
455
|
if ((0, __WEBPACK_EXTERNAL_MODULE__filter_provider_utils_mjs__.isAssocField)(field)) return null;
|
|
455
|
-
return getResultSchema(schemaName, field, collectionName);
|
|
456
|
+
return getResultSchema(schemaName, field, collectionName, (fieldPath || '') + field.key);
|
|
456
457
|
};
|
|
457
|
-
const getResultSchema = (schemaName, field, collectionName)=>{
|
|
458
|
-
var _field_uiSchema, _field_uiSchema1;
|
|
458
|
+
const getResultSchema = (schemaName, field, collectionName, fieldPath)=>{
|
|
459
|
+
var _field_uiSchema, _field_uiSchema1, _field_uiSchema2;
|
|
459
460
|
const schema = {
|
|
460
461
|
type: 'string',
|
|
461
462
|
name: schemaName,
|
|
@@ -472,7 +473,8 @@ const getResultSchema = (schemaName, field, collectionName)=>{
|
|
|
472
473
|
const result = {
|
|
473
474
|
name: (null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : _field_uiSchema.title) || field.name,
|
|
474
475
|
type: 'item',
|
|
475
|
-
|
|
476
|
+
key: ((null === (_field_uiSchema1 = field.uiSchema) || void 0 === _field_uiSchema1 ? void 0 : _field_uiSchema1.title) || field.name) + fieldPath,
|
|
477
|
+
title: (null === (_field_uiSchema2 = field.uiSchema) || void 0 === _field_uiSchema2 ? void 0 : _field_uiSchema2.title) || field.name,
|
|
476
478
|
Component: 'CollectionFieldInitializer',
|
|
477
479
|
remove: removeGridFormItem,
|
|
478
480
|
schema
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FC, PropsWithChildren } from 'react';
|
|
1
|
+
import { FC, PropsWithChildren, type ReactNode } from 'react';
|
|
2
2
|
export interface GeneralSchemaDesignerProps {
|
|
3
3
|
disableInitializer?: boolean;
|
|
4
4
|
title?: string;
|
|
@@ -10,6 +10,7 @@ export interface GeneralSchemaDesignerProps {
|
|
|
10
10
|
*/
|
|
11
11
|
draggable?: boolean;
|
|
12
12
|
showDataSource?: boolean;
|
|
13
|
+
AddMenuModalComponent?: ReactNode;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* @deprecated use `SchemaToolbar` instead
|
|
@@ -15,7 +15,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__SchemaSettings_mjs__ from "./SchemaSettin
|
|
|
15
15
|
import * as __WEBPACK_EXTERNAL_MODULE__styles_mjs__ from "./styles.mjs";
|
|
16
16
|
const GeneralSchemaDesigner = (props)=>{
|
|
17
17
|
var _rowCtx_cols, _ctx_renderSchemaInitializer;
|
|
18
|
-
const { disableInitializer, title, template, schemaSettings, contextValue, draggable = true, showDataSource = true } = props;
|
|
18
|
+
const { disableInitializer, title, template, schemaSettings, contextValue, draggable = true, showDataSource = true, AddMenuModalComponent } = props;
|
|
19
19
|
const { dn, designable } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useDesignable)();
|
|
20
20
|
const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
21
21
|
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
@@ -90,6 +90,14 @@ const GeneralSchemaDesigner = (props)=>{
|
|
|
90
90
|
size: 3,
|
|
91
91
|
align: 'center',
|
|
92
92
|
children: [
|
|
93
|
+
!!AddMenuModalComponent && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__SchemaSettings_mjs__.SchemaSettingsDropdown, {
|
|
94
|
+
title: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.PlusOutlined, {
|
|
95
|
+
role: "button",
|
|
96
|
+
"aria-label": getAriaLabel('add-menu')
|
|
97
|
+
}),
|
|
98
|
+
...schemaSettingsProps,
|
|
99
|
+
children: AddMenuModalComponent
|
|
100
|
+
}),
|
|
93
101
|
draggable && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.DragHandler, {
|
|
94
102
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.DragOutlined, {
|
|
95
103
|
role: "button",
|
|
@@ -42,7 +42,7 @@ export interface SchemaSettingsItemProps extends Omit<MenuItemProps, 'title'> {
|
|
|
42
42
|
}
|
|
43
43
|
export declare const SchemaSettingsItem: FC<SchemaSettingsItemProps>;
|
|
44
44
|
export interface SchemaSettingsItemGroupProps {
|
|
45
|
-
title
|
|
45
|
+
title?: string;
|
|
46
46
|
children: any[];
|
|
47
47
|
}
|
|
48
48
|
export declare const SchemaSettingsItemGroup: FC<SchemaSettingsItemGroupProps>;
|
|
@@ -57,6 +57,7 @@ export interface SchemaSettingsRemoveProps {
|
|
|
57
57
|
confirm?: ModalFuncProps;
|
|
58
58
|
removeParentsIfNoChildren?: boolean;
|
|
59
59
|
breakRemoveOn?: ISchema | ((s: ISchema) => boolean);
|
|
60
|
+
icon?: string;
|
|
60
61
|
}
|
|
61
62
|
export declare const SchemaSettingsRemove: FC<SchemaSettingsRemoveProps>;
|
|
62
63
|
interface SchemaSettingsConnectDataBlocksProps {
|
|
@@ -105,6 +106,7 @@ export interface SchemaSettingsModalItemProps {
|
|
|
105
106
|
asyncGetInitialValues?: () => Promise<any>;
|
|
106
107
|
eventKey?: string;
|
|
107
108
|
hide?: boolean;
|
|
109
|
+
icon?: string | React.ReactNode;
|
|
108
110
|
}
|
|
109
111
|
export declare const SchemaSettingsModalItem: FC<SchemaSettingsModalItemProps>;
|
|
110
112
|
export declare const SchemaSettingsBlockTitleItem: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -339,9 +339,9 @@ const SchemaSettingsFormItemTemplate = function(props) {
|
|
|
339
339
|
});
|
|
340
340
|
};
|
|
341
341
|
const SchemaSettingsItem = (props)=>{
|
|
342
|
+
const { eventKey, title } = props;
|
|
342
343
|
const { pushMenuItem } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_useMenuItem_mjs__.useCollectMenuItems)();
|
|
343
344
|
const { collectMenuItem } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_useMenuItem_mjs__.useCollectMenuItem)();
|
|
344
|
-
const { eventKey, title } = props;
|
|
345
345
|
const { name } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useSchemaSettingsItem)();
|
|
346
346
|
const item = {
|
|
347
347
|
key: title,
|
|
@@ -404,7 +404,7 @@ const SchemaSettingsDivider = function() {
|
|
|
404
404
|
return null;
|
|
405
405
|
};
|
|
406
406
|
const SchemaSettingsRemove = (props)=>{
|
|
407
|
-
const { confirm, removeParentsIfNoChildren, breakRemoveOn } = props;
|
|
407
|
+
const { icon, confirm, removeParentsIfNoChildren, breakRemoveOn } = props;
|
|
408
408
|
const { dn, template } = useSchemaSettings();
|
|
409
409
|
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
410
410
|
const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
@@ -416,6 +416,12 @@ const SchemaSettingsRemove = (props)=>{
|
|
|
416
416
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(SchemaSettingsItem, {
|
|
417
417
|
title: "Delete",
|
|
418
418
|
eventKey: "remove",
|
|
419
|
+
icon: icon ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_mjs__.Icon, {
|
|
420
|
+
style: {
|
|
421
|
+
color: '#eb5050'
|
|
422
|
+
},
|
|
423
|
+
type: icon
|
|
424
|
+
}) : null,
|
|
419
425
|
onClick: ()=>{
|
|
420
426
|
modal.confirm({
|
|
421
427
|
title: t('Delete block'),
|
|
@@ -443,7 +449,12 @@ const SchemaSettingsRemove = (props)=>{
|
|
|
443
449
|
}
|
|
444
450
|
});
|
|
445
451
|
},
|
|
446
|
-
children:
|
|
452
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("span", {
|
|
453
|
+
style: {
|
|
454
|
+
color: '#eb5050'
|
|
455
|
+
},
|
|
456
|
+
children: t('Delete')
|
|
457
|
+
})
|
|
447
458
|
});
|
|
448
459
|
};
|
|
449
460
|
const SchemaSettingsConnectDataBlocks = (props)=>{
|
|
@@ -999,7 +1010,8 @@ const SchemaSettingsDefaultSortingRules = function(props) {
|
|
|
999
1010
|
'x-component-props': {
|
|
1000
1011
|
style: {
|
|
1001
1012
|
width: 260
|
|
1002
|
-
}
|
|
1013
|
+
},
|
|
1014
|
+
optionLabelProp: 'fullLabel'
|
|
1003
1015
|
}
|
|
1004
1016
|
},
|
|
1005
1017
|
direction: {
|