@materialui-reactjs/admin 2.0.0 → 2.0.1

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.
Files changed (93) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +4 -1
  3. package/dist/Common-DFahMuQE.cjs +11 -0
  4. package/dist/{Common-1GAoFU4L.js → Common-_PK8HLKN.js} +22 -16
  5. package/dist/HeaderUpdate-Dirxjmxs.cjs +1 -0
  6. package/dist/{HeaderUpdate-UXncZcAD.js → HeaderUpdate-drlnuHI8.js} +24 -25
  7. package/dist/{UDragFile-BqGt1-gK.js → UDragFile-D8wOZ1Ut.js} +2 -2
  8. package/dist/UDragFile-Db0sK4M7.cjs +1 -0
  9. package/dist/{Validator-aKlMgoxl.js → Validator-D2zwZeov.js} +73 -50
  10. package/dist/Validator-DBxl8wtE.cjs +1 -0
  11. package/dist/ckeditor/ckeditor.d.ts +3 -0
  12. package/dist/ckeditor/plugins/elfinder.d.ts +11 -0
  13. package/dist/ckeditor/plugins/fullscreen.d.ts +15 -0
  14. package/dist/ckeditor/plugins/pdffinder.d.ts +18 -0
  15. package/dist/ckeditor/types.d.ts +37 -0
  16. package/dist/{common-DVWX6AUQ.js → common-CEZp8xpQ.js} +14 -3
  17. package/dist/common-ivDX6gGq.cjs +1 -0
  18. package/dist/components/echarts/index.cjs +1 -1
  19. package/dist/components/echarts/index.js +1 -1
  20. package/dist/components/form/AsxhUImages.d.ts +2 -1
  21. package/dist/components/form/BoxAddRow.d.ts +2 -1
  22. package/dist/components/form/CusForm.d.ts +19 -6
  23. package/dist/components/form/Editor.d.ts +2 -1
  24. package/dist/components/form/EfImage.d.ts +2 -1
  25. package/dist/components/form/EfImages.d.ts +2 -1
  26. package/dist/components/form/PImage.d.ts +2 -1
  27. package/dist/components/form/SelectAddRowBoxAdvanced.d.ts +13 -4
  28. package/dist/components/form/SelectBox.d.ts +20 -7
  29. package/dist/components/form/UDragFile.d.ts +2 -1
  30. package/dist/components/form/UFile.d.ts +2 -1
  31. package/dist/components/form/UFiles.d.ts +9 -2
  32. package/dist/components/form/UImages.d.ts +2 -1
  33. package/dist/components/form/index.cjs +1 -1
  34. package/dist/components/form/index.js +2 -2
  35. package/dist/components/meta/CardTable.d.ts +4 -2
  36. package/dist/components/meta/CardTable.types.d.ts +11 -5
  37. package/dist/components/meta/CusTooltip.d.ts +7 -1
  38. package/dist/components/meta/Head.d.ts +10 -1
  39. package/dist/components/meta/HeaderDetail.d.ts +2 -1
  40. package/dist/components/meta/ScrollTable.d.ts +7 -3
  41. package/dist/components/meta/SearchBox.d.ts +2 -1
  42. package/dist/components/meta/SortableItem.d.ts +11 -1
  43. package/dist/components/meta/index.cjs +1 -1
  44. package/dist/components/meta/index.js +2 -2
  45. package/dist/components/sidebar/index.cjs +1 -1
  46. package/dist/components/sidebar/index.js +1 -1
  47. package/dist/components/single/List.d.ts +15 -4
  48. package/dist/components/single/Update.d.ts +2 -1
  49. package/dist/components/single/UpdateTableDetail.d.ts +2 -1
  50. package/dist/components/single/index.cjs +1 -1
  51. package/dist/components/single/index.js +1 -1
  52. package/dist/components/top-navbar/index.cjs +1 -1
  53. package/dist/components/top-navbar/index.js +28 -28
  54. package/dist/echarts-Bi3uwLbg.cjs +1 -0
  55. package/dist/{echarts-CRmndsxC.js → echarts-CTzMqeR5.js} +4 -4
  56. package/dist/form-heyswTRq.js +3897 -0
  57. package/dist/form-sgtop6li.cjs +49 -0
  58. package/dist/hook/common.d.ts +22 -0
  59. package/dist/hook/detail.cjs +1 -1
  60. package/dist/hook/detail.js +1 -1
  61. package/dist/hook/fields.cjs +1 -1
  62. package/dist/hook/fields.js +1 -1
  63. package/dist/hook/index.cjs +1 -1
  64. package/dist/hook/index.d.ts +4 -3
  65. package/dist/hook/index.js +10 -10
  66. package/dist/hook/update.cjs +1 -1
  67. package/dist/hook/update.d.ts +2 -2
  68. package/dist/hook/update.js +10 -7
  69. package/dist/index.cjs +1 -1
  70. package/dist/index.js +11 -11
  71. package/dist/meta-BANk9kHW.cjs +1 -0
  72. package/dist/meta-CheDAmMh.js +745 -0
  73. package/dist/sidebar-CfQAYWi-.cjs +1 -0
  74. package/dist/{sidebar-CVORMKBY.js → sidebar-CzRmfvhi.js} +3 -3
  75. package/dist/{single-CqD5cgNi.js → single-BsJ7TYJi.js} +240 -252
  76. package/dist/single-C2WPEjhk.cjs +1 -0
  77. package/dist/utils/Common.d.ts +100 -27
  78. package/dist/utils/Env.d.ts +1 -1
  79. package/dist/utils/index.cjs +1 -1
  80. package/dist/utils/index.js +49 -40
  81. package/package.json +1 -1
  82. package/dist/Common-BBYXssMH.cjs +0 -11
  83. package/dist/HeaderUpdate-DIwc8EAA.cjs +0 -1
  84. package/dist/UDragFile-oJ05zNLR.cjs +0 -1
  85. package/dist/Validator-BcydBvOg.cjs +0 -1
  86. package/dist/common-CHDJQ2Ca.cjs +0 -1
  87. package/dist/echarts-Dla22xas.cjs +0 -1
  88. package/dist/form-BNAbGCXe.js +0 -45955
  89. package/dist/form-DUL_O4IY.cjs +0 -65
  90. package/dist/meta-CXHXSPbq.cjs +0 -1
  91. package/dist/meta-Dhll5zt9.js +0 -764
  92. package/dist/sidebar-G5Ody16K.cjs +0 -1
  93. package/dist/single-CsUaxEjQ.cjs +0 -1
