react-cron-generator 2.0.2 → 2.0.4

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
 
@@ -340,15 +336,15 @@ var cronstrueI18n = {exports: {}};
340
336
  var description = this.getSegmentDescription(this.expressionParts[0], this.i18n.everySecond(), function (s) {
341
337
  return s;
342
338
  }, function (s) {
343
- return stringUtilities_1.StringUtilities.format(_this.i18n.everyX0Seconds(), s);
339
+ return stringUtilities_1.StringUtilities.format(_this.i18n.everyX0Seconds(s), s);
344
340
  }, function (s) {
345
341
  return _this.i18n.secondsX0ThroughX1PastTheMinute();
346
342
  }, function (s) {
347
343
  return s == "0"
348
344
  ? ""
349
345
  : parseInt(s) < 20
350
- ? _this.i18n.atX0SecondsPastTheMinute()
351
- : _this.i18n.atX0SecondsPastTheMinuteGt20() || _this.i18n.atX0SecondsPastTheMinute();
346
+ ? _this.i18n.atX0SecondsPastTheMinute(s)
347
+ : _this.i18n.atX0SecondsPastTheMinuteGt20() || _this.i18n.atX0SecondsPastTheMinute(s);
352
348
  });
353
349
  return description;
354
350
  };
@@ -359,7 +355,7 @@ var cronstrueI18n = {exports: {}};
359
355
  var description = this.getSegmentDescription(this.expressionParts[1], this.i18n.everyMinute(), function (s) {
360
356
  return s;
361
357
  }, function (s) {
362
- return stringUtilities_1.StringUtilities.format(_this.i18n.everyX0Minutes(), s);
358
+ return stringUtilities_1.StringUtilities.format(_this.i18n.everyX0Minutes(s), s);
363
359
  }, function (s) {
364
360
  return _this.i18n.minutesX0ThroughX1PastTheHour();
365
361
  }, function (s) {
@@ -367,11 +363,11 @@ var cronstrueI18n = {exports: {}};
367
363
  return s == "0" && hourExpression.indexOf("/") == -1 && secondsExpression == ""
368
364
  ? _this.i18n.everyHour()
369
365
  : parseInt(s) < 20
370
- ? _this.i18n.atX0MinutesPastTheHour()
371
- : _this.i18n.atX0MinutesPastTheHourGt20() || _this.i18n.atX0MinutesPastTheHour();
366
+ ? _this.i18n.atX0MinutesPastTheHour(s)
367
+ : _this.i18n.atX0MinutesPastTheHourGt20() || _this.i18n.atX0MinutesPastTheHour(s);
372
368
  }
373
369
  catch (e) {
374
- return _this.i18n.atX0MinutesPastTheHour();
370
+ return _this.i18n.atX0MinutesPastTheHour(s);
375
371
  }
376
372
  });
377
373
  return description;
@@ -382,7 +378,7 @@ var cronstrueI18n = {exports: {}};
382
378
  var description = this.getSegmentDescription(expression, this.i18n.everyHour(), function (s) {
383
379
  return _this.formatTime(s, "0", "");
384
380
  }, function (s) {
385
- return stringUtilities_1.StringUtilities.format(_this.i18n.everyX0Hours(), s);
381
+ return stringUtilities_1.StringUtilities.format(_this.i18n.everyX0Hours(s), s);
386
382
  }, function (s) {
387
383
  return _this.i18n.betweenX0AndX1();
388
384
  }, function (s) {
@@ -392,7 +388,10 @@ var cronstrueI18n = {exports: {}};
392
388
  var atTheHourMatches = Array.from(description.matchAll(/:00/g));
393
389
  if (atTheHourMatches.length > 1) {
394
390
  var lastAtTheHourMatchIndex = atTheHourMatches[atTheHourMatches.length - 1].index;
395
- description = description.substring(0, lastAtTheHourMatchIndex) + ":59" + description.substring(lastAtTheHourMatchIndex + 3);
391
+ description =
392
+ description.substring(0, lastAtTheHourMatchIndex) +
393
+ ":59" +
394
+ description.substring(lastAtTheHourMatchIndex + 3);
396
395
  }
397
396
  }
398
397
  return description;
@@ -405,7 +404,7 @@ var cronstrueI18n = {exports: {}};
405
404
  description = "";
406
405
  }
