@gindow/element-go 1.0.0 → 1.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 +12 -12
- package/dist/resolver.cjs +1 -1
- package/dist/resolver.mjs +2 -2
- package/dist/src/components/ExAssetPreview.vue.d.ts +35 -0
- package/dist/src/components/ExButton.vue.d.ts +120 -0
- package/dist/src/components/ExEmpty.vue.d.ts +16 -0
- package/dist/src/components/ExForm.vue.d.ts +366 -0
- package/dist/src/components/ExFormField.vue.d.ts +25 -0
- package/dist/src/components/ExFormSearch.vue.d.ts +59 -0
- package/dist/src/components/ExFormViewer.vue.d.ts +116 -0
- package/dist/src/components/ExIcon.vue.d.ts +59 -0
- package/dist/src/components/ExInputPercentage.vue.d.ts +47 -0
- package/dist/src/components/ExLayout/account.vue.d.ts +2 -0
- package/dist/src/components/ExLayout/aside.vue.d.ts +61 -0
- package/dist/src/components/ExLayout/lang.vue.d.ts +23 -0
- package/dist/src/components/ExLayout.vue.d.ts +81 -0
- package/dist/src/components/ExLoading.vue.d.ts +23 -0
- package/dist/src/components/ExMenu.vue.d.ts +49 -0
- package/dist/src/components/ExPage.vue.d.ts +70 -0
- package/dist/src/components/ExPageHeader.vue.d.ts +45 -0
- package/dist/src/components/ExPagination.vue.d.ts +18 -0
- package/dist/src/components/ExSelect.vue.d.ts +58 -0
- package/dist/src/components/ExTable.vue.d.ts +1514 -0
- package/dist/src/components/ExTableColumn.vue.d.ts +155 -0
- package/dist/src/components/ExUpload.vue.d.ts +379 -0
- package/dist/src/components/ExUploadAsset.vue.d.ts +701 -0
- package/dist/src/components/vIcon.vue.d.ts +47 -0
- package/dist/src/hooks/useBreak.d.ts +4 -0
- package/dist/src/hooks/useChat.d.ts +72 -0
- package/dist/src/hooks/useIcon.d.ts +5 -0
- package/dist/src/hooks/useMessage.d.ts +12 -0
- package/dist/src/hooks/useNanoid.d.ts +5 -0
- package/dist/src/hooks/useUpload.d.ts +12 -0
- package/dist/src/index.d.ts +29 -0
- package/dist/src/locale/en-US.d.ts +50 -0
- package/dist/src/locale/index.d.ts +15 -0
- package/dist/src/locale/zh-CN.d.ts +50 -0
- package/dist/src/resolver.d.ts +19 -0
- package/dist/src/types/index.d.ts +76 -0
- package/dist/src/utils/datetime.d.ts +13 -0
- package/dist/src/utils/download.d.ts +1 -0
- package/dist/src/utils/formatter.d.ts +25 -0
- package/dist/src/utils/get.d.ts +1 -0
- package/dist/src/utils/index.d.ts +8 -0
- package/dist/src/utils/params.d.ts +8 -0
- package/dist/src/utils/platform.d.ts +11 -0
- package/dist/src/utils/request.d.ts +43 -0
- package/dist/src/utils/validate.d.ts +13 -0
- package/package.json +4 -4
- package/src/resolver.ts +8 -8
- package/dist/element-go.d.ts +0 -1
- package/dist/resolver.d.ts +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
2
|
+
vendor: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
default: string;
|
|
5
|
+
};
|
|
6
|
+
icon: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
size: {
|
|
11
|
+
type: NumberConstructor;
|
|
12
|
+
default: number;
|
|
13
|
+
};
|
|
14
|
+
strokeWidth: {
|
|
15
|
+
type: NumberConstructor;
|
|
16
|
+
default: number;
|
|
17
|
+
};
|
|
18
|
+
color: {
|
|
19
|
+
type: StringConstructor;
|
|
20
|
+
};
|
|
21
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<globalThis.ExtractPropTypes<{
|
|
22
|
+
vendor: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
default: string;
|
|
25
|
+
};
|
|
26
|
+
icon: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
default: string;
|
|
29
|
+
};
|
|
30
|
+
size: {
|
|
31
|
+
type: NumberConstructor;
|
|
32
|
+
default: number;
|
|
33
|
+
};
|
|
34
|
+
strokeWidth: {
|
|
35
|
+
type: NumberConstructor;
|
|
36
|
+
default: number;
|
|
37
|
+
};
|
|
38
|
+
color: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
};
|
|
41
|
+
}>> & Readonly<{}>, {
|
|
42
|
+
size: number;
|
|
43
|
+
icon: string;
|
|
44
|
+
vendor: string;
|
|
45
|
+
strokeWidth: number;
|
|
46
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
47
|
+
export default _default;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export interface IChatMessage {
|
|
2
|
+
question: string;
|
|
3
|
+
answer: string;
|
|
4
|
+
conversation_id: string;
|
|
5
|
+
message_id: string;
|
|
6
|
+
created_at: number;
|
|
7
|
+
}
|
|
8
|
+
export interface IMessageEvent {
|
|
9
|
+
event: 'message' | 'agent_message' | 'agent_thought' | 'message_file' | 'message_end' | 'tts_message' | 'tts_message_end' | 'message_replace' | 'error' | 'ping';
|
|
10
|
+
task_id: string;
|
|
11
|
+
id: string;
|
|
12
|
+
conversation_id: string;
|
|
13
|
+
message_id: string;
|
|
14
|
+
created_at: number;
|
|
15
|
+
answer?: string;
|
|
16
|
+
metadata?: Record<string, any>;
|
|
17
|
+
}
|
|
18
|
+
export interface IUsageEvent {
|
|
19
|
+
event: 'message_end';
|
|
20
|
+
task_id: string;
|
|
21
|
+
id: string;
|
|
22
|
+
conversation_id: string;
|
|
23
|
+
message_id: string;
|
|
24
|
+
created_at: number;
|
|
25
|
+
usage: {
|
|
26
|
+
prompt_tokens: number;
|
|
27
|
+
prompt_unit_price: number;
|
|
28
|
+
prompt_price_unit: number;
|
|
29
|
+
prompt_price: number;
|
|
30
|
+
completion_tokens: number;
|
|
31
|
+
completion_unit_price: number;
|
|
32
|
+
completion_price_unit: number;
|
|
33
|
+
completion_price: number;
|
|
34
|
+
total_tokens: number;
|
|
35
|
+
total_price: number;
|
|
36
|
+
currency: string;
|
|
37
|
+
latency: number;
|
|
38
|
+
};
|
|
39
|
+
metadata?: Record<string, any>;
|
|
40
|
+
}
|
|
41
|
+
export interface IErrorEvent {
|
|
42
|
+
event: 'error';
|
|
43
|
+
task_id: string;
|
|
44
|
+
id: string;
|
|
45
|
+
code: string;
|
|
46
|
+
message: string;
|
|
47
|
+
}
|
|
48
|
+
export interface ISendMessageParams {
|
|
49
|
+
query: string;
|
|
50
|
+
inputs?: Record<string, any>;
|
|
51
|
+
response_mode?: 'streaming' | 'blocking';
|
|
52
|
+
conversation_id?: string;
|
|
53
|
+
user: string;
|
|
54
|
+
files?: Array<{
|
|
55
|
+
type: string;
|
|
56
|
+
transfer_method: 'remote_url' | 'local_file';
|
|
57
|
+
url?: string;
|
|
58
|
+
upload_file_id?: string;
|
|
59
|
+
}>;
|
|
60
|
+
auto_generate_name?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export declare const useChat: (baseURL: string, apiKey: string) => {
|
|
63
|
+
sendMessage: (params: ISendMessageParams, callbacks: {
|
|
64
|
+
onMessage?: (text: string) => void;
|
|
65
|
+
onEnd?: (conversationId: string, messageId: string) => void;
|
|
66
|
+
onError?: (error: {
|
|
67
|
+
code: string;
|
|
68
|
+
message: string;
|
|
69
|
+
}) => void;
|
|
70
|
+
onFinish?: () => void;
|
|
71
|
+
}) => Promise<void>;
|
|
72
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
import { MessageOptions, ElMessageBoxOptions, NotificationOptions } from 'element-plus';
|
|
3
|
+
export declare const useMessage: () => {
|
|
4
|
+
message: (msg: string, options?: Partial<MessageOptions>) => import('element-plus').MessageHandler;
|
|
5
|
+
success: (msg: string, options?: Partial<MessageOptions>) => import('element-plus').MessageHandler;
|
|
6
|
+
error: (msg: string, options?: Partial<MessageOptions>) => import('element-plus').MessageHandler;
|
|
7
|
+
warning: (msg: string, options?: Partial<MessageOptions>) => import('element-plus').MessageHandler;
|
|
8
|
+
dialog: (msg: string, title?: string, options?: Partial<ElMessageBoxOptions>) => Promise<import('element-plus').MessageBoxData>;
|
|
9
|
+
confirm: (msg: string, title?: string, options?: Partial<ElMessageBoxOptions>) => Promise<import('element-plus').MessageBoxData>;
|
|
10
|
+
prompt: (msg: string | VNode, title?: string, options?: Partial<ElMessageBoxOptions>) => Promise<import('element-plus').MessageBoxData>;
|
|
11
|
+
notify: (msg: string, options?: Partial<NotificationOptions>) => import('element-plus').NotificationHandle;
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const useUpload: () => {
|
|
2
|
+
handler: (file: File, para?: {
|
|
3
|
+
compressor: boolean;
|
|
4
|
+
}) => Promise<File>;
|
|
5
|
+
getDimension: (blob: Blob) => Promise<{
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}>;
|
|
9
|
+
getFileType: (file: File) => Promise<{
|
|
10
|
+
mimeType: string;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
|
+
import { provider, setLocale, getLocale, useLocale } from './locale';
|
|
3
|
+
import { default as ExAssetPreview } from './components/ExAssetPreview.vue';
|
|
4
|
+
import { default as ExButton } from './components/ExButton.vue';
|
|
5
|
+
import { default as ExEmpty } from './components/ExEmpty.vue';
|
|
6
|
+
import { default as ExForm } from './components/ExForm.vue';
|
|
7
|
+
import { default as ExFormField } from './components/ExFormField.vue';
|
|
8
|
+
import { default as ExFormSearch } from './components/ExFormSearch.vue';
|
|
9
|
+
import { default as ExFormViewer } from './components/ExFormViewer.vue';
|
|
10
|
+
import { default as ExIcon } from './components/ExIcon.vue';
|
|
11
|
+
import { default as ExInputPercentage } from './components/ExInputPercentage.vue';
|
|
12
|
+
import { default as ExLayout } from './components/ExLayout.vue';
|
|
13
|
+
import { default as ExLoading } from './components/ExLoading.vue';
|
|
14
|
+
import { default as ExMenu } from './components/ExMenu.vue';
|
|
15
|
+
import { default as ExPage } from './components/ExPage.vue';
|
|
16
|
+
import { default as ExPageHeader } from './components/ExPageHeader.vue';
|
|
17
|
+
import { default as ExPagination } from './components/ExPagination.vue';
|
|
18
|
+
import { default as ExSelect } from './components/ExSelect.vue';
|
|
19
|
+
import { default as ExTable } from './components/ExTable.vue';
|
|
20
|
+
import { default as ExTableColumn } from './components/ExTableColumn.vue';
|
|
21
|
+
import { default as ExUpload } from './components/ExUpload.vue';
|
|
22
|
+
import { default as ExUploadAsset } from './components/ExUploadAsset.vue';
|
|
23
|
+
export * from './types';
|
|
24
|
+
export { useMessage } from './hooks/useMessage';
|
|
25
|
+
export { useNanoid } from './hooks/useNanoid';
|
|
26
|
+
export { useIcon } from './hooks/useIcon';
|
|
27
|
+
declare const ElementGo: Plugin;
|
|
28
|
+
export default ElementGo;
|
|
29
|
+
export { ExAssetPreview, ExButton, ExEmpty, ExForm, ExFormField, ExFormSearch, ExFormViewer, ExIcon, ExInputPercentage, ExLayout, ExLoading, ExMenu, ExPage, ExPageHeader, ExPagination, ExSelect, ExTable, ExTableColumn, ExUpload, ExUploadAsset, provider, setLocale, getLocale, useLocale, };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
core: {
|
|
3
|
+
back: string;
|
|
4
|
+
save: string;
|
|
5
|
+
cancel: string;
|
|
6
|
+
reset: string;
|
|
7
|
+
search: string;
|
|
8
|
+
keywords: string;
|
|
9
|
+
upload: string;
|
|
10
|
+
confirm: string;
|
|
11
|
+
phoneNumber: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
noPermission: string;
|
|
14
|
+
create: string;
|
|
15
|
+
edit: string;
|
|
16
|
+
delete: string;
|
|
17
|
+
sort: string;
|
|
18
|
+
logout: string;
|
|
19
|
+
profile: string;
|
|
20
|
+
password: string;
|
|
21
|
+
datetime: {
|
|
22
|
+
to: string;
|
|
23
|
+
start: string;
|
|
24
|
+
end: string;
|
|
25
|
+
yesterday: string;
|
|
26
|
+
today: string;
|
|
27
|
+
thisWeek: string;
|
|
28
|
+
thisMonth: string;
|
|
29
|
+
thisYear: string;
|
|
30
|
+
};
|
|
31
|
+
message: {
|
|
32
|
+
successful: string;
|
|
33
|
+
downloadFailed: string;
|
|
34
|
+
tooLarge: string;
|
|
35
|
+
fileExceed: string;
|
|
36
|
+
confirm: string;
|
|
37
|
+
delConfirm: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
empty: {
|
|
41
|
+
noData: string;
|
|
42
|
+
};
|
|
43
|
+
dialog: {
|
|
44
|
+
tip: string;
|
|
45
|
+
confirm: string;
|
|
46
|
+
prompt: string;
|
|
47
|
+
required: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type Messages = Record<string, any>;
|
|
2
|
+
export declare const provider: (opts?: {
|
|
3
|
+
locale?: string;
|
|
4
|
+
messages?: Messages;
|
|
5
|
+
}) => {
|
|
6
|
+
locale: globalThis.Ref<string, string>;
|
|
7
|
+
messages: Messages;
|
|
8
|
+
};
|
|
9
|
+
export declare const useLocale: () => {
|
|
10
|
+
locale: globalThis.Ref<string, string>;
|
|
11
|
+
t: (path: string, params?: Record<string, string | number>) => string;
|
|
12
|
+
};
|
|
13
|
+
export declare const setLocale: (lang: string) => string;
|
|
14
|
+
export declare const getLocale: () => string;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
core: {
|
|
3
|
+
back: string;
|
|
4
|
+
save: string;
|
|
5
|
+
cancel: string;
|
|
6
|
+
reset: string;
|
|
7
|
+
search: string;
|
|
8
|
+
keywords: string;
|
|
9
|
+
upload: string;
|
|
10
|
+
confirm: string;
|
|
11
|
+
phoneNumber: string;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
noPermission: string;
|
|
14
|
+
create: string;
|
|
15
|
+
edit: string;
|
|
16
|
+
delete: string;
|
|
17
|
+
sort: string;
|
|
18
|
+
logout: string;
|
|
19
|
+
profile: string;
|
|
20
|
+
password: string;
|
|
21
|
+
datetime: {
|
|
22
|
+
to: string;
|
|
23
|
+
start: string;
|
|
24
|
+
end: string;
|
|
25
|
+
yesterday: string;
|
|
26
|
+
today: string;
|
|
27
|
+
thisWeek: string;
|
|
28
|
+
thisMonth: string;
|
|
29
|
+
thisYear: string;
|
|
30
|
+
};
|
|
31
|
+
message: {
|
|
32
|
+
successful: string;
|
|
33
|
+
downloadFailed: string;
|
|
34
|
+
tooLarge: string;
|
|
35
|
+
fileExceed: string;
|
|
36
|
+
confirm: string;
|
|
37
|
+
delConfirm: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
empty: {
|
|
41
|
+
noData: string;
|
|
42
|
+
};
|
|
43
|
+
dialog: {
|
|
44
|
+
tip: string;
|
|
45
|
+
confirm: string;
|
|
46
|
+
prompt: string;
|
|
47
|
+
required: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface ElementGoResolverOptions {
|
|
2
|
+
/**
|
|
3
|
+
* 是否自动导入 @gindow/element-go 的聚合样式文件。
|
|
4
|
+
* 默认 true:每次解析到 Ex* 组件时附带 `@gindow/element-go/styles/index.css` 副作用导入
|
|
5
|
+
* (unplugin-vue-components 会去重,不会重复打包)。
|
|
6
|
+
* 设为 false 时需在应用入口手动 `import '@gindow/element-go/styles/index.css'`。
|
|
7
|
+
*/
|
|
8
|
+
importStyle?: boolean;
|
|
9
|
+
/** 自定义前缀,默认 'Ex' */
|
|
10
|
+
prefix?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function ElementGoResolver(options?: ElementGoResolverOptions): {
|
|
13
|
+
type: "component";
|
|
14
|
+
resolve(name: string): {
|
|
15
|
+
name: string;
|
|
16
|
+
from: string;
|
|
17
|
+
sideEffects: string | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { FormItemRule, UploadUserFile } from 'element-plus';
|
|
2
|
+
export interface IModel {
|
|
3
|
+
id?: string | any;
|
|
4
|
+
created_at?: string;
|
|
5
|
+
updated_at?: string;
|
|
6
|
+
deleted_at?: string;
|
|
7
|
+
[property: string]: any;
|
|
8
|
+
}
|
|
9
|
+
export interface IField extends IModel {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
options?: {
|
|
16
|
+
label: string;
|
|
17
|
+
value: string;
|
|
18
|
+
}[] | any[];
|
|
19
|
+
component?: any;
|
|
20
|
+
}
|
|
21
|
+
export type IFilter = Omit<IField, 'name'> & {
|
|
22
|
+
label?: string;
|
|
23
|
+
rules?: FormItemRule[];
|
|
24
|
+
};
|
|
25
|
+
export interface IParams extends IModel {
|
|
26
|
+
filter?: Object;
|
|
27
|
+
search?: string;
|
|
28
|
+
include?: string;
|
|
29
|
+
page?: number;
|
|
30
|
+
size?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface IPagination {
|
|
33
|
+
current_page: number;
|
|
34
|
+
per_page: number;
|
|
35
|
+
count: number;
|
|
36
|
+
total: number;
|
|
37
|
+
total_pages: number;
|
|
38
|
+
}
|
|
39
|
+
export interface IResult {
|
|
40
|
+
code: number;
|
|
41
|
+
message: string;
|
|
42
|
+
data?: IModel | IModel[] | null;
|
|
43
|
+
meta?: {
|
|
44
|
+
pagination?: IPagination;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export interface IAsset extends IModel {
|
|
48
|
+
id: string;
|
|
49
|
+
type: string;
|
|
50
|
+
title: string;
|
|
51
|
+
url: string;
|
|
52
|
+
shrink: string;
|
|
53
|
+
}
|
|
54
|
+
export interface IUploadUserFile extends UploadUserFile {
|
|
55
|
+
id?: string;
|
|
56
|
+
percentage?: number;
|
|
57
|
+
asset?: IAsset;
|
|
58
|
+
title?: string;
|
|
59
|
+
width?: number;
|
|
60
|
+
height?: number;
|
|
61
|
+
type?: string;
|
|
62
|
+
mimeType?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface IMenu {
|
|
65
|
+
key?: string;
|
|
66
|
+
title: string;
|
|
67
|
+
path: string;
|
|
68
|
+
name?: string;
|
|
69
|
+
icon?: string;
|
|
70
|
+
depend?: string;
|
|
71
|
+
hidden?: boolean;
|
|
72
|
+
divider?: boolean;
|
|
73
|
+
disabled?: boolean;
|
|
74
|
+
children?: IMenu[];
|
|
75
|
+
isGroup?: boolean;
|
|
76
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as dayjs } from 'dayjs';
|
|
2
|
+
export declare class DateTime {
|
|
3
|
+
static dayjs: typeof dayjs;
|
|
4
|
+
static s(date?: dayjs.ConfigType, symbol?: string): string;
|
|
5
|
+
static m(date?: dayjs.ConfigType, symbol?: string): string;
|
|
6
|
+
static h(date?: dayjs.ConfigType, symbol?: string): string;
|
|
7
|
+
static d(date?: dayjs.ConfigType, symbol?: string): string;
|
|
8
|
+
static M(date?: dayjs.ConfigType, symbol?: string): string;
|
|
9
|
+
static y(date?: dayjs.ConfigType): string;
|
|
10
|
+
static date(date?: dayjs.ConfigType, symbol?: string): string;
|
|
11
|
+
static time(date?: dayjs.ConfigType): string;
|
|
12
|
+
static format(date?: dayjs.ConfigType, format?: string): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const download: (blob: Blob, filename: string) => void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare class Formatter {
|
|
2
|
+
static config: {
|
|
3
|
+
locale?: string;
|
|
4
|
+
currency?: string;
|
|
5
|
+
decimals?: number;
|
|
6
|
+
};
|
|
7
|
+
static set: (config: {
|
|
8
|
+
locale?: string;
|
|
9
|
+
currency?: string;
|
|
10
|
+
decimals?: number;
|
|
11
|
+
}) => {
|
|
12
|
+
locale?: string;
|
|
13
|
+
currency?: string;
|
|
14
|
+
decimals?: number;
|
|
15
|
+
};
|
|
16
|
+
static id: (str?: string) => string;
|
|
17
|
+
static date: (datestr?: string) => string;
|
|
18
|
+
static idcard: (idcard?: string) => string;
|
|
19
|
+
static phone: (phone?: string, naked?: boolean) => string;
|
|
20
|
+
static email: (email?: string) => string;
|
|
21
|
+
static bankcard: (bankcard?: string) => string;
|
|
22
|
+
static url: (url?: string) => string;
|
|
23
|
+
static price: (value?: string | number, currency?: string) => string;
|
|
24
|
+
static currency: (value?: string | number, currency?: string) => string;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const get: (object: any, path: string | string[], defaultValue?: any) => any;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { request } from './request';
|
|
2
|
+
export { get } from './get';
|
|
3
|
+
export { download } from './download';
|
|
4
|
+
export { Formatter } from './formatter';
|
|
5
|
+
export { Validate } from './validate';
|
|
6
|
+
export { DateTime } from './datetime';
|
|
7
|
+
export { Platform } from './platform';
|
|
8
|
+
export { $params } from './params';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class Platform {
|
|
2
|
+
static get userAgent(): string;
|
|
3
|
+
static get isFlutter(): boolean;
|
|
4
|
+
static get isFlutterIOS(): boolean;
|
|
5
|
+
static get isWeb(): boolean;
|
|
6
|
+
static get isMobile(): boolean;
|
|
7
|
+
static get isIOS(): boolean;
|
|
8
|
+
static get isWechat(): boolean;
|
|
9
|
+
static get isWxwork(): boolean;
|
|
10
|
+
static get isMiniprogram(): boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
+
export declare const request: {
|
|
3
|
+
baseURL: string;
|
|
4
|
+
publicKey: string;
|
|
5
|
+
headers: Record<string, string>;
|
|
6
|
+
instance: AxiosInstance | null;
|
|
7
|
+
accessToken: string;
|
|
8
|
+
init(config?: {
|
|
9
|
+
baseURL?: string;
|
|
10
|
+
publicKey?: string;
|
|
11
|
+
}): void;
|
|
12
|
+
setToken(token: string, options?: {
|
|
13
|
+
expires?: number;
|
|
14
|
+
domain?: string;
|
|
15
|
+
}): void;
|
|
16
|
+
getToken(): string;
|
|
17
|
+
delToken(): void;
|
|
18
|
+
get(url: string, params?: {}, auth?: boolean): any;
|
|
19
|
+
put(url: string, data?: {}, auth?: boolean): any;
|
|
20
|
+
patch(url: string, data?: {}, auth?: boolean): any;
|
|
21
|
+
delete(url: string, params?: {}, auth?: boolean): any;
|
|
22
|
+
post(url: string, data?: {}, auth?: boolean): any;
|
|
23
|
+
blob(url: string, params?: {}, auth?: boolean): any;
|
|
24
|
+
request(para: any, auth?: boolean): any;
|
|
25
|
+
download(url: string, params?: {}, filename?: string, auth?: boolean): Promise<any>;
|
|
26
|
+
upload(url: string, data?: {}): Promise<AxiosResponse<any, any, {}>>;
|
|
27
|
+
sse(url: string, para?: {
|
|
28
|
+
[key: string]: string | number | undefined | null | void;
|
|
29
|
+
} | null): EventSource;
|
|
30
|
+
setHeader(key: string, value: string): void;
|
|
31
|
+
delHeader(key: string): void;
|
|
32
|
+
};
|
|
33
|
+
export declare class resource {
|
|
34
|
+
url: string;
|
|
35
|
+
auth: boolean;
|
|
36
|
+
constructor(url: string, auth?: boolean);
|
|
37
|
+
select: (para?: {}) => any;
|
|
38
|
+
create: (para?: {}) => any;
|
|
39
|
+
find: (id: string, para?: {}) => any;
|
|
40
|
+
update: (id: string, para?: {}) => any;
|
|
41
|
+
delete: (id: string, para?: {}) => any;
|
|
42
|
+
get(para: any): Promise<any>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class Validate {
|
|
2
|
+
static country: string;
|
|
3
|
+
static set: (country: string) => string;
|
|
4
|
+
static get phone_pattern(): RegExp;
|
|
5
|
+
static email_pattern: RegExp;
|
|
6
|
+
static idcard_pattern: RegExp;
|
|
7
|
+
static cname_pattern: RegExp;
|
|
8
|
+
static password_pattern: RegExp;
|
|
9
|
+
static phone: (str: string) => boolean;
|
|
10
|
+
static email: (str: string) => boolean;
|
|
11
|
+
static idcard: (str: string) => boolean;
|
|
12
|
+
static cname: (str: string) => boolean;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gindow/element-go",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "基于 Element Plus 的桌面端扩展组件库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "./dist/element-go.cjs",
|
|
8
|
-
"types": "./dist/
|
|
8
|
+
"types": "./dist/src/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"types": "./dist/
|
|
11
|
+
"types": "./dist/src/index.d.ts",
|
|
12
12
|
"import": "./dist/element-go.mjs",
|
|
13
13
|
"require": "./dist/element-go.cjs"
|
|
14
14
|
},
|
|
15
15
|
"./resolver": {
|
|
16
|
-
"types": "./dist/resolver.d.ts",
|
|
16
|
+
"types": "./dist/src/resolver.d.ts",
|
|
17
17
|
"import": "./dist/resolver.mjs",
|
|
18
18
|
"require": "./dist/resolver.cjs"
|
|
19
19
|
},
|
package/src/resolver.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export interface ElementGoResolverOptions {
|
|
2
2
|
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
* 是否自动导入 @gindow/element-go 的聚合样式文件。
|
|
4
|
+
* 默认 true:每次解析到 Ex* 组件时附带 `@gindow/element-go/styles/index.css` 副作用导入
|
|
5
|
+
* (unplugin-vue-components 会去重,不会重复打包)。
|
|
6
|
+
* 设为 false 时需在应用入口手动 `import '@gindow/element-go/styles/index.css'`。
|
|
7
|
+
*/
|
|
8
|
+
importStyle?: boolean
|
|
9
9
|
/** 自定义前缀,默认 'Ex' */
|
|
10
10
|
prefix?: string
|
|
11
11
|
}
|
|
@@ -18,8 +18,8 @@ export function ElementGoResolver(options: ElementGoResolverOptions = {}) {
|
|
|
18
18
|
if (!name.startsWith(prefix)) return
|
|
19
19
|
return {
|
|
20
20
|
name,
|
|
21
|
-
from: 'element-go',
|
|
22
|
-
sideEffects: importStyle ? 'element-go/styles/index.css' : undefined,
|
|
21
|
+
from: '@gindow/element-go',
|
|
22
|
+
sideEffects: importStyle ? '@gindow/element-go/styles/index.css' : undefined,
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
}
|
package/dist/element-go.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { }
|
package/dist/resolver.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { }
|