orion-design 0.1.53 → 0.1.55
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Button/index.js +1 -1
- package/dist/components/Flex/Col.d.ts +5 -16
- package/dist/components/Flex/Item.d.ts +1 -15
- package/dist/components/Flex/Row.d.ts +5 -16
- package/dist/components/Flex/index.js +44 -51
- package/dist/components/Flex/index.js.map +1 -1
- package/dist/components/Form/FileInput/FileInput.vue.d.ts +4 -4
- package/dist/components/Form/Form.vue.d.ts +2 -2
- package/dist/components/Form/LovInput/LovInput.vue.d.ts +8 -8
- package/dist/components/Form/TableSelect/TableSelect.vue.d.ts +8 -8
- package/dist/components/Form/index.d.ts +1 -1
- package/dist/components/Form/index.js +1 -1
- package/dist/components/LovTable/LovPagetable.vue.d.ts +144 -504
- package/dist/components/LovTable/LovQuerytable.vue.d.ts +84 -356
- package/dist/components/LovTable/index.d.ts +114 -430
- package/dist/components/Pagetable/Pagetable.d.ts +43 -153
- package/dist/components/Pagetable/columns/PagetableCellButton.d.ts +5 -16
- package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +23 -96
- package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +28 -120
- package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +20 -83
- package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +23 -95
- package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +33 -127
- package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +29 -100
- package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +33 -127
- package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +22 -94
- package/dist/components/Pagetable/columns/PagetableColumngroup.d.ts +8 -29
- package/dist/components/Pagetable/hooks/useColumns.js +2 -2
- package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
- package/dist/components/Pagetable/hooks/usePagetable.d.ts +13 -8
- package/dist/components/Pagetable/hooks/usePagetable.js +52 -40
- package/dist/components/Pagetable/hooks/usePagetable.js.map +1 -1
- package/dist/components/Pagetable/index.d.ts +72 -216
- package/dist/components/Pagetable/index.js +526 -497
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Querytable/Querytable.d.ts +18 -78
- package/dist/components/Querytable/columns/QuerytableCellButton.d.ts +5 -16
- package/dist/components/Querytable/columns/QuerytableColumnButtongroup.d.ts +20 -83
- package/dist/components/Querytable/columns/QuerytableColumnDate.d.ts +26 -108
- package/dist/components/Querytable/columns/QuerytableColumnDiy.d.ts +17 -70
- package/dist/components/Querytable/columns/QuerytableColumnLink.d.ts +19 -81
- package/dist/components/Querytable/columns/QuerytableColumnMultiselect.d.ts +29 -113
- package/dist/components/Querytable/columns/QuerytableColumnNumber.d.ts +26 -87
- package/dist/components/Querytable/columns/QuerytableColumnSingleselect.d.ts +30 -114
- package/dist/components/Querytable/columns/QuerytableColumnString.d.ts +20 -82
- package/dist/components/Querytable/columns/QuerytableColumngroup.d.ts +8 -29
- package/dist/components/Querytable/hooks/useColumns.js +2 -2
- package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
- package/dist/components/Querytable/index.d.ts +49 -157
- package/dist/components/Querytable/index.js +384 -367
- package/dist/components/Querytable/index.js.map +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +22 -48
- package/dist/components/RichTextEditor/index.d.ts +15 -34
- package/dist/components/RichTextEditor/index.js +31 -26
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/Space/index.d.ts +11 -62
- package/dist/components/TableSelectPagetable/TableSelectPagetable.vue.d.ts +144 -504
- package/dist/components/TableSelectPagetable/index.d.ts +72 -252
- package/dist/components/Throne/ThroneContextProvider.d.ts +5 -16
- package/dist/components/_antd_util/camelize.d.ts +2 -0
- package/dist/components/_antd_util/camelize.js +8 -0
- package/dist/components/_antd_util/camelize.js.map +1 -0
- package/dist/components/_antd_util/classNames.js +24 -0
- package/dist/components/_antd_util/classNames.js.map +1 -0
- package/dist/components/_antd_util/index.d.ts +1 -0
- package/dist/components/_antd_util/index.js +14 -0
- package/dist/components/_antd_util/index.js.map +1 -0
- package/dist/components/_antd_util/isValid.js.map +1 -0
- package/dist/components/components.js +2 -2
- package/dist/components/index.js +3 -3
- package/dist/components-BZKLgLQx.js +54 -0
- package/dist/components-BZKLgLQx.js.map +1 -0
- package/dist/index-CvcZkdiG.js +46 -0
- package/dist/index-CvcZkdiG.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +1 -1
- package/dist/version/version.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/Pagetable/interface.d.ts +0 -11
- package/dist/components/Pagetable/interface.js +0 -2
- package/dist/components/Pagetable/interface.js.map +0 -1
- package/dist/components/Querytable/interface.d.ts +0 -10
- package/dist/components/Querytable/interface.js +0 -2
- package/dist/components/Querytable/interface.js.map +0 -1
- package/dist/components/_util/classNames.js +0 -24
- package/dist/components/_util/classNames.js.map +0 -1
- package/dist/components/_util/isValid.js.map +0 -1
- package/dist/components/_util/props-util/index.d.ts +0 -6
- package/dist/components/_util/props-util/index.js +0 -26
- package/dist/components/_util/props-util/index.js.map +0 -1
- package/dist/components/_util/props-util/initDefaultProps.d.ts +0 -6
- package/dist/components/_util/props-util/initDefaultProps.js +0 -14
- package/dist/components/_util/props-util/initDefaultProps.js.map +0 -1
- package/dist/components/_util/type.d.ts +0 -66
- package/dist/components/_util/type.js +0 -53
- package/dist/components/_util/type.js.map +0 -1
- package/dist/components/_util/util.d.ts +0 -18
- package/dist/components/_util/util.js +0 -55
- package/dist/components/_util/util.js.map +0 -1
- package/dist/components/_util/vue-types/index.d.ts +0 -12
- package/dist/components/_util/vue-types/index.js +0 -331
- package/dist/components/_util/vue-types/index.js.map +0 -1
- package/dist/components-BvgQJQRM.js +0 -55
- package/dist/components-BvgQJQRM.js.map +0 -1
- package/dist/index-BbsXWo7C.js +0 -44
- package/dist/index-BbsXWo7C.js.map +0 -1
- /package/dist/components/{_util → _antd_util}/classNames.d.ts +0 -0
- /package/dist/components/{_util → _antd_util}/isValid.d.ts +0 -0
- /package/dist/components/{_util → _antd_util}/isValid.js +0 -0
@@ -1,135 +1,41 @@
|
|
1
|
-
import {
|
2
|
-
import { FixedType } from '../interface';
|
1
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
3
2
|
export declare const pagetableColumnSingleselectProps: () => {
|
4
|
-
head:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
};
|
16
|
-
name: {
|
17
|
-
type: PropType<string>;
|
18
|
-
default: string;
|
19
|
-
};
|
20
|
-
width: {
|
21
|
-
type: PropType<string | boolean>;
|
22
|
-
default: string | boolean;
|
23
|
-
};
|
24
|
-
fixed: {
|
25
|
-
type: PropType<FixedType>;
|
26
|
-
default: FixedType;
|
27
|
-
};
|
28
|
-
tail: {
|
29
|
-
type: PropType<string | boolean>;
|
30
|
-
default: string | boolean;
|
31
|
-
};
|
32
|
-
code: {
|
33
|
-
type: PropType<string | {
|
34
|
-
value: string;
|
35
|
-
content: string;
|
36
|
-
}[]>;
|
37
|
-
default: string | {
|
38
|
-
value: string;
|
39
|
-
content: string;
|
40
|
-
}[];
|
41
|
-
};
|
3
|
+
head: StringConstructor;
|
4
|
+
headAlign: PropType<"left" | "right" | "center">;
|
5
|
+
bodyAlign: PropType<"left" | "right" | "center">;
|
6
|
+
name: StringConstructor;
|
7
|
+
width: (NumberConstructor | StringConstructor)[];
|
8
|
+
fixed: (StringConstructor | BooleanConstructor)[];
|
9
|
+
tail: (StringConstructor | BooleanConstructor)[];
|
10
|
+
code: PropType<string | {
|
11
|
+
value: string;
|
12
|
+
content: string;
|
13
|
+
}[]>;
|
42
14
|
};
|
43
15
|
export type PagetableColumnSingleselectProps = Partial<ExtractPropTypes<ReturnType<typeof pagetableColumnSingleselectProps>>>;
|
44
16
|
declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
|
45
|
-
head:
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
};
|
57
|
-
name: {
|
58
|
-
type: PropType<string>;
|
59
|
-
default: string;
|
60
|
-
};
|
61
|
-
width: {
|
62
|
-
type: PropType<string | boolean>;
|
63
|
-
default: string | boolean;
|
64
|
-
};
|
65
|
-
fixed: {
|
66
|
-
type: PropType<FixedType>;
|
67
|
-
default: FixedType;
|
68
|
-
};
|
69
|
-
tail: {
|
70
|
-
type: PropType<string | boolean>;
|
71
|
-
default: string | boolean;
|
72
|
-
};
|
73
|
-
code: {
|
74
|
-
type: PropType<string | {
|
75
|
-
value: string;
|
76
|
-
content: string;
|
77
|
-
}[]>;
|
78
|
-
default: string | {
|
79
|
-
value: string;
|
80
|
-
content: string;
|
81
|
-
}[];
|
82
|
-
};
|
17
|
+
head: StringConstructor;
|
18
|
+
headAlign: PropType<"left" | "right" | "center">;
|
19
|
+
bodyAlign: PropType<"left" | "right" | "center">;
|
20
|
+
name: StringConstructor;
|
21
|
+
width: (NumberConstructor | StringConstructor)[];
|
22
|
+
fixed: (StringConstructor | BooleanConstructor)[];
|
23
|
+
tail: (StringConstructor | BooleanConstructor)[];
|
24
|
+
code: PropType<string | {
|
25
|
+
value: string;
|
26
|
+
content: string;
|
27
|
+
}[]>;
|
83
28
|
}>, () => null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ExtractPropTypes<{
|
84
|
-
head:
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
bodyAlign: {
|
93
|
-
type: PropType<"center" | "left" | "right">;
|
94
|
-
default: "center" | "left" | "right";
|
95
|
-
};
|
96
|
-
name: {
|
97
|
-
type: PropType<string>;
|
98
|
-
default: string;
|
99
|
-
};
|
100
|
-
width: {
|
101
|
-
type: PropType<string | boolean>;
|
102
|
-
default: string | boolean;
|
103
|
-
};
|
104
|
-
fixed: {
|
105
|
-
type: PropType<FixedType>;
|
106
|
-
default: FixedType;
|
107
|
-
};
|
108
|
-
tail: {
|
109
|
-
type: PropType<string | boolean>;
|
110
|
-
default: string | boolean;
|
111
|
-
};
|
112
|
-
code: {
|
113
|
-
type: PropType<string | {
|
114
|
-
value: string;
|
115
|
-
content: string;
|
116
|
-
}[]>;
|
117
|
-
default: string | {
|
118
|
-
value: string;
|
119
|
-
content: string;
|
120
|
-
}[];
|
121
|
-
};
|
122
|
-
}>> & Readonly<{}>, {
|
123
|
-
name: string;
|
124
|
-
fixed: FixedType;
|
125
|
-
code: string | {
|
29
|
+
head: StringConstructor;
|
30
|
+
headAlign: PropType<"left" | "right" | "center">;
|
31
|
+
bodyAlign: PropType<"left" | "right" | "center">;
|
32
|
+
name: StringConstructor;
|
33
|
+
width: (NumberConstructor | StringConstructor)[];
|
34
|
+
fixed: (StringConstructor | BooleanConstructor)[];
|
35
|
+
tail: (StringConstructor | BooleanConstructor)[];
|
36
|
+
code: PropType<string | {
|
126
37
|
value: string;
|
127
38
|
content: string;
|
128
|
-
}[]
|
129
|
-
|
130
|
-
width: string | boolean;
|
131
|
-
bodyAlign: "center" | "left" | "right";
|
132
|
-
tail: string | boolean;
|
133
|
-
headAlign: "center" | "left" | "right";
|
134
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
39
|
+
}[]>;
|
40
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
135
41
|
export default _default;
|
@@ -1,101 +1,29 @@
|
|
1
1
|
import { PropType, ExtractPropTypes } from 'vue';
|
2
|
-
import { FixedType } from '../interface';
|
3
2
|
export declare const pagetableColumnStringProps: () => {
|
4
|
-
head:
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
};
|
12
|
-
bodyAlign: {
|
13
|
-
type: PropType<"center" | "left" | "right">;
|
14
|
-
default: "center" | "left" | "right";
|
15
|
-
};
|
16
|
-
name: {
|
17
|
-
type: PropType<string>;
|
18
|
-
default: string;
|
19
|
-
};
|
20
|
-
width: {
|
21
|
-
type: PropType<string | boolean>;
|
22
|
-
default: string | boolean;
|
23
|
-
};
|
24
|
-
fixed: {
|
25
|
-
type: PropType<FixedType>;
|
26
|
-
default: FixedType;
|
27
|
-
};
|
28
|
-
tail: {
|
29
|
-
type: PropType<string | boolean>;
|
30
|
-
default: string | boolean;
|
31
|
-
};
|
3
|
+
head: StringConstructor;
|
4
|
+
headAlign: PropType<"left" | "right" | "center">;
|
5
|
+
bodyAlign: PropType<"left" | "right" | "center">;
|
6
|
+
name: StringConstructor;
|
7
|
+
width: (NumberConstructor | StringConstructor)[];
|
8
|
+
fixed: (StringConstructor | BooleanConstructor)[];
|
9
|
+
tail: (StringConstructor | BooleanConstructor)[];
|
32
10
|
};
|
33
11
|
export type PagetableColumnStringProps = Partial<ExtractPropTypes<ReturnType<typeof pagetableColumnStringProps>>>;
|
34
12
|
declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
|
35
|
-
head:
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
};
|
43
|
-
bodyAlign: {
|
44
|
-
type: PropType<"center" | "left" | "right">;
|
45
|
-
default: "center" | "left" | "right";
|
46
|
-
};
|
47
|
-
name: {
|
48
|
-
type: PropType<string>;
|
49
|
-
default: string;
|
50
|
-
};
|
51
|
-
width: {
|
52
|
-
type: PropType<string | boolean>;
|
53
|
-
default: string | boolean;
|
54
|
-
};
|
55
|
-
fixed: {
|
56
|
-
type: PropType<FixedType>;
|
57
|
-
default: FixedType;
|
58
|
-
};
|
59
|
-
tail: {
|
60
|
-
type: PropType<string | boolean>;
|
61
|
-
default: string | boolean;
|
62
|
-
};
|
13
|
+
head: StringConstructor;
|
14
|
+
headAlign: PropType<"left" | "right" | "center">;
|
15
|
+
bodyAlign: PropType<"left" | "right" | "center">;
|
16
|
+
name: StringConstructor;
|
17
|
+
width: (NumberConstructor | StringConstructor)[];
|
18
|
+
fixed: (StringConstructor | BooleanConstructor)[];
|
19
|
+
tail: (StringConstructor | BooleanConstructor)[];
|
63
20
|
}>, () => null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ExtractPropTypes<{
|
64
|
-
head:
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
bodyAlign: {
|
73
|
-
type: PropType<"center" | "left" | "right">;
|
74
|
-
default: "center" | "left" | "right";
|
75
|
-
};
|
76
|
-
name: {
|
77
|
-
type: PropType<string>;
|
78
|
-
default: string;
|
79
|
-
};
|
80
|
-
width: {
|
81
|
-
type: PropType<string | boolean>;
|
82
|
-
default: string | boolean;
|
83
|
-
};
|
84
|
-
fixed: {
|
85
|
-
type: PropType<FixedType>;
|
86
|
-
default: FixedType;
|
87
|
-
};
|
88
|
-
tail: {
|
89
|
-
type: PropType<string | boolean>;
|
90
|
-
default: string | boolean;
|
91
|
-
};
|
92
|
-
}>> & Readonly<{}>, {
|
93
|
-
name: string;
|
94
|
-
fixed: FixedType;
|
95
|
-
head: string;
|
96
|
-
width: string | boolean;
|
97
|
-
bodyAlign: "center" | "left" | "right";
|
98
|
-
tail: string | boolean;
|
99
|
-
headAlign: "center" | "left" | "right";
|
100
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
21
|
+
head: StringConstructor;
|
22
|
+
headAlign: PropType<"left" | "right" | "center">;
|
23
|
+
bodyAlign: PropType<"left" | "right" | "center">;
|
24
|
+
name: StringConstructor;
|
25
|
+
width: (NumberConstructor | StringConstructor)[];
|
26
|
+
fixed: (StringConstructor | BooleanConstructor)[];
|
27
|
+
tail: (StringConstructor | BooleanConstructor)[];
|
28
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
101
29
|
export default _default;
|
@@ -1,35 +1,14 @@
|
|
1
|
-
import {
|
1
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
2
2
|
export declare const pagetableColumngroupProps: () => {
|
3
|
-
head:
|
4
|
-
|
5
|
-
default: string;
|
6
|
-
};
|
7
|
-
headAlign: {
|
8
|
-
type: PropType<"center" | "left" | "right">;
|
9
|
-
default: "center" | "left" | "right";
|
10
|
-
};
|
3
|
+
head: StringConstructor;
|
4
|
+
headAlign: PropType<"left" | "right" | "center">;
|
11
5
|
};
|
12
6
|
export type PagetableColumngroupProps = Partial<ExtractPropTypes<ReturnType<typeof pagetableColumngroupProps>>>;
|
13
7
|
declare const _default: import('vue').DefineComponent<ExtractPropTypes<{
|
14
|
-
head:
|
15
|
-
|
16
|
-
default: string;
|
17
|
-
};
|
18
|
-
headAlign: {
|
19
|
-
type: PropType<"center" | "left" | "right">;
|
20
|
-
default: "center" | "left" | "right";
|
21
|
-
};
|
8
|
+
head: StringConstructor;
|
9
|
+
headAlign: PropType<"left" | "right" | "center">;
|
22
10
|
}>, () => null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ExtractPropTypes<{
|
23
|
-
head:
|
24
|
-
|
25
|
-
|
26
|
-
};
|
27
|
-
headAlign: {
|
28
|
-
type: PropType<"center" | "left" | "right">;
|
29
|
-
default: "center" | "left" | "right";
|
30
|
-
};
|
31
|
-
}>> & Readonly<{}>, {
|
32
|
-
head: string;
|
33
|
-
headAlign: "center" | "left" | "right";
|
34
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
11
|
+
head: StringConstructor;
|
12
|
+
headAlign: PropType<"left" | "right" | "center">;
|
13
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
35
14
|
export default _default;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { computed as g } from "vue";
|
2
2
|
import y from "../../../error/OrionError.js";
|
3
|
-
import
|
4
|
-
import { filterEmpty as d } from "../../
|
3
|
+
import f from "../../_antd_util/camelize.js";
|
4
|
+
import { filterEmpty as d } from "../../_antd_util/index.js";
|
5
5
|
function m(n) {
|
6
6
|
return n == null ? void 0 : n.map((a) => {
|
7
7
|
var t, i;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useColumns.js","sources":["../../../../src/components/Pagetable/hooks/useColumns.ts"],"sourcesContent":["import { computed } from 'vue'\r\nimport OrionError from '../../../error/OrionError'\r\n\r\nimport
|
1
|
+
{"version":3,"file":"useColumns.js","sources":["../../../../src/components/Pagetable/hooks/useColumns.ts"],"sourcesContent":["import { computed } from 'vue'\r\nimport OrionError from '../../../error/OrionError'\r\n\r\nimport camelize from '../../_antd_util/camelize'\r\nimport { filterEmpty } from '../../_antd_util'\r\n\r\nfunction genColumns(children) {\r\n const tableColumns = children?.map((c) => {\r\n const props = { ...(c.props || {}) }\r\n for (const [k, v] of Object.entries(props)) {\r\n delete props[k]\r\n props[camelize(k)] = v\r\n }\r\n\r\n if (c.type.name === 'OPagetableColumnIndex') {\r\n return {\r\n type: c.type.name,\r\n }\r\n } else if (c.type.name === 'OPagetableColumnString' || c.type.name === 'OPagetableColumnLink') {\r\n return {\r\n type: c.type.name,\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n bodyAlign: props?.bodyAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n tail: props?.tail,\r\n }\r\n } else if (c.type.name === 'OPagetableColumnNumber') {\r\n return {\r\n type: c.type.name,\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n bodyAlign: props?.bodyAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n tail: props?.tail,\r\n\r\n thousandsSeparator: props?.thousandsSeparator,\r\n precision: Number(props?.precision),\r\n percentage: props?.percentage,\r\n }\r\n } else if (c.type.name === 'OPagetableColumnDate') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n bodyAlign: props?.bodyAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n tail: props?.tail,\r\n\r\n format: props?.format,\r\n sourceFormat: props?.sourceFormat,\r\n }\r\n } else if (c.type.name === 'OPagetableColumnSingleselect' || c.type.name === 'OPagetableColumnMultiselect') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n bodyAlign: props?.bodyAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n tail: props?.tail,\r\n\r\n code: props?.code,\r\n }\r\n } else if (c.type.name === 'OPagetableColumnButtongroup') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n bodyAlign: props?.bodyAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n tail: props?.tail,\r\n\r\n children: c.children,\r\n }\r\n } else if (c.type.name === 'OPagetableColumngroup') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n\r\n children: genColumns(filterEmpty(c.children?.default?.())),\r\n }\r\n } else if (c.type.name === 'OPagetableColumnDiy') {\r\n return {\r\n type: c.type.name,\r\n\r\n head: props?.head,\r\n headAlign: props?.headAlign,\r\n name: props?.name,\r\n width: props?.width,\r\n fixed: props?.fixed,\r\n tail: props?.tail,\r\n\r\n children: c.children,\r\n }\r\n } else {\r\n throw new OrionError(`OPagetable不能正确解析'${c.type.name}'子组件。`)\r\n }\r\n })\r\n\r\n return tableColumns\r\n}\r\n\r\nexport default function useColumns(slots) {\r\n const columns = computed(() => {\r\n const children = slots.default?.()\r\n\r\n const non_empty_children = filterEmpty(children)\r\n\r\n const tableColumns = genColumns(non_empty_children)\r\n\r\n return tableColumns\r\n })\r\n\r\n return columns\r\n}\r\n"],"names":["genColumns","children","c","props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AAAA,QACd,MAAMA,KAAA,gBAAAA,EAAO;AAAA,QAEb,UAAUD,EAAE;AAAA,MAAA;AAEL,QAAAA,EAAE,KAAK,SAAS;AAClB,aAAA;AAAA,QACL,MAAMA,EAAE,KAAK;AAAA,QAEb,MAAMC,KAAA,gBAAAA,EAAO;AAAA,QACb,WAAWA,KAAA,gBAAAA,EAAO;AAAA,QAElB,UAAUH,EAAWO,GAAYC,KAAAC,IAAAP,EAAE,aAAF,gBAAAO,EAAY,YAAZ,gBAAAD,EAAA,KAAAC,EAAuB,CAAC;AAAA,MAAA;AAElD,QAAAP,EAAE,KAAK,SAAS;AAClB,aAAA;AAAA,QACL,MAAMA,EAAE,KAAK;AAAA,QAEb,MAAMC,KAAA,gBAAAA,EAAO;AAAA,QACb,WAAWA,KAAA,gBAAAA,EAAO;AAAA,QAClB,MAAMA,KAAA,gBAAAA,EAAO;AAAA,QACb,OAAOA,KAAA,gBAAAA,EAAO;AAAA,QACd,OAAOA,KAAA,gBAAAA,EAAO;AAAA,QACd,MAAMA,KAAA,gBAAAA,EAAO;AAAA,QAEb,UAAUD,EAAE;AAAA,MAAA;AAGd,UAAM,IAAIQ,EAAW,oBAAoBR,EAAE,KAAK,IAAI,OAAO;AAAA,EAC7D;AAIJ;AAEA,SAAwBS,EAAWC,GAAO;AAWjC,SAVSC,EAAS,MAAM;;AACvB,UAAAZ,KAAWQ,IAAAG,EAAM,YAAN,gBAAAH,EAAA,KAAAG,IAEXE,IAAqBP,EAAYN,CAAQ;AAIxC,WAFcD,EAAWc,CAAkB;AAAA,EAE3C,CACR;AAGH;"}
|
@@ -1,16 +1,21 @@
|
|
1
|
+
import { ShallowRef } from 'vue';
|
2
|
+
import { PagetableInstance } from '../Pagetable';
|
1
3
|
interface PaginationProps {
|
2
4
|
currentPage: number;
|
3
5
|
pageSize: number;
|
4
6
|
pageSizes?: number[];
|
5
7
|
total?: number;
|
6
8
|
}
|
7
|
-
type LoadDataFn<Row, Tail> = (
|
9
|
+
type LoadDataFn<Row, Tail> = (self: {
|
8
10
|
data: Row[];
|
9
|
-
|
10
|
-
tailData
|
11
|
-
|
11
|
+
pagination: PaginationProps;
|
12
|
+
tailData: Tail | undefined;
|
13
|
+
toggleRowSelection: (row: Row, selected?: boolean) => void;
|
14
|
+
toggleAllSelection: () => void;
|
15
|
+
setCurrentRow: (row: Row) => void;
|
16
|
+
}) => Promise<void>;
|
12
17
|
interface UsePagetableOptions<Row, Tail> {
|
13
|
-
tableRef
|
18
|
+
tableRef?: Readonly<ShallowRef<PagetableInstance | null>>;
|
14
19
|
onLoadData: LoadDataFn<Row, Tail>;
|
15
20
|
afterSelectionChange?: (newSelection: Row[]) => void;
|
16
21
|
afterCurrentRowChange?: (currentRow: Row, oldCurrentRow: Row) => void;
|
@@ -18,7 +23,7 @@ interface UsePagetableOptions<Row, Tail> {
|
|
18
23
|
initialPagination?: PaginationProps;
|
19
24
|
}
|
20
25
|
declare const usePagetable: <Row = any, Tail = any>(options: UsePagetableOptions<Row, Tail>) => {
|
21
|
-
data:
|
26
|
+
data: Row[];
|
22
27
|
pagination: {
|
23
28
|
currentPage: number;
|
24
29
|
pageSize: number;
|
@@ -26,14 +31,14 @@ declare const usePagetable: <Row = any, Tail = any>(options: UsePagetableOptions
|
|
26
31
|
total?: number | undefined;
|
27
32
|
};
|
28
33
|
tailData: Tail | undefined;
|
29
|
-
selection:
|
34
|
+
selection: Row[];
|
30
35
|
currentRow: Row | undefined;
|
31
36
|
onSelectionChange: (newSelection: Row[]) => void;
|
32
37
|
onCurrentRowChange: (newCurrentRow: Row, oldCurrentRow: Row) => void;
|
33
38
|
clearSelection: () => void;
|
34
39
|
toggleRowSelection: (row: Row, selected?: boolean) => void;
|
35
40
|
toggleAllSelection: () => void;
|
36
|
-
getSelectionRows: () =>
|
41
|
+
getSelectionRows: () => Row[];
|
37
42
|
setCurrentRow: (row: Row) => void;
|
38
43
|
loadData: () => Promise<void>;
|
39
44
|
};
|
@@ -1,50 +1,62 @@
|
|
1
|
-
import { ref as
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
import { ref as o, reactive as v } from "vue";
|
2
|
+
import n from "../../../error/OrionError.js";
|
3
|
+
const z = (C) => {
|
4
|
+
const { tableRef: e, onLoadData: b, afterSelectionChange: l, afterCurrentRowChange: c, initialData: r, initialPagination: i } = C, s = o(r || []), g = o(
|
5
|
+
i || {
|
5
6
|
currentPage: 1,
|
6
7
|
pageSize: 10
|
7
8
|
}
|
8
|
-
),
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
9
|
+
), w = o(), f = o([]), u = o(), d = (t) => {
|
10
|
+
f.value = t, l && l(t);
|
11
|
+
}, p = (t, a) => {
|
12
|
+
u.value = t, c && c(t, a);
|
13
|
+
}, D = () => {
|
14
|
+
if (!e)
|
15
|
+
throw new n("调用clearSelection失败,tableRef为空");
|
16
|
+
e.value.clearSelection();
|
17
|
+
}, R = (t, a) => {
|
18
|
+
if (!e)
|
19
|
+
throw new n("调用toggleRowSelection失败,tableRef为空");
|
20
|
+
e.value.toggleRowSelection(t, a);
|
21
|
+
}, S = () => {
|
22
|
+
if (!e)
|
23
|
+
throw new n("调用toggleAllSelection失败,tableRef为空");
|
24
|
+
e.value.toggleAllSelection();
|
25
|
+
}, m = () => {
|
26
|
+
if (!e)
|
27
|
+
throw new n("调用getSelectionRows失败,tableRef为空");
|
28
|
+
return e.value.getSelectionRows();
|
29
|
+
}, h = (t) => {
|
30
|
+
if (!e)
|
31
|
+
throw new n("调用setCurrentRow失败,tableRef为空");
|
32
|
+
e.value.setCurrentRow(t);
|
33
|
+
}, A = v({
|
34
|
+
data: s,
|
35
|
+
pagination: g,
|
36
|
+
tailData: w,
|
37
|
+
toggleRowSelection: R,
|
38
|
+
toggleAllSelection: S,
|
39
|
+
setCurrentRow: h
|
40
|
+
});
|
41
|
+
return v({
|
42
|
+
data: s,
|
43
|
+
pagination: g,
|
44
|
+
tailData: w,
|
45
|
+
selection: f,
|
46
|
+
currentRow: u,
|
47
|
+
onSelectionChange: d,
|
48
|
+
onCurrentRowChange: p,
|
49
|
+
clearSelection: D,
|
50
|
+
toggleRowSelection: R,
|
51
|
+
toggleAllSelection: S,
|
52
|
+
getSelectionRows: m,
|
53
|
+
setCurrentRow: h,
|
41
54
|
loadData: async () => {
|
42
|
-
|
43
|
-
r.value = e.data, n.value.total = e.total, s.value = e.tailData;
|
55
|
+
await b(A);
|
44
56
|
}
|
45
57
|
});
|
46
58
|
};
|
47
59
|
export {
|
48
|
-
|
60
|
+
z as default
|
49
61
|
};
|
50
62
|
//# sourceMappingURL=usePagetable.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"usePagetable.js","sources":["../../../../src/components/Pagetable/hooks/usePagetable.ts"],"sourcesContent":["import { reactive, ref } from 'vue'\r\n\r\ninterface PaginationProps {\r\n currentPage: number\r\n pageSize: number\r\n pageSizes?: number[]\r\n total?: number\r\n}\r\n\r\ntype LoadDataFn<Row, Tail> = (
|
1
|
+
{"version":3,"file":"usePagetable.js","sources":["../../../../src/components/Pagetable/hooks/usePagetable.ts"],"sourcesContent":["import { reactive, Ref, ref, ShallowRef } from 'vue'\r\nimport { PagetableInstance } from '../Pagetable'\r\nimport OrionError from '../../../error/OrionError'\r\n\r\ninterface PaginationProps {\r\n currentPage: number\r\n pageSize: number\r\n pageSizes?: number[]\r\n total?: number\r\n}\r\n\r\ntype LoadDataFn<Row, Tail> = (self: {\r\n data: Row[]\r\n pagination: PaginationProps\r\n tailData: Tail | undefined\r\n toggleRowSelection: (row: Row, selected?: boolean) => void\r\n toggleAllSelection: () => void\r\n setCurrentRow: (row: Row) => void\r\n}) => Promise<void>\r\n\r\ninterface UsePagetableOptions<Row, Tail> {\r\n tableRef?: Readonly<ShallowRef<PagetableInstance | null>>\r\n onLoadData: LoadDataFn<Row, Tail>\r\n afterSelectionChange?: (newSelection: Row[]) => void\r\n afterCurrentRowChange?: (currentRow: Row, oldCurrentRow: Row) => void\r\n initialData?: Row[]\r\n initialPagination?: PaginationProps\r\n}\r\n\r\nconst usePagetable = <Row = any, Tail = any>(options: UsePagetableOptions<Row, Tail>) => {\r\n const { tableRef, onLoadData, afterSelectionChange, afterCurrentRowChange, initialData, initialPagination } = options\r\n\r\n const data = ref<Row[]>(initialData ? initialData : []) as Ref<Row[]>\r\n const pagination = ref<PaginationProps>(\r\n initialPagination\r\n ? initialPagination\r\n : {\r\n currentPage: 1,\r\n pageSize: 10,\r\n }\r\n )\r\n const tailData = ref<Tail>()\r\n const selection = ref<Row[]>([]) as Ref<Row[]>\r\n const currentRow = ref<Row>()\r\n\r\n const onSelectionChange = (newSelection: Row[]) => {\r\n selection.value = newSelection\r\n afterSelectionChange && afterSelectionChange(newSelection)\r\n }\r\n const onCurrentRowChange = (newCurrentRow: Row, oldCurrentRow: Row) => {\r\n currentRow.value = newCurrentRow\r\n afterCurrentRowChange && afterCurrentRowChange(newCurrentRow, oldCurrentRow)\r\n }\r\n\r\n const clearSelection = () => {\r\n if (!tableRef) {\r\n throw new OrionError(`调用clearSelection失败,tableRef为空`)\r\n }\r\n tableRef.value!.clearSelection()\r\n }\r\n const toggleRowSelection = (row: Row, selected?: boolean) => {\r\n if (!tableRef) {\r\n throw new OrionError(`调用toggleRowSelection失败,tableRef为空`)\r\n }\r\n tableRef.value!.toggleRowSelection(row, selected)\r\n }\r\n const toggleAllSelection = () => {\r\n if (!tableRef) {\r\n throw new OrionError(`调用toggleAllSelection失败,tableRef为空`)\r\n }\r\n tableRef.value!.toggleAllSelection()\r\n }\r\n const getSelectionRows = () => {\r\n if (!tableRef) {\r\n throw new OrionError(`调用getSelectionRows失败,tableRef为空`)\r\n }\r\n return tableRef.value!.getSelectionRows() as Row[]\r\n }\r\n const setCurrentRow = (row: Row) => {\r\n if (!tableRef) {\r\n throw new OrionError(`调用setCurrentRow失败,tableRef为空`)\r\n }\r\n tableRef.value!.setCurrentRow(row)\r\n }\r\n\r\n const self = reactive({\r\n data,\r\n pagination,\r\n tailData,\r\n toggleRowSelection,\r\n toggleAllSelection,\r\n setCurrentRow,\r\n })\r\n\r\n const loadData = async () => {\r\n await onLoadData(self)\r\n }\r\n\r\n return reactive({\r\n data,\r\n pagination,\r\n tailData,\r\n selection,\r\n currentRow,\r\n onSelectionChange,\r\n onCurrentRowChange,\r\n clearSelection,\r\n toggleRowSelection,\r\n toggleAllSelection,\r\n getSelectionRows,\r\n setCurrentRow,\r\n loadData,\r\n })\r\n}\r\n\r\nexport default usePagetable\r\n"],"names":["usePagetable","options","tableRef","onLoadData","afterSelectionChange","afterCurrentRowChange","initialData","initialPagination","data","ref","pagination","tailData","selection","currentRow","onSelectionChange","newSelection","onCurrentRowChange","newCurrentRow","oldCurrentRow","clearSelection","OrionError","toggleRowSelection","row","selected","toggleAllSelection","getSelectionRows","setCurrentRow","self","reactive"],"mappings":";;AA6BM,MAAAA,IAAe,CAAwBC,MAA4C;AACvF,QAAM,EAAE,UAAAC,GAAU,YAAAC,GAAY,sBAAAC,GAAsB,uBAAAC,GAAuB,aAAAC,GAAa,mBAAAC,EAAsB,IAAAN,GAExGO,IAAOC,EAAWH,KAA4B,CAAE,CAAA,GAChDI,IAAaD;AAAA,IACjBF,KAEI;AAAA,MACE,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,EAAA,GAEAI,IAAWF,KACXG,IAAYH,EAAW,CAAA,CAAE,GACzBI,IAAaJ,KAEbK,IAAoB,CAACC,MAAwB;AACjD,IAAAH,EAAU,QAAQG,GAClBX,KAAwBA,EAAqBW,CAAY;AAAA,EAAA,GAErDC,IAAqB,CAACC,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