react-cron-generator 2.0.1 → 2.0.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/build/index.js CHANGED
@@ -1,9 +1,5 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useState, useEffect } from 'react';
7
3
 
8
4
  var cronstrueI18n = {exports: {}};
9
5
 
@@ -669,7 +665,7 @@ var cronstrueI18n = {exports: {}};
669
665
 
670
666
 
671
667
  Object.defineProperty(exports, "__esModule", ({ value: true }));
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;
668
+ exports.th = 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;
673
669
  var en_1 = __webpack_require__(751);
674
670
  Object.defineProperty(exports, "en", ({ enumerable: true, get: function () { return en_1.en; } }));
675
671
  var da_1 = __webpack_require__(904);
@@ -734,6 +730,8 @@ var cronstrueI18n = {exports: {}};
734
730
  Object.defineProperty(exports, "hu", ({ enumerable: true, get: function () { return hu_1.hu; } }));
735
731
  var af_1 = __webpack_require__(675);
736
732
  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; } }));
737
735
 
738
736
 
739
737
  /***/ }),
@@ -3771,13 +3769,13 @@ var cronstrueI18n = {exports: {}};
3771
3769
  return "1시간마다";
3772
3770
  };
3773
3771
  ko.prototype.atSpace = function () {
3774
- return "에서 ";
3772
+ return "시간 ";
3775
3773
  };
3776
3774
  ko.prototype.everyMinuteBetweenX0AndX1 = function () {
3777
3775
  return "%s 및 %s 사이에 매 분";
3778
3776
  };
3779
3777
  ko.prototype.at = function () {
3780
- return "에서";
3778
+ return "시간";
3781
3779
  };
3782
3780
  ko.prototype.spaceAnd = function () {
3783
3781
  return " 및";
@@ -3822,7 +3820,7 @@ var cronstrueI18n = {exports: {}};
3822
3820
  return ", %s에서 %s까지";
3823
3821
  };
3824
3822
  ko.prototype.commaAndX0ThroughX1 = function () {
3825
- return ", 및%s에서 %s까지";
3823
+ return ", 및 %s에서 %s까지";
3826
3824
  };
3827
3825
  ko.prototype.first = function () {
3828
3826
  return "첫 번째";
@@ -5948,6 +5946,194 @@ var cronstrueI18n = {exports: {}};
5948
5946
  exports.sw = sw;
5949
5947
 
5950
5948
 
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
+
5951
6137
  /***/ }),
5952
6138
 
5953
6139
  /***/ 999:
@@ -6859,34 +7045,34 @@ const MinutesCron = (props) => {
6859
7045
  }
6860
7046
  };
6861
7047
  const value = props.value[1].split('/')[1];
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)')] })));
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)')] })));
6863
7049
  };
6864
7050
 
6865
7051
  const MinutesSelect = (props) => {
6866
7052
  const buildOptions = () => {
6867
7053
  let options = [];
6868
7054
  for (let i = 0; i < 60; i++) {
6869
- options.push(jsxRuntime.jsx("option", Object.assign({ id: i.toString() }, { children: (i < 10 ? '0' : '') + i }), i));
7055
+ options.push(jsx("option", Object.assign({ id: i.toString() }, { children: (i < 10 ? '0' : '') + i }), i));
6870
7056
  }
6871
7057
  return options;
6872
7058
  };
6873
- return (jsxRuntime.jsx("select", Object.assign({ disabled: props.disabled === true ? true : false, className: "minutes", onChange: props.onChange, value: props.value }, { children: buildOptions() })));
7059
+ return (jsx("select", Object.assign({ disabled: props.disabled === true ? true : false, className: "minutes", onChange: props.onChange, value: props.value }, { children: buildOptions() })));
6874
7060
  };
6875
7061
 
6876
7062
  const HourSelect = (props) => {
6877
7063
  const buildOptions = () => {
6878
7064
  let options = [];
6879
7065
  for (let i = 0; i < 24; i++) {
6880
- options.push(jsxRuntime.jsx("option", Object.assign({ id: i.toString() }, { children: (i < 10 ? '0' : '') + i }), i));
7066
+ options.push(jsx("option", Object.assign({ id: i.toString() }, { children: (i < 10 ? '0' : '') + i }), i));
6881
7067
  }
6882
7068
  return options;
6883
7069
  };
6884
- return (jsxRuntime.jsx("select", Object.assign({ disabled: props.disabled === true ? true : false, className: "hours", onChange: props.onChange, value: props.value }, { children: buildOptions() })));
7070
+ return (jsx("select", Object.assign({ disabled: props.disabled === true ? true : false, className: "hours", onChange: props.onChange, value: props.value }, { children: buildOptions() })));
6885
7071
  };