407
406
  else {
408
- description = this.getSegmentDescription(this.expressionParts[5], this.i18n.commaEveryDay(), function (s) {
407
+ description = this.getSegmentDescription(this.expressionParts[5], this.i18n.commaEveryDay(), function (s, form) {
409
408
  var exp = s;
410
409
  if (s.indexOf("#") > -1) {
411
410
  exp = s.substr(0, s.indexOf("#"));
@@ -413,47 +412,54 @@ var cronstrueI18n = {exports: {}};
413
412
  else if (s.indexOf("L") > -1) {
414
413
  exp = exp.replace("L", "");
415
414
  }
416
- return daysOfWeekNames[parseInt(exp)];
415
+ return _this.i18n.daysOfTheWeekInCase
416
+ ? _this.i18n.daysOfTheWeekInCase(form)[parseInt(exp)]
417
+ : daysOfWeekNames[parseInt(exp)];
417
418
  }, function (s) {
418
419
  if (parseInt(s) == 1) {
419
420
  return "";
420
421
  }
421
422
  else {
422
- return stringUtilities_1.StringUtilities.format(_this.i18n.commaEveryX0DaysOfTheWeek(), s);
423
+ return stringUtilities_1.StringUtilities.format(_this.i18n.commaEveryX0DaysOfTheWeek(s), s);
423
424
  }
424
425
  }, function (s) {
426
+ var beginFrom = s.substring(0, s.indexOf("-"));
425
427
  var domSpecified = _this.expressionParts[3] != "*";
426
- return domSpecified ? _this.i18n.commaAndX0ThroughX1() : _this.i18n.commaX0ThroughX1();
428
+ return domSpecified ? _this.i18n.commaAndX0ThroughX1(beginFrom) : _this.i18n.commaX0ThroughX1(beginFrom);
427
429
  }, function (s) {
428
430
  var format = null;
429
431
  if (s.indexOf("#") > -1) {
430
432
  var dayOfWeekOfMonthNumber = s.substring(s.indexOf("#") + 1);
433
+ var dayOfWeekNumber = s.substring(0, s.indexOf("#"));
431
434
  var dayOfWeekOfMonthDescription = null;
432
435
  switch (dayOfWeekOfMonthNumber) {
433
436
  case "1":
434
- dayOfWeekOfMonthDescription = _this.i18n.first();
437
+ dayOfWeekOfMonthDescription = _this.i18n.first(dayOfWeekNumber);
435
438
  break;
436
439
  case "2":
437
- dayOfWeekOfMonthDescription = _this.i18n.second();
440
+ dayOfWeekOfMonthDescription = _this.i18n.second(dayOfWeekNumber);
438
441
  break;
439
442
  case "3":
440
- dayOfWeekOfMonthDescription = _this.i18n.third();
443
+ dayOfWeekOfMonthDescription = _this.i18n.third(dayOfWeekNumber);
441
444
  break;
442
445
  case "4":
443
- dayOfWeekOfMonthDescription = _this.i18n.fourth();
446
+ dayOfWeekOfMonthDescription = _this.i18n.fourth(dayOfWeekNumber);
444
447
  break;
445
448
  case "5":
446
- dayOfWeekOfMonthDescription = _this.i18n.fifth();
449
+ dayOfWeekOfMonthDescription = _this.i18n.fifth(dayOfWeekNumber);
447
450
  break;
448
451
  }
449
- format = _this.i18n.commaOnThe() + dayOfWeekOfMonthDescription + _this.i18n.spaceX0OfTheMonth();
452
+ format =
453
+ _this.i18n.commaOnThe(dayOfWeekOfMonthNumber) +
454
+ dayOfWeekOfMonthDescription +
455
+ _this.i18n.spaceX0OfTheMonth();
450
456
  }
451
457
  else if (s.indexOf("L") > -1) {
452
- format = _this.i18n.commaOnTheLastX0OfTheMonth();
458
+ format = _this.i18n.commaOnTheLastX0OfTheMonth(s.replace("L", ""));
453
459
  }
454
460
  else {
455
461
  var domSpecified = _this.expressionParts[3] != "*";
456
- format = domSpecified ? _this.i18n.commaAndOnX0() : _this.i18n.commaOnlyOnX0();
462
+ format = domSpecified ? _this.i18n.commaAndOnX0() : _this.i18n.commaOnlyOnX0(s);
457
463
  }
458
464
  return format;
459
465
  });
@@ -463,14 +469,16 @@ var cronstrueI18n = {exports: {}};
463
469
  ExpressionDescriptor.prototype.getMonthDescription = function () {
464
470
  var _this = this;
465
471
  var monthNames = this.i18n.monthsOfTheYear();
466
- var description = this.getSegmentDescription(this.expressionParts[4], "", function (s) {
467
- return monthNames[parseInt(s) - 1];
472
+ var description = this.getSegmentDescription(this.expressionParts[4], "", function (s, form) {
473
+ return form && _this.i18n.monthsOfTheYearInCase
474
+ ? _this.i18n.monthsOfTheYearInCase(form)[parseInt(s) - 1]
475
+ : monthNames[parseInt(s) - 1];
468
476
  }, function (s) {
469
477
  if (parseInt(s) == 1) {
470
478
  return "";
471
479
  }
472
480
  else {
473
- return stringUtilities_1.StringUtilities.format(_this.i18n.commaEveryX0Months(), s);
481
+ return stringUtilities_1.StringUtilities.format(_this.i18n.commaEveryX0Months(s), s);
474
482
  }
475
483
  }, function (s) {
476
484
  return _this.i18n.commaMonthX0ThroughMonthX1() || _this.i18n.commaX0ThroughX1();
@@ -505,7 +513,7 @@ var cronstrueI18n = {exports: {}};
505
513
  var lastDayOffSetMatches = expression.match(/L-(\d{1,2})/);
506
514
  if (lastDayOffSetMatches) {
507
515
  var offSetDays = lastDayOffSetMatches[1];
508
- description = stringUtilities_1.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(), offSetDays);
516
+ description = stringUtilities_1.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(offSetDays), offSetDays);
509
517
  break;
510
518
  }
511
519
  else if (expression == "*" && this.expressionParts[5] != "*") {
@@ -519,11 +527,11 @@ var cronstrueI18n = {exports: {}};
519
527
  ? stringUtilities_1.StringUtilities.format(_this.i18n.dayX0(), s)
520
528
  : s;
521
529
  }, function (s) {
522
- return s == "1" ? _this.i18n.commaEveryDay() : _this.i18n.commaEveryX0Days();
530
+ return s == "1" ? _this.i18n.commaEveryDay() : _this.i18n.commaEveryX0Days(s);
523
531
  }, function (s) {
524
- return _this.i18n.commaBetweenDayX0AndX1OfTheMonth();
532
+ return _this.i18n.commaBetweenDayX0AndX1OfTheMonth(s);
525
533
  }, function (s) {
526
- return _this.i18n.commaOnDayX0OfTheMonth();
534
+ return _this.i18n.commaOnDayX0OfTheMonth(s);
527
535
  });
528
536
  }
529
537
  break;
@@ -536,7 +544,7 @@ var cronstrueI18n = {exports: {}};
536
544
  var description = this.getSegmentDescription(this.expressionParts[6], "", function (s) {
537
545
  return /^\d+$/.test(s) ? new Date(parseInt(s), 1).getFullYear().toString() : s;
538
546
  }, function (s) {
539
- return stringUtilities_1.StringUtilities.format(_this.i18n.commaEveryX0Years(), s);
547
+ return stringUtilities_1.StringUtilities.format(_this.i18n.commaEveryX0Years(s), s);
540
548
  }, function (s) {
541
549
  return _this.i18n.commaYearX0ThroughYearX1() || _this.i18n.commaX0ThroughX1();
542
550
  }, function (s) {
@@ -617,8 +625,8 @@ var cronstrueI18n = {exports: {}};
617
625
  ExpressionDescriptor.prototype.generateRangeSegmentDescription = function (rangeExpression, getRangeDescriptionFormat, getSingleItemDescription) {
618
626
  var description = "";
619
627
  var rangeSegments = rangeExpression.split("-");
620
- var rangeSegment1Description = getSingleItemDescription(rangeSegments[0]);
621
- var rangeSegment2Description = getSingleItemDescription(rangeSegments[1]);
628
+ var rangeSegment1Description = getSingleItemDescription(rangeSegments[0], 1);
629
+ var rangeSegment2Description = getSingleItemDescription(rangeSegments[1], 2);
622
630
  var rangeDescriptionFormat = getRangeDescriptionFormat(rangeExpression);
623
631
  description += stringUtilities_1.StringUtilities.format(rangeDescriptionFormat, rangeSegment1Description, rangeSegment2Description);
624
632
  return description;
@@ -669,7 +677,7 @@ var cronstrueI18n = {exports: {}};
669
677
 
670
678
 
671
679
  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;
680
+ 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
681
  var en_1 = __webpack_require__(751);
674
682
  Object.defineProperty(exports, "en", ({ enumerable: true, get: function () { return en_1.en; } }));
675
683
  var da_1 = __webpack_require__(904);
@@ -734,6 +742,8 @@ var cronstrueI18n = {exports: {}};
734
742
  Object.defineProperty(exports, "hu", ({ enumerable: true, get: function () { return hu_1.hu; } }));
735
743
  var af_1 = __webpack_require__(675);
736
744
  Object.defineProperty(exports, "af", ({ enumerable: true, get: function () { return af_1.af; } }));
745
+ var th_1 = __webpack_require__(312);
746
+ Object.defineProperty(exports, "th", ({ enumerable: true, get: function () { return th_1.th; } }));
737
747
 
738
748
 
739
749
  /***/ }),
@@ -3771,13 +3781,13 @@ var cronstrueI18n = {exports: {}};
3771
3781
  return "1시간마다";
3772
3782
  };
3773
3783
  ko.prototype.atSpace = function () {
3774
- return "에서 ";
3784
+ return "시간 ";
3775
3785
  };
3776
3786
  ko.prototype.everyMinuteBetweenX0AndX1 = function () {
3777
3787
  return "%s 및 %s 사이에 매 분";
3778
3788
  };
3779
3789
  ko.prototype.at = function () {
3780
- return "에서";
3790
+ return "시간";
3781
3791
  };
3782
3792
  ko.prototype.spaceAnd = function () {
3783
3793
  return " 및";
@@ -3822,7 +3832,7 @@ var cronstrueI18n = {exports: {}};
3822
3832
  return ", %s에서 %s까지";
3823
3833
  };
3824
3834
  ko.prototype.commaAndX0ThroughX1 = function () {
3825
- return ", 및%s에서 %s까지";
3835
+ return ", 및 %s에서 %s까지";
3826
3836
  };
3827
3837
  ko.prototype.first = function () {
3828
3838
  return "첫 번째";
@@ -5031,6 +5041,18 @@ var cronstrueI18n = {exports: {}};
5031
5041
 
5032
5042
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5033
5043
  exports.ru = void 0;
5044
+ var getPhraseByNumber = function (str, words) {
5045
+ var number = Number(str);
5046
+ return number !== undefined
5047
+ ? words[number % 100 > 4 && number % 100 < 20 ? 2 : [2, 0, 1, 1, 1, 2][number % 10 < 5 ? Math.abs(number) % 10 : 5]]
5048
+ : words[2];
5049
+ };
5050
+ var getPhraseByDayOfWeek = function (str, words) {
5051
+ var number = Number(str);
5052
+ return number !== undefined
5053
+ ? words[number === 0 ? 0 : number === 1 || number === 2 || number === 4 ? 1 : 2]
5054
+ : words[1];
5055
+ };
5034
5056
  var ru = (function () {
5035
5057
  function ru() {
5036
5058
  }
@@ -5073,26 +5095,26 @@ var cronstrueI18n = {exports: {}};
5073
5095
  ru.prototype.everySecond = function () {
5074
5096
  return "каждую секунду";
5075
5097
  };
5076
- ru.prototype.everyX0Seconds = function () {
5077
- return "каждые %s секунд";
5098
+ ru.prototype.everyX0Seconds = function (s) {
5099
+ return getPhraseByNumber(s, ["каждую %s секунду", "каждые %s секунды", "каждые %s секунд"]);
5078
5100
  };
5079
5101
  ru.prototype.secondsX0ThroughX1PastTheMinute = function () {
5080
5102
  return "секунды с %s по %s";
5081
5103
  };
5082
- ru.prototype.atX0SecondsPastTheMinute = function () {
5083
- return "в %s секунд";
5104
+ ru.prototype.atX0SecondsPastTheMinute = function (s) {
5105
+ return getPhraseByNumber(s, ["в %s секунду", "в %s секунды", "в %s секунд"]);
5084
5106
  };
5085
- ru.prototype.everyX0Minutes = function () {
5086
- return "каждые %s минут";
5107
+ ru.prototype.everyX0Minutes = function (s) {
5108
+ return getPhraseByNumber(s, ["каждую %s минуту", "каждые %s минуты", "каждые %s минут"]);
5087
5109
  };
5088
5110
  ru.prototype.minutesX0ThroughX1PastTheHour = function () {
5089
5111
  return "минуты с %s по %s";
5090
5112
  };
5091
- ru.prototype.atX0MinutesPastTheHour = function () {
5092
- return "в %s минут";
5113
+ ru.prototype.atX0MinutesPastTheHour = function (s) {
5114
+ return getPhraseByNumber(s, ["в %s минуту", "в %s минуты", "в %s минут"]);
5093
5115
  };
5094
- ru.prototype.everyX0Hours = function () {
5095
- return "каждые %s часов";
5116
+ ru.prototype.everyX0Hours = function (s) {
5117
+ return getPhraseByNumber(s, ["каждый %s час", "каждые %s часа", "каждые %s часов"]);
5096
5118
  };
5097
5119
  ru.prototype.betweenX0AndX1 = function () {
5098
5120
  return "с %s по %s";
@@ -5103,32 +5125,32 @@ var cronstrueI18n = {exports: {}};
5103
5125
  ru.prototype.commaEveryDay = function () {
5104
5126
  return ", каждый день";
5105
5127
  };
5106
- ru.prototype.commaEveryX0DaysOfTheWeek = function () {
5107
- return ", каждые %s дней недели";
5128
+ ru.prototype.commaEveryX0DaysOfTheWeek = function (s) {
5129
+ return getPhraseByNumber(s, ["", ", каждые %s дня недели", ", каждые %s дней недели"]);
5108
5130
  };
5109
- ru.prototype.commaX0ThroughX1 = function () {
5110
- return ", %s по %s";
5131
+ ru.prototype.commaX0ThroughX1 = function (s) {
5132
+ return s && (s[0] == "2" || s[0] == "3") ? ", со %s по %s" : ", с %s по %s";
5111
5133
  };
5112
- ru.prototype.commaAndX0ThroughX1 = function () {
5113
- return ", и %s по %s";
5134
+ ru.prototype.commaAndX0ThroughX1 = function (s) {
5135
+ return s && (s[0] == "2" || s[0] == "3") ? " и со %s по %s" : " и с %s по %s";
5114
5136
  };
5115
- ru.prototype.first = function () {
5116
- return "первый";
5137
+ ru.prototype.first = function (s) {
5138
+ return getPhraseByDayOfWeek(s, ["первое", "первый", "первую"]);
5117
5139
  };
5118
- ru.prototype.second = function () {
5119
- return "второй";
5140
+ ru.prototype.second = function (s) {
5141
+ return getPhraseByDayOfWeek(s, ["второе", "второй", "вторую"]);
5120
5142
  };
5121
- ru.prototype.third = function () {
5122
- return "третий";
5143
+ ru.prototype.third = function (s) {
5144
+ return getPhraseByDayOfWeek(s, ["третье", "третий", "третью"]);
5123
5145
  };
5124
- ru.prototype.fourth = function () {
5125
- return "четвертый";
5146
+ ru.prototype.fourth = function (s) {
5147
+ return getPhraseByDayOfWeek(s, ["четвертое", "четвертый", "четвертую"]);
5126
5148
  };
5127
- ru.prototype.fifth = function () {
5128
- return "пятый";
5149
+ ru.prototype.fifth = function (s) {
5150
+ return getPhraseByDayOfWeek(s, ["пятое", "пятый", "пятую"]);
5129
5151
  };
5130
- ru.prototype.commaOnThe = function () {
5131
- return ", в ";
5152
+ ru.prototype.commaOnThe = function (s) {
5153
+ return s === "2" ? ", во " : ", в ";
5132
5154
  };
5133
5155
  ru.prototype.spaceX0OfTheMonth = function () {
5134
5156
  return " %s месяца";
@@ -5136,17 +5158,20 @@ var cronstrueI18n = {exports: {}};
5136
5158
  ru.prototype.lastDay = function () {
5137
5159
  return "последний день";
5138
5160
  };
5139
- ru.prototype.commaOnTheLastX0OfTheMonth = function () {
5140
- return ", в последний %s месяца";
5161
+ ru.prototype.commaOnTheLastX0OfTheMonth = function (s) {
5162
+ return getPhraseByDayOfWeek(s, [", в последнее %s месяца", ", в последний %s месяца", ", в последнюю %s месяца"]);
5141
5163
  };
5142
- ru.prototype.commaOnlyOnX0 = function () {
5143
- return ", только в %s";
5164
+ ru.prototype.commaOnlyOnX0 = function (s) {
5165
+ return s && s[0] === "2" ? ", только во %s" : ", только в %s";
5144
5166
  };
5145
5167
  ru.prototype.commaAndOnX0 = function () {
5146
- return ", и в %s";
5168
+ return ", и %s";
5169
+ };
5170
+ ru.prototype.commaEveryX0Months = function (s) {
5171
+ return getPhraseByNumber(s, ["", " каждые %s месяца", " каждые %s месяцев"]);
5147
5172
  };
5148
- ru.prototype.commaEveryX0Months = function () {
5149
- return ", каждые %s месяцев";
5173
+ ru.prototype.commaOnlyInMonthX0 = function () {
5174
+ return ", только %s";
5150
5175
  };
5151
5176
  ru.prototype.commaOnlyInX0 = function () {
5152
5177
  return ", только в %s";
@@ -5157,29 +5182,33 @@ var cronstrueI18n = {exports: {}};
5157
5182
  ru.prototype.commaOnTheLastWeekdayOfTheMonth = function () {
5158
5183
  return ", в последний будний день месяца";
5159
5184
  };
5160
- ru.prototype.commaDaysBeforeTheLastDayOfTheMonth = function () {
5161
- return ", %s дней до последнего дня месяца";
5185
+ ru.prototype.commaDaysBeforeTheLastDayOfTheMonth = function (s) {
5186
+ return getPhraseByNumber(s, [
5187
+ ", за %s день до конца месяца",
5188
+ ", за %s дня до конца месяца",
5189
+ ", за %s дней до конца месяца",
5190
+ ]);
5162
5191
  };
5163
5192
  ru.prototype.firstWeekday = function () {
5164
5193
  return "первый будний день";
5165
5194
  };
5166
5195
  ru.prototype.weekdayNearestDayX0 = function () {
5167
- return "ближайший будний день к %s";
5196
+ return "ближайший будний день к %s числу";
5168
5197
  };
5169
5198
  ru.prototype.commaOnTheX0OfTheMonth = function () {
5170
5199
  return ", в %s месяца";
5171
5200
  };
5172
- ru.prototype.commaEveryX0Days = function () {
5173
- return ", каждые %s дней";
5201
+ ru.prototype.commaEveryX0Days = function (s) {
5202
+ return getPhraseByNumber(s, [", каждый %s день", ", каждые %s дня", ", каждые %s дней"]);
5174
5203
  };
5175
- ru.prototype.commaBetweenDayX0AndX1OfTheMonth = function () {
5176
- return ", с %s по %s число месяца";
5204
+ ru.prototype.commaBetweenDayX0AndX1OfTheMonth = function (s) {
5205
+ return s && s.substring(0, s.indexOf("-")) == "2" ? ", со %s по %s число месяца" : ", с %s по %s число месяца";
5177
5206
  };
5178
- ru.prototype.commaOnDayX0OfTheMonth = function () {
5179
- return ", в %s число месяца";
5207
+ ru.prototype.commaOnDayX0OfTheMonth = function (s) {
5208
+ return s && s[0] == "2" ? ", во %s число месяца" : ", в %s число месяца";
5180
5209
  };
5181
- ru.prototype.commaEveryX0Years = function () {
5182
- return ", каждые %s лет";
5210
+ ru.prototype.commaEveryX0Years = function (s) {
5211
+ return getPhraseByNumber(s, [", каждый %s год", ", каждые %s года", ", каждые %s лет"]);
5183
5212
  };
5184
5213
  ru.prototype.commaStartingX0 = function () {
5185
5214
  return ", начало %s";
@@ -5187,6 +5216,12 @@ var cronstrueI18n = {exports: {}};
5187
5216
  ru.prototype.daysOfTheWeek = function () {
5188
5217
  return ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"];
5189
5218
  };
5219
+ ru.prototype.daysOfTheWeekInCase = function (f) {
5220
+ if (f === void 0) { f = 2; }
5221
+ return f == 1
5222
+ ? ["воскресенья", "понедельника", "вторника", "среды", "четверга", "пятницы", "субботы"]
5223
+ : ["воскресенье", "понедельник", "вторник", "среду", "четверг", "пятницу", "субботу"];
5224
+ };
5190
5225
  ru.prototype.monthsOfTheYear = function () {
5191
5226
  return [
5192
5227
  "январь",
@@ -5203,6 +5238,24 @@ var cronstrueI18n = {exports: {}};
5203
5238
  "декабрь",
5204
5239
  ];
5205
5240
  };
5241
+ ru.prototype.monthsOfTheYearInCase = function (f) {
5242
+ return f == 1
5243
+ ? [
5244
+ "января",
5245
+ "февраля",
5246
+ "марта",
5247
+ "апреля",
5248
+ "мая",
5249
+ "июня",
5250
+ "июля",
5251
+ "августа",
5252
+ "сентября",
5253
+ "октября",
5254
+ "ноября",
5255
+ "декабря",
5256
+ ]
5257
+ : this.monthsOfTheYear();
5258
+ };
5206
5259
  return ru;
5207
5260
  }());
5208
5261
  exports.ru = ru;
@@ -5948,6 +6001,194 @@ var cronstrueI18n = {exports: {}};
5948
6001
  exports.sw = sw;
5949
6002
 
5950
6003
 
6004
+ /***/ }),
6005
+
6006
+ /***/ 312:
6007
+ /***/ ((__unused_webpack_module, exports) => {
6008
+
6009
+
6010
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
6011
+ exports.th = void 0;
6012
+ var th = (function () {
6013
+ function th() {
6014
+ }
6015
+ th.prototype.atX0SecondsPastTheMinuteGt20 = function () {
6016
+ return null;
6017
+ };
6018
+ th.prototype.atX0MinutesPastTheHourGt20 = function () {
6019
+ return null;
6020
+ };
6021
+ th.prototype.commaMonthX0ThroughMonthX1 = function () {
6022
+ return null;
6023
+ };
6024
+ th.prototype.commaYearX0ThroughYearX1 = function () {
6025
+ return null;
6026
+ };
6027
+ th.prototype.use24HourTimeFormatByDefault = function () {
6028
+ return false;
6029
+ };
6030
+ th.prototype.anErrorOccuredWhenGeneratingTheExpressionD = function () {
6031
+ return "เกิดข้อผิดพลาดขณะสร้างคำอธิบายนิพจน์ ตรวจสอบไวยากรณ์นิพจน์ครอน";
6032
+ };
6033
+ th.prototype.everyMinute = function () {
6034
+ return "ทุกๆ นาที";
6035
+ };
6036
+ th.prototype.everyHour = function () {
6037
+ return "ทุกๆ ชั่วโมง";
6038
+ };
6039
+ th.prototype.atSpace = function () {
6040
+ return "เมื่อ ";
6041
+ };
6042
+ th.prototype.everyMinuteBetweenX0AndX1 = function () {
6043
+ return "ทุกๆ นาที %s และ %s";
6044
+ };
6045
+ th.prototype.at = function () {
6046
+ return "เมื่อ";
6047
+ };
6048
+ th.prototype.spaceAnd = function () {
6049
+ return " และ";
6050
+ };
6051
+ th.prototype.everySecond = function () {
6052
+ return "ทุกๆ วินาที";
6053
+ };
6054
+ th.prototype.everyX0Seconds = function () {
6055
+ return "ทุกๆ %s วินาที";
6056
+ };
6057
+ th.prototype.secondsX0ThroughX1PastTheMinute = function () {
6058
+ return "วินาที %s ถึง %s นาทีที่ผ่านมา";
6059
+ };
6060
+ th.prototype.atX0SecondsPastTheMinute = function () {
6061
+ return "เมื่อ %s วินาที นาทีที่ผ่านมา";
6062
+ };
6063
+ th.prototype.everyX0Minutes = function () {
6064
+ return "ทุกๆ %s นาที";
6065
+ };
6066
+ th.prototype.minutesX0ThroughX1PastTheHour = function () {
6067
+ return "นาที %s ถึง %s ชั่วโมงที่ผ่านมา";
6068
+ };
6069
+ th.prototype.atX0MinutesPastTheHour = function () {
6070
+ return "เมื่อ %s นาที ชั่วโมงที่ผ่านมา";
6071
+ };
6072
+ th.prototype.everyX0Hours = function () {
6073
+ return "ทุกๆ %s ชั่วโมง";
6074
+ };
6075
+ th.prototype.betweenX0AndX1 = function () {
6076
+ return "ระหว่าง %s ถึง %s";
6077
+ };
6078
+ th.prototype.atX0 = function () {
6079
+ return "เมื่อ %s";
6080
+ };
6081
+ th.prototype.commaEveryDay = function () {
6082
+ return ", ทุกๆ วัน";
6083
+ };
6084
+ th.prototype.commaEveryX0DaysOfTheWeek = function () {
6085
+ return ", ทุกๆ %s วันของสัปดาห์";
6086
+ };
6087
+ th.prototype.commaX0ThroughX1 = function () {
6088
+ return ", %s ถึง %s";
6089
+ };
6090
+ th.prototype.commaAndX0ThroughX1 = function () {
6091
+ return ", %s ถึง %s";
6092
+ };
6093
+ th.prototype.first = function () {
6094
+ return "แรก";
6095
+ };
6096
+ th.prototype.second = function () {
6097
+ return "ที่สอง";
6098
+ };
6099
+ th.prototype.third = function () {
6100
+ return "ที่สาม";
6101
+ };
6102
+ th.prototype.fourth = function () {
6103
+ return "ที่สี่";
6104
+ };
6105
+ th.prototype.fifth = function () {
6106
+ return "ที่ห้า";
6107
+ };
6108
+ th.prototype.commaOnThe = function () {
6109
+ return ", ในวัน ";
6110
+ };
6111
+ th.prototype.spaceX0OfTheMonth = function () {
6112
+ return " %s ของเดือน";
6113
+ };
6114
+ th.prototype.lastDay = function () {
6115
+ return "วันสุดท้าย";
6116
+ };
6117
+ th.prototype.commaOnTheLastX0OfTheMonth = function () {
6118
+ return ", ณ สุดท้าย %s ของเดือน";
6119
+ };
6120
+ th.prototype.commaOnlyOnX0 = function () {
6121
+ return ", เท่านั้น %s";
6122
+ };
6123
+ th.prototype.commaAndOnX0 = function () {
6124
+ return ", และใน %s";
6125
+ };
6126
+ th.prototype.commaEveryX0Months = function () {
6127
+ return ", ทุกๆ %s เดือน";
6128
+ };
6129
+ th.prototype.commaOnlyInX0 = function () {
6130
+ return ", เท่านั้น %s";
6131
+ };
6132
+ th.prototype.commaOnTheLastDayOfTheMonth = function () {
6133
+ return ", ในวันสิ้นเดือน";
6134
+ };
6135
+ th.prototype.commaOnTheLastWeekdayOfTheMonth = function () {
6136
+ return ", ในวันธรรมดาสุดท้ายของเดือน";
6137
+ };
6138
+ th.prototype.commaDaysBeforeTheLastDayOfTheMonth = function () {
6139
+ return ", %s วันก่อนวันสุดท้ายของเดือน";
6140
+ };
6141
+ th.prototype.firstWeekday = function () {
6142
+ return "วันธรรมดาวันแรก";
6143
+ };
6144
+ th.prototype.weekdayNearestDayX0 = function () {
6145
+ return "วันธรรมดาที่ใกล้ที่สุด %s";
6146
+ };
6147
+ th.prototype.commaOnTheX0OfTheMonth = function () {
6148
+ return ", ในวัน %s ของเดือน";
6149
+ };
6150
+ th.prototype.commaEveryX0Days = function () {
6151
+ return ", ทุกๆ %s วัน";
6152
+ };
6153
+ th.prototype.commaBetweenDayX0AndX1OfTheMonth = function () {
6154
+ return ", ระหว่างวัน %s และ %s ของเดือน";
6155
+ };
6156
+ th.prototype.commaOnDayX0OfTheMonth = function () {
6157
+ return ", ในวัน %s ของเดือน";
6158
+ };
6159
+ th.prototype.commaEveryHour = function () {
6160
+ return ", ทุกๆ ชั่วโมง";
6161
+ };
6162
+ th.prototype.commaEveryX0Years = function () {
6163
+ return ", ทุกๆ %s ปี";
6164
+ };
6165
+ th.prototype.commaStartingX0 = function () {
6166
+ return ", เริ่ม %s";
6167
+ };
6168
+ th.prototype.daysOfTheWeek = function () {
6169
+ return ["วันอาทิตย์", "วันจันทร์", "วันอังคาร", "วันพุธ", "วันพฤหัสบดี", "วันศุกร์", "วันเสาร์"];
6170
+ };
6171
+ th.prototype.monthsOfTheYear = function () {
6172
+ return [
6173
+ "มกราคม",
6174
+ "กุมภาพันธ์",
6175
+ "มีนาคม",
6176
+ "เมษายน",
6177
+ "พฤษภาคม",
6178
+ "มิถุนายน",
6179
+ "กรกฎาคม",
6180
+ "สิงหาคม",
6181
+ "กันยายน",
6182
+ "ตุลาคม",
6183
+ "พฤศจิกายน",
6184
+ "ธันวาคม",
6185
+ ];
6186
+ };
6187
+ return th;
6188
+ }());
6189
+ exports.th = th;
6190
+
6191
+
5951
6192
  /***/ }),
5952
6193
 
5953
6194
  /***/ 999:
@@ -6859,34 +7100,34 @@ const MinutesCron = (props) => {
6859
7100
  }
6860
7101
  };
6861
7102
  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)')] })));
7103
+ 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
7104
  };
6864
7105
 
6865
7106
  const MinutesSelect = (props) => {
6866
7107
  const buildOptions = () => {
6867
7108
  let options = [];
6868
7109
  for (let i = 0; i < 60; i++) {
6869
- options.push(jsxRuntime.jsx("option", Object.assign({ id: i.toString() }, { children: (i < 10 ? '0' : '') + i }), i));
7110
+ options.push(jsx("option", Object.assign({ id: i.toString() }, { children: (i < 10 ? '0' : '') + i }), i));
6870
7111
  }
6871
7112
  return options;
6872
7113
  };
6873
- return (jsxRuntime.jsx("select", Object.assign({ disabled: props.disabled === true ? true : false, className: "minutes", onChange: props.onChange, value: props.value }, { children: buildOptions() })));
7114
+ return (jsx("select", Object.assign({ disabled: props.disabled === true ? true : false, className: "minutes", onChange: props.onChange, value: props.value }, { children: buildOptions() })));
6874
7115
  };
6875
7116
 
6876
7117
  const HourSelect = (props) => {
6877
7118
  const buildOptions = () => {
6878
7119
  let options = [];
6879
7120
  for (let i = 0; i < 24; i++) {
6880
- options.push(jsxRuntime.jsx("option", Object.assign({ id: i.toString() }, { children: (i < 10 ? '0' : '') + i }), i));
7121
+ options.push(jsx("option", Object.assign({ id: i.toString() }, { children: (i < 10 ? '0' : '') + i }), i));
6881
7122
  }
6882
7123
  return options;
6883
7124
  };
6884
- return (jsxRuntime.jsx("select", Object.assign({ disabled: props.disabled === true ? true : false, className: "hours", onChange: props.onChange, value: props.value }, { children: buildOptions() })));
7125
+ return (jsx("select", Object.assign({ disabled: props.disabled === true ? true : false, className: "hours", onChange: props.onChange, value: props.value }, { children: buildOptions() })));
6885
7126
  };
6886
7127
 
6887
7128
  const DailyCron = (props) => {
6888
- const [state, setState] = react.useState({ hour: 0, minute: 0, every: false });
6889
- react.useEffect(() => {
7129
+ const [state, setState] = useState({ hour: 0, minute: 0, every: false });
7130
+ useEffect(() => {
6890
7131
  setState(Object.assign(Object.assign({}, state), { every: props.value[3] !== '?' }));
6891
7132
  }, []);
6892
7133
  const onDayChange = (e) => {
@@ -6907,12 +7148,12 @@ const DailyCron = (props) => {
6907
7148
  props.onChange(val);
6908
7149
  };
6909
7150
  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] })] })));
7151
+ 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
7152
  };
6912
7153
 
6913
7154
  const HourlyCron = (props) => {
6914
- const [state, setState] = react.useState({ every: false });
6915
- react.useEffect(() => {
7155
+ const [state, setState] = useState({ every: false });
7156
+ useEffect(() => {
6916
7157
  if (props.value[2].split('/')[1] || props.value[2] === '*') {
6917
7158
  setState(Object.assign(Object.assign({}, state), { every: true }));
6918
7159
  }
@@ -6946,7 +7187,7 @@ const HourlyCron = (props) => {
6946
7187
  props.onChange(val);
6947
7188
  };
6948
7189
  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] })] })) }))] })) })));
7190
+ 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
7191
  };
6951
7192
 
6952
7193
  const WeeklyCron = (props) => {
@@ -6996,12 +7237,12 @@ const WeeklyCron = (props) => {
6996
7237
  val[5] = valFive;
6997
7238
  };
6998
7239
  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", { className: 'min_height_auto', type: "checkbox", value: "MON", onChange: onCheck, checked: (props.value[5].search('MON') !== -1) ? true : false }), translateFn('Monday'), jsxRuntime.jsx("br", {}), jsxRuntime.jsx("input", { className: 'min_height_auto', type: "checkbox", value: "WED", onChange: onCheck, checked: props.value[5].search('WED') !== -1 ? true : false }), translateFn('Wednesday'), jsxRuntime.jsx("br", {}), jsxRuntime.jsx("input", { className: 'min_height_auto', type: "checkbox", value: "FRI", onChange: onCheck, checked: (props.value[5].search('FRI') !== -1) ? true : false }), translateFn('Friday'), jsxRuntime.jsx("br", {}), jsxRuntime.jsx("input", { className: 'min_height_auto', 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", { className: 'min_height_auto', type: "checkbox", value: "TUE", onChange: onCheck, checked: props.value[5].search('TUE') !== -1 ? true : false }), translateFn('Tuesday'), jsxRuntime.jsx("br", {}), jsxRuntime.jsx("input", { className: 'min_height_auto', type: "checkbox", value: "THU", onChange: onCheck, checked: props.value[5].search('THU') !== -1 ? true : false }), translateFn('Thursday'), jsxRuntime.jsx("br", {}), jsxRuntime.jsx("input", { className: 'min_height_auto', 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] })] })));
7240
+ 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
7241
  };
7001
7242
 
7002
7243
  const MonthlyCron = (props) => {
7003
- const [state, setState] = react.useState({ hour: 0, minute: 0, every: "" });
7004
- react.useEffect(() => {
7244
+ const [state, setState] = useState({ hour: 0, minute: 0, every: "" });
7245
+ useEffect(() => {
7005
7246
  let every;
7006
7247
  if (props.value[3] === 'L') {
7007
7248
  every = "2";
@@ -7047,7 +7288,7 @@ const MonthlyCron = (props) => {
7047
7288
  props.onChange(val);
7048
7289
  };
7049
7290
  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] })] })));
