aq-fe-framework 0.1.281 → 0.1.283

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.
@@ -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_validateForm_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 k\xFD t\u1EF1 th\u01B0\u1EDDng, s\u1ED1 , v\xE0 d\u1EA5u '-'";
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_validateForm_validateCode
302
308
  };
@@ -93,11 +93,6 @@ declare function MyAppSpotlight({ menu }: {
93
93
  menu: I_BasicAppShell_LinkItem[];
94
94
  }): react_jsx_runtime.JSX.Element;
95
95
 
96
- declare function MyAnchorViewPDF({ label, pdfLink }: {
97
- label: string;
98
- pdfLink: string;
99
- }): react_jsx_runtime.JSX.Element;
100
-
101
96
  interface CoreActionIconProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ActionIconProps {
102
97
  actionType?: type_action;
103
98
  }
@@ -109,6 +104,35 @@ interface CoreButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElem
109
104
  }
110
105
  declare function CoreButton({ children, actionType, ...rest }: CoreButtonProps): react_jsx_runtime.JSX.Element;
111
106
 
107
+ interface CoreButtonCreateUpdateProps<IReq, IRes> {
108
+ modalProps?: ModalProps;
109
+ actionIconProps?: ActionIconProps;
110
+ buttonProps?: ButtonProps;
111
+ isCreate?: boolean;
112
+ onSubmit: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>>;
113
+ onSuccess?: () => void;
114
+ onError?: () => void;
115
+ form: UseFormReturnType<IReq>;
116
+ closeModalWhenSubmit?: boolean;
117
+ resetFormWhenSubmit?: boolean;
118
+ disclosure?: ReturnType<typeof useDisclosure>;
119
+ children?: ReactNode;
120
+ }
121
+ declare function CoreButtonCreateUpdate<IReq, IRes>({ modalProps, actionIconProps, buttonProps, form, onSubmit, onSuccess, onError, closeModalWhenSubmit, resetFormWhenSubmit, children, disclosure: externalDisclosure, isCreate, }: CoreButtonCreateUpdateProps<IReq, IRes>): react_jsx_runtime.JSX.Element;
122
+
123
+ interface CoreButtonModalProps {
124
+ children?: ReactNode;
125
+ disclosure: ReturnType<typeof useDisclosure>;
126
+ buttonProps?: ButtonProps;
127
+ modalProps?: ModalProps;
128
+ }
129
+ declare function CoreButtonModal({ disclosure, children, buttonProps, modalProps, }: CoreButtonModalProps): react_jsx_runtime.JSX.Element;
130
+
131
+ declare function MyAnchorViewPDF({ label, pdfLink }: {
132
+ label: string;
133
+ pdfLink: string;
134
+ }): react_jsx_runtime.JSX.Element;
135
+
112
136
  interface IMyButton extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ButtonProps {
113
137
  crudType?: type_action;
114
138
  children?: ReactNode;
@@ -152,22 +176,6 @@ interface AQButtonExportDataProps {
152
176
  }
153
177
  declare function AQButtonExportData({ isAllData, objectName, data, exportConfig }: AQButtonExportDataProps): react_jsx_runtime.JSX.Element;
154
178
 
155
- interface CoreButtonCreateUpdateProps<IReq, IRes> {
156
- modalProps?: ModalProps;
157
- actionIconProps?: ActionIconProps;
158
- buttonProps?: ButtonProps;
159
- isCreate?: boolean;
160
- onSubmit: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>>;
161
- onSuccess?: () => void;
162
- onError?: () => void;
163
- form: UseFormReturnType<IReq>;
164
- closeModalWhenSubmit?: boolean;
165
- resetFormWhenSubmit?: boolean;
166
- disclosure?: ReturnType<typeof useDisclosure>;
167
- children?: ReactNode;
168
- }
169
- declare function CoreButtonCreateUpdate<IReq, IRes>({ modalProps, actionIconProps, buttonProps, form, onSubmit, onSuccess, onError, closeModalWhenSubmit, resetFormWhenSubmit, children, disclosure: externalDisclosure, isCreate, }: CoreButtonCreateUpdateProps<IReq, IRes>): react_jsx_runtime.JSX.Element;
170
-
171
179
  interface IMyButtonCreate<IReq, IRes> extends Omit<ComponentProps<typeof MyButtonModal>, "disclosure" | "form" | "onSubmit"> {
172
180
  onSubmit: (values: IReq) => Promise<AxiosResponse<MyApiResponse<IRes>>> | void;
173
181
  onSuccess?: () => void;
@@ -245,14 +253,6 @@ interface IAQSelectTableByOpenModal<TData extends MRT_RowData> extends Omit<MRT_
245
253
  }
246
254
  declare function AQSelectTableByOpenModal<TData extends MRT_RowData>({ setSelectedData, data, columns, API, modalSize, title, label, listLabel, objectName, fullScreen, closeAfterSelect, ...rest }: IAQSelectTableByOpenModal<TData>): react_jsx_runtime.JSX.Element;
247
255
 
248
- interface CoreButtonModalProps {
249
- children?: ReactNode;
250
- disclosure: ReturnType<typeof useDisclosure>;
251
- buttonProps?: ButtonProps;
252
- modalProps?: ModalProps;
253
- }
254
- declare function CoreButtonModal({ disclosure, children, buttonProps, modalProps, }: CoreButtonModalProps): react_jsx_runtime.JSX.Element;
255
-
256
256
  interface I$6 extends ButtonProps {
257
257
  contentToPrint?: ReactNode;
258
258
  children?: ReactNode;
@@ -72,7 +72,7 @@ import {
72
72
  useS_BasicAppShell,
73
73
  useS_ButtonImport,
74
74
  utils_layout_getItemsWithoutLinks
75
- } from "../chunk-6OYVVLKC.mjs";
75
+ } from "../chunk-B4QOFQSV.mjs";
76
76
  import "../chunk-NWBLJ3W3.mjs";
77
77
  import "../chunk-K6S7R6LU.mjs";
78
78
  import "../chunk-KKJ3OEEW.mjs";
@@ -24,7 +24,7 @@ import {
24
24
  useS_BasicAppShell,
25
25
  useS_authenticate,
26
26
  utils_layout_getItemsWithoutLinks
27
- } from "../chunk-6OYVVLKC.mjs";
27
+ } from "../chunk-B4QOFQSV.mjs";
28
28
  import {
29
29
  const_object_documentTypes
30
30
  } from "../chunk-GFEMKKFH.mjs";
@@ -50,7 +50,7 @@ import {
50
50
  utils_config_getBaseUrl,
51
51
  utils_converter_enumToSelectOptions,
52
52
  utils_file_fileToAQDocumentType
53
- } from "../chunk-PI7ZROBI.mjs";
53
+ } from "../chunk-VPI5YKN6.mjs";
54
54
  import "../chunk-5U2JSHSJ.mjs";
55
55
  import {
56
56
  utils_notification_show
@@ -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_validateForm_validateCode: (value?: string) => "Không được để trống" | "Chỉ được nhập ký tự thường, số , và dấu '-'" | 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_validateForm_validateCode };
@@ -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
- } from "../chunk-PI7ZROBI.mjs";
19
+ utils_time_getCurrentTimeString,
20
+ utils_validateForm_validateCode
21
+ } from "../chunk-VPI5YKN6.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_validateForm_validateCode
49
51
  };
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "types": "./dist/enum/index.d.mts"
35
35
  }
36
36
  },
37
- "version": "0.1.281",
37
+ "version": "0.1.283",
38
38
  "private": false,
39
39
  "files": [
40
40
  "dist"