@tachybase/client 0.23.58 → 1.0.18
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/api-client/APIClient.d.ts +5 -2
- package/es/api-client/APIClient.mjs +93 -49
- package/es/api-client/hooks/useRequest.d.ts +2 -0
- package/es/application/Application.d.ts +3 -0
- package/es/application/Application.mjs +11 -0
- package/es/application/CustomRouterContextProvider.d.ts +54 -0
- package/es/application/CustomRouterContextProvider.mjs +209 -0
- package/es/application/NoticesManager.d.ts +12 -3
- package/es/application/NoticesManager.mjs +27 -3
- package/es/application/RouterManager.d.ts +8 -3
- package/es/application/RouterManager.mjs +48 -15
- package/es/application/schema-initializer/context/index.d.ts +1 -1
- package/es/block-provider/hooks/index.d.ts +2 -0
- package/es/block-provider/hooks/index.mjs +25 -21
- package/es/built-in/context-menu/ContextMenu.provider.mjs +6 -6
- package/es/built-in/context-menu/ContextMenuItemsProps.d.ts +4 -4
- package/es/built-in/context-menu/ContextMenuItemsProps.mjs +6 -6
- package/es/built-in/context-menu/index.mjs +1 -1
- package/es/built-in/context-menu/useContextMenu.d.ts +2 -2
- package/es/built-in/index.mjs +5 -0
- package/es/built-in/page-style/PageStyle.provider.mjs +2 -2
- package/es/built-in/pm/PluginManager.mjs +45 -45
- package/es/collection-manager/interfaces/email.d.ts +0 -1
- package/es/collection-manager/interfaces/input.d.ts +0 -2
- package/es/collection-manager/interfaces/integer.d.ts +0 -2
- package/es/collection-manager/interfaces/number.d.ts +0 -1
- package/es/collection-manager/interfaces/password.d.ts +0 -1
- package/es/collection-manager/interfaces/percent.d.ts +0 -1
- package/es/collection-manager/interfaces/phone.d.ts +0 -1
- package/es/collection-manager/interfaces/properties/index.d.ts +0 -2
- package/es/collection-manager/interfaces/properties/index.mjs +0 -2
- package/es/collection-manager/templates/sql.d.ts +1 -1
- package/es/collection-manager/templates/view.d.ts +1 -1
- package/es/data-source/collection-field-interface/CollectionFieldInterface.d.ts +1 -0
- package/es/data-source/collection-field-interface/CollectionFieldInterface.mjs +18 -0
- package/es/data-source/collection-field-interface/CollectionFieldInterfaceManager.d.ts +8 -1
- package/es/data-source/collection-field-interface/CollectionFieldInterfaceManager.mjs +20 -0
- package/es/data-source/commonsSettingsItem/fieldComponent.mjs +3 -1
- package/es/data-source/data-source/DataSource.d.ts +1 -1
- package/es/filter-provider/utils.mjs +6 -0
- package/es/i18n/i18n.mjs +7 -12
- package/es/modules/actions/delete/deleteActionSettings.mjs +10 -0
- package/es/modules/blocks/data-blocks/form/FilterItemCustomSettings.mjs +1 -1
- package/es/modules/blocks/data-blocks/form/fieldSettingsFormItem.mjs +9 -4
- package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.mjs +2 -2
- package/es/modules/blocks/data-blocks/table/tableBlockSettings.mjs +4 -0
- package/es/modules/blocks/data-blocks/table/tableColumnSettings.mjs +44 -0
- package/es/modules/blocks/filter-blocks/collapse/filterCollapseItemFieldSettings.mjs +4 -0
- package/es/modules/blocks/filter-blocks/form/filterFormItemFieldSettings.mjs +9 -0
- package/es/modules/fields/component/SubTable/secondLevelSelect.d.ts +11 -0
- package/es/modules/fields/component/SubTable/secondLevelSelect.mjs +102 -0
- package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.d.ts +79 -41
- package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.mjs +103 -100
- package/es/powered-by/index.mjs +4 -7
- package/es/schema-component/antd/action/Action.Designer.mjs +38 -3
- package/es/schema-component/antd/action/Action.Modal.mjs +0 -1
- package/es/schema-component/antd/action/Action.mjs +1 -3
- package/es/schema-component/antd/association-field/SubTabs/InternalCollapse.mjs +2 -1
- package/es/schema-component/antd/checkbox/Checkbox.mjs +6 -4
- package/es/schema-component/antd/index.d.ts +1 -0
- package/es/schema-component/antd/index.mjs +1 -0
- package/es/schema-component/antd/media-card/MediaCard.d.ts +11 -0
- package/es/schema-component/antd/media-card/MediaCard.mjs +35 -0
- package/es/schema-component/antd/media-card/index.d.ts +1 -0
- package/es/schema-component/antd/media-card/index.mjs +1 -0
- package/es/schema-component/antd/media-card/style.d.ts +3 -0
- package/es/schema-component/antd/media-card/style.mjs +25 -0
- package/es/schema-component/antd/page/Page.mjs +34 -24
- package/es/schema-component/antd/password/utils.d.ts +1 -1
- package/es/schema-component/common/dnd-context/index.mjs +1 -7
- package/es/schema-component/common/sortable-item/DragHandlePageTab.d.ts +1 -0
- package/es/schema-component/common/sortable-item/DragHandlePageTab.mjs +71 -0
- package/es/schema-component/common/sortable-item/DragHandlePageTab.style.d.ts +3 -0
- package/es/schema-component/common/sortable-item/DragHandlePageTab.style.mjs +25 -0
- package/es/schema-items/GeneralSettings.mjs +5 -0
- package/es/schema-settings/EditCustomDefaultValue.mjs +1 -1
- package/es/schema-settings/SchemaSettings.mjs +1 -1
- package/es/schema-settings/SchemaSettingsDefaultValue.mjs +2 -0
- package/es/schema-settings/utils/createModalSettingsItem.d.ts +26 -0
- package/es/schema-settings/utils/createModalSettingsItem.mjs +46 -0
- package/es/schema-settings/utils/createSelectSettingsItem.d.ts +25 -0
- package/es/schema-settings/utils/createSelectSettingsItem.mjs +40 -0
- package/es/schema-settings/utils/createSwitchSettingsItem.d.ts +21 -0
- package/es/schema-settings/utils/createSwitchSettingsItem.mjs +38 -0
- package/es/schema-settings/utils/createTextSettingsItem.d.ts +9 -0
- package/es/schema-settings/utils/createTextSettingsItem.mjs +21 -0
- package/es/schema-settings/utils/index.d.ts +4 -0
- package/es/schema-settings/utils/index.mjs +4 -0
- package/es/schema-settings/utils/util.d.ts +12 -0
- package/es/schema-settings/utils/util.mjs +24 -0
- package/es/user/CurrentUserProvider.mjs +6 -3
- package/lib/api-client/APIClient.js +93 -49
- package/lib/application/Application.js +11 -0
- package/lib/application/CustomRouterContextProvider.js +276 -0
- package/lib/application/NoticesManager.js +27 -3
- package/lib/application/RouterManager.js +49 -15
- package/lib/block-provider/hooks/index.js +76 -58
- package/lib/built-in/context-menu/ContextMenu.provider.js +6 -6
- package/lib/built-in/context-menu/ContextMenuItemsProps.js +6 -6
- package/lib/built-in/context-menu/index.js +1 -1
- package/lib/built-in/index.js +5 -0
- package/lib/built-in/page-style/PageStyle.provider.js +2 -2
- package/lib/built-in/pm/PluginManager.js +45 -45
- package/lib/collection-manager/interfaces/properties/index.js +0 -2
- package/lib/data-source/collection-field-interface/CollectionFieldInterface.js +18 -0
- package/lib/data-source/collection-field-interface/CollectionFieldInterfaceManager.js +20 -0
- package/lib/data-source/commonsSettingsItem/fieldComponent.js +3 -1
- package/lib/filter-provider/utils.js +6 -0
- package/lib/i18n/i18n.js +7 -12
- package/lib/locale/en_US.js +4 -0
- package/lib/locale/zh-CN.js +13 -1
- package/lib/modules/actions/delete/deleteActionSettings.js +10 -0
- package/lib/modules/blocks/data-blocks/form/FilterItemCustomSettings.js +1 -1
- package/lib/modules/blocks/data-blocks/form/fieldSettingsFormItem.js +9 -4
- package/lib/modules/blocks/data-blocks/table/hooks/useTableBlockProps.js +2 -2
- package/lib/modules/blocks/data-blocks/table/tableBlockSettings.js +4 -0
- package/lib/modules/blocks/data-blocks/table/tableColumnSettings.js +44 -0
- package/lib/modules/blocks/filter-blocks/collapse/filterCollapseItemFieldSettings.js +4 -0
- package/lib/modules/blocks/filter-blocks/form/filterFormItemFieldSettings.js +9 -0
- package/lib/modules/fields/component/SubTable/secondLevelSelect.js +136 -0
- package/lib/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.js +104 -103
- package/lib/powered-by/index.js +4 -7
- package/lib/schema-component/antd/action/Action.Designer.js +38 -3
- package/lib/schema-component/antd/action/Action.Modal.js +0 -1
- package/lib/schema-component/antd/action/Action.js +1 -3
- package/lib/schema-component/antd/association-field/SubTabs/InternalCollapse.js +2 -1
- package/lib/schema-component/antd/checkbox/Checkbox.js +6 -4
- package/lib/schema-component/antd/index.js +18 -4
- package/lib/schema-component/antd/media-card/MediaCard.js +69 -0
- package/lib/schema-component/antd/media-card/index.js +65 -0
- package/lib/schema-component/antd/media-card/style.js +59 -0
- package/lib/schema-component/antd/page/Page.js +34 -24
- package/lib/schema-component/common/dnd-context/index.js +1 -7
- package/lib/schema-component/common/sortable-item/DragHandlePageTab.js +105 -0
- package/lib/schema-component/common/sortable-item/DragHandlePageTab.style.js +59 -0
- package/lib/schema-items/GeneralSettings.js +5 -0
- package/lib/schema-settings/EditCustomDefaultValue.js +1 -1
- package/lib/schema-settings/SchemaSettings.js +1 -1
- package/lib/schema-settings/SchemaSettingsDefaultValue.js +2 -0
- package/lib/schema-settings/utils/createModalSettingsItem.js +94 -0
- package/lib/schema-settings/utils/createSelectSettingsItem.js +88 -0
- package/lib/schema-settings/utils/createSwitchSettingsItem.js +86 -0
- package/lib/schema-settings/utils/createTextSettingsItem.js +55 -0
- package/lib/schema-settings/utils/index.js +92 -0
- package/lib/schema-settings/utils/util.js +74 -0
- package/lib/user/CurrentUserProvider.js +6 -3
- package/package.json +7 -7
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
useStyles: ()=>useStyles
|
|
30
|
+
});
|
|
31
|
+
const external_antd_style_namespaceObject = require("antd-style");
|
|
32
|
+
function _tagged_template_literal(strings, raw) {
|
|
33
|
+
if (!raw) raw = strings.slice(0);
|
|
34
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
35
|
+
raw: {
|
|
36
|
+
value: Object.freeze(raw)
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
function _templateObject() {
|
|
41
|
+
const data = _tagged_template_literal([
|
|
42
|
+
"\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: 10px;\n width: fit-content;\n padding: 10px;\n cursor: pointer;\n\n &.layout {\n flex-direction: column;\n }\n :hover {\n border-radius: 10px;\n transform: scale(1.05);\n transition: all 0.3s;\n }\n\n &.need-hover:hover {\n background-color: var(--colorPrimaryText);\n }\n\n .icon-wrapper {\n padding: 20px;\n border-radius: 40%;\n .icon {\n padding: 10px;\n border-radius: 50%;\n background-color: #ffffff;\n font-size: 20px;\n }\n }\n\n .title {\n flex: 1;\n display: inline-block;\n font-size: 16px;\n color: #2f2f2f;\n overflow: hidden;\n }\n "
|
|
43
|
+
]);
|
|
44
|
+
_templateObject = function() {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
const useStyles = (0, external_antd_style_namespaceObject.createStyles)((param)=>{
|
|
50
|
+
let { css, token } = param;
|
|
51
|
+
return {
|
|
52
|
+
mediaCardStyle: css(_templateObject())
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
var __webpack_export_target__ = exports;
|
|
56
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
57
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
58
|
+
value: true
|
|
59
|
+
});
|
|
@@ -47,6 +47,7 @@ const components_namespaceObject = require("@tachybase/components");
|
|
|
47
47
|
const schema_namespaceObject = require("@tachybase/schema");
|
|
48
48
|
const icons_namespaceObject = require("@ant-design/icons");
|
|
49
49
|
const pro_layout_namespaceObject = require("@ant-design/pro-layout");
|
|
50
|
+
const core_namespaceObject = require("@dnd-kit/core");
|
|
50
51
|
const external_antd_namespaceObject = require("antd");
|
|
51
52
|
const external_antd_style_namespaceObject = require("antd-style");
|
|
52
53
|
const external_classnames_namespaceObject = require("classnames");
|
|
@@ -65,6 +66,7 @@ const useGetAriaLabelOfSchemaInitializer_js_namespaceObject = require("../../../
|
|
|
65
66
|
const theme_index_js_namespaceObject = require("../../../style/theme/index.js");
|
|
66
67
|
const external_common_index_js_namespaceObject = require("../../common/index.js");
|
|
67
68
|
const sortable_item_index_js_namespaceObject = require("../../common/sortable-item/index.js");
|
|
69
|
+
const DragHandlePageTab_js_namespaceObject = require("../../common/sortable-item/DragHandlePageTab.js");
|
|
68
70
|
const external_core_index_js_namespaceObject = require("../../core/index.js");
|
|
69
71
|
const external_hooks_index_js_namespaceObject = require("../../hooks/index.js");
|
|
70
72
|
const external_error_fallback_index_js_namespaceObject = require("../error-fallback/index.js");
|
|
@@ -134,7 +136,7 @@ const PageHeader = (props)=>{
|
|
|
134
136
|
const { theme } = (0, theme_index_js_namespaceObject.useGlobalTheme)();
|
|
135
137
|
const options = (0, external_react_namespaceObject.useContext)(schema_namespaceObject.SchemaOptionsContext);
|
|
136
138
|
const compile = (0, external_hooks_index_js_namespaceObject.useCompile)();
|
|
137
|
-
const {
|
|
139
|
+
const { showScrollArea } = (0, useContextMenu_js_namespaceObject.useContextMenu)();
|
|
138
140
|
const hidePageTitle = null === (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops ? void 0 : _fieldSchema_xcomponentprops.hidePageTitle;
|
|
139
141
|
const pageHeaderTitle = hidePageTitle ? void 0 : fieldSchema.title || compile(title);
|
|
140
142
|
const items = fieldSchema.mapProperties((schema)=>({
|
|
@@ -153,12 +155,12 @@ const PageHeader = (props)=>{
|
|
|
153
155
|
ghost: false,
|
|
154
156
|
title: pageHeaderTitle || ' ',
|
|
155
157
|
...parentProps,
|
|
156
|
-
extra: !enablePageTabs &&
|
|
158
|
+
extra: !enablePageTabs && showScrollArea && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_index_js_namespaceObject.ScrollArea, {}),
|
|
157
159
|
footer: enablePageTabs && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TabComponent, {
|
|
158
160
|
activeKey: activeKey,
|
|
159
161
|
setLoading: setLoading,
|
|
160
162
|
setSearchParams: setSearchParams,
|
|
161
|
-
|
|
163
|
+
showScrollArea: showScrollArea,
|
|
162
164
|
options: options,
|
|
163
165
|
theme: theme,
|
|
164
166
|
items: items
|
|
@@ -167,9 +169,14 @@ const PageHeader = (props)=>{
|
|
|
167
169
|
});
|
|
168
170
|
};
|
|
169
171
|
const TabComponent = (props)=>{
|
|
170
|
-
const { activeKey, setLoading, setSearchParams,
|
|
172
|
+
const { activeKey, setLoading, setSearchParams, showScrollArea, options, theme, items } = props;
|
|
171
173
|
const { styles } = (0, external_Page_style_js_namespaceObject.useStyles)();
|
|
172
174
|
const [hasMounted, setHasMounted] = (0, external_react_namespaceObject.useState)(false);
|
|
175
|
+
const sensors = (0, core_namespaceObject.useSensors)((0, core_namespaceObject.useSensor)(core_namespaceObject.PointerSensor, {
|
|
176
|
+
activationConstraint: {
|
|
177
|
+
distance: 5
|
|
178
|
+
}
|
|
179
|
+
}));
|
|
173
180
|
const handleTabClick = (activeKey)=>{
|
|
174
181
|
setLoading(true);
|
|
175
182
|
setSearchParams([
|
|
@@ -188,6 +195,7 @@ const TabComponent = (props)=>{
|
|
|
188
195
|
});
|
|
189
196
|
}, []);
|
|
190
197
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_common_index_js_namespaceObject.DndContext, {
|
|
198
|
+
sensors: sensors,
|
|
191
199
|
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Tabs, {
|
|
192
200
|
className: styles.tabComponentClass,
|
|
193
201
|
type: "card",
|
|
@@ -198,7 +206,7 @@ const TabComponent = (props)=>{
|
|
|
198
206
|
onTabClick: handleTabClick,
|
|
199
207
|
tabBarExtraContent: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TabBarExtraContent, {
|
|
200
208
|
theme: theme,
|
|
201
|
-
|
|
209
|
+
showScrollArea: showScrollArea,
|
|
202
210
|
options: options
|
|
203
211
|
})
|
|
204
212
|
})
|
|
@@ -208,31 +216,33 @@ const TabItem = (props)=>{
|
|
|
208
216
|
const { schema } = props;
|
|
209
217
|
const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
|
|
210
218
|
const { styles } = (0, external_Page_style_js_namespaceObject.useStyles)();
|
|
211
|
-
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.
|
|
219
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(sortable_item_index_js_namespaceObject.SortableItem, {
|
|
212
220
|
id: schema.name,
|
|
213
221
|
schema: schema,
|
|
214
222
|
className: external_classnames_default()('tb-action-link', 'designerCss', props.className, styles.tabItemClass),
|
|
215
|
-
children:
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
223
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(DragHandlePageTab_js_namespaceObject.DragHandlePageTab, {
|
|
224
|
+
children: [
|
|
225
|
+
schema['x-icon'] && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_icon_index_js_namespaceObject.Icon, {
|
|
226
|
+
style: {
|
|
227
|
+
marginRight: 8
|
|
228
|
+
},
|
|
229
|
+
type: schema['x-icon']
|
|
230
|
+
}),
|
|
231
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
232
|
+
children: schema.title || t('Unnamed')
|
|
233
|
+
}),
|
|
234
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
235
|
+
className: "tab-designer-wrapper",
|
|
236
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_PageTabDesigner_js_namespaceObject.PageTabDesigner, {
|
|
237
|
+
schema: schema
|
|
238
|
+
})
|
|
229
239
|
})
|
|
230
|
-
|
|
231
|
-
|
|
240
|
+
]
|
|
241
|
+
})
|
|
232
242
|
});
|
|
233
243
|
};
|
|
234
244
|
const TabBarExtraContent = (props)=>{
|
|
235
|
-
const {
|
|
245
|
+
const { showScrollArea, options, theme } = props;
|
|
236
246
|
const dn = (0, external_hooks_index_js_namespaceObject.useDesignable)();
|
|
237
247
|
const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
|
|
238
248
|
const { getAriaLabel } = (0, useGetAriaLabelOfSchemaInitializer_js_namespaceObject.useGetAriaLabelOfSchemaInitializer)();
|
|
@@ -265,7 +275,7 @@ const TabBarExtraContent = (props)=>{
|
|
|
265
275
|
icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(icons_namespaceObject.PlusOutlined, {}),
|
|
266
276
|
onClick: handleAddTab
|
|
267
277
|
}),
|
|
268
|
-
|
|
278
|
+
showScrollArea && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_index_js_namespaceObject.ScrollArea, {
|
|
269
279
|
className: "scroll-area-extra-content"
|
|
270
280
|
})
|
|
271
281
|
]
|
|
@@ -113,13 +113,7 @@ const DndContext = (0, schema_namespaceObject.observer)((props)=>{
|
|
|
113
113
|
dropAnimation: {
|
|
114
114
|
duration: 10,
|
|
115
115
|
easing: 'cubic-bezier(0.18, 0.67, 0.6, 1.22)'
|
|
116
|
-
}
|
|
117
|
-
children: visible && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
118
|
-
style: {
|
|
119
|
-
whiteSpace: 'nowrap'
|
|
120
|
-
},
|
|
121
|
-
children: t('Dragging')
|
|
122
|
-
})
|
|
116
|
+
}
|
|
123
117
|
}),
|
|
124
118
|
props.children
|
|
125
119
|
]
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
DragHandlePageTab: ()=>DragHandlePageTab
|
|
30
|
+
});
|
|
31
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
32
|
+
const external_react_namespaceObject = require("react");
|
|
33
|
+
const external_antd_style_namespaceObject = require("antd-style");
|
|
34
|
+
const index_js_namespaceObject = require("../../hooks/index.js");
|
|
35
|
+
const external_DragHandlePageTab_style_js_namespaceObject = require("./DragHandlePageTab.style.js");
|
|
36
|
+
const external_SortableItem_js_namespaceObject = require("./SortableItem.js");
|
|
37
|
+
const DragHandlePageTab = (props)=>{
|
|
38
|
+
const { isSubMenu, children, className: overStyle, isAdminMenu } = props;
|
|
39
|
+
const { draggable } = (0, external_react_namespaceObject.useContext)(external_SortableItem_js_namespaceObject.SortableContext);
|
|
40
|
+
const { designable } = (0, index_js_namespaceObject.useDesignable)();
|
|
41
|
+
const { attributes, listeners, setNodeRef, transform, isDragging } = draggable;
|
|
42
|
+
const { styles } = (0, external_DragHandlePageTab_style_js_namespaceObject.useStyles)();
|
|
43
|
+
const ref = (0, external_react_namespaceObject.useRef)(null);
|
|
44
|
+
const [dimensions, setDimensions] = (0, external_react_namespaceObject.useState)({
|
|
45
|
+
width: 0,
|
|
46
|
+
height: 0
|
|
47
|
+
});
|
|
48
|
+
const [initialPosition, setInitialPosition] = (0, external_react_namespaceObject.useState)({
|
|
49
|
+
x: 0,
|
|
50
|
+
y: 0
|
|
51
|
+
});
|
|
52
|
+
const centerOffset = {
|
|
53
|
+
x: 4 * dimensions.width,
|
|
54
|
+
y: 3 * dimensions.height
|
|
55
|
+
};
|
|
56
|
+
const style = {
|
|
57
|
+
position: isDragging ? 'fixed' : 'static',
|
|
58
|
+
top: isDragging ? initialPosition.y - centerOffset.y : 0,
|
|
59
|
+
left: isDragging ? initialPosition.x - centerOffset.x : 0,
|
|
60
|
+
width: isDragging ? 'max-content' : '100%',
|
|
61
|
+
height: isDragging ? 'max-content' : '100%',
|
|
62
|
+
zIndex: isDragging ? 999 : 'auto',
|
|
63
|
+
pointerEvents: isDragging ? 'none' : 'auto',
|
|
64
|
+
transform: transform ? "translate3d(".concat(transform.x, "px, ").concat(transform.y, "px, 0) scale(").concat(isDragging ? 1.05 : 1, ")") : void 0,
|
|
65
|
+
boxShadow: isDragging ? '0 4px 8px rgba(0, 0, 0, 0.1)' : 'none'
|
|
66
|
+
};
|
|
67
|
+
const handleMouseDown = (event)=>{
|
|
68
|
+
if (ref.current) {
|
|
69
|
+
const { width, height } = ref.current.getBoundingClientRect();
|
|
70
|
+
const { clientX, clientY } = event;
|
|
71
|
+
setDimensions({
|
|
72
|
+
width,
|
|
73
|
+
height
|
|
74
|
+
});
|
|
75
|
+
setInitialPosition({
|
|
76
|
+
x: clientX,
|
|
77
|
+
y: clientY
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
if (!designable) return children;
|
|
82
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
83
|
+
ref: setNodeRef,
|
|
84
|
+
className: (0, external_antd_style_namespaceObject.cx)(styles.dragHandleMenu, {
|
|
85
|
+
draggable: isDragging,
|
|
86
|
+
leftBorder: isSubMenu && isDragging,
|
|
87
|
+
adminMenu: isAdminMenu && isDragging
|
|
88
|
+
}, overStyle),
|
|
89
|
+
style: style,
|
|
90
|
+
...listeners,
|
|
91
|
+
...attributes,
|
|
92
|
+
role: "none",
|
|
93
|
+
onMouseDown: handleMouseDown,
|
|
94
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
95
|
+
ref: ref,
|
|
96
|
+
className: 'wrapper',
|
|
97
|
+
children: children
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
var __webpack_export_target__ = exports;
|
|
102
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
103
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
104
|
+
value: true
|
|
105
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
useStyles: ()=>useStyles
|
|
30
|
+
});
|
|
31
|
+
const external_antd_style_namespaceObject = require("antd-style");
|
|
32
|
+
function _tagged_template_literal(strings, raw) {
|
|
33
|
+
if (!raw) raw = strings.slice(0);
|
|
34
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
35
|
+
raw: {
|
|
36
|
+
value: Object.freeze(raw)
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
function _templateObject() {
|
|
41
|
+
const data = _tagged_template_literal([
|
|
42
|
+
"\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\n .wrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-around;\n }\n "
|
|
43
|
+
]);
|
|
44
|
+
_templateObject = function() {
|
|
45
|
+
return data;
|
|
46
|
+
};
|
|
47
|
+
return data;
|
|
48
|
+
}
|
|
49
|
+
const useStyles = (0, external_antd_style_namespaceObject.createStyles)((param)=>{
|
|
50
|
+
let { css, token } = param;
|
|
51
|
+
return {
|
|
52
|
+
dragHandleMenu: css(_templateObject())
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
var __webpack_export_target__ = exports;
|
|
56
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
57
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
58
|
+
value: true
|
|
59
|
+
});
|
|
@@ -33,6 +33,7 @@ const external_react_i18next_namespaceObject = require("react-i18next");
|
|
|
33
33
|
const index_js_namespaceObject = require("../application/schema-toolbar/index.js");
|
|
34
34
|
const external_collection_manager_index_js_namespaceObject = require("../collection-manager/index.js");
|
|
35
35
|
const external_schema_component_index_js_namespaceObject = require("../schema-component/index.js");
|
|
36
|
+
const SchemaSettingsDefaultValue_js_namespaceObject = require("../schema-settings/SchemaSettingsDefaultValue.js");
|
|
36
37
|
const generalSettingsItems = [
|
|
37
38
|
{
|
|
38
39
|
name: 'editFieldTitle',
|
|
@@ -232,6 +233,10 @@ const generalSettingsItems = [
|
|
|
232
233
|
const { required = true } = (0, index_js_namespaceObject.useSchemaToolbar)();
|
|
233
234
|
return !field.readPretty && 'FormField' !== fieldSchema['x-component'] && required;
|
|
234
235
|
}
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: 'editDefaultValue',
|
|
239
|
+
Component: SchemaSettingsDefaultValue_js_namespaceObject.SchemaSettingsDefaultValue
|
|
235
240
|
}
|
|
236
241
|
];
|
|
237
242
|
var __webpack_export_target__ = exports;
|
|
@@ -112,7 +112,7 @@ function _tagged_template_literal(strings, raw) {
|
|
|
112
112
|
}
|
|
113
113
|
function _templateObject() {
|
|
114
114
|
const data = _tagged_template_literal([
|
|
115
|
-
"\n .ant-dropdown-menu-item-group-list {\n max-height:
|
|
115
|
+
"\n .ant-dropdown-menu-item-group-list {\n max-height: 400px;\n overflow-y: auto;\n }\n "
|
|
116
116
|
]);
|
|
117
117
|
_templateObject = function() {
|
|
118
118
|
return data;
|
|
@@ -224,6 +224,8 @@ const SchemaSettingsDefaultValue = function(props) {
|
|
|
224
224
|
const schema = {
|
|
225
225
|
['x-uid']: fieldSchema['x-uid']
|
|
226
226
|
};
|
|
227
|
+
v.default = v.default || null;
|
|
228
|
+
field.value = v.default;
|
|
227
229
|
fieldSchema.default = v.default;
|
|
228
230
|
if (!v.default && 0 !== v.default) field.value = null;
|
|
229
231
|
schema.default = v.default;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = function(module) {
|
|
5
|
+
var getter = module && module.__esModule ? function() {
|
|
6
|
+
return module['default'];
|
|
7
|
+
} : function() {
|
|
8
|
+
return module;
|
|
9
|
+
};
|
|
10
|
+
__webpack_require__.d(getter, {
|
|
11
|
+
a: getter
|
|
12
|
+
});
|
|
13
|
+
return getter;
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
18
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: definition[key]
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = function(obj, prop) {
|
|
26
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
27
|
+
};
|
|
28
|
+
})();
|
|
29
|
+
(()=>{
|
|
30
|
+
__webpack_require__.r = function(exports1) {
|
|
31
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
32
|
+
value: 'Module'
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
35
|
+
value: true
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
var __webpack_exports__ = {};
|
|
40
|
+
__webpack_require__.r(__webpack_exports__);
|
|
41
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
42
|
+
createModalSettingsItem: ()=>createModalSettingsItem
|
|
43
|
+
});
|
|
44
|
+
const external_lodash_namespaceObject = require("lodash");
|
|
45
|
+
var external_lodash_default = /*#__PURE__*/ __webpack_require__.n(external_lodash_namespaceObject);
|
|
46
|
+
const external_react_i18next_namespaceObject = require("react-i18next");
|
|
47
|
+
const index_js_namespaceObject = require("../../schema-component/index.js");
|
|
48
|
+
const external_util_js_namespaceObject = require("./util.js");
|
|
49
|
+
function createModalSettingsItem(options) {
|
|
50
|
+
const { name, parentSchemaKey, valueKeys, schema, title, useSubmit = external_util_js_namespaceObject.useHookDefault, useVisible, defaultValue: propsDefaultValue, useDefaultValue = external_util_js_namespaceObject.useHookDefault, width, type = 'common' } = options;
|
|
51
|
+
return {
|
|
52
|
+
name,
|
|
53
|
+
type: 'actionModal',
|
|
54
|
+
useVisible,
|
|
55
|
+
useComponentProps () {
|
|
56
|
+
const fieldSchema = (0, external_util_js_namespaceObject.useSchemaByType)(type);
|
|
57
|
+
const { dn } = (0, index_js_namespaceObject.useDesignable)();
|
|
58
|
+
const defaultValue = useDefaultValue(propsDefaultValue);
|
|
59
|
+
const values = parentSchemaKey ? external_lodash_default().get(fieldSchema, parentSchemaKey) : void 0;
|
|
60
|
+
const compile = (0, index_js_namespaceObject.useCompile)();
|
|
61
|
+
const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
|
|
62
|
+
const onSubmit = useSubmit();
|
|
63
|
+
const { fieldSchema: tableColumnSchema } = (0, index_js_namespaceObject.useColumnSchema)() || {};
|
|
64
|
+
return {
|
|
65
|
+
title: 'function' == typeof title ? title(t) : compile(title),
|
|
66
|
+
width,
|
|
67
|
+
schema: schema({
|
|
68
|
+
...defaultValue,
|
|
69
|
+
...values
|
|
70
|
+
}),
|
|
71
|
+
onSubmit (values) {
|
|
72
|
+
const newSchema = (0, external_util_js_namespaceObject.getNewSchema)({
|
|
73
|
+
fieldSchema,
|
|
74
|
+
parentSchemaKey: parentSchemaKey,
|
|
75
|
+
value: values,
|
|
76
|
+
valueKeys
|
|
77
|
+
});
|
|
78
|
+
if (tableColumnSchema) {
|
|
79
|
+
dn.emit('patch', {
|
|
80
|
+
schema: newSchema
|
|
81
|
+
});
|
|
82
|
+
dn.refresh();
|
|
83
|
+
} else dn.deepMerge(newSchema);
|
|
84
|
+
return null == onSubmit ? void 0 : onSubmit(values);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
var __webpack_export_target__ = exports;
|
|
91
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
92
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
93
|
+
value: true
|
|
94
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = function(module) {
|
|
5
|
+
var getter = module && module.__esModule ? function() {
|
|
6
|
+
return module['default'];
|
|
7
|
+
} : function() {
|
|
8
|
+
return module;
|
|
9
|
+
};
|
|
10
|
+
__webpack_require__.d(getter, {
|
|
11
|
+
a: getter
|
|
12
|
+
});
|
|
13
|
+
return getter;
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
18
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: definition[key]
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = function(obj, prop) {
|
|
26
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
27
|
+
};
|
|
28
|
+
})();
|
|
29
|
+
(()=>{
|
|
30
|
+
__webpack_require__.r = function(exports1) {
|
|
31
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
32
|
+
value: 'Module'
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
35
|
+
value: true
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
var __webpack_exports__ = {};
|
|
40
|
+
__webpack_require__.r(__webpack_exports__);
|
|
41
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
42
|
+
createSelectSchemaSettingsItem: ()=>createSelectSchemaSettingsItem
|
|
43
|
+
});
|
|
44
|
+
const external_lodash_namespaceObject = require("lodash");
|
|
45
|
+
var external_lodash_default = /*#__PURE__*/ __webpack_require__.n(external_lodash_namespaceObject);
|
|
46
|
+
const external_react_i18next_namespaceObject = require("react-i18next");
|
|
47
|
+
const index_js_namespaceObject = require("../../schema-component/index.js");
|
|
48
|
+
const external_util_js_namespaceObject = require("./util.js");
|
|
49
|
+
const createSelectSchemaSettingsItem = (options)=>{
|
|
50
|
+
const { name, title, options: propsOptions, useOptions = external_util_js_namespaceObject.useHookDefault, schemaKey, useVisible, type = 'common', defaultValue: propsDefaultValue, useDefaultValue = external_util_js_namespaceObject.useHookDefault } = options;
|
|
51
|
+
return {
|
|
52
|
+
name,
|
|
53
|
+
type: 'select',
|
|
54
|
+
useVisible,
|
|
55
|
+
useComponentProps () {
|
|
56
|
+
const fieldSchema = (0, external_util_js_namespaceObject.useSchemaByType)(type);
|
|
57
|
+
const { fieldSchema: tableColumnSchema } = (0, index_js_namespaceObject.useColumnSchema)() || {};
|
|
58
|
+
const { dn } = (0, index_js_namespaceObject.useDesignable)();
|
|
59
|
+
const options = useOptions(propsOptions);
|
|
60
|
+
const defaultValue = useDefaultValue(propsDefaultValue);
|
|
61
|
+
const compile = (0, index_js_namespaceObject.useCompile)();
|
|
62
|
+
const { t } = (0, external_react_i18next_namespaceObject.useTranslation)();
|
|
63
|
+
return {
|
|
64
|
+
title: 'function' == typeof title ? title(t) : compile(title),
|
|
65
|
+
options,
|
|
66
|
+
value: external_lodash_default().get(fieldSchema, schemaKey, defaultValue),
|
|
67
|
+
onChange (v) {
|
|
68
|
+
const newSchema = (0, external_util_js_namespaceObject.getNewSchema)({
|
|
69
|
+
fieldSchema,
|
|
70
|
+
schemaKey,
|
|
71
|
+
value: v
|
|
72
|
+
});
|
|
73
|
+
if (tableColumnSchema) {
|
|
74
|
+
dn.emit('patch', {
|
|
75
|
+
schema: newSchema
|
|
76
|
+
});
|
|
77
|
+
dn.refresh();
|
|
78
|
+
} else dn.deepMerge(newSchema);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
var __webpack_export_target__ = exports;
|
|
85
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
86
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
87
|
+
value: true
|
|
88
|
+
});
|