@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
|
@@ -74,21 +74,49 @@ const useKanbanEvents = ()=>{
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
|
-
const
|
|
77
|
+
const toOneField = (field)=>[
|
|
78
|
+
'belongsTo',
|
|
79
|
+
'hasOne'
|
|
80
|
+
].includes(field.type);
|
|
81
|
+
const useSortFields = function(collectionName) {
|
|
82
|
+
let depth = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1, parentFieldName = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : '', parentLabel = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : '';
|
|
83
|
+
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
78
84
|
const { getCollectionFields, getInterface } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useCollectionManager_deprecated)();
|
|
79
85
|
const fields = getCollectionFields(collectionName);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
+
if (!Array.isArray(fields) || 0 === fields.length) return [];
|
|
87
|
+
fields.sort((a, b)=>{
|
|
88
|
+
const toOnFieldA = toOneField(a);
|
|
89
|
+
const toOnFieldB = toOneField(b);
|
|
90
|
+
if (toOnFieldA && !toOnFieldB) return 1;
|
|
91
|
+
if (!toOnFieldA && toOnFieldB) return -1;
|
|
92
|
+
return a.sort - b.sort;
|
|
93
|
+
});
|
|
94
|
+
return fields.map((field)=>{
|
|
86
95
|
var _field_uiSchema;
|
|
87
|
-
return
|
|
88
|
-
|
|
89
|
-
|
|
96
|
+
if (!field.interface) return null;
|
|
97
|
+
const fieldInterface = getInterface(field.interface);
|
|
98
|
+
if (!(null == fieldInterface ? void 0 : fieldInterface.sortable) && !toOneField(field)) return null;
|
|
99
|
+
if (!(null == fieldInterface ? void 0 : fieldInterface.sortable) && depth >= 2) return null;
|
|
100
|
+
if (field.target === collectionName) return null;
|
|
101
|
+
const value = parentFieldName ? "".concat(parentFieldName, ".").concat(field.name) : field.name;
|
|
102
|
+
const currentLabel = (null == field ? void 0 : null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : _field_uiSchema.title) || field.name;
|
|
103
|
+
let fullLabel = '';
|
|
104
|
+
if (parentLabel) {
|
|
105
|
+
if (parentLabel.includes('{{') || currentLabel.includes('{{')) {
|
|
106
|
+
const formatLabel = (label)=>label.includes('{{t(') ? "t(".concat(label.slice(4, -3), ")") : label.includes('{{') ? "t(".concat(label.slice(2, -2), ")") : '"'.concat(label, '"');
|
|
107
|
+
let formattedParentLabel = formatLabel(parentLabel);
|
|
108
|
+
const formattedCurrentLabel = formatLabel(currentLabel);
|
|
109
|
+
fullLabel = "{{t(".concat(formattedParentLabel, ' + "/" + ').concat(formattedCurrentLabel, ")}}");
|
|
110
|
+
} else fullLabel = "".concat(parentLabel, " / ").concat(currentLabel);
|
|
111
|
+
} else fullLabel = currentLabel;
|
|
112
|
+
const option = {
|
|
113
|
+
label: currentLabel,
|
|
114
|
+
fullLabel,
|
|
115
|
+
value
|
|
90
116
|
};
|
|
91
|
-
|
|
117
|
+
if (field.target) option.children = useSortFields(field.target, depth + 1, value, fullLabel);
|
|
118
|
+
return option;
|
|
119
|
+
}).filter(Boolean);
|
|
92
120
|
};
|
|
93
121
|
const useChildrenCollections = (collectionName)=>{
|
|
94
122
|
const { getChildrenCollections } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useCollectionManager_deprecated)();
|
package/es/icon/preloaded.mjs
CHANGED
|
@@ -36,7 +36,7 @@ const Approval = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runti
|
|
|
36
36
|
]
|
|
37
37
|
});
|
|
38
38
|
const ApprovalNew = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("svg", {
|
|
39
|
-
|
|
39
|
+
fillRule: "evenodd",
|
|
40
40
|
viewBox: "0 0 34 34",
|
|
41
41
|
focusable: "false",
|
|
42
42
|
fill: "currentColor",
|
|
@@ -51,7 +51,7 @@ const ApprovalNew = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_ru
|
|
|
51
51
|
id: "Ellipse 42",
|
|
52
52
|
d: "M16.8963 7C14.6872 7 12.8963 8.79086 12.8963 11C12.8963 12.2907 13.5076 13.4385 14.4564 14.1699C14.7966 14.4322 15.018 14.8415 14.9526 15.266L14.6723 17.0856C14.5972 17.5734 14.1774 17.9334 13.6839 17.9334H10.999C10.4467 17.9334 9.99902 18.3811 9.99902 18.9334V22.012",
|
|
53
53
|
stroke: "white",
|
|
54
|
-
|
|
54
|
+
strokeWidth: "1.5"
|
|
55
55
|
}),
|
|
56
56
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("path", {
|
|
57
57
|
id: "Ellipse 43",
|
|
@@ -62,8 +62,8 @@ const ApprovalNew = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_ru
|
|
|
62
62
|
id: "Vector 5",
|
|
63
63
|
d: "M10.0479 25.0195H23.7546",
|
|
64
64
|
stroke: "white",
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
strokeWidth: "1.5",
|
|
66
|
+
strokeLinecap: "round"
|
|
67
67
|
})
|
|
68
68
|
]
|
|
69
69
|
})
|
package/es/index.d.ts
CHANGED
|
@@ -18,7 +18,6 @@ export * from './i18n';
|
|
|
18
18
|
export * from './icon';
|
|
19
19
|
export { default as locale } from './locale';
|
|
20
20
|
export * from './built-in';
|
|
21
|
-
export * from './built-in/assistant';
|
|
22
21
|
export * from './built-in/pinned-list';
|
|
23
22
|
export * from './built-in/pm';
|
|
24
23
|
export * from './powered-by';
|
package/es/index.mjs
CHANGED
|
@@ -21,7 +21,6 @@ export * from "./hooks/index.mjs";
|
|
|
21
21
|
export * from "./i18n/index.mjs";
|
|
22
22
|
export * from "./icon/index.mjs";
|
|
23
23
|
export * from "./built-in/index.mjs";
|
|
24
|
-
export * from "./built-in/assistant/index.mjs";
|
|
25
24
|
export * from "./built-in/pinned-list/index.mjs";
|
|
26
25
|
export * from "./built-in/pm/index.mjs";
|
|
27
26
|
export * from "./powered-by/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AssociateActionInitializer: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__application_index_mjs__ from "../../../application/index.mjs";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__schema_initializer_items_ActionInitializer_mjs__ from "../../../schema-initializer/items/ActionInitializer.mjs";
|
|
5
|
+
const AssociateActionInitializer = ()=>{
|
|
6
|
+
const schema = {
|
|
7
|
+
type: 'void',
|
|
8
|
+
'x-action': 'associate',
|
|
9
|
+
'x-acl-action': 'associate',
|
|
10
|
+
title: "{{t('Associate')}}",
|
|
11
|
+
'x-toolbar': 'ActionSchemaToolbar',
|
|
12
|
+
'x-settings': 'actionSettings:associate',
|
|
13
|
+
'x-component': 'Action',
|
|
14
|
+
'x-component-props': {
|
|
15
|
+
actionType: 'associations',
|
|
16
|
+
openMode: 'drawer',
|
|
17
|
+
type: 'primary',
|
|
18
|
+
icon: 'PlusOutlined'
|
|
19
|
+
},
|
|
20
|
+
properties: {
|
|
21
|
+
drawer: {
|
|
22
|
+
type: 'void',
|
|
23
|
+
title: '{{ t("Select record") }}',
|
|
24
|
+
'x-component': 'Action.Container',
|
|
25
|
+
'x-component-props': {
|
|
26
|
+
className: 'nb-record-picker-selector'
|
|
27
|
+
},
|
|
28
|
+
'x-decorator': 'AssociateActionProvider',
|
|
29
|
+
properties: {
|
|
30
|
+
grid: {
|
|
31
|
+
type: 'void',
|
|
32
|
+
'x-component': 'Grid',
|
|
33
|
+
'x-initializer': 'popup:tableSelector:addBlock',
|
|
34
|
+
properties: {}
|
|
35
|
+
},
|
|
36
|
+
footer: {
|
|
37
|
+
'x-component': 'Action.Container.Footer',
|
|
38
|
+
'x-component-props': {},
|
|
39
|
+
properties: {
|
|
40
|
+
actions: {
|
|
41
|
+
type: 'void',
|
|
42
|
+
'x-component': 'ActionBar',
|
|
43
|
+
'x-component-props': {},
|
|
44
|
+
properties: {
|
|
45
|
+
submit: {
|
|
46
|
+
title: '{{ t("Submit") }}',
|
|
47
|
+
'x-action': 'submit',
|
|
48
|
+
'x-component': 'Action',
|
|
49
|
+
'x-use-component-props': 'usePickActionProps',
|
|
50
|
+
'x-toolbar': 'ActionSchemaToolbar',
|
|
51
|
+
'x-settings': 'actionSettings:submit',
|
|
52
|
+
'x-component-props': {
|
|
53
|
+
type: 'primary',
|
|
54
|
+
htmlType: 'submit'
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const itemConfig = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useSchemaInitializerItem)();
|
|
66
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__schema_initializer_items_ActionInitializer_mjs__.ActionInitializer, {
|
|
67
|
+
item: itemConfig,
|
|
68
|
+
schema: schema
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
export { AssociateActionInitializer };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface AssociateActionProviderProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
onChange?: (selectedRows: any[]) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const AssociateActionProvider: (props: AssociateActionProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
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__index_mjs__ from "../../../index.mjs";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__block_provider_TableSelectorProvider_mjs__ from "../../../block-provider/TableSelectorProvider.mjs";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_antd_record_picker_index_mjs__ from "../../../schema-component/antd/record-picker/index.mjs";
|
|
6
|
+
const useTableSelectorProps = ()=>{
|
|
7
|
+
const { setSelectedRows } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__schema_component_antd_record_picker_index_mjs__.RecordPickerContext);
|
|
8
|
+
const { onRowSelectionChange, rowKey = 'id', ...others } = (0, __WEBPACK_EXTERNAL_MODULE__block_provider_TableSelectorProvider_mjs__.useTableSelectorProps)();
|
|
9
|
+
return {
|
|
10
|
+
...others,
|
|
11
|
+
rowKey,
|
|
12
|
+
rowSelection: {
|
|
13
|
+
type: 'checkbox'
|
|
14
|
+
},
|
|
15
|
+
onRowSelectionChange (selectedRowKeys, selectedRows) {
|
|
16
|
+
null == setSelectedRows || setSelectedRows(selectedRowKeys);
|
|
17
|
+
null == onRowSelectionChange || onRowSelectionChange(selectedRowKeys, selectedRows);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const AssociateActionProvider = (props)=>{
|
|
22
|
+
const [selectedRows, setSelectedRows] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)([]);
|
|
23
|
+
const collection = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useCollection)();
|
|
24
|
+
const { resource, service, block, __parent } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useBlockRequestContext)();
|
|
25
|
+
const pickerProps = {
|
|
26
|
+
size: 'small',
|
|
27
|
+
onChange: null == props ? void 0 : props.onChange,
|
|
28
|
+
selectedRows,
|
|
29
|
+
setSelectedRows
|
|
30
|
+
};
|
|
31
|
+
const usePickActionProps = ()=>{
|
|
32
|
+
const { selectedRows } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__schema_component_antd_record_picker_index_mjs__.RecordPickerContext);
|
|
33
|
+
const { setVisible, setFormValueChanged } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useActionContext)();
|
|
34
|
+
return {
|
|
35
|
+
async onClick (e, callBack) {
|
|
36
|
+
await resource.add({
|
|
37
|
+
values: selectedRows
|
|
38
|
+
});
|
|
39
|
+
null == callBack || callBack();
|
|
40
|
+
null == setVisible || setVisible(false);
|
|
41
|
+
if (block && 'TableField' !== block) {
|
|
42
|
+
var __parent_service_refresh, __parent_service;
|
|
43
|
+
null == __parent || null === (__parent_service = __parent.service) || void 0 === __parent_service || null === (__parent_service_refresh = __parent_service.refresh) || void 0 === __parent_service_refresh || __parent_service_refresh.call(__parent_service);
|
|
44
|
+
null == setFormValueChanged || setFormValueChanged(false);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
const getFilter = ()=>{
|
|
50
|
+
var _service_data;
|
|
51
|
+
const targetKey = (null == collection ? void 0 : collection.filterTargetKey) || 'id';
|
|
52
|
+
if (null === (_service_data = service.data) || void 0 === _service_data ? void 0 : _service_data.data) {
|
|
53
|
+
var _service_data1;
|
|
54
|
+
const list = null === (_service_data1 = service.data) || void 0 === _service_data1 ? void 0 : _service_data1.data.map((option)=>option[targetKey]).filter(Boolean);
|
|
55
|
+
const filter = list.length ? {
|
|
56
|
+
$and: [
|
|
57
|
+
{
|
|
58
|
+
["".concat(targetKey, ".$ne")]: list
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
} : {};
|
|
62
|
+
return filter;
|
|
63
|
+
}
|
|
64
|
+
return {};
|
|
65
|
+
};
|
|
66
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__schema_component_antd_record_picker_index_mjs__.RecordPickerProvider, {
|
|
67
|
+
...pickerProps,
|
|
68
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_mjs__.SchemaComponentOptions, {
|
|
69
|
+
scope: {
|
|
70
|
+
useTableSelectorProps,
|
|
71
|
+
usePickActionProps
|
|
72
|
+
},
|
|
73
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__block_provider_TableSelectorProvider_mjs__.TableSelectorParamsProvider, {
|
|
74
|
+
params: {
|
|
75
|
+
filter: getFilter()
|
|
76
|
+
},
|
|
77
|
+
children: props.children
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
export { AssociateActionProvider };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__application_index_mjs__ from "../../../application/index.mjs";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__application_schema_settings_SchemaSettings_mjs__ from "../../../application/schema-settings/SchemaSettings.mjs";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__ from "../../../collection-manager/index.mjs";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__ from "../../../schema-component/antd/action/Action.Designer.mjs";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__schema_items_index_mjs__ from "../../../schema-items/index.mjs";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_SchemaSettings_mjs__ from "../../../schema-settings/SchemaSettings.mjs";
|
|
8
|
+
const associateActionSettings = new __WEBPACK_EXTERNAL_MODULE__application_schema_settings_SchemaSettings_mjs__.SchemaSettings({
|
|
9
|
+
name: 'actionSettings:associate',
|
|
10
|
+
items: [
|
|
11
|
+
{
|
|
12
|
+
name: 'editButton',
|
|
13
|
+
Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.ButtonEditor,
|
|
14
|
+
useComponentProps () {
|
|
15
|
+
const { buttonEditorProps } = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useSchemaToolbar)();
|
|
16
|
+
return buttonEditorProps;
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'openMode',
|
|
21
|
+
Component: __WEBPACK_EXTERNAL_MODULE__schema_items_index_mjs__.SchemaSettingOpenModeSchemaItems,
|
|
22
|
+
componentProps: {
|
|
23
|
+
openMode: true,
|
|
24
|
+
openSize: true
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'enableChildCollections',
|
|
29
|
+
Component: __WEBPACK_EXTERNAL_MODULE__schema_settings_SchemaSettings_mjs__.SchemaSettingsEnableChildCollections,
|
|
30
|
+
useComponentProps () {
|
|
31
|
+
const { name } = (0, __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
|
|
32
|
+
return {
|
|
33
|
+
collectionName: name
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
useVisible () {
|
|
37
|
+
const { name } = (0, __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollection_deprecated)();
|
|
38
|
+
const { getChildrenCollections } = (0, __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollectionManager_deprecated)();
|
|
39
|
+
const isChildCollectionAction = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>getChildrenCollections(name).length > 0, [
|
|
40
|
+
getChildrenCollections,
|
|
41
|
+
name
|
|
42
|
+
]);
|
|
43
|
+
return isChildCollectionAction;
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'delete',
|
|
48
|
+
sort: 100,
|
|
49
|
+
Component: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_action_Action_Designer_mjs__.RemoveButton,
|
|
50
|
+
useComponentProps () {
|
|
51
|
+
const { removeButtonProps } = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useSchemaToolbar)();
|
|
52
|
+
return removeButtonProps;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
export { associateActionSettings };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
|
|
3
4
|
import * as __WEBPACK_EXTERNAL_MODULE__ant_design_icons__ from "@ant-design/icons";
|
|
4
5
|
import * as __WEBPACK_EXTERNAL_MODULE__application_index_mjs__ from "../../../../application/index.mjs";
|
|
5
6
|
import * as __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__ from "../../../../collection-manager/index.mjs";
|
|
@@ -34,23 +35,27 @@ const RecordFormBlockInitializer = ()=>{
|
|
|
34
35
|
};
|
|
35
36
|
function useCreateEditFormBlock() {
|
|
36
37
|
const { insert } = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useSchemaInitializer)();
|
|
38
|
+
const cm = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useCollectionManager)();
|
|
39
|
+
const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
40
|
+
const actionType = null == fieldSchema ? void 0 : fieldSchema['actionType'];
|
|
37
41
|
const association = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useAssociationName)();
|
|
38
42
|
const createEditFormBlock = (0, __WEBPACK_EXTERNAL_MODULE_react__.useCallback)((param)=>{
|
|
39
43
|
let { item } = param;
|
|
40
|
-
const
|
|
41
|
-
|
|
44
|
+
const field = item.associationField;
|
|
45
|
+
const collectionName = (null == field ? void 0 : field.target) ? cm.getCollection(field.target).name : item.collectionName || item.name;
|
|
46
|
+
if (item.associationField) {
|
|
42
47
|
const field = item.associationField;
|
|
43
48
|
insert((0, __WEBPACK_EXTERNAL_MODULE__createEditFormBlockUISchema_mjs__.createEditFormBlockUISchema)({
|
|
44
49
|
dataSource: item.dataSource,
|
|
45
50
|
association: "".concat(field.collectionName, ".").concat(field.name)
|
|
46
51
|
}));
|
|
47
|
-
} else insert((0, __WEBPACK_EXTERNAL_MODULE__createEditFormBlockUISchema_mjs__.createEditFormBlockUISchema)(association ? {
|
|
52
|
+
} else insert((0, __WEBPACK_EXTERNAL_MODULE__createEditFormBlockUISchema_mjs__.createEditFormBlockUISchema)(association && !actionType ? {
|
|
48
53
|
association,
|
|
49
54
|
dataSource: item.dataSource,
|
|
50
55
|
isCurrent: true
|
|
51
56
|
} : {
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
dataSource: item.dataSource,
|
|
58
|
+
collectionName
|
|
54
59
|
}));
|
|
55
60
|
}, [
|
|
56
61
|
association,
|
|
@@ -60,16 +65,18 @@ function useCreateEditFormBlock() {
|
|
|
60
65
|
let { item } = param;
|
|
61
66
|
if ('FormItem' !== item.template.componentName) return templateSchema;
|
|
62
67
|
{
|
|
63
|
-
const
|
|
64
|
-
association,
|
|
65
|
-
dataSource: item.dataSource,
|
|
66
|
-
templateSchema: templateSchema,
|
|
67
|
-
isCurrent: true
|
|
68
|
-
} : {
|
|
69
|
-
collectionName: item.collectionName || item.name,
|
|
68
|
+
const options = {
|
|
70
69
|
dataSource: item.dataSource,
|
|
71
|
-
templateSchema
|
|
72
|
-
}
|
|
70
|
+
templateSchema
|
|
71
|
+
};
|
|
72
|
+
if (item.associationField) {
|
|
73
|
+
const field = item.associationField;
|
|
74
|
+
options.association = "".concat(field.collectionName, ".").concat(field.name);
|
|
75
|
+
} else if (association) {
|
|
76
|
+
options.association = association;
|
|
77
|
+
options.isCurrent = true;
|
|
78
|
+
} else options.collectionName = item.collectionName || item.name;
|
|
79
|
+
const blockSchema = (0, __WEBPACK_EXTERNAL_MODULE__createEditFormBlockUISchema_mjs__.createEditFormBlockUISchema)(options);
|
|
73
80
|
if ('reference' === item.mode) blockSchema['x-template-key'] = item.template.key;
|
|
74
81
|
return blockSchema;
|
|
75
82
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ISchema } from '@tachybase/schema';
|
|
2
|
-
interface EditFormBlockOptions {
|
|
2
|
+
export interface EditFormBlockOptions {
|
|
3
3
|
dataSource: string;
|
|
4
4
|
/** 如果传了 association 就不需要再传 collectionName 了 */
|
|
5
5
|
collectionName?: string;
|
|
@@ -11,4 +11,3 @@ interface EditFormBlockOptions {
|
|
|
11
11
|
isCurrent?: boolean;
|
|
12
12
|
}
|
|
13
13
|
export declare function createEditFormBlockUISchema(options: EditFormBlockOptions): ISchema;
|
|
14
|
-
export {};
|
|
@@ -44,6 +44,21 @@ const tableActionInitializers = new __WEBPACK_EXTERNAL_MODULE__application_schem
|
|
|
44
44
|
].includes(collection.template) || (null == collection ? void 0 : collection.writableView);
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
|
+
{
|
|
48
|
+
type: 'item',
|
|
49
|
+
title: "{{t('Associate')}}",
|
|
50
|
+
name: 'associate',
|
|
51
|
+
Component: 'AssociateActionInitializer',
|
|
52
|
+
useVisible () {
|
|
53
|
+
const collection = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useCollection)();
|
|
54
|
+
const props = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useDataBlockProps)();
|
|
55
|
+
return props.association && (![
|
|
56
|
+
'view',
|
|
57
|
+
'file',
|
|
58
|
+
'sql'
|
|
59
|
+
].includes(collection.template) || (null == collection ? void 0 : collection.writableView));
|
|
60
|
+
}
|
|
61
|
+
},
|
|
47
62
|
{
|
|
48
63
|
type: 'item',
|
|
49
64
|
title: "{{t('Delete')}}",
|
|
@@ -112,12 +112,12 @@ const tableColumnSettings = new __WEBPACK_EXTERNAL_MODULE__application_schema_se
|
|
|
112
112
|
name: 'sortable',
|
|
113
113
|
type: 'switch',
|
|
114
114
|
useVisible () {
|
|
115
|
-
|
|
115
|
+
(0, __WEBPACK_EXTERNAL_MODULE__data_source_collection_CollectionProvider_mjs__.useCollection)();
|
|
116
116
|
const { collectionField } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_antd_table_v2_Table_Column_Decorator_mjs__.useColumnSchema)();
|
|
117
117
|
const { getInterface } = (0, __WEBPACK_EXTERNAL_MODULE__collection_manager_index_mjs__.useCollectionManager_deprecated)();
|
|
118
118
|
const interfaceCfg = getInterface(null == collectionField ? void 0 : collectionField.interface);
|
|
119
119
|
const { currentMode } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_antd_association_field_hooks_mjs__.useAssociationFieldContext)();
|
|
120
|
-
return (null == interfaceCfg ? void 0 : interfaceCfg.sortable) === true && !currentMode
|
|
120
|
+
return (null == interfaceCfg ? void 0 : interfaceCfg.sortable) === true && !currentMode;
|
|
121
121
|
},
|
|
122
122
|
useComponentProps () {
|
|
123
123
|
const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
@@ -24,6 +24,10 @@ const radioComponentFieldSettings = new __WEBPACK_EXTERNAL_MODULE__application_s
|
|
|
24
24
|
{
|
|
25
25
|
label: t('Radio group'),
|
|
26
26
|
value: 'Radio group'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: t('Select'),
|
|
30
|
+
value: 'Select'
|
|
27
31
|
}
|
|
28
32
|
];
|
|
29
33
|
const { dn } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useDesignable)();
|
|
@@ -273,6 +273,7 @@ const fieldComponent = {
|
|
|
273
273
|
useComponentProps () {
|
|
274
274
|
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
275
275
|
const field = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useField)();
|
|
276
|
+
const collectionFieldCurrent = (0, __WEBPACK_EXTERNAL_MODULE__data_source_index_mjs__.useCollectionField)();
|
|
276
277
|
const { fieldSchema: tableColumnSchema, collectionField } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_antd_table_v2_Table_Column_Decorator_mjs__.useColumnSchema)();
|
|
277
278
|
const schema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
278
279
|
const fieldSchema = tableColumnSchema || schema;
|
|
@@ -283,9 +284,22 @@ const fieldComponent = {
|
|
|
283
284
|
const isAddNewForm = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useIsAddNewForm)();
|
|
284
285
|
const fieldMode = (0, __WEBPACK_EXTERNAL_MODULE__common_useFieldComponentName_mjs__.useFieldComponentName)();
|
|
285
286
|
const { dn } = (0, __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.useDesignable)();
|
|
287
|
+
const isMuiltipleSelect = [
|
|
288
|
+
'select'
|
|
289
|
+
].includes(null == collectionFieldCurrent ? void 0 : collectionFieldCurrent.interface);
|
|
290
|
+
const optionsMuiltipleSelect = [
|
|
291
|
+
{
|
|
292
|
+
label: t('Select'),
|
|
293
|
+
value: 'Select'
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
label: t('Radio group'),
|
|
297
|
+
value: 'Radio group'
|
|
298
|
+
}
|
|
299
|
+
];
|
|
286
300
|
return {
|
|
287
301
|
title: t('Field component'),
|
|
288
|
-
options: fieldModeOptions,
|
|
302
|
+
options: isMuiltipleSelect ? optionsMuiltipleSelect : fieldModeOptions,
|
|
289
303
|
value: fieldMode,
|
|
290
304
|
onChange (mode) {
|
|
291
305
|
const schema = {
|
|
@@ -316,7 +330,7 @@ const selectComponentFieldSettings = new __WEBPACK_EXTERNAL_MODULE__application_
|
|
|
316
330
|
items: [
|
|
317
331
|
{
|
|
318
332
|
...fieldComponent,
|
|
319
|
-
useVisible: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_form_item_FormItem_Settings_mjs__.
|
|
333
|
+
useVisible: __WEBPACK_EXTERNAL_MODULE__schema_component_antd_form_item_FormItem_Settings_mjs__.useIsMuiltipleAble
|
|
320
334
|
},
|
|
321
335
|
{
|
|
322
336
|
...setTheDataScope,
|
|
@@ -4,6 +4,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__tachybase_components__ from "@tachybase/c
|
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE_react_i18next__ from "react-i18next";
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE__application_index_mjs__ from "../../application/index.mjs";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__icon_index_mjs__ from "../../icon/index.mjs";
|
|
7
8
|
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__ from "../../schema-component/index.mjs";
|
|
8
9
|
import * as __WEBPACK_EXTERNAL_MODULE__schema_component_antd_menu_MenuItemInitializers_index_mjs__ from "../../schema-component/antd/menu/MenuItemInitializers/index.mjs";
|
|
9
10
|
import * as __WEBPACK_EXTERNAL_MODULE__style_theme_index_mjs__ from "../../style/theme/index.mjs";
|
|
@@ -70,7 +71,10 @@ const GroupItem = ()=>{
|
|
|
70
71
|
theme
|
|
71
72
|
]);
|
|
72
73
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__application_index_mjs__.SchemaInitializerItem, {
|
|
73
|
-
|
|
74
|
+
icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__icon_index_mjs__.Icon, {
|
|
75
|
+
type: 'FolderAddOutlined'
|
|
76
|
+
}),
|
|
77
|
+
title: t('Create group'),
|
|
74
78
|
onClick: handleClick,
|
|
75
79
|
className: styles.menuItem
|
|
76
80
|
});
|