aq-fe-framework 0.1.25 → 0.1.27

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.
@@ -0,0 +1,439 @@
1
+ import * as react from 'react';
2
+ import react__default, { ReactNode, ComponentProps } from 'react';
3
+ import { MantineSize, ActionIconProps, ButtonProps, useModalsStack, CheckboxProps, SelectProps, NumberFormatterProps, FieldsetProps, FileInputProps, NumberInputProps, TextareaProps, TextInputProps, ContainerProps, FlexProps, GroupProps, TypographyStylesProviderProps, TabsProps, SkeletonProps } from '@mantine/core';
4
+ import { useDisclosure, useListState } from '@mantine/hooks';
5
+ import { UseFormReturnType, useForm } from '@mantine/form';
6
+ import { I as IUtils_Excel_ColumnConfig } from '../excel---d-HDs7.mjs';
7
+ import { MRT_ColumnDef, MRT_RowData, MRT_TableOptions, MRT_TableInstance } from 'mantine-react-table';
8
+ import { ConfigOptions } from 'export-to-csv';
9
+ import { DateInputProps } from '@mantine/dates';
10
+ import { EditorOptions } from '@tiptap/react';
11
+ import { IconProps, Icon } from '@tabler/icons-react';
12
+ import 'exceljs';
13
+
14
+ declare const MyBoxesCore: ({ className, ...rest }: {
15
+ className?: string;
16
+ }) => react__default.JSX.Element;
17
+ declare const Boxes: react__default.MemoExoticComponent<({ className, ...rest }: {
18
+ className?: string;
19
+ }) => react__default.JSX.Element>;
20
+
21
+ declare function MyBoxesBackground({ title, desc }: {
22
+ title: string;
23
+ desc?: string;
24
+ }): react.JSX.Element;
25
+
26
+ type T0MANTINE_SIZE = number | MantineSize | (string & {}) | undefined;
27
+ type T0CRUD = "default" | "create" | "update" | "delete" | "save" | "createMultiple" | "check" | "import" | "print" | "cancel" | "export" | "select";
28
+
29
+ interface IMyActionIcon extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ActionIconProps {
30
+ crudType?: T0CRUD;
31
+ children?: ReactNode;
32
+ }
33
+ declare function MyActionIcon({ children, crudType, ...rest }: IMyActionIcon): react.JSX.Element | undefined;
34
+
35
+ interface IActionIconCheck extends ActionIconProps {
36
+ modalSize?: string;
37
+ comment?: string;
38
+ }
39
+ declare function MyActionIconCheck({ modalSize, comment, ...rest }: IActionIconCheck): react.JSX.Element;
40
+
41
+ interface IMyActionIconModal extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ActionIconProps {
42
+ title?: string;
43
+ children?: ReactNode;
44
+ crudType?: T0CRUD;
45
+ modalSize?: T0MANTINE_SIZE;
46
+ disclosure: ReturnType<typeof useDisclosure>;
47
+ fullScreen?: boolean;
48
+ icon?: ReactNode;
49
+ }
50
+ declare function MyActionIconModal({ fullScreen, crudType, disclosure, modalSize, title, children, icon, ...rest }: IMyActionIconModal): react.JSX.Element | undefined;
51
+
52
+ interface IActionIconDelete extends Omit<ComponentProps<typeof MyActionIconModal>, "disclosure"> {
53
+ onSubmit: () => void;
54
+ onSuccess?: () => void;
55
+ onError?: () => void;
56
+ contextData?: string;
57
+ loading?: boolean;
58
+ }
59
+ declare function MyActionIconDelete({ onSubmit, onSuccess, onError, contextData, ...rest }: IActionIconDelete): react.JSX.Element;
60
+
61
+ interface IActionIconUpdate<T> extends Omit<ComponentProps<typeof MyActionIconModal>, "form" | "disclosure" | "onSubmit"> {
62
+ onSubmit: (values: T) => void;
63
+ onSuccess?: () => void;
64
+ onError?: () => void;
65
+ form: UseFormReturnType<T>;
66
+ disclosure?: ReturnType<typeof useDisclosure>;
67
+ }
68
+ declare function MyActionIconUpdate<T>({ form, onSubmit, onSuccess, onError, children, ...rest }: IActionIconUpdate<T>): react.JSX.Element;
69
+
70
+ declare function MyActionIconDownloadPDF({ pdfLink }: {
71
+ pdfLink: string;
72
+ }): react.JSX.Element;
73
+
74
+ declare function MyActionIconUpload(): react.JSX.Element;
75
+
76
+ interface IActionIconViewPDF extends ActionIconProps {
77
+ modalSize?: string;
78
+ pdfLink: string;
79
+ }
80
+ declare function MyActionIconViewPDF({ modalSize, pdfLink, ...rest }: IActionIconViewPDF): react.JSX.Element;
81
+
82
+ declare function MySwitchTheme(): react.JSX.Element;
83
+
84
+ interface I0LinkItem {
85
+ pageId?: number;
86
+ name?: string;
87
+ label: string;
88
+ status?: "Default" | "Prototype" | "New" | "Menu" | "Change";
89
+ link?: string;
90
+ links?: I0LinkItem[];
91
+ }
92
+ declare function BasicAppShell_transformMenuToEnum(prefixProjectName: string, menu: I0LinkItem[]): Record<string, number>;
93
+ declare function BasicAppShell({ children, menu }: {
94
+ children: ReactNode;
95
+ menu: I0LinkItem[];
96
+ }): react.JSX.Element;
97
+ declare const groupToTwoLevels: (menu: I0LinkItem[]) => I0LinkItem[];
98
+ declare function utils_layout_getItemsWithoutLinks(menu: I0LinkItem[]): I0LinkItem[];
99
+
100
+ declare function MyAppSpotlight({ menu }: {
101
+ menu: I0LinkItem[];
102
+ }): react.JSX.Element;
103
+ declare function SpotlightTrigger(): react.JSX.Element;
104
+
105
+ declare function MyAnchorViewPDF({ label, pdfLink }: {
106
+ label: string;
107
+ pdfLink: string;
108
+ }): react.JSX.Element;
109
+
110
+ interface IMyButton extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ButtonProps {
111
+ crudType?: T0CRUD;
112
+ children?: ReactNode;
113
+ }
114
+ declare function MyButton({ children, crudType, ...rest }: IMyButton): react.JSX.Element | undefined;
115
+
116
+ interface IMyButtonModal extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ButtonProps {
117
+ label?: string;
118
+ title?: string;
119
+ children?: ReactNode;
120
+ crudType?: T0CRUD;
121
+ modalSize?: T0MANTINE_SIZE;
122
+ objectName?: string;
123
+ disclosure: ReturnType<typeof useDisclosure>;
124
+ fullScreen?: boolean;
125
+ }
126
+ declare function MyButtonModal({ fullScreen, crudType, disclosure, modalSize, title, label, children, objectName, ...rest }: IMyButtonModal): react.JSX.Element | undefined;
127
+
128
+ interface IMyButtonCreate$1 extends Omit<ComponentProps<typeof MyButtonModal>, "disclosure" | "form"> {
129
+ onSubmit: () => void;
130
+ onSuccess?: () => void;
131
+ onError?: () => void;
132
+ form: ReturnType<typeof useForm>;
133
+ setImportedData?: (data: any) => void;
134
+ }
135
+ declare function AQButtonCreateByImportFile({ form, onSubmit, onSuccess, onError, setImportedData, ...rest }: IMyButtonCreate$1): react.JSX.Element;
136
+
137
+ interface FieldConfig {
138
+ fieldName: string;
139
+ header: string;
140
+ formatFunction?: (value: any, row: any) => any;
141
+ }
142
+ interface ExportConfig {
143
+ fields: FieldConfig[];
144
+ }
145
+ interface AQButtonExportDataProps {
146
+ isAllData: boolean;
147
+ objectName: string;
148
+ data: any[];
149
+ exportConfig: ExportConfig;
150
+ }
151
+ declare function AQButtonExportData({ isAllData, objectName, data, exportConfig }: AQButtonExportDataProps): react.JSX.Element;
152
+
153
+ interface IMyButtonCreate<T> extends Omit<ComponentProps<typeof MyButtonModal>, "disclosure" | "form" | "onSubmit"> {
154
+ onSubmit: (values: T) => void;
155
+ onSuccess?: () => void;
156
+ onError?: () => void;
157
+ form: UseFormReturnType<T>;
158
+ notCloseModalWhenSubmit?: boolean;
159
+ notResetFormWhenSubmit?: boolean;
160
+ disclosure?: ReturnType<typeof useDisclosure>;
161
+ }
162
+ declare function MyButtonCreate<T>({ form, onSubmit, onSuccess, onError, notCloseModalWhenSubmit, notResetFormWhenSubmit, children, disclosure: externalDisclosure, ...rest }: IMyButtonCreate<T>): react.JSX.Element;
163
+
164
+ interface SelectFileModalProps {
165
+ onExportStructure?: () => void;
166
+ stack: ReturnType<typeof useModalsStack<"select-file-page" | "select-field-page" | "implement-page">>;
167
+ }
168
+ declare function SelectFileModal({ onExportStructure, stack }: SelectFileModalProps): react.JSX.Element;
169
+
170
+ interface MyButtonImportProps extends Omit<SelectFileModalProps, "stack"> {
171
+ onImport: (data: any) => void;
172
+ }
173
+ declare function MyButtonImport({ onExportStructure, onImport }: MyButtonImportProps): react.JSX.Element;
174
+
175
+ interface SelectFieldModalProps {
176
+ stack: ReturnType<typeof useModalsStack<"select-file-page" | "select-field-page" | "implement-page">>;
177
+ onImport: () => void;
178
+ }
179
+ declare function SelectFieldModal({ stack, onImport }: SelectFieldModalProps): react.JSX.Element;
180
+
181
+ interface IFieldConfig extends IUtils_Excel_ColumnConfig<any> {
182
+ isSelected?: boolean;
183
+ fieldToMap?: string;
184
+ }
185
+ interface I$5 {
186
+ file?: File | null;
187
+ title?: string[];
188
+ data?: any[];
189
+ startTitleIndex?: string | number;
190
+ startDataIndex?: string | number;
191
+ fieldConfig?: IFieldConfig[];
192
+ }
193
+ declare function useS_ButtonImport(): {
194
+ columns: MRT_ColumnDef<any>[];
195
+ changeSelected: (fieldKey: string, isSelected: boolean) => void;
196
+ setFieldToMap: (fieldKey: string, fieldToMap: string) => void;
197
+ getDataFinal: <T>() => T[];
198
+ changeAllSelected: (isSelected: boolean) => void;
199
+ autoMap: () => void;
200
+ state: I$5;
201
+ setState: (newState: I$5) => void;
202
+ setProperty: <K extends keyof I$5>(key: K, value: I$5[K]) => void;
203
+ resetState: () => void;
204
+ };
205
+
206
+ interface IAQSelectTableByOpenModal<TData extends MRT_RowData> extends Omit<MRT_TableOptions<TData>, "data">, Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "color" | "style">, ButtonProps {
207
+ label?: string;
208
+ listLabel?: string;
209
+ title?: string;
210
+ modalSize?: T0MANTINE_SIZE;
211
+ objectName?: string;
212
+ fullScreen?: boolean;
213
+ setSelectedData: (data: any) => void;
214
+ data?: any;
215
+ columns: MRT_ColumnDef<TData>[];
216
+ API?: string;
217
+ closeAfterSelect?: boolean;
218
+ }
219
+ declare function AQSelectTableByOpenModal<TData extends MRT_RowData>({ setSelectedData, data, columns, API, modalSize, title, label, listLabel, objectName, fullScreen, closeAfterSelect, ...rest }: IAQSelectTableByOpenModal<TData>): react.JSX.Element;
220
+
221
+ interface IMyButtonRouterBack extends ButtonProps {
222
+ url?: string;
223
+ label?: string;
224
+ }
225
+ declare function MyButtonRouterBack({ url, label, ...rest }: IMyButtonRouterBack): react.JSX.Element;
226
+
227
+ interface IMyButtonViewPDF {
228
+ modalSize?: string;
229
+ label?: string;
230
+ id?: number;
231
+ src?: string;
232
+ }
233
+ declare function MyButtonViewPDF({ id, modalSize, label, src }: IMyButtonViewPDF): react.JSX.Element;
234
+
235
+ declare function MyCalendar(): react.JSX.Element;
236
+
237
+ declare function MyCenterFull({ children }: {
238
+ children: ReactNode;
239
+ }): react.JSX.Element;
240
+
241
+ interface I$4 extends CheckboxProps {
242
+ }
243
+ declare function MyCheckbox({ ...rest }: I$4): react.JSX.Element;
244
+
245
+ interface IMySelect extends SelectProps {
246
+ label?: string;
247
+ data: Array<string | {
248
+ value: string;
249
+ label: string;
250
+ }>;
251
+ }
252
+ declare function MySelect({ label, ...rest }: IMySelect): react.JSX.Element;
253
+
254
+ interface IAQCardProps {
255
+ imgSrc?: string | null;
256
+ title?: string;
257
+ description?: string;
258
+ children?: ReactNode;
259
+ date?: string;
260
+ status?: string;
261
+ href?: string;
262
+ }
263
+ declare function AQCard({ imgSrc, title, description, date, children, status, href }: IAQCardProps): react.JSX.Element;
264
+
265
+ type FormatFunction<TData extends MRT_RowData> = (value: any) => any;
266
+ interface IDataTable$1<TData extends MRT_RowData> extends MRT_TableOptions<TData> {
267
+ columns: MRT_ColumnDef<TData>[];
268
+ data: TData[];
269
+ rowActionSize?: number;
270
+ exportAble?: boolean;
271
+ renderTopToolbarCustomActions?: ((props: {
272
+ table: MRT_TableInstance<TData>;
273
+ }) => ReactNode) | undefined;
274
+ csvConfigProps?: ConfigOptions;
275
+ formats?: {
276
+ [K in keyof TData]?: FormatFunction<TData>;
277
+ };
278
+ setSelectedRow?: (data: any) => void;
279
+ }
280
+ declare function MyDataTable<TData extends MRT_RowData>({ formats, exportAble, csvConfigProps, rowActionSize, columns, data, renderTopToolbarCustomActions, setSelectedRow, ...rest }: IDataTable$1<TData>): react.JSX.Element | undefined;
281
+
282
+ interface I$3 {
283
+ keyLabel?: string;
284
+ label?: string;
285
+ }
286
+ declare function MyKeyLabel({ keyLabel, label }: I$3): react.JSX.Element;
287
+
288
+ interface I$2 extends NumberFormatterProps {
289
+ }
290
+ declare function MyNumberFormatter({ ...rest }: I$2): react.JSX.Element;
291
+
292
+ declare function AQStatCard1({ title, value, unit, description, icons, diff }: {
293
+ title: string;
294
+ value: string;
295
+ unit?: string;
296
+ description: string;
297
+ icons: ReactNode;
298
+ diff: number;
299
+ }): react.JSX.Element;
300
+
301
+ interface IDateInput extends DateInputProps {
302
+ label?: string;
303
+ }
304
+ declare function MyDateInput({ label, ...rest }: IDateInput): react.JSX.Element;
305
+
306
+ interface MyFieldsetProps extends FieldsetProps {
307
+ chilren?: ReactNode;
308
+ title?: string;
309
+ }
310
+ declare function MyFieldset({ children, title, ...rest }: MyFieldsetProps): react.JSX.Element;
311
+
312
+ interface IFileInput extends FileInputProps {
313
+ label?: string;
314
+ }
315
+ declare function MyFileInput({ label, ...rest }: IFileInput): react.JSX.Element;
316
+
317
+ interface INumberInput extends NumberInputProps {
318
+ label?: string;
319
+ }
320
+ declare function MyNumberInput({ label, ...rest }: INumberInput): react.JSX.Element;
321
+
322
+ interface IMyTextArea extends TextareaProps {
323
+ label?: string;
324
+ }
325
+ declare function MyTextArea({ label, ...rest }: IMyTextArea): react.JSX.Element;
326
+
327
+ interface IMyTextEditor extends Partial<EditorOptions> {
328
+ label?: string;
329
+ error?: string;
330
+ value?: string;
331
+ onChange?: any;
332
+ contentHeight?: MantineSize | string;
333
+ autoHiddenToolBar?: boolean;
334
+ }
335
+ declare function MyTextEditor({ autoHiddenToolBar, contentHeight, onChange, value, error, label, ...rest }: IMyTextEditor): react.JSX.Element;
336
+
337
+ interface IMyTextInput extends TextInputProps {
338
+ label?: string;
339
+ defaultValue?: string;
340
+ }
341
+ declare function MyTextInput({ label, defaultValue, ...rest }: IMyTextInput): react.JSX.Element;
342
+
343
+ interface I$1 extends ContainerProps {
344
+ children?: ReactNode;
345
+ }
346
+ declare function MyContainer({ children, ...rest }: I$1): react.JSX.Element;
347
+
348
+ interface IMyFlexColumn extends FlexProps {
349
+ children?: ReactNode;
350
+ }
351
+ declare function MyFlexColumn({ children, ...rest }: IMyFlexColumn): react.JSX.Element;
352
+
353
+ interface IMyFlexEnd extends GroupProps {
354
+ children: ReactNode;
355
+ }
356
+ declare function MyFlexEnd({ children, ...rest }: IMyFlexEnd): react.JSX.Element;
357
+
358
+ interface IFlexRow extends FlexProps {
359
+ children: ReactNode;
360
+ }
361
+ declare function MyFlexRow({ children, ...rest }: IFlexRow): react.JSX.Element;
362
+
363
+ interface IMenu {
364
+ label?: string;
365
+ href?: string;
366
+ }
367
+ interface IHeaderMegaMenu {
368
+ children?: ReactNode;
369
+ menus?: IMenu[];
370
+ }
371
+ declare function HeaderMegaMenu({ children, menus }: IHeaderMegaMenu): react.JSX.Element;
372
+
373
+ interface I {
374
+ name?: string;
375
+ }
376
+ declare function useHeaderMegaMenuStore(): {
377
+ state: I;
378
+ setState: (newState: I) => void;
379
+ setProperty: <K extends "name">(key: K, value: I[K]) => void;
380
+ resetState: () => void;
381
+ };
382
+
383
+ interface HtmlWrapper extends TypographyStylesProviderProps {
384
+ html: string;
385
+ mah?: number | string;
386
+ zip?: boolean;
387
+ }
388
+ declare function MyHtmlWrapper({ html, mah, zip, ...rest }: HtmlWrapper): react.JSX.Element;
389
+
390
+ interface IPageContent {
391
+ title?: string;
392
+ canBack?: boolean;
393
+ rightTopBar?: ReactNode;
394
+ children?: ReactNode;
395
+ leftTopBar?: ReactNode;
396
+ status?: "Prototype" | "Beta";
397
+ }
398
+ declare function MyPageContent({ leftTopBar, title, canBack, rightTopBar, status, children }: IPageContent): react.JSX.Element;
399
+
400
+ interface ITab {
401
+ label: string;
402
+ icon?: react__default.ForwardRefExoticComponent<IconProps & react__default.RefAttributes<Icon>>;
403
+ }
404
+ interface IMyTab extends TabsProps {
405
+ tabList: ITab[];
406
+ children?: ReactNode;
407
+ }
408
+ declare function MyTab({ tabList, children, ...rest }: IMyTab): react__default.JSX.Element;
409
+
410
+ declare function MyCardioLoader(): react.JSX.Element;
411
+
412
+ interface IDataTable<TData extends MRT_RowData> extends Omit<MRT_TableOptions<TData>, "data"> {
413
+ listLabel?: string;
414
+ columns: MRT_ColumnDef<TData>[];
415
+ data?: TData[];
416
+ renderTopToolbarCustomActions?: ((props: {
417
+ table: MRT_TableInstance<TData>;
418
+ }) => ReactNode) | undefined;
419
+ listState: ReturnType<typeof useListState<TData>>;
420
+ selectButtonlabel?: string;
421
+ modalSize?: MantineSize;
422
+ }
423
+ declare function MyDataTableSelect<TData extends MRT_RowData>({ modalSize, renderTopToolbarCustomActions, data, selectButtonlabel, listState, columns, listLabel, ...rest }: IDataTable<TData>): react.JSX.Element | "Đang tải...";
424
+
425
+ interface ISelect extends SelectProps {
426
+ apiGet: string;
427
+ label?: string;
428
+ dataMapper?: (item: any) => {
429
+ value: string;
430
+ label: string;
431
+ };
432
+ }
433
+ declare function MySelectAPIGet({ apiGet, label, dataMapper, ...rest }: ISelect): react.JSX.Element | "Loading...";
434
+
435
+ interface IMySkeletonTable extends SkeletonProps {
436
+ }
437
+ declare function MySkeletonTable({ h }: IMySkeletonTable): react.JSX.Element;
438
+
439
+ export { AQButtonCreateByImportFile, AQButtonExportData, AQCard, AQSelectTableByOpenModal, AQStatCard1, BasicAppShell, BasicAppShell_transformMenuToEnum, Boxes, HeaderMegaMenu, type I0LinkItem, type IAQCardProps, type IMyTextEditor, MyActionIcon, MyActionIconCheck, MyActionIconDelete, MyActionIconDownloadPDF, MyActionIconModal, MyActionIconUpdate, MyActionIconUpload, MyActionIconViewPDF, MyAnchorViewPDF, MyAppSpotlight, MyBoxesBackground, MyBoxesCore, MyButton, MyButtonCreate, MyButtonImport, MyButtonModal, MyButtonRouterBack, MyButtonViewPDF, MyCalendar, MyCardioLoader, MyCenterFull, MyCheckbox, MyContainer, MyDataTable, MyDataTableSelect, MyDateInput, MyFieldset, MyFileInput, MyFlexColumn, MyFlexEnd, MyFlexRow, MyHtmlWrapper, MyKeyLabel, MyNumberFormatter, MyNumberInput, MyPageContent, MySelect, MySelectAPIGet, MySkeletonTable, MySwitchTheme, MyTab, MyTextArea, MyTextEditor, MyTextInput, SelectFieldModal, SelectFileModal, type SelectFileModalProps, SpotlightTrigger, groupToTwoLevels, useHeaderMegaMenuStore, useS_ButtonImport, utils_layout_getItemsWithoutLinks };