@nocobase/client 0.10.0-alpha.2 → 0.10.0-alpha.3
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/acl/Configuration/MenuItemsProvider.js +3 -3
- package/es/application/Application.js +2 -2
- package/es/auth/SigninPage.js +12 -9
- package/es/collection-manager/Configuration/AddCollectionAction.js +31 -25
- package/es/collection-manager/Configuration/AddFieldAction.js +45 -32
- package/es/collection-manager/Configuration/AddSubFieldAction.js +24 -19
- package/es/collection-manager/Configuration/ConfigurationTabs.js +57 -50
- package/es/collection-manager/hooks/useOptions.js +39 -36
- package/es/collection-manager/interfaces/integer.js +1 -1
- package/es/collection-manager/interfaces/number.js +3 -3
- package/es/collection-manager/interfaces/percent.js +3 -3
- package/es/formula/Expression.js +66 -46
- package/es/hooks/index.d.ts +1 -0
- package/es/hooks/index.js +1 -0
- package/es/hooks/useAdminSchemaUid.d.ts +1 -0
- package/es/hooks/useAdminSchemaUid.js +6 -0
- package/es/hooks/useMenuItem.d.ts +37 -0
- package/es/hooks/useMenuItem.js +90 -0
- package/es/index.d.ts +2 -3
- package/es/index.js +3 -4
- package/es/locale/en_US.d.ts +3 -1
- package/es/locale/en_US.js +4 -2
- package/es/locale/es_ES.d.ts +1 -1
- package/es/locale/es_ES.js +1 -1
- package/es/locale/ja_JP.d.ts +3 -1
- package/es/locale/ja_JP.js +4 -2
- package/es/locale/pt_BR.d.ts +1 -1
- package/es/locale/pt_BR.js +1 -1
- package/es/locale/ru_RU.d.ts +1 -1
- package/es/locale/ru_RU.js +1 -1
- package/es/locale/zh_CN.d.ts +3 -1
- package/es/locale/zh_CN.js +3 -1
- package/es/pm/Card.js +5 -5
- package/es/pm/PluginManagerLink.js +16 -12
- package/es/pm/index.d.ts +2 -1
- package/es/pm/index.js +36 -22
- package/es/route-switch/antd/admin-layout/index.js +4 -4
- package/es/schema-component/antd/action/Action.Designer.js +3 -5
- package/es/schema-component/antd/action/Action.Drawer.js +1 -1
- package/es/schema-component/antd/action/ActionBar.js +1 -1
- package/es/schema-component/antd/association-field/SubTable.js +1 -1
- package/es/schema-component/antd/calendar/DeleteEvent.js +1 -1
- package/es/schema-component/antd/cascader/Cascader.js +1 -1
- package/es/schema-component/antd/form-item/FormItem.js +10 -3
- package/es/schema-component/antd/grid-card/GridCard.Designer.js +3 -4
- package/es/schema-component/antd/index.less +1 -3
- package/es/schema-component/antd/menu/Menu.js +306 -156
- package/es/schema-component/antd/page/Page.js +29 -23
- package/es/schema-component/antd/remote-select/RemoteSelect.js +58 -10
- package/es/schema-component/antd/remote-select/utils.d.ts +4 -0
- package/es/schema-component/antd/remote-select/utils.js +31 -0
- package/es/schema-component/antd/table-v2/FilterDynamicComponent.js +17 -2
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +51 -12
- package/es/schema-component/antd/table-v2/Table.js +9 -7
- package/es/schema-component/antd/tabs/Tabs.js +35 -22
- package/es/schema-component/antd/tabs/context.d.ts +1 -1
- package/es/schema-component/antd/upload/ReadPretty.js +7 -3
- package/es/schema-component/antd/variable/VariableSelect.js +1 -1
- package/es/schema-component/common/utils/uitls.d.ts +1 -0
- package/es/schema-component/common/utils/uitls.js +1 -1
- package/es/schema-initializer/SchemaInitializer.d.ts +7 -2
- package/es/schema-initializer/SchemaInitializer.js +155 -102
- package/es/schema-initializer/SelectCollection.d.ts +1 -2
- package/es/schema-initializer/SelectCollection.js +19 -16
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
- package/es/schema-initializer/buttons/TableActionInitializers.js +5 -5
- package/es/schema-initializer/buttons/TableColumnInitializers.js +3 -2
- package/es/schema-initializer/components/CreateRecordAction.js +37 -27
- package/es/schema-initializer/components/assigned-field/AssignedField.js +2 -1
- package/es/schema-initializer/items/CalendarBlockInitializer.js +2 -2
- package/es/schema-initializer/utils.d.ts +0 -1
- package/es/schema-initializer/utils.js +40 -25
- package/es/schema-settings/SchemaSettings.js +123 -46
- package/es/schema-settings/VariableInput/hooks/useFormVariable.d.ts +19 -0
- package/es/schema-settings/VariableInput/hooks/useFormVariable.js +89 -0
- package/es/schema-settings/VariableInput/hooks/useIterationVariable.d.ts +8 -0
- package/es/schema-settings/VariableInput/hooks/useIterationVariable.js +77 -0
- package/es/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +5 -12
- package/es/schema-settings/VariableInput/hooks/useVariableOptions.js +19 -3
- package/es/schema-templates/BlockTemplateDetails.js +5 -1
- package/es/schema-templates/BlockTemplatePage.js +4 -1
- package/es/user/ChangePassword.d.ts +1 -2
- package/es/user/ChangePassword.js +30 -26
- package/es/user/CurrentUser.js +172 -141
- package/es/user/EditProfile.d.ts +1 -2
- package/es/user/EditProfile.js +30 -24
- package/es/user/LanguageSettings.d.ts +1 -2
- package/es/user/LanguageSettings.js +67 -64
- package/es/user/SigninPage.js +25 -22
- package/es/user/SwitchRole.d.ts +1 -2
- package/es/user/SwitchRole.js +54 -49
- package/es/user/ThemeSettings.d.ts +1 -2
- package/es/user/ThemeSettings.js +56 -52
- package/lib/acl/Configuration/MenuItemsProvider.js +3 -3
- package/lib/application/Application.js +2 -2
- package/lib/auth/SigninPage.js +25 -22
- package/lib/collection-manager/Configuration/AddCollectionAction.js +29 -23
- package/lib/collection-manager/Configuration/AddFieldAction.js +43 -30
- package/lib/collection-manager/Configuration/AddSubFieldAction.js +22 -17
- package/lib/collection-manager/Configuration/ConfigurationTabs.js +57 -49
- package/lib/collection-manager/hooks/useOptions.js +39 -36
- package/lib/collection-manager/interfaces/integer.js +1 -1
- package/lib/collection-manager/interfaces/number.js +3 -3
- package/lib/collection-manager/interfaces/percent.js +3 -3
- package/lib/formula/Expression.js +64 -44
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +11 -0
- package/lib/hooks/useAdminSchemaUid.d.ts +1 -0
- package/lib/hooks/useAdminSchemaUid.js +13 -0
- package/lib/hooks/useMenuItem.d.ts +37 -0
- package/lib/hooks/useMenuItem.js +104 -0
- package/lib/index.d.ts +2 -3
- package/lib/index.js +22 -33
- package/lib/locale/en_US.d.ts +3 -1
- package/lib/locale/en_US.js +4 -2
- package/lib/locale/es_ES.d.ts +1 -1
- package/lib/locale/es_ES.js +1 -1
- package/lib/locale/ja_JP.d.ts +3 -1
- package/lib/locale/ja_JP.js +4 -2
- package/lib/locale/pt_BR.d.ts +1 -1
- package/lib/locale/pt_BR.js +1 -1
- package/lib/locale/ru_RU.d.ts +1 -1
- package/lib/locale/ru_RU.js +1 -1
- package/lib/locale/zh_CN.d.ts +3 -1
- package/lib/locale/zh_CN.js +3 -1
- package/lib/pm/Card.js +6 -6
- package/lib/pm/PluginManagerLink.js +15 -10
- package/lib/pm/index.d.ts +2 -1
- package/lib/pm/index.js +37 -23
- package/lib/route-switch/antd/admin-layout/index.js +3 -3
- package/lib/schema-component/antd/action/Action.Designer.js +2 -4
- package/lib/schema-component/antd/action/Action.Drawer.js +1 -1
- package/lib/schema-component/antd/association-field/SubTable.js +1 -1
- package/lib/schema-component/antd/calendar/DeleteEvent.js +1 -1
- package/lib/schema-component/antd/cascader/Cascader.js +1 -1
- package/lib/schema-component/antd/form-item/FormItem.js +10 -3
- package/lib/schema-component/antd/grid-card/GridCard.Designer.js +4 -5
- package/lib/schema-component/antd/index.less +1 -3
- package/lib/schema-component/antd/menu/Menu.js +304 -154
- package/lib/schema-component/antd/page/Page.js +29 -23
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +55 -7
- package/lib/schema-component/antd/remote-select/utils.d.ts +4 -0
- package/lib/schema-component/antd/remote-select/utils.js +41 -0
- package/lib/schema-component/antd/table-v2/FilterDynamicComponent.js +17 -2
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +50 -11
- package/lib/schema-component/antd/table-v2/Table.js +9 -7
- package/lib/schema-component/antd/tabs/Tabs.js +34 -21
- package/lib/schema-component/antd/tabs/context.d.ts +1 -1
- package/lib/schema-component/antd/upload/ReadPretty.js +7 -3
- package/lib/schema-component/antd/variable/VariableSelect.js +1 -1
- package/lib/schema-component/common/utils/uitls.d.ts +1 -0
- package/lib/schema-component/common/utils/uitls.js +3 -1
- package/lib/schema-initializer/SchemaInitializer.d.ts +7 -2
- package/lib/schema-initializer/SchemaInitializer.js +154 -101
- package/lib/schema-initializer/SelectCollection.d.ts +1 -2
- package/lib/schema-initializer/SelectCollection.js +22 -17
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +1 -1
- package/lib/schema-initializer/buttons/TableActionInitializers.js +5 -5
- package/lib/schema-initializer/buttons/TableColumnInitializers.js +2 -1
- package/lib/schema-initializer/components/CreateRecordAction.js +35 -25
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +2 -1
- package/lib/schema-initializer/items/CalendarBlockInitializer.js +9 -9
- package/lib/schema-initializer/utils.d.ts +0 -1
- package/lib/schema-initializer/utils.js +41 -25
- package/lib/schema-settings/SchemaSettings.js +122 -45
- package/lib/schema-settings/VariableInput/hooks/useFormVariable.d.ts +19 -0
- package/lib/schema-settings/VariableInput/hooks/useFormVariable.js +96 -0
- package/lib/schema-settings/VariableInput/hooks/useIterationVariable.d.ts +8 -0
- package/lib/schema-settings/VariableInput/hooks/useIterationVariable.js +84 -0
- package/lib/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +5 -12
- package/lib/schema-settings/VariableInput/hooks/useVariableOptions.js +19 -3
- package/lib/schema-templates/BlockTemplateDetails.js +5 -1
- package/lib/schema-templates/BlockTemplatePage.js +5 -2
- package/lib/user/ChangePassword.d.ts +1 -2
- package/lib/user/ChangePassword.js +30 -26
- package/lib/user/CurrentUser.js +166 -135
- package/lib/user/EditProfile.d.ts +1 -2
- package/lib/user/EditProfile.js +31 -25
- package/lib/user/LanguageSettings.d.ts +1 -2
- package/lib/user/LanguageSettings.js +66 -63
- package/lib/user/SigninPage.js +25 -22
- package/lib/user/SwitchRole.d.ts +1 -2
- package/lib/user/SwitchRole.js +57 -51
- package/lib/user/ThemeSettings.d.ts +1 -2
- package/lib/user/ThemeSettings.js +59 -54
- package/package.json +9 -8
- package/es/settings-form/SettingsForm.d.ts +0 -13
- package/es/settings-form/SettingsForm.js +0 -309
- package/es/settings-form/index.d.ts +0 -1
- package/es/settings-form/index.js +0 -1
- package/lib/settings-form/SettingsForm.d.ts +0 -13
- package/lib/settings-form/SettingsForm.js +0 -320
- package/lib/settings-form/index.d.ts +0 -1
- package/lib/settings-form/index.js +0 -16
package/es/pm/index.js
CHANGED
|
@@ -9,9 +9,10 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
9
9
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
10
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
11
11
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
12
|
+
import { PageHeader } from '@ant-design/pro-layout';
|
|
12
13
|
import { css } from '@emotion/css';
|
|
13
|
-
import { Layout, Menu,
|
|
14
|
-
import { sortBy } from 'lodash';
|
|
14
|
+
import { Layout, Menu, Result, Spin, Tabs } from 'antd';
|
|
15
|
+
import _, { sortBy } from 'lodash';
|
|
15
16
|
import React, { createContext, useContext, useEffect, useMemo } from 'react';
|
|
16
17
|
import { useTranslation } from 'react-i18next';
|
|
17
18
|
import { Navigate, useNavigate, useParams } from 'react-router-dom';
|
|
@@ -109,23 +110,28 @@ var PluginList = function PluginList(props) {
|
|
|
109
110
|
}
|
|
110
111
|
}, []);
|
|
111
112
|
return snippets.includes('pm') ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(PageHeader, {
|
|
113
|
+
style: {
|
|
114
|
+
backgroundColor: 'white',
|
|
115
|
+
paddingBottom: 0
|
|
116
|
+
},
|
|
112
117
|
ghost: false,
|
|
113
118
|
title: t('Plugin manager'),
|
|
114
119
|
footer: /*#__PURE__*/React.createElement(Tabs, {
|
|
115
120
|
activeKey: tabName,
|
|
116
121
|
onChange: function onChange(activeKey) {
|
|
117
122
|
navigate("/admin/pm/list/".concat(activeKey));
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
123
|
+
},
|
|
124
|
+
items: [{
|
|
125
|
+
key: 'local',
|
|
126
|
+
label: t('Local')
|
|
127
|
+
}, {
|
|
128
|
+
key: 'built-in',
|
|
129
|
+
label: t('Built-in')
|
|
130
|
+
}, {
|
|
131
|
+
key: 'marketplace',
|
|
132
|
+
label: t('Marketplace')
|
|
133
|
+
}]
|
|
134
|
+
})
|
|
129
135
|
}), /*#__PURE__*/React.createElement("div", {
|
|
130
136
|
className: 'm24',
|
|
131
137
|
style: {
|
|
@@ -190,7 +196,7 @@ var settings = {
|
|
|
190
196
|
}
|
|
191
197
|
}
|
|
192
198
|
};
|
|
193
|
-
export var getPluginsTabs = function
|
|
199
|
+
export var getPluginsTabs = _.memoize(function (items, snippets) {
|
|
194
200
|
var pluginsTabs = Object.keys(items).map(function (plugin) {
|
|
195
201
|
var tabsObj = items[plugin].tabs;
|
|
196
202
|
var tabs = sortBy(Object.keys(tabsObj).map(function (tab) {
|
|
@@ -213,7 +219,7 @@ export var getPluginsTabs = function getPluginsTabs(items, snippets) {
|
|
|
213
219
|
return sortBy(pluginsTabs, function (o) {
|
|
214
220
|
return !o.isAllow;
|
|
215
221
|
});
|
|
216
|
-
};
|
|
222
|
+
});
|
|
217
223
|
var SettingsCenter = function SettingsCenter(props) {
|
|
218
224
|
var _activePlugin$tabs$fi, _items$pluginName2, _items$pluginName2$ta, _items$pluginName2$ta2, _items$pluginName3, _plugin$tabs;
|
|
219
225
|
var _useACLRoleContext2 = useACLRoleContext(),
|
|
@@ -289,19 +295,27 @@ var SettingsCenter = function SettingsCenter(props) {
|
|
|
289
295
|
},
|
|
290
296
|
items: menuItems
|
|
291
297
|
})), /*#__PURE__*/React.createElement(Layout.Content, null, aclPluginTabCheck && /*#__PURE__*/React.createElement(PageHeader, {
|
|
298
|
+
style: {
|
|
299
|
+
backgroundColor: 'white',
|
|
300
|
+
paddingBottom: 0
|
|
301
|
+
},
|
|
292
302
|
ghost: false,
|
|
293
303
|
title: compile((_items$pluginName3 = items[pluginName]) === null || _items$pluginName3 === void 0 ? void 0 : _items$pluginName3.title),
|
|
294
304
|
footer: /*#__PURE__*/React.createElement(Tabs, {
|
|
295
305
|
activeKey: tabName,
|
|
296
306
|
onChange: function onChange(activeKey) {
|
|
297
307
|
navigate("/admin/settings/".concat(pluginName, "/").concat(activeKey));
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
308
|
+
},
|
|
309
|
+
items: (_plugin$tabs = plugin.tabs) === null || _plugin$tabs === void 0 ? void 0 : _plugin$tabs.map(function (tab) {
|
|
310
|
+
if (!tab.isAllow) {
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
return {
|
|
314
|
+
label: compile(tab === null || tab === void 0 ? void 0 : tab.title),
|
|
315
|
+
key: tab.key
|
|
316
|
+
};
|
|
317
|
+
})
|
|
318
|
+
})
|
|
305
319
|
}), /*#__PURE__*/React.createElement("div", {
|
|
306
320
|
className: 'm24',
|
|
307
321
|
style: {
|
|
@@ -16,7 +16,7 @@ import { css } from '@emotion/css';
|
|
|
16
16
|
import { Layout, Spin } from 'antd';
|
|
17
17
|
import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
18
18
|
import { Outlet, useNavigate, useParams } from 'react-router-dom';
|
|
19
|
-
import { ACLRolesCheckProvider, CurrentAppInfoProvider, CurrentUser, CurrentUserProvider, PinnedPluginList, RemoteCollectionManagerProvider, RemoteSchemaTemplateManagerProvider, SchemaComponent, findByUid, findMenuItem, useACLRoleContext, useDocumentTitle, useRequest,
|
|
19
|
+
import { ACLRolesCheckProvider, CurrentAppInfoProvider, CurrentUser, CurrentUserProvider, PinnedPluginList, RemoteCollectionManagerProvider, RemoteSchemaTemplateManagerProvider, SchemaComponent, findByUid, findMenuItem, useACLRoleContext, useAdminSchemaUid, useDocumentTitle, useRequest, useSystemSettings } from '../../../';
|
|
20
20
|
import { useCollectionManager } from '../../../collection-manager';
|
|
21
21
|
var filterByACL = function filterByACL(schema, options) {
|
|
22
22
|
var allowAll = options.allowAll,
|
|
@@ -60,7 +60,6 @@ var MenuEditor = function MenuEditor(props) {
|
|
|
60
60
|
var defaultSelectedUid = params.name;
|
|
61
61
|
var sideMenuRef = props.sideMenuRef;
|
|
62
62
|
var ctx = useACLRoleContext();
|
|
63
|
-
var route = useRoute();
|
|
64
63
|
var _useState = useState(null),
|
|
65
64
|
_useState2 = _slicedToArray(_useState, 2),
|
|
66
65
|
current = _useState2[0],
|
|
@@ -72,10 +71,11 @@ var MenuEditor = function MenuEditor(props) {
|
|
|
72
71
|
setCurrent(schema);
|
|
73
72
|
navigate("/admin/".concat(schema['x-uid']));
|
|
74
73
|
};
|
|
74
|
+
var adminSchemaUid = useAdminSchemaUid();
|
|
75
75
|
var _useRequest = useRequest({
|
|
76
|
-
url: "/uiSchemas:getJsonSchema/".concat(
|
|
76
|
+
url: "/uiSchemas:getJsonSchema/".concat(adminSchemaUid)
|
|
77
77
|
}, {
|
|
78
|
-
refreshDeps: [
|
|
78
|
+
refreshDeps: [adminSchemaUid],
|
|
79
79
|
onSuccess: function onSuccess(data) {
|
|
80
80
|
var schema = filterByACL(data === null || data === void 0 ? void 0 : data.data, ctx);
|
|
81
81
|
// url 为 `/admin` 的情况
|
|
@@ -15,7 +15,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
15
15
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
16
|
import { connect, mapProps, useField, useFieldSchema } from '@formily/react';
|
|
17
17
|
import { isValid, uid } from '@formily/shared';
|
|
18
|
-
import { Tree as AntdTree
|
|
18
|
+
import { Tree as AntdTree } from 'antd';
|
|
19
19
|
import { cloneDeep } from 'lodash';
|
|
20
20
|
import React, { useEffect, useState } from 'react';
|
|
21
21
|
import { useTranslation } from 'react-i18next';
|
|
@@ -49,7 +49,7 @@ var MenuGroup = function MenuGroup(props) {
|
|
|
49
49
|
if (!['customize:popup', 'customize:update', 'customize:save', 'customize:table:request', 'customize:form:request'].includes(actionType)) {
|
|
50
50
|
return /*#__PURE__*/React.createElement(React.Fragment, null, props.children);
|
|
51
51
|
}
|
|
52
|
-
return /*#__PURE__*/React.createElement(
|
|
52
|
+
return /*#__PURE__*/React.createElement(SchemaSettings.ItemGroup, {
|
|
53
53
|
title: "".concat(t('Customize'), " > ").concat(actionTitles[actionType])
|
|
54
54
|
}, props.children);
|
|
55
55
|
};
|
|
@@ -63,9 +63,7 @@ export var ActionDesigner = function ActionDesigner(props) {
|
|
|
63
63
|
var _useCollection = useCollection(),
|
|
64
64
|
name = _useCollection.name;
|
|
65
65
|
var _useCollectionManager = useCollectionManager(),
|
|
66
|
-
getChildrenCollections = _useCollectionManager.getChildrenCollections
|
|
67
|
-
getCollection = _useCollectionManager.getCollection,
|
|
68
|
-
getCollectionField = _useCollectionManager.getCollectionField;
|
|
66
|
+
getChildrenCollections = _useCollectionManager.getChildrenCollections;
|
|
69
67
|
var _useDesignable = useDesignable(),
|
|
70
68
|
dn = _useDesignable.dn;
|
|
71
69
|
var _useTranslation2 = useTranslation(),
|
|
@@ -45,7 +45,7 @@ export var ActionDrawer = observer(function (props) {
|
|
|
45
45
|
width: openSizeWidthMap.get(openSize),
|
|
46
46
|
title: field.title
|
|
47
47
|
}, others), drawerProps), modalProps), {}, {
|
|
48
|
-
|
|
48
|
+
rootStyle: _objectSpread(_objectSpread({}, drawerProps === null || drawerProps === void 0 ? void 0 : drawerProps.style), others === null || others === void 0 ? void 0 : others.style),
|
|
49
49
|
destroyOnClose: true,
|
|
50
50
|
open: visible,
|
|
51
51
|
onClose: function onClose() {
|
|
@@ -9,7 +9,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
9
9
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
10
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
11
|
import { cx } from '@emotion/css';
|
|
12
|
-
import {
|
|
12
|
+
import { RecursionField, observer, useFieldSchema } from '@formily/react';
|
|
13
13
|
import { Space } from 'antd';
|
|
14
14
|
import React, { useContext } from 'react';
|
|
15
15
|
import { createPortal } from 'react-dom';
|
|
@@ -35,7 +35,7 @@ export var SubTable = observer(function (props) {
|
|
|
35
35
|
return /*#__PURE__*/React.createElement("div", {
|
|
36
36
|
className: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-table-footer {\n padding: 0 !important;\n }\n .ant-formily-item-error-help {\n display: none;\n }\n .ant-description-textarea {\n line-height: 34px;\n }\n .ant-table-cell .ant-formily-item-error-help {\n display: block;\n position: absolute;\n font-size: 12px;\n top: 100%;\n background: #fff;\n width: 100%;\n margin-top: 3px;\n padding: 3px;\n z-index: 1;\n border-radius: 3px;\n box-shadow: 0 0 10px #eee;\n animation: none;\n transform: translateY(0);\n opacity: 1;\n }\n "])))
|
|
37
37
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
38
|
-
className: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ant-select-selector {\n /* min-height: 31px; */\n }\n .ant-formily-item.ant-formily-item-feedback-layout-loose {\n margin-bottom: 0px !important;\n }\n .ant-formily-editable {\n vertical-align: sub;\n }\n .ant-table table {\n }\n td:not(.ant-table-selection-column) {\n padding:
|
|
38
|
+
className: css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ant-select-selector {\n /* min-height: 31px; */\n }\n .ant-formily-item.ant-formily-item-feedback-layout-loose {\n margin-bottom: 0px !important;\n }\n .ant-formily-editable {\n vertical-align: sub;\n }\n .ant-table table {\n }\n td:not(.ant-table-selection-column) {\n padding: 5px !important;\n }\n "]))),
|
|
39
39
|
bordered: true,
|
|
40
40
|
size: 'small',
|
|
41
41
|
field: field,
|
|
@@ -94,7 +94,7 @@ export var DeleteEvent = observer(function () {
|
|
|
94
94
|
t = _useTranslation.t;
|
|
95
95
|
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(Modal, {
|
|
96
96
|
title: cron ? t('Delete events') : null,
|
|
97
|
-
|
|
97
|
+
open: visible,
|
|
98
98
|
onCancel: function onCancel() {
|
|
99
99
|
return setVisible(false);
|
|
100
100
|
},
|
|
@@ -83,6 +83,7 @@ FormItem.Designer = function Designer() {
|
|
|
83
83
|
getField = _useCollection.getField;
|
|
84
84
|
var _useFormBlockContext = useFormBlockContext(),
|
|
85
85
|
form = _useFormBlockContext.form;
|
|
86
|
+
var ctx = useBlockRequestContext();
|
|
86
87
|
var field = useField();
|
|
87
88
|
var fieldSchema = useFieldSchema();
|
|
88
89
|
var _useTranslation = useTranslation(),
|
|
@@ -399,12 +400,15 @@ FormItem.Designer = function Designer() {
|
|
|
399
400
|
properties: {
|
|
400
401
|
filter: {
|
|
401
402
|
default: defaultFilter,
|
|
402
|
-
// title: '数据范围',
|
|
403
403
|
enum: dataSource,
|
|
404
404
|
'x-component': 'Filter',
|
|
405
405
|
'x-component-props': {
|
|
406
406
|
dynamicComponent: function dynamicComponent(props) {
|
|
407
|
-
return FilterDynamicComponent(_objectSpread({}, props)
|
|
407
|
+
return FilterDynamicComponent(_objectSpread(_objectSpread({}, props), {}, {
|
|
408
|
+
form: form,
|
|
409
|
+
collectionField: collectionField,
|
|
410
|
+
rootCollection: ctx.props.collection || ctx.props.resource
|
|
411
|
+
}));
|
|
408
412
|
}
|
|
409
413
|
}
|
|
410
414
|
}
|
|
@@ -416,7 +420,6 @@ FormItem.Designer = function Designer() {
|
|
|
416
420
|
filter = removeNullCondition(filter);
|
|
417
421
|
_.set(field.componentProps, 'service.params.filter', filter);
|
|
418
422
|
fieldSchema['x-component-props'] = field.componentProps;
|
|
419
|
-
field.componentProps = field.componentProps;
|
|
420
423
|
dn.emit('patch', {
|
|
421
424
|
schema: (_schema5 = {}, _defineProperty(_schema5, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema5, 'x-component-props', field.componentProps), _schema5)
|
|
422
425
|
});
|
|
@@ -778,6 +781,10 @@ FormItem.Designer = function Designer() {
|
|
|
778
781
|
export function isFileCollection(collection) {
|
|
779
782
|
return (collection === null || collection === void 0 ? void 0 : collection.template) === 'file';
|
|
780
783
|
}
|
|
784
|
+
function extractFirstPart(path) {
|
|
785
|
+
var firstDotIndex = path.indexOf('.');
|
|
786
|
+
return firstDotIndex !== -1 ? path.slice(0, firstDotIndex) : path;
|
|
787
|
+
}
|
|
781
788
|
FormItem.FilterFormDesigner = FilterFormDesigner;
|
|
782
789
|
export function getFieldDefaultValue(fieldSchema, collectionField) {
|
|
783
790
|
var _fieldSchema$default, _collectionField$uiSc5;
|
|
@@ -4,21 +4,20 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
import { useFieldSchema, useField } from '@formily/react';
|
|
8
|
-
import React, { useMemo } from 'react';
|
|
9
7
|
import { ArrayItems } from '@formily/antd';
|
|
8
|
+
import { useField, useFieldSchema } from '@formily/react';
|
|
10
9
|
import { Slider } from 'antd';
|
|
11
10
|
import _ from 'lodash';
|
|
11
|
+
import React, { useMemo } from 'react';
|
|
12
12
|
import { useTranslation } from 'react-i18next';
|
|
13
13
|
import { useCollection, useCollectionFilterOptions, useSortFields } from '../../../collection-manager';
|
|
14
14
|
import { GeneralSchemaDesigner, SchemaSettings } from '../../../schema-settings';
|
|
15
15
|
import { useSchemaTemplate } from '../../../schema-templates';
|
|
16
|
+
import { SchemaComponentOptions } from '../../core';
|
|
16
17
|
import { useDesignable } from '../../hooks';
|
|
17
18
|
import { removeNullCondition } from '../filter';
|
|
18
19
|
import { FilterDynamicComponent } from '../table-v2/FilterDynamicComponent';
|
|
19
|
-
import { SchemaComponentOptions } from '../../core';
|
|
20
20
|
import { defaultColumnCount, gridSizes, pageSizeOptions, screenSizeMaps, screenSizeTitleMaps } from './options';
|
|
21
|
-
Slider;
|
|
22
21
|
var columnCountMarks = [1, 2, 3, 4, 6, 8, 12, 24].reduce(function (obj, cur) {
|
|
23
22
|
obj[cur] = cur;
|
|
24
23
|
return obj;
|
|
@@ -42,7 +42,5 @@
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
html body {
|
|
45
|
-
--adm-font-family: -apple-system,
|
|
46
|
-
Microsoft YaHei, Helvetica Neue, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji,
|
|
47
|
-
Segoe UI Symbol;
|
|
45
|
+
--adm-font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";
|
|
48
46
|
}
|