aq-fe-framework 0.1.282 → 0.1.284
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.
@@ -270,7 +270,7 @@ var utils_time_getCurrentTimeString = () => {
|
|
270
270
|
return `${hours}:${minutes}:${seconds}`;
|
271
271
|
};
|
272
272
|
|
273
|
-
// src/utils/
|
273
|
+
// src/utils/utils_validator.ts
|
274
274
|
import { isNotEmpty } from "@mantine/form";
|
275
275
|
function U0MyValidateEmpty(message) {
|
276
276
|
return isNotEmpty(message ? message : "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng");
|
@@ -278,6 +278,11 @@ function U0MyValidateEmpty(message) {
|
|
278
278
|
function U0MyValidateEmail(value) {
|
279
279
|
return /^\S+@\S+$/.test(value) ? null : "Email kh\xF4ng \u0111\xFAng \u0111\u1ECBnh d\u1EA1ng";
|
280
280
|
}
|
281
|
+
var utils_validator_validateCode = (value) => {
|
282
|
+
if (!value) return "Kh\xF4ng \u0111\u01B0\u1EE3c \u0111\u1EC3 tr\u1ED1ng";
|
283
|
+
const isValid = /^[A-Za-z0-9][A-Za-z0-9-]*$/.test(value);
|
284
|
+
return isValid ? null : "Ch\u1EC9 \u0111\u01B0\u1EE3c nh\u1EADp ch\u1EEF, s\u1ED1 v\xE0 d\u1EA5u '-' (kh\xF4ng b\u1EAFt \u0111\u1EA7u b\u1EB1ng '-')";
|
285
|
+
};
|
281
286
|
|
282
287
|
export {
|
283
288
|
U0DateToDDMMYYYString,
|
@@ -298,5 +303,6 @@ export {
|
|
298
303
|
utils_time_convertTimeStringToSeconds,
|
299
304
|
utils_time_getCurrentTimeString,
|
300
305
|
U0MyValidateEmpty,
|
301
|
-
U0MyValidateEmail
|
306
|
+
U0MyValidateEmail,
|
307
|
+
utils_validator_validateCode
|
302
308
|
};
|
package/dist/utils/index.d.mts
CHANGED
@@ -44,5 +44,6 @@ declare const utils_time_getCurrentTimeString: () => string;
|
|
44
44
|
|
45
45
|
declare function U0MyValidateEmpty(message?: string): (value: unknown) => React.ReactNode;
|
46
46
|
declare function U0MyValidateEmail(value?: string): "Email không đúng định dạng" | null;
|
47
|
+
declare const utils_validator_validateCode: (value?: string) => "Không được để trống" | "Chỉ được nhập chữ, số và dấu '-' (không bắt đầu bằng '-')" | null;
|
47
48
|
|
48
|
-
export { U0DateToDDMMYYYString, U0MyValidateEmail, U0MyValidateEmpty, updateEnableList, utils_converter_enumToSelectOptions, utils_converter_getKeyByValue, utils_converter_getLabelByValue, utils_currency_formatWithSuffix, utils_date_dateToDDMMYYYString, utils_date_formatToDateTimeStartEnd, utils_date_getHHmm, utils_notification_show, utils_pdf_download, utils_time_convertTimeStringToSeconds, utils_time_getCurrentTimeString };
|
49
|
+
export { U0DateToDDMMYYYString, U0MyValidateEmail, U0MyValidateEmpty, updateEnableList, utils_converter_enumToSelectOptions, utils_converter_getKeyByValue, utils_converter_getLabelByValue, utils_currency_formatWithSuffix, utils_date_dateToDDMMYYYString, utils_date_formatToDateTimeStartEnd, utils_date_getHHmm, utils_notification_show, utils_pdf_download, utils_time_convertTimeStringToSeconds, utils_time_getCurrentTimeString, utils_validator_validateCode };
|
package/dist/utils/index.mjs
CHANGED
@@ -16,8 +16,9 @@ import {
|
|
16
16
|
utils_file_docxtemplaterDownload,
|
17
17
|
utils_file_fileToAQDocumentType,
|
18
18
|
utils_time_convertTimeStringToSeconds,
|
19
|
-
utils_time_getCurrentTimeString
|
20
|
-
|
19
|
+
utils_time_getCurrentTimeString,
|
20
|
+
utils_validator_validateCode
|
21
|
+
} from "../chunk-4H6NEAG4.mjs";
|
21
22
|
import {
|
22
23
|
utils_pdf_download
|
23
24
|
} from "../chunk-5U2JSHSJ.mjs";
|
@@ -45,5 +46,6 @@ export {
|
|
45
46
|
utils_notification_show,
|
46
47
|
utils_pdf_download,
|
47
48
|
utils_time_convertTimeStringToSeconds,
|
48
|
-
utils_time_getCurrentTimeString
|
49
|
+
utils_time_getCurrentTimeString,
|
50
|
+
utils_validator_validateCode
|
49
51
|
};
|