@mc-markets/ui 1.0.0

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.
Files changed (36) hide show
  1. package/README.md +502 -0
  2. package/dist/index.js +23 -0
  3. package/dist/packages/components/Dialog/index.vue.d.ts +51 -0
  4. package/dist/packages/components/Grid/components/GridItem.vue.d.ts +37 -0
  5. package/dist/packages/components/Grid/index.vue.d.ts +31 -0
  6. package/dist/packages/components/Grid/interface/index.d.ts +5 -0
  7. package/dist/packages/components/Icon/index.vue.d.ts +2 -0
  8. package/dist/packages/components/SearchBar/index.vue.d.ts +42 -0
  9. package/dist/packages/components/SearchForm/components/SearchFormItem.vue.d.ts +24 -0
  10. package/dist/packages/components/SearchForm/index.vue.d.ts +3019 -0
  11. package/dist/packages/components/proForm/components/FormItem.vue.d.ts +46 -0
  12. package/dist/packages/components/proForm/components/interface/index.d.ts +66 -0
  13. package/dist/packages/components/proForm/index.vue.d.ts +230 -0
  14. package/dist/packages/components/proTable/components/ColSetting.vue.d.ts +8 -0
  15. package/dist/packages/components/proTable/components/Pagination.vue.d.ts +17 -0
  16. package/dist/packages/components/proTable/components/TableColumn.vue.d.ts +6 -0
  17. package/dist/packages/components/proTable/interface/index.d.ts +66 -0
  18. package/dist/packages/hooks/interface/index.d.ts +28 -0
  19. package/dist/packages/hooks/useSelection.d.ts +16 -0
  20. package/dist/packages/hooks/useTable.d.ts +54 -0
  21. package/dist/packages/index.d.ts +24 -0
  22. package/dist/packages/utils/common.d.ts +13 -0
  23. package/dist/packages/utils/composables/useGlobalProperties.d.ts +1 -0
  24. package/dist/packages/utils/dayjs.d.ts +2 -0
  25. package/dist/packages/utils/directive.d.ts +2 -0
  26. package/dist/packages/utils/eventBus.d.ts +2 -0
  27. package/dist/packages/utils/index.d.ts +152 -0
  28. package/dist/packages/utils/is/index.d.ts +72 -0
  29. package/dist/packages/utils/validate.d.ts +112 -0
  30. package/dist/src/api/index.d.ts +24 -0
  31. package/dist/src/api/interface/index.d.ts +34 -0
  32. package/dist/src/api/test.d.ts +1 -0
  33. package/dist/src/main.d.ts +0 -0
  34. package/dist/style.css +1 -0
  35. package/dist/vite.config.d.ts +2 -0
  36. package/package.json +151 -0