6886
7072
 
6887
7073
  const DailyCron = (props) => {
6888
- const [state, setState] = react.useState({ hour: 0, minute: 0, every: false });
6889
- react.useEffect(() => {
7074
+ const [state, setState] = useState({ hour: 0, minute: 0, every: false });
7075
+ useEffect(() => {
6890
7076
  setState(Object.assign(Object.assign({}, state), { every: props.value[3] !== '?' }));
6891
7077
  }, []);
6892
7078
  const onDayChange = (e) => {
@@ -6907,12 +7093,12 @@ const DailyCron = (props) => {
6907
7093
  props.onChange(val);
6908
7094
  };
6909
7095
  const translateFn = props.translate;
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] })] })));
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] })] })));
6911
7097
  };
6912
7098
 
6913
7099
  const HourlyCron = (props) => {
6914
- const [state, setState] = react.useState({ every: false });
6915
- react.useEffect(() => {
7100
+ const [state, setState] = useState({ every: false });
7101
+ useEffect(() => {
6916
7102
  if (props.value[2].split('/')[1] || props.value[2] === '*') {
6917
7103
  setState(Object.assign(Object.assign({}, state), { every: true }));
6918
7104
  }
@@ -6946,7 +7132,7 @@ const HourlyCron = (props) => {
6946
7132
  props.onChange(val);
6947
7133
  };
6948
7134
  const translateFn = props.translate;
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] })] })) }))] })) })));
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('minute(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] })] })) }))] })) })));
6950
7136
  };
6951
7137
 
6952
7138
  const WeeklyCron = (props) => {
@@ -6996,12 +7182,12 @@ const WeeklyCron = (props) => {
6996
7182
  val[5] = valFive;
6997
7183
  };
6998
7184
  const translateFn = props.translate;
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] })] })));
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", { className: 'min_height_auto', type: "checkbox", value: "MON", onChange: onCheck, checked: (props.value[5].search('MON') !== -1) ? true : false }), translateFn('Monday'), jsx("br", {}), jsx("input", { className: 'min_height_auto', type: "checkbox", value: "WED", onChange: onCheck, checked: props.value[5].search('WED') !== -1 ? true : false }), translateFn('Wednesday'), jsx("br", {}), jsx("input", { className: 'min_height_auto', type: "checkbox", value: "FRI", onChange: onCheck, checked: (props.value[5].search('FRI') !== -1) ? true : false }), translateFn('Friday'), jsx("br", {}), jsx("input", { className: 'min_height_auto', 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", { className: 'min_height_auto', type: "checkbox", value: "TUE", onChange: onCheck, checked: props.value[5].search('TUE') !== -1 ? true : false }), translateFn('Tuesday'), jsx("br", {}), jsx("input", { className: 'min_height_auto', type: "checkbox", value: "THU", onChange: onCheck, checked: props.value[5].search('THU') !== -1 ? true : false }), translateFn('Thursday'), jsx("br", {}), jsx("input", { className: 'min_height_auto', 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] })] })));
7000
7186
  };
7001
7187
 
7002
7188
  const MonthlyCron = (props) => {
7003
- const [state, setState] = react.useState({ hour: 0, minute: 0, every: "" });
7004
- react.useEffect(() => {
7189
+ const [state, setState] = useState({ hour: 0, minute: 0, every: "" });
7190
+ useEffect(() => {
7005
7191
  let every;
7006
7192
  if (props.value[3] === 'L') {
7007
7193
  every = "2";
@@ -7047,7 +7233,7 @@ const MonthlyCron = (props) => {
7047
7233
  props.onChange(val);
7048
7234
  };
7049
7235
  const translateFn = props.translate;
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] })] })));
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] })] })));
7051
7237
  };
7052
7238
 
