react-cron-generator 2.0.0 → 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/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/build/index.d.ts +4 -0
- package/{dist → build}/index.js +32 -231
- 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 +4 -4
- package/dist/index.js.map +0 -1
package/build/cron.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { HeaderKeyType } from './meta';
|
|
3
|
+
import './cron-builder.css';
|
|
4
|
+
interface CronProp {
|
|
5
|
+
value?: string;
|
|
6
|
+
onChange(val: string, text: string): void;
|
|
7
|
+
showResultText: boolean;
|
|
8
|
+
showResultCron: boolean;
|
|
9
|
+
translateFn?(key: string): string;
|
|
10
|
+
locale?: string;
|
|
11
|
+
options?: {
|
|
12
|
+
headers: HeaderKeyType[];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
declare const Cron: React.FunctionComponent<CronProp>;
|
|
16
|
+
export default Cron;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { ChangeEvent } from 'react';
|
|
2
|
+
interface HourSelectProp {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
onChange(event: ChangeEvent<HTMLSelectElement>): void;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
declare const HourSelect: React.FunctionComponent<HourSelectProp>;
|
|
8
|
+
export default HourSelect;
|
package/build/index.d.ts
ADDED
package/{dist → build}/index.js
RENAMED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var react = require('react');
|
|
3
7
|
|
|
4
8
|
var cronstrueI18n = {exports: {}};
|
|
5
9
|
|
|
@@ -665,7 +669,7 @@ var cronstrueI18n = {exports: {}};
|
|
|
665
669
|
|
|
666
670
|
|
|
667
671
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
668
|
-
exports.
|
|
672
|
+
exports.af = exports.hu = exports.be = exports.ca = exports.fa = exports.sw = exports.sl = exports.fi = exports.sk = exports.cs = exports.he = exports.ja = exports.zh_TW = exports.zh_CN = exports.uk = exports.tr = exports.ru = exports.ro = exports.pt_PT = exports.pt_BR = exports.pl = exports.sv = exports.nb = exports.nl = exports.ko = exports.id = exports.it = exports.fr = exports.es = exports.de = exports.da = exports.en = void 0;
|
|
669
673
|
var en_1 = __webpack_require__(751);
|
|
670
674
|
Object.defineProperty(exports, "en", ({ enumerable: true, get: function () { return en_1.en; } }));
|
|
671
675
|
var da_1 = __webpack_require__(904);
|
|
@@ -730,8 +734,6 @@ var cronstrueI18n = {exports: {}};
|
|
|
730
734
|
Object.defineProperty(exports, "hu", ({ enumerable: true, get: function () { return hu_1.hu; } }));
|
|
731
735
|
var af_1 = __webpack_require__(675);
|
|
732
736
|
Object.defineProperty(exports, "af", ({ enumerable: true, get: function () { return af_1.af; } }));
|
|
733
|
-
var th_1 = __webpack_require__(312);
|
|
734
|
-
Object.defineProperty(exports, "th", ({ enumerable: true, get: function () { return th_1.th; } }));
|
|
735
737
|
|
|
736
738
|
|
|
737
739
|
/***/ }),
|
|
@@ -3769,13 +3771,13 @@ var cronstrueI18n = {exports: {}};
|
|
|
3769
3771
|
return "1시간마다";
|
|
3770
3772
|
};
|
|
3771
3773
|
ko.prototype.atSpace = function () {
|
|
3772
|
-
return "
|
|
3774
|
+
return "에서 ";
|
|
3773
3775
|
};
|
|
3774
3776
|
ko.prototype.everyMinuteBetweenX0AndX1 = function () {
|
|
3775
3777
|
return "%s 및 %s 사이에 매 분";
|
|
3776
3778
|
};
|
|
3777
3779
|
ko.prototype.at = function () {
|
|
3778
|
-
return "
|
|
3780
|
+
return "에서";
|
|
3779
3781
|
};
|
|
3780
3782
|
ko.prototype.spaceAnd = function () {
|
|
3781
3783
|
return " 및";
|
|
@@ -3820,7 +3822,7 @@ var cronstrueI18n = {exports: {}};
|
|
|
3820
3822
|
return ", %s에서 %s까지";
|
|
3821
3823
|
};
|
|
3822
3824
|
ko.prototype.commaAndX0ThroughX1 = function () {
|
|
3823
|
-
return ",
|
|
3825
|
+
return ", 및%s에서 %s까지";
|
|
3824
3826
|
};
|
|
3825
3827
|
ko.prototype.first = function () {
|
|
3826
3828
|
return "첫 번째";
|
|
@@ -5946,194 +5948,6 @@ var cronstrueI18n = {exports: {}};
|
|
|
5946
5948
|
exports.sw = sw;
|
|
5947
5949
|
|
|
5948
5950
|
|
|
5949
|
-
/***/ }),
|
|
5950
|
-
|
|
5951
|
-
/***/ 312:
|
|
5952
|
-
/***/ ((__unused_webpack_module, exports) => {
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
5956
|
-
exports.th = void 0;
|
|
5957
|
-
var th = (function () {
|
|
5958
|
-
function th() {
|
|
5959
|
-
}
|
|
5960
|
-
th.prototype.atX0SecondsPastTheMinuteGt20 = function () {
|
|
5961
|
-
return null;
|
|
5962
|
-
};
|
|
5963
|
-
th.prototype.atX0MinutesPastTheHourGt20 = function () {
|
|
5964
|
-
return null;
|
|
5965
|
-
};
|
|
5966
|
-
th.prototype.commaMonthX0ThroughMonthX1 = function () {
|
|
5967
|
-
return null;
|
|
5968
|
-
};
|
|
5969
|
-
th.prototype.commaYearX0ThroughYearX1 = function () {
|
|
5970
|
-
return null;
|
|
5971
|
-
};
|
|
5972
|
-
th.prototype.use24HourTimeFormatByDefault = function () {
|
|
5973
|
-
return false;
|
|
5974
|
-
};
|
|
5975
|
-
th.prototype.anErrorOccuredWhenGeneratingTheExpressionD = function () {
|
|
5976
|
-
return "เกิดข้อผิดพลาดขณะสร้างคำอธิบายนิพจน์ ตรวจสอบไวยากรณ์นิพจน์ครอน";
|
|
5977
|
-
};
|
|
5978
|
-
th.prototype.everyMinute = function () {
|
|
5979
|
-
return "ทุกๆ นาที";
|
|
5980
|
-
};
|
|
5981
|
-
th.prototype.everyHour = function () {
|
|
5982
|
-
return "ทุกๆ ชั่วโมง";
|
|
5983
|
-
};
|
|
5984
|
-
th.prototype.atSpace = function () {
|
|
5985
|
-
return "เมื่อ ";
|
|
5986
|
-
};
|
|
5987
|
-
th.prototype.everyMinuteBetweenX0AndX1 = function () {
|
|
5988
|
-
return "ทุกๆ นาที %s และ %s";
|
|
5989
|
-
};
|
|
5990
|
-
th.prototype.at = function () {
|
|
5991
|
-
return "เมื่อ";
|
|
5992
|
-
};
|
|
5993
|
-
th.prototype.spaceAnd = function () {
|
|
5994
|
-
return " และ";
|
|
5995
|
-
};
|
|
5996
|
-
th.prototype.everySecond = function () {
|
|
5997
|
-
return "ทุกๆ วินาที";
|
|
5998
|
-
};
|
|
5999
|
-
th.prototype.everyX0Seconds = function () {
|
|
6000
|
-
return "ทุกๆ %s วินาที";
|
|
6001
|
-
};
|
|
6002
|
-
th.prototype.secondsX0ThroughX1PastTheMinute = function () {
|
|
6003
|
-
return "วินาที %s ถึง %s นาทีที่ผ่านมา";
|
|
6004
|
-
};
|
|
6005
|
-
th.prototype.atX0SecondsPastTheMinute = function () {
|
|
6006
|
-
return "เมื่อ %s วินาที นาทีที่ผ่านมา";
|
|
6007
|
-
};
|
|
6008
|
-
th.prototype.everyX0Minutes = function () {
|
|
6009
|
-
return "ทุกๆ %s นาที";
|
|
6010
|
-
};
|
|
6011
|
-
th.prototype.minutesX0ThroughX1PastTheHour = function () {
|
|
6012
|
-
return "นาที %s ถึง %s ชั่วโมงที่ผ่านมา";
|
|
6013
|
-
};
|
|
6014
|
-
th.prototype.atX0MinutesPastTheHour = function () {
|
|
6015
|
-
return "เมื่อ %s นาที ชั่วโมงที่ผ่านมา";
|
|
6016
|
-
};
|
|
6017
|
-
th.prototype.everyX0Hours = function () {
|
|
6018
|
-
return "ทุกๆ %s ชั่วโมง";
|
|
6019
|
-
};
|
|
6020
|
-
th.prototype.betweenX0AndX1 = function () {
|
|
6021
|
-
return "ระหว่าง %s ถึง %s";
|
|
6022
|
-
};
|
|
6023
|
-
th.prototype.atX0 = function () {
|
|
6024
|
-
return "เมื่อ %s";
|
|
6025
|
-
};
|
|
6026
|
-
th.prototype.commaEveryDay = function () {
|
|
6027
|
-
return ", ทุกๆ วัน";
|
|
6028
|
-
};
|
|
6029
|
-
th.prototype.commaEveryX0DaysOfTheWeek = function () {
|
|
6030
|
-
return ", ทุกๆ %s วันของสัปดาห์";
|
|
6031
|
-
};
|
|
6032
|
-
th.prototype.commaX0ThroughX1 = function () {
|
|
6033
|
-
return ", %s ถึง %s";
|
|
6034
|
-
};
|
|
6035
|
-
th.prototype.commaAndX0ThroughX1 = function () {
|
|
6036
|
-
return ", %s ถึง %s";
|
|
6037
|
-
};
|
|
6038
|
-
th.prototype.first = function () {
|
|
6039
|
-
return "แรก";
|
|
6040
|
-
};
|
|
6041
|
-
th.prototype.second = function () {
|
|
6042
|
-
return "ที่สอง";
|
|
6043
|
-
};
|
|
6044
|
-
th.prototype.third = function () {
|
|
6045
|
-
return "ที่สาม";
|
|
6046
|
-
};
|
|
6047
|
-
th.prototype.fourth = function () {
|
|
6048
|
-
return "ที่สี่";
|
|
6049
|
-
};
|
|
6050
|
-
th.prototype.fifth = function () {
|
|
6051
|
-
return "ที่ห้า";
|
|
6052
|
-
};
|
|
6053
|
-
th.prototype.commaOnThe = function () {
|
|
6054
|
-
return ", ในวัน ";
|
|
6055
|
-
};
|
|
6056
|
-
th.prototype.spaceX0OfTheMonth = function () {
|
|
6057
|
-
return " %s ของเดือน";
|
|
6058
|
-
};
|
|
6059
|
-
th.prototype.lastDay = function () {
|
|
6060
|
-
return "วันสุดท้าย";
|
|
6061
|
-
};
|
|
6062
|
-
th.prototype.commaOnTheLastX0OfTheMonth = function () {
|
|
6063
|
-
return ", ณ สุดท้าย %s ของเดือน";
|
|
6064
|
-
};
|
|
6065
|
-
th.prototype.commaOnlyOnX0 = function () {
|
|
6066
|
-
return ", เท่านั้น %s";
|
|
6067
|
-
};
|
|
6068
|
-
th.prototype.commaAndOnX0 = function () {
|
|
6069
|
-
return ", และใน %s";
|
|
6070
|
-
};
|
|
6071
|
-
th.prototype.commaEveryX0Months = function () {
|
|
6072
|
-
return ", ทุกๆ %s เดือน";
|
|
6073
|
-
};
|
|
6074
|
-
th.prototype.commaOnlyInX0 = function () {
|
|
6075
|
-
return ", เท่านั้น %s";
|
|
6076
|
-
};
|
|
6077
|
-
th.prototype.commaOnTheLastDayOfTheMonth = function () {
|
|
6078
|
-
return ", ในวันสิ้นเดือน";
|
|
6079
|
-
};
|
|
6080
|
-
th.prototype.commaOnTheLastWeekdayOfTheMonth = function () {
|
|
6081
|
-
return ", ในวันธรรมดาสุดท้ายของเดือน";
|
|
6082
|
-
};
|
|
6083
|
-
th.prototype.commaDaysBeforeTheLastDayOfTheMonth = function () {
|
|
6084
|
-
return ", %s วันก่อนวันสุดท้ายของเดือน";
|
|
6085
|
-
};
|
|
6086
|
-
th.prototype.firstWeekday = function () {
|
|
6087
|
-
return "วันธรรมดาวันแรก";
|
|
6088
|
-
};
|
|
6089
|
-
th.prototype.weekdayNearestDayX0 = function () {
|
|
6090
|
-
return "วันธรรมดาที่ใกล้ที่สุด %s";
|
|
6091
|
-
};
|
|
6092
|
-
th.prototype.commaOnTheX0OfTheMonth = function () {
|
|
6093
|
-
return ", ในวัน %s ของเดือน";
|
|
6094
|
-
};
|
|
6095
|
-
th.prototype.commaEveryX0Days = function () {
|
|
6096
|
-
return ", ทุกๆ %s วัน";
|
|
6097
|
-
};
|
|
6098
|
-
th.prototype.commaBetweenDayX0AndX1OfTheMonth = function () {
|
|
6099
|
-
return ", ระหว่างวัน %s และ %s ของเดือน";
|
|
6100
|
-
};
|
|
6101
|
-
th.prototype.commaOnDayX0OfTheMonth = function () {
|
|
6102
|
-
return ", ในวัน %s ของเดือน";
|
|
6103
|
-
};
|
|
6104
|
-
th.prototype.commaEveryHour = function () {
|
|
6105
|
-
return ", ทุกๆ ชั่วโมง";
|
|
6106
|
-
};
|
|
6107
|
-
th.prototype.commaEveryX0Years = function () {
|
|
6108
|
-
return ", ทุกๆ %s ปี";
|
|
6109
|
-
};
|
|
6110
|
-
th.prototype.commaStartingX0 = function () {
|
|
6111
|
-
return ", เริ่ม %s";
|
|
6112
|
-
};
|
|
6113
|
-
th.prototype.daysOfTheWeek = function () {
|
|
6114
|
-
return ["วันอาทิตย์", "วันจันทร์", "วันอังคาร", "วันพุธ", "วันพฤหัสบดี", "วันศุกร์", "วันเสาร์"];
|
|
6115
|
-
};
|
|
6116
|
-
th.prototype.monthsOfTheYear = function () {
|
|
6117
|
-
return [
|
|
6118
|
-
"มกราคม",
|
|
6119
|
-
"กุมภาพันธ์",
|
|
6120
|
-
"มีนาคม",
|
|
6121
|
-
"เมษายน",
|
|
6122
|
-
"พฤษภาคม",
|
|
6123
|
-
"มิถุนายน",
|
|
6124
|
-
"กรกฎาคม",
|
|
6125
|
-
"สิงหาคม",
|
|
6126
|
-
"กันยายน",
|
|
6127
|
-
"ตุลาคม",
|
|
6128
|
-
"พฤศจิกายน",
|
|
6129
|
-
"ธันวาคม",
|
|
6130
|
-
];
|
|
6131
|
-
};
|
|
6132
|
-
return th;
|
|
6133
|
-
}());
|
|
6134
|
-
exports.th = th;
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
5951
|
/***/ }),
|
|
6138
5952
|
|
|
6139
5953
|
/***/ 999:
|
|
@@ -7045,34 +6859,34 @@ const MinutesCron = (props) => {
|
|
|
7045
6859
|
}
|
|
7046
6860
|
};
|
|
7047
6861
|
const value = props.value[1].split('/')[1];
|
|
7048
|
-
return (jsxs("div", Object.assign({ className: "well" }, { children: [props.translate('Every'), " ", jsx("input", { type: "Number", onChange: onChange, value: value, min: 1, max: 60 }), " ", props.translate('minute(s)')] })));
|
|
6862
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: "well" }, { children: [props.translate('Every'), " ", jsxRuntime.jsx("input", { type: "Number", onChange: onChange, value: value, min: 1, max: 60 }), " ", props.translate('minute(s)')] })));
|
|
7049
6863
|
};
|
|
7050
6864
|
|
|
7051
6865
|
const MinutesSelect = (props) => {
|
|
7052
6866
|
const buildOptions = () => {
|
|
7053
6867
|
let options = [];
|
|
7054
6868
|
for (let i = 0; i < 60; i++) {
|
|
7055
|
-
options.push(jsx("option", Object.assign({ id: i.toString() }, { children: (i < 10 ? '0' : '') + i }), i));
|
|
6869
|
+
options.push(jsxRuntime.jsx("option", Object.assign({ id: i.toString() }, { children: (i < 10 ? '0' : '') + i }), i));
|
|
7056
6870
|
}
|
|
7057
6871
|
return options;
|
|
7058
6872
|
};
|
|
7059
|
-
return (jsx("select", Object.assign({ disabled: props.disabled === true ? true : false, className: "minutes", onChange: props.onChange, value: props.value }, { children: buildOptions() })));
|
|
6873
|
+
return (jsxRuntime.jsx("select", Object.assign({ disabled: props.disabled === true ? true : false, className: "minutes", onChange: props.onChange, value: props.value }, { children: buildOptions() })));
|
|
7060
6874
|
};
|
|
7061
6875
|
|
|
7062
6876
|
const HourSelect = (props) => {
|
|
7063
6877
|
const buildOptions = () => {
|
|
7064
6878
|
let options = [];
|
|
7065
6879
|
for (let i = 0; i < 24; i++) {
|
|
7066
|
-
options.push(jsx("option", Object.assign({ id: i.toString() }, { children: (i < 10 ? '0' : '') + i }), i));
|
|
6880
|
+
options.push(jsxRuntime.jsx("option", Object.assign({ id: i.toString() }, { children: (i < 10 ? '0' : '') + i }), i));
|
|
7067
6881
|
}
|
|
7068
6882
|
return options;
|
|
7069
6883
|
};
|
|
7070
|
-
return (jsx("select", Object.assign({ disabled: props.disabled === true ? true : false, className: "hours", onChange: props.onChange, value: props.value }, { children: buildOptions() })));
|
|
6884
|
+
return (jsxRuntime.jsx("select", Object.assign({ disabled: props.disabled === true ? true : false, className: "hours", onChange: props.onChange, value: props.value }, { children: buildOptions() })));
|
|
7071
6885
|
};
|
|
7072
6886
|
|
|
7073
6887
|
const DailyCron = (props) => {
|
|
7074
|
-
const [state, setState] = useState({ hour: 0, minute: 0, every: false });
|
|
7075
|
-
useEffect(() => {
|
|
6888
|
+
const [state, setState] = react.useState({ hour: 0, minute: 0, every: false });
|
|
6889
|
+
react.useEffect(() => {
|
|
7076
6890
|
setState(Object.assign(Object.assign({}, state), { every: props.value[3] !== '?' }));
|
|
7077
6891
|
}, []);
|
|
7078
6892
|
const onDayChange = (e) => {
|
|
@@ -7093,12 +6907,12 @@ const DailyCron = (props) => {
|
|
|
7093
6907
|
props.onChange(val);
|
|
7094
6908
|
};
|
|
7095
6909
|
const translateFn = props.translate;
|
|
7096
|
-
return (jsxs("div", Object.assign({ className: "tab-pane" }, { children: [jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { type: "radio", onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: true })); props.onChange(); }, value: "1", name: "DailyRadio", checked: state.every }), jsx("span", { children: translateFn('Every') }), jsx("input", { disabled: !state.every, type: "Number", maxLength: 2, onChange: onDayChange, value: props.value[3].split('/')[1] ? props.value[3].split('/')[1] : '' }), jsx("span", { children: translateFn('day(s)') })] })), jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: false })); props.onChange(['0', props.value[1], props.value[2], '?', '*', 'MON-FRI', '*']); }, type: "radio", value: "2", name: "DailyRadio", checked: !state.every }), jsx("span", { children: translateFn('Every week day') })] })), jsx("span", { children: translateFn('Start time') }), jsx(HourSelect, { onChange: onAtHourChange, value: props.value[2] }), jsx(MinutesSelect, { onChange: onAtMinuteChange, value: props.value[1] })] })));
|
|
6910
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: "tab-pane" }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsxRuntime.jsx("input", { type: "radio", onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: true })); props.onChange(); }, value: "1", name: "DailyRadio", checked: state.every }), jsxRuntime.jsx("span", { children: translateFn('Every') }), jsxRuntime.jsx("input", { disabled: !state.every, type: "Number", maxLength: 2, onChange: onDayChange, value: props.value[3].split('/')[1] ? props.value[3].split('/')[1] : '' }), jsxRuntime.jsx("span", { children: translateFn('day(s)') })] })), jsxRuntime.jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsxRuntime.jsx("input", { onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: false })); props.onChange(['0', props.value[1], props.value[2], '?', '*', 'MON-FRI', '*']); }, type: "radio", value: "2", name: "DailyRadio", checked: !state.every }), jsxRuntime.jsx("span", { children: translateFn('Every week day') })] })), jsxRuntime.jsx("span", { children: translateFn('Start time') }), jsxRuntime.jsx(HourSelect, { onChange: onAtHourChange, value: props.value[2] }), jsxRuntime.jsx(MinutesSelect, { onChange: onAtMinuteChange, value: props.value[1] })] })));
|
|
7097
6911
|
};
|
|
7098
6912
|
|
|
7099
6913
|
const HourlyCron = (props) => {
|
|
7100
|
-
const [state, setState] = useState({ every: false });
|
|
7101
|
-
useEffect(() => {
|
|
6914
|
+
const [state, setState] = react.useState({ every: false });
|
|
6915
|
+
react.useEffect(() => {
|
|
7102
6916
|
if (props.value[2].split('/')[1] || props.value[2] === '*') {
|
|
7103
6917
|
setState(Object.assign(Object.assign({}, state), { every: true }));
|
|
7104
6918
|
}
|
|
@@ -7132,7 +6946,7 @@ const HourlyCron = (props) => {
|
|
|
7132
6946
|
props.onChange(val);
|
|
7133
6947
|
};
|
|
7134
6948
|
const translateFn = props.translate;
|
|
7135
|
-
return (jsx("div", Object.assign({ className: "tab-content" }, { children: jsxs("div", Object.assign({ className: "tab-pane active" }, { children: [jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { type: "radio", onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: true })); props.onChange(['0', '0', '0/1', '1/1', '*', '?', '*']); }, checked: state.every }), jsxs("span", { children: [translateFn('Every'), " "] }), jsx("input", { disabled: !state.every, type: "Number", onChange: onHourChange, value: props.value[2].split('/')[1] ? props.value[2].split('/')[1] : '' }), jsx("span", { children: translateFn('hour') }), jsx("input", { disabled: !state.every, type: "Number", onChange: onMinuteChange, value: props.value[1] }), jsx("span", { children: translateFn('minutes(s)') })] })), jsx("div", Object.assign({ className: "well well-small margin-right-0 margin-left-0" }, { children: jsxs("div", Object.assign({ className: "text_align_right", style: { width: '100%' } }, { children: [jsx("input", { type: "radio", onChange: (e) => { setState({ every: false }); props.onChange(); }, checked: !state.every }), jsx("span", Object.assign({ className: "" }, { children: translateFn('At') })), jsx(HourSelect, { disabled: state.every, onChange: onAtHourChange, value: props.value[2] }), jsx(MinutesSelect, { disabled: state.every, onChange: onAtMinuteChange, value: props.value[1] })] })) }))] })) })));
|
|
6949
|
+
return (jsxRuntime.jsx("div", Object.assign({ className: "tab-content" }, { children: jsxRuntime.jsxs("div", Object.assign({ className: "tab-pane active" }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsxRuntime.jsx("input", { type: "radio", onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: true })); props.onChange(['0', '0', '0/1', '1/1', '*', '?', '*']); }, checked: state.every }), jsxRuntime.jsxs("span", { children: [translateFn('Every'), " "] }), jsxRuntime.jsx("input", { disabled: !state.every, type: "Number", onChange: onHourChange, value: props.value[2].split('/')[1] ? props.value[2].split('/')[1] : '' }), jsxRuntime.jsx("span", { children: translateFn('hour') }), jsxRuntime.jsx("input", { disabled: !state.every, type: "Number", onChange: onMinuteChange, value: props.value[1] }), jsxRuntime.jsx("span", { children: translateFn('minutes(s)') })] })), jsxRuntime.jsx("div", Object.assign({ className: "well well-small margin-right-0 margin-left-0" }, { children: jsxRuntime.jsxs("div", Object.assign({ className: "text_align_right", style: { width: '100%' } }, { children: [jsxRuntime.jsx("input", { type: "radio", onChange: (e) => { setState({ every: false }); props.onChange(); }, checked: !state.every }), jsxRuntime.jsx("span", Object.assign({ className: "" }, { children: translateFn('At') })), jsxRuntime.jsx(HourSelect, { disabled: state.every, onChange: onAtHourChange, value: props.value[2] }), jsxRuntime.jsx(MinutesSelect, { disabled: state.every, onChange: onAtMinuteChange, value: props.value[1] })] })) }))] })) })));
|
|
7136
6950
|
};
|
|
7137
6951
|
|
|
7138
6952
|
const WeeklyCron = (props) => {
|
|
@@ -7182,12 +6996,12 @@ const WeeklyCron = (props) => {
|
|
|
7182
6996
|
val[5] = valFive;
|
|
7183
6997
|
};
|
|
7184
6998
|
const translateFn = props.translate;
|
|
7185
|
-
return (jsxs("div", Object.assign({ className: "container-fluid" }, { children: [jsxs("div", Object.assign({ className: "well well-small row" }, { children: [jsx("div", Object.assign({ className: "span6 col-sm-6" }, { children: jsxs("div", Object.assign({ className: "text_align_left" }, { children: [jsx("input", { type: "checkbox", value: "MON", onChange: onCheck, checked: (props.value[5].search('MON') !== -1) ? true : false }), translateFn('Monday'), jsx("br", {}), jsx("input", { type: "checkbox", value: "WED", onChange: onCheck, checked: props.value[5].search('WED') !== -1 ? true : false }), translateFn('Wednesday'), jsx("br", {}), jsx("input", { type: "checkbox", value: "FRI", onChange: onCheck, checked: (props.value[5].search('FRI') !== -1) ? true : false }), translateFn('Friday'), jsx("br", {}), jsx("input", { type: "checkbox", value: "SUN", onChange: onCheck, checked: props.value[5].search('SUN') !== -1 ? true : false }), translateFn('Sunday')] })) })), jsxs("div", Object.assign({ className: "span6 col-sm-6" }, { children: [jsxs("div", Object.assign({ className: "text_align_left" }, { children: [jsx("input", { type: "checkbox", value: "TUE", onChange: onCheck, checked: props.value[5].search('TUE') !== -1 ? true : false }), translateFn('Tuesday'), jsx("br", {}), jsx("input", { type: "checkbox", value: "THU", onChange: onCheck, checked: props.value[5].search('THU') !== -1 ? true : false }), translateFn('Thursday'), jsx("br", {}), jsx("input", { type: "checkbox", value: "SAT", onChange: onCheck, checked: props.value[5].search('SAT') !== -1 ? true : false }), translateFn('Saturday')] })), jsx("br", {}), jsx("br", {})] }))] })), translateFn('Start time'), jsx(HourSelect, { onChange: onAtHourChange, value: props.value[2] }), jsx(MinutesSelect, { onChange: onAtMinuteChange, value: props.value[1] })] })));
|
|
6999
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: "container-fluid" }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: "well well-small row" }, { children: [jsxRuntime.jsx("div", Object.assign({ className: "span6 col-sm-6" }, { children: jsxRuntime.jsxs("div", Object.assign({ className: "text_align_left" }, { children: [jsxRuntime.jsx("input", { type: "checkbox", value: "MON", onChange: onCheck, checked: (props.value[5].search('MON') !== -1) ? true : false }), translateFn('Monday'), jsxRuntime.jsx("br", {}), jsxRuntime.jsx("input", { type: "checkbox", value: "WED", onChange: onCheck, checked: props.value[5].search('WED') !== -1 ? true : false }), translateFn('Wednesday'), jsxRuntime.jsx("br", {}), jsxRuntime.jsx("input", { type: "checkbox", value: "FRI", onChange: onCheck, checked: (props.value[5].search('FRI') !== -1) ? true : false }), translateFn('Friday'), jsxRuntime.jsx("br", {}), jsxRuntime.jsx("input", { type: "checkbox", value: "SUN", onChange: onCheck, checked: props.value[5].search('SUN') !== -1 ? true : false }), translateFn('Sunday')] })) })), jsxRuntime.jsxs("div", Object.assign({ className: "span6 col-sm-6" }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: "text_align_left" }, { children: [jsxRuntime.jsx("input", { type: "checkbox", value: "TUE", onChange: onCheck, checked: props.value[5].search('TUE') !== -1 ? true : false }), translateFn('Tuesday'), jsxRuntime.jsx("br", {}), jsxRuntime.jsx("input", { type: "checkbox", value: "THU", onChange: onCheck, checked: props.value[5].search('THU') !== -1 ? true : false }), translateFn('Thursday'), jsxRuntime.jsx("br", {}), jsxRuntime.jsx("input", { type: "checkbox", value: "SAT", onChange: onCheck, checked: props.value[5].search('SAT') !== -1 ? true : false }), translateFn('Saturday')] })), jsxRuntime.jsx("br", {}), jsxRuntime.jsx("br", {})] }))] })), translateFn('Start time'), jsxRuntime.jsx(HourSelect, { onChange: onAtHourChange, value: props.value[2] }), jsxRuntime.jsx(MinutesSelect, { onChange: onAtMinuteChange, value: props.value[1] })] })));
|
|
7186
7000
|
};
|
|
7187
7001
|
|
|
7188
7002
|
const MonthlyCron = (props) => {
|
|
7189
|
-
const [state, setState] = useState({ hour: 0, minute: 0, every: "" });
|
|
7190
|
-
useEffect(() => {
|
|
7003
|
+
const [state, setState] = react.useState({ hour: 0, minute: 0, every: "" });
|
|
7004
|
+
react.useEffect(() => {
|
|
7191
7005
|
let every;
|
|
7192
7006
|
if (props.value[3] === 'L') {
|
|
7193
7007
|
every = "2";
|
|
@@ -7233,7 +7047,7 @@ const MonthlyCron = (props) => {
|
|
|
7233
7047
|
props.onChange(val);
|
|
7234
7048
|
};
|
|
7235
7049
|
const translateFn = props.translate;
|
|
7236
|
-
return (jsxs("div", Object.assign({ className: "tab-pane" }, { children: [jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { type: "radio", onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: e.target.value })); props.onChange(['0', props.value[1] === '*' ? '0' : props.value[1], props.value[2] === '*' ? '0' : props.value[2], '1', '1/1', '?', '*']); }, value: "1", name: "MonthlyRadio", checked: state.every === "1" ? true : false }), translateFn('Day'), jsx("input", { readOnly: state.every !== "1", type: "number", value: props.value[3], onChange: onDayChange }), translateFn('of every month(s)')] })), jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: e.target.value })); props.onChange(['0', props.value[1] === '*' ? '0' : props.value[1], props.value[2] === '*' ? '0' : props.value[2], 'L', '*', '?', '*']); }, type: "radio", value: "2", name: "DailyRadio", checked: state.every === "2" ? true : false }), translateFn('Last day of every month')] })), jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: e.target.value })); props.onChange(['0', props.value[1] === '*' ? '0' : props.value[1], props.value[2] === '*' ? '0' : props.value[2], 'LW', '*', '?', '*']); }, type: "radio", value: "3", name: "DailyRadio", checked: state.every === "3" ? true : false }), translateFn('On the last weekday of every month')] })), jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { type: "radio", onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: e.target.value })); props.onChange(['0', props.value[1] === '*' ? '0' : props.value[1], props.value[2] === '*' ? '0' : props.value[2], `L-${1}`, '*', '?', '*']); }, value: "4", name: "MonthlyRadio", checked: state.every === "4" ? true : false }), jsx("input", { readOnly: state.every !== "4", type: "number", value: props.value[3].split('-').length && props.value[3].split('-')[1] ? props.value[3].split('-')[1] : '', onChange: onLastDayChange }), translateFn('day(s) before the end of the month')] })), translateFn('Start time'), jsx(HourSelect, { onChange: onAtHourChange, value: props.value[2] }), jsx(MinutesSelect, { onChange: onAtMinuteChange, value: props.value[1] })] })));
|
|
7050
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: "tab-pane" }, { children: [jsxRuntime.jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsxRuntime.jsx("input", { type: "radio", onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: e.target.value })); props.onChange(['0', props.value[1] === '*' ? '0' : props.value[1], props.value[2] === '*' ? '0' : props.value[2], '1', '1/1', '?', '*']); }, value: "1", name: "MonthlyRadio", checked: state.every === "1" ? true : false }), translateFn('Day'), jsxRuntime.jsx("input", { readOnly: state.every !== "1", type: "number", value: props.value[3], onChange: onDayChange }), translateFn('of every month(s)')] })), jsxRuntime.jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsxRuntime.jsx("input", { onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: e.target.value })); props.onChange(['0', props.value[1] === '*' ? '0' : props.value[1], props.value[2] === '*' ? '0' : props.value[2], 'L', '*', '?', '*']); }, type: "radio", value: "2", name: "DailyRadio", checked: state.every === "2" ? true : false }), translateFn('Last day of every month')] })), jsxRuntime.jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsxRuntime.jsx("input", { onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: e.target.value })); props.onChange(['0', props.value[1] === '*' ? '0' : props.value[1], props.value[2] === '*' ? '0' : props.value[2], 'LW', '*', '?', '*']); }, type: "radio", value: "3", name: "DailyRadio", checked: state.every === "3" ? true : false }), translateFn('On the last weekday of every month')] })), jsxRuntime.jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsxRuntime.jsx("input", { type: "radio", onChange: (e) => { setState(Object.assign(Object.assign({}, state), { every: e.target.value })); props.onChange(['0', props.value[1] === '*' ? '0' : props.value[1], props.value[2] === '*' ? '0' : props.value[2], `L-${1}`, '*', '?', '*']); }, value: "4", name: "MonthlyRadio", checked: state.every === "4" ? true : false }), jsxRuntime.jsx("input", { readOnly: state.every !== "4", type: "number", value: props.value[3].split('-').length && props.value[3].split('-')[1] ? props.value[3].split('-')[1] : '', onChange: onLastDayChange }), translateFn('day(s) before the end of the month')] })), translateFn('Start time'), jsxRuntime.jsx(HourSelect, { onChange: onAtHourChange, value: props.value[2] }), jsxRuntime.jsx(MinutesSelect, { onChange: onAtMinuteChange, value: props.value[1] })] })));
|
|
7237
7051
|
};
|
|
7238
7052
|
|
|
7239
7053
|
const CustomCron = (props) => {
|
|
@@ -7242,7 +7056,7 @@ const CustomCron = (props) => {
|
|
|
7242
7056
|
};
|
|
7243
7057
|
const translateFn = props.translate;
|
|
7244
7058
|
let val = props.value.toString().replace(/,/g, ' ').replace(/!/g, ',');
|
|
7245
|
-
return (jsxs("div", Object.assign({ className: "well" }, { children: [translateFn('Expression'), " ", jsx("input", { type: "text", onChange: onChange, value: val })] })));
|
|
7059
|
+
return (jsxRuntime.jsxs("div", Object.assign({ className: "well" }, { children: [translateFn('Expression'), " ", jsxRuntime.jsx("input", { type: "text", onChange: onChange, value: val })] })));
|
|
7246
7060
|
};
|
|
7247
7061
|
|
|
7248
7062
|
const HEADER = {
|
|
@@ -7355,8 +7169,8 @@ styleInject(css_248z);
|
|
|
7355
7169
|
|
|
7356
7170
|
const defaultCron = '0 0 00 1/1 * ? *';
|
|
7357
7171
|
const Cron = (props) => {
|
|
7358
|
-
const [state, setState] = useState({ value: [], headers: loadHeaders(props.options), locale: props.locale ? props.locale : 'en' });
|
|
7359
|
-
useEffect(() => {
|
|
7172
|
+
const [state, setState] = react.useState({ value: [], headers: loadHeaders(props.options), locale: props.locale ? props.locale : 'en' });
|
|
7173
|
+
react.useEffect(() => {
|
|
7360
7174
|
setValue(props.value ? props.value : "");
|
|
7361
7175
|
if (props.translateFn && !props.locale) {
|
|
7362
7176
|
console.log('Warning !!! locale not set while using translateFn');
|
|
@@ -7365,7 +7179,7 @@ const Cron = (props) => {
|
|
|
7365
7179
|
// this.props.onRef(this);
|
|
7366
7180
|
// }
|
|
7367
7181
|
}, []);
|
|
7368
|
-
useEffect(() => {
|
|
7182
|
+
react.useEffect(() => {
|
|
7369
7183
|
let newVal = '';
|
|
7370
7184
|
newVal = state.value.toString().replace(/,/g, ' ');
|
|
7371
7185
|
newVal = newVal.replace(/!/g, ',');
|
|
@@ -7373,7 +7187,7 @@ const Cron = (props) => {
|
|
|
7373
7187
|
setValue(props.value ? props.value : "");
|
|
7374
7188
|
}
|
|
7375
7189
|
}, [props.value]);
|
|
7376
|
-
useEffect(() => {
|
|
7190
|
+
react.useEffect(() => {
|
|
7377
7191
|
parentChange(state.value);
|
|
7378
7192
|
}, [state.value]);
|
|
7379
7193
|
const setValue = (value) => {
|
|
@@ -7423,7 +7237,7 @@ const Cron = (props) => {
|
|
|
7423
7237
|
};
|
|
7424
7238
|
const getHeaders = () => {
|
|
7425
7239
|
return state.headers.map((d, index) => {
|
|
7426
|
-
return jsx("li", Object.assign({ className: "nav-item" }, { children: jsx("a", Object.assign({ className: `nav-link ${state.selectedTab === d ? 'active' : ''}`, onClick: () => tabChanged(d) }, { children: translate(d) })) }), index);
|
|
7240
|
+
return jsxRuntime.jsx("li", Object.assign({ className: "nav-item" }, { children: jsxRuntime.jsx("a", Object.assign({ className: `nav-link ${state.selectedTab === d ? 'active' : ''}`, onClick: () => tabChanged(d) }, { children: translate(d) })) }), index);
|
|
7427
7241
|
});
|
|
7428
7242
|
};
|
|
7429
7243
|
const onValueChange = (val) => {
|
|
@@ -7465,7 +7279,7 @@ const Cron = (props) => {
|
|
|
7465
7279
|
throw new Error('Value does not match any available headers.');
|
|
7466
7280
|
}
|
|
7467
7281
|
const CronComponent = selectedMetaData.component;
|
|
7468
|
-
return jsx(CronComponent, { translate: translate, value: state.value, onChange: onValueChange });
|
|
7282
|
+
return jsxRuntime.jsx(CronComponent, { translate: translate, value: state.value, onChange: onValueChange });
|
|
7469
7283
|
};
|
|
7470
7284
|
const translate = (key) => {
|
|
7471
7285
|
let translatedText = key;
|
|
@@ -7477,19 +7291,6 @@ const Cron = (props) => {
|
|
|
7477
7291
|
}
|
|
7478
7292
|
return translatedText;
|
|
7479
7293
|
};
|
|
7480
|
-
return (jsxs("div", Object.assign({ className: 'cron_builder' }, { children: [jsx("ul", Object.assign({ className: "nav nav-tabs" }, { children: getHeaders() })), jsx("div", Object.assign({ className: "cron_builder_bordering" }, { children: state.selectedTab ? getComponent(state.selectedTab) : "Select a header" })), props.showResultText && jsx("div", Object.assign({ className: "cron-builder-bg" }, { children: getVal() })), props.showResultCron && jsx("div", Object.assign({ className: "cron-builder-bg" }, { children: state.value.toString().replace(/,/g, ' ').replace(/!/g, ',') }))] })));
|
|
7481
|
-
};
|
|
7482
|
-
|
|
7483
|
-
export { HEADER, Cron as default };
|
|
7484
|
-
//# sourceMappingURL=index.js.map
|
|
7485
|
-
|
|
7486
|
-
translatedText = props.translateFn(key);
|
|
7487
|
-
if (typeof translatedText !== 'string') {
|
|
7488
|
-
throw new Error('translateFn expects a string translation');
|
|
7489
|
-
}
|
|
7490
|
-
}
|
|
7491
|
-
return translatedText;
|
|
7492
|
-
};
|
|
7493
7294
|
return (jsxRuntime.jsxs("div", Object.assign({ className: 'cron_builder' }, { children: [jsxRuntime.jsx("ul", Object.assign({ className: "nav nav-tabs" }, { children: getHeaders() })), jsxRuntime.jsx("div", Object.assign({ className: "cron_builder_bordering" }, { children: state.selectedTab ? getComponent(state.selectedTab) : "Select a header" })), props.showResultText && jsxRuntime.jsx("div", Object.assign({ className: "cron-builder-bg" }, { children: getVal() })), props.showResultCron && jsxRuntime.jsx("div", Object.assign({ className: "cron-builder-bg" }, { children: state.value.toString().replace(/,/g, ' ').replace(/!/g, ',') }))] })));
|
|
7494
7295
|
};
|
|
7495
7296
|
|