react-cron-generator 2.0.13 → 2.0.15
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/monthly.d.ts +1 -1
- package/build/index.js +210 -31
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -2044,7 +2044,7 @@ var cronstrueI18n = {exports: {}};
|
|
|
2044
2044
|
return ", kun i %s";
|
|
2045
2045
|
};
|
|
2046
2046
|
da.prototype.commaOnlyOnX0 = function () {
|
|
2047
|
-
return ",
|
|
2047
|
+
return ", på %se";
|
|
2048
2048
|
};
|
|
2049
2049
|
da.prototype.commaAndOnX0 = function () {
|
|
2050
2050
|
return ", og på %s";
|
|
@@ -8006,12 +8006,22 @@ const DailyCron = (props) => {
|
|
|
8006
8006
|
val[cronPosition] = value;
|
|
8007
8007
|
props.onChange(val);
|
|
8008
8008
|
};
|
|
8009
|
+
const onClickEveryWeekDay = () => {
|
|
8010
|
+
if (props.disabled || !state.every) {
|
|
8011
|
+
return;
|
|
8012
|
+
}
|
|
8013
|
+
setState(Object.assign(Object.assign({}, state), { every: false }));
|
|
8014
|
+
props.onChange(['0', props.value[1], props.value[2], '?', '*', 'MON-FRI', '*']);
|
|
8015
|
+
};
|
|
8016
|
+
const onClickDailyRadio = () => {
|
|
8017
|
+
if (props.disabled || state.every) {
|
|
8018
|
+
return;
|
|
8019
|
+
}
|
|
8020
|
+
setState(Object.assign(Object.assign({}, state), { every: true }));
|
|
8021
|
+
props.onChange();
|
|
8022
|
+
};
|
|
8009
8023
|
const translateFn = props.translate;
|
|
8010
|
-
return (jsxs("div", Object.assign({ className: "tab-pane" }, { children: [jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { type: "radio", onChange: (
|
|
8011
|
-
return;
|
|
8012
|
-
} setState(Object.assign(Object.assign({}, state), { every: true })); props.onChange(); }, value: "1", name: "DailyRadio", checked: state.every, disabled: props.disabled }), jsx("span", { children: translateFn('Every') }), jsx("input", { disabled: !state.every || props.disabled, 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) => { if (props.disabled) {
|
|
8013
|
-
return;
|
|
8014
|
-
} 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, disabled: props.disabled }), jsx("span", { children: translateFn('Every week day') })] })), jsx("span", { children: translateFn('Start time') }), jsx(HourSelect, { onChange: onAtHourChange, value: props.value[2], disabled: props.disabled }), jsx(MinutesSelect, { onChange: onAtMinuteChange, value: props.value[1], disabled: props.disabled })] })));
|
|
8024
|
+
return (jsxs("div", Object.assign({ className: "tab-pane" }, { children: [jsxs("div", Object.assign({ className: "well well-small cursor_pointer", onClick: onClickDailyRadio }, { children: [jsx("input", { type: "radio", value: "1", name: "DailyRadio", checked: state.every, disabled: props.disabled }), jsx("span", { children: translateFn('Every') }), jsx("input", { readOnly: !state.every, disabled: props.disabled, 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 cursor_pointer", onClick: onClickEveryWeekDay }, { children: [jsx("input", { type: "radio", value: "2", name: "EveryWeekDay", checked: !state.every, disabled: props.disabled }), jsx("span", { children: translateFn('Every week day') })] })), jsx("span", { children: translateFn('Start time') }), jsx(HourSelect, { onChange: onAtHourChange, value: props.value[2], disabled: props.disabled }), jsx(MinutesSelect, { onChange: onAtMinuteChange, value: props.value[1], disabled: props.disabled })] })));
|
|
8015
8025
|
};
|
|
8016
8026
|
|
|
8017
8027
|
const HourlyCron = (props) => {
|
|
@@ -8055,12 +8065,22 @@ const HourlyCron = (props) => {
|
|
|
8055
8065
|
val[1] = `${e.target.value}`;
|
|
8056
8066
|
props.onChange(val);
|
|
8057
8067
|
};
|
|
8068
|
+
const onClickEveryHourMinute = () => {
|
|
8069
|
+
if (props.disabled || state.every) {
|
|
8070
|
+
return;
|
|
8071
|
+
}
|
|
8072
|
+
setState(Object.assign(Object.assign({}, state), { every: true }));
|
|
8073
|
+
props.onChange(['0', '0', '0/1', '1/1', '*', '?', '*']);
|
|
8074
|
+
};
|
|
8075
|
+
const onClickEverySpecificHour = () => {
|
|
8076
|
+
if (props.disabled || !state.every) {
|
|
8077
|
+
return;
|
|
8078
|
+
}
|
|
8079
|
+
setState({ every: false });
|
|
8080
|
+
props.onChange();
|
|
8081
|
+
};
|
|
8058
8082
|
const translateFn = props.translate;
|
|
8059
|
-
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: (
|
|
8060
|
-
return;
|
|
8061
|
-
} setState(Object.assign(Object.assign({}, state), { every: true })); props.onChange(['0', '0', '0/1', '1/1', '*', '?', '*']); }, checked: state.every, disabled: props.disabled }), jsxs("span", { children: [translateFn('Every'), " "] }), jsx("input", { disabled: !state.every || props.disabled, 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 || props.disabled, 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) => { if (props.disabled) {
|
|
8062
|
-
return;
|
|
8063
|
-
} setState({ every: false }); props.onChange(); }, checked: !state.every, disabled: props.disabled }), jsx("span", Object.assign({ className: "" }, { children: translateFn('At') })), jsx(HourSelect, { disabled: state.every || props.disabled, onChange: onAtHourChange, value: props.value[2] }), jsx(MinutesSelect, { disabled: state.every || props.disabled, onChange: onAtMinuteChange, value: props.value[1] })] })) }))] })) })));
|
|
8083
|
+
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 cursor_pointer", onClick: onClickEveryHourMinute }, { children: [jsx("input", { name: 'EveryHourMinute', type: "radio", checked: state.every, disabled: props.disabled }), jsxs("span", { children: [translateFn('Every'), " "] }), jsx("input", { readOnly: !state.every, disabled: props.disabled, type: "Number", onChange: onHourChange, value: props.value[2].split('/')[1] ? props.value[2].split('/')[1] : '' }), jsx("span", { children: translateFn('hour') }), jsx("input", { readOnly: !state.every, disabled: props.disabled, type: "Number", onChange: onMinuteChange, value: props.value[1] }), jsx("span", { children: translateFn('minute(s)') })] })), jsxs("div", Object.assign({ className: "well well-small cursor_pointer", onClick: onClickEverySpecificHour }, { children: [jsx("input", { name: 'EverySpecificHour', type: "radio", checked: !state.every, disabled: props.disabled }), jsx("span", { children: translateFn('At') }), jsx(HourSelect, { disabled: props.disabled, onChange: onAtHourChange, value: props.value[2] }), jsx(MinutesSelect, { disabled: props.disabled, onChange: onAtMinuteChange, value: props.value[1] })] }))] })) })));
|
|
8064
8084
|
};
|
|
8065
8085
|
|
|
8066
8086
|
const WeeklyCron = (props) => {
|
|
@@ -8119,22 +8139,25 @@ const WeeklyCron = (props) => {
|
|
|
8119
8139
|
val[5] = valFive;
|
|
8120
8140
|
};
|
|
8121
8141
|
const translateFn = props.translate;
|
|
8122
|
-
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, disabled: props.disabled }), 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, disabled: props.disabled }), 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, disabled: props.disabled }), 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, disabled: props.disabled }), 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, disabled: props.disabled }), 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, disabled: props.disabled }), 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, disabled: props.disabled }), translateFn('Saturday')] })), jsx("br", {}), jsx("br", {})] }))] })), translateFn('Start time'), jsx(HourSelect, { onChange: onAtHourChange, value: props.value[2], disabled: props.disabled }), jsx(MinutesSelect, { onChange: onAtMinuteChange, value: props.value[1], disabled: props.disabled })] })));
|
|
8142
|
+
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", { id: "mon-checkbox", className: 'min_height_auto cursor_pointer', type: "checkbox", value: "MON", onChange: onCheck, checked: (props.value[5].search('MON') !== -1) ? true : false, disabled: props.disabled }), jsx("label", Object.assign({ className: 'cursor_pointer', htmlFor: 'mon-checkbox' }, { children: translateFn('Monday') })), jsx("br", {}), jsx("input", { id: "wed-checkbox", className: 'min_height_auto cursor_pointer', type: "checkbox", value: "WED", onChange: onCheck, checked: props.value[5].search('WED') !== -1 ? true : false, disabled: props.disabled }), jsx("label", Object.assign({ className: 'cursor_pointer', htmlFor: 'wed-checkbox' }, { children: translateFn('Wednesday') })), jsx("br", {}), jsx("input", { id: "fri-checkbox", className: 'min_height_auto cursor_pointer', type: "checkbox", value: "FRI", onChange: onCheck, checked: (props.value[5].search('FRI') !== -1) ? true : false, disabled: props.disabled }), jsx("label", Object.assign({ className: 'cursor_pointer', htmlFor: 'fri-checkbox' }, { children: translateFn('Friday') })), jsx("br", {}), jsx("input", { id: "sun-checkbox", className: 'min_height_auto cursor_pointer', type: "checkbox", value: "SUN", onChange: onCheck, checked: props.value[5].search('SUN') !== -1 ? true : false, disabled: props.disabled }), jsx("label", Object.assign({ className: 'cursor_pointer', htmlFor: 'sun-checkbox' }, { children: translateFn('Sunday') }))] })) })), jsxs("div", Object.assign({ className: "span6 col-sm-6" }, { children: [jsxs("div", Object.assign({ className: "text_align_left" }, { children: [jsx("input", { id: "tue-checkbox", className: 'min_height_auto cursor_pointer', type: "checkbox", value: "TUE", onChange: onCheck, checked: props.value[5].search('TUE') !== -1 ? true : false, disabled: props.disabled }), jsx("label", Object.assign({ className: 'cursor_pointer', htmlFor: 'tue-checkbox' }, { children: translateFn('Tuesday') })), jsx("br", {}), jsx("input", { id: "thu-checkbox", className: 'min_height_auto cursor_pointer', type: "checkbox", value: "THU", onChange: onCheck, checked: props.value[5].search('THU') !== -1 ? true : false, disabled: props.disabled }), jsx("label", Object.assign({ className: 'cursor_pointer', htmlFor: 'thu-checkbox' }, { children: translateFn('Thursday') })), jsx("br", {}), jsx("input", { id: "sat-checkbox", className: 'min_height_auto cursor_pointer', type: "checkbox", value: "SAT", onChange: onCheck, checked: props.value[5].search('SAT') !== -1 ? true : false, disabled: props.disabled }), jsx("label", Object.assign({ className: 'cursor_pointer', htmlFor: 'sat-checkbox' }, { children: translateFn('Saturday') }))] })), jsx("br", {}), jsx("br", {})] }))] })), translateFn('Start time'), jsx(HourSelect, { onChange: onAtHourChange, value: props.value[2], disabled: props.disabled }), jsx(MinutesSelect, { onChange: onAtMinuteChange, value: props.value[1], disabled: props.disabled })] })));
|
|
8123
8143
|
};
|
|
8124
8144
|
|
|
8125
8145
|
const MonthlyCron = (props) => {
|
|
8126
8146
|
const [state, setState] = useState({ hour: 0, minute: 0, every: "" });
|
|
8127
8147
|
useEffect(() => {
|
|
8128
8148
|
let every;
|
|
8129
|
-
if (props.value[3] ===
|
|
8149
|
+
if (props.value[3] === "L") {
|
|
8130
8150
|
every = "2";
|
|
8131
8151
|
}
|
|
8132
|
-
else if (props.value[3] ===
|
|
8152
|
+
else if (props.value[3] === "LW") {
|
|
8133
8153
|
every = "3";
|
|
8134
8154
|
}
|
|
8135
|
-
else if (props.value[3].startsWith(
|
|
8155
|
+
else if (props.value[3].startsWith("L")) {
|
|
8136
8156
|
every = "4";
|
|
8137
8157
|
}
|
|
8158
|
+
else if (props.value[3].includes("!")) {
|
|
8159
|
+
every = "5";
|
|
8160
|
+
}
|
|
8138
8161
|
else {
|
|
8139
8162
|
every = "1";
|
|
8140
8163
|
}
|
|
@@ -8144,20 +8167,58 @@ const MonthlyCron = (props) => {
|
|
|
8144
8167
|
if (props.disabled) {
|
|
8145
8168
|
return;
|
|
8146
8169
|
}
|
|
8147
|
-
if ((
|
|
8148
|
-
let val = [
|
|
8170
|
+
if ((parseInt(e.target.value) > 0 && parseInt(e.target.value) <= 31) || e.target.value === "") {
|
|
8171
|
+
let val = [
|
|
8172
|
+
"0",
|
|
8173
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8174
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8175
|
+
props.value[3],
|
|
8176
|
+
"1/1",
|
|
8177
|
+
"?",
|
|
8178
|
+
"*",
|
|
8179
|
+
];
|
|
8149
8180
|
val[3] = `${e.target.value}`;
|
|
8150
8181
|
props.onChange(val);
|
|
8151
8182
|
}
|
|
8152
8183
|
};
|
|
8184
|
+
const onMultiDayChange = (e) => {
|
|
8185
|
+
if (props.disabled) {
|
|
8186
|
+
return;
|
|
8187
|
+
}
|
|
8188
|
+
if (e.target.value === "" ||
|
|
8189
|
+
e.target.value
|
|
8190
|
+
.split(",")
|
|
8191
|
+
.map((day) => day.trim() ? parseInt(day.trim()) : day)
|
|
8192
|
+
.every((day) => typeof day !== "string" ? (day > 0 && day <= 31) : day === "")) {
|
|
8193
|
+
let val = [
|
|
8194
|
+
"0",
|
|
8195
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8196
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8197
|
+
props.value[3],
|
|
8198
|
+
"1/1",
|
|
8199
|
+
"?",
|
|
8200
|
+
"*",
|
|
8201
|
+
];
|
|
8202
|
+
val[3] = `${e.target.value.replaceAll(",", "!")}`;
|
|
8203
|
+
props.onChange(val);
|
|
8204
|
+
}
|
|
8205
|
+
};
|
|
8153
8206
|
const onLastDayChange = (e) => {
|
|
8154
8207
|
if (props.disabled) {
|
|
8155
8208
|
return;
|
|
8156
8209
|
}
|
|
8157
|
-
if ((
|
|
8158
|
-
let val = [
|
|
8159
|
-
|
|
8160
|
-
|
|
8210
|
+
if ((parseInt(e.target.value) >> 0 && parseInt(e.target.value) <= 31) || e.target.value === "") {
|
|
8211
|
+
let val = [
|
|
8212
|
+
"0",
|
|
8213
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8214
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8215
|
+
props.value[3],
|
|
8216
|
+
"1/1",
|
|
8217
|
+
"?",
|
|
8218
|
+
"*",
|
|
8219
|
+
];
|
|
8220
|
+
if (e.target.value === "") {
|
|
8221
|
+
val[3] = "";
|
|
8161
8222
|
}
|
|
8162
8223
|
else {
|
|
8163
8224
|
val[3] = `L-${e.target.value}`;
|
|
@@ -8181,16 +8242,83 @@ const MonthlyCron = (props) => {
|
|
|
8181
8242
|
val[1] = `${e.target.value}`;
|
|
8182
8243
|
props.onChange(val);
|
|
8183
8244
|
};
|
|
8245
|
+
const onClickMonthlyOnceRadio = (value = "1") => {
|
|
8246
|
+
if (props.disabled || state.every === "1") {
|
|
8247
|
+
return;
|
|
8248
|
+
}
|
|
8249
|
+
setState(Object.assign(Object.assign({}, state), { every: value }));
|
|
8250
|
+
props.onChange([
|
|
8251
|
+
"0",
|
|
8252
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8253
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8254
|
+
"1",
|
|
8255
|
+
"1/1",
|
|
8256
|
+
"?",
|
|
8257
|
+
"*",
|
|
8258
|
+
]);
|
|
8259
|
+
};
|
|
8260
|
+
const onClickLastDayOfEveryMonth = (value = "2") => {
|
|
8261
|
+
if (props.disabled || state.every === "2") {
|
|
8262
|
+
return;
|
|
8263
|
+
}
|
|
8264
|
+
setState(Object.assign(Object.assign({}, state), { every: value }));
|
|
8265
|
+
props.onChange([
|
|
8266
|
+
"0",
|
|
8267
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8268
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8269
|
+
"L",
|
|
8270
|
+
"*",
|
|
8271
|
+
"?",
|
|
8272
|
+
"*",
|
|
8273
|
+
]);
|
|
8274
|
+
};
|
|
8275
|
+
const onClickLastWeekdayOfEveryMonth = (value = "3") => {
|
|
8276
|
+
if (props.disabled || state.every === "3") {
|
|
8277
|
+
return;
|
|
8278
|
+
}
|
|
8279
|
+
setState(Object.assign(Object.assign({}, state), { every: value }));
|
|
8280
|
+
props.onChange([
|
|
8281
|
+
"0",
|
|
8282
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8283
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8284
|
+
"LW",
|
|
8285
|
+
"*",
|
|
8286
|
+
"?",
|
|
8287
|
+
"*",
|
|
8288
|
+
]);
|
|
8289
|
+
};
|
|
8290
|
+
const onClickDaysBeforeEndOfMonth = (value = "4") => {
|
|
8291
|
+
if (props.disabled || state.every === "4") {
|
|
8292
|
+
return;
|
|
8293
|
+
}
|
|
8294
|
+
setState(Object.assign(Object.assign({}, state), { every: value }));
|
|
8295
|
+
props.onChange([
|
|
8296
|
+
"0",
|
|
8297
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8298
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8299
|
+
`L-${1}`,
|
|
8300
|
+
"*",
|
|
8301
|
+
"?",
|
|
8302
|
+
"*",
|
|
8303
|
+
]);
|
|
8304
|
+
};
|
|
8305
|
+
const onClickMonthlyMultipleRadio = (value = "5") => {
|
|
8306
|
+
if (props.disabled || state.every === "5") {
|
|
8307
|
+
return;
|
|
8308
|
+
}
|
|
8309
|
+
setState(Object.assign(Object.assign({}, state), { every: value }));
|
|
8310
|
+
props.onChange([
|
|
8311
|
+
"0",
|
|
8312
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8313
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8314
|
+
"1",
|
|
8315
|
+
"1/1",
|
|
8316
|
+
"?",
|
|
8317
|
+
"*",
|
|
8318
|
+
]);
|
|
8319
|
+
};
|
|
8184
8320
|
const translateFn = props.translate;
|
|
8185
|
-
return (jsxs("div", Object.assign({ className: "tab-pane" }, { children: [jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { type: "radio", onChange: (
|
|
8186
|
-
return;
|
|
8187
|
-
} 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, disabled: props.disabled }), translateFn('Day'), jsx("input", { readOnly: state.every !== "1", type: "number", value: props.value[3], onChange: onDayChange, disabled: props.disabled }), translateFn('of every month(s)')] })), jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { onChange: (e) => { if (props.disabled) {
|
|
8188
|
-
return;
|
|
8189
|
-
} 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, disabled: props.disabled }), translateFn('Last day of every month')] })), jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { onChange: (e) => { if (props.disabled) {
|
|
8190
|
-
return;
|
|
8191
|
-
} 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, disabled: props.disabled }), translateFn('On the last weekday of every month')] })), jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { type: "radio", onChange: (e) => { if (props.disabled) {
|
|
8192
|
-
return;
|
|
8193
|
-
} 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, disabled: props.disabled }), 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, disabled: props.disabled }), translateFn('day(s) before the end of the month')] })), translateFn('Start time'), jsx(HourSelect, { onChange: onAtHourChange, value: props.value[2], disabled: props.disabled }), jsx(MinutesSelect, { onChange: onAtMinuteChange, value: props.value[1], disabled: props.disabled })] })));
|
|
8321
|
+
return (jsxs("div", Object.assign({ className: "tab-pane" }, { children: [jsxs("div", Object.assign({ className: "well well-small cursor_pointer", onClick: () => onClickMonthlyOnceRadio() }, { children: [jsx("input", { type: "radio", value: "1", name: "MonthlyOnceRadio", checked: state.every === "1" ? true : false, disabled: props.disabled }), translateFn("Day"), jsx("input", { readOnly: state.every !== "1", type: "number", value: props.value[3], onChange: onDayChange, disabled: props.disabled }), translateFn("of every month(s)")] })), jsxs("div", Object.assign({ className: "well well-small cursor_pointer", onClick: () => onClickLastDayOfEveryMonth() }, { children: [jsx("input", { type: "radio", value: "2", name: "LastDayOfEveryMonth", checked: state.every === "2" ? true : false, disabled: props.disabled }), translateFn("Last day of every month")] })), jsxs("div", Object.assign({ className: "well well-small cursor_pointer", onClick: () => onClickLastWeekdayOfEveryMonth() }, { children: [jsx("input", { type: "radio", value: "3", name: "LastWeekdayOfEveryMonth", checked: state.every === "3" ? true : false, disabled: props.disabled }), translateFn("On the last weekday of every month")] })), jsxs("div", Object.assign({ className: "well well-small cursor_pointer", onClick: () => onClickDaysBeforeEndOfMonth() }, { children: [jsx("input", { type: "radio", value: "4", name: "DaysBeforeEndOfMonth", checked: state.every === "4" ? true : false, disabled: props.disabled }), 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, disabled: props.disabled }), translateFn("day(s) before the end of the month")] })), jsxs("div", Object.assign({ className: "well well-small cursor_pointer", onClick: () => onClickMonthlyMultipleRadio() }, { children: [jsx("input", { type: "radio", value: "5", name: "MonthlyMultipleRadio", checked: state.every === "5" ? true : false, disabled: props.disabled }), jsx("input", { readOnly: state.every !== "5", type: "text", value: state.every === "5" ? props.value[3].replaceAll("!", ",") : "", onChange: onMultiDayChange, disabled: props.disabled }), translateFn("Days of every month (comma separated dates)")] })), translateFn("Start time"), jsx(HourSelect, { onChange: onAtHourChange, value: props.value[2], disabled: props.disabled }), jsx(MinutesSelect, { onChange: onAtMinuteChange, value: props.value[1], disabled: props.disabled })] })));
|
|
8194
8322
|
};
|
|
8195
8323
|
|
|
8196
8324
|
const CustomCron = (props) => {
|
|
@@ -8282,6 +8410,54 @@ const loadHeaders = (options) => {
|
|
|
8282
8410
|
return defaultTabs;
|
|
8283
8411
|
};
|
|
8284
8412
|
|
|
8413
|
+
var Every = "Every";
|
|
8414
|
+
var hour = "hour";
|
|
8415
|
+
var At = "At";
|
|
8416
|
+
var Day = "Day";
|
|
8417
|
+
var Monday = "Monday";
|
|
8418
|
+
var Tuesday = "Tuesday";
|
|
8419
|
+
var Wednesday = "Wednesday";
|
|
8420
|
+
var Thursday = "Thursday";
|
|
8421
|
+
var Friday = "Friday";
|
|
8422
|
+
var Saturday = "Saturday";
|
|
8423
|
+
var Sunday = "Sunday";
|
|
8424
|
+
var Minutes = "Minutes";
|
|
8425
|
+
var Hourly = "Hourly";
|
|
8426
|
+
var Daily = "Daily";
|
|
8427
|
+
var Weekly = "Weekly";
|
|
8428
|
+
var Monthly = "Monthly";
|
|
8429
|
+
var Custom = "Custom";
|
|
8430
|
+
var Expression = "Expression";
|
|
8431
|
+
var translations = {
|
|
8432
|
+
Every: Every,
|
|
8433
|
+
"day(s)": "day(s)",
|
|
8434
|
+
"Every week day": "Every week day",
|
|
8435
|
+
"Start time": "Start time",
|
|
8436
|
+
hour: hour,
|
|
8437
|
+
At: At,
|
|
8438
|
+
"minute(s)": "minute(s)",
|
|
8439
|
+
Day: Day,
|
|
8440
|
+
"of every month(s)": "of every month(s)",
|
|
8441
|
+
"Last day of every month": "Last day of every month",
|
|
8442
|
+
"On the last weekday of every month": "On the last weekday of every month",
|
|
8443
|
+
"day(s) before the end of the month": "Day(s) before the end of the month",
|
|
8444
|
+
Monday: Monday,
|
|
8445
|
+
Tuesday: Tuesday,
|
|
8446
|
+
Wednesday: Wednesday,
|
|
8447
|
+
Thursday: Thursday,
|
|
8448
|
+
Friday: Friday,
|
|
8449
|
+
Saturday: Saturday,
|
|
8450
|
+
Sunday: Sunday,
|
|
8451
|
+
Minutes: Minutes,
|
|
8452
|
+
Hourly: Hourly,
|
|
8453
|
+
Daily: Daily,
|
|
8454
|
+
Weekly: Weekly,
|
|
8455
|
+
Monthly: Monthly,
|
|
8456
|
+
Custom: Custom,
|
|
8457
|
+
Expression: Expression,
|
|
8458
|
+
"Days of every month (comma separated dates)": "Days of every month (comma separated dates)"
|
|
8459
|
+
};
|
|
8460
|
+
|
|
8285
8461
|
function styleInject(css, ref) {
|
|
8286
8462
|
if ( ref === void 0 ) ref = {};
|
|
8287
8463
|
var insertAt = ref.insertAt;
|
|
@@ -8309,7 +8485,7 @@ function styleInject(css, ref) {
|
|
|
8309
8485
|
}
|
|
8310
8486
|
}
|
|
8311
8487
|
|
|
8312
|
-
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:disabled{\n background-color: #f5f5f5;\n cursor: default;\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 .nav-tabs .nav-item.show .nav-link, .cron_builder .nav-tabs .nav-link.disabled {\n color: #6c757d;\n background-color: #ffffff;\n border-color: transparent transparent #ffffff;\n cursor: not-allowed;\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.cron_builder .nav.nav-tabs {\n list-style: none;\n display: flex;\n margin: 0 0;\n padding-left: 0;\n}\n.cron_builder .row {\n display: flex;\n}\n.cron_builder .col-sm-6 {\n flex: 0 0 50%;\n}\n.cron_builder .min_height_auto {\n min-height: auto !important;\n}\n.cron_builder {\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}\n";
|
|
8488
|
+
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:disabled{\n background-color: #f5f5f5;\n cursor: default;\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 .nav-tabs .nav-item.show .nav-link, .cron_builder .nav-tabs .nav-link.disabled {\n color: #6c757d;\n background-color: #ffffff;\n border-color: transparent transparent #ffffff;\n cursor: not-allowed;\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.cron_builder .nav.nav-tabs {\n list-style: none;\n display: flex;\n margin: 0 0;\n padding-left: 0;\n}\n.cron_builder .row {\n display: flex;\n}\n.cron_builder .col-sm-6 {\n flex: 0 0 50%;\n}\n.cron_builder .min_height_auto {\n min-height: auto !important;\n}\n.cron_builder {\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}\n.cron_builder .cursor_pointer {\n cursor: pointer;\n}";
|
|
8313
8489
|
styleInject(css_248z);
|
|
8314
8490
|
|
|
8315
8491
|
const defaultCron = '0 0 00 1/1 * ? *';
|
|
@@ -8428,6 +8604,9 @@ const Cron = (props) => {
|
|
|
8428
8604
|
throw new Error('translateFn expects a string translation');
|
|
8429
8605
|
}
|
|
8430
8606
|
}
|
|
8607
|
+
else if (translations[translatedText]) {
|
|
8608
|
+
return translations[translatedText];
|
|
8609
|
+
}
|
|
8431
8610
|
return translatedText;
|
|
8432
8611
|
};
|
|
8433
8612
|
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, ',') }))] })));
|