@nocobase/client 0.7.1-alpha.7 → 0.7.2-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/acl/Configuration/schemas/scopes.js +1 -0
- package/es/application/Application.js +0 -4
- package/es/block-provider/BlockSchemaComponentProvider.js +3 -0
- package/es/block-provider/FormBlockProvider.js +2 -1
- package/es/block-provider/FormFieldProvider.d.ts +8 -0
- package/es/block-provider/FormFieldProvider.js +89 -0
- package/es/block-provider/KanbanBlockProvider.js +117 -3
- package/es/block-provider/TableFieldProvider.js +17 -2
- package/es/block-provider/TableSelectorProvider.js +38 -6
- package/es/block-provider/hooks/index.js +10 -3
- package/es/block-provider/index.d.ts +1 -0
- package/es/block-provider/index.js +2 -1
- package/es/collection-manager/CollectionField.js +5 -1
- package/es/collection-manager/CollectionFieldProvider.js +7 -2
- package/es/collection-manager/Configuration/AddFieldAction.js +1 -1
- package/es/collection-manager/Configuration/EditFieldAction.js +1 -1
- package/es/collection-manager/hooks/useCollectionManager.js +20 -5
- package/es/collection-manager/interfaces/index.d.ts +2 -1
- package/es/collection-manager/interfaces/index.js +3 -2
- package/es/collection-manager/interfaces/integer.d.ts +2 -0
- package/es/{workflow/nodes/update.js → collection-manager/interfaces/integer.js} +24 -20
- package/es/collection-manager/interfaces/linkTo.js +14 -6
- package/es/collection-manager/interfaces/m2m.js +12 -5
- package/es/collection-manager/interfaces/m2o.js +59 -8
- package/es/collection-manager/interfaces/o2m.js +72 -46
- package/es/collection-manager/interfaces/o2o.js +100 -39
- package/es/collection-manager/interfaces/properties/operators.d.ts +13 -0
- package/es/collection-manager/interfaces/properties/operators.js +7 -0
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -2
- package/es/locale/en_US.d.ts +7 -0
- package/es/locale/en_US.js +9 -2
- package/es/locale/zh_CN.d.ts +10 -1
- package/es/locale/zh_CN.js +10 -1
- package/es/schema-component/antd/AntdSchemaComponentProvider.js +2 -0
- package/es/schema-component/antd/filter/DynamicComponent.js +50 -3
- package/es/schema-component/antd/filter/FilterItem.js +6 -0
- package/es/schema-component/antd/filter/useFilterActionProps.js +2 -0
- package/es/schema-component/antd/form-item/FormItem.js +79 -16
- package/es/schema-component/antd/form-v2/FormField.d.ts +1 -0
- package/es/schema-component/antd/form-v2/FormField.js +29 -0
- package/es/schema-component/antd/form-v2/index.d.ts +1 -0
- package/es/schema-component/antd/form-v2/index.js +2 -1
- package/es/schema-component/antd/g2plot/G2Plot.js +33 -3
- package/es/schema-component/antd/g2plot/requestChartData.d.ts +4 -0
- package/es/schema-component/antd/g2plot/requestChartData.js +33 -0
- package/es/schema-component/antd/kanban/Kanban.Card.Designer.js +10 -1
- package/es/schema-component/antd/record-picker/InputRecordPicker.js +34 -14
- package/es/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +34 -11
- package/es/schema-component/antd/record-picker/useFieldNames.js +2 -2
- package/es/schema-component/antd/select/shared.js +4 -2
- package/es/schema-component/antd/table-v2/Table.Column.Decorator.d.ts +1 -1
- package/es/schema-component/antd/table-v2/Table.Column.Decorator.js +7 -3
- package/es/schema-component/antd/table-v2/Table.Column.Designer.js +7 -2
- package/es/schema-component/antd/table-v2/Table.js +4 -2
- package/es/schema-component/antd/table-v2/TableField.js +7 -0
- package/es/schema-initializer/buttons/TableColumnInitializers.js +26 -12
- package/es/schema-initializer/components/assigned-field/AssignedField.js +34 -47
- package/es/schema-initializer/utils.d.ts +2 -0
- package/es/schema-initializer/utils.js +160 -30
- package/es/schema-settings/SchemaSettings.js +6 -3
- package/lib/acl/Configuration/schemas/scopes.js +1 -0
- package/lib/application/Application.js +0 -5
- package/lib/block-provider/BlockSchemaComponentProvider.js +4 -0
- package/lib/block-provider/FormBlockProvider.js +2 -1
- package/lib/block-provider/FormFieldProvider.d.ts +8 -0
- package/lib/block-provider/FormFieldProvider.js +120 -0
- package/lib/block-provider/KanbanBlockProvider.js +118 -1
- package/lib/block-provider/TableFieldProvider.js +19 -2
- package/lib/block-provider/TableSelectorProvider.js +39 -5
- package/lib/block-provider/hooks/index.js +11 -3
- package/lib/block-provider/index.d.ts +1 -0
- package/lib/block-provider/index.js +13 -0
- package/lib/collection-manager/CollectionField.js +5 -1
- package/lib/collection-manager/CollectionFieldProvider.js +9 -3
- package/lib/collection-manager/Configuration/AddFieldAction.js +1 -1
- package/lib/collection-manager/Configuration/EditFieldAction.js +1 -1
- package/lib/collection-manager/hooks/useCollectionManager.js +20 -5
- package/lib/collection-manager/interfaces/index.d.ts +2 -1
- package/lib/collection-manager/interfaces/index.js +26 -13
- package/lib/collection-manager/interfaces/integer.d.ts +2 -0
- package/lib/{workflow/nodes/update.js → collection-manager/interfaces/integer.js} +26 -24
- package/lib/collection-manager/interfaces/linkTo.js +14 -6
- package/lib/collection-manager/interfaces/m2m.js +12 -5
- package/lib/collection-manager/interfaces/m2o.js +61 -10
- package/lib/collection-manager/interfaces/o2m.js +72 -45
- package/lib/collection-manager/interfaces/o2o.js +103 -43
- package/lib/collection-manager/interfaces/properties/operators.d.ts +13 -0
- package/lib/collection-manager/interfaces/properties/operators.js +7 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -13
- package/lib/locale/en_US.d.ts +7 -0
- package/lib/locale/en_US.js +9 -2
- package/lib/locale/zh_CN.d.ts +10 -1
- package/lib/locale/zh_CN.js +10 -1
- package/lib/schema-component/antd/AntdSchemaComponentProvider.js +3 -0
- package/lib/schema-component/antd/filter/DynamicComponent.js +52 -1
- package/lib/schema-component/antd/filter/FilterItem.js +7 -0
- package/lib/schema-component/antd/filter/useFilterActionProps.js +2 -0
- package/lib/schema-component/antd/form-item/FormItem.js +80 -17
- package/lib/schema-component/antd/form-v2/FormField.d.ts +1 -0
- package/lib/schema-component/antd/form-v2/FormField.js +48 -0
- package/lib/schema-component/antd/form-v2/index.d.ts +1 -0
- package/lib/schema-component/antd/form-v2/index.js +17 -0
- package/lib/schema-component/antd/g2plot/G2Plot.js +32 -2
- package/lib/schema-component/antd/g2plot/requestChartData.d.ts +4 -0
- package/lib/schema-component/antd/g2plot/requestChartData.js +42 -0
- package/lib/schema-component/antd/kanban/Kanban.Card.Designer.js +9 -0
- package/lib/schema-component/antd/record-picker/InputRecordPicker.js +33 -13
- package/lib/schema-component/antd/record-picker/ReadPrettyRecordPicker.js +32 -9
- package/lib/schema-component/antd/record-picker/useFieldNames.js +2 -2
- package/lib/schema-component/antd/select/shared.js +4 -2
- package/lib/schema-component/antd/table-v2/Table.Column.Decorator.d.ts +1 -1
- package/lib/schema-component/antd/table-v2/Table.Column.Decorator.js +6 -2
- package/lib/schema-component/antd/table-v2/Table.Column.Designer.js +7 -2
- package/lib/schema-component/antd/table-v2/Table.js +4 -2
- package/lib/schema-component/antd/table-v2/TableField.js +8 -0
- package/lib/schema-initializer/buttons/TableColumnInitializers.js +25 -11
- package/lib/schema-initializer/components/assigned-field/AssignedField.js +29 -43
- package/lib/schema-initializer/utils.d.ts +2 -0
- package/lib/schema-initializer/utils.js +166 -30
- package/lib/schema-settings/SchemaSettings.js +5 -2
- package/package.json +4 -5
- package/es/workflow/ExecutionResourceProvider.d.ts +0 -4
- package/es/workflow/ExecutionResourceProvider.js +0 -35
- package/es/workflow/WorkflowCanvas.d.ts +0 -15
- package/es/workflow/WorkflowCanvas.js +0 -375
- package/es/workflow/WorkflowLink.d.ts +0 -1
- package/es/workflow/WorkflowLink.js +0 -21
- package/es/workflow/WorkflowPage.d.ts +0 -1
- package/es/workflow/WorkflowPage.js +0 -43
- package/es/workflow/WorkflowRouteProvider.d.ts +0 -1
- package/es/workflow/WorkflowRouteProvider.js +0 -30
- package/es/workflow/WorkflowShortcut.d.ts +0 -1
- package/es/workflow/WorkflowShortcut.js +0 -62
- package/es/workflow/calculators.d.ts +0 -101
- package/es/workflow/calculators.js +0 -647
- package/es/workflow/components/Duration.d.ts +0 -5
- package/es/workflow/components/Duration.js +0 -61
- package/es/workflow/index.d.ts +0 -5
- package/es/workflow/index.js +0 -5
- package/es/workflow/nodes/calculation.d.ts +0 -25
- package/es/workflow/nodes/calculation.js +0 -47
- package/es/workflow/nodes/condition.d.ts +0 -46
- package/es/workflow/nodes/condition.js +0 -255
- package/es/workflow/nodes/create.d.ts +0 -46
- package/es/workflow/nodes/create.js +0 -90
- package/es/workflow/nodes/delay.d.ts +0 -35
- package/es/workflow/nodes/delay.js +0 -37
- package/es/workflow/nodes/destroy.d.ts +0 -55
- package/es/workflow/nodes/destroy.js +0 -27
- package/es/workflow/nodes/index.d.ts +0 -33
- package/es/workflow/nodes/index.js +0 -312
- package/es/workflow/nodes/parallel.d.ts +0 -24
- package/es/workflow/nodes/parallel.js +0 -132
- package/es/workflow/nodes/query.d.ts +0 -70
- package/es/workflow/nodes/query.js +0 -98
- package/es/workflow/nodes/update.d.ts +0 -60
- package/es/workflow/schemas/collection.d.ts +0 -42
- package/es/workflow/schemas/collection.js +0 -57
- package/es/workflow/schemas/executions.d.ts +0 -209
- package/es/workflow/schemas/executions.js +0 -157
- package/es/workflow/schemas/workflows.d.ts +0 -2
- package/es/workflow/schemas/workflows.js +0 -334
- package/es/workflow/style.d.ts +0 -12
- package/es/workflow/style.js +0 -17
- package/es/workflow/triggers/collection.d.ts +0 -77
- package/es/workflow/triggers/collection.js +0 -144
- package/es/workflow/triggers/index.d.ts +0 -26
- package/es/workflow/triggers/index.js +0 -177
- package/es/workflow/triggers/schedule/DateFieldsSelect.d.ts +0 -2
- package/es/workflow/triggers/schedule/DateFieldsSelect.js +0 -39
- package/es/workflow/triggers/schedule/EndsByField.d.ts +0 -5
- package/es/workflow/triggers/schedule/EndsByField.js +0 -57
- package/es/workflow/triggers/schedule/OnField.d.ts +0 -5
- package/es/workflow/triggers/schedule/OnField.js +0 -87
- package/es/workflow/triggers/schedule/RepeatField.d.ts +0 -5
- package/es/workflow/triggers/schedule/RepeatField.js +0 -131
- package/es/workflow/triggers/schedule/ScheduleConfig.d.ts +0 -1
- package/es/workflow/triggers/schedule/ScheduleConfig.js +0 -225
- package/es/workflow/triggers/schedule/index.d.ts +0 -25
- package/es/workflow/triggers/schedule/index.js +0 -77
- package/es/workflow/triggers/schedule/locale/Cron.zh-CN.d.ts +0 -34
- package/es/workflow/triggers/schedule/locale/Cron.zh-CN.js +0 -37
- package/lib/workflow/ExecutionResourceProvider.d.ts +0 -4
- package/lib/workflow/ExecutionResourceProvider.js +0 -48
- package/lib/workflow/WorkflowCanvas.d.ts +0 -15
- package/lib/workflow/WorkflowCanvas.js +0 -408
- package/lib/workflow/WorkflowLink.d.ts +0 -1
- package/lib/workflow/WorkflowLink.js +0 -36
- package/lib/workflow/WorkflowPage.d.ts +0 -1
- package/lib/workflow/WorkflowPage.js +0 -60
- package/lib/workflow/WorkflowRouteProvider.d.ts +0 -1
- package/lib/workflow/WorkflowRouteProvider.js +0 -47
- package/lib/workflow/WorkflowShortcut.d.ts +0 -1
- package/lib/workflow/WorkflowShortcut.js +0 -87
- package/lib/workflow/calculators.d.ts +0 -101
- package/lib/workflow/calculators.js +0 -688
- package/lib/workflow/components/Duration.d.ts +0 -5
- package/lib/workflow/components/Duration.js +0 -74
- package/lib/workflow/index.d.ts +0 -5
- package/lib/workflow/index.js +0 -70
- package/lib/workflow/nodes/calculation.d.ts +0 -25
- package/lib/workflow/nodes/calculation.js +0 -61
- package/lib/workflow/nodes/condition.d.ts +0 -46
- package/lib/workflow/nodes/condition.js +0 -275
- package/lib/workflow/nodes/create.d.ts +0 -46
- package/lib/workflow/nodes/create.js +0 -107
- package/lib/workflow/nodes/delay.d.ts +0 -35
- package/lib/workflow/nodes/delay.js +0 -48
- package/lib/workflow/nodes/destroy.d.ts +0 -55
- package/lib/workflow/nodes/destroy.js +0 -38
- package/lib/workflow/nodes/index.d.ts +0 -33
- package/lib/workflow/nodes/index.js +0 -357
- package/lib/workflow/nodes/parallel.d.ts +0 -24
- package/lib/workflow/nodes/parallel.js +0 -155
- package/lib/workflow/nodes/query.d.ts +0 -70
- package/lib/workflow/nodes/query.js +0 -115
- package/lib/workflow/nodes/update.d.ts +0 -60
- package/lib/workflow/schemas/collection.d.ts +0 -42
- package/lib/workflow/schemas/collection.js +0 -70
- package/lib/workflow/schemas/executions.d.ts +0 -209
- package/lib/workflow/schemas/executions.js +0 -164
- package/lib/workflow/schemas/workflows.d.ts +0 -2
- package/lib/workflow/schemas/workflows.js +0 -344
- package/lib/workflow/style.d.ts +0 -12
- package/lib/workflow/style.js +0 -37
- package/lib/workflow/triggers/collection.d.ts +0 -77
- package/lib/workflow/triggers/collection.js +0 -164
- package/lib/workflow/triggers/index.d.ts +0 -26
- package/lib/workflow/triggers/index.js +0 -201
- package/lib/workflow/triggers/schedule/DateFieldsSelect.d.ts +0 -2
- package/lib/workflow/triggers/schedule/DateFieldsSelect.js +0 -54
- package/lib/workflow/triggers/schedule/EndsByField.d.ts +0 -5
- package/lib/workflow/triggers/schedule/EndsByField.js +0 -73
- package/lib/workflow/triggers/schedule/OnField.d.ts +0 -5
- package/lib/workflow/triggers/schedule/OnField.js +0 -105
- package/lib/workflow/triggers/schedule/RepeatField.d.ts +0 -5
- package/lib/workflow/triggers/schedule/RepeatField.js +0 -146
- package/lib/workflow/triggers/schedule/ScheduleConfig.d.ts +0 -1
- package/lib/workflow/triggers/schedule/ScheduleConfig.js +0 -250
- package/lib/workflow/triggers/schedule/index.d.ts +0 -25
- package/lib/workflow/triggers/schedule/index.js +0 -94
- package/lib/workflow/triggers/schedule/locale/Cron.zh-CN.d.ts +0 -34
- package/lib/workflow/triggers/schedule/locale/Cron.zh-CN.js +0 -44
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
var _templateObject;
|
|
2
|
-
|
|
3
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
4
|
-
|
|
5
|
-
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); } }
|
|
6
|
-
|
|
7
|
-
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); }); }; }
|
|
8
|
-
|
|
9
|
-
import { css, cx } from "@emotion/css";
|
|
10
|
-
import { useForm } from "@formily/react";
|
|
11
|
-
import { Registry } from "@nocobase/utils/client";
|
|
12
|
-
import { message, Tag } from "antd";
|
|
13
|
-
import React from "react";
|
|
14
|
-
import { useTranslation } from "react-i18next";
|
|
15
|
-
import { SchemaComponent, useActionContext, useAPIClient, useCompile, useResourceActionContext } from '../../';
|
|
16
|
-
import { nodeCardClass, nodeMetaClass } from "../style";
|
|
17
|
-
import { useFlowContext } from "../WorkflowCanvas";
|
|
18
|
-
import collection from './collection';
|
|
19
|
-
import schedule from "./schedule/";
|
|
20
|
-
|
|
21
|
-
function useUpdateConfigAction() {
|
|
22
|
-
var _useTranslation = useTranslation(),
|
|
23
|
-
t = _useTranslation.t;
|
|
24
|
-
|
|
25
|
-
var form = useForm();
|
|
26
|
-
var api = useAPIClient();
|
|
27
|
-
|
|
28
|
-
var _useFlowContext = useFlowContext(),
|
|
29
|
-
workflow = _useFlowContext.workflow;
|
|
30
|
-
|
|
31
|
-
var ctx = useActionContext();
|
|
32
|
-
|
|
33
|
-
var _useResourceActionCon = useResourceActionContext(),
|
|
34
|
-
refresh = _useResourceActionCon.refresh;
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
run: function run() {
|
|
38
|
-
return _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
39
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
40
|
-
while (1) {
|
|
41
|
-
switch (_context.prev = _context.next) {
|
|
42
|
-
case 0:
|
|
43
|
-
if (!workflow.executed) {
|
|
44
|
-
_context.next = 3;
|
|
45
|
-
break;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
message.error(t('Trigger in executed workflow cannot be modified'));
|
|
49
|
-
return _context.abrupt("return");
|
|
50
|
-
|
|
51
|
-
case 3:
|
|
52
|
-
_context.next = 5;
|
|
53
|
-
return form.submit();
|
|
54
|
-
|
|
55
|
-
case 5:
|
|
56
|
-
_context.next = 7;
|
|
57
|
-
return api.resource('workflows').update({
|
|
58
|
-
filterByTk: workflow.id,
|
|
59
|
-
values: form.values
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
case 7:
|
|
63
|
-
ctx.setVisible(false);
|
|
64
|
-
refresh();
|
|
65
|
-
|
|
66
|
-
case 9:
|
|
67
|
-
case "end":
|
|
68
|
-
return _context.stop();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}, _callee);
|
|
72
|
-
}))();
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
;
|
|
78
|
-
;
|
|
79
|
-
export var triggers = new Registry();
|
|
80
|
-
triggers.register(collection.type, collection);
|
|
81
|
-
triggers.register(schedule.type, schedule);
|
|
82
|
-
export var TriggerConfig = function TriggerConfig() {
|
|
83
|
-
var _useTranslation2 = useTranslation(),
|
|
84
|
-
t = _useTranslation2.t;
|
|
85
|
-
|
|
86
|
-
var compile = useCompile();
|
|
87
|
-
|
|
88
|
-
var _useResourceActionCon2 = useResourceActionContext(),
|
|
89
|
-
data = _useResourceActionCon2.data;
|
|
90
|
-
|
|
91
|
-
if (!data) {
|
|
92
|
-
return null;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
var _data$data = data.data,
|
|
96
|
-
type = _data$data.type,
|
|
97
|
-
config = _data$data.config,
|
|
98
|
-
executed = _data$data.executed;
|
|
99
|
-
|
|
100
|
-
var _triggers$get = triggers.get(type),
|
|
101
|
-
title = _triggers$get.title,
|
|
102
|
-
fieldset = _triggers$get.fieldset,
|
|
103
|
-
scope = _triggers$get.scope,
|
|
104
|
-
components = _triggers$get.components;
|
|
105
|
-
|
|
106
|
-
var detailText = executed ? '{{t("View")}}' : '{{t("Configure")}}';
|
|
107
|
-
var titleText = "".concat(t('Trigger'), ": ").concat(compile(title));
|
|
108
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
109
|
-
className: cx(nodeCardClass)
|
|
110
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
111
|
-
className: cx(nodeMetaClass)
|
|
112
|
-
}, /*#__PURE__*/React.createElement(Tag, {
|
|
113
|
-
color: "gold"
|
|
114
|
-
}, t('Trigger'))), /*#__PURE__*/React.createElement("h4", null, compile(title)), /*#__PURE__*/React.createElement(SchemaComponent, {
|
|
115
|
-
schema: {
|
|
116
|
-
type: 'void',
|
|
117
|
-
title: detailText,
|
|
118
|
-
'x-component': 'Action.Link',
|
|
119
|
-
name: 'drawer',
|
|
120
|
-
properties: {
|
|
121
|
-
drawer: {
|
|
122
|
-
type: 'void',
|
|
123
|
-
title: titleText,
|
|
124
|
-
'x-component': 'Action.Drawer',
|
|
125
|
-
'x-decorator': 'Form',
|
|
126
|
-
'x-decorator-props': {
|
|
127
|
-
initialValue: {
|
|
128
|
-
config: config
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
properties: {
|
|
132
|
-
config: {
|
|
133
|
-
type: 'void',
|
|
134
|
-
name: 'config',
|
|
135
|
-
'x-component': 'fieldset',
|
|
136
|
-
'x-component-props': {
|
|
137
|
-
className: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-select{\n width: auto;\n }\n "])))
|
|
138
|
-
},
|
|
139
|
-
properties: fieldset
|
|
140
|
-
},
|
|
141
|
-
actions: {
|
|
142
|
-
type: 'void',
|
|
143
|
-
'x-component': 'Action.Drawer.Footer',
|
|
144
|
-
properties: executed ? {
|
|
145
|
-
close: {
|
|
146
|
-
title: '{{t("Close")}}',
|
|
147
|
-
'x-component': 'Action',
|
|
148
|
-
'x-component-props': {
|
|
149
|
-
useAction: '{{ cm.useCancelAction }}'
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
} : {
|
|
153
|
-
cancel: {
|
|
154
|
-
title: '{{t("Cancel")}}',
|
|
155
|
-
'x-component': 'Action',
|
|
156
|
-
'x-component-props': {
|
|
157
|
-
useAction: '{{ cm.useCancelAction }}'
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
submit: {
|
|
161
|
-
title: '{{t("Submit")}}',
|
|
162
|
-
'x-component': 'Action',
|
|
163
|
-
'x-component-props': {
|
|
164
|
-
type: 'primary',
|
|
165
|
-
useAction: useUpdateConfigAction
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
scope: scope,
|
|
175
|
-
components: components
|
|
176
|
-
}));
|
|
177
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
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; }
|
|
2
|
-
|
|
3
|
-
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; }
|
|
4
|
-
|
|
5
|
-
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; }
|
|
6
|
-
|
|
7
|
-
import React from "react";
|
|
8
|
-
import { observer, useForm } from "@formily/react";
|
|
9
|
-
import { Select } from "antd";
|
|
10
|
-
import { useCollectionManager, useCompile } from "../../../";
|
|
11
|
-
import { useTranslation } from "react-i18next";
|
|
12
|
-
export var DateFieldsSelect = observer(function (props) {
|
|
13
|
-
var _values$config;
|
|
14
|
-
|
|
15
|
-
var _useTranslation = useTranslation(),
|
|
16
|
-
t = _useTranslation.t;
|
|
17
|
-
|
|
18
|
-
var compile = useCompile();
|
|
19
|
-
|
|
20
|
-
var _useCollectionManager = useCollectionManager(),
|
|
21
|
-
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
22
|
-
|
|
23
|
-
var _useForm = useForm(),
|
|
24
|
-
values = _useForm.values;
|
|
25
|
-
|
|
26
|
-
var fields = getCollectionFields(values === null || values === void 0 ? void 0 : (_values$config = values.config) === null || _values$config === void 0 ? void 0 : _values$config.collection);
|
|
27
|
-
return /*#__PURE__*/React.createElement(Select, _objectSpread({
|
|
28
|
-
placeholder: t('Select Field')
|
|
29
|
-
}, props), fields.filter(function (field) {
|
|
30
|
-
return !field.hidden && (field.uiSchema ? field.type === 'date' : false);
|
|
31
|
-
}).map(function (field) {
|
|
32
|
-
var _field$uiSchema;
|
|
33
|
-
|
|
34
|
-
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
35
|
-
key: field.name,
|
|
36
|
-
value: field.name
|
|
37
|
-
}, compile((_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.title));
|
|
38
|
-
}));
|
|
39
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var _templateObject;
|
|
2
|
-
|
|
3
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
-
|
|
9
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
|
-
|
|
11
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
-
|
|
13
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
14
|
-
|
|
15
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
16
|
-
|
|
17
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
|
-
|
|
19
|
-
import { css } from "@emotion/css";
|
|
20
|
-
import { DatePicker, Select } from "antd";
|
|
21
|
-
import React, { useState } from "react";
|
|
22
|
-
import { useTranslation } from "react-i18next";
|
|
23
|
-
import { OnField } from "./OnField";
|
|
24
|
-
export function EndsByField(_ref) {
|
|
25
|
-
var value = _ref.value,
|
|
26
|
-
_onChange = _ref.onChange;
|
|
27
|
-
|
|
28
|
-
var _useTranslation = useTranslation(),
|
|
29
|
-
t = _useTranslation.t;
|
|
30
|
-
|
|
31
|
-
var _useState = useState(_typeof(value) === 'object' && !(value instanceof Date) ? 'field' : 'date'),
|
|
32
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
33
|
-
type = _useState2[0],
|
|
34
|
-
setType = _useState2[1];
|
|
35
|
-
|
|
36
|
-
return /*#__PURE__*/React.createElement("fieldset", {
|
|
37
|
-
className: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: .5em;\n "])))
|
|
38
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
39
|
-
value: type,
|
|
40
|
-
onChange: function onChange(t) {
|
|
41
|
-
_onChange(t === 'field' ? {} : null);
|
|
42
|
-
|
|
43
|
-
setType(t);
|
|
44
|
-
}
|
|
45
|
-
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
46
|
-
value: 'field'
|
|
47
|
-
}, t('By field')), /*#__PURE__*/React.createElement(Select.Option, {
|
|
48
|
-
value: 'date'
|
|
49
|
-
}, t('By custom date'))), type === 'field' ? /*#__PURE__*/React.createElement(OnField, {
|
|
50
|
-
value: value,
|
|
51
|
-
onChange: _onChange
|
|
52
|
-
}) : /*#__PURE__*/React.createElement(DatePicker, {
|
|
53
|
-
showTime: true,
|
|
54
|
-
value: value,
|
|
55
|
-
onChange: _onChange
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
var _templateObject;
|
|
2
|
-
|
|
3
|
-
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; }
|
|
4
|
-
|
|
5
|
-
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; }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
10
|
-
|
|
11
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
|
|
13
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
-
|
|
15
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
|
|
17
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
|
-
|
|
19
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
20
|
-
|
|
21
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
-
|
|
23
|
-
import React, { useState } from "react";
|
|
24
|
-
import { css } from "@emotion/css";
|
|
25
|
-
import { InputNumber, Select } from "antd";
|
|
26
|
-
import { useTranslation } from "react-i18next";
|
|
27
|
-
import { DateFieldsSelect } from "./DateFieldsSelect";
|
|
28
|
-
export function OnField(_ref) {
|
|
29
|
-
var value = _ref.value,
|
|
30
|
-
_onChange = _ref.onChange;
|
|
31
|
-
|
|
32
|
-
var _useTranslation = useTranslation(),
|
|
33
|
-
t = _useTranslation.t;
|
|
34
|
-
|
|
35
|
-
var _useState = useState(value.offset ? value.offset / Math.abs(value.offset) : 0),
|
|
36
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
37
|
-
dir = _useState2[0],
|
|
38
|
-
setDir = _useState2[1];
|
|
39
|
-
|
|
40
|
-
return /*#__PURE__*/React.createElement("fieldset", {
|
|
41
|
-
className: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n gap: .5em;\n "])))
|
|
42
|
-
}, /*#__PURE__*/React.createElement(DateFieldsSelect, {
|
|
43
|
-
value: value.field,
|
|
44
|
-
onChange: function onChange(field) {
|
|
45
|
-
return _onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
46
|
-
field: field
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
}), value.field ? /*#__PURE__*/React.createElement(Select, {
|
|
50
|
-
value: dir,
|
|
51
|
-
onChange: function onChange(v) {
|
|
52
|
-
setDir(v);
|
|
53
|
-
|
|
54
|
-
_onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
55
|
-
offset: Math.abs(value.offset) * v
|
|
56
|
-
}));
|
|
57
|
-
}
|
|
58
|
-
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
59
|
-
value: 0
|
|
60
|
-
}, t('Exactly at')), /*#__PURE__*/React.createElement(Select.Option, {
|
|
61
|
-
value: -1
|
|
62
|
-
}, t('Before')), /*#__PURE__*/React.createElement(Select.Option, {
|
|
63
|
-
value: 1
|
|
64
|
-
}, t('After'))) : null, dir ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputNumber, {
|
|
65
|
-
value: Math.abs(value.offset),
|
|
66
|
-
onChange: function onChange(v) {
|
|
67
|
-
return _onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
68
|
-
offset: v * dir
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
}), /*#__PURE__*/React.createElement(Select, {
|
|
72
|
-
value: value.unit || 86400000,
|
|
73
|
-
onChange: function onChange(unit) {
|
|
74
|
-
return _onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
75
|
-
unit: unit
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
}, /*#__PURE__*/React.createElement(Select.Option, {
|
|
79
|
-
value: 86400000
|
|
80
|
-
}, t('Days')), /*#__PURE__*/React.createElement(Select.Option, {
|
|
81
|
-
value: 3600000
|
|
82
|
-
}, t('Hours')), /*#__PURE__*/React.createElement(Select.Option, {
|
|
83
|
-
value: 60000
|
|
84
|
-
}, t('Minutes')), /*#__PURE__*/React.createElement(Select.Option, {
|
|
85
|
-
value: 1000
|
|
86
|
-
}, t('Seconds')))) : null);
|
|
87
|
-
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
var _templateObject;
|
|
2
|
-
|
|
3
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
4
|
-
|
|
5
|
-
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); }
|
|
6
|
-
|
|
7
|
-
import { css } from "@emotion/css";
|
|
8
|
-
import { InputNumber, Select } from "antd";
|
|
9
|
-
import React from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { Cron } from 'react-js-cron';
|
|
12
|
-
import CronZhCN from './locale/Cron.zh-CN';
|
|
13
|
-
var languages = {
|
|
14
|
-
'zh-CN': CronZhCN
|
|
15
|
-
};
|
|
16
|
-
var RepeatOptions = [{
|
|
17
|
-
value: 'none',
|
|
18
|
-
text: 'No repeat'
|
|
19
|
-
}, {
|
|
20
|
-
value: 60000,
|
|
21
|
-
text: 'By minute',
|
|
22
|
-
unitText: 'Minutes'
|
|
23
|
-
}, {
|
|
24
|
-
value: 3600000,
|
|
25
|
-
text: 'By hour',
|
|
26
|
-
unitText: 'Hours'
|
|
27
|
-
}, {
|
|
28
|
-
value: 86400000,
|
|
29
|
-
text: 'By day',
|
|
30
|
-
unitText: 'Days'
|
|
31
|
-
}, {
|
|
32
|
-
value: 604800000,
|
|
33
|
-
text: 'By week',
|
|
34
|
-
unitText: 'Weeks'
|
|
35
|
-
}, // { value: 18144_000_000, text: 'By 30 days' },
|
|
36
|
-
{
|
|
37
|
-
value: 'cron',
|
|
38
|
-
text: 'Advanced'
|
|
39
|
-
}];
|
|
40
|
-
|
|
41
|
-
function getNumberOption(v) {
|
|
42
|
-
var opts = RepeatOptions.filter(function (option) {
|
|
43
|
-
return typeof option.value === 'number';
|
|
44
|
-
}).reverse();
|
|
45
|
-
return opts.find(function (item) {
|
|
46
|
-
return !(v % item.value);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function getRepeatTypeValue(v) {
|
|
51
|
-
switch (_typeof(v)) {
|
|
52
|
-
case 'number':
|
|
53
|
-
var option = getNumberOption(v);
|
|
54
|
-
return option ? option.value : 'none';
|
|
55
|
-
|
|
56
|
-
case 'string':
|
|
57
|
-
return 'cron';
|
|
58
|
-
|
|
59
|
-
default:
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return 'none';
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function CommonRepeatField(_ref) {
|
|
67
|
-
var value = _ref.value,
|
|
68
|
-
_onChange = _ref.onChange;
|
|
69
|
-
|
|
70
|
-
var _useTranslation = useTranslation(),
|
|
71
|
-
t = _useTranslation.t;
|
|
72
|
-
|
|
73
|
-
var option = getNumberOption(value);
|
|
74
|
-
return /*#__PURE__*/React.createElement(InputNumber, {
|
|
75
|
-
value: value / option.value,
|
|
76
|
-
onChange: function onChange(v) {
|
|
77
|
-
return _onChange(v * option.value);
|
|
78
|
-
},
|
|
79
|
-
min: 1,
|
|
80
|
-
addonBefore: t('Every'),
|
|
81
|
-
addonAfter: t(option.unitText)
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function RepeatField(_ref2) {
|
|
86
|
-
var _ref2$value = _ref2.value,
|
|
87
|
-
value = _ref2$value === void 0 ? null : _ref2$value,
|
|
88
|
-
onChange = _ref2.onChange;
|
|
89
|
-
|
|
90
|
-
var _useTranslation2 = useTranslation(),
|
|
91
|
-
t = _useTranslation2.t;
|
|
92
|
-
|
|
93
|
-
var typeValue = getRepeatTypeValue(value);
|
|
94
|
-
|
|
95
|
-
function onTypeChange(v) {
|
|
96
|
-
if (v === 'none') {
|
|
97
|
-
onChange(null);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (v === 'cron') {
|
|
102
|
-
onChange('0 * * * * *');
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
onChange(v);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
var locale = languages[localStorage.getItem('NOCOBASE_LOCALE') || 'en-US'];
|
|
110
|
-
return /*#__PURE__*/React.createElement("fieldset", {
|
|
111
|
-
className: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: ", ";\n align-items: flex-start;\n gap: .5em;\n\n .react-js-cron{\n padding: .5em .5em 0 .5em;\n border: 1px dashed #ccc;\n\n .react-js-cron-field{\n margin-bottom: .5em;\n\n > span{\n margin: 0 .5em 0 0;\n }\n\n > .react-js-cron-select{\n margin: 0 .5em 0 0;\n }\n }\n }\n "])), typeValue === 'cron' ? 'column' : 'row')
|
|
112
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
113
|
-
value: typeValue,
|
|
114
|
-
onChange: onTypeChange
|
|
115
|
-
}, RepeatOptions.map(function (item) {
|
|
116
|
-
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
117
|
-
key: item.value,
|
|
118
|
-
value: item.value
|
|
119
|
-
}, t(item.text));
|
|
120
|
-
})), typeof typeValue === 'number' ? /*#__PURE__*/React.createElement(CommonRepeatField, {
|
|
121
|
-
value: value,
|
|
122
|
-
onChange: onChange
|
|
123
|
-
}) : null, typeValue === 'cron' ? /*#__PURE__*/React.createElement(Cron, {
|
|
124
|
-
value: value.trim().split(/\s+/).slice(1).join(' '),
|
|
125
|
-
setValue: function setValue(v) {
|
|
126
|
-
return onChange("0 ".concat(v));
|
|
127
|
-
},
|
|
128
|
-
clearButton: false,
|
|
129
|
-
locale: locale
|
|
130
|
-
}) : null);
|
|
131
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ScheduleConfig: () => JSX.Element;
|