@tachybase/client 0.23.22 → 0.23.40
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/SchemaInitializerButton.mjs +1 -1
- package/es/application/schema-initializer/components/SchemaInitializerChildren.mjs +1 -1
- package/es/built-in/admin-layout/AdminLayout.mjs +15 -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/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 -10
- 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/index.d.ts +0 -1
- package/es/index.mjs +0 -1
- 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 +75 -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 +2 -1
- package/es/schema-component/antd/menu/Menu.Designer.mjs +62 -42
- package/es/schema-component/antd/menu/Menu.mjs +124 -163
- 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/MenuAdd.d.ts +1 -0
- package/es/schema-component/antd/menu/MenuAdd.mjs +18 -0
- package/es/schema-component/antd/menu/MenuSearchAdd.d.ts +7 -0
- package/es/schema-component/antd/menu/MenuSearchAdd.mjs +41 -0
- package/es/schema-component/antd/menu/MenuSearchAdd.style.d.ts +3 -0
- package/es/schema-component/antd/menu/MenuSearchAdd.style.mjs +25 -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-component/common/sortable-item/SortableItem.d.ts +1 -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/SchemaInitializerButton.js +1 -1
- package/lib/application/schema-initializer/components/SchemaInitializerChildren.js +1 -1
- package/lib/built-in/admin-layout/AdminLayout.js +15 -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/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 +142 -114
- 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/context.js → setting-layout/style.js} +24 -5
- package/lib/collection-manager/action-hooks.js +39 -11
- package/lib/icon/preloaded.js +4 -4
- package/lib/index.js +71 -86
- 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 +109 -0
- package/lib/schema-component/antd/menu/AdminMenu.style.js +70 -0
- package/lib/schema-component/antd/menu/Menu.Designer.js +62 -41
- package/lib/schema-component/antd/menu/Menu.js +124 -163
- package/lib/schema-component/antd/menu/Menu.styles.js +8 -20
- package/lib/{built-in/assistant/calculator/CalculatorDisplay.js → schema-component/antd/menu/MenuAdd.js} +14 -17
- package/lib/schema-component/antd/menu/MenuSearchAdd.js +89 -0
- package/lib/schema-component/antd/menu/MenuSearchAdd.style.js +59 -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/Assistant.provider.d.ts +0 -9
- package/es/built-in/assistant/Assistant.provider.mjs +0 -125
- 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/context.d.ts +0 -3
- package/es/built-in/assistant/context.mjs +0 -6
- package/es/built-in/assistant/index.d.ts +0 -7
- package/es/built-in/assistant/index.mjs +0 -16
- 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/Assistant.provider.js +0 -161
- 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/CalculatorKey.js +0 -45
- 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/index.js +0 -107
- package/lib/built-in/assistant/search-and-jump/index.js +0 -96
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
|
|
2
2
|
subMenuDesignerCss: import("antd-style").SerializedStyles;
|
|
3
3
|
designerCss: import("antd-style").SerializedStyles;
|
|
4
|
-
headerMenuClass: import("antd-style").SerializedStyles;
|
|
5
4
|
sideMenuClass: import("antd-style").SerializedStyles;
|
|
6
5
|
menuItemClass: import("antd-style").SerializedStyles;
|
|
7
|
-
|
|
6
|
+
headerMenuClass: import("antd-style").SerializedStyles;
|
|
8
7
|
}>;
|
|
@@ -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 @@
|
|
|
1
|
+
export declare const MenuAdd: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../../../index.mjs";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_SchemaSettings_mjs__ from "../../../schema-settings/SchemaSettings.mjs";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__Menu_Designer_mjs__ from "./Menu.Designer.mjs";
|
|
5
|
+
const MenuAdd = (props)=>{
|
|
6
|
+
const { dn } = props;
|
|
7
|
+
const { getAriaLabel } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useGetAriaLabelOfDesigner)();
|
|
8
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__schema_settings_SchemaSettings_mjs__.SchemaSettingsDropdown, {
|
|
9
|
+
title: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_mjs__.Icon, {
|
|
10
|
+
type: "PlusOutlined",
|
|
11
|
+
"aria-label": getAriaLabel('add-menu')
|
|
12
|
+
}),
|
|
13
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__Menu_Designer_mjs__.InsertMenuItemsGroup, {
|
|
14
|
+
dn: dn
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
export { MenuAdd };
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
import * as __WEBPACK_EXTERNAL_MODULE__MenuAdd_mjs__ from "./MenuAdd.mjs";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__MenuSearchAdd_style_mjs__ from "./MenuSearchAdd.style.mjs";
|
|
7
|
+
const MenuSearchAdd = (props)=>{
|
|
8
|
+
const { designable, dn, setSearchMenuTitle } = props;
|
|
9
|
+
const { t } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useTranslation)();
|
|
10
|
+
const { styles } = (0, __WEBPACK_EXTERNAL_MODULE__MenuSearchAdd_style_mjs__.useStyles)();
|
|
11
|
+
const handleChange = __WEBPACK_EXTERNAL_MODULE_lodash__["default"].debounce((event)=>{
|
|
12
|
+
event.stopPropagation();
|
|
13
|
+
const searchValue = event.target.value.trim();
|
|
14
|
+
setSearchMenuTitle(searchValue);
|
|
15
|
+
}, 500);
|
|
16
|
+
const handleSearch = (value, event)=>{
|
|
17
|
+
event.stopPropagation();
|
|
18
|
+
__WEBPACK_EXTERNAL_MODULE_lodash__["default"].debounce(setSearchMenuTitle, 500)(value.trim());
|
|
19
|
+
};
|
|
20
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
|
|
21
|
+
className: styles.menuSearchAdd,
|
|
22
|
+
children: [
|
|
23
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Input.Search, {
|
|
24
|
+
allowClear: true,
|
|
25
|
+
placeholder: t('search Menu'),
|
|
26
|
+
prefix: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_mjs__.Icon, {
|
|
27
|
+
type: "SearchOutlined"
|
|
28
|
+
}),
|
|
29
|
+
onChange: handleChange,
|
|
30
|
+
onSearch: handleSearch
|
|
31
|
+
}),
|
|
32
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
33
|
+
className: "menu-add-wrapper",
|
|
34
|
+
children: designable && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__MenuAdd_mjs__.MenuAdd, {
|
|
35
|
+
dn: dn
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
]
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
export { MenuSearchAdd };
|
|
@@ -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 /* NOTE: 这里的样式是为了让搜索框的样式, 避免上层 antd 写死的 padding-left: 24px 的影响 */\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n\n /* NOTE: 放这三个样式是为了提升选择器优先级, 覆盖掉 antd 的默认样式 */\n .ant-input-outlined.ant-input-outlined.ant-input-outlined {\n background-color: #f9f9f9;\n border-radius: 5px;\n border: none;\n box-shadow: none;\n }\n\n /* 移除 antd 默认的后置搜索图标 */\n .ant-input-group-addon {\n display: none;\n }\n\n .menu-add-wrapper {\n .ant-dropdown-trigger {\n display: grid;\n place-items: center;\n\n width: 30px;\n /* 这里是为了和前边元素保持对齐, antd 组件写死了高度 */\n height: 28px;\n\n cursor: pointer;\n\n :hover,\n :active {\n border-radius: 5px;\n color: #ffffff;\n background-color: #f4f4f4;\n }\n }\n }\n "
|
|
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
|
+
menuSearchAdd: css(_templateObject())
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
export { useStyles };
|
|
@@ -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 };
|
|
@@ -9,6 +9,7 @@ interface SortableItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
9
9
|
schema?: Schema;
|
|
10
10
|
removeParentsIfNoChildren?: boolean;
|
|
11
11
|
ref?: React.Ref<any>;
|
|
12
|
+
overStyle?: object;
|
|
12
13
|
}
|
|
13
14
|
export declare const SortableItem: React.MemoExoticComponent<import("@tachybase/schema").ReactFC<SortableItemProps & {
|
|
14
15
|
ref?: React.Ref<any>;
|
|
@@ -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",
|