@materialui-reactjs/admin 1.0.6 → 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.
- package/CHANGELOG.md +322 -0
- package/LICENSE +21 -0
- package/README.md +587 -453
- package/dist/Common-DFahMuQE.cjs +11 -0
- package/dist/Common-_PK8HLKN.js +267 -0
- package/dist/Env-DoS-iQjs.cjs +1 -0
- package/dist/Env-SHztUA3s.js +16 -0
- package/dist/HeaderUpdate-Dirxjmxs.cjs +1 -0
- package/dist/{chunks/HeaderUpdate-DuS-gHNR.js → HeaderUpdate-drlnuHI8.js} +28 -25
- package/dist/SortableItem-C3KzO8Xh.cjs +1 -0
- package/dist/SpinnerLoader-BujLjvC3.cjs +1 -0
- package/dist/{chunks/SpinnerLoader-h8RDIarB.js → SpinnerLoader-CyhOQC6d.js} +2 -2
- package/dist/UDragFile-D8wOZ1Ut.js +96 -0
- package/dist/UDragFile-Db0sK4M7.cjs +1 -0
- package/dist/{chunks/Validator-CXYkI7vJ.js → Validator-D2zwZeov.js} +83 -52
- package/dist/Validator-DBxl8wtE.cjs +1 -0
- package/dist/assets/css/form.css +1 -1
- package/dist/assets/css/index.css +1 -1
- package/dist/ckeditor/ckeditor.d.ts +3 -0
- package/dist/ckeditor/plugins/elfinder.d.ts +11 -0
- package/dist/ckeditor/plugins/fullscreen.d.ts +15 -0
- package/dist/ckeditor/plugins/pdffinder.d.ts +18 -0
- package/dist/ckeditor/types.d.ts +37 -0
- package/dist/common-CEZp8xpQ.js +30 -0
- package/dist/common-ivDX6gGq.cjs +1 -0
- package/dist/components/echarts/index.cjs +1 -0
- package/dist/components/echarts/index.js +1 -1
- package/dist/components/form/AdvancedMultiSelect.d.ts +6 -3
- package/dist/components/form/AsxhUImages.d.ts +2 -1
- package/dist/components/form/BoxAddRow.d.ts +13 -2
- package/dist/components/form/CheckTreeBox.d.ts +12 -3
- package/dist/components/form/CusForm.d.ts +19 -6
- package/dist/components/form/DateInput.d.ts +2 -1
- package/dist/components/form/Editor.d.ts +2 -1
- package/dist/components/form/EfFile.d.ts +2 -1
- package/dist/components/form/EfImage.d.ts +2 -1
- package/dist/components/form/EfImages.d.ts +2 -1
- package/dist/components/form/PImage.d.ts +2 -1
- package/dist/components/form/SelectAddRowBox.d.ts +9 -5
- package/dist/components/form/SelectAddRowBoxAdvanced.d.ts +13 -4
- package/dist/components/form/SelectBox.d.ts +20 -7
- package/dist/components/form/UDragFile.d.ts +2 -1
- package/dist/components/form/UFile.d.ts +2 -1
- package/dist/components/form/UFiles.d.ts +9 -2
- package/dist/components/form/UImages.d.ts +2 -1
- package/dist/components/form/index.cjs +1 -0
- package/dist/components/form/index.js +2 -2
- package/dist/components/loader/SpinnerLoader.d.ts +5 -1
- package/dist/components/loader/index.cjs +1 -0
- package/dist/components/loader/index.js +1 -2
- package/dist/components/meta/CardTable.d.ts +11 -5
- package/dist/components/meta/CardTable.types.d.ts +57 -0
- package/dist/components/meta/CusTooltip.d.ts +8 -2
- package/dist/components/meta/Head.d.ts +10 -1
- package/dist/components/meta/HeaderDetail.d.ts +2 -1
- package/dist/components/meta/HeaderUpdate.d.ts +5 -1
- package/dist/components/meta/ModalForm.d.ts +41 -11
- package/dist/components/meta/Navtabs.d.ts +1 -1
- package/dist/components/meta/ScrollTable.d.ts +7 -3
- package/dist/components/meta/SearchBox.d.ts +8 -5
- package/dist/components/meta/SortableItem.d.ts +11 -1
- package/dist/components/meta/index.cjs +1 -0
- package/dist/components/meta/index.d.ts +1 -0
- package/dist/components/meta/index.js +3 -3
- package/dist/components/sidebar/Sidebar.types.d.ts +9 -7
- package/dist/components/sidebar/index.cjs +1 -0
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/single/Detail.d.ts +8 -3
- package/dist/components/single/Fields.d.ts +10 -4
- package/dist/components/single/Import.d.ts +8 -3
- package/dist/components/single/List.d.ts +33 -7
- package/dist/components/single/Update.d.ts +10 -4
- package/dist/components/single/UpdateDetail.d.ts +3 -2
- package/dist/components/single/UpdateTableDetail.d.ts +4 -3
- package/dist/components/single/index.cjs +1 -0
- package/dist/components/single/index.js +1 -1
- package/dist/components/top-navbar/index.cjs +1 -0
- package/dist/components/top-navbar/index.js +78 -2
- package/dist/echarts-Bi3uwLbg.cjs +1 -0
- package/dist/{chunks/echarts-CRmndsxC.js → echarts-CTzMqeR5.js} +4 -4
- package/dist/form-heyswTRq.js +3897 -0
- package/dist/form-sgtop6li.cjs +49 -0
- package/dist/hook/common.d.ts +87 -0
- package/dist/hook/detail.cjs +1 -0
- package/dist/hook/detail.d.ts +9 -15
- package/dist/hook/detail.js +1 -11
- package/dist/hook/fields.cjs +1 -0
- package/dist/hook/fields.d.ts +6 -14
- package/dist/hook/fields.js +1 -11
- package/dist/hook/import.d.ts +6 -11
- package/dist/hook/index.cjs +1 -0
- package/dist/hook/index.d.ts +29 -20
- package/dist/hook/index.js +14 -11
- package/dist/hook/update.cjs +1 -0
- package/dist/hook/update.d.ts +11 -19
- package/dist/hook/update.js +12 -9
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +14 -11
- package/dist/meta-BANk9kHW.cjs +1 -0
- package/dist/meta-CheDAmMh.js +745 -0
- package/dist/rolldown-runtime-BocRIvOZ.cjs +1 -0
- package/dist/sidebar-CfQAYWi-.cjs +1 -0
- package/dist/{chunks/sidebar-Dj4Xr9du.js → sidebar-CzRmfvhi.js} +10 -13
- package/dist/{chunks/single-CRF61o_U.js → single-BsJ7TYJi.js} +364 -282
- package/dist/single-C2WPEjhk.cjs +1 -0
- package/dist/style.cjs +0 -0
- package/dist/style.d.ts +0 -0
- package/dist/style.js +0 -0
- package/dist/types/Menu.d.ts +25 -0
- package/dist/utils/Common.d.ts +224 -43
- package/dist/utils/CusRoute.d.ts +21 -1
- package/dist/utils/Env.d.ts +23 -2
- package/dist/utils/Group.d.ts +12 -1
- package/dist/utils/Validator.d.ts +34 -12
- package/dist/utils/index.cjs +11 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +212 -171
- package/package.json +190 -163
- package/dist/chunks/Common-BURf0rBN.js +0 -222
- package/dist/chunks/Env-DRXhvUcb.js +0 -16
- package/dist/chunks/UDragFile-BnUR3riq.js +0 -92
- package/dist/chunks/form-CPkpL5eA.js +0 -45889
- package/dist/chunks/loader-BUiOnhOH.js +0 -1
- package/dist/chunks/meta-4qPWijBT.js +0 -758
- package/dist/chunks/top-navbar-Bob0gMUh.js +0 -78
- package/scripts/postinstall.cjs +0 -80
- /package/dist/{chunks/SortableItem-B4-Zsso3.js → SortableItem-B4-Zsso3.js} +0 -0
- /package/dist/{components/meta/Pdfviewer.d.ts → hook/import.cjs} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Plugin } from 'ckeditor5';
|
|
2
|
+
/**
|
|
3
|
+
* Nút toolbar `elfinder` — mở file manager để chèn ảnh.
|
|
4
|
+
*
|
|
5
|
+
* Plugin KHÔNG tự quản lý UI: nó chỉ đăng ký button rồi gọi lại callback
|
|
6
|
+
* `config.elfinder` do `Editor.tsx` truyền vào. Nhờ vậy plugin không phụ
|
|
7
|
+
* thuộc vào jQuery/Bootstrap/elFinder — mọi thứ UI thuộc về component React.
|
|
8
|
+
*/
|
|
9
|
+
export default class ElFinder extends Plugin {
|
|
10
|
+
init(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Plugin } from 'ckeditor5';
|
|
2
|
+
/**
|
|
3
|
+
* Nút toolbar `fullscreen` — phóng editor phủ toàn màn hình.
|
|
4
|
+
*
|
|
5
|
+
* CKEditor 5 v48 đã có plugin Fullscreen chính thức, nhưng bản đó đòi hỏi
|
|
6
|
+
* `GeneralHtmlSupport` và đổi hành vi toolbar. Ở đây giữ bản custom để hành vi
|
|
7
|
+
* không đổi so với bản build cũ: chỉ đặt inline style `position: fixed` lên
|
|
8
|
+
* chính thẻ `.ck-editor` rồi khôi phục lại khi bấm lần nữa.
|
|
9
|
+
*/
|
|
10
|
+
export default class Fullscreen extends Plugin {
|
|
11
|
+
private isFullscreen;
|
|
12
|
+
private originalStyles;
|
|
13
|
+
init(): void;
|
|
14
|
+
toggle(): void;
|
|
15
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/hook/common.ts
|
|
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) {
|
|
14
|
+
if (!e) return;
|
|
15
|
+
let t = e.id;
|
|
16
|
+
if (t == null || t === "") return;
|
|
17
|
+
let n = Number(t);
|
|
18
|
+
return Number.isNaN(n) ? void 0 : n;
|
|
19
|
+
}
|
|
20
|
+
var n = (e) => {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
let { name: t, type: n, value: r } = e.target;
|
|
23
|
+
if (n === "file") {
|
|
24
|
+
let n = e.target.files;
|
|
25
|
+
return { [t]: n?.[0] ?? null };
|
|
26
|
+
}
|
|
27
|
+
return { [t]: r };
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
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}});
|
|
@@ -0,0 +1 @@
|
|
|
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 "../../
|
|
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,16 +1,19 @@
|
|
|
1
|
+
import { FormChangeHandler } from '../../hook/common';
|
|
2
|
+
/** Kiểu giá trị của một lựa chọn — luôn là primitive để so sánh được. */
|
|
3
|
+
type SelectValue = string | number;
|
|
1
4
|
interface SelectProps {
|
|
2
5
|
label?: string;
|
|
3
6
|
name?: string;
|
|
4
|
-
lists?:
|
|
7
|
+
lists?: Array<Record<string, unknown>>;
|
|
5
8
|
keyValue?: string;
|
|
6
9
|
keyName?: string;
|
|
7
|
-
value?:
|
|
10
|
+
value?: SelectValue[];
|
|
8
11
|
cpnClass?: string;
|
|
9
12
|
required?: boolean;
|
|
10
13
|
disabled?: boolean;
|
|
11
14
|
all?: boolean;
|
|
12
15
|
zero?: boolean;
|
|
13
|
-
onChange?:
|
|
16
|
+
onChange?: FormChangeHandler;
|
|
14
17
|
}
|
|
15
18
|
export declare const AdvancedMultiSelect: React.FC<SelectProps>;
|
|
16
19
|
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?:
|
|
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:
|
|
9
|
+
value: FormScalar;
|
|
9
10
|
}[];
|
|
10
11
|
keyValue?: string;
|
|
11
12
|
keyName?: string;
|
|
@@ -15,7 +16,17 @@ export interface Option {
|
|
|
15
16
|
ext?: string;
|
|
16
17
|
colClass?: string;
|
|
17
18
|
}
|
|
18
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Một dòng trong form động.
|
|
21
|
+
*
|
|
22
|
+
* - `_uid` : khoá ổn định cho react-key và dnd-kit.
|
|
23
|
+
* - field `text`/`textarea`: object lồng theo mã ngôn ngữ, `{ [langId]: value }`
|
|
24
|
+
* (xem `renderField` — tên field được sinh thành `{name}{langId}`).
|
|
25
|
+
* - field khác : giá trị thẳng (`""`, `[]`, hoặc kết quả từ picker).
|
|
26
|
+
*/
|
|
27
|
+
export type Row = Record<string, unknown> & {
|
|
28
|
+
_uid?: string;
|
|
29
|
+
};
|
|
19
30
|
interface BoxAddRowProps {
|
|
20
31
|
layout?: number;
|
|
21
32
|
options: Option[];
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import { FormChangeHandler } from '../../hook/common';
|
|
2
|
+
/** Một nút trong cây quyền (tối đa 3 cấp: cha -> con -> cháu). */
|
|
3
|
+
export interface TreeNode {
|
|
4
|
+
id: number | string;
|
|
5
|
+
name: string;
|
|
6
|
+
subs?: TreeNode[];
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
1
9
|
interface CheckTreeBoxProps {
|
|
2
10
|
label?: string;
|
|
3
11
|
name: string;
|
|
4
|
-
|
|
5
|
-
|
|
12
|
+
/** id đang chọn; component không tự giữ state — nhận từ parent. */
|
|
13
|
+
values?: string[];
|
|
14
|
+
lists: TreeNode[];
|
|
6
15
|
col?: string;
|
|
7
16
|
keyValue?: string;
|
|
8
17
|
keyName?: string;
|
|
@@ -12,7 +21,7 @@ interface CheckTreeBoxProps {
|
|
|
12
21
|
required?: boolean;
|
|
13
22
|
disabled?: boolean;
|
|
14
23
|
readonly?: boolean;
|
|
15
|
-
onChange?:
|
|
24
|
+
onChange?: FormChangeHandler;
|
|
16
25
|
}
|
|
17
26
|
export declare const CheckTreeBox: React.FC<CheckTreeBoxProps>;
|
|
18
27
|
export {};
|
|
@@ -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?:
|
|
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?:
|
|
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
|
|
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?:
|
|
92
|
-
lists:
|
|
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?:
|
|
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 DateProps {
|
|
2
3
|
label: string;
|
|
3
4
|
name: string;
|
|
@@ -8,7 +9,7 @@ interface DateProps {
|
|
|
8
9
|
placeholder?: string;
|
|
9
10
|
placeholderText?: string;
|
|
10
11
|
readonly?: boolean;
|
|
11
|
-
onChange?:
|
|
12
|
+
onChange?: FormChangeHandler;
|
|
12
13
|
}
|
|
13
14
|
export declare const DateInput: React.FC<DateProps>;
|
|
14
15
|
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?:
|
|
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 EfFileProps {
|
|
2
3
|
label: string;
|
|
3
4
|
name: string;
|
|
@@ -9,7 +10,7 @@ interface EfFileProps {
|
|
|
9
10
|
readonly?: boolean;
|
|
10
11
|
ext: string;
|
|
11
12
|
df?: string;
|
|
12
|
-
onChange?:
|
|
13
|
+
onChange?: FormChangeHandler;
|
|
13
14
|
}
|
|
14
15
|
export declare const EfFile: React.FC<EfFileProps>;
|
|
15
16
|
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?:
|
|
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?:
|
|
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?:
|
|
13
|
+
onChange?: FormChangeHandler;
|
|
13
14
|
}
|
|
14
15
|
export declare const PImage: React.FC<PImageProps>;
|
|
15
16
|
export {};
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
/** Một dòng chi tiết; giá trị đổi tuỳ loại field nên để `unknown`. */
|
|
2
|
+
export type DetailRow = Record<string, unknown>;
|
|
1
3
|
interface SelectProps {
|
|
2
4
|
itemLabel: string;
|
|
5
|
+
/** Tên field giữ id của dòng, ví dụ `productId`. */
|
|
3
6
|
itemName: string;
|
|
4
7
|
selectName?: string;
|
|
5
8
|
keyName?: string;
|
|
6
9
|
keyValue?: string;
|
|
7
|
-
lists:
|
|
10
|
+
lists: Array<Record<string, unknown>>;
|
|
8
11
|
clsWidth?: string;
|
|
9
12
|
btnTxt?: string;
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
/** Render nội dung một dòng; nhận thêm handler sửa giá trị của dòng đó. */
|
|
14
|
+
rendeRowData?: (row: DetailRow, index: number, onEdit: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>, row: number) => void) => React.ReactNode;
|
|
15
|
+
detailRow?: DetailRow[] | null;
|
|
12
16
|
isEdit?: boolean;
|
|
13
|
-
onSubmit?: (data:
|
|
14
|
-
onChangeRow?: (data:
|
|
17
|
+
onSubmit?: (data: DetailRow[], frmRef: HTMLElement) => void;
|
|
18
|
+
onChangeRow?: (data: DetailRow[]) => void;
|
|
15
19
|
}
|
|
16
20
|
export declare const SelectAddRowBox: React.FC<SelectProps>;
|
|
17
21
|
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
|
|
14
|
+
lists?: CrudItem[];
|
|
6
15
|
clsWidth?: string;
|
|
7
16
|
btnTxt?: string;
|
|
8
|
-
rendeRowData?:
|
|
9
|
-
detailRow?:
|
|
17
|
+
rendeRowData?: RenderRowData;
|
|
18
|
+
detailRow?: CrudItem[];
|
|
10
19
|
isEdit?: boolean;
|
|
11
20
|
keyValue?: string;
|
|
12
21
|
keyName?: string;
|
|
13
|
-
onSubmit?: (data:
|
|
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
|
|
17
|
+
lists?: CrudItem[];
|
|
5
18
|
keyValue?: string;
|
|
6
19
|
keyName?: string;
|
|
7
|
-
value?:
|
|
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?:
|
|
14
|
-
onChange?:
|
|
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
|
|
33
|
+
lists?: CrudItem[];
|
|
21
34
|
keyValue?: string;
|
|
22
35
|
keyName?: string;
|
|
23
|
-
value?:
|
|
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?:
|
|
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:
|
|
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?:
|
|
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?:
|
|
13
|
+
onChange?: FormChangeHandler;
|
|
13
14
|
}
|
|
14
15
|
export declare const UFiles: React.FC<UFileProps>;
|
|
15
|
-
|
|
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?:
|
|
13
|
+
onChange?: FormChangeHandler;
|
|
13
14
|
}
|
|
14
15
|
export declare const UImages: React.FC<UImageProps>;
|
|
15
16
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
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 "../../
|
|
2
|
-
import { t as D } from "../../
|
|
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,7 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
interface SpinnerLoaderProps {
|
|
3
3
|
children: ReactNode;
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Tuỳ chọn: `undefined` được coi như "không tải" (xem render bên dưới),
|
|
6
|
+
* nên component không bắt buộc phải truyền cờ này.
|
|
7
|
+
*/
|
|
8
|
+
loading?: boolean;
|
|
5
9
|
style?: React.CSSProperties;
|
|
6
10
|
}
|
|
7
11
|
export declare const SpinnerLoader: React.FC<SpinnerLoaderProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../SpinnerLoader-BujLjvC3.cjs");exports.SpinnerLoader=e.t;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { TableFormBody, TableOptions, TableService } from './CardTable.types';
|
|
2
|
+
import { FormValue } from '../../hook/common';
|
|
3
|
+
import { TableFilter } from '../../hook/index';
|
|
1
4
|
export interface ApiOptionType {
|
|
2
5
|
cUri: string;
|
|
3
|
-
filter?:
|
|
4
|
-
formData?:
|
|
6
|
+
filter?: TableFilter;
|
|
7
|
+
formData?: Partial<FormValue>;
|
|
5
8
|
apiGetData: string;
|
|
6
9
|
apiGetDetail: string;
|
|
7
10
|
apiCreate: string;
|
|
@@ -24,9 +27,12 @@ export interface RoleOption {
|
|
|
24
27
|
isIndex: boolean;
|
|
25
28
|
}
|
|
26
29
|
interface CardTableProps {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
/** Nội dung form hiển thị trong modal thêm/sửa. */
|
|
31
|
+
frmBody: TableFormBody;
|
|
32
|
+
/** Hợp đồng mô tả nhãn + kiểu hiển thị của từng cột/trường. */
|
|
33
|
+
service: TableService;
|
|
34
|
+
/** Danh sách chọn dùng cho trường tìm kiếm dạng `select`. */
|
|
35
|
+
options: TableOptions;
|
|
30
36
|
tbOption: TbOption;
|
|
31
37
|
roleOption: RoleOption;
|
|
32
38
|
apiOption: ApiOptionType;
|