react-cron-generator 2.0.14 → 2.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/build/cron.d.ts +1 -1
- package/build/day-select/index.d.ts +14 -0
- package/build/index.d.ts +4 -2
- package/build/index.js +163 -104
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,6 +85,12 @@ const options = {
|
|
|
85
85
|
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
## Importables
|
|
89
|
+
|
|
90
|
+
Cron - The react Cron component. - Default
|
|
91
|
+
CronProp - Cron component types.
|
|
92
|
+
cronsture - Cronsture/i18 - [cronstrue](https://www.npmjs.com/package/cronstrue)
|
|
93
|
+
|
|
88
94
|
|
|
89
95
|
## Release notes 2.x.x
|
|
90
96
|
1. Build Procedure updated
|
package/build/cron.d.ts
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type DaySelectProp = {
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
onChange(value: null | string): void;
|
|
5
|
+
value: string;
|
|
6
|
+
multi?: false;
|
|
7
|
+
} | {
|
|
8
|
+
multi: true;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onChange(value: string[]): void;
|
|
11
|
+
value: string[];
|
|
12
|
+
};
|
|
13
|
+
declare const DaySelect: React.FunctionComponent<DaySelectProp>;
|
|
14
|
+
export default DaySelect;
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useEffect } from 'react';
|
|
2
|
+
import { useState, useEffect, useRef, useCallback } from 'react';
|
|
3
3
|
|
|
4
4
|
var cronstrueI18n = {exports: {}};
|
|
5
5
|
|
|
@@ -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,7 +8139,47 @@ 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 })] })));
|
|
8143
|
+
};
|
|
8144
|
+
|
|
8145
|
+
const DaySelect = ({ disabled, multi = false, onChange, value, }) => {
|
|
8146
|
+
const [show, setShow] = useState(false);
|
|
8147
|
+
const ref = useRef(null);
|
|
8148
|
+
const handleClickOutside = useCallback((event) => {
|
|
8149
|
+
if (show && ref.current && !ref.current.contains(event.target)) {
|
|
8150
|
+
setShow(false);
|
|
8151
|
+
}
|
|
8152
|
+
}, [ref, show]);
|
|
8153
|
+
useEffect(() => {
|
|
8154
|
+
// Bind the event listener
|
|
8155
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
8156
|
+
return () => {
|
|
8157
|
+
// Unbind the event listener on clean up
|
|
8158
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
8159
|
+
};
|
|
8160
|
+
}, [handleClickOutside]);
|
|
8161
|
+
const onSelect = (i) => {
|
|
8162
|
+
if (multi && Array.isArray(value)) {
|
|
8163
|
+
onChange((value.includes(i)
|
|
8164
|
+
? [...value.slice(0, value.indexOf(i)), ...value.splice(value.indexOf(i) + 1, value.length - 1)]
|
|
8165
|
+
: [...value, i]));
|
|
8166
|
+
}
|
|
8167
|
+
else {
|
|
8168
|
+
onChange((value === i ? null : i));
|
|
8169
|
+
}
|
|
8170
|
+
};
|
|
8171
|
+
const buildOptions = () => {
|
|
8172
|
+
let options = [];
|
|
8173
|
+
for (let i = 1; i <= 31; i++) {
|
|
8174
|
+
options.push(jsx("label", Object.assign({ className: `dropdown-item ${(Array.isArray(value) ? value.includes(i.toString()) : value === i.toString()) ? "dropdown-item-selected" : ""}`, onClick: () => !disabled && onSelect(i.toString()) }, { children: i })));
|
|
8175
|
+
}
|
|
8176
|
+
return options;
|
|
8177
|
+
};
|
|
8178
|
+
return (jsxs("div", Object.assign({ className: "dropdown mx-2", ref: ref }, { children: [jsx("input", { disabled: disabled, className: "dropbtn mx-0", onClick: () => setShow((s) => !s), value: (Array.isArray(value) ? value.length : value)
|
|
8179
|
+
? Array.isArray(value)
|
|
8180
|
+
? value.join(",")
|
|
8181
|
+
: value
|
|
8182
|
+
: "" }), show && jsx("div", Object.assign({ className: "dropdown-content" }, { children: buildOptions() }))] })));
|
|
8123
8183
|
};
|
|
8124
8184
|
|
|
8125
8185
|
const MonthlyCron = (props) => {
|
|
@@ -8161,27 +8221,21 @@ const MonthlyCron = (props) => {
|
|
|
8161
8221
|
props.onChange(val);
|
|
8162
8222
|
}
|
|
8163
8223
|
};
|
|
8164
|
-
const onMultiDayChange = (
|
|
8224
|
+
const onMultiDayChange = (value) => {
|
|
8165
8225
|
if (props.disabled) {
|
|
8166
8226
|
return;
|
|
8167
8227
|
}
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
"?",
|
|
8180
|
-
"*",
|
|
8181
|
-
];
|
|
8182
|
-
val[3] = `${e.target.value.replaceAll(",", "!")}`;
|
|
8183
|
-
props.onChange(val);
|
|
8184
|
-
}
|
|
8228
|
+
const val = [
|
|
8229
|
+
"0",
|
|
8230
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8231
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8232
|
+
props.value[3],
|
|
8233
|
+
"1/1",
|
|
8234
|
+
"?",
|
|
8235
|
+
"*",
|
|
8236
|
+
];
|
|
8237
|
+
val[3] = `${value.filter(p => p).join("!")}`;
|
|
8238
|
+
props.onChange(val);
|
|
8185
8239
|
};
|
|
8186
8240
|
const onLastDayChange = (e) => {
|
|
8187
8241
|
if (props.disabled) {
|
|
@@ -8222,78 +8276,83 @@ const MonthlyCron = (props) => {
|
|
|
8222
8276
|
val[1] = `${e.target.value}`;
|
|
8223
8277
|
props.onChange(val);
|
|
8224
8278
|
};
|
|
8279
|
+
const onClickMonthlyOnceRadio = (value = "1") => {
|
|
8280
|
+
if (props.disabled || state.every === "1") {
|
|
8281
|
+
return;
|
|
8282
|
+
}
|
|
8283
|
+
setState(Object.assign(Object.assign({}, state), { every: value }));
|
|
8284
|
+
props.onChange([
|
|
8285
|
+
"0",
|
|
8286
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8287
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8288
|
+
"1",
|
|
8289
|
+
"1/1",
|
|
8290
|
+
"?",
|
|
8291
|
+
"*",
|
|
8292
|
+
]);
|
|
8293
|
+
};
|
|
8294
|
+
const onClickLastDayOfEveryMonth = (value = "2") => {
|
|
8295
|
+
if (props.disabled || state.every === "2") {
|
|
8296
|
+
return;
|
|
8297
|
+
}
|
|
8298
|
+
setState(Object.assign(Object.assign({}, state), { every: value }));
|
|
8299
|
+
props.onChange([
|
|
8300
|
+
"0",
|
|
8301
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8302
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8303
|
+
"L",
|
|
8304
|
+
"*",
|
|
8305
|
+
"?",
|
|
8306
|
+
"*",
|
|
8307
|
+
]);
|
|
8308
|
+
};
|
|
8309
|
+
const onClickLastWeekdayOfEveryMonth = (value = "3") => {
|
|
8310
|
+
if (props.disabled || state.every === "3") {
|
|
8311
|
+
return;
|
|
8312
|
+
}
|
|
8313
|
+
setState(Object.assign(Object.assign({}, state), { every: value }));
|
|
8314
|
+
props.onChange([
|
|
8315
|
+
"0",
|
|
8316
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8317
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8318
|
+
"LW",
|
|
8319
|
+
"*",
|
|
8320
|
+
"?",
|
|
8321
|
+
"*",
|
|
8322
|
+
]);
|
|
8323
|
+
};
|
|
8324
|
+
const onClickDaysBeforeEndOfMonth = (value = "4") => {
|
|
8325
|
+
if (props.disabled || state.every === "4") {
|
|
8326
|
+
return;
|
|
8327
|
+
}
|
|
8328
|
+
setState(Object.assign(Object.assign({}, state), { every: value }));
|
|
8329
|
+
props.onChange([
|
|
8330
|
+
"0",
|
|
8331
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8332
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8333
|
+
`L-${1}`,
|
|
8334
|
+
"*",
|
|
8335
|
+
"?",
|
|
8336
|
+
"*",
|
|
8337
|
+
]);
|
|
8338
|
+
};
|
|
8339
|
+
const onClickMonthlyMultipleRadio = (value = "5") => {
|
|
8340
|
+
if (props.disabled || state.every === "5") {
|
|
8341
|
+
return;
|
|
8342
|
+
}
|
|
8343
|
+
setState(Object.assign(Object.assign({}, state), { every: value }));
|
|
8344
|
+
props.onChange([
|
|
8345
|
+
"0",
|
|
8346
|
+
props.value[1] === "*" ? "0" : props.value[1],
|
|
8347
|
+
props.value[2] === "*" ? "0" : props.value[2],
|
|
8348
|
+
"1",
|
|
8349
|
+
"1/1",
|
|
8350
|
+
"?",
|
|
8351
|
+
"*",
|
|
8352
|
+
]);
|
|
8353
|
+
};
|
|
8225
8354
|
const translateFn = props.translate;
|
|
8226
|
-
return (jsxs("div", Object.assign({ className: "tab-pane" }, { children: [jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { type: "radio", onChange: (e) => {
|
|
8227
|
-
if (props.disabled) {
|
|
8228
|
-
return;
|
|
8229
|
-
}
|
|
8230
|
-
setState(Object.assign(Object.assign({}, state), { every: e.target.value }));
|
|
8231
|
-
props.onChange([
|
|
8232
|
-
"0",
|
|
8233
|
-
props.value[1] === "*" ? "0" : props.value[1],
|
|
8234
|
-
props.value[2] === "*" ? "0" : props.value[2],
|
|
8235
|
-
"1",
|
|
8236
|
-
"1/1",
|
|
8237
|
-
"?",
|
|
8238
|
-
"*",
|
|
8239
|
-
]);
|
|
8240
|
-
}, 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) => {
|
|
8241
|
-
if (props.disabled) {
|
|
8242
|
-
return;
|
|
8243
|
-
}
|
|
8244
|
-
setState(Object.assign(Object.assign({}, state), { every: e.target.value }));
|
|
8245
|
-
props.onChange([
|
|
8246
|
-
"0",
|
|
8247
|
-
props.value[1] === "*" ? "0" : props.value[1],
|
|
8248
|
-
props.value[2] === "*" ? "0" : props.value[2],
|
|
8249
|
-
"L",
|
|
8250
|
-
"*",
|
|
8251
|
-
"?",
|
|
8252
|
-
"*",
|
|
8253
|
-
]);
|
|
8254
|
-
}, 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) => {
|
|
8255
|
-
if (props.disabled) {
|
|
8256
|
-
return;
|
|
8257
|
-
}
|
|
8258
|
-
setState(Object.assign(Object.assign({}, state), { every: e.target.value }));
|
|
8259
|
-
props.onChange([
|
|
8260
|
-
"0",
|
|
8261
|
-
props.value[1] === "*" ? "0" : props.value[1],
|
|
8262
|
-
props.value[2] === "*" ? "0" : props.value[2],
|
|
8263
|
-
"LW",
|
|
8264
|
-
"*",
|
|
8265
|
-
"?",
|
|
8266
|
-
"*",
|
|
8267
|
-
]);
|
|
8268
|
-
}, 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) => {
|
|
8269
|
-
if (props.disabled) {
|
|
8270
|
-
return;
|
|
8271
|
-
}
|
|
8272
|
-
setState(Object.assign(Object.assign({}, state), { every: e.target.value }));
|
|
8273
|
-
props.onChange([
|
|
8274
|
-
"0",
|
|
8275
|
-
props.value[1] === "*" ? "0" : props.value[1],
|
|
8276
|
-
props.value[2] === "*" ? "0" : props.value[2],
|
|
8277
|
-
`L-${1}`,
|
|
8278
|
-
"*",
|
|
8279
|
-
"?",
|
|
8280
|
-
"*",
|
|
8281
|
-
]);
|
|
8282
|
-
}, 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")] })), jsxs("div", Object.assign({ className: "well well-small" }, { children: [jsx("input", { type: "radio", onChange: (e) => {
|
|
8283
|
-
if (props.disabled) {
|
|
8284
|
-
return;
|
|
8285
|
-
}
|
|
8286
|
-
setState(Object.assign(Object.assign({}, state), { every: e.target.value }));
|
|
8287
|
-
props.onChange([
|
|
8288
|
-
"0",
|
|
8289
|
-
props.value[1] === "*" ? "0" : props.value[1],
|
|
8290
|
-
props.value[2] === "*" ? "0" : props.value[2],
|
|
8291
|
-
"1",
|
|
8292
|
-
"1/1",
|
|
8293
|
-
"?",
|
|
8294
|
-
"*",
|
|
8295
|
-
]);
|
|
8296
|
-
}, 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 (coma 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 })] })));
|
|
8355
|
+
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(DaySelect, { onChange: (e) => onMultiDayChange(e), disabled: props.disabled, value: state.every === "5" ? props.value[3].split("!") : [], multi: true }), translateFn("Days of every 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 })] })));
|
|
8297
8356
|
};
|
|
8298
8357
|
|
|
8299
8358
|
const CustomCron = (props) => {
|
|
@@ -8430,7 +8489,7 @@ var translations = {
|
|
|
8430
8489
|
Monthly: Monthly,
|
|
8431
8490
|
Custom: Custom,
|
|
8432
8491
|
Expression: Expression,
|
|
8433
|
-
"Days of every month
|
|
8492
|
+
"Days of every month": "Days of every month"
|
|
8434
8493
|
};
|
|
8435
8494
|
|
|
8436
8495
|
function styleInject(css, ref) {
|
|
@@ -8460,7 +8519,7 @@ function styleInject(css, ref) {
|
|
|
8460
8519
|
}
|
|
8461
8520
|
}
|
|
8462
8521
|
|
|
8463
|
-
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";
|
|
8522
|
+
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}\n\n.cron_builder .dropbtn {\n cursor: pointer;\n}\n\n.cron_builder .dropdown {\n position: relative;\n display: inline-block;\n}\n\n.cron_builder .dropdown-content {\n position: absolute;\n background-color: #f1f1f1;\n min-width: 140px;\n overflow: auto;\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n z-index: 1;\n left: 0;\n right: 0;\n text-align: left;\n max-height: 150px;\n overflow: auto;\n}\n\n@media screen and (min-height: 800px) {\n .cron_builder .dropdown-content {\n max-height: 200px;\n }\n}\n\n.cron_builder .dropdown-content .dropdown-item {\n color: black;\n padding: 12px 16px;\n text-decoration: none;\n display: block;\n}\n\n.cron_builder .dropdown-content .dropdown-item:hover, .cron_builder .dropdown-content .dropdown-item-selected {\n background-color: #086090;\n color: white;\n}\n\n.cron_builder .mx-0 {\n margin-left: 0 !important;\n margin-right: 0 !important;\n}\n.cron_builder .mx-2 {\n margin-left: 10px !important;\n margin-right: 10px !important;\n}";
|
|
8464
8523
|
styleInject(css_248z);
|
|
8465
8524
|
|
|
8466
8525
|
const defaultCron = '0 0 00 1/1 * ? *';
|
|
@@ -8587,5 +8646,5 @@ const Cron = (props) => {
|
|
|
8587
8646
|
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, ',') }))] })));
|
|
8588
8647
|
};
|
|
8589
8648
|
|
|
8590
|
-
export { HEADER, Cron as default };
|
|
8649
|
+
export { HEADER, i18n as cronstrue, Cron as default };
|
|
8591
8650
|
//# sourceMappingURL=index.js.map
|