awing-library 2.1.99-beta → 2.1.100-beta

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.
@@ -32,14 +32,13 @@ var react_1 = __importDefault(require("react"));
32
32
  var react_i18next_1 = require("react-i18next");
33
33
  var BasicInput_1 = __importDefault(require("./BasicInput"));
34
34
  var validation_1 = require("../../../AWING/ultis/validation");
35
- var cronRegex = /^(\*|[0-5]?\d)(?:\/\d+)? (\*|1?\d|2[0-3])(?:\/\d+)? (\*|0?[1-9]|[12]\d|3[01])(?:\/\d+)? (\*|0?[1-9]|1[0-2]|(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec))(?:\/\d+)? (\*|0?[0-7]|(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat))(?:\/\d+)?$/;
36
35
  var CornJobInput = function (_a) {
37
36
  var jobModel = _a.jobModel, handleChange = _a.handleChange;
38
37
  var t = (0, react_i18next_1.useTranslation)().t;
39
38
  return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: 'relative' }, children: (0, jsx_runtime_1.jsx)(BasicInput_1.default, { fullWidth: true, sx: {
40
39
  marginTop: function (t) { return t.spacing(1); },
41
40
  marginBottom: function (t) { return t.spacing(1); },
42
- }, name: "cronTime", label: t('TaskScheduler.Help.Crontime'), onChange: handleChange, value: jobModel.cronTime, checkValid: function (value) { return (0, validation_1.textValidation)(value, 50, true, cronRegex, /^.*$/); }, InputProps: {
41
+ }, name: "cronTime", label: t('TaskScheduler.Help.Crontime'), onChange: handleChange, value: jobModel.cronTime, checkValid: function (value) { return (0, validation_1.textValidation)(value, 50, true, false, false); }, InputProps: {
43
42
  startAdornment: ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "start", sx: { marginRight: '30px' }, children: (0, jsx_runtime_1.jsx)(HtmlTooltip, { arrow: true, placement: "bottom-start", title: (0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: t('TaskScheduler.Help.Crontime') }), (0, jsx_runtime_1.jsxs)("p", { children: [(0, jsx_runtime_1.jsxs)("span", { children: ["[", t('Common.Minute'), "]"] }), (0, jsx_runtime_1.jsxs)("span", { children: ["_[", t('Common.Hour'), "]"] }), (0, jsx_runtime_1.jsxs)("span", { children: ["_[", t('Common.Day'), "]"] }), (0, jsx_runtime_1.jsxs)("span", { children: ["_[", t('Common.Month'), "]"] }), (0, jsx_runtime_1.jsxs)("span", { children: ["_[", t('Common.DayOfWeek'), "]"] })] }), (0, jsx_runtime_1.jsx)("table", { children: (0, jsx_runtime_1.jsxs)("tbody", { children: [(0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsxs)("th", { children: [t('Common.Minute'), ":"] }), (0, jsx_runtime_1.jsx)("td", { children: "0 - 59" })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsxs)("th", { children: [t('Common.Hour'), ":"] }), (0, jsx_runtime_1.jsx)("td", { children: "0 - 23" })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsxs)("th", { children: [t('Common.Day'), ":"] }), (0, jsx_runtime_1.jsx)("td", { children: "1 - 31" })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsxs)("th", { children: [t('Common.Month'), ":"] }), (0, jsx_runtime_1.jsx)("td", { children: "1 - 12" })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsxs)("th", { children: [t('Common.DayOfWeek'), ":"] }), (0, jsx_runtime_1.jsx)("td", { children: "0 - 6" })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { children: "*" }), (0, jsx_runtime_1.jsx)("td", { children: t('TaskScheduler.Help.*') })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { children: "," }), (0, jsx_runtime_1.jsx)("td", { children: t('TaskScheduler.Help.,') })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { children: "-" }), (0, jsx_runtime_1.jsx)("td", { children: t('TaskScheduler.Help.-') })] }), (0, jsx_runtime_1.jsxs)("tr", { children: [(0, jsx_runtime_1.jsx)("th", { children: "/" }), (0, jsx_runtime_1.jsx)("td", { children: t('TaskScheduler.Help./') })] })] }) })] }), children: (0, jsx_runtime_1.jsx)(icons_material_1.HelpOutline, { fontSize: "small", color: "action", style: { position: 'absolute', left: '0' } }) }) })),
44
43
  } }) }));
45
44
  };
@@ -96,7 +96,7 @@ exports.logicExpressionValid = logicExpressionValid;
96
96
  var textValidation = function (str, length, required, pattern, invertRegex) {
97
97
  if (length === void 0) { length = 50; }
98
98
  if (required === void 0) { required = true; }
99
- if (pattern === void 0) { pattern = /^[a-zA-Z0-9\/\-_.()\[\] ]+$/g; }
99
+ if (pattern === void 0) { pattern = /^[a-zA-Z0-9đĐ\/\-_.()\[\] \u0080-\uFFFF]+$/g; }
100
100
  var validRes = {
101
101
  valid: true,
102
102
  message: [],
@@ -106,18 +106,11 @@ var textValidation = function (str, length, required, pattern, invertRegex) {
106
106
  validRes.valid = false;
107
107
  validRes.message.push(i18n_1.default.t('Common.Required'));
108
108
  }
109
- var textTransform = String(str)
110
- .normalize('NFD')
111
- .toLowerCase()
112
- .replace(/\s\s+/g, ' ')
113
- .replace(/[\u0300-\u036f]/g, '')
114
- .replace(/đ/g, 'd')
115
- .trim();
116
- if (textTransform && pattern && !pattern.test(textTransform)) {
109
+ if (str && pattern && !pattern.test(str)) {
117
110
  validRes.valid = false;
118
111
  if (invertRegex !== false) {
119
112
  var invertedRegex = invertRegex || new RegExp("[^".concat(pattern.source.replace(/[*+?^${}|]/g, ''), "]").replace(/\[\[|\]\]/g, ']'), 'g');
120
- validRes.message.push("".concat(i18n_1.default.t('Common.InvalidChars'), ": ").concat(Array.from(new Set(textTransform.match(invertedRegex))).join(' ')));
113
+ validRes.message.push("".concat(i18n_1.default.t('Common.InvalidChars'), ": ").concat(Array.from(new Set(str.match(invertedRegex))).join(' ')));
121
114
  }
122
115
  }
123
116
  var byteSize = new Blob([str]).size;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.99-beta",
3
+ "version": "2.1.100-beta",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",