@@ -0,0 +1,18 @@
1
+ import { ClassicEditor, Plugin } from 'ckeditor5';
2
+ /**
3
+ * Nút toolbar `pdffinder` — chèn PDF viewer vào nội dung.
4
+ *
5
+ * `config.pdffinder` (do `Editor.tsx` cấp) trả về file đã chọn. Chỉ khi
6
+ * `mime` là PDF mới chèn, và người dùng được hỏi tiêu đề trước khi nhúng.
7
+ */
8
+ export default class PdfFinder extends Plugin {
9
+ init(): void;
10
+ /**
11
+ * Nhúng PDF vào editor dưới dạng thẻ `<oembed>`.
12
+ *
13
+ * Đi qua đúng pipeline data của CKEditor (`toView` -> `toModel`) thay vì
14
+ * gán `innerHTML`: như vậy nội dung đi qua upcast converter + schema, và
15
+ * `GeneralHtmlSupport` giữ lại đúng những gì đã cấu hình `allow`.
16
+ */
17
+ insertPdf(editor: ClassicEditor, url: string, title: string): void;
18
+ }
@@ -0,0 +1,37 @@
1
+ import { ClassicEditor, EditorConfig } from 'ckeditor5';
2
+ /**
3
+ * Kiểu dữ liệu 1 file mà elFinder trả về.
4
+ *
5
+ * Chỉ `url` là bắt buộc — `name` và `mime` tuỳ chọn vì connector có thể
6
+ * không trả về đủ field (xem `Editor.tsx`).
7
+ */
8
+ export interface ElFinderFile {
9
+ url: string;
10
+ name?: string;
11
+ mime?: string;
12
+ }
13
+ /**
14
+ * Callback cho nút `elfinder` của toolbar.
15
+ *
16
+ * Plugin không tự mở file manager — nó chỉ gọi hàm này (do `Editor.tsx` cấp)
17
+ * để phía ứng dụng quyết định UI/luồng chọn ảnh.
18
+ */
19
+ export type ElFinderOpener = (editor: ClassicEditor) => Promise<void> | void;
20
+ /**
21
+ * Callback cho nút `pdffinder` của toolbar.
22
+ *
23
+ * Phải trả về file đã chọn; `PdfFinder` chỉ chèn khi `mime` là PDF.
24
+ * Trả `null`/`undefined` (hoặc người dùng huỷ) thì không chèn gì.
25
+ */
26
+ export type PdfFinderOpener = (editor: ClassicEditor) => Promise<ElFinderFile | null | undefined> | ElFinderFile | null | undefined;
27
+ /**
28
+ * Cấu hình editor của thư viện: `EditorConfig` chuẩn của CKEditor 5 cộng
29
+ * thêm 2 callback do `Editor.tsx` truyền vào.
30
+ *
31
+ * Dùng `extends` (không phải `Omit`) để CKEditor vẫn tự merge `toolbar`,
32
+ * `image`, `htmlSupport`... từ `defaultConfig` như bình thường.
33
+ */
34
+ export interface M4DEditorConfig extends EditorConfig {
35
+ elfinder?: ElFinderOpener;
36
+ pdffinder?: PdfFinderOpener;
37
+ }
@@ -1,12 +1,23 @@
1
1
  //#region src/hook/common.ts