7053
7239
  const CustomCron = (props) => {
@@ -7056,7 +7242,7 @@ const CustomCron = (props) => {
7056
7242
  };
7057
7243
  const translateFn = props.translate;
7058
7244
  let val = props.value.toString().replace(/,/g, ' ').replace(/!/g, ',');
7059
- return (jsxRuntime.jsxs("div", Object.assign({ className: "well" }, { children: [translateFn('Expression'), " ", jsxRuntime.jsx("input", { type: "text", onChange: onChange, value: val })] })));
7245
+ return (jsxs("div", Object.assign({ className: "well" }, { children: [translateFn('Expression'), " ", jsx("input", { type: "text", onChange: onChange, value: val })] })));
7060
7246
  };
7061
7247
 
7062
7248
  const HEADER = {
@@ -7164,13 +7350,13 @@ function styleInject(css, ref) {
7164
7350
  }
7165
7351
  }
7166
7352
 
7167
- var css_248z = ".cron_builder_bordering {\n border: 1px solid #ddd;\n border-top: none;\n text-align: center;\n padding: 10px;\n background: #fff;\n}\n.cron_builder_bordering input, .cron_builder_bordering select {\n width: 100px;\n margin-right: 10px;\n margin-left: 10px;\n border: 1px solid #ddd;\n border-radius: 4px;\n outline: none;\n padding-left: 5px;\n}\n.df {\n display: flex;\n}\n.cron-builder-bg {\n background-color: #086090;\n color: white;\n text-align: center;\n margin-bottom: 4px;\n padding: 8px 0px;\n}\n.cron_builder_bordering select {\n background-color: white;\n width: 75px;\n cursor: pointer;\n padding: 4px 2px;\n border-radius: 4px;\n}\n.cron_builder_bordering select option:hover {\n background-color: #086090;\n}\n.well-small input {\n width: auto !important;\n}\n.cron_builder_bordering input[type='radio'] {\n margin-top: 0px;\n vertical-align: middle;\n}\n.cron_builder {\n border: 1px solid #d0cbcb;\n padding: 5px;\n background-color: #dddef13d;\n width: 100%;\n max-width: 600px;\n}\n.text_align_left {\n text-align: left;\n}\n.cron_builder .nav li {\n cursor: pointer;\n flex: 0 0 85px;\n text-align: center;\n}\n.cron_builder .nav li a {\n color:#337ab7;\n\n}\n.cron_builder .nav-tabs .nav-link:focus, .cron_builder .nav-tabs .nav-link:hover {\n border-color: transparent transparent transparent;\n background-color: #eeeeee;\n}\n.cron_builder .nav-tabs .nav-item.show .nav-link, .cron_builder .nav-tabs .nav-link.active {\n border-color: #dee2e6 #dee2e6 #fff;\n background-color: #ffffff;\n}\n.cron_builder { \n font-size: 14px;\n}\n.cron_builder .well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: #f5f5f5;\n border: 1px solid #e3e3e3;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 5%);\n box-shadow: inset 0 1px 1px rgb(0 0 0 / 5%);\n}\n@media screen and (max-width:767px) {\n .cron_builder .nav li {\n cursor: pointer;\n flex: 0 0 65px;\n text-align: center;\n }\n}";
7353
+ var css_248z = ".cron_builder_bordering {\n border: 1px solid #ddd;\n border-top: none;\n text-align: center;\n padding: 10px;\n background: #fff;\n}\n.cron_builder_bordering input, .cron_builder_bordering select {\n width: 100px;\n margin-right: 10px;\n margin-left: 10px;\n border: 1px solid #ddd;\n border-radius: 4px;\n outline: none;\n padding: 0px 5px;\n min-height: 28px;\n}\n.df {\n display: flex;\n}\n.cron-builder-bg {\n background-color: #086090;\n color: white;\n text-align: center;\n margin-bottom: 4px;\n padding: 8px 0px;\n}\n.cron_builder_bordering select {\n background-color: white;\n width: 75px;\n cursor: pointer;\n padding: 4px 2px;\n border-radius: 4px;\n}\n.cron_builder_bordering select option:hover {\n background-color: #086090;\n}\n.well-small input {\n width: auto !important;\n}\n.cron_builder_bordering input[type='radio'] {\n margin-top: 0px;\n vertical-align: middle;\n}\n.cron_builder {\n border: 1px solid #d0cbcb;\n padding: 5px;\n background-color: #dddef13d;\n width: 100%;\n max-width: 600px;\n}\n.text_align_left {\n text-align: left;\n}\n.cron_builder .nav li {\n cursor: pointer;\n flex: 1 1 10px;\n text-align: center;\n width: 10px;\n display: flex;\n padding: 0px 1px;\n}\n.cron_builder .nav li a {\n color:#337ab7;\n width: 100%;\n padding: 10px;\n display: inline-block;\n border-radius: 4px 4px 0px 0px;\n}\n.cron_builder .nav-tabs .nav-link:focus, .cron_builder .nav-tabs .nav-link:hover {\n border-color: transparent transparent transparent;\n background-color: #eeeeee;\n}\n.cron_builder .nav-tabs .nav-item.show .nav-link, .cron_builder .nav-tabs .nav-link.active {\n border-color: #dee2e6 #dee2e6 #fff;\n background-color: #ffffff;\n}\n.cron_builder { \n font-size: 14px;\n}\n.cron_builder .well {\n min-height: 20px;\n padding: 19px;\n margin-bottom: 20px;\n background-color: #f5f5f5;\n border: 1px solid #e3e3e3;\n border-radius: 4px;\n -webkit-box-shadow: inset 0 1px 1px rgb(0 0 0 / 5%);\n box-shadow: inset 0 1px 1px rgb(0 0 0 / 5%);\n}\n@media screen and (max-width:767px) {\n .cron_builder .nav li {\n cursor: pointer;\n flex: 0 0 65px;\n text-align: center;\n }\n}\n\n/* ---- boostrap ----- */\n.nav.nav-tabs {\n list-style: none;\n display: flex;\n margin: 0 0;\n padding-left: 0;\n}\n.row {\n display: flex;\n}\n.col-sm-6 {\n flex: 0 0 50%;\n}\n.min_height_auto {\n min-height: auto !important;\n}\nbody {\n font-family: -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";\n}";
7168
7354
  styleInject(css_248z);