7291
+ 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
7292
  };
7052
7293
 
7053
7294
  const CustomCron = (props) => {
@@ -7056,7 +7297,7 @@ const CustomCron = (props) => {
7056
7297
  };
7057
7298
  const translateFn = props.translate;
7058
7299
  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 })] })));
7300
+ return (jsxs("div", Object.assign({ className: "well" }, { children: [translateFn('Expression'), " ", jsx("input", { type: "text", onChange: onChange, value: val })] })));
7060
7301
  };
7061
7302
 
7062
7303
  const HEADER = {
@@ -7169,8 +7410,8 @@ styleInject(css_248z);
7169
7410
 
7170
7411
  const defaultCron = '0 0 00 1/1 * ? *';
7171
7412
  const Cron = (props) => {
7172
- const [state, setState] = react.useState({ value: [], headers: loadHeaders(props.options), locale: props.locale ? props.locale : 'en' });
7173
- react.useEffect(() => {
7413
+ const [state, setState] = useState({ value: [], headers: loadHeaders(props.options), locale: props.locale ? props.locale : 'en' });
7414
+ useEffect(() => {
7174
7415
  setValue(props.value ? props.value : "");
7175
7416
  if (props.translateFn && !props.locale) {
7176
7417
  console.log('Warning !!! locale not set while using translateFn');
@@ -7179,7 +7420,7 @@ const Cron = (props) => {
7179
7420
  // this.props.onRef(this);
7180
7421
  // }
7181
7422
  }, []);
7182
- react.useEffect(() => {
7423
+ useEffect(() => {
7183
7424
  let newVal = '';
7184
7425
  newVal = state.value.toString().replace(/,/g, ' ');
7185
7426
  newVal = newVal.replace(/!/g, ',');
@@ -7187,7 +7428,7 @@ const Cron = (props) => {
7187
7428
  setValue(props.value ? props.value : "");
7188
7429
  }
7189
7430
  }, [props.value]);
7190
- react.useEffect(() => {
7431
+ useEffect(() => {
7191
7432
  parentChange(state.value);
7192
7433
  }, [state.value]);
7193
7434
  const setValue = (value) => {
@@ -7237,7 +7478,7 @@ const Cron = (props) => {
7237
7478
  };
7238
7479
  const getHeaders = () => {
7239
7480
  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);
7481
+ 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
7482
  });
7242
7483
  };
7243
7484
  const onValueChange = (val) => {
@@ -7279,7 +7520,7 @@ const Cron = (props) => {
7279
7520
  throw new Error('Value does not match any available headers.');
7280
7521
  }
7281
7522
  const CronComponent = selectedMetaData.component;
7282
- return jsxRuntime.jsx(CronComponent, { translate: translate, value: state.value, onChange: onValueChange });
7523
+ return jsx(CronComponent, { translate: translate, value: state.value, onChange: onValueChange });
7283
7524
  };
7284
7525
  const translate = (key) => {
7285
7526
  let translatedText = key;
@@ -7291,6 +7532,19 @@ const Cron = (props) => {
7291
7532
  }
7292
7533
  return translatedText;
7293
7534
  };
7535
+ 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, ',') }))] })));
7536
+ };
7537
+
7538
+ export { HEADER, Cron as default };
7539
+ //# sourceMappingURL=index.js.map
7540
+
7541
+ translatedText = props.translateFn(key);
7542
+ if (typeof translatedText !== 'string') {
7543
+ throw new Error('translateFn expects a string translation');
7544
+ }
7545
+ }
7546
+ return translatedText;
7547
+ };
7294
7548
  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
7549
  };
7296
7550