@nocobase/client 0.7.3-alpha.1 → 0.7.4-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/application/Application.d.ts +1 -0
- package/es/application/Application.js +7 -1
- package/es/block-provider/FormBlockProvider.js +7 -0
- package/es/block-provider/TableFieldProvider.d.ts +1 -0
- package/es/block-provider/TableFieldProvider.js +5 -2
- package/es/block-provider/TableSelectorProvider.js +1 -1
- package/es/block-provider/hooks/index.js +14 -2
- package/es/collection-manager/CollectionField.js +9 -4
- package/es/collection-manager/Configuration/AddFieldAction.js +6 -0
- package/es/collection-manager/Configuration/EditFieldAction.js +7 -0
- package/es/collection-manager/Configuration/index.js +5 -1
- package/es/collection-manager/Configuration/schemas/collections.js +3 -2
- package/es/collection-manager/action-hooks.d.ts +3 -0
- package/es/collection-manager/action-hooks.js +91 -36
- package/es/collection-manager/interfaces/checkbox.js +1 -0
- package/es/collection-manager/interfaces/checkboxGroup.js +1 -0
- package/es/collection-manager/interfaces/datetime.js +1 -0
- package/es/collection-manager/interfaces/email.js +1 -0
- package/es/collection-manager/interfaces/icon.js +1 -0
- package/es/collection-manager/interfaces/input.js +1 -0
- package/es/collection-manager/interfaces/integer.js +1 -0
- package/es/collection-manager/interfaces/m2m.js +2 -0
- package/es/collection-manager/interfaces/m2o.js +1 -0
- package/es/collection-manager/interfaces/markdown.js +1 -0
- package/es/collection-manager/interfaces/multipleSelect.js +1 -0
- package/es/collection-manager/interfaces/number.js +1 -0
- package/es/collection-manager/interfaces/o2m.js +1 -0
- package/es/collection-manager/interfaces/o2o.js +3 -0
- package/es/collection-manager/interfaces/password.js +3 -1
- package/es/collection-manager/interfaces/percent.js +1 -0
- package/es/collection-manager/interfaces/phone.js +1 -0
- package/es/collection-manager/interfaces/properties/index.d.ts +1 -0
- package/es/collection-manager/interfaces/properties/index.js +1 -0
- package/es/collection-manager/interfaces/properties/operators.js +4 -4
- package/es/collection-manager/interfaces/radioGroup.js +1 -0
- package/es/collection-manager/interfaces/richText.js +1 -0
- package/es/collection-manager/interfaces/select.js +1 -0
- package/es/collection-manager/interfaces/textarea.js +1 -0
- package/es/collection-manager/interfaces/time.js +1 -0
- package/es/locale/en_US.d.ts +3 -2
- package/es/locale/en_US.js +4 -3
- package/es/locale/zh_CN.d.ts +5 -2
- package/es/locale/zh_CN.js +5 -2
- package/es/plugin-manager/PluginManager.d.ts +1 -0
- package/es/plugin-manager/PluginManager.js +12 -2
- package/es/schema-component/antd/calendar/Calendar.Designer.js +16 -10
- package/es/schema-component/antd/date-picker/DatePicker.d.ts +1 -1
- package/es/schema-component/antd/date-picker/DatePicker.js +1 -1
- package/es/schema-component/antd/date-picker/ReadPretty.js +1 -1
- package/es/schema-component/antd/date-picker/util.d.ts +0 -10
- package/es/schema-component/antd/date-picker/util.js +1 -79
- package/es/schema-component/antd/form-item/FormItem.js +39 -9
- package/es/schema-component/antd/input-number/InputNumber.js +1 -1
- package/es/schema-component/antd/input-number/ReadPretty.js +2 -4
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +1 -1
- package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +1 -1
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +3 -1
- package/es/schema-component/antd/table-v2/Table.d.ts +0 -11
- package/es/schema-component/antd/table-v2/Table.js +162 -88
- package/es/schema-component/antd/table-v2/TableField.js +3 -0
- package/es/schema-component/antd/tabs/Tabs.Designer.js +23 -12
- package/es/schema-component/antd/tabs/Tabs.js +7 -1
- package/es/schema-component/core/DesignableSwitch.js +7 -1
- package/es/schema-initializer/buttons/TabPaneInitializers.js +11 -3
- package/es/schema-initializer/components/assigned-field/AssignedField.js +6 -4
- package/es/schema-initializer/items/index.js +2 -1
- package/es/schema-initializer/utils.js +16 -0
- package/es/schema-settings/SchemaSettings.js +7 -0
- package/lib/application/Application.d.ts +1 -0
- package/lib/application/Application.js +11 -2
- package/lib/block-provider/FormBlockProvider.js +8 -0
- package/lib/block-provider/TableFieldProvider.d.ts +1 -0
- package/lib/block-provider/TableFieldProvider.js +4 -1
- package/lib/block-provider/TableSelectorProvider.js +1 -1
- package/lib/block-provider/hooks/index.js +14 -2
- package/lib/collection-manager/CollectionField.js +9 -4
- package/lib/collection-manager/Configuration/AddFieldAction.js +6 -0
- package/lib/collection-manager/Configuration/EditFieldAction.js +7 -0
- package/lib/collection-manager/Configuration/index.js +5 -0
- package/lib/collection-manager/Configuration/schemas/collections.js +3 -2
- package/lib/collection-manager/action-hooks.d.ts +3 -0
- package/lib/collection-manager/action-hooks.js +98 -37
- package/lib/collection-manager/interfaces/checkbox.js +1 -0
- package/lib/collection-manager/interfaces/checkboxGroup.js +1 -0
- package/lib/collection-manager/interfaces/datetime.js +1 -0
- package/lib/collection-manager/interfaces/email.js +1 -0
- package/lib/collection-manager/interfaces/icon.js +1 -0
- package/lib/collection-manager/interfaces/input.js +1 -0
- package/lib/collection-manager/interfaces/integer.js +1 -0
- package/lib/collection-manager/interfaces/m2m.js +2 -0
- package/lib/collection-manager/interfaces/m2o.js +1 -0
- package/lib/collection-manager/interfaces/markdown.js +1 -0
- package/lib/collection-manager/interfaces/multipleSelect.js +1 -0
- package/lib/collection-manager/interfaces/number.js +1 -0
- package/lib/collection-manager/interfaces/o2m.js +1 -0
- package/lib/collection-manager/interfaces/o2o.js +3 -0
- package/lib/collection-manager/interfaces/password.js +4 -2
- package/lib/collection-manager/interfaces/percent.js +1 -0
- package/lib/collection-manager/interfaces/phone.js +1 -0
- package/lib/collection-manager/interfaces/properties/index.d.ts +1 -0
- package/lib/collection-manager/interfaces/properties/index.js +1 -0
- package/lib/collection-manager/interfaces/properties/operators.js +4 -4
- package/lib/collection-manager/interfaces/radioGroup.js +1 -0
- package/lib/collection-manager/interfaces/richText.js +1 -0
- package/lib/collection-manager/interfaces/select.js +1 -0
- package/lib/collection-manager/interfaces/textarea.js +1 -0
- package/lib/collection-manager/interfaces/time.js +1 -0
- package/lib/locale/en_US.d.ts +3 -2
- package/lib/locale/en_US.js +4 -3
- package/lib/locale/zh_CN.d.ts +5 -2
- package/lib/locale/zh_CN.js +5 -2
- package/lib/plugin-manager/PluginManager.d.ts +1 -0
- package/lib/plugin-manager/PluginManager.js +15 -2
- package/lib/schema-component/antd/calendar/Calendar.Designer.js +16 -10
- package/lib/schema-component/antd/date-picker/DatePicker.d.ts +1 -1
- package/lib/schema-component/antd/date-picker/DatePicker.js +2 -2
- package/lib/schema-component/antd/date-picker/ReadPretty.js +6 -6
- package/lib/schema-component/antd/date-picker/util.d.ts +0 -10
- package/lib/schema-component/antd/date-picker/util.js +6 -89
- package/lib/schema-component/antd/form-item/FormItem.js +42 -18
- package/lib/schema-component/antd/input-number/InputNumber.js +6 -6
- package/lib/schema-component/antd/input-number/ReadPretty.js +2 -5
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +2 -2
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +1 -1
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +3 -1
- package/lib/schema-component/antd/table-v2/Table.d.ts +0 -11
- package/lib/schema-component/antd/table-v2/Table.js +171 -90
- package/lib/schema-component/antd/table-v2/TableField.js +3 -0
- package/lib/schema-component/antd/tabs/Tabs.Designer.js +23 -12
- package/lib/schema-component/antd/tabs/Tabs.js +8 -1
- package/lib/schema-component/core/DesignableSwitch.js +8 -1
- package/lib/schema-initializer/buttons/TabPaneInitializers.js +11 -3
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +7 -4
- package/lib/schema-initializer/items/index.js +2 -1
- package/lib/schema-initializer/utils.js +16 -0
- package/lib/schema-settings/SchemaSettings.js +7 -0
- package/package.json +5 -4
|
@@ -25,6 +25,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
25
25
|
|
|
26
26
|
import { RecursionField, useField, useFieldSchema } from '@formily/react';
|
|
27
27
|
import { Select } from 'antd';
|
|
28
|
+
import { differenceBy, unionBy } from 'lodash';
|
|
28
29
|
import React, { createContext, useContext, useEffect, useState } from 'react';
|
|
29
30
|
import { useTableSelectorProps as useTsp } from '../../../block-provider/TableSelectorProvider';
|
|
30
31
|
import { CollectionProvider, useCollection } from '../../../collection-manager';
|
|
@@ -32,7 +33,6 @@ import { FormProvider, SchemaComponentOptions } from '../../core';
|
|
|
32
33
|
import { useCompile } from '../../hooks';
|
|
33
34
|
import { ActionContext, useActionContext } from '../action';
|
|
34
35
|
import { useFieldNames } from './useFieldNames';
|
|
35
|
-
import { differenceBy, unionBy } from 'lodash';
|
|
36
36
|
var RecordPickerContext = /*#__PURE__*/createContext(null);
|
|
37
37
|
|
|
38
38
|
var useTableSelectorProps = function useTableSelectorProps() {
|
|
@@ -69,7 +69,7 @@ export var ReadPrettyRecordPicker = observer(function (props) {
|
|
|
69
69
|
setRecord(record);
|
|
70
70
|
ellipsisWithTooltipRef === null || ellipsisWithTooltipRef === void 0 ? void 0 : (_ellipsisWithTooltipR = ellipsisWithTooltipRef.current) === null || _ellipsisWithTooltipR === void 0 ? void 0 : _ellipsisWithTooltipR.setPopoverVisible(false);
|
|
71
71
|
}
|
|
72
|
-
}, compile(record === null || record === void 0 ? void 0 : record[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label']))), index < arr.length - 1 ? /*#__PURE__*/React.createElement("span", {
|
|
72
|
+
}, compile(record === null || record === void 0 ? void 0 : record[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label) || 'label']) || (record === null || record === void 0 ? void 0 : record[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value']) || (record === null || record === void 0 ? void 0 : record.id))), index < arr.length - 1 ? /*#__PURE__*/React.createElement("span", {
|
|
73
73
|
style: {
|
|
74
74
|
marginRight: 4,
|
|
75
75
|
color: '#aaa'
|
|
@@ -114,7 +114,9 @@ export var TableColumnDesigner = function TableColumnDesigner(props) {
|
|
|
114
114
|
options: options,
|
|
115
115
|
value: fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames['label'],
|
|
116
116
|
onChange: function onChange(label) {
|
|
117
|
-
var
|
|
117
|
+
var _collectionField$uiSc2, _fieldSchema$xCompon2;
|
|
118
|
+
|
|
119
|
+
var fieldNames = _objectSpread(_objectSpread(_objectSpread({}, collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc2 = collectionField.uiSchema) === null || _collectionField$uiSc2 === void 0 ? void 0 : _collectionField$uiSc2['x-component-props']['fieldNames']), fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2['fieldNames']), {}, {
|
|
118
120
|
label: label
|
|
119
121
|
});
|
|
120
122
|
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
export declare const components: {
|
|
2
|
-
header: {
|
|
3
|
-
wrapper: (props: any) => JSX.Element;
|
|
4
|
-
cell: (props: any) => JSX.Element;
|
|
5
|
-
};
|
|
6
|
-
body: {
|
|
7
|
-
wrapper: (props: any) => JSX.Element;
|
|
8
|
-
row: (props: any) => JSX.Element;
|
|
9
|
-
cell: (props: any) => JSX.Element;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
1
|
export declare const Table: any;
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
var _excluded = ["pagination", "useProps", "onChange"],
|
|
2
2
|
_excluded2 = ["pagination"],
|
|
3
|
-
_excluded3 = ["dragSort", "showIndex", "
|
|
3
|
+
_excluded3 = ["dragSort", "showIndex", "onRowSelectionChange", "onChange", "rowSelection", "rowKey", "required"];
|
|
4
4
|
|
|
5
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
6
|
-
|
|
7
|
-
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); } }
|
|
8
|
-
|
|
9
|
-
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); }); }; }
|
|
5
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
10
6
|
|
|
11
7
|
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; }
|
|
12
8
|
|
|
13
9
|
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; }
|
|
14
10
|
|
|
15
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
16
|
-
|
|
17
11
|
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; }
|
|
18
12
|
|
|
19
13
|
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; }
|
|
20
14
|
|
|
21
15
|
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; }
|
|
22
16
|
|
|
17
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
18
|
+
|
|
23
19
|
import { MenuOutlined } from '@ant-design/icons';
|
|
20
|
+
import { SortableContext, useSortable } from '@dnd-kit/sortable';
|
|
24
21
|
import { css } from '@emotion/css';
|
|
25
22
|
import { observer, RecursionField, useField, useFieldSchema } from '@formily/react';
|
|
23
|
+
import { reaction } from '@formily/reactive';
|
|
24
|
+
import { useMemoizedFn } from 'ahooks';
|
|
26
25
|
import { Table as AntdTable } from 'antd';
|
|
27
26
|
import { default as classNames, default as cls } from 'classnames';
|
|
28
|
-
import React from 'react';
|
|
29
|
-
import ReactDragListView from 'react-drag-listview';
|
|
27
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
30
28
|
import { useTranslation } from 'react-i18next';
|
|
31
29
|
import { DndContext } from '../..';
|
|
32
30
|
import { RecordIndexProvider, RecordProvider, useSchemaInitializer } from '../../../';
|
|
@@ -102,39 +100,41 @@ var useTableColumns = function useTableColumns() {
|
|
|
102
100
|
});
|
|
103
101
|
};
|
|
104
102
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
}
|
|
103
|
+
var topActiveClass = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n & > td {\n border-top: 2px solid rgba(241, 139, 98, 0.6) !important;\n }\n"])));
|
|
104
|
+
var bottomActiveClass = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n & > td {\n border-bottom: 2px solid rgba(241, 139, 98, 0.6) !important;\n }\n"])));
|
|
105
|
+
|
|
106
|
+
var SortableRow = function SortableRow(props) {
|
|
107
|
+
var _props$dataRowKey, _active$data$current$, _active$data$current, _over$data$current$so, _over$data$current;
|
|
108
|
+
|
|
109
|
+
var id = (_props$dataRowKey = props['data-row-key']) === null || _props$dataRowKey === void 0 ? void 0 : _props$dataRowKey.toString();
|
|
110
|
+
|
|
111
|
+
var _useSortable = useSortable({
|
|
112
|
+
id: id
|
|
113
|
+
}),
|
|
114
|
+
setNodeRef = _useSortable.setNodeRef,
|
|
115
|
+
isOver = _useSortable.isOver,
|
|
116
|
+
active = _useSortable.active,
|
|
117
|
+
over = _useSortable.over;
|
|
118
|
+
|
|
119
|
+
var className = ((_active$data$current$ = active === null || active === void 0 ? void 0 : (_active$data$current = active.data.current) === null || _active$data$current === void 0 ? void 0 : _active$data$current.sortable.index) !== null && _active$data$current$ !== void 0 ? _active$data$current$ : -1) > ((_over$data$current$so = over === null || over === void 0 ? void 0 : (_over$data$current = over.data.current) === null || _over$data$current === void 0 ? void 0 : _over$data$current.sortable.index) !== null && _over$data$current$so !== void 0 ? _over$data$current$so : -1) ? topActiveClass : bottomActiveClass;
|
|
120
|
+
return /*#__PURE__*/React.createElement("tr", _objectSpread(_objectSpread({
|
|
121
|
+
ref: (active === null || active === void 0 ? void 0 : active.id) !== id ? setNodeRef : null
|
|
122
|
+
}, props), {}, {
|
|
123
|
+
className: classNames(_defineProperty({}, className, active && isOver))
|
|
124
|
+
}));
|
|
129
125
|
};
|
|
130
126
|
|
|
131
|
-
var SortHandle = function SortHandle() {
|
|
132
|
-
|
|
133
|
-
|
|
127
|
+
var SortHandle = function SortHandle(props) {
|
|
128
|
+
var _useSortable2 = useSortable({
|
|
129
|
+
id: props.id
|
|
130
|
+
}),
|
|
131
|
+
listeners = _useSortable2.listeners;
|
|
132
|
+
|
|
133
|
+
return /*#__PURE__*/React.createElement(MenuOutlined, _objectSpread(_objectSpread({}, listeners), {}, {
|
|
134
134
|
style: {
|
|
135
135
|
cursor: 'grab'
|
|
136
136
|
}
|
|
137
|
-
});
|
|
137
|
+
}));
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
var TableIndex = function TableIndex(props) {
|
|
@@ -169,6 +169,25 @@ var usePaginationProps = function usePaginationProps(pagination1, pagination2) {
|
|
|
169
169
|
}, pagination1), pagination2);
|
|
170
170
|
};
|
|
171
171
|
|
|
172
|
+
var useValidator = function useValidator(validator) {
|
|
173
|
+
var field = useField();
|
|
174
|
+
useEffect(function () {
|
|
175
|
+
var dispose = reaction(function () {
|
|
176
|
+
return field.value;
|
|
177
|
+
}, function (value) {
|
|
178
|
+
var message = validator(value);
|
|
179
|
+
field.setFeedback({
|
|
180
|
+
type: 'error',
|
|
181
|
+
code: 'ValidateError',
|
|
182
|
+
messages: message ? [message] : []
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
return function () {
|
|
186
|
+
dispose();
|
|
187
|
+
};
|
|
188
|
+
}, []);
|
|
189
|
+
};
|
|
190
|
+
|
|
172
191
|
export var Table = observer(function (props) {
|
|
173
192
|
var _field$data, _field$value3, _field$value3$slice;
|
|
174
193
|
|
|
@@ -189,13 +208,92 @@ export var Table = observer(function (props) {
|
|
|
189
208
|
dragSort = _others1$others$dragS === void 0 ? false : _others1$others$dragS,
|
|
190
209
|
_others1$others$showI = _others1$others.showIndex,
|
|
191
210
|
showIndex = _others1$others$showI === void 0 ? true : _others1$others$showI,
|
|
192
|
-
onRowDragEnd = _others1$others.onRowDragEnd,
|
|
193
211
|
onRowSelectionChange = _others1$others.onRowSelectionChange,
|
|
194
212
|
onTableChange = _others1$others.onChange,
|
|
195
213
|
rowSelection = _others1$others.rowSelection,
|
|
214
|
+
rowKey = _others1$others.rowKey,
|
|
215
|
+
required = _others1$others.required,
|
|
196
216
|
others = _objectWithoutProperties(_others1$others, _excluded3);
|
|
197
217
|
|
|
218
|
+
var onRowDragEnd = useMemoizedFn(others.onRowDragEnd || function () {});
|
|
198
219
|
var paginationProps = usePaginationProps(pagination1, pagination2);
|
|
220
|
+
var requiredValidator = field.required || required;
|
|
221
|
+
useEffect(function () {
|
|
222
|
+
field.setValidator(function (value) {
|
|
223
|
+
if (requiredValidator) {
|
|
224
|
+
return Array.isArray(value) && value.length > 0 ? null : 'The field value is required';
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return;
|
|
228
|
+
});
|
|
229
|
+
}, [requiredValidator]);
|
|
230
|
+
var components = useMemo(function () {
|
|
231
|
+
return {
|
|
232
|
+
header: {
|
|
233
|
+
wrapper: function wrapper(props) {
|
|
234
|
+
return /*#__PURE__*/React.createElement(DndContext, null, /*#__PURE__*/React.createElement("thead", _objectSpread({}, props)));
|
|
235
|
+
},
|
|
236
|
+
cell: function cell(props) {
|
|
237
|
+
return /*#__PURE__*/React.createElement("th", _objectSpread(_objectSpread({}, props), {}, {
|
|
238
|
+
className: cls(props.className, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n max-width: 300px;\n white-space: nowrap;\n &:hover .general-schema-designer {\n display: block;\n }\n "]))))
|
|
239
|
+
}));
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
body: {
|
|
243
|
+
wrapper: function wrapper(props) {
|
|
244
|
+
return /*#__PURE__*/React.createElement(DndContext, {
|
|
245
|
+
onDragEnd: function onDragEnd(e) {
|
|
246
|
+
var _e$active, _e$active$data$curren, _e$active$data$curren2, _e$over, _e$over$data$current, _e$over$data$current$;
|
|
247
|
+
|
|
248
|
+
if (!e.active || !e.over) {
|
|
249
|
+
console.warn('move cancel');
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
var fromIndex = (_e$active = e.active) === null || _e$active === void 0 ? void 0 : (_e$active$data$curren = _e$active.data.current) === null || _e$active$data$curren === void 0 ? void 0 : (_e$active$data$curren2 = _e$active$data$curren.sortable) === null || _e$active$data$curren2 === void 0 ? void 0 : _e$active$data$curren2.index;
|
|
254
|
+
var toIndex = (_e$over = e.over) === null || _e$over === void 0 ? void 0 : (_e$over$data$current = _e$over.data.current) === null || _e$over$data$current === void 0 ? void 0 : (_e$over$data$current$ = _e$over$data$current.sortable) === null || _e$over$data$current$ === void 0 ? void 0 : _e$over$data$current$.index;
|
|
255
|
+
var from = field.value[fromIndex];
|
|
256
|
+
var to = field.value[toIndex];
|
|
257
|
+
field.move(fromIndex, toIndex);
|
|
258
|
+
onRowDragEnd({
|
|
259
|
+
fromIndex: fromIndex,
|
|
260
|
+
toIndex: toIndex,
|
|
261
|
+
from: from,
|
|
262
|
+
to: to
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
}, /*#__PURE__*/React.createElement("tbody", _objectSpread({}, props)));
|
|
266
|
+
},
|
|
267
|
+
row: function row(props) {
|
|
268
|
+
return /*#__PURE__*/React.createElement(SortableRow, _objectSpread({}, props));
|
|
269
|
+
},
|
|
270
|
+
cell: function cell(props) {
|
|
271
|
+
return /*#__PURE__*/React.createElement("td", _objectSpread(_objectSpread({}, props), {}, {
|
|
272
|
+
className: classNames(props.className, css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n max-width: 300px;\n white-space: nowrap;\n .nb-read-pretty-input-number {\n text-align: right;\n }\n "]))))
|
|
273
|
+
}));
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
}, [field, onRowDragEnd, dragSort]);
|
|
278
|
+
|
|
279
|
+
var defaultRowKey = function defaultRowKey(record) {
|
|
280
|
+
var _field$value2, _field$value2$indexOf;
|
|
281
|
+
|
|
282
|
+
return (_field$value2 = field.value) === null || _field$value2 === void 0 ? void 0 : (_field$value2$indexOf = _field$value2.indexOf) === null || _field$value2$indexOf === void 0 ? void 0 : _field$value2$indexOf.call(_field$value2, record);
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
var getRowKey = function getRowKey(record) {
|
|
286
|
+
if (typeof rowKey === 'string') {
|
|
287
|
+
var _record$rowKey;
|
|
288
|
+
|
|
289
|
+
return (_record$rowKey = record[rowKey]) === null || _record$rowKey === void 0 ? void 0 : _record$rowKey.toString();
|
|
290
|
+
} else {
|
|
291
|
+
var _ref2;
|
|
292
|
+
|
|
293
|
+
return (_ref2 = (rowKey !== null && rowKey !== void 0 ? rowKey : defaultRowKey)(record)) === null || _ref2 === void 0 ? void 0 : _ref2.toString();
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
|
|
199
297
|
var restProps = {
|
|
200
298
|
rowSelection: rowSelection ? _objectSpread({
|
|
201
299
|
type: 'checkbox',
|
|
@@ -220,62 +318,32 @@ export var Table = observer(function (props) {
|
|
|
220
318
|
}
|
|
221
319
|
|
|
222
320
|
return /*#__PURE__*/React.createElement("div", {
|
|
223
|
-
className: classNames(checked ? 'checked' : null, css(
|
|
321
|
+
className: classNames(checked ? 'checked' : null, css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-evenly;\n padding-right: 8px;\n .nb-table-index {\n opacity: 0;\n }\n &:not(.checked) {\n .nb-table-index {\n opacity: 1;\n }\n }\n &:hover {\n .nb-table-index {\n opacity: 0;\n }\n .nb-origin-node {\n display: block;\n }\n }\n "]))))
|
|
224
322
|
}, /*#__PURE__*/React.createElement("div", {
|
|
225
|
-
className: classNames(checked ? 'checked' : null, css(
|
|
226
|
-
}, dragSort && /*#__PURE__*/React.createElement(SortHandle,
|
|
323
|
+
className: classNames(checked ? 'checked' : null, css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-evenly;\n "]))))
|
|
324
|
+
}, dragSort && /*#__PURE__*/React.createElement(SortHandle, {
|
|
325
|
+
id: getRowKey(record)
|
|
326
|
+
}), showIndex && /*#__PURE__*/React.createElement(TableIndex, {
|
|
227
327
|
index: index
|
|
228
328
|
})), /*#__PURE__*/React.createElement("div", {
|
|
229
|
-
className: classNames('nb-origin-node', checked ? 'checked' : null, css(
|
|
329
|
+
className: classNames('nb-origin-node', checked ? 'checked' : null, css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n position: absolute;\n right: 50%;\n transform: translateX(50%);\n &:not(.checked) {\n display: none;\n }\n "]))))
|
|
230
330
|
}, originNode));
|
|
231
331
|
}
|
|
232
332
|
}, rowSelection) : undefined
|
|
233
333
|
};
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
334
|
+
var SortableWrapper = useCallback(function (_ref3) {
|
|
335
|
+
var children = _ref3.children;
|
|
336
|
+
return dragSort ? /*#__PURE__*/React.createElement(SortableContext, {
|
|
337
|
+
items: field.value.map(getRowKey),
|
|
338
|
+
children: children
|
|
339
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, {
|
|
340
|
+
children: children
|
|
341
|
+
});
|
|
342
|
+
}, [field, dragSort]);
|
|
241
343
|
return /*#__PURE__*/React.createElement("div", {
|
|
242
|
-
className: css(
|
|
243
|
-
}, /*#__PURE__*/React.createElement(
|
|
244
|
-
|
|
245
|
-
onDragEnd: function () {
|
|
246
|
-
var _onDragEnd = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(fromIndex, toIndex) {
|
|
247
|
-
var from, to;
|
|
248
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
249
|
-
while (1) {
|
|
250
|
-
switch (_context.prev = _context.next) {
|
|
251
|
-
case 0:
|
|
252
|
-
from = field.value[fromIndex];
|
|
253
|
-
to = field.value[toIndex];
|
|
254
|
-
field.move(fromIndex, toIndex);
|
|
255
|
-
onRowDragEnd({
|
|
256
|
-
fromIndex: fromIndex,
|
|
257
|
-
toIndex: toIndex,
|
|
258
|
-
from: from,
|
|
259
|
-
to: to
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
case 4:
|
|
263
|
-
case "end":
|
|
264
|
-
return _context.stop();
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}, _callee);
|
|
268
|
-
}));
|
|
269
|
-
|
|
270
|
-
function onDragEnd(_x, _x2) {
|
|
271
|
-
return _onDragEnd.apply(this, arguments);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
return onDragEnd;
|
|
275
|
-
}(),
|
|
276
|
-
lineClassName: css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n border-bottom: 2px solid rgba(241, 139, 98, 0.6) !important;\n "])))
|
|
277
|
-
}, /*#__PURE__*/React.createElement(AntdTable, _objectSpread(_objectSpread(_objectSpread({
|
|
278
|
-
rowKey: defaultRowKey
|
|
344
|
+
className: css(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n .ant-table {\n overflow-x: auto;\n overflow-y: hidden;\n }\n "])))
|
|
345
|
+
}, /*#__PURE__*/React.createElement(SortableWrapper, null, /*#__PURE__*/React.createElement(AntdTable, _objectSpread(_objectSpread(_objectSpread({
|
|
346
|
+
rowKey: rowKey !== null && rowKey !== void 0 ? rowKey : defaultRowKey
|
|
279
347
|
}, others), restProps), {}, {
|
|
280
348
|
pagination: paginationProps,
|
|
281
349
|
components: components,
|
|
@@ -286,5 +354,11 @@ export var Table = observer(function (props) {
|
|
|
286
354
|
// scroll={{ x: 12 * 300 + 80 }}
|
|
287
355
|
columns: columns,
|
|
288
356
|
dataSource: field === null || field === void 0 ? void 0 : (_field$value3 = field.value) === null || _field$value3 === void 0 ? void 0 : (_field$value3$slice = _field$value3.slice) === null || _field$value3$slice === void 0 ? void 0 : _field$value3$slice.call(_field$value3)
|
|
289
|
-
})))
|
|
357
|
+
}))), field.errors.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
358
|
+
className: "ant-formily-item-error-help ant-formily-item-help ant-formily-item-help-enter ant-formily-item-help-enter-active"
|
|
359
|
+
}, field.errors.map(function (error) {
|
|
360
|
+
return error.messages.map(function (message) {
|
|
361
|
+
return /*#__PURE__*/React.createElement("div", null, message);
|
|
362
|
+
});
|
|
363
|
+
})));
|
|
290
364
|
});
|
|
@@ -32,6 +32,9 @@ export var TableField = observer(function (props) {
|
|
|
32
32
|
ctx.field.added.add(fieldSchema.name);
|
|
33
33
|
}
|
|
34
34
|
}, []);
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
field.decoratorProps.asterisk = fieldSchema.required;
|
|
37
|
+
}, [fieldSchema.required]);
|
|
35
38
|
return /*#__PURE__*/React.createElement("div", null, props.children);
|
|
36
39
|
});
|
|
37
40
|
TableField.ActionBar = observer(function (props) {
|
|
@@ -25,28 +25,39 @@ export var TabsDesigner = function TabsDesigner() {
|
|
|
25
25
|
properties: {
|
|
26
26
|
title: {
|
|
27
27
|
title: t('Tab name'),
|
|
28
|
+
required: true,
|
|
28
29
|
'x-decorator': 'FormItem',
|
|
29
30
|
'x-component': 'Input',
|
|
30
31
|
'x-component-props': {}
|
|
32
|
+
},
|
|
33
|
+
icon: {
|
|
34
|
+
title: t('Icon'),
|
|
35
|
+
'x-decorator': 'FormItem',
|
|
36
|
+
'x-component': 'IconPicker',
|
|
37
|
+
'x-component-props': {}
|
|
31
38
|
}
|
|
32
39
|
}
|
|
33
40
|
},
|
|
34
41
|
initialValues: {
|
|
35
|
-
title: field.title
|
|
42
|
+
title: field.title,
|
|
43
|
+
icon: field.componentProps.icon
|
|
36
44
|
},
|
|
37
45
|
onSubmit: function onSubmit(_ref) {
|
|
38
|
-
var
|
|
46
|
+
var _schema;
|
|
39
47
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
var title = _ref.title,
|
|
49
|
+
icon = _ref.icon;
|
|
50
|
+
var props = fieldSchema['x-component-props'] || {};
|
|
51
|
+
fieldSchema.title = title;
|
|
52
|
+
field.title = title;
|
|
53
|
+
props.icon = icon;
|
|
54
|
+
field.componentProps.icon = icon;
|
|
55
|
+
fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
|
|
56
|
+
fieldSchema['x-component-props'].icon = icon;
|
|
57
|
+
dn.emit('patch', {
|
|
58
|
+
schema: (_schema = {}, _defineProperty(_schema, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema, "title", title), _defineProperty(_schema, 'x-component-props', props), _schema)
|
|
59
|
+
});
|
|
60
|
+
dn.refresh();
|
|
50
61
|
}
|
|
51
62
|
}), /*#__PURE__*/React.createElement(SchemaSettings.Divider, null), /*#__PURE__*/React.createElement(SchemaSettings.Remove, null));
|
|
52
63
|
};
|
|
@@ -7,6 +7,7 @@ import { observer, RecursionField, useField, useFieldSchema } from '@formily/rea
|
|
|
7
7
|
import { Tabs as AntdTabs } from 'antd';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
9
|
import React from 'react';
|
|
10
|
+
import { Icon } from '../../../icon';
|
|
10
11
|
import { useSchemaInitializer } from '../../../schema-initializer';
|
|
11
12
|
import { DndContext, SortableItem } from '../../common';
|
|
12
13
|
import { useDesigner } from '../../hooks/useDesigner';
|
|
@@ -42,6 +43,11 @@ Tabs.TabPane = observer(function (props) {
|
|
|
42
43
|
var field = useField();
|
|
43
44
|
return /*#__PURE__*/React.createElement(SortableItem, {
|
|
44
45
|
className: classNames('nb-action-link', designerCss, props.className)
|
|
45
|
-
}, props.
|
|
46
|
+
}, props.icon && /*#__PURE__*/React.createElement(Icon, {
|
|
47
|
+
style: {
|
|
48
|
+
marginRight: 2
|
|
49
|
+
},
|
|
50
|
+
type: props.icon
|
|
51
|
+
}), " ", props.tab || field.title, /*#__PURE__*/React.createElement(Designer, null));
|
|
46
52
|
});
|
|
47
53
|
Tabs.Designer = TabsDesigner;
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useDesignable } from '..';
|
|
5
5
|
import { PluginManager } from '../../plugin-manager';
|
|
6
|
+
import { useHotkeys } from 'react-hotkeys-hook';
|
|
6
7
|
export var DesignableSwitch = function DesignableSwitch() {
|
|
7
8
|
var _useDesignable = useDesignable(),
|
|
8
9
|
designable = _useDesignable.designable,
|
|
@@ -15,12 +16,17 @@ export var DesignableSwitch = function DesignableSwitch() {
|
|
|
15
16
|
|
|
16
17
|
if (designable) {
|
|
17
18
|
style['backgroundColor'] = '#f18b62';
|
|
18
|
-
}
|
|
19
|
+
} // 快捷键切换编辑状态
|
|
19
20
|
|
|
21
|
+
|
|
22
|
+
useHotkeys('Ctrl+Shift+U', function () {
|
|
23
|
+
return setDesignable(!designable);
|
|
24
|
+
}, [designable]);
|
|
20
25
|
return /*#__PURE__*/React.createElement(PluginManager.Toolbar.Item, {
|
|
21
26
|
selected: designable,
|
|
22
27
|
icon: /*#__PURE__*/React.createElement(HighlightOutlined, null),
|
|
23
28
|
title: t('UI Editor'),
|
|
29
|
+
subtitle: 'Ctrl+Shift+U',
|
|
24
30
|
style: style,
|
|
25
31
|
onClick: function onClick() {
|
|
26
32
|
setDesignable(!designable);
|
|
@@ -20,7 +20,8 @@ export var TabPaneInitializers = function TabPaneInitializers() {
|
|
|
20
20
|
return {
|
|
21
21
|
run: function run() {
|
|
22
22
|
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
23
|
-
var title;
|
|
23
|
+
var _form$values, title, icon;
|
|
24
|
+
|
|
24
25
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
25
26
|
while (1) {
|
|
26
27
|
switch (_context.prev = _context.next) {
|
|
@@ -29,13 +30,15 @@ export var TabPaneInitializers = function TabPaneInitializers() {
|
|
|
29
30
|
return form.submit();
|
|
30
31
|
|
|
31
32
|
case 2:
|
|
32
|
-
|
|
33
|
+
_form$values = form.values, title = _form$values.title, icon = _form$values.icon;
|
|
33
34
|
insertBeforeEnd({
|
|
34
35
|
type: 'void',
|
|
35
36
|
title: title,
|
|
36
37
|
'x-component': 'Tabs.TabPane',
|
|
37
38
|
'x-designer': 'Tabs.Designer',
|
|
38
|
-
'x-component-props': {
|
|
39
|
+
'x-component-props': {
|
|
40
|
+
icon: icon
|
|
41
|
+
},
|
|
39
42
|
properties: {
|
|
40
43
|
grid: {
|
|
41
44
|
type: 'void',
|
|
@@ -94,6 +97,11 @@ export var TabPaneInitializers = function TabPaneInitializers() {
|
|
|
94
97
|
'x-component': 'Input',
|
|
95
98
|
'x-decorator': 'FormItem'
|
|
96
99
|
},
|
|
100
|
+
icon: {
|
|
101
|
+
title: '{{t("Icon")}}',
|
|
102
|
+
'x-component': 'IconPicker',
|
|
103
|
+
'x-decorator': 'FormItem'
|
|
104
|
+
},
|
|
97
105
|
footer: {
|
|
98
106
|
'x-component': 'Action.Modal.Footer',
|
|
99
107
|
type: 'void',
|
|
@@ -17,6 +17,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
17
17
|
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; }
|
|
18
18
|
|
|
19
19
|
import { connect, useField, useFieldSchema } from '@formily/react';
|
|
20
|
+
import { merge } from '@formily/shared';
|
|
20
21
|
import { Cascader, Select, Space } from 'antd';
|
|
21
22
|
import React, { useEffect, useState } from 'react';
|
|
22
23
|
import { useTranslation } from 'react-i18next';
|
|
@@ -79,10 +80,11 @@ var InternalField = function InternalField(props) {
|
|
|
79
80
|
}
|
|
80
81
|
|
|
81
82
|
setRequired(); // @ts-ignore
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
|
|
84
|
+
field.dataSource = uiSchema.enum;
|
|
85
|
+
var originalProps = compile(uiSchema['x-component-props']) || {};
|
|
86
|
+
var componentProps = merge(originalProps, field.componentProps || {});
|
|
87
|
+
field.componentProps = componentProps; // field.component = [component, componentProps];
|
|
86
88
|
}, [JSON.stringify(uiSchema)]);
|
|
87
89
|
|
|
88
90
|
if (!uiSchema) {
|
|
@@ -415,9 +415,10 @@ export var KanbanBlockInitializer = function KanbanBlockInitializer(props) {
|
|
|
415
415
|
schema: {
|
|
416
416
|
properties: {
|
|
417
417
|
groupField: {
|
|
418
|
-
title: t('
|
|
418
|
+
title: t('Grouping field'),
|
|
419
419
|
enum: fields,
|
|
420
420
|
required: true,
|
|
421
|
+
description: '{{t("Single select and radio fields can be used as the grouping field")}}',
|
|
421
422
|
'x-component': 'Select',
|
|
422
423
|
'x-component-props': {
|
|
423
424
|
objectValue: true,
|
|
@@ -388,11 +388,27 @@ var removeSchema = function removeSchema(schema, cb) {
|
|
|
388
388
|
return cb(schema);
|
|
389
389
|
};
|
|
390
390
|
|
|
391
|
+
var recursiveParent = function recursiveParent(schema) {
|
|
392
|
+
if (!schema.parent) return null;
|
|
393
|
+
if (schema.parent['x-initializer']) return schema.parent;
|
|
394
|
+
return recursiveParent(schema.parent);
|
|
395
|
+
};
|
|
396
|
+
|
|
391
397
|
export var useCurrentSchema = function useCurrentSchema(action, key) {
|
|
398
|
+
var _fieldSchema;
|
|
399
|
+
|
|
392
400
|
var find = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : findSchema;
|
|
393
401
|
var rm = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : removeSchema;
|
|
394
402
|
var fieldSchema = useFieldSchema();
|
|
395
403
|
|
|
404
|
+
if (!((_fieldSchema = fieldSchema) === null || _fieldSchema === void 0 ? void 0 : _fieldSchema['x-initializer'])) {
|
|
405
|
+
var recursiveInitializerSchema = recursiveParent(fieldSchema);
|
|
406
|
+
|
|
407
|
+
if (recursiveInitializerSchema) {
|
|
408
|
+
fieldSchema = recursiveInitializerSchema;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
396
412
|
var _useDesignable = useDesignable(),
|
|
397
413
|
_remove = _useDesignable.remove;
|
|
398
414
|
|
|
@@ -540,6 +540,8 @@ SchemaSettings.Remove = function (props) {
|
|
|
540
540
|
var _useTranslation3 = useTranslation(),
|
|
541
541
|
t = _useTranslation3.t;
|
|
542
542
|
|
|
543
|
+
var field = useField();
|
|
544
|
+
var fieldSchema = useFieldSchema();
|
|
543
545
|
var ctx = useBlockTemplateContext();
|
|
544
546
|
return /*#__PURE__*/React.createElement(SchemaSettings.Item, {
|
|
545
547
|
onClick: function onClick() {
|
|
@@ -553,6 +555,11 @@ SchemaSettings.Remove = function (props) {
|
|
|
553
555
|
breakRemoveOn: breakRemoveOn
|
|
554
556
|
};
|
|
555
557
|
|
|
558
|
+
if (field && field.required) {
|
|
559
|
+
field.required = false;
|
|
560
|
+
fieldSchema['required'] = false;
|
|
561
|
+
}
|
|
562
|
+
|
|
556
563
|
if (template && (ctx === null || ctx === void 0 ? void 0 : ctx.dn)) {
|
|
557
564
|
ctx === null || ctx === void 0 ? void 0 : ctx.dn.remove(null, options);
|
|
558
565
|
} else {
|