@nocobase/client 0.7.7-alpha.1 → 0.8.0-alpha.4
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/ACLShortcut.d.ts +2 -0
- package/es/acl/ACLShortcut.js +31 -2
- package/es/application/Application.d.ts +3 -1
- package/es/application/Application.js +131 -39
- package/es/block-provider/CalendarBlockProvider.d.ts +1 -0
- package/es/block-provider/CalendarBlockProvider.js +6 -3
- package/es/block-provider/TableSelectorProvider.js +21 -6
- package/es/block-provider/hooks/index.d.ts +6 -0
- package/es/block-provider/hooks/index.js +485 -115
- package/es/collection-manager/CollectionManagerProvider.js +26 -45
- package/es/collection-manager/CollectionManagerShortcut.d.ts +2 -0
- package/es/collection-manager/CollectionManagerShortcut.js +38 -3
- package/es/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
- package/es/collection-manager/Configuration/AddFieldAction.js +44 -13
- package/es/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
- package/es/collection-manager/Configuration/EditFieldAction.js +24 -11
- package/es/collection-manager/Configuration/index.d.ts +2 -0
- package/es/collection-manager/Configuration/index.js +2 -0
- package/es/collection-manager/Configuration/schemas/collectionFields.js +2 -2
- package/es/collection-manager/index.d.ts +1 -0
- package/es/collection-manager/index.js +2 -1
- package/es/collection-manager/interfaces/index.d.ts +1 -0
- package/es/collection-manager/interfaces/index.js +1 -0
- package/es/collection-manager/interfaces/json.d.ts +2 -0
- package/es/collection-manager/interfaces/json.js +48 -0
- package/es/collection-manager/interfaces/m2o.js +3 -3
- package/es/collection-manager/interfaces/o2m.js +5 -6
- package/es/collection-manager/interfaces/o2o.js +5 -5
- package/es/collection-manager/interfaces/properties/index.d.ts +14 -0
- package/es/collection-manager/interfaces/properties/index.js +23 -0
- package/es/collection-manager/interfaces/sequence.js +13 -9
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/locale/en_US.d.ts +13 -1
- package/es/locale/en_US.js +14 -2
- package/es/locale/ja_JP.d.ts +1 -1
- package/es/locale/ja_JP.js +1 -1
- package/es/locale/ru_RU.d.ts +1 -1
- package/es/locale/ru_RU.js +1 -1
- package/es/locale/tr_TR.d.ts +1 -1
- package/es/locale/tr_TR.js +1 -1
- package/es/locale/zh_CN.d.ts +39 -1
- package/es/locale/zh_CN.js +40 -2
- package/es/plugin-manager/PluginManager.js +35 -23
- package/es/pm/PluginManagerLink.d.ts +2 -0
- package/es/pm/PluginManagerLink.js +111 -0
- package/es/pm/index.d.ts +4 -0
- package/es/pm/index.js +422 -0
- package/es/route-switch/antd/admin-layout/index.js +1 -1
- package/es/schema-component/antd/action/Action.Designer.js +35 -12
- package/es/schema-component/antd/action/Action.Modal.js +4 -2
- package/es/schema-component/antd/action/Action.js +3 -3
- package/es/schema-component/antd/action/context.d.ts +2 -0
- package/es/schema-component/antd/action/hooks.d.ts +1 -0
- package/es/schema-component/antd/calendar/Calendar.Designer.js +19 -6
- package/es/schema-component/antd/calendar/Calendar.js +23 -2
- package/es/schema-component/antd/calendar/Title.js +18 -3
- package/es/schema-component/antd/calendar/components/Header.d.ts +10 -0
- package/es/schema-component/antd/calendar/components/Header.js +43 -0
- package/es/schema-component/antd/calendar/style.less +53 -9
- package/es/schema-component/antd/calendar/types.d.ts +6 -0
- package/es/schema-component/antd/calendar/utils.d.ts +2 -0
- package/es/schema-component/antd/calendar/utils.js +7 -0
- package/es/schema-component/antd/checkbox/Checkbox.js +13 -4
- package/es/schema-component/antd/formula-input/FormulaInput.js +28 -37
- package/es/schema-component/antd/input/Input.d.ts +1 -0
- package/es/schema-component/antd/input/Input.js +2 -0
- package/es/schema-component/antd/input/Json.d.ts +6 -0
- package/es/schema-component/antd/input/Json.js +41 -0
- package/es/schema-component/antd/input/ReadPretty.d.ts +3 -0
- package/es/schema-component/antd/input/ReadPretty.js +15 -0
- package/es/schema-component/antd/input/index.d.ts +1 -0
- package/es/schema-component/antd/input/index.js +2 -1
- package/es/schema-component/antd/markdown/Markdown.Void.js +5 -2
- package/es/schema-component/antd/radio/Radio.js +2 -1
- package/es/schema-component/antd/select/ReadPretty.js +2 -1
- package/es/schema-component/antd/table-v2/TableSelectorDesigner.js +16 -2
- package/es/schema-component/antd/upload/Upload.js +2 -1
- package/es/schema-component/antd/upload/shared.js +5 -6
- package/es/schema-component/antd/upload/type.d.ts +2 -0
- package/es/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/BulkEditFormItemInitializers.js +50 -0
- package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +35 -0
- package/es/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
- package/es/schema-initializer/buttons/FormActionInitializers.js +118 -0
- package/es/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
- package/es/schema-initializer/buttons/TabPaneInitializers.js +13 -0
- package/es/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
- package/es/schema-initializer/buttons/TableActionInitializers.js +45 -0
- package/es/schema-initializer/buttons/index.d.ts +2 -0
- package/es/schema-initializer/buttons/index.js +2 -0
- package/es/schema-initializer/components/BulkEditField.d.ts +7 -0
- package/es/schema-initializer/components/BulkEditField.js +187 -0
- package/es/schema-initializer/components/index.d.ts +1 -0
- package/es/schema-initializer/components/index.js +2 -1
- package/es/schema-initializer/items/BlockInitializer.js +8 -8
- package/es/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/BulkEditSubmitActionInitializer.js +24 -0
- package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
- package/es/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +103 -0
- package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/CustomizeBulkEditActionInitializer.js +61 -0
- package/es/schema-initializer/items/index.d.ts +3 -0
- package/es/schema-initializer/items/index.js +3 -0
- package/es/schema-initializer/utils.d.ts +1 -0
- package/es/schema-initializer/utils.js +67 -12
- package/es/schema-settings/SchemaSettings.d.ts +6 -0
- package/es/schema-settings/SchemaSettings.js +4 -1
- package/es/schema-templates/BlockTemplatePage.d.ts +1 -0
- package/es/schema-templates/BlockTemplatePage.js +7 -0
- package/es/schema-templates/SchemaTemplateShortcut.js +1 -1
- package/es/system-settings/SystemSettingsShortcut.d.ts +2 -0
- package/es/system-settings/SystemSettingsShortcut.js +134 -5
- package/lib/acl/ACLShortcut.d.ts +2 -0
- package/lib/acl/ACLShortcut.js +41 -4
- package/lib/application/Application.d.ts +3 -1
- package/lib/application/Application.js +139 -39
- package/lib/block-provider/CalendarBlockProvider.d.ts +1 -0
- package/lib/block-provider/CalendarBlockProvider.js +6 -3
- package/lib/block-provider/TableSelectorProvider.js +21 -6
- package/lib/block-provider/hooks/index.d.ts +6 -0
- package/lib/block-provider/hooks/index.js +496 -115
- package/lib/collection-manager/CollectionManagerProvider.js +28 -47
- package/lib/collection-manager/CollectionManagerShortcut.d.ts +2 -0
- package/lib/collection-manager/CollectionManagerShortcut.js +47 -4
- package/lib/collection-manager/Configuration/AddFieldAction.d.ts +5 -1
- package/lib/collection-manager/Configuration/AddFieldAction.js +48 -12
- package/lib/collection-manager/Configuration/EditFieldAction.d.ts +1 -0
- package/lib/collection-manager/Configuration/EditFieldAction.js +26 -10
- package/lib/collection-manager/Configuration/index.d.ts +2 -0
- package/lib/collection-manager/Configuration/index.js +26 -0
- package/lib/collection-manager/Configuration/schemas/collectionFields.js +2 -2
- package/lib/collection-manager/index.d.ts +1 -0
- package/lib/collection-manager/index.js +14 -0
- package/lib/collection-manager/interfaces/index.d.ts +1 -0
- package/lib/collection-manager/interfaces/index.js +13 -0
- package/lib/collection-manager/interfaces/json.d.ts +2 -0
- package/lib/collection-manager/interfaces/json.js +58 -0
- package/lib/collection-manager/interfaces/m2o.js +2 -2
- package/lib/collection-manager/interfaces/o2m.js +4 -5
- package/lib/collection-manager/interfaces/o2o.js +4 -4
- package/lib/collection-manager/interfaces/properties/index.d.ts +14 -0
- package/lib/collection-manager/interfaces/properties/index.js +25 -1
- package/lib/collection-manager/interfaces/sequence.js +13 -9
- package/lib/index.d.ts +1 -0
- package/lib/index.js +13 -0
- package/lib/locale/en_US.d.ts +13 -1
- package/lib/locale/en_US.js +14 -2
- package/lib/locale/ja_JP.d.ts +1 -1
- package/lib/locale/ja_JP.js +1 -1
- package/lib/locale/ru_RU.d.ts +1 -1
- package/lib/locale/ru_RU.js +1 -1
- package/lib/locale/tr_TR.d.ts +1 -1
- package/lib/locale/tr_TR.js +1 -1
- package/lib/locale/zh_CN.d.ts +39 -1
- package/lib/locale/zh_CN.js +40 -2
- package/lib/plugin-manager/PluginManager.js +33 -21
- package/lib/pm/PluginManagerLink.d.ts +2 -0
- package/lib/pm/PluginManagerLink.js +138 -0
- package/lib/pm/index.d.ts +4 -0
- package/lib/pm/index.js +474 -0
- package/lib/route-switch/antd/admin-layout/index.js +1 -1
- package/lib/schema-component/antd/action/Action.Designer.js +35 -12
- package/lib/schema-component/antd/action/Action.Modal.js +4 -2
- package/lib/schema-component/antd/action/Action.js +3 -3
- package/lib/schema-component/antd/action/context.d.ts +2 -0
- package/lib/schema-component/antd/action/hooks.d.ts +1 -0
- package/lib/schema-component/antd/calendar/Calendar.Designer.js +19 -6
- package/lib/schema-component/antd/calendar/Calendar.js +24 -2
- package/lib/schema-component/antd/calendar/Title.js +18 -2
- package/lib/schema-component/antd/calendar/components/Header.d.ts +10 -0
- package/lib/schema-component/antd/calendar/components/Header.js +57 -0
- package/lib/schema-component/antd/calendar/style.less +53 -9
- package/lib/schema-component/antd/calendar/types.d.ts +6 -0
- package/lib/schema-component/antd/calendar/utils.d.ts +2 -0
- package/lib/schema-component/antd/calendar/utils.js +18 -2
- package/lib/schema-component/antd/checkbox/Checkbox.js +13 -4
- package/lib/schema-component/antd/formula-input/FormulaInput.js +28 -37
- package/lib/schema-component/antd/input/Input.d.ts +1 -0
- package/lib/schema-component/antd/input/Input.js +3 -0
- package/lib/schema-component/antd/input/Json.d.ts +6 -0
- package/lib/schema-component/antd/input/Json.js +53 -0
- package/lib/schema-component/antd/input/ReadPretty.d.ts +3 -0
- package/lib/schema-component/antd/input/ReadPretty.js +16 -0
- package/lib/schema-component/antd/input/index.d.ts +1 -0
- package/lib/schema-component/antd/input/index.js +13 -0
- package/lib/schema-component/antd/markdown/Markdown.Void.js +8 -2
- package/lib/schema-component/antd/radio/Radio.js +2 -1
- package/lib/schema-component/antd/select/ReadPretty.js +2 -1
- package/lib/schema-component/antd/table-v2/TableSelectorDesigner.js +17 -2
- package/lib/schema-component/antd/upload/Upload.js +2 -1
- package/lib/schema-component/antd/upload/shared.js +4 -5
- package/lib/schema-component/antd/upload/type.d.ts +2 -0
- package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/BulkEditFormItemInitializers.js +66 -0
- package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/CreateFormBulkEditBlockInitializers.js +50 -0
- package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +132 -0
- package/lib/schema-initializer/buttons/FormActionInitializers.js +121 -2
- package/lib/schema-initializer/buttons/TabPaneInitializers.d.ts +1 -0
- package/lib/schema-initializer/buttons/TabPaneInitializers.js +18 -2
- package/lib/schema-initializer/buttons/TableActionInitializers.d.ts +56 -2
- package/lib/schema-initializer/buttons/TableActionInitializers.js +45 -0
- package/lib/schema-initializer/buttons/index.d.ts +2 -0
- package/lib/schema-initializer/buttons/index.js +26 -0
- package/lib/schema-initializer/components/BulkEditField.d.ts +7 -0
- package/lib/schema-initializer/components/BulkEditField.js +210 -0
- package/lib/schema-initializer/components/index.d.ts +1 -0
- package/lib/schema-initializer/components/index.js +13 -0
- package/lib/schema-initializer/items/BlockInitializer.js +8 -7
- package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/BulkEditSubmitActionInitializer.js +37 -0
- package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/CreateFormBulkEditBlockInitializer.js +121 -0
- package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/CustomizeBulkEditActionInitializer.js +74 -0
- package/lib/schema-initializer/items/index.d.ts +3 -0
- package/lib/schema-initializer/items/index.js +39 -0
- package/lib/schema-initializer/utils.d.ts +1 -0
- package/lib/schema-initializer/utils.js +71 -13
- package/lib/schema-settings/SchemaSettings.d.ts +6 -0
- package/lib/schema-settings/SchemaSettings.js +3 -0
- package/lib/schema-templates/BlockTemplatePage.d.ts +1 -0
- package/lib/schema-templates/BlockTemplatePage.js +12 -2
- package/lib/schema-templates/SchemaTemplateShortcut.js +1 -1
- package/lib/system-settings/SystemSettingsShortcut.d.ts +2 -0
- package/lib/system-settings/SystemSettingsShortcut.js +145 -7
- package/package.json +5 -4
|
@@ -63,13 +63,8 @@ var AntdFormulaInput = function AntdFormulaInput(props) {
|
|
|
63
63
|
|
|
64
64
|
var _useState3 = (0, _react2.useState)(null),
|
|
65
65
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var _useState5 = (0, _react2.useState)(null),
|
|
70
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
71
|
-
html = _useState6[0],
|
|
72
|
-
setHtml = _useState6[1];
|
|
66
|
+
html = _useState4[0],
|
|
67
|
+
setHtml = _useState4[1];
|
|
73
68
|
|
|
74
69
|
var numColumns = new Map();
|
|
75
70
|
var scope = {};
|
|
@@ -80,43 +75,38 @@ var AntdFormulaInput = function AntdFormulaInput(props) {
|
|
|
80
75
|
scope[field.name] = 1;
|
|
81
76
|
});
|
|
82
77
|
var keys = Array.from(numColumns.keys());
|
|
83
|
-
var initHtml;
|
|
84
|
-
|
|
85
|
-
if (value) {
|
|
86
|
-
initHtml = value;
|
|
87
|
-
numColumns.forEach(function (value, key) {
|
|
88
|
-
initHtml = initHtml.replaceAll(key, "<span contentEditable=\"false\" style=\"border: 1px solid #aaa; padding: 2px 5px;\">".concat(value, "</span>"));
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
78
|
(0, _react2.useEffect)(function () {
|
|
93
|
-
if (
|
|
94
|
-
var
|
|
79
|
+
if (value) {
|
|
80
|
+
var newHtml = value;
|
|
95
81
|
numColumns.forEach(function (value, key) {
|
|
96
|
-
|
|
82
|
+
newHtml = newHtml.replaceAll(key, "<span contentEditable=\"false\" ><input disabled=\"disabled\" style=\"width:".concat(18 * value.length, "px;max-width: 120px\" value=\"").concat(value, "\"/><span hidden>").concat(key, "</span></span>"));
|
|
97
83
|
});
|
|
84
|
+
newHtml = "".concat(newHtml, "<span style=\"padding-left: 5px\"></span>"); // set extra span for cursor focus on last position
|
|
98
85
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
86
|
+
setHtml(newHtml);
|
|
87
|
+
} else {
|
|
88
|
+
setHtml('');
|
|
102
89
|
}
|
|
103
|
-
}, [
|
|
90
|
+
}, [value]);
|
|
104
91
|
|
|
105
92
|
var menu = /*#__PURE__*/_react2.default.createElement(_antd.Menu, {
|
|
106
93
|
onClick: function () {
|
|
107
94
|
var _onClick = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(args) {
|
|
108
|
-
var replaceFormula
|
|
95
|
+
var replaceFormula;
|
|
109
96
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
110
97
|
while (1) {
|
|
111
98
|
switch (_context.prev = _context.next) {
|
|
112
99
|
case 0:
|
|
113
|
-
replaceFormula =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
100
|
+
replaceFormula = field.value.replace('@', args.key);
|
|
101
|
+
|
|
102
|
+
if (onChange && replaceFormula != field.value) {
|
|
103
|
+
onChange(replaceFormula);
|
|
104
|
+
}
|
|
105
|
+
|
|
117
106
|
setDropdownVisible(false);
|
|
107
|
+
inputRef.current.focus();
|
|
118
108
|
|
|
119
|
-
case
|
|
109
|
+
case 4:
|
|
120
110
|
case "end":
|
|
121
111
|
return _context.stop();
|
|
122
112
|
}
|
|
@@ -137,12 +127,12 @@ var AntdFormulaInput = function AntdFormulaInput(props) {
|
|
|
137
127
|
}));
|
|
138
128
|
|
|
139
129
|
var handleChange = function handleChange(e) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
130
|
+
if (onChange) {
|
|
131
|
+
if (e.currentTarget.textContent == '') {
|
|
132
|
+
onChange(null);
|
|
133
|
+
} else {
|
|
134
|
+
onChange(e.currentTarget.textContent);
|
|
135
|
+
}
|
|
146
136
|
}
|
|
147
137
|
};
|
|
148
138
|
|
|
@@ -170,7 +160,8 @@ var AntdFormulaInput = function AntdFormulaInput(props) {
|
|
|
170
160
|
try {
|
|
171
161
|
math.evaluate(field.value, scope);
|
|
172
162
|
field.feedbacks = [];
|
|
173
|
-
} catch (
|
|
163
|
+
} catch (e) {
|
|
164
|
+
console.error(field.value, scope, e.message);
|
|
174
165
|
field.setFeedback({
|
|
175
166
|
type: 'error',
|
|
176
167
|
code: 'FormulaError',
|
|
@@ -187,7 +178,7 @@ var AntdFormulaInput = function AntdFormulaInput(props) {
|
|
|
187
178
|
className: "ant-input",
|
|
188
179
|
onChange: handleChange,
|
|
189
180
|
onKeyDown: handleKeyDown,
|
|
190
|
-
html: html ||
|
|
181
|
+
html: html || ''
|
|
191
182
|
}));
|
|
192
183
|
};
|
|
193
184
|
|
|
@@ -15,6 +15,8 @@ var _react2 = _interopRequireDefault(require("react"));
|
|
|
15
15
|
|
|
16
16
|
var _ReadPretty = require("./ReadPretty");
|
|
17
17
|
|
|
18
|
+
var _Json = require("./Json");
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -38,5 +40,6 @@ Input.TextArea = (0, _react.connect)(_antd.Input.TextArea, (0, _react.mapProps)(
|
|
|
38
40
|
}, props);
|
|
39
41
|
}), (0, _react.mapReadPretty)(_ReadPretty.ReadPretty.TextArea));
|
|
40
42
|
Input.URL = (0, _react.connect)(_antd.Input, (0, _react.mapReadPretty)(_ReadPretty.ReadPretty.URL));
|
|
43
|
+
Input.JSON = (0, _react.connect)(_Json.Json, (0, _react.mapReadPretty)(_ReadPretty.ReadPretty.JSON));
|
|
41
44
|
var _default = Input;
|
|
42
45
|
exports.default = _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Json = Json;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _react2 = require("@formily/react");
|
|
11
|
+
|
|
12
|
+
var _antd = require("antd");
|
|
13
|
+
|
|
14
|
+
var _excluded = ["value", "onChange", "space"];
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
+
|
|
22
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
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; }
|
|
27
|
+
|
|
28
|
+
function Json(_ref) {
|
|
29
|
+
var value = _ref.value,
|
|
30
|
+
_onChange = _ref.onChange,
|
|
31
|
+
_ref$space = _ref.space,
|
|
32
|
+
space = _ref$space === void 0 ? 2 : _ref$space,
|
|
33
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
34
|
+
|
|
35
|
+
var field = (0, _react2.useField)();
|
|
36
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Input.TextArea, _objectSpread(_objectSpread({}, props), {}, {
|
|
37
|
+
defaultValue: value != null ? JSON.stringify(value, null, space) : '',
|
|
38
|
+
onChange: function onChange(ev) {
|
|
39
|
+
try {
|
|
40
|
+
var v = ev.target.value.trim() !== '' ? JSON.parse(ev.target.value) : null;
|
|
41
|
+
field.setFeedback({});
|
|
42
|
+
|
|
43
|
+
_onChange(v);
|
|
44
|
+
} catch (err) {
|
|
45
|
+
field.setFeedback({
|
|
46
|
+
type: 'error',
|
|
47
|
+
code: 'JSONSyntaxError',
|
|
48
|
+
messages: [err.message]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
@@ -17,8 +17,14 @@ var _EllipsisWithTooltip = require("./EllipsisWithTooltip");
|
|
|
17
17
|
|
|
18
18
|
var _shared = require("./shared");
|
|
19
19
|
|
|
20
|
+
var _css = require("@emotion/css");
|
|
21
|
+
|
|
22
|
+
var _templateObject;
|
|
23
|
+
|
|
20
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
25
|
|
|
26
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
27
|
+
|
|
22
28
|
var ReadPretty = function ReadPretty() {
|
|
23
29
|
return null;
|
|
24
30
|
};
|
|
@@ -115,4 +121,14 @@ ReadPretty.URL = function (props) {
|
|
|
115
121
|
className: (0, _classnames.default)(prefixCls, props.className),
|
|
116
122
|
style: props.style
|
|
117
123
|
}, props.addonBefore, props.prefix, content, props.suffix, props.addonAfter);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
ReadPretty.JSON = function (props) {
|
|
127
|
+
var _props$space;
|
|
128
|
+
|
|
129
|
+
var prefixCls = (0, _builtins__.usePrefixCls)('json', props);
|
|
130
|
+
return /*#__PURE__*/_react.default.createElement("pre", {
|
|
131
|
+
className: (0, _css.cx)(prefixCls, props.className, (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin-bottom: 0;\n "])))),
|
|
132
|
+
style: props.style
|
|
133
|
+
}, props.value != null ? JSON.stringify(props.value, null, (_props$space = props.space) !== null && _props$space !== void 0 ? _props$space : 2) : '');
|
|
118
134
|
};
|
|
@@ -28,4 +28,17 @@ Object.keys(_ReadPretty).forEach(function (key) {
|
|
|
28
28
|
return _ReadPretty[key];
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _Json = require("./Json");
|
|
34
|
+
|
|
35
|
+
Object.keys(_Json).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _Json[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _Json[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
31
44
|
});
|
|
@@ -11,6 +11,8 @@ var _react = require("@formily/react");
|
|
|
11
11
|
|
|
12
12
|
var _antd = require("antd");
|
|
13
13
|
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
15
|
+
|
|
14
16
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
15
17
|
|
|
16
18
|
var _reactI18next = require("react-i18next");
|
|
@@ -25,6 +27,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
27
|
|
|
26
28
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
29
|
|
|
30
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
+
|
|
28
32
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
29
33
|
|
|
30
34
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -93,7 +97,8 @@ var MarkdownEditor = function MarkdownEditor(props) {
|
|
|
93
97
|
};
|
|
94
98
|
|
|
95
99
|
var MarkdownVoid = (0, _react.observer)(function (props) {
|
|
96
|
-
var content = props.content
|
|
100
|
+
var content = props.content,
|
|
101
|
+
className = props.className;
|
|
97
102
|
var field = (0, _react.useField)();
|
|
98
103
|
var schema = (0, _react.useFieldSchema)();
|
|
99
104
|
|
|
@@ -103,6 +108,7 @@ var MarkdownVoid = (0, _react.observer)(function (props) {
|
|
|
103
108
|
var onSave = props.onSave,
|
|
104
109
|
_onCancel = props.onCancel;
|
|
105
110
|
return (field === null || field === void 0 ? void 0 : field.editable) ? /*#__PURE__*/_react2.default.createElement(MarkdownEditor, _objectSpread(_objectSpread({}, props), {}, {
|
|
111
|
+
className: true,
|
|
106
112
|
defaultValue: content,
|
|
107
113
|
onCancel: function onCancel() {
|
|
108
114
|
field.editable = false;
|
|
@@ -145,7 +151,7 @@ var MarkdownVoid = (0, _react.observer)(function (props) {
|
|
|
145
151
|
return onSubmit;
|
|
146
152
|
}()
|
|
147
153
|
})) : /*#__PURE__*/_react2.default.createElement("div", {
|
|
148
|
-
className: 'nb-markdown',
|
|
154
|
+
className: (0, _classnames.default)(['nb-markdown', className]),
|
|
149
155
|
dangerouslySetInnerHTML: {
|
|
150
156
|
__html: (0, _util.markdown)(content)
|
|
151
157
|
}
|
|
@@ -38,7 +38,8 @@ Radio.Group = (0, _react.connect)(_antd.Radio.Group, (0, _react.mapProps)({
|
|
|
38
38
|
}).map(function (option, key) {
|
|
39
39
|
return /*#__PURE__*/_react2.default.createElement(_antd.Tag, {
|
|
40
40
|
key: key,
|
|
41
|
-
color: option.color
|
|
41
|
+
color: option.color,
|
|
42
|
+
icon: option.icon
|
|
42
43
|
}, option.label);
|
|
43
44
|
}));
|
|
44
45
|
}));
|
|
@@ -45,7 +45,8 @@ var ReadPretty = (0, _react.observer)(function (props) {
|
|
|
45
45
|
return /*#__PURE__*/_react2.default.createElement("div", null, options.map(function (option, key) {
|
|
46
46
|
return /*#__PURE__*/_react2.default.createElement(_antd.Tag, {
|
|
47
47
|
key: key,
|
|
48
|
-
color: option[fieldNames.color]
|
|
48
|
+
color: option[fieldNames.color],
|
|
49
|
+
icon: option.icon
|
|
49
50
|
}, option[fieldNames.label]);
|
|
50
51
|
}));
|
|
51
52
|
});
|
|
@@ -25,6 +25,8 @@ var _schemaTemplates = require("../../../schema-templates");
|
|
|
25
25
|
|
|
26
26
|
var _hooks = require("../../hooks");
|
|
27
27
|
|
|
28
|
+
var _lodash = require("lodash");
|
|
29
|
+
|
|
28
30
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
31
|
|
|
30
32
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -46,7 +48,8 @@ var TableSelectorDesigner = function TableSelectorDesigner() {
|
|
|
46
48
|
var sortFields = (0, _actionHooks.useSortFields)(name);
|
|
47
49
|
|
|
48
50
|
var _useTableSelectorCont = (0, _blockProvider.useTableSelectorContext)(),
|
|
49
|
-
service = _useTableSelectorCont.service
|
|
51
|
+
service = _useTableSelectorCont.service,
|
|
52
|
+
extraFilter = _useTableSelectorCont.extraFilter;
|
|
50
53
|
|
|
51
54
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
52
55
|
t = _useTranslation.t;
|
|
@@ -94,8 +97,20 @@ var TableSelectorDesigner = function TableSelectorDesigner() {
|
|
|
94
97
|
params.filter = filter;
|
|
95
98
|
field.decoratorProps.params = params;
|
|
96
99
|
fieldSchema['x-decorator-props']['params'] = params;
|
|
100
|
+
var serviceFilter = (0, _lodash.cloneDeep)(filter);
|
|
101
|
+
|
|
102
|
+
if (extraFilter) {
|
|
103
|
+
if (serviceFilter) {
|
|
104
|
+
serviceFilter = {
|
|
105
|
+
$and: [extraFilter, serviceFilter]
|
|
106
|
+
};
|
|
107
|
+
} else {
|
|
108
|
+
serviceFilter = extraFilter;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
97
112
|
service.run(_objectSpread(_objectSpread({}, (_service$params = service.params) === null || _service$params === void 0 ? void 0 : _service$params[0]), {}, {
|
|
98
|
-
filter:
|
|
113
|
+
filter: serviceFilter,
|
|
99
114
|
page: 1
|
|
100
115
|
}));
|
|
101
116
|
dn.emit('patch', {
|
|
@@ -262,9 +262,10 @@ Upload.Attachment = (0, _react.connect)(function (props) {
|
|
|
262
262
|
}));
|
|
263
263
|
}, (0, _react.mapReadPretty)(_ReadPretty.ReadPretty.Attachment));
|
|
264
264
|
Upload.Dragger = (0, _react.connect)(function (props) {
|
|
265
|
+
var tipContent = props.tipContent;
|
|
265
266
|
return /*#__PURE__*/_react2.default.createElement("div", {
|
|
266
267
|
className: (0, _builtins__.usePrefixCls)('upload-dragger')
|
|
267
|
-
}, /*#__PURE__*/_react2.default.createElement(_antd.Upload.Dragger, _objectSpread({}, (0, _shared.useUploadProps)(props))));
|
|
268
|
+
}, /*#__PURE__*/_react2.default.createElement(_antd.Upload.Dragger, _objectSpread({}, (0, _shared.useUploadProps)(props)), tipContent, props.children));
|
|
268
269
|
}, (0, _react.mapProps)({
|
|
269
270
|
value: 'fileList'
|
|
270
271
|
}));
|
|
@@ -251,9 +251,11 @@ function useUploadProps(_ref) {
|
|
|
251
251
|
(_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, normalizeFileList(_toConsumableArray(param.fileList)));
|
|
252
252
|
};
|
|
253
253
|
|
|
254
|
-
var form = (0, _react.useForm)();
|
|
255
254
|
var api = (0, _apiClient.useAPIClient)();
|
|
256
255
|
return _objectSpread(_objectSpread({}, props), {}, {
|
|
256
|
+
// in customRequest method can't modify form's status(e.g: form.disabled=true )
|
|
257
|
+
// that will be trigger Upload component(actual Underlying is AjaxUploader component )'s componentWillUnmount method
|
|
258
|
+
// which will cause multiple files upload fail
|
|
257
259
|
customRequest: function customRequest(_ref2) {
|
|
258
260
|
var action = _ref2.action,
|
|
259
261
|
data = _ref2.data,
|
|
@@ -273,7 +275,6 @@ function useUploadProps(_ref) {
|
|
|
273
275
|
}
|
|
274
276
|
|
|
275
277
|
formData.append(filename, file);
|
|
276
|
-
form.disabled = true;
|
|
277
278
|
api.axios.post(action, formData, {
|
|
278
279
|
withCredentials: withCredentials,
|
|
279
280
|
headers: headers,
|
|
@@ -287,9 +288,7 @@ function useUploadProps(_ref) {
|
|
|
287
288
|
}).then(function (_ref4) {
|
|
288
289
|
var data = _ref4.data;
|
|
289
290
|
onSuccess(data, file);
|
|
290
|
-
}).catch(onError).finally(function () {
|
|
291
|
-
form.disabled = false;
|
|
292
|
-
});
|
|
291
|
+
}).catch(onError).finally(function () {});
|
|
293
292
|
return {
|
|
294
293
|
abort: function abort() {
|
|
295
294
|
console.log('upload progress is aborted.');
|
|
@@ -12,6 +12,8 @@ export type UploadProps = Omit<AntdUploadProps, 'onChange'> & {
|
|
|
12
12
|
export type DraggerProps = Omit<AntdDraggerProps, 'onChange'> & {
|
|
13
13
|
onChange?: (fileList: UploadFile[]) => void;
|
|
14
14
|
serviceErrorMessage?: string;
|
|
15
|
+
tipContent?: string | React.ReactNode;
|
|
16
|
+
children?: React.ReactNode;
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
export type ComposedUpload = React.FC<UploadProps> & {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BulkEditFormItemInitializers: (props: any) => JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BulkEditFormItemInitializers = void 0;
|
|
7
|
+
|
|
8
|
+
var _lodash = require("lodash");
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _reactI18next = require("react-i18next");
|
|
13
|
+
|
|
14
|
+
var _SchemaInitializer = require("../SchemaInitializer");
|
|
15
|
+
|
|
16
|
+
var _utils = require("../utils");
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
var BulkEditFormItemInitializers = function BulkEditFormItemInitializers(props) {
|
|
21
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
22
|
+
t = _useTranslation.t;
|
|
23
|
+
|
|
24
|
+
var insertPosition = props.insertPosition,
|
|
25
|
+
component = props.component;
|
|
26
|
+
var associationFields = (0, _utils.useAssociatedFormItemInitializerFields)({
|
|
27
|
+
readPretty: true,
|
|
28
|
+
block: 'Form'
|
|
29
|
+
});
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement(_SchemaInitializer.SchemaInitializer.Button, {
|
|
31
|
+
wrap: _utils.gridRowColWrap,
|
|
32
|
+
icon: 'SettingOutlined',
|
|
33
|
+
items: (0, _lodash.union)([{
|
|
34
|
+
type: 'itemGroup',
|
|
35
|
+
title: t('Display fields'),
|
|
36
|
+
children: (0, _utils.useCustomBulkEditFormItemInitializerFields)()
|
|
37
|
+
}], associationFields.length > 0 ? [{
|
|
38
|
+
type: 'divider'
|
|
39
|
+
}, {
|
|
40
|
+
type: 'itemGroup',
|
|
41
|
+
title: t('Display association fields'),
|
|
42
|
+
children: associationFields
|
|
43
|
+
}] : [], [{
|
|
44
|
+
type: 'divider'
|
|
45
|
+
}, {
|
|
46
|
+
type: 'item',
|
|
47
|
+
title: t('Add text'),
|
|
48
|
+
component: 'BlockInitializer',
|
|
49
|
+
schema: {
|
|
50
|
+
type: 'void',
|
|
51
|
+
'x-editable': false,
|
|
52
|
+
'x-decorator': 'FormItem',
|
|
53
|
+
'x-designer': 'Markdown.Void.Designer',
|
|
54
|
+
'x-component': 'Markdown.Void',
|
|
55
|
+
'x-component-props': {
|
|
56
|
+
content: t('This is a demo text, **supports Markdown syntax**.')
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}]),
|
|
60
|
+
insertPosition: insertPosition,
|
|
61
|
+
component: component,
|
|
62
|
+
title: component ? null : t('Configure fields')
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
exports.BulkEditFormItemInitializers = BulkEditFormItemInitializers;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CreateFormBulkEditBlockInitializers: (props: any) => JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CreateFormBulkEditBlockInitializers = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactI18next = require("react-i18next");
|
|
11
|
+
|
|
12
|
+
var _ = require("../..");
|
|
13
|
+
|
|
14
|
+
var _utils = require("../utils");
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
var CreateFormBulkEditBlockInitializers = function CreateFormBulkEditBlockInitializers(props) {
|
|
19
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
20
|
+
t = _useTranslation.t;
|
|
21
|
+
|
|
22
|
+
var insertPosition = props.insertPosition,
|
|
23
|
+
component = props.component;
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_.SchemaInitializer.Button, {
|
|
25
|
+
wrap: _utils.gridRowColWrap,
|
|
26
|
+
title: component ? null : t('Add block'),
|
|
27
|
+
icon: 'PlusOutlined',
|
|
28
|
+
insertPosition: insertPosition,
|
|
29
|
+
component: component,
|
|
30
|
+
items: [{
|
|
31
|
+
type: 'itemGroup',
|
|
32
|
+
title: '{{t("Data blocks")}}',
|
|
33
|
+
children: [{
|
|
34
|
+
type: 'item',
|
|
35
|
+
title: '{{t("Form")}}',
|
|
36
|
+
component: 'CreateFormBulkEditBlockInitializer'
|
|
37
|
+
}]
|
|
38
|
+
}, {
|
|
39
|
+
type: 'itemGroup',
|
|
40
|
+
title: '{{t("Other blocks")}}',
|
|
41
|
+
children: [{
|
|
42
|
+
type: 'item',
|
|
43
|
+
title: '{{t("Markdown")}}',
|
|
44
|
+
component: 'MarkdownBlockInitializer'
|
|
45
|
+
}]
|
|
46
|
+
}]
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.CreateFormBulkEditBlockInitializers = CreateFormBulkEditBlockInitializers;
|