@campus-admin/ui 1.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -335
- package/dist/campus/card/index.d.ts +9 -0
- package/dist/campus/index.d.ts +7 -0
- package/dist/campus/parent/index.d.ts +9 -0
- package/dist/campus/student/index.d.ts +9 -0
- package/dist/campus/teacher/index.d.ts +9 -0
- package/dist/campus/tel/index.d.ts +9 -0
- package/dist/{base/empty/src/empty.vue.d.ts → components/basic/CaIcon.vue.d.ts} +4 -7
- package/dist/components/basic/CaPageActions.vue.d.ts +15 -0
- package/dist/components/basic/icons.d.ts +48 -0
- package/dist/components/basic/index.d.ts +838 -0
- package/dist/components/button/index.d.ts +348 -0
- package/dist/components/chart/bar-chart/CaBarChart.vue.d.ts +31 -0
- package/dist/components/chart/chart-math.d.ts +178 -0
- package/dist/components/chart/gauge/CaGauge.vue.d.ts +31 -0
- package/dist/components/chart/index.d.ts +195 -0
- package/dist/components/chart/line-chart/CaLineChart.vue.d.ts +40 -0
- package/dist/components/chart/parts/ChartLegend.vue.d.ts +28 -0
- package/dist/{atom/slogan/src/slogan.vue.d.ts → components/chart/parts/ChartStatus.vue.d.ts} +3 -5
- package/dist/components/chart/parts/ChartTable.vue.d.ts +19 -0
- package/dist/components/chart/parts/ChartTooltip.vue.d.ts +23 -0
- package/dist/components/chart/pie-chart/CaPieChart.vue.d.ts +25 -0
- package/dist/components/chart/sparkline/CaSparkline.vue.d.ts +20 -0
- package/dist/components/chart/use-chart.d.ts +36 -0
- package/dist/components/config/CaConfigProvider.vue.d.ts +16 -0
- package/dist/components/config/index.d.ts +33 -0
- package/dist/components/display/index.d.ts +99 -0
- package/dist/{base/copyright/src/copyright.vue.d.ts → components/display/stat-card/CaStatCard.vue.d.ts} +7 -11
- package/dist/{base/skeleton/src/skeleton.vue.d.ts → components/display/status-tag/CaStatusTag.vue.d.ts} +4 -7
- package/dist/components/display/types.d.ts +7 -0
- package/dist/components/form/index.d.ts +112 -0
- package/dist/components/form/schema-form/CaSchemaForm.vue.d.ts +31 -0
- package/dist/components/form/types.d.ts +17 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/layout/index.d.ts +34 -0
- package/dist/components/navigation/CaMenu.vue.d.ts +13 -0
- package/dist/components/navigation/index.d.ts +64 -0
- package/dist/components/overlay/index.d.ts +1511 -0
- package/dist/components/table/data-table/CaDataTable.vue.d.ts +49 -0
- package/dist/components/table/index.d.ts +33 -0
- package/dist/components/table/types.d.ts +46 -0
- package/dist/index.d.ts +21 -1106
- package/dist/index.js +2187 -0
- package/dist/oms/index.d.ts +3 -0
- package/dist/oms/school/index.d.ts +10 -0
- package/dist/shared/inject.d.ts +8 -0
- package/dist/shared/registry.d.ts +5 -0
- package/dist/shared/types.d.ts +9 -0
- package/dist/shared/wrap.d.ts +7 -0
- package/dist/style.css +2 -0
- package/package.json +17 -49
- package/dist/atom/attendance-badge/index.d.ts +0 -5
- package/dist/atom/attendance-badge/src/attendance-badge.vue.d.ts +0 -13
- package/dist/atom/attendance-badge/src/core.d.ts +0 -11
- package/dist/atom/avatar/index.d.ts +0 -3
- package/dist/atom/avatar/src/avatar.vue.d.ts +0 -14
- package/dist/atom/button/index.d.ts +0 -3
- package/dist/atom/button/src/button.vue.d.ts +0 -40
- package/dist/atom/checkbox/index.d.ts +0 -3
- package/dist/atom/checkbox/src/checkbox.vue.d.ts +0 -24
- package/dist/atom/icon/index.d.ts +0 -3
- package/dist/atom/icon/src/icon.vue.d.ts +0 -27
- package/dist/atom/index.d.ts +0 -444
- package/dist/atom/input/index.d.ts +0 -3
- package/dist/atom/input/src/input.vue.d.ts +0 -43
- package/dist/atom/progress/index.d.ts +0 -4
- package/dist/atom/progress/src/core.d.ts +0 -9
- package/dist/atom/progress/src/progress.vue.d.ts +0 -19
- package/dist/atom/select/index.d.ts +0 -5
- package/dist/atom/select/src/core.d.ts +0 -9
- package/dist/atom/select/src/select.vue.d.ts +0 -22
- package/dist/atom/slogan/index.d.ts +0 -3
- package/dist/atom/switch/index.d.ts +0 -3
- package/dist/atom/switch/src/switch.vue.d.ts +0 -16
- package/dist/atom/tag/index.d.ts +0 -3
- package/dist/atom/tag/src/tag.vue.d.ts +0 -31
- package/dist/atom/textarea/index.d.ts +0 -3
- package/dist/atom/textarea/src/textarea.vue.d.ts +0 -19
- package/dist/base/breadcrumb/index.d.ts +0 -4
- package/dist/base/breadcrumb/src/breadcrumb.vue.d.ts +0 -29
- package/dist/base/class-tree/index.d.ts +0 -5
- package/dist/base/class-tree/src/class-tree.vue.d.ts +0 -29
- package/dist/base/class-tree/src/core.d.ts +0 -30
- package/dist/base/copyright/index.d.ts +0 -3
- package/dist/base/drawer/index.d.ts +0 -3
- package/dist/base/drawer/src/drawer.vue.d.ts +0 -36
- package/dist/base/empty/index.d.ts +0 -3
- package/dist/base/index.d.ts +0 -651
- package/dist/base/menu/core.d.ts +0 -34
- package/dist/base/menu/index.d.ts +0 -13
- package/dist/base/menu/side-menu/index.d.ts +0 -5
- package/dist/base/menu/side-menu/src/side-menu.vue.d.ts +0 -59
- package/dist/base/modal/index.d.ts +0 -4
- package/dist/base/modal/src/core.d.ts +0 -8
- package/dist/base/modal/src/modal.vue.d.ts +0 -46
- package/dist/base/page-header/index.d.ts +0 -3
- package/dist/base/page-header/src/page-header.vue.d.ts +0 -27
- package/dist/base/pagination/index.d.ts +0 -5
- package/dist/base/pagination/src/core.d.ts +0 -11
- package/dist/base/pagination/src/pagination.vue.d.ts +0 -26
- package/dist/base/search-form/index.d.ts +0 -3
- package/dist/base/search-form/src/search-form.vue.d.ts +0 -34
- package/dist/base/skeleton/index.d.ts +0 -3
- package/dist/base/statistic/index.d.ts +0 -3
- package/dist/base/statistic/src/statistic.vue.d.ts +0 -16
- package/dist/base/table/index.d.ts +0 -5
- package/dist/base/table/src/core.d.ts +0 -25
- package/dist/base/table/src/table.vue.d.ts +0 -44
- package/dist/base/toast/index.d.ts +0 -5
- package/dist/base/toast/src/store.d.ts +0 -56
- package/dist/base/toast/src/toast-container.vue.d.ts +0 -3
- package/dist/campus-ui.css +0 -2
- package/dist/campus-ui.js +0 -2229
- package/dist/campus-ui.umd.cjs +0 -1
- package/dist/core/index.d.ts +0 -4
- package/dist/core/namespace.d.ts +0 -16
- package/dist/core/theme.d.ts +0 -49
- package/dist/feature/daily-agenda/index.d.ts +0 -5
- package/dist/feature/daily-agenda/src/core.d.ts +0 -25
- package/dist/feature/daily-agenda/src/daily-agenda.vue.d.ts +0 -12
- package/dist/feature/daily-agenda/src/data.d.ts +0 -3
- package/dist/feature/index.d.ts +0 -61
- package/dist/feature/student-picker/index.d.ts +0 -5
- package/dist/feature/student-picker/src/core.d.ts +0 -19
- package/dist/feature/student-picker/src/student-picker.vue.d.ts +0 -26
- package/dist/feature/weekly-timetable/index.d.ts +0 -6
- package/dist/feature/weekly-timetable/src/core.d.ts +0 -33
- package/dist/feature/weekly-timetable/src/data.d.ts +0 -3
- package/dist/feature/weekly-timetable/src/weekly-timetable.vue.d.ts +0 -7
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import 'element-plus/es/components/button/style/css';
|
|
2
|
+
import 'element-plus/es/components/button-group/style/css';
|
|
3
|
+
export declare const CaButton: {
|
|
4
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("element-plus").ButtonProps> & Readonly<{
|
|
5
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
6
|
+
}>, {
|
|
7
|
+
ref: import("vue").Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
8
|
+
size: import("vue").ComputedRef<"" | "default" | "large" | "small">;
|
|
9
|
+
type: import("vue").ComputedRef<"default" | "" | "text" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
10
|
+
disabled: import("vue").ComputedRef<boolean>;
|
|
11
|
+
shouldAddSpace: import("vue").ComputedRef<boolean>;
|
|
12
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
click: (evt: MouseEvent) => void;
|
|
14
|
+
}, import("vue").PublicProps, {
|
|
15
|
+
type: import("element-plus").ButtonType;
|
|
16
|
+
text: boolean;
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
round: boolean;
|
|
19
|
+
dashed: boolean;
|
|
20
|
+
tag: string | import("vue").Component;
|
|
21
|
+
nativeType: import("element-plus").ButtonNativeType;
|
|
22
|
+
loadingIcon: import("element-plus/es/utils/vue/icon.mjs").IconPropType;
|
|
23
|
+
plain: boolean;
|
|
24
|
+
autoInsertSpace: boolean;
|
|
25
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
26
|
+
P: {};
|
|
27
|
+
B: {};
|
|
28
|
+
D: {};
|
|
29
|
+
C: {};
|
|
30
|
+
M: {};
|
|
31
|
+
Defaults: {};
|
|
32
|
+
}, Readonly<import("element-plus").ButtonProps> & Readonly<{
|
|
33
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
ref: import("vue").Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
36
|
+
size: import("vue").ComputedRef<"" | "default" | "large" | "small">;
|
|
37
|
+
type: import("vue").ComputedRef<"default" | "" | "text" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
38
|
+
disabled: import("vue").ComputedRef<boolean>;
|
|
39
|
+
shouldAddSpace: import("vue").ComputedRef<boolean>;
|
|
40
|
+
}, {}, {}, {}, {
|
|
41
|
+
type: import("element-plus").ButtonType;
|
|
42
|
+
text: boolean;
|
|
43
|
+
disabled: boolean;
|
|
44
|
+
round: boolean;
|
|
45
|
+
dashed: boolean;
|
|
46
|
+
tag: string | import("vue").Component;
|
|
47
|
+
nativeType: import("element-plus").ButtonNativeType;
|
|
48
|
+
loadingIcon: import("element-plus/es/utils/vue/icon.mjs").IconPropType;
|
|
49
|
+
plain: boolean;
|
|
50
|
+
autoInsertSpace: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
__isFragment?: never;
|
|
53
|
+
__isTeleport?: never;
|
|
54
|
+
__isSuspense?: never;
|
|
55
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("element-plus").ButtonProps> & Readonly<{
|
|
56
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
57
|
+
}>, {
|
|
58
|
+
ref: import("vue").Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
59
|
+
size: import("vue").ComputedRef<"" | "default" | "large" | "small">;
|
|
60
|
+
type: import("vue").ComputedRef<"default" | "" | "text" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
61
|
+
disabled: import("vue").ComputedRef<boolean>;
|
|
62
|
+
shouldAddSpace: import("vue").ComputedRef<boolean>;
|
|
63
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
64
|
+
click: (evt: MouseEvent) => void;
|
|
65
|
+
}, string, {
|
|
66
|
+
type: import("element-plus").ButtonType;
|
|
67
|
+
text: boolean;
|
|
68
|
+
disabled: boolean;
|
|
69
|
+
round: boolean;
|
|
70
|
+
dashed: boolean;
|
|
71
|
+
tag: string | import("vue").Component;
|
|
72
|
+
nativeType: import("element-plus").ButtonNativeType;
|
|
73
|
+
loadingIcon: import("element-plus/es/utils/vue/icon.mjs").IconPropType;
|
|
74
|
+
plain: boolean;
|
|
75
|
+
autoInsertSpace: boolean;
|
|
76
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
77
|
+
$slots: {
|
|
78
|
+
loading?: (props: {}) => any;
|
|
79
|
+
} & {
|
|
80
|
+
icon?: (props: {}) => any;
|
|
81
|
+
} & {
|
|
82
|
+
default?: (props: {}) => any;
|
|
83
|
+
};
|
|
84
|
+
}) & import("vue").ObjectPlugin & {
|
|
85
|
+
setPropsDefaults: (defaults: {
|
|
86
|
+
readonly size?: "" | "default" | "small" | "large" | (() => "" | "default" | "small" | "large") | undefined;
|
|
87
|
+
readonly disabled?: boolean | (() => boolean) | undefined;
|
|
88
|
+
readonly type?: "" | "warning" | "default" | "text" | "primary" | "success" | "info" | "danger" | (() => "" | "warning" | "default" | "text" | "primary" | "success" | "info" | "danger") | undefined;
|
|
89
|
+
readonly icon?: string | import("vue").FunctionalComponent<any, {}, any, {}> | {
|
|
90
|
+
new (...args: any[]): any;
|
|
91
|
+
__isFragment?: never;
|
|
92
|
+
__isTeleport?: never;
|
|
93
|
+
__isSuspense?: never;
|
|
94
|
+
} | (() => (import("element-plus/es/utils/vue/icon.mjs").IconPropType | undefined) & {}) | undefined;
|
|
95
|
+
readonly nativeType?: "button" | "submit" | "reset" | (() => "button" | "submit" | "reset") | undefined;
|
|
96
|
+
readonly loading?: boolean | (() => boolean) | undefined;
|
|
97
|
+
readonly loadingIcon?: string | import("vue").FunctionalComponent<any, {}, any, {}> | {
|
|
98
|
+
new (...args: any[]): any;
|
|
99
|
+
__isFragment?: never;
|
|
100
|
+
__isTeleport?: never;
|
|
101
|
+
__isSuspense?: never;
|
|
102
|
+
} | (() => (import("element-plus/es/utils/vue/icon.mjs").IconPropType | undefined) & {}) | undefined;
|
|
103
|
+
readonly plain?: boolean | (() => boolean) | undefined;
|
|
104
|
+
readonly text?: boolean | (() => boolean) | undefined;
|
|
105
|
+
readonly link?: boolean | (() => boolean) | undefined;
|
|
106
|
+
readonly bg?: boolean | (() => boolean) | undefined;
|
|
107
|
+
readonly autofocus?: boolean | (() => boolean) | undefined;
|
|
108
|
+
readonly round?: boolean | (() => boolean) | undefined;
|
|
109
|
+
readonly circle?: boolean | (() => boolean) | undefined;
|
|
110
|
+
readonly dashed?: boolean | (() => boolean) | undefined;
|
|
111
|
+
readonly color?: string | (() => string) | undefined;
|
|
112
|
+
readonly dark?: boolean | (() => boolean) | undefined;
|
|
113
|
+
readonly autoInsertSpace?: boolean | (() => boolean) | undefined;
|
|
114
|
+
readonly tag?: string | import("vue").FunctionalComponent<any, {}, any, {}> | {
|
|
115
|
+
new (...args: any[]): any;
|
|
116
|
+
__isFragment?: never;
|
|
117
|
+
__isTeleport?: never;
|
|
118
|
+
__isSuspense?: never;
|
|
119
|
+
} | (() => (string | import("vue").Component | undefined) & {}) | undefined;
|
|
120
|
+
}) => void;
|
|
121
|
+
} & {
|
|
122
|
+
ButtonGroup: {
|
|
123
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("element-plus/es/components/button/src/button-group.mjs").ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
124
|
+
type: "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger";
|
|
125
|
+
direction: "horizontal" | "vertical";
|
|
126
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
127
|
+
P: {};
|
|
128
|
+
B: {};
|
|
129
|
+
D: {};
|
|
130
|
+
C: {};
|
|
131
|
+
M: {};
|
|
132
|
+
Defaults: {};
|
|
133
|
+
}, Readonly<import("element-plus/es/components/button/src/button-group.mjs").ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
134
|
+
type: "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger";
|
|
135
|
+
direction: "horizontal" | "vertical";
|
|
136
|
+
}>;
|
|
137
|
+
__isFragment?: never;
|
|
138
|
+
__isTeleport?: never;
|
|
139
|
+
__isSuspense?: never;
|
|
140
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("element-plus/es/components/button/src/button-group.mjs").ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
141
|
+
type: "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger";
|
|
142
|
+
direction: "horizontal" | "vertical";
|
|
143
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
144
|
+
$slots: {
|
|
145
|
+
default?: (props: {}) => any;
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
export declare const CaButtonGroup: import("element-plus/es/utils/vue/typescript.mjs").SFCWithInstall<{
|
|
150
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("element-plus/es/components/button/src/button-group.mjs").ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
151
|
+
type: "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger";
|
|
152
|
+
direction: "horizontal" | "vertical";
|
|
153
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
154
|
+
P: {};
|
|
155
|
+
B: {};
|
|
156
|
+
D: {};
|
|
157
|
+
C: {};
|
|
158
|
+
M: {};
|
|
159
|
+
Defaults: {};
|
|
160
|
+
}, Readonly<import("element-plus/es/components/button/src/button-group.mjs").ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
161
|
+
type: "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger";
|
|
162
|
+
direction: "horizontal" | "vertical";
|
|
163
|
+
}>;
|
|
164
|
+
__isFragment?: never;
|
|
165
|
+
__isTeleport?: never;
|
|
166
|
+
__isSuspense?: never;
|
|
167
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("element-plus/es/components/button/src/button-group.mjs").ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
168
|
+
type: "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger";
|
|
169
|
+
direction: "horizontal" | "vertical";
|
|
170
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
171
|
+
$slots: {
|
|
172
|
+
default?: (props: {}) => any;
|
|
173
|
+
};
|
|
174
|
+
})>;
|
|
175
|
+
export declare const buttonComponents: {
|
|
176
|
+
CaButton: {
|
|
177
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("element-plus").ButtonProps> & Readonly<{
|
|
178
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
179
|
+
}>, {
|
|
180
|
+
ref: import("vue").Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
181
|
+
size: import("vue").ComputedRef<"" | "default" | "large" | "small">;
|
|
182
|
+
type: import("vue").ComputedRef<"default" | "" | "text" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
183
|
+
disabled: import("vue").ComputedRef<boolean>;
|
|
184
|
+
shouldAddSpace: import("vue").ComputedRef<boolean>;
|
|
185
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
186
|
+
click: (evt: MouseEvent) => void;
|
|
187
|
+
}, import("vue").PublicProps, {
|
|
188
|
+
type: import("element-plus").ButtonType;
|
|
189
|
+
text: boolean;
|
|
190
|
+
disabled: boolean;
|
|
191
|
+
round: boolean;
|
|
192
|
+
dashed: boolean;
|
|
193
|
+
tag: string | import("vue").Component;
|
|
194
|
+
nativeType: import("element-plus").ButtonNativeType;
|
|
195
|
+
loadingIcon: import("element-plus/es/utils/vue/icon.mjs").IconPropType;
|
|
196
|
+
plain: boolean;
|
|
197
|
+
autoInsertSpace: boolean;
|
|
198
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
199
|
+
P: {};
|
|
200
|
+
B: {};
|
|
201
|
+
D: {};
|
|
202
|
+
C: {};
|
|
203
|
+
M: {};
|
|
204
|
+
Defaults: {};
|
|
205
|
+
}, Readonly<import("element-plus").ButtonProps> & Readonly<{
|
|
206
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
207
|
+
}>, {
|
|
208
|
+
ref: import("vue").Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
209
|
+
size: import("vue").ComputedRef<"" | "default" | "large" | "small">;
|
|
210
|
+
type: import("vue").ComputedRef<"default" | "" | "text" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
211
|
+
disabled: import("vue").ComputedRef<boolean>;
|
|
212
|
+
shouldAddSpace: import("vue").ComputedRef<boolean>;
|
|
213
|
+
}, {}, {}, {}, {
|
|
214
|
+
type: import("element-plus").ButtonType;
|
|
215
|
+
text: boolean;
|
|
216
|
+
disabled: boolean;
|
|
217
|
+
round: boolean;
|
|
218
|
+
dashed: boolean;
|
|
219
|
+
tag: string | import("vue").Component;
|
|
220
|
+
nativeType: import("element-plus").ButtonNativeType;
|
|
221
|
+
loadingIcon: import("element-plus/es/utils/vue/icon.mjs").IconPropType;
|
|
222
|
+
plain: boolean;
|
|
223
|
+
autoInsertSpace: boolean;
|
|
224
|
+
}>;
|
|
225
|
+
__isFragment?: never;
|
|
226
|
+
__isTeleport?: never;
|
|
227
|
+
__isSuspense?: never;
|
|
228
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("element-plus").ButtonProps> & Readonly<{
|
|
229
|
+
onClick?: ((evt: MouseEvent) => any) | undefined;
|
|
230
|
+
}>, {
|
|
231
|
+
ref: import("vue").Ref<HTMLButtonElement | undefined, HTMLButtonElement | undefined>;
|
|
232
|
+
size: import("vue").ComputedRef<"" | "default" | "large" | "small">;
|
|
233
|
+
type: import("vue").ComputedRef<"default" | "" | "text" | "info" | "primary" | "success" | "warning" | "danger">;
|
|
234
|
+
disabled: import("vue").ComputedRef<boolean>;
|
|
235
|
+
shouldAddSpace: import("vue").ComputedRef<boolean>;
|
|
236
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
237
|
+
click: (evt: MouseEvent) => void;
|
|
238
|
+
}, string, {
|
|
239
|
+
type: import("element-plus").ButtonType;
|
|
240
|
+
text: boolean;
|
|
241
|
+
disabled: boolean;
|
|
242
|
+
round: boolean;
|
|
243
|
+
dashed: boolean;
|
|
244
|
+
tag: string | import("vue").Component;
|
|
245
|
+
nativeType: import("element-plus").ButtonNativeType;
|
|
246
|
+
loadingIcon: import("element-plus/es/utils/vue/icon.mjs").IconPropType;
|
|
247
|
+
plain: boolean;
|
|
248
|
+
autoInsertSpace: boolean;
|
|
249
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
250
|
+
$slots: {
|
|
251
|
+
loading?: (props: {}) => any;
|
|
252
|
+
} & {
|
|
253
|
+
icon?: (props: {}) => any;
|
|
254
|
+
} & {
|
|
255
|
+
default?: (props: {}) => any;
|
|
256
|
+
};
|
|
257
|
+
}) & import("vue").ObjectPlugin & {
|
|
258
|
+
setPropsDefaults: (defaults: {
|
|
259
|
+
readonly size?: "" | "default" | "small" | "large" | (() => "" | "default" | "small" | "large") | undefined;
|
|
260
|
+
readonly disabled?: boolean | (() => boolean) | undefined;
|
|
261
|
+
readonly type?: "" | "warning" | "default" | "text" | "primary" | "success" | "info" | "danger" | (() => "" | "warning" | "default" | "text" | "primary" | "success" | "info" | "danger") | undefined;
|
|
262
|
+
readonly icon?: string | import("vue").FunctionalComponent<any, {}, any, {}> | {
|
|
263
|
+
new (...args: any[]): any;
|
|
264
|
+
__isFragment?: never;
|
|
265
|
+
__isTeleport?: never;
|
|
266
|
+
__isSuspense?: never;
|
|
267
|
+
} | (() => (import("element-plus/es/utils/vue/icon.mjs").IconPropType | undefined) & {}) | undefined;
|
|
268
|
+
readonly nativeType?: "button" | "submit" | "reset" | (() => "button" | "submit" | "reset") | undefined;
|
|
269
|
+
readonly loading?: boolean | (() => boolean) | undefined;
|
|
270
|
+
readonly loadingIcon?: string | import("vue").FunctionalComponent<any, {}, any, {}> | {
|
|
271
|
+
new (...args: any[]): any;
|
|
272
|
+
__isFragment?: never;
|
|
273
|
+
__isTeleport?: never;
|
|
274
|
+
__isSuspense?: never;
|
|
275
|
+
} | (() => (import("element-plus/es/utils/vue/icon.mjs").IconPropType | undefined) & {}) | undefined;
|
|
276
|
+
readonly plain?: boolean | (() => boolean) | undefined;
|
|
277
|
+
readonly text?: boolean | (() => boolean) | undefined;
|
|
278
|
+
readonly link?: boolean | (() => boolean) | undefined;
|
|
279
|
+
readonly bg?: boolean | (() => boolean) | undefined;
|
|
280
|
+
readonly autofocus?: boolean | (() => boolean) | undefined;
|
|
281
|
+
readonly round?: boolean | (() => boolean) | undefined;
|
|
282
|
+
readonly circle?: boolean | (() => boolean) | undefined;
|
|
283
|
+
readonly dashed?: boolean | (() => boolean) | undefined;
|
|
284
|
+
readonly color?: string | (() => string) | undefined;
|
|
285
|
+
readonly dark?: boolean | (() => boolean) | undefined;
|
|
286
|
+
readonly autoInsertSpace?: boolean | (() => boolean) | undefined;
|
|
287
|
+
readonly tag?: string | import("vue").FunctionalComponent<any, {}, any, {}> | {
|
|
288
|
+
new (...args: any[]): any;
|
|
289
|
+
__isFragment?: never;
|
|
290
|
+
__isTeleport?: never;
|
|
291
|
+
__isSuspense?: never;
|
|
292
|
+
} | (() => (string | import("vue").Component | undefined) & {}) | undefined;
|
|
293
|
+
}) => void;
|
|
294
|
+
} & {
|
|
295
|
+
ButtonGroup: {
|
|
296
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("element-plus/es/components/button/src/button-group.mjs").ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
297
|
+
type: "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger";
|
|
298
|
+
direction: "horizontal" | "vertical";
|
|
299
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
300
|
+
P: {};
|
|
301
|
+
B: {};
|
|
302
|
+
D: {};
|
|
303
|
+
C: {};
|
|
304
|
+
M: {};
|
|
305
|
+
Defaults: {};
|
|
306
|
+
}, Readonly<import("element-plus/es/components/button/src/button-group.mjs").ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
307
|
+
type: "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger";
|
|
308
|
+
direction: "horizontal" | "vertical";
|
|
309
|
+
}>;
|
|
310
|
+
__isFragment?: never;
|
|
311
|
+
__isTeleport?: never;
|
|
312
|
+
__isSuspense?: never;
|
|
313
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("element-plus/es/components/button/src/button-group.mjs").ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
314
|
+
type: "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger";
|
|
315
|
+
direction: "horizontal" | "vertical";
|
|
316
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
317
|
+
$slots: {
|
|
318
|
+
default?: (props: {}) => any;
|
|
319
|
+
};
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
CaButtonGroup: import("element-plus/es/utils/vue/typescript.mjs").SFCWithInstall<{
|
|
323
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("element-plus/es/components/button/src/button-group.mjs").ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {
|
|
324
|
+
type: "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger";
|
|
325
|
+
direction: "horizontal" | "vertical";
|
|
326
|
+
}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
327
|
+
P: {};
|
|
328
|
+
B: {};
|
|
329
|
+
D: {};
|
|
330
|
+
C: {};
|
|
331
|
+
M: {};
|
|
332
|
+
Defaults: {};
|
|
333
|
+
}, Readonly<import("element-plus/es/components/button/src/button-group.mjs").ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, {
|
|
334
|
+
type: "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger";
|
|
335
|
+
direction: "horizontal" | "vertical";
|
|
336
|
+
}>;
|
|
337
|
+
__isFragment?: never;
|
|
338
|
+
__isTeleport?: never;
|
|
339
|
+
__isSuspense?: never;
|
|
340
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("element-plus/es/components/button/src/button-group.mjs").ButtonGroupProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {
|
|
341
|
+
type: "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger";
|
|
342
|
+
direction: "horizontal" | "vertical";
|
|
343
|
+
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
344
|
+
$slots: {
|
|
345
|
+
default?: (props: {}) => any;
|
|
346
|
+
};
|
|
347
|
+
})>;
|
|
348
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Value } from '../chart-math.js';
|
|
2
|
+
export interface BarSeries {
|
|
3
|
+
name: string;
|
|
4
|
+
/** 与 categories 一一对应;缺失值(null)不画柱子 */
|
|
5
|
+
data: Value[];
|
|
6
|
+
color?: string;
|
|
7
|
+
}
|
|
8
|
+
type __VLS_Props = {
|
|
9
|
+
categories: string[];
|
|
10
|
+
series: BarSeries[];
|
|
11
|
+
height?: number;
|
|
12
|
+
width?: number;
|
|
13
|
+
/** 堆叠:同一类目的各系列叠在一根柱子上(正负值分别向两侧累加) */
|
|
14
|
+
stacked?: boolean;
|
|
15
|
+
/** 横向:类目在纵轴、数值在横轴,适合类目名称很长或做排行 */
|
|
16
|
+
horizontal?: boolean;
|
|
17
|
+
/** 在放得下的位置显示数值(堆叠时显示每根柱子的合计) */
|
|
18
|
+
showValues?: boolean;
|
|
19
|
+
/** 单根柱子最大厚度(像素),默认 24 */
|
|
20
|
+
barSize?: number;
|
|
21
|
+
legend?: boolean;
|
|
22
|
+
loading?: boolean;
|
|
23
|
+
title?: string;
|
|
24
|
+
/** 数值轴刻度格式,默认大数用“万 / 亿” */
|
|
25
|
+
yFormatter?: (value: number) => string;
|
|
26
|
+
valueFormatter?: (value: number) => string;
|
|
27
|
+
animated?: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 图表的纯计算:刻度、比例尺、折线 / 面积 / 圆环 / 柱子的路径、堆叠、阈值取色、文字摘要的数据。
|
|
3
|
+
*
|
|
4
|
+
* 为什么单独拆成一个“没有 DOM、没有 Vue”的文件:
|
|
5
|
+
* - 图表组件里最容易出错的就是这些数学(刻度取整、平滑曲线、角度换算、堆叠累加),
|
|
6
|
+
* 放在 .vue 里没法用 node:test 直接测;拆出来后组件只负责“把结果画出来”和交互。
|
|
7
|
+
* - 同一套刻度、路径逻辑被折线、柱状、迷你趋势共用,不在每个组件里各写一份。
|
|
8
|
+
*
|
|
9
|
+
* 约定:
|
|
10
|
+
* - 坐标一律是 SVG 像素坐标(原点在左上,y 向下);角度用弧度,从“12 点钟方向”起顺时针计,
|
|
11
|
+
* 这样饼图、环形图、仪表的起点都在正上方,不用每个组件自己换算。
|
|
12
|
+
* - 数据里的 null / undefined / NaN 表示“这一点没有数据”:折线在此断开,不画成 0(画成 0 会谎报)。
|
|
13
|
+
* - 输出的路径字符串数值统一保留 2 位小数,避免浮点长尾让快照和 DOM 变大。
|
|
14
|
+
*/
|
|
15
|
+
/** 一个坐标点 */
|
|
16
|
+
export interface Point {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
}
|
|
20
|
+
/** 折线数据允许“缺失”:缺失的点不参与绘制,折线在此断开 */
|
|
21
|
+
export type Value = number | null | undefined;
|
|
22
|
+
/** 是否是可以画的有限数字 */
|
|
23
|
+
export declare function isNum(value: unknown): value is number;
|
|
24
|
+
/** 路径里的数值:保留 2 位小数并去掉多余的 0(-0 也规整成 0) */
|
|
25
|
+
export declare function fmt(value: number): string;
|
|
26
|
+
/** 把数值限制在 [min, max] 内 */
|
|
27
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
28
|
+
export interface Scale {
|
|
29
|
+
/** 取整后的轴下界、上界 */
|
|
30
|
+
min: number;
|
|
31
|
+
max: number;
|
|
32
|
+
/** 相邻刻度的间隔,总是 1、2、5 乘以 10 的整数次幂 */
|
|
33
|
+
step: number;
|
|
34
|
+
/** 从 min 到 max 的全部刻度(含两端) */
|
|
35
|
+
ticks: number[];
|
|
36
|
+
}
|
|
37
|
+
/** 把任意正数取成“好看”的数:1、2、5、10 乘以 10 的整数次幂(round 为 true 时四舍五入,否则向上取) */
|
|
38
|
+
export declare function niceNumber(range: number, round: boolean): number;
|
|
39
|
+
/**
|
|
40
|
+
* 由数据范围算出轴的刻度。
|
|
41
|
+
*
|
|
42
|
+
* @param min 数据最小值
|
|
43
|
+
* @param max 数据最大值
|
|
44
|
+
* @param tickCount 期望的刻度数(实际会因为取整略有出入)
|
|
45
|
+
* @param includeZero 是否强制把 0 包含进来:柱状图必须包含(否则柱子长度不再和数值成比例),折线图可以不包含
|
|
46
|
+
*
|
|
47
|
+
* 边界:全部为 0 或 min === max 时不能让范围塌成 0(比例尺会除以 0),这里给出一个合理的范围。
|
|
48
|
+
*/
|
|
49
|
+
export declare function niceScale(min: number, max: number, tickCount?: number, includeZero?: boolean): Scale;
|
|
50
|
+
/** 线性比例尺:把 [d0, d1] 映射到 [r0, r1];定义域退化(d0 === d1)时返回区间中点 */
|
|
51
|
+
export declare function linear(d0: number, d1: number, r0: number, r1: number): (value: number) => number;
|
|
52
|
+
export interface Bands {
|
|
53
|
+
/** 每个类目占的宽度(含两侧留白) */
|
|
54
|
+
step: number;
|
|
55
|
+
/** 每个类目里真正画柱子的宽度 */
|
|
56
|
+
bandwidth: number;
|
|
57
|
+
/** 第 i 个类目内容区的起点 */
|
|
58
|
+
start: (index: number) => number;
|
|
59
|
+
/** 第 i 个类目的中心 */
|
|
60
|
+
center: (index: number) => number;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* 类目轴的分段:把 [from, to] 平均分成 count 段,每段两侧各留 padding 比例的空白。
|
|
64
|
+
* 柱状图每个类目一段;折线图的“类目点”则放在每段的中心(center),首尾不贴边。
|
|
65
|
+
*/
|
|
66
|
+
export declare function bands(count: number, from: number, to: number, padding?: number): Bands;
|
|
67
|
+
/**
|
|
68
|
+
* 横轴类目太密时,按间隔抽取要显示的标签下标,避免文字叠在一起。
|
|
69
|
+
* @param count 类目数
|
|
70
|
+
* @param available 可用于放标签的总宽度
|
|
71
|
+
* @param minLabelWidth 单个标签至少需要的宽度(含间距)
|
|
72
|
+
* 总是保留第 0 个,然后每隔 k 个显示一个。
|
|
73
|
+
*/
|
|
74
|
+
export declare function labelIndices(count: number, available: number, minLabelWidth: number): number[];
|
|
75
|
+
/** 悬停定位:横坐标 x 离哪个位置最近(positions 必须从小到大),没有位置时返回 -1 */
|
|
76
|
+
export declare function nearestIndex(positions: number[], x: number): number;
|
|
77
|
+
/** 把一串可能含缺失值的点按“连续有效段”切开:折线在缺失处断开,而不是连到 0 */
|
|
78
|
+
export declare function splitSegments(points: (Point | null)[]): Point[][];
|
|
79
|
+
/** 折线路径:缺失值处断成多段(每段一个 M);没有可画的点返回空串 */
|
|
80
|
+
export declare function linePath(points: (Point | null)[], smooth?: boolean): string;
|
|
81
|
+
/** 面积路径:每个连续段沿曲线走一遍,再落到基线收口;只有 1 个点的段没有面积 */
|
|
82
|
+
export declare function areaPath(points: (Point | null)[], baseline: number, smooth?: boolean): string;
|
|
83
|
+
export interface Stacked {
|
|
84
|
+
/** 该段起点、终点的数值(起点靠近基线) */
|
|
85
|
+
from: number;
|
|
86
|
+
to: number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* 堆叠:series[s][c] 是第 s 个系列在第 c 个类目的值,返回同形状的 [from, to]。
|
|
90
|
+
* 正值从 0 向上累加、负值从 0 向下累加,两边互不干扰(否则正负相抵会让柱子长度不再等于数值)。
|
|
91
|
+
* 缺失值当作 0 高度但标记为 null,调用方可以据此不画。
|
|
92
|
+
*/
|
|
93
|
+
export declare function stack(series: Value[][]): (Stacked | null)[][];
|
|
94
|
+
/** 取数据范围(忽略缺失值);没有任何有效值返回 null */
|
|
95
|
+
export declare function extent(values: Value[]): [number, number] | null;
|
|
96
|
+
/**
|
|
97
|
+
* 柱子的路径:只有“数据端”(远离基线的一端)是圆角,靠基线的一端是直角,
|
|
98
|
+
* 这样柱子像是从基线上“长出来”的;圆角不能超过柱子自身的宽高。
|
|
99
|
+
*
|
|
100
|
+
* @param x 柱子左上角(竖直柱)或基线端(横向柱)的 x
|
|
101
|
+
* @param y 柱子左上角的 y
|
|
102
|
+
* @param width 宽
|
|
103
|
+
* @param height 高
|
|
104
|
+
* @param radius 圆角半径
|
|
105
|
+
* @param end 数据端在哪一侧:'top' 竖直向上长的柱(顶部圆角)、'bottom' 向下长的柱、'right' 横向向右长、'left' 向左长
|
|
106
|
+
*/
|
|
107
|
+
export declare function barPath(x: number, y: number, width: number, height: number, radius: number, end: 'top' | 'bottom' | 'left' | 'right'): string;
|
|
108
|
+
export interface Arc {
|
|
109
|
+
/** 在输入数组里的下标(值为 0 的项也保留下标,调用方据此对齐颜色和图例) */
|
|
110
|
+
index: number;
|
|
111
|
+
value: number;
|
|
112
|
+
/** 占总数的比例 0..1 */
|
|
113
|
+
ratio: number;
|
|
114
|
+
/** 起止角(弧度,12 点钟起顺时针) */
|
|
115
|
+
start: number;
|
|
116
|
+
end: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* 把一组数值换算成扇区的起止角。
|
|
120
|
+
* 负数和非数字当作 0(占比没有负数的意义);总和为 0 时返回空数组,由组件显示“暂无数据”。
|
|
121
|
+
*
|
|
122
|
+
* @param startAngle 整体起点,默认 0(正上方)
|
|
123
|
+
* @param sweep 整体总角度,默认一整圈;仪表用 270° 或 180°
|
|
124
|
+
*/
|
|
125
|
+
export declare function pieArcs(values: Value[], startAngle?: number, sweep?: number): Arc[];
|
|
126
|
+
/** 极坐标转直角坐标:角度从 12 点钟起顺时针 */
|
|
127
|
+
export declare function polar(cx: number, cy: number, radius: number, angle: number): Point;
|
|
128
|
+
/**
|
|
129
|
+
* 扇环(或扇形,inner 为 0)的路径。
|
|
130
|
+
* 一整圈(跨度 ≥ 360°)时 SVG 的单段圆弧起点终点重合会画不出来,要拆成两个半圈。
|
|
131
|
+
*/
|
|
132
|
+
export declare function arcPath(cx: number, cy: number, outer: number, inner: number, start: number, end: number): string;
|
|
133
|
+
/** 单条圆弧线(给进度环 / 仪表的轨道和进度用,配合 stroke 画,不闭合) */
|
|
134
|
+
export declare function arcStroke(cx: number, cy: number, radius: number, start: number, end: number): string;
|
|
135
|
+
/** 仪表的形状:整圈、270° 开口向下的表盘、180° 半圆 */
|
|
136
|
+
export type GaugeShape = 'ring' | 'gauge' | 'half';
|
|
137
|
+
/** 各形状的起点角与总跨度(弧度) */
|
|
138
|
+
export declare function gaugeSpan(shape: GaugeShape): {
|
|
139
|
+
start: number;
|
|
140
|
+
sweep: number;
|
|
141
|
+
};
|
|
142
|
+
/** 阈值:占比(0..100)达到 at 以上时使用 color;按 at 升序排列后取最后一个已达到的 */
|
|
143
|
+
export interface Threshold {
|
|
144
|
+
at: number;
|
|
145
|
+
color: string;
|
|
146
|
+
}
|
|
147
|
+
/** 按当前百分比取阈值颜色;没有阈值或一个都没达到时返回 fallback */
|
|
148
|
+
export declare function pickThreshold(percent: number, thresholds: Threshold[] | undefined, fallback: string): string;
|
|
149
|
+
/** 数值换成 0..100 的百分比:max 非正数、值缺失都当 0;超过范围截断 */
|
|
150
|
+
export declare function toPercent(value: Value, max: number): number;
|
|
151
|
+
/**
|
|
152
|
+
* 默认的数值格式:整数带千分位,小数最多保留 2 位;用 en-US 固定千分位写法,
|
|
153
|
+
* 不随浏览器地区变化(否则同一页面在不同电脑上轴标签宽度不一样,布局会漂)。
|
|
154
|
+
*/
|
|
155
|
+
export declare function formatNumber(value: number): string;
|
|
156
|
+
/** 大数缩写方案:从大到小排列的 [阈值, 后缀];按语言选用,见词条 campus.chart.compact */
|
|
157
|
+
export type CompactScheme = readonly (readonly [number, string])[];
|
|
158
|
+
/** 中文习惯:万、亿 */
|
|
159
|
+
export declare const COMPACT_CJK: CompactScheme;
|
|
160
|
+
/** 英文习惯:K、M、B */
|
|
161
|
+
export declare const COMPACT_LATIN: CompactScheme;
|
|
162
|
+
/** 轴上的紧凑格式:达到阈值就换成缩写(默认中文的万、亿),其余同 formatNumber */
|
|
163
|
+
export declare function formatCompact(value: number, scheme?: CompactScheme): string;
|
|
164
|
+
/** 某个系列的概览数据,给文字摘要用 */
|
|
165
|
+
export interface SeriesFacts {
|
|
166
|
+
/** 有效点数 */
|
|
167
|
+
count: number;
|
|
168
|
+
min: number;
|
|
169
|
+
max: number;
|
|
170
|
+
/** 最后一个有效值 */
|
|
171
|
+
last: number;
|
|
172
|
+
/** 最后一个有效值所在的类目下标 */
|
|
173
|
+
lastIndex: number;
|
|
174
|
+
}
|
|
175
|
+
/** 统计一个系列(忽略缺失值);一个有效值都没有返回 null */
|
|
176
|
+
export declare function seriesFacts(values: Value[]): SeriesFacts | null;
|
|
177
|
+
/** 占比格式:保留 1 位小数,整数不带 .0(31.0% → 31%) */
|
|
178
|
+
export declare function formatPercent(ratio: number): string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type GaugeShape, type Threshold, type Value } from '../chart-math.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
value: Value;
|
|
4
|
+
/** 满值,默认 100(此时 value 就是百分比) */
|
|
5
|
+
max?: number;
|
|
6
|
+
shape?: GaugeShape;
|
|
7
|
+
/** 直径(像素) */
|
|
8
|
+
size?: number;
|
|
9
|
+
/** 线宽(像素) */
|
|
10
|
+
thickness?: number;
|
|
11
|
+
label?: string;
|
|
12
|
+
/** 默认进度色(没有阈值或未达任何阈值时用),取色板第 1 色 */
|
|
13
|
+
color?: string;
|
|
14
|
+
thresholds?: Threshold[];
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
title?: string;
|
|
17
|
+
animated?: boolean;
|
|
18
|
+
};
|
|
19
|
+
declare var __VLS_1: {};
|
|
20
|
+
type __VLS_Slots = {} & {
|
|
21
|
+
center?: (props: typeof __VLS_1) => any;
|
|
22
|
+
};
|
|
23
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|