@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
|
@@ -11,6 +11,7 @@ var _antd = require("antd");
|
|
|
11
11
|
var _moment = _interopRequireDefault(require("moment"));
|
|
12
12
|
var _react2 = _interopRequireDefault(require("react"));
|
|
13
13
|
var _reactI18next = require("react-i18next");
|
|
14
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
|
14
15
|
var _ = require("../..");
|
|
15
16
|
var _XButton = require("./XButton");
|
|
16
17
|
var _templateObject, _templateObject2, _templateObject3;
|
|
@@ -51,7 +52,7 @@ var ConstantTypes = {
|
|
|
51
52
|
string: {
|
|
52
53
|
label: "{{t(\"String\")}}",
|
|
53
54
|
value: 'string',
|
|
54
|
-
component: function
|
|
55
|
+
component: function StringComponent(_ref) {
|
|
55
56
|
var _onChange = _ref.onChange,
|
|
56
57
|
value = _ref.value;
|
|
57
58
|
return /*#__PURE__*/_react2.default.createElement(_antd.Input, {
|
|
@@ -66,7 +67,7 @@ var ConstantTypes = {
|
|
|
66
67
|
number: {
|
|
67
68
|
label: '{{t("Number")}}',
|
|
68
69
|
value: 'number',
|
|
69
|
-
component: function
|
|
70
|
+
component: function NumberComponent(_ref2) {
|
|
70
71
|
var onChange = _ref2.onChange,
|
|
71
72
|
value = _ref2.value;
|
|
72
73
|
return /*#__PURE__*/_react2.default.createElement(_antd.InputNumber, {
|
|
@@ -79,7 +80,7 @@ var ConstantTypes = {
|
|
|
79
80
|
boolean: {
|
|
80
81
|
label: "{{t(\"Boolean\")}}",
|
|
81
82
|
value: 'boolean',
|
|
82
|
-
component: function
|
|
83
|
+
component: function BooleanComponent(_ref3) {
|
|
83
84
|
var onChange = _ref3.onChange,
|
|
84
85
|
value = _ref3.value;
|
|
85
86
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
@@ -102,7 +103,7 @@ var ConstantTypes = {
|
|
|
102
103
|
date: {
|
|
103
104
|
label: '{{t("Date")}}',
|
|
104
105
|
value: 'date',
|
|
105
|
-
component: function
|
|
106
|
+
component: function DateComponent(_ref4) {
|
|
106
107
|
var _onChange2 = _ref4.onChange,
|
|
107
108
|
value = _ref4.value;
|
|
108
109
|
return /*#__PURE__*/_react2.default.createElement(_antd.DatePicker, {
|
|
@@ -122,7 +123,7 @@ var ConstantTypes = {
|
|
|
122
123
|
null: {
|
|
123
124
|
label: "{{t(\"Null\")}}",
|
|
124
125
|
value: 'null',
|
|
125
|
-
component: function
|
|
126
|
+
component: function NullComponent() {
|
|
126
127
|
var _useTranslation2 = (0, _reactI18next.useTranslation)(),
|
|
127
128
|
t = _useTranslation2.t;
|
|
128
129
|
return /*#__PURE__*/_react2.default.createElement(_antd.Input, {
|
|
@@ -154,12 +155,13 @@ function Input(props) {
|
|
|
154
155
|
children = props.children,
|
|
155
156
|
button = props.button,
|
|
156
157
|
useTypedConstant = props.useTypedConstant,
|
|
157
|
-
style = props.style
|
|
158
|
+
style = props.style,
|
|
159
|
+
className = props.className;
|
|
158
160
|
var parsed = parseValue(value);
|
|
159
161
|
var isConstant = typeof parsed === 'string';
|
|
160
162
|
var type = isConstant ? parsed : '';
|
|
161
163
|
var variable = isConstant ? null : parsed;
|
|
162
|
-
var
|
|
164
|
+
var variableOptions = typeof scope === 'function' ? scope() : scope !== null && scope !== void 0 ? scope : [];
|
|
163
165
|
var _ref5 = children ? {
|
|
164
166
|
value: '',
|
|
165
167
|
label: '{{t("Constant")}}'
|
|
@@ -170,7 +172,7 @@ function Input(props) {
|
|
|
170
172
|
},
|
|
171
173
|
ConstantComponent = _ref5.component,
|
|
172
174
|
constantOption = _objectWithoutProperties(_ref5, _excluded);
|
|
173
|
-
var options = compile([constantOption].concat(_toConsumableArray(
|
|
175
|
+
var options = compile([constantOption].concat(_toConsumableArray(variableOptions)));
|
|
174
176
|
function onSwitch(next) {
|
|
175
177
|
if (next[0] === '') {
|
|
176
178
|
if (next[1]) {
|
|
@@ -200,13 +202,9 @@ function Input(props) {
|
|
|
200
202
|
return /*#__PURE__*/_react2.default.createElement(_antd.Input.Group, {
|
|
201
203
|
compact: true,
|
|
202
204
|
style: style,
|
|
203
|
-
className: (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n
|
|
204
|
-
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
205
|
-
style: {
|
|
206
|
-
flex: 1
|
|
207
|
-
}
|
|
205
|
+
className: (0, _classnames.default)(className, (0, _css.css)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: auto;\n display: flex !important;\n .ant-input-disabled {\n .ant-tag {\n color: #bfbfbf;\n border-color: #d9d9d9;\n }\n }\n .ant-input.null-value {\n width: 4em;\n min-width: 4em;\n }\n "]))))
|
|
208
206
|
}, variable ? /*#__PURE__*/_react2.default.createElement("div", {
|
|
209
|
-
className: (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n
|
|
207
|
+
className: (0, _css.css)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n line-height: 0;\n\n &:hover {\n .ant-select-clear {\n opacity: 0.8;\n }\n }\n\n .ant-input {\n overflow: auto;\n white-space: nowrap;\n ", "\n\n .ant-tag {\n display: inline;\n line-height: 19px;\n margin: 0;\n padding: 2px 7px;\n border-radius: 10px;\n }\n }\n "])), disabled ? '' : 'padding-right: 28px;')
|
|
210
208
|
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
211
209
|
onInput: function onInput(e) {
|
|
212
210
|
return e.preventDefault();
|
|
@@ -227,7 +225,8 @@ function Input(props) {
|
|
|
227
225
|
contentEditable: false,
|
|
228
226
|
color: "blue"
|
|
229
227
|
}, variableText)), !disabled ? /*#__PURE__*/_react2.default.createElement("span", {
|
|
230
|
-
className: (0, _css.cx)('ant-select-clear', (0, _css.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n
|
|
228
|
+
className: (0, _css.cx)('ant-select-clear', (0, _css.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n user-select: 'none';\n "])))),
|
|
229
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
231
230
|
unselectable: "on",
|
|
232
231
|
"aria-hidden": true,
|
|
233
232
|
onClick: function onClick() {
|
|
@@ -236,7 +235,7 @@ function Input(props) {
|
|
|
236
235
|
}, /*#__PURE__*/_react2.default.createElement(_icons.CloseCircleFilled, null)) : null) : children !== null && children !== void 0 ? children : /*#__PURE__*/_react2.default.createElement(ConstantComponent, {
|
|
237
236
|
value: value,
|
|
238
237
|
onChange: onChange
|
|
239
|
-
})
|
|
238
|
+
}), options.length > 1 ? /*#__PURE__*/_react2.default.createElement(_antd.Cascader, {
|
|
240
239
|
options: options,
|
|
241
240
|
value: variable !== null && variable !== void 0 ? variable : [''].concat(_toConsumableArray(children || !((_constantOption$child = constantOption.children) === null || _constantOption$child === void 0 ? void 0 : _constantOption$child.length) ? [] : [type])),
|
|
242
241
|
onChange: onSwitch,
|
|
@@ -9,7 +9,6 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _antd = require("antd");
|
|
10
10
|
var _react2 = require("@formily/react");
|
|
11
11
|
var _css = require("@emotion/css");
|
|
12
|
-
var _reactI18next = require("react-i18next");
|
|
13
12
|
var sanitizeHTML = _interopRequireWildcard(require("sanitize-html"));
|
|
14
13
|
var _2 = require("../..");
|
|
15
14
|
var _VariableSelect = require("./VariableSelect");
|
|
@@ -224,8 +223,6 @@ function TextArea(props) {
|
|
|
224
223
|
_props$multiline = props.multiline,
|
|
225
224
|
multiline = _props$multiline === void 0 ? true : _props$multiline;
|
|
226
225
|
var compile = (0, _2.useCompile)();
|
|
227
|
-
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
228
|
-
t = _useTranslation.t;
|
|
229
226
|
var inputRef = (0, _react.useRef)(null);
|
|
230
227
|
var options = compile((_ref2 = typeof scope === 'function' ? scope() : scope) !== null && _ref2 !== void 0 ? _ref2 : []);
|
|
231
228
|
var form = (0, _react2.useForm)();
|
|
@@ -343,7 +340,7 @@ function TextArea(props) {
|
|
|
343
340
|
if (ev.key === 'Enter') {
|
|
344
341
|
ev.preventDefault();
|
|
345
342
|
}
|
|
346
|
-
setIME(ev.keyCode === 229);
|
|
343
|
+
setIME(ev.keyCode === 229 && ![' ', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'Enter'].includes(ev.key));
|
|
347
344
|
// if (ev.key === 'Control') {
|
|
348
345
|
// console.debug(getSelection().getRangeAt(0));
|
|
349
346
|
// }
|
|
@@ -401,7 +398,7 @@ function TextArea(props) {
|
|
|
401
398
|
onInsert: onInsert
|
|
402
399
|
}) : null);
|
|
403
400
|
}
|
|
404
|
-
TextArea.ReadPretty = function (props) {
|
|
401
|
+
TextArea.ReadPretty = function ReadPretty(props) {
|
|
405
402
|
var _ref5;
|
|
406
403
|
var value = props.value,
|
|
407
404
|
_props$multiline2 = props.multiline,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { IField } from '../../../collection-manager';
|
|
2
3
|
export declare function Variable(): any;
|
|
3
4
|
export declare namespace Variable {
|
|
4
5
|
var Input: import("react").ForwardRefExoticComponent<Pick<Partial<any>, string | number | symbol> & import("react").RefAttributes<unknown>>;
|
|
@@ -6,3 +7,4 @@ export declare namespace Variable {
|
|
|
6
7
|
var JSON: import("react").ForwardRefExoticComponent<Pick<Partial<any>, string | number | symbol> & import("react").RefAttributes<unknown>>;
|
|
7
8
|
}
|
|
8
9
|
export default Variable;
|
|
10
|
+
export declare function isInvariable(value: IField): boolean;
|
|
@@ -5,10 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Variable = Variable;
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
exports.isInvariable = isInvariable;
|
|
8
9
|
var _react = require("@formily/react");
|
|
9
10
|
var _Input = require("./Input");
|
|
10
|
-
var _TextArea = require("./TextArea");
|
|
11
11
|
var _JSONInput = require("./JSONInput");
|
|
12
|
+
var _TextArea = require("./TextArea");
|
|
12
13
|
function Variable() {
|
|
13
14
|
return null;
|
|
14
15
|
}
|
|
@@ -16,4 +17,7 @@ Variable.Input = (0, _react.connect)(_Input.Input);
|
|
|
16
17
|
Variable.TextArea = (0, _react.connect)(_TextArea.TextArea, (0, _react.mapReadPretty)(_TextArea.TextArea.ReadPretty));
|
|
17
18
|
Variable.JSON = (0, _react.connect)(_JSONInput.JSONInput);
|
|
18
19
|
var _default = Variable;
|
|
19
|
-
exports.default = _default;
|
|
20
|
+
exports.default = _default;
|
|
21
|
+
function isInvariable(value) {
|
|
22
|
+
return !!(value === null || value === void 0 ? void 0 : value.invariable);
|
|
23
|
+
}
|
|
@@ -31,7 +31,7 @@ var useDragEnd = function useDragEnd(props) {
|
|
|
31
31
|
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
32
32
|
t = _useTranslation.t;
|
|
33
33
|
return function (event) {
|
|
34
|
-
var _active$data, _active$data$current, _over$data, _over$data$current, _over$data2, _over$data2$current, _over$data3, _over$data3$current, _over$data4, _over$data4$current, _over$data5, _over$data5$current;
|
|
34
|
+
var _active$data, _active$data$current, _over$data, _over$data$current, _over$data2, _over$data2$current, _over$data3, _over$data3$current, _over$data4, _over$data4$current, _over$data5, _over$data5$current, _over$data$current$re;
|
|
35
35
|
var active = event.active,
|
|
36
36
|
over = event.over;
|
|
37
37
|
var activeSchema = active === null || active === void 0 ? void 0 : (_active$data = active.data) === null || _active$data === void 0 ? void 0 : (_active$data$current = _active$data.current) === null || _active$data$current === void 0 ? void 0 : _active$data$current.schema;
|
|
@@ -40,6 +40,7 @@ var useDragEnd = function useDragEnd(props) {
|
|
|
40
40
|
var breakRemoveOn = over === null || over === void 0 ? void 0 : (_over$data3 = over.data) === null || _over$data3 === void 0 ? void 0 : (_over$data3$current = _over$data3.current) === null || _over$data3$current === void 0 ? void 0 : _over$data3$current.breakRemoveOn;
|
|
41
41
|
var wrapSchema = over === null || over === void 0 ? void 0 : (_over$data4 = over.data) === null || _over$data4 === void 0 ? void 0 : (_over$data4$current = _over$data4.current) === null || _over$data4$current === void 0 ? void 0 : _over$data4$current.wrapSchema;
|
|
42
42
|
var onSuccess = over === null || over === void 0 ? void 0 : (_over$data5 = over.data) === null || _over$data5 === void 0 ? void 0 : (_over$data5$current = _over$data5.current) === null || _over$data5$current === void 0 ? void 0 : _over$data5$current.onSuccess;
|
|
43
|
+
var removeParentsIfNoChildren = (_over$data$current$re = over.data.current.removeParentsIfNoChildren) !== null && _over$data$current$re !== void 0 ? _over$data$current$re : true;
|
|
43
44
|
if (!activeSchema || !overSchema) {
|
|
44
45
|
var _props$onDragEnd;
|
|
45
46
|
props === null || props === void 0 ? void 0 : (_props$onDragEnd = props.onDragEnd) === null || _props$onDragEnd === void 0 ? void 0 : _props$onDragEnd.call(props, event);
|
|
@@ -68,7 +69,7 @@ var useDragEnd = function useDragEnd(props) {
|
|
|
68
69
|
dn.insertAdjacent(insertAdjacent, activeSchema, {
|
|
69
70
|
wrap: wrapSchema,
|
|
70
71
|
breakRemoveOn: breakRemoveOn,
|
|
71
|
-
removeParentsIfNoChildren:
|
|
72
|
+
removeParentsIfNoChildren: removeParentsIfNoChildren,
|
|
72
73
|
onSuccess: onSuccess
|
|
73
74
|
});
|
|
74
75
|
props === null || props === void 0 ? void 0 : (_props$onDragEnd4 = props.onDragEnd) === null || _props$onDragEnd4 === void 0 ? void 0 : _props$onDragEnd4.call(props, event);
|
|
@@ -84,15 +84,18 @@ var useSortableItemId = function useSortableItemId(props) {
|
|
|
84
84
|
return field.address.toString();
|
|
85
85
|
};
|
|
86
86
|
var SortableItem = (0, _react.observer)(function (props) {
|
|
87
|
+
var _others$removeParents;
|
|
87
88
|
var _useSortableItemProps = useSortableItemProps(props),
|
|
88
89
|
schema = _useSortableItemProps.schema,
|
|
89
90
|
id = _useSortableItemProps.id,
|
|
90
91
|
others = _objectWithoutProperties(_useSortableItemProps, _excluded2);
|
|
92
|
+
var removeParentsIfNoChildren = (_others$removeParents = others.removeParentsIfNoChildren) !== null && _others$removeParents !== void 0 ? _others$removeParents : true;
|
|
91
93
|
return /*#__PURE__*/_react2.default.createElement(SortableProvider, {
|
|
92
94
|
id: id,
|
|
93
95
|
data: {
|
|
94
96
|
insertAdjacent: 'afterEnd',
|
|
95
|
-
schema: schema
|
|
97
|
+
schema: schema,
|
|
98
|
+
removeParentsIfNoChildren: removeParentsIfNoChildren
|
|
96
99
|
}
|
|
97
100
|
}, /*#__PURE__*/_react2.default.createElement(Sortable, _objectSpread({}, others), props.children));
|
|
98
101
|
});
|
|
@@ -74,7 +74,7 @@ var getValue = function getValue(str, values) {
|
|
|
74
74
|
var regex = /{{(.*?)}}/;
|
|
75
75
|
var matches = str === null || str === void 0 ? void 0 : (_str$match3 = str.match) === null || _str$match3 === void 0 ? void 0 : _str$match3.call(str, regex);
|
|
76
76
|
if (matches) {
|
|
77
|
-
return getVariableValue(str, values);
|
|
77
|
+
return getVariableValue(str, (0, _flat2.default)(values));
|
|
78
78
|
} else {
|
|
79
79
|
return str;
|
|
80
80
|
}
|
|
@@ -123,4 +123,15 @@ Object.keys(_useTableSize).forEach(function (key) {
|
|
|
123
123
|
return _useTableSize[key];
|
|
124
124
|
}
|
|
125
125
|
});
|
|
126
|
+
});
|
|
127
|
+
var _useFieldModeOptions = require("./useFieldModeOptions");
|
|
128
|
+
Object.keys(_useFieldModeOptions).forEach(function (key) {
|
|
129
|
+
if (key === "default" || key === "__esModule") return;
|
|
130
|
+
if (key in exports && exports[key] === _useFieldModeOptions[key]) return;
|
|
131
|
+
Object.defineProperty(exports, key, {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function get() {
|
|
134
|
+
return _useFieldModeOptions[key];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
126
137
|
});
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useFieldModeOptions = void 0;
|
|
7
|
+
var _react = require("@formily/react");
|
|
8
|
+
var _react2 = require("react");
|
|
9
|
+
var _reactI18next = require("react-i18next");
|
|
10
|
+
var _collectionManager = require("../../collection-manager");
|
|
11
|
+
var useFieldModeOptions = function useFieldModeOptions() {
|
|
12
|
+
var _fieldSchema$xCompon;
|
|
13
|
+
var _useCollectionManager = (0, _collectionManager.useCollectionManager)(),
|
|
14
|
+
getCollectionJoinField = _useCollectionManager.getCollectionJoinField,
|
|
15
|
+
getCollection = _useCollectionManager.getCollection;
|
|
16
|
+
var fieldSchema = (0, _react.useFieldSchema)();
|
|
17
|
+
var field = (0, _react.useField)();
|
|
18
|
+
var isReadPretty = field.readPretty;
|
|
19
|
+
var _useCollection = (0, _collectionManager.useCollection)(),
|
|
20
|
+
getField = _useCollection.getField;
|
|
21
|
+
var collectionField = getField(fieldSchema['name']) || getCollectionJoinField(fieldSchema['x-collection-field']);
|
|
22
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
23
|
+
t = _useTranslation.t;
|
|
24
|
+
var _ref = ((_fieldSchema$xCompon = fieldSchema['x-component-props']) === null || _fieldSchema$xCompon === void 0 ? void 0 : _fieldSchema$xCompon.fieldNames) || {},
|
|
25
|
+
label = _ref.label;
|
|
26
|
+
var fieldModeOptions = (0, _react2.useMemo)(function () {
|
|
27
|
+
if (!collectionField || !(collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface)) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!['o2o', 'oho', 'obo', 'o2m', 'linkTo', 'm2o', 'm2m'].includes(collectionField.interface)) return;
|
|
31
|
+
var collection = getCollection(collectionField.target);
|
|
32
|
+
if ((collection === null || collection === void 0 ? void 0 : collection.template) === 'file') {
|
|
33
|
+
return isReadPretty ? [{
|
|
34
|
+
label: t('Title'),
|
|
35
|
+
value: 'Select'
|
|
36
|
+
}, {
|
|
37
|
+
label: t('File manager'),
|
|
38
|
+
value: 'FileManager'
|
|
39
|
+
}] : [{
|
|
40
|
+
label: t('File manager'),
|
|
41
|
+
value: 'FileManager'
|
|
42
|
+
}, {
|
|
43
|
+
label: t('Record picker'),
|
|
44
|
+
value: 'Picker'
|
|
45
|
+
}, {
|
|
46
|
+
label: t('Select'),
|
|
47
|
+
value: 'Select'
|
|
48
|
+
}];
|
|
49
|
+
}
|
|
50
|
+
switch (collectionField.interface) {
|
|
51
|
+
case 'o2m':
|
|
52
|
+
return isReadPretty ? [{
|
|
53
|
+
label: t('Title'),
|
|
54
|
+
value: 'Select'
|
|
55
|
+
},
|
|
56
|
+
// { label: t('Subtable'), value: 'SubTable' },
|
|
57
|
+
{
|
|
58
|
+
label: t('Sub-details'),
|
|
59
|
+
value: 'Nester'
|
|
60
|
+
}] : [{
|
|
61
|
+
label: t('Record picker'),
|
|
62
|
+
value: 'Picker'
|
|
63
|
+
},
|
|
64
|
+
// { label: t('Subtable'), value: 'SubTable' },
|
|
65
|
+
{
|
|
66
|
+
label: t('Select'),
|
|
67
|
+
value: 'Select'
|
|
68
|
+
}, {
|
|
69
|
+
label: t('Subform'),
|
|
70
|
+
value: 'Nester'
|
|
71
|
+
}];
|
|
72
|
+
case 'm2o':
|
|
73
|
+
case 'm2m':
|
|
74
|
+
case 'linkTo':
|
|
75
|
+
return isReadPretty ? [{
|
|
76
|
+
label: t('Title'),
|
|
77
|
+
value: 'Select'
|
|
78
|
+
}, {
|
|
79
|
+
label: t('Sub-details'),
|
|
80
|
+
value: 'Nester'
|
|
81
|
+
}] : [{
|
|
82
|
+
label: t('Record picker'),
|
|
83
|
+
value: 'Picker'
|
|
84
|
+
}, {
|
|
85
|
+
label: t('Select'),
|
|
86
|
+
value: 'Select'
|
|
87
|
+
}, {
|
|
88
|
+
label: t('Subform'),
|
|
89
|
+
value: 'Nester'
|
|
90
|
+
}];
|
|
91
|
+
default:
|
|
92
|
+
return isReadPretty ? [{
|
|
93
|
+
label: t('Title'),
|
|
94
|
+
value: 'Select'
|
|
95
|
+
}, {
|
|
96
|
+
label: t('Sub-details'),
|
|
97
|
+
value: 'Nester'
|
|
98
|
+
}] : [{
|
|
99
|
+
label: t('Record picker'),
|
|
100
|
+
value: 'Picker'
|
|
101
|
+
}, {
|
|
102
|
+
label: t('Select'),
|
|
103
|
+
value: 'Select'
|
|
104
|
+
}, {
|
|
105
|
+
label: t('Subform'),
|
|
106
|
+
value: 'Nester'
|
|
107
|
+
}];
|
|
108
|
+
}
|
|
109
|
+
}, [t, collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface, label]);
|
|
110
|
+
return fieldModeOptions;
|
|
111
|
+
};
|
|
112
|
+
exports.useFieldModeOptions = useFieldModeOptions;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const actionDesignerCss: string;
|
|
3
|
-
export declare const CreateRecordAction: React.MemoExoticComponent<React.FunctionComponent<
|
|
3
|
+
export declare const CreateRecordAction: React.MemoExoticComponent<React.FunctionComponent<Pick<any, string | number | symbol>>>;
|
|
@@ -117,6 +117,7 @@ var CreateRecordAction = (0, _react.observer)(function (props) {
|
|
|
117
117
|
var compile = (0, _schemaComponent.useCompile)();
|
|
118
118
|
var _useDesignable = (0, _.useDesignable)(),
|
|
119
119
|
designable = _useDesignable.designable;
|
|
120
|
+
var icon = props.icon || /*#__PURE__*/_react2.default.createElement(_icons.PlusOutlined, null);
|
|
120
121
|
var menu = /*#__PURE__*/_react2.default.createElement(_antd.Menu, null, inheritsCollections.map(function (option) {
|
|
121
122
|
return /*#__PURE__*/_react2.default.createElement(_antd.Menu.Item, {
|
|
122
123
|
key: option.name,
|
|
@@ -160,16 +161,16 @@ var CreateRecordAction = (0, _react.observer)(function (props) {
|
|
|
160
161
|
setVisible(true);
|
|
161
162
|
setCurrentCollection(collection.name);
|
|
162
163
|
}
|
|
163
|
-
},
|
|
164
|
+
}, icon, props.children) : /*#__PURE__*/_react2.default.createElement(_antd.Dropdown, {
|
|
164
165
|
overlay: menu
|
|
165
166
|
}, /*#__PURE__*/_react2.default.createElement(_antd.Button, {
|
|
166
|
-
icon:
|
|
167
|
+
icon: icon,
|
|
167
168
|
type: 'primary'
|
|
168
169
|
}, props.children, " ", /*#__PURE__*/_react2.default.createElement(_icons.DownOutlined, null))) : /*#__PURE__*/_react2.default.createElement(_antd.Button, {
|
|
169
170
|
type: componentType,
|
|
170
171
|
disabled: field.disabled,
|
|
171
172
|
danger: componentType === 'danger',
|
|
172
|
-
icon:
|
|
173
|
+
icon: icon,
|
|
173
174
|
onClick: function onClick(info) {
|
|
174
175
|
setVisible(true);
|
|
175
176
|
setCurrentCollection(collection.name);
|
|
@@ -3,33 +3,30 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ExpandActionInitializer =
|
|
6
|
+
exports.ExpandActionInitializer = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _antd = require("antd");
|
|
9
|
-
var _css = require("@emotion/css");
|
|
10
|
-
var _reactI18next = require("react-i18next");
|
|
11
|
-
var _react2 = require("@formily/react");
|
|
12
8
|
var _ActionInitializer = require("./ActionInitializer");
|
|
13
|
-
var
|
|
14
|
-
var _icons = require("@ant-design/icons");
|
|
15
|
-
var _templateObject;
|
|
9
|
+
var _reactI18next = require("react-i18next");
|
|
16
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
11
|
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); }
|
|
18
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
12
|
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; }
|
|
20
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; }
|
|
21
14
|
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; }
|
|
22
15
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
23
16
|
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); }
|
|
24
17
|
var ExpandActionInitializer = function ExpandActionInitializer(props) {
|
|
18
|
+
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
19
|
+
t = _useTranslation.t;
|
|
25
20
|
var schema = {
|
|
26
21
|
'x-action': 'expandAll',
|
|
27
22
|
'x-component': 'Action',
|
|
28
|
-
'x-designer': 'Action.
|
|
23
|
+
'x-designer': 'Expand.Action.Design',
|
|
29
24
|
'x-component-props': {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
titleExpand: t("Expand all"),
|
|
26
|
+
titleCollapse: t("Collapse all"),
|
|
27
|
+
iconExpand: 'nodeexpandoutlined',
|
|
28
|
+
iconCollapse: 'nodecollapseoutlined',
|
|
29
|
+
component: 'Expand.Action',
|
|
33
30
|
useAction: function useAction() {
|
|
34
31
|
return {
|
|
35
32
|
run: function run() {}
|
|
@@ -41,27 +38,4 @@ var ExpandActionInitializer = function ExpandActionInitializer(props) {
|
|
|
41
38
|
schema: schema
|
|
42
39
|
}));
|
|
43
40
|
};
|
|
44
|
-
exports.ExpandActionInitializer = ExpandActionInitializer;
|
|
45
|
-
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"])));
|
|
46
|
-
var ExpandActionComponent = function ExpandActionComponent(props) {
|
|
47
|
-
var _schema$parent, _schema$parent$parent;
|
|
48
|
-
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
49
|
-
t = _useTranslation.t;
|
|
50
|
-
var schema = (0, _react2.useFieldSchema)();
|
|
51
|
-
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';
|
|
52
|
-
var ctx = isTableSelector ? (0, _.useTableSelectorContext)() : (0, _.useTableBlockContext)();
|
|
53
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
54
|
-
className: actionDesignerCss
|
|
55
|
-
}, ctx.params['tree'] && /*#__PURE__*/_react.default.createElement(_antd.Button, {
|
|
56
|
-
onClick: function onClick() {
|
|
57
|
-
ctx === null || ctx === void 0 ? void 0 : ctx.setExpandFlag();
|
|
58
|
-
},
|
|
59
|
-
icon: (ctx === null || ctx === void 0 ? void 0 : ctx.expandFlag) ? /*#__PURE__*/_react.default.createElement(_icons.NodeCollapseOutlined, null) : /*#__PURE__*/_react.default.createElement(_icons.NodeExpandOutlined, null),
|
|
60
|
-
type: props.type
|
|
61
|
-
}, props.children[1], /*#__PURE__*/_react.default.createElement("span", {
|
|
62
|
-
style: {
|
|
63
|
-
marginLeft: 10
|
|
64
|
-
}
|
|
65
|
-
}, (ctx === null || ctx === void 0 ? void 0 : ctx.expandFlag) ? t('Collapse all') : t('Expand all'))));
|
|
66
|
-
};
|
|
67
|
-
exports.ExpandActionComponent = ExpandActionComponent;
|
|
41
|
+
exports.ExpandActionInitializer = ExpandActionInitializer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SelectActionInitializer: (props: any) => JSX.Element;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SelectActionInitializer = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _ActionInitializer = require("./ActionInitializer");
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
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); }
|
|
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; }
|
|
12
|
+
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; }
|
|
13
|
+
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; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
+
var SelectActionInitializer = function SelectActionInitializer(props) {
|
|
17
|
+
var schema = {
|
|
18
|
+
type: 'void',
|
|
19
|
+
title: '{{ t("Select") }}',
|
|
20
|
+
'x-action': 'update',
|
|
21
|
+
'x-designer': 'Action.Designer',
|
|
22
|
+
'x-component': 'Action',
|
|
23
|
+
'x-component-props': {
|
|
24
|
+
openMode: 'drawer'
|
|
25
|
+
},
|
|
26
|
+
properties: {
|
|
27
|
+
drawer: {
|
|
28
|
+
type: 'void',
|
|
29
|
+
'x-component': 'AssociationField.Selector',
|
|
30
|
+
title: '{{ t("Select record") }}',
|
|
31
|
+
'x-component-props': {
|
|
32
|
+
className: 'nb-record-picker-selector'
|
|
33
|
+
},
|
|
34
|
+
properties: {
|
|
35
|
+
grid: {
|
|
36
|
+
type: 'void',
|
|
37
|
+
'x-component': 'Grid',
|
|
38
|
+
'x-initializer': 'TableSelectorInitializers',
|
|
39
|
+
properties: {}
|
|
40
|
+
},
|
|
41
|
+
footer: {
|
|
42
|
+
'x-component': 'Action.Container.Footer',
|
|
43
|
+
'x-component-props': {},
|
|
44
|
+
properties: {
|
|
45
|
+
actions: {
|
|
46
|
+
type: 'void',
|
|
47
|
+
'x-component': 'ActionBar',
|
|
48
|
+
'x-component-props': {},
|
|
49
|
+
properties: {
|
|
50
|
+
submit: {
|
|
51
|
+
title: '{{ t("Submit") }}',
|
|
52
|
+
'x-action': 'submit',
|
|
53
|
+
'x-component': 'Action',
|
|
54
|
+
'x-designer': 'Action.Designer',
|
|
55
|
+
'x-component-props': {
|
|
56
|
+
type: 'primary',
|
|
57
|
+
htmlType: 'submit',
|
|
58
|
+
useProps: '{{ usePickActionProps }}'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
return /*#__PURE__*/_react.default.createElement(_ActionInitializer.ActionInitializer, _objectSpread(_objectSpread({}, props), {}, {
|
|
70
|
+
schema: schema
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
exports.SelectActionInitializer = SelectActionInitializer;
|
|
@@ -552,4 +552,15 @@ Object.keys(_ViewActionInitializer).forEach(function (key) {
|
|
|
552
552
|
return _ViewActionInitializer[key];
|
|
553
553
|
}
|
|
554
554
|
});
|
|
555
|
+
});
|
|
556
|
+
var _SelectActionInitializer = require("./SelectActionInitializer");
|
|
557
|
+
Object.keys(_SelectActionInitializer).forEach(function (key) {
|
|
558
|
+
if (key === "default" || key === "__esModule") return;
|
|
559
|
+
if (key in exports && exports[key] === _SelectActionInitializer[key]) return;
|
|
560
|
+
Object.defineProperty(exports, key, {
|
|
561
|
+
enumerable: true,
|
|
562
|
+
get: function get() {
|
|
563
|
+
return _SelectActionInitializer[key];
|
|
564
|
+
}
|
|
565
|
+
});
|
|
555
566
|
});
|