2
- function e(e) {
2
+ var e = (e, t, n) => ({
3
+ target: n === void 0 ? {
4
+ name: e,
5
+ value: t
6
+ } : {
7
+ name: e,
8
+ value: t,
9
+ type: n
10
+ },
11
+ preventDefault: () => {}
12
+ });
13
+ function t(e) {
3
14
  if (!e) return;
4
15
  let t = e.id;
5
16
  if (t == null || t === "") return;
6
17
  let n = Number(t);
7
18
  return Number.isNaN(n) ? void 0 : n;
8
19
  }
9
- var t = (e) => {
20
+ var n = (e) => {
10
21
  e.preventDefault();
11
22
  let { name: t, type: n, value: r } = e.target;
12
23
  if (n === "file") {
@@ -16,4 +27,4 @@ var t = (e) => {
16
27
  return { [t]: r };
17
28
  };
18
29
  //#endregion
19
- export { t as n, e as t };
30
+ export { t as n, n as r, e as t };
@@ -0,0 +1 @@
1
+ var e=(e,t,n)=>({target:n===void 0?{name:e,value:t}:{name:e,value:t,type:n},preventDefault:()=>{}});function t(e){if(!e)return;let t=e.id;if(t==null||t===``)return;let n=Number(t);return Number.isNaN(n)?void 0:n}var n=e=>{e.preventDefault();let{name:t,type:n,value:r}=e.target;if(n===`file`){let n=e.target.files;return{[t]:n?.[0]??null}}return{[t]:r}};Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../echarts-Dla22xas.cjs");exports.BarChart=e.a,exports.LineChart=e.i,exports.MultiBarChart=e.r,exports.MultiLineChart=e.n,exports.PieChart=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../echarts-Bi3uwLbg.cjs");exports.BarChart=e.a,exports.LineChart=e.i,exports.MultiBarChart=e.r,exports.MultiLineChart=e.n,exports.PieChart=e.t;
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, r, t as i } from "../../echarts-CRmndsxC.js";
1
+ import { a as e, i as t, n, r, t as i } from "../../echarts-CTzMqeR5.js";
2
2
  export { e as BarChart, t as LineChart, r as MultiBarChart, n as MultiLineChart, i as PieChart };
@@ -1,3 +1,4 @@
1
+ import { FormChangeHandler } from '../../hook/common';
1
2
  interface UImageProps {
2
3
  label: string;
3
4
  name: string;
@@ -9,7 +10,7 @@ interface UImageProps {
9
10
  readonly?: boolean;
10
11
  ext: string;
11
12
  df?: string;
12
- onChange?: (e: any) => void;
13
+ onChange?: FormChangeHandler;
13
14
  }
14
15
  export declare const AsxhUImages: React.FC<UImageProps>;
15
16
  export {};
@@ -1,3 +1,4 @@
1
+ import { FormScalar } from '../../hook/common';
1
2
  type FieldType = "text" | "textarea" | "select" | "selectMulti" | "image" | "editor";
2
3
  export interface Option {
3
4
  name: string;
@@ -5,7 +6,7 @@ export interface Option {
5
6
  type: FieldType;
6
7
  options?: {
7
8
  label: string;
8
- value: any;
9
+ value: FormScalar;
9
10
  }[];
10
11
  keyValue?: string;
11
12
  keyName?: string;
@@ -1,3 +1,16 @@
1
+ import { CrudItem, FormScalar } from '../../hook/common';
2
+ /**
3
+ * Handler mà các control trong file này nhận.
4
+ *
5
+ * `Text`/`Textarea` vẫn khai báo `ChangeEvent<HTMLInputElement>`/`Textarea` cụ thể
6
+ * vì chúng gắn vào control thật; alias ở đây chỉ để đỡ lặp.
7
+ *
8
+ * `handleChange`/`handleNumChange` nhận `T` là generic và truyền thẳng event ra
9
+ * cho `onChange`, nên không cần union thủ công. `onChange` cho phép `undefined`
10
+ * vì prop ở các control là optional — trước đây kiểu `any` che mất điều này.
11
+ */
12
+ type InputChangeHandler = (e: React.ChangeEvent<HTMLInputElement>) => void;
13
+ type TextareaChangeHandler = (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
1
14
  interface TextProps {
2
15
  label: string;
3
16
  name: string;
@@ -9,7 +22,7 @@ interface TextProps {
9
22
  required?: boolean;
10
23
  disabled?: boolean;
11
24
  readonly?: boolean;
12
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
25
+ onChange?: InputChangeHandler;
13
26
  }
14
27
  export declare const Text: React.FC<TextProps>;
15
28
  interface EmailProps {
@@ -34,7 +47,7 @@ interface TextareaProps {
34
47
  disabled?: boolean;
35
48
  readonly?: boolean;
36
49
  rows?: number;
37
- onChange?: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
50
+ onChange?: TextareaChangeHandler;
38
51
  }
39
52
  export declare const Textarea: React.FC<TextareaProps>;
40
53
  interface NumberProps {
@@ -77,7 +90,7 @@ interface PhoneVnProps {
77
90
  export declare const PhoneVn: React.FC<PhoneVnProps>;
78
91
  interface RatioKeyValProps {
79
92
  label: string;
80
- lists: any;
93
+ lists?: Array<CrudItem | FormScalar>;
81
94
  name: string;
82
95
  value?: string | number;
83
96
  cpnClass?: string;
@@ -88,8 +101,8 @@ export declare const RatioKeyVal: React.FC<RatioKeyValProps>;
88
101
  interface CheckBoxProps {
89
102
  label: string;
90
103
  name: string;
91
- value?: any[];
92
- lists: any[];
104
+ value?: FormScalar[];
105
+ lists: CrudItem[];
93
106
  col: string;
94
107
  keyValue?: string;
95
108
  keyName?: string;
@@ -99,7 +112,7 @@ interface CheckBoxProps {
99
112
  required?: boolean;
100
113
  disabled?: boolean;
101
114
  readonly?: boolean;
102
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
115
+ onChange?: InputChangeHandler;
103
116
  }
104
117
  export declare const CheckBox: React.FC<CheckBoxProps>;
105
118
  export {};
@@ -1,3 +1,4 @@
1
+ import { FormChangeHandler } from '../../hook/common';
1
2
  interface EditorProps {
2
3
  label: string;
3
4
  name: string;
@@ -6,7 +7,7 @@ interface EditorProps {
6
7
  required?: boolean;
7
8
  disabled?: boolean;
8
9
  readonly?: boolean;
9
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
10
+ onChange?: FormChangeHandler;
10
11
  }
11
12
  export declare const Editor: React.FC<EditorProps>;
12
13
  export {};
@@ -1,3 +1,4 @@
1
+ import { FormChangeHandler } from '../../hook/common';
1
2
  interface EfImageProps {
2
3
  label: string;
3
4
  name: string;
@@ -9,7 +10,7 @@ interface EfImageProps {
9
10
  readonly?: boolean;
10
11
  ext: string;
11
12
  df?: string;
12
- onChange?: (e: any) => void;
13
+ onChange?: FormChangeHandler;
13
14
  }
14
15
  export declare const EfImage: React.FC<EfImageProps>;
15
16
  export {};
@@ -1,3 +1,4 @@
1
+ import { FormChangeHandler } from '../../hook/common';
1
2
  interface EfImagesProps {
2
3
  label: string;
3
4
  name: string;
@@ -8,7 +9,7 @@ interface EfImagesProps {
8
9
  disabled?: boolean;
9
10
  readonly?: boolean;
10
11
  ext: string;
11
- onChange?: (e: any) => void;
12
+ onChange?: FormChangeHandler;
12
13
  }
13
14
  export declare const EfImages: React.FC<EfImagesProps>;
14
15
  export {};
@@ -1,3 +1,4 @@
1
+ import { FormChangeHandler } from '../../hook/common';
1
2
  interface PImageProps {
2
3
  label: string;
3
4
  name: string;
@@ -9,7 +10,7 @@ interface PImageProps {
9
10
  readonly?: boolean;
10
11
  ext: string;
11
12
  df?: string;
12
- onChange?: (e: any) => void;
13
+ onChange?: FormChangeHandler;
13
14
  }
14
15
  export declare const PImage: React.FC<PImageProps>;
15
16
  export {};
@@ -1,16 +1,25 @@
1
+ import { CrudItem } from '../../hook/common';
2
+ /**
3
+ * Kiểu callback render dòng (truyền vào `rendeRowData`).
4
+ *
5
+ * `detail` là bản ghi động do API trả về, chỉ chắc chắn có key `itemName` —
6
+ * nên là `CrudItem` thay vì `any`. `handleEditRow` có sẵn ở component, truyền
7
+ * vào để consumer tự dùng khi muốn sửa giá trị một field của dòng đó.
8
+ */
9
+ type RenderRowData = (detail: CrudItem, index: number, handleEditRow: (e: React.ChangeEvent<HTMLInputElement>, row: number) => void) => React.ReactNode;
1
10
  interface SelectProps {
2
11
  itemLabel: string;
3
12
  itemName: string;
4
13
  selectName?: string;
5
- lists: any[];
14
+ lists?: CrudItem[];
6
15
  clsWidth?: string;
7
16
  btnTxt?: string;
8
- rendeRowData?: any;
9
- detailRow?: any;
17
+ rendeRowData?: RenderRowData;
18
+ detailRow?: CrudItem[];
10
19
  isEdit?: boolean;
11
20
  keyValue?: string;
12
21
  keyName?: string;
13
- onSubmit?: (data: any, frmRef: any) => void;
22
+ onSubmit?: (data: CrudItem[], frmRef: HTMLFormElement | null) => void;
14
23
  }
15
24
  export declare const SelectAddRowBoxAdvanced: React.FC<SelectProps>;
16
25
  export {};
@@ -1,32 +1,45 @@
1
+ import { CSSProperties } from 'react';
2
+ import { CrudItem, FormChangeHandler, FormScalar } from '../../hook/common';
3
+ /**
4
+ * Một option của react-select.
5
+ *
6
+ * `value` là giá trị sẽ đưa vào `FormValue` nên bị chặn ở mức `FormScalar` — nếu
7
+ * để `any` thì `value: {a: 1}` lọt vào form data mà không ai bắt được. `label`
8
+ * là thứ hiển thị nên cho phép `ReactNode`.
9
+ */
10
+ export interface OptionType {
11
+ value: FormScalar;
12
+ label: string | number | React.ReactNode;
13
+ }
1
14
  interface SelectProps {
2
15
  label: string;
3
16
  name: string;
4
- lists: any[];
17
+ lists?: CrudItem[];
5
18
  keyValue?: string;
6
19
  keyName?: string;
7
- value?: string | number | any;
20
+ value?: FormScalar;
8
21
  cpnClass?: string;
9
22
  required?: boolean;
10
23
  disabled?: boolean;
11
24
  all?: boolean;
12
25
  zero?: boolean;
13
- style?: any;
14
- onChange?: (e: any) => void;
26
+ style?: CSSProperties;
27
+ onChange?: FormChangeHandler;
15
28
  }
16
29
  export declare const SelectBox: React.FC<SelectProps>;
17
30
  interface SelectMProps {
18
31
  label: string;
19
32
  name: string;
20
- lists: any[];
33
+ lists?: CrudItem[];
21
34
  keyValue?: string;
22
35
  keyName?: string;
23
- value?: any[];
36
+ value?: FormScalar[];
24
37
  cpnClass?: string;
25
38
  required?: boolean;
26
39
  disabled?: boolean;
27
40
  all?: boolean;
28
41
  zero?: boolean;
29
- onChange?: (e: any) => void;
42
+ onChange?: FormChangeHandler;
30
43
  }
31
44
  export declare const SelectMBox: React.FC<SelectMProps>;
32
45
  export {};
@@ -1,3 +1,4 @@
1
+ import { FormChangeHandler } from '../../hook/common';
1
2
  interface UFileProps {
2
3
  label: string;
3
4
  name: string;
@@ -7,7 +8,7 @@ interface UFileProps {
7
8
  disabled?: boolean;
8
9
  readonly?: boolean;
9
10
  ext: string;
10
- onChange: (e: any) => void;
11
+ onChange: FormChangeHandler;
11
12
  }
12
13
  export declare const UDragFile: React.FC<UFileProps>;
13
14
  export {};
@@ -1,3 +1,4 @@
1
+ import { FormChangeHandler } from '../../hook/common';
1
2
  interface UFileProps {
2
3
  label: string;
3
4
  name: string;
@@ -9,7 +10,7 @@ interface UFileProps {
9
10
  readonly?: boolean;
10
11
  ext?: string;
11
12
  df?: string;
12
- onChange?: (e: any) => void;
13
+ onChange?: FormChangeHandler;
13
14
  }
14
15
  export declare const UFile: React.FC<UFileProps>;
15
16
  export {};
@@ -1,3 +1,4 @@
1
+ import { FormChangeHandler, FormValue } from '../../hook/common';
1
2
  interface UFileProps {
2
3
  label: string;
3
4
  name: string;
@@ -9,8 +10,14 @@ interface UFileProps {
9
10
  readonly?: boolean;
10
11
  ext: string;
11
12
  df?: string;
12
- onChange?: (e: any) => void;
13
+ onChange?: FormChangeHandler;
13
14
  }
14
15
  export declare const UFiles: React.FC<UFileProps>;
15
- export declare const validateRequiredFiles: (formValue: any, fieldName: string, fieldLabel: string) => boolean;
16
+ /**
17
+ * Kiểm tra field "file" bắt buộc trước khi submit.
18
+ *
19
+ * Đọc `FormValue` thay vì `any`: giá trị của `fieldName` và `${fieldName}_upload`
20
+ * đều có thể vắng mặt trong payload, nên phải xử lý cả trường hợp thiếu.
21
+ */
22
+ export declare const validateRequiredFiles: (formValue: FormValue, fieldName: string, fieldLabel: string) => boolean;
16
23
  export {};
@@ -1,3 +1,4 @@
1
+ import { FormChangeHandler } from '../../hook/common';
1
2
  interface UImageProps {
2
3
  label: string;
3
4
  name: string;
@@ -9,7 +10,7 @@ interface UImageProps {
9
10
  readonly?: boolean;
10
11
  ext: string;
11
12
  df?: string;
12
- onChange?: (e: any) => void;
13
+ onChange?: FormChangeHandler;
13
14
  }
14
15
  export declare const UImages: React.FC<UImageProps>;
15
16
  export {};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../form-DUL_O4IY.cjs"),t=require("../../UDragFile-oJ05zNLR.cjs");exports.AdvancedMultiSelect=e.D,exports.AsxhUImages=e.E,exports.BoxAddRow=e.p,exports.CheckBox=e.v,exports.CheckTreeBox=e.f,exports.DateInput=e.d,exports.DateTimeInput=e.u,exports.Editor=e.m,exports.EfFile=e.l,exports.EfImage=e.h,exports.EfImages=e.c,exports.Email=e.y,exports.NumberText=e.b,exports.PImage=e.s,exports.Password=e.x,exports.PhoneVn=e.S,exports.RatioKeyVal=e.C,exports.SelectAddRowBox=e.o,exports.SelectAddRowBoxAdvanced=e.a,exports.SelectBox=e.g,exports.SelectMBox=e._,exports.Text=e.w,exports.Textarea=e.T,exports.UDragFile=t.t,exports.UFile=e.i,exports.UFiles=e.n,exports.UImages=e.t,exports.validateRequiredFiles=e.r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../form-sgtop6li.cjs"),t=require("../../UDragFile-Db0sK4M7.cjs");exports.AdvancedMultiSelect=e.D,exports.AsxhUImages=e.E,exports.BoxAddRow=e.p,exports.CheckBox=e.v,exports.CheckTreeBox=e.f,exports.DateInput=e.d,exports.DateTimeInput=e.u,exports.Editor=e.m,exports.EfFile=e.l,exports.EfImage=e.h,exports.EfImages=e.c,exports.Email=e.y,exports.NumberText=e.b,exports.PImage=e.s,exports.Password=e.x,exports.PhoneVn=e.S,exports.RatioKeyVal=e.C,exports.SelectAddRowBox=e.o,exports.SelectAddRowBoxAdvanced=e.a,exports.SelectBox=e.g,exports.SelectMBox=e._,exports.Text=e.w,exports.Textarea=e.T,exports.UDragFile=t.t,exports.UFile=e.i,exports.UFiles=e.n,exports.UImages=e.t,exports.validateRequiredFiles=e.r;
@@ -1,3 +1,3 @@
1
- import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C, w, x as T, y as E } from "../../form-BNAbGCXe.js";
2
- import { t as D } from "../../UDragFile-BqGt1-gK.js";
1
+ import { C as e, D as t, E as n, S as r, T as i, _ as a, a as o, b as s, c, d as l, f as u, g as d, h as f, i as p, l as m, m as h, n as g, o as _, p as v, r as y, s as b, t as x, u as S, v as C, w, x as T, y as E } from "../../form-heyswTRq.js";
2
+ import { t as D } from "../../UDragFile-D8wOZ1Ut.js";
3
3
  export { t as AdvancedMultiSelect, n as AsxhUImages, v as BoxAddRow, C as CheckBox, u as CheckTreeBox, l as DateInput, S as DateTimeInput, h as Editor, m as EfFile, f as EfImage, c as EfImages, E as Email, s as NumberText, b as PImage, T as Password, r as PhoneVn, e as RatioKeyVal, _ as SelectAddRowBox, o as SelectAddRowBoxAdvanced, d as SelectBox, a as SelectMBox, w as Text, i as Textarea, D as UDragFile, p as UFile, g as UFiles, x as UImages, y as validateRequiredFiles };
@@ -1,8 +1,10 @@
1
1
  import { TableFormBody, TableOptions, TableService } from './CardTable.types';
2
+ import { FormValue } from '../../hook/common';
3
+ import { TableFilter } from '../../hook/index';
2
4
  export interface ApiOptionType {
3
5
  cUri: string;
4
- filter?: any;
5
- formData?: any;
6
+ filter?: TableFilter;
7
+ formData?: Partial<FormValue>;
6
8
  apiGetData: string;
7
9
  apiGetDetail: string;
8
10
  apiCreate: string;
@@ -1,3 +1,4 @@
1
+ import { CrudItem } from '../../hook/common';
1
2
  /**
2
3
  * Kiểu cột mà `service.tbFields()` trả về cho từng field của bảng.
3
4
  */
@@ -9,16 +10,21 @@ export interface TableColumnConfig {
9
10
  tdClassName?: string;
10
11
  thClassName?: string;
11
12
  /**
12
- * Hàm chuyển đổi giá trị thô của API thành nội dung hiển thị.
13
- * Tham số thứ hai `raw` = true nghĩa là đang dựng nội dung cho `dangerouslySetInnerHTML`.
14
- */
15
- func?: (value: any, raw?: boolean) => any;
13
+ * Hàm chuyển đổi giá trị thô của API thành nội dung hiển thị.
14
+ *
15
+ * `raw = true` nghĩa là đang dựng nội dung cho `dangerouslySetInnerHTML`, nên hàm
16
+ * phải trả về chuỗi HTML — nhưng ép thành overload sẽ chặn cả những hàm trả
17
+ * `string | ReactNode`, vốn hợp lệ và phổ biến hơn. Ở đây chỉ siết tham số
18
+ * (`unknown` — giá trị đến từ API) và để kiểu trả về là `unknown`; phía render
19
+ * đã ép sang `ReactNode` khi cần.
20
+ */
21
+ func?: (value: unknown, raw?: boolean) => unknown;
16
22
  }
17
23
  /** Cấu hình của một trường tìm kiếm. */
18
24
  export interface TableFilterConfig {
19
25
  type: "text" | "select" | (string & {});
20
26
  /** Danh sách chọn: mảng literal, hoặc tên key tra trong `TableOptions`. */
21
- option?: string | Array<Record<string, any>>;
27
+ option?: string | Array<CrudItem>;
22
28
  /** Tên trường dùng làm nhãn/giá trị hiển thị. */
23
29
  keyName?: string;
24
30
  }
@@ -1,7 +1,13 @@
1
1
  import { TooltipProps } from '@mui/material';
2
- interface TooltipCusProps extends Omit<TooltipProps, "children"> {
2
+ interface TooltipCusProps extends Omit<TooltipProps, "children" | "placement"> {
3
3
  children: React.ReactElement;
4
4
  y?: number;
5
+ /**
6
+ * `Tooltip` của MUI chỉ nhận đúng 12 vị trí đã định nghĩa (`TooltipProps`
7
+ * mặc định không để truyền string tự do). Thu hẹp về đúng union đó thay vì
8
+ * ép `as any` — trước đây sai kiểu chỉ lộ lúc runtime.
9
+ */
10
+ placement?: TooltipProps["placement"];
5
11
  }
6
12
  export declare function CusTooltip({ title, children, placement, y }: TooltipCusProps): import('react').JSX.Element;
7
13
  export {};
@@ -1 +1,10 @@
1
- export declare const Head: ({ config }: Record<string, any>) => import('react').JSX.Element;
1
+ /** Cấu hình mà app truyền cho `Head` để dựng `<Helmet>`. */
2
+ export interface HeadConfig {
3
+ name?: string;
4
+ favicon?: string;
5
+ logotext?: string;
6
+ [key: string]: unknown;
7
+ }
8
+ export declare const Head: ({ config }: {
9
+ config?: HeadConfig;
10
+ }) => import('react').JSX.Element;
@@ -1,8 +1,9 @@
1
+ import { CrudItem } from '../../hook/common';
1
2
  export interface HDProps {
2
3
  cUri: string;
3
4
  adminUri: string;
4
5
  title: string;
5
- item?: any;
6
+ item?: CrudItem;
6
7
  isSave?: boolean;
7
8
  titleAction?: string;
8
9
  }
@@ -1,13 +1,17 @@
1
1
  import { default as React } from 'react';
2
- interface HeaderItem {
3
- label?: any;
2
+ import { CrudItem } from '../../hook/common';
3
+ export interface HeaderItem {
4
+ /** Nhãn cột: chuỗi, hoặc node React tuỳ ý (vd icon, badge). */
5
+ label?: React.ReactNode;
4
6
  width?: number;
7
+ /** Căn chỉnh nội dung ô dữ liệu — CSS `text-*` của Bootstrap. */
8
+ align?: string;
5
9
  thClassName?: string;
6
10
  tdClassName?: string;
7
11
  }
8
12
  interface ScrollTableProps extends React.HTMLAttributes<HTMLTableElement> {
9
13
  header: HeaderItem[];
10
- data: Record<string, any>[];
14
+ data: CrudItem[];
11
15
  numOfFirst?: number;
12
16
  numOfLast?: number;
13
17
  columnWidth?: number;
@@ -1,11 +1,12 @@
1
1
  import { TableFilter } from '../../hook/index';
2
+ import { FormChangeHandler } from '../../hook/common';
2
3
  import { TableOptions, TableService } from './CardTable.types';
3
4
  export interface SearchBoxProps {
4
5
  ftfield: string[];
5
6
  service: TableService;
6
7
  options: TableOptions;
7
8
  filter: TableFilter;
8
- handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) => void;
9
+ handleChange: FormChangeHandler;
9
10
  handleSearchForm: (e: React.MouseEvent<HTMLFormElement>) => void;
10
11
  }
11
12
  export declare const SearchBox: React.FC<SearchBoxProps>;
@@ -1 +1,11 @@
1
- export declare function SortableItem({ id, className, iconSize, iconStyle, children, }: any): import('react').JSX.Element;
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ /** Props của một item có thể kéo-thả (dùng chung bởi `BoxAddRow`). */
3
+ export interface SortableItemProps {
4
+ /** Khóa duy nhất — `useSortable` dùng nó để định danh node. */
5
+ id: string;
6
+ className?: string;
7
+ iconSize?: string;
8
+ iconStyle?: CSSProperties;
9
+ children?: ReactNode;
10
+ }
11
+ export declare function SortableItem({ id, className, iconSize, iconStyle, children, }: SortableItemProps): import('react').JSX.Element;
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../SortableItem-C3KzO8Xh.cjs"),t=require("../../meta-CXHXSPbq.cjs"),n=require("../../HeaderUpdate-DIwc8EAA.cjs");exports.BtnGroup=t.l,exports.CardTable=t.a,exports.CusTooltip=n.d,exports.ElfinderModal=t.i,exports.Error403=n.a,exports.Error404=n.i,exports.Head=t.r,exports.HeaderDetail=n.r,exports.HeaderIndex=n.n,exports.HeaderUpdate=n.t,exports.ModalForm=t.c,exports.NavTabs=t.n,exports.PDFEmbed=t.t,exports.Pagination=n.u,exports.ScrollTable=t.s,exports.SearchBox=t.o,exports.SortableItem=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../SortableItem-C3KzO8Xh.cjs"),t=require("../../meta-BANk9kHW.cjs"),n=require("../../HeaderUpdate-Dirxjmxs.cjs");exports.BtnGroup=t.l,exports.CardTable=t.a,exports.CusTooltip=n.d,exports.ElfinderModal=t.i,exports.Error403=n.a,exports.Error404=n.i,exports.Head=t.r,exports.HeaderDetail=n.r,exports.HeaderIndex=n.n,exports.HeaderUpdate=n.t,exports.ModalForm=t.c,exports.NavTabs=t.n,exports.PDFEmbed=t.t,exports.Pagination=n.u,exports.ScrollTable=t.s,exports.SearchBox=t.o,exports.SortableItem=e.t;
@@ -1,4 +1,4 @@
1
1
  import { t as e } from "../../SortableItem-B4-Zsso3.js";
2
- import { a as t, c as n, i as r, l as i, n as a, o, r as s, s as c, t as l } from "../../meta-Dhll5zt9.js";
3
- import { a as u, d, i as f, n as p, r as m, t as h, u as g } from "../../HeaderUpdate-UXncZcAD.js";
2
+ import { a as t, c as n, i as r, l as i, n as a, o, r as s, s as c, t as l } from "../../meta-CheDAmMh.js";
3
+ import { a as u, d, i as f, n as p, r as m, t as h, u as g } from "../../HeaderUpdate-drlnuHI8.js";
4
4
  export { i as BtnGroup, t as CardTable, d as CusTooltip, r as ElfinderModal, u as Error403, f as Error404, s as Head, m as HeaderDetail, p as HeaderIndex, h as HeaderUpdate, n as ModalForm, a as NavTabs, l as PDFEmbed, g as Pagination, c as ScrollTable, o as SearchBox, e as SortableItem };
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../sidebar-G5Ody16K.cjs");exports.Sidebar=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../sidebar-CfQAYWi-.cjs");exports.Sidebar=e.t;
@@ -1,2 +1,2 @@
1
- import { t as e } from "../../sidebar-CVORMKBY.js";
1
+ import { t as e } from "../../sidebar-CzRmfvhi.js";
2
2
  export { e as Sidebar };
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
- import { StateType, PropsType } from '../../hook/index';
2
+ import { StateType, PropsType, TableFilter } from '../../hook/index';
3
+ import { CrudItem } from '../../hook/common';
3
4
  export declare class SingleIndex extends React.Component<PropsType, StateType> {
4
5
  effectRan: boolean;
5
6
  fluid: boolean;
@@ -32,7 +33,7 @@ export declare class SingleIndex extends React.Component<PropsType, StateType> {
32
33
  handleExport: () => Promise<void>;
33
34
  handleSelectOne: (id: number, checked: boolean) => void;
34
35
  handleSelectAll: (checked: boolean, skipIds?: number[]) => void;
35
- setFilter(filter: any): Promise<void>;
36
+ setFilter(filter: TableFilter): Promise<void>;
36
37
  fetchData: () => Promise<void>;
37
38
  /**
38
39
  * Điểm mở rộng (override point) để subclass nạp cấu hình cột theo người dùng.
@@ -45,8 +46,18 @@ export declare class SingleIndex extends React.Component<PropsType, StateType> {
45
46
  * Kiểu trả về khớp với cách đọc ở `syncPermissionsAndState`.
46
47
  */
47
48
  syncGetField: () => Promise<{
48
- userfield: Record<string, any>;
49
- tablefield: Record<string, any>;
49
+ userfield: CrudItem & {
50
+ data?: {
51
+ ftfield?: string[];
52
+ tbfield?: string[];
53
+ };
54
+ };
55
+ tablefield: CrudItem & {
56
+ data?: {
57
+ deft?: string[];
58
+ detb?: string[];
59
+ };
60
+ };
50
61
  }>;
51
62
  syncPermissionsAndState: () => Promise<void>;
52
63
  initDidMount(): Promise<void>;
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { PropsType, StateType } from '../../hook/update';
3
+ import { CrudItem } from '../../hook/common';
3
4
  export declare class SingleUpdate extends React.Component<PropsType, StateType> {
4
5
  effectRan: boolean;
5
6
  module: string;
@@ -33,7 +34,7 @@ export declare class SingleUpdate extends React.Component<PropsType, StateType>
33
34
  componentDidMountAfter: () => Promise<void>;
34
35
  beforeSubmit: () => Promise<unknown>;
35
36
  handleSubmit: (e: React.SubmitEvent<HTMLFormElement>) => Promise<void>;
36
- afterSubmit: (_item: any) => Promise<void>;
37
+ afterSubmit: (_item: CrudItem) => Promise<void>;
37
38
  renderHeaderUpdate(): React.JSX.Element;
38
39
  render(): React.JSX.Element;
39
40
  }