@nocobase/client 0.9.2-alpha.3 → 0.9.3-alpha.1
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/schemas/useRoleResourceValues.d.ts +1 -14
- package/es/api-client/hooks/useRequest.d.ts +1 -14
- package/es/api-client/hooks/useRequest.js +48 -53
- package/es/block-provider/DetailsBlockProvider.js +13 -1
- package/es/block-provider/FormBlockProvider.js +30 -13
- package/es/block-provider/hooks/index.d.ts +11 -1
- package/es/block-provider/hooks/index.js +527 -301
- package/es/collection-manager/Configuration/CollectionFields.js +1 -2
- package/es/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
- package/es/collection-manager/action-hooks.d.ts +4 -43
- package/es/collection-manager/action-hooks.js +18 -7
- package/es/collection-manager/interfaces/createdBy.js +1 -1
- package/es/collection-manager/interfaces/linkTo.js +5 -40
- package/es/collection-manager/interfaces/m2m.js +6 -39
- package/es/collection-manager/interfaces/m2o.js +6 -39
- package/es/collection-manager/interfaces/o2m.js +6 -69
- package/es/collection-manager/interfaces/o2o.js +31 -122
- package/es/collection-manager/interfaces/types.d.ts +2 -0
- package/es/collection-manager/interfaces/updatedBy.js +1 -1
- package/es/collection-manager/sub-table.d.ts +1 -14
- package/es/collection-manager/templates/tree.js +2 -2
- package/es/filter-provider/FilterProvider.js +3 -1
- package/es/locale/en_US.d.ts +4 -1
- package/es/locale/en_US.js +6 -3
- package/es/locale/ja_JP.d.ts +4 -1
- package/es/locale/ja_JP.js +4 -1
- package/es/locale/pt_BR.d.ts +1 -1
- package/es/locale/pt_BR.js +1 -1
- package/es/locale/zh_CN.d.ts +5 -1
- package/es/locale/zh_CN.js +5 -1
- package/es/schema-component/antd/action/Action.Designer.js +4 -5
- package/es/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
- package/es/schema-component/antd/association-field/AssociationFieldProvider.js +19 -0
- package/es/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
- package/es/schema-component/antd/association-field/AssociationSelect.js +118 -0
- package/es/schema-component/antd/association-field/Editable.d.ts +2 -0
- package/es/schema-component/antd/association-field/Editable.js +88 -0
- package/es/schema-component/antd/association-field/FileManager.d.ts +4 -0
- package/es/schema-component/antd/association-field/FileManager.js +243 -0
- package/es/schema-component/antd/association-field/InternalNester.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalNester.js +28 -0
- package/es/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalPicker.js +267 -0
- package/es/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
- package/es/schema-component/antd/association-field/InternalSubTable.js +28 -0
- package/es/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
- package/es/schema-component/antd/association-field/InternalViewer.js +115 -0
- package/es/schema-component/antd/association-field/Nester.d.ts +1 -0
- package/es/schema-component/antd/association-field/Nester.js +80 -0
- package/es/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
- package/es/schema-component/antd/association-field/ReadPretty.js +38 -0
- package/es/schema-component/antd/association-field/SubTable.d.ts +1 -0
- package/es/schema-component/antd/association-field/SubTable.js +25 -0
- package/es/schema-component/antd/association-field/context.d.ts +7 -0
- package/es/schema-component/antd/association-field/context.js +2 -0
- package/es/schema-component/antd/association-field/hooks.d.ts +8 -0
- package/es/schema-component/antd/association-field/hooks.js +96 -0
- package/es/schema-component/antd/association-field/index.d.ts +1 -0
- package/es/schema-component/antd/association-field/index.js +14 -0
- package/es/schema-component/antd/association-field/schema.d.ts +142 -0
- package/es/schema-component/antd/association-field/schema.js +141 -0
- package/es/schema-component/antd/association-field/util.d.ts +8 -0
- package/es/schema-component/antd/association-field/util.js +84 -0
- package/es/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
- package/es/schema-component/antd/association-select/AssociationSelect.js +11 -2
- package/es/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
- package/es/schema-component/antd/expand-action/Expand.Action.Design.js +112 -0
- package/es/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
- package/es/schema-component/antd/expand-action/Expand.Action.js +40 -0
- package/es/schema-component/antd/expand-action/index.d.ts +1 -0
- package/es/schema-component/antd/expand-action/index.js +5 -0
- package/es/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
- package/es/schema-component/antd/filter/FilterItem.js +1 -1
- package/es/schema-component/antd/filter/useOperators.d.ts +1 -1
- package/es/schema-component/antd/form-item/FormItem.d.ts +2 -1
- package/es/schema-component/antd/form-item/FormItem.js +206 -58
- package/es/schema-component/antd/form-item/SchemaSettingOptions.js +36 -58
- package/es/schema-component/antd/form-v2/utils.js +6 -4
- package/es/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
- package/es/schema-component/antd/gantt/components/other/tooltip.js +1 -1
- package/es/schema-component/antd/index.d.ts +3 -1
- package/es/schema-component/antd/index.js +3 -1
- package/es/schema-component/antd/menu/Menu.js +6 -3
- package/es/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +40 -17
- package/es/schema-component/antd/remote-select/RemoteSelect.js +16 -18
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
- package/es/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
- package/es/schema-component/antd/table-v2/Table.Index.js +6 -0
- package/es/schema-component/antd/table-v2/Table.js +9 -5
- package/es/schema-component/antd/table-v2/index.js +3 -1
- package/es/schema-component/antd/table-v2/utils.js +1 -1
- package/es/schema-component/antd/variable/Input.js +15 -16
- package/es/schema-component/antd/variable/TextArea.js +2 -5
- package/es/schema-component/antd/variable/Variable.d.ts +2 -0
- package/es/schema-component/antd/variable/Variable.js +5 -2
- package/es/schema-component/common/dnd-context/index.js +3 -2
- package/es/schema-component/common/sortable-item/SortableItem.js +4 -1
- package/es/schema-component/common/utils/uitls.js +1 -1
- package/es/schema-component/hooks/index.d.ts +1 -0
- package/es/schema-component/hooks/index.js +2 -1
- package/es/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
- package/es/schema-component/hooks/useFieldModeOptions.js +105 -0
- package/es/schema-initializer/components/CreateRecordAction.d.ts +1 -1
- package/es/schema-initializer/components/CreateRecordAction.js +4 -3
- package/es/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
- package/es/schema-initializer/items/ExpandActionInitializer.js +9 -34
- package/es/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
- package/es/schema-initializer/items/SelectActionInitializer.js +65 -0
- package/es/schema-initializer/items/index.d.ts +1 -0
- package/es/schema-initializer/items/index.js +2 -1
- package/es/schema-initializer/utils.js +57 -43
- package/es/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
- package/es/schema-settings/LinkageRules/Variables.d.ts +1 -1
- package/es/schema-settings/LinkageRules/Variables.js +7 -4
- package/es/schema-settings/SchemaSettings.js +3 -3
- package/es/schema-settings/VariableInput/VariableInput.d.ts +3 -2
- package/es/schema-settings/VariableInput/VariableInput.js +3 -1
- package/lib/acl/Configuration/schemas/useRoleResourceValues.d.ts +1 -14
- package/lib/api-client/hooks/useRequest.d.ts +1 -14
- package/lib/api-client/hooks/useRequest.js +48 -53
- package/lib/block-provider/DetailsBlockProvider.js +13 -1
- package/lib/block-provider/FormBlockProvider.js +31 -15
- package/lib/block-provider/hooks/index.d.ts +11 -1
- package/lib/block-provider/hooks/index.js +537 -308
- package/lib/collection-manager/Configuration/CollectionFields.js +1 -2
- package/lib/collection-manager/Configuration/EditCollectionAction.d.ts +1 -14
- package/lib/collection-manager/action-hooks.d.ts +4 -43
- package/lib/collection-manager/action-hooks.js +18 -7
- package/lib/collection-manager/interfaces/createdBy.js +1 -1
- package/lib/collection-manager/interfaces/linkTo.js +4 -39
- package/lib/collection-manager/interfaces/m2m.js +5 -38
- package/lib/collection-manager/interfaces/m2o.js +5 -38
- package/lib/collection-manager/interfaces/o2m.js +8 -71
- package/lib/collection-manager/interfaces/o2o.js +36 -127
- package/lib/collection-manager/interfaces/types.d.ts +2 -0
- package/lib/collection-manager/interfaces/updatedBy.js +1 -1
- package/lib/collection-manager/sub-table.d.ts +1 -14
- package/lib/collection-manager/templates/tree.js +2 -2
- package/lib/filter-provider/FilterProvider.js +3 -1
- package/lib/locale/en_US.d.ts +4 -1
- package/lib/locale/en_US.js +6 -3
- package/lib/locale/ja_JP.d.ts +4 -1
- package/lib/locale/ja_JP.js +4 -1
- package/lib/locale/pt_BR.d.ts +1 -1
- package/lib/locale/pt_BR.js +1 -1
- package/lib/locale/zh_CN.d.ts +5 -1
- package/lib/locale/zh_CN.js +5 -1
- package/lib/schema-component/antd/action/Action.Designer.js +4 -5
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.d.ts +2 -0
- package/lib/schema-component/antd/association-field/AssociationFieldProvider.js +28 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.d.ts +14 -0
- package/lib/schema-component/antd/association-field/AssociationSelect.js +129 -0
- package/lib/schema-component/antd/association-field/Editable.d.ts +2 -0
- package/lib/schema-component/antd/association-field/Editable.js +97 -0
- package/lib/schema-component/antd/association-field/FileManager.d.ts +4 -0
- package/lib/schema-component/antd/association-field/FileManager.js +253 -0
- package/lib/schema-component/antd/association-field/InternalNester.d.ts +1 -0
- package/lib/schema-component/antd/association-field/InternalNester.js +39 -0
- package/lib/schema-component/antd/association-field/InternalPicker.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalPicker.js +277 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.d.ts +1 -0
- package/lib/schema-component/antd/association-field/InternalSubTable.js +39 -0
- package/lib/schema-component/antd/association-field/InternalViewer.d.ts +2 -0
- package/lib/schema-component/antd/association-field/InternalViewer.js +126 -0
- package/lib/schema-component/antd/association-field/Nester.d.ts +1 -0
- package/lib/schema-component/antd/association-field/Nester.js +89 -0
- package/lib/schema-component/antd/association-field/ReadPretty.d.ts +2 -0
- package/lib/schema-component/antd/association-field/ReadPretty.js +47 -0
- package/lib/schema-component/antd/association-field/SubTable.d.ts +1 -0
- package/lib/schema-component/antd/association-field/SubTable.js +33 -0
- package/lib/schema-component/antd/association-field/context.d.ts +7 -0
- package/lib/schema-component/antd/association-field/context.js +9 -0
- package/lib/schema-component/antd/association-field/hooks.d.ts +8 -0
- package/lib/schema-component/antd/association-field/hooks.js +107 -0
- package/lib/schema-component/antd/association-field/index.d.ts +1 -0
- package/lib/schema-component/antd/association-field/index.js +21 -0
- package/lib/schema-component/antd/association-field/schema.d.ts +142 -0
- package/lib/schema-component/antd/association-field/schema.js +148 -0
- package/lib/schema-component/antd/association-field/util.d.ts +8 -0
- package/lib/schema-component/antd/association-field/util.js +98 -0
- package/lib/schema-component/antd/association-filter/AssociationFilter.FilterBlockInitializer.js +2 -2
- package/lib/schema-component/antd/association-select/AssociationSelect.js +10 -1
- package/lib/schema-component/antd/expand-action/Expand.Action.Design.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.Design.js +120 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/Expand.Action.js +48 -0
- package/lib/schema-component/antd/expand-action/index.d.ts +1 -0
- package/lib/schema-component/antd/expand-action/index.js +12 -0
- package/lib/schema-component/antd/filter/Filter.Action.Designer.js +10 -12
- package/lib/schema-component/antd/filter/FilterItem.js +1 -1
- package/lib/schema-component/antd/filter/useOperators.d.ts +1 -1
- package/lib/schema-component/antd/form-item/FormItem.d.ts +2 -1
- package/lib/schema-component/antd/form-item/FormItem.js +204 -55
- package/lib/schema-component/antd/form-item/SchemaSettingOptions.js +34 -56
- package/lib/schema-component/antd/form-v2/utils.js +6 -5
- package/lib/schema-component/antd/gantt/components/gantt/gantt.js +3 -3
- package/lib/schema-component/antd/gantt/components/other/tooltip.js +1 -1
- package/lib/schema-component/antd/index.d.ts +3 -1
- package/lib/schema-component/antd/index.js +33 -11
- package/lib/schema-component/antd/menu/Menu.js +6 -3
- package/lib/schema-component/antd/record-picker/InputRecordPicker.d.ts +1 -0
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +42 -18
- package/lib/schema-component/antd/remote-select/RemoteSelect.js +15 -17
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +18 -9
- package/lib/schema-component/antd/table-v2/Table.Index.d.ts +1 -0
- package/lib/schema-component/antd/table-v2/Table.Index.js +14 -0
- package/lib/schema-component/antd/table-v2/Table.js +9 -5
- package/lib/schema-component/antd/table-v2/index.js +3 -1
- package/lib/schema-component/antd/table-v2/utils.js +1 -1
- package/lib/schema-component/antd/variable/Input.js +15 -16
- package/lib/schema-component/antd/variable/TextArea.js +2 -5
- package/lib/schema-component/antd/variable/Variable.d.ts +2 -0
- package/lib/schema-component/antd/variable/Variable.js +6 -2
- package/lib/schema-component/common/dnd-context/index.js +3 -2
- package/lib/schema-component/common/sortable-item/SortableItem.js +4 -1
- package/lib/schema-component/common/utils/uitls.js +1 -1
- package/lib/schema-component/hooks/index.d.ts +1 -0
- package/lib/schema-component/hooks/index.js +11 -0
- package/lib/schema-component/hooks/useFieldModeOptions.d.ts +4 -0
- package/lib/schema-component/hooks/useFieldModeOptions.js +112 -0
- package/lib/schema-initializer/components/CreateRecordAction.d.ts +1 -1
- package/lib/schema-initializer/components/CreateRecordAction.js +4 -3
- package/lib/schema-initializer/items/ExpandActionInitializer.d.ts +0 -1
- package/lib/schema-initializer/items/ExpandActionInitializer.js +11 -37
- package/lib/schema-initializer/items/SelectActionInitializer.d.ts +1 -0
- package/lib/schema-initializer/items/SelectActionInitializer.js +73 -0
- package/lib/schema-initializer/items/index.d.ts +1 -0
- package/lib/schema-initializer/items/index.js +11 -0
- package/lib/schema-initializer/utils.js +56 -42
- package/lib/schema-settings/LinkageRules/FilterDynamicComponent.js +1 -1
- package/lib/schema-settings/LinkageRules/Variables.d.ts +1 -1
- package/lib/schema-settings/LinkageRules/Variables.js +7 -4
- package/lib/schema-settings/SchemaSettings.js +4 -4
- package/lib/schema-settings/VariableInput/VariableInput.d.ts +3 -2
- package/lib/schema-settings/VariableInput/VariableInput.js +3 -1
- package/package.json +5 -6
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ExpandActionDesign = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _schemaSettings = require("../../../schema-settings");
|
|
9
|
+
var _reactI18next = require("react-i18next");
|
|
10
|
+
var _react2 = require("@formily/react");
|
|
11
|
+
var _ = require("../..");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
14
|
+
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; }
|
|
15
|
+
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; }
|
|
16
|
+
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; }
|
|
17
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
18
|
+
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); }
|
|
19
|
+
var ExpandActionDesign = function ExpandActionDesign(props) {
|
|
20
|
+
var _fieldSchema$xCompon, _fieldSchema$xCompon2;
|
|
21
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
22
|
+
t = _useTranslation.t;
|
|
23
|
+
var fieldSchema = (0, _react2.useFieldSchema)();
|
|
24
|
+
var field = (0, _react2.useField)();
|
|
25
|
+
var _useDesignable = (0, _.useDesignable)(),
|
|
26
|
+
dn = _useDesignable.dn;
|
|
27
|
+
var _ref = fieldSchema['x-component-props'] || {},
|
|
28
|
+
titleExpand = _ref.titleExpand,
|
|
29
|
+
titleCollapse = _ref.titleCollapse,
|
|
30
|
+
iconExpand = _ref.iconExpand,
|
|
31
|
+
iconCollapse = _ref.iconCollapse;
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(_schemaSettings.GeneralSchemaDesigner, _objectSpread(_objectSpread({}, props), {}, {
|
|
33
|
+
disableInitializer: true
|
|
34
|
+
}), /*#__PURE__*/_react.default.createElement(_schemaSettings.SchemaSettings.ModalItem, {
|
|
35
|
+
title: t('Edit button'),
|
|
36
|
+
schema: {
|
|
37
|
+
type: 'object',
|
|
38
|
+
title: t('Edit button'),
|
|
39
|
+
properties: {
|
|
40
|
+
titleExpand: {
|
|
41
|
+
'x-decorator': 'FormItem',
|
|
42
|
+
'x-component': 'Input',
|
|
43
|
+
title: "".concat(t('Button title'), " - ").concat(t('Expand all')),
|
|
44
|
+
default: titleExpand
|
|
45
|
+
},
|
|
46
|
+
titleCollapse: {
|
|
47
|
+
'x-decorator': 'FormItem',
|
|
48
|
+
'x-component': 'Input',
|
|
49
|
+
title: "".concat(t('Button title'), " - ").concat(t('Collapse all')),
|
|
50
|
+
default: titleCollapse
|
|
51
|
+
},
|
|
52
|
+
iconExpand: {
|
|
53
|
+
'x-decorator': 'FormItem',
|
|
54
|
+
'x-component': 'IconPicker',
|
|
55
|
+
title: "".concat(t('Button icon'), " - ").concat(t('Expand all')),
|
|
56
|
+
default: iconExpand
|
|
57
|
+
},
|
|
58
|
+
iconCollapse: {
|
|
59
|
+
'x-decorator': 'FormItem',
|
|
60
|
+
'x-component': 'IconPicker',
|
|
61
|
+
title: "".concat(t('Button icon'), " - ").concat(t('Collapse all')),
|
|
62
|
+
default: iconCollapse
|
|
63
|
+
},
|
|
64
|
+
type: {
|
|
65
|
+
'x-decorator': 'FormItem',
|
|
66
|
+
'x-component': 'Radio.Group',
|
|
67
|
+
title: t('Button background color'),
|
|
68
|
+
default: (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.danger) ? 'danger' : (fieldSchema === null || fieldSchema === void 0 ? void 0 : (_fieldSchema$xCompon2 = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon2 === void 0 ? void 0 : _fieldSchema$xCompon2.type) === 'primary' ? 'primary' : 'default',
|
|
69
|
+
enum: [{
|
|
70
|
+
value: 'default',
|
|
71
|
+
label: '{{t("Default")}}'
|
|
72
|
+
}, {
|
|
73
|
+
value: 'primary',
|
|
74
|
+
label: '{{t("Highlight")}}'
|
|
75
|
+
}, {
|
|
76
|
+
value: 'danger',
|
|
77
|
+
label: '{{t("Danger red")}}'
|
|
78
|
+
}]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
onSubmit: function onSubmit(_ref2) {
|
|
83
|
+
var titleExpand = _ref2.titleExpand,
|
|
84
|
+
titleCollapse = _ref2.titleCollapse,
|
|
85
|
+
iconExpand = _ref2.iconExpand,
|
|
86
|
+
iconCollapse = _ref2.iconCollapse,
|
|
87
|
+
type = _ref2.type;
|
|
88
|
+
fieldSchema.title = t('Expand/Collapse');
|
|
89
|
+
field.title = t('Expand/Collapse');
|
|
90
|
+
field.componentProps.icon = iconExpand;
|
|
91
|
+
field.componentProps.danger = type === 'danger';
|
|
92
|
+
field.componentProps.type = type;
|
|
93
|
+
fieldSchema['x-component-props'] = _objectSpread(_objectSpread({}, fieldSchema['x-component-props'] || {}), {}, {
|
|
94
|
+
titleExpand: titleExpand,
|
|
95
|
+
titleCollapse: titleCollapse,
|
|
96
|
+
iconExpand: iconExpand,
|
|
97
|
+
iconCollapse: iconCollapse,
|
|
98
|
+
type: type,
|
|
99
|
+
danger: type === 'danger'
|
|
100
|
+
});
|
|
101
|
+
dn.emit('patch', {
|
|
102
|
+
schema: {
|
|
103
|
+
'x-uid': fieldSchema['x-uid'],
|
|
104
|
+
'x-component-props': fieldSchema['x-component-props'],
|
|
105
|
+
title: fieldSchema.title
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
dn.refresh();
|
|
109
|
+
}
|
|
110
|
+
}), /*#__PURE__*/_react.default.createElement(_schemaSettings.SchemaSettings.Divider, null), /*#__PURE__*/_react.default.createElement(_schemaSettings.SchemaSettings.Remove, {
|
|
111
|
+
removeParentsIfNoChildren: true,
|
|
112
|
+
breakRemoveOn: function breakRemoveOn(s) {
|
|
113
|
+
return s['x-component'] === 'Space' || s['x-component'].endsWith('ActionBar');
|
|
114
|
+
},
|
|
115
|
+
confirm: {
|
|
116
|
+
title: t('Delete action')
|
|
117
|
+
}
|
|
118
|
+
}));
|
|
119
|
+
};
|
|
120
|
+
exports.ExpandActionDesign = ExpandActionDesign;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ExpandAction: (props: any) => JSX.Element;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ExpandAction = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _react2 = require("@formily/react");
|
|
9
|
+
var _reactI18next = require("react-i18next");
|
|
10
|
+
var _blockProvider = require("../../../block-provider");
|
|
11
|
+
var _antd = require("antd");
|
|
12
|
+
var _css = require("@emotion/css");
|
|
13
|
+
var _icon = require("../../../icon");
|
|
14
|
+
var _templateObject;
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
17
|
+
var actionDesignerCss = (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n &:hover {\n .general-schema-designer {\n display: block;\n }\n }\n .general-schema-designer {\n position: absolute;\n z-index: 999;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n display: none;\n background: rgba(241, 139, 98, 0.06);\n border: 0;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n pointer-events: none;\n > .general-schema-designer-icons {\n position: absolute;\n right: 2px;\n top: 2px;\n line-height: 16px;\n pointer-events: all;\n .ant-space-item {\n background-color: #f18b62;\n color: #fff;\n line-height: 16px;\n width: 16px;\n padding-left: 1px;\n }\n }\n }\n"])));
|
|
18
|
+
var ExpandAction = function ExpandAction(props) {
|
|
19
|
+
var _schema$parent, _schema$parent$parent;
|
|
20
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
21
|
+
t = _useTranslation.t;
|
|
22
|
+
var schema = (0, _react2.useFieldSchema)();
|
|
23
|
+
var ctxSelector = (0, _blockProvider.useTableSelectorContext)();
|
|
24
|
+
var ctxBlock = (0, _blockProvider.useTableBlockContext)();
|
|
25
|
+
var isTableSelector = ((_schema$parent = schema.parent) === null || _schema$parent === void 0 ? void 0 : (_schema$parent$parent = _schema$parent.parent) === null || _schema$parent$parent === void 0 ? void 0 : _schema$parent$parent['x-decorator']) === 'TableSelectorProvider';
|
|
26
|
+
var ctx = isTableSelector ? ctxSelector : ctxBlock;
|
|
27
|
+
var _ref = schema['x-component-props'] || {},
|
|
28
|
+
titleExpand = _ref.titleExpand,
|
|
29
|
+
titleCollapse = _ref.titleCollapse,
|
|
30
|
+
iconExpand = _ref.iconExpand,
|
|
31
|
+
iconCollapse = _ref.iconCollapse;
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
33
|
+
className: actionDesignerCss
|
|
34
|
+
}, (ctx === null || ctx === void 0 ? void 0 : ctx.params['tree']) && /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
35
|
+
onClick: function onClick() {
|
|
36
|
+
ctx === null || ctx === void 0 ? void 0 : ctx.setExpandFlag();
|
|
37
|
+
},
|
|
38
|
+
icon: /*#__PURE__*/_react.default.createElement(_icon.Icon, {
|
|
39
|
+
type: (ctx === null || ctx === void 0 ? void 0 : ctx.expandFlag) ? iconCollapse : iconExpand
|
|
40
|
+
}),
|
|
41
|
+
type: props.type
|
|
42
|
+
}, props.children[1], /*#__PURE__*/_react.default.createElement("span", {
|
|
43
|
+
style: {
|
|
44
|
+
marginLeft: 10
|
|
45
|
+
}
|
|
46
|
+
}, (ctx === null || ctx === void 0 ? void 0 : ctx.expandFlag) ? titleCollapse : titleExpand)));
|
|
47
|
+
};
|
|
48
|
+
exports.ExpandAction = ExpandAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Expand: any;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Expand = void 0;
|
|
7
|
+
var _Expand = require("./Expand.Action");
|
|
8
|
+
var _ExpandAction = require("./Expand.Action.Design");
|
|
9
|
+
var Expand = _Expand.ExpandAction;
|
|
10
|
+
exports.Expand = Expand;
|
|
11
|
+
Expand.Action = _Expand.ExpandAction;
|
|
12
|
+
Expand.Action.Design = _ExpandAction.ExpandActionDesign;
|
|
@@ -100,20 +100,18 @@ var FilterActionDesigner = function FilterActionDesigner(props) {
|
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
102
|
onSubmit: function onSubmit(_ref) {
|
|
103
|
+
var _schema2;
|
|
103
104
|
var title = _ref.title,
|
|
104
105
|
icon = _ref.icon;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
fieldSchema['x-component-props']
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
});
|
|
115
|
-
dn.refresh();
|
|
116
|
-
}
|
|
106
|
+
fieldSchema.title = title;
|
|
107
|
+
field.title = title;
|
|
108
|
+
field.componentProps.icon = icon;
|
|
109
|
+
fieldSchema['x-component-props'] = fieldSchema['x-component-props'] || {};
|
|
110
|
+
fieldSchema['x-component-props'].icon = icon;
|
|
111
|
+
dn.emit('patch', {
|
|
112
|
+
schema: (_schema2 = {}, _defineProperty(_schema2, 'x-uid', fieldSchema['x-uid']), _defineProperty(_schema2, "title", title), _defineProperty(_schema2, 'x-component-props', _objectSpread({}, fieldSchema['x-component-props'])), _schema2)
|
|
113
|
+
});
|
|
114
|
+
dn.refresh();
|
|
117
115
|
}
|
|
118
116
|
}), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.Divider, null), /*#__PURE__*/_react2.default.createElement(_schemaSettings.SchemaSettings.Remove, {
|
|
119
117
|
removeParentsIfNoChildren: true,
|
|
@@ -61,7 +61,7 @@ var FilterItem = (0, _react.observer)(function (props) {
|
|
|
61
61
|
},
|
|
62
62
|
placeholder: t('Comparision')
|
|
63
63
|
}), !(operator === null || operator === void 0 ? void 0 : operator.noValue) && /*#__PURE__*/_react2.default.createElement(_DynamicComponent.DynamicComponent, {
|
|
64
|
-
value: value,
|
|
64
|
+
value: value ? value : undefined,
|
|
65
65
|
schema: schema,
|
|
66
66
|
onChange: function onChange(value) {
|
|
67
67
|
setValue(value);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ISchema } from '@formily/react';
|
|
2
|
-
import { CollectionFieldOptions } from '../../../collection-manager';
|
|
2
|
+
import { Collection, CollectionFieldOptions } from '../../../collection-manager';
|
|
3
3
|
export declare const FormItem: any;
|
|
4
|
+
export declare function isFileCollection(collection: Collection): boolean;
|
|
4
5
|
export declare function getFieldDefaultValue(fieldSchema: ISchema, collectionField: CollectionFieldOptions): any;
|