@@ -0,0 +1,152 @@
1
+ import { FieldNamesProps } from '../components/proTable/interface';
2
+ export declare function resolveRoutePath(basePath: string, routePath?: string): string;
3
+ /**
4
+ * @description 获取localStorage
5
+ * @param {String} key Storage名称
6
+ * @returns {String}
7
+ */
8
+ export declare function localGet(key: string): any;
9
+ /**
10
+ * @description 存储localStorage
11
+ * @param {String} key Storage名称
12
+ * @param {*} value Storage值
13
+ * @returns {void}
14
+ */
15
+ export declare function localSet(key: string, value: any): void;
16
+ /**
17
+ * @description 清除localStorage
18
+ * @param {String} key Storage名称
19
+ * @returns {void}
20
+ */
21
+ export declare function localRemove(key: string): void;
22
+ /**
23
+ * @description 清除所有localStorage
24
+ * @returns {void}
25
+ */
26
+ export declare function localClear(): void;
27
+ /**
28
+ * @description 判断数据类型
29
+ * @param {*} val 需要判断类型的数据
30
+ * @returns {String}
31
+ */
32
+ export declare function isType(val: any): any;
33
+ /**
34
+ * @description 生成唯一 uuid
35
+ * @returns {String}
36
+ */
37
+ export declare function generateUUID(): string;
38
+ /**
39
+ * 判断两个对象是否相同
40
+ * @param {Object} a 要比较的对象一
41
+ * @param {Object} b 要比较的对象二
42
+ * @returns {Boolean} 相同返回 true,反之 false
43
+ */
44
+ export declare function isObjectValueEqual(a: {
45
+ [key: string]: any;
46
+ }, b: {
47
+ [key: string]: any;
48
+ }): boolean;
49
+ /**
50
+ * @description 生成随机数
51
+ * @param {Number} min 最小值
52
+ * @param {Number} max 最大值
53
+ * @returns {Number}
54
+ */
55
+ export declare function randomNum(min: number, max: number): number;
56
+ /**
57
+ * @description 获取当前时间对应的提示语
58
+ * @returns {String}
59
+ */
60
+ export declare function getTimeState(): "早上好 ⛅" | "中午好 🌞" | "下午好 🌞" | "晚上好 🌛" | "凌晨好 🌛";
61
+ /**
62
+ * @description 获取浏览器默认语言
63
+ * @returns {String}
64
+ */
65
+ export declare function getBrowserLang(): string;
66
+ /**
67
+ * @description 使用递归扁平化菜单,方便添加动态路由
68
+ * @param {Array} menuList 菜单列表
69
+ * @returns {Array}
70
+ */
71
+ export declare function getFlatMenuList(menuList: any[]): any[];
72
+ /**
73
+ * @description 使用递归过滤出需要渲染在左侧菜单的列表 (需剔除 isHide == true 的菜单)
74
+ * @param {Array} menuList 菜单列表
75
+ * @returns {Array}
76
+ * */
77
+ export declare function getShowMenuList(menuList: any[]): any[];
78
+ /**
79
+ * @description 使用递归找出所有面包屑存储到 pinia/vuex 中
80
+ * @param {Array} menuList 菜单列表
81
+ * @param {Array} parent 父级菜单
82
+ * @param {Object} result 处理后的结果
83
+ * @returns {Object}
84
+ */
85
+ export declare const getAllBreadcrumbList: (menuList: any[], parent?: any[], result?: {
86
+ [key: string]: any;
87
+ }) => {
88
+ [key: string]: any;
89
+ };
90
+ /**
91
+ * @description 使用递归处理路由菜单 path,生成一维数组 (第一版本地路由鉴权会用到,该函数暂未使用)
92
+ * @param {Array} menuList 所有菜单列表
93
+ * @param {Array} menuPathArr 菜单地址的一维数组 ['**','**']
94
+ * @returns {Array}
95
+ */
96
+ export declare function getMenuListPath(menuList: any[], menuPathArr?: string[]): string[];
97
+ /**
98
+ * @description 递归查询当前 path 所对应的菜单对象 (该函数暂未使用)
99
+ * @param {Array} menuList 菜单列表
100
+ * @param {String} path 当前访问地址
101
+ * @returns {Object | null}
102
+ */
103
+ export declare function findMenuByPath(menuList: any[], path: string): any | null;
104
+ /**
105
+ * @description 使用递归过滤需要缓存的菜单 name (该函数暂未使用)
106
+ * @param {Array} menuList 所有菜单列表
107
+ * @param {Array} keepAliveNameArr 缓存的菜单 name ['**','**']
108
+ * @returns {Array}
109
+ * */
110
+ export declare function getKeepAliveRouterName(menuList: any[], keepAliveNameArr?: string[]): string[];
111
+ /**
112
+ * @description 格式化表格单元格默认值 (el-table-column)
113
+ * @param {Number} row 行
114
+ * @param {Number} col 列
115
+ * @param {*} callValue 当前单元格值
116
+ * @returns {String}
117
+ * */
118
+ export declare function formatTableColumn(row: number, col: number, callValue: any): any;
119
+ /**
120
+ * @description 处理值无数据情况
121
+ * @param {*} callValue 需要处理的值
122
+ * @returns {String}
123
+ * */
124
+ export declare function formatValue(callValue: any): any;
125
+ /**
126
+ * @description 处理 prop 为多级嵌套的情况,返回的数据 (列如: prop: user.name)
127
+ * @param {Object} row 当前行数据
128
+ * @param {String} prop 当前 prop
129
+ * @returns {*}
130
+ * */
131
+ export declare function handleRowAccordingToProp(row: {
132
+ [key: string]: any;
133
+ }, prop: string): any;
134
+ /**
135
+ * @description 处理 prop,当 prop 为多级嵌套时 ==> 返回最后一级 prop
136
+ * @param {String} prop 当前 prop
137
+ * @returns {String}
138
+ * */
139
+ export declare function handleProp(prop: string): string;
140
+ /**
141
+ * @description 根据枚举列表查询当需要的数据(如果指定了 label 和 value 的 key值,会自动识别格式化)
142
+ * @param {String} callValue 当前单元格值
143
+ * @param {Array} enumData 字典列表
144
+ * @param {Array} fieldNames label && value && children 的 key 值
145
+ * @param {String} type 过滤类型(目前只有 tag)
146
+ * @returns {String}
147
+ * */
148
+ export declare function filterEnum(callValue: any, enumData?: any, fieldNames?: FieldNamesProps, type?: "tag"): any;
149
+ /**
150
+ * @description 递归查找 callValue 对应的 enum 值
151
+ * */
152
+ export declare function findItemNested(enumData: any, callValue: any, value: string, children: string): any;
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @description: 判断值是否未某个类型
3
+ */
4
+ export declare function is(val: unknown, type: string): boolean;
5
+ /**
6
+ * @description: 是否为函数
7
+ */
8
+ export declare function isFunction<T = Function>(val: unknown): val is T;
9
+ /**
10
+ * @description: 是否已定义
11
+ */
12
+ export declare const isDef: <T = unknown>(val?: T) => val is T;
13
+ /**
14
+ * @description: 是否未定义
15
+ */
16
+ export declare const isUnDef: <T = unknown>(val?: T) => val is T;
17
+ /**
18
+ * @description: 是否为对象
19
+ */
20
+ export declare const isObject: (val: any) => val is Record<any, any>;
21
+ /**
22
+ * @description: 是否为时间
23
+ */
24
+ export declare function isDate(val: unknown): val is Date;
25
+ /**
26
+ * @description: 是否为数值
27
+ */
28
+ export declare function isNumber(val: unknown): val is number;
29
+ /**
30
+ * @description: 是否为AsyncFunction
31
+ */
32
+ export declare function isAsyncFunction<T = any>(val: unknown): val is Promise<T>;
33
+ /**
34
+ * @description: 是否为promise
35
+ */
36
+ export declare function isPromise<T = any>(val: unknown): val is Promise<T>;
37
+ /**
38
+ * @description: 是否为字符串
39
+ */
40
+ export declare function isString(val: unknown): val is string;
41
+ /**
42
+ * @description: 是否为boolean类型
43
+ */
44
+ export declare function isBoolean(val: unknown): val is boolean;
45
+ /**
46
+ * @description: 是否为数组
47
+ */
48
+ export declare function isArray(val: any): val is Array<any>;
49
+ /**
50
+ * @description: 是否客户端
51
+ */
52
+ export declare const isClient: () => boolean;
53
+ /**
54
+ * @description: 是否为浏览器
55
+ */
56
+ export declare const isWindow: (val: any) => val is Window;
57
+ /**
58
+ * @description: 是否为 element 元素
59
+ */
60
+ export declare const isElement: (val: unknown) => val is Element;
61
+ /**
62
+ * @description: 是否为 null
63
+ */
64
+ export declare function isNull(val: unknown): val is null;
65
+ /**
66
+ * @description: 是否为 null || undefined
67
+ */
68
+ export declare function isNullOrUnDef(val: unknown): val is null | undefined;
69
+ /**
70
+ * @description: 是否为 16 进制颜色
71
+ */
72
+ export declare const isHexColor: (str: string) => boolean;
@@ -0,0 +1,112 @@
1
+ /**
2
+ * @param {string} path
3
+ * @returns {Boolean}
4
+ */
5
+ export declare function isExternal(path: any): boolean;
6
+ /**
7
+ *@description '密码不能低于8位数,并且包含英文字母'
8
+ * @param str
9
+ */
10
+ export declare function isValidPwd(str: any): boolean;
11
+ /**
12
+ *@description 验证用户名格式 3-15个字母或数字
13
+ * @param str
14
+ */
15
+ export declare function isValidUsername(str: any): boolean;
16
+ /**
17
+ *@description 验证角色名称 2-20个字母或数字
18
+ * @param str
19
+ */
20
+ export declare function isValidRoleName(str: any): boolean;
21
+ /**
22
+ *@description 验证角色唯一标识 1-50个字母或数字
23
+ * @param str
24
+ */
25
+ export declare function isValidRoleSign(str: any): boolean;
26
+ /**
27
+ *@description 验证组织编码格式 1-50个字母或数字
28
+ * @param str
29
+ */
30
+ export declare function isValidOrgCode(str: any): boolean;
31
+ /**
32
+ * @description 验证URL地址格式
33
+ * @param str
34
+ * @returns {boolean}
35
+ */
36
+ export declare function isValidUrl(str: any): boolean;
37
+ /**
38
+ * @description 判断是否全部小写
39
+ * @param str
40
+ * @returns {boolean}
41
+ */
42
+ export declare function isLowerCase(str: any): boolean;
43
+ /**
44
+ * @description 判断是否全部大写
45
+ * @param str
46
+ * @returns {boolean}
47
+ */
48
+ export declare function isUpperCase(str: any): boolean;
49
+ /**
50
+ * @description 判断是否全为字母
51
+ * @param str
52
+ * @returns {boolean}
53
+ */
54
+ export declare function isAlphabets(str: any): boolean;
55
+ /**
56
+ * @description 判断是否全为数字
57
+ * @param str
58
+ * @returns {boolean}
59
+ */
60
+ export declare function isDigital(str: any): boolean;
61
+ /**
62
+ * @description 判断是否为正整数和浮点数
63
+ * @param str
64
+ * @returns {boolean}
65
+ */
66
+ export declare function isFloating(str: any): boolean;
67
+ /**
68
+ * @description 不能包含中文和特殊字符
69
+ * @param str
70
+ * @returns {boolean}
71
+ */
72
+ export declare function isSpecial(str: any): boolean;
73
+ /**
74
+ * @description 正负数、正负浮点数
75
+ * @param str
76
+ * @returns {boolean}
77
+ */
78
+ export declare function isPositive(str: any): boolean;
79
+ /**
80
+ * @description 判断是否有中文(也包含日文和韩文)
81
+ * @param str
82
+ * @returns {boolean}
83
+ */
84
+ export declare function isCharacter(str: any): boolean;
85
+ /**
86
+ * @description 判断是否为电话号码
87
+ * @param str
88
+ * @returns {boolean}
89
+ */
90
+ export declare function isPhoneNumber(str: any): boolean;
91
+ export declare function isTelephoneNumber(str: any): boolean;
92
+ export declare function validPhone(rule: any, value: any, callback: any): void;
93
+ /**
94
+ * 判断是否为邮箱
95
+ * @param string $email
96
+
97
+ * @param boolean
98
+ */
99
+ export declare function isEmail(str: any): boolean;
100
+ /**
101
+ * 验证数据源名称格式
102
+ * @param string $email
103
+
104
+ * @param boolean
105
+ */
106
+ export declare function isDatasourceName(str: any): boolean;
107
+ /**
108
+ * @description 判断是否为中文,字母,数字组成(非特殊字符)
109
+ * @param str
110
+ * @returns {boolean}
111
+ */
112
+ export declare function isNonSpecial(str: any): boolean;
@@ -0,0 +1,24 @@
1
+ import { AxiosInstance, AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from 'axios';
2
+ export interface CustomInternalAxiosRequestConfig extends InternalAxiosRequestConfig {
3
+ loading?: boolean;
4
+ msg?: boolean;
5
+ }
6
+ export interface CustomAxiosResponse extends AxiosResponse {
7
+ config: CustomInternalAxiosRequestConfig;
8
+ data: any;
9
+ }
10
+ export interface CustomAxiosRequestConfig extends AxiosRequestConfig {
11
+ loading?: boolean;
12
+ msg?: boolean;
13
+ }
14
+ declare class RequestHttp {
15
+ service: AxiosInstance;
16
+ constructor(config: AxiosRequestConfig);
17
+ get<T>(url: string, params?: object, _object?: {}): Promise<T>;
18
+ post<T>(url: string, params?: object | string, _object?: {}): Promise<T>;
19
+ put<T>(url: string, params?: object, _object?: {}): Promise<T>;
20
+ delete<T>(url: string, params?: any, _object?: {}): Promise<T>;
21
+ download(url: string, params?: object, _object?: {}): Promise<BlobPart>;
22
+ }
23
+ declare const _default: RequestHttp;
24
+ export default _default;
@@ -0,0 +1,34 @@
1
+ export interface Result {
2
+ code: string;
3
+ msg: string;
4
+ }
5
+ export interface ResultData<T = any> extends Result {
6
+ data: T;
7
+ }
8
+ export interface ResPage<T> {
9
+ list: T[];
10
+ pageNum: number;
11
+ pageSize: number;
12
+ total: number;
13
+ }
14
+ export interface ReqPage {
15
+ pageNum: number;
16
+ pageSize: number;
17
+ }
18
+ export declare namespace Upload {
19
+ interface ResFileUrl {
20
+ fileUrl: string;
21
+ }
22
+ }
23
+ export declare namespace Login {
24
+ interface ReqLoginForm {
25
+ username: string;
26
+ password: string;
27
+ }
28
+ interface ResLogin {
29
+ access_token: string;
30
+ }
31
+ interface ResAuthButtons {
32
+ [key: string]: string[];
33
+ }
34
+ }
@@ -0,0 +1 @@
1
+ export declare const getUserGender: () => Promise<unknown>;
File without changes
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .cursor-move[data-v-2a54c2d3]{cursor:move}
@@ -0,0 +1,2 @@
1
+ declare const _default: () => import('vite').UserConfig;
2
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,151 @@
1
+ {
2
+ "name": "@mc-markets/ui",
3
+ "private": false,
4
+ "version": "1.0.0",
5
+ "type": "module",
6
+ "author": "chenyu",
7
+ "description": "一个功能强大的 Vue 3 UI 组件库,提供完整的 TypeScript 支持",
8
+ "main": "dist/index.js",
9
+ "module": "dist/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.js",
15
+ "types": "./dist/index.d.ts"
16
+ },
17
+ "./style": "./dist/style.css",
18
+ "./dist/style.css": "./dist/style.css",
19
+ "./resolver": "./dist/resolver.js"
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "README.md"
24
+ ],
25
+ "keywords": [
26
+ "vue3",
27
+ "typescript",
28
+ "ui",
29
+ "component",
30
+ "element-plus",
31
+ "pro-table",
32
+ "pro-form",
33
+ "search-form",
34
+ "grid",
35
+ "icon",
36
+ "dialog"
37
+ ],
38
+ "license": "MIT",
39
+ "scripts": {
40
+ "dev": "vite",
41
+ "build": "tsc && vite build",
42
+ "preview": "vite preview",
43
+ "type-check": "vue-tsc --noEmit",
44
+ "lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx --fix",
45
+ "format": "prettier --write .",
46
+ "test": "vitest",
47
+ "test:coverage": "vitest --coverage",
48
+ "prepublishOnly": "npm run build",
49
+ "publish:lib": "node publish.js"
50
+ },
51
+ "dependencies": {
52
+ "@nuxt/kit": "^3.13.2",
53
+ "@vueuse/core": "^9.13.0",
54
+ "@vueuse/integrations": "^9.13.0",
55
+ "axios": "^1.3.5",
56
+ "commitizen": "^4.3.0",
57
+ "dayjs": "^1.11.7",
58
+ "element-plus": "^2.8.3",
59
+ "eruda": "^3.0.0",
60
+ "eslint-config-prettier": "^8.8.0",
61
+ "hotkeys-js": "^3.10.2",
62
+ "lodash-es": "^4.17.21",
63
+ "mitt": "^3.0.0",
64
+ "mockjs": "^1.1.0",
65
+ "npm": "^9.6.6",
66
+ "nprogress": "^0.2.0",
67
+ "path-browserify": "^1.0.1",
68
+ "path-to-regexp": "^6.2.1",
69
+ "pinia": "^2.0.34",
70
+ "pinia-plugin-persist": "^1.0.0",
71
+ "pinia-plugin-persistedstate": "^3.1.0",
72
+ "qs": "^6.11.1",
73
+ "vconsole": "^3.15.0",
74
+ "vue": "^3.2.47",
75
+ "vue-router": "^4.1.6"
76
+ },
77
+ "peerDependencies": {
78
+ "vue": "^3.3.0",
79
+ "element-plus": "^2.8.0"
80
+ },
81
+ "peerDependenciesMeta": {
82
+ "element-plus": {
83
+ "optional": true
84
+ }
85
+ },
86
+ "engines": {
87
+ "node": ">=16.0.0",
88
+ "npm": ">=8.0.0"
89
+ },
90
+ "repository": {
91
+ "type": "git",
92
+ "url": "https://gitee.com/daboluoxigua/npm-pro-ui.git"
93
+ },
94
+ "bugs": {
95
+ "url": "https://gitee.com/daboluoxigua/npm-pro-ui/issues"
96
+ },
97
+ "homepage": "https://gitee.com/daboluoxigua/npm-pro-ui#readme",
98
+ "publishConfig": {
99
+ "access": "public"
100
+ },
101
+ "devDependencies": {
102
+ "@antfu/eslint-config": "^0.38.4",
103
+ "@iconify-json/ep": "^1.1.10",
104
+ "@iconify/vue": "^4.1.1",
105
+ "@types/nprogress": "^0.2.0",
106
+ "@types/path-browserify": "^1.0.0",
107
+ "@types/qs": "^6.9.7",
108
+ "@vitejs/plugin-vue": "^4.1.0",
109
+ "@vitejs/plugin-vue-jsx": "^3.0.1",
110
+ "autoprefixer": "^10.4.14",
111
+ "bumpp": "^9.1.0",
112
+ "cz-conventional-changelog": "^3.3.0",
113
+ "cz-git": "^1.6.1",
114
+ "eslint": "^8.38.0",
115
+ "eslint-plugin-prettier": "^4.2.1",
116
+ "esno": "^0.16.3",
117
+ "fs-extra": "^11.1.1",
118
+ "http-server": "^14.1.1",
119
+ "lint-staged": "^13.2.1",
120
+ "npm-run-all": "^4.1.5",
121
+ "plop": "^3.1.2",
122
+ "postcss-html": "^1.5.0",
123
+ "prettier": "^2.8.8",
124
+ "sass": "^1.62.0",
125
+ "simple-git-hooks": "^2.8.1",
126
+ "sortablejs": "^1.15.0",
127
+ "stylelint": "^15.4.0",
128
+ "stylelint-config-standard": "^32.0.0",
129
+ "stylelint-config-standard-scss": "^8.0.0",
130
+ "stylelint-config-standard-vue": "^1.0.0",
131
+ "stylelint-scss": "^4.6.0",
132
+ "stylelint-stylistic": "^0.4.0",
133
+ "svgo": "^3.0.2",
134
+ "terser": "^5.16.9",
135
+ "typescript": "^5.0.4",
136
+ "unplugin-auto-import": "^0.15.2",
137
+ "unplugin-vue-components": "^0.24.1",
138
+ "vite": "^4.2.1",
139
+ "vite-plugin-banner": "^0.7.0",
140
+ "vite-plugin-compression": "^0.5.1",
141
+ "vite-plugin-dts": "^4.2.1",
142
+ "vite-plugin-mock": "^2.9.6",
143
+ "vite-plugin-pages": "^0.29.0",
144
+ "vite-plugin-spritesmith": "^0.1.1",
145
+ "vite-plugin-svg-icons": "^2.0.1",
146
+ "vite-plugin-vue-inspector": "^3.4.0",
147
+ "vite-plugin-vue-meta-layouts": "^0.2.2",
148
+ "vite-plugin-vue-setup-extend": "^0.4.0",
149
+ "vue-tsc": "^1.2.0"
150
+ }
151
+ }