@materialui-reactjs/admin 1.0.5 → 2.0.0
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 +292 -0
- package/LICENSE +21 -0
- package/README.md +584 -453
- package/dist/Common-1GAoFU4L.js +261 -0
- package/dist/Common-BBYXssMH.cjs +11 -0
- package/dist/Env-DoS-iQjs.cjs +1 -0
- package/dist/Env-SHztUA3s.js +16 -0
- package/dist/HeaderUpdate-DIwc8EAA.cjs +1 -0
- package/dist/{chunks/HeaderUpdate-CYN7fndV.js → HeaderUpdate-UXncZcAD.js} +8 -4
- 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-BqGt1-gK.js +96 -0
- package/dist/UDragFile-oJ05zNLR.cjs +1 -0
- package/dist/Validator-BcydBvOg.cjs +1 -0
- package/dist/{chunks/Validator-CXYkI7vJ.js → Validator-aKlMgoxl.js} +50 -42
- package/dist/assets/css/form.css +1 -1
- package/dist/assets/css/index.css +1 -1
- package/dist/common-CHDJQ2Ca.cjs +1 -0
- package/dist/common-DVWX6AUQ.js +19 -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 +1 -1
- package/dist/components/form/BoxAddRow.d.ts +11 -1
- package/dist/components/form/CheckTreeBox.d.ts +12 -3
- package/dist/components/form/DateInput.d.ts +2 -1
- package/dist/components/form/EfFile.d.ts +2 -1
- package/dist/components/form/EfImage.d.ts +1 -1
- package/dist/components/form/EfImages.d.ts +1 -1
- package/dist/components/form/PImage.d.ts +1 -1
- package/dist/components/form/SelectAddRowBox.d.ts +9 -5
- package/dist/components/form/UDragFile.d.ts +1 -1
- package/dist/components/form/UFile.d.ts +1 -1
- package/dist/components/form/UFiles.d.ts +1 -1
- package/dist/components/form/UImages.d.ts +1 -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 +7 -3
- package/dist/components/meta/CardTable.types.d.ts +51 -0
- package/dist/components/meta/CusTooltip.d.ts +1 -1
- package/dist/components/meta/Head.d.ts +1 -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/SearchBox.d.ts +6 -4
- package/dist/components/meta/SortableItem.d.ts +1 -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 +18 -3
- package/dist/components/single/Update.d.ts +8 -3
- package/dist/components/single/UpdateDetail.d.ts +3 -2
- package/dist/components/single/UpdateTableDetail.d.ts +3 -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-Dla22xas.cjs +1 -0
- package/dist/{chunks/form-DirVyglJ.js → form-BNAbGCXe.js} +6860 -6794
- package/dist/form-DUL_O4IY.cjs +65 -0
- package/dist/hook/common.d.ts +65 -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 +28 -20
- package/dist/hook/index.js +13 -10
- package/dist/hook/update.cjs +1 -0
- package/dist/hook/update.d.ts +9 -17
- package/dist/hook/update.js +2 -2
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +14 -11
- package/dist/meta-CXHXSPbq.cjs +1 -0
- package/dist/{chunks/meta-BkJxF49g.js → meta-Dhll5zt9.js} +45 -39
- package/dist/rolldown-runtime-BocRIvOZ.cjs +1 -0
- package/dist/{chunks/sidebar-Dj4Xr9du.js → sidebar-CVORMKBY.js} +9 -12
- package/dist/sidebar-G5Ody16K.cjs +1 -0
- package/dist/{chunks/single-DfnwtW2f.js → single-CqD5cgNi.js} +353 -259
- package/dist/single-CsUaxEjQ.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 +128 -16
- 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 +188 -151
- package/package.json +190 -163
- package/dist/chunks/Common-C_ZhT4L6.js +0 -217
- package/dist/chunks/Env-DRXhvUcb.js +0 -16
- package/dist/chunks/UDragFile-CAiSfTsp.js +0 -92
- package/dist/chunks/loader-BUiOnhOH.js +0 -1
- package/dist/chunks/top-navbar-FBw88y_o.js +0 -78
- package/scripts/postinstall.cjs +0 -80
- /package/dist/{chunks/SortableItem-B4-Zsso3.js → SortableItem-B4-Zsso3.js} +0 -0
- /package/dist/{chunks/echarts-CRmndsxC.js → echarts-CRmndsxC.js} +0 -0
- /package/dist/{components/meta/Pdfviewer.d.ts → hook/import.cjs} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(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 t=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,"t",{enumerable:!0,get:function(){return e}});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/hook/common.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
if (!e) return;
|
|
4
|
+
let t = e.id;
|
|
5
|
+
if (t == null || t === "") return;
|
|
6
|
+
let n = Number(t);
|
|
7
|
+
return Number.isNaN(n) ? void 0 : n;
|
|
8
|
+
}
|
|
9
|
+
var t = (e) => {
|
|
10
|
+
e.preventDefault();
|
|
11
|
+
let { name: t, type: n, value: r } = e.target;
|
|
12
|
+
if (n === "file") {
|
|
13
|
+
let n = e.target.files;
|
|
14
|
+
return { [t]: n?.[0] ?? null };
|
|
15
|
+
}
|
|
16
|
+
return { [t]: r };
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { t as n, e as t };
|
|
@@ -0,0 +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,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-CRmndsxC.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 {};
|
|
@@ -15,7 +15,17 @@ export interface Option {
|
|
|
15
15
|
ext?: string;
|
|
16
16
|
colClass?: string;
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Một dòng trong form động.
|
|
20
|
+
*
|
|
21
|
+
* - `_uid` : khoá ổn định cho react-key và dnd-kit.
|
|
22
|
+
* - field `text`/`textarea`: object lồng theo mã ngôn ngữ, `{ [langId]: value }`
|
|
23
|
+
* (xem `renderField` — tên field được sinh thành `{name}{langId}`).
|
|
24
|
+
* - field khác : giá trị thẳng (`""`, `[]`, hoặc kết quả từ picker).
|
|
25
|
+
*/
|
|
26
|
+
export type Row = Record<string, unknown> & {
|
|
27
|
+
_uid?: string;
|
|
28
|
+
};
|
|
19
29
|
interface BoxAddRowProps {
|
|
20
30
|
layout?: number;
|
|
21
31
|
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,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 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,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 {};
|
|
@@ -9,7 +9,7 @@ interface UFileProps {
|
|
|
9
9
|
readonly?: boolean;
|
|
10
10
|
ext: string;
|
|
11
11
|
df?: string;
|
|
12
|
-
onChange?: (
|
|
12
|
+
onChange?: (e: any) => void;
|
|
13
13
|
}
|
|
14
14
|
export declare const UFiles: React.FC<UFileProps>;
|
|
15
15
|
export declare const validateRequiredFiles: (formValue: any, fieldName: string, fieldLabel: string) => boolean;
|
|
@@ -0,0 +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,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-BNAbGCXe.js";
|
|
2
|
+
import { t as D } from "../../UDragFile-BqGt1-gK.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,3 +1,4 @@
|
|
|
1
|
+
import { TableFormBody, TableOptions, TableService } from './CardTable.types';
|
|
1
2
|
export interface ApiOptionType {
|
|
2
3
|
cUri: string;
|
|
3
4
|
filter?: any;
|
|
@@ -24,9 +25,12 @@ export interface RoleOption {
|
|
|
24
25
|
isIndex: boolean;
|
|
25
26
|
}
|
|
26
27
|
interface CardTableProps {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
/** Nội dung form hiển thị trong modal thêm/sửa. */
|
|
29
|
+
frmBody: TableFormBody;
|
|
30
|
+
/** Hợp đồng mô tả nhãn + kiểu hiển thị của từng cột/trường. */
|
|
31
|
+
service: TableService;
|
|
32
|
+
/** Danh sách chọn dùng cho trường tìm kiếm dạng `select`. */
|
|
33
|
+
options: TableOptions;
|
|
30
34
|
tbOption: TbOption;
|
|
31
35
|
roleOption: RoleOption;
|
|
32
36
|
apiOption: ApiOptionType;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kiểu cột mà `service.tbFields()` trả về cho từng field của bảng.
|
|
3
|
+
*/
|
|
4
|
+
export type TableColumnType = "text" | "number" | "date" | "select" | "selecthtml" | (string & {});
|
|
5
|
+
/** Cấu hình hiển thị của một cột trong bảng. */
|
|
6
|
+
export interface TableColumnConfig {
|
|
7
|
+
type: TableColumnType;
|
|
8
|
+
width?: number;
|
|
9
|
+
tdClassName?: string;
|
|
10
|
+
thClassName?: string;
|
|
11
|
+
/**
|
|
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;
|
|
16
|
+
}
|
|
17
|
+
/** Cấu hình của một trường tìm kiếm. */
|
|
18
|
+
export interface TableFilterConfig {
|
|
19
|
+
type: "text" | "select" | (string & {});
|
|
20
|
+
/** Danh sách chọn: mảng literal, hoặc tên key tra trong `TableOptions`. */
|
|
21
|
+
option?: string | Array<Record<string, any>>;
|
|
22
|
+
/** Tên trường dùng làm nhãn/giá trị hiển thị. */
|
|
23
|
+
keyName?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Hợp đồng mà consumer phải cung cấp cho `CardTable` / `SearchBox`.
|
|
27
|
+
*
|
|
28
|
+
* Trước đây prop `service` kiểu `any`, nên sai tên hàm chỉ lộ ra lúc runtime.
|
|
29
|
+
* Giờ sai kiểu sẽ bị TypeScript chặn ngay.
|
|
30
|
+
*/
|
|
31
|
+
export interface TableService {
|
|
32
|
+
/** Cấu hình cột hiển thị cho `field`. */
|
|
33
|
+
tbFields: (field: string) => TableColumnConfig;
|
|
34
|
+
/** Cấu hình trường tìm kiếm cho `field`. */
|
|
35
|
+
ftFields: (field: string) => TableFilterConfig;
|
|
36
|
+
/** Nhãn tiếng Việt của `field`. */
|
|
37
|
+
fieldName: (field: string) => string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Bảng tra danh sách chọn, dùng bởi `ftFields().option` khi trả về tên key
|
|
41
|
+
* (chuỗi) thay vì mảng literal.
|
|
42
|
+
*/
|
|
43
|
+
export type TableOptions = Record<string, Array<Record<string, unknown>>>;
|
|
44
|
+
/**
|
|
45
|
+
* Nội dung form render bên trong modal thêm/sửa.
|
|
46
|
+
*
|
|
47
|
+
* Không định nghĩa lại ở đây mà dùng chung với `ModalForm` — chính `ModalForm`
|
|
48
|
+
* là nơi quyết định gọi `frmBody(formData, handleChange)`, nên để một nguồn
|
|
49
|
+
* duy nhất tránh hai bản chữ ký lệch nhau.
|
|
50
|
+
*/
|
|
51
|
+
export type { ModalFormBody as TableFormBody } from './ModalForm';
|
|
@@ -3,5 +3,5 @@ interface TooltipCusProps extends Omit<TooltipProps, "children"> {
|
|
|
3
3
|
children: React.ReactElement;
|
|
4
4
|
y?: number;
|
|
5
5
|
}
|
|
6
|
-
export declare function CusTooltip({ title, children, placement, y }: TooltipCusProps): import(
|
|
6
|
+
export declare function CusTooltip({ title, children, placement, y }: TooltipCusProps): import('react').JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const Head: ({ config }: Record<string, any>) => import(
|
|
1
|
+
export declare const Head: ({ config }: Record<string, any>) => import('react').JSX.Element;
|
|
@@ -2,7 +2,11 @@ export interface HUProps {
|
|
|
2
2
|
adminUri: string;
|
|
3
3
|
cUri: string;
|
|
4
4
|
title: string;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* `id` của bản ghi. Tuỳ chọn vì trang "thêm mới" chưa có bản ghi nào —
|
|
7
|
+
* lúc đó header chỉ hiện nút quay lại, không dùng id.
|
|
8
|
+
*/
|
|
9
|
+
itemId?: number;
|
|
6
10
|
isSave?: boolean;
|
|
7
11
|
titleAction?: string;
|
|
8
12
|
}
|
|
@@ -1,18 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Dispatch, RefObject, SetStateAction } from 'react';
|
|
2
|
+
import { FormValue } from '../../hook/common';
|
|
3
|
+
/**
|
|
4
|
+
* Instance modal của Bootstrap, chỉ phần `ModalForm` thực sự dùng.
|
|
5
|
+
*
|
|
6
|
+
* Cố tình KHÔNG khai báo `Modal` từ `bootstrap`: đó là peerDependency nhưng
|
|
7
|
+
* `@types/bootstrap` thì không được khai ở đâu cả. Nếu để kiểu đó lọt vào
|
|
8
|
+
* `.d.ts`, mọi consumer chạy `skipLibCheck: false` đều phải tự cài
|
|
9
|
+
* `@types/bootstrap` chỉ để typecheck — đã kiểm chứng bằng cách cài package
|
|
10
|
+
* vào một project sạch.
|
|
11
|
+
*/
|
|
12
|
+
export interface ModalInstance {
|
|
13
|
+
hide(): void;
|
|
14
|
+
show(): void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Nội dung form trong modal.
|
|
18
|
+
*
|
|
19
|
+
* Là HÀM render chứ không phải node: `ModalForm` gọi
|
|
20
|
+
* `frmBody(formData, handleChange)` để truyền dữ liệu hiện tại + handler đổi
|
|
21
|
+
* giá trị xuống form con. Truyền một element trực tiếp sẽ ném
|
|
22
|
+
* "frmBody is not a function" lúc runtime.
|
|
23
|
+
*/
|
|
24
|
+
export type ModalFormBody = (formData: FormValue, onChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) => void) => React.ReactNode;
|
|
25
|
+
export interface ModalFormProps {
|
|
26
|
+
/** Element gốc của modal; component gắn instance Bootstrap vào đây. */
|
|
27
|
+
modalRef: RefObject<HTMLDivElement | null>;
|
|
28
|
+
/** URL chi tiết; có `itemId` thì modal tự nạp bản ghi. */
|
|
4
29
|
apiGetDetail?: string;
|
|
30
|
+
/** `0` (hoặc bỏ trống) = chế độ thêm mới. */
|
|
5
31
|
itemId?: number;
|
|
6
|
-
|
|
32
|
+
/** Được gọi khi modal đóng, để parent reset `itemId` về 0. */
|
|
33
|
+
setItemId?: (id: number) => void;
|
|
7
34
|
title: string;
|
|
8
|
-
frmBody:
|
|
35
|
+
frmBody: ModalFormBody;
|
|
9
36
|
clsWidth?: string;
|
|
10
37
|
btnTxt?: string;
|
|
11
|
-
onHide?:
|
|
12
|
-
style?:
|
|
38
|
+
onHide?: () => void;
|
|
39
|
+
style?: React.CSSProperties;
|
|
13
40
|
clsBody?: string;
|
|
14
|
-
|
|
15
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Dữ liệu khởi tạo cho form; ưu tiên dùng `itemId` để tự nạp từ API.
|
|
43
|
+
* Cùng kiểu với state nội bộ nên gán thẳng, không cần chuyển đổi.
|
|
44
|
+
*/
|
|
45
|
+
data?: FormValue;
|
|
46
|
+
onSubmit: (data: FormValue, modal: ModalInstance, setFormData?: Dispatch<SetStateAction<FormValue>>) => void;
|
|
16
47
|
}
|
|
17
|
-
export declare const ModalForm: React.FC<
|
|
18
|
-
export {};
|
|
48
|
+
export declare const ModalForm: React.FC<ModalFormProps>;
|
|
@@ -8,5 +8,5 @@ interface Props {
|
|
|
8
8
|
tabs: Tab[];
|
|
9
9
|
onChange?: (key: TabKey) => void;
|
|
10
10
|
}
|
|
11
|
-
export declare function NavTabs({ tabs, onChange }: Props): import(
|
|
11
|
+
export declare function NavTabs({ tabs, onChange }: Props): import('react').JSX.Element;
|
|
12
12
|
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { TableFilter } from '../../hook/index';
|
|
2
|
+
import { TableOptions, TableService } from './CardTable.types';
|
|
1
3
|
export interface SearchBoxProps {
|
|
2
|
-
ftfield:
|
|
3
|
-
service:
|
|
4
|
-
options:
|
|
5
|
-
filter:
|
|
4
|
+
ftfield: string[];
|
|
5
|
+
service: TableService;
|
|
6
|
+
options: TableOptions;
|
|
7
|
+
filter: TableFilter;
|
|
6
8
|
handleChange: (e: React.ChangeEvent<HTMLInputElement | HTMLSelectElement>) => void;
|
|
7
9
|
handleSearchForm: (e: React.MouseEvent<HTMLFormElement>) => void;
|
|
8
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function SortableItem({ id, className, iconSize, iconStyle, children }: any): import(
|
|
1
|
+
export declare function SortableItem({ id, className, iconSize, iconStyle, children, }: any): import('react').JSX.Element;
|
|
@@ -0,0 +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,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "../../
|
|
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 "../../
|
|
3
|
-
import { a as u, d, i as f, n as p, r as m, t as h, u as g } from "../../
|
|
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";
|
|
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,17 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { MenuPermissionItem } from '../../types/Menu';
|
|
2
|
+
/**
|
|
3
|
+
* Menu hiển thị trong Sidebar.
|
|
4
|
+
*
|
|
5
|
+
* Mở rộng `MenuPermissionItem` (hình dạng tối thiểu cho lớp phân quyền) bằng
|
|
6
|
+
* các trường chỉ dùng để render. Nhờ vậy `MenuItem[]` truyền thẳng được vào
|
|
7
|
+
* `checkPermission` mà không cần ép kiểu.
|
|
8
|
+
*/
|
|
9
|
+
export interface MenuItem extends MenuPermissionItem {
|
|
2
10
|
id: number;
|
|
3
11
|
name: string;
|
|
4
12
|
url: string;
|
|
5
|
-
module: string;
|
|
6
|
-
controller: string;
|
|
7
|
-
action: string;
|
|
8
|
-
code: number;
|
|
9
13
|
parentId: number;
|
|
10
14
|
sortOrder: number;
|
|
11
15
|
menuIcon: string;
|
|
12
|
-
status: number;
|
|
13
16
|
vf: number;
|
|
14
|
-
isPer: boolean;
|
|
15
17
|
subs?: MenuItem[];
|
|
16
18
|
}
|
|
17
19
|
export interface SidebarProps {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../sidebar-G5Ody16K.cjs");exports.Sidebar=e.t;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../
|
|
1
|
+
import { t as e } from "../../sidebar-CVORMKBY.js";
|
|
2
2
|
export { e as Sidebar };
|
|
@@ -7,9 +7,14 @@ export declare class SingleDetail extends React.Component<PropsType, StateType>
|
|
|
7
7
|
state: StateType;
|
|
8
8
|
title: string;
|
|
9
9
|
cUri: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
private _envOverride;
|
|
11
|
+
private _cLinkOverride?;
|
|
12
|
+
get API_URL(): string;
|
|
13
|
+
set API_URL(v: string);
|
|
14
|
+
get ADMIN_URI(): string;
|
|
15
|
+
set ADMIN_URI(v: string);
|
|
16
|
+
get cLink(): string;
|
|
17
|
+
set cLink(v: string);
|
|
13
18
|
getDataUrl: string;
|
|
14
19
|
ctype: string;
|
|
15
20
|
fluid: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { PropsType, StateType } from '../../hook/fields';
|
|
3
|
+
import { CrudItem } from '../../hook/common';
|
|
3
4
|
export declare class SingleFields extends React.Component<PropsType, StateType> {
|
|
4
5
|
effectRan: boolean;
|
|
5
6
|
module: string;
|
|
@@ -8,9 +9,14 @@ export declare class SingleFields extends React.Component<PropsType, StateType>
|
|
|
8
9
|
state: StateType;
|
|
9
10
|
title: string;
|
|
10
11
|
cUri: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
private _envOverride;
|
|
13
|
+
private _cLinkOverride?;
|
|
14
|
+
get API_URL(): string;
|
|
15
|
+
set API_URL(v: string);
|
|
16
|
+
get ADMIN_URI(): string;
|
|
17
|
+
set ADMIN_URI(v: string);
|
|
18
|
+
get cLink(): string;
|
|
19
|
+
set cLink(v: string);
|
|
14
20
|
getDataUrl: string;
|
|
15
21
|
editUrl: string;
|
|
16
22
|
createUrl: string;
|
|
@@ -26,7 +32,7 @@ export declare class SingleFields extends React.Component<PropsType, StateType>
|
|
|
26
32
|
componentDidMount(): void;
|
|
27
33
|
componentDidMountAfter: () => Promise<void>;
|
|
28
34
|
handleSubmit: (e: React.SubmitEvent<HTMLFormElement>) => Promise<void>;
|
|
29
|
-
afterSubmit: (_item:
|
|
35
|
+
afterSubmit: (_item: CrudItem | false) => Promise<void>;
|
|
30
36
|
renderHeaderUpdate(): React.JSX.Element;
|
|
31
37
|
render(): React.JSX.Element;
|
|
32
38
|
}
|
|
@@ -6,9 +6,14 @@ export declare class SingleImport extends React.Component<PropsType, StateType>
|
|
|
6
6
|
state: StateType;
|
|
7
7
|
title: string;
|
|
8
8
|
cUri: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
private _envOverride;
|
|
10
|
+
private _cLinkOverride?;
|
|
11
|
+
get API_URL(): string;
|
|
12
|
+
set API_URL(v: string);
|
|
13
|
+
get ADMIN_URI(): string;
|
|
14
|
+
set ADMIN_URI(v: string);
|
|
15
|
+
get cLink(): string;
|
|
16
|
+
set cLink(v: string);
|
|
12
17
|
importUrl: string;
|
|
13
18
|
importFile: string;
|
|
14
19
|
ctype: string;
|
|
@@ -10,9 +10,14 @@ export declare class SingleIndex extends React.Component<PropsType, StateType> {
|
|
|
10
10
|
state: StateType;
|
|
11
11
|
activeMethod: string[];
|
|
12
12
|
cUri: string;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
private _envOverride;
|
|
14
|
+
private _cLinkOverride?;
|
|
15
|
+
get API_URL(): string;
|
|
16
|
+
set API_URL(v: string);
|
|
17
|
+
get ADMIN_URI(): string;
|
|
18
|
+
set ADMIN_URI(v: string);
|
|
19
|
+
get cLink(): string;
|
|
20
|
+
set cLink(v: string);
|
|
16
21
|
getDataUrl: string;
|
|
17
22
|
deleteUrl: string;
|
|
18
23
|
copyUrl: string;
|
|
@@ -29,6 +34,16 @@ export declare class SingleIndex extends React.Component<PropsType, StateType> {
|
|
|
29
34
|
handleSelectAll: (checked: boolean, skipIds?: number[]) => void;
|
|
30
35
|
setFilter(filter: any): Promise<void>;
|
|
31
36
|
fetchData: () => Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Điểm mở rộng (override point) để subclass nạp cấu hình cột theo người dùng.
|
|
39
|
+
*
|
|
40
|
+
* Mặc định trả hai object RỖNG — nghĩa là `ftfield`/`tbfield` rơi về `[]`.
|
|
41
|
+
* Đây là hành vi có chủ đích, không phải stub quên hoàn thiện: thư viện
|
|
42
|
+
* không được phụ thuộc vào service cụ thể của ứng dụng, nên consumer muốn
|
|
43
|
+
* dùng `hasField` thì override hàm này (xem `Fields.tsx`).
|
|
44
|
+
*
|
|
45
|
+
* Kiểu trả về khớp với cách đọc ở `syncPermissionsAndState`.
|
|
46
|
+
*/
|
|
32
47
|
syncGetField: () => Promise<{
|
|
33
48
|
userfield: Record<string, any>;
|
|
34
49
|
tablefield: Record<string, any>;
|