es-plus-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.
- package/README.md +942 -0
- package/dist/es-plus.js +2160 -0
- package/dist/es-plus.js.map +1 -0
- package/dist/es-plus.umd.cjs +2 -0
- package/dist/es-plus.umd.cjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/src/components/es-dialog/index.d.ts +3 -0
- package/dist/src/components/es-dialog/src/component.vue.d.ts +60 -0
- package/dist/src/components/es-dialog/src/use-dialog.d.ts +15 -0
- package/dist/src/components/es-form/__tests__/es-form.spec.d.ts +1 -0
- package/dist/src/components/es-form/index.d.ts +3 -0
- package/dist/src/components/es-form/src/es-form.vue.d.ts +83 -0
- package/dist/src/components/es-table/index.d.ts +3 -0
- package/dist/src/components/es-table/src/column-item.vue.d.ts +80 -0
- package/dist/src/components/es-table/src/component.vue.d.ts +129 -0
- package/dist/src/components/es-table/src/table-btns.vue.d.ts +19 -0
- package/dist/src/components/svg-icon/index.d.ts +3 -0
- package/dist/src/components/svg-icon/src/svg-icon.vue.d.ts +17 -0
- package/dist/src/composables/use-form-inputs.d.ts +10 -0
- package/dist/src/composables/use-form-layout.d.ts +50 -0
- package/dist/src/composables/use-form-layout.spec.d.ts +1 -0
- package/dist/src/composables/use-form-request.d.ts +18 -0
- package/dist/src/composables/use-table-resize.d.ts +19 -0
- package/dist/src/composables/use-table-selection.d.ts +16 -0
- package/dist/src/composables/use-table-selection.spec.d.ts +1 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/style.d.ts +0 -0
- package/dist/src/types/index.d.ts +147 -0
- package/dist/src/utils/shared.d.ts +17 -0
- package/dist/src/utils/shared.spec.d.ts +1 -0
- package/dist/style.css +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { VNode, RenderFunction } from 'vue';
|
|
2
|
+
import { FormProps, ButtonProps } from 'element-plus';
|
|
3
|
+
|
|
4
|
+
export interface FormItemOption {
|
|
5
|
+
prop: string;
|
|
6
|
+
label: string;
|
|
7
|
+
formtype?: 'Input' | 'Select' | 'datePicker' | 'timePicker' | 'Slider' | 'ColorPicker' | 'Transfer' | 'Cascader' | 'Radio' | 'Checkbox' | 'Switch' | 'Rate' | 'Upload';
|
|
8
|
+
span?: number;
|
|
9
|
+
attrs?: Record<string, unknown>;
|
|
10
|
+
on?: Record<string, unknown>;
|
|
11
|
+
dataOptions?: Array<{
|
|
12
|
+
label: string;
|
|
13
|
+
value: unknown;
|
|
14
|
+
}>;
|
|
15
|
+
isHidden?: (model: Record<string, unknown>, item: FormItemOption, formProps: FormProps) => boolean;
|
|
16
|
+
render?: (h: RenderFunction, model: Record<string, unknown>, ctx: {
|
|
17
|
+
row: FormItemOption;
|
|
18
|
+
index: number;
|
|
19
|
+
}) => VNode | string;
|
|
20
|
+
apiParams?: ApiParams;
|
|
21
|
+
/** 是否在组件初始化时自动加载接口数据,默认 true;设为 false 时需手动调用 formItmeRequestInstance 加载 */
|
|
22
|
+
isInitRun?: boolean;
|
|
23
|
+
callOptionListFormat?: (data: unknown[]) => unknown[];
|
|
24
|
+
/** 自定义 HTTP 请求方法,用于覆盖全局请求配置 */
|
|
25
|
+
httpRequest?: (params: Record<string, unknown>) => Promise<unknown>;
|
|
26
|
+
/** 响应数据回调映射,crtn 用于将 API 响应转换为 dataOptions 格式 */
|
|
27
|
+
listenToCallBack?: Record<string, (params: unknown) => unknown>;
|
|
28
|
+
components?: Record<string, unknown>;
|
|
29
|
+
width?: number | string;
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
32
|
+
export interface ApiParams {
|
|
33
|
+
url: string;
|
|
34
|
+
method?: string;
|
|
35
|
+
headers?: Record<string, string>;
|
|
36
|
+
model?: Record<string, unknown>;
|
|
37
|
+
options?: Record<string, unknown>;
|
|
38
|
+
}
|
|
39
|
+
export interface BtnConfig {
|
|
40
|
+
name: string;
|
|
41
|
+
key?: string;
|
|
42
|
+
type?: ButtonProps['type'];
|
|
43
|
+
size?: ButtonProps['size'];
|
|
44
|
+
icon?: string;
|
|
45
|
+
direction?: 'left' | 'right';
|
|
46
|
+
loading?: boolean;
|
|
47
|
+
disabled?: boolean | (() => boolean);
|
|
48
|
+
click?: (model: Record<string, unknown>, formRef: unknown, httpRequestInstance?: unknown) => void;
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
}
|
|
51
|
+
export interface LayoutFormProps {
|
|
52
|
+
rowLayProps?: Record<string, unknown>;
|
|
53
|
+
fromLayProps?: {
|
|
54
|
+
isBtnHidden?: boolean;
|
|
55
|
+
minFoldRows?: number;
|
|
56
|
+
btnColSpan?: number;
|
|
57
|
+
labelBtnWidth?: string | number;
|
|
58
|
+
};
|
|
59
|
+
setOptions?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface TableColumn {
|
|
62
|
+
prop?: string;
|
|
63
|
+
key?: string;
|
|
64
|
+
label?: string;
|
|
65
|
+
width?: number | string;
|
|
66
|
+
minWidth?: number | string;
|
|
67
|
+
align?: string;
|
|
68
|
+
fixed?: boolean | string;
|
|
69
|
+
formatter?: (row: Record<string, unknown>) => string;
|
|
70
|
+
render?: (h: RenderFunction, ctx: {
|
|
71
|
+
row: Record<string, unknown>;
|
|
72
|
+
value: unknown;
|
|
73
|
+
index: number;
|
|
74
|
+
}) => VNode | string;
|
|
75
|
+
scopedSlots?: {
|
|
76
|
+
customRender?: string;
|
|
77
|
+
};
|
|
78
|
+
groups?: TableColumn[];
|
|
79
|
+
ellipsis?: boolean;
|
|
80
|
+
hidCol?: boolean;
|
|
81
|
+
btns?: Array<{
|
|
82
|
+
name: string;
|
|
83
|
+
type?: string;
|
|
84
|
+
clickEvent?: (row: Record<string, unknown>) => void;
|
|
85
|
+
}>;
|
|
86
|
+
[key: string]: unknown;
|
|
87
|
+
}
|
|
88
|
+
export interface TableOptions {
|
|
89
|
+
multiSelect?: boolean;
|
|
90
|
+
expand?: boolean;
|
|
91
|
+
snIndex?: boolean;
|
|
92
|
+
loading?: boolean;
|
|
93
|
+
border?: boolean;
|
|
94
|
+
stripe?: boolean;
|
|
95
|
+
size?: 'large' | 'default' | 'small';
|
|
96
|
+
headerCellStyle?: Record<string, unknown>;
|
|
97
|
+
highlightCurrentRow?: boolean;
|
|
98
|
+
cachePageSelection?: boolean;
|
|
99
|
+
heightType?: 'auto' | 'height';
|
|
100
|
+
tabHeight?: number | string;
|
|
101
|
+
isInitRun?: boolean;
|
|
102
|
+
actionUrl?: string;
|
|
103
|
+
apiParams?: ApiParams;
|
|
104
|
+
httpRequest?: (params: Record<string, unknown>) => Promise<unknown>;
|
|
105
|
+
listenToCallBack?: Record<string, (params: unknown) => unknown>;
|
|
106
|
+
configTableOut?: Record<string, string>;
|
|
107
|
+
entryQuery?: Record<string, unknown>;
|
|
108
|
+
rowkey?: string;
|
|
109
|
+
[key: string]: unknown;
|
|
110
|
+
}
|
|
111
|
+
export interface PaginationConfig {
|
|
112
|
+
pageSize?: number;
|
|
113
|
+
current?: number;
|
|
114
|
+
total?: number;
|
|
115
|
+
pageSizes?: number[];
|
|
116
|
+
size?: 'large' | 'default' | 'small';
|
|
117
|
+
isSmall?: boolean;
|
|
118
|
+
}
|
|
119
|
+
export interface DialogOptions {
|
|
120
|
+
title?: string;
|
|
121
|
+
width?: string | number;
|
|
122
|
+
render?: (h: RenderFunction, instance: unknown, components: Record<string, unknown>) => VNode;
|
|
123
|
+
renderHeader?: (h: RenderFunction, instance: unknown) => VNode;
|
|
124
|
+
renderFooter?: (h: RenderFunction, instance: unknown) => VNode;
|
|
125
|
+
configBtn?: BtnConfig[];
|
|
126
|
+
onSubmit?: (close: () => void) => void;
|
|
127
|
+
onClosed?: () => void;
|
|
128
|
+
isDraggable?: boolean;
|
|
129
|
+
hiddenFullBtn?: boolean;
|
|
130
|
+
isHiddenFooter?: boolean;
|
|
131
|
+
maxHeight?: string | number;
|
|
132
|
+
appendTo?: string | HTMLElement;
|
|
133
|
+
fullscreen?: boolean;
|
|
134
|
+
[key: string]: unknown;
|
|
135
|
+
}
|
|
136
|
+
export interface EsFormInstance {
|
|
137
|
+
validate: () => Promise<boolean>;
|
|
138
|
+
resetFields: () => void;
|
|
139
|
+
clearValidate: () => void;
|
|
140
|
+
}
|
|
141
|
+
export interface EsTableInstance {
|
|
142
|
+
httpRequestInstance: (model?: Record<string, unknown>) => Promise<unknown>;
|
|
143
|
+
clearSelection: () => void;
|
|
144
|
+
toggleRowSelection: (row: Record<string, unknown>, selected?: boolean) => void;
|
|
145
|
+
clearAllSelection: () => void;
|
|
146
|
+
refresh: () => void;
|
|
147
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const isObject: (value: unknown) => value is Record<string, unknown>;
|
|
2
|
+
export declare const isArray: (value: unknown) => value is unknown[];
|
|
3
|
+
export declare const isFunction: (value: unknown) => value is Function;
|
|
4
|
+
export declare const isString: (value: unknown) => value is string;
|
|
5
|
+
export declare const isNumber: (value: unknown) => value is number;
|
|
6
|
+
export declare const isEmpty: (value: unknown) => boolean;
|
|
7
|
+
export declare const firstWordUpperCase: (str: string) => string;
|
|
8
|
+
export declare const kebabToCamel: (str: string) => string;
|
|
9
|
+
export declare const toPascalCase: (str: string) => string;
|
|
10
|
+
export declare const findValueByKey: (obj: Record<string, unknown>, key: string, depth?: number) => unknown;
|
|
11
|
+
export declare const wrapPromise: <T>(promise: Promise<T>) => Promise<{
|
|
12
|
+
status: "fulfilled";
|
|
13
|
+
value: T;
|
|
14
|
+
} | {
|
|
15
|
+
status: "rejected";
|
|
16
|
+
reason: unknown;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.btns[data-v-8e62c688]{padding:0 0 5px;display:flex;justify-content:space-between;align-items:center}.left-text[data-v-8e62c688]{color:#7d7d7d;font-size:14px}.btn-container_block[data-v-8e62c688]{display:flex;justify-content:space-between;align-items:center;flex:1}.btn-container_block .btn-left[data-v-8e62c688]{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.btn-container_block .btn-right[data-v-8e62c688]{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap}@media (max-width: 768px){.btns[data-v-8e62c688]{flex-direction:column;align-items:flex-start}.btn-container_block[data-v-8e62c688]{flex-direction:column;align-items:flex-start;gap:10px}.btn-container_block .btn-left[data-v-8e62c688],.btn-container_block .btn-right[data-v-8e62c688]{width:100%;justify-content:flex-start}}.el-dp_tables[data-v-a655f407],.el-dp_tables[data-v-a655f407] .el-table__body-wrapper{height:auto}.table_component[data-v-a655f407]{width:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-start;overflow:hidden}.table_containers[data-v-a655f407]{flex:1;width:100%;height:100%;display:flex;justify-content:space-between;flex-direction:column;align-items:flex-start;position:relative}.pagination_page[data-v-a655f407]{width:100%;display:flex;justify-content:center;align-items:center}.btn-slot[data-v-a655f407]{width:100%}.btn-slot .headerBar[data-v-a655f407]{box-sizing:border-box;background-color:#fff;border-radius:6px}.btn-slot .headerBar[data-v-a655f407] .el-form-item--small .el-form-item__label{box-sizing:border-box}.tableContainer[data-v-a655f407]{border-radius:0;transition:all 1.5s;flex:1;width:100%;display:flex;justify-content:space-between;flex-direction:column;align-items:flex-start}.tableContainer .table_inner_containers[data-v-a655f407]{width:100%}.tableContainer[data-v-a655f407] .el-table__empty-block{width:100%!important;margin:32px 0;font-size:14px;line-height:1.5715}.tableContainer[data-v-a655f407] .el-table__empty-block .el-table__empty-text{width:auto!important}.tableContainer[data-v-a655f407] .el-table__empty-block .ant-empty-image{height:40px;margin-bottom:8px}.tableContainer[data-v-a655f407] .el-table__empty-block .ant-empty-image .ant-empty-img-simple-ellipse{fill:#f5f5f5}.tableContainer[data-v-a655f407] .el-table__empty-block .ant-empty-image .ant-empty-img-simple-g{stroke:#d9d9d9}.tableContainer[data-v-a655f407] .el-table__empty-block .ant-empty-image .ant-empty-img-simple-path{fill:#fafafa}.tableContainer[data-v-a655f407] .el-table__empty-block .ant-empty-description{line-height:1.5715;color:#00000040}.tableContainer[data-v-a655f407] .el-tag{height:20px;padding:0 7px;line-height:20px;background:#fafafa;border:none;border-radius:4px}.tableContainer[data-v-a655f407] .el-tag.el-tag--info{color:#000000d9}.tableContainer[data-v-a655f407] .el-tag.el-tag--success{color:#52c41a;background:#f6ffed;border-color:#b7eb8f}.es-form[data-v-767c4265] .el-form-item{margin-bottom:18px}.es-form[data-v-767c4265] .el-form-item__label{font-weight:500}.es-form .buttonOperate[data-v-767c4265]{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.es-form .leftRightBtn[data-v-767c4265]{display:flex;justify-content:space-between;align-items:center;width:100%}.es-form .leftRightBtn .btn-left[data-v-767c4265],.es-form .leftRightBtn .btn-right[data-v-767c4265]{display:flex;align-items:center}.es-form .btn-formItem[data-v-767c4265]{margin-bottom:0}.es-form .formItemCols[data-v-767c4265]{width:100%}.dp-dialog_wrapper[data-v-857351a8] .dialogAuto{margin:0!important}.dp-dialog_wrapper[data-v-857351a8] .el-overlay-dialog{display:flex;justify-content:center;align-items:center}.dp-dialog_wrapper[data-v-857351a8] .el-dialog{padding:10px}.dp-dialog_wrapper[data-v-857351a8] .el-dialog .el-dialog__footer{padding-top:0}.dp-dialog_wrapper[data-v-857351a8] .el-dialog .el-dialog__body{padding:10px 0}.dp-dialog_wrapper[data-v-857351a8] .el-dialog .el-dialog__header{border-bottom:1px solid #eee;display:flex;padding:0 0 10px;align-items:center;justify-content:space-between;margin:0}.dialog-title[data-v-857351a8]{line-height:24px;font-size:14px;color:#303133;font-weight:700}.btns[data-v-857351a8]{display:flex;align-items:center}.btns i[data-v-857351a8]{margin-right:8px;font-size:14px;cursor:pointer}.btns i[data-v-857351a8]:last-child{margin-right:0}.dialog_body_layouts[data-v-857351a8]{overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:rgba(135,162,189,.1490196078) rgba(200,213,225,.2784313725)}[data-v-857351a8]::-webkit-scrollbar{width:14px;height:14px}[data-v-857351a8]::-webkit-scrollbar-button{width:0;height:0;display:none}[data-v-857351a8]::-webkit-scrollbar-corner{background-color:transparent}[data-v-857351a8]::-webkit-scrollbar-thumb{min-height:12px;border:4px solid transparent;background-clip:content-box;border-radius:7px;background-color:#c8d5e1}[data-v-857351a8]::-webkit-scrollbar-thumb:hover{background-color:#a8bbcf}[data-v-857351a8]::-webkit-scrollbar-thumb:active{background-color:#87a2bd}[data-v-857351a8]::-webkit-scrollbar-track{background-color:transparent}[data-v-857351a8]::-webkit-scrollbar-track-piece{background-color:transparent}.svg-icon[data-v-3a11db57]{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}.svg-external-icon[data-v-3a11db57]{background-color:currentColor;-webkit-mask-size:cover!important;mask-size:cover!important;display:inline-block}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "es-plus-ui",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "基于 Vue 3 和 Element Plus 的企业级中后台前端组件库",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/es-plus.umd.cjs",
|
|
7
|
+
"module": "./dist/es-plus.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/es-plus.js",
|
|
12
|
+
"require": "./dist/es-plus.umd.cjs",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./dist/style.css": "./dist/style.css"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"**/*.css"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "vite build",
|
|
26
|
+
"prepublishOnly": "echo 'Skipping build, already built'",
|
|
27
|
+
"test": "vitest",
|
|
28
|
+
"test:ui": "vitest --ui",
|
|
29
|
+
"test:coverage": "vitest --coverage"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"vue3",
|
|
33
|
+
"vue",
|
|
34
|
+
"element-plus",
|
|
35
|
+
"component-library",
|
|
36
|
+
"form",
|
|
37
|
+
"table",
|
|
38
|
+
"dialog",
|
|
39
|
+
"es-plus",
|
|
40
|
+
"typescript",
|
|
41
|
+
"enterprise",
|
|
42
|
+
"config-driven",
|
|
43
|
+
"crud"
|
|
44
|
+
],
|
|
45
|
+
"author": "",
|
|
46
|
+
"license": "MIT",
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public",
|
|
49
|
+
"registry": "https://registry.npmjs.org/"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"vue": "^3.2.0",
|
|
53
|
+
"element-plus": "^2.2.0",
|
|
54
|
+
"@element-plus/icons-vue": "^2.1.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@vitejs/plugin-vue": "^5.0.0",
|
|
58
|
+
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
|
59
|
+
"@vue/test-utils": "^2.4.0",
|
|
60
|
+
"happy-dom": "^14.0.0",
|
|
61
|
+
"sass": "^1.70.0",
|
|
62
|
+
"typescript": "^5.3.0",
|
|
63
|
+
"vite": "^5.0.0",
|
|
64
|
+
"vite-plugin-dts": "^3.7.0",
|
|
65
|
+
"vitest": "^1.2.0",
|
|
66
|
+
"vue": "^3.4.0",
|
|
67
|
+
"vue-tsc": "^1.8.0",
|
|
68
|
+
"element-plus": "^2.5.0"
|
|
69
|
+
}
|
|
70
|
+
}
|