react-cron-generator 1.3.13 → 2.0.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/README.md +4 -19
- package/build/cron-tab/custom.d.ts +8 -0
- package/build/cron-tab/daily.d.ts +8 -0
- package/build/cron-tab/hourly.d.ts +8 -0
- package/build/cron-tab/minutes.d.ts +8 -0
- package/build/cron-tab/monthly.d.ts +8 -0
- package/build/cron-tab/weekly.d.ts +8 -0
- package/build/cron.d.ts +16 -0
- package/build/hour-select/index.d.ts +8 -0
- package/{dist/index.js → build/index.d.ts} +4 -4
- package/build/index.js +7299 -0
- package/build/index.js.map +1 -0
- package/build/meta/index.d.ts +26 -0
- package/build/minutes-select/index.d.ts +8 -0
- package/package.json +36 -16
- package/dist/cron-builder.css +0 -91
- package/dist/cron-tab/custom.js +0 -46
- package/dist/cron-tab/daily.js +0 -130
- package/dist/cron-tab/hourly.js +0 -143
- package/dist/cron-tab/minutes.js +0 -52
- package/dist/cron-tab/monthly.js +0 -175
- package/dist/cron-tab/weekly.js +0 -148
- package/dist/cron-tab/yearly.js +0 -32
- package/dist/cron.js +0 -245
- package/dist/hour-select/index.js +0 -47
- package/dist/localization/translation.json +0 -29
- package/dist/meta/index.js +0 -79
- package/dist/minutes-select/index.js +0 -47
package/dist/meta/index.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import Minutes from '../cron-tab/minutes';
|
|
2
|
-
import Daily from '../cron-tab/daily';
|
|
3
|
-
import Hourly from '../cron-tab/hourly';
|
|
4
|
-
import Weekly from '../cron-tab/weekly';
|
|
5
|
-
import Monthly from '../cron-tab/monthly';
|
|
6
|
-
import Custom from '../cron-tab/custom';
|
|
7
|
-
export var HEADER = {
|
|
8
|
-
MINUTES: 'MINUTES',
|
|
9
|
-
HOURLY: 'HOURLY',
|
|
10
|
-
DAILY: 'DAILY',
|
|
11
|
-
WEEKLY: 'WEEKLY',
|
|
12
|
-
MONTHLY: 'MONTHLY',
|
|
13
|
-
CUSTOM: 'CUSTOM'
|
|
14
|
-
};
|
|
15
|
-
var HEADER_VALUES = {
|
|
16
|
-
MINUTES: 'Minutes',
|
|
17
|
-
HOURLY: 'Hourly',
|
|
18
|
-
DAILY: 'Daily',
|
|
19
|
-
WEEKLY: 'Weekly',
|
|
20
|
-
MONTHLY: 'Monthly',
|
|
21
|
-
CUSTOM: 'Custom'
|
|
22
|
-
};
|
|
23
|
-
var defaultTabs = [HEADER_VALUES.MINUTES, HEADER_VALUES.HOURLY, HEADER_VALUES.DAILY, HEADER_VALUES.WEEKLY, HEADER_VALUES.MONTHLY, HEADER_VALUES.CUSTOM];
|
|
24
|
-
export var metadata = [{
|
|
25
|
-
component: Minutes,
|
|
26
|
-
name: HEADER_VALUES.MINUTES,
|
|
27
|
-
initialCron: ['0', '0/1', '*', '*', '*', '?', '*']
|
|
28
|
-
}, {
|
|
29
|
-
component: Hourly,
|
|
30
|
-
name: HEADER_VALUES.HOURLY,
|
|
31
|
-
initialCron: ['0', '0', '00', '1/1', '*', '?', '*']
|
|
32
|
-
}, {
|
|
33
|
-
component: Daily,
|
|
34
|
-
name: HEADER_VALUES.DAILY,
|
|
35
|
-
initialCron: ['0', '0', '00', '1/1', '*', '?', '*']
|
|
36
|
-
}, {
|
|
37
|
-
component: Weekly,
|
|
38
|
-
name: HEADER_VALUES.WEEKLY,
|
|
39
|
-
initialCron: ['0', '0', '00', '?', '*', '*', '*']
|
|
40
|
-
}, {
|
|
41
|
-
component: Monthly,
|
|
42
|
-
name: HEADER_VALUES.MONTHLY,
|
|
43
|
-
initialCron: ['0', '0', '00', '1', '1/1', '?', '*']
|
|
44
|
-
}, {
|
|
45
|
-
component: Custom,
|
|
46
|
-
name: HEADER_VALUES.CUSTOM,
|
|
47
|
-
initialCron: ['*', '*', '*', '*', '*', '*', '*']
|
|
48
|
-
}];
|
|
49
|
-
|
|
50
|
-
var validateHeaders = function validateHeaders(headers) {
|
|
51
|
-
var validatedHeaders = [];
|
|
52
|
-
headers.forEach(function (header) {
|
|
53
|
-
if (!HEADER_VALUES[header]) {
|
|
54
|
-
throw new Error('Invalid header ' + header); // Avoid duplicates
|
|
55
|
-
} else if (validatedHeaders.indexOf(HEADER_VALUES[header]) === -1) {
|
|
56
|
-
validatedHeaders.push(HEADER_VALUES[header]);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
return validatedHeaders;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* Validate and load headers
|
|
63
|
-
* @param {*} options
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export var loadHeaders = function loadHeaders(options) {
|
|
68
|
-
if (options) {
|
|
69
|
-
if (options.headers) {
|
|
70
|
-
if (!options.headers.length) {
|
|
71
|
-
throw new Error('Atleast one header is required.');
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return validateHeaders(options.headers);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return defaultTabs;
|
|
79
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
-
import React, { Component } from 'react';
|
|
6
|
-
|
|
7
|
-
var Minutes = /*#__PURE__*/function (_Component) {
|
|
8
|
-
_inherits(Minutes, _Component);
|
|
9
|
-
|
|
10
|
-
var _super = _createSuper(Minutes);
|
|
11
|
-
|
|
12
|
-
function Minutes() {
|
|
13
|
-
_classCallCheck(this, Minutes);
|
|
14
|
-
|
|
15
|
-
return _super.apply(this, arguments);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
_createClass(Minutes, [{
|
|
19
|
-
key: "render",
|
|
20
|
-
value: function render() {
|
|
21
|
-
return /*#__PURE__*/React.createElement("select", {
|
|
22
|
-
disabled: this.props.disabled === true ? true : false,
|
|
23
|
-
className: "minutes",
|
|
24
|
-
onChange: this.props.onChange ? this.props.onChange : function () {},
|
|
25
|
-
value: this.props.value
|
|
26
|
-
}, this.buildOptions());
|
|
27
|
-
}
|
|
28
|
-
}, {
|
|
29
|
-
key: "buildOptions",
|
|
30
|
-
value: function buildOptions() {
|
|
31
|
-
var options = [];
|
|
32
|
-
|
|
33
|
-
for (var i = 0; i < 60; i++) {
|
|
34
|
-
options.push( /*#__PURE__*/React.createElement("option", {
|
|
35
|
-
key: i,
|
|
36
|
-
id: i
|
|
37
|
-
}, (i < 10 ? '0' : '') + i));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return options;
|
|
41
|
-
}
|
|
42
|
-
}]);
|
|
43
|
-
|
|
44
|
-
return Minutes;
|
|
45
|
-
}(Component);
|
|
46
|
-
|
|
47
|
-
export { Minutes as default };
|