7169
7355
 
7170
7356
  const defaultCron = '0 0 00 1/1 * ? *';
7171
7357
  const Cron = (props) => {
7172
- const [state, setState] = react.useState({ value: [], headers: loadHeaders(props.options), locale: props.locale ? props.locale : 'en' });
7173
- react.useEffect(() => {
7358
+ const [state, setState] = useState({ value: [], headers: loadHeaders(props.options), locale: props.locale ? props.locale : 'en' });
7359
+ useEffect(() => {
7174
7360
  setValue(props.value ? props.value : "");
7175
7361
  if (props.translateFn && !props.locale) {
7176
7362
  console.log('Warning !!! locale not set while using translateFn');
@@ -7179,7 +7365,7 @@ const Cron = (props) => {
7179
7365
  // this.props.onRef(this);
7180
7366
  // }
7181
7367
  }, []);
7182
- react.useEffect(() => {
7368
+ useEffect(() => {
7183
7369
  let newVal = '';
7184
7370
  newVal = state.value.toString().replace(/,/g, ' ');
7185
7371
  newVal = newVal.replace(/!/g, ',');
@@ -7187,7 +7373,7 @@ const Cron = (props) => {
7187
7373
  setValue(props.value ? props.value : "");
7188
7374
  }
7189
7375
  }, [props.value]);
7190
- react.useEffect(() => {
7376
+ useEffect(() => {
7191
7377
  parentChange(state.value);
7192
7378
  }, [state.value]);
7193
7379
  const setValue = (value) => {
@@ -7237,7 +7423,7 @@ const Cron = (props) => {
7237
7423
  };
7238
7424
  const getHeaders = () => {
7239
7425
  return state.headers.map((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);
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);
7241
7427
  });
7242
7428
  };
7243
7429
  const onValueChange = (val) => {
@@ -7279,7 +7465,7 @@ const Cron = (props) => {
7279
7465
  throw new Error('Value does not match any available headers.');
7280
7466
  }
7281
7467
  const CronComponent = selectedMetaData.component;
7282
- return jsxRuntime.jsx(CronComponent, { translate: translate, value: state.value, onChange: onValueChange });
7468
+ return jsx(CronComponent, { translate: translate, value: state.value, onChange: onValueChange });
7283
7469
  };
7284
7470
  const translate = (key) => {
7285
7471
  let translatedText = key;
@@ -7291,6 +7477,19 @@ const Cron = (props) => {
7291
7477
  }
7292
7478
  return translatedText;
7293
7479
  };
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
+ };
7294
7493
  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, ',') }))] })));
7295
7494
  };
7296
7495