@nocobase/plugin-workflow 0.9.1-alpha.1 → 0.9.2-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/lib/client/AddButton.js +50 -86
- package/lib/client/Branch.js +0 -13
- package/lib/client/ExecutionCanvas.js +16 -63
- package/lib/client/ExecutionLink.js +3 -21
- package/lib/client/ExecutionPage.js +1 -19
- package/lib/client/ExecutionResourceProvider.js +6 -23
- package/lib/client/FlowContext.js +0 -8
- package/lib/client/WorkflowCanvas.js +57 -129
- package/lib/client/WorkflowLink.js +3 -21
- package/lib/client/WorkflowPage.js +1 -19
- package/lib/client/WorkflowProvider.js +24 -47
- package/lib/client/WorkflowShortcut.js +0 -16
- package/lib/client/components/CollectionBlockInitializer.js +12 -22
- package/lib/client/components/CollectionFieldInitializers.js +5 -24
- package/lib/client/components/CollectionFieldset.js +33 -85
- package/lib/client/components/Duration.js +0 -14
- package/lib/client/components/DynamicExpression.d.ts +4 -0
- package/lib/client/components/DynamicExpression.js +102 -0
- package/lib/client/components/FieldsSelect.d.ts +2 -0
- package/lib/client/components/FieldsSelect.js +66 -0
- package/lib/client/components/FilterDynamicComponent.js +1 -10
- package/lib/client/components/NullRender.js +0 -1
- package/lib/client/components/OpenDrawer.js +10 -35
- package/lib/client/components/RadioWithTooltip.js +5 -27
- package/lib/client/components/renderEngineReference.d.ts +1 -0
- package/lib/client/components/renderEngineReference.js +55 -0
- package/lib/client/constants.js +0 -9
- package/lib/client/index.js +0 -6
- package/lib/client/interfaces/expression.d.ts +3 -0
- package/lib/client/interfaces/expression.js +37 -0
- package/lib/client/locale/index.js +5 -15
- package/lib/client/locale/pt-BR.d.ts +130 -0
- package/lib/client/locale/pt-BR.js +136 -0
- package/lib/client/locale/zh-CN.d.ts +16 -1
- package/lib/client/locale/zh-CN.js +17 -2
- package/lib/client/nodes/calculation.d.ts +56 -7
- package/lib/client/nodes/calculation.js +141 -74
- package/lib/client/nodes/condition.d.ts +5 -9
- package/lib/client/nodes/condition.js +30 -93
- package/lib/client/nodes/create.d.ts +36 -12
- package/lib/client/nodes/create.js +14 -28
- package/lib/client/nodes/delay.d.ts +3 -7
- package/lib/client/nodes/delay.js +5 -14
- package/lib/client/nodes/destroy.d.ts +3 -11
- package/lib/client/nodes/destroy.js +14 -12
- package/lib/client/nodes/index.d.ts +2 -2
- package/lib/client/nodes/index.js +181 -222
- package/lib/client/nodes/manual/AssigneesSelect.js +8 -18
- package/lib/client/nodes/manual/ModeConfig.js +0 -27
- package/lib/client/nodes/manual/SchemaConfig.js +87 -449
- package/lib/client/nodes/manual/WorkflowTodo.js +99 -163
- package/lib/client/nodes/manual/WorkflowTodoBlockInitializer.js +4 -20
- package/lib/client/nodes/manual/forms/customForm.d.ts +40 -0
- package/lib/client/nodes/manual/forms/customForm.js +411 -0
- package/lib/client/nodes/manual/index.d.ts +15 -6
- package/lib/client/nodes/manual/index.js +58 -54
- package/lib/client/nodes/parallel.d.ts +1 -2
- package/lib/client/nodes/parallel.js +16 -45
- package/lib/client/nodes/query.d.ts +30 -12
- package/lib/client/nodes/query.js +17 -25
- package/lib/client/nodes/request.d.ts +9 -17
- package/lib/client/nodes/request.js +13 -37
- package/lib/client/nodes/update.d.ts +27 -28
- package/lib/client/nodes/update.js +17 -18
- package/lib/client/schemas/collection.d.ts +20 -7
- package/lib/client/schemas/collection.js +27 -28
- package/lib/client/schemas/executions.js +3 -18
- package/lib/client/schemas/workflows.js +10 -33
- package/lib/client/style.js +75 -26
- package/lib/client/triggers/collection.d.ts +47 -18
- package/lib/client/triggers/collection.js +65 -123
- package/lib/client/triggers/index.d.ts +3 -6
- package/lib/client/triggers/index.js +146 -146
- package/lib/client/triggers/schedule/DateFieldsSelect.js +7 -32
- package/lib/client/triggers/schedule/EndsByField.js +1 -18
- package/lib/client/triggers/schedule/OnField.js +10 -38
- package/lib/client/triggers/schedule/RepeatField.js +4 -32
- package/lib/client/triggers/schedule/ScheduleConfig.js +25 -68
- package/lib/client/triggers/schedule/index.d.ts +21 -1
- package/lib/client/triggers/schedule/index.js +22 -24
- package/lib/client/triggers/schedule/locale/Cron.zh-CN.js +8 -4
- package/lib/client/utils.d.ts +1 -0
- package/lib/client/utils.js +31 -10
- package/lib/client/variable.d.ts +7 -6
- package/lib/client/variable.js +132 -71
- package/lib/index.js +0 -2
- package/lib/server/Plugin.d.ts +7 -7
- package/lib/server/Plugin.js +76 -111
- package/lib/server/Processor.d.ts +2 -0
- package/lib/server/Processor.js +62 -125
- package/lib/server/actions/index.js +3 -10
- package/lib/server/actions/nodes.js +34 -87
- package/lib/server/actions/workflows.js +46 -96
- package/lib/server/collections/executions.js +1 -1
- package/lib/server/collections/flow_nodes.js +7 -4
- package/lib/server/collections/jobs.js +1 -1
- package/lib/server/collections/workflows.js +3 -4
- package/lib/server/fields/expression-field.d.ts +8 -0
- package/lib/server/fields/expression-field.js +26 -0
- package/lib/server/fields/index.d.ts +1 -0
- package/lib/server/fields/index.js +12 -0
- package/lib/server/functions/index.js +3 -14
- package/lib/server/index.js +0 -6
- package/lib/server/instructions/calculation.js +22 -17
- package/lib/server/instructions/condition.js +8 -52
- package/lib/server/instructions/create.js +31 -15
- package/lib/server/instructions/delay.js +4 -32
- package/lib/server/instructions/destroy.js +6 -12
- package/lib/server/instructions/index.js +6 -23
- package/lib/server/instructions/manual/actions.js +22 -31
- package/lib/server/instructions/manual/collecions/users_jobs.js +1 -1
- package/lib/server/instructions/manual/index.d.ts +13 -12
- package/lib/server/instructions/manual/index.js +9 -47
- package/lib/server/instructions/parallel.js +9 -36
- package/lib/server/instructions/query.js +17 -15
- package/lib/server/instructions/request.js +7 -30
- package/lib/server/instructions/update.js +8 -14
- package/lib/server/migrations/20221129153547-calculation-variables.js +3 -27
- package/lib/server/migrations/20230221032941-change-request-body-type.js +3 -26
- package/lib/server/migrations/20230221071831-calculation-expression.js +1 -33
- package/lib/server/migrations/20230221121203-condition-calculation.js +5 -28
- package/lib/server/migrations/20230221162902-jsonb-to-json.js +3 -18
- package/lib/server/migrations/20230411034722-manual-multi-form.d.ts +4 -0
- package/lib/server/migrations/20230411034722-manual-multi-form.js +303 -0
- package/lib/server/models/Execution.js +0 -5
- package/lib/server/models/FlowNode.js +0 -5
- package/lib/server/models/Job.js +0 -5
- package/lib/server/models/Workflow.js +0 -5
- package/lib/server/triggers/collection.js +39 -61
- package/lib/server/triggers/index.js +3 -22
- package/lib/server/triggers/schedule.js +72 -194
- package/package.json +14 -11
|
@@ -5,87 +5,58 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.WorkflowProvider = exports.WorkflowContext = void 0;
|
|
7
7
|
exports.useWorkflowContext = useWorkflowContext;
|
|
8
|
-
|
|
9
8
|
function _react() {
|
|
10
9
|
const data = _interopRequireWildcard(require("react"));
|
|
11
|
-
|
|
12
10
|
_react = function _react() {
|
|
13
11
|
return data;
|
|
14
12
|
};
|
|
15
|
-
|
|
16
13
|
return data;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
15
|
function _antd() {
|
|
20
16
|
const data = require("antd");
|
|
21
|
-
|
|
22
17
|
_antd = function _antd() {
|
|
23
18
|
return data;
|
|
24
19
|
};
|
|
25
|
-
|
|
26
20
|
return data;
|
|
27
21
|
}
|
|
28
|
-
|
|
29
22
|
function _client() {
|
|
30
23
|
const data = require("@nocobase/client");
|
|
31
|
-
|
|
32
24
|
_client = function _client() {
|
|
33
25
|
return data;
|
|
34
26
|
};
|
|
35
|
-
|
|
36
27
|
return data;
|
|
37
28
|
}
|
|
38
|
-
|
|
39
29
|
var _WorkflowPage = require("./WorkflowPage");
|
|
40
|
-
|
|
41
30
|
var _ExecutionPage = require("./ExecutionPage");
|
|
42
|
-
|
|
43
31
|
var _triggers = require("./triggers");
|
|
44
|
-
|
|
45
32
|
var _nodes = require("./nodes");
|
|
46
|
-
|
|
47
33
|
var _locale = require("./locale");
|
|
48
|
-
|
|
49
34
|
var _workflows = require("./schemas/workflows");
|
|
50
|
-
|
|
51
35
|
var _WorkflowLink = require("./WorkflowLink");
|
|
52
|
-
|
|
53
36
|
var _ExecutionResourceProvider = require("./ExecutionResourceProvider");
|
|
54
|
-
|
|
55
37
|
var _ExecutionLink = require("./ExecutionLink");
|
|
56
|
-
|
|
57
38
|
var _OpenDrawer = _interopRequireDefault(require("./components/OpenDrawer"));
|
|
58
|
-
|
|
59
39
|
var _WorkflowTodo = require("./nodes/manual/WorkflowTodo");
|
|
60
|
-
|
|
61
40
|
var _WorkflowTodoBlockInitializer = require("./nodes/manual/WorkflowTodoBlockInitializer");
|
|
62
|
-
|
|
41
|
+
var _DynamicExpression = require("./components/DynamicExpression");
|
|
42
|
+
var _expression = _interopRequireDefault(require("./interfaces/expression"));
|
|
63
43
|
const _excluded = ["routes", "components"];
|
|
64
|
-
|
|
65
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
66
|
-
|
|
67
45
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
68
|
-
|
|
69
46
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
70
|
-
|
|
71
47
|
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; }
|
|
72
|
-
|
|
73
48
|
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; }
|
|
74
|
-
|
|
75
|
-
function
|
|
76
|
-
|
|
49
|
+
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; }
|
|
50
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
51
|
+
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); }
|
|
77
52
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
78
|
-
|
|
79
53
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
80
|
-
|
|
54
|
+
// registerField(expressionField.group, 'expression', expressionField);
|
|
81
55
|
const WorkflowContext = _react().default.createContext({});
|
|
82
|
-
|
|
83
56
|
exports.WorkflowContext = WorkflowContext;
|
|
84
|
-
|
|
85
57
|
function useWorkflowContext() {
|
|
86
58
|
return (0, _react().useContext)(WorkflowContext);
|
|
87
59
|
}
|
|
88
|
-
|
|
89
60
|
function WorkflowPane() {
|
|
90
61
|
return _react().default.createElement(_antd().Card, {
|
|
91
62
|
bordered: false
|
|
@@ -99,17 +70,14 @@ function WorkflowPane() {
|
|
|
99
70
|
}
|
|
100
71
|
}));
|
|
101
72
|
}
|
|
102
|
-
|
|
103
73
|
;
|
|
104
|
-
|
|
105
74
|
const WorkflowProvider = props => {
|
|
106
|
-
const
|
|
107
|
-
|
|
75
|
+
const pmCtx = (0, _react().useContext)(_client().PluginManagerContext);
|
|
76
|
+
const cmCtx = (0, _react().useContext)(_client().CollectionManagerContext);
|
|
108
77
|
const _useContext = (0, _react().useContext)(_client().RouteSwitchContext),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
78
|
+
routes = _useContext.routes,
|
|
79
|
+
components = _useContext.components,
|
|
80
|
+
others = _objectWithoutProperties(_useContext, _excluded);
|
|
113
81
|
routes[1].routes.unshift({
|
|
114
82
|
type: 'route',
|
|
115
83
|
path: '/admin/settings/workflow/workflows/:id',
|
|
@@ -136,7 +104,7 @@ const WorkflowProvider = props => {
|
|
|
136
104
|
}
|
|
137
105
|
}, _react().default.createElement(_client().PluginManagerContext.Provider, {
|
|
138
106
|
value: {
|
|
139
|
-
components: _objectSpread({},
|
|
107
|
+
components: _objectSpread({}, pmCtx === null || pmCtx === void 0 ? void 0 : pmCtx.components)
|
|
140
108
|
}
|
|
141
109
|
}, _react().default.createElement(_client().RouteSwitchContext.Provider, {
|
|
142
110
|
value: _objectSpread(_objectSpread({
|
|
@@ -150,14 +118,23 @@ const WorkflowProvider = props => {
|
|
|
150
118
|
}, _react().default.createElement(_client().SchemaComponentOptions, {
|
|
151
119
|
components: {
|
|
152
120
|
WorkflowTodo: _WorkflowTodo.WorkflowTodo,
|
|
153
|
-
WorkflowTodoBlockInitializer: _WorkflowTodoBlockInitializer.WorkflowTodoBlockInitializer
|
|
121
|
+
WorkflowTodoBlockInitializer: _WorkflowTodoBlockInitializer.WorkflowTodoBlockInitializer,
|
|
122
|
+
DynamicExpression: _DynamicExpression.DynamicExpression
|
|
123
|
+
},
|
|
124
|
+
scope: {
|
|
125
|
+
useCollectionDataSource: _client().useCollectionDataSource
|
|
154
126
|
}
|
|
127
|
+
}, _react().default.createElement(_client().CollectionManagerContext.Provider, {
|
|
128
|
+
value: _objectSpread(_objectSpread({}, cmCtx), {}, {
|
|
129
|
+
interfaces: _objectSpread(_objectSpread({}, cmCtx.interfaces), {}, {
|
|
130
|
+
expression: _expression.default
|
|
131
|
+
})
|
|
132
|
+
})
|
|
155
133
|
}, _react().default.createElement(WorkflowContext.Provider, {
|
|
156
134
|
value: {
|
|
157
135
|
triggers: _triggers.triggers,
|
|
158
136
|
instructions: _nodes.instructions
|
|
159
137
|
}
|
|
160
|
-
}, props.children)))));
|
|
138
|
+
}, props.children))))));
|
|
161
139
|
};
|
|
162
|
-
|
|
163
140
|
exports.WorkflowProvider = WorkflowProvider;
|
|
@@ -4,51 +4,36 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.WorkflowShortcut = void 0;
|
|
7
|
-
|
|
8
7
|
function _react() {
|
|
9
8
|
const data = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
9
|
_react = function _react() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _icons() {
|
|
19
15
|
const data = require("@ant-design/icons");
|
|
20
|
-
|
|
21
16
|
_icons = function _icons() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _reactRouterDom() {
|
|
29
22
|
const data = require("react-router-dom");
|
|
30
|
-
|
|
31
23
|
_reactRouterDom = function _reactRouterDom() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _client() {
|
|
39
29
|
const data = require("@nocobase/client");
|
|
40
|
-
|
|
41
30
|
_client = function _client() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
var _locale = require("./locale");
|
|
49
|
-
|
|
50
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
51
|
-
|
|
52
37
|
const WorkflowShortcut = () => {
|
|
53
38
|
const history = (0, _reactRouterDom().useHistory)();
|
|
54
39
|
return _react().default.createElement(_client().PluginManager.Toolbar.Item, {
|
|
@@ -60,5 +45,4 @@ const WorkflowShortcut = () => {
|
|
|
60
45
|
}
|
|
61
46
|
});
|
|
62
47
|
};
|
|
63
|
-
|
|
64
48
|
exports.WorkflowShortcut = WorkflowShortcut;
|
|
@@ -4,50 +4,36 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.CollectionBlockInitializer = CollectionBlockInitializer;
|
|
7
|
-
|
|
8
7
|
function _react() {
|
|
9
8
|
const data = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
9
|
_react = function _react() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _client() {
|
|
19
15
|
const data = require("@nocobase/client");
|
|
20
|
-
|
|
21
16
|
_client = function _client() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
const _excluded = ["insert", "collection", "dataSource"];
|
|
29
|
-
|
|
30
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
-
|
|
32
23
|
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; }
|
|
33
|
-
|
|
34
24
|
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; }
|
|
35
|
-
|
|
36
|
-
function
|
|
37
|
-
|
|
25
|
+
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; }
|
|
26
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
27
|
+
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); }
|
|
38
28
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
39
|
-
|
|
40
29
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
41
|
-
|
|
42
30
|
function CollectionBlockInitializer(_ref) {
|
|
43
31
|
let insert = _ref.insert,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
32
|
+
collection = _ref.collection,
|
|
33
|
+
dataSource = _ref.dataSource,
|
|
34
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
48
35
|
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
getCollection = _useCollectionManager.getCollection;
|
|
51
37
|
const resovledCollection = getCollection(collection);
|
|
52
38
|
return _react().default.createElement(_client().SchemaInitializer.Item, _objectSpread(_objectSpread({}, props), {}, {
|
|
53
39
|
onClick: () => {
|
|
@@ -60,9 +46,13 @@ function CollectionBlockInitializer(_ref) {
|
|
|
60
46
|
collection
|
|
61
47
|
},
|
|
62
48
|
'x-component': 'CardItem',
|
|
63
|
-
'x-component-props': {
|
|
49
|
+
'x-component-props': {
|
|
50
|
+
// title: props.title
|
|
64
51
|
},
|
|
65
52
|
'x-designer': 'SimpleDesigner',
|
|
53
|
+
'x-designer-props': {
|
|
54
|
+
type: 'record'
|
|
55
|
+
},
|
|
66
56
|
properties: {
|
|
67
57
|
grid: {
|
|
68
58
|
type: 'void',
|
|
@@ -4,57 +4,40 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.CollectionFieldInitializers = CollectionFieldInitializers;
|
|
7
|
-
|
|
8
7
|
function _react() {
|
|
9
8
|
const data = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
9
|
_react = function _react() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _lodash() {
|
|
19
15
|
const data = require("lodash");
|
|
20
|
-
|
|
21
16
|
_lodash = function _lodash() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _client() {
|
|
29
22
|
const data = require("@nocobase/client");
|
|
30
|
-
|
|
31
23
|
_client = function _client() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
const _excluded = ["field"];
|
|
39
|
-
|
|
40
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
|
-
|
|
42
30
|
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; }
|
|
43
|
-
|
|
44
31
|
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; }
|
|
45
|
-
|
|
46
|
-
function
|
|
47
|
-
|
|
32
|
+
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; }
|
|
33
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
34
|
+
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); }
|
|
48
35
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
49
|
-
|
|
50
36
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
51
|
-
|
|
52
37
|
function CollectionFieldInitializer(_ref) {
|
|
53
38
|
var _uiSchema$title;
|
|
54
|
-
|
|
55
39
|
let field = _ref.field,
|
|
56
|
-
|
|
57
|
-
|
|
40
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
58
41
|
const uiSchema = (0, _lodash().cloneDeep)(field.uiSchema);
|
|
59
42
|
delete uiSchema['x-uid'];
|
|
60
43
|
return _react().default.createElement(_client().InitializerWithSwitch, _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -69,11 +52,9 @@ function CollectionFieldInitializer(_ref) {
|
|
|
69
52
|
type: "x-collection-field"
|
|
70
53
|
}));
|
|
71
54
|
}
|
|
72
|
-
|
|
73
55
|
function CollectionFieldInitializers(props) {
|
|
74
56
|
const _useCollection = (0, _client().useCollection)(),
|
|
75
|
-
|
|
76
|
-
|
|
57
|
+
fields = _useCollection.fields;
|
|
77
58
|
const items = fields.filter(field => !['belongsTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type) && field.uiSchema).map(field => ({
|
|
78
59
|
key: field.name,
|
|
79
60
|
type: 'item',
|
|
@@ -4,152 +4,104 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
function _react() {
|
|
9
8
|
const data = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
9
|
_react = function _react() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _react2() {
|
|
19
15
|
const data = require("@formily/react");
|
|
20
|
-
|
|
21
16
|
_react2 = function _react2() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _antd() {
|
|
29
22
|
const data = require("antd");
|
|
30
|
-
|
|
31
23
|
_antd = function _antd() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _icons() {
|
|
39
29
|
const data = require("@ant-design/icons");
|
|
40
|
-
|
|
41
30
|
_icons = function _icons() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
function _reactI18next() {
|
|
49
36
|
const data = require("react-i18next");
|
|
50
|
-
|
|
51
37
|
_reactI18next = function _reactI18next() {
|
|
52
38
|
return data;
|
|
53
39
|
};
|
|
54
|
-
|
|
55
40
|
return data;
|
|
56
41
|
}
|
|
57
|
-
|
|
58
42
|
function _css() {
|
|
59
43
|
const data = require("@emotion/css");
|
|
60
|
-
|
|
61
44
|
_css = function _css() {
|
|
62
45
|
return data;
|
|
63
46
|
};
|
|
64
|
-
|
|
65
47
|
return data;
|
|
66
48
|
}
|
|
67
|
-
|
|
68
49
|
function _client() {
|
|
69
50
|
const data = require("@nocobase/client");
|
|
70
|
-
|
|
71
51
|
_client = function _client() {
|
|
72
52
|
return data;
|
|
73
53
|
};
|
|
74
|
-
|
|
75
54
|
return data;
|
|
76
55
|
}
|
|
77
|
-
|
|
78
56
|
var _locale = require("../locale");
|
|
79
|
-
|
|
80
57
|
var _variable = require("../variable");
|
|
81
|
-
|
|
82
58
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
83
|
-
|
|
84
59
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
85
|
-
|
|
86
60
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
87
|
-
|
|
88
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
89
|
-
|
|
90
|
-
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); }
|
|
91
|
-
|
|
92
61
|
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; }
|
|
93
|
-
|
|
94
62
|
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; }
|
|
95
|
-
|
|
96
|
-
function
|
|
97
|
-
|
|
63
|
+
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; }
|
|
64
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
65
|
+
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); }
|
|
98
66
|
function AssociationInput(props) {
|
|
99
|
-
var _data$config;
|
|
100
|
-
|
|
101
67
|
const _useCollectionManager = (0, _client().useCollectionManager)(),
|
|
102
|
-
|
|
103
|
-
|
|
68
|
+
getCollectionFields = _useCollectionManager.getCollectionFields;
|
|
104
69
|
const _useField = (0, _react2().useField)(),
|
|
105
|
-
|
|
106
|
-
|
|
70
|
+
path = _useField.path;
|
|
107
71
|
const fieldName = path.segments[path.segments.length - 1];
|
|
108
|
-
|
|
109
72
|
const _useForm = (0, _react2().useForm)(),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const fields = getCollectionFields(data === null || data === void 0 ? void 0 : (_data$config = data.config) === null || _data$config === void 0 ? void 0 : _data$config.collection);
|
|
113
|
-
|
|
73
|
+
config = _useForm.values;
|
|
74
|
+
const fields = getCollectionFields(config === null || config === void 0 ? void 0 : config.collection);
|
|
114
75
|
const _fields$find = fields.find(item => item.name === fieldName),
|
|
115
|
-
|
|
116
|
-
|
|
76
|
+
type = _fields$find.type;
|
|
117
77
|
const value = Array.isArray(props.value) ? props.value.join(',') : props.value;
|
|
118
|
-
|
|
119
78
|
function onChange(ev) {
|
|
120
79
|
const trimed = ev.target.value.trim();
|
|
121
80
|
props.onChange(['belongsTo', 'hasOne'].includes(type) ? trimed : trimed.split(/[,\s]+/));
|
|
122
81
|
}
|
|
123
|
-
|
|
124
82
|
return _react().default.createElement(_antd().Input, _objectSpread(_objectSpread({}, props), {}, {
|
|
125
83
|
value: value,
|
|
126
84
|
onChange: onChange
|
|
127
85
|
}));
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
86
|
+
}
|
|
87
|
+
// NOTE: observer for watching useProps
|
|
131
88
|
var _default = (0, _react2().observer)(({
|
|
132
89
|
value,
|
|
133
90
|
disabled,
|
|
134
91
|
onChange: _onChange
|
|
135
92
|
}) => {
|
|
136
|
-
var _data$config2;
|
|
137
|
-
|
|
138
93
|
const _useTranslation = (0, _reactI18next().useTranslation)(),
|
|
139
|
-
|
|
140
|
-
|
|
94
|
+
t = _useTranslation.t;
|
|
141
95
|
const compile = (0, _client().useCompile)();
|
|
142
96
|
const form = (0, _react2().useForm)();
|
|
143
|
-
|
|
144
97
|
const _useCollectionManager2 = (0, _client().useCollectionManager)(),
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
98
|
+
getCollection = _useCollectionManager2.getCollection,
|
|
99
|
+
getCollectionFields = _useCollectionManager2.getCollectionFields;
|
|
148
100
|
const _useForm2 = (0, _react2().useForm)(),
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
|
|
101
|
+
config = _useForm2.values;
|
|
102
|
+
const collectionName = config === null || config === void 0 ? void 0 : config.collection;
|
|
103
|
+
const fields = getCollectionFields(collectionName).filter(field => !field.hidden && (field.uiSchema ? !field.uiSchema['x-read-pretty'] : false)
|
|
104
|
+
// TODO: should use some field option but not type to control this
|
|
153
105
|
&& !['formula'].includes(field.type));
|
|
154
106
|
const unassignedFields = fields.filter(field => !(field.name in value));
|
|
155
107
|
const scope = (0, _variable.useWorkflowVariableOptions)();
|
|
@@ -170,11 +122,10 @@ var _default = (0, _react2().observer)(({
|
|
|
170
122
|
collection: getCollection(collectionName)
|
|
171
123
|
}, fields.filter(field => field.name in value).map(field => {
|
|
172
124
|
var _field$uiSchema$title, _field$uiSchema;
|
|
173
|
-
|
|
174
125
|
// constant for associations to use Input, others to use CollectionField
|
|
175
126
|
// dynamic values only support belongsTo/hasOne association, other association type should disable
|
|
176
|
-
const ConstantCompoent = ['belongsTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type) ? AssociationInput : _client().CollectionField;
|
|
177
|
-
|
|
127
|
+
const ConstantCompoent = ['belongsTo', 'hasOne', 'hasMany', 'belongsToMany'].includes(field.type) ? AssociationInput : _client().CollectionField;
|
|
128
|
+
// TODO: try to use <ObjectField> to replace this map
|
|
178
129
|
return _react().default.createElement(_antd().Form.Item, {
|
|
179
130
|
key: field.name,
|
|
180
131
|
label: compile((_field$uiSchema$title = (_field$uiSchema = field.uiSchema) === null || _field$uiSchema === void 0 ? void 0 : _field$uiSchema.title) !== null && _field$uiSchema$title !== void 0 ? _field$uiSchema$title : field.name),
|
|
@@ -185,7 +136,7 @@ var _default = (0, _react2().observer)(({
|
|
|
185
136
|
}
|
|
186
137
|
`
|
|
187
138
|
}, _react().default.createElement(_client().Variable.Input, {
|
|
188
|
-
scope:
|
|
139
|
+
scope: scope,
|
|
189
140
|
value: value[field.name],
|
|
190
141
|
onChange: next => {
|
|
191
142
|
_onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
@@ -198,11 +149,9 @@ var _default = (0, _react2().observer)(({
|
|
|
198
149
|
properties: {
|
|
199
150
|
[field.name]: {
|
|
200
151
|
'x-component': ConstantCompoent,
|
|
201
|
-
|
|
202
152
|
['x-validator']() {
|
|
203
153
|
return '';
|
|
204
154
|
}
|
|
205
|
-
|
|
206
155
|
}
|
|
207
156
|
}
|
|
208
157
|
}
|
|
@@ -211,33 +160,32 @@ var _default = (0, _react2().observer)(({
|
|
|
211
160
|
icon: _react().default.createElement(_icons().CloseCircleOutlined, null),
|
|
212
161
|
onClick: () => {
|
|
213
162
|
const _field$name = field.name,
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
163
|
+
_ = value[_field$name],
|
|
164
|
+
rest = _objectWithoutProperties(value, [_field$name].map(_toPropertyKey));
|
|
217
165
|
_onChange(rest);
|
|
218
166
|
}
|
|
219
167
|
}) : null);
|
|
220
168
|
}), unassignedFields.length ? _react().default.createElement(_antd().Dropdown, {
|
|
221
169
|
overlay: _react().default.createElement(_antd().Menu, {
|
|
170
|
+
items: unassignedFields.map(field => {
|
|
171
|
+
var _field$uiSchema$title2, _field$uiSchema2;
|
|
172
|
+
return {
|
|
173
|
+
key: field.name,
|
|
174
|
+
label: compile((_field$uiSchema$title2 = (_field$uiSchema2 = field.uiSchema) === null || _field$uiSchema2 === void 0 ? void 0 : _field$uiSchema2.title) !== null && _field$uiSchema$title2 !== void 0 ? _field$uiSchema$title2 : field.name)
|
|
175
|
+
};
|
|
176
|
+
}),
|
|
222
177
|
onClick: ({
|
|
223
178
|
key
|
|
224
179
|
}) => _onChange(_objectSpread(_objectSpread({}, value), {}, {
|
|
225
180
|
[key]: null
|
|
226
181
|
})),
|
|
227
182
|
className: (0, _css().css)`
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
var _field$uiSchema$title2, _field$uiSchema2;
|
|
233
|
-
|
|
234
|
-
return _react().default.createElement(_antd().Menu.Item, {
|
|
235
|
-
key: field.name
|
|
236
|
-
}, compile((_field$uiSchema$title2 = (_field$uiSchema2 = field.uiSchema) === null || _field$uiSchema2 === void 0 ? void 0 : _field$uiSchema2.title) !== null && _field$uiSchema$title2 !== void 0 ? _field$uiSchema$title2 : field.name));
|
|
237
|
-
}))
|
|
183
|
+
max-height: 300px;
|
|
184
|
+
overflow-y: auto;
|
|
185
|
+
`
|
|
186
|
+
})
|
|
238
187
|
}, _react().default.createElement(_antd().Button, {
|
|
239
188
|
icon: _react().default.createElement(_icons().PlusOutlined, null)
|
|
240
189
|
}, t('Add field'))) : null) : _react().default.createElement("p", null, (0, _locale.lang)('Please select collection first')));
|
|
241
190
|
});
|
|
242
|
-
|
|
243
191
|
exports.default = _default;
|
|
@@ -4,41 +4,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = _default;
|
|
7
|
-
|
|
8
7
|
function _react() {
|
|
9
8
|
const data = _interopRequireDefault(require("react"));
|
|
10
|
-
|
|
11
9
|
_react = function _react() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _antd() {
|
|
19
15
|
const data = require("antd");
|
|
20
|
-
|
|
21
16
|
_antd = function _antd() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _css() {
|
|
29
22
|
const data = require("@emotion/css");
|
|
30
|
-
|
|
31
23
|
_css = function _css() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
var _locale = require("../locale");
|
|
39
|
-
|
|
40
29
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
41
|
-
|
|
42
30
|
const UnitOptions = [{
|
|
43
31
|
value: 1000,
|
|
44
32
|
label: 'Seconds'
|
|
@@ -55,11 +43,9 @@ const UnitOptions = [{
|
|
|
55
43
|
value: 604800000,
|
|
56
44
|
label: 'Weeks'
|
|
57
45
|
}];
|
|
58
|
-
|
|
59
46
|
function getNumberOption(v) {
|
|
60
47
|
return UnitOptions.slice().reverse().find(item => !(v % item.value));
|
|
61
48
|
}
|
|
62
|
-
|
|
63
49
|
function _default({
|
|
64
50
|
value = 60000,
|
|
65
51
|
onChange: _onChange
|