@canlooks/can-ui 0.0.54 → 0.0.55
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/dist/cjs/components/curd/curd.d.ts +2 -2
- package/dist/cjs/components/curd/curd.js +2 -2
- package/dist/cjs/components/curd/curdDialog.d.ts +1 -1
- package/dist/cjs/components/curd/curdDialog.js +10 -9
- package/dist/cjs/extensions/curd/curd.d.ts +8 -8
- package/dist/cjs/extensions/curd/curd.js +8 -8
- package/dist/esm/components/curd/curd.d.ts +2 -2
- package/dist/esm/components/curd/curd.js +2 -2
- package/dist/esm/components/curd/curdDialog.d.ts +1 -1
- package/dist/esm/components/curd/curdDialog.js +10 -9
- package/dist/esm/extensions/curd/curd.d.ts +8 -8
- package/dist/esm/extensions/curd/curd.js +6 -6
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ export type LoadRowsReturn<R extends RowType> = {
|
|
|
25
25
|
};
|
|
26
26
|
type EachRowType<R extends RowType, T> = T | ((row: R) => T);
|
|
27
27
|
export type CurdRef<R extends RowType = RowType, F extends FormValue = FormValue> = {
|
|
28
|
-
openCreateDialog(initialValue?:
|
|
28
|
+
openCreateDialog(initialValue?: F): Promise<F> | undefined;
|
|
29
29
|
selectSingle(): Promise<R> | undefined;
|
|
30
30
|
selectMultiple(selected?: Id[]): Promise<Id[]> | undefined;
|
|
31
31
|
};
|
|
@@ -88,7 +88,7 @@ export interface CurdBaseProps<R extends RowType, F extends FormValue> extends O
|
|
|
88
88
|
onUpdate?(formValue: F, row: R): any;
|
|
89
89
|
onDelete?(row: R): any;
|
|
90
90
|
/** 行数据转换为表单值的方法,若不指定,行数据会直接填入表单 */
|
|
91
|
-
|
|
91
|
+
rowToForm?(row: R): F | Promise<F>;
|
|
92
92
|
dialogProps?: CurdDialogProps<R, F>;
|
|
93
93
|
formProps?: FormProps<F>;
|
|
94
94
|
formRef?: Ref<FormRef<F>>;
|
|
@@ -23,14 +23,14 @@ const faPenToSquare_1 = require("@fortawesome/free-regular-svg-icons/faPenToSqua
|
|
|
23
23
|
const faPlus_1 = require("@fortawesome/free-solid-svg-icons/faPlus");
|
|
24
24
|
const faRotateRight_1 = require("@fortawesome/free-solid-svg-icons/faRotateRight");
|
|
25
25
|
exports.Curd = (0, react_1.memo)((props) => {
|
|
26
|
-
const { ref, wrapperProps, wrapperRef, variant = 'standard', loadRows, columns, toolbarLeft, toolbarRight, reloadable = true, onReload, resizable = true, columnConfigurable = true, filterProps, filterRef, initialFilterValue, onFilter, renderFilter, copyable, creatable = true, updatable = true, deletable = true, createButtonProps, updateButtonProps, deleteButtonProps, deleteConfirmProps, controlColumnTitle = '操作', renderExtraControl, titleKey, dataName = '', createName = '添加', updateName = '编辑', deleteName = '删除', onCreate, onUpdate, onDelete,
|
|
26
|
+
const { ref, wrapperProps, wrapperRef, variant = 'standard', loadRows, columns, toolbarLeft, toolbarRight, reloadable = true, onReload, resizable = true, columnConfigurable = true, filterProps, filterRef, initialFilterValue, onFilter, renderFilter, copyable, creatable = true, updatable = true, deletable = true, createButtonProps, updateButtonProps, deleteButtonProps, deleteConfirmProps, controlColumnTitle = '操作', renderExtraControl, titleKey, dataName = '', createName = '添加', updateName = '编辑', deleteName = '删除', onCreate, onUpdate, onDelete, rowToForm, dialogProps, formProps, formRef, onChange, ...dataGridProps } = props;
|
|
27
27
|
/**
|
|
28
28
|
* -------------------------------------------------------------
|
|
29
29
|
* ref
|
|
30
30
|
*/
|
|
31
31
|
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
32
32
|
openCreateDialog(initialValue) {
|
|
33
|
-
return curdDialogRef.current?.open(initialValue);
|
|
33
|
+
return curdDialogRef.current?.open(void 0, initialValue);
|
|
34
34
|
},
|
|
35
35
|
selectSingle() {
|
|
36
36
|
return curdDialogRef.current?.selectSingle();
|
|
@@ -5,7 +5,7 @@ import { FormValue } from '../form';
|
|
|
5
5
|
import { CurdBaseProps } from './curd';
|
|
6
6
|
import { Id } from '../../types';
|
|
7
7
|
export type CurdDialogRef<R extends RowType = RowType, F extends FormValue = FormValue> = {
|
|
8
|
-
open(activeRow?: R): Promise<F>;
|
|
8
|
+
open(activeRow?: R, initialFormValue?: F): Promise<F>;
|
|
9
9
|
selectSingle(): Promise<R>;
|
|
10
10
|
selectMultiple(selected?: Id[]): Promise<Id[]>;
|
|
11
11
|
};
|
|
@@ -14,10 +14,8 @@ const curd_style_1 = require("./curd.style");
|
|
|
14
14
|
const pickerDialog_1 = require("../pickerDialog");
|
|
15
15
|
const __1 = require("../..");
|
|
16
16
|
const faCopy_1 = require("@fortawesome/free-regular-svg-icons/faCopy");
|
|
17
|
-
exports.CurdDialog = (0, react_2.memo)(({ ref, onFinish,
|
|
18
|
-
|
|
19
|
-
curdProps, ...props }) => {
|
|
20
|
-
const { columns, postData, copyable, titleKey, formProps, formRef, dataName = '', createName = '添加', updateName = '编辑' } = curdProps;
|
|
17
|
+
exports.CurdDialog = (0, react_2.memo)(({ ref, onFinish, curdProps, ...props }) => {
|
|
18
|
+
const { columns, rowToForm, copyable, titleKey, formProps, formRef, dataName = '', createName = '添加', updateName = '编辑' } = curdProps;
|
|
21
19
|
/**
|
|
22
20
|
* ----------------------------------------------------------------
|
|
23
21
|
* ref与promise部分
|
|
@@ -39,10 +37,12 @@ curdProps, ...props }) => {
|
|
|
39
37
|
const [selectMode, setSelectMode] = (0, react_2.useState)('single');
|
|
40
38
|
const selectResolvers = (0, react_2.useRef)(void 0);
|
|
41
39
|
(0, react_2.useImperativeHandle)(ref, () => ({
|
|
42
|
-
open(row) {
|
|
40
|
+
open(row, initialFormValue) {
|
|
43
41
|
innerFormRef.current?.resetForm();
|
|
44
|
-
|
|
42
|
+
suppressTransform.current = !!initialFormValue;
|
|
43
|
+
initialFormValue && innerFormRef.current?.setFormValue(initialFormValue);
|
|
45
44
|
setActiveRow(row);
|
|
45
|
+
setInnerOpen(true);
|
|
46
46
|
const { promise } = openResolvers.current = Promise.withResolvers();
|
|
47
47
|
return promise;
|
|
48
48
|
},
|
|
@@ -64,13 +64,14 @@ curdProps, ...props }) => {
|
|
|
64
64
|
* 表单项
|
|
65
65
|
*/
|
|
66
66
|
const [activeRow, setActiveRow] = (0, react_2.useState)();
|
|
67
|
+
const suppressTransform = (0, react_2.useRef)(false);
|
|
67
68
|
const [transforming, setFormValue] = (0, utils_1.useLoading)(async (row) => {
|
|
68
|
-
const formValue =
|
|
69
|
+
const formValue = rowToForm && row ? await rowToForm(row) : row;
|
|
69
70
|
formValue && innerFormRef.current?.setFormValue(formValue);
|
|
70
71
|
});
|
|
71
72
|
(0, react_2.useEffect)(() => {
|
|
72
|
-
innerOpen.current && setFormValue(activeRow);
|
|
73
|
-
}, [innerOpen.current]);
|
|
73
|
+
innerOpen.current && !suppressTransform.current && setFormValue(activeRow);
|
|
74
|
+
}, [innerOpen.current, activeRow]);
|
|
74
75
|
const renderedFormItems = (0, react_2.useMemo)(() => {
|
|
75
76
|
return (0, utils_1.columnsToFormItem)(columns, activeRow)?.map(col => {
|
|
76
77
|
if ((0, react_2.isValidElement)(col)) {
|
|
@@ -10,24 +10,24 @@ import { Id } from '../../types';
|
|
|
10
10
|
export declare function CURD<R extends RowType, F extends FormValue = FormValue>(props?: CurdBaseProps<R, F>): <T extends ComponentClass>(target: T) => T;
|
|
11
11
|
export declare namespace CURD {
|
|
12
12
|
var Column: typeof import("./curd").Column;
|
|
13
|
-
var
|
|
13
|
+
var LoadRows: typeof import("./curd").LoadRows;
|
|
14
14
|
var OnReload: typeof import("./curd").OnReload;
|
|
15
15
|
var OnFilter: typeof import("./curd").OnFilter;
|
|
16
16
|
var OnCreate: typeof import("./curd").OnCreate;
|
|
17
17
|
var OnUpdate: typeof import("./curd").OnUpdate;
|
|
18
18
|
var OnDelete: typeof import("./curd").OnDelete;
|
|
19
|
-
var
|
|
19
|
+
var RowToForm: typeof import("./curd").RowToForm;
|
|
20
20
|
}
|
|
21
21
|
export declare function DATA_GRID<R extends RowType, V extends Id = Id>(props?: DataGridProps<R, V>): <T extends ComponentClass>(target: T) => T;
|
|
22
22
|
export declare namespace DATA_GRID {
|
|
23
23
|
var Column: typeof import("./curd").Column;
|
|
24
|
-
var
|
|
24
|
+
var LoadRows: typeof import("./curd").LoadRows;
|
|
25
25
|
var OnReload: typeof import("./curd").OnReload;
|
|
26
26
|
var OnFilter: typeof import("./curd").OnFilter;
|
|
27
27
|
var OnCreate: typeof import("./curd").OnCreate;
|
|
28
28
|
var OnUpdate: typeof import("./curd").OnUpdate;
|
|
29
29
|
var OnDelete: typeof import("./curd").OnDelete;
|
|
30
|
-
var
|
|
30
|
+
var RowToForm: typeof import("./curd").RowToForm;
|
|
31
31
|
}
|
|
32
32
|
type ColumnDecorator = (prototype: Object, property: string, descriptor?: TypedPropertyDescriptor<any>) => void;
|
|
33
33
|
export declare function Column(title: ReactNode): ColumnDecorator;
|
|
@@ -51,8 +51,8 @@ export declare function Form(prototype: Object, property: string, descriptor?: T
|
|
|
51
51
|
* 方法修饰器
|
|
52
52
|
*/
|
|
53
53
|
type MethodDecorator = (prototype: Object, property: string, descriptor: TypedPropertyDescriptor<any>) => void;
|
|
54
|
-
export declare function
|
|
55
|
-
export declare function
|
|
54
|
+
export declare function LoadRows(): MethodDecorator;
|
|
55
|
+
export declare function LoadRows(prototype: Object, property: string, descriptor: TypedPropertyDescriptor<any>): void;
|
|
56
56
|
export declare function OnReload(): MethodDecorator;
|
|
57
57
|
export declare function OnReload(prototype: Object, property: string, descriptor: TypedPropertyDescriptor<any>): void;
|
|
58
58
|
export declare function OnFilter(): MethodDecorator;
|
|
@@ -63,6 +63,6 @@ export declare function OnUpdate(): MethodDecorator;
|
|
|
63
63
|
export declare function OnUpdate(prototype: Object, property: string, descriptor: TypedPropertyDescriptor<any>): void;
|
|
64
64
|
export declare function OnDelete(): MethodDecorator;
|
|
65
65
|
export declare function OnDelete(prototype: Object, property: string, descriptor: TypedPropertyDescriptor<any>): void;
|
|
66
|
-
export declare function
|
|
67
|
-
export declare function
|
|
66
|
+
export declare function RowToForm(): MethodDecorator;
|
|
67
|
+
export declare function RowToForm(prototype: Object, property: string, descriptor: TypedPropertyDescriptor<any>): void;
|
|
68
68
|
export {};
|
|
@@ -7,13 +7,13 @@ exports.Hide = Hide;
|
|
|
7
7
|
exports.Sort = Sort;
|
|
8
8
|
exports.Filter = Filter;
|
|
9
9
|
exports.Form = Form;
|
|
10
|
-
exports.
|
|
10
|
+
exports.LoadRows = LoadRows;
|
|
11
11
|
exports.OnReload = OnReload;
|
|
12
12
|
exports.OnFilter = OnFilter;
|
|
13
13
|
exports.OnCreate = OnCreate;
|
|
14
14
|
exports.OnUpdate = OnUpdate;
|
|
15
15
|
exports.OnDelete = OnDelete;
|
|
16
|
-
exports.
|
|
16
|
+
exports.RowToForm = RowToForm;
|
|
17
17
|
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
18
18
|
const curd_1 = require("../../components/curd");
|
|
19
19
|
const dataGrid_1 = require("../../components/dataGrid");
|
|
@@ -119,8 +119,8 @@ function setColumnConfigValue(key, value = true) {
|
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
const prototype_methods = new WeakMap();
|
|
122
|
-
CURD.
|
|
123
|
-
function
|
|
122
|
+
CURD.LoadRows = DATA_GRID.LoadRows = LoadRows;
|
|
123
|
+
function LoadRows(a, b, c) {
|
|
124
124
|
return typeof c === 'undefined'
|
|
125
125
|
? setMethods('loadRows')
|
|
126
126
|
: setMethods('loadRows')(a, b, c);
|
|
@@ -155,11 +155,11 @@ function OnDelete(a, b, c) {
|
|
|
155
155
|
? setMethods('onDelete')
|
|
156
156
|
: setMethods('onDelete')(a, b, c);
|
|
157
157
|
}
|
|
158
|
-
CURD.
|
|
159
|
-
function
|
|
158
|
+
CURD.RowToForm = DATA_GRID.RowToForm = RowToForm;
|
|
159
|
+
function RowToForm(a, b, c) {
|
|
160
160
|
return typeof c === 'undefined'
|
|
161
|
-
? setMethods('
|
|
162
|
-
: setMethods('
|
|
161
|
+
? setMethods('rowToForm')
|
|
162
|
+
: setMethods('rowToForm')(a, b, c);
|
|
163
163
|
}
|
|
164
164
|
/**
|
|
165
165
|
* 通用设置prototype_methods的方法
|
|
@@ -25,7 +25,7 @@ export type LoadRowsReturn<R extends RowType> = {
|
|
|
25
25
|
};
|
|
26
26
|
type EachRowType<R extends RowType, T> = T | ((row: R) => T);
|
|
27
27
|
export type CurdRef<R extends RowType = RowType, F extends FormValue = FormValue> = {
|
|
28
|
-
openCreateDialog(initialValue?:
|
|
28
|
+
openCreateDialog(initialValue?: F): Promise<F> | undefined;
|
|
29
29
|
selectSingle(): Promise<R> | undefined;
|
|
30
30
|
selectMultiple(selected?: Id[]): Promise<Id[]> | undefined;
|
|
31
31
|
};
|
|
@@ -88,7 +88,7 @@ export interface CurdBaseProps<R extends RowType, F extends FormValue> extends O
|
|
|
88
88
|
onUpdate?(formValue: F, row: R): any;
|
|
89
89
|
onDelete?(row: R): any;
|
|
90
90
|
/** 行数据转换为表单值的方法,若不指定,行数据会直接填入表单 */
|
|
91
|
-
|
|
91
|
+
rowToForm?(row: R): F | Promise<F>;
|
|
92
92
|
dialogProps?: CurdDialogProps<R, F>;
|
|
93
93
|
formProps?: FormProps<F>;
|
|
94
94
|
formRef?: Ref<FormRef<F>>;
|
|
@@ -20,14 +20,14 @@ import { faPenToSquare } from '@fortawesome/free-regular-svg-icons/faPenToSquare
|
|
|
20
20
|
import { faPlus } from '@fortawesome/free-solid-svg-icons/faPlus';
|
|
21
21
|
import { faRotateRight } from '@fortawesome/free-solid-svg-icons/faRotateRight';
|
|
22
22
|
export const Curd = memo((props) => {
|
|
23
|
-
const { ref, wrapperProps, wrapperRef, variant = 'standard', loadRows, columns, toolbarLeft, toolbarRight, reloadable = true, onReload, resizable = true, columnConfigurable = true, filterProps, filterRef, initialFilterValue, onFilter, renderFilter, copyable, creatable = true, updatable = true, deletable = true, createButtonProps, updateButtonProps, deleteButtonProps, deleteConfirmProps, controlColumnTitle = '操作', renderExtraControl, titleKey, dataName = '', createName = '添加', updateName = '编辑', deleteName = '删除', onCreate, onUpdate, onDelete,
|
|
23
|
+
const { ref, wrapperProps, wrapperRef, variant = 'standard', loadRows, columns, toolbarLeft, toolbarRight, reloadable = true, onReload, resizable = true, columnConfigurable = true, filterProps, filterRef, initialFilterValue, onFilter, renderFilter, copyable, creatable = true, updatable = true, deletable = true, createButtonProps, updateButtonProps, deleteButtonProps, deleteConfirmProps, controlColumnTitle = '操作', renderExtraControl, titleKey, dataName = '', createName = '添加', updateName = '编辑', deleteName = '删除', onCreate, onUpdate, onDelete, rowToForm, dialogProps, formProps, formRef, onChange, ...dataGridProps } = props;
|
|
24
24
|
/**
|
|
25
25
|
* -------------------------------------------------------------
|
|
26
26
|
* ref
|
|
27
27
|
*/
|
|
28
28
|
useImperativeHandle(ref, () => ({
|
|
29
29
|
openCreateDialog(initialValue) {
|
|
30
|
-
return curdDialogRef.current?.open(initialValue);
|
|
30
|
+
return curdDialogRef.current?.open(void 0, initialValue);
|
|
31
31
|
},
|
|
32
32
|
selectSingle() {
|
|
33
33
|
return curdDialogRef.current?.selectSingle();
|
|
@@ -5,7 +5,7 @@ import { FormValue } from '../form';
|
|
|
5
5
|
import { CurdBaseProps } from './curd';
|
|
6
6
|
import { Id } from '../../types';
|
|
7
7
|
export type CurdDialogRef<R extends RowType = RowType, F extends FormValue = FormValue> = {
|
|
8
|
-
open(activeRow?: R): Promise<F>;
|
|
8
|
+
open(activeRow?: R, initialFormValue?: F): Promise<F>;
|
|
9
9
|
selectSingle(): Promise<R>;
|
|
10
10
|
selectMultiple(selected?: Id[]): Promise<Id[]>;
|
|
11
11
|
};
|
|
@@ -11,10 +11,8 @@ import { classes, dialogStyle } from './curd.style';
|
|
|
11
11
|
import { PickerDialog } from '../pickerDialog';
|
|
12
12
|
import { Icon } from '../..';
|
|
13
13
|
import { faCopy } from '@fortawesome/free-regular-svg-icons/faCopy';
|
|
14
|
-
export const CurdDialog = memo(({ ref, onFinish,
|
|
15
|
-
|
|
16
|
-
curdProps, ...props }) => {
|
|
17
|
-
const { columns, postData, copyable, titleKey, formProps, formRef, dataName = '', createName = '添加', updateName = '编辑' } = curdProps;
|
|
14
|
+
export const CurdDialog = memo(({ ref, onFinish, curdProps, ...props }) => {
|
|
15
|
+
const { columns, rowToForm, copyable, titleKey, formProps, formRef, dataName = '', createName = '添加', updateName = '编辑' } = curdProps;
|
|
18
16
|
/**
|
|
19
17
|
* ----------------------------------------------------------------
|
|
20
18
|
* ref与promise部分
|
|
@@ -36,10 +34,12 @@ curdProps, ...props }) => {
|
|
|
36
34
|
const [selectMode, setSelectMode] = useState('single');
|
|
37
35
|
const selectResolvers = useRef(void 0);
|
|
38
36
|
useImperativeHandle(ref, () => ({
|
|
39
|
-
open(row) {
|
|
37
|
+
open(row, initialFormValue) {
|
|
40
38
|
innerFormRef.current?.resetForm();
|
|
41
|
-
|
|
39
|
+
suppressTransform.current = !!initialFormValue;
|
|
40
|
+
initialFormValue && innerFormRef.current?.setFormValue(initialFormValue);
|
|
42
41
|
setActiveRow(row);
|
|
42
|
+
setInnerOpen(true);
|
|
43
43
|
const { promise } = openResolvers.current = Promise.withResolvers();
|
|
44
44
|
return promise;
|
|
45
45
|
},
|
|
@@ -61,13 +61,14 @@ curdProps, ...props }) => {
|
|
|
61
61
|
* 表单项
|
|
62
62
|
*/
|
|
63
63
|
const [activeRow, setActiveRow] = useState();
|
|
64
|
+
const suppressTransform = useRef(false);
|
|
64
65
|
const [transforming, setFormValue] = useLoading(async (row) => {
|
|
65
|
-
const formValue =
|
|
66
|
+
const formValue = rowToForm && row ? await rowToForm(row) : row;
|
|
66
67
|
formValue && innerFormRef.current?.setFormValue(formValue);
|
|
67
68
|
});
|
|
68
69
|
useEffect(() => {
|
|
69
|
-
innerOpen.current && setFormValue(activeRow);
|
|
70
|
-
}, [innerOpen.current]);
|
|
70
|
+
innerOpen.current && !suppressTransform.current && setFormValue(activeRow);
|
|
71
|
+
}, [innerOpen.current, activeRow]);
|
|
71
72
|
const renderedFormItems = useMemo(() => {
|
|
72
73
|
return columnsToFormItem(columns, activeRow)?.map(col => {
|
|
73
74
|
if (isValidElement(col)) {
|
|
@@ -10,24 +10,24 @@ import { Id } from '../../types';
|
|
|
10
10
|
export declare function CURD<R extends RowType, F extends FormValue = FormValue>(props?: CurdBaseProps<R, F>): <T extends ComponentClass>(target: T) => T;
|
|
11
11
|
export declare namespace CURD {
|
|
12
12
|
var Column: typeof import("./curd").Column;
|
|
13
|
-
var
|
|
13
|
+
var LoadRows: typeof import("./curd").LoadRows;
|
|
14
14
|
var OnReload: typeof import("./curd").OnReload;
|
|
15
15
|
var OnFilter: typeof import("./curd").OnFilter;
|
|
16
16
|
var OnCreate: typeof import("./curd").OnCreate;
|
|
17
17
|
var OnUpdate: typeof import("./curd").OnUpdate;
|
|
18
18
|
var OnDelete: typeof import("./curd").OnDelete;
|
|
19
|
-
var
|
|
19
|
+
var RowToForm: typeof import("./curd").RowToForm;
|
|
20
20
|
}
|
|
21
21
|
export declare function DATA_GRID<R extends RowType, V extends Id = Id>(props?: DataGridProps<R, V>): <T extends ComponentClass>(target: T) => T;
|
|
22
22
|
export declare namespace DATA_GRID {
|
|
23
23
|
var Column: typeof import("./curd").Column;
|
|
24
|
-
var
|
|
24
|
+
var LoadRows: typeof import("./curd").LoadRows;
|
|
25
25
|
var OnReload: typeof import("./curd").OnReload;
|
|
26
26
|
var OnFilter: typeof import("./curd").OnFilter;
|
|
27
27
|
var OnCreate: typeof import("./curd").OnCreate;
|
|
28
28
|
var OnUpdate: typeof import("./curd").OnUpdate;
|
|
29
29
|
var OnDelete: typeof import("./curd").OnDelete;
|
|
30
|
-
var
|
|
30
|
+
var RowToForm: typeof import("./curd").RowToForm;
|
|
31
31
|
}
|
|
32
32
|
type ColumnDecorator = (prototype: Object, property: string, descriptor?: TypedPropertyDescriptor<any>) => void;
|
|
33
33
|
export declare function Column(title: ReactNode): ColumnDecorator;
|
|
@@ -51,8 +51,8 @@ export declare function Form(prototype: Object, property: string, descriptor?: T
|
|
|
51
51
|
* 方法修饰器
|
|
52
52
|
*/
|
|
53
53
|
type MethodDecorator = (prototype: Object, property: string, descriptor: TypedPropertyDescriptor<any>) => void;
|
|
54
|
-
export declare function
|
|
55
|
-
export declare function
|
|
54
|
+
export declare function LoadRows(): MethodDecorator;
|
|
55
|
+
export declare function LoadRows(prototype: Object, property: string, descriptor: TypedPropertyDescriptor<any>): void;
|
|
56
56
|
export declare function OnReload(): MethodDecorator;
|
|
57
57
|
export declare function OnReload(prototype: Object, property: string, descriptor: TypedPropertyDescriptor<any>): void;
|
|
58
58
|
export declare function OnFilter(): MethodDecorator;
|
|
@@ -63,6 +63,6 @@ export declare function OnUpdate(): MethodDecorator;
|
|
|
63
63
|
export declare function OnUpdate(prototype: Object, property: string, descriptor: TypedPropertyDescriptor<any>): void;
|
|
64
64
|
export declare function OnDelete(): MethodDecorator;
|
|
65
65
|
export declare function OnDelete(prototype: Object, property: string, descriptor: TypedPropertyDescriptor<any>): void;
|
|
66
|
-
export declare function
|
|
67
|
-
export declare function
|
|
66
|
+
export declare function RowToForm(): MethodDecorator;
|
|
67
|
+
export declare function RowToForm(prototype: Object, property: string, descriptor: TypedPropertyDescriptor<any>): void;
|
|
68
68
|
export {};
|
|
@@ -103,8 +103,8 @@ function setColumnConfigValue(key, value = true) {
|
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
const prototype_methods = new WeakMap();
|
|
106
|
-
CURD.
|
|
107
|
-
export function
|
|
106
|
+
CURD.LoadRows = DATA_GRID.LoadRows = LoadRows;
|
|
107
|
+
export function LoadRows(a, b, c) {
|
|
108
108
|
return typeof c === 'undefined'
|
|
109
109
|
? setMethods('loadRows')
|
|
110
110
|
: setMethods('loadRows')(a, b, c);
|
|
@@ -139,11 +139,11 @@ export function OnDelete(a, b, c) {
|
|
|
139
139
|
? setMethods('onDelete')
|
|
140
140
|
: setMethods('onDelete')(a, b, c);
|
|
141
141
|
}
|
|
142
|
-
CURD.
|
|
143
|
-
export function
|
|
142
|
+
CURD.RowToForm = DATA_GRID.RowToForm = RowToForm;
|
|
143
|
+
export function RowToForm(a, b, c) {
|
|
144
144
|
return typeof c === 'undefined'
|
|
145
|
-
? setMethods('
|
|
146
|
-
: setMethods('
|
|
145
|
+
? setMethods('rowToForm')
|
|
146
|
+
: setMethods('rowToForm')(a, b, c);
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
149
|
* 通用设置prototype_methods的方法
|