@kengic/vue 0.25.1 → 0.25.2-beta.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,185 @@
1
+ import type { ComponentPublicInstance, ComponentRenderProxy, FunctionalComponent, PropType as VuePropType, VNode, VNodeChild } from 'vue';
2
+
3
+ declare global {
4
+ const __APP_INFO__: {
5
+ pkg: {
6
+ name: string;
7
+ version: string;
8
+ dependencies: Recordable<string>;
9
+ devDependencies: Recordable<string>;
10
+ };
11
+ lastBuildTime: string;
12
+ };
13
+ // declare interface Window {
14
+ // // Global vue app instance
15
+ // __APP__: App<Element>;
16
+ // }
17
+
18
+ // vue
19
+ declare type VueNode = VNodeChild | JSX.Element;
20
+
21
+ export type Writable<T> = {
22
+ -readonly [P in keyof T]: T[P];
23
+ };
24
+
25
+ declare type Nullable<T> = T | null;
26
+ declare type NonNullable<T> = T extends null | undefined ? never : T;
27
+ declare type Recordable<T = any> = Record<string, T>;
28
+ declare type ReadonlyRecordable<T = any> = {
29
+ readonly [key: string]: T;
30
+ };
31
+ declare type Indexable<T = any> = {
32
+ [key: string]: T;
33
+ };
34
+ declare type DeepPartial<T> = {
35
+ [P in keyof T]?: DeepPartial<T[P]>;
36
+ };
37
+ declare type TimeoutHandle = ReturnType<typeof setTimeout>;
38
+ declare type IntervalHandle = ReturnType<typeof setInterval>;
39
+
40
+ declare interface ChangeEvent extends Event {
41
+ target: HTMLInputElement;
42
+ }
43
+
44
+ declare interface WheelEvent {
45
+ path?: EventTarget[];
46
+ }
47
+
48
+ interface ImportMetaEnv extends ViteEnv {
49
+ __: unknown;
50
+ }
51
+
52
+ declare interface ViteEnv {
53
+ VITE_PORT: number;
54
+ VITE_USE_MOCK: boolean;
55
+ VITE_USE_PWA: boolean;
56
+ VITE_PUBLIC_PATH: string;
57
+ VITE_PROXY: [string, string][];
58
+ VITE_GLOB_APP_TITLE: string;
59
+ VITE_GLOB_APP_SHORT_NAME: string;
60
+ VITE_USE_CDN: boolean;
61
+ VITE_DROP_CONSOLE: boolean;
62
+ VITE_BUILD_COMPRESS: 'gzip' | 'brotli' | 'none';
63
+ VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE: boolean;
64
+ VITE_LEGACY: boolean;
65
+ VITE_USE_IMAGEMIN: boolean;
66
+ VITE_GENERATE_UI: string;
67
+ }
68
+
69
+ declare function parseInt(s: string | number, radix?: number): number;
70
+
71
+ declare function parseFloat(string: string | number): number;
72
+
73
+ declare interface Fn<T = any, R = T> {
74
+ (...arg: T[]): R;
75
+ }
76
+
77
+ declare interface PromiseFn<T = any, R = T> {
78
+ (...arg: T[]): Promise<R>;
79
+ }
80
+
81
+ declare type RefType<T> = T | null;
82
+
83
+ declare type LabelValueOptions = {
84
+ label: string;
85
+ value: any;
86
+ [key: string]: string | number | boolean;
87
+ }[];
88
+
89
+ declare type EmitType = (event: string, ...args: any[]) => void;
90
+ declare type TargetContext = '_self' | '_blank';
91
+
92
+ declare type ComponentRef<T extends HTMLElement = HTMLDivElement> = ComponentElRef<T> | null;
93
+ declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
94
+ declare type PropType<T> = VuePropType<T>;
95
+
96
+ declare interface ComponentElRef<T extends HTMLElement = HTMLDivElement> {
97
+ $el: T;
98
+ }
99
+
100
+ namespace JSX {
101
+ // tslint:disable no-empty-interface
102
+ type Element = VNode;
103
+ // tslint:disable no-empty-interface
104
+ type ElementClass = ComponentRenderProxy;
105
+
106
+ interface ElementAttributesProperty {
107
+ $props: any;
108
+ }
109
+
110
+ interface IntrinsicElements {
111
+ [elem: string]: any;
112
+ }
113
+
114
+ interface IntrinsicAttributes {
115
+ [elem: string]: any;
116
+ }
117
+ }
118
+ }
119
+
120
+ declare module 'vue' {
121
+ export type JSXComponent<Props = any> = { new (): ComponentPublicInstance<Props> } | FunctionalComponent<Props>;
122
+ }
123
+
124
+ declare module '*.vue' {
125
+ import { DefineComponent } from 'vue';
126
+ const Component: DefineComponent<{}, {}, any>;
127
+ export default Component;
128
+ }
129
+
130
+ declare module 'ant-design-vue/dist/theme';
131
+
132
+ declare module 'ant-design-vue/es/locale/*' {
133
+ import { Locale } from 'ant-design-vue/types/locale-provider';
134
+ const locale: Locale & ReadonlyRecordable;
135
+ export default locale as Locale & ReadonlyRecordable;
136
+ }
137
+
138
+ declare module 'virtual:*' {
139
+ const result: any;
140
+ export default result;
141
+ }
142
+
143
+ declare module 'vue-router' {
144
+ interface RouteMeta extends Record<string | number | symbol, unknown> {
145
+ orderNo?: number;
146
+ // title
147
+ title: string;
148
+ // dynamic router level.
149
+ dynamicLevel?: number;
150
+ // dynamic router real route path (For performance).
151
+ realPath?: string;
152
+ // Whether to ignore permissions
153
+ ignoreAuth?: boolean;
154
+ // role info
155
+ roles?: RoleEnum[];
156
+ // Whether not to cache
157
+ ignoreKeepAlive?: boolean;
158
+ // Is it fixed on tab
159
+ affix?: boolean;
160
+ // icon on tab
161
+ icon?: string;
162
+ frameSrc?: string;
163
+ // current page transition
164
+ transitionName?: string;
165
+ // Whether the route has been dynamically added
166
+ hideBreadcrumb?: boolean;
167
+ // Hide submenu
168
+ hideChildrenInMenu?: boolean;
169
+ // Carrying parameters
170
+ carryParam?: boolean;
171
+ // Used internally to mark single-level menus
172
+ single?: boolean;
173
+ // Currently active menu
174
+ currentActiveMenu?: string;
175
+ // Never show in tab
176
+ hideTab?: boolean;
177
+ // Never show in menu
178
+ hideMenu?: boolean;
179
+ isLink?: boolean;
180
+ // only build for Menu
181
+ ignoreRoute?: boolean;
182
+ // Hide path for children
183
+ hidePathForChildren?: boolean;
184
+ }
185
+ }
@@ -615,7 +615,7 @@ export declare class VarGridConfig {
615
615
  cmd_prm?: string | null;
616
616
  /** 是否将排序字段转换为 under_score 命名方式. */
617
617
  convert_sort_field_to_under_score_flg?: number | null;
618
- /** 行展开是否使用手风琴风格(一次只能展开一行). */
618
+ /** 是否一次只能展开一行. */
619
619
  expand_accordion_flg?: number | null;
620
620
  /** 界面标识(FormID). */
621
621
  frm_id?: string | null;
@@ -174,6 +174,23 @@ export declare const enum KG__VAR_GRID_DETAIL__ALIGN {
174
174
  CENTER = "center",
175
175
  RIGHT = "right"
176
176
  }
177
+ /**
178
+ * 单击某行时的操作.
179
+ */
180
+ export declare const enum KG__VAR_GRID_CONFIG__OPERATION_ON_ROW_CLICK {
181
+ /**
182
+ * 不做操作.
183
+ */
184
+ A = 0,
185
+ /**
186
+ * 勾选该行, 并取消其他勾选行.
187
+ */
188
+ B = 1,
189
+ /**
190
+ * 勾选该行, 并保留其他勾选行.
191
+ */
192
+ C = 2
193
+ }
177
194
  /** @deprecated 已弃用, 请使用 {@link KG__VAR_BUTTON__TYPE}. */
178
195
  export declare const enum KG_BUTTON_TYPE {
179
196
  /** 查询. */
@@ -1 +1,2 @@
1
1
  export * from './src';
2
+ export * from './types';
@@ -0,0 +1,35 @@
1
+ export declare type ErrorMessageMode = 'none' | 'modal' | 'message' | undefined;
2
+ export declare type SuccessMessageMode = 'none' | 'success' | 'error' | undefined;
3
+ export interface RequestOptions {
4
+ joinParamsToUrl?: boolean;
5
+ formatDate?: boolean;
6
+ isTransformResponse?: boolean;
7
+ isReturnNativeResponse?: boolean;
8
+ joinPrefix?: boolean;
9
+ apiUrl?: string;
10
+ urlPrefix?: string;
11
+ errorMessageMode?: ErrorMessageMode;
12
+ successMessageMode?: SuccessMessageMode;
13
+ joinTime?: boolean;
14
+ ignoreCancelToken?: boolean;
15
+ withToken?: boolean;
16
+ }
17
+ export interface Result<T = any> {
18
+ code: number;
19
+ type: 'success' | 'error' | 'warning';
20
+ message: string;
21
+ success?: boolean | null;
22
+ timestamp?: number | null;
23
+ result: T;
24
+ }
25
+ export interface UploadFileParams {
26
+ data?: Recordable;
27
+ name?: string;
28
+ file: File | Blob;
29
+ filename?: string;
30
+ [key: string]: any;
31
+ }
32
+ export interface UploadFileCallBack {
33
+ success?: any;
34
+ isReturnResponse?: boolean;
35
+ }
@@ -0,0 +1,109 @@
1
+ import { ContentEnum, PermissionModeEnum, RouterTransitionEnum, SessionTimeoutProcessingEnum, SettingButtonPositionEnum, ThemeEnum } from '../src/enums/appEnum';
2
+ import { CacheTypeEnum } from '../src/enums/cacheEnum';
3
+ import { MenuModeEnum, MenuTypeEnum, MixSidebarTriggerEnum, TriggerEnum } from '../src/enums/menuEnum';
4
+ export declare type LocaleType = 'zh_CN' | 'en' | 'ru' | 'ja' | 'ko';
5
+ export interface MenuSetting {
6
+ bgColor: string;
7
+ fixed: boolean;
8
+ collapsed: boolean;
9
+ canDrag: boolean;
10
+ show: boolean;
11
+ hidden: boolean;
12
+ split: boolean;
13
+ menuWidth: number;
14
+ mode: MenuModeEnum;
15
+ type: MenuTypeEnum;
16
+ theme: ThemeEnum;
17
+ topMenuAlign: 'start' | 'center' | 'end';
18
+ trigger: TriggerEnum;
19
+ accordion: boolean;
20
+ closeMixSidebarOnChange: boolean;
21
+ collapsedShowTitle: boolean;
22
+ mixSideTrigger: MixSidebarTriggerEnum;
23
+ mixSideFixed: boolean;
24
+ }
25
+ export interface MultiTabsSetting {
26
+ cache: boolean;
27
+ show: boolean;
28
+ showQuick: boolean;
29
+ canDrag: boolean;
30
+ showRedo: boolean;
31
+ showFold: boolean;
32
+ theme: string;
33
+ }
34
+ export interface HeaderSetting {
35
+ bgColor: string;
36
+ fixed: boolean;
37
+ show: boolean;
38
+ theme: ThemeEnum;
39
+ showFullScreen: boolean;
40
+ useLockPage: boolean;
41
+ showDoc: boolean;
42
+ showNotice: boolean;
43
+ showSearch: boolean;
44
+ }
45
+ export interface LocaleSetting {
46
+ showPicker: boolean;
47
+ locale: LocaleType;
48
+ fallback: LocaleType;
49
+ availableLocales: LocaleType[];
50
+ }
51
+ export interface TransitionSetting {
52
+ enable: boolean;
53
+ basicTransition: RouterTransitionEnum;
54
+ openPageLoading: boolean;
55
+ openNProgress: boolean;
56
+ }
57
+ export interface ProjectConfig {
58
+ permissionCacheType: CacheTypeEnum;
59
+ showSettingButton: boolean;
60
+ showDarkModeToggle: boolean;
61
+ settingButtonPosition: SettingButtonPositionEnum;
62
+ permissionMode: PermissionModeEnum;
63
+ sessionTimeoutProcessing: SessionTimeoutProcessingEnum;
64
+ grayMode: boolean;
65
+ colorWeak: boolean;
66
+ themeColor: string;
67
+ fullContent: boolean;
68
+ contentMode: ContentEnum;
69
+ showLogo: boolean;
70
+ showFooter: boolean;
71
+ headerSetting: HeaderSetting;
72
+ menuSetting: MenuSetting;
73
+ multiTabsSetting: MultiTabsSetting;
74
+ transitionSetting: TransitionSetting;
75
+ openKeepAlive: boolean;
76
+ lockTime: number;
77
+ showBreadCrumb: boolean;
78
+ showBreadCrumbIcon: boolean;
79
+ useErrorHandle: boolean;
80
+ useOpenBackTop: boolean;
81
+ canEmbedIFramePage: boolean;
82
+ closeMessageOnSwitch: boolean;
83
+ removeAllHttpPending: boolean;
84
+ }
85
+ export interface GlobConfig {
86
+ title: string;
87
+ apiUrl: string;
88
+ domainUrl: string;
89
+ uploadUrl?: string;
90
+ openSso?: string;
91
+ openQianKun?: string;
92
+ casBaseUrl?: string;
93
+ viewUrl?: string;
94
+ urlPrefix?: string;
95
+ shortName: string;
96
+ }
97
+ export interface GlobEnvConfig {
98
+ VITE_GLOB_APP_TITLE: string;
99
+ VITE_GLOB_API_URL: string;
100
+ VITE_USE_MOCK: string;
101
+ VITE_GLOB_API_URL_PREFIX?: string;
102
+ VITE_GLOB_APP_SHORT_NAME: string;
103
+ VITE_GLOB_APP_OPEN_SSO: string;
104
+ VITE_GLOB_APP_OPEN_QIANKUN: string;
105
+ VITE_GLOB_APP_CAS_BASE_URL: string;
106
+ VITE_GLOB_DOMAIN_URL: string;
107
+ VITE_GLOB_UPLOAD_URL?: string;
108
+ VITE_GLOB_ONLINE_VIEW_URL?: string;
109
+ }
@@ -0,0 +1,4 @@
1
+ export * from './axios';
2
+ export * from './config';
3
+ export * from './store';
4
+ export * from './utils';
@@ -0,0 +1,42 @@
1
+ import { RoleInfo } from '../src/api/sys/model/userModel';
2
+ import { ErrorTypeEnum } from '../src/enums/exceptionEnum';
3
+ import { MenuModeEnum, MenuTypeEnum } from '../src/enums/menuEnum';
4
+ export interface LockInfo {
5
+ pwd?: string | undefined;
6
+ isLock?: boolean;
7
+ }
8
+ export interface ErrorLogInfo {
9
+ type: ErrorTypeEnum;
10
+ file: string;
11
+ name?: string;
12
+ message: string;
13
+ stack?: string;
14
+ detail: string;
15
+ url: string;
16
+ time?: string;
17
+ }
18
+ export interface UserInfo {
19
+ id: string | number;
20
+ userId: string | number;
21
+ username: string;
22
+ realname: string;
23
+ avatar: string;
24
+ desc?: string;
25
+ homePath?: string;
26
+ tenantid?: string | number;
27
+ roles: RoleInfo[];
28
+ orgCode?: string;
29
+ }
30
+ export interface LoginInfo {
31
+ multi_depart?: string | number;
32
+ userInfo?: object;
33
+ departs?: [];
34
+ tenantList?: [];
35
+ isLogin?: boolean;
36
+ }
37
+ export interface BeforeMiniState {
38
+ menuCollapsed?: boolean;
39
+ menuSplit?: boolean;
40
+ menuMode?: MenuModeEnum;
41
+ menuType?: MenuTypeEnum;
42
+ }
@@ -0,0 +1,4 @@
1
+ import type { ComputedRef, Ref } from 'vue';
2
+ export declare type DynamicProps<T> = {
3
+ [P in keyof T]: Ref<T[P]> | T[P] | ComputedRef<T[P]>;
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/vue",
3
- "version": "0.25.1",
3
+ "version": "0.25.2-beta.1",
4
4
  "scripts": {
5
5
  "build": "npm run switch-node-version && rimraf dist && vue-tsc && vite build",
6
6
  "build:dev": "npm run switch-node-version && rimraf dist && vue-tsc && vite build --mode development",